From 8b872bc1b3deb39a267714cd031e2ea4a09ff690 Mon Sep 17 00:00:00 2001 From: Savage Fivetran Date: Thu, 10 Sep 2026 15:00:42 -0700 Subject: [PATCH 01/11] feature/add-journey-models --- .gitignore | 1 + .quickstart/quickstart.yml | 8 + CHANGELOG.md | 15 ++ README.md | 8 +- dbt_project.yml | 4 +- integration_tests/ci/test_scenarios.yml | 2 + integration_tests/dbt_project.yml | 11 +- integration_tests/seeds/journey_data.csv | 5 + .../consistency/consistency_journeys.sql | 51 ++++++ macros/staging/get_journey_columns.sql | 25 +++ models/intermediate/int_iterable.yml | 3 + .../int_iterable__journey_event_metrics.sql | 47 ++++++ .../int_iterable__recurring_campaigns.sql | 5 + models/iterable.yml | 148 +++++++++++++++++- models/iterable__campaigns.sql | 18 +++ models/iterable__journeys.sql | 72 +++++++++ models/staging/src_iterable.yml | 33 ++++ models/staging/stg_iterable.yml | 36 +++++ models/staging/stg_iterable__journey.sql | 54 +++++++ .../staging/tmp/stg_iterable__journey_tmp.sql | 9 ++ 20 files changed, 550 insertions(+), 5 deletions(-) create mode 100644 integration_tests/seeds/journey_data.csv create mode 100644 integration_tests/tests/consistency/consistency_journeys.sql create mode 100644 macros/staging/get_journey_columns.sql create mode 100644 models/intermediate/int_iterable__journey_event_metrics.sql create mode 100644 models/iterable__journeys.sql create mode 100644 models/staging/stg_iterable__journey.sql create mode 100644 models/staging/tmp/stg_iterable__journey_tmp.sql diff --git a/.gitignore b/.gitignore index 96e0d5c..6ea9caf 100644 --- a/.gitignore +++ b/.gitignore @@ -74,3 +74,4 @@ venv.bak/ # Claude instructions CLAUDE.md +.claude/ diff --git a/.quickstart/quickstart.yml b/.quickstart/quickstart.yml index a302447..d4532ab 100644 --- a/.quickstart/quickstart.yml +++ b/.quickstart/quickstart.yml @@ -12,6 +12,8 @@ table_variables: - user_unsubscribed_message_type iterable__using_event_extension: - event_extension + iterable__using_journey: + - journey _fivetran_quickstart_list_user: - list_user @@ -31,6 +33,7 @@ destination_configurations: public_models: [ "iterable__events", "iterable__campaigns", + "iterable__journeys", "iterable__user_unsubscriptions", "iterable__users", "iterable__user_campaign", @@ -43,6 +46,11 @@ supported_vars: description: "Additional `EVENT_EXTENSION` fields to include in `iterable__events`" display_name: "Additional Event Extension Columns" + iterable_journey_pass_through_columns: + type: dictionary + description: "Additional `JOURNEY` fields to include in `iterable__journeys`" + display_name: "Additional Journey Columns" + iterable_user_history_pass_through_columns: type: dictionary description: "Additional `USER_HISTORY` fields to include in `iterable__users` and `iterable__list_user_history`" diff --git a/CHANGELOG.md b/CHANGELOG.md index 74fc419..0355e21 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,18 @@ +# dbt_iterable v1.6.0 + +[PR #84](https://github.com/fivetran/dbt_iterable/pull/84) includes the following updates: + +## Schema/Data Change +**5 total changes • 0 possible breaking changes** + +| Data Model(s) | Change type | Old | New | Notes | +| ------------- | ----------- | --- | --- | ----- | +| `iterable__journeys` | New model | | | Journey-grain rollup of engagement metrics, unique users, and derived rates. | +| `iterable__campaigns` | New fields | | `journey_id`, `journey_name`, `journey_type` | | +| `int_iterable__journey_event_metrics` | New model | | | Aggregates campaign engagement metrics to the journey grain. | +| `int_iterable__recurring_campaigns` | New field | | `journey_id` | | +| `stg_iterable__journey` | New model | | | Staging model for the new `journey` source table. | + # dbt_iterable v1.5.1 [PR #83](https://github.com/fivetran/dbt_iterable/pull/83) includes the following updates: diff --git a/README.md b/README.md index 55090ad..a66fcbd 100644 --- a/README.md +++ b/README.md @@ -36,6 +36,7 @@ By default, this package materializes the following final tables: | [iterable__events](https://fivetran.github.io/dbt_iterable/#!/model/model.iterable.iterable__events) | Tracks all user events with campaign attribution, user details, and channel information to analyze user behavior, conversion paths, and campaign effectiveness at the event level. See [tracked events details](https://fivetran.com/docs/applications/iterable#schemanotes).

**Example Analytics Questions:**| | [iterable__user_campaign](https://fivetran.github.io/dbt_iterable/#!/model/model.iterable.iterable__user_campaign) | Aggregates user-level engagement with specific campaigns and experiment variations including event counts by type to measure individual user responses to campaign messaging.

**Example Analytics Questions:**| | [iterable__campaigns](https://fivetran.github.io/dbt_iterable/#!/model/model.iterable.iterable__campaigns) | Tracks campaign performance with user interaction metrics, event counts, experiment variations, and template details to measure campaign effectiveness and optimize email strategy.

**Example Analytics Questions:**| +| [iterable__journeys](https://fivetran.github.io/dbt_iterable/#!/model/model.iterable.iterable__journeys) | Tracks journey performance with engagement metrics, unique user counts, and derived engagement rates rolled up from the campaigns belonging to each journey, so you can measure which automated sequences actually work. Journeys that send no messages, such as audience splits, are still included.

**Example Analytics Questions:**| | [iterable__users](https://fivetran.github.io/dbt_iterable/#!/model/model.iterable.iterable__users) | Provides a comprehensive view of each user with campaign engagement history, list memberships, unsubscription status, and interaction metrics to understand user preferences and lifetime engagement.

**Example Analytics Questions:**| | [iterable__list_user_history](https://fivetran.github.io/dbt_iterable/#!/model/model.iterable.iterable__list_user_history) | Chronicles user-list membership history to track when users join or leave lists, manage audience segmentation, and analyze list growth without excessive Monthly Active Rows (MAR) usage.

**Example Analytics Questions:**| | [iterable__user_unsubscriptions](https://fivetran.github.io/dbt_iterable/#!/model/model.iterable.iterable__user_unsubscriptions) | Tracks all user unsubscriptions by message type and channel to manage communication preferences, protect sender reputation, and identify unsubscribe patterns.

**Example Analytics Questions:**| @@ -133,15 +134,18 @@ vars: iterable__using_user_unsubscribed_message_type_history: false # default is true iterable__using_campaign_suppression_list_history: false # default is true iterable__using_event_extension: false # default is true + iterable__using_journey: false # default is true ``` ### (Optional) Additional configurations #### Passing Through Additional Fields -This package includes fields we judged were standard across Iterable users. However, the Fivetran connector allows for additional columns to be brought through in the `event_extension` and `user_history` objects. Therefore, if you wish to bring them through, leverage our passthrough column variables. For `event_extension` columns, ensure that `iterable__using_event_extension` is set to True, which is the default. +This package includes fields we judged were standard across Iterable users. However, the Fivetran connector allows for additional columns to be brought through in the `event_extension`, `journey`, and `user_history` objects. Therefore, if you wish to bring them through, leverage our passthrough column variables. For `event_extension` columns, ensure that `iterable__using_event_extension` is set to True, which is the default. The same applies to `iterable__using_journey` for `journey` columns. -You will see these additional columns populate in the end `iterable__list_user_history`, `iterable__events`, and `iterable__users` models. +You will see these additional columns populate in the end `iterable__list_user_history`, `iterable__events`, `iterable__journeys`, and `iterable__users` models. + +The `journey` object includes a set of `draft_*` fields whose exact names vary by connection, so they are not included by default. Use `iterable_journey_pass_through_columns` to bring through the specific draft fields you need. **Notice**: A `dbt run --full-refresh` is required each time these variables are edited. diff --git a/dbt_project.yml b/dbt_project.yml index 449f7ef..5e9ee40 100644 --- a/dbt_project.yml +++ b/dbt_project.yml @@ -1,6 +1,6 @@ name: 'iterable' -version: '1.5.1' +version: '1.6.0' config-version: 2 require-dbt-version: [">=1.3.0", "<3.0.0"] models: @@ -26,6 +26,7 @@ vars: channel: "{{ source('iterable', 'channel') }}" event: "{{ source('iterable', 'event') }}" event_extension: "{{ source('iterable', 'event_extension') }}" + journey: "{{ source('iterable', 'journey') }}" list: "{{ source('iterable', 'list') }}" list_user: "{{ source('iterable', 'list_user') }}" message_type: "{{ source('iterable', 'message_type') }}" @@ -38,6 +39,7 @@ vars: user_unsubscribed_message_type_history: "{{ source('iterable', 'user_unsubscribed_message_type_history') }}" iterable_event_extension_pass_through_columns: [] + iterable_journey_pass_through_columns: [] iterable_user_history_pass_through_columns: [] iterable__event_metrics: diff --git a/integration_tests/ci/test_scenarios.yml b/integration_tests/ci/test_scenarios.yml index ae1b77d..ca95413 100644 --- a/integration_tests/ci/test_scenarios.yml +++ b/integration_tests/ci/test_scenarios.yml @@ -28,6 +28,7 @@ test_scenarios: vars: iterable_user_history_pass_through_columns: '[{"name": "phone_number_updated_at"}]' iterable_event_extension_pass_through_columns: '[{"name": "web_push_message"}]' + iterable_journey_pass_through_columns: '[{"name": "draft_name"}]' include_incremental: false - name: "features disabled" @@ -36,6 +37,7 @@ test_scenarios: iterable__using_user_unsubscribed_message_type_history: false iterable__using_campaign_suppression_list_history: false iterable__using_event_extension: false + iterable__using_journey: false include_incremental: true - name: "MDLS" diff --git a/integration_tests/dbt_project.yml b/integration_tests/dbt_project.yml index 779abf4..0464478 100644 --- a/integration_tests/dbt_project.yml +++ b/integration_tests/dbt_project.yml @@ -1,6 +1,6 @@ config-version: 2 name: 'iterable_integration_tests' -version: '1.5.1' +version: '1.6.0' profile: 'integration_tests' vars: iterable: @@ -59,6 +59,15 @@ seeds: +column_types: payload: "{{ 'varchar(100)' if target.type in ('redshift', 'postgres') else 'string'}}" _fivetran_synced: timestamp + journey_data: + +column_types: + id: "{%- if target.type == 'bigquery' -%} INT64 {%- else -%} bigint {%- endif -%}" + lifetime_limit: "{%- if target.type == 'bigquery' -%} INT64 {%- else -%} bigint {%- endif -%}" + simultaneous_limit: "{%- if target.type == 'bigquery' -%} INT64 {%- else -%} bigint {%- endif -%}" + start_tile_id: "{%- if target.type == 'bigquery' -%} INT64 {%- else -%} bigint {%- endif -%}" + created_at: timestamp + updated_at: timestamp + _fivetran_synced: timestamp list_data: +column_types: _fivetran_synced: timestamp diff --git a/integration_tests/seeds/journey_data.csv b/integration_tests/seeds/journey_data.csv new file mode 100644 index 0000000..1c37ea0 --- /dev/null +++ b/integration_tests/seeds/journey_data.csv @@ -0,0 +1,5 @@ +id,name,journey_type,description,creator_user_id,enabled,is_archived,lifetime_limit,simultaneous_limit,start_tile_id,trigger_event_names,created_at,updated_at,_fivetran_synced,draft_name +157274,Welcome Series,Triggered,Onboarding sequence sent to new subscribers over their first week,jimmy.neutron@goddard.com,true,false,1,1,44001,"[""signUp""]",2021-06-01 09:14:22.000,2021-06-11 13:30:58.412,2021-06-11 13:32:03.771,Welcome Series draft +28801,Automation,Triggered,Behavioral automation triggered by in-app activity,jimmy.neutron@goddard.com,true,false,5,2,44002,"[""customEvent"",""emailOpen""]",2021-05-18 11:02:47.000,2021-06-09 17:45:10.220,2021-06-11 13:32:03.771,Automation draft +83250,Workflow - Survey,Blast,Post-purchase survey invitation,carl.wheezer@goddard.com,true,false,,1,44003,"[""purchase""]",2021-04-27 15:39:05.000,2021-06-02 08:21:36.905,2021-06-11 13:32:03.771, +900001,Audience Split - Dormant Users,Triggered,Splits dormant users into re-engagement branches and updates their profile fields. Sends no messages.,carl.wheezer@goddard.com,false,true,,,44004,[],2021-03-15 10:00:00.000,2021-05-20 12:11:44.310,2021-06-11 13:32:03.771, diff --git a/integration_tests/tests/consistency/consistency_journeys.sql b/integration_tests/tests/consistency/consistency_journeys.sql new file mode 100644 index 0000000..a5d71e5 --- /dev/null +++ b/integration_tests/tests/consistency/consistency_journeys.sql @@ -0,0 +1,51 @@ +{{ config( + tags="fivetran_validations", + enabled=var('fivetran_validation_tests_enabled', false) +) }} + +{% set exclude_cols = ['trigger_event_names'] + var('consistency_test_exclude_metrics', []) %} +{% set fields = dbt_utils.star(from=ref('iterable__journeys'), except=exclude_cols) %} + +-- this test ensures the iterable__journeys end model matches the prior version +with prod as ( + select {{ fields }} + from {{ target.schema }}_iterable_prod.iterable__journeys + where date(updated_at) < date({{ dbt.current_timestamp() }}) +), + +dev as ( + select {{ fields }} + from {{ target.schema }}_iterable_dev.iterable__journeys + where date(updated_at) < date({{ dbt.current_timestamp() }}) +), + +prod_not_in_dev as ( + -- rows from prod not found in dev + select * from prod + except distinct + select * from dev +), + +dev_not_in_prod as ( + -- rows from dev not found in prod + select * from dev + except distinct + select * from prod +), + +final as ( + select + *, + 'from prod' as source + from prod_not_in_dev + + union all -- union since we only care if rows are produced + + select + *, + 'from dev' as source + from dev_not_in_prod +) + +select * +from final diff --git a/macros/staging/get_journey_columns.sql b/macros/staging/get_journey_columns.sql new file mode 100644 index 0000000..2297bf3 --- /dev/null +++ b/macros/staging/get_journey_columns.sql @@ -0,0 +1,25 @@ +{% macro get_journey_columns() %} + +{% set columns = [ + {"name": "_fivetran_deleted", "datatype": "boolean"}, + {"name": "_fivetran_synced", "datatype": dbt.type_timestamp()}, + {"name": "created_at", "datatype": dbt.type_timestamp()}, + {"name": "creator_user_id", "datatype": dbt.type_string()}, + {"name": "description", "datatype": dbt.type_string()}, + {"name": "enabled", "datatype": "boolean"}, + {"name": "id", "datatype": dbt.type_int()}, + {"name": "is_archived", "datatype": "boolean"}, + {"name": "journey_type", "datatype": dbt.type_string()}, + {"name": "lifetime_limit", "datatype": dbt.type_int()}, + {"name": "name", "datatype": dbt.type_string()}, + {"name": "simultaneous_limit", "datatype": dbt.type_int()}, + {"name": "start_tile_id", "datatype": dbt.type_int()}, + {"name": "trigger_event_names", "datatype": dbt.type_string()}, + {"name": "updated_at", "datatype": dbt.type_timestamp()} +] %} + +{{ fivetran_utils.add_pass_through_columns(columns, var('iterable_journey_pass_through_columns')) }} + +{{ return(columns) }} + +{% endmacro %} diff --git a/models/intermediate/int_iterable.yml b/models/intermediate/int_iterable.yml index fd62813..1f5c73d 100644 --- a/models/intermediate/int_iterable.yml +++ b/models/intermediate/int_iterable.yml @@ -11,6 +11,9 @@ models: - name: int_iterable__campaign_lists description: Table that identifies the suppressed and send lists associated with a campaign. + - name: int_iterable__journey_event_metrics + description: Table that generates relevant total and unique journey level aggregations, rolled up from the user/campaign grain via the campaign's journey reference. + - name: int_iterable__latest_campaign description: Table that filters out historical versions of the campaign, and returns the most recent campaign version. diff --git a/models/intermediate/int_iterable__journey_event_metrics.sql b/models/intermediate/int_iterable__journey_event_metrics.sql new file mode 100644 index 0000000..25d5409 --- /dev/null +++ b/models/intermediate/int_iterable__journey_event_metrics.sql @@ -0,0 +1,47 @@ +{{ config(enabled=var('iterable__using_journey', True)) }} + +with user_campaign as ( + select * + from {{ ref('iterable__user_campaign') }} + +), campaign as ( + + select + source_relation, + campaign_id, + journey_id + + from {{ ref('int_iterable__recurring_campaigns') }} + where journey_id is not null + +), journey_event_metrics as ( +{%- set user_campaign_columns = adapter.get_columns_in_relation(ref('iterable__user_campaign')) %} +{%- set non_agg_columns = ['source_relation', 'unique_user_key', 'user_id', '_fivetran_user_id', + 'user_email', 'user_full_name', 'campaign_id', 'campaign_name', 'recurring_campaign_id', + 'recurring_campaign_name', 'first_event_at', 'last_event_at', 'template_id', 'template_name', + 'experiment_id', 'unique_user_campaign_id', 'first_open_or_click_event_at' + ] %} + + select + campaign.source_relation, + campaign.journey_id, + count(distinct user_campaign.campaign_id) as count_total_campaigns, + count(distinct user_campaign.unique_user_key) as count_unique_users, + min(user_campaign.first_event_at) as first_event_at, + max(user_campaign.last_event_at) as last_event_at + {% for col in user_campaign_columns if col.name|lower not in non_agg_columns %} + , sum(user_campaign.{{ col.name }}) as {{ col.name }} + , count(distinct case when user_campaign.{{ col.name }} > 0 then user_campaign.user_email else null end) as unique_{{ col.name }} + {% endfor %} + + from user_campaign + + inner join campaign + on user_campaign.campaign_id = campaign.campaign_id + and user_campaign.source_relation = campaign.source_relation + + {{ dbt_utils.group_by(n=2) }} +) + +select * +from journey_event_metrics diff --git a/models/intermediate/int_iterable__recurring_campaigns.sql b/models/intermediate/int_iterable__recurring_campaigns.sql index a7cae5e..a885594 100644 --- a/models/intermediate/int_iterable__recurring_campaigns.sql +++ b/models/intermediate/int_iterable__recurring_campaigns.sql @@ -18,6 +18,11 @@ with latest_campaign as ( latest_campaign.created_by_user_id, latest_campaign.template_id, latest_campaign.recurring_campaign_id, + {% if var('iterable__using_journey', true) %} + -- cast to string so this matches journey_id in stg_iterable__journey; workflow_id arrives + -- numeric from campaign_history but as a string from event_extension + cast(latest_campaign.workflow_id as {{ dbt.type_string() }}) as journey_id, + {% endif %} recurring_campaign.campaign_name as recurring_campaign_name, recurring_campaign.campaign_state as recurring_campaign_state, diff --git a/models/iterable.yml b/models/iterable.yml index a289922..9dc6354 100644 --- a/models/iterable.yml +++ b/models/iterable.yml @@ -135,6 +135,12 @@ models: description: Count of suppress lists within the campaign/experiment - name: labels description: List of labels associated with the campaign/experiment + - name: journey_id + description: Reference to the journey the campaign belongs to, if applicable + - name: journey_name + description: User defined name of the journey the campaign belongs to, if applicable + - name: journey_type + description: The type of the journey the campaign belongs to, if applicable - name: template_name description: Name of the template associated with the campaign/experiment - name: template_creator_user_id @@ -301,9 +307,149 @@ models: description: The count of multimedia messages (MMS) sent as part of the event. - name: reason description: The reason or cause associated with a specific event or action. - - name: sms_send_count + - name: sms_send_count description: The count of SMS messages sent as part of the event. + - name: iterable__journeys + description: > + Table that provides aggregations for journeys, formerly known as workflows. Metrics are rolled up + from the user/campaign grain via each campaign's journey reference. Journeys which generate no + events, such as those that only split audiences or update user fields, are still included with + null metrics. The grain of this table is one record per journey. + columns: + - name: source_relation + description: "{{ doc('source_relation') }}" + - name: journey_id + description: Unique identifier of the journey + tests: + - not_null + - name: unique_journey_id + description: Unique identifier combining journey_id and source_relation. + tests: + - unique + - name: journey_name + description: User defined name of the journey + - name: journey_type + description: The journey type + - name: journey_description + description: Information about the journey + - name: creator_user_id + description: Reference to the user who created the journey + - name: is_enabled + description: Boolean indicating if the journey is currently enabled + - name: is_archived + description: Boolean indicating if the journey has been archived + - name: lifetime_limit + description: Maximum number of times a user may enter the journey over their lifetime + - name: simultaneous_limit + description: Maximum number of times a user may be in the journey at the same time + - name: start_tile_id + description: Reference to the tile which begins the journey + - name: trigger_event_names + description: The event names which trigger a user's entry into the journey + - name: created_at + description: Creation timestamp + - name: updated_at + description: Last update timestamp + - name: _fivetran_synced + description: "{{ doc('_fivetran_synced') }}" + - name: count_total_campaigns + description: Count of distinct campaigns within the journey that generated events + - name: count_unique_users + description: Count of total unique users within the journey + - name: first_event_at + description: Timestamp of the first event generated by any campaign in the journey + - name: last_event_at + description: Timestamp of the most recent event generated by any campaign in the journey + - name: total_emailclick + description: Total email clicks within the journey + - name: unique_total_emailclick + description: Unique email clicks within the journey + - name: total_emailunsubscribe + description: Total email unsubscribe events within the journey + - name: unique_total_emailunsubscribe + description: Unique total email unsubscribe events within the journey + - name: total_emailcomplaint + description: Total email complaints within the journey + - name: unique_total_emailcomplaint + description: Unique total email complaints within the journey + - name: total_customevent + description: Total custom events within the journey + - name: unique_total_customevent + description: Unique total custom events within the journey + - name: total_emailsubscribe + description: Total email subscribe events within the journey + - name: unique_total_emailsubscribe + description: Unique total email subscribe events within the journey + - name: total_emailopen + description: Total email open events within the journey + - name: unique_total_emailopen + description: Unique total email open events within the journey + - name: total_pushsend + description: Total push send events within the journey + - name: unique_total_pushsend + description: Unique total push send events within the journey + - name: total_smsbounce + description: Total sms bounce events within the journey + - name: unique_total_smsbounce + description: Unique total sms bounce events within the journey + - name: total_pushbounce + description: Total push bounce events within the journey + - name: unique_total_pushbounce + description: Unique total push bounce events within the journey + - name: total_inappsendskip + description: Total in app send skip events within the journey + - name: unique_total_inappsendskip + description: Unique total in app send skip events within the journey + - name: total_smssend + description: Total sms send events within the journey + - name: unique_total_smssend + description: Unique total sms send events within the journey + - name: total_inappsend + description: Total in app send events within the journey + - name: unique_total_inappsend + description: Unique total in app send events within the journey + - name: total_pushopen + description: Total push open events within the journey + - name: unique_total_pushopen + description: Unique total push open events within the journey + - name: total_emailsend + description: Total email send events within the journey + - name: unique_total_emailsend + description: Unique total email send events within the journey + - name: total_pushsendskip + description: Total push send skip events within the journey + - name: unique_total_pushsendskip + description: Unique total push send skip events within the journey + - name: total_inappopen + description: Total in app open events within the journey + - name: unique_total_inappopen + description: Unique total in app open events within the journey + - name: total_emailsendskip + description: Total email send skip events within the journey + - name: unique_total_emailsendskip + description: Unique total email send skip events within the journey + - name: total_emailbounce + description: Total email bounce events within the journey + - name: unique_total_emailbounce + description: Unique total email bounce events within the journey + - name: total_inappclick + description: Total in app click events within the journey + - name: unique_total_inappclick + description: Unique total in app click events within the journey + - name: total_pushuninstall + description: Total push uninstall events within the journey + - name: unique_total_pushuninstall + description: Unique total push uninstall events within the journey + - name: email_open_rate + description: Share of emails sent within the journey that were opened. Only present when both emailSend and emailOpen are included in the `iterable__event_metrics` variable. + - name: email_click_rate + description: Share of emails sent within the journey that were clicked. Only present when both emailSend and emailClick are included in the `iterable__event_metrics` variable. + - name: email_bounce_rate + description: Share of emails sent within the journey that bounced. Only present when both emailSend and emailBounce are included in the `iterable__event_metrics` variable. + - name: email_unsubscribe_rate + description: Share of emails sent within the journey that resulted in an unsubscribe. Only present when both emailSend and emailUnSubscribe are included in the `iterable__event_metrics` variable. + - name: iterable__list_user_history description: > Table that recreates the `list_user_history` source table. Additionally, this table provides an `is_current` field to diff --git a/models/iterable__campaigns.sql b/models/iterable__campaigns.sql index 1341ab5..50b4e85 100644 --- a/models/iterable__campaigns.sql +++ b/models/iterable__campaigns.sql @@ -33,6 +33,14 @@ with campaign_event_metrics as ( select * from {{ ref('int_iterable__latest_template') }} +{% if var('iterable__using_journey', true) %} +), journey as ( + + select * + from {{ ref('stg_iterable__journey') }} + +{% endif %} + ), campaign_join as ( {% set exclude_fields = ['source_relation', 'campaign_id', 'template_id'] %} -- these are in campaigns @@ -47,6 +55,10 @@ with campaign_event_metrics as ( {% if var('iterable__using_campaign_label_history', true) %} campaign_labels.labels, {% endif %} + {% if var('iterable__using_journey', true) %} + journey.journey_name, + journey.journey_type, + {% endif %} template.template_name, template.creator_user_id as template_creator_user_id, template.message_medium, @@ -74,6 +86,12 @@ with campaign_event_metrics as ( on campaign.template_id = template.template_id and campaign.source_relation = template.source_relation + {% if var('iterable__using_journey', true) %} + left join journey + on campaign.journey_id = journey.journey_id + and campaign.source_relation = journey.source_relation + {% endif %} + ), add_surrogate_key as ( {% set surrogate_key_fields = ['campaign_id', 'template_id', 'source_relation'] %} diff --git a/models/iterable__journeys.sql b/models/iterable__journeys.sql new file mode 100644 index 0000000..2afc24b --- /dev/null +++ b/models/iterable__journeys.sql @@ -0,0 +1,72 @@ +{{ config(enabled=var('iterable__using_journey', True)) }} + +{%- set event_metrics = var('iterable__event_metrics') | map('lower') | list %} + +with journey as ( + + select * + from {{ ref('stg_iterable__journey') }} + +), journey_metrics as ( + + select * + from {{ ref('int_iterable__journey_event_metrics') }} + +), journey_join as ( + + {% set exclude_fields = ['source_relation', 'journey_id'] %} -- these are in journey + + -- left join so journeys that generate no events, such as audience-splitting or + -- field-update journeys, are still reported with null metrics + select + journey.*, + {{ dbt_utils.star(from=ref('int_iterable__journey_event_metrics'), except=exclude_fields, relation_alias="journey_metrics") }} + + from journey + + left join journey_metrics + on journey.journey_id = journey_metrics.journey_id + and journey.source_relation = journey_metrics.source_relation + +), add_rates as ( + + -- Engagement rates as a share of emails sent. Each rate is emitted only when both its + -- numerator and denominator events are present in the `iterable__event_metrics` variable, + -- since that list is user-configurable and may not include every email event. + {%- set rate_expressions = [] %} + {%- if 'emailsend' in event_metrics %} + {%- if 'emailopen' in event_metrics %} + {%- do rate_expressions.append('total_emailopen / nullif(total_emailsend, 0) as email_open_rate') %} + {%- endif %} + {%- if 'emailclick' in event_metrics %} + {%- do rate_expressions.append('total_emailclick / nullif(total_emailsend, 0) as email_click_rate') %} + {%- endif %} + {%- if 'emailbounce' in event_metrics %} + {%- do rate_expressions.append('total_emailbounce / nullif(total_emailsend, 0) as email_bounce_rate') %} + {%- endif %} + {%- if 'emailunsubscribe' in event_metrics %} + {%- do rate_expressions.append('total_emailunsubscribe / nullif(total_emailsend, 0) as email_unsubscribe_rate') %} + {%- endif %} + {%- endif %} + + select + * + {% for rate in rate_expressions %} + , {{ rate }} + {% endfor %} + + from journey_join + +), add_surrogate_key as ( + + {% set surrogate_key_fields = ['journey_id', 'source_relation'] %} + + select + *, + {{ dbt_utils.generate_surrogate_key(surrogate_key_fields) }} as unique_journey_id + + from add_rates +) + +select * +from add_surrogate_key diff --git a/models/staging/src_iterable.yml b/models/staging/src_iterable.yml index 9688f90..e60625a 100644 --- a/models/staging/src_iterable.yml +++ b/models/staging/src_iterable.yml @@ -249,6 +249,39 @@ sources: - name: web_push_message description: The message or notification sent to web users as part of the event. + - name: journey + identifier: "{{ var('iterable_journey_identifier', 'journey')}}" + description: Table containing unique journeys, formerly known as workflows. + config: + enabled: "{{ var('iterable__using_journey', true) and var('iterable_sources', []) == [] }}" + columns: + - name: id + description: Unique identifier of the journey + - name: name + description: User defined name of the journey + - name: journey_type + description: The journey type + - name: description + description: Information about the journey + - name: creator_user_id + description: Reference to the user who created the journey + - name: enabled + description: Boolean indicating if the journey is currently enabled + - name: is_archived + description: Boolean indicating if the journey has been archived + - name: lifetime_limit + description: Maximum number of times a user may enter the journey over their lifetime + - name: simultaneous_limit + description: Maximum number of times a user may be in the journey at the same time + - name: start_tile_id + description: Reference to the tile which begins the journey + - name: trigger_event_names + description: The event names which trigger a user's entry into the journey + - name: created_at + description: Creation timestamp + - name: updated_at + description: Last update timestamp + - name: list identifier: "{{ var('iterable_list_identifier', 'list')}}" description: Table containing users and the lists the users are associated with. diff --git a/models/staging/stg_iterable.yml b/models/staging/stg_iterable.yml index b88dcc2..f3257e2 100644 --- a/models/staging/stg_iterable.yml +++ b/models/staging/stg_iterable.yml @@ -251,6 +251,42 @@ models: - name: _fivetran_synced description: "{{ doc('_fivetran_synced') }}" + - name: stg_iterable__journey + description: Table containing unique journeys, formerly known as workflows. + columns: + - name: source_relation + description: "{{ doc('source_relation') }}" + - name: journey_id + description: Unique identifier of the journey + tests: + - not_null + - name: journey_name + description: User defined name of the journey + - name: journey_type + description: The journey type + - name: journey_description + description: Information about the journey + - name: creator_user_id + description: Reference to the user who created the journey + - name: is_enabled + description: Boolean indicating if the journey is currently enabled + - name: is_archived + description: Boolean indicating if the journey has been archived + - name: lifetime_limit + description: Maximum number of times a user may enter the journey over their lifetime + - name: simultaneous_limit + description: Maximum number of times a user may be in the journey at the same time + - name: start_tile_id + description: Reference to the tile which begins the journey + - name: trigger_event_names + description: The event names which trigger a user's entry into the journey + - name: created_at + description: Creation timestamp + - name: updated_at + description: Last update timestamp + - name: _fivetran_synced + description: "{{ doc('_fivetran_synced') }}" + - name: stg_iterable__list description: Table containing users and the lists the users are associated with. columns: diff --git a/models/staging/stg_iterable__journey.sql b/models/staging/stg_iterable__journey.sql new file mode 100644 index 0000000..6351e82 --- /dev/null +++ b/models/staging/stg_iterable__journey.sql @@ -0,0 +1,54 @@ +{{ config(enabled=var('iterable__using_journey', True)) }} + +{% set source_columns_in_relation = adapter.get_columns_in_relation(ref('stg_iterable__journey_tmp')) %} + +with base as ( + + select * + from {{ ref('stg_iterable__journey_tmp') }} + +), + +fields as ( + + select + + {{ + fivetran_utils.fill_staging_columns( + source_columns=source_columns_in_relation, + staging_columns=get_journey_columns() + ) + }} + {{ fivetran_utils.apply_source_relation(package_name='iterable') }} + + from base +), + +final as ( + + select + source_relation, + cast(id as {{ dbt.type_string() }} ) as journey_id, + name as journey_name, + journey_type, + description as journey_description, + cast(creator_user_id as {{ dbt.type_string() }} ) as creator_user_id, + enabled as is_enabled, + is_archived, + lifetime_limit, + simultaneous_limit, + cast(start_tile_id as {{ dbt.type_string() }} ) as start_tile_id, + {{ iterable.json_to_string("trigger_event_names", source_columns_in_relation) }} as trigger_event_names, + created_at, + updated_at, + _fivetran_synced + + --The below script allows for pass through columns. + {{ fivetran_utils.fill_pass_through_columns('iterable_journey_pass_through_columns') }} + + from fields + where not coalesce(_fivetran_deleted, false) +) + +select * +from final diff --git a/models/staging/tmp/stg_iterable__journey_tmp.sql b/models/staging/tmp/stg_iterable__journey_tmp.sql new file mode 100644 index 0000000..08bcd05 --- /dev/null +++ b/models/staging/tmp/stg_iterable__journey_tmp.sql @@ -0,0 +1,9 @@ +{{ config(enabled=var('iterable__using_journey', True)) }} + +{{ + fivetran_utils.union_connections( + connection_dictionary='iterable_sources', + single_source_name='iterable', + single_table_name='journey' + ) +}} From 4b4c717e321a8c74fe52b505c9ba790124f3f72c Mon Sep 17 00:00:00 2001 From: fivetran-data-model-bot Date: Thu, 10 Sep 2026 22:23:30 +0000 Subject: [PATCH 02/11] Generate dbt docs via GitHub Actions --- docs/catalog.json | 2 +- docs/manifest.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/catalog.json b/docs/catalog.json index 2b482a3..3b436ff 100644 --- a/docs/catalog.json +++ b/docs/catalog.json @@ -1 +1 @@ -{"metadata": {"dbt_schema_version": "https://schemas.getdbt.com/dbt/catalog/v1.json", "dbt_version": "1.12.2", "generated_at": "2026-08-13T02:06:39.140406Z", "invocation_id": "ed463d55-d5d8-4684-9748-cd75801d3763", "invocation_started_at": "2026-08-13T02:06:36.230048Z", "env": {}}, "nodes": {"seed.iterable_integration_tests.campaign_history_data": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "campaign_history_data", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"id": {"type": "integer", "index": 1, "name": "id", "comment": null}, "updated_at": {"type": "text", "index": 2, "name": "updated_at", "comment": null}, "template_id": {"type": "integer", "index": 3, "name": "template_id", "comment": null}, "recurring_campaign_id": {"type": "integer", "index": 4, "name": "recurring_campaign_id", "comment": null}, "campaign_state": {"type": "text", "index": 5, "name": "campaign_state", "comment": null}, "created_at": {"type": "text", "index": 6, "name": "created_at", "comment": null}, "created_by_user_id": {"type": "text", "index": 7, "name": "created_by_user_id", "comment": null}, "ended_at": {"type": "integer", "index": 8, "name": "ended_at", "comment": null}, "name": {"type": "text", "index": 9, "name": "name", "comment": null}, "send_size": {"type": "integer", "index": 10, "name": "send_size", "comment": null}, "start_at": {"type": "integer", "index": 11, "name": "start_at", "comment": null}, "type": {"type": "text", "index": 12, "name": "type", "comment": null}, "workflow_id": {"type": "integer", "index": 13, "name": "workflow_id", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 14, "name": "_fivetran_synced", "comment": null}, "updated_by_user_id": {"type": "integer", "index": 15, "name": "updated_by_user_id", "comment": null}, "message_medium": {"type": "text", "index": 16, "name": "message_medium", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.iterable_integration_tests.campaign_history_data"}, "seed.iterable_integration_tests.campaign_label_history_data": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "campaign_label_history_data", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"campaign_id": {"type": "integer", "index": 1, "name": "campaign_id", "comment": null}, "label": {"type": "text", "index": 2, "name": "label", "comment": null}, "updated_at": {"type": "text", "index": 3, "name": "updated_at", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 4, "name": "_fivetran_synced", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.iterable_integration_tests.campaign_label_history_data"}, "seed.iterable_integration_tests.campaign_list_history_data": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "campaign_list_history_data", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"list_id": {"type": "integer", "index": 1, "name": "list_id", "comment": null}, "campaign_id": {"type": "integer", "index": 2, "name": "campaign_id", "comment": null}, "updated_at": {"type": "text", "index": 3, "name": "updated_at", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 4, "name": "_fivetran_synced", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.iterable_integration_tests.campaign_list_history_data"}, "seed.iterable_integration_tests.campaign_metrics_data": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "campaign_metrics_data", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"date": {"type": "date", "index": 1, "name": "date", "comment": null}, "id": {"type": "integer", "index": 2, "name": "id", "comment": null}, "_fivetran_deleted": {"type": "boolean", "index": 3, "name": "_fivetran_deleted", "comment": null}, "average_order_value": {"type": "integer", "index": 4, "name": "average_order_value", "comment": null}, "purchases": {"type": "integer", "index": 5, "name": "purchases", "comment": null}, "revenue": {"type": "integer", "index": 6, "name": "revenue", "comment": null}, "revenue_m": {"type": "integer", "index": 7, "name": "revenue_m", "comment": null}, "total_app_uninstalls": {"type": "integer", "index": 8, "name": "total_app_uninstalls", "comment": null}, "total_complaints": {"type": "integer", "index": 9, "name": "total_complaints", "comment": null}, "total_email_bounced": {"type": "integer", "index": 10, "name": "total_email_bounced", "comment": null}, "total_email_clicked": {"type": "integer", "index": 11, "name": "total_email_clicked", "comment": null}, "total_email_delivered": {"type": "integer", "index": 12, "name": "total_email_delivered", "comment": null}, "total_email_opens": {"type": "integer", "index": 13, "name": "total_email_opens", "comment": null}, "total_email_sends": {"type": "integer", "index": 14, "name": "total_email_sends", "comment": null}, "total_hosted_unsubscribe_clicks": {"type": "integer", "index": 15, "name": "total_hosted_unsubscribe_clicks", "comment": null}, "total_purchases": {"type": "integer", "index": 16, "name": "total_purchases", "comment": null}, "total_pushes_bounced": {"type": "integer", "index": 17, "name": "total_pushes_bounced", "comment": null}, "total_pushes_delivered": {"type": "integer", "index": 18, "name": "total_pushes_delivered", "comment": null}, "total_pushes_opened": {"type": "integer", "index": 19, "name": "total_pushes_opened", "comment": null}, "total_pushes_sent": {"type": "integer", "index": 20, "name": "total_pushes_sent", "comment": null}, "total_unsubscribes": {"type": "integer", "index": 21, "name": "total_unsubscribes", "comment": null}, "unique_email_bounced": {"type": "integer", "index": 22, "name": "unique_email_bounced", "comment": null}, "unique_email_clicks": {"type": "integer", "index": 23, "name": "unique_email_clicks", "comment": null}, "unique_email_opens_or_clicks": {"type": "integer", "index": 24, "name": "unique_email_opens_or_clicks", "comment": null}, "unique_hosted_unsubscribe_clicks": {"type": "integer", "index": 25, "name": "unique_hosted_unsubscribe_clicks", "comment": null}, "unique_purchases": {"type": "integer", "index": 26, "name": "unique_purchases", "comment": null}, "unique_pushes_bounced": {"type": "integer", "index": 27, "name": "unique_pushes_bounced", "comment": null}, "unique_pushes_opened": {"type": "integer", "index": 28, "name": "unique_pushes_opened", "comment": null}, "unique_pushes_sent": {"type": "integer", "index": 29, "name": "unique_pushes_sent", "comment": null}, "unique_unsubscribes": {"type": "integer", "index": 30, "name": "unique_unsubscribes", "comment": null}, "total_push_send_skips": {"type": "integer", "index": 31, "name": "total_push_send_skips", "comment": null}, "total_in_app_opens": {"type": "integer", "index": 32, "name": "total_in_app_opens", "comment": null}, "unique_in_apps_delivered": {"type": "integer", "index": 33, "name": "unique_in_apps_delivered", "comment": null}, "unique_in_app_sends": {"type": "integer", "index": 34, "name": "unique_in_app_sends", "comment": null}, "total_in_app_closes": {"type": "integer", "index": 35, "name": "total_in_app_closes", "comment": null}, "total_inbox_impressions": {"type": "integer", "index": 36, "name": "total_inbox_impressions", "comment": null}, "unique_pushes_delivered": {"type": "integer", "index": 37, "name": "unique_pushes_delivered", "comment": null}, "unique_in_app_clicks": {"type": "integer", "index": 38, "name": "unique_in_app_clicks", "comment": null}, "unique_emails_delivered": {"type": "integer", "index": 39, "name": "unique_emails_delivered", "comment": null}, "total_in_app_clicks": {"type": "integer", "index": 40, "name": "total_in_app_clicks", "comment": null}, "total_in_app_deletes": {"type": "integer", "index": 41, "name": "total_in_app_deletes", "comment": null}, "total_in_app_sent": {"type": "integer", "index": 42, "name": "total_in_app_sent", "comment": null}, "total_in_apps_delivered": {"type": "integer", "index": 43, "name": "total_in_apps_delivered", "comment": null}, "unique_in_app_opens": {"type": "integer", "index": 44, "name": "unique_in_app_opens", "comment": null}, "total_email_holdout": {"type": "integer", "index": 45, "name": "total_email_holdout", "comment": null}, "total_email_send_skips": {"type": "integer", "index": 46, "name": "total_email_send_skips", "comment": null}, "unique_email_sends": {"type": "integer", "index": 47, "name": "unique_email_sends", "comment": null}, "unique_emails_opens": {"type": "integer", "index": 48, "name": "unique_emails_opens", "comment": null}, "total_in_app_holdout": {"type": "integer", "index": 49, "name": "total_in_app_holdout", "comment": null}, "total_in_app_send_skips": {"type": "integer", "index": 50, "name": "total_in_app_send_skips", "comment": null}, "total_push_holdout": {"type": "integer", "index": 51, "name": "total_push_holdout", "comment": null}, "_fivetran_synced": {"type": "text", "index": 52, "name": "_fivetran_synced", "comment": null}, "total_sms_holdout": {"type": "integer", "index": 53, "name": "total_sms_holdout", "comment": null}, "unique_sms_sent": {"type": "integer", "index": 54, "name": "unique_sms_sent", "comment": null}, "total_sms_delivered": {"type": "integer", "index": 55, "name": "total_sms_delivered", "comment": null}, "total_sms_sent": {"type": "integer", "index": 56, "name": "total_sms_sent", "comment": null}, "total_inbound_sms": {"type": "integer", "index": 57, "name": "total_inbound_sms", "comment": null}, "total_sms_bounced": {"type": "integer", "index": 58, "name": "total_sms_bounced", "comment": null}, "total_sms_send_skips": {"type": "integer", "index": 59, "name": "total_sms_send_skips", "comment": null}, "unique_inbound_sms": {"type": "integer", "index": 60, "name": "unique_inbound_sms", "comment": null}, "unique_sms_delivered": {"type": "integer", "index": 61, "name": "unique_sms_delivered", "comment": null}, "unique_sms_bounced": {"type": "integer", "index": 62, "name": "unique_sms_bounced", "comment": null}, "revenue_m_sms_": {"type": "integer", "index": 63, "name": "revenue_m_sms_", "comment": null}, "purchases_m_sms_": {"type": "integer", "index": 64, "name": "purchases_m_sms_", "comment": null}, "purchases_m_email_": {"type": "integer", "index": 65, "name": "purchases_m_email_", "comment": null}, "revenue_m_push_": {"type": "integer", "index": 66, "name": "revenue_m_push_", "comment": null}, "revenue_m_email_": {"type": "integer", "index": 67, "name": "revenue_m_email_", "comment": null}, "purchases_m_push_": {"type": "integer", "index": 68, "name": "purchases_m_push_", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.iterable_integration_tests.campaign_metrics_data"}, "seed.iterable_integration_tests.campaign_suppression_list_history_data": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "campaign_suppression_list_history_data", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"suppressed_list_id": {"type": "integer", "index": 1, "name": "suppressed_list_id", "comment": null}, "campaign_id": {"type": "integer", "index": 2, "name": "campaign_id", "comment": null}, "updated_at": {"type": "text", "index": 3, "name": "updated_at", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 4, "name": "_fivetran_synced", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.iterable_integration_tests.campaign_suppression_list_history_data"}, "seed.iterable_integration_tests.channel_data": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "channel_data", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"id": {"type": "bigint", "index": 1, "name": "id", "comment": null}, "name": {"type": "text", "index": 2, "name": "name", "comment": null}, "channel_type": {"type": "text", "index": 3, "name": "channel_type", "comment": null}, "message_medium": {"type": "text", "index": 4, "name": "message_medium", "comment": null}, "_fivetran_deleted": {"type": "boolean", "index": 5, "name": "_fivetran_deleted", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 6, "name": "_fivetran_synced", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.iterable_integration_tests.channel_data"}, "seed.iterable_integration_tests.event_data": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "event_data", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"_fivetran_id": {"type": "text", "index": 1, "name": "_fivetran_id", "comment": null}, "email": {"type": "text", "index": 2, "name": "email", "comment": null}, "campaign_id": {"type": "integer", "index": 3, "name": "campaign_id", "comment": null}, "message_id": {"type": "integer", "index": 4, "name": "message_id", "comment": null}, "content_id": {"type": "integer", "index": 5, "name": "content_id", "comment": null}, "created_at": {"type": "timestamp without time zone", "index": 6, "name": "created_at", "comment": null}, "event_name": {"type": "text", "index": 7, "name": "event_name", "comment": null}, "ip": {"type": "integer", "index": 8, "name": "ip", "comment": null}, "message_bus_id": {"type": "integer", "index": 9, "name": "message_bus_id", "comment": null}, "message_type_id": {"type": "integer", "index": 10, "name": "message_type_id", "comment": null}, "recipient_state": {"type": "integer", "index": 11, "name": "recipient_state", "comment": null}, "status": {"type": "integer", "index": 12, "name": "status", "comment": null}, "unsub_source": {"type": "integer", "index": 13, "name": "unsub_source", "comment": null}, "user_agent": {"type": "integer", "index": 14, "name": "user_agent", "comment": null}, "user_agent_device": {"type": "integer", "index": 15, "name": "user_agent_device", "comment": null}, "transactional_data": {"type": "character varying(100)", "index": 16, "name": "transactional_data", "comment": null}, "additional_properties": {"type": "text", "index": 17, "name": "additional_properties", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 18, "name": "_fivetran_synced", "comment": null}, "_fivetran_user_id": {"type": "integer", "index": 19, "name": "_fivetran_user_id", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.iterable_integration_tests.event_data"}, "seed.iterable_integration_tests.event_extension_data": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "event_extension_data", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"_fivetran_id": {"type": "text", "index": 1, "name": "_fivetran_id", "comment": null}, "app_already_running": {"type": "integer", "index": 2, "name": "app_already_running", "comment": null}, "badge": {"type": "integer", "index": 3, "name": "badge", "comment": null}, "canonical_url_id": {"type": "integer", "index": 4, "name": "canonical_url_id", "comment": null}, "content_available": {"type": "integer", "index": 5, "name": "content_available", "comment": null}, "content_id": {"type": "integer", "index": 6, "name": "content_id", "comment": null}, "device": {"type": "integer", "index": 7, "name": "device", "comment": null}, "email_id": {"type": "text", "index": 8, "name": "email_id", "comment": null}, "email_subject": {"type": "text", "index": 9, "name": "email_subject", "comment": null}, "experiment_id": {"type": "integer", "index": 10, "name": "experiment_id", "comment": null}, "from_phone_number_id": {"type": "integer", "index": 11, "name": "from_phone_number_id", "comment": null}, "from_smssender_id": {"type": "integer", "index": 12, "name": "from_smssender_id", "comment": null}, "image_url": {"type": "integer", "index": 13, "name": "image_url", "comment": null}, "is_ghost_push": {"type": "integer", "index": 14, "name": "is_ghost_push", "comment": null}, "link_id": {"type": "integer", "index": 15, "name": "link_id", "comment": null}, "link_url": {"type": "integer", "index": 16, "name": "link_url", "comment": null}, "platform_endpoint": {"type": "integer", "index": 17, "name": "platform_endpoint", "comment": null}, "push_message": {"type": "integer", "index": 18, "name": "push_message", "comment": null}, "region": {"type": "text", "index": 19, "name": "region", "comment": null}, "sms_message": {"type": "integer", "index": 20, "name": "sms_message", "comment": null}, "sound": {"type": "integer", "index": 21, "name": "sound", "comment": null}, "to_phone_number": {"type": "integer", "index": 22, "name": "to_phone_number", "comment": null}, "url": {"type": "integer", "index": 23, "name": "url", "comment": null}, "workflow_id": {"type": "integer", "index": 24, "name": "workflow_id", "comment": null}, "workflow_name": {"type": "text", "index": 25, "name": "workflow_name", "comment": null}, "locale": {"type": "integer", "index": 26, "name": "locale", "comment": null}, "deeplink_android": {"type": "integer", "index": 27, "name": "deeplink_android", "comment": null}, "deeplink_ios": {"type": "integer", "index": 28, "name": "deeplink_ios", "comment": null}, "payload": {"type": "character varying(100)", "index": 29, "name": "payload", "comment": null}, "sms_provider_response_status": {"type": "integer", "index": 30, "name": "sms_provider_response_status", "comment": null}, "sms_provider_response_message": {"type": "integer", "index": 31, "name": "sms_provider_response_message", "comment": null}, "sms_provider_response_code": {"type": "integer", "index": 32, "name": "sms_provider_response_code", "comment": null}, "sms_provider_response_more_info": {"type": "integer", "index": 33, "name": "sms_provider_response_more_info", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 34, "name": "_fivetran_synced", "comment": null}, "catalog_collection_count": {"type": "integer", "index": 35, "name": "catalog_collection_count", "comment": null}, "catalog_lookup_count": {"type": "integer", "index": 36, "name": "catalog_lookup_count", "comment": null}, "city": {"type": "text", "index": 37, "name": "city", "comment": null}, "clicked_url": {"type": "text", "index": 38, "name": "clicked_url", "comment": null}, "country": {"type": "text", "index": 39, "name": "country", "comment": null}, "error_code": {"type": "integer", "index": 40, "name": "error_code", "comment": null}, "expires_at": {"type": "text", "index": 41, "name": "expires_at", "comment": null}, "from_phone_number": {"type": "integer", "index": 42, "name": "from_phone_number", "comment": null}, "in_app_body": {"type": "text", "index": 43, "name": "in_app_body", "comment": null}, "is_sms_estimation": {"type": "boolean", "index": 44, "name": "is_sms_estimation", "comment": null}, "labels": {"type": "text", "index": 45, "name": "labels", "comment": null}, "message_context": {"type": "text", "index": 46, "name": "message_context", "comment": null}, "message_status": {"type": "text", "index": 47, "name": "message_status", "comment": null}, "mms_send_count": {"type": "integer", "index": 48, "name": "mms_send_count", "comment": null}, "product_recommendation_count": {"type": "integer", "index": 49, "name": "product_recommendation_count", "comment": null}, "proxy_source": {"type": "text", "index": 50, "name": "proxy_source", "comment": null}, "reason": {"type": "text", "index": 51, "name": "reason", "comment": null}, "sms_send_count": {"type": "integer", "index": 52, "name": "sms_send_count", "comment": null}, "web_push_body": {"type": "text", "index": 53, "name": "web_push_body", "comment": null}, "web_push_click_action": {"type": "text", "index": 54, "name": "web_push_click_action", "comment": null}, "web_push_icon": {"type": "text", "index": 55, "name": "web_push_icon", "comment": null}, "web_push_message": {"type": "text", "index": 56, "name": "web_push_message", "comment": null}, "_fivetran_user_id": {"type": "integer", "index": 57, "name": "_fivetran_user_id", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.iterable_integration_tests.event_extension_data"}, "seed.iterable_integration_tests.list_data": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "list_data", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"id": {"type": "integer", "index": 1, "name": "id", "comment": null}, "name": {"type": "text", "index": 2, "name": "name", "comment": null}, "created_at": {"type": "text", "index": 3, "name": "created_at", "comment": null}, "list_type": {"type": "text", "index": 4, "name": "list_type", "comment": null}, "_fivetran_deleted": {"type": "boolean", "index": 5, "name": "_fivetran_deleted", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 6, "name": "_fivetran_synced", "comment": null}, "description": {"type": "text", "index": 7, "name": "description", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.iterable_integration_tests.list_data"}, "seed.iterable_integration_tests.list_user_data": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "list_user_data", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"_fivetran_id": {"type": "text", "index": 1, "name": "_fivetran_id", "comment": null}, "index": {"type": "bigint", "index": 2, "name": "index", "comment": null}, "list_id": {"type": "bigint", "index": 3, "name": "list_id", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 4, "name": "_fivetran_synced", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.iterable_integration_tests.list_user_data"}, "seed.iterable_integration_tests.message_type_data": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "message_type_data", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"id": {"type": "bigint", "index": 1, "name": "id", "comment": null}, "name": {"type": "text", "index": 2, "name": "name", "comment": null}, "channel_id": {"type": "bigint", "index": 3, "name": "channel_id", "comment": null}, "_fivetran_deleted": {"type": "boolean", "index": 4, "name": "_fivetran_deleted", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 5, "name": "_fivetran_synced", "comment": null}, "created_at": {"type": "timestamp without time zone", "index": 6, "name": "created_at", "comment": null}, "frequency_cap": {"type": "integer", "index": 7, "name": "frequency_cap", "comment": null}, "rate_limit_per_minute": {"type": "integer", "index": 8, "name": "rate_limit_per_minute", "comment": null}, "subscription_policy": {"type": "text", "index": 9, "name": "subscription_policy", "comment": null}, "updated_at": {"type": "timestamp without time zone", "index": 10, "name": "updated_at", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.iterable_integration_tests.message_type_data"}, "seed.iterable_integration_tests.template_history_data": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "template_history_data", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"id": {"type": "integer", "index": 1, "name": "id", "comment": null}, "updated_at": {"type": "text", "index": 2, "name": "updated_at", "comment": null}, "message_type_id": {"type": "integer", "index": 3, "name": "message_type_id", "comment": null}, "client_template_id": {"type": "integer", "index": 4, "name": "client_template_id", "comment": null}, "created_at": {"type": "text", "index": 5, "name": "created_at", "comment": null}, "creator_user_id": {"type": "text", "index": 6, "name": "creator_user_id", "comment": null}, "name": {"type": "text", "index": 7, "name": "name", "comment": null}, "template_type": {"type": "text", "index": 8, "name": "template_type", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 9, "name": "_fivetran_synced", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.iterable_integration_tests.template_history_data"}, "seed.iterable_integration_tests.user_history_bq_json_data": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "user_history_bq_json_data", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"email": {"type": "text", "index": 1, "name": "email", "comment": null}, "updated_at": {"type": "text", "index": 2, "name": "updated_at", "comment": null}, "first_name": {"type": "integer", "index": 3, "name": "first_name", "comment": null}, "last_name": {"type": "integer", "index": 4, "name": "last_name", "comment": null}, "phone_number": {"type": "integer", "index": 5, "name": "phone_number", "comment": null}, "user_id": {"type": "integer", "index": 6, "name": "user_id", "comment": null}, "signup_date": {"type": "text", "index": 7, "name": "signup_date", "comment": null}, "signup_source": {"type": "text", "index": 8, "name": "signup_source", "comment": null}, "phone_number_carrier": {"type": "integer", "index": 9, "name": "phone_number_carrier", "comment": null}, "phone_number_country_code_iso": {"type": "integer", "index": 10, "name": "phone_number_country_code_iso", "comment": null}, "phone_number_line_type": {"type": "integer", "index": 11, "name": "phone_number_line_type", "comment": null}, "phone_number_updated_at": {"type": "integer", "index": 12, "name": "phone_number_updated_at", "comment": null}, "_fivetran_synced": {"type": "text", "index": 13, "name": "_fivetran_synced", "comment": null}, "email_list_ids": {"type": "text", "index": 14, "name": "email_list_ids", "comment": null}, "iterable_user_id": {"type": "integer", "index": 15, "name": "iterable_user_id", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.iterable_integration_tests.user_history_bq_json_data"}, "seed.iterable_integration_tests.user_history_data": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "user_history_data", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"email": {"type": "text", "index": 1, "name": "email", "comment": null}, "updated_at": {"type": "timestamp without time zone", "index": 2, "name": "updated_at", "comment": null}, "first_name": {"type": "integer", "index": 3, "name": "first_name", "comment": null}, "last_name": {"type": "integer", "index": 4, "name": "last_name", "comment": null}, "phone_number": {"type": "integer", "index": 5, "name": "phone_number", "comment": null}, "user_id": {"type": "integer", "index": 6, "name": "user_id", "comment": null}, "signup_date": {"type": "text", "index": 7, "name": "signup_date", "comment": null}, "signup_source": {"type": "text", "index": 8, "name": "signup_source", "comment": null}, "phone_number_carrier": {"type": "integer", "index": 9, "name": "phone_number_carrier", "comment": null}, "phone_number_country_code_iso": {"type": "integer", "index": 10, "name": "phone_number_country_code_iso", "comment": null}, "phone_number_line_type": {"type": "integer", "index": 11, "name": "phone_number_line_type", "comment": null}, "phone_number_updated_at": {"type": "integer", "index": 12, "name": "phone_number_updated_at", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 13, "name": "_fivetran_synced", "comment": null}, "email_list_ids": {"type": "text", "index": 14, "name": "email_list_ids", "comment": null}, "iterable_user_id": {"type": "integer", "index": 15, "name": "iterable_user_id", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.iterable_integration_tests.user_history_data"}, "seed.iterable_integration_tests.user_unsubscribed_channel_data": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "user_unsubscribed_channel_data", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"_fivetran_id": {"type": "text", "index": 1, "name": "_fivetran_id", "comment": null}, "channel_id": {"type": "integer", "index": 2, "name": "channel_id", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 3, "name": "_fivetran_synced", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.iterable_integration_tests.user_unsubscribed_channel_data"}, "seed.iterable_integration_tests.user_unsubscribed_channel_history_data": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "user_unsubscribed_channel_history_data", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"email": {"type": "text", "index": 1, "name": "email", "comment": null}, "channel_id": {"type": "bigint", "index": 2, "name": "channel_id", "comment": null}, "updated_at": {"type": "text", "index": 3, "name": "updated_at", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 4, "name": "_fivetran_synced", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.iterable_integration_tests.user_unsubscribed_channel_history_data"}, "seed.iterable_integration_tests.user_unsubscribed_message_type_data": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "user_unsubscribed_message_type_data", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"_fivetran_id": {"type": "text", "index": 1, "name": "_fivetran_id", "comment": null}, "message_type_id": {"type": "integer", "index": 2, "name": "message_type_id", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 3, "name": "_fivetran_synced", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.iterable_integration_tests.user_unsubscribed_message_type_data"}, "seed.iterable_integration_tests.user_unsubscribed_message_type_history_data": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "user_unsubscribed_message_type_history_data", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"message_type_id": {"type": "integer", "index": 1, "name": "message_type_id", "comment": null}, "email": {"type": "text", "index": 2, "name": "email", "comment": null}, "updated_at": {"type": "text", "index": 3, "name": "updated_at", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 4, "name": "_fivetran_synced", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.iterable_integration_tests.user_unsubscribed_message_type_history_data"}, "model.iterable.int_iterable__campaign_event_metrics": {"metadata": {"type": "VIEW", "schema": "public_iterable_dev", "name": "int_iterable__campaign_event_metrics", "database": "postgres", "comment": "Table that generates relevant total and unique campaign/experiment level aggregations.", "owner": "postgres"}, "columns": {"source_relation": {"type": "text", "index": 1, "name": "source_relation", "comment": null}, "campaign_id": {"type": "text", "index": 2, "name": "campaign_id", "comment": null}, "template_id": {"type": "text", "index": 3, "name": "template_id", "comment": null}, "experiment_id": {"type": "integer", "index": 4, "name": "experiment_id", "comment": null}, "count_unique_users": {"type": "bigint", "index": 5, "name": "count_unique_users", "comment": null}, "total_emailclick": {"type": "numeric", "index": 6, "name": "total_emailclick", "comment": null}, "unique_total_emailclick": {"type": "bigint", "index": 7, "name": "unique_total_emailclick", "comment": null}, "total_emailunsubscribe": {"type": "numeric", "index": 8, "name": "total_emailunsubscribe", "comment": null}, "unique_total_emailunsubscribe": {"type": "bigint", "index": 9, "name": "unique_total_emailunsubscribe", "comment": null}, "total_emailcomplaint": {"type": "numeric", "index": 10, "name": "total_emailcomplaint", "comment": null}, "unique_total_emailcomplaint": {"type": "bigint", "index": 11, "name": "unique_total_emailcomplaint", "comment": null}, "total_customevent": {"type": "numeric", "index": 12, "name": "total_customevent", "comment": null}, "unique_total_customevent": {"type": "bigint", "index": 13, "name": "unique_total_customevent", "comment": null}, "total_emailsubscribe": {"type": "numeric", "index": 14, "name": "total_emailsubscribe", "comment": null}, "unique_total_emailsubscribe": {"type": "bigint", "index": 15, "name": "unique_total_emailsubscribe", "comment": null}, "total_emailopen": {"type": "numeric", "index": 16, "name": "total_emailopen", "comment": null}, "unique_total_emailopen": {"type": "bigint", "index": 17, "name": "unique_total_emailopen", "comment": null}, "total_pushsend": {"type": "numeric", "index": 18, "name": "total_pushsend", "comment": null}, "unique_total_pushsend": {"type": "bigint", "index": 19, "name": "unique_total_pushsend", "comment": null}, "total_smsbounce": {"type": "numeric", "index": 20, "name": "total_smsbounce", "comment": null}, "unique_total_smsbounce": {"type": "bigint", "index": 21, "name": "unique_total_smsbounce", "comment": null}, "total_pushbounce": {"type": "numeric", "index": 22, "name": "total_pushbounce", "comment": null}, "unique_total_pushbounce": {"type": "bigint", "index": 23, "name": "unique_total_pushbounce", "comment": null}, "total_inappsendskip": {"type": "numeric", "index": 24, "name": "total_inappsendskip", "comment": null}, "unique_total_inappsendskip": {"type": "bigint", "index": 25, "name": "unique_total_inappsendskip", "comment": null}, "total_smssend": {"type": "numeric", "index": 26, "name": "total_smssend", "comment": null}, "unique_total_smssend": {"type": "bigint", "index": 27, "name": "unique_total_smssend", "comment": null}, "total_inappsend": {"type": "numeric", "index": 28, "name": "total_inappsend", "comment": null}, "unique_total_inappsend": {"type": "bigint", "index": 29, "name": "unique_total_inappsend", "comment": null}, "total_pushopen": {"type": "numeric", "index": 30, "name": "total_pushopen", "comment": null}, "unique_total_pushopen": {"type": "bigint", "index": 31, "name": "unique_total_pushopen", "comment": null}, "total_emailsend": {"type": "numeric", "index": 32, "name": "total_emailsend", "comment": null}, "unique_total_emailsend": {"type": "bigint", "index": 33, "name": "unique_total_emailsend", "comment": null}, "total_pushsendskip": {"type": "numeric", "index": 34, "name": "total_pushsendskip", "comment": null}, "unique_total_pushsendskip": {"type": "bigint", "index": 35, "name": "unique_total_pushsendskip", "comment": null}, "total_inappopen": {"type": "numeric", "index": 36, "name": "total_inappopen", "comment": null}, "unique_total_inappopen": {"type": "bigint", "index": 37, "name": "unique_total_inappopen", "comment": null}, "total_emailsendskip": {"type": "numeric", "index": 38, "name": "total_emailsendskip", "comment": null}, "unique_total_emailsendskip": {"type": "bigint", "index": 39, "name": "unique_total_emailsendskip", "comment": null}, "total_emailbounce": {"type": "numeric", "index": 40, "name": "total_emailbounce", "comment": null}, "unique_total_emailbounce": {"type": "bigint", "index": 41, "name": "unique_total_emailbounce", "comment": null}, "total_inappclick": {"type": "numeric", "index": 42, "name": "total_inappclick", "comment": null}, "unique_total_inappclick": {"type": "bigint", "index": 43, "name": "unique_total_inappclick", "comment": null}, "total_pushuninstall": {"type": "numeric", "index": 44, "name": "total_pushuninstall", "comment": null}, "unique_total_pushuninstall": {"type": "bigint", "index": 45, "name": "unique_total_pushuninstall", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.int_iterable__campaign_event_metrics"}, "model.iterable.int_iterable__campaign_labels": {"metadata": {"type": "VIEW", "schema": "public_iterable_dev", "name": "int_iterable__campaign_labels", "database": "postgres", "comment": "Table that provides the distinct string aggregation of labels for each campaign.", "owner": "postgres"}, "columns": {"source_relation": {"type": "text", "index": 1, "name": "source_relation", "comment": null}, "campaign_id": {"type": "text", "index": 2, "name": "campaign_id", "comment": null}, "labels": {"type": "text", "index": 3, "name": "labels", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.int_iterable__campaign_labels"}, "model.iterable.int_iterable__campaign_lists": {"metadata": {"type": "VIEW", "schema": "public_iterable_dev", "name": "int_iterable__campaign_lists", "database": "postgres", "comment": "Table that identifies the suppressed and send lists associated with a campaign.", "owner": "postgres"}, "columns": {"source_relation": {"type": "text", "index": 1, "name": "source_relation", "comment": null}, "list_id": {"type": "text", "index": 2, "name": "list_id", "comment": null}, "campaign_id": {"type": "text", "index": 3, "name": "campaign_id", "comment": null}, "updated_at": {"type": "text", "index": 4, "name": "updated_at", "comment": null}, "list_activity": {"type": "text", "index": 5, "name": "list_activity", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.int_iterable__campaign_lists"}, "model.iterable.int_iterable__latest_campaign": {"metadata": {"type": "VIEW", "schema": "public_iterable_dev", "name": "int_iterable__latest_campaign", "database": "postgres", "comment": "Table that filters out historical versions of the campaign, and returns the most recent campaign version.", "owner": "postgres"}, "columns": {"source_relation": {"type": "text", "index": 1, "name": "source_relation", "comment": null}, "campaign_id": {"type": "text", "index": 2, "name": "campaign_id", "comment": null}, "updated_at": {"type": "text", "index": 3, "name": "updated_at", "comment": null}, "campaign_name": {"type": "text", "index": 4, "name": "campaign_name", "comment": null}, "campaign_state": {"type": "text", "index": 5, "name": "campaign_state", "comment": null}, "campaign_type": {"type": "text", "index": 6, "name": "campaign_type", "comment": null}, "send_size": {"type": "integer", "index": 7, "name": "send_size", "comment": null}, "start_at": {"type": "integer", "index": 8, "name": "start_at", "comment": null}, "ended_at": {"type": "integer", "index": 9, "name": "ended_at", "comment": null}, "created_at": {"type": "text", "index": 10, "name": "created_at", "comment": null}, "message_medium": {"type": "text", "index": 11, "name": "message_medium", "comment": null}, "recurring_campaign_id": {"type": "text", "index": 12, "name": "recurring_campaign_id", "comment": null}, "created_by_user_id": {"type": "text", "index": 13, "name": "created_by_user_id", "comment": null}, "updated_by_user_id": {"type": "text", "index": 14, "name": "updated_by_user_id", "comment": null}, "template_id": {"type": "text", "index": 15, "name": "template_id", "comment": null}, "workflow_id": {"type": "integer", "index": 16, "name": "workflow_id", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 17, "name": "_fivetran_synced", "comment": null}, "latest_campaign_index": {"type": "bigint", "index": 18, "name": "latest_campaign_index", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.int_iterable__latest_campaign"}, "model.iterable.int_iterable__latest_template": {"metadata": {"type": "VIEW", "schema": "public_iterable_dev", "name": "int_iterable__latest_template", "database": "postgres", "comment": "Table that provides the most recent version of the template as well as joining relevant message type information.", "owner": "postgres"}, "columns": {"source_relation": {"type": "text", "index": 1, "name": "source_relation", "comment": null}, "template_id": {"type": "text", "index": 2, "name": "template_id", "comment": null}, "template_name": {"type": "text", "index": 3, "name": "template_name", "comment": null}, "template_type": {"type": "text", "index": 4, "name": "template_type", "comment": null}, "created_at": {"type": "text", "index": 5, "name": "created_at", "comment": null}, "client_template_id": {"type": "text", "index": 6, "name": "client_template_id", "comment": null}, "creator_user_id": {"type": "text", "index": 7, "name": "creator_user_id", "comment": null}, "message_type_id": {"type": "text", "index": 8, "name": "message_type_id", "comment": null}, "updated_at": {"type": "text", "index": 9, "name": "updated_at", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 10, "name": "_fivetran_synced", "comment": null}, "latest_template_index": {"type": "bigint", "index": 11, "name": "latest_template_index", "comment": null}, "message_type_name": {"type": "text", "index": 12, "name": "message_type_name", "comment": null}, "channel_id": {"type": "text", "index": 13, "name": "channel_id", "comment": null}, "channel_name": {"type": "text", "index": 14, "name": "channel_name", "comment": null}, "channel_type": {"type": "text", "index": 15, "name": "channel_type", "comment": null}, "message_medium": {"type": "text", "index": 16, "name": "message_medium", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.int_iterable__latest_template"}, "model.iterable.int_iterable__latest_user": {"metadata": {"type": "VIEW", "schema": "public_iterable_dev", "name": "int_iterable__latest_user", "database": "postgres", "comment": "Table that filters out historical versions of the user, and returns only the most recent version.", "owner": "postgres"}, "columns": {"source_relation": {"type": "text", "index": 1, "name": "source_relation", "comment": null}, "_fivetran_user_id": {"type": "text", "index": 2, "name": "_fivetran_user_id", "comment": null}, "email": {"type": "text", "index": 3, "name": "email", "comment": null}, "updated_at": {"type": "timestamp without time zone", "index": 4, "name": "updated_at", "comment": null}, "user_id": {"type": "text", "index": 5, "name": "user_id", "comment": null}, "first_name": {"type": "integer", "index": 6, "name": "first_name", "comment": null}, "last_name": {"type": "integer", "index": 7, "name": "last_name", "comment": null}, "email_list_ids": {"type": "text", "index": 8, "name": "email_list_ids", "comment": null}, "phone_number": {"type": "integer", "index": 9, "name": "phone_number", "comment": null}, "signup_date": {"type": "text", "index": 10, "name": "signup_date", "comment": null}, "signup_source": {"type": "text", "index": 11, "name": "signup_source", "comment": null}, "iterable_user_id": {"type": "text", "index": 12, "name": "iterable_user_id", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 13, "name": "_fivetran_synced", "comment": null}, "unique_user_key": {"type": "text", "index": 14, "name": "unique_user_key", "comment": null}, "latest_user_index": {"type": "bigint", "index": 15, "name": "latest_user_index", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.int_iterable__latest_user"}, "model.iterable.int_iterable__list_user_history": {"metadata": {"type": "BASE TABLE", "schema": "public_iterable_dev", "name": "int_iterable__list_user_history", "database": "postgres", "comment": "Table that provides a history of all lists the user has been associated with.", "owner": "postgres"}, "columns": {"source_relation": {"type": "text", "index": 1, "name": "source_relation", "comment": null}, "_fivetran_user_id": {"type": "text", "index": 2, "name": "_fivetran_user_id", "comment": null}, "unique_user_key": {"type": "text", "index": 3, "name": "unique_user_key", "comment": null}, "email": {"type": "text", "index": 4, "name": "email", "comment": null}, "user_id": {"type": "text", "index": 5, "name": "user_id", "comment": null}, "first_name": {"type": "integer", "index": 6, "name": "first_name", "comment": null}, "last_name": {"type": "integer", "index": 7, "name": "last_name", "comment": null}, "email_list_ids": {"type": "text", "index": 8, "name": "email_list_ids", "comment": null}, "phone_number": {"type": "integer", "index": 9, "name": "phone_number", "comment": null}, "signup_date": {"type": "text", "index": 10, "name": "signup_date", "comment": null}, "signup_source": {"type": "text", "index": 11, "name": "signup_source", "comment": null}, "updated_at": {"type": "timestamp without time zone", "index": 12, "name": "updated_at", "comment": null}, "is_current": {"type": "boolean", "index": 13, "name": "is_current", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.int_iterable__list_user_history"}, "model.iterable.int_iterable__list_user_unnest": {"metadata": {"type": "BASE TABLE", "schema": "public_iterable_dev", "name": "int_iterable__list_user_unnest", "database": "postgres", "comment": "Table that unnests the `email_list_id` field for each user to create a new record for each user and the unique list it was associated with at a unique update. Due to the unnesting functions varying greatly between warehouses, conditional logic is applied throughout the model to appropriately accommodate the model being ran within Redshift, Snowflake, BigQuery, and Postgres.\n", "owner": "postgres"}, "columns": {"source_relation": {"type": "text", "index": 1, "name": "source_relation", "comment": null}, "_fivetran_user_id": {"type": "text", "index": 2, "name": "_fivetran_user_id", "comment": null}, "unique_user_key": {"type": "text", "index": 3, "name": "unique_user_key", "comment": null}, "user_id": {"type": "text", "index": 4, "name": "user_id", "comment": null}, "email": {"type": "text", "index": 5, "name": "email", "comment": null}, "first_name": {"type": "integer", "index": 6, "name": "first_name", "comment": null}, "last_name": {"type": "integer", "index": 7, "name": "last_name", "comment": null}, "signup_date": {"type": "text", "index": 8, "name": "signup_date", "comment": null}, "signup_source": {"type": "text", "index": 9, "name": "signup_source", "comment": null}, "updated_at": {"type": "timestamp without time zone", "index": 10, "name": "updated_at", "comment": null}, "phone_number": {"type": "integer", "index": 11, "name": "phone_number", "comment": null}, "is_current": {"type": "boolean", "index": 12, "name": "is_current", "comment": null}, "email_list_ids": {"type": "text", "index": 13, "name": "email_list_ids", "comment": null}, "list_id": {"type": "integer", "index": 14, "name": "list_id", "comment": null}, "unique_key": {"type": "text", "index": 15, "name": "unique_key", "comment": null}, "date_day": {"type": "date", "index": 16, "name": "date_day", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.int_iterable__list_user_unnest"}, "model.iterable.int_iterable__message_type_channel": {"metadata": {"type": "VIEW", "schema": "public_iterable_dev", "name": "int_iterable__message_type_channel", "database": "postgres", "comment": "Table that joins the message type and channel records together into one comprehensive model to be referenced downstream.", "owner": "postgres"}, "columns": {"source_relation": {"type": "text", "index": 1, "name": "source_relation", "comment": null}, "channel_id": {"type": "text", "index": 2, "name": "channel_id", "comment": null}, "channel_name": {"type": "text", "index": 3, "name": "channel_name", "comment": null}, "channel_type": {"type": "text", "index": 4, "name": "channel_type", "comment": null}, "message_medium": {"type": "text", "index": 5, "name": "message_medium", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 6, "name": "_fivetran_synced", "comment": null}, "message_type_name": {"type": "text", "index": 7, "name": "message_type_name", "comment": null}, "message_type_id": {"type": "text", "index": 8, "name": "message_type_id", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.int_iterable__message_type_channel"}, "model.iterable.int_iterable__recurring_campaigns": {"metadata": {"type": "VIEW", "schema": "public_iterable_dev", "name": "int_iterable__recurring_campaigns", "database": "postgres", "comment": "Table that identifies when a campaign is associated with a recurring campaign and provides additional enriched recurring campaign information.", "owner": "postgres"}, "columns": {"source_relation": {"type": "text", "index": 1, "name": "source_relation", "comment": null}, "campaign_id": {"type": "text", "index": 2, "name": "campaign_id", "comment": null}, "campaign_name": {"type": "text", "index": 3, "name": "campaign_name", "comment": null}, "updated_at": {"type": "text", "index": 4, "name": "updated_at", "comment": null}, "campaign_state": {"type": "text", "index": 5, "name": "campaign_state", "comment": null}, "campaign_type": {"type": "text", "index": 6, "name": "campaign_type", "comment": null}, "send_size": {"type": "integer", "index": 7, "name": "send_size", "comment": null}, "start_at": {"type": "integer", "index": 8, "name": "start_at", "comment": null}, "ended_at": {"type": "integer", "index": 9, "name": "ended_at", "comment": null}, "created_at": {"type": "text", "index": 10, "name": "created_at", "comment": null}, "created_by_user_id": {"type": "text", "index": 11, "name": "created_by_user_id", "comment": null}, "template_id": {"type": "text", "index": 12, "name": "template_id", "comment": null}, "recurring_campaign_id": {"type": "text", "index": 13, "name": "recurring_campaign_id", "comment": null}, "recurring_campaign_name": {"type": "text", "index": 14, "name": "recurring_campaign_name", "comment": null}, "recurring_campaign_state": {"type": "text", "index": 15, "name": "recurring_campaign_state", "comment": null}, "recurring_campaign_send_size": {"type": "integer", "index": 16, "name": "recurring_campaign_send_size", "comment": null}, "recurring_campaign_start_at": {"type": "integer", "index": 17, "name": "recurring_campaign_start_at", "comment": null}, "is_campaign_recurring": {"type": "boolean", "index": 18, "name": "is_campaign_recurring", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.int_iterable__recurring_campaigns"}, "model.iterable.int_iterable__user_event_metrics": {"metadata": {"type": "VIEW", "schema": "public_iterable_dev", "name": "int_iterable__user_event_metrics", "database": "postgres", "comment": "Table that generates user aggregations at the campaign level.", "owner": "postgres"}, "columns": {"source_relation": {"type": "text", "index": 1, "name": "source_relation", "comment": null}, "_fivetran_user_id": {"type": "text", "index": 2, "name": "_fivetran_user_id", "comment": null}, "unique_user_key": {"type": "text", "index": 3, "name": "unique_user_key", "comment": null}, "user_id": {"type": "text", "index": 4, "name": "user_id", "comment": null}, "user_email": {"type": "text", "index": 5, "name": "user_email", "comment": null}, "count_total_campaigns": {"type": "bigint", "index": 6, "name": "count_total_campaigns", "comment": null}, "first_event_at": {"type": "timestamp without time zone", "index": 7, "name": "first_event_at", "comment": null}, "last_event_at": {"type": "timestamp without time zone", "index": 8, "name": "last_event_at", "comment": null}, "total_emailclick": {"type": "numeric", "index": 9, "name": "total_emailclick", "comment": null}, "total_emailunsubscribe": {"type": "numeric", "index": 10, "name": "total_emailunsubscribe", "comment": null}, "total_emailcomplaint": {"type": "numeric", "index": 11, "name": "total_emailcomplaint", "comment": null}, "total_customevent": {"type": "numeric", "index": 12, "name": "total_customevent", "comment": null}, "total_emailsubscribe": {"type": "numeric", "index": 13, "name": "total_emailsubscribe", "comment": null}, "total_emailopen": {"type": "numeric", "index": 14, "name": "total_emailopen", "comment": null}, "total_pushsend": {"type": "numeric", "index": 15, "name": "total_pushsend", "comment": null}, "total_smsbounce": {"type": "numeric", "index": 16, "name": "total_smsbounce", "comment": null}, "total_pushbounce": {"type": "numeric", "index": 17, "name": "total_pushbounce", "comment": null}, "total_inappsendskip": {"type": "numeric", "index": 18, "name": "total_inappsendskip", "comment": null}, "total_smssend": {"type": "numeric", "index": 19, "name": "total_smssend", "comment": null}, "total_inappsend": {"type": "numeric", "index": 20, "name": "total_inappsend", "comment": null}, "total_pushopen": {"type": "numeric", "index": 21, "name": "total_pushopen", "comment": null}, "total_emailsend": {"type": "numeric", "index": 22, "name": "total_emailsend", "comment": null}, "total_pushsendskip": {"type": "numeric", "index": 23, "name": "total_pushsendskip", "comment": null}, "total_inappopen": {"type": "numeric", "index": 24, "name": "total_inappopen", "comment": null}, "total_emailsendskip": {"type": "numeric", "index": 25, "name": "total_emailsendskip", "comment": null}, "total_emailbounce": {"type": "numeric", "index": 26, "name": "total_emailbounce", "comment": null}, "total_inappclick": {"type": "numeric", "index": 27, "name": "total_inappclick", "comment": null}, "total_pushuninstall": {"type": "numeric", "index": 28, "name": "total_pushuninstall", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.int_iterable__user_event_metrics"}, "model.iterable.iterable__campaigns": {"metadata": {"type": "BASE TABLE", "schema": "public_iterable_dev", "name": "iterable__campaigns", "database": "postgres", "comment": "Table that provides aggregations for campaigns at the template and if available, the experiment grain.", "owner": "postgres"}, "columns": {"source_relation": {"type": "text", "index": 1, "name": "source_relation", "comment": "Identifies the record's source."}, "campaign_id": {"type": "text", "index": 2, "name": "campaign_id", "comment": "Unique identifier of the campaign record"}, "campaign_name": {"type": "text", "index": 3, "name": "campaign_name", "comment": "User defined name of the campaign."}, "updated_at": {"type": "text", "index": 4, "name": "updated_at", "comment": "Last update timestamp"}, "campaign_state": {"type": "text", "index": 5, "name": "campaign_state", "comment": "State of the campaign. Can be Draft, Ready, Scheduled, Running, Finished, Starting, Aborted or Recurring"}, "campaign_type": {"type": "text", "index": 6, "name": "campaign_type", "comment": "The campaign type. Can be Blast or Triggered"}, "send_size": {"type": "integer", "index": 7, "name": "send_size", "comment": "Size of the campaign. Number of individuals included in the campaign"}, "start_at": {"type": "integer", "index": 8, "name": "start_at", "comment": "Start timestamp"}, "ended_at": {"type": "integer", "index": 9, "name": "ended_at", "comment": "Ended timestamp"}, "created_at": {"type": "text", "index": 10, "name": "created_at", "comment": "Creation timestamp"}, "created_by_user_id": {"type": "text", "index": 11, "name": "created_by_user_id", "comment": "Reference to the user who created the campaign"}, "template_id": {"type": "text", "index": 12, "name": "template_id", "comment": "Reference to the campaign template"}, "recurring_campaign_id": {"type": "text", "index": 13, "name": "recurring_campaign_id", "comment": "Unique identifier of the recurring campaign (if applicable)"}, "recurring_campaign_name": {"type": "text", "index": 14, "name": "recurring_campaign_name", "comment": "Name of the recurring campaign (if applicable)"}, "recurring_campaign_state": {"type": "text", "index": 15, "name": "recurring_campaign_state", "comment": "State of the recurring campaign (if applicable)"}, "recurring_campaign_send_size": {"type": "integer", "index": 16, "name": "recurring_campaign_send_size", "comment": "Size of the recurring campaign. Number of individuals included in the recurring campaign (if applicable)"}, "recurring_campaign_start_at": {"type": "integer", "index": 17, "name": "recurring_campaign_start_at", "comment": "Timestamp of when the recurring campaign started (if applicable)"}, "is_campaign_recurring": {"type": "boolean", "index": 18, "name": "is_campaign_recurring", "comment": "Boolean indicating if the campaign is a recurring campaign"}, "experiment_id": {"type": "integer", "index": 19, "name": "experiment_id", "comment": "Reference to the experiment used if the event is an experiment"}, "count_unique_users": {"type": "bigint", "index": 20, "name": "count_unique_users", "comment": "Count of total unique users within the campaign/experiment"}, "total_emailclick": {"type": "numeric", "index": 21, "name": "total_emailclick", "comment": "Total email clicks within the campaign/experiment"}, "unique_total_emailclick": {"type": "bigint", "index": 22, "name": "unique_total_emailclick", "comment": "Unique email clicks within the campaign/experiment"}, "total_emailunsubscribe": {"type": "numeric", "index": 23, "name": "total_emailunsubscribe", "comment": "Total email unsubscribe events within the campaign/experiment"}, "unique_total_emailunsubscribe": {"type": "bigint", "index": 24, "name": "unique_total_emailunsubscribe", "comment": "Unique total email unsubscribe events within the campaign/experiment"}, "total_emailcomplaint": {"type": "numeric", "index": 25, "name": "total_emailcomplaint", "comment": "Total email complaints within the campaign/experiment"}, "unique_total_emailcomplaint": {"type": "bigint", "index": 26, "name": "unique_total_emailcomplaint", "comment": "Unique total email complaints within the campaign/experiment"}, "total_customevent": {"type": "numeric", "index": 27, "name": "total_customevent", "comment": "Total custom events within the campaign/experiment"}, "unique_total_customevent": {"type": "bigint", "index": 28, "name": "unique_total_customevent", "comment": "Unique total custom events within the campaign/experiment"}, "total_emailsubscribe": {"type": "numeric", "index": 29, "name": "total_emailsubscribe", "comment": "Total email subscribe events within the campaign/experiment"}, "unique_total_emailsubscribe": {"type": "bigint", "index": 30, "name": "unique_total_emailsubscribe", "comment": "Unique total email subscribe events within the campaign/experiment"}, "total_emailopen": {"type": "numeric", "index": 31, "name": "total_emailopen", "comment": "Total email open events within the campaign/experiment"}, "unique_total_emailopen": {"type": "bigint", "index": 32, "name": "unique_total_emailopen", "comment": "Unique total email open events within the campaign/experiment"}, "total_pushsend": {"type": "numeric", "index": 33, "name": "total_pushsend", "comment": "Total push send event within the campaign/experiment"}, "unique_total_pushsend": {"type": "bigint", "index": 34, "name": "unique_total_pushsend", "comment": "Unique total push send events within the campaign/experiment"}, "total_smsbounce": {"type": "numeric", "index": 35, "name": "total_smsbounce", "comment": "Total sms bounce events within the campaign/experiment"}, "unique_total_smsbounce": {"type": "bigint", "index": 36, "name": "unique_total_smsbounce", "comment": "Unique total sms bounce events within the campaign/experiment"}, "total_pushbounce": {"type": "numeric", "index": 37, "name": "total_pushbounce", "comment": "Total push bounce events within the campaign/experiment"}, "unique_total_pushbounce": {"type": "bigint", "index": 38, "name": "unique_total_pushbounce", "comment": "Unique total push bounce events within the campaign/experiment"}, "total_inappsendskip": {"type": "numeric", "index": 39, "name": "total_inappsendskip", "comment": "Total in app send skip events within the campaign/experiment"}, "unique_total_inappsendskip": {"type": "bigint", "index": 40, "name": "unique_total_inappsendskip", "comment": "Unique total in app send skip events within the campaign/experiment"}, "total_smssend": {"type": "numeric", "index": 41, "name": "total_smssend", "comment": "Total sms send events within the campaign/experiment"}, "unique_total_smssend": {"type": "bigint", "index": 42, "name": "unique_total_smssend", "comment": "Unique total sms send events within the campaign/experiment"}, "total_inappsend": {"type": "numeric", "index": 43, "name": "total_inappsend", "comment": "Total in app send events within the campaign/experiment"}, "unique_total_inappsend": {"type": "bigint", "index": 44, "name": "unique_total_inappsend", "comment": "Unique total in app send events within the campaign/experiment"}, "total_pushopen": {"type": "numeric", "index": 45, "name": "total_pushopen", "comment": "Total push open events within the campaign/experiment"}, "unique_total_pushopen": {"type": "bigint", "index": 46, "name": "unique_total_pushopen", "comment": "Unique total push open events within the campaign/experiment"}, "total_emailsend": {"type": "numeric", "index": 47, "name": "total_emailsend", "comment": "Total email send events within the campaign/experiment"}, "unique_total_emailsend": {"type": "bigint", "index": 48, "name": "unique_total_emailsend", "comment": "Unique total email send events within the campaign/experiment"}, "total_pushsendskip": {"type": "numeric", "index": 49, "name": "total_pushsendskip", "comment": "Total push send skip events within the campaign/experiment"}, "unique_total_pushsendskip": {"type": "bigint", "index": 50, "name": "unique_total_pushsendskip", "comment": "Unique total push send skip events within the campaign/experiment"}, "total_inappopen": {"type": "numeric", "index": 51, "name": "total_inappopen", "comment": "Total in app open events within the campaign/experiment"}, "unique_total_inappopen": {"type": "bigint", "index": 52, "name": "unique_total_inappopen", "comment": "Unique total in app open events within the campaign/experiment"}, "total_emailsendskip": {"type": "numeric", "index": 53, "name": "total_emailsendskip", "comment": "Total email send skip events within the campaign/experiment"}, "unique_total_emailsendskip": {"type": "bigint", "index": 54, "name": "unique_total_emailsendskip", "comment": "Unique total email send skip events within the campaign/experiment"}, "total_emailbounce": {"type": "numeric", "index": 55, "name": "total_emailbounce", "comment": "Total email bounce events within the campaign/experiment"}, "unique_total_emailbounce": {"type": "bigint", "index": 56, "name": "unique_total_emailbounce", "comment": "Unique total email bounce events within the campaign/experiment"}, "total_inappclick": {"type": "numeric", "index": 57, "name": "total_inappclick", "comment": "Total in app click events within the campaign/experiment"}, "unique_total_inappclick": {"type": "bigint", "index": 58, "name": "unique_total_inappclick", "comment": "Unique total in app click events within the campaign/experiment"}, "total_pushuninstall": {"type": "numeric", "index": 59, "name": "total_pushuninstall", "comment": "Total push uninstall events within the campaign/experiment"}, "unique_total_pushuninstall": {"type": "bigint", "index": 60, "name": "unique_total_pushuninstall", "comment": "Unique total push uninstall events within the campaign/experiment"}, "count_send_lists": {"type": "bigint", "index": 61, "name": "count_send_lists", "comment": "Count of send lists within the campaign/experiment"}, "count_suppress_lists": {"type": "bigint", "index": 62, "name": "count_suppress_lists", "comment": "Count of suppress lists within the campaign/experiment"}, "labels": {"type": "text", "index": 63, "name": "labels", "comment": "List of labels associated with the campaign/experiment"}, "template_name": {"type": "text", "index": 64, "name": "template_name", "comment": "Name of the template associated with the campaign/experiment"}, "template_creator_user_id": {"type": "text", "index": 65, "name": "template_creator_user_id", "comment": "The creator user id of the template associated with the campaign/experiment"}, "message_medium": {"type": "text", "index": 66, "name": "message_medium", "comment": "The medium which the message was provided"}, "message_type_name": {"type": "text", "index": 67, "name": "message_type_name", "comment": "The message type name associated with the campaign/experiment"}, "channel_name": {"type": "text", "index": 68, "name": "channel_name", "comment": "The channel name associated with the campaign/experiment"}, "channel_id": {"type": "text", "index": 69, "name": "channel_id", "comment": "The channel identifier associated with the campaign/experiment"}, "channel_type": {"type": "text", "index": 70, "name": "channel_type", "comment": "The channel type associated with the campaign/experiment"}, "unique_campaign_version_id": {"type": "text", "index": 71, "name": "unique_campaign_version_id", "comment": "Unique identifier combining campaign_id, template_id, source_relation, and if available, experiment_id."}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.iterable__campaigns"}, "model.iterable.iterable__events": {"metadata": {"type": "BASE TABLE", "schema": "public_iterable_dev", "name": "iterable__events", "database": "postgres", "comment": "Table that provides a comprehensive view of all events with enriched information such as the campaign, user effected, and template used.", "owner": "postgres"}, "columns": {"source_relation": {"type": "text", "index": 1, "name": "source_relation", "comment": "Identifies the record's source."}, "event_id": {"type": "text", "index": 2, "name": "event_id", "comment": "Unique id of the event generated by Fivetran"}, "unique_event_id": {"type": "text", "index": 3, "name": "unique_event_id", "comment": "A unique surrogate key of event_id, _fivetran_user_id, and source_relation."}, "_fivetran_user_id": {"type": "text", "index": 4, "name": "_fivetran_user_id", "comment": "A Fivetran-created unique identifier for the new Iterable schema in Aug 2023, for users, derived from hashing user_id and/or email, depending on project type."}, "unique_user_key": {"type": "text", "index": 5, "name": "unique_user_key", "comment": "The unique identifier of the user. With the new schema (Aug 2023), it is the _fivetran_user_id. This is a hash of user_id and/or email, depending on project type. If using the old schema, it is email."}, "campaign_id": {"type": "text", "index": 6, "name": "campaign_id", "comment": "Reference to the campaign from which the event originated"}, "content_id": {"type": "text", "index": 7, "name": "content_id", "comment": "Reference to the content the event is associated with"}, "created_at": {"type": "timestamp without time zone", "index": 8, "name": "created_at", "comment": "Creation timestamp"}, "created_on": {"type": "date", "index": 9, "name": "created_on", "comment": "Day when the event was created"}, "email": {"type": "text", "index": 10, "name": "email", "comment": "The user's email. User identifier, for email-based projects. Previously was the unique identifier for user records, for the old Iterable schema before the August 2023 updates."}, "additional_properties": {"type": "text", "index": 11, "name": "additional_properties", "comment": "json object containing addition event properties"}, "event_name": {"type": "text", "index": 12, "name": "event_name", "comment": "Name provided to the individual event"}, "message_bus_id": {"type": "text", "index": 13, "name": "message_bus_id", "comment": "Reference to the message bus associated with the event"}, "message_id": {"type": "text", "index": 14, "name": "message_id", "comment": "Reference to the message the event is associated with"}, "message_type_id": {"type": "text", "index": 15, "name": "message_type_id", "comment": "Reference to the type of message the event is associated with"}, "recipient_state": {"type": "integer", "index": 16, "name": "recipient_state", "comment": "The state of the recipient upon receiving the event"}, "status": {"type": "integer", "index": 17, "name": "status", "comment": "Status of the event"}, "transactional_data": {"type": "character varying(100)", "index": 18, "name": "transactional_data", "comment": "Transactional data associated with the event"}, "unsub_source": {"type": "integer", "index": 19, "name": "unsub_source", "comment": "Source of the unsubscribe event"}, "user_agent": {"type": "integer", "index": 20, "name": "user_agent", "comment": "User agent associated with the event"}, "user_agent_device": {"type": "integer", "index": 21, "name": "user_agent_device", "comment": "The device of the user agent"}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 22, "name": "_fivetran_synced", "comment": "Timestamp of when the event record was synced by Fivetran"}, "campaign_name": {"type": "text", "index": 23, "name": "campaign_name", "comment": "The name of the campaign"}, "campaign_type": {"type": "text", "index": 24, "name": "campaign_type", "comment": "The type of campaign"}, "is_campaign_recurring": {"type": "boolean", "index": 25, "name": "is_campaign_recurring", "comment": "Boolean indicating if the campaign is recurrent"}, "recurring_campaign_name": {"type": "text", "index": 26, "name": "recurring_campaign_name", "comment": "The name of the recurring campaign (if applicable)"}, "recurring_campaign_id": {"type": "text", "index": 27, "name": "recurring_campaign_id", "comment": "The campaign if of the recurring campaign (if applicable)"}, "user_id": {"type": "text", "index": 28, "name": "user_id", "comment": "User identifier, for userID-based projects."}, "user_full_name": {"type": "text", "index": 29, "name": "user_full_name", "comment": "Full name of the user"}, "message_type_name": {"type": "text", "index": 30, "name": "message_type_name", "comment": "Name of the message type"}, "message_medium": {"type": "text", "index": 31, "name": "message_medium", "comment": "Medium of the message"}, "channel_id": {"type": "text", "index": 32, "name": "channel_id", "comment": "Unique identifier of the channel"}, "channel_name": {"type": "text", "index": 33, "name": "channel_name", "comment": "The channel name"}, "channel_type": {"type": "text", "index": 34, "name": "channel_type", "comment": "The type of channel"}, "is_app_already_running": {"type": "integer", "index": 35, "name": "is_app_already_running", "comment": "Boolean indicating if the app is already running"}, "badge": {"type": "integer", "index": 36, "name": "badge", "comment": "Badge associated with the event"}, "catalog_collection_count": {"type": "integer", "index": 37, "name": "catalog_collection_count", "comment": "The count of products or items collected in a catalog associated with the event."}, "catalog_lookup_count": {"type": "integer", "index": 38, "name": "catalog_lookup_count", "comment": "The count of times a catalog was looked up or queried during the event."}, "canonical_url_id": {"type": "text", "index": 39, "name": "canonical_url_id", "comment": "Reference to the url associated with the event"}, "is_content_available": {"type": "integer", "index": 40, "name": "is_content_available", "comment": "Content available from the event"}, "device": {"type": "integer", "index": 41, "name": "device", "comment": "The device associated with the event"}, "email_id": {"type": "text", "index": 42, "name": "email_id", "comment": "Reference to the email associated with the event"}, "email_subject": {"type": "text", "index": 43, "name": "email_subject", "comment": "Subject of the email associated with the event"}, "experiment_id": {"type": "integer", "index": 44, "name": "experiment_id", "comment": "Reference to the experiment used if the event is an experiment"}, "from_phone_number_id": {"type": "integer", "index": 45, "name": "from_phone_number_id", "comment": "Reference to the phone number which the event is from"}, "from_smssender_id": {"type": "integer", "index": 46, "name": "from_smssender_id", "comment": "Reference to the sms sender which the event is from"}, "link_id": {"type": "text", "index": 47, "name": "link_id", "comment": "Reference to the link associated with the event"}, "link_url": {"type": "integer", "index": 48, "name": "link_url", "comment": "Url of the link associated with the event"}, "locale": {"type": "integer", "index": 49, "name": "locale", "comment": "Locale associated with the event"}, "payload": {"type": "character varying(100)", "index": 50, "name": "payload", "comment": "Payload resulted from the event"}, "platform_endpoint": {"type": "integer", "index": 51, "name": "platform_endpoint", "comment": "The specific platform endpoint of the event"}, "push_message": {"type": "integer", "index": 52, "name": "push_message", "comment": "Boolean indicating if the event is a push message"}, "region": {"type": "text", "index": 53, "name": "region", "comment": "Region of the event"}, "sms_message": {"type": "integer", "index": 54, "name": "sms_message", "comment": "Boolean indicating if the event is an sms message"}, "to_phone_number": {"type": "integer", "index": 55, "name": "to_phone_number", "comment": "To phone number associated with the event"}, "url": {"type": "integer", "index": 56, "name": "url", "comment": "Url associated with the event"}, "workflow_id": {"type": "text", "index": 57, "name": "workflow_id", "comment": "Reference to the workflow which the event originated"}, "workflow_name": {"type": "text", "index": 58, "name": "workflow_name", "comment": "Name of the workflow which the event originated"}, "city": {"type": "text", "index": 59, "name": "city", "comment": "The city associated with the event, which could be the location of the recipient."}, "clicked_url": {"type": "text", "index": 60, "name": "clicked_url", "comment": "The URL that was clicked by the recipient in response to the marketing message."}, "country": {"type": "text", "index": 61, "name": "country", "comment": "The country associated with the event, which could be the location of the recipient."}, "error_code": {"type": "integer", "index": 62, "name": "error_code", "comment": "The error code or message indicating any issues or errors encountered during the event."}, "expires_at": {"type": "text", "index": 63, "name": "expires_at", "comment": "The date and time when the event or message is set to expire or become invalid."}, "from_phone_number": {"type": "integer", "index": 64, "name": "from_phone_number", "comment": "The phone number from which the SMS message was sent."}, "in_app_body": {"type": "text", "index": 65, "name": "in_app_body", "comment": "The content or body of an in-app message that was sent as part of the event."}, "is_sms_estimation": {"type": "boolean", "index": 66, "name": "is_sms_estimation", "comment": "A boolean indicating whether the SMS message is an estimation or not."}, "labels": {"type": "text", "index": 67, "name": "labels", "comment": "Any labels or tags associated with the event, which can be used for categorization or organization."}, "message_status": {"type": "text", "index": 68, "name": "message_status", "comment": "The status of the marketing message, such as sent, delivered, opened, etc."}, "mms_send_count": {"type": "integer", "index": 69, "name": "mms_send_count", "comment": "The count of multimedia messages (MMS) sent as part of the event."}, "reason": {"type": "text", "index": 70, "name": "reason", "comment": "The reason or cause associated with a specific event or action."}, "sms_send_count": {"type": "integer", "index": 71, "name": "sms_send_count", "comment": "The count of SMS messages sent as part of the event."}, "template_id": {"type": "text", "index": 72, "name": "template_id", "comment": "Unique identifier of the template"}, "template_name": {"type": "text", "index": 73, "name": "template_name", "comment": "User defined name of the template"}, "template_creator_user_id": {"type": "text", "index": 74, "name": "template_creator_user_id", "comment": "Reference to the user who created the template"}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.iterable__events"}, "model.iterable.iterable__list_user_history": {"metadata": {"type": "BASE TABLE", "schema": "public_iterable_dev", "name": "iterable__list_user_history", "database": "postgres", "comment": "Table that recreates the `list_user_history` source table. Additionally, this table provides an `is_current` field to identify the current lists associated with the user. The table coalesces list_id values from both the direct list_user relationships and the unnested email_list_ids from user history to ensure comprehensive list coverage. The grain of this table is at the user/list/updated_at level.\n", "owner": "postgres"}, "columns": {"source_relation": {"type": "text", "index": 1, "name": "source_relation", "comment": "Identifies the record's source."}, "unique_user_key": {"type": "text", "index": 2, "name": "unique_user_key", "comment": "The unique identifier of the user. With the new schema (Aug 2023), it is the _fivetran_user_id. This is a hash of user_id and/or email, depending on project type. If using the old schema, it is email."}, "_fivetran_user_id": {"type": "text", "index": 3, "name": "_fivetran_user_id", "comment": "A Fivetran-created unique identifier for the new Iterable schema in Aug 2023, for users, derived from hashing user_id and/or email, depending on project type."}, "user_id": {"type": "text", "index": 4, "name": "user_id", "comment": "User identifier, for userID-based projects."}, "user_email": {"type": "text", "index": 5, "name": "user_email", "comment": "Email of the user if it exists."}, "user_first_name": {"type": "integer", "index": 6, "name": "user_first_name", "comment": "First name of the user"}, "user_last_name": {"type": "integer", "index": 7, "name": "user_last_name", "comment": "Last name of the user"}, "user_signup_date": {"type": "text", "index": 8, "name": "user_signup_date", "comment": "Timestamp of when the user signed up"}, "user_signup_source": {"type": "text", "index": 9, "name": "user_signup_source", "comment": "Source where the user signed up"}, "user_updated_at": {"type": "timestamp without time zone", "index": 10, "name": "user_updated_at", "comment": "Last update timestamp"}, "list_id": {"type": "bigint", "index": 11, "name": "list_id", "comment": "The list associated with the user. Uses coalesced values prioritizing `list_id` from `LIST_USER` over the unnested `email_list_ids` from `USER_HISTORY` for comprehensive list coverage."}, "is_current": {"type": "boolean", "index": 12, "name": "is_current", "comment": "Boolean indicating if the current list is active"}, "list_name": {"type": "text", "index": 13, "name": "list_name", "comment": "Name of the list associated with the user"}, "list_type": {"type": "text", "index": 14, "name": "list_type", "comment": "Type of list associated with the user"}, "list_created_at": {"type": "text", "index": 15, "name": "list_created_at", "comment": "Date the list was created"}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.iterable__list_user_history"}, "model.iterable.iterable__user_campaign": {"metadata": {"type": "BASE TABLE", "schema": "public_iterable_dev", "name": "iterable__user_campaign", "database": "postgres", "comment": "Table that provides total and unique metrics for a user associated with particular campaigns and if available, experiments.", "owner": "postgres"}, "columns": {"source_relation": {"type": "text", "index": 1, "name": "source_relation", "comment": "Identifies the record's source."}, "_fivetran_user_id": {"type": "text", "index": 2, "name": "_fivetran_user_id", "comment": "A Fivetran-created unique identifier for the new Iterable schema in Aug 2023, for users, derived from hashing user_id and/or email, depending on project type."}, "unique_user_key": {"type": "text", "index": 3, "name": "unique_user_key", "comment": "The unique identifier of the user. With the new schema (Aug 2023), it is the _fivetran_user_id. This is a hash of user_id and/or email, depending on project type. If using the old schema, it is email."}, "user_id": {"type": "text", "index": 4, "name": "user_id", "comment": "User identifier, for userID-based projects."}, "campaign_id": {"type": "text", "index": 5, "name": "campaign_id", "comment": "The unique identifier of the campaign which the user metrics are associated"}, "experiment_id": {"type": "integer", "index": 6, "name": "experiment_id", "comment": "The unique experiment variation of the campaign"}, "user_email": {"type": "text", "index": 7, "name": "user_email", "comment": "Email of the user if it exists."}, "user_full_name": {"type": "text", "index": 8, "name": "user_full_name", "comment": "The users first and last name"}, "campaign_name": {"type": "text", "index": 9, "name": "campaign_name", "comment": "The name of the campaign which the user metrics are associated"}, "template_id": {"type": "text", "index": 10, "name": "template_id", "comment": "The unique identifier of the template used within the campaign"}, "template_name": {"type": "text", "index": 11, "name": "template_name", "comment": "The name of the template used for the campaign"}, "recurring_campaign_id": {"type": "text", "index": 12, "name": "recurring_campaign_id", "comment": "The unique identifier of the recurring campaign which the campaign is tied to"}, "recurring_campaign_name": {"type": "text", "index": 13, "name": "recurring_campaign_name", "comment": "The name of the recurring campaign which the campaign is tied to"}, "first_event_at": {"type": "timestamp without time zone", "index": 14, "name": "first_event_at", "comment": "Timestamp of the first campaign/experiment event associated with the user"}, "last_event_at": {"type": "timestamp without time zone", "index": 15, "name": "last_event_at", "comment": "Timestamp of the most recent campaign/experiment event associated with the user"}, "first_open_or_click_event_at": {"type": "timestamp without time zone", "index": 16, "name": "first_open_or_click_event_at", "comment": "The time of the first open or click time. This is the first time a user interacts with a campaign, recording the earliest occurring event out of 'emailOpen', 'emailClick', and 'pushOpen'."}, "total_emailclick": {"type": "bigint", "index": 17, "name": "total_emailclick", "comment": "Total email clicks events the user took within the campaign/experiment"}, "total_emailunsubscribe": {"type": "bigint", "index": 18, "name": "total_emailunsubscribe", "comment": "Total email unsubscription events the user performed within the campaign/experiment"}, "total_emailcomplaint": {"type": "bigint", "index": 19, "name": "total_emailcomplaint", "comment": "Total email complaint events the user performed within the campaign/experiment"}, "total_customevent": {"type": "bigint", "index": 20, "name": "total_customevent", "comment": "Total custom events associated with the user within the campaign/experiment"}, "total_emailsubscribe": {"type": "bigint", "index": 21, "name": "total_emailsubscribe", "comment": "Total email subscription events associate with the user within the campaign/experiment"}, "total_emailopen": {"type": "bigint", "index": 22, "name": "total_emailopen", "comment": "Total email open events the user performed within the campaign/experiment"}, "total_pushsend": {"type": "bigint", "index": 23, "name": "total_pushsend", "comment": "Total push send events the user performed within the campaign/experiment"}, "total_smsbounce": {"type": "bigint", "index": 24, "name": "total_smsbounce", "comment": "Total sms bounce events associated with the user within the campaign/experiment"}, "total_pushbounce": {"type": "bigint", "index": 25, "name": "total_pushbounce", "comment": "Total push bounce events associated with the user within the campaign/experiment"}, "total_inappsendskip": {"type": "bigint", "index": 26, "name": "total_inappsendskip", "comment": "Total in app send skip events the user performed within the campaign/experiment"}, "total_smssend": {"type": "bigint", "index": 27, "name": "total_smssend", "comment": "Total sms send events associated with the user within the campaign/experiment"}, "total_inappsend": {"type": "bigint", "index": 28, "name": "total_inappsend", "comment": "Total in app send events associated with the user within the campaign/experiment"}, "total_pushopen": {"type": "bigint", "index": 29, "name": "total_pushopen", "comment": "Total push open events the user performed within the campaign/experiment"}, "total_emailsend": {"type": "bigint", "index": 30, "name": "total_emailsend", "comment": "Total email send event associated with the user within the campaign/experiment"}, "total_pushsendskip": {"type": "bigint", "index": 31, "name": "total_pushsendskip", "comment": "Total push send skip events associated with the user within the campaign/experiment"}, "total_inappopen": {"type": "bigint", "index": 32, "name": "total_inappopen", "comment": "Total in app open events associated with the user within the campaign/experiment"}, "total_emailsendskip": {"type": "bigint", "index": 33, "name": "total_emailsendskip", "comment": "Total email send skip events associated with the user within the campaign/experiment"}, "total_emailbounce": {"type": "bigint", "index": 34, "name": "total_emailbounce", "comment": "Total email bounce events associated with the user within the campaign/experiment"}, "total_inappclick": {"type": "bigint", "index": 35, "name": "total_inappclick", "comment": "Total in app click events associated with the user within the campaign/experiment"}, "total_pushuninstall": {"type": "bigint", "index": 36, "name": "total_pushuninstall", "comment": "Total push uninstall events associated with the user within the campaign/experiment"}, "unique_user_campaign_id": {"type": "text", "index": 37, "name": "unique_user_campaign_id", "comment": "Unique ID combining source_relation, unique_user_key, campaign_id, and if available, experiment_id."}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.iterable__user_campaign"}, "model.iterable.iterable__user_unsubscriptions": {"metadata": {"type": "BASE TABLE", "schema": "public_iterable_dev", "name": "iterable__user_unsubscriptions", "database": "postgres", "comment": "Table that generates the total channel and message types a user has chosen to unsubscribe.", "owner": "postgres"}, "columns": {"source_relation": {"type": "text", "index": 1, "name": "source_relation", "comment": "Identifies the record's source."}, "_fivetran_user_id": {"type": "text", "index": 2, "name": "_fivetran_user_id", "comment": "A Fivetran-created unique identifier for the new Iterable schema in Aug 2023, for users, derived from hashing user_id and/or email, depending on project type."}, "unique_user_key": {"type": "text", "index": 3, "name": "unique_user_key", "comment": "The unique identifier of the user. With the new schema (Aug 2023), it is the _fivetran_user_id. This is a hash of user_id and/or email, depending on project type. If using the old schema, it is email."}, "channel_id": {"type": "text", "index": 4, "name": "channel_id", "comment": "Unique identifier of the channel which the user is unsubscribed"}, "message_type_id": {"type": "text", "index": 5, "name": "message_type_id", "comment": "Unique identifier of the message type which the user is unsubscribed"}, "updated_at": {"type": "timestamp without time zone", "index": 6, "name": "updated_at", "comment": "Timestamp of when the user unsubscribed from the channel or message type"}, "channel_name": {"type": "text", "index": 7, "name": "channel_name", "comment": "The name of the channel which the user is unsubscribed"}, "message_type_name": {"type": "text", "index": 8, "name": "message_type_name", "comment": "The name of the message type which the user is unsubscribed"}, "channel_type": {"type": "text", "index": 9, "name": "channel_type", "comment": "The channel type which the user is unsubscribed"}, "message_medium": {"type": "text", "index": 10, "name": "message_medium", "comment": "The medium type the message was provided which the user is unsubscribed"}, "is_unsubscribed_channel_wide": {"type": "boolean", "index": 11, "name": "is_unsubscribed_channel_wide", "comment": "Boolean indicating if the user unsubscribed at the channel level (i.e. unsubscribed to all message types) or if they unsubscribed from only an individual message type.\n"}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.iterable__user_unsubscriptions"}, "model.iterable.iterable__users": {"metadata": {"type": "BASE TABLE", "schema": "public_iterable_dev", "name": "iterable__users", "database": "postgres", "comment": "Table that provides unique user enriched information.", "owner": "postgres"}, "columns": {"source_relation": {"type": "text", "index": 1, "name": "source_relation", "comment": "Identifies the record's source."}, "user_id": {"type": "text", "index": 2, "name": "user_id", "comment": "User identifier, for userID-based projects."}, "_fivetran_user_id": {"type": "text", "index": 3, "name": "_fivetran_user_id", "comment": "A Fivetran-created unique identifier for the new Iterable schema in Aug 2023, for users, derived from hashing user_id and/or email, depending on project type."}, "unique_user_key": {"type": "text", "index": 4, "name": "unique_user_key", "comment": "The unique identifier of the user. With the new schema (Aug 2023), it is the _fivetran_user_id. This is a hash of user_id and/or email, depending on project type. If using the old schema, it is email."}, "email": {"type": "text", "index": 5, "name": "email", "comment": "The user's email. User identifier, for email-based projects. Previously was the unique identifier for user records, for the old Iterable schema before the August 2023 updates."}, "first_name": {"type": "integer", "index": 6, "name": "first_name", "comment": "First name of the user"}, "last_name": {"type": "integer", "index": 7, "name": "last_name", "comment": "Last name of the user"}, "signup_date": {"type": "text", "index": 8, "name": "signup_date", "comment": "Timestamp of when the user signed up"}, "signup_source": {"type": "text", "index": 9, "name": "signup_source", "comment": "Source where the user signed up"}, "updated_at": {"type": "timestamp without time zone", "index": 10, "name": "updated_at", "comment": "Last update timestamp"}, "phone_number": {"type": "integer", "index": 11, "name": "phone_number", "comment": "Phone number associated with the user"}, "email_list_ids": {"type": "text", "index": 12, "name": "email_list_ids", "comment": "Array of all email lists associated with the user, derived from the list_user table relationships"}, "count_lists": {"type": "bigint", "index": 13, "name": "count_lists", "comment": "Total count of lists associated with the user"}, "count_total_campaigns": {"type": "bigint", "index": 14, "name": "count_total_campaigns", "comment": "Count of all campaigns the user has been in"}, "first_event_at": {"type": "timestamp without time zone", "index": 15, "name": "first_event_at", "comment": "The first event the user ever encountered"}, "last_event_at": {"type": "timestamp without time zone", "index": 16, "name": "last_event_at", "comment": "The most recent event the user has encountered"}, "total_emailclick": {"type": "numeric", "index": 17, "name": "total_emailclick", "comment": "Total number of email clicks the user has performed"}, "total_emailunsubscribe": {"type": "numeric", "index": 18, "name": "total_emailunsubscribe", "comment": "Total unsubscription events the user has performed"}, "total_emailcomplaint": {"type": "numeric", "index": 19, "name": "total_emailcomplaint", "comment": "Total email complaints the user has performed"}, "total_customevent": {"type": "numeric", "index": 20, "name": "total_customevent", "comment": "Total custom events associated with the user"}, "total_emailsubscribe": {"type": "numeric", "index": 21, "name": "total_emailsubscribe", "comment": "Total subscription events the user has performed"}, "total_emailopen": {"type": "numeric", "index": 22, "name": "total_emailopen", "comment": "Total email opened events the user has performed"}, "total_pushsend": {"type": "numeric", "index": 23, "name": "total_pushsend", "comment": "The push send events the user has experienced"}, "total_smsbounce": {"type": "numeric", "index": 24, "name": "total_smsbounce", "comment": "Total sms bounces that are associated with the user"}, "total_pushbounce": {"type": "numeric", "index": 25, "name": "total_pushbounce", "comment": "Total number of push bounces associated with the user"}, "total_inappsendskip": {"type": "numeric", "index": 26, "name": "total_inappsendskip", "comment": "Total in app send skips associated with the user"}, "total_smssend": {"type": "numeric", "index": 27, "name": "total_smssend", "comment": "Total sms sends that the user has experienced"}, "total_inappsend": {"type": "numeric", "index": 28, "name": "total_inappsend", "comment": "Total in app sends the user has experienced"}, "total_pushopen": {"type": "numeric", "index": 29, "name": "total_pushopen", "comment": "Total push messages the user has opened"}, "total_emailsend": {"type": "numeric", "index": 30, "name": "total_emailsend", "comment": "Total emails that have been sent to the user"}, "total_pushsendskip": {"type": "numeric", "index": 31, "name": "total_pushsendskip", "comment": "Total push sends the user has skipped"}, "total_inappopen": {"type": "numeric", "index": 32, "name": "total_inappopen", "comment": "Total in app opens the user has performed"}, "total_emailsendskip": {"type": "numeric", "index": 33, "name": "total_emailsendskip", "comment": "Total email sends the user has skipped"}, "total_emailbounce": {"type": "numeric", "index": 34, "name": "total_emailbounce", "comment": "Total number of emails that have bounced from the user"}, "total_inappclick": {"type": "numeric", "index": 35, "name": "total_inappclick", "comment": "Total in app clicks associated with the user"}, "total_pushuninstall": {"type": "numeric", "index": 36, "name": "total_pushuninstall", "comment": "Total push uninstall events the user has performed"}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.iterable__users"}, "model.iterable.stg_iterable__campaign_history": {"metadata": {"type": "BASE TABLE", "schema": "public_iterable_dev", "name": "stg_iterable__campaign_history", "database": "postgres", "comment": "Table containing a history of campaigns.", "owner": "postgres"}, "columns": {"source_relation": {"type": "text", "index": 1, "name": "source_relation", "comment": "Identifies the record's source."}, "campaign_id": {"type": "text", "index": 2, "name": "campaign_id", "comment": "Unique identifier of the campaign record"}, "updated_at": {"type": "text", "index": 3, "name": "updated_at", "comment": "Last update timestamp"}, "campaign_name": {"type": "text", "index": 4, "name": "campaign_name", "comment": "User defined name of the campaign."}, "campaign_state": {"type": "text", "index": 5, "name": "campaign_state", "comment": "State of the campaign. Can be Draft, Ready, Scheduled, Running, Finished, Starting, Aborted or Recurring"}, "campaign_type": {"type": "text", "index": 6, "name": "campaign_type", "comment": "The campaign type. Can be Blast or Triggered"}, "send_size": {"type": "integer", "index": 7, "name": "send_size", "comment": "Size of the campaign. Number of individuals included in the campaign"}, "start_at": {"type": "integer", "index": 8, "name": "start_at", "comment": "Start timestamp"}, "ended_at": {"type": "integer", "index": 9, "name": "ended_at", "comment": "Ended timestamp"}, "created_at": {"type": "text", "index": 10, "name": "created_at", "comment": "Creation timestamp"}, "message_medium": {"type": "text", "index": 11, "name": "message_medium", "comment": "The medium that this message was sent via, for example Email or InApp"}, "recurring_campaign_id": {"type": "text", "index": 12, "name": "recurring_campaign_id", "comment": "Reference to the recurring campaign, if applicable"}, "created_by_user_id": {"type": "text", "index": 13, "name": "created_by_user_id", "comment": "Reference to the user who created the campaign"}, "updated_by_user_id": {"type": "text", "index": 14, "name": "updated_by_user_id", "comment": "ID of the user who updated this record"}, "template_id": {"type": "text", "index": 15, "name": "template_id", "comment": "Reference to the campaign template"}, "workflow_id": {"type": "integer", "index": 16, "name": "workflow_id", "comment": "Reference to the workflow which the event originated"}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 17, "name": "_fivetran_synced", "comment": "The time when a record was last updated by Fivetran."}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.stg_iterable__campaign_history"}, "model.iterable.stg_iterable__campaign_history_tmp": {"metadata": {"type": "VIEW", "schema": "public_iterable_dev", "name": "stg_iterable__campaign_history_tmp", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"id": {"type": "integer", "index": 1, "name": "id", "comment": null}, "updated_at": {"type": "text", "index": 2, "name": "updated_at", "comment": null}, "template_id": {"type": "integer", "index": 3, "name": "template_id", "comment": null}, "recurring_campaign_id": {"type": "integer", "index": 4, "name": "recurring_campaign_id", "comment": null}, "campaign_state": {"type": "text", "index": 5, "name": "campaign_state", "comment": null}, "created_at": {"type": "text", "index": 6, "name": "created_at", "comment": null}, "created_by_user_id": {"type": "text", "index": 7, "name": "created_by_user_id", "comment": null}, "ended_at": {"type": "integer", "index": 8, "name": "ended_at", "comment": null}, "name": {"type": "text", "index": 9, "name": "name", "comment": null}, "send_size": {"type": "integer", "index": 10, "name": "send_size", "comment": null}, "start_at": {"type": "integer", "index": 11, "name": "start_at", "comment": null}, "type": {"type": "text", "index": 12, "name": "type", "comment": null}, "workflow_id": {"type": "integer", "index": 13, "name": "workflow_id", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 14, "name": "_fivetran_synced", "comment": null}, "updated_by_user_id": {"type": "integer", "index": 15, "name": "updated_by_user_id", "comment": null}, "message_medium": {"type": "text", "index": 16, "name": "message_medium", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.stg_iterable__campaign_history_tmp"}, "model.iterable.stg_iterable__campaign_label_history": {"metadata": {"type": "BASE TABLE", "schema": "public_iterable_dev", "name": "stg_iterable__campaign_label_history", "database": "postgres", "comment": "Table containing a history of labels.", "owner": "postgres"}, "columns": {"source_relation": {"type": "text", "index": 1, "name": "source_relation", "comment": "Identifies the record's source."}, "campaign_id": {"type": "text", "index": 2, "name": "campaign_id", "comment": "Reference to the campaign associated with the label"}, "label": {"type": "text", "index": 3, "name": "label", "comment": "Name of the label"}, "updated_at": {"type": "text", "index": 4, "name": "updated_at", "comment": "Last update timestamp"}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 5, "name": "_fivetran_synced", "comment": "The time when a record was last updated by Fivetran."}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.stg_iterable__campaign_label_history"}, "model.iterable.stg_iterable__campaign_label_history_tmp": {"metadata": {"type": "VIEW", "schema": "public_iterable_dev", "name": "stg_iterable__campaign_label_history_tmp", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"campaign_id": {"type": "integer", "index": 1, "name": "campaign_id", "comment": null}, "label": {"type": "text", "index": 2, "name": "label", "comment": null}, "updated_at": {"type": "text", "index": 3, "name": "updated_at", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 4, "name": "_fivetran_synced", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.stg_iterable__campaign_label_history_tmp"}, "model.iterable.stg_iterable__campaign_list_history": {"metadata": {"type": "BASE TABLE", "schema": "public_iterable_dev", "name": "stg_iterable__campaign_list_history", "database": "postgres", "comment": "Table containing a history of lists.", "owner": "postgres"}, "columns": {"source_relation": {"type": "text", "index": 1, "name": "source_relation", "comment": "Identifies the record's source."}, "campaign_id": {"type": "text", "index": 2, "name": "campaign_id", "comment": "Reference to the campaign associated with the label"}, "list_id": {"type": "text", "index": 3, "name": "list_id", "comment": "Reference to the list used"}, "updated_at": {"type": "text", "index": 4, "name": "updated_at", "comment": "Last update timestamp"}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 5, "name": "_fivetran_synced", "comment": "The time when a record was last updated by Fivetran."}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.stg_iterable__campaign_list_history"}, "model.iterable.stg_iterable__campaign_list_history_tmp": {"metadata": {"type": "VIEW", "schema": "public_iterable_dev", "name": "stg_iterable__campaign_list_history_tmp", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"list_id": {"type": "integer", "index": 1, "name": "list_id", "comment": null}, "campaign_id": {"type": "integer", "index": 2, "name": "campaign_id", "comment": null}, "updated_at": {"type": "text", "index": 3, "name": "updated_at", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 4, "name": "_fivetran_synced", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.stg_iterable__campaign_list_history_tmp"}, "model.iterable.stg_iterable__campaign_suppression_list_history": {"metadata": {"type": "BASE TABLE", "schema": "public_iterable_dev", "name": "stg_iterable__campaign_suppression_list_history", "database": "postgres", "comment": "Table containing a history of suppression lists.", "owner": "postgres"}, "columns": {"source_relation": {"type": "text", "index": 1, "name": "source_relation", "comment": "Identifies the record's source."}, "campaign_id": {"type": "text", "index": 2, "name": "campaign_id", "comment": "Reference to the campaign associated with the label"}, "suppressed_list_id": {"type": "text", "index": 3, "name": "suppressed_list_id", "comment": "Reference to the list used"}, "updated_at": {"type": "text", "index": 4, "name": "updated_at", "comment": "Last update timestamp"}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 5, "name": "_fivetran_synced", "comment": "The time when a record was last updated by Fivetran."}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.stg_iterable__campaign_suppression_list_history"}, "model.iterable.stg_iterable__campaign_suppression_list_history_tmp": {"metadata": {"type": "VIEW", "schema": "public_iterable_dev", "name": "stg_iterable__campaign_suppression_list_history_tmp", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"suppressed_list_id": {"type": "integer", "index": 1, "name": "suppressed_list_id", "comment": null}, "campaign_id": {"type": "integer", "index": 2, "name": "campaign_id", "comment": null}, "updated_at": {"type": "text", "index": 3, "name": "updated_at", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 4, "name": "_fivetran_synced", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.stg_iterable__campaign_suppression_list_history_tmp"}, "model.iterable.stg_iterable__channel": {"metadata": {"type": "BASE TABLE", "schema": "public_iterable_dev", "name": "stg_iterable__channel", "database": "postgres", "comment": "Table containing unique channels.", "owner": "postgres"}, "columns": {"source_relation": {"type": "text", "index": 1, "name": "source_relation", "comment": "Identifies the record's source."}, "channel_id": {"type": "text", "index": 2, "name": "channel_id", "comment": "Unique identifier of the channel"}, "channel_name": {"type": "text", "index": 3, "name": "channel_name", "comment": "User defined name of the channel"}, "channel_type": {"type": "text", "index": 4, "name": "channel_type", "comment": "The channel type"}, "message_medium": {"type": "text", "index": 5, "name": "message_medium", "comment": "The message medium associated with the channel"}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 6, "name": "_fivetran_synced", "comment": "The time when a record was last updated by Fivetran."}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.stg_iterable__channel"}, "model.iterable.stg_iterable__channel_tmp": {"metadata": {"type": "VIEW", "schema": "public_iterable_dev", "name": "stg_iterable__channel_tmp", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"id": {"type": "bigint", "index": 1, "name": "id", "comment": null}, "name": {"type": "text", "index": 2, "name": "name", "comment": null}, "channel_type": {"type": "text", "index": 3, "name": "channel_type", "comment": null}, "message_medium": {"type": "text", "index": 4, "name": "message_medium", "comment": null}, "_fivetran_deleted": {"type": "boolean", "index": 5, "name": "_fivetran_deleted", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 6, "name": "_fivetran_synced", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.stg_iterable__channel_tmp"}, "model.iterable.stg_iterable__event": {"metadata": {"type": "VIEW", "schema": "public_iterable_dev", "name": "stg_iterable__event", "database": "postgres", "comment": "Table containing individual events within campaigns.", "owner": "postgres"}, "columns": {"source_relation": {"type": "text", "index": 1, "name": "source_relation", "comment": "Identifies the record's source."}, "event_id": {"type": "text", "index": 2, "name": "event_id", "comment": "A Fivetran-created unique identifier derived from hashing campaign_id, created_at, and event_name."}, "unique_event_id": {"type": "text", "index": 3, "name": "unique_event_id", "comment": "A surrogate key made up of event_id, _fivetran_user_id, and source_relation."}, "_fivetran_user_id": {"type": "text", "index": 4, "name": "_fivetran_user_id", "comment": "A Fivetran-created unique identifier for users, derived from hashing user_id and/or email, depending on project type. This exists for users of the new schema starting Aug 2023. In the old schema, the unique identifier is email."}, "unique_user_key": {"type": "text", "index": 5, "name": "unique_user_key", "comment": "The unique identifier of the user. With the new schema (Aug 2023), it is the _fivetran_user_id. This is a hash of user_id and/or email, depending on project type. If using the old schema, it is email."}, "campaign_id": {"type": "text", "index": 6, "name": "campaign_id", "comment": "Reference to the campaign from which the event originated"}, "content_id": {"type": "text", "index": 7, "name": "content_id", "comment": "Reference to the content the event is associated with"}, "created_at": {"type": "timestamp without time zone", "index": 8, "name": "created_at", "comment": "Creation timestamp"}, "created_on": {"type": "date", "index": 9, "name": "created_on", "comment": "Creation date"}, "email": {"type": "text", "index": 10, "name": "email", "comment": "Reference to the unique user the event was applied to"}, "additional_properties": {"type": "text", "index": 11, "name": "additional_properties", "comment": "json object containing addition event properties"}, "event_name": {"type": "text", "index": 12, "name": "event_name", "comment": "Name provided to the individual event"}, "message_bus_id": {"type": "text", "index": 13, "name": "message_bus_id", "comment": "Reference to the message bus associated with the event"}, "message_id": {"type": "text", "index": 14, "name": "message_id", "comment": "Reference to the message the event is associated with"}, "message_type_id": {"type": "text", "index": 15, "name": "message_type_id", "comment": "Reference to the type of message the event is associated with"}, "recipient_state": {"type": "integer", "index": 16, "name": "recipient_state", "comment": "The state of the recipient upon receiving the event"}, "status": {"type": "integer", "index": 17, "name": "status", "comment": "Status of the event"}, "transactional_data": {"type": "character varying(100)", "index": 18, "name": "transactional_data", "comment": "Transactional data associated with the event"}, "unsub_source": {"type": "integer", "index": 19, "name": "unsub_source", "comment": "Source of the unsubscribe event"}, "user_agent": {"type": "integer", "index": 20, "name": "user_agent", "comment": "User agent associated with the event"}, "user_agent_device": {"type": "integer", "index": 21, "name": "user_agent_device", "comment": "The device of the user agent"}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 22, "name": "_fivetran_synced", "comment": "The time when a record was last updated by Fivetran."}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.stg_iterable__event"}, "model.iterable.stg_iterable__event_extension": {"metadata": {"type": "VIEW", "schema": "public_iterable_dev", "name": "stg_iterable__event_extension", "database": "postgres", "comment": "Table containing addition properties from the event table.", "owner": "postgres"}, "columns": {"source_relation": {"type": "text", "index": 1, "name": "source_relation", "comment": "Identifies the record's source."}, "event_id": {"type": "text", "index": 2, "name": "event_id", "comment": "A Fivetran-created unique identifier derived from hashing campaign_id, created_at, and event_name."}, "unique_event_id": {"type": "text", "index": 3, "name": "unique_event_id", "comment": "A surrogate key made up of event_id, _fivetran_user_id, and source_relation."}, "is_app_already_running": {"type": "integer", "index": 4, "name": "is_app_already_running", "comment": "Boolean indicating if the app is currently running or not"}, "badge": {"type": "integer", "index": 5, "name": "badge", "comment": "Badge associated with the event"}, "catalog_collection_count": {"type": "integer", "index": 6, "name": "catalog_collection_count", "comment": "The count of products or items collected in a catalog associated with the event."}, "catalog_lookup_count": {"type": "integer", "index": 7, "name": "catalog_lookup_count", "comment": "The count of times a catalog was looked up or queried during the event."}, "canonical_url_id": {"type": "text", "index": 8, "name": "canonical_url_id", "comment": "Reference to the url associated with the event"}, "is_content_available": {"type": "integer", "index": 9, "name": "is_content_available", "comment": "Content available from the event"}, "content_id": {"type": "text", "index": 10, "name": "content_id", "comment": "Reference to the content associated with the event"}, "device": {"type": "integer", "index": 11, "name": "device", "comment": "The device associated with the event"}, "email_id": {"type": "text", "index": 12, "name": "email_id", "comment": "Reference to the email associated with the event"}, "email_subject": {"type": "text", "index": 13, "name": "email_subject", "comment": "Subject of the email associated with the event"}, "experiment_id": {"type": "integer", "index": 14, "name": "experiment_id", "comment": "Reference to the experiment used if the event is an experiment"}, "from_phone_number_id": {"type": "integer", "index": 15, "name": "from_phone_number_id", "comment": "Reference to the phone number which the event is from"}, "from_smssender_id": {"type": "integer", "index": 16, "name": "from_smssender_id", "comment": "Reference to the sms sender which the event is from"}, "link_id": {"type": "text", "index": 17, "name": "link_id", "comment": "Reference to the link associated with the event"}, "link_url": {"type": "integer", "index": 18, "name": "link_url", "comment": "Url of the link associated with the event"}, "locale": {"type": "integer", "index": 19, "name": "locale", "comment": "Locale associated with the event"}, "payload": {"type": "character varying(100)", "index": 20, "name": "payload", "comment": "Payload resulted from the event"}, "platform_endpoint": {"type": "integer", "index": 21, "name": "platform_endpoint", "comment": "The specific platform endpoint of the event"}, "push_message": {"type": "integer", "index": 22, "name": "push_message", "comment": "Boolean indicating if the event is a push message"}, "region": {"type": "text", "index": 23, "name": "region", "comment": "Region of the event"}, "sms_message": {"type": "integer", "index": 24, "name": "sms_message", "comment": "Boolean indicating if the event is an sms message"}, "to_phone_number": {"type": "integer", "index": 25, "name": "to_phone_number", "comment": "To phone number associated with the event"}, "url": {"type": "integer", "index": 26, "name": "url", "comment": "Url associated with the event"}, "workflow_id": {"type": "text", "index": 27, "name": "workflow_id", "comment": "Reference to the workflow which the event originated"}, "workflow_name": {"type": "text", "index": 28, "name": "workflow_name", "comment": "Name of the workflow which the event originated"}, "city": {"type": "text", "index": 29, "name": "city", "comment": "The city associated with the event, which could be the location of the recipient."}, "clicked_url": {"type": "text", "index": 30, "name": "clicked_url", "comment": "The URL that was clicked by the recipient in response to the marketing message."}, "country": {"type": "text", "index": 31, "name": "country", "comment": "The country associated with the event, which could be the location of the recipient."}, "error_code": {"type": "integer", "index": 32, "name": "error_code", "comment": "The error code or message indicating any issues or errors encountered during the event."}, "expires_at": {"type": "text", "index": 33, "name": "expires_at", "comment": "The date and time when the event or message is set to expire or become invalid."}, "from_phone_number": {"type": "integer", "index": 34, "name": "from_phone_number", "comment": "The phone number from which the SMS message was sent."}, "in_app_body": {"type": "text", "index": 35, "name": "in_app_body", "comment": "The content or body of an in-app message that was sent as part of the event."}, "is_sms_estimation": {"type": "boolean", "index": 36, "name": "is_sms_estimation", "comment": "A boolean indicating whether the SMS message is an estimation or not."}, "labels": {"type": "text", "index": 37, "name": "labels", "comment": "Any labels or tags associated with the event, which can be used for categorization or organization."}, "message_status": {"type": "text", "index": 38, "name": "message_status", "comment": "The status of the marketing message, such as sent, delivered, opened, etc."}, "mms_send_count": {"type": "integer", "index": 39, "name": "mms_send_count", "comment": "The count of multimedia messages (MMS) sent as part of the event."}, "reason": {"type": "text", "index": 40, "name": "reason", "comment": "The reason or cause associated with a specific event or action."}, "sms_send_count": {"type": "integer", "index": 41, "name": "sms_send_count", "comment": "The count of SMS messages sent as part of the event."}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 42, "name": "_fivetran_synced", "comment": "The time when a record was last updated by Fivetran."}, "_fivetran_user_id": {"type": "text", "index": 43, "name": "_fivetran_user_id", "comment": "A Fivetran-created unique identifier for users, derived from hashing user_id and/or email, depending on project type. This exists for users of the new schema starting Aug 2023. In the old schema, the unique identifier is email."}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.stg_iterable__event_extension"}, "model.iterable.stg_iterable__event_extension_tmp": {"metadata": {"type": "VIEW", "schema": "public_iterable_dev", "name": "stg_iterable__event_extension_tmp", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"_fivetran_id": {"type": "text", "index": 1, "name": "_fivetran_id", "comment": null}, "app_already_running": {"type": "integer", "index": 2, "name": "app_already_running", "comment": null}, "badge": {"type": "integer", "index": 3, "name": "badge", "comment": null}, "canonical_url_id": {"type": "integer", "index": 4, "name": "canonical_url_id", "comment": null}, "content_available": {"type": "integer", "index": 5, "name": "content_available", "comment": null}, "content_id": {"type": "integer", "index": 6, "name": "content_id", "comment": null}, "device": {"type": "integer", "index": 7, "name": "device", "comment": null}, "email_id": {"type": "text", "index": 8, "name": "email_id", "comment": null}, "email_subject": {"type": "text", "index": 9, "name": "email_subject", "comment": null}, "experiment_id": {"type": "integer", "index": 10, "name": "experiment_id", "comment": null}, "from_phone_number_id": {"type": "integer", "index": 11, "name": "from_phone_number_id", "comment": null}, "from_smssender_id": {"type": "integer", "index": 12, "name": "from_smssender_id", "comment": null}, "image_url": {"type": "integer", "index": 13, "name": "image_url", "comment": null}, "is_ghost_push": {"type": "integer", "index": 14, "name": "is_ghost_push", "comment": null}, "link_id": {"type": "integer", "index": 15, "name": "link_id", "comment": null}, "link_url": {"type": "integer", "index": 16, "name": "link_url", "comment": null}, "platform_endpoint": {"type": "integer", "index": 17, "name": "platform_endpoint", "comment": null}, "push_message": {"type": "integer", "index": 18, "name": "push_message", "comment": null}, "region": {"type": "text", "index": 19, "name": "region", "comment": null}, "sms_message": {"type": "integer", "index": 20, "name": "sms_message", "comment": null}, "sound": {"type": "integer", "index": 21, "name": "sound", "comment": null}, "to_phone_number": {"type": "integer", "index": 22, "name": "to_phone_number", "comment": null}, "url": {"type": "integer", "index": 23, "name": "url", "comment": null}, "workflow_id": {"type": "integer", "index": 24, "name": "workflow_id", "comment": null}, "workflow_name": {"type": "text", "index": 25, "name": "workflow_name", "comment": null}, "locale": {"type": "integer", "index": 26, "name": "locale", "comment": null}, "deeplink_android": {"type": "integer", "index": 27, "name": "deeplink_android", "comment": null}, "deeplink_ios": {"type": "integer", "index": 28, "name": "deeplink_ios", "comment": null}, "payload": {"type": "character varying(100)", "index": 29, "name": "payload", "comment": null}, "sms_provider_response_status": {"type": "integer", "index": 30, "name": "sms_provider_response_status", "comment": null}, "sms_provider_response_message": {"type": "integer", "index": 31, "name": "sms_provider_response_message", "comment": null}, "sms_provider_response_code": {"type": "integer", "index": 32, "name": "sms_provider_response_code", "comment": null}, "sms_provider_response_more_info": {"type": "integer", "index": 33, "name": "sms_provider_response_more_info", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 34, "name": "_fivetran_synced", "comment": null}, "catalog_collection_count": {"type": "integer", "index": 35, "name": "catalog_collection_count", "comment": null}, "catalog_lookup_count": {"type": "integer", "index": 36, "name": "catalog_lookup_count", "comment": null}, "city": {"type": "text", "index": 37, "name": "city", "comment": null}, "clicked_url": {"type": "text", "index": 38, "name": "clicked_url", "comment": null}, "country": {"type": "text", "index": 39, "name": "country", "comment": null}, "error_code": {"type": "integer", "index": 40, "name": "error_code", "comment": null}, "expires_at": {"type": "text", "index": 41, "name": "expires_at", "comment": null}, "from_phone_number": {"type": "integer", "index": 42, "name": "from_phone_number", "comment": null}, "in_app_body": {"type": "text", "index": 43, "name": "in_app_body", "comment": null}, "is_sms_estimation": {"type": "boolean", "index": 44, "name": "is_sms_estimation", "comment": null}, "labels": {"type": "text", "index": 45, "name": "labels", "comment": null}, "message_context": {"type": "text", "index": 46, "name": "message_context", "comment": null}, "message_status": {"type": "text", "index": 47, "name": "message_status", "comment": null}, "mms_send_count": {"type": "integer", "index": 48, "name": "mms_send_count", "comment": null}, "product_recommendation_count": {"type": "integer", "index": 49, "name": "product_recommendation_count", "comment": null}, "proxy_source": {"type": "text", "index": 50, "name": "proxy_source", "comment": null}, "reason": {"type": "text", "index": 51, "name": "reason", "comment": null}, "sms_send_count": {"type": "integer", "index": 52, "name": "sms_send_count", "comment": null}, "web_push_body": {"type": "text", "index": 53, "name": "web_push_body", "comment": null}, "web_push_click_action": {"type": "text", "index": 54, "name": "web_push_click_action", "comment": null}, "web_push_icon": {"type": "text", "index": 55, "name": "web_push_icon", "comment": null}, "web_push_message": {"type": "text", "index": 56, "name": "web_push_message", "comment": null}, "_fivetran_user_id": {"type": "integer", "index": 57, "name": "_fivetran_user_id", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.stg_iterable__event_extension_tmp"}, "model.iterable.stg_iterable__event_tmp": {"metadata": {"type": "VIEW", "schema": "public_iterable_dev", "name": "stg_iterable__event_tmp", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"_fivetran_id": {"type": "text", "index": 1, "name": "_fivetran_id", "comment": null}, "email": {"type": "text", "index": 2, "name": "email", "comment": null}, "campaign_id": {"type": "integer", "index": 3, "name": "campaign_id", "comment": null}, "message_id": {"type": "integer", "index": 4, "name": "message_id", "comment": null}, "content_id": {"type": "integer", "index": 5, "name": "content_id", "comment": null}, "created_at": {"type": "timestamp without time zone", "index": 6, "name": "created_at", "comment": null}, "event_name": {"type": "text", "index": 7, "name": "event_name", "comment": null}, "ip": {"type": "integer", "index": 8, "name": "ip", "comment": null}, "message_bus_id": {"type": "integer", "index": 9, "name": "message_bus_id", "comment": null}, "message_type_id": {"type": "integer", "index": 10, "name": "message_type_id", "comment": null}, "recipient_state": {"type": "integer", "index": 11, "name": "recipient_state", "comment": null}, "status": {"type": "integer", "index": 12, "name": "status", "comment": null}, "unsub_source": {"type": "integer", "index": 13, "name": "unsub_source", "comment": null}, "user_agent": {"type": "integer", "index": 14, "name": "user_agent", "comment": null}, "user_agent_device": {"type": "integer", "index": 15, "name": "user_agent_device", "comment": null}, "transactional_data": {"type": "character varying(100)", "index": 16, "name": "transactional_data", "comment": null}, "additional_properties": {"type": "text", "index": 17, "name": "additional_properties", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 18, "name": "_fivetran_synced", "comment": null}, "_fivetran_user_id": {"type": "integer", "index": 19, "name": "_fivetran_user_id", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.stg_iterable__event_tmp"}, "model.iterable.stg_iterable__list": {"metadata": {"type": "BASE TABLE", "schema": "public_iterable_dev", "name": "stg_iterable__list", "database": "postgres", "comment": "Table containing users and the lists the users are associated with.", "owner": "postgres"}, "columns": {"source_relation": {"type": "text", "index": 1, "name": "source_relation", "comment": "Identifies the record's source."}, "list_id": {"type": "integer", "index": 2, "name": "list_id", "comment": "Unique identifier of the list"}, "list_name": {"type": "text", "index": 3, "name": "list_name", "comment": "User defined name of the list"}, "list_type": {"type": "text", "index": 4, "name": "list_type", "comment": "The list type"}, "created_at": {"type": "text", "index": 5, "name": "created_at", "comment": "Creation timestamp"}, "list_description": {"type": "text", "index": 6, "name": "list_description", "comment": "Information about the list"}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 7, "name": "_fivetran_synced", "comment": "The time when a record was last updated by Fivetran."}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.stg_iterable__list"}, "model.iterable.stg_iterable__list_tmp": {"metadata": {"type": "VIEW", "schema": "public_iterable_dev", "name": "stg_iterable__list_tmp", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"id": {"type": "integer", "index": 1, "name": "id", "comment": null}, "name": {"type": "text", "index": 2, "name": "name", "comment": null}, "created_at": {"type": "text", "index": 3, "name": "created_at", "comment": null}, "list_type": {"type": "text", "index": 4, "name": "list_type", "comment": null}, "_fivetran_deleted": {"type": "boolean", "index": 5, "name": "_fivetran_deleted", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 6, "name": "_fivetran_synced", "comment": null}, "description": {"type": "text", "index": 7, "name": "description", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.stg_iterable__list_tmp"}, "model.iterable.stg_iterable__list_user": {"metadata": {"type": "BASE TABLE", "schema": "public_iterable_dev", "name": "stg_iterable__list_user", "database": "postgres", "comment": "Table containing the relationship between users and lists they belong to.", "owner": "postgres"}, "columns": {"source_relation": {"type": "text", "index": 1, "name": "source_relation", "comment": "Identifies the record's source."}, "_fivetran_user_id": {"type": "text", "index": 2, "name": "_fivetran_user_id", "comment": "Unique identifier of the list-user relationship record, serving as a foreign key to `stg_iterable__user_history._fivetran_id`."}, "list_user_index": {"type": "bigint", "index": 3, "name": "list_user_index", "comment": "Index of the record"}, "list_id": {"type": "bigint", "index": 4, "name": "list_id", "comment": "Reference to the list that the user belongs to"}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 5, "name": "_fivetran_synced", "comment": "The time when a record was last updated by Fivetran."}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.stg_iterable__list_user"}, "model.iterable.stg_iterable__list_user_tmp": {"metadata": {"type": "VIEW", "schema": "public_iterable_dev", "name": "stg_iterable__list_user_tmp", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"_fivetran_id": {"type": "text", "index": 1, "name": "_fivetran_id", "comment": null}, "index": {"type": "bigint", "index": 2, "name": "index", "comment": null}, "list_id": {"type": "bigint", "index": 3, "name": "list_id", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 4, "name": "_fivetran_synced", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.stg_iterable__list_user_tmp"}, "model.iterable.stg_iterable__message_type": {"metadata": {"type": "BASE TABLE", "schema": "public_iterable_dev", "name": "stg_iterable__message_type", "database": "postgres", "comment": "Table containing unique message types.", "owner": "postgres"}, "columns": {"source_relation": {"type": "text", "index": 1, "name": "source_relation", "comment": "Identifies the record's source."}, "message_type_id": {"type": "text", "index": 2, "name": "message_type_id", "comment": "Unique identifier of the message type"}, "message_type_name": {"type": "text", "index": 3, "name": "message_type_name", "comment": "User defined name of the message type"}, "channel_id": {"type": "text", "index": 4, "name": "channel_id", "comment": "Channel that this message type belongs to"}, "message_type_created_at": {"type": "timestamp without time zone", "index": 5, "name": "message_type_created_at", "comment": "Time when the message type was initially created"}, "frequency_cap": {"type": "integer", "index": 6, "name": "frequency_cap", "comment": "The maximum number of times a message of this type can be sent to a recipient within a specified time period to prevent over-messaging"}, "rate_limit_per_minute": {"type": "integer", "index": 7, "name": "rate_limit_per_minute", "comment": "The maximum number of messages of this type that can be sent to recipients in a minute, ensuring controlled message delivery"}, "subscription_policy": {"type": "text", "index": 8, "name": "subscription_policy", "comment": "Information about the policy or rules governing how users can subscribe to or unsubscribe from this specific message type, like OptOut"}, "message_type_updated_at": {"type": "timestamp without time zone", "index": 9, "name": "message_type_updated_at", "comment": "Time when the message type was last updated or modified"}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 10, "name": "_fivetran_synced", "comment": "The time when a record was last updated by Fivetran."}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.stg_iterable__message_type"}, "model.iterable.stg_iterable__message_type_tmp": {"metadata": {"type": "VIEW", "schema": "public_iterable_dev", "name": "stg_iterable__message_type_tmp", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"id": {"type": "bigint", "index": 1, "name": "id", "comment": null}, "name": {"type": "text", "index": 2, "name": "name", "comment": null}, "channel_id": {"type": "bigint", "index": 3, "name": "channel_id", "comment": null}, "_fivetran_deleted": {"type": "boolean", "index": 4, "name": "_fivetran_deleted", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 5, "name": "_fivetran_synced", "comment": null}, "created_at": {"type": "timestamp without time zone", "index": 6, "name": "created_at", "comment": null}, "frequency_cap": {"type": "integer", "index": 7, "name": "frequency_cap", "comment": null}, "rate_limit_per_minute": {"type": "integer", "index": 8, "name": "rate_limit_per_minute", "comment": null}, "subscription_policy": {"type": "text", "index": 9, "name": "subscription_policy", "comment": null}, "updated_at": {"type": "timestamp without time zone", "index": 10, "name": "updated_at", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.stg_iterable__message_type_tmp"}, "model.iterable.stg_iterable__template_history": {"metadata": {"type": "BASE TABLE", "schema": "public_iterable_dev", "name": "stg_iterable__template_history", "database": "postgres", "comment": "Table containing unique templates used across campaigns.", "owner": "postgres"}, "columns": {"source_relation": {"type": "text", "index": 1, "name": "source_relation", "comment": "Identifies the record's source."}, "template_id": {"type": "text", "index": 2, "name": "template_id", "comment": "Unique identifier of the template"}, "template_name": {"type": "text", "index": 3, "name": "template_name", "comment": "User defined name of the template"}, "template_type": {"type": "text", "index": 4, "name": "template_type", "comment": "The type of the template"}, "created_at": {"type": "text", "index": 5, "name": "created_at", "comment": "Creation timestamp"}, "client_template_id": {"type": "text", "index": 6, "name": "client_template_id", "comment": "Reference to the client template"}, "creator_user_id": {"type": "text", "index": 7, "name": "creator_user_id", "comment": "Reference to the user who created the template"}, "message_type_id": {"type": "text", "index": 8, "name": "message_type_id", "comment": "Reference to the message type associated with the template"}, "updated_at": {"type": "text", "index": 9, "name": "updated_at", "comment": "Last update timestamp"}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 10, "name": "_fivetran_synced", "comment": "The time when a record was last updated by Fivetran."}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.stg_iterable__template_history"}, "model.iterable.stg_iterable__template_history_tmp": {"metadata": {"type": "VIEW", "schema": "public_iterable_dev", "name": "stg_iterable__template_history_tmp", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"id": {"type": "integer", "index": 1, "name": "id", "comment": null}, "updated_at": {"type": "text", "index": 2, "name": "updated_at", "comment": null}, "message_type_id": {"type": "integer", "index": 3, "name": "message_type_id", "comment": null}, "client_template_id": {"type": "integer", "index": 4, "name": "client_template_id", "comment": null}, "created_at": {"type": "text", "index": 5, "name": "created_at", "comment": null}, "creator_user_id": {"type": "text", "index": 6, "name": "creator_user_id", "comment": null}, "name": {"type": "text", "index": 7, "name": "name", "comment": null}, "template_type": {"type": "text", "index": 8, "name": "template_type", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 9, "name": "_fivetran_synced", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.stg_iterable__template_history_tmp"}, "model.iterable.stg_iterable__user_history": {"metadata": {"type": "VIEW", "schema": "public_iterable_dev", "name": "stg_iterable__user_history", "database": "postgres", "comment": "Table containing individual user history information.", "owner": "postgres"}, "columns": {"source_relation": {"type": "text", "index": 1, "name": "source_relation", "comment": "Identifies the record's source."}, "_fivetran_user_id": {"type": "text", "index": 2, "name": "_fivetran_user_id", "comment": "A Fivetran-created unique identifier for users, derived from hashing user_id and/or email, depending on project type. This exists for users of the new schema starting Aug 2023. In the old schema, the unique identifier is email."}, "email": {"type": "text", "index": 3, "name": "email", "comment": "The user's email. User identifier, for email-based projects. Previously was the unique identifier for user records, for the old Iterable schema before the August 2023 updates."}, "updated_at": {"type": "timestamp without time zone", "index": 4, "name": "updated_at", "comment": "Last update timestamp"}, "user_id": {"type": "text", "index": 5, "name": "user_id", "comment": "User identifier, for userID-based projects."}, "first_name": {"type": "integer", "index": 6, "name": "first_name", "comment": "First name of the user"}, "last_name": {"type": "integer", "index": 7, "name": "last_name", "comment": "Last name of the user"}, "email_list_ids": {"type": "text", "index": 8, "name": "email_list_ids", "comment": "[DEPRECATED October 13, 2025. Use LIST_USER source instead.] Array of references to the lists associated with the user.\n"}, "phone_number": {"type": "integer", "index": 9, "name": "phone_number", "comment": "Phone number associated with the user"}, "signup_date": {"type": "text", "index": 10, "name": "signup_date", "comment": "Timestamp of when the user signed up"}, "signup_source": {"type": "text", "index": 11, "name": "signup_source", "comment": "Source where the user signed up"}, "iterable_user_id": {"type": "text", "index": 12, "name": "iterable_user_id", "comment": "Another user identifier, for userID-based projects"}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 13, "name": "_fivetran_synced", "comment": "The time when a record was last updated by Fivetran."}, "unique_user_key": {"type": "text", "index": 14, "name": "unique_user_key", "comment": "The unique identifier of the user. With the new schema (Aug 2023), it is the _fivetran_user_id. This is a hash of user_id and/or email, depending on project type. If using the old schema, it is email."}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.stg_iterable__user_history"}, "model.iterable.stg_iterable__user_history_tmp": {"metadata": {"type": "VIEW", "schema": "public_iterable_dev", "name": "stg_iterable__user_history_tmp", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"email": {"type": "text", "index": 1, "name": "email", "comment": null}, "updated_at": {"type": "timestamp without time zone", "index": 2, "name": "updated_at", "comment": null}, "first_name": {"type": "integer", "index": 3, "name": "first_name", "comment": null}, "last_name": {"type": "integer", "index": 4, "name": "last_name", "comment": null}, "phone_number": {"type": "integer", "index": 5, "name": "phone_number", "comment": null}, "user_id": {"type": "integer", "index": 6, "name": "user_id", "comment": null}, "signup_date": {"type": "text", "index": 7, "name": "signup_date", "comment": null}, "signup_source": {"type": "text", "index": 8, "name": "signup_source", "comment": null}, "phone_number_carrier": {"type": "integer", "index": 9, "name": "phone_number_carrier", "comment": null}, "phone_number_country_code_iso": {"type": "integer", "index": 10, "name": "phone_number_country_code_iso", "comment": null}, "phone_number_line_type": {"type": "integer", "index": 11, "name": "phone_number_line_type", "comment": null}, "phone_number_updated_at": {"type": "integer", "index": 12, "name": "phone_number_updated_at", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 13, "name": "_fivetran_synced", "comment": null}, "email_list_ids": {"type": "text", "index": 14, "name": "email_list_ids", "comment": null}, "iterable_user_id": {"type": "integer", "index": 15, "name": "iterable_user_id", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.stg_iterable__user_history_tmp"}, "model.iterable.stg_iterable__user_unsub_message_type": {"metadata": {"type": "BASE TABLE", "schema": "public_iterable_dev", "name": "stg_iterable__user_unsub_message_type", "database": "postgres", "comment": "Table containing the message types from which a user has unsubscribed. \"Unsubscribed\" is shortened to \"unsub\" for postgres compatibility.", "owner": "postgres"}, "columns": {"source_relation": {"type": "text", "index": 1, "name": "source_relation", "comment": "Identifies the record's source."}, "_fivetran_user_id": {"type": "text", "index": 2, "name": "_fivetran_user_id", "comment": "A Fivetran-created unique identifier for users, derived from hashing user_id and/or email, depending on project type. This exists for users of the new schema starting Aug 2023. In the old schema, the unique identifier is email."}, "unique_user_key": {"type": "text", "index": 3, "name": "unique_user_key", "comment": "The unique identifier of the user. With the new schema (Aug 2023), it is the _fivetran_user_id. This is a hash of user_id and/or email, depending on project type. If using the old schema, it is email."}, "message_type_id": {"type": "text", "index": 4, "name": "message_type_id", "comment": "Reference to the message type from which the user unsubscribed"}, "unsub_message_type_unique_key": {"type": "text", "index": 5, "name": "unsub_message_type_unique_key", "comment": "A surrogate key providing a unique key for each record. If using user_unsubscribed_message_type_history, it uses '_fivetran_id', 'email', 'message_type_id', 'updated_at', and 'source_relation'. If not using the history table, it uses '_fivetran_id', 'message_type_id', and 'source_relation'."}, "latest_batch_index": {"type": "integer", "index": 6, "name": "latest_batch_index", "comment": "Indexes each user record based on the most recent available."}, "updated_at": {"type": "timestamp without time zone", "index": 7, "name": "updated_at", "comment": "Last update timestamp"}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 8, "name": "_fivetran_synced", "comment": "The time when a record was last updated by Fivetran."}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.stg_iterable__user_unsub_message_type"}, "model.iterable.stg_iterable__user_unsub_message_type_tmp": {"metadata": {"type": "VIEW", "schema": "public_iterable_dev", "name": "stg_iterable__user_unsub_message_type_tmp", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"_fivetran_id": {"type": "text", "index": 1, "name": "_fivetran_id", "comment": null}, "message_type_id": {"type": "integer", "index": 2, "name": "message_type_id", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 3, "name": "_fivetran_synced", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.stg_iterable__user_unsub_message_type_tmp"}, "model.iterable.stg_iterable__user_unsubscribed_channel": {"metadata": {"type": "BASE TABLE", "schema": "public_iterable_dev", "name": "stg_iterable__user_unsubscribed_channel", "database": "postgres", "comment": "Table containing the history of channels from which a user has unsubscribed.", "owner": "postgres"}, "columns": {"source_relation": {"type": "text", "index": 1, "name": "source_relation", "comment": "Identifies the record's source."}, "_fivetran_user_id": {"type": "text", "index": 2, "name": "_fivetran_user_id", "comment": "A Fivetran-created unique identifier for users, derived from hashing user_id and/or email, depending on project type. This exists for users of the new schema starting Aug 2023. In the old schema, the unique identifier is email."}, "unique_user_key": {"type": "text", "index": 3, "name": "unique_user_key", "comment": "The unique identifier of the user. With the new schema (Aug 2023), it is the _fivetran_user_id. This is a hash of user_id and/or email, depending on project type. If using the old schema, it is email."}, "channel_id": {"type": "text", "index": 4, "name": "channel_id", "comment": "Reference to the channel from which the user unsubscribed"}, "unsub_channel_unique_key": {"type": "text", "index": 5, "name": "unsub_channel_unique_key", "comment": "A surrogate key providing a unique key for each record. If using user_unsubscribed_channel_history, it uses '_fivetran_id', 'channel_id', 'email', 'updated_at', and 'source_relation'. If not using the history table, it uses '_fivetran_id', 'channel_id', and 'source_relation'."}, "latest_batch_index": {"type": "integer", "index": 6, "name": "latest_batch_index", "comment": "Indexes each user record based on the most recent available."}, "updated_at": {"type": "timestamp without time zone", "index": 7, "name": "updated_at", "comment": "Last update timestamp"}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 8, "name": "_fivetran_synced", "comment": "The time when a record was last updated by Fivetran."}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.stg_iterable__user_unsubscribed_channel"}, "model.iterable.stg_iterable__user_unsubscribed_channel_tmp": {"metadata": {"type": "VIEW", "schema": "public_iterable_dev", "name": "stg_iterable__user_unsubscribed_channel_tmp", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"_fivetran_id": {"type": "text", "index": 1, "name": "_fivetran_id", "comment": null}, "channel_id": {"type": "integer", "index": 2, "name": "channel_id", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 3, "name": "_fivetran_synced", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.stg_iterable__user_unsubscribed_channel_tmp"}}, "sources": {"source.iterable.iterable.campaign_history": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "campaign_history_data", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"id": {"type": "integer", "index": 1, "name": "id", "comment": null}, "updated_at": {"type": "text", "index": 2, "name": "updated_at", "comment": null}, "template_id": {"type": "integer", "index": 3, "name": "template_id", "comment": null}, "recurring_campaign_id": {"type": "integer", "index": 4, "name": "recurring_campaign_id", "comment": null}, "campaign_state": {"type": "text", "index": 5, "name": "campaign_state", "comment": null}, "created_at": {"type": "text", "index": 6, "name": "created_at", "comment": null}, "created_by_user_id": {"type": "text", "index": 7, "name": "created_by_user_id", "comment": null}, "ended_at": {"type": "integer", "index": 8, "name": "ended_at", "comment": null}, "name": {"type": "text", "index": 9, "name": "name", "comment": null}, "send_size": {"type": "integer", "index": 10, "name": "send_size", "comment": null}, "start_at": {"type": "integer", "index": 11, "name": "start_at", "comment": null}, "type": {"type": "text", "index": 12, "name": "type", "comment": null}, "workflow_id": {"type": "integer", "index": 13, "name": "workflow_id", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 14, "name": "_fivetran_synced", "comment": null}, "updated_by_user_id": {"type": "integer", "index": 15, "name": "updated_by_user_id", "comment": null}, "message_medium": {"type": "text", "index": 16, "name": "message_medium", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.iterable.iterable.campaign_history"}, "source.iterable.iterable.campaign_label_history": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "campaign_label_history_data", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"campaign_id": {"type": "integer", "index": 1, "name": "campaign_id", "comment": null}, "label": {"type": "text", "index": 2, "name": "label", "comment": null}, "updated_at": {"type": "text", "index": 3, "name": "updated_at", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 4, "name": "_fivetran_synced", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.iterable.iterable.campaign_label_history"}, "source.iterable.iterable.campaign_list_history": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "campaign_list_history_data", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"list_id": {"type": "integer", "index": 1, "name": "list_id", "comment": null}, "campaign_id": {"type": "integer", "index": 2, "name": "campaign_id", "comment": null}, "updated_at": {"type": "text", "index": 3, "name": "updated_at", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 4, "name": "_fivetran_synced", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.iterable.iterable.campaign_list_history"}, "source.iterable.iterable.campaign_suppression_list_history": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "campaign_suppression_list_history_data", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"suppressed_list_id": {"type": "integer", "index": 1, "name": "suppressed_list_id", "comment": null}, "campaign_id": {"type": "integer", "index": 2, "name": "campaign_id", "comment": null}, "updated_at": {"type": "text", "index": 3, "name": "updated_at", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 4, "name": "_fivetran_synced", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.iterable.iterable.campaign_suppression_list_history"}, "source.iterable.iterable.channel": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "channel_data", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"id": {"type": "bigint", "index": 1, "name": "id", "comment": null}, "name": {"type": "text", "index": 2, "name": "name", "comment": null}, "channel_type": {"type": "text", "index": 3, "name": "channel_type", "comment": null}, "message_medium": {"type": "text", "index": 4, "name": "message_medium", "comment": null}, "_fivetran_deleted": {"type": "boolean", "index": 5, "name": "_fivetran_deleted", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 6, "name": "_fivetran_synced", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.iterable.iterable.channel"}, "source.iterable.iterable.event": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "event_data", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"_fivetran_id": {"type": "text", "index": 1, "name": "_fivetran_id", "comment": null}, "email": {"type": "text", "index": 2, "name": "email", "comment": null}, "campaign_id": {"type": "integer", "index": 3, "name": "campaign_id", "comment": null}, "message_id": {"type": "integer", "index": 4, "name": "message_id", "comment": null}, "content_id": {"type": "integer", "index": 5, "name": "content_id", "comment": null}, "created_at": {"type": "timestamp without time zone", "index": 6, "name": "created_at", "comment": null}, "event_name": {"type": "text", "index": 7, "name": "event_name", "comment": null}, "ip": {"type": "integer", "index": 8, "name": "ip", "comment": null}, "message_bus_id": {"type": "integer", "index": 9, "name": "message_bus_id", "comment": null}, "message_type_id": {"type": "integer", "index": 10, "name": "message_type_id", "comment": null}, "recipient_state": {"type": "integer", "index": 11, "name": "recipient_state", "comment": null}, "status": {"type": "integer", "index": 12, "name": "status", "comment": null}, "unsub_source": {"type": "integer", "index": 13, "name": "unsub_source", "comment": null}, "user_agent": {"type": "integer", "index": 14, "name": "user_agent", "comment": null}, "user_agent_device": {"type": "integer", "index": 15, "name": "user_agent_device", "comment": null}, "transactional_data": {"type": "character varying(100)", "index": 16, "name": "transactional_data", "comment": null}, "additional_properties": {"type": "text", "index": 17, "name": "additional_properties", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 18, "name": "_fivetran_synced", "comment": null}, "_fivetran_user_id": {"type": "integer", "index": 19, "name": "_fivetran_user_id", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.iterable.iterable.event"}, "source.iterable.iterable.event_extension": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "event_extension_data", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"_fivetran_id": {"type": "text", "index": 1, "name": "_fivetran_id", "comment": null}, "app_already_running": {"type": "integer", "index": 2, "name": "app_already_running", "comment": null}, "badge": {"type": "integer", "index": 3, "name": "badge", "comment": null}, "canonical_url_id": {"type": "integer", "index": 4, "name": "canonical_url_id", "comment": null}, "content_available": {"type": "integer", "index": 5, "name": "content_available", "comment": null}, "content_id": {"type": "integer", "index": 6, "name": "content_id", "comment": null}, "device": {"type": "integer", "index": 7, "name": "device", "comment": null}, "email_id": {"type": "text", "index": 8, "name": "email_id", "comment": null}, "email_subject": {"type": "text", "index": 9, "name": "email_subject", "comment": null}, "experiment_id": {"type": "integer", "index": 10, "name": "experiment_id", "comment": null}, "from_phone_number_id": {"type": "integer", "index": 11, "name": "from_phone_number_id", "comment": null}, "from_smssender_id": {"type": "integer", "index": 12, "name": "from_smssender_id", "comment": null}, "image_url": {"type": "integer", "index": 13, "name": "image_url", "comment": null}, "is_ghost_push": {"type": "integer", "index": 14, "name": "is_ghost_push", "comment": null}, "link_id": {"type": "integer", "index": 15, "name": "link_id", "comment": null}, "link_url": {"type": "integer", "index": 16, "name": "link_url", "comment": null}, "platform_endpoint": {"type": "integer", "index": 17, "name": "platform_endpoint", "comment": null}, "push_message": {"type": "integer", "index": 18, "name": "push_message", "comment": null}, "region": {"type": "text", "index": 19, "name": "region", "comment": null}, "sms_message": {"type": "integer", "index": 20, "name": "sms_message", "comment": null}, "sound": {"type": "integer", "index": 21, "name": "sound", "comment": null}, "to_phone_number": {"type": "integer", "index": 22, "name": "to_phone_number", "comment": null}, "url": {"type": "integer", "index": 23, "name": "url", "comment": null}, "workflow_id": {"type": "integer", "index": 24, "name": "workflow_id", "comment": null}, "workflow_name": {"type": "text", "index": 25, "name": "workflow_name", "comment": null}, "locale": {"type": "integer", "index": 26, "name": "locale", "comment": null}, "deeplink_android": {"type": "integer", "index": 27, "name": "deeplink_android", "comment": null}, "deeplink_ios": {"type": "integer", "index": 28, "name": "deeplink_ios", "comment": null}, "payload": {"type": "character varying(100)", "index": 29, "name": "payload", "comment": null}, "sms_provider_response_status": {"type": "integer", "index": 30, "name": "sms_provider_response_status", "comment": null}, "sms_provider_response_message": {"type": "integer", "index": 31, "name": "sms_provider_response_message", "comment": null}, "sms_provider_response_code": {"type": "integer", "index": 32, "name": "sms_provider_response_code", "comment": null}, "sms_provider_response_more_info": {"type": "integer", "index": 33, "name": "sms_provider_response_more_info", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 34, "name": "_fivetran_synced", "comment": null}, "catalog_collection_count": {"type": "integer", "index": 35, "name": "catalog_collection_count", "comment": null}, "catalog_lookup_count": {"type": "integer", "index": 36, "name": "catalog_lookup_count", "comment": null}, "city": {"type": "text", "index": 37, "name": "city", "comment": null}, "clicked_url": {"type": "text", "index": 38, "name": "clicked_url", "comment": null}, "country": {"type": "text", "index": 39, "name": "country", "comment": null}, "error_code": {"type": "integer", "index": 40, "name": "error_code", "comment": null}, "expires_at": {"type": "text", "index": 41, "name": "expires_at", "comment": null}, "from_phone_number": {"type": "integer", "index": 42, "name": "from_phone_number", "comment": null}, "in_app_body": {"type": "text", "index": 43, "name": "in_app_body", "comment": null}, "is_sms_estimation": {"type": "boolean", "index": 44, "name": "is_sms_estimation", "comment": null}, "labels": {"type": "text", "index": 45, "name": "labels", "comment": null}, "message_context": {"type": "text", "index": 46, "name": "message_context", "comment": null}, "message_status": {"type": "text", "index": 47, "name": "message_status", "comment": null}, "mms_send_count": {"type": "integer", "index": 48, "name": "mms_send_count", "comment": null}, "product_recommendation_count": {"type": "integer", "index": 49, "name": "product_recommendation_count", "comment": null}, "proxy_source": {"type": "text", "index": 50, "name": "proxy_source", "comment": null}, "reason": {"type": "text", "index": 51, "name": "reason", "comment": null}, "sms_send_count": {"type": "integer", "index": 52, "name": "sms_send_count", "comment": null}, "web_push_body": {"type": "text", "index": 53, "name": "web_push_body", "comment": null}, "web_push_click_action": {"type": "text", "index": 54, "name": "web_push_click_action", "comment": null}, "web_push_icon": {"type": "text", "index": 55, "name": "web_push_icon", "comment": null}, "web_push_message": {"type": "text", "index": 56, "name": "web_push_message", "comment": null}, "_fivetran_user_id": {"type": "integer", "index": 57, "name": "_fivetran_user_id", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.iterable.iterable.event_extension"}, "source.iterable.iterable.list": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "list_data", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"id": {"type": "integer", "index": 1, "name": "id", "comment": null}, "name": {"type": "text", "index": 2, "name": "name", "comment": null}, "created_at": {"type": "text", "index": 3, "name": "created_at", "comment": null}, "list_type": {"type": "text", "index": 4, "name": "list_type", "comment": null}, "_fivetran_deleted": {"type": "boolean", "index": 5, "name": "_fivetran_deleted", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 6, "name": "_fivetran_synced", "comment": null}, "description": {"type": "text", "index": 7, "name": "description", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.iterable.iterable.list"}, "source.iterable.iterable.list_user": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "list_user_data", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"_fivetran_id": {"type": "text", "index": 1, "name": "_fivetran_id", "comment": null}, "index": {"type": "bigint", "index": 2, "name": "index", "comment": null}, "list_id": {"type": "bigint", "index": 3, "name": "list_id", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 4, "name": "_fivetran_synced", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.iterable.iterable.list_user"}, "source.iterable.iterable.message_type": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "message_type_data", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"id": {"type": "bigint", "index": 1, "name": "id", "comment": null}, "name": {"type": "text", "index": 2, "name": "name", "comment": null}, "channel_id": {"type": "bigint", "index": 3, "name": "channel_id", "comment": null}, "_fivetran_deleted": {"type": "boolean", "index": 4, "name": "_fivetran_deleted", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 5, "name": "_fivetran_synced", "comment": null}, "created_at": {"type": "timestamp without time zone", "index": 6, "name": "created_at", "comment": null}, "frequency_cap": {"type": "integer", "index": 7, "name": "frequency_cap", "comment": null}, "rate_limit_per_minute": {"type": "integer", "index": 8, "name": "rate_limit_per_minute", "comment": null}, "subscription_policy": {"type": "text", "index": 9, "name": "subscription_policy", "comment": null}, "updated_at": {"type": "timestamp without time zone", "index": 10, "name": "updated_at", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.iterable.iterable.message_type"}, "source.iterable.iterable.template_history": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "template_history_data", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"id": {"type": "integer", "index": 1, "name": "id", "comment": null}, "updated_at": {"type": "text", "index": 2, "name": "updated_at", "comment": null}, "message_type_id": {"type": "integer", "index": 3, "name": "message_type_id", "comment": null}, "client_template_id": {"type": "integer", "index": 4, "name": "client_template_id", "comment": null}, "created_at": {"type": "text", "index": 5, "name": "created_at", "comment": null}, "creator_user_id": {"type": "text", "index": 6, "name": "creator_user_id", "comment": null}, "name": {"type": "text", "index": 7, "name": "name", "comment": null}, "template_type": {"type": "text", "index": 8, "name": "template_type", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 9, "name": "_fivetran_synced", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.iterable.iterable.template_history"}, "source.iterable.iterable.user_history": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "user_history_data", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"email": {"type": "text", "index": 1, "name": "email", "comment": null}, "updated_at": {"type": "timestamp without time zone", "index": 2, "name": "updated_at", "comment": null}, "first_name": {"type": "integer", "index": 3, "name": "first_name", "comment": null}, "last_name": {"type": "integer", "index": 4, "name": "last_name", "comment": null}, "phone_number": {"type": "integer", "index": 5, "name": "phone_number", "comment": null}, "user_id": {"type": "integer", "index": 6, "name": "user_id", "comment": null}, "signup_date": {"type": "text", "index": 7, "name": "signup_date", "comment": null}, "signup_source": {"type": "text", "index": 8, "name": "signup_source", "comment": null}, "phone_number_carrier": {"type": "integer", "index": 9, "name": "phone_number_carrier", "comment": null}, "phone_number_country_code_iso": {"type": "integer", "index": 10, "name": "phone_number_country_code_iso", "comment": null}, "phone_number_line_type": {"type": "integer", "index": 11, "name": "phone_number_line_type", "comment": null}, "phone_number_updated_at": {"type": "integer", "index": 12, "name": "phone_number_updated_at", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 13, "name": "_fivetran_synced", "comment": null}, "email_list_ids": {"type": "text", "index": 14, "name": "email_list_ids", "comment": null}, "iterable_user_id": {"type": "integer", "index": 15, "name": "iterable_user_id", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.iterable.iterable.user_history"}, "source.iterable.iterable.user_unsubscribed_channel": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "user_unsubscribed_channel_data", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"_fivetran_id": {"type": "text", "index": 1, "name": "_fivetran_id", "comment": null}, "channel_id": {"type": "integer", "index": 2, "name": "channel_id", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 3, "name": "_fivetran_synced", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.iterable.iterable.user_unsubscribed_channel"}, "source.iterable.iterable.user_unsubscribed_channel_history": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "user_unsubscribed_channel_history_data", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"email": {"type": "text", "index": 1, "name": "email", "comment": null}, "channel_id": {"type": "bigint", "index": 2, "name": "channel_id", "comment": null}, "updated_at": {"type": "text", "index": 3, "name": "updated_at", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 4, "name": "_fivetran_synced", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.iterable.iterable.user_unsubscribed_channel_history"}, "source.iterable.iterable.user_unsubscribed_message_type": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "user_unsubscribed_message_type_data", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"_fivetran_id": {"type": "text", "index": 1, "name": "_fivetran_id", "comment": null}, "message_type_id": {"type": "integer", "index": 2, "name": "message_type_id", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 3, "name": "_fivetran_synced", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.iterable.iterable.user_unsubscribed_message_type"}, "source.iterable.iterable.user_unsubscribed_message_type_history": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "user_unsubscribed_message_type_history_data", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"message_type_id": {"type": "integer", "index": 1, "name": "message_type_id", "comment": null}, "email": {"type": "text", "index": 2, "name": "email", "comment": null}, "updated_at": {"type": "text", "index": 3, "name": "updated_at", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 4, "name": "_fivetran_synced", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.iterable.iterable.user_unsubscribed_message_type_history"}}, "errors": null} \ No newline at end of file +{"metadata": {"dbt_schema_version": "https://schemas.getdbt.com/dbt/catalog/v1.json", "dbt_version": "1.12.4", "generated_at": "2026-09-10T22:23:30.455429Z", "invocation_id": "5d6e507e-b2ab-4c2e-82a3-c9b3883d2ddc", "invocation_started_at": "2026-09-10T22:23:28.447126Z", "env": {}}, "nodes": {"seed.iterable_integration_tests.campaign_history_data": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "campaign_history_data", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"id": {"type": "integer", "index": 1, "name": "id", "comment": null}, "updated_at": {"type": "text", "index": 2, "name": "updated_at", "comment": null}, "template_id": {"type": "integer", "index": 3, "name": "template_id", "comment": null}, "recurring_campaign_id": {"type": "integer", "index": 4, "name": "recurring_campaign_id", "comment": null}, "campaign_state": {"type": "text", "index": 5, "name": "campaign_state", "comment": null}, "created_at": {"type": "text", "index": 6, "name": "created_at", "comment": null}, "created_by_user_id": {"type": "text", "index": 7, "name": "created_by_user_id", "comment": null}, "ended_at": {"type": "integer", "index": 8, "name": "ended_at", "comment": null}, "name": {"type": "text", "index": 9, "name": "name", "comment": null}, "send_size": {"type": "integer", "index": 10, "name": "send_size", "comment": null}, "start_at": {"type": "integer", "index": 11, "name": "start_at", "comment": null}, "type": {"type": "text", "index": 12, "name": "type", "comment": null}, "workflow_id": {"type": "integer", "index": 13, "name": "workflow_id", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 14, "name": "_fivetran_synced", "comment": null}, "updated_by_user_id": {"type": "integer", "index": 15, "name": "updated_by_user_id", "comment": null}, "message_medium": {"type": "text", "index": 16, "name": "message_medium", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.iterable_integration_tests.campaign_history_data"}, "seed.iterable_integration_tests.campaign_label_history_data": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "campaign_label_history_data", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"campaign_id": {"type": "integer", "index": 1, "name": "campaign_id", "comment": null}, "label": {"type": "text", "index": 2, "name": "label", "comment": null}, "updated_at": {"type": "text", "index": 3, "name": "updated_at", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 4, "name": "_fivetran_synced", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.iterable_integration_tests.campaign_label_history_data"}, "seed.iterable_integration_tests.campaign_list_history_data": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "campaign_list_history_data", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"list_id": {"type": "integer", "index": 1, "name": "list_id", "comment": null}, "campaign_id": {"type": "integer", "index": 2, "name": "campaign_id", "comment": null}, "updated_at": {"type": "text", "index": 3, "name": "updated_at", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 4, "name": "_fivetran_synced", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.iterable_integration_tests.campaign_list_history_data"}, "seed.iterable_integration_tests.campaign_metrics_data": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "campaign_metrics_data", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"date": {"type": "date", "index": 1, "name": "date", "comment": null}, "id": {"type": "integer", "index": 2, "name": "id", "comment": null}, "_fivetran_deleted": {"type": "boolean", "index": 3, "name": "_fivetran_deleted", "comment": null}, "average_order_value": {"type": "integer", "index": 4, "name": "average_order_value", "comment": null}, "purchases": {"type": "integer", "index": 5, "name": "purchases", "comment": null}, "revenue": {"type": "integer", "index": 6, "name": "revenue", "comment": null}, "revenue_m": {"type": "integer", "index": 7, "name": "revenue_m", "comment": null}, "total_app_uninstalls": {"type": "integer", "index": 8, "name": "total_app_uninstalls", "comment": null}, "total_complaints": {"type": "integer", "index": 9, "name": "total_complaints", "comment": null}, "total_email_bounced": {"type": "integer", "index": 10, "name": "total_email_bounced", "comment": null}, "total_email_clicked": {"type": "integer", "index": 11, "name": "total_email_clicked", "comment": null}, "total_email_delivered": {"type": "integer", "index": 12, "name": "total_email_delivered", "comment": null}, "total_email_opens": {"type": "integer", "index": 13, "name": "total_email_opens", "comment": null}, "total_email_sends": {"type": "integer", "index": 14, "name": "total_email_sends", "comment": null}, "total_hosted_unsubscribe_clicks": {"type": "integer", "index": 15, "name": "total_hosted_unsubscribe_clicks", "comment": null}, "total_purchases": {"type": "integer", "index": 16, "name": "total_purchases", "comment": null}, "total_pushes_bounced": {"type": "integer", "index": 17, "name": "total_pushes_bounced", "comment": null}, "total_pushes_delivered": {"type": "integer", "index": 18, "name": "total_pushes_delivered", "comment": null}, "total_pushes_opened": {"type": "integer", "index": 19, "name": "total_pushes_opened", "comment": null}, "total_pushes_sent": {"type": "integer", "index": 20, "name": "total_pushes_sent", "comment": null}, "total_unsubscribes": {"type": "integer", "index": 21, "name": "total_unsubscribes", "comment": null}, "unique_email_bounced": {"type": "integer", "index": 22, "name": "unique_email_bounced", "comment": null}, "unique_email_clicks": {"type": "integer", "index": 23, "name": "unique_email_clicks", "comment": null}, "unique_email_opens_or_clicks": {"type": "integer", "index": 24, "name": "unique_email_opens_or_clicks", "comment": null}, "unique_hosted_unsubscribe_clicks": {"type": "integer", "index": 25, "name": "unique_hosted_unsubscribe_clicks", "comment": null}, "unique_purchases": {"type": "integer", "index": 26, "name": "unique_purchases", "comment": null}, "unique_pushes_bounced": {"type": "integer", "index": 27, "name": "unique_pushes_bounced", "comment": null}, "unique_pushes_opened": {"type": "integer", "index": 28, "name": "unique_pushes_opened", "comment": null}, "unique_pushes_sent": {"type": "integer", "index": 29, "name": "unique_pushes_sent", "comment": null}, "unique_unsubscribes": {"type": "integer", "index": 30, "name": "unique_unsubscribes", "comment": null}, "total_push_send_skips": {"type": "integer", "index": 31, "name": "total_push_send_skips", "comment": null}, "total_in_app_opens": {"type": "integer", "index": 32, "name": "total_in_app_opens", "comment": null}, "unique_in_apps_delivered": {"type": "integer", "index": 33, "name": "unique_in_apps_delivered", "comment": null}, "unique_in_app_sends": {"type": "integer", "index": 34, "name": "unique_in_app_sends", "comment": null}, "total_in_app_closes": {"type": "integer", "index": 35, "name": "total_in_app_closes", "comment": null}, "total_inbox_impressions": {"type": "integer", "index": 36, "name": "total_inbox_impressions", "comment": null}, "unique_pushes_delivered": {"type": "integer", "index": 37, "name": "unique_pushes_delivered", "comment": null}, "unique_in_app_clicks": {"type": "integer", "index": 38, "name": "unique_in_app_clicks", "comment": null}, "unique_emails_delivered": {"type": "integer", "index": 39, "name": "unique_emails_delivered", "comment": null}, "total_in_app_clicks": {"type": "integer", "index": 40, "name": "total_in_app_clicks", "comment": null}, "total_in_app_deletes": {"type": "integer", "index": 41, "name": "total_in_app_deletes", "comment": null}, "total_in_app_sent": {"type": "integer", "index": 42, "name": "total_in_app_sent", "comment": null}, "total_in_apps_delivered": {"type": "integer", "index": 43, "name": "total_in_apps_delivered", "comment": null}, "unique_in_app_opens": {"type": "integer", "index": 44, "name": "unique_in_app_opens", "comment": null}, "total_email_holdout": {"type": "integer", "index": 45, "name": "total_email_holdout", "comment": null}, "total_email_send_skips": {"type": "integer", "index": 46, "name": "total_email_send_skips", "comment": null}, "unique_email_sends": {"type": "integer", "index": 47, "name": "unique_email_sends", "comment": null}, "unique_emails_opens": {"type": "integer", "index": 48, "name": "unique_emails_opens", "comment": null}, "total_in_app_holdout": {"type": "integer", "index": 49, "name": "total_in_app_holdout", "comment": null}, "total_in_app_send_skips": {"type": "integer", "index": 50, "name": "total_in_app_send_skips", "comment": null}, "total_push_holdout": {"type": "integer", "index": 51, "name": "total_push_holdout", "comment": null}, "_fivetran_synced": {"type": "text", "index": 52, "name": "_fivetran_synced", "comment": null}, "total_sms_holdout": {"type": "integer", "index": 53, "name": "total_sms_holdout", "comment": null}, "unique_sms_sent": {"type": "integer", "index": 54, "name": "unique_sms_sent", "comment": null}, "total_sms_delivered": {"type": "integer", "index": 55, "name": "total_sms_delivered", "comment": null}, "total_sms_sent": {"type": "integer", "index": 56, "name": "total_sms_sent", "comment": null}, "total_inbound_sms": {"type": "integer", "index": 57, "name": "total_inbound_sms", "comment": null}, "total_sms_bounced": {"type": "integer", "index": 58, "name": "total_sms_bounced", "comment": null}, "total_sms_send_skips": {"type": "integer", "index": 59, "name": "total_sms_send_skips", "comment": null}, "unique_inbound_sms": {"type": "integer", "index": 60, "name": "unique_inbound_sms", "comment": null}, "unique_sms_delivered": {"type": "integer", "index": 61, "name": "unique_sms_delivered", "comment": null}, "unique_sms_bounced": {"type": "integer", "index": 62, "name": "unique_sms_bounced", "comment": null}, "revenue_m_sms_": {"type": "integer", "index": 63, "name": "revenue_m_sms_", "comment": null}, "purchases_m_sms_": {"type": "integer", "index": 64, "name": "purchases_m_sms_", "comment": null}, "purchases_m_email_": {"type": "integer", "index": 65, "name": "purchases_m_email_", "comment": null}, "revenue_m_push_": {"type": "integer", "index": 66, "name": "revenue_m_push_", "comment": null}, "revenue_m_email_": {"type": "integer", "index": 67, "name": "revenue_m_email_", "comment": null}, "purchases_m_push_": {"type": "integer", "index": 68, "name": "purchases_m_push_", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.iterable_integration_tests.campaign_metrics_data"}, "seed.iterable_integration_tests.campaign_suppression_list_history_data": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "campaign_suppression_list_history_data", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"suppressed_list_id": {"type": "integer", "index": 1, "name": "suppressed_list_id", "comment": null}, "campaign_id": {"type": "integer", "index": 2, "name": "campaign_id", "comment": null}, "updated_at": {"type": "text", "index": 3, "name": "updated_at", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 4, "name": "_fivetran_synced", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.iterable_integration_tests.campaign_suppression_list_history_data"}, "seed.iterable_integration_tests.channel_data": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "channel_data", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"id": {"type": "bigint", "index": 1, "name": "id", "comment": null}, "name": {"type": "text", "index": 2, "name": "name", "comment": null}, "channel_type": {"type": "text", "index": 3, "name": "channel_type", "comment": null}, "message_medium": {"type": "text", "index": 4, "name": "message_medium", "comment": null}, "_fivetran_deleted": {"type": "boolean", "index": 5, "name": "_fivetran_deleted", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 6, "name": "_fivetran_synced", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.iterable_integration_tests.channel_data"}, "seed.iterable_integration_tests.event_data": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "event_data", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"_fivetran_id": {"type": "text", "index": 1, "name": "_fivetran_id", "comment": null}, "email": {"type": "text", "index": 2, "name": "email", "comment": null}, "campaign_id": {"type": "integer", "index": 3, "name": "campaign_id", "comment": null}, "message_id": {"type": "integer", "index": 4, "name": "message_id", "comment": null}, "content_id": {"type": "integer", "index": 5, "name": "content_id", "comment": null}, "created_at": {"type": "timestamp without time zone", "index": 6, "name": "created_at", "comment": null}, "event_name": {"type": "text", "index": 7, "name": "event_name", "comment": null}, "ip": {"type": "integer", "index": 8, "name": "ip", "comment": null}, "message_bus_id": {"type": "integer", "index": 9, "name": "message_bus_id", "comment": null}, "message_type_id": {"type": "integer", "index": 10, "name": "message_type_id", "comment": null}, "recipient_state": {"type": "integer", "index": 11, "name": "recipient_state", "comment": null}, "status": {"type": "integer", "index": 12, "name": "status", "comment": null}, "unsub_source": {"type": "integer", "index": 13, "name": "unsub_source", "comment": null}, "user_agent": {"type": "integer", "index": 14, "name": "user_agent", "comment": null}, "user_agent_device": {"type": "integer", "index": 15, "name": "user_agent_device", "comment": null}, "transactional_data": {"type": "character varying(100)", "index": 16, "name": "transactional_data", "comment": null}, "additional_properties": {"type": "text", "index": 17, "name": "additional_properties", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 18, "name": "_fivetran_synced", "comment": null}, "_fivetran_user_id": {"type": "integer", "index": 19, "name": "_fivetran_user_id", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.iterable_integration_tests.event_data"}, "seed.iterable_integration_tests.event_extension_data": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "event_extension_data", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"_fivetran_id": {"type": "text", "index": 1, "name": "_fivetran_id", "comment": null}, "app_already_running": {"type": "integer", "index": 2, "name": "app_already_running", "comment": null}, "badge": {"type": "integer", "index": 3, "name": "badge", "comment": null}, "canonical_url_id": {"type": "integer", "index": 4, "name": "canonical_url_id", "comment": null}, "content_available": {"type": "integer", "index": 5, "name": "content_available", "comment": null}, "content_id": {"type": "integer", "index": 6, "name": "content_id", "comment": null}, "device": {"type": "integer", "index": 7, "name": "device", "comment": null}, "email_id": {"type": "text", "index": 8, "name": "email_id", "comment": null}, "email_subject": {"type": "text", "index": 9, "name": "email_subject", "comment": null}, "experiment_id": {"type": "integer", "index": 10, "name": "experiment_id", "comment": null}, "from_phone_number_id": {"type": "integer", "index": 11, "name": "from_phone_number_id", "comment": null}, "from_smssender_id": {"type": "integer", "index": 12, "name": "from_smssender_id", "comment": null}, "image_url": {"type": "integer", "index": 13, "name": "image_url", "comment": null}, "is_ghost_push": {"type": "integer", "index": 14, "name": "is_ghost_push", "comment": null}, "link_id": {"type": "integer", "index": 15, "name": "link_id", "comment": null}, "link_url": {"type": "integer", "index": 16, "name": "link_url", "comment": null}, "platform_endpoint": {"type": "integer", "index": 17, "name": "platform_endpoint", "comment": null}, "push_message": {"type": "integer", "index": 18, "name": "push_message", "comment": null}, "region": {"type": "text", "index": 19, "name": "region", "comment": null}, "sms_message": {"type": "integer", "index": 20, "name": "sms_message", "comment": null}, "sound": {"type": "integer", "index": 21, "name": "sound", "comment": null}, "to_phone_number": {"type": "integer", "index": 22, "name": "to_phone_number", "comment": null}, "url": {"type": "integer", "index": 23, "name": "url", "comment": null}, "workflow_id": {"type": "integer", "index": 24, "name": "workflow_id", "comment": null}, "workflow_name": {"type": "text", "index": 25, "name": "workflow_name", "comment": null}, "locale": {"type": "integer", "index": 26, "name": "locale", "comment": null}, "deeplink_android": {"type": "integer", "index": 27, "name": "deeplink_android", "comment": null}, "deeplink_ios": {"type": "integer", "index": 28, "name": "deeplink_ios", "comment": null}, "payload": {"type": "character varying(100)", "index": 29, "name": "payload", "comment": null}, "sms_provider_response_status": {"type": "integer", "index": 30, "name": "sms_provider_response_status", "comment": null}, "sms_provider_response_message": {"type": "integer", "index": 31, "name": "sms_provider_response_message", "comment": null}, "sms_provider_response_code": {"type": "integer", "index": 32, "name": "sms_provider_response_code", "comment": null}, "sms_provider_response_more_info": {"type": "integer", "index": 33, "name": "sms_provider_response_more_info", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 34, "name": "_fivetran_synced", "comment": null}, "catalog_collection_count": {"type": "integer", "index": 35, "name": "catalog_collection_count", "comment": null}, "catalog_lookup_count": {"type": "integer", "index": 36, "name": "catalog_lookup_count", "comment": null}, "city": {"type": "text", "index": 37, "name": "city", "comment": null}, "clicked_url": {"type": "text", "index": 38, "name": "clicked_url", "comment": null}, "country": {"type": "text", "index": 39, "name": "country", "comment": null}, "error_code": {"type": "integer", "index": 40, "name": "error_code", "comment": null}, "expires_at": {"type": "text", "index": 41, "name": "expires_at", "comment": null}, "from_phone_number": {"type": "integer", "index": 42, "name": "from_phone_number", "comment": null}, "in_app_body": {"type": "text", "index": 43, "name": "in_app_body", "comment": null}, "is_sms_estimation": {"type": "boolean", "index": 44, "name": "is_sms_estimation", "comment": null}, "labels": {"type": "text", "index": 45, "name": "labels", "comment": null}, "message_context": {"type": "text", "index": 46, "name": "message_context", "comment": null}, "message_status": {"type": "text", "index": 47, "name": "message_status", "comment": null}, "mms_send_count": {"type": "integer", "index": 48, "name": "mms_send_count", "comment": null}, "product_recommendation_count": {"type": "integer", "index": 49, "name": "product_recommendation_count", "comment": null}, "proxy_source": {"type": "text", "index": 50, "name": "proxy_source", "comment": null}, "reason": {"type": "text", "index": 51, "name": "reason", "comment": null}, "sms_send_count": {"type": "integer", "index": 52, "name": "sms_send_count", "comment": null}, "web_push_body": {"type": "text", "index": 53, "name": "web_push_body", "comment": null}, "web_push_click_action": {"type": "text", "index": 54, "name": "web_push_click_action", "comment": null}, "web_push_icon": {"type": "text", "index": 55, "name": "web_push_icon", "comment": null}, "web_push_message": {"type": "text", "index": 56, "name": "web_push_message", "comment": null}, "_fivetran_user_id": {"type": "integer", "index": 57, "name": "_fivetran_user_id", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.iterable_integration_tests.event_extension_data"}, "seed.iterable_integration_tests.journey_data": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "journey_data", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"id": {"type": "bigint", "index": 1, "name": "id", "comment": null}, "name": {"type": "text", "index": 2, "name": "name", "comment": null}, "journey_type": {"type": "text", "index": 3, "name": "journey_type", "comment": null}, "description": {"type": "text", "index": 4, "name": "description", "comment": null}, "creator_user_id": {"type": "text", "index": 5, "name": "creator_user_id", "comment": null}, "enabled": {"type": "boolean", "index": 6, "name": "enabled", "comment": null}, "is_archived": {"type": "boolean", "index": 7, "name": "is_archived", "comment": null}, "lifetime_limit": {"type": "bigint", "index": 8, "name": "lifetime_limit", "comment": null}, "simultaneous_limit": {"type": "bigint", "index": 9, "name": "simultaneous_limit", "comment": null}, "start_tile_id": {"type": "bigint", "index": 10, "name": "start_tile_id", "comment": null}, "trigger_event_names": {"type": "text", "index": 11, "name": "trigger_event_names", "comment": null}, "created_at": {"type": "timestamp without time zone", "index": 12, "name": "created_at", "comment": null}, "updated_at": {"type": "timestamp without time zone", "index": 13, "name": "updated_at", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 14, "name": "_fivetran_synced", "comment": null}, "draft_name": {"type": "text", "index": 15, "name": "draft_name", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.iterable_integration_tests.journey_data"}, "seed.iterable_integration_tests.list_data": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "list_data", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"id": {"type": "integer", "index": 1, "name": "id", "comment": null}, "name": {"type": "text", "index": 2, "name": "name", "comment": null}, "created_at": {"type": "text", "index": 3, "name": "created_at", "comment": null}, "list_type": {"type": "text", "index": 4, "name": "list_type", "comment": null}, "_fivetran_deleted": {"type": "boolean", "index": 5, "name": "_fivetran_deleted", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 6, "name": "_fivetran_synced", "comment": null}, "description": {"type": "text", "index": 7, "name": "description", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.iterable_integration_tests.list_data"}, "seed.iterable_integration_tests.list_user_data": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "list_user_data", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"_fivetran_id": {"type": "text", "index": 1, "name": "_fivetran_id", "comment": null}, "index": {"type": "bigint", "index": 2, "name": "index", "comment": null}, "list_id": {"type": "bigint", "index": 3, "name": "list_id", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 4, "name": "_fivetran_synced", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.iterable_integration_tests.list_user_data"}, "seed.iterable_integration_tests.message_type_data": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "message_type_data", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"id": {"type": "bigint", "index": 1, "name": "id", "comment": null}, "name": {"type": "text", "index": 2, "name": "name", "comment": null}, "channel_id": {"type": "bigint", "index": 3, "name": "channel_id", "comment": null}, "_fivetran_deleted": {"type": "boolean", "index": 4, "name": "_fivetran_deleted", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 5, "name": "_fivetran_synced", "comment": null}, "created_at": {"type": "timestamp without time zone", "index": 6, "name": "created_at", "comment": null}, "frequency_cap": {"type": "integer", "index": 7, "name": "frequency_cap", "comment": null}, "rate_limit_per_minute": {"type": "integer", "index": 8, "name": "rate_limit_per_minute", "comment": null}, "subscription_policy": {"type": "text", "index": 9, "name": "subscription_policy", "comment": null}, "updated_at": {"type": "timestamp without time zone", "index": 10, "name": "updated_at", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.iterable_integration_tests.message_type_data"}, "seed.iterable_integration_tests.template_history_data": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "template_history_data", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"id": {"type": "integer", "index": 1, "name": "id", "comment": null}, "updated_at": {"type": "text", "index": 2, "name": "updated_at", "comment": null}, "message_type_id": {"type": "integer", "index": 3, "name": "message_type_id", "comment": null}, "client_template_id": {"type": "integer", "index": 4, "name": "client_template_id", "comment": null}, "created_at": {"type": "text", "index": 5, "name": "created_at", "comment": null}, "creator_user_id": {"type": "text", "index": 6, "name": "creator_user_id", "comment": null}, "name": {"type": "text", "index": 7, "name": "name", "comment": null}, "template_type": {"type": "text", "index": 8, "name": "template_type", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 9, "name": "_fivetran_synced", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.iterable_integration_tests.template_history_data"}, "seed.iterable_integration_tests.user_history_bq_json_data": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "user_history_bq_json_data", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"email": {"type": "text", "index": 1, "name": "email", "comment": null}, "updated_at": {"type": "text", "index": 2, "name": "updated_at", "comment": null}, "first_name": {"type": "integer", "index": 3, "name": "first_name", "comment": null}, "last_name": {"type": "integer", "index": 4, "name": "last_name", "comment": null}, "phone_number": {"type": "integer", "index": 5, "name": "phone_number", "comment": null}, "user_id": {"type": "integer", "index": 6, "name": "user_id", "comment": null}, "signup_date": {"type": "text", "index": 7, "name": "signup_date", "comment": null}, "signup_source": {"type": "text", "index": 8, "name": "signup_source", "comment": null}, "phone_number_carrier": {"type": "integer", "index": 9, "name": "phone_number_carrier", "comment": null}, "phone_number_country_code_iso": {"type": "integer", "index": 10, "name": "phone_number_country_code_iso", "comment": null}, "phone_number_line_type": {"type": "integer", "index": 11, "name": "phone_number_line_type", "comment": null}, "phone_number_updated_at": {"type": "integer", "index": 12, "name": "phone_number_updated_at", "comment": null}, "_fivetran_synced": {"type": "text", "index": 13, "name": "_fivetran_synced", "comment": null}, "email_list_ids": {"type": "text", "index": 14, "name": "email_list_ids", "comment": null}, "iterable_user_id": {"type": "integer", "index": 15, "name": "iterable_user_id", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.iterable_integration_tests.user_history_bq_json_data"}, "seed.iterable_integration_tests.user_history_data": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "user_history_data", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"email": {"type": "text", "index": 1, "name": "email", "comment": null}, "updated_at": {"type": "timestamp without time zone", "index": 2, "name": "updated_at", "comment": null}, "first_name": {"type": "integer", "index": 3, "name": "first_name", "comment": null}, "last_name": {"type": "integer", "index": 4, "name": "last_name", "comment": null}, "phone_number": {"type": "integer", "index": 5, "name": "phone_number", "comment": null}, "user_id": {"type": "integer", "index": 6, "name": "user_id", "comment": null}, "signup_date": {"type": "text", "index": 7, "name": "signup_date", "comment": null}, "signup_source": {"type": "text", "index": 8, "name": "signup_source", "comment": null}, "phone_number_carrier": {"type": "integer", "index": 9, "name": "phone_number_carrier", "comment": null}, "phone_number_country_code_iso": {"type": "integer", "index": 10, "name": "phone_number_country_code_iso", "comment": null}, "phone_number_line_type": {"type": "integer", "index": 11, "name": "phone_number_line_type", "comment": null}, "phone_number_updated_at": {"type": "integer", "index": 12, "name": "phone_number_updated_at", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 13, "name": "_fivetran_synced", "comment": null}, "email_list_ids": {"type": "text", "index": 14, "name": "email_list_ids", "comment": null}, "iterable_user_id": {"type": "integer", "index": 15, "name": "iterable_user_id", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.iterable_integration_tests.user_history_data"}, "seed.iterable_integration_tests.user_unsubscribed_channel_data": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "user_unsubscribed_channel_data", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"_fivetran_id": {"type": "text", "index": 1, "name": "_fivetran_id", "comment": null}, "channel_id": {"type": "integer", "index": 2, "name": "channel_id", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 3, "name": "_fivetran_synced", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.iterable_integration_tests.user_unsubscribed_channel_data"}, "seed.iterable_integration_tests.user_unsubscribed_channel_history_data": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "user_unsubscribed_channel_history_data", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"email": {"type": "text", "index": 1, "name": "email", "comment": null}, "channel_id": {"type": "bigint", "index": 2, "name": "channel_id", "comment": null}, "updated_at": {"type": "text", "index": 3, "name": "updated_at", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 4, "name": "_fivetran_synced", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.iterable_integration_tests.user_unsubscribed_channel_history_data"}, "seed.iterable_integration_tests.user_unsubscribed_message_type_data": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "user_unsubscribed_message_type_data", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"_fivetran_id": {"type": "text", "index": 1, "name": "_fivetran_id", "comment": null}, "message_type_id": {"type": "integer", "index": 2, "name": "message_type_id", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 3, "name": "_fivetran_synced", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.iterable_integration_tests.user_unsubscribed_message_type_data"}, "seed.iterable_integration_tests.user_unsubscribed_message_type_history_data": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "user_unsubscribed_message_type_history_data", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"message_type_id": {"type": "integer", "index": 1, "name": "message_type_id", "comment": null}, "email": {"type": "text", "index": 2, "name": "email", "comment": null}, "updated_at": {"type": "text", "index": 3, "name": "updated_at", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 4, "name": "_fivetran_synced", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.iterable_integration_tests.user_unsubscribed_message_type_history_data"}, "model.iterable.int_iterable__campaign_event_metrics": {"metadata": {"type": "VIEW", "schema": "public_iterable_dev", "name": "int_iterable__campaign_event_metrics", "database": "postgres", "comment": "Table that generates relevant total and unique campaign/experiment level aggregations.", "owner": "postgres"}, "columns": {"source_relation": {"type": "text", "index": 1, "name": "source_relation", "comment": null}, "campaign_id": {"type": "text", "index": 2, "name": "campaign_id", "comment": null}, "template_id": {"type": "text", "index": 3, "name": "template_id", "comment": null}, "experiment_id": {"type": "integer", "index": 4, "name": "experiment_id", "comment": null}, "count_unique_users": {"type": "bigint", "index": 5, "name": "count_unique_users", "comment": null}, "total_emailclick": {"type": "numeric", "index": 6, "name": "total_emailclick", "comment": null}, "unique_total_emailclick": {"type": "bigint", "index": 7, "name": "unique_total_emailclick", "comment": null}, "total_emailunsubscribe": {"type": "numeric", "index": 8, "name": "total_emailunsubscribe", "comment": null}, "unique_total_emailunsubscribe": {"type": "bigint", "index": 9, "name": "unique_total_emailunsubscribe", "comment": null}, "total_emailcomplaint": {"type": "numeric", "index": 10, "name": "total_emailcomplaint", "comment": null}, "unique_total_emailcomplaint": {"type": "bigint", "index": 11, "name": "unique_total_emailcomplaint", "comment": null}, "total_customevent": {"type": "numeric", "index": 12, "name": "total_customevent", "comment": null}, "unique_total_customevent": {"type": "bigint", "index": 13, "name": "unique_total_customevent", "comment": null}, "total_emailsubscribe": {"type": "numeric", "index": 14, "name": "total_emailsubscribe", "comment": null}, "unique_total_emailsubscribe": {"type": "bigint", "index": 15, "name": "unique_total_emailsubscribe", "comment": null}, "total_emailopen": {"type": "numeric", "index": 16, "name": "total_emailopen", "comment": null}, "unique_total_emailopen": {"type": "bigint", "index": 17, "name": "unique_total_emailopen", "comment": null}, "total_pushsend": {"type": "numeric", "index": 18, "name": "total_pushsend", "comment": null}, "unique_total_pushsend": {"type": "bigint", "index": 19, "name": "unique_total_pushsend", "comment": null}, "total_smsbounce": {"type": "numeric", "index": 20, "name": "total_smsbounce", "comment": null}, "unique_total_smsbounce": {"type": "bigint", "index": 21, "name": "unique_total_smsbounce", "comment": null}, "total_pushbounce": {"type": "numeric", "index": 22, "name": "total_pushbounce", "comment": null}, "unique_total_pushbounce": {"type": "bigint", "index": 23, "name": "unique_total_pushbounce", "comment": null}, "total_inappsendskip": {"type": "numeric", "index": 24, "name": "total_inappsendskip", "comment": null}, "unique_total_inappsendskip": {"type": "bigint", "index": 25, "name": "unique_total_inappsendskip", "comment": null}, "total_smssend": {"type": "numeric", "index": 26, "name": "total_smssend", "comment": null}, "unique_total_smssend": {"type": "bigint", "index": 27, "name": "unique_total_smssend", "comment": null}, "total_inappsend": {"type": "numeric", "index": 28, "name": "total_inappsend", "comment": null}, "unique_total_inappsend": {"type": "bigint", "index": 29, "name": "unique_total_inappsend", "comment": null}, "total_pushopen": {"type": "numeric", "index": 30, "name": "total_pushopen", "comment": null}, "unique_total_pushopen": {"type": "bigint", "index": 31, "name": "unique_total_pushopen", "comment": null}, "total_emailsend": {"type": "numeric", "index": 32, "name": "total_emailsend", "comment": null}, "unique_total_emailsend": {"type": "bigint", "index": 33, "name": "unique_total_emailsend", "comment": null}, "total_pushsendskip": {"type": "numeric", "index": 34, "name": "total_pushsendskip", "comment": null}, "unique_total_pushsendskip": {"type": "bigint", "index": 35, "name": "unique_total_pushsendskip", "comment": null}, "total_inappopen": {"type": "numeric", "index": 36, "name": "total_inappopen", "comment": null}, "unique_total_inappopen": {"type": "bigint", "index": 37, "name": "unique_total_inappopen", "comment": null}, "total_emailsendskip": {"type": "numeric", "index": 38, "name": "total_emailsendskip", "comment": null}, "unique_total_emailsendskip": {"type": "bigint", "index": 39, "name": "unique_total_emailsendskip", "comment": null}, "total_emailbounce": {"type": "numeric", "index": 40, "name": "total_emailbounce", "comment": null}, "unique_total_emailbounce": {"type": "bigint", "index": 41, "name": "unique_total_emailbounce", "comment": null}, "total_inappclick": {"type": "numeric", "index": 42, "name": "total_inappclick", "comment": null}, "unique_total_inappclick": {"type": "bigint", "index": 43, "name": "unique_total_inappclick", "comment": null}, "total_pushuninstall": {"type": "numeric", "index": 44, "name": "total_pushuninstall", "comment": null}, "unique_total_pushuninstall": {"type": "bigint", "index": 45, "name": "unique_total_pushuninstall", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.int_iterable__campaign_event_metrics"}, "model.iterable.int_iterable__campaign_labels": {"metadata": {"type": "VIEW", "schema": "public_iterable_dev", "name": "int_iterable__campaign_labels", "database": "postgres", "comment": "Table that provides the distinct string aggregation of labels for each campaign.", "owner": "postgres"}, "columns": {"source_relation": {"type": "text", "index": 1, "name": "source_relation", "comment": null}, "campaign_id": {"type": "text", "index": 2, "name": "campaign_id", "comment": null}, "labels": {"type": "text", "index": 3, "name": "labels", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.int_iterable__campaign_labels"}, "model.iterable.int_iterable__campaign_lists": {"metadata": {"type": "VIEW", "schema": "public_iterable_dev", "name": "int_iterable__campaign_lists", "database": "postgres", "comment": "Table that identifies the suppressed and send lists associated with a campaign.", "owner": "postgres"}, "columns": {"source_relation": {"type": "text", "index": 1, "name": "source_relation", "comment": null}, "list_id": {"type": "text", "index": 2, "name": "list_id", "comment": null}, "campaign_id": {"type": "text", "index": 3, "name": "campaign_id", "comment": null}, "updated_at": {"type": "text", "index": 4, "name": "updated_at", "comment": null}, "list_activity": {"type": "text", "index": 5, "name": "list_activity", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.int_iterable__campaign_lists"}, "model.iterable.int_iterable__journey_event_metrics": {"metadata": {"type": "VIEW", "schema": "public_iterable_dev", "name": "int_iterable__journey_event_metrics", "database": "postgres", "comment": "Table that generates relevant total and unique journey level aggregations, rolled up from the user/campaign grain via the campaign's journey reference.", "owner": "postgres"}, "columns": {"source_relation": {"type": "text", "index": 1, "name": "source_relation", "comment": null}, "journey_id": {"type": "text", "index": 2, "name": "journey_id", "comment": null}, "count_total_campaigns": {"type": "bigint", "index": 3, "name": "count_total_campaigns", "comment": null}, "count_unique_users": {"type": "bigint", "index": 4, "name": "count_unique_users", "comment": null}, "first_event_at": {"type": "timestamp without time zone", "index": 5, "name": "first_event_at", "comment": null}, "last_event_at": {"type": "timestamp without time zone", "index": 6, "name": "last_event_at", "comment": null}, "total_emailclick": {"type": "numeric", "index": 7, "name": "total_emailclick", "comment": null}, "unique_total_emailclick": {"type": "bigint", "index": 8, "name": "unique_total_emailclick", "comment": null}, "total_emailunsubscribe": {"type": "numeric", "index": 9, "name": "total_emailunsubscribe", "comment": null}, "unique_total_emailunsubscribe": {"type": "bigint", "index": 10, "name": "unique_total_emailunsubscribe", "comment": null}, "total_emailcomplaint": {"type": "numeric", "index": 11, "name": "total_emailcomplaint", "comment": null}, "unique_total_emailcomplaint": {"type": "bigint", "index": 12, "name": "unique_total_emailcomplaint", "comment": null}, "total_customevent": {"type": "numeric", "index": 13, "name": "total_customevent", "comment": null}, "unique_total_customevent": {"type": "bigint", "index": 14, "name": "unique_total_customevent", "comment": null}, "total_emailsubscribe": {"type": "numeric", "index": 15, "name": "total_emailsubscribe", "comment": null}, "unique_total_emailsubscribe": {"type": "bigint", "index": 16, "name": "unique_total_emailsubscribe", "comment": null}, "total_emailopen": {"type": "numeric", "index": 17, "name": "total_emailopen", "comment": null}, "unique_total_emailopen": {"type": "bigint", "index": 18, "name": "unique_total_emailopen", "comment": null}, "total_pushsend": {"type": "numeric", "index": 19, "name": "total_pushsend", "comment": null}, "unique_total_pushsend": {"type": "bigint", "index": 20, "name": "unique_total_pushsend", "comment": null}, "total_smsbounce": {"type": "numeric", "index": 21, "name": "total_smsbounce", "comment": null}, "unique_total_smsbounce": {"type": "bigint", "index": 22, "name": "unique_total_smsbounce", "comment": null}, "total_pushbounce": {"type": "numeric", "index": 23, "name": "total_pushbounce", "comment": null}, "unique_total_pushbounce": {"type": "bigint", "index": 24, "name": "unique_total_pushbounce", "comment": null}, "total_inappsendskip": {"type": "numeric", "index": 25, "name": "total_inappsendskip", "comment": null}, "unique_total_inappsendskip": {"type": "bigint", "index": 26, "name": "unique_total_inappsendskip", "comment": null}, "total_smssend": {"type": "numeric", "index": 27, "name": "total_smssend", "comment": null}, "unique_total_smssend": {"type": "bigint", "index": 28, "name": "unique_total_smssend", "comment": null}, "total_inappsend": {"type": "numeric", "index": 29, "name": "total_inappsend", "comment": null}, "unique_total_inappsend": {"type": "bigint", "index": 30, "name": "unique_total_inappsend", "comment": null}, "total_pushopen": {"type": "numeric", "index": 31, "name": "total_pushopen", "comment": null}, "unique_total_pushopen": {"type": "bigint", "index": 32, "name": "unique_total_pushopen", "comment": null}, "total_emailsend": {"type": "numeric", "index": 33, "name": "total_emailsend", "comment": null}, "unique_total_emailsend": {"type": "bigint", "index": 34, "name": "unique_total_emailsend", "comment": null}, "total_pushsendskip": {"type": "numeric", "index": 35, "name": "total_pushsendskip", "comment": null}, "unique_total_pushsendskip": {"type": "bigint", "index": 36, "name": "unique_total_pushsendskip", "comment": null}, "total_inappopen": {"type": "numeric", "index": 37, "name": "total_inappopen", "comment": null}, "unique_total_inappopen": {"type": "bigint", "index": 38, "name": "unique_total_inappopen", "comment": null}, "total_emailsendskip": {"type": "numeric", "index": 39, "name": "total_emailsendskip", "comment": null}, "unique_total_emailsendskip": {"type": "bigint", "index": 40, "name": "unique_total_emailsendskip", "comment": null}, "total_emailbounce": {"type": "numeric", "index": 41, "name": "total_emailbounce", "comment": null}, "unique_total_emailbounce": {"type": "bigint", "index": 42, "name": "unique_total_emailbounce", "comment": null}, "total_inappclick": {"type": "numeric", "index": 43, "name": "total_inappclick", "comment": null}, "unique_total_inappclick": {"type": "bigint", "index": 44, "name": "unique_total_inappclick", "comment": null}, "total_pushuninstall": {"type": "numeric", "index": 45, "name": "total_pushuninstall", "comment": null}, "unique_total_pushuninstall": {"type": "bigint", "index": 46, "name": "unique_total_pushuninstall", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.int_iterable__journey_event_metrics"}, "model.iterable.int_iterable__latest_campaign": {"metadata": {"type": "VIEW", "schema": "public_iterable_dev", "name": "int_iterable__latest_campaign", "database": "postgres", "comment": "Table that filters out historical versions of the campaign, and returns the most recent campaign version.", "owner": "postgres"}, "columns": {"source_relation": {"type": "text", "index": 1, "name": "source_relation", "comment": null}, "campaign_id": {"type": "text", "index": 2, "name": "campaign_id", "comment": null}, "updated_at": {"type": "text", "index": 3, "name": "updated_at", "comment": null}, "campaign_name": {"type": "text", "index": 4, "name": "campaign_name", "comment": null}, "campaign_state": {"type": "text", "index": 5, "name": "campaign_state", "comment": null}, "campaign_type": {"type": "text", "index": 6, "name": "campaign_type", "comment": null}, "send_size": {"type": "integer", "index": 7, "name": "send_size", "comment": null}, "start_at": {"type": "integer", "index": 8, "name": "start_at", "comment": null}, "ended_at": {"type": "integer", "index": 9, "name": "ended_at", "comment": null}, "created_at": {"type": "text", "index": 10, "name": "created_at", "comment": null}, "message_medium": {"type": "text", "index": 11, "name": "message_medium", "comment": null}, "recurring_campaign_id": {"type": "text", "index": 12, "name": "recurring_campaign_id", "comment": null}, "created_by_user_id": {"type": "text", "index": 13, "name": "created_by_user_id", "comment": null}, "updated_by_user_id": {"type": "text", "index": 14, "name": "updated_by_user_id", "comment": null}, "template_id": {"type": "text", "index": 15, "name": "template_id", "comment": null}, "workflow_id": {"type": "integer", "index": 16, "name": "workflow_id", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 17, "name": "_fivetran_synced", "comment": null}, "latest_campaign_index": {"type": "bigint", "index": 18, "name": "latest_campaign_index", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.int_iterable__latest_campaign"}, "model.iterable.int_iterable__latest_template": {"metadata": {"type": "VIEW", "schema": "public_iterable_dev", "name": "int_iterable__latest_template", "database": "postgres", "comment": "Table that provides the most recent version of the template as well as joining relevant message type information.", "owner": "postgres"}, "columns": {"source_relation": {"type": "text", "index": 1, "name": "source_relation", "comment": null}, "template_id": {"type": "text", "index": 2, "name": "template_id", "comment": null}, "template_name": {"type": "text", "index": 3, "name": "template_name", "comment": null}, "template_type": {"type": "text", "index": 4, "name": "template_type", "comment": null}, "created_at": {"type": "text", "index": 5, "name": "created_at", "comment": null}, "client_template_id": {"type": "text", "index": 6, "name": "client_template_id", "comment": null}, "creator_user_id": {"type": "text", "index": 7, "name": "creator_user_id", "comment": null}, "message_type_id": {"type": "text", "index": 8, "name": "message_type_id", "comment": null}, "updated_at": {"type": "text", "index": 9, "name": "updated_at", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 10, "name": "_fivetran_synced", "comment": null}, "latest_template_index": {"type": "bigint", "index": 11, "name": "latest_template_index", "comment": null}, "message_type_name": {"type": "text", "index": 12, "name": "message_type_name", "comment": null}, "channel_id": {"type": "text", "index": 13, "name": "channel_id", "comment": null}, "channel_name": {"type": "text", "index": 14, "name": "channel_name", "comment": null}, "channel_type": {"type": "text", "index": 15, "name": "channel_type", "comment": null}, "message_medium": {"type": "text", "index": 16, "name": "message_medium", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.int_iterable__latest_template"}, "model.iterable.int_iterable__latest_user": {"metadata": {"type": "VIEW", "schema": "public_iterable_dev", "name": "int_iterable__latest_user", "database": "postgres", "comment": "Table that filters out historical versions of the user, and returns only the most recent version.", "owner": "postgres"}, "columns": {"source_relation": {"type": "text", "index": 1, "name": "source_relation", "comment": null}, "_fivetran_user_id": {"type": "text", "index": 2, "name": "_fivetran_user_id", "comment": null}, "email": {"type": "text", "index": 3, "name": "email", "comment": null}, "updated_at": {"type": "timestamp without time zone", "index": 4, "name": "updated_at", "comment": null}, "user_id": {"type": "text", "index": 5, "name": "user_id", "comment": null}, "first_name": {"type": "integer", "index": 6, "name": "first_name", "comment": null}, "last_name": {"type": "integer", "index": 7, "name": "last_name", "comment": null}, "email_list_ids": {"type": "text", "index": 8, "name": "email_list_ids", "comment": null}, "phone_number": {"type": "integer", "index": 9, "name": "phone_number", "comment": null}, "signup_date": {"type": "text", "index": 10, "name": "signup_date", "comment": null}, "signup_source": {"type": "text", "index": 11, "name": "signup_source", "comment": null}, "iterable_user_id": {"type": "text", "index": 12, "name": "iterable_user_id", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 13, "name": "_fivetran_synced", "comment": null}, "unique_user_key": {"type": "text", "index": 14, "name": "unique_user_key", "comment": null}, "latest_user_index": {"type": "bigint", "index": 15, "name": "latest_user_index", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.int_iterable__latest_user"}, "model.iterable.int_iterable__list_user_history": {"metadata": {"type": "BASE TABLE", "schema": "public_iterable_dev", "name": "int_iterable__list_user_history", "database": "postgres", "comment": "Table that provides a history of all lists the user has been associated with.", "owner": "postgres"}, "columns": {"source_relation": {"type": "text", "index": 1, "name": "source_relation", "comment": null}, "_fivetran_user_id": {"type": "text", "index": 2, "name": "_fivetran_user_id", "comment": null}, "unique_user_key": {"type": "text", "index": 3, "name": "unique_user_key", "comment": null}, "email": {"type": "text", "index": 4, "name": "email", "comment": null}, "user_id": {"type": "text", "index": 5, "name": "user_id", "comment": null}, "first_name": {"type": "integer", "index": 6, "name": "first_name", "comment": null}, "last_name": {"type": "integer", "index": 7, "name": "last_name", "comment": null}, "email_list_ids": {"type": "text", "index": 8, "name": "email_list_ids", "comment": null}, "phone_number": {"type": "integer", "index": 9, "name": "phone_number", "comment": null}, "signup_date": {"type": "text", "index": 10, "name": "signup_date", "comment": null}, "signup_source": {"type": "text", "index": 11, "name": "signup_source", "comment": null}, "updated_at": {"type": "timestamp without time zone", "index": 12, "name": "updated_at", "comment": null}, "is_current": {"type": "boolean", "index": 13, "name": "is_current", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.int_iterable__list_user_history"}, "model.iterable.int_iterable__list_user_unnest": {"metadata": {"type": "BASE TABLE", "schema": "public_iterable_dev", "name": "int_iterable__list_user_unnest", "database": "postgres", "comment": "Table that unnests the `email_list_id` field for each user to create a new record for each user and the unique list it was associated with at a unique update. Due to the unnesting functions varying greatly between warehouses, conditional logic is applied throughout the model to appropriately accommodate the model being ran within Redshift, Snowflake, BigQuery, and Postgres.\n", "owner": "postgres"}, "columns": {"source_relation": {"type": "text", "index": 1, "name": "source_relation", "comment": null}, "_fivetran_user_id": {"type": "text", "index": 2, "name": "_fivetran_user_id", "comment": null}, "unique_user_key": {"type": "text", "index": 3, "name": "unique_user_key", "comment": null}, "user_id": {"type": "text", "index": 4, "name": "user_id", "comment": null}, "email": {"type": "text", "index": 5, "name": "email", "comment": null}, "first_name": {"type": "integer", "index": 6, "name": "first_name", "comment": null}, "last_name": {"type": "integer", "index": 7, "name": "last_name", "comment": null}, "signup_date": {"type": "text", "index": 8, "name": "signup_date", "comment": null}, "signup_source": {"type": "text", "index": 9, "name": "signup_source", "comment": null}, "updated_at": {"type": "timestamp without time zone", "index": 10, "name": "updated_at", "comment": null}, "phone_number": {"type": "integer", "index": 11, "name": "phone_number", "comment": null}, "is_current": {"type": "boolean", "index": 12, "name": "is_current", "comment": null}, "email_list_ids": {"type": "text", "index": 13, "name": "email_list_ids", "comment": null}, "list_id": {"type": "integer", "index": 14, "name": "list_id", "comment": null}, "unique_key": {"type": "text", "index": 15, "name": "unique_key", "comment": null}, "date_day": {"type": "date", "index": 16, "name": "date_day", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.int_iterable__list_user_unnest"}, "model.iterable.int_iterable__message_type_channel": {"metadata": {"type": "VIEW", "schema": "public_iterable_dev", "name": "int_iterable__message_type_channel", "database": "postgres", "comment": "Table that joins the message type and channel records together into one comprehensive model to be referenced downstream.", "owner": "postgres"}, "columns": {"source_relation": {"type": "text", "index": 1, "name": "source_relation", "comment": null}, "channel_id": {"type": "text", "index": 2, "name": "channel_id", "comment": null}, "channel_name": {"type": "text", "index": 3, "name": "channel_name", "comment": null}, "channel_type": {"type": "text", "index": 4, "name": "channel_type", "comment": null}, "message_medium": {"type": "text", "index": 5, "name": "message_medium", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 6, "name": "_fivetran_synced", "comment": null}, "message_type_name": {"type": "text", "index": 7, "name": "message_type_name", "comment": null}, "message_type_id": {"type": "text", "index": 8, "name": "message_type_id", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.int_iterable__message_type_channel"}, "model.iterable.int_iterable__recurring_campaigns": {"metadata": {"type": "VIEW", "schema": "public_iterable_dev", "name": "int_iterable__recurring_campaigns", "database": "postgres", "comment": "Table that identifies when a campaign is associated with a recurring campaign and provides additional enriched recurring campaign information.", "owner": "postgres"}, "columns": {"source_relation": {"type": "text", "index": 1, "name": "source_relation", "comment": null}, "campaign_id": {"type": "text", "index": 2, "name": "campaign_id", "comment": null}, "campaign_name": {"type": "text", "index": 3, "name": "campaign_name", "comment": null}, "updated_at": {"type": "text", "index": 4, "name": "updated_at", "comment": null}, "campaign_state": {"type": "text", "index": 5, "name": "campaign_state", "comment": null}, "campaign_type": {"type": "text", "index": 6, "name": "campaign_type", "comment": null}, "send_size": {"type": "integer", "index": 7, "name": "send_size", "comment": null}, "start_at": {"type": "integer", "index": 8, "name": "start_at", "comment": null}, "ended_at": {"type": "integer", "index": 9, "name": "ended_at", "comment": null}, "created_at": {"type": "text", "index": 10, "name": "created_at", "comment": null}, "created_by_user_id": {"type": "text", "index": 11, "name": "created_by_user_id", "comment": null}, "template_id": {"type": "text", "index": 12, "name": "template_id", "comment": null}, "recurring_campaign_id": {"type": "text", "index": 13, "name": "recurring_campaign_id", "comment": null}, "journey_id": {"type": "text", "index": 14, "name": "journey_id", "comment": null}, "recurring_campaign_name": {"type": "text", "index": 15, "name": "recurring_campaign_name", "comment": null}, "recurring_campaign_state": {"type": "text", "index": 16, "name": "recurring_campaign_state", "comment": null}, "recurring_campaign_send_size": {"type": "integer", "index": 17, "name": "recurring_campaign_send_size", "comment": null}, "recurring_campaign_start_at": {"type": "integer", "index": 18, "name": "recurring_campaign_start_at", "comment": null}, "is_campaign_recurring": {"type": "boolean", "index": 19, "name": "is_campaign_recurring", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.int_iterable__recurring_campaigns"}, "model.iterable.int_iterable__user_event_metrics": {"metadata": {"type": "VIEW", "schema": "public_iterable_dev", "name": "int_iterable__user_event_metrics", "database": "postgres", "comment": "Table that generates user aggregations at the campaign level.", "owner": "postgres"}, "columns": {"source_relation": {"type": "text", "index": 1, "name": "source_relation", "comment": null}, "_fivetran_user_id": {"type": "text", "index": 2, "name": "_fivetran_user_id", "comment": null}, "unique_user_key": {"type": "text", "index": 3, "name": "unique_user_key", "comment": null}, "user_id": {"type": "text", "index": 4, "name": "user_id", "comment": null}, "user_email": {"type": "text", "index": 5, "name": "user_email", "comment": null}, "count_total_campaigns": {"type": "bigint", "index": 6, "name": "count_total_campaigns", "comment": null}, "first_event_at": {"type": "timestamp without time zone", "index": 7, "name": "first_event_at", "comment": null}, "last_event_at": {"type": "timestamp without time zone", "index": 8, "name": "last_event_at", "comment": null}, "total_emailclick": {"type": "numeric", "index": 9, "name": "total_emailclick", "comment": null}, "total_emailunsubscribe": {"type": "numeric", "index": 10, "name": "total_emailunsubscribe", "comment": null}, "total_emailcomplaint": {"type": "numeric", "index": 11, "name": "total_emailcomplaint", "comment": null}, "total_customevent": {"type": "numeric", "index": 12, "name": "total_customevent", "comment": null}, "total_emailsubscribe": {"type": "numeric", "index": 13, "name": "total_emailsubscribe", "comment": null}, "total_emailopen": {"type": "numeric", "index": 14, "name": "total_emailopen", "comment": null}, "total_pushsend": {"type": "numeric", "index": 15, "name": "total_pushsend", "comment": null}, "total_smsbounce": {"type": "numeric", "index": 16, "name": "total_smsbounce", "comment": null}, "total_pushbounce": {"type": "numeric", "index": 17, "name": "total_pushbounce", "comment": null}, "total_inappsendskip": {"type": "numeric", "index": 18, "name": "total_inappsendskip", "comment": null}, "total_smssend": {"type": "numeric", "index": 19, "name": "total_smssend", "comment": null}, "total_inappsend": {"type": "numeric", "index": 20, "name": "total_inappsend", "comment": null}, "total_pushopen": {"type": "numeric", "index": 21, "name": "total_pushopen", "comment": null}, "total_emailsend": {"type": "numeric", "index": 22, "name": "total_emailsend", "comment": null}, "total_pushsendskip": {"type": "numeric", "index": 23, "name": "total_pushsendskip", "comment": null}, "total_inappopen": {"type": "numeric", "index": 24, "name": "total_inappopen", "comment": null}, "total_emailsendskip": {"type": "numeric", "index": 25, "name": "total_emailsendskip", "comment": null}, "total_emailbounce": {"type": "numeric", "index": 26, "name": "total_emailbounce", "comment": null}, "total_inappclick": {"type": "numeric", "index": 27, "name": "total_inappclick", "comment": null}, "total_pushuninstall": {"type": "numeric", "index": 28, "name": "total_pushuninstall", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.int_iterable__user_event_metrics"}, "model.iterable.iterable__campaigns": {"metadata": {"type": "BASE TABLE", "schema": "public_iterable_dev", "name": "iterable__campaigns", "database": "postgres", "comment": "Table that provides aggregations for campaigns at the template and if available, the experiment grain.", "owner": "postgres"}, "columns": {"source_relation": {"type": "text", "index": 1, "name": "source_relation", "comment": "Identifies the record's source."}, "campaign_id": {"type": "text", "index": 2, "name": "campaign_id", "comment": "Unique identifier of the campaign record"}, "campaign_name": {"type": "text", "index": 3, "name": "campaign_name", "comment": "User defined name of the campaign."}, "updated_at": {"type": "text", "index": 4, "name": "updated_at", "comment": "Last update timestamp"}, "campaign_state": {"type": "text", "index": 5, "name": "campaign_state", "comment": "State of the campaign. Can be Draft, Ready, Scheduled, Running, Finished, Starting, Aborted or Recurring"}, "campaign_type": {"type": "text", "index": 6, "name": "campaign_type", "comment": "The campaign type. Can be Blast or Triggered"}, "send_size": {"type": "integer", "index": 7, "name": "send_size", "comment": "Size of the campaign. Number of individuals included in the campaign"}, "start_at": {"type": "integer", "index": 8, "name": "start_at", "comment": "Start timestamp"}, "ended_at": {"type": "integer", "index": 9, "name": "ended_at", "comment": "Ended timestamp"}, "created_at": {"type": "text", "index": 10, "name": "created_at", "comment": "Creation timestamp"}, "created_by_user_id": {"type": "text", "index": 11, "name": "created_by_user_id", "comment": "Reference to the user who created the campaign"}, "template_id": {"type": "text", "index": 12, "name": "template_id", "comment": "Reference to the campaign template"}, "recurring_campaign_id": {"type": "text", "index": 13, "name": "recurring_campaign_id", "comment": "Unique identifier of the recurring campaign (if applicable)"}, "journey_id": {"type": "text", "index": 14, "name": "journey_id", "comment": "Reference to the journey the campaign belongs to, if applicable"}, "recurring_campaign_name": {"type": "text", "index": 15, "name": "recurring_campaign_name", "comment": "Name of the recurring campaign (if applicable)"}, "recurring_campaign_state": {"type": "text", "index": 16, "name": "recurring_campaign_state", "comment": "State of the recurring campaign (if applicable)"}, "recurring_campaign_send_size": {"type": "integer", "index": 17, "name": "recurring_campaign_send_size", "comment": "Size of the recurring campaign. Number of individuals included in the recurring campaign (if applicable)"}, "recurring_campaign_start_at": {"type": "integer", "index": 18, "name": "recurring_campaign_start_at", "comment": "Timestamp of when the recurring campaign started (if applicable)"}, "is_campaign_recurring": {"type": "boolean", "index": 19, "name": "is_campaign_recurring", "comment": "Boolean indicating if the campaign is a recurring campaign"}, "experiment_id": {"type": "integer", "index": 20, "name": "experiment_id", "comment": "Reference to the experiment used if the event is an experiment"}, "count_unique_users": {"type": "bigint", "index": 21, "name": "count_unique_users", "comment": "Count of total unique users within the campaign/experiment"}, "total_emailclick": {"type": "numeric", "index": 22, "name": "total_emailclick", "comment": "Total email clicks within the campaign/experiment"}, "unique_total_emailclick": {"type": "bigint", "index": 23, "name": "unique_total_emailclick", "comment": "Unique email clicks within the campaign/experiment"}, "total_emailunsubscribe": {"type": "numeric", "index": 24, "name": "total_emailunsubscribe", "comment": "Total email unsubscribe events within the campaign/experiment"}, "unique_total_emailunsubscribe": {"type": "bigint", "index": 25, "name": "unique_total_emailunsubscribe", "comment": "Unique total email unsubscribe events within the campaign/experiment"}, "total_emailcomplaint": {"type": "numeric", "index": 26, "name": "total_emailcomplaint", "comment": "Total email complaints within the campaign/experiment"}, "unique_total_emailcomplaint": {"type": "bigint", "index": 27, "name": "unique_total_emailcomplaint", "comment": "Unique total email complaints within the campaign/experiment"}, "total_customevent": {"type": "numeric", "index": 28, "name": "total_customevent", "comment": "Total custom events within the campaign/experiment"}, "unique_total_customevent": {"type": "bigint", "index": 29, "name": "unique_total_customevent", "comment": "Unique total custom events within the campaign/experiment"}, "total_emailsubscribe": {"type": "numeric", "index": 30, "name": "total_emailsubscribe", "comment": "Total email subscribe events within the campaign/experiment"}, "unique_total_emailsubscribe": {"type": "bigint", "index": 31, "name": "unique_total_emailsubscribe", "comment": "Unique total email subscribe events within the campaign/experiment"}, "total_emailopen": {"type": "numeric", "index": 32, "name": "total_emailopen", "comment": "Total email open events within the campaign/experiment"}, "unique_total_emailopen": {"type": "bigint", "index": 33, "name": "unique_total_emailopen", "comment": "Unique total email open events within the campaign/experiment"}, "total_pushsend": {"type": "numeric", "index": 34, "name": "total_pushsend", "comment": "Total push send event within the campaign/experiment"}, "unique_total_pushsend": {"type": "bigint", "index": 35, "name": "unique_total_pushsend", "comment": "Unique total push send events within the campaign/experiment"}, "total_smsbounce": {"type": "numeric", "index": 36, "name": "total_smsbounce", "comment": "Total sms bounce events within the campaign/experiment"}, "unique_total_smsbounce": {"type": "bigint", "index": 37, "name": "unique_total_smsbounce", "comment": "Unique total sms bounce events within the campaign/experiment"}, "total_pushbounce": {"type": "numeric", "index": 38, "name": "total_pushbounce", "comment": "Total push bounce events within the campaign/experiment"}, "unique_total_pushbounce": {"type": "bigint", "index": 39, "name": "unique_total_pushbounce", "comment": "Unique total push bounce events within the campaign/experiment"}, "total_inappsendskip": {"type": "numeric", "index": 40, "name": "total_inappsendskip", "comment": "Total in app send skip events within the campaign/experiment"}, "unique_total_inappsendskip": {"type": "bigint", "index": 41, "name": "unique_total_inappsendskip", "comment": "Unique total in app send skip events within the campaign/experiment"}, "total_smssend": {"type": "numeric", "index": 42, "name": "total_smssend", "comment": "Total sms send events within the campaign/experiment"}, "unique_total_smssend": {"type": "bigint", "index": 43, "name": "unique_total_smssend", "comment": "Unique total sms send events within the campaign/experiment"}, "total_inappsend": {"type": "numeric", "index": 44, "name": "total_inappsend", "comment": "Total in app send events within the campaign/experiment"}, "unique_total_inappsend": {"type": "bigint", "index": 45, "name": "unique_total_inappsend", "comment": "Unique total in app send events within the campaign/experiment"}, "total_pushopen": {"type": "numeric", "index": 46, "name": "total_pushopen", "comment": "Total push open events within the campaign/experiment"}, "unique_total_pushopen": {"type": "bigint", "index": 47, "name": "unique_total_pushopen", "comment": "Unique total push open events within the campaign/experiment"}, "total_emailsend": {"type": "numeric", "index": 48, "name": "total_emailsend", "comment": "Total email send events within the campaign/experiment"}, "unique_total_emailsend": {"type": "bigint", "index": 49, "name": "unique_total_emailsend", "comment": "Unique total email send events within the campaign/experiment"}, "total_pushsendskip": {"type": "numeric", "index": 50, "name": "total_pushsendskip", "comment": "Total push send skip events within the campaign/experiment"}, "unique_total_pushsendskip": {"type": "bigint", "index": 51, "name": "unique_total_pushsendskip", "comment": "Unique total push send skip events within the campaign/experiment"}, "total_inappopen": {"type": "numeric", "index": 52, "name": "total_inappopen", "comment": "Total in app open events within the campaign/experiment"}, "unique_total_inappopen": {"type": "bigint", "index": 53, "name": "unique_total_inappopen", "comment": "Unique total in app open events within the campaign/experiment"}, "total_emailsendskip": {"type": "numeric", "index": 54, "name": "total_emailsendskip", "comment": "Total email send skip events within the campaign/experiment"}, "unique_total_emailsendskip": {"type": "bigint", "index": 55, "name": "unique_total_emailsendskip", "comment": "Unique total email send skip events within the campaign/experiment"}, "total_emailbounce": {"type": "numeric", "index": 56, "name": "total_emailbounce", "comment": "Total email bounce events within the campaign/experiment"}, "unique_total_emailbounce": {"type": "bigint", "index": 57, "name": "unique_total_emailbounce", "comment": "Unique total email bounce events within the campaign/experiment"}, "total_inappclick": {"type": "numeric", "index": 58, "name": "total_inappclick", "comment": "Total in app click events within the campaign/experiment"}, "unique_total_inappclick": {"type": "bigint", "index": 59, "name": "unique_total_inappclick", "comment": "Unique total in app click events within the campaign/experiment"}, "total_pushuninstall": {"type": "numeric", "index": 60, "name": "total_pushuninstall", "comment": "Total push uninstall events within the campaign/experiment"}, "unique_total_pushuninstall": {"type": "bigint", "index": 61, "name": "unique_total_pushuninstall", "comment": "Unique total push uninstall events within the campaign/experiment"}, "count_send_lists": {"type": "bigint", "index": 62, "name": "count_send_lists", "comment": "Count of send lists within the campaign/experiment"}, "count_suppress_lists": {"type": "bigint", "index": 63, "name": "count_suppress_lists", "comment": "Count of suppress lists within the campaign/experiment"}, "labels": {"type": "text", "index": 64, "name": "labels", "comment": "List of labels associated with the campaign/experiment"}, "journey_name": {"type": "text", "index": 65, "name": "journey_name", "comment": "User defined name of the journey the campaign belongs to, if applicable"}, "journey_type": {"type": "text", "index": 66, "name": "journey_type", "comment": "The type of the journey the campaign belongs to, if applicable"}, "template_name": {"type": "text", "index": 67, "name": "template_name", "comment": "Name of the template associated with the campaign/experiment"}, "template_creator_user_id": {"type": "text", "index": 68, "name": "template_creator_user_id", "comment": "The creator user id of the template associated with the campaign/experiment"}, "message_medium": {"type": "text", "index": 69, "name": "message_medium", "comment": "The medium which the message was provided"}, "message_type_name": {"type": "text", "index": 70, "name": "message_type_name", "comment": "The message type name associated with the campaign/experiment"}, "channel_name": {"type": "text", "index": 71, "name": "channel_name", "comment": "The channel name associated with the campaign/experiment"}, "channel_id": {"type": "text", "index": 72, "name": "channel_id", "comment": "The channel identifier associated with the campaign/experiment"}, "channel_type": {"type": "text", "index": 73, "name": "channel_type", "comment": "The channel type associated with the campaign/experiment"}, "unique_campaign_version_id": {"type": "text", "index": 74, "name": "unique_campaign_version_id", "comment": "Unique identifier combining campaign_id, template_id, source_relation, and if available, experiment_id."}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.iterable__campaigns"}, "model.iterable.iterable__events": {"metadata": {"type": "BASE TABLE", "schema": "public_iterable_dev", "name": "iterable__events", "database": "postgres", "comment": "Table that provides a comprehensive view of all events with enriched information such as the campaign, user effected, and template used.", "owner": "postgres"}, "columns": {"source_relation": {"type": "text", "index": 1, "name": "source_relation", "comment": "Identifies the record's source."}, "event_id": {"type": "text", "index": 2, "name": "event_id", "comment": "Unique id of the event generated by Fivetran"}, "unique_event_id": {"type": "text", "index": 3, "name": "unique_event_id", "comment": "A unique surrogate key of event_id, _fivetran_user_id, and source_relation."}, "_fivetran_user_id": {"type": "text", "index": 4, "name": "_fivetran_user_id", "comment": "A Fivetran-created unique identifier for the new Iterable schema in Aug 2023, for users, derived from hashing user_id and/or email, depending on project type."}, "unique_user_key": {"type": "text", "index": 5, "name": "unique_user_key", "comment": "The unique identifier of the user. With the new schema (Aug 2023), it is the _fivetran_user_id. This is a hash of user_id and/or email, depending on project type. If using the old schema, it is email."}, "campaign_id": {"type": "text", "index": 6, "name": "campaign_id", "comment": "Reference to the campaign from which the event originated"}, "content_id": {"type": "text", "index": 7, "name": "content_id", "comment": "Reference to the content the event is associated with"}, "created_at": {"type": "timestamp without time zone", "index": 8, "name": "created_at", "comment": "Creation timestamp"}, "created_on": {"type": "date", "index": 9, "name": "created_on", "comment": "Day when the event was created"}, "email": {"type": "text", "index": 10, "name": "email", "comment": "The user's email. User identifier, for email-based projects. Previously was the unique identifier for user records, for the old Iterable schema before the August 2023 updates."}, "additional_properties": {"type": "text", "index": 11, "name": "additional_properties", "comment": "json object containing addition event properties"}, "event_name": {"type": "text", "index": 12, "name": "event_name", "comment": "Name provided to the individual event"}, "message_bus_id": {"type": "text", "index": 13, "name": "message_bus_id", "comment": "Reference to the message bus associated with the event"}, "message_id": {"type": "text", "index": 14, "name": "message_id", "comment": "Reference to the message the event is associated with"}, "message_type_id": {"type": "text", "index": 15, "name": "message_type_id", "comment": "Reference to the type of message the event is associated with"}, "recipient_state": {"type": "integer", "index": 16, "name": "recipient_state", "comment": "The state of the recipient upon receiving the event"}, "status": {"type": "integer", "index": 17, "name": "status", "comment": "Status of the event"}, "transactional_data": {"type": "character varying(100)", "index": 18, "name": "transactional_data", "comment": "Transactional data associated with the event"}, "unsub_source": {"type": "integer", "index": 19, "name": "unsub_source", "comment": "Source of the unsubscribe event"}, "user_agent": {"type": "integer", "index": 20, "name": "user_agent", "comment": "User agent associated with the event"}, "user_agent_device": {"type": "integer", "index": 21, "name": "user_agent_device", "comment": "The device of the user agent"}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 22, "name": "_fivetran_synced", "comment": "Timestamp of when the event record was synced by Fivetran"}, "campaign_name": {"type": "text", "index": 23, "name": "campaign_name", "comment": "The name of the campaign"}, "campaign_type": {"type": "text", "index": 24, "name": "campaign_type", "comment": "The type of campaign"}, "is_campaign_recurring": {"type": "boolean", "index": 25, "name": "is_campaign_recurring", "comment": "Boolean indicating if the campaign is recurrent"}, "recurring_campaign_name": {"type": "text", "index": 26, "name": "recurring_campaign_name", "comment": "The name of the recurring campaign (if applicable)"}, "recurring_campaign_id": {"type": "text", "index": 27, "name": "recurring_campaign_id", "comment": "The campaign if of the recurring campaign (if applicable)"}, "user_id": {"type": "text", "index": 28, "name": "user_id", "comment": "User identifier, for userID-based projects."}, "user_full_name": {"type": "text", "index": 29, "name": "user_full_name", "comment": "Full name of the user"}, "message_type_name": {"type": "text", "index": 30, "name": "message_type_name", "comment": "Name of the message type"}, "message_medium": {"type": "text", "index": 31, "name": "message_medium", "comment": "Medium of the message"}, "channel_id": {"type": "text", "index": 32, "name": "channel_id", "comment": "Unique identifier of the channel"}, "channel_name": {"type": "text", "index": 33, "name": "channel_name", "comment": "The channel name"}, "channel_type": {"type": "text", "index": 34, "name": "channel_type", "comment": "The type of channel"}, "is_app_already_running": {"type": "integer", "index": 35, "name": "is_app_already_running", "comment": "Boolean indicating if the app is already running"}, "badge": {"type": "integer", "index": 36, "name": "badge", "comment": "Badge associated with the event"}, "catalog_collection_count": {"type": "integer", "index": 37, "name": "catalog_collection_count", "comment": "The count of products or items collected in a catalog associated with the event."}, "catalog_lookup_count": {"type": "integer", "index": 38, "name": "catalog_lookup_count", "comment": "The count of times a catalog was looked up or queried during the event."}, "canonical_url_id": {"type": "text", "index": 39, "name": "canonical_url_id", "comment": "Reference to the url associated with the event"}, "is_content_available": {"type": "integer", "index": 40, "name": "is_content_available", "comment": "Content available from the event"}, "device": {"type": "integer", "index": 41, "name": "device", "comment": "The device associated with the event"}, "email_id": {"type": "text", "index": 42, "name": "email_id", "comment": "Reference to the email associated with the event"}, "email_subject": {"type": "text", "index": 43, "name": "email_subject", "comment": "Subject of the email associated with the event"}, "experiment_id": {"type": "integer", "index": 44, "name": "experiment_id", "comment": "Reference to the experiment used if the event is an experiment"}, "from_phone_number_id": {"type": "integer", "index": 45, "name": "from_phone_number_id", "comment": "Reference to the phone number which the event is from"}, "from_smssender_id": {"type": "integer", "index": 46, "name": "from_smssender_id", "comment": "Reference to the sms sender which the event is from"}, "link_id": {"type": "text", "index": 47, "name": "link_id", "comment": "Reference to the link associated with the event"}, "link_url": {"type": "integer", "index": 48, "name": "link_url", "comment": "Url of the link associated with the event"}, "locale": {"type": "integer", "index": 49, "name": "locale", "comment": "Locale associated with the event"}, "payload": {"type": "character varying(100)", "index": 50, "name": "payload", "comment": "Payload resulted from the event"}, "platform_endpoint": {"type": "integer", "index": 51, "name": "platform_endpoint", "comment": "The specific platform endpoint of the event"}, "push_message": {"type": "integer", "index": 52, "name": "push_message", "comment": "Boolean indicating if the event is a push message"}, "region": {"type": "text", "index": 53, "name": "region", "comment": "Region of the event"}, "sms_message": {"type": "integer", "index": 54, "name": "sms_message", "comment": "Boolean indicating if the event is an sms message"}, "to_phone_number": {"type": "integer", "index": 55, "name": "to_phone_number", "comment": "To phone number associated with the event"}, "url": {"type": "integer", "index": 56, "name": "url", "comment": "Url associated with the event"}, "workflow_id": {"type": "text", "index": 57, "name": "workflow_id", "comment": "Reference to the workflow which the event originated"}, "workflow_name": {"type": "text", "index": 58, "name": "workflow_name", "comment": "Name of the workflow which the event originated"}, "city": {"type": "text", "index": 59, "name": "city", "comment": "The city associated with the event, which could be the location of the recipient."}, "clicked_url": {"type": "text", "index": 60, "name": "clicked_url", "comment": "The URL that was clicked by the recipient in response to the marketing message."}, "country": {"type": "text", "index": 61, "name": "country", "comment": "The country associated with the event, which could be the location of the recipient."}, "error_code": {"type": "integer", "index": 62, "name": "error_code", "comment": "The error code or message indicating any issues or errors encountered during the event."}, "expires_at": {"type": "text", "index": 63, "name": "expires_at", "comment": "The date and time when the event or message is set to expire or become invalid."}, "from_phone_number": {"type": "integer", "index": 64, "name": "from_phone_number", "comment": "The phone number from which the SMS message was sent."}, "in_app_body": {"type": "text", "index": 65, "name": "in_app_body", "comment": "The content or body of an in-app message that was sent as part of the event."}, "is_sms_estimation": {"type": "boolean", "index": 66, "name": "is_sms_estimation", "comment": "A boolean indicating whether the SMS message is an estimation or not."}, "labels": {"type": "text", "index": 67, "name": "labels", "comment": "Any labels or tags associated with the event, which can be used for categorization or organization."}, "message_status": {"type": "text", "index": 68, "name": "message_status", "comment": "The status of the marketing message, such as sent, delivered, opened, etc."}, "mms_send_count": {"type": "integer", "index": 69, "name": "mms_send_count", "comment": "The count of multimedia messages (MMS) sent as part of the event."}, "reason": {"type": "text", "index": 70, "name": "reason", "comment": "The reason or cause associated with a specific event or action."}, "sms_send_count": {"type": "integer", "index": 71, "name": "sms_send_count", "comment": "The count of SMS messages sent as part of the event."}, "template_id": {"type": "text", "index": 72, "name": "template_id", "comment": "Unique identifier of the template"}, "template_name": {"type": "text", "index": 73, "name": "template_name", "comment": "User defined name of the template"}, "template_creator_user_id": {"type": "text", "index": 74, "name": "template_creator_user_id", "comment": "Reference to the user who created the template"}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.iterable__events"}, "model.iterable.iterable__journeys": {"metadata": {"type": "BASE TABLE", "schema": "public_iterable_dev", "name": "iterable__journeys", "database": "postgres", "comment": "Table that provides aggregations for journeys, formerly known as workflows. Metrics are rolled up from the user/campaign grain via each campaign's journey reference. Journeys which generate no events, such as those that only split audiences or update user fields, are still included with null metrics. The grain of this table is one record per journey.\n", "owner": "postgres"}, "columns": {"source_relation": {"type": "text", "index": 1, "name": "source_relation", "comment": "Identifies the record's source."}, "journey_id": {"type": "text", "index": 2, "name": "journey_id", "comment": "Unique identifier of the journey"}, "journey_name": {"type": "text", "index": 3, "name": "journey_name", "comment": "User defined name of the journey"}, "journey_type": {"type": "text", "index": 4, "name": "journey_type", "comment": "The journey type"}, "journey_description": {"type": "text", "index": 5, "name": "journey_description", "comment": "Information about the journey"}, "creator_user_id": {"type": "text", "index": 6, "name": "creator_user_id", "comment": "Reference to the user who created the journey"}, "is_enabled": {"type": "boolean", "index": 7, "name": "is_enabled", "comment": "Boolean indicating if the journey is currently enabled"}, "is_archived": {"type": "boolean", "index": 8, "name": "is_archived", "comment": "Boolean indicating if the journey has been archived"}, "lifetime_limit": {"type": "integer", "index": 9, "name": "lifetime_limit", "comment": "Maximum number of times a user may enter the journey over their lifetime"}, "simultaneous_limit": {"type": "integer", "index": 10, "name": "simultaneous_limit", "comment": "Maximum number of times a user may be in the journey at the same time"}, "start_tile_id": {"type": "text", "index": 11, "name": "start_tile_id", "comment": "Reference to the tile which begins the journey"}, "trigger_event_names": {"type": "text", "index": 12, "name": "trigger_event_names", "comment": "The event names which trigger a user's entry into the journey"}, "created_at": {"type": "timestamp without time zone", "index": 13, "name": "created_at", "comment": "Creation timestamp"}, "updated_at": {"type": "timestamp without time zone", "index": 14, "name": "updated_at", "comment": "Last update timestamp"}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 15, "name": "_fivetran_synced", "comment": "The time when a record was last updated by Fivetran."}, "count_total_campaigns": {"type": "bigint", "index": 16, "name": "count_total_campaigns", "comment": "Count of distinct campaigns within the journey that generated events"}, "count_unique_users": {"type": "bigint", "index": 17, "name": "count_unique_users", "comment": "Count of total unique users within the journey"}, "first_event_at": {"type": "timestamp without time zone", "index": 18, "name": "first_event_at", "comment": "Timestamp of the first event generated by any campaign in the journey"}, "last_event_at": {"type": "timestamp without time zone", "index": 19, "name": "last_event_at", "comment": "Timestamp of the most recent event generated by any campaign in the journey"}, "total_emailclick": {"type": "numeric", "index": 20, "name": "total_emailclick", "comment": "Total email clicks within the journey"}, "unique_total_emailclick": {"type": "bigint", "index": 21, "name": "unique_total_emailclick", "comment": "Unique email clicks within the journey"}, "total_emailunsubscribe": {"type": "numeric", "index": 22, "name": "total_emailunsubscribe", "comment": "Total email unsubscribe events within the journey"}, "unique_total_emailunsubscribe": {"type": "bigint", "index": 23, "name": "unique_total_emailunsubscribe", "comment": "Unique total email unsubscribe events within the journey"}, "total_emailcomplaint": {"type": "numeric", "index": 24, "name": "total_emailcomplaint", "comment": "Total email complaints within the journey"}, "unique_total_emailcomplaint": {"type": "bigint", "index": 25, "name": "unique_total_emailcomplaint", "comment": "Unique total email complaints within the journey"}, "total_customevent": {"type": "numeric", "index": 26, "name": "total_customevent", "comment": "Total custom events within the journey"}, "unique_total_customevent": {"type": "bigint", "index": 27, "name": "unique_total_customevent", "comment": "Unique total custom events within the journey"}, "total_emailsubscribe": {"type": "numeric", "index": 28, "name": "total_emailsubscribe", "comment": "Total email subscribe events within the journey"}, "unique_total_emailsubscribe": {"type": "bigint", "index": 29, "name": "unique_total_emailsubscribe", "comment": "Unique total email subscribe events within the journey"}, "total_emailopen": {"type": "numeric", "index": 30, "name": "total_emailopen", "comment": "Total email open events within the journey"}, "unique_total_emailopen": {"type": "bigint", "index": 31, "name": "unique_total_emailopen", "comment": "Unique total email open events within the journey"}, "total_pushsend": {"type": "numeric", "index": 32, "name": "total_pushsend", "comment": "Total push send events within the journey"}, "unique_total_pushsend": {"type": "bigint", "index": 33, "name": "unique_total_pushsend", "comment": "Unique total push send events within the journey"}, "total_smsbounce": {"type": "numeric", "index": 34, "name": "total_smsbounce", "comment": "Total sms bounce events within the journey"}, "unique_total_smsbounce": {"type": "bigint", "index": 35, "name": "unique_total_smsbounce", "comment": "Unique total sms bounce events within the journey"}, "total_pushbounce": {"type": "numeric", "index": 36, "name": "total_pushbounce", "comment": "Total push bounce events within the journey"}, "unique_total_pushbounce": {"type": "bigint", "index": 37, "name": "unique_total_pushbounce", "comment": "Unique total push bounce events within the journey"}, "total_inappsendskip": {"type": "numeric", "index": 38, "name": "total_inappsendskip", "comment": "Total in app send skip events within the journey"}, "unique_total_inappsendskip": {"type": "bigint", "index": 39, "name": "unique_total_inappsendskip", "comment": "Unique total in app send skip events within the journey"}, "total_smssend": {"type": "numeric", "index": 40, "name": "total_smssend", "comment": "Total sms send events within the journey"}, "unique_total_smssend": {"type": "bigint", "index": 41, "name": "unique_total_smssend", "comment": "Unique total sms send events within the journey"}, "total_inappsend": {"type": "numeric", "index": 42, "name": "total_inappsend", "comment": "Total in app send events within the journey"}, "unique_total_inappsend": {"type": "bigint", "index": 43, "name": "unique_total_inappsend", "comment": "Unique total in app send events within the journey"}, "total_pushopen": {"type": "numeric", "index": 44, "name": "total_pushopen", "comment": "Total push open events within the journey"}, "unique_total_pushopen": {"type": "bigint", "index": 45, "name": "unique_total_pushopen", "comment": "Unique total push open events within the journey"}, "total_emailsend": {"type": "numeric", "index": 46, "name": "total_emailsend", "comment": "Total email send events within the journey"}, "unique_total_emailsend": {"type": "bigint", "index": 47, "name": "unique_total_emailsend", "comment": "Unique total email send events within the journey"}, "total_pushsendskip": {"type": "numeric", "index": 48, "name": "total_pushsendskip", "comment": "Total push send skip events within the journey"}, "unique_total_pushsendskip": {"type": "bigint", "index": 49, "name": "unique_total_pushsendskip", "comment": "Unique total push send skip events within the journey"}, "total_inappopen": {"type": "numeric", "index": 50, "name": "total_inappopen", "comment": "Total in app open events within the journey"}, "unique_total_inappopen": {"type": "bigint", "index": 51, "name": "unique_total_inappopen", "comment": "Unique total in app open events within the journey"}, "total_emailsendskip": {"type": "numeric", "index": 52, "name": "total_emailsendskip", "comment": "Total email send skip events within the journey"}, "unique_total_emailsendskip": {"type": "bigint", "index": 53, "name": "unique_total_emailsendskip", "comment": "Unique total email send skip events within the journey"}, "total_emailbounce": {"type": "numeric", "index": 54, "name": "total_emailbounce", "comment": "Total email bounce events within the journey"}, "unique_total_emailbounce": {"type": "bigint", "index": 55, "name": "unique_total_emailbounce", "comment": "Unique total email bounce events within the journey"}, "total_inappclick": {"type": "numeric", "index": 56, "name": "total_inappclick", "comment": "Total in app click events within the journey"}, "unique_total_inappclick": {"type": "bigint", "index": 57, "name": "unique_total_inappclick", "comment": "Unique total in app click events within the journey"}, "total_pushuninstall": {"type": "numeric", "index": 58, "name": "total_pushuninstall", "comment": "Total push uninstall events within the journey"}, "unique_total_pushuninstall": {"type": "bigint", "index": 59, "name": "unique_total_pushuninstall", "comment": "Unique total push uninstall events within the journey"}, "email_open_rate": {"type": "numeric", "index": 60, "name": "email_open_rate", "comment": "Share of emails sent within the journey that were opened. Only present when both emailSend and emailOpen are included in the `iterable__event_metrics` variable."}, "email_click_rate": {"type": "numeric", "index": 61, "name": "email_click_rate", "comment": "Share of emails sent within the journey that were clicked. Only present when both emailSend and emailClick are included in the `iterable__event_metrics` variable."}, "email_bounce_rate": {"type": "numeric", "index": 62, "name": "email_bounce_rate", "comment": "Share of emails sent within the journey that bounced. Only present when both emailSend and emailBounce are included in the `iterable__event_metrics` variable."}, "email_unsubscribe_rate": {"type": "numeric", "index": 63, "name": "email_unsubscribe_rate", "comment": "Share of emails sent within the journey that resulted in an unsubscribe. Only present when both emailSend and emailUnSubscribe are included in the `iterable__event_metrics` variable."}, "unique_journey_id": {"type": "text", "index": 64, "name": "unique_journey_id", "comment": "Unique identifier combining journey_id and source_relation."}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.iterable__journeys"}, "model.iterable.iterable__list_user_history": {"metadata": {"type": "BASE TABLE", "schema": "public_iterable_dev", "name": "iterable__list_user_history", "database": "postgres", "comment": "Table that recreates the `list_user_history` source table. Additionally, this table provides an `is_current` field to identify the current lists associated with the user. The table coalesces list_id values from both the direct list_user relationships and the unnested email_list_ids from user history to ensure comprehensive list coverage. The grain of this table is at the user/list/updated_at level.\n", "owner": "postgres"}, "columns": {"source_relation": {"type": "text", "index": 1, "name": "source_relation", "comment": "Identifies the record's source."}, "unique_user_key": {"type": "text", "index": 2, "name": "unique_user_key", "comment": "The unique identifier of the user. With the new schema (Aug 2023), it is the _fivetran_user_id. This is a hash of user_id and/or email, depending on project type. If using the old schema, it is email."}, "_fivetran_user_id": {"type": "text", "index": 3, "name": "_fivetran_user_id", "comment": "A Fivetran-created unique identifier for the new Iterable schema in Aug 2023, for users, derived from hashing user_id and/or email, depending on project type."}, "user_id": {"type": "text", "index": 4, "name": "user_id", "comment": "User identifier, for userID-based projects."}, "user_email": {"type": "text", "index": 5, "name": "user_email", "comment": "Email of the user if it exists."}, "user_first_name": {"type": "integer", "index": 6, "name": "user_first_name", "comment": "First name of the user"}, "user_last_name": {"type": "integer", "index": 7, "name": "user_last_name", "comment": "Last name of the user"}, "user_signup_date": {"type": "text", "index": 8, "name": "user_signup_date", "comment": "Timestamp of when the user signed up"}, "user_signup_source": {"type": "text", "index": 9, "name": "user_signup_source", "comment": "Source where the user signed up"}, "user_updated_at": {"type": "timestamp without time zone", "index": 10, "name": "user_updated_at", "comment": "Last update timestamp"}, "list_id": {"type": "bigint", "index": 11, "name": "list_id", "comment": "The list associated with the user. Uses coalesced values prioritizing `list_id` from `LIST_USER` over the unnested `email_list_ids` from `USER_HISTORY` for comprehensive list coverage."}, "is_current": {"type": "boolean", "index": 12, "name": "is_current", "comment": "Boolean indicating if the current list is active"}, "list_name": {"type": "text", "index": 13, "name": "list_name", "comment": "Name of the list associated with the user"}, "list_type": {"type": "text", "index": 14, "name": "list_type", "comment": "Type of list associated with the user"}, "list_created_at": {"type": "text", "index": 15, "name": "list_created_at", "comment": "Date the list was created"}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.iterable__list_user_history"}, "model.iterable.iterable__user_campaign": {"metadata": {"type": "BASE TABLE", "schema": "public_iterable_dev", "name": "iterable__user_campaign", "database": "postgres", "comment": "Table that provides total and unique metrics for a user associated with particular campaigns and if available, experiments.", "owner": "postgres"}, "columns": {"source_relation": {"type": "text", "index": 1, "name": "source_relation", "comment": "Identifies the record's source."}, "_fivetran_user_id": {"type": "text", "index": 2, "name": "_fivetran_user_id", "comment": "A Fivetran-created unique identifier for the new Iterable schema in Aug 2023, for users, derived from hashing user_id and/or email, depending on project type."}, "unique_user_key": {"type": "text", "index": 3, "name": "unique_user_key", "comment": "The unique identifier of the user. With the new schema (Aug 2023), it is the _fivetran_user_id. This is a hash of user_id and/or email, depending on project type. If using the old schema, it is email."}, "user_id": {"type": "text", "index": 4, "name": "user_id", "comment": "User identifier, for userID-based projects."}, "campaign_id": {"type": "text", "index": 5, "name": "campaign_id", "comment": "The unique identifier of the campaign which the user metrics are associated"}, "experiment_id": {"type": "integer", "index": 6, "name": "experiment_id", "comment": "The unique experiment variation of the campaign"}, "user_email": {"type": "text", "index": 7, "name": "user_email", "comment": "Email of the user if it exists."}, "user_full_name": {"type": "text", "index": 8, "name": "user_full_name", "comment": "The users first and last name"}, "campaign_name": {"type": "text", "index": 9, "name": "campaign_name", "comment": "The name of the campaign which the user metrics are associated"}, "template_id": {"type": "text", "index": 10, "name": "template_id", "comment": "The unique identifier of the template used within the campaign"}, "template_name": {"type": "text", "index": 11, "name": "template_name", "comment": "The name of the template used for the campaign"}, "recurring_campaign_id": {"type": "text", "index": 12, "name": "recurring_campaign_id", "comment": "The unique identifier of the recurring campaign which the campaign is tied to"}, "recurring_campaign_name": {"type": "text", "index": 13, "name": "recurring_campaign_name", "comment": "The name of the recurring campaign which the campaign is tied to"}, "first_event_at": {"type": "timestamp without time zone", "index": 14, "name": "first_event_at", "comment": "Timestamp of the first campaign/experiment event associated with the user"}, "last_event_at": {"type": "timestamp without time zone", "index": 15, "name": "last_event_at", "comment": "Timestamp of the most recent campaign/experiment event associated with the user"}, "first_open_or_click_event_at": {"type": "timestamp without time zone", "index": 16, "name": "first_open_or_click_event_at", "comment": "The time of the first open or click time. This is the first time a user interacts with a campaign, recording the earliest occurring event out of 'emailOpen', 'emailClick', and 'pushOpen'."}, "total_emailclick": {"type": "bigint", "index": 17, "name": "total_emailclick", "comment": "Total email clicks events the user took within the campaign/experiment"}, "total_emailunsubscribe": {"type": "bigint", "index": 18, "name": "total_emailunsubscribe", "comment": "Total email unsubscription events the user performed within the campaign/experiment"}, "total_emailcomplaint": {"type": "bigint", "index": 19, "name": "total_emailcomplaint", "comment": "Total email complaint events the user performed within the campaign/experiment"}, "total_customevent": {"type": "bigint", "index": 20, "name": "total_customevent", "comment": "Total custom events associated with the user within the campaign/experiment"}, "total_emailsubscribe": {"type": "bigint", "index": 21, "name": "total_emailsubscribe", "comment": "Total email subscription events associate with the user within the campaign/experiment"}, "total_emailopen": {"type": "bigint", "index": 22, "name": "total_emailopen", "comment": "Total email open events the user performed within the campaign/experiment"}, "total_pushsend": {"type": "bigint", "index": 23, "name": "total_pushsend", "comment": "Total push send events the user performed within the campaign/experiment"}, "total_smsbounce": {"type": "bigint", "index": 24, "name": "total_smsbounce", "comment": "Total sms bounce events associated with the user within the campaign/experiment"}, "total_pushbounce": {"type": "bigint", "index": 25, "name": "total_pushbounce", "comment": "Total push bounce events associated with the user within the campaign/experiment"}, "total_inappsendskip": {"type": "bigint", "index": 26, "name": "total_inappsendskip", "comment": "Total in app send skip events the user performed within the campaign/experiment"}, "total_smssend": {"type": "bigint", "index": 27, "name": "total_smssend", "comment": "Total sms send events associated with the user within the campaign/experiment"}, "total_inappsend": {"type": "bigint", "index": 28, "name": "total_inappsend", "comment": "Total in app send events associated with the user within the campaign/experiment"}, "total_pushopen": {"type": "bigint", "index": 29, "name": "total_pushopen", "comment": "Total push open events the user performed within the campaign/experiment"}, "total_emailsend": {"type": "bigint", "index": 30, "name": "total_emailsend", "comment": "Total email send event associated with the user within the campaign/experiment"}, "total_pushsendskip": {"type": "bigint", "index": 31, "name": "total_pushsendskip", "comment": "Total push send skip events associated with the user within the campaign/experiment"}, "total_inappopen": {"type": "bigint", "index": 32, "name": "total_inappopen", "comment": "Total in app open events associated with the user within the campaign/experiment"}, "total_emailsendskip": {"type": "bigint", "index": 33, "name": "total_emailsendskip", "comment": "Total email send skip events associated with the user within the campaign/experiment"}, "total_emailbounce": {"type": "bigint", "index": 34, "name": "total_emailbounce", "comment": "Total email bounce events associated with the user within the campaign/experiment"}, "total_inappclick": {"type": "bigint", "index": 35, "name": "total_inappclick", "comment": "Total in app click events associated with the user within the campaign/experiment"}, "total_pushuninstall": {"type": "bigint", "index": 36, "name": "total_pushuninstall", "comment": "Total push uninstall events associated with the user within the campaign/experiment"}, "unique_user_campaign_id": {"type": "text", "index": 37, "name": "unique_user_campaign_id", "comment": "Unique ID combining source_relation, unique_user_key, campaign_id, and if available, experiment_id."}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.iterable__user_campaign"}, "model.iterable.iterable__user_unsubscriptions": {"metadata": {"type": "BASE TABLE", "schema": "public_iterable_dev", "name": "iterable__user_unsubscriptions", "database": "postgres", "comment": "Table that generates the total channel and message types a user has chosen to unsubscribe.", "owner": "postgres"}, "columns": {"source_relation": {"type": "text", "index": 1, "name": "source_relation", "comment": "Identifies the record's source."}, "_fivetran_user_id": {"type": "text", "index": 2, "name": "_fivetran_user_id", "comment": "A Fivetran-created unique identifier for the new Iterable schema in Aug 2023, for users, derived from hashing user_id and/or email, depending on project type."}, "unique_user_key": {"type": "text", "index": 3, "name": "unique_user_key", "comment": "The unique identifier of the user. With the new schema (Aug 2023), it is the _fivetran_user_id. This is a hash of user_id and/or email, depending on project type. If using the old schema, it is email."}, "channel_id": {"type": "text", "index": 4, "name": "channel_id", "comment": "Unique identifier of the channel which the user is unsubscribed"}, "message_type_id": {"type": "text", "index": 5, "name": "message_type_id", "comment": "Unique identifier of the message type which the user is unsubscribed"}, "updated_at": {"type": "timestamp without time zone", "index": 6, "name": "updated_at", "comment": "Timestamp of when the user unsubscribed from the channel or message type"}, "channel_name": {"type": "text", "index": 7, "name": "channel_name", "comment": "The name of the channel which the user is unsubscribed"}, "message_type_name": {"type": "text", "index": 8, "name": "message_type_name", "comment": "The name of the message type which the user is unsubscribed"}, "channel_type": {"type": "text", "index": 9, "name": "channel_type", "comment": "The channel type which the user is unsubscribed"}, "message_medium": {"type": "text", "index": 10, "name": "message_medium", "comment": "The medium type the message was provided which the user is unsubscribed"}, "is_unsubscribed_channel_wide": {"type": "boolean", "index": 11, "name": "is_unsubscribed_channel_wide", "comment": "Boolean indicating if the user unsubscribed at the channel level (i.e. unsubscribed to all message types) or if they unsubscribed from only an individual message type.\n"}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.iterable__user_unsubscriptions"}, "model.iterable.iterable__users": {"metadata": {"type": "BASE TABLE", "schema": "public_iterable_dev", "name": "iterable__users", "database": "postgres", "comment": "Table that provides unique user enriched information.", "owner": "postgres"}, "columns": {"source_relation": {"type": "text", "index": 1, "name": "source_relation", "comment": "Identifies the record's source."}, "user_id": {"type": "text", "index": 2, "name": "user_id", "comment": "User identifier, for userID-based projects."}, "_fivetran_user_id": {"type": "text", "index": 3, "name": "_fivetran_user_id", "comment": "A Fivetran-created unique identifier for the new Iterable schema in Aug 2023, for users, derived from hashing user_id and/or email, depending on project type."}, "unique_user_key": {"type": "text", "index": 4, "name": "unique_user_key", "comment": "The unique identifier of the user. With the new schema (Aug 2023), it is the _fivetran_user_id. This is a hash of user_id and/or email, depending on project type. If using the old schema, it is email."}, "email": {"type": "text", "index": 5, "name": "email", "comment": "The user's email. User identifier, for email-based projects. Previously was the unique identifier for user records, for the old Iterable schema before the August 2023 updates."}, "first_name": {"type": "integer", "index": 6, "name": "first_name", "comment": "First name of the user"}, "last_name": {"type": "integer", "index": 7, "name": "last_name", "comment": "Last name of the user"}, "signup_date": {"type": "text", "index": 8, "name": "signup_date", "comment": "Timestamp of when the user signed up"}, "signup_source": {"type": "text", "index": 9, "name": "signup_source", "comment": "Source where the user signed up"}, "updated_at": {"type": "timestamp without time zone", "index": 10, "name": "updated_at", "comment": "Last update timestamp"}, "phone_number": {"type": "integer", "index": 11, "name": "phone_number", "comment": "Phone number associated with the user"}, "email_list_ids": {"type": "text", "index": 12, "name": "email_list_ids", "comment": "Array of all email lists associated with the user, derived from the list_user table relationships"}, "count_lists": {"type": "bigint", "index": 13, "name": "count_lists", "comment": "Total count of lists associated with the user"}, "count_total_campaigns": {"type": "bigint", "index": 14, "name": "count_total_campaigns", "comment": "Count of all campaigns the user has been in"}, "first_event_at": {"type": "timestamp without time zone", "index": 15, "name": "first_event_at", "comment": "The first event the user ever encountered"}, "last_event_at": {"type": "timestamp without time zone", "index": 16, "name": "last_event_at", "comment": "The most recent event the user has encountered"}, "total_emailclick": {"type": "numeric", "index": 17, "name": "total_emailclick", "comment": "Total number of email clicks the user has performed"}, "total_emailunsubscribe": {"type": "numeric", "index": 18, "name": "total_emailunsubscribe", "comment": "Total unsubscription events the user has performed"}, "total_emailcomplaint": {"type": "numeric", "index": 19, "name": "total_emailcomplaint", "comment": "Total email complaints the user has performed"}, "total_customevent": {"type": "numeric", "index": 20, "name": "total_customevent", "comment": "Total custom events associated with the user"}, "total_emailsubscribe": {"type": "numeric", "index": 21, "name": "total_emailsubscribe", "comment": "Total subscription events the user has performed"}, "total_emailopen": {"type": "numeric", "index": 22, "name": "total_emailopen", "comment": "Total email opened events the user has performed"}, "total_pushsend": {"type": "numeric", "index": 23, "name": "total_pushsend", "comment": "The push send events the user has experienced"}, "total_smsbounce": {"type": "numeric", "index": 24, "name": "total_smsbounce", "comment": "Total sms bounces that are associated with the user"}, "total_pushbounce": {"type": "numeric", "index": 25, "name": "total_pushbounce", "comment": "Total number of push bounces associated with the user"}, "total_inappsendskip": {"type": "numeric", "index": 26, "name": "total_inappsendskip", "comment": "Total in app send skips associated with the user"}, "total_smssend": {"type": "numeric", "index": 27, "name": "total_smssend", "comment": "Total sms sends that the user has experienced"}, "total_inappsend": {"type": "numeric", "index": 28, "name": "total_inappsend", "comment": "Total in app sends the user has experienced"}, "total_pushopen": {"type": "numeric", "index": 29, "name": "total_pushopen", "comment": "Total push messages the user has opened"}, "total_emailsend": {"type": "numeric", "index": 30, "name": "total_emailsend", "comment": "Total emails that have been sent to the user"}, "total_pushsendskip": {"type": "numeric", "index": 31, "name": "total_pushsendskip", "comment": "Total push sends the user has skipped"}, "total_inappopen": {"type": "numeric", "index": 32, "name": "total_inappopen", "comment": "Total in app opens the user has performed"}, "total_emailsendskip": {"type": "numeric", "index": 33, "name": "total_emailsendskip", "comment": "Total email sends the user has skipped"}, "total_emailbounce": {"type": "numeric", "index": 34, "name": "total_emailbounce", "comment": "Total number of emails that have bounced from the user"}, "total_inappclick": {"type": "numeric", "index": 35, "name": "total_inappclick", "comment": "Total in app clicks associated with the user"}, "total_pushuninstall": {"type": "numeric", "index": 36, "name": "total_pushuninstall", "comment": "Total push uninstall events the user has performed"}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.iterable__users"}, "model.iterable.stg_iterable__campaign_history": {"metadata": {"type": "BASE TABLE", "schema": "public_iterable_dev", "name": "stg_iterable__campaign_history", "database": "postgres", "comment": "Table containing a history of campaigns.", "owner": "postgres"}, "columns": {"source_relation": {"type": "text", "index": 1, "name": "source_relation", "comment": "Identifies the record's source."}, "campaign_id": {"type": "text", "index": 2, "name": "campaign_id", "comment": "Unique identifier of the campaign record"}, "updated_at": {"type": "text", "index": 3, "name": "updated_at", "comment": "Last update timestamp"}, "campaign_name": {"type": "text", "index": 4, "name": "campaign_name", "comment": "User defined name of the campaign."}, "campaign_state": {"type": "text", "index": 5, "name": "campaign_state", "comment": "State of the campaign. Can be Draft, Ready, Scheduled, Running, Finished, Starting, Aborted or Recurring"}, "campaign_type": {"type": "text", "index": 6, "name": "campaign_type", "comment": "The campaign type. Can be Blast or Triggered"}, "send_size": {"type": "integer", "index": 7, "name": "send_size", "comment": "Size of the campaign. Number of individuals included in the campaign"}, "start_at": {"type": "integer", "index": 8, "name": "start_at", "comment": "Start timestamp"}, "ended_at": {"type": "integer", "index": 9, "name": "ended_at", "comment": "Ended timestamp"}, "created_at": {"type": "text", "index": 10, "name": "created_at", "comment": "Creation timestamp"}, "message_medium": {"type": "text", "index": 11, "name": "message_medium", "comment": "The medium that this message was sent via, for example Email or InApp"}, "recurring_campaign_id": {"type": "text", "index": 12, "name": "recurring_campaign_id", "comment": "Reference to the recurring campaign, if applicable"}, "created_by_user_id": {"type": "text", "index": 13, "name": "created_by_user_id", "comment": "Reference to the user who created the campaign"}, "updated_by_user_id": {"type": "text", "index": 14, "name": "updated_by_user_id", "comment": "ID of the user who updated this record"}, "template_id": {"type": "text", "index": 15, "name": "template_id", "comment": "Reference to the campaign template"}, "workflow_id": {"type": "integer", "index": 16, "name": "workflow_id", "comment": "Reference to the workflow which the event originated"}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 17, "name": "_fivetran_synced", "comment": "The time when a record was last updated by Fivetran."}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.stg_iterable__campaign_history"}, "model.iterable.stg_iterable__campaign_history_tmp": {"metadata": {"type": "VIEW", "schema": "public_iterable_dev", "name": "stg_iterable__campaign_history_tmp", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"id": {"type": "integer", "index": 1, "name": "id", "comment": null}, "updated_at": {"type": "text", "index": 2, "name": "updated_at", "comment": null}, "template_id": {"type": "integer", "index": 3, "name": "template_id", "comment": null}, "recurring_campaign_id": {"type": "integer", "index": 4, "name": "recurring_campaign_id", "comment": null}, "campaign_state": {"type": "text", "index": 5, "name": "campaign_state", "comment": null}, "created_at": {"type": "text", "index": 6, "name": "created_at", "comment": null}, "created_by_user_id": {"type": "text", "index": 7, "name": "created_by_user_id", "comment": null}, "ended_at": {"type": "integer", "index": 8, "name": "ended_at", "comment": null}, "name": {"type": "text", "index": 9, "name": "name", "comment": null}, "send_size": {"type": "integer", "index": 10, "name": "send_size", "comment": null}, "start_at": {"type": "integer", "index": 11, "name": "start_at", "comment": null}, "type": {"type": "text", "index": 12, "name": "type", "comment": null}, "workflow_id": {"type": "integer", "index": 13, "name": "workflow_id", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 14, "name": "_fivetran_synced", "comment": null}, "updated_by_user_id": {"type": "integer", "index": 15, "name": "updated_by_user_id", "comment": null}, "message_medium": {"type": "text", "index": 16, "name": "message_medium", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.stg_iterable__campaign_history_tmp"}, "model.iterable.stg_iterable__campaign_label_history": {"metadata": {"type": "BASE TABLE", "schema": "public_iterable_dev", "name": "stg_iterable__campaign_label_history", "database": "postgres", "comment": "Table containing a history of labels.", "owner": "postgres"}, "columns": {"source_relation": {"type": "text", "index": 1, "name": "source_relation", "comment": "Identifies the record's source."}, "campaign_id": {"type": "text", "index": 2, "name": "campaign_id", "comment": "Reference to the campaign associated with the label"}, "label": {"type": "text", "index": 3, "name": "label", "comment": "Name of the label"}, "updated_at": {"type": "text", "index": 4, "name": "updated_at", "comment": "Last update timestamp"}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 5, "name": "_fivetran_synced", "comment": "The time when a record was last updated by Fivetran."}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.stg_iterable__campaign_label_history"}, "model.iterable.stg_iterable__campaign_label_history_tmp": {"metadata": {"type": "VIEW", "schema": "public_iterable_dev", "name": "stg_iterable__campaign_label_history_tmp", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"campaign_id": {"type": "integer", "index": 1, "name": "campaign_id", "comment": null}, "label": {"type": "text", "index": 2, "name": "label", "comment": null}, "updated_at": {"type": "text", "index": 3, "name": "updated_at", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 4, "name": "_fivetran_synced", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.stg_iterable__campaign_label_history_tmp"}, "model.iterable.stg_iterable__campaign_list_history": {"metadata": {"type": "BASE TABLE", "schema": "public_iterable_dev", "name": "stg_iterable__campaign_list_history", "database": "postgres", "comment": "Table containing a history of lists.", "owner": "postgres"}, "columns": {"source_relation": {"type": "text", "index": 1, "name": "source_relation", "comment": "Identifies the record's source."}, "campaign_id": {"type": "text", "index": 2, "name": "campaign_id", "comment": "Reference to the campaign associated with the label"}, "list_id": {"type": "text", "index": 3, "name": "list_id", "comment": "Reference to the list used"}, "updated_at": {"type": "text", "index": 4, "name": "updated_at", "comment": "Last update timestamp"}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 5, "name": "_fivetran_synced", "comment": "The time when a record was last updated by Fivetran."}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.stg_iterable__campaign_list_history"}, "model.iterable.stg_iterable__campaign_list_history_tmp": {"metadata": {"type": "VIEW", "schema": "public_iterable_dev", "name": "stg_iterable__campaign_list_history_tmp", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"list_id": {"type": "integer", "index": 1, "name": "list_id", "comment": null}, "campaign_id": {"type": "integer", "index": 2, "name": "campaign_id", "comment": null}, "updated_at": {"type": "text", "index": 3, "name": "updated_at", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 4, "name": "_fivetran_synced", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.stg_iterable__campaign_list_history_tmp"}, "model.iterable.stg_iterable__campaign_suppression_list_history": {"metadata": {"type": "BASE TABLE", "schema": "public_iterable_dev", "name": "stg_iterable__campaign_suppression_list_history", "database": "postgres", "comment": "Table containing a history of suppression lists.", "owner": "postgres"}, "columns": {"source_relation": {"type": "text", "index": 1, "name": "source_relation", "comment": "Identifies the record's source."}, "campaign_id": {"type": "text", "index": 2, "name": "campaign_id", "comment": "Reference to the campaign associated with the label"}, "suppressed_list_id": {"type": "text", "index": 3, "name": "suppressed_list_id", "comment": "Reference to the list used"}, "updated_at": {"type": "text", "index": 4, "name": "updated_at", "comment": "Last update timestamp"}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 5, "name": "_fivetran_synced", "comment": "The time when a record was last updated by Fivetran."}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.stg_iterable__campaign_suppression_list_history"}, "model.iterable.stg_iterable__campaign_suppression_list_history_tmp": {"metadata": {"type": "VIEW", "schema": "public_iterable_dev", "name": "stg_iterable__campaign_suppression_list_history_tmp", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"suppressed_list_id": {"type": "integer", "index": 1, "name": "suppressed_list_id", "comment": null}, "campaign_id": {"type": "integer", "index": 2, "name": "campaign_id", "comment": null}, "updated_at": {"type": "text", "index": 3, "name": "updated_at", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 4, "name": "_fivetran_synced", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.stg_iterable__campaign_suppression_list_history_tmp"}, "model.iterable.stg_iterable__channel": {"metadata": {"type": "BASE TABLE", "schema": "public_iterable_dev", "name": "stg_iterable__channel", "database": "postgres", "comment": "Table containing unique channels.", "owner": "postgres"}, "columns": {"source_relation": {"type": "text", "index": 1, "name": "source_relation", "comment": "Identifies the record's source."}, "channel_id": {"type": "text", "index": 2, "name": "channel_id", "comment": "Unique identifier of the channel"}, "channel_name": {"type": "text", "index": 3, "name": "channel_name", "comment": "User defined name of the channel"}, "channel_type": {"type": "text", "index": 4, "name": "channel_type", "comment": "The channel type"}, "message_medium": {"type": "text", "index": 5, "name": "message_medium", "comment": "The message medium associated with the channel"}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 6, "name": "_fivetran_synced", "comment": "The time when a record was last updated by Fivetran."}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.stg_iterable__channel"}, "model.iterable.stg_iterable__channel_tmp": {"metadata": {"type": "VIEW", "schema": "public_iterable_dev", "name": "stg_iterable__channel_tmp", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"id": {"type": "bigint", "index": 1, "name": "id", "comment": null}, "name": {"type": "text", "index": 2, "name": "name", "comment": null}, "channel_type": {"type": "text", "index": 3, "name": "channel_type", "comment": null}, "message_medium": {"type": "text", "index": 4, "name": "message_medium", "comment": null}, "_fivetran_deleted": {"type": "boolean", "index": 5, "name": "_fivetran_deleted", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 6, "name": "_fivetran_synced", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.stg_iterable__channel_tmp"}, "model.iterable.stg_iterable__event": {"metadata": {"type": "VIEW", "schema": "public_iterable_dev", "name": "stg_iterable__event", "database": "postgres", "comment": "Table containing individual events within campaigns.", "owner": "postgres"}, "columns": {"source_relation": {"type": "text", "index": 1, "name": "source_relation", "comment": "Identifies the record's source."}, "event_id": {"type": "text", "index": 2, "name": "event_id", "comment": "A Fivetran-created unique identifier derived from hashing campaign_id, created_at, and event_name."}, "unique_event_id": {"type": "text", "index": 3, "name": "unique_event_id", "comment": "A surrogate key made up of event_id, _fivetran_user_id, and source_relation."}, "_fivetran_user_id": {"type": "text", "index": 4, "name": "_fivetran_user_id", "comment": "A Fivetran-created unique identifier for users, derived from hashing user_id and/or email, depending on project type. This exists for users of the new schema starting Aug 2023. In the old schema, the unique identifier is email."}, "unique_user_key": {"type": "text", "index": 5, "name": "unique_user_key", "comment": "The unique identifier of the user. With the new schema (Aug 2023), it is the _fivetran_user_id. This is a hash of user_id and/or email, depending on project type. If using the old schema, it is email."}, "campaign_id": {"type": "text", "index": 6, "name": "campaign_id", "comment": "Reference to the campaign from which the event originated"}, "content_id": {"type": "text", "index": 7, "name": "content_id", "comment": "Reference to the content the event is associated with"}, "created_at": {"type": "timestamp without time zone", "index": 8, "name": "created_at", "comment": "Creation timestamp"}, "created_on": {"type": "date", "index": 9, "name": "created_on", "comment": "Creation date"}, "email": {"type": "text", "index": 10, "name": "email", "comment": "Reference to the unique user the event was applied to"}, "additional_properties": {"type": "text", "index": 11, "name": "additional_properties", "comment": "json object containing addition event properties"}, "event_name": {"type": "text", "index": 12, "name": "event_name", "comment": "Name provided to the individual event"}, "message_bus_id": {"type": "text", "index": 13, "name": "message_bus_id", "comment": "Reference to the message bus associated with the event"}, "message_id": {"type": "text", "index": 14, "name": "message_id", "comment": "Reference to the message the event is associated with"}, "message_type_id": {"type": "text", "index": 15, "name": "message_type_id", "comment": "Reference to the type of message the event is associated with"}, "recipient_state": {"type": "integer", "index": 16, "name": "recipient_state", "comment": "The state of the recipient upon receiving the event"}, "status": {"type": "integer", "index": 17, "name": "status", "comment": "Status of the event"}, "transactional_data": {"type": "character varying(100)", "index": 18, "name": "transactional_data", "comment": "Transactional data associated with the event"}, "unsub_source": {"type": "integer", "index": 19, "name": "unsub_source", "comment": "Source of the unsubscribe event"}, "user_agent": {"type": "integer", "index": 20, "name": "user_agent", "comment": "User agent associated with the event"}, "user_agent_device": {"type": "integer", "index": 21, "name": "user_agent_device", "comment": "The device of the user agent"}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 22, "name": "_fivetran_synced", "comment": "The time when a record was last updated by Fivetran."}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.stg_iterable__event"}, "model.iterable.stg_iterable__event_extension": {"metadata": {"type": "VIEW", "schema": "public_iterable_dev", "name": "stg_iterable__event_extension", "database": "postgres", "comment": "Table containing addition properties from the event table.", "owner": "postgres"}, "columns": {"source_relation": {"type": "text", "index": 1, "name": "source_relation", "comment": "Identifies the record's source."}, "event_id": {"type": "text", "index": 2, "name": "event_id", "comment": "A Fivetran-created unique identifier derived from hashing campaign_id, created_at, and event_name."}, "unique_event_id": {"type": "text", "index": 3, "name": "unique_event_id", "comment": "A surrogate key made up of event_id, _fivetran_user_id, and source_relation."}, "is_app_already_running": {"type": "integer", "index": 4, "name": "is_app_already_running", "comment": "Boolean indicating if the app is currently running or not"}, "badge": {"type": "integer", "index": 5, "name": "badge", "comment": "Badge associated with the event"}, "catalog_collection_count": {"type": "integer", "index": 6, "name": "catalog_collection_count", "comment": "The count of products or items collected in a catalog associated with the event."}, "catalog_lookup_count": {"type": "integer", "index": 7, "name": "catalog_lookup_count", "comment": "The count of times a catalog was looked up or queried during the event."}, "canonical_url_id": {"type": "text", "index": 8, "name": "canonical_url_id", "comment": "Reference to the url associated with the event"}, "is_content_available": {"type": "integer", "index": 9, "name": "is_content_available", "comment": "Content available from the event"}, "content_id": {"type": "text", "index": 10, "name": "content_id", "comment": "Reference to the content associated with the event"}, "device": {"type": "integer", "index": 11, "name": "device", "comment": "The device associated with the event"}, "email_id": {"type": "text", "index": 12, "name": "email_id", "comment": "Reference to the email associated with the event"}, "email_subject": {"type": "text", "index": 13, "name": "email_subject", "comment": "Subject of the email associated with the event"}, "experiment_id": {"type": "integer", "index": 14, "name": "experiment_id", "comment": "Reference to the experiment used if the event is an experiment"}, "from_phone_number_id": {"type": "integer", "index": 15, "name": "from_phone_number_id", "comment": "Reference to the phone number which the event is from"}, "from_smssender_id": {"type": "integer", "index": 16, "name": "from_smssender_id", "comment": "Reference to the sms sender which the event is from"}, "link_id": {"type": "text", "index": 17, "name": "link_id", "comment": "Reference to the link associated with the event"}, "link_url": {"type": "integer", "index": 18, "name": "link_url", "comment": "Url of the link associated with the event"}, "locale": {"type": "integer", "index": 19, "name": "locale", "comment": "Locale associated with the event"}, "payload": {"type": "character varying(100)", "index": 20, "name": "payload", "comment": "Payload resulted from the event"}, "platform_endpoint": {"type": "integer", "index": 21, "name": "platform_endpoint", "comment": "The specific platform endpoint of the event"}, "push_message": {"type": "integer", "index": 22, "name": "push_message", "comment": "Boolean indicating if the event is a push message"}, "region": {"type": "text", "index": 23, "name": "region", "comment": "Region of the event"}, "sms_message": {"type": "integer", "index": 24, "name": "sms_message", "comment": "Boolean indicating if the event is an sms message"}, "to_phone_number": {"type": "integer", "index": 25, "name": "to_phone_number", "comment": "To phone number associated with the event"}, "url": {"type": "integer", "index": 26, "name": "url", "comment": "Url associated with the event"}, "workflow_id": {"type": "text", "index": 27, "name": "workflow_id", "comment": "Reference to the workflow which the event originated"}, "workflow_name": {"type": "text", "index": 28, "name": "workflow_name", "comment": "Name of the workflow which the event originated"}, "city": {"type": "text", "index": 29, "name": "city", "comment": "The city associated with the event, which could be the location of the recipient."}, "clicked_url": {"type": "text", "index": 30, "name": "clicked_url", "comment": "The URL that was clicked by the recipient in response to the marketing message."}, "country": {"type": "text", "index": 31, "name": "country", "comment": "The country associated with the event, which could be the location of the recipient."}, "error_code": {"type": "integer", "index": 32, "name": "error_code", "comment": "The error code or message indicating any issues or errors encountered during the event."}, "expires_at": {"type": "text", "index": 33, "name": "expires_at", "comment": "The date and time when the event or message is set to expire or become invalid."}, "from_phone_number": {"type": "integer", "index": 34, "name": "from_phone_number", "comment": "The phone number from which the SMS message was sent."}, "in_app_body": {"type": "text", "index": 35, "name": "in_app_body", "comment": "The content or body of an in-app message that was sent as part of the event."}, "is_sms_estimation": {"type": "boolean", "index": 36, "name": "is_sms_estimation", "comment": "A boolean indicating whether the SMS message is an estimation or not."}, "labels": {"type": "text", "index": 37, "name": "labels", "comment": "Any labels or tags associated with the event, which can be used for categorization or organization."}, "message_status": {"type": "text", "index": 38, "name": "message_status", "comment": "The status of the marketing message, such as sent, delivered, opened, etc."}, "mms_send_count": {"type": "integer", "index": 39, "name": "mms_send_count", "comment": "The count of multimedia messages (MMS) sent as part of the event."}, "reason": {"type": "text", "index": 40, "name": "reason", "comment": "The reason or cause associated with a specific event or action."}, "sms_send_count": {"type": "integer", "index": 41, "name": "sms_send_count", "comment": "The count of SMS messages sent as part of the event."}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 42, "name": "_fivetran_synced", "comment": "The time when a record was last updated by Fivetran."}, "_fivetran_user_id": {"type": "text", "index": 43, "name": "_fivetran_user_id", "comment": "A Fivetran-created unique identifier for users, derived from hashing user_id and/or email, depending on project type. This exists for users of the new schema starting Aug 2023. In the old schema, the unique identifier is email."}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.stg_iterable__event_extension"}, "model.iterable.stg_iterable__event_extension_tmp": {"metadata": {"type": "VIEW", "schema": "public_iterable_dev", "name": "stg_iterable__event_extension_tmp", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"_fivetran_id": {"type": "text", "index": 1, "name": "_fivetran_id", "comment": null}, "app_already_running": {"type": "integer", "index": 2, "name": "app_already_running", "comment": null}, "badge": {"type": "integer", "index": 3, "name": "badge", "comment": null}, "canonical_url_id": {"type": "integer", "index": 4, "name": "canonical_url_id", "comment": null}, "content_available": {"type": "integer", "index": 5, "name": "content_available", "comment": null}, "content_id": {"type": "integer", "index": 6, "name": "content_id", "comment": null}, "device": {"type": "integer", "index": 7, "name": "device", "comment": null}, "email_id": {"type": "text", "index": 8, "name": "email_id", "comment": null}, "email_subject": {"type": "text", "index": 9, "name": "email_subject", "comment": null}, "experiment_id": {"type": "integer", "index": 10, "name": "experiment_id", "comment": null}, "from_phone_number_id": {"type": "integer", "index": 11, "name": "from_phone_number_id", "comment": null}, "from_smssender_id": {"type": "integer", "index": 12, "name": "from_smssender_id", "comment": null}, "image_url": {"type": "integer", "index": 13, "name": "image_url", "comment": null}, "is_ghost_push": {"type": "integer", "index": 14, "name": "is_ghost_push", "comment": null}, "link_id": {"type": "integer", "index": 15, "name": "link_id", "comment": null}, "link_url": {"type": "integer", "index": 16, "name": "link_url", "comment": null}, "platform_endpoint": {"type": "integer", "index": 17, "name": "platform_endpoint", "comment": null}, "push_message": {"type": "integer", "index": 18, "name": "push_message", "comment": null}, "region": {"type": "text", "index": 19, "name": "region", "comment": null}, "sms_message": {"type": "integer", "index": 20, "name": "sms_message", "comment": null}, "sound": {"type": "integer", "index": 21, "name": "sound", "comment": null}, "to_phone_number": {"type": "integer", "index": 22, "name": "to_phone_number", "comment": null}, "url": {"type": "integer", "index": 23, "name": "url", "comment": null}, "workflow_id": {"type": "integer", "index": 24, "name": "workflow_id", "comment": null}, "workflow_name": {"type": "text", "index": 25, "name": "workflow_name", "comment": null}, "locale": {"type": "integer", "index": 26, "name": "locale", "comment": null}, "deeplink_android": {"type": "integer", "index": 27, "name": "deeplink_android", "comment": null}, "deeplink_ios": {"type": "integer", "index": 28, "name": "deeplink_ios", "comment": null}, "payload": {"type": "character varying(100)", "index": 29, "name": "payload", "comment": null}, "sms_provider_response_status": {"type": "integer", "index": 30, "name": "sms_provider_response_status", "comment": null}, "sms_provider_response_message": {"type": "integer", "index": 31, "name": "sms_provider_response_message", "comment": null}, "sms_provider_response_code": {"type": "integer", "index": 32, "name": "sms_provider_response_code", "comment": null}, "sms_provider_response_more_info": {"type": "integer", "index": 33, "name": "sms_provider_response_more_info", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 34, "name": "_fivetran_synced", "comment": null}, "catalog_collection_count": {"type": "integer", "index": 35, "name": "catalog_collection_count", "comment": null}, "catalog_lookup_count": {"type": "integer", "index": 36, "name": "catalog_lookup_count", "comment": null}, "city": {"type": "text", "index": 37, "name": "city", "comment": null}, "clicked_url": {"type": "text", "index": 38, "name": "clicked_url", "comment": null}, "country": {"type": "text", "index": 39, "name": "country", "comment": null}, "error_code": {"type": "integer", "index": 40, "name": "error_code", "comment": null}, "expires_at": {"type": "text", "index": 41, "name": "expires_at", "comment": null}, "from_phone_number": {"type": "integer", "index": 42, "name": "from_phone_number", "comment": null}, "in_app_body": {"type": "text", "index": 43, "name": "in_app_body", "comment": null}, "is_sms_estimation": {"type": "boolean", "index": 44, "name": "is_sms_estimation", "comment": null}, "labels": {"type": "text", "index": 45, "name": "labels", "comment": null}, "message_context": {"type": "text", "index": 46, "name": "message_context", "comment": null}, "message_status": {"type": "text", "index": 47, "name": "message_status", "comment": null}, "mms_send_count": {"type": "integer", "index": 48, "name": "mms_send_count", "comment": null}, "product_recommendation_count": {"type": "integer", "index": 49, "name": "product_recommendation_count", "comment": null}, "proxy_source": {"type": "text", "index": 50, "name": "proxy_source", "comment": null}, "reason": {"type": "text", "index": 51, "name": "reason", "comment": null}, "sms_send_count": {"type": "integer", "index": 52, "name": "sms_send_count", "comment": null}, "web_push_body": {"type": "text", "index": 53, "name": "web_push_body", "comment": null}, "web_push_click_action": {"type": "text", "index": 54, "name": "web_push_click_action", "comment": null}, "web_push_icon": {"type": "text", "index": 55, "name": "web_push_icon", "comment": null}, "web_push_message": {"type": "text", "index": 56, "name": "web_push_message", "comment": null}, "_fivetran_user_id": {"type": "integer", "index": 57, "name": "_fivetran_user_id", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.stg_iterable__event_extension_tmp"}, "model.iterable.stg_iterable__event_tmp": {"metadata": {"type": "VIEW", "schema": "public_iterable_dev", "name": "stg_iterable__event_tmp", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"_fivetran_id": {"type": "text", "index": 1, "name": "_fivetran_id", "comment": null}, "email": {"type": "text", "index": 2, "name": "email", "comment": null}, "campaign_id": {"type": "integer", "index": 3, "name": "campaign_id", "comment": null}, "message_id": {"type": "integer", "index": 4, "name": "message_id", "comment": null}, "content_id": {"type": "integer", "index": 5, "name": "content_id", "comment": null}, "created_at": {"type": "timestamp without time zone", "index": 6, "name": "created_at", "comment": null}, "event_name": {"type": "text", "index": 7, "name": "event_name", "comment": null}, "ip": {"type": "integer", "index": 8, "name": "ip", "comment": null}, "message_bus_id": {"type": "integer", "index": 9, "name": "message_bus_id", "comment": null}, "message_type_id": {"type": "integer", "index": 10, "name": "message_type_id", "comment": null}, "recipient_state": {"type": "integer", "index": 11, "name": "recipient_state", "comment": null}, "status": {"type": "integer", "index": 12, "name": "status", "comment": null}, "unsub_source": {"type": "integer", "index": 13, "name": "unsub_source", "comment": null}, "user_agent": {"type": "integer", "index": 14, "name": "user_agent", "comment": null}, "user_agent_device": {"type": "integer", "index": 15, "name": "user_agent_device", "comment": null}, "transactional_data": {"type": "character varying(100)", "index": 16, "name": "transactional_data", "comment": null}, "additional_properties": {"type": "text", "index": 17, "name": "additional_properties", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 18, "name": "_fivetran_synced", "comment": null}, "_fivetran_user_id": {"type": "integer", "index": 19, "name": "_fivetran_user_id", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.stg_iterable__event_tmp"}, "model.iterable.stg_iterable__journey": {"metadata": {"type": "BASE TABLE", "schema": "public_iterable_dev", "name": "stg_iterable__journey", "database": "postgres", "comment": "Table containing unique journeys, formerly known as workflows.", "owner": "postgres"}, "columns": {"source_relation": {"type": "text", "index": 1, "name": "source_relation", "comment": "Identifies the record's source."}, "journey_id": {"type": "text", "index": 2, "name": "journey_id", "comment": "Unique identifier of the journey"}, "journey_name": {"type": "text", "index": 3, "name": "journey_name", "comment": "User defined name of the journey"}, "journey_type": {"type": "text", "index": 4, "name": "journey_type", "comment": "The journey type"}, "journey_description": {"type": "text", "index": 5, "name": "journey_description", "comment": "Information about the journey"}, "creator_user_id": {"type": "text", "index": 6, "name": "creator_user_id", "comment": "Reference to the user who created the journey"}, "is_enabled": {"type": "boolean", "index": 7, "name": "is_enabled", "comment": "Boolean indicating if the journey is currently enabled"}, "is_archived": {"type": "boolean", "index": 8, "name": "is_archived", "comment": "Boolean indicating if the journey has been archived"}, "lifetime_limit": {"type": "integer", "index": 9, "name": "lifetime_limit", "comment": "Maximum number of times a user may enter the journey over their lifetime"}, "simultaneous_limit": {"type": "integer", "index": 10, "name": "simultaneous_limit", "comment": "Maximum number of times a user may be in the journey at the same time"}, "start_tile_id": {"type": "text", "index": 11, "name": "start_tile_id", "comment": "Reference to the tile which begins the journey"}, "trigger_event_names": {"type": "text", "index": 12, "name": "trigger_event_names", "comment": "The event names which trigger a user's entry into the journey"}, "created_at": {"type": "timestamp without time zone", "index": 13, "name": "created_at", "comment": "Creation timestamp"}, "updated_at": {"type": "timestamp without time zone", "index": 14, "name": "updated_at", "comment": "Last update timestamp"}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 15, "name": "_fivetran_synced", "comment": "The time when a record was last updated by Fivetran."}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.stg_iterable__journey"}, "model.iterable.stg_iterable__journey_tmp": {"metadata": {"type": "VIEW", "schema": "public_iterable_dev", "name": "stg_iterable__journey_tmp", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"_dbt_source_relation": {"type": "text", "index": 1, "name": "_dbt_source_relation", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.stg_iterable__journey_tmp"}, "model.iterable.stg_iterable__list": {"metadata": {"type": "BASE TABLE", "schema": "public_iterable_dev", "name": "stg_iterable__list", "database": "postgres", "comment": "Table containing users and the lists the users are associated with.", "owner": "postgres"}, "columns": {"source_relation": {"type": "text", "index": 1, "name": "source_relation", "comment": "Identifies the record's source."}, "list_id": {"type": "integer", "index": 2, "name": "list_id", "comment": "Unique identifier of the list"}, "list_name": {"type": "text", "index": 3, "name": "list_name", "comment": "User defined name of the list"}, "list_type": {"type": "text", "index": 4, "name": "list_type", "comment": "The list type"}, "created_at": {"type": "text", "index": 5, "name": "created_at", "comment": "Creation timestamp"}, "list_description": {"type": "text", "index": 6, "name": "list_description", "comment": "Information about the list"}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 7, "name": "_fivetran_synced", "comment": "The time when a record was last updated by Fivetran."}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.stg_iterable__list"}, "model.iterable.stg_iterable__list_tmp": {"metadata": {"type": "VIEW", "schema": "public_iterable_dev", "name": "stg_iterable__list_tmp", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"id": {"type": "integer", "index": 1, "name": "id", "comment": null}, "name": {"type": "text", "index": 2, "name": "name", "comment": null}, "created_at": {"type": "text", "index": 3, "name": "created_at", "comment": null}, "list_type": {"type": "text", "index": 4, "name": "list_type", "comment": null}, "_fivetran_deleted": {"type": "boolean", "index": 5, "name": "_fivetran_deleted", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 6, "name": "_fivetran_synced", "comment": null}, "description": {"type": "text", "index": 7, "name": "description", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.stg_iterable__list_tmp"}, "model.iterable.stg_iterable__list_user": {"metadata": {"type": "BASE TABLE", "schema": "public_iterable_dev", "name": "stg_iterable__list_user", "database": "postgres", "comment": "Table containing the relationship between users and lists they belong to.", "owner": "postgres"}, "columns": {"source_relation": {"type": "text", "index": 1, "name": "source_relation", "comment": "Identifies the record's source."}, "_fivetran_user_id": {"type": "text", "index": 2, "name": "_fivetran_user_id", "comment": "Unique identifier of the list-user relationship record, serving as a foreign key to `stg_iterable__user_history._fivetran_id`."}, "list_user_index": {"type": "bigint", "index": 3, "name": "list_user_index", "comment": "Index of the record"}, "list_id": {"type": "bigint", "index": 4, "name": "list_id", "comment": "Reference to the list that the user belongs to"}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 5, "name": "_fivetran_synced", "comment": "The time when a record was last updated by Fivetran."}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.stg_iterable__list_user"}, "model.iterable.stg_iterable__list_user_tmp": {"metadata": {"type": "VIEW", "schema": "public_iterable_dev", "name": "stg_iterable__list_user_tmp", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"_fivetran_id": {"type": "text", "index": 1, "name": "_fivetran_id", "comment": null}, "index": {"type": "bigint", "index": 2, "name": "index", "comment": null}, "list_id": {"type": "bigint", "index": 3, "name": "list_id", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 4, "name": "_fivetran_synced", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.stg_iterable__list_user_tmp"}, "model.iterable.stg_iterable__message_type": {"metadata": {"type": "BASE TABLE", "schema": "public_iterable_dev", "name": "stg_iterable__message_type", "database": "postgres", "comment": "Table containing unique message types.", "owner": "postgres"}, "columns": {"source_relation": {"type": "text", "index": 1, "name": "source_relation", "comment": "Identifies the record's source."}, "message_type_id": {"type": "text", "index": 2, "name": "message_type_id", "comment": "Unique identifier of the message type"}, "message_type_name": {"type": "text", "index": 3, "name": "message_type_name", "comment": "User defined name of the message type"}, "channel_id": {"type": "text", "index": 4, "name": "channel_id", "comment": "Channel that this message type belongs to"}, "message_type_created_at": {"type": "timestamp without time zone", "index": 5, "name": "message_type_created_at", "comment": "Time when the message type was initially created"}, "frequency_cap": {"type": "integer", "index": 6, "name": "frequency_cap", "comment": "The maximum number of times a message of this type can be sent to a recipient within a specified time period to prevent over-messaging"}, "rate_limit_per_minute": {"type": "integer", "index": 7, "name": "rate_limit_per_minute", "comment": "The maximum number of messages of this type that can be sent to recipients in a minute, ensuring controlled message delivery"}, "subscription_policy": {"type": "text", "index": 8, "name": "subscription_policy", "comment": "Information about the policy or rules governing how users can subscribe to or unsubscribe from this specific message type, like OptOut"}, "message_type_updated_at": {"type": "timestamp without time zone", "index": 9, "name": "message_type_updated_at", "comment": "Time when the message type was last updated or modified"}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 10, "name": "_fivetran_synced", "comment": "The time when a record was last updated by Fivetran."}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.stg_iterable__message_type"}, "model.iterable.stg_iterable__message_type_tmp": {"metadata": {"type": "VIEW", "schema": "public_iterable_dev", "name": "stg_iterable__message_type_tmp", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"id": {"type": "bigint", "index": 1, "name": "id", "comment": null}, "name": {"type": "text", "index": 2, "name": "name", "comment": null}, "channel_id": {"type": "bigint", "index": 3, "name": "channel_id", "comment": null}, "_fivetran_deleted": {"type": "boolean", "index": 4, "name": "_fivetran_deleted", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 5, "name": "_fivetran_synced", "comment": null}, "created_at": {"type": "timestamp without time zone", "index": 6, "name": "created_at", "comment": null}, "frequency_cap": {"type": "integer", "index": 7, "name": "frequency_cap", "comment": null}, "rate_limit_per_minute": {"type": "integer", "index": 8, "name": "rate_limit_per_minute", "comment": null}, "subscription_policy": {"type": "text", "index": 9, "name": "subscription_policy", "comment": null}, "updated_at": {"type": "timestamp without time zone", "index": 10, "name": "updated_at", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.stg_iterable__message_type_tmp"}, "model.iterable.stg_iterable__template_history": {"metadata": {"type": "BASE TABLE", "schema": "public_iterable_dev", "name": "stg_iterable__template_history", "database": "postgres", "comment": "Table containing unique templates used across campaigns.", "owner": "postgres"}, "columns": {"source_relation": {"type": "text", "index": 1, "name": "source_relation", "comment": "Identifies the record's source."}, "template_id": {"type": "text", "index": 2, "name": "template_id", "comment": "Unique identifier of the template"}, "template_name": {"type": "text", "index": 3, "name": "template_name", "comment": "User defined name of the template"}, "template_type": {"type": "text", "index": 4, "name": "template_type", "comment": "The type of the template"}, "created_at": {"type": "text", "index": 5, "name": "created_at", "comment": "Creation timestamp"}, "client_template_id": {"type": "text", "index": 6, "name": "client_template_id", "comment": "Reference to the client template"}, "creator_user_id": {"type": "text", "index": 7, "name": "creator_user_id", "comment": "Reference to the user who created the template"}, "message_type_id": {"type": "text", "index": 8, "name": "message_type_id", "comment": "Reference to the message type associated with the template"}, "updated_at": {"type": "text", "index": 9, "name": "updated_at", "comment": "Last update timestamp"}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 10, "name": "_fivetran_synced", "comment": "The time when a record was last updated by Fivetran."}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.stg_iterable__template_history"}, "model.iterable.stg_iterable__template_history_tmp": {"metadata": {"type": "VIEW", "schema": "public_iterable_dev", "name": "stg_iterable__template_history_tmp", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"id": {"type": "integer", "index": 1, "name": "id", "comment": null}, "updated_at": {"type": "text", "index": 2, "name": "updated_at", "comment": null}, "message_type_id": {"type": "integer", "index": 3, "name": "message_type_id", "comment": null}, "client_template_id": {"type": "integer", "index": 4, "name": "client_template_id", "comment": null}, "created_at": {"type": "text", "index": 5, "name": "created_at", "comment": null}, "creator_user_id": {"type": "text", "index": 6, "name": "creator_user_id", "comment": null}, "name": {"type": "text", "index": 7, "name": "name", "comment": null}, "template_type": {"type": "text", "index": 8, "name": "template_type", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 9, "name": "_fivetran_synced", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.stg_iterable__template_history_tmp"}, "model.iterable.stg_iterable__user_history": {"metadata": {"type": "VIEW", "schema": "public_iterable_dev", "name": "stg_iterable__user_history", "database": "postgres", "comment": "Table containing individual user history information.", "owner": "postgres"}, "columns": {"source_relation": {"type": "text", "index": 1, "name": "source_relation", "comment": "Identifies the record's source."}, "_fivetran_user_id": {"type": "text", "index": 2, "name": "_fivetran_user_id", "comment": "A Fivetran-created unique identifier for users, derived from hashing user_id and/or email, depending on project type. This exists for users of the new schema starting Aug 2023. In the old schema, the unique identifier is email."}, "email": {"type": "text", "index": 3, "name": "email", "comment": "The user's email. User identifier, for email-based projects. Previously was the unique identifier for user records, for the old Iterable schema before the August 2023 updates."}, "updated_at": {"type": "timestamp without time zone", "index": 4, "name": "updated_at", "comment": "Last update timestamp"}, "user_id": {"type": "text", "index": 5, "name": "user_id", "comment": "User identifier, for userID-based projects."}, "first_name": {"type": "integer", "index": 6, "name": "first_name", "comment": "First name of the user"}, "last_name": {"type": "integer", "index": 7, "name": "last_name", "comment": "Last name of the user"}, "email_list_ids": {"type": "text", "index": 8, "name": "email_list_ids", "comment": "[DEPRECATED October 13, 2025. Use LIST_USER source instead.] Array of references to the lists associated with the user.\n"}, "phone_number": {"type": "integer", "index": 9, "name": "phone_number", "comment": "Phone number associated with the user"}, "signup_date": {"type": "text", "index": 10, "name": "signup_date", "comment": "Timestamp of when the user signed up"}, "signup_source": {"type": "text", "index": 11, "name": "signup_source", "comment": "Source where the user signed up"}, "iterable_user_id": {"type": "text", "index": 12, "name": "iterable_user_id", "comment": "Another user identifier, for userID-based projects"}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 13, "name": "_fivetran_synced", "comment": "The time when a record was last updated by Fivetran."}, "unique_user_key": {"type": "text", "index": 14, "name": "unique_user_key", "comment": "The unique identifier of the user. With the new schema (Aug 2023), it is the _fivetran_user_id. This is a hash of user_id and/or email, depending on project type. If using the old schema, it is email."}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.stg_iterable__user_history"}, "model.iterable.stg_iterable__user_history_tmp": {"metadata": {"type": "VIEW", "schema": "public_iterable_dev", "name": "stg_iterable__user_history_tmp", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"email": {"type": "text", "index": 1, "name": "email", "comment": null}, "updated_at": {"type": "timestamp without time zone", "index": 2, "name": "updated_at", "comment": null}, "first_name": {"type": "integer", "index": 3, "name": "first_name", "comment": null}, "last_name": {"type": "integer", "index": 4, "name": "last_name", "comment": null}, "phone_number": {"type": "integer", "index": 5, "name": "phone_number", "comment": null}, "user_id": {"type": "integer", "index": 6, "name": "user_id", "comment": null}, "signup_date": {"type": "text", "index": 7, "name": "signup_date", "comment": null}, "signup_source": {"type": "text", "index": 8, "name": "signup_source", "comment": null}, "phone_number_carrier": {"type": "integer", "index": 9, "name": "phone_number_carrier", "comment": null}, "phone_number_country_code_iso": {"type": "integer", "index": 10, "name": "phone_number_country_code_iso", "comment": null}, "phone_number_line_type": {"type": "integer", "index": 11, "name": "phone_number_line_type", "comment": null}, "phone_number_updated_at": {"type": "integer", "index": 12, "name": "phone_number_updated_at", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 13, "name": "_fivetran_synced", "comment": null}, "email_list_ids": {"type": "text", "index": 14, "name": "email_list_ids", "comment": null}, "iterable_user_id": {"type": "integer", "index": 15, "name": "iterable_user_id", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.stg_iterable__user_history_tmp"}, "model.iterable.stg_iterable__user_unsub_message_type": {"metadata": {"type": "BASE TABLE", "schema": "public_iterable_dev", "name": "stg_iterable__user_unsub_message_type", "database": "postgres", "comment": "Table containing the message types from which a user has unsubscribed. \"Unsubscribed\" is shortened to \"unsub\" for postgres compatibility.", "owner": "postgres"}, "columns": {"source_relation": {"type": "text", "index": 1, "name": "source_relation", "comment": "Identifies the record's source."}, "_fivetran_user_id": {"type": "text", "index": 2, "name": "_fivetran_user_id", "comment": "A Fivetran-created unique identifier for users, derived from hashing user_id and/or email, depending on project type. This exists for users of the new schema starting Aug 2023. In the old schema, the unique identifier is email."}, "unique_user_key": {"type": "text", "index": 3, "name": "unique_user_key", "comment": "The unique identifier of the user. With the new schema (Aug 2023), it is the _fivetran_user_id. This is a hash of user_id and/or email, depending on project type. If using the old schema, it is email."}, "message_type_id": {"type": "text", "index": 4, "name": "message_type_id", "comment": "Reference to the message type from which the user unsubscribed"}, "unsub_message_type_unique_key": {"type": "text", "index": 5, "name": "unsub_message_type_unique_key", "comment": "A surrogate key providing a unique key for each record. If using user_unsubscribed_message_type_history, it uses '_fivetran_id', 'email', 'message_type_id', 'updated_at', and 'source_relation'. If not using the history table, it uses '_fivetran_id', 'message_type_id', and 'source_relation'."}, "latest_batch_index": {"type": "integer", "index": 6, "name": "latest_batch_index", "comment": "Indexes each user record based on the most recent available."}, "updated_at": {"type": "timestamp without time zone", "index": 7, "name": "updated_at", "comment": "Last update timestamp"}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 8, "name": "_fivetran_synced", "comment": "The time when a record was last updated by Fivetran."}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.stg_iterable__user_unsub_message_type"}, "model.iterable.stg_iterable__user_unsub_message_type_tmp": {"metadata": {"type": "VIEW", "schema": "public_iterable_dev", "name": "stg_iterable__user_unsub_message_type_tmp", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"_fivetran_id": {"type": "text", "index": 1, "name": "_fivetran_id", "comment": null}, "message_type_id": {"type": "integer", "index": 2, "name": "message_type_id", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 3, "name": "_fivetran_synced", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.stg_iterable__user_unsub_message_type_tmp"}, "model.iterable.stg_iterable__user_unsubscribed_channel": {"metadata": {"type": "BASE TABLE", "schema": "public_iterable_dev", "name": "stg_iterable__user_unsubscribed_channel", "database": "postgres", "comment": "Table containing the history of channels from which a user has unsubscribed.", "owner": "postgres"}, "columns": {"source_relation": {"type": "text", "index": 1, "name": "source_relation", "comment": "Identifies the record's source."}, "_fivetran_user_id": {"type": "text", "index": 2, "name": "_fivetran_user_id", "comment": "A Fivetran-created unique identifier for users, derived from hashing user_id and/or email, depending on project type. This exists for users of the new schema starting Aug 2023. In the old schema, the unique identifier is email."}, "unique_user_key": {"type": "text", "index": 3, "name": "unique_user_key", "comment": "The unique identifier of the user. With the new schema (Aug 2023), it is the _fivetran_user_id. This is a hash of user_id and/or email, depending on project type. If using the old schema, it is email."}, "channel_id": {"type": "text", "index": 4, "name": "channel_id", "comment": "Reference to the channel from which the user unsubscribed"}, "unsub_channel_unique_key": {"type": "text", "index": 5, "name": "unsub_channel_unique_key", "comment": "A surrogate key providing a unique key for each record. If using user_unsubscribed_channel_history, it uses '_fivetran_id', 'channel_id', 'email', 'updated_at', and 'source_relation'. If not using the history table, it uses '_fivetran_id', 'channel_id', and 'source_relation'."}, "latest_batch_index": {"type": "integer", "index": 6, "name": "latest_batch_index", "comment": "Indexes each user record based on the most recent available."}, "updated_at": {"type": "timestamp without time zone", "index": 7, "name": "updated_at", "comment": "Last update timestamp"}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 8, "name": "_fivetran_synced", "comment": "The time when a record was last updated by Fivetran."}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.stg_iterable__user_unsubscribed_channel"}, "model.iterable.stg_iterable__user_unsubscribed_channel_tmp": {"metadata": {"type": "VIEW", "schema": "public_iterable_dev", "name": "stg_iterable__user_unsubscribed_channel_tmp", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"_fivetran_id": {"type": "text", "index": 1, "name": "_fivetran_id", "comment": null}, "channel_id": {"type": "integer", "index": 2, "name": "channel_id", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 3, "name": "_fivetran_synced", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.stg_iterable__user_unsubscribed_channel_tmp"}}, "sources": {"source.iterable.iterable.campaign_history": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "campaign_history_data", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"id": {"type": "integer", "index": 1, "name": "id", "comment": null}, "updated_at": {"type": "text", "index": 2, "name": "updated_at", "comment": null}, "template_id": {"type": "integer", "index": 3, "name": "template_id", "comment": null}, "recurring_campaign_id": {"type": "integer", "index": 4, "name": "recurring_campaign_id", "comment": null}, "campaign_state": {"type": "text", "index": 5, "name": "campaign_state", "comment": null}, "created_at": {"type": "text", "index": 6, "name": "created_at", "comment": null}, "created_by_user_id": {"type": "text", "index": 7, "name": "created_by_user_id", "comment": null}, "ended_at": {"type": "integer", "index": 8, "name": "ended_at", "comment": null}, "name": {"type": "text", "index": 9, "name": "name", "comment": null}, "send_size": {"type": "integer", "index": 10, "name": "send_size", "comment": null}, "start_at": {"type": "integer", "index": 11, "name": "start_at", "comment": null}, "type": {"type": "text", "index": 12, "name": "type", "comment": null}, "workflow_id": {"type": "integer", "index": 13, "name": "workflow_id", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 14, "name": "_fivetran_synced", "comment": null}, "updated_by_user_id": {"type": "integer", "index": 15, "name": "updated_by_user_id", "comment": null}, "message_medium": {"type": "text", "index": 16, "name": "message_medium", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.iterable.iterable.campaign_history"}, "source.iterable.iterable.campaign_label_history": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "campaign_label_history_data", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"campaign_id": {"type": "integer", "index": 1, "name": "campaign_id", "comment": null}, "label": {"type": "text", "index": 2, "name": "label", "comment": null}, "updated_at": {"type": "text", "index": 3, "name": "updated_at", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 4, "name": "_fivetran_synced", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.iterable.iterable.campaign_label_history"}, "source.iterable.iterable.campaign_list_history": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "campaign_list_history_data", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"list_id": {"type": "integer", "index": 1, "name": "list_id", "comment": null}, "campaign_id": {"type": "integer", "index": 2, "name": "campaign_id", "comment": null}, "updated_at": {"type": "text", "index": 3, "name": "updated_at", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 4, "name": "_fivetran_synced", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.iterable.iterable.campaign_list_history"}, "source.iterable.iterable.campaign_suppression_list_history": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "campaign_suppression_list_history_data", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"suppressed_list_id": {"type": "integer", "index": 1, "name": "suppressed_list_id", "comment": null}, "campaign_id": {"type": "integer", "index": 2, "name": "campaign_id", "comment": null}, "updated_at": {"type": "text", "index": 3, "name": "updated_at", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 4, "name": "_fivetran_synced", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.iterable.iterable.campaign_suppression_list_history"}, "source.iterable.iterable.channel": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "channel_data", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"id": {"type": "bigint", "index": 1, "name": "id", "comment": null}, "name": {"type": "text", "index": 2, "name": "name", "comment": null}, "channel_type": {"type": "text", "index": 3, "name": "channel_type", "comment": null}, "message_medium": {"type": "text", "index": 4, "name": "message_medium", "comment": null}, "_fivetran_deleted": {"type": "boolean", "index": 5, "name": "_fivetran_deleted", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 6, "name": "_fivetran_synced", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.iterable.iterable.channel"}, "source.iterable.iterable.event": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "event_data", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"_fivetran_id": {"type": "text", "index": 1, "name": "_fivetran_id", "comment": null}, "email": {"type": "text", "index": 2, "name": "email", "comment": null}, "campaign_id": {"type": "integer", "index": 3, "name": "campaign_id", "comment": null}, "message_id": {"type": "integer", "index": 4, "name": "message_id", "comment": null}, "content_id": {"type": "integer", "index": 5, "name": "content_id", "comment": null}, "created_at": {"type": "timestamp without time zone", "index": 6, "name": "created_at", "comment": null}, "event_name": {"type": "text", "index": 7, "name": "event_name", "comment": null}, "ip": {"type": "integer", "index": 8, "name": "ip", "comment": null}, "message_bus_id": {"type": "integer", "index": 9, "name": "message_bus_id", "comment": null}, "message_type_id": {"type": "integer", "index": 10, "name": "message_type_id", "comment": null}, "recipient_state": {"type": "integer", "index": 11, "name": "recipient_state", "comment": null}, "status": {"type": "integer", "index": 12, "name": "status", "comment": null}, "unsub_source": {"type": "integer", "index": 13, "name": "unsub_source", "comment": null}, "user_agent": {"type": "integer", "index": 14, "name": "user_agent", "comment": null}, "user_agent_device": {"type": "integer", "index": 15, "name": "user_agent_device", "comment": null}, "transactional_data": {"type": "character varying(100)", "index": 16, "name": "transactional_data", "comment": null}, "additional_properties": {"type": "text", "index": 17, "name": "additional_properties", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 18, "name": "_fivetran_synced", "comment": null}, "_fivetran_user_id": {"type": "integer", "index": 19, "name": "_fivetran_user_id", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.iterable.iterable.event"}, "source.iterable.iterable.event_extension": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "event_extension_data", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"_fivetran_id": {"type": "text", "index": 1, "name": "_fivetran_id", "comment": null}, "app_already_running": {"type": "integer", "index": 2, "name": "app_already_running", "comment": null}, "badge": {"type": "integer", "index": 3, "name": "badge", "comment": null}, "canonical_url_id": {"type": "integer", "index": 4, "name": "canonical_url_id", "comment": null}, "content_available": {"type": "integer", "index": 5, "name": "content_available", "comment": null}, "content_id": {"type": "integer", "index": 6, "name": "content_id", "comment": null}, "device": {"type": "integer", "index": 7, "name": "device", "comment": null}, "email_id": {"type": "text", "index": 8, "name": "email_id", "comment": null}, "email_subject": {"type": "text", "index": 9, "name": "email_subject", "comment": null}, "experiment_id": {"type": "integer", "index": 10, "name": "experiment_id", "comment": null}, "from_phone_number_id": {"type": "integer", "index": 11, "name": "from_phone_number_id", "comment": null}, "from_smssender_id": {"type": "integer", "index": 12, "name": "from_smssender_id", "comment": null}, "image_url": {"type": "integer", "index": 13, "name": "image_url", "comment": null}, "is_ghost_push": {"type": "integer", "index": 14, "name": "is_ghost_push", "comment": null}, "link_id": {"type": "integer", "index": 15, "name": "link_id", "comment": null}, "link_url": {"type": "integer", "index": 16, "name": "link_url", "comment": null}, "platform_endpoint": {"type": "integer", "index": 17, "name": "platform_endpoint", "comment": null}, "push_message": {"type": "integer", "index": 18, "name": "push_message", "comment": null}, "region": {"type": "text", "index": 19, "name": "region", "comment": null}, "sms_message": {"type": "integer", "index": 20, "name": "sms_message", "comment": null}, "sound": {"type": "integer", "index": 21, "name": "sound", "comment": null}, "to_phone_number": {"type": "integer", "index": 22, "name": "to_phone_number", "comment": null}, "url": {"type": "integer", "index": 23, "name": "url", "comment": null}, "workflow_id": {"type": "integer", "index": 24, "name": "workflow_id", "comment": null}, "workflow_name": {"type": "text", "index": 25, "name": "workflow_name", "comment": null}, "locale": {"type": "integer", "index": 26, "name": "locale", "comment": null}, "deeplink_android": {"type": "integer", "index": 27, "name": "deeplink_android", "comment": null}, "deeplink_ios": {"type": "integer", "index": 28, "name": "deeplink_ios", "comment": null}, "payload": {"type": "character varying(100)", "index": 29, "name": "payload", "comment": null}, "sms_provider_response_status": {"type": "integer", "index": 30, "name": "sms_provider_response_status", "comment": null}, "sms_provider_response_message": {"type": "integer", "index": 31, "name": "sms_provider_response_message", "comment": null}, "sms_provider_response_code": {"type": "integer", "index": 32, "name": "sms_provider_response_code", "comment": null}, "sms_provider_response_more_info": {"type": "integer", "index": 33, "name": "sms_provider_response_more_info", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 34, "name": "_fivetran_synced", "comment": null}, "catalog_collection_count": {"type": "integer", "index": 35, "name": "catalog_collection_count", "comment": null}, "catalog_lookup_count": {"type": "integer", "index": 36, "name": "catalog_lookup_count", "comment": null}, "city": {"type": "text", "index": 37, "name": "city", "comment": null}, "clicked_url": {"type": "text", "index": 38, "name": "clicked_url", "comment": null}, "country": {"type": "text", "index": 39, "name": "country", "comment": null}, "error_code": {"type": "integer", "index": 40, "name": "error_code", "comment": null}, "expires_at": {"type": "text", "index": 41, "name": "expires_at", "comment": null}, "from_phone_number": {"type": "integer", "index": 42, "name": "from_phone_number", "comment": null}, "in_app_body": {"type": "text", "index": 43, "name": "in_app_body", "comment": null}, "is_sms_estimation": {"type": "boolean", "index": 44, "name": "is_sms_estimation", "comment": null}, "labels": {"type": "text", "index": 45, "name": "labels", "comment": null}, "message_context": {"type": "text", "index": 46, "name": "message_context", "comment": null}, "message_status": {"type": "text", "index": 47, "name": "message_status", "comment": null}, "mms_send_count": {"type": "integer", "index": 48, "name": "mms_send_count", "comment": null}, "product_recommendation_count": {"type": "integer", "index": 49, "name": "product_recommendation_count", "comment": null}, "proxy_source": {"type": "text", "index": 50, "name": "proxy_source", "comment": null}, "reason": {"type": "text", "index": 51, "name": "reason", "comment": null}, "sms_send_count": {"type": "integer", "index": 52, "name": "sms_send_count", "comment": null}, "web_push_body": {"type": "text", "index": 53, "name": "web_push_body", "comment": null}, "web_push_click_action": {"type": "text", "index": 54, "name": "web_push_click_action", "comment": null}, "web_push_icon": {"type": "text", "index": 55, "name": "web_push_icon", "comment": null}, "web_push_message": {"type": "text", "index": 56, "name": "web_push_message", "comment": null}, "_fivetran_user_id": {"type": "integer", "index": 57, "name": "_fivetran_user_id", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.iterable.iterable.event_extension"}, "source.iterable.iterable.list": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "list_data", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"id": {"type": "integer", "index": 1, "name": "id", "comment": null}, "name": {"type": "text", "index": 2, "name": "name", "comment": null}, "created_at": {"type": "text", "index": 3, "name": "created_at", "comment": null}, "list_type": {"type": "text", "index": 4, "name": "list_type", "comment": null}, "_fivetran_deleted": {"type": "boolean", "index": 5, "name": "_fivetran_deleted", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 6, "name": "_fivetran_synced", "comment": null}, "description": {"type": "text", "index": 7, "name": "description", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.iterable.iterable.list"}, "source.iterable.iterable.list_user": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "list_user_data", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"_fivetran_id": {"type": "text", "index": 1, "name": "_fivetran_id", "comment": null}, "index": {"type": "bigint", "index": 2, "name": "index", "comment": null}, "list_id": {"type": "bigint", "index": 3, "name": "list_id", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 4, "name": "_fivetran_synced", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.iterable.iterable.list_user"}, "source.iterable.iterable.message_type": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "message_type_data", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"id": {"type": "bigint", "index": 1, "name": "id", "comment": null}, "name": {"type": "text", "index": 2, "name": "name", "comment": null}, "channel_id": {"type": "bigint", "index": 3, "name": "channel_id", "comment": null}, "_fivetran_deleted": {"type": "boolean", "index": 4, "name": "_fivetran_deleted", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 5, "name": "_fivetran_synced", "comment": null}, "created_at": {"type": "timestamp without time zone", "index": 6, "name": "created_at", "comment": null}, "frequency_cap": {"type": "integer", "index": 7, "name": "frequency_cap", "comment": null}, "rate_limit_per_minute": {"type": "integer", "index": 8, "name": "rate_limit_per_minute", "comment": null}, "subscription_policy": {"type": "text", "index": 9, "name": "subscription_policy", "comment": null}, "updated_at": {"type": "timestamp without time zone", "index": 10, "name": "updated_at", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.iterable.iterable.message_type"}, "source.iterable.iterable.template_history": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "template_history_data", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"id": {"type": "integer", "index": 1, "name": "id", "comment": null}, "updated_at": {"type": "text", "index": 2, "name": "updated_at", "comment": null}, "message_type_id": {"type": "integer", "index": 3, "name": "message_type_id", "comment": null}, "client_template_id": {"type": "integer", "index": 4, "name": "client_template_id", "comment": null}, "created_at": {"type": "text", "index": 5, "name": "created_at", "comment": null}, "creator_user_id": {"type": "text", "index": 6, "name": "creator_user_id", "comment": null}, "name": {"type": "text", "index": 7, "name": "name", "comment": null}, "template_type": {"type": "text", "index": 8, "name": "template_type", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 9, "name": "_fivetran_synced", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.iterable.iterable.template_history"}, "source.iterable.iterable.user_history": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "user_history_data", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"email": {"type": "text", "index": 1, "name": "email", "comment": null}, "updated_at": {"type": "timestamp without time zone", "index": 2, "name": "updated_at", "comment": null}, "first_name": {"type": "integer", "index": 3, "name": "first_name", "comment": null}, "last_name": {"type": "integer", "index": 4, "name": "last_name", "comment": null}, "phone_number": {"type": "integer", "index": 5, "name": "phone_number", "comment": null}, "user_id": {"type": "integer", "index": 6, "name": "user_id", "comment": null}, "signup_date": {"type": "text", "index": 7, "name": "signup_date", "comment": null}, "signup_source": {"type": "text", "index": 8, "name": "signup_source", "comment": null}, "phone_number_carrier": {"type": "integer", "index": 9, "name": "phone_number_carrier", "comment": null}, "phone_number_country_code_iso": {"type": "integer", "index": 10, "name": "phone_number_country_code_iso", "comment": null}, "phone_number_line_type": {"type": "integer", "index": 11, "name": "phone_number_line_type", "comment": null}, "phone_number_updated_at": {"type": "integer", "index": 12, "name": "phone_number_updated_at", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 13, "name": "_fivetran_synced", "comment": null}, "email_list_ids": {"type": "text", "index": 14, "name": "email_list_ids", "comment": null}, "iterable_user_id": {"type": "integer", "index": 15, "name": "iterable_user_id", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.iterable.iterable.user_history"}, "source.iterable.iterable.user_unsubscribed_channel": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "user_unsubscribed_channel_data", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"_fivetran_id": {"type": "text", "index": 1, "name": "_fivetran_id", "comment": null}, "channel_id": {"type": "integer", "index": 2, "name": "channel_id", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 3, "name": "_fivetran_synced", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.iterable.iterable.user_unsubscribed_channel"}, "source.iterable.iterable.user_unsubscribed_channel_history": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "user_unsubscribed_channel_history_data", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"email": {"type": "text", "index": 1, "name": "email", "comment": null}, "channel_id": {"type": "bigint", "index": 2, "name": "channel_id", "comment": null}, "updated_at": {"type": "text", "index": 3, "name": "updated_at", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 4, "name": "_fivetran_synced", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.iterable.iterable.user_unsubscribed_channel_history"}, "source.iterable.iterable.user_unsubscribed_message_type": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "user_unsubscribed_message_type_data", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"_fivetran_id": {"type": "text", "index": 1, "name": "_fivetran_id", "comment": null}, "message_type_id": {"type": "integer", "index": 2, "name": "message_type_id", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 3, "name": "_fivetran_synced", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.iterable.iterable.user_unsubscribed_message_type"}, "source.iterable.iterable.user_unsubscribed_message_type_history": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "user_unsubscribed_message_type_history_data", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"message_type_id": {"type": "integer", "index": 1, "name": "message_type_id", "comment": null}, "email": {"type": "text", "index": 2, "name": "email", "comment": null}, "updated_at": {"type": "text", "index": 3, "name": "updated_at", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 4, "name": "_fivetran_synced", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.iterable.iterable.user_unsubscribed_message_type_history"}}, "errors": null} \ No newline at end of file diff --git a/docs/manifest.json b/docs/manifest.json index bb70dd2..b8136d9 100644 --- a/docs/manifest.json +++ b/docs/manifest.json @@ -1 +1 @@ -{"metadata": {"dbt_schema_version": "https://schemas.getdbt.com/dbt/manifest/v12.json", "dbt_version": "1.12.2", "generated_at": "2026-08-13T02:06:36.940008Z", "invocation_id": "ed463d55-d5d8-4684-9748-cd75801d3763", "invocation_started_at": "2026-08-13T02:06:26.749889+00:00", "env": {}, "project_name": "iterable_integration_tests", "project_id": "726648524a3768595307d45548dac26e", "user_id": null, "send_anonymous_usage_stats": false, "adapter_type": "postgres", "quoting": {"database": true, "schema": true, "identifier": true, "column": null}, "run_started_at": "2026-08-13T02:06:26.750217+00:00"}, "nodes": {"seed.iterable_integration_tests.user_unsubscribed_channel_history_data": {"database": "postgres", "schema": "public", "name": "user_unsubscribed_channel_history_data", "resource_type": "seed", "package_name": "iterable_integration_tests", "path": "user_unsubscribed_channel_history_data.csv", "original_file_path": "seeds/user_unsubscribed_channel_history_data.csv", "unique_id": "seed.iterable_integration_tests.user_unsubscribed_channel_history_data", "fqn": ["iterable_integration_tests", "user_unsubscribed_channel_history_data"], "alias": "user_unsubscribed_channel_history_data", "checksum": {"name": "sha256", "checksum": "a1b532e561033f6ff137e5a1bde082263903493b763e9358a2a2ba151360e00e"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "seed", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {"channel_id": "bigint", "_fivetran_synced": "timestamp"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": false, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "delimiter": ",", "quote_columns": false}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": false, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"docs": {"show": false}, "quote_columns": "{{ target.type == 'redshift' or var('fivetran_using_source_casing', false) }}", "column_types": {"channel_id": "{%- if target.type == 'bigquery' -%} INT64 {%- else -%} bigint {%- endif -%}", "_fivetran_synced": "timestamp"}}, "created_at": 1786586789.1047099, "relation_name": "\"postgres\".\"public\".\"user_unsubscribed_channel_history_data\"", "raw_code": "", "doc_blocks": [], "root_path": "/home/runner/work/dbt_iterable/dbt_iterable/integration_tests", "depends_on": {"macros": []}}, "seed.iterable_integration_tests.user_history_bq_json_data": {"database": "postgres", "schema": "public", "name": "user_history_bq_json_data", "resource_type": "seed", "package_name": "iterable_integration_tests", "path": "user_history_bq_json_data.csv", "original_file_path": "seeds/user_history_bq_json_data.csv", "unique_id": "seed.iterable_integration_tests.user_history_bq_json_data", "fqn": ["iterable_integration_tests", "user_history_bq_json_data"], "alias": "user_history_bq_json_data", "checksum": {"name": "sha256", "checksum": "d2689731ace45d1a5c13930bcc8b80f7b3a02993f8ee4c58bfcf754b734a5caa"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "seed", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": false, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "delimiter": ",", "quote_columns": false}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": false, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"docs": {"show": false}, "quote_columns": "{{ target.type == 'redshift' or var('fivetran_using_source_casing', false) }}"}, "created_at": 1786586789.11235, "relation_name": "\"postgres\".\"public\".\"user_history_bq_json_data\"", "raw_code": "", "doc_blocks": [], "root_path": "/home/runner/work/dbt_iterable/dbt_iterable/integration_tests", "depends_on": {"macros": []}}, "seed.iterable_integration_tests.event_extension_data": {"database": "postgres", "schema": "public", "name": "event_extension_data", "resource_type": "seed", "package_name": "iterable_integration_tests", "path": "event_extension_data.csv", "original_file_path": "seeds/event_extension_data.csv", "unique_id": "seed.iterable_integration_tests.event_extension_data", "fqn": ["iterable_integration_tests", "event_extension_data"], "alias": "event_extension_data", "checksum": {"name": "sha256", "checksum": "e0ed2a4a9661ad12bdd9d9a2221df3fd32f2da5fad39e9d0f6f01cbc819ffa9a"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "seed", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {"payload": "varchar(100)", "_fivetran_synced": "timestamp"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": false, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "delimiter": ",", "quote_columns": false}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": false, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"docs": {"show": false}, "quote_columns": "{{ target.type == 'redshift' or var('fivetran_using_source_casing', false) }}", "column_types": {"payload": "{{ 'varchar(100)' if target.type in ('redshift', 'postgres') else 'string'}}", "_fivetran_synced": "timestamp"}}, "created_at": 1786586789.1156826, "relation_name": "\"postgres\".\"public\".\"event_extension_data\"", "raw_code": "", "doc_blocks": [], "root_path": "/home/runner/work/dbt_iterable/dbt_iterable/integration_tests", "depends_on": {"macros": []}}, "seed.iterable_integration_tests.event_data": {"database": "postgres", "schema": "public", "name": "event_data", "resource_type": "seed", "package_name": "iterable_integration_tests", "path": "event_data.csv", "original_file_path": "seeds/event_data.csv", "unique_id": "seed.iterable_integration_tests.event_data", "fqn": ["iterable_integration_tests", "event_data"], "alias": "event_data", "checksum": {"name": "sha256", "checksum": "c886615b369d98135814bac7c4070be9d58b4aa6eb9a90a5caa5ddc4454ab0ed"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "seed", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {"transactional_data": "varchar(100)", "created_at": "timestamp", "_fivetran_synced": "timestamp"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": false, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "delimiter": ",", "quote_columns": false}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": false, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"docs": {"show": false}, "quote_columns": "{{ target.type == 'redshift' or var('fivetran_using_source_casing', false) }}", "column_types": {"transactional_data": "{{ 'varchar(100)' if target.type in ('redshift', 'postgres') else 'string'}}", "created_at": "timestamp", "_fivetran_synced": "timestamp"}}, "created_at": 1786586789.119237, "relation_name": "\"postgres\".\"public\".\"event_data\"", "raw_code": "", "doc_blocks": [], "root_path": "/home/runner/work/dbt_iterable/dbt_iterable/integration_tests", "depends_on": {"macros": []}}, "seed.iterable_integration_tests.list_user_data": {"database": "postgres", "schema": "public", "name": "list_user_data", "resource_type": "seed", "package_name": "iterable_integration_tests", "path": "list_user_data.csv", "original_file_path": "seeds/list_user_data.csv", "unique_id": "seed.iterable_integration_tests.list_user_data", "fqn": ["iterable_integration_tests", "list_user_data"], "alias": "list_user_data", "checksum": {"name": "sha256", "checksum": "2dbd80b8fb4338602a543026ede3f5a0797c0a4cf13c4724a877bb60ac6a4793"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "seed", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {"list_id": "bigint", "index": "bigint", "_fivetran_synced": "timestamp"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": false, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "delimiter": ",", "quote_columns": false}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": false, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"docs": {"show": false}, "quote_columns": "{{ target.type == 'redshift' or var('fivetran_using_source_casing', false) }}", "column_types": {"list_id": "{%- if target.type == 'bigquery' -%} INT64 {%- else -%} bigint {%- endif -%}", "index": "{%- if target.type == 'bigquery' -%} INT64 {%- else -%} bigint {%- endif -%}", "_fivetran_synced": "timestamp"}}, "created_at": 1786586789.1225457, "relation_name": "\"postgres\".\"public\".\"list_user_data\"", "raw_code": "", "doc_blocks": [], "root_path": "/home/runner/work/dbt_iterable/dbt_iterable/integration_tests", "depends_on": {"macros": []}}, "seed.iterable_integration_tests.campaign_suppression_list_history_data": {"database": "postgres", "schema": "public", "name": "campaign_suppression_list_history_data", "resource_type": "seed", "package_name": "iterable_integration_tests", "path": "campaign_suppression_list_history_data.csv", "original_file_path": "seeds/campaign_suppression_list_history_data.csv", "unique_id": "seed.iterable_integration_tests.campaign_suppression_list_history_data", "fqn": ["iterable_integration_tests", "campaign_suppression_list_history_data"], "alias": "campaign_suppression_list_history_data", "checksum": {"name": "sha256", "checksum": "c9eaab0efe0e47ef695b57f71b41f23cf527c87610d7770be604e461fe7c9846"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "seed", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {"_fivetran_synced": "timestamp"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": false, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "delimiter": ",", "quote_columns": false}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": false, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"docs": {"show": false}, "quote_columns": "{{ target.type == 'redshift' or var('fivetran_using_source_casing', false) }}", "column_types": {"_fivetran_synced": "timestamp"}}, "created_at": 1786586789.1257885, "relation_name": "\"postgres\".\"public\".\"campaign_suppression_list_history_data\"", "raw_code": "", "doc_blocks": [], "root_path": "/home/runner/work/dbt_iterable/dbt_iterable/integration_tests", "depends_on": {"macros": []}}, "seed.iterable_integration_tests.template_history_data": {"database": "postgres", "schema": "public", "name": "template_history_data", "resource_type": "seed", "package_name": "iterable_integration_tests", "path": "template_history_data.csv", "original_file_path": "seeds/template_history_data.csv", "unique_id": "seed.iterable_integration_tests.template_history_data", "fqn": ["iterable_integration_tests", "template_history_data"], "alias": "template_history_data", "checksum": {"name": "sha256", "checksum": "0f0c442398531afc5fb4c18f12f0d0f694eb3453cb09e0c6c48ba340b110f4a6"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "seed", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {"_fivetran_synced": "timestamp"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": false, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "delimiter": ",", "quote_columns": false}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": false, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"docs": {"show": false}, "quote_columns": "{{ target.type == 'redshift' or var('fivetran_using_source_casing', false) }}", "column_types": {"_fivetran_synced": "timestamp"}}, "created_at": 1786586789.129124, "relation_name": "\"postgres\".\"public\".\"template_history_data\"", "raw_code": "", "doc_blocks": [], "root_path": "/home/runner/work/dbt_iterable/dbt_iterable/integration_tests", "depends_on": {"macros": []}}, "seed.iterable_integration_tests.user_unsubscribed_message_type_data": {"database": "postgres", "schema": "public", "name": "user_unsubscribed_message_type_data", "resource_type": "seed", "package_name": "iterable_integration_tests", "path": "user_unsubscribed_message_type_data.csv", "original_file_path": "seeds/user_unsubscribed_message_type_data.csv", "unique_id": "seed.iterable_integration_tests.user_unsubscribed_message_type_data", "fqn": ["iterable_integration_tests", "user_unsubscribed_message_type_data"], "alias": "user_unsubscribed_message_type_data", "checksum": {"name": "sha256", "checksum": "473f01110084e53b2115bd09606172cb87559359ccd66775f60209851bfdac12"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "seed", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {"_fivetran_synced": "timestamp"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": false, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "delimiter": ",", "quote_columns": false}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": false, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"docs": {"show": false}, "quote_columns": "{{ target.type == 'redshift' or var('fivetran_using_source_casing', false) }}", "column_types": {"_fivetran_synced": "timestamp"}}, "created_at": 1786586789.1322868, "relation_name": "\"postgres\".\"public\".\"user_unsubscribed_message_type_data\"", "raw_code": "", "doc_blocks": [], "root_path": "/home/runner/work/dbt_iterable/dbt_iterable/integration_tests", "depends_on": {"macros": []}}, "seed.iterable_integration_tests.user_history_data": {"database": "postgres", "schema": "public", "name": "user_history_data", "resource_type": "seed", "package_name": "iterable_integration_tests", "path": "user_history_data.csv", "original_file_path": "seeds/user_history_data.csv", "unique_id": "seed.iterable_integration_tests.user_history_data", "fqn": ["iterable_integration_tests", "user_history_data"], "alias": "user_history_data", "checksum": {"name": "sha256", "checksum": "708bd35a21174cf05f0b4370079a339061c0b9292690ac4facd43b1d2bdff186"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "seed", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {"updated_at": "timestamp", "_fivetran_synced": "timestamp"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": false, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "delimiter": ",", "quote_columns": false}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": false, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"docs": {"show": false}, "quote_columns": "{{ target.type == 'redshift' or var('fivetran_using_source_casing', false) }}", "column_types": {"updated_at": "timestamp", "_fivetran_synced": "timestamp"}}, "created_at": 1786586789.1356027, "relation_name": "\"postgres\".\"public\".\"user_history_data\"", "raw_code": "", "doc_blocks": [], "root_path": "/home/runner/work/dbt_iterable/dbt_iterable/integration_tests", "depends_on": {"macros": []}}, "seed.iterable_integration_tests.campaign_metrics_data": {"database": "postgres", "schema": "public", "name": "campaign_metrics_data", "resource_type": "seed", "package_name": "iterable_integration_tests", "path": "campaign_metrics_data.csv", "original_file_path": "seeds/campaign_metrics_data.csv", "unique_id": "seed.iterable_integration_tests.campaign_metrics_data", "fqn": ["iterable_integration_tests", "campaign_metrics_data"], "alias": "campaign_metrics_data", "checksum": {"name": "sha256", "checksum": "45e8e7be3941e10f43112fac7bd78f0b6a63c070090062f65b2ffabe481b8c4e"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "seed", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": false, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "delimiter": ",", "quote_columns": false}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": false, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"docs": {"show": false}, "quote_columns": "{{ target.type == 'redshift' or var('fivetran_using_source_casing', false) }}"}, "created_at": 1786586789.138738, "relation_name": "\"postgres\".\"public\".\"campaign_metrics_data\"", "raw_code": "", "doc_blocks": [], "root_path": "/home/runner/work/dbt_iterable/dbt_iterable/integration_tests", "depends_on": {"macros": []}}, "seed.iterable_integration_tests.channel_data": {"database": "postgres", "schema": "public", "name": "channel_data", "resource_type": "seed", "package_name": "iterable_integration_tests", "path": "channel_data.csv", "original_file_path": "seeds/channel_data.csv", "unique_id": "seed.iterable_integration_tests.channel_data", "fqn": ["iterable_integration_tests", "channel_data"], "alias": "channel_data", "checksum": {"name": "sha256", "checksum": "a77e21fb127c0ff7fc652eb5ffc6b3559fde3d63c2c5291a68f10fefcc2fac37"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "seed", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {"id": "bigint", "_fivetran_synced": "timestamp"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": false, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "delimiter": ",", "quote_columns": false}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": false, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"docs": {"show": false}, "quote_columns": "{{ target.type == 'redshift' or var('fivetran_using_source_casing', false) }}", "column_types": {"id": "{%- if target.type == 'bigquery' -%} INT64 {%- else -%} bigint {%- endif -%}", "_fivetran_synced": "timestamp"}}, "created_at": 1786586789.1418455, "relation_name": "\"postgres\".\"public\".\"channel_data\"", "raw_code": "", "doc_blocks": [], "root_path": "/home/runner/work/dbt_iterable/dbt_iterable/integration_tests", "depends_on": {"macros": []}}, "seed.iterable_integration_tests.campaign_history_data": {"database": "postgres", "schema": "public", "name": "campaign_history_data", "resource_type": "seed", "package_name": "iterable_integration_tests", "path": "campaign_history_data.csv", "original_file_path": "seeds/campaign_history_data.csv", "unique_id": "seed.iterable_integration_tests.campaign_history_data", "fqn": ["iterable_integration_tests", "campaign_history_data"], "alias": "campaign_history_data", "checksum": {"name": "sha256", "checksum": "06adf392dab227dbabbda6782b710213ceea5a30d87990d0cbabe92ba0a955c4"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "seed", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {"_fivetran_synced": "timestamp"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": false, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "delimiter": ",", "quote_columns": false}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": false, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"docs": {"show": false}, "quote_columns": "{{ target.type == 'redshift' or var('fivetran_using_source_casing', false) }}", "column_types": {"_fivetran_synced": "timestamp"}}, "created_at": 1786586789.1450007, "relation_name": "\"postgres\".\"public\".\"campaign_history_data\"", "raw_code": "", "doc_blocks": [], "root_path": "/home/runner/work/dbt_iterable/dbt_iterable/integration_tests", "depends_on": {"macros": []}}, "seed.iterable_integration_tests.campaign_list_history_data": {"database": "postgres", "schema": "public", "name": "campaign_list_history_data", "resource_type": "seed", "package_name": "iterable_integration_tests", "path": "campaign_list_history_data.csv", "original_file_path": "seeds/campaign_list_history_data.csv", "unique_id": "seed.iterable_integration_tests.campaign_list_history_data", "fqn": ["iterable_integration_tests", "campaign_list_history_data"], "alias": "campaign_list_history_data", "checksum": {"name": "sha256", "checksum": "206581e614bf60f37345cbf1bd5e0cacac8a2f329a7dfc521b809c3e6d72e728"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "seed", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {"_fivetran_synced": "timestamp"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": false, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "delimiter": ",", "quote_columns": false}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": false, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"docs": {"show": false}, "quote_columns": "{{ target.type == 'redshift' or var('fivetran_using_source_casing', false) }}", "column_types": {"_fivetran_synced": "timestamp"}}, "created_at": 1786586789.148278, "relation_name": "\"postgres\".\"public\".\"campaign_list_history_data\"", "raw_code": "", "doc_blocks": [], "root_path": "/home/runner/work/dbt_iterable/dbt_iterable/integration_tests", "depends_on": {"macros": []}}, "seed.iterable_integration_tests.user_unsubscribed_channel_data": {"database": "postgres", "schema": "public", "name": "user_unsubscribed_channel_data", "resource_type": "seed", "package_name": "iterable_integration_tests", "path": "user_unsubscribed_channel_data.csv", "original_file_path": "seeds/user_unsubscribed_channel_data.csv", "unique_id": "seed.iterable_integration_tests.user_unsubscribed_channel_data", "fqn": ["iterable_integration_tests", "user_unsubscribed_channel_data"], "alias": "user_unsubscribed_channel_data", "checksum": {"name": "sha256", "checksum": "4c6abacf719352d79d0da89751296fc2665d65546ee2c1ad45d142918c750f28"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "seed", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {"_fivetran_synced": "timestamp"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": false, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "delimiter": ",", "quote_columns": false}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": false, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"docs": {"show": false}, "quote_columns": "{{ target.type == 'redshift' or var('fivetran_using_source_casing', false) }}", "column_types": {"_fivetran_synced": "timestamp"}}, "created_at": 1786586789.151454, "relation_name": "\"postgres\".\"public\".\"user_unsubscribed_channel_data\"", "raw_code": "", "doc_blocks": [], "root_path": "/home/runner/work/dbt_iterable/dbt_iterable/integration_tests", "depends_on": {"macros": []}}, "seed.iterable_integration_tests.user_unsubscribed_message_type_history_data": {"database": "postgres", "schema": "public", "name": "user_unsubscribed_message_type_history_data", "resource_type": "seed", "package_name": "iterable_integration_tests", "path": "user_unsubscribed_message_type_history_data.csv", "original_file_path": "seeds/user_unsubscribed_message_type_history_data.csv", "unique_id": "seed.iterable_integration_tests.user_unsubscribed_message_type_history_data", "fqn": ["iterable_integration_tests", "user_unsubscribed_message_type_history_data"], "alias": "user_unsubscribed_message_type_history_data", "checksum": {"name": "sha256", "checksum": "1e6883673b9a6f44966d10891cece60a739773fadf44302ccf2aad5290222687"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "seed", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {"_fivetran_synced": "timestamp"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": false, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "delimiter": ",", "quote_columns": false}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": false, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"docs": {"show": false}, "quote_columns": "{{ target.type == 'redshift' or var('fivetran_using_source_casing', false) }}", "column_types": {"_fivetran_synced": "timestamp"}}, "created_at": 1786586789.154609, "relation_name": "\"postgres\".\"public\".\"user_unsubscribed_message_type_history_data\"", "raw_code": "", "doc_blocks": [], "root_path": "/home/runner/work/dbt_iterable/dbt_iterable/integration_tests", "depends_on": {"macros": []}}, "seed.iterable_integration_tests.message_type_data": {"database": "postgres", "schema": "public", "name": "message_type_data", "resource_type": "seed", "package_name": "iterable_integration_tests", "path": "message_type_data.csv", "original_file_path": "seeds/message_type_data.csv", "unique_id": "seed.iterable_integration_tests.message_type_data", "fqn": ["iterable_integration_tests", "message_type_data"], "alias": "message_type_data", "checksum": {"name": "sha256", "checksum": "84228c8c4a13092ca90bdf9579856968f5265c49f456d01b8510834ae3520bce"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "seed", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {"id": "bigint", "channel_id": "bigint", "_fivetran_synced": "timestamp"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": false, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "delimiter": ",", "quote_columns": false}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": false, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"docs": {"show": false}, "quote_columns": "{{ target.type == 'redshift' or var('fivetran_using_source_casing', false) }}", "column_types": {"id": "{%- if target.type == 'bigquery' -%} INT64 {%- else -%} bigint {%- endif -%}", "channel_id": "{%- if target.type == 'bigquery' -%} INT64 {%- else -%} bigint {%- endif -%}", "_fivetran_synced": "timestamp"}}, "created_at": 1786586789.1577876, "relation_name": "\"postgres\".\"public\".\"message_type_data\"", "raw_code": "", "doc_blocks": [], "root_path": "/home/runner/work/dbt_iterable/dbt_iterable/integration_tests", "depends_on": {"macros": []}}, "seed.iterable_integration_tests.campaign_label_history_data": {"database": "postgres", "schema": "public", "name": "campaign_label_history_data", "resource_type": "seed", "package_name": "iterable_integration_tests", "path": "campaign_label_history_data.csv", "original_file_path": "seeds/campaign_label_history_data.csv", "unique_id": "seed.iterable_integration_tests.campaign_label_history_data", "fqn": ["iterable_integration_tests", "campaign_label_history_data"], "alias": "campaign_label_history_data", "checksum": {"name": "sha256", "checksum": "30ed21c883f801eb859d0280b90d45cb3dd020cdb708f4ef4aeca772372bf077"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "seed", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {"_fivetran_synced": "timestamp"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": false, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "delimiter": ",", "quote_columns": false}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": false, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"docs": {"show": false}, "quote_columns": "{{ target.type == 'redshift' or var('fivetran_using_source_casing', false) }}", "column_types": {"_fivetran_synced": "timestamp"}}, "created_at": 1786586789.1611154, "relation_name": "\"postgres\".\"public\".\"campaign_label_history_data\"", "raw_code": "", "doc_blocks": [], "root_path": "/home/runner/work/dbt_iterable/dbt_iterable/integration_tests", "depends_on": {"macros": []}}, "seed.iterable_integration_tests.list_data": {"database": "postgres", "schema": "public", "name": "list_data", "resource_type": "seed", "package_name": "iterable_integration_tests", "path": "list_data.csv", "original_file_path": "seeds/list_data.csv", "unique_id": "seed.iterable_integration_tests.list_data", "fqn": ["iterable_integration_tests", "list_data"], "alias": "list_data", "checksum": {"name": "sha256", "checksum": "9d817c52008be5fbdb25cde6fa5855f8222f41a436ba7e2e5ed564e319cb64fd"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "seed", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {"_fivetran_synced": "timestamp"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": false, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "delimiter": ",", "quote_columns": false}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": false, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"docs": {"show": false}, "quote_columns": "{{ target.type == 'redshift' or var('fivetran_using_source_casing', false) }}", "column_types": {"_fivetran_synced": "timestamp"}}, "created_at": 1786586789.1642978, "relation_name": "\"postgres\".\"public\".\"list_data\"", "raw_code": "", "doc_blocks": [], "root_path": "/home/runner/work/dbt_iterable/dbt_iterable/integration_tests", "depends_on": {"macros": []}}, "model.iterable.iterable__user_unsubscriptions": {"database": "postgres", "schema": "public_iterable_dev", "name": "iterable__user_unsubscriptions", "resource_type": "model", "package_name": "iterable", "path": "iterable__user_unsubscriptions.sql", "original_file_path": "models/iterable__user_unsubscriptions.sql", "unique_id": "model.iterable.iterable__user_unsubscriptions", "fqn": ["iterable", "iterable__user_unsubscriptions"], "alias": "iterable__user_unsubscriptions", "checksum": {"name": "sha256", "checksum": "9ffdcfb7996a2147cd7739fc5ac7a1bd2e0db91e0ffc76d1458f53046fc4598f"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "table", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "Table that generates the total channel and message types a user has chosen to unsubscribe.", "columns": {"source_relation": {"name": "source_relation", "description": "Identifies the record's source.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": ["doc.iterable.source_relation"]}, "_fivetran_user_id": {"name": "_fivetran_user_id", "description": "A Fivetran-created unique identifier for the new Iterable schema in Aug 2023, for users, derived from hashing user_id and/or email, depending on project type.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_user_key": {"name": "unique_user_key", "description": "The unique identifier of the user. With the new schema (Aug 2023), it is the _fivetran_user_id. This is a hash of user_id and/or email, depending on project type. If using the old schema, it is email.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "channel_id": {"name": "channel_id", "description": "Unique identifier of the channel which the user is unsubscribed", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "message_type_id": {"name": "message_type_id", "description": "Unique identifier of the message type which the user is unsubscribed", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "channel_name": {"name": "channel_name", "description": "The name of the channel which the user is unsubscribed", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "message_type_name": {"name": "message_type_name", "description": "The name of the message type which the user is unsubscribed", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "channel_type": {"name": "channel_type", "description": "The channel type which the user is unsubscribed", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "message_medium": {"name": "message_medium", "description": "The medium type the message was provided which the user is unsubscribed", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "updated_at": {"name": "updated_at", "description": "Timestamp of when the user unsubscribed from the channel or message type", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "is_unsubscribed_channel_wide": {"name": "is_unsubscribed_channel_wide", "description": "Boolean indicating if the user unsubscribed at the channel level (i.e. unsubscribed to all message types) or if they unsubscribed from only an individual message type.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "iterable://models/iterable.yml", "build_path": null, "unrendered_config": {"materialized": "table", "schema": "iterable_{{ var('directed_schema','dev') }}", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1786586790.38421, "relation_name": "\"postgres\".\"public_iterable_dev\".\"iterable__user_unsubscriptions\"", "raw_code": "{% set using_user_unsubscribed_message_type = var('iterable__using_user_unsubscribed_message_type', True) %}\n\nwith message_type_channel as (\n\n select *\n from {{ ref('int_iterable__message_type_channel') }}\n\n), user_unsubscribed_channel as (\n\n select\n *\n from {{ ref('stg_iterable__user_unsubscribed_channel') }}\n where latest_batch_index = 1\n\n{% if using_user_unsubscribed_message_type %}\n), user_unsubscribed_message_type as (\n\n select\n *\n from {{ ref('stg_iterable__user_unsub_message_type') }}\n where latest_batch_index = 1\n\n{% endif %}\n\n), combine as (\n\n select\n source_relation,\n _fivetran_user_id,\n unique_user_key,\n channel_id,\n cast(null as {{ dbt.type_string() }}) as message_type_id,\n updated_at\n from user_unsubscribed_channel\n\n{% if using_user_unsubscribed_message_type %}\n\n union all\n\n select\n source_relation,\n _fivetran_user_id,\n unique_user_key,\n cast(null as {{ dbt.type_string() }}) as channel_id,\n message_type_id,\n updated_at\n from user_unsubscribed_message_type\n{% endif %}\n\n), final as (\n\n select\n combine.source_relation,\n combine._fivetran_user_id,\n combine.unique_user_key,\n -- coalescing since message_type -> channel goes up a grain\n coalesce(combine.channel_id, message_type_channel.channel_id) as channel_id,\n coalesce(combine.message_type_id, message_type_channel.message_type_id) as message_type_id,\n combine.updated_at,\n message_type_channel.channel_name,\n message_type_channel.message_type_name,\n message_type_channel.channel_type,\n message_type_channel.message_medium,\n case when combine.channel_id is not null then true else false end as is_unsubscribed_channel_wide\n\n from combine\n\n -- unsubscribing from an entire channel unsubscribes a user from all message types in that channel\n join message_type_channel\n on combine.source_relation = message_type_channel.source_relation\n and (combine.channel_id = message_type_channel.channel_id\n or combine.message_type_id = message_type_channel.message_type_id)\n)\n\nselect *\nfrom final", "doc_blocks": [], "language": "sql", "refs": [{"name": "int_iterable__message_type_channel", "package": null, "version": null}, {"name": "stg_iterable__user_unsubscribed_channel", "package": null, "version": null}, {"name": "stg_iterable__user_unsub_message_type", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.type_string"], "nodes": ["model.iterable.int_iterable__message_type_channel", "model.iterable.stg_iterable__user_unsubscribed_channel", "model.iterable.stg_iterable__user_unsub_message_type"]}, "compiled_path": "target/compiled/iterable/models/iterable__user_unsubscriptions.sql", "compiled": true, "compiled_code": "\n\nwith message_type_channel as (\n\n select *\n from \"postgres\".\"public_iterable_dev\".\"int_iterable__message_type_channel\"\n\n), user_unsubscribed_channel as (\n\n select\n *\n from \"postgres\".\"public_iterable_dev\".\"stg_iterable__user_unsubscribed_channel\"\n where latest_batch_index = 1\n\n\n), user_unsubscribed_message_type as (\n\n select\n *\n from \"postgres\".\"public_iterable_dev\".\"stg_iterable__user_unsub_message_type\"\n where latest_batch_index = 1\n\n\n\n), combine as (\n\n select\n source_relation,\n _fivetran_user_id,\n unique_user_key,\n channel_id,\n cast(null as TEXT) as message_type_id,\n updated_at\n from user_unsubscribed_channel\n\n\n\n union all\n\n select\n source_relation,\n _fivetran_user_id,\n unique_user_key,\n cast(null as TEXT) as channel_id,\n message_type_id,\n updated_at\n from user_unsubscribed_message_type\n\n\n), final as (\n\n select\n combine.source_relation,\n combine._fivetran_user_id,\n combine.unique_user_key,\n -- coalescing since message_type -> channel goes up a grain\n coalesce(combine.channel_id, message_type_channel.channel_id) as channel_id,\n coalesce(combine.message_type_id, message_type_channel.message_type_id) as message_type_id,\n combine.updated_at,\n message_type_channel.channel_name,\n message_type_channel.message_type_name,\n message_type_channel.channel_type,\n message_type_channel.message_medium,\n case when combine.channel_id is not null then true else false end as is_unsubscribed_channel_wide\n\n from combine\n\n -- unsubscribing from an entire channel unsubscribes a user from all message types in that channel\n join message_type_channel\n on combine.source_relation = message_type_channel.source_relation\n and (combine.channel_id = message_type_channel.channel_id\n or combine.message_type_id = message_type_channel.message_type_id)\n)\n\nselect *\nfrom final", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.iterable__user_campaign": {"database": "postgres", "schema": "public_iterable_dev", "name": "iterable__user_campaign", "resource_type": "model", "package_name": "iterable", "path": "iterable__user_campaign.sql", "original_file_path": "models/iterable__user_campaign.sql", "unique_id": "model.iterable.iterable__user_campaign", "fqn": ["iterable", "iterable__user_campaign"], "alias": "iterable__user_campaign", "checksum": {"name": "sha256", "checksum": "343ed0b8ab547da53812f4a8426cfd7b93f81ce3886680c4182a2596f1ea8632"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "table", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "Table that provides total and unique metrics for a user associated with particular campaigns and if available, experiments.", "columns": {"source_relation": {"name": "source_relation", "description": "Identifies the record's source.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": ["doc.iterable.source_relation"]}, "unique_user_campaign_id": {"name": "unique_user_campaign_id", "description": "Unique ID combining source_relation, unique_user_key, campaign_id, and if available, experiment_id.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "_fivetran_user_id": {"name": "_fivetran_user_id", "description": "A Fivetran-created unique identifier for the new Iterable schema in Aug 2023, for users, derived from hashing user_id and/or email, depending on project type.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_user_key": {"name": "unique_user_key", "description": "The unique identifier of the user. With the new schema (Aug 2023), it is the _fivetran_user_id. This is a hash of user_id and/or email, depending on project type. If using the old schema, it is email.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "user_id": {"name": "user_id", "description": "User identifier, for userID-based projects.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "user_email": {"name": "user_email", "description": "Email of the user if it exists.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "user_full_name": {"name": "user_full_name", "description": "The users first and last name", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "campaign_id": {"name": "campaign_id", "description": "The unique identifier of the campaign which the user metrics are associated", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "campaign_name": {"name": "campaign_name", "description": "The name of the campaign which the user metrics are associated", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "template_id": {"name": "template_id", "description": "The unique identifier of the template used within the campaign", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "template_name": {"name": "template_name", "description": "The name of the template used for the campaign", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "experiment_id": {"name": "experiment_id", "description": "The unique experiment variation of the campaign", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "recurring_campaign_id": {"name": "recurring_campaign_id", "description": "The unique identifier of the recurring campaign which the campaign is tied to", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "recurring_campaign_name": {"name": "recurring_campaign_name", "description": "The name of the recurring campaign which the campaign is tied to", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "first_event_at": {"name": "first_event_at", "description": "Timestamp of the first campaign/experiment event associated with the user", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "last_event_at": {"name": "last_event_at", "description": "Timestamp of the most recent campaign/experiment event associated with the user", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_emailclick": {"name": "total_emailclick", "description": "Total email clicks events the user took within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_emailunsubscribe": {"name": "total_emailunsubscribe", "description": "Total email unsubscription events the user performed within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_emailcomplaint": {"name": "total_emailcomplaint", "description": "Total email complaint events the user performed within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_customevent": {"name": "total_customevent", "description": "Total custom events associated with the user within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_emailsubscribe": {"name": "total_emailsubscribe", "description": "Total email subscription events associate with the user within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_emailopen": {"name": "total_emailopen", "description": "Total email open events the user performed within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_pushsend": {"name": "total_pushsend", "description": "Total push send events the user performed within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_smsbounce": {"name": "total_smsbounce", "description": "Total sms bounce events associated with the user within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_pushbounce": {"name": "total_pushbounce", "description": "Total push bounce events associated with the user within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_inappsendskip": {"name": "total_inappsendskip", "description": "Total in app send skip events the user performed within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_smssend": {"name": "total_smssend", "description": "Total sms send events associated with the user within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_inappsend": {"name": "total_inappsend", "description": "Total in app send events associated with the user within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_pushopen": {"name": "total_pushopen", "description": "Total push open events the user performed within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_emailsend": {"name": "total_emailsend", "description": "Total email send event associated with the user within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_pushsendskip": {"name": "total_pushsendskip", "description": "Total push send skip events associated with the user within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_inappopen": {"name": "total_inappopen", "description": "Total in app open events associated with the user within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_emailsendskip": {"name": "total_emailsendskip", "description": "Total email send skip events associated with the user within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_emailbounce": {"name": "total_emailbounce", "description": "Total email bounce events associated with the user within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_inappclick": {"name": "total_inappclick", "description": "Total in app click events associated with the user within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_pushuninstall": {"name": "total_pushuninstall", "description": "Total push uninstall events associated with the user within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "first_open_or_click_event_at": {"name": "first_open_or_click_event_at", "description": "The time of the first open or click time. This is the first time a user interacts with a campaign, recording the earliest occurring event out of 'emailOpen', 'emailClick', and 'pushOpen'.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "iterable://models/iterable.yml", "build_path": null, "unrendered_config": {"materialized": "table", "schema": "iterable_{{ var('directed_schema','dev') }}", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1786586790.3828135, "relation_name": "\"postgres\".\"public_iterable_dev\".\"iterable__user_campaign\"", "raw_code": "{% set using_event_extension = var('iterable__using_event_extension', True) %}\n\nwith events as (\n\n select *\n from {{ ref('iterable__events') }}\n\n), pivot_out_events as (\n\n-- this will be at the user-campaign-experiment variation level\n-- if experiment_id is null, the user-campaign interactions happened outside of an experiment\n-- if campaign_id is null, the user interactions are organic\n select\n source_relation,\n _fivetran_user_id,\n unique_user_key,\n user_id,\n campaign_id,\n\n {{ \"experiment_id,\" if using_event_extension }}\n\n email as user_email,\n user_full_name,\n case when campaign_id is null then 'organic' else campaign_name end as campaign_name,\n template_id,\n template_name,\n\n recurring_campaign_id,\n recurring_campaign_name,\n\n min(created_at) as first_event_at,\n max(created_at) as last_event_at,\n min(case when event_name in ('emailOpen', 'emailClick', 'pushOpen') then created_at end) as first_open_or_click_event_at\n\n\n -- count up the number of instances of each metric\n -- `iterable__event_metrics` is set by default to all events brought in by fivetran+iterable\n -- https://fivetran.com/docs/applications/iterable#schemanotes\n {% for em in var('iterable__event_metrics') %}\n , sum(case when lower(event_name) = '{{ em | lower }}' then 1 else 0 end)\n as {{ 'total_' ~ em | replace(' ', '_') | replace('(', '') | replace(')', '') | lower }}\n {% endfor %}\n\n from events\n\n {{ dbt_utils.group_by(n=13 if using_event_extension else 12 ) }}\n\n), add_surrogate_key as (\n\n {% set surrogate_key_fields = ['source_relation', 'unique_user_key', 'campaign_id'] %}\n {% do surrogate_key_fields.append('experiment_id') if var('iterable__using_event_extension', True) %}\n\n select \n *,\n {{ dbt_utils.generate_surrogate_key(surrogate_key_fields) }} as unique_user_campaign_id\n\n from pivot_out_events\n)\n\nselect *\nfrom add_surrogate_key", "doc_blocks": [], "language": "sql", "refs": [{"name": "iterable__events", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt_utils.group_by", "macro.dbt_utils.generate_surrogate_key"], "nodes": ["model.iterable.iterable__events"]}, "compiled_path": "target/compiled/iterable/models/iterable__user_campaign.sql", "compiled": true, "compiled_code": "\n\nwith events as (\n\n select *\n from \"postgres\".\"public_iterable_dev\".\"iterable__events\"\n\n), pivot_out_events as (\n\n-- this will be at the user-campaign-experiment variation level\n-- if experiment_id is null, the user-campaign interactions happened outside of an experiment\n-- if campaign_id is null, the user interactions are organic\n select\n source_relation,\n _fivetran_user_id,\n unique_user_key,\n user_id,\n campaign_id,\n\n experiment_id,\n\n email as user_email,\n user_full_name,\n case when campaign_id is null then 'organic' else campaign_name end as campaign_name,\n template_id,\n template_name,\n\n recurring_campaign_id,\n recurring_campaign_name,\n\n min(created_at) as first_event_at,\n max(created_at) as last_event_at,\n min(case when event_name in ('emailOpen', 'emailClick', 'pushOpen') then created_at end) as first_open_or_click_event_at\n\n\n -- count up the number of instances of each metric\n -- `iterable__event_metrics` is set by default to all events brought in by fivetran+iterable\n -- https://fivetran.com/docs/applications/iterable#schemanotes\n \n , sum(case when lower(event_name) = 'emailclick' then 1 else 0 end)\n as total_emailclick\n \n , sum(case when lower(event_name) = 'emailunsubscribe' then 1 else 0 end)\n as total_emailunsubscribe\n \n , sum(case when lower(event_name) = 'emailcomplaint' then 1 else 0 end)\n as total_emailcomplaint\n \n , sum(case when lower(event_name) = 'customevent' then 1 else 0 end)\n as total_customevent\n \n , sum(case when lower(event_name) = 'emailsubscribe' then 1 else 0 end)\n as total_emailsubscribe\n \n , sum(case when lower(event_name) = 'emailopen' then 1 else 0 end)\n as total_emailopen\n \n , sum(case when lower(event_name) = 'pushsend' then 1 else 0 end)\n as total_pushsend\n \n , sum(case when lower(event_name) = 'smsbounce' then 1 else 0 end)\n as total_smsbounce\n \n , sum(case when lower(event_name) = 'pushbounce' then 1 else 0 end)\n as total_pushbounce\n \n , sum(case when lower(event_name) = 'inappsendskip' then 1 else 0 end)\n as total_inappsendskip\n \n , sum(case when lower(event_name) = 'smssend' then 1 else 0 end)\n as total_smssend\n \n , sum(case when lower(event_name) = 'inappsend' then 1 else 0 end)\n as total_inappsend\n \n , sum(case when lower(event_name) = 'pushopen' then 1 else 0 end)\n as total_pushopen\n \n , sum(case when lower(event_name) = 'emailsend' then 1 else 0 end)\n as total_emailsend\n \n , sum(case when lower(event_name) = 'pushsendskip' then 1 else 0 end)\n as total_pushsendskip\n \n , sum(case when lower(event_name) = 'inappopen' then 1 else 0 end)\n as total_inappopen\n \n , sum(case when lower(event_name) = 'emailsendskip' then 1 else 0 end)\n as total_emailsendskip\n \n , sum(case when lower(event_name) = 'emailbounce' then 1 else 0 end)\n as total_emailbounce\n \n , sum(case when lower(event_name) = 'inappclick' then 1 else 0 end)\n as total_inappclick\n \n , sum(case when lower(event_name) = 'pushuninstall' then 1 else 0 end)\n as total_pushuninstall\n \n\n from events\n\n group by 1,2,3,4,5,6,7,8,9,10,11,12,13\n\n), add_surrogate_key as (\n\n \n \n\n select \n *,\n md5(cast(coalesce(cast(source_relation as TEXT), '_dbt_utils_surrogate_key_null_') || '-' || coalesce(cast(unique_user_key as TEXT), '_dbt_utils_surrogate_key_null_') || '-' || coalesce(cast(campaign_id as TEXT), '_dbt_utils_surrogate_key_null_') || '-' || coalesce(cast(experiment_id as TEXT), '_dbt_utils_surrogate_key_null_') as TEXT)) as unique_user_campaign_id\n\n from pivot_out_events\n)\n\nselect *\nfrom add_surrogate_key", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.iterable__list_user_history": {"database": "postgres", "schema": "public_iterable_dev", "name": "iterable__list_user_history", "resource_type": "model", "package_name": "iterable", "path": "iterable__list_user_history.sql", "original_file_path": "models/iterable__list_user_history.sql", "unique_id": "model.iterable.iterable__list_user_history", "fqn": ["iterable", "iterable__list_user_history"], "alias": "iterable__list_user_history", "checksum": {"name": "sha256", "checksum": "9c0778ad02c86e2145ba4189534ea1eabf07b41bb3aa414934fa554ae4af4e1c"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "table", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "Table that recreates the `list_user_history` source table. Additionally, this table provides an `is_current` field to identify the current lists associated with the user. The table coalesces list_id values from both the direct list_user relationships and the unnested email_list_ids from user history to ensure comprehensive list coverage. The grain of this table is at the user/list/updated_at level.\n", "columns": {"source_relation": {"name": "source_relation", "description": "Identifies the record's source.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": ["doc.iterable.source_relation"]}, "unique_user_key": {"name": "unique_user_key", "description": "The unique identifier of the user. With the new schema (Aug 2023), it is the _fivetran_user_id. This is a hash of user_id and/or email, depending on project type. If using the old schema, it is email.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "_fivetran_user_id": {"name": "_fivetran_user_id", "description": "A Fivetran-created unique identifier for the new Iterable schema in Aug 2023, for users, derived from hashing user_id and/or email, depending on project type.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "user_email": {"name": "user_email", "description": "Email of the user if it exists.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "user_first_name": {"name": "user_first_name", "description": "First name of the user", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "user_last_name": {"name": "user_last_name", "description": "Last name of the user", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "user_id": {"name": "user_id", "description": "User identifier, for userID-based projects.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "user_signup_date": {"name": "user_signup_date", "description": "Timestamp of when the user signed up", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "user_signup_source": {"name": "user_signup_source", "description": "Source where the user signed up", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "user_updated_at": {"name": "user_updated_at", "description": "Last update timestamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "list_id": {"name": "list_id", "description": "The list associated with the user. Uses coalesced values prioritizing `list_id` from `LIST_USER` over the unnested `email_list_ids` from `USER_HISTORY` for comprehensive list coverage.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "is_current": {"name": "is_current", "description": "Boolean indicating if the current list is active", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "list_name": {"name": "list_name", "description": "Name of the list associated with the user", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "list_type": {"name": "list_type", "description": "Type of list associated with the user", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "list_created_at": {"name": "list_created_at", "description": "Date the list was created", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "iterable://models/iterable.yml", "build_path": null, "unrendered_config": {"materialized": "table", "schema": "iterable_{{ var('directed_schema','dev') }}", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1786586790.3795092, "relation_name": "\"postgres\".\"public_iterable_dev\".\"iterable__list_user_history\"", "raw_code": "with user_history_unnest as (\n\n select *\n from {{ ref('int_iterable__list_user_unnest') }}\n\n), list_users as (\n\n select *\n from {{ ref('stg_iterable__list_user') }}\n\n), lists as (\n\n select *\n from {{ ref('stg_iterable__list') }}\n\n), final as (\n select distinct\n user_history_unnest.source_relation,\n user_history_unnest.unique_user_key,\n user_history_unnest._fivetran_user_id,\n user_history_unnest.user_id,\n user_history_unnest.email as user_email,\n user_history_unnest.first_name as user_first_name,\n user_history_unnest.last_name as user_last_name,\n user_history_unnest.signup_date as user_signup_date,\n user_history_unnest.signup_source as user_signup_source,\n user_history_unnest.updated_at as user_updated_at,\n coalesce(list_users.list_id, user_history_unnest.list_id) as list_id,\n user_history_unnest.is_current,\n lists.list_name,\n lists.list_type,\n lists.created_at as list_created_at\n\n --The below script allows for pass through columns.\n {{ fivetran_utils.persist_pass_through_columns(pass_through_variable='iterable_user_history_pass_through_columns', identifier='user_history_unnest') }}\n\n from user_history_unnest\n left join list_users\n on list_users.source_relation = user_history_unnest.source_relation\n and list_users._fivetran_user_id = user_history_unnest._fivetran_user_id\n left join lists\n on lists.source_relation = user_history_unnest.source_relation\n and lists.list_id = coalesce(list_users.list_id, user_history_unnest.list_id)\n)\n\nselect *\nfrom final", "doc_blocks": [], "language": "sql", "refs": [{"name": "int_iterable__list_user_unnest", "package": null, "version": null}, {"name": "stg_iterable__list_user", "package": null, "version": null}, {"name": "stg_iterable__list", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.fivetran_utils.persist_pass_through_columns"], "nodes": ["model.iterable.int_iterable__list_user_unnest", "model.iterable.stg_iterable__list_user", "model.iterable.stg_iterable__list"]}, "compiled_path": "target/compiled/iterable/models/iterable__list_user_history.sql", "compiled": true, "compiled_code": "with user_history_unnest as (\n\n select *\n from \"postgres\".\"public_iterable_dev\".\"int_iterable__list_user_unnest\"\n\n), list_users as (\n\n select *\n from \"postgres\".\"public_iterable_dev\".\"stg_iterable__list_user\"\n\n), lists as (\n\n select *\n from \"postgres\".\"public_iterable_dev\".\"stg_iterable__list\"\n\n), final as (\n select distinct\n user_history_unnest.source_relation,\n user_history_unnest.unique_user_key,\n user_history_unnest._fivetran_user_id,\n user_history_unnest.user_id,\n user_history_unnest.email as user_email,\n user_history_unnest.first_name as user_first_name,\n user_history_unnest.last_name as user_last_name,\n user_history_unnest.signup_date as user_signup_date,\n user_history_unnest.signup_source as user_signup_source,\n user_history_unnest.updated_at as user_updated_at,\n coalesce(list_users.list_id, user_history_unnest.list_id) as list_id,\n user_history_unnest.is_current,\n lists.list_name,\n lists.list_type,\n lists.created_at as list_created_at\n\n --The below script allows for pass through columns.\n \n\n\n\n\n\n from user_history_unnest\n left join list_users\n on list_users.source_relation = user_history_unnest.source_relation\n and list_users._fivetran_user_id = user_history_unnest._fivetran_user_id\n left join lists\n on lists.source_relation = user_history_unnest.source_relation\n and lists.list_id = coalesce(list_users.list_id, user_history_unnest.list_id)\n)\n\nselect *\nfrom final", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.iterable__campaigns": {"database": "postgres", "schema": "public_iterable_dev", "name": "iterable__campaigns", "resource_type": "model", "package_name": "iterable", "path": "iterable__campaigns.sql", "original_file_path": "models/iterable__campaigns.sql", "unique_id": "model.iterable.iterable__campaigns", "fqn": ["iterable", "iterable__campaigns"], "alias": "iterable__campaigns", "checksum": {"name": "sha256", "checksum": "174a0caff16de3a7e7e51718d4428e421e042c8528bbd6b62dc036f7379e048c"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "table", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "Table that provides aggregations for campaigns at the template and if available, the experiment grain.", "columns": {"source_relation": {"name": "source_relation", "description": "Identifies the record's source.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": ["doc.iterable.source_relation"]}, "campaign_id": {"name": "campaign_id", "description": "Unique identifier of the campaign record", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_campaign_version_id": {"name": "unique_campaign_version_id", "description": "Unique identifier combining campaign_id, template_id, source_relation, and if available, experiment_id.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "campaign_name": {"name": "campaign_name", "description": "User defined name of the campaign.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "updated_at": {"name": "updated_at", "description": "Last update timestamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "campaign_state": {"name": "campaign_state", "description": "State of the campaign. Can be Draft, Ready, Scheduled, Running, Finished, Starting, Aborted or Recurring", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "campaign_type": {"name": "campaign_type", "description": "The campaign type. Can be Blast or Triggered", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "send_size": {"name": "send_size", "description": "Size of the campaign. Number of individuals included in the campaign", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "start_at": {"name": "start_at", "description": "Start timestamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "ended_at": {"name": "ended_at", "description": "Ended timestamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "created_at": {"name": "created_at", "description": "Creation timestamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "created_by_user_id": {"name": "created_by_user_id", "description": "Reference to the user who created the campaign", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "template_id": {"name": "template_id", "description": "Reference to the campaign template", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "recurring_campaign_id": {"name": "recurring_campaign_id", "description": "Unique identifier of the recurring campaign (if applicable)", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "recurring_campaign_name": {"name": "recurring_campaign_name", "description": "Name of the recurring campaign (if applicable)", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "recurring_campaign_state": {"name": "recurring_campaign_state", "description": "State of the recurring campaign (if applicable)", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "recurring_campaign_send_size": {"name": "recurring_campaign_send_size", "description": "Size of the recurring campaign. Number of individuals included in the recurring campaign (if applicable)", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "recurring_campaign_start_at": {"name": "recurring_campaign_start_at", "description": "Timestamp of when the recurring campaign started (if applicable)", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "is_campaign_recurring": {"name": "is_campaign_recurring", "description": "Boolean indicating if the campaign is a recurring campaign", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "experiment_id": {"name": "experiment_id", "description": "Reference to the experiment used if the event is an experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "count_unique_users": {"name": "count_unique_users", "description": "Count of total unique users within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_emailclick": {"name": "total_emailclick", "description": "Total email clicks within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_total_emailclick": {"name": "unique_total_emailclick", "description": "Unique email clicks within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_emailunsubscribe": {"name": "total_emailunsubscribe", "description": "Total email unsubscribe events within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_total_emailunsubscribe": {"name": "unique_total_emailunsubscribe", "description": "Unique total email unsubscribe events within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_emailcomplaint": {"name": "total_emailcomplaint", "description": "Total email complaints within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_total_emailcomplaint": {"name": "unique_total_emailcomplaint", "description": "Unique total email complaints within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_customevent": {"name": "total_customevent", "description": "Total custom events within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_total_customevent": {"name": "unique_total_customevent", "description": "Unique total custom events within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_emailsubscribe": {"name": "total_emailsubscribe", "description": "Total email subscribe events within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_total_emailsubscribe": {"name": "unique_total_emailsubscribe", "description": "Unique total email subscribe events within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_emailopen": {"name": "total_emailopen", "description": "Total email open events within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_total_emailopen": {"name": "unique_total_emailopen", "description": "Unique total email open events within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_pushsend": {"name": "total_pushsend", "description": "Total push send event within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_total_pushsend": {"name": "unique_total_pushsend", "description": "Unique total push send events within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_smsbounce": {"name": "total_smsbounce", "description": "Total sms bounce events within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_total_smsbounce": {"name": "unique_total_smsbounce", "description": "Unique total sms bounce events within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_pushbounce": {"name": "total_pushbounce", "description": "Total push bounce events within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_total_pushbounce": {"name": "unique_total_pushbounce", "description": "Unique total push bounce events within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_inappsendskip": {"name": "total_inappsendskip", "description": "Total in app send skip events within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_total_inappsendskip": {"name": "unique_total_inappsendskip", "description": "Unique total in app send skip events within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_smssend": {"name": "total_smssend", "description": "Total sms send events within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_total_smssend": {"name": "unique_total_smssend", "description": "Unique total sms send events within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_inappsend": {"name": "total_inappsend", "description": "Total in app send events within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_total_inappsend": {"name": "unique_total_inappsend", "description": "Unique total in app send events within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_pushopen": {"name": "total_pushopen", "description": "Total push open events within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_total_pushopen": {"name": "unique_total_pushopen", "description": "Unique total push open events within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_emailsend": {"name": "total_emailsend", "description": "Total email send events within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_total_emailsend": {"name": "unique_total_emailsend", "description": "Unique total email send events within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_pushsendskip": {"name": "total_pushsendskip", "description": "Total push send skip events within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_total_pushsendskip": {"name": "unique_total_pushsendskip", "description": "Unique total push send skip events within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_inappopen": {"name": "total_inappopen", "description": "Total in app open events within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_total_inappopen": {"name": "unique_total_inappopen", "description": "Unique total in app open events within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_emailsendskip": {"name": "total_emailsendskip", "description": "Total email send skip events within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_total_emailsendskip": {"name": "unique_total_emailsendskip", "description": "Unique total email send skip events within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_emailbounce": {"name": "total_emailbounce", "description": "Total email bounce events within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_total_emailbounce": {"name": "unique_total_emailbounce", "description": "Unique total email bounce events within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_inappclick": {"name": "total_inappclick", "description": "Total in app click events within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_total_inappclick": {"name": "unique_total_inappclick", "description": "Unique total in app click events within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_pushuninstall": {"name": "total_pushuninstall", "description": "Total push uninstall events within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_total_pushuninstall": {"name": "unique_total_pushuninstall", "description": "Unique total push uninstall events within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "count_send_lists": {"name": "count_send_lists", "description": "Count of send lists within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "count_suppress_lists": {"name": "count_suppress_lists", "description": "Count of suppress lists within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "labels": {"name": "labels", "description": "List of labels associated with the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "template_name": {"name": "template_name", "description": "Name of the template associated with the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "template_creator_user_id": {"name": "template_creator_user_id", "description": "The creator user id of the template associated with the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "message_medium": {"name": "message_medium", "description": "The medium which the message was provided", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "message_type_name": {"name": "message_type_name", "description": "The message type name associated with the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "channel_name": {"name": "channel_name", "description": "The channel name associated with the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "channel_id": {"name": "channel_id", "description": "The channel identifier associated with the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "channel_type": {"name": "channel_type", "description": "The channel type associated with the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "iterable://models/iterable.yml", "build_path": null, "unrendered_config": {"materialized": "table", "schema": "iterable_{{ var('directed_schema','dev') }}", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1786586790.355394, "relation_name": "\"postgres\".\"public_iterable_dev\".\"iterable__campaigns\"", "raw_code": "with campaign_event_metrics as (\n\n select *\n from {{ ref('int_iterable__campaign_event_metrics') }}\n\n), campaign_list_metrics as (\n\n select\n source_relation,\n campaign_id,\n sum(case when list_activity = 'send' then 1 else 0 end) as count_send_lists,\n sum(case when list_activity = 'suppress' then 1 else 0 end) as count_suppress_lists\n\n from {{ ref('int_iterable__campaign_lists') }}\n {{ dbt_utils.group_by(n=2) }}\n\n), campaign as (\n\n select *\n from {{ ref('int_iterable__recurring_campaigns') }}\n \n{% if var('iterable__using_campaign_label_history', true) %}\n), campaign_labels as (\n\n select *\n from {{ ref('int_iterable__campaign_labels') }}\n\n{% endif %}\n\n), template as (\n -- rebringing this in (it is brought in iterable__events) in case any campaigns don't have events yet\n -- this will result in some DAG ugliness but maintains template info for non-sent campaigns\n select *\n from {{ ref('int_iterable__latest_template') }}\n\n), campaign_join as (\n\n {% set exclude_fields = ['source_relation', 'campaign_id', 'template_id'] %} -- these are in campaigns\n\n -- this query will be at the campaign and experiment(if available) variation grain\n select\n campaign.*,\n {{ dbt_utils.star(from=ref('int_iterable__campaign_event_metrics'), except=exclude_fields, relation_alias=\"campaign_event_metrics\") }}\n , \n campaign_list_metrics.count_send_lists,\n campaign_list_metrics.count_suppress_lists,\n {% if var('iterable__using_campaign_label_history', true) %}\n campaign_labels.labels,\n {% endif %}\n template.template_name,\n template.creator_user_id as template_creator_user_id,\n template.message_medium,\n template.message_type_name,\n template.channel_name,\n template.channel_id,\n template.channel_type\n\n from campaign\n left join campaign_event_metrics\n on campaign.campaign_id = campaign_event_metrics.campaign_id\n and campaign.template_id = campaign_event_metrics.template_id\n and campaign.source_relation = campaign_event_metrics.source_relation\n left join campaign_list_metrics\n on campaign.campaign_id = campaign_list_metrics.campaign_id\n and campaign.source_relation = campaign_list_metrics.source_relation\n\n {% if var('iterable__using_campaign_label_history', true) %}\n left join campaign_labels\n on campaign.campaign_id = campaign_labels.campaign_id\n and campaign.source_relation = campaign_labels.source_relation\n {% endif %}\n\n left join template\n on campaign.template_id = template.template_id\n and campaign.source_relation = template.source_relation\n\n), add_surrogate_key as (\n\n {% set surrogate_key_fields = ['campaign_id', 'template_id', 'source_relation'] %}\n {% do surrogate_key_fields.append('experiment_id') if var('iterable__using_event_extension', True) %}\n\n select \n *,\n {{ dbt_utils.generate_surrogate_key(surrogate_key_fields) }} as unique_campaign_version_id\n\n from campaign_join\n)\n\nselect *\nfrom add_surrogate_key", "doc_blocks": [], "language": "sql", "refs": [{"name": "int_iterable__campaign_event_metrics", "package": null, "version": null}, {"name": "int_iterable__campaign_lists", "package": null, "version": null}, {"name": "int_iterable__recurring_campaigns", "package": null, "version": null}, {"name": "int_iterable__campaign_labels", "package": null, "version": null}, {"name": "int_iterable__latest_template", "package": null, "version": null}, {"name": "int_iterable__campaign_event_metrics", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt_utils.group_by", "macro.dbt_utils.star", "macro.dbt_utils.generate_surrogate_key"], "nodes": ["model.iterable.int_iterable__campaign_event_metrics", "model.iterable.int_iterable__campaign_lists", "model.iterable.int_iterable__recurring_campaigns", "model.iterable.int_iterable__campaign_labels", "model.iterable.int_iterable__latest_template"]}, "compiled_path": "target/compiled/iterable/models/iterable__campaigns.sql", "compiled": true, "compiled_code": "with campaign_event_metrics as (\n\n select *\n from \"postgres\".\"public_iterable_dev\".\"int_iterable__campaign_event_metrics\"\n\n), campaign_list_metrics as (\n\n select\n source_relation,\n campaign_id,\n sum(case when list_activity = 'send' then 1 else 0 end) as count_send_lists,\n sum(case when list_activity = 'suppress' then 1 else 0 end) as count_suppress_lists\n\n from \"postgres\".\"public_iterable_dev\".\"int_iterable__campaign_lists\"\n group by 1,2\n\n), campaign as (\n\n select *\n from \"postgres\".\"public_iterable_dev\".\"int_iterable__recurring_campaigns\"\n \n\n), campaign_labels as (\n\n select *\n from \"postgres\".\"public_iterable_dev\".\"int_iterable__campaign_labels\"\n\n\n\n), template as (\n -- rebringing this in (it is brought in iterable__events) in case any campaigns don't have events yet\n -- this will result in some DAG ugliness but maintains template info for non-sent campaigns\n select *\n from \"postgres\".\"public_iterable_dev\".\"int_iterable__latest_template\"\n\n), campaign_join as (\n\n -- these are in campaigns\n\n -- this query will be at the campaign and experiment(if available) variation grain\n select\n campaign.*,\n campaign_event_metrics.\"experiment_id\",\n campaign_event_metrics.\"count_unique_users\",\n campaign_event_metrics.\"total_emailclick\",\n campaign_event_metrics.\"unique_total_emailclick\",\n campaign_event_metrics.\"total_emailunsubscribe\",\n campaign_event_metrics.\"unique_total_emailunsubscribe\",\n campaign_event_metrics.\"total_emailcomplaint\",\n campaign_event_metrics.\"unique_total_emailcomplaint\",\n campaign_event_metrics.\"total_customevent\",\n campaign_event_metrics.\"unique_total_customevent\",\n campaign_event_metrics.\"total_emailsubscribe\",\n campaign_event_metrics.\"unique_total_emailsubscribe\",\n campaign_event_metrics.\"total_emailopen\",\n campaign_event_metrics.\"unique_total_emailopen\",\n campaign_event_metrics.\"total_pushsend\",\n campaign_event_metrics.\"unique_total_pushsend\",\n campaign_event_metrics.\"total_smsbounce\",\n campaign_event_metrics.\"unique_total_smsbounce\",\n campaign_event_metrics.\"total_pushbounce\",\n campaign_event_metrics.\"unique_total_pushbounce\",\n campaign_event_metrics.\"total_inappsendskip\",\n campaign_event_metrics.\"unique_total_inappsendskip\",\n campaign_event_metrics.\"total_smssend\",\n campaign_event_metrics.\"unique_total_smssend\",\n campaign_event_metrics.\"total_inappsend\",\n campaign_event_metrics.\"unique_total_inappsend\",\n campaign_event_metrics.\"total_pushopen\",\n campaign_event_metrics.\"unique_total_pushopen\",\n campaign_event_metrics.\"total_emailsend\",\n campaign_event_metrics.\"unique_total_emailsend\",\n campaign_event_metrics.\"total_pushsendskip\",\n campaign_event_metrics.\"unique_total_pushsendskip\",\n campaign_event_metrics.\"total_inappopen\",\n campaign_event_metrics.\"unique_total_inappopen\",\n campaign_event_metrics.\"total_emailsendskip\",\n campaign_event_metrics.\"unique_total_emailsendskip\",\n campaign_event_metrics.\"total_emailbounce\",\n campaign_event_metrics.\"unique_total_emailbounce\",\n campaign_event_metrics.\"total_inappclick\",\n campaign_event_metrics.\"unique_total_inappclick\",\n campaign_event_metrics.\"total_pushuninstall\",\n campaign_event_metrics.\"unique_total_pushuninstall\"\n , \n campaign_list_metrics.count_send_lists,\n campaign_list_metrics.count_suppress_lists,\n \n campaign_labels.labels,\n \n template.template_name,\n template.creator_user_id as template_creator_user_id,\n template.message_medium,\n template.message_type_name,\n template.channel_name,\n template.channel_id,\n template.channel_type\n\n from campaign\n left join campaign_event_metrics\n on campaign.campaign_id = campaign_event_metrics.campaign_id\n and campaign.template_id = campaign_event_metrics.template_id\n and campaign.source_relation = campaign_event_metrics.source_relation\n left join campaign_list_metrics\n on campaign.campaign_id = campaign_list_metrics.campaign_id\n and campaign.source_relation = campaign_list_metrics.source_relation\n\n \n left join campaign_labels\n on campaign.campaign_id = campaign_labels.campaign_id\n and campaign.source_relation = campaign_labels.source_relation\n \n\n left join template\n on campaign.template_id = template.template_id\n and campaign.source_relation = template.source_relation\n\n), add_surrogate_key as (\n\n \n \n\n select \n *,\n md5(cast(coalesce(cast(campaign_id as TEXT), '_dbt_utils_surrogate_key_null_') || '-' || coalesce(cast(template_id as TEXT), '_dbt_utils_surrogate_key_null_') || '-' || coalesce(cast(source_relation as TEXT), '_dbt_utils_surrogate_key_null_') || '-' || coalesce(cast(experiment_id as TEXT), '_dbt_utils_surrogate_key_null_') as TEXT)) as unique_campaign_version_id\n\n from campaign_join\n)\n\nselect *\nfrom add_surrogate_key", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.iterable__events": {"database": "postgres", "schema": "public_iterable_dev", "name": "iterable__events", "resource_type": "model", "package_name": "iterable", "path": "iterable__events.sql", "original_file_path": "models/iterable__events.sql", "unique_id": "model.iterable.iterable__events", "fqn": ["iterable", "iterable__events"], "alias": "iterable__events", "checksum": {"name": "sha256", "checksum": "d516cb05680b528ba689ac2a2e34bfee8bbd7ede3c7d8ccfea16a28232d39c44"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "incremental", "incremental_strategy": "delete+insert", "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": ["unique_event_id"], "on_schema_change": "fail", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}, "partition_by": {"field": "created_on", "data_type": "date"}, "file_format": "delta"}, "tags": [], "description": "Table that provides a comprehensive view of all events with enriched information such as the campaign, user effected, and template used.", "columns": {"source_relation": {"name": "source_relation", "description": "Identifies the record's source.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": ["doc.iterable.source_relation"]}, "event_id": {"name": "event_id", "description": "Unique id of the event generated by Fivetran", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_event_id": {"name": "unique_event_id", "description": "A unique surrogate key of event_id, _fivetran_user_id, and source_relation.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_user_key": {"name": "unique_user_key", "description": "The unique identifier of the user. With the new schema (Aug 2023), it is the _fivetran_user_id. This is a hash of user_id and/or email, depending on project type. If using the old schema, it is email.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "_fivetran_user_id": {"name": "_fivetran_user_id", "description": "A Fivetran-created unique identifier for the new Iterable schema in Aug 2023, for users, derived from hashing user_id and/or email, depending on project type.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "campaign_id": {"name": "campaign_id", "description": "Reference to the campaign from which the event originated", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "content_id": {"name": "content_id", "description": "Reference to the content the event is associated with", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "created_at": {"name": "created_at", "description": "Creation timestamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "email": {"name": "email", "description": "The user's email. User identifier, for email-based projects. Previously was the unique identifier for user records, for the old Iterable schema before the August 2023 updates.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "additional_properties": {"name": "additional_properties", "description": "json object containing addition event properties", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "event_name": {"name": "event_name", "description": "Name provided to the individual event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "message_bus_id": {"name": "message_bus_id", "description": "Reference to the message bus associated with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "message_id": {"name": "message_id", "description": "Reference to the message the event is associated with", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "message_type_id": {"name": "message_type_id", "description": "Reference to the type of message the event is associated with", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "recipient_state": {"name": "recipient_state", "description": "The state of the recipient upon receiving the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "status": {"name": "status", "description": "Status of the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "transactional_data": {"name": "transactional_data", "description": "Transactional data associated with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unsub_source": {"name": "unsub_source", "description": "Source of the unsubscribe event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "user_agent": {"name": "user_agent", "description": "User agent associated with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "user_agent_device": {"name": "user_agent_device", "description": "The device of the user agent", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "Timestamp of when the event record was synced by Fivetran", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "campaign_name": {"name": "campaign_name", "description": "The name of the campaign", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "campaign_type": {"name": "campaign_type", "description": "The type of campaign", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "is_campaign_recurring": {"name": "is_campaign_recurring", "description": "Boolean indicating if the campaign is recurrent", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "recurring_campaign_name": {"name": "recurring_campaign_name", "description": "The name of the recurring campaign (if applicable)", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "recurring_campaign_id": {"name": "recurring_campaign_id", "description": "The campaign if of the recurring campaign (if applicable)", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "user_id": {"name": "user_id", "description": "User identifier, for userID-based projects.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "user_full_name": {"name": "user_full_name", "description": "Full name of the user", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "message_type_name": {"name": "message_type_name", "description": "Name of the message type", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "message_medium": {"name": "message_medium", "description": "Medium of the message", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "channel_id": {"name": "channel_id", "description": "Unique identifier of the channel", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "channel_name": {"name": "channel_name", "description": "The channel name", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "channel_type": {"name": "channel_type", "description": "The type of channel", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "is_app_already_running": {"name": "is_app_already_running", "description": "Boolean indicating if the app is already running", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "badge": {"name": "badge", "description": "Badge associated with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "canonical_url_id": {"name": "canonical_url_id", "description": "Reference to the url associated with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "is_content_available": {"name": "is_content_available", "description": "Content available from the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "device": {"name": "device", "description": "The device associated with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "email_id": {"name": "email_id", "description": "Reference to the email associated with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "email_subject": {"name": "email_subject", "description": "Subject of the email associated with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "experiment_id": {"name": "experiment_id", "description": "Reference to the experiment used if the event is an experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "from_phone_number_id": {"name": "from_phone_number_id", "description": "Reference to the phone number which the event is from", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "from_smssender_id": {"name": "from_smssender_id", "description": "Reference to the sms sender which the event is from", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "link_id": {"name": "link_id", "description": "Reference to the link associated with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "link_url": {"name": "link_url", "description": "Url of the link associated with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "locale": {"name": "locale", "description": "Locale associated with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "payload": {"name": "payload", "description": "Payload resulted from the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "platform_endpoint": {"name": "platform_endpoint", "description": "The specific platform endpoint of the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "push_message": {"name": "push_message", "description": "Boolean indicating if the event is a push message", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "region": {"name": "region", "description": "Region of the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "sms_message": {"name": "sms_message", "description": "Boolean indicating if the event is an sms message", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "to_phone_number": {"name": "to_phone_number", "description": "To phone number associated with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "url": {"name": "url", "description": "Url associated with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "workflow_id": {"name": "workflow_id", "description": "Reference to the workflow which the event originated", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "workflow_name": {"name": "workflow_name", "description": "Name of the workflow which the event originated", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "catalog_collection_count": {"name": "catalog_collection_count", "description": "The count of products or items collected in a catalog associated with the event.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "catalog_lookup_count": {"name": "catalog_lookup_count", "description": "The count of times a catalog was looked up or queried during the event.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "template_id": {"name": "template_id", "description": "Unique identifier of the template", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "template_name": {"name": "template_name", "description": "User defined name of the template", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "template_creator_user_id": {"name": "template_creator_user_id", "description": "Reference to the user who created the template", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "created_on": {"name": "created_on", "description": "Day when the event was created", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "city": {"name": "city", "description": "The city associated with the event, which could be the location of the recipient.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "clicked_url": {"name": "clicked_url", "description": "The URL that was clicked by the recipient in response to the marketing message.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "country": {"name": "country", "description": "The country associated with the event, which could be the location of the recipient.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "error_code": {"name": "error_code", "description": "The error code or message indicating any issues or errors encountered during the event.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "expires_at": {"name": "expires_at", "description": "The date and time when the event or message is set to expire or become invalid.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "from_phone_number": {"name": "from_phone_number", "description": "The phone number from which the SMS message was sent.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "in_app_body": {"name": "in_app_body", "description": "The content or body of an in-app message that was sent as part of the event.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "is_sms_estimation": {"name": "is_sms_estimation", "description": "A boolean indicating whether the SMS message is an estimation or not.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "labels": {"name": "labels", "description": "Any labels or tags associated with the event, which can be used for categorization or organization.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "message_status": {"name": "message_status", "description": "The status of the marketing message, such as sent, delivered, opened, etc.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "mms_send_count": {"name": "mms_send_count", "description": "The count of multimedia messages (MMS) sent as part of the event.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "reason": {"name": "reason", "description": "The reason or cause associated with a specific event or action.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "sms_send_count": {"name": "sms_send_count", "description": "The count of SMS messages sent as part of the event.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "iterable://models/iterable.yml", "build_path": null, "unrendered_config": {"materialized": "incremental", "schema": "iterable_{{ var('directed_schema','dev') }}", "unique_key": "['unique_event_id']", "incremental_strategy": "CondExpr(test=Compare(expr=Getattr(node=Name(name='target', ctx='load'), attr='type', ctx='load'), ops=[Operand(op='in', expr=Tuple(items=[Const(value='bigquery'), Const(value='spark'), Const(value='databricks')], ctx='load'))]), expr1=Const(value='insert_overwrite'), expr2=Const(value='delete+insert'))", "partition_by": "CondExpr(test=Compare(expr=Getattr(node=Name(name='target', ctx='load'), attr='type', ctx='load'), ops=[Operand(op='notin', expr=Tuple(items=[Const(value='spark'), Const(value='databricks'), Const(value='duckdb')], ctx='load'))]), expr1=Dict(items=[Pair(key=Const(value='field'), value=Const(value='created_on')), Pair(key=Const(value='data_type'), value=Const(value='date'))]), expr2=List(items=[Const(value='created_on')]))", "file_format": "delta", "on_schema_change": "fail", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1786586790.3751261, "relation_name": "\"postgres\".\"public_iterable_dev\".\"iterable__events\"", "raw_code": "{{ config(\n materialized='incremental',\n unique_key=['unique_event_id'],\n incremental_strategy='insert_overwrite' if target.type in ('bigquery', 'spark', 'databricks') else 'delete+insert',\n partition_by={\"field\": \"created_on\", \"data_type\": \"date\"} if target.type not in ('spark', 'databricks', 'duckdb') else ['created_on'],\n file_format='delta',\n on_schema_change='fail'\n ) \n}}\n\n{% set using_event_extension = var('iterable__using_event_extension', True) %}\n\nwith events as (\n\n select *\n from {{ ref('stg_iterable__event') }}\n\n {% if is_incremental() %}\n where created_on >= {{ iterable.iterable_lookback(\n from_date=\"max(created_on)\",\n datepart='day', \n interval=var('iterable_lookback_window', 7)) }}\n {% endif %}\n\n), campaign as (\n\n select *\n from {{ ref('int_iterable__recurring_campaigns') }}\n\n\n{% if using_event_extension %}\n), event_extension as (\n\n select *\n from {{ ref('stg_iterable__event_extension') }}\n{% endif %}\n\n), users as (\n\n select *\n from {{ ref('int_iterable__latest_user') }}\n\n), message_type_channel as (\n\n select *\n from {{ ref('int_iterable__message_type_channel') }}\n\n), template as (\n\n select *\n from {{ ref('int_iterable__latest_template') }}\n\n), event_join as (\n\n select \n events.*,\n campaign.campaign_name,\n campaign.campaign_type,\n campaign.is_campaign_recurring,\n campaign.recurring_campaign_name,\n campaign.recurring_campaign_id,\n\n users.user_id,\n users.first_name || ' ' || users.last_name as user_full_name,\n\n message_type_channel.message_type_name,\n message_type_channel.message_medium,\n message_type_channel.channel_id,\n message_type_channel.channel_name,\n message_type_channel.channel_type\n\n {% if using_event_extension %}\n {% set exclude_fields = [\"source_relation\", \"unique_user_key\",\"_fivetran_user_id\",\"event_id\", \"content_id\", \"_fivetran_synced\", \"unique_event_id\"] %}\n , {{ dbt_utils.star(from=ref('stg_iterable__event_extension'), except=exclude_fields, relation_alias=\"event_extension\") }}\n {% endif %}\n\n ,\n campaign.template_id,\n template.template_name,\n template.creator_user_id as template_creator_user_id\n \n from events\n\n {% if using_event_extension %}\n left join event_extension\n on events.unique_event_id = event_extension.unique_event_id\n and events.source_relation = event_extension.source_relation\n {% endif %}\n\n left join campaign\n on events.campaign_id = campaign.campaign_id\n and events.source_relation = campaign.source_relation\n left join users\n on events.unique_user_key = users.unique_user_key -- unique_user_key = _fivetran_user_id if exists, otherwise email\n and events.source_relation = users.source_relation\n left join message_type_channel\n on events.message_type_id = message_type_channel.message_type_id\n and events.source_relation = message_type_channel.source_relation\n left join template\n on campaign.template_id = template.template_id\n and events.source_relation = template.source_relation\n)\n\nselect *\nfrom event_join", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__event", "package": null, "version": null}, {"name": "int_iterable__recurring_campaigns", "package": null, "version": null}, {"name": "stg_iterable__event_extension", "package": null, "version": null}, {"name": "int_iterable__latest_user", "package": null, "version": null}, {"name": "int_iterable__message_type_channel", "package": null, "version": null}, {"name": "int_iterable__latest_template", "package": null, "version": null}, {"name": "stg_iterable__event_extension", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.is_incremental", "macro.dbt_utils.star", "macro.iterable.iterable_lookback"], "nodes": ["model.iterable.stg_iterable__event", "model.iterable.int_iterable__recurring_campaigns", "model.iterable.stg_iterable__event_extension", "model.iterable.int_iterable__latest_user", "model.iterable.int_iterable__message_type_channel", "model.iterable.int_iterable__latest_template"]}, "compiled_path": "target/compiled/iterable/models/iterable__events.sql", "compiled": true, "compiled_code": "\n\n\n\nwith events as (\n\n select *\n from \"postgres\".\"public_iterable_dev\".\"stg_iterable__event\"\n\n \n where created_on >= \n\n\n\n \n\n \n\n cast('2020-07-12' as date) + ((interval '1 day') * (-7))\n\n\n\n\n \n\n), campaign as (\n\n select *\n from \"postgres\".\"public_iterable_dev\".\"int_iterable__recurring_campaigns\"\n\n\n\n), event_extension as (\n\n select *\n from \"postgres\".\"public_iterable_dev\".\"stg_iterable__event_extension\"\n\n\n), users as (\n\n select *\n from \"postgres\".\"public_iterable_dev\".\"int_iterable__latest_user\"\n\n), message_type_channel as (\n\n select *\n from \"postgres\".\"public_iterable_dev\".\"int_iterable__message_type_channel\"\n\n), template as (\n\n select *\n from \"postgres\".\"public_iterable_dev\".\"int_iterable__latest_template\"\n\n), event_join as (\n\n select \n events.*,\n campaign.campaign_name,\n campaign.campaign_type,\n campaign.is_campaign_recurring,\n campaign.recurring_campaign_name,\n campaign.recurring_campaign_id,\n\n users.user_id,\n users.first_name || ' ' || users.last_name as user_full_name,\n\n message_type_channel.message_type_name,\n message_type_channel.message_medium,\n message_type_channel.channel_id,\n message_type_channel.channel_name,\n message_type_channel.channel_type\n\n \n \n , event_extension.\"is_app_already_running\",\n event_extension.\"badge\",\n event_extension.\"catalog_collection_count\",\n event_extension.\"catalog_lookup_count\",\n event_extension.\"canonical_url_id\",\n event_extension.\"is_content_available\",\n event_extension.\"device\",\n event_extension.\"email_id\",\n event_extension.\"email_subject\",\n event_extension.\"experiment_id\",\n event_extension.\"from_phone_number_id\",\n event_extension.\"from_smssender_id\",\n event_extension.\"link_id\",\n event_extension.\"link_url\",\n event_extension.\"locale\",\n event_extension.\"payload\",\n event_extension.\"platform_endpoint\",\n event_extension.\"push_message\",\n event_extension.\"region\",\n event_extension.\"sms_message\",\n event_extension.\"to_phone_number\",\n event_extension.\"url\",\n event_extension.\"workflow_id\",\n event_extension.\"workflow_name\",\n event_extension.\"city\",\n event_extension.\"clicked_url\",\n event_extension.\"country\",\n event_extension.\"error_code\",\n event_extension.\"expires_at\",\n event_extension.\"from_phone_number\",\n event_extension.\"in_app_body\",\n event_extension.\"is_sms_estimation\",\n event_extension.\"labels\",\n event_extension.\"message_status\",\n event_extension.\"mms_send_count\",\n event_extension.\"reason\",\n event_extension.\"sms_send_count\"\n \n\n ,\n campaign.template_id,\n template.template_name,\n template.creator_user_id as template_creator_user_id\n \n from events\n\n \n left join event_extension\n on events.unique_event_id = event_extension.unique_event_id\n and events.source_relation = event_extension.source_relation\n \n\n left join campaign\n on events.campaign_id = campaign.campaign_id\n and events.source_relation = campaign.source_relation\n left join users\n on events.unique_user_key = users.unique_user_key -- unique_user_key = _fivetran_user_id if exists, otherwise email\n and events.source_relation = users.source_relation\n left join message_type_channel\n on events.message_type_id = message_type_channel.message_type_id\n and events.source_relation = message_type_channel.source_relation\n left join template\n on campaign.template_id = template.template_id\n and events.source_relation = template.source_relation\n)\n\nselect *\nfrom event_join", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.iterable__users": {"database": "postgres", "schema": "public_iterable_dev", "name": "iterable__users", "resource_type": "model", "package_name": "iterable", "path": "iterable__users.sql", "original_file_path": "models/iterable__users.sql", "unique_id": "model.iterable.iterable__users", "fqn": ["iterable", "iterable__users"], "alias": "iterable__users", "checksum": {"name": "sha256", "checksum": "da23dacdef77d357083015551b25b1e1013e549ccea451e28820df44f3ac4f5a"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "table", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "Table that provides unique user enriched information.", "columns": {"source_relation": {"name": "source_relation", "description": "Identifies the record's source.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": ["doc.iterable.source_relation"]}, "unique_user_key": {"name": "unique_user_key", "description": "The unique identifier of the user. With the new schema (Aug 2023), it is the _fivetran_user_id. This is a hash of user_id and/or email, depending on project type. If using the old schema, it is email.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "_fivetran_user_id": {"name": "_fivetran_user_id", "description": "A Fivetran-created unique identifier for the new Iterable schema in Aug 2023, for users, derived from hashing user_id and/or email, depending on project type.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "email": {"name": "email", "description": "The user's email. User identifier, for email-based projects. Previously was the unique identifier for user records, for the old Iterable schema before the August 2023 updates.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "first_name": {"name": "first_name", "description": "First name of the user", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "last_name": {"name": "last_name", "description": "Last name of the user", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "user_id": {"name": "user_id", "description": "User identifier, for userID-based projects.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "signup_date": {"name": "signup_date", "description": "Timestamp of when the user signed up", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "signup_source": {"name": "signup_source", "description": "Source where the user signed up", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "updated_at": {"name": "updated_at", "description": "Last update timestamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "phone_number": {"name": "phone_number", "description": "Phone number associated with the user", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "email_list_ids": {"name": "email_list_ids", "description": "Array of all email lists associated with the user, derived from the list_user table relationships", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "count_lists": {"name": "count_lists", "description": "Total count of lists associated with the user", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "count_total_campaigns": {"name": "count_total_campaigns", "description": "Count of all campaigns the user has been in", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "first_event_at": {"name": "first_event_at", "description": "The first event the user ever encountered", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "last_event_at": {"name": "last_event_at", "description": "The most recent event the user has encountered", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_emailclick": {"name": "total_emailclick", "description": "Total number of email clicks the user has performed", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_emailunsubscribe": {"name": "total_emailunsubscribe", "description": "Total unsubscription events the user has performed", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_emailcomplaint": {"name": "total_emailcomplaint", "description": "Total email complaints the user has performed", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_customevent": {"name": "total_customevent", "description": "Total custom events associated with the user", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_emailsubscribe": {"name": "total_emailsubscribe", "description": "Total subscription events the user has performed", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_emailopen": {"name": "total_emailopen", "description": "Total email opened events the user has performed", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_pushsend": {"name": "total_pushsend", "description": "The push send events the user has experienced", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_smsbounce": {"name": "total_smsbounce", "description": "Total sms bounces that are associated with the user", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_pushbounce": {"name": "total_pushbounce", "description": "Total number of push bounces associated with the user", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_inappsendskip": {"name": "total_inappsendskip", "description": "Total in app send skips associated with the user", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_smssend": {"name": "total_smssend", "description": "Total sms sends that the user has experienced", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_inappsend": {"name": "total_inappsend", "description": "Total in app sends the user has experienced", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_pushopen": {"name": "total_pushopen", "description": "Total push messages the user has opened", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_emailsend": {"name": "total_emailsend", "description": "Total emails that have been sent to the user", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_pushsendskip": {"name": "total_pushsendskip", "description": "Total push sends the user has skipped", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_inappopen": {"name": "total_inappopen", "description": "Total in app opens the user has performed", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_emailsendskip": {"name": "total_emailsendskip", "description": "Total email sends the user has skipped", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_emailbounce": {"name": "total_emailbounce", "description": "Total number of emails that have bounced from the user", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_inappclick": {"name": "total_inappclick", "description": "Total in app clicks associated with the user", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_pushuninstall": {"name": "total_pushuninstall", "description": "Total push uninstall events the user has performed", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "iterable://models/iterable.yml", "build_path": null, "unrendered_config": {"materialized": "table", "schema": "iterable_{{ var('directed_schema','dev') }}", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1786586790.3892918, "relation_name": "\"postgres\".\"public_iterable_dev\".\"iterable__users\"", "raw_code": "{% set passthrough_column_count = var('iterable_user_history_pass_through_columns') | length %}\n\nwith user_event_metrics as (\n\n select *\n from {{ ref('int_iterable__user_event_metrics') }}\n\n), list_users as (\n\n select *\n from {{ ref('stg_iterable__list_user') }}\n order by list_id -- so the list ids will aggregate in the right order\n\n), list_user_aggregated as (\n\n select\n source_relation,\n _fivetran_user_id,\n count(*) as count_lists,\n {{ dbt.concat([\"'['\", fivetran_utils.string_agg(field_to_agg=\"cast(list_id as \" ~ dbt.type_string() ~ \")\", delimiter=\"','\"), \"']'\"]) }} as email_list_ids\n from list_users\n group by 1, 2 \n\n), user_history_unnest as (\n -- this has all the user fields we're looking to pass through\n\n select *\n from {{ ref('int_iterable__list_user_unnest') }}\n\n -- limit to current lists they are a member of. each list-user combo is a unique row, which we will roll up\n where is_current\n\n), user_with_list_metrics as (\n\n select\n source_relation,\n user_id,\n _fivetran_user_id,\n unique_user_key,\n email,\n first_name,\n last_name,\n signup_date,\n signup_source,\n updated_at,\n phone_number,\n email_list_ids\n\n --The below script allows for pass through columns.\n {{ fivetran_utils.persist_pass_through_columns(pass_through_variable='iterable_user_history_pass_through_columns') }}\n\n , count(distinct list_id) as count_lists\n\n from user_history_unnest\n -- roll up to the user\n {{ dbt_utils.group_by(n = 12 + passthrough_column_count) }}\n\n), user_join as (\n\n select\n user_with_list_metrics.source_relation,\n user_with_list_metrics.user_id,\n user_with_list_metrics._fivetran_user_id,\n user_with_list_metrics.unique_user_key,\n user_with_list_metrics.email,\n user_with_list_metrics.first_name,\n user_with_list_metrics.last_name,\n user_with_list_metrics.signup_date,\n user_with_list_metrics.signup_source,\n user_with_list_metrics.updated_at,\n user_with_list_metrics.phone_number,\n coalesce(list_user_aggregated.email_list_ids, user_with_list_metrics.email_list_ids, '[]') as email_list_ids,\n coalesce(list_user_aggregated.count_lists, user_with_list_metrics.count_lists, 0) as count_lists,\n {{ dbt_utils.star(from=ref('int_iterable__user_event_metrics'), except=['source_relation','unique_user_key','_fivetran_user_id','user_id','user_email']) }}\n {{ fivetran_utils.persist_pass_through_columns(pass_through_variable='iterable_user_history_pass_through_columns', identifier='user_with_list_metrics') }}\n\n from user_with_list_metrics\n left join user_event_metrics\n on user_with_list_metrics.unique_user_key = user_event_metrics.unique_user_key\n and user_with_list_metrics.source_relation = user_event_metrics.source_relation\n left join list_user_aggregated\n -- use _fivetran_user_id since in list_user it is a primary key\n on user_with_list_metrics._fivetran_user_id = list_user_aggregated._fivetran_user_id\n and user_with_list_metrics.source_relation = list_user_aggregated.source_relation\n)\n\nselect *\nfrom user_join", "doc_blocks": [], "language": "sql", "refs": [{"name": "int_iterable__user_event_metrics", "package": null, "version": null}, {"name": "stg_iterable__list_user", "package": null, "version": null}, {"name": "int_iterable__list_user_unnest", "package": null, "version": null}, {"name": "int_iterable__user_event_metrics", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.type_string", "macro.fivetran_utils.string_agg", "macro.dbt.concat", "macro.fivetran_utils.persist_pass_through_columns", "macro.dbt_utils.group_by", "macro.dbt_utils.star"], "nodes": ["model.iterable.int_iterable__user_event_metrics", "model.iterable.stg_iterable__list_user", "model.iterable.int_iterable__list_user_unnest"]}, "compiled_path": "target/compiled/iterable/models/iterable__users.sql", "compiled": true, "compiled_code": "\n\nwith user_event_metrics as (\n\n select *\n from \"postgres\".\"public_iterable_dev\".\"int_iterable__user_event_metrics\"\n\n), list_users as (\n\n select *\n from \"postgres\".\"public_iterable_dev\".\"stg_iterable__list_user\"\n order by list_id -- so the list ids will aggregate in the right order\n\n), list_user_aggregated as (\n\n select\n source_relation,\n _fivetran_user_id,\n count(*) as count_lists,\n '[' || \n string_agg(cast(list_id as TEXT), ',')\n\n || ']' as email_list_ids\n from list_users\n group by 1, 2 \n\n), user_history_unnest as (\n -- this has all the user fields we're looking to pass through\n\n select *\n from \"postgres\".\"public_iterable_dev\".\"int_iterable__list_user_unnest\"\n\n -- limit to current lists they are a member of. each list-user combo is a unique row, which we will roll up\n where is_current\n\n), user_with_list_metrics as (\n\n select\n source_relation,\n user_id,\n _fivetran_user_id,\n unique_user_key,\n email,\n first_name,\n last_name,\n signup_date,\n signup_source,\n updated_at,\n phone_number,\n email_list_ids\n\n --The below script allows for pass through columns.\n \n\n\n\n\n\n , count(distinct list_id) as count_lists\n\n from user_history_unnest\n -- roll up to the user\n group by 1,2,3,4,5,6,7,8,9,10,11,12\n\n), user_join as (\n\n select\n user_with_list_metrics.source_relation,\n user_with_list_metrics.user_id,\n user_with_list_metrics._fivetran_user_id,\n user_with_list_metrics.unique_user_key,\n user_with_list_metrics.email,\n user_with_list_metrics.first_name,\n user_with_list_metrics.last_name,\n user_with_list_metrics.signup_date,\n user_with_list_metrics.signup_source,\n user_with_list_metrics.updated_at,\n user_with_list_metrics.phone_number,\n coalesce(list_user_aggregated.email_list_ids, user_with_list_metrics.email_list_ids, '[]') as email_list_ids,\n coalesce(list_user_aggregated.count_lists, user_with_list_metrics.count_lists, 0) as count_lists,\n \"count_total_campaigns\",\n \"first_event_at\",\n \"last_event_at\",\n \"total_emailclick\",\n \"total_emailunsubscribe\",\n \"total_emailcomplaint\",\n \"total_customevent\",\n \"total_emailsubscribe\",\n \"total_emailopen\",\n \"total_pushsend\",\n \"total_smsbounce\",\n \"total_pushbounce\",\n \"total_inappsendskip\",\n \"total_smssend\",\n \"total_inappsend\",\n \"total_pushopen\",\n \"total_emailsend\",\n \"total_pushsendskip\",\n \"total_inappopen\",\n \"total_emailsendskip\",\n \"total_emailbounce\",\n \"total_inappclick\",\n \"total_pushuninstall\"\n \n\n\n\n\n\n from user_with_list_metrics\n left join user_event_metrics\n on user_with_list_metrics.unique_user_key = user_event_metrics.unique_user_key\n and user_with_list_metrics.source_relation = user_event_metrics.source_relation\n left join list_user_aggregated\n -- use _fivetran_user_id since in list_user it is a primary key\n on user_with_list_metrics._fivetran_user_id = list_user_aggregated._fivetran_user_id\n and user_with_list_metrics.source_relation = list_user_aggregated.source_relation\n)\n\nselect *\nfrom user_join", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.int_iterable__recurring_campaigns": {"database": "postgres", "schema": "public_iterable_dev", "name": "int_iterable__recurring_campaigns", "resource_type": "model", "package_name": "iterable", "path": "intermediate/int_iterable__recurring_campaigns.sql", "original_file_path": "models/intermediate/int_iterable__recurring_campaigns.sql", "unique_id": "model.iterable.int_iterable__recurring_campaigns", "fqn": ["iterable", "intermediate", "int_iterable__recurring_campaigns"], "alias": "int_iterable__recurring_campaigns", "checksum": {"name": "sha256", "checksum": "589faf86a2667651d3ec658dfeba20195d43872bb25839f5b31a344307d61bd6"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "Table that identifies when a campaign is associated with a recurring campaign and provides additional enriched recurring campaign information.", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "iterable://models/intermediate/int_iterable.yml", "build_path": null, "unrendered_config": {"materialized": "view", "schema": "iterable_{{ var('directed_schema','dev') }}", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1786586790.493317, "relation_name": "\"postgres\".\"public_iterable_dev\".\"int_iterable__recurring_campaigns\"", "raw_code": "with latest_campaign as (\n\n select * \n from {{ ref('int_iterable__latest_campaign') }}\n\n), recurring_campaign_join as (\n select\n latest_campaign.source_relation,\n latest_campaign.campaign_id,\n latest_campaign.campaign_name,\n latest_campaign.updated_at,\n latest_campaign.campaign_state,\n latest_campaign.campaign_type,\n latest_campaign.send_size,\n latest_campaign.start_at,\n latest_campaign.ended_at,\n latest_campaign.created_at,\n latest_campaign.created_by_user_id,\n latest_campaign.template_id,\n latest_campaign.recurring_campaign_id,\n\n recurring_campaign.campaign_name as recurring_campaign_name,\n recurring_campaign.campaign_state as recurring_campaign_state,\n recurring_campaign.send_size as recurring_campaign_send_size,\n recurring_campaign.start_at as recurring_campaign_start_at\n\n from latest_campaign\n\n left join latest_campaign as recurring_campaign\n on latest_campaign.recurring_campaign_id = recurring_campaign.campaign_id\n and latest_campaign.source_relation = recurring_campaign.source_relation\n\n), final as (\n\n select\n recurring_campaign_join.*,\n case when latest_campaign.recurring_campaign_id is not null then true \n else false end as is_campaign_recurring\n\n from recurring_campaign_join\n left join latest_campaign on recurring_campaign_join.campaign_id = latest_campaign.recurring_campaign_id\n and recurring_campaign_join.template_id = latest_campaign.template_id\n and recurring_campaign_join.source_relation = latest_campaign.source_relation\n)\n\nselect *\nfrom final", "doc_blocks": [], "language": "sql", "refs": [{"name": "int_iterable__latest_campaign", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": [], "nodes": ["model.iterable.int_iterable__latest_campaign"]}, "compiled_path": "target/compiled/iterable/models/intermediate/int_iterable__recurring_campaigns.sql", "compiled": true, "compiled_code": "with latest_campaign as (\n\n select * \n from \"postgres\".\"public_iterable_dev\".\"int_iterable__latest_campaign\"\n\n), recurring_campaign_join as (\n select\n latest_campaign.source_relation,\n latest_campaign.campaign_id,\n latest_campaign.campaign_name,\n latest_campaign.updated_at,\n latest_campaign.campaign_state,\n latest_campaign.campaign_type,\n latest_campaign.send_size,\n latest_campaign.start_at,\n latest_campaign.ended_at,\n latest_campaign.created_at,\n latest_campaign.created_by_user_id,\n latest_campaign.template_id,\n latest_campaign.recurring_campaign_id,\n\n recurring_campaign.campaign_name as recurring_campaign_name,\n recurring_campaign.campaign_state as recurring_campaign_state,\n recurring_campaign.send_size as recurring_campaign_send_size,\n recurring_campaign.start_at as recurring_campaign_start_at\n\n from latest_campaign\n\n left join latest_campaign as recurring_campaign\n on latest_campaign.recurring_campaign_id = recurring_campaign.campaign_id\n and latest_campaign.source_relation = recurring_campaign.source_relation\n\n), final as (\n\n select\n recurring_campaign_join.*,\n case when latest_campaign.recurring_campaign_id is not null then true \n else false end as is_campaign_recurring\n\n from recurring_campaign_join\n left join latest_campaign on recurring_campaign_join.campaign_id = latest_campaign.recurring_campaign_id\n and recurring_campaign_join.template_id = latest_campaign.template_id\n and recurring_campaign_join.source_relation = latest_campaign.source_relation\n)\n\nselect *\nfrom final", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.int_iterable__campaign_labels": {"database": "postgres", "schema": "public_iterable_dev", "name": "int_iterable__campaign_labels", "resource_type": "model", "package_name": "iterable", "path": "intermediate/int_iterable__campaign_labels.sql", "original_file_path": "models/intermediate/int_iterable__campaign_labels.sql", "unique_id": "model.iterable.int_iterable__campaign_labels", "fqn": ["iterable", "intermediate", "int_iterable__campaign_labels"], "alias": "int_iterable__campaign_labels", "checksum": {"name": "sha256", "checksum": "64ae8d410bd6673399326348a650a7facc7b6631aa34fbb01a1598cb96c7d012"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "Table that provides the distinct string aggregation of labels for each campaign.", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "iterable://models/intermediate/int_iterable.yml", "build_path": null, "unrendered_config": {"materialized": "view", "schema": "iterable_{{ var('directed_schema','dev') }}", "enabled": "var('iterable__using_campaign_label_history', True)", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1786586790.4896967, "relation_name": "\"postgres\".\"public_iterable_dev\".\"int_iterable__campaign_labels\"", "raw_code": "{{ config(enabled=var('iterable__using_campaign_label_history', True)) }}\n\nwith campaign_label_history as (\n\n select *\n from {{ ref('stg_iterable__campaign_label_history') }}\n\n), order_campaign_labels as (\n\n select \n *,\n rank() over(partition by campaign_id{{ fivetran_utils.partition_by_source_relation(package_name='iterable') }} order by updated_at desc) as latest_label_batch_index\n\n from campaign_label_history\n\n), latest_labels as (\n\n select *\n from order_campaign_labels\n where latest_label_batch_index = 1\n\n), aggregate_labels as (\n\n select\n source_relation,\n campaign_id,\n {{ fivetran_utils.string_agg('distinct label', \"', '\") }} as labels\n\n from latest_labels\n {{ dbt_utils.group_by(n=2) }}\n)\n\nselect * from aggregate_labels", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__campaign_label_history", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.fivetran_utils.partition_by_source_relation", "macro.fivetran_utils.string_agg", "macro.dbt_utils.group_by"], "nodes": ["model.iterable.stg_iterable__campaign_label_history"]}, "compiled_path": "target/compiled/iterable/models/intermediate/int_iterable__campaign_labels.sql", "compiled": true, "compiled_code": "\n\nwith campaign_label_history as (\n\n select *\n from \"postgres\".\"public_iterable_dev\".\"stg_iterable__campaign_label_history\"\n\n), order_campaign_labels as (\n\n select \n *,\n rank() over(partition by campaign_id order by updated_at desc) as latest_label_batch_index\n\n from campaign_label_history\n\n), latest_labels as (\n\n select *\n from order_campaign_labels\n where latest_label_batch_index = 1\n\n), aggregate_labels as (\n\n select\n source_relation,\n campaign_id,\n \n string_agg(distinct label, ', ')\n\n as labels\n\n from latest_labels\n group by 1,2\n)\n\nselect * from aggregate_labels", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.int_iterable__latest_campaign": {"database": "postgres", "schema": "public_iterable_dev", "name": "int_iterable__latest_campaign", "resource_type": "model", "package_name": "iterable", "path": "intermediate/int_iterable__latest_campaign.sql", "original_file_path": "models/intermediate/int_iterable__latest_campaign.sql", "unique_id": "model.iterable.int_iterable__latest_campaign", "fqn": ["iterable", "intermediate", "int_iterable__latest_campaign"], "alias": "int_iterable__latest_campaign", "checksum": {"name": "sha256", "checksum": "8063c9ccdfe6dee1694944607534fbb31bafe2856073ac2f5ea58aa513714e4f"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "Table that filters out historical versions of the campaign, and returns the most recent campaign version.", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "iterable://models/intermediate/int_iterable.yml", "build_path": null, "unrendered_config": {"materialized": "view", "schema": "iterable_{{ var('directed_schema','dev') }}", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1786586790.4906473, "relation_name": "\"postgres\".\"public_iterable_dev\".\"int_iterable__latest_campaign\"", "raw_code": "with campaign_history as (\n select *\n from {{ ref('stg_iterable__campaign_history') }}\n\n), latest_campaign as (\n select\n *,\n row_number() over(partition by campaign_id{{ fivetran_utils.partition_by_source_relation(package_name='iterable') }} order by updated_at desc) as latest_campaign_index\n from campaign_history\n)\n\nselect *\nfrom latest_campaign\nwhere latest_campaign_index = 1", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__campaign_history", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.fivetran_utils.partition_by_source_relation"], "nodes": ["model.iterable.stg_iterable__campaign_history"]}, "compiled_path": "target/compiled/iterable/models/intermediate/int_iterable__latest_campaign.sql", "compiled": true, "compiled_code": "with campaign_history as (\n select *\n from \"postgres\".\"public_iterable_dev\".\"stg_iterable__campaign_history\"\n\n), latest_campaign as (\n select\n *,\n row_number() over(partition by campaign_id order by updated_at desc) as latest_campaign_index\n from campaign_history\n)\n\nselect *\nfrom latest_campaign\nwhere latest_campaign_index = 1", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.int_iterable__message_type_channel": {"database": "postgres", "schema": "public_iterable_dev", "name": "int_iterable__message_type_channel", "resource_type": "model", "package_name": "iterable", "path": "intermediate/int_iterable__message_type_channel.sql", "original_file_path": "models/intermediate/int_iterable__message_type_channel.sql", "unique_id": "model.iterable.int_iterable__message_type_channel", "fqn": ["iterable", "intermediate", "int_iterable__message_type_channel"], "alias": "int_iterable__message_type_channel", "checksum": {"name": "sha256", "checksum": "9f54e0a46c508fbe16514b8e598ee614b3462649f85582b5513905f6392d728d"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "Table that joins the message type and channel records together into one comprehensive model to be referenced downstream.", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "iterable://models/intermediate/int_iterable.yml", "build_path": null, "unrendered_config": {"materialized": "view", "schema": "iterable_{{ var('directed_schema','dev') }}", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1786586790.4928691, "relation_name": "\"postgres\".\"public_iterable_dev\".\"int_iterable__message_type_channel\"", "raw_code": "with message_type as (\n\n select *\n from {{ ref('stg_iterable__message_type') }}\n\n), channel as (\n\n select *\n from {{ ref('stg_iterable__channel') }}\n\n), final as (\n\n select \n channel.*,\n message_type.message_type_name,\n message_type.message_type_id\n from channel\n left join message_type\n on channel.channel_id = message_type.channel_id\n and channel.source_relation = message_type.source_relation\n)\n\nselect *\nfrom final", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__message_type", "package": null, "version": null}, {"name": "stg_iterable__channel", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": [], "nodes": ["model.iterable.stg_iterable__message_type", "model.iterable.stg_iterable__channel"]}, "compiled_path": "target/compiled/iterable/models/intermediate/int_iterable__message_type_channel.sql", "compiled": true, "compiled_code": "with message_type as (\n\n select *\n from \"postgres\".\"public_iterable_dev\".\"stg_iterable__message_type\"\n\n), channel as (\n\n select *\n from \"postgres\".\"public_iterable_dev\".\"stg_iterable__channel\"\n\n), final as (\n\n select \n channel.*,\n message_type.message_type_name,\n message_type.message_type_id\n from channel\n left join message_type\n on channel.channel_id = message_type.channel_id\n and channel.source_relation = message_type.source_relation\n)\n\nselect *\nfrom final", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.int_iterable__campaign_lists": {"database": "postgres", "schema": "public_iterable_dev", "name": "int_iterable__campaign_lists", "resource_type": "model", "package_name": "iterable", "path": "intermediate/int_iterable__campaign_lists.sql", "original_file_path": "models/intermediate/int_iterable__campaign_lists.sql", "unique_id": "model.iterable.int_iterable__campaign_lists", "fqn": ["iterable", "intermediate", "int_iterable__campaign_lists"], "alias": "int_iterable__campaign_lists", "checksum": {"name": "sha256", "checksum": "33c167f12bf4fadb7316af985f2b60ee9989ade1a428d684037465d1a449685e"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "Table that identifies the suppressed and send lists associated with a campaign.", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "iterable://models/intermediate/int_iterable.yml", "build_path": null, "unrendered_config": {"materialized": "view", "schema": "iterable_{{ var('directed_schema','dev') }}", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1786586790.49019, "relation_name": "\"postgres\".\"public_iterable_dev\".\"int_iterable__campaign_lists\"", "raw_code": "with \n\n{% if var('iterable__using_campaign_suppression_list_history', True) %}\n\ncampaign_suppression_list_history as (\n\n select *\n from {{ ref('stg_iterable__campaign_suppression_list_history') }}\n\n), \n\n{% endif %}\n\ncampaign_send_list_history as (\n\n select *\n from {{ ref('stg_iterable__campaign_list_history') }}\n\n), combine_list_histories as (\n\n{% if var('iterable__using_campaign_suppression_list_history', True) %}\n\n select\n source_relation,\n suppressed_list_id as list_id,\n campaign_id,\n updated_at,\n 'suppress' as list_activity\n from campaign_suppression_list_history\n\n union all\n\n{% endif %}\n\n select\n source_relation,\n list_id,\n campaign_id,\n updated_at,\n 'send' as list_activity\n from campaign_send_list_history\n\n), order_campaign_list_history as (\n\n select\n *,\n row_number() over(partition by list_id, campaign_id{{ fivetran_utils.partition_by_source_relation(package_name='iterable') }} order by updated_at desc) as latest_list_index\n from combine_list_histories\n\n), latest_campaign_list_history as (\n\n select\n source_relation,\n list_id,\n campaign_id,\n updated_at,\n list_activity\n\n from order_campaign_list_history\n where latest_list_index = 1\n)\n\nselect *\nfrom latest_campaign_list_history", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__campaign_suppression_list_history", "package": null, "version": null}, {"name": "stg_iterable__campaign_list_history", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.fivetran_utils.partition_by_source_relation"], "nodes": ["model.iterable.stg_iterable__campaign_suppression_list_history", "model.iterable.stg_iterable__campaign_list_history"]}, "compiled_path": "target/compiled/iterable/models/intermediate/int_iterable__campaign_lists.sql", "compiled": true, "compiled_code": "with \n\n\n\ncampaign_suppression_list_history as (\n\n select *\n from \"postgres\".\"public_iterable_dev\".\"stg_iterable__campaign_suppression_list_history\"\n\n), \n\n\n\ncampaign_send_list_history as (\n\n select *\n from \"postgres\".\"public_iterable_dev\".\"stg_iterable__campaign_list_history\"\n\n), combine_list_histories as (\n\n\n\n select\n source_relation,\n suppressed_list_id as list_id,\n campaign_id,\n updated_at,\n 'suppress' as list_activity\n from campaign_suppression_list_history\n\n union all\n\n\n\n select\n source_relation,\n list_id,\n campaign_id,\n updated_at,\n 'send' as list_activity\n from campaign_send_list_history\n\n), order_campaign_list_history as (\n\n select\n *,\n row_number() over(partition by list_id, campaign_id order by updated_at desc) as latest_list_index\n from combine_list_histories\n\n), latest_campaign_list_history as (\n\n select\n source_relation,\n list_id,\n campaign_id,\n updated_at,\n list_activity\n\n from order_campaign_list_history\n where latest_list_index = 1\n)\n\nselect *\nfrom latest_campaign_list_history", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.int_iterable__latest_user": {"database": "postgres", "schema": "public_iterable_dev", "name": "int_iterable__latest_user", "resource_type": "model", "package_name": "iterable", "path": "intermediate/int_iterable__latest_user.sql", "original_file_path": "models/intermediate/int_iterable__latest_user.sql", "unique_id": "model.iterable.int_iterable__latest_user", "fqn": ["iterable", "intermediate", "int_iterable__latest_user"], "alias": "int_iterable__latest_user", "checksum": {"name": "sha256", "checksum": "580070cfbe396b904d0dc15669eefe5b9f017005d0aa91aa2c3d96b4e4686e81"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "Table that filters out historical versions of the user, and returns only the most recent version.", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "iterable://models/intermediate/int_iterable.yml", "build_path": null, "unrendered_config": {"materialized": "view", "schema": "iterable_{{ var('directed_schema','dev') }}", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1786586790.4915702, "relation_name": "\"postgres\".\"public_iterable_dev\".\"int_iterable__latest_user\"", "raw_code": "with user_history as (\n select *\n from {{ ref('stg_iterable__user_history') }}\n\n), latest_user as (\n select\n *,\n row_number() over(partition by unique_user_key{{ fivetran_utils.partition_by_source_relation(package_name='iterable') }} order by updated_at desc) as latest_user_index\n from user_history\n)\n\nselect *\nfrom latest_user\nwhere latest_user_index = 1", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__user_history", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.fivetran_utils.partition_by_source_relation"], "nodes": ["model.iterable.stg_iterable__user_history"]}, "compiled_path": "target/compiled/iterable/models/intermediate/int_iterable__latest_user.sql", "compiled": true, "compiled_code": "with user_history as (\n select *\n from \"postgres\".\"public_iterable_dev\".\"stg_iterable__user_history\"\n\n), latest_user as (\n select\n *,\n row_number() over(partition by unique_user_key order by updated_at desc) as latest_user_index\n from user_history\n)\n\nselect *\nfrom latest_user\nwhere latest_user_index = 1", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.int_iterable__list_user_history": {"database": "postgres", "schema": "public_iterable_dev", "name": "int_iterable__list_user_history", "resource_type": "model", "package_name": "iterable", "path": "intermediate/int_iterable__list_user_history.sql", "original_file_path": "models/intermediate/int_iterable__list_user_history.sql", "unique_id": "model.iterable.int_iterable__list_user_history", "fqn": ["iterable", "intermediate", "int_iterable__list_user_history"], "alias": "int_iterable__list_user_history", "checksum": {"name": "sha256", "checksum": "26b2bd189944dfea25bb63edf9e3da03a3e8169e3501b894716e8d1f8e1df5a0"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "table", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "Table that provides a history of all lists the user has been associated with.", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "iterable://models/intermediate/int_iterable.yml", "build_path": null, "unrendered_config": {"materialized": "table", "schema": "iterable_{{ var('directed_schema','dev') }}", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1786586790.4920216, "relation_name": "\"postgres\".\"public_iterable_dev\".\"int_iterable__list_user_history\"", "raw_code": "-- this model will serve to extract only email-list changes\nwith user_history as (\n\n select *\n from {{ ref('stg_iterable__user_history') }}\n\n), previous_email_list_ids as (\n\n select\n *,\n lag(email_list_ids) over(partition by unique_user_key{{ fivetran_utils.partition_by_source_relation(package_name='iterable') }} order by updated_at asc) as previous_ids -- partition by email instead of unique_user_key here since this model is only for email-list users\n\n from user_history\n\n), only_new_email_list_ids as (\n\n select\n source_relation,\n _fivetran_user_id,\n unique_user_key,\n user_id,\n email,\n first_name,\n last_name,\n email_list_ids,\n phone_number,\n signup_date,\n signup_source,\n updated_at\n\n --The below script allows for pass through columns.\n {{ fivetran_utils.persist_pass_through_columns(pass_through_variable='iterable_user_history_pass_through_columns', identifier='previous_email_list_ids') }}\n\n from previous_email_list_ids\n where email_list_ids != coalesce(previous_ids, 'this is new') -- list ids are always stored in their arrays in numerical order\n\n), most_recent_list_ids as (\n\n select\n *,\n row_number() over(partition by email{{ fivetran_utils.partition_by_source_relation(package_name='iterable') }} order by updated_at desc) as latest_user_index\n\n from only_new_email_list_ids\n\n), final as (\n\n select\n source_relation,\n _fivetran_user_id,\n unique_user_key,\n email,\n user_id,\n first_name,\n last_name,\n email_list_ids,\n phone_number,\n signup_date,\n signup_source,\n updated_at,\n latest_user_index = 1 as is_current\n\n --The below script allows for pass through columns.\n {{ fivetran_utils.persist_pass_through_columns(pass_through_variable='iterable_user_history_pass_through_columns', identifier='most_recent_list_ids') }}\n\n from most_recent_list_ids\n)\n\nselect * from final", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__user_history", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.fivetran_utils.partition_by_source_relation", "macro.fivetran_utils.persist_pass_through_columns"], "nodes": ["model.iterable.stg_iterable__user_history"]}, "compiled_path": "target/compiled/iterable/models/intermediate/int_iterable__list_user_history.sql", "compiled": true, "compiled_code": "-- this model will serve to extract only email-list changes\nwith user_history as (\n\n select *\n from \"postgres\".\"public_iterable_dev\".\"stg_iterable__user_history\"\n\n), previous_email_list_ids as (\n\n select\n *,\n lag(email_list_ids) over(partition by unique_user_key order by updated_at asc) as previous_ids -- partition by email instead of unique_user_key here since this model is only for email-list users\n\n from user_history\n\n), only_new_email_list_ids as (\n\n select\n source_relation,\n _fivetran_user_id,\n unique_user_key,\n user_id,\n email,\n first_name,\n last_name,\n email_list_ids,\n phone_number,\n signup_date,\n signup_source,\n updated_at\n\n --The below script allows for pass through columns.\n \n\n\n\n\n\n from previous_email_list_ids\n where email_list_ids != coalesce(previous_ids, 'this is new') -- list ids are always stored in their arrays in numerical order\n\n), most_recent_list_ids as (\n\n select\n *,\n row_number() over(partition by email order by updated_at desc) as latest_user_index\n\n from only_new_email_list_ids\n\n), final as (\n\n select\n source_relation,\n _fivetran_user_id,\n unique_user_key,\n email,\n user_id,\n first_name,\n last_name,\n email_list_ids,\n phone_number,\n signup_date,\n signup_source,\n updated_at,\n latest_user_index = 1 as is_current\n\n --The below script allows for pass through columns.\n \n\n\n\n\n\n from most_recent_list_ids\n)\n\nselect * from final", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.int_iterable__list_user_unnest": {"database": "postgres", "schema": "public_iterable_dev", "name": "int_iterable__list_user_unnest", "resource_type": "model", "package_name": "iterable", "path": "intermediate/int_iterable__list_user_unnest.sql", "original_file_path": "models/intermediate/int_iterable__list_user_unnest.sql", "unique_id": "model.iterable.int_iterable__list_user_unnest", "fqn": ["iterable", "intermediate", "int_iterable__list_user_unnest"], "alias": "int_iterable__list_user_unnest", "checksum": {"name": "sha256", "checksum": "82ec833586106f02efef7fe24516f3323171e61f1083323e97c892f21ddfa263"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "incremental", "incremental_strategy": "delete+insert", "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": "unique_key", "on_schema_change": "fail", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}, "partition_by": {"field": "date_day", "data_type": "date"}, "file_format": "delta"}, "tags": [], "description": "Table that unnests the `email_list_id` field for each user to create a new record for each user and the unique list it was associated with at a unique update. Due to the unnesting functions varying greatly between warehouses, conditional logic is applied throughout the model to appropriately accommodate the model being ran within Redshift, Snowflake, BigQuery, and Postgres.\n", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "iterable://models/intermediate/int_iterable.yml", "build_path": null, "unrendered_config": {"materialized": "incremental", "schema": "iterable_{{ var('directed_schema','dev') }}", "unique_key": "unique_key", "incremental_strategy": "CondExpr(test=Compare(expr=Getattr(node=Name(name='target', ctx='load'), attr='type', ctx='load'), ops=[Operand(op='in', expr=Tuple(items=[Const(value='bigquery'), Const(value='spark'), Const(value='databricks')], ctx='load'))]), expr1=Const(value='insert_overwrite'), expr2=Const(value='delete+insert'))", "partition_by": "CondExpr(test=Compare(expr=Getattr(node=Name(name='target', ctx='load'), attr='type', ctx='load'), ops=[Operand(op='notin', expr=Tuple(items=[Const(value='spark'), Const(value='databricks'), Const(value='duckdb')], ctx='load'))]), expr1=Dict(items=[Pair(key=Const(value='field'), value=Const(value='date_day')), Pair(key=Const(value='data_type'), value=Const(value='date'))]), expr2=List(items=[Const(value='date_day')]))", "file_format": "delta", "on_schema_change": "fail", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1786586790.492454, "relation_name": "\"postgres\".\"public_iterable_dev\".\"int_iterable__list_user_unnest\"", "raw_code": "{{ config(\n materialized='incremental',\n unique_key='unique_key',\n incremental_strategy='insert_overwrite' if target.type in ('bigquery', 'spark', 'databricks') else 'delete+insert',\n partition_by={\"field\": \"date_day\", \"data_type\": \"date\"} if target.type not in ('spark', 'databricks', 'duckdb') else ['date_day'],\n file_format='delta',\n on_schema_change='fail'\n )\n}}\n\nwith user_history as (\n\n select *\n from {{ ref('int_iterable__list_user_history') }} as user_history\n\n {% if is_incremental() %}\n {# the only rows we potentially want to overwrite are active ones #}\n where user_history.updated_at >= coalesce((select min(updated_at) from {{ this }} where is_current), '2010-01-01')\n {% endif %}\n\n{% if target.type == 'redshift' %}\n{# using PartiQL syntax to work with redshift's SUPER types #}\n), redshift_parse_email_lists as (\n\n select\n source_relation,\n _fivetran_user_id,\n unique_user_key,\n email,\n first_name,\n last_name,\n user_id,\n signup_date,\n signup_source,\n phone_number,\n updated_at,\n is_current,\n email_list_ids,\n {# let's not remove empty array-rows #}\n json_parse(case when email_list_ids = '[]' then '[\"is_null\"]' else email_list_ids end) as super_email_list_ids\n\n --The below script allows for pass through columns.\n {{ fivetran_utils.persist_pass_through_columns(pass_through_variable='iterable_user_history_pass_through_columns', identifier='user_history') }}\n\n from user_history\n\n), unnest_email_array as (\n\n select\n source_relation,\n _fivetran_user_id,\n unique_user_key,\n email,\n first_name,\n last_name,\n user_id,\n signup_date,\n signup_source,\n phone_number,\n updated_at,\n is_current,\n {# go back to strings #}\n cast(email_list_ids as {{ dbt.type_string() }}) as email_list_ids,\n cast(email_list_id as {{ dbt.type_string() }}) as email_list_id\n\n --The below script allows for pass through columns.\n {{ fivetran_utils.persist_pass_through_columns(pass_through_variable='iterable_user_history_pass_through_columns', identifier='emails') }}\n\n from redshift_parse_email_lists as emails, emails.super_email_list_ids as email_list_id\n\n{% else %}\n), unnest_email_array as (\n\n select\n source_relation,\n _fivetran_user_id,\n unique_user_key,\n email,\n first_name,\n last_name,\n user_id,\n signup_date,\n signup_source,\n phone_number,\n updated_at,\n is_current,\n email_list_ids,\n case when email_list_ids != '[]' then\n {% if target.type == 'snowflake' %}\n email_list_id.value\n {% elif target.type in ('spark','databricks') %}\n email_list_id.col\n {% else %} email_list_id {% endif %}\n else null\n end as email_list_id\n\n --The below script allows for pass through columns.\n {{ fivetran_utils.persist_pass_through_columns(pass_through_variable='iterable_user_history_pass_through_columns', identifier='user_history') }}\n\n from user_history\n\n {% if target.type == 'snowflake' %}\n cross join\n table(flatten(input => parse_json(\n case when email_list_ids = '[]' then '[\"is_null\"]' {# to not remove empty array-rows #}\n else email_list_ids end))) as email_list_id\n {% elif target.type == 'bigquery' %}\n cross join\n unnest(JSON_EXTRACT_STRING_ARRAY(\n case when email_list_ids = '[]' then '[\"is_null\"]' {# to not remove empty array-rows #}\n else email_list_ids end)) as email_list_id\n {% elif target.type in ('spark','databricks') %}\n cross join\n lateral explode_outer(from_json(\n case when email_list_ids = '[]' then '[\"is_null\"]' {# to not remove empty array-rows #}\n else email_list_ids end, 'array')) as email_list_id\n {% elif target.type == 'duckdb' %}\n cross join\n unnest(from_json(cast((\n case when email_list_ids = '[]' then '[\"is_null\"]' {# to not remove empty array-rows #}\n else email_list_ids end) as varchar), '[\"VARCHAR\"]')) as t(email_list_id)\n {% else %} {# target is postgres #}\n cross join\n json_array_elements_text(cast((\n case when email_list_ids = '[]' then '[\"is_null\"]' {# to not remove empty array-rows #}\n else email_list_ids end) as json)) as email_list_id\n {%- endif %}\n\n{%- endif -%}\n), adjust_nulls as (\n\n select\n source_relation,\n _fivetran_user_id,\n unique_user_key,\n email,\n first_name,\n last_name,\n user_id,\n signup_date,\n signup_source,\n updated_at,\n phone_number,\n is_current,\n case when email_list_ids = '[\"is_null\"]' then '[]' else email_list_ids end as email_list_ids,\n cast(NULLIF(email_list_id, 'is_null') as {{ dbt.type_int() }}) as list_id\n\n --The below script allows for pass through columns.\n {{ fivetran_utils.persist_pass_through_columns(pass_through_variable='iterable_user_history_pass_through_columns', identifier='unnest_email_array') }}\n\n from unnest_email_array\n\n), final as (\n\n select\n source_relation,\n _fivetran_user_id,\n unique_user_key,\n user_id,\n email,\n first_name,\n last_name,\n signup_date,\n signup_source,\n updated_at,\n phone_number,\n is_current,\n email_list_ids,\n list_id,\n {{ dbt_utils.generate_surrogate_key([\"source_relation\", \"unique_user_key\", \"list_id\", \"updated_at\"]) }} as unique_key,\n cast( {{ dbt.date_trunc('day', 'updated_at') }} as date) as date_day\n\n --The below script allows for pass through columns.\n {{ fivetran_utils.persist_pass_through_columns(pass_through_variable='iterable_user_history_pass_through_columns', identifier='adjust_nulls') }}\n\n from adjust_nulls\n)\n\nselect *\nfrom final", "doc_blocks": [], "language": "sql", "refs": [{"name": "int_iterable__list_user_history", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.is_incremental", "macro.fivetran_utils.persist_pass_through_columns", "macro.dbt.type_int", "macro.dbt_utils.generate_surrogate_key", "macro.dbt.date_trunc"], "nodes": ["model.iterable.int_iterable__list_user_history"]}, "compiled_path": "target/compiled/iterable/models/intermediate/int_iterable__list_user_unnest.sql", "compiled": true, "compiled_code": "\n\nwith user_history as (\n\n select *\n from \"postgres\".\"public_iterable_dev\".\"int_iterable__list_user_history\" as user_history\n\n \n \n where user_history.updated_at >= coalesce((select min(updated_at) from \"postgres\".\"public_iterable_dev\".\"int_iterable__list_user_unnest\" where is_current), '2010-01-01')\n \n\n\n), unnest_email_array as (\n\n select\n source_relation,\n _fivetran_user_id,\n unique_user_key,\n email,\n first_name,\n last_name,\n user_id,\n signup_date,\n signup_source,\n phone_number,\n updated_at,\n is_current,\n email_list_ids,\n case when email_list_ids != '[]' then\n email_list_id \n else null\n end as email_list_id\n\n --The below script allows for pass through columns.\n \n\n\n\n\n\n from user_history\n\n \n cross join\n json_array_elements_text(cast((\n case when email_list_ids = '[]' then '[\"is_null\"]' \n else email_list_ids end) as json)) as email_list_id), adjust_nulls as (\n\n select\n source_relation,\n _fivetran_user_id,\n unique_user_key,\n email,\n first_name,\n last_name,\n user_id,\n signup_date,\n signup_source,\n updated_at,\n phone_number,\n is_current,\n case when email_list_ids = '[\"is_null\"]' then '[]' else email_list_ids end as email_list_ids,\n cast(NULLIF(email_list_id, 'is_null') as integer) as list_id\n\n --The below script allows for pass through columns.\n \n\n\n\n\n\n from unnest_email_array\n\n), final as (\n\n select\n source_relation,\n _fivetran_user_id,\n unique_user_key,\n user_id,\n email,\n first_name,\n last_name,\n signup_date,\n signup_source,\n updated_at,\n phone_number,\n is_current,\n email_list_ids,\n list_id,\n md5(cast(coalesce(cast(source_relation as TEXT), '_dbt_utils_surrogate_key_null_') || '-' || coalesce(cast(unique_user_key as TEXT), '_dbt_utils_surrogate_key_null_') || '-' || coalesce(cast(list_id as TEXT), '_dbt_utils_surrogate_key_null_') || '-' || coalesce(cast(updated_at as TEXT), '_dbt_utils_surrogate_key_null_') as TEXT)) as unique_key,\n cast( date_trunc('day', updated_at) as date) as date_day\n\n --The below script allows for pass through columns.\n \n\n\n\n\n\n from adjust_nulls\n)\n\nselect *\nfrom final", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.int_iterable__latest_template": {"database": "postgres", "schema": "public_iterable_dev", "name": "int_iterable__latest_template", "resource_type": "model", "package_name": "iterable", "path": "intermediate/int_iterable__latest_template.sql", "original_file_path": "models/intermediate/int_iterable__latest_template.sql", "unique_id": "model.iterable.int_iterable__latest_template", "fqn": ["iterable", "intermediate", "int_iterable__latest_template"], "alias": "int_iterable__latest_template", "checksum": {"name": "sha256", "checksum": "44d385d803b47bd9be4b5bfc6d78b88689e9c113d478ba8feb96f91717f45b3b"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "Table that provides the most recent version of the template as well as joining relevant message type information.", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "iterable://models/intermediate/int_iterable.yml", "build_path": null, "unrendered_config": {"materialized": "view", "schema": "iterable_{{ var('directed_schema','dev') }}", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1786586790.4911194, "relation_name": "\"postgres\".\"public_iterable_dev\".\"int_iterable__latest_template\"", "raw_code": "with template_history as (\n select *\n from {{ ref('stg_iterable__template_history') }}\n\n), order_template as (\n select\n *,\n row_number() over(partition by template_id{{ fivetran_utils.partition_by_source_relation(package_name='iterable') }} order by updated_at desc) as latest_template_index\n from template_history\n\n), latest_template as (\n\n select *\n from order_template\n where latest_template_index = 1\n\n), message_type_channel as (\n\n select *\n from {{ ref('int_iterable__message_type_channel') }}\n\n), template_join as (\n\n select \n latest_template.*,\n message_type_channel.message_type_name,\n message_type_channel.channel_id,\n message_type_channel.channel_name,\n message_type_channel.channel_type,\n message_type_channel.message_medium\n\n from latest_template \n left join message_type_channel\n on latest_template.message_type_id = message_type_channel.message_type_id\n and latest_template.source_relation = message_type_channel.source_relation\n)\n\nselect *\nfrom template_join", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__template_history", "package": null, "version": null}, {"name": "int_iterable__message_type_channel", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.fivetran_utils.partition_by_source_relation"], "nodes": ["model.iterable.stg_iterable__template_history", "model.iterable.int_iterable__message_type_channel"]}, "compiled_path": "target/compiled/iterable/models/intermediate/int_iterable__latest_template.sql", "compiled": true, "compiled_code": "with template_history as (\n select *\n from \"postgres\".\"public_iterable_dev\".\"stg_iterable__template_history\"\n\n), order_template as (\n select\n *,\n row_number() over(partition by template_id order by updated_at desc) as latest_template_index\n from template_history\n\n), latest_template as (\n\n select *\n from order_template\n where latest_template_index = 1\n\n), message_type_channel as (\n\n select *\n from \"postgres\".\"public_iterable_dev\".\"int_iterable__message_type_channel\"\n\n), template_join as (\n\n select \n latest_template.*,\n message_type_channel.message_type_name,\n message_type_channel.channel_id,\n message_type_channel.channel_name,\n message_type_channel.channel_type,\n message_type_channel.message_medium\n\n from latest_template \n left join message_type_channel\n on latest_template.message_type_id = message_type_channel.message_type_id\n and latest_template.source_relation = message_type_channel.source_relation\n)\n\nselect *\nfrom template_join", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.int_iterable__user_event_metrics": {"database": "postgres", "schema": "public_iterable_dev", "name": "int_iterable__user_event_metrics", "resource_type": "model", "package_name": "iterable", "path": "intermediate/int_iterable__user_event_metrics.sql", "original_file_path": "models/intermediate/int_iterable__user_event_metrics.sql", "unique_id": "model.iterable.int_iterable__user_event_metrics", "fqn": ["iterable", "intermediate", "int_iterable__user_event_metrics"], "alias": "int_iterable__user_event_metrics", "checksum": {"name": "sha256", "checksum": "56af49e00fd9cad13663d8bf802187ff1d12561fb1fd9d3732d182703b34ca4d"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "Table that generates user aggregations at the campaign level.", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "iterable://models/intermediate/int_iterable.yml", "build_path": null, "unrendered_config": {"materialized": "view", "schema": "iterable_{{ var('directed_schema','dev') }}", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1786586790.4937367, "relation_name": "\"postgres\".\"public_iterable_dev\".\"int_iterable__user_event_metrics\"", "raw_code": "with user_campaign as (\n\n select *\n from {{ ref('iterable__user_campaign') }}\n\n), user_event_metrics as (\n\n{%- set user_campaign_columns = adapter.get_columns_in_relation(ref('iterable__user_campaign')) %}\n{%- set non_agg_columns = ['source_relation', 'unique_user_key', 'user_id', '_fivetran_user_id', \n 'user_email', 'user_full_name', 'campaign_id', 'campaign_name', 'recurring_campaign_id', \n 'recurring_campaign_name', 'first_event_at', 'last_event_at', 'template_id', 'template_name', \n 'experiment_id', 'unique_user_campaign_id', 'first_open_or_click_event_at'\n ] %}\n\n select\n source_relation,\n _fivetran_user_id,\n unique_user_key,\n user_id,\n user_email,\n count(distinct campaign_id) as count_total_campaigns,\n min(first_event_at) as first_event_at,\n max(last_event_at) as last_event_at\n\n {% for col in user_campaign_columns if col.name|lower not in non_agg_columns %}\n , sum({{ col.name }}) as {{ col.name }}\n {% endfor %}\n\n from user_campaign\n {{ dbt_utils.group_by(n=5) }}\n\n)\n\nselect *\nfrom user_event_metrics", "doc_blocks": [], "language": "sql", "refs": [{"name": "iterable__user_campaign", "package": null, "version": null}, {"name": "iterable__user_campaign", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt_utils.group_by"], "nodes": ["model.iterable.iterable__user_campaign"]}, "compiled_path": "target/compiled/iterable/models/intermediate/int_iterable__user_event_metrics.sql", "compiled": true, "compiled_code": "with user_campaign as (\n\n select *\n from \"postgres\".\"public_iterable_dev\".\"iterable__user_campaign\"\n\n), user_event_metrics as (\n\n select\n source_relation,\n _fivetran_user_id,\n unique_user_key,\n user_id,\n user_email,\n count(distinct campaign_id) as count_total_campaigns,\n min(first_event_at) as first_event_at,\n max(last_event_at) as last_event_at\n\n \n , sum(total_emailclick) as total_emailclick\n \n , sum(total_emailunsubscribe) as total_emailunsubscribe\n \n , sum(total_emailcomplaint) as total_emailcomplaint\n \n , sum(total_customevent) as total_customevent\n \n , sum(total_emailsubscribe) as total_emailsubscribe\n \n , sum(total_emailopen) as total_emailopen\n \n , sum(total_pushsend) as total_pushsend\n \n , sum(total_smsbounce) as total_smsbounce\n \n , sum(total_pushbounce) as total_pushbounce\n \n , sum(total_inappsendskip) as total_inappsendskip\n \n , sum(total_smssend) as total_smssend\n \n , sum(total_inappsend) as total_inappsend\n \n , sum(total_pushopen) as total_pushopen\n \n , sum(total_emailsend) as total_emailsend\n \n , sum(total_pushsendskip) as total_pushsendskip\n \n , sum(total_inappopen) as total_inappopen\n \n , sum(total_emailsendskip) as total_emailsendskip\n \n , sum(total_emailbounce) as total_emailbounce\n \n , sum(total_inappclick) as total_inappclick\n \n , sum(total_pushuninstall) as total_pushuninstall\n \n\n from user_campaign\n group by 1,2,3,4,5\n\n)\n\nselect *\nfrom user_event_metrics", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.int_iterable__campaign_event_metrics": {"database": "postgres", "schema": "public_iterable_dev", "name": "int_iterable__campaign_event_metrics", "resource_type": "model", "package_name": "iterable", "path": "intermediate/int_iterable__campaign_event_metrics.sql", "original_file_path": "models/intermediate/int_iterable__campaign_event_metrics.sql", "unique_id": "model.iterable.int_iterable__campaign_event_metrics", "fqn": ["iterable", "intermediate", "int_iterable__campaign_event_metrics"], "alias": "int_iterable__campaign_event_metrics", "checksum": {"name": "sha256", "checksum": "81038e93b6f7f8151fb0d719780a87ebc5bd95b613431564e7c470121a174e26"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "Table that generates relevant total and unique campaign/experiment level aggregations.", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "iterable://models/intermediate/int_iterable.yml", "build_path": null, "unrendered_config": {"materialized": "view", "schema": "iterable_{{ var('directed_schema','dev') }}", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1786586790.4891937, "relation_name": "\"postgres\".\"public_iterable_dev\".\"int_iterable__campaign_event_metrics\"", "raw_code": "with user_campaign as (\n select *\n from {{ ref('iterable__user_campaign') }}\n\n), campaign_user_event_metrics as (\n{%- set using_event_extension = var('iterable__using_event_extension', True) %}\n{%- set user_campaign_columns = adapter.get_columns_in_relation(ref('iterable__user_campaign')) %}\n{%- set non_agg_columns = ['source_relation', 'unique_user_key', 'user_id', '_fivetran_user_id', \n 'user_email', 'user_full_name', 'campaign_id', 'campaign_name', 'recurring_campaign_id', \n 'recurring_campaign_name', 'first_event_at', 'last_event_at', 'template_id', 'template_name', \n 'experiment_id', 'unique_user_campaign_id', 'first_open_or_click_event_at'\n ] %}\n\n select\n source_relation,\n campaign_id,\n template_id\n {{ \", experiment_id\" if using_event_extension }}\n , count(distinct unique_user_key) as count_unique_users\n {% for col in user_campaign_columns if col.name|lower not in non_agg_columns %}\n , sum({{ col.name }}) as {{ col.name }}\n , count(distinct case when {{ col.name }} > 0 then user_email else null end) as unique_{{ col.name }}\n {% endfor %}\n \n from user_campaign\n \n {{ dbt_utils.group_by(n=4 if using_event_extension else 3) }}\n)\n\nselect *\nfrom campaign_user_event_metrics", "doc_blocks": [], "language": "sql", "refs": [{"name": "iterable__user_campaign", "package": null, "version": null}, {"name": "iterable__user_campaign", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt_utils.group_by"], "nodes": ["model.iterable.iterable__user_campaign"]}, "compiled_path": "target/compiled/iterable/models/intermediate/int_iterable__campaign_event_metrics.sql", "compiled": true, "compiled_code": "with user_campaign as (\n select *\n from \"postgres\".\"public_iterable_dev\".\"iterable__user_campaign\"\n\n), campaign_user_event_metrics as (\n\n select\n source_relation,\n campaign_id,\n template_id\n , experiment_id\n , count(distinct unique_user_key) as count_unique_users\n \n , sum(total_emailclick) as total_emailclick\n , count(distinct case when total_emailclick > 0 then user_email else null end) as unique_total_emailclick\n \n , sum(total_emailunsubscribe) as total_emailunsubscribe\n , count(distinct case when total_emailunsubscribe > 0 then user_email else null end) as unique_total_emailunsubscribe\n \n , sum(total_emailcomplaint) as total_emailcomplaint\n , count(distinct case when total_emailcomplaint > 0 then user_email else null end) as unique_total_emailcomplaint\n \n , sum(total_customevent) as total_customevent\n , count(distinct case when total_customevent > 0 then user_email else null end) as unique_total_customevent\n \n , sum(total_emailsubscribe) as total_emailsubscribe\n , count(distinct case when total_emailsubscribe > 0 then user_email else null end) as unique_total_emailsubscribe\n \n , sum(total_emailopen) as total_emailopen\n , count(distinct case when total_emailopen > 0 then user_email else null end) as unique_total_emailopen\n \n , sum(total_pushsend) as total_pushsend\n , count(distinct case when total_pushsend > 0 then user_email else null end) as unique_total_pushsend\n \n , sum(total_smsbounce) as total_smsbounce\n , count(distinct case when total_smsbounce > 0 then user_email else null end) as unique_total_smsbounce\n \n , sum(total_pushbounce) as total_pushbounce\n , count(distinct case when total_pushbounce > 0 then user_email else null end) as unique_total_pushbounce\n \n , sum(total_inappsendskip) as total_inappsendskip\n , count(distinct case when total_inappsendskip > 0 then user_email else null end) as unique_total_inappsendskip\n \n , sum(total_smssend) as total_smssend\n , count(distinct case when total_smssend > 0 then user_email else null end) as unique_total_smssend\n \n , sum(total_inappsend) as total_inappsend\n , count(distinct case when total_inappsend > 0 then user_email else null end) as unique_total_inappsend\n \n , sum(total_pushopen) as total_pushopen\n , count(distinct case when total_pushopen > 0 then user_email else null end) as unique_total_pushopen\n \n , sum(total_emailsend) as total_emailsend\n , count(distinct case when total_emailsend > 0 then user_email else null end) as unique_total_emailsend\n \n , sum(total_pushsendskip) as total_pushsendskip\n , count(distinct case when total_pushsendskip > 0 then user_email else null end) as unique_total_pushsendskip\n \n , sum(total_inappopen) as total_inappopen\n , count(distinct case when total_inappopen > 0 then user_email else null end) as unique_total_inappopen\n \n , sum(total_emailsendskip) as total_emailsendskip\n , count(distinct case when total_emailsendskip > 0 then user_email else null end) as unique_total_emailsendskip\n \n , sum(total_emailbounce) as total_emailbounce\n , count(distinct case when total_emailbounce > 0 then user_email else null end) as unique_total_emailbounce\n \n , sum(total_inappclick) as total_inappclick\n , count(distinct case when total_inappclick > 0 then user_email else null end) as unique_total_inappclick\n \n , sum(total_pushuninstall) as total_pushuninstall\n , count(distinct case when total_pushuninstall > 0 then user_email else null end) as unique_total_pushuninstall\n \n \n from user_campaign\n \n group by 1,2,3,4\n)\n\nselect *\nfrom campaign_user_event_metrics", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.stg_iterable__campaign_suppression_list_history": {"database": "postgres", "schema": "public_iterable_dev", "name": "stg_iterable__campaign_suppression_list_history", "resource_type": "model", "package_name": "iterable", "path": "staging/stg_iterable__campaign_suppression_list_history.sql", "original_file_path": "models/staging/stg_iterable__campaign_suppression_list_history.sql", "unique_id": "model.iterable.stg_iterable__campaign_suppression_list_history", "fqn": ["iterable", "staging", "stg_iterable__campaign_suppression_list_history"], "alias": "stg_iterable__campaign_suppression_list_history", "checksum": {"name": "sha256", "checksum": "695d57ff7cf14d55ef6881ee9184e873c2cdc7fd61bfd9fbb0cb3330fe055ae0"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "table", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "Table containing a history of suppression lists.", "columns": {"source_relation": {"name": "source_relation", "description": "Identifies the record's source.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": ["doc.iterable.source_relation"]}, "campaign_id": {"name": "campaign_id", "description": "Reference to the campaign associated with the label", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "suppressed_list_id": {"name": "suppressed_list_id", "description": "Reference to the list used", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "updated_at": {"name": "updated_at", "description": "Last update timestamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "The time when a record was last updated by Fivetran.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": ["doc.iterable._fivetran_synced"]}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "iterable://models/staging/stg_iterable.yml", "build_path": null, "unrendered_config": {"materialized": "table", "schema": "iterable_{{ var('directed_schema','dev') }}", "enabled": "var('iterable__using_campaign_suppression_list_history', True)", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1786586790.6453803, "relation_name": "\"postgres\".\"public_iterable_dev\".\"stg_iterable__campaign_suppression_list_history\"", "raw_code": "{{ config(enabled=var('iterable__using_campaign_suppression_list_history', True)) }}\n\nwith base as (\n\n select * \n from {{ ref('stg_iterable__campaign_suppression_list_history_tmp') }}\n\n),\n\nfields as (\n\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_iterable/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_iterable/macros/).\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_iterable__campaign_suppression_list_history_tmp')),\n staging_columns=get_campaign_suppression_list_history_columns()\n )\n }}\n {{ fivetran_utils.apply_source_relation(package_name='iterable') }}\n\n from base\n),\n\nfinal as (\n\n select\n source_relation,\n cast(campaign_id as {{ dbt.type_string() }}) as campaign_id,\n cast(suppressed_list_id as {{ dbt.type_string() }}) as suppressed_list_id,\n updated_at,\n _fivetran_synced\n from fields\n)\n\nselect * \nfrom final", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__campaign_suppression_list_history_tmp", "package": null, "version": null}, {"name": "stg_iterable__campaign_suppression_list_history_tmp", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.iterable.get_campaign_suppression_list_history_columns", "macro.fivetran_utils.fill_staging_columns", "macro.fivetran_utils.apply_source_relation", "macro.dbt.type_string"], "nodes": ["model.iterable.stg_iterable__campaign_suppression_list_history_tmp"]}, "compiled_path": "target/compiled/iterable/models/staging/stg_iterable__campaign_suppression_list_history.sql", "compiled": true, "compiled_code": "\n\nwith base as (\n\n select * \n from \"postgres\".\"public_iterable_dev\".\"stg_iterable__campaign_suppression_list_history_tmp\"\n\n),\n\nfields as (\n\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_iterable/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_iterable/macros/).\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n \n _fivetran_synced as _fivetran_synced,\n campaign_id as campaign_id,\n suppressed_list_id as suppressed_list_id,\n updated_at as updated_at\n \n\n\n\n\n \n \n\n\n\n\n\n, cast('postgres.public' as TEXT) as source_relation\n\n\n from base\n),\n\nfinal as (\n\n select\n source_relation,\n cast(campaign_id as TEXT) as campaign_id,\n cast(suppressed_list_id as TEXT) as suppressed_list_id,\n updated_at,\n _fivetran_synced\n from fields\n)\n\nselect * \nfrom final", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.stg_iterable__list_user": {"database": "postgres", "schema": "public_iterable_dev", "name": "stg_iterable__list_user", "resource_type": "model", "package_name": "iterable", "path": "staging/stg_iterable__list_user.sql", "original_file_path": "models/staging/stg_iterable__list_user.sql", "unique_id": "model.iterable.stg_iterable__list_user", "fqn": ["iterable", "staging", "stg_iterable__list_user"], "alias": "stg_iterable__list_user", "checksum": {"name": "sha256", "checksum": "f3fe66e05562725c91948ac2023c649573560043aa82c03fe93f6232f6600954"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "table", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "Table containing the relationship between users and lists they belong to.", "columns": {"source_relation": {"name": "source_relation", "description": "Identifies the record's source.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": ["doc.iterable.source_relation"]}, "_fivetran_user_id": {"name": "_fivetran_user_id", "description": "Unique identifier of the list-user relationship record, serving as a foreign key to `stg_iterable__user_history._fivetran_id`.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "list_user_index": {"name": "list_user_index", "description": "Index of the record", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "list_id": {"name": "list_id", "description": "Reference to the list that the user belongs to", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "The time when a record was last updated by Fivetran.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": ["doc.iterable._fivetran_synced"]}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "iterable://models/staging/stg_iterable.yml", "build_path": null, "unrendered_config": {"materialized": "table", "schema": "iterable_{{ var('directed_schema','dev') }}", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1786586790.6565273, "relation_name": "\"postgres\".\"public_iterable_dev\".\"stg_iterable__list_user\"", "raw_code": "{% set source_columns_in_relation = adapter.get_columns_in_relation(ref('stg_iterable__list_user_tmp')) %}\n\nwith base as (\n\n select *\n from {{ ref('stg_iterable__list_user_tmp') }}\n\n),\n\nfields as (\n\n select\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=source_columns_in_relation,\n staging_columns=get_list_user_columns()\n )\n }}\n {{ fivetran_utils.apply_source_relation(package_name='iterable') }}\n\n from base\n),\n\nfinal as (\n\n select\n source_relation,\n cast(_fivetran_id as {{ dbt.type_string() }} ) as _fivetran_user_id,\n index as list_user_index,\n list_id,\n _fivetran_synced\n\n from fields\n)\n\nselect *\nfrom final", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__list_user_tmp", "package": null, "version": null}, {"name": "stg_iterable__list_user_tmp", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.iterable.get_list_user_columns", "macro.fivetran_utils.fill_staging_columns", "macro.fivetran_utils.apply_source_relation", "macro.dbt.type_string"], "nodes": ["model.iterable.stg_iterable__list_user_tmp"]}, "compiled_path": "target/compiled/iterable/models/staging/stg_iterable__list_user.sql", "compiled": true, "compiled_code": "\n\nwith base as (\n\n select *\n from \"postgres\".\"public_iterable_dev\".\"stg_iterable__list_user_tmp\"\n\n),\n\nfields as (\n\n select\n \n _fivetran_id as _fivetran_id,\n _fivetran_synced as _fivetran_synced,\n index as index,\n list_id as list_id\n \n\n\n\n\n \n \n\n\n\n\n\n, cast('postgres.public' as TEXT) as source_relation\n\n\n from base\n),\n\nfinal as (\n\n select\n source_relation,\n cast(_fivetran_id as TEXT ) as _fivetran_user_id,\n index as list_user_index,\n list_id,\n _fivetran_synced\n\n from fields\n)\n\nselect *\nfrom final", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.stg_iterable__campaign_history": {"database": "postgres", "schema": "public_iterable_dev", "name": "stg_iterable__campaign_history", "resource_type": "model", "package_name": "iterable", "path": "staging/stg_iterable__campaign_history.sql", "original_file_path": "models/staging/stg_iterable__campaign_history.sql", "unique_id": "model.iterable.stg_iterable__campaign_history", "fqn": ["iterable", "staging", "stg_iterable__campaign_history"], "alias": "stg_iterable__campaign_history", "checksum": {"name": "sha256", "checksum": "7e7aecc134f0b697da58c7cd663aadf6de586a55c84369c2a7274811b2bb368b"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "table", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "Table containing a history of campaigns.", "columns": {"source_relation": {"name": "source_relation", "description": "Identifies the record's source.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": ["doc.iterable.source_relation"]}, "campaign_id": {"name": "campaign_id", "description": "Unique identifier of the campaign record", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "updated_at": {"name": "updated_at", "description": "Last update timestamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "campaign_name": {"name": "campaign_name", "description": "User defined name of the campaign.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "campaign_state": {"name": "campaign_state", "description": "State of the campaign. Can be Draft, Ready, Scheduled, Running, Finished, Starting, Aborted or Recurring", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "campaign_type": {"name": "campaign_type", "description": "The campaign type. Can be Blast or Triggered", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "send_size": {"name": "send_size", "description": "Size of the campaign. Number of individuals included in the campaign", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "start_at": {"name": "start_at", "description": "Start timestamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "ended_at": {"name": "ended_at", "description": "Ended timestamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "created_at": {"name": "created_at", "description": "Creation timestamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "recurring_campaign_id": {"name": "recurring_campaign_id", "description": "Reference to the recurring campaign, if applicable", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "created_by_user_id": {"name": "created_by_user_id", "description": "Reference to the user who created the campaign", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "template_id": {"name": "template_id", "description": "Reference to the campaign template", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "updated_by_user_id": {"name": "updated_by_user_id", "description": "ID of the user who updated this record", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "message_medium": {"name": "message_medium", "description": "The medium that this message was sent via, for example Email or InApp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "workflow_id": {"name": "workflow_id", "description": "Reference to the workflow which the event originated", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "The time when a record was last updated by Fivetran.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": ["doc.iterable._fivetran_synced"]}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "iterable://models/staging/stg_iterable.yml", "build_path": null, "unrendered_config": {"materialized": "table", "schema": "iterable_{{ var('directed_schema','dev') }}", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1786586790.6429503, "relation_name": "\"postgres\".\"public_iterable_dev\".\"stg_iterable__campaign_history\"", "raw_code": "with base as (\n\n select * \n from {{ ref('stg_iterable__campaign_history_tmp') }}\n\n),\n\nfields as (\n\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_iterable/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_iterable/macros/).\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_iterable__campaign_history_tmp')),\n staging_columns=get_campaign_history_columns()\n )\n }}\n {{ fivetran_utils.apply_source_relation(package_name='iterable') }}\n \n from base\n),\n\nfinal as (\n\n select\n source_relation,\n cast(id as {{ dbt.type_string() }}) as campaign_id,\n updated_at,\n name as campaign_name,\n campaign_state,\n type as campaign_type,\n send_size,\n start_at,\n ended_at,\n created_at,\n message_medium,\n cast(recurring_campaign_id as {{ dbt.type_string() }}) as recurring_campaign_id,\n cast(created_by_user_id as {{ dbt.type_string() }} ) as created_by_user_id,\n cast(updated_by_user_id as {{ dbt.type_string() }} ) as updated_by_user_id,\n cast(template_id as {{ dbt.type_string() }}) as template_id,\n workflow_id,\n _fivetran_synced\n\n from fields\n)\n\nselect * \nfrom final", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__campaign_history_tmp", "package": null, "version": null}, {"name": "stg_iterable__campaign_history_tmp", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.iterable.get_campaign_history_columns", "macro.fivetran_utils.fill_staging_columns", "macro.fivetran_utils.apply_source_relation", "macro.dbt.type_string"], "nodes": ["model.iterable.stg_iterable__campaign_history_tmp"]}, "compiled_path": "target/compiled/iterable/models/staging/stg_iterable__campaign_history.sql", "compiled": true, "compiled_code": "with base as (\n\n select * \n from \"postgres\".\"public_iterable_dev\".\"stg_iterable__campaign_history_tmp\"\n\n),\n\nfields as (\n\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_iterable/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_iterable/macros/).\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n \n _fivetran_synced as _fivetran_synced,\n campaign_state as campaign_state,\n created_at as created_at,\n created_by_user_id as created_by_user_id,\n updated_by_user_id as updated_by_user_id,\n ended_at as ended_at,\n id as id,\n name as name,\n recurring_campaign_id as recurring_campaign_id,\n send_size as send_size,\n start_at as start_at,\n template_id as template_id,\n type as type,\n updated_at as updated_at,\n workflow_id as workflow_id,\n message_medium as message_medium\n \n\n\n\n\n \n \n\n\n\n\n\n, cast('postgres.public' as TEXT) as source_relation\n\n \n from base\n),\n\nfinal as (\n\n select\n source_relation,\n cast(id as TEXT) as campaign_id,\n updated_at,\n name as campaign_name,\n campaign_state,\n type as campaign_type,\n send_size,\n start_at,\n ended_at,\n created_at,\n message_medium,\n cast(recurring_campaign_id as TEXT) as recurring_campaign_id,\n cast(created_by_user_id as TEXT ) as created_by_user_id,\n cast(updated_by_user_id as TEXT ) as updated_by_user_id,\n cast(template_id as TEXT) as template_id,\n workflow_id,\n _fivetran_synced\n\n from fields\n)\n\nselect * \nfrom final", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.stg_iterable__user_history": {"database": "postgres", "schema": "public_iterable_dev", "name": "stg_iterable__user_history", "resource_type": "model", "package_name": "iterable", "path": "staging/stg_iterable__user_history.sql", "original_file_path": "models/staging/stg_iterable__user_history.sql", "unique_id": "model.iterable.stg_iterable__user_history", "fqn": ["iterable", "staging", "stg_iterable__user_history"], "alias": "stg_iterable__user_history", "checksum": {"name": "sha256", "checksum": "632b1ddaf71b0cb861ae314c40c6a68a25371b8646d2fa2334c4eb7149227251"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "Table containing individual user history information.", "columns": {"source_relation": {"name": "source_relation", "description": "Identifies the record's source.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": ["doc.iterable.source_relation"]}, "unique_user_key": {"name": "unique_user_key", "description": "The unique identifier of the user. With the new schema (Aug 2023), it is the _fivetran_user_id. This is a hash of user_id and/or email, depending on project type. If using the old schema, it is email.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "email": {"name": "email", "description": "The user's email. User identifier, for email-based projects. Previously was the unique identifier for user records, for the old Iterable schema before the August 2023 updates.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "user_id": {"name": "user_id", "description": "User identifier, for userID-based projects.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "first_name": {"name": "first_name", "description": "First name of the user", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "last_name": {"name": "last_name", "description": "Last name of the user", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "email_list_ids": {"name": "email_list_ids", "description": "[DEPRECATED October 13, 2025. Use LIST_USER source instead.] Array of references to the lists associated with the user.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "signup_date": {"name": "signup_date", "description": "Timestamp of when the user signed up", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "signup_source": {"name": "signup_source", "description": "Source where the user signed up", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "updated_at": {"name": "updated_at", "description": "Last update timestamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "phone_number": {"name": "phone_number", "description": "Phone number associated with the user", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "iterable_user_id": {"name": "iterable_user_id", "description": "Another user identifier, for userID-based projects", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "_fivetran_user_id": {"name": "_fivetran_user_id", "description": "A Fivetran-created unique identifier for users, derived from hashing user_id and/or email, depending on project type. This exists for users of the new schema starting Aug 2023. In the old schema, the unique identifier is email.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "The time when a record was last updated by Fivetran.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": ["doc.iterable._fivetran_synced"]}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "iterable://models/staging/stg_iterable.yml", "build_path": null, "unrendered_config": {"materialized": "view", "schema": "iterable_{{ var('directed_schema','dev') }}", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1786586790.657664, "relation_name": "\"postgres\".\"public_iterable_dev\".\"stg_iterable__user_history\"", "raw_code": "{{ config(materialized='view') }}\n{% set source_columns_in_relation = adapter.get_columns_in_relation(ref('stg_iterable__user_history_tmp')) %}\n\n\nwith base as (\n\n select * \n from {{ ref('stg_iterable__user_history_tmp') }}\n\n),\n\nfields as (\n\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_iterable/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_iterable/macros/).\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=source_columns_in_relation,\n staging_columns=get_user_history_columns()\n )\n }}\n {{ fivetran_utils.apply_source_relation(package_name='iterable') }}\n\n from base\n),\n\nfinal as (\n\n select\n source_relation,\n cast(_fivetran_id as {{ dbt.type_string() }} ) as _fivetran_user_id,\n lower(email) as email,\n updated_at,\n cast(user_id as {{ dbt.type_string() }} ) as user_id,\n first_name,\n last_name,\n {{ iterable.json_to_string(\"email_list_ids\", source_columns_in_relation) }} as email_list_ids,\n phone_number,\n signup_date,\n signup_source,\n cast(iterable_user_id as {{ dbt.type_string() }} ) as iterable_user_id,\n _fivetran_synced,\n coalesce(cast(_fivetran_id as {{ dbt.type_string() }} ) , email) as unique_user_key\n\n {{ fivetran_utils.fill_pass_through_columns('iterable_user_history_pass_through_columns') }}\n\n from fields\n)\n\nselect *\nfrom final", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__user_history_tmp", "package": null, "version": null}, {"name": "stg_iterable__user_history_tmp", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.iterable.get_user_history_columns", "macro.fivetran_utils.fill_staging_columns", "macro.fivetran_utils.apply_source_relation", "macro.dbt.type_string", "macro.iterable.json_to_string", "macro.fivetran_utils.fill_pass_through_columns"], "nodes": ["model.iterable.stg_iterable__user_history_tmp"]}, "compiled_path": "target/compiled/iterable/models/staging/stg_iterable__user_history.sql", "compiled": true, "compiled_code": "\n\n\n\nwith base as (\n\n select * \n from \"postgres\".\"public_iterable_dev\".\"stg_iterable__user_history_tmp\"\n\n),\n\nfields as (\n\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_iterable/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_iterable/macros/).\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n \n cast(null as TEXT) as _fivetran_id,\n _fivetran_synced as _fivetran_synced,\n email as email,\n email_list_ids as email_list_ids,\n first_name as first_name,\n last_name as last_name,\n phone_number as phone_number,\n signup_date as signup_date,\n signup_source as signup_source,\n updated_at as updated_at,\n user_id as user_id,\n iterable_user_id as iterable_user_id\n \n\n\n\n\n \n \n\n\n\n\n\n, cast('postgres.public' as TEXT) as source_relation\n\n\n from base\n),\n\nfinal as (\n\n select\n source_relation,\n cast(_fivetran_id as TEXT ) as _fivetran_user_id,\n lower(email) as email,\n updated_at,\n cast(user_id as TEXT ) as user_id,\n first_name,\n last_name,\n cast(email_list_ids as TEXT) as email_list_ids,\n phone_number,\n signup_date,\n signup_source,\n cast(iterable_user_id as TEXT ) as iterable_user_id,\n _fivetran_synced,\n coalesce(cast(_fivetran_id as TEXT ) , email) as unique_user_key\n\n \n\n\n\n\n\n from fields\n)\n\nselect *\nfrom final", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.stg_iterable__user_unsub_message_type": {"database": "postgres", "schema": "public_iterable_dev", "name": "stg_iterable__user_unsub_message_type", "resource_type": "model", "package_name": "iterable", "path": "staging/stg_iterable__user_unsub_message_type.sql", "original_file_path": "models/staging/stg_iterable__user_unsub_message_type.sql", "unique_id": "model.iterable.stg_iterable__user_unsub_message_type", "fqn": ["iterable", "staging", "stg_iterable__user_unsub_message_type"], "alias": "stg_iterable__user_unsub_message_type", "checksum": {"name": "sha256", "checksum": "82bd48604365ec4a7a3309f2ce007e169add2c902675e5d1da155edc32a6bb71"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "table", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "Table containing the message types from which a user has unsubscribed. \"Unsubscribed\" is shortened to \"unsub\" for postgres compatibility.", "columns": {"source_relation": {"name": "source_relation", "description": "Identifies the record's source.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": ["doc.iterable.source_relation"]}, "message_type_id": {"name": "message_type_id", "description": "Reference to the message type from which the user unsubscribed", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unsub_message_type_unique_key": {"name": "unsub_message_type_unique_key", "description": "A surrogate key providing a unique key for each record. If using user_unsubscribed_message_type_history, it uses '_fivetran_id', 'email', 'message_type_id', 'updated_at', and 'source_relation'. If not using the history table, it uses '_fivetran_id', 'message_type_id', and 'source_relation'.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "_fivetran_user_id": {"name": "_fivetran_user_id", "description": "A Fivetran-created unique identifier for users, derived from hashing user_id and/or email, depending on project type. This exists for users of the new schema starting Aug 2023. In the old schema, the unique identifier is email.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_user_key": {"name": "unique_user_key", "description": "The unique identifier of the user. With the new schema (Aug 2023), it is the _fivetran_user_id. This is a hash of user_id and/or email, depending on project type. If using the old schema, it is email.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "latest_batch_index": {"name": "latest_batch_index", "description": "Indexes each user record based on the most recent available.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "updated_at": {"name": "updated_at", "description": "Last update timestamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "The time when a record was last updated by Fivetran.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": ["doc.iterable._fivetran_synced"]}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "iterable://models/staging/stg_iterable.yml", "build_path": null, "unrendered_config": {"materialized": "table", "schema": "iterable_{{ var('directed_schema','dev') }}", "enabled": "var('iterable__using_user_unsubscribed_message_type', True)", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1786586790.6604953, "relation_name": "\"postgres\".\"public_iterable_dev\".\"stg_iterable__user_unsub_message_type\"", "raw_code": "{{ config(enabled=var('iterable__using_user_unsubscribed_message_type', True)) }}\n\nwith base as (\n\n select * \n from {{ ref('stg_iterable__user_unsub_message_type_tmp') }}\n\n),\n\nfields as (\n\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_iterable/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_iterable/macros/).\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_iterable__user_unsub_message_type_tmp')),\n staging_columns=get_user_unsubscribed_message_type_columns()\n )\n }}\n {{ fivetran_utils.apply_source_relation(package_name='iterable') }}\n\n from base\n),\n\nfinal as (\n\n select\n source_relation,\n cast(_fivetran_id as {{ dbt.type_string() }} ) as _fivetran_user_id,\n coalesce(cast(_fivetran_id as {{ dbt.type_string() }} ), email) as unique_user_key,\n cast(message_type_id as {{ dbt.type_string() }} ) as message_type_id,\n {{ dbt_utils.generate_surrogate_key(['_fivetran_id', 'email', 'message_type_id','updated_at','source_relation']) }} as unsub_message_type_unique_key,\n\n {% if does_table_exist('user_unsubscribed_message_type') == false %}\n rank() over(partition by email, message_type_id{{ fivetran_utils.partition_by_source_relation(package_name='iterable') }} order by updated_at desc) as latest_batch_index,\n {% else %}\n 1 as latest_batch_index,\n {% endif %}\n\n updated_at,\n _fivetran_synced\n\n from fields\n)\n\nselect *\nfrom final", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__user_unsub_message_type_tmp", "package": null, "version": null}, {"name": "stg_iterable__user_unsub_message_type_tmp", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.iterable.get_user_unsubscribed_message_type_columns", "macro.fivetran_utils.fill_staging_columns", "macro.fivetran_utils.apply_source_relation", "macro.dbt.type_string", "macro.dbt_utils.generate_surrogate_key", "macro.iterable.does_table_exist"], "nodes": ["model.iterable.stg_iterable__user_unsub_message_type_tmp"]}, "compiled_path": "target/compiled/iterable/models/staging/stg_iterable__user_unsub_message_type.sql", "compiled": true, "compiled_code": "\n\nwith base as (\n\n select * \n from \"postgres\".\"public_iterable_dev\".\"stg_iterable__user_unsub_message_type_tmp\"\n\n),\n\nfields as (\n\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_iterable/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_iterable/macros/).\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n \n _fivetran_synced as _fivetran_synced,\n _fivetran_id as _fivetran_id,\n message_type_id as message_type_id,\n cast(null as TEXT) as email,\n cast(null as timestamp) as updated_at\n \n\n\n\n\n \n \n\n\n\n\n\n, cast('postgres.public' as TEXT) as source_relation\n\n\n from base\n),\n\nfinal as (\n\n select\n source_relation,\n cast(_fivetran_id as TEXT ) as _fivetran_user_id,\n coalesce(cast(_fivetran_id as TEXT ), email) as unique_user_key,\n cast(message_type_id as TEXT ) as message_type_id,\n md5(cast(coalesce(cast(_fivetran_id as TEXT), '_dbt_utils_surrogate_key_null_') || '-' || coalesce(cast(email as TEXT), '_dbt_utils_surrogate_key_null_') || '-' || coalesce(cast(message_type_id as TEXT), '_dbt_utils_surrogate_key_null_') || '-' || coalesce(cast(updated_at as TEXT), '_dbt_utils_surrogate_key_null_') || '-' || coalesce(cast(source_relation as TEXT), '_dbt_utils_surrogate_key_null_') as TEXT)) as unsub_message_type_unique_key,\n\n \n 1 as latest_batch_index,\n \n\n updated_at,\n _fivetran_synced\n\n from fields\n)\n\nselect *\nfrom final", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.stg_iterable__user_unsubscribed_channel": {"database": "postgres", "schema": "public_iterable_dev", "name": "stg_iterable__user_unsubscribed_channel", "resource_type": "model", "package_name": "iterable", "path": "staging/stg_iterable__user_unsubscribed_channel.sql", "original_file_path": "models/staging/stg_iterable__user_unsubscribed_channel.sql", "unique_id": "model.iterable.stg_iterable__user_unsubscribed_channel", "fqn": ["iterable", "staging", "stg_iterable__user_unsubscribed_channel"], "alias": "stg_iterable__user_unsubscribed_channel", "checksum": {"name": "sha256", "checksum": "5c639597d14f4bb7072df74e39c2b8aaa7bf1e29c6204243035014d14a0bc6f2"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "table", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "Table containing the history of channels from which a user has unsubscribed.", "columns": {"source_relation": {"name": "source_relation", "description": "Identifies the record's source.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": ["doc.iterable.source_relation"]}, "channel_id": {"name": "channel_id", "description": "Reference to the channel from which the user unsubscribed", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unsub_channel_unique_key": {"name": "unsub_channel_unique_key", "description": "A surrogate key providing a unique key for each record. If using user_unsubscribed_channel_history, it uses '_fivetran_id', 'channel_id', 'email', 'updated_at', and 'source_relation'. If not using the history table, it uses '_fivetran_id', 'channel_id', and 'source_relation'.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "_fivetran_user_id": {"name": "_fivetran_user_id", "description": "A Fivetran-created unique identifier for users, derived from hashing user_id and/or email, depending on project type. This exists for users of the new schema starting Aug 2023. In the old schema, the unique identifier is email.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_user_key": {"name": "unique_user_key", "description": "The unique identifier of the user. With the new schema (Aug 2023), it is the _fivetran_user_id. This is a hash of user_id and/or email, depending on project type. If using the old schema, it is email.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "latest_batch_index": {"name": "latest_batch_index", "description": "Indexes each user record based on the most recent available.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "updated_at": {"name": "updated_at", "description": "Last update timestamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "The time when a record was last updated by Fivetran.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": ["doc.iterable._fivetran_synced"]}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "iterable://models/staging/stg_iterable.yml", "build_path": null, "unrendered_config": {"materialized": "table", "schema": "iterable_{{ var('directed_schema','dev') }}", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1786586790.6592135, "relation_name": "\"postgres\".\"public_iterable_dev\".\"stg_iterable__user_unsubscribed_channel\"", "raw_code": "with base as (\n select *\n from {{ ref('stg_iterable__user_unsubscribed_channel_tmp') }}\n\n),\n\nfields as (\n\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_iterable/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_iterable/macros/).\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_iterable__user_unsubscribed_channel_tmp')),\n staging_columns=get_user_unsubscribed_channel_columns()\n )\n }}\n {{ fivetran_utils.apply_source_relation(package_name='iterable') }}\n\n from base\n),\n\nfinal as (\n\n select\n source_relation,\n cast(_fivetran_id as {{ dbt.type_string() }} ) as _fivetran_user_id,\n coalesce(cast(_fivetran_id as {{ dbt.type_string() }} ), email) as unique_user_key,\n cast(channel_id as {{ dbt.type_string() }} ) as channel_id,\n {{ dbt_utils.generate_surrogate_key(['_fivetran_id', 'channel_id', 'email', 'updated_at', 'source_relation']) }} as unsub_channel_unique_key,\n\n {% if does_table_exist('user_unsubscribed_channel') == false %}\n rank() over(partition by email, channel_id{{ fivetran_utils.partition_by_source_relation(package_name='iterable') }} order by updated_at desc) as latest_batch_index,\n {% else %}\n 1 as latest_batch_index,\n {% endif %}\n\n updated_at,\n _fivetran_synced\n\n from fields\n)\n\n\nselect *\nfrom final", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__user_unsubscribed_channel_tmp", "package": null, "version": null}, {"name": "stg_iterable__user_unsubscribed_channel_tmp", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.iterable.get_user_unsubscribed_channel_columns", "macro.fivetran_utils.fill_staging_columns", "macro.fivetran_utils.apply_source_relation", "macro.dbt.type_string", "macro.dbt_utils.generate_surrogate_key", "macro.iterable.does_table_exist"], "nodes": ["model.iterable.stg_iterable__user_unsubscribed_channel_tmp"]}, "compiled_path": "target/compiled/iterable/models/staging/stg_iterable__user_unsubscribed_channel.sql", "compiled": true, "compiled_code": "with base as (\n select *\n from \"postgres\".\"public_iterable_dev\".\"stg_iterable__user_unsubscribed_channel_tmp\"\n\n),\n\nfields as (\n\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_iterable/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_iterable/macros/).\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n \n _fivetran_synced as _fivetran_synced,\n _fivetran_id as _fivetran_id,\n channel_id as channel_id,\n cast(null as TEXT) as email,\n cast(null as timestamp) as updated_at\n \n\n\n\n\n \n \n\n\n\n\n\n, cast('postgres.public' as TEXT) as source_relation\n\n\n from base\n),\n\nfinal as (\n\n select\n source_relation,\n cast(_fivetran_id as TEXT ) as _fivetran_user_id,\n coalesce(cast(_fivetran_id as TEXT ), email) as unique_user_key,\n cast(channel_id as TEXT ) as channel_id,\n md5(cast(coalesce(cast(_fivetran_id as TEXT), '_dbt_utils_surrogate_key_null_') || '-' || coalesce(cast(channel_id as TEXT), '_dbt_utils_surrogate_key_null_') || '-' || coalesce(cast(email as TEXT), '_dbt_utils_surrogate_key_null_') || '-' || coalesce(cast(updated_at as TEXT), '_dbt_utils_surrogate_key_null_') || '-' || coalesce(cast(source_relation as TEXT), '_dbt_utils_surrogate_key_null_') as TEXT)) as unsub_channel_unique_key,\n\n \n 1 as latest_batch_index,\n \n\n updated_at,\n _fivetran_synced\n\n from fields\n)\n\n\nselect *\nfrom final", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.stg_iterable__campaign_list_history": {"database": "postgres", "schema": "public_iterable_dev", "name": "stg_iterable__campaign_list_history", "resource_type": "model", "package_name": "iterable", "path": "staging/stg_iterable__campaign_list_history.sql", "original_file_path": "models/staging/stg_iterable__campaign_list_history.sql", "unique_id": "model.iterable.stg_iterable__campaign_list_history", "fqn": ["iterable", "staging", "stg_iterable__campaign_list_history"], "alias": "stg_iterable__campaign_list_history", "checksum": {"name": "sha256", "checksum": "c7db9c46a66fec00d9fbd6492c0ea17397ec80a12d85fa2d63b9f04f09c45013"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "table", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "Table containing a history of lists.", "columns": {"source_relation": {"name": "source_relation", "description": "Identifies the record's source.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": ["doc.iterable.source_relation"]}, "campaign_id": {"name": "campaign_id", "description": "Reference to the campaign associated with the label", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "list_id": {"name": "list_id", "description": "Reference to the list used", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "updated_at": {"name": "updated_at", "description": "Last update timestamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "The time when a record was last updated by Fivetran.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": ["doc.iterable._fivetran_synced"]}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "iterable://models/staging/stg_iterable.yml", "build_path": null, "unrendered_config": {"materialized": "table", "schema": "iterable_{{ var('directed_schema','dev') }}", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1786586790.6445863, "relation_name": "\"postgres\".\"public_iterable_dev\".\"stg_iterable__campaign_list_history\"", "raw_code": "with base as (\n\n select * \n from {{ ref('stg_iterable__campaign_list_history_tmp') }}\n\n),\n\nfields as (\n\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_iterable/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_iterable/macros/).\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_iterable__campaign_list_history_tmp')),\n staging_columns=get_campaign_list_history_columns()\n )\n }}\n {{ fivetran_utils.apply_source_relation(package_name='iterable') }}\n \n from base\n),\n\nfinal as (\n\n select\n source_relation,\n cast(campaign_id as {{ dbt.type_string() }}) as campaign_id,\n cast(list_id as {{ dbt.type_string() }}) as list_id,\n updated_at,\n _fivetran_synced\n from fields\n)\n\nselect * \nfrom final", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__campaign_list_history_tmp", "package": null, "version": null}, {"name": "stg_iterable__campaign_list_history_tmp", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.iterable.get_campaign_list_history_columns", "macro.fivetran_utils.fill_staging_columns", "macro.fivetran_utils.apply_source_relation", "macro.dbt.type_string"], "nodes": ["model.iterable.stg_iterable__campaign_list_history_tmp"]}, "compiled_path": "target/compiled/iterable/models/staging/stg_iterable__campaign_list_history.sql", "compiled": true, "compiled_code": "with base as (\n\n select * \n from \"postgres\".\"public_iterable_dev\".\"stg_iterable__campaign_list_history_tmp\"\n\n),\n\nfields as (\n\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_iterable/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_iterable/macros/).\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n \n _fivetran_synced as _fivetran_synced,\n campaign_id as campaign_id,\n list_id as list_id,\n updated_at as updated_at\n \n\n\n\n\n \n \n\n\n\n\n\n, cast('postgres.public' as TEXT) as source_relation\n\n \n from base\n),\n\nfinal as (\n\n select\n source_relation,\n cast(campaign_id as TEXT) as campaign_id,\n cast(list_id as TEXT) as list_id,\n updated_at,\n _fivetran_synced\n from fields\n)\n\nselect * \nfrom final", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.stg_iterable__event_extension": {"database": "postgres", "schema": "public_iterable_dev", "name": "stg_iterable__event_extension", "resource_type": "model", "package_name": "iterable", "path": "staging/stg_iterable__event_extension.sql", "original_file_path": "models/staging/stg_iterable__event_extension.sql", "unique_id": "model.iterable.stg_iterable__event_extension", "fqn": ["iterable", "staging", "stg_iterable__event_extension"], "alias": "stg_iterable__event_extension", "checksum": {"name": "sha256", "checksum": "006d3abf1fe12ef7312b3f02d07a13a483883e57acfe0fceedb3e6a9f71372ff"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "Table containing addition properties from the event table.", "columns": {"source_relation": {"name": "source_relation", "description": "Identifies the record's source.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": ["doc.iterable.source_relation"]}, "event_id": {"name": "event_id", "description": "A Fivetran-created unique identifier derived from hashing campaign_id, created_at, and event_name.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_event_id": {"name": "unique_event_id", "description": "A surrogate key made up of event_id, _fivetran_user_id, and source_relation.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "is_app_already_running": {"name": "is_app_already_running", "description": "Boolean indicating if the app is currently running or not", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "badge": {"name": "badge", "description": "Badge associated with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "canonical_url_id": {"name": "canonical_url_id", "description": "Reference to the url associated with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "is_content_available": {"name": "is_content_available", "description": "Content available from the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "content_id": {"name": "content_id", "description": "Reference to the content associated with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "device": {"name": "device", "description": "The device associated with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "email_id": {"name": "email_id", "description": "Reference to the email associated with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "email_subject": {"name": "email_subject", "description": "Subject of the email associated with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "experiment_id": {"name": "experiment_id", "description": "Reference to the experiment used if the event is an experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "from_phone_number_id": {"name": "from_phone_number_id", "description": "Reference to the phone number which the event is from", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "from_smssender_id": {"name": "from_smssender_id", "description": "Reference to the sms sender which the event is from", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "link_id": {"name": "link_id", "description": "Reference to the link associated with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "link_url": {"name": "link_url", "description": "Url of the link associated with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "locale": {"name": "locale", "description": "Locale associated with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "payload": {"name": "payload", "description": "Payload resulted from the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "platform_endpoint": {"name": "platform_endpoint", "description": "The specific platform endpoint of the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "push_message": {"name": "push_message", "description": "Boolean indicating if the event is a push message", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "region": {"name": "region", "description": "Region of the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "sms_message": {"name": "sms_message", "description": "Boolean indicating if the event is an sms message", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "to_phone_number": {"name": "to_phone_number", "description": "To phone number associated with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "url": {"name": "url", "description": "Url associated with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "workflow_id": {"name": "workflow_id", "description": "Reference to the workflow which the event originated", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "workflow_name": {"name": "workflow_name", "description": "Name of the workflow which the event originated", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "catalog_collection_count": {"name": "catalog_collection_count", "description": "The count of products or items collected in a catalog associated with the event.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "catalog_lookup_count": {"name": "catalog_lookup_count", "description": "The count of times a catalog was looked up or queried during the event.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "city": {"name": "city", "description": "The city associated with the event, which could be the location of the recipient.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "clicked_url": {"name": "clicked_url", "description": "The URL that was clicked by the recipient in response to the marketing message.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "country": {"name": "country", "description": "The country associated with the event, which could be the location of the recipient.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "error_code": {"name": "error_code", "description": "The error code or message indicating any issues or errors encountered during the event.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "expires_at": {"name": "expires_at", "description": "The date and time when the event or message is set to expire or become invalid.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "from_phone_number": {"name": "from_phone_number", "description": "The phone number from which the SMS message was sent.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "in_app_body": {"name": "in_app_body", "description": "The content or body of an in-app message that was sent as part of the event.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "is_sms_estimation": {"name": "is_sms_estimation", "description": "A boolean indicating whether the SMS message is an estimation or not.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "labels": {"name": "labels", "description": "Any labels or tags associated with the event, which can be used for categorization or organization.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "message_status": {"name": "message_status", "description": "The status of the marketing message, such as sent, delivered, opened, etc.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "mms_send_count": {"name": "mms_send_count", "description": "The count of multimedia messages (MMS) sent as part of the event.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "reason": {"name": "reason", "description": "The reason or cause associated with a specific event or action.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "sms_send_count": {"name": "sms_send_count", "description": "The count of SMS messages sent as part of the event.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "_fivetran_user_id": {"name": "_fivetran_user_id", "description": "A Fivetran-created unique identifier for users, derived from hashing user_id and/or email, depending on project type. This exists for users of the new schema starting Aug 2023. In the old schema, the unique identifier is email.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "The time when a record was last updated by Fivetran.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": ["doc.iterable._fivetran_synced"]}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "iterable://models/staging/stg_iterable.yml", "build_path": null, "unrendered_config": {"materialized": "view", "schema": "iterable_{{ var('directed_schema','dev') }}", "enabled": "var('iterable__using_event_extension', True)", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1786586790.6514714, "relation_name": "\"postgres\".\"public_iterable_dev\".\"stg_iterable__event_extension\"", "raw_code": "{{ config(\n enabled=var('iterable__using_event_extension', True),\n materialized='view'\n) }}\n\nwith base as (\n\n select * \n from {{ ref('stg_iterable__event_extension_tmp') }}\n\n),\n\nfields as (\n\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_iterable/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_iterable/macros/).\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_iterable__event_extension_tmp')),\n staging_columns=get_event_extension_columns()\n )\n }}\n {{ fivetran_utils.apply_source_relation(package_name='iterable') }}\n\n from base\n),\n\nfinal as (\n select\n source_relation,\n cast(_fivetran_id as {{ dbt.type_string() }} ) as event_id,\n {{ dbt_utils.generate_surrogate_key(['_fivetran_id','_fivetran_user_id','source_relation']) }} as unique_event_id,\n app_already_running as is_app_already_running,\n badge,\n catalog_collection_count,\n catalog_lookup_count,\n cast(canonical_url_id as {{ dbt.type_string() }} ) as canonical_url_id,\n content_available as is_content_available,\n cast(content_id as {{ dbt.type_string() }} ) as content_id,\n device,\n cast(email_id as {{ dbt.type_string() }}) as email_id,\n email_subject,\n experiment_id,\n from_phone_number_id,\n from_smssender_id,\n cast(link_id as {{ dbt.type_string() }} ) as link_id,\n link_url,\n locale,\n payload,\n platform_endpoint,\n push_message,\n region,\n sms_message,\n to_phone_number,\n url,\n cast(workflow_id as {{ dbt.type_string() }} ) as workflow_id,\n workflow_name,\n city,\n clicked_url,\n country,\n error_code,\n expires_at,\n from_phone_number,\n in_app_body,\n is_sms_estimation,\n labels,\n message_status,\n mms_send_count,\n reason,\n sms_send_count,\n _fivetran_synced,\n cast(_fivetran_user_id as {{ dbt.type_string() }} ) as _fivetran_user_id\n\n --The below script allows for pass through columns.\n {{ fivetran_utils.fill_pass_through_columns('iterable_event_extension_pass_through_columns') }}\n\n from fields\n)\n\nselect *\nfrom final", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__event_extension_tmp", "package": null, "version": null}, {"name": "stg_iterable__event_extension_tmp", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.iterable.get_event_extension_columns", "macro.fivetran_utils.fill_staging_columns", "macro.fivetran_utils.apply_source_relation", "macro.dbt.type_string", "macro.dbt_utils.generate_surrogate_key", "macro.fivetran_utils.fill_pass_through_columns"], "nodes": ["model.iterable.stg_iterable__event_extension_tmp"]}, "compiled_path": "target/compiled/iterable/models/staging/stg_iterable__event_extension.sql", "compiled": true, "compiled_code": "\n\nwith base as (\n\n select * \n from \"postgres\".\"public_iterable_dev\".\"stg_iterable__event_extension_tmp\"\n\n),\n\nfields as (\n\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_iterable/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_iterable/macros/).\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n \n _fivetran_id as _fivetran_id,\n _fivetran_synced as _fivetran_synced,\n app_already_running as app_already_running,\n badge as badge,\n catalog_collection_count as catalog_collection_count,\n catalog_lookup_count as catalog_lookup_count,\n canonical_url_id as canonical_url_id,\n content_available as content_available,\n content_id as content_id,\n device as device,\n email_id as email_id,\n email_subject as email_subject,\n experiment_id as experiment_id,\n from_phone_number_id as from_phone_number_id,\n from_smssender_id as from_smssender_id,\n link_id as link_id,\n link_url as link_url,\n locale as locale,\n payload as payload,\n platform_endpoint as platform_endpoint,\n push_message as push_message,\n region as region,\n sms_message as sms_message,\n to_phone_number as to_phone_number,\n url as url,\n workflow_id as workflow_id,\n workflow_name as workflow_name,\n city as city,\n clicked_url as clicked_url,\n country as country,\n error_code as error_code,\n expires_at as expires_at,\n from_phone_number as from_phone_number,\n in_app_body as in_app_body,\n is_sms_estimation as is_sms_estimation,\n labels as labels,\n message_status as message_status,\n mms_send_count as mms_send_count,\n reason as reason,\n sms_send_count as sms_send_count,\n _fivetran_user_id as _fivetran_user_id\n \n\n\n\n\n \n \n\n\n\n\n\n, cast('postgres.public' as TEXT) as source_relation\n\n\n from base\n),\n\nfinal as (\n select\n source_relation,\n cast(_fivetran_id as TEXT ) as event_id,\n md5(cast(coalesce(cast(_fivetran_id as TEXT), '_dbt_utils_surrogate_key_null_') || '-' || coalesce(cast(_fivetran_user_id as TEXT), '_dbt_utils_surrogate_key_null_') || '-' || coalesce(cast(source_relation as TEXT), '_dbt_utils_surrogate_key_null_') as TEXT)) as unique_event_id,\n app_already_running as is_app_already_running,\n badge,\n catalog_collection_count,\n catalog_lookup_count,\n cast(canonical_url_id as TEXT ) as canonical_url_id,\n content_available as is_content_available,\n cast(content_id as TEXT ) as content_id,\n device,\n cast(email_id as TEXT) as email_id,\n email_subject,\n experiment_id,\n from_phone_number_id,\n from_smssender_id,\n cast(link_id as TEXT ) as link_id,\n link_url,\n locale,\n payload,\n platform_endpoint,\n push_message,\n region,\n sms_message,\n to_phone_number,\n url,\n cast(workflow_id as TEXT ) as workflow_id,\n workflow_name,\n city,\n clicked_url,\n country,\n error_code,\n expires_at,\n from_phone_number,\n in_app_body,\n is_sms_estimation,\n labels,\n message_status,\n mms_send_count,\n reason,\n sms_send_count,\n _fivetran_synced,\n cast(_fivetran_user_id as TEXT ) as _fivetran_user_id\n\n --The below script allows for pass through columns.\n \n\n\n\n\n\n from fields\n)\n\nselect *\nfrom final", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.stg_iterable__message_type": {"database": "postgres", "schema": "public_iterable_dev", "name": "stg_iterable__message_type", "resource_type": "model", "package_name": "iterable", "path": "staging/stg_iterable__message_type.sql", "original_file_path": "models/staging/stg_iterable__message_type.sql", "unique_id": "model.iterable.stg_iterable__message_type", "fqn": ["iterable", "staging", "stg_iterable__message_type"], "alias": "stg_iterable__message_type", "checksum": {"name": "sha256", "checksum": "046caf2bcc8a01dd2b8ef46a5dfb52e02b8bebe01e892de5d658910c97d5e6a4"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "table", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "Table containing unique message types.", "columns": {"source_relation": {"name": "source_relation", "description": "Identifies the record's source.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": ["doc.iterable.source_relation"]}, "message_type_id": {"name": "message_type_id", "description": "Unique identifier of the message type", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "message_type_name": {"name": "message_type_name", "description": "User defined name of the message type", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "channel_id": {"name": "channel_id", "description": "Channel that this message type belongs to", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "message_type_created_at": {"name": "message_type_created_at", "description": "Time when the message type was initially created", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "frequency_cap": {"name": "frequency_cap", "description": "The maximum number of times a message of this type can be sent to a recipient within a specified time period to prevent over-messaging", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "rate_limit_per_minute": {"name": "rate_limit_per_minute", "description": "The maximum number of messages of this type that can be sent to recipients in a minute, ensuring controlled message delivery", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "subscription_policy": {"name": "subscription_policy", "description": "Information about the policy or rules governing how users can subscribe to or unsubscribe from this specific message type, like OptOut", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "message_type_updated_at": {"name": "message_type_updated_at", "description": "Time when the message type was last updated or modified", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "The time when a record was last updated by Fivetran.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": ["doc.iterable._fivetran_synced"]}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "iterable://models/staging/stg_iterable.yml", "build_path": null, "unrendered_config": {"materialized": "table", "schema": "iterable_{{ var('directed_schema','dev') }}", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1786586790.654371, "relation_name": "\"postgres\".\"public_iterable_dev\".\"stg_iterable__message_type\"", "raw_code": "with base as (\n\n select * \n from {{ ref('stg_iterable__message_type_tmp') }}\n\n),\n\nfields as (\n\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_iterable/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_iterable/macros/).\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_iterable__message_type_tmp')),\n staging_columns=get_message_type_columns()\n )\n }}\n {{ fivetran_utils.apply_source_relation(package_name='iterable') }}\n\n from base\n),\n\nfinal as (\n\n select\n source_relation,\n cast(id as {{ dbt.type_string() }} ) as message_type_id,\n name as message_type_name,\n cast(channel_id as {{ dbt.type_string() }} ) as channel_id,\n created_at as message_type_created_at,\n frequency_cap,\n rate_limit_per_minute,\n subscription_policy,\n updated_at as message_type_updated_at,\n _fivetran_synced\n from fields\n where not coalesce(_fivetran_deleted, true)\n)\n\nselect * \nfrom final", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__message_type_tmp", "package": null, "version": null}, {"name": "stg_iterable__message_type_tmp", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.iterable.get_message_type_columns", "macro.fivetran_utils.fill_staging_columns", "macro.fivetran_utils.apply_source_relation", "macro.dbt.type_string"], "nodes": ["model.iterable.stg_iterable__message_type_tmp"]}, "compiled_path": "target/compiled/iterable/models/staging/stg_iterable__message_type.sql", "compiled": true, "compiled_code": "with base as (\n\n select * \n from \"postgres\".\"public_iterable_dev\".\"stg_iterable__message_type_tmp\"\n\n),\n\nfields as (\n\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_iterable/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_iterable/macros/).\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n \n _fivetran_deleted as _fivetran_deleted,\n _fivetran_synced as _fivetran_synced,\n channel_id as channel_id,\n id as id,\n name as name,\n created_at as created_at,\n frequency_cap as frequency_cap,\n rate_limit_per_minute as rate_limit_per_minute,\n subscription_policy as subscription_policy,\n updated_at as updated_at\n \n\n\n\n\n \n \n\n\n\n\n\n, cast('postgres.public' as TEXT) as source_relation\n\n\n from base\n),\n\nfinal as (\n\n select\n source_relation,\n cast(id as TEXT ) as message_type_id,\n name as message_type_name,\n cast(channel_id as TEXT ) as channel_id,\n created_at as message_type_created_at,\n frequency_cap,\n rate_limit_per_minute,\n subscription_policy,\n updated_at as message_type_updated_at,\n _fivetran_synced\n from fields\n where not coalesce(_fivetran_deleted, true)\n)\n\nselect * \nfrom final", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.stg_iterable__list": {"database": "postgres", "schema": "public_iterable_dev", "name": "stg_iterable__list", "resource_type": "model", "package_name": "iterable", "path": "staging/stg_iterable__list.sql", "original_file_path": "models/staging/stg_iterable__list.sql", "unique_id": "model.iterable.stg_iterable__list", "fqn": ["iterable", "staging", "stg_iterable__list"], "alias": "stg_iterable__list", "checksum": {"name": "sha256", "checksum": "b2a6869e5186282b7f5c8173ecba41c0324c1dc31df78db2418f51f2578eaa21"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "table", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "Table containing users and the lists the users are associated with.", "columns": {"source_relation": {"name": "source_relation", "description": "Identifies the record's source.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": ["doc.iterable.source_relation"]}, "list_id": {"name": "list_id", "description": "Unique identifier of the list", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "list_name": {"name": "list_name", "description": "User defined name of the list", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "list_type": {"name": "list_type", "description": "The list type", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "created_at": {"name": "created_at", "description": "Creation timestamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "list_description": {"name": "list_description", "description": "Information about the list", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "The time when a record was last updated by Fivetran.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": ["doc.iterable._fivetran_synced"]}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "iterable://models/staging/stg_iterable.yml", "build_path": null, "unrendered_config": {"materialized": "table", "schema": "iterable_{{ var('directed_schema','dev') }}", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1786586790.6527705, "relation_name": "\"postgres\".\"public_iterable_dev\".\"stg_iterable__list\"", "raw_code": "with base as (\n\n select * \n from {{ ref('stg_iterable__list_tmp') }}\n\n),\n\nfields as (\n\n select\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_iterable__list_tmp')),\n staging_columns=get_list_columns()\n )\n }}\n {{ fivetran_utils.apply_source_relation(package_name='iterable') }}\n \n from base\n),\n\nfinal as (\n\n select\n source_relation,\n id as list_id,\n name as list_name,\n list_type,\n created_at,\n description as list_description,\n _fivetran_synced\n from fields\n where not coalesce(_fivetran_deleted, true)\n)\n\nselect * \nfrom final", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__list_tmp", "package": null, "version": null}, {"name": "stg_iterable__list_tmp", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.iterable.get_list_columns", "macro.fivetran_utils.fill_staging_columns", "macro.fivetran_utils.apply_source_relation"], "nodes": ["model.iterable.stg_iterable__list_tmp"]}, "compiled_path": "target/compiled/iterable/models/staging/stg_iterable__list.sql", "compiled": true, "compiled_code": "with base as (\n\n select * \n from \"postgres\".\"public_iterable_dev\".\"stg_iterable__list_tmp\"\n\n),\n\nfields as (\n\n select\n \n _fivetran_deleted as _fivetran_deleted,\n _fivetran_synced as _fivetran_synced,\n created_at as created_at,\n id as id,\n list_type as list_type,\n description as description,\n name as name\n \n\n\n\n\n \n \n\n\n\n\n\n, cast('postgres.public' as TEXT) as source_relation\n\n \n from base\n),\n\nfinal as (\n\n select\n source_relation,\n id as list_id,\n name as list_name,\n list_type,\n created_at,\n description as list_description,\n _fivetran_synced\n from fields\n where not coalesce(_fivetran_deleted, true)\n)\n\nselect * \nfrom final", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.stg_iterable__channel": {"database": "postgres", "schema": "public_iterable_dev", "name": "stg_iterable__channel", "resource_type": "model", "package_name": "iterable", "path": "staging/stg_iterable__channel.sql", "original_file_path": "models/staging/stg_iterable__channel.sql", "unique_id": "model.iterable.stg_iterable__channel", "fqn": ["iterable", "staging", "stg_iterable__channel"], "alias": "stg_iterable__channel", "checksum": {"name": "sha256", "checksum": "1ade77557691cabd1c65676182adaf401d8dde9ee42a6918d1ea7a124159cbf2"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "table", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "Table containing unique channels.", "columns": {"source_relation": {"name": "source_relation", "description": "Identifies the record's source.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": ["doc.iterable.source_relation"]}, "channel_id": {"name": "channel_id", "description": "Unique identifier of the channel", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "channel_name": {"name": "channel_name", "description": "User defined name of the channel", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "channel_type": {"name": "channel_type", "description": "The channel type", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "message_medium": {"name": "message_medium", "description": "The message medium associated with the channel", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "The time when a record was last updated by Fivetran.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": ["doc.iterable._fivetran_synced"]}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "iterable://models/staging/stg_iterable.yml", "build_path": null, "unrendered_config": {"materialized": "table", "schema": "iterable_{{ var('directed_schema','dev') }}", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1786586790.6462016, "relation_name": "\"postgres\".\"public_iterable_dev\".\"stg_iterable__channel\"", "raw_code": "with base as (\n\n select *\n from {{ ref('stg_iterable__channel_tmp') }}\n\n),\n\nfields as (\n\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns\n that are expected/needed (staging_columns from dbt_iterable/models/tmp/) and compares it with columns\n in the source (source_columns from dbt_iterable/macros/).\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_iterable__channel_tmp')),\n staging_columns=get_channel_columns()\n )\n }}\n {{ fivetran_utils.apply_source_relation(package_name='iterable') }}\n\n from base\n\n),\n\nfinal as (\n\n select\n source_relation,\n cast(id as {{ dbt.type_string() }} ) as channel_id,\n name as channel_name,\n channel_type,\n message_medium,\n _fivetran_synced\n\n from fields\n where not coalesce(_fivetran_deleted, false)\n)\n\nselect * \nfrom final", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__channel_tmp", "package": null, "version": null}, {"name": "stg_iterable__channel_tmp", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.iterable.get_channel_columns", "macro.fivetran_utils.fill_staging_columns", "macro.fivetran_utils.apply_source_relation", "macro.dbt.type_string"], "nodes": ["model.iterable.stg_iterable__channel_tmp"]}, "compiled_path": "target/compiled/iterable/models/staging/stg_iterable__channel.sql", "compiled": true, "compiled_code": "with base as (\n\n select *\n from \"postgres\".\"public_iterable_dev\".\"stg_iterable__channel_tmp\"\n\n),\n\nfields as (\n\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns\n that are expected/needed (staging_columns from dbt_iterable/models/tmp/) and compares it with columns\n in the source (source_columns from dbt_iterable/macros/).\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n \n _fivetran_deleted as _fivetran_deleted,\n _fivetran_synced as _fivetran_synced,\n channel_type as channel_type,\n id as id,\n message_medium as message_medium,\n name as name\n \n\n\n\n\n \n \n\n\n\n\n\n, cast('postgres.public' as TEXT) as source_relation\n\n\n from base\n\n),\n\nfinal as (\n\n select\n source_relation,\n cast(id as TEXT ) as channel_id,\n name as channel_name,\n channel_type,\n message_medium,\n _fivetran_synced\n\n from fields\n where not coalesce(_fivetran_deleted, false)\n)\n\nselect * \nfrom final", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.stg_iterable__template_history": {"database": "postgres", "schema": "public_iterable_dev", "name": "stg_iterable__template_history", "resource_type": "model", "package_name": "iterable", "path": "staging/stg_iterable__template_history.sql", "original_file_path": "models/staging/stg_iterable__template_history.sql", "unique_id": "model.iterable.stg_iterable__template_history", "fqn": ["iterable", "staging", "stg_iterable__template_history"], "alias": "stg_iterable__template_history", "checksum": {"name": "sha256", "checksum": "f0eaf9d44d7959a04ba079cbf711646772487aeafc89414b097dd5f230b44910"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "table", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "Table containing unique templates used across campaigns.", "columns": {"source_relation": {"name": "source_relation", "description": "Identifies the record's source.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": ["doc.iterable.source_relation"]}, "template_id": {"name": "template_id", "description": "Unique identifier of the template", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "template_name": {"name": "template_name", "description": "User defined name of the template", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "template_type": {"name": "template_type", "description": "The type of the template", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "created_at": {"name": "created_at", "description": "Creation timestamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "client_template_id": {"name": "client_template_id", "description": "Reference to the client template", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "creator_user_id": {"name": "creator_user_id", "description": "Reference to the user who created the template", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "message_type_id": {"name": "message_type_id", "description": "Reference to the message type associated with the template", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "updated_at": {"name": "updated_at", "description": "Last update timestamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "The time when a record was last updated by Fivetran.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": ["doc.iterable._fivetran_synced"]}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "iterable://models/staging/stg_iterable.yml", "build_path": null, "unrendered_config": {"materialized": "table", "schema": "iterable_{{ var('directed_schema','dev') }}", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1786586790.6553583, "relation_name": "\"postgres\".\"public_iterable_dev\".\"stg_iterable__template_history\"", "raw_code": "with base as (\n\n select * \n from {{ ref('stg_iterable__template_history_tmp') }}\n\n),\n\nfields as (\n\n select\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_iterable__template_history_tmp')),\n staging_columns=get_template_history_columns()\n )\n }}\n {{ fivetran_utils.apply_source_relation(package_name='iterable') }}\n\n from base\n),\n\nfinal as (\n\n select\n source_relation,\n cast(id as {{ dbt.type_string() }} ) as template_id,\n name as template_name,\n template_type,\n created_at,\n cast(client_template_id as {{ dbt.type_string() }} ) as client_template_id,\n cast(creator_user_id as {{ dbt.type_string() }} ) as creator_user_id,\n cast(message_type_id as {{ dbt.type_string() }} ) as message_type_id,\n updated_at,\n _fivetran_synced\n from fields\n)\n\nselect * \nfrom final", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__template_history_tmp", "package": null, "version": null}, {"name": "stg_iterable__template_history_tmp", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.iterable.get_template_history_columns", "macro.fivetran_utils.fill_staging_columns", "macro.fivetran_utils.apply_source_relation", "macro.dbt.type_string"], "nodes": ["model.iterable.stg_iterable__template_history_tmp"]}, "compiled_path": "target/compiled/iterable/models/staging/stg_iterable__template_history.sql", "compiled": true, "compiled_code": "with base as (\n\n select * \n from \"postgres\".\"public_iterable_dev\".\"stg_iterable__template_history_tmp\"\n\n),\n\nfields as (\n\n select\n \n _fivetran_synced as _fivetran_synced,\n client_template_id as client_template_id,\n created_at as created_at,\n creator_user_id as creator_user_id,\n id as id,\n message_type_id as message_type_id,\n name as name,\n template_type as template_type,\n updated_at as updated_at\n \n\n\n\n\n \n \n\n\n\n\n\n, cast('postgres.public' as TEXT) as source_relation\n\n\n from base\n),\n\nfinal as (\n\n select\n source_relation,\n cast(id as TEXT ) as template_id,\n name as template_name,\n template_type,\n created_at,\n cast(client_template_id as TEXT ) as client_template_id,\n cast(creator_user_id as TEXT ) as creator_user_id,\n cast(message_type_id as TEXT ) as message_type_id,\n updated_at,\n _fivetran_synced\n from fields\n)\n\nselect * \nfrom final", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.stg_iterable__event": {"database": "postgres", "schema": "public_iterable_dev", "name": "stg_iterable__event", "resource_type": "model", "package_name": "iterable", "path": "staging/stg_iterable__event.sql", "original_file_path": "models/staging/stg_iterable__event.sql", "unique_id": "model.iterable.stg_iterable__event", "fqn": ["iterable", "staging", "stg_iterable__event"], "alias": "stg_iterable__event", "checksum": {"name": "sha256", "checksum": "22ba2d21012d8301984a6fcea5b9f40f9579f5565aaea7417f7458f6fd37937b"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "Table containing individual events within campaigns.", "columns": {"source_relation": {"name": "source_relation", "description": "Identifies the record's source.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": ["doc.iterable.source_relation"]}, "event_id": {"name": "event_id", "description": "A Fivetran-created unique identifier derived from hashing campaign_id, created_at, and event_name.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_event_id": {"name": "unique_event_id", "description": "A surrogate key made up of event_id, _fivetran_user_id, and source_relation.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "campaign_id": {"name": "campaign_id", "description": "Reference to the campaign from which the event originated", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "content_id": {"name": "content_id", "description": "Reference to the content the event is associated with", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "created_at": {"name": "created_at", "description": "Creation timestamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "created_on": {"name": "created_on", "description": "Creation date", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "email": {"name": "email", "description": "Reference to the unique user the event was applied to", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "additional_properties": {"name": "additional_properties", "description": "json object containing addition event properties", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "event_name": {"name": "event_name", "description": "Name provided to the individual event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "message_bus_id": {"name": "message_bus_id", "description": "Reference to the message bus associated with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "message_id": {"name": "message_id", "description": "Reference to the message the event is associated with", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "message_type_id": {"name": "message_type_id", "description": "Reference to the type of message the event is associated with", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "recipient_state": {"name": "recipient_state", "description": "The state of the recipient upon receiving the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "status": {"name": "status", "description": "Status of the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "transactional_data": {"name": "transactional_data", "description": "Transactional data associated with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unsub_source": {"name": "unsub_source", "description": "Source of the unsubscribe event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "user_agent": {"name": "user_agent", "description": "User agent associated with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "user_agent_device": {"name": "user_agent_device", "description": "The device of the user agent", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "_fivetran_user_id": {"name": "_fivetran_user_id", "description": "A Fivetran-created unique identifier for users, derived from hashing user_id and/or email, depending on project type. This exists for users of the new schema starting Aug 2023. In the old schema, the unique identifier is email.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_user_key": {"name": "unique_user_key", "description": "The unique identifier of the user. With the new schema (Aug 2023), it is the _fivetran_user_id. This is a hash of user_id and/or email, depending on project type. If using the old schema, it is email.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "The time when a record was last updated by Fivetran.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": ["doc.iterable._fivetran_synced"]}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "iterable://models/staging/stg_iterable.yml", "build_path": null, "unrendered_config": {"materialized": "view", "schema": "iterable_{{ var('directed_schema','dev') }}", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1786586790.6478286, "relation_name": "\"postgres\".\"public_iterable_dev\".\"stg_iterable__event\"", "raw_code": "{{ config( materialized = 'view' ) }}\n\nwith base as (\n\n select * \n from {{ ref('stg_iterable__event_tmp') }}\n\n),\n\nfields as (\n\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_iterable/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_iterable/macros/).\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_iterable__event_tmp')),\n staging_columns=get_event_columns()\n )\n }}\n {{ fivetran_utils.apply_source_relation(package_name='iterable') }}\n \n from base\n),\n\nfinal as (\n\n select\n source_relation,\n cast(_fivetran_id as {{ dbt.type_string() }} ) as event_id,\n {{ dbt_utils.generate_surrogate_key(['_fivetran_id','_fivetran_user_id','source_relation']) }} as unique_event_id,\n cast(_fivetran_user_id as {{ dbt.type_string() }} ) as _fivetran_user_id,\n coalesce(cast(_fivetran_user_id as {{ dbt.type_string() }} ) , email) as unique_user_key,\n cast(campaign_id as {{ dbt.type_string() }} ) as campaign_id,\n cast(content_id as {{ dbt.type_string() }} ) as content_id,\n created_at,\n cast( {{ dbt.date_trunc('day', 'created_at') }} as date) as created_on,\n lower(email) as email,\n additional_properties,\n event_name,\n cast(message_bus_id as {{ dbt.type_string() }} ) as message_bus_id,\n cast(message_id as {{ dbt.type_string() }} ) as message_id,\n cast(message_type_id as {{ dbt.type_string() }} ) as message_type_id,\n recipient_state,\n status,\n transactional_data,\n unsub_source,\n user_agent,\n user_agent_device,\n _fivetran_synced\n\n from fields\n)\n\nselect *\nfrom final", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__event_tmp", "package": null, "version": null}, {"name": "stg_iterable__event_tmp", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.iterable.get_event_columns", "macro.fivetran_utils.fill_staging_columns", "macro.fivetran_utils.apply_source_relation", "macro.dbt.type_string", "macro.dbt_utils.generate_surrogate_key", "macro.dbt.date_trunc"], "nodes": ["model.iterable.stg_iterable__event_tmp"]}, "compiled_path": "target/compiled/iterable/models/staging/stg_iterable__event.sql", "compiled": true, "compiled_code": "\n\nwith base as (\n\n select * \n from \"postgres\".\"public_iterable_dev\".\"stg_iterable__event_tmp\"\n\n),\n\nfields as (\n\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_iterable/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_iterable/macros/).\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n \n _fivetran_id as _fivetran_id,\n _fivetran_user_id as _fivetran_user_id,\n _fivetran_synced as _fivetran_synced,\n campaign_id as campaign_id,\n content_id as content_id,\n created_at as created_at,\n email as email,\n event_name as event_name,\n message_bus_id as message_bus_id,\n message_id as message_id,\n message_type_id as message_type_id,\n recipient_state as recipient_state,\n status as status,\n unsub_source as unsub_source,\n user_agent as user_agent,\n user_agent_device as user_agent_device,\n transactional_data as transactional_data,\n additional_properties as additional_properties\n \n\n\n\n\n \n \n\n\n\n\n\n, cast('postgres.public' as TEXT) as source_relation\n\n \n from base\n),\n\nfinal as (\n\n select\n source_relation,\n cast(_fivetran_id as TEXT ) as event_id,\n md5(cast(coalesce(cast(_fivetran_id as TEXT), '_dbt_utils_surrogate_key_null_') || '-' || coalesce(cast(_fivetran_user_id as TEXT), '_dbt_utils_surrogate_key_null_') || '-' || coalesce(cast(source_relation as TEXT), '_dbt_utils_surrogate_key_null_') as TEXT)) as unique_event_id,\n cast(_fivetran_user_id as TEXT ) as _fivetran_user_id,\n coalesce(cast(_fivetran_user_id as TEXT ) , email) as unique_user_key,\n cast(campaign_id as TEXT ) as campaign_id,\n cast(content_id as TEXT ) as content_id,\n created_at,\n cast( date_trunc('day', created_at) as date) as created_on,\n lower(email) as email,\n additional_properties,\n event_name,\n cast(message_bus_id as TEXT ) as message_bus_id,\n cast(message_id as TEXT ) as message_id,\n cast(message_type_id as TEXT ) as message_type_id,\n recipient_state,\n status,\n transactional_data,\n unsub_source,\n user_agent,\n user_agent_device,\n _fivetran_synced\n\n from fields\n)\n\nselect *\nfrom final", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.stg_iterable__campaign_label_history": {"database": "postgres", "schema": "public_iterable_dev", "name": "stg_iterable__campaign_label_history", "resource_type": "model", "package_name": "iterable", "path": "staging/stg_iterable__campaign_label_history.sql", "original_file_path": "models/staging/stg_iterable__campaign_label_history.sql", "unique_id": "model.iterable.stg_iterable__campaign_label_history", "fqn": ["iterable", "staging", "stg_iterable__campaign_label_history"], "alias": "stg_iterable__campaign_label_history", "checksum": {"name": "sha256", "checksum": "2001c425039c576063482caa3d4a72f39c5cd8aff32ffee63f083977f1f0c35f"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "table", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "Table containing a history of labels.", "columns": {"source_relation": {"name": "source_relation", "description": "Identifies the record's source.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": ["doc.iterable.source_relation"]}, "campaign_id": {"name": "campaign_id", "description": "Reference to the campaign associated with the label", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "label": {"name": "label", "description": "Name of the label", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "updated_at": {"name": "updated_at", "description": "Last update timestamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "The time when a record was last updated by Fivetran.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": ["doc.iterable._fivetran_synced"]}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "iterable://models/staging/stg_iterable.yml", "build_path": null, "unrendered_config": {"materialized": "table", "schema": "iterable_{{ var('directed_schema','dev') }}", "enabled": "var('iterable__using_campaign_label_history', True)", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1786586790.643775, "relation_name": "\"postgres\".\"public_iterable_dev\".\"stg_iterable__campaign_label_history\"", "raw_code": "{{ config(enabled=var('iterable__using_campaign_label_history', True)) }}\n\nwith base as (\n\n select * \n from {{ ref('stg_iterable__campaign_label_history_tmp') }}\n\n),\n\nfields as (\n\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_iterable/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_iterable/macros/).\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_iterable__campaign_label_history_tmp')),\n staging_columns=get_campaign_label_history_columns()\n )\n }}\n {{ fivetran_utils.apply_source_relation(package_name='iterable') }}\n \n from base\n),\n\nfinal as (\n\n select\n source_relation,\n cast(campaign_id as {{ dbt.type_string() }}) as campaign_id,\n label,\n updated_at,\n _fivetran_synced\n from fields\n)\n\nselect * \nfrom final", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__campaign_label_history_tmp", "package": null, "version": null}, {"name": "stg_iterable__campaign_label_history_tmp", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.iterable.get_campaign_label_history_columns", "macro.fivetran_utils.fill_staging_columns", "macro.fivetran_utils.apply_source_relation", "macro.dbt.type_string"], "nodes": ["model.iterable.stg_iterable__campaign_label_history_tmp"]}, "compiled_path": "target/compiled/iterable/models/staging/stg_iterable__campaign_label_history.sql", "compiled": true, "compiled_code": "\n\nwith base as (\n\n select * \n from \"postgres\".\"public_iterable_dev\".\"stg_iterable__campaign_label_history_tmp\"\n\n),\n\nfields as (\n\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_iterable/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_iterable/macros/).\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n \n _fivetran_synced as _fivetran_synced,\n campaign_id as campaign_id,\n label as label,\n updated_at as updated_at\n \n\n\n\n\n \n \n\n\n\n\n\n, cast('postgres.public' as TEXT) as source_relation\n\n \n from base\n),\n\nfinal as (\n\n select\n source_relation,\n cast(campaign_id as TEXT) as campaign_id,\n label,\n updated_at,\n _fivetran_synced\n from fields\n)\n\nselect * \nfrom final", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.stg_iterable__campaign_suppression_list_history_tmp": {"database": "postgres", "schema": "public_iterable_dev", "name": "stg_iterable__campaign_suppression_list_history_tmp", "resource_type": "model", "package_name": "iterable", "path": "staging/tmp/stg_iterable__campaign_suppression_list_history_tmp.sql", "original_file_path": "models/staging/tmp/stg_iterable__campaign_suppression_list_history_tmp.sql", "unique_id": "model.iterable.stg_iterable__campaign_suppression_list_history_tmp", "fqn": ["iterable", "staging", "tmp", "stg_iterable__campaign_suppression_list_history_tmp"], "alias": "stg_iterable__campaign_suppression_list_history_tmp", "checksum": {"name": "sha256", "checksum": "3c5a325cac70574f2defa9fa09b436c03a3fe8a3dede5729ca95451b410d636c"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"materialized": "view", "schema": "iterable_{{ var('directed_schema','dev') }}", "enabled": "var('iterable__using_campaign_suppression_list_history', True)", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1786586789.9232059, "relation_name": "\"postgres\".\"public_iterable_dev\".\"stg_iterable__campaign_suppression_list_history_tmp\"", "raw_code": "{{ config(enabled=var('iterable__using_campaign_suppression_list_history', True)) }}\n\n{{\n fivetran_utils.union_connections(\n connection_dictionary='iterable_sources',\n single_source_name='iterable',\n single_table_name='campaign_suppression_list_history'\n )\n}}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["iterable", "campaign_suppression_list_history"], ["iterable", "campaign_suppression_list_history"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.fivetran_utils.union_connections"], "nodes": ["source.iterable.iterable.campaign_suppression_list_history"]}, "compiled_path": "target/compiled/iterable/models/staging/tmp/stg_iterable__campaign_suppression_list_history_tmp.sql", "compiled": true, "compiled_code": "\n\n\n\n\n-- ** Values passed to adapter.get_relation:\n -- full-identifier_var: iterable_campaign_suppression_list_history_identifier\n -- database: postgres \n -- schema: public\n -- identifier: campaign_suppression_list_history_data\n\n\n select\n \"suppressed_list_id\",\n \"campaign_id\",\n \"updated_at\",\n \"_fivetran_synced\"\n from \"postgres\".\"public\".\"campaign_suppression_list_history_data\" as source_table\n\n ", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.stg_iterable__template_history_tmp": {"database": "postgres", "schema": "public_iterable_dev", "name": "stg_iterable__template_history_tmp", "resource_type": "model", "package_name": "iterable", "path": "staging/tmp/stg_iterable__template_history_tmp.sql", "original_file_path": "models/staging/tmp/stg_iterable__template_history_tmp.sql", "unique_id": "model.iterable.stg_iterable__template_history_tmp", "fqn": ["iterable", "staging", "tmp", "stg_iterable__template_history_tmp"], "alias": "stg_iterable__template_history_tmp", "checksum": {"name": "sha256", "checksum": "b37299e696c1cd6388ad85a4042f9b8a5364b969e7c4fdb42f03e4c4803e9a7f"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"materialized": "view", "schema": "iterable_{{ var('directed_schema','dev') }}", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1786586789.9464655, "relation_name": "\"postgres\".\"public_iterable_dev\".\"stg_iterable__template_history_tmp\"", "raw_code": "{{\n fivetran_utils.union_connections(\n connection_dictionary='iterable_sources',\n single_source_name='iterable',\n single_table_name='template_history'\n )\n}}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["iterable", "template_history"], ["iterable", "template_history"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.fivetran_utils.union_connections"], "nodes": ["source.iterable.iterable.template_history"]}, "compiled_path": "target/compiled/iterable/models/staging/tmp/stg_iterable__template_history_tmp.sql", "compiled": true, "compiled_code": "\n\n\n-- ** Values passed to adapter.get_relation:\n -- full-identifier_var: iterable_template_history_identifier\n -- database: postgres \n -- schema: public\n -- identifier: template_history_data\n\n\n select\n \"id\",\n \"updated_at\",\n \"message_type_id\",\n \"client_template_id\",\n \"created_at\",\n \"creator_user_id\",\n \"name\",\n \"template_type\",\n \"_fivetran_synced\"\n from \"postgres\".\"public\".\"template_history_data\" as source_table\n\n ", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.stg_iterable__event_extension_tmp": {"database": "postgres", "schema": "public_iterable_dev", "name": "stg_iterable__event_extension_tmp", "resource_type": "model", "package_name": "iterable", "path": "staging/tmp/stg_iterable__event_extension_tmp.sql", "original_file_path": "models/staging/tmp/stg_iterable__event_extension_tmp.sql", "unique_id": "model.iterable.stg_iterable__event_extension_tmp", "fqn": ["iterable", "staging", "tmp", "stg_iterable__event_extension_tmp"], "alias": "stg_iterable__event_extension_tmp", "checksum": {"name": "sha256", "checksum": "09d92da24c5304acbb0f0ebc81fe49e70458d1319cb1c2090f5f9ce0b87ecb29"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"materialized": "view", "schema": "iterable_{{ var('directed_schema','dev') }}", "enabled": "var('iterable__using_event_extension', True)", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1786586789.953089, "relation_name": "\"postgres\".\"public_iterable_dev\".\"stg_iterable__event_extension_tmp\"", "raw_code": "{{ config(enabled=var('iterable__using_event_extension', True)) }}\n\n{{\n fivetran_utils.union_connections(\n connection_dictionary='iterable_sources',\n single_source_name='iterable',\n single_table_name='event_extension'\n )\n}}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["iterable", "event_extension"], ["iterable", "event_extension"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.fivetran_utils.union_connections"], "nodes": ["source.iterable.iterable.event_extension"]}, "compiled_path": "target/compiled/iterable/models/staging/tmp/stg_iterable__event_extension_tmp.sql", "compiled": true, "compiled_code": "\n\n\n\n\n-- ** Values passed to adapter.get_relation:\n -- full-identifier_var: iterable_event_extension_identifier\n -- database: postgres \n -- schema: public\n -- identifier: event_extension_data\n\n\n select\n \"_fivetran_id\",\n \"app_already_running\",\n \"badge\",\n \"canonical_url_id\",\n \"content_available\",\n \"content_id\",\n \"device\",\n \"email_id\",\n \"email_subject\",\n \"experiment_id\",\n \"from_phone_number_id\",\n \"from_smssender_id\",\n \"image_url\",\n \"is_ghost_push\",\n \"link_id\",\n \"link_url\",\n \"platform_endpoint\",\n \"push_message\",\n \"region\",\n \"sms_message\",\n \"sound\",\n \"to_phone_number\",\n \"url\",\n \"workflow_id\",\n \"workflow_name\",\n \"locale\",\n \"deeplink_android\",\n \"deeplink_ios\",\n \"payload\",\n \"sms_provider_response_status\",\n \"sms_provider_response_message\",\n \"sms_provider_response_code\",\n \"sms_provider_response_more_info\",\n \"_fivetran_synced\",\n \"catalog_collection_count\",\n \"catalog_lookup_count\",\n \"city\",\n \"clicked_url\",\n \"country\",\n \"error_code\",\n \"expires_at\",\n \"from_phone_number\",\n \"in_app_body\",\n \"is_sms_estimation\",\n \"labels\",\n \"message_context\",\n \"message_status\",\n \"mms_send_count\",\n \"product_recommendation_count\",\n \"proxy_source\",\n \"reason\",\n \"sms_send_count\",\n \"web_push_body\",\n \"web_push_click_action\",\n \"web_push_icon\",\n \"web_push_message\",\n \"_fivetran_user_id\"\n from \"postgres\".\"public\".\"event_extension_data\" as source_table\n\n ", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.stg_iterable__user_unsubscribed_channel_tmp": {"database": "postgres", "schema": "public_iterable_dev", "name": "stg_iterable__user_unsubscribed_channel_tmp", "resource_type": "model", "package_name": "iterable", "path": "staging/tmp/stg_iterable__user_unsubscribed_channel_tmp.sql", "original_file_path": "models/staging/tmp/stg_iterable__user_unsubscribed_channel_tmp.sql", "unique_id": "model.iterable.stg_iterable__user_unsubscribed_channel_tmp", "fqn": ["iterable", "staging", "tmp", "stg_iterable__user_unsubscribed_channel_tmp"], "alias": "stg_iterable__user_unsubscribed_channel_tmp", "checksum": {"name": "sha256", "checksum": "a8d43331a84f0d1dae8511478d01cded7dfb389fef925f7173f50eb6b6b9c142"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"materialized": "view", "schema": "iterable_{{ var('directed_schema','dev') }}", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1786586789.960409, "relation_name": "\"postgres\".\"public_iterable_dev\".\"stg_iterable__user_unsubscribed_channel_tmp\"", "raw_code": "{{\n fivetran_utils.union_connections(\n connection_dictionary='iterable_sources',\n single_source_name='iterable',\n single_table_name='user_unsubscribed_channel' if does_table_exist('user_unsubscribed_channel') else 'user_unsubscribed_channel_history'\n )\n}}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["iterable", "user_unsubscribed_channel_history"], ["iterable", "user_unsubscribed_channel_history"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.iterable.does_table_exist", "macro.fivetran_utils.union_connections"], "nodes": ["source.iterable.iterable.user_unsubscribed_channel_history"]}, "compiled_path": "target/compiled/iterable/models/staging/tmp/stg_iterable__user_unsubscribed_channel_tmp.sql", "compiled": true, "compiled_code": "\n\n\n-- ** Values passed to adapter.get_relation:\n -- full-identifier_var: iterable_user_unsubscribed_channel_identifier\n -- database: postgres \n -- schema: public\n -- identifier: user_unsubscribed_channel_data\n\n\n select\n \"_fivetran_id\",\n \"channel_id\",\n \"_fivetran_synced\"\n from \"postgres\".\"public\".\"user_unsubscribed_channel_data\" as source_table\n\n ", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.stg_iterable__message_type_tmp": {"database": "postgres", "schema": "public_iterable_dev", "name": "stg_iterable__message_type_tmp", "resource_type": "model", "package_name": "iterable", "path": "staging/tmp/stg_iterable__message_type_tmp.sql", "original_file_path": "models/staging/tmp/stg_iterable__message_type_tmp.sql", "unique_id": "model.iterable.stg_iterable__message_type_tmp", "fqn": ["iterable", "staging", "tmp", "stg_iterable__message_type_tmp"], "alias": "stg_iterable__message_type_tmp", "checksum": {"name": "sha256", "checksum": "fda7a978e7b71b46f37e4878898c6655526f0531d36f74968c7bbb56ec4200e5"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"materialized": "view", "schema": "iterable_{{ var('directed_schema','dev') }}", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1786586789.967287, "relation_name": "\"postgres\".\"public_iterable_dev\".\"stg_iterable__message_type_tmp\"", "raw_code": "{{\n fivetran_utils.union_connections(\n connection_dictionary='iterable_sources',\n single_source_name='iterable',\n single_table_name='message_type'\n )\n}}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["iterable", "message_type"], ["iterable", "message_type"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.fivetran_utils.union_connections"], "nodes": ["source.iterable.iterable.message_type"]}, "compiled_path": "target/compiled/iterable/models/staging/tmp/stg_iterable__message_type_tmp.sql", "compiled": true, "compiled_code": "\n\n\n-- ** Values passed to adapter.get_relation:\n -- full-identifier_var: iterable_message_type_identifier\n -- database: postgres \n -- schema: public\n -- identifier: message_type_data\n\n\n select\n \"id\",\n \"name\",\n \"channel_id\",\n \"_fivetran_deleted\",\n \"_fivetran_synced\",\n \"created_at\",\n \"frequency_cap\",\n \"rate_limit_per_minute\",\n \"subscription_policy\",\n \"updated_at\"\n from \"postgres\".\"public\".\"message_type_data\" as source_table\n\n ", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.stg_iterable__campaign_list_history_tmp": {"database": "postgres", "schema": "public_iterable_dev", "name": "stg_iterable__campaign_list_history_tmp", "resource_type": "model", "package_name": "iterable", "path": "staging/tmp/stg_iterable__campaign_list_history_tmp.sql", "original_file_path": "models/staging/tmp/stg_iterable__campaign_list_history_tmp.sql", "unique_id": "model.iterable.stg_iterable__campaign_list_history_tmp", "fqn": ["iterable", "staging", "tmp", "stg_iterable__campaign_list_history_tmp"], "alias": "stg_iterable__campaign_list_history_tmp", "checksum": {"name": "sha256", "checksum": "c26b6a07e1d280b2d5dea6ddbff02200d527e798d8af0a8105be30c0e7d013f7"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"materialized": "view", "schema": "iterable_{{ var('directed_schema','dev') }}", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1786586789.974192, "relation_name": "\"postgres\".\"public_iterable_dev\".\"stg_iterable__campaign_list_history_tmp\"", "raw_code": "{{\n fivetran_utils.union_connections(\n connection_dictionary='iterable_sources',\n single_source_name='iterable',\n single_table_name='campaign_list_history'\n )\n}}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["iterable", "campaign_list_history"], ["iterable", "campaign_list_history"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.fivetran_utils.union_connections"], "nodes": ["source.iterable.iterable.campaign_list_history"]}, "compiled_path": "target/compiled/iterable/models/staging/tmp/stg_iterable__campaign_list_history_tmp.sql", "compiled": true, "compiled_code": "\n\n\n-- ** Values passed to adapter.get_relation:\n -- full-identifier_var: iterable_campaign_list_history_identifier\n -- database: postgres \n -- schema: public\n -- identifier: campaign_list_history_data\n\n\n select\n \"list_id\",\n \"campaign_id\",\n \"updated_at\",\n \"_fivetran_synced\"\n from \"postgres\".\"public\".\"campaign_list_history_data\" as source_table\n\n ", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.stg_iterable__user_history_tmp": {"database": "postgres", "schema": "public_iterable_dev", "name": "stg_iterable__user_history_tmp", "resource_type": "model", "package_name": "iterable", "path": "staging/tmp/stg_iterable__user_history_tmp.sql", "original_file_path": "models/staging/tmp/stg_iterable__user_history_tmp.sql", "unique_id": "model.iterable.stg_iterable__user_history_tmp", "fqn": ["iterable", "staging", "tmp", "stg_iterable__user_history_tmp"], "alias": "stg_iterable__user_history_tmp", "checksum": {"name": "sha256", "checksum": "cc04d0fbef9ff5cd4f72ae66c9cffd316c5e134ecd81dc216dcf682b34eb587b"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"materialized": "view", "schema": "iterable_{{ var('directed_schema','dev') }}", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1786586789.9805448, "relation_name": "\"postgres\".\"public_iterable_dev\".\"stg_iterable__user_history_tmp\"", "raw_code": "{{\n fivetran_utils.union_connections(\n connection_dictionary='iterable_sources',\n single_source_name='iterable',\n single_table_name='user_history'\n )\n}}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["iterable", "user_history"], ["iterable", "user_history"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.fivetran_utils.union_connections"], "nodes": ["source.iterable.iterable.user_history"]}, "compiled_path": "target/compiled/iterable/models/staging/tmp/stg_iterable__user_history_tmp.sql", "compiled": true, "compiled_code": "\n\n\n-- ** Values passed to adapter.get_relation:\n -- full-identifier_var: iterable_user_history_identifier\n -- database: postgres \n -- schema: public\n -- identifier: user_history_data\n\n\n select\n \"email\",\n \"updated_at\",\n \"first_name\",\n \"last_name\",\n \"phone_number\",\n \"user_id\",\n \"signup_date\",\n \"signup_source\",\n \"phone_number_carrier\",\n \"phone_number_country_code_iso\",\n \"phone_number_line_type\",\n \"phone_number_updated_at\",\n \"_fivetran_synced\",\n \"email_list_ids\",\n \"iterable_user_id\"\n from \"postgres\".\"public\".\"user_history_data\" as source_table\n\n ", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.stg_iterable__campaign_history_tmp": {"database": "postgres", "schema": "public_iterable_dev", "name": "stg_iterable__campaign_history_tmp", "resource_type": "model", "package_name": "iterable", "path": "staging/tmp/stg_iterable__campaign_history_tmp.sql", "original_file_path": "models/staging/tmp/stg_iterable__campaign_history_tmp.sql", "unique_id": "model.iterable.stg_iterable__campaign_history_tmp", "fqn": ["iterable", "staging", "tmp", "stg_iterable__campaign_history_tmp"], "alias": "stg_iterable__campaign_history_tmp", "checksum": {"name": "sha256", "checksum": "a37ade72efad4e5d8b38cc0548f4a4c79d38a4a337ce71f236581bda47f94696"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"materialized": "view", "schema": "iterable_{{ var('directed_schema','dev') }}", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1786586789.9871054, "relation_name": "\"postgres\".\"public_iterable_dev\".\"stg_iterable__campaign_history_tmp\"", "raw_code": "{{\n fivetran_utils.union_connections(\n connection_dictionary='iterable_sources',\n single_source_name='iterable',\n single_table_name='campaign_history'\n )\n}}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["iterable", "campaign_history"], ["iterable", "campaign_history"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.fivetran_utils.union_connections"], "nodes": ["source.iterable.iterable.campaign_history"]}, "compiled_path": "target/compiled/iterable/models/staging/tmp/stg_iterable__campaign_history_tmp.sql", "compiled": true, "compiled_code": "\n\n\n-- ** Values passed to adapter.get_relation:\n -- full-identifier_var: iterable_campaign_history_identifier\n -- database: postgres \n -- schema: public\n -- identifier: campaign_history_data\n\n\n select\n \"id\",\n \"updated_at\",\n \"template_id\",\n \"recurring_campaign_id\",\n \"campaign_state\",\n \"created_at\",\n \"created_by_user_id\",\n \"ended_at\",\n \"name\",\n \"send_size\",\n \"start_at\",\n \"type\",\n \"workflow_id\",\n \"_fivetran_synced\",\n \"updated_by_user_id\",\n \"message_medium\"\n from \"postgres\".\"public\".\"campaign_history_data\" as source_table\n\n ", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.stg_iterable__campaign_label_history_tmp": {"database": "postgres", "schema": "public_iterable_dev", "name": "stg_iterable__campaign_label_history_tmp", "resource_type": "model", "package_name": "iterable", "path": "staging/tmp/stg_iterable__campaign_label_history_tmp.sql", "original_file_path": "models/staging/tmp/stg_iterable__campaign_label_history_tmp.sql", "unique_id": "model.iterable.stg_iterable__campaign_label_history_tmp", "fqn": ["iterable", "staging", "tmp", "stg_iterable__campaign_label_history_tmp"], "alias": "stg_iterable__campaign_label_history_tmp", "checksum": {"name": "sha256", "checksum": "08e70c9938c895459cabba65b1992d360775e26ea2b8275e408bcf21e814bd58"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"materialized": "view", "schema": "iterable_{{ var('directed_schema','dev') }}", "enabled": "var('iterable__using_campaign_label_history', True)", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1786586789.993586, "relation_name": "\"postgres\".\"public_iterable_dev\".\"stg_iterable__campaign_label_history_tmp\"", "raw_code": "{{ config(enabled=var('iterable__using_campaign_label_history', True)) }}\n\n{{\n fivetran_utils.union_connections(\n connection_dictionary='iterable_sources',\n single_source_name='iterable',\n single_table_name='campaign_label_history'\n )\n}}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["iterable", "campaign_label_history"], ["iterable", "campaign_label_history"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.fivetran_utils.union_connections"], "nodes": ["source.iterable.iterable.campaign_label_history"]}, "compiled_path": "target/compiled/iterable/models/staging/tmp/stg_iterable__campaign_label_history_tmp.sql", "compiled": true, "compiled_code": "\n\n\n\n\n-- ** Values passed to adapter.get_relation:\n -- full-identifier_var: iterable_campaign_label_history_identifier\n -- database: postgres \n -- schema: public\n -- identifier: campaign_label_history_data\n\n\n select\n \"campaign_id\",\n \"label\",\n \"updated_at\",\n \"_fivetran_synced\"\n from \"postgres\".\"public\".\"campaign_label_history_data\" as source_table\n\n ", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.stg_iterable__user_unsub_message_type_tmp": {"database": "postgres", "schema": "public_iterable_dev", "name": "stg_iterable__user_unsub_message_type_tmp", "resource_type": "model", "package_name": "iterable", "path": "staging/tmp/stg_iterable__user_unsub_message_type_tmp.sql", "original_file_path": "models/staging/tmp/stg_iterable__user_unsub_message_type_tmp.sql", "unique_id": "model.iterable.stg_iterable__user_unsub_message_type_tmp", "fqn": ["iterable", "staging", "tmp", "stg_iterable__user_unsub_message_type_tmp"], "alias": "stg_iterable__user_unsub_message_type_tmp", "checksum": {"name": "sha256", "checksum": "ddb46e159ed22f011676fbe7e00ba9271a493bc5185d286261ae30fa0b183636"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"materialized": "view", "schema": "iterable_{{ var('directed_schema','dev') }}", "enabled": "var('iterable__using_user_unsubscribed_message_type', True)", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1786586790.0011199, "relation_name": "\"postgres\".\"public_iterable_dev\".\"stg_iterable__user_unsub_message_type_tmp\"", "raw_code": "{{ config(enabled=var('iterable__using_user_unsubscribed_message_type', True)) }}\n\n{{\n fivetran_utils.union_connections(\n connection_dictionary='iterable_sources',\n single_source_name='iterable',\n single_table_name='user_unsubscribed_message_type' if does_table_exist('user_unsubscribed_message_type') else 'user_unsubscribed_message_type_history'\n )\n}}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["iterable", "user_unsubscribed_message_type_history"], ["iterable", "user_unsubscribed_message_type_history"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.iterable.does_table_exist", "macro.fivetran_utils.union_connections"], "nodes": ["source.iterable.iterable.user_unsubscribed_message_type_history"]}, "compiled_path": "target/compiled/iterable/models/staging/tmp/stg_iterable__user_unsub_message_type_tmp.sql", "compiled": true, "compiled_code": "\n\n\n\n\n-- ** Values passed to adapter.get_relation:\n -- full-identifier_var: iterable_user_unsubscribed_message_type_identifier\n -- database: postgres \n -- schema: public\n -- identifier: user_unsubscribed_message_type_data\n\n\n select\n \"_fivetran_id\",\n \"message_type_id\",\n \"_fivetran_synced\"\n from \"postgres\".\"public\".\"user_unsubscribed_message_type_data\" as source_table\n\n ", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.stg_iterable__channel_tmp": {"database": "postgres", "schema": "public_iterable_dev", "name": "stg_iterable__channel_tmp", "resource_type": "model", "package_name": "iterable", "path": "staging/tmp/stg_iterable__channel_tmp.sql", "original_file_path": "models/staging/tmp/stg_iterable__channel_tmp.sql", "unique_id": "model.iterable.stg_iterable__channel_tmp", "fqn": ["iterable", "staging", "tmp", "stg_iterable__channel_tmp"], "alias": "stg_iterable__channel_tmp", "checksum": {"name": "sha256", "checksum": "0516bc3567b725378b33829b8c3e7dc1b6680922f2d1e7824a913b82ca617905"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"materialized": "view", "schema": "iterable_{{ var('directed_schema','dev') }}", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1786586790.0091774, "relation_name": "\"postgres\".\"public_iterable_dev\".\"stg_iterable__channel_tmp\"", "raw_code": "{{\n fivetran_utils.union_connections(\n connection_dictionary='iterable_sources',\n single_source_name='iterable',\n single_table_name='channel'\n )\n}}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["iterable", "channel"], ["iterable", "channel"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.fivetran_utils.union_connections"], "nodes": ["source.iterable.iterable.channel"]}, "compiled_path": "target/compiled/iterable/models/staging/tmp/stg_iterable__channel_tmp.sql", "compiled": true, "compiled_code": "\n\n\n-- ** Values passed to adapter.get_relation:\n -- full-identifier_var: iterable_channel_identifier\n -- database: postgres \n -- schema: public\n -- identifier: channel_data\n\n\n select\n \"id\",\n \"name\",\n \"channel_type\",\n \"message_medium\",\n \"_fivetran_deleted\",\n \"_fivetran_synced\"\n from \"postgres\".\"public\".\"channel_data\" as source_table\n\n ", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.stg_iterable__list_tmp": {"database": "postgres", "schema": "public_iterable_dev", "name": "stg_iterable__list_tmp", "resource_type": "model", "package_name": "iterable", "path": "staging/tmp/stg_iterable__list_tmp.sql", "original_file_path": "models/staging/tmp/stg_iterable__list_tmp.sql", "unique_id": "model.iterable.stg_iterable__list_tmp", "fqn": ["iterable", "staging", "tmp", "stg_iterable__list_tmp"], "alias": "stg_iterable__list_tmp", "checksum": {"name": "sha256", "checksum": "95fbbf63205ef9000c19e76270c8ab96e23c4f9d8072f3892a08f20648a42b5a"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"materialized": "view", "schema": "iterable_{{ var('directed_schema','dev') }}", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1786586790.0155225, "relation_name": "\"postgres\".\"public_iterable_dev\".\"stg_iterable__list_tmp\"", "raw_code": "{{\n fivetran_utils.union_connections(\n connection_dictionary='iterable_sources',\n single_source_name='iterable',\n single_table_name='list'\n )\n}}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["iterable", "list"], ["iterable", "list"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.fivetran_utils.union_connections"], "nodes": ["source.iterable.iterable.list"]}, "compiled_path": "target/compiled/iterable/models/staging/tmp/stg_iterable__list_tmp.sql", "compiled": true, "compiled_code": "\n\n\n-- ** Values passed to adapter.get_relation:\n -- full-identifier_var: iterable_list_identifier\n -- database: postgres \n -- schema: public\n -- identifier: list_data\n\n\n select\n \"id\",\n \"name\",\n \"created_at\",\n \"list_type\",\n \"_fivetran_deleted\",\n \"_fivetran_synced\",\n \"description\"\n from \"postgres\".\"public\".\"list_data\" as source_table\n\n ", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.stg_iterable__list_user_tmp": {"database": "postgres", "schema": "public_iterable_dev", "name": "stg_iterable__list_user_tmp", "resource_type": "model", "package_name": "iterable", "path": "staging/tmp/stg_iterable__list_user_tmp.sql", "original_file_path": "models/staging/tmp/stg_iterable__list_user_tmp.sql", "unique_id": "model.iterable.stg_iterable__list_user_tmp", "fqn": ["iterable", "staging", "tmp", "stg_iterable__list_user_tmp"], "alias": "stg_iterable__list_user_tmp", "checksum": {"name": "sha256", "checksum": "5c8b455013c26cfd4094b38e210edeb911a22dc0f05544e65fb48c350c2725fe"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"materialized": "view", "schema": "iterable_{{ var('directed_schema','dev') }}", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1786586790.0220466, "relation_name": "\"postgres\".\"public_iterable_dev\".\"stg_iterable__list_user_tmp\"", "raw_code": "{{\n fivetran_utils.union_connections(\n connection_dictionary='iterable_sources',\n single_source_name='iterable',\n single_table_name='list_user'\n )\n}}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["iterable", "list_user"], ["iterable", "list_user"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.fivetran_utils.union_connections"], "nodes": ["source.iterable.iterable.list_user"]}, "compiled_path": "target/compiled/iterable/models/staging/tmp/stg_iterable__list_user_tmp.sql", "compiled": true, "compiled_code": "\n\n\n-- ** Values passed to adapter.get_relation:\n -- full-identifier_var: iterable_list_user_identifier\n -- database: postgres \n -- schema: public\n -- identifier: list_user_data\n\n\n select\n \"_fivetran_id\",\n \"index\",\n \"list_id\",\n \"_fivetran_synced\"\n from \"postgres\".\"public\".\"list_user_data\" as source_table\n\n ", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.stg_iterable__event_tmp": {"database": "postgres", "schema": "public_iterable_dev", "name": "stg_iterable__event_tmp", "resource_type": "model", "package_name": "iterable", "path": "staging/tmp/stg_iterable__event_tmp.sql", "original_file_path": "models/staging/tmp/stg_iterable__event_tmp.sql", "unique_id": "model.iterable.stg_iterable__event_tmp", "fqn": ["iterable", "staging", "tmp", "stg_iterable__event_tmp"], "alias": "stg_iterable__event_tmp", "checksum": {"name": "sha256", "checksum": "31555eb22bfca797c1f1a4f1503da21f7620762d199e7e32b2d268c03e139f65"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"materialized": "view", "schema": "iterable_{{ var('directed_schema','dev') }}", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1786586790.0285656, "relation_name": "\"postgres\".\"public_iterable_dev\".\"stg_iterable__event_tmp\"", "raw_code": "{{\n fivetran_utils.union_connections(\n connection_dictionary='iterable_sources',\n single_source_name='iterable',\n single_table_name='event'\n )\n}}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["iterable", "event"], ["iterable", "event"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.fivetran_utils.union_connections"], "nodes": ["source.iterable.iterable.event"]}, "compiled_path": "target/compiled/iterable/models/staging/tmp/stg_iterable__event_tmp.sql", "compiled": true, "compiled_code": "\n\n\n-- ** Values passed to adapter.get_relation:\n -- full-identifier_var: iterable_event_identifier\n -- database: postgres \n -- schema: public\n -- identifier: event_data\n\n\n select\n \"_fivetran_id\",\n \"email\",\n \"campaign_id\",\n \"message_id\",\n \"content_id\",\n \"created_at\",\n \"event_name\",\n \"ip\",\n \"message_bus_id\",\n \"message_type_id\",\n \"recipient_state\",\n \"status\",\n \"unsub_source\",\n \"user_agent\",\n \"user_agent_device\",\n \"transactional_data\",\n \"additional_properties\",\n \"_fivetran_synced\",\n \"_fivetran_user_id\"\n from \"postgres\".\"public\".\"event_data\" as source_table\n\n ", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "test.iterable.not_null_iterable__campaigns_campaign_id.03c9448919": {"database": "postgres", "schema": "public_dbt_test__audit", "name": "not_null_iterable__campaigns_campaign_id", "resource_type": "test", "package_name": "iterable", "path": "not_null_iterable__campaigns_campaign_id.sql", "original_file_path": "models/iterable.yml", "unique_id": "test.iterable.not_null_iterable__campaigns_campaign_id.03c9448919", "fqn": ["iterable", "not_null_iterable__campaigns_campaign_id"], "alias": "not_null_iterable__campaigns_campaign_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "sql_header": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {}, "created_at": 1786586790.4779232, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "iterable__campaigns", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.iterable.iterable__campaigns"]}, "compiled_path": "target/compiled/iterable/models/iterable.yml/not_null_iterable__campaigns_campaign_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect campaign_id\nfrom \"postgres\".\"public_iterable_dev\".\"iterable__campaigns\"\nwhere campaign_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "campaign_id", "file_key_name": "models.iterable__campaigns", "attached_node": "model.iterable.iterable__campaigns", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "campaign_id", "model": "{{ get_where_subquery(ref('iterable__campaigns')) }}"}, "namespace": null}}, "test.iterable.not_null_iterable__events_event_id.ed1d28a650": {"database": "postgres", "schema": "public_dbt_test__audit", "name": "not_null_iterable__events_event_id", "resource_type": "test", "package_name": "iterable", "path": "not_null_iterable__events_event_id.sql", "original_file_path": "models/iterable.yml", "unique_id": "test.iterable.not_null_iterable__events_event_id.ed1d28a650", "fqn": ["iterable", "not_null_iterable__events_event_id"], "alias": "not_null_iterable__events_event_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "sql_header": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {}, "created_at": 1786586790.4810908, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "iterable__events", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.iterable.iterable__events"]}, "compiled_path": "target/compiled/iterable/models/iterable.yml/not_null_iterable__events_event_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect event_id\nfrom \"postgres\".\"public_iterable_dev\".\"iterable__events\"\nwhere event_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "event_id", "file_key_name": "models.iterable__events", "attached_node": "model.iterable.iterable__events", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "event_id", "model": "{{ get_where_subquery(ref('iterable__events')) }}"}, "namespace": null}}, "test.iterable.not_null_iterable__user_unsubscriptions_unique_user_key.f8db72932b": {"database": "postgres", "schema": "public_dbt_test__audit", "name": "not_null_iterable__user_unsubscriptions_unique_user_key", "resource_type": "test", "package_name": "iterable", "path": "not_null_iterable__user_unsubscriptions_unique_user_key.sql", "original_file_path": "models/iterable.yml", "unique_id": "test.iterable.not_null_iterable__user_unsubscriptions_unique_user_key.f8db72932b", "fqn": ["iterable", "not_null_iterable__user_unsubscriptions_unique_user_key"], "alias": "not_null_iterable__user_unsubscriptions_unique_user_key", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "sql_header": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {}, "created_at": 1786586790.4838324, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "iterable__user_unsubscriptions", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.iterable.iterable__user_unsubscriptions"]}, "compiled_path": "target/compiled/iterable/models/iterable.yml/not_null_iterable__user_unsubscriptions_unique_user_key.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect unique_user_key\nfrom \"postgres\".\"public_iterable_dev\".\"iterable__user_unsubscriptions\"\nwhere unique_user_key is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "unique_user_key", "file_key_name": "models.iterable__user_unsubscriptions", "attached_node": "model.iterable.iterable__user_unsubscriptions", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "unique_user_key", "model": "{{ get_where_subquery(ref('iterable__user_unsubscriptions')) }}"}, "namespace": null}}, "test.iterable.not_null_iterable__users_unique_user_key.4ca37a26c8": {"database": "postgres", "schema": "public_dbt_test__audit", "name": "not_null_iterable__users_unique_user_key", "resource_type": "test", "package_name": "iterable", "path": "not_null_iterable__users_unique_user_key.sql", "original_file_path": "models/iterable.yml", "unique_id": "test.iterable.not_null_iterable__users_unique_user_key.4ca37a26c8", "fqn": ["iterable", "not_null_iterable__users_unique_user_key"], "alias": "not_null_iterable__users_unique_user_key", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "sql_header": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {}, "created_at": 1786586790.4864173, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "iterable__users", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.iterable.iterable__users"]}, "compiled_path": "target/compiled/iterable/models/iterable.yml/not_null_iterable__users_unique_user_key.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect unique_user_key\nfrom \"postgres\".\"public_iterable_dev\".\"iterable__users\"\nwhere unique_user_key is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "unique_user_key", "file_key_name": "models.iterable__users", "attached_node": "model.iterable.iterable__users", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "unique_user_key", "model": "{{ get_where_subquery(ref('iterable__users')) }}"}, "namespace": null}}, "test.iterable.not_null_stg_iterable__campaign_history_campaign_id.b7c36e4525": {"database": "postgres", "schema": "public_dbt_test__audit", "name": "not_null_stg_iterable__campaign_history_campaign_id", "resource_type": "test", "package_name": "iterable", "path": "not_null_stg_iterable__campaign_history_campaign_id.sql", "original_file_path": "models/staging/stg_iterable.yml", "unique_id": "test.iterable.not_null_stg_iterable__campaign_history_campaign_id.b7c36e4525", "fqn": ["iterable", "staging", "not_null_stg_iterable__campaign_history_campaign_id"], "alias": "not_null_stg_iterable__campaign_history_campaign_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "sql_header": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {}, "created_at": 1786586790.661683, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__campaign_history", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.iterable.stg_iterable__campaign_history"]}, "compiled_path": "target/compiled/iterable/models/staging/stg_iterable.yml/not_null_stg_iterable__campaign_history_campaign_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect campaign_id\nfrom \"postgres\".\"public_iterable_dev\".\"stg_iterable__campaign_history\"\nwhere campaign_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "campaign_id", "file_key_name": "models.stg_iterable__campaign_history", "attached_node": "model.iterable.stg_iterable__campaign_history", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "campaign_id", "model": "{{ get_where_subquery(ref('stg_iterable__campaign_history')) }}"}, "namespace": null}}, "test.iterable.not_null_stg_iterable__campaign_label_history_campaign_id.1918cef89a": {"database": "postgres", "schema": "public_dbt_test__audit", "name": "not_null_stg_iterable__campaign_label_history_campaign_id", "resource_type": "test", "package_name": "iterable", "path": "not_null_stg_iterable__campaign_label_history_campaign_id.sql", "original_file_path": "models/staging/stg_iterable.yml", "unique_id": "test.iterable.not_null_stg_iterable__campaign_label_history_campaign_id.1918cef89a", "fqn": ["iterable", "staging", "not_null_stg_iterable__campaign_label_history_campaign_id"], "alias": "not_null_stg_iterable__campaign_label_history_campaign_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "sql_header": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {}, "created_at": 1786586790.664572, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__campaign_label_history", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.iterable.stg_iterable__campaign_label_history"]}, "compiled_path": "target/compiled/iterable/models/staging/stg_iterable.yml/not_null_stg_iterable__campaign_label_history_campaign_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect campaign_id\nfrom \"postgres\".\"public_iterable_dev\".\"stg_iterable__campaign_label_history\"\nwhere campaign_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "campaign_id", "file_key_name": "models.stg_iterable__campaign_label_history", "attached_node": "model.iterable.stg_iterable__campaign_label_history", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "campaign_id", "model": "{{ get_where_subquery(ref('stg_iterable__campaign_label_history')) }}"}, "namespace": null}}, "test.iterable.not_null_stg_iterable__campaign_list_history_campaign_id.208f9bf9ed": {"database": "postgres", "schema": "public_dbt_test__audit", "name": "not_null_stg_iterable__campaign_list_history_campaign_id", "resource_type": "test", "package_name": "iterable", "path": "not_null_stg_iterable__campaign_list_history_campaign_id.sql", "original_file_path": "models/staging/stg_iterable.yml", "unique_id": "test.iterable.not_null_stg_iterable__campaign_list_history_campaign_id.208f9bf9ed", "fqn": ["iterable", "staging", "not_null_stg_iterable__campaign_list_history_campaign_id"], "alias": "not_null_stg_iterable__campaign_list_history_campaign_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "sql_header": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {}, "created_at": 1786586790.6671736, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__campaign_list_history", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.iterable.stg_iterable__campaign_list_history"]}, "compiled_path": "target/compiled/iterable/models/staging/stg_iterable.yml/not_null_stg_iterable__campaign_list_history_campaign_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect campaign_id\nfrom \"postgres\".\"public_iterable_dev\".\"stg_iterable__campaign_list_history\"\nwhere campaign_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "campaign_id", "file_key_name": "models.stg_iterable__campaign_list_history", "attached_node": "model.iterable.stg_iterable__campaign_list_history", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "campaign_id", "model": "{{ get_where_subquery(ref('stg_iterable__campaign_list_history')) }}"}, "namespace": null}}, "test.iterable.not_null_stg_iterable__campaign_suppression_list_history_campaign_id.3921289710": {"database": "postgres", "schema": "public_dbt_test__audit", "name": "not_null_stg_iterable__campaign_suppression_list_history_campaign_id", "resource_type": "test", "package_name": "iterable", "path": "not_null_stg_iterable__campaig_3ce753a10225cac67c8a1434b5541997.sql", "original_file_path": "models/staging/stg_iterable.yml", "unique_id": "test.iterable.not_null_stg_iterable__campaign_suppression_list_history_campaign_id.3921289710", "fqn": ["iterable", "staging", "not_null_stg_iterable__campaign_suppression_list_history_campaign_id"], "alias": "not_null_stg_iterable__campaig_3ce753a10225cac67c8a1434b5541997", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "not_null_stg_iterable__campaig_3ce753a10225cac67c8a1434b5541997", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "sql_header": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"alias": "not_null_stg_iterable__campaig_3ce753a10225cac67c8a1434b5541997"}, "created_at": 1786586790.6699057, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"not_null_stg_iterable__campaig_3ce753a10225cac67c8a1434b5541997\") }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__campaign_suppression_list_history", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.iterable.stg_iterable__campaign_suppression_list_history"]}, "compiled_path": "target/compiled/iterable/models/staging/stg_iterable.yml/not_null_stg_iterable__campaig_3ce753a10225cac67c8a1434b5541997.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect campaign_id\nfrom \"postgres\".\"public_iterable_dev\".\"stg_iterable__campaign_suppression_list_history\"\nwhere campaign_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "campaign_id", "file_key_name": "models.stg_iterable__campaign_suppression_list_history", "attached_node": "model.iterable.stg_iterable__campaign_suppression_list_history", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "campaign_id", "model": "{{ get_where_subquery(ref('stg_iterable__campaign_suppression_list_history')) }}"}, "namespace": null}}, "test.iterable.not_null_stg_iterable__channel_channel_id.182ceb9636": {"database": "postgres", "schema": "public_dbt_test__audit", "name": "not_null_stg_iterable__channel_channel_id", "resource_type": "test", "package_name": "iterable", "path": "not_null_stg_iterable__channel_channel_id.sql", "original_file_path": "models/staging/stg_iterable.yml", "unique_id": "test.iterable.not_null_stg_iterable__channel_channel_id.182ceb9636", "fqn": ["iterable", "staging", "not_null_stg_iterable__channel_channel_id"], "alias": "not_null_stg_iterable__channel_channel_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "sql_header": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {}, "created_at": 1786586790.6724665, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__channel", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.iterable.stg_iterable__channel"]}, "compiled_path": "target/compiled/iterable/models/staging/stg_iterable.yml/not_null_stg_iterable__channel_channel_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect channel_id\nfrom \"postgres\".\"public_iterable_dev\".\"stg_iterable__channel\"\nwhere channel_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "channel_id", "file_key_name": "models.stg_iterable__channel", "attached_node": "model.iterable.stg_iterable__channel", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "channel_id", "model": "{{ get_where_subquery(ref('stg_iterable__channel')) }}"}, "namespace": null}}, "test.iterable.not_null_stg_iterable__event_event_id.370cd4bc9d": {"database": "postgres", "schema": "public_dbt_test__audit", "name": "not_null_stg_iterable__event_event_id", "resource_type": "test", "package_name": "iterable", "path": "not_null_stg_iterable__event_event_id.sql", "original_file_path": "models/staging/stg_iterable.yml", "unique_id": "test.iterable.not_null_stg_iterable__event_event_id.370cd4bc9d", "fqn": ["iterable", "staging", "not_null_stg_iterable__event_event_id"], "alias": "not_null_stg_iterable__event_event_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "sql_header": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {}, "created_at": 1786586790.675015, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__event", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.iterable.stg_iterable__event"]}, "compiled_path": "target/compiled/iterable/models/staging/stg_iterable.yml/not_null_stg_iterable__event_event_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect event_id\nfrom \"postgres\".\"public_iterable_dev\".\"stg_iterable__event\"\nwhere event_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "event_id", "file_key_name": "models.stg_iterable__event", "attached_node": "model.iterable.stg_iterable__event", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "event_id", "model": "{{ get_where_subquery(ref('stg_iterable__event')) }}"}, "namespace": null}}, "test.iterable.not_null_stg_iterable__event_unique_event_id.e2b46d3bb6": {"database": "postgres", "schema": "public_dbt_test__audit", "name": "not_null_stg_iterable__event_unique_event_id", "resource_type": "test", "package_name": "iterable", "path": "not_null_stg_iterable__event_unique_event_id.sql", "original_file_path": "models/staging/stg_iterable.yml", "unique_id": "test.iterable.not_null_stg_iterable__event_unique_event_id.e2b46d3bb6", "fqn": ["iterable", "staging", "not_null_stg_iterable__event_unique_event_id"], "alias": "not_null_stg_iterable__event_unique_event_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "sql_header": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {}, "created_at": 1786586790.6776617, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__event", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.iterable.stg_iterable__event"]}, "compiled_path": "target/compiled/iterable/models/staging/stg_iterable.yml/not_null_stg_iterable__event_unique_event_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect unique_event_id\nfrom \"postgres\".\"public_iterable_dev\".\"stg_iterable__event\"\nwhere unique_event_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "unique_event_id", "file_key_name": "models.stg_iterable__event", "attached_node": "model.iterable.stg_iterable__event", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "unique_event_id", "model": "{{ get_where_subquery(ref('stg_iterable__event')) }}"}, "namespace": null}}, "test.iterable.not_null_stg_iterable__event_extension_event_id.144dedcd30": {"database": "postgres", "schema": "public_dbt_test__audit", "name": "not_null_stg_iterable__event_extension_event_id", "resource_type": "test", "package_name": "iterable", "path": "not_null_stg_iterable__event_extension_event_id.sql", "original_file_path": "models/staging/stg_iterable.yml", "unique_id": "test.iterable.not_null_stg_iterable__event_extension_event_id.144dedcd30", "fqn": ["iterable", "staging", "not_null_stg_iterable__event_extension_event_id"], "alias": "not_null_stg_iterable__event_extension_event_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "sql_header": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {}, "created_at": 1786586790.6803484, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__event_extension", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.iterable.stg_iterable__event_extension"]}, "compiled_path": "target/compiled/iterable/models/staging/stg_iterable.yml/not_null_stg_iterable__event_extension_event_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect event_id\nfrom \"postgres\".\"public_iterable_dev\".\"stg_iterable__event_extension\"\nwhere event_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "event_id", "file_key_name": "models.stg_iterable__event_extension", "attached_node": "model.iterable.stg_iterable__event_extension", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "event_id", "model": "{{ get_where_subquery(ref('stg_iterable__event_extension')) }}"}, "namespace": null}}, "test.iterable.not_null_stg_iterable__list_list_id.47029d839a": {"database": "postgres", "schema": "public_dbt_test__audit", "name": "not_null_stg_iterable__list_list_id", "resource_type": "test", "package_name": "iterable", "path": "not_null_stg_iterable__list_list_id.sql", "original_file_path": "models/staging/stg_iterable.yml", "unique_id": "test.iterable.not_null_stg_iterable__list_list_id.47029d839a", "fqn": ["iterable", "staging", "not_null_stg_iterable__list_list_id"], "alias": "not_null_stg_iterable__list_list_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "sql_header": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {}, "created_at": 1786586790.682875, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__list", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.iterable.stg_iterable__list"]}, "compiled_path": "target/compiled/iterable/models/staging/stg_iterable.yml/not_null_stg_iterable__list_list_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect list_id\nfrom \"postgres\".\"public_iterable_dev\".\"stg_iterable__list\"\nwhere list_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "list_id", "file_key_name": "models.stg_iterable__list", "attached_node": "model.iterable.stg_iterable__list", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "list_id", "model": "{{ get_where_subquery(ref('stg_iterable__list')) }}"}, "namespace": null}}, "test.iterable.not_null_stg_iterable__message_type_message_type_id.75eaa6fa62": {"database": "postgres", "schema": "public_dbt_test__audit", "name": "not_null_stg_iterable__message_type_message_type_id", "resource_type": "test", "package_name": "iterable", "path": "not_null_stg_iterable__message_type_message_type_id.sql", "original_file_path": "models/staging/stg_iterable.yml", "unique_id": "test.iterable.not_null_stg_iterable__message_type_message_type_id.75eaa6fa62", "fqn": ["iterable", "staging", "not_null_stg_iterable__message_type_message_type_id"], "alias": "not_null_stg_iterable__message_type_message_type_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "sql_header": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {}, "created_at": 1786586790.6854327, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__message_type", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.iterable.stg_iterable__message_type"]}, "compiled_path": "target/compiled/iterable/models/staging/stg_iterable.yml/not_null_stg_iterable__message_type_message_type_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect message_type_id\nfrom \"postgres\".\"public_iterable_dev\".\"stg_iterable__message_type\"\nwhere message_type_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "message_type_id", "file_key_name": "models.stg_iterable__message_type", "attached_node": "model.iterable.stg_iterable__message_type", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "message_type_id", "model": "{{ get_where_subquery(ref('stg_iterable__message_type')) }}"}, "namespace": null}}, "test.iterable.not_null_stg_iterable__template_history_template_id.14b24a1dfe": {"database": "postgres", "schema": "public_dbt_test__audit", "name": "not_null_stg_iterable__template_history_template_id", "resource_type": "test", "package_name": "iterable", "path": "not_null_stg_iterable__template_history_template_id.sql", "original_file_path": "models/staging/stg_iterable.yml", "unique_id": "test.iterable.not_null_stg_iterable__template_history_template_id.14b24a1dfe", "fqn": ["iterable", "staging", "not_null_stg_iterable__template_history_template_id"], "alias": "not_null_stg_iterable__template_history_template_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "sql_header": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {}, "created_at": 1786586790.6879544, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__template_history", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.iterable.stg_iterable__template_history"]}, "compiled_path": "target/compiled/iterable/models/staging/stg_iterable.yml/not_null_stg_iterable__template_history_template_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect template_id\nfrom \"postgres\".\"public_iterable_dev\".\"stg_iterable__template_history\"\nwhere template_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "template_id", "file_key_name": "models.stg_iterable__template_history", "attached_node": "model.iterable.stg_iterable__template_history", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "template_id", "model": "{{ get_where_subquery(ref('stg_iterable__template_history')) }}"}, "namespace": null}}, "test.iterable.not_null_stg_iterable__list_user__fivetran_user_id.cca4b34c07": {"database": "postgres", "schema": "public_dbt_test__audit", "name": "not_null_stg_iterable__list_user__fivetran_user_id", "resource_type": "test", "package_name": "iterable", "path": "not_null_stg_iterable__list_user__fivetran_user_id.sql", "original_file_path": "models/staging/stg_iterable.yml", "unique_id": "test.iterable.not_null_stg_iterable__list_user__fivetran_user_id.cca4b34c07", "fqn": ["iterable", "staging", "not_null_stg_iterable__list_user__fivetran_user_id"], "alias": "not_null_stg_iterable__list_user__fivetran_user_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "sql_header": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {}, "created_at": 1786586790.6904554, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__list_user", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.iterable.stg_iterable__list_user"]}, "compiled_path": "target/compiled/iterable/models/staging/stg_iterable.yml/not_null_stg_iterable__list_user__fivetran_user_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect _fivetran_user_id\nfrom \"postgres\".\"public_iterable_dev\".\"stg_iterable__list_user\"\nwhere _fivetran_user_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "_fivetran_user_id", "file_key_name": "models.stg_iterable__list_user", "attached_node": "model.iterable.stg_iterable__list_user", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "_fivetran_user_id", "model": "{{ get_where_subquery(ref('stg_iterable__list_user')) }}"}, "namespace": null}}, "test.iterable.not_null_stg_iterable__user_history_unique_user_key.2845af2127": {"database": "postgres", "schema": "public_dbt_test__audit", "name": "not_null_stg_iterable__user_history_unique_user_key", "resource_type": "test", "package_name": "iterable", "path": "not_null_stg_iterable__user_history_unique_user_key.sql", "original_file_path": "models/staging/stg_iterable.yml", "unique_id": "test.iterable.not_null_stg_iterable__user_history_unique_user_key.2845af2127", "fqn": ["iterable", "staging", "not_null_stg_iterable__user_history_unique_user_key"], "alias": "not_null_stg_iterable__user_history_unique_user_key", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "sql_header": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {}, "created_at": 1786586790.693138, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__user_history", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.iterable.stg_iterable__user_history"]}, "compiled_path": "target/compiled/iterable/models/staging/stg_iterable.yml/not_null_stg_iterable__user_history_unique_user_key.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect unique_user_key\nfrom \"postgres\".\"public_iterable_dev\".\"stg_iterable__user_history\"\nwhere unique_user_key is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "unique_user_key", "file_key_name": "models.stg_iterable__user_history", "attached_node": "model.iterable.stg_iterable__user_history", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "unique_user_key", "model": "{{ get_where_subquery(ref('stg_iterable__user_history')) }}"}, "namespace": null}}, "test.iterable.not_null_stg_iterable__user_unsubscribed_channel_channel_id.da0ed9e9be": {"database": "postgres", "schema": "public_dbt_test__audit", "name": "not_null_stg_iterable__user_unsubscribed_channel_channel_id", "resource_type": "test", "package_name": "iterable", "path": "not_null_stg_iterable__user_unsubscribed_channel_channel_id.sql", "original_file_path": "models/staging/stg_iterable.yml", "unique_id": "test.iterable.not_null_stg_iterable__user_unsubscribed_channel_channel_id.da0ed9e9be", "fqn": ["iterable", "staging", "not_null_stg_iterable__user_unsubscribed_channel_channel_id"], "alias": "not_null_stg_iterable__user_unsubscribed_channel_channel_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "sql_header": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {}, "created_at": 1786586790.695642, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__user_unsubscribed_channel", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.iterable.stg_iterable__user_unsubscribed_channel"]}, "compiled_path": "target/compiled/iterable/models/staging/stg_iterable.yml/not_null_stg_iterable__user_unsubscribed_channel_channel_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect channel_id\nfrom \"postgres\".\"public_iterable_dev\".\"stg_iterable__user_unsubscribed_channel\"\nwhere channel_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "channel_id", "file_key_name": "models.stg_iterable__user_unsubscribed_channel", "attached_node": "model.iterable.stg_iterable__user_unsubscribed_channel", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "channel_id", "model": "{{ get_where_subquery(ref('stg_iterable__user_unsubscribed_channel')) }}"}, "namespace": null}}, "test.iterable.not_null_stg_iterable__user_unsub_message_type_message_type_id.268a89ea6f": {"database": "postgres", "schema": "public_dbt_test__audit", "name": "not_null_stg_iterable__user_unsub_message_type_message_type_id", "resource_type": "test", "package_name": "iterable", "path": "not_null_stg_iterable__user_unsub_message_type_message_type_id.sql", "original_file_path": "models/staging/stg_iterable.yml", "unique_id": "test.iterable.not_null_stg_iterable__user_unsub_message_type_message_type_id.268a89ea6f", "fqn": ["iterable", "staging", "not_null_stg_iterable__user_unsub_message_type_message_type_id"], "alias": "not_null_stg_iterable__user_unsub_message_type_message_type_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "sql_header": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {}, "created_at": 1786586790.6981535, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__user_unsub_message_type", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.iterable.stg_iterable__user_unsub_message_type"]}, "compiled_path": "target/compiled/iterable/models/staging/stg_iterable.yml/not_null_stg_iterable__user_unsub_message_type_message_type_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect message_type_id\nfrom \"postgres\".\"public_iterable_dev\".\"stg_iterable__user_unsub_message_type\"\nwhere message_type_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "message_type_id", "file_key_name": "models.stg_iterable__user_unsub_message_type", "attached_node": "model.iterable.stg_iterable__user_unsub_message_type", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "message_type_id", "model": "{{ get_where_subquery(ref('stg_iterable__user_unsub_message_type')) }}"}, "namespace": null}}}, "sources": {"source.iterable.iterable.campaign_history": {"database": "postgres", "schema": "public", "name": "campaign_history", "resource_type": "source", "package_name": "iterable", "path": "models/staging/src_iterable.yml", "original_file_path": "models/staging/src_iterable.yml", "unique_id": "source.iterable.iterable.campaign_history", "fqn": ["iterable", "staging", "iterable", "campaign_history"], "source_name": "iterable", "source_description": "", "loader": "fivetran", "identifier": "campaign_history_data", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Table containing a history of campaigns.", "columns": {"id": {"name": "id", "description": "Unique identifier of the campaign record", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "updated_at": {"name": "updated_at", "description": "Last update's timestamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "name": {"name": "name", "description": "User defined name of the campaign.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "campaign_state": {"name": "campaign_state", "description": "State of the campaign. Can be Draft, Ready, Scheduled, Running, Finished, Starting, Aborted or Recurring", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "type": {"name": "type", "description": "The campaign type. Can be Blast or Triggered", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "send_size": {"name": "send_size", "description": "Size of the campaign. Number of individuals included in the campaign", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "start_at": {"name": "start_at", "description": "Start timestamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "ended_at": {"name": "ended_at", "description": "Ended timestamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "created_at": {"name": "created_at", "description": "Creation timestamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "recurring_campaign_id": {"name": "recurring_campaign_id", "description": "Reference to the recurring campaign, if applicable", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "created_by_user_id": {"name": "created_by_user_id", "description": "Reference to the user who created the campaign", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "template_id": {"name": "template_id", "description": "Reference to the campaign template", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "updated_by_user_id": {"name": "updated_by_user_id", "description": "ID of the user who updated this record", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "message_medium": {"name": "message_medium", "description": "The medium that this message was sent via, for example Email or InApp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": "_fivetran_synced", "loaded_at_query": null, "meta": {}, "tags": [], "static_analysis": null}, "patch_path": null, "unrendered_config": {"loaded_at_field": "_fivetran_synced", "enabled": true, "loaded_at_query": null, "meta": {}, "tags": []}, "relation_name": "\"postgres\".\"public\".\"campaign_history_data\"", "created_at": 1786586790.7274532, "unrendered_database": "{% if target.type != 'spark' %}{{ var('iterable_database', target.database)}}{% endif %}", "unrendered_schema": "{{var ('iterable_schema', 'iterable')}}", "doc_blocks": []}, "source.iterable.iterable.campaign_label_history": {"database": "postgres", "schema": "public", "name": "campaign_label_history", "resource_type": "source", "package_name": "iterable", "path": "models/staging/src_iterable.yml", "original_file_path": "models/staging/src_iterable.yml", "unique_id": "source.iterable.iterable.campaign_label_history", "fqn": ["iterable", "staging", "iterable", "campaign_label_history"], "source_name": "iterable", "source_description": "", "loader": "fivetran", "identifier": "campaign_label_history_data", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Table containing a history of labels.", "columns": {"campaign_id": {"name": "campaign_id", "description": "Reference to the campaign associated with the label", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "label": {"name": "label", "description": "Name of the label", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "updated_at": {"name": "updated_at", "description": "Last update timestamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": "_fivetran_synced", "loaded_at_query": null, "meta": {}, "tags": [], "static_analysis": null}, "patch_path": null, "unrendered_config": {"loaded_at_field": "_fivetran_synced", "enabled": true, "loaded_at_query": null, "meta": {}, "tags": []}, "relation_name": "\"postgres\".\"public\".\"campaign_label_history_data\"", "created_at": 1786586790.7296154, "unrendered_database": "{% if target.type != 'spark' %}{{ var('iterable_database', target.database)}}{% endif %}", "unrendered_schema": "{{var ('iterable_schema', 'iterable')}}", "doc_blocks": []}, "source.iterable.iterable.campaign_list_history": {"database": "postgres", "schema": "public", "name": "campaign_list_history", "resource_type": "source", "package_name": "iterable", "path": "models/staging/src_iterable.yml", "original_file_path": "models/staging/src_iterable.yml", "unique_id": "source.iterable.iterable.campaign_list_history", "fqn": ["iterable", "staging", "iterable", "campaign_list_history"], "source_name": "iterable", "source_description": "", "loader": "fivetran", "identifier": "campaign_list_history_data", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Table containing a history of lists.", "columns": {"campaign_id": {"name": "campaign_id", "description": "Reference to the campaign associated with the label", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "list_id": {"name": "list_id", "description": "Reference to the list used", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "updated_at": {"name": "updated_at", "description": "Last update timestamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": "_fivetran_synced", "loaded_at_query": null, "meta": {}, "tags": [], "static_analysis": null}, "patch_path": null, "unrendered_config": {"loaded_at_field": "_fivetran_synced", "enabled": true, "loaded_at_query": null, "meta": {}, "tags": []}, "relation_name": "\"postgres\".\"public\".\"campaign_list_history_data\"", "created_at": 1786586790.7302346, "unrendered_database": "{% if target.type != 'spark' %}{{ var('iterable_database', target.database)}}{% endif %}", "unrendered_schema": "{{var ('iterable_schema', 'iterable')}}", "doc_blocks": []}, "source.iterable.iterable.campaign_suppression_list_history": {"database": "postgres", "schema": "public", "name": "campaign_suppression_list_history", "resource_type": "source", "package_name": "iterable", "path": "models/staging/src_iterable.yml", "original_file_path": "models/staging/src_iterable.yml", "unique_id": "source.iterable.iterable.campaign_suppression_list_history", "fqn": ["iterable", "staging", "iterable", "campaign_suppression_list_history"], "source_name": "iterable", "source_description": "", "loader": "fivetran", "identifier": "campaign_suppression_list_history_data", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Table containing a history of suppression lists.\n", "columns": {"campaign_id": {"name": "campaign_id", "description": "Reference to the campaign associated with the label", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "suppressed_list_id": {"name": "suppressed_list_id", "description": "Reference to the list used", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "updated_at": {"name": "updated_at", "description": "Last update timestamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": "_fivetran_synced", "loaded_at_query": null, "meta": {}, "tags": [], "static_analysis": null}, "patch_path": null, "unrendered_config": {"loaded_at_field": "_fivetran_synced", "enabled": true, "loaded_at_query": null, "meta": {}, "tags": []}, "relation_name": "\"postgres\".\"public\".\"campaign_suppression_list_history_data\"", "created_at": 1786586790.7308183, "unrendered_database": "{% if target.type != 'spark' %}{{ var('iterable_database', target.database)}}{% endif %}", "unrendered_schema": "{{var ('iterable_schema', 'iterable')}}", "doc_blocks": []}, "source.iterable.iterable.channel": {"database": "postgres", "schema": "public", "name": "channel", "resource_type": "source", "package_name": "iterable", "path": "models/staging/src_iterable.yml", "original_file_path": "models/staging/src_iterable.yml", "unique_id": "source.iterable.iterable.channel", "fqn": ["iterable", "staging", "iterable", "channel"], "source_name": "iterable", "source_description": "", "loader": "fivetran", "identifier": "channel_data", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Table containing unique channels.", "columns": {"id": {"name": "id", "description": "Unique identifier of the channel", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "name": {"name": "name", "description": "User defined name of the channel", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "channel_type": {"name": "channel_type", "description": "The channel type", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "message_medium": {"name": "message_medium", "description": "The message medium associated with the channel", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": "_fivetran_synced", "loaded_at_query": null, "meta": {}, "tags": [], "static_analysis": null}, "patch_path": null, "unrendered_config": {"loaded_at_field": "_fivetran_synced", "enabled": true, "loaded_at_query": null, "meta": {}, "tags": []}, "relation_name": "\"postgres\".\"public\".\"channel_data\"", "created_at": 1786586790.7314084, "unrendered_database": "{% if target.type != 'spark' %}{{ var('iterable_database', target.database)}}{% endif %}", "unrendered_schema": "{{var ('iterable_schema', 'iterable')}}", "doc_blocks": []}, "source.iterable.iterable.event": {"database": "postgres", "schema": "public", "name": "event", "resource_type": "source", "package_name": "iterable", "path": "models/staging/src_iterable.yml", "original_file_path": "models/staging/src_iterable.yml", "unique_id": "source.iterable.iterable.event", "fqn": ["iterable", "staging", "iterable", "event"], "source_name": "iterable", "source_description": "", "loader": "fivetran", "identifier": "event_data", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Table containing individual events within campaigns.", "columns": {"_fivetran_id": {"name": "_fivetran_id", "description": "A Fivetran-created unique identifier derived from hashing campaign_id, created_at, and event_name.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "campaign_id": {"name": "campaign_id", "description": "Reference to the campaign from which the event originated", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "content_id": {"name": "content_id", "description": "Reference to the content the event is associated with.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "created_at": {"name": "created_at", "description": "Creation timestamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "email": {"name": "email", "description": "The user's email. User identifier, for email-based projects. Previously was the unique identifier for user records, for Iterable customers before August 2023. Exists if using the history version of the table.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "additional_properties": {"name": "additional_properties", "description": "json object containing addition event properties", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "event_name": {"name": "event_name", "description": "Name provided to the individual event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "message_bus_id": {"name": "message_bus_id", "description": "Reference to the message bus associated with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "message_id": {"name": "message_id", "description": "Reference to the message the event is associated with", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "message_type_id": {"name": "message_type_id", "description": "Reference to the type of message the event is associated with", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "recipient_state": {"name": "recipient_state", "description": "The state of the recipient upon receiving the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "status": {"name": "status", "description": "Status of the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "transactional_data": {"name": "transactional_data", "description": "Transactional data associated with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unsub_source": {"name": "unsub_source", "description": "Source of the unsubscribe event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "user_agent": {"name": "user_agent", "description": "User agent associated with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "user_agent_device": {"name": "user_agent_device", "description": "The device of the user agent", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "_fivetran_user_id": {"name": "_fivetran_user_id", "description": "A Fivetran-created unique identifier for users, derived from hashing user_id and/or email, depending on project type.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": "_fivetran_synced", "loaded_at_query": null, "meta": {}, "tags": [], "static_analysis": null}, "patch_path": null, "unrendered_config": {"loaded_at_field": "_fivetran_synced", "enabled": true, "loaded_at_query": null, "meta": {}, "tags": []}, "relation_name": "\"postgres\".\"public\".\"event_data\"", "created_at": 1786586790.73224, "unrendered_database": "{% if target.type != 'spark' %}{{ var('iterable_database', target.database)}}{% endif %}", "unrendered_schema": "{{var ('iterable_schema', 'iterable')}}", "doc_blocks": []}, "source.iterable.iterable.event_extension": {"database": "postgres", "schema": "public", "name": "event_extension", "resource_type": "source", "package_name": "iterable", "path": "models/staging/src_iterable.yml", "original_file_path": "models/staging/src_iterable.yml", "unique_id": "source.iterable.iterable.event_extension", "fqn": ["iterable", "staging", "iterable", "event_extension"], "source_name": "iterable", "source_description": "", "loader": "fivetran", "identifier": "event_extension_data", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Table containing additional properties from the event table.", "columns": {"_fivetran_id": {"name": "_fivetran_id", "description": "A Fivetran-created unique identifier derived from hashing campaign_id, created_at, and event_name.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "app_already_running": {"name": "app_already_running", "description": "Boolean indicating if the app is currently running or not", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "badge": {"name": "badge", "description": "Badge associated with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "canonical_url_id": {"name": "canonical_url_id", "description": "Reference to the url associated with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "content_available": {"name": "content_available", "description": "Content available from the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "content_id": {"name": "content_id", "description": "Reference to the content associated with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "deeplink_android": {"name": "deeplink_android", "description": "Deeplink associated with the event from an android device", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "deeplink_ios": {"name": "deeplink_ios", "description": "Deeplink associated with the event from an ios device", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "device": {"name": "device", "description": "The device associated with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "email_id": {"name": "email_id", "description": "Reference to the email associated with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "email_subject": {"name": "email_subject", "description": "Subject of the email associated with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "experiment_id": {"name": "experiment_id", "description": "Reference to the experiment used if the event is an experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "from_phone_number_id": {"name": "from_phone_number_id", "description": "Reference to the phone number which the event is from", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "from_smssender_id": {"name": "from_smssender_id", "description": "Reference to the sms sender which the event is from", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "image_url": {"name": "image_url", "description": "Image url of the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "is_ghost_push": {"name": "is_ghost_push", "description": "Boolean indicating if the event is a result of a ghost push", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "link_id": {"name": "link_id", "description": "Reference to the link associated with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "link_url": {"name": "link_url", "description": "Url of the link associated with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "locale": {"name": "locale", "description": "Locale associated with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "payload": {"name": "payload", "description": "Payload resulted from the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "platform_endpoint": {"name": "platform_endpoint", "description": "The specific platform endpoint of the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "push_message": {"name": "push_message", "description": "Boolean indicating if the event is a push message", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "region": {"name": "region", "description": "Region of the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "sms_message": {"name": "sms_message", "description": "Boolean indicating if the event is an sms message", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "sms_provider_response_code": {"name": "sms_provider_response_code", "description": "sms provider response code from the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "sms_provider_response_message": {"name": "sms_provider_response_message", "description": "sms provider response message from the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "sms_provider_response_more_info": {"name": "sms_provider_response_more_info", "description": "sms provider response addition info from the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "sms_provider_response_status": {"name": "sms_provider_response_status", "description": "Status of the sms provider response from the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "sound": {"name": "sound", "description": "Boolean indicating if a sound was used with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "to_phone_number": {"name": "to_phone_number", "description": "To phone number associated with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "url": {"name": "url", "description": "Url associated with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "workflow_id": {"name": "workflow_id", "description": "Reference to the workflow which the event originated", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "workflow_name": {"name": "workflow_name", "description": "Name of the workflow which the event originated", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "catalog_collection_count": {"name": "catalog_collection_count", "description": "The count of products or items collected in a catalog associated with the event.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "catalog_lookup_count": {"name": "catalog_lookup_count", "description": "The count of times a catalog was looked up or queried during the event.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "city": {"name": "city", "description": "The city associated with the event, which could be the location of the recipient.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "clicked_url": {"name": "clicked_url", "description": "The URL that was clicked by the recipient in response to the marketing message.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "country": {"name": "country", "description": "The country associated with the event, which could be the location of the recipient.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "error_code": {"name": "error_code", "description": "The error code or message indicating any issues or errors encountered during the event.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "expires_at": {"name": "expires_at", "description": "The date and time when the event or message is set to expire or become invalid.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "from_phone_number": {"name": "from_phone_number", "description": "The phone number from which the SMS message was sent.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "in_app_body": {"name": "in_app_body", "description": "The content or body of an in-app message that was sent as part of the event.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "is_sms_estimation": {"name": "is_sms_estimation", "description": "A boolean indicating whether the SMS message is an estimation or not.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "labels": {"name": "labels", "description": "Any labels or tags associated with the event, which can be used for categorization or organization.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "message_context": {"name": "message_context", "description": "Additional contextual information related to the marketing message or event.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "message_status": {"name": "message_status", "description": "The status of the marketing message, such as sent, delivered, opened, etc.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "mms_send_count": {"name": "mms_send_count", "description": "The count of multimedia messages (MMS) sent as part of the event.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "product_recommendation_count": {"name": "product_recommendation_count", "description": "The count of product recommendations included in the message.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "proxy_source": {"name": "proxy_source", "description": "Information about the source or proxy used for sending the message.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "reason": {"name": "reason", "description": "The reason or cause associated with a specific event or action.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "sms_send_count": {"name": "sms_send_count", "description": "The count of SMS messages sent as part of the event.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "web_push_body": {"name": "web_push_body", "description": "The content or body of a web push notification sent as part of the event.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "web_push_click_action": {"name": "web_push_click_action", "description": "The action triggered when a recipient clicks a web push notification.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "web_push_icon": {"name": "web_push_icon", "description": "The icon or image associated with the web push notification.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "web_push_message": {"name": "web_push_message", "description": "The message or notification sent to web users as part of the event.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": "_fivetran_synced", "loaded_at_query": null, "meta": {}, "tags": [], "static_analysis": null}, "patch_path": null, "unrendered_config": {"loaded_at_field": "_fivetran_synced", "enabled": true, "loaded_at_query": null, "meta": {}, "tags": []}, "relation_name": "\"postgres\".\"public\".\"event_extension_data\"", "created_at": 1786586790.7331226, "unrendered_database": "{% if target.type != 'spark' %}{{ var('iterable_database', target.database)}}{% endif %}", "unrendered_schema": "{{var ('iterable_schema', 'iterable')}}", "doc_blocks": []}, "source.iterable.iterable.list": {"database": "postgres", "schema": "public", "name": "list", "resource_type": "source", "package_name": "iterable", "path": "models/staging/src_iterable.yml", "original_file_path": "models/staging/src_iterable.yml", "unique_id": "source.iterable.iterable.list", "fqn": ["iterable", "staging", "iterable", "list"], "source_name": "iterable", "source_description": "", "loader": "fivetran", "identifier": "list_data", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Table containing users and the lists the users are associated with.", "columns": {"id": {"name": "id", "description": "Unique identifier of the list", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "name": {"name": "name", "description": "User defined name of the list", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "list_type": {"name": "list_type", "description": "The list type", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "created_at": {"name": "created_at", "description": "Creation timestamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "description": {"name": "description", "description": "Information about the list", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": "_fivetran_synced", "loaded_at_query": null, "meta": {}, "tags": [], "static_analysis": null}, "patch_path": null, "unrendered_config": {"loaded_at_field": "_fivetran_synced", "enabled": true, "loaded_at_query": null, "meta": {}, "tags": []}, "relation_name": "\"postgres\".\"public\".\"list_data\"", "created_at": 1786586790.7337523, "unrendered_database": "{% if target.type != 'spark' %}{{ var('iterable_database', target.database)}}{% endif %}", "unrendered_schema": "{{var ('iterable_schema', 'iterable')}}", "doc_blocks": []}, "source.iterable.iterable.message_type": {"database": "postgres", "schema": "public", "name": "message_type", "resource_type": "source", "package_name": "iterable", "path": "models/staging/src_iterable.yml", "original_file_path": "models/staging/src_iterable.yml", "unique_id": "source.iterable.iterable.message_type", "fqn": ["iterable", "staging", "iterable", "message_type"], "source_name": "iterable", "source_description": "", "loader": "fivetran", "identifier": "message_type_data", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Table containing unique message types.", "columns": {"id": {"name": "id", "description": "Unique identifier of the message type", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "name": {"name": "name", "description": "User defined name of the message type", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "channel_id": {"name": "channel_id", "description": "Channel that this message type belongs to", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "created_at": {"name": "created_at", "description": "Time when the message type was initially created", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "frequency_cap": {"name": "frequency_cap", "description": "The maximum number of times a message of this type can be sent to a recipient within a specified time period to prevent over-messaging", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "rate_limit_per_minute": {"name": "rate_limit_per_minute", "description": "The maximum number of messages of this type that can be sent to recipients in a minute, ensuring controlled message delivery", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "subscription_policy": {"name": "subscription_policy", "description": "Information about the policy or rules governing how users can subscribe to or unsubscribe from this specific message type, like OptOut", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "updated_at": {"name": "updated_at", "description": "Time when the message type was last updated or modified", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": "_fivetran_synced", "loaded_at_query": null, "meta": {}, "tags": [], "static_analysis": null}, "patch_path": null, "unrendered_config": {"loaded_at_field": "_fivetran_synced", "enabled": true, "loaded_at_query": null, "meta": {}, "tags": []}, "relation_name": "\"postgres\".\"public\".\"message_type_data\"", "created_at": 1786586790.7343607, "unrendered_database": "{% if target.type != 'spark' %}{{ var('iterable_database', target.database)}}{% endif %}", "unrendered_schema": "{{var ('iterable_schema', 'iterable')}}", "doc_blocks": []}, "source.iterable.iterable.template_history": {"database": "postgres", "schema": "public", "name": "template_history", "resource_type": "source", "package_name": "iterable", "path": "models/staging/src_iterable.yml", "original_file_path": "models/staging/src_iterable.yml", "unique_id": "source.iterable.iterable.template_history", "fqn": ["iterable", "staging", "iterable", "template_history"], "source_name": "iterable", "source_description": "", "loader": "fivetran", "identifier": "template_history_data", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Table containing unique templates used across campaigns.", "columns": {"id": {"name": "id", "description": "Unique identifier of the template", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "name": {"name": "name", "description": "User defined name of the template", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "template_type": {"name": "template_type", "description": "The type of the template", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "created_at": {"name": "created_at", "description": "Creation timestamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "client_template_id": {"name": "client_template_id", "description": "Reference to the client template", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "creator_user_id": {"name": "creator_user_id", "description": "Reference to the user who created the template", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "message_type_id": {"name": "message_type_id", "description": "Reference to the message type associated with the template", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "updated_at": {"name": "updated_at", "description": "Last update timestamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": "_fivetran_synced", "loaded_at_query": null, "meta": {}, "tags": [], "static_analysis": null}, "patch_path": null, "unrendered_config": {"loaded_at_field": "_fivetran_synced", "enabled": true, "loaded_at_query": null, "meta": {}, "tags": []}, "relation_name": "\"postgres\".\"public\".\"template_history_data\"", "created_at": 1786586790.7349522, "unrendered_database": "{% if target.type != 'spark' %}{{ var('iterable_database', target.database)}}{% endif %}", "unrendered_schema": "{{var ('iterable_schema', 'iterable')}}", "doc_blocks": []}, "source.iterable.iterable.user_history": {"database": "postgres", "schema": "public", "name": "user_history", "resource_type": "source", "package_name": "iterable", "path": "models/staging/src_iterable.yml", "original_file_path": "models/staging/src_iterable.yml", "unique_id": "source.iterable.iterable.user_history", "fqn": ["iterable", "staging", "iterable", "user_history"], "source_name": "iterable", "source_description": "", "loader": "fivetran", "identifier": "user_history_data", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Table containing individual user history information.", "columns": {"email": {"name": "email", "description": "The user's email. Previously was the unique identifier for the user records, for Iterable customers before August 2023. This has since been replaced by iterable_user_id.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "user_id": {"name": "user_id", "description": "User defined identifier of the user. This is not a unique field", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "iterable_user_id": {"name": "iterable_user_id", "description": "The unique identifier of the user", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "first_name": {"name": "first_name", "description": "First name of the user", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "last_name": {"name": "last_name", "description": "Last name of the user", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "email_list_ids": {"name": "email_list_ids", "description": "[DEPRECATED October 13, 2025 Use LIST_USER source instead.] Array of references to the lists associated with the user\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "signup_date": {"name": "signup_date", "description": "Timestamp of when the user signed up", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "signup_source": {"name": "signup_source", "description": "Source where the user signed up", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "updated_at": {"name": "updated_at", "description": "Last update timestamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": "_fivetran_synced", "loaded_at_query": null, "meta": {}, "tags": [], "static_analysis": null}, "patch_path": null, "unrendered_config": {"loaded_at_field": "_fivetran_synced", "enabled": true, "loaded_at_query": null, "meta": {}, "tags": []}, "relation_name": "\"postgres\".\"public\".\"user_history_data\"", "created_at": 1786586790.7355278, "unrendered_database": "{% if target.type != 'spark' %}{{ var('iterable_database', target.database)}}{% endif %}", "unrendered_schema": "{{var ('iterable_schema', 'iterable')}}", "doc_blocks": []}, "source.iterable.iterable.user_unsubscribed_channel": {"database": "postgres", "schema": "public", "name": "user_unsubscribed_channel", "resource_type": "source", "package_name": "iterable", "path": "models/staging/src_iterable.yml", "original_file_path": "models/staging/src_iterable.yml", "unique_id": "source.iterable.iterable.user_unsubscribed_channel", "fqn": ["iterable", "staging", "iterable", "user_unsubscribed_channel"], "source_name": "iterable", "source_description": "", "loader": "fivetran", "identifier": "user_unsubscribed_channel_data", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Table containing the channels from which a user has unsubscribed.", "columns": {"_fivetran_id": {"name": "_fivetran_id", "description": "A Fivetran-created unique identifier for users, derived from hashing user_id and/or email, depending on project type.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "channel_id": {"name": "channel_id", "description": "Reference to the channel from which the user unsubscribed", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": "_fivetran_synced", "loaded_at_query": null, "meta": {}, "tags": [], "static_analysis": null}, "patch_path": null, "unrendered_config": {"loaded_at_field": "_fivetran_synced", "enabled": true, "loaded_at_query": null, "meta": {}, "tags": []}, "relation_name": "\"postgres\".\"public\".\"user_unsubscribed_channel_data\"", "created_at": 1786586790.736069, "unrendered_database": "{% if target.type != 'spark' %}{{ var('iterable_database', target.database)}}{% endif %}", "unrendered_schema": "{{var ('iterable_schema', 'iterable')}}", "doc_blocks": []}, "source.iterable.iterable.user_unsubscribed_message_type": {"database": "postgres", "schema": "public", "name": "user_unsubscribed_message_type", "resource_type": "source", "package_name": "iterable", "path": "models/staging/src_iterable.yml", "original_file_path": "models/staging/src_iterable.yml", "unique_id": "source.iterable.iterable.user_unsubscribed_message_type", "fqn": ["iterable", "staging", "iterable", "user_unsubscribed_message_type"], "source_name": "iterable", "source_description": "", "loader": "fivetran", "identifier": "user_unsubscribed_message_type_data", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Table containing the message types from which a user has unsubscribed.", "columns": {"_fivetran_id": {"name": "_fivetran_id", "description": "A Fivetran-created unique identifier for users, derived from hashing user_id and/or email, depending on project type.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "message_type_id": {"name": "message_type_id", "description": "Reference to the message type from which the user unsubscribed", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": "_fivetran_synced", "loaded_at_query": null, "meta": {}, "tags": [], "static_analysis": null}, "patch_path": null, "unrendered_config": {"loaded_at_field": "_fivetran_synced", "enabled": true, "loaded_at_query": null, "meta": {}, "tags": []}, "relation_name": "\"postgres\".\"public\".\"user_unsubscribed_message_type_data\"", "created_at": 1786586790.7366068, "unrendered_database": "{% if target.type != 'spark' %}{{ var('iterable_database', target.database)}}{% endif %}", "unrendered_schema": "{{var ('iterable_schema', 'iterable')}}", "doc_blocks": []}, "source.iterable.iterable.user_unsubscribed_channel_history": {"database": "postgres", "schema": "public", "name": "user_unsubscribed_channel_history", "resource_type": "source", "package_name": "iterable", "path": "models/staging/src_iterable.yml", "original_file_path": "models/staging/src_iterable.yml", "unique_id": "source.iterable.iterable.user_unsubscribed_channel_history", "fqn": ["iterable", "staging", "iterable", "user_unsubscribed_channel_history"], "source_name": "iterable", "source_description": "", "loader": "fivetran", "identifier": "user_unsubscribed_channel_history_data", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Table containing the history of channels from which a user has unsubscribed.", "columns": {"channel_id": {"name": "channel_id", "description": "Reference to the channel from which the user unsubscribed", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "email": {"name": "email", "description": "Unique identifier of the user", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "updated_at": {"name": "updated_at", "description": "Last update timestamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": "_fivetran_synced", "loaded_at_query": null, "meta": {}, "tags": [], "static_analysis": null}, "patch_path": null, "unrendered_config": {"loaded_at_field": "_fivetran_synced", "enabled": true, "loaded_at_query": null, "meta": {}, "tags": []}, "relation_name": "\"postgres\".\"public\".\"user_unsubscribed_channel_history_data\"", "created_at": 1786586790.7371743, "unrendered_database": "{% if target.type != 'spark' %}{{ var('iterable_database', target.database)}}{% endif %}", "unrendered_schema": "{{var ('iterable_schema', 'iterable')}}", "doc_blocks": []}, "source.iterable.iterable.user_unsubscribed_message_type_history": {"database": "postgres", "schema": "public", "name": "user_unsubscribed_message_type_history", "resource_type": "source", "package_name": "iterable", "path": "models/staging/src_iterable.yml", "original_file_path": "models/staging/src_iterable.yml", "unique_id": "source.iterable.iterable.user_unsubscribed_message_type_history", "fqn": ["iterable", "staging", "iterable", "user_unsubscribed_message_type_history"], "source_name": "iterable", "source_description": "", "loader": "fivetran", "identifier": "user_unsubscribed_message_type_history_data", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Table containing the history of message types from which a user has unsubscribed.", "columns": {"message_type_id": {"name": "message_type_id", "description": "Reference to the message type from which the user unsubscribed", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "email": {"name": "email", "description": "Unique identifier of the user", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "updated_at": {"name": "updated_at", "description": "Last update timestamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": "_fivetran_synced", "loaded_at_query": null, "meta": {}, "tags": [], "static_analysis": null}, "patch_path": null, "unrendered_config": {"loaded_at_field": "_fivetran_synced", "enabled": true, "loaded_at_query": null, "meta": {}, "tags": []}, "relation_name": "\"postgres\".\"public\".\"user_unsubscribed_message_type_history_data\"", "created_at": 1786586790.7377317, "unrendered_database": "{% if target.type != 'spark' %}{{ var('iterable_database', target.database)}}{% endif %}", "unrendered_schema": "{{var ('iterable_schema', 'iterable')}}", "doc_blocks": []}, "source.iterable.iterable.list_user": {"database": "postgres", "schema": "public", "name": "list_user", "resource_type": "source", "package_name": "iterable", "path": "models/staging/src_iterable.yml", "original_file_path": "models/staging/src_iterable.yml", "unique_id": "source.iterable.iterable.list_user", "fqn": ["iterable", "staging", "iterable", "list_user"], "source_name": "iterable", "source_description": "", "loader": "fivetran", "identifier": "list_user_data", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Table containing the relationship between users and lists they belong to.", "columns": {"_fivetran_id": {"name": "_fivetran_id", "description": "Unique identifier of the list-user relationship record, serving as a foreign key to `user_history._fivetran_id`.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "index": {"name": "index", "description": "Index of the record", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "list_id": {"name": "list_id", "description": "Reference to the list that the user belongs to", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "Timestamp when the record was last synced by Fivetran", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": "_fivetran_synced", "loaded_at_query": null, "meta": {}, "tags": [], "static_analysis": null}, "patch_path": null, "unrendered_config": {"loaded_at_field": "_fivetran_synced", "enabled": true, "loaded_at_query": null, "meta": {}, "tags": []}, "relation_name": "\"postgres\".\"public\".\"list_user_data\"", "created_at": 1786586790.7382953, "unrendered_database": "{% if target.type != 'spark' %}{{ var('iterable_database', target.database)}}{% endif %}", "unrendered_schema": "{{var ('iterable_schema', 'iterable')}}", "doc_blocks": []}}, "macros": {"macro.dbt_postgres.postgres__current_timestamp": {"name": "postgres__current_timestamp", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/timestamps.sql", "original_file_path": "macros/timestamps.sql", "unique_id": "macro.dbt_postgres.postgres__current_timestamp", "macro_sql": "{% macro postgres__current_timestamp() -%}\n now()\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1786586787.5133045, "supported_languages": null}, "macro.dbt_postgres.postgres__snapshot_string_as_time": {"name": "postgres__snapshot_string_as_time", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/timestamps.sql", "original_file_path": "macros/timestamps.sql", "unique_id": "macro.dbt_postgres.postgres__snapshot_string_as_time", "macro_sql": "{% macro postgres__snapshot_string_as_time(timestamp) -%}\n {%- set result = \"'\" ~ timestamp ~ \"'::timestamp without time zone\" -%}\n {{ return(result) }}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "timestamp", "type": null, "description": ""}], "created_at": 1786586787.5136964, "supported_languages": null}, "macro.dbt_postgres.postgres__snapshot_get_time": {"name": "postgres__snapshot_get_time", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/timestamps.sql", "original_file_path": "macros/timestamps.sql", "unique_id": "macro.dbt_postgres.postgres__snapshot_get_time", "macro_sql": "{% macro postgres__snapshot_get_time() -%}\n {{ current_timestamp() }}::timestamp without time zone\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.current_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1786586787.5139139, "supported_languages": null}, "macro.dbt_postgres.postgres__current_timestamp_backcompat": {"name": "postgres__current_timestamp_backcompat", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/timestamps.sql", "original_file_path": "macros/timestamps.sql", "unique_id": "macro.dbt_postgres.postgres__current_timestamp_backcompat", "macro_sql": "{% macro postgres__current_timestamp_backcompat() %}\n current_timestamp::{{ type_timestamp() }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.type_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1786586787.5141106, "supported_languages": null}, "macro.dbt_postgres.postgres__current_timestamp_in_utc_backcompat": {"name": "postgres__current_timestamp_in_utc_backcompat", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/timestamps.sql", "original_file_path": "macros/timestamps.sql", "unique_id": "macro.dbt_postgres.postgres__current_timestamp_in_utc_backcompat", "macro_sql": "{% macro postgres__current_timestamp_in_utc_backcompat() %}\n (current_timestamp at time zone 'utc')::{{ type_timestamp() }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.type_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1786586787.5142915, "supported_languages": null}, "macro.dbt_postgres.postgres__create_table_as": {"name": "postgres__create_table_as", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "unique_id": "macro.dbt_postgres.postgres__create_table_as", "macro_sql": "{% macro postgres__create_table_as(temporary, relation, sql) -%}\n {%- set unlogged = config.get('unlogged', default=false) -%}\n {%- set sql_header = config.get('sql_header', none) -%}\n\n {{ sql_header if sql_header is not none }}\n\n create {% if temporary -%}\n temporary\n {%- elif unlogged -%}\n unlogged\n {%- endif %} table {{ relation }}\n {% set contract_config = config.get('contract') %}\n {% if contract_config.enforced %}\n {{ get_assert_columns_equivalent(sql) }}\n {% endif -%}\n {% if contract_config.enforced and (not temporary) -%}\n {{ get_table_columns_and_constraints() }} ;\n insert into {{ relation }} (\n {{ adapter.dispatch('get_column_names', 'dbt')() }}\n )\n {%- set sql = get_select_subquery(sql) %}\n {% else %}\n as\n {% endif %}\n (\n {{ sql }}\n );\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.get_assert_columns_equivalent", "macro.dbt.get_table_columns_and_constraints", "macro.dbt.default__get_column_names", "macro.dbt.get_select_subquery"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "temporary", "type": null, "description": ""}, {"name": "relation", "type": null, "description": ""}, {"name": "sql", "type": null, "description": ""}], "created_at": 1786586787.5182114, "supported_languages": null}, "macro.dbt_postgres.postgres__get_create_index_sql": {"name": "postgres__get_create_index_sql", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "unique_id": "macro.dbt_postgres.postgres__get_create_index_sql", "macro_sql": "{% macro postgres__get_create_index_sql(relation, index_dict) -%}\n {%- set index_config = adapter.parse_index(index_dict) -%}\n {%- set comma_separated_columns = \", \".join(index_config.columns) -%}\n {%- set index_name = index_config.render(relation) -%}\n\n create {% if index_config.unique -%}\n unique\n {%- endif %} index if not exists\n \"{{ index_name }}\"\n on {{ relation }} {% if index_config.type -%}\n using {{ index_config.type }}\n {%- endif %}\n ({{ comma_separated_columns }})\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "index_dict", "type": null, "description": ""}], "created_at": 1786586787.5190575, "supported_languages": null}, "macro.dbt_postgres.postgres__create_schema": {"name": "postgres__create_schema", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "unique_id": "macro.dbt_postgres.postgres__create_schema", "macro_sql": "{% macro postgres__create_schema(relation) -%}\n {% if relation.database -%}\n {{ adapter.verify_database(relation.database) }}\n {%- endif -%}\n {%- call statement('create_schema') -%}\n create schema if not exists {{ relation.without_identifier().include(database=False) }}\n {%- endcall -%}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1786586787.5196326, "supported_languages": null}, "macro.dbt_postgres.postgres__drop_schema": {"name": "postgres__drop_schema", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "unique_id": "macro.dbt_postgres.postgres__drop_schema", "macro_sql": "{% macro postgres__drop_schema(relation) -%}\n {% if relation.database -%}\n {{ adapter.verify_database(relation.database) }}\n {%- endif -%}\n {%- call statement('drop_schema') -%}\n drop schema if exists {{ relation.without_identifier().include(database=False) }} cascade\n {%- endcall -%}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1786586787.5201988, "supported_languages": null}, "macro.dbt_postgres.postgres__get_columns_in_relation": {"name": "postgres__get_columns_in_relation", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "unique_id": "macro.dbt_postgres.postgres__get_columns_in_relation", "macro_sql": "{% macro postgres__get_columns_in_relation(relation) -%}\n {% call statement('get_columns_in_relation', fetch_result=True) %}\n select\n column_name,\n data_type,\n character_maximum_length,\n numeric_precision,\n numeric_scale\n\n from {{ relation.information_schema('columns') }}\n where table_name = '{{ relation.identifier }}'\n {% if relation.schema %}\n and table_schema = '{{ relation.schema }}'\n {% endif %}\n order by ordinal_position\n\n {% endcall %}\n {% set table = load_result('get_columns_in_relation').table %}\n {{ return(sql_convert_columns_in_relation(table)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement", "macro.dbt.sql_convert_columns_in_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1786586787.5209885, "supported_languages": null}, "macro.dbt_postgres.postgres__list_relations_without_caching": {"name": "postgres__list_relations_without_caching", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "unique_id": "macro.dbt_postgres.postgres__list_relations_without_caching", "macro_sql": "{% macro postgres__list_relations_without_caching(schema_relation) %}\n {% call statement('list_relations_without_caching', fetch_result=True) -%}\n select\n '{{ schema_relation.database }}' as database,\n tablename as name,\n schemaname as schema,\n 'table' as type\n from pg_tables\n where schemaname ilike '{{ schema_relation.schema }}'\n union all\n select\n '{{ schema_relation.database }}' as database,\n viewname as name,\n schemaname as schema,\n 'view' as type\n from pg_views\n where schemaname ilike '{{ schema_relation.schema }}'\n union all\n select\n '{{ schema_relation.database }}' as database,\n matviewname as name,\n schemaname as schema,\n 'materialized_view' as type\n from pg_matviews\n where schemaname ilike '{{ schema_relation.schema }}'\n union all\n select distinct\n '{{ schema_relation.database }}' as database,\n proname as name,\n ns.nspname as schema,\n 'function' as type\n from pg_proc\n join pg_namespace as ns on pronamespace = ns.oid\n where ns.nspname ilike '{{ schema_relation.schema }}'\n {% endcall %}\n {{ return(load_result('list_relations_without_caching').table) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "schema_relation", "type": null, "description": ""}], "created_at": 1786586787.5219653, "supported_languages": null}, "macro.dbt_postgres.postgres__information_schema_name": {"name": "postgres__information_schema_name", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "unique_id": "macro.dbt_postgres.postgres__information_schema_name", "macro_sql": "{% macro postgres__information_schema_name(database) -%}\n {% if database_name -%}\n {{ adapter.verify_database(database_name) }}\n {%- endif -%}\n information_schema\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "database", "type": null, "description": ""}], "created_at": 1786586787.5222766, "supported_languages": null}, "macro.dbt_postgres.postgres__list_schemas": {"name": "postgres__list_schemas", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "unique_id": "macro.dbt_postgres.postgres__list_schemas", "macro_sql": "{% macro postgres__list_schemas(database) %}\n {% if database -%}\n {{ adapter.verify_database(database) }}\n {%- endif -%}\n {% call statement('list_schemas', fetch_result=True, auto_begin=False) %}\n select distinct nspname from pg_namespace\n {% endcall %}\n {{ return(load_result('list_schemas').table) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "database", "type": null, "description": ""}], "created_at": 1786586787.5228384, "supported_languages": null}, "macro.dbt_postgres.postgres__check_schema_exists": {"name": "postgres__check_schema_exists", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "unique_id": "macro.dbt_postgres.postgres__check_schema_exists", "macro_sql": "{% macro postgres__check_schema_exists(information_schema, schema) -%}\n {% if information_schema.database -%}\n {{ adapter.verify_database(information_schema.database) }}\n {%- endif -%}\n {% call statement('check_schema_exists', fetch_result=True, auto_begin=False) %}\n select count(*) from pg_namespace where nspname = '{{ schema }}'\n {% endcall %}\n {{ return(load_result('check_schema_exists').table) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "information_schema", "type": null, "description": ""}, {"name": "schema", "type": null, "description": ""}], "created_at": 1786586787.5234768, "supported_languages": null}, "macro.dbt_postgres.postgres__make_relation_with_suffix": {"name": "postgres__make_relation_with_suffix", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "unique_id": "macro.dbt_postgres.postgres__make_relation_with_suffix", "macro_sql": "{% macro postgres__make_relation_with_suffix(base_relation, suffix, dstring) %}\n {% if dstring %}\n {% set dt = modules.datetime.datetime.now() %}\n {% set dtstring = dt.strftime(\"%H%M%S%f\") %}\n {% set suffix = suffix ~ dtstring %}\n {% endif %}\n {% set suffix_length = suffix|length %}\n {% set relation_max_name_length = base_relation.relation_max_name_length() %}\n {% if suffix_length > relation_max_name_length %}\n {% do exceptions.raise_compiler_error('Relation suffix is too long (' ~ suffix_length ~ ' characters). Maximum length is ' ~ relation_max_name_length ~ ' characters.') %}\n {% endif %}\n {% set identifier = base_relation.identifier[:relation_max_name_length - suffix_length] ~ suffix %}\n\n {{ return(base_relation.incorporate(path={\"identifier\": identifier })) }}\n\n {% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "base_relation", "type": null, "description": ""}, {"name": "suffix", "type": null, "description": ""}, {"name": "dstring", "type": null, "description": ""}], "created_at": 1786586787.5248277, "supported_languages": null}, "macro.dbt_postgres.postgres__make_intermediate_relation": {"name": "postgres__make_intermediate_relation", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "unique_id": "macro.dbt_postgres.postgres__make_intermediate_relation", "macro_sql": "{% macro postgres__make_intermediate_relation(base_relation, suffix) %}\n {{ return(postgres__make_relation_with_suffix(base_relation, suffix, dstring=False)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__make_relation_with_suffix"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "base_relation", "type": null, "description": ""}, {"name": "suffix", "type": null, "description": ""}], "created_at": 1786586787.525165, "supported_languages": null}, "macro.dbt_postgres.postgres__make_temp_relation": {"name": "postgres__make_temp_relation", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "unique_id": "macro.dbt_postgres.postgres__make_temp_relation", "macro_sql": "{% macro postgres__make_temp_relation(base_relation, suffix) %}\n {% set temp_relation = postgres__make_relation_with_suffix(base_relation, suffix, dstring=True) %}\n {{ return(temp_relation.incorporate(path={\"schema\": none,\n \"database\": none})) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__make_relation_with_suffix"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "base_relation", "type": null, "description": ""}, {"name": "suffix", "type": null, "description": ""}], "created_at": 1786586787.525682, "supported_languages": null}, "macro.dbt_postgres.postgres__make_backup_relation": {"name": "postgres__make_backup_relation", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "unique_id": "macro.dbt_postgres.postgres__make_backup_relation", "macro_sql": "{% macro postgres__make_backup_relation(base_relation, backup_relation_type, suffix) %}\n {% set backup_relation = postgres__make_relation_with_suffix(base_relation, suffix, dstring=False) %}\n {{ return(backup_relation.incorporate(type=backup_relation_type)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__make_relation_with_suffix"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "base_relation", "type": null, "description": ""}, {"name": "backup_relation_type", "type": null, "description": ""}, {"name": "suffix", "type": null, "description": ""}], "created_at": 1786586787.5261314, "supported_languages": null}, "macro.dbt_postgres.postgres_escape_comment": {"name": "postgres_escape_comment", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "unique_id": "macro.dbt_postgres.postgres_escape_comment", "macro_sql": "{% macro postgres_escape_comment(comment) -%}\n {% if comment is not string %}\n {% do exceptions.raise_compiler_error('cannot escape a non-string: ' ~ comment) %}\n {% endif %}\n {%- set magic = '$dbt_comment_literal_block$' -%}\n {%- if magic in comment -%}\n {%- do exceptions.raise_compiler_error('The string ' ~ magic ~ ' is not allowed in comments.') -%}\n {%- endif -%}\n {{ magic }}{{ comment }}{{ magic }}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "comment", "type": null, "description": ""}], "created_at": 1786586787.526804, "supported_languages": null}, "macro.dbt_postgres.postgres__alter_relation_comment": {"name": "postgres__alter_relation_comment", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "unique_id": "macro.dbt_postgres.postgres__alter_relation_comment", "macro_sql": "{% macro postgres__alter_relation_comment(relation, comment) %}\n {% set escaped_comment = postgres_escape_comment(comment) %}\n {% if relation.type == 'materialized_view' -%}\n {% set relation_type = \"materialized view\" %}\n {%- else -%}\n {%- set relation_type = relation.type -%}\n {%- endif -%}\n comment on {{ relation_type }} {{ relation }} is {{ escaped_comment }};\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres_escape_comment"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "comment", "type": null, "description": ""}], "created_at": 1786586787.5274217, "supported_languages": null}, "macro.dbt_postgres.postgres__alter_column_comment": {"name": "postgres__alter_column_comment", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "unique_id": "macro.dbt_postgres.postgres__alter_column_comment", "macro_sql": "{% macro postgres__alter_column_comment(relation, column_dict) %}\n {% set existing_columns = adapter.get_columns_in_relation(relation) | map(attribute=\"name\") | list %}\n {% for column_name in column_dict if (column_name in existing_columns) %}\n {% set comment = column_dict[column_name]['description'] %}\n {% set escaped_comment = postgres_escape_comment(comment) %}\n comment on column {{ relation }}.{{ adapter.quote(column_name) if column_dict[column_name]['quote'] else column_name }} is {{ escaped_comment }};\n {% endfor %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres_escape_comment"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "column_dict", "type": null, "description": ""}], "created_at": 1786586787.5283988, "supported_languages": null}, "macro.dbt_postgres.postgres__get_show_grant_sql": {"name": "postgres__get_show_grant_sql", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "unique_id": "macro.dbt_postgres.postgres__get_show_grant_sql", "macro_sql": "\n\n{%- macro postgres__get_show_grant_sql(relation) -%}\n select grantee, privilege_type\n from {{ relation.information_schema('role_table_grants') }}\n where grantor = current_role\n and grantee != current_role\n and table_schema = '{{ relation.schema }}'\n and table_name = '{{ relation.identifier }}'\n{%- endmacro -%}\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1786586787.5287306, "supported_languages": null}, "macro.dbt_postgres.postgres__copy_grants": {"name": "postgres__copy_grants", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "unique_id": "macro.dbt_postgres.postgres__copy_grants", "macro_sql": "{% macro postgres__copy_grants() %}\n {{ return(False) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1786586787.5289357, "supported_languages": null}, "macro.dbt_postgres.postgres__get_show_indexes_sql": {"name": "postgres__get_show_indexes_sql", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "unique_id": "macro.dbt_postgres.postgres__get_show_indexes_sql", "macro_sql": "{% macro postgres__get_show_indexes_sql(relation) %}\n select\n i.relname as name,\n m.amname as method,\n ix.indisunique as \"unique\",\n array_to_string(array_agg(a.attname), ',') as column_names\n from pg_index ix\n join pg_class i\n on i.oid = ix.indexrelid\n join pg_am m\n on m.oid=i.relam\n join pg_class t\n on t.oid = ix.indrelid\n join pg_namespace n\n on n.oid = t.relnamespace\n join pg_attribute a\n on a.attrelid = t.oid\n and a.attnum = ANY(ix.indkey)\n where t.relname = '{{ relation.identifier }}'\n and n.nspname = '{{ relation.schema }}'\n and t.relkind in ('r', 'm')\n group by 1, 2, 3\n order by 1, 2, 3\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1786586787.5292287, "supported_languages": null}, "macro.dbt_postgres.postgres__get_drop_index_sql": {"name": "postgres__get_drop_index_sql", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "unique_id": "macro.dbt_postgres.postgres__get_drop_index_sql", "macro_sql": "\n\n\n{%- macro postgres__get_drop_index_sql(relation, index_name) -%}\n drop index if exists \"{{ relation.schema }}\".\"{{ index_name }}\"\n{%- endmacro -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "index_name", "type": null, "description": ""}], "created_at": 1786586787.529459, "supported_languages": null}, "macro.dbt_postgres.postgres__get_catalog_relations": {"name": "postgres__get_catalog_relations", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/catalog.sql", "original_file_path": "macros/catalog.sql", "unique_id": "macro.dbt_postgres.postgres__get_catalog_relations", "macro_sql": "{% macro postgres__get_catalog_relations(information_schema, relations) -%}\n {%- call statement('catalog', fetch_result=True) -%}\n\n {#\n If the user has multiple databases set and the first one is wrong, this will fail.\n But we won't fail in the case where there are multiple quoting-difference-only dbs, which is better.\n #}\n {% set database = information_schema.database %}\n {{ adapter.verify_database(database) }}\n\n select\n '{{ database }}' as table_database,\n sch.nspname as table_schema,\n tbl.relname as table_name,\n case tbl.relkind\n when 'v' then 'VIEW'\n when 'm' then 'MATERIALIZED VIEW'\n else 'BASE TABLE'\n end as table_type,\n tbl_desc.description as table_comment,\n col.attname as column_name,\n col.attnum as column_index,\n pg_catalog.format_type(col.atttypid, col.atttypmod) as column_type,\n col_desc.description as column_comment,\n pg_get_userbyid(tbl.relowner) as table_owner\n\n from pg_catalog.pg_namespace sch\n join pg_catalog.pg_class tbl on tbl.relnamespace = sch.oid\n join pg_catalog.pg_attribute col on col.attrelid = tbl.oid\n left outer join pg_catalog.pg_description tbl_desc on (tbl_desc.objoid = tbl.oid and tbl_desc.objsubid = 0)\n left outer join pg_catalog.pg_description col_desc on (col_desc.objoid = tbl.oid and col_desc.objsubid = col.attnum)\n where (\n {%- for relation in relations -%}\n {%- if relation.identifier -%}\n (upper(sch.nspname) = upper('{{ relation.schema }}') and\n upper(tbl.relname) = upper('{{ relation.identifier }}'))\n {%- else-%}\n upper(sch.nspname) = upper('{{ relation.schema }}')\n {%- endif -%}\n {%- if not loop.last %} or {% endif -%}\n {%- endfor -%}\n )\n and not pg_is_other_temp_schema(sch.oid) -- not a temporary schema belonging to another session\n and tbl.relpersistence in ('p', 'u') -- [p]ermanent table or [u]nlogged table. Exclude [t]emporary tables\n and tbl.relkind in ('r', 'v', 'f', 'p', 'm') -- o[r]dinary table, [v]iew, [f]oreign table, [p]artitioned table, [m]aterialized view. Other values are [i]ndex, [S]equence, [c]omposite type, [t]OAST table\n and col.attnum > 0 -- negative numbers are used for system columns such as oid\n and not col.attisdropped -- column as not been dropped\n\n order by\n sch.nspname,\n tbl.relname,\n col.attnum\n\n {%- endcall -%}\n\n {{ return(load_result('catalog').table) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "information_schema", "type": null, "description": ""}, {"name": "relations", "type": null, "description": ""}], "created_at": 1786586787.5311353, "supported_languages": null}, "macro.dbt_postgres.postgres__get_catalog": {"name": "postgres__get_catalog", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/catalog.sql", "original_file_path": "macros/catalog.sql", "unique_id": "macro.dbt_postgres.postgres__get_catalog", "macro_sql": "{% macro postgres__get_catalog(information_schema, schemas) -%}\n {%- set relations = [] -%}\n {%- for schema in schemas -%}\n {%- set dummy = relations.append({'schema': schema}) -%}\n {%- endfor -%}\n {{ return(postgres__get_catalog_relations(information_schema, relations)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__get_catalog_relations"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "information_schema", "type": null, "description": ""}, {"name": "schemas", "type": null, "description": ""}], "created_at": 1786586787.531821, "supported_languages": null}, "macro.dbt_postgres.postgres__get_relations": {"name": "postgres__get_relations", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/relations.sql", "original_file_path": "macros/relations.sql", "unique_id": "macro.dbt_postgres.postgres__get_relations", "macro_sql": "{% macro postgres__get_relations() -%}\n\n {#\n -- in pg_depend, objid is the dependent, refobjid is the referenced object\n -- > a pg_depend entry indicates that the referenced object cannot be\n -- > dropped without also dropping the dependent object.\n #}\n\n {%- call statement('relations', fetch_result=True) -%}\n select distinct\n dependent_namespace.nspname as dependent_schema,\n dependent_class.relname as dependent_name,\n referenced_namespace.nspname as referenced_schema,\n referenced_class.relname as referenced_name\n\n -- Query for views: views are entries in pg_class with an entry in pg_rewrite, but we avoid\n -- a seq scan on pg_rewrite by leveraging the fact there is an \"internal\" row in pg_depend for\n -- the view...\n from pg_class as dependent_class\n join pg_namespace as dependent_namespace on dependent_namespace.oid = dependent_class.relnamespace\n join pg_depend as dependent_depend on dependent_depend.refobjid = dependent_class.oid\n and dependent_depend.classid = 'pg_rewrite'::regclass\n and dependent_depend.refclassid = 'pg_class'::regclass\n and dependent_depend.deptype = 'i'\n\n -- ... and via pg_depend (that has a row per column, hence the need for \"distinct\" above, and\n -- making sure to exclude the internal row to avoid a view appearing to depend on itself)...\n join pg_depend as joining_depend on joining_depend.objid = dependent_depend.objid\n and joining_depend.classid = 'pg_rewrite'::regclass\n and joining_depend.refclassid = 'pg_class'::regclass\n and joining_depend.refobjid != dependent_depend.refobjid\n\n -- ... we can find the tables they query from in pg_class, but excluding system tables. Note we\n -- don't need need to exclude _dependent_ system tables, because they only query from other\n -- system tables, and so are automatically excluded by excluding _referenced_ system tables\n join pg_class as referenced_class on referenced_class.oid = joining_depend.refobjid\n join pg_namespace as referenced_namespace on referenced_namespace.oid = referenced_class.relnamespace\n and referenced_namespace.nspname != 'information_schema'\n and referenced_namespace.nspname not like 'pg\\_%'\n\n order by\n dependent_schema, dependent_name, referenced_schema, referenced_name;\n\n {%- endcall -%}\n\n {{ return(load_result('relations').table) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1786586787.532691, "supported_languages": null}, "macro.dbt_postgres.postgres_get_relations": {"name": "postgres_get_relations", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/relations.sql", "original_file_path": "macros/relations.sql", "unique_id": "macro.dbt_postgres.postgres_get_relations", "macro_sql": "{% macro postgres_get_relations() %}\n {{ return(postgres__get_relations()) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__get_relations"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1786586787.5329194, "supported_languages": null}, "macro.dbt_postgres.postgres__dateadd": {"name": "postgres__dateadd", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/utils/dateadd.sql", "original_file_path": "macros/utils/dateadd.sql", "unique_id": "macro.dbt_postgres.postgres__dateadd", "macro_sql": "{% macro postgres__dateadd(datepart, interval, from_date_or_timestamp) %}\n\n {{ from_date_or_timestamp }} + ((interval '1 {{ datepart }}') * ({{ interval }}))\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "datepart", "type": null, "description": ""}, {"name": "interval", "type": null, "description": ""}, {"name": "from_date_or_timestamp", "type": null, "description": ""}], "created_at": 1786586787.533281, "supported_languages": null}, "macro.dbt_postgres.postgres__any_value": {"name": "postgres__any_value", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/utils/any_value.sql", "original_file_path": "macros/utils/any_value.sql", "unique_id": "macro.dbt_postgres.postgres__any_value", "macro_sql": "{% macro postgres__any_value(expression) -%}\n\n min({{ expression }})\n\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "expression", "type": null, "description": ""}], "created_at": 1786586787.5335429, "supported_languages": null}, "macro.dbt_postgres.postgres__equals": {"name": "postgres__equals", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/utils/equals.sql", "original_file_path": "macros/utils/equals.sql", "unique_id": "macro.dbt_postgres.postgres__equals", "macro_sql": "{% macro postgres__equals(expr1, expr2) -%}\n{%- if adapter.behavior.enable_truthy_nulls_equals_macro.no_warn %}\n ({{ expr1 }} IS NOT DISTINCT FROM {{ expr2 }})\n{%- else -%}\n ({{ expr1 }} = {{ expr2 }})\n{%- endif %}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "expr1", "type": null, "description": ""}, {"name": "expr2", "type": null, "description": ""}], "created_at": 1786586787.5340827, "supported_languages": null}, "macro.dbt_postgres.postgres__listagg": {"name": "postgres__listagg", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/utils/listagg.sql", "original_file_path": "macros/utils/listagg.sql", "unique_id": "macro.dbt_postgres.postgres__listagg", "macro_sql": "{% macro postgres__listagg(measure, delimiter_text, order_by_clause, limit_num) -%}\n\n {% if limit_num -%}\n array_to_string(\n (array_agg(\n {{ measure }}\n {% if order_by_clause -%}\n {{ order_by_clause }}\n {%- endif %}\n ))[1:{{ limit_num }}],\n {{ delimiter_text }}\n )\n {%- else %}\n string_agg(\n {{ measure }},\n {{ delimiter_text }}\n {% if order_by_clause -%}\n {{ order_by_clause }}\n {%- endif %}\n )\n {%- endif %}\n\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "measure", "type": null, "description": ""}, {"name": "delimiter_text", "type": null, "description": ""}, {"name": "order_by_clause", "type": null, "description": ""}, {"name": "limit_num", "type": null, "description": ""}], "created_at": 1786586787.5349562, "supported_languages": null}, "macro.dbt_postgres.postgres__datediff": {"name": "postgres__datediff", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/utils/datediff.sql", "original_file_path": "macros/utils/datediff.sql", "unique_id": "macro.dbt_postgres.postgres__datediff", "macro_sql": "{% macro postgres__datediff(first_date, second_date, datepart) -%}\n\n {% if datepart == 'year' %}\n (date_part('year', ({{second_date}})::date) - date_part('year', ({{first_date}})::date))\n {% elif datepart == 'quarter' %}\n ({{ datediff(first_date, second_date, 'year') }} * 4 + date_part('quarter', ({{second_date}})::date) - date_part('quarter', ({{first_date}})::date))\n {% elif datepart == 'month' %}\n ({{ datediff(first_date, second_date, 'year') }} * 12 + date_part('month', ({{second_date}})::date) - date_part('month', ({{first_date}})::date))\n {% elif datepart == 'day' %}\n (({{second_date}})::date - ({{first_date}})::date)\n {% elif datepart == 'week' %}\n ({{ datediff(first_date, second_date, 'day') }} / 7 + case\n when date_part('dow', ({{first_date}})::timestamp) <= date_part('dow', ({{second_date}})::timestamp) then\n case when {{first_date}} <= {{second_date}} then 0 else -1 end\n else\n case when {{first_date}} <= {{second_date}} then 1 else 0 end\n end)\n {% elif datepart == 'hour' %}\n ({{ datediff(first_date, second_date, 'day') }} * 24 + date_part('hour', ({{second_date}})::timestamp) - date_part('hour', ({{first_date}})::timestamp))\n {% elif datepart == 'minute' %}\n ({{ datediff(first_date, second_date, 'hour') }} * 60 + date_part('minute', ({{second_date}})::timestamp) - date_part('minute', ({{first_date}})::timestamp))\n {% elif datepart == 'second' %}\n ({{ datediff(first_date, second_date, 'minute') }} * 60 + floor(date_part('second', ({{second_date}})::timestamp)) - floor(date_part('second', ({{first_date}})::timestamp)))\n {% elif datepart == 'millisecond' %}\n ({{ datediff(first_date, second_date, 'minute') }} * 60000 + floor(date_part('millisecond', ({{second_date}})::timestamp)) - floor(date_part('millisecond', ({{first_date}})::timestamp)))\n {% elif datepart == 'microsecond' %}\n ({{ datediff(first_date, second_date, 'minute') }} * 60000000 + floor(date_part('microsecond', ({{second_date}})::timestamp)) - floor(date_part('microsecond', ({{first_date}})::timestamp)))\n {% else %}\n {{ exceptions.raise_compiler_error(\"Unsupported datepart for macro datediff in postgres: {!r}\".format(datepart)) }}\n {% endif %}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.datediff"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "first_date", "type": null, "description": ""}, {"name": "second_date", "type": null, "description": ""}, {"name": "datepart", "type": null, "description": ""}], "created_at": 1786586787.5382628, "supported_languages": null}, "macro.dbt_postgres.postgres__last_day": {"name": "postgres__last_day", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/utils/last_day.sql", "original_file_path": "macros/utils/last_day.sql", "unique_id": "macro.dbt_postgres.postgres__last_day", "macro_sql": "{% macro postgres__last_day(date, datepart) -%}\n\n {%- if datepart == 'quarter' -%}\n -- postgres dateadd does not support quarter interval.\n cast(\n {{dbt.dateadd('day', '-1',\n dbt.dateadd('month', '3', dbt.date_trunc(datepart, date))\n )}}\n as date)\n {%- else -%}\n {{dbt.default_last_day(date, datepart)}}\n {%- endif -%}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.dateadd", "macro.dbt.date_trunc", "macro.dbt.default_last_day"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "date", "type": null, "description": ""}, {"name": "datepart", "type": null, "description": ""}], "created_at": 1786586787.5391004, "supported_languages": null}, "macro.dbt_postgres.postgres__split_part": {"name": "postgres__split_part", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/utils/split_part.sql", "original_file_path": "macros/utils/split_part.sql", "unique_id": "macro.dbt_postgres.postgres__split_part", "macro_sql": "{% macro postgres__split_part(string_text, delimiter_text, part_number) %}\n\n {% if part_number >= 0 %}\n {{ dbt.default__split_part(string_text, delimiter_text, part_number) }}\n {% else %}\n {{ dbt._split_part_negative(string_text, delimiter_text, part_number) }}\n {% endif %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__split_part", "macro.dbt._split_part_negative"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "string_text", "type": null, "description": ""}, {"name": "delimiter_text", "type": null, "description": ""}, {"name": "part_number", "type": null, "description": ""}], "created_at": 1786586787.539748, "supported_languages": null}, "macro.dbt_postgres.postgres__snapshot_merge_sql": {"name": "postgres__snapshot_merge_sql", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/materializations/snapshot_merge.sql", "original_file_path": "macros/materializations/snapshot_merge.sql", "unique_id": "macro.dbt_postgres.postgres__snapshot_merge_sql", "macro_sql": "{% macro postgres__snapshot_merge_sql(target, source, insert_cols) -%}\n {%- set insert_cols_csv = insert_cols | join(', ') -%}\n\n {%- set columns = config.get(\"snapshot_table_column_names\") or get_snapshot_table_column_names() -%}\n\n update {{ target }}\n set {{ columns.dbt_valid_to }} = DBT_INTERNAL_SOURCE.{{ columns.dbt_valid_to }}\n from {{ source }} as DBT_INTERNAL_SOURCE\n where DBT_INTERNAL_SOURCE.{{ columns.dbt_scd_id }}::text = {{ target }}.{{ columns.dbt_scd_id }}::text\n and DBT_INTERNAL_SOURCE.dbt_change_type::text in ('update'::text, 'delete'::text)\n {% if config.get(\"dbt_valid_to_current\") %}\n and ({{ target }}.{{ columns.dbt_valid_to }} = {{ config.get('dbt_valid_to_current') }} or {{ target }}.{{ columns.dbt_valid_to }} is null);\n {% else %}\n and {{ target }}.{{ columns.dbt_valid_to }} is null;\n {% endif %}\n\n\n insert into {{ target }} ({{ insert_cols_csv }})\n select {% for column in insert_cols -%}\n DBT_INTERNAL_SOURCE.{{ column }} {%- if not loop.last %}, {%- endif %}\n {%- endfor %}\n from {{ source }} as DBT_INTERNAL_SOURCE\n where DBT_INTERNAL_SOURCE.dbt_change_type::text = 'insert'::text;\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_snapshot_table_column_names"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "target", "type": null, "description": ""}, {"name": "source", "type": null, "description": ""}, {"name": "insert_cols", "type": null, "description": ""}], "created_at": 1786586787.5415993, "supported_languages": null}, "macro.dbt_postgres.postgres__get_incremental_default_sql": {"name": "postgres__get_incremental_default_sql", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/materializations/incremental_strategies.sql", "original_file_path": "macros/materializations/incremental_strategies.sql", "unique_id": "macro.dbt_postgres.postgres__get_incremental_default_sql", "macro_sql": "{% macro postgres__get_incremental_default_sql(arg_dict) %}\n\n {% if arg_dict[\"unique_key\"] %}\n {% do return(get_incremental_delete_insert_sql(arg_dict)) %}\n {% else %}\n {% do return(get_incremental_append_sql(arg_dict)) %}\n {% endif %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_incremental_delete_insert_sql", "macro.dbt.get_incremental_append_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "arg_dict", "type": null, "description": ""}], "created_at": 1786586787.5423646, "supported_languages": null}, "macro.dbt_postgres.postgres__get_incremental_microbatch_sql": {"name": "postgres__get_incremental_microbatch_sql", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/materializations/incremental_strategies.sql", "original_file_path": "macros/materializations/incremental_strategies.sql", "unique_id": "macro.dbt_postgres.postgres__get_incremental_microbatch_sql", "macro_sql": "{% macro postgres__get_incremental_microbatch_sql(arg_dict) %}\n\n {% if arg_dict[\"unique_key\"] %}\n {% do return(adapter.dispatch('get_incremental_merge_sql', 'dbt')(arg_dict)) %}\n {% else %}\n {{ exceptions.raise_compiler_error(\"dbt-postgres 'microbatch' requires a `unique_key` config\") }}\n {% endif %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_incremental_merge_sql", "macro.dbt.default__get_incremental_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "arg_dict", "type": null, "description": ""}], "created_at": 1786586787.5428865, "supported_languages": null}, "macro.dbt_postgres.postgres__formatted_scalar_function_args_sql": {"name": "postgres__formatted_scalar_function_args_sql", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/materializations/functions/scalar.sql", "original_file_path": "macros/materializations/functions/scalar.sql", "unique_id": "macro.dbt_postgres.postgres__formatted_scalar_function_args_sql", "macro_sql": "{% macro postgres__formatted_scalar_function_args_sql() %}\n {% set args = [] %}\n {% for arg in model.arguments -%}\n {% set default_value = arg.get('default_value', none) %}\n {% if default_value != none %}\n {%- do args.append(arg.name ~ ' ' ~ arg.data_type ~ ' DEFAULT ' ~ default_value) -%}\n {% else %}\n {%- do args.append(arg.name ~ ' ' ~ arg.data_type) -%}\n {% endif %}\n {%- endfor %}\n {{ args | join(', ') }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1786586787.5440357, "supported_languages": null}, "macro.dbt_postgres.postgres__get_rename_table_sql": {"name": "postgres__get_rename_table_sql", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/relations/table/rename.sql", "original_file_path": "macros/relations/table/rename.sql", "unique_id": "macro.dbt_postgres.postgres__get_rename_table_sql", "macro_sql": "{% macro postgres__get_rename_table_sql(relation, new_name) %}\n alter table {{ relation }} rename to {{ new_name }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "new_name", "type": null, "description": ""}], "created_at": 1786586787.5443494, "supported_languages": null}, "macro.dbt_postgres.postgres__get_replace_table_sql": {"name": "postgres__get_replace_table_sql", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/relations/table/replace.sql", "original_file_path": "macros/relations/table/replace.sql", "unique_id": "macro.dbt_postgres.postgres__get_replace_table_sql", "macro_sql": "{% macro postgres__get_replace_table_sql(relation, sql) -%}\n\n {%- set sql_header = config.get('sql_header', none) -%}\n {{ sql_header if sql_header is not none }}\n\n create or replace table {{ relation }}\n {% set contract_config = config.get('contract') %}\n {% if contract_config.enforced %}\n {{ get_assert_columns_equivalent(sql) }}\n {{ get_table_columns_and_constraints() }}\n {%- set sql = get_select_subquery(sql) %}\n {% endif %}\n as (\n {{ sql }}\n );\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.get_assert_columns_equivalent", "macro.dbt.get_table_columns_and_constraints", "macro.dbt.get_select_subquery"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "sql", "type": null, "description": ""}], "created_at": 1786586787.5454738, "supported_languages": null}, "macro.dbt_postgres.postgres__drop_table": {"name": "postgres__drop_table", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/relations/table/drop.sql", "original_file_path": "macros/relations/table/drop.sql", "unique_id": "macro.dbt_postgres.postgres__drop_table", "macro_sql": "{% macro postgres__drop_table(relation) -%}\n drop table if exists {{ relation }} cascade\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1786586787.5457249, "supported_languages": null}, "macro.dbt_postgres.postgres__get_rename_view_sql": {"name": "postgres__get_rename_view_sql", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/relations/view/rename.sql", "original_file_path": "macros/relations/view/rename.sql", "unique_id": "macro.dbt_postgres.postgres__get_rename_view_sql", "macro_sql": "{% macro postgres__get_rename_view_sql(relation, new_name) %}\n alter view {{ relation }} rename to {{ new_name }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "new_name", "type": null, "description": ""}], "created_at": 1786586787.5460253, "supported_languages": null}, "macro.dbt_postgres.postgres__get_replace_view_sql": {"name": "postgres__get_replace_view_sql", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/relations/view/replace.sql", "original_file_path": "macros/relations/view/replace.sql", "unique_id": "macro.dbt_postgres.postgres__get_replace_view_sql", "macro_sql": "{% macro postgres__get_replace_view_sql(relation, sql) -%}\n\n {%- set sql_header = config.get('sql_header', none) -%}\n {{ sql_header if sql_header is not none }}\n\n create or replace view {{ relation }}\n {% set contract_config = config.get('contract') %}\n {% if contract_config.enforced %}\n {{ get_assert_columns_equivalent(sql) }}\n {%- endif %}\n as (\n {{ sql }}\n );\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.get_assert_columns_equivalent"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "sql", "type": null, "description": ""}], "created_at": 1786586787.5468626, "supported_languages": null}, "macro.dbt_postgres.postgres__drop_view": {"name": "postgres__drop_view", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/relations/view/drop.sql", "original_file_path": "macros/relations/view/drop.sql", "unique_id": "macro.dbt_postgres.postgres__drop_view", "macro_sql": "{% macro postgres__drop_view(relation) -%}\n drop view if exists {{ relation }} cascade\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1786586787.547123, "supported_languages": null}, "macro.dbt_postgres.postgres__describe_materialized_view": {"name": "postgres__describe_materialized_view", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/relations/materialized_view/describe.sql", "original_file_path": "macros/relations/materialized_view/describe.sql", "unique_id": "macro.dbt_postgres.postgres__describe_materialized_view", "macro_sql": "{% macro postgres__describe_materialized_view(relation) %}\n -- for now just get the indexes, we don't need the name or the query yet\n {% set _indexes = run_query(get_show_indexes_sql(relation)) %}\n {% do return({'indexes': _indexes}) %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.run_query", "macro.dbt.get_show_indexes_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1786586787.5476034, "supported_languages": null}, "macro.dbt_postgres.postgres__refresh_materialized_view": {"name": "postgres__refresh_materialized_view", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/relations/materialized_view/refresh.sql", "original_file_path": "macros/relations/materialized_view/refresh.sql", "unique_id": "macro.dbt_postgres.postgres__refresh_materialized_view", "macro_sql": "{% macro postgres__refresh_materialized_view(relation) %}\n refresh materialized view {{ relation }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1786586787.5478423, "supported_languages": null}, "macro.dbt_postgres.postgres__get_rename_materialized_view_sql": {"name": "postgres__get_rename_materialized_view_sql", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/relations/materialized_view/rename.sql", "original_file_path": "macros/relations/materialized_view/rename.sql", "unique_id": "macro.dbt_postgres.postgres__get_rename_materialized_view_sql", "macro_sql": "{% macro postgres__get_rename_materialized_view_sql(relation, new_name) %}\n alter materialized view {{ relation }} rename to {{ new_name }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "new_name", "type": null, "description": ""}], "created_at": 1786586787.5481434, "supported_languages": null}, "macro.dbt_postgres.postgres__get_alter_materialized_view_as_sql": {"name": "postgres__get_alter_materialized_view_as_sql", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/relations/materialized_view/alter.sql", "original_file_path": "macros/relations/materialized_view/alter.sql", "unique_id": "macro.dbt_postgres.postgres__get_alter_materialized_view_as_sql", "macro_sql": "{% macro postgres__get_alter_materialized_view_as_sql(\n relation,\n configuration_changes,\n sql,\n existing_relation,\n backup_relation,\n intermediate_relation\n) %}\n\n -- apply a full refresh immediately if needed\n {% if configuration_changes.requires_full_refresh %}\n\n {{ get_replace_sql(existing_relation, relation, sql) }}\n\n -- otherwise apply individual changes as needed\n {% else %}\n\n {{ postgres__update_indexes_on_materialized_view(relation, configuration_changes.indexes) }}\n\n {%- endif -%}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_replace_sql", "macro.dbt_postgres.postgres__update_indexes_on_materialized_view"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "configuration_changes", "type": null, "description": ""}, {"name": "sql", "type": null, "description": ""}, {"name": "existing_relation", "type": null, "description": ""}, {"name": "backup_relation", "type": null, "description": ""}, {"name": "intermediate_relation", "type": null, "description": ""}], "created_at": 1786586787.5490766, "supported_languages": null}, "macro.dbt_postgres.postgres__update_indexes_on_materialized_view": {"name": "postgres__update_indexes_on_materialized_view", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/relations/materialized_view/alter.sql", "original_file_path": "macros/relations/materialized_view/alter.sql", "unique_id": "macro.dbt_postgres.postgres__update_indexes_on_materialized_view", "macro_sql": "\n\n\n{%- macro postgres__update_indexes_on_materialized_view(relation, index_changes) -%}\n {{- log(\"Applying UPDATE INDEXES to: \" ~ relation) -}}\n\n {%- for _index_change in index_changes -%}\n {%- set _index = _index_change.context -%}\n\n {%- if _index_change.action == \"drop\" -%}\n\n {{ postgres__get_drop_index_sql(relation, _index.name) }}\n\n {%- elif _index_change.action == \"create\" -%}\n\n {{ postgres__get_create_index_sql(relation, _index.as_node_config) }}\n\n {%- endif -%}\n\t{{ ';' if not loop.last else \"\" }}\n\n {%- endfor -%}\n\n{%- endmacro -%}\n\n\n", "depends_on": {"macros": ["macro.dbt_postgres.postgres__get_drop_index_sql", "macro.dbt_postgres.postgres__get_create_index_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "index_changes", "type": null, "description": ""}], "created_at": 1786586787.5499606, "supported_languages": null}, "macro.dbt_postgres.postgres__get_materialized_view_configuration_changes": {"name": "postgres__get_materialized_view_configuration_changes", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/relations/materialized_view/alter.sql", "original_file_path": "macros/relations/materialized_view/alter.sql", "unique_id": "macro.dbt_postgres.postgres__get_materialized_view_configuration_changes", "macro_sql": "{% macro postgres__get_materialized_view_configuration_changes(existing_relation, new_config) %}\n {% set _existing_materialized_view = postgres__describe_materialized_view(existing_relation) %}\n {% set _configuration_changes = existing_relation.get_materialized_view_config_change_collection(_existing_materialized_view, new_config.model) %}\n {% do return(_configuration_changes) %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__describe_materialized_view"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "existing_relation", "type": null, "description": ""}, {"name": "new_config", "type": null, "description": ""}], "created_at": 1786586787.5504558, "supported_languages": null}, "macro.dbt_postgres.postgres__get_create_materialized_view_as_sql": {"name": "postgres__get_create_materialized_view_as_sql", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/relations/materialized_view/create.sql", "original_file_path": "macros/relations/materialized_view/create.sql", "unique_id": "macro.dbt_postgres.postgres__get_create_materialized_view_as_sql", "macro_sql": "{% macro postgres__get_create_materialized_view_as_sql(relation, sql) %}\n create materialized view if not exists {{ relation }} as {{ sql }};\n\n {% for _index_dict in config.get('indexes', []) -%}\n {{- get_create_index_sql(relation, _index_dict) -}}{{ ';' if not loop.last else \"\" }}\n {%- endfor -%}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_create_index_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "sql", "type": null, "description": ""}], "created_at": 1786586787.551187, "supported_languages": null}, "macro.dbt_postgres.postgres__drop_materialized_view": {"name": "postgres__drop_materialized_view", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/relations/materialized_view/drop.sql", "original_file_path": "macros/relations/materialized_view/drop.sql", "unique_id": "macro.dbt_postgres.postgres__drop_materialized_view", "macro_sql": "{% macro postgres__drop_materialized_view(relation) -%}\n drop materialized view if exists {{ relation }} cascade\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1786586787.5514336, "supported_languages": null}, "macro.dbt.dateadd": {"name": "dateadd", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/dateadd.sql", "original_file_path": "macros/utils/dateadd.sql", "unique_id": "macro.dbt.dateadd", "macro_sql": "{% macro dateadd(datepart, interval, from_date_or_timestamp) %}\n {{ return(adapter.dispatch('dateadd', 'dbt')(datepart, interval, from_date_or_timestamp)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__dateadd"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "datepart", "type": null, "description": ""}, {"name": "interval", "type": null, "description": ""}, {"name": "from_date_or_timestamp", "type": null, "description": ""}], "created_at": 1786586787.551959, "supported_languages": null}, "macro.dbt.default__dateadd": {"name": "default__dateadd", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/dateadd.sql", "original_file_path": "macros/utils/dateadd.sql", "unique_id": "macro.dbt.default__dateadd", "macro_sql": "{% macro default__dateadd(datepart, interval, from_date_or_timestamp) %}\n\n dateadd(\n {{ datepart }},\n {{ interval }},\n {{ from_date_or_timestamp }}\n )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "datepart", "type": null, "description": ""}, {"name": "interval", "type": null, "description": ""}, {"name": "from_date_or_timestamp", "type": null, "description": ""}], "created_at": 1786586787.5522418, "supported_languages": null}, "macro.dbt.array_append": {"name": "array_append", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/array_append.sql", "original_file_path": "macros/utils/array_append.sql", "unique_id": "macro.dbt.array_append", "macro_sql": "{% macro array_append(array, new_element) -%}\n {{ return(adapter.dispatch('array_append', 'dbt')(array, new_element)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__array_append"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "array", "type": null, "description": ""}, {"name": "new_element", "type": null, "description": ""}], "created_at": 1786586787.5528104, "supported_languages": null}, "macro.dbt.default__array_append": {"name": "default__array_append", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/array_append.sql", "original_file_path": "macros/utils/array_append.sql", "unique_id": "macro.dbt.default__array_append", "macro_sql": "{% macro default__array_append(array, new_element) -%}\n array_append({{ array }}, {{ new_element }})\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "array", "type": null, "description": ""}, {"name": "new_element", "type": null, "description": ""}], "created_at": 1786586787.5530581, "supported_languages": null}, "macro.dbt.escape_single_quotes": {"name": "escape_single_quotes", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/escape_single_quotes.sql", "original_file_path": "macros/utils/escape_single_quotes.sql", "unique_id": "macro.dbt.escape_single_quotes", "macro_sql": "{% macro escape_single_quotes(expression) %}\n {{ return(adapter.dispatch('escape_single_quotes', 'dbt') (expression)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__escape_single_quotes"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "expression", "type": null, "description": ""}], "created_at": 1786586787.5535054, "supported_languages": null}, "macro.dbt.default__escape_single_quotes": {"name": "default__escape_single_quotes", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/escape_single_quotes.sql", "original_file_path": "macros/utils/escape_single_quotes.sql", "unique_id": "macro.dbt.default__escape_single_quotes", "macro_sql": "{% macro default__escape_single_quotes(expression) -%}\n{{ expression | replace(\"'\",\"''\") }}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "expression", "type": null, "description": ""}], "created_at": 1786586787.553735, "supported_languages": null}, "macro.dbt.except": {"name": "except", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/except.sql", "original_file_path": "macros/utils/except.sql", "unique_id": "macro.dbt.except", "macro_sql": "{% macro except() %}\n {{ return(adapter.dispatch('except', 'dbt')()) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__except"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1786586787.554116, "supported_languages": null}, "macro.dbt.default__except": {"name": "default__except", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/except.sql", "original_file_path": "macros/utils/except.sql", "unique_id": "macro.dbt.default__except", "macro_sql": "{% macro default__except() %}\n\n except\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1786586787.5542462, "supported_languages": null}, "macro.dbt.any_value": {"name": "any_value", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/any_value.sql", "original_file_path": "macros/utils/any_value.sql", "unique_id": "macro.dbt.any_value", "macro_sql": "{% macro any_value(expression) -%}\n {{ return(adapter.dispatch('any_value', 'dbt') (expression)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__any_value"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "expression", "type": null, "description": ""}], "created_at": 1786586787.5546436, "supported_languages": null}, "macro.dbt.default__any_value": {"name": "default__any_value", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/any_value.sql", "original_file_path": "macros/utils/any_value.sql", "unique_id": "macro.dbt.default__any_value", "macro_sql": "{% macro default__any_value(expression) -%}\n\n any_value({{ expression }})\n\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "expression", "type": null, "description": ""}], "created_at": 1786586787.5548198, "supported_languages": null}, "macro.dbt.right": {"name": "right", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/right.sql", "original_file_path": "macros/utils/right.sql", "unique_id": "macro.dbt.right", "macro_sql": "{% macro right(string_text, length_expression) -%}\n {{ return(adapter.dispatch('right', 'dbt') (string_text, length_expression)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__right"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "string_text", "type": null, "description": ""}, {"name": "length_expression", "type": null, "description": ""}], "created_at": 1786586787.5552816, "supported_languages": null}, "macro.dbt.default__right": {"name": "default__right", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/right.sql", "original_file_path": "macros/utils/right.sql", "unique_id": "macro.dbt.default__right", "macro_sql": "{% macro default__right(string_text, length_expression) %}\n\n right(\n {{ string_text }},\n {{ length_expression }}\n )\n\n{%- endmacro -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "string_text", "type": null, "description": ""}, {"name": "length_expression", "type": null, "description": ""}], "created_at": 1786586787.5555072, "supported_languages": null}, "macro.dbt.string_literal": {"name": "string_literal", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/literal.sql", "original_file_path": "macros/utils/literal.sql", "unique_id": "macro.dbt.string_literal", "macro_sql": "{%- macro string_literal(value) -%}\n {{ return(adapter.dispatch('string_literal', 'dbt') (value)) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt.default__string_literal"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "value", "type": null, "description": ""}], "created_at": 1786586787.5559177, "supported_languages": null}, "macro.dbt.default__string_literal": {"name": "default__string_literal", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/literal.sql", "original_file_path": "macros/utils/literal.sql", "unique_id": "macro.dbt.default__string_literal", "macro_sql": "{% macro default__string_literal(value) -%}\n '{{ value }}'\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "value", "type": null, "description": ""}], "created_at": 1786586787.556091, "supported_languages": null}, "macro.dbt.replace": {"name": "replace", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/replace.sql", "original_file_path": "macros/utils/replace.sql", "unique_id": "macro.dbt.replace", "macro_sql": "{% macro replace(field, old_chars, new_chars) -%}\n {{ return(adapter.dispatch('replace', 'dbt') (field, old_chars, new_chars)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__replace"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field", "type": null, "description": ""}, {"name": "old_chars", "type": null, "description": ""}, {"name": "new_chars", "type": null, "description": ""}], "created_at": 1786586787.5565808, "supported_languages": null}, "macro.dbt.default__replace": {"name": "default__replace", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/replace.sql", "original_file_path": "macros/utils/replace.sql", "unique_id": "macro.dbt.default__replace", "macro_sql": "{% macro default__replace(field, old_chars, new_chars) %}\n\n replace(\n {{ field }},\n {{ old_chars }},\n {{ new_chars }}\n )\n\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field", "type": null, "description": ""}, {"name": "old_chars", "type": null, "description": ""}, {"name": "new_chars", "type": null, "description": ""}], "created_at": 1786586787.5568526, "supported_languages": null}, "macro.dbt.cast": {"name": "cast", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/cast.sql", "original_file_path": "macros/utils/cast.sql", "unique_id": "macro.dbt.cast", "macro_sql": "{% macro cast(field, type) %}\n {{ return(adapter.dispatch('cast', 'dbt') (field, type)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__cast"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field", "type": null, "description": ""}, {"name": "type", "type": null, "description": ""}], "created_at": 1786586787.5573192, "supported_languages": null}, "macro.dbt.default__cast": {"name": "default__cast", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/cast.sql", "original_file_path": "macros/utils/cast.sql", "unique_id": "macro.dbt.default__cast", "macro_sql": "{% macro default__cast(field, type) %}\n cast({{field}} as {{type}})\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field", "type": null, "description": ""}, {"name": "type", "type": null, "description": ""}], "created_at": 1786586787.55754, "supported_languages": null}, "macro.dbt.concat": {"name": "concat", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/concat.sql", "original_file_path": "macros/utils/concat.sql", "unique_id": "macro.dbt.concat", "macro_sql": "{% macro concat(fields) -%}\n {{ return(adapter.dispatch('concat', 'dbt')(fields)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__concat"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "fields", "type": null, "description": ""}], "created_at": 1786586787.5580597, "supported_languages": null}, "macro.dbt.default__concat": {"name": "default__concat", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/concat.sql", "original_file_path": "macros/utils/concat.sql", "unique_id": "macro.dbt.default__concat", "macro_sql": "{% macro default__concat(fields) -%}\n {{ fields|join(' || ') }}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "fields", "type": null, "description": ""}], "created_at": 1786586787.5582752, "supported_languages": null}, "macro.dbt.position": {"name": "position", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/position.sql", "original_file_path": "macros/utils/position.sql", "unique_id": "macro.dbt.position", "macro_sql": "{% macro position(substring_text, string_text) -%}\n {{ return(adapter.dispatch('position', 'dbt') (substring_text, string_text)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__position"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "substring_text", "type": null, "description": ""}, {"name": "string_text", "type": null, "description": ""}], "created_at": 1786586787.558733, "supported_languages": null}, "macro.dbt.default__position": {"name": "default__position", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/position.sql", "original_file_path": "macros/utils/position.sql", "unique_id": "macro.dbt.default__position", "macro_sql": "{% macro default__position(substring_text, string_text) %}\n\n position(\n {{ substring_text }} in {{ string_text }}\n )\n\n{%- endmacro -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "substring_text", "type": null, "description": ""}, {"name": "string_text", "type": null, "description": ""}], "created_at": 1786586787.5589726, "supported_languages": null}, "macro.dbt.get_intervals_between": {"name": "get_intervals_between", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/date_spine.sql", "original_file_path": "macros/utils/date_spine.sql", "unique_id": "macro.dbt.get_intervals_between", "macro_sql": "{% macro get_intervals_between(start_date, end_date, datepart) -%}\n {{ return(adapter.dispatch('get_intervals_between', 'dbt')(start_date, end_date, datepart)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_intervals_between"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "start_date", "type": null, "description": ""}, {"name": "end_date", "type": null, "description": ""}, {"name": "datepart", "type": null, "description": ""}], "created_at": 1786586787.5597918, "supported_languages": null}, "macro.dbt.default__get_intervals_between": {"name": "default__get_intervals_between", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/date_spine.sql", "original_file_path": "macros/utils/date_spine.sql", "unique_id": "macro.dbt.default__get_intervals_between", "macro_sql": "{% macro default__get_intervals_between(start_date, end_date, datepart) -%}\n {%- call statement('get_intervals_between', fetch_result=True) %}\n\n select {{ dbt.datediff(start_date, end_date, datepart) }}\n\n {%- endcall -%}\n\n {%- set value_list = load_result('get_intervals_between') -%}\n\n {%- if value_list and value_list['data'] -%}\n {%- set values = value_list['data'] | map(attribute=0) | list %}\n {{ return(values[0]) }}\n {%- else -%}\n {{ return(1) }}\n {%- endif -%}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.statement", "macro.dbt.datediff"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "start_date", "type": null, "description": ""}, {"name": "end_date", "type": null, "description": ""}, {"name": "datepart", "type": null, "description": ""}], "created_at": 1786586787.5607677, "supported_languages": null}, "macro.dbt.date_spine": {"name": "date_spine", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/date_spine.sql", "original_file_path": "macros/utils/date_spine.sql", "unique_id": "macro.dbt.date_spine", "macro_sql": "{% macro date_spine(datepart, start_date, end_date) %}\n {{ return(adapter.dispatch('date_spine', 'dbt')(datepart, start_date, end_date)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__date_spine"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "datepart", "type": null, "description": ""}, {"name": "start_date", "type": null, "description": ""}, {"name": "end_date", "type": null, "description": ""}], "created_at": 1786586787.5611663, "supported_languages": null}, "macro.dbt.default__date_spine": {"name": "default__date_spine", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/date_spine.sql", "original_file_path": "macros/utils/date_spine.sql", "unique_id": "macro.dbt.default__date_spine", "macro_sql": "{% macro default__date_spine(datepart, start_date, end_date) %}\n\n\n {# call as follows:\n\n date_spine(\n \"day\",\n \"to_date('01/01/2016', 'mm/dd/yyyy')\",\n \"dbt.dateadd(week, 1, current_date)\"\n ) #}\n\n\n with rawdata as (\n\n {{dbt.generate_series(\n dbt.get_intervals_between(start_date, end_date, datepart)\n )}}\n\n ),\n\n all_periods as (\n\n select (\n {{\n dbt.dateadd(\n datepart,\n \"row_number() over (order by 1) - 1\",\n start_date\n )\n }}\n ) as date_{{datepart}}\n from rawdata\n\n ),\n\n filtered as (\n\n select *\n from all_periods\n where date_{{datepart}} <= {{ end_date }}\n\n )\n\n select * from filtered\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.generate_series", "macro.dbt.get_intervals_between", "macro.dbt.dateadd"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "datepart", "type": null, "description": ""}, {"name": "start_date", "type": null, "description": ""}, {"name": "end_date", "type": null, "description": ""}], "created_at": 1786586787.5618072, "supported_languages": null}, "macro.dbt.cast_bool_to_text": {"name": "cast_bool_to_text", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/cast_bool_to_text.sql", "original_file_path": "macros/utils/cast_bool_to_text.sql", "unique_id": "macro.dbt.cast_bool_to_text", "macro_sql": "{% macro cast_bool_to_text(field) %}\n {{ adapter.dispatch('cast_bool_to_text', 'dbt') (field) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__cast_bool_to_text"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field", "type": null, "description": ""}], "created_at": 1786586787.5622602, "supported_languages": null}, "macro.dbt.default__cast_bool_to_text": {"name": "default__cast_bool_to_text", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/cast_bool_to_text.sql", "original_file_path": "macros/utils/cast_bool_to_text.sql", "unique_id": "macro.dbt.default__cast_bool_to_text", "macro_sql": "{% macro default__cast_bool_to_text(field) %}\n cast({{ field }} as {{ api.Column.translate_type('string') }})\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field", "type": null, "description": ""}], "created_at": 1786586787.5625267, "supported_languages": null}, "macro.dbt.length": {"name": "length", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/length.sql", "original_file_path": "macros/utils/length.sql", "unique_id": "macro.dbt.length", "macro_sql": "{% macro length(expression) -%}\n {{ return(adapter.dispatch('length', 'dbt') (expression)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__length"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "expression", "type": null, "description": ""}], "created_at": 1786586787.5629492, "supported_languages": null}, "macro.dbt.default__length": {"name": "default__length", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/length.sql", "original_file_path": "macros/utils/length.sql", "unique_id": "macro.dbt.default__length", "macro_sql": "{% macro default__length(expression) %}\n\n length(\n {{ expression }}\n )\n\n{%- endmacro -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "expression", "type": null, "description": ""}], "created_at": 1786586787.563129, "supported_languages": null}, "macro.dbt.hash": {"name": "hash", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/hash.sql", "original_file_path": "macros/utils/hash.sql", "unique_id": "macro.dbt.hash", "macro_sql": "{% macro hash(field) -%}\n {{ return(adapter.dispatch('hash', 'dbt') (field)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__hash"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field", "type": null, "description": ""}], "created_at": 1786586787.5635393, "supported_languages": null}, "macro.dbt.default__hash": {"name": "default__hash", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/hash.sql", "original_file_path": "macros/utils/hash.sql", "unique_id": "macro.dbt.default__hash", "macro_sql": "{% macro default__hash(field) -%}\n md5(cast({{ field }} as {{ api.Column.translate_type('string') }}))\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field", "type": null, "description": ""}], "created_at": 1786586787.5637987, "supported_languages": null}, "macro.dbt.array_construct": {"name": "array_construct", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/array_construct.sql", "original_file_path": "macros/utils/array_construct.sql", "unique_id": "macro.dbt.array_construct", "macro_sql": "{% macro array_construct(inputs=[], data_type=api.Column.translate_type('integer')) -%}\n {{ return(adapter.dispatch('array_construct', 'dbt')(inputs, data_type)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__array_construct"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "inputs", "type": null, "description": ""}, {"name": "data_type", "type": null, "description": ""}], "created_at": 1786586787.5644279, "supported_languages": null}, "macro.dbt.default__array_construct": {"name": "default__array_construct", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/array_construct.sql", "original_file_path": "macros/utils/array_construct.sql", "unique_id": "macro.dbt.default__array_construct", "macro_sql": "{% macro default__array_construct(inputs, data_type) -%}\n {% if inputs|length > 0 %}\n array[ {{ inputs|join(' , ') }} ]\n {% else %}\n array[]::{{data_type}}[]\n {% endif %}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "inputs", "type": null, "description": ""}, {"name": "data_type", "type": null, "description": ""}], "created_at": 1786586787.5649493, "supported_languages": null}, "macro.dbt.equals": {"name": "equals", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/equals.sql", "original_file_path": "macros/utils/equals.sql", "unique_id": "macro.dbt.equals", "macro_sql": "{% macro equals(expr1, expr2) %}\n {{ return(adapter.dispatch('equals', 'dbt') (expr1, expr2)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__equals"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "expr1", "type": null, "description": ""}, {"name": "expr2", "type": null, "description": ""}], "created_at": 1786586787.5654898, "supported_languages": null}, "macro.dbt.default__equals": {"name": "default__equals", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/equals.sql", "original_file_path": "macros/utils/equals.sql", "unique_id": "macro.dbt.default__equals", "macro_sql": "{% macro default__equals(expr1, expr2) -%}\n{%- if adapter.behavior.enable_truthy_nulls_equals_macro.no_warn %}\n case when (({{ expr1 }} = {{ expr2 }}) or ({{ expr1 }} is null and {{ expr2 }} is null))\n then 0\n else 1\n end = 0\n{%- else -%}\n ({{ expr1 }} = {{ expr2 }})\n{%- endif %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "expr1", "type": null, "description": ""}, {"name": "expr2", "type": null, "description": ""}], "created_at": 1786586787.5659833, "supported_languages": null}, "macro.dbt.listagg": {"name": "listagg", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/listagg.sql", "original_file_path": "macros/utils/listagg.sql", "unique_id": "macro.dbt.listagg", "macro_sql": "{% macro listagg(measure, delimiter_text=\"','\", order_by_clause=none, limit_num=none) -%}\n {{ return(adapter.dispatch('listagg', 'dbt') (measure, delimiter_text, order_by_clause, limit_num)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__listagg"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "measure", "type": null, "description": ""}, {"name": "delimiter_text", "type": null, "description": ""}, {"name": "order_by_clause", "type": null, "description": ""}, {"name": "limit_num", "type": null, "description": ""}], "created_at": 1786586787.5667236, "supported_languages": null}, "macro.dbt.default__listagg": {"name": "default__listagg", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/listagg.sql", "original_file_path": "macros/utils/listagg.sql", "unique_id": "macro.dbt.default__listagg", "macro_sql": "{% macro default__listagg(measure, delimiter_text, order_by_clause, limit_num) -%}\n\n {% if limit_num -%}\n array_to_string(\n array_slice(\n array_agg(\n {{ measure }}\n ){% if order_by_clause -%}\n within group ({{ order_by_clause }})\n {%- endif %}\n ,0\n ,{{ limit_num }}\n ),\n {{ delimiter_text }}\n )\n {%- else %}\n listagg(\n {{ measure }},\n {{ delimiter_text }}\n )\n {% if order_by_clause -%}\n within group ({{ order_by_clause }})\n {%- endif %}\n {%- endif %}\n\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "measure", "type": null, "description": ""}, {"name": "delimiter_text", "type": null, "description": ""}, {"name": "order_by_clause", "type": null, "description": ""}, {"name": "limit_num", "type": null, "description": ""}], "created_at": 1786586787.5674062, "supported_languages": null}, "macro.dbt.datediff": {"name": "datediff", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/datediff.sql", "original_file_path": "macros/utils/datediff.sql", "unique_id": "macro.dbt.datediff", "macro_sql": "{% macro datediff(first_date, second_date, datepart) %}\n {{ return(adapter.dispatch('datediff', 'dbt')(first_date, second_date, datepart)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__datediff"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "first_date", "type": null, "description": ""}, {"name": "second_date", "type": null, "description": ""}, {"name": "datepart", "type": null, "description": ""}], "created_at": 1786586787.567947, "supported_languages": null}, "macro.dbt.default__datediff": {"name": "default__datediff", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/datediff.sql", "original_file_path": "macros/utils/datediff.sql", "unique_id": "macro.dbt.default__datediff", "macro_sql": "{% macro default__datediff(first_date, second_date, datepart) -%}\n\n datediff(\n {{ datepart }},\n {{ first_date }},\n {{ second_date }}\n )\n\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "first_date", "type": null, "description": ""}, {"name": "second_date", "type": null, "description": ""}, {"name": "datepart", "type": null, "description": ""}], "created_at": 1786586787.568229, "supported_languages": null}, "macro.dbt.date_trunc": {"name": "date_trunc", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/date_trunc.sql", "original_file_path": "macros/utils/date_trunc.sql", "unique_id": "macro.dbt.date_trunc", "macro_sql": "{% macro date_trunc(datepart, date) -%}\n {{ return(adapter.dispatch('date_trunc', 'dbt') (datepart, date)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__date_trunc"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "datepart", "type": null, "description": ""}, {"name": "date", "type": null, "description": ""}], "created_at": 1786586787.568677, "supported_languages": null}, "macro.dbt.default__date_trunc": {"name": "default__date_trunc", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/date_trunc.sql", "original_file_path": "macros/utils/date_trunc.sql", "unique_id": "macro.dbt.default__date_trunc", "macro_sql": "{% macro default__date_trunc(datepart, date) -%}\n date_trunc('{{datepart}}', {{date}})\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "datepart", "type": null, "description": ""}, {"name": "date", "type": null, "description": ""}], "created_at": 1786586787.5689027, "supported_languages": null}, "macro.dbt.bool_or": {"name": "bool_or", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/bool_or.sql", "original_file_path": "macros/utils/bool_or.sql", "unique_id": "macro.dbt.bool_or", "macro_sql": "{% macro bool_or(expression) -%}\n {{ return(adapter.dispatch('bool_or', 'dbt') (expression)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__bool_or"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "expression", "type": null, "description": ""}], "created_at": 1786586787.5693038, "supported_languages": null}, "macro.dbt.default__bool_or": {"name": "default__bool_or", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/bool_or.sql", "original_file_path": "macros/utils/bool_or.sql", "unique_id": "macro.dbt.default__bool_or", "macro_sql": "{% macro default__bool_or(expression) -%}\n\n bool_or({{ expression }})\n\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "expression", "type": null, "description": ""}], "created_at": 1786586787.5694797, "supported_languages": null}, "macro.dbt.last_day": {"name": "last_day", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/last_day.sql", "original_file_path": "macros/utils/last_day.sql", "unique_id": "macro.dbt.last_day", "macro_sql": "{% macro last_day(date, datepart) %}\n {{ return(adapter.dispatch('last_day', 'dbt') (date, datepart)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__last_day"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "date", "type": null, "description": ""}, {"name": "datepart", "type": null, "description": ""}], "created_at": 1786586787.5700004, "supported_languages": null}, "macro.dbt.default_last_day": {"name": "default_last_day", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/last_day.sql", "original_file_path": "macros/utils/last_day.sql", "unique_id": "macro.dbt.default_last_day", "macro_sql": "\n\n{%- macro default_last_day(date, datepart) -%}\n cast(\n {{dbt.dateadd('day', '-1',\n dbt.dateadd(datepart, '1', dbt.date_trunc(datepart, date))\n )}}\n as date)\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt.dateadd", "macro.dbt.date_trunc"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "date", "type": null, "description": ""}, {"name": "datepart", "type": null, "description": ""}], "created_at": 1786586787.5704305, "supported_languages": null}, "macro.dbt.default__last_day": {"name": "default__last_day", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/last_day.sql", "original_file_path": "macros/utils/last_day.sql", "unique_id": "macro.dbt.default__last_day", "macro_sql": "{% macro default__last_day(date, datepart) -%}\n {{dbt.default_last_day(date, datepart)}}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default_last_day"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "date", "type": null, "description": ""}, {"name": "datepart", "type": null, "description": ""}], "created_at": 1786586787.570672, "supported_languages": null}, "macro.dbt.date": {"name": "date", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/date.sql", "original_file_path": "macros/utils/date.sql", "unique_id": "macro.dbt.date", "macro_sql": "{% macro date(year, month, day) %}\n {{ return(adapter.dispatch('date', 'dbt') (year, month, day)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__date"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "year", "type": null, "description": ""}, {"name": "month", "type": null, "description": ""}, {"name": "day", "type": null, "description": ""}], "created_at": 1786586787.5712078, "supported_languages": null}, "macro.dbt.default__date": {"name": "default__date", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/date.sql", "original_file_path": "macros/utils/date.sql", "unique_id": "macro.dbt.default__date", "macro_sql": "{% macro default__date(year, month, day) -%}\n {%- set dt = modules.datetime.date(year, month, day) -%}\n {%- set iso_8601_formatted_date = dt.strftime('%Y-%m-%d') -%}\n to_date('{{ iso_8601_formatted_date }}', 'YYYY-MM-DD')\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "year", "type": null, "description": ""}, {"name": "month", "type": null, "description": ""}, {"name": "day", "type": null, "description": ""}], "created_at": 1786586787.5717645, "supported_languages": null}, "macro.dbt.intersect": {"name": "intersect", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/intersect.sql", "original_file_path": "macros/utils/intersect.sql", "unique_id": "macro.dbt.intersect", "macro_sql": "{% macro intersect() %}\n {{ return(adapter.dispatch('intersect', 'dbt')()) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__intersect"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1786586787.5721588, "supported_languages": null}, "macro.dbt.default__intersect": {"name": "default__intersect", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/intersect.sql", "original_file_path": "macros/utils/intersect.sql", "unique_id": "macro.dbt.default__intersect", "macro_sql": "{% macro default__intersect() %}\n\n intersect\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1786586787.5722876, "supported_languages": null}, "macro.dbt.get_powers_of_two": {"name": "get_powers_of_two", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/generate_series.sql", "original_file_path": "macros/utils/generate_series.sql", "unique_id": "macro.dbt.get_powers_of_two", "macro_sql": "{% macro get_powers_of_two(upper_bound) %}\n {{ return(adapter.dispatch('get_powers_of_two', 'dbt')(upper_bound)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_powers_of_two"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "upper_bound", "type": null, "description": ""}], "created_at": 1786586787.57301, "supported_languages": null}, "macro.dbt.default__get_powers_of_two": {"name": "default__get_powers_of_two", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/generate_series.sql", "original_file_path": "macros/utils/generate_series.sql", "unique_id": "macro.dbt.default__get_powers_of_two", "macro_sql": "{% macro default__get_powers_of_two(upper_bound) %}\n\n {% if upper_bound <= 0 %}\n {{ exceptions.raise_compiler_error(\"upper bound must be positive\") }}\n {% endif %}\n\n {% for _ in range(1, 100) %}\n {% if upper_bound <= 2 ** loop.index %}{{ return(loop.index) }}{% endif %}\n {% endfor %}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "upper_bound", "type": null, "description": ""}], "created_at": 1786586787.5736759, "supported_languages": null}, "macro.dbt.generate_series": {"name": "generate_series", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/generate_series.sql", "original_file_path": "macros/utils/generate_series.sql", "unique_id": "macro.dbt.generate_series", "macro_sql": "{% macro generate_series(upper_bound) %}\n {{ return(adapter.dispatch('generate_series', 'dbt')(upper_bound)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__generate_series"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "upper_bound", "type": null, "description": ""}], "created_at": 1786586787.573998, "supported_languages": null}, "macro.dbt.default__generate_series": {"name": "default__generate_series", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/generate_series.sql", "original_file_path": "macros/utils/generate_series.sql", "unique_id": "macro.dbt.default__generate_series", "macro_sql": "{% macro default__generate_series(upper_bound) %}\n\n {% set n = dbt.get_powers_of_two(upper_bound) %}\n\n with p as (\n select 0 as generated_number union all select 1\n ), unioned as (\n\n select\n\n {% for i in range(n) %}\n p{{i}}.generated_number * power(2, {{i}})\n {% if not loop.last %} + {% endif %}\n {% endfor %}\n + 1\n as generated_number\n\n from\n\n {% for i in range(n) %}\n p as p{{i}}\n {% if not loop.last %} cross join {% endif %}\n {% endfor %}\n\n )\n\n select *\n from unioned\n where generated_number <= {{upper_bound}}\n order by generated_number\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_powers_of_two"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "upper_bound", "type": null, "description": ""}], "created_at": 1786586787.5748243, "supported_languages": null}, "macro.dbt.split_part": {"name": "split_part", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/split_part.sql", "original_file_path": "macros/utils/split_part.sql", "unique_id": "macro.dbt.split_part", "macro_sql": "{% macro split_part(string_text, delimiter_text, part_number) %}\n {{ return(adapter.dispatch('split_part', 'dbt') (string_text, delimiter_text, part_number)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__split_part"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "string_text", "type": null, "description": ""}, {"name": "delimiter_text", "type": null, "description": ""}, {"name": "part_number", "type": null, "description": ""}], "created_at": 1786586787.5754747, "supported_languages": null}, "macro.dbt.default__split_part": {"name": "default__split_part", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/split_part.sql", "original_file_path": "macros/utils/split_part.sql", "unique_id": "macro.dbt.default__split_part", "macro_sql": "{% macro default__split_part(string_text, delimiter_text, part_number) %}\n\n split_part(\n {{ string_text }},\n {{ delimiter_text }},\n {{ part_number }}\n )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "string_text", "type": null, "description": ""}, {"name": "delimiter_text", "type": null, "description": ""}, {"name": "part_number", "type": null, "description": ""}], "created_at": 1786586787.575753, "supported_languages": null}, "macro.dbt._split_part_negative": {"name": "_split_part_negative", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/split_part.sql", "original_file_path": "macros/utils/split_part.sql", "unique_id": "macro.dbt._split_part_negative", "macro_sql": "{% macro _split_part_negative(string_text, delimiter_text, part_number) %}\n\n split_part(\n {{ string_text }},\n {{ delimiter_text }},\n length({{ string_text }})\n - length(\n replace({{ string_text }}, {{ delimiter_text }}, '')\n ) + 2 + {{ part_number }}\n )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "string_text", "type": null, "description": ""}, {"name": "delimiter_text", "type": null, "description": ""}, {"name": "part_number", "type": null, "description": ""}], "created_at": 1786586787.5761328, "supported_languages": null}, "macro.dbt.type_string": {"name": "type_string", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "unique_id": "macro.dbt.type_string", "macro_sql": "\n\n{%- macro type_string() -%}\n {{ return(adapter.dispatch('type_string', 'dbt')()) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt.default__type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1786586787.577322, "supported_languages": null}, "macro.dbt.default__type_string": {"name": "default__type_string", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "unique_id": "macro.dbt.default__type_string", "macro_sql": "{% macro default__type_string() %}\n {{ return(api.Column.translate_type(\"string\")) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1786586787.577578, "supported_languages": null}, "macro.dbt.type_timestamp": {"name": "type_timestamp", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "unique_id": "macro.dbt.type_timestamp", "macro_sql": "\n\n{%- macro type_timestamp() -%}\n {{ return(adapter.dispatch('type_timestamp', 'dbt')()) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt.default__type_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1786586787.5778458, "supported_languages": null}, "macro.dbt.default__type_timestamp": {"name": "default__type_timestamp", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "unique_id": "macro.dbt.default__type_timestamp", "macro_sql": "{% macro default__type_timestamp() %}\n {{ return(api.Column.translate_type(\"timestamp\")) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1786586787.57811, "supported_languages": null}, "macro.dbt.type_float": {"name": "type_float", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "unique_id": "macro.dbt.type_float", "macro_sql": "\n\n{%- macro type_float() -%}\n {{ return(adapter.dispatch('type_float', 'dbt')()) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt.default__type_float"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1786586787.5783746, "supported_languages": null}, "macro.dbt.default__type_float": {"name": "default__type_float", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "unique_id": "macro.dbt.default__type_float", "macro_sql": "{% macro default__type_float() %}\n {{ return(api.Column.translate_type(\"float\")) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1786586787.5787187, "supported_languages": null}, "macro.dbt.type_numeric": {"name": "type_numeric", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "unique_id": "macro.dbt.type_numeric", "macro_sql": "\n\n{%- macro type_numeric() -%}\n {{ return(adapter.dispatch('type_numeric', 'dbt')()) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt.default__type_numeric"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1786586787.5790021, "supported_languages": null}, "macro.dbt.default__type_numeric": {"name": "default__type_numeric", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "unique_id": "macro.dbt.default__type_numeric", "macro_sql": "{% macro default__type_numeric() %}\n {{ return(api.Column.numeric_type(\"numeric\", 28, 6)) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1786586787.5792944, "supported_languages": null}, "macro.dbt.type_bigint": {"name": "type_bigint", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "unique_id": "macro.dbt.type_bigint", "macro_sql": "\n\n{%- macro type_bigint() -%}\n {{ return(adapter.dispatch('type_bigint', 'dbt')()) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt.default__type_bigint"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1786586787.579554, "supported_languages": null}, "macro.dbt.default__type_bigint": {"name": "default__type_bigint", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "unique_id": "macro.dbt.default__type_bigint", "macro_sql": "{% macro default__type_bigint() %}\n {{ return(api.Column.translate_type(\"bigint\")) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1786586787.5798013, "supported_languages": null}, "macro.dbt.type_int": {"name": "type_int", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "unique_id": "macro.dbt.type_int", "macro_sql": "\n\n{%- macro type_int() -%}\n {{ return(adapter.dispatch('type_int', 'dbt')()) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt.default__type_int"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1786586787.58008, "supported_languages": null}, "macro.dbt.default__type_int": {"name": "default__type_int", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "unique_id": "macro.dbt.default__type_int", "macro_sql": "{%- macro default__type_int() -%}\n {{ return(api.Column.translate_type(\"integer\")) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1786586787.5803237, "supported_languages": null}, "macro.dbt.type_boolean": {"name": "type_boolean", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "unique_id": "macro.dbt.type_boolean", "macro_sql": "\n\n{%- macro type_boolean() -%}\n {{ return(adapter.dispatch('type_boolean', 'dbt')()) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt.default__type_boolean"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1786586787.5805833, "supported_languages": null}, "macro.dbt.default__type_boolean": {"name": "default__type_boolean", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "unique_id": "macro.dbt.default__type_boolean", "macro_sql": "{%- macro default__type_boolean() -%}\n {{ return(api.Column.translate_type(\"boolean\")) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1786586787.5808182, "supported_languages": null}, "macro.dbt.array_concat": {"name": "array_concat", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/array_concat.sql", "original_file_path": "macros/utils/array_concat.sql", "unique_id": "macro.dbt.array_concat", "macro_sql": "{% macro array_concat(array_1, array_2) -%}\n {{ return(adapter.dispatch('array_concat', 'dbt')(array_1, array_2)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__array_concat"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "array_1", "type": null, "description": ""}, {"name": "array_2", "type": null, "description": ""}], "created_at": 1786586787.5812962, "supported_languages": null}, "macro.dbt.default__array_concat": {"name": "default__array_concat", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/array_concat.sql", "original_file_path": "macros/utils/array_concat.sql", "unique_id": "macro.dbt.default__array_concat", "macro_sql": "{% macro default__array_concat(array_1, array_2) -%}\n array_cat({{ array_1 }}, {{ array_2 }})\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "array_1", "type": null, "description": ""}, {"name": "array_2", "type": null, "description": ""}], "created_at": 1786586787.58152, "supported_languages": null}, "macro.dbt.safe_cast": {"name": "safe_cast", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/safe_cast.sql", "original_file_path": "macros/utils/safe_cast.sql", "unique_id": "macro.dbt.safe_cast", "macro_sql": "{% macro safe_cast(field, type) %}\n {{ return(adapter.dispatch('safe_cast', 'dbt') (field, type)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__safe_cast"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field", "type": null, "description": ""}, {"name": "type", "type": null, "description": ""}], "created_at": 1786586787.582007, "supported_languages": null}, "macro.dbt.default__safe_cast": {"name": "default__safe_cast", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/safe_cast.sql", "original_file_path": "macros/utils/safe_cast.sql", "unique_id": "macro.dbt.default__safe_cast", "macro_sql": "{% macro default__safe_cast(field, type) %}\n {# most databases don't support this function yet\n so we just need to use cast #}\n cast({{field}} as {{type}})\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field", "type": null, "description": ""}, {"name": "type", "type": null, "description": ""}], "created_at": 1786586787.5822434, "supported_languages": null}, "macro.dbt.set_sql_header": {"name": "set_sql_header", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/configs.sql", "original_file_path": "macros/materializations/configs.sql", "unique_id": "macro.dbt.set_sql_header", "macro_sql": "{% macro set_sql_header(config) -%}\n {{ config.set('sql_header', caller()) }}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "config", "type": null, "description": ""}], "created_at": 1786586787.5827312, "supported_languages": null}, "macro.dbt.should_full_refresh": {"name": "should_full_refresh", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/configs.sql", "original_file_path": "macros/materializations/configs.sql", "unique_id": "macro.dbt.should_full_refresh", "macro_sql": "{% macro should_full_refresh() %}\n {% set config_full_refresh = config.get('full_refresh') %}\n {% if config_full_refresh is none %}\n {% set config_full_refresh = flags.FULL_REFRESH %}\n {% endif %}\n {% do return(config_full_refresh) %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1786586787.5832348, "supported_languages": null}, "macro.dbt.should_store_failures": {"name": "should_store_failures", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/configs.sql", "original_file_path": "macros/materializations/configs.sql", "unique_id": "macro.dbt.should_store_failures", "macro_sql": "{% macro should_store_failures() %}\n {% set config_store_failures = config.get('store_failures') %}\n {% if config_store_failures is none %}\n {% set config_store_failures = flags.STORE_FAILURES %}\n {% endif %}\n {% do return(config_store_failures) %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1786586787.583827, "supported_languages": null}, "macro.dbt.run_hooks": {"name": "run_hooks", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/hooks.sql", "original_file_path": "macros/materializations/hooks.sql", "unique_id": "macro.dbt.run_hooks", "macro_sql": "{% macro run_hooks(hooks, inside_transaction=True) %}\n {% for hook in hooks | selectattr('transaction', 'equalto', inside_transaction) %}\n {% if not inside_transaction and loop.first %}\n {% call statement(auto_begin=inside_transaction) %}\n commit;\n {% endcall %}\n {% endif %}\n {% set rendered = render(hook.get('sql')) | trim %}\n {% if (rendered | length) > 0 %}\n {% call statement(auto_begin=inside_transaction) %}\n {{ rendered }}\n {% endcall %}\n {% endif %}\n {% endfor %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "hooks", "type": null, "description": ""}, {"name": "inside_transaction", "type": null, "description": ""}], "created_at": 1786586787.585375, "supported_languages": null}, "macro.dbt.make_hook_config": {"name": "make_hook_config", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/hooks.sql", "original_file_path": "macros/materializations/hooks.sql", "unique_id": "macro.dbt.make_hook_config", "macro_sql": "{% macro make_hook_config(sql, inside_transaction) %}\n {{ tojson({\"sql\": sql, \"transaction\": inside_transaction}) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "sql", "type": null, "description": ""}, {"name": "inside_transaction", "type": null, "description": ""}], "created_at": 1786586787.5857234, "supported_languages": null}, "macro.dbt.before_begin": {"name": "before_begin", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/hooks.sql", "original_file_path": "macros/materializations/hooks.sql", "unique_id": "macro.dbt.before_begin", "macro_sql": "{% macro before_begin(sql) %}\n {{ make_hook_config(sql, inside_transaction=False) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.make_hook_config"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "sql", "type": null, "description": ""}], "created_at": 1786586787.5859916, "supported_languages": null}, "macro.dbt.in_transaction": {"name": "in_transaction", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/hooks.sql", "original_file_path": "macros/materializations/hooks.sql", "unique_id": "macro.dbt.in_transaction", "macro_sql": "{% macro in_transaction(sql) %}\n {{ make_hook_config(sql, inside_transaction=True) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.make_hook_config"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "sql", "type": null, "description": ""}], "created_at": 1786586787.5862277, "supported_languages": null}, "macro.dbt.after_commit": {"name": "after_commit", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/hooks.sql", "original_file_path": "macros/materializations/hooks.sql", "unique_id": "macro.dbt.after_commit", "macro_sql": "{% macro after_commit(sql) %}\n {{ make_hook_config(sql, inside_transaction=False) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.make_hook_config"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "sql", "type": null, "description": ""}], "created_at": 1786586787.5864604, "supported_languages": null}, "macro.dbt.materialization_table_default": {"name": "materialization_table_default", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/table.sql", "original_file_path": "macros/materializations/models/table.sql", "unique_id": "macro.dbt.materialization_table_default", "macro_sql": "{% materialization table, default %}\n\n {%- set existing_relation = load_cached_relation(this) -%}\n {%- set target_relation = this.incorporate(type='table') %}\n {%- set intermediate_relation = make_intermediate_relation(target_relation) -%}\n -- the intermediate_relation should not already exist in the database; get_relation\n -- will return None in that case. Otherwise, we get a relation that we can drop\n -- later, before we try to use this name for the current operation\n {%- set preexisting_intermediate_relation = load_cached_relation(intermediate_relation) -%}\n /*\n See ../view/view.sql for more information about this relation.\n */\n {%- set backup_relation_type = 'table' if existing_relation is none else existing_relation.type -%}\n {%- set backup_relation = make_backup_relation(target_relation, backup_relation_type) -%}\n -- as above, the backup_relation should not already exist\n {%- set preexisting_backup_relation = load_cached_relation(backup_relation) -%}\n -- grab current tables grants config for comparision later on\n {% set grant_config = config.get('grants') %}\n\n -- drop the temp relations if they exist already in the database\n {{ drop_relation_if_exists(preexisting_intermediate_relation) }}\n {{ drop_relation_if_exists(preexisting_backup_relation) }}\n\n {{ run_hooks(pre_hooks, inside_transaction=False) }}\n\n -- `BEGIN` happens here:\n {{ run_hooks(pre_hooks, inside_transaction=True) }}\n\n -- build model\n {% call statement('main') -%}\n {{ get_create_table_as_sql(False, intermediate_relation, sql) }}\n {%- endcall %}\n\n {% do create_indexes(intermediate_relation) %}\n\n -- cleanup\n {% if existing_relation is not none %}\n /* Do the equivalent of rename_if_exists. 'existing_relation' could have been dropped\n since the variable was first set. */\n {% set existing_relation = load_cached_relation(existing_relation) %}\n {% if existing_relation is not none %}\n {{ adapter.rename_relation(existing_relation, backup_relation) }}\n {% endif %}\n {% endif %}\n\n {{ adapter.rename_relation(intermediate_relation, target_relation) }}\n\n {{ run_hooks(post_hooks, inside_transaction=True) }}\n\n {% set should_revoke = should_revoke(existing_relation, full_refresh_mode=True) %}\n {% do apply_grants(target_relation, grant_config, should_revoke=should_revoke) %}\n\n {% do persist_docs(target_relation, model) %}\n\n -- `COMMIT` happens here\n {{ adapter.commit() }}\n\n -- finally, drop the existing/backup relation after the commit\n {{ drop_relation_if_exists(backup_relation) }}\n\n {{ run_hooks(post_hooks, inside_transaction=False) }}\n\n {{ return({'relations': [target_relation]}) }}\n{% endmaterialization %}", "depends_on": {"macros": ["macro.dbt.load_cached_relation", "macro.dbt.make_intermediate_relation", "macro.dbt.make_backup_relation", "macro.dbt.drop_relation_if_exists", "macro.dbt.run_hooks", "macro.dbt.statement", "macro.dbt.get_create_table_as_sql", "macro.dbt.create_indexes", "macro.dbt.should_revoke", "macro.dbt.apply_grants", "macro.dbt.persist_docs"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "supported_languages", "type": null, "description": ""}], "created_at": 1786586787.5899136, "supported_languages": ["sql"]}, "macro.dbt.materialization_view_default": {"name": "materialization_view_default", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/view.sql", "original_file_path": "macros/materializations/models/view.sql", "unique_id": "macro.dbt.materialization_view_default", "macro_sql": "{%- materialization view, default -%}\n\n {%- set existing_relation = load_cached_relation(this) -%}\n {%- set target_relation = this.incorporate(type='view') -%}\n {%- set intermediate_relation = make_intermediate_relation(target_relation) -%}\n\n -- the intermediate_relation should not already exist in the database; get_relation\n -- will return None in that case. Otherwise, we get a relation that we can drop\n -- later, before we try to use this name for the current operation\n {%- set preexisting_intermediate_relation = load_cached_relation(intermediate_relation) -%}\n /*\n This relation (probably) doesn't exist yet. If it does exist, it's a leftover from\n a previous run, and we're going to try to drop it immediately. At the end of this\n materialization, we're going to rename the \"existing_relation\" to this identifier,\n and then we're going to drop it. In order to make sure we run the correct one of:\n - drop view ...\n - drop table ...\n\n We need to set the type of this relation to be the type of the existing_relation, if it exists,\n or else \"view\" as a sane default if it does not. Note that if the existing_relation does not\n exist, then there is nothing to move out of the way and subsequentally drop. In that case,\n this relation will be effectively unused.\n */\n {%- set backup_relation_type = 'view' if existing_relation is none else existing_relation.type -%}\n {%- set backup_relation = make_backup_relation(target_relation, backup_relation_type) -%}\n -- as above, the backup_relation should not already exist\n {%- set preexisting_backup_relation = load_cached_relation(backup_relation) -%}\n -- grab current tables grants config for comparision later on\n {% set grant_config = config.get('grants') %}\n\n {{ run_hooks(pre_hooks, inside_transaction=False) }}\n\n -- drop the temp relations if they exist already in the database\n {{ drop_relation_if_exists(preexisting_intermediate_relation) }}\n {{ drop_relation_if_exists(preexisting_backup_relation) }}\n\n -- `BEGIN` happens here:\n {{ run_hooks(pre_hooks, inside_transaction=True) }}\n\n -- build model\n {% call statement('main') -%}\n {{ get_create_view_as_sql(intermediate_relation, sql) }}\n {%- endcall %}\n\n -- cleanup\n -- move the existing view out of the way\n {% if existing_relation is not none %}\n /* Do the equivalent of rename_if_exists. 'existing_relation' could have been dropped\n since the variable was first set. */\n {% set existing_relation = load_cached_relation(existing_relation) %}\n {% if existing_relation is not none %}\n {{ adapter.rename_relation(existing_relation, backup_relation) }}\n {% endif %}\n {% endif %}\n {{ adapter.rename_relation(intermediate_relation, target_relation) }}\n\n {% set should_revoke = should_revoke(existing_relation, full_refresh_mode=True) %}\n {% do apply_grants(target_relation, grant_config, should_revoke=should_revoke) %}\n\n {% do persist_docs(target_relation, model) %}\n\n {{ run_hooks(post_hooks, inside_transaction=True) }}\n\n {{ adapter.commit() }}\n\n {{ drop_relation_if_exists(backup_relation) }}\n\n {{ run_hooks(post_hooks, inside_transaction=False) }}\n\n {{ return({'relations': [target_relation]}) }}\n\n{%- endmaterialization -%}", "depends_on": {"macros": ["macro.dbt.load_cached_relation", "macro.dbt.make_intermediate_relation", "macro.dbt.make_backup_relation", "macro.dbt.run_hooks", "macro.dbt.drop_relation_if_exists", "macro.dbt.statement", "macro.dbt.get_create_view_as_sql", "macro.dbt.should_revoke", "macro.dbt.apply_grants", "macro.dbt.persist_docs"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "supported_languages", "type": null, "description": ""}], "created_at": 1786586787.5934432, "supported_languages": ["sql"]}, "macro.dbt.materialization_materialized_view_default": {"name": "materialization_materialized_view_default", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/materialized_view.sql", "original_file_path": "macros/materializations/models/materialized_view.sql", "unique_id": "macro.dbt.materialization_materialized_view_default", "macro_sql": "{% materialization materialized_view, default %}\n {% set existing_relation = load_cached_relation(this) %}\n {% set target_relation = this.incorporate(type=this.MaterializedView) %}\n {% set intermediate_relation = make_intermediate_relation(target_relation) %}\n {% set backup_relation_type = target_relation.MaterializedView if existing_relation is none else existing_relation.type %}\n {% set backup_relation = make_backup_relation(target_relation, backup_relation_type) %}\n\n {{ materialized_view_setup(backup_relation, intermediate_relation, pre_hooks) }}\n\n {% set build_sql = materialized_view_get_build_sql(existing_relation, target_relation, backup_relation, intermediate_relation) %}\n\n {% if build_sql == '' %}\n {{ materialized_view_execute_no_op(target_relation) }}\n {% else %}\n {{ materialized_view_execute_build_sql(build_sql, existing_relation, target_relation, post_hooks) }}\n {% endif %}\n\n {{ materialized_view_teardown(backup_relation, intermediate_relation, post_hooks) }}\n\n {{ return({'relations': [target_relation]}) }}\n\n{% endmaterialization %}", "depends_on": {"macros": ["macro.dbt.load_cached_relation", "macro.dbt.make_intermediate_relation", "macro.dbt.make_backup_relation", "macro.dbt.materialized_view_setup", "macro.dbt.materialized_view_get_build_sql", "macro.dbt.materialized_view_execute_no_op", "macro.dbt.materialized_view_execute_build_sql", "macro.dbt.materialized_view_teardown"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "supported_languages", "type": null, "description": ""}], "created_at": 1786586787.5960639, "supported_languages": ["sql"]}, "macro.dbt.materialized_view_setup": {"name": "materialized_view_setup", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/materialized_view.sql", "original_file_path": "macros/materializations/models/materialized_view.sql", "unique_id": "macro.dbt.materialized_view_setup", "macro_sql": "{% macro materialized_view_setup(backup_relation, intermediate_relation, pre_hooks) %}\n\n -- backup_relation and intermediate_relation should not already exist in the database\n -- it's possible these exist because of a previous run that exited unexpectedly\n {% set preexisting_backup_relation = load_cached_relation(backup_relation) %}\n {% set preexisting_intermediate_relation = load_cached_relation(intermediate_relation) %}\n\n -- drop the temp relations if they exist already in the database\n {{ drop_relation_if_exists(preexisting_backup_relation) }}\n {{ drop_relation_if_exists(preexisting_intermediate_relation) }}\n\n {{ run_hooks(pre_hooks, inside_transaction=False) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.load_cached_relation", "macro.dbt.drop_relation_if_exists", "macro.dbt.run_hooks"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "backup_relation", "type": null, "description": ""}, {"name": "intermediate_relation", "type": null, "description": ""}, {"name": "pre_hooks", "type": null, "description": ""}], "created_at": 1786586787.5967042, "supported_languages": null}, "macro.dbt.materialized_view_teardown": {"name": "materialized_view_teardown", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/materialized_view.sql", "original_file_path": "macros/materializations/models/materialized_view.sql", "unique_id": "macro.dbt.materialized_view_teardown", "macro_sql": "{% macro materialized_view_teardown(backup_relation, intermediate_relation, post_hooks) %}\n\n -- drop the temp relations if they exist to leave the database clean for the next run\n {{ drop_relation_if_exists(backup_relation) }}\n {{ drop_relation_if_exists(intermediate_relation) }}\n\n {{ run_hooks(post_hooks, inside_transaction=False) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.drop_relation_if_exists", "macro.dbt.run_hooks"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "backup_relation", "type": null, "description": ""}, {"name": "intermediate_relation", "type": null, "description": ""}, {"name": "post_hooks", "type": null, "description": ""}], "created_at": 1786586787.597131, "supported_languages": null}, "macro.dbt.materialized_view_get_build_sql": {"name": "materialized_view_get_build_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/materialized_view.sql", "original_file_path": "macros/materializations/models/materialized_view.sql", "unique_id": "macro.dbt.materialized_view_get_build_sql", "macro_sql": "{% macro materialized_view_get_build_sql(existing_relation, target_relation, backup_relation, intermediate_relation) %}\n\n {% set full_refresh_mode = should_full_refresh() %}\n\n -- determine the scenario we're in: create, full_refresh, alter, refresh data\n {% if existing_relation is none %}\n {% set build_sql = get_create_materialized_view_as_sql(target_relation, sql) %}\n {% elif full_refresh_mode or not existing_relation.is_materialized_view %}\n {% set build_sql = get_replace_sql(existing_relation, target_relation, sql) %}\n {% else %}\n\n -- get config options\n {% set on_configuration_change = config.get('on_configuration_change') %}\n {% set configuration_changes = get_materialized_view_configuration_changes(existing_relation, config) %}\n\n {% if configuration_changes is none %}\n {% set build_sql = refresh_materialized_view(target_relation) %}\n\n {% elif on_configuration_change == 'apply' %}\n {% set build_sql = get_alter_materialized_view_as_sql(target_relation, configuration_changes, sql, existing_relation, backup_relation, intermediate_relation) %}\n {% elif on_configuration_change == 'continue' %}\n {% set build_sql = '' %}\n {{ exceptions.warn(\"Configuration changes were identified and `on_configuration_change` was set to `continue` for `\" ~ target_relation.render() ~ \"`\") }}\n {% elif on_configuration_change == 'fail' %}\n {{ exceptions.raise_fail_fast_error(\"Configuration changes were identified and `on_configuration_change` was set to `fail` for `\" ~ target_relation.render() ~ \"`\") }}\n\n {% else %}\n -- this only happens if the user provides a value other than `apply`, 'skip', 'fail'\n {{ exceptions.raise_compiler_error(\"Unexpected configuration scenario\") }}\n\n {% endif %}\n\n {% endif %}\n\n {% do return(build_sql) %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.should_full_refresh", "macro.dbt.get_create_materialized_view_as_sql", "macro.dbt.get_replace_sql", "macro.dbt.get_materialized_view_configuration_changes", "macro.dbt.refresh_materialized_view", "macro.dbt.get_alter_materialized_view_as_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "existing_relation", "type": null, "description": ""}, {"name": "target_relation", "type": null, "description": ""}, {"name": "backup_relation", "type": null, "description": ""}, {"name": "intermediate_relation", "type": null, "description": ""}], "created_at": 1786586787.5993466, "supported_languages": null}, "macro.dbt.materialized_view_execute_no_op": {"name": "materialized_view_execute_no_op", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/materialized_view.sql", "original_file_path": "macros/materializations/models/materialized_view.sql", "unique_id": "macro.dbt.materialized_view_execute_no_op", "macro_sql": "{% macro materialized_view_execute_no_op(target_relation) %}\n {% do store_raw_result(\n name=\"main\",\n message=\"skip \" ~ target_relation,\n code=\"skip\",\n rows_affected=\"-1\"\n ) %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "target_relation", "type": null, "description": ""}], "created_at": 1786586787.5997412, "supported_languages": null}, "macro.dbt.materialized_view_execute_build_sql": {"name": "materialized_view_execute_build_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/materialized_view.sql", "original_file_path": "macros/materializations/models/materialized_view.sql", "unique_id": "macro.dbt.materialized_view_execute_build_sql", "macro_sql": "{% macro materialized_view_execute_build_sql(build_sql, existing_relation, target_relation, post_hooks) %}\n\n -- `BEGIN` happens here:\n {{ run_hooks(pre_hooks, inside_transaction=True) }}\n\n {% set grant_config = config.get('grants') %}\n\n {% call statement(name=\"main\") %}\n {{ build_sql }}\n {% endcall %}\n\n {% set should_revoke = should_revoke(existing_relation, full_refresh_mode=True) %}\n {% do apply_grants(target_relation, grant_config, should_revoke=should_revoke) %}\n\n {% do persist_docs(target_relation, model) %}\n\n {{ run_hooks(post_hooks, inside_transaction=True) }}\n\n {{ adapter.commit() }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.run_hooks", "macro.dbt.statement", "macro.dbt.should_revoke", "macro.dbt.apply_grants", "macro.dbt.persist_docs"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "build_sql", "type": null, "description": ""}, {"name": "existing_relation", "type": null, "description": ""}, {"name": "target_relation", "type": null, "description": ""}, {"name": "post_hooks", "type": null, "description": ""}], "created_at": 1786586787.6008148, "supported_languages": null}, "macro.dbt.materialization_incremental_default": {"name": "materialization_incremental_default", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/incremental.sql", "original_file_path": "macros/materializations/models/incremental/incremental.sql", "unique_id": "macro.dbt.materialization_incremental_default", "macro_sql": "{% materialization incremental, default -%}\n\n -- relations\n {%- set existing_relation = load_cached_relation(this) -%}\n {%- set target_relation = this.incorporate(type='table') -%}\n {%- set temp_relation = make_temp_relation(target_relation)-%}\n {%- set intermediate_relation = make_intermediate_relation(target_relation)-%}\n {%- set backup_relation_type = 'table' if existing_relation is none else existing_relation.type -%}\n {%- set backup_relation = make_backup_relation(target_relation, backup_relation_type) -%}\n\n -- configs\n {%- set unique_key = config.get('unique_key') -%}\n {%- set full_refresh_mode = (should_full_refresh() or existing_relation.is_view) -%}\n {%- set on_schema_change = incremental_validate_on_schema_change(config.get('on_schema_change'), default='ignore') -%}\n\n -- the temp_ and backup_ relations should not already exist in the database; get_relation\n -- will return None in that case. Otherwise, we get a relation that we can drop\n -- later, before we try to use this name for the current operation. This has to happen before\n -- BEGIN, in a separate transaction\n {%- set preexisting_intermediate_relation = load_cached_relation(intermediate_relation)-%}\n {%- set preexisting_backup_relation = load_cached_relation(backup_relation) -%}\n -- grab current tables grants config for comparision later on\n {% set grant_config = config.get('grants') %}\n {{ drop_relation_if_exists(preexisting_intermediate_relation) }}\n {{ drop_relation_if_exists(preexisting_backup_relation) }}\n\n {{ run_hooks(pre_hooks, inside_transaction=False) }}\n\n -- `BEGIN` happens here:\n {{ run_hooks(pre_hooks, inside_transaction=True) }}\n\n {% set to_drop = [] %}\n\n {% set incremental_strategy = config.get('incremental_strategy') or 'default' %}\n {% set strategy_sql_macro_func = adapter.get_incremental_strategy_macro(context, incremental_strategy) %}\n\n {% if existing_relation is none %}\n {% set build_sql = get_create_table_as_sql(False, target_relation, sql) %}\n {% set relation_for_indexes = target_relation %}\n {% elif full_refresh_mode %}\n {% set build_sql = get_create_table_as_sql(False, intermediate_relation, sql) %}\n {% set relation_for_indexes = intermediate_relation %}\n {% set need_swap = true %}\n {% else %}\n {% do run_query(get_create_table_as_sql(True, temp_relation, sql)) %}\n {% set relation_for_indexes = temp_relation %}\n {% set contract_config = config.get('contract') %}\n {% if not contract_config or not contract_config.enforced %}\n {% do adapter.expand_target_column_types(\n from_relation=temp_relation,\n to_relation=target_relation) %}\n {% endif %}\n {#-- Process schema changes. Returns dict of changes if successful. Use source columns for upserting/merging --#}\n {% set dest_columns = process_schema_changes(on_schema_change, temp_relation, existing_relation) %}\n {% if not dest_columns %}\n {% set dest_columns = adapter.get_columns_in_relation(existing_relation) %}\n {% endif %}\n\n {#-- Get the incremental_strategy, the macro to use for the strategy, and build the sql --#}\n {% set incremental_predicates = config.get('predicates', none) or config.get('incremental_predicates', none) %}\n {% set strategy_arg_dict = ({'target_relation': target_relation, 'temp_relation': temp_relation, 'unique_key': unique_key, 'dest_columns': dest_columns, 'incremental_predicates': incremental_predicates }) %}\n {% set build_sql = strategy_sql_macro_func(strategy_arg_dict) %}\n\n {% endif %}\n\n {% call statement(\"main\") %}\n {{ build_sql }}\n {% endcall %}\n\n {% if existing_relation is none or existing_relation.is_view or should_full_refresh() %}\n {% do create_indexes(relation_for_indexes) %}\n {% endif %}\n\n {% if need_swap %}\n {% do adapter.rename_relation(target_relation, backup_relation) %}\n {% do adapter.rename_relation(intermediate_relation, target_relation) %}\n {% do to_drop.append(backup_relation) %}\n {% endif %}\n\n {% set should_revoke = should_revoke(existing_relation, full_refresh_mode) %}\n {% do apply_grants(target_relation, grant_config, should_revoke=should_revoke) %}\n\n {% do persist_docs(target_relation, model) %}\n\n {{ run_hooks(post_hooks, inside_transaction=True) }}\n\n -- `COMMIT` happens here\n {% do adapter.commit() %}\n\n {% for rel in to_drop %}\n {% do adapter.drop_relation(rel) %}\n {% endfor %}\n\n {{ run_hooks(post_hooks, inside_transaction=False) }}\n\n {{ return({'relations': [target_relation]}) }}\n\n{%- endmaterialization %}", "depends_on": {"macros": ["macro.dbt.load_cached_relation", "macro.dbt.make_temp_relation", "macro.dbt.make_intermediate_relation", "macro.dbt.make_backup_relation", "macro.dbt.should_full_refresh", "macro.dbt.incremental_validate_on_schema_change", "macro.dbt.drop_relation_if_exists", "macro.dbt.run_hooks", "macro.dbt.get_create_table_as_sql", "macro.dbt.run_query", "macro.dbt.process_schema_changes", "macro.dbt.statement", "macro.dbt.create_indexes", "macro.dbt.should_revoke", "macro.dbt.apply_grants", "macro.dbt.persist_docs"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "supported_languages", "type": null, "description": ""}], "created_at": 1786586787.6077936, "supported_languages": ["sql"]}, "macro.dbt.incremental_validate_on_schema_change": {"name": "incremental_validate_on_schema_change", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/on_schema_change.sql", "original_file_path": "macros/materializations/models/incremental/on_schema_change.sql", "unique_id": "macro.dbt.incremental_validate_on_schema_change", "macro_sql": "{% macro incremental_validate_on_schema_change(on_schema_change, default='ignore') %}\n\n {% if on_schema_change not in ['sync_all_columns', 'append_new_columns', 'fail', 'ignore'] %}\n\n {% set log_message = 'Invalid value for on_schema_change (%s) specified. Setting default value of %s.' % (on_schema_change, default) %}\n {% do log(log_message) %}\n\n {{ return(default) }}\n\n {% else %}\n\n {{ return(on_schema_change) }}\n\n {% endif %}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "on_schema_change", "type": null, "description": ""}, {"name": "default", "type": null, "description": ""}], "created_at": 1786586787.6100445, "supported_languages": null}, "macro.dbt.check_for_schema_changes": {"name": "check_for_schema_changes", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/on_schema_change.sql", "original_file_path": "macros/materializations/models/incremental/on_schema_change.sql", "unique_id": "macro.dbt.check_for_schema_changes", "macro_sql": "{% macro check_for_schema_changes(source_relation, target_relation) %}\n {{ return(adapter.dispatch('check_for_schema_changes', 'dbt')(source_relation, target_relation)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__check_for_schema_changes"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "source_relation", "type": null, "description": ""}, {"name": "target_relation", "type": null, "description": ""}], "created_at": 1786586787.6104069, "supported_languages": null}, "macro.dbt.default__check_for_schema_changes": {"name": "default__check_for_schema_changes", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/on_schema_change.sql", "original_file_path": "macros/materializations/models/incremental/on_schema_change.sql", "unique_id": "macro.dbt.default__check_for_schema_changes", "macro_sql": "{% macro default__check_for_schema_changes(source_relation, target_relation) %}\n\n {% set schema_changed = False %}\n\n {%- set source_columns = adapter.get_columns_in_relation(source_relation) -%}\n {%- set target_columns = adapter.get_columns_in_relation(target_relation) -%}\n {%- set source_not_in_target = diff_columns(source_columns, target_columns) -%}\n {%- set target_not_in_source = diff_columns(target_columns, source_columns) -%}\n\n {% set new_target_types = diff_column_data_types(source_columns, target_columns) %}\n\n {% if source_not_in_target != [] %}\n {% set schema_changed = True %}\n {% elif target_not_in_source != [] or new_target_types != [] %}\n {% set schema_changed = True %}\n {% elif new_target_types != [] %}\n {% set schema_changed = True %}\n {% endif %}\n\n {% set changes_dict = {\n 'schema_changed': schema_changed,\n 'source_not_in_target': source_not_in_target,\n 'target_not_in_source': target_not_in_source,\n 'source_columns': source_columns,\n 'target_columns': target_columns,\n 'new_target_types': new_target_types\n } %}\n\n {% set msg %}\n In {{ target_relation }}:\n Schema changed: {{ schema_changed }}\n Source columns not in target: {{ source_not_in_target }}\n Target columns not in source: {{ target_not_in_source }}\n New column types: {{ new_target_types }}\n {% endset %}\n\n {% do log(msg) %}\n\n {{ return(changes_dict) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.diff_columns", "macro.dbt.diff_column_data_types"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "source_relation", "type": null, "description": ""}, {"name": "target_relation", "type": null, "description": ""}], "created_at": 1786586787.6123674, "supported_languages": null}, "macro.dbt.sync_column_schemas": {"name": "sync_column_schemas", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/on_schema_change.sql", "original_file_path": "macros/materializations/models/incremental/on_schema_change.sql", "unique_id": "macro.dbt.sync_column_schemas", "macro_sql": "{% macro sync_column_schemas(on_schema_change, target_relation, schema_changes_dict) %}\n {{ return(adapter.dispatch('sync_column_schemas', 'dbt')(on_schema_change, target_relation, schema_changes_dict)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__sync_column_schemas"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "on_schema_change", "type": null, "description": ""}, {"name": "target_relation", "type": null, "description": ""}, {"name": "schema_changes_dict", "type": null, "description": ""}], "created_at": 1786586787.6127687, "supported_languages": null}, "macro.dbt.default__sync_column_schemas": {"name": "default__sync_column_schemas", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/on_schema_change.sql", "original_file_path": "macros/materializations/models/incremental/on_schema_change.sql", "unique_id": "macro.dbt.default__sync_column_schemas", "macro_sql": "{% macro default__sync_column_schemas(on_schema_change, target_relation, schema_changes_dict) %}\n\n {%- set add_to_target_arr = schema_changes_dict['source_not_in_target'] -%}\n {%- set remove_from_target_arr = schema_changes_dict['target_not_in_source'] -%}\n {%- set new_target_types = schema_changes_dict['new_target_types'] -%}\n\n {%- if on_schema_change == 'append_new_columns'-%}\n {%- if add_to_target_arr | length > 0 -%}\n {%- do alter_relation_add_remove_columns(target_relation, add_to_target_arr, none) -%}\n {%- endif -%}\n\n {% elif on_schema_change == 'sync_all_columns' %}\n\n {% if add_to_target_arr | length > 0 or remove_from_target_arr | length > 0 %}\n {%- do alter_relation_add_remove_columns(target_relation, add_to_target_arr, remove_from_target_arr) -%}\n {% endif %}\n\n {% if new_target_types != [] %}\n {% for ntt in new_target_types %}\n {% set column_name = ntt['column_name'] %}\n {% set new_type = ntt['new_type'] %}\n {% do alter_column_type(target_relation, column_name, new_type) %}\n {% endfor %}\n {% endif %}\n\n {% endif %}\n\n {% set schema_change_message %}\n In {{ target_relation }}:\n Schema change approach: {{ on_schema_change }}\n Columns added: {{ add_to_target_arr }}\n Columns removed: {{ remove_from_target_arr }}\n Data types changed: {{ new_target_types }}\n {% endset %}\n\n {% do log(schema_change_message) %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.alter_relation_add_remove_columns", "macro.dbt.alter_column_type"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "on_schema_change", "type": null, "description": ""}, {"name": "target_relation", "type": null, "description": ""}, {"name": "schema_changes_dict", "type": null, "description": ""}], "created_at": 1786586787.61468, "supported_languages": null}, "macro.dbt.process_schema_changes": {"name": "process_schema_changes", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/on_schema_change.sql", "original_file_path": "macros/materializations/models/incremental/on_schema_change.sql", "unique_id": "macro.dbt.process_schema_changes", "macro_sql": "{% macro process_schema_changes(on_schema_change, source_relation, target_relation) %}\n {{ return(adapter.dispatch('process_schema_changes', 'dbt')(on_schema_change, source_relation, target_relation)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__process_schema_changes"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "on_schema_change", "type": null, "description": ""}, {"name": "source_relation", "type": null, "description": ""}, {"name": "target_relation", "type": null, "description": ""}], "created_at": 1786586787.6150868, "supported_languages": null}, "macro.dbt.default__process_schema_changes": {"name": "default__process_schema_changes", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/on_schema_change.sql", "original_file_path": "macros/materializations/models/incremental/on_schema_change.sql", "unique_id": "macro.dbt.default__process_schema_changes", "macro_sql": "{% macro default__process_schema_changes(on_schema_change, source_relation, target_relation) %}\n\n {% if on_schema_change == 'ignore' %}\n\n {{ return({}) }}\n\n {% else %}\n\n {% set schema_changes_dict = check_for_schema_changes(source_relation, target_relation) %}\n\n {% if schema_changes_dict['schema_changed'] %}\n\n {% if on_schema_change == 'fail' %}\n\n {% set fail_msg %}\n The source and target schemas on this incremental model are out of sync!\n They can be reconciled in several ways:\n - set the `on_schema_change` config to either append_new_columns or sync_all_columns, depending on your situation.\n - Re-run the incremental model with `full_refresh: True` to update the target schema.\n - update the schema manually and re-run the process.\n\n Additional troubleshooting context:\n Source columns not in target: {{ schema_changes_dict['source_not_in_target'] }}\n Target columns not in source: {{ schema_changes_dict['target_not_in_source'] }}\n New column types: {{ schema_changes_dict['new_target_types'] }}\n {% endset %}\n\n {% do exceptions.raise_compiler_error(fail_msg) %}\n\n {# -- unless we ignore, run the sync operation per the config #}\n {% else %}\n\n {% do sync_column_schemas(on_schema_change, target_relation, schema_changes_dict) %}\n\n {% endif %}\n\n {% endif %}\n\n {{ return(schema_changes_dict['source_columns']) }}\n\n {% endif %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.check_for_schema_changes", "macro.dbt.sync_column_schemas"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "on_schema_change", "type": null, "description": ""}, {"name": "source_relation", "type": null, "description": ""}, {"name": "target_relation", "type": null, "description": ""}], "created_at": 1786586787.6164732, "supported_languages": null}, "macro.dbt.get_quoted_csv": {"name": "get_quoted_csv", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/column_helpers.sql", "original_file_path": "macros/materializations/models/incremental/column_helpers.sql", "unique_id": "macro.dbt.get_quoted_csv", "macro_sql": "{% macro get_quoted_csv(column_names) %}\n\n {% set quoted = [] %}\n {% for col in column_names -%}\n {%- do quoted.append(adapter.quote(col)) -%}\n {%- endfor %}\n\n {%- set dest_cols_csv = quoted | join(', ') -%}\n {{ return(dest_cols_csv) }}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "column_names", "type": null, "description": ""}], "created_at": 1786586787.6179354, "supported_languages": null}, "macro.dbt.diff_columns": {"name": "diff_columns", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/column_helpers.sql", "original_file_path": "macros/materializations/models/incremental/column_helpers.sql", "unique_id": "macro.dbt.diff_columns", "macro_sql": "{% macro diff_columns(source_columns, target_columns) %}\n\n {% set result = [] %}\n {% set source_names = source_columns | map(attribute = 'column') | list %}\n {% set target_names = target_columns | map(attribute = 'column') | list %}\n\n {# --check whether the name attribute exists in the target - this does not perform a data type check #}\n {% for sc in source_columns %}\n {% if sc.name not in target_names %}\n {{ result.append(sc) }}\n {% endif %}\n {% endfor %}\n\n {{ return(result) }}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "source_columns", "type": null, "description": ""}, {"name": "target_columns", "type": null, "description": ""}], "created_at": 1786586787.6188114, "supported_languages": null}, "macro.dbt.diff_column_data_types": {"name": "diff_column_data_types", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/column_helpers.sql", "original_file_path": "macros/materializations/models/incremental/column_helpers.sql", "unique_id": "macro.dbt.diff_column_data_types", "macro_sql": "{% macro diff_column_data_types(source_columns, target_columns) %}\n {{ return(adapter.dispatch('diff_column_data_types', 'dbt')(source_columns, target_columns)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__diff_column_data_types"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "source_columns", "type": null, "description": ""}, {"name": "target_columns", "type": null, "description": ""}], "created_at": 1786586787.6191819, "supported_languages": null}, "macro.dbt.default__diff_column_data_types": {"name": "default__diff_column_data_types", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/column_helpers.sql", "original_file_path": "macros/materializations/models/incremental/column_helpers.sql", "unique_id": "macro.dbt.default__diff_column_data_types", "macro_sql": "{% macro default__diff_column_data_types(source_columns, target_columns) %}\n {% set result = [] %}\n {% for sc in source_columns %}\n {% set tc = target_columns | selectattr(\"name\", \"equalto\", sc.name) | list | first %}\n {% if tc %}\n {% if sc.expanded_data_type != tc.expanded_data_type and not sc.can_expand_to(other_column=tc) %}\n {{ result.append( { 'column_name': tc.name, 'new_type': sc.expanded_data_type } ) }}\n {% endif %}\n {% endif %}\n {% endfor %}\n\n {{ return(result) }}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "source_columns", "type": null, "description": ""}, {"name": "target_columns", "type": null, "description": ""}], "created_at": 1786586787.6202419, "supported_languages": null}, "macro.dbt.get_merge_update_columns": {"name": "get_merge_update_columns", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/column_helpers.sql", "original_file_path": "macros/materializations/models/incremental/column_helpers.sql", "unique_id": "macro.dbt.get_merge_update_columns", "macro_sql": "{% macro get_merge_update_columns(merge_update_columns, merge_exclude_columns, dest_columns) %}\n {{ return(adapter.dispatch('get_merge_update_columns', 'dbt')(merge_update_columns, merge_exclude_columns, dest_columns)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_merge_update_columns"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "merge_update_columns", "type": null, "description": ""}, {"name": "merge_exclude_columns", "type": null, "description": ""}, {"name": "dest_columns", "type": null, "description": ""}], "created_at": 1786586787.6207397, "supported_languages": null}, "macro.dbt.default__get_merge_update_columns": {"name": "default__get_merge_update_columns", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/column_helpers.sql", "original_file_path": "macros/materializations/models/incremental/column_helpers.sql", "unique_id": "macro.dbt.default__get_merge_update_columns", "macro_sql": "{% macro default__get_merge_update_columns(merge_update_columns, merge_exclude_columns, dest_columns) %}\n {%- set default_cols = dest_columns | map(attribute=\"quoted\") | list -%}\n\n {%- if merge_update_columns and merge_exclude_columns -%}\n {{ exceptions.raise_compiler_error(\n 'Model cannot specify merge_update_columns and merge_exclude_columns. Please update model to use only one config'\n )}}\n {%- elif merge_update_columns -%}\n {%- set update_columns = merge_update_columns -%}\n {%- elif merge_exclude_columns -%}\n {%- set update_columns = [] -%}\n {%- for column in dest_columns -%}\n {% if column.column | lower not in merge_exclude_columns | map(\"lower\") | list %}\n {%- do update_columns.append(column.quoted) -%}\n {% endif %}\n {%- endfor -%}\n {%- else -%}\n {%- set update_columns = default_cols -%}\n {%- endif -%}\n\n {{ return(update_columns) }}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "merge_update_columns", "type": null, "description": ""}, {"name": "merge_exclude_columns", "type": null, "description": ""}, {"name": "dest_columns", "type": null, "description": ""}], "created_at": 1786586787.6219223, "supported_languages": null}, "macro.dbt.get_merge_sql": {"name": "get_merge_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/merge.sql", "original_file_path": "macros/materializations/models/incremental/merge.sql", "unique_id": "macro.dbt.get_merge_sql", "macro_sql": "{% macro get_merge_sql(target, source, unique_key, dest_columns, incremental_predicates=none) -%}\n -- back compat for old kwarg name\n {% set incremental_predicates = kwargs.get('predicates', incremental_predicates) %}\n {{ adapter.dispatch('get_merge_sql', 'dbt')(target, source, unique_key, dest_columns, incremental_predicates) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "target", "type": null, "description": ""}, {"name": "source", "type": null, "description": ""}, {"name": "unique_key", "type": null, "description": ""}, {"name": "dest_columns", "type": null, "description": ""}, {"name": "incremental_predicates", "type": null, "description": ""}], "created_at": 1786586787.6238248, "supported_languages": null}, "macro.dbt.get_merge_unique_key_match": {"name": "get_merge_unique_key_match", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/merge.sql", "original_file_path": "macros/materializations/models/incremental/merge.sql", "unique_id": "macro.dbt.get_merge_unique_key_match", "macro_sql": "{% macro get_merge_unique_key_match(source_unique_key, target_unique_key) %}\n {{ return(adapter.dispatch('get_merge_unique_key_match', 'dbt')(source_unique_key, target_unique_key)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_merge_unique_key_match"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "source_unique_key", "type": null, "description": ""}, {"name": "target_unique_key", "type": null, "description": ""}], "created_at": 1786586787.624196, "supported_languages": null}, "macro.dbt.default__get_merge_unique_key_match": {"name": "default__get_merge_unique_key_match", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/merge.sql", "original_file_path": "macros/materializations/models/incremental/merge.sql", "unique_id": "macro.dbt.default__get_merge_unique_key_match", "macro_sql": "{% macro default__get_merge_unique_key_match(source_unique_key, target_unique_key) -%}\n {{ return(equals(source_unique_key, target_unique_key) | trim) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.equals"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "source_unique_key", "type": null, "description": ""}, {"name": "target_unique_key", "type": null, "description": ""}], "created_at": 1786586787.624485, "supported_languages": null}, "macro.dbt.default__get_merge_sql": {"name": "default__get_merge_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/merge.sql", "original_file_path": "macros/materializations/models/incremental/merge.sql", "unique_id": "macro.dbt.default__get_merge_sql", "macro_sql": "{% macro default__get_merge_sql(target, source, unique_key, dest_columns, incremental_predicates=none) -%}\n {%- set predicates = [] if incremental_predicates is none else [] + incremental_predicates -%}\n {%- set dest_cols_csv = get_quoted_csv(dest_columns | map(attribute=\"name\")) -%}\n {%- set merge_update_columns = config.get('merge_update_columns') -%}\n {%- set merge_exclude_columns = config.get('merge_exclude_columns') -%}\n {%- set update_columns = get_merge_update_columns(merge_update_columns, merge_exclude_columns, dest_columns) -%}\n {%- set sql_header = config.get('sql_header', none) -%}\n\n {% if unique_key %}\n {% if unique_key is sequence and unique_key is not mapping and unique_key is not string %}\n {% for key in unique_key %}\n {% set this_key_match %}\n DBT_INTERNAL_SOURCE.{{ key }} = DBT_INTERNAL_DEST.{{ key }}\n {% endset %}\n {% do predicates.append(this_key_match) %}\n {% endfor %}\n {% else %}\n {% set source_unique_key = (\"DBT_INTERNAL_SOURCE.\" ~ unique_key) | trim %}\n {% set target_unique_key = (\"DBT_INTERNAL_DEST.\" ~ unique_key) | trim %}\n {% set unique_key_match = get_merge_unique_key_match(source_unique_key, target_unique_key) %}\n {% do predicates.append(unique_key_match) %}\n {% endif %}\n {% else %}\n {% do predicates.append('FALSE') %}\n {% endif %}\n\n {{ sql_header if sql_header is not none }}\n\n merge into {{ target }} as DBT_INTERNAL_DEST\n using {{ source }} as DBT_INTERNAL_SOURCE\n on {{\"(\" ~ predicates | join(\") and (\") ~ \")\"}}\n\n {% if unique_key %}\n when matched then update set\n {% for column_name in update_columns -%}\n {{ column_name }} = DBT_INTERNAL_SOURCE.{{ column_name }}\n {%- if not loop.last %}, {%- endif %}\n {%- endfor %}\n {% endif %}\n\n when not matched then insert\n ({{ dest_cols_csv }})\n values\n ({{ dest_cols_csv }})\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_quoted_csv", "macro.dbt.get_merge_update_columns", "macro.dbt.get_merge_unique_key_match"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "target", "type": null, "description": ""}, {"name": "source", "type": null, "description": ""}, {"name": "unique_key", "type": null, "description": ""}, {"name": "dest_columns", "type": null, "description": ""}, {"name": "incremental_predicates", "type": null, "description": ""}], "created_at": 1786586787.6273215, "supported_languages": null}, "macro.dbt.get_delete_insert_merge_sql": {"name": "get_delete_insert_merge_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/merge.sql", "original_file_path": "macros/materializations/models/incremental/merge.sql", "unique_id": "macro.dbt.get_delete_insert_merge_sql", "macro_sql": "{% macro get_delete_insert_merge_sql(target, source, unique_key, dest_columns, incremental_predicates) -%}\n {{ adapter.dispatch('get_delete_insert_merge_sql', 'dbt')(target, source, unique_key, dest_columns, incremental_predicates) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_delete_insert_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "target", "type": null, "description": ""}, {"name": "source", "type": null, "description": ""}, {"name": "unique_key", "type": null, "description": ""}, {"name": "dest_columns", "type": null, "description": ""}, {"name": "incremental_predicates", "type": null, "description": ""}], "created_at": 1786586787.6277733, "supported_languages": null}, "macro.dbt.default__get_delete_insert_merge_sql": {"name": "default__get_delete_insert_merge_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/merge.sql", "original_file_path": "macros/materializations/models/incremental/merge.sql", "unique_id": "macro.dbt.default__get_delete_insert_merge_sql", "macro_sql": "{% macro default__get_delete_insert_merge_sql(target, source, unique_key, dest_columns, incremental_predicates) -%}\n\n {%- set dest_cols_csv = get_quoted_csv(dest_columns | map(attribute=\"name\")) -%}\n\n {% if unique_key %}\n {% if unique_key is string %}\n {% set unique_key = [unique_key] %}\n {% endif %}\n\n {%- set unique_key_str = unique_key|join(', ') -%}\n\n delete from {{ target }} as DBT_INTERNAL_DEST\n where ({{ unique_key_str }}) in (\n select distinct {{ unique_key_str }}\n from {{ source }} as DBT_INTERNAL_SOURCE\n )\n {%- if incremental_predicates %}\n {% for predicate in incremental_predicates %}\n and {{ predicate }}\n {% endfor %}\n {%- endif -%};\n\n {% endif %}\n\n insert into {{ target }} ({{ dest_cols_csv }})\n (\n select {{ dest_cols_csv }}\n from {{ source }}\n )\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.get_quoted_csv"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "target", "type": null, "description": ""}, {"name": "source", "type": null, "description": ""}, {"name": "unique_key", "type": null, "description": ""}, {"name": "dest_columns", "type": null, "description": ""}, {"name": "incremental_predicates", "type": null, "description": ""}], "created_at": 1786586787.6289685, "supported_languages": null}, "macro.dbt.get_insert_overwrite_merge_sql": {"name": "get_insert_overwrite_merge_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/merge.sql", "original_file_path": "macros/materializations/models/incremental/merge.sql", "unique_id": "macro.dbt.get_insert_overwrite_merge_sql", "macro_sql": "{% macro get_insert_overwrite_merge_sql(target, source, dest_columns, predicates, include_sql_header=false) -%}\n {{ adapter.dispatch('get_insert_overwrite_merge_sql', 'dbt')(target, source, dest_columns, predicates, include_sql_header) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_insert_overwrite_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "target", "type": null, "description": ""}, {"name": "source", "type": null, "description": ""}, {"name": "dest_columns", "type": null, "description": ""}, {"name": "predicates", "type": null, "description": ""}, {"name": "include_sql_header", "type": null, "description": ""}], "created_at": 1786586787.6294174, "supported_languages": null}, "macro.dbt.default__get_insert_overwrite_merge_sql": {"name": "default__get_insert_overwrite_merge_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/merge.sql", "original_file_path": "macros/materializations/models/incremental/merge.sql", "unique_id": "macro.dbt.default__get_insert_overwrite_merge_sql", "macro_sql": "{% macro default__get_insert_overwrite_merge_sql(target, source, dest_columns, predicates, include_sql_header) -%}\n {#-- The only time include_sql_header is True: --#}\n {#-- BigQuery + insert_overwrite strategy + \"static\" partitions config --#}\n {#-- We should consider including the sql header at the materialization level instead --#}\n\n {%- set predicates = [] if predicates is none else [] + predicates -%}\n {%- set dest_cols_csv = get_quoted_csv(dest_columns | map(attribute=\"name\")) -%}\n {%- set sql_header = config.get('sql_header', none) -%}\n\n {{ sql_header if sql_header is not none and include_sql_header }}\n\n merge into {{ target }} as DBT_INTERNAL_DEST\n using {{ source }} as DBT_INTERNAL_SOURCE\n on FALSE\n\n when not matched by source\n {% if predicates %} and {{ predicates | join(' and ') }} {% endif %}\n then delete\n\n when not matched then insert\n ({{ dest_cols_csv }})\n values\n ({{ dest_cols_csv }})\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_quoted_csv"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "target", "type": null, "description": ""}, {"name": "source", "type": null, "description": ""}, {"name": "dest_columns", "type": null, "description": ""}, {"name": "predicates", "type": null, "description": ""}, {"name": "include_sql_header", "type": null, "description": ""}], "created_at": 1786586787.6304762, "supported_languages": null}, "macro.dbt.get_incremental_append_sql": {"name": "get_incremental_append_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "unique_id": "macro.dbt.get_incremental_append_sql", "macro_sql": "{% macro get_incremental_append_sql(arg_dict) %}\n\n {{ return(adapter.dispatch('get_incremental_append_sql', 'dbt')(arg_dict)) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_incremental_append_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "arg_dict", "type": null, "description": ""}], "created_at": 1786586787.6316092, "supported_languages": null}, "macro.dbt.default__get_incremental_append_sql": {"name": "default__get_incremental_append_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "unique_id": "macro.dbt.default__get_incremental_append_sql", "macro_sql": "{% macro default__get_incremental_append_sql(arg_dict) %}\n\n {% do return(get_insert_into_sql(arg_dict[\"target_relation\"], arg_dict[\"temp_relation\"], arg_dict[\"dest_columns\"])) %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_insert_into_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "arg_dict", "type": null, "description": ""}], "created_at": 1786586787.6320183, "supported_languages": null}, "macro.dbt.get_incremental_delete_insert_sql": {"name": "get_incremental_delete_insert_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "unique_id": "macro.dbt.get_incremental_delete_insert_sql", "macro_sql": "{% macro get_incremental_delete_insert_sql(arg_dict) %}\n\n {{ return(adapter.dispatch('get_incremental_delete_insert_sql', 'dbt')(arg_dict)) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_incremental_delete_insert_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "arg_dict", "type": null, "description": ""}], "created_at": 1786586787.6323273, "supported_languages": null}, "macro.dbt.default__get_incremental_delete_insert_sql": {"name": "default__get_incremental_delete_insert_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "unique_id": "macro.dbt.default__get_incremental_delete_insert_sql", "macro_sql": "{% macro default__get_incremental_delete_insert_sql(arg_dict) %}\n\n {% do return(get_delete_insert_merge_sql(arg_dict[\"target_relation\"], arg_dict[\"temp_relation\"], arg_dict[\"unique_key\"], arg_dict[\"dest_columns\"], arg_dict[\"incremental_predicates\"])) %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_delete_insert_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "arg_dict", "type": null, "description": ""}], "created_at": 1786586787.6328123, "supported_languages": null}, "macro.dbt.get_incremental_merge_sql": {"name": "get_incremental_merge_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "unique_id": "macro.dbt.get_incremental_merge_sql", "macro_sql": "{% macro get_incremental_merge_sql(arg_dict) %}\n\n {{ return(adapter.dispatch('get_incremental_merge_sql', 'dbt')(arg_dict)) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_incremental_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "arg_dict", "type": null, "description": ""}], "created_at": 1786586787.63358, "supported_languages": null}, "macro.dbt.default__get_incremental_merge_sql": {"name": "default__get_incremental_merge_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "unique_id": "macro.dbt.default__get_incremental_merge_sql", "macro_sql": "{% macro default__get_incremental_merge_sql(arg_dict) %}\n\n {% do return(get_merge_sql(arg_dict[\"target_relation\"], arg_dict[\"temp_relation\"], arg_dict[\"unique_key\"], arg_dict[\"dest_columns\"], arg_dict[\"incremental_predicates\"])) %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "arg_dict", "type": null, "description": ""}], "created_at": 1786586787.6340826, "supported_languages": null}, "macro.dbt.get_incremental_insert_overwrite_sql": {"name": "get_incremental_insert_overwrite_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "unique_id": "macro.dbt.get_incremental_insert_overwrite_sql", "macro_sql": "{% macro get_incremental_insert_overwrite_sql(arg_dict) %}\n\n {{ return(adapter.dispatch('get_incremental_insert_overwrite_sql', 'dbt')(arg_dict)) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_incremental_insert_overwrite_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "arg_dict", "type": null, "description": ""}], "created_at": 1786586787.6343832, "supported_languages": null}, "macro.dbt.default__get_incremental_insert_overwrite_sql": {"name": "default__get_incremental_insert_overwrite_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "unique_id": "macro.dbt.default__get_incremental_insert_overwrite_sql", "macro_sql": "{% macro default__get_incremental_insert_overwrite_sql(arg_dict) %}\n\n {% do return(get_insert_overwrite_merge_sql(arg_dict[\"target_relation\"], arg_dict[\"temp_relation\"], arg_dict[\"dest_columns\"], arg_dict[\"incremental_predicates\"])) %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_insert_overwrite_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "arg_dict", "type": null, "description": ""}], "created_at": 1786586787.6348042, "supported_languages": null}, "macro.dbt.get_incremental_default_sql": {"name": "get_incremental_default_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "unique_id": "macro.dbt.get_incremental_default_sql", "macro_sql": "{% macro get_incremental_default_sql(arg_dict) %}\n\n {{ return(adapter.dispatch('get_incremental_default_sql', 'dbt')(arg_dict)) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__get_incremental_default_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "arg_dict", "type": null, "description": ""}], "created_at": 1786586787.6351182, "supported_languages": null}, "macro.dbt.default__get_incremental_default_sql": {"name": "default__get_incremental_default_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "unique_id": "macro.dbt.default__get_incremental_default_sql", "macro_sql": "{% macro default__get_incremental_default_sql(arg_dict) %}\n\n {% do return(get_incremental_append_sql(arg_dict)) %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_incremental_append_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "arg_dict", "type": null, "description": ""}], "created_at": 1786586787.635362, "supported_languages": null}, "macro.dbt.get_incremental_microbatch_sql": {"name": "get_incremental_microbatch_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "unique_id": "macro.dbt.get_incremental_microbatch_sql", "macro_sql": "{% macro get_incremental_microbatch_sql(arg_dict) %}\n\n {{ return(adapter.dispatch('get_incremental_microbatch_sql', 'dbt')(arg_dict)) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__get_incremental_microbatch_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "arg_dict", "type": null, "description": ""}], "created_at": 1786586787.6356566, "supported_languages": null}, "macro.dbt.default__get_incremental_microbatch_sql": {"name": "default__get_incremental_microbatch_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "unique_id": "macro.dbt.default__get_incremental_microbatch_sql", "macro_sql": "{% macro default__get_incremental_microbatch_sql(arg_dict) %}\n\n {{ exceptions.raise_not_implemented('microbatch materialization strategy not implemented for adapter ' + adapter.type()) }}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "arg_dict", "type": null, "description": ""}], "created_at": 1786586787.6359293, "supported_languages": null}, "macro.dbt.get_insert_into_sql": {"name": "get_insert_into_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "unique_id": "macro.dbt.get_insert_into_sql", "macro_sql": "{% macro get_insert_into_sql(target_relation, temp_relation, dest_columns) %}\n\n {%- set dest_cols_csv = get_quoted_csv(dest_columns | map(attribute=\"name\")) -%}\n\n insert into {{ target_relation }} ({{ dest_cols_csv }})\n (\n select {{ dest_cols_csv }}\n from {{ temp_relation }}\n )\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_quoted_csv"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "target_relation", "type": null, "description": ""}, {"name": "temp_relation", "type": null, "description": ""}, {"name": "dest_columns", "type": null, "description": ""}], "created_at": 1786586787.6363854, "supported_languages": null}, "macro.dbt.is_incremental": {"name": "is_incremental", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/is_incremental.sql", "original_file_path": "macros/materializations/models/incremental/is_incremental.sql", "unique_id": "macro.dbt.is_incremental", "macro_sql": "{% macro is_incremental() %}\n {#-- do not run introspective queries in parsing #}\n {% if not execute %}\n {{ return(False) }}\n {% else %}\n {% set relation = adapter.get_relation(this.database, this.schema, this.table) %}\n {{ return(relation is not none\n and relation.type == 'table'\n and model.config.materialized == 'incremental'\n and not should_full_refresh()) }}\n {% endif %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.should_full_refresh"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1786586787.6373522, "supported_languages": null}, "macro.dbt.can_clone_table": {"name": "can_clone_table", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/clone/can_clone_table.sql", "original_file_path": "macros/materializations/models/clone/can_clone_table.sql", "unique_id": "macro.dbt.can_clone_table", "macro_sql": "{% macro can_clone_table() %}\n {{ return(adapter.dispatch('can_clone_table', 'dbt')()) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__can_clone_table"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1786586787.6377523, "supported_languages": null}, "macro.dbt.default__can_clone_table": {"name": "default__can_clone_table", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/clone/can_clone_table.sql", "original_file_path": "macros/materializations/models/clone/can_clone_table.sql", "unique_id": "macro.dbt.default__can_clone_table", "macro_sql": "{% macro default__can_clone_table() %}\n {{ return(False) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1786586787.6379704, "supported_languages": null}, "macro.dbt.materialization_clone_default": {"name": "materialization_clone_default", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/clone/clone.sql", "original_file_path": "macros/materializations/models/clone/clone.sql", "unique_id": "macro.dbt.materialization_clone_default", "macro_sql": "{%- materialization clone, default -%}\n\n {%- set relations = {'relations': []} -%}\n\n {%- if not defer_relation -%}\n -- nothing to do\n {{ log(\"No relation found in state manifest for \" ~ model.unique_id, info=True) }}\n {{ return(relations) }}\n {%- endif -%}\n\n {%- set existing_relation = load_cached_relation(this) -%}\n\n {%- if existing_relation and not flags.FULL_REFRESH -%}\n -- noop!\n {{ log(\"Relation \" ~ existing_relation ~ \" already exists\", info=True) }}\n {{ return(relations) }}\n {%- endif -%}\n\n {%- set other_existing_relation = load_cached_relation(defer_relation) -%}\n\n -- If this is a database that can do zero-copy cloning of tables, and the other relation is a table, then this will be a table\n -- Otherwise, this will be a view\n\n {% set can_clone_table = can_clone_table() %}\n {%- set grant_config = config.get('grants') -%}\n\n {%- if other_existing_relation and other_existing_relation.type == 'table' and can_clone_table -%}\n\n {%- set target_relation = this.incorporate(type='table') -%}\n {% if existing_relation is not none and not existing_relation.is_table %}\n {{ log(\"Dropping relation \" ~ existing_relation.render() ~ \" because it is of type \" ~ existing_relation.type) }}\n {{ drop_relation_if_exists(existing_relation) }}\n {% endif %}\n\n -- as a general rule, data platforms that can clone tables can also do atomic 'create or replace'\n {% if target_relation.database == defer_relation.database and\n target_relation.schema == defer_relation.schema and\n target_relation.identifier == defer_relation.identifier %}\n {{ log(\"Target relation and defer relation are the same, skipping clone for relation: \" ~ target_relation.render()) }}\n {% else %}\n {% call statement('main') %}\n {{ create_or_replace_clone(target_relation, defer_relation) }}\n {% endcall %}\n {% endif %}\n {% set should_revoke = should_revoke(existing_relation, full_refresh_mode=True) %}\n {% do apply_grants(target_relation, grant_config, should_revoke=should_revoke) %}\n {% do persist_docs(target_relation, model) %}\n\n {{ return({'relations': [target_relation]}) }}\n\n {%- else -%}\n\n {%- set target_relation = this.incorporate(type='view') -%}\n\n -- reuse the view materialization\n -- TODO: support actual dispatch for materialization macros\n -- Tracking ticket: https://github.com/dbt-labs/dbt-core/issues/7799\n {% set search_name = \"materialization_view_\" ~ adapter.type() %}\n {% if not search_name in context %}\n {% set search_name = \"materialization_view_default\" %}\n {% endif %}\n {% set materialization_macro = context[search_name] %}\n {% set relations = materialization_macro() %}\n {{ return(relations) }}\n\n {%- endif -%}\n\n{%- endmaterialization -%}", "depends_on": {"macros": ["macro.dbt.load_cached_relation", "macro.dbt.can_clone_table", "macro.dbt.drop_relation_if_exists", "macro.dbt.statement", "macro.dbt.create_or_replace_clone", "macro.dbt.should_revoke", "macro.dbt.apply_grants", "macro.dbt.persist_docs"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "supported_languages", "type": null, "description": ""}], "created_at": 1786586787.642306, "supported_languages": ["sql"]}, "macro.dbt.create_or_replace_clone": {"name": "create_or_replace_clone", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/clone/create_or_replace_clone.sql", "original_file_path": "macros/materializations/models/clone/create_or_replace_clone.sql", "unique_id": "macro.dbt.create_or_replace_clone", "macro_sql": "{% macro create_or_replace_clone(this_relation, defer_relation) %}\n {{ return(adapter.dispatch('create_or_replace_clone', 'dbt')(this_relation, defer_relation)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__create_or_replace_clone"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "this_relation", "type": null, "description": ""}, {"name": "defer_relation", "type": null, "description": ""}], "created_at": 1786586787.6428509, "supported_languages": null}, "macro.dbt.default__create_or_replace_clone": {"name": "default__create_or_replace_clone", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/clone/create_or_replace_clone.sql", "original_file_path": "macros/materializations/models/clone/create_or_replace_clone.sql", "unique_id": "macro.dbt.default__create_or_replace_clone", "macro_sql": "{% macro default__create_or_replace_clone(this_relation, defer_relation) %}\n create or replace table {{ this_relation.render() }} clone {{ defer_relation.render() }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "this_relation", "type": null, "description": ""}, {"name": "defer_relation", "type": null, "description": ""}], "created_at": 1786586787.6431592, "supported_languages": null}, "macro.dbt.get_where_subquery": {"name": "get_where_subquery", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/tests/where_subquery.sql", "original_file_path": "macros/materializations/tests/where_subquery.sql", "unique_id": "macro.dbt.get_where_subquery", "macro_sql": "{% macro get_where_subquery(relation) -%}\n {% do return(adapter.dispatch('get_where_subquery', 'dbt')(relation)) %}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_where_subquery"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1786586787.6436973, "supported_languages": null}, "macro.dbt.default__get_where_subquery": {"name": "default__get_where_subquery", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/tests/where_subquery.sql", "original_file_path": "macros/materializations/tests/where_subquery.sql", "unique_id": "macro.dbt.default__get_where_subquery", "macro_sql": "{% macro default__get_where_subquery(relation) -%}\n {% set where = config.get('where', '') %}\n {% if where %}\n {%- set filtered -%}\n (select * from {{ relation }} where {{ where }}) dbt_subquery\n {%- endset -%}\n {% do return(filtered) %}\n {%- else -%}\n {% do return(relation) %}\n {%- endif -%}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1786586787.6443353, "supported_languages": null}, "macro.dbt.get_test_sql": {"name": "get_test_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/tests/helpers.sql", "original_file_path": "macros/materializations/tests/helpers.sql", "unique_id": "macro.dbt.get_test_sql", "macro_sql": "{% macro get_test_sql(main_sql, fail_calc, warn_if, error_if, limit) -%}\n {{ adapter.dispatch('get_test_sql', 'dbt')(main_sql, fail_calc, warn_if, error_if, limit) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_test_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "main_sql", "type": null, "description": ""}, {"name": "fail_calc", "type": null, "description": ""}, {"name": "warn_if", "type": null, "description": ""}, {"name": "error_if", "type": null, "description": ""}, {"name": "limit", "type": null, "description": ""}], "created_at": 1786586787.645245, "supported_languages": null}, "macro.dbt.default__get_test_sql": {"name": "default__get_test_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/tests/helpers.sql", "original_file_path": "macros/materializations/tests/helpers.sql", "unique_id": "macro.dbt.default__get_test_sql", "macro_sql": "{% macro default__get_test_sql(main_sql, fail_calc, warn_if, error_if, limit) -%}\n select\n {{ fail_calc }} as failures,\n {{ fail_calc }} {{ warn_if }} as should_warn,\n {{ fail_calc }} {{ error_if }} as should_error\n from (\n {{ main_sql }}\n {{ \"limit \" ~ limit if limit != none }}\n ) dbt_internal_test\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "main_sql", "type": null, "description": ""}, {"name": "fail_calc", "type": null, "description": ""}, {"name": "warn_if", "type": null, "description": ""}, {"name": "error_if", "type": null, "description": ""}, {"name": "limit", "type": null, "description": ""}], "created_at": 1786586787.6457639, "supported_languages": null}, "macro.dbt.get_unit_test_sql": {"name": "get_unit_test_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/tests/helpers.sql", "original_file_path": "macros/materializations/tests/helpers.sql", "unique_id": "macro.dbt.get_unit_test_sql", "macro_sql": "{% macro get_unit_test_sql(main_sql, expected_fixture_sql, expected_column_names) -%}\n {{ adapter.dispatch('get_unit_test_sql', 'dbt')(main_sql, expected_fixture_sql, expected_column_names) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_unit_test_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "main_sql", "type": null, "description": ""}, {"name": "expected_fixture_sql", "type": null, "description": ""}, {"name": "expected_column_names", "type": null, "description": ""}], "created_at": 1786586787.646124, "supported_languages": null}, "macro.dbt.default__get_unit_test_sql": {"name": "default__get_unit_test_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/tests/helpers.sql", "original_file_path": "macros/materializations/tests/helpers.sql", "unique_id": "macro.dbt.default__get_unit_test_sql", "macro_sql": "{% macro default__get_unit_test_sql(main_sql, expected_fixture_sql, expected_column_names) -%}\n-- Build actual result given inputs\nwith dbt_internal_unit_test_actual as (\n select\n {% for expected_column_name in expected_column_names %}{{expected_column_name}}{% if not loop.last -%},{% endif %}{%- endfor -%}, {{ dbt.string_literal(\"actual\") }} as {{ adapter.quote(\"actual_or_expected\") }}\n from (\n {{ main_sql }}\n ) _dbt_internal_unit_test_actual\n),\n-- Build expected result\ndbt_internal_unit_test_expected as (\n select\n {% for expected_column_name in expected_column_names %}{{expected_column_name}}{% if not loop.last -%}, {% endif %}{%- endfor -%}, {{ dbt.string_literal(\"expected\") }} as {{ adapter.quote(\"actual_or_expected\") }}\n from (\n {{ expected_fixture_sql }}\n ) _dbt_internal_unit_test_expected\n)\n-- Union actual and expected results\nselect * from dbt_internal_unit_test_actual\nunion all\nselect * from dbt_internal_unit_test_expected\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.string_literal"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "main_sql", "type": null, "description": ""}, {"name": "expected_fixture_sql", "type": null, "description": ""}, {"name": "expected_column_names", "type": null, "description": ""}], "created_at": 1786586787.6471167, "supported_languages": null}, "macro.dbt.materialization_test_default": {"name": "materialization_test_default", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/tests/test.sql", "original_file_path": "macros/materializations/tests/test.sql", "unique_id": "macro.dbt.materialization_test_default", "macro_sql": "{%- materialization test, default -%}\n\n {% set relations = [] %}\n {% set limit = config.get('limit') %}\n {% set sql_header = config.get('sql_header') if flags.REQUIRE_SQL_HEADER_IN_TEST_CONFIGS else none %}\n\n {% set sql_with_limit %}\n {{ get_limit_subquery_sql(sql, limit) }}\n {% endset %}\n\n {% if should_store_failures() %}\n\n {% set identifier = model['alias'] %}\n {% set old_relation = adapter.get_relation(database=database, schema=schema, identifier=identifier) %}\n\n {% set store_failures_as = config.get('store_failures_as') %}\n -- if `--store-failures` is invoked via command line and `store_failures_as` is not set,\n -- config.get('store_failures_as', 'table') returns None, not 'table'\n {% if store_failures_as == none %}{% set store_failures_as = 'table' %}{% endif %}\n {% if store_failures_as not in ['table', 'view'] %}\n {{ exceptions.raise_compiler_error(\n \"'\" ~ store_failures_as ~ \"' is not a valid value for `store_failures_as`. \"\n \"Accepted values are: ['ephemeral', 'table', 'view']\"\n ) }}\n {% endif %}\n\n {% set target_relation = api.Relation.create(\n identifier=identifier, schema=schema, database=database, type=store_failures_as) -%} %}\n\n {% if old_relation %}\n {% do adapter.drop_relation(old_relation) %}\n {% endif %}\n\n {% call statement(auto_begin=True) %}\n {% if sql_header %}{{ sql_header }}{% endif %}\n {{ get_create_sql(target_relation, sql_with_limit) }}\n {% endcall %}\n\n {% do relations.append(target_relation) %}\n\n {# Since the test failures have already been saved to the database, reuse that result rather than querying again #}\n {% set main_sql %}\n select *\n from {{ target_relation }}\n {% endset %}\n\n {{ adapter.commit() }}\n\n {% else %}\n\n {% set main_sql = sql_with_limit %}\n\n {% endif %}\n\n {% set fail_calc = config.get('fail_calc') %}\n {% set warn_if = config.get('warn_if') %}\n {% set error_if = config.get('error_if') %}\n\n {% call statement('main', fetch_result=True) -%}\n\n {% if sql_header %}{{ sql_header }}{% endif %}\n {# The limit has already been included above, and we do not want to duplicate it again. We also want to be safe for macro overrides treating `limit` as a required parameter. #}\n {{ get_test_sql(main_sql, fail_calc, warn_if, error_if, limit=none)}}\n\n {%- endcall %}\n\n {{ return({'relations': relations}) }}\n\n{%- endmaterialization -%}", "depends_on": {"macros": ["macro.dbt.get_limit_subquery_sql", "macro.dbt.should_store_failures", "macro.dbt.statement", "macro.dbt.get_create_sql", "macro.dbt.get_test_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "supported_languages", "type": null, "description": ""}], "created_at": 1786586787.6513674, "supported_languages": ["sql"]}, "macro.dbt.materialization_unit_default": {"name": "materialization_unit_default", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/tests/unit.sql", "original_file_path": "macros/materializations/tests/unit.sql", "unique_id": "macro.dbt.materialization_unit_default", "macro_sql": "{%- materialization unit, default -%}\n\n {% set relations = [] %}\n {% set sql_header = config.get('sql_header') if flags.REQUIRE_SQL_HEADER_IN_TEST_CONFIGS else none %}\n\n {% set expected_rows = config.get('expected_rows') %}\n {% set expected_sql = config.get('expected_sql') %}\n {% set tested_expected_column_names = expected_rows[0].keys() if (expected_rows | length ) > 0 else get_columns_in_query(sql) %}\n\n {%- set target_relation = this.incorporate(type='table') -%}\n {%- set temp_relation = make_temp_relation(target_relation)-%}\n {% do run_query(get_create_table_as_sql(True, temp_relation, get_empty_subquery_sql(sql))) %}\n {%- set columns_in_relation = adapter.get_columns_in_relation(temp_relation) -%}\n {%- set column_name_to_data_types = {} -%}\n {%- set column_name_to_quoted = {} -%}\n {%- for column in columns_in_relation -%}\n {%- do column_name_to_data_types.update({column.name|lower: column.data_type}) -%}\n {%- do column_name_to_quoted.update({column.name|lower: column.quoted}) -%}\n {%- endfor -%}\n\n {%- set expected_column_names_quoted = [] -%}\n {%- for column_name in tested_expected_column_names -%}\n {%- do expected_column_names_quoted.append(column_name_to_quoted[column_name|lower]) -%}\n {%- endfor -%}\n\n {% if not expected_sql %}\n {% set expected_sql = get_expected_sql(expected_rows, column_name_to_data_types, column_name_to_quoted) %}\n {% endif %}\n {% set unit_test_sql = get_unit_test_sql(sql, expected_sql, expected_column_names_quoted) %}\n\n {% call statement('main', fetch_result=True) -%}\n\n {% if sql_header %}{{ sql_header }}{% endif %}\n {{ unit_test_sql }}\n\n {%- endcall %}\n\n {% do adapter.drop_relation(temp_relation) %}\n\n {{ return({'relations': relations}) }}\n\n{%- endmaterialization -%}", "depends_on": {"macros": ["macro.dbt.get_columns_in_query", "macro.dbt.make_temp_relation", "macro.dbt.run_query", "macro.dbt.get_create_table_as_sql", "macro.dbt.get_empty_subquery_sql", "macro.dbt.get_expected_sql", "macro.dbt.get_unit_test_sql", "macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "supported_languages", "type": null, "description": ""}], "created_at": 1786586787.654845, "supported_languages": ["sql"]}, "macro.dbt.materialization_seed_default": {"name": "materialization_seed_default", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/seeds/seed.sql", "original_file_path": "macros/materializations/seeds/seed.sql", "unique_id": "macro.dbt.materialization_seed_default", "macro_sql": "{% materialization seed, default %}\n\n {%- set identifier = model['alias'] -%}\n {%- set full_refresh_mode = (should_full_refresh()) -%}\n\n {%- set old_relation = adapter.get_relation(database=database, schema=schema, identifier=identifier) -%}\n\n {%- set exists_as_table = (old_relation is not none and old_relation.is_table) -%}\n {%- set exists_as_view = (old_relation is not none and old_relation.is_view) -%}\n\n {%- set grant_config = config.get('grants') -%}\n {%- set agate_table = load_agate_table() -%}\n -- grab current tables grants config for comparison later on\n\n {%- do store_result('agate_table', response='OK', agate_table=agate_table) -%}\n\n {{ run_hooks(pre_hooks, inside_transaction=False) }}\n\n -- `BEGIN` happens here:\n {{ run_hooks(pre_hooks, inside_transaction=True) }}\n\n -- build model\n {% set create_table_sql = \"\" %}\n {% if exists_as_view %}\n {{ exceptions.raise_compiler_error(\"Cannot seed to '{}', it is a view\".format(old_relation.render())) }}\n {% elif exists_as_table %}\n {% set create_table_sql = reset_csv_table(model, full_refresh_mode, old_relation, agate_table) %}\n {% else %}\n {% set create_table_sql = create_csv_table(model, agate_table) %}\n {% endif %}\n\n {% set code = 'CREATE' if full_refresh_mode else 'INSERT' %}\n {% set rows_affected = (agate_table.rows | length) %}\n {% set sql = \"\" %}\n {% if rows_affected > 0 %}\n {% set sql = load_csv_rows(model, agate_table) %}\n {% endif %}\n\n {% call noop_statement('main', code ~ ' ' ~ rows_affected, code, rows_affected) %}\n {{ get_csv_sql(create_table_sql, sql) }};\n {% endcall %}\n\n {% set target_relation = this.incorporate(type='table') %}\n\n {% set should_revoke = should_revoke(old_relation, full_refresh_mode) %}\n {% do apply_grants(target_relation, grant_config, should_revoke=should_revoke) %}\n\n {% do persist_docs(target_relation, model) %}\n\n {% if full_refresh_mode or not exists_as_table %}\n {% do create_indexes(target_relation) %}\n {% endif %}\n\n {{ run_hooks(post_hooks, inside_transaction=True) }}\n\n -- `COMMIT` happens here\n {{ adapter.commit() }}\n\n {{ run_hooks(post_hooks, inside_transaction=False) }}\n\n {{ return({'relations': [target_relation]}) }}\n\n{% endmaterialization %}", "depends_on": {"macros": ["macro.dbt.should_full_refresh", "macro.dbt.run_hooks", "macro.dbt.reset_csv_table", "macro.dbt.create_csv_table", "macro.dbt.load_csv_rows", "macro.dbt.noop_statement", "macro.dbt.get_csv_sql", "macro.dbt.should_revoke", "macro.dbt.apply_grants", "macro.dbt.persist_docs", "macro.dbt.create_indexes"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "supported_languages", "type": null, "description": ""}], "created_at": 1786586787.6592662, "supported_languages": ["sql"]}, "macro.dbt.create_csv_table": {"name": "create_csv_table", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "unique_id": "macro.dbt.create_csv_table", "macro_sql": "{% macro create_csv_table(model, agate_table) -%}\n {{ adapter.dispatch('create_csv_table', 'dbt')(model, agate_table) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__create_csv_table"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "agate_table", "type": null, "description": ""}], "created_at": 1786586787.6609457, "supported_languages": null}, "macro.dbt.default__create_csv_table": {"name": "default__create_csv_table", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "unique_id": "macro.dbt.default__create_csv_table", "macro_sql": "{% macro default__create_csv_table(model, agate_table) %}\n {%- set column_override = model['config'].get('column_types', {}) -%}\n {%- set quote_seed_column = model['config'].get('quote_columns', None) -%}\n\n {% set sql %}\n create table {{ this.render() }} (\n {%- for col_name in agate_table.column_names -%}\n {%- set inferred_type = adapter.convert_type(agate_table, loop.index0) -%}\n {%- set type = column_override.get(col_name, inferred_type) -%}\n {%- set column_name = (col_name | string) -%}\n {{ adapter.quote_seed_column(column_name, quote_seed_column) }} {{ type }} {%- if not loop.last -%}, {%- endif -%}\n {%- endfor -%}\n )\n {% endset %}\n\n {% call statement('_') -%}\n {{ sql }}\n {%- endcall %}\n\n {{ return(sql) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "agate_table", "type": null, "description": ""}], "created_at": 1786586787.662393, "supported_languages": null}, "macro.dbt.reset_csv_table": {"name": "reset_csv_table", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "unique_id": "macro.dbt.reset_csv_table", "macro_sql": "{% macro reset_csv_table(model, full_refresh, old_relation, agate_table) -%}\n {{ adapter.dispatch('reset_csv_table', 'dbt')(model, full_refresh, old_relation, agate_table) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__reset_csv_table"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "full_refresh", "type": null, "description": ""}, {"name": "old_relation", "type": null, "description": ""}, {"name": "agate_table", "type": null, "description": ""}], "created_at": 1786586787.6627839, "supported_languages": null}, "macro.dbt.default__reset_csv_table": {"name": "default__reset_csv_table", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "unique_id": "macro.dbt.default__reset_csv_table", "macro_sql": "{% macro default__reset_csv_table(model, full_refresh, old_relation, agate_table) %}\n {% set sql = \"\" %}\n {% if full_refresh %}\n {{ adapter.drop_relation(old_relation) }}\n {% set sql = create_csv_table(model, agate_table) %}\n {% else %}\n {{ adapter.truncate_relation(old_relation) }}\n {% set sql = \"truncate table \" ~ old_relation.render() %}\n {% endif %}\n\n {{ return(sql) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.create_csv_table"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "full_refresh", "type": null, "description": ""}, {"name": "old_relation", "type": null, "description": ""}, {"name": "agate_table", "type": null, "description": ""}], "created_at": 1786586787.6635792, "supported_languages": null}, "macro.dbt.get_csv_sql": {"name": "get_csv_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "unique_id": "macro.dbt.get_csv_sql", "macro_sql": "{% macro get_csv_sql(create_or_truncate_sql, insert_sql) %}\n {{ adapter.dispatch('get_csv_sql', 'dbt')(create_or_truncate_sql, insert_sql) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_csv_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "create_or_truncate_sql", "type": null, "description": ""}, {"name": "insert_sql", "type": null, "description": ""}], "created_at": 1786586787.6639047, "supported_languages": null}, "macro.dbt.default__get_csv_sql": {"name": "default__get_csv_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "unique_id": "macro.dbt.default__get_csv_sql", "macro_sql": "{% macro default__get_csv_sql(create_or_truncate_sql, insert_sql) %}\n {{ create_or_truncate_sql }};\n -- dbt seed --\n {{ insert_sql }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "create_or_truncate_sql", "type": null, "description": ""}, {"name": "insert_sql", "type": null, "description": ""}], "created_at": 1786586787.66413, "supported_languages": null}, "macro.dbt.get_binding_char": {"name": "get_binding_char", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "unique_id": "macro.dbt.get_binding_char", "macro_sql": "{% macro get_binding_char() -%}\n {{ adapter.dispatch('get_binding_char', 'dbt')() }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_binding_char"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1786586787.6643593, "supported_languages": null}, "macro.dbt.default__get_binding_char": {"name": "default__get_binding_char", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "unique_id": "macro.dbt.default__get_binding_char", "macro_sql": "{% macro default__get_binding_char() %}\n {{ return('%s') }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1786586787.6645484, "supported_languages": null}, "macro.dbt.get_batch_size": {"name": "get_batch_size", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "unique_id": "macro.dbt.get_batch_size", "macro_sql": "{% macro get_batch_size() -%}\n {{ return(adapter.dispatch('get_batch_size', 'dbt')()) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_batch_size"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1786586787.6648057, "supported_languages": null}, "macro.dbt.default__get_batch_size": {"name": "default__get_batch_size", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "unique_id": "macro.dbt.default__get_batch_size", "macro_sql": "{% macro default__get_batch_size() %}\n {{ return(10000) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1786586787.6650057, "supported_languages": null}, "macro.dbt.get_seed_column_quoted_csv": {"name": "get_seed_column_quoted_csv", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "unique_id": "macro.dbt.get_seed_column_quoted_csv", "macro_sql": "{% macro get_seed_column_quoted_csv(model, column_names) %}\n {%- set quote_seed_column = model['config'].get('quote_columns', None) -%}\n {% set quoted = [] %}\n {% for col in column_names -%}\n {%- do quoted.append(adapter.quote_seed_column(col, quote_seed_column)) -%}\n {%- endfor %}\n\n {%- set dest_cols_csv = quoted | join(', ') -%}\n {{ return(dest_cols_csv) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "column_names", "type": null, "description": ""}], "created_at": 1786586787.6657724, "supported_languages": null}, "macro.dbt.load_csv_rows": {"name": "load_csv_rows", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "unique_id": "macro.dbt.load_csv_rows", "macro_sql": "{% macro load_csv_rows(model, agate_table) -%}\n {{ adapter.dispatch('load_csv_rows', 'dbt')(model, agate_table) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__load_csv_rows"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "agate_table", "type": null, "description": ""}], "created_at": 1786586787.66619, "supported_languages": null}, "macro.dbt.default__load_csv_rows": {"name": "default__load_csv_rows", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "unique_id": "macro.dbt.default__load_csv_rows", "macro_sql": "{% macro default__load_csv_rows(model, agate_table) %}\n\n {% set batch_size = get_batch_size() %}\n\n {% set cols_sql = get_seed_column_quoted_csv(model, agate_table.column_names) %}\n {% set bindings = [] %}\n\n {% set statements = [] %}\n\n {% for chunk in agate_table.rows | batch(batch_size) %}\n {% set bindings = [] %}\n\n {% for row in chunk %}\n {% do bindings.extend(row) %}\n {% endfor %}\n\n {% set sql %}\n insert into {{ this.render() }} ({{ cols_sql }}) values\n {% for row in chunk -%}\n ({%- for column in agate_table.column_names -%}\n {{ get_binding_char() }}\n {%- if not loop.last%},{%- endif %}\n {%- endfor -%})\n {%- if not loop.last%},{%- endif %}\n {%- endfor %}\n {% endset %}\n\n {% do adapter.add_query(sql, bindings=bindings, abridge_sql_log=True) %}\n\n {% if loop.index0 == 0 %}\n {% do statements.append(sql) %}\n {% endif %}\n {% endfor %}\n\n {# Return SQL so we can render it out into the compiled files #}\n {{ return(statements[0]) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_batch_size", "macro.dbt.get_seed_column_quoted_csv", "macro.dbt.get_binding_char"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "agate_table", "type": null, "description": ""}], "created_at": 1786586787.6681795, "supported_languages": null}, "macro.dbt.get_aggregate_function_create_replace_signature": {"name": "get_aggregate_function_create_replace_signature", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/functions/aggregate.sql", "original_file_path": "macros/materializations/functions/aggregate.sql", "unique_id": "macro.dbt.get_aggregate_function_create_replace_signature", "macro_sql": "{% macro get_aggregate_function_create_replace_signature(target_relation) %}\n {{ return(adapter.dispatch('get_aggregate_function_create_replace_signature', 'dbt')(target_relation)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_aggregate_function_create_replace_signature"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "target_relation", "type": null, "description": ""}], "created_at": 1786586787.6693208, "supported_languages": null}, "macro.dbt.default__get_aggregate_function_create_replace_signature": {"name": "default__get_aggregate_function_create_replace_signature", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/functions/aggregate.sql", "original_file_path": "macros/materializations/functions/aggregate.sql", "unique_id": "macro.dbt.default__get_aggregate_function_create_replace_signature", "macro_sql": "{% macro default__get_aggregate_function_create_replace_signature(target_relation) %}\n CREATE OR REPLACE AGGREGATE FUNCTION {{ target_relation.render() }} ({{ get_formatted_aggregate_function_args()}})\n RETURNS {{ model.returns.data_type }}\n {{ get_function_language_specifier() }}\n {{ get_aggregate_function_volatility_specifier() }}\n {% if model.get('language') == 'python' %}\n {{ get_function_python_options() }}\n {% endif %}\n AS\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_formatted_aggregate_function_args", "macro.dbt.get_function_language_specifier", "macro.dbt.get_aggregate_function_volatility_specifier", "macro.dbt.get_function_python_options"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "target_relation", "type": null, "description": ""}], "created_at": 1786586787.66993, "supported_languages": null}, "macro.dbt.get_formatted_aggregate_function_args": {"name": "get_formatted_aggregate_function_args", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/functions/aggregate.sql", "original_file_path": "macros/materializations/functions/aggregate.sql", "unique_id": "macro.dbt.get_formatted_aggregate_function_args", "macro_sql": "{% macro get_formatted_aggregate_function_args() %}\n {{ return(adapter.dispatch('get_formatted_aggregate_function_args', 'dbt')()) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_formatted_aggregate_function_args"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1786586787.670215, "supported_languages": null}, "macro.dbt.default__get_formatted_aggregate_function_args": {"name": "default__get_formatted_aggregate_function_args", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/functions/aggregate.sql", "original_file_path": "macros/materializations/functions/aggregate.sql", "unique_id": "macro.dbt.default__get_formatted_aggregate_function_args", "macro_sql": "{% macro default__get_formatted_aggregate_function_args() %}\n {# conveniently we can reuse the sql scalar function args #}\n {{ formatted_scalar_function_args_sql() }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.formatted_scalar_function_args_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1786586787.6704047, "supported_languages": null}, "macro.dbt.get_function_language_specifier": {"name": "get_function_language_specifier", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/functions/aggregate.sql", "original_file_path": "macros/materializations/functions/aggregate.sql", "unique_id": "macro.dbt.get_function_language_specifier", "macro_sql": "{% macro get_function_language_specifier() %}\n {{ return(adapter.dispatch('get_function_language_specifier', 'dbt')()) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_function_language_specifier"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1786586787.67067, "supported_languages": null}, "macro.dbt.default__get_function_language_specifier": {"name": "default__get_function_language_specifier", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/functions/aggregate.sql", "original_file_path": "macros/materializations/functions/aggregate.sql", "unique_id": "macro.dbt.default__get_function_language_specifier", "macro_sql": "{% macro default__get_function_language_specifier() %}\n {% set language = model.get('language') %}\n {% if language == 'sql' %}\n {# generally you dont need to specify the language for sql functions #}\n {% elif language == 'python' %}\n LANGUAGE PYTHON\n {% elif language == 'javascript' %}\n LANGUAGE js\n {% else %}\n {{ 'LANGUAGE ' ~ language.upper() }}\n {% endif %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1786586787.6712773, "supported_languages": null}, "macro.dbt.get_aggregate_function_volatility_specifier": {"name": "get_aggregate_function_volatility_specifier", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/functions/aggregate.sql", "original_file_path": "macros/materializations/functions/aggregate.sql", "unique_id": "macro.dbt.get_aggregate_function_volatility_specifier", "macro_sql": "{% macro get_aggregate_function_volatility_specifier() %}\n {{ return(adapter.dispatch('get_aggregate_function_volatility_specifier', 'dbt')()) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_aggregate_function_volatility_specifier"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1786586787.671554, "supported_languages": null}, "macro.dbt.default__get_aggregate_function_volatility_specifier": {"name": "default__get_aggregate_function_volatility_specifier", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/functions/aggregate.sql", "original_file_path": "macros/materializations/functions/aggregate.sql", "unique_id": "macro.dbt.default__get_aggregate_function_volatility_specifier", "macro_sql": "{% macro default__get_aggregate_function_volatility_specifier() %}\n {{ scalar_function_volatility_sql() }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.scalar_function_volatility_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1786586787.671727, "supported_languages": null}, "macro.dbt.get_function_python_options": {"name": "get_function_python_options", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/functions/aggregate.sql", "original_file_path": "macros/materializations/functions/aggregate.sql", "unique_id": "macro.dbt.get_function_python_options", "macro_sql": "{% macro get_function_python_options() %}\n {{ return(adapter.dispatch('get_function_python_options', 'dbt')()) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_function_python_options"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1786586787.6720421, "supported_languages": null}, "macro.dbt.default__get_function_python_options": {"name": "default__get_function_python_options", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/functions/aggregate.sql", "original_file_path": "macros/materializations/functions/aggregate.sql", "unique_id": "macro.dbt.default__get_function_python_options", "macro_sql": "{% macro default__get_function_python_options() %}\n RUNTIME_VERSION = '{{ model.config.get('runtime_version') }}'\n HANDLER = '{{ model.config.get('entry_point') }}'\n {% set packages = model.config.get('packages', []) %}\n {% if packages %}\n PACKAGES = ('{{ packages | join(\"','\") }}')\n {% endif %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1786586787.672651, "supported_languages": null}, "macro.dbt.scalar_function_sql": {"name": "scalar_function_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/functions/scalar.sql", "original_file_path": "macros/materializations/functions/scalar.sql", "unique_id": "macro.dbt.scalar_function_sql", "macro_sql": "{% macro scalar_function_sql(target_relation) %}\n {{ return(adapter.dispatch('scalar_function_sql', 'dbt')(target_relation)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__scalar_function_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "target_relation", "type": null, "description": ""}], "created_at": 1786586787.6740568, "supported_languages": null}, "macro.dbt.default__scalar_function_sql": {"name": "default__scalar_function_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/functions/scalar.sql", "original_file_path": "macros/materializations/functions/scalar.sql", "unique_id": "macro.dbt.default__scalar_function_sql", "macro_sql": "{% macro default__scalar_function_sql(target_relation) %}\n {{ scalar_function_create_replace_signature_sql(target_relation) }}\n {{ scalar_function_body_sql() }};\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.scalar_function_create_replace_signature_sql", "macro.dbt.scalar_function_body_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "target_relation", "type": null, "description": ""}], "created_at": 1786586787.6743143, "supported_languages": null}, "macro.dbt.scalar_function_create_replace_signature_sql": {"name": "scalar_function_create_replace_signature_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/functions/scalar.sql", "original_file_path": "macros/materializations/functions/scalar.sql", "unique_id": "macro.dbt.scalar_function_create_replace_signature_sql", "macro_sql": "{% macro scalar_function_create_replace_signature_sql(target_relation) %}\n {{ return(adapter.dispatch('scalar_function_create_replace_signature_sql', 'dbt')(target_relation)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__scalar_function_create_replace_signature_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "target_relation", "type": null, "description": ""}], "created_at": 1786586787.6746094, "supported_languages": null}, "macro.dbt.default__scalar_function_create_replace_signature_sql": {"name": "default__scalar_function_create_replace_signature_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/functions/scalar.sql", "original_file_path": "macros/materializations/functions/scalar.sql", "unique_id": "macro.dbt.default__scalar_function_create_replace_signature_sql", "macro_sql": "{% macro default__scalar_function_create_replace_signature_sql(target_relation) %}\n CREATE OR REPLACE FUNCTION {{ target_relation.render() }} ({{ formatted_scalar_function_args_sql()}})\n RETURNS {{ model.returns.data_type }}\n {{ scalar_function_volatility_sql() }}\n AS\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.formatted_scalar_function_args_sql", "macro.dbt.scalar_function_volatility_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "target_relation", "type": null, "description": ""}], "created_at": 1786586787.6749635, "supported_languages": null}, "macro.dbt.formatted_scalar_function_args_sql": {"name": "formatted_scalar_function_args_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/functions/scalar.sql", "original_file_path": "macros/materializations/functions/scalar.sql", "unique_id": "macro.dbt.formatted_scalar_function_args_sql", "macro_sql": "{% macro formatted_scalar_function_args_sql() %}\n {{ return(adapter.dispatch('formatted_scalar_function_args_sql', 'dbt')()) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__formatted_scalar_function_args_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1786586787.6753414, "supported_languages": null}, "macro.dbt.formatted_scalar_function_args_javascript": {"name": "formatted_scalar_function_args_javascript", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/functions/scalar.sql", "original_file_path": "macros/materializations/functions/scalar.sql", "unique_id": "macro.dbt.formatted_scalar_function_args_javascript", "macro_sql": "{% macro formatted_scalar_function_args_javascript() %}\n {{ return(adapter.dispatch('formatted_scalar_function_args_javascript', 'dbt')()) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__formatted_scalar_function_args_javascript"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1786586787.6756134, "supported_languages": null}, "macro.dbt.default__formatted_scalar_function_args_sql": {"name": "default__formatted_scalar_function_args_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/functions/scalar.sql", "original_file_path": "macros/materializations/functions/scalar.sql", "unique_id": "macro.dbt.default__formatted_scalar_function_args_sql", "macro_sql": "{% macro default__formatted_scalar_function_args_sql() %}\n {% set args = [] %}\n {% for arg in model.arguments -%}\n {%- do args.append(arg.name ~ ' ' ~ arg.data_type) -%}\n {%- endfor %}\n {{ args | join(', ') }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1786586787.6761558, "supported_languages": null}, "macro.dbt.default__formatted_scalar_function_args_javascript": {"name": "default__formatted_scalar_function_args_javascript", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/functions/scalar.sql", "original_file_path": "macros/materializations/functions/scalar.sql", "unique_id": "macro.dbt.default__formatted_scalar_function_args_javascript", "macro_sql": "{% macro default__formatted_scalar_function_args_javascript() %}\n {% set msg = \"formatted_scalar_function_args_javascript not implemented for adapter \" ~ adapter.type() %}\n {% do exceptions.raise_compiler_error(msg) %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1786586787.6764925, "supported_languages": null}, "macro.dbt.scalar_function_body_sql": {"name": "scalar_function_body_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/functions/scalar.sql", "original_file_path": "macros/materializations/functions/scalar.sql", "unique_id": "macro.dbt.scalar_function_body_sql", "macro_sql": "{% macro scalar_function_body_sql() %}\n {{ return(adapter.dispatch('scalar_function_body_sql', 'dbt')()) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__scalar_function_body_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1786586787.6767642, "supported_languages": null}, "macro.dbt.default__scalar_function_body_sql": {"name": "default__scalar_function_body_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/functions/scalar.sql", "original_file_path": "macros/materializations/functions/scalar.sql", "unique_id": "macro.dbt.default__scalar_function_body_sql", "macro_sql": "{% macro default__scalar_function_body_sql() %}\n $$\n {{ model.compiled_code }}\n $$ LANGUAGE SQL\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1786586787.676948, "supported_languages": null}, "macro.dbt.scalar_function_volatility_sql": {"name": "scalar_function_volatility_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/functions/scalar.sql", "original_file_path": "macros/materializations/functions/scalar.sql", "unique_id": "macro.dbt.scalar_function_volatility_sql", "macro_sql": "{% macro scalar_function_volatility_sql() %}\n {{ return(adapter.dispatch('scalar_function_volatility_sql', 'dbt')()) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__scalar_function_volatility_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1786586787.6772132, "supported_languages": null}, "macro.dbt.scalar_function_volatility_javascript": {"name": "scalar_function_volatility_javascript", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/functions/scalar.sql", "original_file_path": "macros/materializations/functions/scalar.sql", "unique_id": "macro.dbt.scalar_function_volatility_javascript", "macro_sql": "{% macro scalar_function_volatility_javascript() %}\n {{ return(adapter.dispatch('scalar_function_volatility_javascript', 'dbt')()) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__scalar_function_volatility_javascript"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1786586787.6774764, "supported_languages": null}, "macro.dbt.default__scalar_function_volatility_javascript": {"name": "default__scalar_function_volatility_javascript", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/functions/scalar.sql", "original_file_path": "macros/materializations/functions/scalar.sql", "unique_id": "macro.dbt.default__scalar_function_volatility_javascript", "macro_sql": "{% macro default__scalar_function_volatility_javascript() %}\n {% set volatility = model.config.get('volatility') %}\n {% if volatility != none %}\n {% set msg = \"Volatility is not supported by \" ~ adapter.type() ~ \" in javascript UDF and will be ignored\" %}\n {% do exceptions.warn(msg) %}\n {% endif %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1786586787.6780677, "supported_languages": null}, "macro.dbt.default__scalar_function_volatility_sql": {"name": "default__scalar_function_volatility_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/functions/scalar.sql", "original_file_path": "macros/materializations/functions/scalar.sql", "unique_id": "macro.dbt.default__scalar_function_volatility_sql", "macro_sql": "{% macro default__scalar_function_volatility_sql() %}\n {% set volatility = model.config.get('volatility') %}\n {% if volatility == 'deterministic' %}\n IMMUTABLE\n {% elif volatility == 'stable' %}\n STABLE\n {% elif volatility == 'non-deterministic' %}\n VOLATILE\n {% elif volatility != none %}\n {# This shouldn't happen unless a new volatility is invented #}\n {% do unsupported_volatility_warning(volatility) %}\n {% endif %}\n {# If no volatility is set, don't add anything and let the data warehouse default it #}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.unsupported_volatility_warning"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1786586787.6787512, "supported_languages": null}, "macro.dbt.unsupported_volatility_warning": {"name": "unsupported_volatility_warning", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/functions/scalar.sql", "original_file_path": "macros/materializations/functions/scalar.sql", "unique_id": "macro.dbt.unsupported_volatility_warning", "macro_sql": "{% macro unsupported_volatility_warning(volatility) %}\n {{ return(adapter.dispatch('unsupported_volatility_warning', 'dbt')(volatility)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__unsupported_volatility_warning"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "volatility", "type": null, "description": ""}], "created_at": 1786586787.6790693, "supported_languages": null}, "macro.dbt.default__unsupported_volatility_warning": {"name": "default__unsupported_volatility_warning", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/functions/scalar.sql", "original_file_path": "macros/materializations/functions/scalar.sql", "unique_id": "macro.dbt.default__unsupported_volatility_warning", "macro_sql": "{% macro default__unsupported_volatility_warning(volatility) %}\n {% set msg = \"Found `\" ~ volatility ~ \"` volatility specified on function `\" ~ model.name ~ \"`. This volatility is not supported by \" ~ adapter.type() ~ \", and will be ignored\" %}\n {% do exceptions.warn(msg) %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "volatility", "type": null, "description": ""}], "created_at": 1786586787.679508, "supported_languages": null}, "macro.dbt.materialization_function_default": {"name": "materialization_function_default", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/functions/function.sql", "original_file_path": "macros/materializations/functions/function.sql", "unique_id": "macro.dbt.materialization_function_default", "macro_sql": "{% materialization function, default, supported_languages=['sql', 'python', 'javascript'] %}\n {% set existing_relation = load_cached_relation(this) %}\n {% set target_relation = this.incorporate(type=this.Function) %}\n\n {{ run_hooks(pre_hooks) }}\n\n {% set function_config = this.get_function_config(model) %}\n {% set macro_name = this.get_function_macro_name(function_config) %}\n\n {# Doing this aliasing of adapter.dispatch is a hacky way to disable the static analysis of actually calling adapter.dispatch #}\n {# This is necessary because the static analysis breaks being able to dynamically pass a macro_name #}\n {% set _dispatch = adapter.dispatch %}\n\n {% set build_sql = _dispatch(macro_name, 'dbt')(target_relation) %}\n {{ function_execute_build_sql(build_sql, existing_relation, target_relation) }}\n {{ run_hooks(post_hooks) }}\n\n {{ return({'relations': [target_relation]}) }}\n\n{% endmaterialization %}", "depends_on": {"macros": ["macro.dbt.load_cached_relation", "macro.dbt.run_hooks", "macro.dbt.function_execute_build_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "supported_languages", "type": null, "description": ""}], "created_at": 1786586787.681067, "supported_languages": ["sql", "python", "javascript"]}, "macro.dbt.function_execute_build_sql": {"name": "function_execute_build_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/functions/helpers.sql", "original_file_path": "macros/materializations/functions/helpers.sql", "unique_id": "macro.dbt.function_execute_build_sql", "macro_sql": "{% macro function_execute_build_sql(build_sql, existing_relation, target_relation) %}\n {{ return(adapter.dispatch('function_execute_build_sql', 'dbt')(build_sql, existing_relation, target_relation)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__function_execute_build_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "build_sql", "type": null, "description": ""}, {"name": "existing_relation", "type": null, "description": ""}, {"name": "target_relation", "type": null, "description": ""}], "created_at": 1786586787.6817014, "supported_languages": null}, "macro.dbt.default__function_execute_build_sql": {"name": "default__function_execute_build_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/functions/helpers.sql", "original_file_path": "macros/materializations/functions/helpers.sql", "unique_id": "macro.dbt.default__function_execute_build_sql", "macro_sql": "{% macro default__function_execute_build_sql(build_sql, existing_relation, target_relation) %}\n\n {% set grant_config = config.get('grants') %}\n\n {% call statement(name=\"main\") %}\n {{ build_sql }}\n {% endcall %}\n\n {% set should_revoke = should_revoke(existing_relation, full_refresh_mode=True) %}\n {% do apply_grants(target_relation, grant_config, should_revoke=should_revoke) %}\n\n {% do persist_docs(target_relation, model) %}\n\n {{ adapter.commit() }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement", "macro.dbt.should_revoke", "macro.dbt.apply_grants", "macro.dbt.persist_docs"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "build_sql", "type": null, "description": ""}, {"name": "existing_relation", "type": null, "description": ""}, {"name": "target_relation", "type": null, "description": ""}], "created_at": 1786586787.6825747, "supported_languages": null}, "macro.dbt.snapshot_merge_sql": {"name": "snapshot_merge_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/snapshot_merge.sql", "original_file_path": "macros/materializations/snapshots/snapshot_merge.sql", "unique_id": "macro.dbt.snapshot_merge_sql", "macro_sql": "{% macro snapshot_merge_sql(target, source, insert_cols) -%}\n {{ adapter.dispatch('snapshot_merge_sql', 'dbt')(target, source, insert_cols) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__snapshot_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "target", "type": null, "description": ""}, {"name": "source", "type": null, "description": ""}, {"name": "insert_cols", "type": null, "description": ""}], "created_at": 1786586787.6833107, "supported_languages": null}, "macro.dbt.default__snapshot_merge_sql": {"name": "default__snapshot_merge_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/snapshot_merge.sql", "original_file_path": "macros/materializations/snapshots/snapshot_merge.sql", "unique_id": "macro.dbt.default__snapshot_merge_sql", "macro_sql": "{% macro default__snapshot_merge_sql(target, source, insert_cols) -%}\n {%- set insert_cols_csv = insert_cols | join(', ') -%}\n\n {%- set columns = config.get(\"snapshot_table_column_names\") or get_snapshot_table_column_names() -%}\n\n merge into {{ target.render() }} as DBT_INTERNAL_DEST\n using {{ source }} as DBT_INTERNAL_SOURCE\n on DBT_INTERNAL_SOURCE.{{ columns.dbt_scd_id }} = DBT_INTERNAL_DEST.{{ columns.dbt_scd_id }}\n\n when matched\n {% if config.get(\"dbt_valid_to_current\") %}\n\t{% set source_unique_key = (\"DBT_INTERNAL_DEST.\" ~ columns.dbt_valid_to) | trim %}\n\t{% set target_unique_key = config.get('dbt_valid_to_current') | trim %}\n\tand ({{ equals(source_unique_key, target_unique_key) }} or {{ source_unique_key }} is null)\n\n {% else %}\n and DBT_INTERNAL_DEST.{{ columns.dbt_valid_to }} is null\n {% endif %}\n and DBT_INTERNAL_SOURCE.dbt_change_type in ('update', 'delete')\n then update\n set {{ columns.dbt_valid_to }} = DBT_INTERNAL_SOURCE.{{ columns.dbt_valid_to }}\n\n when not matched\n and DBT_INTERNAL_SOURCE.dbt_change_type = 'insert'\n then insert ({{ insert_cols_csv }})\n values ({{ insert_cols_csv }})\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_snapshot_table_column_names", "macro.dbt.equals"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "target", "type": null, "description": ""}, {"name": "source", "type": null, "description": ""}, {"name": "insert_cols", "type": null, "description": ""}], "created_at": 1786586787.6848001, "supported_languages": null}, "macro.dbt.materialization_snapshot_default": {"name": "materialization_snapshot_default", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/snapshot.sql", "original_file_path": "macros/materializations/snapshots/snapshot.sql", "unique_id": "macro.dbt.materialization_snapshot_default", "macro_sql": "{% materialization snapshot, default %}\n\n {%- set target_table = model.get('alias', model.get('name')) -%}\n\n {%- set strategy_name = config.get('strategy') -%}\n {%- set unique_key = config.get('unique_key') %}\n -- grab current tables grants config for comparision later on\n {%- set grant_config = config.get('grants') -%}\n\n {% set target_relation_exists, target_relation = get_or_create_relation(\n database=model.database,\n schema=model.schema,\n identifier=target_table,\n type='table') -%}\n\n {%- if not target_relation.is_table -%}\n {% do exceptions.relation_wrong_type(target_relation, 'table') %}\n {%- endif -%}\n\n\n {{ run_hooks(pre_hooks, inside_transaction=False) }}\n\n {{ run_hooks(pre_hooks, inside_transaction=True) }}\n\n {% set strategy_macro = strategy_dispatch(strategy_name) %}\n {# The model['config'] parameter below is no longer used, but passing anyway for compatibility #}\n {# It was a dictionary of config, instead of the config object from the context #}\n {% set strategy = strategy_macro(model, \"snapshotted_data\", \"source_data\", model['config'], target_relation_exists) %}\n\n {% if not target_relation_exists %}\n\n {% set build_sql = build_snapshot_table(strategy, model['compiled_code']) %}\n {% set build_or_select_sql = build_sql %}\n {% set final_sql = create_table_as(False, target_relation, build_sql) %}\n\n {% else %}\n\n {% set columns = config.get(\"snapshot_table_column_names\") or get_snapshot_table_column_names() %}\n\n {{ adapter.assert_valid_snapshot_target_given_strategy(target_relation, columns, strategy) }}\n\n {% set build_or_select_sql = snapshot_staging_table(strategy, sql, target_relation) %}\n {% set staging_table = build_snapshot_staging_table(strategy, sql, target_relation) %}\n\n -- this may no-op if the database does not require column expansion\n {% do adapter.expand_target_column_types(from_relation=staging_table,\n to_relation=target_relation) %}\n\n {% set remove_columns = ['dbt_change_type', 'DBT_CHANGE_TYPE', 'dbt_unique_key', 'DBT_UNIQUE_KEY'] %}\n {% if unique_key | is_list %}\n {% for key in strategy.unique_key %}\n {{ remove_columns.append('dbt_unique_key_' + loop.index|string) }}\n {{ remove_columns.append('DBT_UNIQUE_KEY_' + loop.index|string) }}\n {% endfor %}\n {% endif %}\n\n {% set missing_columns = adapter.get_missing_columns(staging_table, target_relation)\n | rejectattr('name', 'in', remove_columns)\n | list %}\n\n {% do create_columns(target_relation, missing_columns) %}\n\n {% set source_columns = adapter.get_columns_in_relation(staging_table)\n | rejectattr('name', 'in', remove_columns)\n | list %}\n\n {% set quoted_source_columns = [] %}\n {% for column in source_columns %}\n {% do quoted_source_columns.append(adapter.quote(column.name)) %}\n {% endfor %}\n\n {% set final_sql = snapshot_merge_sql(\n target = target_relation,\n source = staging_table,\n insert_cols = quoted_source_columns\n )\n %}\n\n {% endif %}\n\n\n {{ check_time_data_types(build_or_select_sql) }}\n\n {% call statement('main') %}\n {{ final_sql }}\n {% endcall %}\n\n {% set should_revoke = should_revoke(target_relation_exists, full_refresh_mode=False) %}\n {% do apply_grants(target_relation, grant_config, should_revoke=should_revoke) %}\n\n {% do persist_docs(target_relation, model) %}\n\n {% if not target_relation_exists %}\n {% do create_indexes(target_relation) %}\n {% endif %}\n\n {{ run_hooks(post_hooks, inside_transaction=True) }}\n\n {{ adapter.commit() }}\n\n {% if staging_table is defined %}\n {% do post_snapshot(staging_table) %}\n {% endif %}\n\n {{ run_hooks(post_hooks, inside_transaction=False) }}\n\n {{ return({'relations': [target_relation]}) }}\n\n{% endmaterialization %}", "depends_on": {"macros": ["macro.dbt.get_or_create_relation", "macro.dbt.run_hooks", "macro.dbt.strategy_dispatch", "macro.dbt.build_snapshot_table", "macro.dbt.create_table_as", "macro.dbt.get_snapshot_table_column_names", "macro.dbt.snapshot_staging_table", "macro.dbt.build_snapshot_staging_table", "macro.dbt.create_columns", "macro.dbt.snapshot_merge_sql", "macro.dbt.check_time_data_types", "macro.dbt.statement", "macro.dbt.should_revoke", "macro.dbt.apply_grants", "macro.dbt.persist_docs", "macro.dbt.create_indexes", "macro.dbt.post_snapshot"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "supported_languages", "type": null, "description": ""}], "created_at": 1786586787.691347, "supported_languages": ["sql"]}, "macro.dbt.strategy_dispatch": {"name": "strategy_dispatch", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/strategies.sql", "original_file_path": "macros/materializations/snapshots/strategies.sql", "unique_id": "macro.dbt.strategy_dispatch", "macro_sql": "{% macro strategy_dispatch(name) -%}\n{% set original_name = name %}\n {% if '.' in name %}\n {% set package_name, name = name.split(\".\", 1) %}\n {% else %}\n {% set package_name = none %}\n {% endif %}\n\n {% if package_name is none %}\n {% set package_context = context %}\n {% elif package_name in context %}\n {% set package_context = context[package_name] %}\n {% else %}\n {% set error_msg %}\n Could not find package '{{package_name}}', called with '{{original_name}}'\n {% endset %}\n {{ exceptions.raise_compiler_error(error_msg | trim) }}\n {% endif %}\n\n {%- set search_name = 'snapshot_' ~ name ~ '_strategy' -%}\n\n {% if search_name not in package_context %}\n {% set error_msg %}\n The specified strategy macro '{{name}}' was not found in package '{{ package_name }}'\n {% endset %}\n {{ exceptions.raise_compiler_error(error_msg | trim) }}\n {% endif %}\n {{ return(package_context[search_name]) }}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "name", "type": null, "description": ""}], "created_at": 1786586787.6948767, "supported_languages": null}, "macro.dbt.snapshot_hash_arguments": {"name": "snapshot_hash_arguments", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/strategies.sql", "original_file_path": "macros/materializations/snapshots/strategies.sql", "unique_id": "macro.dbt.snapshot_hash_arguments", "macro_sql": "{% macro snapshot_hash_arguments(args) -%}\n {{ adapter.dispatch('snapshot_hash_arguments', 'dbt')(args) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__snapshot_hash_arguments"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "args", "type": null, "description": ""}], "created_at": 1786586787.6951885, "supported_languages": null}, "macro.dbt.default__snapshot_hash_arguments": {"name": "default__snapshot_hash_arguments", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/strategies.sql", "original_file_path": "macros/materializations/snapshots/strategies.sql", "unique_id": "macro.dbt.default__snapshot_hash_arguments", "macro_sql": "{% macro default__snapshot_hash_arguments(args) -%}\n md5({%- for arg in args -%}\n coalesce(cast({{ arg }} as varchar ), '')\n {% if not loop.last %} || '|' || {% endif %}\n {%- endfor -%})\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "args", "type": null, "description": ""}], "created_at": 1786586787.6955576, "supported_languages": null}, "macro.dbt.snapshot_timestamp_strategy": {"name": "snapshot_timestamp_strategy", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/strategies.sql", "original_file_path": "macros/materializations/snapshots/strategies.sql", "unique_id": "macro.dbt.snapshot_timestamp_strategy", "macro_sql": "{% macro snapshot_timestamp_strategy(node, snapshotted_rel, current_rel, model_config, target_exists) %}\n {# The model_config parameter is no longer used, but is passed in anyway for compatibility. #}\n {% set primary_key = config.get('unique_key') %}\n {% set updated_at = config.get('updated_at') %}\n {% set hard_deletes = adapter.get_hard_deletes_behavior(config) %}\n {% set invalidate_hard_deletes = hard_deletes == 'invalidate' %}\n {% set columns = config.get(\"snapshot_table_column_names\") or get_snapshot_table_column_names() %}\n\n {#/*\n The snapshot relation might not have an {{ updated_at }} value if the\n snapshot strategy is changed from `check` to `timestamp`. We\n should use a dbt-created column for the comparison in the snapshot\n table instead of assuming that the user-supplied {{ updated_at }}\n will be present in the historical data.\n\n See https://github.com/dbt-labs/dbt-core/issues/2350\n */ #}\n {% set row_changed_expr -%}\n ({{ snapshotted_rel }}.{{ columns.dbt_valid_from }} < {{ current_rel }}.{{ updated_at }})\n {%- endset %}\n\n {% set scd_args = api.Relation.scd_args(primary_key, updated_at) %}\n {% set scd_id_expr = snapshot_hash_arguments(scd_args) %}\n\n {% do return({\n \"unique_key\": primary_key,\n \"updated_at\": updated_at,\n \"row_changed\": row_changed_expr,\n \"scd_id\": scd_id_expr,\n \"invalidate_hard_deletes\": invalidate_hard_deletes,\n \"hard_deletes\": hard_deletes\n }) %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_snapshot_table_column_names", "macro.dbt.snapshot_hash_arguments"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "node", "type": null, "description": ""}, {"name": "snapshotted_rel", "type": null, "description": ""}, {"name": "current_rel", "type": null, "description": ""}, {"name": "model_config", "type": null, "description": ""}, {"name": "target_exists", "type": null, "description": ""}], "created_at": 1786586787.697141, "supported_languages": null}, "macro.dbt.snapshot_string_as_time": {"name": "snapshot_string_as_time", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/strategies.sql", "original_file_path": "macros/materializations/snapshots/strategies.sql", "unique_id": "macro.dbt.snapshot_string_as_time", "macro_sql": "{% macro snapshot_string_as_time(timestamp) -%}\n {{ adapter.dispatch('snapshot_string_as_time', 'dbt')(timestamp) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__snapshot_string_as_time"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "timestamp", "type": null, "description": ""}], "created_at": 1786586787.6974223, "supported_languages": null}, "macro.dbt.default__snapshot_string_as_time": {"name": "default__snapshot_string_as_time", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/strategies.sql", "original_file_path": "macros/materializations/snapshots/strategies.sql", "unique_id": "macro.dbt.default__snapshot_string_as_time", "macro_sql": "{% macro default__snapshot_string_as_time(timestamp) %}\n {% do exceptions.raise_not_implemented(\n 'snapshot_string_as_time macro not implemented for adapter '+adapter.type()\n ) %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "timestamp", "type": null, "description": ""}], "created_at": 1786586787.6977017, "supported_languages": null}, "macro.dbt.snapshot_check_all_get_existing_columns": {"name": "snapshot_check_all_get_existing_columns", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/strategies.sql", "original_file_path": "macros/materializations/snapshots/strategies.sql", "unique_id": "macro.dbt.snapshot_check_all_get_existing_columns", "macro_sql": "{% macro snapshot_check_all_get_existing_columns(node, target_exists, check_cols_config) -%}\n {%- if not target_exists -%}\n {#-- no table yet -> return whatever the query does --#}\n {{ return((false, query_columns)) }}\n {%- endif -%}\n\n {#-- handle any schema changes --#}\n {%- set target_relation = adapter.get_relation(database=node.database, schema=node.schema, identifier=node.alias) -%}\n\n {% if check_cols_config == 'all' %}\n {%- set query_columns = get_columns_in_query(node['compiled_code']) -%}\n\n {% elif check_cols_config is iterable and (check_cols_config | length) > 0 %}\n {#-- query for proper casing/quoting, to support comparison below --#}\n {%- set select_check_cols_from_target -%}\n {#-- N.B. The whitespace below is necessary to avoid edge case issue with comments --#}\n {#-- See: https://github.com/dbt-labs/dbt-core/issues/6781 --#}\n select {{ check_cols_config | join(', ') }} from (\n {{ node['compiled_code'] }}\n ) subq\n {%- endset -%}\n {% set query_columns = get_columns_in_query(select_check_cols_from_target) %}\n\n {% else %}\n {% do exceptions.raise_compiler_error(\"Invalid value for 'check_cols': \" ~ check_cols_config) %}\n {% endif %}\n\n {%- set existing_cols = adapter.get_columns_in_relation(target_relation) | map(attribute = 'name') | list -%}\n {%- set ns = namespace() -%} {#-- handle for-loop scoping with a namespace --#}\n {%- set ns.column_added = false -%}\n\n {%- set intersection = [] -%}\n {%- for col in query_columns -%}\n {%- if col in existing_cols -%}\n {%- do intersection.append(adapter.quote(col)) -%}\n {%- else -%}\n {% set ns.column_added = true %}\n {%- endif -%}\n {%- endfor -%}\n {{ return((ns.column_added, intersection)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.get_columns_in_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "node", "type": null, "description": ""}, {"name": "target_exists", "type": null, "description": ""}, {"name": "check_cols_config", "type": null, "description": ""}], "created_at": 1786586787.6999614, "supported_languages": null}, "macro.dbt.snapshot_check_strategy": {"name": "snapshot_check_strategy", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/strategies.sql", "original_file_path": "macros/materializations/snapshots/strategies.sql", "unique_id": "macro.dbt.snapshot_check_strategy", "macro_sql": "{% macro snapshot_check_strategy(node, snapshotted_rel, current_rel, model_config, target_exists) %}\n {# The model_config parameter is no longer used, but is passed in anyway for compatibility. #}\n {% set check_cols_config = config.get('check_cols') %}\n {% set primary_key = config.get('unique_key') %}\n {% set hard_deletes = adapter.get_hard_deletes_behavior(config) %}\n {% set invalidate_hard_deletes = hard_deletes == 'invalidate' %}\n {% set updated_at = config.get('updated_at') or snapshot_get_time() %}\n\n {% set column_added = false %}\n\n {% set column_added, check_cols = snapshot_check_all_get_existing_columns(node, target_exists, check_cols_config) %}\n\n {%- set row_changed_expr -%}\n (\n {%- if column_added -%}\n {{ get_true_sql() }}\n {%- else -%}\n {%- for col in check_cols -%}\n {{ snapshotted_rel }}.{{ col }} != {{ current_rel }}.{{ col }}\n or\n (\n (({{ snapshotted_rel }}.{{ col }} is null) and not ({{ current_rel }}.{{ col }} is null))\n or\n ((not {{ snapshotted_rel }}.{{ col }} is null) and ({{ current_rel }}.{{ col }} is null))\n )\n {%- if not loop.last %} or {% endif -%}\n {%- endfor -%}\n {%- endif -%}\n )\n {%- endset %}\n\n {% set scd_args = api.Relation.scd_args(primary_key, updated_at) %}\n {% set scd_id_expr = snapshot_hash_arguments(scd_args) %}\n\n {% do return({\n \"unique_key\": primary_key,\n \"updated_at\": updated_at,\n \"row_changed\": row_changed_expr,\n \"scd_id\": scd_id_expr,\n \"invalidate_hard_deletes\": invalidate_hard_deletes,\n \"hard_deletes\": hard_deletes\n }) %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.snapshot_get_time", "macro.dbt.snapshot_check_all_get_existing_columns", "macro.dbt.get_true_sql", "macro.dbt.snapshot_hash_arguments"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "node", "type": null, "description": ""}, {"name": "snapshotted_rel", "type": null, "description": ""}, {"name": "current_rel", "type": null, "description": ""}, {"name": "model_config", "type": null, "description": ""}, {"name": "target_exists", "type": null, "description": ""}], "created_at": 1786586787.7024195, "supported_languages": null}, "macro.dbt.create_columns": {"name": "create_columns", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "unique_id": "macro.dbt.create_columns", "macro_sql": "{% macro create_columns(relation, columns) %}\n {{ adapter.dispatch('create_columns', 'dbt')(relation, columns) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__create_columns"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "columns", "type": null, "description": ""}], "created_at": 1786586787.7060893, "supported_languages": null}, "macro.dbt.default__create_columns": {"name": "default__create_columns", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "unique_id": "macro.dbt.default__create_columns", "macro_sql": "{% macro default__create_columns(relation, columns) %}\n {% for column in columns %}\n {% call statement() %}\n alter table {{ relation.render() }} add column {{ adapter.quote(column.name) }} {{ column.expanded_data_type }};\n {% endcall %}\n {% endfor %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "columns", "type": null, "description": ""}], "created_at": 1786586787.7066321, "supported_languages": null}, "macro.dbt.post_snapshot": {"name": "post_snapshot", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "unique_id": "macro.dbt.post_snapshot", "macro_sql": "{% macro post_snapshot(staging_relation) %}\n {{ adapter.dispatch('post_snapshot', 'dbt')(staging_relation) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__post_snapshot"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "staging_relation", "type": null, "description": ""}], "created_at": 1786586787.7069235, "supported_languages": null}, "macro.dbt.default__post_snapshot": {"name": "default__post_snapshot", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "unique_id": "macro.dbt.default__post_snapshot", "macro_sql": "{% macro default__post_snapshot(staging_relation) %}\n {# no-op #}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "staging_relation", "type": null, "description": ""}], "created_at": 1786586787.7070823, "supported_languages": null}, "macro.dbt.get_true_sql": {"name": "get_true_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "unique_id": "macro.dbt.get_true_sql", "macro_sql": "{% macro get_true_sql() %}\n {{ adapter.dispatch('get_true_sql', 'dbt')() }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_true_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1786586787.707319, "supported_languages": null}, "macro.dbt.default__get_true_sql": {"name": "default__get_true_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "unique_id": "macro.dbt.default__get_true_sql", "macro_sql": "{% macro default__get_true_sql() %}\n {{ return('TRUE') }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1786586787.7075126, "supported_languages": null}, "macro.dbt.snapshot_staging_table": {"name": "snapshot_staging_table", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "unique_id": "macro.dbt.snapshot_staging_table", "macro_sql": "{% macro snapshot_staging_table(strategy, source_sql, target_relation) -%}\n {{ adapter.dispatch('snapshot_staging_table', 'dbt')(strategy, source_sql, target_relation) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__snapshot_staging_table"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "strategy", "type": null, "description": ""}, {"name": "source_sql", "type": null, "description": ""}, {"name": "target_relation", "type": null, "description": ""}], "created_at": 1786586787.7078514, "supported_languages": null}, "macro.dbt.get_snapshot_table_column_names": {"name": "get_snapshot_table_column_names", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "unique_id": "macro.dbt.get_snapshot_table_column_names", "macro_sql": "{% macro get_snapshot_table_column_names() %}\n {{ return({'dbt_valid_to': 'dbt_valid_to', 'dbt_valid_from': 'dbt_valid_from', 'dbt_scd_id': 'dbt_scd_id', 'dbt_updated_at': 'dbt_updated_at', 'dbt_is_deleted': 'dbt_is_deleted'}) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1786586787.7082796, "supported_languages": null}, "macro.dbt.default__snapshot_staging_table": {"name": "default__snapshot_staging_table", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "unique_id": "macro.dbt.default__snapshot_staging_table", "macro_sql": "{% macro default__snapshot_staging_table(strategy, source_sql, target_relation) -%}\n {% set columns = config.get('snapshot_table_column_names') or get_snapshot_table_column_names() %}\n {% if strategy.hard_deletes == 'new_record' %}\n {% set new_scd_id = snapshot_hash_arguments([columns.dbt_scd_id, snapshot_get_time()]) %}\n {% endif %}\n with snapshot_query as (\n\n {{ source_sql }}\n\n ),\n\n snapshotted_data as (\n\n select *, {{ unique_key_fields(strategy.unique_key) }}\n from {{ target_relation }}\n where\n {% if config.get('dbt_valid_to_current') %}\n\t\t{% set source_unique_key = columns.dbt_valid_to | trim %}\n\t\t{% set target_unique_key = config.get('dbt_valid_to_current') | trim %}\n\n\t\t{# The exact equals semantics between NULL values depends on the current behavior flag set. Also, update records if the source field is null #}\n ( {{ equals(source_unique_key, target_unique_key) }} or {{ source_unique_key }} is null )\n {% else %}\n {{ columns.dbt_valid_to }} is null\n {% endif %}\n\n ),\n\n insertions_source_data as (\n\n select *, {{ unique_key_fields(strategy.unique_key) }},\n {{ strategy.updated_at }} as {{ columns.dbt_updated_at }},\n {{ strategy.updated_at }} as {{ columns.dbt_valid_from }},\n {{ get_dbt_valid_to_current(strategy, columns) }},\n {{ strategy.scd_id }} as {{ columns.dbt_scd_id }}\n\n from snapshot_query\n ),\n\n updates_source_data as (\n\n select *, {{ unique_key_fields(strategy.unique_key) }},\n {{ strategy.updated_at }} as {{ columns.dbt_updated_at }},\n {{ strategy.updated_at }} as {{ columns.dbt_valid_from }},\n {{ strategy.updated_at }} as {{ columns.dbt_valid_to }}\n\n from snapshot_query\n ),\n\n {%- if strategy.hard_deletes == 'invalidate' or strategy.hard_deletes == 'new_record' %}\n\n deletes_source_data as (\n\n select *, {{ unique_key_fields(strategy.unique_key) }}\n from snapshot_query\n ),\n {% endif %}\n\n insertions as (\n\n select\n 'insert' as dbt_change_type,\n source_data.*\n {%- if strategy.hard_deletes == 'new_record' -%}\n ,'False' as {{ columns.dbt_is_deleted }}\n {%- endif %}\n\n from insertions_source_data as source_data\n left outer join snapshotted_data\n on {{ unique_key_join_on(strategy.unique_key, \"snapshotted_data\", \"source_data\") }}\n where {{ unique_key_is_null(strategy.unique_key, \"snapshotted_data\") }}\n or ({{ unique_key_is_not_null(strategy.unique_key, \"snapshotted_data\") }} and (\n {{ strategy.row_changed }} {%- if strategy.hard_deletes == 'new_record' -%} or snapshotted_data.{{ columns.dbt_is_deleted }} = 'True' {% endif %}\n )\n\n )\n\n ),\n\n updates as (\n\n select\n 'update' as dbt_change_type,\n source_data.*,\n snapshotted_data.{{ columns.dbt_scd_id }}\n {%- if strategy.hard_deletes == 'new_record' -%}\n , snapshotted_data.{{ columns.dbt_is_deleted }}\n {%- endif %}\n\n from updates_source_data as source_data\n join snapshotted_data\n on {{ unique_key_join_on(strategy.unique_key, \"snapshotted_data\", \"source_data\") }}\n where (\n {{ strategy.row_changed }} {%- if strategy.hard_deletes == 'new_record' -%} or snapshotted_data.{{ columns.dbt_is_deleted }} = 'True' {% endif %}\n )\n )\n\n {%- if strategy.hard_deletes == 'invalidate' or strategy.hard_deletes == 'new_record' %}\n ,\n deletes as (\n\n select\n 'delete' as dbt_change_type,\n source_data.*,\n {{ snapshot_get_time() }} as {{ columns.dbt_valid_from }},\n {{ snapshot_get_time() }} as {{ columns.dbt_updated_at }},\n {{ snapshot_get_time() }} as {{ columns.dbt_valid_to }},\n snapshotted_data.{{ columns.dbt_scd_id }}\n {%- if strategy.hard_deletes == 'new_record' -%}\n , snapshotted_data.{{ columns.dbt_is_deleted }}\n {%- endif %}\n from snapshotted_data\n left join deletes_source_data as source_data\n on {{ unique_key_join_on(strategy.unique_key, \"snapshotted_data\", \"source_data\") }}\n where {{ unique_key_is_null(strategy.unique_key, \"source_data\") }}\n\n {%- if strategy.hard_deletes == 'new_record' %}\n and not (\n --avoid updating the record's valid_to if the latest entry is marked as deleted\n snapshotted_data.{{ columns.dbt_is_deleted }} = 'True'\n and\n {% if config.get('dbt_valid_to_current') -%}\n snapshotted_data.{{ columns.dbt_valid_to }} = {{ config.get('dbt_valid_to_current') }}\n {%- else -%}\n snapshotted_data.{{ columns.dbt_valid_to }} is null\n {%- endif %}\n )\n {%- endif %}\n )\n {%- endif %}\n\n {%- if strategy.hard_deletes == 'new_record' %}\n {% set snapshotted_cols = get_list_of_column_names(get_columns_in_relation(target_relation)) %}\n {% set source_col_names = get_columns_in_query(source_sql) %}\n ,\n deletion_records as (\n\n select\n 'insert' as dbt_change_type,\n {%- for col_name in source_col_names -%}\n {%- if col_name in snapshotted_cols -%}\n snapshotted_data.{{ adapter.quote(col_name) }},\n {%- else -%}\n source_data.{{ adapter.quote(col_name) }},\n {%- endif -%}\n {% endfor -%}\n {%- if strategy.unique_key | is_list -%}\n {%- for key in strategy.unique_key -%}\n snapshotted_data.{{ key }} as dbt_unique_key_{{ loop.index }},\n {% endfor -%}\n {%- else -%}\n snapshotted_data.dbt_unique_key as dbt_unique_key,\n {% endif -%}\n {{ snapshot_get_time() }} as {{ columns.dbt_valid_from }},\n {{ snapshot_get_time() }} as {{ columns.dbt_updated_at }},\n snapshotted_data.{{ columns.dbt_valid_to }} as {{ columns.dbt_valid_to }},\n {{ new_scd_id }} as {{ columns.dbt_scd_id }},\n 'True' as {{ columns.dbt_is_deleted }}\n from snapshotted_data\n left join deletes_source_data as source_data\n on {{ unique_key_join_on(strategy.unique_key, \"snapshotted_data\", \"source_data\") }}\n where {{ unique_key_is_null(strategy.unique_key, \"source_data\") }}\n and not (\n --avoid inserting a new record if the latest one is marked as deleted\n snapshotted_data.{{ columns.dbt_is_deleted }} = 'True'\n and\n {% if config.get('dbt_valid_to_current') -%}\n snapshotted_data.{{ columns.dbt_valid_to }} = {{ config.get('dbt_valid_to_current') }}\n {%- else -%}\n snapshotted_data.{{ columns.dbt_valid_to }} is null\n {%- endif %}\n )\n\n )\n {%- endif %}\n\n select * from insertions\n union all\n select * from updates\n {%- if strategy.hard_deletes == 'invalidate' or strategy.hard_deletes == 'new_record' %}\n union all\n select * from deletes\n {%- endif %}\n {%- if strategy.hard_deletes == 'new_record' %}\n union all\n select * from deletion_records\n {%- endif %}\n\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.get_snapshot_table_column_names", "macro.dbt.snapshot_hash_arguments", "macro.dbt.snapshot_get_time", "macro.dbt.unique_key_fields", "macro.dbt.equals", "macro.dbt.get_dbt_valid_to_current", "macro.dbt.unique_key_join_on", "macro.dbt.unique_key_is_null", "macro.dbt.unique_key_is_not_null", "macro.dbt.get_list_of_column_names", "macro.dbt.get_columns_in_relation", "macro.dbt.get_columns_in_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "strategy", "type": null, "description": ""}, {"name": "source_sql", "type": null, "description": ""}, {"name": "target_relation", "type": null, "description": ""}], "created_at": 1786586787.7154884, "supported_languages": null}, "macro.dbt.build_snapshot_table": {"name": "build_snapshot_table", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "unique_id": "macro.dbt.build_snapshot_table", "macro_sql": "{% macro build_snapshot_table(strategy, sql) -%}\n {{ adapter.dispatch('build_snapshot_table', 'dbt')(strategy, sql) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__build_snapshot_table"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "strategy", "type": null, "description": ""}, {"name": "sql", "type": null, "description": ""}], "created_at": 1786586787.7158737, "supported_languages": null}, "macro.dbt.default__build_snapshot_table": {"name": "default__build_snapshot_table", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "unique_id": "macro.dbt.default__build_snapshot_table", "macro_sql": "{% macro default__build_snapshot_table(strategy, sql) %}\n {% set columns = config.get('snapshot_table_column_names') or get_snapshot_table_column_names() %}\n\n select *,\n {{ strategy.scd_id }} as {{ columns.dbt_scd_id }},\n {{ strategy.updated_at }} as {{ columns.dbt_updated_at }},\n {{ strategy.updated_at }} as {{ columns.dbt_valid_from }},\n {{ get_dbt_valid_to_current(strategy, columns) }}\n {%- if strategy.hard_deletes == 'new_record' -%}\n , 'False' as {{ columns.dbt_is_deleted }}\n {% endif -%}\n from (\n {{ sql }}\n ) sbq\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_snapshot_table_column_names", "macro.dbt.get_dbt_valid_to_current"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "strategy", "type": null, "description": ""}, {"name": "sql", "type": null, "description": ""}], "created_at": 1786586787.7167294, "supported_languages": null}, "macro.dbt.build_snapshot_staging_table": {"name": "build_snapshot_staging_table", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "unique_id": "macro.dbt.build_snapshot_staging_table", "macro_sql": "{% macro build_snapshot_staging_table(strategy, sql, target_relation) %}\n {% set temp_relation = make_temp_relation(target_relation) %}\n\n {% set select = snapshot_staging_table(strategy, sql, target_relation) %}\n\n {% call statement('build_snapshot_staging_relation') %}\n {{ create_table_as(True, temp_relation, select) }}\n {% endcall %}\n\n {% do return(temp_relation) %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.make_temp_relation", "macro.dbt.snapshot_staging_table", "macro.dbt.statement", "macro.dbt.create_table_as"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "strategy", "type": null, "description": ""}, {"name": "sql", "type": null, "description": ""}, {"name": "target_relation", "type": null, "description": ""}], "created_at": 1786586787.717438, "supported_languages": null}, "macro.dbt.get_updated_at_column_data_type": {"name": "get_updated_at_column_data_type", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "unique_id": "macro.dbt.get_updated_at_column_data_type", "macro_sql": "{% macro get_updated_at_column_data_type(snapshot_sql) %}\n {% set snapshot_sql_column_schema = get_column_schema_from_query(snapshot_sql) %}\n {% set dbt_updated_at_data_type = null %}\n {% set ns = namespace() -%} {#-- handle for-loop scoping with a namespace --#}\n {% set ns.dbt_updated_at_data_type = null -%}\n {% for column in snapshot_sql_column_schema %}\n {% if ((column.column == 'dbt_updated_at') or (column.column == 'DBT_UPDATED_AT')) %}\n {% set ns.dbt_updated_at_data_type = column.dtype %}\n {% endif %}\n {% endfor %}\n {{ return(ns.dbt_updated_at_data_type or none) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_column_schema_from_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "snapshot_sql", "type": null, "description": ""}], "created_at": 1786586787.7184045, "supported_languages": null}, "macro.dbt.check_time_data_types": {"name": "check_time_data_types", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "unique_id": "macro.dbt.check_time_data_types", "macro_sql": "{% macro check_time_data_types(sql) %}\n {% set dbt_updated_at_data_type = get_updated_at_column_data_type(sql) %}\n {% set snapshot_get_time_data_type = get_snapshot_get_time_data_type() %}\n {% if snapshot_get_time_data_type is not none and dbt_updated_at_data_type is not none and snapshot_get_time_data_type != dbt_updated_at_data_type %}\n {% if exceptions.warn_snapshot_timestamp_data_types %}\n {{ exceptions.warn_snapshot_timestamp_data_types(snapshot_get_time_data_type, dbt_updated_at_data_type) }}\n {% endif %}\n {% endif %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_updated_at_column_data_type", "macro.dbt.get_snapshot_get_time_data_type"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "sql", "type": null, "description": ""}], "created_at": 1786586787.7191057, "supported_languages": null}, "macro.dbt.get_dbt_valid_to_current": {"name": "get_dbt_valid_to_current", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "unique_id": "macro.dbt.get_dbt_valid_to_current", "macro_sql": "{% macro get_dbt_valid_to_current(strategy, columns) %}\n {% set dbt_valid_to_current = config.get('dbt_valid_to_current') or \"null\" %}\n coalesce(nullif({{ strategy.updated_at }}, {{ strategy.updated_at }}), {{dbt_valid_to_current}})\n as {{ columns.dbt_valid_to }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "strategy", "type": null, "description": ""}, {"name": "columns", "type": null, "description": ""}], "created_at": 1786586787.719556, "supported_languages": null}, "macro.dbt.unique_key_fields": {"name": "unique_key_fields", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "unique_id": "macro.dbt.unique_key_fields", "macro_sql": "{% macro unique_key_fields(unique_key) %}\n {% if unique_key | is_list %}\n {% for key in unique_key %}\n {{ key }} as dbt_unique_key_{{ loop.index }}\n {%- if not loop.last %} , {%- endif %}\n {% endfor %}\n {% else %}\n {{ unique_key }} as dbt_unique_key\n {% endif %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "unique_key", "type": null, "description": ""}], "created_at": 1786586787.7201128, "supported_languages": null}, "macro.dbt.unique_key_join_on": {"name": "unique_key_join_on", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "unique_id": "macro.dbt.unique_key_join_on", "macro_sql": "{% macro unique_key_join_on(unique_key, identifier, from_identifier) %}\n {% if unique_key | is_list %}\n {% for key in unique_key %}\n\t {% set source_unique_key = (identifier ~ \".dbt_unique_key_\" ~ loop.index) | trim %}\n\t {% set target_unique_key = (from_identifier ~ \".dbt_unique_key_\" ~ loop.index) | trim %}\n\t {{ equals(source_unique_key, target_unique_key) }}\n {%- if not loop.last %} and {%- endif %}\n {% endfor %}\n {% else %}\n {{ identifier }}.dbt_unique_key = {{ from_identifier }}.dbt_unique_key\n {% endif %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.equals"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "unique_key", "type": null, "description": ""}, {"name": "identifier", "type": null, "description": ""}, {"name": "from_identifier", "type": null, "description": ""}], "created_at": 1786586787.721055, "supported_languages": null}, "macro.dbt.unique_key_is_null": {"name": "unique_key_is_null", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "unique_id": "macro.dbt.unique_key_is_null", "macro_sql": "{% macro unique_key_is_null(unique_key, identifier) %}\n {% if unique_key | is_list %}\n {{ identifier }}.dbt_unique_key_1 is null\n {% else %}\n {{ identifier }}.dbt_unique_key is null\n {% endif %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "unique_key", "type": null, "description": ""}, {"name": "identifier", "type": null, "description": ""}], "created_at": 1786586787.7214048, "supported_languages": null}, "macro.dbt.unique_key_is_not_null": {"name": "unique_key_is_not_null", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "unique_id": "macro.dbt.unique_key_is_not_null", "macro_sql": "{% macro unique_key_is_not_null(unique_key, identifier) %}\n {% if unique_key | is_list %}\n {{ identifier }}.dbt_unique_key_1 is not null\n {% else %}\n {{ identifier }}.dbt_unique_key is not null\n {% endif %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "unique_key", "type": null, "description": ""}, {"name": "identifier", "type": null, "description": ""}], "created_at": 1786586787.7217388, "supported_languages": null}, "macro.dbt.get_create_backup_sql": {"name": "get_create_backup_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/create_backup.sql", "original_file_path": "macros/relations/create_backup.sql", "unique_id": "macro.dbt.get_create_backup_sql", "macro_sql": "{%- macro get_create_backup_sql(relation) -%}\n {{- log('Applying CREATE BACKUP to: ' ~ relation) -}}\n {{- adapter.dispatch('get_create_backup_sql', 'dbt')(relation) -}}\n{%- endmacro -%}\n\n\n", "depends_on": {"macros": ["macro.dbt.default__get_create_backup_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1786586787.7223077, "supported_languages": null}, "macro.dbt.default__get_create_backup_sql": {"name": "default__get_create_backup_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/create_backup.sql", "original_file_path": "macros/relations/create_backup.sql", "unique_id": "macro.dbt.default__get_create_backup_sql", "macro_sql": "{%- macro default__get_create_backup_sql(relation) -%}\n\n -- get the standard backup name\n {% set backup_relation = make_backup_relation(relation, relation.type) %}\n\n -- drop any pre-existing backup\n {{ get_drop_sql(backup_relation) }};\n\n {{ get_rename_sql(relation, backup_relation.identifier) }}\n\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt.make_backup_relation", "macro.dbt.get_drop_sql", "macro.dbt.get_rename_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1786586787.7227437, "supported_languages": null}, "macro.dbt.get_rename_sql": {"name": "get_rename_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/rename.sql", "original_file_path": "macros/relations/rename.sql", "unique_id": "macro.dbt.get_rename_sql", "macro_sql": "{%- macro get_rename_sql(relation, new_name) -%}\n {{- log('Applying RENAME to: ' ~ relation) -}}\n {{- adapter.dispatch('get_rename_sql', 'dbt')(relation, new_name) -}}\n{%- endmacro -%}\n\n\n", "depends_on": {"macros": ["macro.dbt.default__get_rename_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "new_name", "type": null, "description": ""}], "created_at": 1786586787.72353, "supported_languages": null}, "macro.dbt.default__get_rename_sql": {"name": "default__get_rename_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/rename.sql", "original_file_path": "macros/relations/rename.sql", "unique_id": "macro.dbt.default__get_rename_sql", "macro_sql": "{%- macro default__get_rename_sql(relation, new_name) -%}\n\n {%- if relation.is_view -%}\n {{ get_rename_view_sql(relation, new_name) }}\n\n {%- elif relation.is_table -%}\n {{ get_rename_table_sql(relation, new_name) }}\n\n {%- elif relation.is_materialized_view -%}\n {{ get_rename_materialized_view_sql(relation, new_name) }}\n\n {%- else -%}\n {{- exceptions.raise_compiler_error(\"`get_rename_sql` has not been implemented for: \" ~ relation.type ) -}}\n\n {%- endif -%}\n\n{%- endmacro -%}\n\n\n", "depends_on": {"macros": ["macro.dbt.get_rename_view_sql", "macro.dbt.get_rename_table_sql", "macro.dbt.get_rename_materialized_view_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "new_name", "type": null, "description": ""}], "created_at": 1786586787.7242577, "supported_languages": null}, "macro.dbt.rename_relation": {"name": "rename_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/rename.sql", "original_file_path": "macros/relations/rename.sql", "unique_id": "macro.dbt.rename_relation", "macro_sql": "{% macro rename_relation(from_relation, to_relation) -%}\n {{ return(adapter.dispatch('rename_relation', 'dbt')(from_relation, to_relation)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__rename_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "from_relation", "type": null, "description": ""}, {"name": "to_relation", "type": null, "description": ""}], "created_at": 1786586787.7245982, "supported_languages": null}, "macro.dbt.default__rename_relation": {"name": "default__rename_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/rename.sql", "original_file_path": "macros/relations/rename.sql", "unique_id": "macro.dbt.default__rename_relation", "macro_sql": "{% macro default__rename_relation(from_relation, to_relation) -%}\n {% set target_name = adapter.quote_as_configured(to_relation.identifier, 'identifier') %}\n {% call statement('rename_relation') -%}\n alter table {{ from_relation.render() }} rename to {{ target_name }}\n {%- endcall %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "from_relation", "type": null, "description": ""}, {"name": "to_relation", "type": null, "description": ""}], "created_at": 1786586787.7250967, "supported_languages": null}, "macro.dbt.get_replace_sql": {"name": "get_replace_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/replace.sql", "original_file_path": "macros/relations/replace.sql", "unique_id": "macro.dbt.get_replace_sql", "macro_sql": "{% macro get_replace_sql(existing_relation, target_relation, sql) %}\n {{- log('Applying REPLACE to: ' ~ existing_relation) -}}\n {{- adapter.dispatch('get_replace_sql', 'dbt')(existing_relation, target_relation, sql) -}}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_replace_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "existing_relation", "type": null, "description": ""}, {"name": "target_relation", "type": null, "description": ""}, {"name": "sql", "type": null, "description": ""}], "created_at": 1786586787.7260215, "supported_languages": null}, "macro.dbt.default__get_replace_sql": {"name": "default__get_replace_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/replace.sql", "original_file_path": "macros/relations/replace.sql", "unique_id": "macro.dbt.default__get_replace_sql", "macro_sql": "{% macro default__get_replace_sql(existing_relation, target_relation, sql) %}\n\n {# /* use a create or replace statement if possible */ #}\n\n {% set is_replaceable = existing_relation.type == target_relation.type and existing_relation.can_be_replaced %}\n\n {% if is_replaceable and existing_relation.is_view %}\n {{ get_replace_view_sql(target_relation, sql) }}\n\n {% elif is_replaceable and existing_relation.is_table %}\n {{ get_replace_table_sql(target_relation, sql) }}\n\n {% elif is_replaceable and existing_relation.is_materialized_view %}\n {{ get_replace_materialized_view_sql(target_relation, sql) }}\n\n {# /* a create or replace statement is not possible, so try to stage and/or backup to be safe */ #}\n\n {# /* create target_relation as an intermediate relation, then swap it out with the existing one using a backup */ #}\n {%- elif target_relation.can_be_renamed and existing_relation.can_be_renamed -%}\n {{ get_create_intermediate_sql(target_relation, sql) }};\n {{ get_create_backup_sql(existing_relation) }};\n {{ get_rename_intermediate_sql(target_relation) }};\n {{ get_drop_backup_sql(existing_relation) }}\n\n {# /* create target_relation as an intermediate relation, then swap it out with the existing one without using a backup */ #}\n {%- elif target_relation.can_be_renamed -%}\n {{ get_create_intermediate_sql(target_relation, sql) }};\n {{ get_drop_sql(existing_relation) }};\n {{ get_rename_intermediate_sql(target_relation) }}\n\n {# /* create target_relation in place by first backing up the existing relation */ #}\n {%- elif existing_relation.can_be_renamed -%}\n {{ get_create_backup_sql(existing_relation) }};\n {{ get_create_sql(target_relation, sql) }};\n {{ get_drop_backup_sql(existing_relation) }}\n\n {# /* no renaming is allowed, so just drop and create */ #}\n {%- else -%}\n {{ get_drop_sql(existing_relation) }};\n {{ get_create_sql(target_relation, sql) }}\n\n {%- endif -%}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_replace_view_sql", "macro.dbt.get_replace_table_sql", "macro.dbt.get_replace_materialized_view_sql", "macro.dbt.get_create_intermediate_sql", "macro.dbt.get_create_backup_sql", "macro.dbt.get_rename_intermediate_sql", "macro.dbt.get_drop_backup_sql", "macro.dbt.get_drop_sql", "macro.dbt.get_create_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "existing_relation", "type": null, "description": ""}, {"name": "target_relation", "type": null, "description": ""}, {"name": "sql", "type": null, "description": ""}], "created_at": 1786586787.7280626, "supported_languages": null}, "macro.dbt.drop_schema_named": {"name": "drop_schema_named", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/schema.sql", "original_file_path": "macros/relations/schema.sql", "unique_id": "macro.dbt.drop_schema_named", "macro_sql": "{% macro drop_schema_named(schema_name) %}\n {{ return(adapter.dispatch('drop_schema_named', 'dbt') (schema_name)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__drop_schema_named"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "schema_name", "type": null, "description": ""}], "created_at": 1786586787.7285335, "supported_languages": null}, "macro.dbt.default__drop_schema_named": {"name": "default__drop_schema_named", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/schema.sql", "original_file_path": "macros/relations/schema.sql", "unique_id": "macro.dbt.default__drop_schema_named", "macro_sql": "{% macro default__drop_schema_named(schema_name) %}\n {% set schema_relation = api.Relation.create(schema=schema_name) %}\n {{ adapter.drop_schema(schema_relation) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "schema_name", "type": null, "description": ""}], "created_at": 1786586787.728881, "supported_languages": null}, "macro.dbt.get_rename_intermediate_sql": {"name": "get_rename_intermediate_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/rename_intermediate.sql", "original_file_path": "macros/relations/rename_intermediate.sql", "unique_id": "macro.dbt.get_rename_intermediate_sql", "macro_sql": "{%- macro get_rename_intermediate_sql(relation) -%}\n {{- log('Applying RENAME INTERMEDIATE to: ' ~ relation) -}}\n {{- adapter.dispatch('get_rename_intermediate_sql', 'dbt')(relation) -}}\n{%- endmacro -%}\n\n\n", "depends_on": {"macros": ["macro.dbt.default__get_rename_intermediate_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1786586787.7293885, "supported_languages": null}, "macro.dbt.default__get_rename_intermediate_sql": {"name": "default__get_rename_intermediate_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/rename_intermediate.sql", "original_file_path": "macros/relations/rename_intermediate.sql", "unique_id": "macro.dbt.default__get_rename_intermediate_sql", "macro_sql": "{%- macro default__get_rename_intermediate_sql(relation) -%}\n\n -- get the standard intermediate name\n {% set intermediate_relation = make_intermediate_relation(relation) %}\n\n {{ get_rename_sql(intermediate_relation, relation.identifier) }}\n\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt.make_intermediate_relation", "macro.dbt.get_rename_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1786586787.7297244, "supported_languages": null}, "macro.dbt.get_create_sql": {"name": "get_create_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/create.sql", "original_file_path": "macros/relations/create.sql", "unique_id": "macro.dbt.get_create_sql", "macro_sql": "{%- macro get_create_sql(relation, sql) -%}\n {{- log('Applying CREATE to: ' ~ relation) -}}\n {{- adapter.dispatch('get_create_sql', 'dbt')(relation, sql) -}}\n{%- endmacro -%}\n\n\n", "depends_on": {"macros": ["macro.dbt.default__get_create_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "sql", "type": null, "description": ""}], "created_at": 1786586787.7303526, "supported_languages": null}, "macro.dbt.default__get_create_sql": {"name": "default__get_create_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/create.sql", "original_file_path": "macros/relations/create.sql", "unique_id": "macro.dbt.default__get_create_sql", "macro_sql": "{%- macro default__get_create_sql(relation, sql) -%}\n\n {%- if relation.is_view -%}\n {{ get_create_view_as_sql(relation, sql) }}\n\n {%- elif relation.is_table -%}\n {{ get_create_table_as_sql(False, relation, sql) }}\n\n {%- elif relation.is_materialized_view -%}\n {{ get_create_materialized_view_as_sql(relation, sql) }}\n\n {%- else -%}\n {{- exceptions.raise_compiler_error(\"`get_create_sql` has not been implemented for: \" ~ relation.type ) -}}\n\n {%- endif -%}\n\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt.get_create_view_as_sql", "macro.dbt.get_create_table_as_sql", "macro.dbt.get_create_materialized_view_as_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "sql", "type": null, "description": ""}], "created_at": 1786586787.7310784, "supported_languages": null}, "macro.dbt.get_drop_backup_sql": {"name": "get_drop_backup_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/drop_backup.sql", "original_file_path": "macros/relations/drop_backup.sql", "unique_id": "macro.dbt.get_drop_backup_sql", "macro_sql": "{%- macro get_drop_backup_sql(relation) -%}\n {{- log('Applying DROP BACKUP to: ' ~ relation) -}}\n {{- adapter.dispatch('get_drop_backup_sql', 'dbt')(relation) -}}\n{%- endmacro -%}\n\n\n", "depends_on": {"macros": ["macro.dbt.default__get_drop_backup_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1786586787.7315755, "supported_languages": null}, "macro.dbt.default__get_drop_backup_sql": {"name": "default__get_drop_backup_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/drop_backup.sql", "original_file_path": "macros/relations/drop_backup.sql", "unique_id": "macro.dbt.default__get_drop_backup_sql", "macro_sql": "{%- macro default__get_drop_backup_sql(relation) -%}\n\n -- get the standard backup name\n {% set backup_relation = make_backup_relation(relation, relation.type) %}\n\n {{ get_drop_sql(backup_relation) }}\n\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt.make_backup_relation", "macro.dbt.get_drop_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1786586787.731926, "supported_languages": null}, "macro.dbt.get_create_intermediate_sql": {"name": "get_create_intermediate_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/create_intermediate.sql", "original_file_path": "macros/relations/create_intermediate.sql", "unique_id": "macro.dbt.get_create_intermediate_sql", "macro_sql": "{%- macro get_create_intermediate_sql(relation, sql) -%}\n {{- log('Applying CREATE INTERMEDIATE to: ' ~ relation) -}}\n {{- adapter.dispatch('get_create_intermediate_sql', 'dbt')(relation, sql) -}}\n{%- endmacro -%}\n\n\n", "depends_on": {"macros": ["macro.dbt.default__get_create_intermediate_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "sql", "type": null, "description": ""}], "created_at": 1786586787.7324805, "supported_languages": null}, "macro.dbt.default__get_create_intermediate_sql": {"name": "default__get_create_intermediate_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/create_intermediate.sql", "original_file_path": "macros/relations/create_intermediate.sql", "unique_id": "macro.dbt.default__get_create_intermediate_sql", "macro_sql": "{%- macro default__get_create_intermediate_sql(relation, sql) -%}\n\n -- get the standard intermediate name\n {% set intermediate_relation = make_intermediate_relation(relation) %}\n\n -- drop any pre-existing intermediate\n {{ get_drop_sql(intermediate_relation) }};\n\n {{ get_create_sql(intermediate_relation, sql) }}\n\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt.make_intermediate_relation", "macro.dbt.get_drop_sql", "macro.dbt.get_create_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "sql", "type": null, "description": ""}], "created_at": 1786586787.7329073, "supported_languages": null}, "macro.dbt.get_drop_sql": {"name": "get_drop_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/drop.sql", "original_file_path": "macros/relations/drop.sql", "unique_id": "macro.dbt.get_drop_sql", "macro_sql": "{%- macro get_drop_sql(relation) -%}\n {{- log('Applying DROP to: ' ~ relation) -}}\n {{- adapter.dispatch('get_drop_sql', 'dbt')(relation) -}}\n{%- endmacro -%}\n\n\n", "depends_on": {"macros": ["macro.dbt.default__get_drop_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1786586787.7336423, "supported_languages": null}, "macro.dbt.default__get_drop_sql": {"name": "default__get_drop_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/drop.sql", "original_file_path": "macros/relations/drop.sql", "unique_id": "macro.dbt.default__get_drop_sql", "macro_sql": "{%- macro default__get_drop_sql(relation) -%}\n\n {%- if relation.is_view -%}\n {{ drop_view(relation) }}\n\n {%- elif relation.is_table -%}\n {{ drop_table(relation) }}\n\n {%- elif relation.is_materialized_view -%}\n {{ drop_materialized_view(relation) }}\n\n {%- else -%}\n drop {{ relation.type }} if exists {{ relation.render() }} cascade\n\n {%- endif -%}\n\n{%- endmacro -%}\n\n\n", "depends_on": {"macros": ["macro.dbt.drop_view", "macro.dbt.drop_table", "macro.dbt.drop_materialized_view"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1786586787.734275, "supported_languages": null}, "macro.dbt.drop_relation": {"name": "drop_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/drop.sql", "original_file_path": "macros/relations/drop.sql", "unique_id": "macro.dbt.drop_relation", "macro_sql": "{% macro drop_relation(relation) -%}\n {{ return(adapter.dispatch('drop_relation', 'dbt')(relation)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__drop_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1786586787.7345772, "supported_languages": null}, "macro.dbt.default__drop_relation": {"name": "default__drop_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/drop.sql", "original_file_path": "macros/relations/drop.sql", "unique_id": "macro.dbt.default__drop_relation", "macro_sql": "{% macro default__drop_relation(relation) -%}\n {% call statement('drop_relation', auto_begin=False) -%}\n {{ get_drop_sql(relation) }}\n {%- endcall %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement", "macro.dbt.get_drop_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1786586787.7349124, "supported_languages": null}, "macro.dbt.drop_relation_if_exists": {"name": "drop_relation_if_exists", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/drop.sql", "original_file_path": "macros/relations/drop.sql", "unique_id": "macro.dbt.drop_relation_if_exists", "macro_sql": "{% macro drop_relation_if_exists(relation) %}\n {% if relation is not none %}\n {{ adapter.drop_relation(relation) }}\n {% endif %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1786586787.7353337, "supported_languages": null}, "macro.dbt.get_rename_table_sql": {"name": "get_rename_table_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/table/rename.sql", "original_file_path": "macros/relations/table/rename.sql", "unique_id": "macro.dbt.get_rename_table_sql", "macro_sql": "{% macro get_rename_table_sql(relation, new_name) %}\n {{- adapter.dispatch('get_rename_table_sql', 'dbt')(relation, new_name) -}}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__get_rename_table_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "new_name", "type": null, "description": ""}], "created_at": 1786586787.7357762, "supported_languages": null}, "macro.dbt.default__get_rename_table_sql": {"name": "default__get_rename_table_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/table/rename.sql", "original_file_path": "macros/relations/table/rename.sql", "unique_id": "macro.dbt.default__get_rename_table_sql", "macro_sql": "{% macro default__get_rename_table_sql(relation, new_name) %}\n {{ exceptions.raise_compiler_error(\n \"`get_rename_table_sql` has not been implemented for this adapter.\"\n ) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "new_name", "type": null, "description": ""}], "created_at": 1786586787.7360313, "supported_languages": null}, "macro.dbt.get_replace_table_sql": {"name": "get_replace_table_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/table/replace.sql", "original_file_path": "macros/relations/table/replace.sql", "unique_id": "macro.dbt.get_replace_table_sql", "macro_sql": "{% macro get_replace_table_sql(relation, sql) %}\n {{- adapter.dispatch('get_replace_table_sql', 'dbt')(relation, sql) -}}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__get_replace_table_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "sql", "type": null, "description": ""}], "created_at": 1786586787.7364576, "supported_languages": null}, "macro.dbt.default__get_replace_table_sql": {"name": "default__get_replace_table_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/table/replace.sql", "original_file_path": "macros/relations/table/replace.sql", "unique_id": "macro.dbt.default__get_replace_table_sql", "macro_sql": "{% macro default__get_replace_table_sql(relation, sql) %}\n {{ exceptions.raise_compiler_error(\n \"`get_replace_table_sql` has not been implemented for this adapter.\"\n ) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "sql", "type": null, "description": ""}], "created_at": 1786586787.736696, "supported_languages": null}, "macro.dbt.get_create_table_as_sql": {"name": "get_create_table_as_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/table/create.sql", "original_file_path": "macros/relations/table/create.sql", "unique_id": "macro.dbt.get_create_table_as_sql", "macro_sql": "{% macro get_create_table_as_sql(temporary, relation, sql) -%}\n {{ adapter.dispatch('get_create_table_as_sql', 'dbt')(temporary, relation, sql) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_create_table_as_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "temporary", "type": null, "description": ""}, {"name": "relation", "type": null, "description": ""}, {"name": "sql", "type": null, "description": ""}], "created_at": 1786586787.7377334, "supported_languages": null}, "macro.dbt.default__get_create_table_as_sql": {"name": "default__get_create_table_as_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/table/create.sql", "original_file_path": "macros/relations/table/create.sql", "unique_id": "macro.dbt.default__get_create_table_as_sql", "macro_sql": "{% macro default__get_create_table_as_sql(temporary, relation, sql) -%}\n {{ return(create_table_as(temporary, relation, sql)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.create_table_as"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "temporary", "type": null, "description": ""}, {"name": "relation", "type": null, "description": ""}, {"name": "sql", "type": null, "description": ""}], "created_at": 1786586787.7380629, "supported_languages": null}, "macro.dbt.create_table_as": {"name": "create_table_as", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/table/create.sql", "original_file_path": "macros/relations/table/create.sql", "unique_id": "macro.dbt.create_table_as", "macro_sql": "{% macro create_table_as(temporary, relation, compiled_code, language='sql') -%}\n {# backward compatibility for create_table_as that does not support language #}\n {% if language == \"sql\" %}\n {{ adapter.dispatch('create_table_as', 'dbt')(temporary, relation, compiled_code)}}\n {% else %}\n {{ adapter.dispatch('create_table_as', 'dbt')(temporary, relation, compiled_code, language) }}\n {% endif %}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__create_table_as"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "temporary", "type": null, "description": ""}, {"name": "relation", "type": null, "description": ""}, {"name": "compiled_code", "type": null, "description": ""}, {"name": "language", "type": null, "description": ""}], "created_at": 1786586787.738767, "supported_languages": null}, "macro.dbt.default__create_table_as": {"name": "default__create_table_as", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/table/create.sql", "original_file_path": "macros/relations/table/create.sql", "unique_id": "macro.dbt.default__create_table_as", "macro_sql": "{% macro default__create_table_as(temporary, relation, sql) -%}\n {%- set sql_header = config.get('sql_header', none) -%}\n\n {{ sql_header if sql_header is not none }}\n\n create {% if temporary: -%}temporary{%- endif %} table\n {{ relation.include(database=(not temporary), schema=(not temporary)) }}\n {% set contract_config = config.get('contract') %}\n {% if contract_config.enforced and (not temporary) %}\n {{ get_assert_columns_equivalent(sql) }}\n {{ get_table_columns_and_constraints() }}\n {%- set sql = get_select_subquery(sql) %}\n {% endif %}\n as (\n {{ sql }}\n );\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.get_assert_columns_equivalent", "macro.dbt.get_table_columns_and_constraints", "macro.dbt.get_select_subquery"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "temporary", "type": null, "description": ""}, {"name": "relation", "type": null, "description": ""}, {"name": "sql", "type": null, "description": ""}], "created_at": 1786586787.739905, "supported_languages": null}, "macro.dbt.default__get_column_names": {"name": "default__get_column_names", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/table/create.sql", "original_file_path": "macros/relations/table/create.sql", "unique_id": "macro.dbt.default__get_column_names", "macro_sql": "{% macro default__get_column_names() %}\n {#- loop through user_provided_columns to get column names -#}\n {%- set user_provided_columns = model['columns'] -%}\n {%- for i in user_provided_columns %}\n {%- set col = user_provided_columns[i] -%}\n {%- set col_name = adapter.quote(col['name']) if col.get('quote') else col['name'] -%}\n {{ col_name }}{{ \", \" if not loop.last }}\n {%- endfor -%}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1786586787.7406619, "supported_languages": null}, "macro.dbt.get_select_subquery": {"name": "get_select_subquery", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/table/create.sql", "original_file_path": "macros/relations/table/create.sql", "unique_id": "macro.dbt.get_select_subquery", "macro_sql": "{% macro get_select_subquery(sql) %}\n {{ return(adapter.dispatch('get_select_subquery', 'dbt')(sql)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_select_subquery"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "sql", "type": null, "description": ""}], "created_at": 1786586787.7409806, "supported_languages": null}, "macro.dbt.default__get_select_subquery": {"name": "default__get_select_subquery", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/table/create.sql", "original_file_path": "macros/relations/table/create.sql", "unique_id": "macro.dbt.default__get_select_subquery", "macro_sql": "{% macro default__get_select_subquery(sql) %}\n select {{ adapter.dispatch('get_column_names', 'dbt')() }}\n from (\n {{ sql }}\n ) as model_subq\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_column_names"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "sql", "type": null, "description": ""}], "created_at": 1786586787.7412727, "supported_languages": null}, "macro.dbt.drop_table": {"name": "drop_table", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/table/drop.sql", "original_file_path": "macros/relations/table/drop.sql", "unique_id": "macro.dbt.drop_table", "macro_sql": "{% macro drop_table(relation) -%}\n {{- adapter.dispatch('drop_table', 'dbt')(relation) -}}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__drop_table"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1786586787.7416828, "supported_languages": null}, "macro.dbt.default__drop_table": {"name": "default__drop_table", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/table/drop.sql", "original_file_path": "macros/relations/table/drop.sql", "unique_id": "macro.dbt.default__drop_table", "macro_sql": "{% macro default__drop_table(relation) -%}\n drop table if exists {{ relation.render() }} cascade\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1786586787.741882, "supported_languages": null}, "macro.dbt.get_table_columns_and_constraints": {"name": "get_table_columns_and_constraints", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/column/columns_spec_ddl.sql", "original_file_path": "macros/relations/column/columns_spec_ddl.sql", "unique_id": "macro.dbt.get_table_columns_and_constraints", "macro_sql": "{%- macro get_table_columns_and_constraints() -%}\n {{ adapter.dispatch('get_table_columns_and_constraints', 'dbt')() }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt.default__get_table_columns_and_constraints"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1786586787.7431538, "supported_languages": null}, "macro.dbt.default__get_table_columns_and_constraints": {"name": "default__get_table_columns_and_constraints", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/column/columns_spec_ddl.sql", "original_file_path": "macros/relations/column/columns_spec_ddl.sql", "unique_id": "macro.dbt.default__get_table_columns_and_constraints", "macro_sql": "{% macro default__get_table_columns_and_constraints() -%}\n {{ return(table_columns_and_constraints()) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.table_columns_and_constraints"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1786586787.7437358, "supported_languages": null}, "macro.dbt.table_columns_and_constraints": {"name": "table_columns_and_constraints", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/column/columns_spec_ddl.sql", "original_file_path": "macros/relations/column/columns_spec_ddl.sql", "unique_id": "macro.dbt.table_columns_and_constraints", "macro_sql": "{% macro table_columns_and_constraints() %}\n {# loop through user_provided_columns to create DDL with data types and constraints #}\n {%- set raw_column_constraints = adapter.render_raw_columns_constraints(raw_columns=model['columns']) -%}\n {%- set raw_model_constraints = adapter.render_raw_model_constraints(raw_constraints=model['constraints']) -%}\n (\n {% for c in raw_column_constraints -%}\n {{ c }}{{ \",\" if not loop.last or raw_model_constraints }}\n {% endfor %}\n {% for c in raw_model_constraints -%}\n {{ c }}{{ \",\" if not loop.last }}\n {% endfor -%}\n )\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1786586787.744622, "supported_languages": null}, "macro.dbt.get_assert_columns_equivalent": {"name": "get_assert_columns_equivalent", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/column/columns_spec_ddl.sql", "original_file_path": "macros/relations/column/columns_spec_ddl.sql", "unique_id": "macro.dbt.get_assert_columns_equivalent", "macro_sql": "\n\n{%- macro get_assert_columns_equivalent(sql) -%}\n {{ adapter.dispatch('get_assert_columns_equivalent', 'dbt')(sql) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt.default__get_assert_columns_equivalent"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "sql", "type": null, "description": ""}], "created_at": 1786586787.7449164, "supported_languages": null}, "macro.dbt.default__get_assert_columns_equivalent": {"name": "default__get_assert_columns_equivalent", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/column/columns_spec_ddl.sql", "original_file_path": "macros/relations/column/columns_spec_ddl.sql", "unique_id": "macro.dbt.default__get_assert_columns_equivalent", "macro_sql": "{% macro default__get_assert_columns_equivalent(sql) -%}\n {{ return(assert_columns_equivalent(sql)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.assert_columns_equivalent"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "sql", "type": null, "description": ""}], "created_at": 1786586787.7451465, "supported_languages": null}, "macro.dbt.assert_columns_equivalent": {"name": "assert_columns_equivalent", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/column/columns_spec_ddl.sql", "original_file_path": "macros/relations/column/columns_spec_ddl.sql", "unique_id": "macro.dbt.assert_columns_equivalent", "macro_sql": "{% macro assert_columns_equivalent(sql) %}\n\n {#-- First ensure the user has defined 'columns' in yaml specification --#}\n {%- set user_defined_columns = model['columns'] -%}\n {%- if not user_defined_columns -%}\n {{ exceptions.raise_contract_error([], []) }}\n {%- endif -%}\n\n {#-- Obtain the column schema provided by sql file. #}\n {%- set sql_file_provided_columns = get_column_schema_from_query(sql, config.get('sql_header', none)) -%}\n {#--Obtain the column schema provided by the schema file by generating an 'empty schema' query from the model's columns. #}\n {%- set schema_file_provided_columns = get_column_schema_from_query(get_empty_schema_sql(user_defined_columns)) -%}\n\n {#-- create dictionaries with name and formatted data type and strings for exception #}\n {%- set sql_columns = format_columns(sql_file_provided_columns) -%}\n {%- set yaml_columns = format_columns(schema_file_provided_columns) -%}\n\n {%- if sql_columns|length != yaml_columns|length -%}\n {%- do exceptions.raise_contract_error(yaml_columns, sql_columns) -%}\n {%- endif -%}\n\n {%- for sql_col in sql_columns -%}\n {%- set yaml_col = [] -%}\n {%- for this_col in yaml_columns -%}\n {%- if this_col['name'] == sql_col['name'] -%}\n {%- do yaml_col.append(this_col) -%}\n {%- break -%}\n {%- endif -%}\n {%- endfor -%}\n {%- if not yaml_col -%}\n {#-- Column with name not found in yaml #}\n {%- do exceptions.raise_contract_error(yaml_columns, sql_columns) -%}\n {%- endif -%}\n {%- if sql_col['formatted'] != yaml_col[0]['formatted'] -%}\n {#-- Column data types don't match #}\n {%- do exceptions.raise_contract_error(yaml_columns, sql_columns) -%}\n {%- endif -%}\n {%- endfor -%}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_column_schema_from_query", "macro.dbt.get_empty_schema_sql", "macro.dbt.format_columns"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "sql", "type": null, "description": ""}], "created_at": 1786586787.747209, "supported_languages": null}, "macro.dbt.format_columns": {"name": "format_columns", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/column/columns_spec_ddl.sql", "original_file_path": "macros/relations/column/columns_spec_ddl.sql", "unique_id": "macro.dbt.format_columns", "macro_sql": "{% macro format_columns(columns) %}\n {% set formatted_columns = [] %}\n {% for column in columns %}\n {%- set formatted_column = adapter.dispatch('format_column', 'dbt')(column) -%}\n {%- do formatted_columns.append(formatted_column) -%}\n {% endfor %}\n {{ return(formatted_columns) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__format_column"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "columns", "type": null, "description": ""}], "created_at": 1786586787.747836, "supported_languages": null}, "macro.dbt.default__format_column": {"name": "default__format_column", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/column/columns_spec_ddl.sql", "original_file_path": "macros/relations/column/columns_spec_ddl.sql", "unique_id": "macro.dbt.default__format_column", "macro_sql": "{% macro default__format_column(column) -%}\n {% set data_type = column.dtype %}\n {% set formatted = column.column.lower() ~ \" \" ~ data_type %}\n {{ return({'name': column.name, 'data_type': data_type, 'formatted': formatted}) }}\n{%- endmacro -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "column", "type": null, "description": ""}], "created_at": 1786586787.7484121, "supported_languages": null}, "macro.dbt.get_rename_view_sql": {"name": "get_rename_view_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/view/rename.sql", "original_file_path": "macros/relations/view/rename.sql", "unique_id": "macro.dbt.get_rename_view_sql", "macro_sql": "{% macro get_rename_view_sql(relation, new_name) %}\n {{- adapter.dispatch('get_rename_view_sql', 'dbt')(relation, new_name) -}}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__get_rename_view_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "new_name", "type": null, "description": ""}], "created_at": 1786586787.7488708, "supported_languages": null}, "macro.dbt.default__get_rename_view_sql": {"name": "default__get_rename_view_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/view/rename.sql", "original_file_path": "macros/relations/view/rename.sql", "unique_id": "macro.dbt.default__get_rename_view_sql", "macro_sql": "{% macro default__get_rename_view_sql(relation, new_name) %}\n {{ exceptions.raise_compiler_error(\n \"`get_rename_view_sql` has not been implemented for this adapter.\"\n ) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "new_name", "type": null, "description": ""}], "created_at": 1786586787.7491283, "supported_languages": null}, "macro.dbt.get_replace_view_sql": {"name": "get_replace_view_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/view/replace.sql", "original_file_path": "macros/relations/view/replace.sql", "unique_id": "macro.dbt.get_replace_view_sql", "macro_sql": "{% macro get_replace_view_sql(relation, sql) %}\n {{- adapter.dispatch('get_replace_view_sql', 'dbt')(relation, sql) -}}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__get_replace_view_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "sql", "type": null, "description": ""}], "created_at": 1786586787.7499945, "supported_languages": null}, "macro.dbt.default__get_replace_view_sql": {"name": "default__get_replace_view_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/view/replace.sql", "original_file_path": "macros/relations/view/replace.sql", "unique_id": "macro.dbt.default__get_replace_view_sql", "macro_sql": "{% macro default__get_replace_view_sql(relation, sql) %}\n {{ exceptions.raise_compiler_error(\n \"`get_replace_view_sql` has not been implemented for this adapter.\"\n ) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "sql", "type": null, "description": ""}], "created_at": 1786586787.7502453, "supported_languages": null}, "macro.dbt.create_or_replace_view": {"name": "create_or_replace_view", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/view/replace.sql", "original_file_path": "macros/relations/view/replace.sql", "unique_id": "macro.dbt.create_or_replace_view", "macro_sql": "{% macro create_or_replace_view() %}\n {%- set identifier = model['alias'] -%}\n\n {%- set old_relation = adapter.get_relation(database=database, schema=schema, identifier=identifier) -%}\n {%- set exists_as_view = (old_relation is not none and old_relation.is_view) -%}\n\n {%- set target_relation = api.Relation.create(\n identifier=identifier, schema=schema, database=database,\n type='view') -%}\n {% set grant_config = config.get('grants') %}\n\n {{ run_hooks(pre_hooks) }}\n\n -- If there's a table with the same name and we weren't told to full refresh,\n -- that's an error. If we were told to full refresh, drop it. This behavior differs\n -- for Snowflake and BigQuery, so multiple dispatch is used.\n {%- if old_relation is not none and old_relation.is_table -%}\n {{ handle_existing_table(should_full_refresh(), old_relation) }}\n {%- endif -%}\n\n -- build model\n {% call statement('main') -%}\n {{ get_create_view_as_sql(target_relation, sql) }}\n {%- endcall %}\n\n {% set should_revoke = should_revoke(exists_as_view, full_refresh_mode=True) %}\n {% do apply_grants(target_relation, grant_config, should_revoke=should_revoke) %}\n\n {{ run_hooks(post_hooks) }}\n\n {{ return({'relations': [target_relation]}) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.run_hooks", "macro.dbt.handle_existing_table", "macro.dbt.should_full_refresh", "macro.dbt.statement", "macro.dbt.get_create_view_as_sql", "macro.dbt.should_revoke", "macro.dbt.apply_grants"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1786586787.7520423, "supported_languages": null}, "macro.dbt.handle_existing_table": {"name": "handle_existing_table", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/view/replace.sql", "original_file_path": "macros/relations/view/replace.sql", "unique_id": "macro.dbt.handle_existing_table", "macro_sql": "{% macro handle_existing_table(full_refresh, old_relation) %}\n {{ adapter.dispatch('handle_existing_table', 'dbt')(full_refresh, old_relation) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__handle_existing_table"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "full_refresh", "type": null, "description": ""}, {"name": "old_relation", "type": null, "description": ""}], "created_at": 1786586787.8075016, "supported_languages": null}, "macro.dbt.default__handle_existing_table": {"name": "default__handle_existing_table", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/view/replace.sql", "original_file_path": "macros/relations/view/replace.sql", "unique_id": "macro.dbt.default__handle_existing_table", "macro_sql": "{% macro default__handle_existing_table(full_refresh, old_relation) %}\n {{ log(\"Dropping relation \" ~ old_relation.render() ~ \" because it is of type \" ~ old_relation.type) }}\n {{ adapter.drop_relation(old_relation) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "full_refresh", "type": null, "description": ""}, {"name": "old_relation", "type": null, "description": ""}], "created_at": 1786586787.8080404, "supported_languages": null}, "macro.dbt.get_create_view_as_sql": {"name": "get_create_view_as_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/view/create.sql", "original_file_path": "macros/relations/view/create.sql", "unique_id": "macro.dbt.get_create_view_as_sql", "macro_sql": "{% macro get_create_view_as_sql(relation, sql) -%}\n {{ adapter.dispatch('get_create_view_as_sql', 'dbt')(relation, sql) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_create_view_as_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "sql", "type": null, "description": ""}], "created_at": 1786586787.8087392, "supported_languages": null}, "macro.dbt.default__get_create_view_as_sql": {"name": "default__get_create_view_as_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/view/create.sql", "original_file_path": "macros/relations/view/create.sql", "unique_id": "macro.dbt.default__get_create_view_as_sql", "macro_sql": "{% macro default__get_create_view_as_sql(relation, sql) -%}\n {{ return(create_view_as(relation, sql)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.create_view_as"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "sql", "type": null, "description": ""}], "created_at": 1786586787.809052, "supported_languages": null}, "macro.dbt.create_view_as": {"name": "create_view_as", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/view/create.sql", "original_file_path": "macros/relations/view/create.sql", "unique_id": "macro.dbt.create_view_as", "macro_sql": "{% macro create_view_as(relation, sql) -%}\n {{ adapter.dispatch('create_view_as', 'dbt')(relation, sql) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__create_view_as"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "sql", "type": null, "description": ""}], "created_at": 1786586787.8093717, "supported_languages": null}, "macro.dbt.default__create_view_as": {"name": "default__create_view_as", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/view/create.sql", "original_file_path": "macros/relations/view/create.sql", "unique_id": "macro.dbt.default__create_view_as", "macro_sql": "{% macro default__create_view_as(relation, sql) -%}\n {%- set sql_header = config.get('sql_header', none) -%}\n\n {{ sql_header if sql_header is not none }}\n create view {{ relation.render() }}\n {% set contract_config = config.get('contract') %}\n {% if contract_config.enforced %}\n {{ get_assert_columns_equivalent(sql) }}\n {%- endif %}\n as (\n {{ sql }}\n );\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.get_assert_columns_equivalent"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "sql", "type": null, "description": ""}], "created_at": 1786586787.8101187, "supported_languages": null}, "macro.dbt.drop_view": {"name": "drop_view", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/view/drop.sql", "original_file_path": "macros/relations/view/drop.sql", "unique_id": "macro.dbt.drop_view", "macro_sql": "{% macro drop_view(relation) -%}\n {{- adapter.dispatch('drop_view', 'dbt')(relation) -}}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__drop_view"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1786586787.8105605, "supported_languages": null}, "macro.dbt.default__drop_view": {"name": "default__drop_view", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/view/drop.sql", "original_file_path": "macros/relations/view/drop.sql", "unique_id": "macro.dbt.default__drop_view", "macro_sql": "{% macro default__drop_view(relation) -%}\n drop view if exists {{ relation.render() }} cascade\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1786586787.810774, "supported_languages": null}, "macro.dbt.refresh_materialized_view": {"name": "refresh_materialized_view", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/materialized_view/refresh.sql", "original_file_path": "macros/relations/materialized_view/refresh.sql", "unique_id": "macro.dbt.refresh_materialized_view", "macro_sql": "{% macro refresh_materialized_view(relation) %}\n {{- log('Applying REFRESH to: ' ~ relation) -}}\n {{- adapter.dispatch('refresh_materialized_view', 'dbt')(relation) -}}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__refresh_materialized_view"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1786586787.8112931, "supported_languages": null}, "macro.dbt.default__refresh_materialized_view": {"name": "default__refresh_materialized_view", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/materialized_view/refresh.sql", "original_file_path": "macros/relations/materialized_view/refresh.sql", "unique_id": "macro.dbt.default__refresh_materialized_view", "macro_sql": "{% macro default__refresh_materialized_view(relation) %}\n {{ exceptions.raise_compiler_error(\"`refresh_materialized_view` has not been implemented for this adapter.\") }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1786586787.81152, "supported_languages": null}, "macro.dbt.get_rename_materialized_view_sql": {"name": "get_rename_materialized_view_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/materialized_view/rename.sql", "original_file_path": "macros/relations/materialized_view/rename.sql", "unique_id": "macro.dbt.get_rename_materialized_view_sql", "macro_sql": "{% macro get_rename_materialized_view_sql(relation, new_name) %}\n {{- adapter.dispatch('get_rename_materialized_view_sql', 'dbt')(relation, new_name) -}}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__get_rename_materialized_view_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "new_name", "type": null, "description": ""}], "created_at": 1786586787.811974, "supported_languages": null}, "macro.dbt.default__get_rename_materialized_view_sql": {"name": "default__get_rename_materialized_view_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/materialized_view/rename.sql", "original_file_path": "macros/relations/materialized_view/rename.sql", "unique_id": "macro.dbt.default__get_rename_materialized_view_sql", "macro_sql": "{% macro default__get_rename_materialized_view_sql(relation, new_name) %}\n {{ exceptions.raise_compiler_error(\n \"`get_rename_materialized_view_sql` has not been implemented for this adapter.\"\n ) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "new_name", "type": null, "description": ""}], "created_at": 1786586787.8122308, "supported_languages": null}, "macro.dbt.get_alter_materialized_view_as_sql": {"name": "get_alter_materialized_view_as_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/materialized_view/alter.sql", "original_file_path": "macros/relations/materialized_view/alter.sql", "unique_id": "macro.dbt.get_alter_materialized_view_as_sql", "macro_sql": "{% macro get_alter_materialized_view_as_sql(\n relation,\n configuration_changes,\n sql,\n existing_relation,\n backup_relation,\n intermediate_relation\n) %}\n {{- log('Applying ALTER to: ' ~ relation) -}}\n {{- adapter.dispatch('get_alter_materialized_view_as_sql', 'dbt')(\n relation,\n configuration_changes,\n sql,\n existing_relation,\n backup_relation,\n intermediate_relation\n ) -}}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__get_alter_materialized_view_as_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "configuration_changes", "type": null, "description": ""}, {"name": "sql", "type": null, "description": ""}, {"name": "existing_relation", "type": null, "description": ""}, {"name": "backup_relation", "type": null, "description": ""}, {"name": "intermediate_relation", "type": null, "description": ""}], "created_at": 1786586787.8131256, "supported_languages": null}, "macro.dbt.default__get_alter_materialized_view_as_sql": {"name": "default__get_alter_materialized_view_as_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/materialized_view/alter.sql", "original_file_path": "macros/relations/materialized_view/alter.sql", "unique_id": "macro.dbt.default__get_alter_materialized_view_as_sql", "macro_sql": "{% macro default__get_alter_materialized_view_as_sql(\n relation,\n configuration_changes,\n sql,\n existing_relation,\n backup_relation,\n intermediate_relation\n) %}\n {{ exceptions.raise_compiler_error(\"Materialized views have not been implemented for this adapter.\") }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "configuration_changes", "type": null, "description": ""}, {"name": "sql", "type": null, "description": ""}, {"name": "existing_relation", "type": null, "description": ""}, {"name": "backup_relation", "type": null, "description": ""}, {"name": "intermediate_relation", "type": null, "description": ""}], "created_at": 1786586787.8134592, "supported_languages": null}, "macro.dbt.get_materialized_view_configuration_changes": {"name": "get_materialized_view_configuration_changes", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/materialized_view/alter.sql", "original_file_path": "macros/relations/materialized_view/alter.sql", "unique_id": "macro.dbt.get_materialized_view_configuration_changes", "macro_sql": "{% macro get_materialized_view_configuration_changes(existing_relation, new_config) %}\n /* {#\n It's recommended that configuration changes be formatted as follows:\n {\"\": [{\"action\": \"\", \"context\": ...}]}\n\n For example:\n {\n \"indexes\": [\n {\"action\": \"drop\", \"context\": \"index_abc\"},\n {\"action\": \"create\", \"context\": {\"columns\": [\"column_1\", \"column_2\"], \"type\": \"hash\", \"unique\": True}},\n ],\n }\n\n Either way, `get_materialized_view_configuration_changes` needs to align with `get_alter_materialized_view_as_sql`.\n #} */\n {{- log('Determining configuration changes on: ' ~ existing_relation) -}}\n {%- do return(adapter.dispatch('get_materialized_view_configuration_changes', 'dbt')(existing_relation, new_config)) -%}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__get_materialized_view_configuration_changes"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "existing_relation", "type": null, "description": ""}, {"name": "new_config", "type": null, "description": ""}], "created_at": 1786586787.814065, "supported_languages": null}, "macro.dbt.default__get_materialized_view_configuration_changes": {"name": "default__get_materialized_view_configuration_changes", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/materialized_view/alter.sql", "original_file_path": "macros/relations/materialized_view/alter.sql", "unique_id": "macro.dbt.default__get_materialized_view_configuration_changes", "macro_sql": "{% macro default__get_materialized_view_configuration_changes(existing_relation, new_config) %}\n {{ exceptions.raise_compiler_error(\"Materialized views have not been implemented for this adapter.\") }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "existing_relation", "type": null, "description": ""}, {"name": "new_config", "type": null, "description": ""}], "created_at": 1786586787.8143313, "supported_languages": null}, "macro.dbt.get_replace_materialized_view_sql": {"name": "get_replace_materialized_view_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/materialized_view/replace.sql", "original_file_path": "macros/relations/materialized_view/replace.sql", "unique_id": "macro.dbt.get_replace_materialized_view_sql", "macro_sql": "{% macro get_replace_materialized_view_sql(relation, sql) %}\n {{- adapter.dispatch('get_replace_materialized_view_sql', 'dbt')(relation, sql) -}}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_replace_materialized_view_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "sql", "type": null, "description": ""}], "created_at": 1786586787.8147852, "supported_languages": null}, "macro.dbt.default__get_replace_materialized_view_sql": {"name": "default__get_replace_materialized_view_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/materialized_view/replace.sql", "original_file_path": "macros/relations/materialized_view/replace.sql", "unique_id": "macro.dbt.default__get_replace_materialized_view_sql", "macro_sql": "{% macro default__get_replace_materialized_view_sql(relation, sql) %}\n {{ exceptions.raise_compiler_error(\n \"`get_replace_materialized_view_sql` has not been implemented for this adapter.\"\n ) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "sql", "type": null, "description": ""}], "created_at": 1786586787.8150492, "supported_languages": null}, "macro.dbt.get_create_materialized_view_as_sql": {"name": "get_create_materialized_view_as_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/materialized_view/create.sql", "original_file_path": "macros/relations/materialized_view/create.sql", "unique_id": "macro.dbt.get_create_materialized_view_as_sql", "macro_sql": "{% macro get_create_materialized_view_as_sql(relation, sql) -%}\n {{- adapter.dispatch('get_create_materialized_view_as_sql', 'dbt')(relation, sql) -}}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__get_create_materialized_view_as_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "sql", "type": null, "description": ""}], "created_at": 1786586787.8154848, "supported_languages": null}, "macro.dbt.default__get_create_materialized_view_as_sql": {"name": "default__get_create_materialized_view_as_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/materialized_view/create.sql", "original_file_path": "macros/relations/materialized_view/create.sql", "unique_id": "macro.dbt.default__get_create_materialized_view_as_sql", "macro_sql": "{% macro default__get_create_materialized_view_as_sql(relation, sql) -%}\n {{ exceptions.raise_compiler_error(\n \"`get_create_materialized_view_as_sql` has not been implemented for this adapter.\"\n ) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "sql", "type": null, "description": ""}], "created_at": 1786586787.815726, "supported_languages": null}, "macro.dbt.drop_materialized_view": {"name": "drop_materialized_view", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/materialized_view/drop.sql", "original_file_path": "macros/relations/materialized_view/drop.sql", "unique_id": "macro.dbt.drop_materialized_view", "macro_sql": "{% macro drop_materialized_view(relation) -%}\n {{- adapter.dispatch('drop_materialized_view', 'dbt')(relation) -}}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__drop_materialized_view"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1786586787.8161623, "supported_languages": null}, "macro.dbt.default__drop_materialized_view": {"name": "default__drop_materialized_view", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/materialized_view/drop.sql", "original_file_path": "macros/relations/materialized_view/drop.sql", "unique_id": "macro.dbt.default__drop_materialized_view", "macro_sql": "{% macro default__drop_materialized_view(relation) -%}\n drop materialized view if exists {{ relation.render() }} cascade\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1786586787.8163772, "supported_languages": null}, "macro.dbt.statement": {"name": "statement", "resource_type": "macro", "package_name": "dbt", "path": "macros/etc/statement.sql", "original_file_path": "macros/etc/statement.sql", "unique_id": "macro.dbt.statement", "macro_sql": "\n{%- macro statement(name=None, fetch_result=False, auto_begin=True, language='sql') -%}\n {%- if execute: -%}\n {%- set compiled_code = caller() -%}\n\n {%- if name == 'main' -%}\n {{ log('Writing runtime {} for node \"{}\"'.format(language, model['unique_id'])) }}\n {{ write(compiled_code) }}\n {%- endif -%}\n {%- if language == 'sql'-%}\n {%- set res, table = adapter.execute(compiled_code, auto_begin=auto_begin, fetch=fetch_result) -%}\n {%- elif language == 'python' -%}\n {%- set res = submit_python_job(model, compiled_code) -%}\n {#-- TODO: What should table be for python models? --#}\n {%- set table = None -%}\n {%- else -%}\n {% do exceptions.raise_compiler_error(\"statement macro didn't get supported language\") %}\n {%- endif -%}\n\n {%- if name is not none -%}\n {{ store_result(name, response=res, agate_table=table) }}\n {%- endif -%}\n\n {%- endif -%}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "name", "type": null, "description": ""}, {"name": "fetch_result", "type": null, "description": ""}, {"name": "auto_begin", "type": null, "description": ""}, {"name": "language", "type": null, "description": ""}], "created_at": 1786586787.8185492, "supported_languages": null}, "macro.dbt.noop_statement": {"name": "noop_statement", "resource_type": "macro", "package_name": "dbt", "path": "macros/etc/statement.sql", "original_file_path": "macros/etc/statement.sql", "unique_id": "macro.dbt.noop_statement", "macro_sql": "{% macro noop_statement(name=None, message=None, code=None, rows_affected=None, res=None) -%}\n {%- set sql = caller() -%}\n\n {%- if name == 'main' -%}\n {{ log('Writing runtime SQL for node \"{}\"'.format(model['unique_id'])) }}\n {{ write(sql) }}\n {%- endif -%}\n\n {%- if name is not none -%}\n {{ store_raw_result(name, message=message, code=code, rows_affected=rows_affected, agate_table=res) }}\n {%- endif -%}\n\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "name", "type": null, "description": ""}, {"name": "message", "type": null, "description": ""}, {"name": "code", "type": null, "description": ""}, {"name": "rows_affected", "type": null, "description": ""}, {"name": "res", "type": null, "description": ""}], "created_at": 1786586787.819518, "supported_languages": null}, "macro.dbt.run_query": {"name": "run_query", "resource_type": "macro", "package_name": "dbt", "path": "macros/etc/statement.sql", "original_file_path": "macros/etc/statement.sql", "unique_id": "macro.dbt.run_query", "macro_sql": "{% macro run_query(sql) %}\n {% call statement(\"run_query_statement\", fetch_result=true, auto_begin=false) %}\n {{ sql }}\n {% endcall %}\n\n {% do return(load_result(\"run_query_statement\").table) %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "sql", "type": null, "description": ""}], "created_at": 1786586787.8200204, "supported_languages": null}, "macro.dbt.convert_datetime": {"name": "convert_datetime", "resource_type": "macro", "package_name": "dbt", "path": "macros/etc/datetime.sql", "original_file_path": "macros/etc/datetime.sql", "unique_id": "macro.dbt.convert_datetime", "macro_sql": "{% macro convert_datetime(date_str, date_fmt) %}\n\n {% set error_msg -%}\n The provided partition date '{{ date_str }}' does not match the expected format '{{ date_fmt }}'\n {%- endset %}\n\n {% set res = try_or_compiler_error(error_msg, modules.datetime.datetime.strptime, date_str.strip(), date_fmt) %}\n {{ return(res) }}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "date_str", "type": null, "description": ""}, {"name": "date_fmt", "type": null, "description": ""}], "created_at": 1786586787.8212903, "supported_languages": null}, "macro.dbt.dates_in_range": {"name": "dates_in_range", "resource_type": "macro", "package_name": "dbt", "path": "macros/etc/datetime.sql", "original_file_path": "macros/etc/datetime.sql", "unique_id": "macro.dbt.dates_in_range", "macro_sql": "{% macro dates_in_range(start_date_str, end_date_str=none, in_fmt=\"%Y%m%d\", out_fmt=\"%Y%m%d\") %}\n {% set end_date_str = start_date_str if end_date_str is none else end_date_str %}\n\n {% set start_date = convert_datetime(start_date_str, in_fmt) %}\n {% set end_date = convert_datetime(end_date_str, in_fmt) %}\n\n {% set day_count = (end_date - start_date).days %}\n {% if day_count < 0 %}\n {% set msg -%}\n Partition start date is after the end date ({{ start_date }}, {{ end_date }})\n {%- endset %}\n\n {{ exceptions.raise_compiler_error(msg, model) }}\n {% endif %}\n\n {% set date_list = [] %}\n {% for i in range(0, day_count + 1) %}\n {% set the_date = (modules.datetime.timedelta(days=i) + start_date) %}\n {% if not out_fmt %}\n {% set _ = date_list.append(the_date) %}\n {% else %}\n {% set _ = date_list.append(the_date.strftime(out_fmt)) %}\n {% endif %}\n {% endfor %}\n\n {{ return(date_list) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.convert_datetime"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "start_date_str", "type": null, "description": ""}, {"name": "end_date_str", "type": null, "description": ""}, {"name": "in_fmt", "type": null, "description": ""}, {"name": "out_fmt", "type": null, "description": ""}], "created_at": 1786586787.8233445, "supported_languages": null}, "macro.dbt.partition_range": {"name": "partition_range", "resource_type": "macro", "package_name": "dbt", "path": "macros/etc/datetime.sql", "original_file_path": "macros/etc/datetime.sql", "unique_id": "macro.dbt.partition_range", "macro_sql": "{% macro partition_range(raw_partition_date, date_fmt='%Y%m%d') %}\n {% set partition_range = (raw_partition_date | string).split(\",\") %}\n\n {% if (partition_range | length) == 1 %}\n {% set start_date = partition_range[0] %}\n {% set end_date = none %}\n {% elif (partition_range | length) == 2 %}\n {% set start_date = partition_range[0] %}\n {% set end_date = partition_range[1] %}\n {% else %}\n {{ exceptions.raise_compiler_error(\"Invalid partition time. Expected format: {Start Date}[,{End Date}]. Got: \" ~ raw_partition_date) }}\n {% endif %}\n\n {{ return(dates_in_range(start_date, end_date, in_fmt=date_fmt)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.dates_in_range"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "raw_partition_date", "type": null, "description": ""}, {"name": "date_fmt", "type": null, "description": ""}], "created_at": 1786586787.8245814, "supported_languages": null}, "macro.dbt.py_current_timestring": {"name": "py_current_timestring", "resource_type": "macro", "package_name": "dbt", "path": "macros/etc/datetime.sql", "original_file_path": "macros/etc/datetime.sql", "unique_id": "macro.dbt.py_current_timestring", "macro_sql": "{% macro py_current_timestring() %}\n {% set dt = modules.datetime.datetime.now() %}\n {% do return(dt.strftime(\"%Y%m%d%H%M%S%f\")) %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1786586787.8249907, "supported_languages": null}, "macro.dbt.default__test_not_null": {"name": "default__test_not_null", "resource_type": "macro", "package_name": "dbt", "path": "macros/generic_test_sql/not_null.sql", "original_file_path": "macros/generic_test_sql/not_null.sql", "unique_id": "macro.dbt.default__test_not_null", "macro_sql": "{% macro default__test_not_null(model, column_name) %}\n\n{% set column_list = '*' if should_store_failures() else column_name %}\n\nselect {{ column_list }}\nfrom {{ model }}\nwhere {{ column_name }} is null\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.should_store_failures"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "column_name", "type": null, "description": ""}], "created_at": 1786586787.8255496, "supported_languages": null}, "macro.dbt.default__test_unique": {"name": "default__test_unique", "resource_type": "macro", "package_name": "dbt", "path": "macros/generic_test_sql/unique.sql", "original_file_path": "macros/generic_test_sql/unique.sql", "unique_id": "macro.dbt.default__test_unique", "macro_sql": "{% macro default__test_unique(model, column_name) %}\n\nselect\n {{ column_name }} as unique_field,\n count(*) as n_records\n\nfrom {{ model }}\nwhere {{ column_name }} is not null\ngroup by {{ column_name }}\nhaving count(*) > 1\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "column_name", "type": null, "description": ""}], "created_at": 1786586787.825972, "supported_languages": null}, "macro.dbt.default__test_accepted_values": {"name": "default__test_accepted_values", "resource_type": "macro", "package_name": "dbt", "path": "macros/generic_test_sql/accepted_values.sql", "original_file_path": "macros/generic_test_sql/accepted_values.sql", "unique_id": "macro.dbt.default__test_accepted_values", "macro_sql": "{% macro default__test_accepted_values(model, column_name, values, quote=True) %}\n\nwith all_values as (\n\n select\n {{ column_name }} as value_field,\n count(*) as n_records\n\n from {{ model }}\n group by {{ column_name }}\n\n)\n\nselect *\nfrom all_values\nwhere value_field not in (\n {% for value in values -%}\n {% if quote -%}\n '{{ value }}'\n {%- else -%}\n {{ value }}\n {%- endif -%}\n {%- if not loop.last -%},{%- endif %}\n {%- endfor %}\n)\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "column_name", "type": null, "description": ""}, {"name": "values", "type": null, "description": ""}, {"name": "quote", "type": null, "description": ""}], "created_at": 1786586787.8268256, "supported_languages": null}, "macro.dbt.default__test_relationships": {"name": "default__test_relationships", "resource_type": "macro", "package_name": "dbt", "path": "macros/generic_test_sql/relationships.sql", "original_file_path": "macros/generic_test_sql/relationships.sql", "unique_id": "macro.dbt.default__test_relationships", "macro_sql": "{% macro default__test_relationships(model, column_name, to, field) %}\n\nwith child as (\n select {{ column_name }} as from_field\n from {{ model }}\n where {{ column_name }} is not null\n),\n\nparent as (\n select {{ field }} as to_field\n from {{ to }}\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "column_name", "type": null, "description": ""}, {"name": "to", "type": null, "description": ""}, {"name": "field", "type": null, "description": ""}], "created_at": 1786586787.8273344, "supported_languages": null}, "macro.dbt.get_fixture_sql": {"name": "get_fixture_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/unit_test_sql/get_fixture_sql.sql", "original_file_path": "macros/unit_test_sql/get_fixture_sql.sql", "unique_id": "macro.dbt.get_fixture_sql", "macro_sql": "{% macro get_fixture_sql(rows, column_name_to_data_types) %}\n-- Fixture for {{ model.name }}\n{% set default_row = {} %}\n\n{%- if not column_name_to_data_types -%}\n{#-- Use defer_relation IFF it is available in the manifest and 'this' is missing from the database --#}\n{%- set this_or_defer_relation = defer_relation if (defer_relation and not load_relation(this)) else this -%}\n{%- set columns_in_relation = adapter.get_columns_in_relation(this_or_defer_relation) -%}\n\n{%- set column_name_to_data_types = {} -%}\n{%- set column_name_to_quoted = {} -%}\n{%- for column in columns_in_relation -%}\n\n{#-- This needs to be a case-insensitive comparison --#}\n{%- do column_name_to_data_types.update({column.name|lower: column.data_type}) -%}\n{%- do column_name_to_quoted.update({column.name|lower: column.quoted}) -%}\n{%- endfor -%}\n{%- endif -%}\n\n{%- if not column_name_to_data_types -%}\n {{ exceptions.raise_compiler_error(\"Not able to get columns for unit test '\" ~ model.name ~ \"' from relation \" ~ this ~ \" because the relation doesn't exist\") }}\n{%- endif -%}\n\n{%- for column_name, column_type in column_name_to_data_types.items() -%}\n {%- do default_row.update({column_name: (safe_cast(\"null\", column_type) | trim )}) -%}\n{%- endfor -%}\n\n{{ validate_fixture_rows(rows, row_number) }}\n\n{%- for row in rows -%}\n{%- set formatted_row = format_row(row, column_name_to_data_types) -%}\n{%- set default_row_copy = default_row.copy() -%}\n{%- do default_row_copy.update(formatted_row) -%}\nselect\n{%- for column_name, column_value in default_row_copy.items() %} {{ column_value }} as {{ column_name_to_quoted[column_name] }}{% if not loop.last -%}, {%- endif %}\n{%- endfor %}\n{%- if not loop.last %}\nunion all\n{% endif %}\n{%- endfor -%}\n\n{%- if (rows | length) == 0 -%}\n select\n {%- for column_name, column_value in default_row.items() %} {{ column_value }} as {{ column_name_to_quoted[column_name] }}{% if not loop.last -%},{%- endif %}\n {%- endfor %}\n limit 0\n{%- endif -%}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.load_relation", "macro.dbt.safe_cast", "macro.dbt.validate_fixture_rows", "macro.dbt.format_row"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "rows", "type": null, "description": ""}, {"name": "column_name_to_data_types", "type": null, "description": ""}], "created_at": 1786586787.8316975, "supported_languages": null}, "macro.dbt.get_expected_sql": {"name": "get_expected_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/unit_test_sql/get_fixture_sql.sql", "original_file_path": "macros/unit_test_sql/get_fixture_sql.sql", "unique_id": "macro.dbt.get_expected_sql", "macro_sql": "{% macro get_expected_sql(rows, column_name_to_data_types, column_name_to_quoted) %}\n\n{%- if (rows | length) == 0 -%}\n select * from dbt_internal_unit_test_actual\n limit 0\n{%- else -%}\n{%- for row in rows -%}\n{%- set formatted_row = format_row(row, column_name_to_data_types) -%}\nselect\n{%- for column_name, column_value in formatted_row.items() %} {{ column_value }} as {{ column_name_to_quoted[column_name] }}{% if not loop.last -%}, {%- endif %}\n{%- endfor %}\n{%- if not loop.last %}\nunion all\n{% endif %}\n{%- endfor -%}\n{%- endif -%}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.format_row"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "rows", "type": null, "description": ""}, {"name": "column_name_to_data_types", "type": null, "description": ""}, {"name": "column_name_to_quoted", "type": null, "description": ""}], "created_at": 1786586787.8328269, "supported_languages": null}, "macro.dbt.format_row": {"name": "format_row", "resource_type": "macro", "package_name": "dbt", "path": "macros/unit_test_sql/get_fixture_sql.sql", "original_file_path": "macros/unit_test_sql/get_fixture_sql.sql", "unique_id": "macro.dbt.format_row", "macro_sql": "\n\n{%- macro format_row(row, column_name_to_data_types) -%}\n {#-- generate case-insensitive formatted row --#}\n {% set formatted_row = {} %}\n {%- for column_name, column_value in row.items() -%}\n {% set column_name = column_name|lower %}\n\n {%- if column_name not in column_name_to_data_types %}\n {#-- if user-provided row contains column name that relation does not contain, raise an error --#}\n {% set fixture_name = \"expected output\" if model.resource_type == 'unit_test' else (\"'\" ~ model.name ~ \"'\") %}\n {{ exceptions.raise_compiler_error(\n \"Invalid column name: '\" ~ column_name ~ \"' in unit test fixture for \" ~ fixture_name ~ \".\"\n \"\\nAccepted columns for \" ~ fixture_name ~ \" are: \" ~ (column_name_to_data_types.keys()|list)\n ) }}\n {%- endif -%}\n\n {%- set column_type = column_name_to_data_types[column_name] %}\n\n {#-- For string fixture values, strip varchar length to prevent silent truncation (GH-11974) --#}\n {%- if column_value is string and 'varying' in column_type -%}\n {%- set column_type = column_type.split('(')[0] -%}\n {%- endif -%}\n\n {#-- sanitize column_value: wrap yaml strings in quotes, apply cast --#}\n {%- set column_value_clean = column_value -%}\n {%- if column_value is string -%}\n {%- set column_value_clean = dbt.string_literal(dbt.escape_single_quotes(column_value)) -%}\n {%- elif column_value is none -%}\n {%- set column_value_clean = 'null' -%}\n {%- endif -%}\n\n {%- set row_update = {column_name: safe_cast(column_value_clean, column_type) } -%}\n {%- do formatted_row.update(row_update) -%}\n {%- endfor -%}\n {{ return(formatted_row) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt.string_literal", "macro.dbt.escape_single_quotes", "macro.dbt.safe_cast"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "row", "type": null, "description": ""}, {"name": "column_name_to_data_types", "type": null, "description": ""}], "created_at": 1786586787.8349261, "supported_languages": null}, "macro.dbt.validate_fixture_rows": {"name": "validate_fixture_rows", "resource_type": "macro", "package_name": "dbt", "path": "macros/unit_test_sql/get_fixture_sql.sql", "original_file_path": "macros/unit_test_sql/get_fixture_sql.sql", "unique_id": "macro.dbt.validate_fixture_rows", "macro_sql": "{%- macro validate_fixture_rows(rows, row_number) -%}\n {{ return(adapter.dispatch('validate_fixture_rows', 'dbt')(rows, row_number)) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt.default__validate_fixture_rows"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "rows", "type": null, "description": ""}, {"name": "row_number", "type": null, "description": ""}], "created_at": 1786586787.835297, "supported_languages": null}, "macro.dbt.default__validate_fixture_rows": {"name": "default__validate_fixture_rows", "resource_type": "macro", "package_name": "dbt", "path": "macros/unit_test_sql/get_fixture_sql.sql", "original_file_path": "macros/unit_test_sql/get_fixture_sql.sql", "unique_id": "macro.dbt.default__validate_fixture_rows", "macro_sql": "{%- macro default__validate_fixture_rows(rows, row_number) -%}\n {# This is an abstract method for adapter overrides as needed #}\n{%- endmacro -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "rows", "type": null, "description": ""}, {"name": "row_number", "type": null, "description": ""}], "created_at": 1786586787.8355298, "supported_languages": null}, "macro.dbt.resolve_model_name": {"name": "resolve_model_name", "resource_type": "macro", "package_name": "dbt", "path": "macros/python_model/python.sql", "original_file_path": "macros/python_model/python.sql", "unique_id": "macro.dbt.resolve_model_name", "macro_sql": "{% macro resolve_model_name(input_model_name) %}\n {{ return(adapter.dispatch('resolve_model_name', 'dbt')(input_model_name)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__resolve_model_name"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "input_model_name", "type": null, "description": ""}], "created_at": 1786586787.8369644, "supported_languages": null}, "macro.dbt.default__resolve_model_name": {"name": "default__resolve_model_name", "resource_type": "macro", "package_name": "dbt", "path": "macros/python_model/python.sql", "original_file_path": "macros/python_model/python.sql", "unique_id": "macro.dbt.default__resolve_model_name", "macro_sql": "\n\n{%- macro default__resolve_model_name(input_model_name) -%}\n {{ input_model_name | string | replace('\"', '\\\"') }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "input_model_name", "type": null, "description": ""}], "created_at": 1786586787.8372345, "supported_languages": null}, "macro.dbt.build_ref_function": {"name": "build_ref_function", "resource_type": "macro", "package_name": "dbt", "path": "macros/python_model/python.sql", "original_file_path": "macros/python_model/python.sql", "unique_id": "macro.dbt.build_ref_function", "macro_sql": "{% macro build_ref_function(model) %}\n\n {%- set ref_dict = {} -%}\n {%- for _ref in model.refs -%}\n {% set _ref_args = [_ref.get('package'), _ref['name']] if _ref.get('package') else [_ref['name'],] %}\n {%- set resolved = ref(*_ref_args, v=_ref.get('version')) -%}\n\n {#\n We want to get the string of the returned relation by calling .render() in order to skip sample/empty\n mode rendering logic. However, people override the default ref macro, and often return a string instead\n of a relation (like the ref macro does by default). Thus, to make sure we dont blow things up, we have\n to ensure the resolved relation has a .render() method.\n #}\n {%- if resolved.render is defined and resolved.render is callable -%}\n {%- set resolved = resolved.render() -%}\n {%- endif -%}\n\n {%- if _ref.get('version') -%}\n {% do _ref_args.extend([\"v\" ~ _ref['version']]) %}\n {%- endif -%}\n {%- do ref_dict.update({_ref_args | join('.'): resolve_model_name(resolved)}) -%}\n {%- endfor -%}\n\ndef ref(*args, **kwargs):\n refs = {{ ref_dict | tojson }}\n key = '.'.join(args)\n version = kwargs.get(\"v\") or kwargs.get(\"version\")\n if version:\n key += f\".v{version}\"\n dbt_load_df_function = kwargs.get(\"dbt_load_df_function\")\n return dbt_load_df_function(refs[key])\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.resolve_model_name"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}], "created_at": 1786586787.838822, "supported_languages": null}, "macro.dbt.build_source_function": {"name": "build_source_function", "resource_type": "macro", "package_name": "dbt", "path": "macros/python_model/python.sql", "original_file_path": "macros/python_model/python.sql", "unique_id": "macro.dbt.build_source_function", "macro_sql": "{% macro build_source_function(model) %}\n\n {%- set source_dict = {} -%}\n {%- for _source in model.sources -%}\n {%- set resolved = source(*_source) -%}\n {%- do source_dict.update({_source | join('.'): resolve_model_name(resolved)}) -%}\n {%- endfor -%}\n\ndef source(*args, dbt_load_df_function):\n sources = {{ source_dict | tojson }}\n key = '.'.join(args)\n return dbt_load_df_function(sources[key])\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.resolve_model_name"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}], "created_at": 1786586787.8395216, "supported_languages": null}, "macro.dbt.build_config_dict": {"name": "build_config_dict", "resource_type": "macro", "package_name": "dbt", "path": "macros/python_model/python.sql", "original_file_path": "macros/python_model/python.sql", "unique_id": "macro.dbt.build_config_dict", "macro_sql": "{% macro build_config_dict(model) %}\n {%- set config_dict = {} -%}\n {% set config_dbt_used = zip(model.config.config_keys_used, model.config.config_keys_defaults) | list %}\n {%- for key, default in config_dbt_used -%}\n {# weird type testing with enum, would be much easier to write this logic in Python! #}\n {%- if key == \"language\" -%}\n {%- set value = \"python\" -%}\n {%- endif -%}\n {%- set value = model.config.get(key, default) -%}\n {%- do config_dict.update({key: value}) -%}\n {%- endfor -%}\n {# Handle dbt.config.meta_get() calls - use separate dict to avoid overwriting native configs #}\n {%- set meta_dict = {} -%}\n {%- if model.config.meta_keys_used -%}\n {% set meta_dbt_used = zip(model.config.meta_keys_used, model.config.meta_keys_defaults) | list %}\n {%- for key, default in meta_dbt_used -%}\n {%- if model.config.meta and key in model.config.meta -%}\n {%- set value = model.config.meta[key] -%}\n {%- else -%}\n {%- set value = default -%}\n {%- endif -%}\n {%- do meta_dict.update({key: value}) -%}\n {%- endfor -%}\n {%- endif -%}\nconfig_dict = {{ config_dict }}\nmeta_dict = {{ meta_dict }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}], "created_at": 1786586787.8413942, "supported_languages": null}, "macro.dbt.py_script_postfix": {"name": "py_script_postfix", "resource_type": "macro", "package_name": "dbt", "path": "macros/python_model/python.sql", "original_file_path": "macros/python_model/python.sql", "unique_id": "macro.dbt.py_script_postfix", "macro_sql": "{% macro py_script_postfix(model) %}\n# This part is user provided model code\n# you will need to copy the next section to run the code\n# COMMAND ----------\n# this part is dbt logic for get ref work, do not modify\n\n{{ build_ref_function(model ) }}\n{{ build_source_function(model ) }}\n{{ build_config_dict(model) }}\n\nclass config:\n def __init__(self, *args, **kwargs):\n pass\n\n @staticmethod\n def get(key, default=None):\n return config_dict.get(key, default)\n\n @staticmethod\n def meta_get(key, default=None):\n return meta_dict.get(key, default)\n\nclass this:\n \"\"\"dbt.this() or dbt.this.identifier\"\"\"\n database = \"{{ this.database }}\"\n schema = \"{{ this.schema }}\"\n identifier = \"{{ this.identifier }}\"\n {% set this_relation_name = resolve_model_name(this) %}\n def __repr__(self):\n return '{{ this_relation_name }}'\n\n\nclass dbtObj:\n def __init__(self, load_df_function) -> None:\n self.source = lambda *args: source(*args, dbt_load_df_function=load_df_function)\n self.ref = lambda *args, **kwargs: ref(*args, **kwargs, dbt_load_df_function=load_df_function)\n self.config = config\n self.this = this()\n self.is_incremental = {{ is_incremental() }}\n\n# COMMAND ----------\n{{py_script_comment()}}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.build_ref_function", "macro.dbt.build_source_function", "macro.dbt.build_config_dict", "macro.dbt.resolve_model_name", "macro.dbt.is_incremental", "macro.dbt.py_script_comment"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}], "created_at": 1786586787.8422234, "supported_languages": null}, "macro.dbt.py_script_comment": {"name": "py_script_comment", "resource_type": "macro", "package_name": "dbt", "path": "macros/python_model/python.sql", "original_file_path": "macros/python_model/python.sql", "unique_id": "macro.dbt.py_script_comment", "macro_sql": "{%macro py_script_comment()%}\n{%endmacro%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1786586787.8423595, "supported_languages": null}, "macro.dbt.generate_database_name": {"name": "generate_database_name", "resource_type": "macro", "package_name": "dbt", "path": "macros/get_custom_name/get_custom_database.sql", "original_file_path": "macros/get_custom_name/get_custom_database.sql", "unique_id": "macro.dbt.generate_database_name", "macro_sql": "{% macro generate_database_name(custom_database_name=none, node=none) -%}\n {% do return(adapter.dispatch('generate_database_name', 'dbt')(custom_database_name, node)) %}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__generate_database_name"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "custom_database_name", "type": null, "description": ""}, {"name": "node", "type": null, "description": ""}], "created_at": 1786586787.843076, "supported_languages": null}, "macro.dbt.default__generate_database_name": {"name": "default__generate_database_name", "resource_type": "macro", "package_name": "dbt", "path": "macros/get_custom_name/get_custom_database.sql", "original_file_path": "macros/get_custom_name/get_custom_database.sql", "unique_id": "macro.dbt.default__generate_database_name", "macro_sql": "{% macro default__generate_database_name(custom_database_name=none, node=none) -%}\n {%- set default_database = target.database -%}\n {%- if node is not none and node|attr('database') -%}\n {%- set catalog_relation = adapter.build_catalog_relation(node) -%}\n {%- if catalog_relation and catalog_relation|attr('catalog_database') -%}\n {{ return(catalog_relation.catalog_database) }}\n {%- endif -%}\n {%- endif -%}\n {%- if custom_database_name is none -%}\n\n {{ default_database }}\n\n {%- else -%}\n\n {{ custom_database_name }}\n\n {%- endif -%}\n\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "custom_database_name", "type": null, "description": ""}, {"name": "node", "type": null, "description": ""}], "created_at": 1786586787.8439677, "supported_languages": null}, "macro.dbt.generate_latest_version_pointer_alias": {"name": "generate_latest_version_pointer_alias", "resource_type": "macro", "package_name": "dbt", "path": "macros/get_custom_name/get_latest_version_pointer_alias.sql", "original_file_path": "macros/get_custom_name/get_latest_version_pointer_alias.sql", "unique_id": "macro.dbt.generate_latest_version_pointer_alias", "macro_sql": "{% macro generate_latest_version_pointer_alias(custom_alias_name=none, node=none) -%}\n {% do return(adapter.dispatch('generate_latest_version_pointer_alias', 'dbt')(custom_alias_name, node)) %}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__generate_latest_version_pointer_alias"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "custom_alias_name", "type": null, "description": ""}, {"name": "node", "type": null, "description": ""}], "created_at": 1786586787.8445888, "supported_languages": null}, "macro.dbt.default__generate_latest_version_pointer_alias": {"name": "default__generate_latest_version_pointer_alias", "resource_type": "macro", "package_name": "dbt", "path": "macros/get_custom_name/get_latest_version_pointer_alias.sql", "original_file_path": "macros/get_custom_name/get_latest_version_pointer_alias.sql", "unique_id": "macro.dbt.default__generate_latest_version_pointer_alias", "macro_sql": "{% macro default__generate_latest_version_pointer_alias(custom_alias_name=none, node=none) -%}\n {%- if custom_alias_name -%}\n {{ custom_alias_name | trim }}\n {%- else -%}\n {{ node.name }}\n {%- endif -%}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "custom_alias_name", "type": null, "description": ""}, {"name": "node", "type": null, "description": ""}], "created_at": 1786586787.8449724, "supported_languages": null}, "macro.dbt.generate_schema_name": {"name": "generate_schema_name", "resource_type": "macro", "package_name": "dbt", "path": "macros/get_custom_name/get_custom_schema.sql", "original_file_path": "macros/get_custom_name/get_custom_schema.sql", "unique_id": "macro.dbt.generate_schema_name", "macro_sql": "{% macro generate_schema_name(custom_schema_name=none, node=none) -%}\n {{ return(adapter.dispatch('generate_schema_name', 'dbt')(custom_schema_name, node)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__generate_schema_name"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "custom_schema_name", "type": null, "description": ""}, {"name": "node", "type": null, "description": ""}], "created_at": 1786586787.845704, "supported_languages": null}, "macro.dbt.default__generate_schema_name": {"name": "default__generate_schema_name", "resource_type": "macro", "package_name": "dbt", "path": "macros/get_custom_name/get_custom_schema.sql", "original_file_path": "macros/get_custom_name/get_custom_schema.sql", "unique_id": "macro.dbt.default__generate_schema_name", "macro_sql": "{% macro default__generate_schema_name(custom_schema_name, node) -%}\n\n {%- set default_schema = target.schema -%}\n {%- if custom_schema_name is none -%}\n\n {{ default_schema }}\n\n {%- else -%}\n\n {{ default_schema }}_{{ custom_schema_name | trim }}\n\n {%- endif -%}\n\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "custom_schema_name", "type": null, "description": ""}, {"name": "node", "type": null, "description": ""}], "created_at": 1786586787.8461728, "supported_languages": null}, "macro.dbt.generate_schema_name_for_env": {"name": "generate_schema_name_for_env", "resource_type": "macro", "package_name": "dbt", "path": "macros/get_custom_name/get_custom_schema.sql", "original_file_path": "macros/get_custom_name/get_custom_schema.sql", "unique_id": "macro.dbt.generate_schema_name_for_env", "macro_sql": "{% macro generate_schema_name_for_env(custom_schema_name, node) -%}\n\n {%- set default_schema = target.schema -%}\n {%- if target.name == 'prod' and custom_schema_name is not none -%}\n\n {{ custom_schema_name | trim }}\n\n {%- else -%}\n\n {{ default_schema }}\n\n {%- endif -%}\n\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "custom_schema_name", "type": null, "description": ""}, {"name": "node", "type": null, "description": ""}], "created_at": 1786586787.8467867, "supported_languages": null}, "macro.dbt.generate_alias_name": {"name": "generate_alias_name", "resource_type": "macro", "package_name": "dbt", "path": "macros/get_custom_name/get_custom_alias.sql", "original_file_path": "macros/get_custom_name/get_custom_alias.sql", "unique_id": "macro.dbt.generate_alias_name", "macro_sql": "{% macro generate_alias_name(custom_alias_name=none, node=none) -%}\n {% do return(adapter.dispatch('generate_alias_name', 'dbt')(custom_alias_name, node)) %}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__generate_alias_name"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "custom_alias_name", "type": null, "description": ""}, {"name": "node", "type": null, "description": ""}], "created_at": 1786586787.8474476, "supported_languages": null}, "macro.dbt.default__generate_alias_name": {"name": "default__generate_alias_name", "resource_type": "macro", "package_name": "dbt", "path": "macros/get_custom_name/get_custom_alias.sql", "original_file_path": "macros/get_custom_name/get_custom_alias.sql", "unique_id": "macro.dbt.default__generate_alias_name", "macro_sql": "{% macro default__generate_alias_name(custom_alias_name=none, node=none) -%}\n\n {%- if custom_alias_name -%}\n\n {{ custom_alias_name | trim }}\n\n {%- elif node.version -%}\n\n {{ return(node.name ~ \"_v\" ~ (node.version | replace(\".\", \"_\"))) }}\n\n {%- else -%}\n\n {{ node.name }}\n\n {%- endif -%}\n\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "custom_alias_name", "type": null, "description": ""}, {"name": "node", "type": null, "description": ""}], "created_at": 1786586787.8481038, "supported_languages": null}, "macro.dbt.current_timestamp": {"name": "current_timestamp", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/timestamps.sql", "original_file_path": "macros/adapters/timestamps.sql", "unique_id": "macro.dbt.current_timestamp", "macro_sql": "{%- macro current_timestamp() -%}\n {{ adapter.dispatch('current_timestamp', 'dbt')() }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt_postgres.postgres__current_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1786586787.8489158, "supported_languages": null}, "macro.dbt.default__current_timestamp": {"name": "default__current_timestamp", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/timestamps.sql", "original_file_path": "macros/adapters/timestamps.sql", "unique_id": "macro.dbt.default__current_timestamp", "macro_sql": "{% macro default__current_timestamp() -%}\n {{ exceptions.raise_not_implemented(\n 'current_timestamp macro not implemented for adapter ' + adapter.type()) }}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1786586787.8491848, "supported_languages": null}, "macro.dbt.snapshot_get_time": {"name": "snapshot_get_time", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/timestamps.sql", "original_file_path": "macros/adapters/timestamps.sql", "unique_id": "macro.dbt.snapshot_get_time", "macro_sql": "\n\n{%- macro snapshot_get_time() -%}\n {{ adapter.dispatch('snapshot_get_time', 'dbt')() }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt_postgres.postgres__snapshot_get_time"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1786586787.849423, "supported_languages": null}, "macro.dbt.default__snapshot_get_time": {"name": "default__snapshot_get_time", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/timestamps.sql", "original_file_path": "macros/adapters/timestamps.sql", "unique_id": "macro.dbt.default__snapshot_get_time", "macro_sql": "{% macro default__snapshot_get_time() %}\n {{ current_timestamp() }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.current_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1786586787.8495986, "supported_languages": null}, "macro.dbt.get_snapshot_get_time_data_type": {"name": "get_snapshot_get_time_data_type", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/timestamps.sql", "original_file_path": "macros/adapters/timestamps.sql", "unique_id": "macro.dbt.get_snapshot_get_time_data_type", "macro_sql": "{% macro get_snapshot_get_time_data_type() %}\n {% set snapshot_time = adapter.dispatch('snapshot_get_time', 'dbt')() %}\n {% set time_data_type_sql = 'select ' ~ snapshot_time ~ ' as dbt_snapshot_time' %}\n {% set snapshot_time_column_schema = get_column_schema_from_query(time_data_type_sql) %}\n {% set time_data_type = snapshot_time_column_schema[0].dtype %}\n {{ return(time_data_type or none) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.snapshot_get_time", "macro.dbt_postgres.postgres__snapshot_get_time", "macro.dbt.get_column_schema_from_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1786586787.8502913, "supported_languages": null}, "macro.dbt.current_timestamp_backcompat": {"name": "current_timestamp_backcompat", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/timestamps.sql", "original_file_path": "macros/adapters/timestamps.sql", "unique_id": "macro.dbt.current_timestamp_backcompat", "macro_sql": "{% macro current_timestamp_backcompat() %}\n {{ return(adapter.dispatch('current_timestamp_backcompat', 'dbt')()) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__current_timestamp_backcompat"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1786586787.8505812, "supported_languages": null}, "macro.dbt.default__current_timestamp_backcompat": {"name": "default__current_timestamp_backcompat", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/timestamps.sql", "original_file_path": "macros/adapters/timestamps.sql", "unique_id": "macro.dbt.default__current_timestamp_backcompat", "macro_sql": "{% macro default__current_timestamp_backcompat() %}\n current_timestamp::timestamp\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1786586787.8507135, "supported_languages": null}, "macro.dbt.current_timestamp_in_utc_backcompat": {"name": "current_timestamp_in_utc_backcompat", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/timestamps.sql", "original_file_path": "macros/adapters/timestamps.sql", "unique_id": "macro.dbt.current_timestamp_in_utc_backcompat", "macro_sql": "{% macro current_timestamp_in_utc_backcompat() %}\n {{ return(adapter.dispatch('current_timestamp_in_utc_backcompat', 'dbt')()) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__current_timestamp_in_utc_backcompat"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1786586787.851001, "supported_languages": null}, "macro.dbt.default__current_timestamp_in_utc_backcompat": {"name": "default__current_timestamp_in_utc_backcompat", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/timestamps.sql", "original_file_path": "macros/adapters/timestamps.sql", "unique_id": "macro.dbt.default__current_timestamp_in_utc_backcompat", "macro_sql": "{% macro default__current_timestamp_in_utc_backcompat() %}\n {{ return(adapter.dispatch('current_timestamp_backcompat', 'dbt')()) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.current_timestamp_backcompat", "macro.dbt_postgres.postgres__current_timestamp_backcompat"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1786586787.8512776, "supported_languages": null}, "macro.dbt.get_create_index_sql": {"name": "get_create_index_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/indexes.sql", "original_file_path": "macros/adapters/indexes.sql", "unique_id": "macro.dbt.get_create_index_sql", "macro_sql": "{% macro get_create_index_sql(relation, index_dict) -%}\n {{ return(adapter.dispatch('get_create_index_sql', 'dbt')(relation, index_dict)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__get_create_index_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "index_dict", "type": null, "description": ""}], "created_at": 1786586787.8521104, "supported_languages": null}, "macro.dbt.default__get_create_index_sql": {"name": "default__get_create_index_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/indexes.sql", "original_file_path": "macros/adapters/indexes.sql", "unique_id": "macro.dbt.default__get_create_index_sql", "macro_sql": "{% macro default__get_create_index_sql(relation, index_dict) -%}\n {% do return(None) %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "index_dict", "type": null, "description": ""}], "created_at": 1786586787.8523555, "supported_languages": null}, "macro.dbt.create_indexes": {"name": "create_indexes", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/indexes.sql", "original_file_path": "macros/adapters/indexes.sql", "unique_id": "macro.dbt.create_indexes", "macro_sql": "{% macro create_indexes(relation) -%}\n {{ adapter.dispatch('create_indexes', 'dbt')(relation) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__create_indexes"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1786586787.8526182, "supported_languages": null}, "macro.dbt.default__create_indexes": {"name": "default__create_indexes", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/indexes.sql", "original_file_path": "macros/adapters/indexes.sql", "unique_id": "macro.dbt.default__create_indexes", "macro_sql": "{% macro default__create_indexes(relation) -%}\n {%- set _indexes = config.get('indexes', default=[]) -%}\n\n {% for _index_dict in _indexes %}\n {% set create_index_sql = get_create_index_sql(relation, _index_dict) %}\n {% if create_index_sql %}\n {% do run_query(create_index_sql) %}\n {% endif %}\n {% endfor %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_create_index_sql", "macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1786586787.8534095, "supported_languages": null}, "macro.dbt.get_drop_index_sql": {"name": "get_drop_index_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/indexes.sql", "original_file_path": "macros/adapters/indexes.sql", "unique_id": "macro.dbt.get_drop_index_sql", "macro_sql": "{% macro get_drop_index_sql(relation, index_name) -%}\n {{ adapter.dispatch('get_drop_index_sql', 'dbt')(relation, index_name) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__get_drop_index_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "index_name", "type": null, "description": ""}], "created_at": 1786586787.8537288, "supported_languages": null}, "macro.dbt.default__get_drop_index_sql": {"name": "default__get_drop_index_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/indexes.sql", "original_file_path": "macros/adapters/indexes.sql", "unique_id": "macro.dbt.default__get_drop_index_sql", "macro_sql": "{% macro default__get_drop_index_sql(relation, index_name) -%}\n {{ exceptions.raise_compiler_error(\"`get_drop_index_sql has not been implemented for this adapter.\") }}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "index_name", "type": null, "description": ""}], "created_at": 1786586787.8539758, "supported_languages": null}, "macro.dbt.get_show_indexes_sql": {"name": "get_show_indexes_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/indexes.sql", "original_file_path": "macros/adapters/indexes.sql", "unique_id": "macro.dbt.get_show_indexes_sql", "macro_sql": "{% macro get_show_indexes_sql(relation) -%}\n {{ adapter.dispatch('get_show_indexes_sql', 'dbt')(relation) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__get_show_indexes_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1786586787.8542378, "supported_languages": null}, "macro.dbt.default__get_show_indexes_sql": {"name": "default__get_show_indexes_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/indexes.sql", "original_file_path": "macros/adapters/indexes.sql", "unique_id": "macro.dbt.default__get_show_indexes_sql", "macro_sql": "{% macro default__get_show_indexes_sql(relation) -%}\n {{ exceptions.raise_compiler_error(\"`get_show_indexes_sql has not been implemented for this adapter.\") }}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1786586787.854447, "supported_languages": null}, "macro.dbt.get_catalog_relations": {"name": "get_catalog_relations", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "unique_id": "macro.dbt.get_catalog_relations", "macro_sql": "{% macro get_catalog_relations(information_schema, relations) -%}\n {{ return(adapter.dispatch('get_catalog_relations', 'dbt')(information_schema, relations)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__get_catalog_relations"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "information_schema", "type": null, "description": ""}, {"name": "relations", "type": null, "description": ""}], "created_at": 1786586787.8559504, "supported_languages": null}, "macro.dbt.default__get_catalog_relations": {"name": "default__get_catalog_relations", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "unique_id": "macro.dbt.default__get_catalog_relations", "macro_sql": "{% macro default__get_catalog_relations(information_schema, relations) -%}\n {% set typename = adapter.type() %}\n {% set msg -%}\n get_catalog_relations not implemented for {{ typename }}\n {%- endset %}\n\n {{ exceptions.raise_compiler_error(msg) }}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "information_schema", "type": null, "description": ""}, {"name": "relations", "type": null, "description": ""}], "created_at": 1786586787.8563929, "supported_languages": null}, "macro.dbt.get_catalog": {"name": "get_catalog", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "unique_id": "macro.dbt.get_catalog", "macro_sql": "{% macro get_catalog(information_schema, schemas) -%}\n {{ return(adapter.dispatch('get_catalog', 'dbt')(information_schema, schemas)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__get_catalog"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "information_schema", "type": null, "description": ""}, {"name": "schemas", "type": null, "description": ""}], "created_at": 1786586787.856732, "supported_languages": null}, "macro.dbt.default__get_catalog": {"name": "default__get_catalog", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "unique_id": "macro.dbt.default__get_catalog", "macro_sql": "{% macro default__get_catalog(information_schema, schemas) -%}\n\n {% set typename = adapter.type() %}\n {% set msg -%}\n get_catalog not implemented for {{ typename }}\n {%- endset %}\n\n {{ exceptions.raise_compiler_error(msg) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "information_schema", "type": null, "description": ""}, {"name": "schemas", "type": null, "description": ""}], "created_at": 1786586787.8571703, "supported_languages": null}, "macro.dbt.information_schema_name": {"name": "information_schema_name", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "unique_id": "macro.dbt.information_schema_name", "macro_sql": "{% macro information_schema_name(database) %}\n {{ return(adapter.dispatch('information_schema_name', 'dbt')(database)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__information_schema_name"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "database", "type": null, "description": ""}], "created_at": 1786586787.8574755, "supported_languages": null}, "macro.dbt.default__information_schema_name": {"name": "default__information_schema_name", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "unique_id": "macro.dbt.default__information_schema_name", "macro_sql": "{% macro default__information_schema_name(database) -%}\n {%- if database -%}\n {{ database }}.INFORMATION_SCHEMA\n {%- else -%}\n INFORMATION_SCHEMA\n {%- endif -%}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "database", "type": null, "description": ""}], "created_at": 1786586787.8577409, "supported_languages": null}, "macro.dbt.list_schemas": {"name": "list_schemas", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "unique_id": "macro.dbt.list_schemas", "macro_sql": "{% macro list_schemas(database) -%}\n {{ return(adapter.dispatch('list_schemas', 'dbt')(database)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__list_schemas"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "database", "type": null, "description": ""}], "created_at": 1786586787.8580494, "supported_languages": null}, "macro.dbt.default__list_schemas": {"name": "default__list_schemas", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "unique_id": "macro.dbt.default__list_schemas", "macro_sql": "{% macro default__list_schemas(database) -%}\n {% set sql %}\n select distinct schema_name\n from {{ information_schema_name(database) }}.SCHEMATA\n where catalog_name ilike '{{ database }}'\n {% endset %}\n {{ return(run_query(sql)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.information_schema_name", "macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "database", "type": null, "description": ""}], "created_at": 1786586787.858444, "supported_languages": null}, "macro.dbt.check_schema_exists": {"name": "check_schema_exists", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "unique_id": "macro.dbt.check_schema_exists", "macro_sql": "{% macro check_schema_exists(information_schema, schema) -%}\n {{ return(adapter.dispatch('check_schema_exists', 'dbt')(information_schema, schema)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__check_schema_exists"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "information_schema", "type": null, "description": ""}, {"name": "schema", "type": null, "description": ""}], "created_at": 1786586787.85878, "supported_languages": null}, "macro.dbt.default__check_schema_exists": {"name": "default__check_schema_exists", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "unique_id": "macro.dbt.default__check_schema_exists", "macro_sql": "{% macro default__check_schema_exists(information_schema, schema) -%}\n {% set sql -%}\n select count(*)\n from {{ information_schema.replace(information_schema_view='SCHEMATA') }}\n where catalog_name='{{ information_schema.database }}'\n and schema_name='{{ schema }}'\n {%- endset %}\n {{ return(run_query(sql)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.replace", "macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "information_schema", "type": null, "description": ""}, {"name": "schema", "type": null, "description": ""}], "created_at": 1786586787.8592887, "supported_languages": null}, "macro.dbt.list_relations_without_caching": {"name": "list_relations_without_caching", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "unique_id": "macro.dbt.list_relations_without_caching", "macro_sql": "{% macro list_relations_without_caching(schema_relation) %}\n {{ return(adapter.dispatch('list_relations_without_caching', 'dbt')(schema_relation)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__list_relations_without_caching"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "schema_relation", "type": null, "description": ""}], "created_at": 1786586787.8597183, "supported_languages": null}, "macro.dbt.default__list_relations_without_caching": {"name": "default__list_relations_without_caching", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "unique_id": "macro.dbt.default__list_relations_without_caching", "macro_sql": "{% macro default__list_relations_without_caching(schema_relation) %}\n {{ exceptions.raise_not_implemented(\n 'list_relations_without_caching macro not implemented for adapter '+adapter.type()) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "schema_relation", "type": null, "description": ""}], "created_at": 1786586787.8600144, "supported_languages": null}, "macro.dbt.list_function_relations_without_caching": {"name": "list_function_relations_without_caching", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "unique_id": "macro.dbt.list_function_relations_without_caching", "macro_sql": "{% macro list_function_relations_without_caching(schema_relation) %}\n {{ return(adapter.dispatch('list_function_relations_without_caching', 'dbt')(schema_relation)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__list_function_relations_without_caching"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "schema_relation", "type": null, "description": ""}], "created_at": 1786586787.8603172, "supported_languages": null}, "macro.dbt.default__list_function_relations_without_caching": {"name": "default__list_function_relations_without_caching", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "unique_id": "macro.dbt.default__list_function_relations_without_caching", "macro_sql": "{% macro default__list_function_relations_without_caching(schema_relation) %}\n {{ exceptions.raise_not_implemented(\n 'list_function_relations_without_caching macro not implemented for adapter '+adapter.type()) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "schema_relation", "type": null, "description": ""}], "created_at": 1786586787.8605816, "supported_languages": null}, "macro.dbt.get_catalog_for_single_relation": {"name": "get_catalog_for_single_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "unique_id": "macro.dbt.get_catalog_for_single_relation", "macro_sql": "{% macro get_catalog_for_single_relation(relation) %}\n {{ return(adapter.dispatch('get_catalog_for_single_relation', 'dbt')(relation)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_catalog_for_single_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1786586787.8608847, "supported_languages": null}, "macro.dbt.default__get_catalog_for_single_relation": {"name": "default__get_catalog_for_single_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "unique_id": "macro.dbt.default__get_catalog_for_single_relation", "macro_sql": "{% macro default__get_catalog_for_single_relation(relation) %}\n {{ exceptions.raise_not_implemented(\n 'get_catalog_for_single_relation macro not implemented for adapter '+adapter.type()) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1786586787.861169, "supported_languages": null}, "macro.dbt.get_relations": {"name": "get_relations", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "unique_id": "macro.dbt.get_relations", "macro_sql": "{% macro get_relations() %}\n {{ return(adapter.dispatch('get_relations', 'dbt')()) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__get_relations"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1786586787.861446, "supported_languages": null}, "macro.dbt.default__get_relations": {"name": "default__get_relations", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "unique_id": "macro.dbt.default__get_relations", "macro_sql": "{% macro default__get_relations() %}\n {{ exceptions.raise_not_implemented(\n 'get_relations macro not implemented for adapter '+adapter.type()) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1786586787.8616965, "supported_languages": null}, "macro.dbt.get_relation_last_modified": {"name": "get_relation_last_modified", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "unique_id": "macro.dbt.get_relation_last_modified", "macro_sql": "{% macro get_relation_last_modified(information_schema, relations) %}\n {{ return(adapter.dispatch('get_relation_last_modified', 'dbt')(information_schema, relations)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_relation_last_modified"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "information_schema", "type": null, "description": ""}, {"name": "relations", "type": null, "description": ""}], "created_at": 1786586787.862044, "supported_languages": null}, "macro.dbt.default__get_relation_last_modified": {"name": "default__get_relation_last_modified", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "unique_id": "macro.dbt.default__get_relation_last_modified", "macro_sql": "{% macro default__get_relation_last_modified(information_schema, relations) %}\n {{ exceptions.raise_not_implemented(\n 'get_relation_last_modified macro not implemented for adapter ' + adapter.type()) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "information_schema", "type": null, "description": ""}, {"name": "relations", "type": null, "description": ""}], "created_at": 1786586787.8623288, "supported_languages": null}, "macro.dbt.get_columns_in_relation": {"name": "get_columns_in_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "unique_id": "macro.dbt.get_columns_in_relation", "macro_sql": "{% macro get_columns_in_relation(relation) -%}\n {{ return(adapter.dispatch('get_columns_in_relation', 'dbt')(relation)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__get_columns_in_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1786586787.8643029, "supported_languages": null}, "macro.dbt.default__get_columns_in_relation": {"name": "default__get_columns_in_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "unique_id": "macro.dbt.default__get_columns_in_relation", "macro_sql": "{% macro default__get_columns_in_relation(relation) -%}\n {{ exceptions.raise_not_implemented(\n 'get_columns_in_relation macro not implemented for adapter '+adapter.type()) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1786586787.8645768, "supported_languages": null}, "macro.dbt.sql_convert_columns_in_relation": {"name": "sql_convert_columns_in_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "unique_id": "macro.dbt.sql_convert_columns_in_relation", "macro_sql": "{% macro sql_convert_columns_in_relation(table) -%}\n {% set columns = [] %}\n {% for row in table %}\n {% do columns.append(api.Column(*row)) %}\n {% endfor %}\n {{ return(columns) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "table", "type": null, "description": ""}], "created_at": 1786586787.8650892, "supported_languages": null}, "macro.dbt.get_list_of_column_names": {"name": "get_list_of_column_names", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "unique_id": "macro.dbt.get_list_of_column_names", "macro_sql": "\n\n{%- macro get_list_of_column_names(columns) -%}\n {% set col_names = [] %}\n {% for col in columns %}\n {% do col_names.append(col.name) %}\n {% endfor %}\n {{ return(col_names) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "columns", "type": null, "description": ""}], "created_at": 1786586787.8655553, "supported_languages": null}, "macro.dbt.get_empty_subquery_sql": {"name": "get_empty_subquery_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "unique_id": "macro.dbt.get_empty_subquery_sql", "macro_sql": "{% macro get_empty_subquery_sql(select_sql, select_sql_header=none) -%}\n {{ return(adapter.dispatch('get_empty_subquery_sql', 'dbt')(select_sql, select_sql_header)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_empty_subquery_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "select_sql", "type": null, "description": ""}, {"name": "select_sql_header", "type": null, "description": ""}], "created_at": 1786586787.865919, "supported_languages": null}, "macro.dbt.default__get_empty_subquery_sql": {"name": "default__get_empty_subquery_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "unique_id": "macro.dbt.default__get_empty_subquery_sql", "macro_sql": "{% macro default__get_empty_subquery_sql(select_sql, select_sql_header=none) %}\n {%- if select_sql_header is not none -%}\n {{ select_sql_header }}\n {%- endif -%}\n select * from (\n {{ select_sql }}\n ) as __dbt_sbq\n where false\n limit 0\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "select_sql", "type": null, "description": ""}, {"name": "select_sql_header", "type": null, "description": ""}], "created_at": 1786586787.8662653, "supported_languages": null}, "macro.dbt.get_empty_schema_sql": {"name": "get_empty_schema_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "unique_id": "macro.dbt.get_empty_schema_sql", "macro_sql": "{% macro get_empty_schema_sql(columns) -%}\n {{ return(adapter.dispatch('get_empty_schema_sql', 'dbt')(columns)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_empty_schema_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "columns", "type": null, "description": ""}], "created_at": 1786586787.8666873, "supported_languages": null}, "macro.dbt.default__get_empty_schema_sql": {"name": "default__get_empty_schema_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "unique_id": "macro.dbt.default__get_empty_schema_sql", "macro_sql": "{% macro default__get_empty_schema_sql(columns) %}\n {%- set col_err = [] -%}\n {%- set col_naked_numeric = [] -%}\n select\n {% for i in columns %}\n {%- set col = columns[i] -%}\n {%- if col['data_type'] is not defined -%}\n {%- do col_err.append(col['name']) -%}\n {#-- If this column's type is just 'numeric' then it is missing precision/scale, raise a warning --#}\n {%- elif col['data_type'].strip().lower() in ('numeric', 'decimal', 'number') -%}\n {%- do col_naked_numeric.append(col['name']) -%}\n {%- endif -%}\n {% set col_name = adapter.quote(col['name']) if col.get('quote') else col['name'] %}\n {{ cast('null', col['data_type']) }} as {{ col_name }}{{ \", \" if not loop.last }}\n {%- endfor -%}\n {%- if (col_err | length) > 0 -%}\n {{ exceptions.column_type_missing(column_names=col_err) }}\n {%- elif (col_naked_numeric | length) > 0 -%}\n {{ exceptions.warn(\"Detected columns with numeric type and unspecified precision/scale, this can lead to unintended rounding: \" ~ col_naked_numeric ~ \"`\") }}\n {%- endif -%}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.cast"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "columns", "type": null, "description": ""}], "created_at": 1786586787.868624, "supported_languages": null}, "macro.dbt.get_column_schema_from_query": {"name": "get_column_schema_from_query", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "unique_id": "macro.dbt.get_column_schema_from_query", "macro_sql": "{% macro get_column_schema_from_query(select_sql, select_sql_header=none) -%}\n {% set columns = [] %}\n {# -- Using an 'empty subquery' here to get the same schema as the given select_sql statement, without necessitating a data scan.#}\n {% set sql = get_empty_subquery_sql(select_sql, select_sql_header) %}\n {% set column_schema = adapter.get_column_schema_from_query(sql) %}\n {{ return(column_schema) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_empty_subquery_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "select_sql", "type": null, "description": ""}, {"name": "select_sql_header", "type": null, "description": ""}], "created_at": 1786586787.8692179, "supported_languages": null}, "macro.dbt.get_columns_in_query": {"name": "get_columns_in_query", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "unique_id": "macro.dbt.get_columns_in_query", "macro_sql": "{% macro get_columns_in_query(select_sql) -%}\n {{ return(adapter.dispatch('get_columns_in_query', 'dbt')(select_sql)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_columns_in_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "select_sql", "type": null, "description": ""}], "created_at": 1786586787.86953, "supported_languages": null}, "macro.dbt.default__get_columns_in_query": {"name": "default__get_columns_in_query", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "unique_id": "macro.dbt.default__get_columns_in_query", "macro_sql": "{% macro default__get_columns_in_query(select_sql) %}\n {% call statement('get_columns_in_query', fetch_result=True, auto_begin=False) -%}\n {{ get_empty_subquery_sql(select_sql) }}\n {% endcall %}\n {{ return(load_result('get_columns_in_query').table.columns | map(attribute='name') | list) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement", "macro.dbt.get_empty_subquery_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "select_sql", "type": null, "description": ""}], "created_at": 1786586787.8701088, "supported_languages": null}, "macro.dbt.alter_column_type": {"name": "alter_column_type", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "unique_id": "macro.dbt.alter_column_type", "macro_sql": "{% macro alter_column_type(relation, column_name, new_column_type) -%}\n {{ return(adapter.dispatch('alter_column_type', 'dbt')(relation, column_name, new_column_type)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__alter_column_type"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "column_name", "type": null, "description": ""}, {"name": "new_column_type", "type": null, "description": ""}], "created_at": 1786586787.8704877, "supported_languages": null}, "macro.dbt.default__alter_column_type": {"name": "default__alter_column_type", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "unique_id": "macro.dbt.default__alter_column_type", "macro_sql": "{% macro default__alter_column_type(relation, column_name, new_column_type) -%}\n {#\n 1. Create a new column (w/ temp name and correct type)\n 2. Copy data over to it\n 3. Drop the existing column (cascade!)\n 4. Rename the new column to existing column\n #}\n {%- set tmp_column = column_name + \"__dbt_alter\" -%}\n\n {% call statement('alter_column_type') %}\n alter table {{ relation.render() }} add column {{ adapter.quote(tmp_column) }} {{ new_column_type }};\n update {{ relation.render() }} set {{ adapter.quote(tmp_column) }} = {{ adapter.quote(column_name) }};\n alter table {{ relation.render() }} drop column {{ adapter.quote(column_name) }} cascade;\n alter table {{ relation.render() }} rename column {{ adapter.quote(tmp_column) }} to {{ adapter.quote(column_name) }}\n {% endcall %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "column_name", "type": null, "description": ""}, {"name": "new_column_type", "type": null, "description": ""}], "created_at": 1786586787.8716362, "supported_languages": null}, "macro.dbt.alter_relation_add_remove_columns": {"name": "alter_relation_add_remove_columns", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "unique_id": "macro.dbt.alter_relation_add_remove_columns", "macro_sql": "{% macro alter_relation_add_remove_columns(relation, add_columns = none, remove_columns = none) -%}\n {{ return(adapter.dispatch('alter_relation_add_remove_columns', 'dbt')(relation, add_columns, remove_columns)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__alter_relation_add_remove_columns"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "add_columns", "type": null, "description": ""}, {"name": "remove_columns", "type": null, "description": ""}], "created_at": 1786586787.8720834, "supported_languages": null}, "macro.dbt.default__alter_relation_add_remove_columns": {"name": "default__alter_relation_add_remove_columns", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "unique_id": "macro.dbt.default__alter_relation_add_remove_columns", "macro_sql": "{% macro default__alter_relation_add_remove_columns(relation, add_columns, remove_columns) %}\n\n {% if add_columns is none %}\n {% set add_columns = [] %}\n {% endif %}\n {% if remove_columns is none %}\n {% set remove_columns = [] %}\n {% endif %}\n\n {% set sql -%}\n\n alter {{ relation.type }} {{ relation.render() }}\n\n {% for column in add_columns %}\n add column {{ column.quoted }} {{ column.expanded_data_type }}{{ ',' if not loop.last }}\n {% endfor %}{{ ',' if add_columns and remove_columns }}\n\n {% for column in remove_columns %}\n drop column {{ column.quoted }}{{ ',' if not loop.last }}\n {% endfor %}\n\n {%- endset -%}\n\n {% do run_query(sql) %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "add_columns", "type": null, "description": ""}, {"name": "remove_columns", "type": null, "description": ""}], "created_at": 1786586787.8733845, "supported_languages": null}, "macro.dbt.is_core_v2": {"name": "is_core_v2", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/runtime.sql", "original_file_path": "macros/adapters/runtime.sql", "unique_id": "macro.dbt.is_core_v2", "macro_sql": "{% macro is_core_v2() -%}\n {%- set major_version = (dbt_version.split('.') | first) | int -%}\n {{ return(major_version == 2) }}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1786586787.8738883, "supported_languages": null}, "macro.dbt.create_schema": {"name": "create_schema", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/schema.sql", "original_file_path": "macros/adapters/schema.sql", "unique_id": "macro.dbt.create_schema", "macro_sql": "{% macro create_schema(relation) -%}\n {{ adapter.dispatch('create_schema', 'dbt')(relation) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__create_schema"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1786586787.87444, "supported_languages": null}, "macro.dbt.default__create_schema": {"name": "default__create_schema", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/schema.sql", "original_file_path": "macros/adapters/schema.sql", "unique_id": "macro.dbt.default__create_schema", "macro_sql": "{% macro default__create_schema(relation) -%}\n {%- call statement('create_schema') -%}\n create schema if not exists {{ relation.without_identifier() }}\n {% endcall %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1786586787.8747482, "supported_languages": null}, "macro.dbt.drop_schema": {"name": "drop_schema", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/schema.sql", "original_file_path": "macros/adapters/schema.sql", "unique_id": "macro.dbt.drop_schema", "macro_sql": "{% macro drop_schema(relation) -%}\n {{ adapter.dispatch('drop_schema', 'dbt')(relation) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__drop_schema"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1786586787.8750281, "supported_languages": null}, "macro.dbt.default__drop_schema": {"name": "default__drop_schema", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/schema.sql", "original_file_path": "macros/adapters/schema.sql", "unique_id": "macro.dbt.default__drop_schema", "macro_sql": "{% macro default__drop_schema(relation) -%}\n {%- call statement('drop_schema') -%}\n drop schema if exists {{ relation.without_identifier() }} cascade\n {% endcall %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1786586787.8753262, "supported_languages": null}, "macro.dbt.alter_column_comment": {"name": "alter_column_comment", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/persist_docs.sql", "original_file_path": "macros/adapters/persist_docs.sql", "unique_id": "macro.dbt.alter_column_comment", "macro_sql": "{% macro alter_column_comment(relation, column_dict) -%}\n {{ return(adapter.dispatch('alter_column_comment', 'dbt')(relation, column_dict)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__alter_column_comment"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "column_dict", "type": null, "description": ""}], "created_at": 1786586787.8764338, "supported_languages": null}, "macro.dbt.default__alter_column_comment": {"name": "default__alter_column_comment", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/persist_docs.sql", "original_file_path": "macros/adapters/persist_docs.sql", "unique_id": "macro.dbt.default__alter_column_comment", "macro_sql": "{% macro default__alter_column_comment(relation, column_dict) -%}\n {{ exceptions.raise_not_implemented(\n 'alter_column_comment macro not implemented for adapter '+adapter.type()) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "column_dict", "type": null, "description": ""}], "created_at": 1786586787.8767247, "supported_languages": null}, "macro.dbt.alter_relation_comment": {"name": "alter_relation_comment", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/persist_docs.sql", "original_file_path": "macros/adapters/persist_docs.sql", "unique_id": "macro.dbt.alter_relation_comment", "macro_sql": "{% macro alter_relation_comment(relation, relation_comment) -%}\n {{ return(adapter.dispatch('alter_relation_comment', 'dbt')(relation, relation_comment)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__alter_relation_comment"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "relation_comment", "type": null, "description": ""}], "created_at": 1786586787.877202, "supported_languages": null}, "macro.dbt.default__alter_relation_comment": {"name": "default__alter_relation_comment", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/persist_docs.sql", "original_file_path": "macros/adapters/persist_docs.sql", "unique_id": "macro.dbt.default__alter_relation_comment", "macro_sql": "{% macro default__alter_relation_comment(relation, relation_comment) -%}\n {{ exceptions.raise_not_implemented(\n 'alter_relation_comment macro not implemented for adapter '+adapter.type()) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "relation_comment", "type": null, "description": ""}], "created_at": 1786586787.8774908, "supported_languages": null}, "macro.dbt.persist_docs": {"name": "persist_docs", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/persist_docs.sql", "original_file_path": "macros/adapters/persist_docs.sql", "unique_id": "macro.dbt.persist_docs", "macro_sql": "{% macro persist_docs(relation, model, for_relation=true, for_columns=true) -%}\n {{ return(adapter.dispatch('persist_docs', 'dbt')(relation, model, for_relation, for_columns)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__persist_docs"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "model", "type": null, "description": ""}, {"name": "for_relation", "type": null, "description": ""}, {"name": "for_columns", "type": null, "description": ""}], "created_at": 1786586787.877956, "supported_languages": null}, "macro.dbt.validate_doc_columns": {"name": "validate_doc_columns", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/persist_docs.sql", "original_file_path": "macros/adapters/persist_docs.sql", "unique_id": "macro.dbt.validate_doc_columns", "macro_sql": "{% macro validate_doc_columns(relation, column_dict, existing_column_names) %}\n {% set existing_lower = existing_column_names | map(\"lower\") | list %}\n {% set missing = [] %}\n {% set filtered = {} %}\n {% for col_name in column_dict %}\n {% set is_quoted = column_dict[col_name]['quote'] %}\n {% if is_quoted %}\n {% set present = col_name in existing_column_names %}\n {% else %}\n {% set present = col_name | lower in existing_lower %}\n {% endif %}\n {% if present %}\n {% do filtered.update({col_name: column_dict[col_name]}) %}\n {% else %}\n {% do missing.append(col_name) %}\n {% endif %}\n {% endfor %}\n {% if missing | length > 0 %}\n {{ exceptions.warn(\"In relation \" ~ relation.render() ~ \": The following columns are specified in the schema but are not present in the database: \" ~ missing | join(\", \")) }}\n {% endif %}\n {{ return(filtered) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "column_dict", "type": null, "description": ""}, {"name": "existing_column_names", "type": null, "description": ""}], "created_at": 1786586787.8796656, "supported_languages": null}, "macro.dbt.default__persist_docs": {"name": "default__persist_docs", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/persist_docs.sql", "original_file_path": "macros/adapters/persist_docs.sql", "unique_id": "macro.dbt.default__persist_docs", "macro_sql": "{% macro default__persist_docs(relation, model, for_relation, for_columns) -%}\n {% if for_relation and config.persist_relation_docs() and model.description %}\n {% do run_query(alter_relation_comment(relation, model.description)) %}\n {% endif %}\n\n {% if for_columns and config.persist_column_docs() and model.columns %}\n {% set existing_columns = adapter.get_columns_in_relation(relation) | map(attribute=\"name\") | list %}\n {% set filtered_columns = validate_doc_columns(relation, model.columns, existing_columns) %}\n {% set alter_comment_sql = alter_column_comment(relation, filtered_columns) %}\n {% if alter_comment_sql and alter_comment_sql | trim | length > 0 %}\n {% do run_query(alter_comment_sql) %}\n {% endif %}\n {% endif %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.run_query", "macro.dbt.alter_relation_comment", "macro.dbt.validate_doc_columns", "macro.dbt.alter_column_comment"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "model", "type": null, "description": ""}, {"name": "for_relation", "type": null, "description": ""}, {"name": "for_columns", "type": null, "description": ""}], "created_at": 1786586787.8810287, "supported_languages": null}, "macro.dbt.collect_freshness": {"name": "collect_freshness", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/freshness.sql", "original_file_path": "macros/adapters/freshness.sql", "unique_id": "macro.dbt.collect_freshness", "macro_sql": "{% macro collect_freshness(source, loaded_at_field, filter) %}\n {{ return(adapter.dispatch('collect_freshness', 'dbt')(source, loaded_at_field, filter))}}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__collect_freshness"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "source", "type": null, "description": ""}, {"name": "loaded_at_field", "type": null, "description": ""}, {"name": "filter", "type": null, "description": ""}], "created_at": 1786586787.8818102, "supported_languages": null}, "macro.dbt.default__collect_freshness": {"name": "default__collect_freshness", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/freshness.sql", "original_file_path": "macros/adapters/freshness.sql", "unique_id": "macro.dbt.default__collect_freshness", "macro_sql": "{% macro default__collect_freshness(source, loaded_at_field, filter) %}\n {% call statement('collect_freshness', fetch_result=True, auto_begin=False) -%}\n select\n max({{ loaded_at_field }}) as max_loaded_at,\n {{ current_timestamp() }} as snapshotted_at\n from {{ source }}\n {% if filter %}\n where {{ filter }}\n {% endif %}\n {% endcall %}\n {{ return(load_result('collect_freshness')) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement", "macro.dbt.current_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "source", "type": null, "description": ""}, {"name": "loaded_at_field", "type": null, "description": ""}, {"name": "filter", "type": null, "description": ""}], "created_at": 1786586787.8825154, "supported_languages": null}, "macro.dbt.collect_freshness_custom_sql": {"name": "collect_freshness_custom_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/freshness.sql", "original_file_path": "macros/adapters/freshness.sql", "unique_id": "macro.dbt.collect_freshness_custom_sql", "macro_sql": "{% macro collect_freshness_custom_sql(source, loaded_at_query) %}\n {{ return(adapter.dispatch('collect_freshness_custom_sql', 'dbt')(source, loaded_at_query))}}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__collect_freshness_custom_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "source", "type": null, "description": ""}, {"name": "loaded_at_query", "type": null, "description": ""}], "created_at": 1786586787.8828678, "supported_languages": null}, "macro.dbt.default__collect_freshness_custom_sql": {"name": "default__collect_freshness_custom_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/freshness.sql", "original_file_path": "macros/adapters/freshness.sql", "unique_id": "macro.dbt.default__collect_freshness_custom_sql", "macro_sql": "{% macro default__collect_freshness_custom_sql(source, loaded_at_query) %}\n {% call statement('collect_freshness_custom_sql', fetch_result=True, auto_begin=False) -%}\n with source_query as (\n {{ loaded_at_query }}\n )\n select\n (select * from source_query) as max_loaded_at,\n {{ current_timestamp() }} as snapshotted_at\n {% endcall %}\n {{ return(load_result('collect_freshness_custom_sql')) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement", "macro.dbt.current_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "source", "type": null, "description": ""}, {"name": "loaded_at_query", "type": null, "description": ""}], "created_at": 1786586787.8833954, "supported_languages": null}, "macro.dbt.copy_grants": {"name": "copy_grants", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "unique_id": "macro.dbt.copy_grants", "macro_sql": "{% macro copy_grants() %}\n {{ return(adapter.dispatch('copy_grants', 'dbt')()) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__copy_grants"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1786586787.8853226, "supported_languages": null}, "macro.dbt.default__copy_grants": {"name": "default__copy_grants", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "unique_id": "macro.dbt.default__copy_grants", "macro_sql": "{% macro default__copy_grants() %}\n {{ return(True) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1786586787.8855274, "supported_languages": null}, "macro.dbt.support_multiple_grantees_per_dcl_statement": {"name": "support_multiple_grantees_per_dcl_statement", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "unique_id": "macro.dbt.support_multiple_grantees_per_dcl_statement", "macro_sql": "{% macro support_multiple_grantees_per_dcl_statement() %}\n {{ return(adapter.dispatch('support_multiple_grantees_per_dcl_statement', 'dbt')()) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__support_multiple_grantees_per_dcl_statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1786586787.8858037, "supported_languages": null}, "macro.dbt.default__support_multiple_grantees_per_dcl_statement": {"name": "default__support_multiple_grantees_per_dcl_statement", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "unique_id": "macro.dbt.default__support_multiple_grantees_per_dcl_statement", "macro_sql": "\n\n{%- macro default__support_multiple_grantees_per_dcl_statement() -%}\n {{ return(True) }}\n{%- endmacro -%}\n\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1786586787.8860095, "supported_languages": null}, "macro.dbt.should_revoke": {"name": "should_revoke", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "unique_id": "macro.dbt.should_revoke", "macro_sql": "{% macro should_revoke(existing_relation, full_refresh_mode=True) %}\n\n {% if not existing_relation %}\n {#-- The table doesn't already exist, so no grants to copy over --#}\n {{ return(False) }}\n {% elif full_refresh_mode %}\n {#-- The object is being REPLACED -- whether grants are copied over depends on the value of user config --#}\n {{ return(copy_grants()) }}\n {% else %}\n {#-- The table is being merged/upserted/inserted -- grants will be carried over --#}\n {{ return(True) }}\n {% endif %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.copy_grants"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "existing_relation", "type": null, "description": ""}, {"name": "full_refresh_mode", "type": null, "description": ""}], "created_at": 1786586787.8865592, "supported_languages": null}, "macro.dbt.get_show_grant_sql": {"name": "get_show_grant_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "unique_id": "macro.dbt.get_show_grant_sql", "macro_sql": "{% macro get_show_grant_sql(relation) %}\n {{ return(adapter.dispatch(\"get_show_grant_sql\", \"dbt\")(relation)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__get_show_grant_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1786586787.8869991, "supported_languages": null}, "macro.dbt.default__get_show_grant_sql": {"name": "default__get_show_grant_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "unique_id": "macro.dbt.default__get_show_grant_sql", "macro_sql": "{% macro default__get_show_grant_sql(relation) %}\n show grants on {{ relation.render() }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1786586787.887218, "supported_languages": null}, "macro.dbt.get_grant_sql": {"name": "get_grant_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "unique_id": "macro.dbt.get_grant_sql", "macro_sql": "{% macro get_grant_sql(relation, privilege, grantees) %}\n {{ return(adapter.dispatch('get_grant_sql', 'dbt')(relation, privilege, grantees)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_grant_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "privilege", "type": null, "description": ""}, {"name": "grantees", "type": null, "description": ""}], "created_at": 1786586787.887597, "supported_languages": null}, "macro.dbt.default__get_grant_sql": {"name": "default__get_grant_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "unique_id": "macro.dbt.default__get_grant_sql", "macro_sql": "\n\n{%- macro default__get_grant_sql(relation, privilege, grantees) -%}\n grant {{ privilege }} on {{ relation.render() }} to {{ grantees | join(', ') }}\n{%- endmacro -%}\n\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "privilege", "type": null, "description": ""}, {"name": "grantees", "type": null, "description": ""}], "created_at": 1786586787.8879673, "supported_languages": null}, "macro.dbt.get_revoke_sql": {"name": "get_revoke_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "unique_id": "macro.dbt.get_revoke_sql", "macro_sql": "{% macro get_revoke_sql(relation, privilege, grantees) %}\n {{ return(adapter.dispatch('get_revoke_sql', 'dbt')(relation, privilege, grantees)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_revoke_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "privilege", "type": null, "description": ""}, {"name": "grantees", "type": null, "description": ""}], "created_at": 1786586787.8883414, "supported_languages": null}, "macro.dbt.default__get_revoke_sql": {"name": "default__get_revoke_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "unique_id": "macro.dbt.default__get_revoke_sql", "macro_sql": "\n\n{%- macro default__get_revoke_sql(relation, privilege, grantees) -%}\n {%- set quoted_grantees = [] -%}\n {%- for grantee in grantees -%}\n {%- do quoted_grantees.append(adapter.quote(grantee)) -%}\n {%- endfor -%}\n revoke {{ privilege }} on {{ relation.render() }} from {{ quoted_grantees | join(', ') }}\n{%- endmacro -%}\n\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "privilege", "type": null, "description": ""}, {"name": "grantees", "type": null, "description": ""}], "created_at": 1786586787.8889673, "supported_languages": null}, "macro.dbt.get_dcl_statement_list": {"name": "get_dcl_statement_list", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "unique_id": "macro.dbt.get_dcl_statement_list", "macro_sql": "{% macro get_dcl_statement_list(relation, grant_config, get_dcl_macro) %}\n {{ return(adapter.dispatch('get_dcl_statement_list', 'dbt')(relation, grant_config, get_dcl_macro)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_dcl_statement_list"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "grant_config", "type": null, "description": ""}, {"name": "get_dcl_macro", "type": null, "description": ""}], "created_at": 1786586787.8893538, "supported_languages": null}, "macro.dbt.default__get_dcl_statement_list": {"name": "default__get_dcl_statement_list", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "unique_id": "macro.dbt.default__get_dcl_statement_list", "macro_sql": "\n\n{%- macro default__get_dcl_statement_list(relation, grant_config, get_dcl_macro) -%}\n {#\n -- Unpack grant_config into specific privileges and the set of users who need them granted/revoked.\n -- Depending on whether this database supports multiple grantees per statement, pass in the list of\n -- all grantees per privilege, or (if not) template one statement per privilege-grantee pair.\n -- `get_dcl_macro` will be either `get_grant_sql` or `get_revoke_sql`\n #}\n {%- set dcl_statements = [] -%}\n {%- for privilege, grantees in grant_config.items() %}\n {%- if support_multiple_grantees_per_dcl_statement() and grantees -%}\n {%- set dcl = get_dcl_macro(relation, privilege, grantees) -%}\n {%- do dcl_statements.append(dcl) -%}\n {%- else -%}\n {%- for grantee in grantees -%}\n {% set dcl = get_dcl_macro(relation, privilege, [grantee]) %}\n {%- do dcl_statements.append(dcl) -%}\n {% endfor -%}\n {%- endif -%}\n {%- endfor -%}\n {{ return(dcl_statements) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.support_multiple_grantees_per_dcl_statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "grant_config", "type": null, "description": ""}, {"name": "get_dcl_macro", "type": null, "description": ""}], "created_at": 1786586787.890464, "supported_languages": null}, "macro.dbt.call_dcl_statements": {"name": "call_dcl_statements", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "unique_id": "macro.dbt.call_dcl_statements", "macro_sql": "{% macro call_dcl_statements(dcl_statement_list) %}\n {{ return(adapter.dispatch(\"call_dcl_statements\", \"dbt\")(dcl_statement_list)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__call_dcl_statements"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "dcl_statement_list", "type": null, "description": ""}], "created_at": 1786586787.8907812, "supported_languages": null}, "macro.dbt.default__call_dcl_statements": {"name": "default__call_dcl_statements", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "unique_id": "macro.dbt.default__call_dcl_statements", "macro_sql": "{% macro default__call_dcl_statements(dcl_statement_list) %}\n {#\n -- By default, supply all grant + revoke statements in a single semicolon-separated block,\n -- so that they're all processed together.\n\n -- Some databases do not support this. Those adapters will need to override this macro\n -- to run each statement individually.\n #}\n {% call statement('grants') %}\n {% for dcl_statement in dcl_statement_list %}\n {{ dcl_statement }};\n {% endfor %}\n {% endcall %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "dcl_statement_list", "type": null, "description": ""}], "created_at": 1786586787.8912, "supported_languages": null}, "macro.dbt.apply_grants": {"name": "apply_grants", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "unique_id": "macro.dbt.apply_grants", "macro_sql": "{% macro apply_grants(relation, grant_config, should_revoke) %}\n {{ return(adapter.dispatch(\"apply_grants\", \"dbt\")(relation, grant_config, should_revoke)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__apply_grants"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "grant_config", "type": null, "description": ""}, {"name": "should_revoke", "type": null, "description": ""}], "created_at": 1786586787.8915732, "supported_languages": null}, "macro.dbt.default__apply_grants": {"name": "default__apply_grants", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "unique_id": "macro.dbt.default__apply_grants", "macro_sql": "{% macro default__apply_grants(relation, grant_config, should_revoke=True) %}\n {#-- If grant_config is {} or None, this is a no-op --#}\n {% if grant_config %}\n {% if should_revoke %}\n {#-- We think previous grants may have carried over --#}\n {#-- Show current grants and calculate diffs --#}\n {% set current_grants_table = run_query(get_show_grant_sql(relation)) %}\n {% set current_grants_dict = adapter.standardize_grants_dict(current_grants_table) %}\n {% set needs_granting = diff_of_two_dicts(grant_config, current_grants_dict) %}\n {% set needs_revoking = diff_of_two_dicts(current_grants_dict, grant_config) %}\n {% if not (needs_granting or needs_revoking) %}\n {{ log('On ' ~ relation.render() ~': All grants are in place, no revocation or granting needed.')}}\n {% endif %}\n {% else %}\n {#-- We don't think there's any chance of previous grants having carried over. --#}\n {#-- Jump straight to granting what the user has configured. --#}\n {% set needs_revoking = {} %}\n {% set needs_granting = grant_config %}\n {% endif %}\n {% if needs_granting or needs_revoking %}\n {% set revoke_statement_list = get_dcl_statement_list(relation, needs_revoking, get_revoke_sql) %}\n {% set grant_statement_list = get_dcl_statement_list(relation, needs_granting, get_grant_sql) %}\n {% set dcl_statement_list = revoke_statement_list + grant_statement_list %}\n {% if dcl_statement_list %}\n {{ call_dcl_statements(dcl_statement_list) }}\n {% endif %}\n {% endif %}\n {% endif %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.run_query", "macro.dbt.get_show_grant_sql", "macro.dbt.get_dcl_statement_list", "macro.dbt.call_dcl_statements"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "grant_config", "type": null, "description": ""}, {"name": "should_revoke", "type": null, "description": ""}], "created_at": 1786586787.8935103, "supported_languages": null}, "macro.dbt.get_show_sql": {"name": "get_show_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/show.sql", "original_file_path": "macros/adapters/show.sql", "unique_id": "macro.dbt.get_show_sql", "macro_sql": "{% macro get_show_sql(compiled_code, sql_header, limit) -%}\n {%- if sql_header is not none -%}\n {{ sql_header }}\n {%- endif %}\n {{ get_limit_subquery_sql(compiled_code, limit) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_limit_subquery_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "compiled_code", "type": null, "description": ""}, {"name": "sql_header", "type": null, "description": ""}, {"name": "limit", "type": null, "description": ""}], "created_at": 1786586787.894205, "supported_languages": null}, "macro.dbt.get_limit_subquery_sql": {"name": "get_limit_subquery_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/show.sql", "original_file_path": "macros/adapters/show.sql", "unique_id": "macro.dbt.get_limit_subquery_sql", "macro_sql": "\n{%- macro get_limit_subquery_sql(sql, limit) -%}\n {{ adapter.dispatch('get_limit_sql', 'dbt')(sql, limit) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt.default__get_limit_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "sql", "type": null, "description": ""}, {"name": "limit", "type": null, "description": ""}], "created_at": 1786586787.894517, "supported_languages": null}, "macro.dbt.default__get_limit_sql": {"name": "default__get_limit_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/show.sql", "original_file_path": "macros/adapters/show.sql", "unique_id": "macro.dbt.default__get_limit_sql", "macro_sql": "{% macro default__get_limit_sql(sql, limit) %}\n {{ sql }}\n {% if limit is not none %}\n limit {{ limit }}\n {%- endif -%}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "sql", "type": null, "description": ""}, {"name": "limit", "type": null, "description": ""}], "created_at": 1786586787.8948286, "supported_languages": null}, "macro.dbt.make_intermediate_relation": {"name": "make_intermediate_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "unique_id": "macro.dbt.make_intermediate_relation", "macro_sql": "{% macro make_intermediate_relation(base_relation, suffix='__dbt_tmp') %}\n {{ return(adapter.dispatch('make_intermediate_relation', 'dbt')(base_relation, suffix)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__make_intermediate_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "base_relation", "type": null, "description": ""}, {"name": "suffix", "type": null, "description": ""}], "created_at": 1786586787.8960035, "supported_languages": null}, "macro.dbt.default__make_intermediate_relation": {"name": "default__make_intermediate_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "unique_id": "macro.dbt.default__make_intermediate_relation", "macro_sql": "{% macro default__make_intermediate_relation(base_relation, suffix) %}\n {{ return(default__make_temp_relation(base_relation, suffix)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__make_temp_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "base_relation", "type": null, "description": ""}, {"name": "suffix", "type": null, "description": ""}], "created_at": 1786586787.8962893, "supported_languages": null}, "macro.dbt.make_temp_relation": {"name": "make_temp_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "unique_id": "macro.dbt.make_temp_relation", "macro_sql": "{% macro make_temp_relation(base_relation, suffix='__dbt_tmp') %}\n {#-- This ensures microbatch batches get unique temp relations to avoid clobbering --#}\n {% if suffix == '__dbt_tmp' and model.batch %}\n {% set suffix = suffix ~ '_' ~ model.batch.id %}\n {% endif %}\n\n {{ return(adapter.dispatch('make_temp_relation', 'dbt')(base_relation, suffix)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__make_temp_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "base_relation", "type": null, "description": ""}, {"name": "suffix", "type": null, "description": ""}], "created_at": 1786586787.8969324, "supported_languages": null}, "macro.dbt.default__make_temp_relation": {"name": "default__make_temp_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "unique_id": "macro.dbt.default__make_temp_relation", "macro_sql": "{% macro default__make_temp_relation(base_relation, suffix) %}\n {%- set temp_identifier = base_relation.identifier ~ suffix -%}\n {%- set temp_relation = base_relation.incorporate(\n path={\"identifier\": temp_identifier}) -%}\n\n {{ return(temp_relation) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "base_relation", "type": null, "description": ""}, {"name": "suffix", "type": null, "description": ""}], "created_at": 1786586787.897407, "supported_languages": null}, "macro.dbt.make_backup_relation": {"name": "make_backup_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "unique_id": "macro.dbt.make_backup_relation", "macro_sql": "{% macro make_backup_relation(base_relation, backup_relation_type, suffix='__dbt_backup') %}\n {{ return(adapter.dispatch('make_backup_relation', 'dbt')(base_relation, backup_relation_type, suffix)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__make_backup_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "base_relation", "type": null, "description": ""}, {"name": "backup_relation_type", "type": null, "description": ""}, {"name": "suffix", "type": null, "description": ""}], "created_at": 1786586787.8978448, "supported_languages": null}, "macro.dbt.default__make_backup_relation": {"name": "default__make_backup_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "unique_id": "macro.dbt.default__make_backup_relation", "macro_sql": "{% macro default__make_backup_relation(base_relation, backup_relation_type, suffix) %}\n {%- set backup_identifier = base_relation.identifier ~ suffix -%}\n {%- set backup_relation = base_relation.incorporate(\n path={\"identifier\": backup_identifier},\n type=backup_relation_type\n ) -%}\n {{ return(backup_relation) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "base_relation", "type": null, "description": ""}, {"name": "backup_relation_type", "type": null, "description": ""}, {"name": "suffix", "type": null, "description": ""}], "created_at": 1786586787.8983934, "supported_languages": null}, "macro.dbt.truncate_relation": {"name": "truncate_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "unique_id": "macro.dbt.truncate_relation", "macro_sql": "{% macro truncate_relation(relation) -%}\n {{ return(adapter.dispatch('truncate_relation', 'dbt')(relation)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__truncate_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1786586787.8987386, "supported_languages": null}, "macro.dbt.default__truncate_relation": {"name": "default__truncate_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "unique_id": "macro.dbt.default__truncate_relation", "macro_sql": "{% macro default__truncate_relation(relation) -%}\n {% call statement('truncate_relation') -%}\n truncate table {{ relation.render() }}\n {%- endcall %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1786586787.8990703, "supported_languages": null}, "macro.dbt.get_or_create_relation": {"name": "get_or_create_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "unique_id": "macro.dbt.get_or_create_relation", "macro_sql": "{% macro get_or_create_relation(database, schema, identifier, type) -%}\n {{ return(adapter.dispatch('get_or_create_relation', 'dbt')(database, schema, identifier, type)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_or_create_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "database", "type": null, "description": ""}, {"name": "schema", "type": null, "description": ""}, {"name": "identifier", "type": null, "description": ""}, {"name": "type", "type": null, "description": ""}], "created_at": 1786586787.8994744, "supported_languages": null}, "macro.dbt.default__get_or_create_relation": {"name": "default__get_or_create_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "unique_id": "macro.dbt.default__get_or_create_relation", "macro_sql": "{% macro default__get_or_create_relation(database, schema, identifier, type) %}\n {%- set target_relation = adapter.get_relation(database=database, schema=schema, identifier=identifier) %}\n\n {% if target_relation %}\n {% do return([true, target_relation]) %}\n {% endif %}\n\n {%- set new_relation = api.Relation.create(\n database=database,\n schema=schema,\n identifier=identifier,\n type=type\n ) -%}\n {% do return([false, new_relation]) %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "database", "type": null, "description": ""}, {"name": "schema", "type": null, "description": ""}, {"name": "identifier", "type": null, "description": ""}, {"name": "type", "type": null, "description": ""}], "created_at": 1786586787.9005015, "supported_languages": null}, "macro.dbt.load_cached_relation": {"name": "load_cached_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "unique_id": "macro.dbt.load_cached_relation", "macro_sql": "{% macro load_cached_relation(relation) %}\n {% do return(adapter.get_relation(\n database=relation.database,\n schema=relation.schema,\n identifier=relation.identifier\n )) -%}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1786586787.900887, "supported_languages": null}, "macro.dbt.load_relation": {"name": "load_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "unique_id": "macro.dbt.load_relation", "macro_sql": "{% macro load_relation(relation) %}\n {{ return(load_cached_relation(relation)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.load_cached_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1786586787.901144, "supported_languages": null}, "macro.dbt.validate_sql": {"name": "validate_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/validate_sql.sql", "original_file_path": "macros/adapters/validate_sql.sql", "unique_id": "macro.dbt.validate_sql", "macro_sql": "{% macro validate_sql(sql) -%}\n {{ return(adapter.dispatch('validate_sql', 'dbt')(sql)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__validate_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "sql", "type": null, "description": ""}], "created_at": 1786586787.9016275, "supported_languages": null}, "macro.dbt.default__validate_sql": {"name": "default__validate_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/validate_sql.sql", "original_file_path": "macros/adapters/validate_sql.sql", "unique_id": "macro.dbt.default__validate_sql", "macro_sql": "{% macro default__validate_sql(sql) -%}\n {% call statement('validate_sql') -%}\n explain {{ sql }}\n {% endcall %}\n {{ return(load_result('validate_sql')) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "sql", "type": null, "description": ""}], "created_at": 1786586787.9020047, "supported_languages": null}, "macro.dbt.test_unique": {"name": "test_unique", "resource_type": "macro", "package_name": "dbt", "path": "tests/generic/builtin.sql", "original_file_path": "tests/generic/builtin.sql", "unique_id": "macro.dbt.test_unique", "macro_sql": "{% test unique(model, column_name) %}\n {% set macro = adapter.dispatch('test_unique', 'dbt') %}\n {{ macro(model, column_name) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt.default__test_unique"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1786586787.902733, "supported_languages": null}, "macro.dbt.test_not_null": {"name": "test_not_null", "resource_type": "macro", "package_name": "dbt", "path": "tests/generic/builtin.sql", "original_file_path": "tests/generic/builtin.sql", "unique_id": "macro.dbt.test_not_null", "macro_sql": "{% test not_null(model, column_name) %}\n {% set macro = adapter.dispatch('test_not_null', 'dbt') %}\n {{ macro(model, column_name) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt.default__test_not_null"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1786586787.90316, "supported_languages": null}, "macro.dbt.test_accepted_values": {"name": "test_accepted_values", "resource_type": "macro", "package_name": "dbt", "path": "tests/generic/builtin.sql", "original_file_path": "tests/generic/builtin.sql", "unique_id": "macro.dbt.test_accepted_values", "macro_sql": "{% test accepted_values(model, column_name, values, quote=True) %}\n {% set macro = adapter.dispatch('test_accepted_values', 'dbt') %}\n {{ macro(model, column_name, values, quote) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt.default__test_accepted_values"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1786586787.903744, "supported_languages": null}, "macro.dbt.test_relationships": {"name": "test_relationships", "resource_type": "macro", "package_name": "dbt", "path": "tests/generic/builtin.sql", "original_file_path": "tests/generic/builtin.sql", "unique_id": "macro.dbt.test_relationships", "macro_sql": "{% test relationships(model, column_name, to, field) %}\n {% set macro = adapter.dispatch('test_relationships', 'dbt') %}\n {{ macro(model, column_name, to, field) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt.default__test_relationships"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1786586787.904267, "supported_languages": null}, "macro.fivetran_utils.fill_staging_columns": {"name": "fill_staging_columns", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/fill_staging_columns.sql", "original_file_path": "macros/fill_staging_columns.sql", "unique_id": "macro.fivetran_utils.fill_staging_columns", "macro_sql": "{% macro fill_staging_columns(source_columns, staging_columns) %}\n\n{%- set source_column_names = source_columns|map(attribute='name')|map('lower')|list -%}\n{%- set using_source_casing = var('fivetran_using_source_casing', false) -%}\n\n{%- for column in staging_columns %}\n {%- if column.name|lower in source_column_names %}\n {%- if using_source_casing %}\n {%- set column_alias = column.alias if 'alias' in column else column.name %}\n {{ adapter.quote(column.name) }} as {{ adapter.quote(column_alias|upper if target.type == 'snowflake' else column_alias) }}\n {%- else %}\n {{ fivetran_utils.quote_column(column) }} as\n {%- if 'alias' in column %} {{ column.alias }}{% else %} {{ fivetran_utils.quote_column(column) }}{% endif %}\n {%- endif %}\n {%- else %}\n cast(null as {{ column.datatype }}) as\n {%- if 'alias' in column %} {{ column.alias }}{% else %} {{ fivetran_utils.quote_column(column) }}{% endif %}\n {%- endif %}{{ ',' if not loop.last }}\n{%- endfor %}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.quote_column"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "source_columns", "type": null, "description": ""}, {"name": "staging_columns", "type": null, "description": ""}], "created_at": 1786586787.906701, "supported_languages": null}, "macro.fivetran_utils.quote_column": {"name": "quote_column", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/fill_staging_columns.sql", "original_file_path": "macros/fill_staging_columns.sql", "unique_id": "macro.fivetran_utils.quote_column", "macro_sql": "{% macro quote_column(column) %}\n {%- if 'quote' in column %}\n {%- if column.quote %}\n {%- if target.type in ('bigquery', 'spark', 'databricks') %}\n `{{ column.name }}`\n {%- elif target.type == 'snowflake' %}\n \"{{ column.name | upper }}\"\n {%- else %}\n \"{{ column.name }}\"\n {%- endif %}\n {%- else %}{{ column.name }}\n {%- endif %}\n {%- else %}{{ column.name }}\n {%- endif %}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "column", "type": null, "description": ""}], "created_at": 1786586787.90758, "supported_languages": null}, "macro.fivetran_utils.string_agg": {"name": "string_agg", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/string_agg.sql", "original_file_path": "macros/string_agg.sql", "unique_id": "macro.fivetran_utils.string_agg", "macro_sql": "{% macro string_agg(field_to_agg, delimiter) -%}\n\n{{ adapter.dispatch('string_agg', 'fivetran_utils') (field_to_agg, delimiter) }}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.default__string_agg"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field_to_agg", "type": null, "description": ""}, {"name": "delimiter", "type": null, "description": ""}], "created_at": 1786586787.9081917, "supported_languages": null}, "macro.fivetran_utils.default__string_agg": {"name": "default__string_agg", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/string_agg.sql", "original_file_path": "macros/string_agg.sql", "unique_id": "macro.fivetran_utils.default__string_agg", "macro_sql": "{% macro default__string_agg(field_to_agg, delimiter) %}\n string_agg({{ field_to_agg }}, {{ delimiter }})\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field_to_agg", "type": null, "description": ""}, {"name": "delimiter", "type": null, "description": ""}], "created_at": 1786586787.9084206, "supported_languages": null}, "macro.fivetran_utils.snowflake__string_agg": {"name": "snowflake__string_agg", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/string_agg.sql", "original_file_path": "macros/string_agg.sql", "unique_id": "macro.fivetran_utils.snowflake__string_agg", "macro_sql": "{% macro snowflake__string_agg(field_to_agg, delimiter) %}\n listagg({{ field_to_agg }}, {{ delimiter }})\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field_to_agg", "type": null, "description": ""}, {"name": "delimiter", "type": null, "description": ""}], "created_at": 1786586787.9086375, "supported_languages": null}, "macro.fivetran_utils.redshift__string_agg": {"name": "redshift__string_agg", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/string_agg.sql", "original_file_path": "macros/string_agg.sql", "unique_id": "macro.fivetran_utils.redshift__string_agg", "macro_sql": "{% macro redshift__string_agg(field_to_agg, delimiter) %}\n listagg({{ field_to_agg }}, {{ delimiter }})\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field_to_agg", "type": null, "description": ""}, {"name": "delimiter", "type": null, "description": ""}], "created_at": 1786586787.9088511, "supported_languages": null}, "macro.fivetran_utils.spark__string_agg": {"name": "spark__string_agg", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/string_agg.sql", "original_file_path": "macros/string_agg.sql", "unique_id": "macro.fivetran_utils.spark__string_agg", "macro_sql": "{% macro spark__string_agg(field_to_agg, delimiter) %}\n -- collect set will remove duplicates\n replace(replace(replace(cast( collect_set({{ field_to_agg }}) as string), '[', ''), ']', ''), ', ', {{ delimiter }} )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field_to_agg", "type": null, "description": ""}, {"name": "delimiter", "type": null, "description": ""}], "created_at": 1786586787.9090948, "supported_languages": null}, "macro.fivetran_utils.add_dbt_source_relation": {"name": "add_dbt_source_relation", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/add_dbt_source_relation.sql", "original_file_path": "macros/add_dbt_source_relation.sql", "unique_id": "macro.fivetran_utils.add_dbt_source_relation", "macro_sql": "{% macro add_dbt_source_relation() %}\n\n{% if var('union_schemas', none) or var('union_databases', none) %}\n, _dbt_source_relation\n{% endif %}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1786586787.90953, "supported_languages": null}, "macro.fivetran_utils.remove_prefix_from_columns": {"name": "remove_prefix_from_columns", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/remove_prefix_from_columns.sql", "original_file_path": "macros/remove_prefix_from_columns.sql", "unique_id": "macro.fivetran_utils.remove_prefix_from_columns", "macro_sql": "{% macro remove_prefix_from_columns(columns, prefix='', exclude=[]) %}\n\n {%- for col in columns if col.name not in exclude -%}\n {%- if col.name[:prefix|length]|lower == prefix -%}\n {{ col.name }} as {{ col.name[prefix|length:] }}\n {%- else -%}\n {{ col.name }}\n {%- endif -%}\n {%- if not loop.last -%},{%- endif %}\n {% endfor -%}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "columns", "type": null, "description": ""}, {"name": "prefix", "type": null, "description": ""}, {"name": "exclude", "type": null, "description": ""}], "created_at": 1786586787.9111025, "supported_languages": null}, "macro.fivetran_utils.pivot_json_extract": {"name": "pivot_json_extract", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/pivot_json_extract.sql", "original_file_path": "macros/pivot_json_extract.sql", "unique_id": "macro.fivetran_utils.pivot_json_extract", "macro_sql": "{% macro pivot_json_extract(string, list_of_properties) %}\n\n{%- for property in list_of_properties -%}\n{%- if property is mapping -%}\nreplace( {{ fivetran_utils.json_extract(string, property.name) }}, '\"', '') as {{ property.alias if property.alias else property.name | replace(' ', '_') | replace('.', '_') | lower }}\n\n{%- else -%}\nreplace( {{ fivetran_utils.json_extract(string, property) }}, '\"', '') as {{ property | replace(' ', '_') | lower }}\n\n{%- endif -%}\n{%- if not loop.last -%},{%- endif %}\n{% endfor -%}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.json_extract"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "string", "type": null, "description": ""}, {"name": "list_of_properties", "type": null, "description": ""}], "created_at": 1786586787.9123974, "supported_languages": null}, "macro.fivetran_utils.max_bool": {"name": "max_bool", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/max_bool.sql", "original_file_path": "macros/max_bool.sql", "unique_id": "macro.fivetran_utils.max_bool", "macro_sql": "{% macro max_bool(boolean_field) -%}\n\n{{ adapter.dispatch('max_bool', 'fivetran_utils') (boolean_field) }}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.default__max_bool"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "boolean_field", "type": null, "description": ""}], "created_at": 1786586787.912872, "supported_languages": null}, "macro.fivetran_utils.default__max_bool": {"name": "default__max_bool", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/max_bool.sql", "original_file_path": "macros/max_bool.sql", "unique_id": "macro.fivetran_utils.default__max_bool", "macro_sql": "{% macro default__max_bool(boolean_field) %}\n\n bool_or( {{ boolean_field }} )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "boolean_field", "type": null, "description": ""}], "created_at": 1786586787.913076, "supported_languages": null}, "macro.fivetran_utils.snowflake__max_bool": {"name": "snowflake__max_bool", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/max_bool.sql", "original_file_path": "macros/max_bool.sql", "unique_id": "macro.fivetran_utils.snowflake__max_bool", "macro_sql": "{% macro snowflake__max_bool(boolean_field) %}\n\n max( {{ boolean_field }} )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "boolean_field", "type": null, "description": ""}], "created_at": 1786586787.9132469, "supported_languages": null}, "macro.fivetran_utils.bigquery__max_bool": {"name": "bigquery__max_bool", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/max_bool.sql", "original_file_path": "macros/max_bool.sql", "unique_id": "macro.fivetran_utils.bigquery__max_bool", "macro_sql": "{% macro bigquery__max_bool(boolean_field) %}\n\n max( {{ boolean_field }} )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "boolean_field", "type": null, "description": ""}], "created_at": 1786586787.9134133, "supported_languages": null}, "macro.fivetran_utils.dummy_coalesce_value": {"name": "dummy_coalesce_value", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/dummy_coalesce_value.sql", "original_file_path": "macros/dummy_coalesce_value.sql", "unique_id": "macro.fivetran_utils.dummy_coalesce_value", "macro_sql": "{% macro dummy_coalesce_value(column) %}\n\n{% set coalesce_value = {\n 'STRING': \"'DUMMY_STRING'\",\n 'BOOLEAN': 'null',\n 'INT': 999999999,\n 'FLOAT': 999999999.99,\n 'TIMESTAMP': 'cast(\"2099-12-31\" as timestamp)',\n 'DATE': 'cast(\"2099-12-31\" as date)',\n} %}\n\n{% if column.is_float() %}\n{{ return(coalesce_value['FLOAT']) }}\n\n{% elif column.is_numeric() %}\n{{ return(coalesce_value['INT']) }}\n\n{% elif column.is_string() %}\n{{ return(coalesce_value['STRING']) }}\n\n{% elif column.data_type|lower == 'boolean' %}\n{{ return(coalesce_value['BOOLEAN']) }}\n\n{% elif 'timestamp' in column.data_type|lower %}\n{{ return(coalesce_value['TIMESTAMP']) }}\n\n{% elif 'date' in column.data_type|lower %}\n{{ return(coalesce_value['DATE']) }}\n\n{% elif 'int' in column.data_type|lower %}\n{{ return(coalesce_value['INT']) }}\n\n{% endif %}\n\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "column", "type": null, "description": ""}], "created_at": 1786586787.9155846, "supported_languages": null}, "macro.fivetran_utils.source_relation": {"name": "source_relation", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/source_relation.sql", "original_file_path": "macros/source_relation.sql", "unique_id": "macro.fivetran_utils.source_relation", "macro_sql": "{% macro source_relation(union_schema_variable='union_schemas', union_database_variable='union_databases') -%}\n\n{{ adapter.dispatch('source_relation', 'fivetran_utils') (union_schema_variable, union_database_variable) }}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.default__source_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "union_schema_variable", "type": null, "description": ""}, {"name": "union_database_variable", "type": null, "description": ""}], "created_at": 1786586787.9162738, "supported_languages": null}, "macro.fivetran_utils.default__source_relation": {"name": "default__source_relation", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/source_relation.sql", "original_file_path": "macros/source_relation.sql", "unique_id": "macro.fivetran_utils.default__source_relation", "macro_sql": "{% macro default__source_relation(union_schema_variable, union_database_variable) %}\n\n{% if var(union_schema_variable, none) %}\n, case\n {% for schema in var(union_schema_variable) %}\n when lower(replace(replace(_dbt_source_relation,'\"',''),'`','')) like '%.{{ schema|lower }}.%' then '{{ schema|lower }}'\n {% endfor %}\n end as source_relation\n{% elif var(union_database_variable, none) %}\n, case\n {% for database in var(union_database_variable) %}\n when lower(replace(replace(_dbt_source_relation,'\"',''),'`','')) like '%{{ database|lower }}.%' then '{{ database|lower }}'\n {% endfor %}\n end as source_relation\n{% else %}\n, cast('' as {{ dbt.type_string() }}) as source_relation\n{% endif %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "union_schema_variable", "type": null, "description": ""}, {"name": "union_database_variable", "type": null, "description": ""}], "created_at": 1786586787.9172251, "supported_languages": null}, "macro.fivetran_utils.calculated_fields": {"name": "calculated_fields", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/calculated_fields.sql", "original_file_path": "macros/calculated_fields.sql", "unique_id": "macro.fivetran_utils.calculated_fields", "macro_sql": "{% macro calculated_fields(variable) -%}\n\n{% if var(variable, none) %}\n {% for field in var(variable) %}\n , {{ field.transform_sql }} as {{ field.name }} \n {% endfor %}\n{% endif %}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "variable", "type": null, "description": ""}], "created_at": 1786586787.9178388, "supported_languages": null}, "macro.fivetran_utils.enabled_vars_one_true": {"name": "enabled_vars_one_true", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/enabled_vars_one_true.sql", "original_file_path": "macros/enabled_vars_one_true.sql", "unique_id": "macro.fivetran_utils.enabled_vars_one_true", "macro_sql": "{% macro enabled_vars_one_true(vars) %}\n\n{% for v in vars %}\n \n {% if var(v, False) == True %}\n {{ return(True) }}\n {% endif %}\n\n{% endfor %}\n\n{{ return(False) }}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "vars", "type": null, "description": ""}], "created_at": 1786586787.9185042, "supported_languages": null}, "macro.fivetran_utils.try_cast": {"name": "try_cast", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/try_cast.sql", "original_file_path": "macros/try_cast.sql", "unique_id": "macro.fivetran_utils.try_cast", "macro_sql": "{% macro try_cast(field, type) %}\n {{ adapter.dispatch('try_cast', 'fivetran_utils') (field, type) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.postgres__try_cast"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field", "type": null, "description": ""}, {"name": "type", "type": null, "description": ""}], "created_at": 1786586787.9193823, "supported_languages": null}, "macro.fivetran_utils.default__try_cast": {"name": "default__try_cast", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/try_cast.sql", "original_file_path": "macros/try_cast.sql", "unique_id": "macro.fivetran_utils.default__try_cast", "macro_sql": "{% macro default__try_cast(field, type) %}\n {# most databases don't support this function yet\n so we just need to use cast #}\n cast({{field}} as {{type}})\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field", "type": null, "description": ""}, {"name": "type", "type": null, "description": ""}], "created_at": 1786586787.9196322, "supported_languages": null}, "macro.fivetran_utils.redshift__try_cast": {"name": "redshift__try_cast", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/try_cast.sql", "original_file_path": "macros/try_cast.sql", "unique_id": "macro.fivetran_utils.redshift__try_cast", "macro_sql": "{% macro redshift__try_cast(field, type) %}\n{%- if type == 'numeric' -%}\n\n case\n when trim({{field}}) ~ '^(0|[1-9][0-9]*)$' then trim({{field}})\n else null\n end::{{type}}\n\n{% else %}\n {{ exceptions.raise_compiler_error(\n \"non-numeric datatypes are not currently supported\") }}\n\n{% endif %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field", "type": null, "description": ""}, {"name": "type", "type": null, "description": ""}], "created_at": 1786586787.9201803, "supported_languages": null}, "macro.fivetran_utils.postgres__try_cast": {"name": "postgres__try_cast", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/try_cast.sql", "original_file_path": "macros/try_cast.sql", "unique_id": "macro.fivetran_utils.postgres__try_cast", "macro_sql": "{% macro postgres__try_cast(field, type) %}\n{%- if type == 'numeric' -%}\n\n case\n when replace(cast({{field}} as varchar),cast(' ' as varchar),cast('' as varchar)) ~ '^(0|[1-9][0-9]*)$' \n then replace(cast({{field}} as varchar),cast(' ' as varchar),cast('' as varchar))\n else null\n end::{{type}}\n\n{% else %}\n {{ exceptions.raise_compiler_error(\n \"non-numeric datatypes are not currently supported\") }}\n\n{% endif %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field", "type": null, "description": ""}, {"name": "type", "type": null, "description": ""}], "created_at": 1786586787.920794, "supported_languages": null}, "macro.fivetran_utils.snowflake__try_cast": {"name": "snowflake__try_cast", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/try_cast.sql", "original_file_path": "macros/try_cast.sql", "unique_id": "macro.fivetran_utils.snowflake__try_cast", "macro_sql": "{% macro snowflake__try_cast(field, type) %}\n try_cast(cast({{field}} as varchar) as {{type}})\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field", "type": null, "description": ""}, {"name": "type", "type": null, "description": ""}], "created_at": 1786586787.9210474, "supported_languages": null}, "macro.fivetran_utils.bigquery__try_cast": {"name": "bigquery__try_cast", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/try_cast.sql", "original_file_path": "macros/try_cast.sql", "unique_id": "macro.fivetran_utils.bigquery__try_cast", "macro_sql": "{% macro bigquery__try_cast(field, type) %}\n safe_cast({{field}} as {{type}})\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field", "type": null, "description": ""}, {"name": "type", "type": null, "description": ""}], "created_at": 1786586787.921273, "supported_languages": null}, "macro.fivetran_utils.spark__try_cast": {"name": "spark__try_cast", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/try_cast.sql", "original_file_path": "macros/try_cast.sql", "unique_id": "macro.fivetran_utils.spark__try_cast", "macro_sql": "{% macro spark__try_cast(field, type) %}\n try_cast({{field}} as {{type}})\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field", "type": null, "description": ""}, {"name": "type", "type": null, "description": ""}], "created_at": 1786586787.9214916, "supported_languages": null}, "macro.fivetran_utils.sqlserver__try_cast": {"name": "sqlserver__try_cast", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/try_cast.sql", "original_file_path": "macros/try_cast.sql", "unique_id": "macro.fivetran_utils.sqlserver__try_cast", "macro_sql": "{% macro sqlserver__try_cast(field, type) %}\n try_cast({{field}} as {{type}})\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field", "type": null, "description": ""}, {"name": "type", "type": null, "description": ""}], "created_at": 1786586787.9217043, "supported_languages": null}, "macro.fivetran_utils.json_parse": {"name": "json_parse", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/json_parse.sql", "original_file_path": "macros/json_parse.sql", "unique_id": "macro.fivetran_utils.json_parse", "macro_sql": "{% macro json_parse(string, string_path) -%}\n\n{{ adapter.dispatch('json_parse', 'fivetran_utils') (string, string_path) }}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.postgres__json_parse"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "string", "type": null, "description": ""}, {"name": "string_path", "type": null, "description": ""}], "created_at": 1786586787.9228547, "supported_languages": null}, "macro.fivetran_utils.default__json_parse": {"name": "default__json_parse", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/json_parse.sql", "original_file_path": "macros/json_parse.sql", "unique_id": "macro.fivetran_utils.default__json_parse", "macro_sql": "{% macro default__json_parse(string, string_path) %}\n\n json_extract_path_text({{string}}, {%- for s in string_path -%}'{{ s }}'{%- if not loop.last -%},{%- endif -%}{%- endfor -%} )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "string", "type": null, "description": ""}, {"name": "string_path", "type": null, "description": ""}], "created_at": 1786586787.9232955, "supported_languages": null}, "macro.fivetran_utils.redshift__json_parse": {"name": "redshift__json_parse", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/json_parse.sql", "original_file_path": "macros/json_parse.sql", "unique_id": "macro.fivetran_utils.redshift__json_parse", "macro_sql": "{% macro redshift__json_parse(string, string_path) %}\n\n json_extract_path_text({{string}}, {%- for s in string_path -%}'{{ s }}'{%- if not loop.last -%},{%- endif -%}{%- endfor -%} )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "string", "type": null, "description": ""}, {"name": "string_path", "type": null, "description": ""}], "created_at": 1786586787.9237049, "supported_languages": null}, "macro.fivetran_utils.bigquery__json_parse": {"name": "bigquery__json_parse", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/json_parse.sql", "original_file_path": "macros/json_parse.sql", "unique_id": "macro.fivetran_utils.bigquery__json_parse", "macro_sql": "{% macro bigquery__json_parse(string, string_path) %}\n\n \n json_extract_scalar({{string}}, '$.{%- for s in string_path -%}{{ s }}{%- if not loop.last -%}.{%- endif -%}{%- endfor -%} ')\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "string", "type": null, "description": ""}, {"name": "string_path", "type": null, "description": ""}], "created_at": 1786586787.924109, "supported_languages": null}, "macro.fivetran_utils.postgres__json_parse": {"name": "postgres__json_parse", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/json_parse.sql", "original_file_path": "macros/json_parse.sql", "unique_id": "macro.fivetran_utils.postgres__json_parse", "macro_sql": "{% macro postgres__json_parse(string, string_path) %}\n\n {{string}}::json #>> '{ {%- for s in string_path -%}{{ s }}{%- if not loop.last -%},{%- endif -%}{%- endfor -%} }'\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "string", "type": null, "description": ""}, {"name": "string_path", "type": null, "description": ""}], "created_at": 1786586787.924496, "supported_languages": null}, "macro.fivetran_utils.snowflake__json_parse": {"name": "snowflake__json_parse", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/json_parse.sql", "original_file_path": "macros/json_parse.sql", "unique_id": "macro.fivetran_utils.snowflake__json_parse", "macro_sql": "{% macro snowflake__json_parse(string, string_path) %}\n\n parse_json( {{string}} ) {%- for s in string_path -%}{% if s is number %}[{{ s }}]{% else %}['{{ s }}']{% endif %}{%- endfor -%}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "string", "type": null, "description": ""}, {"name": "string_path", "type": null, "description": ""}], "created_at": 1786586787.9249346, "supported_languages": null}, "macro.fivetran_utils.spark__json_parse": {"name": "spark__json_parse", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/json_parse.sql", "original_file_path": "macros/json_parse.sql", "unique_id": "macro.fivetran_utils.spark__json_parse", "macro_sql": "{% macro spark__json_parse(string, string_path) %}\n\n {{string}} : {%- for s in string_path -%}{% if s is number %}[{{ s }}]{% else %}['{{ s }}']{% endif %}{%- endfor -%}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "string", "type": null, "description": ""}, {"name": "string_path", "type": null, "description": ""}], "created_at": 1786586787.9253645, "supported_languages": null}, "macro.fivetran_utils.sqlserver__json_parse": {"name": "sqlserver__json_parse", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/json_parse.sql", "original_file_path": "macros/json_parse.sql", "unique_id": "macro.fivetran_utils.sqlserver__json_parse", "macro_sql": "{% macro sqlserver__json_parse(string, string_path) %}\n\n json_value({{string}}, '$.{%- for s in string_path -%}{{ s }}{%- if not loop.last -%}.{%- endif -%}{%- endfor -%} ')\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "string", "type": null, "description": ""}, {"name": "string_path", "type": null, "description": ""}], "created_at": 1786586787.9257488, "supported_languages": null}, "macro.fivetran_utils.duckdb__json_parse": {"name": "duckdb__json_parse", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/json_parse.sql", "original_file_path": "macros/json_parse.sql", "unique_id": "macro.fivetran_utils.duckdb__json_parse", "macro_sql": "{% macro duckdb__json_parse(string, string_path) %}\n\n json_extract_string({{string}}, '${%- for s in string_path -%}{% if s is number %}[{{ s }}]{% else %}.{{ s }}{% endif %}{%- endfor -%}')\n \n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "string", "type": null, "description": ""}, {"name": "string_path", "type": null, "description": ""}], "created_at": 1786586787.926201, "supported_languages": null}, "macro.fivetran_utils.fill_pass_through_columns": {"name": "fill_pass_through_columns", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/fill_pass_through_columns.sql", "original_file_path": "macros/fill_pass_through_columns.sql", "unique_id": "macro.fivetran_utils.fill_pass_through_columns", "macro_sql": "{% macro fill_pass_through_columns(pass_through_variable) %}\n\n{% if var(pass_through_variable) %}\n {% for field in var(pass_through_variable) %}\n {% if field is mapping %}\n {% if field.transform_sql %}\n , {{ field.transform_sql }} as {{ field.alias if field.alias else field.name }}\n {% else %}\n , {{ field.alias if field.alias else field.name }}\n {% endif %}\n {% else %}\n , {{ field }}\n {% endif %}\n {% endfor %}\n{% endif %}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "pass_through_variable", "type": null, "description": ""}], "created_at": 1786586787.927355, "supported_languages": null}, "macro.fivetran_utils.union_relations": {"name": "union_relations", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/union_relations.sql", "original_file_path": "macros/union_relations.sql", "unique_id": "macro.fivetran_utils.union_relations", "macro_sql": "{%- macro union_relations(relations, aliases=none, column_override=none, include=[], exclude=[], source_column_name=none) -%}\n\n {%- if exclude and include -%}\n {{ exceptions.raise_compiler_error(\"Both an exclude and include list were provided to the `union` macro. Only one is allowed\") }}\n {%- endif -%}\n\n {#-- Prevent querying of db in parsing mode. This works because this macro does not create any new refs. -#}\n {%- if not execute %}\n {{ return('') }}\n {% endif -%}\n\n {%- set column_override = column_override if column_override is not none else {} -%}\n {%- set source_column_name = source_column_name if source_column_name is not none else '_dbt_source_relation' -%}\n\n {%- set relation_columns = {} -%}\n {%- set column_superset = {} -%}\n\n {%- for relation in relations -%}\n\n {%- do relation_columns.update({relation: []}) -%}\n\n {%- do dbt_utils._is_relation(relation, 'union_relations') -%}\n {%- set cols = adapter.get_columns_in_relation(relation) -%}\n {%- for col in cols -%}\n\n {#- If an exclude list was provided and the column is in the list, do nothing -#}\n {%- if exclude and col.column in exclude -%}\n\n {#- If an include list was provided and the column is not in the list, do nothing -#}\n {%- elif include and col.column not in include -%}\n\n {#- Otherwise add the column to the column superset -#}\n {%- else -%}\n\n {#- update the list of columns in this relation -#}\n {%- do relation_columns[relation].append(col.column) -%}\n\n {%- if col.column in column_superset -%}\n\n {%- set stored = column_superset[col.column] -%}\n {%- if col.is_string() and stored.is_string() and col.string_size() > stored.string_size() -%}\n\n {%- do column_superset.update({col.column: col}) -%}\n\n {%- endif %}\n\n {%- else -%}\n\n {%- do column_superset.update({col.column: col}) -%}\n\n {%- endif -%}\n\n {%- endif -%}\n\n {%- endfor -%}\n {%- endfor -%}\n\n {%- set ordered_column_names = column_superset.keys() -%}\n\n {%- for relation in relations %}\n\n (\n select\n\n cast({{ dbt.string_literal(relation) }} as {{ dbt.type_string() }}) as {{ source_column_name }},\n {% for col_name in ordered_column_names -%}\n\n {%- set col = column_superset[col_name] %}\n {%- set col_type = column_override.get(col.column, col.data_type) %}\n {%- set col_name = adapter.quote(col_name) if col_name in relation_columns[relation] else 'null' %}\n cast({{ col_name }} as {{ col_type }}) as {{ col.quoted }} {% if not loop.last %},{% endif -%}\n\n {%- endfor %}\n\n from {{ aliases[loop.index0] if aliases else relation }}\n )\n\n {% if not loop.last -%}\n union all\n {% endif -%}\n\n {%- endfor -%}\n\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt_utils._is_relation", "macro.dbt.string_literal", "macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relations", "type": null, "description": ""}, {"name": "aliases", "type": null, "description": ""}, {"name": "column_override", "type": null, "description": ""}, {"name": "include", "type": null, "description": ""}, {"name": "exclude", "type": null, "description": ""}, {"name": "source_column_name", "type": null, "description": ""}], "created_at": 1786586787.9322238, "supported_languages": null}, "macro.fivetran_utils.union_tables": {"name": "union_tables", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/union_relations.sql", "original_file_path": "macros/union_relations.sql", "unique_id": "macro.fivetran_utils.union_tables", "macro_sql": "{%- macro union_tables(tables, column_override=none, include=[], exclude=[], source_column_name='_dbt_source_table') -%}\n\n {%- do exceptions.warn(\"Warning: the `union_tables` macro is no longer supported and will be deprecated in a future release of dbt-utils. Use the `union_relations` macro instead\") -%}\n\n {{ return(dbt_utils.union_relations(tables, column_override, include, exclude, source_column_name)) }}\n\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt_utils.union_relations"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "tables", "type": null, "description": ""}, {"name": "column_override", "type": null, "description": ""}, {"name": "include", "type": null, "description": ""}, {"name": "exclude", "type": null, "description": ""}, {"name": "source_column_name", "type": null, "description": ""}], "created_at": 1786586787.932846, "supported_languages": null}, "macro.fivetran_utils.ceiling": {"name": "ceiling", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/ceiling.sql", "original_file_path": "macros/ceiling.sql", "unique_id": "macro.fivetran_utils.ceiling", "macro_sql": "{% macro ceiling(num) -%}\n\n{{ adapter.dispatch('ceiling', 'fivetran_utils') (num) }}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.default__ceiling"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "num", "type": null, "description": ""}], "created_at": 1786586787.933311, "supported_languages": null}, "macro.fivetran_utils.default__ceiling": {"name": "default__ceiling", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/ceiling.sql", "original_file_path": "macros/ceiling.sql", "unique_id": "macro.fivetran_utils.default__ceiling", "macro_sql": "{% macro default__ceiling(num) %}\n ceiling({{ num }})\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "num", "type": null, "description": ""}], "created_at": 1786586787.9335, "supported_languages": null}, "macro.fivetran_utils.snowflake__ceiling": {"name": "snowflake__ceiling", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/ceiling.sql", "original_file_path": "macros/ceiling.sql", "unique_id": "macro.fivetran_utils.snowflake__ceiling", "macro_sql": "{% macro snowflake__ceiling(num) %}\n ceil({{ num }})\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "num", "type": null, "description": ""}], "created_at": 1786586787.933677, "supported_languages": null}, "macro.fivetran_utils.json_extract": {"name": "json_extract", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/json_extract.sql", "original_file_path": "macros/json_extract.sql", "unique_id": "macro.fivetran_utils.json_extract", "macro_sql": "{% macro json_extract(string, string_path) -%}\n\n{{ adapter.dispatch('json_extract', 'fivetran_utils') (string, string_path) }}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.postgres__json_extract"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "string", "type": null, "description": ""}, {"name": "string_path", "type": null, "description": ""}], "created_at": 1786586787.9343817, "supported_languages": null}, "macro.fivetran_utils.default__json_extract": {"name": "default__json_extract", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/json_extract.sql", "original_file_path": "macros/json_extract.sql", "unique_id": "macro.fivetran_utils.default__json_extract", "macro_sql": "{% macro default__json_extract(string, string_path) %}\n\n json_extract_path_text({{string}}, {{ \"'\" ~ string_path ~ \"'\" }} )\n \n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "string", "type": null, "description": ""}, {"name": "string_path", "type": null, "description": ""}], "created_at": 1786586787.9346516, "supported_languages": null}, "macro.fivetran_utils.snowflake__json_extract": {"name": "snowflake__json_extract", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/json_extract.sql", "original_file_path": "macros/json_extract.sql", "unique_id": "macro.fivetran_utils.snowflake__json_extract", "macro_sql": "{% macro snowflake__json_extract(string, string_path) %}\n\n json_extract_path_text(try_parse_json( {{string}} ), {{ \"'\" ~ string_path ~ \"'\" }} )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "string", "type": null, "description": ""}, {"name": "string_path", "type": null, "description": ""}], "created_at": 1786586787.9349253, "supported_languages": null}, "macro.fivetran_utils.redshift__json_extract": {"name": "redshift__json_extract", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/json_extract.sql", "original_file_path": "macros/json_extract.sql", "unique_id": "macro.fivetran_utils.redshift__json_extract", "macro_sql": "{% macro redshift__json_extract(string, string_path) %}\n\n case when is_valid_json( {{string}} ) then json_extract_path_text({{string}}, {{ \"'\" ~ string_path ~ \"'\" }} ) else null end\n \n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "string", "type": null, "description": ""}, {"name": "string_path", "type": null, "description": ""}], "created_at": 1786586787.9352167, "supported_languages": null}, "macro.fivetran_utils.bigquery__json_extract": {"name": "bigquery__json_extract", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/json_extract.sql", "original_file_path": "macros/json_extract.sql", "unique_id": "macro.fivetran_utils.bigquery__json_extract", "macro_sql": "{% macro bigquery__json_extract(string, string_path) %}\n\n json_extract_scalar({{string}}, {{ \"'$.\" ~ string_path ~ \"'\" }} )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "string", "type": null, "description": ""}, {"name": "string_path", "type": null, "description": ""}], "created_at": 1786586787.935469, "supported_languages": null}, "macro.fivetran_utils.postgres__json_extract": {"name": "postgres__json_extract", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/json_extract.sql", "original_file_path": "macros/json_extract.sql", "unique_id": "macro.fivetran_utils.postgres__json_extract", "macro_sql": "{% macro postgres__json_extract(string, string_path) %}\n\n {{string}}::json->>{{\"'\" ~ string_path ~ \"'\" }}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "string", "type": null, "description": ""}, {"name": "string_path", "type": null, "description": ""}], "created_at": 1786586787.9357188, "supported_languages": null}, "macro.fivetran_utils.partition_by_source_relation": {"name": "partition_by_source_relation", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/partition_by_source_relation.sql", "original_file_path": "macros/partition_by_source_relation.sql", "unique_id": "macro.fivetran_utils.partition_by_source_relation", "macro_sql": "{% macro partition_by_source_relation(package_name, has_other_partitions='yes', alias=None, package_prefix_union_variable=true) %}\n {{ return(adapter.dispatch('partition_by_source_relation', 'fivetran_utils')(package_name, has_other_partitions, alias, package_prefix_union_variable)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.default__partition_by_source_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "package_name", "type": null, "description": ""}, {"name": "has_other_partitions", "type": null, "description": ""}, {"name": "alias", "type": null, "description": ""}, {"name": "package_prefix_union_variable", "type": null, "description": ""}], "created_at": 1786586787.9366002, "supported_languages": null}, "macro.fivetran_utils.default__partition_by_source_relation": {"name": "default__partition_by_source_relation", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/partition_by_source_relation.sql", "original_file_path": "macros/partition_by_source_relation.sql", "unique_id": "macro.fivetran_utils.default__partition_by_source_relation", "macro_sql": "{% macro default__partition_by_source_relation(package_name, has_other_partitions='yes', alias=None, package_prefix_union_variable=true) -%}\n\n{%- if package_prefix_union_variable %}\n {%- set union_schemas_var = package_name ~ '_union_schemas' -%}\n {%- set union_databases_var = package_name ~ '_union_databases' -%}\n{%- else %}\n {%- set union_schemas_var = 'union_schemas' -%}\n {%- set union_databases_var = 'union_databases' -%}\n{%- endif -%}\n\n{%- set is_unioning = var(union_schemas_var, [])|length > 1 or var(union_databases_var, [])|length > 1 or var(package_name ~ '_sources', [])|length > 1 -%}\n{%- set prefix = '' if alias is none else alias ~ '.' -%}\n\n{%- if has_other_partitions == 'no' -%}\n {{- 'partition by ' ~ prefix ~ 'source_relation' if is_unioning else '' -}}\n{%- else -%}\n {{- ', ' ~ prefix ~ 'source_relation' if is_unioning else '' -}}\n{%- endif -%}\n\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "package_name", "type": null, "description": ""}, {"name": "has_other_partitions", "type": null, "description": ""}, {"name": "alias", "type": null, "description": ""}, {"name": "package_prefix_union_variable", "type": null, "description": ""}], "created_at": 1786586787.9382153, "supported_languages": null}, "macro.fivetran_utils.empty_variable_warning": {"name": "empty_variable_warning", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/empty_variable_warning.sql", "original_file_path": "macros/empty_variable_warning.sql", "unique_id": "macro.fivetran_utils.empty_variable_warning", "macro_sql": "{% macro empty_variable_warning(variable, downstream_model) %}\n\n{% if not var(variable) %}\n{{ log(\n \"\"\"\n Warning: You have passed an empty list to the \"\"\" ~ variable ~ \"\"\".\n As a result, you won't see the history of any columns in the \"\"\" ~ downstream_model ~ \"\"\" model.\n \"\"\",\n info=True\n) }}\n{% endif %}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "variable", "type": null, "description": ""}, {"name": "downstream_model", "type": null, "description": ""}], "created_at": 1786586787.9389112, "supported_languages": null}, "macro.fivetran_utils.wrap_in_quotes": {"name": "wrap_in_quotes", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/wrap_in_quotes.sql", "original_file_path": "macros/wrap_in_quotes.sql", "unique_id": "macro.fivetran_utils.wrap_in_quotes", "macro_sql": "{%- macro wrap_in_quotes(object_to_quote) -%}\n\n{{ return(adapter.dispatch('wrap_in_quotes', 'fivetran_utils')(object_to_quote)) }}\n\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.fivetran_utils.postgres__wrap_in_quotes"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "object_to_quote", "type": null, "description": ""}], "created_at": 1786586787.939485, "supported_languages": null}, "macro.fivetran_utils.default__wrap_in_quotes": {"name": "default__wrap_in_quotes", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/wrap_in_quotes.sql", "original_file_path": "macros/wrap_in_quotes.sql", "unique_id": "macro.fivetran_utils.default__wrap_in_quotes", "macro_sql": "{%- macro default__wrap_in_quotes(object_to_quote) -%}\n{# bigquery, spark, databricks #}\n `{{ object_to_quote }}`\n{%- endmacro -%}\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "object_to_quote", "type": null, "description": ""}], "created_at": 1786586787.9396849, "supported_languages": null}, "macro.fivetran_utils.snowflake__wrap_in_quotes": {"name": "snowflake__wrap_in_quotes", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/wrap_in_quotes.sql", "original_file_path": "macros/wrap_in_quotes.sql", "unique_id": "macro.fivetran_utils.snowflake__wrap_in_quotes", "macro_sql": "{%- macro snowflake__wrap_in_quotes(object_to_quote) -%}\n \"{{ object_to_quote | upper }}\"\n{%- endmacro -%}\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "object_to_quote", "type": null, "description": ""}], "created_at": 1786586787.9398825, "supported_languages": null}, "macro.fivetran_utils.redshift__wrap_in_quotes": {"name": "redshift__wrap_in_quotes", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/wrap_in_quotes.sql", "original_file_path": "macros/wrap_in_quotes.sql", "unique_id": "macro.fivetran_utils.redshift__wrap_in_quotes", "macro_sql": "{%- macro redshift__wrap_in_quotes(object_to_quote) -%}\n \"{{ object_to_quote }}\"\n{%- endmacro -%}\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "object_to_quote", "type": null, "description": ""}], "created_at": 1786586787.9400766, "supported_languages": null}, "macro.fivetran_utils.postgres__wrap_in_quotes": {"name": "postgres__wrap_in_quotes", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/wrap_in_quotes.sql", "original_file_path": "macros/wrap_in_quotes.sql", "unique_id": "macro.fivetran_utils.postgres__wrap_in_quotes", "macro_sql": "{%- macro postgres__wrap_in_quotes(object_to_quote) -%}\n \"{{ object_to_quote }}\"\n{%- endmacro -%}\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "object_to_quote", "type": null, "description": ""}], "created_at": 1786586787.94025, "supported_languages": null}, "macro.fivetran_utils.duckdb__wrap_in_quotes": {"name": "duckdb__wrap_in_quotes", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/wrap_in_quotes.sql", "original_file_path": "macros/wrap_in_quotes.sql", "unique_id": "macro.fivetran_utils.duckdb__wrap_in_quotes", "macro_sql": "{%- macro duckdb__wrap_in_quotes(object_to_quote) -%}\n \"{{ object_to_quote }}\"\n{%- endmacro -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "object_to_quote", "type": null, "description": ""}], "created_at": 1786586787.9404166, "supported_languages": null}, "macro.fivetran_utils.array_agg": {"name": "array_agg", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/array_agg.sql", "original_file_path": "macros/array_agg.sql", "unique_id": "macro.fivetran_utils.array_agg", "macro_sql": "{% macro array_agg(field_to_agg) -%}\n\n{{ adapter.dispatch('array_agg', 'fivetran_utils') (field_to_agg) }}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.default__array_agg"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field_to_agg", "type": null, "description": ""}], "created_at": 1786586787.940837, "supported_languages": null}, "macro.fivetran_utils.default__array_agg": {"name": "default__array_agg", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/array_agg.sql", "original_file_path": "macros/array_agg.sql", "unique_id": "macro.fivetran_utils.default__array_agg", "macro_sql": "{% macro default__array_agg(field_to_agg) %}\n array_agg({{ field_to_agg }})\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field_to_agg", "type": null, "description": ""}], "created_at": 1786586787.9410272, "supported_languages": null}, "macro.fivetran_utils.redshift__array_agg": {"name": "redshift__array_agg", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/array_agg.sql", "original_file_path": "macros/array_agg.sql", "unique_id": "macro.fivetran_utils.redshift__array_agg", "macro_sql": "{% macro redshift__array_agg(field_to_agg) %}\n listagg({{ field_to_agg }}, ',')\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field_to_agg", "type": null, "description": ""}], "created_at": 1786586787.9411962, "supported_languages": null}, "macro.fivetran_utils.timestamp_add": {"name": "timestamp_add", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/timestamp_add.sql", "original_file_path": "macros/timestamp_add.sql", "unique_id": "macro.fivetran_utils.timestamp_add", "macro_sql": "{% macro timestamp_add(datepart, interval, from_timestamp) -%}\n\n{{ adapter.dispatch('timestamp_add', 'fivetran_utils') (datepart, interval, from_timestamp) }}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.postgres__timestamp_add"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "datepart", "type": null, "description": ""}, {"name": "interval", "type": null, "description": ""}, {"name": "from_timestamp", "type": null, "description": ""}], "created_at": 1786586787.9419248, "supported_languages": null}, "macro.fivetran_utils.default__timestamp_add": {"name": "default__timestamp_add", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/timestamp_add.sql", "original_file_path": "macros/timestamp_add.sql", "unique_id": "macro.fivetran_utils.default__timestamp_add", "macro_sql": "{% macro default__timestamp_add(datepart, interval, from_timestamp) %}\n\n timestampadd(\n {{ datepart }},\n {{ interval }},\n {{ from_timestamp }}\n )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "datepart", "type": null, "description": ""}, {"name": "interval", "type": null, "description": ""}, {"name": "from_timestamp", "type": null, "description": ""}], "created_at": 1786586787.9422064, "supported_languages": null}, "macro.fivetran_utils.bigquery__timestamp_add": {"name": "bigquery__timestamp_add", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/timestamp_add.sql", "original_file_path": "macros/timestamp_add.sql", "unique_id": "macro.fivetran_utils.bigquery__timestamp_add", "macro_sql": "{% macro bigquery__timestamp_add(datepart, interval, from_timestamp) %}\n\n timestamp_add({{ from_timestamp }}, interval {{ interval }} {{ datepart }})\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "datepart", "type": null, "description": ""}, {"name": "interval", "type": null, "description": ""}, {"name": "from_timestamp", "type": null, "description": ""}], "created_at": 1786586787.9424767, "supported_languages": null}, "macro.fivetran_utils.redshift__timestamp_add": {"name": "redshift__timestamp_add", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/timestamp_add.sql", "original_file_path": "macros/timestamp_add.sql", "unique_id": "macro.fivetran_utils.redshift__timestamp_add", "macro_sql": "{% macro redshift__timestamp_add(datepart, interval, from_timestamp) %}\n\n dateadd(\n {{ datepart }},\n {{ interval }},\n {{ from_timestamp }}\n )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "datepart", "type": null, "description": ""}, {"name": "interval", "type": null, "description": ""}, {"name": "from_timestamp", "type": null, "description": ""}], "created_at": 1786586787.942743, "supported_languages": null}, "macro.fivetran_utils.postgres__timestamp_add": {"name": "postgres__timestamp_add", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/timestamp_add.sql", "original_file_path": "macros/timestamp_add.sql", "unique_id": "macro.fivetran_utils.postgres__timestamp_add", "macro_sql": "{% macro postgres__timestamp_add(datepart, interval, from_timestamp) %}\n\n {{ from_timestamp }} + ((interval '1 {{ datepart }}') * ({{ interval }}))\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "datepart", "type": null, "description": ""}, {"name": "interval", "type": null, "description": ""}, {"name": "from_timestamp", "type": null, "description": ""}], "created_at": 1786586787.943122, "supported_languages": null}, "macro.fivetran_utils.spark__timestamp_add": {"name": "spark__timestamp_add", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/timestamp_add.sql", "original_file_path": "macros/timestamp_add.sql", "unique_id": "macro.fivetran_utils.spark__timestamp_add", "macro_sql": "{% macro spark__timestamp_add(datepart, interval, from_timestamp) %}\n\n {{ dbt.dateadd(datepart, interval, from_timestamp) }}\n \n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.dateadd"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "datepart", "type": null, "description": ""}, {"name": "interval", "type": null, "description": ""}, {"name": "from_timestamp", "type": null, "description": ""}], "created_at": 1786586787.9434216, "supported_languages": null}, "macro.fivetran_utils.duckdb__timestamp_add": {"name": "duckdb__timestamp_add", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/timestamp_add.sql", "original_file_path": "macros/timestamp_add.sql", "unique_id": "macro.fivetran_utils.duckdb__timestamp_add", "macro_sql": "{% macro duckdb__timestamp_add(datepart, interval, from_timestamp) %}\n\n {{ from_timestamp }} + ((interval '1 {{ datepart }}') * ({{ interval }}))\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "datepart", "type": null, "description": ""}, {"name": "interval", "type": null, "description": ""}, {"name": "from_timestamp", "type": null, "description": ""}], "created_at": 1786586787.9436853, "supported_languages": null}, "macro.fivetran_utils.extract_url_parameter": {"name": "extract_url_parameter", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/extract_url_parameter.sql", "original_file_path": "macros/extract_url_parameter.sql", "unique_id": "macro.fivetran_utils.extract_url_parameter", "macro_sql": "{% macro extract_url_parameter(field, url_parameter) -%}\n\n{{ adapter.dispatch('extract_url_parameter', 'fivetran_utils') (field, url_parameter) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.default__extract_url_parameter"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field", "type": null, "description": ""}, {"name": "url_parameter", "type": null, "description": ""}], "created_at": 1786586787.9442186, "supported_languages": null}, "macro.fivetran_utils.default__extract_url_parameter": {"name": "default__extract_url_parameter", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/extract_url_parameter.sql", "original_file_path": "macros/extract_url_parameter.sql", "unique_id": "macro.fivetran_utils.default__extract_url_parameter", "macro_sql": "{% macro default__extract_url_parameter(field, url_parameter) -%}\n\n{{ dbt_utils.get_url_parameter(field, url_parameter) }}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.get_url_parameter"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field", "type": null, "description": ""}, {"name": "url_parameter", "type": null, "description": ""}], "created_at": 1786586787.9444683, "supported_languages": null}, "macro.fivetran_utils.spark__extract_url_parameter": {"name": "spark__extract_url_parameter", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/extract_url_parameter.sql", "original_file_path": "macros/extract_url_parameter.sql", "unique_id": "macro.fivetran_utils.spark__extract_url_parameter", "macro_sql": "{% macro spark__extract_url_parameter(field, url_parameter) -%}\n\n{%- set formatted_url_parameter = \"'\" + url_parameter + \"=([^&]+)'\" -%}\nnullif(regexp_extract({{ field }}, {{ formatted_url_parameter }}, 1), '')\n\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field", "type": null, "description": ""}, {"name": "url_parameter", "type": null, "description": ""}], "created_at": 1786586787.9447954, "supported_languages": null}, "macro.fivetran_utils.add_pass_through_columns": {"name": "add_pass_through_columns", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/add_pass_through_columns.sql", "original_file_path": "macros/add_pass_through_columns.sql", "unique_id": "macro.fivetran_utils.add_pass_through_columns", "macro_sql": "{% macro add_pass_through_columns(base_columns, pass_through_var) %}\n\n {% if pass_through_var %}\n\n {% for column in pass_through_var %}\n\n {% if column is mapping %}\n\n {% if column.alias %}\n\n {% do base_columns.append({ \"name\": column.name, \"alias\": column.alias, \"datatype\": column.datatype if column.datatype else dbt.type_string()}) %}\n\n {% else %}\n\n {% do base_columns.append({ \"name\": column.name, \"datatype\": column.datatype if column.datatype else dbt.type_string()}) %}\n \n {% endif %}\n\n {% else %}\n\n {% do base_columns.append({ \"name\": column, \"datatype\": dbt.type_string()}) %}\n\n {% endif %}\n\n {% endfor %}\n\n {% endif %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "base_columns", "type": null, "description": ""}, {"name": "pass_through_var", "type": null, "description": ""}], "created_at": 1786586787.946462, "supported_languages": null}, "macro.fivetran_utils.snowflake_seed_data": {"name": "snowflake_seed_data", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/snowflake_seed_data.sql", "original_file_path": "macros/snowflake_seed_data.sql", "unique_id": "macro.fivetran_utils.snowflake_seed_data", "macro_sql": "{% macro snowflake_seed_data(seed_name) %}\n\n{% if target.type == 'snowflake' %}\n{{ return(ref(seed_name ~ '_snowflake')) }}\n{% else %}\n{{ return(ref(seed_name)) }}\n{% endif %}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "seed_name", "type": null, "description": ""}], "created_at": 1786586787.9471056, "supported_languages": null}, "macro.fivetran_utils.union_data": {"name": "union_data", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/union_data.sql", "original_file_path": "macros/union_data.sql", "unique_id": "macro.fivetran_utils.union_data", "macro_sql": "{%- macro union_data(table_identifier, database_variable, schema_variable, default_database, default_schema, default_variable, union_schema_variable='union_schemas', union_database_variable='union_databases') -%}\n\n{{ adapter.dispatch('union_data', 'fivetran_utils') (\n table_identifier, \n database_variable, \n schema_variable, \n default_database, \n default_schema, \n default_variable,\n union_schema_variable,\n union_database_variable\n ) }}\n\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.fivetran_utils.default__union_data"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "table_identifier", "type": null, "description": ""}, {"name": "database_variable", "type": null, "description": ""}, {"name": "schema_variable", "type": null, "description": ""}, {"name": "default_database", "type": null, "description": ""}, {"name": "default_schema", "type": null, "description": ""}, {"name": "default_variable", "type": null, "description": ""}, {"name": "union_schema_variable", "type": null, "description": ""}, {"name": "union_database_variable", "type": null, "description": ""}], "created_at": 1786586787.949128, "supported_languages": null}, "macro.fivetran_utils.default__union_data": {"name": "default__union_data", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/union_data.sql", "original_file_path": "macros/union_data.sql", "unique_id": "macro.fivetran_utils.default__union_data", "macro_sql": "{%- macro default__union_data(\n table_identifier, \n database_variable, \n schema_variable, \n default_database, \n default_schema, \n default_variable,\n union_schema_variable,\n union_database_variable\n ) -%}\n\n{%- if var(union_schema_variable, none) -%}\n\n {%- set relations = [] -%}\n \n {%- if var(union_schema_variable) is string -%}\n {%- set trimmed = var(union_schema_variable)|trim('[')|trim(']') -%}\n {%- set schemas = trimmed.split(',')|map('trim',\" \")|map('trim','\"')|map('trim',\"'\") -%}\n {%- else -%}\n {%- set schemas = var(union_schema_variable) -%}\n {%- endif -%}\n\n {%- for schema in var(union_schema_variable) -%}\n {%- set relation=adapter.get_relation(\n database=source(schema, table_identifier).database if var('has_defined_sources', false) else var(database_variable, default_database),\n schema=source(schema, table_identifier).schema if var('has_defined_sources', false) else schema,\n identifier=source(schema, table_identifier).identifier if var('has_defined_sources', false) else table_identifier\n ) -%}\n \n {%- set relation_exists=relation is not none -%}\n\n {%- if relation_exists -%}\n {%- do relations.append(relation) -%}\n {%- endif -%}\n\n {%- endfor -%}\n \n {%- if relations != [] -%}\n {{ dbt_utils.union_relations(relations) }}\n {%- else -%}\n {% if execute and not var('fivetran__remove_empty_table_warnings', false) -%}\n {{ exceptions.warn(\"\\n\\nPlease be aware: The \" ~ table_identifier|upper ~ \" table was not found in your \" ~ default_schema|upper ~ \" schema(s). The Fivetran dbt package will create a completely empty \" ~ table_identifier|upper ~ \" staging model as to not break downstream transformations. To turn off these warnings, set the `fivetran__remove_empty_table_warnings` variable to TRUE (see https://github.com/fivetran/dbt_fivetran_utils/tree/releases/v0.4.latest#union_data-source for details).\\n\") }}\n {% endif -%}\n select \n cast(null as {{ dbt.type_string() }}) as _dbt_source_relation\n limit 0\n {%- endif -%}\n\n{%- elif var(union_database_variable, none) -%}\n\n {%- set relations = [] -%}\n\n {%- for database in var(union_database_variable) -%}\n {%- set relation=adapter.get_relation(\n database=source(schema, table_identifier).database if var('has_defined_sources', false) else database,\n schema=source(schema, table_identifier).schema if var('has_defined_sources', false) else var(schema_variable, default_schema),\n identifier=source(schema, table_identifier).identifier if var('has_defined_sources', false) else table_identifier\n ) -%}\n\n {%- set relation_exists=relation is not none -%}\n\n {%- if relation_exists -%}\n {%- do relations.append(relation) -%}\n {%- endif -%}\n\n {%- endfor -%}\n\n {%- if relations != [] -%}\n {{ dbt_utils.union_relations(relations) }}\n {%- else -%}\n {% if execute and not var('fivetran__remove_empty_table_warnings', false) -%}\n {{ exceptions.warn(\"\\n\\nPlease be aware: The \" ~ table_identifier|upper ~ \" table was not found in your \" ~ default_schema|upper ~ \" schema(s). The Fivetran dbt package will create a completely empty \" ~ table_identifier|upper ~ \" staging model as to not break downstream transformations. To turn off these warnings, set the `fivetran__remove_empty_table_warnings` variable to TRUE (see https://github.com/fivetran/dbt_fivetran_utils/tree/releases/v0.4.latest#union_data-source for details).\\n\") }}\n {% endif -%}\n select \n cast(null as {{ dbt.type_string() }}) as _dbt_source_relation\n limit 0\n {%- endif -%}\n\n{%- else -%}\n {% set exception_schemas = {\"linkedin_company_pages\": \"linkedin_pages\", \"instagram_business_pages\": \"instagram_business\"} %}\n {% set relation = namespace(value=\"\") %}\n {% if default_schema in exception_schemas.keys() %}\n {% for corrected_schema_name in exception_schemas.items() %} \n {% if default_schema in corrected_schema_name %}\n {# In order for this macro to effectively work within upstream integration tests (mainly used by the Fivetran dbt package maintainers), this identifier variable selection is required to use the macro with different identifier names. #}\n {% set identifier_var = corrected_schema_name[1] + \"_\" + table_identifier + \"_identifier\" %}\n {%- set relation.value=adapter.get_relation(\n database=source(corrected_schema_name[1], table_identifier).database,\n schema=source(corrected_schema_name[1], table_identifier).schema,\n identifier=var(identifier_var, table_identifier)\n ) -%}\n {% endif %}\n {% endfor %}\n {% else %}\n {# In order for this macro to effectively work within upstream integration tests (mainly used by the Fivetran dbt package maintainers), this identifier variable selection is required to use the macro with different identifier names. #}\n {% set identifier_var = default_schema + \"_\" + table_identifier + \"_identifier\" %}\n {# Unfortunately the Twitter Organic identifiers were misspelled. As such, we will need to account for this in the model. This will be adjusted in the Twitter Organic package, but to ensure backwards compatibility, this needs to be included. #}\n {% if var(identifier_var, none) is none %} \n {% set identifier_var = default_schema + \"_\" + table_identifier + \"_identifer\" %}\n {% endif %}\n {%- set relation.value=adapter.get_relation(\n database=source(default_schema, table_identifier).database,\n schema=source(default_schema, table_identifier).schema,\n identifier=var(identifier_var, table_identifier)\n ) -%}\n {% endif %}\n{%- set table_exists=relation.value is not none -%}\n\n{%- if table_exists -%}\n select * \n from {{ relation.value }}\n{%- else -%}\n {% if execute and not var('fivetran__remove_empty_table_warnings', false) -%}\n {{ exceptions.warn(\"\\n\\nPlease be aware: The \" ~ table_identifier|upper ~ \" table was not found in your \" ~ default_schema|upper ~ \" schema(s). The Fivetran dbt package will create a completely empty \" ~ table_identifier|upper ~ \" staging model as to not break downstream transformations. To turn off these warnings, set the `fivetran__remove_empty_table_warnings` variable to TRUE (see https://github.com/fivetran/dbt_fivetran_utils/tree/releases/v0.4.latest#union_data-source for details).\\n\") }}\n {% endif -%}\n select \n cast(null as {{ dbt.type_string() }}) as _dbt_source_relation\n limit 0\n{%- endif -%}\n{%- endif -%}\n\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt_utils.union_relations", "macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "table_identifier", "type": null, "description": ""}, {"name": "database_variable", "type": null, "description": ""}, {"name": "schema_variable", "type": null, "description": ""}, {"name": "default_database", "type": null, "description": ""}, {"name": "default_schema", "type": null, "description": ""}, {"name": "default_variable", "type": null, "description": ""}, {"name": "union_schema_variable", "type": null, "description": ""}, {"name": "union_database_variable", "type": null, "description": ""}], "created_at": 1786586787.9565372, "supported_languages": null}, "macro.fivetran_utils.enabled_vars": {"name": "enabled_vars", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/enabled_vars.sql", "original_file_path": "macros/enabled_vars.sql", "unique_id": "macro.fivetran_utils.enabled_vars", "macro_sql": "{% macro enabled_vars(vars) %}\n\n{% for v in vars %}\n \n {% if var(v, True) == False %}\n {{ return(False) }}\n {% endif %}\n\n{% endfor %}\n\n{{ return(True) }}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "vars", "type": null, "description": ""}], "created_at": 1786586787.957285, "supported_languages": null}, "macro.fivetran_utils.timestamp_diff": {"name": "timestamp_diff", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/timestamp_diff.sql", "original_file_path": "macros/timestamp_diff.sql", "unique_id": "macro.fivetran_utils.timestamp_diff", "macro_sql": "{% macro timestamp_diff(first_date, second_date, datepart) %}\n {{ adapter.dispatch('timestamp_diff', 'fivetran_utils')(first_date, second_date, datepart) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.postgres__timestamp_diff"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "first_date", "type": null, "description": ""}, {"name": "second_date", "type": null, "description": ""}, {"name": "datepart", "type": null, "description": ""}], "created_at": 1786586787.958603, "supported_languages": null}, "macro.fivetran_utils.default__timestamp_diff": {"name": "default__timestamp_diff", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/timestamp_diff.sql", "original_file_path": "macros/timestamp_diff.sql", "unique_id": "macro.fivetran_utils.default__timestamp_diff", "macro_sql": "{% macro default__timestamp_diff(first_date, second_date, datepart) %}\n\n datediff(\n {{ datepart }},\n {{ first_date }},\n {{ second_date }}\n )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "first_date", "type": null, "description": ""}, {"name": "second_date", "type": null, "description": ""}, {"name": "datepart", "type": null, "description": ""}], "created_at": 1786586787.9588892, "supported_languages": null}, "macro.fivetran_utils.redshift__timestamp_diff": {"name": "redshift__timestamp_diff", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/timestamp_diff.sql", "original_file_path": "macros/timestamp_diff.sql", "unique_id": "macro.fivetran_utils.redshift__timestamp_diff", "macro_sql": "{% macro redshift__timestamp_diff(first_date, second_date, datepart) %}\n\n datediff(\n {{ datepart }},\n {{ first_date }},\n {{ second_date }}\n )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "first_date", "type": null, "description": ""}, {"name": "second_date", "type": null, "description": ""}, {"name": "datepart", "type": null, "description": ""}], "created_at": 1786586787.9591818, "supported_languages": null}, "macro.fivetran_utils.bigquery__timestamp_diff": {"name": "bigquery__timestamp_diff", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/timestamp_diff.sql", "original_file_path": "macros/timestamp_diff.sql", "unique_id": "macro.fivetran_utils.bigquery__timestamp_diff", "macro_sql": "{% macro bigquery__timestamp_diff(first_date, second_date, datepart) %}\n\n timestamp_diff(\n {{second_date}},\n {{first_date}},\n {{datepart}}\n )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "first_date", "type": null, "description": ""}, {"name": "second_date", "type": null, "description": ""}, {"name": "datepart", "type": null, "description": ""}], "created_at": 1786586787.9594448, "supported_languages": null}, "macro.fivetran_utils.postgres__timestamp_diff": {"name": "postgres__timestamp_diff", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/timestamp_diff.sql", "original_file_path": "macros/timestamp_diff.sql", "unique_id": "macro.fivetran_utils.postgres__timestamp_diff", "macro_sql": "{% macro postgres__timestamp_diff(first_date, second_date, datepart) %}\n\n {% if datepart == 'year' %}\n (date_part('year', ({{second_date}})::date) - date_part('year', ({{first_date}})::date))\n {% elif datepart == 'quarter' %}\n ({{ dbt.datediff(first_date, second_date, 'year') }} * 4 + date_part('quarter', ({{second_date}})::date) - date_part('quarter', ({{first_date}})::date))\n {% elif datepart == 'month' %}\n ({{ dbt.datediff(first_date, second_date, 'year') }} * 12 + date_part('month', ({{second_date}})::date) - date_part('month', ({{first_date}})::date))\n {% elif datepart == 'day' %}\n (({{second_date}})::date - ({{first_date}})::date)\n {% elif datepart == 'week' %}\n ({{ dbt.datediff(first_date, second_date, 'day') }} / 7 + case\n when date_part('dow', ({{first_date}})::timestamp) <= date_part('dow', ({{second_date}})::timestamp) then\n case when {{first_date}} <= {{second_date}} then 0 else -1 end\n else\n case when {{first_date}} <= {{second_date}} then 1 else 0 end\n end)\n {% elif datepart == 'hour' %}\n ({{ dbt.datediff(first_date, second_date, 'day') }} * 24 + date_part('hour', ({{second_date}})::timestamp) - date_part('hour', ({{first_date}})::timestamp))\n {% elif datepart == 'minute' %}\n ({{ dbt.datediff(first_date, second_date, 'hour') }} * 60 + date_part('minute', ({{second_date}})::timestamp) - date_part('minute', ({{first_date}})::timestamp))\n {% elif datepart == 'second' %}\n ({{ dbt.datediff(first_date, second_date, 'minute') }} * 60 + floor(date_part('second', ({{second_date}})::timestamp)) - floor(date_part('second', ({{first_date}})::timestamp)))\n {% elif datepart == 'millisecond' %}\n ({{ dbt.datediff(first_date, second_date, 'minute') }} * 60000 + floor(date_part('millisecond', ({{second_date}})::timestamp)) - floor(date_part('millisecond', ({{first_date}})::timestamp)))\n {% elif datepart == 'microsecond' %}\n ({{ dbt.datediff(first_date, second_date, 'minute') }} * 60000000 + floor(date_part('microsecond', ({{second_date}})::timestamp)) - floor(date_part('microsecond', ({{first_date}})::timestamp)))\n {% else %}\n {{ exceptions.raise_compiler_error(\"Unsupported datepart for macro datediff in postgres: {!r}\".format(datepart)) }}\n {% endif %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.datediff"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "first_date", "type": null, "description": ""}, {"name": "second_date", "type": null, "description": ""}, {"name": "datepart", "type": null, "description": ""}], "created_at": 1786586787.9621317, "supported_languages": null}, "macro.fivetran_utils.duckdb__timestamp_diff": {"name": "duckdb__timestamp_diff", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/timestamp_diff.sql", "original_file_path": "macros/timestamp_diff.sql", "unique_id": "macro.fivetran_utils.duckdb__timestamp_diff", "macro_sql": "{% macro duckdb__timestamp_diff(first_date, second_date, datepart) %}\n\n datediff('{{ datepart }}', {{ first_date }}, {{ second_date }})\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "first_date", "type": null, "description": ""}, {"name": "second_date", "type": null, "description": ""}, {"name": "datepart", "type": null, "description": ""}], "created_at": 1786586787.9625175, "supported_languages": null}, "macro.fivetran_utils.union_connections": {"name": "union_connections", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/union_connections.sql", "original_file_path": "macros/union_connections.sql", "unique_id": "macro.fivetran_utils.union_connections", "macro_sql": "{% macro union_connections(connection_dictionary, single_source_name, single_table_name, default_identifier=single_table_name) %}\n\n{{ adapter.dispatch('union_connections', 'fivetran_utils') (connection_dictionary, single_source_name, single_table_name, default_identifier) }}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.default__union_connections"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "connection_dictionary", "type": null, "description": ""}, {"name": "single_source_name", "type": null, "description": ""}, {"name": "single_table_name", "type": null, "description": ""}, {"name": "default_identifier", "type": null, "description": ""}], "created_at": 1786586787.9638531, "supported_languages": null}, "macro.fivetran_utils.default__union_connections": {"name": "default__union_connections", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/union_connections.sql", "original_file_path": "macros/union_connections.sql", "unique_id": "macro.fivetran_utils.default__union_connections", "macro_sql": "{% macro default__union_connections(connection_dictionary, single_source_name, single_table_name, default_identifier=single_table_name) %}\n\n{%- set exception_warning = \"\\n\\nPlease be aware: The \" ~ single_source_name|upper ~ \".\" ~ single_table_name|upper ~ \" table was not found in your schema(s). The Fivetran Data Model will create a completely empty staging model as to not break downstream transformations. To turn off these warnings, set the `fivetran__remove_empty_table_warnings` variable to TRUE (see https://github.com/fivetran/dbt_fivetran_utils/tree/releases/v0.4.latest#union_connections-source for details).\\n\"%}\n{%- set using_empty_table_warnings = (execute and not var('fivetran__remove_empty_table_warnings', false)) %}\n{%- set connections = var(connection_dictionary, []) %}\n{%- set using_unioning = connections | length > 0 %}\n{%- set identifier_var = single_source_name + \"_\" + single_table_name + \"_identifier\" %}\n\n{%- if using_unioning %}\n{# For unioning #}\n {%- set relations = [] -%}\n {%- for connection in connections -%}\n\n {% if var('has_defined_sources', false) %}\n {%- set database = source(connection.name, single_table_name).database %}\n {%- set schema = source(connection.name, single_table_name).schema %}\n {%- set identifier = source(connection.name, single_table_name).identifier %}\n {%- else %}\n {%- set database = connection.database if connection.database else target.database %}\n {%- set schema = connection.schema if connection.schema else single_source_name %}\n {%- set identifier = var(identifier_var, default_identifier) %}\n {%- endif %}\n \n {%- set relation=adapter.get_relation(\n database=database,\n schema=schema,\n identifier=identifier\n )\n -%}\n\n {%- if relation is not none -%}\n {%- do relations.append(relation) -%}\n {%- endif -%}\n\n -- ** Values passed to adapter.get_relation:\n {{ '-- database: ' ~ database }}\n {{ '-- schema: ' ~ schema }}\n {{ '-- identifier: ' ~ identifier ~ '\\n' }}\n\n {%- endfor -%}\n\n {%- if relations | length > 0 -%}\n {{ fivetran_utils.union_relations_custom(relations, source_column_name='_dbt_source_relation') }}\n\n {%- else -%}\n {{ exceptions.warn(exception_warning) if using_empty_table_warnings }}\n\n select\n cast(null as {{ dbt.type_string() }}) as _dbt_source_relation\n limit {{ '0' if target.type != 'redshift' else '1' }}\n {%- endif -%}\n\n{% else %}\n{# Not unioning #}\n\n {%- set database = source(single_source_name, single_table_name).database %}\n {%- set schema = source(single_source_name, single_table_name).schema %}\n {%- set identifier = var(identifier_var, default_identifier) %}\n\n {%- set relation=adapter.get_relation(\n database=database,\n schema=schema,\n identifier=identifier\n )\n -%}\n\n -- ** Values passed to adapter.get_relation:\n {{ '-- full-identifier_var: ' ~ identifier_var }}\n {{ '-- database: ' ~ database }} \n {{ '-- schema: ' ~ schema }}\n {{ '-- identifier: ' ~ identifier ~ '\\n' }}\n\n {% if relation is not none -%}\n select\n {{ dbt_utils.star(from=source(single_source_name, single_table_name)) }}\n from {{ source(single_source_name, single_table_name) }} as source_table\n\n {% else %}\n {{ exceptions.warn(exception_warning) if using_empty_table_warnings }}\n\n select\n cast(null as {{ dbt.type_string() }}) as _dbt_source_relation\n limit {{ '0' if target.type != 'redshift' else '1' }}\n {%- endif -%}\n{% endif -%}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.union_relations_custom", "macro.dbt.type_string", "macro.dbt_utils.star"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "connection_dictionary", "type": null, "description": ""}, {"name": "single_source_name", "type": null, "description": ""}, {"name": "single_table_name", "type": null, "description": ""}, {"name": "default_identifier", "type": null, "description": ""}], "created_at": 1786586787.9682386, "supported_languages": null}, "macro.fivetran_utils.collect_freshness": {"name": "collect_freshness", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/collect_freshness.sql", "original_file_path": "macros/collect_freshness.sql", "unique_id": "macro.fivetran_utils.collect_freshness", "macro_sql": "{% macro collect_freshness(source, loaded_at_field, filter) %}\n {{ return(adapter.dispatch('collect_freshness')(source, loaded_at_field, filter))}}\n{% endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.default__collect_freshness"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "source", "type": null, "description": ""}, {"name": "loaded_at_field", "type": null, "description": ""}, {"name": "filter", "type": null, "description": ""}], "created_at": 1786586787.9691308, "supported_languages": null}, "macro.fivetran_utils.default__collect_freshness": {"name": "default__collect_freshness", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/collect_freshness.sql", "original_file_path": "macros/collect_freshness.sql", "unique_id": "macro.fivetran_utils.default__collect_freshness", "macro_sql": "{% macro default__collect_freshness(source, loaded_at_field, filter) %}\n {% call statement('collect_freshness', fetch_result=True, auto_begin=False) -%}\n\n {%- set enabled_array = [] -%}\n {% for node in graph.sources.values() %}\n {% if node.identifier == source.identifier %}\n {% if (node.meta['is_enabled'] | default(true)) %}\n {%- do enabled_array.append(1) -%}\n {% endif %}\n {% endif %}\n {% endfor %}\n {% set is_enabled = (enabled_array != []) %}\n\n select\n {% if is_enabled %}\n max({{ loaded_at_field }})\n {% else %} \n {{ current_timestamp() }} {% endif %} as max_loaded_at,\n {{ current_timestamp() }} as snapshotted_at\n\n {% if is_enabled %}\n from {{ source }}\n {% if filter %}\n where {{ filter }}\n {% endif %}\n {% endif %}\n\n {% endcall %}\n\n {% if dbt_version.split('.') | map('int') | list >= [1, 5, 0] %}\n {{ return(load_result('collect_freshness')) }}\n {% else %}\n {{ return(load_result('collect_freshness').table) }}\n {% endif %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement", "macro.dbt.current_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "source", "type": null, "description": ""}, {"name": "loaded_at_field", "type": null, "description": ""}, {"name": "filter", "type": null, "description": ""}], "created_at": 1786586787.9711108, "supported_languages": null}, "macro.fivetran_utils.fivetran_date_spine": {"name": "fivetran_date_spine", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/fivetran_date_spine.sql", "original_file_path": "macros/fivetran_date_spine.sql", "unique_id": "macro.fivetran_utils.fivetran_date_spine", "macro_sql": "{% macro fivetran_date_spine(datepart, start_date, end_date) -%}\n\n{{ return(adapter.dispatch('fivetran_date_spine', 'fivetran_utils') (datepart, start_date, end_date)) }}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.default__fivetran_date_spine"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "datepart", "type": null, "description": ""}, {"name": "start_date", "type": null, "description": ""}, {"name": "end_date", "type": null, "description": ""}], "created_at": 1786586787.9720078, "supported_languages": null}, "macro.fivetran_utils.default__fivetran_date_spine": {"name": "default__fivetran_date_spine", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/fivetran_date_spine.sql", "original_file_path": "macros/fivetran_date_spine.sql", "unique_id": "macro.fivetran_utils.default__fivetran_date_spine", "macro_sql": "{% macro default__fivetran_date_spine(datepart, start_date, end_date) %}\n\n {{ dbt_utils.date_spine(datepart, start_date, end_date) }}\n \n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.date_spine"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "datepart", "type": null, "description": ""}, {"name": "start_date", "type": null, "description": ""}, {"name": "end_date", "type": null, "description": ""}], "created_at": 1786586787.9723144, "supported_languages": null}, "macro.fivetran_utils.sqlserver__fivetran_date_spine": {"name": "sqlserver__fivetran_date_spine", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/fivetran_date_spine.sql", "original_file_path": "macros/fivetran_date_spine.sql", "unique_id": "macro.fivetran_utils.sqlserver__fivetran_date_spine", "macro_sql": "{% macro sqlserver__fivetran_date_spine(datepart, start_date, end_date) -%}\n\n {% set date_spine_query %}\n with\n\n l0 as (\n\n select c\n from (select 1 union all select 1) as d(c)\n\n ),\n l1 as (\n\n select\n 1 as c\n from l0 as a\n cross join l0 as b\n\n ),\n\n l2 as (\n\n select 1 as c\n from l1 as a\n cross join l1 as b\n ),\n\n l3 as (\n\n select 1 as c\n from l2 as a\n cross join l2 as b\n ),\n\n l4 as (\n\n select 1 as c\n from l3 as a\n cross join l3 as b\n ),\n\n l5 as (\n\n select 1 as c\n from l4 as a\n cross join l4 as b\n ),\n\n nums as (\n\n select row_number() over (order by (select null)) as rownum\n from l5\n ),\n\n rawdata as (\n\n select top ({{dbt.datediff(start_date, end_date, datepart)}}) rownum -1 as n\n from nums\n order by rownum\n ),\n\n all_periods as (\n\n select (\n {{\n dbt.dateadd(\n datepart,\n 'n',\n start_date\n )\n }}\n ) as date_{{datepart}}\n from rawdata\n ),\n\n filtered as (\n\n select *\n from all_periods\n where date_{{datepart}} <= {{ end_date }}\n\n )\n\n select * from filtered\n order by 1\n\n {% endset %}\n\n {% set results = run_query(date_spine_query) %}\n\n {% if execute %}\n\n {% set results_list = results.columns[0].values() %}\n \n {% else %}\n\n {% set results_list = [] %}\n\n {% endif %}\n\n {%- for date_field in results_list %}\n select cast('{{ date_field }}' as date) as date_{{datepart}} {{ 'union all ' if not loop.last else '' }}\n {% endfor -%}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.datediff", "macro.dbt.dateadd", "macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "datepart", "type": null, "description": ""}, {"name": "start_date", "type": null, "description": ""}, {"name": "end_date", "type": null, "description": ""}], "created_at": 1786586787.9736671, "supported_languages": null}, "macro.fivetran_utils.apply_source_relation": {"name": "apply_source_relation", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/apply_source_relation.sql", "original_file_path": "macros/apply_source_relation.sql", "unique_id": "macro.fivetran_utils.apply_source_relation", "macro_sql": "{% macro apply_source_relation(package_name, use_package_prefix=true) -%}\n\n{{ adapter.dispatch('apply_source_relation', 'fivetran_utils') (package_name, use_package_prefix) }}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.default__apply_source_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "package_name", "type": null, "description": ""}, {"name": "use_package_prefix", "type": null, "description": ""}], "created_at": 1786586787.9744146, "supported_languages": null}, "macro.fivetran_utils.default__apply_source_relation": {"name": "default__apply_source_relation", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/apply_source_relation.sql", "original_file_path": "macros/apply_source_relation.sql", "unique_id": "macro.fivetran_utils.default__apply_source_relation", "macro_sql": "{% macro default__apply_source_relation(package_name, use_package_prefix=true) -%}\n\n{% set sources_var = package_name ~ '_sources' %}\n{% set database_var = package_name ~ '_database' %}\n{% set schema_var = package_name ~ '_schema' %}\n\n{% if use_package_prefix %}\n {% set union_schemas_var = package_name ~ '_union_schemas' %}\n {% set union_databases_var = package_name ~ '_union_databases' %}\n{% else %}\n {% set union_schemas_var = 'union_schemas' %}\n {% set union_databases_var = 'union_databases' %}\n{% endif %}\n\n{% if var(sources_var, []) | length > 0 %}\n, _dbt_source_relation as source_relation\n{% elif var(union_schemas_var, []) | length > 0 or var(union_databases_var, []) | length > 0 %}\n{{ fivetran_utils.source_relation(union_schema_variable=union_schemas_var, union_database_variable=union_databases_var) }}\n{% else %}\n{% set database = var(database_var, target.database) %}\n{% set schema = var(schema_var, package_name) %}\n, cast('{{ database ~ \".\" ~ schema }}' as {{ dbt.type_string() }}) as source_relation\n{% endif %}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.source_relation", "macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "package_name", "type": null, "description": ""}, {"name": "use_package_prefix", "type": null, "description": ""}], "created_at": 1786586787.9762352, "supported_languages": null}, "macro.fivetran_utils.percentile": {"name": "percentile", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/percentile.sql", "original_file_path": "macros/percentile.sql", "unique_id": "macro.fivetran_utils.percentile", "macro_sql": "{% macro percentile(percentile_field, partition_field, percent) -%}\n\n{{ adapter.dispatch('percentile', 'fivetran_utils') (percentile_field, partition_field, percent) }}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.postgres__percentile"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "percentile_field", "type": null, "description": ""}, {"name": "partition_field", "type": null, "description": ""}, {"name": "percent", "type": null, "description": ""}], "created_at": 1786586787.9770355, "supported_languages": null}, "macro.fivetran_utils.default__percentile": {"name": "default__percentile", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/percentile.sql", "original_file_path": "macros/percentile.sql", "unique_id": "macro.fivetran_utils.default__percentile", "macro_sql": "{% macro default__percentile(percentile_field, partition_field, percent) %}\n\n percentile_cont( \n {{ percent }} )\n within group ( order by {{ percentile_field }} )\n over ( partition by {{ partition_field }} )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "percentile_field", "type": null, "description": ""}, {"name": "partition_field", "type": null, "description": ""}, {"name": "percent", "type": null, "description": ""}], "created_at": 1786586787.9773233, "supported_languages": null}, "macro.fivetran_utils.redshift__percentile": {"name": "redshift__percentile", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/percentile.sql", "original_file_path": "macros/percentile.sql", "unique_id": "macro.fivetran_utils.redshift__percentile", "macro_sql": "{% macro redshift__percentile(percentile_field, partition_field, percent) %}\n\n percentile_cont( \n {{ percent }} )\n within group ( order by {{ percentile_field }} )\n over ( partition by {{ partition_field }} )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "percentile_field", "type": null, "description": ""}, {"name": "partition_field", "type": null, "description": ""}, {"name": "percent", "type": null, "description": ""}], "created_at": 1786586787.9775972, "supported_languages": null}, "macro.fivetran_utils.bigquery__percentile": {"name": "bigquery__percentile", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/percentile.sql", "original_file_path": "macros/percentile.sql", "unique_id": "macro.fivetran_utils.bigquery__percentile", "macro_sql": "{% macro bigquery__percentile(percentile_field, partition_field, percent) %}\n\n percentile_cont( \n {{ percentile_field }}, \n {{ percent }}) \n over (partition by {{ partition_field }} \n )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "percentile_field", "type": null, "description": ""}, {"name": "partition_field", "type": null, "description": ""}, {"name": "percent", "type": null, "description": ""}], "created_at": 1786586787.9778626, "supported_languages": null}, "macro.fivetran_utils.postgres__percentile": {"name": "postgres__percentile", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/percentile.sql", "original_file_path": "macros/percentile.sql", "unique_id": "macro.fivetran_utils.postgres__percentile", "macro_sql": "{% macro postgres__percentile(percentile_field, partition_field, percent) %}\n\n percentile_cont( \n {{ percent }} )\n within group ( order by {{ percentile_field }} )\n /* have to group by partition field */\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "percentile_field", "type": null, "description": ""}, {"name": "partition_field", "type": null, "description": ""}, {"name": "percent", "type": null, "description": ""}], "created_at": 1786586787.9782312, "supported_languages": null}, "macro.fivetran_utils.spark__percentile": {"name": "spark__percentile", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/percentile.sql", "original_file_path": "macros/percentile.sql", "unique_id": "macro.fivetran_utils.spark__percentile", "macro_sql": "{% macro spark__percentile(percentile_field, partition_field, percent) %}\n\n percentile( \n {{ percentile_field }}, \n {{ percent }}) \n over (partition by {{ partition_field }} \n )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "percentile_field", "type": null, "description": ""}, {"name": "partition_field", "type": null, "description": ""}, {"name": "percent", "type": null, "description": ""}], "created_at": 1786586787.9785051, "supported_languages": null}, "macro.fivetran_utils.duckdb__percentile": {"name": "duckdb__percentile", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/percentile.sql", "original_file_path": "macros/percentile.sql", "unique_id": "macro.fivetran_utils.duckdb__percentile", "macro_sql": "{% macro duckdb__percentile(percentile_field, partition_field, percent) %}\n\n quantile_cont(\n {{ percentile_field }},\n {{ percent }})\n over (partition by {{ partition_field }}\n )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "percentile_field", "type": null, "description": ""}, {"name": "partition_field", "type": null, "description": ""}, {"name": "percent", "type": null, "description": ""}], "created_at": 1786586787.978774, "supported_languages": null}, "macro.fivetran_utils.seed_data_helper": {"name": "seed_data_helper", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/seed_data_helper.sql", "original_file_path": "macros/seed_data_helper.sql", "unique_id": "macro.fivetran_utils.seed_data_helper", "macro_sql": "{% macro seed_data_helper(seed_name, warehouses) %}\n\n{% if target.type in warehouses %}\n {% for w in warehouses %}\n {% if target.type == w %}\n {{ return(ref(seed_name ~ \"_\" ~ w ~ \"\")) }}\n {% endif %}\n {% endfor %}\n{% else %}\n{{ return(ref(seed_name)) }}\n{% endif %}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "seed_name", "type": null, "description": ""}, {"name": "warehouses", "type": null, "description": ""}], "created_at": 1786586787.9797158, "supported_languages": null}, "macro.fivetran_utils.drop_schemas_automation": {"name": "drop_schemas_automation", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/drop_schemas_automation.sql", "original_file_path": "macros/drop_schemas_automation.sql", "unique_id": "macro.fivetran_utils.drop_schemas_automation", "macro_sql": "{% macro drop_schemas_automation(drop_target_schema=true) %}\n {{ return(adapter.dispatch('drop_schemas_automation', 'fivetran_utils')(drop_target_schema)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.default__drop_schemas_automation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "drop_target_schema", "type": null, "description": ""}], "created_at": 1786586787.9805005, "supported_languages": null}, "macro.fivetran_utils.default__drop_schemas_automation": {"name": "default__drop_schemas_automation", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/drop_schemas_automation.sql", "original_file_path": "macros/drop_schemas_automation.sql", "unique_id": "macro.fivetran_utils.default__drop_schemas_automation", "macro_sql": "{% macro default__drop_schemas_automation(drop_target_schema=true) %}\n\n{% set fetch_list_sql %}\n {% if target.type not in ('databricks', 'spark') %}\n select schema_name\n from \n {{ wrap_in_quotes(target.database) }}.INFORMATION_SCHEMA.SCHEMATA\n where lower(schema_name) like '{{ target.schema | lower }}{%- if not drop_target_schema -%}_{%- endif -%}%'\n {% else %}\n SHOW SCHEMAS LIKE '{{ target.schema }}{%- if not drop_target_schema -%}_{%- endif -%}*'\n {% endif %}\n{% endset %}\n\n{% set results = run_query(fetch_list_sql) %}\n\n{% if execute %}\n {% set results_list = results.columns[0].values() %}\n{% else %}\n {% set results_list = [] %}\n{% endif %}\n\n{% for schema_to_drop in results_list %}\n {% do adapter.drop_schema(api.Relation.create(database=target.database, schema=schema_to_drop)) %}\n {{ print('Schema ' ~ schema_to_drop ~ ' successfully dropped from the ' ~ target.database ~ ' database.\\n')}}\n{% endfor %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.wrap_in_quotes", "macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "drop_target_schema", "type": null, "description": ""}], "created_at": 1786586787.9821346, "supported_languages": null}, "macro.fivetran_utils.duckdb__drop_schemas_automation": {"name": "duckdb__drop_schemas_automation", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/drop_schemas_automation.sql", "original_file_path": "macros/drop_schemas_automation.sql", "unique_id": "macro.fivetran_utils.duckdb__drop_schemas_automation", "macro_sql": "{% macro duckdb__drop_schemas_automation(drop_target_schema=true) %}\n\n {{ print('Not dropping any schemas in DuckDB.\\n') }}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "drop_target_schema", "type": null, "description": ""}], "created_at": 1786586787.982388, "supported_languages": null}, "macro.fivetran_utils.union_relations_custom": {"name": "union_relations_custom", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/union_relations_custom.sql", "original_file_path": "macros/union_relations_custom.sql", "unique_id": "macro.fivetran_utils.union_relations_custom", "macro_sql": "{%- macro union_relations_custom(relations, aliases=none, column_override=none, include=[], exclude=[], source_column_name='_dbt_source_relation', where=none) -%}\n {{ return(adapter.dispatch('union_relations_custom', 'fivetran_utils')(relations, aliases, column_override, include, exclude, source_column_name, where)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.default__union_relations_custom"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relations", "type": null, "description": ""}, {"name": "aliases", "type": null, "description": ""}, {"name": "column_override", "type": null, "description": ""}, {"name": "include", "type": null, "description": ""}, {"name": "exclude", "type": null, "description": ""}, {"name": "source_column_name", "type": null, "description": ""}, {"name": "where", "type": null, "description": ""}], "created_at": 1786586787.9842913, "supported_languages": null}, "macro.fivetran_utils.default__union_relations_custom": {"name": "default__union_relations_custom", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/union_relations_custom.sql", "original_file_path": "macros/union_relations_custom.sql", "unique_id": "macro.fivetran_utils.default__union_relations_custom", "macro_sql": "\n\n{%- macro default__union_relations_custom(relations, aliases=none, column_override=none, include=[], exclude=[], source_column_name='_dbt_source_relation', where=none) -%}\n\n {%- if exclude and include -%}\n {{ exceptions.raise_compiler_error(\"Both an exclude and include list were provided to the `union` macro. Only one is allowed\") }}\n {%- endif -%}\n\n {#-- Prevent querying of db in parsing mode. This works because this macro does not create any new refs. -#}\n {%- if not execute %}\n {{ return('') }}\n {% endif -%}\n\n {%- set column_override = column_override if column_override is not none else {} -%}\n\n {%- set relation_columns = {} -%}\n {%- set column_superset = {} -%}\n {%- set all_excludes = [] -%}\n {%- set all_includes = [] -%}\n\n {%- if exclude -%}\n {%- for exc in exclude -%}\n {%- do all_excludes.append(exc | lower) -%}\n {%- endfor -%}\n {%- endif -%}\n\n {%- if include -%}\n {%- for inc in include -%}\n {%- do all_includes.append(inc | lower) -%}\n {%- endfor -%}\n {%- endif -%}\n\n {%- for relation in relations -%}\n\n {%- do relation_columns.update({relation: []}) -%}\n\n {%- do dbt_utils._is_relation(relation, 'union_relations_custom') -%}\n {%- do dbt_utils._is_ephemeral(relation, 'union_relations_custom') -%}\n {%- set cols = adapter.get_columns_in_relation(relation) -%}\n {%- for col in cols -%}\n\n {#- If an exclude list was provided and the column is in the list, do nothing -#}\n {%- if exclude and col.column | lower in all_excludes -%}\n\n {#- If an include list was provided and the column is not in the list, do nothing -#}\n {%- elif include and col.column | lower not in all_includes -%}\n\n {#- Otherwise add the column to the column superset -#}\n {%- else -%}\n\n {#- update the list of columns in this relation -#}\n {%- do relation_columns[relation].append(col.column) -%}\n\n {%- if col.column in column_superset -%}\n\n {%- set stored = column_superset[col.column] -%}\n {%- if col.is_string() and stored.is_string() and col.string_size() > stored.string_size() -%}\n\n {%- do column_superset.update({col.column: col}) -%}\n\n {%- endif %}\n\n {%- else -%}\n\n {%- do column_superset.update({col.column: col}) -%}\n\n {%- endif -%}\n\n {%- endif -%}\n\n {%- endfor -%}\n {%- endfor -%}\n\n {%- set ordered_column_names = column_superset.keys() -%}\n {%- set dbt_command = flags.WHICH -%}\n\n\n {% if dbt_command in ['run', 'build'] %}\n {% if (include | length > 0 or exclude | length > 0) and not column_superset.keys() %}\n {%- set relations_string -%}\n {%- for relation in relations -%}\n {{ relation.name }}\n {%- if not loop.last %}, {% endif -%}\n {%- endfor -%}\n {%- endset -%}\n\n {%- set error_message -%}\n There were no columns found to union for relations {{ relations_string }}\n {%- endset -%}\n\n {{ exceptions.raise_compiler_error(error_message) }}\n {%- endif -%}\n {%- endif -%}\n\n {%- for relation in relations %}\n\n (\n select\n\n {%- if source_column_name is not none %}\n {# dbt_utils union_relations includes the table in the source_relation. For Fivetran dbt package purposes the table should not be included in the source relation. #}\n cast({{ dbt.string_literal(relation.database ~ '.' ~ relation.schema) }} as {{ dbt.type_string() }}) as {{ source_column_name }},\n {%- endif %}\n\n {% for col_name in ordered_column_names -%}\n\n {%- set col = column_superset[col_name] %}\n {%- set col_type = column_override.get(col.column, col.data_type) %}\n {%- set col_name = adapter.quote(col_name) if col_name in relation_columns[relation] else 'null' %}\n cast({{ col_name }} as {{ col_type }}) as {{ col.quoted }} {% if not loop.last %},{% endif -%}\n\n {%- endfor %}\n \n {# This alias is a change from dbt_utils union_relations code. Avoids errors if the table is named a reserved keyword #}\n from {{ aliases[loop.index0] if aliases else relation }} as unioned_relation_{{ loop.index }}\n\n {% if where -%}\n where {{ where }}\n {%- endif %}\n )\n\n {% if not loop.last -%}\n union all\n {% endif -%}\n\n {%- endfor -%}\n\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt_utils._is_relation", "macro.dbt_utils._is_ephemeral", "macro.dbt.string_literal", "macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relations", "type": null, "description": ""}, {"name": "aliases", "type": null, "description": ""}, {"name": "column_override", "type": null, "description": ""}, {"name": "include", "type": null, "description": ""}, {"name": "exclude", "type": null, "description": ""}, {"name": "source_column_name", "type": null, "description": ""}, {"name": "where", "type": null, "description": ""}], "created_at": 1786586787.990226, "supported_languages": null}, "macro.fivetran_utils.first_value": {"name": "first_value", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/first_value.sql", "original_file_path": "macros/first_value.sql", "unique_id": "macro.fivetran_utils.first_value", "macro_sql": "{% macro first_value(first_value_field, partition_field, order_by_field, order=\"asc\") -%}\n\n{{ adapter.dispatch('first_value', 'fivetran_utils') (first_value_field, partition_field, order_by_field, order) }}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.default__first_value"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "first_value_field", "type": null, "description": ""}, {"name": "partition_field", "type": null, "description": ""}, {"name": "order_by_field", "type": null, "description": ""}, {"name": "order", "type": null, "description": ""}], "created_at": 1786586787.9909887, "supported_languages": null}, "macro.fivetran_utils.default__first_value": {"name": "default__first_value", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/first_value.sql", "original_file_path": "macros/first_value.sql", "unique_id": "macro.fivetran_utils.default__first_value", "macro_sql": "{% macro default__first_value(first_value_field, partition_field, order_by_field, order=\"asc\") %}\n\n first_value( {{ first_value_field }} ignore nulls ) over (partition by {{ partition_field }} order by {{ order_by_field }} {{ order }} )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "first_value_field", "type": null, "description": ""}, {"name": "partition_field", "type": null, "description": ""}, {"name": "order_by_field", "type": null, "description": ""}, {"name": "order", "type": null, "description": ""}], "created_at": 1786586787.991357, "supported_languages": null}, "macro.fivetran_utils.redshift__first_value": {"name": "redshift__first_value", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/first_value.sql", "original_file_path": "macros/first_value.sql", "unique_id": "macro.fivetran_utils.redshift__first_value", "macro_sql": "{% macro redshift__first_value(first_value_field, partition_field, order_by_field, order=\"asc\") %}\n\n first_value( {{ first_value_field }} ignore nulls ) over (partition by {{ partition_field }} order by {{ order_by_field }} {{ order }} , {{ partition_field }} rows unbounded preceding )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "first_value_field", "type": null, "description": ""}, {"name": "partition_field", "type": null, "description": ""}, {"name": "order_by_field", "type": null, "description": ""}, {"name": "order", "type": null, "description": ""}], "created_at": 1786586787.9917345, "supported_languages": null}, "macro.fivetran_utils.persist_pass_through_columns": {"name": "persist_pass_through_columns", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/persist_pass_through_columns.sql", "original_file_path": "macros/persist_pass_through_columns.sql", "unique_id": "macro.fivetran_utils.persist_pass_through_columns", "macro_sql": "{% macro persist_pass_through_columns(pass_through_variable, identifier=none, transform='') %}\n\n{% if var(pass_through_variable, none) %}\n {% for field in var(pass_through_variable) %}\n , {{ transform ~ '(' ~ (identifier ~ '.' if identifier else '') ~ (field.alias if field.alias else field.name) ~ ')' }} as {{ field.alias if field.alias else field.name }}\n {% endfor %}\n{% endif %}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "pass_through_variable", "type": null, "description": ""}, {"name": "identifier", "type": null, "description": ""}, {"name": "transform", "type": null, "description": ""}], "created_at": 1786586787.9927838, "supported_languages": null}, "macro.dbt_utils.get_url_path": {"name": "get_url_path", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/web/get_url_path.sql", "original_file_path": "macros/web/get_url_path.sql", "unique_id": "macro.dbt_utils.get_url_path", "macro_sql": "{% macro get_url_path(field) -%}\n {{ return(adapter.dispatch('get_url_path', 'dbt_utils')(field)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__get_url_path"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field", "type": null, "description": ""}], "created_at": 1786586787.9933732, "supported_languages": null}, "macro.dbt_utils.default__get_url_path": {"name": "default__get_url_path", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/web/get_url_path.sql", "original_file_path": "macros/web/get_url_path.sql", "unique_id": "macro.dbt_utils.default__get_url_path", "macro_sql": "{% macro default__get_url_path(field) -%}\n\n {%- set stripped_url =\n dbt.replace(\n dbt.replace(field, \"'http://'\", \"''\"), \"'https://'\", \"''\")\n -%}\n\n {%- set first_slash_pos -%}\n coalesce(\n nullif({{ dbt.position(\"'/'\", stripped_url) }}, 0),\n {{ dbt.position(\"'?'\", stripped_url) }} - 1\n )\n {%- endset -%}\n\n {%- set parsed_path =\n dbt.split_part(\n dbt.right(\n stripped_url,\n dbt.length(stripped_url) ~ \"-\" ~ first_slash_pos\n ),\n \"'?'\", 1\n )\n -%}\n\n {{ dbt.safe_cast(\n parsed_path,\n dbt.type_string()\n )}}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.replace", "macro.dbt.position", "macro.dbt.split_part", "macro.dbt.right", "macro.dbt.length", "macro.dbt.safe_cast", "macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field", "type": null, "description": ""}], "created_at": 1786586787.9944062, "supported_languages": null}, "macro.dbt_utils.get_url_host": {"name": "get_url_host", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/web/get_url_host.sql", "original_file_path": "macros/web/get_url_host.sql", "unique_id": "macro.dbt_utils.get_url_host", "macro_sql": "{% macro get_url_host(field) -%}\n {{ return(adapter.dispatch('get_url_host', 'dbt_utils')(field)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__get_url_host"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field", "type": null, "description": ""}], "created_at": 1786586787.9949179, "supported_languages": null}, "macro.dbt_utils.default__get_url_host": {"name": "default__get_url_host", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/web/get_url_host.sql", "original_file_path": "macros/web/get_url_host.sql", "unique_id": "macro.dbt_utils.default__get_url_host", "macro_sql": "{% macro default__get_url_host(field) -%}\n\n{%- set parsed =\n dbt.split_part(\n dbt.split_part(\n dbt.replace(\n dbt.replace(\n dbt.replace(field, \"'android-app://'\", \"''\"\n ), \"'http://'\", \"''\"\n ), \"'https://'\", \"''\"\n ), \"'/'\", 1\n ), \"'?'\", 1\n )\n\n-%}\n\n\n {{ dbt.safe_cast(\n parsed,\n dbt.type_string()\n )}}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.split_part", "macro.dbt.replace", "macro.dbt.safe_cast", "macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field", "type": null, "description": ""}], "created_at": 1786586787.995671, "supported_languages": null}, "macro.dbt_utils.get_url_parameter": {"name": "get_url_parameter", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/web/get_url_parameter.sql", "original_file_path": "macros/web/get_url_parameter.sql", "unique_id": "macro.dbt_utils.get_url_parameter", "macro_sql": "{% macro get_url_parameter(field, url_parameter) -%}\n {{ return(adapter.dispatch('get_url_parameter', 'dbt_utils')(field, url_parameter)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__get_url_parameter"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field", "type": null, "description": ""}, {"name": "url_parameter", "type": null, "description": ""}], "created_at": 1786586787.9961903, "supported_languages": null}, "macro.dbt_utils.default__get_url_parameter": {"name": "default__get_url_parameter", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/web/get_url_parameter.sql", "original_file_path": "macros/web/get_url_parameter.sql", "unique_id": "macro.dbt_utils.default__get_url_parameter", "macro_sql": "{% macro default__get_url_parameter(field, url_parameter) -%}\n\n{%- set formatted_url_parameter = \"'\" + url_parameter + \"='\" -%}\n\n{%- set split = dbt.split_part(dbt.split_part(field, formatted_url_parameter, 2), \"'&'\", 1) -%}\n\nnullif({{ split }},'')\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.split_part"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field", "type": null, "description": ""}, {"name": "url_parameter", "type": null, "description": ""}], "created_at": 1786586787.9967146, "supported_languages": null}, "macro.dbt_utils.pretty_time": {"name": "pretty_time", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/jinja_helpers/pretty_time.sql", "original_file_path": "macros/jinja_helpers/pretty_time.sql", "unique_id": "macro.dbt_utils.pretty_time", "macro_sql": "{% macro pretty_time(format='%H:%M:%S') %}\n {{ return(adapter.dispatch('pretty_time', 'dbt_utils')(format)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__pretty_time"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "format", "type": null, "description": ""}], "created_at": 1786586787.9971867, "supported_languages": null}, "macro.dbt_utils.default__pretty_time": {"name": "default__pretty_time", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/jinja_helpers/pretty_time.sql", "original_file_path": "macros/jinja_helpers/pretty_time.sql", "unique_id": "macro.dbt_utils.default__pretty_time", "macro_sql": "{% macro default__pretty_time(format='%H:%M:%S') %}\n {{ return(modules.datetime.datetime.now().strftime(format)) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "format", "type": null, "description": ""}], "created_at": 1786586787.997504, "supported_languages": null}, "macro.dbt_utils._is_ephemeral": {"name": "_is_ephemeral", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/jinja_helpers/_is_ephemeral.sql", "original_file_path": "macros/jinja_helpers/_is_ephemeral.sql", "unique_id": "macro.dbt_utils._is_ephemeral", "macro_sql": "{% macro _is_ephemeral(obj, macro) %}\n {%- if obj.is_cte -%}\n {% set ephemeral_prefix = api.Relation.add_ephemeral_prefix('') %}\n {% if obj.name.startswith(ephemeral_prefix) %}\n {% set model_name = obj.name[(ephemeral_prefix|length):] %}\n {% else %}\n {% set model_name = obj.name %}\n {%- endif -%}\n {% set error_message %}\nThe `{{ macro }}` macro cannot be used with ephemeral models, as it relies on the information schema.\n\n`{{ model_name }}` is an ephemeral model. Consider making it a view or table instead.\n {% endset %}\n {%- do exceptions.raise_compiler_error(error_message) -%}\n {%- endif -%}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "obj", "type": null, "description": ""}, {"name": "macro", "type": null, "description": ""}], "created_at": 1786586787.9987736, "supported_languages": null}, "macro.dbt_utils.log_info": {"name": "log_info", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/jinja_helpers/log_info.sql", "original_file_path": "macros/jinja_helpers/log_info.sql", "unique_id": "macro.dbt_utils.log_info", "macro_sql": "{% macro log_info(message) %}\n {{ return(adapter.dispatch('log_info', 'dbt_utils')(message)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__log_info"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "message", "type": null, "description": ""}], "created_at": 1786586787.999226, "supported_languages": null}, "macro.dbt_utils.default__log_info": {"name": "default__log_info", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/jinja_helpers/log_info.sql", "original_file_path": "macros/jinja_helpers/log_info.sql", "unique_id": "macro.dbt_utils.default__log_info", "macro_sql": "{% macro default__log_info(message) %}\n {{ log(dbt_utils.pretty_log_format(message), info=True) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.pretty_log_format"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "message", "type": null, "description": ""}], "created_at": 1786586787.9995108, "supported_languages": null}, "macro.dbt_utils._is_relation": {"name": "_is_relation", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/jinja_helpers/_is_relation.sql", "original_file_path": "macros/jinja_helpers/_is_relation.sql", "unique_id": "macro.dbt_utils._is_relation", "macro_sql": "{% macro _is_relation(obj, macro) %}\n {%- if not (obj is mapping and obj.get('metadata', {}).get('type', '').endswith('Relation')) -%}\n {%- do exceptions.raise_compiler_error(\"Macro \" ~ macro ~ \" expected a Relation but received the value: \" ~ obj) -%}\n {%- endif -%}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "obj", "type": null, "description": ""}, {"name": "macro", "type": null, "description": ""}], "created_at": 1786586788.0002606, "supported_languages": null}, "macro.dbt_utils.pretty_log_format": {"name": "pretty_log_format", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/jinja_helpers/pretty_log_format.sql", "original_file_path": "macros/jinja_helpers/pretty_log_format.sql", "unique_id": "macro.dbt_utils.pretty_log_format", "macro_sql": "{% macro pretty_log_format(message) %}\n {{ return(adapter.dispatch('pretty_log_format', 'dbt_utils')(message)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__pretty_log_format"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "message", "type": null, "description": ""}], "created_at": 1786586788.0006983, "supported_languages": null}, "macro.dbt_utils.default__pretty_log_format": {"name": "default__pretty_log_format", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/jinja_helpers/pretty_log_format.sql", "original_file_path": "macros/jinja_helpers/pretty_log_format.sql", "unique_id": "macro.dbt_utils.default__pretty_log_format", "macro_sql": "{% macro default__pretty_log_format(message) %}\n {{ return( dbt_utils.pretty_time() ~ ' + ' ~ message) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.pretty_time"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "message", "type": null, "description": ""}], "created_at": 1786586788.0009828, "supported_languages": null}, "macro.dbt_utils.slugify": {"name": "slugify", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/jinja_helpers/slugify.sql", "original_file_path": "macros/jinja_helpers/slugify.sql", "unique_id": "macro.dbt_utils.slugify", "macro_sql": "{% macro slugify(string) %}\n\n{% if not string %}\n{{ return('') }}\n{% endif %}\n\n{#- Lower case the string -#}\n{% set string = string | lower %}\n{#- Replace spaces and dashes with underscores -#}\n{% set string = modules.re.sub('[ -]+', '_', string) %}\n{#- Only take letters, numbers, and underscores -#}\n{% set string = modules.re.sub('[^a-z0-9_]+', '', string) %}\n{#- Prepends \"_\" if string begins with a number -#}\n{% set string = modules.re.sub('^[0-9]', '_' + string[0], string) %}\n\n{{ return(string) }}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "string", "type": null, "description": ""}], "created_at": 1786586788.0021875, "supported_languages": null}, "macro.dbt_utils.group_by": {"name": "group_by", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/groupby.sql", "original_file_path": "macros/sql/groupby.sql", "unique_id": "macro.dbt_utils.group_by", "macro_sql": "{%- macro group_by(n) -%}\n {{ return(adapter.dispatch('group_by', 'dbt_utils')(n)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__group_by"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "n", "type": null, "description": ""}], "created_at": 1786586788.002644, "supported_languages": null}, "macro.dbt_utils.default__group_by": {"name": "default__group_by", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/groupby.sql", "original_file_path": "macros/sql/groupby.sql", "unique_id": "macro.dbt_utils.default__group_by", "macro_sql": "\n\n{%- macro default__group_by(n) -%}\n\n group by {% for i in range(1, n + 1) -%}\n {{ i }}{{ ',' if not loop.last }} \n {%- endfor -%}\n\n{%- endmacro -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "n", "type": null, "description": ""}], "created_at": 1786586788.0030696, "supported_languages": null}, "macro.dbt_utils.safe_subtract": {"name": "safe_subtract", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/safe_subtract.sql", "original_file_path": "macros/sql/safe_subtract.sql", "unique_id": "macro.dbt_utils.safe_subtract", "macro_sql": "{%- macro safe_subtract(field_list) -%}\n {{ return(adapter.dispatch('safe_subtract', 'dbt_utils')(field_list)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__safe_subtract"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field_list", "type": null, "description": ""}], "created_at": 1786586788.0036077, "supported_languages": null}, "macro.dbt_utils.default__safe_subtract": {"name": "default__safe_subtract", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/safe_subtract.sql", "original_file_path": "macros/sql/safe_subtract.sql", "unique_id": "macro.dbt_utils.default__safe_subtract", "macro_sql": "\n\n{%- macro default__safe_subtract(field_list) -%}\n\n{%- if field_list is not iterable or field_list is string or field_list is mapping -%}\n\n{%- set error_message = '\nWarning: the `safe_subtract` macro takes a single list argument instead of \\\nstring arguments. The {}.{} model triggered this warning. \\\n'.format(model.package_name, model.name) -%}\n\n{%- do exceptions.raise_compiler_error(error_message) -%}\n\n{%- endif -%}\n\n{% set fields = [] %}\n\n{%- for field in field_list -%}\n\n {% do fields.append(\"coalesce(\" ~ field ~ \", 0)\") %}\n\n{%- endfor -%}\n\n{{ fields|join(' -\\n ') }}\n\n{%- endmacro -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field_list", "type": null, "description": ""}], "created_at": 1786586788.0044944, "supported_languages": null}, "macro.dbt_utils.nullcheck_table": {"name": "nullcheck_table", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/nullcheck_table.sql", "original_file_path": "macros/sql/nullcheck_table.sql", "unique_id": "macro.dbt_utils.nullcheck_table", "macro_sql": "{% macro nullcheck_table(relation) %}\n {{ return(adapter.dispatch('nullcheck_table', 'dbt_utils')(relation)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__nullcheck_table"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1786586788.0049963, "supported_languages": null}, "macro.dbt_utils.default__nullcheck_table": {"name": "default__nullcheck_table", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/nullcheck_table.sql", "original_file_path": "macros/sql/nullcheck_table.sql", "unique_id": "macro.dbt_utils.default__nullcheck_table", "macro_sql": "{% macro default__nullcheck_table(relation) %}\n\n {%- do dbt_utils._is_relation(relation, 'nullcheck_table') -%}\n {%- do dbt_utils._is_ephemeral(relation, 'nullcheck_table') -%}\n {% set cols = adapter.get_columns_in_relation(relation) %}\n\n select {{ dbt_utils.nullcheck(cols) }}\n from {{relation}}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils._is_relation", "macro.dbt_utils._is_ephemeral", "macro.dbt_utils.nullcheck"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1786586788.0055444, "supported_languages": null}, "macro.dbt_utils.get_single_value": {"name": "get_single_value", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_single_value.sql", "original_file_path": "macros/sql/get_single_value.sql", "unique_id": "macro.dbt_utils.get_single_value", "macro_sql": "{% macro get_single_value(query, default=none) %}\n {{ return(adapter.dispatch('get_single_value', 'dbt_utils')(query, default)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__get_single_value"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "query", "type": null, "description": ""}, {"name": "default", "type": null, "description": ""}], "created_at": 1786586788.0062292, "supported_languages": null}, "macro.dbt_utils.default__get_single_value": {"name": "default__get_single_value", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_single_value.sql", "original_file_path": "macros/sql/get_single_value.sql", "unique_id": "macro.dbt_utils.default__get_single_value", "macro_sql": "{% macro default__get_single_value(query, default) %}\n\n{# This macro returns the (0, 0) record in a query, i.e. the first row of the first column #}\n\n {%- call statement('get_query_result', fetch_result=True, auto_begin=false) -%}\n\n {{ query }}\n\n {%- endcall -%}\n\n {%- if execute -%}\n\n {% set r = load_result('get_query_result').table.columns[0].values() %}\n {% if r | length == 0 %}\n {% do print('Query `' ~ query ~ '` returned no rows. Using the default value: ' ~ default) %}\n {% set sql_result = default %}\n {% else %}\n {% set sql_result = r[0] %}\n {% endif %}\n \n {%- else -%}\n \n {% set sql_result = default %}\n \n {%- endif -%}\n\n {% do return(sql_result) %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "query", "type": null, "description": ""}, {"name": "default", "type": null, "description": ""}], "created_at": 1786586788.0075283, "supported_languages": null}, "macro.dbt_utils.get_filtered_columns_in_relation": {"name": "get_filtered_columns_in_relation", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_filtered_columns_in_relation.sql", "original_file_path": "macros/sql/get_filtered_columns_in_relation.sql", "unique_id": "macro.dbt_utils.get_filtered_columns_in_relation", "macro_sql": "{% macro get_filtered_columns_in_relation(from, except=[]) -%}\n {{ return(adapter.dispatch('get_filtered_columns_in_relation', 'dbt_utils')(from, except)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__get_filtered_columns_in_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "from", "type": null, "description": ""}, {"name": "except", "type": null, "description": ""}], "created_at": 1786586788.0082343, "supported_languages": null}, "macro.dbt_utils.default__get_filtered_columns_in_relation": {"name": "default__get_filtered_columns_in_relation", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_filtered_columns_in_relation.sql", "original_file_path": "macros/sql/get_filtered_columns_in_relation.sql", "unique_id": "macro.dbt_utils.default__get_filtered_columns_in_relation", "macro_sql": "{% macro default__get_filtered_columns_in_relation(from, except=[]) -%}\n {%- do dbt_utils._is_relation(from, 'get_filtered_columns_in_relation') -%}\n {%- do dbt_utils._is_ephemeral(from, 'get_filtered_columns_in_relation') -%}\n\n {# -- Prevent querying of db in parsing mode. This works because this macro does not create any new refs. #}\n {%- if not execute -%}\n {{ return([]) }}\n {% endif %}\n\n {%- set include_cols = [] %}\n {%- set cols = adapter.get_columns_in_relation(from) -%}\n {%- set except = except | map(\"lower\") | list %}\n {%- for col in cols -%}\n {%- if col.column|lower not in except -%}\n {% do include_cols.append(col.column) %}\n {%- endif %}\n {%- endfor %}\n\n {{ return(include_cols) }}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_utils._is_relation", "macro.dbt_utils._is_ephemeral"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "from", "type": null, "description": ""}, {"name": "except", "type": null, "description": ""}], "created_at": 1786586788.009405, "supported_languages": null}, "macro.dbt_utils.get_relations_by_prefix": {"name": "get_relations_by_prefix", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_relations_by_prefix.sql", "original_file_path": "macros/sql/get_relations_by_prefix.sql", "unique_id": "macro.dbt_utils.get_relations_by_prefix", "macro_sql": "{% macro get_relations_by_prefix(schema, prefix, exclude='', database=target.database) %}\n {{ return(adapter.dispatch('get_relations_by_prefix', 'dbt_utils')(schema, prefix, exclude, database)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__get_relations_by_prefix"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "schema", "type": null, "description": ""}, {"name": "prefix", "type": null, "description": ""}, {"name": "exclude", "type": null, "description": ""}, {"name": "database", "type": null, "description": ""}], "created_at": 1786586788.010212, "supported_languages": null}, "macro.dbt_utils.default__get_relations_by_prefix": {"name": "default__get_relations_by_prefix", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_relations_by_prefix.sql", "original_file_path": "macros/sql/get_relations_by_prefix.sql", "unique_id": "macro.dbt_utils.default__get_relations_by_prefix", "macro_sql": "{% macro default__get_relations_by_prefix(schema, prefix, exclude='', database=target.database) %}\n\n {%- call statement('get_tables', fetch_result=True) %}\n\n {{ dbt_utils.get_tables_by_prefix_sql(schema, prefix, exclude, database) }}\n\n {%- endcall -%}\n\n {%- set table_list = load_result('get_tables') -%}\n\n {%- if table_list and table_list['table'] -%}\n {%- set tbl_relations = [] -%}\n {%- for row in table_list['table'] -%}\n {%- set tbl_relation = api.Relation.create(\n database=database,\n schema=row.table_schema,\n identifier=row.table_name,\n type=row.table_type\n ) -%}\n {%- do tbl_relations.append(tbl_relation) -%}\n {%- endfor -%}\n\n {{ return(tbl_relations) }}\n {%- else -%}\n {{ return([]) }}\n {%- endif -%}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement", "macro.dbt_utils.get_tables_by_prefix_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "schema", "type": null, "description": ""}, {"name": "prefix", "type": null, "description": ""}, {"name": "exclude", "type": null, "description": ""}, {"name": "database", "type": null, "description": ""}], "created_at": 1786586788.0115862, "supported_languages": null}, "macro.dbt_utils.get_tables_by_prefix_sql": {"name": "get_tables_by_prefix_sql", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_tables_by_prefix_sql.sql", "original_file_path": "macros/sql/get_tables_by_prefix_sql.sql", "unique_id": "macro.dbt_utils.get_tables_by_prefix_sql", "macro_sql": "{% macro get_tables_by_prefix_sql(schema, prefix, exclude='', database=target.database) %}\n {{ return(adapter.dispatch('get_tables_by_prefix_sql', 'dbt_utils')(schema, prefix, exclude, database)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__get_tables_by_prefix_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "schema", "type": null, "description": ""}, {"name": "prefix", "type": null, "description": ""}, {"name": "exclude", "type": null, "description": ""}, {"name": "database", "type": null, "description": ""}], "created_at": 1786586788.012228, "supported_languages": null}, "macro.dbt_utils.default__get_tables_by_prefix_sql": {"name": "default__get_tables_by_prefix_sql", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_tables_by_prefix_sql.sql", "original_file_path": "macros/sql/get_tables_by_prefix_sql.sql", "unique_id": "macro.dbt_utils.default__get_tables_by_prefix_sql", "macro_sql": "{% macro default__get_tables_by_prefix_sql(schema, prefix, exclude='', database=target.database) %}\n\n {{ dbt_utils.get_tables_by_pattern_sql(\n schema_pattern = schema,\n table_pattern = prefix ~ '%',\n exclude = exclude,\n database = database\n ) }}\n \n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.get_tables_by_pattern_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "schema", "type": null, "description": ""}, {"name": "prefix", "type": null, "description": ""}, {"name": "exclude", "type": null, "description": ""}, {"name": "database", "type": null, "description": ""}], "created_at": 1786586788.0126934, "supported_languages": null}, "macro.dbt_utils.get_query_results_as_dict": {"name": "get_query_results_as_dict", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_query_results_as_dict.sql", "original_file_path": "macros/sql/get_query_results_as_dict.sql", "unique_id": "macro.dbt_utils.get_query_results_as_dict", "macro_sql": "{% macro get_query_results_as_dict(query) %}\n {{ return(adapter.dispatch('get_query_results_as_dict', 'dbt_utils')(query)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__get_query_results_as_dict"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "query", "type": null, "description": ""}], "created_at": 1786586788.013265, "supported_languages": null}, "macro.dbt_utils.default__get_query_results_as_dict": {"name": "default__get_query_results_as_dict", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_query_results_as_dict.sql", "original_file_path": "macros/sql/get_query_results_as_dict.sql", "unique_id": "macro.dbt_utils.default__get_query_results_as_dict", "macro_sql": "{% macro default__get_query_results_as_dict(query) %}\n\n{# This macro returns a dictionary of the form {column_name: (tuple_of_results)} #}\n\n {%- call statement('get_query_results', fetch_result=True,auto_begin=false) -%}\n\n {{ query }}\n\n {%- endcall -%}\n\n {% set sql_results={} %}\n\n {%- if execute -%}\n {% set sql_results_table = load_result('get_query_results').table.columns %}\n {% for column_name, column in sql_results_table.items() %}\n {% do sql_results.update({column_name: column.values()}) %}\n {% endfor %}\n {%- endif -%}\n\n {{ return(sql_results) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "query", "type": null, "description": ""}], "created_at": 1786586788.0142405, "supported_languages": null}, "macro.dbt_utils.pivot": {"name": "pivot", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/pivot.sql", "original_file_path": "macros/sql/pivot.sql", "unique_id": "macro.dbt_utils.pivot", "macro_sql": "{% macro pivot(column,\n values,\n alias=True,\n agg='sum',\n cmp='=',\n prefix='',\n suffix='',\n then_value=1,\n else_value=0,\n quote_identifiers=True,\n distinct=False) %}\n {{ return(adapter.dispatch('pivot', 'dbt_utils')(column, values, alias, agg, cmp, prefix, suffix, then_value, else_value, quote_identifiers, distinct)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__pivot"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "column", "type": null, "description": ""}, {"name": "values", "type": null, "description": ""}, {"name": "alias", "type": null, "description": ""}, {"name": "agg", "type": null, "description": ""}, {"name": "cmp", "type": null, "description": ""}, {"name": "prefix", "type": null, "description": ""}, {"name": "suffix", "type": null, "description": ""}, {"name": "then_value", "type": null, "description": ""}, {"name": "else_value", "type": null, "description": ""}, {"name": "quote_identifiers", "type": null, "description": ""}, {"name": "distinct", "type": null, "description": ""}], "created_at": 1786586788.0155864, "supported_languages": null}, "macro.dbt_utils.default__pivot": {"name": "default__pivot", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/pivot.sql", "original_file_path": "macros/sql/pivot.sql", "unique_id": "macro.dbt_utils.default__pivot", "macro_sql": "{% macro default__pivot(column,\n values,\n alias=True,\n agg='sum',\n cmp='=',\n prefix='',\n suffix='',\n then_value=1,\n else_value=0,\n quote_identifiers=True,\n distinct=False) %}\n {% for value in values %}\n {{ agg }}(\n {% if distinct %} distinct {% endif %}\n case\n when {{ column }} {{ cmp }} '{{ dbt.escape_single_quotes(value) }}'\n then {{ then_value }}\n else {{ else_value }}\n end\n )\n {% if alias %}\n {% if quote_identifiers %}\n as {{ adapter.quote(prefix ~ value ~ suffix) }}\n {% else %}\n as {{ dbt_utils.slugify(prefix ~ value ~ suffix) }}\n {% endif %}\n {% endif %}\n {% if not loop.last %},{% endif %}\n {% endfor %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.escape_single_quotes", "macro.dbt_utils.slugify"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "column", "type": null, "description": ""}, {"name": "values", "type": null, "description": ""}, {"name": "alias", "type": null, "description": ""}, {"name": "agg", "type": null, "description": ""}, {"name": "cmp", "type": null, "description": ""}, {"name": "prefix", "type": null, "description": ""}, {"name": "suffix", "type": null, "description": ""}, {"name": "then_value", "type": null, "description": ""}, {"name": "else_value", "type": null, "description": ""}, {"name": "quote_identifiers", "type": null, "description": ""}, {"name": "distinct", "type": null, "description": ""}], "created_at": 1786586788.0174322, "supported_languages": null}, "macro.dbt_utils.get_intervals_between": {"name": "get_intervals_between", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/date_spine.sql", "original_file_path": "macros/sql/date_spine.sql", "unique_id": "macro.dbt_utils.get_intervals_between", "macro_sql": "{% macro get_intervals_between(start_date, end_date, datepart) -%}\n {{ return(adapter.dispatch('get_intervals_between', 'dbt_utils')(start_date, end_date, datepart)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__get_intervals_between"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "start_date", "type": null, "description": ""}, {"name": "end_date", "type": null, "description": ""}, {"name": "datepart", "type": null, "description": ""}], "created_at": 1786586788.018293, "supported_languages": null}, "macro.dbt_utils.default__get_intervals_between": {"name": "default__get_intervals_between", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/date_spine.sql", "original_file_path": "macros/sql/date_spine.sql", "unique_id": "macro.dbt_utils.default__get_intervals_between", "macro_sql": "{% macro default__get_intervals_between(start_date, end_date, datepart) -%}\n {%- call statement('get_intervals_between', fetch_result=True) %}\n\n select {{ dbt.datediff(start_date, end_date, datepart) }}\n\n {%- endcall -%}\n\n {%- set value_list = load_result('get_intervals_between') -%}\n\n {%- if value_list and value_list['data'] -%}\n {%- set values = value_list['data'] | map(attribute=0) | list %}\n {{ return(values[0]) }}\n {%- else -%}\n {{ return(1) }}\n {%- endif -%}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.statement", "macro.dbt.datediff"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "start_date", "type": null, "description": ""}, {"name": "end_date", "type": null, "description": ""}, {"name": "datepart", "type": null, "description": ""}], "created_at": 1786586788.0192664, "supported_languages": null}, "macro.dbt_utils.date_spine": {"name": "date_spine", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/date_spine.sql", "original_file_path": "macros/sql/date_spine.sql", "unique_id": "macro.dbt_utils.date_spine", "macro_sql": "{% macro date_spine(datepart, start_date, end_date) %}\n {{ return(adapter.dispatch('date_spine', 'dbt_utils')(datepart, start_date, end_date)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__date_spine"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "datepart", "type": null, "description": ""}, {"name": "start_date", "type": null, "description": ""}, {"name": "end_date", "type": null, "description": ""}], "created_at": 1786586788.0196486, "supported_languages": null}, "macro.dbt_utils.default__date_spine": {"name": "default__date_spine", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/date_spine.sql", "original_file_path": "macros/sql/date_spine.sql", "unique_id": "macro.dbt_utils.default__date_spine", "macro_sql": "{% macro default__date_spine(datepart, start_date, end_date) %}\n\n\n{# call as follows:\n\ndate_spine(\n \"day\",\n \"to_date('01/01/2016', 'mm/dd/yyyy')\",\n \"dbt.dateadd(week, 1, current_date)\"\n) #}\n\n\nwith rawdata as (\n\n {{dbt_utils.generate_series(\n dbt_utils.get_intervals_between(start_date, end_date, datepart)\n )}}\n\n),\n\nall_periods as (\n\n select (\n {{\n dbt.dateadd(\n datepart,\n \"row_number() over (order by generated_number) - 1\",\n start_date\n )\n }}\n ) as date_{{datepart}}\n from rawdata\n\n),\n\nfiltered as (\n\n select *\n from all_periods\n where date_{{datepart}} <= {{ end_date }}\n\n)\n\nselect * from filtered\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.generate_series", "macro.dbt_utils.get_intervals_between", "macro.dbt.dateadd"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "datepart", "type": null, "description": ""}, {"name": "start_date", "type": null, "description": ""}, {"name": "end_date", "type": null, "description": ""}], "created_at": 1786586788.020252, "supported_languages": null}, "macro.dbt_utils.get_column_values": {"name": "get_column_values", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_column_values.sql", "original_file_path": "macros/sql/get_column_values.sql", "unique_id": "macro.dbt_utils.get_column_values", "macro_sql": "{% macro get_column_values(table, column, order_by='count(*) desc', max_records=none, default=none, where=none) -%}\n {{ return(adapter.dispatch('get_column_values', 'dbt_utils')(table, column, order_by, max_records, default, where)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__get_column_values"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "table", "type": null, "description": ""}, {"name": "column", "type": null, "description": ""}, {"name": "order_by", "type": null, "description": ""}, {"name": "max_records", "type": null, "description": ""}, {"name": "default", "type": null, "description": ""}, {"name": "where", "type": null, "description": ""}], "created_at": 1786586788.0214684, "supported_languages": null}, "macro.dbt_utils.default__get_column_values": {"name": "default__get_column_values", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_column_values.sql", "original_file_path": "macros/sql/get_column_values.sql", "unique_id": "macro.dbt_utils.default__get_column_values", "macro_sql": "{% macro default__get_column_values(table, column, order_by='count(*) desc', max_records=none, default=none, where=none) -%}\n {#-- Prevent querying of db in parsing mode. This works because this macro does not create any new refs. #}\n {%- if not execute -%}\n {% set default = [] if not default %}\n {{ return(default) }}\n {% endif %}\n\n {%- do dbt_utils._is_ephemeral(table, 'get_column_values') -%}\n\n {# Not all relations are tables. Renaming for internal clarity without breaking functionality for anyone using named arguments #}\n {# TODO: Change the method signature in a future 0.x.0 release #}\n {%- set target_relation = table -%}\n\n {# adapter.load_relation is a convenience wrapper to avoid building a Relation when we already have one #}\n {% set relation_exists = (load_relation(target_relation)) is not none %}\n\n {%- call statement('get_column_values', fetch_result=true) %}\n\n {%- if not relation_exists and default is none -%}\n\n {{ exceptions.raise_compiler_error(\"In get_column_values(): relation \" ~ target_relation ~ \" does not exist and no default value was provided.\") }}\n\n {%- elif not relation_exists and default is not none -%}\n\n {{ log(\"Relation \" ~ target_relation ~ \" does not exist. Returning the default value: \" ~ default) }}\n\n {{ return(default) }}\n\n {%- else -%}\n\n\n select\n {{ column }} as value\n\n from {{ target_relation }}\n\n {% if where is not none %}\n where {{ where }}\n {% endif %}\n\n group by {{ column }}\n order by {{ order_by }}\n\n {% if max_records is not none %}\n limit {{ max_records }}\n {% endif %}\n\n {% endif %}\n\n {%- endcall -%}\n\n {%- set value_list = load_result('get_column_values') -%}\n\n {%- if value_list and value_list['data'] -%}\n {%- set values = value_list['data'] | map(attribute=0) | list %}\n {{ return(values) }}\n {%- else -%}\n {{ return(default) }}\n {%- endif -%}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_utils._is_ephemeral", "macro.dbt.load_relation", "macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "table", "type": null, "description": ""}, {"name": "column", "type": null, "description": ""}, {"name": "order_by", "type": null, "description": ""}, {"name": "max_records", "type": null, "description": ""}, {"name": "default", "type": null, "description": ""}, {"name": "where", "type": null, "description": ""}], "created_at": 1786586788.0239344, "supported_languages": null}, "macro.dbt_utils.star": {"name": "star", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/star.sql", "original_file_path": "macros/sql/star.sql", "unique_id": "macro.dbt_utils.star", "macro_sql": "{% macro star(from, relation_alias=False, except=[], prefix='', suffix='', quote_identifiers=True, unquote_aliases=False, rename={}) -%}\r\n {{ return(adapter.dispatch('star', 'dbt_utils')(from, relation_alias, except, prefix, suffix, quote_identifiers, unquote_aliases, rename)) }}\r\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__star"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "from", "type": null, "description": ""}, {"name": "relation_alias", "type": null, "description": ""}, {"name": "except", "type": null, "description": ""}, {"name": "prefix", "type": null, "description": ""}, {"name": "suffix", "type": null, "description": ""}, {"name": "quote_identifiers", "type": null, "description": ""}, {"name": "unquote_aliases", "type": null, "description": ""}, {"name": "rename", "type": null, "description": ""}], "created_at": 1786586788.025479, "supported_languages": null}, "macro.dbt_utils.default__star": {"name": "default__star", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/star.sql", "original_file_path": "macros/sql/star.sql", "unique_id": "macro.dbt_utils.default__star", "macro_sql": "{% macro default__star(from, relation_alias=False, except=[], prefix='', suffix='', quote_identifiers=True, unquote_aliases=False, rename={}) -%}\r\n {%- do dbt_utils._is_relation(from, 'star') -%}\r\n {%- do dbt_utils._is_ephemeral(from, 'star') -%}\r\n\r\n {#-- Prevent querying of db in parsing mode. This works because this macro does not create any new refs. #}\r\n {%- if not execute -%}\r\n {% do return('*') %}\r\n {%- endif -%}\r\n\r\n {% set cols = dbt_utils.get_filtered_columns_in_relation(from, except) %}\r\n\r\n {%- set rename_lower = {} -%}\r\n {%- for key, val in rename.items() -%}\r\n {%- do rename_lower.update({key.lower(): val}) -%}\r\n {%- endfor -%}\r\n\r\n {%- if cols|length <= 0 -%}\r\n {% if flags.WHICH == 'compile' %}\r\n {% set response %}\r\n*\r\n/* No columns were returned. Maybe the relation doesn't exist yet\r\nor all columns were excluded. This star is only output during\r\ndbt compile, and exists to keep SQLFluff happy. */\r\n {% endset %}\r\n {% do return(response) %}\r\n {% else %}\r\n {% do return(\"/* no columns returned from star() macro */\") %}\r\n {% endif %}\r\n {%- else -%}\r\n {%- for col in cols %}\r\n {%- if relation_alias %}{{ relation_alias }}.{% else %}{%- endif -%}\r\n {%- if quote_identifiers -%}\r\n {{ adapter.quote(col)|trim }}\r\n {%- if col.lower() in rename_lower %} as {{ rename_lower[col.lower()] }}\r\n {%- elif unquote_aliases %} as {{ (prefix ~ col ~ suffix)|trim }}\r\n {%- elif prefix!='' or suffix!='' %} as {{ adapter.quote(prefix ~ col ~ suffix)|trim }}\r\n {%- endif -%}\r\n {%- else -%}\r\n {{ col|trim }}\r\n {%- if col.lower() in rename_lower %} as {{ rename_lower[col.lower()] }}\r\n {%- elif prefix!='' or suffix!='' %} as {{ (prefix ~ col ~ suffix)|trim }}\r\n {%- endif -%}\r\n {%- endif -%}\r\n {%- if not loop.last %},{{ '\\n ' }}{%- endif -%}\r\n {%- endfor -%}\r\n {% endif %}\r\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_utils._is_relation", "macro.dbt_utils._is_ephemeral", "macro.dbt_utils.get_filtered_columns_in_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "from", "type": null, "description": ""}, {"name": "relation_alias", "type": null, "description": ""}, {"name": "except", "type": null, "description": ""}, {"name": "prefix", "type": null, "description": ""}, {"name": "suffix", "type": null, "description": ""}, {"name": "quote_identifiers", "type": null, "description": ""}, {"name": "unquote_aliases", "type": null, "description": ""}, {"name": "rename", "type": null, "description": ""}], "created_at": 1786586788.0288136, "supported_languages": null}, "macro.dbt_utils.safe_add": {"name": "safe_add", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/safe_add.sql", "original_file_path": "macros/sql/safe_add.sql", "unique_id": "macro.dbt_utils.safe_add", "macro_sql": "{%- macro safe_add(field_list) -%}\n {{ return(adapter.dispatch('safe_add', 'dbt_utils')(field_list)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__safe_add"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field_list", "type": null, "description": ""}], "created_at": 1786586788.0294354, "supported_languages": null}, "macro.dbt_utils.default__safe_add": {"name": "default__safe_add", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/safe_add.sql", "original_file_path": "macros/sql/safe_add.sql", "unique_id": "macro.dbt_utils.default__safe_add", "macro_sql": "\n\n{%- macro default__safe_add(field_list) -%}\n\n{%- if field_list is not iterable or field_list is string or field_list is mapping -%}\n\n{%- set error_message = '\nWarning: the `safe_add` macro now takes a single list argument instead of \\\nstring arguments. The {}.{} model triggered this warning. \\\n'.format(model.package_name, model.name) -%}\n\n{%- do exceptions.warn(error_message) -%}\n\n{%- endif -%}\n\n{% set fields = [] %}\n\n{%- for field in field_list -%}\n\n {% do fields.append(\"coalesce(\" ~ field ~ \", 0)\") %}\n\n{%- endfor -%}\n\n{{ fields|join(' +\\n ') }}\n\n{%- endmacro -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field_list", "type": null, "description": ""}], "created_at": 1786586788.0303423, "supported_languages": null}, "macro.dbt_utils.width_bucket": {"name": "width_bucket", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/width_bucket.sql", "original_file_path": "macros/sql/width_bucket.sql", "unique_id": "macro.dbt_utils.width_bucket", "macro_sql": "{% macro width_bucket(expr, min_value, max_value, num_buckets) %}\n {{ return(adapter.dispatch('width_bucket', 'dbt_utils') (expr, min_value, max_value, num_buckets)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__width_bucket"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "expr", "type": null, "description": ""}, {"name": "min_value", "type": null, "description": ""}, {"name": "max_value", "type": null, "description": ""}, {"name": "num_buckets", "type": null, "description": ""}], "created_at": 1786586788.0311024, "supported_languages": null}, "macro.dbt_utils.default__width_bucket": {"name": "default__width_bucket", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/width_bucket.sql", "original_file_path": "macros/sql/width_bucket.sql", "unique_id": "macro.dbt_utils.default__width_bucket", "macro_sql": "{% macro default__width_bucket(expr, min_value, max_value, num_buckets) -%}\n\n {% set bin_size -%}\n (( {{ max_value }} - {{ min_value }} ) / {{ num_buckets }} )\n {%- endset %}\n (\n -- to break ties when the amount is eaxtly at the bucket egde\n case\n when\n mod(\n {{ dbt.safe_cast(expr, dbt.type_numeric() ) }},\n {{ dbt.safe_cast(bin_size, dbt.type_numeric() ) }}\n ) = 0\n then 1\n else 0\n end\n ) +\n -- Anything over max_value goes the N+1 bucket\n least(\n ceil(\n ({{ expr }} - {{ min_value }})/{{ bin_size }}\n ),\n {{ num_buckets }} + 1\n )\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.safe_cast", "macro.dbt.type_numeric"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "expr", "type": null, "description": ""}, {"name": "min_value", "type": null, "description": ""}, {"name": "max_value", "type": null, "description": ""}, {"name": "num_buckets", "type": null, "description": ""}], "created_at": 1786586788.031863, "supported_languages": null}, "macro.dbt_utils.snowflake__width_bucket": {"name": "snowflake__width_bucket", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/width_bucket.sql", "original_file_path": "macros/sql/width_bucket.sql", "unique_id": "macro.dbt_utils.snowflake__width_bucket", "macro_sql": "{% macro snowflake__width_bucket(expr, min_value, max_value, num_buckets) %}\n width_bucket({{ expr }}, {{ min_value }}, {{ max_value }}, {{ num_buckets }} )\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "expr", "type": null, "description": ""}, {"name": "min_value", "type": null, "description": ""}, {"name": "max_value", "type": null, "description": ""}, {"name": "num_buckets", "type": null, "description": ""}], "created_at": 1786586788.0322056, "supported_languages": null}, "macro.dbt_utils.get_table_types_sql": {"name": "get_table_types_sql", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_table_types_sql.sql", "original_file_path": "macros/sql/get_table_types_sql.sql", "unique_id": "macro.dbt_utils.get_table_types_sql", "macro_sql": "{%- macro get_table_types_sql() -%}\n {{ return(adapter.dispatch('get_table_types_sql', 'dbt_utils')()) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt_utils.postgres__get_table_types_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1786586788.0327384, "supported_languages": null}, "macro.dbt_utils.default__get_table_types_sql": {"name": "default__get_table_types_sql", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_table_types_sql.sql", "original_file_path": "macros/sql/get_table_types_sql.sql", "unique_id": "macro.dbt_utils.default__get_table_types_sql", "macro_sql": "{% macro default__get_table_types_sql() %}\n case table_type\n when 'BASE TABLE' then 'table'\n when 'EXTERNAL TABLE' then 'external'\n when 'MATERIALIZED VIEW' then 'materializedview'\n else lower(table_type)\n end as {{ adapter.quote('table_type') }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1786586788.0329878, "supported_languages": null}, "macro.dbt_utils.postgres__get_table_types_sql": {"name": "postgres__get_table_types_sql", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_table_types_sql.sql", "original_file_path": "macros/sql/get_table_types_sql.sql", "unique_id": "macro.dbt_utils.postgres__get_table_types_sql", "macro_sql": "{% macro postgres__get_table_types_sql() %}\n case table_type\n when 'BASE TABLE' then 'table'\n when 'FOREIGN' then 'external'\n when 'MATERIALIZED VIEW' then 'materializedview'\n else lower(table_type)\n end as {{ adapter.quote('table_type') }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1786586788.0332205, "supported_languages": null}, "macro.dbt_utils.databricks__get_table_types_sql": {"name": "databricks__get_table_types_sql", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_table_types_sql.sql", "original_file_path": "macros/sql/get_table_types_sql.sql", "unique_id": "macro.dbt_utils.databricks__get_table_types_sql", "macro_sql": "{% macro databricks__get_table_types_sql() %}\n case table_type\n when 'MANAGED' then 'table'\n when 'BASE TABLE' then 'table'\n when 'MATERIALIZED VIEW' then 'materializedview'\n else lower(table_type)\n end as {{ adapter.quote('table_type') }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1786586788.0334446, "supported_languages": null}, "macro.dbt_utils.safe_divide": {"name": "safe_divide", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/safe_divide.sql", "original_file_path": "macros/sql/safe_divide.sql", "unique_id": "macro.dbt_utils.safe_divide", "macro_sql": "{% macro safe_divide(numerator, denominator) -%}\n {{ return(adapter.dispatch('safe_divide', 'dbt_utils')(numerator, denominator)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__safe_divide"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "numerator", "type": null, "description": ""}, {"name": "denominator", "type": null, "description": ""}], "created_at": 1786586788.033914, "supported_languages": null}, "macro.dbt_utils.default__safe_divide": {"name": "default__safe_divide", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/safe_divide.sql", "original_file_path": "macros/sql/safe_divide.sql", "unique_id": "macro.dbt_utils.default__safe_divide", "macro_sql": "{% macro default__safe_divide(numerator, denominator) %}\n ( {{ numerator }} ) / nullif( ( {{ denominator }} ), 0)\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "numerator", "type": null, "description": ""}, {"name": "denominator", "type": null, "description": ""}], "created_at": 1786586788.034142, "supported_languages": null}, "macro.dbt_utils.get_tables_by_pattern_sql": {"name": "get_tables_by_pattern_sql", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_tables_by_pattern_sql.sql", "original_file_path": "macros/sql/get_tables_by_pattern_sql.sql", "unique_id": "macro.dbt_utils.get_tables_by_pattern_sql", "macro_sql": "{% macro get_tables_by_pattern_sql(schema_pattern, table_pattern, exclude='', database=target.database) %}\n {{ return(adapter.dispatch('get_tables_by_pattern_sql', 'dbt_utils')\n (schema_pattern, table_pattern, exclude, database)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__get_tables_by_pattern_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "schema_pattern", "type": null, "description": ""}, {"name": "table_pattern", "type": null, "description": ""}, {"name": "exclude", "type": null, "description": ""}, {"name": "database", "type": null, "description": ""}], "created_at": 1786586788.0354779, "supported_languages": null}, "macro.dbt_utils.default__get_tables_by_pattern_sql": {"name": "default__get_tables_by_pattern_sql", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_tables_by_pattern_sql.sql", "original_file_path": "macros/sql/get_tables_by_pattern_sql.sql", "unique_id": "macro.dbt_utils.default__get_tables_by_pattern_sql", "macro_sql": "{% macro default__get_tables_by_pattern_sql(schema_pattern, table_pattern, exclude='', database=target.database) %}\n\n select distinct\n table_schema as {{ adapter.quote('table_schema') }},\n table_name as {{ adapter.quote('table_name') }},\n {{ dbt_utils.get_table_types_sql() }}\n from {{ database }}.information_schema.tables\n where table_schema ilike '{{ schema_pattern }}'\n and table_name ilike '{{ table_pattern }}'\n and table_name not ilike '{{ exclude }}'\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.get_table_types_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "schema_pattern", "type": null, "description": ""}, {"name": "table_pattern", "type": null, "description": ""}, {"name": "exclude", "type": null, "description": ""}, {"name": "database", "type": null, "description": ""}], "created_at": 1786586788.0360959, "supported_languages": null}, "macro.dbt_utils.redshift__get_tables_by_pattern_sql": {"name": "redshift__get_tables_by_pattern_sql", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_tables_by_pattern_sql.sql", "original_file_path": "macros/sql/get_tables_by_pattern_sql.sql", "unique_id": "macro.dbt_utils.redshift__get_tables_by_pattern_sql", "macro_sql": "{% macro redshift__get_tables_by_pattern_sql(schema_pattern, table_pattern, exclude='', database=target.database) %}\n\n {% set sql %}\n select distinct\n table_schema as {{ adapter.quote('table_schema') }},\n table_name as {{ adapter.quote('table_name') }},\n {{ dbt_utils.get_table_types_sql() }}\n from \"{{ database }}\".\"information_schema\".\"tables\"\n where table_schema ilike '{{ schema_pattern }}'\n and table_name ilike '{{ table_pattern }}'\n and table_name not ilike '{{ exclude }}'\n union all\n select distinct\n schemaname as {{ adapter.quote('table_schema') }},\n tablename as {{ adapter.quote('table_name') }},\n 'external' as {{ adapter.quote('table_type') }}\n from svv_external_tables\n where redshift_database_name = '{{ database }}'\n and schemaname ilike '{{ schema_pattern }}'\n and table_name ilike '{{ table_pattern }}'\n and table_name not ilike '{{ exclude }}'\n {% endset %}\n\n {{ return(sql) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.get_table_types_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "schema_pattern", "type": null, "description": ""}, {"name": "table_pattern", "type": null, "description": ""}, {"name": "exclude", "type": null, "description": ""}, {"name": "database", "type": null, "description": ""}], "created_at": 1786586788.0372932, "supported_languages": null}, "macro.dbt_utils.bigquery__get_tables_by_pattern_sql": {"name": "bigquery__get_tables_by_pattern_sql", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_tables_by_pattern_sql.sql", "original_file_path": "macros/sql/get_tables_by_pattern_sql.sql", "unique_id": "macro.dbt_utils.bigquery__get_tables_by_pattern_sql", "macro_sql": "{% macro bigquery__get_tables_by_pattern_sql(schema_pattern, table_pattern, exclude='', database=target.database) %}\n\n {% if '%' in schema_pattern %}\n {% set schemata=dbt_utils._bigquery__get_matching_schemata(schema_pattern, database) %}\n {% else %}\n {% set schemata=[schema_pattern] %}\n {% endif %}\n\n {% set sql %}\n {% for schema in schemata %}\n select distinct\n table_schema,\n table_name,\n {{ dbt_utils.get_table_types_sql() }}\n\n from {{ adapter.quote(database) }}.{{ schema }}.INFORMATION_SCHEMA.TABLES\n where lower(table_name) like lower ('{{ table_pattern }}')\n and lower(table_name) not like lower ('{{ exclude }}')\n\n {% if not loop.last %} union all {% endif %}\n\n {% endfor %}\n {% endset %}\n\n {{ return(sql) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils._bigquery__get_matching_schemata", "macro.dbt_utils.get_table_types_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "schema_pattern", "type": null, "description": ""}, {"name": "table_pattern", "type": null, "description": ""}, {"name": "exclude", "type": null, "description": ""}, {"name": "database", "type": null, "description": ""}], "created_at": 1786586788.0384731, "supported_languages": null}, "macro.dbt_utils._bigquery__get_matching_schemata": {"name": "_bigquery__get_matching_schemata", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_tables_by_pattern_sql.sql", "original_file_path": "macros/sql/get_tables_by_pattern_sql.sql", "unique_id": "macro.dbt_utils._bigquery__get_matching_schemata", "macro_sql": "{% macro _bigquery__get_matching_schemata(schema_pattern, database) %}\n {% if execute %}\n\n {% set sql %}\n select schema_name from {{ adapter.quote(database) }}.INFORMATION_SCHEMA.SCHEMATA\n where lower(schema_name) like lower('{{ schema_pattern }}')\n {% endset %}\n\n {% set results=run_query(sql) %}\n\n {% set schemata=results.columns['schema_name'].values() %}\n\n {{ return(schemata) }}\n\n {% else %}\n\n {{ return([]) }}\n\n {% endif %}\n\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "schema_pattern", "type": null, "description": ""}, {"name": "database", "type": null, "description": ""}], "created_at": 1786586788.0392945, "supported_languages": null}, "macro.dbt_utils.union_relations": {"name": "union_relations", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/union.sql", "original_file_path": "macros/sql/union.sql", "unique_id": "macro.dbt_utils.union_relations", "macro_sql": "{%- macro union_relations(relations, column_override=none, include=[], exclude=[], source_column_name='_dbt_source_relation', where=none) -%}\n {{ return(adapter.dispatch('union_relations', 'dbt_utils')(relations, column_override, include, exclude, source_column_name, where)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__union_relations"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relations", "type": null, "description": ""}, {"name": "column_override", "type": null, "description": ""}, {"name": "include", "type": null, "description": ""}, {"name": "exclude", "type": null, "description": ""}, {"name": "source_column_name", "type": null, "description": ""}, {"name": "where", "type": null, "description": ""}], "created_at": 1786586788.041158, "supported_languages": null}, "macro.dbt_utils.default__union_relations": {"name": "default__union_relations", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/union.sql", "original_file_path": "macros/sql/union.sql", "unique_id": "macro.dbt_utils.default__union_relations", "macro_sql": "\n\n{%- macro default__union_relations(relations, column_override=none, include=[], exclude=[], source_column_name='_dbt_source_relation', where=none) -%}\n\n {%- if exclude and include -%}\n {{ exceptions.raise_compiler_error(\"Both an exclude and include list were provided to the `union` macro. Only one is allowed\") }}\n {%- endif -%}\n\n {#-- Prevent querying of db in parsing mode. This works because this macro does not create any new refs. -#}\n {%- if not execute %}\n {{ return('') }}\n {% endif -%}\n\n {%- set column_override = column_override if column_override is not none else {} -%}\n\n {%- set relation_columns = {} -%}\n {%- set column_superset = {} -%}\n {%- set all_excludes = [] -%}\n {%- set all_includes = [] -%}\n\n {%- if exclude -%}\n {%- for exc in exclude -%}\n {%- do all_excludes.append(exc | lower) -%}\n {%- endfor -%}\n {%- endif -%}\n\n {%- if include -%}\n {%- for inc in include -%}\n {%- do all_includes.append(inc | lower) -%}\n {%- endfor -%}\n {%- endif -%}\n\n {%- for relation in relations -%}\n\n {%- do relation_columns.update({relation: []}) -%}\n\n {%- do dbt_utils._is_relation(relation, 'union_relations') -%}\n {%- do dbt_utils._is_ephemeral(relation, 'union_relations') -%}\n {%- set cols = adapter.get_columns_in_relation(relation) -%}\n {%- for col in cols -%}\n\n {#- If an exclude list was provided and the column is in the list, do nothing -#}\n {%- if exclude and col.column | lower in all_excludes -%}\n\n {#- If an include list was provided and the column is not in the list, do nothing -#}\n {%- elif include and col.column | lower not in all_includes -%}\n\n {#- Otherwise add the column to the column superset -#}\n {%- else -%}\n\n {#- update the list of columns in this relation -#}\n {%- do relation_columns[relation].append(col.column) -%}\n\n {%- if col.column in column_superset -%}\n\n {%- set stored = column_superset[col.column] -%}\n {%- if col.is_string() and stored.is_string() and col.string_size() > stored.string_size() -%}\n\n {%- do column_superset.update({col.column: col}) -%}\n\n {%- endif %}\n\n {%- else -%}\n\n {%- do column_superset.update({col.column: col}) -%}\n\n {%- endif -%}\n\n {%- endif -%}\n\n {%- endfor -%}\n {%- endfor -%}\n\n {%- set ordered_column_names = column_superset.keys() -%}\n {%- set dbt_command = flags.WHICH -%}\n\n\n {% if dbt_command in ['run', 'build'] %}\n {% if (include | length > 0 or exclude | length > 0) and not column_superset.keys() %}\n {%- set relations_string -%}\n {%- for relation in relations -%}\n {{ relation.name }}\n {%- if not loop.last %}, {% endif -%}\n {%- endfor -%}\n {%- endset -%}\n\n {%- set error_message -%}\n There were no columns found to union for relations {{ relations_string }}\n {%- endset -%}\n\n {{ exceptions.raise_compiler_error(error_message) }}\n {%- endif -%}\n {%- endif -%}\n\n {%- for relation in relations %}\n\n (\n select\n\n {%- if source_column_name is not none %}\n cast({{ dbt.string_literal(relation.render()) }} as {{ dbt.type_string() }}) as {{ source_column_name }},\n {%- endif %}\n\n /* No columns from any of the relations.\n This star is only output during dbt compile, and exists to keep SQLFluff happy. */\n {% if dbt_command == 'compile' and ordered_column_names|length == 0 %}\n *\n {% endif %}\n\n {% for col_name in ordered_column_names -%}\n\n {%- set col = column_superset[col_name] %}\n {%- set col_type = column_override.get(col.column, col.data_type) %}\n {%- set col_name = adapter.quote(col_name) if col_name in relation_columns[relation] else 'null' %}\n cast({{ col_name }} as {{ col_type }}) as {{ col.quoted }} {% if not loop.last %},{% endif -%}\n\n {%- endfor %}\n\n from {{ relation }}\n\n {% if where -%}\n where {{ where }}\n {%- endif %}\n )\n\n {% if not loop.last -%}\n union all\n {% endif -%}\n\n {%- endfor -%}\n\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt_utils._is_relation", "macro.dbt_utils._is_ephemeral", "macro.dbt.string_literal", "macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relations", "type": null, "description": ""}, {"name": "column_override", "type": null, "description": ""}, {"name": "include", "type": null, "description": ""}, {"name": "exclude", "type": null, "description": ""}, {"name": "source_column_name", "type": null, "description": ""}, {"name": "where", "type": null, "description": ""}], "created_at": 1786586788.0469046, "supported_languages": null}, "macro.dbt_utils.surrogate_key": {"name": "surrogate_key", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/surrogate_key.sql", "original_file_path": "macros/sql/surrogate_key.sql", "unique_id": "macro.dbt_utils.surrogate_key", "macro_sql": "{%- macro surrogate_key(field_list) -%}\n {% set frustrating_jinja_feature = varargs %}\n {{ return(adapter.dispatch('surrogate_key', 'dbt_utils')(field_list, *varargs)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__surrogate_key"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field_list", "type": null, "description": ""}], "created_at": 1786586788.0475304, "supported_languages": null}, "macro.dbt_utils.default__surrogate_key": {"name": "default__surrogate_key", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/surrogate_key.sql", "original_file_path": "macros/sql/surrogate_key.sql", "unique_id": "macro.dbt_utils.default__surrogate_key", "macro_sql": "\n\n{%- macro default__surrogate_key(field_list) -%}\n\n{%- set error_message = '\nWarning: `dbt_utils.surrogate_key` has been replaced by \\\n`dbt_utils.generate_surrogate_key`. The new macro treats null values \\\ndifferently to empty strings. To restore the behaviour of the original \\\nmacro, add a global variable in dbt_project.yml called \\\n`surrogate_key_treat_nulls_as_empty_strings` to your \\\ndbt_project.yml file with a value of True. \\\nThe {}.{} model triggered this warning. \\\n'.format(model.package_name, model.name) -%}\n\n{%- do exceptions.raise_compiler_error(error_message) -%}\n\n{%- endmacro -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field_list", "type": null, "description": ""}], "created_at": 1786586788.0479324, "supported_languages": null}, "macro.dbt_utils.generate_surrogate_key": {"name": "generate_surrogate_key", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/generate_surrogate_key.sql", "original_file_path": "macros/sql/generate_surrogate_key.sql", "unique_id": "macro.dbt_utils.generate_surrogate_key", "macro_sql": "{%- macro generate_surrogate_key(field_list) -%}\n {{ return(adapter.dispatch('generate_surrogate_key', 'dbt_utils')(field_list)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__generate_surrogate_key"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field_list", "type": null, "description": ""}], "created_at": 1786586788.0485518, "supported_languages": null}, "macro.dbt_utils.default__generate_surrogate_key": {"name": "default__generate_surrogate_key", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/generate_surrogate_key.sql", "original_file_path": "macros/sql/generate_surrogate_key.sql", "unique_id": "macro.dbt_utils.default__generate_surrogate_key", "macro_sql": "\n\n{%- macro default__generate_surrogate_key(field_list) -%}\n\n{%- if var('surrogate_key_treat_nulls_as_empty_strings', False) -%}\n {%- set default_null_value = \"\" -%}\n{%- else -%}\n {%- set default_null_value = '_dbt_utils_surrogate_key_null_' -%}\n{%- endif -%}\n\n{%- set fields = [] -%}\n\n{%- for field in field_list -%}\n\n {%- do fields.append(\n \"coalesce(cast(\" ~ field ~ \" as \" ~ dbt.type_string() ~ \"), '\" ~ default_null_value ~\"')\"\n ) -%}\n\n {%- if not loop.last %}\n {%- do fields.append(\"'-'\") -%}\n {%- endif -%}\n\n{%- endfor -%}\n\n{{ dbt.hash(dbt.concat(fields)) }}\n\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt.type_string", "macro.dbt.hash", "macro.dbt.concat"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field_list", "type": null, "description": ""}], "created_at": 1786586788.0495882, "supported_languages": null}, "macro.dbt_utils.deduplicate": {"name": "deduplicate", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/deduplicate.sql", "original_file_path": "macros/sql/deduplicate.sql", "unique_id": "macro.dbt_utils.deduplicate", "macro_sql": "{%- macro deduplicate(relation, partition_by, order_by) -%}\n {{ return(adapter.dispatch('deduplicate', 'dbt_utils')(relation, partition_by, order_by)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.postgres__deduplicate"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "partition_by", "type": null, "description": ""}, {"name": "order_by", "type": null, "description": ""}], "created_at": 1786586788.0505579, "supported_languages": null}, "macro.dbt_utils.default__deduplicate": {"name": "default__deduplicate", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/deduplicate.sql", "original_file_path": "macros/sql/deduplicate.sql", "unique_id": "macro.dbt_utils.default__deduplicate", "macro_sql": "\n\n{%- macro default__deduplicate(relation, partition_by, order_by) -%}\n\n with row_numbered as (\n select\n _inner.*,\n row_number() over (\n partition by {{ partition_by }}\n order by {{ order_by }}\n ) as rn\n from {{ relation }} as _inner\n )\n\n select\n distinct data.*\n from {{ relation }} as data\n {#\n -- Not all DBs will support natural joins but the ones that do include:\n -- Oracle, MySQL, SQLite, Redshift, Teradata, Materialize, Databricks\n -- Apache Spark, SingleStore, Vertica\n -- Those that do not appear to support natural joins include:\n -- SQLServer, Trino, Presto, Rockset, Athena\n #}\n natural join row_numbered\n where row_numbered.rn = 1\n\n{%- endmacro -%}\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "partition_by", "type": null, "description": ""}, {"name": "order_by", "type": null, "description": ""}], "created_at": 1786586788.0509322, "supported_languages": null}, "macro.dbt_utils.redshift__deduplicate": {"name": "redshift__deduplicate", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/deduplicate.sql", "original_file_path": "macros/sql/deduplicate.sql", "unique_id": "macro.dbt_utils.redshift__deduplicate", "macro_sql": "{% macro redshift__deduplicate(relation, partition_by, order_by) -%}\n\n select *\n from {{ relation }} as tt\n qualify\n row_number() over (\n partition by {{ partition_by }}\n order by {{ order_by }}\n ) = 1\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "partition_by", "type": null, "description": ""}, {"name": "order_by", "type": null, "description": ""}], "created_at": 1786586788.0512137, "supported_languages": null}, "macro.dbt_utils.postgres__deduplicate": {"name": "postgres__deduplicate", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/deduplicate.sql", "original_file_path": "macros/sql/deduplicate.sql", "unique_id": "macro.dbt_utils.postgres__deduplicate", "macro_sql": "\n{%- macro postgres__deduplicate(relation, partition_by, order_by) -%}\n\n select\n distinct on ({{ partition_by }}) *\n from {{ relation }}\n order by {{ partition_by }}{{ ',' ~ order_by }}\n\n{%- endmacro -%}\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "partition_by", "type": null, "description": ""}, {"name": "order_by", "type": null, "description": ""}], "created_at": 1786586788.0515285, "supported_languages": null}, "macro.dbt_utils.snowflake__deduplicate": {"name": "snowflake__deduplicate", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/deduplicate.sql", "original_file_path": "macros/sql/deduplicate.sql", "unique_id": "macro.dbt_utils.snowflake__deduplicate", "macro_sql": "\n{%- macro snowflake__deduplicate(relation, partition_by, order_by) -%}\n\n select *\n from {{ relation }}\n qualify\n row_number() over (\n partition by {{ partition_by }}\n order by {{ order_by }}\n ) = 1\n\n{%- endmacro -%}\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "partition_by", "type": null, "description": ""}, {"name": "order_by", "type": null, "description": ""}], "created_at": 1786586788.0518034, "supported_languages": null}, "macro.dbt_utils.databricks__deduplicate": {"name": "databricks__deduplicate", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/deduplicate.sql", "original_file_path": "macros/sql/deduplicate.sql", "unique_id": "macro.dbt_utils.databricks__deduplicate", "macro_sql": "\n{%- macro databricks__deduplicate(relation, partition_by, order_by) -%}\n\n select *\n from {{ relation }}\n qualify\n row_number() over (\n partition by {{ partition_by }}\n order by {{ order_by }}\n ) = 1\n\n{%- endmacro -%}\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "partition_by", "type": null, "description": ""}, {"name": "order_by", "type": null, "description": ""}], "created_at": 1786586788.052089, "supported_languages": null}, "macro.dbt_utils.bigquery__deduplicate": {"name": "bigquery__deduplicate", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/deduplicate.sql", "original_file_path": "macros/sql/deduplicate.sql", "unique_id": "macro.dbt_utils.bigquery__deduplicate", "macro_sql": "\n{%- macro bigquery__deduplicate(relation, partition_by, order_by) -%}\n\n select unique.*\n from (\n select\n array_agg (\n original\n order by {{ order_by }}\n limit 1\n )[offset(0)] unique\n from {{ relation }} original\n group by {{ partition_by }}\n )\n\n{%- endmacro -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "partition_by", "type": null, "description": ""}, {"name": "order_by", "type": null, "description": ""}], "created_at": 1786586788.0523736, "supported_languages": null}, "macro.dbt_utils.get_relations_by_pattern": {"name": "get_relations_by_pattern", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_relations_by_pattern.sql", "original_file_path": "macros/sql/get_relations_by_pattern.sql", "unique_id": "macro.dbt_utils.get_relations_by_pattern", "macro_sql": "{% macro get_relations_by_pattern(schema_pattern, table_pattern, exclude='', database=target.database) %}\n {{ return(adapter.dispatch('get_relations_by_pattern', 'dbt_utils')(schema_pattern, table_pattern, exclude, database)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__get_relations_by_pattern"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "schema_pattern", "type": null, "description": ""}, {"name": "table_pattern", "type": null, "description": ""}, {"name": "exclude", "type": null, "description": ""}, {"name": "database", "type": null, "description": ""}], "created_at": 1786586788.0531833, "supported_languages": null}, "macro.dbt_utils.default__get_relations_by_pattern": {"name": "default__get_relations_by_pattern", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_relations_by_pattern.sql", "original_file_path": "macros/sql/get_relations_by_pattern.sql", "unique_id": "macro.dbt_utils.default__get_relations_by_pattern", "macro_sql": "{% macro default__get_relations_by_pattern(schema_pattern, table_pattern, exclude='', database=target.database) %}\n\n {%- call statement('get_tables', fetch_result=True) %}\n\n {{ dbt_utils.get_tables_by_pattern_sql(schema_pattern, table_pattern, exclude, database) }}\n\n {%- endcall -%}\n\n {%- set table_list = load_result('get_tables') -%}\n\n {%- if table_list and table_list['table'] -%}\n {%- set tbl_relations = [] -%}\n {%- for row in table_list['table'] -%}\n {%- set tbl_relation = api.Relation.create(\n database=database,\n schema=row.table_schema,\n identifier=row.table_name,\n type=row.table_type\n ) -%}\n {%- do tbl_relations.append(tbl_relation) -%}\n {%- endfor -%}\n\n {{ return(tbl_relations) }}\n {%- else -%}\n {{ return([]) }}\n {%- endif -%}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement", "macro.dbt_utils.get_tables_by_pattern_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "schema_pattern", "type": null, "description": ""}, {"name": "table_pattern", "type": null, "description": ""}, {"name": "exclude", "type": null, "description": ""}, {"name": "database", "type": null, "description": ""}], "created_at": 1786586788.0546846, "supported_languages": null}, "macro.dbt_utils.degrees_to_radians": {"name": "degrees_to_radians", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/haversine_distance.sql", "original_file_path": "macros/sql/haversine_distance.sql", "unique_id": "macro.dbt_utils.degrees_to_radians", "macro_sql": "{% macro degrees_to_radians(degrees) -%}\n acos(-1) * {{degrees}} / 180\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "degrees", "type": null, "description": ""}], "created_at": 1786586788.0554788, "supported_languages": null}, "macro.dbt_utils.haversine_distance": {"name": "haversine_distance", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/haversine_distance.sql", "original_file_path": "macros/sql/haversine_distance.sql", "unique_id": "macro.dbt_utils.haversine_distance", "macro_sql": "{% macro haversine_distance(lat1, lon1, lat2, lon2, unit='mi') -%}\n {{ return(adapter.dispatch('haversine_distance', 'dbt_utils')(lat1,lon1,lat2,lon2,unit)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__haversine_distance"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "lat1", "type": null, "description": ""}, {"name": "lon1", "type": null, "description": ""}, {"name": "lat2", "type": null, "description": ""}, {"name": "lon2", "type": null, "description": ""}, {"name": "unit", "type": null, "description": ""}], "created_at": 1786586788.0559533, "supported_languages": null}, "macro.dbt_utils.default__haversine_distance": {"name": "default__haversine_distance", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/haversine_distance.sql", "original_file_path": "macros/sql/haversine_distance.sql", "unique_id": "macro.dbt_utils.default__haversine_distance", "macro_sql": "{% macro default__haversine_distance(lat1, lon1, lat2, lon2, unit='mi') -%}\n{%- if unit == 'mi' %}\n {% set conversion_rate = 1 %}\n{% elif unit == 'km' %}\n {% set conversion_rate = 1.60934 %}\n{% else %}\n {{ exceptions.raise_compiler_error(\"unit input must be one of 'mi' or 'km'. Got \" ~ unit) }}\n{% endif %}\n\n 2 * 3961 * asin(sqrt(power((sin(radians(({{ lat2 }} - {{ lat1 }}) / 2))), 2) +\n cos(radians({{lat1}})) * cos(radians({{lat2}})) *\n power((sin(radians(({{ lon2 }} - {{ lon1 }}) / 2))), 2))) * {{ conversion_rate }}\n\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "lat1", "type": null, "description": ""}, {"name": "lon1", "type": null, "description": ""}, {"name": "lat2", "type": null, "description": ""}, {"name": "lon2", "type": null, "description": ""}, {"name": "unit", "type": null, "description": ""}], "created_at": 1786586788.056857, "supported_languages": null}, "macro.dbt_utils.bigquery__haversine_distance": {"name": "bigquery__haversine_distance", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/haversine_distance.sql", "original_file_path": "macros/sql/haversine_distance.sql", "unique_id": "macro.dbt_utils.bigquery__haversine_distance", "macro_sql": "{% macro bigquery__haversine_distance(lat1, lon1, lat2, lon2, unit='mi') -%}\n{% set radians_lat1 = dbt_utils.degrees_to_radians(lat1) %}\n{% set radians_lat2 = dbt_utils.degrees_to_radians(lat2) %}\n{% set radians_lon1 = dbt_utils.degrees_to_radians(lon1) %}\n{% set radians_lon2 = dbt_utils.degrees_to_radians(lon2) %}\n{%- if unit == 'mi' %}\n {% set conversion_rate = 1 %}\n{% elif unit == 'km' %}\n {% set conversion_rate = 1.60934 %}\n{% else %}\n {{ exceptions.raise_compiler_error(\"unit input must be one of 'mi' or 'km'. Got \" ~ unit) }}\n{% endif %}\n 2 * 3961 * asin(sqrt(power(sin(({{ radians_lat2 }} - {{ radians_lat1 }}) / 2), 2) +\n cos({{ radians_lat1 }}) * cos({{ radians_lat2 }}) *\n power(sin(({{ radians_lon2 }} - {{ radians_lon1 }}) / 2), 2))) * {{ conversion_rate }}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.degrees_to_radians"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "lat1", "type": null, "description": ""}, {"name": "lon1", "type": null, "description": ""}, {"name": "lat2", "type": null, "description": ""}, {"name": "lon2", "type": null, "description": ""}, {"name": "unit", "type": null, "description": ""}], "created_at": 1786586788.0582044, "supported_languages": null}, "macro.dbt_utils.get_powers_of_two": {"name": "get_powers_of_two", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/generate_series.sql", "original_file_path": "macros/sql/generate_series.sql", "unique_id": "macro.dbt_utils.get_powers_of_two", "macro_sql": "{% macro get_powers_of_two(upper_bound) %}\n {{ return(adapter.dispatch('get_powers_of_two', 'dbt_utils')(upper_bound)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__get_powers_of_two"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "upper_bound", "type": null, "description": ""}], "created_at": 1786586788.0589812, "supported_languages": null}, "macro.dbt_utils.default__get_powers_of_two": {"name": "default__get_powers_of_two", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/generate_series.sql", "original_file_path": "macros/sql/generate_series.sql", "unique_id": "macro.dbt_utils.default__get_powers_of_two", "macro_sql": "{% macro default__get_powers_of_two(upper_bound) %}\n\n {% if upper_bound <= 0 %}\n {{ exceptions.raise_compiler_error(\"upper bound must be positive\") }}\n {% endif %}\n\n {% for _ in range(1, 100) %}\n {% if upper_bound <= 2 ** loop.index %}{{ return(loop.index) }}{% endif %}\n {% endfor %}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "upper_bound", "type": null, "description": ""}], "created_at": 1786586788.0596583, "supported_languages": null}, "macro.dbt_utils.generate_series": {"name": "generate_series", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/generate_series.sql", "original_file_path": "macros/sql/generate_series.sql", "unique_id": "macro.dbt_utils.generate_series", "macro_sql": "{% macro generate_series(upper_bound) %}\n {{ return(adapter.dispatch('generate_series', 'dbt_utils')(upper_bound)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__generate_series"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "upper_bound", "type": null, "description": ""}], "created_at": 1786586788.0599866, "supported_languages": null}, "macro.dbt_utils.default__generate_series": {"name": "default__generate_series", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/generate_series.sql", "original_file_path": "macros/sql/generate_series.sql", "unique_id": "macro.dbt_utils.default__generate_series", "macro_sql": "{% macro default__generate_series(upper_bound) %}\n\n {% set n = dbt_utils.get_powers_of_two(upper_bound) %}\n\n with p as (\n select 0 as generated_number union all select 1\n ), unioned as (\n\n select\n\n {% for i in range(n) %}\n p{{i}}.generated_number * power(2, {{i}})\n {% if not loop.last %} + {% endif %}\n {% endfor %}\n + 1\n as generated_number\n\n from\n\n {% for i in range(n) %}\n p as p{{i}}\n {% if not loop.last %} cross join {% endif %}\n {% endfor %}\n\n )\n\n select *\n from unioned\n where generated_number <= {{upper_bound}}\n order by generated_number\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.get_powers_of_two"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "upper_bound", "type": null, "description": ""}], "created_at": 1786586788.0608156, "supported_languages": null}, "macro.dbt_utils.nullcheck": {"name": "nullcheck", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/nullcheck.sql", "original_file_path": "macros/sql/nullcheck.sql", "unique_id": "macro.dbt_utils.nullcheck", "macro_sql": "{% macro nullcheck(cols) %}\n {{ return(adapter.dispatch('nullcheck', 'dbt_utils')(cols)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__nullcheck"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "cols", "type": null, "description": ""}], "created_at": 1786586788.061362, "supported_languages": null}, "macro.dbt_utils.default__nullcheck": {"name": "default__nullcheck", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/nullcheck.sql", "original_file_path": "macros/sql/nullcheck.sql", "unique_id": "macro.dbt_utils.default__nullcheck", "macro_sql": "{% macro default__nullcheck(cols) %}\n{%- for col in cols %}\n\n {% if col.is_string() -%}\n\n nullif({{col.name}},'') as {{col.name}}\n\n {%- else -%}\n\n {{col.name}}\n\n {%- endif -%}\n\n{%- if not loop.last -%} , {%- endif -%}\n\n{%- endfor -%}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "cols", "type": null, "description": ""}], "created_at": 1786586788.0619686, "supported_languages": null}, "macro.dbt_utils.unpivot": {"name": "unpivot", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/unpivot.sql", "original_file_path": "macros/sql/unpivot.sql", "unique_id": "macro.dbt_utils.unpivot", "macro_sql": "{% macro unpivot(relation=none, cast_to='varchar', exclude=none, remove=none, field_name='field_name', value_name='value', quote_identifiers=False) -%}\n {{ return(adapter.dispatch('unpivot', 'dbt_utils')(relation, cast_to, exclude, remove, field_name, value_name, quote_identifiers)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__unpivot"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "cast_to", "type": null, "description": ""}, {"name": "exclude", "type": null, "description": ""}, {"name": "remove", "type": null, "description": ""}, {"name": "field_name", "type": null, "description": ""}, {"name": "value_name", "type": null, "description": ""}, {"name": "quote_identifiers", "type": null, "description": ""}], "created_at": 1786586788.0632708, "supported_languages": null}, "macro.dbt_utils.default__unpivot": {"name": "default__unpivot", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/unpivot.sql", "original_file_path": "macros/sql/unpivot.sql", "unique_id": "macro.dbt_utils.default__unpivot", "macro_sql": "{% macro default__unpivot(relation=none, cast_to='varchar', exclude=none, remove=none, field_name='field_name', value_name='value', quote_identifiers=False) -%}\n\n {% if not relation %}\n {{ exceptions.raise_compiler_error(\"Error: argument `relation` is required for `unpivot` macro.\") }}\n {% endif %}\n\n {%- set exclude = exclude if exclude is not none else [] %}\n {%- set remove = remove if remove is not none else [] %}\n\n {%- set include_cols = [] %}\n\n {%- set table_columns = {} %}\n\n {%- do table_columns.update({relation: []}) %}\n\n {%- do dbt_utils._is_relation(relation, 'unpivot') -%}\n {%- do dbt_utils._is_ephemeral(relation, 'unpivot') -%}\n {%- set cols = adapter.get_columns_in_relation(relation) %}\n\n {%- for col in cols -%}\n {%- if col.column.lower() not in remove|map('lower') and col.column.lower() not in exclude|map('lower') -%}\n {% do include_cols.append(col) %}\n {%- endif %}\n {%- endfor %}\n\n\n {%- for col in include_cols -%}\n {%- set current_col_name = adapter.quote(col.column) if quote_identifiers else col.column -%}\n select\n {%- for exclude_col in exclude %}\n {{ adapter.quote(exclude_col) if quote_identifiers else exclude_col }},\n {%- endfor %}\n\n cast('{{ col.column }}' as {{ dbt.type_string() }}) as {{ adapter.quote(field_name) if quote_identifiers else field_name }},\n cast( {% if col.data_type == 'boolean' %}\n {{ dbt.cast_bool_to_text(current_col_name) }}\n {% else %}\n {{ current_col_name }}\n {% endif %}\n as {{ cast_to }}) as {{ adapter.quote(value_name) if quote_identifiers else value_name }}\n\n from {{ relation }}\n\n {% if not loop.last -%}\n union all\n {% endif -%}\n {%- endfor -%}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_utils._is_relation", "macro.dbt_utils._is_ephemeral", "macro.dbt.type_string", "macro.dbt.cast_bool_to_text"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "cast_to", "type": null, "description": ""}, {"name": "exclude", "type": null, "description": ""}, {"name": "remove", "type": null, "description": ""}, {"name": "field_name", "type": null, "description": ""}, {"name": "value_name", "type": null, "description": ""}, {"name": "quote_identifiers", "type": null, "description": ""}], "created_at": 1786586788.066392, "supported_languages": null}, "macro.dbt_utils.test_sequential_values": {"name": "test_sequential_values", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/sequential_values.sql", "original_file_path": "macros/generic_tests/sequential_values.sql", "unique_id": "macro.dbt_utils.test_sequential_values", "macro_sql": "{% test sequential_values(model, column_name, interval=1, datepart=None, group_by_columns = []) %}\n\n {{ return(adapter.dispatch('test_sequential_values', 'dbt_utils')(model, column_name, interval, datepart, group_by_columns)) }}\n\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_sequential_values"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "column_name", "type": null, "description": ""}, {"name": "interval", "type": null, "description": ""}, {"name": "datepart", "type": null, "description": ""}, {"name": "group_by_columns", "type": null, "description": ""}], "created_at": 1786586788.0673594, "supported_languages": null}, "macro.dbt_utils.default__test_sequential_values": {"name": "default__test_sequential_values", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/sequential_values.sql", "original_file_path": "macros/generic_tests/sequential_values.sql", "unique_id": "macro.dbt_utils.default__test_sequential_values", "macro_sql": "{% macro default__test_sequential_values(model, column_name, interval=1, datepart=None, group_by_columns = []) %}\n\n{% set previous_column_name = \"previous_\" ~ dbt_utils.slugify(column_name) %}\n\n{% if group_by_columns|length() > 0 %}\n {% set select_gb_cols = group_by_columns|join(',') + ', ' %}\n {% set partition_gb_cols = 'partition by ' + group_by_columns|join(',') %}\n{% endif %}\n\nwith windowed as (\n\n select\n {{ select_gb_cols }}\n {{ column_name }},\n lag({{ column_name }}) over (\n {{partition_gb_cols}}\n order by {{ column_name }}\n ) as {{ previous_column_name }}\n from {{ model }}\n),\n\nvalidation_errors as (\n select\n *\n from windowed\n {% if datepart %}\n where not(cast({{ column_name }} as {{ dbt.type_timestamp() }})= cast({{ dbt.dateadd(datepart, interval, previous_column_name) }} as {{ dbt.type_timestamp() }}))\n {% else %}\n where not({{ column_name }} = {{ previous_column_name }} + {{ interval }})\n {% endif %}\n)\n\nselect *\nfrom validation_errors\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.slugify", "macro.dbt.type_timestamp", "macro.dbt.dateadd"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "column_name", "type": null, "description": ""}, {"name": "interval", "type": null, "description": ""}, {"name": "datepart", "type": null, "description": ""}, {"name": "group_by_columns", "type": null, "description": ""}], "created_at": 1786586788.068847, "supported_languages": null}, "macro.dbt_utils.test_equality": {"name": "test_equality", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/equality.sql", "original_file_path": "macros/generic_tests/equality.sql", "unique_id": "macro.dbt_utils.test_equality", "macro_sql": "{% test equality(model, compare_model, compare_columns=None, exclude_columns=None, precision = None) %}\n {{ return(adapter.dispatch('test_equality', 'dbt_utils')(model, compare_model, compare_columns, exclude_columns, precision)) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_equality"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "compare_model", "type": null, "description": ""}, {"name": "compare_columns", "type": null, "description": ""}, {"name": "exclude_columns", "type": null, "description": ""}, {"name": "precision", "type": null, "description": ""}], "created_at": 1786586788.070821, "supported_languages": null}, "macro.dbt_utils.default__test_equality": {"name": "default__test_equality", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/equality.sql", "original_file_path": "macros/generic_tests/equality.sql", "unique_id": "macro.dbt_utils.default__test_equality", "macro_sql": "{% macro default__test_equality(model, compare_model, compare_columns=None, exclude_columns=None, precision = None) %}\n\n{%- if compare_columns and exclude_columns -%}\n {{ exceptions.raise_compiler_error(\"Both a compare and an ignore list were provided to the `equality` macro. Only one is allowed\") }}\n{%- endif -%}\n\n{% set set_diff %}\n count(*) + coalesce(abs(\n sum(case when which_diff = 'a_minus_b' then 1 else 0 end) -\n sum(case when which_diff = 'b_minus_a' then 1 else 0 end)\n ), 0)\n{% endset %}\n\n{#-- Needs to be set at parse time, before we return '' below --#}\n{{ config(fail_calc = set_diff) }}\n\n{#-- Prevent querying of db in parsing mode. This works because this macro does not create any new refs. #}\n{%- if not execute -%}\n {{ return('') }}\n{% endif %}\n\n\n\n-- setup\n{%- do dbt_utils._is_relation(model, 'test_equality') -%}\n\n{# Ensure there are no extra columns in the compare_model vs model #}\n{%- if not compare_columns -%}\n {%- do dbt_utils._is_ephemeral(model, 'test_equality') -%}\n {%- do dbt_utils._is_ephemeral(compare_model, 'test_equality') -%}\n\n {%- set model_columns = adapter.get_columns_in_relation(model) -%}\n {%- set compare_model_columns = adapter.get_columns_in_relation(compare_model) -%}\n\n\n {%- if exclude_columns -%}\n {#-- Lower case ignore columns for easier comparison --#}\n {%- set exclude_columns = exclude_columns | map(\"lower\") | list %}\n\n {# Filter out the excluded columns #}\n {%- set include_columns = [] %}\n {%- set include_model_columns = [] %}\n {%- for column in model_columns -%}\n {%- if column.name | lower not in exclude_columns -%}\n {% do include_columns.append(column) %}\n {%- endif %}\n {%- endfor %}\n {%- for column in compare_model_columns -%}\n {%- if column.name | lower not in exclude_columns -%}\n {% do include_model_columns.append(column) %}\n {%- endif %}\n {%- endfor %}\n\n {%- set compare_columns_set = set(include_columns | map(attribute='quoted') | map(\"lower\")) %}\n {%- set compare_model_columns_set = set(include_model_columns | map(attribute='quoted') | map(\"lower\")) %}\n {%- else -%}\n {%- set compare_columns_set = set(model_columns | map(attribute='quoted') | map(\"lower\")) %}\n {%- set compare_model_columns_set = set(compare_model_columns | map(attribute='quoted') | map(\"lower\")) %}\n {%- endif -%}\n\n {% if compare_columns_set != compare_model_columns_set %}\n {{ exceptions.raise_compiler_error(compare_model ~\" has less columns than \" ~ model ~ \", please ensure they have the same columns or use the `compare_columns` or `exclude_columns` arguments to subset them.\") }}\n {% endif %}\n\n\n{% endif %}\n\n{%- if not precision -%}\n {%- if not compare_columns -%}\n {# \n You cannot get the columns in an ephemeral model (due to not existing in the information schema),\n so if the user does not provide an explicit list of columns we must error in the case it is ephemeral\n #}\n {%- do dbt_utils._is_ephemeral(model, 'test_equality') -%}\n {%- set compare_columns = adapter.get_columns_in_relation(model)-%}\n\n {%- if exclude_columns -%}\n {#-- Lower case ignore columns for easier comparison --#}\n {%- set exclude_columns = exclude_columns | map(\"lower\") | list %}\n\n {# Filter out the excluded columns #}\n {%- set include_columns = [] %}\n {%- for column in compare_columns -%}\n {%- if column.name | lower not in exclude_columns -%}\n {% do include_columns.append(column) %}\n {%- endif %}\n {%- endfor %}\n\n {%- set compare_columns = include_columns | map(attribute='quoted') %}\n {%- else -%} {# Compare columns provided #}\n {%- set compare_columns = compare_columns | map(attribute='quoted') %}\n {%- endif -%}\n {%- endif -%}\n\n {% set compare_cols_csv = compare_columns | join(', ') %}\n\n{% else %} {# Precision required #}\n {#-\n If rounding is required, we need to get the types, so it cannot be ephemeral even if they provide column names\n -#}\n {%- do dbt_utils._is_ephemeral(model, 'test_equality') -%}\n {%- set columns = adapter.get_columns_in_relation(model) -%}\n\n {% set columns_list = [] %}\n {%- for col in columns -%}\n {%- if (\n (col.name|lower in compare_columns|map('lower') or not compare_columns) and\n (col.name|lower not in exclude_columns|map('lower') or not exclude_columns)\n ) -%}\n {# Databricks double type is not picked up by any number type checks in dbt #}\n {%- if col.is_float() or col.is_numeric() or col.data_type == 'double' -%}\n {# Cast is required due to postgres not having round for a double precision number #}\n {%- do columns_list.append('round(cast(' ~ col.quoted ~ ' as ' ~ dbt.type_numeric() ~ '),' ~ precision ~ ') as ' ~ col.quoted) -%}\n {%- else -%} {# Non-numeric type #}\n {%- do columns_list.append(col.quoted) -%}\n {%- endif -%}\n {% endif %}\n {%- endfor -%}\n\n {% set compare_cols_csv = columns_list | join(', ') %}\n\n{% endif %}\n\nwith a as (\n\n select * from {{ model }}\n\n),\n\nb as (\n\n select * from {{ compare_model }}\n\n),\n\na_minus_b as (\n\n select {{compare_cols_csv}} from a\n {{ dbt.except() }}\n select {{compare_cols_csv}} from b\n\n),\n\nb_minus_a as (\n\n select {{compare_cols_csv}} from b\n {{ dbt.except() }}\n select {{compare_cols_csv}} from a\n\n),\n\nunioned as (\n\n select 'a_minus_b' as which_diff, a_minus_b.* from a_minus_b\n union all\n select 'b_minus_a' as which_diff, b_minus_a.* from b_minus_a\n\n)\n\nselect * from unioned\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils._is_relation", "macro.dbt_utils._is_ephemeral", "macro.dbt.type_numeric", "macro.dbt.except"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "compare_model", "type": null, "description": ""}, {"name": "compare_columns", "type": null, "description": ""}, {"name": "exclude_columns", "type": null, "description": ""}, {"name": "precision", "type": null, "description": ""}], "created_at": 1786586788.0771914, "supported_languages": null}, "macro.dbt_utils.test_equal_rowcount": {"name": "test_equal_rowcount", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/equal_rowcount.sql", "original_file_path": "macros/generic_tests/equal_rowcount.sql", "unique_id": "macro.dbt_utils.test_equal_rowcount", "macro_sql": "{% test equal_rowcount(model, compare_model, group_by_columns = []) %}\n {{ return(adapter.dispatch('test_equal_rowcount', 'dbt_utils')(model, compare_model, group_by_columns)) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_equal_rowcount"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "compare_model", "type": null, "description": ""}, {"name": "group_by_columns", "type": null, "description": ""}], "created_at": 1786586788.0782547, "supported_languages": null}, "macro.dbt_utils.default__test_equal_rowcount": {"name": "default__test_equal_rowcount", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/equal_rowcount.sql", "original_file_path": "macros/generic_tests/equal_rowcount.sql", "unique_id": "macro.dbt_utils.default__test_equal_rowcount", "macro_sql": "{% macro default__test_equal_rowcount(model, compare_model, group_by_columns) %}\n\n{#-- Needs to be set at parse time, before we return '' below --#}\n{{ config(fail_calc = 'sum(coalesce(diff_count, 0))') }}\n\n{#-- Prevent querying of db in parsing mode. This works because this macro does not create any new refs. #}\n{%- if not execute -%}\n {{ return('') }}\n{% endif %}\n\n{% if group_by_columns|length() > 0 %}\n {% set select_gb_cols = group_by_columns|join(', ') + ', ' %}\n {% set join_gb_cols %}\n {% for c in group_by_columns %}\n and a.{{c}} = b.{{c}}\n {% endfor %}\n {% endset %}\n {% set groupby_gb_cols = 'group by ' + group_by_columns|join(',') %}\n{% endif %}\n\n{#-- We must add a fake join key in case additional grouping variables are not provided --#}\n{#-- Redshift does not allow for dynamically created join conditions (e.g. full join on 1 = 1 --#}\n{#-- The same logic is used in fewer_rows_than. In case of changes, maintain consistent logic --#}\n{% set group_by_columns = ['id_dbtutils_test_equal_rowcount'] + group_by_columns %}\n{% set groupby_gb_cols = 'group by ' + group_by_columns|join(',') %}\n\nwith a as (\n\n select \n {{select_gb_cols}}\n 1 as id_dbtutils_test_equal_rowcount,\n count(*) as count_a \n from {{ model }}\n {{groupby_gb_cols}}\n\n\n),\nb as (\n\n select \n {{select_gb_cols}}\n 1 as id_dbtutils_test_equal_rowcount,\n count(*) as count_b \n from {{ compare_model }}\n {{groupby_gb_cols}}\n\n),\nfinal as (\n\n select\n \n {% for c in group_by_columns -%}\n a.{{c}} as {{c}}_a,\n b.{{c}} as {{c}}_b,\n {% endfor %}\n\n count_a,\n count_b,\n abs(count_a - count_b) as diff_count\n\n from a\n full join b\n on\n a.id_dbtutils_test_equal_rowcount = b.id_dbtutils_test_equal_rowcount\n {{join_gb_cols}}\n\n\n)\n\nselect * from final\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "compare_model", "type": null, "description": ""}, {"name": "group_by_columns", "type": null, "description": ""}], "created_at": 1786586788.0800073, "supported_languages": null}, "macro.dbt_utils.test_not_empty_string": {"name": "test_not_empty_string", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/not_empty_string.sql", "original_file_path": "macros/generic_tests/not_empty_string.sql", "unique_id": "macro.dbt_utils.test_not_empty_string", "macro_sql": "{% test not_empty_string(model, column_name, trim_whitespace=true) %}\n\n {{ return(adapter.dispatch('test_not_empty_string', 'dbt_utils')(model, column_name, trim_whitespace)) }}\n\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_not_empty_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "column_name", "type": null, "description": ""}, {"name": "trim_whitespace", "type": null, "description": ""}], "created_at": 1786586788.0806594, "supported_languages": null}, "macro.dbt_utils.default__test_not_empty_string": {"name": "default__test_not_empty_string", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/not_empty_string.sql", "original_file_path": "macros/generic_tests/not_empty_string.sql", "unique_id": "macro.dbt_utils.default__test_not_empty_string", "macro_sql": "{% macro default__test_not_empty_string(model, column_name, trim_whitespace=true) %}\n\n with\n \n all_values as (\n\n select \n\n\n {% if trim_whitespace == true -%}\n\n trim({{ column_name }}) as {{ column_name }}\n\n {%- else -%}\n\n {{ column_name }}\n\n {%- endif %}\n \n from {{ model }}\n\n ),\n\n errors as (\n\n select * from all_values\n where {{ column_name }} = ''\n\n )\n\n select * from errors\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "column_name", "type": null, "description": ""}, {"name": "trim_whitespace", "type": null, "description": ""}], "created_at": 1786586788.0811734, "supported_languages": null}, "macro.dbt_utils.test_unique_combination_of_columns": {"name": "test_unique_combination_of_columns", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/unique_combination_of_columns.sql", "original_file_path": "macros/generic_tests/unique_combination_of_columns.sql", "unique_id": "macro.dbt_utils.test_unique_combination_of_columns", "macro_sql": "{% test unique_combination_of_columns(model, combination_of_columns, quote_columns=false) %}\n {{ return(adapter.dispatch('test_unique_combination_of_columns', 'dbt_utils')(model, combination_of_columns, quote_columns)) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_unique_combination_of_columns"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "combination_of_columns", "type": null, "description": ""}, {"name": "quote_columns", "type": null, "description": ""}], "created_at": 1786586788.0818799, "supported_languages": null}, "macro.dbt_utils.default__test_unique_combination_of_columns": {"name": "default__test_unique_combination_of_columns", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/unique_combination_of_columns.sql", "original_file_path": "macros/generic_tests/unique_combination_of_columns.sql", "unique_id": "macro.dbt_utils.default__test_unique_combination_of_columns", "macro_sql": "{% macro default__test_unique_combination_of_columns(model, combination_of_columns, quote_columns=false) %}\n\n{% if not quote_columns %}\n {%- set column_list=combination_of_columns %}\n{% elif quote_columns %}\n {%- set column_list=[] %}\n {% for column in combination_of_columns -%}\n {% do column_list.append( adapter.quote(column) ) %}\n {%- endfor %}\n{% else %}\n {{ exceptions.raise_compiler_error(\n \"`quote_columns` argument for unique_combination_of_columns test must be one of [True, False] Got: '\" ~ quote ~\"'.'\"\n ) }}\n{% endif %}\n\n{%- set columns_csv=column_list | join(', ') %}\n\n\nwith validation_errors as (\n\n select\n {{ columns_csv }}\n from {{ model }}\n group by {{ columns_csv }}\n having count(*) > 1\n\n)\n\nselect *\nfrom validation_errors\n\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "combination_of_columns", "type": null, "description": ""}, {"name": "quote_columns", "type": null, "description": ""}], "created_at": 1786586788.0829284, "supported_languages": null}, "macro.dbt_utils.test_expression_is_true": {"name": "test_expression_is_true", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/expression_is_true.sql", "original_file_path": "macros/generic_tests/expression_is_true.sql", "unique_id": "macro.dbt_utils.test_expression_is_true", "macro_sql": "{% test expression_is_true(model, expression, column_name=None) %}\n {{ return(adapter.dispatch('test_expression_is_true', 'dbt_utils')(model, expression, column_name)) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_expression_is_true"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "expression", "type": null, "description": ""}, {"name": "column_name", "type": null, "description": ""}], "created_at": 1786586788.0835571, "supported_languages": null}, "macro.dbt_utils.default__test_expression_is_true": {"name": "default__test_expression_is_true", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/expression_is_true.sql", "original_file_path": "macros/generic_tests/expression_is_true.sql", "unique_id": "macro.dbt_utils.default__test_expression_is_true", "macro_sql": "{% macro default__test_expression_is_true(model, expression, column_name) %}\n\n{% set column_list = '*' if should_store_failures() else \"1\" %}\n\nselect\n {{ column_list }}\nfrom {{ model }}\n{% if column_name is none %}\nwhere not({{ expression }})\n{%- else %}\nwhere not({{ column_name }} {{ expression }})\n{%- endif %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.should_store_failures"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "expression", "type": null, "description": ""}, {"name": "column_name", "type": null, "description": ""}], "created_at": 1786586788.0841677, "supported_languages": null}, "macro.dbt_utils.test_accepted_range": {"name": "test_accepted_range", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/accepted_range.sql", "original_file_path": "macros/generic_tests/accepted_range.sql", "unique_id": "macro.dbt_utils.test_accepted_range", "macro_sql": "{% test accepted_range(model, column_name, min_value=none, max_value=none, inclusive=true) %}\n {{ return(adapter.dispatch('test_accepted_range', 'dbt_utils')(model, column_name, min_value, max_value, inclusive)) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_accepted_range"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "column_name", "type": null, "description": ""}, {"name": "min_value", "type": null, "description": ""}, {"name": "max_value", "type": null, "description": ""}, {"name": "inclusive", "type": null, "description": ""}], "created_at": 1786586788.0849538, "supported_languages": null}, "macro.dbt_utils.default__test_accepted_range": {"name": "default__test_accepted_range", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/accepted_range.sql", "original_file_path": "macros/generic_tests/accepted_range.sql", "unique_id": "macro.dbt_utils.default__test_accepted_range", "macro_sql": "{% macro default__test_accepted_range(model, column_name, min_value=none, max_value=none, inclusive=true) %}\n\nwith meet_condition as(\n select *\n from {{ model }}\n),\n\nvalidation_errors as (\n select *\n from meet_condition\n where\n -- never true, defaults to an empty result set. Exists to ensure any combo of the `or` clauses below succeeds\n 1 = 2\n\n {%- if min_value is not none %}\n -- records with a value >= min_value are permitted. The `not` flips this to find records that don't meet the rule.\n or not {{ column_name }} > {{- \"=\" if inclusive }} {{ min_value }}\n {%- endif %}\n\n {%- if max_value is not none %}\n -- records with a value <= max_value are permitted. The `not` flips this to find records that don't meet the rule.\n or not {{ column_name }} < {{- \"=\" if inclusive }} {{ max_value }}\n {%- endif %}\n)\n\nselect *\nfrom validation_errors\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "column_name", "type": null, "description": ""}, {"name": "min_value", "type": null, "description": ""}, {"name": "max_value", "type": null, "description": ""}, {"name": "inclusive", "type": null, "description": ""}], "created_at": 1786586788.0857236, "supported_languages": null}, "macro.dbt_utils.test_relationships_where": {"name": "test_relationships_where", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/relationships_where.sql", "original_file_path": "macros/generic_tests/relationships_where.sql", "unique_id": "macro.dbt_utils.test_relationships_where", "macro_sql": "{% test relationships_where(model, column_name, to, field, from_condition=\"1=1\", to_condition=\"1=1\") %}\n {{ return(adapter.dispatch('test_relationships_where', 'dbt_utils')(model, column_name, to, field, from_condition, to_condition)) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_relationships_where"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "column_name", "type": null, "description": ""}, {"name": "to", "type": null, "description": ""}, {"name": "field", "type": null, "description": ""}, {"name": "from_condition", "type": null, "description": ""}, {"name": "to_condition", "type": null, "description": ""}], "created_at": 1786586788.0866144, "supported_languages": null}, "macro.dbt_utils.default__test_relationships_where": {"name": "default__test_relationships_where", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/relationships_where.sql", "original_file_path": "macros/generic_tests/relationships_where.sql", "unique_id": "macro.dbt_utils.default__test_relationships_where", "macro_sql": "{% macro default__test_relationships_where(model, column_name, to, field, from_condition=\"1=1\", to_condition=\"1=1\") %}\n\n{# T-SQL has no boolean data type so we use 1=1 which returns TRUE #}\n{# ref https://stackoverflow.com/a/7170753/3842610 #}\n\nwith left_table as (\n\n select\n {{column_name}} as id\n\n from {{model}}\n\n where {{column_name}} is not null\n and {{from_condition}}\n\n),\n\nright_table as (\n\n select\n {{field}} as id\n\n from {{to}}\n\n where {{field}} is not null\n and {{to_condition}}\n\n),\n\nexceptions as (\n\n select\n left_table.id,\n right_table.id as right_id\n\n from left_table\n\n left join right_table\n on left_table.id = right_table.id\n\n where right_table.id is null\n\n)\n\nselect * from exceptions\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "column_name", "type": null, "description": ""}, {"name": "to", "type": null, "description": ""}, {"name": "field", "type": null, "description": ""}, {"name": "from_condition", "type": null, "description": ""}, {"name": "to_condition", "type": null, "description": ""}], "created_at": 1786586788.0872133, "supported_languages": null}, "macro.dbt_utils.test_not_constant": {"name": "test_not_constant", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/not_constant.sql", "original_file_path": "macros/generic_tests/not_constant.sql", "unique_id": "macro.dbt_utils.test_not_constant", "macro_sql": "{% test not_constant(model, column_name, group_by_columns = []) %}\n {{ return(adapter.dispatch('test_not_constant', 'dbt_utils')(model, column_name, group_by_columns)) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_not_constant"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "column_name", "type": null, "description": ""}, {"name": "group_by_columns", "type": null, "description": ""}], "created_at": 1786586788.0878875, "supported_languages": null}, "macro.dbt_utils.default__test_not_constant": {"name": "default__test_not_constant", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/not_constant.sql", "original_file_path": "macros/generic_tests/not_constant.sql", "unique_id": "macro.dbt_utils.default__test_not_constant", "macro_sql": "{% macro default__test_not_constant(model, column_name, group_by_columns) %}\n\n{% if group_by_columns|length() > 0 %}\n {% set select_gb_cols = group_by_columns|join(' ,') + ', ' %}\n {% set groupby_gb_cols = 'group by ' + group_by_columns|join(',') %}\n{% endif %}\n\n\nselect\n {# In TSQL, subquery aggregate columns need aliases #}\n {# thus: a filler col name, 'filler_column' #}\n {{select_gb_cols}}\n count(distinct {{ column_name }}) as filler_column\n\nfrom {{ model }}\n\n {{groupby_gb_cols}}\n\nhaving count(distinct {{ column_name }}) = 1\n\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "column_name", "type": null, "description": ""}, {"name": "group_by_columns", "type": null, "description": ""}], "created_at": 1786586788.0887723, "supported_languages": null}, "macro.dbt_utils.test_recency": {"name": "test_recency", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/recency.sql", "original_file_path": "macros/generic_tests/recency.sql", "unique_id": "macro.dbt_utils.test_recency", "macro_sql": "{% test recency(model, field, datepart, interval, ignore_time_component=False, group_by_columns = []) %}\n {{ return(adapter.dispatch('test_recency', 'dbt_utils')(model, field, datepart, interval, ignore_time_component, group_by_columns)) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_recency"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "field", "type": null, "description": ""}, {"name": "datepart", "type": null, "description": ""}, {"name": "interval", "type": null, "description": ""}, {"name": "ignore_time_component", "type": null, "description": ""}, {"name": "group_by_columns", "type": null, "description": ""}], "created_at": 1786586788.0897162, "supported_languages": null}, "macro.dbt_utils.default__test_recency": {"name": "default__test_recency", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/recency.sql", "original_file_path": "macros/generic_tests/recency.sql", "unique_id": "macro.dbt_utils.default__test_recency", "macro_sql": "{% macro default__test_recency(model, field, datepart, interval, ignore_time_component, group_by_columns) %}\n\n{% set empty_invocation = flags.EMPTY is defined and flags.EMPTY %}\n\n{% set threshold = 'cast(' ~ dbt.dateadd(datepart, interval * -1, dbt.current_timestamp()) ~ ' as ' ~ ('date' if ignore_time_component else dbt.type_timestamp()) ~ ')' %}\n\n{% if group_by_columns|length() > 0 %}\n {% set select_gb_cols = group_by_columns|join(' ,') + ', ' %}\n {% set groupby_gb_cols = 'group by ' + group_by_columns|join(',') %}\n{% endif %}\n\n\nwith recency as (\n\n select \n\n {{ select_gb_cols }}\n {% if ignore_time_component %}\n cast(max({{ field }}) as date) as most_recent\n {%- else %}\n max({{ field }}) as most_recent\n {%- endif %}\n\n from {{ model }}\n\n {{ groupby_gb_cols }}\n\n)\n\nselect\n\n {{ select_gb_cols }}\n most_recent,\n {{ threshold }} as threshold\n\nfrom recency\nwhere most_recent < {{ threshold }}\n{%- if not empty_invocation %}\n or most_recent is null\n{%- endif %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.dateadd", "macro.dbt.current_timestamp", "macro.dbt.type_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "field", "type": null, "description": ""}, {"name": "datepart", "type": null, "description": ""}, {"name": "interval", "type": null, "description": ""}, {"name": "ignore_time_component", "type": null, "description": ""}, {"name": "group_by_columns", "type": null, "description": ""}], "created_at": 1786586788.0913053, "supported_languages": null}, "macro.dbt_utils.test_fewer_rows_than": {"name": "test_fewer_rows_than", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/fewer_rows_than.sql", "original_file_path": "macros/generic_tests/fewer_rows_than.sql", "unique_id": "macro.dbt_utils.test_fewer_rows_than", "macro_sql": "{% test fewer_rows_than(model, compare_model, group_by_columns = []) %}\n {{ return(adapter.dispatch('test_fewer_rows_than', 'dbt_utils')(model, compare_model, group_by_columns)) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_fewer_rows_than"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "compare_model", "type": null, "description": ""}, {"name": "group_by_columns", "type": null, "description": ""}], "created_at": 1786586788.0922892, "supported_languages": null}, "macro.dbt_utils.default__test_fewer_rows_than": {"name": "default__test_fewer_rows_than", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/fewer_rows_than.sql", "original_file_path": "macros/generic_tests/fewer_rows_than.sql", "unique_id": "macro.dbt_utils.default__test_fewer_rows_than", "macro_sql": "{% macro default__test_fewer_rows_than(model, compare_model, group_by_columns) %}\n\n{{ config(fail_calc = 'sum(coalesce(row_count_delta, 0))') }}\n\n{% if group_by_columns|length() > 0 %}\n {% set select_gb_cols = group_by_columns|join(' ,') + ', ' %}\n {% set join_gb_cols %}\n {% for c in group_by_columns %}\n and a.{{c}} = b.{{c}}\n {% endfor %}\n {% endset %}\n {% set groupby_gb_cols = 'group by ' + group_by_columns|join(',') %}\n{% endif %}\n\n{#-- We must add a fake join key in case additional grouping variables are not provided --#}\n{#-- Redshift does not allow for dynamically created join conditions (e.g. full join on 1 = 1 --#}\n{#-- The same logic is used in equal_rowcount. In case of changes, maintain consistent logic --#}\n{% set group_by_columns = ['id_dbtutils_test_fewer_rows_than'] + group_by_columns %}\n{% set groupby_gb_cols = 'group by ' + group_by_columns|join(',') %}\n\n\nwith a as (\n\n select \n {{select_gb_cols}}\n 1 as id_dbtutils_test_fewer_rows_than,\n count(*) as count_our_model \n from {{ model }}\n {{ groupby_gb_cols }}\n\n),\nb as (\n\n select \n {{select_gb_cols}}\n 1 as id_dbtutils_test_fewer_rows_than,\n count(*) as count_comparison_model \n from {{ compare_model }}\n {{ groupby_gb_cols }}\n\n),\ncounts as (\n\n select\n\n {% for c in group_by_columns -%}\n a.{{c}} as {{c}}_a,\n b.{{c}} as {{c}}_b,\n {% endfor %}\n\n count_our_model,\n count_comparison_model\n from a\n full join b on \n a.id_dbtutils_test_fewer_rows_than = b.id_dbtutils_test_fewer_rows_than\n {{ join_gb_cols }}\n\n),\nfinal as (\n\n select *,\n case\n -- fail the test if we have more rows than the reference model and return the row count delta\n when count_our_model > count_comparison_model then (count_our_model - count_comparison_model)\n -- fail the test if they are the same number\n when count_our_model = count_comparison_model then 1\n -- pass the test if the delta is positive (i.e. return the number 0)\n else 0\n end as row_count_delta\n from counts\n\n)\n\nselect * from final\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "compare_model", "type": null, "description": ""}, {"name": "group_by_columns", "type": null, "description": ""}], "created_at": 1786586788.0939445, "supported_languages": null}, "macro.dbt_utils.test_mutually_exclusive_ranges": {"name": "test_mutually_exclusive_ranges", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/mutually_exclusive_ranges.sql", "original_file_path": "macros/generic_tests/mutually_exclusive_ranges.sql", "unique_id": "macro.dbt_utils.test_mutually_exclusive_ranges", "macro_sql": "{% test mutually_exclusive_ranges(model, lower_bound_column, upper_bound_column, partition_by=None, gaps='allowed', zero_length_range_allowed=False) %}\n {{ return(adapter.dispatch('test_mutually_exclusive_ranges', 'dbt_utils')(model, lower_bound_column, upper_bound_column, partition_by, gaps, zero_length_range_allowed)) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_mutually_exclusive_ranges"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "lower_bound_column", "type": null, "description": ""}, {"name": "upper_bound_column", "type": null, "description": ""}, {"name": "partition_by", "type": null, "description": ""}, {"name": "gaps", "type": null, "description": ""}, {"name": "zero_length_range_allowed", "type": null, "description": ""}], "created_at": 1786586788.0953045, "supported_languages": null}, "macro.dbt_utils.default__test_mutually_exclusive_ranges": {"name": "default__test_mutually_exclusive_ranges", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/mutually_exclusive_ranges.sql", "original_file_path": "macros/generic_tests/mutually_exclusive_ranges.sql", "unique_id": "macro.dbt_utils.default__test_mutually_exclusive_ranges", "macro_sql": "{% macro default__test_mutually_exclusive_ranges(model, lower_bound_column, upper_bound_column, partition_by=None, gaps='allowed', zero_length_range_allowed=False) %}\n{% if gaps == 'not_allowed' %}\n {% set allow_gaps_operator='=' %}\n {% set allow_gaps_operator_in_words='equal_to' %}\n{% elif gaps == 'allowed' %}\n {% set allow_gaps_operator='<=' %}\n {% set allow_gaps_operator_in_words='less_than_or_equal_to' %}\n{% elif gaps == 'required' %}\n {% set allow_gaps_operator='<' %}\n {% set allow_gaps_operator_in_words='less_than' %}\n{% else %}\n {{ exceptions.raise_compiler_error(\n \"`gaps` argument for mutually_exclusive_ranges test must be one of ['not_allowed', 'allowed', 'required'] Got: '\" ~ gaps ~\"'.'\"\n ) }}\n{% endif %}\n{% if not zero_length_range_allowed %}\n {% set allow_zero_length_operator='<' %}\n {% set allow_zero_length_operator_in_words='less_than' %}\n{% elif zero_length_range_allowed %}\n {% set allow_zero_length_operator='<=' %}\n {% set allow_zero_length_operator_in_words='less_than_or_equal_to' %}\n{% else %}\n {{ exceptions.raise_compiler_error(\n \"`zero_length_range_allowed` argument for mutually_exclusive_ranges test must be one of [true, false] Got: '\" ~ zero_length_range_allowed ~\"'.'\"\n ) }}\n{% endif %}\n\n{% set partition_clause=\"partition by \" ~ partition_by if partition_by else '' %}\n\nwith window_functions as (\n\n select\n {% if partition_by %}\n {{ partition_by }} as partition_by_col,\n {% endif %}\n {{ lower_bound_column }} as lower_bound,\n {{ upper_bound_column }} as upper_bound,\n\n lead({{ lower_bound_column }}) over (\n {{ partition_clause }}\n order by {{ lower_bound_column }}, {{ upper_bound_column }}\n ) as next_lower_bound,\n\n row_number() over (\n {{ partition_clause }}\n order by {{ lower_bound_column }} desc, {{ upper_bound_column }} desc\n ) = 1 as is_last_record\n\n from {{ model }}\n\n),\n\ncalc as (\n -- We want to return records where one of our assumptions fails, so we'll use\n -- the `not` function with `and` statements so we can write our assumptions more cleanly\n select\n *,\n\n -- For each record: lower_bound should be < upper_bound.\n -- Coalesce it to return an error on the null case (implicit assumption\n -- these columns are not_null)\n coalesce(\n lower_bound {{ allow_zero_length_operator }} upper_bound,\n false\n ) as lower_bound_{{ allow_zero_length_operator_in_words }}_upper_bound,\n\n -- For each record: upper_bound {{ allow_gaps_operator }} the next lower_bound.\n -- Coalesce it to handle null cases for the last record.\n coalesce(\n upper_bound {{ allow_gaps_operator }} next_lower_bound,\n is_last_record,\n false\n ) as upper_bound_{{ allow_gaps_operator_in_words }}_next_lower_bound\n\n from window_functions\n\n),\n\nvalidation_errors as (\n\n select\n *\n from calc\n\n where not(\n -- THE FOLLOWING SHOULD BE TRUE --\n lower_bound_{{ allow_zero_length_operator_in_words }}_upper_bound\n and upper_bound_{{ allow_gaps_operator_in_words }}_next_lower_bound\n )\n)\n\nselect * from validation_errors\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "lower_bound_column", "type": null, "description": ""}, {"name": "upper_bound_column", "type": null, "description": ""}, {"name": "partition_by", "type": null, "description": ""}, {"name": "gaps", "type": null, "description": ""}, {"name": "zero_length_range_allowed", "type": null, "description": ""}], "created_at": 1786586788.0977595, "supported_languages": null}, "macro.dbt_utils.test_cardinality_equality": {"name": "test_cardinality_equality", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/cardinality_equality.sql", "original_file_path": "macros/generic_tests/cardinality_equality.sql", "unique_id": "macro.dbt_utils.test_cardinality_equality", "macro_sql": "{% test cardinality_equality(model, column_name, to, field) %}\n {{ return(adapter.dispatch('test_cardinality_equality', 'dbt_utils')(model, column_name, to, field)) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_cardinality_equality"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "column_name", "type": null, "description": ""}, {"name": "to", "type": null, "description": ""}, {"name": "field", "type": null, "description": ""}], "created_at": 1786586788.0984502, "supported_languages": null}, "macro.dbt_utils.default__test_cardinality_equality": {"name": "default__test_cardinality_equality", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/cardinality_equality.sql", "original_file_path": "macros/generic_tests/cardinality_equality.sql", "unique_id": "macro.dbt_utils.default__test_cardinality_equality", "macro_sql": "{% macro default__test_cardinality_equality(model, column_name, to, field) %}\n\n{# T-SQL does not let you use numbers as aliases for columns #}\n{# Thus, no \"GROUP BY 1\" #}\n\nwith table_a as (\nselect\n {{ column_name }},\n count(*) as num_rows\nfrom {{ model }}\ngroup by {{ column_name }}\n),\n\ntable_b as (\nselect\n {{ field }},\n count(*) as num_rows\nfrom {{ to }}\ngroup by {{ field }}\n),\n\nexcept_a as (\n select *\n from table_a\n {{ dbt.except() }}\n select *\n from table_b\n),\n\nexcept_b as (\n select *\n from table_b\n {{ dbt.except() }}\n select *\n from table_a\n),\n\nunioned as (\n select *\n from except_a\n union all\n select *\n from except_b\n)\n\nselect *\nfrom unioned\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.except"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "column_name", "type": null, "description": ""}, {"name": "to", "type": null, "description": ""}, {"name": "field", "type": null, "description": ""}], "created_at": 1786586788.0990286, "supported_languages": null}, "macro.dbt_utils.test_not_accepted_values": {"name": "test_not_accepted_values", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/not_accepted_values.sql", "original_file_path": "macros/generic_tests/not_accepted_values.sql", "unique_id": "macro.dbt_utils.test_not_accepted_values", "macro_sql": "{% test not_accepted_values(model, column_name, values, quote=True) %}\n {{ return(adapter.dispatch('test_not_accepted_values', 'dbt_utils')(model, column_name, values, quote)) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_not_accepted_values"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "column_name", "type": null, "description": ""}, {"name": "values", "type": null, "description": ""}, {"name": "quote", "type": null, "description": ""}], "created_at": 1786586788.0997207, "supported_languages": null}, "macro.dbt_utils.default__test_not_accepted_values": {"name": "default__test_not_accepted_values", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/not_accepted_values.sql", "original_file_path": "macros/generic_tests/not_accepted_values.sql", "unique_id": "macro.dbt_utils.default__test_not_accepted_values", "macro_sql": "{% macro default__test_not_accepted_values(model, column_name, values, quote=True) %}\nwith all_values as (\n\n select distinct\n {{ column_name }} as value_field\n\n from {{ model }}\n\n),\n\nvalidation_errors as (\n\n select\n value_field\n\n from all_values\n where value_field in (\n {% for value in values -%}\n {% if quote -%}\n '{{ value }}'\n {%- else -%}\n {{ value }}\n {%- endif -%}\n {%- if not loop.last -%},{%- endif %}\n {%- endfor %}\n )\n\n)\n\nselect *\nfrom validation_errors\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "column_name", "type": null, "description": ""}, {"name": "values", "type": null, "description": ""}, {"name": "quote", "type": null, "description": ""}], "created_at": 1786586788.1003754, "supported_languages": null}, "macro.dbt_utils.test_at_least_one": {"name": "test_at_least_one", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/at_least_one.sql", "original_file_path": "macros/generic_tests/at_least_one.sql", "unique_id": "macro.dbt_utils.test_at_least_one", "macro_sql": "{% test at_least_one(model, column_name, group_by_columns = []) %}\n {{ return(adapter.dispatch('test_at_least_one', 'dbt_utils')(model, column_name, group_by_columns)) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_at_least_one"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "column_name", "type": null, "description": ""}, {"name": "group_by_columns", "type": null, "description": ""}], "created_at": 1786586788.1011927, "supported_languages": null}, "macro.dbt_utils.default__test_at_least_one": {"name": "default__test_at_least_one", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/at_least_one.sql", "original_file_path": "macros/generic_tests/at_least_one.sql", "unique_id": "macro.dbt_utils.default__test_at_least_one", "macro_sql": "{% macro default__test_at_least_one(model, column_name, group_by_columns) %}\n\n{% set pruned_cols = [column_name] %}\n\n{% if group_by_columns|length() > 0 %}\n\n {% set select_gb_cols = group_by_columns|join(' ,') + ', ' %}\n {% set groupby_gb_cols = 'group by ' + group_by_columns|join(',') %}\n {% set pruned_cols = group_by_columns %}\n\n {% if column_name not in pruned_cols %}\n {% do pruned_cols.append(column_name) %}\n {% endif %}\n\n{% endif %}\n\n{% set select_pruned_cols = pruned_cols|join(' ,') %}\n\nselect *\nfrom (\n with pruned_rows as (\n select\n {{ select_pruned_cols }}\n from {{ model }}\n {% if group_by_columns|length() == 0 %}\n where {{ column_name }} is not null\n limit 1\n {% endif %}\n )\n select\n {# In TSQL, subquery aggregate columns need aliases #}\n {# thus: a filler col name, 'filler_column' #}\n {{select_gb_cols}}\n count({{ column_name }}) as filler_column\n\n from pruned_rows\n\n {{groupby_gb_cols}}\n\n having count({{ column_name }}) = 0\n\n) validation_errors\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "column_name", "type": null, "description": ""}, {"name": "group_by_columns", "type": null, "description": ""}], "created_at": 1786586788.1027057, "supported_languages": null}, "macro.dbt_utils.test_not_null_proportion": {"name": "test_not_null_proportion", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/not_null_proportion.sql", "original_file_path": "macros/generic_tests/not_null_proportion.sql", "unique_id": "macro.dbt_utils.test_not_null_proportion", "macro_sql": "{% macro test_not_null_proportion(model, group_by_columns = []) %}\n {{ return(adapter.dispatch('test_not_null_proportion', 'dbt_utils')(model, group_by_columns, **kwargs)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_not_null_proportion"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "group_by_columns", "type": null, "description": ""}], "created_at": 1786586788.1034842, "supported_languages": null}, "macro.dbt_utils.default__test_not_null_proportion": {"name": "default__test_not_null_proportion", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/not_null_proportion.sql", "original_file_path": "macros/generic_tests/not_null_proportion.sql", "unique_id": "macro.dbt_utils.default__test_not_null_proportion", "macro_sql": "{% macro default__test_not_null_proportion(model, group_by_columns) %}\n\n{% set column_name = kwargs.get('column_name', kwargs.get('arg')) %}\n{% set at_least = kwargs.get('at_least', kwargs.get('arg')) %}\n{% set at_most = kwargs.get('at_most', kwargs.get('arg', 1)) %}\n\n{% if group_by_columns|length() > 0 %}\n {% set select_gb_cols = group_by_columns|join(' ,') + ', ' %}\n {% set groupby_gb_cols = 'group by ' + group_by_columns|join(',') %}\n{% endif %}\n\nwith validation as (\n select\n {{select_gb_cols}}\n sum(case when {{ column_name }} is null then 0 else 1 end) / cast(count(*) as {{ dbt.type_numeric() }}) as not_null_proportion\n from {{ model }}\n {{groupby_gb_cols}}\n),\nvalidation_errors as (\n select\n {{select_gb_cols}}\n not_null_proportion\n from validation\n where not_null_proportion < {{ at_least }} or not_null_proportion > {{ at_most }}\n)\nselect\n *\nfrom validation_errors\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.type_numeric"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "group_by_columns", "type": null, "description": ""}], "created_at": 1786586788.1048594, "supported_languages": null}, "macro.iterable.iterable_lookback": {"name": "iterable_lookback", "resource_type": "macro", "package_name": "iterable", "path": "macros/iterable_lookback.sql", "original_file_path": "macros/iterable_lookback.sql", "unique_id": "macro.iterable.iterable_lookback", "macro_sql": "{% macro iterable_lookback(from_date, datepart, interval, safety_date='2020-01-01') %}\n\n{{ adapter.dispatch('iterable_lookback', 'iterable') (from_date, datepart, interval, safety_date='2020-01-01') }}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.iterable.default__iterable_lookback"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "from_date", "type": null, "description": ""}, {"name": "datepart", "type": null, "description": ""}, {"name": "interval", "type": null, "description": ""}, {"name": "safety_date", "type": null, "description": ""}], "created_at": 1786586788.1055613, "supported_languages": null}, "macro.iterable.default__iterable_lookback": {"name": "default__iterable_lookback", "resource_type": "macro", "package_name": "iterable", "path": "macros/iterable_lookback.sql", "original_file_path": "macros/iterable_lookback.sql", "unique_id": "macro.iterable.default__iterable_lookback", "macro_sql": "{% macro default__iterable_lookback(from_date, datepart, interval, safety_date='2020-01-01') %}\n\n {% set sql_statement %}\n select coalesce({{ from_date }}, {{ \"'\" ~ safety_date ~ \"'\" }})\n from {{ this }}\n {%- endset -%}\n\n {%- set result = dbt_utils.get_single_value(sql_statement) %}\n\n {{ dbt.dateadd(datepart=datepart, interval=-interval, from_date_or_timestamp=\"cast('\" ~ result ~ \"' as date)\") }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.get_single_value", "macro.dbt.dateadd"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "from_date", "type": null, "description": ""}, {"name": "datepart", "type": null, "description": ""}, {"name": "interval", "type": null, "description": ""}, {"name": "safety_date", "type": null, "description": ""}], "created_at": 1786586788.1062987, "supported_languages": null}, "macro.iterable.get_campaign_suppression_list_history_columns": {"name": "get_campaign_suppression_list_history_columns", "resource_type": "macro", "package_name": "iterable", "path": "macros/staging/get_campaign_suppression_list_history_columns.sql", "original_file_path": "macros/staging/get_campaign_suppression_list_history_columns.sql", "unique_id": "macro.iterable.get_campaign_suppression_list_history_columns", "macro_sql": "{% macro get_campaign_suppression_list_history_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"campaign_id\", \"datatype\": dbt.type_int()},\n {\"name\": \"suppressed_list_id\", \"datatype\": dbt.type_int()},\n {\"name\": \"updated_at\", \"datatype\": dbt.type_timestamp()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.type_timestamp", "macro.dbt.type_int"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1786586788.1072752, "supported_languages": null}, "macro.iterable.get_list_user_columns": {"name": "get_list_user_columns", "resource_type": "macro", "package_name": "iterable", "path": "macros/staging/get_list_user_columns.sql", "original_file_path": "macros/staging/get_list_user_columns.sql", "unique_id": "macro.iterable.get_list_user_columns", "macro_sql": "{% macro get_list_user_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_id\", \"datatype\": dbt.type_string()},\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"index\", \"datatype\": dbt.type_int()},\n {\"name\": \"list_id\", \"datatype\": dbt.type_int()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.type_string", "macro.dbt.type_timestamp", "macro.dbt.type_int"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1786586788.108253, "supported_languages": null}, "macro.iterable.get_event_columns": {"name": "get_event_columns", "resource_type": "macro", "package_name": "iterable", "path": "macros/staging/get_event_columns.sql", "original_file_path": "macros/staging/get_event_columns.sql", "unique_id": "macro.iterable.get_event_columns", "macro_sql": "{% macro get_event_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_id\", \"datatype\": dbt.type_string()},\n {\"name\": \"_fivetran_user_id\", \"datatype\": dbt.type_string()},\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"campaign_id\", \"datatype\": dbt.type_int()},\n {\"name\": \"content_id\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"created_at\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"email\", \"datatype\": dbt.type_string()},\n {\"name\": \"event_name\", \"datatype\": dbt.type_string()},\n {\"name\": \"message_bus_id\", \"datatype\": dbt.type_string()},\n {\"name\": \"message_id\", \"datatype\": dbt.type_string()},\n {\"name\": \"message_type_id\", \"datatype\": dbt.type_int()},\n {\"name\": \"recipient_state\", \"datatype\": dbt.type_string()},\n {\"name\": \"status\", \"datatype\": dbt.type_string()},\n {\"name\": \"unsub_source\", \"datatype\": dbt.type_string()},\n {\"name\": \"user_agent\", \"datatype\": dbt.type_string()},\n {\"name\": \"user_agent_device\", \"datatype\": dbt.type_string()},\n {\"name\": \"transactional_data\", \"datatype\": dbt.type_string()},\n {\"name\": \"additional_properties\", \"datatype\": dbt.type_string()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.type_string", "macro.dbt.type_timestamp", "macro.dbt.type_int", "macro.dbt.type_numeric"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1786586788.1113088, "supported_languages": null}, "macro.iterable.get_campaign_history_columns": {"name": "get_campaign_history_columns", "resource_type": "macro", "package_name": "iterable", "path": "macros/staging/get_campaign_history_columns.sql", "original_file_path": "macros/staging/get_campaign_history_columns.sql", "unique_id": "macro.iterable.get_campaign_history_columns", "macro_sql": "{% macro get_campaign_history_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"campaign_state\", \"datatype\": dbt.type_string()},\n {\"name\": \"created_at\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"created_by_user_id\", \"datatype\": dbt.type_string()},\n {\"name\": \"updated_by_user_id\", \"datatype\": dbt.type_string()},\n {\"name\": \"ended_at\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"id\", \"datatype\": dbt.type_int()},\n {\"name\": \"name\", \"datatype\": dbt.type_string()},\n {\"name\": \"recurring_campaign_id\", \"datatype\": dbt.type_int()},\n {\"name\": \"send_size\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"start_at\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"template_id\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"type\", \"datatype\": dbt.type_string()},\n {\"name\": \"updated_at\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"workflow_id\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"message_medium\", \"datatype\": dbt.type_string()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.type_timestamp", "macro.dbt.type_string", "macro.dbt.type_int", "macro.dbt.type_numeric"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1786586788.114097, "supported_languages": null}, "macro.iterable.get_channel_columns": {"name": "get_channel_columns", "resource_type": "macro", "package_name": "iterable", "path": "macros/staging/get_channel_columns.sql", "original_file_path": "macros/staging/get_channel_columns.sql", "unique_id": "macro.iterable.get_channel_columns", "macro_sql": "{% macro get_channel_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_deleted\", \"datatype\": \"boolean\"},\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"channel_type\", \"datatype\": dbt.type_string()},\n {\"name\": \"id\", \"datatype\": dbt.type_int()},\n {\"name\": \"message_medium\", \"datatype\": dbt.type_string()},\n {\"name\": \"name\", \"datatype\": dbt.type_string()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.type_timestamp", "macro.dbt.type_string", "macro.dbt.type_int"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1786586788.115492, "supported_languages": null}, "macro.iterable.get_list_columns": {"name": "get_list_columns", "resource_type": "macro", "package_name": "iterable", "path": "macros/staging/get_list_columns.sql", "original_file_path": "macros/staging/get_list_columns.sql", "unique_id": "macro.iterable.get_list_columns", "macro_sql": "{% macro get_list_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_deleted\", \"datatype\": \"boolean\"},\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"created_at\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"id\", \"datatype\": dbt.type_int()},\n {\"name\": \"list_type\", \"datatype\": dbt.type_string()},\n {\"name\": \"description\", \"datatype\": dbt.type_string()},\n {\"name\": \"name\", \"datatype\": dbt.type_string()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.type_timestamp", "macro.dbt.type_int", "macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1786586788.1169748, "supported_languages": null}, "macro.iterable.get_template_history_columns": {"name": "get_template_history_columns", "resource_type": "macro", "package_name": "iterable", "path": "macros/staging/get_template_history_columns.sql", "original_file_path": "macros/staging/get_template_history_columns.sql", "unique_id": "macro.iterable.get_template_history_columns", "macro_sql": "{% macro get_template_history_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"client_template_id\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"created_at\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"creator_user_id\", \"datatype\": dbt.type_string()},\n {\"name\": \"id\", \"datatype\": dbt.type_int()},\n {\"name\": \"message_type_id\", \"datatype\": dbt.type_int()},\n {\"name\": \"name\", \"datatype\": dbt.type_string()},\n {\"name\": \"template_type\", \"datatype\": dbt.type_string()},\n {\"name\": \"updated_at\", \"datatype\": dbt.type_timestamp()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.type_timestamp", "macro.dbt.type_numeric", "macro.dbt.type_string", "macro.dbt.type_int"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1786586788.1187105, "supported_languages": null}, "macro.iterable.get_user_unsubscribed_channel_columns": {"name": "get_user_unsubscribed_channel_columns", "resource_type": "macro", "package_name": "iterable", "path": "macros/staging/get_user_unsubscribed_channel_columns.sql", "original_file_path": "macros/staging/get_user_unsubscribed_channel_columns.sql", "unique_id": "macro.iterable.get_user_unsubscribed_channel_columns", "macro_sql": "{% macro get_user_unsubscribed_channel_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"_fivetran_id\", \"datatype\": dbt.type_string()},\n {\"name\": \"channel_id\", \"datatype\": dbt.type_int()},\n {\"name\": \"email\", \"datatype\": dbt.type_string()},\n {\"name\": \"updated_at\", \"datatype\": dbt.type_timestamp()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.type_timestamp", "macro.dbt.type_string", "macro.dbt.type_int"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1786586788.1198442, "supported_languages": null}, "macro.iterable.get_campaign_label_history_columns": {"name": "get_campaign_label_history_columns", "resource_type": "macro", "package_name": "iterable", "path": "macros/staging/get_campaign_label_history_columns.sql", "original_file_path": "macros/staging/get_campaign_label_history_columns.sql", "unique_id": "macro.iterable.get_campaign_label_history_columns", "macro_sql": "{% macro get_campaign_label_history_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"campaign_id\", \"datatype\": dbt.type_int()},\n {\"name\": \"label\", \"datatype\": dbt.type_string()},\n {\"name\": \"updated_at\", \"datatype\": dbt.type_timestamp()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.type_timestamp", "macro.dbt.type_int", "macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1786586788.120819, "supported_languages": null}, "macro.iterable.get_user_history_columns": {"name": "get_user_history_columns", "resource_type": "macro", "package_name": "iterable", "path": "macros/staging/get_user_history_columns.sql", "original_file_path": "macros/staging/get_user_history_columns.sql", "unique_id": "macro.iterable.get_user_history_columns", "macro_sql": "{% macro get_user_history_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_id\", \"datatype\": dbt.type_string()},\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"email\", \"datatype\": dbt.type_string()},\n {\"name\": \"email_list_ids\", \"datatype\": dbt.type_string()},\n {\"name\": \"first_name\", \"datatype\": dbt.type_string()},\n {\"name\": \"last_name\", \"datatype\": dbt.type_string()},\n {\"name\": \"phone_number\", \"datatype\": dbt.type_string()},\n {\"name\": \"signup_date\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"signup_source\", \"datatype\": dbt.type_string()},\n {\"name\": \"updated_at\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"user_id\", \"datatype\": dbt.type_string()},\n {\"name\": \"iterable_user_id\", \"datatype\": dbt.type_string()}\n\n] %}\n\n{{ fivetran_utils.add_pass_through_columns(columns, var('iterable_user_history_pass_through_columns')) }}\n\n{{ return(columns) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.type_string", "macro.dbt.type_timestamp", "macro.fivetran_utils.add_pass_through_columns"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1786586788.1232476, "supported_languages": null}, "macro.iterable.get_user_unsubscribed_message_type_columns": {"name": "get_user_unsubscribed_message_type_columns", "resource_type": "macro", "package_name": "iterable", "path": "macros/staging/get_user_unsubscribed_message_type_columns.sql", "original_file_path": "macros/staging/get_user_unsubscribed_message_type_columns.sql", "unique_id": "macro.iterable.get_user_unsubscribed_message_type_columns", "macro_sql": "{% macro get_user_unsubscribed_message_type_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"_fivetran_id\", \"datatype\": dbt.type_string()},\n {\"name\": \"message_type_id\", \"datatype\": dbt.type_string()},\n {\"name\": \"email\", \"datatype\": dbt.type_string()},\n {\"name\": \"updated_at\", \"datatype\": dbt.type_timestamp()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.type_timestamp", "macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1786586788.1243849, "supported_languages": null}, "macro.iterable.json_to_string": {"name": "json_to_string", "resource_type": "macro", "package_name": "iterable", "path": "macros/staging/json_to_string.sql", "original_file_path": "macros/staging/json_to_string.sql", "unique_id": "macro.iterable.json_to_string", "macro_sql": "{%- macro json_to_string(column, column_list) -%}\n {{ return(adapter.dispatch('json_to_string', 'iterable')(column, column_list)) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.iterable.default__json_to_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "column", "type": null, "description": ""}, {"name": "column_list", "type": null, "description": ""}], "created_at": 1786586788.1250381, "supported_languages": null}, "macro.iterable.default__json_to_string": {"name": "default__json_to_string", "resource_type": "macro", "package_name": "iterable", "path": "macros/staging/json_to_string.sql", "original_file_path": "macros/staging/json_to_string.sql", "unique_id": "macro.iterable.default__json_to_string", "macro_sql": "{%- macro default__json_to_string(column, column_list) -%}\n cast({{ column }} as {{ dbt.type_string() }})\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "column", "type": null, "description": ""}, {"name": "column_list", "type": null, "description": ""}], "created_at": 1786586788.1252956, "supported_languages": null}, "macro.iterable.bigquery__json_to_string": {"name": "bigquery__json_to_string", "resource_type": "macro", "package_name": "iterable", "path": "macros/staging/json_to_string.sql", "original_file_path": "macros/staging/json_to_string.sql", "unique_id": "macro.iterable.bigquery__json_to_string", "macro_sql": "{%- macro bigquery__json_to_string(column, column_list) -%}\n {%- set columns = column_list -%}\n {%- set ns = namespace(column_type='string') -%}\n\n {%- for col in columns -%}\n {%- if col.name|lower == column|lower -%}\n {%- set ns.column_type = col.dtype|lower -%}\n {%- endif -%}\n {%- endfor -%}\n\n {%- if ns.column_type == 'json' -%}\n to_json_string({{ column }})\n {%- else -%}\n cast({{ column }} as {{ dbt.type_string() }})\n {%- endif -%}\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "column", "type": null, "description": ""}, {"name": "column_list", "type": null, "description": ""}], "created_at": 1786586788.1261754, "supported_languages": null}, "macro.iterable.get_campaign_list_history_columns": {"name": "get_campaign_list_history_columns", "resource_type": "macro", "package_name": "iterable", "path": "macros/staging/get_campaign_list_history_columns.sql", "original_file_path": "macros/staging/get_campaign_list_history_columns.sql", "unique_id": "macro.iterable.get_campaign_list_history_columns", "macro_sql": "{% macro get_campaign_list_history_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"campaign_id\", \"datatype\": dbt.type_int()},\n {\"name\": \"list_id\", \"datatype\": dbt.type_int()},\n {\"name\": \"updated_at\", \"datatype\": dbt.type_timestamp()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.type_timestamp", "macro.dbt.type_int"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1786586788.1271513, "supported_languages": null}, "macro.iterable.does_table_exist": {"name": "does_table_exist", "resource_type": "macro", "package_name": "iterable", "path": "macros/staging/does_table_exist.sql", "original_file_path": "macros/staging/does_table_exist.sql", "unique_id": "macro.iterable.does_table_exist", "macro_sql": "{%- macro does_table_exist(table_name) -%}\n {%- if execute -%} -- returns true when dbt is in execute mode\n {%- set ns = namespace(has_table=false) -%} -- declare boolean namespace and default value \n {%- for node in graph.sources.values() -%} -- grab sources from the dictionary of nodes \n -- call the database for the matching table\n {%- if node.name | lower == table_name | lower -%} \n {%- set source_relation = adapter.get_relation(\n database=node.database,\n schema=node.schema,\n identifier=node.identifier ) -%}\n {% endif %}\n {%- if source_relation == None -%} \n {{ return(False) }} -- return false if relation identified by the database.schema.identifier does not exist for the given table name\n {% endif %}\n {%- endfor -%}\n {{ return(True) }}\n {%- endif -%} \n{%- endmacro -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "table_name", "type": null, "description": ""}], "created_at": 1786586788.1284816, "supported_languages": null}, "macro.iterable.get_event_extension_columns": {"name": "get_event_extension_columns", "resource_type": "macro", "package_name": "iterable", "path": "macros/staging/get_event_extension_columns.sql", "original_file_path": "macros/staging/get_event_extension_columns.sql", "unique_id": "macro.iterable.get_event_extension_columns", "macro_sql": "{% macro get_event_extension_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_id\", \"datatype\": dbt.type_string()},\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"app_already_running\", \"datatype\": \"boolean\"},\n {\"name\": \"badge\", \"datatype\": dbt.type_string()},\n {\"name\": \"catalog_collection_count\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"catalog_lookup_count\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"canonical_url_id\", \"datatype\": dbt.type_string()},\n {\"name\": \"content_available\", \"datatype\": \"boolean\"},\n {\"name\": \"content_id\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"device\", \"datatype\": dbt.type_string()},\n {\"name\": \"email_id\", \"datatype\": dbt.type_string()},\n {\"name\": \"email_subject\", \"datatype\": dbt.type_string()},\n {\"name\": \"experiment_id\", \"datatype\": dbt.type_string()},\n {\"name\": \"from_phone_number_id\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"from_smssender_id\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"link_id\", \"datatype\": dbt.type_string()},\n {\"name\": \"link_url\", \"datatype\": dbt.type_string()},\n {\"name\": \"locale\", \"datatype\": dbt.type_string()},\n {\"name\": \"payload\", \"datatype\": dbt.type_string()},\n {\"name\": \"platform_endpoint\", \"datatype\": dbt.type_string()},\n {\"name\": \"push_message\", \"datatype\": dbt.type_string()},\n {\"name\": \"region\", \"datatype\": dbt.type_string()},\n {\"name\": \"sms_message\", \"datatype\": dbt.type_string()},\n {\"name\": \"to_phone_number\", \"datatype\": dbt.type_string()},\n {\"name\": \"url\", \"datatype\": dbt.type_string()},\n {\"name\": \"workflow_id\", \"datatype\": dbt.type_string()},\n {\"name\": \"workflow_name\", \"datatype\": dbt.type_string()},\n {\"name\": \"city\", \"datatype\": dbt.type_string()},\n {\"name\": \"clicked_url\", \"datatype\": dbt.type_string()},\n {\"name\": \"country\", \"datatype\": dbt.type_string()},\n {\"name\": \"error_code\", \"datatype\": dbt.type_string()},\n {\"name\": \"expires_at\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"from_phone_number\", \"datatype\": dbt.type_string()},\n {\"name\": \"in_app_body\", \"datatype\": dbt.type_string()},\n {\"name\": \"is_sms_estimation\", \"datatype\": \"boolean\"},\n {\"name\": \"labels\", \"datatype\": dbt.type_string()},\n {\"name\": \"message_status\", \"datatype\": dbt.type_string()},\n {\"name\": \"mms_send_count\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"reason\", \"datatype\": dbt.type_string()},\n {\"name\": \"sms_send_count\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"_fivetran_user_id\", \"datatype\": dbt.type_string()}\n] %}\n\n{{ fivetran_utils.add_pass_through_columns(columns, var('iterable_event_extension_pass_through_columns')) }}\n\n{{ return(columns) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.type_string", "macro.dbt.type_timestamp", "macro.dbt.type_numeric", "macro.fivetran_utils.add_pass_through_columns"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1786586788.1351628, "supported_languages": null}, "macro.iterable.get_message_type_columns": {"name": "get_message_type_columns", "resource_type": "macro", "package_name": "iterable", "path": "macros/staging/get_message_type_columns.sql", "original_file_path": "macros/staging/get_message_type_columns.sql", "unique_id": "macro.iterable.get_message_type_columns", "macro_sql": "{% macro get_message_type_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_deleted\", \"datatype\": \"boolean\"},\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"channel_id\", \"datatype\": dbt.type_int()},\n {\"name\": \"id\", \"datatype\": dbt.type_int()},\n {\"name\": \"name\", \"datatype\": dbt.type_string()},\n {\"name\": \"created_at\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"frequency_cap\", \"datatype\": dbt.type_string()},\n {\"name\": \"rate_limit_per_minute\", \"datatype\": dbt.type_string()},\n {\"name\": \"subscription_policy\", \"datatype\": dbt.type_string()},\n {\"name\": \"updated_at\", \"datatype\": dbt.type_timestamp()},\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.type_timestamp", "macro.dbt.type_int", "macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1786586788.1370738, "supported_languages": null}}, "docs": {"doc.dbt.__overview__": {"name": "__overview__", "resource_type": "doc", "package_name": "dbt", "path": "overview.md", "original_file_path": "docs/overview.md", "unique_id": "doc.dbt.__overview__", "block_contents": "### Welcome!\n\nWelcome to the auto-generated documentation for your dbt project!\n\n### Navigation\n\nYou can use the `Project` and `Database` navigation tabs on the left side of the window to explore the models\nin your project.\n\n#### Project Tab\nThe `Project` tab mirrors the directory structure of your dbt project. In this tab, you can see all of the\nmodels defined in your dbt project, as well as models imported from dbt packages.\n\n#### Database Tab\nThe `Database` tab also exposes your models, but in a format that looks more like a database explorer. This view\nshows relations (tables and views) grouped into database schemas. Note that ephemeral models are _not_ shown\nin this interface, as they do not exist in the database.\n\n### Graph Exploration\nYou can click the blue icon on the bottom-right corner of the page to view the lineage graph of your models.\n\nOn model pages, you'll see the immediate parents and children of the model you're exploring. By clicking the `Expand`\nbutton at the top-right of this lineage pane, you'll be able to see all of the models that are used to build,\nor are built from, the model you're exploring.\n\nOnce expanded, you'll be able to use the `--select` and `--exclude` model selection syntax to filter the\nmodels in the graph. For more information on model selection, check out the [dbt docs](https://docs.getdbt.com/docs/model-selection-syntax).\n\nNote that you can also right-click on models to interactively filter and explore the graph.\n\n---\n\n### More information\n\n- [What is dbt](https://docs.getdbt.com/docs/introduction)?\n- Read the [dbt viewpoint](https://docs.getdbt.com/docs/viewpoint)\n- [Installation](https://docs.getdbt.com/docs/installation)\n- Join the [dbt Community](https://www.getdbt.com/community/) for questions and discussion"}, "doc.iterable.source_relation": {"name": "source_relation", "resource_type": "doc", "package_name": "iterable", "path": "docs.md", "original_file_path": "models/docs.md", "unique_id": "doc.iterable.source_relation", "block_contents": "Identifies the record's source."}, "doc.iterable._fivetran_synced": {"name": "_fivetran_synced", "resource_type": "doc", "package_name": "iterable", "path": "docs.md", "original_file_path": "models/docs.md", "unique_id": "doc.iterable._fivetran_synced", "block_contents": "The time when a record was last updated by Fivetran."}}, "exposures": {}, "metrics": {}, "groups": {}, "selectors": {}, "disabled": {"test.iterable_integration_tests.consistency_events": [{"database": "postgres", "schema": "public_dbt_test__audit", "name": "consistency_events", "resource_type": "test", "package_name": "iterable_integration_tests", "path": "consistency/consistency_events.sql", "original_file_path": "tests/consistency/consistency_events.sql", "unique_id": "test.iterable_integration_tests.consistency_events", "fqn": ["iterable_integration_tests", "consistency", "consistency_events"], "alias": "consistency_events", "checksum": {"name": "sha256", "checksum": "6e82de77a605ca7613eb3563f2158ad172785552d38cbf3617136a816c073b36"}, "config": {"enabled": false, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": ["fivetran_validations"], "meta": {}, "group": null, "static_analysis": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "sql_header": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": ["fivetran_validations"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"tags": "fivetran_validations", "enabled": "var('fivetran_validation_tests_enabled', False)"}, "created_at": 1786586788.8340151, "relation_name": null, "raw_code": "{{ config(\n tags=\"fivetran_validations\",\n enabled=var('fivetran_validation_tests_enabled', false)\n) }}\n\n-- exclude JSON fields\n{% set exclude_cols = ['additional_properties', 'transactional_data'] + var('consistency_test_exclude_metrics', []) %}\n{% set fields = dbt_utils.star(from=ref('iterable__events'), except=exclude_cols) %}\n\n-- this test ensures the iterable__events end model matches the prior version\nwith prod as (\n select {{ fields }}\n from {{ target.schema }}_iterable_prod.iterable__events\n where date(created_at) < date({{ dbt.current_timestamp() }})\n),\n\ndev as (\n select {{ fields }}\n from {{ target.schema }}_iterable_dev.iterable__events\n where date(created_at) < date({{ dbt.current_timestamp() }})\n),\n\nprod_not_in_dev as (\n -- rows from prod not found in dev\n select * from prod\n except distinct\n select * from dev\n),\n\ndev_not_in_prod as (\n -- rows from dev not found in prod\n select * from dev\n except distinct\n select * from prod\n),\n\nfinal as (\n select\n *,\n 'from prod' as source\n from prod_not_in_dev\n\n union all -- union since we only care if rows are produced\n\n select\n *,\n 'from dev' as source\n from dev_not_in_prod\n)\n\nselect *\nfrom final", "doc_blocks": [], "language": "sql", "refs": [{"name": "iterable__events", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt_utils.star", "macro.dbt.current_timestamp"], "nodes": []}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}}], "test.iterable_integration_tests.consistency_user_unsubscriptions": [{"database": "postgres", "schema": "public_dbt_test__audit", "name": "consistency_user_unsubscriptions", "resource_type": "test", "package_name": "iterable_integration_tests", "path": "consistency/consistency_user_unsubscriptions.sql", "original_file_path": "tests/consistency/consistency_user_unsubscriptions.sql", "unique_id": "test.iterable_integration_tests.consistency_user_unsubscriptions", "fqn": ["iterable_integration_tests", "consistency", "consistency_user_unsubscriptions"], "alias": "consistency_user_unsubscriptions", "checksum": {"name": "sha256", "checksum": "32d0be8a7f721a49100a7f4b1046a8ecb1d75b86f4ad1a484d53a1d03343bc40"}, "config": {"enabled": false, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": ["fivetran_validations"], "meta": {}, "group": null, "static_analysis": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "sql_header": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": ["fivetran_validations"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"tags": "fivetran_validations", "enabled": "var('fivetran_validation_tests_enabled', False)"}, "created_at": 1786586788.8890452, "relation_name": null, "raw_code": "{{ config(\n tags=\"fivetran_validations\",\n enabled=var('fivetran_validation_tests_enabled', false)\n) }}\n\n{% set exclude_cols = var('consistency_test_exclude_metrics', []) %}\n{% set fields = dbt_utils.star(from=ref('iterable__user_unsubscriptions'), except=exclude_cols) %}\n\n-- this test ensures the iterable__user_unsubscriptions end model matches the prior version\nwith prod as (\n select {{ fields }}\n from {{ target.schema }}_iterable_prod.iterable__user_unsubscriptions\n),\n\ndev as (\n select {{ fields }}\n from {{ target.schema }}_iterable_dev.iterable__user_unsubscriptions\n),\n\nprod_not_in_dev as (\n -- rows from prod not found in dev\n select * from prod\n except distinct\n select * from dev\n),\n\ndev_not_in_prod as (\n -- rows from dev not found in prod\n select * from dev\n except distinct\n select * from prod\n),\n\nfinal as (\n select\n *,\n 'from prod' as source\n from prod_not_in_dev\n\n union all -- union since we only care if rows are produced\n\n select\n *,\n 'from dev' as source\n from dev_not_in_prod\n)\n\nselect *\nfrom final", "doc_blocks": [], "language": "sql", "refs": [{"name": "iterable__user_unsubscriptions", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt_utils.star"], "nodes": []}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}}], "test.iterable_integration_tests.consistency_user_campaign": [{"database": "postgres", "schema": "public_dbt_test__audit", "name": "consistency_user_campaign", "resource_type": "test", "package_name": "iterable_integration_tests", "path": "consistency/consistency_user_campaign.sql", "original_file_path": "tests/consistency/consistency_user_campaign.sql", "unique_id": "test.iterable_integration_tests.consistency_user_campaign", "fqn": ["iterable_integration_tests", "consistency", "consistency_user_campaign"], "alias": "consistency_user_campaign", "checksum": {"name": "sha256", "checksum": "8663f2c250688a8303d2ef38dc723e2fc62d996396b4b07e13c05feeb48cd97c"}, "config": {"enabled": false, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": ["fivetran_validations"], "meta": {}, "group": null, "static_analysis": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "sql_header": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": ["fivetran_validations"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"tags": "fivetran_validations", "enabled": "var('fivetran_validation_tests_enabled', False)"}, "created_at": 1786586788.8961625, "relation_name": null, "raw_code": "{{ config(\n tags=\"fivetran_validations\",\n enabled=var('fivetran_validation_tests_enabled', false)\n) }}\n\n{% set exclude_cols = var('consistency_test_exclude_metrics', []) %}\n{% set fields = dbt_utils.star(from=ref('iterable__user_campaign'), except=exclude_cols) %}\n\n-- this test ensures the iterable__user_campaign end model matches the prior version\nwith prod as (\n select {{ fields }}\n from {{ target.schema }}_iterable_prod.iterable__user_campaign\n where date(first_event_at) < date({{ dbt.current_timestamp() }})\n),\n\ndev as (\n select {{ fields }}\n from {{ target.schema }}_iterable_dev.iterable__user_campaign\n where date(first_event_at) < date({{ dbt.current_timestamp() }})\n),\n\nprod_not_in_dev as (\n -- rows from prod not found in dev\n select * from prod\n except distinct\n select * from dev\n),\n\ndev_not_in_prod as (\n -- rows from dev not found in prod\n select * from dev\n except distinct\n select * from prod\n),\n\nfinal as (\n select\n *,\n 'from prod' as source\n from prod_not_in_dev\n\n union all -- union since we only care if rows are produced\n\n select\n *,\n 'from dev' as source\n from dev_not_in_prod\n)\n\nselect *\nfrom final", "doc_blocks": [], "language": "sql", "refs": [{"name": "iterable__user_campaign", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt_utils.star", "macro.dbt.current_timestamp"], "nodes": []}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}}], "test.iterable_integration_tests.consistency_users": [{"database": "postgres", "schema": "public_dbt_test__audit", "name": "consistency_users", "resource_type": "test", "package_name": "iterable_integration_tests", "path": "consistency/consistency_users.sql", "original_file_path": "tests/consistency/consistency_users.sql", "unique_id": "test.iterable_integration_tests.consistency_users", "fqn": ["iterable_integration_tests", "consistency", "consistency_users"], "alias": "consistency_users", "checksum": {"name": "sha256", "checksum": "d367ccd8f7d79248da78ce29fc8f08876913df08b89866895cce315f46ef81e3"}, "config": {"enabled": false, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": ["fivetran_validations"], "meta": {}, "group": null, "static_analysis": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "sql_header": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": ["fivetran_validations"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"tags": "fivetran_validations", "enabled": "var('fivetran_validation_tests_enabled', False)"}, "created_at": 1786586788.9059463, "relation_name": null, "raw_code": "{{ config(\n tags=\"fivetran_validations\",\n enabled=var('fivetran_validation_tests_enabled', false)\n) }}\n\n{% set exclude_cols = var('consistency_test_exclude_metrics', []) %}\n{% set fields = dbt_utils.star(from=ref('iterable__users'), except=exclude_cols) %}\n\n-- this test ensures the iterable__users end model matches the prior version\nwith prod as (\n select {{ fields }}\n from {{ target.schema }}_iterable_prod.iterable__users\n where date(updated_at) < date({{ dbt.current_timestamp() }})\n),\n\ndev as (\n select {{ fields }}\n from {{ target.schema }}_iterable_dev.iterable__users\n where date(updated_at) < date({{ dbt.current_timestamp() }})\n),\n\nprod_not_in_dev as (\n -- rows from prod not found in dev\n select * from prod\n except distinct\n select * from dev\n),\n\ndev_not_in_prod as (\n -- rows from dev not found in prod\n select * from dev\n except distinct\n select * from prod\n),\n\nfinal as (\n select\n *,\n 'from prod' as source\n from prod_not_in_dev\n\n union all -- union since we only care if rows are produced\n\n select\n *,\n 'from dev' as source\n from dev_not_in_prod\n)\n\nselect *\nfrom final", "doc_blocks": [], "language": "sql", "refs": [{"name": "iterable__users", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt_utils.star", "macro.dbt.current_timestamp"], "nodes": []}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}}], "test.iterable_integration_tests.consistency_user_unsubscribes_pre_aug_2023": [{"database": "postgres", "schema": "public_dbt_test__audit", "name": "consistency_user_unsubscribes_pre_aug_2023", "resource_type": "test", "package_name": "iterable_integration_tests", "path": "consistency/consistency_user_unsubscribes_pre_aug_2023.sql", "original_file_path": "tests/consistency/consistency_user_unsubscribes_pre_aug_2023.sql", "unique_id": "test.iterable_integration_tests.consistency_user_unsubscribes_pre_aug_2023", "fqn": ["iterable_integration_tests", "consistency", "consistency_user_unsubscribes_pre_aug_2023"], "alias": "consistency_user_unsubscribes_pre_aug_2023", "checksum": {"name": "sha256", "checksum": "0d85b35d94066e59119f57fbe930a19353dfbb79b4e812b54de9c19520a58402"}, "config": {"enabled": false, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": ["fivetran_validations"], "meta": {}, "group": null, "static_analysis": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "sql_header": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": ["fivetran_validations"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"tags": "fivetran_validations", "enabled": "var('fivetran_validation_tests_enabled', False)"}, "created_at": 1786586788.91423, "relation_name": null, "raw_code": "-- These validation tests were designed to work with the pre-August 2023 version of the Iterable connector.\n-- You will thus need to comment out `iterable_user_unsubscribed_channel_identifier` and `iterable_user_unsubscribed_message_type_identifier` in the `integration_tests/dbt_project.yml` to run and validate these tests. \n\n{{ config(\n tags=\"fivetran_validations\",\n enabled=var('fivetran_validation_tests_enabled', false)\n) }}\n\n\nwith prod as (\n\n select \n unique_user_key, \n coalesce(count(distinct unique_user_key), 0) as unique_user_records_prod, \n coalesce(count(distinct channel_id), 0) as channels_prod, \n coalesce(count(distinct message_type_id), 0) as message_types_prod\n from {{ target.schema }}_iterable_prod.iterable__user_unsubscriptions\n where channel_id is not null\n and message_type_id is not null\n group by 1\n),\n\ndev as (\n\n select \n unique_user_key, \n coalesce(count(distinct unique_user_key), 0) as unique_user_records_dev, \n coalesce(count(distinct channel_id), 0) as channels_dev, \n coalesce(count(distinct message_type_id), 0) as message_types_dev\n from {{ target.schema }}_iterable_dev.iterable__user_unsubscriptions\n where channel_id is not null\n and message_type_id is not null\n group by 1\n),\n\nfinal as (\n\n select \n prod.unique_user_key,\n unique_user_records_prod,\n unique_user_records_dev,\n channels_prod,\n channels_dev,\n message_types_prod,\n message_types_dev\n from prod\n full outer join dev\n on prod.unique_user_key = dev.unique_user_key\n) \n\nselect *\nfrom final\nwhere unique_user_records_prod != unique_user_records_dev\n and channels_prod != channels_dev \n and message_types_prod != message_types_dev", "doc_blocks": [], "language": "sql", "refs": [], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": [], "nodes": []}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}}], "test.iterable_integration_tests.consistency_list_user_history": [{"database": "postgres", "schema": "public_dbt_test__audit", "name": "consistency_list_user_history", "resource_type": "test", "package_name": "iterable_integration_tests", "path": "consistency/consistency_list_user_history.sql", "original_file_path": "tests/consistency/consistency_list_user_history.sql", "unique_id": "test.iterable_integration_tests.consistency_list_user_history", "fqn": ["iterable_integration_tests", "consistency", "consistency_list_user_history"], "alias": "consistency_list_user_history", "checksum": {"name": "sha256", "checksum": "e0081cf1366801020e3c9fbdc71e989f2bdd7b713ee328c2f4a5e9b97355601e"}, "config": {"enabled": false, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": ["fivetran_validations"], "meta": {}, "group": null, "static_analysis": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "sql_header": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": ["fivetran_validations"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"tags": "fivetran_validations", "enabled": "var('fivetran_validation_tests_enabled', False)"}, "created_at": 1786586788.9194555, "relation_name": null, "raw_code": "{{ config(\n tags=\"fivetran_validations\",\n enabled=var('fivetran_validation_tests_enabled', false)\n) }}\n\n{% set exclude_cols = var('consistency_test_exclude_metrics', []) %}\n{% set fields = dbt_utils.star(from=ref('iterable__list_user_history'), except=exclude_cols) %}\n\n-- this test ensures the iterable__list_user_history end model matches the prior version\nwith prod as (\n select {{ fields }}\n from {{ target.schema }}_iterable_prod.iterable__list_user_history\n),\n\ndev as (\n select {{ fields }}\n from {{ target.schema }}_iterable_dev.iterable__list_user_history\n),\n\nprod_not_in_dev as (\n -- rows from prod not found in dev\n select * from prod\n except distinct\n select * from dev\n),\n\ndev_not_in_prod as (\n -- rows from dev not found in prod\n select * from dev\n except distinct\n select * from prod\n),\n\nfinal as (\n select\n *,\n 'from prod' as source\n from prod_not_in_dev\n\n union all -- union since we only care if rows are produced\n\n select\n *,\n 'from dev' as source\n from dev_not_in_prod\n)\n\nselect *\nfrom final", "doc_blocks": [], "language": "sql", "refs": [{"name": "iterable__list_user_history", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt_utils.star"], "nodes": []}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}}], "test.iterable_integration_tests.consistency_campaigns": [{"database": "postgres", "schema": "public_dbt_test__audit", "name": "consistency_campaigns", "resource_type": "test", "package_name": "iterable_integration_tests", "path": "consistency/consistency_campaigns.sql", "original_file_path": "tests/consistency/consistency_campaigns.sql", "unique_id": "test.iterable_integration_tests.consistency_campaigns", "fqn": ["iterable_integration_tests", "consistency", "consistency_campaigns"], "alias": "consistency_campaigns", "checksum": {"name": "sha256", "checksum": "30e008529ef9f5fa6d8697bbcff2562fc9b176d571cc310458e67e8c82a46185"}, "config": {"enabled": false, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": ["fivetran_validations"], "meta": {}, "group": null, "static_analysis": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "sql_header": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": ["fivetran_validations"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"tags": "fivetran_validations", "enabled": "var('fivetran_validation_tests_enabled', False)"}, "created_at": 1786586788.9263616, "relation_name": null, "raw_code": "{{ config(\n tags=\"fivetran_validations\",\n enabled=var('fivetran_validation_tests_enabled', false)\n) }}\n\n{% set exclude_cols = ['labels'] + var('consistency_test_exclude_metrics', []) %}\n{% set fields = dbt_utils.star(from=ref('iterable__campaigns'), except=exclude_cols) %}\n\n-- this test ensures the iterable__campaigns end model matches the prior version\nwith prod as (\n select {{ fields }}\n from {{ target.schema }}_iterable_prod.iterable__campaigns\n where date(updated_at) < date({{ dbt.current_timestamp() }})\n),\n\ndev as (\n select {{ fields }}\n from {{ target.schema }}_iterable_dev.iterable__campaigns\n where date(updated_at) < date({{ dbt.current_timestamp() }})\n),\n\nprod_not_in_dev as (\n -- rows from prod not found in dev\n select * from prod\n except distinct\n select * from dev\n),\n\ndev_not_in_prod as (\n -- rows from dev not found in prod\n select * from dev\n except distinct\n select * from prod\n),\n\nfinal as (\n select\n *,\n 'from prod' as source\n from prod_not_in_dev\n\n union all -- union since we only care if rows are produced\n\n select\n *,\n 'from dev' as source\n from dev_not_in_prod\n)\n\nselect *\nfrom final", "doc_blocks": [], "language": "sql", "refs": [{"name": "iterable__campaigns", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt_utils.star", "macro.dbt.current_timestamp"], "nodes": []}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}}], "test.iterable_integration_tests.user_unsubscribe_count_match_pre_aug_2023": [{"database": "postgres", "schema": "public_dbt_test__audit", "name": "user_unsubscribe_count_match_pre_aug_2023", "resource_type": "test", "package_name": "iterable_integration_tests", "path": "integrity/user_unsubscribe_count_match_pre_aug_2023.sql", "original_file_path": "tests/integrity/user_unsubscribe_count_match_pre_aug_2023.sql", "unique_id": "test.iterable_integration_tests.user_unsubscribe_count_match_pre_aug_2023", "fqn": ["iterable_integration_tests", "integrity", "user_unsubscribe_count_match_pre_aug_2023"], "alias": "user_unsubscribe_count_match_pre_aug_2023", "checksum": {"name": "sha256", "checksum": "6b37518965460a9c0b7161808527fa4b6f240a6ead0827a3950705267ebd236f"}, "config": {"enabled": false, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": ["fivetran_validations"], "meta": {}, "group": null, "static_analysis": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "sql_header": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": ["fivetran_validations"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"tags": "fivetran_validations", "enabled": "var('fivetran_validation_tests_enabled', False)"}, "created_at": 1786586788.9348302, "relation_name": null, "raw_code": "-- These validation tests were designed to work with the pre-August 2023 version of the Iterable connector.\n-- You will thus need to comment out `iterable_user_unsubscribed_channel_identifier` and `iterable_user_unsubscribed_message_type_identifier` in the `integration_tests/dbt_project.yml` to run and validate these tests. \n\n{{ config(\n tags=\"fivetran_validations\",\n enabled=var('fivetran_validation_tests_enabled', false)\n) }}\n\nwith unsub_channels as (\n\n select \n unique_user_key, \n channel_id\n from {{ ref('stg_iterable__user_unsubscribed_channel') }}\n group by 1, 2\n),\n\nunsub_messages as (\n\n select \n unique_user_key, \n message_type_id\n from {{ ref('stg_iterable__user_unsub_message_type') }}\n group by 1, 2\n),\n\nchannel_message_combos as (\n\n select channel_id, message_type_id \n from {{ ref('stg_iterable__message_type') }}\n group by 1, 2\n),\n\nmessage_channel_unsubs as (\n\n select \n unsub_channels.unique_user_key as unique_user_key_source,\n channel_message_combos.channel_id as channel_source,\n channel_message_combos.message_type_id as message_type_source\n from unsub_channels \n inner join channel_message_combos\n on unsub_channels.channel_id = channel_message_combos.channel_id\n\n union all\n\n select \n unsub_messages.unique_user_key as unique_user_key_source,\n channel_message_combos.channel_id as channel_source,\n channel_message_combos.message_type_id as message_type_source\n from unsub_messages\n inner join channel_message_combos\n on unsub_messages.message_type_id = channel_message_combos.message_type_id\n\n),\n\nsource_counts as (\n\n select unique_user_key_source, channel_source, message_type_source, count(*) as source_count\n from message_channel_unsubs \n group by 1, 2, 3\n),\n\nend_model_counts as (\n\n select unique_user_key as unique_user_key_end, channel_id as channel_end, message_type_id as message_type_end, count(*) as end_count\n from {{ ref('iterable__user_unsubscriptions') }}\n group by 1, 2, 3 \n)\n\nselect * \nfrom source_counts\ninner join end_model_counts \n on source_counts.unique_user_key_source = end_model_counts.unique_user_key_end\nwhere source_counts.channel_source = end_model_counts.channel_end\n and source_counts.message_type_source = end_model_counts.message_type_end\n and source_counts.source_count != end_model_counts.end_count", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__user_unsubscribed_channel", "package": null, "version": null}, {"name": "stg_iterable__user_unsub_message_type", "package": null, "version": null}, {"name": "stg_iterable__message_type", "package": null, "version": null}, {"name": "iterable__user_unsubscriptions", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": [], "nodes": []}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}}], "model.iterable.int_iterable__custom_events": [{"database": "postgres", "schema": "public_iterable_dev", "name": "int_iterable__custom_events", "resource_type": "model", "package_name": "iterable", "path": "intermediate/int_iterable__custom_events.sql", "original_file_path": "models/intermediate/int_iterable__custom_events.sql", "unique_id": "model.iterable.int_iterable__custom_events", "fqn": ["iterable", "intermediate", "int_iterable__custom_events"], "alias": "int_iterable__custom_events", "checksum": {"name": "sha256", "checksum": "0f0f1330b62dd5a320f37f7e30dae86a90c57e07c135369a259cfcba61875a16"}, "config": {"enabled": false, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "incremental", "incremental_strategy": "merge", "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": "event_id", "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}, "file_format": "delta"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"materialized": "incremental", "schema": "iterable_{{ var('directed_schema','dev') }}", "unique_key": "event_id", "incremental_strategy": "merge", "file_format": "delta", "enabled": "False", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1786586789.5276291, "relation_name": "\"postgres\".\"public_iterable_dev\".\"int_iterable__custom_events\"", "raw_code": "{{\n config(\n materialized='incremental',\n unique_key='event_id',\n incremental_strategy = 'merge',\n file_format = 'delta',\n enabled=false\n )\n}}\n\n-- leave this alone for now....setting enabled to false\nwith events as (\n\n select *\n from {{ ref('stg_iterable__event') }}\n\n where lower(event_name) = 'customevent'\n {% if is_incremental() %}\n and updated_at > ( select max(updated_at) from {{ this }} )\n {% endif %}\n\n), custom_events as (\n\n select \n events.*\n {# {{ dbt.split_part(string_text='additional_properties', delimiter_text=' : \"{', part_number=1) }} #}\n\n {% if target.type == 'snowflake' %}\n ,\n additional_properties.key as custom_event_name,\n additional_properties.value as custom_event_metadata\n {% endif %}\n from events\n\n \n {% if target.type == 'snowflake' %}\n cross join \n table(flatten(additional_properties)) as additional_properties\n where additional_properties.key != '_id'\n {% endif %}\n)\n\nselect *\nfrom custom_events", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__event", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.is_incremental"], "nodes": []}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}]}, "parent_map": {"seed.iterable_integration_tests.user_unsubscribed_channel_history_data": [], "seed.iterable_integration_tests.user_history_bq_json_data": [], "seed.iterable_integration_tests.event_extension_data": [], "seed.iterable_integration_tests.event_data": [], "seed.iterable_integration_tests.list_user_data": [], "seed.iterable_integration_tests.campaign_suppression_list_history_data": [], "seed.iterable_integration_tests.template_history_data": [], "seed.iterable_integration_tests.user_unsubscribed_message_type_data": [], "seed.iterable_integration_tests.user_history_data": [], "seed.iterable_integration_tests.campaign_metrics_data": [], "seed.iterable_integration_tests.channel_data": [], "seed.iterable_integration_tests.campaign_history_data": [], "seed.iterable_integration_tests.campaign_list_history_data": [], "seed.iterable_integration_tests.user_unsubscribed_channel_data": [], "seed.iterable_integration_tests.user_unsubscribed_message_type_history_data": [], "seed.iterable_integration_tests.message_type_data": [], "seed.iterable_integration_tests.campaign_label_history_data": [], "seed.iterable_integration_tests.list_data": [], "model.iterable.iterable__user_unsubscriptions": ["model.iterable.int_iterable__message_type_channel", "model.iterable.stg_iterable__user_unsub_message_type", "model.iterable.stg_iterable__user_unsubscribed_channel"], "model.iterable.iterable__user_campaign": ["model.iterable.iterable__events"], "model.iterable.iterable__list_user_history": ["model.iterable.int_iterable__list_user_unnest", "model.iterable.stg_iterable__list", "model.iterable.stg_iterable__list_user"], "model.iterable.iterable__campaigns": ["model.iterable.int_iterable__campaign_event_metrics", "model.iterable.int_iterable__campaign_labels", "model.iterable.int_iterable__campaign_lists", "model.iterable.int_iterable__latest_template", "model.iterable.int_iterable__recurring_campaigns"], "model.iterable.iterable__events": ["model.iterable.int_iterable__latest_template", "model.iterable.int_iterable__latest_user", "model.iterable.int_iterable__message_type_channel", "model.iterable.int_iterable__recurring_campaigns", "model.iterable.stg_iterable__event", "model.iterable.stg_iterable__event_extension"], "model.iterable.iterable__users": ["model.iterable.int_iterable__list_user_unnest", "model.iterable.int_iterable__user_event_metrics", "model.iterable.stg_iterable__list_user"], "model.iterable.int_iterable__recurring_campaigns": ["model.iterable.int_iterable__latest_campaign"], "model.iterable.int_iterable__campaign_labels": ["model.iterable.stg_iterable__campaign_label_history"], "model.iterable.int_iterable__latest_campaign": ["model.iterable.stg_iterable__campaign_history"], "model.iterable.int_iterable__message_type_channel": ["model.iterable.stg_iterable__channel", "model.iterable.stg_iterable__message_type"], "model.iterable.int_iterable__campaign_lists": ["model.iterable.stg_iterable__campaign_list_history", "model.iterable.stg_iterable__campaign_suppression_list_history"], "model.iterable.int_iterable__latest_user": ["model.iterable.stg_iterable__user_history"], "model.iterable.int_iterable__list_user_history": ["model.iterable.stg_iterable__user_history"], "model.iterable.int_iterable__list_user_unnest": ["model.iterable.int_iterable__list_user_history"], "model.iterable.int_iterable__latest_template": ["model.iterable.int_iterable__message_type_channel", "model.iterable.stg_iterable__template_history"], "model.iterable.int_iterable__user_event_metrics": ["model.iterable.iterable__user_campaign"], "model.iterable.int_iterable__campaign_event_metrics": ["model.iterable.iterable__user_campaign"], "model.iterable.stg_iterable__campaign_suppression_list_history": ["model.iterable.stg_iterable__campaign_suppression_list_history_tmp"], "model.iterable.stg_iterable__list_user": ["model.iterable.stg_iterable__list_user_tmp"], "model.iterable.stg_iterable__campaign_history": ["model.iterable.stg_iterable__campaign_history_tmp"], "model.iterable.stg_iterable__user_history": ["model.iterable.stg_iterable__user_history_tmp"], "model.iterable.stg_iterable__user_unsub_message_type": ["model.iterable.stg_iterable__user_unsub_message_type_tmp"], "model.iterable.stg_iterable__user_unsubscribed_channel": ["model.iterable.stg_iterable__user_unsubscribed_channel_tmp"], "model.iterable.stg_iterable__campaign_list_history": ["model.iterable.stg_iterable__campaign_list_history_tmp"], "model.iterable.stg_iterable__event_extension": ["model.iterable.stg_iterable__event_extension_tmp"], "model.iterable.stg_iterable__message_type": ["model.iterable.stg_iterable__message_type_tmp"], "model.iterable.stg_iterable__list": ["model.iterable.stg_iterable__list_tmp"], "model.iterable.stg_iterable__channel": ["model.iterable.stg_iterable__channel_tmp"], "model.iterable.stg_iterable__template_history": ["model.iterable.stg_iterable__template_history_tmp"], "model.iterable.stg_iterable__event": ["model.iterable.stg_iterable__event_tmp"], "model.iterable.stg_iterable__campaign_label_history": ["model.iterable.stg_iterable__campaign_label_history_tmp"], "model.iterable.stg_iterable__campaign_suppression_list_history_tmp": ["source.iterable.iterable.campaign_suppression_list_history"], "model.iterable.stg_iterable__template_history_tmp": ["source.iterable.iterable.template_history"], "model.iterable.stg_iterable__event_extension_tmp": ["source.iterable.iterable.event_extension"], "model.iterable.stg_iterable__user_unsubscribed_channel_tmp": ["source.iterable.iterable.user_unsubscribed_channel_history"], "model.iterable.stg_iterable__message_type_tmp": ["source.iterable.iterable.message_type"], "model.iterable.stg_iterable__campaign_list_history_tmp": ["source.iterable.iterable.campaign_list_history"], "model.iterable.stg_iterable__user_history_tmp": ["source.iterable.iterable.user_history"], "model.iterable.stg_iterable__campaign_history_tmp": ["source.iterable.iterable.campaign_history"], "model.iterable.stg_iterable__campaign_label_history_tmp": ["source.iterable.iterable.campaign_label_history"], "model.iterable.stg_iterable__user_unsub_message_type_tmp": ["source.iterable.iterable.user_unsubscribed_message_type_history"], "model.iterable.stg_iterable__channel_tmp": ["source.iterable.iterable.channel"], "model.iterable.stg_iterable__list_tmp": ["source.iterable.iterable.list"], "model.iterable.stg_iterable__list_user_tmp": ["source.iterable.iterable.list_user"], "model.iterable.stg_iterable__event_tmp": ["source.iterable.iterable.event"], "test.iterable.not_null_iterable__campaigns_campaign_id.03c9448919": ["model.iterable.iterable__campaigns"], "test.iterable.not_null_iterable__events_event_id.ed1d28a650": ["model.iterable.iterable__events"], "test.iterable.not_null_iterable__user_unsubscriptions_unique_user_key.f8db72932b": ["model.iterable.iterable__user_unsubscriptions"], "test.iterable.not_null_iterable__users_unique_user_key.4ca37a26c8": ["model.iterable.iterable__users"], "test.iterable.not_null_stg_iterable__campaign_history_campaign_id.b7c36e4525": ["model.iterable.stg_iterable__campaign_history"], "test.iterable.not_null_stg_iterable__campaign_label_history_campaign_id.1918cef89a": ["model.iterable.stg_iterable__campaign_label_history"], "test.iterable.not_null_stg_iterable__campaign_list_history_campaign_id.208f9bf9ed": ["model.iterable.stg_iterable__campaign_list_history"], "test.iterable.not_null_stg_iterable__campaign_suppression_list_history_campaign_id.3921289710": ["model.iterable.stg_iterable__campaign_suppression_list_history"], "test.iterable.not_null_stg_iterable__channel_channel_id.182ceb9636": ["model.iterable.stg_iterable__channel"], "test.iterable.not_null_stg_iterable__event_event_id.370cd4bc9d": ["model.iterable.stg_iterable__event"], "test.iterable.not_null_stg_iterable__event_unique_event_id.e2b46d3bb6": ["model.iterable.stg_iterable__event"], "test.iterable.not_null_stg_iterable__event_extension_event_id.144dedcd30": ["model.iterable.stg_iterable__event_extension"], "test.iterable.not_null_stg_iterable__list_list_id.47029d839a": ["model.iterable.stg_iterable__list"], "test.iterable.not_null_stg_iterable__message_type_message_type_id.75eaa6fa62": ["model.iterable.stg_iterable__message_type"], "test.iterable.not_null_stg_iterable__template_history_template_id.14b24a1dfe": ["model.iterable.stg_iterable__template_history"], "test.iterable.not_null_stg_iterable__list_user__fivetran_user_id.cca4b34c07": ["model.iterable.stg_iterable__list_user"], "test.iterable.not_null_stg_iterable__user_history_unique_user_key.2845af2127": ["model.iterable.stg_iterable__user_history"], "test.iterable.not_null_stg_iterable__user_unsubscribed_channel_channel_id.da0ed9e9be": ["model.iterable.stg_iterable__user_unsubscribed_channel"], "test.iterable.not_null_stg_iterable__user_unsub_message_type_message_type_id.268a89ea6f": ["model.iterable.stg_iterable__user_unsub_message_type"], "source.iterable.iterable.campaign_history": [], "source.iterable.iterable.campaign_label_history": [], "source.iterable.iterable.campaign_list_history": [], "source.iterable.iterable.campaign_suppression_list_history": [], "source.iterable.iterable.channel": [], "source.iterable.iterable.event": [], "source.iterable.iterable.event_extension": [], "source.iterable.iterable.list": [], "source.iterable.iterable.message_type": [], "source.iterable.iterable.template_history": [], "source.iterable.iterable.user_history": [], "source.iterable.iterable.user_unsubscribed_channel": [], "source.iterable.iterable.user_unsubscribed_message_type": [], "source.iterable.iterable.user_unsubscribed_channel_history": [], "source.iterable.iterable.user_unsubscribed_message_type_history": [], "source.iterable.iterable.list_user": []}, "child_map": {"seed.iterable_integration_tests.user_unsubscribed_channel_history_data": [], "seed.iterable_integration_tests.user_history_bq_json_data": [], "seed.iterable_integration_tests.event_extension_data": [], "seed.iterable_integration_tests.event_data": [], "seed.iterable_integration_tests.list_user_data": [], "seed.iterable_integration_tests.campaign_suppression_list_history_data": [], "seed.iterable_integration_tests.template_history_data": [], "seed.iterable_integration_tests.user_unsubscribed_message_type_data": [], "seed.iterable_integration_tests.user_history_data": [], "seed.iterable_integration_tests.campaign_metrics_data": [], "seed.iterable_integration_tests.channel_data": [], "seed.iterable_integration_tests.campaign_history_data": [], "seed.iterable_integration_tests.campaign_list_history_data": [], "seed.iterable_integration_tests.user_unsubscribed_channel_data": [], "seed.iterable_integration_tests.user_unsubscribed_message_type_history_data": [], "seed.iterable_integration_tests.message_type_data": [], "seed.iterable_integration_tests.campaign_label_history_data": [], "seed.iterable_integration_tests.list_data": [], "model.iterable.iterable__user_unsubscriptions": ["test.iterable.not_null_iterable__user_unsubscriptions_unique_user_key.f8db72932b"], "model.iterable.iterable__user_campaign": ["model.iterable.int_iterable__campaign_event_metrics", "model.iterable.int_iterable__user_event_metrics"], "model.iterable.iterable__list_user_history": [], "model.iterable.iterable__campaigns": ["test.iterable.not_null_iterable__campaigns_campaign_id.03c9448919"], "model.iterable.iterable__events": ["model.iterable.iterable__user_campaign", "test.iterable.not_null_iterable__events_event_id.ed1d28a650"], "model.iterable.iterable__users": ["test.iterable.not_null_iterable__users_unique_user_key.4ca37a26c8"], "model.iterable.int_iterable__recurring_campaigns": ["model.iterable.iterable__campaigns", "model.iterable.iterable__events"], "model.iterable.int_iterable__campaign_labels": ["model.iterable.iterable__campaigns"], "model.iterable.int_iterable__latest_campaign": ["model.iterable.int_iterable__recurring_campaigns"], "model.iterable.int_iterable__message_type_channel": ["model.iterable.int_iterable__latest_template", "model.iterable.iterable__events", "model.iterable.iterable__user_unsubscriptions"], "model.iterable.int_iterable__campaign_lists": ["model.iterable.iterable__campaigns"], "model.iterable.int_iterable__latest_user": ["model.iterable.iterable__events"], "model.iterable.int_iterable__list_user_history": ["model.iterable.int_iterable__list_user_unnest"], "model.iterable.int_iterable__list_user_unnest": ["model.iterable.iterable__list_user_history", "model.iterable.iterable__users"], "model.iterable.int_iterable__latest_template": ["model.iterable.iterable__campaigns", "model.iterable.iterable__events"], "model.iterable.int_iterable__user_event_metrics": ["model.iterable.iterable__users"], "model.iterable.int_iterable__campaign_event_metrics": ["model.iterable.iterable__campaigns"], "model.iterable.stg_iterable__campaign_suppression_list_history": ["model.iterable.int_iterable__campaign_lists", "test.iterable.not_null_stg_iterable__campaign_suppression_list_history_campaign_id.3921289710"], "model.iterable.stg_iterable__list_user": ["model.iterable.iterable__list_user_history", "model.iterable.iterable__users", "test.iterable.not_null_stg_iterable__list_user__fivetran_user_id.cca4b34c07"], "model.iterable.stg_iterable__campaign_history": ["model.iterable.int_iterable__latest_campaign", "test.iterable.not_null_stg_iterable__campaign_history_campaign_id.b7c36e4525"], "model.iterable.stg_iterable__user_history": ["model.iterable.int_iterable__latest_user", "model.iterable.int_iterable__list_user_history", "test.iterable.not_null_stg_iterable__user_history_unique_user_key.2845af2127"], "model.iterable.stg_iterable__user_unsub_message_type": ["model.iterable.iterable__user_unsubscriptions", "test.iterable.not_null_stg_iterable__user_unsub_message_type_message_type_id.268a89ea6f"], "model.iterable.stg_iterable__user_unsubscribed_channel": ["model.iterable.iterable__user_unsubscriptions", "test.iterable.not_null_stg_iterable__user_unsubscribed_channel_channel_id.da0ed9e9be"], "model.iterable.stg_iterable__campaign_list_history": ["model.iterable.int_iterable__campaign_lists", "test.iterable.not_null_stg_iterable__campaign_list_history_campaign_id.208f9bf9ed"], "model.iterable.stg_iterable__event_extension": ["model.iterable.iterable__events", "test.iterable.not_null_stg_iterable__event_extension_event_id.144dedcd30"], "model.iterable.stg_iterable__message_type": ["model.iterable.int_iterable__message_type_channel", "test.iterable.not_null_stg_iterable__message_type_message_type_id.75eaa6fa62"], "model.iterable.stg_iterable__list": ["model.iterable.iterable__list_user_history", "test.iterable.not_null_stg_iterable__list_list_id.47029d839a"], "model.iterable.stg_iterable__channel": ["model.iterable.int_iterable__message_type_channel", "test.iterable.not_null_stg_iterable__channel_channel_id.182ceb9636"], "model.iterable.stg_iterable__template_history": ["model.iterable.int_iterable__latest_template", "test.iterable.not_null_stg_iterable__template_history_template_id.14b24a1dfe"], "model.iterable.stg_iterable__event": ["model.iterable.iterable__events", "test.iterable.not_null_stg_iterable__event_event_id.370cd4bc9d", "test.iterable.not_null_stg_iterable__event_unique_event_id.e2b46d3bb6"], "model.iterable.stg_iterable__campaign_label_history": ["model.iterable.int_iterable__campaign_labels", "test.iterable.not_null_stg_iterable__campaign_label_history_campaign_id.1918cef89a"], "model.iterable.stg_iterable__campaign_suppression_list_history_tmp": ["model.iterable.stg_iterable__campaign_suppression_list_history"], "model.iterable.stg_iterable__template_history_tmp": ["model.iterable.stg_iterable__template_history"], "model.iterable.stg_iterable__event_extension_tmp": ["model.iterable.stg_iterable__event_extension"], "model.iterable.stg_iterable__user_unsubscribed_channel_tmp": ["model.iterable.stg_iterable__user_unsubscribed_channel"], "model.iterable.stg_iterable__message_type_tmp": ["model.iterable.stg_iterable__message_type"], "model.iterable.stg_iterable__campaign_list_history_tmp": ["model.iterable.stg_iterable__campaign_list_history"], "model.iterable.stg_iterable__user_history_tmp": ["model.iterable.stg_iterable__user_history"], "model.iterable.stg_iterable__campaign_history_tmp": ["model.iterable.stg_iterable__campaign_history"], "model.iterable.stg_iterable__campaign_label_history_tmp": ["model.iterable.stg_iterable__campaign_label_history"], "model.iterable.stg_iterable__user_unsub_message_type_tmp": ["model.iterable.stg_iterable__user_unsub_message_type"], "model.iterable.stg_iterable__channel_tmp": ["model.iterable.stg_iterable__channel"], "model.iterable.stg_iterable__list_tmp": ["model.iterable.stg_iterable__list"], "model.iterable.stg_iterable__list_user_tmp": ["model.iterable.stg_iterable__list_user"], "model.iterable.stg_iterable__event_tmp": ["model.iterable.stg_iterable__event"], "test.iterable.not_null_iterable__campaigns_campaign_id.03c9448919": [], "test.iterable.not_null_iterable__events_event_id.ed1d28a650": [], "test.iterable.not_null_iterable__user_unsubscriptions_unique_user_key.f8db72932b": [], "test.iterable.not_null_iterable__users_unique_user_key.4ca37a26c8": [], "test.iterable.not_null_stg_iterable__campaign_history_campaign_id.b7c36e4525": [], "test.iterable.not_null_stg_iterable__campaign_label_history_campaign_id.1918cef89a": [], "test.iterable.not_null_stg_iterable__campaign_list_history_campaign_id.208f9bf9ed": [], "test.iterable.not_null_stg_iterable__campaign_suppression_list_history_campaign_id.3921289710": [], "test.iterable.not_null_stg_iterable__channel_channel_id.182ceb9636": [], "test.iterable.not_null_stg_iterable__event_event_id.370cd4bc9d": [], "test.iterable.not_null_stg_iterable__event_unique_event_id.e2b46d3bb6": [], "test.iterable.not_null_stg_iterable__event_extension_event_id.144dedcd30": [], "test.iterable.not_null_stg_iterable__list_list_id.47029d839a": [], "test.iterable.not_null_stg_iterable__message_type_message_type_id.75eaa6fa62": [], "test.iterable.not_null_stg_iterable__template_history_template_id.14b24a1dfe": [], "test.iterable.not_null_stg_iterable__list_user__fivetran_user_id.cca4b34c07": [], "test.iterable.not_null_stg_iterable__user_history_unique_user_key.2845af2127": [], "test.iterable.not_null_stg_iterable__user_unsubscribed_channel_channel_id.da0ed9e9be": [], "test.iterable.not_null_stg_iterable__user_unsub_message_type_message_type_id.268a89ea6f": [], "source.iterable.iterable.campaign_history": ["model.iterable.stg_iterable__campaign_history_tmp"], "source.iterable.iterable.campaign_label_history": ["model.iterable.stg_iterable__campaign_label_history_tmp"], "source.iterable.iterable.campaign_list_history": ["model.iterable.stg_iterable__campaign_list_history_tmp"], "source.iterable.iterable.campaign_suppression_list_history": ["model.iterable.stg_iterable__campaign_suppression_list_history_tmp"], "source.iterable.iterable.channel": ["model.iterable.stg_iterable__channel_tmp"], "source.iterable.iterable.event": ["model.iterable.stg_iterable__event_tmp"], "source.iterable.iterable.event_extension": ["model.iterable.stg_iterable__event_extension_tmp"], "source.iterable.iterable.list": ["model.iterable.stg_iterable__list_tmp"], "source.iterable.iterable.message_type": ["model.iterable.stg_iterable__message_type_tmp"], "source.iterable.iterable.template_history": ["model.iterable.stg_iterable__template_history_tmp"], "source.iterable.iterable.user_history": ["model.iterable.stg_iterable__user_history_tmp"], "source.iterable.iterable.user_unsubscribed_channel": [], "source.iterable.iterable.user_unsubscribed_message_type": [], "source.iterable.iterable.user_unsubscribed_channel_history": ["model.iterable.stg_iterable__user_unsubscribed_channel_tmp"], "source.iterable.iterable.user_unsubscribed_message_type_history": ["model.iterable.stg_iterable__user_unsub_message_type_tmp"], "source.iterable.iterable.list_user": ["model.iterable.stg_iterable__list_user_tmp"]}, "group_map": {}, "saved_queries": {}, "semantic_models": {}, "unit_tests": {}, "functions": {}} \ No newline at end of file +{"metadata": {"dbt_schema_version": "https://schemas.getdbt.com/dbt/manifest/v12.json", "dbt_version": "1.12.4", "generated_at": "2026-09-10T22:23:28.896440Z", "invocation_id": "5d6e507e-b2ab-4c2e-82a3-c9b3883d2ddc", "invocation_started_at": "2026-09-10T22:23:21.776886+00:00", "env": {}, "project_name": "iterable_integration_tests", "project_id": "726648524a3768595307d45548dac26e", "user_id": null, "send_anonymous_usage_stats": false, "adapter_type": "postgres", "quoting": {"database": true, "schema": true, "identifier": true, "column": null}, "run_started_at": "2026-09-10T22:23:21.777067+00:00"}, "nodes": {"seed.iterable_integration_tests.campaign_metrics_data": {"database": "postgres", "schema": "public", "name": "campaign_metrics_data", "resource_type": "seed", "package_name": "iterable_integration_tests", "path": "campaign_metrics_data.csv", "original_file_path": "seeds/campaign_metrics_data.csv", "unique_id": "seed.iterable_integration_tests.campaign_metrics_data", "fqn": ["iterable_integration_tests", "campaign_metrics_data"], "alias": "campaign_metrics_data", "checksum": {"name": "sha256", "checksum": "45e8e7be3941e10f43112fac7bd78f0b6a63c070090062f65b2ffabe481b8c4e"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "seed", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": false, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "delimiter": ",", "quote_columns": false}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": false, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"docs": {"show": false}, "quote_columns": "{{ target.type == 'redshift' or var('fivetran_using_source_casing', false) }}"}, "created_at": 1789079003.3322992, "relation_name": "\"postgres\".\"public\".\"campaign_metrics_data\"", "raw_code": "", "doc_blocks": [], "root_path": "/home/runner/work/dbt_iterable/dbt_iterable/integration_tests", "depends_on": {"macros": []}}, "seed.iterable_integration_tests.campaign_list_history_data": {"database": "postgres", "schema": "public", "name": "campaign_list_history_data", "resource_type": "seed", "package_name": "iterable_integration_tests", "path": "campaign_list_history_data.csv", "original_file_path": "seeds/campaign_list_history_data.csv", "unique_id": "seed.iterable_integration_tests.campaign_list_history_data", "fqn": ["iterable_integration_tests", "campaign_list_history_data"], "alias": "campaign_list_history_data", "checksum": {"name": "sha256", "checksum": "206581e614bf60f37345cbf1bd5e0cacac8a2f329a7dfc521b809c3e6d72e728"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "seed", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {"_fivetran_synced": "timestamp"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": false, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "delimiter": ",", "quote_columns": false}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": false, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"docs": {"show": false}, "quote_columns": "{{ target.type == 'redshift' or var('fivetran_using_source_casing', false) }}", "column_types": {"_fivetran_synced": "timestamp"}}, "created_at": 1789079003.337283, "relation_name": "\"postgres\".\"public\".\"campaign_list_history_data\"", "raw_code": "", "doc_blocks": [], "root_path": "/home/runner/work/dbt_iterable/dbt_iterable/integration_tests", "depends_on": {"macros": []}}, "seed.iterable_integration_tests.user_unsubscribed_message_type_history_data": {"database": "postgres", "schema": "public", "name": "user_unsubscribed_message_type_history_data", "resource_type": "seed", "package_name": "iterable_integration_tests", "path": "user_unsubscribed_message_type_history_data.csv", "original_file_path": "seeds/user_unsubscribed_message_type_history_data.csv", "unique_id": "seed.iterable_integration_tests.user_unsubscribed_message_type_history_data", "fqn": ["iterable_integration_tests", "user_unsubscribed_message_type_history_data"], "alias": "user_unsubscribed_message_type_history_data", "checksum": {"name": "sha256", "checksum": "1e6883673b9a6f44966d10891cece60a739773fadf44302ccf2aad5290222687"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "seed", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {"_fivetran_synced": "timestamp"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": false, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "delimiter": ",", "quote_columns": false}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": false, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"docs": {"show": false}, "quote_columns": "{{ target.type == 'redshift' or var('fivetran_using_source_casing', false) }}", "column_types": {"_fivetran_synced": "timestamp"}}, "created_at": 1789079003.339468, "relation_name": "\"postgres\".\"public\".\"user_unsubscribed_message_type_history_data\"", "raw_code": "", "doc_blocks": [], "root_path": "/home/runner/work/dbt_iterable/dbt_iterable/integration_tests", "depends_on": {"macros": []}}, "seed.iterable_integration_tests.user_unsubscribed_channel_history_data": {"database": "postgres", "schema": "public", "name": "user_unsubscribed_channel_history_data", "resource_type": "seed", "package_name": "iterable_integration_tests", "path": "user_unsubscribed_channel_history_data.csv", "original_file_path": "seeds/user_unsubscribed_channel_history_data.csv", "unique_id": "seed.iterable_integration_tests.user_unsubscribed_channel_history_data", "fqn": ["iterable_integration_tests", "user_unsubscribed_channel_history_data"], "alias": "user_unsubscribed_channel_history_data", "checksum": {"name": "sha256", "checksum": "a1b532e561033f6ff137e5a1bde082263903493b763e9358a2a2ba151360e00e"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "seed", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {"channel_id": "bigint", "_fivetran_synced": "timestamp"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": false, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "delimiter": ",", "quote_columns": false}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": false, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"docs": {"show": false}, "quote_columns": "{{ target.type == 'redshift' or var('fivetran_using_source_casing', false) }}", "column_types": {"channel_id": "{%- if target.type == 'bigquery' -%} INT64 {%- else -%} bigint {%- endif -%}", "_fivetran_synced": "timestamp"}}, "created_at": 1789079003.3418727, "relation_name": "\"postgres\".\"public\".\"user_unsubscribed_channel_history_data\"", "raw_code": "", "doc_blocks": [], "root_path": "/home/runner/work/dbt_iterable/dbt_iterable/integration_tests", "depends_on": {"macros": []}}, "seed.iterable_integration_tests.campaign_suppression_list_history_data": {"database": "postgres", "schema": "public", "name": "campaign_suppression_list_history_data", "resource_type": "seed", "package_name": "iterable_integration_tests", "path": "campaign_suppression_list_history_data.csv", "original_file_path": "seeds/campaign_suppression_list_history_data.csv", "unique_id": "seed.iterable_integration_tests.campaign_suppression_list_history_data", "fqn": ["iterable_integration_tests", "campaign_suppression_list_history_data"], "alias": "campaign_suppression_list_history_data", "checksum": {"name": "sha256", "checksum": "c9eaab0efe0e47ef695b57f71b41f23cf527c87610d7770be604e461fe7c9846"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "seed", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {"_fivetran_synced": "timestamp"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": false, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "delimiter": ",", "quote_columns": false}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": false, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"docs": {"show": false}, "quote_columns": "{{ target.type == 'redshift' or var('fivetran_using_source_casing', false) }}", "column_types": {"_fivetran_synced": "timestamp"}}, "created_at": 1789079003.344041, "relation_name": "\"postgres\".\"public\".\"campaign_suppression_list_history_data\"", "raw_code": "", "doc_blocks": [], "root_path": "/home/runner/work/dbt_iterable/dbt_iterable/integration_tests", "depends_on": {"macros": []}}, "seed.iterable_integration_tests.channel_data": {"database": "postgres", "schema": "public", "name": "channel_data", "resource_type": "seed", "package_name": "iterable_integration_tests", "path": "channel_data.csv", "original_file_path": "seeds/channel_data.csv", "unique_id": "seed.iterable_integration_tests.channel_data", "fqn": ["iterable_integration_tests", "channel_data"], "alias": "channel_data", "checksum": {"name": "sha256", "checksum": "a77e21fb127c0ff7fc652eb5ffc6b3559fde3d63c2c5291a68f10fefcc2fac37"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "seed", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {"id": "bigint", "_fivetran_synced": "timestamp"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": false, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "delimiter": ",", "quote_columns": false}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": false, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"docs": {"show": false}, "quote_columns": "{{ target.type == 'redshift' or var('fivetran_using_source_casing', false) }}", "column_types": {"id": "{%- if target.type == 'bigquery' -%} INT64 {%- else -%} bigint {%- endif -%}", "_fivetran_synced": "timestamp"}}, "created_at": 1789079003.3461516, "relation_name": "\"postgres\".\"public\".\"channel_data\"", "raw_code": "", "doc_blocks": [], "root_path": "/home/runner/work/dbt_iterable/dbt_iterable/integration_tests", "depends_on": {"macros": []}}, "seed.iterable_integration_tests.template_history_data": {"database": "postgres", "schema": "public", "name": "template_history_data", "resource_type": "seed", "package_name": "iterable_integration_tests", "path": "template_history_data.csv", "original_file_path": "seeds/template_history_data.csv", "unique_id": "seed.iterable_integration_tests.template_history_data", "fqn": ["iterable_integration_tests", "template_history_data"], "alias": "template_history_data", "checksum": {"name": "sha256", "checksum": "0f0c442398531afc5fb4c18f12f0d0f694eb3453cb09e0c6c48ba340b110f4a6"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "seed", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {"_fivetran_synced": "timestamp"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": false, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "delimiter": ",", "quote_columns": false}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": false, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"docs": {"show": false}, "quote_columns": "{{ target.type == 'redshift' or var('fivetran_using_source_casing', false) }}", "column_types": {"_fivetran_synced": "timestamp"}}, "created_at": 1789079003.3482864, "relation_name": "\"postgres\".\"public\".\"template_history_data\"", "raw_code": "", "doc_blocks": [], "root_path": "/home/runner/work/dbt_iterable/dbt_iterable/integration_tests", "depends_on": {"macros": []}}, "seed.iterable_integration_tests.message_type_data": {"database": "postgres", "schema": "public", "name": "message_type_data", "resource_type": "seed", "package_name": "iterable_integration_tests", "path": "message_type_data.csv", "original_file_path": "seeds/message_type_data.csv", "unique_id": "seed.iterable_integration_tests.message_type_data", "fqn": ["iterable_integration_tests", "message_type_data"], "alias": "message_type_data", "checksum": {"name": "sha256", "checksum": "84228c8c4a13092ca90bdf9579856968f5265c49f456d01b8510834ae3520bce"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "seed", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {"id": "bigint", "channel_id": "bigint", "_fivetran_synced": "timestamp"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": false, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "delimiter": ",", "quote_columns": false}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": false, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"docs": {"show": false}, "quote_columns": "{{ target.type == 'redshift' or var('fivetran_using_source_casing', false) }}", "column_types": {"id": "{%- if target.type == 'bigquery' -%} INT64 {%- else -%} bigint {%- endif -%}", "channel_id": "{%- if target.type == 'bigquery' -%} INT64 {%- else -%} bigint {%- endif -%}", "_fivetran_synced": "timestamp"}}, "created_at": 1789079003.3504887, "relation_name": "\"postgres\".\"public\".\"message_type_data\"", "raw_code": "", "doc_blocks": [], "root_path": "/home/runner/work/dbt_iterable/dbt_iterable/integration_tests", "depends_on": {"macros": []}}, "seed.iterable_integration_tests.event_data": {"database": "postgres", "schema": "public", "name": "event_data", "resource_type": "seed", "package_name": "iterable_integration_tests", "path": "event_data.csv", "original_file_path": "seeds/event_data.csv", "unique_id": "seed.iterable_integration_tests.event_data", "fqn": ["iterable_integration_tests", "event_data"], "alias": "event_data", "checksum": {"name": "sha256", "checksum": "c886615b369d98135814bac7c4070be9d58b4aa6eb9a90a5caa5ddc4454ab0ed"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "seed", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {"transactional_data": "varchar(100)", "created_at": "timestamp", "_fivetran_synced": "timestamp"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": false, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "delimiter": ",", "quote_columns": false}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": false, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"docs": {"show": false}, "quote_columns": "{{ target.type == 'redshift' or var('fivetran_using_source_casing', false) }}", "column_types": {"transactional_data": "{{ 'varchar(100)' if target.type in ('redshift', 'postgres') else 'string'}}", "created_at": "timestamp", "_fivetran_synced": "timestamp"}}, "created_at": 1789079003.3526897, "relation_name": "\"postgres\".\"public\".\"event_data\"", "raw_code": "", "doc_blocks": [], "root_path": "/home/runner/work/dbt_iterable/dbt_iterable/integration_tests", "depends_on": {"macros": []}}, "seed.iterable_integration_tests.list_user_data": {"database": "postgres", "schema": "public", "name": "list_user_data", "resource_type": "seed", "package_name": "iterable_integration_tests", "path": "list_user_data.csv", "original_file_path": "seeds/list_user_data.csv", "unique_id": "seed.iterable_integration_tests.list_user_data", "fqn": ["iterable_integration_tests", "list_user_data"], "alias": "list_user_data", "checksum": {"name": "sha256", "checksum": "2dbd80b8fb4338602a543026ede3f5a0797c0a4cf13c4724a877bb60ac6a4793"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "seed", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {"list_id": "bigint", "index": "bigint", "_fivetran_synced": "timestamp"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": false, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "delimiter": ",", "quote_columns": false}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": false, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"docs": {"show": false}, "quote_columns": "{{ target.type == 'redshift' or var('fivetran_using_source_casing', false) }}", "column_types": {"list_id": "{%- if target.type == 'bigquery' -%} INT64 {%- else -%} bigint {%- endif -%}", "index": "{%- if target.type == 'bigquery' -%} INT64 {%- else -%} bigint {%- endif -%}", "_fivetran_synced": "timestamp"}}, "created_at": 1789079003.3548837, "relation_name": "\"postgres\".\"public\".\"list_user_data\"", "raw_code": "", "doc_blocks": [], "root_path": "/home/runner/work/dbt_iterable/dbt_iterable/integration_tests", "depends_on": {"macros": []}}, "seed.iterable_integration_tests.user_history_bq_json_data": {"database": "postgres", "schema": "public", "name": "user_history_bq_json_data", "resource_type": "seed", "package_name": "iterable_integration_tests", "path": "user_history_bq_json_data.csv", "original_file_path": "seeds/user_history_bq_json_data.csv", "unique_id": "seed.iterable_integration_tests.user_history_bq_json_data", "fqn": ["iterable_integration_tests", "user_history_bq_json_data"], "alias": "user_history_bq_json_data", "checksum": {"name": "sha256", "checksum": "d2689731ace45d1a5c13930bcc8b80f7b3a02993f8ee4c58bfcf754b734a5caa"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "seed", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": false, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "delimiter": ",", "quote_columns": false}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": false, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"docs": {"show": false}, "quote_columns": "{{ target.type == 'redshift' or var('fivetran_using_source_casing', false) }}"}, "created_at": 1789079003.357003, "relation_name": "\"postgres\".\"public\".\"user_history_bq_json_data\"", "raw_code": "", "doc_blocks": [], "root_path": "/home/runner/work/dbt_iterable/dbt_iterable/integration_tests", "depends_on": {"macros": []}}, "seed.iterable_integration_tests.user_unsubscribed_message_type_data": {"database": "postgres", "schema": "public", "name": "user_unsubscribed_message_type_data", "resource_type": "seed", "package_name": "iterable_integration_tests", "path": "user_unsubscribed_message_type_data.csv", "original_file_path": "seeds/user_unsubscribed_message_type_data.csv", "unique_id": "seed.iterable_integration_tests.user_unsubscribed_message_type_data", "fqn": ["iterable_integration_tests", "user_unsubscribed_message_type_data"], "alias": "user_unsubscribed_message_type_data", "checksum": {"name": "sha256", "checksum": "473f01110084e53b2115bd09606172cb87559359ccd66775f60209851bfdac12"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "seed", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {"_fivetran_synced": "timestamp"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": false, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "delimiter": ",", "quote_columns": false}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": false, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"docs": {"show": false}, "quote_columns": "{{ target.type == 'redshift' or var('fivetran_using_source_casing', false) }}", "column_types": {"_fivetran_synced": "timestamp"}}, "created_at": 1789079003.3590732, "relation_name": "\"postgres\".\"public\".\"user_unsubscribed_message_type_data\"", "raw_code": "", "doc_blocks": [], "root_path": "/home/runner/work/dbt_iterable/dbt_iterable/integration_tests", "depends_on": {"macros": []}}, "seed.iterable_integration_tests.journey_data": {"database": "postgres", "schema": "public", "name": "journey_data", "resource_type": "seed", "package_name": "iterable_integration_tests", "path": "journey_data.csv", "original_file_path": "seeds/journey_data.csv", "unique_id": "seed.iterable_integration_tests.journey_data", "fqn": ["iterable_integration_tests", "journey_data"], "alias": "journey_data", "checksum": {"name": "sha256", "checksum": "b2265e4981c1414ffb3c839029d79f1bd926e13c48ba1337f7198042448fdb71"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "seed", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {"id": "bigint", "lifetime_limit": "bigint", "simultaneous_limit": "bigint", "start_tile_id": "bigint", "created_at": "timestamp", "updated_at": "timestamp", "_fivetran_synced": "timestamp"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": false, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "delimiter": ",", "quote_columns": false}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": false, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"docs": {"show": false}, "quote_columns": "{{ target.type == 'redshift' or var('fivetran_using_source_casing', false) }}", "column_types": {"id": "{%- if target.type == 'bigquery' -%} INT64 {%- else -%} bigint {%- endif -%}", "lifetime_limit": "{%- if target.type == 'bigquery' -%} INT64 {%- else -%} bigint {%- endif -%}", "simultaneous_limit": "{%- if target.type == 'bigquery' -%} INT64 {%- else -%} bigint {%- endif -%}", "start_tile_id": "{%- if target.type == 'bigquery' -%} INT64 {%- else -%} bigint {%- endif -%}", "created_at": "timestamp", "updated_at": "timestamp", "_fivetran_synced": "timestamp"}}, "created_at": 1789079003.36133, "relation_name": "\"postgres\".\"public\".\"journey_data\"", "raw_code": "", "doc_blocks": [], "root_path": "/home/runner/work/dbt_iterable/dbt_iterable/integration_tests", "depends_on": {"macros": []}}, "seed.iterable_integration_tests.campaign_history_data": {"database": "postgres", "schema": "public", "name": "campaign_history_data", "resource_type": "seed", "package_name": "iterable_integration_tests", "path": "campaign_history_data.csv", "original_file_path": "seeds/campaign_history_data.csv", "unique_id": "seed.iterable_integration_tests.campaign_history_data", "fqn": ["iterable_integration_tests", "campaign_history_data"], "alias": "campaign_history_data", "checksum": {"name": "sha256", "checksum": "06adf392dab227dbabbda6782b710213ceea5a30d87990d0cbabe92ba0a955c4"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "seed", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {"_fivetran_synced": "timestamp"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": false, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "delimiter": ",", "quote_columns": false}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": false, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"docs": {"show": false}, "quote_columns": "{{ target.type == 'redshift' or var('fivetran_using_source_casing', false) }}", "column_types": {"_fivetran_synced": "timestamp"}}, "created_at": 1789079003.3635008, "relation_name": "\"postgres\".\"public\".\"campaign_history_data\"", "raw_code": "", "doc_blocks": [], "root_path": "/home/runner/work/dbt_iterable/dbt_iterable/integration_tests", "depends_on": {"macros": []}}, "seed.iterable_integration_tests.list_data": {"database": "postgres", "schema": "public", "name": "list_data", "resource_type": "seed", "package_name": "iterable_integration_tests", "path": "list_data.csv", "original_file_path": "seeds/list_data.csv", "unique_id": "seed.iterable_integration_tests.list_data", "fqn": ["iterable_integration_tests", "list_data"], "alias": "list_data", "checksum": {"name": "sha256", "checksum": "9d817c52008be5fbdb25cde6fa5855f8222f41a436ba7e2e5ed564e319cb64fd"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "seed", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {"_fivetran_synced": "timestamp"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": false, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "delimiter": ",", "quote_columns": false}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": false, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"docs": {"show": false}, "quote_columns": "{{ target.type == 'redshift' or var('fivetran_using_source_casing', false) }}", "column_types": {"_fivetran_synced": "timestamp"}}, "created_at": 1789079003.3656101, "relation_name": "\"postgres\".\"public\".\"list_data\"", "raw_code": "", "doc_blocks": [], "root_path": "/home/runner/work/dbt_iterable/dbt_iterable/integration_tests", "depends_on": {"macros": []}}, "seed.iterable_integration_tests.event_extension_data": {"database": "postgres", "schema": "public", "name": "event_extension_data", "resource_type": "seed", "package_name": "iterable_integration_tests", "path": "event_extension_data.csv", "original_file_path": "seeds/event_extension_data.csv", "unique_id": "seed.iterable_integration_tests.event_extension_data", "fqn": ["iterable_integration_tests", "event_extension_data"], "alias": "event_extension_data", "checksum": {"name": "sha256", "checksum": "e0ed2a4a9661ad12bdd9d9a2221df3fd32f2da5fad39e9d0f6f01cbc819ffa9a"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "seed", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {"payload": "varchar(100)", "_fivetran_synced": "timestamp"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": false, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "delimiter": ",", "quote_columns": false}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": false, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"docs": {"show": false}, "quote_columns": "{{ target.type == 'redshift' or var('fivetran_using_source_casing', false) }}", "column_types": {"payload": "{{ 'varchar(100)' if target.type in ('redshift', 'postgres') else 'string'}}", "_fivetran_synced": "timestamp"}}, "created_at": 1789079003.3677528, "relation_name": "\"postgres\".\"public\".\"event_extension_data\"", "raw_code": "", "doc_blocks": [], "root_path": "/home/runner/work/dbt_iterable/dbt_iterable/integration_tests", "depends_on": {"macros": []}}, "seed.iterable_integration_tests.user_unsubscribed_channel_data": {"database": "postgres", "schema": "public", "name": "user_unsubscribed_channel_data", "resource_type": "seed", "package_name": "iterable_integration_tests", "path": "user_unsubscribed_channel_data.csv", "original_file_path": "seeds/user_unsubscribed_channel_data.csv", "unique_id": "seed.iterable_integration_tests.user_unsubscribed_channel_data", "fqn": ["iterable_integration_tests", "user_unsubscribed_channel_data"], "alias": "user_unsubscribed_channel_data", "checksum": {"name": "sha256", "checksum": "4c6abacf719352d79d0da89751296fc2665d65546ee2c1ad45d142918c750f28"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "seed", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {"_fivetran_synced": "timestamp"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": false, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "delimiter": ",", "quote_columns": false}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": false, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"docs": {"show": false}, "quote_columns": "{{ target.type == 'redshift' or var('fivetran_using_source_casing', false) }}", "column_types": {"_fivetran_synced": "timestamp"}}, "created_at": 1789079003.3699496, "relation_name": "\"postgres\".\"public\".\"user_unsubscribed_channel_data\"", "raw_code": "", "doc_blocks": [], "root_path": "/home/runner/work/dbt_iterable/dbt_iterable/integration_tests", "depends_on": {"macros": []}}, "seed.iterable_integration_tests.campaign_label_history_data": {"database": "postgres", "schema": "public", "name": "campaign_label_history_data", "resource_type": "seed", "package_name": "iterable_integration_tests", "path": "campaign_label_history_data.csv", "original_file_path": "seeds/campaign_label_history_data.csv", "unique_id": "seed.iterable_integration_tests.campaign_label_history_data", "fqn": ["iterable_integration_tests", "campaign_label_history_data"], "alias": "campaign_label_history_data", "checksum": {"name": "sha256", "checksum": "30ed21c883f801eb859d0280b90d45cb3dd020cdb708f4ef4aeca772372bf077"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "seed", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {"_fivetran_synced": "timestamp"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": false, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "delimiter": ",", "quote_columns": false}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": false, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"docs": {"show": false}, "quote_columns": "{{ target.type == 'redshift' or var('fivetran_using_source_casing', false) }}", "column_types": {"_fivetran_synced": "timestamp"}}, "created_at": 1789079003.3720965, "relation_name": "\"postgres\".\"public\".\"campaign_label_history_data\"", "raw_code": "", "doc_blocks": [], "root_path": "/home/runner/work/dbt_iterable/dbt_iterable/integration_tests", "depends_on": {"macros": []}}, "seed.iterable_integration_tests.user_history_data": {"database": "postgres", "schema": "public", "name": "user_history_data", "resource_type": "seed", "package_name": "iterable_integration_tests", "path": "user_history_data.csv", "original_file_path": "seeds/user_history_data.csv", "unique_id": "seed.iterable_integration_tests.user_history_data", "fqn": ["iterable_integration_tests", "user_history_data"], "alias": "user_history_data", "checksum": {"name": "sha256", "checksum": "708bd35a21174cf05f0b4370079a339061c0b9292690ac4facd43b1d2bdff186"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "seed", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {"updated_at": "timestamp", "_fivetran_synced": "timestamp"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": false, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "delimiter": ",", "quote_columns": false}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": false, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"docs": {"show": false}, "quote_columns": "{{ target.type == 'redshift' or var('fivetran_using_source_casing', false) }}", "column_types": {"updated_at": "timestamp", "_fivetran_synced": "timestamp"}}, "created_at": 1789079003.3742623, "relation_name": "\"postgres\".\"public\".\"user_history_data\"", "raw_code": "", "doc_blocks": [], "root_path": "/home/runner/work/dbt_iterable/dbt_iterable/integration_tests", "depends_on": {"macros": []}}, "model.iterable.iterable__users": {"database": "postgres", "schema": "public_iterable_dev", "name": "iterable__users", "resource_type": "model", "package_name": "iterable", "path": "iterable__users.sql", "original_file_path": "models/iterable__users.sql", "unique_id": "model.iterable.iterable__users", "fqn": ["iterable", "iterable__users"], "alias": "iterable__users", "checksum": {"name": "sha256", "checksum": "da23dacdef77d357083015551b25b1e1013e549ccea451e28820df44f3ac4f5a"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "table", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "Table that provides unique user enriched information.", "columns": {"source_relation": {"name": "source_relation", "description": "Identifies the record's source.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": ["doc.iterable.source_relation"]}, "unique_user_key": {"name": "unique_user_key", "description": "The unique identifier of the user. With the new schema (Aug 2023), it is the _fivetran_user_id. This is a hash of user_id and/or email, depending on project type. If using the old schema, it is email.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "_fivetran_user_id": {"name": "_fivetran_user_id", "description": "A Fivetran-created unique identifier for the new Iterable schema in Aug 2023, for users, derived from hashing user_id and/or email, depending on project type.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "email": {"name": "email", "description": "The user's email. User identifier, for email-based projects. Previously was the unique identifier for user records, for the old Iterable schema before the August 2023 updates.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "first_name": {"name": "first_name", "description": "First name of the user", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "last_name": {"name": "last_name", "description": "Last name of the user", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "user_id": {"name": "user_id", "description": "User identifier, for userID-based projects.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "signup_date": {"name": "signup_date", "description": "Timestamp of when the user signed up", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "signup_source": {"name": "signup_source", "description": "Source where the user signed up", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "updated_at": {"name": "updated_at", "description": "Last update timestamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "phone_number": {"name": "phone_number", "description": "Phone number associated with the user", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "email_list_ids": {"name": "email_list_ids", "description": "Array of all email lists associated with the user, derived from the list_user table relationships", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "count_lists": {"name": "count_lists", "description": "Total count of lists associated with the user", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "count_total_campaigns": {"name": "count_total_campaigns", "description": "Count of all campaigns the user has been in", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "first_event_at": {"name": "first_event_at", "description": "The first event the user ever encountered", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "last_event_at": {"name": "last_event_at", "description": "The most recent event the user has encountered", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_emailclick": {"name": "total_emailclick", "description": "Total number of email clicks the user has performed", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_emailunsubscribe": {"name": "total_emailunsubscribe", "description": "Total unsubscription events the user has performed", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_emailcomplaint": {"name": "total_emailcomplaint", "description": "Total email complaints the user has performed", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_customevent": {"name": "total_customevent", "description": "Total custom events associated with the user", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_emailsubscribe": {"name": "total_emailsubscribe", "description": "Total subscription events the user has performed", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_emailopen": {"name": "total_emailopen", "description": "Total email opened events the user has performed", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_pushsend": {"name": "total_pushsend", "description": "The push send events the user has experienced", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_smsbounce": {"name": "total_smsbounce", "description": "Total sms bounces that are associated with the user", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_pushbounce": {"name": "total_pushbounce", "description": "Total number of push bounces associated with the user", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_inappsendskip": {"name": "total_inappsendskip", "description": "Total in app send skips associated with the user", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_smssend": {"name": "total_smssend", "description": "Total sms sends that the user has experienced", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_inappsend": {"name": "total_inappsend", "description": "Total in app sends the user has experienced", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_pushopen": {"name": "total_pushopen", "description": "Total push messages the user has opened", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_emailsend": {"name": "total_emailsend", "description": "Total emails that have been sent to the user", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_pushsendskip": {"name": "total_pushsendskip", "description": "Total push sends the user has skipped", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_inappopen": {"name": "total_inappopen", "description": "Total in app opens the user has performed", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_emailsendskip": {"name": "total_emailsendskip", "description": "Total email sends the user has skipped", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_emailbounce": {"name": "total_emailbounce", "description": "Total number of emails that have bounced from the user", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_inappclick": {"name": "total_inappclick", "description": "Total in app clicks associated with the user", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_pushuninstall": {"name": "total_pushuninstall", "description": "Total push uninstall events the user has performed", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "iterable://models/iterable.yml", "build_path": null, "unrendered_config": {"materialized": "table", "schema": "iterable_{{ var('directed_schema','dev') }}", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789079004.2267928, "relation_name": "\"postgres\".\"public_iterable_dev\".\"iterable__users\"", "raw_code": "{% set passthrough_column_count = var('iterable_user_history_pass_through_columns') | length %}\n\nwith user_event_metrics as (\n\n select *\n from {{ ref('int_iterable__user_event_metrics') }}\n\n), list_users as (\n\n select *\n from {{ ref('stg_iterable__list_user') }}\n order by list_id -- so the list ids will aggregate in the right order\n\n), list_user_aggregated as (\n\n select\n source_relation,\n _fivetran_user_id,\n count(*) as count_lists,\n {{ dbt.concat([\"'['\", fivetran_utils.string_agg(field_to_agg=\"cast(list_id as \" ~ dbt.type_string() ~ \")\", delimiter=\"','\"), \"']'\"]) }} as email_list_ids\n from list_users\n group by 1, 2 \n\n), user_history_unnest as (\n -- this has all the user fields we're looking to pass through\n\n select *\n from {{ ref('int_iterable__list_user_unnest') }}\n\n -- limit to current lists they are a member of. each list-user combo is a unique row, which we will roll up\n where is_current\n\n), user_with_list_metrics as (\n\n select\n source_relation,\n user_id,\n _fivetran_user_id,\n unique_user_key,\n email,\n first_name,\n last_name,\n signup_date,\n signup_source,\n updated_at,\n phone_number,\n email_list_ids\n\n --The below script allows for pass through columns.\n {{ fivetran_utils.persist_pass_through_columns(pass_through_variable='iterable_user_history_pass_through_columns') }}\n\n , count(distinct list_id) as count_lists\n\n from user_history_unnest\n -- roll up to the user\n {{ dbt_utils.group_by(n = 12 + passthrough_column_count) }}\n\n), user_join as (\n\n select\n user_with_list_metrics.source_relation,\n user_with_list_metrics.user_id,\n user_with_list_metrics._fivetran_user_id,\n user_with_list_metrics.unique_user_key,\n user_with_list_metrics.email,\n user_with_list_metrics.first_name,\n user_with_list_metrics.last_name,\n user_with_list_metrics.signup_date,\n user_with_list_metrics.signup_source,\n user_with_list_metrics.updated_at,\n user_with_list_metrics.phone_number,\n coalesce(list_user_aggregated.email_list_ids, user_with_list_metrics.email_list_ids, '[]') as email_list_ids,\n coalesce(list_user_aggregated.count_lists, user_with_list_metrics.count_lists, 0) as count_lists,\n {{ dbt_utils.star(from=ref('int_iterable__user_event_metrics'), except=['source_relation','unique_user_key','_fivetran_user_id','user_id','user_email']) }}\n {{ fivetran_utils.persist_pass_through_columns(pass_through_variable='iterable_user_history_pass_through_columns', identifier='user_with_list_metrics') }}\n\n from user_with_list_metrics\n left join user_event_metrics\n on user_with_list_metrics.unique_user_key = user_event_metrics.unique_user_key\n and user_with_list_metrics.source_relation = user_event_metrics.source_relation\n left join list_user_aggregated\n -- use _fivetran_user_id since in list_user it is a primary key\n on user_with_list_metrics._fivetran_user_id = list_user_aggregated._fivetran_user_id\n and user_with_list_metrics.source_relation = list_user_aggregated.source_relation\n)\n\nselect *\nfrom user_join", "doc_blocks": [], "language": "sql", "refs": [{"name": "int_iterable__user_event_metrics", "package": null, "version": null}, {"name": "stg_iterable__list_user", "package": null, "version": null}, {"name": "int_iterable__list_user_unnest", "package": null, "version": null}, {"name": "int_iterable__user_event_metrics", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.type_string", "macro.fivetran_utils.string_agg", "macro.dbt.concat", "macro.fivetran_utils.persist_pass_through_columns", "macro.dbt_utils.group_by", "macro.dbt_utils.star"], "nodes": ["model.iterable.int_iterable__user_event_metrics", "model.iterable.stg_iterable__list_user", "model.iterable.int_iterable__list_user_unnest"]}, "compiled_path": "target/compiled/iterable/models/iterable__users.sql", "compiled": true, "compiled_code": "\n\nwith user_event_metrics as (\n\n select *\n from \"postgres\".\"public_iterable_dev\".\"int_iterable__user_event_metrics\"\n\n), list_users as (\n\n select *\n from \"postgres\".\"public_iterable_dev\".\"stg_iterable__list_user\"\n order by list_id -- so the list ids will aggregate in the right order\n\n), list_user_aggregated as (\n\n select\n source_relation,\n _fivetran_user_id,\n count(*) as count_lists,\n '[' || \n string_agg(cast(list_id as TEXT), ',')\n\n || ']' as email_list_ids\n from list_users\n group by 1, 2 \n\n), user_history_unnest as (\n -- this has all the user fields we're looking to pass through\n\n select *\n from \"postgres\".\"public_iterable_dev\".\"int_iterable__list_user_unnest\"\n\n -- limit to current lists they are a member of. each list-user combo is a unique row, which we will roll up\n where is_current\n\n), user_with_list_metrics as (\n\n select\n source_relation,\n user_id,\n _fivetran_user_id,\n unique_user_key,\n email,\n first_name,\n last_name,\n signup_date,\n signup_source,\n updated_at,\n phone_number,\n email_list_ids\n\n --The below script allows for pass through columns.\n \n\n\n\n\n\n , count(distinct list_id) as count_lists\n\n from user_history_unnest\n -- roll up to the user\n group by 1,2,3,4,5,6,7,8,9,10,11,12\n\n), user_join as (\n\n select\n user_with_list_metrics.source_relation,\n user_with_list_metrics.user_id,\n user_with_list_metrics._fivetran_user_id,\n user_with_list_metrics.unique_user_key,\n user_with_list_metrics.email,\n user_with_list_metrics.first_name,\n user_with_list_metrics.last_name,\n user_with_list_metrics.signup_date,\n user_with_list_metrics.signup_source,\n user_with_list_metrics.updated_at,\n user_with_list_metrics.phone_number,\n coalesce(list_user_aggregated.email_list_ids, user_with_list_metrics.email_list_ids, '[]') as email_list_ids,\n coalesce(list_user_aggregated.count_lists, user_with_list_metrics.count_lists, 0) as count_lists,\n \"count_total_campaigns\",\n \"first_event_at\",\n \"last_event_at\",\n \"total_emailclick\",\n \"total_emailunsubscribe\",\n \"total_emailcomplaint\",\n \"total_customevent\",\n \"total_emailsubscribe\",\n \"total_emailopen\",\n \"total_pushsend\",\n \"total_smsbounce\",\n \"total_pushbounce\",\n \"total_inappsendskip\",\n \"total_smssend\",\n \"total_inappsend\",\n \"total_pushopen\",\n \"total_emailsend\",\n \"total_pushsendskip\",\n \"total_inappopen\",\n \"total_emailsendskip\",\n \"total_emailbounce\",\n \"total_inappclick\",\n \"total_pushuninstall\"\n \n\n\n\n\n\n from user_with_list_metrics\n left join user_event_metrics\n on user_with_list_metrics.unique_user_key = user_event_metrics.unique_user_key\n and user_with_list_metrics.source_relation = user_event_metrics.source_relation\n left join list_user_aggregated\n -- use _fivetran_user_id since in list_user it is a primary key\n on user_with_list_metrics._fivetran_user_id = list_user_aggregated._fivetran_user_id\n and user_with_list_metrics.source_relation = list_user_aggregated.source_relation\n)\n\nselect *\nfrom user_join", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.iterable__list_user_history": {"database": "postgres", "schema": "public_iterable_dev", "name": "iterable__list_user_history", "resource_type": "model", "package_name": "iterable", "path": "iterable__list_user_history.sql", "original_file_path": "models/iterable__list_user_history.sql", "unique_id": "model.iterable.iterable__list_user_history", "fqn": ["iterable", "iterable__list_user_history"], "alias": "iterable__list_user_history", "checksum": {"name": "sha256", "checksum": "9c0778ad02c86e2145ba4189534ea1eabf07b41bb3aa414934fa554ae4af4e1c"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "table", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "Table that recreates the `list_user_history` source table. Additionally, this table provides an `is_current` field to identify the current lists associated with the user. The table coalesces list_id values from both the direct list_user relationships and the unnested email_list_ids from user history to ensure comprehensive list coverage. The grain of this table is at the user/list/updated_at level.\n", "columns": {"source_relation": {"name": "source_relation", "description": "Identifies the record's source.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": ["doc.iterable.source_relation"]}, "unique_user_key": {"name": "unique_user_key", "description": "The unique identifier of the user. With the new schema (Aug 2023), it is the _fivetran_user_id. This is a hash of user_id and/or email, depending on project type. If using the old schema, it is email.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "_fivetran_user_id": {"name": "_fivetran_user_id", "description": "A Fivetran-created unique identifier for the new Iterable schema in Aug 2023, for users, derived from hashing user_id and/or email, depending on project type.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "user_email": {"name": "user_email", "description": "Email of the user if it exists.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "user_first_name": {"name": "user_first_name", "description": "First name of the user", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "user_last_name": {"name": "user_last_name", "description": "Last name of the user", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "user_id": {"name": "user_id", "description": "User identifier, for userID-based projects.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "user_signup_date": {"name": "user_signup_date", "description": "Timestamp of when the user signed up", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "user_signup_source": {"name": "user_signup_source", "description": "Source where the user signed up", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "user_updated_at": {"name": "user_updated_at", "description": "Last update timestamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "list_id": {"name": "list_id", "description": "The list associated with the user. Uses coalesced values prioritizing `list_id` from `LIST_USER` over the unnested `email_list_ids` from `USER_HISTORY` for comprehensive list coverage.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "is_current": {"name": "is_current", "description": "Boolean indicating if the current list is active", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "list_name": {"name": "list_name", "description": "Name of the list associated with the user", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "list_type": {"name": "list_type", "description": "Type of list associated with the user", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "list_created_at": {"name": "list_created_at", "description": "Date the list was created", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "iterable://models/iterable.yml", "build_path": null, "unrendered_config": {"materialized": "table", "schema": "iterable_{{ var('directed_schema','dev') }}", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789079004.2212896, "relation_name": "\"postgres\".\"public_iterable_dev\".\"iterable__list_user_history\"", "raw_code": "with user_history_unnest as (\n\n select *\n from {{ ref('int_iterable__list_user_unnest') }}\n\n), list_users as (\n\n select *\n from {{ ref('stg_iterable__list_user') }}\n\n), lists as (\n\n select *\n from {{ ref('stg_iterable__list') }}\n\n), final as (\n select distinct\n user_history_unnest.source_relation,\n user_history_unnest.unique_user_key,\n user_history_unnest._fivetran_user_id,\n user_history_unnest.user_id,\n user_history_unnest.email as user_email,\n user_history_unnest.first_name as user_first_name,\n user_history_unnest.last_name as user_last_name,\n user_history_unnest.signup_date as user_signup_date,\n user_history_unnest.signup_source as user_signup_source,\n user_history_unnest.updated_at as user_updated_at,\n coalesce(list_users.list_id, user_history_unnest.list_id) as list_id,\n user_history_unnest.is_current,\n lists.list_name,\n lists.list_type,\n lists.created_at as list_created_at\n\n --The below script allows for pass through columns.\n {{ fivetran_utils.persist_pass_through_columns(pass_through_variable='iterable_user_history_pass_through_columns', identifier='user_history_unnest') }}\n\n from user_history_unnest\n left join list_users\n on list_users.source_relation = user_history_unnest.source_relation\n and list_users._fivetran_user_id = user_history_unnest._fivetran_user_id\n left join lists\n on lists.source_relation = user_history_unnest.source_relation\n and lists.list_id = coalesce(list_users.list_id, user_history_unnest.list_id)\n)\n\nselect *\nfrom final", "doc_blocks": [], "language": "sql", "refs": [{"name": "int_iterable__list_user_unnest", "package": null, "version": null}, {"name": "stg_iterable__list_user", "package": null, "version": null}, {"name": "stg_iterable__list", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.fivetran_utils.persist_pass_through_columns"], "nodes": ["model.iterable.int_iterable__list_user_unnest", "model.iterable.stg_iterable__list_user", "model.iterable.stg_iterable__list"]}, "compiled_path": "target/compiled/iterable/models/iterable__list_user_history.sql", "compiled": true, "compiled_code": "with user_history_unnest as (\n\n select *\n from \"postgres\".\"public_iterable_dev\".\"int_iterable__list_user_unnest\"\n\n), list_users as (\n\n select *\n from \"postgres\".\"public_iterable_dev\".\"stg_iterable__list_user\"\n\n), lists as (\n\n select *\n from \"postgres\".\"public_iterable_dev\".\"stg_iterable__list\"\n\n), final as (\n select distinct\n user_history_unnest.source_relation,\n user_history_unnest.unique_user_key,\n user_history_unnest._fivetran_user_id,\n user_history_unnest.user_id,\n user_history_unnest.email as user_email,\n user_history_unnest.first_name as user_first_name,\n user_history_unnest.last_name as user_last_name,\n user_history_unnest.signup_date as user_signup_date,\n user_history_unnest.signup_source as user_signup_source,\n user_history_unnest.updated_at as user_updated_at,\n coalesce(list_users.list_id, user_history_unnest.list_id) as list_id,\n user_history_unnest.is_current,\n lists.list_name,\n lists.list_type,\n lists.created_at as list_created_at\n\n --The below script allows for pass through columns.\n \n\n\n\n\n\n from user_history_unnest\n left join list_users\n on list_users.source_relation = user_history_unnest.source_relation\n and list_users._fivetran_user_id = user_history_unnest._fivetran_user_id\n left join lists\n on lists.source_relation = user_history_unnest.source_relation\n and lists.list_id = coalesce(list_users.list_id, user_history_unnest.list_id)\n)\n\nselect *\nfrom final", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.iterable__events": {"database": "postgres", "schema": "public_iterable_dev", "name": "iterable__events", "resource_type": "model", "package_name": "iterable", "path": "iterable__events.sql", "original_file_path": "models/iterable__events.sql", "unique_id": "model.iterable.iterable__events", "fqn": ["iterable", "iterable__events"], "alias": "iterable__events", "checksum": {"name": "sha256", "checksum": "d516cb05680b528ba689ac2a2e34bfee8bbd7ede3c7d8ccfea16a28232d39c44"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "incremental", "incremental_strategy": "delete+insert", "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": ["unique_event_id"], "on_schema_change": "fail", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}, "partition_by": {"field": "created_on", "data_type": "date"}, "file_format": "delta"}, "tags": [], "description": "Table that provides a comprehensive view of all events with enriched information such as the campaign, user effected, and template used.", "columns": {"source_relation": {"name": "source_relation", "description": "Identifies the record's source.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": ["doc.iterable.source_relation"]}, "event_id": {"name": "event_id", "description": "Unique id of the event generated by Fivetran", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_event_id": {"name": "unique_event_id", "description": "A unique surrogate key of event_id, _fivetran_user_id, and source_relation.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_user_key": {"name": "unique_user_key", "description": "The unique identifier of the user. With the new schema (Aug 2023), it is the _fivetran_user_id. This is a hash of user_id and/or email, depending on project type. If using the old schema, it is email.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "_fivetran_user_id": {"name": "_fivetran_user_id", "description": "A Fivetran-created unique identifier for the new Iterable schema in Aug 2023, for users, derived from hashing user_id and/or email, depending on project type.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "campaign_id": {"name": "campaign_id", "description": "Reference to the campaign from which the event originated", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "content_id": {"name": "content_id", "description": "Reference to the content the event is associated with", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "created_at": {"name": "created_at", "description": "Creation timestamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "email": {"name": "email", "description": "The user's email. User identifier, for email-based projects. Previously was the unique identifier for user records, for the old Iterable schema before the August 2023 updates.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "additional_properties": {"name": "additional_properties", "description": "json object containing addition event properties", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "event_name": {"name": "event_name", "description": "Name provided to the individual event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "message_bus_id": {"name": "message_bus_id", "description": "Reference to the message bus associated with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "message_id": {"name": "message_id", "description": "Reference to the message the event is associated with", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "message_type_id": {"name": "message_type_id", "description": "Reference to the type of message the event is associated with", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "recipient_state": {"name": "recipient_state", "description": "The state of the recipient upon receiving the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "status": {"name": "status", "description": "Status of the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "transactional_data": {"name": "transactional_data", "description": "Transactional data associated with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unsub_source": {"name": "unsub_source", "description": "Source of the unsubscribe event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "user_agent": {"name": "user_agent", "description": "User agent associated with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "user_agent_device": {"name": "user_agent_device", "description": "The device of the user agent", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "Timestamp of when the event record was synced by Fivetran", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "campaign_name": {"name": "campaign_name", "description": "The name of the campaign", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "campaign_type": {"name": "campaign_type", "description": "The type of campaign", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "is_campaign_recurring": {"name": "is_campaign_recurring", "description": "Boolean indicating if the campaign is recurrent", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "recurring_campaign_name": {"name": "recurring_campaign_name", "description": "The name of the recurring campaign (if applicable)", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "recurring_campaign_id": {"name": "recurring_campaign_id", "description": "The campaign if of the recurring campaign (if applicable)", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "user_id": {"name": "user_id", "description": "User identifier, for userID-based projects.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "user_full_name": {"name": "user_full_name", "description": "Full name of the user", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "message_type_name": {"name": "message_type_name", "description": "Name of the message type", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "message_medium": {"name": "message_medium", "description": "Medium of the message", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "channel_id": {"name": "channel_id", "description": "Unique identifier of the channel", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "channel_name": {"name": "channel_name", "description": "The channel name", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "channel_type": {"name": "channel_type", "description": "The type of channel", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "is_app_already_running": {"name": "is_app_already_running", "description": "Boolean indicating if the app is already running", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "badge": {"name": "badge", "description": "Badge associated with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "canonical_url_id": {"name": "canonical_url_id", "description": "Reference to the url associated with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "is_content_available": {"name": "is_content_available", "description": "Content available from the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "device": {"name": "device", "description": "The device associated with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "email_id": {"name": "email_id", "description": "Reference to the email associated with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "email_subject": {"name": "email_subject", "description": "Subject of the email associated with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "experiment_id": {"name": "experiment_id", "description": "Reference to the experiment used if the event is an experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "from_phone_number_id": {"name": "from_phone_number_id", "description": "Reference to the phone number which the event is from", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "from_smssender_id": {"name": "from_smssender_id", "description": "Reference to the sms sender which the event is from", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "link_id": {"name": "link_id", "description": "Reference to the link associated with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "link_url": {"name": "link_url", "description": "Url of the link associated with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "locale": {"name": "locale", "description": "Locale associated with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "payload": {"name": "payload", "description": "Payload resulted from the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "platform_endpoint": {"name": "platform_endpoint", "description": "The specific platform endpoint of the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "push_message": {"name": "push_message", "description": "Boolean indicating if the event is a push message", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "region": {"name": "region", "description": "Region of the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "sms_message": {"name": "sms_message", "description": "Boolean indicating if the event is an sms message", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "to_phone_number": {"name": "to_phone_number", "description": "To phone number associated with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "url": {"name": "url", "description": "Url associated with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "workflow_id": {"name": "workflow_id", "description": "Reference to the workflow which the event originated", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "workflow_name": {"name": "workflow_name", "description": "Name of the workflow which the event originated", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "catalog_collection_count": {"name": "catalog_collection_count", "description": "The count of products or items collected in a catalog associated with the event.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "catalog_lookup_count": {"name": "catalog_lookup_count", "description": "The count of times a catalog was looked up or queried during the event.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "template_id": {"name": "template_id", "description": "Unique identifier of the template", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "template_name": {"name": "template_name", "description": "User defined name of the template", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "template_creator_user_id": {"name": "template_creator_user_id", "description": "Reference to the user who created the template", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "created_on": {"name": "created_on", "description": "Day when the event was created", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "city": {"name": "city", "description": "The city associated with the event, which could be the location of the recipient.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "clicked_url": {"name": "clicked_url", "description": "The URL that was clicked by the recipient in response to the marketing message.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "country": {"name": "country", "description": "The country associated with the event, which could be the location of the recipient.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "error_code": {"name": "error_code", "description": "The error code or message indicating any issues or errors encountered during the event.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "expires_at": {"name": "expires_at", "description": "The date and time when the event or message is set to expire or become invalid.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "from_phone_number": {"name": "from_phone_number", "description": "The phone number from which the SMS message was sent.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "in_app_body": {"name": "in_app_body", "description": "The content or body of an in-app message that was sent as part of the event.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "is_sms_estimation": {"name": "is_sms_estimation", "description": "A boolean indicating whether the SMS message is an estimation or not.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "labels": {"name": "labels", "description": "Any labels or tags associated with the event, which can be used for categorization or organization.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "message_status": {"name": "message_status", "description": "The status of the marketing message, such as sent, delivered, opened, etc.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "mms_send_count": {"name": "mms_send_count", "description": "The count of multimedia messages (MMS) sent as part of the event.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "reason": {"name": "reason", "description": "The reason or cause associated with a specific event or action.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "sms_send_count": {"name": "sms_send_count", "description": "The count of SMS messages sent as part of the event.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "iterable://models/iterable.yml", "build_path": null, "unrendered_config": {"materialized": "incremental", "schema": "iterable_{{ var('directed_schema','dev') }}", "unique_key": "['unique_event_id']", "incremental_strategy": "CondExpr(test=Compare(expr=Getattr(node=Name(name='target', ctx='load'), attr='type', ctx='load'), ops=[Operand(op='in', expr=Tuple(items=[Const(value='bigquery'), Const(value='spark'), Const(value='databricks')], ctx='load'))]), expr1=Const(value='insert_overwrite'), expr2=Const(value='delete+insert'))", "partition_by": "CondExpr(test=Compare(expr=Getattr(node=Name(name='target', ctx='load'), attr='type', ctx='load'), ops=[Operand(op='notin', expr=Tuple(items=[Const(value='spark'), Const(value='databricks'), Const(value='duckdb')], ctx='load'))]), expr1=Dict(items=[Pair(key=Const(value='field'), value=Const(value='created_on')), Pair(key=Const(value='data_type'), value=Const(value='date'))]), expr2=List(items=[Const(value='created_on')]))", "file_format": "delta", "on_schema_change": "fail", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789079004.2127106, "relation_name": "\"postgres\".\"public_iterable_dev\".\"iterable__events\"", "raw_code": "{{ config(\n materialized='incremental',\n unique_key=['unique_event_id'],\n incremental_strategy='insert_overwrite' if target.type in ('bigquery', 'spark', 'databricks') else 'delete+insert',\n partition_by={\"field\": \"created_on\", \"data_type\": \"date\"} if target.type not in ('spark', 'databricks', 'duckdb') else ['created_on'],\n file_format='delta',\n on_schema_change='fail'\n ) \n}}\n\n{% set using_event_extension = var('iterable__using_event_extension', True) %}\n\nwith events as (\n\n select *\n from {{ ref('stg_iterable__event') }}\n\n {% if is_incremental() %}\n where created_on >= {{ iterable.iterable_lookback(\n from_date=\"max(created_on)\",\n datepart='day', \n interval=var('iterable_lookback_window', 7)) }}\n {% endif %}\n\n), campaign as (\n\n select *\n from {{ ref('int_iterable__recurring_campaigns') }}\n\n\n{% if using_event_extension %}\n), event_extension as (\n\n select *\n from {{ ref('stg_iterable__event_extension') }}\n{% endif %}\n\n), users as (\n\n select *\n from {{ ref('int_iterable__latest_user') }}\n\n), message_type_channel as (\n\n select *\n from {{ ref('int_iterable__message_type_channel') }}\n\n), template as (\n\n select *\n from {{ ref('int_iterable__latest_template') }}\n\n), event_join as (\n\n select \n events.*,\n campaign.campaign_name,\n campaign.campaign_type,\n campaign.is_campaign_recurring,\n campaign.recurring_campaign_name,\n campaign.recurring_campaign_id,\n\n users.user_id,\n users.first_name || ' ' || users.last_name as user_full_name,\n\n message_type_channel.message_type_name,\n message_type_channel.message_medium,\n message_type_channel.channel_id,\n message_type_channel.channel_name,\n message_type_channel.channel_type\n\n {% if using_event_extension %}\n {% set exclude_fields = [\"source_relation\", \"unique_user_key\",\"_fivetran_user_id\",\"event_id\", \"content_id\", \"_fivetran_synced\", \"unique_event_id\"] %}\n , {{ dbt_utils.star(from=ref('stg_iterable__event_extension'), except=exclude_fields, relation_alias=\"event_extension\") }}\n {% endif %}\n\n ,\n campaign.template_id,\n template.template_name,\n template.creator_user_id as template_creator_user_id\n \n from events\n\n {% if using_event_extension %}\n left join event_extension\n on events.unique_event_id = event_extension.unique_event_id\n and events.source_relation = event_extension.source_relation\n {% endif %}\n\n left join campaign\n on events.campaign_id = campaign.campaign_id\n and events.source_relation = campaign.source_relation\n left join users\n on events.unique_user_key = users.unique_user_key -- unique_user_key = _fivetran_user_id if exists, otherwise email\n and events.source_relation = users.source_relation\n left join message_type_channel\n on events.message_type_id = message_type_channel.message_type_id\n and events.source_relation = message_type_channel.source_relation\n left join template\n on campaign.template_id = template.template_id\n and events.source_relation = template.source_relation\n)\n\nselect *\nfrom event_join", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__event", "package": null, "version": null}, {"name": "int_iterable__recurring_campaigns", "package": null, "version": null}, {"name": "stg_iterable__event_extension", "package": null, "version": null}, {"name": "int_iterable__latest_user", "package": null, "version": null}, {"name": "int_iterable__message_type_channel", "package": null, "version": null}, {"name": "int_iterable__latest_template", "package": null, "version": null}, {"name": "stg_iterable__event_extension", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.is_incremental", "macro.dbt_utils.star", "macro.iterable.iterable_lookback"], "nodes": ["model.iterable.stg_iterable__event", "model.iterable.int_iterable__recurring_campaigns", "model.iterable.stg_iterable__event_extension", "model.iterable.int_iterable__latest_user", "model.iterable.int_iterable__message_type_channel", "model.iterable.int_iterable__latest_template"]}, "compiled_path": "target/compiled/iterable/models/iterable__events.sql", "compiled": true, "compiled_code": "\n\n\n\nwith events as (\n\n select *\n from \"postgres\".\"public_iterable_dev\".\"stg_iterable__event\"\n\n \n where created_on >= \n\n\n\n \n\n \n\n cast('2020-07-12' as date) + ((interval '1 day') * (-7))\n\n\n\n\n \n\n), campaign as (\n\n select *\n from \"postgres\".\"public_iterable_dev\".\"int_iterable__recurring_campaigns\"\n\n\n\n), event_extension as (\n\n select *\n from \"postgres\".\"public_iterable_dev\".\"stg_iterable__event_extension\"\n\n\n), users as (\n\n select *\n from \"postgres\".\"public_iterable_dev\".\"int_iterable__latest_user\"\n\n), message_type_channel as (\n\n select *\n from \"postgres\".\"public_iterable_dev\".\"int_iterable__message_type_channel\"\n\n), template as (\n\n select *\n from \"postgres\".\"public_iterable_dev\".\"int_iterable__latest_template\"\n\n), event_join as (\n\n select \n events.*,\n campaign.campaign_name,\n campaign.campaign_type,\n campaign.is_campaign_recurring,\n campaign.recurring_campaign_name,\n campaign.recurring_campaign_id,\n\n users.user_id,\n users.first_name || ' ' || users.last_name as user_full_name,\n\n message_type_channel.message_type_name,\n message_type_channel.message_medium,\n message_type_channel.channel_id,\n message_type_channel.channel_name,\n message_type_channel.channel_type\n\n \n \n , event_extension.\"is_app_already_running\",\n event_extension.\"badge\",\n event_extension.\"catalog_collection_count\",\n event_extension.\"catalog_lookup_count\",\n event_extension.\"canonical_url_id\",\n event_extension.\"is_content_available\",\n event_extension.\"device\",\n event_extension.\"email_id\",\n event_extension.\"email_subject\",\n event_extension.\"experiment_id\",\n event_extension.\"from_phone_number_id\",\n event_extension.\"from_smssender_id\",\n event_extension.\"link_id\",\n event_extension.\"link_url\",\n event_extension.\"locale\",\n event_extension.\"payload\",\n event_extension.\"platform_endpoint\",\n event_extension.\"push_message\",\n event_extension.\"region\",\n event_extension.\"sms_message\",\n event_extension.\"to_phone_number\",\n event_extension.\"url\",\n event_extension.\"workflow_id\",\n event_extension.\"workflow_name\",\n event_extension.\"city\",\n event_extension.\"clicked_url\",\n event_extension.\"country\",\n event_extension.\"error_code\",\n event_extension.\"expires_at\",\n event_extension.\"from_phone_number\",\n event_extension.\"in_app_body\",\n event_extension.\"is_sms_estimation\",\n event_extension.\"labels\",\n event_extension.\"message_status\",\n event_extension.\"mms_send_count\",\n event_extension.\"reason\",\n event_extension.\"sms_send_count\"\n \n\n ,\n campaign.template_id,\n template.template_name,\n template.creator_user_id as template_creator_user_id\n \n from events\n\n \n left join event_extension\n on events.unique_event_id = event_extension.unique_event_id\n and events.source_relation = event_extension.source_relation\n \n\n left join campaign\n on events.campaign_id = campaign.campaign_id\n and events.source_relation = campaign.source_relation\n left join users\n on events.unique_user_key = users.unique_user_key -- unique_user_key = _fivetran_user_id if exists, otherwise email\n and events.source_relation = users.source_relation\n left join message_type_channel\n on events.message_type_id = message_type_channel.message_type_id\n and events.source_relation = message_type_channel.source_relation\n left join template\n on campaign.template_id = template.template_id\n and events.source_relation = template.source_relation\n)\n\nselect *\nfrom event_join", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.iterable__user_campaign": {"database": "postgres", "schema": "public_iterable_dev", "name": "iterable__user_campaign", "resource_type": "model", "package_name": "iterable", "path": "iterable__user_campaign.sql", "original_file_path": "models/iterable__user_campaign.sql", "unique_id": "model.iterable.iterable__user_campaign", "fqn": ["iterable", "iterable__user_campaign"], "alias": "iterable__user_campaign", "checksum": {"name": "sha256", "checksum": "343ed0b8ab547da53812f4a8426cfd7b93f81ce3886680c4182a2596f1ea8632"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "table", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "Table that provides total and unique metrics for a user associated with particular campaigns and if available, experiments.", "columns": {"source_relation": {"name": "source_relation", "description": "Identifies the record's source.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": ["doc.iterable.source_relation"]}, "unique_user_campaign_id": {"name": "unique_user_campaign_id", "description": "Unique ID combining source_relation, unique_user_key, campaign_id, and if available, experiment_id.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "_fivetran_user_id": {"name": "_fivetran_user_id", "description": "A Fivetran-created unique identifier for the new Iterable schema in Aug 2023, for users, derived from hashing user_id and/or email, depending on project type.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_user_key": {"name": "unique_user_key", "description": "The unique identifier of the user. With the new schema (Aug 2023), it is the _fivetran_user_id. This is a hash of user_id and/or email, depending on project type. If using the old schema, it is email.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "user_id": {"name": "user_id", "description": "User identifier, for userID-based projects.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "user_email": {"name": "user_email", "description": "Email of the user if it exists.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "user_full_name": {"name": "user_full_name", "description": "The users first and last name", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "campaign_id": {"name": "campaign_id", "description": "The unique identifier of the campaign which the user metrics are associated", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "campaign_name": {"name": "campaign_name", "description": "The name of the campaign which the user metrics are associated", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "template_id": {"name": "template_id", "description": "The unique identifier of the template used within the campaign", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "template_name": {"name": "template_name", "description": "The name of the template used for the campaign", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "experiment_id": {"name": "experiment_id", "description": "The unique experiment variation of the campaign", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "recurring_campaign_id": {"name": "recurring_campaign_id", "description": "The unique identifier of the recurring campaign which the campaign is tied to", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "recurring_campaign_name": {"name": "recurring_campaign_name", "description": "The name of the recurring campaign which the campaign is tied to", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "first_event_at": {"name": "first_event_at", "description": "Timestamp of the first campaign/experiment event associated with the user", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "last_event_at": {"name": "last_event_at", "description": "Timestamp of the most recent campaign/experiment event associated with the user", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_emailclick": {"name": "total_emailclick", "description": "Total email clicks events the user took within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_emailunsubscribe": {"name": "total_emailunsubscribe", "description": "Total email unsubscription events the user performed within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_emailcomplaint": {"name": "total_emailcomplaint", "description": "Total email complaint events the user performed within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_customevent": {"name": "total_customevent", "description": "Total custom events associated with the user within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_emailsubscribe": {"name": "total_emailsubscribe", "description": "Total email subscription events associate with the user within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_emailopen": {"name": "total_emailopen", "description": "Total email open events the user performed within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_pushsend": {"name": "total_pushsend", "description": "Total push send events the user performed within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_smsbounce": {"name": "total_smsbounce", "description": "Total sms bounce events associated with the user within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_pushbounce": {"name": "total_pushbounce", "description": "Total push bounce events associated with the user within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_inappsendskip": {"name": "total_inappsendskip", "description": "Total in app send skip events the user performed within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_smssend": {"name": "total_smssend", "description": "Total sms send events associated with the user within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_inappsend": {"name": "total_inappsend", "description": "Total in app send events associated with the user within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_pushopen": {"name": "total_pushopen", "description": "Total push open events the user performed within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_emailsend": {"name": "total_emailsend", "description": "Total email send event associated with the user within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_pushsendskip": {"name": "total_pushsendskip", "description": "Total push send skip events associated with the user within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_inappopen": {"name": "total_inappopen", "description": "Total in app open events associated with the user within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_emailsendskip": {"name": "total_emailsendskip", "description": "Total email send skip events associated with the user within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_emailbounce": {"name": "total_emailbounce", "description": "Total email bounce events associated with the user within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_inappclick": {"name": "total_inappclick", "description": "Total in app click events associated with the user within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_pushuninstall": {"name": "total_pushuninstall", "description": "Total push uninstall events associated with the user within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "first_open_or_click_event_at": {"name": "first_open_or_click_event_at", "description": "The time of the first open or click time. This is the first time a user interacts with a campaign, recording the earliest occurring event out of 'emailOpen', 'emailClick', and 'pushOpen'.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "iterable://models/iterable.yml", "build_path": null, "unrendered_config": {"materialized": "table", "schema": "iterable_{{ var('directed_schema','dev') }}", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789079004.2231557, "relation_name": "\"postgres\".\"public_iterable_dev\".\"iterable__user_campaign\"", "raw_code": "{% set using_event_extension = var('iterable__using_event_extension', True) %}\n\nwith events as (\n\n select *\n from {{ ref('iterable__events') }}\n\n), pivot_out_events as (\n\n-- this will be at the user-campaign-experiment variation level\n-- if experiment_id is null, the user-campaign interactions happened outside of an experiment\n-- if campaign_id is null, the user interactions are organic\n select\n source_relation,\n _fivetran_user_id,\n unique_user_key,\n user_id,\n campaign_id,\n\n {{ \"experiment_id,\" if using_event_extension }}\n\n email as user_email,\n user_full_name,\n case when campaign_id is null then 'organic' else campaign_name end as campaign_name,\n template_id,\n template_name,\n\n recurring_campaign_id,\n recurring_campaign_name,\n\n min(created_at) as first_event_at,\n max(created_at) as last_event_at,\n min(case when event_name in ('emailOpen', 'emailClick', 'pushOpen') then created_at end) as first_open_or_click_event_at\n\n\n -- count up the number of instances of each metric\n -- `iterable__event_metrics` is set by default to all events brought in by fivetran+iterable\n -- https://fivetran.com/docs/applications/iterable#schemanotes\n {% for em in var('iterable__event_metrics') %}\n , sum(case when lower(event_name) = '{{ em | lower }}' then 1 else 0 end)\n as {{ 'total_' ~ em | replace(' ', '_') | replace('(', '') | replace(')', '') | lower }}\n {% endfor %}\n\n from events\n\n {{ dbt_utils.group_by(n=13 if using_event_extension else 12 ) }}\n\n), add_surrogate_key as (\n\n {% set surrogate_key_fields = ['source_relation', 'unique_user_key', 'campaign_id'] %}\n {% do surrogate_key_fields.append('experiment_id') if var('iterable__using_event_extension', True) %}\n\n select \n *,\n {{ dbt_utils.generate_surrogate_key(surrogate_key_fields) }} as unique_user_campaign_id\n\n from pivot_out_events\n)\n\nselect *\nfrom add_surrogate_key", "doc_blocks": [], "language": "sql", "refs": [{"name": "iterable__events", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt_utils.group_by", "macro.dbt_utils.generate_surrogate_key"], "nodes": ["model.iterable.iterable__events"]}, "compiled_path": "target/compiled/iterable/models/iterable__user_campaign.sql", "compiled": true, "compiled_code": "\n\nwith events as (\n\n select *\n from \"postgres\".\"public_iterable_dev\".\"iterable__events\"\n\n), pivot_out_events as (\n\n-- this will be at the user-campaign-experiment variation level\n-- if experiment_id is null, the user-campaign interactions happened outside of an experiment\n-- if campaign_id is null, the user interactions are organic\n select\n source_relation,\n _fivetran_user_id,\n unique_user_key,\n user_id,\n campaign_id,\n\n experiment_id,\n\n email as user_email,\n user_full_name,\n case when campaign_id is null then 'organic' else campaign_name end as campaign_name,\n template_id,\n template_name,\n\n recurring_campaign_id,\n recurring_campaign_name,\n\n min(created_at) as first_event_at,\n max(created_at) as last_event_at,\n min(case when event_name in ('emailOpen', 'emailClick', 'pushOpen') then created_at end) as first_open_or_click_event_at\n\n\n -- count up the number of instances of each metric\n -- `iterable__event_metrics` is set by default to all events brought in by fivetran+iterable\n -- https://fivetran.com/docs/applications/iterable#schemanotes\n \n , sum(case when lower(event_name) = 'emailclick' then 1 else 0 end)\n as total_emailclick\n \n , sum(case when lower(event_name) = 'emailunsubscribe' then 1 else 0 end)\n as total_emailunsubscribe\n \n , sum(case when lower(event_name) = 'emailcomplaint' then 1 else 0 end)\n as total_emailcomplaint\n \n , sum(case when lower(event_name) = 'customevent' then 1 else 0 end)\n as total_customevent\n \n , sum(case when lower(event_name) = 'emailsubscribe' then 1 else 0 end)\n as total_emailsubscribe\n \n , sum(case when lower(event_name) = 'emailopen' then 1 else 0 end)\n as total_emailopen\n \n , sum(case when lower(event_name) = 'pushsend' then 1 else 0 end)\n as total_pushsend\n \n , sum(case when lower(event_name) = 'smsbounce' then 1 else 0 end)\n as total_smsbounce\n \n , sum(case when lower(event_name) = 'pushbounce' then 1 else 0 end)\n as total_pushbounce\n \n , sum(case when lower(event_name) = 'inappsendskip' then 1 else 0 end)\n as total_inappsendskip\n \n , sum(case when lower(event_name) = 'smssend' then 1 else 0 end)\n as total_smssend\n \n , sum(case when lower(event_name) = 'inappsend' then 1 else 0 end)\n as total_inappsend\n \n , sum(case when lower(event_name) = 'pushopen' then 1 else 0 end)\n as total_pushopen\n \n , sum(case when lower(event_name) = 'emailsend' then 1 else 0 end)\n as total_emailsend\n \n , sum(case when lower(event_name) = 'pushsendskip' then 1 else 0 end)\n as total_pushsendskip\n \n , sum(case when lower(event_name) = 'inappopen' then 1 else 0 end)\n as total_inappopen\n \n , sum(case when lower(event_name) = 'emailsendskip' then 1 else 0 end)\n as total_emailsendskip\n \n , sum(case when lower(event_name) = 'emailbounce' then 1 else 0 end)\n as total_emailbounce\n \n , sum(case when lower(event_name) = 'inappclick' then 1 else 0 end)\n as total_inappclick\n \n , sum(case when lower(event_name) = 'pushuninstall' then 1 else 0 end)\n as total_pushuninstall\n \n\n from events\n\n group by 1,2,3,4,5,6,7,8,9,10,11,12,13\n\n), add_surrogate_key as (\n\n \n \n\n select \n *,\n md5(cast(coalesce(cast(source_relation as TEXT), '_dbt_utils_surrogate_key_null_') || '-' || coalesce(cast(unique_user_key as TEXT), '_dbt_utils_surrogate_key_null_') || '-' || coalesce(cast(campaign_id as TEXT), '_dbt_utils_surrogate_key_null_') || '-' || coalesce(cast(experiment_id as TEXT), '_dbt_utils_surrogate_key_null_') as TEXT)) as unique_user_campaign_id\n\n from pivot_out_events\n)\n\nselect *\nfrom add_surrogate_key", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.iterable__user_unsubscriptions": {"database": "postgres", "schema": "public_iterable_dev", "name": "iterable__user_unsubscriptions", "resource_type": "model", "package_name": "iterable", "path": "iterable__user_unsubscriptions.sql", "original_file_path": "models/iterable__user_unsubscriptions.sql", "unique_id": "model.iterable.iterable__user_unsubscriptions", "fqn": ["iterable", "iterable__user_unsubscriptions"], "alias": "iterable__user_unsubscriptions", "checksum": {"name": "sha256", "checksum": "9ffdcfb7996a2147cd7739fc5ac7a1bd2e0db91e0ffc76d1458f53046fc4598f"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "table", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "Table that generates the total channel and message types a user has chosen to unsubscribe.", "columns": {"source_relation": {"name": "source_relation", "description": "Identifies the record's source.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": ["doc.iterable.source_relation"]}, "_fivetran_user_id": {"name": "_fivetran_user_id", "description": "A Fivetran-created unique identifier for the new Iterable schema in Aug 2023, for users, derived from hashing user_id and/or email, depending on project type.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_user_key": {"name": "unique_user_key", "description": "The unique identifier of the user. With the new schema (Aug 2023), it is the _fivetran_user_id. This is a hash of user_id and/or email, depending on project type. If using the old schema, it is email.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "channel_id": {"name": "channel_id", "description": "Unique identifier of the channel which the user is unsubscribed", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "message_type_id": {"name": "message_type_id", "description": "Unique identifier of the message type which the user is unsubscribed", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "channel_name": {"name": "channel_name", "description": "The name of the channel which the user is unsubscribed", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "message_type_name": {"name": "message_type_name", "description": "The name of the message type which the user is unsubscribed", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "channel_type": {"name": "channel_type", "description": "The channel type which the user is unsubscribed", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "message_medium": {"name": "message_medium", "description": "The medium type the message was provided which the user is unsubscribed", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "updated_at": {"name": "updated_at", "description": "Timestamp of when the user unsubscribed from the channel or message type", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "is_unsubscribed_channel_wide": {"name": "is_unsubscribed_channel_wide", "description": "Boolean indicating if the user unsubscribed at the channel level (i.e. unsubscribed to all message types) or if they unsubscribed from only an individual message type.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "iterable://models/iterable.yml", "build_path": null, "unrendered_config": {"materialized": "table", "schema": "iterable_{{ var('directed_schema','dev') }}", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789079004.2240705, "relation_name": "\"postgres\".\"public_iterable_dev\".\"iterable__user_unsubscriptions\"", "raw_code": "{% set using_user_unsubscribed_message_type = var('iterable__using_user_unsubscribed_message_type', True) %}\n\nwith message_type_channel as (\n\n select *\n from {{ ref('int_iterable__message_type_channel') }}\n\n), user_unsubscribed_channel as (\n\n select\n *\n from {{ ref('stg_iterable__user_unsubscribed_channel') }}\n where latest_batch_index = 1\n\n{% if using_user_unsubscribed_message_type %}\n), user_unsubscribed_message_type as (\n\n select\n *\n from {{ ref('stg_iterable__user_unsub_message_type') }}\n where latest_batch_index = 1\n\n{% endif %}\n\n), combine as (\n\n select\n source_relation,\n _fivetran_user_id,\n unique_user_key,\n channel_id,\n cast(null as {{ dbt.type_string() }}) as message_type_id,\n updated_at\n from user_unsubscribed_channel\n\n{% if using_user_unsubscribed_message_type %}\n\n union all\n\n select\n source_relation,\n _fivetran_user_id,\n unique_user_key,\n cast(null as {{ dbt.type_string() }}) as channel_id,\n message_type_id,\n updated_at\n from user_unsubscribed_message_type\n{% endif %}\n\n), final as (\n\n select\n combine.source_relation,\n combine._fivetran_user_id,\n combine.unique_user_key,\n -- coalescing since message_type -> channel goes up a grain\n coalesce(combine.channel_id, message_type_channel.channel_id) as channel_id,\n coalesce(combine.message_type_id, message_type_channel.message_type_id) as message_type_id,\n combine.updated_at,\n message_type_channel.channel_name,\n message_type_channel.message_type_name,\n message_type_channel.channel_type,\n message_type_channel.message_medium,\n case when combine.channel_id is not null then true else false end as is_unsubscribed_channel_wide\n\n from combine\n\n -- unsubscribing from an entire channel unsubscribes a user from all message types in that channel\n join message_type_channel\n on combine.source_relation = message_type_channel.source_relation\n and (combine.channel_id = message_type_channel.channel_id\n or combine.message_type_id = message_type_channel.message_type_id)\n)\n\nselect *\nfrom final", "doc_blocks": [], "language": "sql", "refs": [{"name": "int_iterable__message_type_channel", "package": null, "version": null}, {"name": "stg_iterable__user_unsubscribed_channel", "package": null, "version": null}, {"name": "stg_iterable__user_unsub_message_type", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.type_string"], "nodes": ["model.iterable.int_iterable__message_type_channel", "model.iterable.stg_iterable__user_unsubscribed_channel", "model.iterable.stg_iterable__user_unsub_message_type"]}, "compiled_path": "target/compiled/iterable/models/iterable__user_unsubscriptions.sql", "compiled": true, "compiled_code": "\n\nwith message_type_channel as (\n\n select *\n from \"postgres\".\"public_iterable_dev\".\"int_iterable__message_type_channel\"\n\n), user_unsubscribed_channel as (\n\n select\n *\n from \"postgres\".\"public_iterable_dev\".\"stg_iterable__user_unsubscribed_channel\"\n where latest_batch_index = 1\n\n\n), user_unsubscribed_message_type as (\n\n select\n *\n from \"postgres\".\"public_iterable_dev\".\"stg_iterable__user_unsub_message_type\"\n where latest_batch_index = 1\n\n\n\n), combine as (\n\n select\n source_relation,\n _fivetran_user_id,\n unique_user_key,\n channel_id,\n cast(null as TEXT) as message_type_id,\n updated_at\n from user_unsubscribed_channel\n\n\n\n union all\n\n select\n source_relation,\n _fivetran_user_id,\n unique_user_key,\n cast(null as TEXT) as channel_id,\n message_type_id,\n updated_at\n from user_unsubscribed_message_type\n\n\n), final as (\n\n select\n combine.source_relation,\n combine._fivetran_user_id,\n combine.unique_user_key,\n -- coalescing since message_type -> channel goes up a grain\n coalesce(combine.channel_id, message_type_channel.channel_id) as channel_id,\n coalesce(combine.message_type_id, message_type_channel.message_type_id) as message_type_id,\n combine.updated_at,\n message_type_channel.channel_name,\n message_type_channel.message_type_name,\n message_type_channel.channel_type,\n message_type_channel.message_medium,\n case when combine.channel_id is not null then true else false end as is_unsubscribed_channel_wide\n\n from combine\n\n -- unsubscribing from an entire channel unsubscribes a user from all message types in that channel\n join message_type_channel\n on combine.source_relation = message_type_channel.source_relation\n and (combine.channel_id = message_type_channel.channel_id\n or combine.message_type_id = message_type_channel.message_type_id)\n)\n\nselect *\nfrom final", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.iterable__journeys": {"database": "postgres", "schema": "public_iterable_dev", "name": "iterable__journeys", "resource_type": "model", "package_name": "iterable", "path": "iterable__journeys.sql", "original_file_path": "models/iterable__journeys.sql", "unique_id": "model.iterable.iterable__journeys", "fqn": ["iterable", "iterable__journeys"], "alias": "iterable__journeys", "checksum": {"name": "sha256", "checksum": "40ff36423bf5dfa1aa7c15f92e5c0103b2c8010bcb03fe666a72a9d002ac9dbc"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "table", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "Table that provides aggregations for journeys, formerly known as workflows. Metrics are rolled up from the user/campaign grain via each campaign's journey reference. Journeys which generate no events, such as those that only split audiences or update user fields, are still included with null metrics. The grain of this table is one record per journey.\n", "columns": {"source_relation": {"name": "source_relation", "description": "Identifies the record's source.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": ["doc.iterable.source_relation"]}, "journey_id": {"name": "journey_id", "description": "Unique identifier of the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_journey_id": {"name": "unique_journey_id", "description": "Unique identifier combining journey_id and source_relation.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "journey_name": {"name": "journey_name", "description": "User defined name of the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "journey_type": {"name": "journey_type", "description": "The journey type", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "journey_description": {"name": "journey_description", "description": "Information about the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "creator_user_id": {"name": "creator_user_id", "description": "Reference to the user who created the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "is_enabled": {"name": "is_enabled", "description": "Boolean indicating if the journey is currently enabled", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "is_archived": {"name": "is_archived", "description": "Boolean indicating if the journey has been archived", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "lifetime_limit": {"name": "lifetime_limit", "description": "Maximum number of times a user may enter the journey over their lifetime", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "simultaneous_limit": {"name": "simultaneous_limit", "description": "Maximum number of times a user may be in the journey at the same time", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "start_tile_id": {"name": "start_tile_id", "description": "Reference to the tile which begins the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "trigger_event_names": {"name": "trigger_event_names", "description": "The event names which trigger a user's entry into the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "created_at": {"name": "created_at", "description": "Creation timestamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "updated_at": {"name": "updated_at", "description": "Last update timestamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "The time when a record was last updated by Fivetran.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": ["doc.iterable._fivetran_synced"]}, "count_total_campaigns": {"name": "count_total_campaigns", "description": "Count of distinct campaigns within the journey that generated events", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "count_unique_users": {"name": "count_unique_users", "description": "Count of total unique users within the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "first_event_at": {"name": "first_event_at", "description": "Timestamp of the first event generated by any campaign in the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "last_event_at": {"name": "last_event_at", "description": "Timestamp of the most recent event generated by any campaign in the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_emailclick": {"name": "total_emailclick", "description": "Total email clicks within the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_total_emailclick": {"name": "unique_total_emailclick", "description": "Unique email clicks within the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_emailunsubscribe": {"name": "total_emailunsubscribe", "description": "Total email unsubscribe events within the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_total_emailunsubscribe": {"name": "unique_total_emailunsubscribe", "description": "Unique total email unsubscribe events within the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_emailcomplaint": {"name": "total_emailcomplaint", "description": "Total email complaints within the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_total_emailcomplaint": {"name": "unique_total_emailcomplaint", "description": "Unique total email complaints within the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_customevent": {"name": "total_customevent", "description": "Total custom events within the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_total_customevent": {"name": "unique_total_customevent", "description": "Unique total custom events within the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_emailsubscribe": {"name": "total_emailsubscribe", "description": "Total email subscribe events within the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_total_emailsubscribe": {"name": "unique_total_emailsubscribe", "description": "Unique total email subscribe events within the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_emailopen": {"name": "total_emailopen", "description": "Total email open events within the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_total_emailopen": {"name": "unique_total_emailopen", "description": "Unique total email open events within the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_pushsend": {"name": "total_pushsend", "description": "Total push send events within the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_total_pushsend": {"name": "unique_total_pushsend", "description": "Unique total push send events within the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_smsbounce": {"name": "total_smsbounce", "description": "Total sms bounce events within the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_total_smsbounce": {"name": "unique_total_smsbounce", "description": "Unique total sms bounce events within the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_pushbounce": {"name": "total_pushbounce", "description": "Total push bounce events within the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_total_pushbounce": {"name": "unique_total_pushbounce", "description": "Unique total push bounce events within the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_inappsendskip": {"name": "total_inappsendskip", "description": "Total in app send skip events within the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_total_inappsendskip": {"name": "unique_total_inappsendskip", "description": "Unique total in app send skip events within the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_smssend": {"name": "total_smssend", "description": "Total sms send events within the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_total_smssend": {"name": "unique_total_smssend", "description": "Unique total sms send events within the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_inappsend": {"name": "total_inappsend", "description": "Total in app send events within the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_total_inappsend": {"name": "unique_total_inappsend", "description": "Unique total in app send events within the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_pushopen": {"name": "total_pushopen", "description": "Total push open events within the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_total_pushopen": {"name": "unique_total_pushopen", "description": "Unique total push open events within the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_emailsend": {"name": "total_emailsend", "description": "Total email send events within the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_total_emailsend": {"name": "unique_total_emailsend", "description": "Unique total email send events within the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_pushsendskip": {"name": "total_pushsendskip", "description": "Total push send skip events within the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_total_pushsendskip": {"name": "unique_total_pushsendskip", "description": "Unique total push send skip events within the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_inappopen": {"name": "total_inappopen", "description": "Total in app open events within the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_total_inappopen": {"name": "unique_total_inappopen", "description": "Unique total in app open events within the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_emailsendskip": {"name": "total_emailsendskip", "description": "Total email send skip events within the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_total_emailsendskip": {"name": "unique_total_emailsendskip", "description": "Unique total email send skip events within the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_emailbounce": {"name": "total_emailbounce", "description": "Total email bounce events within the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_total_emailbounce": {"name": "unique_total_emailbounce", "description": "Unique total email bounce events within the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_inappclick": {"name": "total_inappclick", "description": "Total in app click events within the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_total_inappclick": {"name": "unique_total_inappclick", "description": "Unique total in app click events within the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_pushuninstall": {"name": "total_pushuninstall", "description": "Total push uninstall events within the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_total_pushuninstall": {"name": "unique_total_pushuninstall", "description": "Unique total push uninstall events within the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "email_open_rate": {"name": "email_open_rate", "description": "Share of emails sent within the journey that were opened. Only present when both emailSend and emailOpen are included in the `iterable__event_metrics` variable.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "email_click_rate": {"name": "email_click_rate", "description": "Share of emails sent within the journey that were clicked. Only present when both emailSend and emailClick are included in the `iterable__event_metrics` variable.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "email_bounce_rate": {"name": "email_bounce_rate", "description": "Share of emails sent within the journey that bounced. Only present when both emailSend and emailBounce are included in the `iterable__event_metrics` variable.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "email_unsubscribe_rate": {"name": "email_unsubscribe_rate", "description": "Share of emails sent within the journey that resulted in an unsubscribe. Only present when both emailSend and emailUnSubscribe are included in the `iterable__event_metrics` variable.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "iterable://models/iterable.yml", "build_path": null, "unrendered_config": {"materialized": "table", "schema": "iterable_{{ var('directed_schema','dev') }}", "enabled": "var('iterable__using_journey', True)", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789079004.2184186, "relation_name": "\"postgres\".\"public_iterable_dev\".\"iterable__journeys\"", "raw_code": "{{ config(enabled=var('iterable__using_journey', True)) }}\n\n{%- set event_metrics = var('iterable__event_metrics') | map('lower') | list %}\n\nwith journey as (\n\n select *\n from {{ ref('stg_iterable__journey') }}\n\n), journey_metrics as (\n\n select *\n from {{ ref('int_iterable__journey_event_metrics') }}\n\n), journey_join as (\n\n {% set exclude_fields = ['source_relation', 'journey_id'] %} -- these are in journey\n\n -- left join so journeys that generate no events, such as audience-splitting or\n -- field-update journeys, are still reported with null metrics\n select\n journey.*,\n {{ dbt_utils.star(from=ref('int_iterable__journey_event_metrics'), except=exclude_fields, relation_alias=\"journey_metrics\") }}\n\n from journey\n\n left join journey_metrics\n on journey.journey_id = journey_metrics.journey_id\n and journey.source_relation = journey_metrics.source_relation\n\n), add_rates as (\n\n -- Engagement rates as a share of emails sent. Each rate is emitted only when both its\n -- numerator and denominator events are present in the `iterable__event_metrics` variable,\n -- since that list is user-configurable and may not include every email event.\n {%- set rate_expressions = [] %}\n {%- if 'emailsend' in event_metrics %}\n {%- if 'emailopen' in event_metrics %}\n {%- do rate_expressions.append('total_emailopen / nullif(total_emailsend, 0) as email_open_rate') %}\n {%- endif %}\n {%- if 'emailclick' in event_metrics %}\n {%- do rate_expressions.append('total_emailclick / nullif(total_emailsend, 0) as email_click_rate') %}\n {%- endif %}\n {%- if 'emailbounce' in event_metrics %}\n {%- do rate_expressions.append('total_emailbounce / nullif(total_emailsend, 0) as email_bounce_rate') %}\n {%- endif %}\n {%- if 'emailunsubscribe' in event_metrics %}\n {%- do rate_expressions.append('total_emailunsubscribe / nullif(total_emailsend, 0) as email_unsubscribe_rate') %}\n {%- endif %}\n {%- endif %}\n\n select\n *\n {% for rate in rate_expressions %}\n , {{ rate }}\n {% endfor %}\n\n from journey_join\n\n), add_surrogate_key as (\n\n {% set surrogate_key_fields = ['journey_id', 'source_relation'] %}\n\n select\n *,\n {{ dbt_utils.generate_surrogate_key(surrogate_key_fields) }} as unique_journey_id\n\n from add_rates\n)\n\nselect *\nfrom add_surrogate_key", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__journey", "package": null, "version": null}, {"name": "int_iterable__journey_event_metrics", "package": null, "version": null}, {"name": "int_iterable__journey_event_metrics", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt_utils.star", "macro.dbt_utils.generate_surrogate_key"], "nodes": ["model.iterable.stg_iterable__journey", "model.iterable.int_iterable__journey_event_metrics"]}, "compiled_path": "target/compiled/iterable/models/iterable__journeys.sql", "compiled": true, "compiled_code": "\n\nwith journey as (\n\n select *\n from \"postgres\".\"public_iterable_dev\".\"stg_iterable__journey\"\n\n), journey_metrics as (\n\n select *\n from \"postgres\".\"public_iterable_dev\".\"int_iterable__journey_event_metrics\"\n\n), journey_join as (\n\n -- these are in journey\n\n -- left join so journeys that generate no events, such as audience-splitting or\n -- field-update journeys, are still reported with null metrics\n select\n journey.*,\n journey_metrics.\"count_total_campaigns\",\n journey_metrics.\"count_unique_users\",\n journey_metrics.\"first_event_at\",\n journey_metrics.\"last_event_at\",\n journey_metrics.\"total_emailclick\",\n journey_metrics.\"unique_total_emailclick\",\n journey_metrics.\"total_emailunsubscribe\",\n journey_metrics.\"unique_total_emailunsubscribe\",\n journey_metrics.\"total_emailcomplaint\",\n journey_metrics.\"unique_total_emailcomplaint\",\n journey_metrics.\"total_customevent\",\n journey_metrics.\"unique_total_customevent\",\n journey_metrics.\"total_emailsubscribe\",\n journey_metrics.\"unique_total_emailsubscribe\",\n journey_metrics.\"total_emailopen\",\n journey_metrics.\"unique_total_emailopen\",\n journey_metrics.\"total_pushsend\",\n journey_metrics.\"unique_total_pushsend\",\n journey_metrics.\"total_smsbounce\",\n journey_metrics.\"unique_total_smsbounce\",\n journey_metrics.\"total_pushbounce\",\n journey_metrics.\"unique_total_pushbounce\",\n journey_metrics.\"total_inappsendskip\",\n journey_metrics.\"unique_total_inappsendskip\",\n journey_metrics.\"total_smssend\",\n journey_metrics.\"unique_total_smssend\",\n journey_metrics.\"total_inappsend\",\n journey_metrics.\"unique_total_inappsend\",\n journey_metrics.\"total_pushopen\",\n journey_metrics.\"unique_total_pushopen\",\n journey_metrics.\"total_emailsend\",\n journey_metrics.\"unique_total_emailsend\",\n journey_metrics.\"total_pushsendskip\",\n journey_metrics.\"unique_total_pushsendskip\",\n journey_metrics.\"total_inappopen\",\n journey_metrics.\"unique_total_inappopen\",\n journey_metrics.\"total_emailsendskip\",\n journey_metrics.\"unique_total_emailsendskip\",\n journey_metrics.\"total_emailbounce\",\n journey_metrics.\"unique_total_emailbounce\",\n journey_metrics.\"total_inappclick\",\n journey_metrics.\"unique_total_inappclick\",\n journey_metrics.\"total_pushuninstall\",\n journey_metrics.\"unique_total_pushuninstall\"\n\n from journey\n\n left join journey_metrics\n on journey.journey_id = journey_metrics.journey_id\n and journey.source_relation = journey_metrics.source_relation\n\n), add_rates as (\n\n -- Engagement rates as a share of emails sent. Each rate is emitted only when both its\n -- numerator and denominator events are present in the `iterable__event_metrics` variable,\n -- since that list is user-configurable and may not include every email event.\n\n select\n *\n \n , total_emailopen / nullif(total_emailsend, 0) as email_open_rate\n \n , total_emailclick / nullif(total_emailsend, 0) as email_click_rate\n \n , total_emailbounce / nullif(total_emailsend, 0) as email_bounce_rate\n \n , total_emailunsubscribe / nullif(total_emailsend, 0) as email_unsubscribe_rate\n \n\n from journey_join\n\n), add_surrogate_key as (\n\n \n\n select\n *,\n md5(cast(coalesce(cast(journey_id as TEXT), '_dbt_utils_surrogate_key_null_') || '-' || coalesce(cast(source_relation as TEXT), '_dbt_utils_surrogate_key_null_') as TEXT)) as unique_journey_id\n\n from add_rates\n)\n\nselect *\nfrom add_surrogate_key", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": ["unique_journey_id"], "time_spine": null}, "model.iterable.iterable__campaigns": {"database": "postgres", "schema": "public_iterable_dev", "name": "iterable__campaigns", "resource_type": "model", "package_name": "iterable", "path": "iterable__campaigns.sql", "original_file_path": "models/iterable__campaigns.sql", "unique_id": "model.iterable.iterable__campaigns", "fqn": ["iterable", "iterable__campaigns"], "alias": "iterable__campaigns", "checksum": {"name": "sha256", "checksum": "8a06f641cc3e4a6fcf53c1ff0571db0c9b0e7212a2a2ff5ea9111e035a96b0cc"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "table", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "Table that provides aggregations for campaigns at the template and if available, the experiment grain.", "columns": {"source_relation": {"name": "source_relation", "description": "Identifies the record's source.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": ["doc.iterable.source_relation"]}, "campaign_id": {"name": "campaign_id", "description": "Unique identifier of the campaign record", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_campaign_version_id": {"name": "unique_campaign_version_id", "description": "Unique identifier combining campaign_id, template_id, source_relation, and if available, experiment_id.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "campaign_name": {"name": "campaign_name", "description": "User defined name of the campaign.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "updated_at": {"name": "updated_at", "description": "Last update timestamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "campaign_state": {"name": "campaign_state", "description": "State of the campaign. Can be Draft, Ready, Scheduled, Running, Finished, Starting, Aborted or Recurring", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "campaign_type": {"name": "campaign_type", "description": "The campaign type. Can be Blast or Triggered", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "send_size": {"name": "send_size", "description": "Size of the campaign. Number of individuals included in the campaign", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "start_at": {"name": "start_at", "description": "Start timestamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "ended_at": {"name": "ended_at", "description": "Ended timestamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "created_at": {"name": "created_at", "description": "Creation timestamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "created_by_user_id": {"name": "created_by_user_id", "description": "Reference to the user who created the campaign", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "template_id": {"name": "template_id", "description": "Reference to the campaign template", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "recurring_campaign_id": {"name": "recurring_campaign_id", "description": "Unique identifier of the recurring campaign (if applicable)", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "recurring_campaign_name": {"name": "recurring_campaign_name", "description": "Name of the recurring campaign (if applicable)", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "recurring_campaign_state": {"name": "recurring_campaign_state", "description": "State of the recurring campaign (if applicable)", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "recurring_campaign_send_size": {"name": "recurring_campaign_send_size", "description": "Size of the recurring campaign. Number of individuals included in the recurring campaign (if applicable)", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "recurring_campaign_start_at": {"name": "recurring_campaign_start_at", "description": "Timestamp of when the recurring campaign started (if applicable)", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "is_campaign_recurring": {"name": "is_campaign_recurring", "description": "Boolean indicating if the campaign is a recurring campaign", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "experiment_id": {"name": "experiment_id", "description": "Reference to the experiment used if the event is an experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "count_unique_users": {"name": "count_unique_users", "description": "Count of total unique users within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_emailclick": {"name": "total_emailclick", "description": "Total email clicks within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_total_emailclick": {"name": "unique_total_emailclick", "description": "Unique email clicks within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_emailunsubscribe": {"name": "total_emailunsubscribe", "description": "Total email unsubscribe events within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_total_emailunsubscribe": {"name": "unique_total_emailunsubscribe", "description": "Unique total email unsubscribe events within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_emailcomplaint": {"name": "total_emailcomplaint", "description": "Total email complaints within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_total_emailcomplaint": {"name": "unique_total_emailcomplaint", "description": "Unique total email complaints within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_customevent": {"name": "total_customevent", "description": "Total custom events within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_total_customevent": {"name": "unique_total_customevent", "description": "Unique total custom events within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_emailsubscribe": {"name": "total_emailsubscribe", "description": "Total email subscribe events within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_total_emailsubscribe": {"name": "unique_total_emailsubscribe", "description": "Unique total email subscribe events within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_emailopen": {"name": "total_emailopen", "description": "Total email open events within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_total_emailopen": {"name": "unique_total_emailopen", "description": "Unique total email open events within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_pushsend": {"name": "total_pushsend", "description": "Total push send event within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_total_pushsend": {"name": "unique_total_pushsend", "description": "Unique total push send events within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_smsbounce": {"name": "total_smsbounce", "description": "Total sms bounce events within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_total_smsbounce": {"name": "unique_total_smsbounce", "description": "Unique total sms bounce events within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_pushbounce": {"name": "total_pushbounce", "description": "Total push bounce events within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_total_pushbounce": {"name": "unique_total_pushbounce", "description": "Unique total push bounce events within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_inappsendskip": {"name": "total_inappsendskip", "description": "Total in app send skip events within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_total_inappsendskip": {"name": "unique_total_inappsendskip", "description": "Unique total in app send skip events within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_smssend": {"name": "total_smssend", "description": "Total sms send events within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_total_smssend": {"name": "unique_total_smssend", "description": "Unique total sms send events within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_inappsend": {"name": "total_inappsend", "description": "Total in app send events within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_total_inappsend": {"name": "unique_total_inappsend", "description": "Unique total in app send events within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_pushopen": {"name": "total_pushopen", "description": "Total push open events within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_total_pushopen": {"name": "unique_total_pushopen", "description": "Unique total push open events within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_emailsend": {"name": "total_emailsend", "description": "Total email send events within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_total_emailsend": {"name": "unique_total_emailsend", "description": "Unique total email send events within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_pushsendskip": {"name": "total_pushsendskip", "description": "Total push send skip events within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_total_pushsendskip": {"name": "unique_total_pushsendskip", "description": "Unique total push send skip events within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_inappopen": {"name": "total_inappopen", "description": "Total in app open events within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_total_inappopen": {"name": "unique_total_inappopen", "description": "Unique total in app open events within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_emailsendskip": {"name": "total_emailsendskip", "description": "Total email send skip events within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_total_emailsendskip": {"name": "unique_total_emailsendskip", "description": "Unique total email send skip events within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_emailbounce": {"name": "total_emailbounce", "description": "Total email bounce events within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_total_emailbounce": {"name": "unique_total_emailbounce", "description": "Unique total email bounce events within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_inappclick": {"name": "total_inappclick", "description": "Total in app click events within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_total_inappclick": {"name": "unique_total_inappclick", "description": "Unique total in app click events within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_pushuninstall": {"name": "total_pushuninstall", "description": "Total push uninstall events within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_total_pushuninstall": {"name": "unique_total_pushuninstall", "description": "Unique total push uninstall events within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "count_send_lists": {"name": "count_send_lists", "description": "Count of send lists within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "count_suppress_lists": {"name": "count_suppress_lists", "description": "Count of suppress lists within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "labels": {"name": "labels", "description": "List of labels associated with the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "journey_id": {"name": "journey_id", "description": "Reference to the journey the campaign belongs to, if applicable", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "journey_name": {"name": "journey_name", "description": "User defined name of the journey the campaign belongs to, if applicable", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "journey_type": {"name": "journey_type", "description": "The type of the journey the campaign belongs to, if applicable", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "template_name": {"name": "template_name", "description": "Name of the template associated with the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "template_creator_user_id": {"name": "template_creator_user_id", "description": "The creator user id of the template associated with the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "message_medium": {"name": "message_medium", "description": "The medium which the message was provided", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "message_type_name": {"name": "message_type_name", "description": "The message type name associated with the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "channel_name": {"name": "channel_name", "description": "The channel name associated with the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "channel_id": {"name": "channel_id", "description": "The channel identifier associated with the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "channel_type": {"name": "channel_type", "description": "The channel type associated with the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "iterable://models/iterable.yml", "build_path": null, "unrendered_config": {"materialized": "table", "schema": "iterable_{{ var('directed_schema','dev') }}", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789079004.200406, "relation_name": "\"postgres\".\"public_iterable_dev\".\"iterable__campaigns\"", "raw_code": "with campaign_event_metrics as (\n\n select *\n from {{ ref('int_iterable__campaign_event_metrics') }}\n\n), campaign_list_metrics as (\n\n select\n source_relation,\n campaign_id,\n sum(case when list_activity = 'send' then 1 else 0 end) as count_send_lists,\n sum(case when list_activity = 'suppress' then 1 else 0 end) as count_suppress_lists\n\n from {{ ref('int_iterable__campaign_lists') }}\n {{ dbt_utils.group_by(n=2) }}\n\n), campaign as (\n\n select *\n from {{ ref('int_iterable__recurring_campaigns') }}\n \n{% if var('iterable__using_campaign_label_history', true) %}\n), campaign_labels as (\n\n select *\n from {{ ref('int_iterable__campaign_labels') }}\n\n{% endif %}\n\n), template as (\n -- rebringing this in (it is brought in iterable__events) in case any campaigns don't have events yet\n -- this will result in some DAG ugliness but maintains template info for non-sent campaigns\n select *\n from {{ ref('int_iterable__latest_template') }}\n\n{% if var('iterable__using_journey', true) %}\n), journey as (\n\n select *\n from {{ ref('stg_iterable__journey') }}\n\n{% endif %}\n\n), campaign_join as (\n\n {% set exclude_fields = ['source_relation', 'campaign_id', 'template_id'] %} -- these are in campaigns\n\n -- this query will be at the campaign and experiment(if available) variation grain\n select\n campaign.*,\n {{ dbt_utils.star(from=ref('int_iterable__campaign_event_metrics'), except=exclude_fields, relation_alias=\"campaign_event_metrics\") }}\n , \n campaign_list_metrics.count_send_lists,\n campaign_list_metrics.count_suppress_lists,\n {% if var('iterable__using_campaign_label_history', true) %}\n campaign_labels.labels,\n {% endif %}\n {% if var('iterable__using_journey', true) %}\n journey.journey_name,\n journey.journey_type,\n {% endif %}\n template.template_name,\n template.creator_user_id as template_creator_user_id,\n template.message_medium,\n template.message_type_name,\n template.channel_name,\n template.channel_id,\n template.channel_type\n\n from campaign\n left join campaign_event_metrics\n on campaign.campaign_id = campaign_event_metrics.campaign_id\n and campaign.template_id = campaign_event_metrics.template_id\n and campaign.source_relation = campaign_event_metrics.source_relation\n left join campaign_list_metrics\n on campaign.campaign_id = campaign_list_metrics.campaign_id\n and campaign.source_relation = campaign_list_metrics.source_relation\n\n {% if var('iterable__using_campaign_label_history', true) %}\n left join campaign_labels\n on campaign.campaign_id = campaign_labels.campaign_id\n and campaign.source_relation = campaign_labels.source_relation\n {% endif %}\n\n left join template\n on campaign.template_id = template.template_id\n and campaign.source_relation = template.source_relation\n\n {% if var('iterable__using_journey', true) %}\n left join journey\n on campaign.journey_id = journey.journey_id\n and campaign.source_relation = journey.source_relation\n {% endif %}\n\n), add_surrogate_key as (\n\n {% set surrogate_key_fields = ['campaign_id', 'template_id', 'source_relation'] %}\n {% do surrogate_key_fields.append('experiment_id') if var('iterable__using_event_extension', True) %}\n\n select \n *,\n {{ dbt_utils.generate_surrogate_key(surrogate_key_fields) }} as unique_campaign_version_id\n\n from campaign_join\n)\n\nselect *\nfrom add_surrogate_key", "doc_blocks": [], "language": "sql", "refs": [{"name": "int_iterable__campaign_event_metrics", "package": null, "version": null}, {"name": "int_iterable__campaign_lists", "package": null, "version": null}, {"name": "int_iterable__recurring_campaigns", "package": null, "version": null}, {"name": "int_iterable__campaign_labels", "package": null, "version": null}, {"name": "int_iterable__latest_template", "package": null, "version": null}, {"name": "stg_iterable__journey", "package": null, "version": null}, {"name": "int_iterable__campaign_event_metrics", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt_utils.group_by", "macro.dbt_utils.star", "macro.dbt_utils.generate_surrogate_key"], "nodes": ["model.iterable.int_iterable__campaign_event_metrics", "model.iterable.int_iterable__campaign_lists", "model.iterable.int_iterable__recurring_campaigns", "model.iterable.int_iterable__campaign_labels", "model.iterable.int_iterable__latest_template", "model.iterable.stg_iterable__journey"]}, "compiled_path": "target/compiled/iterable/models/iterable__campaigns.sql", "compiled": true, "compiled_code": "with campaign_event_metrics as (\n\n select *\n from \"postgres\".\"public_iterable_dev\".\"int_iterable__campaign_event_metrics\"\n\n), campaign_list_metrics as (\n\n select\n source_relation,\n campaign_id,\n sum(case when list_activity = 'send' then 1 else 0 end) as count_send_lists,\n sum(case when list_activity = 'suppress' then 1 else 0 end) as count_suppress_lists\n\n from \"postgres\".\"public_iterable_dev\".\"int_iterable__campaign_lists\"\n group by 1,2\n\n), campaign as (\n\n select *\n from \"postgres\".\"public_iterable_dev\".\"int_iterable__recurring_campaigns\"\n \n\n), campaign_labels as (\n\n select *\n from \"postgres\".\"public_iterable_dev\".\"int_iterable__campaign_labels\"\n\n\n\n), template as (\n -- rebringing this in (it is brought in iterable__events) in case any campaigns don't have events yet\n -- this will result in some DAG ugliness but maintains template info for non-sent campaigns\n select *\n from \"postgres\".\"public_iterable_dev\".\"int_iterable__latest_template\"\n\n\n), journey as (\n\n select *\n from \"postgres\".\"public_iterable_dev\".\"stg_iterable__journey\"\n\n\n\n), campaign_join as (\n\n -- these are in campaigns\n\n -- this query will be at the campaign and experiment(if available) variation grain\n select\n campaign.*,\n campaign_event_metrics.\"experiment_id\",\n campaign_event_metrics.\"count_unique_users\",\n campaign_event_metrics.\"total_emailclick\",\n campaign_event_metrics.\"unique_total_emailclick\",\n campaign_event_metrics.\"total_emailunsubscribe\",\n campaign_event_metrics.\"unique_total_emailunsubscribe\",\n campaign_event_metrics.\"total_emailcomplaint\",\n campaign_event_metrics.\"unique_total_emailcomplaint\",\n campaign_event_metrics.\"total_customevent\",\n campaign_event_metrics.\"unique_total_customevent\",\n campaign_event_metrics.\"total_emailsubscribe\",\n campaign_event_metrics.\"unique_total_emailsubscribe\",\n campaign_event_metrics.\"total_emailopen\",\n campaign_event_metrics.\"unique_total_emailopen\",\n campaign_event_metrics.\"total_pushsend\",\n campaign_event_metrics.\"unique_total_pushsend\",\n campaign_event_metrics.\"total_smsbounce\",\n campaign_event_metrics.\"unique_total_smsbounce\",\n campaign_event_metrics.\"total_pushbounce\",\n campaign_event_metrics.\"unique_total_pushbounce\",\n campaign_event_metrics.\"total_inappsendskip\",\n campaign_event_metrics.\"unique_total_inappsendskip\",\n campaign_event_metrics.\"total_smssend\",\n campaign_event_metrics.\"unique_total_smssend\",\n campaign_event_metrics.\"total_inappsend\",\n campaign_event_metrics.\"unique_total_inappsend\",\n campaign_event_metrics.\"total_pushopen\",\n campaign_event_metrics.\"unique_total_pushopen\",\n campaign_event_metrics.\"total_emailsend\",\n campaign_event_metrics.\"unique_total_emailsend\",\n campaign_event_metrics.\"total_pushsendskip\",\n campaign_event_metrics.\"unique_total_pushsendskip\",\n campaign_event_metrics.\"total_inappopen\",\n campaign_event_metrics.\"unique_total_inappopen\",\n campaign_event_metrics.\"total_emailsendskip\",\n campaign_event_metrics.\"unique_total_emailsendskip\",\n campaign_event_metrics.\"total_emailbounce\",\n campaign_event_metrics.\"unique_total_emailbounce\",\n campaign_event_metrics.\"total_inappclick\",\n campaign_event_metrics.\"unique_total_inappclick\",\n campaign_event_metrics.\"total_pushuninstall\",\n campaign_event_metrics.\"unique_total_pushuninstall\"\n , \n campaign_list_metrics.count_send_lists,\n campaign_list_metrics.count_suppress_lists,\n \n campaign_labels.labels,\n \n \n journey.journey_name,\n journey.journey_type,\n \n template.template_name,\n template.creator_user_id as template_creator_user_id,\n template.message_medium,\n template.message_type_name,\n template.channel_name,\n template.channel_id,\n template.channel_type\n\n from campaign\n left join campaign_event_metrics\n on campaign.campaign_id = campaign_event_metrics.campaign_id\n and campaign.template_id = campaign_event_metrics.template_id\n and campaign.source_relation = campaign_event_metrics.source_relation\n left join campaign_list_metrics\n on campaign.campaign_id = campaign_list_metrics.campaign_id\n and campaign.source_relation = campaign_list_metrics.source_relation\n\n \n left join campaign_labels\n on campaign.campaign_id = campaign_labels.campaign_id\n and campaign.source_relation = campaign_labels.source_relation\n \n\n left join template\n on campaign.template_id = template.template_id\n and campaign.source_relation = template.source_relation\n\n \n left join journey\n on campaign.journey_id = journey.journey_id\n and campaign.source_relation = journey.source_relation\n \n\n), add_surrogate_key as (\n\n \n \n\n select \n *,\n md5(cast(coalesce(cast(campaign_id as TEXT), '_dbt_utils_surrogate_key_null_') || '-' || coalesce(cast(template_id as TEXT), '_dbt_utils_surrogate_key_null_') || '-' || coalesce(cast(source_relation as TEXT), '_dbt_utils_surrogate_key_null_') || '-' || coalesce(cast(experiment_id as TEXT), '_dbt_utils_surrogate_key_null_') as TEXT)) as unique_campaign_version_id\n\n from campaign_join\n)\n\nselect *\nfrom add_surrogate_key", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.int_iterable__campaign_labels": {"database": "postgres", "schema": "public_iterable_dev", "name": "int_iterable__campaign_labels", "resource_type": "model", "package_name": "iterable", "path": "intermediate/int_iterable__campaign_labels.sql", "original_file_path": "models/intermediate/int_iterable__campaign_labels.sql", "unique_id": "model.iterable.int_iterable__campaign_labels", "fqn": ["iterable", "intermediate", "int_iterable__campaign_labels"], "alias": "int_iterable__campaign_labels", "checksum": {"name": "sha256", "checksum": "64ae8d410bd6673399326348a650a7facc7b6631aa34fbb01a1598cb96c7d012"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "Table that provides the distinct string aggregation of labels for each campaign.", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "iterable://models/intermediate/int_iterable.yml", "build_path": null, "unrendered_config": {"materialized": "view", "schema": "iterable_{{ var('directed_schema','dev') }}", "enabled": "var('iterable__using_campaign_label_history', True)", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789079004.295383, "relation_name": "\"postgres\".\"public_iterable_dev\".\"int_iterable__campaign_labels\"", "raw_code": "{{ config(enabled=var('iterable__using_campaign_label_history', True)) }}\n\nwith campaign_label_history as (\n\n select *\n from {{ ref('stg_iterable__campaign_label_history') }}\n\n), order_campaign_labels as (\n\n select \n *,\n rank() over(partition by campaign_id{{ fivetran_utils.partition_by_source_relation(package_name='iterable') }} order by updated_at desc) as latest_label_batch_index\n\n from campaign_label_history\n\n), latest_labels as (\n\n select *\n from order_campaign_labels\n where latest_label_batch_index = 1\n\n), aggregate_labels as (\n\n select\n source_relation,\n campaign_id,\n {{ fivetran_utils.string_agg('distinct label', \"', '\") }} as labels\n\n from latest_labels\n {{ dbt_utils.group_by(n=2) }}\n)\n\nselect * from aggregate_labels", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__campaign_label_history", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.fivetran_utils.partition_by_source_relation", "macro.fivetran_utils.string_agg", "macro.dbt_utils.group_by"], "nodes": ["model.iterable.stg_iterable__campaign_label_history"]}, "compiled_path": "target/compiled/iterable/models/intermediate/int_iterable__campaign_labels.sql", "compiled": true, "compiled_code": "\n\nwith campaign_label_history as (\n\n select *\n from \"postgres\".\"public_iterable_dev\".\"stg_iterable__campaign_label_history\"\n\n), order_campaign_labels as (\n\n select \n *,\n rank() over(partition by campaign_id order by updated_at desc) as latest_label_batch_index\n\n from campaign_label_history\n\n), latest_labels as (\n\n select *\n from order_campaign_labels\n where latest_label_batch_index = 1\n\n), aggregate_labels as (\n\n select\n source_relation,\n campaign_id,\n \n string_agg(distinct label, ', ')\n\n as labels\n\n from latest_labels\n group by 1,2\n)\n\nselect * from aggregate_labels", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.int_iterable__journey_event_metrics": {"database": "postgres", "schema": "public_iterable_dev", "name": "int_iterable__journey_event_metrics", "resource_type": "model", "package_name": "iterable", "path": "intermediate/int_iterable__journey_event_metrics.sql", "original_file_path": "models/intermediate/int_iterable__journey_event_metrics.sql", "unique_id": "model.iterable.int_iterable__journey_event_metrics", "fqn": ["iterable", "intermediate", "int_iterable__journey_event_metrics"], "alias": "int_iterable__journey_event_metrics", "checksum": {"name": "sha256", "checksum": "6a1f0f32043a423287b962d9f2ab46aeda312c047c09256447a7068f8830353d"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "Table that generates relevant total and unique journey level aggregations, rolled up from the user/campaign grain via the campaign's journey reference.", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "iterable://models/intermediate/int_iterable.yml", "build_path": null, "unrendered_config": {"materialized": "view", "schema": "iterable_{{ var('directed_schema','dev') }}", "enabled": "var('iterable__using_journey', True)", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789079004.295994, "relation_name": "\"postgres\".\"public_iterable_dev\".\"int_iterable__journey_event_metrics\"", "raw_code": "{{ config(enabled=var('iterable__using_journey', True)) }}\n\nwith user_campaign as (\n select *\n from {{ ref('iterable__user_campaign') }}\n\n), campaign as (\n\n select\n source_relation,\n campaign_id,\n journey_id\n\n from {{ ref('int_iterable__recurring_campaigns') }}\n where journey_id is not null\n\n), journey_event_metrics as (\n{%- set user_campaign_columns = adapter.get_columns_in_relation(ref('iterable__user_campaign')) %}\n{%- set non_agg_columns = ['source_relation', 'unique_user_key', 'user_id', '_fivetran_user_id',\n 'user_email', 'user_full_name', 'campaign_id', 'campaign_name', 'recurring_campaign_id',\n 'recurring_campaign_name', 'first_event_at', 'last_event_at', 'template_id', 'template_name',\n 'experiment_id', 'unique_user_campaign_id', 'first_open_or_click_event_at'\n ] %}\n\n select\n campaign.source_relation,\n campaign.journey_id,\n count(distinct user_campaign.campaign_id) as count_total_campaigns,\n count(distinct user_campaign.unique_user_key) as count_unique_users,\n min(user_campaign.first_event_at) as first_event_at,\n max(user_campaign.last_event_at) as last_event_at\n {% for col in user_campaign_columns if col.name|lower not in non_agg_columns %}\n , sum(user_campaign.{{ col.name }}) as {{ col.name }}\n , count(distinct case when user_campaign.{{ col.name }} > 0 then user_campaign.user_email else null end) as unique_{{ col.name }}\n {% endfor %}\n\n from user_campaign\n\n inner join campaign\n on user_campaign.campaign_id = campaign.campaign_id\n and user_campaign.source_relation = campaign.source_relation\n\n {{ dbt_utils.group_by(n=2) }}\n)\n\nselect *\nfrom journey_event_metrics", "doc_blocks": [], "language": "sql", "refs": [{"name": "iterable__user_campaign", "package": null, "version": null}, {"name": "int_iterable__recurring_campaigns", "package": null, "version": null}, {"name": "iterable__user_campaign", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt_utils.group_by"], "nodes": ["model.iterable.iterable__user_campaign", "model.iterable.int_iterable__recurring_campaigns"]}, "compiled_path": "target/compiled/iterable/models/intermediate/int_iterable__journey_event_metrics.sql", "compiled": true, "compiled_code": "\n\nwith user_campaign as (\n select *\n from \"postgres\".\"public_iterable_dev\".\"iterable__user_campaign\"\n\n), campaign as (\n\n select\n source_relation,\n campaign_id,\n journey_id\n\n from \"postgres\".\"public_iterable_dev\".\"int_iterable__recurring_campaigns\"\n where journey_id is not null\n\n), journey_event_metrics as (\n\n select\n campaign.source_relation,\n campaign.journey_id,\n count(distinct user_campaign.campaign_id) as count_total_campaigns,\n count(distinct user_campaign.unique_user_key) as count_unique_users,\n min(user_campaign.first_event_at) as first_event_at,\n max(user_campaign.last_event_at) as last_event_at\n \n , sum(user_campaign.total_emailclick) as total_emailclick\n , count(distinct case when user_campaign.total_emailclick > 0 then user_campaign.user_email else null end) as unique_total_emailclick\n \n , sum(user_campaign.total_emailunsubscribe) as total_emailunsubscribe\n , count(distinct case when user_campaign.total_emailunsubscribe > 0 then user_campaign.user_email else null end) as unique_total_emailunsubscribe\n \n , sum(user_campaign.total_emailcomplaint) as total_emailcomplaint\n , count(distinct case when user_campaign.total_emailcomplaint > 0 then user_campaign.user_email else null end) as unique_total_emailcomplaint\n \n , sum(user_campaign.total_customevent) as total_customevent\n , count(distinct case when user_campaign.total_customevent > 0 then user_campaign.user_email else null end) as unique_total_customevent\n \n , sum(user_campaign.total_emailsubscribe) as total_emailsubscribe\n , count(distinct case when user_campaign.total_emailsubscribe > 0 then user_campaign.user_email else null end) as unique_total_emailsubscribe\n \n , sum(user_campaign.total_emailopen) as total_emailopen\n , count(distinct case when user_campaign.total_emailopen > 0 then user_campaign.user_email else null end) as unique_total_emailopen\n \n , sum(user_campaign.total_pushsend) as total_pushsend\n , count(distinct case when user_campaign.total_pushsend > 0 then user_campaign.user_email else null end) as unique_total_pushsend\n \n , sum(user_campaign.total_smsbounce) as total_smsbounce\n , count(distinct case when user_campaign.total_smsbounce > 0 then user_campaign.user_email else null end) as unique_total_smsbounce\n \n , sum(user_campaign.total_pushbounce) as total_pushbounce\n , count(distinct case when user_campaign.total_pushbounce > 0 then user_campaign.user_email else null end) as unique_total_pushbounce\n \n , sum(user_campaign.total_inappsendskip) as total_inappsendskip\n , count(distinct case when user_campaign.total_inappsendskip > 0 then user_campaign.user_email else null end) as unique_total_inappsendskip\n \n , sum(user_campaign.total_smssend) as total_smssend\n , count(distinct case when user_campaign.total_smssend > 0 then user_campaign.user_email else null end) as unique_total_smssend\n \n , sum(user_campaign.total_inappsend) as total_inappsend\n , count(distinct case when user_campaign.total_inappsend > 0 then user_campaign.user_email else null end) as unique_total_inappsend\n \n , sum(user_campaign.total_pushopen) as total_pushopen\n , count(distinct case when user_campaign.total_pushopen > 0 then user_campaign.user_email else null end) as unique_total_pushopen\n \n , sum(user_campaign.total_emailsend) as total_emailsend\n , count(distinct case when user_campaign.total_emailsend > 0 then user_campaign.user_email else null end) as unique_total_emailsend\n \n , sum(user_campaign.total_pushsendskip) as total_pushsendskip\n , count(distinct case when user_campaign.total_pushsendskip > 0 then user_campaign.user_email else null end) as unique_total_pushsendskip\n \n , sum(user_campaign.total_inappopen) as total_inappopen\n , count(distinct case when user_campaign.total_inappopen > 0 then user_campaign.user_email else null end) as unique_total_inappopen\n \n , sum(user_campaign.total_emailsendskip) as total_emailsendskip\n , count(distinct case when user_campaign.total_emailsendskip > 0 then user_campaign.user_email else null end) as unique_total_emailsendskip\n \n , sum(user_campaign.total_emailbounce) as total_emailbounce\n , count(distinct case when user_campaign.total_emailbounce > 0 then user_campaign.user_email else null end) as unique_total_emailbounce\n \n , sum(user_campaign.total_inappclick) as total_inappclick\n , count(distinct case when user_campaign.total_inappclick > 0 then user_campaign.user_email else null end) as unique_total_inappclick\n \n , sum(user_campaign.total_pushuninstall) as total_pushuninstall\n , count(distinct case when user_campaign.total_pushuninstall > 0 then user_campaign.user_email else null end) as unique_total_pushuninstall\n \n\n from user_campaign\n\n inner join campaign\n on user_campaign.campaign_id = campaign.campaign_id\n and user_campaign.source_relation = campaign.source_relation\n\n group by 1,2\n)\n\nselect *\nfrom journey_event_metrics", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.int_iterable__list_user_unnest": {"database": "postgres", "schema": "public_iterable_dev", "name": "int_iterable__list_user_unnest", "resource_type": "model", "package_name": "iterable", "path": "intermediate/int_iterable__list_user_unnest.sql", "original_file_path": "models/intermediate/int_iterable__list_user_unnest.sql", "unique_id": "model.iterable.int_iterable__list_user_unnest", "fqn": ["iterable", "intermediate", "int_iterable__list_user_unnest"], "alias": "int_iterable__list_user_unnest", "checksum": {"name": "sha256", "checksum": "82ec833586106f02efef7fe24516f3323171e61f1083323e97c892f21ddfa263"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "incremental", "incremental_strategy": "delete+insert", "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": "unique_key", "on_schema_change": "fail", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}, "partition_by": {"field": "date_day", "data_type": "date"}, "file_format": "delta"}, "tags": [], "description": "Table that unnests the `email_list_id` field for each user to create a new record for each user and the unique list it was associated with at a unique update. Due to the unnesting functions varying greatly between warehouses, conditional logic is applied throughout the model to appropriately accommodate the model being ran within Redshift, Snowflake, BigQuery, and Postgres.\n", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "iterable://models/intermediate/int_iterable.yml", "build_path": null, "unrendered_config": {"materialized": "incremental", "schema": "iterable_{{ var('directed_schema','dev') }}", "unique_key": "unique_key", "incremental_strategy": "CondExpr(test=Compare(expr=Getattr(node=Name(name='target', ctx='load'), attr='type', ctx='load'), ops=[Operand(op='in', expr=Tuple(items=[Const(value='bigquery'), Const(value='spark'), Const(value='databricks')], ctx='load'))]), expr1=Const(value='insert_overwrite'), expr2=Const(value='delete+insert'))", "partition_by": "CondExpr(test=Compare(expr=Getattr(node=Name(name='target', ctx='load'), attr='type', ctx='load'), ops=[Operand(op='notin', expr=Tuple(items=[Const(value='spark'), Const(value='databricks'), Const(value='duckdb')], ctx='load'))]), expr1=Dict(items=[Pair(key=Const(value='field'), value=Const(value='date_day')), Pair(key=Const(value='data_type'), value=Const(value='date'))]), expr2=List(items=[Const(value='date_day')]))", "file_format": "delta", "on_schema_change": "fail", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789079004.2974107, "relation_name": "\"postgres\".\"public_iterable_dev\".\"int_iterable__list_user_unnest\"", "raw_code": "{{ config(\n materialized='incremental',\n unique_key='unique_key',\n incremental_strategy='insert_overwrite' if target.type in ('bigquery', 'spark', 'databricks') else 'delete+insert',\n partition_by={\"field\": \"date_day\", \"data_type\": \"date\"} if target.type not in ('spark', 'databricks', 'duckdb') else ['date_day'],\n file_format='delta',\n on_schema_change='fail'\n )\n}}\n\nwith user_history as (\n\n select *\n from {{ ref('int_iterable__list_user_history') }} as user_history\n\n {% if is_incremental() %}\n {# the only rows we potentially want to overwrite are active ones #}\n where user_history.updated_at >= coalesce((select min(updated_at) from {{ this }} where is_current), '2010-01-01')\n {% endif %}\n\n{% if target.type == 'redshift' %}\n{# using PartiQL syntax to work with redshift's SUPER types #}\n), redshift_parse_email_lists as (\n\n select\n source_relation,\n _fivetran_user_id,\n unique_user_key,\n email,\n first_name,\n last_name,\n user_id,\n signup_date,\n signup_source,\n phone_number,\n updated_at,\n is_current,\n email_list_ids,\n {# let's not remove empty array-rows #}\n json_parse(case when email_list_ids = '[]' then '[\"is_null\"]' else email_list_ids end) as super_email_list_ids\n\n --The below script allows for pass through columns.\n {{ fivetran_utils.persist_pass_through_columns(pass_through_variable='iterable_user_history_pass_through_columns', identifier='user_history') }}\n\n from user_history\n\n), unnest_email_array as (\n\n select\n source_relation,\n _fivetran_user_id,\n unique_user_key,\n email,\n first_name,\n last_name,\n user_id,\n signup_date,\n signup_source,\n phone_number,\n updated_at,\n is_current,\n {# go back to strings #}\n cast(email_list_ids as {{ dbt.type_string() }}) as email_list_ids,\n cast(email_list_id as {{ dbt.type_string() }}) as email_list_id\n\n --The below script allows for pass through columns.\n {{ fivetran_utils.persist_pass_through_columns(pass_through_variable='iterable_user_history_pass_through_columns', identifier='emails') }}\n\n from redshift_parse_email_lists as emails, emails.super_email_list_ids as email_list_id\n\n{% else %}\n), unnest_email_array as (\n\n select\n source_relation,\n _fivetran_user_id,\n unique_user_key,\n email,\n first_name,\n last_name,\n user_id,\n signup_date,\n signup_source,\n phone_number,\n updated_at,\n is_current,\n email_list_ids,\n case when email_list_ids != '[]' then\n {% if target.type == 'snowflake' %}\n email_list_id.value\n {% elif target.type in ('spark','databricks') %}\n email_list_id.col\n {% else %} email_list_id {% endif %}\n else null\n end as email_list_id\n\n --The below script allows for pass through columns.\n {{ fivetran_utils.persist_pass_through_columns(pass_through_variable='iterable_user_history_pass_through_columns', identifier='user_history') }}\n\n from user_history\n\n {% if target.type == 'snowflake' %}\n cross join\n table(flatten(input => parse_json(\n case when email_list_ids = '[]' then '[\"is_null\"]' {# to not remove empty array-rows #}\n else email_list_ids end))) as email_list_id\n {% elif target.type == 'bigquery' %}\n cross join\n unnest(JSON_EXTRACT_STRING_ARRAY(\n case when email_list_ids = '[]' then '[\"is_null\"]' {# to not remove empty array-rows #}\n else email_list_ids end)) as email_list_id\n {% elif target.type in ('spark','databricks') %}\n cross join\n lateral explode_outer(from_json(\n case when email_list_ids = '[]' then '[\"is_null\"]' {# to not remove empty array-rows #}\n else email_list_ids end, 'array')) as email_list_id\n {% elif target.type == 'duckdb' %}\n cross join\n unnest(from_json(cast((\n case when email_list_ids = '[]' then '[\"is_null\"]' {# to not remove empty array-rows #}\n else email_list_ids end) as varchar), '[\"VARCHAR\"]')) as t(email_list_id)\n {% else %} {# target is postgres #}\n cross join\n json_array_elements_text(cast((\n case when email_list_ids = '[]' then '[\"is_null\"]' {# to not remove empty array-rows #}\n else email_list_ids end) as json)) as email_list_id\n {%- endif %}\n\n{%- endif -%}\n), adjust_nulls as (\n\n select\n source_relation,\n _fivetran_user_id,\n unique_user_key,\n email,\n first_name,\n last_name,\n user_id,\n signup_date,\n signup_source,\n updated_at,\n phone_number,\n is_current,\n case when email_list_ids = '[\"is_null\"]' then '[]' else email_list_ids end as email_list_ids,\n cast(NULLIF(email_list_id, 'is_null') as {{ dbt.type_int() }}) as list_id\n\n --The below script allows for pass through columns.\n {{ fivetran_utils.persist_pass_through_columns(pass_through_variable='iterable_user_history_pass_through_columns', identifier='unnest_email_array') }}\n\n from unnest_email_array\n\n), final as (\n\n select\n source_relation,\n _fivetran_user_id,\n unique_user_key,\n user_id,\n email,\n first_name,\n last_name,\n signup_date,\n signup_source,\n updated_at,\n phone_number,\n is_current,\n email_list_ids,\n list_id,\n {{ dbt_utils.generate_surrogate_key([\"source_relation\", \"unique_user_key\", \"list_id\", \"updated_at\"]) }} as unique_key,\n cast( {{ dbt.date_trunc('day', 'updated_at') }} as date) as date_day\n\n --The below script allows for pass through columns.\n {{ fivetran_utils.persist_pass_through_columns(pass_through_variable='iterable_user_history_pass_through_columns', identifier='adjust_nulls') }}\n\n from adjust_nulls\n)\n\nselect *\nfrom final", "doc_blocks": [], "language": "sql", "refs": [{"name": "int_iterable__list_user_history", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.is_incremental", "macro.fivetran_utils.persist_pass_through_columns", "macro.dbt.type_int", "macro.dbt_utils.generate_surrogate_key", "macro.dbt.date_trunc"], "nodes": ["model.iterable.int_iterable__list_user_history"]}, "compiled_path": "target/compiled/iterable/models/intermediate/int_iterable__list_user_unnest.sql", "compiled": true, "compiled_code": "\n\nwith user_history as (\n\n select *\n from \"postgres\".\"public_iterable_dev\".\"int_iterable__list_user_history\" as user_history\n\n \n \n where user_history.updated_at >= coalesce((select min(updated_at) from \"postgres\".\"public_iterable_dev\".\"int_iterable__list_user_unnest\" where is_current), '2010-01-01')\n \n\n\n), unnest_email_array as (\n\n select\n source_relation,\n _fivetran_user_id,\n unique_user_key,\n email,\n first_name,\n last_name,\n user_id,\n signup_date,\n signup_source,\n phone_number,\n updated_at,\n is_current,\n email_list_ids,\n case when email_list_ids != '[]' then\n email_list_id \n else null\n end as email_list_id\n\n --The below script allows for pass through columns.\n \n\n\n\n\n\n from user_history\n\n \n cross join\n json_array_elements_text(cast((\n case when email_list_ids = '[]' then '[\"is_null\"]' \n else email_list_ids end) as json)) as email_list_id), adjust_nulls as (\n\n select\n source_relation,\n _fivetran_user_id,\n unique_user_key,\n email,\n first_name,\n last_name,\n user_id,\n signup_date,\n signup_source,\n updated_at,\n phone_number,\n is_current,\n case when email_list_ids = '[\"is_null\"]' then '[]' else email_list_ids end as email_list_ids,\n cast(NULLIF(email_list_id, 'is_null') as integer) as list_id\n\n --The below script allows for pass through columns.\n \n\n\n\n\n\n from unnest_email_array\n\n), final as (\n\n select\n source_relation,\n _fivetran_user_id,\n unique_user_key,\n user_id,\n email,\n first_name,\n last_name,\n signup_date,\n signup_source,\n updated_at,\n phone_number,\n is_current,\n email_list_ids,\n list_id,\n md5(cast(coalesce(cast(source_relation as TEXT), '_dbt_utils_surrogate_key_null_') || '-' || coalesce(cast(unique_user_key as TEXT), '_dbt_utils_surrogate_key_null_') || '-' || coalesce(cast(list_id as TEXT), '_dbt_utils_surrogate_key_null_') || '-' || coalesce(cast(updated_at as TEXT), '_dbt_utils_surrogate_key_null_') as TEXT)) as unique_key,\n cast( date_trunc('day', updated_at) as date) as date_day\n\n --The below script allows for pass through columns.\n \n\n\n\n\n\n from adjust_nulls\n)\n\nselect *\nfrom final", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.int_iterable__latest_template": {"database": "postgres", "schema": "public_iterable_dev", "name": "int_iterable__latest_template", "resource_type": "model", "package_name": "iterable", "path": "intermediate/int_iterable__latest_template.sql", "original_file_path": "models/intermediate/int_iterable__latest_template.sql", "unique_id": "model.iterable.int_iterable__latest_template", "fqn": ["iterable", "intermediate", "int_iterable__latest_template"], "alias": "int_iterable__latest_template", "checksum": {"name": "sha256", "checksum": "44d385d803b47bd9be4b5bfc6d78b88689e9c113d478ba8feb96f91717f45b3b"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "Table that provides the most recent version of the template as well as joining relevant message type information.", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "iterable://models/intermediate/int_iterable.yml", "build_path": null, "unrendered_config": {"materialized": "view", "schema": "iterable_{{ var('directed_schema','dev') }}", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789079004.2965682, "relation_name": "\"postgres\".\"public_iterable_dev\".\"int_iterable__latest_template\"", "raw_code": "with template_history as (\n select *\n from {{ ref('stg_iterable__template_history') }}\n\n), order_template as (\n select\n *,\n row_number() over(partition by template_id{{ fivetran_utils.partition_by_source_relation(package_name='iterable') }} order by updated_at desc) as latest_template_index\n from template_history\n\n), latest_template as (\n\n select *\n from order_template\n where latest_template_index = 1\n\n), message_type_channel as (\n\n select *\n from {{ ref('int_iterable__message_type_channel') }}\n\n), template_join as (\n\n select \n latest_template.*,\n message_type_channel.message_type_name,\n message_type_channel.channel_id,\n message_type_channel.channel_name,\n message_type_channel.channel_type,\n message_type_channel.message_medium\n\n from latest_template \n left join message_type_channel\n on latest_template.message_type_id = message_type_channel.message_type_id\n and latest_template.source_relation = message_type_channel.source_relation\n)\n\nselect *\nfrom template_join", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__template_history", "package": null, "version": null}, {"name": "int_iterable__message_type_channel", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.fivetran_utils.partition_by_source_relation"], "nodes": ["model.iterable.stg_iterable__template_history", "model.iterable.int_iterable__message_type_channel"]}, "compiled_path": "target/compiled/iterable/models/intermediate/int_iterable__latest_template.sql", "compiled": true, "compiled_code": "with template_history as (\n select *\n from \"postgres\".\"public_iterable_dev\".\"stg_iterable__template_history\"\n\n), order_template as (\n select\n *,\n row_number() over(partition by template_id order by updated_at desc) as latest_template_index\n from template_history\n\n), latest_template as (\n\n select *\n from order_template\n where latest_template_index = 1\n\n), message_type_channel as (\n\n select *\n from \"postgres\".\"public_iterable_dev\".\"int_iterable__message_type_channel\"\n\n), template_join as (\n\n select \n latest_template.*,\n message_type_channel.message_type_name,\n message_type_channel.channel_id,\n message_type_channel.channel_name,\n message_type_channel.channel_type,\n message_type_channel.message_medium\n\n from latest_template \n left join message_type_channel\n on latest_template.message_type_id = message_type_channel.message_type_id\n and latest_template.source_relation = message_type_channel.source_relation\n)\n\nselect *\nfrom template_join", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.int_iterable__campaign_event_metrics": {"database": "postgres", "schema": "public_iterable_dev", "name": "int_iterable__campaign_event_metrics", "resource_type": "model", "package_name": "iterable", "path": "intermediate/int_iterable__campaign_event_metrics.sql", "original_file_path": "models/intermediate/int_iterable__campaign_event_metrics.sql", "unique_id": "model.iterable.int_iterable__campaign_event_metrics", "fqn": ["iterable", "intermediate", "int_iterable__campaign_event_metrics"], "alias": "int_iterable__campaign_event_metrics", "checksum": {"name": "sha256", "checksum": "81038e93b6f7f8151fb0d719780a87ebc5bd95b613431564e7c470121a174e26"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "Table that generates relevant total and unique campaign/experiment level aggregations.", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "iterable://models/intermediate/int_iterable.yml", "build_path": null, "unrendered_config": {"materialized": "view", "schema": "iterable_{{ var('directed_schema','dev') }}", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789079004.2950556, "relation_name": "\"postgres\".\"public_iterable_dev\".\"int_iterable__campaign_event_metrics\"", "raw_code": "with user_campaign as (\n select *\n from {{ ref('iterable__user_campaign') }}\n\n), campaign_user_event_metrics as (\n{%- set using_event_extension = var('iterable__using_event_extension', True) %}\n{%- set user_campaign_columns = adapter.get_columns_in_relation(ref('iterable__user_campaign')) %}\n{%- set non_agg_columns = ['source_relation', 'unique_user_key', 'user_id', '_fivetran_user_id', \n 'user_email', 'user_full_name', 'campaign_id', 'campaign_name', 'recurring_campaign_id', \n 'recurring_campaign_name', 'first_event_at', 'last_event_at', 'template_id', 'template_name', \n 'experiment_id', 'unique_user_campaign_id', 'first_open_or_click_event_at'\n ] %}\n\n select\n source_relation,\n campaign_id,\n template_id\n {{ \", experiment_id\" if using_event_extension }}\n , count(distinct unique_user_key) as count_unique_users\n {% for col in user_campaign_columns if col.name|lower not in non_agg_columns %}\n , sum({{ col.name }}) as {{ col.name }}\n , count(distinct case when {{ col.name }} > 0 then user_email else null end) as unique_{{ col.name }}\n {% endfor %}\n \n from user_campaign\n \n {{ dbt_utils.group_by(n=4 if using_event_extension else 3) }}\n)\n\nselect *\nfrom campaign_user_event_metrics", "doc_blocks": [], "language": "sql", "refs": [{"name": "iterable__user_campaign", "package": null, "version": null}, {"name": "iterable__user_campaign", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt_utils.group_by"], "nodes": ["model.iterable.iterable__user_campaign"]}, "compiled_path": "target/compiled/iterable/models/intermediate/int_iterable__campaign_event_metrics.sql", "compiled": true, "compiled_code": "with user_campaign as (\n select *\n from \"postgres\".\"public_iterable_dev\".\"iterable__user_campaign\"\n\n), campaign_user_event_metrics as (\n\n select\n source_relation,\n campaign_id,\n template_id\n , experiment_id\n , count(distinct unique_user_key) as count_unique_users\n \n , sum(total_emailclick) as total_emailclick\n , count(distinct case when total_emailclick > 0 then user_email else null end) as unique_total_emailclick\n \n , sum(total_emailunsubscribe) as total_emailunsubscribe\n , count(distinct case when total_emailunsubscribe > 0 then user_email else null end) as unique_total_emailunsubscribe\n \n , sum(total_emailcomplaint) as total_emailcomplaint\n , count(distinct case when total_emailcomplaint > 0 then user_email else null end) as unique_total_emailcomplaint\n \n , sum(total_customevent) as total_customevent\n , count(distinct case when total_customevent > 0 then user_email else null end) as unique_total_customevent\n \n , sum(total_emailsubscribe) as total_emailsubscribe\n , count(distinct case when total_emailsubscribe > 0 then user_email else null end) as unique_total_emailsubscribe\n \n , sum(total_emailopen) as total_emailopen\n , count(distinct case when total_emailopen > 0 then user_email else null end) as unique_total_emailopen\n \n , sum(total_pushsend) as total_pushsend\n , count(distinct case when total_pushsend > 0 then user_email else null end) as unique_total_pushsend\n \n , sum(total_smsbounce) as total_smsbounce\n , count(distinct case when total_smsbounce > 0 then user_email else null end) as unique_total_smsbounce\n \n , sum(total_pushbounce) as total_pushbounce\n , count(distinct case when total_pushbounce > 0 then user_email else null end) as unique_total_pushbounce\n \n , sum(total_inappsendskip) as total_inappsendskip\n , count(distinct case when total_inappsendskip > 0 then user_email else null end) as unique_total_inappsendskip\n \n , sum(total_smssend) as total_smssend\n , count(distinct case when total_smssend > 0 then user_email else null end) as unique_total_smssend\n \n , sum(total_inappsend) as total_inappsend\n , count(distinct case when total_inappsend > 0 then user_email else null end) as unique_total_inappsend\n \n , sum(total_pushopen) as total_pushopen\n , count(distinct case when total_pushopen > 0 then user_email else null end) as unique_total_pushopen\n \n , sum(total_emailsend) as total_emailsend\n , count(distinct case when total_emailsend > 0 then user_email else null end) as unique_total_emailsend\n \n , sum(total_pushsendskip) as total_pushsendskip\n , count(distinct case when total_pushsendskip > 0 then user_email else null end) as unique_total_pushsendskip\n \n , sum(total_inappopen) as total_inappopen\n , count(distinct case when total_inappopen > 0 then user_email else null end) as unique_total_inappopen\n \n , sum(total_emailsendskip) as total_emailsendskip\n , count(distinct case when total_emailsendskip > 0 then user_email else null end) as unique_total_emailsendskip\n \n , sum(total_emailbounce) as total_emailbounce\n , count(distinct case when total_emailbounce > 0 then user_email else null end) as unique_total_emailbounce\n \n , sum(total_inappclick) as total_inappclick\n , count(distinct case when total_inappclick > 0 then user_email else null end) as unique_total_inappclick\n \n , sum(total_pushuninstall) as total_pushuninstall\n , count(distinct case when total_pushuninstall > 0 then user_email else null end) as unique_total_pushuninstall\n \n \n from user_campaign\n \n group by 1,2,3,4\n)\n\nselect *\nfrom campaign_user_event_metrics", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.int_iterable__campaign_lists": {"database": "postgres", "schema": "public_iterable_dev", "name": "int_iterable__campaign_lists", "resource_type": "model", "package_name": "iterable", "path": "intermediate/int_iterable__campaign_lists.sql", "original_file_path": "models/intermediate/int_iterable__campaign_lists.sql", "unique_id": "model.iterable.int_iterable__campaign_lists", "fqn": ["iterable", "intermediate", "int_iterable__campaign_lists"], "alias": "int_iterable__campaign_lists", "checksum": {"name": "sha256", "checksum": "33c167f12bf4fadb7316af985f2b60ee9989ade1a428d684037465d1a449685e"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "Table that identifies the suppressed and send lists associated with a campaign.", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "iterable://models/intermediate/int_iterable.yml", "build_path": null, "unrendered_config": {"materialized": "view", "schema": "iterable_{{ var('directed_schema','dev') }}", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789079004.2956827, "relation_name": "\"postgres\".\"public_iterable_dev\".\"int_iterable__campaign_lists\"", "raw_code": "with \n\n{% if var('iterable__using_campaign_suppression_list_history', True) %}\n\ncampaign_suppression_list_history as (\n\n select *\n from {{ ref('stg_iterable__campaign_suppression_list_history') }}\n\n), \n\n{% endif %}\n\ncampaign_send_list_history as (\n\n select *\n from {{ ref('stg_iterable__campaign_list_history') }}\n\n), combine_list_histories as (\n\n{% if var('iterable__using_campaign_suppression_list_history', True) %}\n\n select\n source_relation,\n suppressed_list_id as list_id,\n campaign_id,\n updated_at,\n 'suppress' as list_activity\n from campaign_suppression_list_history\n\n union all\n\n{% endif %}\n\n select\n source_relation,\n list_id,\n campaign_id,\n updated_at,\n 'send' as list_activity\n from campaign_send_list_history\n\n), order_campaign_list_history as (\n\n select\n *,\n row_number() over(partition by list_id, campaign_id{{ fivetran_utils.partition_by_source_relation(package_name='iterable') }} order by updated_at desc) as latest_list_index\n from combine_list_histories\n\n), latest_campaign_list_history as (\n\n select\n source_relation,\n list_id,\n campaign_id,\n updated_at,\n list_activity\n\n from order_campaign_list_history\n where latest_list_index = 1\n)\n\nselect *\nfrom latest_campaign_list_history", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__campaign_suppression_list_history", "package": null, "version": null}, {"name": "stg_iterable__campaign_list_history", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.fivetran_utils.partition_by_source_relation"], "nodes": ["model.iterable.stg_iterable__campaign_suppression_list_history", "model.iterable.stg_iterable__campaign_list_history"]}, "compiled_path": "target/compiled/iterable/models/intermediate/int_iterable__campaign_lists.sql", "compiled": true, "compiled_code": "with \n\n\n\ncampaign_suppression_list_history as (\n\n select *\n from \"postgres\".\"public_iterable_dev\".\"stg_iterable__campaign_suppression_list_history\"\n\n), \n\n\n\ncampaign_send_list_history as (\n\n select *\n from \"postgres\".\"public_iterable_dev\".\"stg_iterable__campaign_list_history\"\n\n), combine_list_histories as (\n\n\n\n select\n source_relation,\n suppressed_list_id as list_id,\n campaign_id,\n updated_at,\n 'suppress' as list_activity\n from campaign_suppression_list_history\n\n union all\n\n\n\n select\n source_relation,\n list_id,\n campaign_id,\n updated_at,\n 'send' as list_activity\n from campaign_send_list_history\n\n), order_campaign_list_history as (\n\n select\n *,\n row_number() over(partition by list_id, campaign_id order by updated_at desc) as latest_list_index\n from combine_list_histories\n\n), latest_campaign_list_history as (\n\n select\n source_relation,\n list_id,\n campaign_id,\n updated_at,\n list_activity\n\n from order_campaign_list_history\n where latest_list_index = 1\n)\n\nselect *\nfrom latest_campaign_list_history", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.int_iterable__recurring_campaigns": {"database": "postgres", "schema": "public_iterable_dev", "name": "int_iterable__recurring_campaigns", "resource_type": "model", "package_name": "iterable", "path": "intermediate/int_iterable__recurring_campaigns.sql", "original_file_path": "models/intermediate/int_iterable__recurring_campaigns.sql", "unique_id": "model.iterable.int_iterable__recurring_campaigns", "fqn": ["iterable", "intermediate", "int_iterable__recurring_campaigns"], "alias": "int_iterable__recurring_campaigns", "checksum": {"name": "sha256", "checksum": "177c12b9779cfd975d0de322b8ccfc36bdecb1f509262c02ca1c8cb7035926d8"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "Table that identifies when a campaign is associated with a recurring campaign and provides additional enriched recurring campaign information.", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "iterable://models/intermediate/int_iterable.yml", "build_path": null, "unrendered_config": {"materialized": "view", "schema": "iterable_{{ var('directed_schema','dev') }}", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789079004.297988, "relation_name": "\"postgres\".\"public_iterable_dev\".\"int_iterable__recurring_campaigns\"", "raw_code": "with latest_campaign as (\n\n select * \n from {{ ref('int_iterable__latest_campaign') }}\n\n), recurring_campaign_join as (\n select\n latest_campaign.source_relation,\n latest_campaign.campaign_id,\n latest_campaign.campaign_name,\n latest_campaign.updated_at,\n latest_campaign.campaign_state,\n latest_campaign.campaign_type,\n latest_campaign.send_size,\n latest_campaign.start_at,\n latest_campaign.ended_at,\n latest_campaign.created_at,\n latest_campaign.created_by_user_id,\n latest_campaign.template_id,\n latest_campaign.recurring_campaign_id,\n {% if var('iterable__using_journey', true) %}\n -- cast to string so this matches journey_id in stg_iterable__journey; workflow_id arrives\n -- numeric from campaign_history but as a string from event_extension\n cast(latest_campaign.workflow_id as {{ dbt.type_string() }}) as journey_id,\n {% endif %}\n\n recurring_campaign.campaign_name as recurring_campaign_name,\n recurring_campaign.campaign_state as recurring_campaign_state,\n recurring_campaign.send_size as recurring_campaign_send_size,\n recurring_campaign.start_at as recurring_campaign_start_at\n\n from latest_campaign\n\n left join latest_campaign as recurring_campaign\n on latest_campaign.recurring_campaign_id = recurring_campaign.campaign_id\n and latest_campaign.source_relation = recurring_campaign.source_relation\n\n), final as (\n\n select\n recurring_campaign_join.*,\n case when latest_campaign.recurring_campaign_id is not null then true \n else false end as is_campaign_recurring\n\n from recurring_campaign_join\n left join latest_campaign on recurring_campaign_join.campaign_id = latest_campaign.recurring_campaign_id\n and recurring_campaign_join.template_id = latest_campaign.template_id\n and recurring_campaign_join.source_relation = latest_campaign.source_relation\n)\n\nselect *\nfrom final", "doc_blocks": [], "language": "sql", "refs": [{"name": "int_iterable__latest_campaign", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.type_string"], "nodes": ["model.iterable.int_iterable__latest_campaign"]}, "compiled_path": "target/compiled/iterable/models/intermediate/int_iterable__recurring_campaigns.sql", "compiled": true, "compiled_code": "with latest_campaign as (\n\n select * \n from \"postgres\".\"public_iterable_dev\".\"int_iterable__latest_campaign\"\n\n), recurring_campaign_join as (\n select\n latest_campaign.source_relation,\n latest_campaign.campaign_id,\n latest_campaign.campaign_name,\n latest_campaign.updated_at,\n latest_campaign.campaign_state,\n latest_campaign.campaign_type,\n latest_campaign.send_size,\n latest_campaign.start_at,\n latest_campaign.ended_at,\n latest_campaign.created_at,\n latest_campaign.created_by_user_id,\n latest_campaign.template_id,\n latest_campaign.recurring_campaign_id,\n \n -- cast to string so this matches journey_id in stg_iterable__journey; workflow_id arrives\n -- numeric from campaign_history but as a string from event_extension\n cast(latest_campaign.workflow_id as TEXT) as journey_id,\n \n\n recurring_campaign.campaign_name as recurring_campaign_name,\n recurring_campaign.campaign_state as recurring_campaign_state,\n recurring_campaign.send_size as recurring_campaign_send_size,\n recurring_campaign.start_at as recurring_campaign_start_at\n\n from latest_campaign\n\n left join latest_campaign as recurring_campaign\n on latest_campaign.recurring_campaign_id = recurring_campaign.campaign_id\n and latest_campaign.source_relation = recurring_campaign.source_relation\n\n), final as (\n\n select\n recurring_campaign_join.*,\n case when latest_campaign.recurring_campaign_id is not null then true \n else false end as is_campaign_recurring\n\n from recurring_campaign_join\n left join latest_campaign on recurring_campaign_join.campaign_id = latest_campaign.recurring_campaign_id\n and recurring_campaign_join.template_id = latest_campaign.template_id\n and recurring_campaign_join.source_relation = latest_campaign.source_relation\n)\n\nselect *\nfrom final", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.int_iterable__list_user_history": {"database": "postgres", "schema": "public_iterable_dev", "name": "int_iterable__list_user_history", "resource_type": "model", "package_name": "iterable", "path": "intermediate/int_iterable__list_user_history.sql", "original_file_path": "models/intermediate/int_iterable__list_user_history.sql", "unique_id": "model.iterable.int_iterable__list_user_history", "fqn": ["iterable", "intermediate", "int_iterable__list_user_history"], "alias": "int_iterable__list_user_history", "checksum": {"name": "sha256", "checksum": "26b2bd189944dfea25bb63edf9e3da03a3e8169e3501b894716e8d1f8e1df5a0"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "table", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "Table that provides a history of all lists the user has been associated with.", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "iterable://models/intermediate/int_iterable.yml", "build_path": null, "unrendered_config": {"materialized": "table", "schema": "iterable_{{ var('directed_schema','dev') }}", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789079004.297139, "relation_name": "\"postgres\".\"public_iterable_dev\".\"int_iterable__list_user_history\"", "raw_code": "-- this model will serve to extract only email-list changes\nwith user_history as (\n\n select *\n from {{ ref('stg_iterable__user_history') }}\n\n), previous_email_list_ids as (\n\n select\n *,\n lag(email_list_ids) over(partition by unique_user_key{{ fivetran_utils.partition_by_source_relation(package_name='iterable') }} order by updated_at asc) as previous_ids -- partition by email instead of unique_user_key here since this model is only for email-list users\n\n from user_history\n\n), only_new_email_list_ids as (\n\n select\n source_relation,\n _fivetran_user_id,\n unique_user_key,\n user_id,\n email,\n first_name,\n last_name,\n email_list_ids,\n phone_number,\n signup_date,\n signup_source,\n updated_at\n\n --The below script allows for pass through columns.\n {{ fivetran_utils.persist_pass_through_columns(pass_through_variable='iterable_user_history_pass_through_columns', identifier='previous_email_list_ids') }}\n\n from previous_email_list_ids\n where email_list_ids != coalesce(previous_ids, 'this is new') -- list ids are always stored in their arrays in numerical order\n\n), most_recent_list_ids as (\n\n select\n *,\n row_number() over(partition by email{{ fivetran_utils.partition_by_source_relation(package_name='iterable') }} order by updated_at desc) as latest_user_index\n\n from only_new_email_list_ids\n\n), final as (\n\n select\n source_relation,\n _fivetran_user_id,\n unique_user_key,\n email,\n user_id,\n first_name,\n last_name,\n email_list_ids,\n phone_number,\n signup_date,\n signup_source,\n updated_at,\n latest_user_index = 1 as is_current\n\n --The below script allows for pass through columns.\n {{ fivetran_utils.persist_pass_through_columns(pass_through_variable='iterable_user_history_pass_through_columns', identifier='most_recent_list_ids') }}\n\n from most_recent_list_ids\n)\n\nselect * from final", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__user_history", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.fivetran_utils.partition_by_source_relation", "macro.fivetran_utils.persist_pass_through_columns"], "nodes": ["model.iterable.stg_iterable__user_history"]}, "compiled_path": "target/compiled/iterable/models/intermediate/int_iterable__list_user_history.sql", "compiled": true, "compiled_code": "-- this model will serve to extract only email-list changes\nwith user_history as (\n\n select *\n from \"postgres\".\"public_iterable_dev\".\"stg_iterable__user_history\"\n\n), previous_email_list_ids as (\n\n select\n *,\n lag(email_list_ids) over(partition by unique_user_key order by updated_at asc) as previous_ids -- partition by email instead of unique_user_key here since this model is only for email-list users\n\n from user_history\n\n), only_new_email_list_ids as (\n\n select\n source_relation,\n _fivetran_user_id,\n unique_user_key,\n user_id,\n email,\n first_name,\n last_name,\n email_list_ids,\n phone_number,\n signup_date,\n signup_source,\n updated_at\n\n --The below script allows for pass through columns.\n \n\n\n\n\n\n from previous_email_list_ids\n where email_list_ids != coalesce(previous_ids, 'this is new') -- list ids are always stored in their arrays in numerical order\n\n), most_recent_list_ids as (\n\n select\n *,\n row_number() over(partition by email order by updated_at desc) as latest_user_index\n\n from only_new_email_list_ids\n\n), final as (\n\n select\n source_relation,\n _fivetran_user_id,\n unique_user_key,\n email,\n user_id,\n first_name,\n last_name,\n email_list_ids,\n phone_number,\n signup_date,\n signup_source,\n updated_at,\n latest_user_index = 1 as is_current\n\n --The below script allows for pass through columns.\n \n\n\n\n\n\n from most_recent_list_ids\n)\n\nselect * from final", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.int_iterable__message_type_channel": {"database": "postgres", "schema": "public_iterable_dev", "name": "int_iterable__message_type_channel", "resource_type": "model", "package_name": "iterable", "path": "intermediate/int_iterable__message_type_channel.sql", "original_file_path": "models/intermediate/int_iterable__message_type_channel.sql", "unique_id": "model.iterable.int_iterable__message_type_channel", "fqn": ["iterable", "intermediate", "int_iterable__message_type_channel"], "alias": "int_iterable__message_type_channel", "checksum": {"name": "sha256", "checksum": "9f54e0a46c508fbe16514b8e598ee614b3462649f85582b5513905f6392d728d"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "Table that joins the message type and channel records together into one comprehensive model to be referenced downstream.", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "iterable://models/intermediate/int_iterable.yml", "build_path": null, "unrendered_config": {"materialized": "view", "schema": "iterable_{{ var('directed_schema','dev') }}", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789079004.297692, "relation_name": "\"postgres\".\"public_iterable_dev\".\"int_iterable__message_type_channel\"", "raw_code": "with message_type as (\n\n select *\n from {{ ref('stg_iterable__message_type') }}\n\n), channel as (\n\n select *\n from {{ ref('stg_iterable__channel') }}\n\n), final as (\n\n select \n channel.*,\n message_type.message_type_name,\n message_type.message_type_id\n from channel\n left join message_type\n on channel.channel_id = message_type.channel_id\n and channel.source_relation = message_type.source_relation\n)\n\nselect *\nfrom final", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__message_type", "package": null, "version": null}, {"name": "stg_iterable__channel", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": [], "nodes": ["model.iterable.stg_iterable__message_type", "model.iterable.stg_iterable__channel"]}, "compiled_path": "target/compiled/iterable/models/intermediate/int_iterable__message_type_channel.sql", "compiled": true, "compiled_code": "with message_type as (\n\n select *\n from \"postgres\".\"public_iterable_dev\".\"stg_iterable__message_type\"\n\n), channel as (\n\n select *\n from \"postgres\".\"public_iterable_dev\".\"stg_iterable__channel\"\n\n), final as (\n\n select \n channel.*,\n message_type.message_type_name,\n message_type.message_type_id\n from channel\n left join message_type\n on channel.channel_id = message_type.channel_id\n and channel.source_relation = message_type.source_relation\n)\n\nselect *\nfrom final", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.int_iterable__user_event_metrics": {"database": "postgres", "schema": "public_iterable_dev", "name": "int_iterable__user_event_metrics", "resource_type": "model", "package_name": "iterable", "path": "intermediate/int_iterable__user_event_metrics.sql", "original_file_path": "models/intermediate/int_iterable__user_event_metrics.sql", "unique_id": "model.iterable.int_iterable__user_event_metrics", "fqn": ["iterable", "intermediate", "int_iterable__user_event_metrics"], "alias": "int_iterable__user_event_metrics", "checksum": {"name": "sha256", "checksum": "56af49e00fd9cad13663d8bf802187ff1d12561fb1fd9d3732d182703b34ca4d"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "Table that generates user aggregations at the campaign level.", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "iterable://models/intermediate/int_iterable.yml", "build_path": null, "unrendered_config": {"materialized": "view", "schema": "iterable_{{ var('directed_schema','dev') }}", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789079004.2982738, "relation_name": "\"postgres\".\"public_iterable_dev\".\"int_iterable__user_event_metrics\"", "raw_code": "with user_campaign as (\n\n select *\n from {{ ref('iterable__user_campaign') }}\n\n), user_event_metrics as (\n\n{%- set user_campaign_columns = adapter.get_columns_in_relation(ref('iterable__user_campaign')) %}\n{%- set non_agg_columns = ['source_relation', 'unique_user_key', 'user_id', '_fivetran_user_id', \n 'user_email', 'user_full_name', 'campaign_id', 'campaign_name', 'recurring_campaign_id', \n 'recurring_campaign_name', 'first_event_at', 'last_event_at', 'template_id', 'template_name', \n 'experiment_id', 'unique_user_campaign_id', 'first_open_or_click_event_at'\n ] %}\n\n select\n source_relation,\n _fivetran_user_id,\n unique_user_key,\n user_id,\n user_email,\n count(distinct campaign_id) as count_total_campaigns,\n min(first_event_at) as first_event_at,\n max(last_event_at) as last_event_at\n\n {% for col in user_campaign_columns if col.name|lower not in non_agg_columns %}\n , sum({{ col.name }}) as {{ col.name }}\n {% endfor %}\n\n from user_campaign\n {{ dbt_utils.group_by(n=5) }}\n\n)\n\nselect *\nfrom user_event_metrics", "doc_blocks": [], "language": "sql", "refs": [{"name": "iterable__user_campaign", "package": null, "version": null}, {"name": "iterable__user_campaign", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt_utils.group_by"], "nodes": ["model.iterable.iterable__user_campaign"]}, "compiled_path": "target/compiled/iterable/models/intermediate/int_iterable__user_event_metrics.sql", "compiled": true, "compiled_code": "with user_campaign as (\n\n select *\n from \"postgres\".\"public_iterable_dev\".\"iterable__user_campaign\"\n\n), user_event_metrics as (\n\n select\n source_relation,\n _fivetran_user_id,\n unique_user_key,\n user_id,\n user_email,\n count(distinct campaign_id) as count_total_campaigns,\n min(first_event_at) as first_event_at,\n max(last_event_at) as last_event_at\n\n \n , sum(total_emailclick) as total_emailclick\n \n , sum(total_emailunsubscribe) as total_emailunsubscribe\n \n , sum(total_emailcomplaint) as total_emailcomplaint\n \n , sum(total_customevent) as total_customevent\n \n , sum(total_emailsubscribe) as total_emailsubscribe\n \n , sum(total_emailopen) as total_emailopen\n \n , sum(total_pushsend) as total_pushsend\n \n , sum(total_smsbounce) as total_smsbounce\n \n , sum(total_pushbounce) as total_pushbounce\n \n , sum(total_inappsendskip) as total_inappsendskip\n \n , sum(total_smssend) as total_smssend\n \n , sum(total_inappsend) as total_inappsend\n \n , sum(total_pushopen) as total_pushopen\n \n , sum(total_emailsend) as total_emailsend\n \n , sum(total_pushsendskip) as total_pushsendskip\n \n , sum(total_inappopen) as total_inappopen\n \n , sum(total_emailsendskip) as total_emailsendskip\n \n , sum(total_emailbounce) as total_emailbounce\n \n , sum(total_inappclick) as total_inappclick\n \n , sum(total_pushuninstall) as total_pushuninstall\n \n\n from user_campaign\n group by 1,2,3,4,5\n\n)\n\nselect *\nfrom user_event_metrics", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.int_iterable__latest_user": {"database": "postgres", "schema": "public_iterable_dev", "name": "int_iterable__latest_user", "resource_type": "model", "package_name": "iterable", "path": "intermediate/int_iterable__latest_user.sql", "original_file_path": "models/intermediate/int_iterable__latest_user.sql", "unique_id": "model.iterable.int_iterable__latest_user", "fqn": ["iterable", "intermediate", "int_iterable__latest_user"], "alias": "int_iterable__latest_user", "checksum": {"name": "sha256", "checksum": "580070cfbe396b904d0dc15669eefe5b9f017005d0aa91aa2c3d96b4e4686e81"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "Table that filters out historical versions of the user, and returns only the most recent version.", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "iterable://models/intermediate/int_iterable.yml", "build_path": null, "unrendered_config": {"materialized": "view", "schema": "iterable_{{ var('directed_schema','dev') }}", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789079004.2968426, "relation_name": "\"postgres\".\"public_iterable_dev\".\"int_iterable__latest_user\"", "raw_code": "with user_history as (\n select *\n from {{ ref('stg_iterable__user_history') }}\n\n), latest_user as (\n select\n *,\n row_number() over(partition by unique_user_key{{ fivetran_utils.partition_by_source_relation(package_name='iterable') }} order by updated_at desc) as latest_user_index\n from user_history\n)\n\nselect *\nfrom latest_user\nwhere latest_user_index = 1", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__user_history", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.fivetran_utils.partition_by_source_relation"], "nodes": ["model.iterable.stg_iterable__user_history"]}, "compiled_path": "target/compiled/iterable/models/intermediate/int_iterable__latest_user.sql", "compiled": true, "compiled_code": "with user_history as (\n select *\n from \"postgres\".\"public_iterable_dev\".\"stg_iterable__user_history\"\n\n), latest_user as (\n select\n *,\n row_number() over(partition by unique_user_key order by updated_at desc) as latest_user_index\n from user_history\n)\n\nselect *\nfrom latest_user\nwhere latest_user_index = 1", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.int_iterable__latest_campaign": {"database": "postgres", "schema": "public_iterable_dev", "name": "int_iterable__latest_campaign", "resource_type": "model", "package_name": "iterable", "path": "intermediate/int_iterable__latest_campaign.sql", "original_file_path": "models/intermediate/int_iterable__latest_campaign.sql", "unique_id": "model.iterable.int_iterable__latest_campaign", "fqn": ["iterable", "intermediate", "int_iterable__latest_campaign"], "alias": "int_iterable__latest_campaign", "checksum": {"name": "sha256", "checksum": "8063c9ccdfe6dee1694944607534fbb31bafe2856073ac2f5ea58aa513714e4f"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "Table that filters out historical versions of the campaign, and returns the most recent campaign version.", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "iterable://models/intermediate/int_iterable.yml", "build_path": null, "unrendered_config": {"materialized": "view", "schema": "iterable_{{ var('directed_schema','dev') }}", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789079004.2962873, "relation_name": "\"postgres\".\"public_iterable_dev\".\"int_iterable__latest_campaign\"", "raw_code": "with campaign_history as (\n select *\n from {{ ref('stg_iterable__campaign_history') }}\n\n), latest_campaign as (\n select\n *,\n row_number() over(partition by campaign_id{{ fivetran_utils.partition_by_source_relation(package_name='iterable') }} order by updated_at desc) as latest_campaign_index\n from campaign_history\n)\n\nselect *\nfrom latest_campaign\nwhere latest_campaign_index = 1", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__campaign_history", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.fivetran_utils.partition_by_source_relation"], "nodes": ["model.iterable.stg_iterable__campaign_history"]}, "compiled_path": "target/compiled/iterable/models/intermediate/int_iterable__latest_campaign.sql", "compiled": true, "compiled_code": "with campaign_history as (\n select *\n from \"postgres\".\"public_iterable_dev\".\"stg_iterable__campaign_history\"\n\n), latest_campaign as (\n select\n *,\n row_number() over(partition by campaign_id order by updated_at desc) as latest_campaign_index\n from campaign_history\n)\n\nselect *\nfrom latest_campaign\nwhere latest_campaign_index = 1", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.stg_iterable__message_type": {"database": "postgres", "schema": "public_iterable_dev", "name": "stg_iterable__message_type", "resource_type": "model", "package_name": "iterable", "path": "staging/stg_iterable__message_type.sql", "original_file_path": "models/staging/stg_iterable__message_type.sql", "unique_id": "model.iterable.stg_iterable__message_type", "fqn": ["iterable", "staging", "stg_iterable__message_type"], "alias": "stg_iterable__message_type", "checksum": {"name": "sha256", "checksum": "046caf2bcc8a01dd2b8ef46a5dfb52e02b8bebe01e892de5d658910c97d5e6a4"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "table", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "Table containing unique message types.", "columns": {"source_relation": {"name": "source_relation", "description": "Identifies the record's source.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": ["doc.iterable.source_relation"]}, "message_type_id": {"name": "message_type_id", "description": "Unique identifier of the message type", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "message_type_name": {"name": "message_type_name", "description": "User defined name of the message type", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "channel_id": {"name": "channel_id", "description": "Channel that this message type belongs to", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "message_type_created_at": {"name": "message_type_created_at", "description": "Time when the message type was initially created", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "frequency_cap": {"name": "frequency_cap", "description": "The maximum number of times a message of this type can be sent to a recipient within a specified time period to prevent over-messaging", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "rate_limit_per_minute": {"name": "rate_limit_per_minute", "description": "The maximum number of messages of this type that can be sent to recipients in a minute, ensuring controlled message delivery", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "subscription_policy": {"name": "subscription_policy", "description": "Information about the policy or rules governing how users can subscribe to or unsubscribe from this specific message type, like OptOut", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "message_type_updated_at": {"name": "message_type_updated_at", "description": "Time when the message type was last updated or modified", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "The time when a record was last updated by Fivetran.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": ["doc.iterable._fivetran_synced"]}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "iterable://models/staging/stg_iterable.yml", "build_path": null, "unrendered_config": {"materialized": "table", "schema": "iterable_{{ var('directed_schema','dev') }}", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789079004.3078182, "relation_name": "\"postgres\".\"public_iterable_dev\".\"stg_iterable__message_type\"", "raw_code": "with base as (\n\n select * \n from {{ ref('stg_iterable__message_type_tmp') }}\n\n),\n\nfields as (\n\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_iterable/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_iterable/macros/).\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_iterable__message_type_tmp')),\n staging_columns=get_message_type_columns()\n )\n }}\n {{ fivetran_utils.apply_source_relation(package_name='iterable') }}\n\n from base\n),\n\nfinal as (\n\n select\n source_relation,\n cast(id as {{ dbt.type_string() }} ) as message_type_id,\n name as message_type_name,\n cast(channel_id as {{ dbt.type_string() }} ) as channel_id,\n created_at as message_type_created_at,\n frequency_cap,\n rate_limit_per_minute,\n subscription_policy,\n updated_at as message_type_updated_at,\n _fivetran_synced\n from fields\n where not coalesce(_fivetran_deleted, true)\n)\n\nselect * \nfrom final", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__message_type_tmp", "package": null, "version": null}, {"name": "stg_iterable__message_type_tmp", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.iterable.get_message_type_columns", "macro.fivetran_utils.fill_staging_columns", "macro.fivetran_utils.apply_source_relation", "macro.dbt.type_string"], "nodes": ["model.iterable.stg_iterable__message_type_tmp"]}, "compiled_path": "target/compiled/iterable/models/staging/stg_iterable__message_type.sql", "compiled": true, "compiled_code": "with base as (\n\n select * \n from \"postgres\".\"public_iterable_dev\".\"stg_iterable__message_type_tmp\"\n\n),\n\nfields as (\n\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_iterable/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_iterable/macros/).\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n \n _fivetran_deleted as _fivetran_deleted,\n _fivetran_synced as _fivetran_synced,\n channel_id as channel_id,\n id as id,\n name as name,\n created_at as created_at,\n frequency_cap as frequency_cap,\n rate_limit_per_minute as rate_limit_per_minute,\n subscription_policy as subscription_policy,\n updated_at as updated_at\n \n\n\n\n\n \n \n\n\n\n\n\n, cast('postgres.public' as TEXT) as source_relation\n\n\n from base\n),\n\nfinal as (\n\n select\n source_relation,\n cast(id as TEXT ) as message_type_id,\n name as message_type_name,\n cast(channel_id as TEXT ) as channel_id,\n created_at as message_type_created_at,\n frequency_cap,\n rate_limit_per_minute,\n subscription_policy,\n updated_at as message_type_updated_at,\n _fivetran_synced\n from fields\n where not coalesce(_fivetran_deleted, true)\n)\n\nselect * \nfrom final", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.stg_iterable__event": {"database": "postgres", "schema": "public_iterable_dev", "name": "stg_iterable__event", "resource_type": "model", "package_name": "iterable", "path": "staging/stg_iterable__event.sql", "original_file_path": "models/staging/stg_iterable__event.sql", "unique_id": "model.iterable.stg_iterable__event", "fqn": ["iterable", "staging", "stg_iterable__event"], "alias": "stg_iterable__event", "checksum": {"name": "sha256", "checksum": "22ba2d21012d8301984a6fcea5b9f40f9579f5565aaea7417f7458f6fd37937b"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "Table containing individual events within campaigns.", "columns": {"source_relation": {"name": "source_relation", "description": "Identifies the record's source.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": ["doc.iterable.source_relation"]}, "event_id": {"name": "event_id", "description": "A Fivetran-created unique identifier derived from hashing campaign_id, created_at, and event_name.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_event_id": {"name": "unique_event_id", "description": "A surrogate key made up of event_id, _fivetran_user_id, and source_relation.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "campaign_id": {"name": "campaign_id", "description": "Reference to the campaign from which the event originated", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "content_id": {"name": "content_id", "description": "Reference to the content the event is associated with", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "created_at": {"name": "created_at", "description": "Creation timestamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "created_on": {"name": "created_on", "description": "Creation date", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "email": {"name": "email", "description": "Reference to the unique user the event was applied to", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "additional_properties": {"name": "additional_properties", "description": "json object containing addition event properties", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "event_name": {"name": "event_name", "description": "Name provided to the individual event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "message_bus_id": {"name": "message_bus_id", "description": "Reference to the message bus associated with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "message_id": {"name": "message_id", "description": "Reference to the message the event is associated with", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "message_type_id": {"name": "message_type_id", "description": "Reference to the type of message the event is associated with", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "recipient_state": {"name": "recipient_state", "description": "The state of the recipient upon receiving the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "status": {"name": "status", "description": "Status of the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "transactional_data": {"name": "transactional_data", "description": "Transactional data associated with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unsub_source": {"name": "unsub_source", "description": "Source of the unsubscribe event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "user_agent": {"name": "user_agent", "description": "User agent associated with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "user_agent_device": {"name": "user_agent_device", "description": "The device of the user agent", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "_fivetran_user_id": {"name": "_fivetran_user_id", "description": "A Fivetran-created unique identifier for users, derived from hashing user_id and/or email, depending on project type. This exists for users of the new schema starting Aug 2023. In the old schema, the unique identifier is email.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_user_key": {"name": "unique_user_key", "description": "The unique identifier of the user. With the new schema (Aug 2023), it is the _fivetran_user_id. This is a hash of user_id and/or email, depending on project type. If using the old schema, it is email.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "The time when a record was last updated by Fivetran.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": ["doc.iterable._fivetran_synced"]}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "iterable://models/staging/stg_iterable.yml", "build_path": null, "unrendered_config": {"materialized": "view", "schema": "iterable_{{ var('directed_schema','dev') }}", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789079004.3031285, "relation_name": "\"postgres\".\"public_iterable_dev\".\"stg_iterable__event\"", "raw_code": "{{ config( materialized = 'view' ) }}\n\nwith base as (\n\n select * \n from {{ ref('stg_iterable__event_tmp') }}\n\n),\n\nfields as (\n\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_iterable/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_iterable/macros/).\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_iterable__event_tmp')),\n staging_columns=get_event_columns()\n )\n }}\n {{ fivetran_utils.apply_source_relation(package_name='iterable') }}\n \n from base\n),\n\nfinal as (\n\n select\n source_relation,\n cast(_fivetran_id as {{ dbt.type_string() }} ) as event_id,\n {{ dbt_utils.generate_surrogate_key(['_fivetran_id','_fivetran_user_id','source_relation']) }} as unique_event_id,\n cast(_fivetran_user_id as {{ dbt.type_string() }} ) as _fivetran_user_id,\n coalesce(cast(_fivetran_user_id as {{ dbt.type_string() }} ) , email) as unique_user_key,\n cast(campaign_id as {{ dbt.type_string() }} ) as campaign_id,\n cast(content_id as {{ dbt.type_string() }} ) as content_id,\n created_at,\n cast( {{ dbt.date_trunc('day', 'created_at') }} as date) as created_on,\n lower(email) as email,\n additional_properties,\n event_name,\n cast(message_bus_id as {{ dbt.type_string() }} ) as message_bus_id,\n cast(message_id as {{ dbt.type_string() }} ) as message_id,\n cast(message_type_id as {{ dbt.type_string() }} ) as message_type_id,\n recipient_state,\n status,\n transactional_data,\n unsub_source,\n user_agent,\n user_agent_device,\n _fivetran_synced\n\n from fields\n)\n\nselect *\nfrom final", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__event_tmp", "package": null, "version": null}, {"name": "stg_iterable__event_tmp", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.iterable.get_event_columns", "macro.fivetran_utils.fill_staging_columns", "macro.fivetran_utils.apply_source_relation", "macro.dbt.type_string", "macro.dbt_utils.generate_surrogate_key", "macro.dbt.date_trunc"], "nodes": ["model.iterable.stg_iterable__event_tmp"]}, "compiled_path": "target/compiled/iterable/models/staging/stg_iterable__event.sql", "compiled": true, "compiled_code": "\n\nwith base as (\n\n select * \n from \"postgres\".\"public_iterable_dev\".\"stg_iterable__event_tmp\"\n\n),\n\nfields as (\n\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_iterable/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_iterable/macros/).\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n \n _fivetran_id as _fivetran_id,\n _fivetran_user_id as _fivetran_user_id,\n _fivetran_synced as _fivetran_synced,\n campaign_id as campaign_id,\n content_id as content_id,\n created_at as created_at,\n email as email,\n event_name as event_name,\n message_bus_id as message_bus_id,\n message_id as message_id,\n message_type_id as message_type_id,\n recipient_state as recipient_state,\n status as status,\n unsub_source as unsub_source,\n user_agent as user_agent,\n user_agent_device as user_agent_device,\n transactional_data as transactional_data,\n additional_properties as additional_properties\n \n\n\n\n\n \n \n\n\n\n\n\n, cast('postgres.public' as TEXT) as source_relation\n\n \n from base\n),\n\nfinal as (\n\n select\n source_relation,\n cast(_fivetran_id as TEXT ) as event_id,\n md5(cast(coalesce(cast(_fivetran_id as TEXT), '_dbt_utils_surrogate_key_null_') || '-' || coalesce(cast(_fivetran_user_id as TEXT), '_dbt_utils_surrogate_key_null_') || '-' || coalesce(cast(source_relation as TEXT), '_dbt_utils_surrogate_key_null_') as TEXT)) as unique_event_id,\n cast(_fivetran_user_id as TEXT ) as _fivetran_user_id,\n coalesce(cast(_fivetran_user_id as TEXT ) , email) as unique_user_key,\n cast(campaign_id as TEXT ) as campaign_id,\n cast(content_id as TEXT ) as content_id,\n created_at,\n cast( date_trunc('day', created_at) as date) as created_on,\n lower(email) as email,\n additional_properties,\n event_name,\n cast(message_bus_id as TEXT ) as message_bus_id,\n cast(message_id as TEXT ) as message_id,\n cast(message_type_id as TEXT ) as message_type_id,\n recipient_state,\n status,\n transactional_data,\n unsub_source,\n user_agent,\n user_agent_device,\n _fivetran_synced\n\n from fields\n)\n\nselect *\nfrom final", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.stg_iterable__user_unsubscribed_channel": {"database": "postgres", "schema": "public_iterable_dev", "name": "stg_iterable__user_unsubscribed_channel", "resource_type": "model", "package_name": "iterable", "path": "staging/stg_iterable__user_unsubscribed_channel.sql", "original_file_path": "models/staging/stg_iterable__user_unsubscribed_channel.sql", "unique_id": "model.iterable.stg_iterable__user_unsubscribed_channel", "fqn": ["iterable", "staging", "stg_iterable__user_unsubscribed_channel"], "alias": "stg_iterable__user_unsubscribed_channel", "checksum": {"name": "sha256", "checksum": "5c639597d14f4bb7072df74e39c2b8aaa7bf1e29c6204243035014d14a0bc6f2"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "table", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "Table containing the history of channels from which a user has unsubscribed.", "columns": {"source_relation": {"name": "source_relation", "description": "Identifies the record's source.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": ["doc.iterable.source_relation"]}, "channel_id": {"name": "channel_id", "description": "Reference to the channel from which the user unsubscribed", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unsub_channel_unique_key": {"name": "unsub_channel_unique_key", "description": "A surrogate key providing a unique key for each record. If using user_unsubscribed_channel_history, it uses '_fivetran_id', 'channel_id', 'email', 'updated_at', and 'source_relation'. If not using the history table, it uses '_fivetran_id', 'channel_id', and 'source_relation'.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "_fivetran_user_id": {"name": "_fivetran_user_id", "description": "A Fivetran-created unique identifier for users, derived from hashing user_id and/or email, depending on project type. This exists for users of the new schema starting Aug 2023. In the old schema, the unique identifier is email.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_user_key": {"name": "unique_user_key", "description": "The unique identifier of the user. With the new schema (Aug 2023), it is the _fivetran_user_id. This is a hash of user_id and/or email, depending on project type. If using the old schema, it is email.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "latest_batch_index": {"name": "latest_batch_index", "description": "Indexes each user record based on the most recent available.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "updated_at": {"name": "updated_at", "description": "Last update timestamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "The time when a record was last updated by Fivetran.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": ["doc.iterable._fivetran_synced"]}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "iterable://models/staging/stg_iterable.yml", "build_path": null, "unrendered_config": {"materialized": "table", "schema": "iterable_{{ var('directed_schema','dev') }}", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789079004.3115592, "relation_name": "\"postgres\".\"public_iterable_dev\".\"stg_iterable__user_unsubscribed_channel\"", "raw_code": "with base as (\n select *\n from {{ ref('stg_iterable__user_unsubscribed_channel_tmp') }}\n\n),\n\nfields as (\n\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_iterable/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_iterable/macros/).\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_iterable__user_unsubscribed_channel_tmp')),\n staging_columns=get_user_unsubscribed_channel_columns()\n )\n }}\n {{ fivetran_utils.apply_source_relation(package_name='iterable') }}\n\n from base\n),\n\nfinal as (\n\n select\n source_relation,\n cast(_fivetran_id as {{ dbt.type_string() }} ) as _fivetran_user_id,\n coalesce(cast(_fivetran_id as {{ dbt.type_string() }} ), email) as unique_user_key,\n cast(channel_id as {{ dbt.type_string() }} ) as channel_id,\n {{ dbt_utils.generate_surrogate_key(['_fivetran_id', 'channel_id', 'email', 'updated_at', 'source_relation']) }} as unsub_channel_unique_key,\n\n {% if does_table_exist('user_unsubscribed_channel') == false %}\n rank() over(partition by email, channel_id{{ fivetran_utils.partition_by_source_relation(package_name='iterable') }} order by updated_at desc) as latest_batch_index,\n {% else %}\n 1 as latest_batch_index,\n {% endif %}\n\n updated_at,\n _fivetran_synced\n\n from fields\n)\n\n\nselect *\nfrom final", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__user_unsubscribed_channel_tmp", "package": null, "version": null}, {"name": "stg_iterable__user_unsubscribed_channel_tmp", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.iterable.get_user_unsubscribed_channel_columns", "macro.fivetran_utils.fill_staging_columns", "macro.fivetran_utils.apply_source_relation", "macro.dbt.type_string", "macro.dbt_utils.generate_surrogate_key", "macro.iterable.does_table_exist"], "nodes": ["model.iterable.stg_iterable__user_unsubscribed_channel_tmp"]}, "compiled_path": "target/compiled/iterable/models/staging/stg_iterable__user_unsubscribed_channel.sql", "compiled": true, "compiled_code": "with base as (\n select *\n from \"postgres\".\"public_iterable_dev\".\"stg_iterable__user_unsubscribed_channel_tmp\"\n\n),\n\nfields as (\n\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_iterable/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_iterable/macros/).\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n \n _fivetran_synced as _fivetran_synced,\n _fivetran_id as _fivetran_id,\n channel_id as channel_id,\n cast(null as TEXT) as email,\n cast(null as timestamp) as updated_at\n \n\n\n\n\n \n \n\n\n\n\n\n, cast('postgres.public' as TEXT) as source_relation\n\n\n from base\n),\n\nfinal as (\n\n select\n source_relation,\n cast(_fivetran_id as TEXT ) as _fivetran_user_id,\n coalesce(cast(_fivetran_id as TEXT ), email) as unique_user_key,\n cast(channel_id as TEXT ) as channel_id,\n md5(cast(coalesce(cast(_fivetran_id as TEXT), '_dbt_utils_surrogate_key_null_') || '-' || coalesce(cast(channel_id as TEXT), '_dbt_utils_surrogate_key_null_') || '-' || coalesce(cast(email as TEXT), '_dbt_utils_surrogate_key_null_') || '-' || coalesce(cast(updated_at as TEXT), '_dbt_utils_surrogate_key_null_') || '-' || coalesce(cast(source_relation as TEXT), '_dbt_utils_surrogate_key_null_') as TEXT)) as unsub_channel_unique_key,\n\n \n 1 as latest_batch_index,\n \n\n updated_at,\n _fivetran_synced\n\n from fields\n)\n\n\nselect *\nfrom final", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.stg_iterable__campaign_history": {"database": "postgres", "schema": "public_iterable_dev", "name": "stg_iterable__campaign_history", "resource_type": "model", "package_name": "iterable", "path": "staging/stg_iterable__campaign_history.sql", "original_file_path": "models/staging/stg_iterable__campaign_history.sql", "unique_id": "model.iterable.stg_iterable__campaign_history", "fqn": ["iterable", "staging", "stg_iterable__campaign_history"], "alias": "stg_iterable__campaign_history", "checksum": {"name": "sha256", "checksum": "7e7aecc134f0b697da58c7cd663aadf6de586a55c84369c2a7274811b2bb368b"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "table", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "Table containing a history of campaigns.", "columns": {"source_relation": {"name": "source_relation", "description": "Identifies the record's source.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": ["doc.iterable.source_relation"]}, "campaign_id": {"name": "campaign_id", "description": "Unique identifier of the campaign record", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "updated_at": {"name": "updated_at", "description": "Last update timestamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "campaign_name": {"name": "campaign_name", "description": "User defined name of the campaign.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "campaign_state": {"name": "campaign_state", "description": "State of the campaign. Can be Draft, Ready, Scheduled, Running, Finished, Starting, Aborted or Recurring", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "campaign_type": {"name": "campaign_type", "description": "The campaign type. Can be Blast or Triggered", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "send_size": {"name": "send_size", "description": "Size of the campaign. Number of individuals included in the campaign", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "start_at": {"name": "start_at", "description": "Start timestamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "ended_at": {"name": "ended_at", "description": "Ended timestamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "created_at": {"name": "created_at", "description": "Creation timestamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "recurring_campaign_id": {"name": "recurring_campaign_id", "description": "Reference to the recurring campaign, if applicable", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "created_by_user_id": {"name": "created_by_user_id", "description": "Reference to the user who created the campaign", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "template_id": {"name": "template_id", "description": "Reference to the campaign template", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "updated_by_user_id": {"name": "updated_by_user_id", "description": "ID of the user who updated this record", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "message_medium": {"name": "message_medium", "description": "The medium that this message was sent via, for example Email or InApp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "workflow_id": {"name": "workflow_id", "description": "Reference to the workflow which the event originated", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "The time when a record was last updated by Fivetran.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": ["doc.iterable._fivetran_synced"]}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "iterable://models/staging/stg_iterable.yml", "build_path": null, "unrendered_config": {"materialized": "table", "schema": "iterable_{{ var('directed_schema','dev') }}", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789079004.2995934, "relation_name": "\"postgres\".\"public_iterable_dev\".\"stg_iterable__campaign_history\"", "raw_code": "with base as (\n\n select * \n from {{ ref('stg_iterable__campaign_history_tmp') }}\n\n),\n\nfields as (\n\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_iterable/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_iterable/macros/).\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_iterable__campaign_history_tmp')),\n staging_columns=get_campaign_history_columns()\n )\n }}\n {{ fivetran_utils.apply_source_relation(package_name='iterable') }}\n \n from base\n),\n\nfinal as (\n\n select\n source_relation,\n cast(id as {{ dbt.type_string() }}) as campaign_id,\n updated_at,\n name as campaign_name,\n campaign_state,\n type as campaign_type,\n send_size,\n start_at,\n ended_at,\n created_at,\n message_medium,\n cast(recurring_campaign_id as {{ dbt.type_string() }}) as recurring_campaign_id,\n cast(created_by_user_id as {{ dbt.type_string() }} ) as created_by_user_id,\n cast(updated_by_user_id as {{ dbt.type_string() }} ) as updated_by_user_id,\n cast(template_id as {{ dbt.type_string() }}) as template_id,\n workflow_id,\n _fivetran_synced\n\n from fields\n)\n\nselect * \nfrom final", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__campaign_history_tmp", "package": null, "version": null}, {"name": "stg_iterable__campaign_history_tmp", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.iterable.get_campaign_history_columns", "macro.fivetran_utils.fill_staging_columns", "macro.fivetran_utils.apply_source_relation", "macro.dbt.type_string"], "nodes": ["model.iterable.stg_iterable__campaign_history_tmp"]}, "compiled_path": "target/compiled/iterable/models/staging/stg_iterable__campaign_history.sql", "compiled": true, "compiled_code": "with base as (\n\n select * \n from \"postgres\".\"public_iterable_dev\".\"stg_iterable__campaign_history_tmp\"\n\n),\n\nfields as (\n\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_iterable/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_iterable/macros/).\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n \n _fivetran_synced as _fivetran_synced,\n campaign_state as campaign_state,\n created_at as created_at,\n created_by_user_id as created_by_user_id,\n updated_by_user_id as updated_by_user_id,\n ended_at as ended_at,\n id as id,\n name as name,\n recurring_campaign_id as recurring_campaign_id,\n send_size as send_size,\n start_at as start_at,\n template_id as template_id,\n type as type,\n updated_at as updated_at,\n workflow_id as workflow_id,\n message_medium as message_medium\n \n\n\n\n\n \n \n\n\n\n\n\n, cast('postgres.public' as TEXT) as source_relation\n\n \n from base\n),\n\nfinal as (\n\n select\n source_relation,\n cast(id as TEXT) as campaign_id,\n updated_at,\n name as campaign_name,\n campaign_state,\n type as campaign_type,\n send_size,\n start_at,\n ended_at,\n created_at,\n message_medium,\n cast(recurring_campaign_id as TEXT) as recurring_campaign_id,\n cast(created_by_user_id as TEXT ) as created_by_user_id,\n cast(updated_by_user_id as TEXT ) as updated_by_user_id,\n cast(template_id as TEXT) as template_id,\n workflow_id,\n _fivetran_synced\n\n from fields\n)\n\nselect * \nfrom final", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.stg_iterable__campaign_label_history": {"database": "postgres", "schema": "public_iterable_dev", "name": "stg_iterable__campaign_label_history", "resource_type": "model", "package_name": "iterable", "path": "staging/stg_iterable__campaign_label_history.sql", "original_file_path": "models/staging/stg_iterable__campaign_label_history.sql", "unique_id": "model.iterable.stg_iterable__campaign_label_history", "fqn": ["iterable", "staging", "stg_iterable__campaign_label_history"], "alias": "stg_iterable__campaign_label_history", "checksum": {"name": "sha256", "checksum": "2001c425039c576063482caa3d4a72f39c5cd8aff32ffee63f083977f1f0c35f"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "table", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "Table containing a history of labels.", "columns": {"source_relation": {"name": "source_relation", "description": "Identifies the record's source.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": ["doc.iterable.source_relation"]}, "campaign_id": {"name": "campaign_id", "description": "Reference to the campaign associated with the label", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "label": {"name": "label", "description": "Name of the label", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "updated_at": {"name": "updated_at", "description": "Last update timestamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "The time when a record was last updated by Fivetran.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": ["doc.iterable._fivetran_synced"]}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "iterable://models/staging/stg_iterable.yml", "build_path": null, "unrendered_config": {"materialized": "table", "schema": "iterable_{{ var('directed_schema','dev') }}", "enabled": "var('iterable__using_campaign_label_history', True)", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789079004.3003542, "relation_name": "\"postgres\".\"public_iterable_dev\".\"stg_iterable__campaign_label_history\"", "raw_code": "{{ config(enabled=var('iterable__using_campaign_label_history', True)) }}\n\nwith base as (\n\n select * \n from {{ ref('stg_iterable__campaign_label_history_tmp') }}\n\n),\n\nfields as (\n\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_iterable/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_iterable/macros/).\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_iterable__campaign_label_history_tmp')),\n staging_columns=get_campaign_label_history_columns()\n )\n }}\n {{ fivetran_utils.apply_source_relation(package_name='iterable') }}\n \n from base\n),\n\nfinal as (\n\n select\n source_relation,\n cast(campaign_id as {{ dbt.type_string() }}) as campaign_id,\n label,\n updated_at,\n _fivetran_synced\n from fields\n)\n\nselect * \nfrom final", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__campaign_label_history_tmp", "package": null, "version": null}, {"name": "stg_iterable__campaign_label_history_tmp", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.iterable.get_campaign_label_history_columns", "macro.fivetran_utils.fill_staging_columns", "macro.fivetran_utils.apply_source_relation", "macro.dbt.type_string"], "nodes": ["model.iterable.stg_iterable__campaign_label_history_tmp"]}, "compiled_path": "target/compiled/iterable/models/staging/stg_iterable__campaign_label_history.sql", "compiled": true, "compiled_code": "\n\nwith base as (\n\n select * \n from \"postgres\".\"public_iterable_dev\".\"stg_iterable__campaign_label_history_tmp\"\n\n),\n\nfields as (\n\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_iterable/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_iterable/macros/).\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n \n _fivetran_synced as _fivetran_synced,\n campaign_id as campaign_id,\n label as label,\n updated_at as updated_at\n \n\n\n\n\n \n \n\n\n\n\n\n, cast('postgres.public' as TEXT) as source_relation\n\n \n from base\n),\n\nfinal as (\n\n select\n source_relation,\n cast(campaign_id as TEXT) as campaign_id,\n label,\n updated_at,\n _fivetran_synced\n from fields\n)\n\nselect * \nfrom final", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.stg_iterable__template_history": {"database": "postgres", "schema": "public_iterable_dev", "name": "stg_iterable__template_history", "resource_type": "model", "package_name": "iterable", "path": "staging/stg_iterable__template_history.sql", "original_file_path": "models/staging/stg_iterable__template_history.sql", "unique_id": "model.iterable.stg_iterable__template_history", "fqn": ["iterable", "staging", "stg_iterable__template_history"], "alias": "stg_iterable__template_history", "checksum": {"name": "sha256", "checksum": "f0eaf9d44d7959a04ba079cbf711646772487aeafc89414b097dd5f230b44910"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "table", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "Table containing unique templates used across campaigns.", "columns": {"source_relation": {"name": "source_relation", "description": "Identifies the record's source.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": ["doc.iterable.source_relation"]}, "template_id": {"name": "template_id", "description": "Unique identifier of the template", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "template_name": {"name": "template_name", "description": "User defined name of the template", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "template_type": {"name": "template_type", "description": "The type of the template", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "created_at": {"name": "created_at", "description": "Creation timestamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "client_template_id": {"name": "client_template_id", "description": "Reference to the client template", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "creator_user_id": {"name": "creator_user_id", "description": "Reference to the user who created the template", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "message_type_id": {"name": "message_type_id", "description": "Reference to the message type associated with the template", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "updated_at": {"name": "updated_at", "description": "Last update timestamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "The time when a record was last updated by Fivetran.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": ["doc.iterable._fivetran_synced"]}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "iterable://models/staging/stg_iterable.yml", "build_path": null, "unrendered_config": {"materialized": "table", "schema": "iterable_{{ var('directed_schema','dev') }}", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789079004.3088174, "relation_name": "\"postgres\".\"public_iterable_dev\".\"stg_iterable__template_history\"", "raw_code": "with base as (\n\n select * \n from {{ ref('stg_iterable__template_history_tmp') }}\n\n),\n\nfields as (\n\n select\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_iterable__template_history_tmp')),\n staging_columns=get_template_history_columns()\n )\n }}\n {{ fivetran_utils.apply_source_relation(package_name='iterable') }}\n\n from base\n),\n\nfinal as (\n\n select\n source_relation,\n cast(id as {{ dbt.type_string() }} ) as template_id,\n name as template_name,\n template_type,\n created_at,\n cast(client_template_id as {{ dbt.type_string() }} ) as client_template_id,\n cast(creator_user_id as {{ dbt.type_string() }} ) as creator_user_id,\n cast(message_type_id as {{ dbt.type_string() }} ) as message_type_id,\n updated_at,\n _fivetran_synced\n from fields\n)\n\nselect * \nfrom final", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__template_history_tmp", "package": null, "version": null}, {"name": "stg_iterable__template_history_tmp", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.iterable.get_template_history_columns", "macro.fivetran_utils.fill_staging_columns", "macro.fivetran_utils.apply_source_relation", "macro.dbt.type_string"], "nodes": ["model.iterable.stg_iterable__template_history_tmp"]}, "compiled_path": "target/compiled/iterable/models/staging/stg_iterable__template_history.sql", "compiled": true, "compiled_code": "with base as (\n\n select * \n from \"postgres\".\"public_iterable_dev\".\"stg_iterable__template_history_tmp\"\n\n),\n\nfields as (\n\n select\n \n _fivetran_synced as _fivetran_synced,\n client_template_id as client_template_id,\n created_at as created_at,\n creator_user_id as creator_user_id,\n id as id,\n message_type_id as message_type_id,\n name as name,\n template_type as template_type,\n updated_at as updated_at\n \n\n\n\n\n \n \n\n\n\n\n\n, cast('postgres.public' as TEXT) as source_relation\n\n\n from base\n),\n\nfinal as (\n\n select\n source_relation,\n cast(id as TEXT ) as template_id,\n name as template_name,\n template_type,\n created_at,\n cast(client_template_id as TEXT ) as client_template_id,\n cast(creator_user_id as TEXT ) as creator_user_id,\n cast(message_type_id as TEXT ) as message_type_id,\n updated_at,\n _fivetran_synced\n from fields\n)\n\nselect * \nfrom final", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.stg_iterable__journey": {"database": "postgres", "schema": "public_iterable_dev", "name": "stg_iterable__journey", "resource_type": "model", "package_name": "iterable", "path": "staging/stg_iterable__journey.sql", "original_file_path": "models/staging/stg_iterable__journey.sql", "unique_id": "model.iterable.stg_iterable__journey", "fqn": ["iterable", "staging", "stg_iterable__journey"], "alias": "stg_iterable__journey", "checksum": {"name": "sha256", "checksum": "d53993c3137351b54f560a3e0194593ea0d2787d328e2bc6cfe13977b35a3906"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "table", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "Table containing unique journeys, formerly known as workflows.", "columns": {"source_relation": {"name": "source_relation", "description": "Identifies the record's source.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": ["doc.iterable.source_relation"]}, "journey_id": {"name": "journey_id", "description": "Unique identifier of the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "journey_name": {"name": "journey_name", "description": "User defined name of the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "journey_type": {"name": "journey_type", "description": "The journey type", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "journey_description": {"name": "journey_description", "description": "Information about the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "creator_user_id": {"name": "creator_user_id", "description": "Reference to the user who created the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "is_enabled": {"name": "is_enabled", "description": "Boolean indicating if the journey is currently enabled", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "is_archived": {"name": "is_archived", "description": "Boolean indicating if the journey has been archived", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "lifetime_limit": {"name": "lifetime_limit", "description": "Maximum number of times a user may enter the journey over their lifetime", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "simultaneous_limit": {"name": "simultaneous_limit", "description": "Maximum number of times a user may be in the journey at the same time", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "start_tile_id": {"name": "start_tile_id", "description": "Reference to the tile which begins the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "trigger_event_names": {"name": "trigger_event_names", "description": "The event names which trigger a user's entry into the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "created_at": {"name": "created_at", "description": "Creation timestamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "updated_at": {"name": "updated_at", "description": "Last update timestamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "The time when a record was last updated by Fivetran.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": ["doc.iterable._fivetran_synced"]}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "iterable://models/staging/stg_iterable.yml", "build_path": null, "unrendered_config": {"materialized": "table", "schema": "iterable_{{ var('directed_schema','dev') }}", "enabled": "var('iterable__using_journey', True)", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789079004.305471, "relation_name": "\"postgres\".\"public_iterable_dev\".\"stg_iterable__journey\"", "raw_code": "{{ config(enabled=var('iterable__using_journey', True)) }}\n\n{% set source_columns_in_relation = adapter.get_columns_in_relation(ref('stg_iterable__journey_tmp')) %}\n\nwith base as (\n\n select *\n from {{ ref('stg_iterable__journey_tmp') }}\n\n),\n\nfields as (\n\n select\n\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=source_columns_in_relation,\n staging_columns=get_journey_columns()\n )\n }}\n {{ fivetran_utils.apply_source_relation(package_name='iterable') }}\n\n from base\n),\n\nfinal as (\n\n select\n source_relation,\n cast(id as {{ dbt.type_string() }} ) as journey_id,\n name as journey_name,\n journey_type,\n description as journey_description,\n cast(creator_user_id as {{ dbt.type_string() }} ) as creator_user_id,\n enabled as is_enabled,\n is_archived,\n lifetime_limit,\n simultaneous_limit,\n cast(start_tile_id as {{ dbt.type_string() }} ) as start_tile_id,\n {{ iterable.json_to_string(\"trigger_event_names\", source_columns_in_relation) }} as trigger_event_names,\n created_at,\n updated_at,\n _fivetran_synced\n\n --The below script allows for pass through columns.\n {{ fivetran_utils.fill_pass_through_columns('iterable_journey_pass_through_columns') }}\n\n from fields\n where not coalesce(_fivetran_deleted, false)\n)\n\nselect *\nfrom final", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__journey_tmp", "package": null, "version": null}, {"name": "stg_iterable__journey_tmp", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.iterable.get_journey_columns", "macro.fivetran_utils.fill_staging_columns", "macro.fivetran_utils.apply_source_relation", "macro.dbt.type_string", "macro.iterable.json_to_string", "macro.fivetran_utils.fill_pass_through_columns"], "nodes": ["model.iterable.stg_iterable__journey_tmp"]}, "compiled_path": "target/compiled/iterable/models/staging/stg_iterable__journey.sql", "compiled": true, "compiled_code": "\n\n\n\nwith base as (\n\n select *\n from \"postgres\".\"public_iterable_dev\".\"stg_iterable__journey_tmp\"\n\n),\n\nfields as (\n\n select\n\n \n cast(null as boolean) as _fivetran_deleted,\n cast(null as timestamp) as _fivetran_synced,\n cast(null as timestamp) as created_at,\n cast(null as TEXT) as creator_user_id,\n cast(null as TEXT) as description,\n cast(null as boolean) as enabled,\n cast(null as integer) as id,\n cast(null as boolean) as is_archived,\n cast(null as TEXT) as journey_type,\n cast(null as integer) as lifetime_limit,\n cast(null as TEXT) as name,\n cast(null as integer) as simultaneous_limit,\n cast(null as integer) as start_tile_id,\n cast(null as TEXT) as trigger_event_names,\n cast(null as timestamp) as updated_at\n \n\n\n\n\n \n \n\n\n\n\n\n, cast('postgres.public' as TEXT) as source_relation\n\n\n from base\n),\n\nfinal as (\n\n select\n source_relation,\n cast(id as TEXT ) as journey_id,\n name as journey_name,\n journey_type,\n description as journey_description,\n cast(creator_user_id as TEXT ) as creator_user_id,\n enabled as is_enabled,\n is_archived,\n lifetime_limit,\n simultaneous_limit,\n cast(start_tile_id as TEXT ) as start_tile_id,\n cast(trigger_event_names as TEXT) as trigger_event_names,\n created_at,\n updated_at,\n _fivetran_synced\n\n --The below script allows for pass through columns.\n \n\n\n\n\n\n from fields\n where not coalesce(_fivetran_deleted, false)\n)\n\nselect *\nfrom final", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.stg_iterable__user_history": {"database": "postgres", "schema": "public_iterable_dev", "name": "stg_iterable__user_history", "resource_type": "model", "package_name": "iterable", "path": "staging/stg_iterable__user_history.sql", "original_file_path": "models/staging/stg_iterable__user_history.sql", "unique_id": "model.iterable.stg_iterable__user_history", "fqn": ["iterable", "staging", "stg_iterable__user_history"], "alias": "stg_iterable__user_history", "checksum": {"name": "sha256", "checksum": "632b1ddaf71b0cb861ae314c40c6a68a25371b8646d2fa2334c4eb7149227251"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "Table containing individual user history information.", "columns": {"source_relation": {"name": "source_relation", "description": "Identifies the record's source.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": ["doc.iterable.source_relation"]}, "unique_user_key": {"name": "unique_user_key", "description": "The unique identifier of the user. With the new schema (Aug 2023), it is the _fivetran_user_id. This is a hash of user_id and/or email, depending on project type. If using the old schema, it is email.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "email": {"name": "email", "description": "The user's email. User identifier, for email-based projects. Previously was the unique identifier for user records, for the old Iterable schema before the August 2023 updates.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "user_id": {"name": "user_id", "description": "User identifier, for userID-based projects.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "first_name": {"name": "first_name", "description": "First name of the user", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "last_name": {"name": "last_name", "description": "Last name of the user", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "email_list_ids": {"name": "email_list_ids", "description": "[DEPRECATED October 13, 2025. Use LIST_USER source instead.] Array of references to the lists associated with the user.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "signup_date": {"name": "signup_date", "description": "Timestamp of when the user signed up", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "signup_source": {"name": "signup_source", "description": "Source where the user signed up", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "updated_at": {"name": "updated_at", "description": "Last update timestamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "phone_number": {"name": "phone_number", "description": "Phone number associated with the user", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "iterable_user_id": {"name": "iterable_user_id", "description": "Another user identifier, for userID-based projects", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "_fivetran_user_id": {"name": "_fivetran_user_id", "description": "A Fivetran-created unique identifier for users, derived from hashing user_id and/or email, depending on project type. This exists for users of the new schema starting Aug 2023. In the old schema, the unique identifier is email.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "The time when a record was last updated by Fivetran.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": ["doc.iterable._fivetran_synced"]}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "iterable://models/staging/stg_iterable.yml", "build_path": null, "unrendered_config": {"materialized": "view", "schema": "iterable_{{ var('directed_schema','dev') }}", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789079004.3105521, "relation_name": "\"postgres\".\"public_iterable_dev\".\"stg_iterable__user_history\"", "raw_code": "{{ config(materialized='view') }}\n{% set source_columns_in_relation = adapter.get_columns_in_relation(ref('stg_iterable__user_history_tmp')) %}\n\n\nwith base as (\n\n select * \n from {{ ref('stg_iterable__user_history_tmp') }}\n\n),\n\nfields as (\n\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_iterable/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_iterable/macros/).\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=source_columns_in_relation,\n staging_columns=get_user_history_columns()\n )\n }}\n {{ fivetran_utils.apply_source_relation(package_name='iterable') }}\n\n from base\n),\n\nfinal as (\n\n select\n source_relation,\n cast(_fivetran_id as {{ dbt.type_string() }} ) as _fivetran_user_id,\n lower(email) as email,\n updated_at,\n cast(user_id as {{ dbt.type_string() }} ) as user_id,\n first_name,\n last_name,\n {{ iterable.json_to_string(\"email_list_ids\", source_columns_in_relation) }} as email_list_ids,\n phone_number,\n signup_date,\n signup_source,\n cast(iterable_user_id as {{ dbt.type_string() }} ) as iterable_user_id,\n _fivetran_synced,\n coalesce(cast(_fivetran_id as {{ dbt.type_string() }} ) , email) as unique_user_key\n\n {{ fivetran_utils.fill_pass_through_columns('iterable_user_history_pass_through_columns') }}\n\n from fields\n)\n\nselect *\nfrom final", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__user_history_tmp", "package": null, "version": null}, {"name": "stg_iterable__user_history_tmp", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.iterable.get_user_history_columns", "macro.fivetran_utils.fill_staging_columns", "macro.fivetran_utils.apply_source_relation", "macro.dbt.type_string", "macro.iterable.json_to_string", "macro.fivetran_utils.fill_pass_through_columns"], "nodes": ["model.iterable.stg_iterable__user_history_tmp"]}, "compiled_path": "target/compiled/iterable/models/staging/stg_iterable__user_history.sql", "compiled": true, "compiled_code": "\n\n\n\nwith base as (\n\n select * \n from \"postgres\".\"public_iterable_dev\".\"stg_iterable__user_history_tmp\"\n\n),\n\nfields as (\n\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_iterable/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_iterable/macros/).\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n \n cast(null as TEXT) as _fivetran_id,\n _fivetran_synced as _fivetran_synced,\n email as email,\n email_list_ids as email_list_ids,\n first_name as first_name,\n last_name as last_name,\n phone_number as phone_number,\n signup_date as signup_date,\n signup_source as signup_source,\n updated_at as updated_at,\n user_id as user_id,\n iterable_user_id as iterable_user_id\n \n\n\n\n\n \n \n\n\n\n\n\n, cast('postgres.public' as TEXT) as source_relation\n\n\n from base\n),\n\nfinal as (\n\n select\n source_relation,\n cast(_fivetran_id as TEXT ) as _fivetran_user_id,\n lower(email) as email,\n updated_at,\n cast(user_id as TEXT ) as user_id,\n first_name,\n last_name,\n cast(email_list_ids as TEXT) as email_list_ids,\n phone_number,\n signup_date,\n signup_source,\n cast(iterable_user_id as TEXT ) as iterable_user_id,\n _fivetran_synced,\n coalesce(cast(_fivetran_id as TEXT ) , email) as unique_user_key\n\n \n\n\n\n\n\n from fields\n)\n\nselect *\nfrom final", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.stg_iterable__user_unsub_message_type": {"database": "postgres", "schema": "public_iterable_dev", "name": "stg_iterable__user_unsub_message_type", "resource_type": "model", "package_name": "iterable", "path": "staging/stg_iterable__user_unsub_message_type.sql", "original_file_path": "models/staging/stg_iterable__user_unsub_message_type.sql", "unique_id": "model.iterable.stg_iterable__user_unsub_message_type", "fqn": ["iterable", "staging", "stg_iterable__user_unsub_message_type"], "alias": "stg_iterable__user_unsub_message_type", "checksum": {"name": "sha256", "checksum": "82bd48604365ec4a7a3309f2ce007e169add2c902675e5d1da155edc32a6bb71"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "table", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "Table containing the message types from which a user has unsubscribed. \"Unsubscribed\" is shortened to \"unsub\" for postgres compatibility.", "columns": {"source_relation": {"name": "source_relation", "description": "Identifies the record's source.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": ["doc.iterable.source_relation"]}, "message_type_id": {"name": "message_type_id", "description": "Reference to the message type from which the user unsubscribed", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unsub_message_type_unique_key": {"name": "unsub_message_type_unique_key", "description": "A surrogate key providing a unique key for each record. If using user_unsubscribed_message_type_history, it uses '_fivetran_id', 'email', 'message_type_id', 'updated_at', and 'source_relation'. If not using the history table, it uses '_fivetran_id', 'message_type_id', and 'source_relation'.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "_fivetran_user_id": {"name": "_fivetran_user_id", "description": "A Fivetran-created unique identifier for users, derived from hashing user_id and/or email, depending on project type. This exists for users of the new schema starting Aug 2023. In the old schema, the unique identifier is email.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_user_key": {"name": "unique_user_key", "description": "The unique identifier of the user. With the new schema (Aug 2023), it is the _fivetran_user_id. This is a hash of user_id and/or email, depending on project type. If using the old schema, it is email.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "latest_batch_index": {"name": "latest_batch_index", "description": "Indexes each user record based on the most recent available.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "updated_at": {"name": "updated_at", "description": "Last update timestamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "The time when a record was last updated by Fivetran.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": ["doc.iterable._fivetran_synced"]}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "iterable://models/staging/stg_iterable.yml", "build_path": null, "unrendered_config": {"materialized": "table", "schema": "iterable_{{ var('directed_schema','dev') }}", "enabled": "var('iterable__using_user_unsubscribed_message_type', True)", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789079004.3123887, "relation_name": "\"postgres\".\"public_iterable_dev\".\"stg_iterable__user_unsub_message_type\"", "raw_code": "{{ config(enabled=var('iterable__using_user_unsubscribed_message_type', True)) }}\n\nwith base as (\n\n select * \n from {{ ref('stg_iterable__user_unsub_message_type_tmp') }}\n\n),\n\nfields as (\n\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_iterable/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_iterable/macros/).\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_iterable__user_unsub_message_type_tmp')),\n staging_columns=get_user_unsubscribed_message_type_columns()\n )\n }}\n {{ fivetran_utils.apply_source_relation(package_name='iterable') }}\n\n from base\n),\n\nfinal as (\n\n select\n source_relation,\n cast(_fivetran_id as {{ dbt.type_string() }} ) as _fivetran_user_id,\n coalesce(cast(_fivetran_id as {{ dbt.type_string() }} ), email) as unique_user_key,\n cast(message_type_id as {{ dbt.type_string() }} ) as message_type_id,\n {{ dbt_utils.generate_surrogate_key(['_fivetran_id', 'email', 'message_type_id','updated_at','source_relation']) }} as unsub_message_type_unique_key,\n\n {% if does_table_exist('user_unsubscribed_message_type') == false %}\n rank() over(partition by email, message_type_id{{ fivetran_utils.partition_by_source_relation(package_name='iterable') }} order by updated_at desc) as latest_batch_index,\n {% else %}\n 1 as latest_batch_index,\n {% endif %}\n\n updated_at,\n _fivetran_synced\n\n from fields\n)\n\nselect *\nfrom final", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__user_unsub_message_type_tmp", "package": null, "version": null}, {"name": "stg_iterable__user_unsub_message_type_tmp", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.iterable.get_user_unsubscribed_message_type_columns", "macro.fivetran_utils.fill_staging_columns", "macro.fivetran_utils.apply_source_relation", "macro.dbt.type_string", "macro.dbt_utils.generate_surrogate_key", "macro.iterable.does_table_exist"], "nodes": ["model.iterable.stg_iterable__user_unsub_message_type_tmp"]}, "compiled_path": "target/compiled/iterable/models/staging/stg_iterable__user_unsub_message_type.sql", "compiled": true, "compiled_code": "\n\nwith base as (\n\n select * \n from \"postgres\".\"public_iterable_dev\".\"stg_iterable__user_unsub_message_type_tmp\"\n\n),\n\nfields as (\n\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_iterable/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_iterable/macros/).\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n \n _fivetran_synced as _fivetran_synced,\n _fivetran_id as _fivetran_id,\n message_type_id as message_type_id,\n cast(null as TEXT) as email,\n cast(null as timestamp) as updated_at\n \n\n\n\n\n \n \n\n\n\n\n\n, cast('postgres.public' as TEXT) as source_relation\n\n\n from base\n),\n\nfinal as (\n\n select\n source_relation,\n cast(_fivetran_id as TEXT ) as _fivetran_user_id,\n coalesce(cast(_fivetran_id as TEXT ), email) as unique_user_key,\n cast(message_type_id as TEXT ) as message_type_id,\n md5(cast(coalesce(cast(_fivetran_id as TEXT), '_dbt_utils_surrogate_key_null_') || '-' || coalesce(cast(email as TEXT), '_dbt_utils_surrogate_key_null_') || '-' || coalesce(cast(message_type_id as TEXT), '_dbt_utils_surrogate_key_null_') || '-' || coalesce(cast(updated_at as TEXT), '_dbt_utils_surrogate_key_null_') || '-' || coalesce(cast(source_relation as TEXT), '_dbt_utils_surrogate_key_null_') as TEXT)) as unsub_message_type_unique_key,\n\n \n 1 as latest_batch_index,\n \n\n updated_at,\n _fivetran_synced\n\n from fields\n)\n\nselect *\nfrom final", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.stg_iterable__list": {"database": "postgres", "schema": "public_iterable_dev", "name": "stg_iterable__list", "resource_type": "model", "package_name": "iterable", "path": "staging/stg_iterable__list.sql", "original_file_path": "models/staging/stg_iterable__list.sql", "unique_id": "model.iterable.stg_iterable__list", "fqn": ["iterable", "staging", "stg_iterable__list"], "alias": "stg_iterable__list", "checksum": {"name": "sha256", "checksum": "b2a6869e5186282b7f5c8173ecba41c0324c1dc31df78db2418f51f2578eaa21"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "table", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "Table containing users and the lists the users are associated with.", "columns": {"source_relation": {"name": "source_relation", "description": "Identifies the record's source.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": ["doc.iterable.source_relation"]}, "list_id": {"name": "list_id", "description": "Unique identifier of the list", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "list_name": {"name": "list_name", "description": "User defined name of the list", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "list_type": {"name": "list_type", "description": "The list type", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "created_at": {"name": "created_at", "description": "Creation timestamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "list_description": {"name": "list_description", "description": "Information about the list", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "The time when a record was last updated by Fivetran.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": ["doc.iterable._fivetran_synced"]}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "iterable://models/staging/stg_iterable.yml", "build_path": null, "unrendered_config": {"materialized": "table", "schema": "iterable_{{ var('directed_schema','dev') }}", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789079004.3062253, "relation_name": "\"postgres\".\"public_iterable_dev\".\"stg_iterable__list\"", "raw_code": "with base as (\n\n select * \n from {{ ref('stg_iterable__list_tmp') }}\n\n),\n\nfields as (\n\n select\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_iterable__list_tmp')),\n staging_columns=get_list_columns()\n )\n }}\n {{ fivetran_utils.apply_source_relation(package_name='iterable') }}\n \n from base\n),\n\nfinal as (\n\n select\n source_relation,\n id as list_id,\n name as list_name,\n list_type,\n created_at,\n description as list_description,\n _fivetran_synced\n from fields\n where not coalesce(_fivetran_deleted, true)\n)\n\nselect * \nfrom final", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__list_tmp", "package": null, "version": null}, {"name": "stg_iterable__list_tmp", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.iterable.get_list_columns", "macro.fivetran_utils.fill_staging_columns", "macro.fivetran_utils.apply_source_relation"], "nodes": ["model.iterable.stg_iterable__list_tmp"]}, "compiled_path": "target/compiled/iterable/models/staging/stg_iterable__list.sql", "compiled": true, "compiled_code": "with base as (\n\n select * \n from \"postgres\".\"public_iterable_dev\".\"stg_iterable__list_tmp\"\n\n),\n\nfields as (\n\n select\n \n _fivetran_deleted as _fivetran_deleted,\n _fivetran_synced as _fivetran_synced,\n created_at as created_at,\n id as id,\n list_type as list_type,\n description as description,\n name as name\n \n\n\n\n\n \n \n\n\n\n\n\n, cast('postgres.public' as TEXT) as source_relation\n\n \n from base\n),\n\nfinal as (\n\n select\n source_relation,\n id as list_id,\n name as list_name,\n list_type,\n created_at,\n description as list_description,\n _fivetran_synced\n from fields\n where not coalesce(_fivetran_deleted, true)\n)\n\nselect * \nfrom final", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.stg_iterable__list_user": {"database": "postgres", "schema": "public_iterable_dev", "name": "stg_iterable__list_user", "resource_type": "model", "package_name": "iterable", "path": "staging/stg_iterable__list_user.sql", "original_file_path": "models/staging/stg_iterable__list_user.sql", "unique_id": "model.iterable.stg_iterable__list_user", "fqn": ["iterable", "staging", "stg_iterable__list_user"], "alias": "stg_iterable__list_user", "checksum": {"name": "sha256", "checksum": "f3fe66e05562725c91948ac2023c649573560043aa82c03fe93f6232f6600954"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "table", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "Table containing the relationship between users and lists they belong to.", "columns": {"source_relation": {"name": "source_relation", "description": "Identifies the record's source.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": ["doc.iterable.source_relation"]}, "_fivetran_user_id": {"name": "_fivetran_user_id", "description": "Unique identifier of the list-user relationship record, serving as a foreign key to `stg_iterable__user_history._fivetran_id`.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "list_user_index": {"name": "list_user_index", "description": "Index of the record", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "list_id": {"name": "list_id", "description": "Reference to the list that the user belongs to", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "The time when a record was last updated by Fivetran.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": ["doc.iterable._fivetran_synced"]}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "iterable://models/staging/stg_iterable.yml", "build_path": null, "unrendered_config": {"materialized": "table", "schema": "iterable_{{ var('directed_schema','dev') }}", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789079004.3096058, "relation_name": "\"postgres\".\"public_iterable_dev\".\"stg_iterable__list_user\"", "raw_code": "{% set source_columns_in_relation = adapter.get_columns_in_relation(ref('stg_iterable__list_user_tmp')) %}\n\nwith base as (\n\n select *\n from {{ ref('stg_iterable__list_user_tmp') }}\n\n),\n\nfields as (\n\n select\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=source_columns_in_relation,\n staging_columns=get_list_user_columns()\n )\n }}\n {{ fivetran_utils.apply_source_relation(package_name='iterable') }}\n\n from base\n),\n\nfinal as (\n\n select\n source_relation,\n cast(_fivetran_id as {{ dbt.type_string() }} ) as _fivetran_user_id,\n index as list_user_index,\n list_id,\n _fivetran_synced\n\n from fields\n)\n\nselect *\nfrom final", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__list_user_tmp", "package": null, "version": null}, {"name": "stg_iterable__list_user_tmp", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.iterable.get_list_user_columns", "macro.fivetran_utils.fill_staging_columns", "macro.fivetran_utils.apply_source_relation", "macro.dbt.type_string"], "nodes": ["model.iterable.stg_iterable__list_user_tmp"]}, "compiled_path": "target/compiled/iterable/models/staging/stg_iterable__list_user.sql", "compiled": true, "compiled_code": "\n\nwith base as (\n\n select *\n from \"postgres\".\"public_iterable_dev\".\"stg_iterable__list_user_tmp\"\n\n),\n\nfields as (\n\n select\n \n _fivetran_id as _fivetran_id,\n _fivetran_synced as _fivetran_synced,\n index as index,\n list_id as list_id\n \n\n\n\n\n \n \n\n\n\n\n\n, cast('postgres.public' as TEXT) as source_relation\n\n\n from base\n),\n\nfinal as (\n\n select\n source_relation,\n cast(_fivetran_id as TEXT ) as _fivetran_user_id,\n index as list_user_index,\n list_id,\n _fivetran_synced\n\n from fields\n)\n\nselect *\nfrom final", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.stg_iterable__campaign_suppression_list_history": {"database": "postgres", "schema": "public_iterable_dev", "name": "stg_iterable__campaign_suppression_list_history", "resource_type": "model", "package_name": "iterable", "path": "staging/stg_iterable__campaign_suppression_list_history.sql", "original_file_path": "models/staging/stg_iterable__campaign_suppression_list_history.sql", "unique_id": "model.iterable.stg_iterable__campaign_suppression_list_history", "fqn": ["iterable", "staging", "stg_iterable__campaign_suppression_list_history"], "alias": "stg_iterable__campaign_suppression_list_history", "checksum": {"name": "sha256", "checksum": "695d57ff7cf14d55ef6881ee9184e873c2cdc7fd61bfd9fbb0cb3330fe055ae0"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "table", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "Table containing a history of suppression lists.", "columns": {"source_relation": {"name": "source_relation", "description": "Identifies the record's source.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": ["doc.iterable.source_relation"]}, "campaign_id": {"name": "campaign_id", "description": "Reference to the campaign associated with the label", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "suppressed_list_id": {"name": "suppressed_list_id", "description": "Reference to the list used", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "updated_at": {"name": "updated_at", "description": "Last update timestamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "The time when a record was last updated by Fivetran.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": ["doc.iterable._fivetran_synced"]}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "iterable://models/staging/stg_iterable.yml", "build_path": null, "unrendered_config": {"materialized": "table", "schema": "iterable_{{ var('directed_schema','dev') }}", "enabled": "var('iterable__using_campaign_suppression_list_history', True)", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789079004.3016183, "relation_name": "\"postgres\".\"public_iterable_dev\".\"stg_iterable__campaign_suppression_list_history\"", "raw_code": "{{ config(enabled=var('iterable__using_campaign_suppression_list_history', True)) }}\n\nwith base as (\n\n select * \n from {{ ref('stg_iterable__campaign_suppression_list_history_tmp') }}\n\n),\n\nfields as (\n\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_iterable/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_iterable/macros/).\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_iterable__campaign_suppression_list_history_tmp')),\n staging_columns=get_campaign_suppression_list_history_columns()\n )\n }}\n {{ fivetran_utils.apply_source_relation(package_name='iterable') }}\n\n from base\n),\n\nfinal as (\n\n select\n source_relation,\n cast(campaign_id as {{ dbt.type_string() }}) as campaign_id,\n cast(suppressed_list_id as {{ dbt.type_string() }}) as suppressed_list_id,\n updated_at,\n _fivetran_synced\n from fields\n)\n\nselect * \nfrom final", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__campaign_suppression_list_history_tmp", "package": null, "version": null}, {"name": "stg_iterable__campaign_suppression_list_history_tmp", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.iterable.get_campaign_suppression_list_history_columns", "macro.fivetran_utils.fill_staging_columns", "macro.fivetran_utils.apply_source_relation", "macro.dbt.type_string"], "nodes": ["model.iterable.stg_iterable__campaign_suppression_list_history_tmp"]}, "compiled_path": "target/compiled/iterable/models/staging/stg_iterable__campaign_suppression_list_history.sql", "compiled": true, "compiled_code": "\n\nwith base as (\n\n select * \n from \"postgres\".\"public_iterable_dev\".\"stg_iterable__campaign_suppression_list_history_tmp\"\n\n),\n\nfields as (\n\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_iterable/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_iterable/macros/).\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n \n _fivetran_synced as _fivetran_synced,\n campaign_id as campaign_id,\n suppressed_list_id as suppressed_list_id,\n updated_at as updated_at\n \n\n\n\n\n \n \n\n\n\n\n\n, cast('postgres.public' as TEXT) as source_relation\n\n\n from base\n),\n\nfinal as (\n\n select\n source_relation,\n cast(campaign_id as TEXT) as campaign_id,\n cast(suppressed_list_id as TEXT) as suppressed_list_id,\n updated_at,\n _fivetran_synced\n from fields\n)\n\nselect * \nfrom final", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.stg_iterable__event_extension": {"database": "postgres", "schema": "public_iterable_dev", "name": "stg_iterable__event_extension", "resource_type": "model", "package_name": "iterable", "path": "staging/stg_iterable__event_extension.sql", "original_file_path": "models/staging/stg_iterable__event_extension.sql", "unique_id": "model.iterable.stg_iterable__event_extension", "fqn": ["iterable", "staging", "stg_iterable__event_extension"], "alias": "stg_iterable__event_extension", "checksum": {"name": "sha256", "checksum": "006d3abf1fe12ef7312b3f02d07a13a483883e57acfe0fceedb3e6a9f71372ff"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "Table containing addition properties from the event table.", "columns": {"source_relation": {"name": "source_relation", "description": "Identifies the record's source.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": ["doc.iterable.source_relation"]}, "event_id": {"name": "event_id", "description": "A Fivetran-created unique identifier derived from hashing campaign_id, created_at, and event_name.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_event_id": {"name": "unique_event_id", "description": "A surrogate key made up of event_id, _fivetran_user_id, and source_relation.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "is_app_already_running": {"name": "is_app_already_running", "description": "Boolean indicating if the app is currently running or not", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "badge": {"name": "badge", "description": "Badge associated with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "canonical_url_id": {"name": "canonical_url_id", "description": "Reference to the url associated with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "is_content_available": {"name": "is_content_available", "description": "Content available from the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "content_id": {"name": "content_id", "description": "Reference to the content associated with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "device": {"name": "device", "description": "The device associated with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "email_id": {"name": "email_id", "description": "Reference to the email associated with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "email_subject": {"name": "email_subject", "description": "Subject of the email associated with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "experiment_id": {"name": "experiment_id", "description": "Reference to the experiment used if the event is an experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "from_phone_number_id": {"name": "from_phone_number_id", "description": "Reference to the phone number which the event is from", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "from_smssender_id": {"name": "from_smssender_id", "description": "Reference to the sms sender which the event is from", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "link_id": {"name": "link_id", "description": "Reference to the link associated with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "link_url": {"name": "link_url", "description": "Url of the link associated with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "locale": {"name": "locale", "description": "Locale associated with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "payload": {"name": "payload", "description": "Payload resulted from the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "platform_endpoint": {"name": "platform_endpoint", "description": "The specific platform endpoint of the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "push_message": {"name": "push_message", "description": "Boolean indicating if the event is a push message", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "region": {"name": "region", "description": "Region of the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "sms_message": {"name": "sms_message", "description": "Boolean indicating if the event is an sms message", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "to_phone_number": {"name": "to_phone_number", "description": "To phone number associated with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "url": {"name": "url", "description": "Url associated with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "workflow_id": {"name": "workflow_id", "description": "Reference to the workflow which the event originated", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "workflow_name": {"name": "workflow_name", "description": "Name of the workflow which the event originated", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "catalog_collection_count": {"name": "catalog_collection_count", "description": "The count of products or items collected in a catalog associated with the event.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "catalog_lookup_count": {"name": "catalog_lookup_count", "description": "The count of times a catalog was looked up or queried during the event.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "city": {"name": "city", "description": "The city associated with the event, which could be the location of the recipient.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "clicked_url": {"name": "clicked_url", "description": "The URL that was clicked by the recipient in response to the marketing message.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "country": {"name": "country", "description": "The country associated with the event, which could be the location of the recipient.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "error_code": {"name": "error_code", "description": "The error code or message indicating any issues or errors encountered during the event.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "expires_at": {"name": "expires_at", "description": "The date and time when the event or message is set to expire or become invalid.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "from_phone_number": {"name": "from_phone_number", "description": "The phone number from which the SMS message was sent.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "in_app_body": {"name": "in_app_body", "description": "The content or body of an in-app message that was sent as part of the event.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "is_sms_estimation": {"name": "is_sms_estimation", "description": "A boolean indicating whether the SMS message is an estimation or not.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "labels": {"name": "labels", "description": "Any labels or tags associated with the event, which can be used for categorization or organization.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "message_status": {"name": "message_status", "description": "The status of the marketing message, such as sent, delivered, opened, etc.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "mms_send_count": {"name": "mms_send_count", "description": "The count of multimedia messages (MMS) sent as part of the event.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "reason": {"name": "reason", "description": "The reason or cause associated with a specific event or action.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "sms_send_count": {"name": "sms_send_count", "description": "The count of SMS messages sent as part of the event.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "_fivetran_user_id": {"name": "_fivetran_user_id", "description": "A Fivetran-created unique identifier for users, derived from hashing user_id and/or email, depending on project type. This exists for users of the new schema starting Aug 2023. In the old schema, the unique identifier is email.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "The time when a record was last updated by Fivetran.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": ["doc.iterable._fivetran_synced"]}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "iterable://models/staging/stg_iterable.yml", "build_path": null, "unrendered_config": {"materialized": "view", "schema": "iterable_{{ var('directed_schema','dev') }}", "enabled": "var('iterable__using_event_extension', True)", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789079004.304681, "relation_name": "\"postgres\".\"public_iterable_dev\".\"stg_iterable__event_extension\"", "raw_code": "{{ config(\n enabled=var('iterable__using_event_extension', True),\n materialized='view'\n) }}\n\nwith base as (\n\n select * \n from {{ ref('stg_iterable__event_extension_tmp') }}\n\n),\n\nfields as (\n\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_iterable/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_iterable/macros/).\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_iterable__event_extension_tmp')),\n staging_columns=get_event_extension_columns()\n )\n }}\n {{ fivetran_utils.apply_source_relation(package_name='iterable') }}\n\n from base\n),\n\nfinal as (\n select\n source_relation,\n cast(_fivetran_id as {{ dbt.type_string() }} ) as event_id,\n {{ dbt_utils.generate_surrogate_key(['_fivetran_id','_fivetran_user_id','source_relation']) }} as unique_event_id,\n app_already_running as is_app_already_running,\n badge,\n catalog_collection_count,\n catalog_lookup_count,\n cast(canonical_url_id as {{ dbt.type_string() }} ) as canonical_url_id,\n content_available as is_content_available,\n cast(content_id as {{ dbt.type_string() }} ) as content_id,\n device,\n cast(email_id as {{ dbt.type_string() }}) as email_id,\n email_subject,\n experiment_id,\n from_phone_number_id,\n from_smssender_id,\n cast(link_id as {{ dbt.type_string() }} ) as link_id,\n link_url,\n locale,\n payload,\n platform_endpoint,\n push_message,\n region,\n sms_message,\n to_phone_number,\n url,\n cast(workflow_id as {{ dbt.type_string() }} ) as workflow_id,\n workflow_name,\n city,\n clicked_url,\n country,\n error_code,\n expires_at,\n from_phone_number,\n in_app_body,\n is_sms_estimation,\n labels,\n message_status,\n mms_send_count,\n reason,\n sms_send_count,\n _fivetran_synced,\n cast(_fivetran_user_id as {{ dbt.type_string() }} ) as _fivetran_user_id\n\n --The below script allows for pass through columns.\n {{ fivetran_utils.fill_pass_through_columns('iterable_event_extension_pass_through_columns') }}\n\n from fields\n)\n\nselect *\nfrom final", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__event_extension_tmp", "package": null, "version": null}, {"name": "stg_iterable__event_extension_tmp", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.iterable.get_event_extension_columns", "macro.fivetran_utils.fill_staging_columns", "macro.fivetran_utils.apply_source_relation", "macro.dbt.type_string", "macro.dbt_utils.generate_surrogate_key", "macro.fivetran_utils.fill_pass_through_columns"], "nodes": ["model.iterable.stg_iterable__event_extension_tmp"]}, "compiled_path": "target/compiled/iterable/models/staging/stg_iterable__event_extension.sql", "compiled": true, "compiled_code": "\n\nwith base as (\n\n select * \n from \"postgres\".\"public_iterable_dev\".\"stg_iterable__event_extension_tmp\"\n\n),\n\nfields as (\n\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_iterable/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_iterable/macros/).\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n \n _fivetran_id as _fivetran_id,\n _fivetran_synced as _fivetran_synced,\n app_already_running as app_already_running,\n badge as badge,\n catalog_collection_count as catalog_collection_count,\n catalog_lookup_count as catalog_lookup_count,\n canonical_url_id as canonical_url_id,\n content_available as content_available,\n content_id as content_id,\n device as device,\n email_id as email_id,\n email_subject as email_subject,\n experiment_id as experiment_id,\n from_phone_number_id as from_phone_number_id,\n from_smssender_id as from_smssender_id,\n link_id as link_id,\n link_url as link_url,\n locale as locale,\n payload as payload,\n platform_endpoint as platform_endpoint,\n push_message as push_message,\n region as region,\n sms_message as sms_message,\n to_phone_number as to_phone_number,\n url as url,\n workflow_id as workflow_id,\n workflow_name as workflow_name,\n city as city,\n clicked_url as clicked_url,\n country as country,\n error_code as error_code,\n expires_at as expires_at,\n from_phone_number as from_phone_number,\n in_app_body as in_app_body,\n is_sms_estimation as is_sms_estimation,\n labels as labels,\n message_status as message_status,\n mms_send_count as mms_send_count,\n reason as reason,\n sms_send_count as sms_send_count,\n _fivetran_user_id as _fivetran_user_id\n \n\n\n\n\n \n \n\n\n\n\n\n, cast('postgres.public' as TEXT) as source_relation\n\n\n from base\n),\n\nfinal as (\n select\n source_relation,\n cast(_fivetran_id as TEXT ) as event_id,\n md5(cast(coalesce(cast(_fivetran_id as TEXT), '_dbt_utils_surrogate_key_null_') || '-' || coalesce(cast(_fivetran_user_id as TEXT), '_dbt_utils_surrogate_key_null_') || '-' || coalesce(cast(source_relation as TEXT), '_dbt_utils_surrogate_key_null_') as TEXT)) as unique_event_id,\n app_already_running as is_app_already_running,\n badge,\n catalog_collection_count,\n catalog_lookup_count,\n cast(canonical_url_id as TEXT ) as canonical_url_id,\n content_available as is_content_available,\n cast(content_id as TEXT ) as content_id,\n device,\n cast(email_id as TEXT) as email_id,\n email_subject,\n experiment_id,\n from_phone_number_id,\n from_smssender_id,\n cast(link_id as TEXT ) as link_id,\n link_url,\n locale,\n payload,\n platform_endpoint,\n push_message,\n region,\n sms_message,\n to_phone_number,\n url,\n cast(workflow_id as TEXT ) as workflow_id,\n workflow_name,\n city,\n clicked_url,\n country,\n error_code,\n expires_at,\n from_phone_number,\n in_app_body,\n is_sms_estimation,\n labels,\n message_status,\n mms_send_count,\n reason,\n sms_send_count,\n _fivetran_synced,\n cast(_fivetran_user_id as TEXT ) as _fivetran_user_id\n\n --The below script allows for pass through columns.\n \n\n\n\n\n\n from fields\n)\n\nselect *\nfrom final", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.stg_iterable__campaign_list_history": {"database": "postgres", "schema": "public_iterable_dev", "name": "stg_iterable__campaign_list_history", "resource_type": "model", "package_name": "iterable", "path": "staging/stg_iterable__campaign_list_history.sql", "original_file_path": "models/staging/stg_iterable__campaign_list_history.sql", "unique_id": "model.iterable.stg_iterable__campaign_list_history", "fqn": ["iterable", "staging", "stg_iterable__campaign_list_history"], "alias": "stg_iterable__campaign_list_history", "checksum": {"name": "sha256", "checksum": "c7db9c46a66fec00d9fbd6492c0ea17397ec80a12d85fa2d63b9f04f09c45013"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "table", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "Table containing a history of lists.", "columns": {"source_relation": {"name": "source_relation", "description": "Identifies the record's source.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": ["doc.iterable.source_relation"]}, "campaign_id": {"name": "campaign_id", "description": "Reference to the campaign associated with the label", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "list_id": {"name": "list_id", "description": "Reference to the list used", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "updated_at": {"name": "updated_at", "description": "Last update timestamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "The time when a record was last updated by Fivetran.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": ["doc.iterable._fivetran_synced"]}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "iterable://models/staging/stg_iterable.yml", "build_path": null, "unrendered_config": {"materialized": "table", "schema": "iterable_{{ var('directed_schema','dev') }}", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789079004.3008409, "relation_name": "\"postgres\".\"public_iterable_dev\".\"stg_iterable__campaign_list_history\"", "raw_code": "with base as (\n\n select * \n from {{ ref('stg_iterable__campaign_list_history_tmp') }}\n\n),\n\nfields as (\n\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_iterable/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_iterable/macros/).\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_iterable__campaign_list_history_tmp')),\n staging_columns=get_campaign_list_history_columns()\n )\n }}\n {{ fivetran_utils.apply_source_relation(package_name='iterable') }}\n \n from base\n),\n\nfinal as (\n\n select\n source_relation,\n cast(campaign_id as {{ dbt.type_string() }}) as campaign_id,\n cast(list_id as {{ dbt.type_string() }}) as list_id,\n updated_at,\n _fivetran_synced\n from fields\n)\n\nselect * \nfrom final", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__campaign_list_history_tmp", "package": null, "version": null}, {"name": "stg_iterable__campaign_list_history_tmp", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.iterable.get_campaign_list_history_columns", "macro.fivetran_utils.fill_staging_columns", "macro.fivetran_utils.apply_source_relation", "macro.dbt.type_string"], "nodes": ["model.iterable.stg_iterable__campaign_list_history_tmp"]}, "compiled_path": "target/compiled/iterable/models/staging/stg_iterable__campaign_list_history.sql", "compiled": true, "compiled_code": "with base as (\n\n select * \n from \"postgres\".\"public_iterable_dev\".\"stg_iterable__campaign_list_history_tmp\"\n\n),\n\nfields as (\n\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_iterable/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_iterable/macros/).\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n \n _fivetran_synced as _fivetran_synced,\n campaign_id as campaign_id,\n list_id as list_id,\n updated_at as updated_at\n \n\n\n\n\n \n \n\n\n\n\n\n, cast('postgres.public' as TEXT) as source_relation\n\n \n from base\n),\n\nfinal as (\n\n select\n source_relation,\n cast(campaign_id as TEXT) as campaign_id,\n cast(list_id as TEXT) as list_id,\n updated_at,\n _fivetran_synced\n from fields\n)\n\nselect * \nfrom final", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.stg_iterable__channel": {"database": "postgres", "schema": "public_iterable_dev", "name": "stg_iterable__channel", "resource_type": "model", "package_name": "iterable", "path": "staging/stg_iterable__channel.sql", "original_file_path": "models/staging/stg_iterable__channel.sql", "unique_id": "model.iterable.stg_iterable__channel", "fqn": ["iterable", "staging", "stg_iterable__channel"], "alias": "stg_iterable__channel", "checksum": {"name": "sha256", "checksum": "1ade77557691cabd1c65676182adaf401d8dde9ee42a6918d1ea7a124159cbf2"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "table", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "Table containing unique channels.", "columns": {"source_relation": {"name": "source_relation", "description": "Identifies the record's source.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": ["doc.iterable.source_relation"]}, "channel_id": {"name": "channel_id", "description": "Unique identifier of the channel", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "channel_name": {"name": "channel_name", "description": "User defined name of the channel", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "channel_type": {"name": "channel_type", "description": "The channel type", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "message_medium": {"name": "message_medium", "description": "The message medium associated with the channel", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "The time when a record was last updated by Fivetran.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": ["doc.iterable._fivetran_synced"]}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "iterable://models/staging/stg_iterable.yml", "build_path": null, "unrendered_config": {"materialized": "table", "schema": "iterable_{{ var('directed_schema','dev') }}", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789079004.3021634, "relation_name": "\"postgres\".\"public_iterable_dev\".\"stg_iterable__channel\"", "raw_code": "with base as (\n\n select *\n from {{ ref('stg_iterable__channel_tmp') }}\n\n),\n\nfields as (\n\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns\n that are expected/needed (staging_columns from dbt_iterable/models/tmp/) and compares it with columns\n in the source (source_columns from dbt_iterable/macros/).\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_iterable__channel_tmp')),\n staging_columns=get_channel_columns()\n )\n }}\n {{ fivetran_utils.apply_source_relation(package_name='iterable') }}\n\n from base\n\n),\n\nfinal as (\n\n select\n source_relation,\n cast(id as {{ dbt.type_string() }} ) as channel_id,\n name as channel_name,\n channel_type,\n message_medium,\n _fivetran_synced\n\n from fields\n where not coalesce(_fivetran_deleted, false)\n)\n\nselect * \nfrom final", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__channel_tmp", "package": null, "version": null}, {"name": "stg_iterable__channel_tmp", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.iterable.get_channel_columns", "macro.fivetran_utils.fill_staging_columns", "macro.fivetran_utils.apply_source_relation", "macro.dbt.type_string"], "nodes": ["model.iterable.stg_iterable__channel_tmp"]}, "compiled_path": "target/compiled/iterable/models/staging/stg_iterable__channel.sql", "compiled": true, "compiled_code": "with base as (\n\n select *\n from \"postgres\".\"public_iterable_dev\".\"stg_iterable__channel_tmp\"\n\n),\n\nfields as (\n\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns\n that are expected/needed (staging_columns from dbt_iterable/models/tmp/) and compares it with columns\n in the source (source_columns from dbt_iterable/macros/).\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n \n _fivetran_deleted as _fivetran_deleted,\n _fivetran_synced as _fivetran_synced,\n channel_type as channel_type,\n id as id,\n message_medium as message_medium,\n name as name\n \n\n\n\n\n \n \n\n\n\n\n\n, cast('postgres.public' as TEXT) as source_relation\n\n\n from base\n\n),\n\nfinal as (\n\n select\n source_relation,\n cast(id as TEXT ) as channel_id,\n name as channel_name,\n channel_type,\n message_medium,\n _fivetran_synced\n\n from fields\n where not coalesce(_fivetran_deleted, false)\n)\n\nselect * \nfrom final", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.stg_iterable__message_type_tmp": {"database": "postgres", "schema": "public_iterable_dev", "name": "stg_iterable__message_type_tmp", "resource_type": "model", "package_name": "iterable", "path": "staging/tmp/stg_iterable__message_type_tmp.sql", "original_file_path": "models/staging/tmp/stg_iterable__message_type_tmp.sql", "unique_id": "model.iterable.stg_iterable__message_type_tmp", "fqn": ["iterable", "staging", "tmp", "stg_iterable__message_type_tmp"], "alias": "stg_iterable__message_type_tmp", "checksum": {"name": "sha256", "checksum": "fda7a978e7b71b46f37e4878898c6655526f0531d36f74968c7bbb56ec4200e5"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"materialized": "view", "schema": "iterable_{{ var('directed_schema','dev') }}", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789079003.9030004, "relation_name": "\"postgres\".\"public_iterable_dev\".\"stg_iterable__message_type_tmp\"", "raw_code": "{{\n fivetran_utils.union_connections(\n connection_dictionary='iterable_sources',\n single_source_name='iterable',\n single_table_name='message_type'\n )\n}}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["iterable", "message_type"], ["iterable", "message_type"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.fivetran_utils.union_connections"], "nodes": ["source.iterable.iterable.message_type"]}, "compiled_path": "target/compiled/iterable/models/staging/tmp/stg_iterable__message_type_tmp.sql", "compiled": true, "compiled_code": "\n\n\n-- ** Values passed to adapter.get_relation:\n -- full-identifier_var: iterable_message_type_identifier\n -- database: postgres \n -- schema: public\n -- identifier: message_type_data\n\n\n select\n \"id\",\n \"name\",\n \"channel_id\",\n \"_fivetran_deleted\",\n \"_fivetran_synced\",\n \"created_at\",\n \"frequency_cap\",\n \"rate_limit_per_minute\",\n \"subscription_policy\",\n \"updated_at\"\n from \"postgres\".\"public\".\"message_type_data\" as source_table\n\n ", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.stg_iterable__event_extension_tmp": {"database": "postgres", "schema": "public_iterable_dev", "name": "stg_iterable__event_extension_tmp", "resource_type": "model", "package_name": "iterable", "path": "staging/tmp/stg_iterable__event_extension_tmp.sql", "original_file_path": "models/staging/tmp/stg_iterable__event_extension_tmp.sql", "unique_id": "model.iterable.stg_iterable__event_extension_tmp", "fqn": ["iterable", "staging", "tmp", "stg_iterable__event_extension_tmp"], "alias": "stg_iterable__event_extension_tmp", "checksum": {"name": "sha256", "checksum": "09d92da24c5304acbb0f0ebc81fe49e70458d1319cb1c2090f5f9ce0b87ecb29"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"materialized": "view", "schema": "iterable_{{ var('directed_schema','dev') }}", "enabled": "var('iterable__using_event_extension', True)", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789079003.9174972, "relation_name": "\"postgres\".\"public_iterable_dev\".\"stg_iterable__event_extension_tmp\"", "raw_code": "{{ config(enabled=var('iterable__using_event_extension', True)) }}\n\n{{\n fivetran_utils.union_connections(\n connection_dictionary='iterable_sources',\n single_source_name='iterable',\n single_table_name='event_extension'\n )\n}}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["iterable", "event_extension"], ["iterable", "event_extension"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.fivetran_utils.union_connections"], "nodes": ["source.iterable.iterable.event_extension"]}, "compiled_path": "target/compiled/iterable/models/staging/tmp/stg_iterable__event_extension_tmp.sql", "compiled": true, "compiled_code": "\n\n\n\n\n-- ** Values passed to adapter.get_relation:\n -- full-identifier_var: iterable_event_extension_identifier\n -- database: postgres \n -- schema: public\n -- identifier: event_extension_data\n\n\n select\n \"_fivetran_id\",\n \"app_already_running\",\n \"badge\",\n \"canonical_url_id\",\n \"content_available\",\n \"content_id\",\n \"device\",\n \"email_id\",\n \"email_subject\",\n \"experiment_id\",\n \"from_phone_number_id\",\n \"from_smssender_id\",\n \"image_url\",\n \"is_ghost_push\",\n \"link_id\",\n \"link_url\",\n \"platform_endpoint\",\n \"push_message\",\n \"region\",\n \"sms_message\",\n \"sound\",\n \"to_phone_number\",\n \"url\",\n \"workflow_id\",\n \"workflow_name\",\n \"locale\",\n \"deeplink_android\",\n \"deeplink_ios\",\n \"payload\",\n \"sms_provider_response_status\",\n \"sms_provider_response_message\",\n \"sms_provider_response_code\",\n \"sms_provider_response_more_info\",\n \"_fivetran_synced\",\n \"catalog_collection_count\",\n \"catalog_lookup_count\",\n \"city\",\n \"clicked_url\",\n \"country\",\n \"error_code\",\n \"expires_at\",\n \"from_phone_number\",\n \"in_app_body\",\n \"is_sms_estimation\",\n \"labels\",\n \"message_context\",\n \"message_status\",\n \"mms_send_count\",\n \"product_recommendation_count\",\n \"proxy_source\",\n \"reason\",\n \"sms_send_count\",\n \"web_push_body\",\n \"web_push_click_action\",\n \"web_push_icon\",\n \"web_push_message\",\n \"_fivetran_user_id\"\n from \"postgres\".\"public\".\"event_extension_data\" as source_table\n\n ", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.stg_iterable__user_unsub_message_type_tmp": {"database": "postgres", "schema": "public_iterable_dev", "name": "stg_iterable__user_unsub_message_type_tmp", "resource_type": "model", "package_name": "iterable", "path": "staging/tmp/stg_iterable__user_unsub_message_type_tmp.sql", "original_file_path": "models/staging/tmp/stg_iterable__user_unsub_message_type_tmp.sql", "unique_id": "model.iterable.stg_iterable__user_unsub_message_type_tmp", "fqn": ["iterable", "staging", "tmp", "stg_iterable__user_unsub_message_type_tmp"], "alias": "stg_iterable__user_unsub_message_type_tmp", "checksum": {"name": "sha256", "checksum": "ddb46e159ed22f011676fbe7e00ba9271a493bc5185d286261ae30fa0b183636"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"materialized": "view", "schema": "iterable_{{ var('directed_schema','dev') }}", "enabled": "var('iterable__using_user_unsubscribed_message_type', True)", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789079003.9226346, "relation_name": "\"postgres\".\"public_iterable_dev\".\"stg_iterable__user_unsub_message_type_tmp\"", "raw_code": "{{ config(enabled=var('iterable__using_user_unsubscribed_message_type', True)) }}\n\n{{\n fivetran_utils.union_connections(\n connection_dictionary='iterable_sources',\n single_source_name='iterable',\n single_table_name='user_unsubscribed_message_type' if does_table_exist('user_unsubscribed_message_type') else 'user_unsubscribed_message_type_history'\n )\n}}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["iterable", "user_unsubscribed_message_type_history"], ["iterable", "user_unsubscribed_message_type_history"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.iterable.does_table_exist", "macro.fivetran_utils.union_connections"], "nodes": ["source.iterable.iterable.user_unsubscribed_message_type_history"]}, "compiled_path": "target/compiled/iterable/models/staging/tmp/stg_iterable__user_unsub_message_type_tmp.sql", "compiled": true, "compiled_code": "\n\n\n\n\n-- ** Values passed to adapter.get_relation:\n -- full-identifier_var: iterable_user_unsubscribed_message_type_identifier\n -- database: postgres \n -- schema: public\n -- identifier: user_unsubscribed_message_type_data\n\n\n select\n \"_fivetran_id\",\n \"message_type_id\",\n \"_fivetran_synced\"\n from \"postgres\".\"public\".\"user_unsubscribed_message_type_data\" as source_table\n\n ", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.stg_iterable__campaign_list_history_tmp": {"database": "postgres", "schema": "public_iterable_dev", "name": "stg_iterable__campaign_list_history_tmp", "resource_type": "model", "package_name": "iterable", "path": "staging/tmp/stg_iterable__campaign_list_history_tmp.sql", "original_file_path": "models/staging/tmp/stg_iterable__campaign_list_history_tmp.sql", "unique_id": "model.iterable.stg_iterable__campaign_list_history_tmp", "fqn": ["iterable", "staging", "tmp", "stg_iterable__campaign_list_history_tmp"], "alias": "stg_iterable__campaign_list_history_tmp", "checksum": {"name": "sha256", "checksum": "c26b6a07e1d280b2d5dea6ddbff02200d527e798d8af0a8105be30c0e7d013f7"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"materialized": "view", "schema": "iterable_{{ var('directed_schema','dev') }}", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789079003.9280632, "relation_name": "\"postgres\".\"public_iterable_dev\".\"stg_iterable__campaign_list_history_tmp\"", "raw_code": "{{\n fivetran_utils.union_connections(\n connection_dictionary='iterable_sources',\n single_source_name='iterable',\n single_table_name='campaign_list_history'\n )\n}}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["iterable", "campaign_list_history"], ["iterable", "campaign_list_history"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.fivetran_utils.union_connections"], "nodes": ["source.iterable.iterable.campaign_list_history"]}, "compiled_path": "target/compiled/iterable/models/staging/tmp/stg_iterable__campaign_list_history_tmp.sql", "compiled": true, "compiled_code": "\n\n\n-- ** Values passed to adapter.get_relation:\n -- full-identifier_var: iterable_campaign_list_history_identifier\n -- database: postgres \n -- schema: public\n -- identifier: campaign_list_history_data\n\n\n select\n \"list_id\",\n \"campaign_id\",\n \"updated_at\",\n \"_fivetran_synced\"\n from \"postgres\".\"public\".\"campaign_list_history_data\" as source_table\n\n ", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.stg_iterable__list_user_tmp": {"database": "postgres", "schema": "public_iterable_dev", "name": "stg_iterable__list_user_tmp", "resource_type": "model", "package_name": "iterable", "path": "staging/tmp/stg_iterable__list_user_tmp.sql", "original_file_path": "models/staging/tmp/stg_iterable__list_user_tmp.sql", "unique_id": "model.iterable.stg_iterable__list_user_tmp", "fqn": ["iterable", "staging", "tmp", "stg_iterable__list_user_tmp"], "alias": "stg_iterable__list_user_tmp", "checksum": {"name": "sha256", "checksum": "5c8b455013c26cfd4094b38e210edeb911a22dc0f05544e65fb48c350c2725fe"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"materialized": "view", "schema": "iterable_{{ var('directed_schema','dev') }}", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789079003.9325027, "relation_name": "\"postgres\".\"public_iterable_dev\".\"stg_iterable__list_user_tmp\"", "raw_code": "{{\n fivetran_utils.union_connections(\n connection_dictionary='iterable_sources',\n single_source_name='iterable',\n single_table_name='list_user'\n )\n}}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["iterable", "list_user"], ["iterable", "list_user"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.fivetran_utils.union_connections"], "nodes": ["source.iterable.iterable.list_user"]}, "compiled_path": "target/compiled/iterable/models/staging/tmp/stg_iterable__list_user_tmp.sql", "compiled": true, "compiled_code": "\n\n\n-- ** Values passed to adapter.get_relation:\n -- full-identifier_var: iterable_list_user_identifier\n -- database: postgres \n -- schema: public\n -- identifier: list_user_data\n\n\n select\n \"_fivetran_id\",\n \"index\",\n \"list_id\",\n \"_fivetran_synced\"\n from \"postgres\".\"public\".\"list_user_data\" as source_table\n\n ", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.stg_iterable__user_history_tmp": {"database": "postgres", "schema": "public_iterable_dev", "name": "stg_iterable__user_history_tmp", "resource_type": "model", "package_name": "iterable", "path": "staging/tmp/stg_iterable__user_history_tmp.sql", "original_file_path": "models/staging/tmp/stg_iterable__user_history_tmp.sql", "unique_id": "model.iterable.stg_iterable__user_history_tmp", "fqn": ["iterable", "staging", "tmp", "stg_iterable__user_history_tmp"], "alias": "stg_iterable__user_history_tmp", "checksum": {"name": "sha256", "checksum": "cc04d0fbef9ff5cd4f72ae66c9cffd316c5e134ecd81dc216dcf682b34eb587b"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"materialized": "view", "schema": "iterable_{{ var('directed_schema','dev') }}", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789079003.937289, "relation_name": "\"postgres\".\"public_iterable_dev\".\"stg_iterable__user_history_tmp\"", "raw_code": "{{\n fivetran_utils.union_connections(\n connection_dictionary='iterable_sources',\n single_source_name='iterable',\n single_table_name='user_history'\n )\n}}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["iterable", "user_history"], ["iterable", "user_history"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.fivetran_utils.union_connections"], "nodes": ["source.iterable.iterable.user_history"]}, "compiled_path": "target/compiled/iterable/models/staging/tmp/stg_iterable__user_history_tmp.sql", "compiled": true, "compiled_code": "\n\n\n-- ** Values passed to adapter.get_relation:\n -- full-identifier_var: iterable_user_history_identifier\n -- database: postgres \n -- schema: public\n -- identifier: user_history_data\n\n\n select\n \"email\",\n \"updated_at\",\n \"first_name\",\n \"last_name\",\n \"phone_number\",\n \"user_id\",\n \"signup_date\",\n \"signup_source\",\n \"phone_number_carrier\",\n \"phone_number_country_code_iso\",\n \"phone_number_line_type\",\n \"phone_number_updated_at\",\n \"_fivetran_synced\",\n \"email_list_ids\",\n \"iterable_user_id\"\n from \"postgres\".\"public\".\"user_history_data\" as source_table\n\n ", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.stg_iterable__campaign_history_tmp": {"database": "postgres", "schema": "public_iterable_dev", "name": "stg_iterable__campaign_history_tmp", "resource_type": "model", "package_name": "iterable", "path": "staging/tmp/stg_iterable__campaign_history_tmp.sql", "original_file_path": "models/staging/tmp/stg_iterable__campaign_history_tmp.sql", "unique_id": "model.iterable.stg_iterable__campaign_history_tmp", "fqn": ["iterable", "staging", "tmp", "stg_iterable__campaign_history_tmp"], "alias": "stg_iterable__campaign_history_tmp", "checksum": {"name": "sha256", "checksum": "a37ade72efad4e5d8b38cc0548f4a4c79d38a4a337ce71f236581bda47f94696"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"materialized": "view", "schema": "iterable_{{ var('directed_schema','dev') }}", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789079003.941746, "relation_name": "\"postgres\".\"public_iterable_dev\".\"stg_iterable__campaign_history_tmp\"", "raw_code": "{{\n fivetran_utils.union_connections(\n connection_dictionary='iterable_sources',\n single_source_name='iterable',\n single_table_name='campaign_history'\n )\n}}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["iterable", "campaign_history"], ["iterable", "campaign_history"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.fivetran_utils.union_connections"], "nodes": ["source.iterable.iterable.campaign_history"]}, "compiled_path": "target/compiled/iterable/models/staging/tmp/stg_iterable__campaign_history_tmp.sql", "compiled": true, "compiled_code": "\n\n\n-- ** Values passed to adapter.get_relation:\n -- full-identifier_var: iterable_campaign_history_identifier\n -- database: postgres \n -- schema: public\n -- identifier: campaign_history_data\n\n\n select\n \"id\",\n \"updated_at\",\n \"template_id\",\n \"recurring_campaign_id\",\n \"campaign_state\",\n \"created_at\",\n \"created_by_user_id\",\n \"ended_at\",\n \"name\",\n \"send_size\",\n \"start_at\",\n \"type\",\n \"workflow_id\",\n \"_fivetran_synced\",\n \"updated_by_user_id\",\n \"message_medium\"\n from \"postgres\".\"public\".\"campaign_history_data\" as source_table\n\n ", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.stg_iterable__template_history_tmp": {"database": "postgres", "schema": "public_iterable_dev", "name": "stg_iterable__template_history_tmp", "resource_type": "model", "package_name": "iterable", "path": "staging/tmp/stg_iterable__template_history_tmp.sql", "original_file_path": "models/staging/tmp/stg_iterable__template_history_tmp.sql", "unique_id": "model.iterable.stg_iterable__template_history_tmp", "fqn": ["iterable", "staging", "tmp", "stg_iterable__template_history_tmp"], "alias": "stg_iterable__template_history_tmp", "checksum": {"name": "sha256", "checksum": "b37299e696c1cd6388ad85a4042f9b8a5364b969e7c4fdb42f03e4c4803e9a7f"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"materialized": "view", "schema": "iterable_{{ var('directed_schema','dev') }}", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789079003.946246, "relation_name": "\"postgres\".\"public_iterable_dev\".\"stg_iterable__template_history_tmp\"", "raw_code": "{{\n fivetran_utils.union_connections(\n connection_dictionary='iterable_sources',\n single_source_name='iterable',\n single_table_name='template_history'\n )\n}}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["iterable", "template_history"], ["iterable", "template_history"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.fivetran_utils.union_connections"], "nodes": ["source.iterable.iterable.template_history"]}, "compiled_path": "target/compiled/iterable/models/staging/tmp/stg_iterable__template_history_tmp.sql", "compiled": true, "compiled_code": "\n\n\n-- ** Values passed to adapter.get_relation:\n -- full-identifier_var: iterable_template_history_identifier\n -- database: postgres \n -- schema: public\n -- identifier: template_history_data\n\n\n select\n \"id\",\n \"updated_at\",\n \"message_type_id\",\n \"client_template_id\",\n \"created_at\",\n \"creator_user_id\",\n \"name\",\n \"template_type\",\n \"_fivetran_synced\"\n from \"postgres\".\"public\".\"template_history_data\" as source_table\n\n ", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.stg_iterable__event_tmp": {"database": "postgres", "schema": "public_iterable_dev", "name": "stg_iterable__event_tmp", "resource_type": "model", "package_name": "iterable", "path": "staging/tmp/stg_iterable__event_tmp.sql", "original_file_path": "models/staging/tmp/stg_iterable__event_tmp.sql", "unique_id": "model.iterable.stg_iterable__event_tmp", "fqn": ["iterable", "staging", "tmp", "stg_iterable__event_tmp"], "alias": "stg_iterable__event_tmp", "checksum": {"name": "sha256", "checksum": "31555eb22bfca797c1f1a4f1503da21f7620762d199e7e32b2d268c03e139f65"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"materialized": "view", "schema": "iterable_{{ var('directed_schema','dev') }}", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789079003.950569, "relation_name": "\"postgres\".\"public_iterable_dev\".\"stg_iterable__event_tmp\"", "raw_code": "{{\n fivetran_utils.union_connections(\n connection_dictionary='iterable_sources',\n single_source_name='iterable',\n single_table_name='event'\n )\n}}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["iterable", "event"], ["iterable", "event"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.fivetran_utils.union_connections"], "nodes": ["source.iterable.iterable.event"]}, "compiled_path": "target/compiled/iterable/models/staging/tmp/stg_iterable__event_tmp.sql", "compiled": true, "compiled_code": "\n\n\n-- ** Values passed to adapter.get_relation:\n -- full-identifier_var: iterable_event_identifier\n -- database: postgres \n -- schema: public\n -- identifier: event_data\n\n\n select\n \"_fivetran_id\",\n \"email\",\n \"campaign_id\",\n \"message_id\",\n \"content_id\",\n \"created_at\",\n \"event_name\",\n \"ip\",\n \"message_bus_id\",\n \"message_type_id\",\n \"recipient_state\",\n \"status\",\n \"unsub_source\",\n \"user_agent\",\n \"user_agent_device\",\n \"transactional_data\",\n \"additional_properties\",\n \"_fivetran_synced\",\n \"_fivetran_user_id\"\n from \"postgres\".\"public\".\"event_data\" as source_table\n\n ", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.stg_iterable__journey_tmp": {"database": "postgres", "schema": "public_iterable_dev", "name": "stg_iterable__journey_tmp", "resource_type": "model", "package_name": "iterable", "path": "staging/tmp/stg_iterable__journey_tmp.sql", "original_file_path": "models/staging/tmp/stg_iterable__journey_tmp.sql", "unique_id": "model.iterable.stg_iterable__journey_tmp", "fqn": ["iterable", "staging", "tmp", "stg_iterable__journey_tmp"], "alias": "stg_iterable__journey_tmp", "checksum": {"name": "sha256", "checksum": "9e10fed335359755ce1488a7df46c9bfd4a08b029e757c4e81c8c2f8cce28961"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"materialized": "view", "schema": "iterable_{{ var('directed_schema','dev') }}", "enabled": "var('iterable__using_journey', True)", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789079003.9550436, "relation_name": "\"postgres\".\"public_iterable_dev\".\"stg_iterable__journey_tmp\"", "raw_code": "{{ config(enabled=var('iterable__using_journey', True)) }}\n\n{{\n fivetran_utils.union_connections(\n connection_dictionary='iterable_sources',\n single_source_name='iterable',\n single_table_name='journey'\n )\n}}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["iterable", "journey"], ["iterable", "journey"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.fivetran_utils.union_connections"], "nodes": ["source.iterable.iterable.journey"]}, "compiled_path": "target/compiled/iterable/models/staging/tmp/stg_iterable__journey_tmp.sql", "compiled": true, "compiled_code": "\n\n\n\n\n-- ** Values passed to adapter.get_relation:\n -- full-identifier_var: iterable_journey_identifier\n -- database: postgres \n -- schema: public\n -- identifier: journey\n\n\n \n \n\n select\n cast(null as TEXT) as _dbt_source_relation\n limit 0", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.stg_iterable__campaign_suppression_list_history_tmp": {"database": "postgres", "schema": "public_iterable_dev", "name": "stg_iterable__campaign_suppression_list_history_tmp", "resource_type": "model", "package_name": "iterable", "path": "staging/tmp/stg_iterable__campaign_suppression_list_history_tmp.sql", "original_file_path": "models/staging/tmp/stg_iterable__campaign_suppression_list_history_tmp.sql", "unique_id": "model.iterable.stg_iterable__campaign_suppression_list_history_tmp", "fqn": ["iterable", "staging", "tmp", "stg_iterable__campaign_suppression_list_history_tmp"], "alias": "stg_iterable__campaign_suppression_list_history_tmp", "checksum": {"name": "sha256", "checksum": "3c5a325cac70574f2defa9fa09b436c03a3fe8a3dede5729ca95451b410d636c"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"materialized": "view", "schema": "iterable_{{ var('directed_schema','dev') }}", "enabled": "var('iterable__using_campaign_suppression_list_history', True)", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789079003.9601126, "relation_name": "\"postgres\".\"public_iterable_dev\".\"stg_iterable__campaign_suppression_list_history_tmp\"", "raw_code": "{{ config(enabled=var('iterable__using_campaign_suppression_list_history', True)) }}\n\n{{\n fivetran_utils.union_connections(\n connection_dictionary='iterable_sources',\n single_source_name='iterable',\n single_table_name='campaign_suppression_list_history'\n )\n}}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["iterable", "campaign_suppression_list_history"], ["iterable", "campaign_suppression_list_history"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.fivetran_utils.union_connections"], "nodes": ["source.iterable.iterable.campaign_suppression_list_history"]}, "compiled_path": "target/compiled/iterable/models/staging/tmp/stg_iterable__campaign_suppression_list_history_tmp.sql", "compiled": true, "compiled_code": "\n\n\n\n\n-- ** Values passed to adapter.get_relation:\n -- full-identifier_var: iterable_campaign_suppression_list_history_identifier\n -- database: postgres \n -- schema: public\n -- identifier: campaign_suppression_list_history_data\n\n\n select\n \"suppressed_list_id\",\n \"campaign_id\",\n \"updated_at\",\n \"_fivetran_synced\"\n from \"postgres\".\"public\".\"campaign_suppression_list_history_data\" as source_table\n\n ", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.stg_iterable__campaign_label_history_tmp": {"database": "postgres", "schema": "public_iterable_dev", "name": "stg_iterable__campaign_label_history_tmp", "resource_type": "model", "package_name": "iterable", "path": "staging/tmp/stg_iterable__campaign_label_history_tmp.sql", "original_file_path": "models/staging/tmp/stg_iterable__campaign_label_history_tmp.sql", "unique_id": "model.iterable.stg_iterable__campaign_label_history_tmp", "fqn": ["iterable", "staging", "tmp", "stg_iterable__campaign_label_history_tmp"], "alias": "stg_iterable__campaign_label_history_tmp", "checksum": {"name": "sha256", "checksum": "08e70c9938c895459cabba65b1992d360775e26ea2b8275e408bcf21e814bd58"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"materialized": "view", "schema": "iterable_{{ var('directed_schema','dev') }}", "enabled": "var('iterable__using_campaign_label_history', True)", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789079003.9651775, "relation_name": "\"postgres\".\"public_iterable_dev\".\"stg_iterable__campaign_label_history_tmp\"", "raw_code": "{{ config(enabled=var('iterable__using_campaign_label_history', True)) }}\n\n{{\n fivetran_utils.union_connections(\n connection_dictionary='iterable_sources',\n single_source_name='iterable',\n single_table_name='campaign_label_history'\n )\n}}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["iterable", "campaign_label_history"], ["iterable", "campaign_label_history"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.fivetran_utils.union_connections"], "nodes": ["source.iterable.iterable.campaign_label_history"]}, "compiled_path": "target/compiled/iterable/models/staging/tmp/stg_iterable__campaign_label_history_tmp.sql", "compiled": true, "compiled_code": "\n\n\n\n\n-- ** Values passed to adapter.get_relation:\n -- full-identifier_var: iterable_campaign_label_history_identifier\n -- database: postgres \n -- schema: public\n -- identifier: campaign_label_history_data\n\n\n select\n \"campaign_id\",\n \"label\",\n \"updated_at\",\n \"_fivetran_synced\"\n from \"postgres\".\"public\".\"campaign_label_history_data\" as source_table\n\n ", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.stg_iterable__list_tmp": {"database": "postgres", "schema": "public_iterable_dev", "name": "stg_iterable__list_tmp", "resource_type": "model", "package_name": "iterable", "path": "staging/tmp/stg_iterable__list_tmp.sql", "original_file_path": "models/staging/tmp/stg_iterable__list_tmp.sql", "unique_id": "model.iterable.stg_iterable__list_tmp", "fqn": ["iterable", "staging", "tmp", "stg_iterable__list_tmp"], "alias": "stg_iterable__list_tmp", "checksum": {"name": "sha256", "checksum": "95fbbf63205ef9000c19e76270c8ab96e23c4f9d8072f3892a08f20648a42b5a"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"materialized": "view", "schema": "iterable_{{ var('directed_schema','dev') }}", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789079003.9701025, "relation_name": "\"postgres\".\"public_iterable_dev\".\"stg_iterable__list_tmp\"", "raw_code": "{{\n fivetran_utils.union_connections(\n connection_dictionary='iterable_sources',\n single_source_name='iterable',\n single_table_name='list'\n )\n}}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["iterable", "list"], ["iterable", "list"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.fivetran_utils.union_connections"], "nodes": ["source.iterable.iterable.list"]}, "compiled_path": "target/compiled/iterable/models/staging/tmp/stg_iterable__list_tmp.sql", "compiled": true, "compiled_code": "\n\n\n-- ** Values passed to adapter.get_relation:\n -- full-identifier_var: iterable_list_identifier\n -- database: postgres \n -- schema: public\n -- identifier: list_data\n\n\n select\n \"id\",\n \"name\",\n \"created_at\",\n \"list_type\",\n \"_fivetran_deleted\",\n \"_fivetran_synced\",\n \"description\"\n from \"postgres\".\"public\".\"list_data\" as source_table\n\n ", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.stg_iterable__channel_tmp": {"database": "postgres", "schema": "public_iterable_dev", "name": "stg_iterable__channel_tmp", "resource_type": "model", "package_name": "iterable", "path": "staging/tmp/stg_iterable__channel_tmp.sql", "original_file_path": "models/staging/tmp/stg_iterable__channel_tmp.sql", "unique_id": "model.iterable.stg_iterable__channel_tmp", "fqn": ["iterable", "staging", "tmp", "stg_iterable__channel_tmp"], "alias": "stg_iterable__channel_tmp", "checksum": {"name": "sha256", "checksum": "0516bc3567b725378b33829b8c3e7dc1b6680922f2d1e7824a913b82ca617905"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"materialized": "view", "schema": "iterable_{{ var('directed_schema','dev') }}", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789079003.9745605, "relation_name": "\"postgres\".\"public_iterable_dev\".\"stg_iterable__channel_tmp\"", "raw_code": "{{\n fivetran_utils.union_connections(\n connection_dictionary='iterable_sources',\n single_source_name='iterable',\n single_table_name='channel'\n )\n}}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["iterable", "channel"], ["iterable", "channel"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.fivetran_utils.union_connections"], "nodes": ["source.iterable.iterable.channel"]}, "compiled_path": "target/compiled/iterable/models/staging/tmp/stg_iterable__channel_tmp.sql", "compiled": true, "compiled_code": "\n\n\n-- ** Values passed to adapter.get_relation:\n -- full-identifier_var: iterable_channel_identifier\n -- database: postgres \n -- schema: public\n -- identifier: channel_data\n\n\n select\n \"id\",\n \"name\",\n \"channel_type\",\n \"message_medium\",\n \"_fivetran_deleted\",\n \"_fivetran_synced\"\n from \"postgres\".\"public\".\"channel_data\" as source_table\n\n ", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.stg_iterable__user_unsubscribed_channel_tmp": {"database": "postgres", "schema": "public_iterable_dev", "name": "stg_iterable__user_unsubscribed_channel_tmp", "resource_type": "model", "package_name": "iterable", "path": "staging/tmp/stg_iterable__user_unsubscribed_channel_tmp.sql", "original_file_path": "models/staging/tmp/stg_iterable__user_unsubscribed_channel_tmp.sql", "unique_id": "model.iterable.stg_iterable__user_unsubscribed_channel_tmp", "fqn": ["iterable", "staging", "tmp", "stg_iterable__user_unsubscribed_channel_tmp"], "alias": "stg_iterable__user_unsubscribed_channel_tmp", "checksum": {"name": "sha256", "checksum": "a8d43331a84f0d1dae8511478d01cded7dfb389fef925f7173f50eb6b6b9c142"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"materialized": "view", "schema": "iterable_{{ var('directed_schema','dev') }}", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789079003.979078, "relation_name": "\"postgres\".\"public_iterable_dev\".\"stg_iterable__user_unsubscribed_channel_tmp\"", "raw_code": "{{\n fivetran_utils.union_connections(\n connection_dictionary='iterable_sources',\n single_source_name='iterable',\n single_table_name='user_unsubscribed_channel' if does_table_exist('user_unsubscribed_channel') else 'user_unsubscribed_channel_history'\n )\n}}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["iterable", "user_unsubscribed_channel_history"], ["iterable", "user_unsubscribed_channel_history"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.iterable.does_table_exist", "macro.fivetran_utils.union_connections"], "nodes": ["source.iterable.iterable.user_unsubscribed_channel_history"]}, "compiled_path": "target/compiled/iterable/models/staging/tmp/stg_iterable__user_unsubscribed_channel_tmp.sql", "compiled": true, "compiled_code": "\n\n\n-- ** Values passed to adapter.get_relation:\n -- full-identifier_var: iterable_user_unsubscribed_channel_identifier\n -- database: postgres \n -- schema: public\n -- identifier: user_unsubscribed_channel_data\n\n\n select\n \"_fivetran_id\",\n \"channel_id\",\n \"_fivetran_synced\"\n from \"postgres\".\"public\".\"user_unsubscribed_channel_data\" as source_table\n\n ", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "test.iterable.not_null_iterable__campaigns_campaign_id.03c9448919": {"database": "postgres", "schema": "public_dbt_test__audit", "name": "not_null_iterable__campaigns_campaign_id", "resource_type": "test", "package_name": "iterable", "path": "not_null_iterable__campaigns_campaign_id.sql", "original_file_path": "models/iterable.yml", "unique_id": "test.iterable.not_null_iterable__campaigns_campaign_id.03c9448919", "fqn": ["iterable", "not_null_iterable__campaigns_campaign_id"], "alias": "not_null_iterable__campaigns_campaign_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "sql_header": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {}, "created_at": 1789079004.283278, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "iterable__campaigns", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.iterable.iterable__campaigns"]}, "compiled_path": "target/compiled/iterable/models/iterable.yml/not_null_iterable__campaigns_campaign_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect campaign_id\nfrom \"postgres\".\"public_iterable_dev\".\"iterable__campaigns\"\nwhere campaign_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "campaign_id", "file_key_name": "models.iterable__campaigns", "attached_node": "model.iterable.iterable__campaigns", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "campaign_id", "model": "{{ get_where_subquery(ref('iterable__campaigns')) }}"}, "namespace": null}}, "test.iterable.not_null_iterable__events_event_id.ed1d28a650": {"database": "postgres", "schema": "public_dbt_test__audit", "name": "not_null_iterable__events_event_id", "resource_type": "test", "package_name": "iterable", "path": "not_null_iterable__events_event_id.sql", "original_file_path": "models/iterable.yml", "unique_id": "test.iterable.not_null_iterable__events_event_id.ed1d28a650", "fqn": ["iterable", "not_null_iterable__events_event_id"], "alias": "not_null_iterable__events_event_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "sql_header": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {}, "created_at": 1789079004.285318, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "iterable__events", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.iterable.iterable__events"]}, "compiled_path": "target/compiled/iterable/models/iterable.yml/not_null_iterable__events_event_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect event_id\nfrom \"postgres\".\"public_iterable_dev\".\"iterable__events\"\nwhere event_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "event_id", "file_key_name": "models.iterable__events", "attached_node": "model.iterable.iterable__events", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "event_id", "model": "{{ get_where_subquery(ref('iterable__events')) }}"}, "namespace": null}}, "test.iterable.not_null_iterable__journeys_journey_id.b5c6b8783a": {"database": "postgres", "schema": "public_dbt_test__audit", "name": "not_null_iterable__journeys_journey_id", "resource_type": "test", "package_name": "iterable", "path": "not_null_iterable__journeys_journey_id.sql", "original_file_path": "models/iterable.yml", "unique_id": "test.iterable.not_null_iterable__journeys_journey_id.b5c6b8783a", "fqn": ["iterable", "not_null_iterable__journeys_journey_id"], "alias": "not_null_iterable__journeys_journey_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "sql_header": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {}, "created_at": 1789079004.2870908, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "iterable__journeys", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.iterable.iterable__journeys"]}, "compiled_path": "target/compiled/iterable/models/iterable.yml/not_null_iterable__journeys_journey_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect journey_id\nfrom \"postgres\".\"public_iterable_dev\".\"iterable__journeys\"\nwhere journey_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "journey_id", "file_key_name": "models.iterable__journeys", "attached_node": "model.iterable.iterable__journeys", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "journey_id", "model": "{{ get_where_subquery(ref('iterable__journeys')) }}"}, "namespace": null}}, "test.iterable.unique_iterable__journeys_unique_journey_id.ba86841246": {"database": "postgres", "schema": "public_dbt_test__audit", "name": "unique_iterable__journeys_unique_journey_id", "resource_type": "test", "package_name": "iterable", "path": "unique_iterable__journeys_unique_journey_id.sql", "original_file_path": "models/iterable.yml", "unique_id": "test.iterable.unique_iterable__journeys_unique_journey_id.ba86841246", "fqn": ["iterable", "unique_iterable__journeys_unique_journey_id"], "alias": "unique_iterable__journeys_unique_journey_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "sql_header": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {}, "created_at": 1789079004.2887745, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "iterable__journeys", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.iterable.iterable__journeys"]}, "compiled_path": "target/compiled/iterable/models/iterable.yml/unique_iterable__journeys_unique_journey_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n unique_journey_id as unique_field,\n count(*) as n_records\n\nfrom \"postgres\".\"public_iterable_dev\".\"iterable__journeys\"\nwhere unique_journey_id is not null\ngroup by unique_journey_id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "unique_journey_id", "file_key_name": "models.iterable__journeys", "attached_node": "model.iterable.iterable__journeys", "test_metadata": {"name": "unique", "kwargs": {"column_name": "unique_journey_id", "model": "{{ get_where_subquery(ref('iterable__journeys')) }}"}, "namespace": null}}, "test.iterable.not_null_iterable__user_unsubscriptions_unique_user_key.f8db72932b": {"database": "postgres", "schema": "public_dbt_test__audit", "name": "not_null_iterable__user_unsubscriptions_unique_user_key", "resource_type": "test", "package_name": "iterable", "path": "not_null_iterable__user_unsubscriptions_unique_user_key.sql", "original_file_path": "models/iterable.yml", "unique_id": "test.iterable.not_null_iterable__user_unsubscriptions_unique_user_key.f8db72932b", "fqn": ["iterable", "not_null_iterable__user_unsubscriptions_unique_user_key"], "alias": "not_null_iterable__user_unsubscriptions_unique_user_key", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "sql_header": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {}, "created_at": 1789079004.2914467, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "iterable__user_unsubscriptions", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.iterable.iterable__user_unsubscriptions"]}, "compiled_path": "target/compiled/iterable/models/iterable.yml/not_null_iterable__user_unsubscriptions_unique_user_key.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect unique_user_key\nfrom \"postgres\".\"public_iterable_dev\".\"iterable__user_unsubscriptions\"\nwhere unique_user_key is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "unique_user_key", "file_key_name": "models.iterable__user_unsubscriptions", "attached_node": "model.iterable.iterable__user_unsubscriptions", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "unique_user_key", "model": "{{ get_where_subquery(ref('iterable__user_unsubscriptions')) }}"}, "namespace": null}}, "test.iterable.not_null_iterable__users_unique_user_key.4ca37a26c8": {"database": "postgres", "schema": "public_dbt_test__audit", "name": "not_null_iterable__users_unique_user_key", "resource_type": "test", "package_name": "iterable", "path": "not_null_iterable__users_unique_user_key.sql", "original_file_path": "models/iterable.yml", "unique_id": "test.iterable.not_null_iterable__users_unique_user_key.4ca37a26c8", "fqn": ["iterable", "not_null_iterable__users_unique_user_key"], "alias": "not_null_iterable__users_unique_user_key", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "sql_header": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {}, "created_at": 1789079004.293257, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "iterable__users", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.iterable.iterable__users"]}, "compiled_path": "target/compiled/iterable/models/iterable.yml/not_null_iterable__users_unique_user_key.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect unique_user_key\nfrom \"postgres\".\"public_iterable_dev\".\"iterable__users\"\nwhere unique_user_key is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "unique_user_key", "file_key_name": "models.iterable__users", "attached_node": "model.iterable.iterable__users", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "unique_user_key", "model": "{{ get_where_subquery(ref('iterable__users')) }}"}, "namespace": null}}, "test.iterable.not_null_stg_iterable__campaign_history_campaign_id.b7c36e4525": {"database": "postgres", "schema": "public_dbt_test__audit", "name": "not_null_stg_iterable__campaign_history_campaign_id", "resource_type": "test", "package_name": "iterable", "path": "not_null_stg_iterable__campaign_history_campaign_id.sql", "original_file_path": "models/staging/stg_iterable.yml", "unique_id": "test.iterable.not_null_stg_iterable__campaign_history_campaign_id.b7c36e4525", "fqn": ["iterable", "staging", "not_null_stg_iterable__campaign_history_campaign_id"], "alias": "not_null_stg_iterable__campaign_history_campaign_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "sql_header": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {}, "created_at": 1789079004.313116, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__campaign_history", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.iterable.stg_iterable__campaign_history"]}, "compiled_path": "target/compiled/iterable/models/staging/stg_iterable.yml/not_null_stg_iterable__campaign_history_campaign_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect campaign_id\nfrom \"postgres\".\"public_iterable_dev\".\"stg_iterable__campaign_history\"\nwhere campaign_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "campaign_id", "file_key_name": "models.stg_iterable__campaign_history", "attached_node": "model.iterable.stg_iterable__campaign_history", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "campaign_id", "model": "{{ get_where_subquery(ref('stg_iterable__campaign_history')) }}"}, "namespace": null}}, "test.iterable.not_null_stg_iterable__campaign_label_history_campaign_id.1918cef89a": {"database": "postgres", "schema": "public_dbt_test__audit", "name": "not_null_stg_iterable__campaign_label_history_campaign_id", "resource_type": "test", "package_name": "iterable", "path": "not_null_stg_iterable__campaign_label_history_campaign_id.sql", "original_file_path": "models/staging/stg_iterable.yml", "unique_id": "test.iterable.not_null_stg_iterable__campaign_label_history_campaign_id.1918cef89a", "fqn": ["iterable", "staging", "not_null_stg_iterable__campaign_label_history_campaign_id"], "alias": "not_null_stg_iterable__campaign_label_history_campaign_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "sql_header": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {}, "created_at": 1789079004.314922, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__campaign_label_history", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.iterable.stg_iterable__campaign_label_history"]}, "compiled_path": "target/compiled/iterable/models/staging/stg_iterable.yml/not_null_stg_iterable__campaign_label_history_campaign_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect campaign_id\nfrom \"postgres\".\"public_iterable_dev\".\"stg_iterable__campaign_label_history\"\nwhere campaign_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "campaign_id", "file_key_name": "models.stg_iterable__campaign_label_history", "attached_node": "model.iterable.stg_iterable__campaign_label_history", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "campaign_id", "model": "{{ get_where_subquery(ref('stg_iterable__campaign_label_history')) }}"}, "namespace": null}}, "test.iterable.not_null_stg_iterable__campaign_list_history_campaign_id.208f9bf9ed": {"database": "postgres", "schema": "public_dbt_test__audit", "name": "not_null_stg_iterable__campaign_list_history_campaign_id", "resource_type": "test", "package_name": "iterable", "path": "not_null_stg_iterable__campaign_list_history_campaign_id.sql", "original_file_path": "models/staging/stg_iterable.yml", "unique_id": "test.iterable.not_null_stg_iterable__campaign_list_history_campaign_id.208f9bf9ed", "fqn": ["iterable", "staging", "not_null_stg_iterable__campaign_list_history_campaign_id"], "alias": "not_null_stg_iterable__campaign_list_history_campaign_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "sql_header": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {}, "created_at": 1789079004.3166952, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__campaign_list_history", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.iterable.stg_iterable__campaign_list_history"]}, "compiled_path": "target/compiled/iterable/models/staging/stg_iterable.yml/not_null_stg_iterable__campaign_list_history_campaign_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect campaign_id\nfrom \"postgres\".\"public_iterable_dev\".\"stg_iterable__campaign_list_history\"\nwhere campaign_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "campaign_id", "file_key_name": "models.stg_iterable__campaign_list_history", "attached_node": "model.iterable.stg_iterable__campaign_list_history", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "campaign_id", "model": "{{ get_where_subquery(ref('stg_iterable__campaign_list_history')) }}"}, "namespace": null}}, "test.iterable.not_null_stg_iterable__campaign_suppression_list_history_campaign_id.3921289710": {"database": "postgres", "schema": "public_dbt_test__audit", "name": "not_null_stg_iterable__campaign_suppression_list_history_campaign_id", "resource_type": "test", "package_name": "iterable", "path": "not_null_stg_iterable__campaig_3ce753a10225cac67c8a1434b5541997.sql", "original_file_path": "models/staging/stg_iterable.yml", "unique_id": "test.iterable.not_null_stg_iterable__campaign_suppression_list_history_campaign_id.3921289710", "fqn": ["iterable", "staging", "not_null_stg_iterable__campaign_suppression_list_history_campaign_id"], "alias": "not_null_stg_iterable__campaig_3ce753a10225cac67c8a1434b5541997", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "not_null_stg_iterable__campaig_3ce753a10225cac67c8a1434b5541997", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "sql_header": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"alias": "not_null_stg_iterable__campaig_3ce753a10225cac67c8a1434b5541997"}, "created_at": 1789079004.3184543, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"not_null_stg_iterable__campaig_3ce753a10225cac67c8a1434b5541997\") }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__campaign_suppression_list_history", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.iterable.stg_iterable__campaign_suppression_list_history"]}, "compiled_path": "target/compiled/iterable/models/staging/stg_iterable.yml/not_null_stg_iterable__campaig_3ce753a10225cac67c8a1434b5541997.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect campaign_id\nfrom \"postgres\".\"public_iterable_dev\".\"stg_iterable__campaign_suppression_list_history\"\nwhere campaign_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "campaign_id", "file_key_name": "models.stg_iterable__campaign_suppression_list_history", "attached_node": "model.iterable.stg_iterable__campaign_suppression_list_history", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "campaign_id", "model": "{{ get_where_subquery(ref('stg_iterable__campaign_suppression_list_history')) }}"}, "namespace": null}}, "test.iterable.not_null_stg_iterable__channel_channel_id.182ceb9636": {"database": "postgres", "schema": "public_dbt_test__audit", "name": "not_null_stg_iterable__channel_channel_id", "resource_type": "test", "package_name": "iterable", "path": "not_null_stg_iterable__channel_channel_id.sql", "original_file_path": "models/staging/stg_iterable.yml", "unique_id": "test.iterable.not_null_stg_iterable__channel_channel_id.182ceb9636", "fqn": ["iterable", "staging", "not_null_stg_iterable__channel_channel_id"], "alias": "not_null_stg_iterable__channel_channel_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "sql_header": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {}, "created_at": 1789079004.3201542, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__channel", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.iterable.stg_iterable__channel"]}, "compiled_path": "target/compiled/iterable/models/staging/stg_iterable.yml/not_null_stg_iterable__channel_channel_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect channel_id\nfrom \"postgres\".\"public_iterable_dev\".\"stg_iterable__channel\"\nwhere channel_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "channel_id", "file_key_name": "models.stg_iterable__channel", "attached_node": "model.iterable.stg_iterable__channel", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "channel_id", "model": "{{ get_where_subquery(ref('stg_iterable__channel')) }}"}, "namespace": null}}, "test.iterable.not_null_stg_iterable__event_event_id.370cd4bc9d": {"database": "postgres", "schema": "public_dbt_test__audit", "name": "not_null_stg_iterable__event_event_id", "resource_type": "test", "package_name": "iterable", "path": "not_null_stg_iterable__event_event_id.sql", "original_file_path": "models/staging/stg_iterable.yml", "unique_id": "test.iterable.not_null_stg_iterable__event_event_id.370cd4bc9d", "fqn": ["iterable", "staging", "not_null_stg_iterable__event_event_id"], "alias": "not_null_stg_iterable__event_event_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "sql_header": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {}, "created_at": 1789079004.3218014, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__event", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.iterable.stg_iterable__event"]}, "compiled_path": "target/compiled/iterable/models/staging/stg_iterable.yml/not_null_stg_iterable__event_event_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect event_id\nfrom \"postgres\".\"public_iterable_dev\".\"stg_iterable__event\"\nwhere event_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "event_id", "file_key_name": "models.stg_iterable__event", "attached_node": "model.iterable.stg_iterable__event", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "event_id", "model": "{{ get_where_subquery(ref('stg_iterable__event')) }}"}, "namespace": null}}, "test.iterable.not_null_stg_iterable__event_unique_event_id.e2b46d3bb6": {"database": "postgres", "schema": "public_dbt_test__audit", "name": "not_null_stg_iterable__event_unique_event_id", "resource_type": "test", "package_name": "iterable", "path": "not_null_stg_iterable__event_unique_event_id.sql", "original_file_path": "models/staging/stg_iterable.yml", "unique_id": "test.iterable.not_null_stg_iterable__event_unique_event_id.e2b46d3bb6", "fqn": ["iterable", "staging", "not_null_stg_iterable__event_unique_event_id"], "alias": "not_null_stg_iterable__event_unique_event_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "sql_header": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {}, "created_at": 1789079004.3235013, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__event", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.iterable.stg_iterable__event"]}, "compiled_path": "target/compiled/iterable/models/staging/stg_iterable.yml/not_null_stg_iterable__event_unique_event_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect unique_event_id\nfrom \"postgres\".\"public_iterable_dev\".\"stg_iterable__event\"\nwhere unique_event_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "unique_event_id", "file_key_name": "models.stg_iterable__event", "attached_node": "model.iterable.stg_iterable__event", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "unique_event_id", "model": "{{ get_where_subquery(ref('stg_iterable__event')) }}"}, "namespace": null}}, "test.iterable.not_null_stg_iterable__event_extension_event_id.144dedcd30": {"database": "postgres", "schema": "public_dbt_test__audit", "name": "not_null_stg_iterable__event_extension_event_id", "resource_type": "test", "package_name": "iterable", "path": "not_null_stg_iterable__event_extension_event_id.sql", "original_file_path": "models/staging/stg_iterable.yml", "unique_id": "test.iterable.not_null_stg_iterable__event_extension_event_id.144dedcd30", "fqn": ["iterable", "staging", "not_null_stg_iterable__event_extension_event_id"], "alias": "not_null_stg_iterable__event_extension_event_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "sql_header": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {}, "created_at": 1789079004.3252597, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__event_extension", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.iterable.stg_iterable__event_extension"]}, "compiled_path": "target/compiled/iterable/models/staging/stg_iterable.yml/not_null_stg_iterable__event_extension_event_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect event_id\nfrom \"postgres\".\"public_iterable_dev\".\"stg_iterable__event_extension\"\nwhere event_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "event_id", "file_key_name": "models.stg_iterable__event_extension", "attached_node": "model.iterable.stg_iterable__event_extension", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "event_id", "model": "{{ get_where_subquery(ref('stg_iterable__event_extension')) }}"}, "namespace": null}}, "test.iterable.not_null_stg_iterable__journey_journey_id.cc38bd633c": {"database": "postgres", "schema": "public_dbt_test__audit", "name": "not_null_stg_iterable__journey_journey_id", "resource_type": "test", "package_name": "iterable", "path": "not_null_stg_iterable__journey_journey_id.sql", "original_file_path": "models/staging/stg_iterable.yml", "unique_id": "test.iterable.not_null_stg_iterable__journey_journey_id.cc38bd633c", "fqn": ["iterable", "staging", "not_null_stg_iterable__journey_journey_id"], "alias": "not_null_stg_iterable__journey_journey_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "sql_header": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {}, "created_at": 1789079004.326939, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__journey", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.iterable.stg_iterable__journey"]}, "compiled_path": "target/compiled/iterable/models/staging/stg_iterable.yml/not_null_stg_iterable__journey_journey_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect journey_id\nfrom \"postgres\".\"public_iterable_dev\".\"stg_iterable__journey\"\nwhere journey_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "journey_id", "file_key_name": "models.stg_iterable__journey", "attached_node": "model.iterable.stg_iterable__journey", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "journey_id", "model": "{{ get_where_subquery(ref('stg_iterable__journey')) }}"}, "namespace": null}}, "test.iterable.not_null_stg_iterable__list_list_id.47029d839a": {"database": "postgres", "schema": "public_dbt_test__audit", "name": "not_null_stg_iterable__list_list_id", "resource_type": "test", "package_name": "iterable", "path": "not_null_stg_iterable__list_list_id.sql", "original_file_path": "models/staging/stg_iterable.yml", "unique_id": "test.iterable.not_null_stg_iterable__list_list_id.47029d839a", "fqn": ["iterable", "staging", "not_null_stg_iterable__list_list_id"], "alias": "not_null_stg_iterable__list_list_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "sql_header": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {}, "created_at": 1789079004.3286154, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__list", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.iterable.stg_iterable__list"]}, "compiled_path": "target/compiled/iterable/models/staging/stg_iterable.yml/not_null_stg_iterable__list_list_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect list_id\nfrom \"postgres\".\"public_iterable_dev\".\"stg_iterable__list\"\nwhere list_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "list_id", "file_key_name": "models.stg_iterable__list", "attached_node": "model.iterable.stg_iterable__list", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "list_id", "model": "{{ get_where_subquery(ref('stg_iterable__list')) }}"}, "namespace": null}}, "test.iterable.not_null_stg_iterable__message_type_message_type_id.75eaa6fa62": {"database": "postgres", "schema": "public_dbt_test__audit", "name": "not_null_stg_iterable__message_type_message_type_id", "resource_type": "test", "package_name": "iterable", "path": "not_null_stg_iterable__message_type_message_type_id.sql", "original_file_path": "models/staging/stg_iterable.yml", "unique_id": "test.iterable.not_null_stg_iterable__message_type_message_type_id.75eaa6fa62", "fqn": ["iterable", "staging", "not_null_stg_iterable__message_type_message_type_id"], "alias": "not_null_stg_iterable__message_type_message_type_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "sql_header": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {}, "created_at": 1789079004.3303366, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__message_type", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.iterable.stg_iterable__message_type"]}, "compiled_path": "target/compiled/iterable/models/staging/stg_iterable.yml/not_null_stg_iterable__message_type_message_type_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect message_type_id\nfrom \"postgres\".\"public_iterable_dev\".\"stg_iterable__message_type\"\nwhere message_type_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "message_type_id", "file_key_name": "models.stg_iterable__message_type", "attached_node": "model.iterable.stg_iterable__message_type", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "message_type_id", "model": "{{ get_where_subquery(ref('stg_iterable__message_type')) }}"}, "namespace": null}}, "test.iterable.not_null_stg_iterable__template_history_template_id.14b24a1dfe": {"database": "postgres", "schema": "public_dbt_test__audit", "name": "not_null_stg_iterable__template_history_template_id", "resource_type": "test", "package_name": "iterable", "path": "not_null_stg_iterable__template_history_template_id.sql", "original_file_path": "models/staging/stg_iterable.yml", "unique_id": "test.iterable.not_null_stg_iterable__template_history_template_id.14b24a1dfe", "fqn": ["iterable", "staging", "not_null_stg_iterable__template_history_template_id"], "alias": "not_null_stg_iterable__template_history_template_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "sql_header": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {}, "created_at": 1789079004.332152, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__template_history", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.iterable.stg_iterable__template_history"]}, "compiled_path": "target/compiled/iterable/models/staging/stg_iterable.yml/not_null_stg_iterable__template_history_template_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect template_id\nfrom \"postgres\".\"public_iterable_dev\".\"stg_iterable__template_history\"\nwhere template_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "template_id", "file_key_name": "models.stg_iterable__template_history", "attached_node": "model.iterable.stg_iterable__template_history", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "template_id", "model": "{{ get_where_subquery(ref('stg_iterable__template_history')) }}"}, "namespace": null}}, "test.iterable.not_null_stg_iterable__list_user__fivetran_user_id.cca4b34c07": {"database": "postgres", "schema": "public_dbt_test__audit", "name": "not_null_stg_iterable__list_user__fivetran_user_id", "resource_type": "test", "package_name": "iterable", "path": "not_null_stg_iterable__list_user__fivetran_user_id.sql", "original_file_path": "models/staging/stg_iterable.yml", "unique_id": "test.iterable.not_null_stg_iterable__list_user__fivetran_user_id.cca4b34c07", "fqn": ["iterable", "staging", "not_null_stg_iterable__list_user__fivetran_user_id"], "alias": "not_null_stg_iterable__list_user__fivetran_user_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "sql_header": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {}, "created_at": 1789079004.3338337, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__list_user", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.iterable.stg_iterable__list_user"]}, "compiled_path": "target/compiled/iterable/models/staging/stg_iterable.yml/not_null_stg_iterable__list_user__fivetran_user_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect _fivetran_user_id\nfrom \"postgres\".\"public_iterable_dev\".\"stg_iterable__list_user\"\nwhere _fivetran_user_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "_fivetran_user_id", "file_key_name": "models.stg_iterable__list_user", "attached_node": "model.iterable.stg_iterable__list_user", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "_fivetran_user_id", "model": "{{ get_where_subquery(ref('stg_iterable__list_user')) }}"}, "namespace": null}}, "test.iterable.not_null_stg_iterable__user_history_unique_user_key.2845af2127": {"database": "postgres", "schema": "public_dbt_test__audit", "name": "not_null_stg_iterable__user_history_unique_user_key", "resource_type": "test", "package_name": "iterable", "path": "not_null_stg_iterable__user_history_unique_user_key.sql", "original_file_path": "models/staging/stg_iterable.yml", "unique_id": "test.iterable.not_null_stg_iterable__user_history_unique_user_key.2845af2127", "fqn": ["iterable", "staging", "not_null_stg_iterable__user_history_unique_user_key"], "alias": "not_null_stg_iterable__user_history_unique_user_key", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "sql_header": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {}, "created_at": 1789079004.3355062, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__user_history", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.iterable.stg_iterable__user_history"]}, "compiled_path": "target/compiled/iterable/models/staging/stg_iterable.yml/not_null_stg_iterable__user_history_unique_user_key.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect unique_user_key\nfrom \"postgres\".\"public_iterable_dev\".\"stg_iterable__user_history\"\nwhere unique_user_key is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "unique_user_key", "file_key_name": "models.stg_iterable__user_history", "attached_node": "model.iterable.stg_iterable__user_history", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "unique_user_key", "model": "{{ get_where_subquery(ref('stg_iterable__user_history')) }}"}, "namespace": null}}, "test.iterable.not_null_stg_iterable__user_unsubscribed_channel_channel_id.da0ed9e9be": {"database": "postgres", "schema": "public_dbt_test__audit", "name": "not_null_stg_iterable__user_unsubscribed_channel_channel_id", "resource_type": "test", "package_name": "iterable", "path": "not_null_stg_iterable__user_unsubscribed_channel_channel_id.sql", "original_file_path": "models/staging/stg_iterable.yml", "unique_id": "test.iterable.not_null_stg_iterable__user_unsubscribed_channel_channel_id.da0ed9e9be", "fqn": ["iterable", "staging", "not_null_stg_iterable__user_unsubscribed_channel_channel_id"], "alias": "not_null_stg_iterable__user_unsubscribed_channel_channel_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "sql_header": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {}, "created_at": 1789079004.3371725, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__user_unsubscribed_channel", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.iterable.stg_iterable__user_unsubscribed_channel"]}, "compiled_path": "target/compiled/iterable/models/staging/stg_iterable.yml/not_null_stg_iterable__user_unsubscribed_channel_channel_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect channel_id\nfrom \"postgres\".\"public_iterable_dev\".\"stg_iterable__user_unsubscribed_channel\"\nwhere channel_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "channel_id", "file_key_name": "models.stg_iterable__user_unsubscribed_channel", "attached_node": "model.iterable.stg_iterable__user_unsubscribed_channel", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "channel_id", "model": "{{ get_where_subquery(ref('stg_iterable__user_unsubscribed_channel')) }}"}, "namespace": null}}, "test.iterable.not_null_stg_iterable__user_unsub_message_type_message_type_id.268a89ea6f": {"database": "postgres", "schema": "public_dbt_test__audit", "name": "not_null_stg_iterable__user_unsub_message_type_message_type_id", "resource_type": "test", "package_name": "iterable", "path": "not_null_stg_iterable__user_unsub_message_type_message_type_id.sql", "original_file_path": "models/staging/stg_iterable.yml", "unique_id": "test.iterable.not_null_stg_iterable__user_unsub_message_type_message_type_id.268a89ea6f", "fqn": ["iterable", "staging", "not_null_stg_iterable__user_unsub_message_type_message_type_id"], "alias": "not_null_stg_iterable__user_unsub_message_type_message_type_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "sql_header": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {}, "created_at": 1789079004.3389616, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__user_unsub_message_type", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.iterable.stg_iterable__user_unsub_message_type"]}, "compiled_path": "target/compiled/iterable/models/staging/stg_iterable.yml/not_null_stg_iterable__user_unsub_message_type_message_type_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect message_type_id\nfrom \"postgres\".\"public_iterable_dev\".\"stg_iterable__user_unsub_message_type\"\nwhere message_type_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "message_type_id", "file_key_name": "models.stg_iterable__user_unsub_message_type", "attached_node": "model.iterable.stg_iterable__user_unsub_message_type", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "message_type_id", "model": "{{ get_where_subquery(ref('stg_iterable__user_unsub_message_type')) }}"}, "namespace": null}}}, "sources": {"source.iterable.iterable.campaign_history": {"database": "postgres", "schema": "public", "name": "campaign_history", "resource_type": "source", "package_name": "iterable", "path": "models/staging/src_iterable.yml", "original_file_path": "models/staging/src_iterable.yml", "unique_id": "source.iterable.iterable.campaign_history", "fqn": ["iterable", "staging", "iterable", "campaign_history"], "source_name": "iterable", "source_description": "", "loader": "fivetran", "identifier": "campaign_history_data", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Table containing a history of campaigns.", "columns": {"id": {"name": "id", "description": "Unique identifier of the campaign record", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "updated_at": {"name": "updated_at", "description": "Last update's timestamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "name": {"name": "name", "description": "User defined name of the campaign.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "campaign_state": {"name": "campaign_state", "description": "State of the campaign. Can be Draft, Ready, Scheduled, Running, Finished, Starting, Aborted or Recurring", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "type": {"name": "type", "description": "The campaign type. Can be Blast or Triggered", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "send_size": {"name": "send_size", "description": "Size of the campaign. Number of individuals included in the campaign", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "start_at": {"name": "start_at", "description": "Start timestamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "ended_at": {"name": "ended_at", "description": "Ended timestamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "created_at": {"name": "created_at", "description": "Creation timestamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "recurring_campaign_id": {"name": "recurring_campaign_id", "description": "Reference to the recurring campaign, if applicable", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "created_by_user_id": {"name": "created_by_user_id", "description": "Reference to the user who created the campaign", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "template_id": {"name": "template_id", "description": "Reference to the campaign template", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "updated_by_user_id": {"name": "updated_by_user_id", "description": "ID of the user who updated this record", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "message_medium": {"name": "message_medium", "description": "The medium that this message was sent via, for example Email or InApp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": "_fivetran_synced", "loaded_at_query": null, "meta": {}, "tags": [], "static_analysis": null}, "patch_path": null, "unrendered_config": {"loaded_at_field": "_fivetran_synced", "enabled": true, "loaded_at_query": null, "meta": {}, "tags": []}, "relation_name": "\"postgres\".\"public\".\"campaign_history_data\"", "created_at": 1789079004.4525154, "unrendered_database": "{% if target.type != 'spark' %}{{ var('iterable_database', target.database)}}{% endif %}", "unrendered_schema": "{{var ('iterable_schema', 'iterable')}}", "doc_blocks": []}, "source.iterable.iterable.campaign_label_history": {"database": "postgres", "schema": "public", "name": "campaign_label_history", "resource_type": "source", "package_name": "iterable", "path": "models/staging/src_iterable.yml", "original_file_path": "models/staging/src_iterable.yml", "unique_id": "source.iterable.iterable.campaign_label_history", "fqn": ["iterable", "staging", "iterable", "campaign_label_history"], "source_name": "iterable", "source_description": "", "loader": "fivetran", "identifier": "campaign_label_history_data", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Table containing a history of labels.", "columns": {"campaign_id": {"name": "campaign_id", "description": "Reference to the campaign associated with the label", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "label": {"name": "label", "description": "Name of the label", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "updated_at": {"name": "updated_at", "description": "Last update timestamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": "_fivetran_synced", "loaded_at_query": null, "meta": {}, "tags": [], "static_analysis": null}, "patch_path": null, "unrendered_config": {"loaded_at_field": "_fivetran_synced", "enabled": true, "loaded_at_query": null, "meta": {}, "tags": []}, "relation_name": "\"postgres\".\"public\".\"campaign_label_history_data\"", "created_at": 1789079004.453962, "unrendered_database": "{% if target.type != 'spark' %}{{ var('iterable_database', target.database)}}{% endif %}", "unrendered_schema": "{{var ('iterable_schema', 'iterable')}}", "doc_blocks": []}, "source.iterable.iterable.campaign_list_history": {"database": "postgres", "schema": "public", "name": "campaign_list_history", "resource_type": "source", "package_name": "iterable", "path": "models/staging/src_iterable.yml", "original_file_path": "models/staging/src_iterable.yml", "unique_id": "source.iterable.iterable.campaign_list_history", "fqn": ["iterable", "staging", "iterable", "campaign_list_history"], "source_name": "iterable", "source_description": "", "loader": "fivetran", "identifier": "campaign_list_history_data", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Table containing a history of lists.", "columns": {"campaign_id": {"name": "campaign_id", "description": "Reference to the campaign associated with the label", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "list_id": {"name": "list_id", "description": "Reference to the list used", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "updated_at": {"name": "updated_at", "description": "Last update timestamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": "_fivetran_synced", "loaded_at_query": null, "meta": {}, "tags": [], "static_analysis": null}, "patch_path": null, "unrendered_config": {"loaded_at_field": "_fivetran_synced", "enabled": true, "loaded_at_query": null, "meta": {}, "tags": []}, "relation_name": "\"postgres\".\"public\".\"campaign_list_history_data\"", "created_at": 1789079004.45436, "unrendered_database": "{% if target.type != 'spark' %}{{ var('iterable_database', target.database)}}{% endif %}", "unrendered_schema": "{{var ('iterable_schema', 'iterable')}}", "doc_blocks": []}, "source.iterable.iterable.campaign_suppression_list_history": {"database": "postgres", "schema": "public", "name": "campaign_suppression_list_history", "resource_type": "source", "package_name": "iterable", "path": "models/staging/src_iterable.yml", "original_file_path": "models/staging/src_iterable.yml", "unique_id": "source.iterable.iterable.campaign_suppression_list_history", "fqn": ["iterable", "staging", "iterable", "campaign_suppression_list_history"], "source_name": "iterable", "source_description": "", "loader": "fivetran", "identifier": "campaign_suppression_list_history_data", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Table containing a history of suppression lists.\n", "columns": {"campaign_id": {"name": "campaign_id", "description": "Reference to the campaign associated with the label", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "suppressed_list_id": {"name": "suppressed_list_id", "description": "Reference to the list used", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "updated_at": {"name": "updated_at", "description": "Last update timestamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": "_fivetran_synced", "loaded_at_query": null, "meta": {}, "tags": [], "static_analysis": null}, "patch_path": null, "unrendered_config": {"loaded_at_field": "_fivetran_synced", "enabled": true, "loaded_at_query": null, "meta": {}, "tags": []}, "relation_name": "\"postgres\".\"public\".\"campaign_suppression_list_history_data\"", "created_at": 1789079004.454741, "unrendered_database": "{% if target.type != 'spark' %}{{ var('iterable_database', target.database)}}{% endif %}", "unrendered_schema": "{{var ('iterable_schema', 'iterable')}}", "doc_blocks": []}, "source.iterable.iterable.channel": {"database": "postgres", "schema": "public", "name": "channel", "resource_type": "source", "package_name": "iterable", "path": "models/staging/src_iterable.yml", "original_file_path": "models/staging/src_iterable.yml", "unique_id": "source.iterable.iterable.channel", "fqn": ["iterable", "staging", "iterable", "channel"], "source_name": "iterable", "source_description": "", "loader": "fivetran", "identifier": "channel_data", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Table containing unique channels.", "columns": {"id": {"name": "id", "description": "Unique identifier of the channel", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "name": {"name": "name", "description": "User defined name of the channel", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "channel_type": {"name": "channel_type", "description": "The channel type", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "message_medium": {"name": "message_medium", "description": "The message medium associated with the channel", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": "_fivetran_synced", "loaded_at_query": null, "meta": {}, "tags": [], "static_analysis": null}, "patch_path": null, "unrendered_config": {"loaded_at_field": "_fivetran_synced", "enabled": true, "loaded_at_query": null, "meta": {}, "tags": []}, "relation_name": "\"postgres\".\"public\".\"channel_data\"", "created_at": 1789079004.4552507, "unrendered_database": "{% if target.type != 'spark' %}{{ var('iterable_database', target.database)}}{% endif %}", "unrendered_schema": "{{var ('iterable_schema', 'iterable')}}", "doc_blocks": []}, "source.iterable.iterable.event": {"database": "postgres", "schema": "public", "name": "event", "resource_type": "source", "package_name": "iterable", "path": "models/staging/src_iterable.yml", "original_file_path": "models/staging/src_iterable.yml", "unique_id": "source.iterable.iterable.event", "fqn": ["iterable", "staging", "iterable", "event"], "source_name": "iterable", "source_description": "", "loader": "fivetran", "identifier": "event_data", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Table containing individual events within campaigns.", "columns": {"_fivetran_id": {"name": "_fivetran_id", "description": "A Fivetran-created unique identifier derived from hashing campaign_id, created_at, and event_name.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "campaign_id": {"name": "campaign_id", "description": "Reference to the campaign from which the event originated", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "content_id": {"name": "content_id", "description": "Reference to the content the event is associated with.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "created_at": {"name": "created_at", "description": "Creation timestamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "email": {"name": "email", "description": "The user's email. User identifier, for email-based projects. Previously was the unique identifier for user records, for Iterable customers before August 2023. Exists if using the history version of the table.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "additional_properties": {"name": "additional_properties", "description": "json object containing addition event properties", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "event_name": {"name": "event_name", "description": "Name provided to the individual event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "message_bus_id": {"name": "message_bus_id", "description": "Reference to the message bus associated with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "message_id": {"name": "message_id", "description": "Reference to the message the event is associated with", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "message_type_id": {"name": "message_type_id", "description": "Reference to the type of message the event is associated with", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "recipient_state": {"name": "recipient_state", "description": "The state of the recipient upon receiving the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "status": {"name": "status", "description": "Status of the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "transactional_data": {"name": "transactional_data", "description": "Transactional data associated with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unsub_source": {"name": "unsub_source", "description": "Source of the unsubscribe event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "user_agent": {"name": "user_agent", "description": "User agent associated with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "user_agent_device": {"name": "user_agent_device", "description": "The device of the user agent", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "_fivetran_user_id": {"name": "_fivetran_user_id", "description": "A Fivetran-created unique identifier for users, derived from hashing user_id and/or email, depending on project type.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": "_fivetran_synced", "loaded_at_query": null, "meta": {}, "tags": [], "static_analysis": null}, "patch_path": null, "unrendered_config": {"loaded_at_field": "_fivetran_synced", "enabled": true, "loaded_at_query": null, "meta": {}, "tags": []}, "relation_name": "\"postgres\".\"public\".\"event_data\"", "created_at": 1789079004.4556756, "unrendered_database": "{% if target.type != 'spark' %}{{ var('iterable_database', target.database)}}{% endif %}", "unrendered_schema": "{{var ('iterable_schema', 'iterable')}}", "doc_blocks": []}, "source.iterable.iterable.event_extension": {"database": "postgres", "schema": "public", "name": "event_extension", "resource_type": "source", "package_name": "iterable", "path": "models/staging/src_iterable.yml", "original_file_path": "models/staging/src_iterable.yml", "unique_id": "source.iterable.iterable.event_extension", "fqn": ["iterable", "staging", "iterable", "event_extension"], "source_name": "iterable", "source_description": "", "loader": "fivetran", "identifier": "event_extension_data", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Table containing additional properties from the event table.", "columns": {"_fivetran_id": {"name": "_fivetran_id", "description": "A Fivetran-created unique identifier derived from hashing campaign_id, created_at, and event_name.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "app_already_running": {"name": "app_already_running", "description": "Boolean indicating if the app is currently running or not", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "badge": {"name": "badge", "description": "Badge associated with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "canonical_url_id": {"name": "canonical_url_id", "description": "Reference to the url associated with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "content_available": {"name": "content_available", "description": "Content available from the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "content_id": {"name": "content_id", "description": "Reference to the content associated with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "deeplink_android": {"name": "deeplink_android", "description": "Deeplink associated with the event from an android device", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "deeplink_ios": {"name": "deeplink_ios", "description": "Deeplink associated with the event from an ios device", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "device": {"name": "device", "description": "The device associated with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "email_id": {"name": "email_id", "description": "Reference to the email associated with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "email_subject": {"name": "email_subject", "description": "Subject of the email associated with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "experiment_id": {"name": "experiment_id", "description": "Reference to the experiment used if the event is an experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "from_phone_number_id": {"name": "from_phone_number_id", "description": "Reference to the phone number which the event is from", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "from_smssender_id": {"name": "from_smssender_id", "description": "Reference to the sms sender which the event is from", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "image_url": {"name": "image_url", "description": "Image url of the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "is_ghost_push": {"name": "is_ghost_push", "description": "Boolean indicating if the event is a result of a ghost push", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "link_id": {"name": "link_id", "description": "Reference to the link associated with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "link_url": {"name": "link_url", "description": "Url of the link associated with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "locale": {"name": "locale", "description": "Locale associated with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "payload": {"name": "payload", "description": "Payload resulted from the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "platform_endpoint": {"name": "platform_endpoint", "description": "The specific platform endpoint of the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "push_message": {"name": "push_message", "description": "Boolean indicating if the event is a push message", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "region": {"name": "region", "description": "Region of the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "sms_message": {"name": "sms_message", "description": "Boolean indicating if the event is an sms message", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "sms_provider_response_code": {"name": "sms_provider_response_code", "description": "sms provider response code from the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "sms_provider_response_message": {"name": "sms_provider_response_message", "description": "sms provider response message from the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "sms_provider_response_more_info": {"name": "sms_provider_response_more_info", "description": "sms provider response addition info from the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "sms_provider_response_status": {"name": "sms_provider_response_status", "description": "Status of the sms provider response from the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "sound": {"name": "sound", "description": "Boolean indicating if a sound was used with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "to_phone_number": {"name": "to_phone_number", "description": "To phone number associated with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "url": {"name": "url", "description": "Url associated with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "workflow_id": {"name": "workflow_id", "description": "Reference to the workflow which the event originated", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "workflow_name": {"name": "workflow_name", "description": "Name of the workflow which the event originated", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "catalog_collection_count": {"name": "catalog_collection_count", "description": "The count of products or items collected in a catalog associated with the event.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "catalog_lookup_count": {"name": "catalog_lookup_count", "description": "The count of times a catalog was looked up or queried during the event.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "city": {"name": "city", "description": "The city associated with the event, which could be the location of the recipient.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "clicked_url": {"name": "clicked_url", "description": "The URL that was clicked by the recipient in response to the marketing message.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "country": {"name": "country", "description": "The country associated with the event, which could be the location of the recipient.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "error_code": {"name": "error_code", "description": "The error code or message indicating any issues or errors encountered during the event.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "expires_at": {"name": "expires_at", "description": "The date and time when the event or message is set to expire or become invalid.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "from_phone_number": {"name": "from_phone_number", "description": "The phone number from which the SMS message was sent.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "in_app_body": {"name": "in_app_body", "description": "The content or body of an in-app message that was sent as part of the event.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "is_sms_estimation": {"name": "is_sms_estimation", "description": "A boolean indicating whether the SMS message is an estimation or not.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "labels": {"name": "labels", "description": "Any labels or tags associated with the event, which can be used for categorization or organization.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "message_context": {"name": "message_context", "description": "Additional contextual information related to the marketing message or event.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "message_status": {"name": "message_status", "description": "The status of the marketing message, such as sent, delivered, opened, etc.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "mms_send_count": {"name": "mms_send_count", "description": "The count of multimedia messages (MMS) sent as part of the event.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "product_recommendation_count": {"name": "product_recommendation_count", "description": "The count of product recommendations included in the message.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "proxy_source": {"name": "proxy_source", "description": "Information about the source or proxy used for sending the message.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "reason": {"name": "reason", "description": "The reason or cause associated with a specific event or action.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "sms_send_count": {"name": "sms_send_count", "description": "The count of SMS messages sent as part of the event.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "web_push_body": {"name": "web_push_body", "description": "The content or body of a web push notification sent as part of the event.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "web_push_click_action": {"name": "web_push_click_action", "description": "The action triggered when a recipient clicks a web push notification.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "web_push_icon": {"name": "web_push_icon", "description": "The icon or image associated with the web push notification.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "web_push_message": {"name": "web_push_message", "description": "The message or notification sent to web users as part of the event.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": "_fivetran_synced", "loaded_at_query": null, "meta": {}, "tags": [], "static_analysis": null}, "patch_path": null, "unrendered_config": {"loaded_at_field": "_fivetran_synced", "enabled": true, "loaded_at_query": null, "meta": {}, "tags": []}, "relation_name": "\"postgres\".\"public\".\"event_extension_data\"", "created_at": 1789079004.4562557, "unrendered_database": "{% if target.type != 'spark' %}{{ var('iterable_database', target.database)}}{% endif %}", "unrendered_schema": "{{var ('iterable_schema', 'iterable')}}", "doc_blocks": []}, "source.iterable.iterable.journey": {"database": "postgres", "schema": "public", "name": "journey", "resource_type": "source", "package_name": "iterable", "path": "models/staging/src_iterable.yml", "original_file_path": "models/staging/src_iterable.yml", "unique_id": "source.iterable.iterable.journey", "fqn": ["iterable", "staging", "iterable", "journey"], "source_name": "iterable", "source_description": "", "loader": "fivetran", "identifier": "journey", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Table containing unique journeys, formerly known as workflows.", "columns": {"id": {"name": "id", "description": "Unique identifier of the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "name": {"name": "name", "description": "User defined name of the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "journey_type": {"name": "journey_type", "description": "The journey type", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "description": {"name": "description", "description": "Information about the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "creator_user_id": {"name": "creator_user_id", "description": "Reference to the user who created the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "enabled": {"name": "enabled", "description": "Boolean indicating if the journey is currently enabled", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "is_archived": {"name": "is_archived", "description": "Boolean indicating if the journey has been archived", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "lifetime_limit": {"name": "lifetime_limit", "description": "Maximum number of times a user may enter the journey over their lifetime", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "simultaneous_limit": {"name": "simultaneous_limit", "description": "Maximum number of times a user may be in the journey at the same time", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "start_tile_id": {"name": "start_tile_id", "description": "Reference to the tile which begins the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "trigger_event_names": {"name": "trigger_event_names", "description": "The event names which trigger a user's entry into the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "created_at": {"name": "created_at", "description": "Creation timestamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "updated_at": {"name": "updated_at", "description": "Last update timestamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": "_fivetran_synced", "loaded_at_query": null, "meta": {}, "tags": [], "static_analysis": null}, "patch_path": null, "unrendered_config": {"loaded_at_field": "_fivetran_synced", "enabled": true, "loaded_at_query": null, "meta": {}, "tags": []}, "relation_name": "\"postgres\".\"public\".\"journey\"", "created_at": 1789079004.4566548, "unrendered_database": "{% if target.type != 'spark' %}{{ var('iterable_database', target.database)}}{% endif %}", "unrendered_schema": "{{var ('iterable_schema', 'iterable')}}", "doc_blocks": []}, "source.iterable.iterable.list": {"database": "postgres", "schema": "public", "name": "list", "resource_type": "source", "package_name": "iterable", "path": "models/staging/src_iterable.yml", "original_file_path": "models/staging/src_iterable.yml", "unique_id": "source.iterable.iterable.list", "fqn": ["iterable", "staging", "iterable", "list"], "source_name": "iterable", "source_description": "", "loader": "fivetran", "identifier": "list_data", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Table containing users and the lists the users are associated with.", "columns": {"id": {"name": "id", "description": "Unique identifier of the list", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "name": {"name": "name", "description": "User defined name of the list", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "list_type": {"name": "list_type", "description": "The list type", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "created_at": {"name": "created_at", "description": "Creation timestamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "description": {"name": "description", "description": "Information about the list", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": "_fivetran_synced", "loaded_at_query": null, "meta": {}, "tags": [], "static_analysis": null}, "patch_path": null, "unrendered_config": {"loaded_at_field": "_fivetran_synced", "enabled": true, "loaded_at_query": null, "meta": {}, "tags": []}, "relation_name": "\"postgres\".\"public\".\"list_data\"", "created_at": 1789079004.4570384, "unrendered_database": "{% if target.type != 'spark' %}{{ var('iterable_database', target.database)}}{% endif %}", "unrendered_schema": "{{var ('iterable_schema', 'iterable')}}", "doc_blocks": []}, "source.iterable.iterable.message_type": {"database": "postgres", "schema": "public", "name": "message_type", "resource_type": "source", "package_name": "iterable", "path": "models/staging/src_iterable.yml", "original_file_path": "models/staging/src_iterable.yml", "unique_id": "source.iterable.iterable.message_type", "fqn": ["iterable", "staging", "iterable", "message_type"], "source_name": "iterable", "source_description": "", "loader": "fivetran", "identifier": "message_type_data", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Table containing unique message types.", "columns": {"id": {"name": "id", "description": "Unique identifier of the message type", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "name": {"name": "name", "description": "User defined name of the message type", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "channel_id": {"name": "channel_id", "description": "Channel that this message type belongs to", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "created_at": {"name": "created_at", "description": "Time when the message type was initially created", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "frequency_cap": {"name": "frequency_cap", "description": "The maximum number of times a message of this type can be sent to a recipient within a specified time period to prevent over-messaging", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "rate_limit_per_minute": {"name": "rate_limit_per_minute", "description": "The maximum number of messages of this type that can be sent to recipients in a minute, ensuring controlled message delivery", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "subscription_policy": {"name": "subscription_policy", "description": "Information about the policy or rules governing how users can subscribe to or unsubscribe from this specific message type, like OptOut", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "updated_at": {"name": "updated_at", "description": "Time when the message type was last updated or modified", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": "_fivetran_synced", "loaded_at_query": null, "meta": {}, "tags": [], "static_analysis": null}, "patch_path": null, "unrendered_config": {"loaded_at_field": "_fivetran_synced", "enabled": true, "loaded_at_query": null, "meta": {}, "tags": []}, "relation_name": "\"postgres\".\"public\".\"message_type_data\"", "created_at": 1789079004.4574254, "unrendered_database": "{% if target.type != 'spark' %}{{ var('iterable_database', target.database)}}{% endif %}", "unrendered_schema": "{{var ('iterable_schema', 'iterable')}}", "doc_blocks": []}, "source.iterable.iterable.template_history": {"database": "postgres", "schema": "public", "name": "template_history", "resource_type": "source", "package_name": "iterable", "path": "models/staging/src_iterable.yml", "original_file_path": "models/staging/src_iterable.yml", "unique_id": "source.iterable.iterable.template_history", "fqn": ["iterable", "staging", "iterable", "template_history"], "source_name": "iterable", "source_description": "", "loader": "fivetran", "identifier": "template_history_data", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Table containing unique templates used across campaigns.", "columns": {"id": {"name": "id", "description": "Unique identifier of the template", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "name": {"name": "name", "description": "User defined name of the template", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "template_type": {"name": "template_type", "description": "The type of the template", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "created_at": {"name": "created_at", "description": "Creation timestamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "client_template_id": {"name": "client_template_id", "description": "Reference to the client template", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "creator_user_id": {"name": "creator_user_id", "description": "Reference to the user who created the template", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "message_type_id": {"name": "message_type_id", "description": "Reference to the message type associated with the template", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "updated_at": {"name": "updated_at", "description": "Last update timestamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": "_fivetran_synced", "loaded_at_query": null, "meta": {}, "tags": [], "static_analysis": null}, "patch_path": null, "unrendered_config": {"loaded_at_field": "_fivetran_synced", "enabled": true, "loaded_at_query": null, "meta": {}, "tags": []}, "relation_name": "\"postgres\".\"public\".\"template_history_data\"", "created_at": 1789079004.4578168, "unrendered_database": "{% if target.type != 'spark' %}{{ var('iterable_database', target.database)}}{% endif %}", "unrendered_schema": "{{var ('iterable_schema', 'iterable')}}", "doc_blocks": []}, "source.iterable.iterable.user_history": {"database": "postgres", "schema": "public", "name": "user_history", "resource_type": "source", "package_name": "iterable", "path": "models/staging/src_iterable.yml", "original_file_path": "models/staging/src_iterable.yml", "unique_id": "source.iterable.iterable.user_history", "fqn": ["iterable", "staging", "iterable", "user_history"], "source_name": "iterable", "source_description": "", "loader": "fivetran", "identifier": "user_history_data", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Table containing individual user history information.", "columns": {"email": {"name": "email", "description": "The user's email. Previously was the unique identifier for the user records, for Iterable customers before August 2023. This has since been replaced by iterable_user_id.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "user_id": {"name": "user_id", "description": "User defined identifier of the user. This is not a unique field", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "iterable_user_id": {"name": "iterable_user_id", "description": "The unique identifier of the user", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "first_name": {"name": "first_name", "description": "First name of the user", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "last_name": {"name": "last_name", "description": "Last name of the user", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "email_list_ids": {"name": "email_list_ids", "description": "[DEPRECATED October 13, 2025 Use LIST_USER source instead.] Array of references to the lists associated with the user\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "signup_date": {"name": "signup_date", "description": "Timestamp of when the user signed up", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "signup_source": {"name": "signup_source", "description": "Source where the user signed up", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "updated_at": {"name": "updated_at", "description": "Last update timestamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": "_fivetran_synced", "loaded_at_query": null, "meta": {}, "tags": [], "static_analysis": null}, "patch_path": null, "unrendered_config": {"loaded_at_field": "_fivetran_synced", "enabled": true, "loaded_at_query": null, "meta": {}, "tags": []}, "relation_name": "\"postgres\".\"public\".\"user_history_data\"", "created_at": 1789079004.4582138, "unrendered_database": "{% if target.type != 'spark' %}{{ var('iterable_database', target.database)}}{% endif %}", "unrendered_schema": "{{var ('iterable_schema', 'iterable')}}", "doc_blocks": []}, "source.iterable.iterable.user_unsubscribed_channel": {"database": "postgres", "schema": "public", "name": "user_unsubscribed_channel", "resource_type": "source", "package_name": "iterable", "path": "models/staging/src_iterable.yml", "original_file_path": "models/staging/src_iterable.yml", "unique_id": "source.iterable.iterable.user_unsubscribed_channel", "fqn": ["iterable", "staging", "iterable", "user_unsubscribed_channel"], "source_name": "iterable", "source_description": "", "loader": "fivetran", "identifier": "user_unsubscribed_channel_data", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Table containing the channels from which a user has unsubscribed.", "columns": {"_fivetran_id": {"name": "_fivetran_id", "description": "A Fivetran-created unique identifier for users, derived from hashing user_id and/or email, depending on project type.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "channel_id": {"name": "channel_id", "description": "Reference to the channel from which the user unsubscribed", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": "_fivetran_synced", "loaded_at_query": null, "meta": {}, "tags": [], "static_analysis": null}, "patch_path": null, "unrendered_config": {"loaded_at_field": "_fivetran_synced", "enabled": true, "loaded_at_query": null, "meta": {}, "tags": []}, "relation_name": "\"postgres\".\"public\".\"user_unsubscribed_channel_data\"", "created_at": 1789079004.4585803, "unrendered_database": "{% if target.type != 'spark' %}{{ var('iterable_database', target.database)}}{% endif %}", "unrendered_schema": "{{var ('iterable_schema', 'iterable')}}", "doc_blocks": []}, "source.iterable.iterable.user_unsubscribed_message_type": {"database": "postgres", "schema": "public", "name": "user_unsubscribed_message_type", "resource_type": "source", "package_name": "iterable", "path": "models/staging/src_iterable.yml", "original_file_path": "models/staging/src_iterable.yml", "unique_id": "source.iterable.iterable.user_unsubscribed_message_type", "fqn": ["iterable", "staging", "iterable", "user_unsubscribed_message_type"], "source_name": "iterable", "source_description": "", "loader": "fivetran", "identifier": "user_unsubscribed_message_type_data", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Table containing the message types from which a user has unsubscribed.", "columns": {"_fivetran_id": {"name": "_fivetran_id", "description": "A Fivetran-created unique identifier for users, derived from hashing user_id and/or email, depending on project type.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "message_type_id": {"name": "message_type_id", "description": "Reference to the message type from which the user unsubscribed", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": "_fivetran_synced", "loaded_at_query": null, "meta": {}, "tags": [], "static_analysis": null}, "patch_path": null, "unrendered_config": {"loaded_at_field": "_fivetran_synced", "enabled": true, "loaded_at_query": null, "meta": {}, "tags": []}, "relation_name": "\"postgres\".\"public\".\"user_unsubscribed_message_type_data\"", "created_at": 1789079004.458988, "unrendered_database": "{% if target.type != 'spark' %}{{ var('iterable_database', target.database)}}{% endif %}", "unrendered_schema": "{{var ('iterable_schema', 'iterable')}}", "doc_blocks": []}, "source.iterable.iterable.user_unsubscribed_channel_history": {"database": "postgres", "schema": "public", "name": "user_unsubscribed_channel_history", "resource_type": "source", "package_name": "iterable", "path": "models/staging/src_iterable.yml", "original_file_path": "models/staging/src_iterable.yml", "unique_id": "source.iterable.iterable.user_unsubscribed_channel_history", "fqn": ["iterable", "staging", "iterable", "user_unsubscribed_channel_history"], "source_name": "iterable", "source_description": "", "loader": "fivetran", "identifier": "user_unsubscribed_channel_history_data", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Table containing the history of channels from which a user has unsubscribed.", "columns": {"channel_id": {"name": "channel_id", "description": "Reference to the channel from which the user unsubscribed", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "email": {"name": "email", "description": "Unique identifier of the user", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "updated_at": {"name": "updated_at", "description": "Last update timestamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": "_fivetran_synced", "loaded_at_query": null, "meta": {}, "tags": [], "static_analysis": null}, "patch_path": null, "unrendered_config": {"loaded_at_field": "_fivetran_synced", "enabled": true, "loaded_at_query": null, "meta": {}, "tags": []}, "relation_name": "\"postgres\".\"public\".\"user_unsubscribed_channel_history_data\"", "created_at": 1789079004.459353, "unrendered_database": "{% if target.type != 'spark' %}{{ var('iterable_database', target.database)}}{% endif %}", "unrendered_schema": "{{var ('iterable_schema', 'iterable')}}", "doc_blocks": []}, "source.iterable.iterable.user_unsubscribed_message_type_history": {"database": "postgres", "schema": "public", "name": "user_unsubscribed_message_type_history", "resource_type": "source", "package_name": "iterable", "path": "models/staging/src_iterable.yml", "original_file_path": "models/staging/src_iterable.yml", "unique_id": "source.iterable.iterable.user_unsubscribed_message_type_history", "fqn": ["iterable", "staging", "iterable", "user_unsubscribed_message_type_history"], "source_name": "iterable", "source_description": "", "loader": "fivetran", "identifier": "user_unsubscribed_message_type_history_data", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Table containing the history of message types from which a user has unsubscribed.", "columns": {"message_type_id": {"name": "message_type_id", "description": "Reference to the message type from which the user unsubscribed", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "email": {"name": "email", "description": "Unique identifier of the user", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "updated_at": {"name": "updated_at", "description": "Last update timestamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": "_fivetran_synced", "loaded_at_query": null, "meta": {}, "tags": [], "static_analysis": null}, "patch_path": null, "unrendered_config": {"loaded_at_field": "_fivetran_synced", "enabled": true, "loaded_at_query": null, "meta": {}, "tags": []}, "relation_name": "\"postgres\".\"public\".\"user_unsubscribed_message_type_history_data\"", "created_at": 1789079004.4597125, "unrendered_database": "{% if target.type != 'spark' %}{{ var('iterable_database', target.database)}}{% endif %}", "unrendered_schema": "{{var ('iterable_schema', 'iterable')}}", "doc_blocks": []}, "source.iterable.iterable.list_user": {"database": "postgres", "schema": "public", "name": "list_user", "resource_type": "source", "package_name": "iterable", "path": "models/staging/src_iterable.yml", "original_file_path": "models/staging/src_iterable.yml", "unique_id": "source.iterable.iterable.list_user", "fqn": ["iterable", "staging", "iterable", "list_user"], "source_name": "iterable", "source_description": "", "loader": "fivetran", "identifier": "list_user_data", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Table containing the relationship between users and lists they belong to.", "columns": {"_fivetran_id": {"name": "_fivetran_id", "description": "Unique identifier of the list-user relationship record, serving as a foreign key to `user_history._fivetran_id`.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "index": {"name": "index", "description": "Index of the record", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "list_id": {"name": "list_id", "description": "Reference to the list that the user belongs to", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "Timestamp when the record was last synced by Fivetran", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": "_fivetran_synced", "loaded_at_query": null, "meta": {}, "tags": [], "static_analysis": null}, "patch_path": null, "unrendered_config": {"loaded_at_field": "_fivetran_synced", "enabled": true, "loaded_at_query": null, "meta": {}, "tags": []}, "relation_name": "\"postgres\".\"public\".\"list_user_data\"", "created_at": 1789079004.4600847, "unrendered_database": "{% if target.type != 'spark' %}{{ var('iterable_database', target.database)}}{% endif %}", "unrendered_schema": "{{var ('iterable_schema', 'iterable')}}", "doc_blocks": []}}, "macros": {"macro.dbt_postgres.postgres__current_timestamp": {"name": "postgres__current_timestamp", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/timestamps.sql", "original_file_path": "macros/timestamps.sql", "unique_id": "macro.dbt_postgres.postgres__current_timestamp", "macro_sql": "{% macro postgres__current_timestamp() -%}\n now()\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789079002.2570221, "supported_languages": null}, "macro.dbt_postgres.postgres__snapshot_string_as_time": {"name": "postgres__snapshot_string_as_time", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/timestamps.sql", "original_file_path": "macros/timestamps.sql", "unique_id": "macro.dbt_postgres.postgres__snapshot_string_as_time", "macro_sql": "{% macro postgres__snapshot_string_as_time(timestamp) -%}\n {%- set result = \"'\" ~ timestamp ~ \"'::timestamp without time zone\" -%}\n {{ return(result) }}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "timestamp", "type": null, "description": ""}], "created_at": 1789079002.2572875, "supported_languages": null}, "macro.dbt_postgres.postgres__snapshot_get_time": {"name": "postgres__snapshot_get_time", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/timestamps.sql", "original_file_path": "macros/timestamps.sql", "unique_id": "macro.dbt_postgres.postgres__snapshot_get_time", "macro_sql": "{% macro postgres__snapshot_get_time() -%}\n {{ current_timestamp() }}::timestamp without time zone\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.current_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789079002.2574263, "supported_languages": null}, "macro.dbt_postgres.postgres__current_timestamp_backcompat": {"name": "postgres__current_timestamp_backcompat", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/timestamps.sql", "original_file_path": "macros/timestamps.sql", "unique_id": "macro.dbt_postgres.postgres__current_timestamp_backcompat", "macro_sql": "{% macro postgres__current_timestamp_backcompat() %}\n current_timestamp::{{ type_timestamp() }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.type_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789079002.257558, "supported_languages": null}, "macro.dbt_postgres.postgres__current_timestamp_in_utc_backcompat": {"name": "postgres__current_timestamp_in_utc_backcompat", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/timestamps.sql", "original_file_path": "macros/timestamps.sql", "unique_id": "macro.dbt_postgres.postgres__current_timestamp_in_utc_backcompat", "macro_sql": "{% macro postgres__current_timestamp_in_utc_backcompat() %}\n (current_timestamp at time zone 'utc')::{{ type_timestamp() }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.type_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789079002.257687, "supported_languages": null}, "macro.dbt_postgres.postgres__get_catalog_relations": {"name": "postgres__get_catalog_relations", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/catalog.sql", "original_file_path": "macros/catalog.sql", "unique_id": "macro.dbt_postgres.postgres__get_catalog_relations", "macro_sql": "{% macro postgres__get_catalog_relations(information_schema, relations) -%}\n {%- call statement('catalog', fetch_result=True) -%}\n\n {#\n If the user has multiple databases set and the first one is wrong, this will fail.\n But we won't fail in the case where there are multiple quoting-difference-only dbs, which is better.\n #}\n {% set database = information_schema.database %}\n {{ adapter.verify_database(database) }}\n\n select\n '{{ database }}' as table_database,\n sch.nspname as table_schema,\n tbl.relname as table_name,\n case tbl.relkind\n when 'v' then 'VIEW'\n when 'm' then 'MATERIALIZED VIEW'\n else 'BASE TABLE'\n end as table_type,\n tbl_desc.description as table_comment,\n col.attname as column_name,\n col.attnum as column_index,\n pg_catalog.format_type(col.atttypid, col.atttypmod) as column_type,\n col_desc.description as column_comment,\n pg_get_userbyid(tbl.relowner) as table_owner\n\n from pg_catalog.pg_namespace sch\n join pg_catalog.pg_class tbl on tbl.relnamespace = sch.oid\n join pg_catalog.pg_attribute col on col.attrelid = tbl.oid\n left outer join pg_catalog.pg_description tbl_desc on (tbl_desc.objoid = tbl.oid and tbl_desc.objsubid = 0)\n left outer join pg_catalog.pg_description col_desc on (col_desc.objoid = tbl.oid and col_desc.objsubid = col.attnum)\n where (\n {%- for relation in relations -%}\n {%- if relation.identifier -%}\n (upper(sch.nspname) = upper('{{ relation.schema }}') and\n upper(tbl.relname) = upper('{{ relation.identifier }}'))\n {%- else-%}\n upper(sch.nspname) = upper('{{ relation.schema }}')\n {%- endif -%}\n {%- if not loop.last %} or {% endif -%}\n {%- endfor -%}\n )\n and not pg_is_other_temp_schema(sch.oid) -- not a temporary schema belonging to another session\n and tbl.relpersistence in ('p', 'u') -- [p]ermanent table or [u]nlogged table. Exclude [t]emporary tables\n and tbl.relkind in ('r', 'v', 'f', 'p', 'm') -- o[r]dinary table, [v]iew, [f]oreign table, [p]artitioned table, [m]aterialized view. Other values are [i]ndex, [S]equence, [c]omposite type, [t]OAST table\n and col.attnum > 0 -- negative numbers are used for system columns such as oid\n and not col.attisdropped -- column as not been dropped\n\n order by\n sch.nspname,\n tbl.relname,\n col.attnum\n\n {%- endcall -%}\n\n {{ return(load_result('catalog').table) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "information_schema", "type": null, "description": ""}, {"name": "relations", "type": null, "description": ""}], "created_at": 1789079002.2589054, "supported_languages": null}, "macro.dbt_postgres.postgres__get_catalog": {"name": "postgres__get_catalog", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/catalog.sql", "original_file_path": "macros/catalog.sql", "unique_id": "macro.dbt_postgres.postgres__get_catalog", "macro_sql": "{% macro postgres__get_catalog(information_schema, schemas) -%}\n {%- set relations = [] -%}\n {%- for schema in schemas -%}\n {%- set dummy = relations.append({'schema': schema}) -%}\n {%- endfor -%}\n {{ return(postgres__get_catalog_relations(information_schema, relations)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__get_catalog_relations"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "information_schema", "type": null, "description": ""}, {"name": "schemas", "type": null, "description": ""}], "created_at": 1789079002.2593236, "supported_languages": null}, "macro.dbt_postgres.postgres__get_relations": {"name": "postgres__get_relations", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/relations.sql", "original_file_path": "macros/relations.sql", "unique_id": "macro.dbt_postgres.postgres__get_relations", "macro_sql": "{% macro postgres__get_relations() -%}\n\n {#\n -- in pg_depend, objid is the dependent, refobjid is the referenced object\n -- > a pg_depend entry indicates that the referenced object cannot be\n -- > dropped without also dropping the dependent object.\n #}\n\n {%- call statement('relations', fetch_result=True) -%}\n select distinct\n dependent_namespace.nspname as dependent_schema,\n dependent_class.relname as dependent_name,\n referenced_namespace.nspname as referenced_schema,\n referenced_class.relname as referenced_name\n\n -- Query for views: views are entries in pg_class with an entry in pg_rewrite, but we avoid\n -- a seq scan on pg_rewrite by leveraging the fact there is an \"internal\" row in pg_depend for\n -- the view...\n from pg_class as dependent_class\n join pg_namespace as dependent_namespace on dependent_namespace.oid = dependent_class.relnamespace\n join pg_depend as dependent_depend on dependent_depend.refobjid = dependent_class.oid\n and dependent_depend.classid = 'pg_rewrite'::regclass\n and dependent_depend.refclassid = 'pg_class'::regclass\n and dependent_depend.deptype = 'i'\n\n -- ... and via pg_depend (that has a row per column, hence the need for \"distinct\" above, and\n -- making sure to exclude the internal row to avoid a view appearing to depend on itself)...\n join pg_depend as joining_depend on joining_depend.objid = dependent_depend.objid\n and joining_depend.classid = 'pg_rewrite'::regclass\n and joining_depend.refclassid = 'pg_class'::regclass\n and joining_depend.refobjid != dependent_depend.refobjid\n\n -- ... we can find the tables they query from in pg_class, but excluding system tables. Note we\n -- don't need need to exclude _dependent_ system tables, because they only query from other\n -- system tables, and so are automatically excluded by excluding _referenced_ system tables\n join pg_class as referenced_class on referenced_class.oid = joining_depend.refobjid\n join pg_namespace as referenced_namespace on referenced_namespace.oid = referenced_class.relnamespace\n and referenced_namespace.nspname != 'information_schema'\n and referenced_namespace.nspname not like 'pg\\_%'\n\n order by\n dependent_schema, dependent_name, referenced_schema, referenced_name;\n\n {%- endcall -%}\n\n {{ return(load_result('relations').table) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789079002.2598848, "supported_languages": null}, "macro.dbt_postgres.postgres_get_relations": {"name": "postgres_get_relations", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/relations.sql", "original_file_path": "macros/relations.sql", "unique_id": "macro.dbt_postgres.postgres_get_relations", "macro_sql": "{% macro postgres_get_relations() %}\n {{ return(postgres__get_relations()) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__get_relations"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789079002.2600472, "supported_languages": null}, "macro.dbt_postgres.postgres__create_table_as": {"name": "postgres__create_table_as", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "unique_id": "macro.dbt_postgres.postgres__create_table_as", "macro_sql": "{% macro postgres__create_table_as(temporary, relation, sql) -%}\n {%- set unlogged = config.get('unlogged', default=false) -%}\n {%- set sql_header = config.get('sql_header', none) -%}\n\n {{ sql_header if sql_header is not none }}\n\n create {% if temporary -%}\n temporary\n {%- elif unlogged -%}\n unlogged\n {%- endif %} table {{ relation }}\n {% set contract_config = config.get('contract') %}\n {% if contract_config.enforced %}\n {{ get_assert_columns_equivalent(sql) }}\n {% endif -%}\n {% if contract_config.enforced and (not temporary) -%}\n {{ get_table_columns_and_constraints() }} ;\n insert into {{ relation }} (\n {{ adapter.dispatch('get_column_names', 'dbt')() }}\n )\n {%- set sql = get_select_subquery(sql) %}\n {% else %}\n as\n {% endif %}\n (\n {{ sql }}\n );\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.get_assert_columns_equivalent", "macro.dbt.get_table_columns_and_constraints", "macro.dbt.default__get_column_names", "macro.dbt.get_select_subquery"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "temporary", "type": null, "description": ""}, {"name": "relation", "type": null, "description": ""}, {"name": "sql", "type": null, "description": ""}], "created_at": 1789079002.262571, "supported_languages": null}, "macro.dbt_postgres.postgres__get_create_index_sql": {"name": "postgres__get_create_index_sql", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "unique_id": "macro.dbt_postgres.postgres__get_create_index_sql", "macro_sql": "{% macro postgres__get_create_index_sql(relation, index_dict) -%}\n {%- set index_config = adapter.parse_index(index_dict) -%}\n {%- set comma_separated_columns = \", \".join(index_config.columns) -%}\n {%- set index_name = index_config.render(relation) -%}\n\n create {% if index_config.unique -%}\n unique\n {%- endif %} index if not exists\n \"{{ index_name }}\"\n on {{ relation }} {% if index_config.type -%}\n using {{ index_config.type }}\n {%- endif %}\n ({{ comma_separated_columns }})\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "index_dict", "type": null, "description": ""}], "created_at": 1789079002.2631474, "supported_languages": null}, "macro.dbt_postgres.postgres__create_schema": {"name": "postgres__create_schema", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "unique_id": "macro.dbt_postgres.postgres__create_schema", "macro_sql": "{% macro postgres__create_schema(relation) -%}\n {% if relation.database -%}\n {{ adapter.verify_database(relation.database) }}\n {%- endif -%}\n {%- call statement('create_schema') -%}\n create schema if not exists {{ relation.without_identifier().include(database=False) }}\n {%- endcall -%}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789079002.2635005, "supported_languages": null}, "macro.dbt_postgres.postgres__drop_schema": {"name": "postgres__drop_schema", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "unique_id": "macro.dbt_postgres.postgres__drop_schema", "macro_sql": "{% macro postgres__drop_schema(relation) -%}\n {% if relation.database -%}\n {{ adapter.verify_database(relation.database) }}\n {%- endif -%}\n {%- call statement('drop_schema') -%}\n drop schema if exists {{ relation.without_identifier().include(database=False) }} cascade\n {%- endcall -%}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789079002.2638617, "supported_languages": null}, "macro.dbt_postgres.postgres__get_columns_in_relation": {"name": "postgres__get_columns_in_relation", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "unique_id": "macro.dbt_postgres.postgres__get_columns_in_relation", "macro_sql": "{% macro postgres__get_columns_in_relation(relation) -%}\n {% call statement('get_columns_in_relation', fetch_result=True) %}\n select\n column_name,\n data_type,\n character_maximum_length,\n numeric_precision,\n numeric_scale\n\n from {{ relation.information_schema('columns') }}\n where table_name = '{{ relation.identifier }}'\n {% if relation.schema %}\n and table_schema = '{{ relation.schema }}'\n {% endif %}\n order by ordinal_position\n\n {% endcall %}\n {% set table = load_result('get_columns_in_relation').table %}\n {{ return(sql_convert_columns_in_relation(table)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement", "macro.dbt.sql_convert_columns_in_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789079002.2643924, "supported_languages": null}, "macro.dbt_postgres.postgres__list_relations_without_caching": {"name": "postgres__list_relations_without_caching", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "unique_id": "macro.dbt_postgres.postgres__list_relations_without_caching", "macro_sql": "{% macro postgres__list_relations_without_caching(schema_relation) %}\n {% call statement('list_relations_without_caching', fetch_result=True) -%}\n select\n '{{ schema_relation.database }}' as database,\n tablename as name,\n schemaname as schema,\n 'table' as type\n from pg_tables\n where schemaname ilike '{{ schema_relation.schema }}'\n union all\n select\n '{{ schema_relation.database }}' as database,\n viewname as name,\n schemaname as schema,\n 'view' as type\n from pg_views\n where schemaname ilike '{{ schema_relation.schema }}'\n union all\n select\n '{{ schema_relation.database }}' as database,\n matviewname as name,\n schemaname as schema,\n 'materialized_view' as type\n from pg_matviews\n where schemaname ilike '{{ schema_relation.schema }}'\n union all\n select distinct\n '{{ schema_relation.database }}' as database,\n proname as name,\n ns.nspname as schema,\n 'function' as type\n from pg_proc\n join pg_namespace as ns on pronamespace = ns.oid\n where ns.nspname ilike '{{ schema_relation.schema }}'\n {% endcall %}\n {{ return(load_result('list_relations_without_caching').table) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "schema_relation", "type": null, "description": ""}], "created_at": 1789079002.2649593, "supported_languages": null}, "macro.dbt_postgres.postgres__information_schema_name": {"name": "postgres__information_schema_name", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "unique_id": "macro.dbt_postgres.postgres__information_schema_name", "macro_sql": "{% macro postgres__information_schema_name(database) -%}\n {% if database_name -%}\n {{ adapter.verify_database(database_name) }}\n {%- endif -%}\n information_schema\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "database", "type": null, "description": ""}], "created_at": 1789079002.265158, "supported_languages": null}, "macro.dbt_postgres.postgres__list_schemas": {"name": "postgres__list_schemas", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "unique_id": "macro.dbt_postgres.postgres__list_schemas", "macro_sql": "{% macro postgres__list_schemas(database) %}\n {% if database -%}\n {{ adapter.verify_database(database) }}\n {%- endif -%}\n {% call statement('list_schemas', fetch_result=True, auto_begin=False) %}\n select distinct nspname from pg_namespace\n {% endcall %}\n {{ return(load_result('list_schemas').table) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "database", "type": null, "description": ""}], "created_at": 1789079002.2655349, "supported_languages": null}, "macro.dbt_postgres.postgres__check_schema_exists": {"name": "postgres__check_schema_exists", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "unique_id": "macro.dbt_postgres.postgres__check_schema_exists", "macro_sql": "{% macro postgres__check_schema_exists(information_schema, schema) -%}\n {% if information_schema.database -%}\n {{ adapter.verify_database(information_schema.database) }}\n {%- endif -%}\n {% call statement('check_schema_exists', fetch_result=True, auto_begin=False) %}\n select count(*) from pg_namespace where nspname = '{{ schema }}'\n {% endcall %}\n {{ return(load_result('check_schema_exists').table) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "information_schema", "type": null, "description": ""}, {"name": "schema", "type": null, "description": ""}], "created_at": 1789079002.2659714, "supported_languages": null}, "macro.dbt_postgres.postgres__make_relation_with_suffix": {"name": "postgres__make_relation_with_suffix", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "unique_id": "macro.dbt_postgres.postgres__make_relation_with_suffix", "macro_sql": "{% macro postgres__make_relation_with_suffix(base_relation, suffix, dstring) %}\n {% if dstring %}\n {% set dt = modules.datetime.datetime.now() %}\n {% set dtstring = dt.strftime(\"%H%M%S%f\") %}\n {% set suffix = suffix ~ dtstring %}\n {% endif %}\n {% set suffix_length = suffix|length %}\n {% set relation_max_name_length = base_relation.relation_max_name_length() %}\n {% if suffix_length > relation_max_name_length %}\n {% do exceptions.raise_compiler_error('Relation suffix is too long (' ~ suffix_length ~ ' characters). Maximum length is ' ~ relation_max_name_length ~ ' characters.') %}\n {% endif %}\n {% set identifier = base_relation.identifier[:relation_max_name_length - suffix_length] ~ suffix %}\n\n {{ return(base_relation.incorporate(path={\"identifier\": identifier })) }}\n\n {% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "base_relation", "type": null, "description": ""}, {"name": "suffix", "type": null, "description": ""}, {"name": "dstring", "type": null, "description": ""}], "created_at": 1789079002.2669744, "supported_languages": null}, "macro.dbt_postgres.postgres__make_intermediate_relation": {"name": "postgres__make_intermediate_relation", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "unique_id": "macro.dbt_postgres.postgres__make_intermediate_relation", "macro_sql": "{% macro postgres__make_intermediate_relation(base_relation, suffix) %}\n {{ return(postgres__make_relation_with_suffix(base_relation, suffix, dstring=False)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__make_relation_with_suffix"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "base_relation", "type": null, "description": ""}, {"name": "suffix", "type": null, "description": ""}], "created_at": 1789079002.267209, "supported_languages": null}, "macro.dbt_postgres.postgres__make_temp_relation": {"name": "postgres__make_temp_relation", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "unique_id": "macro.dbt_postgres.postgres__make_temp_relation", "macro_sql": "{% macro postgres__make_temp_relation(base_relation, suffix) %}\n {% set temp_relation = postgres__make_relation_with_suffix(base_relation, suffix, dstring=True) %}\n {{ return(temp_relation.incorporate(path={\"schema\": none,\n \"database\": none})) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__make_relation_with_suffix"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "base_relation", "type": null, "description": ""}, {"name": "suffix", "type": null, "description": ""}], "created_at": 1789079002.2675655, "supported_languages": null}, "macro.dbt_postgres.postgres__make_backup_relation": {"name": "postgres__make_backup_relation", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "unique_id": "macro.dbt_postgres.postgres__make_backup_relation", "macro_sql": "{% macro postgres__make_backup_relation(base_relation, backup_relation_type, suffix) %}\n {% set backup_relation = postgres__make_relation_with_suffix(base_relation, suffix, dstring=False) %}\n {{ return(backup_relation.incorporate(type=backup_relation_type)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__make_relation_with_suffix"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "base_relation", "type": null, "description": ""}, {"name": "backup_relation_type", "type": null, "description": ""}, {"name": "suffix", "type": null, "description": ""}], "created_at": 1789079002.2678816, "supported_languages": null}, "macro.dbt_postgres.postgres_escape_comment": {"name": "postgres_escape_comment", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "unique_id": "macro.dbt_postgres.postgres_escape_comment", "macro_sql": "{% macro postgres_escape_comment(comment) -%}\n {% if comment is not string %}\n {% do exceptions.raise_compiler_error('cannot escape a non-string: ' ~ comment) %}\n {% endif %}\n {%- set magic = '$dbt_comment_literal_block$' -%}\n {%- if magic in comment -%}\n {%- do exceptions.raise_compiler_error('The string ' ~ magic ~ ' is not allowed in comments.') -%}\n {%- endif -%}\n {{ magic }}{{ comment }}{{ magic }}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "comment", "type": null, "description": ""}], "created_at": 1789079002.268371, "supported_languages": null}, "macro.dbt_postgres.postgres__alter_relation_comment": {"name": "postgres__alter_relation_comment", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "unique_id": "macro.dbt_postgres.postgres__alter_relation_comment", "macro_sql": "{% macro postgres__alter_relation_comment(relation, comment) %}\n {% set escaped_comment = postgres_escape_comment(comment) %}\n {% if relation.type == 'materialized_view' -%}\n {% set relation_type = \"materialized view\" %}\n {%- else -%}\n {%- set relation_type = relation.type -%}\n {%- endif -%}\n comment on {{ relation_type }} {{ relation }} is {{ escaped_comment }};\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres_escape_comment"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "comment", "type": null, "description": ""}], "created_at": 1789079002.2687976, "supported_languages": null}, "macro.dbt_postgres.postgres__alter_column_comment": {"name": "postgres__alter_column_comment", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "unique_id": "macro.dbt_postgres.postgres__alter_column_comment", "macro_sql": "{% macro postgres__alter_column_comment(relation, column_dict) %}\n {% set existing_columns = adapter.get_columns_in_relation(relation) | map(attribute=\"name\") | list %}\n {% for column_name in column_dict if (column_name in existing_columns) %}\n {% set comment = column_dict[column_name]['description'] %}\n {% set escaped_comment = postgres_escape_comment(comment) %}\n comment on column {{ relation }}.{{ adapter.quote(column_name) if column_dict[column_name]['quote'] else column_name }} is {{ escaped_comment }};\n {% endfor %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres_escape_comment"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "column_dict", "type": null, "description": ""}], "created_at": 1789079002.2694628, "supported_languages": null}, "macro.dbt_postgres.postgres__get_show_grant_sql": {"name": "postgres__get_show_grant_sql", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "unique_id": "macro.dbt_postgres.postgres__get_show_grant_sql", "macro_sql": "\n\n{%- macro postgres__get_show_grant_sql(relation) -%}\n select grantee, privilege_type\n from {{ relation.information_schema('role_table_grants') }}\n where grantor = current_role\n and grantee != current_role\n and table_schema = '{{ relation.schema }}'\n and table_name = '{{ relation.identifier }}'\n{%- endmacro -%}\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789079002.2696931, "supported_languages": null}, "macro.dbt_postgres.postgres__copy_grants": {"name": "postgres__copy_grants", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "unique_id": "macro.dbt_postgres.postgres__copy_grants", "macro_sql": "{% macro postgres__copy_grants() %}\n {{ return(False) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789079002.2698298, "supported_languages": null}, "macro.dbt_postgres.postgres__get_show_indexes_sql": {"name": "postgres__get_show_indexes_sql", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "unique_id": "macro.dbt_postgres.postgres__get_show_indexes_sql", "macro_sql": "{% macro postgres__get_show_indexes_sql(relation) %}\n select\n i.relname as name,\n m.amname as method,\n ix.indisunique as \"unique\",\n array_to_string(array_agg(a.attname), ',') as column_names\n from pg_index ix\n join pg_class i\n on i.oid = ix.indexrelid\n join pg_am m\n on m.oid=i.relam\n join pg_class t\n on t.oid = ix.indrelid\n join pg_namespace n\n on n.oid = t.relnamespace\n join pg_attribute a\n on a.attrelid = t.oid\n and a.attnum = ANY(ix.indkey)\n where t.relname = '{{ relation.identifier }}'\n and n.nspname = '{{ relation.schema }}'\n and t.relkind in ('r', 'm')\n group by 1, 2, 3\n order by 1, 2, 3\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789079002.2700377, "supported_languages": null}, "macro.dbt_postgres.postgres__get_drop_index_sql": {"name": "postgres__get_drop_index_sql", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "unique_id": "macro.dbt_postgres.postgres__get_drop_index_sql", "macro_sql": "\n\n\n{%- macro postgres__get_drop_index_sql(relation, index_name) -%}\n drop index if exists \"{{ relation.schema }}\".\"{{ index_name }}\"\n{%- endmacro -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "index_name", "type": null, "description": ""}], "created_at": 1789079002.2702043, "supported_languages": null}, "macro.dbt_postgres.postgres__get_create_materialized_view_as_sql": {"name": "postgres__get_create_materialized_view_as_sql", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/relations/materialized_view/create.sql", "original_file_path": "macros/relations/materialized_view/create.sql", "unique_id": "macro.dbt_postgres.postgres__get_create_materialized_view_as_sql", "macro_sql": "{% macro postgres__get_create_materialized_view_as_sql(relation, sql) %}\n create materialized view if not exists {{ relation }} as {{ sql }};\n\n {% for _index_dict in config.get('indexes', []) -%}\n {{- get_create_index_sql(relation, _index_dict) -}}{{ ';' if not loop.last else \"\" }}\n {%- endfor -%}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_create_index_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "sql", "type": null, "description": ""}], "created_at": 1789079002.2707057, "supported_languages": null}, "macro.dbt_postgres.postgres__get_alter_materialized_view_as_sql": {"name": "postgres__get_alter_materialized_view_as_sql", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/relations/materialized_view/alter.sql", "original_file_path": "macros/relations/materialized_view/alter.sql", "unique_id": "macro.dbt_postgres.postgres__get_alter_materialized_view_as_sql", "macro_sql": "{% macro postgres__get_alter_materialized_view_as_sql(\n relation,\n configuration_changes,\n sql,\n existing_relation,\n backup_relation,\n intermediate_relation\n) %}\n\n -- apply a full refresh immediately if needed\n {% if configuration_changes.requires_full_refresh %}\n\n {{ get_replace_sql(existing_relation, relation, sql) }}\n\n -- otherwise apply individual changes as needed\n {% else %}\n\n {{ postgres__update_indexes_on_materialized_view(relation, configuration_changes.indexes) }}\n\n {%- endif -%}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_replace_sql", "macro.dbt_postgres.postgres__update_indexes_on_materialized_view"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "configuration_changes", "type": null, "description": ""}, {"name": "sql", "type": null, "description": ""}, {"name": "existing_relation", "type": null, "description": ""}, {"name": "backup_relation", "type": null, "description": ""}, {"name": "intermediate_relation", "type": null, "description": ""}], "created_at": 1789079002.2713287, "supported_languages": null}, "macro.dbt_postgres.postgres__update_indexes_on_materialized_view": {"name": "postgres__update_indexes_on_materialized_view", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/relations/materialized_view/alter.sql", "original_file_path": "macros/relations/materialized_view/alter.sql", "unique_id": "macro.dbt_postgres.postgres__update_indexes_on_materialized_view", "macro_sql": "\n\n\n{%- macro postgres__update_indexes_on_materialized_view(relation, index_changes) -%}\n {{- log(\"Applying UPDATE INDEXES to: \" ~ relation) -}}\n\n {%- for _index_change in index_changes -%}\n {%- set _index = _index_change.context -%}\n\n {%- if _index_change.action == \"drop\" -%}\n\n {{ postgres__get_drop_index_sql(relation, _index.name) }}\n\n {%- elif _index_change.action == \"create\" -%}\n\n {{ postgres__get_create_index_sql(relation, _index.as_node_config) }}\n\n {%- endif -%}\n\t{{ ';' if not loop.last else \"\" }}\n\n {%- endfor -%}\n\n{%- endmacro -%}\n\n\n", "depends_on": {"macros": ["macro.dbt_postgres.postgres__get_drop_index_sql", "macro.dbt_postgres.postgres__get_create_index_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "index_changes", "type": null, "description": ""}], "created_at": 1789079002.2719471, "supported_languages": null}, "macro.dbt_postgres.postgres__get_materialized_view_configuration_changes": {"name": "postgres__get_materialized_view_configuration_changes", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/relations/materialized_view/alter.sql", "original_file_path": "macros/relations/materialized_view/alter.sql", "unique_id": "macro.dbt_postgres.postgres__get_materialized_view_configuration_changes", "macro_sql": "{% macro postgres__get_materialized_view_configuration_changes(existing_relation, new_config) %}\n {% set _existing_materialized_view = postgres__describe_materialized_view(existing_relation) %}\n {% set _configuration_changes = existing_relation.get_materialized_view_config_change_collection(_existing_materialized_view, new_config.model) %}\n {% do return(_configuration_changes) %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__describe_materialized_view"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "existing_relation", "type": null, "description": ""}, {"name": "new_config", "type": null, "description": ""}], "created_at": 1789079002.272282, "supported_languages": null}, "macro.dbt_postgres.postgres__get_rename_materialized_view_sql": {"name": "postgres__get_rename_materialized_view_sql", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/relations/materialized_view/rename.sql", "original_file_path": "macros/relations/materialized_view/rename.sql", "unique_id": "macro.dbt_postgres.postgres__get_rename_materialized_view_sql", "macro_sql": "{% macro postgres__get_rename_materialized_view_sql(relation, new_name) %}\n alter materialized view {{ relation }} rename to {{ new_name }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "new_name", "type": null, "description": ""}], "created_at": 1789079002.2724977, "supported_languages": null}, "macro.dbt_postgres.postgres__refresh_materialized_view": {"name": "postgres__refresh_materialized_view", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/relations/materialized_view/refresh.sql", "original_file_path": "macros/relations/materialized_view/refresh.sql", "unique_id": "macro.dbt_postgres.postgres__refresh_materialized_view", "macro_sql": "{% macro postgres__refresh_materialized_view(relation) %}\n refresh materialized view {{ relation }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789079002.272665, "supported_languages": null}, "macro.dbt_postgres.postgres__drop_materialized_view": {"name": "postgres__drop_materialized_view", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/relations/materialized_view/drop.sql", "original_file_path": "macros/relations/materialized_view/drop.sql", "unique_id": "macro.dbt_postgres.postgres__drop_materialized_view", "macro_sql": "{% macro postgres__drop_materialized_view(relation) -%}\n drop materialized view if exists {{ relation }} cascade\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789079002.2728298, "supported_languages": null}, "macro.dbt_postgres.postgres__describe_materialized_view": {"name": "postgres__describe_materialized_view", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/relations/materialized_view/describe.sql", "original_file_path": "macros/relations/materialized_view/describe.sql", "unique_id": "macro.dbt_postgres.postgres__describe_materialized_view", "macro_sql": "{% macro postgres__describe_materialized_view(relation) %}\n -- for now just get the indexes, we don't need the name or the query yet\n {% set _indexes = run_query(get_show_indexes_sql(relation)) %}\n {% do return({'indexes': _indexes}) %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.run_query", "macro.dbt.get_show_indexes_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789079002.2732463, "supported_languages": null}, "macro.dbt_postgres.postgres__get_rename_view_sql": {"name": "postgres__get_rename_view_sql", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/relations/view/rename.sql", "original_file_path": "macros/relations/view/rename.sql", "unique_id": "macro.dbt_postgres.postgres__get_rename_view_sql", "macro_sql": "{% macro postgres__get_rename_view_sql(relation, new_name) %}\n alter view {{ relation }} rename to {{ new_name }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "new_name", "type": null, "description": ""}], "created_at": 1789079002.2734535, "supported_languages": null}, "macro.dbt_postgres.postgres__drop_view": {"name": "postgres__drop_view", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/relations/view/drop.sql", "original_file_path": "macros/relations/view/drop.sql", "unique_id": "macro.dbt_postgres.postgres__drop_view", "macro_sql": "{% macro postgres__drop_view(relation) -%}\n drop view if exists {{ relation }} cascade\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789079002.2736154, "supported_languages": null}, "macro.dbt_postgres.postgres__get_replace_view_sql": {"name": "postgres__get_replace_view_sql", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/relations/view/replace.sql", "original_file_path": "macros/relations/view/replace.sql", "unique_id": "macro.dbt_postgres.postgres__get_replace_view_sql", "macro_sql": "{% macro postgres__get_replace_view_sql(relation, sql) -%}\n\n {%- set sql_header = config.get('sql_header', none) -%}\n {{ sql_header if sql_header is not none }}\n\n create or replace view {{ relation }}\n {% set contract_config = config.get('contract') %}\n {% if contract_config.enforced %}\n {{ get_assert_columns_equivalent(sql) }}\n {%- endif %}\n as (\n {{ sql }}\n );\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.get_assert_columns_equivalent"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "sql", "type": null, "description": ""}], "created_at": 1789079002.2742078, "supported_languages": null}, "macro.dbt_postgres.postgres__get_rename_table_sql": {"name": "postgres__get_rename_table_sql", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/relations/table/rename.sql", "original_file_path": "macros/relations/table/rename.sql", "unique_id": "macro.dbt_postgres.postgres__get_rename_table_sql", "macro_sql": "{% macro postgres__get_rename_table_sql(relation, new_name) %}\n alter table {{ relation }} rename to {{ new_name }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "new_name", "type": null, "description": ""}], "created_at": 1789079002.2744124, "supported_languages": null}, "macro.dbt_postgres.postgres__drop_table": {"name": "postgres__drop_table", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/relations/table/drop.sql", "original_file_path": "macros/relations/table/drop.sql", "unique_id": "macro.dbt_postgres.postgres__drop_table", "macro_sql": "{% macro postgres__drop_table(relation) -%}\n drop table if exists {{ relation }} cascade\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789079002.2745757, "supported_languages": null}, "macro.dbt_postgres.postgres__get_replace_table_sql": {"name": "postgres__get_replace_table_sql", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/relations/table/replace.sql", "original_file_path": "macros/relations/table/replace.sql", "unique_id": "macro.dbt_postgres.postgres__get_replace_table_sql", "macro_sql": "{% macro postgres__get_replace_table_sql(relation, sql) -%}\n\n {%- set sql_header = config.get('sql_header', none) -%}\n {{ sql_header if sql_header is not none }}\n\n create or replace table {{ relation }}\n {% set contract_config = config.get('contract') %}\n {% if contract_config.enforced %}\n {{ get_assert_columns_equivalent(sql) }}\n {{ get_table_columns_and_constraints() }}\n {%- set sql = get_select_subquery(sql) %}\n {% endif %}\n as (\n {{ sql }}\n );\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.get_assert_columns_equivalent", "macro.dbt.get_table_columns_and_constraints", "macro.dbt.get_select_subquery"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "sql", "type": null, "description": ""}], "created_at": 1789079002.2752702, "supported_languages": null}, "macro.dbt_postgres.postgres__get_incremental_default_sql": {"name": "postgres__get_incremental_default_sql", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/materializations/incremental_strategies.sql", "original_file_path": "macros/materializations/incremental_strategies.sql", "unique_id": "macro.dbt_postgres.postgres__get_incremental_default_sql", "macro_sql": "{% macro postgres__get_incremental_default_sql(arg_dict) %}\n\n {% if arg_dict[\"unique_key\"] %}\n {% do return(get_incremental_delete_insert_sql(arg_dict)) %}\n {% else %}\n {% do return(get_incremental_append_sql(arg_dict)) %}\n {% endif %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_incremental_delete_insert_sql", "macro.dbt.get_incremental_append_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "arg_dict", "type": null, "description": ""}], "created_at": 1789079002.2757597, "supported_languages": null}, "macro.dbt_postgres.postgres__get_incremental_microbatch_sql": {"name": "postgres__get_incremental_microbatch_sql", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/materializations/incremental_strategies.sql", "original_file_path": "macros/materializations/incremental_strategies.sql", "unique_id": "macro.dbt_postgres.postgres__get_incremental_microbatch_sql", "macro_sql": "{% macro postgres__get_incremental_microbatch_sql(arg_dict) %}\n\n {% if arg_dict[\"unique_key\"] %}\n {% do return(adapter.dispatch('get_incremental_merge_sql', 'dbt')(arg_dict)) %}\n {% else %}\n {{ exceptions.raise_compiler_error(\"dbt-postgres 'microbatch' requires a `unique_key` config\") }}\n {% endif %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_incremental_merge_sql", "macro.dbt.default__get_incremental_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "arg_dict", "type": null, "description": ""}], "created_at": 1789079002.2761407, "supported_languages": null}, "macro.dbt_postgres.postgres__snapshot_merge_sql": {"name": "postgres__snapshot_merge_sql", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/materializations/snapshot_merge.sql", "original_file_path": "macros/materializations/snapshot_merge.sql", "unique_id": "macro.dbt_postgres.postgres__snapshot_merge_sql", "macro_sql": "{% macro postgres__snapshot_merge_sql(target, source, insert_cols) -%}\n {%- set insert_cols_csv = insert_cols | join(', ') -%}\n\n {%- set columns = config.get(\"snapshot_table_column_names\") or get_snapshot_table_column_names() -%}\n\n update {{ target }}\n set {{ columns.dbt_valid_to }} = DBT_INTERNAL_SOURCE.{{ columns.dbt_valid_to }}\n from {{ source }} as DBT_INTERNAL_SOURCE\n where DBT_INTERNAL_SOURCE.{{ columns.dbt_scd_id }}::text = {{ target }}.{{ columns.dbt_scd_id }}::text\n and DBT_INTERNAL_SOURCE.dbt_change_type::text in ('update'::text, 'delete'::text)\n {% if config.get(\"dbt_valid_to_current\") %}\n and ({{ target }}.{{ columns.dbt_valid_to }} = {{ config.get('dbt_valid_to_current') }} or {{ target }}.{{ columns.dbt_valid_to }} is null);\n {% else %}\n and {{ target }}.{{ columns.dbt_valid_to }} is null;\n {% endif %}\n\n\n insert into {{ target }} ({{ insert_cols_csv }})\n select {% for column in insert_cols -%}\n DBT_INTERNAL_SOURCE.{{ column }} {%- if not loop.last %}, {%- endif %}\n {%- endfor %}\n from {{ source }} as DBT_INTERNAL_SOURCE\n where DBT_INTERNAL_SOURCE.dbt_change_type::text = 'insert'::text;\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_snapshot_table_column_names"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "target", "type": null, "description": ""}, {"name": "source", "type": null, "description": ""}, {"name": "insert_cols", "type": null, "description": ""}], "created_at": 1789079002.2774005, "supported_languages": null}, "macro.dbt_postgres.postgres__formatted_scalar_function_args_sql": {"name": "postgres__formatted_scalar_function_args_sql", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/materializations/functions/scalar.sql", "original_file_path": "macros/materializations/functions/scalar.sql", "unique_id": "macro.dbt_postgres.postgres__formatted_scalar_function_args_sql", "macro_sql": "{% macro postgres__formatted_scalar_function_args_sql() %}\n {% set args = [] %}\n {% for arg in model.arguments -%}\n {% set default_value = arg.get('default_value', none) %}\n {% if default_value != none %}\n {%- do args.append(arg.name ~ ' ' ~ arg.data_type ~ ' DEFAULT ' ~ default_value) -%}\n {% else %}\n {%- do args.append(arg.name ~ ' ' ~ arg.data_type) -%}\n {% endif %}\n {%- endfor %}\n {{ args | join(', ') }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789079002.278216, "supported_languages": null}, "macro.dbt_postgres.postgres__last_day": {"name": "postgres__last_day", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/utils/last_day.sql", "original_file_path": "macros/utils/last_day.sql", "unique_id": "macro.dbt_postgres.postgres__last_day", "macro_sql": "{% macro postgres__last_day(date, datepart) -%}\n\n {%- if datepart == 'quarter' -%}\n -- postgres dateadd does not support quarter interval.\n cast(\n {{dbt.dateadd('day', '-1',\n dbt.dateadd('month', '3', dbt.date_trunc(datepart, date))\n )}}\n as date)\n {%- else -%}\n {{dbt.default_last_day(date, datepart)}}\n {%- endif -%}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.dateadd", "macro.dbt.date_trunc", "macro.dbt.default_last_day"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "date", "type": null, "description": ""}, {"name": "datepart", "type": null, "description": ""}], "created_at": 1789079002.278745, "supported_languages": null}, "macro.dbt_postgres.postgres__listagg": {"name": "postgres__listagg", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/utils/listagg.sql", "original_file_path": "macros/utils/listagg.sql", "unique_id": "macro.dbt_postgres.postgres__listagg", "macro_sql": "{% macro postgres__listagg(measure, delimiter_text, order_by_clause, limit_num) -%}\n\n {% if limit_num -%}\n array_to_string(\n (array_agg(\n {{ measure }}\n {% if order_by_clause -%}\n {{ order_by_clause }}\n {%- endif %}\n ))[1:{{ limit_num }}],\n {{ delimiter_text }}\n )\n {%- else %}\n string_agg(\n {{ measure }},\n {{ delimiter_text }}\n {% if order_by_clause -%}\n {{ order_by_clause }}\n {%- endif %}\n )\n {%- endif %}\n\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "measure", "type": null, "description": ""}, {"name": "delimiter_text", "type": null, "description": ""}, {"name": "order_by_clause", "type": null, "description": ""}, {"name": "limit_num", "type": null, "description": ""}], "created_at": 1789079002.2793276, "supported_languages": null}, "macro.dbt_postgres.postgres__any_value": {"name": "postgres__any_value", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/utils/any_value.sql", "original_file_path": "macros/utils/any_value.sql", "unique_id": "macro.dbt_postgres.postgres__any_value", "macro_sql": "{% macro postgres__any_value(expression) -%}\n\n min({{ expression }})\n\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "expression", "type": null, "description": ""}], "created_at": 1789079002.2795053, "supported_languages": null}, "macro.dbt_postgres.postgres__datediff": {"name": "postgres__datediff", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/utils/datediff.sql", "original_file_path": "macros/utils/datediff.sql", "unique_id": "macro.dbt_postgres.postgres__datediff", "macro_sql": "{% macro postgres__datediff(first_date, second_date, datepart) -%}\n\n {% if datepart == 'year' %}\n (date_part('year', ({{second_date}})::date) - date_part('year', ({{first_date}})::date))\n {% elif datepart == 'quarter' %}\n ({{ datediff(first_date, second_date, 'year') }} * 4 + date_part('quarter', ({{second_date}})::date) - date_part('quarter', ({{first_date}})::date))\n {% elif datepart == 'month' %}\n ({{ datediff(first_date, second_date, 'year') }} * 12 + date_part('month', ({{second_date}})::date) - date_part('month', ({{first_date}})::date))\n {% elif datepart == 'day' %}\n (({{second_date}})::date - ({{first_date}})::date)\n {% elif datepart == 'week' %}\n ({{ datediff(first_date, second_date, 'day') }} / 7 + case\n when date_part('dow', ({{first_date}})::timestamp) <= date_part('dow', ({{second_date}})::timestamp) then\n case when {{first_date}} <= {{second_date}} then 0 else -1 end\n else\n case when {{first_date}} <= {{second_date}} then 1 else 0 end\n end)\n {% elif datepart == 'hour' %}\n ({{ datediff(first_date, second_date, 'day') }} * 24 + date_part('hour', ({{second_date}})::timestamp) - date_part('hour', ({{first_date}})::timestamp))\n {% elif datepart == 'minute' %}\n ({{ datediff(first_date, second_date, 'hour') }} * 60 + date_part('minute', ({{second_date}})::timestamp) - date_part('minute', ({{first_date}})::timestamp))\n {% elif datepart == 'second' %}\n ({{ datediff(first_date, second_date, 'minute') }} * 60 + floor(date_part('second', ({{second_date}})::timestamp)) - floor(date_part('second', ({{first_date}})::timestamp)))\n {% elif datepart == 'millisecond' %}\n ({{ datediff(first_date, second_date, 'minute') }} * 60000 + floor(date_part('millisecond', ({{second_date}})::timestamp)) - floor(date_part('millisecond', ({{first_date}})::timestamp)))\n {% elif datepart == 'microsecond' %}\n ({{ datediff(first_date, second_date, 'minute') }} * 60000000 + floor(date_part('microsecond', ({{second_date}})::timestamp)) - floor(date_part('microsecond', ({{first_date}})::timestamp)))\n {% else %}\n {{ exceptions.raise_compiler_error(\"Unsupported datepart for macro datediff in postgres: {!r}\".format(datepart)) }}\n {% endif %}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.datediff"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "first_date", "type": null, "description": ""}, {"name": "second_date", "type": null, "description": ""}, {"name": "datepart", "type": null, "description": ""}], "created_at": 1789079002.2817757, "supported_languages": null}, "macro.dbt_postgres.postgres__equals": {"name": "postgres__equals", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/utils/equals.sql", "original_file_path": "macros/utils/equals.sql", "unique_id": "macro.dbt_postgres.postgres__equals", "macro_sql": "{% macro postgres__equals(expr1, expr2) -%}\n{%- if adapter.behavior.enable_truthy_nulls_equals_macro.no_warn %}\n ({{ expr1 }} IS NOT DISTINCT FROM {{ expr2 }})\n{%- else -%}\n ({{ expr1 }} = {{ expr2 }})\n{%- endif %}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "expr1", "type": null, "description": ""}, {"name": "expr2", "type": null, "description": ""}], "created_at": 1789079002.2821772, "supported_languages": null}, "macro.dbt_postgres.postgres__dateadd": {"name": "postgres__dateadd", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/utils/dateadd.sql", "original_file_path": "macros/utils/dateadd.sql", "unique_id": "macro.dbt_postgres.postgres__dateadd", "macro_sql": "{% macro postgres__dateadd(datepart, interval, from_date_or_timestamp) %}\n\n {{ from_date_or_timestamp }} + ((interval '1 {{ datepart }}') * ({{ interval }}))\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "datepart", "type": null, "description": ""}, {"name": "interval", "type": null, "description": ""}, {"name": "from_date_or_timestamp", "type": null, "description": ""}], "created_at": 1789079002.2824275, "supported_languages": null}, "macro.dbt_postgres.postgres__split_part": {"name": "postgres__split_part", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/utils/split_part.sql", "original_file_path": "macros/utils/split_part.sql", "unique_id": "macro.dbt_postgres.postgres__split_part", "macro_sql": "{% macro postgres__split_part(string_text, delimiter_text, part_number) %}\n\n {% if part_number >= 0 %}\n {{ dbt.default__split_part(string_text, delimiter_text, part_number) }}\n {% else %}\n {{ dbt._split_part_negative(string_text, delimiter_text, part_number) }}\n {% endif %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__split_part", "macro.dbt._split_part_negative"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "string_text", "type": null, "description": ""}, {"name": "delimiter_text", "type": null, "description": ""}, {"name": "part_number", "type": null, "description": ""}], "created_at": 1789079002.282883, "supported_languages": null}, "macro.dbt.get_fixture_sql": {"name": "get_fixture_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/unit_test_sql/get_fixture_sql.sql", "original_file_path": "macros/unit_test_sql/get_fixture_sql.sql", "unique_id": "macro.dbt.get_fixture_sql", "macro_sql": "{% macro get_fixture_sql(rows, column_name_to_data_types) %}\n-- Fixture for {{ model.name }}\n{% set default_row = {} %}\n\n{%- if not column_name_to_data_types -%}\n{#-- Use defer_relation IFF it is available in the manifest and 'this' is missing from the database --#}\n{%- set this_or_defer_relation = defer_relation if (defer_relation and not load_relation(this)) else this -%}\n{%- set columns_in_relation = adapter.get_columns_in_relation(this_or_defer_relation) -%}\n\n{%- set column_name_to_data_types = {} -%}\n{%- set column_name_to_quoted = {} -%}\n{%- for column in columns_in_relation -%}\n\n{#-- This needs to be a case-insensitive comparison --#}\n{%- do column_name_to_data_types.update({column.name|lower: column.data_type}) -%}\n{%- do column_name_to_quoted.update({column.name|lower: column.quoted}) -%}\n{%- endfor -%}\n{%- endif -%}\n\n{%- if not column_name_to_data_types -%}\n {{ exceptions.raise_compiler_error(\"Not able to get columns for unit test '\" ~ model.name ~ \"' from relation \" ~ this ~ \" because the relation doesn't exist\") }}\n{%- endif -%}\n\n{%- for column_name, column_type in column_name_to_data_types.items() -%}\n {%- do default_row.update({column_name: (safe_cast(\"null\", column_type) | trim )}) -%}\n{%- endfor -%}\n\n{{ validate_fixture_rows(rows, row_number) }}\n\n{%- for row in rows -%}\n{%- set formatted_row = format_row(row, column_name_to_data_types) -%}\n{%- set default_row_copy = default_row.copy() -%}\n{%- do default_row_copy.update(formatted_row) -%}\nselect\n{%- for column_name, column_value in default_row_copy.items() %} {{ column_value }} as {{ column_name_to_quoted[column_name] }}{% if not loop.last -%}, {%- endif %}\n{%- endfor %}\n{%- if not loop.last %}\nunion all\n{% endif %}\n{%- endfor -%}\n\n{%- if (rows | length) == 0 -%}\n select\n {%- for column_name, column_value in default_row.items() %} {{ column_value }} as {{ column_name_to_quoted[column_name] }}{% if not loop.last -%},{%- endif %}\n {%- endfor %}\n limit 0\n{%- endif -%}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.load_relation", "macro.dbt.safe_cast", "macro.dbt.validate_fixture_rows", "macro.dbt.format_row"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "rows", "type": null, "description": ""}, {"name": "column_name_to_data_types", "type": null, "description": ""}], "created_at": 1789079002.2857778, "supported_languages": null}, "macro.dbt.get_expected_sql": {"name": "get_expected_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/unit_test_sql/get_fixture_sql.sql", "original_file_path": "macros/unit_test_sql/get_fixture_sql.sql", "unique_id": "macro.dbt.get_expected_sql", "macro_sql": "{% macro get_expected_sql(rows, column_name_to_data_types, column_name_to_quoted) %}\n\n{%- if (rows | length) == 0 -%}\n select * from dbt_internal_unit_test_actual\n limit 0\n{%- else -%}\n{%- for row in rows -%}\n{%- set formatted_row = format_row(row, column_name_to_data_types) -%}\nselect\n{%- for column_name, column_value in formatted_row.items() %} {{ column_value }} as {{ column_name_to_quoted[column_name] }}{% if not loop.last -%}, {%- endif %}\n{%- endfor %}\n{%- if not loop.last %}\nunion all\n{% endif %}\n{%- endfor -%}\n{%- endif -%}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.format_row"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "rows", "type": null, "description": ""}, {"name": "column_name_to_data_types", "type": null, "description": ""}, {"name": "column_name_to_quoted", "type": null, "description": ""}], "created_at": 1789079002.2866004, "supported_languages": null}, "macro.dbt.format_row": {"name": "format_row", "resource_type": "macro", "package_name": "dbt", "path": "macros/unit_test_sql/get_fixture_sql.sql", "original_file_path": "macros/unit_test_sql/get_fixture_sql.sql", "unique_id": "macro.dbt.format_row", "macro_sql": "\n\n{%- macro format_row(row, column_name_to_data_types) -%}\n {#-- generate case-insensitive formatted row --#}\n {% set formatted_row = {} %}\n {%- for column_name, column_value in row.items() -%}\n {% set column_name = column_name|lower %}\n\n {%- if column_name not in column_name_to_data_types %}\n {#-- if user-provided row contains column name that relation does not contain, raise an error --#}\n {% set fixture_name = \"expected output\" if model.resource_type == 'unit_test' else (\"'\" ~ model.name ~ \"'\") %}\n {{ exceptions.raise_compiler_error(\n \"Invalid column name: '\" ~ column_name ~ \"' in unit test fixture for \" ~ fixture_name ~ \".\"\n \"\\nAccepted columns for \" ~ fixture_name ~ \" are: \" ~ (column_name_to_data_types.keys()|list)\n ) }}\n {%- endif -%}\n\n {%- set column_type = column_name_to_data_types[column_name] %}\n\n {#-- For string fixture values, strip varchar length to prevent silent truncation (GH-11974) --#}\n {%- if column_value is string and 'varying' in column_type -%}\n {%- set column_type = column_type.split('(')[0] -%}\n {%- endif -%}\n\n {#-- sanitize column_value: wrap yaml strings in quotes, apply cast --#}\n {%- set column_value_clean = column_value -%}\n {%- if column_value is string -%}\n {%- set column_value_clean = dbt.string_literal(dbt.escape_single_quotes(column_value)) -%}\n {%- elif column_value is none -%}\n {%- set column_value_clean = 'null' -%}\n {%- endif -%}\n\n {%- set row_update = {column_name: safe_cast(column_value_clean, column_type) } -%}\n {%- do formatted_row.update(row_update) -%}\n {%- endfor -%}\n {{ return(formatted_row) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt.string_literal", "macro.dbt.escape_single_quotes", "macro.dbt.safe_cast"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "row", "type": null, "description": ""}, {"name": "column_name_to_data_types", "type": null, "description": ""}], "created_at": 1789079002.2880273, "supported_languages": null}, "macro.dbt.validate_fixture_rows": {"name": "validate_fixture_rows", "resource_type": "macro", "package_name": "dbt", "path": "macros/unit_test_sql/get_fixture_sql.sql", "original_file_path": "macros/unit_test_sql/get_fixture_sql.sql", "unique_id": "macro.dbt.validate_fixture_rows", "macro_sql": "{%- macro validate_fixture_rows(rows, row_number) -%}\n {{ return(adapter.dispatch('validate_fixture_rows', 'dbt')(rows, row_number)) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt.default__validate_fixture_rows"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "rows", "type": null, "description": ""}, {"name": "row_number", "type": null, "description": ""}], "created_at": 1789079002.2882745, "supported_languages": null}, "macro.dbt.default__validate_fixture_rows": {"name": "default__validate_fixture_rows", "resource_type": "macro", "package_name": "dbt", "path": "macros/unit_test_sql/get_fixture_sql.sql", "original_file_path": "macros/unit_test_sql/get_fixture_sql.sql", "unique_id": "macro.dbt.default__validate_fixture_rows", "macro_sql": "{%- macro default__validate_fixture_rows(rows, row_number) -%}\n {# This is an abstract method for adapter overrides as needed #}\n{%- endmacro -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "rows", "type": null, "description": ""}, {"name": "row_number", "type": null, "description": ""}], "created_at": 1789079002.2883933, "supported_languages": null}, "macro.dbt.get_create_sql": {"name": "get_create_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/create.sql", "original_file_path": "macros/relations/create.sql", "unique_id": "macro.dbt.get_create_sql", "macro_sql": "{%- macro get_create_sql(relation, sql) -%}\n {{- log('Applying CREATE to: ' ~ relation) -}}\n {{- adapter.dispatch('get_create_sql', 'dbt')(relation, sql) -}}\n{%- endmacro -%}\n\n\n", "depends_on": {"macros": ["macro.dbt.default__get_create_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "sql", "type": null, "description": ""}], "created_at": 1789079002.288821, "supported_languages": null}, "macro.dbt.default__get_create_sql": {"name": "default__get_create_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/create.sql", "original_file_path": "macros/relations/create.sql", "unique_id": "macro.dbt.default__get_create_sql", "macro_sql": "{%- macro default__get_create_sql(relation, sql) -%}\n\n {%- if relation.is_view -%}\n {{ get_create_view_as_sql(relation, sql) }}\n\n {%- elif relation.is_table -%}\n {{ get_create_table_as_sql(False, relation, sql) }}\n\n {%- elif relation.is_materialized_view -%}\n {{ get_create_materialized_view_as_sql(relation, sql) }}\n\n {%- else -%}\n {{- exceptions.raise_compiler_error(\"`get_create_sql` has not been implemented for: \" ~ relation.type ) -}}\n\n {%- endif -%}\n\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt.get_create_view_as_sql", "macro.dbt.get_create_table_as_sql", "macro.dbt.get_create_materialized_view_as_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "sql", "type": null, "description": ""}], "created_at": 1789079002.289322, "supported_languages": null}, "macro.dbt.drop_schema_named": {"name": "drop_schema_named", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/schema.sql", "original_file_path": "macros/relations/schema.sql", "unique_id": "macro.dbt.drop_schema_named", "macro_sql": "{% macro drop_schema_named(schema_name) %}\n {{ return(adapter.dispatch('drop_schema_named', 'dbt') (schema_name)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__drop_schema_named"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "schema_name", "type": null, "description": ""}], "created_at": 1789079002.2896163, "supported_languages": null}, "macro.dbt.default__drop_schema_named": {"name": "default__drop_schema_named", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/schema.sql", "original_file_path": "macros/relations/schema.sql", "unique_id": "macro.dbt.default__drop_schema_named", "macro_sql": "{% macro default__drop_schema_named(schema_name) %}\n {% set schema_relation = api.Relation.create(schema=schema_name) %}\n {{ adapter.drop_schema(schema_relation) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "schema_name", "type": null, "description": ""}], "created_at": 1789079002.2898684, "supported_languages": null}, "macro.dbt.get_create_intermediate_sql": {"name": "get_create_intermediate_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/create_intermediate.sql", "original_file_path": "macros/relations/create_intermediate.sql", "unique_id": "macro.dbt.get_create_intermediate_sql", "macro_sql": "{%- macro get_create_intermediate_sql(relation, sql) -%}\n {{- log('Applying CREATE INTERMEDIATE to: ' ~ relation) -}}\n {{- adapter.dispatch('get_create_intermediate_sql', 'dbt')(relation, sql) -}}\n{%- endmacro -%}\n\n\n", "depends_on": {"macros": ["macro.dbt.default__get_create_intermediate_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "sql", "type": null, "description": ""}], "created_at": 1789079002.2902362, "supported_languages": null}, "macro.dbt.default__get_create_intermediate_sql": {"name": "default__get_create_intermediate_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/create_intermediate.sql", "original_file_path": "macros/relations/create_intermediate.sql", "unique_id": "macro.dbt.default__get_create_intermediate_sql", "macro_sql": "{%- macro default__get_create_intermediate_sql(relation, sql) -%}\n\n -- get the standard intermediate name\n {% set intermediate_relation = make_intermediate_relation(relation) %}\n\n -- drop any pre-existing intermediate\n {{ get_drop_sql(intermediate_relation) }};\n\n {{ get_create_sql(intermediate_relation, sql) }}\n\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt.make_intermediate_relation", "macro.dbt.get_drop_sql", "macro.dbt.get_create_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "sql", "type": null, "description": ""}], "created_at": 1789079002.2905192, "supported_languages": null}, "macro.dbt.get_drop_backup_sql": {"name": "get_drop_backup_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/drop_backup.sql", "original_file_path": "macros/relations/drop_backup.sql", "unique_id": "macro.dbt.get_drop_backup_sql", "macro_sql": "{%- macro get_drop_backup_sql(relation) -%}\n {{- log('Applying DROP BACKUP to: ' ~ relation) -}}\n {{- adapter.dispatch('get_drop_backup_sql', 'dbt')(relation) -}}\n{%- endmacro -%}\n\n\n", "depends_on": {"macros": ["macro.dbt.default__get_drop_backup_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789079002.2908583, "supported_languages": null}, "macro.dbt.default__get_drop_backup_sql": {"name": "default__get_drop_backup_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/drop_backup.sql", "original_file_path": "macros/relations/drop_backup.sql", "unique_id": "macro.dbt.default__get_drop_backup_sql", "macro_sql": "{%- macro default__get_drop_backup_sql(relation) -%}\n\n -- get the standard backup name\n {% set backup_relation = make_backup_relation(relation, relation.type) %}\n\n {{ get_drop_sql(backup_relation) }}\n\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt.make_backup_relation", "macro.dbt.get_drop_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789079002.291096, "supported_languages": null}, "macro.dbt.get_rename_sql": {"name": "get_rename_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/rename.sql", "original_file_path": "macros/relations/rename.sql", "unique_id": "macro.dbt.get_rename_sql", "macro_sql": "{%- macro get_rename_sql(relation, new_name) -%}\n {{- log('Applying RENAME to: ' ~ relation) -}}\n {{- adapter.dispatch('get_rename_sql', 'dbt')(relation, new_name) -}}\n{%- endmacro -%}\n\n\n", "depends_on": {"macros": ["macro.dbt.default__get_rename_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "new_name", "type": null, "description": ""}], "created_at": 1789079002.291591, "supported_languages": null}, "macro.dbt.default__get_rename_sql": {"name": "default__get_rename_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/rename.sql", "original_file_path": "macros/relations/rename.sql", "unique_id": "macro.dbt.default__get_rename_sql", "macro_sql": "{%- macro default__get_rename_sql(relation, new_name) -%}\n\n {%- if relation.is_view -%}\n {{ get_rename_view_sql(relation, new_name) }}\n\n {%- elif relation.is_table -%}\n {{ get_rename_table_sql(relation, new_name) }}\n\n {%- elif relation.is_materialized_view -%}\n {{ get_rename_materialized_view_sql(relation, new_name) }}\n\n {%- else -%}\n {{- exceptions.raise_compiler_error(\"`get_rename_sql` has not been implemented for: \" ~ relation.type ) -}}\n\n {%- endif -%}\n\n{%- endmacro -%}\n\n\n", "depends_on": {"macros": ["macro.dbt.get_rename_view_sql", "macro.dbt.get_rename_table_sql", "macro.dbt.get_rename_materialized_view_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "new_name", "type": null, "description": ""}], "created_at": 1789079002.2920942, "supported_languages": null}, "macro.dbt.rename_relation": {"name": "rename_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/rename.sql", "original_file_path": "macros/relations/rename.sql", "unique_id": "macro.dbt.rename_relation", "macro_sql": "{% macro rename_relation(from_relation, to_relation) -%}\n {{ return(adapter.dispatch('rename_relation', 'dbt')(from_relation, to_relation)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__rename_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "from_relation", "type": null, "description": ""}, {"name": "to_relation", "type": null, "description": ""}], "created_at": 1789079002.2923234, "supported_languages": null}, "macro.dbt.default__rename_relation": {"name": "default__rename_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/rename.sql", "original_file_path": "macros/relations/rename.sql", "unique_id": "macro.dbt.default__rename_relation", "macro_sql": "{% macro default__rename_relation(from_relation, to_relation) -%}\n {% set target_name = adapter.quote_as_configured(to_relation.identifier, 'identifier') %}\n {% call statement('rename_relation') -%}\n alter table {{ from_relation.render() }} rename to {{ target_name }}\n {%- endcall %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "from_relation", "type": null, "description": ""}, {"name": "to_relation", "type": null, "description": ""}], "created_at": 1789079002.2926528, "supported_languages": null}, "macro.dbt.get_drop_sql": {"name": "get_drop_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/drop.sql", "original_file_path": "macros/relations/drop.sql", "unique_id": "macro.dbt.get_drop_sql", "macro_sql": "{%- macro get_drop_sql(relation) -%}\n {{- log('Applying DROP to: ' ~ relation) -}}\n {{- adapter.dispatch('get_drop_sql', 'dbt')(relation) -}}\n{%- endmacro -%}\n\n\n", "depends_on": {"macros": ["macro.dbt.default__get_drop_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789079002.2931483, "supported_languages": null}, "macro.dbt.default__get_drop_sql": {"name": "default__get_drop_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/drop.sql", "original_file_path": "macros/relations/drop.sql", "unique_id": "macro.dbt.default__get_drop_sql", "macro_sql": "{%- macro default__get_drop_sql(relation) -%}\n\n {%- if relation.is_view -%}\n {{ drop_view(relation) }}\n\n {%- elif relation.is_table -%}\n {{ drop_table(relation) }}\n\n {%- elif relation.is_materialized_view -%}\n {{ drop_materialized_view(relation) }}\n\n {%- else -%}\n drop {{ relation.type }} if exists {{ relation.render() }} cascade\n\n {%- endif -%}\n\n{%- endmacro -%}\n\n\n", "depends_on": {"macros": ["macro.dbt.drop_view", "macro.dbt.drop_table", "macro.dbt.drop_materialized_view"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789079002.2936616, "supported_languages": null}, "macro.dbt.drop_relation": {"name": "drop_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/drop.sql", "original_file_path": "macros/relations/drop.sql", "unique_id": "macro.dbt.drop_relation", "macro_sql": "{% macro drop_relation(relation) -%}\n {{ return(adapter.dispatch('drop_relation', 'dbt')(relation)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__drop_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789079002.2938826, "supported_languages": null}, "macro.dbt.default__drop_relation": {"name": "default__drop_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/drop.sql", "original_file_path": "macros/relations/drop.sql", "unique_id": "macro.dbt.default__drop_relation", "macro_sql": "{% macro default__drop_relation(relation) -%}\n {% call statement('drop_relation', auto_begin=False) -%}\n {{ get_drop_sql(relation) }}\n {%- endcall %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement", "macro.dbt.get_drop_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789079002.294117, "supported_languages": null}, "macro.dbt.drop_relation_if_exists": {"name": "drop_relation_if_exists", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/drop.sql", "original_file_path": "macros/relations/drop.sql", "unique_id": "macro.dbt.drop_relation_if_exists", "macro_sql": "{% macro drop_relation_if_exists(relation) %}\n {% if relation is not none %}\n {{ adapter.drop_relation(relation) }}\n {% endif %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789079002.2943323, "supported_languages": null}, "macro.dbt.get_rename_intermediate_sql": {"name": "get_rename_intermediate_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/rename_intermediate.sql", "original_file_path": "macros/relations/rename_intermediate.sql", "unique_id": "macro.dbt.get_rename_intermediate_sql", "macro_sql": "{%- macro get_rename_intermediate_sql(relation) -%}\n {{- log('Applying RENAME INTERMEDIATE to: ' ~ relation) -}}\n {{- adapter.dispatch('get_rename_intermediate_sql', 'dbt')(relation) -}}\n{%- endmacro -%}\n\n\n", "depends_on": {"macros": ["macro.dbt.default__get_rename_intermediate_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789079002.2946672, "supported_languages": null}, "macro.dbt.default__get_rename_intermediate_sql": {"name": "default__get_rename_intermediate_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/rename_intermediate.sql", "original_file_path": "macros/relations/rename_intermediate.sql", "unique_id": "macro.dbt.default__get_rename_intermediate_sql", "macro_sql": "{%- macro default__get_rename_intermediate_sql(relation) -%}\n\n -- get the standard intermediate name\n {% set intermediate_relation = make_intermediate_relation(relation) %}\n\n {{ get_rename_sql(intermediate_relation, relation.identifier) }}\n\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt.make_intermediate_relation", "macro.dbt.get_rename_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789079002.2949185, "supported_languages": null}, "macro.dbt.get_replace_sql": {"name": "get_replace_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/replace.sql", "original_file_path": "macros/relations/replace.sql", "unique_id": "macro.dbt.get_replace_sql", "macro_sql": "{% macro get_replace_sql(existing_relation, target_relation, sql) %}\n {{- log('Applying REPLACE to: ' ~ existing_relation) -}}\n {{- adapter.dispatch('get_replace_sql', 'dbt')(existing_relation, target_relation, sql) -}}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_replace_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "existing_relation", "type": null, "description": ""}, {"name": "target_relation", "type": null, "description": ""}, {"name": "sql", "type": null, "description": ""}], "created_at": 1789079002.2955065, "supported_languages": null}, "macro.dbt.default__get_replace_sql": {"name": "default__get_replace_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/replace.sql", "original_file_path": "macros/relations/replace.sql", "unique_id": "macro.dbt.default__get_replace_sql", "macro_sql": "{% macro default__get_replace_sql(existing_relation, target_relation, sql) %}\n\n {# /* use a create or replace statement if possible */ #}\n\n {% set is_replaceable = existing_relation.type == target_relation.type and existing_relation.can_be_replaced %}\n\n {% if is_replaceable and existing_relation.is_view %}\n {{ get_replace_view_sql(target_relation, sql) }}\n\n {% elif is_replaceable and existing_relation.is_table %}\n {{ get_replace_table_sql(target_relation, sql) }}\n\n {% elif is_replaceable and existing_relation.is_materialized_view %}\n {{ get_replace_materialized_view_sql(target_relation, sql) }}\n\n {# /* a create or replace statement is not possible, so try to stage and/or backup to be safe */ #}\n\n {# /* create target_relation as an intermediate relation, then swap it out with the existing one using a backup */ #}\n {%- elif target_relation.can_be_renamed and existing_relation.can_be_renamed -%}\n {{ get_create_intermediate_sql(target_relation, sql) }};\n {{ get_create_backup_sql(existing_relation) }};\n {{ get_rename_intermediate_sql(target_relation) }};\n {{ get_drop_backup_sql(existing_relation) }}\n\n {# /* create target_relation as an intermediate relation, then swap it out with the existing one without using a backup */ #}\n {%- elif target_relation.can_be_renamed -%}\n {{ get_create_intermediate_sql(target_relation, sql) }};\n {{ get_drop_sql(existing_relation) }};\n {{ get_rename_intermediate_sql(target_relation) }}\n\n {# /* create target_relation in place by first backing up the existing relation */ #}\n {%- elif existing_relation.can_be_renamed -%}\n {{ get_create_backup_sql(existing_relation) }};\n {{ get_create_sql(target_relation, sql) }};\n {{ get_drop_backup_sql(existing_relation) }}\n\n {# /* no renaming is allowed, so just drop and create */ #}\n {%- else -%}\n {{ get_drop_sql(existing_relation) }};\n {{ get_create_sql(target_relation, sql) }}\n\n {%- endif -%}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_replace_view_sql", "macro.dbt.get_replace_table_sql", "macro.dbt.get_replace_materialized_view_sql", "macro.dbt.get_create_intermediate_sql", "macro.dbt.get_create_backup_sql", "macro.dbt.get_rename_intermediate_sql", "macro.dbt.get_drop_backup_sql", "macro.dbt.get_drop_sql", "macro.dbt.get_create_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "existing_relation", "type": null, "description": ""}, {"name": "target_relation", "type": null, "description": ""}, {"name": "sql", "type": null, "description": ""}], "created_at": 1789079002.296818, "supported_languages": null}, "macro.dbt.get_create_backup_sql": {"name": "get_create_backup_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/create_backup.sql", "original_file_path": "macros/relations/create_backup.sql", "unique_id": "macro.dbt.get_create_backup_sql", "macro_sql": "{%- macro get_create_backup_sql(relation) -%}\n {{- log('Applying CREATE BACKUP to: ' ~ relation) -}}\n {{- adapter.dispatch('get_create_backup_sql', 'dbt')(relation) -}}\n{%- endmacro -%}\n\n\n", "depends_on": {"macros": ["macro.dbt.default__get_create_backup_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789079002.2971876, "supported_languages": null}, "macro.dbt.default__get_create_backup_sql": {"name": "default__get_create_backup_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/create_backup.sql", "original_file_path": "macros/relations/create_backup.sql", "unique_id": "macro.dbt.default__get_create_backup_sql", "macro_sql": "{%- macro default__get_create_backup_sql(relation) -%}\n\n -- get the standard backup name\n {% set backup_relation = make_backup_relation(relation, relation.type) %}\n\n -- drop any pre-existing backup\n {{ get_drop_sql(backup_relation) }};\n\n {{ get_rename_sql(relation, backup_relation.identifier) }}\n\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt.make_backup_relation", "macro.dbt.get_drop_sql", "macro.dbt.get_rename_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789079002.2974837, "supported_languages": null}, "macro.dbt.get_create_materialized_view_as_sql": {"name": "get_create_materialized_view_as_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/materialized_view/create.sql", "original_file_path": "macros/relations/materialized_view/create.sql", "unique_id": "macro.dbt.get_create_materialized_view_as_sql", "macro_sql": "{% macro get_create_materialized_view_as_sql(relation, sql) -%}\n {{- adapter.dispatch('get_create_materialized_view_as_sql', 'dbt')(relation, sql) -}}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__get_create_materialized_view_as_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "sql", "type": null, "description": ""}], "created_at": 1789079002.2977755, "supported_languages": null}, "macro.dbt.default__get_create_materialized_view_as_sql": {"name": "default__get_create_materialized_view_as_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/materialized_view/create.sql", "original_file_path": "macros/relations/materialized_view/create.sql", "unique_id": "macro.dbt.default__get_create_materialized_view_as_sql", "macro_sql": "{% macro default__get_create_materialized_view_as_sql(relation, sql) -%}\n {{ exceptions.raise_compiler_error(\n \"`get_create_materialized_view_as_sql` has not been implemented for this adapter.\"\n ) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "sql", "type": null, "description": ""}], "created_at": 1789079002.2979584, "supported_languages": null}, "macro.dbt.get_alter_materialized_view_as_sql": {"name": "get_alter_materialized_view_as_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/materialized_view/alter.sql", "original_file_path": "macros/relations/materialized_view/alter.sql", "unique_id": "macro.dbt.get_alter_materialized_view_as_sql", "macro_sql": "{% macro get_alter_materialized_view_as_sql(\n relation,\n configuration_changes,\n sql,\n existing_relation,\n backup_relation,\n intermediate_relation\n) %}\n {{- log('Applying ALTER to: ' ~ relation) -}}\n {{- adapter.dispatch('get_alter_materialized_view_as_sql', 'dbt')(\n relation,\n configuration_changes,\n sql,\n existing_relation,\n backup_relation,\n intermediate_relation\n ) -}}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__get_alter_materialized_view_as_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "configuration_changes", "type": null, "description": ""}, {"name": "sql", "type": null, "description": ""}, {"name": "existing_relation", "type": null, "description": ""}, {"name": "backup_relation", "type": null, "description": ""}, {"name": "intermediate_relation", "type": null, "description": ""}], "created_at": 1789079002.2985215, "supported_languages": null}, "macro.dbt.default__get_alter_materialized_view_as_sql": {"name": "default__get_alter_materialized_view_as_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/materialized_view/alter.sql", "original_file_path": "macros/relations/materialized_view/alter.sql", "unique_id": "macro.dbt.default__get_alter_materialized_view_as_sql", "macro_sql": "{% macro default__get_alter_materialized_view_as_sql(\n relation,\n configuration_changes,\n sql,\n existing_relation,\n backup_relation,\n intermediate_relation\n) %}\n {{ exceptions.raise_compiler_error(\"Materialized views have not been implemented for this adapter.\") }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "configuration_changes", "type": null, "description": ""}, {"name": "sql", "type": null, "description": ""}, {"name": "existing_relation", "type": null, "description": ""}, {"name": "backup_relation", "type": null, "description": ""}, {"name": "intermediate_relation", "type": null, "description": ""}], "created_at": 1789079002.298731, "supported_languages": null}, "macro.dbt.get_materialized_view_configuration_changes": {"name": "get_materialized_view_configuration_changes", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/materialized_view/alter.sql", "original_file_path": "macros/relations/materialized_view/alter.sql", "unique_id": "macro.dbt.get_materialized_view_configuration_changes", "macro_sql": "{% macro get_materialized_view_configuration_changes(existing_relation, new_config) %}\n /* {#\n It's recommended that configuration changes be formatted as follows:\n {\"\": [{\"action\": \"\", \"context\": ...}]}\n\n For example:\n {\n \"indexes\": [\n {\"action\": \"drop\", \"context\": \"index_abc\"},\n {\"action\": \"create\", \"context\": {\"columns\": [\"column_1\", \"column_2\"], \"type\": \"hash\", \"unique\": True}},\n ],\n }\n\n Either way, `get_materialized_view_configuration_changes` needs to align with `get_alter_materialized_view_as_sql`.\n #} */\n {{- log('Determining configuration changes on: ' ~ existing_relation) -}}\n {%- do return(adapter.dispatch('get_materialized_view_configuration_changes', 'dbt')(existing_relation, new_config)) -%}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__get_materialized_view_configuration_changes"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "existing_relation", "type": null, "description": ""}, {"name": "new_config", "type": null, "description": ""}], "created_at": 1789079002.2990553, "supported_languages": null}, "macro.dbt.default__get_materialized_view_configuration_changes": {"name": "default__get_materialized_view_configuration_changes", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/materialized_view/alter.sql", "original_file_path": "macros/relations/materialized_view/alter.sql", "unique_id": "macro.dbt.default__get_materialized_view_configuration_changes", "macro_sql": "{% macro default__get_materialized_view_configuration_changes(existing_relation, new_config) %}\n {{ exceptions.raise_compiler_error(\"Materialized views have not been implemented for this adapter.\") }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "existing_relation", "type": null, "description": ""}, {"name": "new_config", "type": null, "description": ""}], "created_at": 1789079002.2992241, "supported_languages": null}, "macro.dbt.get_rename_materialized_view_sql": {"name": "get_rename_materialized_view_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/materialized_view/rename.sql", "original_file_path": "macros/relations/materialized_view/rename.sql", "unique_id": "macro.dbt.get_rename_materialized_view_sql", "macro_sql": "{% macro get_rename_materialized_view_sql(relation, new_name) %}\n {{- adapter.dispatch('get_rename_materialized_view_sql', 'dbt')(relation, new_name) -}}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__get_rename_materialized_view_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "new_name", "type": null, "description": ""}], "created_at": 1789079002.2995155, "supported_languages": null}, "macro.dbt.default__get_rename_materialized_view_sql": {"name": "default__get_rename_materialized_view_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/materialized_view/rename.sql", "original_file_path": "macros/relations/materialized_view/rename.sql", "unique_id": "macro.dbt.default__get_rename_materialized_view_sql", "macro_sql": "{% macro default__get_rename_materialized_view_sql(relation, new_name) %}\n {{ exceptions.raise_compiler_error(\n \"`get_rename_materialized_view_sql` has not been implemented for this adapter.\"\n ) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "new_name", "type": null, "description": ""}], "created_at": 1789079002.2997448, "supported_languages": null}, "macro.dbt.refresh_materialized_view": {"name": "refresh_materialized_view", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/materialized_view/refresh.sql", "original_file_path": "macros/relations/materialized_view/refresh.sql", "unique_id": "macro.dbt.refresh_materialized_view", "macro_sql": "{% macro refresh_materialized_view(relation) %}\n {{- log('Applying REFRESH to: ' ~ relation) -}}\n {{- adapter.dispatch('refresh_materialized_view', 'dbt')(relation) -}}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__refresh_materialized_view"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789079002.3000793, "supported_languages": null}, "macro.dbt.default__refresh_materialized_view": {"name": "default__refresh_materialized_view", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/materialized_view/refresh.sql", "original_file_path": "macros/relations/materialized_view/refresh.sql", "unique_id": "macro.dbt.default__refresh_materialized_view", "macro_sql": "{% macro default__refresh_materialized_view(relation) %}\n {{ exceptions.raise_compiler_error(\"`refresh_materialized_view` has not been implemented for this adapter.\") }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789079002.3002305, "supported_languages": null}, "macro.dbt.drop_materialized_view": {"name": "drop_materialized_view", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/materialized_view/drop.sql", "original_file_path": "macros/relations/materialized_view/drop.sql", "unique_id": "macro.dbt.drop_materialized_view", "macro_sql": "{% macro drop_materialized_view(relation) -%}\n {{- adapter.dispatch('drop_materialized_view', 'dbt')(relation) -}}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__drop_materialized_view"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789079002.3004944, "supported_languages": null}, "macro.dbt.default__drop_materialized_view": {"name": "default__drop_materialized_view", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/materialized_view/drop.sql", "original_file_path": "macros/relations/materialized_view/drop.sql", "unique_id": "macro.dbt.default__drop_materialized_view", "macro_sql": "{% macro default__drop_materialized_view(relation) -%}\n drop materialized view if exists {{ relation.render() }} cascade\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789079002.3006368, "supported_languages": null}, "macro.dbt.get_replace_materialized_view_sql": {"name": "get_replace_materialized_view_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/materialized_view/replace.sql", "original_file_path": "macros/relations/materialized_view/replace.sql", "unique_id": "macro.dbt.get_replace_materialized_view_sql", "macro_sql": "{% macro get_replace_materialized_view_sql(relation, sql) %}\n {{- adapter.dispatch('get_replace_materialized_view_sql', 'dbt')(relation, sql) -}}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_replace_materialized_view_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "sql", "type": null, "description": ""}], "created_at": 1789079002.3009353, "supported_languages": null}, "macro.dbt.default__get_replace_materialized_view_sql": {"name": "default__get_replace_materialized_view_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/materialized_view/replace.sql", "original_file_path": "macros/relations/materialized_view/replace.sql", "unique_id": "macro.dbt.default__get_replace_materialized_view_sql", "macro_sql": "{% macro default__get_replace_materialized_view_sql(relation, sql) %}\n {{ exceptions.raise_compiler_error(\n \"`get_replace_materialized_view_sql` has not been implemented for this adapter.\"\n ) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "sql", "type": null, "description": ""}], "created_at": 1789079002.3011053, "supported_languages": null}, "macro.dbt.get_create_view_as_sql": {"name": "get_create_view_as_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/view/create.sql", "original_file_path": "macros/relations/view/create.sql", "unique_id": "macro.dbt.get_create_view_as_sql", "macro_sql": "{% macro get_create_view_as_sql(relation, sql) -%}\n {{ adapter.dispatch('get_create_view_as_sql', 'dbt')(relation, sql) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_create_view_as_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "sql", "type": null, "description": ""}], "created_at": 1789079002.3014977, "supported_languages": null}, "macro.dbt.default__get_create_view_as_sql": {"name": "default__get_create_view_as_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/view/create.sql", "original_file_path": "macros/relations/view/create.sql", "unique_id": "macro.dbt.default__get_create_view_as_sql", "macro_sql": "{% macro default__get_create_view_as_sql(relation, sql) -%}\n {{ return(create_view_as(relation, sql)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.create_view_as"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "sql", "type": null, "description": ""}], "created_at": 1789079002.301691, "supported_languages": null}, "macro.dbt.create_view_as": {"name": "create_view_as", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/view/create.sql", "original_file_path": "macros/relations/view/create.sql", "unique_id": "macro.dbt.create_view_as", "macro_sql": "{% macro create_view_as(relation, sql) -%}\n {{ adapter.dispatch('create_view_as', 'dbt')(relation, sql) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__create_view_as"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "sql", "type": null, "description": ""}], "created_at": 1789079002.3019042, "supported_languages": null}, "macro.dbt.default__create_view_as": {"name": "default__create_view_as", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/view/create.sql", "original_file_path": "macros/relations/view/create.sql", "unique_id": "macro.dbt.default__create_view_as", "macro_sql": "{% macro default__create_view_as(relation, sql) -%}\n {%- set sql_header = config.get('sql_header', none) -%}\n\n {{ sql_header if sql_header is not none }}\n create view {{ relation.render() }}\n {% set contract_config = config.get('contract') %}\n {% if contract_config.enforced %}\n {{ get_assert_columns_equivalent(sql) }}\n {%- endif %}\n as (\n {{ sql }}\n );\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.get_assert_columns_equivalent"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "sql", "type": null, "description": ""}], "created_at": 1789079002.3023841, "supported_languages": null}, "macro.dbt.get_rename_view_sql": {"name": "get_rename_view_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/view/rename.sql", "original_file_path": "macros/relations/view/rename.sql", "unique_id": "macro.dbt.get_rename_view_sql", "macro_sql": "{% macro get_rename_view_sql(relation, new_name) %}\n {{- adapter.dispatch('get_rename_view_sql', 'dbt')(relation, new_name) -}}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__get_rename_view_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "new_name", "type": null, "description": ""}], "created_at": 1789079002.3026745, "supported_languages": null}, "macro.dbt.default__get_rename_view_sql": {"name": "default__get_rename_view_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/view/rename.sql", "original_file_path": "macros/relations/view/rename.sql", "unique_id": "macro.dbt.default__get_rename_view_sql", "macro_sql": "{% macro default__get_rename_view_sql(relation, new_name) %}\n {{ exceptions.raise_compiler_error(\n \"`get_rename_view_sql` has not been implemented for this adapter.\"\n ) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "new_name", "type": null, "description": ""}], "created_at": 1789079002.3028383, "supported_languages": null}, "macro.dbt.drop_view": {"name": "drop_view", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/view/drop.sql", "original_file_path": "macros/relations/view/drop.sql", "unique_id": "macro.dbt.drop_view", "macro_sql": "{% macro drop_view(relation) -%}\n {{- adapter.dispatch('drop_view', 'dbt')(relation) -}}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__drop_view"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789079002.3031137, "supported_languages": null}, "macro.dbt.default__drop_view": {"name": "default__drop_view", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/view/drop.sql", "original_file_path": "macros/relations/view/drop.sql", "unique_id": "macro.dbt.default__drop_view", "macro_sql": "{% macro default__drop_view(relation) -%}\n drop view if exists {{ relation.render() }} cascade\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789079002.3032537, "supported_languages": null}, "macro.dbt.get_replace_view_sql": {"name": "get_replace_view_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/view/replace.sql", "original_file_path": "macros/relations/view/replace.sql", "unique_id": "macro.dbt.get_replace_view_sql", "macro_sql": "{% macro get_replace_view_sql(relation, sql) %}\n {{- adapter.dispatch('get_replace_view_sql', 'dbt')(relation, sql) -}}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__get_replace_view_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "sql", "type": null, "description": ""}], "created_at": 1789079002.3037887, "supported_languages": null}, "macro.dbt.default__get_replace_view_sql": {"name": "default__get_replace_view_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/view/replace.sql", "original_file_path": "macros/relations/view/replace.sql", "unique_id": "macro.dbt.default__get_replace_view_sql", "macro_sql": "{% macro default__get_replace_view_sql(relation, sql) %}\n {{ exceptions.raise_compiler_error(\n \"`get_replace_view_sql` has not been implemented for this adapter.\"\n ) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "sql", "type": null, "description": ""}], "created_at": 1789079002.3040278, "supported_languages": null}, "macro.dbt.create_or_replace_view": {"name": "create_or_replace_view", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/view/replace.sql", "original_file_path": "macros/relations/view/replace.sql", "unique_id": "macro.dbt.create_or_replace_view", "macro_sql": "{% macro create_or_replace_view() %}\n {%- set identifier = model['alias'] -%}\n\n {%- set old_relation = adapter.get_relation(database=database, schema=schema, identifier=identifier) -%}\n {%- set exists_as_view = (old_relation is not none and old_relation.is_view) -%}\n\n {%- set target_relation = api.Relation.create(\n identifier=identifier, schema=schema, database=database,\n type='view') -%}\n {% set grant_config = config.get('grants') %}\n\n {{ run_hooks(pre_hooks) }}\n\n -- If there's a table with the same name and we weren't told to full refresh,\n -- that's an error. If we were told to full refresh, drop it. This behavior differs\n -- for Snowflake and BigQuery, so multiple dispatch is used.\n {%- if old_relation is not none and old_relation.is_table -%}\n {{ handle_existing_table(should_full_refresh(), old_relation) }}\n {%- endif -%}\n\n -- build model\n {% call statement('main') -%}\n {{ get_create_view_as_sql(target_relation, sql) }}\n {%- endcall %}\n\n {% set should_revoke = should_revoke(exists_as_view, full_refresh_mode=True) %}\n {% do apply_grants(target_relation, grant_config, should_revoke=should_revoke) %}\n\n {{ run_hooks(post_hooks) }}\n\n {{ return({'relations': [target_relation]}) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.run_hooks", "macro.dbt.handle_existing_table", "macro.dbt.should_full_refresh", "macro.dbt.statement", "macro.dbt.get_create_view_as_sql", "macro.dbt.should_revoke", "macro.dbt.apply_grants"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789079002.3052475, "supported_languages": null}, "macro.dbt.handle_existing_table": {"name": "handle_existing_table", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/view/replace.sql", "original_file_path": "macros/relations/view/replace.sql", "unique_id": "macro.dbt.handle_existing_table", "macro_sql": "{% macro handle_existing_table(full_refresh, old_relation) %}\n {{ adapter.dispatch('handle_existing_table', 'dbt')(full_refresh, old_relation) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__handle_existing_table"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "full_refresh", "type": null, "description": ""}, {"name": "old_relation", "type": null, "description": ""}], "created_at": 1789079002.3054748, "supported_languages": null}, "macro.dbt.default__handle_existing_table": {"name": "default__handle_existing_table", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/view/replace.sql", "original_file_path": "macros/relations/view/replace.sql", "unique_id": "macro.dbt.default__handle_existing_table", "macro_sql": "{% macro default__handle_existing_table(full_refresh, old_relation) %}\n {{ log(\"Dropping relation \" ~ old_relation.render() ~ \" because it is of type \" ~ old_relation.type) }}\n {{ adapter.drop_relation(old_relation) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "full_refresh", "type": null, "description": ""}, {"name": "old_relation", "type": null, "description": ""}], "created_at": 1789079002.305741, "supported_languages": null}, "macro.dbt.get_table_columns_and_constraints": {"name": "get_table_columns_and_constraints", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/column/columns_spec_ddl.sql", "original_file_path": "macros/relations/column/columns_spec_ddl.sql", "unique_id": "macro.dbt.get_table_columns_and_constraints", "macro_sql": "{%- macro get_table_columns_and_constraints() -%}\n {{ adapter.dispatch('get_table_columns_and_constraints', 'dbt')() }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt.default__get_table_columns_and_constraints"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789079002.3065531, "supported_languages": null}, "macro.dbt.default__get_table_columns_and_constraints": {"name": "default__get_table_columns_and_constraints", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/column/columns_spec_ddl.sql", "original_file_path": "macros/relations/column/columns_spec_ddl.sql", "unique_id": "macro.dbt.default__get_table_columns_and_constraints", "macro_sql": "{% macro default__get_table_columns_and_constraints() -%}\n {{ return(table_columns_and_constraints()) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.table_columns_and_constraints"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789079002.3066955, "supported_languages": null}, "macro.dbt.table_columns_and_constraints": {"name": "table_columns_and_constraints", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/column/columns_spec_ddl.sql", "original_file_path": "macros/relations/column/columns_spec_ddl.sql", "unique_id": "macro.dbt.table_columns_and_constraints", "macro_sql": "{% macro table_columns_and_constraints() %}\n {# loop through user_provided_columns to create DDL with data types and constraints #}\n {%- set raw_column_constraints = adapter.render_raw_columns_constraints(raw_columns=model['columns']) -%}\n {%- set raw_model_constraints = adapter.render_raw_model_constraints(raw_constraints=model['constraints']) -%}\n (\n {% for c in raw_column_constraints -%}\n {{ c }}{{ \",\" if not loop.last or raw_model_constraints }}\n {% endfor %}\n {% for c in raw_model_constraints -%}\n {{ c }}{{ \",\" if not loop.last }}\n {% endfor -%}\n )\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789079002.307296, "supported_languages": null}, "macro.dbt.get_assert_columns_equivalent": {"name": "get_assert_columns_equivalent", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/column/columns_spec_ddl.sql", "original_file_path": "macros/relations/column/columns_spec_ddl.sql", "unique_id": "macro.dbt.get_assert_columns_equivalent", "macro_sql": "\n\n{%- macro get_assert_columns_equivalent(sql) -%}\n {{ adapter.dispatch('get_assert_columns_equivalent', 'dbt')(sql) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt.default__get_assert_columns_equivalent"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "sql", "type": null, "description": ""}], "created_at": 1789079002.3074875, "supported_languages": null}, "macro.dbt.default__get_assert_columns_equivalent": {"name": "default__get_assert_columns_equivalent", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/column/columns_spec_ddl.sql", "original_file_path": "macros/relations/column/columns_spec_ddl.sql", "unique_id": "macro.dbt.default__get_assert_columns_equivalent", "macro_sql": "{% macro default__get_assert_columns_equivalent(sql) -%}\n {{ return(assert_columns_equivalent(sql)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.assert_columns_equivalent"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "sql", "type": null, "description": ""}], "created_at": 1789079002.307646, "supported_languages": null}, "macro.dbt.assert_columns_equivalent": {"name": "assert_columns_equivalent", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/column/columns_spec_ddl.sql", "original_file_path": "macros/relations/column/columns_spec_ddl.sql", "unique_id": "macro.dbt.assert_columns_equivalent", "macro_sql": "{% macro assert_columns_equivalent(sql) %}\n\n {#-- First ensure the user has defined 'columns' in yaml specification --#}\n {%- set user_defined_columns = model['columns'] -%}\n {%- if not user_defined_columns -%}\n {{ exceptions.raise_contract_error([], []) }}\n {%- endif -%}\n\n {#-- Obtain the column schema provided by sql file. #}\n {%- set sql_file_provided_columns = get_column_schema_from_query(sql, config.get('sql_header', none)) -%}\n {#--Obtain the column schema provided by the schema file by generating an 'empty schema' query from the model's columns. #}\n {%- set schema_file_provided_columns = get_column_schema_from_query(get_empty_schema_sql(user_defined_columns)) -%}\n\n {#-- create dictionaries with name and formatted data type and strings for exception #}\n {%- set sql_columns = format_columns(sql_file_provided_columns) -%}\n {%- set yaml_columns = format_columns(schema_file_provided_columns) -%}\n\n {%- if sql_columns|length != yaml_columns|length -%}\n {%- do exceptions.raise_contract_error(yaml_columns, sql_columns) -%}\n {%- endif -%}\n\n {%- for sql_col in sql_columns -%}\n {%- set yaml_col = [] -%}\n {%- for this_col in yaml_columns -%}\n {%- if this_col['name'] == sql_col['name'] -%}\n {%- do yaml_col.append(this_col) -%}\n {%- break -%}\n {%- endif -%}\n {%- endfor -%}\n {%- if not yaml_col -%}\n {#-- Column with name not found in yaml #}\n {%- do exceptions.raise_contract_error(yaml_columns, sql_columns) -%}\n {%- endif -%}\n {%- if sql_col['formatted'] != yaml_col[0]['formatted'] -%}\n {#-- Column data types don't match #}\n {%- do exceptions.raise_contract_error(yaml_columns, sql_columns) -%}\n {%- endif -%}\n {%- endfor -%}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_column_schema_from_query", "macro.dbt.get_empty_schema_sql", "macro.dbt.format_columns"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "sql", "type": null, "description": ""}], "created_at": 1789079002.3090608, "supported_languages": null}, "macro.dbt.format_columns": {"name": "format_columns", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/column/columns_spec_ddl.sql", "original_file_path": "macros/relations/column/columns_spec_ddl.sql", "unique_id": "macro.dbt.format_columns", "macro_sql": "{% macro format_columns(columns) %}\n {% set formatted_columns = [] %}\n {% for column in columns %}\n {%- set formatted_column = adapter.dispatch('format_column', 'dbt')(column) -%}\n {%- do formatted_columns.append(formatted_column) -%}\n {% endfor %}\n {{ return(formatted_columns) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__format_column"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "columns", "type": null, "description": ""}], "created_at": 1789079002.3094876, "supported_languages": null}, "macro.dbt.default__format_column": {"name": "default__format_column", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/column/columns_spec_ddl.sql", "original_file_path": "macros/relations/column/columns_spec_ddl.sql", "unique_id": "macro.dbt.default__format_column", "macro_sql": "{% macro default__format_column(column) -%}\n {% set data_type = column.dtype %}\n {% set formatted = column.column.lower() ~ \" \" ~ data_type %}\n {{ return({'name': column.name, 'data_type': data_type, 'formatted': formatted}) }}\n{%- endmacro -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "column", "type": null, "description": ""}], "created_at": 1789079002.3098695, "supported_languages": null}, "macro.dbt.get_create_table_as_sql": {"name": "get_create_table_as_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/table/create.sql", "original_file_path": "macros/relations/table/create.sql", "unique_id": "macro.dbt.get_create_table_as_sql", "macro_sql": "{% macro get_create_table_as_sql(temporary, relation, sql) -%}\n {{ adapter.dispatch('get_create_table_as_sql', 'dbt')(temporary, relation, sql) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_create_table_as_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "temporary", "type": null, "description": ""}, {"name": "relation", "type": null, "description": ""}, {"name": "sql", "type": null, "description": ""}], "created_at": 1789079002.3105526, "supported_languages": null}, "macro.dbt.default__get_create_table_as_sql": {"name": "default__get_create_table_as_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/table/create.sql", "original_file_path": "macros/relations/table/create.sql", "unique_id": "macro.dbt.default__get_create_table_as_sql", "macro_sql": "{% macro default__get_create_table_as_sql(temporary, relation, sql) -%}\n {{ return(create_table_as(temporary, relation, sql)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.create_table_as"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "temporary", "type": null, "description": ""}, {"name": "relation", "type": null, "description": ""}, {"name": "sql", "type": null, "description": ""}], "created_at": 1789079002.3107624, "supported_languages": null}, "macro.dbt.create_table_as": {"name": "create_table_as", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/table/create.sql", "original_file_path": "macros/relations/table/create.sql", "unique_id": "macro.dbt.create_table_as", "macro_sql": "{% macro create_table_as(temporary, relation, compiled_code, language='sql') -%}\n {# backward compatibility for create_table_as that does not support language #}\n {% if language == \"sql\" %}\n {{ adapter.dispatch('create_table_as', 'dbt')(temporary, relation, compiled_code)}}\n {% else %}\n {{ adapter.dispatch('create_table_as', 'dbt')(temporary, relation, compiled_code, language) }}\n {% endif %}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__create_table_as"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "temporary", "type": null, "description": ""}, {"name": "relation", "type": null, "description": ""}, {"name": "compiled_code", "type": null, "description": ""}, {"name": "language", "type": null, "description": ""}], "created_at": 1789079002.3113205, "supported_languages": null}, "macro.dbt.default__create_table_as": {"name": "default__create_table_as", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/table/create.sql", "original_file_path": "macros/relations/table/create.sql", "unique_id": "macro.dbt.default__create_table_as", "macro_sql": "{% macro default__create_table_as(temporary, relation, sql) -%}\n {%- set sql_header = config.get('sql_header', none) -%}\n\n {{ sql_header if sql_header is not none }}\n\n create {% if temporary: -%}temporary{%- endif %} table\n {{ relation.include(database=(not temporary), schema=(not temporary)) }}\n {% set contract_config = config.get('contract') %}\n {% if contract_config.enforced and (not temporary) %}\n {{ get_assert_columns_equivalent(sql) }}\n {{ get_table_columns_and_constraints() }}\n {%- set sql = get_select_subquery(sql) %}\n {% endif %}\n as (\n {{ sql }}\n );\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.get_assert_columns_equivalent", "macro.dbt.get_table_columns_and_constraints", "macro.dbt.get_select_subquery"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "temporary", "type": null, "description": ""}, {"name": "relation", "type": null, "description": ""}, {"name": "sql", "type": null, "description": ""}], "created_at": 1789079002.3121114, "supported_languages": null}, "macro.dbt.default__get_column_names": {"name": "default__get_column_names", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/table/create.sql", "original_file_path": "macros/relations/table/create.sql", "unique_id": "macro.dbt.default__get_column_names", "macro_sql": "{% macro default__get_column_names() %}\n {#- loop through user_provided_columns to get column names -#}\n {%- set user_provided_columns = model['columns'] -%}\n {%- for i in user_provided_columns %}\n {%- set col = user_provided_columns[i] -%}\n {%- set col_name = adapter.quote(col['name']) if col.get('quote') else col['name'] -%}\n {{ col_name }}{{ \", \" if not loop.last }}\n {%- endfor -%}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789079002.3126292, "supported_languages": null}, "macro.dbt.get_select_subquery": {"name": "get_select_subquery", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/table/create.sql", "original_file_path": "macros/relations/table/create.sql", "unique_id": "macro.dbt.get_select_subquery", "macro_sql": "{% macro get_select_subquery(sql) %}\n {{ return(adapter.dispatch('get_select_subquery', 'dbt')(sql)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_select_subquery"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "sql", "type": null, "description": ""}], "created_at": 1789079002.3128371, "supported_languages": null}, "macro.dbt.default__get_select_subquery": {"name": "default__get_select_subquery", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/table/create.sql", "original_file_path": "macros/relations/table/create.sql", "unique_id": "macro.dbt.default__get_select_subquery", "macro_sql": "{% macro default__get_select_subquery(sql) %}\n select {{ adapter.dispatch('get_column_names', 'dbt')() }}\n from (\n {{ sql }}\n ) as model_subq\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_column_names"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "sql", "type": null, "description": ""}], "created_at": 1789079002.3130522, "supported_languages": null}, "macro.dbt.get_rename_table_sql": {"name": "get_rename_table_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/table/rename.sql", "original_file_path": "macros/relations/table/rename.sql", "unique_id": "macro.dbt.get_rename_table_sql", "macro_sql": "{% macro get_rename_table_sql(relation, new_name) %}\n {{- adapter.dispatch('get_rename_table_sql', 'dbt')(relation, new_name) -}}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__get_rename_table_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "new_name", "type": null, "description": ""}], "created_at": 1789079002.3133519, "supported_languages": null}, "macro.dbt.default__get_rename_table_sql": {"name": "default__get_rename_table_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/table/rename.sql", "original_file_path": "macros/relations/table/rename.sql", "unique_id": "macro.dbt.default__get_rename_table_sql", "macro_sql": "{% macro default__get_rename_table_sql(relation, new_name) %}\n {{ exceptions.raise_compiler_error(\n \"`get_rename_table_sql` has not been implemented for this adapter.\"\n ) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "new_name", "type": null, "description": ""}], "created_at": 1789079002.3135197, "supported_languages": null}, "macro.dbt.drop_table": {"name": "drop_table", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/table/drop.sql", "original_file_path": "macros/relations/table/drop.sql", "unique_id": "macro.dbt.drop_table", "macro_sql": "{% macro drop_table(relation) -%}\n {{- adapter.dispatch('drop_table', 'dbt')(relation) -}}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__drop_table"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789079002.3137906, "supported_languages": null}, "macro.dbt.default__drop_table": {"name": "default__drop_table", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/table/drop.sql", "original_file_path": "macros/relations/table/drop.sql", "unique_id": "macro.dbt.default__drop_table", "macro_sql": "{% macro default__drop_table(relation) -%}\n drop table if exists {{ relation.render() }} cascade\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789079002.3139474, "supported_languages": null}, "macro.dbt.get_replace_table_sql": {"name": "get_replace_table_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/table/replace.sql", "original_file_path": "macros/relations/table/replace.sql", "unique_id": "macro.dbt.get_replace_table_sql", "macro_sql": "{% macro get_replace_table_sql(relation, sql) %}\n {{- adapter.dispatch('get_replace_table_sql', 'dbt')(relation, sql) -}}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__get_replace_table_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "sql", "type": null, "description": ""}], "created_at": 1789079002.3142426, "supported_languages": null}, "macro.dbt.default__get_replace_table_sql": {"name": "default__get_replace_table_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/table/replace.sql", "original_file_path": "macros/relations/table/replace.sql", "unique_id": "macro.dbt.default__get_replace_table_sql", "macro_sql": "{% macro default__get_replace_table_sql(relation, sql) %}\n {{ exceptions.raise_compiler_error(\n \"`get_replace_table_sql` has not been implemented for this adapter.\"\n ) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "sql", "type": null, "description": ""}], "created_at": 1789079002.3144107, "supported_languages": null}, "macro.dbt.default__test_relationships": {"name": "default__test_relationships", "resource_type": "macro", "package_name": "dbt", "path": "macros/generic_test_sql/relationships.sql", "original_file_path": "macros/generic_test_sql/relationships.sql", "unique_id": "macro.dbt.default__test_relationships", "macro_sql": "{% macro default__test_relationships(model, column_name, to, field) %}\n\nwith child as (\n select {{ column_name }} as from_field\n from {{ model }}\n where {{ column_name }} is not null\n),\n\nparent as (\n select {{ field }} as to_field\n from {{ to }}\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "column_name", "type": null, "description": ""}, {"name": "to", "type": null, "description": ""}, {"name": "field", "type": null, "description": ""}], "created_at": 1789079002.3147297, "supported_languages": null}, "macro.dbt.default__test_accepted_values": {"name": "default__test_accepted_values", "resource_type": "macro", "package_name": "dbt", "path": "macros/generic_test_sql/accepted_values.sql", "original_file_path": "macros/generic_test_sql/accepted_values.sql", "unique_id": "macro.dbt.default__test_accepted_values", "macro_sql": "{% macro default__test_accepted_values(model, column_name, values, quote=True) %}\n\nwith all_values as (\n\n select\n {{ column_name }} as value_field,\n count(*) as n_records\n\n from {{ model }}\n group by {{ column_name }}\n\n)\n\nselect *\nfrom all_values\nwhere value_field not in (\n {% for value in values -%}\n {% if quote -%}\n '{{ value }}'\n {%- else -%}\n {{ value }}\n {%- endif -%}\n {%- if not loop.last -%},{%- endif %}\n {%- endfor %}\n)\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "column_name", "type": null, "description": ""}, {"name": "values", "type": null, "description": ""}, {"name": "quote", "type": null, "description": ""}], "created_at": 1789079002.3153062, "supported_languages": null}, "macro.dbt.default__test_not_null": {"name": "default__test_not_null", "resource_type": "macro", "package_name": "dbt", "path": "macros/generic_test_sql/not_null.sql", "original_file_path": "macros/generic_test_sql/not_null.sql", "unique_id": "macro.dbt.default__test_not_null", "macro_sql": "{% macro default__test_not_null(model, column_name) %}\n\n{% set column_list = '*' if should_store_failures() else column_name %}\n\nselect {{ column_list }}\nfrom {{ model }}\nwhere {{ column_name }} is null\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.should_store_failures"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "column_name", "type": null, "description": ""}], "created_at": 1789079002.3156385, "supported_languages": null}, "macro.dbt.default__test_unique": {"name": "default__test_unique", "resource_type": "macro", "package_name": "dbt", "path": "macros/generic_test_sql/unique.sql", "original_file_path": "macros/generic_test_sql/unique.sql", "unique_id": "macro.dbt.default__test_unique", "macro_sql": "{% macro default__test_unique(model, column_name) %}\n\nselect\n {{ column_name }} as unique_field,\n count(*) as n_records\n\nfrom {{ model }}\nwhere {{ column_name }} is not null\ngroup by {{ column_name }}\nhaving count(*) > 1\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "column_name", "type": null, "description": ""}], "created_at": 1789079002.3159103, "supported_languages": null}, "macro.dbt.set_sql_header": {"name": "set_sql_header", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/configs.sql", "original_file_path": "macros/materializations/configs.sql", "unique_id": "macro.dbt.set_sql_header", "macro_sql": "{% macro set_sql_header(config) -%}\n {{ config.set('sql_header', caller()) }}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "config", "type": null, "description": ""}], "created_at": 1789079002.3162365, "supported_languages": null}, "macro.dbt.should_full_refresh": {"name": "should_full_refresh", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/configs.sql", "original_file_path": "macros/materializations/configs.sql", "unique_id": "macro.dbt.should_full_refresh", "macro_sql": "{% macro should_full_refresh() %}\n {% set config_full_refresh = config.get('full_refresh') %}\n {% if config_full_refresh is none %}\n {% set config_full_refresh = flags.FULL_REFRESH %}\n {% endif %}\n {% do return(config_full_refresh) %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789079002.3166535, "supported_languages": null}, "macro.dbt.should_store_failures": {"name": "should_store_failures", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/configs.sql", "original_file_path": "macros/materializations/configs.sql", "unique_id": "macro.dbt.should_store_failures", "macro_sql": "{% macro should_store_failures() %}\n {% set config_store_failures = config.get('store_failures') %}\n {% if config_store_failures is none %}\n {% set config_store_failures = flags.STORE_FAILURES %}\n {% endif %}\n {% do return(config_store_failures) %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789079002.3170006, "supported_languages": null}, "macro.dbt.run_hooks": {"name": "run_hooks", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/hooks.sql", "original_file_path": "macros/materializations/hooks.sql", "unique_id": "macro.dbt.run_hooks", "macro_sql": "{% macro run_hooks(hooks, inside_transaction=True) %}\n {% for hook in hooks | selectattr('transaction', 'equalto', inside_transaction) %}\n {% if not inside_transaction and loop.first %}\n {% call statement(auto_begin=inside_transaction) %}\n commit;\n {% endcall %}\n {% endif %}\n {% set rendered = render(hook.get('sql')) | trim %}\n {% if (rendered | length) > 0 %}\n {% call statement(auto_begin=inside_transaction) %}\n {{ rendered }}\n {% endcall %}\n {% endif %}\n {% endfor %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "hooks", "type": null, "description": ""}, {"name": "inside_transaction", "type": null, "description": ""}], "created_at": 1789079002.3179517, "supported_languages": null}, "macro.dbt.make_hook_config": {"name": "make_hook_config", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/hooks.sql", "original_file_path": "macros/materializations/hooks.sql", "unique_id": "macro.dbt.make_hook_config", "macro_sql": "{% macro make_hook_config(sql, inside_transaction) %}\n {{ tojson({\"sql\": sql, \"transaction\": inside_transaction}) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "sql", "type": null, "description": ""}, {"name": "inside_transaction", "type": null, "description": ""}], "created_at": 1789079002.3181753, "supported_languages": null}, "macro.dbt.before_begin": {"name": "before_begin", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/hooks.sql", "original_file_path": "macros/materializations/hooks.sql", "unique_id": "macro.dbt.before_begin", "macro_sql": "{% macro before_begin(sql) %}\n {{ make_hook_config(sql, inside_transaction=False) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.make_hook_config"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "sql", "type": null, "description": ""}], "created_at": 1789079002.318342, "supported_languages": null}, "macro.dbt.in_transaction": {"name": "in_transaction", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/hooks.sql", "original_file_path": "macros/materializations/hooks.sql", "unique_id": "macro.dbt.in_transaction", "macro_sql": "{% macro in_transaction(sql) %}\n {{ make_hook_config(sql, inside_transaction=True) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.make_hook_config"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "sql", "type": null, "description": ""}], "created_at": 1789079002.318511, "supported_languages": null}, "macro.dbt.after_commit": {"name": "after_commit", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/hooks.sql", "original_file_path": "macros/materializations/hooks.sql", "unique_id": "macro.dbt.after_commit", "macro_sql": "{% macro after_commit(sql) %}\n {{ make_hook_config(sql, inside_transaction=False) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.make_hook_config"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "sql", "type": null, "description": ""}], "created_at": 1789079002.3186748, "supported_languages": null}, "macro.dbt.materialization_seed_default": {"name": "materialization_seed_default", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/seeds/seed.sql", "original_file_path": "macros/materializations/seeds/seed.sql", "unique_id": "macro.dbt.materialization_seed_default", "macro_sql": "{% materialization seed, default %}\n\n {%- set identifier = model['alias'] -%}\n {%- set full_refresh_mode = (should_full_refresh()) -%}\n\n {%- set old_relation = adapter.get_relation(database=database, schema=schema, identifier=identifier) -%}\n\n {%- set exists_as_table = (old_relation is not none and old_relation.is_table) -%}\n {%- set exists_as_view = (old_relation is not none and old_relation.is_view) -%}\n\n {%- set grant_config = config.get('grants') -%}\n {%- set agate_table = load_agate_table() -%}\n -- grab current tables grants config for comparison later on\n\n {%- do store_result('agate_table', response='OK', agate_table=agate_table) -%}\n\n {{ run_hooks(pre_hooks, inside_transaction=False) }}\n\n -- `BEGIN` happens here:\n {{ run_hooks(pre_hooks, inside_transaction=True) }}\n\n -- build model\n {% set create_table_sql = \"\" %}\n {% if exists_as_view %}\n {{ exceptions.raise_compiler_error(\"Cannot seed to '{}', it is a view\".format(old_relation.render())) }}\n {% elif exists_as_table %}\n {% set create_table_sql = reset_csv_table(model, full_refresh_mode, old_relation, agate_table) %}\n {% else %}\n {% set create_table_sql = create_csv_table(model, agate_table) %}\n {% endif %}\n\n {% set code = 'CREATE' if full_refresh_mode else 'INSERT' %}\n {% set rows_affected = (agate_table.rows | length) %}\n {% set sql = \"\" %}\n {% if rows_affected > 0 %}\n {% set sql = load_csv_rows(model, agate_table) %}\n {% endif %}\n\n {% call noop_statement('main', code ~ ' ' ~ rows_affected, code, rows_affected) %}\n {{ get_csv_sql(create_table_sql, sql) }};\n {% endcall %}\n\n {% set target_relation = this.incorporate(type='table') %}\n\n {% set should_revoke = should_revoke(old_relation, full_refresh_mode) %}\n {% do apply_grants(target_relation, grant_config, should_revoke=should_revoke) %}\n\n {% do persist_docs(target_relation, model) %}\n\n {% if full_refresh_mode or not exists_as_table %}\n {% do create_indexes(target_relation) %}\n {% endif %}\n\n {{ run_hooks(post_hooks, inside_transaction=True) }}\n\n -- `COMMIT` happens here\n {{ adapter.commit() }}\n\n {{ run_hooks(post_hooks, inside_transaction=False) }}\n\n {{ return({'relations': [target_relation]}) }}\n\n{% endmaterialization %}", "depends_on": {"macros": ["macro.dbt.should_full_refresh", "macro.dbt.run_hooks", "macro.dbt.reset_csv_table", "macro.dbt.create_csv_table", "macro.dbt.load_csv_rows", "macro.dbt.noop_statement", "macro.dbt.get_csv_sql", "macro.dbt.should_revoke", "macro.dbt.apply_grants", "macro.dbt.persist_docs", "macro.dbt.create_indexes"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "supported_languages", "type": null, "description": ""}], "created_at": 1789079002.3216689, "supported_languages": ["sql"]}, "macro.dbt.create_csv_table": {"name": "create_csv_table", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "unique_id": "macro.dbt.create_csv_table", "macro_sql": "{% macro create_csv_table(model, agate_table) -%}\n {{ adapter.dispatch('create_csv_table', 'dbt')(model, agate_table) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__create_csv_table"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "agate_table", "type": null, "description": ""}], "created_at": 1789079002.3227544, "supported_languages": null}, "macro.dbt.default__create_csv_table": {"name": "default__create_csv_table", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "unique_id": "macro.dbt.default__create_csv_table", "macro_sql": "{% macro default__create_csv_table(model, agate_table) %}\n {%- set column_override = model['config'].get('column_types', {}) -%}\n {%- set quote_seed_column = model['config'].get('quote_columns', None) -%}\n\n {% set sql %}\n create table {{ this.render() }} (\n {%- for col_name in agate_table.column_names -%}\n {%- set inferred_type = adapter.convert_type(agate_table, loop.index0) -%}\n {%- set type = column_override.get(col_name, inferred_type) -%}\n {%- set column_name = (col_name | string) -%}\n {{ adapter.quote_seed_column(column_name, quote_seed_column) }} {{ type }} {%- if not loop.last -%}, {%- endif -%}\n {%- endfor -%}\n )\n {% endset %}\n\n {% call statement('_') -%}\n {{ sql }}\n {%- endcall %}\n\n {{ return(sql) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "agate_table", "type": null, "description": ""}], "created_at": 1789079002.3237627, "supported_languages": null}, "macro.dbt.reset_csv_table": {"name": "reset_csv_table", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "unique_id": "macro.dbt.reset_csv_table", "macro_sql": "{% macro reset_csv_table(model, full_refresh, old_relation, agate_table) -%}\n {{ adapter.dispatch('reset_csv_table', 'dbt')(model, full_refresh, old_relation, agate_table) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__reset_csv_table"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "full_refresh", "type": null, "description": ""}, {"name": "old_relation", "type": null, "description": ""}, {"name": "agate_table", "type": null, "description": ""}], "created_at": 1789079002.324041, "supported_languages": null}, "macro.dbt.default__reset_csv_table": {"name": "default__reset_csv_table", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "unique_id": "macro.dbt.default__reset_csv_table", "macro_sql": "{% macro default__reset_csv_table(model, full_refresh, old_relation, agate_table) %}\n {% set sql = \"\" %}\n {% if full_refresh %}\n {{ adapter.drop_relation(old_relation) }}\n {% set sql = create_csv_table(model, agate_table) %}\n {% else %}\n {{ adapter.truncate_relation(old_relation) }}\n {% set sql = \"truncate table \" ~ old_relation.render() %}\n {% endif %}\n\n {{ return(sql) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.create_csv_table"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "full_refresh", "type": null, "description": ""}, {"name": "old_relation", "type": null, "description": ""}, {"name": "agate_table", "type": null, "description": ""}], "created_at": 1789079002.3245916, "supported_languages": null}, "macro.dbt.get_csv_sql": {"name": "get_csv_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "unique_id": "macro.dbt.get_csv_sql", "macro_sql": "{% macro get_csv_sql(create_or_truncate_sql, insert_sql) %}\n {{ adapter.dispatch('get_csv_sql', 'dbt')(create_or_truncate_sql, insert_sql) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_csv_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "create_or_truncate_sql", "type": null, "description": ""}, {"name": "insert_sql", "type": null, "description": ""}], "created_at": 1789079002.3248084, "supported_languages": null}, "macro.dbt.default__get_csv_sql": {"name": "default__get_csv_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "unique_id": "macro.dbt.default__get_csv_sql", "macro_sql": "{% macro default__get_csv_sql(create_or_truncate_sql, insert_sql) %}\n {{ create_or_truncate_sql }};\n -- dbt seed --\n {{ insert_sql }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "create_or_truncate_sql", "type": null, "description": ""}, {"name": "insert_sql", "type": null, "description": ""}], "created_at": 1789079002.3249767, "supported_languages": null}, "macro.dbt.get_binding_char": {"name": "get_binding_char", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "unique_id": "macro.dbt.get_binding_char", "macro_sql": "{% macro get_binding_char() -%}\n {{ adapter.dispatch('get_binding_char', 'dbt')() }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_binding_char"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789079002.325138, "supported_languages": null}, "macro.dbt.default__get_binding_char": {"name": "default__get_binding_char", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "unique_id": "macro.dbt.default__get_binding_char", "macro_sql": "{% macro default__get_binding_char() %}\n {{ return('%s') }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789079002.3252742, "supported_languages": null}, "macro.dbt.get_batch_size": {"name": "get_batch_size", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "unique_id": "macro.dbt.get_batch_size", "macro_sql": "{% macro get_batch_size() -%}\n {{ return(adapter.dispatch('get_batch_size', 'dbt')()) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_batch_size"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789079002.3254507, "supported_languages": null}, "macro.dbt.default__get_batch_size": {"name": "default__get_batch_size", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "unique_id": "macro.dbt.default__get_batch_size", "macro_sql": "{% macro default__get_batch_size() %}\n {{ return(10000) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789079002.3255858, "supported_languages": null}, "macro.dbt.get_seed_column_quoted_csv": {"name": "get_seed_column_quoted_csv", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "unique_id": "macro.dbt.get_seed_column_quoted_csv", "macro_sql": "{% macro get_seed_column_quoted_csv(model, column_names) %}\n {%- set quote_seed_column = model['config'].get('quote_columns', None) -%}\n {% set quoted = [] %}\n {% for col in column_names -%}\n {%- do quoted.append(adapter.quote_seed_column(col, quote_seed_column)) -%}\n {%- endfor %}\n\n {%- set dest_cols_csv = quoted | join(', ') -%}\n {{ return(dest_cols_csv) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "column_names", "type": null, "description": ""}], "created_at": 1789079002.3261583, "supported_languages": null}, "macro.dbt.load_csv_rows": {"name": "load_csv_rows", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "unique_id": "macro.dbt.load_csv_rows", "macro_sql": "{% macro load_csv_rows(model, agate_table) -%}\n {{ adapter.dispatch('load_csv_rows', 'dbt')(model, agate_table) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__load_csv_rows"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "agate_table", "type": null, "description": ""}], "created_at": 1789079002.3263714, "supported_languages": null}, "macro.dbt.default__load_csv_rows": {"name": "default__load_csv_rows", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "unique_id": "macro.dbt.default__load_csv_rows", "macro_sql": "{% macro default__load_csv_rows(model, agate_table) %}\n\n {% set batch_size = get_batch_size() %}\n\n {% set cols_sql = get_seed_column_quoted_csv(model, agate_table.column_names) %}\n {% set bindings = [] %}\n\n {% set statements = [] %}\n\n {% for chunk in agate_table.rows | batch(batch_size) %}\n {% set bindings = [] %}\n\n {% for row in chunk %}\n {% do bindings.extend(row) %}\n {% endfor %}\n\n {% set sql %}\n insert into {{ this.render() }} ({{ cols_sql }}) values\n {% for row in chunk -%}\n ({%- for column in agate_table.column_names -%}\n {{ get_binding_char() }}\n {%- if not loop.last%},{%- endif %}\n {%- endfor -%})\n {%- if not loop.last%},{%- endif %}\n {%- endfor %}\n {% endset %}\n\n {% do adapter.add_query(sql, bindings=bindings, abridge_sql_log=True) %}\n\n {% if loop.index0 == 0 %}\n {% do statements.append(sql) %}\n {% endif %}\n {% endfor %}\n\n {# Return SQL so we can render it out into the compiled files #}\n {{ return(statements[0]) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_batch_size", "macro.dbt.get_seed_column_quoted_csv", "macro.dbt.get_binding_char"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "agate_table", "type": null, "description": ""}], "created_at": 1789079002.32779, "supported_languages": null}, "macro.dbt.materialization_unit_default": {"name": "materialization_unit_default", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/tests/unit.sql", "original_file_path": "macros/materializations/tests/unit.sql", "unique_id": "macro.dbt.materialization_unit_default", "macro_sql": "{%- materialization unit, default -%}\n\n {% set relations = [] %}\n {% set sql_header = config.get('sql_header') if flags.REQUIRE_SQL_HEADER_IN_TEST_CONFIGS else none %}\n\n {% set expected_rows = config.get('expected_rows') %}\n {% set expected_sql = config.get('expected_sql') %}\n {% set tested_expected_column_names = expected_rows[0].keys() if (expected_rows | length ) > 0 else get_columns_in_query(sql) %}\n\n {%- set target_relation = this.incorporate(type='table') -%}\n {%- set temp_relation = make_temp_relation(target_relation)-%}\n {% do run_query(get_create_table_as_sql(True, temp_relation, get_empty_subquery_sql(sql))) %}\n {%- set columns_in_relation = adapter.get_columns_in_relation(temp_relation) -%}\n {%- set column_name_to_data_types = {} -%}\n {%- set column_name_to_quoted = {} -%}\n {%- for column in columns_in_relation -%}\n {%- do column_name_to_data_types.update({column.name|lower: column.data_type}) -%}\n {%- do column_name_to_quoted.update({column.name|lower: column.quoted}) -%}\n {%- endfor -%}\n\n {%- set expected_column_names_quoted = [] -%}\n {%- for column_name in tested_expected_column_names -%}\n {%- do expected_column_names_quoted.append(column_name_to_quoted[column_name|lower]) -%}\n {%- endfor -%}\n\n {% if not expected_sql %}\n {% set expected_sql = get_expected_sql(expected_rows, column_name_to_data_types, column_name_to_quoted) %}\n {% endif %}\n {% set unit_test_sql = get_unit_test_sql(sql, expected_sql, expected_column_names_quoted) %}\n\n {% call statement('main', fetch_result=True) -%}\n\n {% if sql_header %}{{ sql_header }}{% endif %}\n {{ unit_test_sql }}\n\n {%- endcall %}\n\n {% do adapter.drop_relation(temp_relation) %}\n\n {{ return({'relations': relations}) }}\n\n{%- endmaterialization -%}", "depends_on": {"macros": ["macro.dbt.get_columns_in_query", "macro.dbt.make_temp_relation", "macro.dbt.run_query", "macro.dbt.get_create_table_as_sql", "macro.dbt.get_empty_subquery_sql", "macro.dbt.get_expected_sql", "macro.dbt.get_unit_test_sql", "macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "supported_languages", "type": null, "description": ""}], "created_at": 1789079002.3301504, "supported_languages": ["sql"]}, "macro.dbt.materialization_test_default": {"name": "materialization_test_default", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/tests/test.sql", "original_file_path": "macros/materializations/tests/test.sql", "unique_id": "macro.dbt.materialization_test_default", "macro_sql": "{%- materialization test, default -%}\n\n {% set relations = [] %}\n {% set limit = config.get('limit') %}\n {% set sql_header = config.get('sql_header') if flags.REQUIRE_SQL_HEADER_IN_TEST_CONFIGS else none %}\n\n {% set sql_with_limit %}\n {{ get_limit_subquery_sql(sql, limit) }}\n {% endset %}\n\n {% if should_store_failures() %}\n\n {% set identifier = model['alias'] %}\n {% set old_relation = adapter.get_relation(database=database, schema=schema, identifier=identifier) %}\n\n {% set store_failures_as = config.get('store_failures_as') %}\n -- if `--store-failures` is invoked via command line and `store_failures_as` is not set,\n -- config.get('store_failures_as', 'table') returns None, not 'table'\n {% if store_failures_as == none %}{% set store_failures_as = 'table' %}{% endif %}\n {% if store_failures_as not in ['table', 'view'] %}\n {{ exceptions.raise_compiler_error(\n \"'\" ~ store_failures_as ~ \"' is not a valid value for `store_failures_as`. \"\n \"Accepted values are: ['ephemeral', 'table', 'view']\"\n ) }}\n {% endif %}\n\n {% set target_relation = api.Relation.create(\n identifier=identifier, schema=schema, database=database, type=store_failures_as) -%} %}\n\n {% if old_relation %}\n {% do adapter.drop_relation(old_relation) %}\n {% endif %}\n\n {% call statement(auto_begin=True) %}\n {% if sql_header %}{{ sql_header }}{% endif %}\n {{ get_create_sql(target_relation, sql_with_limit) }}\n {% endcall %}\n\n {% do relations.append(target_relation) %}\n\n {# Since the test failures have already been saved to the database, reuse that result rather than querying again #}\n {% set main_sql %}\n select *\n from {{ target_relation }}\n {% endset %}\n\n {{ adapter.commit() }}\n\n {% else %}\n\n {% set main_sql = sql_with_limit %}\n\n {% endif %}\n\n {% set fail_calc = config.get('fail_calc') %}\n {% set warn_if = config.get('warn_if') %}\n {% set error_if = config.get('error_if') %}\n\n {% call statement('main', fetch_result=True) -%}\n\n {% if sql_header %}{{ sql_header }}{% endif %}\n {# The limit has already been included above, and we do not want to duplicate it again. We also want to be safe for macro overrides treating `limit` as a required parameter. #}\n {{ get_test_sql(main_sql, fail_calc, warn_if, error_if, limit=none)}}\n\n {%- endcall %}\n\n {{ return({'relations': relations}) }}\n\n{%- endmaterialization -%}", "depends_on": {"macros": ["macro.dbt.get_limit_subquery_sql", "macro.dbt.should_store_failures", "macro.dbt.statement", "macro.dbt.get_create_sql", "macro.dbt.get_test_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "supported_languages", "type": null, "description": ""}], "created_at": 1789079002.3330054, "supported_languages": ["sql"]}, "macro.dbt.get_test_sql": {"name": "get_test_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/tests/helpers.sql", "original_file_path": "macros/materializations/tests/helpers.sql", "unique_id": "macro.dbt.get_test_sql", "macro_sql": "{% macro get_test_sql(main_sql, fail_calc, warn_if, error_if, limit) -%}\n {{ adapter.dispatch('get_test_sql', 'dbt')(main_sql, fail_calc, warn_if, error_if, limit) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_test_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "main_sql", "type": null, "description": ""}, {"name": "fail_calc", "type": null, "description": ""}, {"name": "warn_if", "type": null, "description": ""}, {"name": "error_if", "type": null, "description": ""}, {"name": "limit", "type": null, "description": ""}], "created_at": 1789079002.33362, "supported_languages": null}, "macro.dbt.default__get_test_sql": {"name": "default__get_test_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/tests/helpers.sql", "original_file_path": "macros/materializations/tests/helpers.sql", "unique_id": "macro.dbt.default__get_test_sql", "macro_sql": "{% macro default__get_test_sql(main_sql, fail_calc, warn_if, error_if, limit) -%}\n select\n {{ fail_calc }} as failures,\n {{ fail_calc }} {{ warn_if }} as should_warn,\n {{ fail_calc }} {{ error_if }} as should_error\n from (\n {{ main_sql }}\n {{ \"limit \" ~ limit if limit != none }}\n ) dbt_internal_test\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "main_sql", "type": null, "description": ""}, {"name": "fail_calc", "type": null, "description": ""}, {"name": "warn_if", "type": null, "description": ""}, {"name": "error_if", "type": null, "description": ""}, {"name": "limit", "type": null, "description": ""}], "created_at": 1789079002.3339863, "supported_languages": null}, "macro.dbt.get_unit_test_sql": {"name": "get_unit_test_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/tests/helpers.sql", "original_file_path": "macros/materializations/tests/helpers.sql", "unique_id": "macro.dbt.get_unit_test_sql", "macro_sql": "{% macro get_unit_test_sql(main_sql, expected_fixture_sql, expected_column_names) -%}\n {{ adapter.dispatch('get_unit_test_sql', 'dbt')(main_sql, expected_fixture_sql, expected_column_names) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_unit_test_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "main_sql", "type": null, "description": ""}, {"name": "expected_fixture_sql", "type": null, "description": ""}, {"name": "expected_column_names", "type": null, "description": ""}], "created_at": 1789079002.3342268, "supported_languages": null}, "macro.dbt.default__get_unit_test_sql": {"name": "default__get_unit_test_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/tests/helpers.sql", "original_file_path": "macros/materializations/tests/helpers.sql", "unique_id": "macro.dbt.default__get_unit_test_sql", "macro_sql": "{% macro default__get_unit_test_sql(main_sql, expected_fixture_sql, expected_column_names) -%}\n-- Build actual result given inputs\nwith dbt_internal_unit_test_actual as (\n select\n {% for expected_column_name in expected_column_names %}{{expected_column_name}}{% if not loop.last -%},{% endif %}{%- endfor -%}, {{ dbt.string_literal(\"actual\") }} as {{ adapter.quote(\"actual_or_expected\") }}\n from (\n {{ main_sql }}\n ) _dbt_internal_unit_test_actual\n),\n-- Build expected result\ndbt_internal_unit_test_expected as (\n select\n {% for expected_column_name in expected_column_names %}{{expected_column_name}}{% if not loop.last -%}, {% endif %}{%- endfor -%}, {{ dbt.string_literal(\"expected\") }} as {{ adapter.quote(\"actual_or_expected\") }}\n from (\n {{ expected_fixture_sql }}\n ) _dbt_internal_unit_test_expected\n)\n-- Union actual and expected results\nselect * from dbt_internal_unit_test_actual\nunion all\nselect * from dbt_internal_unit_test_expected\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.string_literal"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "main_sql", "type": null, "description": ""}, {"name": "expected_fixture_sql", "type": null, "description": ""}, {"name": "expected_column_names", "type": null, "description": ""}], "created_at": 1789079002.3349123, "supported_languages": null}, "macro.dbt.get_where_subquery": {"name": "get_where_subquery", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/tests/where_subquery.sql", "original_file_path": "macros/materializations/tests/where_subquery.sql", "unique_id": "macro.dbt.get_where_subquery", "macro_sql": "{% macro get_where_subquery(relation) -%}\n {% do return(adapter.dispatch('get_where_subquery', 'dbt')(relation)) %}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_where_subquery"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789079002.3352835, "supported_languages": null}, "macro.dbt.default__get_where_subquery": {"name": "default__get_where_subquery", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/tests/where_subquery.sql", "original_file_path": "macros/materializations/tests/where_subquery.sql", "unique_id": "macro.dbt.default__get_where_subquery", "macro_sql": "{% macro default__get_where_subquery(relation) -%}\n {% set where = config.get('where', '') %}\n {% if where %}\n {%- set filtered -%}\n (select * from {{ relation }} where {{ where }}) dbt_subquery\n {%- endset -%}\n {% do return(filtered) %}\n {%- else -%}\n {% do return(relation) %}\n {%- endif -%}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789079002.3357115, "supported_languages": null}, "macro.dbt.materialization_snapshot_default": {"name": "materialization_snapshot_default", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/snapshot.sql", "original_file_path": "macros/materializations/snapshots/snapshot.sql", "unique_id": "macro.dbt.materialization_snapshot_default", "macro_sql": "{% materialization snapshot, default %}\n\n {%- set target_table = model.get('alias', model.get('name')) -%}\n\n {%- set strategy_name = config.get('strategy') -%}\n {%- set unique_key = config.get('unique_key') %}\n -- grab current tables grants config for comparision later on\n {%- set grant_config = config.get('grants') -%}\n\n {% set target_relation_exists, target_relation = get_or_create_relation(\n database=model.database,\n schema=model.schema,\n identifier=target_table,\n type='table') -%}\n\n {%- if not target_relation.is_table -%}\n {% do exceptions.relation_wrong_type(target_relation, 'table') %}\n {%- endif -%}\n\n\n {{ run_hooks(pre_hooks, inside_transaction=False) }}\n\n {{ run_hooks(pre_hooks, inside_transaction=True) }}\n\n {% set strategy_macro = strategy_dispatch(strategy_name) %}\n {# The model['config'] parameter below is no longer used, but passing anyway for compatibility #}\n {# It was a dictionary of config, instead of the config object from the context #}\n {% set strategy = strategy_macro(model, \"snapshotted_data\", \"source_data\", model['config'], target_relation_exists) %}\n\n {% if not target_relation_exists %}\n\n {% set build_sql = build_snapshot_table(strategy, model['compiled_code']) %}\n {% set build_or_select_sql = build_sql %}\n {% set final_sql = create_table_as(False, target_relation, build_sql) %}\n\n {% else %}\n\n {% set columns = config.get(\"snapshot_table_column_names\") or get_snapshot_table_column_names() %}\n\n {{ adapter.assert_valid_snapshot_target_given_strategy(target_relation, columns, strategy) }}\n\n {% set build_or_select_sql = snapshot_staging_table(strategy, sql, target_relation) %}\n {% set staging_table = build_snapshot_staging_table(strategy, sql, target_relation) %}\n\n -- this may no-op if the database does not require column expansion\n {% do adapter.expand_target_column_types(from_relation=staging_table,\n to_relation=target_relation) %}\n\n {% set remove_columns = ['dbt_change_type', 'DBT_CHANGE_TYPE', 'dbt_unique_key', 'DBT_UNIQUE_KEY'] %}\n {% if unique_key | is_list %}\n {% for key in strategy.unique_key %}\n {{ remove_columns.append('dbt_unique_key_' + loop.index|string) }}\n {{ remove_columns.append('DBT_UNIQUE_KEY_' + loop.index|string) }}\n {% endfor %}\n {% endif %}\n\n {% set missing_columns = adapter.get_missing_columns(staging_table, target_relation)\n | rejectattr('name', 'in', remove_columns)\n | list %}\n\n {% do create_columns(target_relation, missing_columns) %}\n\n {% set source_columns = adapter.get_columns_in_relation(staging_table)\n | rejectattr('name', 'in', remove_columns)\n | list %}\n\n {% set quoted_source_columns = [] %}\n {% for column in source_columns %}\n {% do quoted_source_columns.append(adapter.quote(column.name)) %}\n {% endfor %}\n\n {% set final_sql = snapshot_merge_sql(\n target = target_relation,\n source = staging_table,\n insert_cols = quoted_source_columns\n )\n %}\n\n {% endif %}\n\n\n {{ check_time_data_types(build_or_select_sql) }}\n\n {% call statement('main') %}\n {{ final_sql }}\n {% endcall %}\n\n {% set should_revoke = should_revoke(target_relation_exists, full_refresh_mode=False) %}\n {% do apply_grants(target_relation, grant_config, should_revoke=should_revoke) %}\n\n {% do persist_docs(target_relation, model) %}\n\n {% if not target_relation_exists %}\n {% do create_indexes(target_relation) %}\n {% endif %}\n\n {{ run_hooks(post_hooks, inside_transaction=True) }}\n\n {{ adapter.commit() }}\n\n {% if staging_table is defined %}\n {% do post_snapshot(staging_table) %}\n {% endif %}\n\n {{ run_hooks(post_hooks, inside_transaction=False) }}\n\n {{ return({'relations': [target_relation]}) }}\n\n{% endmaterialization %}", "depends_on": {"macros": ["macro.dbt.get_or_create_relation", "macro.dbt.run_hooks", "macro.dbt.strategy_dispatch", "macro.dbt.build_snapshot_table", "macro.dbt.create_table_as", "macro.dbt.get_snapshot_table_column_names", "macro.dbt.snapshot_staging_table", "macro.dbt.build_snapshot_staging_table", "macro.dbt.create_columns", "macro.dbt.snapshot_merge_sql", "macro.dbt.check_time_data_types", "macro.dbt.statement", "macro.dbt.should_revoke", "macro.dbt.apply_grants", "macro.dbt.persist_docs", "macro.dbt.create_indexes", "macro.dbt.post_snapshot"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "supported_languages", "type": null, "description": ""}], "created_at": 1789079002.3400931, "supported_languages": ["sql"]}, "macro.dbt.strategy_dispatch": {"name": "strategy_dispatch", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/strategies.sql", "original_file_path": "macros/materializations/snapshots/strategies.sql", "unique_id": "macro.dbt.strategy_dispatch", "macro_sql": "{% macro strategy_dispatch(name) -%}\n{% set original_name = name %}\n {% if '.' in name %}\n {% set package_name, name = name.split(\".\", 1) %}\n {% else %}\n {% set package_name = none %}\n {% endif %}\n\n {% if package_name is none %}\n {% set package_context = context %}\n {% elif package_name in context %}\n {% set package_context = context[package_name] %}\n {% else %}\n {% set error_msg %}\n Could not find package '{{package_name}}', called with '{{original_name}}'\n {% endset %}\n {{ exceptions.raise_compiler_error(error_msg | trim) }}\n {% endif %}\n\n {%- set search_name = 'snapshot_' ~ name ~ '_strategy' -%}\n\n {% if search_name not in package_context %}\n {% set error_msg %}\n The specified strategy macro '{{name}}' was not found in package '{{ package_name }}'\n {% endset %}\n {{ exceptions.raise_compiler_error(error_msg | trim) }}\n {% endif %}\n {{ return(package_context[search_name]) }}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "name", "type": null, "description": ""}], "created_at": 1789079002.3424258, "supported_languages": null}, "macro.dbt.snapshot_hash_arguments": {"name": "snapshot_hash_arguments", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/strategies.sql", "original_file_path": "macros/materializations/snapshots/strategies.sql", "unique_id": "macro.dbt.snapshot_hash_arguments", "macro_sql": "{% macro snapshot_hash_arguments(args) -%}\n {{ adapter.dispatch('snapshot_hash_arguments', 'dbt')(args) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__snapshot_hash_arguments"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "args", "type": null, "description": ""}], "created_at": 1789079002.3426273, "supported_languages": null}, "macro.dbt.default__snapshot_hash_arguments": {"name": "default__snapshot_hash_arguments", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/strategies.sql", "original_file_path": "macros/materializations/snapshots/strategies.sql", "unique_id": "macro.dbt.default__snapshot_hash_arguments", "macro_sql": "{% macro default__snapshot_hash_arguments(args) -%}\n md5({%- for arg in args -%}\n coalesce(cast({{ arg }} as varchar ), '')\n {% if not loop.last %} || '|' || {% endif %}\n {%- endfor -%})\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "args", "type": null, "description": ""}], "created_at": 1789079002.3428915, "supported_languages": null}, "macro.dbt.snapshot_timestamp_strategy": {"name": "snapshot_timestamp_strategy", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/strategies.sql", "original_file_path": "macros/materializations/snapshots/strategies.sql", "unique_id": "macro.dbt.snapshot_timestamp_strategy", "macro_sql": "{% macro snapshot_timestamp_strategy(node, snapshotted_rel, current_rel, model_config, target_exists) %}\n {# The model_config parameter is no longer used, but is passed in anyway for compatibility. #}\n {% set primary_key = config.get('unique_key') %}\n {% set updated_at = config.get('updated_at') %}\n {% set hard_deletes = adapter.get_hard_deletes_behavior(config) %}\n {% set invalidate_hard_deletes = hard_deletes == 'invalidate' %}\n {% set columns = config.get(\"snapshot_table_column_names\") or get_snapshot_table_column_names() %}\n\n {#/*\n The snapshot relation might not have an {{ updated_at }} value if the\n snapshot strategy is changed from `check` to `timestamp`. We\n should use a dbt-created column for the comparison in the snapshot\n table instead of assuming that the user-supplied {{ updated_at }}\n will be present in the historical data.\n\n See https://github.com/dbt-labs/dbt-core/issues/2350\n */ #}\n {% set row_changed_expr -%}\n ({{ snapshotted_rel }}.{{ columns.dbt_valid_from }} < {{ current_rel }}.{{ updated_at }})\n {%- endset %}\n\n {% set scd_args = api.Relation.scd_args(primary_key, updated_at) %}\n {% set scd_id_expr = snapshot_hash_arguments(scd_args) %}\n\n {% do return({\n \"unique_key\": primary_key,\n \"updated_at\": updated_at,\n \"row_changed\": row_changed_expr,\n \"scd_id\": scd_id_expr,\n \"invalidate_hard_deletes\": invalidate_hard_deletes,\n \"hard_deletes\": hard_deletes\n }) %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_snapshot_table_column_names", "macro.dbt.snapshot_hash_arguments"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "node", "type": null, "description": ""}, {"name": "snapshotted_rel", "type": null, "description": ""}, {"name": "current_rel", "type": null, "description": ""}, {"name": "model_config", "type": null, "description": ""}, {"name": "target_exists", "type": null, "description": ""}], "created_at": 1789079002.3439653, "supported_languages": null}, "macro.dbt.snapshot_string_as_time": {"name": "snapshot_string_as_time", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/strategies.sql", "original_file_path": "macros/materializations/snapshots/strategies.sql", "unique_id": "macro.dbt.snapshot_string_as_time", "macro_sql": "{% macro snapshot_string_as_time(timestamp) -%}\n {{ adapter.dispatch('snapshot_string_as_time', 'dbt')(timestamp) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__snapshot_string_as_time"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "timestamp", "type": null, "description": ""}], "created_at": 1789079002.344164, "supported_languages": null}, "macro.dbt.default__snapshot_string_as_time": {"name": "default__snapshot_string_as_time", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/strategies.sql", "original_file_path": "macros/materializations/snapshots/strategies.sql", "unique_id": "macro.dbt.default__snapshot_string_as_time", "macro_sql": "{% macro default__snapshot_string_as_time(timestamp) %}\n {% do exceptions.raise_not_implemented(\n 'snapshot_string_as_time macro not implemented for adapter '+adapter.type()\n ) %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "timestamp", "type": null, "description": ""}], "created_at": 1789079002.3443594, "supported_languages": null}, "macro.dbt.snapshot_check_all_get_existing_columns": {"name": "snapshot_check_all_get_existing_columns", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/strategies.sql", "original_file_path": "macros/materializations/snapshots/strategies.sql", "unique_id": "macro.dbt.snapshot_check_all_get_existing_columns", "macro_sql": "{% macro snapshot_check_all_get_existing_columns(node, target_exists, check_cols_config) -%}\n {%- if not target_exists -%}\n {#-- no table yet -> return whatever the query does --#}\n {{ return((false, query_columns)) }}\n {%- endif -%}\n\n {#-- handle any schema changes --#}\n {%- set target_relation = adapter.get_relation(database=node.database, schema=node.schema, identifier=node.alias) -%}\n\n {% if check_cols_config == 'all' %}\n {%- set query_columns = get_columns_in_query(node['compiled_code']) -%}\n\n {% elif check_cols_config is iterable and (check_cols_config | length) > 0 %}\n {#-- query for proper casing/quoting, to support comparison below --#}\n {%- set select_check_cols_from_target -%}\n {#-- N.B. The whitespace below is necessary to avoid edge case issue with comments --#}\n {#-- See: https://github.com/dbt-labs/dbt-core/issues/6781 --#}\n select {{ check_cols_config | join(', ') }} from (\n {{ node['compiled_code'] }}\n ) subq\n {%- endset -%}\n {% set query_columns = get_columns_in_query(select_check_cols_from_target) %}\n\n {% else %}\n {% do exceptions.raise_compiler_error(\"Invalid value for 'check_cols': \" ~ check_cols_config) %}\n {% endif %}\n\n {%- set existing_cols = adapter.get_columns_in_relation(target_relation) | map(attribute = 'name') | list -%}\n {%- set ns = namespace() -%} {#-- handle for-loop scoping with a namespace --#}\n {%- set ns.column_added = false -%}\n\n {%- set intersection = [] -%}\n {%- for col in query_columns -%}\n {%- if col in existing_cols -%}\n {%- do intersection.append(adapter.quote(col)) -%}\n {%- else -%}\n {% set ns.column_added = true %}\n {%- endif -%}\n {%- endfor -%}\n {{ return((ns.column_added, intersection)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.get_columns_in_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "node", "type": null, "description": ""}, {"name": "target_exists", "type": null, "description": ""}, {"name": "check_cols_config", "type": null, "description": ""}], "created_at": 1789079002.3459015, "supported_languages": null}, "macro.dbt.snapshot_check_strategy": {"name": "snapshot_check_strategy", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/strategies.sql", "original_file_path": "macros/materializations/snapshots/strategies.sql", "unique_id": "macro.dbt.snapshot_check_strategy", "macro_sql": "{% macro snapshot_check_strategy(node, snapshotted_rel, current_rel, model_config, target_exists) %}\n {# The model_config parameter is no longer used, but is passed in anyway for compatibility. #}\n {% set check_cols_config = config.get('check_cols') %}\n {% set primary_key = config.get('unique_key') %}\n {% set hard_deletes = adapter.get_hard_deletes_behavior(config) %}\n {% set invalidate_hard_deletes = hard_deletes == 'invalidate' %}\n {% set updated_at = config.get('updated_at') or snapshot_get_time() %}\n\n {% set column_added = false %}\n\n {% set column_added, check_cols = snapshot_check_all_get_existing_columns(node, target_exists, check_cols_config) %}\n\n {%- set row_changed_expr -%}\n (\n {%- if column_added -%}\n {{ get_true_sql() }}\n {%- else -%}\n {%- for col in check_cols -%}\n {{ snapshotted_rel }}.{{ col }} != {{ current_rel }}.{{ col }}\n or\n (\n (({{ snapshotted_rel }}.{{ col }} is null) and not ({{ current_rel }}.{{ col }} is null))\n or\n ((not {{ snapshotted_rel }}.{{ col }} is null) and ({{ current_rel }}.{{ col }} is null))\n )\n {%- if not loop.last %} or {% endif -%}\n {%- endfor -%}\n {%- endif -%}\n )\n {%- endset %}\n\n {% set scd_args = api.Relation.scd_args(primary_key, updated_at) %}\n {% set scd_id_expr = snapshot_hash_arguments(scd_args) %}\n\n {% do return({\n \"unique_key\": primary_key,\n \"updated_at\": updated_at,\n \"row_changed\": row_changed_expr,\n \"scd_id\": scd_id_expr,\n \"invalidate_hard_deletes\": invalidate_hard_deletes,\n \"hard_deletes\": hard_deletes\n }) %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.snapshot_get_time", "macro.dbt.snapshot_check_all_get_existing_columns", "macro.dbt.get_true_sql", "macro.dbt.snapshot_hash_arguments"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "node", "type": null, "description": ""}, {"name": "snapshotted_rel", "type": null, "description": ""}, {"name": "current_rel", "type": null, "description": ""}, {"name": "model_config", "type": null, "description": ""}, {"name": "target_exists", "type": null, "description": ""}], "created_at": 1789079002.3475437, "supported_languages": null}, "macro.dbt.snapshot_merge_sql": {"name": "snapshot_merge_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/snapshot_merge.sql", "original_file_path": "macros/materializations/snapshots/snapshot_merge.sql", "unique_id": "macro.dbt.snapshot_merge_sql", "macro_sql": "{% macro snapshot_merge_sql(target, source, insert_cols) -%}\n {{ adapter.dispatch('snapshot_merge_sql', 'dbt')(target, source, insert_cols) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__snapshot_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "target", "type": null, "description": ""}, {"name": "source", "type": null, "description": ""}, {"name": "insert_cols", "type": null, "description": ""}], "created_at": 1789079002.348046, "supported_languages": null}, "macro.dbt.default__snapshot_merge_sql": {"name": "default__snapshot_merge_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/snapshot_merge.sql", "original_file_path": "macros/materializations/snapshots/snapshot_merge.sql", "unique_id": "macro.dbt.default__snapshot_merge_sql", "macro_sql": "{% macro default__snapshot_merge_sql(target, source, insert_cols) -%}\n {%- set insert_cols_csv = insert_cols | join(', ') -%}\n\n {%- set columns = config.get(\"snapshot_table_column_names\") or get_snapshot_table_column_names() -%}\n\n merge into {{ target.render() }} as DBT_INTERNAL_DEST\n using {{ source }} as DBT_INTERNAL_SOURCE\n on DBT_INTERNAL_SOURCE.{{ columns.dbt_scd_id }} = DBT_INTERNAL_DEST.{{ columns.dbt_scd_id }}\n\n when matched\n {% if config.get(\"dbt_valid_to_current\") %}\n\t{% set source_unique_key = (\"DBT_INTERNAL_DEST.\" ~ columns.dbt_valid_to) | trim %}\n\t{% set target_unique_key = config.get('dbt_valid_to_current') | trim %}\n\tand ({{ equals(source_unique_key, target_unique_key) }} or {{ source_unique_key }} is null)\n\n {% else %}\n and DBT_INTERNAL_DEST.{{ columns.dbt_valid_to }} is null\n {% endif %}\n and DBT_INTERNAL_SOURCE.dbt_change_type in ('update', 'delete')\n then update\n set {{ columns.dbt_valid_to }} = DBT_INTERNAL_SOURCE.{{ columns.dbt_valid_to }}\n\n when not matched\n and DBT_INTERNAL_SOURCE.dbt_change_type = 'insert'\n then insert ({{ insert_cols_csv }})\n values ({{ insert_cols_csv }})\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_snapshot_table_column_names", "macro.dbt.equals"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "target", "type": null, "description": ""}, {"name": "source", "type": null, "description": ""}, {"name": "insert_cols", "type": null, "description": ""}], "created_at": 1789079002.348955, "supported_languages": null}, "macro.dbt.create_columns": {"name": "create_columns", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "unique_id": "macro.dbt.create_columns", "macro_sql": "{% macro create_columns(relation, columns) %}\n {{ adapter.dispatch('create_columns', 'dbt')(relation, columns) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__create_columns"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "columns", "type": null, "description": ""}], "created_at": 1789079002.3512747, "supported_languages": null}, "macro.dbt.default__create_columns": {"name": "default__create_columns", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "unique_id": "macro.dbt.default__create_columns", "macro_sql": "{% macro default__create_columns(relation, columns) %}\n {% for column in columns %}\n {% call statement() %}\n alter table {{ relation.render() }} add column {{ adapter.quote(column.name) }} {{ column.expanded_data_type }};\n {% endcall %}\n {% endfor %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "columns", "type": null, "description": ""}], "created_at": 1789079002.3516555, "supported_languages": null}, "macro.dbt.post_snapshot": {"name": "post_snapshot", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "unique_id": "macro.dbt.post_snapshot", "macro_sql": "{% macro post_snapshot(staging_relation) %}\n {{ adapter.dispatch('post_snapshot', 'dbt')(staging_relation) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__post_snapshot"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "staging_relation", "type": null, "description": ""}], "created_at": 1789079002.3518636, "supported_languages": null}, "macro.dbt.default__post_snapshot": {"name": "default__post_snapshot", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "unique_id": "macro.dbt.default__post_snapshot", "macro_sql": "{% macro default__post_snapshot(staging_relation) %}\n {# no-op #}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "staging_relation", "type": null, "description": ""}], "created_at": 1789079002.3519778, "supported_languages": null}, "macro.dbt.get_true_sql": {"name": "get_true_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "unique_id": "macro.dbt.get_true_sql", "macro_sql": "{% macro get_true_sql() %}\n {{ adapter.dispatch('get_true_sql', 'dbt')() }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_true_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789079002.3521442, "supported_languages": null}, "macro.dbt.default__get_true_sql": {"name": "default__get_true_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "unique_id": "macro.dbt.default__get_true_sql", "macro_sql": "{% macro default__get_true_sql() %}\n {{ return('TRUE') }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789079002.3522823, "supported_languages": null}, "macro.dbt.snapshot_staging_table": {"name": "snapshot_staging_table", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "unique_id": "macro.dbt.snapshot_staging_table", "macro_sql": "{% macro snapshot_staging_table(strategy, source_sql, target_relation) -%}\n {{ adapter.dispatch('snapshot_staging_table', 'dbt')(strategy, source_sql, target_relation) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__snapshot_staging_table"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "strategy", "type": null, "description": ""}, {"name": "source_sql", "type": null, "description": ""}, {"name": "target_relation", "type": null, "description": ""}], "created_at": 1789079002.3525074, "supported_languages": null}, "macro.dbt.get_snapshot_table_column_names": {"name": "get_snapshot_table_column_names", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "unique_id": "macro.dbt.get_snapshot_table_column_names", "macro_sql": "{% macro get_snapshot_table_column_names() %}\n {{ return({'dbt_valid_to': 'dbt_valid_to', 'dbt_valid_from': 'dbt_valid_from', 'dbt_scd_id': 'dbt_scd_id', 'dbt_updated_at': 'dbt_updated_at', 'dbt_is_deleted': 'dbt_is_deleted'}) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789079002.3527787, "supported_languages": null}, "macro.dbt.default__snapshot_staging_table": {"name": "default__snapshot_staging_table", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "unique_id": "macro.dbt.default__snapshot_staging_table", "macro_sql": "{% macro default__snapshot_staging_table(strategy, source_sql, target_relation) -%}\n {% set columns = config.get('snapshot_table_column_names') or get_snapshot_table_column_names() %}\n {% if strategy.hard_deletes == 'new_record' %}\n {% set new_scd_id = snapshot_hash_arguments([columns.dbt_scd_id, snapshot_get_time()]) %}\n {% endif %}\n with snapshot_query as (\n\n {{ source_sql }}\n\n ),\n\n snapshotted_data as (\n\n select *, {{ unique_key_fields(strategy.unique_key) }}\n from {{ target_relation }}\n where\n {% if config.get('dbt_valid_to_current') %}\n\t\t{% set source_unique_key = columns.dbt_valid_to | trim %}\n\t\t{% set target_unique_key = config.get('dbt_valid_to_current') | trim %}\n\n\t\t{# The exact equals semantics between NULL values depends on the current behavior flag set. Also, update records if the source field is null #}\n ( {{ equals(source_unique_key, target_unique_key) }} or {{ source_unique_key }} is null )\n {% else %}\n {{ columns.dbt_valid_to }} is null\n {% endif %}\n\n ),\n\n insertions_source_data as (\n\n select *, {{ unique_key_fields(strategy.unique_key) }},\n {{ strategy.updated_at }} as {{ columns.dbt_updated_at }},\n {{ strategy.updated_at }} as {{ columns.dbt_valid_from }},\n {{ get_dbt_valid_to_current(strategy, columns) }},\n {{ strategy.scd_id }} as {{ columns.dbt_scd_id }}\n\n from snapshot_query\n ),\n\n updates_source_data as (\n\n select *, {{ unique_key_fields(strategy.unique_key) }},\n {{ strategy.updated_at }} as {{ columns.dbt_updated_at }},\n {{ strategy.updated_at }} as {{ columns.dbt_valid_from }},\n {{ strategy.updated_at }} as {{ columns.dbt_valid_to }}\n\n from snapshot_query\n ),\n\n {%- if strategy.hard_deletes == 'invalidate' or strategy.hard_deletes == 'new_record' %}\n\n deletes_source_data as (\n\n select *, {{ unique_key_fields(strategy.unique_key) }}\n from snapshot_query\n ),\n {% endif %}\n\n insertions as (\n\n select\n 'insert' as dbt_change_type,\n source_data.*\n {%- if strategy.hard_deletes == 'new_record' -%}\n ,'False' as {{ columns.dbt_is_deleted }}\n {%- endif %}\n\n from insertions_source_data as source_data\n left outer join snapshotted_data\n on {{ unique_key_join_on(strategy.unique_key, \"snapshotted_data\", \"source_data\") }}\n where {{ unique_key_is_null(strategy.unique_key, \"snapshotted_data\") }}\n or ({{ unique_key_is_not_null(strategy.unique_key, \"snapshotted_data\") }} and (\n {{ strategy.row_changed }} {%- if strategy.hard_deletes == 'new_record' -%} or snapshotted_data.{{ columns.dbt_is_deleted }} = 'True' {% endif %}\n )\n\n )\n\n ),\n\n updates as (\n\n select\n 'update' as dbt_change_type,\n source_data.*,\n snapshotted_data.{{ columns.dbt_scd_id }}\n {%- if strategy.hard_deletes == 'new_record' -%}\n , snapshotted_data.{{ columns.dbt_is_deleted }}\n {%- endif %}\n\n from updates_source_data as source_data\n join snapshotted_data\n on {{ unique_key_join_on(strategy.unique_key, \"snapshotted_data\", \"source_data\") }}\n where (\n {{ strategy.row_changed }} {%- if strategy.hard_deletes == 'new_record' -%} or snapshotted_data.{{ columns.dbt_is_deleted }} = 'True' {% endif %}\n )\n )\n\n {%- if strategy.hard_deletes == 'invalidate' or strategy.hard_deletes == 'new_record' %}\n ,\n deletes as (\n\n select\n 'delete' as dbt_change_type,\n source_data.*,\n {{ snapshot_get_time() }} as {{ columns.dbt_valid_from }},\n {{ snapshot_get_time() }} as {{ columns.dbt_updated_at }},\n {{ snapshot_get_time() }} as {{ columns.dbt_valid_to }},\n snapshotted_data.{{ columns.dbt_scd_id }}\n {%- if strategy.hard_deletes == 'new_record' -%}\n , snapshotted_data.{{ columns.dbt_is_deleted }}\n {%- endif %}\n from snapshotted_data\n left join deletes_source_data as source_data\n on {{ unique_key_join_on(strategy.unique_key, \"snapshotted_data\", \"source_data\") }}\n where {{ unique_key_is_null(strategy.unique_key, \"source_data\") }}\n\n {%- if strategy.hard_deletes == 'new_record' %}\n and not (\n --avoid updating the record's valid_to if the latest entry is marked as deleted\n snapshotted_data.{{ columns.dbt_is_deleted }} = 'True'\n and\n {% if config.get('dbt_valid_to_current') -%}\n snapshotted_data.{{ columns.dbt_valid_to }} = {{ config.get('dbt_valid_to_current') }}\n {%- else -%}\n snapshotted_data.{{ columns.dbt_valid_to }} is null\n {%- endif %}\n )\n {%- endif %}\n )\n {%- endif %}\n\n {%- if strategy.hard_deletes == 'new_record' %}\n {% set snapshotted_cols = get_list_of_column_names(get_columns_in_relation(target_relation)) %}\n {% set source_col_names = get_columns_in_query(source_sql) %}\n ,\n deletion_records as (\n\n select\n 'insert' as dbt_change_type,\n {%- for col_name in source_col_names -%}\n {%- if col_name in snapshotted_cols -%}\n snapshotted_data.{{ adapter.quote(col_name) }},\n {%- else -%}\n source_data.{{ adapter.quote(col_name) }},\n {%- endif -%}\n {% endfor -%}\n {%- if strategy.unique_key | is_list -%}\n {%- for key in strategy.unique_key -%}\n snapshotted_data.{{ key }} as dbt_unique_key_{{ loop.index }},\n {% endfor -%}\n {%- else -%}\n snapshotted_data.dbt_unique_key as dbt_unique_key,\n {% endif -%}\n {{ snapshot_get_time() }} as {{ columns.dbt_valid_from }},\n {{ snapshot_get_time() }} as {{ columns.dbt_updated_at }},\n snapshotted_data.{{ columns.dbt_valid_to }} as {{ columns.dbt_valid_to }},\n {{ new_scd_id }} as {{ columns.dbt_scd_id }},\n 'True' as {{ columns.dbt_is_deleted }}\n from snapshotted_data\n left join deletes_source_data as source_data\n on {{ unique_key_join_on(strategy.unique_key, \"snapshotted_data\", \"source_data\") }}\n where {{ unique_key_is_null(strategy.unique_key, \"source_data\") }}\n and not (\n --avoid inserting a new record if the latest one is marked as deleted\n snapshotted_data.{{ columns.dbt_is_deleted }} = 'True'\n and\n {% if config.get('dbt_valid_to_current') -%}\n snapshotted_data.{{ columns.dbt_valid_to }} = {{ config.get('dbt_valid_to_current') }}\n {%- else -%}\n snapshotted_data.{{ columns.dbt_valid_to }} is null\n {%- endif %}\n )\n\n )\n {%- endif %}\n\n select * from insertions\n union all\n select * from updates\n {%- if strategy.hard_deletes == 'invalidate' or strategy.hard_deletes == 'new_record' %}\n union all\n select * from deletes\n {%- endif %}\n {%- if strategy.hard_deletes == 'new_record' %}\n union all\n select * from deletion_records\n {%- endif %}\n\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.get_snapshot_table_column_names", "macro.dbt.snapshot_hash_arguments", "macro.dbt.snapshot_get_time", "macro.dbt.unique_key_fields", "macro.dbt.equals", "macro.dbt.get_dbt_valid_to_current", "macro.dbt.unique_key_join_on", "macro.dbt.unique_key_is_null", "macro.dbt.unique_key_is_not_null", "macro.dbt.get_list_of_column_names", "macro.dbt.get_columns_in_relation", "macro.dbt.get_columns_in_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "strategy", "type": null, "description": ""}, {"name": "source_sql", "type": null, "description": ""}, {"name": "target_relation", "type": null, "description": ""}], "created_at": 1789079002.3576024, "supported_languages": null}, "macro.dbt.build_snapshot_table": {"name": "build_snapshot_table", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "unique_id": "macro.dbt.build_snapshot_table", "macro_sql": "{% macro build_snapshot_table(strategy, sql) -%}\n {{ adapter.dispatch('build_snapshot_table', 'dbt')(strategy, sql) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__build_snapshot_table"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "strategy", "type": null, "description": ""}, {"name": "sql", "type": null, "description": ""}], "created_at": 1789079002.357863, "supported_languages": null}, "macro.dbt.default__build_snapshot_table": {"name": "default__build_snapshot_table", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "unique_id": "macro.dbt.default__build_snapshot_table", "macro_sql": "{% macro default__build_snapshot_table(strategy, sql) %}\n {% set columns = config.get('snapshot_table_column_names') or get_snapshot_table_column_names() %}\n\n select *,\n {{ strategy.scd_id }} as {{ columns.dbt_scd_id }},\n {{ strategy.updated_at }} as {{ columns.dbt_updated_at }},\n {{ strategy.updated_at }} as {{ columns.dbt_valid_from }},\n {{ get_dbt_valid_to_current(strategy, columns) }}\n {%- if strategy.hard_deletes == 'new_record' -%}\n , 'False' as {{ columns.dbt_is_deleted }}\n {% endif -%}\n from (\n {{ sql }}\n ) sbq\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_snapshot_table_column_names", "macro.dbt.get_dbt_valid_to_current"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "strategy", "type": null, "description": ""}, {"name": "sql", "type": null, "description": ""}], "created_at": 1789079002.3584268, "supported_languages": null}, "macro.dbt.build_snapshot_staging_table": {"name": "build_snapshot_staging_table", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "unique_id": "macro.dbt.build_snapshot_staging_table", "macro_sql": "{% macro build_snapshot_staging_table(strategy, sql, target_relation) %}\n {% set temp_relation = make_temp_relation(target_relation) %}\n\n {% set select = snapshot_staging_table(strategy, sql, target_relation) %}\n\n {% call statement('build_snapshot_staging_relation') %}\n {{ create_table_as(True, temp_relation, select) }}\n {% endcall %}\n\n {% do return(temp_relation) %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.make_temp_relation", "macro.dbt.snapshot_staging_table", "macro.dbt.statement", "macro.dbt.create_table_as"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "strategy", "type": null, "description": ""}, {"name": "sql", "type": null, "description": ""}, {"name": "target_relation", "type": null, "description": ""}], "created_at": 1789079002.358916, "supported_languages": null}, "macro.dbt.get_updated_at_column_data_type": {"name": "get_updated_at_column_data_type", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "unique_id": "macro.dbt.get_updated_at_column_data_type", "macro_sql": "{% macro get_updated_at_column_data_type(snapshot_sql) %}\n {% set snapshot_sql_column_schema = get_column_schema_from_query(snapshot_sql) %}\n {% set dbt_updated_at_data_type = null %}\n {% set ns = namespace() -%} {#-- handle for-loop scoping with a namespace --#}\n {% set ns.dbt_updated_at_data_type = null -%}\n {% for column in snapshot_sql_column_schema %}\n {% if ((column.column == 'dbt_updated_at') or (column.column == 'DBT_UPDATED_AT')) %}\n {% set ns.dbt_updated_at_data_type = column.dtype %}\n {% endif %}\n {% endfor %}\n {{ return(ns.dbt_updated_at_data_type or none) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_column_schema_from_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "snapshot_sql", "type": null, "description": ""}], "created_at": 1789079002.3595746, "supported_languages": null}, "macro.dbt.check_time_data_types": {"name": "check_time_data_types", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "unique_id": "macro.dbt.check_time_data_types", "macro_sql": "{% macro check_time_data_types(sql) %}\n {% set dbt_updated_at_data_type = get_updated_at_column_data_type(sql) %}\n {% set snapshot_get_time_data_type = get_snapshot_get_time_data_type() %}\n {% if snapshot_get_time_data_type is not none and dbt_updated_at_data_type is not none and snapshot_get_time_data_type != dbt_updated_at_data_type %}\n {% if exceptions.warn_snapshot_timestamp_data_types %}\n {{ exceptions.warn_snapshot_timestamp_data_types(snapshot_get_time_data_type, dbt_updated_at_data_type) }}\n {% endif %}\n {% endif %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_updated_at_column_data_type", "macro.dbt.get_snapshot_get_time_data_type"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "sql", "type": null, "description": ""}], "created_at": 1789079002.360061, "supported_languages": null}, "macro.dbt.get_dbt_valid_to_current": {"name": "get_dbt_valid_to_current", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "unique_id": "macro.dbt.get_dbt_valid_to_current", "macro_sql": "{% macro get_dbt_valid_to_current(strategy, columns) %}\n {% set dbt_valid_to_current = config.get('dbt_valid_to_current') or \"null\" %}\n coalesce(nullif({{ strategy.updated_at }}, {{ strategy.updated_at }}), {{dbt_valid_to_current}})\n as {{ columns.dbt_valid_to }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "strategy", "type": null, "description": ""}, {"name": "columns", "type": null, "description": ""}], "created_at": 1789079002.3603709, "supported_languages": null}, "macro.dbt.unique_key_fields": {"name": "unique_key_fields", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "unique_id": "macro.dbt.unique_key_fields", "macro_sql": "{% macro unique_key_fields(unique_key) %}\n {% if unique_key | is_list %}\n {% for key in unique_key %}\n {{ key }} as dbt_unique_key_{{ loop.index }}\n {%- if not loop.last %} , {%- endif %}\n {% endfor %}\n {% else %}\n {{ unique_key }} as dbt_unique_key\n {% endif %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "unique_key", "type": null, "description": ""}], "created_at": 1789079002.3607528, "supported_languages": null}, "macro.dbt.unique_key_join_on": {"name": "unique_key_join_on", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "unique_id": "macro.dbt.unique_key_join_on", "macro_sql": "{% macro unique_key_join_on(unique_key, identifier, from_identifier) %}\n {% if unique_key | is_list %}\n {% for key in unique_key %}\n\t {% set source_unique_key = (identifier ~ \".dbt_unique_key_\" ~ loop.index) | trim %}\n\t {% set target_unique_key = (from_identifier ~ \".dbt_unique_key_\" ~ loop.index) | trim %}\n\t {{ equals(source_unique_key, target_unique_key) }}\n {%- if not loop.last %} and {%- endif %}\n {% endfor %}\n {% else %}\n {{ identifier }}.dbt_unique_key = {{ from_identifier }}.dbt_unique_key\n {% endif %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.equals"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "unique_key", "type": null, "description": ""}, {"name": "identifier", "type": null, "description": ""}, {"name": "from_identifier", "type": null, "description": ""}], "created_at": 1789079002.3614004, "supported_languages": null}, "macro.dbt.unique_key_is_null": {"name": "unique_key_is_null", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "unique_id": "macro.dbt.unique_key_is_null", "macro_sql": "{% macro unique_key_is_null(unique_key, identifier) %}\n {% if unique_key | is_list %}\n {{ identifier }}.dbt_unique_key_1 is null\n {% else %}\n {{ identifier }}.dbt_unique_key is null\n {% endif %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "unique_key", "type": null, "description": ""}, {"name": "identifier", "type": null, "description": ""}], "created_at": 1789079002.3616514, "supported_languages": null}, "macro.dbt.unique_key_is_not_null": {"name": "unique_key_is_not_null", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "unique_id": "macro.dbt.unique_key_is_not_null", "macro_sql": "{% macro unique_key_is_not_null(unique_key, identifier) %}\n {% if unique_key | is_list %}\n {{ identifier }}.dbt_unique_key_1 is not null\n {% else %}\n {{ identifier }}.dbt_unique_key is not null\n {% endif %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "unique_key", "type": null, "description": ""}, {"name": "identifier", "type": null, "description": ""}], "created_at": 1789079002.3619041, "supported_languages": null}, "macro.dbt.get_aggregate_function_create_replace_signature": {"name": "get_aggregate_function_create_replace_signature", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/functions/aggregate.sql", "original_file_path": "macros/materializations/functions/aggregate.sql", "unique_id": "macro.dbt.get_aggregate_function_create_replace_signature", "macro_sql": "{% macro get_aggregate_function_create_replace_signature(target_relation) %}\n {{ return(adapter.dispatch('get_aggregate_function_create_replace_signature', 'dbt')(target_relation)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_aggregate_function_create_replace_signature"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "target_relation", "type": null, "description": ""}], "created_at": 1789079002.3626397, "supported_languages": null}, "macro.dbt.default__get_aggregate_function_create_replace_signature": {"name": "default__get_aggregate_function_create_replace_signature", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/functions/aggregate.sql", "original_file_path": "macros/materializations/functions/aggregate.sql", "unique_id": "macro.dbt.default__get_aggregate_function_create_replace_signature", "macro_sql": "{% macro default__get_aggregate_function_create_replace_signature(target_relation) %}\n CREATE OR REPLACE AGGREGATE FUNCTION {{ target_relation.render() }} ({{ get_formatted_aggregate_function_args()}})\n RETURNS {{ model.returns.data_type }}\n {{ get_function_language_specifier() }}\n {{ get_aggregate_function_volatility_specifier() }}\n {% if model.get('language') == 'python' %}\n {{ get_function_python_options() }}\n {% endif %}\n AS\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_formatted_aggregate_function_args", "macro.dbt.get_function_language_specifier", "macro.dbt.get_aggregate_function_volatility_specifier", "macro.dbt.get_function_python_options"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "target_relation", "type": null, "description": ""}], "created_at": 1789079002.36306, "supported_languages": null}, "macro.dbt.get_formatted_aggregate_function_args": {"name": "get_formatted_aggregate_function_args", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/functions/aggregate.sql", "original_file_path": "macros/materializations/functions/aggregate.sql", "unique_id": "macro.dbt.get_formatted_aggregate_function_args", "macro_sql": "{% macro get_formatted_aggregate_function_args() %}\n {{ return(adapter.dispatch('get_formatted_aggregate_function_args', 'dbt')()) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_formatted_aggregate_function_args"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789079002.3632562, "supported_languages": null}, "macro.dbt.default__get_formatted_aggregate_function_args": {"name": "default__get_formatted_aggregate_function_args", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/functions/aggregate.sql", "original_file_path": "macros/materializations/functions/aggregate.sql", "unique_id": "macro.dbt.default__get_formatted_aggregate_function_args", "macro_sql": "{% macro default__get_formatted_aggregate_function_args() %}\n {# conveniently we can reuse the sql scalar function args #}\n {{ formatted_scalar_function_args_sql() }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.formatted_scalar_function_args_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789079002.3633945, "supported_languages": null}, "macro.dbt.get_function_language_specifier": {"name": "get_function_language_specifier", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/functions/aggregate.sql", "original_file_path": "macros/materializations/functions/aggregate.sql", "unique_id": "macro.dbt.get_function_language_specifier", "macro_sql": "{% macro get_function_language_specifier() %}\n {{ return(adapter.dispatch('get_function_language_specifier', 'dbt')()) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_function_language_specifier"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789079002.3635805, "supported_languages": null}, "macro.dbt.default__get_function_language_specifier": {"name": "default__get_function_language_specifier", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/functions/aggregate.sql", "original_file_path": "macros/materializations/functions/aggregate.sql", "unique_id": "macro.dbt.default__get_function_language_specifier", "macro_sql": "{% macro default__get_function_language_specifier() %}\n {% set language = model.get('language') %}\n {% if language == 'sql' %}\n {# generally you dont need to specify the language for sql functions #}\n {% elif language == 'python' %}\n LANGUAGE PYTHON\n {% elif language == 'javascript' %}\n LANGUAGE js\n {% else %}\n {{ 'LANGUAGE ' ~ language.upper() }}\n {% endif %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789079002.3642616, "supported_languages": null}, "macro.dbt.get_aggregate_function_volatility_specifier": {"name": "get_aggregate_function_volatility_specifier", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/functions/aggregate.sql", "original_file_path": "macros/materializations/functions/aggregate.sql", "unique_id": "macro.dbt.get_aggregate_function_volatility_specifier", "macro_sql": "{% macro get_aggregate_function_volatility_specifier() %}\n {{ return(adapter.dispatch('get_aggregate_function_volatility_specifier', 'dbt')()) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_aggregate_function_volatility_specifier"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789079002.3644545, "supported_languages": null}, "macro.dbt.default__get_aggregate_function_volatility_specifier": {"name": "default__get_aggregate_function_volatility_specifier", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/functions/aggregate.sql", "original_file_path": "macros/materializations/functions/aggregate.sql", "unique_id": "macro.dbt.default__get_aggregate_function_volatility_specifier", "macro_sql": "{% macro default__get_aggregate_function_volatility_specifier() %}\n {{ scalar_function_volatility_sql() }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.scalar_function_volatility_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789079002.3645809, "supported_languages": null}, "macro.dbt.get_function_python_options": {"name": "get_function_python_options", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/functions/aggregate.sql", "original_file_path": "macros/materializations/functions/aggregate.sql", "unique_id": "macro.dbt.get_function_python_options", "macro_sql": "{% macro get_function_python_options() %}\n {{ return(adapter.dispatch('get_function_python_options', 'dbt')()) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_function_python_options"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789079002.3647623, "supported_languages": null}, "macro.dbt.default__get_function_python_options": {"name": "default__get_function_python_options", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/functions/aggregate.sql", "original_file_path": "macros/materializations/functions/aggregate.sql", "unique_id": "macro.dbt.default__get_function_python_options", "macro_sql": "{% macro default__get_function_python_options() %}\n RUNTIME_VERSION = '{{ model.config.get('runtime_version') }}'\n HANDLER = '{{ model.config.get('entry_point') }}'\n {% set packages = model.config.get('packages', []) %}\n {% if packages %}\n PACKAGES = ('{{ packages | join(\"','\") }}')\n {% endif %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789079002.3651896, "supported_languages": null}, "macro.dbt.scalar_function_sql": {"name": "scalar_function_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/functions/scalar.sql", "original_file_path": "macros/materializations/functions/scalar.sql", "unique_id": "macro.dbt.scalar_function_sql", "macro_sql": "{% macro scalar_function_sql(target_relation) %}\n {{ return(adapter.dispatch('scalar_function_sql', 'dbt')(target_relation)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__scalar_function_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "target_relation", "type": null, "description": ""}], "created_at": 1789079002.366085, "supported_languages": null}, "macro.dbt.default__scalar_function_sql": {"name": "default__scalar_function_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/functions/scalar.sql", "original_file_path": "macros/materializations/functions/scalar.sql", "unique_id": "macro.dbt.default__scalar_function_sql", "macro_sql": "{% macro default__scalar_function_sql(target_relation) %}\n {{ scalar_function_create_replace_signature_sql(target_relation) }}\n {{ scalar_function_body_sql() }};\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.scalar_function_create_replace_signature_sql", "macro.dbt.scalar_function_body_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "target_relation", "type": null, "description": ""}], "created_at": 1789079002.3662713, "supported_languages": null}, "macro.dbt.scalar_function_create_replace_signature_sql": {"name": "scalar_function_create_replace_signature_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/functions/scalar.sql", "original_file_path": "macros/materializations/functions/scalar.sql", "unique_id": "macro.dbt.scalar_function_create_replace_signature_sql", "macro_sql": "{% macro scalar_function_create_replace_signature_sql(target_relation) %}\n {{ return(adapter.dispatch('scalar_function_create_replace_signature_sql', 'dbt')(target_relation)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__scalar_function_create_replace_signature_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "target_relation", "type": null, "description": ""}], "created_at": 1789079002.3664813, "supported_languages": null}, "macro.dbt.default__scalar_function_create_replace_signature_sql": {"name": "default__scalar_function_create_replace_signature_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/functions/scalar.sql", "original_file_path": "macros/materializations/functions/scalar.sql", "unique_id": "macro.dbt.default__scalar_function_create_replace_signature_sql", "macro_sql": "{% macro default__scalar_function_create_replace_signature_sql(target_relation) %}\n CREATE OR REPLACE FUNCTION {{ target_relation.render() }} ({{ formatted_scalar_function_args_sql()}})\n RETURNS {{ model.returns.data_type }}\n {{ scalar_function_volatility_sql() }}\n AS\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.formatted_scalar_function_args_sql", "macro.dbt.scalar_function_volatility_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "target_relation", "type": null, "description": ""}], "created_at": 1789079002.3667233, "supported_languages": null}, "macro.dbt.formatted_scalar_function_args_sql": {"name": "formatted_scalar_function_args_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/functions/scalar.sql", "original_file_path": "macros/materializations/functions/scalar.sql", "unique_id": "macro.dbt.formatted_scalar_function_args_sql", "macro_sql": "{% macro formatted_scalar_function_args_sql() %}\n {{ return(adapter.dispatch('formatted_scalar_function_args_sql', 'dbt')()) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__formatted_scalar_function_args_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789079002.3669243, "supported_languages": null}, "macro.dbt.formatted_scalar_function_args_javascript": {"name": "formatted_scalar_function_args_javascript", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/functions/scalar.sql", "original_file_path": "macros/materializations/functions/scalar.sql", "unique_id": "macro.dbt.formatted_scalar_function_args_javascript", "macro_sql": "{% macro formatted_scalar_function_args_javascript() %}\n {{ return(adapter.dispatch('formatted_scalar_function_args_javascript', 'dbt')()) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__formatted_scalar_function_args_javascript"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789079002.367109, "supported_languages": null}, "macro.dbt.default__formatted_scalar_function_args_sql": {"name": "default__formatted_scalar_function_args_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/functions/scalar.sql", "original_file_path": "macros/materializations/functions/scalar.sql", "unique_id": "macro.dbt.default__formatted_scalar_function_args_sql", "macro_sql": "{% macro default__formatted_scalar_function_args_sql() %}\n {% set args = [] %}\n {% for arg in model.arguments -%}\n {%- do args.append(arg.name ~ ' ' ~ arg.data_type) -%}\n {%- endfor %}\n {{ args | join(', ') }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789079002.367479, "supported_languages": null}, "macro.dbt.default__formatted_scalar_function_args_javascript": {"name": "default__formatted_scalar_function_args_javascript", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/functions/scalar.sql", "original_file_path": "macros/materializations/functions/scalar.sql", "unique_id": "macro.dbt.default__formatted_scalar_function_args_javascript", "macro_sql": "{% macro default__formatted_scalar_function_args_javascript() %}\n {% set msg = \"formatted_scalar_function_args_javascript not implemented for adapter \" ~ adapter.type() %}\n {% do exceptions.raise_compiler_error(msg) %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789079002.367712, "supported_languages": null}, "macro.dbt.scalar_function_body_sql": {"name": "scalar_function_body_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/functions/scalar.sql", "original_file_path": "macros/materializations/functions/scalar.sql", "unique_id": "macro.dbt.scalar_function_body_sql", "macro_sql": "{% macro scalar_function_body_sql() %}\n {{ return(adapter.dispatch('scalar_function_body_sql', 'dbt')()) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__scalar_function_body_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789079002.3679092, "supported_languages": null}, "macro.dbt.default__scalar_function_body_sql": {"name": "default__scalar_function_body_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/functions/scalar.sql", "original_file_path": "macros/materializations/functions/scalar.sql", "unique_id": "macro.dbt.default__scalar_function_body_sql", "macro_sql": "{% macro default__scalar_function_body_sql() %}\n $$\n {{ model.compiled_code }}\n $$ LANGUAGE SQL\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789079002.368032, "supported_languages": null}, "macro.dbt.scalar_function_volatility_sql": {"name": "scalar_function_volatility_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/functions/scalar.sql", "original_file_path": "macros/materializations/functions/scalar.sql", "unique_id": "macro.dbt.scalar_function_volatility_sql", "macro_sql": "{% macro scalar_function_volatility_sql() %}\n {{ return(adapter.dispatch('scalar_function_volatility_sql', 'dbt')()) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__scalar_function_volatility_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789079002.3682153, "supported_languages": null}, "macro.dbt.scalar_function_volatility_javascript": {"name": "scalar_function_volatility_javascript", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/functions/scalar.sql", "original_file_path": "macros/materializations/functions/scalar.sql", "unique_id": "macro.dbt.scalar_function_volatility_javascript", "macro_sql": "{% macro scalar_function_volatility_javascript() %}\n {{ return(adapter.dispatch('scalar_function_volatility_javascript', 'dbt')()) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__scalar_function_volatility_javascript"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789079002.3683994, "supported_languages": null}, "macro.dbt.default__scalar_function_volatility_javascript": {"name": "default__scalar_function_volatility_javascript", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/functions/scalar.sql", "original_file_path": "macros/materializations/functions/scalar.sql", "unique_id": "macro.dbt.default__scalar_function_volatility_javascript", "macro_sql": "{% macro default__scalar_function_volatility_javascript() %}\n {% set volatility = model.config.get('volatility') %}\n {% if volatility != none %}\n {% set msg = \"Volatility is not supported by \" ~ adapter.type() ~ \" in javascript UDF and will be ignored\" %}\n {% do exceptions.warn(msg) %}\n {% endif %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789079002.4130635, "supported_languages": null}, "macro.dbt.default__scalar_function_volatility_sql": {"name": "default__scalar_function_volatility_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/functions/scalar.sql", "original_file_path": "macros/materializations/functions/scalar.sql", "unique_id": "macro.dbt.default__scalar_function_volatility_sql", "macro_sql": "{% macro default__scalar_function_volatility_sql() %}\n {% set volatility = model.config.get('volatility') %}\n {% if volatility == 'deterministic' %}\n IMMUTABLE\n {% elif volatility == 'stable' %}\n STABLE\n {% elif volatility == 'non-deterministic' %}\n VOLATILE\n {% elif volatility != none %}\n {# This shouldn't happen unless a new volatility is invented #}\n {% do unsupported_volatility_warning(volatility) %}\n {% endif %}\n {# If no volatility is set, don't add anything and let the data warehouse default it #}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.unsupported_volatility_warning"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789079002.4136775, "supported_languages": null}, "macro.dbt.unsupported_volatility_warning": {"name": "unsupported_volatility_warning", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/functions/scalar.sql", "original_file_path": "macros/materializations/functions/scalar.sql", "unique_id": "macro.dbt.unsupported_volatility_warning", "macro_sql": "{% macro unsupported_volatility_warning(volatility) %}\n {{ return(adapter.dispatch('unsupported_volatility_warning', 'dbt')(volatility)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__unsupported_volatility_warning"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "volatility", "type": null, "description": ""}], "created_at": 1789079002.4139616, "supported_languages": null}, "macro.dbt.default__unsupported_volatility_warning": {"name": "default__unsupported_volatility_warning", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/functions/scalar.sql", "original_file_path": "macros/materializations/functions/scalar.sql", "unique_id": "macro.dbt.default__unsupported_volatility_warning", "macro_sql": "{% macro default__unsupported_volatility_warning(volatility) %}\n {% set msg = \"Found `\" ~ volatility ~ \"` volatility specified on function `\" ~ model.name ~ \"`. This volatility is not supported by \" ~ adapter.type() ~ \", and will be ignored\" %}\n {% do exceptions.warn(msg) %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "volatility", "type": null, "description": ""}], "created_at": 1789079002.4143333, "supported_languages": null}, "macro.dbt.materialization_function_default": {"name": "materialization_function_default", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/functions/function.sql", "original_file_path": "macros/materializations/functions/function.sql", "unique_id": "macro.dbt.materialization_function_default", "macro_sql": "{% materialization function, default, supported_languages=['sql', 'python', 'javascript'] %}\n {% set existing_relation = load_cached_relation(this) %}\n {% set target_relation = this.incorporate(type=this.Function) %}\n\n {{ run_hooks(pre_hooks) }}\n\n {% set function_config = this.get_function_config(model) %}\n {% set macro_name = this.get_function_macro_name(function_config) %}\n\n {# Doing this aliasing of adapter.dispatch is a hacky way to disable the static analysis of actually calling adapter.dispatch #}\n {# This is necessary because the static analysis breaks being able to dynamically pass a macro_name #}\n {% set _dispatch = adapter.dispatch %}\n\n {% set build_sql = _dispatch(macro_name, 'dbt')(target_relation) %}\n {{ function_execute_build_sql(build_sql, existing_relation, target_relation) }}\n {{ run_hooks(post_hooks) }}\n\n {{ return({'relations': [target_relation]}) }}\n\n{% endmaterialization %}", "depends_on": {"macros": ["macro.dbt.load_cached_relation", "macro.dbt.run_hooks", "macro.dbt.function_execute_build_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "supported_languages", "type": null, "description": ""}], "created_at": 1789079002.4155967, "supported_languages": ["sql", "python", "javascript"]}, "macro.dbt.function_execute_build_sql": {"name": "function_execute_build_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/functions/helpers.sql", "original_file_path": "macros/materializations/functions/helpers.sql", "unique_id": "macro.dbt.function_execute_build_sql", "macro_sql": "{% macro function_execute_build_sql(build_sql, existing_relation, target_relation) %}\n {{ return(adapter.dispatch('function_execute_build_sql', 'dbt')(build_sql, existing_relation, target_relation)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__function_execute_build_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "build_sql", "type": null, "description": ""}, {"name": "existing_relation", "type": null, "description": ""}, {"name": "target_relation", "type": null, "description": ""}], "created_at": 1789079002.4161081, "supported_languages": null}, "macro.dbt.default__function_execute_build_sql": {"name": "default__function_execute_build_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/functions/helpers.sql", "original_file_path": "macros/materializations/functions/helpers.sql", "unique_id": "macro.dbt.default__function_execute_build_sql", "macro_sql": "{% macro default__function_execute_build_sql(build_sql, existing_relation, target_relation) %}\n\n {% set grant_config = config.get('grants') %}\n\n {% call statement(name=\"main\") %}\n {{ build_sql }}\n {% endcall %}\n\n {% set should_revoke = should_revoke(existing_relation, full_refresh_mode=True) %}\n {% do apply_grants(target_relation, grant_config, should_revoke=should_revoke) %}\n\n {% do persist_docs(target_relation, model) %}\n\n {{ adapter.commit() }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement", "macro.dbt.should_revoke", "macro.dbt.apply_grants", "macro.dbt.persist_docs"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "build_sql", "type": null, "description": ""}, {"name": "existing_relation", "type": null, "description": ""}, {"name": "target_relation", "type": null, "description": ""}], "created_at": 1789079002.4167948, "supported_languages": null}, "macro.dbt.materialization_table_default": {"name": "materialization_table_default", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/table.sql", "original_file_path": "macros/materializations/models/table.sql", "unique_id": "macro.dbt.materialization_table_default", "macro_sql": "{% materialization table, default %}\n\n {%- set existing_relation = load_cached_relation(this) -%}\n {%- set target_relation = this.incorporate(type='table') %}\n {%- set intermediate_relation = make_intermediate_relation(target_relation) -%}\n -- the intermediate_relation should not already exist in the database; get_relation\n -- will return None in that case. Otherwise, we get a relation that we can drop\n -- later, before we try to use this name for the current operation\n {%- set preexisting_intermediate_relation = load_cached_relation(intermediate_relation) -%}\n /*\n See ../view/view.sql for more information about this relation.\n */\n {%- set backup_relation_type = 'table' if existing_relation is none else existing_relation.type -%}\n {%- set backup_relation = make_backup_relation(target_relation, backup_relation_type) -%}\n -- as above, the backup_relation should not already exist\n {%- set preexisting_backup_relation = load_cached_relation(backup_relation) -%}\n -- grab current tables grants config for comparision later on\n {% set grant_config = config.get('grants') %}\n\n -- drop the temp relations if they exist already in the database\n {{ drop_relation_if_exists(preexisting_intermediate_relation) }}\n {{ drop_relation_if_exists(preexisting_backup_relation) }}\n\n {{ run_hooks(pre_hooks, inside_transaction=False) }}\n\n -- `BEGIN` happens here:\n {{ run_hooks(pre_hooks, inside_transaction=True) }}\n\n -- build model\n {% call statement('main') -%}\n {{ get_create_table_as_sql(False, intermediate_relation, sql) }}\n {%- endcall %}\n\n {% do create_indexes(intermediate_relation) %}\n\n -- cleanup\n {% if existing_relation is not none %}\n /* Do the equivalent of rename_if_exists. 'existing_relation' could have been dropped\n since the variable was first set. */\n {% set existing_relation = load_cached_relation(existing_relation) %}\n {% if existing_relation is not none %}\n {{ adapter.rename_relation(existing_relation, backup_relation) }}\n {% endif %}\n {% endif %}\n\n {{ adapter.rename_relation(intermediate_relation, target_relation) }}\n\n {{ run_hooks(post_hooks, inside_transaction=True) }}\n\n {% set should_revoke = should_revoke(existing_relation, full_refresh_mode=True) %}\n {% do apply_grants(target_relation, grant_config, should_revoke=should_revoke) %}\n\n {% do persist_docs(target_relation, model) %}\n\n -- `COMMIT` happens here\n {{ adapter.commit() }}\n\n -- finally, drop the existing/backup relation after the commit\n {{ drop_relation_if_exists(backup_relation) }}\n\n {{ run_hooks(post_hooks, inside_transaction=False) }}\n\n {{ return({'relations': [target_relation]}) }}\n{% endmaterialization %}", "depends_on": {"macros": ["macro.dbt.load_cached_relation", "macro.dbt.make_intermediate_relation", "macro.dbt.make_backup_relation", "macro.dbt.drop_relation_if_exists", "macro.dbt.run_hooks", "macro.dbt.statement", "macro.dbt.get_create_table_as_sql", "macro.dbt.create_indexes", "macro.dbt.should_revoke", "macro.dbt.apply_grants", "macro.dbt.persist_docs"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "supported_languages", "type": null, "description": ""}], "created_at": 1789079002.4195416, "supported_languages": ["sql"]}, "macro.dbt.materialization_materialized_view_default": {"name": "materialization_materialized_view_default", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/materialized_view.sql", "original_file_path": "macros/materializations/models/materialized_view.sql", "unique_id": "macro.dbt.materialization_materialized_view_default", "macro_sql": "{% materialization materialized_view, default %}\n {% set existing_relation = load_cached_relation(this) %}\n {% set target_relation = this.incorporate(type=this.MaterializedView) %}\n {% set intermediate_relation = make_intermediate_relation(target_relation) %}\n {% set backup_relation_type = target_relation.MaterializedView if existing_relation is none else existing_relation.type %}\n {% set backup_relation = make_backup_relation(target_relation, backup_relation_type) %}\n\n {{ materialized_view_setup(backup_relation, intermediate_relation, pre_hooks) }}\n\n {% set build_sql = materialized_view_get_build_sql(existing_relation, target_relation, backup_relation, intermediate_relation) %}\n\n {% if build_sql == '' %}\n {{ materialized_view_execute_no_op(target_relation) }}\n {% else %}\n {{ materialized_view_execute_build_sql(build_sql, existing_relation, target_relation, post_hooks) }}\n {% endif %}\n\n {{ materialized_view_teardown(backup_relation, intermediate_relation, post_hooks) }}\n\n {{ return({'relations': [target_relation]}) }}\n\n{% endmaterialization %}", "depends_on": {"macros": ["macro.dbt.load_cached_relation", "macro.dbt.make_intermediate_relation", "macro.dbt.make_backup_relation", "macro.dbt.materialized_view_setup", "macro.dbt.materialized_view_get_build_sql", "macro.dbt.materialized_view_execute_no_op", "macro.dbt.materialized_view_execute_build_sql", "macro.dbt.materialized_view_teardown"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "supported_languages", "type": null, "description": ""}], "created_at": 1789079002.4214869, "supported_languages": ["sql"]}, "macro.dbt.materialized_view_setup": {"name": "materialized_view_setup", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/materialized_view.sql", "original_file_path": "macros/materializations/models/materialized_view.sql", "unique_id": "macro.dbt.materialized_view_setup", "macro_sql": "{% macro materialized_view_setup(backup_relation, intermediate_relation, pre_hooks) %}\n\n -- backup_relation and intermediate_relation should not already exist in the database\n -- it's possible these exist because of a previous run that exited unexpectedly\n {% set preexisting_backup_relation = load_cached_relation(backup_relation) %}\n {% set preexisting_intermediate_relation = load_cached_relation(intermediate_relation) %}\n\n -- drop the temp relations if they exist already in the database\n {{ drop_relation_if_exists(preexisting_backup_relation) }}\n {{ drop_relation_if_exists(preexisting_intermediate_relation) }}\n\n {{ run_hooks(pre_hooks, inside_transaction=False) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.load_cached_relation", "macro.dbt.drop_relation_if_exists", "macro.dbt.run_hooks"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "backup_relation", "type": null, "description": ""}, {"name": "intermediate_relation", "type": null, "description": ""}, {"name": "pre_hooks", "type": null, "description": ""}], "created_at": 1789079002.4220145, "supported_languages": null}, "macro.dbt.materialized_view_teardown": {"name": "materialized_view_teardown", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/materialized_view.sql", "original_file_path": "macros/materializations/models/materialized_view.sql", "unique_id": "macro.dbt.materialized_view_teardown", "macro_sql": "{% macro materialized_view_teardown(backup_relation, intermediate_relation, post_hooks) %}\n\n -- drop the temp relations if they exist to leave the database clean for the next run\n {{ drop_relation_if_exists(backup_relation) }}\n {{ drop_relation_if_exists(intermediate_relation) }}\n\n {{ run_hooks(post_hooks, inside_transaction=False) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.drop_relation_if_exists", "macro.dbt.run_hooks"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "backup_relation", "type": null, "description": ""}, {"name": "intermediate_relation", "type": null, "description": ""}, {"name": "post_hooks", "type": null, "description": ""}], "created_at": 1789079002.4223387, "supported_languages": null}, "macro.dbt.materialized_view_get_build_sql": {"name": "materialized_view_get_build_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/materialized_view.sql", "original_file_path": "macros/materializations/models/materialized_view.sql", "unique_id": "macro.dbt.materialized_view_get_build_sql", "macro_sql": "{% macro materialized_view_get_build_sql(existing_relation, target_relation, backup_relation, intermediate_relation) %}\n\n {% set full_refresh_mode = should_full_refresh() %}\n\n -- determine the scenario we're in: create, full_refresh, alter, refresh data\n {% if existing_relation is none %}\n {% set build_sql = get_create_materialized_view_as_sql(target_relation, sql) %}\n {% elif full_refresh_mode or not existing_relation.is_materialized_view %}\n {% set build_sql = get_replace_sql(existing_relation, target_relation, sql) %}\n {% else %}\n\n -- get config options\n {% set on_configuration_change = config.get('on_configuration_change') %}\n {% set configuration_changes = get_materialized_view_configuration_changes(existing_relation, config) %}\n\n {% if configuration_changes is none %}\n {% set build_sql = refresh_materialized_view(target_relation) %}\n\n {% elif on_configuration_change == 'apply' %}\n {% set build_sql = get_alter_materialized_view_as_sql(target_relation, configuration_changes, sql, existing_relation, backup_relation, intermediate_relation) %}\n {% elif on_configuration_change == 'continue' %}\n {% set build_sql = '' %}\n {{ exceptions.warn(\"Configuration changes were identified and `on_configuration_change` was set to `continue` for `\" ~ target_relation.render() ~ \"`\") }}\n {% elif on_configuration_change == 'fail' %}\n {{ exceptions.raise_fail_fast_error(\"Configuration changes were identified and `on_configuration_change` was set to `fail` for `\" ~ target_relation.render() ~ \"`\") }}\n\n {% else %}\n -- this only happens if the user provides a value other than `apply`, 'skip', 'fail'\n {{ exceptions.raise_compiler_error(\"Unexpected configuration scenario\") }}\n\n {% endif %}\n\n {% endif %}\n\n {% do return(build_sql) %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.should_full_refresh", "macro.dbt.get_create_materialized_view_as_sql", "macro.dbt.get_replace_sql", "macro.dbt.get_materialized_view_configuration_changes", "macro.dbt.refresh_materialized_view", "macro.dbt.get_alter_materialized_view_as_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "existing_relation", "type": null, "description": ""}, {"name": "target_relation", "type": null, "description": ""}, {"name": "backup_relation", "type": null, "description": ""}, {"name": "intermediate_relation", "type": null, "description": ""}], "created_at": 1789079002.4239593, "supported_languages": null}, "macro.dbt.materialized_view_execute_no_op": {"name": "materialized_view_execute_no_op", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/materialized_view.sql", "original_file_path": "macros/materializations/models/materialized_view.sql", "unique_id": "macro.dbt.materialized_view_execute_no_op", "macro_sql": "{% macro materialized_view_execute_no_op(target_relation) %}\n {% do store_raw_result(\n name=\"main\",\n message=\"skip \" ~ target_relation,\n code=\"skip\",\n rows_affected=\"-1\"\n ) %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "target_relation", "type": null, "description": ""}], "created_at": 1789079002.4242656, "supported_languages": null}, "macro.dbt.materialized_view_execute_build_sql": {"name": "materialized_view_execute_build_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/materialized_view.sql", "original_file_path": "macros/materializations/models/materialized_view.sql", "unique_id": "macro.dbt.materialized_view_execute_build_sql", "macro_sql": "{% macro materialized_view_execute_build_sql(build_sql, existing_relation, target_relation, post_hooks) %}\n\n -- `BEGIN` happens here:\n {{ run_hooks(pre_hooks, inside_transaction=True) }}\n\n {% set grant_config = config.get('grants') %}\n\n {% call statement(name=\"main\") %}\n {{ build_sql }}\n {% endcall %}\n\n {% set should_revoke = should_revoke(existing_relation, full_refresh_mode=True) %}\n {% do apply_grants(target_relation, grant_config, should_revoke=should_revoke) %}\n\n {% do persist_docs(target_relation, model) %}\n\n {{ run_hooks(post_hooks, inside_transaction=True) }}\n\n {{ adapter.commit() }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.run_hooks", "macro.dbt.statement", "macro.dbt.should_revoke", "macro.dbt.apply_grants", "macro.dbt.persist_docs"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "build_sql", "type": null, "description": ""}, {"name": "existing_relation", "type": null, "description": ""}, {"name": "target_relation", "type": null, "description": ""}, {"name": "post_hooks", "type": null, "description": ""}], "created_at": 1789079002.4250581, "supported_languages": null}, "macro.dbt.materialization_view_default": {"name": "materialization_view_default", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/view.sql", "original_file_path": "macros/materializations/models/view.sql", "unique_id": "macro.dbt.materialization_view_default", "macro_sql": "{%- materialization view, default -%}\n\n {%- set existing_relation = load_cached_relation(this) -%}\n {%- set target_relation = this.incorporate(type='view') -%}\n {%- set intermediate_relation = make_intermediate_relation(target_relation) -%}\n\n -- the intermediate_relation should not already exist in the database; get_relation\n -- will return None in that case. Otherwise, we get a relation that we can drop\n -- later, before we try to use this name for the current operation\n {%- set preexisting_intermediate_relation = load_cached_relation(intermediate_relation) -%}\n /*\n This relation (probably) doesn't exist yet. If it does exist, it's a leftover from\n a previous run, and we're going to try to drop it immediately. At the end of this\n materialization, we're going to rename the \"existing_relation\" to this identifier,\n and then we're going to drop it. In order to make sure we run the correct one of:\n - drop view ...\n - drop table ...\n\n We need to set the type of this relation to be the type of the existing_relation, if it exists,\n or else \"view\" as a sane default if it does not. Note that if the existing_relation does not\n exist, then there is nothing to move out of the way and subsequentally drop. In that case,\n this relation will be effectively unused.\n */\n {%- set backup_relation_type = 'view' if existing_relation is none else existing_relation.type -%}\n {%- set backup_relation = make_backup_relation(target_relation, backup_relation_type) -%}\n -- as above, the backup_relation should not already exist\n {%- set preexisting_backup_relation = load_cached_relation(backup_relation) -%}\n -- grab current tables grants config for comparision later on\n {% set grant_config = config.get('grants') %}\n\n {{ run_hooks(pre_hooks, inside_transaction=False) }}\n\n -- drop the temp relations if they exist already in the database\n {{ drop_relation_if_exists(preexisting_intermediate_relation) }}\n {{ drop_relation_if_exists(preexisting_backup_relation) }}\n\n -- `BEGIN` happens here:\n {{ run_hooks(pre_hooks, inside_transaction=True) }}\n\n -- build model\n {% call statement('main') -%}\n {{ get_create_view_as_sql(intermediate_relation, sql) }}\n {%- endcall %}\n\n -- cleanup\n -- move the existing view out of the way\n {% if existing_relation is not none %}\n /* Do the equivalent of rename_if_exists. 'existing_relation' could have been dropped\n since the variable was first set. */\n {% set existing_relation = load_cached_relation(existing_relation) %}\n {% if existing_relation is not none %}\n {{ adapter.rename_relation(existing_relation, backup_relation) }}\n {% endif %}\n {% endif %}\n {{ adapter.rename_relation(intermediate_relation, target_relation) }}\n\n {% set should_revoke = should_revoke(existing_relation, full_refresh_mode=True) %}\n {% do apply_grants(target_relation, grant_config, should_revoke=should_revoke) %}\n\n {% do persist_docs(target_relation, model) %}\n\n {{ run_hooks(post_hooks, inside_transaction=True) }}\n\n {{ adapter.commit() }}\n\n {{ drop_relation_if_exists(backup_relation) }}\n\n {{ run_hooks(post_hooks, inside_transaction=False) }}\n\n {{ return({'relations': [target_relation]}) }}\n\n{%- endmaterialization -%}", "depends_on": {"macros": ["macro.dbt.load_cached_relation", "macro.dbt.make_intermediate_relation", "macro.dbt.make_backup_relation", "macro.dbt.run_hooks", "macro.dbt.drop_relation_if_exists", "macro.dbt.statement", "macro.dbt.get_create_view_as_sql", "macro.dbt.should_revoke", "macro.dbt.apply_grants", "macro.dbt.persist_docs"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "supported_languages", "type": null, "description": ""}], "created_at": 1789079002.4274516, "supported_languages": ["sql"]}, "macro.dbt.materialization_clone_default": {"name": "materialization_clone_default", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/clone/clone.sql", "original_file_path": "macros/materializations/models/clone/clone.sql", "unique_id": "macro.dbt.materialization_clone_default", "macro_sql": "{%- materialization clone, default -%}\n\n {%- set relations = {'relations': []} -%}\n\n {%- if not defer_relation -%}\n -- nothing to do\n {{ log(\"No relation found in state manifest for \" ~ model.unique_id, info=True) }}\n {{ return(relations) }}\n {%- endif -%}\n\n {%- set existing_relation = load_cached_relation(this) -%}\n\n {%- if existing_relation and not flags.FULL_REFRESH -%}\n -- noop!\n {{ log(\"Relation \" ~ existing_relation ~ \" already exists\", info=True) }}\n {{ return(relations) }}\n {%- endif -%}\n\n {%- set other_existing_relation = load_cached_relation(defer_relation) -%}\n\n -- If this is a database that can do zero-copy cloning of tables, and the other relation is a table, then this will be a table\n -- Otherwise, this will be a view\n\n {% set can_clone_table = can_clone_table() %}\n {%- set grant_config = config.get('grants') -%}\n\n {%- if other_existing_relation and other_existing_relation.type == 'table' and can_clone_table -%}\n\n {%- set target_relation = this.incorporate(type='table') -%}\n {% if existing_relation is not none and not existing_relation.is_table %}\n {{ log(\"Dropping relation \" ~ existing_relation.render() ~ \" because it is of type \" ~ existing_relation.type) }}\n {{ drop_relation_if_exists(existing_relation) }}\n {% endif %}\n\n -- as a general rule, data platforms that can clone tables can also do atomic 'create or replace'\n {% if target_relation.database == defer_relation.database and\n target_relation.schema == defer_relation.schema and\n target_relation.identifier == defer_relation.identifier %}\n {{ log(\"Target relation and defer relation are the same, skipping clone for relation: \" ~ target_relation.render()) }}\n {% else %}\n {% call statement('main') %}\n {{ create_or_replace_clone(target_relation, defer_relation) }}\n {% endcall %}\n {% endif %}\n {% set should_revoke = should_revoke(existing_relation, full_refresh_mode=True) %}\n {% do apply_grants(target_relation, grant_config, should_revoke=should_revoke) %}\n {% do persist_docs(target_relation, model) %}\n\n {{ return({'relations': [target_relation]}) }}\n\n {%- else -%}\n\n {%- set target_relation = this.incorporate(type='view') -%}\n\n -- reuse the view materialization\n -- TODO: support actual dispatch for materialization macros\n -- Tracking ticket: https://github.com/dbt-labs/dbt-core/issues/7799\n {% set search_name = \"materialization_view_\" ~ adapter.type() %}\n {% if not search_name in context %}\n {% set search_name = \"materialization_view_default\" %}\n {% endif %}\n {% set materialization_macro = context[search_name] %}\n {% set relations = materialization_macro() %}\n {{ return(relations) }}\n\n {%- endif -%}\n\n{%- endmaterialization -%}", "depends_on": {"macros": ["macro.dbt.load_cached_relation", "macro.dbt.can_clone_table", "macro.dbt.drop_relation_if_exists", "macro.dbt.statement", "macro.dbt.create_or_replace_clone", "macro.dbt.should_revoke", "macro.dbt.apply_grants", "macro.dbt.persist_docs"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "supported_languages", "type": null, "description": ""}], "created_at": 1789079002.4304426, "supported_languages": ["sql"]}, "macro.dbt.can_clone_table": {"name": "can_clone_table", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/clone/can_clone_table.sql", "original_file_path": "macros/materializations/models/clone/can_clone_table.sql", "unique_id": "macro.dbt.can_clone_table", "macro_sql": "{% macro can_clone_table() %}\n {{ return(adapter.dispatch('can_clone_table', 'dbt')()) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__can_clone_table"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789079002.430764, "supported_languages": null}, "macro.dbt.default__can_clone_table": {"name": "default__can_clone_table", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/clone/can_clone_table.sql", "original_file_path": "macros/materializations/models/clone/can_clone_table.sql", "unique_id": "macro.dbt.default__can_clone_table", "macro_sql": "{% macro default__can_clone_table() %}\n {{ return(False) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789079002.430922, "supported_languages": null}, "macro.dbt.create_or_replace_clone": {"name": "create_or_replace_clone", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/clone/create_or_replace_clone.sql", "original_file_path": "macros/materializations/models/clone/create_or_replace_clone.sql", "unique_id": "macro.dbt.create_or_replace_clone", "macro_sql": "{% macro create_or_replace_clone(this_relation, defer_relation) %}\n {{ return(adapter.dispatch('create_or_replace_clone', 'dbt')(this_relation, defer_relation)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__create_or_replace_clone"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "this_relation", "type": null, "description": ""}, {"name": "defer_relation", "type": null, "description": ""}], "created_at": 1789079002.4312456, "supported_languages": null}, "macro.dbt.default__create_or_replace_clone": {"name": "default__create_or_replace_clone", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/clone/create_or_replace_clone.sql", "original_file_path": "macros/materializations/models/clone/create_or_replace_clone.sql", "unique_id": "macro.dbt.default__create_or_replace_clone", "macro_sql": "{% macro default__create_or_replace_clone(this_relation, defer_relation) %}\n create or replace table {{ this_relation.render() }} clone {{ defer_relation.render() }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "this_relation", "type": null, "description": ""}, {"name": "defer_relation", "type": null, "description": ""}], "created_at": 1789079002.4314494, "supported_languages": null}, "macro.dbt.materialization_incremental_default": {"name": "materialization_incremental_default", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/incremental.sql", "original_file_path": "macros/materializations/models/incremental/incremental.sql", "unique_id": "macro.dbt.materialization_incremental_default", "macro_sql": "{% materialization incremental, default -%}\n\n -- relations\n {%- set existing_relation = load_cached_relation(this) -%}\n {%- set target_relation = this.incorporate(type='table') -%}\n {%- set temp_relation = make_temp_relation(target_relation)-%}\n {%- set intermediate_relation = make_intermediate_relation(target_relation)-%}\n {%- set backup_relation_type = 'table' if existing_relation is none else existing_relation.type -%}\n {%- set backup_relation = make_backup_relation(target_relation, backup_relation_type) -%}\n\n -- configs\n {%- set unique_key = config.get('unique_key') -%}\n {%- set full_refresh_mode = (should_full_refresh() or existing_relation.is_view) -%}\n {%- set on_schema_change = incremental_validate_on_schema_change(config.get('on_schema_change'), default='ignore') -%}\n\n -- the temp_ and backup_ relations should not already exist in the database; get_relation\n -- will return None in that case. Otherwise, we get a relation that we can drop\n -- later, before we try to use this name for the current operation. This has to happen before\n -- BEGIN, in a separate transaction\n {%- set preexisting_intermediate_relation = load_cached_relation(intermediate_relation)-%}\n {%- set preexisting_backup_relation = load_cached_relation(backup_relation) -%}\n -- grab current tables grants config for comparision later on\n {% set grant_config = config.get('grants') %}\n {{ drop_relation_if_exists(preexisting_intermediate_relation) }}\n {{ drop_relation_if_exists(preexisting_backup_relation) }}\n\n {{ run_hooks(pre_hooks, inside_transaction=False) }}\n\n -- `BEGIN` happens here:\n {{ run_hooks(pre_hooks, inside_transaction=True) }}\n\n {% set to_drop = [] %}\n\n {% set incremental_strategy = config.get('incremental_strategy') or 'default' %}\n {% set strategy_sql_macro_func = adapter.get_incremental_strategy_macro(context, incremental_strategy) %}\n\n {% if existing_relation is none %}\n {% set build_sql = get_create_table_as_sql(False, target_relation, sql) %}\n {% set relation_for_indexes = target_relation %}\n {% elif full_refresh_mode %}\n {% set build_sql = get_create_table_as_sql(False, intermediate_relation, sql) %}\n {% set relation_for_indexes = intermediate_relation %}\n {% set need_swap = true %}\n {% else %}\n {% do run_query(get_create_table_as_sql(True, temp_relation, sql)) %}\n {% set relation_for_indexes = temp_relation %}\n {% set contract_config = config.get('contract') %}\n {% if not contract_config or not contract_config.enforced %}\n {% do adapter.expand_target_column_types(\n from_relation=temp_relation,\n to_relation=target_relation) %}\n {% endif %}\n {#-- Process schema changes. Returns dict of changes if successful. Use source columns for upserting/merging --#}\n {% set dest_columns = process_schema_changes(on_schema_change, temp_relation, existing_relation) %}\n {% if not dest_columns %}\n {% set dest_columns = adapter.get_columns_in_relation(existing_relation) %}\n {% endif %}\n\n {#-- Get the incremental_strategy, the macro to use for the strategy, and build the sql --#}\n {% set incremental_predicates = config.get('predicates', none) or config.get('incremental_predicates', none) %}\n {% set strategy_arg_dict = ({'target_relation': target_relation, 'temp_relation': temp_relation, 'unique_key': unique_key, 'dest_columns': dest_columns, 'incremental_predicates': incremental_predicates }) %}\n {% set build_sql = strategy_sql_macro_func(strategy_arg_dict) %}\n\n {% endif %}\n\n {% call statement(\"main\") %}\n {{ build_sql }}\n {% endcall %}\n\n {% if existing_relation is none or existing_relation.is_view or should_full_refresh() %}\n {% do create_indexes(relation_for_indexes) %}\n {% endif %}\n\n {% if need_swap %}\n {% do adapter.rename_relation(target_relation, backup_relation) %}\n {% do adapter.rename_relation(intermediate_relation, target_relation) %}\n {% do to_drop.append(backup_relation) %}\n {% endif %}\n\n {% set should_revoke = should_revoke(existing_relation, full_refresh_mode) %}\n {% do apply_grants(target_relation, grant_config, should_revoke=should_revoke) %}\n\n {% do persist_docs(target_relation, model) %}\n\n {{ run_hooks(post_hooks, inside_transaction=True) }}\n\n -- `COMMIT` happens here\n {% do adapter.commit() %}\n\n {% for rel in to_drop %}\n {% do adapter.drop_relation(rel) %}\n {% endfor %}\n\n {{ run_hooks(post_hooks, inside_transaction=False) }}\n\n {{ return({'relations': [target_relation]}) }}\n\n{%- endmaterialization %}", "depends_on": {"macros": ["macro.dbt.load_cached_relation", "macro.dbt.make_temp_relation", "macro.dbt.make_intermediate_relation", "macro.dbt.make_backup_relation", "macro.dbt.should_full_refresh", "macro.dbt.incremental_validate_on_schema_change", "macro.dbt.drop_relation_if_exists", "macro.dbt.run_hooks", "macro.dbt.get_create_table_as_sql", "macro.dbt.run_query", "macro.dbt.process_schema_changes", "macro.dbt.statement", "macro.dbt.create_indexes", "macro.dbt.should_revoke", "macro.dbt.apply_grants", "macro.dbt.persist_docs"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "supported_languages", "type": null, "description": ""}], "created_at": 1789079002.4362128, "supported_languages": ["sql"]}, "macro.dbt.get_quoted_csv": {"name": "get_quoted_csv", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/column_helpers.sql", "original_file_path": "macros/materializations/models/incremental/column_helpers.sql", "unique_id": "macro.dbt.get_quoted_csv", "macro_sql": "{% macro get_quoted_csv(column_names) %}\n\n {% set quoted = [] %}\n {% for col in column_names -%}\n {%- do quoted.append(adapter.quote(col)) -%}\n {%- endfor %}\n\n {%- set dest_cols_csv = quoted | join(', ') -%}\n {{ return(dest_cols_csv) }}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "column_names", "type": null, "description": ""}], "created_at": 1789079002.4372199, "supported_languages": null}, "macro.dbt.diff_columns": {"name": "diff_columns", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/column_helpers.sql", "original_file_path": "macros/materializations/models/incremental/column_helpers.sql", "unique_id": "macro.dbt.diff_columns", "macro_sql": "{% macro diff_columns(source_columns, target_columns) %}\n\n {% set result = [] %}\n {% set source_names = source_columns | map(attribute = 'column') | list %}\n {% set target_names = target_columns | map(attribute = 'column') | list %}\n\n {# --check whether the name attribute exists in the target - this does not perform a data type check #}\n {% for sc in source_columns %}\n {% if sc.name not in target_names %}\n {{ result.append(sc) }}\n {% endif %}\n {% endfor %}\n\n {{ return(result) }}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "source_columns", "type": null, "description": ""}, {"name": "target_columns", "type": null, "description": ""}], "created_at": 1789079002.437854, "supported_languages": null}, "macro.dbt.diff_column_data_types": {"name": "diff_column_data_types", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/column_helpers.sql", "original_file_path": "macros/materializations/models/incremental/column_helpers.sql", "unique_id": "macro.dbt.diff_column_data_types", "macro_sql": "{% macro diff_column_data_types(source_columns, target_columns) %}\n {{ return(adapter.dispatch('diff_column_data_types', 'dbt')(source_columns, target_columns)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__diff_column_data_types"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "source_columns", "type": null, "description": ""}, {"name": "target_columns", "type": null, "description": ""}], "created_at": 1789079002.438105, "supported_languages": null}, "macro.dbt.default__diff_column_data_types": {"name": "default__diff_column_data_types", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/column_helpers.sql", "original_file_path": "macros/materializations/models/incremental/column_helpers.sql", "unique_id": "macro.dbt.default__diff_column_data_types", "macro_sql": "{% macro default__diff_column_data_types(source_columns, target_columns) %}\n {% set result = [] %}\n {% for sc in source_columns %}\n {% set tc = target_columns | selectattr(\"name\", \"equalto\", sc.name) | list | first %}\n {% if tc %}\n {% if sc.expanded_data_type != tc.expanded_data_type and not sc.can_expand_to(other_column=tc) %}\n {{ result.append( { 'column_name': tc.name, 'new_type': sc.expanded_data_type } ) }}\n {% endif %}\n {% endif %}\n {% endfor %}\n\n {{ return(result) }}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "source_columns", "type": null, "description": ""}, {"name": "target_columns", "type": null, "description": ""}], "created_at": 1789079002.4388213, "supported_languages": null}, "macro.dbt.get_merge_update_columns": {"name": "get_merge_update_columns", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/column_helpers.sql", "original_file_path": "macros/materializations/models/incremental/column_helpers.sql", "unique_id": "macro.dbt.get_merge_update_columns", "macro_sql": "{% macro get_merge_update_columns(merge_update_columns, merge_exclude_columns, dest_columns) %}\n {{ return(adapter.dispatch('get_merge_update_columns', 'dbt')(merge_update_columns, merge_exclude_columns, dest_columns)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_merge_update_columns"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "merge_update_columns", "type": null, "description": ""}, {"name": "merge_exclude_columns", "type": null, "description": ""}, {"name": "dest_columns", "type": null, "description": ""}], "created_at": 1789079002.439103, "supported_languages": null}, "macro.dbt.default__get_merge_update_columns": {"name": "default__get_merge_update_columns", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/column_helpers.sql", "original_file_path": "macros/materializations/models/incremental/column_helpers.sql", "unique_id": "macro.dbt.default__get_merge_update_columns", "macro_sql": "{% macro default__get_merge_update_columns(merge_update_columns, merge_exclude_columns, dest_columns) %}\n {%- set default_cols = dest_columns | map(attribute=\"quoted\") | list -%}\n\n {%- if merge_update_columns and merge_exclude_columns -%}\n {{ exceptions.raise_compiler_error(\n 'Model cannot specify merge_update_columns and merge_exclude_columns. Please update model to use only one config'\n )}}\n {%- elif merge_update_columns -%}\n {%- set update_columns = merge_update_columns -%}\n {%- elif merge_exclude_columns -%}\n {%- set update_columns = [] -%}\n {%- for column in dest_columns -%}\n {% if column.column | lower not in merge_exclude_columns | map(\"lower\") | list %}\n {%- do update_columns.append(column.quoted) -%}\n {% endif %}\n {%- endfor -%}\n {%- else -%}\n {%- set update_columns = default_cols -%}\n {%- endif -%}\n\n {{ return(update_columns) }}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "merge_update_columns", "type": null, "description": ""}, {"name": "merge_exclude_columns", "type": null, "description": ""}, {"name": "dest_columns", "type": null, "description": ""}], "created_at": 1789079002.4399292, "supported_languages": null}, "macro.dbt.get_incremental_append_sql": {"name": "get_incremental_append_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "unique_id": "macro.dbt.get_incremental_append_sql", "macro_sql": "{% macro get_incremental_append_sql(arg_dict) %}\n\n {{ return(adapter.dispatch('get_incremental_append_sql', 'dbt')(arg_dict)) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_incremental_append_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "arg_dict", "type": null, "description": ""}], "created_at": 1789079002.4406548, "supported_languages": null}, "macro.dbt.default__get_incremental_append_sql": {"name": "default__get_incremental_append_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "unique_id": "macro.dbt.default__get_incremental_append_sql", "macro_sql": "{% macro default__get_incremental_append_sql(arg_dict) %}\n\n {% do return(get_insert_into_sql(arg_dict[\"target_relation\"], arg_dict[\"temp_relation\"], arg_dict[\"dest_columns\"])) %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_insert_into_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "arg_dict", "type": null, "description": ""}], "created_at": 1789079002.440939, "supported_languages": null}, "macro.dbt.get_incremental_delete_insert_sql": {"name": "get_incremental_delete_insert_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "unique_id": "macro.dbt.get_incremental_delete_insert_sql", "macro_sql": "{% macro get_incremental_delete_insert_sql(arg_dict) %}\n\n {{ return(adapter.dispatch('get_incremental_delete_insert_sql', 'dbt')(arg_dict)) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_incremental_delete_insert_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "arg_dict", "type": null, "description": ""}], "created_at": 1789079002.4411602, "supported_languages": null}, "macro.dbt.default__get_incremental_delete_insert_sql": {"name": "default__get_incremental_delete_insert_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "unique_id": "macro.dbt.default__get_incremental_delete_insert_sql", "macro_sql": "{% macro default__get_incremental_delete_insert_sql(arg_dict) %}\n\n {% do return(get_delete_insert_merge_sql(arg_dict[\"target_relation\"], arg_dict[\"temp_relation\"], arg_dict[\"unique_key\"], arg_dict[\"dest_columns\"], arg_dict[\"incremental_predicates\"])) %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_delete_insert_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "arg_dict", "type": null, "description": ""}], "created_at": 1789079002.441484, "supported_languages": null}, "macro.dbt.get_incremental_merge_sql": {"name": "get_incremental_merge_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "unique_id": "macro.dbt.get_incremental_merge_sql", "macro_sql": "{% macro get_incremental_merge_sql(arg_dict) %}\n\n {{ return(adapter.dispatch('get_incremental_merge_sql', 'dbt')(arg_dict)) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_incremental_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "arg_dict", "type": null, "description": ""}], "created_at": 1789079002.4416997, "supported_languages": null}, "macro.dbt.default__get_incremental_merge_sql": {"name": "default__get_incremental_merge_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "unique_id": "macro.dbt.default__get_incremental_merge_sql", "macro_sql": "{% macro default__get_incremental_merge_sql(arg_dict) %}\n\n {% do return(get_merge_sql(arg_dict[\"target_relation\"], arg_dict[\"temp_relation\"], arg_dict[\"unique_key\"], arg_dict[\"dest_columns\"], arg_dict[\"incremental_predicates\"])) %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "arg_dict", "type": null, "description": ""}], "created_at": 1789079002.4420376, "supported_languages": null}, "macro.dbt.get_incremental_insert_overwrite_sql": {"name": "get_incremental_insert_overwrite_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "unique_id": "macro.dbt.get_incremental_insert_overwrite_sql", "macro_sql": "{% macro get_incremental_insert_overwrite_sql(arg_dict) %}\n\n {{ return(adapter.dispatch('get_incremental_insert_overwrite_sql', 'dbt')(arg_dict)) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_incremental_insert_overwrite_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "arg_dict", "type": null, "description": ""}], "created_at": 1789079002.4422526, "supported_languages": null}, "macro.dbt.default__get_incremental_insert_overwrite_sql": {"name": "default__get_incremental_insert_overwrite_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "unique_id": "macro.dbt.default__get_incremental_insert_overwrite_sql", "macro_sql": "{% macro default__get_incremental_insert_overwrite_sql(arg_dict) %}\n\n {% do return(get_insert_overwrite_merge_sql(arg_dict[\"target_relation\"], arg_dict[\"temp_relation\"], arg_dict[\"dest_columns\"], arg_dict[\"incremental_predicates\"])) %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_insert_overwrite_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "arg_dict", "type": null, "description": ""}], "created_at": 1789079002.442622, "supported_languages": null}, "macro.dbt.get_incremental_default_sql": {"name": "get_incremental_default_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "unique_id": "macro.dbt.get_incremental_default_sql", "macro_sql": "{% macro get_incremental_default_sql(arg_dict) %}\n\n {{ return(adapter.dispatch('get_incremental_default_sql', 'dbt')(arg_dict)) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__get_incremental_default_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "arg_dict", "type": null, "description": ""}], "created_at": 1789079002.4428341, "supported_languages": null}, "macro.dbt.default__get_incremental_default_sql": {"name": "default__get_incremental_default_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "unique_id": "macro.dbt.default__get_incremental_default_sql", "macro_sql": "{% macro default__get_incremental_default_sql(arg_dict) %}\n\n {% do return(get_incremental_append_sql(arg_dict)) %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_incremental_append_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "arg_dict", "type": null, "description": ""}], "created_at": 1789079002.4430218, "supported_languages": null}, "macro.dbt.get_incremental_microbatch_sql": {"name": "get_incremental_microbatch_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "unique_id": "macro.dbt.get_incremental_microbatch_sql", "macro_sql": "{% macro get_incremental_microbatch_sql(arg_dict) %}\n\n {{ return(adapter.dispatch('get_incremental_microbatch_sql', 'dbt')(arg_dict)) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__get_incremental_microbatch_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "arg_dict", "type": null, "description": ""}], "created_at": 1789079002.4432294, "supported_languages": null}, "macro.dbt.default__get_incremental_microbatch_sql": {"name": "default__get_incremental_microbatch_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "unique_id": "macro.dbt.default__get_incremental_microbatch_sql", "macro_sql": "{% macro default__get_incremental_microbatch_sql(arg_dict) %}\n\n {{ exceptions.raise_not_implemented('microbatch materialization strategy not implemented for adapter ' + adapter.type()) }}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "arg_dict", "type": null, "description": ""}], "created_at": 1789079002.4434178, "supported_languages": null}, "macro.dbt.get_insert_into_sql": {"name": "get_insert_into_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "unique_id": "macro.dbt.get_insert_into_sql", "macro_sql": "{% macro get_insert_into_sql(target_relation, temp_relation, dest_columns) %}\n\n {%- set dest_cols_csv = get_quoted_csv(dest_columns | map(attribute=\"name\")) -%}\n\n insert into {{ target_relation }} ({{ dest_cols_csv }})\n (\n select {{ dest_cols_csv }}\n from {{ temp_relation }}\n )\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_quoted_csv"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "target_relation", "type": null, "description": ""}, {"name": "temp_relation", "type": null, "description": ""}, {"name": "dest_columns", "type": null, "description": ""}], "created_at": 1789079002.443732, "supported_languages": null}, "macro.dbt.incremental_validate_on_schema_change": {"name": "incremental_validate_on_schema_change", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/on_schema_change.sql", "original_file_path": "macros/materializations/models/incremental/on_schema_change.sql", "unique_id": "macro.dbt.incremental_validate_on_schema_change", "macro_sql": "{% macro incremental_validate_on_schema_change(on_schema_change, default='ignore') %}\n\n {% if on_schema_change not in ['sync_all_columns', 'append_new_columns', 'fail', 'ignore'] %}\n\n {% set log_message = 'Invalid value for on_schema_change (%s) specified. Setting default value of %s.' % (on_schema_change, default) %}\n {% do log(log_message) %}\n\n {{ return(default) }}\n\n {% else %}\n\n {{ return(on_schema_change) }}\n\n {% endif %}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "on_schema_change", "type": null, "description": ""}, {"name": "default", "type": null, "description": ""}], "created_at": 1789079002.44526, "supported_languages": null}, "macro.dbt.check_for_schema_changes": {"name": "check_for_schema_changes", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/on_schema_change.sql", "original_file_path": "macros/materializations/models/incremental/on_schema_change.sql", "unique_id": "macro.dbt.check_for_schema_changes", "macro_sql": "{% macro check_for_schema_changes(source_relation, target_relation) %}\n {{ return(adapter.dispatch('check_for_schema_changes', 'dbt')(source_relation, target_relation)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__check_for_schema_changes"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "source_relation", "type": null, "description": ""}, {"name": "target_relation", "type": null, "description": ""}], "created_at": 1789079002.4455228, "supported_languages": null}, "macro.dbt.default__check_for_schema_changes": {"name": "default__check_for_schema_changes", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/on_schema_change.sql", "original_file_path": "macros/materializations/models/incremental/on_schema_change.sql", "unique_id": "macro.dbt.default__check_for_schema_changes", "macro_sql": "{% macro default__check_for_schema_changes(source_relation, target_relation) %}\n\n {% set schema_changed = False %}\n\n {%- set source_columns = adapter.get_columns_in_relation(source_relation) -%}\n {%- set target_columns = adapter.get_columns_in_relation(target_relation) -%}\n {%- set source_not_in_target = diff_columns(source_columns, target_columns) -%}\n {%- set target_not_in_source = diff_columns(target_columns, source_columns) -%}\n\n {% set new_target_types = diff_column_data_types(source_columns, target_columns) %}\n\n {% if source_not_in_target != [] %}\n {% set schema_changed = True %}\n {% elif target_not_in_source != [] or new_target_types != [] %}\n {% set schema_changed = True %}\n {% elif new_target_types != [] %}\n {% set schema_changed = True %}\n {% endif %}\n\n {% set changes_dict = {\n 'schema_changed': schema_changed,\n 'source_not_in_target': source_not_in_target,\n 'target_not_in_source': target_not_in_source,\n 'source_columns': source_columns,\n 'target_columns': target_columns,\n 'new_target_types': new_target_types\n } %}\n\n {% set msg %}\n In {{ target_relation }}:\n Schema changed: {{ schema_changed }}\n Source columns not in target: {{ source_not_in_target }}\n Target columns not in source: {{ target_not_in_source }}\n New column types: {{ new_target_types }}\n {% endset %}\n\n {% do log(msg) %}\n\n {{ return(changes_dict) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.diff_columns", "macro.dbt.diff_column_data_types"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "source_relation", "type": null, "description": ""}, {"name": "target_relation", "type": null, "description": ""}], "created_at": 1789079002.4468977, "supported_languages": null}, "macro.dbt.sync_column_schemas": {"name": "sync_column_schemas", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/on_schema_change.sql", "original_file_path": "macros/materializations/models/incremental/on_schema_change.sql", "unique_id": "macro.dbt.sync_column_schemas", "macro_sql": "{% macro sync_column_schemas(on_schema_change, target_relation, schema_changes_dict) %}\n {{ return(adapter.dispatch('sync_column_schemas', 'dbt')(on_schema_change, target_relation, schema_changes_dict)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__sync_column_schemas"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "on_schema_change", "type": null, "description": ""}, {"name": "target_relation", "type": null, "description": ""}, {"name": "schema_changes_dict", "type": null, "description": ""}], "created_at": 1789079002.4471827, "supported_languages": null}, "macro.dbt.default__sync_column_schemas": {"name": "default__sync_column_schemas", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/on_schema_change.sql", "original_file_path": "macros/materializations/models/incremental/on_schema_change.sql", "unique_id": "macro.dbt.default__sync_column_schemas", "macro_sql": "{% macro default__sync_column_schemas(on_schema_change, target_relation, schema_changes_dict) %}\n\n {%- set add_to_target_arr = schema_changes_dict['source_not_in_target'] -%}\n {%- set remove_from_target_arr = schema_changes_dict['target_not_in_source'] -%}\n {%- set new_target_types = schema_changes_dict['new_target_types'] -%}\n\n {%- if on_schema_change == 'append_new_columns'-%}\n {%- if add_to_target_arr | length > 0 -%}\n {%- do alter_relation_add_remove_columns(target_relation, add_to_target_arr, none) -%}\n {%- endif -%}\n\n {% elif on_schema_change == 'sync_all_columns' %}\n\n {% if add_to_target_arr | length > 0 or remove_from_target_arr | length > 0 %}\n {%- do alter_relation_add_remove_columns(target_relation, add_to_target_arr, remove_from_target_arr) -%}\n {% endif %}\n\n {% if new_target_types != [] %}\n {% for ntt in new_target_types %}\n {% set column_name = ntt['column_name'] %}\n {% set new_type = ntt['new_type'] %}\n {% do alter_column_type(target_relation, column_name, new_type) %}\n {% endfor %}\n {% endif %}\n\n {% endif %}\n\n {% set schema_change_message %}\n In {{ target_relation }}:\n Schema change approach: {{ on_schema_change }}\n Columns added: {{ add_to_target_arr }}\n Columns removed: {{ remove_from_target_arr }}\n Data types changed: {{ new_target_types }}\n {% endset %}\n\n {% do log(schema_change_message) %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.alter_relation_add_remove_columns", "macro.dbt.alter_column_type"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "on_schema_change", "type": null, "description": ""}, {"name": "target_relation", "type": null, "description": ""}, {"name": "schema_changes_dict", "type": null, "description": ""}], "created_at": 1789079002.4485164, "supported_languages": null}, "macro.dbt.process_schema_changes": {"name": "process_schema_changes", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/on_schema_change.sql", "original_file_path": "macros/materializations/models/incremental/on_schema_change.sql", "unique_id": "macro.dbt.process_schema_changes", "macro_sql": "{% macro process_schema_changes(on_schema_change, source_relation, target_relation) %}\n {{ return(adapter.dispatch('process_schema_changes', 'dbt')(on_schema_change, source_relation, target_relation)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__process_schema_changes"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "on_schema_change", "type": null, "description": ""}, {"name": "source_relation", "type": null, "description": ""}, {"name": "target_relation", "type": null, "description": ""}], "created_at": 1789079002.448906, "supported_languages": null}, "macro.dbt.default__process_schema_changes": {"name": "default__process_schema_changes", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/on_schema_change.sql", "original_file_path": "macros/materializations/models/incremental/on_schema_change.sql", "unique_id": "macro.dbt.default__process_schema_changes", "macro_sql": "{% macro default__process_schema_changes(on_schema_change, source_relation, target_relation) %}\n\n {% if on_schema_change == 'ignore' %}\n\n {{ return({}) }}\n\n {% else %}\n\n {% set schema_changes_dict = check_for_schema_changes(source_relation, target_relation) %}\n\n {% if schema_changes_dict['schema_changed'] %}\n\n {% if on_schema_change == 'fail' %}\n\n {% set fail_msg %}\n The source and target schemas on this incremental model are out of sync!\n They can be reconciled in several ways:\n - set the `on_schema_change` config to either append_new_columns or sync_all_columns, depending on your situation.\n - Re-run the incremental model with `full_refresh: True` to update the target schema.\n - update the schema manually and re-run the process.\n\n Additional troubleshooting context:\n Source columns not in target: {{ schema_changes_dict['source_not_in_target'] }}\n Target columns not in source: {{ schema_changes_dict['target_not_in_source'] }}\n New column types: {{ schema_changes_dict['new_target_types'] }}\n {% endset %}\n\n {% do exceptions.raise_compiler_error(fail_msg) %}\n\n {# -- unless we ignore, run the sync operation per the config #}\n {% else %}\n\n {% do sync_column_schemas(on_schema_change, target_relation, schema_changes_dict) %}\n\n {% endif %}\n\n {% endif %}\n\n {{ return(schema_changes_dict['source_columns']) }}\n\n {% endif %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.check_for_schema_changes", "macro.dbt.sync_column_schemas"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "on_schema_change", "type": null, "description": ""}, {"name": "source_relation", "type": null, "description": ""}, {"name": "target_relation", "type": null, "description": ""}], "created_at": 1789079002.4498558, "supported_languages": null}, "macro.dbt.get_merge_sql": {"name": "get_merge_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/merge.sql", "original_file_path": "macros/materializations/models/incremental/merge.sql", "unique_id": "macro.dbt.get_merge_sql", "macro_sql": "{% macro get_merge_sql(target, source, unique_key, dest_columns, incremental_predicates=none) -%}\n -- back compat for old kwarg name\n {% set incremental_predicates = kwargs.get('predicates', incremental_predicates) %}\n {{ adapter.dispatch('get_merge_sql', 'dbt')(target, source, unique_key, dest_columns, incremental_predicates) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "target", "type": null, "description": ""}, {"name": "source", "type": null, "description": ""}, {"name": "unique_key", "type": null, "description": ""}, {"name": "dest_columns", "type": null, "description": ""}, {"name": "incremental_predicates", "type": null, "description": ""}], "created_at": 1789079002.4511206, "supported_languages": null}, "macro.dbt.get_merge_unique_key_match": {"name": "get_merge_unique_key_match", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/merge.sql", "original_file_path": "macros/materializations/models/incremental/merge.sql", "unique_id": "macro.dbt.get_merge_unique_key_match", "macro_sql": "{% macro get_merge_unique_key_match(source_unique_key, target_unique_key) %}\n {{ return(adapter.dispatch('get_merge_unique_key_match', 'dbt')(source_unique_key, target_unique_key)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_merge_unique_key_match"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "source_unique_key", "type": null, "description": ""}, {"name": "target_unique_key", "type": null, "description": ""}], "created_at": 1789079002.451369, "supported_languages": null}, "macro.dbt.default__get_merge_unique_key_match": {"name": "default__get_merge_unique_key_match", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/merge.sql", "original_file_path": "macros/materializations/models/incremental/merge.sql", "unique_id": "macro.dbt.default__get_merge_unique_key_match", "macro_sql": "{% macro default__get_merge_unique_key_match(source_unique_key, target_unique_key) -%}\n {{ return(equals(source_unique_key, target_unique_key) | trim) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.equals"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "source_unique_key", "type": null, "description": ""}, {"name": "target_unique_key", "type": null, "description": ""}], "created_at": 1789079002.451568, "supported_languages": null}, "macro.dbt.default__get_merge_sql": {"name": "default__get_merge_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/merge.sql", "original_file_path": "macros/materializations/models/incremental/merge.sql", "unique_id": "macro.dbt.default__get_merge_sql", "macro_sql": "{% macro default__get_merge_sql(target, source, unique_key, dest_columns, incremental_predicates=none) -%}\n {%- set predicates = [] if incremental_predicates is none else [] + incremental_predicates -%}\n {%- set dest_cols_csv = get_quoted_csv(dest_columns | map(attribute=\"name\")) -%}\n {%- set merge_update_columns = config.get('merge_update_columns') -%}\n {%- set merge_exclude_columns = config.get('merge_exclude_columns') -%}\n {%- set update_columns = get_merge_update_columns(merge_update_columns, merge_exclude_columns, dest_columns) -%}\n {%- set sql_header = config.get('sql_header', none) -%}\n\n {% if unique_key %}\n {% if unique_key is sequence and unique_key is not mapping and unique_key is not string %}\n {% for key in unique_key %}\n {% set this_key_match %}\n DBT_INTERNAL_SOURCE.{{ key }} = DBT_INTERNAL_DEST.{{ key }}\n {% endset %}\n {% do predicates.append(this_key_match) %}\n {% endfor %}\n {% else %}\n {% set source_unique_key = (\"DBT_INTERNAL_SOURCE.\" ~ unique_key) | trim %}\n {% set target_unique_key = (\"DBT_INTERNAL_DEST.\" ~ unique_key) | trim %}\n {% set unique_key_match = get_merge_unique_key_match(source_unique_key, target_unique_key) %}\n {% do predicates.append(unique_key_match) %}\n {% endif %}\n {% else %}\n {% do predicates.append('FALSE') %}\n {% endif %}\n\n {{ sql_header if sql_header is not none }}\n\n merge into {{ target }} as DBT_INTERNAL_DEST\n using {{ source }} as DBT_INTERNAL_SOURCE\n on {{\"(\" ~ predicates | join(\") and (\") ~ \")\"}}\n\n {% if unique_key %}\n when matched then update set\n {% for column_name in update_columns -%}\n {{ column_name }} = DBT_INTERNAL_SOURCE.{{ column_name }}\n {%- if not loop.last %}, {%- endif %}\n {%- endfor %}\n {% endif %}\n\n when not matched then insert\n ({{ dest_cols_csv }})\n values\n ({{ dest_cols_csv }})\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_quoted_csv", "macro.dbt.get_merge_update_columns", "macro.dbt.get_merge_unique_key_match"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "target", "type": null, "description": ""}, {"name": "source", "type": null, "description": ""}, {"name": "unique_key", "type": null, "description": ""}, {"name": "dest_columns", "type": null, "description": ""}, {"name": "incremental_predicates", "type": null, "description": ""}], "created_at": 1789079002.4534802, "supported_languages": null}, "macro.dbt.get_delete_insert_merge_sql": {"name": "get_delete_insert_merge_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/merge.sql", "original_file_path": "macros/materializations/models/incremental/merge.sql", "unique_id": "macro.dbt.get_delete_insert_merge_sql", "macro_sql": "{% macro get_delete_insert_merge_sql(target, source, unique_key, dest_columns, incremental_predicates) -%}\n {{ adapter.dispatch('get_delete_insert_merge_sql', 'dbt')(target, source, unique_key, dest_columns, incremental_predicates) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_delete_insert_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "target", "type": null, "description": ""}, {"name": "source", "type": null, "description": ""}, {"name": "unique_key", "type": null, "description": ""}, {"name": "dest_columns", "type": null, "description": ""}, {"name": "incremental_predicates", "type": null, "description": ""}], "created_at": 1789079002.4537852, "supported_languages": null}, "macro.dbt.default__get_delete_insert_merge_sql": {"name": "default__get_delete_insert_merge_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/merge.sql", "original_file_path": "macros/materializations/models/incremental/merge.sql", "unique_id": "macro.dbt.default__get_delete_insert_merge_sql", "macro_sql": "{% macro default__get_delete_insert_merge_sql(target, source, unique_key, dest_columns, incremental_predicates) -%}\n\n {%- set dest_cols_csv = get_quoted_csv(dest_columns | map(attribute=\"name\")) -%}\n\n {% if unique_key %}\n {% if unique_key is string %}\n {% set unique_key = [unique_key] %}\n {% endif %}\n\n {%- set unique_key_str = unique_key|join(', ') -%}\n\n delete from {{ target }} as DBT_INTERNAL_DEST\n where ({{ unique_key_str }}) in (\n select distinct {{ unique_key_str }}\n from {{ source }} as DBT_INTERNAL_SOURCE\n )\n {%- if incremental_predicates %}\n {% for predicate in incremental_predicates %}\n and {{ predicate }}\n {% endfor %}\n {%- endif -%};\n\n {% endif %}\n\n insert into {{ target }} ({{ dest_cols_csv }})\n (\n select {{ dest_cols_csv }}\n from {{ source }}\n )\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.get_quoted_csv"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "target", "type": null, "description": ""}, {"name": "source", "type": null, "description": ""}, {"name": "unique_key", "type": null, "description": ""}, {"name": "dest_columns", "type": null, "description": ""}, {"name": "incremental_predicates", "type": null, "description": ""}], "created_at": 1789079002.4546173, "supported_languages": null}, "macro.dbt.get_insert_overwrite_merge_sql": {"name": "get_insert_overwrite_merge_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/merge.sql", "original_file_path": "macros/materializations/models/incremental/merge.sql", "unique_id": "macro.dbt.get_insert_overwrite_merge_sql", "macro_sql": "{% macro get_insert_overwrite_merge_sql(target, source, dest_columns, predicates, include_sql_header=false) -%}\n {{ adapter.dispatch('get_insert_overwrite_merge_sql', 'dbt')(target, source, dest_columns, predicates, include_sql_header) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_insert_overwrite_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "target", "type": null, "description": ""}, {"name": "source", "type": null, "description": ""}, {"name": "dest_columns", "type": null, "description": ""}, {"name": "predicates", "type": null, "description": ""}, {"name": "include_sql_header", "type": null, "description": ""}], "created_at": 1789079002.4549224, "supported_languages": null}, "macro.dbt.default__get_insert_overwrite_merge_sql": {"name": "default__get_insert_overwrite_merge_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/merge.sql", "original_file_path": "macros/materializations/models/incremental/merge.sql", "unique_id": "macro.dbt.default__get_insert_overwrite_merge_sql", "macro_sql": "{% macro default__get_insert_overwrite_merge_sql(target, source, dest_columns, predicates, include_sql_header) -%}\n {#-- The only time include_sql_header is True: --#}\n {#-- BigQuery + insert_overwrite strategy + \"static\" partitions config --#}\n {#-- We should consider including the sql header at the materialization level instead --#}\n\n {%- set predicates = [] if predicates is none else [] + predicates -%}\n {%- set dest_cols_csv = get_quoted_csv(dest_columns | map(attribute=\"name\")) -%}\n {%- set sql_header = config.get('sql_header', none) -%}\n\n {{ sql_header if sql_header is not none and include_sql_header }}\n\n merge into {{ target }} as DBT_INTERNAL_DEST\n using {{ source }} as DBT_INTERNAL_SOURCE\n on FALSE\n\n when not matched by source\n {% if predicates %} and {{ predicates | join(' and ') }} {% endif %}\n then delete\n\n when not matched then insert\n ({{ dest_cols_csv }})\n values\n ({{ dest_cols_csv }})\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_quoted_csv"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "target", "type": null, "description": ""}, {"name": "source", "type": null, "description": ""}, {"name": "dest_columns", "type": null, "description": ""}, {"name": "predicates", "type": null, "description": ""}, {"name": "include_sql_header", "type": null, "description": ""}], "created_at": 1789079002.4556448, "supported_languages": null}, "macro.dbt.is_incremental": {"name": "is_incremental", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/is_incremental.sql", "original_file_path": "macros/materializations/models/incremental/is_incremental.sql", "unique_id": "macro.dbt.is_incremental", "macro_sql": "{% macro is_incremental() %}\n {#-- do not run introspective queries in parsing #}\n {% if not execute %}\n {{ return(False) }}\n {% else %}\n {% set relation = adapter.get_relation(this.database, this.schema, this.table) %}\n {{ return(relation is not none\n and relation.type == 'table'\n and model.config.materialized == 'incremental'\n and not should_full_refresh()) }}\n {% endif %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.should_full_refresh"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789079002.456344, "supported_languages": null}, "macro.dbt.date": {"name": "date", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/date.sql", "original_file_path": "macros/utils/date.sql", "unique_id": "macro.dbt.date", "macro_sql": "{% macro date(year, month, day) %}\n {{ return(adapter.dispatch('date', 'dbt') (year, month, day)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__date"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "year", "type": null, "description": ""}, {"name": "month", "type": null, "description": ""}, {"name": "day", "type": null, "description": ""}], "created_at": 1789079002.4567199, "supported_languages": null}, "macro.dbt.default__date": {"name": "default__date", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/date.sql", "original_file_path": "macros/utils/date.sql", "unique_id": "macro.dbt.default__date", "macro_sql": "{% macro default__date(year, month, day) -%}\n {%- set dt = modules.datetime.date(year, month, day) -%}\n {%- set iso_8601_formatted_date = dt.strftime('%Y-%m-%d') -%}\n to_date('{{ iso_8601_formatted_date }}', 'YYYY-MM-DD')\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "year", "type": null, "description": ""}, {"name": "month", "type": null, "description": ""}, {"name": "day", "type": null, "description": ""}], "created_at": 1789079002.4571254, "supported_languages": null}, "macro.dbt.safe_cast": {"name": "safe_cast", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/safe_cast.sql", "original_file_path": "macros/utils/safe_cast.sql", "unique_id": "macro.dbt.safe_cast", "macro_sql": "{% macro safe_cast(field, type) %}\n {{ return(adapter.dispatch('safe_cast', 'dbt') (field, type)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__safe_cast"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field", "type": null, "description": ""}, {"name": "type", "type": null, "description": ""}], "created_at": 1789079002.4574938, "supported_languages": null}, "macro.dbt.default__safe_cast": {"name": "default__safe_cast", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/safe_cast.sql", "original_file_path": "macros/utils/safe_cast.sql", "unique_id": "macro.dbt.default__safe_cast", "macro_sql": "{% macro default__safe_cast(field, type) %}\n {# most databases don't support this function yet\n so we just need to use cast #}\n cast({{field}} as {{type}})\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field", "type": null, "description": ""}, {"name": "type", "type": null, "description": ""}], "created_at": 1789079002.4576626, "supported_languages": null}, "macro.dbt.array_concat": {"name": "array_concat", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/array_concat.sql", "original_file_path": "macros/utils/array_concat.sql", "unique_id": "macro.dbt.array_concat", "macro_sql": "{% macro array_concat(array_1, array_2) -%}\n {{ return(adapter.dispatch('array_concat', 'dbt')(array_1, array_2)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__array_concat"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "array_1", "type": null, "description": ""}, {"name": "array_2", "type": null, "description": ""}], "created_at": 1789079002.458088, "supported_languages": null}, "macro.dbt.default__array_concat": {"name": "default__array_concat", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/array_concat.sql", "original_file_path": "macros/utils/array_concat.sql", "unique_id": "macro.dbt.default__array_concat", "macro_sql": "{% macro default__array_concat(array_1, array_2) -%}\n array_cat({{ array_1 }}, {{ array_2 }})\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "array_1", "type": null, "description": ""}, {"name": "array_2", "type": null, "description": ""}], "created_at": 1789079002.4582636, "supported_languages": null}, "macro.dbt.escape_single_quotes": {"name": "escape_single_quotes", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/escape_single_quotes.sql", "original_file_path": "macros/utils/escape_single_quotes.sql", "unique_id": "macro.dbt.escape_single_quotes", "macro_sql": "{% macro escape_single_quotes(expression) %}\n {{ return(adapter.dispatch('escape_single_quotes', 'dbt') (expression)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__escape_single_quotes"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "expression", "type": null, "description": ""}], "created_at": 1789079002.4585736, "supported_languages": null}, "macro.dbt.default__escape_single_quotes": {"name": "default__escape_single_quotes", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/escape_single_quotes.sql", "original_file_path": "macros/utils/escape_single_quotes.sql", "unique_id": "macro.dbt.default__escape_single_quotes", "macro_sql": "{% macro default__escape_single_quotes(expression) -%}\n{{ expression | replace(\"'\",\"''\") }}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "expression", "type": null, "description": ""}], "created_at": 1789079002.4587443, "supported_languages": null}, "macro.dbt.type_string": {"name": "type_string", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "unique_id": "macro.dbt.type_string", "macro_sql": "\n\n{%- macro type_string() -%}\n {{ return(adapter.dispatch('type_string', 'dbt')()) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt.default__type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789079002.4595191, "supported_languages": null}, "macro.dbt.default__type_string": {"name": "default__type_string", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "unique_id": "macro.dbt.default__type_string", "macro_sql": "{% macro default__type_string() %}\n {{ return(api.Column.translate_type(\"string\")) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789079002.4596999, "supported_languages": null}, "macro.dbt.type_timestamp": {"name": "type_timestamp", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "unique_id": "macro.dbt.type_timestamp", "macro_sql": "\n\n{%- macro type_timestamp() -%}\n {{ return(adapter.dispatch('type_timestamp', 'dbt')()) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt.default__type_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789079002.4599044, "supported_languages": null}, "macro.dbt.default__type_timestamp": {"name": "default__type_timestamp", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "unique_id": "macro.dbt.default__type_timestamp", "macro_sql": "{% macro default__type_timestamp() %}\n {{ return(api.Column.translate_type(\"timestamp\")) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789079002.4600813, "supported_languages": null}, "macro.dbt.type_float": {"name": "type_float", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "unique_id": "macro.dbt.type_float", "macro_sql": "\n\n{%- macro type_float() -%}\n {{ return(adapter.dispatch('type_float', 'dbt')()) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt.default__type_float"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789079002.4602618, "supported_languages": null}, "macro.dbt.default__type_float": {"name": "default__type_float", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "unique_id": "macro.dbt.default__type_float", "macro_sql": "{% macro default__type_float() %}\n {{ return(api.Column.translate_type(\"float\")) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789079002.460434, "supported_languages": null}, "macro.dbt.type_numeric": {"name": "type_numeric", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "unique_id": "macro.dbt.type_numeric", "macro_sql": "\n\n{%- macro type_numeric() -%}\n {{ return(adapter.dispatch('type_numeric', 'dbt')()) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt.default__type_numeric"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789079002.460614, "supported_languages": null}, "macro.dbt.default__type_numeric": {"name": "default__type_numeric", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "unique_id": "macro.dbt.default__type_numeric", "macro_sql": "{% macro default__type_numeric() %}\n {{ return(api.Column.numeric_type(\"numeric\", 28, 6)) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789079002.4608138, "supported_languages": null}, "macro.dbt.type_bigint": {"name": "type_bigint", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "unique_id": "macro.dbt.type_bigint", "macro_sql": "\n\n{%- macro type_bigint() -%}\n {{ return(adapter.dispatch('type_bigint', 'dbt')()) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt.default__type_bigint"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789079002.4610393, "supported_languages": null}, "macro.dbt.default__type_bigint": {"name": "default__type_bigint", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "unique_id": "macro.dbt.default__type_bigint", "macro_sql": "{% macro default__type_bigint() %}\n {{ return(api.Column.translate_type(\"bigint\")) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789079002.461235, "supported_languages": null}, "macro.dbt.type_int": {"name": "type_int", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "unique_id": "macro.dbt.type_int", "macro_sql": "\n\n{%- macro type_int() -%}\n {{ return(adapter.dispatch('type_int', 'dbt')()) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt.default__type_int"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789079002.4614277, "supported_languages": null}, "macro.dbt.default__type_int": {"name": "default__type_int", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "unique_id": "macro.dbt.default__type_int", "macro_sql": "{%- macro default__type_int() -%}\n {{ return(api.Column.translate_type(\"integer\")) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789079002.461596, "supported_languages": null}, "macro.dbt.type_boolean": {"name": "type_boolean", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "unique_id": "macro.dbt.type_boolean", "macro_sql": "\n\n{%- macro type_boolean() -%}\n {{ return(adapter.dispatch('type_boolean', 'dbt')()) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt.default__type_boolean"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789079002.4618785, "supported_languages": null}, "macro.dbt.default__type_boolean": {"name": "default__type_boolean", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "unique_id": "macro.dbt.default__type_boolean", "macro_sql": "{%- macro default__type_boolean() -%}\n {{ return(api.Column.translate_type(\"boolean\")) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789079002.4620564, "supported_languages": null}, "macro.dbt.array_append": {"name": "array_append", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/array_append.sql", "original_file_path": "macros/utils/array_append.sql", "unique_id": "macro.dbt.array_append", "macro_sql": "{% macro array_append(array, new_element) -%}\n {{ return(adapter.dispatch('array_append', 'dbt')(array, new_element)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__array_append"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "array", "type": null, "description": ""}, {"name": "new_element", "type": null, "description": ""}], "created_at": 1789079002.4623775, "supported_languages": null}, "macro.dbt.default__array_append": {"name": "default__array_append", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/array_append.sql", "original_file_path": "macros/utils/array_append.sql", "unique_id": "macro.dbt.default__array_append", "macro_sql": "{% macro default__array_append(array, new_element) -%}\n array_append({{ array }}, {{ new_element }})\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "array", "type": null, "description": ""}, {"name": "new_element", "type": null, "description": ""}], "created_at": 1789079002.4625401, "supported_languages": null}, "macro.dbt.get_powers_of_two": {"name": "get_powers_of_two", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/generate_series.sql", "original_file_path": "macros/utils/generate_series.sql", "unique_id": "macro.dbt.get_powers_of_two", "macro_sql": "{% macro get_powers_of_two(upper_bound) %}\n {{ return(adapter.dispatch('get_powers_of_two', 'dbt')(upper_bound)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_powers_of_two"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "upper_bound", "type": null, "description": ""}], "created_at": 1789079002.4630446, "supported_languages": null}, "macro.dbt.default__get_powers_of_two": {"name": "default__get_powers_of_two", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/generate_series.sql", "original_file_path": "macros/utils/generate_series.sql", "unique_id": "macro.dbt.default__get_powers_of_two", "macro_sql": "{% macro default__get_powers_of_two(upper_bound) %}\n\n {% if upper_bound <= 0 %}\n {{ exceptions.raise_compiler_error(\"upper bound must be positive\") }}\n {% endif %}\n\n {% for _ in range(1, 100) %}\n {% if upper_bound <= 2 ** loop.index %}{{ return(loop.index) }}{% endif %}\n {% endfor %}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "upper_bound", "type": null, "description": ""}], "created_at": 1789079002.4635308, "supported_languages": null}, "macro.dbt.generate_series": {"name": "generate_series", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/generate_series.sql", "original_file_path": "macros/utils/generate_series.sql", "unique_id": "macro.dbt.generate_series", "macro_sql": "{% macro generate_series(upper_bound) %}\n {{ return(adapter.dispatch('generate_series', 'dbt')(upper_bound)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__generate_series"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "upper_bound", "type": null, "description": ""}], "created_at": 1789079002.4637523, "supported_languages": null}, "macro.dbt.default__generate_series": {"name": "default__generate_series", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/generate_series.sql", "original_file_path": "macros/utils/generate_series.sql", "unique_id": "macro.dbt.default__generate_series", "macro_sql": "{% macro default__generate_series(upper_bound) %}\n\n {% set n = dbt.get_powers_of_two(upper_bound) %}\n\n with p as (\n select 0 as generated_number union all select 1\n ), unioned as (\n\n select\n\n {% for i in range(n) %}\n p{{i}}.generated_number * power(2, {{i}})\n {% if not loop.last %} + {% endif %}\n {% endfor %}\n + 1\n as generated_number\n\n from\n\n {% for i in range(n) %}\n p as p{{i}}\n {% if not loop.last %} cross join {% endif %}\n {% endfor %}\n\n )\n\n select *\n from unioned\n where generated_number <= {{upper_bound}}\n order by generated_number\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_powers_of_two"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "upper_bound", "type": null, "description": ""}], "created_at": 1789079002.464358, "supported_languages": null}, "macro.dbt.right": {"name": "right", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/right.sql", "original_file_path": "macros/utils/right.sql", "unique_id": "macro.dbt.right", "macro_sql": "{% macro right(string_text, length_expression) -%}\n {{ return(adapter.dispatch('right', 'dbt') (string_text, length_expression)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__right"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "string_text", "type": null, "description": ""}, {"name": "length_expression", "type": null, "description": ""}], "created_at": 1789079002.464685, "supported_languages": null}, "macro.dbt.default__right": {"name": "default__right", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/right.sql", "original_file_path": "macros/utils/right.sql", "unique_id": "macro.dbt.default__right", "macro_sql": "{% macro default__right(string_text, length_expression) %}\n\n right(\n {{ string_text }},\n {{ length_expression }}\n )\n\n{%- endmacro -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "string_text", "type": null, "description": ""}, {"name": "length_expression", "type": null, "description": ""}], "created_at": 1789079002.464867, "supported_languages": null}, "macro.dbt.hash": {"name": "hash", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/hash.sql", "original_file_path": "macros/utils/hash.sql", "unique_id": "macro.dbt.hash", "macro_sql": "{% macro hash(field) -%}\n {{ return(adapter.dispatch('hash', 'dbt') (field)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__hash"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field", "type": null, "description": ""}], "created_at": 1789079002.4651608, "supported_languages": null}, "macro.dbt.default__hash": {"name": "default__hash", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/hash.sql", "original_file_path": "macros/utils/hash.sql", "unique_id": "macro.dbt.default__hash", "macro_sql": "{% macro default__hash(field) -%}\n md5(cast({{ field }} as {{ api.Column.translate_type('string') }}))\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field", "type": null, "description": ""}], "created_at": 1789079002.4653463, "supported_languages": null}, "macro.dbt.intersect": {"name": "intersect", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/intersect.sql", "original_file_path": "macros/utils/intersect.sql", "unique_id": "macro.dbt.intersect", "macro_sql": "{% macro intersect() %}\n {{ return(adapter.dispatch('intersect', 'dbt')()) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__intersect"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789079002.4656005, "supported_languages": null}, "macro.dbt.default__intersect": {"name": "default__intersect", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/intersect.sql", "original_file_path": "macros/utils/intersect.sql", "unique_id": "macro.dbt.default__intersect", "macro_sql": "{% macro default__intersect() %}\n\n intersect\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789079002.4656954, "supported_languages": null}, "macro.dbt.last_day": {"name": "last_day", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/last_day.sql", "original_file_path": "macros/utils/last_day.sql", "unique_id": "macro.dbt.last_day", "macro_sql": "{% macro last_day(date, datepart) %}\n {{ return(adapter.dispatch('last_day', 'dbt') (date, datepart)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__last_day"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "date", "type": null, "description": ""}, {"name": "datepart", "type": null, "description": ""}], "created_at": 1789079002.4660559, "supported_languages": null}, "macro.dbt.default_last_day": {"name": "default_last_day", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/last_day.sql", "original_file_path": "macros/utils/last_day.sql", "unique_id": "macro.dbt.default_last_day", "macro_sql": "\n\n{%- macro default_last_day(date, datepart) -%}\n cast(\n {{dbt.dateadd('day', '-1',\n dbt.dateadd(datepart, '1', dbt.date_trunc(datepart, date))\n )}}\n as date)\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt.dateadd", "macro.dbt.date_trunc"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "date", "type": null, "description": ""}, {"name": "datepart", "type": null, "description": ""}], "created_at": 1789079002.4663496, "supported_languages": null}, "macro.dbt.default__last_day": {"name": "default__last_day", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/last_day.sql", "original_file_path": "macros/utils/last_day.sql", "unique_id": "macro.dbt.default__last_day", "macro_sql": "{% macro default__last_day(date, datepart) -%}\n {{dbt.default_last_day(date, datepart)}}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default_last_day"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "date", "type": null, "description": ""}, {"name": "datepart", "type": null, "description": ""}], "created_at": 1789079002.4666002, "supported_languages": null}, "macro.dbt.listagg": {"name": "listagg", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/listagg.sql", "original_file_path": "macros/utils/listagg.sql", "unique_id": "macro.dbt.listagg", "macro_sql": "{% macro listagg(measure, delimiter_text=\"','\", order_by_clause=none, limit_num=none) -%}\n {{ return(adapter.dispatch('listagg', 'dbt') (measure, delimiter_text, order_by_clause, limit_num)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__listagg"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "measure", "type": null, "description": ""}, {"name": "delimiter_text", "type": null, "description": ""}, {"name": "order_by_clause", "type": null, "description": ""}, {"name": "limit_num", "type": null, "description": ""}], "created_at": 1789079002.4671068, "supported_languages": null}, "macro.dbt.default__listagg": {"name": "default__listagg", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/listagg.sql", "original_file_path": "macros/utils/listagg.sql", "unique_id": "macro.dbt.default__listagg", "macro_sql": "{% macro default__listagg(measure, delimiter_text, order_by_clause, limit_num) -%}\n\n {% if limit_num -%}\n array_to_string(\n array_slice(\n array_agg(\n {{ measure }}\n ){% if order_by_clause -%}\n within group ({{ order_by_clause }})\n {%- endif %}\n ,0\n ,{{ limit_num }}\n ),\n {{ delimiter_text }}\n )\n {%- else %}\n listagg(\n {{ measure }},\n {{ delimiter_text }}\n )\n {% if order_by_clause -%}\n within group ({{ order_by_clause }})\n {%- endif %}\n {%- endif %}\n\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "measure", "type": null, "description": ""}, {"name": "delimiter_text", "type": null, "description": ""}, {"name": "order_by_clause", "type": null, "description": ""}, {"name": "limit_num", "type": null, "description": ""}], "created_at": 1789079002.4675732, "supported_languages": null}, "macro.dbt.cast_bool_to_text": {"name": "cast_bool_to_text", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/cast_bool_to_text.sql", "original_file_path": "macros/utils/cast_bool_to_text.sql", "unique_id": "macro.dbt.cast_bool_to_text", "macro_sql": "{% macro cast_bool_to_text(field) %}\n {{ adapter.dispatch('cast_bool_to_text', 'dbt') (field) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__cast_bool_to_text"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field", "type": null, "description": ""}], "created_at": 1789079002.467865, "supported_languages": null}, "macro.dbt.default__cast_bool_to_text": {"name": "default__cast_bool_to_text", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/cast_bool_to_text.sql", "original_file_path": "macros/utils/cast_bool_to_text.sql", "unique_id": "macro.dbt.default__cast_bool_to_text", "macro_sql": "{% macro default__cast_bool_to_text(field) %}\n cast({{ field }} as {{ api.Column.translate_type('string') }})\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field", "type": null, "description": ""}], "created_at": 1789079002.4680538, "supported_languages": null}, "macro.dbt.date_trunc": {"name": "date_trunc", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/date_trunc.sql", "original_file_path": "macros/utils/date_trunc.sql", "unique_id": "macro.dbt.date_trunc", "macro_sql": "{% macro date_trunc(datepart, date) -%}\n {{ return(adapter.dispatch('date_trunc', 'dbt') (datepart, date)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__date_trunc"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "datepart", "type": null, "description": ""}, {"name": "date", "type": null, "description": ""}], "created_at": 1789079002.4683542, "supported_languages": null}, "macro.dbt.default__date_trunc": {"name": "default__date_trunc", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/date_trunc.sql", "original_file_path": "macros/utils/date_trunc.sql", "unique_id": "macro.dbt.default__date_trunc", "macro_sql": "{% macro default__date_trunc(datepart, date) -%}\n date_trunc('{{datepart}}', {{date}})\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "datepart", "type": null, "description": ""}, {"name": "date", "type": null, "description": ""}], "created_at": 1789079002.4685102, "supported_languages": null}, "macro.dbt.position": {"name": "position", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/position.sql", "original_file_path": "macros/utils/position.sql", "unique_id": "macro.dbt.position", "macro_sql": "{% macro position(substring_text, string_text) -%}\n {{ return(adapter.dispatch('position', 'dbt') (substring_text, string_text)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__position"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "substring_text", "type": null, "description": ""}, {"name": "string_text", "type": null, "description": ""}], "created_at": 1789079002.4688153, "supported_languages": null}, "macro.dbt.default__position": {"name": "default__position", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/position.sql", "original_file_path": "macros/utils/position.sql", "unique_id": "macro.dbt.default__position", "macro_sql": "{% macro default__position(substring_text, string_text) %}\n\n position(\n {{ substring_text }} in {{ string_text }}\n )\n\n{%- endmacro -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "substring_text", "type": null, "description": ""}, {"name": "string_text", "type": null, "description": ""}], "created_at": 1789079002.4689987, "supported_languages": null}, "macro.dbt.any_value": {"name": "any_value", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/any_value.sql", "original_file_path": "macros/utils/any_value.sql", "unique_id": "macro.dbt.any_value", "macro_sql": "{% macro any_value(expression) -%}\n {{ return(adapter.dispatch('any_value', 'dbt') (expression)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__any_value"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "expression", "type": null, "description": ""}], "created_at": 1789079002.4692762, "supported_languages": null}, "macro.dbt.default__any_value": {"name": "default__any_value", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/any_value.sql", "original_file_path": "macros/utils/any_value.sql", "unique_id": "macro.dbt.default__any_value", "macro_sql": "{% macro default__any_value(expression) -%}\n\n any_value({{ expression }})\n\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "expression", "type": null, "description": ""}], "created_at": 1789079002.4694006, "supported_languages": null}, "macro.dbt.length": {"name": "length", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/length.sql", "original_file_path": "macros/utils/length.sql", "unique_id": "macro.dbt.length", "macro_sql": "{% macro length(expression) -%}\n {{ return(adapter.dispatch('length', 'dbt') (expression)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__length"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "expression", "type": null, "description": ""}], "created_at": 1789079002.4696698, "supported_languages": null}, "macro.dbt.default__length": {"name": "default__length", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/length.sql", "original_file_path": "macros/utils/length.sql", "unique_id": "macro.dbt.default__length", "macro_sql": "{% macro default__length(expression) %}\n\n length(\n {{ expression }}\n )\n\n{%- endmacro -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "expression", "type": null, "description": ""}], "created_at": 1789079002.4697967, "supported_languages": null}, "macro.dbt.cast": {"name": "cast", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/cast.sql", "original_file_path": "macros/utils/cast.sql", "unique_id": "macro.dbt.cast", "macro_sql": "{% macro cast(field, type) %}\n {{ return(adapter.dispatch('cast', 'dbt') (field, type)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__cast"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field", "type": null, "description": ""}, {"name": "type", "type": null, "description": ""}], "created_at": 1789079002.4701216, "supported_languages": null}, "macro.dbt.default__cast": {"name": "default__cast", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/cast.sql", "original_file_path": "macros/utils/cast.sql", "unique_id": "macro.dbt.default__cast", "macro_sql": "{% macro default__cast(field, type) %}\n cast({{field}} as {{type}})\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field", "type": null, "description": ""}, {"name": "type", "type": null, "description": ""}], "created_at": 1789079002.4702766, "supported_languages": null}, "macro.dbt.get_intervals_between": {"name": "get_intervals_between", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/date_spine.sql", "original_file_path": "macros/utils/date_spine.sql", "unique_id": "macro.dbt.get_intervals_between", "macro_sql": "{% macro get_intervals_between(start_date, end_date, datepart) -%}\n {{ return(adapter.dispatch('get_intervals_between', 'dbt')(start_date, end_date, datepart)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_intervals_between"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "start_date", "type": null, "description": ""}, {"name": "end_date", "type": null, "description": ""}, {"name": "datepart", "type": null, "description": ""}], "created_at": 1789079002.4708948, "supported_languages": null}, "macro.dbt.default__get_intervals_between": {"name": "default__get_intervals_between", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/date_spine.sql", "original_file_path": "macros/utils/date_spine.sql", "unique_id": "macro.dbt.default__get_intervals_between", "macro_sql": "{% macro default__get_intervals_between(start_date, end_date, datepart) -%}\n {%- call statement('get_intervals_between', fetch_result=True) %}\n\n select {{ dbt.datediff(start_date, end_date, datepart) }}\n\n {%- endcall -%}\n\n {%- set value_list = load_result('get_intervals_between') -%}\n\n {%- if value_list and value_list['data'] -%}\n {%- set values = value_list['data'] | map(attribute=0) | list %}\n {{ return(values[0]) }}\n {%- else -%}\n {{ return(1) }}\n {%- endif -%}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.statement", "macro.dbt.datediff"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "start_date", "type": null, "description": ""}, {"name": "end_date", "type": null, "description": ""}, {"name": "datepart", "type": null, "description": ""}], "created_at": 1789079002.4715726, "supported_languages": null}, "macro.dbt.date_spine": {"name": "date_spine", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/date_spine.sql", "original_file_path": "macros/utils/date_spine.sql", "unique_id": "macro.dbt.date_spine", "macro_sql": "{% macro date_spine(datepart, start_date, end_date) %}\n {{ return(adapter.dispatch('date_spine', 'dbt')(datepart, start_date, end_date)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__date_spine"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "datepart", "type": null, "description": ""}, {"name": "start_date", "type": null, "description": ""}, {"name": "end_date", "type": null, "description": ""}], "created_at": 1789079002.4718554, "supported_languages": null}, "macro.dbt.default__date_spine": {"name": "default__date_spine", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/date_spine.sql", "original_file_path": "macros/utils/date_spine.sql", "unique_id": "macro.dbt.default__date_spine", "macro_sql": "{% macro default__date_spine(datepart, start_date, end_date) %}\n\n\n {# call as follows:\n\n date_spine(\n \"day\",\n \"to_date('01/01/2016', 'mm/dd/yyyy')\",\n \"dbt.dateadd(week, 1, current_date)\"\n ) #}\n\n\n with rawdata as (\n\n {{dbt.generate_series(\n dbt.get_intervals_between(start_date, end_date, datepart)\n )}}\n\n ),\n\n all_periods as (\n\n select (\n {{\n dbt.dateadd(\n datepart,\n \"row_number() over (order by 1) - 1\",\n start_date\n )\n }}\n ) as date_{{datepart}}\n from rawdata\n\n ),\n\n filtered as (\n\n select *\n from all_periods\n where date_{{datepart}} <= {{ end_date }}\n\n )\n\n select * from filtered\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.generate_series", "macro.dbt.get_intervals_between", "macro.dbt.dateadd"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "datepart", "type": null, "description": ""}, {"name": "start_date", "type": null, "description": ""}, {"name": "end_date", "type": null, "description": ""}], "created_at": 1789079002.472265, "supported_languages": null}, "macro.dbt.datediff": {"name": "datediff", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/datediff.sql", "original_file_path": "macros/utils/datediff.sql", "unique_id": "macro.dbt.datediff", "macro_sql": "{% macro datediff(first_date, second_date, datepart) %}\n {{ return(adapter.dispatch('datediff', 'dbt')(first_date, second_date, datepart)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__datediff"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "first_date", "type": null, "description": ""}, {"name": "second_date", "type": null, "description": ""}, {"name": "datepart", "type": null, "description": ""}], "created_at": 1789079002.472613, "supported_languages": null}, "macro.dbt.default__datediff": {"name": "default__datediff", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/datediff.sql", "original_file_path": "macros/utils/datediff.sql", "unique_id": "macro.dbt.default__datediff", "macro_sql": "{% macro default__datediff(first_date, second_date, datepart) -%}\n\n datediff(\n {{ datepart }},\n {{ first_date }},\n {{ second_date }}\n )\n\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "first_date", "type": null, "description": ""}, {"name": "second_date", "type": null, "description": ""}, {"name": "datepart", "type": null, "description": ""}], "created_at": 1789079002.4728134, "supported_languages": null}, "macro.dbt.equals": {"name": "equals", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/equals.sql", "original_file_path": "macros/utils/equals.sql", "unique_id": "macro.dbt.equals", "macro_sql": "{% macro equals(expr1, expr2) %}\n {{ return(adapter.dispatch('equals', 'dbt') (expr1, expr2)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__equals"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "expr1", "type": null, "description": ""}, {"name": "expr2", "type": null, "description": ""}], "created_at": 1789079002.4732223, "supported_languages": null}, "macro.dbt.default__equals": {"name": "default__equals", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/equals.sql", "original_file_path": "macros/utils/equals.sql", "unique_id": "macro.dbt.default__equals", "macro_sql": "{% macro default__equals(expr1, expr2) -%}\n{%- if adapter.behavior.enable_truthy_nulls_equals_macro.no_warn %}\n case when (({{ expr1 }} = {{ expr2 }}) or ({{ expr1 }} is null and {{ expr2 }} is null))\n then 0\n else 1\n end = 0\n{%- else -%}\n ({{ expr1 }} = {{ expr2 }})\n{%- endif %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "expr1", "type": null, "description": ""}, {"name": "expr2", "type": null, "description": ""}], "created_at": 1789079002.4735522, "supported_languages": null}, "macro.dbt.dateadd": {"name": "dateadd", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/dateadd.sql", "original_file_path": "macros/utils/dateadd.sql", "unique_id": "macro.dbt.dateadd", "macro_sql": "{% macro dateadd(datepart, interval, from_date_or_timestamp) %}\n {{ return(adapter.dispatch('dateadd', 'dbt')(datepart, interval, from_date_or_timestamp)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__dateadd"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "datepart", "type": null, "description": ""}, {"name": "interval", "type": null, "description": ""}, {"name": "from_date_or_timestamp", "type": null, "description": ""}], "created_at": 1789079002.4739265, "supported_languages": null}, "macro.dbt.default__dateadd": {"name": "default__dateadd", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/dateadd.sql", "original_file_path": "macros/utils/dateadd.sql", "unique_id": "macro.dbt.default__dateadd", "macro_sql": "{% macro default__dateadd(datepart, interval, from_date_or_timestamp) %}\n\n dateadd(\n {{ datepart }},\n {{ interval }},\n {{ from_date_or_timestamp }}\n )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "datepart", "type": null, "description": ""}, {"name": "interval", "type": null, "description": ""}, {"name": "from_date_or_timestamp", "type": null, "description": ""}], "created_at": 1789079002.4741225, "supported_languages": null}, "macro.dbt.concat": {"name": "concat", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/concat.sql", "original_file_path": "macros/utils/concat.sql", "unique_id": "macro.dbt.concat", "macro_sql": "{% macro concat(fields) -%}\n {{ return(adapter.dispatch('concat', 'dbt')(fields)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__concat"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "fields", "type": null, "description": ""}], "created_at": 1789079002.4743998, "supported_languages": null}, "macro.dbt.default__concat": {"name": "default__concat", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/concat.sql", "original_file_path": "macros/utils/concat.sql", "unique_id": "macro.dbt.default__concat", "macro_sql": "{% macro default__concat(fields) -%}\n {{ fields|join(' || ') }}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "fields", "type": null, "description": ""}], "created_at": 1789079002.4745483, "supported_languages": null}, "macro.dbt.array_construct": {"name": "array_construct", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/array_construct.sql", "original_file_path": "macros/utils/array_construct.sql", "unique_id": "macro.dbt.array_construct", "macro_sql": "{% macro array_construct(inputs=[], data_type=api.Column.translate_type('integer')) -%}\n {{ return(adapter.dispatch('array_construct', 'dbt')(inputs, data_type)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__array_construct"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "inputs", "type": null, "description": ""}, {"name": "data_type", "type": null, "description": ""}], "created_at": 1789079002.474967, "supported_languages": null}, "macro.dbt.default__array_construct": {"name": "default__array_construct", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/array_construct.sql", "original_file_path": "macros/utils/array_construct.sql", "unique_id": "macro.dbt.default__array_construct", "macro_sql": "{% macro default__array_construct(inputs, data_type) -%}\n {% if inputs|length > 0 %}\n array[ {{ inputs|join(' , ') }} ]\n {% else %}\n array[]::{{data_type}}[]\n {% endif %}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "inputs", "type": null, "description": ""}, {"name": "data_type", "type": null, "description": ""}], "created_at": 1789079002.4752433, "supported_languages": null}, "macro.dbt.split_part": {"name": "split_part", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/split_part.sql", "original_file_path": "macros/utils/split_part.sql", "unique_id": "macro.dbt.split_part", "macro_sql": "{% macro split_part(string_text, delimiter_text, part_number) %}\n {{ return(adapter.dispatch('split_part', 'dbt') (string_text, delimiter_text, part_number)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__split_part"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "string_text", "type": null, "description": ""}, {"name": "delimiter_text", "type": null, "description": ""}, {"name": "part_number", "type": null, "description": ""}], "created_at": 1789079002.4756436, "supported_languages": null}, "macro.dbt.default__split_part": {"name": "default__split_part", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/split_part.sql", "original_file_path": "macros/utils/split_part.sql", "unique_id": "macro.dbt.default__split_part", "macro_sql": "{% macro default__split_part(string_text, delimiter_text, part_number) %}\n\n split_part(\n {{ string_text }},\n {{ delimiter_text }},\n {{ part_number }}\n )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "string_text", "type": null, "description": ""}, {"name": "delimiter_text", "type": null, "description": ""}, {"name": "part_number", "type": null, "description": ""}], "created_at": 1789079002.4759305, "supported_languages": null}, "macro.dbt._split_part_negative": {"name": "_split_part_negative", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/split_part.sql", "original_file_path": "macros/utils/split_part.sql", "unique_id": "macro.dbt._split_part_negative", "macro_sql": "{% macro _split_part_negative(string_text, delimiter_text, part_number) %}\n\n split_part(\n {{ string_text }},\n {{ delimiter_text }},\n length({{ string_text }})\n - length(\n replace({{ string_text }}, {{ delimiter_text }}, '')\n ) + 2 + {{ part_number }}\n )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "string_text", "type": null, "description": ""}, {"name": "delimiter_text", "type": null, "description": ""}, {"name": "part_number", "type": null, "description": ""}], "created_at": 1789079002.4761846, "supported_languages": null}, "macro.dbt.bool_or": {"name": "bool_or", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/bool_or.sql", "original_file_path": "macros/utils/bool_or.sql", "unique_id": "macro.dbt.bool_or", "macro_sql": "{% macro bool_or(expression) -%}\n {{ return(adapter.dispatch('bool_or', 'dbt') (expression)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__bool_or"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "expression", "type": null, "description": ""}], "created_at": 1789079002.4764621, "supported_languages": null}, "macro.dbt.default__bool_or": {"name": "default__bool_or", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/bool_or.sql", "original_file_path": "macros/utils/bool_or.sql", "unique_id": "macro.dbt.default__bool_or", "macro_sql": "{% macro default__bool_or(expression) -%}\n\n bool_or({{ expression }})\n\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "expression", "type": null, "description": ""}], "created_at": 1789079002.4765906, "supported_languages": null}, "macro.dbt.replace": {"name": "replace", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/replace.sql", "original_file_path": "macros/utils/replace.sql", "unique_id": "macro.dbt.replace", "macro_sql": "{% macro replace(field, old_chars, new_chars) -%}\n {{ return(adapter.dispatch('replace', 'dbt') (field, old_chars, new_chars)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__replace"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field", "type": null, "description": ""}, {"name": "old_chars", "type": null, "description": ""}, {"name": "new_chars", "type": null, "description": ""}], "created_at": 1789079002.4769425, "supported_languages": null}, "macro.dbt.default__replace": {"name": "default__replace", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/replace.sql", "original_file_path": "macros/utils/replace.sql", "unique_id": "macro.dbt.default__replace", "macro_sql": "{% macro default__replace(field, old_chars, new_chars) %}\n\n replace(\n {{ field }},\n {{ old_chars }},\n {{ new_chars }}\n )\n\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field", "type": null, "description": ""}, {"name": "old_chars", "type": null, "description": ""}, {"name": "new_chars", "type": null, "description": ""}], "created_at": 1789079002.4771366, "supported_languages": null}, "macro.dbt.string_literal": {"name": "string_literal", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/literal.sql", "original_file_path": "macros/utils/literal.sql", "unique_id": "macro.dbt.string_literal", "macro_sql": "{%- macro string_literal(value) -%}\n {{ return(adapter.dispatch('string_literal', 'dbt') (value)) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt.default__string_literal"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "value", "type": null, "description": ""}], "created_at": 1789079002.4774163, "supported_languages": null}, "macro.dbt.default__string_literal": {"name": "default__string_literal", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/literal.sql", "original_file_path": "macros/utils/literal.sql", "unique_id": "macro.dbt.default__string_literal", "macro_sql": "{% macro default__string_literal(value) -%}\n '{{ value }}'\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "value", "type": null, "description": ""}], "created_at": 1789079002.477542, "supported_languages": null}, "macro.dbt.except": {"name": "except", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/except.sql", "original_file_path": "macros/utils/except.sql", "unique_id": "macro.dbt.except", "macro_sql": "{% macro except() %}\n {{ return(adapter.dispatch('except', 'dbt')()) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__except"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789079002.4777899, "supported_languages": null}, "macro.dbt.default__except": {"name": "default__except", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/except.sql", "original_file_path": "macros/utils/except.sql", "unique_id": "macro.dbt.default__except", "macro_sql": "{% macro default__except() %}\n\n except\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789079002.4779012, "supported_languages": null}, "macro.dbt.statement": {"name": "statement", "resource_type": "macro", "package_name": "dbt", "path": "macros/etc/statement.sql", "original_file_path": "macros/etc/statement.sql", "unique_id": "macro.dbt.statement", "macro_sql": "\n{%- macro statement(name=None, fetch_result=False, auto_begin=True, language='sql') -%}\n {%- if execute: -%}\n {%- set compiled_code = caller() -%}\n\n {%- if name == 'main' -%}\n {{ log('Writing runtime {} for node \"{}\"'.format(language, model['unique_id'])) }}\n {{ write(compiled_code) }}\n {%- endif -%}\n {%- if language == 'sql'-%}\n {%- set res, table = adapter.execute(compiled_code, auto_begin=auto_begin, fetch=fetch_result) -%}\n {%- elif language == 'python' -%}\n {%- set res = submit_python_job(model, compiled_code) -%}\n {#-- TODO: What should table be for python models? --#}\n {%- set table = None -%}\n {%- else -%}\n {% do exceptions.raise_compiler_error(\"statement macro didn't get supported language\") %}\n {%- endif -%}\n\n {%- if name is not none -%}\n {{ store_result(name, response=res, agate_table=table) }}\n {%- endif -%}\n\n {%- endif -%}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "name", "type": null, "description": ""}, {"name": "fetch_result", "type": null, "description": ""}, {"name": "auto_begin", "type": null, "description": ""}, {"name": "language", "type": null, "description": ""}], "created_at": 1789079002.4793038, "supported_languages": null}, "macro.dbt.noop_statement": {"name": "noop_statement", "resource_type": "macro", "package_name": "dbt", "path": "macros/etc/statement.sql", "original_file_path": "macros/etc/statement.sql", "unique_id": "macro.dbt.noop_statement", "macro_sql": "{% macro noop_statement(name=None, message=None, code=None, rows_affected=None, res=None) -%}\n {%- set sql = caller() -%}\n\n {%- if name == 'main' -%}\n {{ log('Writing runtime SQL for node \"{}\"'.format(model['unique_id'])) }}\n {{ write(sql) }}\n {%- endif -%}\n\n {%- if name is not none -%}\n {{ store_raw_result(name, message=message, code=code, rows_affected=rows_affected, agate_table=res) }}\n {%- endif -%}\n\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "name", "type": null, "description": ""}, {"name": "message", "type": null, "description": ""}, {"name": "code", "type": null, "description": ""}, {"name": "rows_affected", "type": null, "description": ""}, {"name": "res", "type": null, "description": ""}], "created_at": 1789079002.480022, "supported_languages": null}, "macro.dbt.run_query": {"name": "run_query", "resource_type": "macro", "package_name": "dbt", "path": "macros/etc/statement.sql", "original_file_path": "macros/etc/statement.sql", "unique_id": "macro.dbt.run_query", "macro_sql": "{% macro run_query(sql) %}\n {% call statement(\"run_query_statement\", fetch_result=true, auto_begin=false) %}\n {{ sql }}\n {% endcall %}\n\n {% do return(load_result(\"run_query_statement\").table) %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "sql", "type": null, "description": ""}], "created_at": 1789079002.4803503, "supported_languages": null}, "macro.dbt.convert_datetime": {"name": "convert_datetime", "resource_type": "macro", "package_name": "dbt", "path": "macros/etc/datetime.sql", "original_file_path": "macros/etc/datetime.sql", "unique_id": "macro.dbt.convert_datetime", "macro_sql": "{% macro convert_datetime(date_str, date_fmt) %}\n\n {% set error_msg -%}\n The provided partition date '{{ date_str }}' does not match the expected format '{{ date_fmt }}'\n {%- endset %}\n\n {% set res = try_or_compiler_error(error_msg, modules.datetime.datetime.strptime, date_str.strip(), date_fmt) %}\n {{ return(res) }}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "date_str", "type": null, "description": ""}, {"name": "date_fmt", "type": null, "description": ""}], "created_at": 1789079002.4811838, "supported_languages": null}, "macro.dbt.dates_in_range": {"name": "dates_in_range", "resource_type": "macro", "package_name": "dbt", "path": "macros/etc/datetime.sql", "original_file_path": "macros/etc/datetime.sql", "unique_id": "macro.dbt.dates_in_range", "macro_sql": "{% macro dates_in_range(start_date_str, end_date_str=none, in_fmt=\"%Y%m%d\", out_fmt=\"%Y%m%d\") %}\n {% set end_date_str = start_date_str if end_date_str is none else end_date_str %}\n\n {% set start_date = convert_datetime(start_date_str, in_fmt) %}\n {% set end_date = convert_datetime(end_date_str, in_fmt) %}\n\n {% set day_count = (end_date - start_date).days %}\n {% if day_count < 0 %}\n {% set msg -%}\n Partition start date is after the end date ({{ start_date }}, {{ end_date }})\n {%- endset %}\n\n {{ exceptions.raise_compiler_error(msg, model) }}\n {% endif %}\n\n {% set date_list = [] %}\n {% for i in range(0, day_count + 1) %}\n {% set the_date = (modules.datetime.timedelta(days=i) + start_date) %}\n {% if not out_fmt %}\n {% set _ = date_list.append(the_date) %}\n {% else %}\n {% set _ = date_list.append(the_date.strftime(out_fmt)) %}\n {% endif %}\n {% endfor %}\n\n {{ return(date_list) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.convert_datetime"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "start_date_str", "type": null, "description": ""}, {"name": "end_date_str", "type": null, "description": ""}, {"name": "in_fmt", "type": null, "description": ""}, {"name": "out_fmt", "type": null, "description": ""}], "created_at": 1789079002.4825168, "supported_languages": null}, "macro.dbt.partition_range": {"name": "partition_range", "resource_type": "macro", "package_name": "dbt", "path": "macros/etc/datetime.sql", "original_file_path": "macros/etc/datetime.sql", "unique_id": "macro.dbt.partition_range", "macro_sql": "{% macro partition_range(raw_partition_date, date_fmt='%Y%m%d') %}\n {% set partition_range = (raw_partition_date | string).split(\",\") %}\n\n {% if (partition_range | length) == 1 %}\n {% set start_date = partition_range[0] %}\n {% set end_date = none %}\n {% elif (partition_range | length) == 2 %}\n {% set start_date = partition_range[0] %}\n {% set end_date = partition_range[1] %}\n {% else %}\n {{ exceptions.raise_compiler_error(\"Invalid partition time. Expected format: {Start Date}[,{End Date}]. Got: \" ~ raw_partition_date) }}\n {% endif %}\n\n {{ return(dates_in_range(start_date, end_date, in_fmt=date_fmt)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.dates_in_range"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "raw_partition_date", "type": null, "description": ""}, {"name": "date_fmt", "type": null, "description": ""}], "created_at": 1789079002.4833634, "supported_languages": null}, "macro.dbt.py_current_timestring": {"name": "py_current_timestring", "resource_type": "macro", "package_name": "dbt", "path": "macros/etc/datetime.sql", "original_file_path": "macros/etc/datetime.sql", "unique_id": "macro.dbt.py_current_timestring", "macro_sql": "{% macro py_current_timestring() %}\n {% set dt = modules.datetime.datetime.now() %}\n {% do return(dt.strftime(\"%Y%m%d%H%M%S%f\")) %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789079002.4836247, "supported_languages": null}, "macro.dbt.resolve_model_name": {"name": "resolve_model_name", "resource_type": "macro", "package_name": "dbt", "path": "macros/python_model/python.sql", "original_file_path": "macros/python_model/python.sql", "unique_id": "macro.dbt.resolve_model_name", "macro_sql": "{% macro resolve_model_name(input_model_name) %}\n {{ return(adapter.dispatch('resolve_model_name', 'dbt')(input_model_name)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__resolve_model_name"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "input_model_name", "type": null, "description": ""}], "created_at": 1789079002.4845457, "supported_languages": null}, "macro.dbt.default__resolve_model_name": {"name": "default__resolve_model_name", "resource_type": "macro", "package_name": "dbt", "path": "macros/python_model/python.sql", "original_file_path": "macros/python_model/python.sql", "unique_id": "macro.dbt.default__resolve_model_name", "macro_sql": "\n\n{%- macro default__resolve_model_name(input_model_name) -%}\n {{ input_model_name | string | replace('\"', '\\\"') }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "input_model_name", "type": null, "description": ""}], "created_at": 1789079002.4847345, "supported_languages": null}, "macro.dbt.build_ref_function": {"name": "build_ref_function", "resource_type": "macro", "package_name": "dbt", "path": "macros/python_model/python.sql", "original_file_path": "macros/python_model/python.sql", "unique_id": "macro.dbt.build_ref_function", "macro_sql": "{% macro build_ref_function(model) %}\n\n {%- set ref_dict = {} -%}\n {%- for _ref in model.refs -%}\n {% set _ref_args = [_ref.get('package'), _ref['name']] if _ref.get('package') else [_ref['name'],] %}\n {%- set resolved = ref(*_ref_args, v=_ref.get('version')) -%}\n\n {#\n We want to get the string of the returned relation by calling .render() in order to skip sample/empty\n mode rendering logic. However, people override the default ref macro, and often return a string instead\n of a relation (like the ref macro does by default). Thus, to make sure we dont blow things up, we have\n to ensure the resolved relation has a .render() method.\n #}\n {%- if resolved.render is defined and resolved.render is callable -%}\n {%- set resolved = resolved.render() -%}\n {%- endif -%}\n\n {%- if _ref.get('version') -%}\n {% do _ref_args.extend([\"v\" ~ _ref['version']]) %}\n {%- endif -%}\n {%- do ref_dict.update({_ref_args | join('.'): resolve_model_name(resolved)}) -%}\n {%- endfor -%}\n\ndef ref(*args, **kwargs):\n refs = {{ ref_dict | tojson }}\n key = '.'.join(args)\n version = kwargs.get(\"v\") or kwargs.get(\"version\")\n if version:\n key += f\".v{version}\"\n dbt_load_df_function = kwargs.get(\"dbt_load_df_function\")\n return dbt_load_df_function(refs[key])\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.resolve_model_name"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}], "created_at": 1789079002.4857903, "supported_languages": null}, "macro.dbt.build_source_function": {"name": "build_source_function", "resource_type": "macro", "package_name": "dbt", "path": "macros/python_model/python.sql", "original_file_path": "macros/python_model/python.sql", "unique_id": "macro.dbt.build_source_function", "macro_sql": "{% macro build_source_function(model) %}\n\n {%- set source_dict = {} -%}\n {%- for _source in model.sources -%}\n {%- set resolved = source(*_source) -%}\n {%- do source_dict.update({_source | join('.'): resolve_model_name(resolved)}) -%}\n {%- endfor -%}\n\ndef source(*args, dbt_load_df_function):\n sources = {{ source_dict | tojson }}\n key = '.'.join(args)\n return dbt_load_df_function(sources[key])\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.resolve_model_name"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}], "created_at": 1789079002.4862778, "supported_languages": null}, "macro.dbt.build_config_dict": {"name": "build_config_dict", "resource_type": "macro", "package_name": "dbt", "path": "macros/python_model/python.sql", "original_file_path": "macros/python_model/python.sql", "unique_id": "macro.dbt.build_config_dict", "macro_sql": "{% macro build_config_dict(model) %}\n {%- set config_dict = {} -%}\n {% set config_dbt_used = zip(model.config.config_keys_used, model.config.config_keys_defaults) | list %}\n {%- for key, default in config_dbt_used -%}\n {# weird type testing with enum, would be much easier to write this logic in Python! #}\n {%- if key == \"language\" -%}\n {%- set value = \"python\" -%}\n {%- endif -%}\n {%- set value = model.config.get(key, default) -%}\n {%- do config_dict.update({key: value}) -%}\n {%- endfor -%}\n {# Handle dbt.config.meta_get() calls - use separate dict to avoid overwriting native configs #}\n {%- set meta_dict = {} -%}\n {%- if model.config.meta_keys_used -%}\n {% set meta_dbt_used = zip(model.config.meta_keys_used, model.config.meta_keys_defaults) | list %}\n {%- for key, default in meta_dbt_used -%}\n {%- if model.config.meta and key in model.config.meta -%}\n {%- set value = model.config.meta[key] -%}\n {%- else -%}\n {%- set value = default -%}\n {%- endif -%}\n {%- do meta_dict.update({key: value}) -%}\n {%- endfor -%}\n {%- endif -%}\nconfig_dict = {{ config_dict }}\nmeta_dict = {{ meta_dict }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}], "created_at": 1789079002.487545, "supported_languages": null}, "macro.dbt.py_script_postfix": {"name": "py_script_postfix", "resource_type": "macro", "package_name": "dbt", "path": "macros/python_model/python.sql", "original_file_path": "macros/python_model/python.sql", "unique_id": "macro.dbt.py_script_postfix", "macro_sql": "{% macro py_script_postfix(model) %}\n# This part is user provided model code\n# you will need to copy the next section to run the code\n# COMMAND ----------\n# this part is dbt logic for get ref work, do not modify\n\n{{ build_ref_function(model ) }}\n{{ build_source_function(model ) }}\n{{ build_config_dict(model) }}\n\nclass config:\n def __init__(self, *args, **kwargs):\n pass\n\n @staticmethod\n def get(key, default=None):\n return config_dict.get(key, default)\n\n @staticmethod\n def meta_get(key, default=None):\n return meta_dict.get(key, default)\n\nclass this:\n \"\"\"dbt.this() or dbt.this.identifier\"\"\"\n database = \"{{ this.database }}\"\n schema = \"{{ this.schema }}\"\n identifier = \"{{ this.identifier }}\"\n {% set this_relation_name = resolve_model_name(this) %}\n def __repr__(self):\n return '{{ this_relation_name }}'\n\n\nclass dbtObj:\n def __init__(self, load_df_function) -> None:\n self.source = lambda *args: source(*args, dbt_load_df_function=load_df_function)\n self.ref = lambda *args, **kwargs: ref(*args, **kwargs, dbt_load_df_function=load_df_function)\n self.config = config\n self.this = this()\n self.is_incremental = {{ is_incremental() }}\n\n# COMMAND ----------\n{{py_script_comment()}}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.build_ref_function", "macro.dbt.build_source_function", "macro.dbt.build_config_dict", "macro.dbt.resolve_model_name", "macro.dbt.is_incremental", "macro.dbt.py_script_comment"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}], "created_at": 1789079002.488393, "supported_languages": null}, "macro.dbt.py_script_comment": {"name": "py_script_comment", "resource_type": "macro", "package_name": "dbt", "path": "macros/python_model/python.sql", "original_file_path": "macros/python_model/python.sql", "unique_id": "macro.dbt.py_script_comment", "macro_sql": "{%macro py_script_comment()%}\n{%endmacro%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789079002.4885023, "supported_languages": null}, "macro.dbt.generate_schema_name": {"name": "generate_schema_name", "resource_type": "macro", "package_name": "dbt", "path": "macros/get_custom_name/get_custom_schema.sql", "original_file_path": "macros/get_custom_name/get_custom_schema.sql", "unique_id": "macro.dbt.generate_schema_name", "macro_sql": "{% macro generate_schema_name(custom_schema_name=none, node=none) -%}\n {{ return(adapter.dispatch('generate_schema_name', 'dbt')(custom_schema_name, node)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__generate_schema_name"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "custom_schema_name", "type": null, "description": ""}, {"name": "node", "type": null, "description": ""}], "created_at": 1789079002.4890165, "supported_languages": null}, "macro.dbt.default__generate_schema_name": {"name": "default__generate_schema_name", "resource_type": "macro", "package_name": "dbt", "path": "macros/get_custom_name/get_custom_schema.sql", "original_file_path": "macros/get_custom_name/get_custom_schema.sql", "unique_id": "macro.dbt.default__generate_schema_name", "macro_sql": "{% macro default__generate_schema_name(custom_schema_name, node) -%}\n\n {%- set default_schema = target.schema -%}\n {%- if custom_schema_name is none -%}\n\n {{ default_schema }}\n\n {%- else -%}\n\n {{ default_schema }}_{{ custom_schema_name | trim }}\n\n {%- endif -%}\n\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "custom_schema_name", "type": null, "description": ""}, {"name": "node", "type": null, "description": ""}], "created_at": 1789079002.4893236, "supported_languages": null}, "macro.dbt.generate_schema_name_for_env": {"name": "generate_schema_name_for_env", "resource_type": "macro", "package_name": "dbt", "path": "macros/get_custom_name/get_custom_schema.sql", "original_file_path": "macros/get_custom_name/get_custom_schema.sql", "unique_id": "macro.dbt.generate_schema_name_for_env", "macro_sql": "{% macro generate_schema_name_for_env(custom_schema_name, node) -%}\n\n {%- set default_schema = target.schema -%}\n {%- if target.name == 'prod' and custom_schema_name is not none -%}\n\n {{ custom_schema_name | trim }}\n\n {%- else -%}\n\n {{ default_schema }}\n\n {%- endif -%}\n\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "custom_schema_name", "type": null, "description": ""}, {"name": "node", "type": null, "description": ""}], "created_at": 1789079002.4896421, "supported_languages": null}, "macro.dbt.generate_latest_version_pointer_alias": {"name": "generate_latest_version_pointer_alias", "resource_type": "macro", "package_name": "dbt", "path": "macros/get_custom_name/get_latest_version_pointer_alias.sql", "original_file_path": "macros/get_custom_name/get_latest_version_pointer_alias.sql", "unique_id": "macro.dbt.generate_latest_version_pointer_alias", "macro_sql": "{% macro generate_latest_version_pointer_alias(custom_alias_name=none, node=none) -%}\n {% do return(adapter.dispatch('generate_latest_version_pointer_alias', 'dbt')(custom_alias_name, node)) %}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__generate_latest_version_pointer_alias"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "custom_alias_name", "type": null, "description": ""}, {"name": "node", "type": null, "description": ""}], "created_at": 1789079002.4900584, "supported_languages": null}, "macro.dbt.default__generate_latest_version_pointer_alias": {"name": "default__generate_latest_version_pointer_alias", "resource_type": "macro", "package_name": "dbt", "path": "macros/get_custom_name/get_latest_version_pointer_alias.sql", "original_file_path": "macros/get_custom_name/get_latest_version_pointer_alias.sql", "unique_id": "macro.dbt.default__generate_latest_version_pointer_alias", "macro_sql": "{% macro default__generate_latest_version_pointer_alias(custom_alias_name=none, node=none) -%}\n {%- if custom_alias_name -%}\n {{ custom_alias_name | trim }}\n {%- else -%}\n {{ node.name }}\n {%- endif -%}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "custom_alias_name", "type": null, "description": ""}, {"name": "node", "type": null, "description": ""}], "created_at": 1789079002.49031, "supported_languages": null}, "macro.dbt.generate_database_name": {"name": "generate_database_name", "resource_type": "macro", "package_name": "dbt", "path": "macros/get_custom_name/get_custom_database.sql", "original_file_path": "macros/get_custom_name/get_custom_database.sql", "unique_id": "macro.dbt.generate_database_name", "macro_sql": "{% macro generate_database_name(custom_database_name=none, node=none) -%}\n {% do return(adapter.dispatch('generate_database_name', 'dbt')(custom_database_name, node)) %}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__generate_database_name"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "custom_database_name", "type": null, "description": ""}, {"name": "node", "type": null, "description": ""}], "created_at": 1789079002.490748, "supported_languages": null}, "macro.dbt.default__generate_database_name": {"name": "default__generate_database_name", "resource_type": "macro", "package_name": "dbt", "path": "macros/get_custom_name/get_custom_database.sql", "original_file_path": "macros/get_custom_name/get_custom_database.sql", "unique_id": "macro.dbt.default__generate_database_name", "macro_sql": "{% macro default__generate_database_name(custom_database_name=none, node=none) -%}\n {%- set default_database = target.database -%}\n {%- if node is not none and node|attr('database') -%}\n {%- set catalog_relation = adapter.build_catalog_relation(node) -%}\n {%- if catalog_relation and catalog_relation|attr('catalog_database') -%}\n {{ return(catalog_relation.catalog_database) }}\n {%- endif -%}\n {%- endif -%}\n {%- if custom_database_name is none -%}\n\n {{ default_database }}\n\n {%- else -%}\n\n {{ custom_database_name }}\n\n {%- endif -%}\n\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "custom_database_name", "type": null, "description": ""}, {"name": "node", "type": null, "description": ""}], "created_at": 1789079002.4913616, "supported_languages": null}, "macro.dbt.generate_alias_name": {"name": "generate_alias_name", "resource_type": "macro", "package_name": "dbt", "path": "macros/get_custom_name/get_custom_alias.sql", "original_file_path": "macros/get_custom_name/get_custom_alias.sql", "unique_id": "macro.dbt.generate_alias_name", "macro_sql": "{% macro generate_alias_name(custom_alias_name=none, node=none) -%}\n {% do return(adapter.dispatch('generate_alias_name', 'dbt')(custom_alias_name, node)) %}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__generate_alias_name"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "custom_alias_name", "type": null, "description": ""}, {"name": "node", "type": null, "description": ""}], "created_at": 1789079002.4917898, "supported_languages": null}, "macro.dbt.default__generate_alias_name": {"name": "default__generate_alias_name", "resource_type": "macro", "package_name": "dbt", "path": "macros/get_custom_name/get_custom_alias.sql", "original_file_path": "macros/get_custom_name/get_custom_alias.sql", "unique_id": "macro.dbt.default__generate_alias_name", "macro_sql": "{% macro default__generate_alias_name(custom_alias_name=none, node=none) -%}\n\n {%- if custom_alias_name -%}\n\n {{ custom_alias_name | trim }}\n\n {%- elif node.version -%}\n\n {{ return(node.name ~ \"_v\" ~ (node.version | replace(\".\", \"_\"))) }}\n\n {%- else -%}\n\n {{ node.name }}\n\n {%- endif -%}\n\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "custom_alias_name", "type": null, "description": ""}, {"name": "node", "type": null, "description": ""}], "created_at": 1789079002.492237, "supported_languages": null}, "macro.dbt.get_show_sql": {"name": "get_show_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/show.sql", "original_file_path": "macros/adapters/show.sql", "unique_id": "macro.dbt.get_show_sql", "macro_sql": "{% macro get_show_sql(compiled_code, sql_header, limit) -%}\n {%- if sql_header is not none -%}\n {{ sql_header }}\n {%- endif %}\n {{ get_limit_subquery_sql(compiled_code, limit) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_limit_subquery_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "compiled_code", "type": null, "description": ""}, {"name": "sql_header", "type": null, "description": ""}, {"name": "limit", "type": null, "description": ""}], "created_at": 1789079002.4926755, "supported_languages": null}, "macro.dbt.get_limit_subquery_sql": {"name": "get_limit_subquery_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/show.sql", "original_file_path": "macros/adapters/show.sql", "unique_id": "macro.dbt.get_limit_subquery_sql", "macro_sql": "\n{%- macro get_limit_subquery_sql(sql, limit) -%}\n {{ adapter.dispatch('get_limit_sql', 'dbt')(sql, limit) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt.default__get_limit_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "sql", "type": null, "description": ""}, {"name": "limit", "type": null, "description": ""}], "created_at": 1789079002.4929054, "supported_languages": null}, "macro.dbt.default__get_limit_sql": {"name": "default__get_limit_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/show.sql", "original_file_path": "macros/adapters/show.sql", "unique_id": "macro.dbt.default__get_limit_sql", "macro_sql": "{% macro default__get_limit_sql(sql, limit) %}\n {{ sql }}\n {% if limit is not none %}\n limit {{ limit }}\n {%- endif -%}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "sql", "type": null, "description": ""}, {"name": "limit", "type": null, "description": ""}], "created_at": 1789079002.4931324, "supported_languages": null}, "macro.dbt.current_timestamp": {"name": "current_timestamp", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/timestamps.sql", "original_file_path": "macros/adapters/timestamps.sql", "unique_id": "macro.dbt.current_timestamp", "macro_sql": "{%- macro current_timestamp() -%}\n {{ adapter.dispatch('current_timestamp', 'dbt')() }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt_postgres.postgres__current_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789079002.4936426, "supported_languages": null}, "macro.dbt.default__current_timestamp": {"name": "default__current_timestamp", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/timestamps.sql", "original_file_path": "macros/adapters/timestamps.sql", "unique_id": "macro.dbt.default__current_timestamp", "macro_sql": "{% macro default__current_timestamp() -%}\n {{ exceptions.raise_not_implemented(\n 'current_timestamp macro not implemented for adapter ' + adapter.type()) }}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789079002.4938266, "supported_languages": null}, "macro.dbt.snapshot_get_time": {"name": "snapshot_get_time", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/timestamps.sql", "original_file_path": "macros/adapters/timestamps.sql", "unique_id": "macro.dbt.snapshot_get_time", "macro_sql": "\n\n{%- macro snapshot_get_time() -%}\n {{ adapter.dispatch('snapshot_get_time', 'dbt')() }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt_postgres.postgres__snapshot_get_time"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789079002.4940886, "supported_languages": null}, "macro.dbt.default__snapshot_get_time": {"name": "default__snapshot_get_time", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/timestamps.sql", "original_file_path": "macros/adapters/timestamps.sql", "unique_id": "macro.dbt.default__snapshot_get_time", "macro_sql": "{% macro default__snapshot_get_time() %}\n {{ current_timestamp() }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.current_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789079002.4942272, "supported_languages": null}, "macro.dbt.get_snapshot_get_time_data_type": {"name": "get_snapshot_get_time_data_type", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/timestamps.sql", "original_file_path": "macros/adapters/timestamps.sql", "unique_id": "macro.dbt.get_snapshot_get_time_data_type", "macro_sql": "{% macro get_snapshot_get_time_data_type() %}\n {% set snapshot_time = adapter.dispatch('snapshot_get_time', 'dbt')() %}\n {% set time_data_type_sql = 'select ' ~ snapshot_time ~ ' as dbt_snapshot_time' %}\n {% set snapshot_time_column_schema = get_column_schema_from_query(time_data_type_sql) %}\n {% set time_data_type = snapshot_time_column_schema[0].dtype %}\n {{ return(time_data_type or none) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.snapshot_get_time", "macro.dbt_postgres.postgres__snapshot_get_time", "macro.dbt.get_column_schema_from_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789079002.4946923, "supported_languages": null}, "macro.dbt.current_timestamp_backcompat": {"name": "current_timestamp_backcompat", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/timestamps.sql", "original_file_path": "macros/adapters/timestamps.sql", "unique_id": "macro.dbt.current_timestamp_backcompat", "macro_sql": "{% macro current_timestamp_backcompat() %}\n {{ return(adapter.dispatch('current_timestamp_backcompat', 'dbt')()) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__current_timestamp_backcompat"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789079002.4948962, "supported_languages": null}, "macro.dbt.default__current_timestamp_backcompat": {"name": "default__current_timestamp_backcompat", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/timestamps.sql", "original_file_path": "macros/adapters/timestamps.sql", "unique_id": "macro.dbt.default__current_timestamp_backcompat", "macro_sql": "{% macro default__current_timestamp_backcompat() %}\n current_timestamp::timestamp\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789079002.4949946, "supported_languages": null}, "macro.dbt.current_timestamp_in_utc_backcompat": {"name": "current_timestamp_in_utc_backcompat", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/timestamps.sql", "original_file_path": "macros/adapters/timestamps.sql", "unique_id": "macro.dbt.current_timestamp_in_utc_backcompat", "macro_sql": "{% macro current_timestamp_in_utc_backcompat() %}\n {{ return(adapter.dispatch('current_timestamp_in_utc_backcompat', 'dbt')()) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__current_timestamp_in_utc_backcompat"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789079002.4951758, "supported_languages": null}, "macro.dbt.default__current_timestamp_in_utc_backcompat": {"name": "default__current_timestamp_in_utc_backcompat", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/timestamps.sql", "original_file_path": "macros/adapters/timestamps.sql", "unique_id": "macro.dbt.default__current_timestamp_in_utc_backcompat", "macro_sql": "{% macro default__current_timestamp_in_utc_backcompat() %}\n {{ return(adapter.dispatch('current_timestamp_backcompat', 'dbt')()) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.current_timestamp_backcompat", "macro.dbt_postgres.postgres__current_timestamp_backcompat"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789079002.495359, "supported_languages": null}, "macro.dbt.create_schema": {"name": "create_schema", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/schema.sql", "original_file_path": "macros/adapters/schema.sql", "unique_id": "macro.dbt.create_schema", "macro_sql": "{% macro create_schema(relation) -%}\n {{ adapter.dispatch('create_schema', 'dbt')(relation) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__create_schema"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789079002.495715, "supported_languages": null}, "macro.dbt.default__create_schema": {"name": "default__create_schema", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/schema.sql", "original_file_path": "macros/adapters/schema.sql", "unique_id": "macro.dbt.default__create_schema", "macro_sql": "{% macro default__create_schema(relation) -%}\n {%- call statement('create_schema') -%}\n create schema if not exists {{ relation.without_identifier() }}\n {% endcall %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789079002.495942, "supported_languages": null}, "macro.dbt.drop_schema": {"name": "drop_schema", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/schema.sql", "original_file_path": "macros/adapters/schema.sql", "unique_id": "macro.dbt.drop_schema", "macro_sql": "{% macro drop_schema(relation) -%}\n {{ adapter.dispatch('drop_schema', 'dbt')(relation) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__drop_schema"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789079002.4961252, "supported_languages": null}, "macro.dbt.default__drop_schema": {"name": "default__drop_schema", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/schema.sql", "original_file_path": "macros/adapters/schema.sql", "unique_id": "macro.dbt.default__drop_schema", "macro_sql": "{% macro default__drop_schema(relation) -%}\n {%- call statement('drop_schema') -%}\n drop schema if exists {{ relation.without_identifier() }} cascade\n {% endcall %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789079002.4963293, "supported_languages": null}, "macro.dbt.copy_grants": {"name": "copy_grants", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "unique_id": "macro.dbt.copy_grants", "macro_sql": "{% macro copy_grants() %}\n {{ return(adapter.dispatch('copy_grants', 'dbt')()) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__copy_grants"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789079002.497558, "supported_languages": null}, "macro.dbt.default__copy_grants": {"name": "default__copy_grants", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "unique_id": "macro.dbt.default__copy_grants", "macro_sql": "{% macro default__copy_grants() %}\n {{ return(True) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789079002.497701, "supported_languages": null}, "macro.dbt.support_multiple_grantees_per_dcl_statement": {"name": "support_multiple_grantees_per_dcl_statement", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "unique_id": "macro.dbt.support_multiple_grantees_per_dcl_statement", "macro_sql": "{% macro support_multiple_grantees_per_dcl_statement() %}\n {{ return(adapter.dispatch('support_multiple_grantees_per_dcl_statement', 'dbt')()) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__support_multiple_grantees_per_dcl_statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789079002.497902, "supported_languages": null}, "macro.dbt.default__support_multiple_grantees_per_dcl_statement": {"name": "default__support_multiple_grantees_per_dcl_statement", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "unique_id": "macro.dbt.default__support_multiple_grantees_per_dcl_statement", "macro_sql": "\n\n{%- macro default__support_multiple_grantees_per_dcl_statement() -%}\n {{ return(True) }}\n{%- endmacro -%}\n\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789079002.4980433, "supported_languages": null}, "macro.dbt.should_revoke": {"name": "should_revoke", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "unique_id": "macro.dbt.should_revoke", "macro_sql": "{% macro should_revoke(existing_relation, full_refresh_mode=True) %}\n\n {% if not existing_relation %}\n {#-- The table doesn't already exist, so no grants to copy over --#}\n {{ return(False) }}\n {% elif full_refresh_mode %}\n {#-- The object is being REPLACED -- whether grants are copied over depends on the value of user config --#}\n {{ return(copy_grants()) }}\n {% else %}\n {#-- The table is being merged/upserted/inserted -- grants will be carried over --#}\n {{ return(True) }}\n {% endif %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.copy_grants"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "existing_relation", "type": null, "description": ""}, {"name": "full_refresh_mode", "type": null, "description": ""}], "created_at": 1789079002.4985101, "supported_languages": null}, "macro.dbt.get_show_grant_sql": {"name": "get_show_grant_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "unique_id": "macro.dbt.get_show_grant_sql", "macro_sql": "{% macro get_show_grant_sql(relation) %}\n {{ return(adapter.dispatch(\"get_show_grant_sql\", \"dbt\")(relation)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__get_show_grant_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789079002.4987285, "supported_languages": null}, "macro.dbt.default__get_show_grant_sql": {"name": "default__get_show_grant_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "unique_id": "macro.dbt.default__get_show_grant_sql", "macro_sql": "{% macro default__get_show_grant_sql(relation) %}\n show grants on {{ relation.render() }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789079002.4988847, "supported_languages": null}, "macro.dbt.get_grant_sql": {"name": "get_grant_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "unique_id": "macro.dbt.get_grant_sql", "macro_sql": "{% macro get_grant_sql(relation, privilege, grantees) %}\n {{ return(adapter.dispatch('get_grant_sql', 'dbt')(relation, privilege, grantees)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_grant_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "privilege", "type": null, "description": ""}, {"name": "grantees", "type": null, "description": ""}], "created_at": 1789079002.4991384, "supported_languages": null}, "macro.dbt.default__get_grant_sql": {"name": "default__get_grant_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "unique_id": "macro.dbt.default__get_grant_sql", "macro_sql": "\n\n{%- macro default__get_grant_sql(relation, privilege, grantees) -%}\n grant {{ privilege }} on {{ relation.render() }} to {{ grantees | join(', ') }}\n{%- endmacro -%}\n\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "privilege", "type": null, "description": ""}, {"name": "grantees", "type": null, "description": ""}], "created_at": 1789079002.4993806, "supported_languages": null}, "macro.dbt.get_revoke_sql": {"name": "get_revoke_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "unique_id": "macro.dbt.get_revoke_sql", "macro_sql": "{% macro get_revoke_sql(relation, privilege, grantees) %}\n {{ return(adapter.dispatch('get_revoke_sql', 'dbt')(relation, privilege, grantees)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_revoke_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "privilege", "type": null, "description": ""}, {"name": "grantees", "type": null, "description": ""}], "created_at": 1789079002.499642, "supported_languages": null}, "macro.dbt.default__get_revoke_sql": {"name": "default__get_revoke_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "unique_id": "macro.dbt.default__get_revoke_sql", "macro_sql": "\n\n{%- macro default__get_revoke_sql(relation, privilege, grantees) -%}\n {%- set quoted_grantees = [] -%}\n {%- for grantee in grantees -%}\n {%- do quoted_grantees.append(adapter.quote(grantee)) -%}\n {%- endfor -%}\n revoke {{ privilege }} on {{ relation.render() }} from {{ quoted_grantees | join(', ') }}\n{%- endmacro -%}\n\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "privilege", "type": null, "description": ""}, {"name": "grantees", "type": null, "description": ""}], "created_at": 1789079002.500081, "supported_languages": null}, "macro.dbt.get_dcl_statement_list": {"name": "get_dcl_statement_list", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "unique_id": "macro.dbt.get_dcl_statement_list", "macro_sql": "{% macro get_dcl_statement_list(relation, grant_config, get_dcl_macro) %}\n {{ return(adapter.dispatch('get_dcl_statement_list', 'dbt')(relation, grant_config, get_dcl_macro)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_dcl_statement_list"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "grant_config", "type": null, "description": ""}, {"name": "get_dcl_macro", "type": null, "description": ""}], "created_at": 1789079002.5003345, "supported_languages": null}, "macro.dbt.default__get_dcl_statement_list": {"name": "default__get_dcl_statement_list", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "unique_id": "macro.dbt.default__get_dcl_statement_list", "macro_sql": "\n\n{%- macro default__get_dcl_statement_list(relation, grant_config, get_dcl_macro) -%}\n {#\n -- Unpack grant_config into specific privileges and the set of users who need them granted/revoked.\n -- Depending on whether this database supports multiple grantees per statement, pass in the list of\n -- all grantees per privilege, or (if not) template one statement per privilege-grantee pair.\n -- `get_dcl_macro` will be either `get_grant_sql` or `get_revoke_sql`\n #}\n {%- set dcl_statements = [] -%}\n {%- for privilege, grantees in grant_config.items() %}\n {%- if support_multiple_grantees_per_dcl_statement() and grantees -%}\n {%- set dcl = get_dcl_macro(relation, privilege, grantees) -%}\n {%- do dcl_statements.append(dcl) -%}\n {%- else -%}\n {%- for grantee in grantees -%}\n {% set dcl = get_dcl_macro(relation, privilege, [grantee]) %}\n {%- do dcl_statements.append(dcl) -%}\n {% endfor -%}\n {%- endif -%}\n {%- endfor -%}\n {{ return(dcl_statements) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.support_multiple_grantees_per_dcl_statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "grant_config", "type": null, "description": ""}, {"name": "get_dcl_macro", "type": null, "description": ""}], "created_at": 1789079002.5010939, "supported_languages": null}, "macro.dbt.call_dcl_statements": {"name": "call_dcl_statements", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "unique_id": "macro.dbt.call_dcl_statements", "macro_sql": "{% macro call_dcl_statements(dcl_statement_list) %}\n {{ return(adapter.dispatch(\"call_dcl_statements\", \"dbt\")(dcl_statement_list)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__call_dcl_statements"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "dcl_statement_list", "type": null, "description": ""}], "created_at": 1789079002.5013094, "supported_languages": null}, "macro.dbt.default__call_dcl_statements": {"name": "default__call_dcl_statements", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "unique_id": "macro.dbt.default__call_dcl_statements", "macro_sql": "{% macro default__call_dcl_statements(dcl_statement_list) %}\n {#\n -- By default, supply all grant + revoke statements in a single semicolon-separated block,\n -- so that they're all processed together.\n\n -- Some databases do not support this. Those adapters will need to override this macro\n -- to run each statement individually.\n #}\n {% call statement('grants') %}\n {% for dcl_statement in dcl_statement_list %}\n {{ dcl_statement }};\n {% endfor %}\n {% endcall %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "dcl_statement_list", "type": null, "description": ""}], "created_at": 1789079002.501583, "supported_languages": null}, "macro.dbt.apply_grants": {"name": "apply_grants", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "unique_id": "macro.dbt.apply_grants", "macro_sql": "{% macro apply_grants(relation, grant_config, should_revoke) %}\n {{ return(adapter.dispatch(\"apply_grants\", \"dbt\")(relation, grant_config, should_revoke)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__apply_grants"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "grant_config", "type": null, "description": ""}, {"name": "should_revoke", "type": null, "description": ""}], "created_at": 1789079002.5018415, "supported_languages": null}, "macro.dbt.default__apply_grants": {"name": "default__apply_grants", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "unique_id": "macro.dbt.default__apply_grants", "macro_sql": "{% macro default__apply_grants(relation, grant_config, should_revoke=True) %}\n {#-- If grant_config is {} or None, this is a no-op --#}\n {% if grant_config %}\n {% if should_revoke %}\n {#-- We think previous grants may have carried over --#}\n {#-- Show current grants and calculate diffs --#}\n {% set current_grants_table = run_query(get_show_grant_sql(relation)) %}\n {% set current_grants_dict = adapter.standardize_grants_dict(current_grants_table) %}\n {% set needs_granting = diff_of_two_dicts(grant_config, current_grants_dict) %}\n {% set needs_revoking = diff_of_two_dicts(current_grants_dict, grant_config) %}\n {% if not (needs_granting or needs_revoking) %}\n {{ log('On ' ~ relation.render() ~': All grants are in place, no revocation or granting needed.')}}\n {% endif %}\n {% else %}\n {#-- We don't think there's any chance of previous grants having carried over. --#}\n {#-- Jump straight to granting what the user has configured. --#}\n {% set needs_revoking = {} %}\n {% set needs_granting = grant_config %}\n {% endif %}\n {% if needs_granting or needs_revoking %}\n {% set revoke_statement_list = get_dcl_statement_list(relation, needs_revoking, get_revoke_sql) %}\n {% set grant_statement_list = get_dcl_statement_list(relation, needs_granting, get_grant_sql) %}\n {% set dcl_statement_list = revoke_statement_list + grant_statement_list %}\n {% if dcl_statement_list %}\n {{ call_dcl_statements(dcl_statement_list) }}\n {% endif %}\n {% endif %}\n {% endif %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.run_query", "macro.dbt.get_show_grant_sql", "macro.dbt.get_dcl_statement_list", "macro.dbt.call_dcl_statements"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "grant_config", "type": null, "description": ""}, {"name": "should_revoke", "type": null, "description": ""}], "created_at": 1789079002.5031998, "supported_languages": null}, "macro.dbt.is_core_v2": {"name": "is_core_v2", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/runtime.sql", "original_file_path": "macros/adapters/runtime.sql", "unique_id": "macro.dbt.is_core_v2", "macro_sql": "{% macro is_core_v2() -%}\n {%- set major_version = (dbt_version.split('.') | first) | int -%}\n {{ return(major_version == 2) }}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789079002.5035512, "supported_languages": null}, "macro.dbt.alter_column_comment": {"name": "alter_column_comment", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/persist_docs.sql", "original_file_path": "macros/adapters/persist_docs.sql", "unique_id": "macro.dbt.alter_column_comment", "macro_sql": "{% macro alter_column_comment(relation, column_dict) -%}\n {{ return(adapter.dispatch('alter_column_comment', 'dbt')(relation, column_dict)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__alter_column_comment"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "column_dict", "type": null, "description": ""}], "created_at": 1789079002.5042725, "supported_languages": null}, "macro.dbt.default__alter_column_comment": {"name": "default__alter_column_comment", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/persist_docs.sql", "original_file_path": "macros/adapters/persist_docs.sql", "unique_id": "macro.dbt.default__alter_column_comment", "macro_sql": "{% macro default__alter_column_comment(relation, column_dict) -%}\n {{ exceptions.raise_not_implemented(\n 'alter_column_comment macro not implemented for adapter '+adapter.type()) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "column_dict", "type": null, "description": ""}], "created_at": 1789079002.5044653, "supported_languages": null}, "macro.dbt.alter_relation_comment": {"name": "alter_relation_comment", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/persist_docs.sql", "original_file_path": "macros/adapters/persist_docs.sql", "unique_id": "macro.dbt.alter_relation_comment", "macro_sql": "{% macro alter_relation_comment(relation, relation_comment) -%}\n {{ return(adapter.dispatch('alter_relation_comment', 'dbt')(relation, relation_comment)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__alter_relation_comment"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "relation_comment", "type": null, "description": ""}], "created_at": 1789079002.504693, "supported_languages": null}, "macro.dbt.default__alter_relation_comment": {"name": "default__alter_relation_comment", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/persist_docs.sql", "original_file_path": "macros/adapters/persist_docs.sql", "unique_id": "macro.dbt.default__alter_relation_comment", "macro_sql": "{% macro default__alter_relation_comment(relation, relation_comment) -%}\n {{ exceptions.raise_not_implemented(\n 'alter_relation_comment macro not implemented for adapter '+adapter.type()) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "relation_comment", "type": null, "description": ""}], "created_at": 1789079002.5049126, "supported_languages": null}, "macro.dbt.persist_docs": {"name": "persist_docs", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/persist_docs.sql", "original_file_path": "macros/adapters/persist_docs.sql", "unique_id": "macro.dbt.persist_docs", "macro_sql": "{% macro persist_docs(relation, model, for_relation=true, for_columns=true) -%}\n {{ return(adapter.dispatch('persist_docs', 'dbt')(relation, model, for_relation, for_columns)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__persist_docs"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "model", "type": null, "description": ""}, {"name": "for_relation", "type": null, "description": ""}, {"name": "for_columns", "type": null, "description": ""}], "created_at": 1789079002.5052104, "supported_languages": null}, "macro.dbt.validate_doc_columns": {"name": "validate_doc_columns", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/persist_docs.sql", "original_file_path": "macros/adapters/persist_docs.sql", "unique_id": "macro.dbt.validate_doc_columns", "macro_sql": "{% macro validate_doc_columns(relation, column_dict, existing_column_names) %}\n {% set existing_lower = existing_column_names | map(\"lower\") | list %}\n {% set missing = [] %}\n {% set filtered = {} %}\n {% for col_name in column_dict %}\n {% set is_quoted = column_dict[col_name]['quote'] %}\n {% if is_quoted %}\n {% set present = col_name in existing_column_names %}\n {% else %}\n {% set present = col_name | lower in existing_lower %}\n {% endif %}\n {% if present %}\n {% do filtered.update({col_name: column_dict[col_name]}) %}\n {% else %}\n {% do missing.append(col_name) %}\n {% endif %}\n {% endfor %}\n {% if missing | length > 0 %}\n {{ exceptions.warn(\"In relation \" ~ relation.render() ~ \": The following columns are specified in the schema but are not present in the database: \" ~ missing | join(\", \")) }}\n {% endif %}\n {{ return(filtered) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "column_dict", "type": null, "description": ""}, {"name": "existing_column_names", "type": null, "description": ""}], "created_at": 1789079002.5063727, "supported_languages": null}, "macro.dbt.default__persist_docs": {"name": "default__persist_docs", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/persist_docs.sql", "original_file_path": "macros/adapters/persist_docs.sql", "unique_id": "macro.dbt.default__persist_docs", "macro_sql": "{% macro default__persist_docs(relation, model, for_relation, for_columns) -%}\n {% if for_relation and config.persist_relation_docs() and model.description %}\n {% do run_query(alter_relation_comment(relation, model.description)) %}\n {% endif %}\n\n {% if for_columns and config.persist_column_docs() and model.columns %}\n {% set existing_columns = adapter.get_columns_in_relation(relation) | map(attribute=\"name\") | list %}\n {% set filtered_columns = validate_doc_columns(relation, model.columns, existing_columns) %}\n {% set alter_comment_sql = alter_column_comment(relation, filtered_columns) %}\n {% if alter_comment_sql and alter_comment_sql | trim | length > 0 %}\n {% do run_query(alter_comment_sql) %}\n {% endif %}\n {% endif %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.run_query", "macro.dbt.alter_relation_comment", "macro.dbt.validate_doc_columns", "macro.dbt.alter_column_comment"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "model", "type": null, "description": ""}, {"name": "for_relation", "type": null, "description": ""}, {"name": "for_columns", "type": null, "description": ""}], "created_at": 1789079002.5073495, "supported_languages": null}, "macro.dbt.get_columns_in_relation": {"name": "get_columns_in_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "unique_id": "macro.dbt.get_columns_in_relation", "macro_sql": "{% macro get_columns_in_relation(relation) -%}\n {{ return(adapter.dispatch('get_columns_in_relation', 'dbt')(relation)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__get_columns_in_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789079002.5086434, "supported_languages": null}, "macro.dbt.default__get_columns_in_relation": {"name": "default__get_columns_in_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "unique_id": "macro.dbt.default__get_columns_in_relation", "macro_sql": "{% macro default__get_columns_in_relation(relation) -%}\n {{ exceptions.raise_not_implemented(\n 'get_columns_in_relation macro not implemented for adapter '+adapter.type()) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789079002.508836, "supported_languages": null}, "macro.dbt.sql_convert_columns_in_relation": {"name": "sql_convert_columns_in_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "unique_id": "macro.dbt.sql_convert_columns_in_relation", "macro_sql": "{% macro sql_convert_columns_in_relation(table) -%}\n {% set columns = [] %}\n {% for row in table %}\n {% do columns.append(api.Column(*row)) %}\n {% endfor %}\n {{ return(columns) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "table", "type": null, "description": ""}], "created_at": 1789079002.5092123, "supported_languages": null}, "macro.dbt.get_list_of_column_names": {"name": "get_list_of_column_names", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "unique_id": "macro.dbt.get_list_of_column_names", "macro_sql": "\n\n{%- macro get_list_of_column_names(columns) -%}\n {% set col_names = [] %}\n {% for col in columns %}\n {% do col_names.append(col.name) %}\n {% endfor %}\n {{ return(col_names) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "columns", "type": null, "description": ""}], "created_at": 1789079002.509544, "supported_languages": null}, "macro.dbt.get_empty_subquery_sql": {"name": "get_empty_subquery_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "unique_id": "macro.dbt.get_empty_subquery_sql", "macro_sql": "{% macro get_empty_subquery_sql(select_sql, select_sql_header=none) -%}\n {{ return(adapter.dispatch('get_empty_subquery_sql', 'dbt')(select_sql, select_sql_header)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_empty_subquery_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "select_sql", "type": null, "description": ""}, {"name": "select_sql_header", "type": null, "description": ""}], "created_at": 1789079002.5097857, "supported_languages": null}, "macro.dbt.default__get_empty_subquery_sql": {"name": "default__get_empty_subquery_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "unique_id": "macro.dbt.default__get_empty_subquery_sql", "macro_sql": "{% macro default__get_empty_subquery_sql(select_sql, select_sql_header=none) %}\n {%- if select_sql_header is not none -%}\n {{ select_sql_header }}\n {%- endif -%}\n select * from (\n {{ select_sql }}\n ) as __dbt_sbq\n where false\n limit 0\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "select_sql", "type": null, "description": ""}, {"name": "select_sql_header", "type": null, "description": ""}], "created_at": 1789079002.5100405, "supported_languages": null}, "macro.dbt.get_empty_schema_sql": {"name": "get_empty_schema_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "unique_id": "macro.dbt.get_empty_schema_sql", "macro_sql": "{% macro get_empty_schema_sql(columns) -%}\n {{ return(adapter.dispatch('get_empty_schema_sql', 'dbt')(columns)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_empty_schema_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "columns", "type": null, "description": ""}], "created_at": 1789079002.5102458, "supported_languages": null}, "macro.dbt.default__get_empty_schema_sql": {"name": "default__get_empty_schema_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "unique_id": "macro.dbt.default__get_empty_schema_sql", "macro_sql": "{% macro default__get_empty_schema_sql(columns) %}\n {%- set col_err = [] -%}\n {%- set col_naked_numeric = [] -%}\n select\n {% for i in columns %}\n {%- set col = columns[i] -%}\n {%- if col['data_type'] is not defined -%}\n {%- do col_err.append(col['name']) -%}\n {#-- If this column's type is just 'numeric' then it is missing precision/scale, raise a warning --#}\n {%- elif col['data_type'].strip().lower() in ('numeric', 'decimal', 'number') -%}\n {%- do col_naked_numeric.append(col['name']) -%}\n {%- endif -%}\n {% set col_name = adapter.quote(col['name']) if col.get('quote') else col['name'] %}\n {{ cast('null', col['data_type']) }} as {{ col_name }}{{ \", \" if not loop.last }}\n {%- endfor -%}\n {%- if (col_err | length) > 0 -%}\n {{ exceptions.column_type_missing(column_names=col_err) }}\n {%- elif (col_naked_numeric | length) > 0 -%}\n {{ exceptions.warn(\"Detected columns with numeric type and unspecified precision/scale, this can lead to unintended rounding: \" ~ col_naked_numeric ~ \"`\") }}\n {%- endif -%}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.cast"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "columns", "type": null, "description": ""}], "created_at": 1789079002.511528, "supported_languages": null}, "macro.dbt.get_column_schema_from_query": {"name": "get_column_schema_from_query", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "unique_id": "macro.dbt.get_column_schema_from_query", "macro_sql": "{% macro get_column_schema_from_query(select_sql, select_sql_header=none) -%}\n {% set columns = [] %}\n {# -- Using an 'empty subquery' here to get the same schema as the given select_sql statement, without necessitating a data scan.#}\n {% set sql = get_empty_subquery_sql(select_sql, select_sql_header) %}\n {% set column_schema = adapter.get_column_schema_from_query(sql) %}\n {{ return(column_schema) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_empty_subquery_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "select_sql", "type": null, "description": ""}, {"name": "select_sql_header", "type": null, "description": ""}], "created_at": 1789079002.5119407, "supported_languages": null}, "macro.dbt.get_columns_in_query": {"name": "get_columns_in_query", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "unique_id": "macro.dbt.get_columns_in_query", "macro_sql": "{% macro get_columns_in_query(select_sql) -%}\n {{ return(adapter.dispatch('get_columns_in_query', 'dbt')(select_sql)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_columns_in_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "select_sql", "type": null, "description": ""}], "created_at": 1789079002.512151, "supported_languages": null}, "macro.dbt.default__get_columns_in_query": {"name": "default__get_columns_in_query", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "unique_id": "macro.dbt.default__get_columns_in_query", "macro_sql": "{% macro default__get_columns_in_query(select_sql) %}\n {% call statement('get_columns_in_query', fetch_result=True, auto_begin=False) -%}\n {{ get_empty_subquery_sql(select_sql) }}\n {% endcall %}\n {{ return(load_result('get_columns_in_query').table.columns | map(attribute='name') | list) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement", "macro.dbt.get_empty_subquery_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "select_sql", "type": null, "description": ""}], "created_at": 1789079002.5125313, "supported_languages": null}, "macro.dbt.alter_column_type": {"name": "alter_column_type", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "unique_id": "macro.dbt.alter_column_type", "macro_sql": "{% macro alter_column_type(relation, column_name, new_column_type) -%}\n {{ return(adapter.dispatch('alter_column_type', 'dbt')(relation, column_name, new_column_type)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__alter_column_type"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "column_name", "type": null, "description": ""}, {"name": "new_column_type", "type": null, "description": ""}], "created_at": 1789079002.5127854, "supported_languages": null}, "macro.dbt.default__alter_column_type": {"name": "default__alter_column_type", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "unique_id": "macro.dbt.default__alter_column_type", "macro_sql": "{% macro default__alter_column_type(relation, column_name, new_column_type) -%}\n {#\n 1. Create a new column (w/ temp name and correct type)\n 2. Copy data over to it\n 3. Drop the existing column (cascade!)\n 4. Rename the new column to existing column\n #}\n {%- set tmp_column = column_name + \"__dbt_alter\" -%}\n\n {% call statement('alter_column_type') %}\n alter table {{ relation.render() }} add column {{ adapter.quote(tmp_column) }} {{ new_column_type }};\n update {{ relation.render() }} set {{ adapter.quote(tmp_column) }} = {{ adapter.quote(column_name) }};\n alter table {{ relation.render() }} drop column {{ adapter.quote(column_name) }} cascade;\n alter table {{ relation.render() }} rename column {{ adapter.quote(tmp_column) }} to {{ adapter.quote(column_name) }}\n {% endcall %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "column_name", "type": null, "description": ""}, {"name": "new_column_type", "type": null, "description": ""}], "created_at": 1789079002.5135987, "supported_languages": null}, "macro.dbt.alter_relation_add_remove_columns": {"name": "alter_relation_add_remove_columns", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "unique_id": "macro.dbt.alter_relation_add_remove_columns", "macro_sql": "{% macro alter_relation_add_remove_columns(relation, add_columns = none, remove_columns = none) -%}\n {{ return(adapter.dispatch('alter_relation_add_remove_columns', 'dbt')(relation, add_columns, remove_columns)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__alter_relation_add_remove_columns"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "add_columns", "type": null, "description": ""}, {"name": "remove_columns", "type": null, "description": ""}], "created_at": 1789079002.5139062, "supported_languages": null}, "macro.dbt.default__alter_relation_add_remove_columns": {"name": "default__alter_relation_add_remove_columns", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "unique_id": "macro.dbt.default__alter_relation_add_remove_columns", "macro_sql": "{% macro default__alter_relation_add_remove_columns(relation, add_columns, remove_columns) %}\n\n {% if add_columns is none %}\n {% set add_columns = [] %}\n {% endif %}\n {% if remove_columns is none %}\n {% set remove_columns = [] %}\n {% endif %}\n\n {% set sql -%}\n\n alter {{ relation.type }} {{ relation.render() }}\n\n {% for column in add_columns %}\n add column {{ column.quoted }} {{ column.expanded_data_type }}{{ ',' if not loop.last }}\n {% endfor %}{{ ',' if add_columns and remove_columns }}\n\n {% for column in remove_columns %}\n drop column {{ column.quoted }}{{ ',' if not loop.last }}\n {% endfor %}\n\n {%- endset -%}\n\n {% do run_query(sql) %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "add_columns", "type": null, "description": ""}, {"name": "remove_columns", "type": null, "description": ""}], "created_at": 1789079002.5147784, "supported_languages": null}, "macro.dbt.get_create_index_sql": {"name": "get_create_index_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/indexes.sql", "original_file_path": "macros/adapters/indexes.sql", "unique_id": "macro.dbt.get_create_index_sql", "macro_sql": "{% macro get_create_index_sql(relation, index_dict) -%}\n {{ return(adapter.dispatch('get_create_index_sql', 'dbt')(relation, index_dict)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__get_create_index_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "index_dict", "type": null, "description": ""}], "created_at": 1789079002.5153437, "supported_languages": null}, "macro.dbt.default__get_create_index_sql": {"name": "default__get_create_index_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/indexes.sql", "original_file_path": "macros/adapters/indexes.sql", "unique_id": "macro.dbt.default__get_create_index_sql", "macro_sql": "{% macro default__get_create_index_sql(relation, index_dict) -%}\n {% do return(None) %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "index_dict", "type": null, "description": ""}], "created_at": 1789079002.5155072, "supported_languages": null}, "macro.dbt.create_indexes": {"name": "create_indexes", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/indexes.sql", "original_file_path": "macros/adapters/indexes.sql", "unique_id": "macro.dbt.create_indexes", "macro_sql": "{% macro create_indexes(relation) -%}\n {{ adapter.dispatch('create_indexes', 'dbt')(relation) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__create_indexes"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789079002.5156906, "supported_languages": null}, "macro.dbt.default__create_indexes": {"name": "default__create_indexes", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/indexes.sql", "original_file_path": "macros/adapters/indexes.sql", "unique_id": "macro.dbt.default__create_indexes", "macro_sql": "{% macro default__create_indexes(relation) -%}\n {%- set _indexes = config.get('indexes', default=[]) -%}\n\n {% for _index_dict in _indexes %}\n {% set create_index_sql = get_create_index_sql(relation, _index_dict) %}\n {% if create_index_sql %}\n {% do run_query(create_index_sql) %}\n {% endif %}\n {% endfor %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_create_index_sql", "macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789079002.5161498, "supported_languages": null}, "macro.dbt.get_drop_index_sql": {"name": "get_drop_index_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/indexes.sql", "original_file_path": "macros/adapters/indexes.sql", "unique_id": "macro.dbt.get_drop_index_sql", "macro_sql": "{% macro get_drop_index_sql(relation, index_name) -%}\n {{ adapter.dispatch('get_drop_index_sql', 'dbt')(relation, index_name) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__get_drop_index_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "index_name", "type": null, "description": ""}], "created_at": 1789079002.51636, "supported_languages": null}, "macro.dbt.default__get_drop_index_sql": {"name": "default__get_drop_index_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/indexes.sql", "original_file_path": "macros/adapters/indexes.sql", "unique_id": "macro.dbt.default__get_drop_index_sql", "macro_sql": "{% macro default__get_drop_index_sql(relation, index_name) -%}\n {{ exceptions.raise_compiler_error(\"`get_drop_index_sql has not been implemented for this adapter.\") }}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "index_name", "type": null, "description": ""}], "created_at": 1789079002.5165179, "supported_languages": null}, "macro.dbt.get_show_indexes_sql": {"name": "get_show_indexes_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/indexes.sql", "original_file_path": "macros/adapters/indexes.sql", "unique_id": "macro.dbt.get_show_indexes_sql", "macro_sql": "{% macro get_show_indexes_sql(relation) -%}\n {{ adapter.dispatch('get_show_indexes_sql', 'dbt')(relation) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__get_show_indexes_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789079002.516696, "supported_languages": null}, "macro.dbt.default__get_show_indexes_sql": {"name": "default__get_show_indexes_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/indexes.sql", "original_file_path": "macros/adapters/indexes.sql", "unique_id": "macro.dbt.default__get_show_indexes_sql", "macro_sql": "{% macro default__get_show_indexes_sql(relation) -%}\n {{ exceptions.raise_compiler_error(\"`get_show_indexes_sql has not been implemented for this adapter.\") }}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789079002.5168426, "supported_languages": null}, "macro.dbt.get_catalog_relations": {"name": "get_catalog_relations", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "unique_id": "macro.dbt.get_catalog_relations", "macro_sql": "{% macro get_catalog_relations(information_schema, relations) -%}\n {{ return(adapter.dispatch('get_catalog_relations', 'dbt')(information_schema, relations)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__get_catalog_relations"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "information_schema", "type": null, "description": ""}, {"name": "relations", "type": null, "description": ""}], "created_at": 1789079002.5178187, "supported_languages": null}, "macro.dbt.default__get_catalog_relations": {"name": "default__get_catalog_relations", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "unique_id": "macro.dbt.default__get_catalog_relations", "macro_sql": "{% macro default__get_catalog_relations(information_schema, relations) -%}\n {% set typename = adapter.type() %}\n {% set msg -%}\n get_catalog_relations not implemented for {{ typename }}\n {%- endset %}\n\n {{ exceptions.raise_compiler_error(msg) }}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "information_schema", "type": null, "description": ""}, {"name": "relations", "type": null, "description": ""}], "created_at": 1789079002.5181391, "supported_languages": null}, "macro.dbt.get_catalog": {"name": "get_catalog", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "unique_id": "macro.dbt.get_catalog", "macro_sql": "{% macro get_catalog(information_schema, schemas) -%}\n {{ return(adapter.dispatch('get_catalog', 'dbt')(information_schema, schemas)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__get_catalog"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "information_schema", "type": null, "description": ""}, {"name": "schemas", "type": null, "description": ""}], "created_at": 1789079002.5183685, "supported_languages": null}, "macro.dbt.default__get_catalog": {"name": "default__get_catalog", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "unique_id": "macro.dbt.default__get_catalog", "macro_sql": "{% macro default__get_catalog(information_schema, schemas) -%}\n\n {% set typename = adapter.type() %}\n {% set msg -%}\n get_catalog not implemented for {{ typename }}\n {%- endset %}\n\n {{ exceptions.raise_compiler_error(msg) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "information_schema", "type": null, "description": ""}, {"name": "schemas", "type": null, "description": ""}], "created_at": 1789079002.518662, "supported_languages": null}, "macro.dbt.information_schema_name": {"name": "information_schema_name", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "unique_id": "macro.dbt.information_schema_name", "macro_sql": "{% macro information_schema_name(database) %}\n {{ return(adapter.dispatch('information_schema_name', 'dbt')(database)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__information_schema_name"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "database", "type": null, "description": ""}], "created_at": 1789079002.5188832, "supported_languages": null}, "macro.dbt.default__information_schema_name": {"name": "default__information_schema_name", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "unique_id": "macro.dbt.default__information_schema_name", "macro_sql": "{% macro default__information_schema_name(database) -%}\n {%- if database -%}\n {{ database }}.INFORMATION_SCHEMA\n {%- else -%}\n INFORMATION_SCHEMA\n {%- endif -%}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "database", "type": null, "description": ""}], "created_at": 1789079002.519149, "supported_languages": null}, "macro.dbt.list_schemas": {"name": "list_schemas", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "unique_id": "macro.dbt.list_schemas", "macro_sql": "{% macro list_schemas(database) -%}\n {{ return(adapter.dispatch('list_schemas', 'dbt')(database)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__list_schemas"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "database", "type": null, "description": ""}], "created_at": 1789079002.5193582, "supported_languages": null}, "macro.dbt.default__list_schemas": {"name": "default__list_schemas", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "unique_id": "macro.dbt.default__list_schemas", "macro_sql": "{% macro default__list_schemas(database) -%}\n {% set sql %}\n select distinct schema_name\n from {{ information_schema_name(database) }}.SCHEMATA\n where catalog_name ilike '{{ database }}'\n {% endset %}\n {{ return(run_query(sql)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.information_schema_name", "macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "database", "type": null, "description": ""}], "created_at": 1789079002.5196397, "supported_languages": null}, "macro.dbt.check_schema_exists": {"name": "check_schema_exists", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "unique_id": "macro.dbt.check_schema_exists", "macro_sql": "{% macro check_schema_exists(information_schema, schema) -%}\n {{ return(adapter.dispatch('check_schema_exists', 'dbt')(information_schema, schema)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__check_schema_exists"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "information_schema", "type": null, "description": ""}, {"name": "schema", "type": null, "description": ""}], "created_at": 1789079002.5198758, "supported_languages": null}, "macro.dbt.default__check_schema_exists": {"name": "default__check_schema_exists", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "unique_id": "macro.dbt.default__check_schema_exists", "macro_sql": "{% macro default__check_schema_exists(information_schema, schema) -%}\n {% set sql -%}\n select count(*)\n from {{ information_schema.replace(information_schema_view='SCHEMATA') }}\n where catalog_name='{{ information_schema.database }}'\n and schema_name='{{ schema }}'\n {%- endset %}\n {{ return(run_query(sql)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.replace", "macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "information_schema", "type": null, "description": ""}, {"name": "schema", "type": null, "description": ""}], "created_at": 1789079002.5202107, "supported_languages": null}, "macro.dbt.list_relations_without_caching": {"name": "list_relations_without_caching", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "unique_id": "macro.dbt.list_relations_without_caching", "macro_sql": "{% macro list_relations_without_caching(schema_relation) %}\n {{ return(adapter.dispatch('list_relations_without_caching', 'dbt')(schema_relation)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__list_relations_without_caching"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "schema_relation", "type": null, "description": ""}], "created_at": 1789079002.5204122, "supported_languages": null}, "macro.dbt.default__list_relations_without_caching": {"name": "default__list_relations_without_caching", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "unique_id": "macro.dbt.default__list_relations_without_caching", "macro_sql": "{% macro default__list_relations_without_caching(schema_relation) %}\n {{ exceptions.raise_not_implemented(\n 'list_relations_without_caching macro not implemented for adapter '+adapter.type()) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "schema_relation", "type": null, "description": ""}], "created_at": 1789079002.5205922, "supported_languages": null}, "macro.dbt.list_function_relations_without_caching": {"name": "list_function_relations_without_caching", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "unique_id": "macro.dbt.list_function_relations_without_caching", "macro_sql": "{% macro list_function_relations_without_caching(schema_relation) %}\n {{ return(adapter.dispatch('list_function_relations_without_caching', 'dbt')(schema_relation)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__list_function_relations_without_caching"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "schema_relation", "type": null, "description": ""}], "created_at": 1789079002.5207915, "supported_languages": null}, "macro.dbt.default__list_function_relations_without_caching": {"name": "default__list_function_relations_without_caching", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "unique_id": "macro.dbt.default__list_function_relations_without_caching", "macro_sql": "{% macro default__list_function_relations_without_caching(schema_relation) %}\n {{ exceptions.raise_not_implemented(\n 'list_function_relations_without_caching macro not implemented for adapter '+adapter.type()) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "schema_relation", "type": null, "description": ""}], "created_at": 1789079002.5209994, "supported_languages": null}, "macro.dbt.get_catalog_for_single_relation": {"name": "get_catalog_for_single_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "unique_id": "macro.dbt.get_catalog_for_single_relation", "macro_sql": "{% macro get_catalog_for_single_relation(relation) %}\n {{ return(adapter.dispatch('get_catalog_for_single_relation', 'dbt')(relation)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_catalog_for_single_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789079002.5212057, "supported_languages": null}, "macro.dbt.default__get_catalog_for_single_relation": {"name": "default__get_catalog_for_single_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "unique_id": "macro.dbt.default__get_catalog_for_single_relation", "macro_sql": "{% macro default__get_catalog_for_single_relation(relation) %}\n {{ exceptions.raise_not_implemented(\n 'get_catalog_for_single_relation macro not implemented for adapter '+adapter.type()) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789079002.5213861, "supported_languages": null}, "macro.dbt.get_relations": {"name": "get_relations", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "unique_id": "macro.dbt.get_relations", "macro_sql": "{% macro get_relations() %}\n {{ return(adapter.dispatch('get_relations', 'dbt')()) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__get_relations"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789079002.5215683, "supported_languages": null}, "macro.dbt.default__get_relations": {"name": "default__get_relations", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "unique_id": "macro.dbt.default__get_relations", "macro_sql": "{% macro default__get_relations() %}\n {{ exceptions.raise_not_implemented(\n 'get_relations macro not implemented for adapter '+adapter.type()) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789079002.521747, "supported_languages": null}, "macro.dbt.get_relation_last_modified": {"name": "get_relation_last_modified", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "unique_id": "macro.dbt.get_relation_last_modified", "macro_sql": "{% macro get_relation_last_modified(information_schema, relations) %}\n {{ return(adapter.dispatch('get_relation_last_modified', 'dbt')(information_schema, relations)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_relation_last_modified"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "information_schema", "type": null, "description": ""}, {"name": "relations", "type": null, "description": ""}], "created_at": 1789079002.5219953, "supported_languages": null}, "macro.dbt.default__get_relation_last_modified": {"name": "default__get_relation_last_modified", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "unique_id": "macro.dbt.default__get_relation_last_modified", "macro_sql": "{% macro default__get_relation_last_modified(information_schema, relations) %}\n {{ exceptions.raise_not_implemented(\n 'get_relation_last_modified macro not implemented for adapter ' + adapter.type()) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "information_schema", "type": null, "description": ""}, {"name": "relations", "type": null, "description": ""}], "created_at": 1789079002.522189, "supported_languages": null}, "macro.dbt.validate_sql": {"name": "validate_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/validate_sql.sql", "original_file_path": "macros/adapters/validate_sql.sql", "unique_id": "macro.dbt.validate_sql", "macro_sql": "{% macro validate_sql(sql) -%}\n {{ return(adapter.dispatch('validate_sql', 'dbt')(sql)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__validate_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "sql", "type": null, "description": ""}], "created_at": 1789079002.5225139, "supported_languages": null}, "macro.dbt.default__validate_sql": {"name": "default__validate_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/validate_sql.sql", "original_file_path": "macros/adapters/validate_sql.sql", "unique_id": "macro.dbt.default__validate_sql", "macro_sql": "{% macro default__validate_sql(sql) -%}\n {% call statement('validate_sql') -%}\n explain {{ sql }}\n {% endcall %}\n {{ return(load_result('validate_sql')) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "sql", "type": null, "description": ""}], "created_at": 1789079002.5228722, "supported_languages": null}, "macro.dbt.collect_freshness": {"name": "collect_freshness", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/freshness.sql", "original_file_path": "macros/adapters/freshness.sql", "unique_id": "macro.dbt.collect_freshness", "macro_sql": "{% macro collect_freshness(source, loaded_at_field, filter) %}\n {{ return(adapter.dispatch('collect_freshness', 'dbt')(source, loaded_at_field, filter))}}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__collect_freshness"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "source", "type": null, "description": ""}, {"name": "loaded_at_field", "type": null, "description": ""}, {"name": "filter", "type": null, "description": ""}], "created_at": 1789079002.5233634, "supported_languages": null}, "macro.dbt.default__collect_freshness": {"name": "default__collect_freshness", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/freshness.sql", "original_file_path": "macros/adapters/freshness.sql", "unique_id": "macro.dbt.default__collect_freshness", "macro_sql": "{% macro default__collect_freshness(source, loaded_at_field, filter) %}\n {% call statement('collect_freshness', fetch_result=True, auto_begin=False) -%}\n select\n max({{ loaded_at_field }}) as max_loaded_at,\n {{ current_timestamp() }} as snapshotted_at\n from {{ source }}\n {% if filter %}\n where {{ filter }}\n {% endif %}\n {% endcall %}\n {{ return(load_result('collect_freshness')) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement", "macro.dbt.current_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "source", "type": null, "description": ""}, {"name": "loaded_at_field", "type": null, "description": ""}, {"name": "filter", "type": null, "description": ""}], "created_at": 1789079002.5238206, "supported_languages": null}, "macro.dbt.collect_freshness_custom_sql": {"name": "collect_freshness_custom_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/freshness.sql", "original_file_path": "macros/adapters/freshness.sql", "unique_id": "macro.dbt.collect_freshness_custom_sql", "macro_sql": "{% macro collect_freshness_custom_sql(source, loaded_at_query) %}\n {{ return(adapter.dispatch('collect_freshness_custom_sql', 'dbt')(source, loaded_at_query))}}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__collect_freshness_custom_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "source", "type": null, "description": ""}, {"name": "loaded_at_query", "type": null, "description": ""}], "created_at": 1789079002.5240703, "supported_languages": null}, "macro.dbt.default__collect_freshness_custom_sql": {"name": "default__collect_freshness_custom_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/freshness.sql", "original_file_path": "macros/adapters/freshness.sql", "unique_id": "macro.dbt.default__collect_freshness_custom_sql", "macro_sql": "{% macro default__collect_freshness_custom_sql(source, loaded_at_query) %}\n {% call statement('collect_freshness_custom_sql', fetch_result=True, auto_begin=False) -%}\n with source_query as (\n {{ loaded_at_query }}\n )\n select\n (select * from source_query) as max_loaded_at,\n {{ current_timestamp() }} as snapshotted_at\n {% endcall %}\n {{ return(load_result('collect_freshness_custom_sql')) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement", "macro.dbt.current_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "source", "type": null, "description": ""}, {"name": "loaded_at_query", "type": null, "description": ""}], "created_at": 1789079002.5244246, "supported_languages": null}, "macro.dbt.make_intermediate_relation": {"name": "make_intermediate_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "unique_id": "macro.dbt.make_intermediate_relation", "macro_sql": "{% macro make_intermediate_relation(base_relation, suffix='__dbt_tmp') %}\n {{ return(adapter.dispatch('make_intermediate_relation', 'dbt')(base_relation, suffix)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__make_intermediate_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "base_relation", "type": null, "description": ""}, {"name": "suffix", "type": null, "description": ""}], "created_at": 1789079002.525204, "supported_languages": null}, "macro.dbt.default__make_intermediate_relation": {"name": "default__make_intermediate_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "unique_id": "macro.dbt.default__make_intermediate_relation", "macro_sql": "{% macro default__make_intermediate_relation(base_relation, suffix) %}\n {{ return(default__make_temp_relation(base_relation, suffix)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__make_temp_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "base_relation", "type": null, "description": ""}, {"name": "suffix", "type": null, "description": ""}], "created_at": 1789079002.525397, "supported_languages": null}, "macro.dbt.make_temp_relation": {"name": "make_temp_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "unique_id": "macro.dbt.make_temp_relation", "macro_sql": "{% macro make_temp_relation(base_relation, suffix='__dbt_tmp') %}\n {#-- This ensures microbatch batches get unique temp relations to avoid clobbering --#}\n {% if suffix == '__dbt_tmp' and model.batch %}\n {% set suffix = suffix ~ '_' ~ model.batch.id %}\n {% endif %}\n\n {{ return(adapter.dispatch('make_temp_relation', 'dbt')(base_relation, suffix)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__make_temp_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "base_relation", "type": null, "description": ""}, {"name": "suffix", "type": null, "description": ""}], "created_at": 1789079002.5258265, "supported_languages": null}, "macro.dbt.default__make_temp_relation": {"name": "default__make_temp_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "unique_id": "macro.dbt.default__make_temp_relation", "macro_sql": "{% macro default__make_temp_relation(base_relation, suffix) %}\n {%- set temp_identifier = base_relation.identifier ~ suffix -%}\n {%- set temp_relation = base_relation.incorporate(\n path={\"identifier\": temp_identifier}) -%}\n\n {{ return(temp_relation) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "base_relation", "type": null, "description": ""}, {"name": "suffix", "type": null, "description": ""}], "created_at": 1789079002.526186, "supported_languages": null}, "macro.dbt.make_backup_relation": {"name": "make_backup_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "unique_id": "macro.dbt.make_backup_relation", "macro_sql": "{% macro make_backup_relation(base_relation, backup_relation_type, suffix='__dbt_backup') %}\n {{ return(adapter.dispatch('make_backup_relation', 'dbt')(base_relation, backup_relation_type, suffix)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__make_backup_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "base_relation", "type": null, "description": ""}, {"name": "backup_relation_type", "type": null, "description": ""}, {"name": "suffix", "type": null, "description": ""}], "created_at": 1789079002.5264564, "supported_languages": null}, "macro.dbt.default__make_backup_relation": {"name": "default__make_backup_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "unique_id": "macro.dbt.default__make_backup_relation", "macro_sql": "{% macro default__make_backup_relation(base_relation, backup_relation_type, suffix) %}\n {%- set backup_identifier = base_relation.identifier ~ suffix -%}\n {%- set backup_relation = base_relation.incorporate(\n path={\"identifier\": backup_identifier},\n type=backup_relation_type\n ) -%}\n {{ return(backup_relation) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "base_relation", "type": null, "description": ""}, {"name": "backup_relation_type", "type": null, "description": ""}, {"name": "suffix", "type": null, "description": ""}], "created_at": 1789079002.5268204, "supported_languages": null}, "macro.dbt.truncate_relation": {"name": "truncate_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "unique_id": "macro.dbt.truncate_relation", "macro_sql": "{% macro truncate_relation(relation) -%}\n {{ return(adapter.dispatch('truncate_relation', 'dbt')(relation)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__truncate_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789079002.5270357, "supported_languages": null}, "macro.dbt.default__truncate_relation": {"name": "default__truncate_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "unique_id": "macro.dbt.default__truncate_relation", "macro_sql": "{% macro default__truncate_relation(relation) -%}\n {% call statement('truncate_relation') -%}\n truncate table {{ relation.render() }}\n {%- endcall %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789079002.527242, "supported_languages": null}, "macro.dbt.get_or_create_relation": {"name": "get_or_create_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "unique_id": "macro.dbt.get_or_create_relation", "macro_sql": "{% macro get_or_create_relation(database, schema, identifier, type) -%}\n {{ return(adapter.dispatch('get_or_create_relation', 'dbt')(database, schema, identifier, type)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_or_create_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "database", "type": null, "description": ""}, {"name": "schema", "type": null, "description": ""}, {"name": "identifier", "type": null, "description": ""}, {"name": "type", "type": null, "description": ""}], "created_at": 1789079002.5275087, "supported_languages": null}, "macro.dbt.default__get_or_create_relation": {"name": "default__get_or_create_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "unique_id": "macro.dbt.default__get_or_create_relation", "macro_sql": "{% macro default__get_or_create_relation(database, schema, identifier, type) %}\n {%- set target_relation = adapter.get_relation(database=database, schema=schema, identifier=identifier) %}\n\n {% if target_relation %}\n {% do return([true, target_relation]) %}\n {% endif %}\n\n {%- set new_relation = api.Relation.create(\n database=database,\n schema=schema,\n identifier=identifier,\n type=type\n ) -%}\n {% do return([false, new_relation]) %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "database", "type": null, "description": ""}, {"name": "schema", "type": null, "description": ""}, {"name": "identifier", "type": null, "description": ""}, {"name": "type", "type": null, "description": ""}], "created_at": 1789079002.5281987, "supported_languages": null}, "macro.dbt.load_cached_relation": {"name": "load_cached_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "unique_id": "macro.dbt.load_cached_relation", "macro_sql": "{% macro load_cached_relation(relation) %}\n {% do return(adapter.get_relation(\n database=relation.database,\n schema=relation.schema,\n identifier=relation.identifier\n )) -%}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789079002.5284553, "supported_languages": null}, "macro.dbt.load_relation": {"name": "load_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "unique_id": "macro.dbt.load_relation", "macro_sql": "{% macro load_relation(relation) %}\n {{ return(load_cached_relation(relation)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.load_cached_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789079002.5286186, "supported_languages": null}, "macro.dbt.test_unique": {"name": "test_unique", "resource_type": "macro", "package_name": "dbt", "path": "tests/generic/builtin.sql", "original_file_path": "tests/generic/builtin.sql", "unique_id": "macro.dbt.test_unique", "macro_sql": "{% test unique(model, column_name) %}\n {% set macro = adapter.dispatch('test_unique', 'dbt') %}\n {{ macro(model, column_name) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt.default__test_unique"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789079002.5291333, "supported_languages": null}, "macro.dbt.test_not_null": {"name": "test_not_null", "resource_type": "macro", "package_name": "dbt", "path": "tests/generic/builtin.sql", "original_file_path": "tests/generic/builtin.sql", "unique_id": "macro.dbt.test_not_null", "macro_sql": "{% test not_null(model, column_name) %}\n {% set macro = adapter.dispatch('test_not_null', 'dbt') %}\n {{ macro(model, column_name) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt.default__test_not_null"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789079002.529417, "supported_languages": null}, "macro.dbt.test_accepted_values": {"name": "test_accepted_values", "resource_type": "macro", "package_name": "dbt", "path": "tests/generic/builtin.sql", "original_file_path": "tests/generic/builtin.sql", "unique_id": "macro.dbt.test_accepted_values", "macro_sql": "{% test accepted_values(model, column_name, values, quote=True) %}\n {% set macro = adapter.dispatch('test_accepted_values', 'dbt') %}\n {{ macro(model, column_name, values, quote) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt.default__test_accepted_values"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789079002.5297556, "supported_languages": null}, "macro.dbt.test_relationships": {"name": "test_relationships", "resource_type": "macro", "package_name": "dbt", "path": "tests/generic/builtin.sql", "original_file_path": "tests/generic/builtin.sql", "unique_id": "macro.dbt.test_relationships", "macro_sql": "{% test relationships(model, column_name, to, field) %}\n {% set macro = adapter.dispatch('test_relationships', 'dbt') %}\n {{ macro(model, column_name, to, field) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt.default__test_relationships"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789079002.5301135, "supported_languages": null}, "macro.dbt_utils.slugify": {"name": "slugify", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/jinja_helpers/slugify.sql", "original_file_path": "macros/jinja_helpers/slugify.sql", "unique_id": "macro.dbt_utils.slugify", "macro_sql": "{% macro slugify(string) %}\n\n{% if not string %}\n{{ return('') }}\n{% endif %}\n\n{#- Lower case the string -#}\n{% set string = string | lower %}\n{#- Replace spaces and dashes with underscores -#}\n{% set string = modules.re.sub('[ -]+', '_', string) %}\n{#- Only take letters, numbers, and underscores -#}\n{% set string = modules.re.sub('[^a-z0-9_]+', '', string) %}\n{#- Prepends \"_\" if string begins with a number -#}\n{% set string = modules.re.sub('^[0-9]', '_' + string[0], string) %}\n\n{{ return(string) }}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "string", "type": null, "description": ""}], "created_at": 1789079002.5309591, "supported_languages": null}, "macro.dbt_utils.log_info": {"name": "log_info", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/jinja_helpers/log_info.sql", "original_file_path": "macros/jinja_helpers/log_info.sql", "unique_id": "macro.dbt_utils.log_info", "macro_sql": "{% macro log_info(message) %}\n {{ return(adapter.dispatch('log_info', 'dbt_utils')(message)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__log_info"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "message", "type": null, "description": ""}], "created_at": 1789079002.5312538, "supported_languages": null}, "macro.dbt_utils.default__log_info": {"name": "default__log_info", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/jinja_helpers/log_info.sql", "original_file_path": "macros/jinja_helpers/log_info.sql", "unique_id": "macro.dbt_utils.default__log_info", "macro_sql": "{% macro default__log_info(message) %}\n {{ log(dbt_utils.pretty_log_format(message), info=True) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.pretty_log_format"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "message", "type": null, "description": ""}], "created_at": 1789079002.5314488, "supported_languages": null}, "macro.dbt_utils.pretty_log_format": {"name": "pretty_log_format", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/jinja_helpers/pretty_log_format.sql", "original_file_path": "macros/jinja_helpers/pretty_log_format.sql", "unique_id": "macro.dbt_utils.pretty_log_format", "macro_sql": "{% macro pretty_log_format(message) %}\n {{ return(adapter.dispatch('pretty_log_format', 'dbt_utils')(message)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__pretty_log_format"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "message", "type": null, "description": ""}], "created_at": 1789079002.531745, "supported_languages": null}, "macro.dbt_utils.default__pretty_log_format": {"name": "default__pretty_log_format", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/jinja_helpers/pretty_log_format.sql", "original_file_path": "macros/jinja_helpers/pretty_log_format.sql", "unique_id": "macro.dbt_utils.default__pretty_log_format", "macro_sql": "{% macro default__pretty_log_format(message) %}\n {{ return( dbt_utils.pretty_time() ~ ' + ' ~ message) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.pretty_time"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "message", "type": null, "description": ""}], "created_at": 1789079002.5319529, "supported_languages": null}, "macro.dbt_utils._is_ephemeral": {"name": "_is_ephemeral", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/jinja_helpers/_is_ephemeral.sql", "original_file_path": "macros/jinja_helpers/_is_ephemeral.sql", "unique_id": "macro.dbt_utils._is_ephemeral", "macro_sql": "{% macro _is_ephemeral(obj, macro) %}\n {%- if obj.is_cte -%}\n {% set ephemeral_prefix = api.Relation.add_ephemeral_prefix('') %}\n {% if obj.name.startswith(ephemeral_prefix) %}\n {% set model_name = obj.name[(ephemeral_prefix|length):] %}\n {% else %}\n {% set model_name = obj.name %}\n {%- endif -%}\n {% set error_message %}\nThe `{{ macro }}` macro cannot be used with ephemeral models, as it relies on the information schema.\n\n`{{ model_name }}` is an ephemeral model. Consider making it a view or table instead.\n {% endset %}\n {%- do exceptions.raise_compiler_error(error_message) -%}\n {%- endif -%}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "obj", "type": null, "description": ""}, {"name": "macro", "type": null, "description": ""}], "created_at": 1789079002.5327363, "supported_languages": null}, "macro.dbt_utils._is_relation": {"name": "_is_relation", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/jinja_helpers/_is_relation.sql", "original_file_path": "macros/jinja_helpers/_is_relation.sql", "unique_id": "macro.dbt_utils._is_relation", "macro_sql": "{% macro _is_relation(obj, macro) %}\n {%- if not (obj is mapping and obj.get('metadata', {}).get('type', '').endswith('Relation')) -%}\n {%- do exceptions.raise_compiler_error(\"Macro \" ~ macro ~ \" expected a Relation but received the value: \" ~ obj) -%}\n {%- endif -%}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "obj", "type": null, "description": ""}, {"name": "macro", "type": null, "description": ""}], "created_at": 1789079002.5332377, "supported_languages": null}, "macro.dbt_utils.pretty_time": {"name": "pretty_time", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/jinja_helpers/pretty_time.sql", "original_file_path": "macros/jinja_helpers/pretty_time.sql", "unique_id": "macro.dbt_utils.pretty_time", "macro_sql": "{% macro pretty_time(format='%H:%M:%S') %}\n {{ return(adapter.dispatch('pretty_time', 'dbt_utils')(format)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__pretty_time"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "format", "type": null, "description": ""}], "created_at": 1789079002.5335429, "supported_languages": null}, "macro.dbt_utils.default__pretty_time": {"name": "default__pretty_time", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/jinja_helpers/pretty_time.sql", "original_file_path": "macros/jinja_helpers/pretty_time.sql", "unique_id": "macro.dbt_utils.default__pretty_time", "macro_sql": "{% macro default__pretty_time(format='%H:%M:%S') %}\n {{ return(modules.datetime.datetime.now().strftime(format)) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "format", "type": null, "description": ""}], "created_at": 1789079002.5337617, "supported_languages": null}, "macro.dbt_utils.test_not_constant": {"name": "test_not_constant", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/not_constant.sql", "original_file_path": "macros/generic_tests/not_constant.sql", "unique_id": "macro.dbt_utils.test_not_constant", "macro_sql": "{% test not_constant(model, column_name, group_by_columns = []) %}\n {{ return(adapter.dispatch('test_not_constant', 'dbt_utils')(model, column_name, group_by_columns)) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_not_constant"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "column_name", "type": null, "description": ""}, {"name": "group_by_columns", "type": null, "description": ""}], "created_at": 1789079002.5342243, "supported_languages": null}, "macro.dbt_utils.default__test_not_constant": {"name": "default__test_not_constant", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/not_constant.sql", "original_file_path": "macros/generic_tests/not_constant.sql", "unique_id": "macro.dbt_utils.default__test_not_constant", "macro_sql": "{% macro default__test_not_constant(model, column_name, group_by_columns) %}\n\n{% if group_by_columns|length() > 0 %}\n {% set select_gb_cols = group_by_columns|join(' ,') + ', ' %}\n {% set groupby_gb_cols = 'group by ' + group_by_columns|join(',') %}\n{% endif %}\n\n\nselect\n {# In TSQL, subquery aggregate columns need aliases #}\n {# thus: a filler col name, 'filler_column' #}\n {{select_gb_cols}}\n count(distinct {{ column_name }}) as filler_column\n\nfrom {{ model }}\n\n {{groupby_gb_cols}}\n\nhaving count(distinct {{ column_name }}) = 1\n\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "column_name", "type": null, "description": ""}, {"name": "group_by_columns", "type": null, "description": ""}], "created_at": 1789079002.5348208, "supported_languages": null}, "macro.dbt_utils.test_equality": {"name": "test_equality", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/equality.sql", "original_file_path": "macros/generic_tests/equality.sql", "unique_id": "macro.dbt_utils.test_equality", "macro_sql": "{% test equality(model, compare_model, compare_columns=None, exclude_columns=None, precision = None) %}\n {{ return(adapter.dispatch('test_equality', 'dbt_utils')(model, compare_model, compare_columns, exclude_columns, precision)) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_equality"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "compare_model", "type": null, "description": ""}, {"name": "compare_columns", "type": null, "description": ""}, {"name": "exclude_columns", "type": null, "description": ""}, {"name": "precision", "type": null, "description": ""}], "created_at": 1789079002.5360937, "supported_languages": null}, "macro.dbt_utils.default__test_equality": {"name": "default__test_equality", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/equality.sql", "original_file_path": "macros/generic_tests/equality.sql", "unique_id": "macro.dbt_utils.default__test_equality", "macro_sql": "{% macro default__test_equality(model, compare_model, compare_columns=None, exclude_columns=None, precision = None) %}\n\n{%- if compare_columns and exclude_columns -%}\n {{ exceptions.raise_compiler_error(\"Both a compare and an ignore list were provided to the `equality` macro. Only one is allowed\") }}\n{%- endif -%}\n\n{% set set_diff %}\n count(*) + coalesce(abs(\n sum(case when which_diff = 'a_minus_b' then 1 else 0 end) -\n sum(case when which_diff = 'b_minus_a' then 1 else 0 end)\n ), 0)\n{% endset %}\n\n{#-- Needs to be set at parse time, before we return '' below --#}\n{{ config(fail_calc = set_diff) }}\n\n{#-- Prevent querying of db in parsing mode. This works because this macro does not create any new refs. #}\n{%- if not execute -%}\n {{ return('') }}\n{% endif %}\n\n\n\n-- setup\n{%- do dbt_utils._is_relation(model, 'test_equality') -%}\n\n{# Ensure there are no extra columns in the compare_model vs model #}\n{%- if not compare_columns -%}\n {%- do dbt_utils._is_ephemeral(model, 'test_equality') -%}\n {%- do dbt_utils._is_ephemeral(compare_model, 'test_equality') -%}\n\n {%- set model_columns = adapter.get_columns_in_relation(model) -%}\n {%- set compare_model_columns = adapter.get_columns_in_relation(compare_model) -%}\n\n\n {%- if exclude_columns -%}\n {#-- Lower case ignore columns for easier comparison --#}\n {%- set exclude_columns = exclude_columns | map(\"lower\") | list %}\n\n {# Filter out the excluded columns #}\n {%- set include_columns = [] %}\n {%- set include_model_columns = [] %}\n {%- for column in model_columns -%}\n {%- if column.name | lower not in exclude_columns -%}\n {% do include_columns.append(column) %}\n {%- endif %}\n {%- endfor %}\n {%- for column in compare_model_columns -%}\n {%- if column.name | lower not in exclude_columns -%}\n {% do include_model_columns.append(column) %}\n {%- endif %}\n {%- endfor %}\n\n {%- set compare_columns_set = set(include_columns | map(attribute='quoted') | map(\"lower\")) %}\n {%- set compare_model_columns_set = set(include_model_columns | map(attribute='quoted') | map(\"lower\")) %}\n {%- else -%}\n {%- set compare_columns_set = set(model_columns | map(attribute='quoted') | map(\"lower\")) %}\n {%- set compare_model_columns_set = set(compare_model_columns | map(attribute='quoted') | map(\"lower\")) %}\n {%- endif -%}\n\n {% if compare_columns_set != compare_model_columns_set %}\n {{ exceptions.raise_compiler_error(compare_model ~\" has less columns than \" ~ model ~ \", please ensure they have the same columns or use the `compare_columns` or `exclude_columns` arguments to subset them.\") }}\n {% endif %}\n\n\n{% endif %}\n\n{%- if not precision -%}\n {%- if not compare_columns -%}\n {# \n You cannot get the columns in an ephemeral model (due to not existing in the information schema),\n so if the user does not provide an explicit list of columns we must error in the case it is ephemeral\n #}\n {%- do dbt_utils._is_ephemeral(model, 'test_equality') -%}\n {%- set compare_columns = adapter.get_columns_in_relation(model)-%}\n\n {%- if exclude_columns -%}\n {#-- Lower case ignore columns for easier comparison --#}\n {%- set exclude_columns = exclude_columns | map(\"lower\") | list %}\n\n {# Filter out the excluded columns #}\n {%- set include_columns = [] %}\n {%- for column in compare_columns -%}\n {%- if column.name | lower not in exclude_columns -%}\n {% do include_columns.append(column) %}\n {%- endif %}\n {%- endfor %}\n\n {%- set compare_columns = include_columns | map(attribute='quoted') %}\n {%- else -%} {# Compare columns provided #}\n {%- set compare_columns = compare_columns | map(attribute='quoted') %}\n {%- endif -%}\n {%- endif -%}\n\n {% set compare_cols_csv = compare_columns | join(', ') %}\n\n{% else %} {# Precision required #}\n {#-\n If rounding is required, we need to get the types, so it cannot be ephemeral even if they provide column names\n -#}\n {%- do dbt_utils._is_ephemeral(model, 'test_equality') -%}\n {%- set columns = adapter.get_columns_in_relation(model) -%}\n\n {% set columns_list = [] %}\n {%- for col in columns -%}\n {%- if (\n (col.name|lower in compare_columns|map('lower') or not compare_columns) and\n (col.name|lower not in exclude_columns|map('lower') or not exclude_columns)\n ) -%}\n {# Databricks double type is not picked up by any number type checks in dbt #}\n {%- if col.is_float() or col.is_numeric() or col.data_type == 'double' -%}\n {# Cast is required due to postgres not having round for a double precision number #}\n {%- do columns_list.append('round(cast(' ~ col.quoted ~ ' as ' ~ dbt.type_numeric() ~ '),' ~ precision ~ ') as ' ~ col.quoted) -%}\n {%- else -%} {# Non-numeric type #}\n {%- do columns_list.append(col.quoted) -%}\n {%- endif -%}\n {% endif %}\n {%- endfor -%}\n\n {% set compare_cols_csv = columns_list | join(', ') %}\n\n{% endif %}\n\nwith a as (\n\n select * from {{ model }}\n\n),\n\nb as (\n\n select * from {{ compare_model }}\n\n),\n\na_minus_b as (\n\n select {{compare_cols_csv}} from a\n {{ dbt.except() }}\n select {{compare_cols_csv}} from b\n\n),\n\nb_minus_a as (\n\n select {{compare_cols_csv}} from b\n {{ dbt.except() }}\n select {{compare_cols_csv}} from a\n\n),\n\nunioned as (\n\n select 'a_minus_b' as which_diff, a_minus_b.* from a_minus_b\n union all\n select 'b_minus_a' as which_diff, b_minus_a.* from b_minus_a\n\n)\n\nselect * from unioned\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils._is_relation", "macro.dbt_utils._is_ephemeral", "macro.dbt.type_numeric", "macro.dbt.except"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "compare_model", "type": null, "description": ""}, {"name": "compare_columns", "type": null, "description": ""}, {"name": "exclude_columns", "type": null, "description": ""}, {"name": "precision", "type": null, "description": ""}], "created_at": 1789079002.5404835, "supported_languages": null}, "macro.dbt_utils.test_not_empty_string": {"name": "test_not_empty_string", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/not_empty_string.sql", "original_file_path": "macros/generic_tests/not_empty_string.sql", "unique_id": "macro.dbt_utils.test_not_empty_string", "macro_sql": "{% test not_empty_string(model, column_name, trim_whitespace=true) %}\n\n {{ return(adapter.dispatch('test_not_empty_string', 'dbt_utils')(model, column_name, trim_whitespace)) }}\n\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_not_empty_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "column_name", "type": null, "description": ""}, {"name": "trim_whitespace", "type": null, "description": ""}], "created_at": 1789079002.5409687, "supported_languages": null}, "macro.dbt_utils.default__test_not_empty_string": {"name": "default__test_not_empty_string", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/not_empty_string.sql", "original_file_path": "macros/generic_tests/not_empty_string.sql", "unique_id": "macro.dbt_utils.default__test_not_empty_string", "macro_sql": "{% macro default__test_not_empty_string(model, column_name, trim_whitespace=true) %}\n\n with\n \n all_values as (\n\n select \n\n\n {% if trim_whitespace == true -%}\n\n trim({{ column_name }}) as {{ column_name }}\n\n {%- else -%}\n\n {{ column_name }}\n\n {%- endif %}\n \n from {{ model }}\n\n ),\n\n errors as (\n\n select * from all_values\n where {{ column_name }} = ''\n\n )\n\n select * from errors\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "column_name", "type": null, "description": ""}, {"name": "trim_whitespace", "type": null, "description": ""}], "created_at": 1789079002.5413277, "supported_languages": null}, "macro.dbt_utils.test_recency": {"name": "test_recency", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/recency.sql", "original_file_path": "macros/generic_tests/recency.sql", "unique_id": "macro.dbt_utils.test_recency", "macro_sql": "{% test recency(model, field, datepart, interval, ignore_time_component=False, group_by_columns = []) %}\n {{ return(adapter.dispatch('test_recency', 'dbt_utils')(model, field, datepart, interval, ignore_time_component, group_by_columns)) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_recency"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "field", "type": null, "description": ""}, {"name": "datepart", "type": null, "description": ""}, {"name": "interval", "type": null, "description": ""}, {"name": "ignore_time_component", "type": null, "description": ""}, {"name": "group_by_columns", "type": null, "description": ""}], "created_at": 1789079002.541952, "supported_languages": null}, "macro.dbt_utils.default__test_recency": {"name": "default__test_recency", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/recency.sql", "original_file_path": "macros/generic_tests/recency.sql", "unique_id": "macro.dbt_utils.default__test_recency", "macro_sql": "{% macro default__test_recency(model, field, datepart, interval, ignore_time_component, group_by_columns) %}\n\n{% set empty_invocation = flags.EMPTY is defined and flags.EMPTY %}\n\n{% set threshold = 'cast(' ~ dbt.dateadd(datepart, interval * -1, dbt.current_timestamp()) ~ ' as ' ~ ('date' if ignore_time_component else dbt.type_timestamp()) ~ ')' %}\n\n{% if group_by_columns|length() > 0 %}\n {% set select_gb_cols = group_by_columns|join(' ,') + ', ' %}\n {% set groupby_gb_cols = 'group by ' + group_by_columns|join(',') %}\n{% endif %}\n\n\nwith recency as (\n\n select \n\n {{ select_gb_cols }}\n {% if ignore_time_component %}\n cast(max({{ field }}) as date) as most_recent\n {%- else %}\n max({{ field }}) as most_recent\n {%- endif %}\n\n from {{ model }}\n\n {{ groupby_gb_cols }}\n\n)\n\nselect\n\n {{ select_gb_cols }}\n most_recent,\n {{ threshold }} as threshold\n\nfrom recency\nwhere most_recent < {{ threshold }}\n{%- if not empty_invocation %}\n or most_recent is null\n{%- endif %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.dateadd", "macro.dbt.current_timestamp", "macro.dbt.type_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "field", "type": null, "description": ""}, {"name": "datepart", "type": null, "description": ""}, {"name": "interval", "type": null, "description": ""}, {"name": "ignore_time_component", "type": null, "description": ""}, {"name": "group_by_columns", "type": null, "description": ""}], "created_at": 1789079002.5430305, "supported_languages": null}, "macro.dbt_utils.test_at_least_one": {"name": "test_at_least_one", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/at_least_one.sql", "original_file_path": "macros/generic_tests/at_least_one.sql", "unique_id": "macro.dbt_utils.test_at_least_one", "macro_sql": "{% test at_least_one(model, column_name, group_by_columns = []) %}\n {{ return(adapter.dispatch('test_at_least_one', 'dbt_utils')(model, column_name, group_by_columns)) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_at_least_one"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "column_name", "type": null, "description": ""}, {"name": "group_by_columns", "type": null, "description": ""}], "created_at": 1789079002.5435686, "supported_languages": null}, "macro.dbt_utils.default__test_at_least_one": {"name": "default__test_at_least_one", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/at_least_one.sql", "original_file_path": "macros/generic_tests/at_least_one.sql", "unique_id": "macro.dbt_utils.default__test_at_least_one", "macro_sql": "{% macro default__test_at_least_one(model, column_name, group_by_columns) %}\n\n{% set pruned_cols = [column_name] %}\n\n{% if group_by_columns|length() > 0 %}\n\n {% set select_gb_cols = group_by_columns|join(' ,') + ', ' %}\n {% set groupby_gb_cols = 'group by ' + group_by_columns|join(',') %}\n {% set pruned_cols = group_by_columns %}\n\n {% if column_name not in pruned_cols %}\n {% do pruned_cols.append(column_name) %}\n {% endif %}\n\n{% endif %}\n\n{% set select_pruned_cols = pruned_cols|join(' ,') %}\n\nselect *\nfrom (\n with pruned_rows as (\n select\n {{ select_pruned_cols }}\n from {{ model }}\n {% if group_by_columns|length() == 0 %}\n where {{ column_name }} is not null\n limit 1\n {% endif %}\n )\n select\n {# In TSQL, subquery aggregate columns need aliases #}\n {# thus: a filler col name, 'filler_column' #}\n {{select_gb_cols}}\n count({{ column_name }}) as filler_column\n\n from pruned_rows\n\n {{groupby_gb_cols}}\n\n having count({{ column_name }}) = 0\n\n) validation_errors\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "column_name", "type": null, "description": ""}, {"name": "group_by_columns", "type": null, "description": ""}], "created_at": 1789079002.5445306, "supported_languages": null}, "macro.dbt_utils.test_unique_combination_of_columns": {"name": "test_unique_combination_of_columns", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/unique_combination_of_columns.sql", "original_file_path": "macros/generic_tests/unique_combination_of_columns.sql", "unique_id": "macro.dbt_utils.test_unique_combination_of_columns", "macro_sql": "{% test unique_combination_of_columns(model, combination_of_columns, quote_columns=false) %}\n {{ return(adapter.dispatch('test_unique_combination_of_columns', 'dbt_utils')(model, combination_of_columns, quote_columns)) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_unique_combination_of_columns"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "combination_of_columns", "type": null, "description": ""}, {"name": "quote_columns", "type": null, "description": ""}], "created_at": 1789079002.5450234, "supported_languages": null}, "macro.dbt_utils.default__test_unique_combination_of_columns": {"name": "default__test_unique_combination_of_columns", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/unique_combination_of_columns.sql", "original_file_path": "macros/generic_tests/unique_combination_of_columns.sql", "unique_id": "macro.dbt_utils.default__test_unique_combination_of_columns", "macro_sql": "{% macro default__test_unique_combination_of_columns(model, combination_of_columns, quote_columns=false) %}\n\n{% if not quote_columns %}\n {%- set column_list=combination_of_columns %}\n{% elif quote_columns %}\n {%- set column_list=[] %}\n {% for column in combination_of_columns -%}\n {% do column_list.append( adapter.quote(column) ) %}\n {%- endfor %}\n{% else %}\n {{ exceptions.raise_compiler_error(\n \"`quote_columns` argument for unique_combination_of_columns test must be one of [True, False] Got: '\" ~ quote ~\"'.'\"\n ) }}\n{% endif %}\n\n{%- set columns_csv=column_list | join(', ') %}\n\n\nwith validation_errors as (\n\n select\n {{ columns_csv }}\n from {{ model }}\n group by {{ columns_csv }}\n having count(*) > 1\n\n)\n\nselect *\nfrom validation_errors\n\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "combination_of_columns", "type": null, "description": ""}, {"name": "quote_columns", "type": null, "description": ""}], "created_at": 1789079002.5457141, "supported_languages": null}, "macro.dbt_utils.test_fewer_rows_than": {"name": "test_fewer_rows_than", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/fewer_rows_than.sql", "original_file_path": "macros/generic_tests/fewer_rows_than.sql", "unique_id": "macro.dbt_utils.test_fewer_rows_than", "macro_sql": "{% test fewer_rows_than(model, compare_model, group_by_columns = []) %}\n {{ return(adapter.dispatch('test_fewer_rows_than', 'dbt_utils')(model, compare_model, group_by_columns)) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_fewer_rows_than"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "compare_model", "type": null, "description": ""}, {"name": "group_by_columns", "type": null, "description": ""}], "created_at": 1789079002.5463417, "supported_languages": null}, "macro.dbt_utils.default__test_fewer_rows_than": {"name": "default__test_fewer_rows_than", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/fewer_rows_than.sql", "original_file_path": "macros/generic_tests/fewer_rows_than.sql", "unique_id": "macro.dbt_utils.default__test_fewer_rows_than", "macro_sql": "{% macro default__test_fewer_rows_than(model, compare_model, group_by_columns) %}\n\n{{ config(fail_calc = 'sum(coalesce(row_count_delta, 0))') }}\n\n{% if group_by_columns|length() > 0 %}\n {% set select_gb_cols = group_by_columns|join(' ,') + ', ' %}\n {% set join_gb_cols %}\n {% for c in group_by_columns %}\n and a.{{c}} = b.{{c}}\n {% endfor %}\n {% endset %}\n {% set groupby_gb_cols = 'group by ' + group_by_columns|join(',') %}\n{% endif %}\n\n{#-- We must add a fake join key in case additional grouping variables are not provided --#}\n{#-- Redshift does not allow for dynamically created join conditions (e.g. full join on 1 = 1 --#}\n{#-- The same logic is used in equal_rowcount. In case of changes, maintain consistent logic --#}\n{% set group_by_columns = ['id_dbtutils_test_fewer_rows_than'] + group_by_columns %}\n{% set groupby_gb_cols = 'group by ' + group_by_columns|join(',') %}\n\n\nwith a as (\n\n select \n {{select_gb_cols}}\n 1 as id_dbtutils_test_fewer_rows_than,\n count(*) as count_our_model \n from {{ model }}\n {{ groupby_gb_cols }}\n\n),\nb as (\n\n select \n {{select_gb_cols}}\n 1 as id_dbtutils_test_fewer_rows_than,\n count(*) as count_comparison_model \n from {{ compare_model }}\n {{ groupby_gb_cols }}\n\n),\ncounts as (\n\n select\n\n {% for c in group_by_columns -%}\n a.{{c}} as {{c}}_a,\n b.{{c}} as {{c}}_b,\n {% endfor %}\n\n count_our_model,\n count_comparison_model\n from a\n full join b on \n a.id_dbtutils_test_fewer_rows_than = b.id_dbtutils_test_fewer_rows_than\n {{ join_gb_cols }}\n\n),\nfinal as (\n\n select *,\n case\n -- fail the test if we have more rows than the reference model and return the row count delta\n when count_our_model > count_comparison_model then (count_our_model - count_comparison_model)\n -- fail the test if they are the same number\n when count_our_model = count_comparison_model then 1\n -- pass the test if the delta is positive (i.e. return the number 0)\n else 0\n end as row_count_delta\n from counts\n\n)\n\nselect * from final\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "compare_model", "type": null, "description": ""}, {"name": "group_by_columns", "type": null, "description": ""}], "created_at": 1789079002.54755, "supported_languages": null}, "macro.dbt_utils.test_not_null_proportion": {"name": "test_not_null_proportion", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/not_null_proportion.sql", "original_file_path": "macros/generic_tests/not_null_proportion.sql", "unique_id": "macro.dbt_utils.test_not_null_proportion", "macro_sql": "{% macro test_not_null_proportion(model, group_by_columns = []) %}\n {{ return(adapter.dispatch('test_not_null_proportion', 'dbt_utils')(model, group_by_columns, **kwargs)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_not_null_proportion"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "group_by_columns", "type": null, "description": ""}], "created_at": 1789079002.5480835, "supported_languages": null}, "macro.dbt_utils.default__test_not_null_proportion": {"name": "default__test_not_null_proportion", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/not_null_proportion.sql", "original_file_path": "macros/generic_tests/not_null_proportion.sql", "unique_id": "macro.dbt_utils.default__test_not_null_proportion", "macro_sql": "{% macro default__test_not_null_proportion(model, group_by_columns) %}\n\n{% set column_name = kwargs.get('column_name', kwargs.get('arg')) %}\n{% set at_least = kwargs.get('at_least', kwargs.get('arg')) %}\n{% set at_most = kwargs.get('at_most', kwargs.get('arg', 1)) %}\n\n{% if group_by_columns|length() > 0 %}\n {% set select_gb_cols = group_by_columns|join(' ,') + ', ' %}\n {% set groupby_gb_cols = 'group by ' + group_by_columns|join(',') %}\n{% endif %}\n\nwith validation as (\n select\n {{select_gb_cols}}\n sum(case when {{ column_name }} is null then 0 else 1 end) / cast(count(*) as {{ dbt.type_numeric() }}) as not_null_proportion\n from {{ model }}\n {{groupby_gb_cols}}\n),\nvalidation_errors as (\n select\n {{select_gb_cols}}\n not_null_proportion\n from validation\n where not_null_proportion < {{ at_least }} or not_null_proportion > {{ at_most }}\n)\nselect\n *\nfrom validation_errors\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.type_numeric"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "group_by_columns", "type": null, "description": ""}], "created_at": 1789079002.5490062, "supported_languages": null}, "macro.dbt_utils.test_equal_rowcount": {"name": "test_equal_rowcount", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/equal_rowcount.sql", "original_file_path": "macros/generic_tests/equal_rowcount.sql", "unique_id": "macro.dbt_utils.test_equal_rowcount", "macro_sql": "{% test equal_rowcount(model, compare_model, group_by_columns = []) %}\n {{ return(adapter.dispatch('test_equal_rowcount', 'dbt_utils')(model, compare_model, group_by_columns)) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_equal_rowcount"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "compare_model", "type": null, "description": ""}, {"name": "group_by_columns", "type": null, "description": ""}], "created_at": 1789079002.5496573, "supported_languages": null}, "macro.dbt_utils.default__test_equal_rowcount": {"name": "default__test_equal_rowcount", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/equal_rowcount.sql", "original_file_path": "macros/generic_tests/equal_rowcount.sql", "unique_id": "macro.dbt_utils.default__test_equal_rowcount", "macro_sql": "{% macro default__test_equal_rowcount(model, compare_model, group_by_columns) %}\n\n{#-- Needs to be set at parse time, before we return '' below --#}\n{{ config(fail_calc = 'sum(coalesce(diff_count, 0))') }}\n\n{#-- Prevent querying of db in parsing mode. This works because this macro does not create any new refs. #}\n{%- if not execute -%}\n {{ return('') }}\n{% endif %}\n\n{% if group_by_columns|length() > 0 %}\n {% set select_gb_cols = group_by_columns|join(', ') + ', ' %}\n {% set join_gb_cols %}\n {% for c in group_by_columns %}\n and a.{{c}} = b.{{c}}\n {% endfor %}\n {% endset %}\n {% set groupby_gb_cols = 'group by ' + group_by_columns|join(',') %}\n{% endif %}\n\n{#-- We must add a fake join key in case additional grouping variables are not provided --#}\n{#-- Redshift does not allow for dynamically created join conditions (e.g. full join on 1 = 1 --#}\n{#-- The same logic is used in fewer_rows_than. In case of changes, maintain consistent logic --#}\n{% set group_by_columns = ['id_dbtutils_test_equal_rowcount'] + group_by_columns %}\n{% set groupby_gb_cols = 'group by ' + group_by_columns|join(',') %}\n\nwith a as (\n\n select \n {{select_gb_cols}}\n 1 as id_dbtutils_test_equal_rowcount,\n count(*) as count_a \n from {{ model }}\n {{groupby_gb_cols}}\n\n\n),\nb as (\n\n select \n {{select_gb_cols}}\n 1 as id_dbtutils_test_equal_rowcount,\n count(*) as count_b \n from {{ compare_model }}\n {{groupby_gb_cols}}\n\n),\nfinal as (\n\n select\n \n {% for c in group_by_columns -%}\n a.{{c}} as {{c}}_a,\n b.{{c}} as {{c}}_b,\n {% endfor %}\n\n count_a,\n count_b,\n abs(count_a - count_b) as diff_count\n\n from a\n full join b\n on\n a.id_dbtutils_test_equal_rowcount = b.id_dbtutils_test_equal_rowcount\n {{join_gb_cols}}\n\n\n)\n\nselect * from final\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "compare_model", "type": null, "description": ""}, {"name": "group_by_columns", "type": null, "description": ""}], "created_at": 1789079002.5508635, "supported_languages": null}, "macro.dbt_utils.test_sequential_values": {"name": "test_sequential_values", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/sequential_values.sql", "original_file_path": "macros/generic_tests/sequential_values.sql", "unique_id": "macro.dbt_utils.test_sequential_values", "macro_sql": "{% test sequential_values(model, column_name, interval=1, datepart=None, group_by_columns = []) %}\n\n {{ return(adapter.dispatch('test_sequential_values', 'dbt_utils')(model, column_name, interval, datepart, group_by_columns)) }}\n\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_sequential_values"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "column_name", "type": null, "description": ""}, {"name": "interval", "type": null, "description": ""}, {"name": "datepart", "type": null, "description": ""}, {"name": "group_by_columns", "type": null, "description": ""}], "created_at": 1789079002.55147, "supported_languages": null}, "macro.dbt_utils.default__test_sequential_values": {"name": "default__test_sequential_values", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/sequential_values.sql", "original_file_path": "macros/generic_tests/sequential_values.sql", "unique_id": "macro.dbt_utils.default__test_sequential_values", "macro_sql": "{% macro default__test_sequential_values(model, column_name, interval=1, datepart=None, group_by_columns = []) %}\n\n{% set previous_column_name = \"previous_\" ~ dbt_utils.slugify(column_name) %}\n\n{% if group_by_columns|length() > 0 %}\n {% set select_gb_cols = group_by_columns|join(',') + ', ' %}\n {% set partition_gb_cols = 'partition by ' + group_by_columns|join(',') %}\n{% endif %}\n\nwith windowed as (\n\n select\n {{ select_gb_cols }}\n {{ column_name }},\n lag({{ column_name }}) over (\n {{partition_gb_cols}}\n order by {{ column_name }}\n ) as {{ previous_column_name }}\n from {{ model }}\n),\n\nvalidation_errors as (\n select\n *\n from windowed\n {% if datepart %}\n where not(cast({{ column_name }} as {{ dbt.type_timestamp() }})= cast({{ dbt.dateadd(datepart, interval, previous_column_name) }} as {{ dbt.type_timestamp() }}))\n {% else %}\n where not({{ column_name }} = {{ previous_column_name }} + {{ interval }})\n {% endif %}\n)\n\nselect *\nfrom validation_errors\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.slugify", "macro.dbt.type_timestamp", "macro.dbt.dateadd"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "column_name", "type": null, "description": ""}, {"name": "interval", "type": null, "description": ""}, {"name": "datepart", "type": null, "description": ""}, {"name": "group_by_columns", "type": null, "description": ""}], "created_at": 1789079002.552503, "supported_languages": null}, "macro.dbt_utils.test_mutually_exclusive_ranges": {"name": "test_mutually_exclusive_ranges", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/mutually_exclusive_ranges.sql", "original_file_path": "macros/generic_tests/mutually_exclusive_ranges.sql", "unique_id": "macro.dbt_utils.test_mutually_exclusive_ranges", "macro_sql": "{% test mutually_exclusive_ranges(model, lower_bound_column, upper_bound_column, partition_by=None, gaps='allowed', zero_length_range_allowed=False) %}\n {{ return(adapter.dispatch('test_mutually_exclusive_ranges', 'dbt_utils')(model, lower_bound_column, upper_bound_column, partition_by, gaps, zero_length_range_allowed)) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_mutually_exclusive_ranges"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "lower_bound_column", "type": null, "description": ""}, {"name": "upper_bound_column", "type": null, "description": ""}, {"name": "partition_by", "type": null, "description": ""}, {"name": "gaps", "type": null, "description": ""}, {"name": "zero_length_range_allowed", "type": null, "description": ""}], "created_at": 1789079002.5533931, "supported_languages": null}, "macro.dbt_utils.default__test_mutually_exclusive_ranges": {"name": "default__test_mutually_exclusive_ranges", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/mutually_exclusive_ranges.sql", "original_file_path": "macros/generic_tests/mutually_exclusive_ranges.sql", "unique_id": "macro.dbt_utils.default__test_mutually_exclusive_ranges", "macro_sql": "{% macro default__test_mutually_exclusive_ranges(model, lower_bound_column, upper_bound_column, partition_by=None, gaps='allowed', zero_length_range_allowed=False) %}\n{% if gaps == 'not_allowed' %}\n {% set allow_gaps_operator='=' %}\n {% set allow_gaps_operator_in_words='equal_to' %}\n{% elif gaps == 'allowed' %}\n {% set allow_gaps_operator='<=' %}\n {% set allow_gaps_operator_in_words='less_than_or_equal_to' %}\n{% elif gaps == 'required' %}\n {% set allow_gaps_operator='<' %}\n {% set allow_gaps_operator_in_words='less_than' %}\n{% else %}\n {{ exceptions.raise_compiler_error(\n \"`gaps` argument for mutually_exclusive_ranges test must be one of ['not_allowed', 'allowed', 'required'] Got: '\" ~ gaps ~\"'.'\"\n ) }}\n{% endif %}\n{% if not zero_length_range_allowed %}\n {% set allow_zero_length_operator='<' %}\n {% set allow_zero_length_operator_in_words='less_than' %}\n{% elif zero_length_range_allowed %}\n {% set allow_zero_length_operator='<=' %}\n {% set allow_zero_length_operator_in_words='less_than_or_equal_to' %}\n{% else %}\n {{ exceptions.raise_compiler_error(\n \"`zero_length_range_allowed` argument for mutually_exclusive_ranges test must be one of [true, false] Got: '\" ~ zero_length_range_allowed ~\"'.'\"\n ) }}\n{% endif %}\n\n{% set partition_clause=\"partition by \" ~ partition_by if partition_by else '' %}\n\nwith window_functions as (\n\n select\n {% if partition_by %}\n {{ partition_by }} as partition_by_col,\n {% endif %}\n {{ lower_bound_column }} as lower_bound,\n {{ upper_bound_column }} as upper_bound,\n\n lead({{ lower_bound_column }}) over (\n {{ partition_clause }}\n order by {{ lower_bound_column }}, {{ upper_bound_column }}\n ) as next_lower_bound,\n\n row_number() over (\n {{ partition_clause }}\n order by {{ lower_bound_column }} desc, {{ upper_bound_column }} desc\n ) = 1 as is_last_record\n\n from {{ model }}\n\n),\n\ncalc as (\n -- We want to return records where one of our assumptions fails, so we'll use\n -- the `not` function with `and` statements so we can write our assumptions more cleanly\n select\n *,\n\n -- For each record: lower_bound should be < upper_bound.\n -- Coalesce it to return an error on the null case (implicit assumption\n -- these columns are not_null)\n coalesce(\n lower_bound {{ allow_zero_length_operator }} upper_bound,\n false\n ) as lower_bound_{{ allow_zero_length_operator_in_words }}_upper_bound,\n\n -- For each record: upper_bound {{ allow_gaps_operator }} the next lower_bound.\n -- Coalesce it to handle null cases for the last record.\n coalesce(\n upper_bound {{ allow_gaps_operator }} next_lower_bound,\n is_last_record,\n false\n ) as upper_bound_{{ allow_gaps_operator_in_words }}_next_lower_bound\n\n from window_functions\n\n),\n\nvalidation_errors as (\n\n select\n *\n from calc\n\n where not(\n -- THE FOLLOWING SHOULD BE TRUE --\n lower_bound_{{ allow_zero_length_operator_in_words }}_upper_bound\n and upper_bound_{{ allow_gaps_operator_in_words }}_next_lower_bound\n )\n)\n\nselect * from validation_errors\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "lower_bound_column", "type": null, "description": ""}, {"name": "upper_bound_column", "type": null, "description": ""}, {"name": "partition_by", "type": null, "description": ""}, {"name": "gaps", "type": null, "description": ""}, {"name": "zero_length_range_allowed", "type": null, "description": ""}], "created_at": 1789079002.5553744, "supported_languages": null}, "macro.dbt_utils.test_cardinality_equality": {"name": "test_cardinality_equality", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/cardinality_equality.sql", "original_file_path": "macros/generic_tests/cardinality_equality.sql", "unique_id": "macro.dbt_utils.test_cardinality_equality", "macro_sql": "{% test cardinality_equality(model, column_name, to, field) %}\n {{ return(adapter.dispatch('test_cardinality_equality', 'dbt_utils')(model, column_name, to, field)) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_cardinality_equality"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "column_name", "type": null, "description": ""}, {"name": "to", "type": null, "description": ""}, {"name": "field", "type": null, "description": ""}], "created_at": 1789079002.555836, "supported_languages": null}, "macro.dbt_utils.default__test_cardinality_equality": {"name": "default__test_cardinality_equality", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/cardinality_equality.sql", "original_file_path": "macros/generic_tests/cardinality_equality.sql", "unique_id": "macro.dbt_utils.default__test_cardinality_equality", "macro_sql": "{% macro default__test_cardinality_equality(model, column_name, to, field) %}\n\n{# T-SQL does not let you use numbers as aliases for columns #}\n{# Thus, no \"GROUP BY 1\" #}\n\nwith table_a as (\nselect\n {{ column_name }},\n count(*) as num_rows\nfrom {{ model }}\ngroup by {{ column_name }}\n),\n\ntable_b as (\nselect\n {{ field }},\n count(*) as num_rows\nfrom {{ to }}\ngroup by {{ field }}\n),\n\nexcept_a as (\n select *\n from table_a\n {{ dbt.except() }}\n select *\n from table_b\n),\n\nexcept_b as (\n select *\n from table_b\n {{ dbt.except() }}\n select *\n from table_a\n),\n\nunioned as (\n select *\n from except_a\n union all\n select *\n from except_b\n)\n\nselect *\nfrom unioned\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.except"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "column_name", "type": null, "description": ""}, {"name": "to", "type": null, "description": ""}, {"name": "field", "type": null, "description": ""}], "created_at": 1789079002.556247, "supported_languages": null}, "macro.dbt_utils.test_relationships_where": {"name": "test_relationships_where", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/relationships_where.sql", "original_file_path": "macros/generic_tests/relationships_where.sql", "unique_id": "macro.dbt_utils.test_relationships_where", "macro_sql": "{% test relationships_where(model, column_name, to, field, from_condition=\"1=1\", to_condition=\"1=1\") %}\n {{ return(adapter.dispatch('test_relationships_where', 'dbt_utils')(model, column_name, to, field, from_condition, to_condition)) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_relationships_where"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "column_name", "type": null, "description": ""}, {"name": "to", "type": null, "description": ""}, {"name": "field", "type": null, "description": ""}, {"name": "from_condition", "type": null, "description": ""}, {"name": "to_condition", "type": null, "description": ""}], "created_at": 1789079002.5567567, "supported_languages": null}, "macro.dbt_utils.default__test_relationships_where": {"name": "default__test_relationships_where", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/relationships_where.sql", "original_file_path": "macros/generic_tests/relationships_where.sql", "unique_id": "macro.dbt_utils.default__test_relationships_where", "macro_sql": "{% macro default__test_relationships_where(model, column_name, to, field, from_condition=\"1=1\", to_condition=\"1=1\") %}\n\n{# T-SQL has no boolean data type so we use 1=1 which returns TRUE #}\n{# ref https://stackoverflow.com/a/7170753/3842610 #}\n\nwith left_table as (\n\n select\n {{column_name}} as id\n\n from {{model}}\n\n where {{column_name}} is not null\n and {{from_condition}}\n\n),\n\nright_table as (\n\n select\n {{field}} as id\n\n from {{to}}\n\n where {{field}} is not null\n and {{to_condition}}\n\n),\n\nexceptions as (\n\n select\n left_table.id,\n right_table.id as right_id\n\n from left_table\n\n left join right_table\n on left_table.id = right_table.id\n\n where right_table.id is null\n\n)\n\nselect * from exceptions\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "column_name", "type": null, "description": ""}, {"name": "to", "type": null, "description": ""}, {"name": "field", "type": null, "description": ""}, {"name": "from_condition", "type": null, "description": ""}, {"name": "to_condition", "type": null, "description": ""}], "created_at": 1789079002.5571518, "supported_languages": null}, "macro.dbt_utils.test_expression_is_true": {"name": "test_expression_is_true", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/expression_is_true.sql", "original_file_path": "macros/generic_tests/expression_is_true.sql", "unique_id": "macro.dbt_utils.test_expression_is_true", "macro_sql": "{% test expression_is_true(model, expression, column_name=None) %}\n {{ return(adapter.dispatch('test_expression_is_true', 'dbt_utils')(model, expression, column_name)) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_expression_is_true"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "expression", "type": null, "description": ""}, {"name": "column_name", "type": null, "description": ""}], "created_at": 1789079002.5575602, "supported_languages": null}, "macro.dbt_utils.default__test_expression_is_true": {"name": "default__test_expression_is_true", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/expression_is_true.sql", "original_file_path": "macros/generic_tests/expression_is_true.sql", "unique_id": "macro.dbt_utils.default__test_expression_is_true", "macro_sql": "{% macro default__test_expression_is_true(model, expression, column_name) %}\n\n{% set column_list = '*' if should_store_failures() else \"1\" %}\n\nselect\n {{ column_list }}\nfrom {{ model }}\n{% if column_name is none %}\nwhere not({{ expression }})\n{%- else %}\nwhere not({{ column_name }} {{ expression }})\n{%- endif %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.should_store_failures"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "expression", "type": null, "description": ""}, {"name": "column_name", "type": null, "description": ""}], "created_at": 1789079002.5579948, "supported_languages": null}, "macro.dbt_utils.test_not_accepted_values": {"name": "test_not_accepted_values", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/not_accepted_values.sql", "original_file_path": "macros/generic_tests/not_accepted_values.sql", "unique_id": "macro.dbt_utils.test_not_accepted_values", "macro_sql": "{% test not_accepted_values(model, column_name, values, quote=True) %}\n {{ return(adapter.dispatch('test_not_accepted_values', 'dbt_utils')(model, column_name, values, quote)) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_not_accepted_values"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "column_name", "type": null, "description": ""}, {"name": "values", "type": null, "description": ""}, {"name": "quote", "type": null, "description": ""}], "created_at": 1789079002.5584416, "supported_languages": null}, "macro.dbt_utils.default__test_not_accepted_values": {"name": "default__test_not_accepted_values", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/not_accepted_values.sql", "original_file_path": "macros/generic_tests/not_accepted_values.sql", "unique_id": "macro.dbt_utils.default__test_not_accepted_values", "macro_sql": "{% macro default__test_not_accepted_values(model, column_name, values, quote=True) %}\nwith all_values as (\n\n select distinct\n {{ column_name }} as value_field\n\n from {{ model }}\n\n),\n\nvalidation_errors as (\n\n select\n value_field\n\n from all_values\n where value_field in (\n {% for value in values -%}\n {% if quote -%}\n '{{ value }}'\n {%- else -%}\n {{ value }}\n {%- endif -%}\n {%- if not loop.last -%},{%- endif %}\n {%- endfor %}\n )\n\n)\n\nselect *\nfrom validation_errors\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "column_name", "type": null, "description": ""}, {"name": "values", "type": null, "description": ""}, {"name": "quote", "type": null, "description": ""}], "created_at": 1789079002.5588915, "supported_languages": null}, "macro.dbt_utils.test_accepted_range": {"name": "test_accepted_range", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/accepted_range.sql", "original_file_path": "macros/generic_tests/accepted_range.sql", "unique_id": "macro.dbt_utils.test_accepted_range", "macro_sql": "{% test accepted_range(model, column_name, min_value=none, max_value=none, inclusive=true) %}\n {{ return(adapter.dispatch('test_accepted_range', 'dbt_utils')(model, column_name, min_value, max_value, inclusive)) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_accepted_range"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "column_name", "type": null, "description": ""}, {"name": "min_value", "type": null, "description": ""}, {"name": "max_value", "type": null, "description": ""}, {"name": "inclusive", "type": null, "description": ""}], "created_at": 1789079002.5594022, "supported_languages": null}, "macro.dbt_utils.default__test_accepted_range": {"name": "default__test_accepted_range", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/accepted_range.sql", "original_file_path": "macros/generic_tests/accepted_range.sql", "unique_id": "macro.dbt_utils.default__test_accepted_range", "macro_sql": "{% macro default__test_accepted_range(model, column_name, min_value=none, max_value=none, inclusive=true) %}\n\nwith meet_condition as(\n select *\n from {{ model }}\n),\n\nvalidation_errors as (\n select *\n from meet_condition\n where\n -- never true, defaults to an empty result set. Exists to ensure any combo of the `or` clauses below succeeds\n 1 = 2\n\n {%- if min_value is not none %}\n -- records with a value >= min_value are permitted. The `not` flips this to find records that don't meet the rule.\n or not {{ column_name }} > {{- \"=\" if inclusive }} {{ min_value }}\n {%- endif %}\n\n {%- if max_value is not none %}\n -- records with a value <= max_value are permitted. The `not` flips this to find records that don't meet the rule.\n or not {{ column_name }} < {{- \"=\" if inclusive }} {{ max_value }}\n {%- endif %}\n)\n\nselect *\nfrom validation_errors\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "column_name", "type": null, "description": ""}, {"name": "min_value", "type": null, "description": ""}, {"name": "max_value", "type": null, "description": ""}, {"name": "inclusive", "type": null, "description": ""}], "created_at": 1789079002.559936, "supported_languages": null}, "macro.dbt_utils.get_url_parameter": {"name": "get_url_parameter", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/web/get_url_parameter.sql", "original_file_path": "macros/web/get_url_parameter.sql", "unique_id": "macro.dbt_utils.get_url_parameter", "macro_sql": "{% macro get_url_parameter(field, url_parameter) -%}\n {{ return(adapter.dispatch('get_url_parameter', 'dbt_utils')(field, url_parameter)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__get_url_parameter"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field", "type": null, "description": ""}, {"name": "url_parameter", "type": null, "description": ""}], "created_at": 1789079002.5602832, "supported_languages": null}, "macro.dbt_utils.default__get_url_parameter": {"name": "default__get_url_parameter", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/web/get_url_parameter.sql", "original_file_path": "macros/web/get_url_parameter.sql", "unique_id": "macro.dbt_utils.default__get_url_parameter", "macro_sql": "{% macro default__get_url_parameter(field, url_parameter) -%}\n\n{%- set formatted_url_parameter = \"'\" + url_parameter + \"='\" -%}\n\n{%- set split = dbt.split_part(dbt.split_part(field, formatted_url_parameter, 2), \"'&'\", 1) -%}\n\nnullif({{ split }},'')\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.split_part"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field", "type": null, "description": ""}, {"name": "url_parameter", "type": null, "description": ""}], "created_at": 1789079002.5606549, "supported_languages": null}, "macro.dbt_utils.get_url_host": {"name": "get_url_host", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/web/get_url_host.sql", "original_file_path": "macros/web/get_url_host.sql", "unique_id": "macro.dbt_utils.get_url_host", "macro_sql": "{% macro get_url_host(field) -%}\n {{ return(adapter.dispatch('get_url_host', 'dbt_utils')(field)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__get_url_host"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field", "type": null, "description": ""}], "created_at": 1789079002.5610063, "supported_languages": null}, "macro.dbt_utils.default__get_url_host": {"name": "default__get_url_host", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/web/get_url_host.sql", "original_file_path": "macros/web/get_url_host.sql", "unique_id": "macro.dbt_utils.default__get_url_host", "macro_sql": "{% macro default__get_url_host(field) -%}\n\n{%- set parsed =\n dbt.split_part(\n dbt.split_part(\n dbt.replace(\n dbt.replace(\n dbt.replace(field, \"'android-app://'\", \"''\"\n ), \"'http://'\", \"''\"\n ), \"'https://'\", \"''\"\n ), \"'/'\", 1\n ), \"'?'\", 1\n )\n\n-%}\n\n\n {{ dbt.safe_cast(\n parsed,\n dbt.type_string()\n )}}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.split_part", "macro.dbt.replace", "macro.dbt.safe_cast", "macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field", "type": null, "description": ""}], "created_at": 1789079002.5615854, "supported_languages": null}, "macro.dbt_utils.get_url_path": {"name": "get_url_path", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/web/get_url_path.sql", "original_file_path": "macros/web/get_url_path.sql", "unique_id": "macro.dbt_utils.get_url_path", "macro_sql": "{% macro get_url_path(field) -%}\n {{ return(adapter.dispatch('get_url_path', 'dbt_utils')(field)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__get_url_path"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field", "type": null, "description": ""}], "created_at": 1789079002.5619912, "supported_languages": null}, "macro.dbt_utils.default__get_url_path": {"name": "default__get_url_path", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/web/get_url_path.sql", "original_file_path": "macros/web/get_url_path.sql", "unique_id": "macro.dbt_utils.default__get_url_path", "macro_sql": "{% macro default__get_url_path(field) -%}\n\n {%- set stripped_url =\n dbt.replace(\n dbt.replace(field, \"'http://'\", \"''\"), \"'https://'\", \"''\")\n -%}\n\n {%- set first_slash_pos -%}\n coalesce(\n nullif({{ dbt.position(\"'/'\", stripped_url) }}, 0),\n {{ dbt.position(\"'?'\", stripped_url) }} - 1\n )\n {%- endset -%}\n\n {%- set parsed_path =\n dbt.split_part(\n dbt.right(\n stripped_url,\n dbt.length(stripped_url) ~ \"-\" ~ first_slash_pos\n ),\n \"'?'\", 1\n )\n -%}\n\n {{ dbt.safe_cast(\n parsed_path,\n dbt.type_string()\n )}}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.replace", "macro.dbt.position", "macro.dbt.split_part", "macro.dbt.right", "macro.dbt.length", "macro.dbt.safe_cast", "macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field", "type": null, "description": ""}], "created_at": 1789079002.5627022, "supported_languages": null}, "macro.dbt_utils.get_column_values": {"name": "get_column_values", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_column_values.sql", "original_file_path": "macros/sql/get_column_values.sql", "unique_id": "macro.dbt_utils.get_column_values", "macro_sql": "{% macro get_column_values(table, column, order_by='count(*) desc', max_records=none, default=none, where=none) -%}\n {{ return(adapter.dispatch('get_column_values', 'dbt_utils')(table, column, order_by, max_records, default, where)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__get_column_values"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "table", "type": null, "description": ""}, {"name": "column", "type": null, "description": ""}, {"name": "order_by", "type": null, "description": ""}, {"name": "max_records", "type": null, "description": ""}, {"name": "default", "type": null, "description": ""}, {"name": "where", "type": null, "description": ""}], "created_at": 1789079002.563491, "supported_languages": null}, "macro.dbt_utils.default__get_column_values": {"name": "default__get_column_values", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_column_values.sql", "original_file_path": "macros/sql/get_column_values.sql", "unique_id": "macro.dbt_utils.default__get_column_values", "macro_sql": "{% macro default__get_column_values(table, column, order_by='count(*) desc', max_records=none, default=none, where=none) -%}\n {#-- Prevent querying of db in parsing mode. This works because this macro does not create any new refs. #}\n {%- if not execute -%}\n {% set default = [] if not default %}\n {{ return(default) }}\n {% endif %}\n\n {%- do dbt_utils._is_ephemeral(table, 'get_column_values') -%}\n\n {# Not all relations are tables. Renaming for internal clarity without breaking functionality for anyone using named arguments #}\n {# TODO: Change the method signature in a future 0.x.0 release #}\n {%- set target_relation = table -%}\n\n {# adapter.load_relation is a convenience wrapper to avoid building a Relation when we already have one #}\n {% set relation_exists = (load_relation(target_relation)) is not none %}\n\n {%- call statement('get_column_values', fetch_result=true) %}\n\n {%- if not relation_exists and default is none -%}\n\n {{ exceptions.raise_compiler_error(\"In get_column_values(): relation \" ~ target_relation ~ \" does not exist and no default value was provided.\") }}\n\n {%- elif not relation_exists and default is not none -%}\n\n {{ log(\"Relation \" ~ target_relation ~ \" does not exist. Returning the default value: \" ~ default) }}\n\n {{ return(default) }}\n\n {%- else -%}\n\n\n select\n {{ column }} as value\n\n from {{ target_relation }}\n\n {% if where is not none %}\n where {{ where }}\n {% endif %}\n\n group by {{ column }}\n order by {{ order_by }}\n\n {% if max_records is not none %}\n limit {{ max_records }}\n {% endif %}\n\n {% endif %}\n\n {%- endcall -%}\n\n {%- set value_list = load_result('get_column_values') -%}\n\n {%- if value_list and value_list['data'] -%}\n {%- set values = value_list['data'] | map(attribute=0) | list %}\n {{ return(values) }}\n {%- else -%}\n {{ return(default) }}\n {%- endif -%}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_utils._is_ephemeral", "macro.dbt.load_relation", "macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "table", "type": null, "description": ""}, {"name": "column", "type": null, "description": ""}, {"name": "order_by", "type": null, "description": ""}, {"name": "max_records", "type": null, "description": ""}, {"name": "default", "type": null, "description": ""}, {"name": "where", "type": null, "description": ""}], "created_at": 1789079002.5651813, "supported_languages": null}, "macro.dbt_utils.star": {"name": "star", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/star.sql", "original_file_path": "macros/sql/star.sql", "unique_id": "macro.dbt_utils.star", "macro_sql": "{% macro star(from, relation_alias=False, except=[], prefix='', suffix='', quote_identifiers=True, unquote_aliases=False, rename={}) -%}\r\n {{ return(adapter.dispatch('star', 'dbt_utils')(from, relation_alias, except, prefix, suffix, quote_identifiers, unquote_aliases, rename)) }}\r\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__star"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "from", "type": null, "description": ""}, {"name": "relation_alias", "type": null, "description": ""}, {"name": "except", "type": null, "description": ""}, {"name": "prefix", "type": null, "description": ""}, {"name": "suffix", "type": null, "description": ""}, {"name": "quote_identifiers", "type": null, "description": ""}, {"name": "unquote_aliases", "type": null, "description": ""}, {"name": "rename", "type": null, "description": ""}], "created_at": 1789079002.5661552, "supported_languages": null}, "macro.dbt_utils.default__star": {"name": "default__star", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/star.sql", "original_file_path": "macros/sql/star.sql", "unique_id": "macro.dbt_utils.default__star", "macro_sql": "{% macro default__star(from, relation_alias=False, except=[], prefix='', suffix='', quote_identifiers=True, unquote_aliases=False, rename={}) -%}\r\n {%- do dbt_utils._is_relation(from, 'star') -%}\r\n {%- do dbt_utils._is_ephemeral(from, 'star') -%}\r\n\r\n {#-- Prevent querying of db in parsing mode. This works because this macro does not create any new refs. #}\r\n {%- if not execute -%}\r\n {% do return('*') %}\r\n {%- endif -%}\r\n\r\n {% set cols = dbt_utils.get_filtered_columns_in_relation(from, except) %}\r\n\r\n {%- set rename_lower = {} -%}\r\n {%- for key, val in rename.items() -%}\r\n {%- do rename_lower.update({key.lower(): val}) -%}\r\n {%- endfor -%}\r\n\r\n {%- if cols|length <= 0 -%}\r\n {% if flags.WHICH == 'compile' %}\r\n {% set response %}\r\n*\r\n/* No columns were returned. Maybe the relation doesn't exist yet\r\nor all columns were excluded. This star is only output during\r\ndbt compile, and exists to keep SQLFluff happy. */\r\n {% endset %}\r\n {% do return(response) %}\r\n {% else %}\r\n {% do return(\"/* no columns returned from star() macro */\") %}\r\n {% endif %}\r\n {%- else -%}\r\n {%- for col in cols %}\r\n {%- if relation_alias %}{{ relation_alias }}.{% else %}{%- endif -%}\r\n {%- if quote_identifiers -%}\r\n {{ adapter.quote(col)|trim }}\r\n {%- if col.lower() in rename_lower %} as {{ rename_lower[col.lower()] }}\r\n {%- elif unquote_aliases %} as {{ (prefix ~ col ~ suffix)|trim }}\r\n {%- elif prefix!='' or suffix!='' %} as {{ adapter.quote(prefix ~ col ~ suffix)|trim }}\r\n {%- endif -%}\r\n {%- else -%}\r\n {{ col|trim }}\r\n {%- if col.lower() in rename_lower %} as {{ rename_lower[col.lower()] }}\r\n {%- elif prefix!='' or suffix!='' %} as {{ (prefix ~ col ~ suffix)|trim }}\r\n {%- endif -%}\r\n {%- endif -%}\r\n {%- if not loop.last %},{{ '\\n ' }}{%- endif -%}\r\n {%- endfor -%}\r\n {% endif %}\r\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_utils._is_relation", "macro.dbt_utils._is_ephemeral", "macro.dbt_utils.get_filtered_columns_in_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "from", "type": null, "description": ""}, {"name": "relation_alias", "type": null, "description": ""}, {"name": "except", "type": null, "description": ""}, {"name": "prefix", "type": null, "description": ""}, {"name": "suffix", "type": null, "description": ""}, {"name": "quote_identifiers", "type": null, "description": ""}, {"name": "unquote_aliases", "type": null, "description": ""}, {"name": "rename", "type": null, "description": ""}], "created_at": 1789079002.5684385, "supported_languages": null}, "macro.dbt_utils.get_table_types_sql": {"name": "get_table_types_sql", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_table_types_sql.sql", "original_file_path": "macros/sql/get_table_types_sql.sql", "unique_id": "macro.dbt_utils.get_table_types_sql", "macro_sql": "{%- macro get_table_types_sql() -%}\n {{ return(adapter.dispatch('get_table_types_sql', 'dbt_utils')()) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt_utils.postgres__get_table_types_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789079002.568854, "supported_languages": null}, "macro.dbt_utils.default__get_table_types_sql": {"name": "default__get_table_types_sql", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_table_types_sql.sql", "original_file_path": "macros/sql/get_table_types_sql.sql", "unique_id": "macro.dbt_utils.default__get_table_types_sql", "macro_sql": "{% macro default__get_table_types_sql() %}\n case table_type\n when 'BASE TABLE' then 'table'\n when 'EXTERNAL TABLE' then 'external'\n when 'MATERIALIZED VIEW' then 'materializedview'\n else lower(table_type)\n end as {{ adapter.quote('table_type') }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789079002.5690289, "supported_languages": null}, "macro.dbt_utils.postgres__get_table_types_sql": {"name": "postgres__get_table_types_sql", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_table_types_sql.sql", "original_file_path": "macros/sql/get_table_types_sql.sql", "unique_id": "macro.dbt_utils.postgres__get_table_types_sql", "macro_sql": "{% macro postgres__get_table_types_sql() %}\n case table_type\n when 'BASE TABLE' then 'table'\n when 'FOREIGN' then 'external'\n when 'MATERIALIZED VIEW' then 'materializedview'\n else lower(table_type)\n end as {{ adapter.quote('table_type') }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789079002.5691931, "supported_languages": null}, "macro.dbt_utils.databricks__get_table_types_sql": {"name": "databricks__get_table_types_sql", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_table_types_sql.sql", "original_file_path": "macros/sql/get_table_types_sql.sql", "unique_id": "macro.dbt_utils.databricks__get_table_types_sql", "macro_sql": "{% macro databricks__get_table_types_sql() %}\n case table_type\n when 'MANAGED' then 'table'\n when 'BASE TABLE' then 'table'\n when 'MATERIALIZED VIEW' then 'materializedview'\n else lower(table_type)\n end as {{ adapter.quote('table_type') }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789079002.5693538, "supported_languages": null}, "macro.dbt_utils.get_tables_by_pattern_sql": {"name": "get_tables_by_pattern_sql", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_tables_by_pattern_sql.sql", "original_file_path": "macros/sql/get_tables_by_pattern_sql.sql", "unique_id": "macro.dbt_utils.get_tables_by_pattern_sql", "macro_sql": "{% macro get_tables_by_pattern_sql(schema_pattern, table_pattern, exclude='', database=target.database) %}\n {{ return(adapter.dispatch('get_tables_by_pattern_sql', 'dbt_utils')\n (schema_pattern, table_pattern, exclude, database)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__get_tables_by_pattern_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "schema_pattern", "type": null, "description": ""}, {"name": "table_pattern", "type": null, "description": ""}, {"name": "exclude", "type": null, "description": ""}, {"name": "database", "type": null, "description": ""}], "created_at": 1789079002.5702503, "supported_languages": null}, "macro.dbt_utils.default__get_tables_by_pattern_sql": {"name": "default__get_tables_by_pattern_sql", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_tables_by_pattern_sql.sql", "original_file_path": "macros/sql/get_tables_by_pattern_sql.sql", "unique_id": "macro.dbt_utils.default__get_tables_by_pattern_sql", "macro_sql": "{% macro default__get_tables_by_pattern_sql(schema_pattern, table_pattern, exclude='', database=target.database) %}\n\n select distinct\n table_schema as {{ adapter.quote('table_schema') }},\n table_name as {{ adapter.quote('table_name') }},\n {{ dbt_utils.get_table_types_sql() }}\n from {{ database }}.information_schema.tables\n where table_schema ilike '{{ schema_pattern }}'\n and table_name ilike '{{ table_pattern }}'\n and table_name not ilike '{{ exclude }}'\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.get_table_types_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "schema_pattern", "type": null, "description": ""}, {"name": "table_pattern", "type": null, "description": ""}, {"name": "exclude", "type": null, "description": ""}, {"name": "database", "type": null, "description": ""}], "created_at": 1789079002.5706558, "supported_languages": null}, "macro.dbt_utils.redshift__get_tables_by_pattern_sql": {"name": "redshift__get_tables_by_pattern_sql", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_tables_by_pattern_sql.sql", "original_file_path": "macros/sql/get_tables_by_pattern_sql.sql", "unique_id": "macro.dbt_utils.redshift__get_tables_by_pattern_sql", "macro_sql": "{% macro redshift__get_tables_by_pattern_sql(schema_pattern, table_pattern, exclude='', database=target.database) %}\n\n {% set sql %}\n select distinct\n table_schema as {{ adapter.quote('table_schema') }},\n table_name as {{ adapter.quote('table_name') }},\n {{ dbt_utils.get_table_types_sql() }}\n from \"{{ database }}\".\"information_schema\".\"tables\"\n where table_schema ilike '{{ schema_pattern }}'\n and table_name ilike '{{ table_pattern }}'\n and table_name not ilike '{{ exclude }}'\n union all\n select distinct\n schemaname as {{ adapter.quote('table_schema') }},\n tablename as {{ adapter.quote('table_name') }},\n 'external' as {{ adapter.quote('table_type') }}\n from svv_external_tables\n where redshift_database_name = '{{ database }}'\n and schemaname ilike '{{ schema_pattern }}'\n and table_name ilike '{{ table_pattern }}'\n and table_name not ilike '{{ exclude }}'\n {% endset %}\n\n {{ return(sql) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.get_table_types_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "schema_pattern", "type": null, "description": ""}, {"name": "table_pattern", "type": null, "description": ""}, {"name": "exclude", "type": null, "description": ""}, {"name": "database", "type": null, "description": ""}], "created_at": 1789079002.571403, "supported_languages": null}, "macro.dbt_utils.bigquery__get_tables_by_pattern_sql": {"name": "bigquery__get_tables_by_pattern_sql", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_tables_by_pattern_sql.sql", "original_file_path": "macros/sql/get_tables_by_pattern_sql.sql", "unique_id": "macro.dbt_utils.bigquery__get_tables_by_pattern_sql", "macro_sql": "{% macro bigquery__get_tables_by_pattern_sql(schema_pattern, table_pattern, exclude='', database=target.database) %}\n\n {% if '%' in schema_pattern %}\n {% set schemata=dbt_utils._bigquery__get_matching_schemata(schema_pattern, database) %}\n {% else %}\n {% set schemata=[schema_pattern] %}\n {% endif %}\n\n {% set sql %}\n {% for schema in schemata %}\n select distinct\n table_schema,\n table_name,\n {{ dbt_utils.get_table_types_sql() }}\n\n from {{ adapter.quote(database) }}.{{ schema }}.INFORMATION_SCHEMA.TABLES\n where lower(table_name) like lower ('{{ table_pattern }}')\n and lower(table_name) not like lower ('{{ exclude }}')\n\n {% if not loop.last %} union all {% endif %}\n\n {% endfor %}\n {% endset %}\n\n {{ return(sql) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils._bigquery__get_matching_schemata", "macro.dbt_utils.get_table_types_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "schema_pattern", "type": null, "description": ""}, {"name": "table_pattern", "type": null, "description": ""}, {"name": "exclude", "type": null, "description": ""}, {"name": "database", "type": null, "description": ""}], "created_at": 1789079002.5722122, "supported_languages": null}, "macro.dbt_utils._bigquery__get_matching_schemata": {"name": "_bigquery__get_matching_schemata", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_tables_by_pattern_sql.sql", "original_file_path": "macros/sql/get_tables_by_pattern_sql.sql", "unique_id": "macro.dbt_utils._bigquery__get_matching_schemata", "macro_sql": "{% macro _bigquery__get_matching_schemata(schema_pattern, database) %}\n {% if execute %}\n\n {% set sql %}\n select schema_name from {{ adapter.quote(database) }}.INFORMATION_SCHEMA.SCHEMATA\n where lower(schema_name) like lower('{{ schema_pattern }}')\n {% endset %}\n\n {% set results=run_query(sql) %}\n\n {% set schemata=results.columns['schema_name'].values() %}\n\n {{ return(schemata) }}\n\n {% else %}\n\n {{ return([]) }}\n\n {% endif %}\n\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "schema_pattern", "type": null, "description": ""}, {"name": "database", "type": null, "description": ""}], "created_at": 1789079002.5727665, "supported_languages": null}, "macro.dbt_utils.get_tables_by_prefix_sql": {"name": "get_tables_by_prefix_sql", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_tables_by_prefix_sql.sql", "original_file_path": "macros/sql/get_tables_by_prefix_sql.sql", "unique_id": "macro.dbt_utils.get_tables_by_prefix_sql", "macro_sql": "{% macro get_tables_by_prefix_sql(schema, prefix, exclude='', database=target.database) %}\n {{ return(adapter.dispatch('get_tables_by_prefix_sql', 'dbt_utils')(schema, prefix, exclude, database)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__get_tables_by_prefix_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "schema", "type": null, "description": ""}, {"name": "prefix", "type": null, "description": ""}, {"name": "exclude", "type": null, "description": ""}, {"name": "database", "type": null, "description": ""}], "created_at": 1789079002.573207, "supported_languages": null}, "macro.dbt_utils.default__get_tables_by_prefix_sql": {"name": "default__get_tables_by_prefix_sql", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_tables_by_prefix_sql.sql", "original_file_path": "macros/sql/get_tables_by_prefix_sql.sql", "unique_id": "macro.dbt_utils.default__get_tables_by_prefix_sql", "macro_sql": "{% macro default__get_tables_by_prefix_sql(schema, prefix, exclude='', database=target.database) %}\n\n {{ dbt_utils.get_tables_by_pattern_sql(\n schema_pattern = schema,\n table_pattern = prefix ~ '%',\n exclude = exclude,\n database = database\n ) }}\n \n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.get_tables_by_pattern_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "schema", "type": null, "description": ""}, {"name": "prefix", "type": null, "description": ""}, {"name": "exclude", "type": null, "description": ""}, {"name": "database", "type": null, "description": ""}], "created_at": 1789079002.5735152, "supported_languages": null}, "macro.dbt_utils.degrees_to_radians": {"name": "degrees_to_radians", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/haversine_distance.sql", "original_file_path": "macros/sql/haversine_distance.sql", "unique_id": "macro.dbt_utils.degrees_to_radians", "macro_sql": "{% macro degrees_to_radians(degrees) -%}\n acos(-1) * {{degrees}} / 180\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "degrees", "type": null, "description": ""}], "created_at": 1789079002.574017, "supported_languages": null}, "macro.dbt_utils.haversine_distance": {"name": "haversine_distance", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/haversine_distance.sql", "original_file_path": "macros/sql/haversine_distance.sql", "unique_id": "macro.dbt_utils.haversine_distance", "macro_sql": "{% macro haversine_distance(lat1, lon1, lat2, lon2, unit='mi') -%}\n {{ return(adapter.dispatch('haversine_distance', 'dbt_utils')(lat1,lon1,lat2,lon2,unit)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__haversine_distance"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "lat1", "type": null, "description": ""}, {"name": "lon1", "type": null, "description": ""}, {"name": "lat2", "type": null, "description": ""}, {"name": "lon2", "type": null, "description": ""}, {"name": "unit", "type": null, "description": ""}], "created_at": 1789079002.5743196, "supported_languages": null}, "macro.dbt_utils.default__haversine_distance": {"name": "default__haversine_distance", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/haversine_distance.sql", "original_file_path": "macros/sql/haversine_distance.sql", "unique_id": "macro.dbt_utils.default__haversine_distance", "macro_sql": "{% macro default__haversine_distance(lat1, lon1, lat2, lon2, unit='mi') -%}\n{%- if unit == 'mi' %}\n {% set conversion_rate = 1 %}\n{% elif unit == 'km' %}\n {% set conversion_rate = 1.60934 %}\n{% else %}\n {{ exceptions.raise_compiler_error(\"unit input must be one of 'mi' or 'km'. Got \" ~ unit) }}\n{% endif %}\n\n 2 * 3961 * asin(sqrt(power((sin(radians(({{ lat2 }} - {{ lat1 }}) / 2))), 2) +\n cos(radians({{lat1}})) * cos(radians({{lat2}})) *\n power((sin(radians(({{ lon2 }} - {{ lon1 }}) / 2))), 2))) * {{ conversion_rate }}\n\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "lat1", "type": null, "description": ""}, {"name": "lon1", "type": null, "description": ""}, {"name": "lat2", "type": null, "description": ""}, {"name": "lon2", "type": null, "description": ""}, {"name": "unit", "type": null, "description": ""}], "created_at": 1789079002.5750463, "supported_languages": null}, "macro.dbt_utils.bigquery__haversine_distance": {"name": "bigquery__haversine_distance", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/haversine_distance.sql", "original_file_path": "macros/sql/haversine_distance.sql", "unique_id": "macro.dbt_utils.bigquery__haversine_distance", "macro_sql": "{% macro bigquery__haversine_distance(lat1, lon1, lat2, lon2, unit='mi') -%}\n{% set radians_lat1 = dbt_utils.degrees_to_radians(lat1) %}\n{% set radians_lat2 = dbt_utils.degrees_to_radians(lat2) %}\n{% set radians_lon1 = dbt_utils.degrees_to_radians(lon1) %}\n{% set radians_lon2 = dbt_utils.degrees_to_radians(lon2) %}\n{%- if unit == 'mi' %}\n {% set conversion_rate = 1 %}\n{% elif unit == 'km' %}\n {% set conversion_rate = 1.60934 %}\n{% else %}\n {{ exceptions.raise_compiler_error(\"unit input must be one of 'mi' or 'km'. Got \" ~ unit) }}\n{% endif %}\n 2 * 3961 * asin(sqrt(power(sin(({{ radians_lat2 }} - {{ radians_lat1 }}) / 2), 2) +\n cos({{ radians_lat1 }}) * cos({{ radians_lat2 }}) *\n power(sin(({{ radians_lon2 }} - {{ radians_lon1 }}) / 2), 2))) * {{ conversion_rate }}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.degrees_to_radians"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "lat1", "type": null, "description": ""}, {"name": "lon1", "type": null, "description": ""}, {"name": "lat2", "type": null, "description": ""}, {"name": "lon2", "type": null, "description": ""}, {"name": "unit", "type": null, "description": ""}], "created_at": 1789079002.5759451, "supported_languages": null}, "macro.dbt_utils.get_powers_of_two": {"name": "get_powers_of_two", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/generate_series.sql", "original_file_path": "macros/sql/generate_series.sql", "unique_id": "macro.dbt_utils.get_powers_of_two", "macro_sql": "{% macro get_powers_of_two(upper_bound) %}\n {{ return(adapter.dispatch('get_powers_of_two', 'dbt_utils')(upper_bound)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__get_powers_of_two"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "upper_bound", "type": null, "description": ""}], "created_at": 1789079002.5764487, "supported_languages": null}, "macro.dbt_utils.default__get_powers_of_two": {"name": "default__get_powers_of_two", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/generate_series.sql", "original_file_path": "macros/sql/generate_series.sql", "unique_id": "macro.dbt_utils.default__get_powers_of_two", "macro_sql": "{% macro default__get_powers_of_two(upper_bound) %}\n\n {% if upper_bound <= 0 %}\n {{ exceptions.raise_compiler_error(\"upper bound must be positive\") }}\n {% endif %}\n\n {% for _ in range(1, 100) %}\n {% if upper_bound <= 2 ** loop.index %}{{ return(loop.index) }}{% endif %}\n {% endfor %}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "upper_bound", "type": null, "description": ""}], "created_at": 1789079002.5769205, "supported_languages": null}, "macro.dbt_utils.generate_series": {"name": "generate_series", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/generate_series.sql", "original_file_path": "macros/sql/generate_series.sql", "unique_id": "macro.dbt_utils.generate_series", "macro_sql": "{% macro generate_series(upper_bound) %}\n {{ return(adapter.dispatch('generate_series', 'dbt_utils')(upper_bound)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__generate_series"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "upper_bound", "type": null, "description": ""}], "created_at": 1789079002.577136, "supported_languages": null}, "macro.dbt_utils.default__generate_series": {"name": "default__generate_series", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/generate_series.sql", "original_file_path": "macros/sql/generate_series.sql", "unique_id": "macro.dbt_utils.default__generate_series", "macro_sql": "{% macro default__generate_series(upper_bound) %}\n\n {% set n = dbt_utils.get_powers_of_two(upper_bound) %}\n\n with p as (\n select 0 as generated_number union all select 1\n ), unioned as (\n\n select\n\n {% for i in range(n) %}\n p{{i}}.generated_number * power(2, {{i}})\n {% if not loop.last %} + {% endif %}\n {% endfor %}\n + 1\n as generated_number\n\n from\n\n {% for i in range(n) %}\n p as p{{i}}\n {% if not loop.last %} cross join {% endif %}\n {% endfor %}\n\n )\n\n select *\n from unioned\n where generated_number <= {{upper_bound}}\n order by generated_number\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.get_powers_of_two"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "upper_bound", "type": null, "description": ""}], "created_at": 1789079002.5777092, "supported_languages": null}, "macro.dbt_utils.safe_subtract": {"name": "safe_subtract", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/safe_subtract.sql", "original_file_path": "macros/sql/safe_subtract.sql", "unique_id": "macro.dbt_utils.safe_subtract", "macro_sql": "{%- macro safe_subtract(field_list) -%}\n {{ return(adapter.dispatch('safe_subtract', 'dbt_utils')(field_list)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__safe_subtract"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field_list", "type": null, "description": ""}], "created_at": 1789079002.578098, "supported_languages": null}, "macro.dbt_utils.default__safe_subtract": {"name": "default__safe_subtract", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/safe_subtract.sql", "original_file_path": "macros/sql/safe_subtract.sql", "unique_id": "macro.dbt_utils.default__safe_subtract", "macro_sql": "\n\n{%- macro default__safe_subtract(field_list) -%}\n\n{%- if field_list is not iterable or field_list is string or field_list is mapping -%}\n\n{%- set error_message = '\nWarning: the `safe_subtract` macro takes a single list argument instead of \\\nstring arguments. The {}.{} model triggered this warning. \\\n'.format(model.package_name, model.name) -%}\n\n{%- do exceptions.raise_compiler_error(error_message) -%}\n\n{%- endif -%}\n\n{% set fields = [] %}\n\n{%- for field in field_list -%}\n\n {% do fields.append(\"coalesce(\" ~ field ~ \", 0)\") %}\n\n{%- endfor -%}\n\n{{ fields|join(' -\\n ') }}\n\n{%- endmacro -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field_list", "type": null, "description": ""}], "created_at": 1789079002.5786984, "supported_languages": null}, "macro.dbt_utils.deduplicate": {"name": "deduplicate", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/deduplicate.sql", "original_file_path": "macros/sql/deduplicate.sql", "unique_id": "macro.dbt_utils.deduplicate", "macro_sql": "{%- macro deduplicate(relation, partition_by, order_by) -%}\n {{ return(adapter.dispatch('deduplicate', 'dbt_utils')(relation, partition_by, order_by)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.postgres__deduplicate"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "partition_by", "type": null, "description": ""}, {"name": "order_by", "type": null, "description": ""}], "created_at": 1789079002.5793436, "supported_languages": null}, "macro.dbt_utils.default__deduplicate": {"name": "default__deduplicate", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/deduplicate.sql", "original_file_path": "macros/sql/deduplicate.sql", "unique_id": "macro.dbt_utils.default__deduplicate", "macro_sql": "\n\n{%- macro default__deduplicate(relation, partition_by, order_by) -%}\n\n with row_numbered as (\n select\n _inner.*,\n row_number() over (\n partition by {{ partition_by }}\n order by {{ order_by }}\n ) as rn\n from {{ relation }} as _inner\n )\n\n select\n distinct data.*\n from {{ relation }} as data\n {#\n -- Not all DBs will support natural joins but the ones that do include:\n -- Oracle, MySQL, SQLite, Redshift, Teradata, Materialize, Databricks\n -- Apache Spark, SingleStore, Vertica\n -- Those that do not appear to support natural joins include:\n -- SQLServer, Trino, Presto, Rockset, Athena\n #}\n natural join row_numbered\n where row_numbered.rn = 1\n\n{%- endmacro -%}\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "partition_by", "type": null, "description": ""}, {"name": "order_by", "type": null, "description": ""}], "created_at": 1789079002.5795953, "supported_languages": null}, "macro.dbt_utils.redshift__deduplicate": {"name": "redshift__deduplicate", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/deduplicate.sql", "original_file_path": "macros/sql/deduplicate.sql", "unique_id": "macro.dbt_utils.redshift__deduplicate", "macro_sql": "{% macro redshift__deduplicate(relation, partition_by, order_by) -%}\n\n select *\n from {{ relation }} as tt\n qualify\n row_number() over (\n partition by {{ partition_by }}\n order by {{ order_by }}\n ) = 1\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "partition_by", "type": null, "description": ""}, {"name": "order_by", "type": null, "description": ""}], "created_at": 1789079002.5797887, "supported_languages": null}, "macro.dbt_utils.postgres__deduplicate": {"name": "postgres__deduplicate", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/deduplicate.sql", "original_file_path": "macros/sql/deduplicate.sql", "unique_id": "macro.dbt_utils.postgres__deduplicate", "macro_sql": "\n{%- macro postgres__deduplicate(relation, partition_by, order_by) -%}\n\n select\n distinct on ({{ partition_by }}) *\n from {{ relation }}\n order by {{ partition_by }}{{ ',' ~ order_by }}\n\n{%- endmacro -%}\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "partition_by", "type": null, "description": ""}, {"name": "order_by", "type": null, "description": ""}], "created_at": 1789079002.5800192, "supported_languages": null}, "macro.dbt_utils.snowflake__deduplicate": {"name": "snowflake__deduplicate", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/deduplicate.sql", "original_file_path": "macros/sql/deduplicate.sql", "unique_id": "macro.dbt_utils.snowflake__deduplicate", "macro_sql": "\n{%- macro snowflake__deduplicate(relation, partition_by, order_by) -%}\n\n select *\n from {{ relation }}\n qualify\n row_number() over (\n partition by {{ partition_by }}\n order by {{ order_by }}\n ) = 1\n\n{%- endmacro -%}\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "partition_by", "type": null, "description": ""}, {"name": "order_by", "type": null, "description": ""}], "created_at": 1789079002.5802147, "supported_languages": null}, "macro.dbt_utils.databricks__deduplicate": {"name": "databricks__deduplicate", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/deduplicate.sql", "original_file_path": "macros/sql/deduplicate.sql", "unique_id": "macro.dbt_utils.databricks__deduplicate", "macro_sql": "\n{%- macro databricks__deduplicate(relation, partition_by, order_by) -%}\n\n select *\n from {{ relation }}\n qualify\n row_number() over (\n partition by {{ partition_by }}\n order by {{ order_by }}\n ) = 1\n\n{%- endmacro -%}\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "partition_by", "type": null, "description": ""}, {"name": "order_by", "type": null, "description": ""}], "created_at": 1789079002.5804057, "supported_languages": null}, "macro.dbt_utils.bigquery__deduplicate": {"name": "bigquery__deduplicate", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/deduplicate.sql", "original_file_path": "macros/sql/deduplicate.sql", "unique_id": "macro.dbt_utils.bigquery__deduplicate", "macro_sql": "\n{%- macro bigquery__deduplicate(relation, partition_by, order_by) -%}\n\n select unique.*\n from (\n select\n array_agg (\n original\n order by {{ order_by }}\n limit 1\n )[offset(0)] unique\n from {{ relation }} original\n group by {{ partition_by }}\n )\n\n{%- endmacro -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "partition_by", "type": null, "description": ""}, {"name": "order_by", "type": null, "description": ""}], "created_at": 1789079002.580601, "supported_languages": null}, "macro.dbt_utils.generate_surrogate_key": {"name": "generate_surrogate_key", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/generate_surrogate_key.sql", "original_file_path": "macros/sql/generate_surrogate_key.sql", "unique_id": "macro.dbt_utils.generate_surrogate_key", "macro_sql": "{%- macro generate_surrogate_key(field_list) -%}\n {{ return(adapter.dispatch('generate_surrogate_key', 'dbt_utils')(field_list)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__generate_surrogate_key"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field_list", "type": null, "description": ""}], "created_at": 1789079002.5810168, "supported_languages": null}, "macro.dbt_utils.default__generate_surrogate_key": {"name": "default__generate_surrogate_key", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/generate_surrogate_key.sql", "original_file_path": "macros/sql/generate_surrogate_key.sql", "unique_id": "macro.dbt_utils.default__generate_surrogate_key", "macro_sql": "\n\n{%- macro default__generate_surrogate_key(field_list) -%}\n\n{%- if var('surrogate_key_treat_nulls_as_empty_strings', False) -%}\n {%- set default_null_value = \"\" -%}\n{%- else -%}\n {%- set default_null_value = '_dbt_utils_surrogate_key_null_' -%}\n{%- endif -%}\n\n{%- set fields = [] -%}\n\n{%- for field in field_list -%}\n\n {%- do fields.append(\n \"coalesce(cast(\" ~ field ~ \" as \" ~ dbt.type_string() ~ \"), '\" ~ default_null_value ~\"')\"\n ) -%}\n\n {%- if not loop.last %}\n {%- do fields.append(\"'-'\") -%}\n {%- endif -%}\n\n{%- endfor -%}\n\n{{ dbt.hash(dbt.concat(fields)) }}\n\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt.type_string", "macro.dbt.hash", "macro.dbt.concat"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field_list", "type": null, "description": ""}], "created_at": 1789079002.5818076, "supported_languages": null}, "macro.dbt_utils.pivot": {"name": "pivot", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/pivot.sql", "original_file_path": "macros/sql/pivot.sql", "unique_id": "macro.dbt_utils.pivot", "macro_sql": "{% macro pivot(column,\n values,\n alias=True,\n agg='sum',\n cmp='=',\n prefix='',\n suffix='',\n then_value=1,\n else_value=0,\n quote_identifiers=True,\n distinct=False) %}\n {{ return(adapter.dispatch('pivot', 'dbt_utils')(column, values, alias, agg, cmp, prefix, suffix, then_value, else_value, quote_identifiers, distinct)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__pivot"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "column", "type": null, "description": ""}, {"name": "values", "type": null, "description": ""}, {"name": "alias", "type": null, "description": ""}, {"name": "agg", "type": null, "description": ""}, {"name": "cmp", "type": null, "description": ""}, {"name": "prefix", "type": null, "description": ""}, {"name": "suffix", "type": null, "description": ""}, {"name": "then_value", "type": null, "description": ""}, {"name": "else_value", "type": null, "description": ""}, {"name": "quote_identifiers", "type": null, "description": ""}, {"name": "distinct", "type": null, "description": ""}], "created_at": 1789079002.58268, "supported_languages": null}, "macro.dbt_utils.default__pivot": {"name": "default__pivot", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/pivot.sql", "original_file_path": "macros/sql/pivot.sql", "unique_id": "macro.dbt_utils.default__pivot", "macro_sql": "{% macro default__pivot(column,\n values,\n alias=True,\n agg='sum',\n cmp='=',\n prefix='',\n suffix='',\n then_value=1,\n else_value=0,\n quote_identifiers=True,\n distinct=False) %}\n {% for value in values %}\n {{ agg }}(\n {% if distinct %} distinct {% endif %}\n case\n when {{ column }} {{ cmp }} '{{ dbt.escape_single_quotes(value) }}'\n then {{ then_value }}\n else {{ else_value }}\n end\n )\n {% if alias %}\n {% if quote_identifiers %}\n as {{ adapter.quote(prefix ~ value ~ suffix) }}\n {% else %}\n as {{ dbt_utils.slugify(prefix ~ value ~ suffix) }}\n {% endif %}\n {% endif %}\n {% if not loop.last %},{% endif %}\n {% endfor %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.escape_single_quotes", "macro.dbt_utils.slugify"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "column", "type": null, "description": ""}, {"name": "values", "type": null, "description": ""}, {"name": "alias", "type": null, "description": ""}, {"name": "agg", "type": null, "description": ""}, {"name": "cmp", "type": null, "description": ""}, {"name": "prefix", "type": null, "description": ""}, {"name": "suffix", "type": null, "description": ""}, {"name": "then_value", "type": null, "description": ""}, {"name": "else_value", "type": null, "description": ""}, {"name": "quote_identifiers", "type": null, "description": ""}, {"name": "distinct", "type": null, "description": ""}], "created_at": 1789079002.5835996, "supported_languages": null}, "macro.dbt_utils.nullcheck_table": {"name": "nullcheck_table", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/nullcheck_table.sql", "original_file_path": "macros/sql/nullcheck_table.sql", "unique_id": "macro.dbt_utils.nullcheck_table", "macro_sql": "{% macro nullcheck_table(relation) %}\n {{ return(adapter.dispatch('nullcheck_table', 'dbt_utils')(relation)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__nullcheck_table"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789079002.5839736, "supported_languages": null}, "macro.dbt_utils.default__nullcheck_table": {"name": "default__nullcheck_table", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/nullcheck_table.sql", "original_file_path": "macros/sql/nullcheck_table.sql", "unique_id": "macro.dbt_utils.default__nullcheck_table", "macro_sql": "{% macro default__nullcheck_table(relation) %}\n\n {%- do dbt_utils._is_relation(relation, 'nullcheck_table') -%}\n {%- do dbt_utils._is_ephemeral(relation, 'nullcheck_table') -%}\n {% set cols = adapter.get_columns_in_relation(relation) %}\n\n select {{ dbt_utils.nullcheck(cols) }}\n from {{relation}}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils._is_relation", "macro.dbt_utils._is_ephemeral", "macro.dbt_utils.nullcheck"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789079002.5843594, "supported_languages": null}, "macro.dbt_utils.get_relations_by_pattern": {"name": "get_relations_by_pattern", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_relations_by_pattern.sql", "original_file_path": "macros/sql/get_relations_by_pattern.sql", "unique_id": "macro.dbt_utils.get_relations_by_pattern", "macro_sql": "{% macro get_relations_by_pattern(schema_pattern, table_pattern, exclude='', database=target.database) %}\n {{ return(adapter.dispatch('get_relations_by_pattern', 'dbt_utils')(schema_pattern, table_pattern, exclude, database)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__get_relations_by_pattern"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "schema_pattern", "type": null, "description": ""}, {"name": "table_pattern", "type": null, "description": ""}, {"name": "exclude", "type": null, "description": ""}, {"name": "database", "type": null, "description": ""}], "created_at": 1789079002.5848813, "supported_languages": null}, "macro.dbt_utils.default__get_relations_by_pattern": {"name": "default__get_relations_by_pattern", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_relations_by_pattern.sql", "original_file_path": "macros/sql/get_relations_by_pattern.sql", "unique_id": "macro.dbt_utils.default__get_relations_by_pattern", "macro_sql": "{% macro default__get_relations_by_pattern(schema_pattern, table_pattern, exclude='', database=target.database) %}\n\n {%- call statement('get_tables', fetch_result=True) %}\n\n {{ dbt_utils.get_tables_by_pattern_sql(schema_pattern, table_pattern, exclude, database) }}\n\n {%- endcall -%}\n\n {%- set table_list = load_result('get_tables') -%}\n\n {%- if table_list and table_list['table'] -%}\n {%- set tbl_relations = [] -%}\n {%- for row in table_list['table'] -%}\n {%- set tbl_relation = api.Relation.create(\n database=database,\n schema=row.table_schema,\n identifier=row.table_name,\n type=row.table_type\n ) -%}\n {%- do tbl_relations.append(tbl_relation) -%}\n {%- endfor -%}\n\n {{ return(tbl_relations) }}\n {%- else -%}\n {{ return([]) }}\n {%- endif -%}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement", "macro.dbt_utils.get_tables_by_pattern_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "schema_pattern", "type": null, "description": ""}, {"name": "table_pattern", "type": null, "description": ""}, {"name": "exclude", "type": null, "description": ""}, {"name": "database", "type": null, "description": ""}], "created_at": 1789079002.5858164, "supported_languages": null}, "macro.dbt_utils.get_query_results_as_dict": {"name": "get_query_results_as_dict", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_query_results_as_dict.sql", "original_file_path": "macros/sql/get_query_results_as_dict.sql", "unique_id": "macro.dbt_utils.get_query_results_as_dict", "macro_sql": "{% macro get_query_results_as_dict(query) %}\n {{ return(adapter.dispatch('get_query_results_as_dict', 'dbt_utils')(query)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__get_query_results_as_dict"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "query", "type": null, "description": ""}], "created_at": 1789079002.5862136, "supported_languages": null}, "macro.dbt_utils.default__get_query_results_as_dict": {"name": "default__get_query_results_as_dict", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_query_results_as_dict.sql", "original_file_path": "macros/sql/get_query_results_as_dict.sql", "unique_id": "macro.dbt_utils.default__get_query_results_as_dict", "macro_sql": "{% macro default__get_query_results_as_dict(query) %}\n\n{# This macro returns a dictionary of the form {column_name: (tuple_of_results)} #}\n\n {%- call statement('get_query_results', fetch_result=True,auto_begin=false) -%}\n\n {{ query }}\n\n {%- endcall -%}\n\n {% set sql_results={} %}\n\n {%- if execute -%}\n {% set sql_results_table = load_result('get_query_results').table.columns %}\n {% for column_name, column in sql_results_table.items() %}\n {% do sql_results.update({column_name: column.values()}) %}\n {% endfor %}\n {%- endif -%}\n\n {{ return(sql_results) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "query", "type": null, "description": ""}], "created_at": 1789079002.5868652, "supported_languages": null}, "macro.dbt_utils.union_relations": {"name": "union_relations", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/union.sql", "original_file_path": "macros/sql/union.sql", "unique_id": "macro.dbt_utils.union_relations", "macro_sql": "{%- macro union_relations(relations, column_override=none, include=[], exclude=[], source_column_name='_dbt_source_relation', where=none) -%}\n {{ return(adapter.dispatch('union_relations', 'dbt_utils')(relations, column_override, include, exclude, source_column_name, where)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__union_relations"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relations", "type": null, "description": ""}, {"name": "column_override", "type": null, "description": ""}, {"name": "include", "type": null, "description": ""}, {"name": "exclude", "type": null, "description": ""}, {"name": "source_column_name", "type": null, "description": ""}, {"name": "where", "type": null, "description": ""}], "created_at": 1789079002.5880215, "supported_languages": null}, "macro.dbt_utils.default__union_relations": {"name": "default__union_relations", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/union.sql", "original_file_path": "macros/sql/union.sql", "unique_id": "macro.dbt_utils.default__union_relations", "macro_sql": "\n\n{%- macro default__union_relations(relations, column_override=none, include=[], exclude=[], source_column_name='_dbt_source_relation', where=none) -%}\n\n {%- if exclude and include -%}\n {{ exceptions.raise_compiler_error(\"Both an exclude and include list were provided to the `union` macro. Only one is allowed\") }}\n {%- endif -%}\n\n {#-- Prevent querying of db in parsing mode. This works because this macro does not create any new refs. -#}\n {%- if not execute %}\n {{ return('') }}\n {% endif -%}\n\n {%- set column_override = column_override if column_override is not none else {} -%}\n\n {%- set relation_columns = {} -%}\n {%- set column_superset = {} -%}\n {%- set all_excludes = [] -%}\n {%- set all_includes = [] -%}\n\n {%- if exclude -%}\n {%- for exc in exclude -%}\n {%- do all_excludes.append(exc | lower) -%}\n {%- endfor -%}\n {%- endif -%}\n\n {%- if include -%}\n {%- for inc in include -%}\n {%- do all_includes.append(inc | lower) -%}\n {%- endfor -%}\n {%- endif -%}\n\n {%- for relation in relations -%}\n\n {%- do relation_columns.update({relation: []}) -%}\n\n {%- do dbt_utils._is_relation(relation, 'union_relations') -%}\n {%- do dbt_utils._is_ephemeral(relation, 'union_relations') -%}\n {%- set cols = adapter.get_columns_in_relation(relation) -%}\n {%- for col in cols -%}\n\n {#- If an exclude list was provided and the column is in the list, do nothing -#}\n {%- if exclude and col.column | lower in all_excludes -%}\n\n {#- If an include list was provided and the column is not in the list, do nothing -#}\n {%- elif include and col.column | lower not in all_includes -%}\n\n {#- Otherwise add the column to the column superset -#}\n {%- else -%}\n\n {#- update the list of columns in this relation -#}\n {%- do relation_columns[relation].append(col.column) -%}\n\n {%- if col.column in column_superset -%}\n\n {%- set stored = column_superset[col.column] -%}\n {%- if col.is_string() and stored.is_string() and col.string_size() > stored.string_size() -%}\n\n {%- do column_superset.update({col.column: col}) -%}\n\n {%- endif %}\n\n {%- else -%}\n\n {%- do column_superset.update({col.column: col}) -%}\n\n {%- endif -%}\n\n {%- endif -%}\n\n {%- endfor -%}\n {%- endfor -%}\n\n {%- set ordered_column_names = column_superset.keys() -%}\n {%- set dbt_command = flags.WHICH -%}\n\n\n {% if dbt_command in ['run', 'build'] %}\n {% if (include | length > 0 or exclude | length > 0) and not column_superset.keys() %}\n {%- set relations_string -%}\n {%- for relation in relations -%}\n {{ relation.name }}\n {%- if not loop.last %}, {% endif -%}\n {%- endfor -%}\n {%- endset -%}\n\n {%- set error_message -%}\n There were no columns found to union for relations {{ relations_string }}\n {%- endset -%}\n\n {{ exceptions.raise_compiler_error(error_message) }}\n {%- endif -%}\n {%- endif -%}\n\n {%- for relation in relations %}\n\n (\n select\n\n {%- if source_column_name is not none %}\n cast({{ dbt.string_literal(relation.render()) }} as {{ dbt.type_string() }}) as {{ source_column_name }},\n {%- endif %}\n\n /* No columns from any of the relations.\n This star is only output during dbt compile, and exists to keep SQLFluff happy. */\n {% if dbt_command == 'compile' and ordered_column_names|length == 0 %}\n *\n {% endif %}\n\n {% for col_name in ordered_column_names -%}\n\n {%- set col = column_superset[col_name] %}\n {%- set col_type = column_override.get(col.column, col.data_type) %}\n {%- set col_name = adapter.quote(col_name) if col_name in relation_columns[relation] else 'null' %}\n cast({{ col_name }} as {{ col_type }}) as {{ col.quoted }} {% if not loop.last %},{% endif -%}\n\n {%- endfor %}\n\n from {{ relation }}\n\n {% if where -%}\n where {{ where }}\n {%- endif %}\n )\n\n {% if not loop.last -%}\n union all\n {% endif -%}\n\n {%- endfor -%}\n\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt_utils._is_relation", "macro.dbt_utils._is_ephemeral", "macro.dbt.string_literal", "macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relations", "type": null, "description": ""}, {"name": "column_override", "type": null, "description": ""}, {"name": "include", "type": null, "description": ""}, {"name": "exclude", "type": null, "description": ""}, {"name": "source_column_name", "type": null, "description": ""}, {"name": "where", "type": null, "description": ""}], "created_at": 1789079002.5919771, "supported_languages": null}, "macro.dbt_utils.unpivot": {"name": "unpivot", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/unpivot.sql", "original_file_path": "macros/sql/unpivot.sql", "unique_id": "macro.dbt_utils.unpivot", "macro_sql": "{% macro unpivot(relation=none, cast_to='varchar', exclude=none, remove=none, field_name='field_name', value_name='value', quote_identifiers=False) -%}\n {{ return(adapter.dispatch('unpivot', 'dbt_utils')(relation, cast_to, exclude, remove, field_name, value_name, quote_identifiers)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__unpivot"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "cast_to", "type": null, "description": ""}, {"name": "exclude", "type": null, "description": ""}, {"name": "remove", "type": null, "description": ""}, {"name": "field_name", "type": null, "description": ""}, {"name": "value_name", "type": null, "description": ""}, {"name": "quote_identifiers", "type": null, "description": ""}], "created_at": 1789079002.5928705, "supported_languages": null}, "macro.dbt_utils.default__unpivot": {"name": "default__unpivot", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/unpivot.sql", "original_file_path": "macros/sql/unpivot.sql", "unique_id": "macro.dbt_utils.default__unpivot", "macro_sql": "{% macro default__unpivot(relation=none, cast_to='varchar', exclude=none, remove=none, field_name='field_name', value_name='value', quote_identifiers=False) -%}\n\n {% if not relation %}\n {{ exceptions.raise_compiler_error(\"Error: argument `relation` is required for `unpivot` macro.\") }}\n {% endif %}\n\n {%- set exclude = exclude if exclude is not none else [] %}\n {%- set remove = remove if remove is not none else [] %}\n\n {%- set include_cols = [] %}\n\n {%- set table_columns = {} %}\n\n {%- do table_columns.update({relation: []}) %}\n\n {%- do dbt_utils._is_relation(relation, 'unpivot') -%}\n {%- do dbt_utils._is_ephemeral(relation, 'unpivot') -%}\n {%- set cols = adapter.get_columns_in_relation(relation) %}\n\n {%- for col in cols -%}\n {%- if col.column.lower() not in remove|map('lower') and col.column.lower() not in exclude|map('lower') -%}\n {% do include_cols.append(col) %}\n {%- endif %}\n {%- endfor %}\n\n\n {%- for col in include_cols -%}\n {%- set current_col_name = adapter.quote(col.column) if quote_identifiers else col.column -%}\n select\n {%- for exclude_col in exclude %}\n {{ adapter.quote(exclude_col) if quote_identifiers else exclude_col }},\n {%- endfor %}\n\n cast('{{ col.column }}' as {{ dbt.type_string() }}) as {{ adapter.quote(field_name) if quote_identifiers else field_name }},\n cast( {% if col.data_type == 'boolean' %}\n {{ dbt.cast_bool_to_text(current_col_name) }}\n {% else %}\n {{ current_col_name }}\n {% endif %}\n as {{ cast_to }}) as {{ adapter.quote(value_name) if quote_identifiers else value_name }}\n\n from {{ relation }}\n\n {% if not loop.last -%}\n union all\n {% endif -%}\n {%- endfor -%}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_utils._is_relation", "macro.dbt_utils._is_ephemeral", "macro.dbt.type_string", "macro.dbt.cast_bool_to_text"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "cast_to", "type": null, "description": ""}, {"name": "exclude", "type": null, "description": ""}, {"name": "remove", "type": null, "description": ""}, {"name": "field_name", "type": null, "description": ""}, {"name": "value_name", "type": null, "description": ""}, {"name": "quote_identifiers", "type": null, "description": ""}], "created_at": 1789079002.5948963, "supported_languages": null}, "macro.dbt_utils.nullcheck": {"name": "nullcheck", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/nullcheck.sql", "original_file_path": "macros/sql/nullcheck.sql", "unique_id": "macro.dbt_utils.nullcheck", "macro_sql": "{% macro nullcheck(cols) %}\n {{ return(adapter.dispatch('nullcheck', 'dbt_utils')(cols)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__nullcheck"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "cols", "type": null, "description": ""}], "created_at": 1789079002.5952697, "supported_languages": null}, "macro.dbt_utils.default__nullcheck": {"name": "default__nullcheck", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/nullcheck.sql", "original_file_path": "macros/sql/nullcheck.sql", "unique_id": "macro.dbt_utils.default__nullcheck", "macro_sql": "{% macro default__nullcheck(cols) %}\n{%- for col in cols %}\n\n {% if col.is_string() -%}\n\n nullif({{col.name}},'') as {{col.name}}\n\n {%- else -%}\n\n {{col.name}}\n\n {%- endif -%}\n\n{%- if not loop.last -%} , {%- endif -%}\n\n{%- endfor -%}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "cols", "type": null, "description": ""}], "created_at": 1789079002.5956466, "supported_languages": null}, "macro.dbt_utils.get_intervals_between": {"name": "get_intervals_between", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/date_spine.sql", "original_file_path": "macros/sql/date_spine.sql", "unique_id": "macro.dbt_utils.get_intervals_between", "macro_sql": "{% macro get_intervals_between(start_date, end_date, datepart) -%}\n {{ return(adapter.dispatch('get_intervals_between', 'dbt_utils')(start_date, end_date, datepart)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__get_intervals_between"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "start_date", "type": null, "description": ""}, {"name": "end_date", "type": null, "description": ""}, {"name": "datepart", "type": null, "description": ""}], "created_at": 1789079002.5961967, "supported_languages": null}, "macro.dbt_utils.default__get_intervals_between": {"name": "default__get_intervals_between", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/date_spine.sql", "original_file_path": "macros/sql/date_spine.sql", "unique_id": "macro.dbt_utils.default__get_intervals_between", "macro_sql": "{% macro default__get_intervals_between(start_date, end_date, datepart) -%}\n {%- call statement('get_intervals_between', fetch_result=True) %}\n\n select {{ dbt.datediff(start_date, end_date, datepart) }}\n\n {%- endcall -%}\n\n {%- set value_list = load_result('get_intervals_between') -%}\n\n {%- if value_list and value_list['data'] -%}\n {%- set values = value_list['data'] | map(attribute=0) | list %}\n {{ return(values[0]) }}\n {%- else -%}\n {{ return(1) }}\n {%- endif -%}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.statement", "macro.dbt.datediff"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "start_date", "type": null, "description": ""}, {"name": "end_date", "type": null, "description": ""}, {"name": "datepart", "type": null, "description": ""}], "created_at": 1789079002.596843, "supported_languages": null}, "macro.dbt_utils.date_spine": {"name": "date_spine", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/date_spine.sql", "original_file_path": "macros/sql/date_spine.sql", "unique_id": "macro.dbt_utils.date_spine", "macro_sql": "{% macro date_spine(datepart, start_date, end_date) %}\n {{ return(adapter.dispatch('date_spine', 'dbt_utils')(datepart, start_date, end_date)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__date_spine"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "datepart", "type": null, "description": ""}, {"name": "start_date", "type": null, "description": ""}, {"name": "end_date", "type": null, "description": ""}], "created_at": 1789079002.5971134, "supported_languages": null}, "macro.dbt_utils.default__date_spine": {"name": "default__date_spine", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/date_spine.sql", "original_file_path": "macros/sql/date_spine.sql", "unique_id": "macro.dbt_utils.default__date_spine", "macro_sql": "{% macro default__date_spine(datepart, start_date, end_date) %}\n\n\n{# call as follows:\n\ndate_spine(\n \"day\",\n \"to_date('01/01/2016', 'mm/dd/yyyy')\",\n \"dbt.dateadd(week, 1, current_date)\"\n) #}\n\n\nwith rawdata as (\n\n {{dbt_utils.generate_series(\n dbt_utils.get_intervals_between(start_date, end_date, datepart)\n )}}\n\n),\n\nall_periods as (\n\n select (\n {{\n dbt.dateadd(\n datepart,\n \"row_number() over (order by generated_number) - 1\",\n start_date\n )\n }}\n ) as date_{{datepart}}\n from rawdata\n\n),\n\nfiltered as (\n\n select *\n from all_periods\n where date_{{datepart}} <= {{ end_date }}\n\n)\n\nselect * from filtered\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.generate_series", "macro.dbt_utils.get_intervals_between", "macro.dbt.dateadd"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "datepart", "type": null, "description": ""}, {"name": "start_date", "type": null, "description": ""}, {"name": "end_date", "type": null, "description": ""}], "created_at": 1789079002.597508, "supported_languages": null}, "macro.dbt_utils.get_filtered_columns_in_relation": {"name": "get_filtered_columns_in_relation", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_filtered_columns_in_relation.sql", "original_file_path": "macros/sql/get_filtered_columns_in_relation.sql", "unique_id": "macro.dbt_utils.get_filtered_columns_in_relation", "macro_sql": "{% macro get_filtered_columns_in_relation(from, except=[]) -%}\n {{ return(adapter.dispatch('get_filtered_columns_in_relation', 'dbt_utils')(from, except)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__get_filtered_columns_in_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "from", "type": null, "description": ""}, {"name": "except", "type": null, "description": ""}], "created_at": 1789079002.5979629, "supported_languages": null}, "macro.dbt_utils.default__get_filtered_columns_in_relation": {"name": "default__get_filtered_columns_in_relation", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_filtered_columns_in_relation.sql", "original_file_path": "macros/sql/get_filtered_columns_in_relation.sql", "unique_id": "macro.dbt_utils.default__get_filtered_columns_in_relation", "macro_sql": "{% macro default__get_filtered_columns_in_relation(from, except=[]) -%}\n {%- do dbt_utils._is_relation(from, 'get_filtered_columns_in_relation') -%}\n {%- do dbt_utils._is_ephemeral(from, 'get_filtered_columns_in_relation') -%}\n\n {# -- Prevent querying of db in parsing mode. This works because this macro does not create any new refs. #}\n {%- if not execute -%}\n {{ return([]) }}\n {% endif %}\n\n {%- set include_cols = [] %}\n {%- set cols = adapter.get_columns_in_relation(from) -%}\n {%- set except = except | map(\"lower\") | list %}\n {%- for col in cols -%}\n {%- if col.column|lower not in except -%}\n {% do include_cols.append(col.column) %}\n {%- endif %}\n {%- endfor %}\n\n {{ return(include_cols) }}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_utils._is_relation", "macro.dbt_utils._is_ephemeral"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "from", "type": null, "description": ""}, {"name": "except", "type": null, "description": ""}], "created_at": 1789079002.5987585, "supported_languages": null}, "macro.dbt_utils.surrogate_key": {"name": "surrogate_key", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/surrogate_key.sql", "original_file_path": "macros/sql/surrogate_key.sql", "unique_id": "macro.dbt_utils.surrogate_key", "macro_sql": "{%- macro surrogate_key(field_list) -%}\n {% set frustrating_jinja_feature = varargs %}\n {{ return(adapter.dispatch('surrogate_key', 'dbt_utils')(field_list, *varargs)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__surrogate_key"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field_list", "type": null, "description": ""}], "created_at": 1789079002.599153, "supported_languages": null}, "macro.dbt_utils.default__surrogate_key": {"name": "default__surrogate_key", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/surrogate_key.sql", "original_file_path": "macros/sql/surrogate_key.sql", "unique_id": "macro.dbt_utils.default__surrogate_key", "macro_sql": "\n\n{%- macro default__surrogate_key(field_list) -%}\n\n{%- set error_message = '\nWarning: `dbt_utils.surrogate_key` has been replaced by \\\n`dbt_utils.generate_surrogate_key`. The new macro treats null values \\\ndifferently to empty strings. To restore the behaviour of the original \\\nmacro, add a global variable in dbt_project.yml called \\\n`surrogate_key_treat_nulls_as_empty_strings` to your \\\ndbt_project.yml file with a value of True. \\\nThe {}.{} model triggered this warning. \\\n'.format(model.package_name, model.name) -%}\n\n{%- do exceptions.raise_compiler_error(error_message) -%}\n\n{%- endmacro -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field_list", "type": null, "description": ""}], "created_at": 1789079002.5994153, "supported_languages": null}, "macro.dbt_utils.get_single_value": {"name": "get_single_value", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_single_value.sql", "original_file_path": "macros/sql/get_single_value.sql", "unique_id": "macro.dbt_utils.get_single_value", "macro_sql": "{% macro get_single_value(query, default=none) %}\n {{ return(adapter.dispatch('get_single_value', 'dbt_utils')(query, default)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__get_single_value"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "query", "type": null, "description": ""}, {"name": "default", "type": null, "description": ""}], "created_at": 1789079002.599868, "supported_languages": null}, "macro.dbt_utils.default__get_single_value": {"name": "default__get_single_value", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_single_value.sql", "original_file_path": "macros/sql/get_single_value.sql", "unique_id": "macro.dbt_utils.default__get_single_value", "macro_sql": "{% macro default__get_single_value(query, default) %}\n\n{# This macro returns the (0, 0) record in a query, i.e. the first row of the first column #}\n\n {%- call statement('get_query_result', fetch_result=True, auto_begin=false) -%}\n\n {{ query }}\n\n {%- endcall -%}\n\n {%- if execute -%}\n\n {% set r = load_result('get_query_result').table.columns[0].values() %}\n {% if r | length == 0 %}\n {% do print('Query `' ~ query ~ '` returned no rows. Using the default value: ' ~ default) %}\n {% set sql_result = default %}\n {% else %}\n {% set sql_result = r[0] %}\n {% endif %}\n \n {%- else -%}\n \n {% set sql_result = default %}\n \n {%- endif -%}\n\n {% do return(sql_result) %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "query", "type": null, "description": ""}, {"name": "default", "type": null, "description": ""}], "created_at": 1789079002.6007543, "supported_languages": null}, "macro.dbt_utils.width_bucket": {"name": "width_bucket", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/width_bucket.sql", "original_file_path": "macros/sql/width_bucket.sql", "unique_id": "macro.dbt_utils.width_bucket", "macro_sql": "{% macro width_bucket(expr, min_value, max_value, num_buckets) %}\n {{ return(adapter.dispatch('width_bucket', 'dbt_utils') (expr, min_value, max_value, num_buckets)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__width_bucket"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "expr", "type": null, "description": ""}, {"name": "min_value", "type": null, "description": ""}, {"name": "max_value", "type": null, "description": ""}, {"name": "num_buckets", "type": null, "description": ""}], "created_at": 1789079002.6012616, "supported_languages": null}, "macro.dbt_utils.default__width_bucket": {"name": "default__width_bucket", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/width_bucket.sql", "original_file_path": "macros/sql/width_bucket.sql", "unique_id": "macro.dbt_utils.default__width_bucket", "macro_sql": "{% macro default__width_bucket(expr, min_value, max_value, num_buckets) -%}\n\n {% set bin_size -%}\n (( {{ max_value }} - {{ min_value }} ) / {{ num_buckets }} )\n {%- endset %}\n (\n -- to break ties when the amount is eaxtly at the bucket egde\n case\n when\n mod(\n {{ dbt.safe_cast(expr, dbt.type_numeric() ) }},\n {{ dbt.safe_cast(bin_size, dbt.type_numeric() ) }}\n ) = 0\n then 1\n else 0\n end\n ) +\n -- Anything over max_value goes the N+1 bucket\n least(\n ceil(\n ({{ expr }} - {{ min_value }})/{{ bin_size }}\n ),\n {{ num_buckets }} + 1\n )\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.safe_cast", "macro.dbt.type_numeric"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "expr", "type": null, "description": ""}, {"name": "min_value", "type": null, "description": ""}, {"name": "max_value", "type": null, "description": ""}, {"name": "num_buckets", "type": null, "description": ""}], "created_at": 1789079002.6017702, "supported_languages": null}, "macro.dbt_utils.snowflake__width_bucket": {"name": "snowflake__width_bucket", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/width_bucket.sql", "original_file_path": "macros/sql/width_bucket.sql", "unique_id": "macro.dbt_utils.snowflake__width_bucket", "macro_sql": "{% macro snowflake__width_bucket(expr, min_value, max_value, num_buckets) %}\n width_bucket({{ expr }}, {{ min_value }}, {{ max_value }}, {{ num_buckets }} )\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "expr", "type": null, "description": ""}, {"name": "min_value", "type": null, "description": ""}, {"name": "max_value", "type": null, "description": ""}, {"name": "num_buckets", "type": null, "description": ""}], "created_at": 1789079002.6020038, "supported_languages": null}, "macro.dbt_utils.get_relations_by_prefix": {"name": "get_relations_by_prefix", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_relations_by_prefix.sql", "original_file_path": "macros/sql/get_relations_by_prefix.sql", "unique_id": "macro.dbt_utils.get_relations_by_prefix", "macro_sql": "{% macro get_relations_by_prefix(schema, prefix, exclude='', database=target.database) %}\n {{ return(adapter.dispatch('get_relations_by_prefix', 'dbt_utils')(schema, prefix, exclude, database)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__get_relations_by_prefix"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "schema", "type": null, "description": ""}, {"name": "prefix", "type": null, "description": ""}, {"name": "exclude", "type": null, "description": ""}, {"name": "database", "type": null, "description": ""}], "created_at": 1789079002.602514, "supported_languages": null}, "macro.dbt_utils.default__get_relations_by_prefix": {"name": "default__get_relations_by_prefix", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_relations_by_prefix.sql", "original_file_path": "macros/sql/get_relations_by_prefix.sql", "unique_id": "macro.dbt_utils.default__get_relations_by_prefix", "macro_sql": "{% macro default__get_relations_by_prefix(schema, prefix, exclude='', database=target.database) %}\n\n {%- call statement('get_tables', fetch_result=True) %}\n\n {{ dbt_utils.get_tables_by_prefix_sql(schema, prefix, exclude, database) }}\n\n {%- endcall -%}\n\n {%- set table_list = load_result('get_tables') -%}\n\n {%- if table_list and table_list['table'] -%}\n {%- set tbl_relations = [] -%}\n {%- for row in table_list['table'] -%}\n {%- set tbl_relation = api.Relation.create(\n database=database,\n schema=row.table_schema,\n identifier=row.table_name,\n type=row.table_type\n ) -%}\n {%- do tbl_relations.append(tbl_relation) -%}\n {%- endfor -%}\n\n {{ return(tbl_relations) }}\n {%- else -%}\n {{ return([]) }}\n {%- endif -%}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement", "macro.dbt_utils.get_tables_by_prefix_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "schema", "type": null, "description": ""}, {"name": "prefix", "type": null, "description": ""}, {"name": "exclude", "type": null, "description": ""}, {"name": "database", "type": null, "description": ""}], "created_at": 1789079002.6034594, "supported_languages": null}, "macro.dbt_utils.safe_divide": {"name": "safe_divide", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/safe_divide.sql", "original_file_path": "macros/sql/safe_divide.sql", "unique_id": "macro.dbt_utils.safe_divide", "macro_sql": "{% macro safe_divide(numerator, denominator) -%}\n {{ return(adapter.dispatch('safe_divide', 'dbt_utils')(numerator, denominator)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__safe_divide"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "numerator", "type": null, "description": ""}, {"name": "denominator", "type": null, "description": ""}], "created_at": 1789079002.6037753, "supported_languages": null}, "macro.dbt_utils.default__safe_divide": {"name": "default__safe_divide", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/safe_divide.sql", "original_file_path": "macros/sql/safe_divide.sql", "unique_id": "macro.dbt_utils.default__safe_divide", "macro_sql": "{% macro default__safe_divide(numerator, denominator) %}\n ( {{ numerator }} ) / nullif( ( {{ denominator }} ), 0)\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "numerator", "type": null, "description": ""}, {"name": "denominator", "type": null, "description": ""}], "created_at": 1789079002.6039474, "supported_languages": null}, "macro.dbt_utils.safe_add": {"name": "safe_add", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/safe_add.sql", "original_file_path": "macros/sql/safe_add.sql", "unique_id": "macro.dbt_utils.safe_add", "macro_sql": "{%- macro safe_add(field_list) -%}\n {{ return(adapter.dispatch('safe_add', 'dbt_utils')(field_list)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__safe_add"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field_list", "type": null, "description": ""}], "created_at": 1789079002.6043015, "supported_languages": null}, "macro.dbt_utils.default__safe_add": {"name": "default__safe_add", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/safe_add.sql", "original_file_path": "macros/sql/safe_add.sql", "unique_id": "macro.dbt_utils.default__safe_add", "macro_sql": "\n\n{%- macro default__safe_add(field_list) -%}\n\n{%- if field_list is not iterable or field_list is string or field_list is mapping -%}\n\n{%- set error_message = '\nWarning: the `safe_add` macro now takes a single list argument instead of \\\nstring arguments. The {}.{} model triggered this warning. \\\n'.format(model.package_name, model.name) -%}\n\n{%- do exceptions.warn(error_message) -%}\n\n{%- endif -%}\n\n{% set fields = [] %}\n\n{%- for field in field_list -%}\n\n {% do fields.append(\"coalesce(\" ~ field ~ \", 0)\") %}\n\n{%- endfor -%}\n\n{{ fields|join(' +\\n ') }}\n\n{%- endmacro -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field_list", "type": null, "description": ""}], "created_at": 1789079002.6049035, "supported_languages": null}, "macro.dbt_utils.group_by": {"name": "group_by", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/groupby.sql", "original_file_path": "macros/sql/groupby.sql", "unique_id": "macro.dbt_utils.group_by", "macro_sql": "{%- macro group_by(n) -%}\n {{ return(adapter.dispatch('group_by', 'dbt_utils')(n)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__group_by"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "n", "type": null, "description": ""}], "created_at": 1789079002.6052134, "supported_languages": null}, "macro.dbt_utils.default__group_by": {"name": "default__group_by", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/groupby.sql", "original_file_path": "macros/sql/groupby.sql", "unique_id": "macro.dbt_utils.default__group_by", "macro_sql": "\n\n{%- macro default__group_by(n) -%}\n\n group by {% for i in range(1, n + 1) -%}\n {{ i }}{{ ',' if not loop.last }} \n {%- endfor -%}\n\n{%- endmacro -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "n", "type": null, "description": ""}], "created_at": 1789079002.6055007, "supported_languages": null}, "macro.iterable.iterable_lookback": {"name": "iterable_lookback", "resource_type": "macro", "package_name": "iterable", "path": "macros/iterable_lookback.sql", "original_file_path": "macros/iterable_lookback.sql", "unique_id": "macro.iterable.iterable_lookback", "macro_sql": "{% macro iterable_lookback(from_date, datepart, interval, safety_date='2020-01-01') %}\n\n{{ adapter.dispatch('iterable_lookback', 'iterable') (from_date, datepart, interval, safety_date='2020-01-01') }}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.iterable.default__iterable_lookback"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "from_date", "type": null, "description": ""}, {"name": "datepart", "type": null, "description": ""}, {"name": "interval", "type": null, "description": ""}, {"name": "safety_date", "type": null, "description": ""}], "created_at": 1789079002.605946, "supported_languages": null}, "macro.iterable.default__iterable_lookback": {"name": "default__iterable_lookback", "resource_type": "macro", "package_name": "iterable", "path": "macros/iterable_lookback.sql", "original_file_path": "macros/iterable_lookback.sql", "unique_id": "macro.iterable.default__iterable_lookback", "macro_sql": "{% macro default__iterable_lookback(from_date, datepart, interval, safety_date='2020-01-01') %}\n\n {% set sql_statement %}\n select coalesce({{ from_date }}, {{ \"'\" ~ safety_date ~ \"'\" }})\n from {{ this }}\n {%- endset -%}\n\n {%- set result = dbt_utils.get_single_value(sql_statement) %}\n\n {{ dbt.dateadd(datepart=datepart, interval=-interval, from_date_or_timestamp=\"cast('\" ~ result ~ \"' as date)\") }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.get_single_value", "macro.dbt.dateadd"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "from_date", "type": null, "description": ""}, {"name": "datepart", "type": null, "description": ""}, {"name": "interval", "type": null, "description": ""}, {"name": "safety_date", "type": null, "description": ""}], "created_at": 1789079002.6065092, "supported_languages": null}, "macro.iterable.get_campaign_list_history_columns": {"name": "get_campaign_list_history_columns", "resource_type": "macro", "package_name": "iterable", "path": "macros/staging/get_campaign_list_history_columns.sql", "original_file_path": "macros/staging/get_campaign_list_history_columns.sql", "unique_id": "macro.iterable.get_campaign_list_history_columns", "macro_sql": "{% macro get_campaign_list_history_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"campaign_id\", \"datatype\": dbt.type_int()},\n {\"name\": \"list_id\", \"datatype\": dbt.type_int()},\n {\"name\": \"updated_at\", \"datatype\": dbt.type_timestamp()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.type_timestamp", "macro.dbt.type_int"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789079002.6071563, "supported_languages": null}, "macro.iterable.get_list_columns": {"name": "get_list_columns", "resource_type": "macro", "package_name": "iterable", "path": "macros/staging/get_list_columns.sql", "original_file_path": "macros/staging/get_list_columns.sql", "unique_id": "macro.iterable.get_list_columns", "macro_sql": "{% macro get_list_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_deleted\", \"datatype\": \"boolean\"},\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"created_at\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"id\", \"datatype\": dbt.type_int()},\n {\"name\": \"list_type\", \"datatype\": dbt.type_string()},\n {\"name\": \"description\", \"datatype\": dbt.type_string()},\n {\"name\": \"name\", \"datatype\": dbt.type_string()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.type_timestamp", "macro.dbt.type_int", "macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789079002.608066, "supported_languages": null}, "macro.iterable.get_campaign_history_columns": {"name": "get_campaign_history_columns", "resource_type": "macro", "package_name": "iterable", "path": "macros/staging/get_campaign_history_columns.sql", "original_file_path": "macros/staging/get_campaign_history_columns.sql", "unique_id": "macro.iterable.get_campaign_history_columns", "macro_sql": "{% macro get_campaign_history_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"campaign_state\", \"datatype\": dbt.type_string()},\n {\"name\": \"created_at\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"created_by_user_id\", \"datatype\": dbt.type_string()},\n {\"name\": \"updated_by_user_id\", \"datatype\": dbt.type_string()},\n {\"name\": \"ended_at\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"id\", \"datatype\": dbt.type_int()},\n {\"name\": \"name\", \"datatype\": dbt.type_string()},\n {\"name\": \"recurring_campaign_id\", \"datatype\": dbt.type_int()},\n {\"name\": \"send_size\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"start_at\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"template_id\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"type\", \"datatype\": dbt.type_string()},\n {\"name\": \"updated_at\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"workflow_id\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"message_medium\", \"datatype\": dbt.type_string()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.type_timestamp", "macro.dbt.type_string", "macro.dbt.type_int", "macro.dbt.type_numeric"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789079002.60978, "supported_languages": null}, "macro.iterable.get_event_columns": {"name": "get_event_columns", "resource_type": "macro", "package_name": "iterable", "path": "macros/staging/get_event_columns.sql", "original_file_path": "macros/staging/get_event_columns.sql", "unique_id": "macro.iterable.get_event_columns", "macro_sql": "{% macro get_event_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_id\", \"datatype\": dbt.type_string()},\n {\"name\": \"_fivetran_user_id\", \"datatype\": dbt.type_string()},\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"campaign_id\", \"datatype\": dbt.type_int()},\n {\"name\": \"content_id\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"created_at\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"email\", \"datatype\": dbt.type_string()},\n {\"name\": \"event_name\", \"datatype\": dbt.type_string()},\n {\"name\": \"message_bus_id\", \"datatype\": dbt.type_string()},\n {\"name\": \"message_id\", \"datatype\": dbt.type_string()},\n {\"name\": \"message_type_id\", \"datatype\": dbt.type_int()},\n {\"name\": \"recipient_state\", \"datatype\": dbt.type_string()},\n {\"name\": \"status\", \"datatype\": dbt.type_string()},\n {\"name\": \"unsub_source\", \"datatype\": dbt.type_string()},\n {\"name\": \"user_agent\", \"datatype\": dbt.type_string()},\n {\"name\": \"user_agent_device\", \"datatype\": dbt.type_string()},\n {\"name\": \"transactional_data\", \"datatype\": dbt.type_string()},\n {\"name\": \"additional_properties\", \"datatype\": dbt.type_string()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.type_string", "macro.dbt.type_timestamp", "macro.dbt.type_int", "macro.dbt.type_numeric"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789079002.6116905, "supported_languages": null}, "macro.iterable.get_event_extension_columns": {"name": "get_event_extension_columns", "resource_type": "macro", "package_name": "iterable", "path": "macros/staging/get_event_extension_columns.sql", "original_file_path": "macros/staging/get_event_extension_columns.sql", "unique_id": "macro.iterable.get_event_extension_columns", "macro_sql": "{% macro get_event_extension_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_id\", \"datatype\": dbt.type_string()},\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"app_already_running\", \"datatype\": \"boolean\"},\n {\"name\": \"badge\", \"datatype\": dbt.type_string()},\n {\"name\": \"catalog_collection_count\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"catalog_lookup_count\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"canonical_url_id\", \"datatype\": dbt.type_string()},\n {\"name\": \"content_available\", \"datatype\": \"boolean\"},\n {\"name\": \"content_id\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"device\", \"datatype\": dbt.type_string()},\n {\"name\": \"email_id\", \"datatype\": dbt.type_string()},\n {\"name\": \"email_subject\", \"datatype\": dbt.type_string()},\n {\"name\": \"experiment_id\", \"datatype\": dbt.type_string()},\n {\"name\": \"from_phone_number_id\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"from_smssender_id\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"link_id\", \"datatype\": dbt.type_string()},\n {\"name\": \"link_url\", \"datatype\": dbt.type_string()},\n {\"name\": \"locale\", \"datatype\": dbt.type_string()},\n {\"name\": \"payload\", \"datatype\": dbt.type_string()},\n {\"name\": \"platform_endpoint\", \"datatype\": dbt.type_string()},\n {\"name\": \"push_message\", \"datatype\": dbt.type_string()},\n {\"name\": \"region\", \"datatype\": dbt.type_string()},\n {\"name\": \"sms_message\", \"datatype\": dbt.type_string()},\n {\"name\": \"to_phone_number\", \"datatype\": dbt.type_string()},\n {\"name\": \"url\", \"datatype\": dbt.type_string()},\n {\"name\": \"workflow_id\", \"datatype\": dbt.type_string()},\n {\"name\": \"workflow_name\", \"datatype\": dbt.type_string()},\n {\"name\": \"city\", \"datatype\": dbt.type_string()},\n {\"name\": \"clicked_url\", \"datatype\": dbt.type_string()},\n {\"name\": \"country\", \"datatype\": dbt.type_string()},\n {\"name\": \"error_code\", \"datatype\": dbt.type_string()},\n {\"name\": \"expires_at\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"from_phone_number\", \"datatype\": dbt.type_string()},\n {\"name\": \"in_app_body\", \"datatype\": dbt.type_string()},\n {\"name\": \"is_sms_estimation\", \"datatype\": \"boolean\"},\n {\"name\": \"labels\", \"datatype\": dbt.type_string()},\n {\"name\": \"message_status\", \"datatype\": dbt.type_string()},\n {\"name\": \"mms_send_count\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"reason\", \"datatype\": dbt.type_string()},\n {\"name\": \"sms_send_count\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"_fivetran_user_id\", \"datatype\": dbt.type_string()}\n] %}\n\n{{ fivetran_utils.add_pass_through_columns(columns, var('iterable_event_extension_pass_through_columns')) }}\n\n{{ return(columns) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.type_string", "macro.dbt.type_timestamp", "macro.dbt.type_numeric", "macro.fivetran_utils.add_pass_through_columns"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789079002.615833, "supported_languages": null}, "macro.iterable.get_campaign_label_history_columns": {"name": "get_campaign_label_history_columns", "resource_type": "macro", "package_name": "iterable", "path": "macros/staging/get_campaign_label_history_columns.sql", "original_file_path": "macros/staging/get_campaign_label_history_columns.sql", "unique_id": "macro.iterable.get_campaign_label_history_columns", "macro_sql": "{% macro get_campaign_label_history_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"campaign_id\", \"datatype\": dbt.type_int()},\n {\"name\": \"label\", \"datatype\": dbt.type_string()},\n {\"name\": \"updated_at\", \"datatype\": dbt.type_timestamp()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.type_timestamp", "macro.dbt.type_int", "macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789079002.6164954, "supported_languages": null}, "macro.iterable.get_template_history_columns": {"name": "get_template_history_columns", "resource_type": "macro", "package_name": "iterable", "path": "macros/staging/get_template_history_columns.sql", "original_file_path": "macros/staging/get_template_history_columns.sql", "unique_id": "macro.iterable.get_template_history_columns", "macro_sql": "{% macro get_template_history_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"client_template_id\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"created_at\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"creator_user_id\", \"datatype\": dbt.type_string()},\n {\"name\": \"id\", \"datatype\": dbt.type_int()},\n {\"name\": \"message_type_id\", \"datatype\": dbt.type_int()},\n {\"name\": \"name\", \"datatype\": dbt.type_string()},\n {\"name\": \"template_type\", \"datatype\": dbt.type_string()},\n {\"name\": \"updated_at\", \"datatype\": dbt.type_timestamp()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.type_timestamp", "macro.dbt.type_numeric", "macro.dbt.type_string", "macro.dbt.type_int"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789079002.6175673, "supported_languages": null}, "macro.iterable.get_journey_columns": {"name": "get_journey_columns", "resource_type": "macro", "package_name": "iterable", "path": "macros/staging/get_journey_columns.sql", "original_file_path": "macros/staging/get_journey_columns.sql", "unique_id": "macro.iterable.get_journey_columns", "macro_sql": "{% macro get_journey_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_deleted\", \"datatype\": \"boolean\"},\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"created_at\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"creator_user_id\", \"datatype\": dbt.type_string()},\n {\"name\": \"description\", \"datatype\": dbt.type_string()},\n {\"name\": \"enabled\", \"datatype\": \"boolean\"},\n {\"name\": \"id\", \"datatype\": dbt.type_int()},\n {\"name\": \"is_archived\", \"datatype\": \"boolean\"},\n {\"name\": \"journey_type\", \"datatype\": dbt.type_string()},\n {\"name\": \"lifetime_limit\", \"datatype\": dbt.type_int()},\n {\"name\": \"name\", \"datatype\": dbt.type_string()},\n {\"name\": \"simultaneous_limit\", \"datatype\": dbt.type_int()},\n {\"name\": \"start_tile_id\", \"datatype\": dbt.type_int()},\n {\"name\": \"trigger_event_names\", \"datatype\": dbt.type_string()},\n {\"name\": \"updated_at\", \"datatype\": dbt.type_timestamp()}\n] %}\n\n{{ fivetran_utils.add_pass_through_columns(columns, var('iterable_journey_pass_through_columns')) }}\n\n{{ return(columns) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.type_timestamp", "macro.dbt.type_string", "macro.dbt.type_int", "macro.fivetran_utils.add_pass_through_columns"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789079002.6192496, "supported_languages": null}, "macro.iterable.get_list_user_columns": {"name": "get_list_user_columns", "resource_type": "macro", "package_name": "iterable", "path": "macros/staging/get_list_user_columns.sql", "original_file_path": "macros/staging/get_list_user_columns.sql", "unique_id": "macro.iterable.get_list_user_columns", "macro_sql": "{% macro get_list_user_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_id\", \"datatype\": dbt.type_string()},\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"index\", \"datatype\": dbt.type_int()},\n {\"name\": \"list_id\", \"datatype\": dbt.type_int()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.type_string", "macro.dbt.type_timestamp", "macro.dbt.type_int"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789079002.6198719, "supported_languages": null}, "macro.iterable.json_to_string": {"name": "json_to_string", "resource_type": "macro", "package_name": "iterable", "path": "macros/staging/json_to_string.sql", "original_file_path": "macros/staging/json_to_string.sql", "unique_id": "macro.iterable.json_to_string", "macro_sql": "{%- macro json_to_string(column, column_list) -%}\n {{ return(adapter.dispatch('json_to_string', 'iterable')(column, column_list)) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.iterable.default__json_to_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "column", "type": null, "description": ""}, {"name": "column_list", "type": null, "description": ""}], "created_at": 1789079002.6202912, "supported_languages": null}, "macro.iterable.default__json_to_string": {"name": "default__json_to_string", "resource_type": "macro", "package_name": "iterable", "path": "macros/staging/json_to_string.sql", "original_file_path": "macros/staging/json_to_string.sql", "unique_id": "macro.iterable.default__json_to_string", "macro_sql": "{%- macro default__json_to_string(column, column_list) -%}\n cast({{ column }} as {{ dbt.type_string() }})\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "column", "type": null, "description": ""}, {"name": "column_list", "type": null, "description": ""}], "created_at": 1789079002.620468, "supported_languages": null}, "macro.iterable.bigquery__json_to_string": {"name": "bigquery__json_to_string", "resource_type": "macro", "package_name": "iterable", "path": "macros/staging/json_to_string.sql", "original_file_path": "macros/staging/json_to_string.sql", "unique_id": "macro.iterable.bigquery__json_to_string", "macro_sql": "{%- macro bigquery__json_to_string(column, column_list) -%}\n {%- set columns = column_list -%}\n {%- set ns = namespace(column_type='string') -%}\n\n {%- for col in columns -%}\n {%- if col.name|lower == column|lower -%}\n {%- set ns.column_type = col.dtype|lower -%}\n {%- endif -%}\n {%- endfor -%}\n\n {%- if ns.column_type == 'json' -%}\n to_json_string({{ column }})\n {%- else -%}\n cast({{ column }} as {{ dbt.type_string() }})\n {%- endif -%}\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "column", "type": null, "description": ""}, {"name": "column_list", "type": null, "description": ""}], "created_at": 1789079002.6210716, "supported_languages": null}, "macro.iterable.get_user_unsubscribed_message_type_columns": {"name": "get_user_unsubscribed_message_type_columns", "resource_type": "macro", "package_name": "iterable", "path": "macros/staging/get_user_unsubscribed_message_type_columns.sql", "original_file_path": "macros/staging/get_user_unsubscribed_message_type_columns.sql", "unique_id": "macro.iterable.get_user_unsubscribed_message_type_columns", "macro_sql": "{% macro get_user_unsubscribed_message_type_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"_fivetran_id\", \"datatype\": dbt.type_string()},\n {\"name\": \"message_type_id\", \"datatype\": dbt.type_string()},\n {\"name\": \"email\", \"datatype\": dbt.type_string()},\n {\"name\": \"updated_at\", \"datatype\": dbt.type_timestamp()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.type_timestamp", "macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789079002.6217852, "supported_languages": null}, "macro.iterable.does_table_exist": {"name": "does_table_exist", "resource_type": "macro", "package_name": "iterable", "path": "macros/staging/does_table_exist.sql", "original_file_path": "macros/staging/does_table_exist.sql", "unique_id": "macro.iterable.does_table_exist", "macro_sql": "{%- macro does_table_exist(table_name) -%}\n {%- if execute -%} -- returns true when dbt is in execute mode\n {%- set ns = namespace(has_table=false) -%} -- declare boolean namespace and default value \n {%- for node in graph.sources.values() -%} -- grab sources from the dictionary of nodes \n -- call the database for the matching table\n {%- if node.name | lower == table_name | lower -%} \n {%- set source_relation = adapter.get_relation(\n database=node.database,\n schema=node.schema,\n identifier=node.identifier ) -%}\n {% endif %}\n {%- if source_relation == None -%} \n {{ return(False) }} -- return false if relation identified by the database.schema.identifier does not exist for the given table name\n {% endif %}\n {%- endfor -%}\n {{ return(True) }}\n {%- endif -%} \n{%- endmacro -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "table_name", "type": null, "description": ""}], "created_at": 1789079002.6226323, "supported_languages": null}, "macro.iterable.get_user_history_columns": {"name": "get_user_history_columns", "resource_type": "macro", "package_name": "iterable", "path": "macros/staging/get_user_history_columns.sql", "original_file_path": "macros/staging/get_user_history_columns.sql", "unique_id": "macro.iterable.get_user_history_columns", "macro_sql": "{% macro get_user_history_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_id\", \"datatype\": dbt.type_string()},\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"email\", \"datatype\": dbt.type_string()},\n {\"name\": \"email_list_ids\", \"datatype\": dbt.type_string()},\n {\"name\": \"first_name\", \"datatype\": dbt.type_string()},\n {\"name\": \"last_name\", \"datatype\": dbt.type_string()},\n {\"name\": \"phone_number\", \"datatype\": dbt.type_string()},\n {\"name\": \"signup_date\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"signup_source\", \"datatype\": dbt.type_string()},\n {\"name\": \"updated_at\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"user_id\", \"datatype\": dbt.type_string()},\n {\"name\": \"iterable_user_id\", \"datatype\": dbt.type_string()}\n\n] %}\n\n{{ fivetran_utils.add_pass_through_columns(columns, var('iterable_user_history_pass_through_columns')) }}\n\n{{ return(columns) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.type_string", "macro.dbt.type_timestamp", "macro.fivetran_utils.add_pass_through_columns"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789079002.62412, "supported_languages": null}, "macro.iterable.get_campaign_suppression_list_history_columns": {"name": "get_campaign_suppression_list_history_columns", "resource_type": "macro", "package_name": "iterable", "path": "macros/staging/get_campaign_suppression_list_history_columns.sql", "original_file_path": "macros/staging/get_campaign_suppression_list_history_columns.sql", "unique_id": "macro.iterable.get_campaign_suppression_list_history_columns", "macro_sql": "{% macro get_campaign_suppression_list_history_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"campaign_id\", \"datatype\": dbt.type_int()},\n {\"name\": \"suppressed_list_id\", \"datatype\": dbt.type_int()},\n {\"name\": \"updated_at\", \"datatype\": dbt.type_timestamp()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.type_timestamp", "macro.dbt.type_int"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789079002.6247473, "supported_languages": null}, "macro.iterable.get_user_unsubscribed_channel_columns": {"name": "get_user_unsubscribed_channel_columns", "resource_type": "macro", "package_name": "iterable", "path": "macros/staging/get_user_unsubscribed_channel_columns.sql", "original_file_path": "macros/staging/get_user_unsubscribed_channel_columns.sql", "unique_id": "macro.iterable.get_user_unsubscribed_channel_columns", "macro_sql": "{% macro get_user_unsubscribed_channel_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"_fivetran_id\", \"datatype\": dbt.type_string()},\n {\"name\": \"channel_id\", \"datatype\": dbt.type_int()},\n {\"name\": \"email\", \"datatype\": dbt.type_string()},\n {\"name\": \"updated_at\", \"datatype\": dbt.type_timestamp()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.type_timestamp", "macro.dbt.type_string", "macro.dbt.type_int"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789079002.6254733, "supported_languages": null}, "macro.iterable.get_message_type_columns": {"name": "get_message_type_columns", "resource_type": "macro", "package_name": "iterable", "path": "macros/staging/get_message_type_columns.sql", "original_file_path": "macros/staging/get_message_type_columns.sql", "unique_id": "macro.iterable.get_message_type_columns", "macro_sql": "{% macro get_message_type_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_deleted\", \"datatype\": \"boolean\"},\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"channel_id\", \"datatype\": dbt.type_int()},\n {\"name\": \"id\", \"datatype\": dbt.type_int()},\n {\"name\": \"name\", \"datatype\": dbt.type_string()},\n {\"name\": \"created_at\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"frequency_cap\", \"datatype\": dbt.type_string()},\n {\"name\": \"rate_limit_per_minute\", \"datatype\": dbt.type_string()},\n {\"name\": \"subscription_policy\", \"datatype\": dbt.type_string()},\n {\"name\": \"updated_at\", \"datatype\": dbt.type_timestamp()},\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.type_timestamp", "macro.dbt.type_int", "macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789079002.6267033, "supported_languages": null}, "macro.iterable.get_channel_columns": {"name": "get_channel_columns", "resource_type": "macro", "package_name": "iterable", "path": "macros/staging/get_channel_columns.sql", "original_file_path": "macros/staging/get_channel_columns.sql", "unique_id": "macro.iterable.get_channel_columns", "macro_sql": "{% macro get_channel_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_deleted\", \"datatype\": \"boolean\"},\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"channel_type\", \"datatype\": dbt.type_string()},\n {\"name\": \"id\", \"datatype\": dbt.type_int()},\n {\"name\": \"message_medium\", \"datatype\": dbt.type_string()},\n {\"name\": \"name\", \"datatype\": dbt.type_string()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.type_timestamp", "macro.dbt.type_string", "macro.dbt.type_int"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789079002.6275144, "supported_languages": null}, "macro.fivetran_utils.enabled_vars_one_true": {"name": "enabled_vars_one_true", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/enabled_vars_one_true.sql", "original_file_path": "macros/enabled_vars_one_true.sql", "unique_id": "macro.fivetran_utils.enabled_vars_one_true", "macro_sql": "{% macro enabled_vars_one_true(vars) %}\n\n{% for v in vars %}\n \n {% if var(v, False) == True %}\n {{ return(True) }}\n {% endif %}\n\n{% endfor %}\n\n{{ return(False) }}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "vars", "type": null, "description": ""}], "created_at": 1789079002.6279666, "supported_languages": null}, "macro.fivetran_utils.json_parse": {"name": "json_parse", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/json_parse.sql", "original_file_path": "macros/json_parse.sql", "unique_id": "macro.fivetran_utils.json_parse", "macro_sql": "{% macro json_parse(string, string_path) -%}\n\n{{ adapter.dispatch('json_parse', 'fivetran_utils') (string, string_path) }}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.postgres__json_parse"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "string", "type": null, "description": ""}, {"name": "string_path", "type": null, "description": ""}], "created_at": 1789079002.6286838, "supported_languages": null}, "macro.fivetran_utils.default__json_parse": {"name": "default__json_parse", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/json_parse.sql", "original_file_path": "macros/json_parse.sql", "unique_id": "macro.fivetran_utils.default__json_parse", "macro_sql": "{% macro default__json_parse(string, string_path) %}\n\n json_extract_path_text({{string}}, {%- for s in string_path -%}'{{ s }}'{%- if not loop.last -%},{%- endif -%}{%- endfor -%} )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "string", "type": null, "description": ""}, {"name": "string_path", "type": null, "description": ""}], "created_at": 1789079002.6289861, "supported_languages": null}, "macro.fivetran_utils.redshift__json_parse": {"name": "redshift__json_parse", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/json_parse.sql", "original_file_path": "macros/json_parse.sql", "unique_id": "macro.fivetran_utils.redshift__json_parse", "macro_sql": "{% macro redshift__json_parse(string, string_path) %}\n\n json_extract_path_text({{string}}, {%- for s in string_path -%}'{{ s }}'{%- if not loop.last -%},{%- endif -%}{%- endfor -%} )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "string", "type": null, "description": ""}, {"name": "string_path", "type": null, "description": ""}], "created_at": 1789079002.6292741, "supported_languages": null}, "macro.fivetran_utils.bigquery__json_parse": {"name": "bigquery__json_parse", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/json_parse.sql", "original_file_path": "macros/json_parse.sql", "unique_id": "macro.fivetran_utils.bigquery__json_parse", "macro_sql": "{% macro bigquery__json_parse(string, string_path) %}\n\n \n json_extract_scalar({{string}}, '$.{%- for s in string_path -%}{{ s }}{%- if not loop.last -%}.{%- endif -%}{%- endfor -%} ')\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "string", "type": null, "description": ""}, {"name": "string_path", "type": null, "description": ""}], "created_at": 1789079002.6295512, "supported_languages": null}, "macro.fivetran_utils.postgres__json_parse": {"name": "postgres__json_parse", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/json_parse.sql", "original_file_path": "macros/json_parse.sql", "unique_id": "macro.fivetran_utils.postgres__json_parse", "macro_sql": "{% macro postgres__json_parse(string, string_path) %}\n\n {{string}}::json #>> '{ {%- for s in string_path -%}{{ s }}{%- if not loop.last -%},{%- endif -%}{%- endfor -%} }'\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "string", "type": null, "description": ""}, {"name": "string_path", "type": null, "description": ""}], "created_at": 1789079002.6298263, "supported_languages": null}, "macro.fivetran_utils.snowflake__json_parse": {"name": "snowflake__json_parse", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/json_parse.sql", "original_file_path": "macros/json_parse.sql", "unique_id": "macro.fivetran_utils.snowflake__json_parse", "macro_sql": "{% macro snowflake__json_parse(string, string_path) %}\n\n parse_json( {{string}} ) {%- for s in string_path -%}{% if s is number %}[{{ s }}]{% else %}['{{ s }}']{% endif %}{%- endfor -%}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "string", "type": null, "description": ""}, {"name": "string_path", "type": null, "description": ""}], "created_at": 1789079002.630143, "supported_languages": null}, "macro.fivetran_utils.spark__json_parse": {"name": "spark__json_parse", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/json_parse.sql", "original_file_path": "macros/json_parse.sql", "unique_id": "macro.fivetran_utils.spark__json_parse", "macro_sql": "{% macro spark__json_parse(string, string_path) %}\n\n {{string}} : {%- for s in string_path -%}{% if s is number %}[{{ s }}]{% else %}['{{ s }}']{% endif %}{%- endfor -%}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "string", "type": null, "description": ""}, {"name": "string_path", "type": null, "description": ""}], "created_at": 1789079002.6304452, "supported_languages": null}, "macro.fivetran_utils.sqlserver__json_parse": {"name": "sqlserver__json_parse", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/json_parse.sql", "original_file_path": "macros/json_parse.sql", "unique_id": "macro.fivetran_utils.sqlserver__json_parse", "macro_sql": "{% macro sqlserver__json_parse(string, string_path) %}\n\n json_value({{string}}, '$.{%- for s in string_path -%}{{ s }}{%- if not loop.last -%}.{%- endif -%}{%- endfor -%} ')\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "string", "type": null, "description": ""}, {"name": "string_path", "type": null, "description": ""}], "created_at": 1789079002.630716, "supported_languages": null}, "macro.fivetran_utils.duckdb__json_parse": {"name": "duckdb__json_parse", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/json_parse.sql", "original_file_path": "macros/json_parse.sql", "unique_id": "macro.fivetran_utils.duckdb__json_parse", "macro_sql": "{% macro duckdb__json_parse(string, string_path) %}\n\n json_extract_string({{string}}, '${%- for s in string_path -%}{% if s is number %}[{{ s }}]{% else %}.{{ s }}{% endif %}{%- endfor -%}')\n \n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "string", "type": null, "description": ""}, {"name": "string_path", "type": null, "description": ""}], "created_at": 1789079002.6310365, "supported_languages": null}, "macro.fivetran_utils.union_relations_custom": {"name": "union_relations_custom", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/union_relations_custom.sql", "original_file_path": "macros/union_relations_custom.sql", "unique_id": "macro.fivetran_utils.union_relations_custom", "macro_sql": "{%- macro union_relations_custom(relations, aliases=none, column_override=none, include=[], exclude=[], source_column_name='_dbt_source_relation', where=none) -%}\n {{ return(adapter.dispatch('union_relations_custom', 'fivetran_utils')(relations, aliases, column_override, include, exclude, source_column_name, where)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.default__union_relations_custom"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relations", "type": null, "description": ""}, {"name": "aliases", "type": null, "description": ""}, {"name": "column_override", "type": null, "description": ""}, {"name": "include", "type": null, "description": ""}, {"name": "exclude", "type": null, "description": ""}, {"name": "source_column_name", "type": null, "description": ""}, {"name": "where", "type": null, "description": ""}], "created_at": 1789079002.6322722, "supported_languages": null}, "macro.fivetran_utils.default__union_relations_custom": {"name": "default__union_relations_custom", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/union_relations_custom.sql", "original_file_path": "macros/union_relations_custom.sql", "unique_id": "macro.fivetran_utils.default__union_relations_custom", "macro_sql": "\n\n{%- macro default__union_relations_custom(relations, aliases=none, column_override=none, include=[], exclude=[], source_column_name='_dbt_source_relation', where=none) -%}\n\n {%- if exclude and include -%}\n {{ exceptions.raise_compiler_error(\"Both an exclude and include list were provided to the `union` macro. Only one is allowed\") }}\n {%- endif -%}\n\n {#-- Prevent querying of db in parsing mode. This works because this macro does not create any new refs. -#}\n {%- if not execute %}\n {{ return('') }}\n {% endif -%}\n\n {%- set column_override = column_override if column_override is not none else {} -%}\n\n {%- set relation_columns = {} -%}\n {%- set column_superset = {} -%}\n {%- set all_excludes = [] -%}\n {%- set all_includes = [] -%}\n\n {%- if exclude -%}\n {%- for exc in exclude -%}\n {%- do all_excludes.append(exc | lower) -%}\n {%- endfor -%}\n {%- endif -%}\n\n {%- if include -%}\n {%- for inc in include -%}\n {%- do all_includes.append(inc | lower) -%}\n {%- endfor -%}\n {%- endif -%}\n\n {%- for relation in relations -%}\n\n {%- do relation_columns.update({relation: []}) -%}\n\n {%- do dbt_utils._is_relation(relation, 'union_relations_custom') -%}\n {%- do dbt_utils._is_ephemeral(relation, 'union_relations_custom') -%}\n {%- set cols = adapter.get_columns_in_relation(relation) -%}\n {%- for col in cols -%}\n\n {#- If an exclude list was provided and the column is in the list, do nothing -#}\n {%- if exclude and col.column | lower in all_excludes -%}\n\n {#- If an include list was provided and the column is not in the list, do nothing -#}\n {%- elif include and col.column | lower not in all_includes -%}\n\n {#- Otherwise add the column to the column superset -#}\n {%- else -%}\n\n {#- update the list of columns in this relation -#}\n {%- do relation_columns[relation].append(col.column) -%}\n\n {%- if col.column in column_superset -%}\n\n {%- set stored = column_superset[col.column] -%}\n {%- if col.is_string() and stored.is_string() and col.string_size() > stored.string_size() -%}\n\n {%- do column_superset.update({col.column: col}) -%}\n\n {%- endif %}\n\n {%- else -%}\n\n {%- do column_superset.update({col.column: col}) -%}\n\n {%- endif -%}\n\n {%- endif -%}\n\n {%- endfor -%}\n {%- endfor -%}\n\n {%- set ordered_column_names = column_superset.keys() -%}\n {%- set dbt_command = flags.WHICH -%}\n\n\n {% if dbt_command in ['run', 'build'] %}\n {% if (include | length > 0 or exclude | length > 0) and not column_superset.keys() %}\n {%- set relations_string -%}\n {%- for relation in relations -%}\n {{ relation.name }}\n {%- if not loop.last %}, {% endif -%}\n {%- endfor -%}\n {%- endset -%}\n\n {%- set error_message -%}\n There were no columns found to union for relations {{ relations_string }}\n {%- endset -%}\n\n {{ exceptions.raise_compiler_error(error_message) }}\n {%- endif -%}\n {%- endif -%}\n\n {%- for relation in relations %}\n\n (\n select\n\n {%- if source_column_name is not none %}\n {# dbt_utils union_relations includes the table in the source_relation. For Fivetran dbt package purposes the table should not be included in the source relation. #}\n cast({{ dbt.string_literal(relation.database ~ '.' ~ relation.schema) }} as {{ dbt.type_string() }}) as {{ source_column_name }},\n {%- endif %}\n\n {% for col_name in ordered_column_names -%}\n\n {%- set col = column_superset[col_name] %}\n {%- set col_type = column_override.get(col.column, col.data_type) %}\n {%- set col_name = adapter.quote(col_name) if col_name in relation_columns[relation] else 'null' %}\n cast({{ col_name }} as {{ col_type }}) as {{ col.quoted }} {% if not loop.last %},{% endif -%}\n\n {%- endfor %}\n \n {# This alias is a change from dbt_utils union_relations code. Avoids errors if the table is named a reserved keyword #}\n from {{ aliases[loop.index0] if aliases else relation }} as unioned_relation_{{ loop.index }}\n\n {% if where -%}\n where {{ where }}\n {%- endif %}\n )\n\n {% if not loop.last -%}\n union all\n {% endif -%}\n\n {%- endfor -%}\n\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt_utils._is_relation", "macro.dbt_utils._is_ephemeral", "macro.dbt.string_literal", "macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relations", "type": null, "description": ""}, {"name": "aliases", "type": null, "description": ""}, {"name": "column_override", "type": null, "description": ""}, {"name": "include", "type": null, "description": ""}, {"name": "exclude", "type": null, "description": ""}, {"name": "source_column_name", "type": null, "description": ""}, {"name": "where", "type": null, "description": ""}], "created_at": 1789079002.6362786, "supported_languages": null}, "macro.fivetran_utils.seed_data_helper": {"name": "seed_data_helper", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/seed_data_helper.sql", "original_file_path": "macros/seed_data_helper.sql", "unique_id": "macro.fivetran_utils.seed_data_helper", "macro_sql": "{% macro seed_data_helper(seed_name, warehouses) %}\n\n{% if target.type in warehouses %}\n {% for w in warehouses %}\n {% if target.type == w %}\n {{ return(ref(seed_name ~ \"_\" ~ w ~ \"\")) }}\n {% endif %}\n {% endfor %}\n{% else %}\n{{ return(ref(seed_name)) }}\n{% endif %}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "seed_name", "type": null, "description": ""}, {"name": "warehouses", "type": null, "description": ""}], "created_at": 1789079002.6369662, "supported_languages": null}, "macro.fivetran_utils.drop_schemas_automation": {"name": "drop_schemas_automation", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/drop_schemas_automation.sql", "original_file_path": "macros/drop_schemas_automation.sql", "unique_id": "macro.fivetran_utils.drop_schemas_automation", "macro_sql": "{% macro drop_schemas_automation(drop_target_schema=true) %}\n {{ return(adapter.dispatch('drop_schemas_automation', 'fivetran_utils')(drop_target_schema)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.default__drop_schemas_automation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "drop_target_schema", "type": null, "description": ""}], "created_at": 1789079002.6374838, "supported_languages": null}, "macro.fivetran_utils.default__drop_schemas_automation": {"name": "default__drop_schemas_automation", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/drop_schemas_automation.sql", "original_file_path": "macros/drop_schemas_automation.sql", "unique_id": "macro.fivetran_utils.default__drop_schemas_automation", "macro_sql": "{% macro default__drop_schemas_automation(drop_target_schema=true) %}\n\n{% set fetch_list_sql %}\n {% if target.type not in ('databricks', 'spark') %}\n select schema_name\n from \n {{ wrap_in_quotes(target.database) }}.INFORMATION_SCHEMA.SCHEMATA\n where lower(schema_name) like '{{ target.schema | lower }}{%- if not drop_target_schema -%}_{%- endif -%}%'\n {% else %}\n SHOW SCHEMAS LIKE '{{ target.schema }}{%- if not drop_target_schema -%}_{%- endif -%}*'\n {% endif %}\n{% endset %}\n\n{% set results = run_query(fetch_list_sql) %}\n\n{% if execute %}\n {% set results_list = results.columns[0].values() %}\n{% else %}\n {% set results_list = [] %}\n{% endif %}\n\n{% for schema_to_drop in results_list %}\n {% do adapter.drop_schema(api.Relation.create(database=target.database, schema=schema_to_drop)) %}\n {{ print('Schema ' ~ schema_to_drop ~ ' successfully dropped from the ' ~ target.database ~ ' database.\\n')}}\n{% endfor %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.wrap_in_quotes", "macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "drop_target_schema", "type": null, "description": ""}], "created_at": 1789079002.6386201, "supported_languages": null}, "macro.fivetran_utils.duckdb__drop_schemas_automation": {"name": "duckdb__drop_schemas_automation", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/drop_schemas_automation.sql", "original_file_path": "macros/drop_schemas_automation.sql", "unique_id": "macro.fivetran_utils.duckdb__drop_schemas_automation", "macro_sql": "{% macro duckdb__drop_schemas_automation(drop_target_schema=true) %}\n\n {{ print('Not dropping any schemas in DuckDB.\\n') }}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "drop_target_schema", "type": null, "description": ""}], "created_at": 1789079002.638801, "supported_languages": null}, "macro.fivetran_utils.ceiling": {"name": "ceiling", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/ceiling.sql", "original_file_path": "macros/ceiling.sql", "unique_id": "macro.fivetran_utils.ceiling", "macro_sql": "{% macro ceiling(num) -%}\n\n{{ adapter.dispatch('ceiling', 'fivetran_utils') (num) }}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.default__ceiling"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "num", "type": null, "description": ""}], "created_at": 1789079002.6391003, "supported_languages": null}, "macro.fivetran_utils.default__ceiling": {"name": "default__ceiling", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/ceiling.sql", "original_file_path": "macros/ceiling.sql", "unique_id": "macro.fivetran_utils.default__ceiling", "macro_sql": "{% macro default__ceiling(num) %}\n ceiling({{ num }})\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "num", "type": null, "description": ""}], "created_at": 1789079002.6392298, "supported_languages": null}, "macro.fivetran_utils.snowflake__ceiling": {"name": "snowflake__ceiling", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/ceiling.sql", "original_file_path": "macros/ceiling.sql", "unique_id": "macro.fivetran_utils.snowflake__ceiling", "macro_sql": "{% macro snowflake__ceiling(num) %}\n ceil({{ num }})\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "num", "type": null, "description": ""}], "created_at": 1789079002.6393535, "supported_languages": null}, "macro.fivetran_utils.fill_pass_through_columns": {"name": "fill_pass_through_columns", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/fill_pass_through_columns.sql", "original_file_path": "macros/fill_pass_through_columns.sql", "unique_id": "macro.fivetran_utils.fill_pass_through_columns", "macro_sql": "{% macro fill_pass_through_columns(pass_through_variable) %}\n\n{% if var(pass_through_variable) %}\n {% for field in var(pass_through_variable) %}\n {% if field is mapping %}\n {% if field.transform_sql %}\n , {{ field.transform_sql }} as {{ field.alias if field.alias else field.name }}\n {% else %}\n , {{ field.alias if field.alias else field.name }}\n {% endif %}\n {% else %}\n , {{ field }}\n {% endif %}\n {% endfor %}\n{% endif %}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "pass_through_variable", "type": null, "description": ""}], "created_at": 1789079002.64011, "supported_languages": null}, "macro.fivetran_utils.persist_pass_through_columns": {"name": "persist_pass_through_columns", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/persist_pass_through_columns.sql", "original_file_path": "macros/persist_pass_through_columns.sql", "unique_id": "macro.fivetran_utils.persist_pass_through_columns", "macro_sql": "{% macro persist_pass_through_columns(pass_through_variable, identifier=none, transform='') %}\n\n{% if var(pass_through_variable, none) %}\n {% for field in var(pass_through_variable) %}\n , {{ transform ~ '(' ~ (identifier ~ '.' if identifier else '') ~ (field.alias if field.alias else field.name) ~ ')' }} as {{ field.alias if field.alias else field.name }}\n {% endfor %}\n{% endif %}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "pass_through_variable", "type": null, "description": ""}, {"name": "identifier", "type": null, "description": ""}, {"name": "transform", "type": null, "description": ""}], "created_at": 1789079002.640789, "supported_languages": null}, "macro.fivetran_utils.try_cast": {"name": "try_cast", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/try_cast.sql", "original_file_path": "macros/try_cast.sql", "unique_id": "macro.fivetran_utils.try_cast", "macro_sql": "{% macro try_cast(field, type) %}\n {{ adapter.dispatch('try_cast', 'fivetran_utils') (field, type) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.postgres__try_cast"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field", "type": null, "description": ""}, {"name": "type", "type": null, "description": ""}], "created_at": 1789079002.641354, "supported_languages": null}, "macro.fivetran_utils.default__try_cast": {"name": "default__try_cast", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/try_cast.sql", "original_file_path": "macros/try_cast.sql", "unique_id": "macro.fivetran_utils.default__try_cast", "macro_sql": "{% macro default__try_cast(field, type) %}\n {# most databases don't support this function yet\n so we just need to use cast #}\n cast({{field}} as {{type}})\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field", "type": null, "description": ""}, {"name": "type", "type": null, "description": ""}], "created_at": 1789079002.6415267, "supported_languages": null}, "macro.fivetran_utils.redshift__try_cast": {"name": "redshift__try_cast", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/try_cast.sql", "original_file_path": "macros/try_cast.sql", "unique_id": "macro.fivetran_utils.redshift__try_cast", "macro_sql": "{% macro redshift__try_cast(field, type) %}\n{%- if type == 'numeric' -%}\n\n case\n when trim({{field}}) ~ '^(0|[1-9][0-9]*)$' then trim({{field}})\n else null\n end::{{type}}\n\n{% else %}\n {{ exceptions.raise_compiler_error(\n \"non-numeric datatypes are not currently supported\") }}\n\n{% endif %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field", "type": null, "description": ""}, {"name": "type", "type": null, "description": ""}], "created_at": 1789079002.641872, "supported_languages": null}, "macro.fivetran_utils.postgres__try_cast": {"name": "postgres__try_cast", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/try_cast.sql", "original_file_path": "macros/try_cast.sql", "unique_id": "macro.fivetran_utils.postgres__try_cast", "macro_sql": "{% macro postgres__try_cast(field, type) %}\n{%- if type == 'numeric' -%}\n\n case\n when replace(cast({{field}} as varchar),cast(' ' as varchar),cast('' as varchar)) ~ '^(0|[1-9][0-9]*)$' \n then replace(cast({{field}} as varchar),cast(' ' as varchar),cast('' as varchar))\n else null\n end::{{type}}\n\n{% else %}\n {{ exceptions.raise_compiler_error(\n \"non-numeric datatypes are not currently supported\") }}\n\n{% endif %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field", "type": null, "description": ""}, {"name": "type", "type": null, "description": ""}], "created_at": 1789079002.6422074, "supported_languages": null}, "macro.fivetran_utils.snowflake__try_cast": {"name": "snowflake__try_cast", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/try_cast.sql", "original_file_path": "macros/try_cast.sql", "unique_id": "macro.fivetran_utils.snowflake__try_cast", "macro_sql": "{% macro snowflake__try_cast(field, type) %}\n try_cast(cast({{field}} as varchar) as {{type}})\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field", "type": null, "description": ""}, {"name": "type", "type": null, "description": ""}], "created_at": 1789079002.6423724, "supported_languages": null}, "macro.fivetran_utils.bigquery__try_cast": {"name": "bigquery__try_cast", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/try_cast.sql", "original_file_path": "macros/try_cast.sql", "unique_id": "macro.fivetran_utils.bigquery__try_cast", "macro_sql": "{% macro bigquery__try_cast(field, type) %}\n safe_cast({{field}} as {{type}})\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field", "type": null, "description": ""}, {"name": "type", "type": null, "description": ""}], "created_at": 1789079002.642593, "supported_languages": null}, "macro.fivetran_utils.spark__try_cast": {"name": "spark__try_cast", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/try_cast.sql", "original_file_path": "macros/try_cast.sql", "unique_id": "macro.fivetran_utils.spark__try_cast", "macro_sql": "{% macro spark__try_cast(field, type) %}\n try_cast({{field}} as {{type}})\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field", "type": null, "description": ""}, {"name": "type", "type": null, "description": ""}], "created_at": 1789079002.642744, "supported_languages": null}, "macro.fivetran_utils.sqlserver__try_cast": {"name": "sqlserver__try_cast", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/try_cast.sql", "original_file_path": "macros/try_cast.sql", "unique_id": "macro.fivetran_utils.sqlserver__try_cast", "macro_sql": "{% macro sqlserver__try_cast(field, type) %}\n try_cast({{field}} as {{type}})\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field", "type": null, "description": ""}, {"name": "type", "type": null, "description": ""}], "created_at": 1789079002.6429071, "supported_languages": null}, "macro.fivetran_utils.fivetran_date_spine": {"name": "fivetran_date_spine", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/fivetran_date_spine.sql", "original_file_path": "macros/fivetran_date_spine.sql", "unique_id": "macro.fivetran_utils.fivetran_date_spine", "macro_sql": "{% macro fivetran_date_spine(datepart, start_date, end_date) -%}\n\n{{ return(adapter.dispatch('fivetran_date_spine', 'fivetran_utils') (datepart, start_date, end_date)) }}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.default__fivetran_date_spine"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "datepart", "type": null, "description": ""}, {"name": "start_date", "type": null, "description": ""}, {"name": "end_date", "type": null, "description": ""}], "created_at": 1789079002.6434743, "supported_languages": null}, "macro.fivetran_utils.default__fivetran_date_spine": {"name": "default__fivetran_date_spine", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/fivetran_date_spine.sql", "original_file_path": "macros/fivetran_date_spine.sql", "unique_id": "macro.fivetran_utils.default__fivetran_date_spine", "macro_sql": "{% macro default__fivetran_date_spine(datepart, start_date, end_date) %}\n\n {{ dbt_utils.date_spine(datepart, start_date, end_date) }}\n \n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.date_spine"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "datepart", "type": null, "description": ""}, {"name": "start_date", "type": null, "description": ""}, {"name": "end_date", "type": null, "description": ""}], "created_at": 1789079002.6436815, "supported_languages": null}, "macro.fivetran_utils.sqlserver__fivetran_date_spine": {"name": "sqlserver__fivetran_date_spine", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/fivetran_date_spine.sql", "original_file_path": "macros/fivetran_date_spine.sql", "unique_id": "macro.fivetran_utils.sqlserver__fivetran_date_spine", "macro_sql": "{% macro sqlserver__fivetran_date_spine(datepart, start_date, end_date) -%}\n\n {% set date_spine_query %}\n with\n\n l0 as (\n\n select c\n from (select 1 union all select 1) as d(c)\n\n ),\n l1 as (\n\n select\n 1 as c\n from l0 as a\n cross join l0 as b\n\n ),\n\n l2 as (\n\n select 1 as c\n from l1 as a\n cross join l1 as b\n ),\n\n l3 as (\n\n select 1 as c\n from l2 as a\n cross join l2 as b\n ),\n\n l4 as (\n\n select 1 as c\n from l3 as a\n cross join l3 as b\n ),\n\n l5 as (\n\n select 1 as c\n from l4 as a\n cross join l4 as b\n ),\n\n nums as (\n\n select row_number() over (order by (select null)) as rownum\n from l5\n ),\n\n rawdata as (\n\n select top ({{dbt.datediff(start_date, end_date, datepart)}}) rownum -1 as n\n from nums\n order by rownum\n ),\n\n all_periods as (\n\n select (\n {{\n dbt.dateadd(\n datepart,\n 'n',\n start_date\n )\n }}\n ) as date_{{datepart}}\n from rawdata\n ),\n\n filtered as (\n\n select *\n from all_periods\n where date_{{datepart}} <= {{ end_date }}\n\n )\n\n select * from filtered\n order by 1\n\n {% endset %}\n\n {% set results = run_query(date_spine_query) %}\n\n {% if execute %}\n\n {% set results_list = results.columns[0].values() %}\n \n {% else %}\n\n {% set results_list = [] %}\n\n {% endif %}\n\n {%- for date_field in results_list %}\n select cast('{{ date_field }}' as date) as date_{{datepart}} {{ 'union all ' if not loop.last else '' }}\n {% endfor -%}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.datediff", "macro.dbt.dateadd", "macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "datepart", "type": null, "description": ""}, {"name": "start_date", "type": null, "description": ""}, {"name": "end_date", "type": null, "description": ""}], "created_at": 1789079002.644612, "supported_languages": null}, "macro.fivetran_utils.partition_by_source_relation": {"name": "partition_by_source_relation", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/partition_by_source_relation.sql", "original_file_path": "macros/partition_by_source_relation.sql", "unique_id": "macro.fivetran_utils.partition_by_source_relation", "macro_sql": "{% macro partition_by_source_relation(package_name, has_other_partitions='yes', alias=None, package_prefix_union_variable=true) %}\n {{ return(adapter.dispatch('partition_by_source_relation', 'fivetran_utils')(package_name, has_other_partitions, alias, package_prefix_union_variable)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.default__partition_by_source_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "package_name", "type": null, "description": ""}, {"name": "has_other_partitions", "type": null, "description": ""}, {"name": "alias", "type": null, "description": ""}, {"name": "package_prefix_union_variable", "type": null, "description": ""}], "created_at": 1789079002.6451993, "supported_languages": null}, "macro.fivetran_utils.default__partition_by_source_relation": {"name": "default__partition_by_source_relation", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/partition_by_source_relation.sql", "original_file_path": "macros/partition_by_source_relation.sql", "unique_id": "macro.fivetran_utils.default__partition_by_source_relation", "macro_sql": "{% macro default__partition_by_source_relation(package_name, has_other_partitions='yes', alias=None, package_prefix_union_variable=true) -%}\n\n{%- if package_prefix_union_variable %}\n {%- set union_schemas_var = package_name ~ '_union_schemas' -%}\n {%- set union_databases_var = package_name ~ '_union_databases' -%}\n{%- else %}\n {%- set union_schemas_var = 'union_schemas' -%}\n {%- set union_databases_var = 'union_databases' -%}\n{%- endif -%}\n\n{%- set is_unioning = var(union_schemas_var, [])|length > 1 or var(union_databases_var, [])|length > 1 or var(package_name ~ '_sources', [])|length > 1 -%}\n{%- set prefix = '' if alias is none else alias ~ '.' -%}\n\n{%- if has_other_partitions == 'no' -%}\n {{- 'partition by ' ~ prefix ~ 'source_relation' if is_unioning else '' -}}\n{%- else -%}\n {{- ', ' ~ prefix ~ 'source_relation' if is_unioning else '' -}}\n{%- endif -%}\n\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "package_name", "type": null, "description": ""}, {"name": "has_other_partitions", "type": null, "description": ""}, {"name": "alias", "type": null, "description": ""}, {"name": "package_prefix_union_variable", "type": null, "description": ""}], "created_at": 1789079002.6461935, "supported_languages": null}, "macro.fivetran_utils.fill_staging_columns": {"name": "fill_staging_columns", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/fill_staging_columns.sql", "original_file_path": "macros/fill_staging_columns.sql", "unique_id": "macro.fivetran_utils.fill_staging_columns", "macro_sql": "{% macro fill_staging_columns(source_columns, staging_columns) %}\n\n{%- set source_column_names = source_columns|map(attribute='name')|map('lower')|list -%}\n{%- set using_source_casing = var('fivetran_using_source_casing', false) -%}\n\n{%- for column in staging_columns %}\n {%- if column.name|lower in source_column_names %}\n {%- if using_source_casing %}\n {%- set column_alias = column.alias if 'alias' in column else column.name %}\n {{ adapter.quote(column.name) }} as {{ adapter.quote(column_alias|upper if target.type == 'snowflake' else column_alias) }}\n {%- else %}\n {{ fivetran_utils.quote_column(column) }} as\n {%- if 'alias' in column %} {{ column.alias }}{% else %} {{ fivetran_utils.quote_column(column) }}{% endif %}\n {%- endif %}\n {%- else %}\n cast(null as {{ column.datatype }}) as\n {%- if 'alias' in column %} {{ column.alias }}{% else %} {{ fivetran_utils.quote_column(column) }}{% endif %}\n {%- endif %}{{ ',' if not loop.last }}\n{%- endfor %}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.quote_column"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "source_columns", "type": null, "description": ""}, {"name": "staging_columns", "type": null, "description": ""}], "created_at": 1789079002.6478019, "supported_languages": null}, "macro.fivetran_utils.quote_column": {"name": "quote_column", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/fill_staging_columns.sql", "original_file_path": "macros/fill_staging_columns.sql", "unique_id": "macro.fivetran_utils.quote_column", "macro_sql": "{% macro quote_column(column) %}\n {%- if 'quote' in column %}\n {%- if column.quote %}\n {%- if target.type in ('bigquery', 'spark', 'databricks') %}\n `{{ column.name }}`\n {%- elif target.type == 'snowflake' %}\n \"{{ column.name | upper }}\"\n {%- else %}\n \"{{ column.name }}\"\n {%- endif %}\n {%- else %}{{ column.name }}\n {%- endif %}\n {%- else %}{{ column.name }}\n {%- endif %}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "column", "type": null, "description": ""}], "created_at": 1789079002.648729, "supported_languages": null}, "macro.fivetran_utils.union_connections": {"name": "union_connections", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/union_connections.sql", "original_file_path": "macros/union_connections.sql", "unique_id": "macro.fivetran_utils.union_connections", "macro_sql": "{% macro union_connections(connection_dictionary, single_source_name, single_table_name, default_identifier=single_table_name) %}\n\n{{ adapter.dispatch('union_connections', 'fivetran_utils') (connection_dictionary, single_source_name, single_table_name, default_identifier) }}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.default__union_connections"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "connection_dictionary", "type": null, "description": ""}, {"name": "single_source_name", "type": null, "description": ""}, {"name": "single_table_name", "type": null, "description": ""}, {"name": "default_identifier", "type": null, "description": ""}], "created_at": 1789079002.6496115, "supported_languages": null}, "macro.fivetran_utils.default__union_connections": {"name": "default__union_connections", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/union_connections.sql", "original_file_path": "macros/union_connections.sql", "unique_id": "macro.fivetran_utils.default__union_connections", "macro_sql": "{% macro default__union_connections(connection_dictionary, single_source_name, single_table_name, default_identifier=single_table_name) %}\n\n{%- set exception_warning = \"\\n\\nPlease be aware: The \" ~ single_source_name|upper ~ \".\" ~ single_table_name|upper ~ \" table was not found in your schema(s). The Fivetran Data Model will create a completely empty staging model as to not break downstream transformations. To turn off these warnings, set the `fivetran__remove_empty_table_warnings` variable to TRUE (see https://github.com/fivetran/dbt_fivetran_utils/tree/releases/v0.4.latest#union_connections-source for details).\\n\"%}\n{%- set using_empty_table_warnings = (execute and not var('fivetran__remove_empty_table_warnings', false)) %}\n{%- set connections = var(connection_dictionary, []) %}\n{%- set using_unioning = connections | length > 0 %}\n{%- set identifier_var = single_source_name + \"_\" + single_table_name + \"_identifier\" %}\n\n{%- if using_unioning %}\n{# For unioning #}\n {%- set relations = [] -%}\n {%- for connection in connections -%}\n\n {% if var('has_defined_sources', false) %}\n {%- set database = source(connection.name, single_table_name).database %}\n {%- set schema = source(connection.name, single_table_name).schema %}\n {%- set identifier = source(connection.name, single_table_name).identifier %}\n {%- else %}\n {%- set database = connection.database if connection.database else target.database %}\n {%- set schema = connection.schema if connection.schema else single_source_name %}\n {%- set identifier = var(identifier_var, default_identifier) %}\n {%- endif %}\n \n {%- set relation=adapter.get_relation(\n database=database,\n schema=schema,\n identifier=identifier\n )\n -%}\n\n {%- if relation is not none -%}\n {%- do relations.append(relation) -%}\n {%- endif -%}\n\n -- ** Values passed to adapter.get_relation:\n {{ '-- database: ' ~ database }}\n {{ '-- schema: ' ~ schema }}\n {{ '-- identifier: ' ~ identifier ~ '\\n' }}\n\n {%- endfor -%}\n\n {%- if relations | length > 0 -%}\n {{ fivetran_utils.union_relations_custom(relations, source_column_name='_dbt_source_relation') }}\n\n {%- else -%}\n {{ exceptions.warn(exception_warning) if using_empty_table_warnings }}\n\n select\n cast(null as {{ dbt.type_string() }}) as _dbt_source_relation\n limit {{ '0' if target.type != 'redshift' else '1' }}\n {%- endif -%}\n\n{% else %}\n{# Not unioning #}\n\n {%- set database = source(single_source_name, single_table_name).database %}\n {%- set schema = source(single_source_name, single_table_name).schema %}\n {%- set identifier = var(identifier_var, default_identifier) %}\n\n {%- set relation=adapter.get_relation(\n database=database,\n schema=schema,\n identifier=identifier\n )\n -%}\n\n -- ** Values passed to adapter.get_relation:\n {{ '-- full-identifier_var: ' ~ identifier_var }}\n {{ '-- database: ' ~ database }} \n {{ '-- schema: ' ~ schema }}\n {{ '-- identifier: ' ~ identifier ~ '\\n' }}\n\n {% if relation is not none -%}\n select\n {{ dbt_utils.star(from=source(single_source_name, single_table_name)) }}\n from {{ source(single_source_name, single_table_name) }} as source_table\n\n {% else %}\n {{ exceptions.warn(exception_warning) if using_empty_table_warnings }}\n\n select\n cast(null as {{ dbt.type_string() }}) as _dbt_source_relation\n limit {{ '0' if target.type != 'redshift' else '1' }}\n {%- endif -%}\n{% endif -%}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.union_relations_custom", "macro.dbt.type_string", "macro.dbt_utils.star"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "connection_dictionary", "type": null, "description": ""}, {"name": "single_source_name", "type": null, "description": ""}, {"name": "single_table_name", "type": null, "description": ""}, {"name": "default_identifier", "type": null, "description": ""}], "created_at": 1789079002.6526597, "supported_languages": null}, "macro.fivetran_utils.source_relation": {"name": "source_relation", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/source_relation.sql", "original_file_path": "macros/source_relation.sql", "unique_id": "macro.fivetran_utils.source_relation", "macro_sql": "{% macro source_relation(union_schema_variable='union_schemas', union_database_variable='union_databases') -%}\n\n{{ adapter.dispatch('source_relation', 'fivetran_utils') (union_schema_variable, union_database_variable) }}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.default__source_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "union_schema_variable", "type": null, "description": ""}, {"name": "union_database_variable", "type": null, "description": ""}], "created_at": 1789079002.6531384, "supported_languages": null}, "macro.fivetran_utils.default__source_relation": {"name": "default__source_relation", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/source_relation.sql", "original_file_path": "macros/source_relation.sql", "unique_id": "macro.fivetran_utils.default__source_relation", "macro_sql": "{% macro default__source_relation(union_schema_variable, union_database_variable) %}\n\n{% if var(union_schema_variable, none) %}\n, case\n {% for schema in var(union_schema_variable) %}\n when lower(replace(replace(_dbt_source_relation,'\"',''),'`','')) like '%.{{ schema|lower }}.%' then '{{ schema|lower }}'\n {% endfor %}\n end as source_relation\n{% elif var(union_database_variable, none) %}\n, case\n {% for database in var(union_database_variable) %}\n when lower(replace(replace(_dbt_source_relation,'\"',''),'`','')) like '%{{ database|lower }}.%' then '{{ database|lower }}'\n {% endfor %}\n end as source_relation\n{% else %}\n, cast('' as {{ dbt.type_string() }}) as source_relation\n{% endif %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "union_schema_variable", "type": null, "description": ""}, {"name": "union_database_variable", "type": null, "description": ""}], "created_at": 1789079002.653778, "supported_languages": null}, "macro.fivetran_utils.apply_source_relation": {"name": "apply_source_relation", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/apply_source_relation.sql", "original_file_path": "macros/apply_source_relation.sql", "unique_id": "macro.fivetran_utils.apply_source_relation", "macro_sql": "{% macro apply_source_relation(package_name, use_package_prefix=true) -%}\n\n{{ adapter.dispatch('apply_source_relation', 'fivetran_utils') (package_name, use_package_prefix) }}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.default__apply_source_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "package_name", "type": null, "description": ""}, {"name": "use_package_prefix", "type": null, "description": ""}], "created_at": 1789079002.6542802, "supported_languages": null}, "macro.fivetran_utils.default__apply_source_relation": {"name": "default__apply_source_relation", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/apply_source_relation.sql", "original_file_path": "macros/apply_source_relation.sql", "unique_id": "macro.fivetran_utils.default__apply_source_relation", "macro_sql": "{% macro default__apply_source_relation(package_name, use_package_prefix=true) -%}\n\n{% set sources_var = package_name ~ '_sources' %}\n{% set database_var = package_name ~ '_database' %}\n{% set schema_var = package_name ~ '_schema' %}\n\n{% if use_package_prefix %}\n {% set union_schemas_var = package_name ~ '_union_schemas' %}\n {% set union_databases_var = package_name ~ '_union_databases' %}\n{% else %}\n {% set union_schemas_var = 'union_schemas' %}\n {% set union_databases_var = 'union_databases' %}\n{% endif %}\n\n{% if var(sources_var, []) | length > 0 %}\n, _dbt_source_relation as source_relation\n{% elif var(union_schemas_var, []) | length > 0 or var(union_databases_var, []) | length > 0 %}\n{{ fivetran_utils.source_relation(union_schema_variable=union_schemas_var, union_database_variable=union_databases_var) }}\n{% else %}\n{% set database = var(database_var, target.database) %}\n{% set schema = var(schema_var, package_name) %}\n, cast('{{ database ~ \".\" ~ schema }}' as {{ dbt.type_string() }}) as source_relation\n{% endif %}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.source_relation", "macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "package_name", "type": null, "description": ""}, {"name": "use_package_prefix", "type": null, "description": ""}], "created_at": 1789079002.655495, "supported_languages": null}, "macro.fivetran_utils.calculated_fields": {"name": "calculated_fields", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/calculated_fields.sql", "original_file_path": "macros/calculated_fields.sql", "unique_id": "macro.fivetran_utils.calculated_fields", "macro_sql": "{% macro calculated_fields(variable) -%}\n\n{% if var(variable, none) %}\n {% for field in var(variable) %}\n , {{ field.transform_sql }} as {{ field.name }} \n {% endfor %}\n{% endif %}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "variable", "type": null, "description": ""}], "created_at": 1789079002.6559367, "supported_languages": null}, "macro.fivetran_utils.union_data": {"name": "union_data", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/union_data.sql", "original_file_path": "macros/union_data.sql", "unique_id": "macro.fivetran_utils.union_data", "macro_sql": "{%- macro union_data(table_identifier, database_variable, schema_variable, default_database, default_schema, default_variable, union_schema_variable='union_schemas', union_database_variable='union_databases') -%}\n\n{{ adapter.dispatch('union_data', 'fivetran_utils') (\n table_identifier, \n database_variable, \n schema_variable, \n default_database, \n default_schema, \n default_variable,\n union_schema_variable,\n union_database_variable\n ) }}\n\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.fivetran_utils.default__union_data"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "table_identifier", "type": null, "description": ""}, {"name": "database_variable", "type": null, "description": ""}, {"name": "schema_variable", "type": null, "description": ""}, {"name": "default_database", "type": null, "description": ""}, {"name": "default_schema", "type": null, "description": ""}, {"name": "default_variable", "type": null, "description": ""}, {"name": "union_schema_variable", "type": null, "description": ""}, {"name": "union_database_variable", "type": null, "description": ""}], "created_at": 1789079002.6572013, "supported_languages": null}, "macro.fivetran_utils.default__union_data": {"name": "default__union_data", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/union_data.sql", "original_file_path": "macros/union_data.sql", "unique_id": "macro.fivetran_utils.default__union_data", "macro_sql": "{%- macro default__union_data(\n table_identifier, \n database_variable, \n schema_variable, \n default_database, \n default_schema, \n default_variable,\n union_schema_variable,\n union_database_variable\n ) -%}\n\n{%- if var(union_schema_variable, none) -%}\n\n {%- set relations = [] -%}\n \n {%- if var(union_schema_variable) is string -%}\n {%- set trimmed = var(union_schema_variable)|trim('[')|trim(']') -%}\n {%- set schemas = trimmed.split(',')|map('trim',\" \")|map('trim','\"')|map('trim',\"'\") -%}\n {%- else -%}\n {%- set schemas = var(union_schema_variable) -%}\n {%- endif -%}\n\n {%- for schema in var(union_schema_variable) -%}\n {%- set relation=adapter.get_relation(\n database=source(schema, table_identifier).database if var('has_defined_sources', false) else var(database_variable, default_database),\n schema=source(schema, table_identifier).schema if var('has_defined_sources', false) else schema,\n identifier=source(schema, table_identifier).identifier if var('has_defined_sources', false) else table_identifier\n ) -%}\n \n {%- set relation_exists=relation is not none -%}\n\n {%- if relation_exists -%}\n {%- do relations.append(relation) -%}\n {%- endif -%}\n\n {%- endfor -%}\n \n {%- if relations != [] -%}\n {{ dbt_utils.union_relations(relations) }}\n {%- else -%}\n {% if execute and not var('fivetran__remove_empty_table_warnings', false) -%}\n {{ exceptions.warn(\"\\n\\nPlease be aware: The \" ~ table_identifier|upper ~ \" table was not found in your \" ~ default_schema|upper ~ \" schema(s). The Fivetran dbt package will create a completely empty \" ~ table_identifier|upper ~ \" staging model as to not break downstream transformations. To turn off these warnings, set the `fivetran__remove_empty_table_warnings` variable to TRUE (see https://github.com/fivetran/dbt_fivetran_utils/tree/releases/v0.4.latest#union_data-source for details).\\n\") }}\n {% endif -%}\n select \n cast(null as {{ dbt.type_string() }}) as _dbt_source_relation\n limit 0\n {%- endif -%}\n\n{%- elif var(union_database_variable, none) -%}\n\n {%- set relations = [] -%}\n\n {%- for database in var(union_database_variable) -%}\n {%- set relation=adapter.get_relation(\n database=source(schema, table_identifier).database if var('has_defined_sources', false) else database,\n schema=source(schema, table_identifier).schema if var('has_defined_sources', false) else var(schema_variable, default_schema),\n identifier=source(schema, table_identifier).identifier if var('has_defined_sources', false) else table_identifier\n ) -%}\n\n {%- set relation_exists=relation is not none -%}\n\n {%- if relation_exists -%}\n {%- do relations.append(relation) -%}\n {%- endif -%}\n\n {%- endfor -%}\n\n {%- if relations != [] -%}\n {{ dbt_utils.union_relations(relations) }}\n {%- else -%}\n {% if execute and not var('fivetran__remove_empty_table_warnings', false) -%}\n {{ exceptions.warn(\"\\n\\nPlease be aware: The \" ~ table_identifier|upper ~ \" table was not found in your \" ~ default_schema|upper ~ \" schema(s). The Fivetran dbt package will create a completely empty \" ~ table_identifier|upper ~ \" staging model as to not break downstream transformations. To turn off these warnings, set the `fivetran__remove_empty_table_warnings` variable to TRUE (see https://github.com/fivetran/dbt_fivetran_utils/tree/releases/v0.4.latest#union_data-source for details).\\n\") }}\n {% endif -%}\n select \n cast(null as {{ dbt.type_string() }}) as _dbt_source_relation\n limit 0\n {%- endif -%}\n\n{%- else -%}\n {% set exception_schemas = {\"linkedin_company_pages\": \"linkedin_pages\", \"instagram_business_pages\": \"instagram_business\"} %}\n {% set relation = namespace(value=\"\") %}\n {% if default_schema in exception_schemas.keys() %}\n {% for corrected_schema_name in exception_schemas.items() %} \n {% if default_schema in corrected_schema_name %}\n {# In order for this macro to effectively work within upstream integration tests (mainly used by the Fivetran dbt package maintainers), this identifier variable selection is required to use the macro with different identifier names. #}\n {% set identifier_var = corrected_schema_name[1] + \"_\" + table_identifier + \"_identifier\" %}\n {%- set relation.value=adapter.get_relation(\n database=source(corrected_schema_name[1], table_identifier).database,\n schema=source(corrected_schema_name[1], table_identifier).schema,\n identifier=var(identifier_var, table_identifier)\n ) -%}\n {% endif %}\n {% endfor %}\n {% else %}\n {# In order for this macro to effectively work within upstream integration tests (mainly used by the Fivetran dbt package maintainers), this identifier variable selection is required to use the macro with different identifier names. #}\n {% set identifier_var = default_schema + \"_\" + table_identifier + \"_identifier\" %}\n {# Unfortunately the Twitter Organic identifiers were misspelled. As such, we will need to account for this in the model. This will be adjusted in the Twitter Organic package, but to ensure backwards compatibility, this needs to be included. #}\n {% if var(identifier_var, none) is none %} \n {% set identifier_var = default_schema + \"_\" + table_identifier + \"_identifer\" %}\n {% endif %}\n {%- set relation.value=adapter.get_relation(\n database=source(default_schema, table_identifier).database,\n schema=source(default_schema, table_identifier).schema,\n identifier=var(identifier_var, table_identifier)\n ) -%}\n {% endif %}\n{%- set table_exists=relation.value is not none -%}\n\n{%- if table_exists -%}\n select * \n from {{ relation.value }}\n{%- else -%}\n {% if execute and not var('fivetran__remove_empty_table_warnings', false) -%}\n {{ exceptions.warn(\"\\n\\nPlease be aware: The \" ~ table_identifier|upper ~ \" table was not found in your \" ~ default_schema|upper ~ \" schema(s). The Fivetran dbt package will create a completely empty \" ~ table_identifier|upper ~ \" staging model as to not break downstream transformations. To turn off these warnings, set the `fivetran__remove_empty_table_warnings` variable to TRUE (see https://github.com/fivetran/dbt_fivetran_utils/tree/releases/v0.4.latest#union_data-source for details).\\n\") }}\n {% endif -%}\n select \n cast(null as {{ dbt.type_string() }}) as _dbt_source_relation\n limit 0\n{%- endif -%}\n{%- endif -%}\n\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt_utils.union_relations", "macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "table_identifier", "type": null, "description": ""}, {"name": "database_variable", "type": null, "description": ""}, {"name": "schema_variable", "type": null, "description": ""}, {"name": "default_database", "type": null, "description": ""}, {"name": "default_schema", "type": null, "description": ""}, {"name": "default_variable", "type": null, "description": ""}, {"name": "union_schema_variable", "type": null, "description": ""}, {"name": "union_database_variable", "type": null, "description": ""}], "created_at": 1789079002.6621914, "supported_languages": null}, "macro.fivetran_utils.pivot_json_extract": {"name": "pivot_json_extract", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/pivot_json_extract.sql", "original_file_path": "macros/pivot_json_extract.sql", "unique_id": "macro.fivetran_utils.pivot_json_extract", "macro_sql": "{% macro pivot_json_extract(string, list_of_properties) %}\n\n{%- for property in list_of_properties -%}\n{%- if property is mapping -%}\nreplace( {{ fivetran_utils.json_extract(string, property.name) }}, '\"', '') as {{ property.alias if property.alias else property.name | replace(' ', '_') | replace('.', '_') | lower }}\n\n{%- else -%}\nreplace( {{ fivetran_utils.json_extract(string, property) }}, '\"', '') as {{ property | replace(' ', '_') | lower }}\n\n{%- endif -%}\n{%- if not loop.last -%},{%- endif %}\n{% endfor -%}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.json_extract"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "string", "type": null, "description": ""}, {"name": "list_of_properties", "type": null, "description": ""}], "created_at": 1789079002.6630838, "supported_languages": null}, "macro.fivetran_utils.add_dbt_source_relation": {"name": "add_dbt_source_relation", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/add_dbt_source_relation.sql", "original_file_path": "macros/add_dbt_source_relation.sql", "unique_id": "macro.fivetran_utils.add_dbt_source_relation", "macro_sql": "{% macro add_dbt_source_relation() %}\n\n{% if var('union_schemas', none) or var('union_databases', none) %}\n, _dbt_source_relation\n{% endif %}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789079002.6633952, "supported_languages": null}, "macro.fivetran_utils.array_agg": {"name": "array_agg", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/array_agg.sql", "original_file_path": "macros/array_agg.sql", "unique_id": "macro.fivetran_utils.array_agg", "macro_sql": "{% macro array_agg(field_to_agg) -%}\n\n{{ adapter.dispatch('array_agg', 'fivetran_utils') (field_to_agg) }}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.default__array_agg"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field_to_agg", "type": null, "description": ""}], "created_at": 1789079002.6636777, "supported_languages": null}, "macro.fivetran_utils.default__array_agg": {"name": "default__array_agg", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/array_agg.sql", "original_file_path": "macros/array_agg.sql", "unique_id": "macro.fivetran_utils.default__array_agg", "macro_sql": "{% macro default__array_agg(field_to_agg) %}\n array_agg({{ field_to_agg }})\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field_to_agg", "type": null, "description": ""}], "created_at": 1789079002.6638064, "supported_languages": null}, "macro.fivetran_utils.redshift__array_agg": {"name": "redshift__array_agg", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/array_agg.sql", "original_file_path": "macros/array_agg.sql", "unique_id": "macro.fivetran_utils.redshift__array_agg", "macro_sql": "{% macro redshift__array_agg(field_to_agg) %}\n listagg({{ field_to_agg }}, ',')\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field_to_agg", "type": null, "description": ""}], "created_at": 1789079002.6639533, "supported_languages": null}, "macro.fivetran_utils.collect_freshness": {"name": "collect_freshness", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/collect_freshness.sql", "original_file_path": "macros/collect_freshness.sql", "unique_id": "macro.fivetran_utils.collect_freshness", "macro_sql": "{% macro collect_freshness(source, loaded_at_field, filter) %}\n {{ return(adapter.dispatch('collect_freshness')(source, loaded_at_field, filter))}}\n{% endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.default__collect_freshness"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "source", "type": null, "description": ""}, {"name": "loaded_at_field", "type": null, "description": ""}, {"name": "filter", "type": null, "description": ""}], "created_at": 1789079002.664469, "supported_languages": null}, "macro.fivetran_utils.default__collect_freshness": {"name": "default__collect_freshness", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/collect_freshness.sql", "original_file_path": "macros/collect_freshness.sql", "unique_id": "macro.fivetran_utils.default__collect_freshness", "macro_sql": "{% macro default__collect_freshness(source, loaded_at_field, filter) %}\n {% call statement('collect_freshness', fetch_result=True, auto_begin=False) -%}\n\n {%- set enabled_array = [] -%}\n {% for node in graph.sources.values() %}\n {% if node.identifier == source.identifier %}\n {% if (node.meta['is_enabled'] | default(true)) %}\n {%- do enabled_array.append(1) -%}\n {% endif %}\n {% endif %}\n {% endfor %}\n {% set is_enabled = (enabled_array != []) %}\n\n select\n {% if is_enabled %}\n max({{ loaded_at_field }})\n {% else %} \n {{ current_timestamp() }} {% endif %} as max_loaded_at,\n {{ current_timestamp() }} as snapshotted_at\n\n {% if is_enabled %}\n from {{ source }}\n {% if filter %}\n where {{ filter }}\n {% endif %}\n {% endif %}\n\n {% endcall %}\n\n {% if dbt_version.split('.') | map('int') | list >= [1, 5, 0] %}\n {{ return(load_result('collect_freshness')) }}\n {% else %}\n {{ return(load_result('collect_freshness').table) }}\n {% endif %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement", "macro.dbt.current_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "source", "type": null, "description": ""}, {"name": "loaded_at_field", "type": null, "description": ""}, {"name": "filter", "type": null, "description": ""}], "created_at": 1789079002.6658003, "supported_languages": null}, "macro.fivetran_utils.first_value": {"name": "first_value", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/first_value.sql", "original_file_path": "macros/first_value.sql", "unique_id": "macro.fivetran_utils.first_value", "macro_sql": "{% macro first_value(first_value_field, partition_field, order_by_field, order=\"asc\") -%}\n\n{{ adapter.dispatch('first_value', 'fivetran_utils') (first_value_field, partition_field, order_by_field, order) }}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.default__first_value"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "first_value_field", "type": null, "description": ""}, {"name": "partition_field", "type": null, "description": ""}, {"name": "order_by_field", "type": null, "description": ""}, {"name": "order", "type": null, "description": ""}], "created_at": 1789079002.666261, "supported_languages": null}, "macro.fivetran_utils.default__first_value": {"name": "default__first_value", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/first_value.sql", "original_file_path": "macros/first_value.sql", "unique_id": "macro.fivetran_utils.default__first_value", "macro_sql": "{% macro default__first_value(first_value_field, partition_field, order_by_field, order=\"asc\") %}\n\n first_value( {{ first_value_field }} ignore nulls ) over (partition by {{ partition_field }} order by {{ order_by_field }} {{ order }} )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "first_value_field", "type": null, "description": ""}, {"name": "partition_field", "type": null, "description": ""}, {"name": "order_by_field", "type": null, "description": ""}, {"name": "order", "type": null, "description": ""}], "created_at": 1789079002.6664991, "supported_languages": null}, "macro.fivetran_utils.redshift__first_value": {"name": "redshift__first_value", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/first_value.sql", "original_file_path": "macros/first_value.sql", "unique_id": "macro.fivetran_utils.redshift__first_value", "macro_sql": "{% macro redshift__first_value(first_value_field, partition_field, order_by_field, order=\"asc\") %}\n\n first_value( {{ first_value_field }} ignore nulls ) over (partition by {{ partition_field }} order by {{ order_by_field }} {{ order }} , {{ partition_field }} rows unbounded preceding )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "first_value_field", "type": null, "description": ""}, {"name": "partition_field", "type": null, "description": ""}, {"name": "order_by_field", "type": null, "description": ""}, {"name": "order", "type": null, "description": ""}], "created_at": 1789079002.6667573, "supported_languages": null}, "macro.fivetran_utils.union_relations": {"name": "union_relations", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/union_relations.sql", "original_file_path": "macros/union_relations.sql", "unique_id": "macro.fivetran_utils.union_relations", "macro_sql": "{%- macro union_relations(relations, aliases=none, column_override=none, include=[], exclude=[], source_column_name=none) -%}\n\n {%- if exclude and include -%}\n {{ exceptions.raise_compiler_error(\"Both an exclude and include list were provided to the `union` macro. Only one is allowed\") }}\n {%- endif -%}\n\n {#-- Prevent querying of db in parsing mode. This works because this macro does not create any new refs. -#}\n {%- if not execute %}\n {{ return('') }}\n {% endif -%}\n\n {%- set column_override = column_override if column_override is not none else {} -%}\n {%- set source_column_name = source_column_name if source_column_name is not none else '_dbt_source_relation' -%}\n\n {%- set relation_columns = {} -%}\n {%- set column_superset = {} -%}\n\n {%- for relation in relations -%}\n\n {%- do relation_columns.update({relation: []}) -%}\n\n {%- do dbt_utils._is_relation(relation, 'union_relations') -%}\n {%- set cols = adapter.get_columns_in_relation(relation) -%}\n {%- for col in cols -%}\n\n {#- If an exclude list was provided and the column is in the list, do nothing -#}\n {%- if exclude and col.column in exclude -%}\n\n {#- If an include list was provided and the column is not in the list, do nothing -#}\n {%- elif include and col.column not in include -%}\n\n {#- Otherwise add the column to the column superset -#}\n {%- else -%}\n\n {#- update the list of columns in this relation -#}\n {%- do relation_columns[relation].append(col.column) -%}\n\n {%- if col.column in column_superset -%}\n\n {%- set stored = column_superset[col.column] -%}\n {%- if col.is_string() and stored.is_string() and col.string_size() > stored.string_size() -%}\n\n {%- do column_superset.update({col.column: col}) -%}\n\n {%- endif %}\n\n {%- else -%}\n\n {%- do column_superset.update({col.column: col}) -%}\n\n {%- endif -%}\n\n {%- endif -%}\n\n {%- endfor -%}\n {%- endfor -%}\n\n {%- set ordered_column_names = column_superset.keys() -%}\n\n {%- for relation in relations %}\n\n (\n select\n\n cast({{ dbt.string_literal(relation) }} as {{ dbt.type_string() }}) as {{ source_column_name }},\n {% for col_name in ordered_column_names -%}\n\n {%- set col = column_superset[col_name] %}\n {%- set col_type = column_override.get(col.column, col.data_type) %}\n {%- set col_name = adapter.quote(col_name) if col_name in relation_columns[relation] else 'null' %}\n cast({{ col_name }} as {{ col_type }}) as {{ col.quoted }} {% if not loop.last %},{% endif -%}\n\n {%- endfor %}\n\n from {{ aliases[loop.index0] if aliases else relation }}\n )\n\n {% if not loop.last -%}\n union all\n {% endif -%}\n\n {%- endfor -%}\n\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt_utils._is_relation", "macro.dbt.string_literal", "macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relations", "type": null, "description": ""}, {"name": "aliases", "type": null, "description": ""}, {"name": "column_override", "type": null, "description": ""}, {"name": "include", "type": null, "description": ""}, {"name": "exclude", "type": null, "description": ""}, {"name": "source_column_name", "type": null, "description": ""}], "created_at": 1789079002.669988, "supported_languages": null}, "macro.fivetran_utils.union_tables": {"name": "union_tables", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/union_relations.sql", "original_file_path": "macros/union_relations.sql", "unique_id": "macro.fivetran_utils.union_tables", "macro_sql": "{%- macro union_tables(tables, column_override=none, include=[], exclude=[], source_column_name='_dbt_source_table') -%}\n\n {%- do exceptions.warn(\"Warning: the `union_tables` macro is no longer supported and will be deprecated in a future release of dbt-utils. Use the `union_relations` macro instead\") -%}\n\n {{ return(dbt_utils.union_relations(tables, column_override, include, exclude, source_column_name)) }}\n\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt_utils.union_relations"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "tables", "type": null, "description": ""}, {"name": "column_override", "type": null, "description": ""}, {"name": "include", "type": null, "description": ""}, {"name": "exclude", "type": null, "description": ""}, {"name": "source_column_name", "type": null, "description": ""}], "created_at": 1789079002.670405, "supported_languages": null}, "macro.fivetran_utils.timestamp_diff": {"name": "timestamp_diff", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/timestamp_diff.sql", "original_file_path": "macros/timestamp_diff.sql", "unique_id": "macro.fivetran_utils.timestamp_diff", "macro_sql": "{% macro timestamp_diff(first_date, second_date, datepart) %}\n {{ adapter.dispatch('timestamp_diff', 'fivetran_utils')(first_date, second_date, datepart) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.postgres__timestamp_diff"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "first_date", "type": null, "description": ""}, {"name": "second_date", "type": null, "description": ""}, {"name": "datepart", "type": null, "description": ""}], "created_at": 1789079002.67127, "supported_languages": null}, "macro.fivetran_utils.default__timestamp_diff": {"name": "default__timestamp_diff", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/timestamp_diff.sql", "original_file_path": "macros/timestamp_diff.sql", "unique_id": "macro.fivetran_utils.default__timestamp_diff", "macro_sql": "{% macro default__timestamp_diff(first_date, second_date, datepart) %}\n\n datediff(\n {{ datepart }},\n {{ first_date }},\n {{ second_date }}\n )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "first_date", "type": null, "description": ""}, {"name": "second_date", "type": null, "description": ""}, {"name": "datepart", "type": null, "description": ""}], "created_at": 1789079002.6714733, "supported_languages": null}, "macro.fivetran_utils.redshift__timestamp_diff": {"name": "redshift__timestamp_diff", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/timestamp_diff.sql", "original_file_path": "macros/timestamp_diff.sql", "unique_id": "macro.fivetran_utils.redshift__timestamp_diff", "macro_sql": "{% macro redshift__timestamp_diff(first_date, second_date, datepart) %}\n\n datediff(\n {{ datepart }},\n {{ first_date }},\n {{ second_date }}\n )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "first_date", "type": null, "description": ""}, {"name": "second_date", "type": null, "description": ""}, {"name": "datepart", "type": null, "description": ""}], "created_at": 1789079002.6716733, "supported_languages": null}, "macro.fivetran_utils.bigquery__timestamp_diff": {"name": "bigquery__timestamp_diff", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/timestamp_diff.sql", "original_file_path": "macros/timestamp_diff.sql", "unique_id": "macro.fivetran_utils.bigquery__timestamp_diff", "macro_sql": "{% macro bigquery__timestamp_diff(first_date, second_date, datepart) %}\n\n timestamp_diff(\n {{second_date}},\n {{first_date}},\n {{datepart}}\n )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "first_date", "type": null, "description": ""}, {"name": "second_date", "type": null, "description": ""}, {"name": "datepart", "type": null, "description": ""}], "created_at": 1789079002.671876, "supported_languages": null}, "macro.fivetran_utils.postgres__timestamp_diff": {"name": "postgres__timestamp_diff", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/timestamp_diff.sql", "original_file_path": "macros/timestamp_diff.sql", "unique_id": "macro.fivetran_utils.postgres__timestamp_diff", "macro_sql": "{% macro postgres__timestamp_diff(first_date, second_date, datepart) %}\n\n {% if datepart == 'year' %}\n (date_part('year', ({{second_date}})::date) - date_part('year', ({{first_date}})::date))\n {% elif datepart == 'quarter' %}\n ({{ dbt.datediff(first_date, second_date, 'year') }} * 4 + date_part('quarter', ({{second_date}})::date) - date_part('quarter', ({{first_date}})::date))\n {% elif datepart == 'month' %}\n ({{ dbt.datediff(first_date, second_date, 'year') }} * 12 + date_part('month', ({{second_date}})::date) - date_part('month', ({{first_date}})::date))\n {% elif datepart == 'day' %}\n (({{second_date}})::date - ({{first_date}})::date)\n {% elif datepart == 'week' %}\n ({{ dbt.datediff(first_date, second_date, 'day') }} / 7 + case\n when date_part('dow', ({{first_date}})::timestamp) <= date_part('dow', ({{second_date}})::timestamp) then\n case when {{first_date}} <= {{second_date}} then 0 else -1 end\n else\n case when {{first_date}} <= {{second_date}} then 1 else 0 end\n end)\n {% elif datepart == 'hour' %}\n ({{ dbt.datediff(first_date, second_date, 'day') }} * 24 + date_part('hour', ({{second_date}})::timestamp) - date_part('hour', ({{first_date}})::timestamp))\n {% elif datepart == 'minute' %}\n ({{ dbt.datediff(first_date, second_date, 'hour') }} * 60 + date_part('minute', ({{second_date}})::timestamp) - date_part('minute', ({{first_date}})::timestamp))\n {% elif datepart == 'second' %}\n ({{ dbt.datediff(first_date, second_date, 'minute') }} * 60 + floor(date_part('second', ({{second_date}})::timestamp)) - floor(date_part('second', ({{first_date}})::timestamp)))\n {% elif datepart == 'millisecond' %}\n ({{ dbt.datediff(first_date, second_date, 'minute') }} * 60000 + floor(date_part('millisecond', ({{second_date}})::timestamp)) - floor(date_part('millisecond', ({{first_date}})::timestamp)))\n {% elif datepart == 'microsecond' %}\n ({{ dbt.datediff(first_date, second_date, 'minute') }} * 60000000 + floor(date_part('microsecond', ({{second_date}})::timestamp)) - floor(date_part('microsecond', ({{first_date}})::timestamp)))\n {% else %}\n {{ exceptions.raise_compiler_error(\"Unsupported datepart for macro datediff in postgres: {!r}\".format(datepart)) }}\n {% endif %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.datediff"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "first_date", "type": null, "description": ""}, {"name": "second_date", "type": null, "description": ""}, {"name": "datepart", "type": null, "description": ""}], "created_at": 1789079002.6736941, "supported_languages": null}, "macro.fivetran_utils.duckdb__timestamp_diff": {"name": "duckdb__timestamp_diff", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/timestamp_diff.sql", "original_file_path": "macros/timestamp_diff.sql", "unique_id": "macro.fivetran_utils.duckdb__timestamp_diff", "macro_sql": "{% macro duckdb__timestamp_diff(first_date, second_date, datepart) %}\n\n datediff('{{ datepart }}', {{ first_date }}, {{ second_date }})\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "first_date", "type": null, "description": ""}, {"name": "second_date", "type": null, "description": ""}, {"name": "datepart", "type": null, "description": ""}], "created_at": 1789079002.6739137, "supported_languages": null}, "macro.fivetran_utils.add_pass_through_columns": {"name": "add_pass_through_columns", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/add_pass_through_columns.sql", "original_file_path": "macros/add_pass_through_columns.sql", "unique_id": "macro.fivetran_utils.add_pass_through_columns", "macro_sql": "{% macro add_pass_through_columns(base_columns, pass_through_var) %}\n\n {% if pass_through_var %}\n\n {% for column in pass_through_var %}\n\n {% if column is mapping %}\n\n {% if column.alias %}\n\n {% do base_columns.append({ \"name\": column.name, \"alias\": column.alias, \"datatype\": column.datatype if column.datatype else dbt.type_string()}) %}\n\n {% else %}\n\n {% do base_columns.append({ \"name\": column.name, \"datatype\": column.datatype if column.datatype else dbt.type_string()}) %}\n \n {% endif %}\n\n {% else %}\n\n {% do base_columns.append({ \"name\": column, \"datatype\": dbt.type_string()}) %}\n\n {% endif %}\n\n {% endfor %}\n\n {% endif %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "base_columns", "type": null, "description": ""}, {"name": "pass_through_var", "type": null, "description": ""}], "created_at": 1789079002.6750205, "supported_languages": null}, "macro.fivetran_utils.timestamp_add": {"name": "timestamp_add", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/timestamp_add.sql", "original_file_path": "macros/timestamp_add.sql", "unique_id": "macro.fivetran_utils.timestamp_add", "macro_sql": "{% macro timestamp_add(datepart, interval, from_timestamp) -%}\n\n{{ adapter.dispatch('timestamp_add', 'fivetran_utils') (datepart, interval, from_timestamp) }}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.postgres__timestamp_add"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "datepart", "type": null, "description": ""}, {"name": "interval", "type": null, "description": ""}, {"name": "from_timestamp", "type": null, "description": ""}], "created_at": 1789079002.6755133, "supported_languages": null}, "macro.fivetran_utils.default__timestamp_add": {"name": "default__timestamp_add", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/timestamp_add.sql", "original_file_path": "macros/timestamp_add.sql", "unique_id": "macro.fivetran_utils.default__timestamp_add", "macro_sql": "{% macro default__timestamp_add(datepart, interval, from_timestamp) %}\n\n timestampadd(\n {{ datepart }},\n {{ interval }},\n {{ from_timestamp }}\n )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "datepart", "type": null, "description": ""}, {"name": "interval", "type": null, "description": ""}, {"name": "from_timestamp", "type": null, "description": ""}], "created_at": 1789079002.6757073, "supported_languages": null}, "macro.fivetran_utils.bigquery__timestamp_add": {"name": "bigquery__timestamp_add", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/timestamp_add.sql", "original_file_path": "macros/timestamp_add.sql", "unique_id": "macro.fivetran_utils.bigquery__timestamp_add", "macro_sql": "{% macro bigquery__timestamp_add(datepart, interval, from_timestamp) %}\n\n timestamp_add({{ from_timestamp }}, interval {{ interval }} {{ datepart }})\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "datepart", "type": null, "description": ""}, {"name": "interval", "type": null, "description": ""}, {"name": "from_timestamp", "type": null, "description": ""}], "created_at": 1789079002.6759095, "supported_languages": null}, "macro.fivetran_utils.redshift__timestamp_add": {"name": "redshift__timestamp_add", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/timestamp_add.sql", "original_file_path": "macros/timestamp_add.sql", "unique_id": "macro.fivetran_utils.redshift__timestamp_add", "macro_sql": "{% macro redshift__timestamp_add(datepart, interval, from_timestamp) %}\n\n dateadd(\n {{ datepart }},\n {{ interval }},\n {{ from_timestamp }}\n )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "datepart", "type": null, "description": ""}, {"name": "interval", "type": null, "description": ""}, {"name": "from_timestamp", "type": null, "description": ""}], "created_at": 1789079002.6760979, "supported_languages": null}, "macro.fivetran_utils.postgres__timestamp_add": {"name": "postgres__timestamp_add", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/timestamp_add.sql", "original_file_path": "macros/timestamp_add.sql", "unique_id": "macro.fivetran_utils.postgres__timestamp_add", "macro_sql": "{% macro postgres__timestamp_add(datepart, interval, from_timestamp) %}\n\n {{ from_timestamp }} + ((interval '1 {{ datepart }}') * ({{ interval }}))\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "datepart", "type": null, "description": ""}, {"name": "interval", "type": null, "description": ""}, {"name": "from_timestamp", "type": null, "description": ""}], "created_at": 1789079002.6762831, "supported_languages": null}, "macro.fivetran_utils.spark__timestamp_add": {"name": "spark__timestamp_add", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/timestamp_add.sql", "original_file_path": "macros/timestamp_add.sql", "unique_id": "macro.fivetran_utils.spark__timestamp_add", "macro_sql": "{% macro spark__timestamp_add(datepart, interval, from_timestamp) %}\n\n {{ dbt.dateadd(datepart, interval, from_timestamp) }}\n \n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.dateadd"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "datepart", "type": null, "description": ""}, {"name": "interval", "type": null, "description": ""}, {"name": "from_timestamp", "type": null, "description": ""}], "created_at": 1789079002.6764884, "supported_languages": null}, "macro.fivetran_utils.duckdb__timestamp_add": {"name": "duckdb__timestamp_add", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/timestamp_add.sql", "original_file_path": "macros/timestamp_add.sql", "unique_id": "macro.fivetran_utils.duckdb__timestamp_add", "macro_sql": "{% macro duckdb__timestamp_add(datepart, interval, from_timestamp) %}\n\n {{ from_timestamp }} + ((interval '1 {{ datepart }}') * ({{ interval }}))\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "datepart", "type": null, "description": ""}, {"name": "interval", "type": null, "description": ""}, {"name": "from_timestamp", "type": null, "description": ""}], "created_at": 1789079002.676744, "supported_languages": null}, "macro.fivetran_utils.enabled_vars": {"name": "enabled_vars", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/enabled_vars.sql", "original_file_path": "macros/enabled_vars.sql", "unique_id": "macro.fivetran_utils.enabled_vars", "macro_sql": "{% macro enabled_vars(vars) %}\n\n{% for v in vars %}\n \n {% if var(v, True) == False %}\n {{ return(False) }}\n {% endif %}\n\n{% endfor %}\n\n{{ return(True) }}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "vars", "type": null, "description": ""}], "created_at": 1789079002.6772094, "supported_languages": null}, "macro.fivetran_utils.wrap_in_quotes": {"name": "wrap_in_quotes", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/wrap_in_quotes.sql", "original_file_path": "macros/wrap_in_quotes.sql", "unique_id": "macro.fivetran_utils.wrap_in_quotes", "macro_sql": "{%- macro wrap_in_quotes(object_to_quote) -%}\n\n{{ return(adapter.dispatch('wrap_in_quotes', 'fivetran_utils')(object_to_quote)) }}\n\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.fivetran_utils.postgres__wrap_in_quotes"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "object_to_quote", "type": null, "description": ""}], "created_at": 1789079002.6775901, "supported_languages": null}, "macro.fivetran_utils.default__wrap_in_quotes": {"name": "default__wrap_in_quotes", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/wrap_in_quotes.sql", "original_file_path": "macros/wrap_in_quotes.sql", "unique_id": "macro.fivetran_utils.default__wrap_in_quotes", "macro_sql": "{%- macro default__wrap_in_quotes(object_to_quote) -%}\n{# bigquery, spark, databricks #}\n `{{ object_to_quote }}`\n{%- endmacro -%}\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "object_to_quote", "type": null, "description": ""}], "created_at": 1789079002.677725, "supported_languages": null}, "macro.fivetran_utils.snowflake__wrap_in_quotes": {"name": "snowflake__wrap_in_quotes", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/wrap_in_quotes.sql", "original_file_path": "macros/wrap_in_quotes.sql", "unique_id": "macro.fivetran_utils.snowflake__wrap_in_quotes", "macro_sql": "{%- macro snowflake__wrap_in_quotes(object_to_quote) -%}\n \"{{ object_to_quote | upper }}\"\n{%- endmacro -%}\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "object_to_quote", "type": null, "description": ""}], "created_at": 1789079002.6778789, "supported_languages": null}, "macro.fivetran_utils.redshift__wrap_in_quotes": {"name": "redshift__wrap_in_quotes", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/wrap_in_quotes.sql", "original_file_path": "macros/wrap_in_quotes.sql", "unique_id": "macro.fivetran_utils.redshift__wrap_in_quotes", "macro_sql": "{%- macro redshift__wrap_in_quotes(object_to_quote) -%}\n \"{{ object_to_quote }}\"\n{%- endmacro -%}\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "object_to_quote", "type": null, "description": ""}], "created_at": 1789079002.6780076, "supported_languages": null}, "macro.fivetran_utils.postgres__wrap_in_quotes": {"name": "postgres__wrap_in_quotes", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/wrap_in_quotes.sql", "original_file_path": "macros/wrap_in_quotes.sql", "unique_id": "macro.fivetran_utils.postgres__wrap_in_quotes", "macro_sql": "{%- macro postgres__wrap_in_quotes(object_to_quote) -%}\n \"{{ object_to_quote }}\"\n{%- endmacro -%}\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "object_to_quote", "type": null, "description": ""}], "created_at": 1789079002.6781273, "supported_languages": null}, "macro.fivetran_utils.duckdb__wrap_in_quotes": {"name": "duckdb__wrap_in_quotes", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/wrap_in_quotes.sql", "original_file_path": "macros/wrap_in_quotes.sql", "unique_id": "macro.fivetran_utils.duckdb__wrap_in_quotes", "macro_sql": "{%- macro duckdb__wrap_in_quotes(object_to_quote) -%}\n \"{{ object_to_quote }}\"\n{%- endmacro -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "object_to_quote", "type": null, "description": ""}], "created_at": 1789079002.6782448, "supported_languages": null}, "macro.fivetran_utils.json_extract": {"name": "json_extract", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/json_extract.sql", "original_file_path": "macros/json_extract.sql", "unique_id": "macro.fivetran_utils.json_extract", "macro_sql": "{% macro json_extract(string, string_path) -%}\n\n{{ adapter.dispatch('json_extract', 'fivetran_utils') (string, string_path) }}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.postgres__json_extract"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "string", "type": null, "description": ""}, {"name": "string_path", "type": null, "description": ""}], "created_at": 1789079002.6786852, "supported_languages": null}, "macro.fivetran_utils.default__json_extract": {"name": "default__json_extract", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/json_extract.sql", "original_file_path": "macros/json_extract.sql", "unique_id": "macro.fivetran_utils.default__json_extract", "macro_sql": "{% macro default__json_extract(string, string_path) %}\n\n json_extract_path_text({{string}}, {{ \"'\" ~ string_path ~ \"'\" }} )\n \n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "string", "type": null, "description": ""}, {"name": "string_path", "type": null, "description": ""}], "created_at": 1789079002.6788843, "supported_languages": null}, "macro.fivetran_utils.snowflake__json_extract": {"name": "snowflake__json_extract", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/json_extract.sql", "original_file_path": "macros/json_extract.sql", "unique_id": "macro.fivetran_utils.snowflake__json_extract", "macro_sql": "{% macro snowflake__json_extract(string, string_path) %}\n\n json_extract_path_text(try_parse_json( {{string}} ), {{ \"'\" ~ string_path ~ \"'\" }} )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "string", "type": null, "description": ""}, {"name": "string_path", "type": null, "description": ""}], "created_at": 1789079002.6790762, "supported_languages": null}, "macro.fivetran_utils.redshift__json_extract": {"name": "redshift__json_extract", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/json_extract.sql", "original_file_path": "macros/json_extract.sql", "unique_id": "macro.fivetran_utils.redshift__json_extract", "macro_sql": "{% macro redshift__json_extract(string, string_path) %}\n\n case when is_valid_json( {{string}} ) then json_extract_path_text({{string}}, {{ \"'\" ~ string_path ~ \"'\" }} ) else null end\n \n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "string", "type": null, "description": ""}, {"name": "string_path", "type": null, "description": ""}], "created_at": 1789079002.6792724, "supported_languages": null}, "macro.fivetran_utils.bigquery__json_extract": {"name": "bigquery__json_extract", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/json_extract.sql", "original_file_path": "macros/json_extract.sql", "unique_id": "macro.fivetran_utils.bigquery__json_extract", "macro_sql": "{% macro bigquery__json_extract(string, string_path) %}\n\n json_extract_scalar({{string}}, {{ \"'$.\" ~ string_path ~ \"'\" }} )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "string", "type": null, "description": ""}, {"name": "string_path", "type": null, "description": ""}], "created_at": 1789079002.6794467, "supported_languages": null}, "macro.fivetran_utils.postgres__json_extract": {"name": "postgres__json_extract", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/json_extract.sql", "original_file_path": "macros/json_extract.sql", "unique_id": "macro.fivetran_utils.postgres__json_extract", "macro_sql": "{% macro postgres__json_extract(string, string_path) %}\n\n {{string}}::json->>{{\"'\" ~ string_path ~ \"'\" }}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "string", "type": null, "description": ""}, {"name": "string_path", "type": null, "description": ""}], "created_at": 1789079002.6796188, "supported_languages": null}, "macro.fivetran_utils.extract_url_parameter": {"name": "extract_url_parameter", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/extract_url_parameter.sql", "original_file_path": "macros/extract_url_parameter.sql", "unique_id": "macro.fivetran_utils.extract_url_parameter", "macro_sql": "{% macro extract_url_parameter(field, url_parameter) -%}\n\n{{ adapter.dispatch('extract_url_parameter', 'fivetran_utils') (field, url_parameter) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.default__extract_url_parameter"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field", "type": null, "description": ""}, {"name": "url_parameter", "type": null, "description": ""}], "created_at": 1789079002.6799707, "supported_languages": null}, "macro.fivetran_utils.default__extract_url_parameter": {"name": "default__extract_url_parameter", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/extract_url_parameter.sql", "original_file_path": "macros/extract_url_parameter.sql", "unique_id": "macro.fivetran_utils.default__extract_url_parameter", "macro_sql": "{% macro default__extract_url_parameter(field, url_parameter) -%}\n\n{{ dbt_utils.get_url_parameter(field, url_parameter) }}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.get_url_parameter"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field", "type": null, "description": ""}, {"name": "url_parameter", "type": null, "description": ""}], "created_at": 1789079002.680214, "supported_languages": null}, "macro.fivetran_utils.spark__extract_url_parameter": {"name": "spark__extract_url_parameter", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/extract_url_parameter.sql", "original_file_path": "macros/extract_url_parameter.sql", "unique_id": "macro.fivetran_utils.spark__extract_url_parameter", "macro_sql": "{% macro spark__extract_url_parameter(field, url_parameter) -%}\n\n{%- set formatted_url_parameter = \"'\" + url_parameter + \"=([^&]+)'\" -%}\nnullif(regexp_extract({{ field }}, {{ formatted_url_parameter }}, 1), '')\n\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field", "type": null, "description": ""}, {"name": "url_parameter", "type": null, "description": ""}], "created_at": 1789079002.6804454, "supported_languages": null}, "macro.fivetran_utils.string_agg": {"name": "string_agg", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/string_agg.sql", "original_file_path": "macros/string_agg.sql", "unique_id": "macro.fivetran_utils.string_agg", "macro_sql": "{% macro string_agg(field_to_agg, delimiter) -%}\n\n{{ adapter.dispatch('string_agg', 'fivetran_utils') (field_to_agg, delimiter) }}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.default__string_agg"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field_to_agg", "type": null, "description": ""}, {"name": "delimiter", "type": null, "description": ""}], "created_at": 1789079002.680818, "supported_languages": null}, "macro.fivetran_utils.default__string_agg": {"name": "default__string_agg", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/string_agg.sql", "original_file_path": "macros/string_agg.sql", "unique_id": "macro.fivetran_utils.default__string_agg", "macro_sql": "{% macro default__string_agg(field_to_agg, delimiter) %}\n string_agg({{ field_to_agg }}, {{ delimiter }})\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field_to_agg", "type": null, "description": ""}, {"name": "delimiter", "type": null, "description": ""}], "created_at": 1789079002.6809967, "supported_languages": null}, "macro.fivetran_utils.snowflake__string_agg": {"name": "snowflake__string_agg", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/string_agg.sql", "original_file_path": "macros/string_agg.sql", "unique_id": "macro.fivetran_utils.snowflake__string_agg", "macro_sql": "{% macro snowflake__string_agg(field_to_agg, delimiter) %}\n listagg({{ field_to_agg }}, {{ delimiter }})\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field_to_agg", "type": null, "description": ""}, {"name": "delimiter", "type": null, "description": ""}], "created_at": 1789079002.681155, "supported_languages": null}, "macro.fivetran_utils.redshift__string_agg": {"name": "redshift__string_agg", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/string_agg.sql", "original_file_path": "macros/string_agg.sql", "unique_id": "macro.fivetran_utils.redshift__string_agg", "macro_sql": "{% macro redshift__string_agg(field_to_agg, delimiter) %}\n listagg({{ field_to_agg }}, {{ delimiter }})\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field_to_agg", "type": null, "description": ""}, {"name": "delimiter", "type": null, "description": ""}], "created_at": 1789079002.681306, "supported_languages": null}, "macro.fivetran_utils.spark__string_agg": {"name": "spark__string_agg", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/string_agg.sql", "original_file_path": "macros/string_agg.sql", "unique_id": "macro.fivetran_utils.spark__string_agg", "macro_sql": "{% macro spark__string_agg(field_to_agg, delimiter) %}\n -- collect set will remove duplicates\n replace(replace(replace(cast( collect_set({{ field_to_agg }}) as string), '[', ''), ']', ''), ', ', {{ delimiter }} )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field_to_agg", "type": null, "description": ""}, {"name": "delimiter", "type": null, "description": ""}], "created_at": 1789079002.6814616, "supported_languages": null}, "macro.fivetran_utils.max_bool": {"name": "max_bool", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/max_bool.sql", "original_file_path": "macros/max_bool.sql", "unique_id": "macro.fivetran_utils.max_bool", "macro_sql": "{% macro max_bool(boolean_field) -%}\n\n{{ adapter.dispatch('max_bool', 'fivetran_utils') (boolean_field) }}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.default__max_bool"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "boolean_field", "type": null, "description": ""}], "created_at": 1789079002.6818273, "supported_languages": null}, "macro.fivetran_utils.default__max_bool": {"name": "default__max_bool", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/max_bool.sql", "original_file_path": "macros/max_bool.sql", "unique_id": "macro.fivetran_utils.default__max_bool", "macro_sql": "{% macro default__max_bool(boolean_field) %}\n\n bool_or( {{ boolean_field }} )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "boolean_field", "type": null, "description": ""}], "created_at": 1789079002.681972, "supported_languages": null}, "macro.fivetran_utils.snowflake__max_bool": {"name": "snowflake__max_bool", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/max_bool.sql", "original_file_path": "macros/max_bool.sql", "unique_id": "macro.fivetran_utils.snowflake__max_bool", "macro_sql": "{% macro snowflake__max_bool(boolean_field) %}\n\n max( {{ boolean_field }} )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "boolean_field", "type": null, "description": ""}], "created_at": 1789079002.6820974, "supported_languages": null}, "macro.fivetran_utils.bigquery__max_bool": {"name": "bigquery__max_bool", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/max_bool.sql", "original_file_path": "macros/max_bool.sql", "unique_id": "macro.fivetran_utils.bigquery__max_bool", "macro_sql": "{% macro bigquery__max_bool(boolean_field) %}\n\n max( {{ boolean_field }} )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "boolean_field", "type": null, "description": ""}], "created_at": 1789079002.6822197, "supported_languages": null}, "macro.fivetran_utils.empty_variable_warning": {"name": "empty_variable_warning", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/empty_variable_warning.sql", "original_file_path": "macros/empty_variable_warning.sql", "unique_id": "macro.fivetran_utils.empty_variable_warning", "macro_sql": "{% macro empty_variable_warning(variable, downstream_model) %}\n\n{% if not var(variable) %}\n{{ log(\n \"\"\"\n Warning: You have passed an empty list to the \"\"\" ~ variable ~ \"\"\".\n As a result, you won't see the history of any columns in the \"\"\" ~ downstream_model ~ \"\"\" model.\n \"\"\",\n info=True\n) }}\n{% endif %}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "variable", "type": null, "description": ""}, {"name": "downstream_model", "type": null, "description": ""}], "created_at": 1789079002.6826477, "supported_languages": null}, "macro.fivetran_utils.dummy_coalesce_value": {"name": "dummy_coalesce_value", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/dummy_coalesce_value.sql", "original_file_path": "macros/dummy_coalesce_value.sql", "unique_id": "macro.fivetran_utils.dummy_coalesce_value", "macro_sql": "{% macro dummy_coalesce_value(column) %}\n\n{% set coalesce_value = {\n 'STRING': \"'DUMMY_STRING'\",\n 'BOOLEAN': 'null',\n 'INT': 999999999,\n 'FLOAT': 999999999.99,\n 'TIMESTAMP': 'cast(\"2099-12-31\" as timestamp)',\n 'DATE': 'cast(\"2099-12-31\" as date)',\n} %}\n\n{% if column.is_float() %}\n{{ return(coalesce_value['FLOAT']) }}\n\n{% elif column.is_numeric() %}\n{{ return(coalesce_value['INT']) }}\n\n{% elif column.is_string() %}\n{{ return(coalesce_value['STRING']) }}\n\n{% elif column.data_type|lower == 'boolean' %}\n{{ return(coalesce_value['BOOLEAN']) }}\n\n{% elif 'timestamp' in column.data_type|lower %}\n{{ return(coalesce_value['TIMESTAMP']) }}\n\n{% elif 'date' in column.data_type|lower %}\n{{ return(coalesce_value['DATE']) }}\n\n{% elif 'int' in column.data_type|lower %}\n{{ return(coalesce_value['INT']) }}\n\n{% endif %}\n\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "column", "type": null, "description": ""}], "created_at": 1789079002.6841924, "supported_languages": null}, "macro.fivetran_utils.percentile": {"name": "percentile", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/percentile.sql", "original_file_path": "macros/percentile.sql", "unique_id": "macro.fivetran_utils.percentile", "macro_sql": "{% macro percentile(percentile_field, partition_field, percent) -%}\n\n{{ adapter.dispatch('percentile', 'fivetran_utils') (percentile_field, partition_field, percent) }}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.postgres__percentile"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "percentile_field", "type": null, "description": ""}, {"name": "partition_field", "type": null, "description": ""}, {"name": "percent", "type": null, "description": ""}], "created_at": 1789079002.6847045, "supported_languages": null}, "macro.fivetran_utils.default__percentile": {"name": "default__percentile", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/percentile.sql", "original_file_path": "macros/percentile.sql", "unique_id": "macro.fivetran_utils.default__percentile", "macro_sql": "{% macro default__percentile(percentile_field, partition_field, percent) %}\n\n percentile_cont( \n {{ percent }} )\n within group ( order by {{ percentile_field }} )\n over ( partition by {{ partition_field }} )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "percentile_field", "type": null, "description": ""}, {"name": "partition_field", "type": null, "description": ""}, {"name": "percent", "type": null, "description": ""}], "created_at": 1789079002.6849139, "supported_languages": null}, "macro.fivetran_utils.redshift__percentile": {"name": "redshift__percentile", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/percentile.sql", "original_file_path": "macros/percentile.sql", "unique_id": "macro.fivetran_utils.redshift__percentile", "macro_sql": "{% macro redshift__percentile(percentile_field, partition_field, percent) %}\n\n percentile_cont( \n {{ percent }} )\n within group ( order by {{ percentile_field }} )\n over ( partition by {{ partition_field }} )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "percentile_field", "type": null, "description": ""}, {"name": "partition_field", "type": null, "description": ""}, {"name": "percent", "type": null, "description": ""}], "created_at": 1789079002.685109, "supported_languages": null}, "macro.fivetran_utils.bigquery__percentile": {"name": "bigquery__percentile", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/percentile.sql", "original_file_path": "macros/percentile.sql", "unique_id": "macro.fivetran_utils.bigquery__percentile", "macro_sql": "{% macro bigquery__percentile(percentile_field, partition_field, percent) %}\n\n percentile_cont( \n {{ percentile_field }}, \n {{ percent }}) \n over (partition by {{ partition_field }} \n )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "percentile_field", "type": null, "description": ""}, {"name": "partition_field", "type": null, "description": ""}, {"name": "percent", "type": null, "description": ""}], "created_at": 1789079002.6852984, "supported_languages": null}, "macro.fivetran_utils.postgres__percentile": {"name": "postgres__percentile", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/percentile.sql", "original_file_path": "macros/percentile.sql", "unique_id": "macro.fivetran_utils.postgres__percentile", "macro_sql": "{% macro postgres__percentile(percentile_field, partition_field, percent) %}\n\n percentile_cont( \n {{ percent }} )\n within group ( order by {{ percentile_field }} )\n /* have to group by partition field */\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "percentile_field", "type": null, "description": ""}, {"name": "partition_field", "type": null, "description": ""}, {"name": "percent", "type": null, "description": ""}], "created_at": 1789079002.6854696, "supported_languages": null}, "macro.fivetran_utils.spark__percentile": {"name": "spark__percentile", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/percentile.sql", "original_file_path": "macros/percentile.sql", "unique_id": "macro.fivetran_utils.spark__percentile", "macro_sql": "{% macro spark__percentile(percentile_field, partition_field, percent) %}\n\n percentile( \n {{ percentile_field }}, \n {{ percent }}) \n over (partition by {{ partition_field }} \n )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "percentile_field", "type": null, "description": ""}, {"name": "partition_field", "type": null, "description": ""}, {"name": "percent", "type": null, "description": ""}], "created_at": 1789079002.6856575, "supported_languages": null}, "macro.fivetran_utils.duckdb__percentile": {"name": "duckdb__percentile", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/percentile.sql", "original_file_path": "macros/percentile.sql", "unique_id": "macro.fivetran_utils.duckdb__percentile", "macro_sql": "{% macro duckdb__percentile(percentile_field, partition_field, percent) %}\n\n quantile_cont(\n {{ percentile_field }},\n {{ percent }})\n over (partition by {{ partition_field }}\n )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "percentile_field", "type": null, "description": ""}, {"name": "partition_field", "type": null, "description": ""}, {"name": "percent", "type": null, "description": ""}], "created_at": 1789079002.6858437, "supported_languages": null}, "macro.fivetran_utils.remove_prefix_from_columns": {"name": "remove_prefix_from_columns", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/remove_prefix_from_columns.sql", "original_file_path": "macros/remove_prefix_from_columns.sql", "unique_id": "macro.fivetran_utils.remove_prefix_from_columns", "macro_sql": "{% macro remove_prefix_from_columns(columns, prefix='', exclude=[]) %}\n\n {%- for col in columns if col.name not in exclude -%}\n {%- if col.name[:prefix|length]|lower == prefix -%}\n {{ col.name }} as {{ col.name[prefix|length:] }}\n {%- else -%}\n {{ col.name }}\n {%- endif -%}\n {%- if not loop.last -%},{%- endif %}\n {% endfor -%}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "columns", "type": null, "description": ""}, {"name": "prefix", "type": null, "description": ""}, {"name": "exclude", "type": null, "description": ""}], "created_at": 1789079002.6865199, "supported_languages": null}, "macro.fivetran_utils.snowflake_seed_data": {"name": "snowflake_seed_data", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/snowflake_seed_data.sql", "original_file_path": "macros/snowflake_seed_data.sql", "unique_id": "macro.fivetran_utils.snowflake_seed_data", "macro_sql": "{% macro snowflake_seed_data(seed_name) %}\n\n{% if target.type == 'snowflake' %}\n{{ return(ref(seed_name ~ '_snowflake')) }}\n{% else %}\n{{ return(ref(seed_name)) }}\n{% endif %}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "seed_name", "type": null, "description": ""}], "created_at": 1789079002.6869526, "supported_languages": null}}, "docs": {"doc.dbt.__overview__": {"name": "__overview__", "resource_type": "doc", "package_name": "dbt", "path": "overview.md", "original_file_path": "docs/overview.md", "unique_id": "doc.dbt.__overview__", "block_contents": "### Welcome!\n\nWelcome to the auto-generated documentation for your dbt project!\n\n### Navigation\n\nYou can use the `Project` and `Database` navigation tabs on the left side of the window to explore the models\nin your project.\n\n#### Project Tab\nThe `Project` tab mirrors the directory structure of your dbt project. In this tab, you can see all of the\nmodels defined in your dbt project, as well as models imported from dbt packages.\n\n#### Database Tab\nThe `Database` tab also exposes your models, but in a format that looks more like a database explorer. This view\nshows relations (tables and views) grouped into database schemas. Note that ephemeral models are _not_ shown\nin this interface, as they do not exist in the database.\n\n### Graph Exploration\nYou can click the blue icon on the bottom-right corner of the page to view the lineage graph of your models.\n\nOn model pages, you'll see the immediate parents and children of the model you're exploring. By clicking the `Expand`\nbutton at the top-right of this lineage pane, you'll be able to see all of the models that are used to build,\nor are built from, the model you're exploring.\n\nOnce expanded, you'll be able to use the `--select` and `--exclude` model selection syntax to filter the\nmodels in the graph. For more information on model selection, check out the [dbt docs](https://docs.getdbt.com/docs/model-selection-syntax).\n\nNote that you can also right-click on models to interactively filter and explore the graph.\n\n---\n\n### More information\n\n- [What is dbt](https://docs.getdbt.com/docs/introduction)?\n- Read the [dbt viewpoint](https://docs.getdbt.com/docs/viewpoint)\n- [Installation](https://docs.getdbt.com/docs/installation)\n- Join the [dbt Community](https://www.getdbt.com/community/) for questions and discussion"}, "doc.iterable.source_relation": {"name": "source_relation", "resource_type": "doc", "package_name": "iterable", "path": "docs.md", "original_file_path": "models/docs.md", "unique_id": "doc.iterable.source_relation", "block_contents": "Identifies the record's source."}, "doc.iterable._fivetran_synced": {"name": "_fivetran_synced", "resource_type": "doc", "package_name": "iterable", "path": "docs.md", "original_file_path": "models/docs.md", "unique_id": "doc.iterable._fivetran_synced", "block_contents": "The time when a record was last updated by Fivetran."}}, "exposures": {}, "metrics": {}, "groups": {}, "selectors": {}, "disabled": {"test.iterable_integration_tests.consistency_campaigns": [{"database": "postgres", "schema": "public_dbt_test__audit", "name": "consistency_campaigns", "resource_type": "test", "package_name": "iterable_integration_tests", "path": "consistency/consistency_campaigns.sql", "original_file_path": "tests/consistency/consistency_campaigns.sql", "unique_id": "test.iterable_integration_tests.consistency_campaigns", "fqn": ["iterable_integration_tests", "consistency", "consistency_campaigns"], "alias": "consistency_campaigns", "checksum": {"name": "sha256", "checksum": "30e008529ef9f5fa6d8697bbcff2562fc9b176d571cc310458e67e8c82a46185"}, "config": {"enabled": false, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": ["fivetran_validations"], "meta": {}, "group": null, "static_analysis": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "sql_header": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": ["fivetran_validations"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"tags": "fivetran_validations", "enabled": "var('fivetran_validation_tests_enabled', False)"}, "created_at": 1789079003.1515768, "relation_name": null, "raw_code": "{{ config(\n tags=\"fivetran_validations\",\n enabled=var('fivetran_validation_tests_enabled', false)\n) }}\n\n{% set exclude_cols = ['labels'] + var('consistency_test_exclude_metrics', []) %}\n{% set fields = dbt_utils.star(from=ref('iterable__campaigns'), except=exclude_cols) %}\n\n-- this test ensures the iterable__campaigns end model matches the prior version\nwith prod as (\n select {{ fields }}\n from {{ target.schema }}_iterable_prod.iterable__campaigns\n where date(updated_at) < date({{ dbt.current_timestamp() }})\n),\n\ndev as (\n select {{ fields }}\n from {{ target.schema }}_iterable_dev.iterable__campaigns\n where date(updated_at) < date({{ dbt.current_timestamp() }})\n),\n\nprod_not_in_dev as (\n -- rows from prod not found in dev\n select * from prod\n except distinct\n select * from dev\n),\n\ndev_not_in_prod as (\n -- rows from dev not found in prod\n select * from dev\n except distinct\n select * from prod\n),\n\nfinal as (\n select\n *,\n 'from prod' as source\n from prod_not_in_dev\n\n union all -- union since we only care if rows are produced\n\n select\n *,\n 'from dev' as source\n from dev_not_in_prod\n)\n\nselect *\nfrom final", "doc_blocks": [], "language": "sql", "refs": [{"name": "iterable__campaigns", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt_utils.star", "macro.dbt.current_timestamp"], "nodes": []}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}}], "test.iterable_integration_tests.consistency_user_unsubscriptions": [{"database": "postgres", "schema": "public_dbt_test__audit", "name": "consistency_user_unsubscriptions", "resource_type": "test", "package_name": "iterable_integration_tests", "path": "consistency/consistency_user_unsubscriptions.sql", "original_file_path": "tests/consistency/consistency_user_unsubscriptions.sql", "unique_id": "test.iterable_integration_tests.consistency_user_unsubscriptions", "fqn": ["iterable_integration_tests", "consistency", "consistency_user_unsubscriptions"], "alias": "consistency_user_unsubscriptions", "checksum": {"name": "sha256", "checksum": "32d0be8a7f721a49100a7f4b1046a8ecb1d75b86f4ad1a484d53a1d03343bc40"}, "config": {"enabled": false, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": ["fivetran_validations"], "meta": {}, "group": null, "static_analysis": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "sql_header": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": ["fivetran_validations"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"tags": "fivetran_validations", "enabled": "var('fivetran_validation_tests_enabled', False)"}, "created_at": 1789079003.187948, "relation_name": null, "raw_code": "{{ config(\n tags=\"fivetran_validations\",\n enabled=var('fivetran_validation_tests_enabled', false)\n) }}\n\n{% set exclude_cols = var('consistency_test_exclude_metrics', []) %}\n{% set fields = dbt_utils.star(from=ref('iterable__user_unsubscriptions'), except=exclude_cols) %}\n\n-- this test ensures the iterable__user_unsubscriptions end model matches the prior version\nwith prod as (\n select {{ fields }}\n from {{ target.schema }}_iterable_prod.iterable__user_unsubscriptions\n),\n\ndev as (\n select {{ fields }}\n from {{ target.schema }}_iterable_dev.iterable__user_unsubscriptions\n),\n\nprod_not_in_dev as (\n -- rows from prod not found in dev\n select * from prod\n except distinct\n select * from dev\n),\n\ndev_not_in_prod as (\n -- rows from dev not found in prod\n select * from dev\n except distinct\n select * from prod\n),\n\nfinal as (\n select\n *,\n 'from prod' as source\n from prod_not_in_dev\n\n union all -- union since we only care if rows are produced\n\n select\n *,\n 'from dev' as source\n from dev_not_in_prod\n)\n\nselect *\nfrom final", "doc_blocks": [], "language": "sql", "refs": [{"name": "iterable__user_unsubscriptions", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt_utils.star"], "nodes": []}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}}], "test.iterable_integration_tests.consistency_list_user_history": [{"database": "postgres", "schema": "public_dbt_test__audit", "name": "consistency_list_user_history", "resource_type": "test", "package_name": "iterable_integration_tests", "path": "consistency/consistency_list_user_history.sql", "original_file_path": "tests/consistency/consistency_list_user_history.sql", "unique_id": "test.iterable_integration_tests.consistency_list_user_history", "fqn": ["iterable_integration_tests", "consistency", "consistency_list_user_history"], "alias": "consistency_list_user_history", "checksum": {"name": "sha256", "checksum": "e0081cf1366801020e3c9fbdc71e989f2bdd7b713ee328c2f4a5e9b97355601e"}, "config": {"enabled": false, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": ["fivetran_validations"], "meta": {}, "group": null, "static_analysis": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "sql_header": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": ["fivetran_validations"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"tags": "fivetran_validations", "enabled": "var('fivetran_validation_tests_enabled', False)"}, "created_at": 1789079003.1927247, "relation_name": null, "raw_code": "{{ config(\n tags=\"fivetran_validations\",\n enabled=var('fivetran_validation_tests_enabled', false)\n) }}\n\n{% set exclude_cols = var('consistency_test_exclude_metrics', []) %}\n{% set fields = dbt_utils.star(from=ref('iterable__list_user_history'), except=exclude_cols) %}\n\n-- this test ensures the iterable__list_user_history end model matches the prior version\nwith prod as (\n select {{ fields }}\n from {{ target.schema }}_iterable_prod.iterable__list_user_history\n),\n\ndev as (\n select {{ fields }}\n from {{ target.schema }}_iterable_dev.iterable__list_user_history\n),\n\nprod_not_in_dev as (\n -- rows from prod not found in dev\n select * from prod\n except distinct\n select * from dev\n),\n\ndev_not_in_prod as (\n -- rows from dev not found in prod\n select * from dev\n except distinct\n select * from prod\n),\n\nfinal as (\n select\n *,\n 'from prod' as source\n from prod_not_in_dev\n\n union all -- union since we only care if rows are produced\n\n select\n *,\n 'from dev' as source\n from dev_not_in_prod\n)\n\nselect *\nfrom final", "doc_blocks": [], "language": "sql", "refs": [{"name": "iterable__list_user_history", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt_utils.star"], "nodes": []}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}}], "test.iterable_integration_tests.consistency_users": [{"database": "postgres", "schema": "public_dbt_test__audit", "name": "consistency_users", "resource_type": "test", "package_name": "iterable_integration_tests", "path": "consistency/consistency_users.sql", "original_file_path": "tests/consistency/consistency_users.sql", "unique_id": "test.iterable_integration_tests.consistency_users", "fqn": ["iterable_integration_tests", "consistency", "consistency_users"], "alias": "consistency_users", "checksum": {"name": "sha256", "checksum": "d367ccd8f7d79248da78ce29fc8f08876913df08b89866895cce315f46ef81e3"}, "config": {"enabled": false, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": ["fivetran_validations"], "meta": {}, "group": null, "static_analysis": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "sql_header": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": ["fivetran_validations"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"tags": "fivetran_validations", "enabled": "var('fivetran_validation_tests_enabled', False)"}, "created_at": 1789079003.1975255, "relation_name": null, "raw_code": "{{ config(\n tags=\"fivetran_validations\",\n enabled=var('fivetran_validation_tests_enabled', false)\n) }}\n\n{% set exclude_cols = var('consistency_test_exclude_metrics', []) %}\n{% set fields = dbt_utils.star(from=ref('iterable__users'), except=exclude_cols) %}\n\n-- this test ensures the iterable__users end model matches the prior version\nwith prod as (\n select {{ fields }}\n from {{ target.schema }}_iterable_prod.iterable__users\n where date(updated_at) < date({{ dbt.current_timestamp() }})\n),\n\ndev as (\n select {{ fields }}\n from {{ target.schema }}_iterable_dev.iterable__users\n where date(updated_at) < date({{ dbt.current_timestamp() }})\n),\n\nprod_not_in_dev as (\n -- rows from prod not found in dev\n select * from prod\n except distinct\n select * from dev\n),\n\ndev_not_in_prod as (\n -- rows from dev not found in prod\n select * from dev\n except distinct\n select * from prod\n),\n\nfinal as (\n select\n *,\n 'from prod' as source\n from prod_not_in_dev\n\n union all -- union since we only care if rows are produced\n\n select\n *,\n 'from dev' as source\n from dev_not_in_prod\n)\n\nselect *\nfrom final", "doc_blocks": [], "language": "sql", "refs": [{"name": "iterable__users", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt_utils.star", "macro.dbt.current_timestamp"], "nodes": []}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}}], "test.iterable_integration_tests.consistency_user_unsubscribes_pre_aug_2023": [{"database": "postgres", "schema": "public_dbt_test__audit", "name": "consistency_user_unsubscribes_pre_aug_2023", "resource_type": "test", "package_name": "iterable_integration_tests", "path": "consistency/consistency_user_unsubscribes_pre_aug_2023.sql", "original_file_path": "tests/consistency/consistency_user_unsubscribes_pre_aug_2023.sql", "unique_id": "test.iterable_integration_tests.consistency_user_unsubscribes_pre_aug_2023", "fqn": ["iterable_integration_tests", "consistency", "consistency_user_unsubscribes_pre_aug_2023"], "alias": "consistency_user_unsubscribes_pre_aug_2023", "checksum": {"name": "sha256", "checksum": "0d85b35d94066e59119f57fbe930a19353dfbb79b4e812b54de9c19520a58402"}, "config": {"enabled": false, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": ["fivetran_validations"], "meta": {}, "group": null, "static_analysis": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "sql_header": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": ["fivetran_validations"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"tags": "fivetran_validations", "enabled": "var('fivetran_validation_tests_enabled', False)"}, "created_at": 1789079003.2030814, "relation_name": null, "raw_code": "-- These validation tests were designed to work with the pre-August 2023 version of the Iterable connector.\n-- You will thus need to comment out `iterable_user_unsubscribed_channel_identifier` and `iterable_user_unsubscribed_message_type_identifier` in the `integration_tests/dbt_project.yml` to run and validate these tests. \n\n{{ config(\n tags=\"fivetran_validations\",\n enabled=var('fivetran_validation_tests_enabled', false)\n) }}\n\n\nwith prod as (\n\n select \n unique_user_key, \n coalesce(count(distinct unique_user_key), 0) as unique_user_records_prod, \n coalesce(count(distinct channel_id), 0) as channels_prod, \n coalesce(count(distinct message_type_id), 0) as message_types_prod\n from {{ target.schema }}_iterable_prod.iterable__user_unsubscriptions\n where channel_id is not null\n and message_type_id is not null\n group by 1\n),\n\ndev as (\n\n select \n unique_user_key, \n coalesce(count(distinct unique_user_key), 0) as unique_user_records_dev, \n coalesce(count(distinct channel_id), 0) as channels_dev, \n coalesce(count(distinct message_type_id), 0) as message_types_dev\n from {{ target.schema }}_iterable_dev.iterable__user_unsubscriptions\n where channel_id is not null\n and message_type_id is not null\n group by 1\n),\n\nfinal as (\n\n select \n prod.unique_user_key,\n unique_user_records_prod,\n unique_user_records_dev,\n channels_prod,\n channels_dev,\n message_types_prod,\n message_types_dev\n from prod\n full outer join dev\n on prod.unique_user_key = dev.unique_user_key\n) \n\nselect *\nfrom final\nwhere unique_user_records_prod != unique_user_records_dev\n and channels_prod != channels_dev \n and message_types_prod != message_types_dev", "doc_blocks": [], "language": "sql", "refs": [], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": [], "nodes": []}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}}], "test.iterable_integration_tests.consistency_user_campaign": [{"database": "postgres", "schema": "public_dbt_test__audit", "name": "consistency_user_campaign", "resource_type": "test", "package_name": "iterable_integration_tests", "path": "consistency/consistency_user_campaign.sql", "original_file_path": "tests/consistency/consistency_user_campaign.sql", "unique_id": "test.iterable_integration_tests.consistency_user_campaign", "fqn": ["iterable_integration_tests", "consistency", "consistency_user_campaign"], "alias": "consistency_user_campaign", "checksum": {"name": "sha256", "checksum": "8663f2c250688a8303d2ef38dc723e2fc62d996396b4b07e13c05feeb48cd97c"}, "config": {"enabled": false, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": ["fivetran_validations"], "meta": {}, "group": null, "static_analysis": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "sql_header": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": ["fivetran_validations"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"tags": "fivetran_validations", "enabled": "var('fivetran_validation_tests_enabled', False)"}, "created_at": 1789079003.2065723, "relation_name": null, "raw_code": "{{ config(\n tags=\"fivetran_validations\",\n enabled=var('fivetran_validation_tests_enabled', false)\n) }}\n\n{% set exclude_cols = var('consistency_test_exclude_metrics', []) %}\n{% set fields = dbt_utils.star(from=ref('iterable__user_campaign'), except=exclude_cols) %}\n\n-- this test ensures the iterable__user_campaign end model matches the prior version\nwith prod as (\n select {{ fields }}\n from {{ target.schema }}_iterable_prod.iterable__user_campaign\n where date(first_event_at) < date({{ dbt.current_timestamp() }})\n),\n\ndev as (\n select {{ fields }}\n from {{ target.schema }}_iterable_dev.iterable__user_campaign\n where date(first_event_at) < date({{ dbt.current_timestamp() }})\n),\n\nprod_not_in_dev as (\n -- rows from prod not found in dev\n select * from prod\n except distinct\n select * from dev\n),\n\ndev_not_in_prod as (\n -- rows from dev not found in prod\n select * from dev\n except distinct\n select * from prod\n),\n\nfinal as (\n select\n *,\n 'from prod' as source\n from prod_not_in_dev\n\n union all -- union since we only care if rows are produced\n\n select\n *,\n 'from dev' as source\n from dev_not_in_prod\n)\n\nselect *\nfrom final", "doc_blocks": [], "language": "sql", "refs": [{"name": "iterable__user_campaign", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt_utils.star", "macro.dbt.current_timestamp"], "nodes": []}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}}], "test.iterable_integration_tests.consistency_events": [{"database": "postgres", "schema": "public_dbt_test__audit", "name": "consistency_events", "resource_type": "test", "package_name": "iterable_integration_tests", "path": "consistency/consistency_events.sql", "original_file_path": "tests/consistency/consistency_events.sql", "unique_id": "test.iterable_integration_tests.consistency_events", "fqn": ["iterable_integration_tests", "consistency", "consistency_events"], "alias": "consistency_events", "checksum": {"name": "sha256", "checksum": "6e82de77a605ca7613eb3563f2158ad172785552d38cbf3617136a816c073b36"}, "config": {"enabled": false, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": ["fivetran_validations"], "meta": {}, "group": null, "static_analysis": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "sql_header": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": ["fivetran_validations"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"tags": "fivetran_validations", "enabled": "var('fivetran_validation_tests_enabled', False)"}, "created_at": 1789079003.2119424, "relation_name": null, "raw_code": "{{ config(\n tags=\"fivetran_validations\",\n enabled=var('fivetran_validation_tests_enabled', false)\n) }}\n\n-- exclude JSON fields\n{% set exclude_cols = ['additional_properties', 'transactional_data'] + var('consistency_test_exclude_metrics', []) %}\n{% set fields = dbt_utils.star(from=ref('iterable__events'), except=exclude_cols) %}\n\n-- this test ensures the iterable__events end model matches the prior version\nwith prod as (\n select {{ fields }}\n from {{ target.schema }}_iterable_prod.iterable__events\n where date(created_at) < date({{ dbt.current_timestamp() }})\n),\n\ndev as (\n select {{ fields }}\n from {{ target.schema }}_iterable_dev.iterable__events\n where date(created_at) < date({{ dbt.current_timestamp() }})\n),\n\nprod_not_in_dev as (\n -- rows from prod not found in dev\n select * from prod\n except distinct\n select * from dev\n),\n\ndev_not_in_prod as (\n -- rows from dev not found in prod\n select * from dev\n except distinct\n select * from prod\n),\n\nfinal as (\n select\n *,\n 'from prod' as source\n from prod_not_in_dev\n\n union all -- union since we only care if rows are produced\n\n select\n *,\n 'from dev' as source\n from dev_not_in_prod\n)\n\nselect *\nfrom final", "doc_blocks": [], "language": "sql", "refs": [{"name": "iterable__events", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt_utils.star", "macro.dbt.current_timestamp"], "nodes": []}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}}], "test.iterable_integration_tests.consistency_journeys": [{"database": "postgres", "schema": "public_dbt_test__audit", "name": "consistency_journeys", "resource_type": "test", "package_name": "iterable_integration_tests", "path": "consistency/consistency_journeys.sql", "original_file_path": "tests/consistency/consistency_journeys.sql", "unique_id": "test.iterable_integration_tests.consistency_journeys", "fqn": ["iterable_integration_tests", "consistency", "consistency_journeys"], "alias": "consistency_journeys", "checksum": {"name": "sha256", "checksum": "93a73b2e7e1d608a1116fddcec932e15ce18a57fb099872a13b4f97ca006d18f"}, "config": {"enabled": false, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": ["fivetran_validations"], "meta": {}, "group": null, "static_analysis": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "sql_header": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": ["fivetran_validations"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"tags": "fivetran_validations", "enabled": "var('fivetran_validation_tests_enabled', False)"}, "created_at": 1789079003.2183816, "relation_name": null, "raw_code": "{{ config(\n tags=\"fivetran_validations\",\n enabled=var('fivetran_validation_tests_enabled', false)\n) }}\n\n{% set exclude_cols = ['trigger_event_names'] + var('consistency_test_exclude_metrics', []) %}\n{% set fields = dbt_utils.star(from=ref('iterable__journeys'), except=exclude_cols) %}\n\n-- this test ensures the iterable__journeys end model matches the prior version\nwith prod as (\n select {{ fields }}\n from {{ target.schema }}_iterable_prod.iterable__journeys\n where date(updated_at) < date({{ dbt.current_timestamp() }})\n),\n\ndev as (\n select {{ fields }}\n from {{ target.schema }}_iterable_dev.iterable__journeys\n where date(updated_at) < date({{ dbt.current_timestamp() }})\n),\n\nprod_not_in_dev as (\n -- rows from prod not found in dev\n select * from prod\n except distinct\n select * from dev\n),\n\ndev_not_in_prod as (\n -- rows from dev not found in prod\n select * from dev\n except distinct\n select * from prod\n),\n\nfinal as (\n select\n *,\n 'from prod' as source\n from prod_not_in_dev\n\n union all -- union since we only care if rows are produced\n\n select\n *,\n 'from dev' as source\n from dev_not_in_prod\n)\n\nselect *\nfrom final", "doc_blocks": [], "language": "sql", "refs": [{"name": "iterable__journeys", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt_utils.star", "macro.dbt.current_timestamp"], "nodes": []}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}}], "test.iterable_integration_tests.user_unsubscribe_count_match_pre_aug_2023": [{"database": "postgres", "schema": "public_dbt_test__audit", "name": "user_unsubscribe_count_match_pre_aug_2023", "resource_type": "test", "package_name": "iterable_integration_tests", "path": "integrity/user_unsubscribe_count_match_pre_aug_2023.sql", "original_file_path": "tests/integrity/user_unsubscribe_count_match_pre_aug_2023.sql", "unique_id": "test.iterable_integration_tests.user_unsubscribe_count_match_pre_aug_2023", "fqn": ["iterable_integration_tests", "integrity", "user_unsubscribe_count_match_pre_aug_2023"], "alias": "user_unsubscribe_count_match_pre_aug_2023", "checksum": {"name": "sha256", "checksum": "6b37518965460a9c0b7161808527fa4b6f240a6ead0827a3950705267ebd236f"}, "config": {"enabled": false, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": ["fivetran_validations"], "meta": {}, "group": null, "static_analysis": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "sql_header": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": ["fivetran_validations"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"tags": "fivetran_validations", "enabled": "var('fivetran_validation_tests_enabled', False)"}, "created_at": 1789079003.2240984, "relation_name": null, "raw_code": "-- These validation tests were designed to work with the pre-August 2023 version of the Iterable connector.\n-- You will thus need to comment out `iterable_user_unsubscribed_channel_identifier` and `iterable_user_unsubscribed_message_type_identifier` in the `integration_tests/dbt_project.yml` to run and validate these tests. \n\n{{ config(\n tags=\"fivetran_validations\",\n enabled=var('fivetran_validation_tests_enabled', false)\n) }}\n\nwith unsub_channels as (\n\n select \n unique_user_key, \n channel_id\n from {{ ref('stg_iterable__user_unsubscribed_channel') }}\n group by 1, 2\n),\n\nunsub_messages as (\n\n select \n unique_user_key, \n message_type_id\n from {{ ref('stg_iterable__user_unsub_message_type') }}\n group by 1, 2\n),\n\nchannel_message_combos as (\n\n select channel_id, message_type_id \n from {{ ref('stg_iterable__message_type') }}\n group by 1, 2\n),\n\nmessage_channel_unsubs as (\n\n select \n unsub_channels.unique_user_key as unique_user_key_source,\n channel_message_combos.channel_id as channel_source,\n channel_message_combos.message_type_id as message_type_source\n from unsub_channels \n inner join channel_message_combos\n on unsub_channels.channel_id = channel_message_combos.channel_id\n\n union all\n\n select \n unsub_messages.unique_user_key as unique_user_key_source,\n channel_message_combos.channel_id as channel_source,\n channel_message_combos.message_type_id as message_type_source\n from unsub_messages\n inner join channel_message_combos\n on unsub_messages.message_type_id = channel_message_combos.message_type_id\n\n),\n\nsource_counts as (\n\n select unique_user_key_source, channel_source, message_type_source, count(*) as source_count\n from message_channel_unsubs \n group by 1, 2, 3\n),\n\nend_model_counts as (\n\n select unique_user_key as unique_user_key_end, channel_id as channel_end, message_type_id as message_type_end, count(*) as end_count\n from {{ ref('iterable__user_unsubscriptions') }}\n group by 1, 2, 3 \n)\n\nselect * \nfrom source_counts\ninner join end_model_counts \n on source_counts.unique_user_key_source = end_model_counts.unique_user_key_end\nwhere source_counts.channel_source = end_model_counts.channel_end\n and source_counts.message_type_source = end_model_counts.message_type_end\n and source_counts.source_count != end_model_counts.end_count", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__user_unsubscribed_channel", "package": null, "version": null}, {"name": "stg_iterable__user_unsub_message_type", "package": null, "version": null}, {"name": "stg_iterable__message_type", "package": null, "version": null}, {"name": "iterable__user_unsubscriptions", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": [], "nodes": []}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}}], "model.iterable.int_iterable__custom_events": [{"database": "postgres", "schema": "public_iterable_dev", "name": "int_iterable__custom_events", "resource_type": "model", "package_name": "iterable", "path": "intermediate/int_iterable__custom_events.sql", "original_file_path": "models/intermediate/int_iterable__custom_events.sql", "unique_id": "model.iterable.int_iterable__custom_events", "fqn": ["iterable", "intermediate", "int_iterable__custom_events"], "alias": "int_iterable__custom_events", "checksum": {"name": "sha256", "checksum": "0f0f1330b62dd5a320f37f7e30dae86a90c57e07c135369a259cfcba61875a16"}, "config": {"enabled": false, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "incremental", "incremental_strategy": "merge", "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": "event_id", "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}, "file_format": "delta"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"materialized": "incremental", "schema": "iterable_{{ var('directed_schema','dev') }}", "unique_key": "event_id", "incremental_strategy": "merge", "file_format": "delta", "enabled": "False", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789079003.6617742, "relation_name": "\"postgres\".\"public_iterable_dev\".\"int_iterable__custom_events\"", "raw_code": "{{\n config(\n materialized='incremental',\n unique_key='event_id',\n incremental_strategy = 'merge',\n file_format = 'delta',\n enabled=false\n )\n}}\n\n-- leave this alone for now....setting enabled to false\nwith events as (\n\n select *\n from {{ ref('stg_iterable__event') }}\n\n where lower(event_name) = 'customevent'\n {% if is_incremental() %}\n and updated_at > ( select max(updated_at) from {{ this }} )\n {% endif %}\n\n), custom_events as (\n\n select \n events.*\n {# {{ dbt.split_part(string_text='additional_properties', delimiter_text=' : \"{', part_number=1) }} #}\n\n {% if target.type == 'snowflake' %}\n ,\n additional_properties.key as custom_event_name,\n additional_properties.value as custom_event_metadata\n {% endif %}\n from events\n\n \n {% if target.type == 'snowflake' %}\n cross join \n table(flatten(additional_properties)) as additional_properties\n where additional_properties.key != '_id'\n {% endif %}\n)\n\nselect *\nfrom custom_events", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__event", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.is_incremental"], "nodes": []}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}]}, "parent_map": {"seed.iterable_integration_tests.campaign_metrics_data": [], "seed.iterable_integration_tests.campaign_list_history_data": [], "seed.iterable_integration_tests.user_unsubscribed_message_type_history_data": [], "seed.iterable_integration_tests.user_unsubscribed_channel_history_data": [], "seed.iterable_integration_tests.campaign_suppression_list_history_data": [], "seed.iterable_integration_tests.channel_data": [], "seed.iterable_integration_tests.template_history_data": [], "seed.iterable_integration_tests.message_type_data": [], "seed.iterable_integration_tests.event_data": [], "seed.iterable_integration_tests.list_user_data": [], "seed.iterable_integration_tests.user_history_bq_json_data": [], "seed.iterable_integration_tests.user_unsubscribed_message_type_data": [], "seed.iterable_integration_tests.journey_data": [], "seed.iterable_integration_tests.campaign_history_data": [], "seed.iterable_integration_tests.list_data": [], "seed.iterable_integration_tests.event_extension_data": [], "seed.iterable_integration_tests.user_unsubscribed_channel_data": [], "seed.iterable_integration_tests.campaign_label_history_data": [], "seed.iterable_integration_tests.user_history_data": [], "model.iterable.iterable__users": ["model.iterable.int_iterable__list_user_unnest", "model.iterable.int_iterable__user_event_metrics", "model.iterable.stg_iterable__list_user"], "model.iterable.iterable__list_user_history": ["model.iterable.int_iterable__list_user_unnest", "model.iterable.stg_iterable__list", "model.iterable.stg_iterable__list_user"], "model.iterable.iterable__events": ["model.iterable.int_iterable__latest_template", "model.iterable.int_iterable__latest_user", "model.iterable.int_iterable__message_type_channel", "model.iterable.int_iterable__recurring_campaigns", "model.iterable.stg_iterable__event", "model.iterable.stg_iterable__event_extension"], "model.iterable.iterable__user_campaign": ["model.iterable.iterable__events"], "model.iterable.iterable__user_unsubscriptions": ["model.iterable.int_iterable__message_type_channel", "model.iterable.stg_iterable__user_unsub_message_type", "model.iterable.stg_iterable__user_unsubscribed_channel"], "model.iterable.iterable__journeys": ["model.iterable.int_iterable__journey_event_metrics", "model.iterable.stg_iterable__journey"], "model.iterable.iterable__campaigns": ["model.iterable.int_iterable__campaign_event_metrics", "model.iterable.int_iterable__campaign_labels", "model.iterable.int_iterable__campaign_lists", "model.iterable.int_iterable__latest_template", "model.iterable.int_iterable__recurring_campaigns", "model.iterable.stg_iterable__journey"], "model.iterable.int_iterable__campaign_labels": ["model.iterable.stg_iterable__campaign_label_history"], "model.iterable.int_iterable__journey_event_metrics": ["model.iterable.int_iterable__recurring_campaigns", "model.iterable.iterable__user_campaign"], "model.iterable.int_iterable__list_user_unnest": ["model.iterable.int_iterable__list_user_history"], "model.iterable.int_iterable__latest_template": ["model.iterable.int_iterable__message_type_channel", "model.iterable.stg_iterable__template_history"], "model.iterable.int_iterable__campaign_event_metrics": ["model.iterable.iterable__user_campaign"], "model.iterable.int_iterable__campaign_lists": ["model.iterable.stg_iterable__campaign_list_history", "model.iterable.stg_iterable__campaign_suppression_list_history"], "model.iterable.int_iterable__recurring_campaigns": ["model.iterable.int_iterable__latest_campaign"], "model.iterable.int_iterable__list_user_history": ["model.iterable.stg_iterable__user_history"], "model.iterable.int_iterable__message_type_channel": ["model.iterable.stg_iterable__channel", "model.iterable.stg_iterable__message_type"], "model.iterable.int_iterable__user_event_metrics": ["model.iterable.iterable__user_campaign"], "model.iterable.int_iterable__latest_user": ["model.iterable.stg_iterable__user_history"], "model.iterable.int_iterable__latest_campaign": ["model.iterable.stg_iterable__campaign_history"], "model.iterable.stg_iterable__message_type": ["model.iterable.stg_iterable__message_type_tmp"], "model.iterable.stg_iterable__event": ["model.iterable.stg_iterable__event_tmp"], "model.iterable.stg_iterable__user_unsubscribed_channel": ["model.iterable.stg_iterable__user_unsubscribed_channel_tmp"], "model.iterable.stg_iterable__campaign_history": ["model.iterable.stg_iterable__campaign_history_tmp"], "model.iterable.stg_iterable__campaign_label_history": ["model.iterable.stg_iterable__campaign_label_history_tmp"], "model.iterable.stg_iterable__template_history": ["model.iterable.stg_iterable__template_history_tmp"], "model.iterable.stg_iterable__journey": ["model.iterable.stg_iterable__journey_tmp"], "model.iterable.stg_iterable__user_history": ["model.iterable.stg_iterable__user_history_tmp"], "model.iterable.stg_iterable__user_unsub_message_type": ["model.iterable.stg_iterable__user_unsub_message_type_tmp"], "model.iterable.stg_iterable__list": ["model.iterable.stg_iterable__list_tmp"], "model.iterable.stg_iterable__list_user": ["model.iterable.stg_iterable__list_user_tmp"], "model.iterable.stg_iterable__campaign_suppression_list_history": ["model.iterable.stg_iterable__campaign_suppression_list_history_tmp"], "model.iterable.stg_iterable__event_extension": ["model.iterable.stg_iterable__event_extension_tmp"], "model.iterable.stg_iterable__campaign_list_history": ["model.iterable.stg_iterable__campaign_list_history_tmp"], "model.iterable.stg_iterable__channel": ["model.iterable.stg_iterable__channel_tmp"], "model.iterable.stg_iterable__message_type_tmp": ["source.iterable.iterable.message_type"], "model.iterable.stg_iterable__event_extension_tmp": ["source.iterable.iterable.event_extension"], "model.iterable.stg_iterable__user_unsub_message_type_tmp": ["source.iterable.iterable.user_unsubscribed_message_type_history"], "model.iterable.stg_iterable__campaign_list_history_tmp": ["source.iterable.iterable.campaign_list_history"], "model.iterable.stg_iterable__list_user_tmp": ["source.iterable.iterable.list_user"], "model.iterable.stg_iterable__user_history_tmp": ["source.iterable.iterable.user_history"], "model.iterable.stg_iterable__campaign_history_tmp": ["source.iterable.iterable.campaign_history"], "model.iterable.stg_iterable__template_history_tmp": ["source.iterable.iterable.template_history"], "model.iterable.stg_iterable__event_tmp": ["source.iterable.iterable.event"], "model.iterable.stg_iterable__journey_tmp": ["source.iterable.iterable.journey"], "model.iterable.stg_iterable__campaign_suppression_list_history_tmp": ["source.iterable.iterable.campaign_suppression_list_history"], "model.iterable.stg_iterable__campaign_label_history_tmp": ["source.iterable.iterable.campaign_label_history"], "model.iterable.stg_iterable__list_tmp": ["source.iterable.iterable.list"], "model.iterable.stg_iterable__channel_tmp": ["source.iterable.iterable.channel"], "model.iterable.stg_iterable__user_unsubscribed_channel_tmp": ["source.iterable.iterable.user_unsubscribed_channel_history"], "test.iterable.not_null_iterable__campaigns_campaign_id.03c9448919": ["model.iterable.iterable__campaigns"], "test.iterable.not_null_iterable__events_event_id.ed1d28a650": ["model.iterable.iterable__events"], "test.iterable.not_null_iterable__journeys_journey_id.b5c6b8783a": ["model.iterable.iterable__journeys"], "test.iterable.unique_iterable__journeys_unique_journey_id.ba86841246": ["model.iterable.iterable__journeys"], "test.iterable.not_null_iterable__user_unsubscriptions_unique_user_key.f8db72932b": ["model.iterable.iterable__user_unsubscriptions"], "test.iterable.not_null_iterable__users_unique_user_key.4ca37a26c8": ["model.iterable.iterable__users"], "test.iterable.not_null_stg_iterable__campaign_history_campaign_id.b7c36e4525": ["model.iterable.stg_iterable__campaign_history"], "test.iterable.not_null_stg_iterable__campaign_label_history_campaign_id.1918cef89a": ["model.iterable.stg_iterable__campaign_label_history"], "test.iterable.not_null_stg_iterable__campaign_list_history_campaign_id.208f9bf9ed": ["model.iterable.stg_iterable__campaign_list_history"], "test.iterable.not_null_stg_iterable__campaign_suppression_list_history_campaign_id.3921289710": ["model.iterable.stg_iterable__campaign_suppression_list_history"], "test.iterable.not_null_stg_iterable__channel_channel_id.182ceb9636": ["model.iterable.stg_iterable__channel"], "test.iterable.not_null_stg_iterable__event_event_id.370cd4bc9d": ["model.iterable.stg_iterable__event"], "test.iterable.not_null_stg_iterable__event_unique_event_id.e2b46d3bb6": ["model.iterable.stg_iterable__event"], "test.iterable.not_null_stg_iterable__event_extension_event_id.144dedcd30": ["model.iterable.stg_iterable__event_extension"], "test.iterable.not_null_stg_iterable__journey_journey_id.cc38bd633c": ["model.iterable.stg_iterable__journey"], "test.iterable.not_null_stg_iterable__list_list_id.47029d839a": ["model.iterable.stg_iterable__list"], "test.iterable.not_null_stg_iterable__message_type_message_type_id.75eaa6fa62": ["model.iterable.stg_iterable__message_type"], "test.iterable.not_null_stg_iterable__template_history_template_id.14b24a1dfe": ["model.iterable.stg_iterable__template_history"], "test.iterable.not_null_stg_iterable__list_user__fivetran_user_id.cca4b34c07": ["model.iterable.stg_iterable__list_user"], "test.iterable.not_null_stg_iterable__user_history_unique_user_key.2845af2127": ["model.iterable.stg_iterable__user_history"], "test.iterable.not_null_stg_iterable__user_unsubscribed_channel_channel_id.da0ed9e9be": ["model.iterable.stg_iterable__user_unsubscribed_channel"], "test.iterable.not_null_stg_iterable__user_unsub_message_type_message_type_id.268a89ea6f": ["model.iterable.stg_iterable__user_unsub_message_type"], "source.iterable.iterable.campaign_history": [], "source.iterable.iterable.campaign_label_history": [], "source.iterable.iterable.campaign_list_history": [], "source.iterable.iterable.campaign_suppression_list_history": [], "source.iterable.iterable.channel": [], "source.iterable.iterable.event": [], "source.iterable.iterable.event_extension": [], "source.iterable.iterable.journey": [], "source.iterable.iterable.list": [], "source.iterable.iterable.message_type": [], "source.iterable.iterable.template_history": [], "source.iterable.iterable.user_history": [], "source.iterable.iterable.user_unsubscribed_channel": [], "source.iterable.iterable.user_unsubscribed_message_type": [], "source.iterable.iterable.user_unsubscribed_channel_history": [], "source.iterable.iterable.user_unsubscribed_message_type_history": [], "source.iterable.iterable.list_user": []}, "child_map": {"seed.iterable_integration_tests.campaign_metrics_data": [], "seed.iterable_integration_tests.campaign_list_history_data": [], "seed.iterable_integration_tests.user_unsubscribed_message_type_history_data": [], "seed.iterable_integration_tests.user_unsubscribed_channel_history_data": [], "seed.iterable_integration_tests.campaign_suppression_list_history_data": [], "seed.iterable_integration_tests.channel_data": [], "seed.iterable_integration_tests.template_history_data": [], "seed.iterable_integration_tests.message_type_data": [], "seed.iterable_integration_tests.event_data": [], "seed.iterable_integration_tests.list_user_data": [], "seed.iterable_integration_tests.user_history_bq_json_data": [], "seed.iterable_integration_tests.user_unsubscribed_message_type_data": [], "seed.iterable_integration_tests.journey_data": [], "seed.iterable_integration_tests.campaign_history_data": [], "seed.iterable_integration_tests.list_data": [], "seed.iterable_integration_tests.event_extension_data": [], "seed.iterable_integration_tests.user_unsubscribed_channel_data": [], "seed.iterable_integration_tests.campaign_label_history_data": [], "seed.iterable_integration_tests.user_history_data": [], "model.iterable.iterable__users": ["test.iterable.not_null_iterable__users_unique_user_key.4ca37a26c8"], "model.iterable.iterable__list_user_history": [], "model.iterable.iterable__events": ["model.iterable.iterable__user_campaign", "test.iterable.not_null_iterable__events_event_id.ed1d28a650"], "model.iterable.iterable__user_campaign": ["model.iterable.int_iterable__campaign_event_metrics", "model.iterable.int_iterable__journey_event_metrics", "model.iterable.int_iterable__user_event_metrics"], "model.iterable.iterable__user_unsubscriptions": ["test.iterable.not_null_iterable__user_unsubscriptions_unique_user_key.f8db72932b"], "model.iterable.iterable__journeys": ["test.iterable.not_null_iterable__journeys_journey_id.b5c6b8783a", "test.iterable.unique_iterable__journeys_unique_journey_id.ba86841246"], "model.iterable.iterable__campaigns": ["test.iterable.not_null_iterable__campaigns_campaign_id.03c9448919"], "model.iterable.int_iterable__campaign_labels": ["model.iterable.iterable__campaigns"], "model.iterable.int_iterable__journey_event_metrics": ["model.iterable.iterable__journeys"], "model.iterable.int_iterable__list_user_unnest": ["model.iterable.iterable__list_user_history", "model.iterable.iterable__users"], "model.iterable.int_iterable__latest_template": ["model.iterable.iterable__campaigns", "model.iterable.iterable__events"], "model.iterable.int_iterable__campaign_event_metrics": ["model.iterable.iterable__campaigns"], "model.iterable.int_iterable__campaign_lists": ["model.iterable.iterable__campaigns"], "model.iterable.int_iterable__recurring_campaigns": ["model.iterable.int_iterable__journey_event_metrics", "model.iterable.iterable__campaigns", "model.iterable.iterable__events"], "model.iterable.int_iterable__list_user_history": ["model.iterable.int_iterable__list_user_unnest"], "model.iterable.int_iterable__message_type_channel": ["model.iterable.int_iterable__latest_template", "model.iterable.iterable__events", "model.iterable.iterable__user_unsubscriptions"], "model.iterable.int_iterable__user_event_metrics": ["model.iterable.iterable__users"], "model.iterable.int_iterable__latest_user": ["model.iterable.iterable__events"], "model.iterable.int_iterable__latest_campaign": ["model.iterable.int_iterable__recurring_campaigns"], "model.iterable.stg_iterable__message_type": ["model.iterable.int_iterable__message_type_channel", "test.iterable.not_null_stg_iterable__message_type_message_type_id.75eaa6fa62"], "model.iterable.stg_iterable__event": ["model.iterable.iterable__events", "test.iterable.not_null_stg_iterable__event_event_id.370cd4bc9d", "test.iterable.not_null_stg_iterable__event_unique_event_id.e2b46d3bb6"], "model.iterable.stg_iterable__user_unsubscribed_channel": ["model.iterable.iterable__user_unsubscriptions", "test.iterable.not_null_stg_iterable__user_unsubscribed_channel_channel_id.da0ed9e9be"], "model.iterable.stg_iterable__campaign_history": ["model.iterable.int_iterable__latest_campaign", "test.iterable.not_null_stg_iterable__campaign_history_campaign_id.b7c36e4525"], "model.iterable.stg_iterable__campaign_label_history": ["model.iterable.int_iterable__campaign_labels", "test.iterable.not_null_stg_iterable__campaign_label_history_campaign_id.1918cef89a"], "model.iterable.stg_iterable__template_history": ["model.iterable.int_iterable__latest_template", "test.iterable.not_null_stg_iterable__template_history_template_id.14b24a1dfe"], "model.iterable.stg_iterable__journey": ["model.iterable.iterable__campaigns", "model.iterable.iterable__journeys", "test.iterable.not_null_stg_iterable__journey_journey_id.cc38bd633c"], "model.iterable.stg_iterable__user_history": ["model.iterable.int_iterable__latest_user", "model.iterable.int_iterable__list_user_history", "test.iterable.not_null_stg_iterable__user_history_unique_user_key.2845af2127"], "model.iterable.stg_iterable__user_unsub_message_type": ["model.iterable.iterable__user_unsubscriptions", "test.iterable.not_null_stg_iterable__user_unsub_message_type_message_type_id.268a89ea6f"], "model.iterable.stg_iterable__list": ["model.iterable.iterable__list_user_history", "test.iterable.not_null_stg_iterable__list_list_id.47029d839a"], "model.iterable.stg_iterable__list_user": ["model.iterable.iterable__list_user_history", "model.iterable.iterable__users", "test.iterable.not_null_stg_iterable__list_user__fivetran_user_id.cca4b34c07"], "model.iterable.stg_iterable__campaign_suppression_list_history": ["model.iterable.int_iterable__campaign_lists", "test.iterable.not_null_stg_iterable__campaign_suppression_list_history_campaign_id.3921289710"], "model.iterable.stg_iterable__event_extension": ["model.iterable.iterable__events", "test.iterable.not_null_stg_iterable__event_extension_event_id.144dedcd30"], "model.iterable.stg_iterable__campaign_list_history": ["model.iterable.int_iterable__campaign_lists", "test.iterable.not_null_stg_iterable__campaign_list_history_campaign_id.208f9bf9ed"], "model.iterable.stg_iterable__channel": ["model.iterable.int_iterable__message_type_channel", "test.iterable.not_null_stg_iterable__channel_channel_id.182ceb9636"], "model.iterable.stg_iterable__message_type_tmp": ["model.iterable.stg_iterable__message_type"], "model.iterable.stg_iterable__event_extension_tmp": ["model.iterable.stg_iterable__event_extension"], "model.iterable.stg_iterable__user_unsub_message_type_tmp": ["model.iterable.stg_iterable__user_unsub_message_type"], "model.iterable.stg_iterable__campaign_list_history_tmp": ["model.iterable.stg_iterable__campaign_list_history"], "model.iterable.stg_iterable__list_user_tmp": ["model.iterable.stg_iterable__list_user"], "model.iterable.stg_iterable__user_history_tmp": ["model.iterable.stg_iterable__user_history"], "model.iterable.stg_iterable__campaign_history_tmp": ["model.iterable.stg_iterable__campaign_history"], "model.iterable.stg_iterable__template_history_tmp": ["model.iterable.stg_iterable__template_history"], "model.iterable.stg_iterable__event_tmp": ["model.iterable.stg_iterable__event"], "model.iterable.stg_iterable__journey_tmp": ["model.iterable.stg_iterable__journey"], "model.iterable.stg_iterable__campaign_suppression_list_history_tmp": ["model.iterable.stg_iterable__campaign_suppression_list_history"], "model.iterable.stg_iterable__campaign_label_history_tmp": ["model.iterable.stg_iterable__campaign_label_history"], "model.iterable.stg_iterable__list_tmp": ["model.iterable.stg_iterable__list"], "model.iterable.stg_iterable__channel_tmp": ["model.iterable.stg_iterable__channel"], "model.iterable.stg_iterable__user_unsubscribed_channel_tmp": ["model.iterable.stg_iterable__user_unsubscribed_channel"], "test.iterable.not_null_iterable__campaigns_campaign_id.03c9448919": [], "test.iterable.not_null_iterable__events_event_id.ed1d28a650": [], "test.iterable.not_null_iterable__journeys_journey_id.b5c6b8783a": [], "test.iterable.unique_iterable__journeys_unique_journey_id.ba86841246": [], "test.iterable.not_null_iterable__user_unsubscriptions_unique_user_key.f8db72932b": [], "test.iterable.not_null_iterable__users_unique_user_key.4ca37a26c8": [], "test.iterable.not_null_stg_iterable__campaign_history_campaign_id.b7c36e4525": [], "test.iterable.not_null_stg_iterable__campaign_label_history_campaign_id.1918cef89a": [], "test.iterable.not_null_stg_iterable__campaign_list_history_campaign_id.208f9bf9ed": [], "test.iterable.not_null_stg_iterable__campaign_suppression_list_history_campaign_id.3921289710": [], "test.iterable.not_null_stg_iterable__channel_channel_id.182ceb9636": [], "test.iterable.not_null_stg_iterable__event_event_id.370cd4bc9d": [], "test.iterable.not_null_stg_iterable__event_unique_event_id.e2b46d3bb6": [], "test.iterable.not_null_stg_iterable__event_extension_event_id.144dedcd30": [], "test.iterable.not_null_stg_iterable__journey_journey_id.cc38bd633c": [], "test.iterable.not_null_stg_iterable__list_list_id.47029d839a": [], "test.iterable.not_null_stg_iterable__message_type_message_type_id.75eaa6fa62": [], "test.iterable.not_null_stg_iterable__template_history_template_id.14b24a1dfe": [], "test.iterable.not_null_stg_iterable__list_user__fivetran_user_id.cca4b34c07": [], "test.iterable.not_null_stg_iterable__user_history_unique_user_key.2845af2127": [], "test.iterable.not_null_stg_iterable__user_unsubscribed_channel_channel_id.da0ed9e9be": [], "test.iterable.not_null_stg_iterable__user_unsub_message_type_message_type_id.268a89ea6f": [], "source.iterable.iterable.campaign_history": ["model.iterable.stg_iterable__campaign_history_tmp"], "source.iterable.iterable.campaign_label_history": ["model.iterable.stg_iterable__campaign_label_history_tmp"], "source.iterable.iterable.campaign_list_history": ["model.iterable.stg_iterable__campaign_list_history_tmp"], "source.iterable.iterable.campaign_suppression_list_history": ["model.iterable.stg_iterable__campaign_suppression_list_history_tmp"], "source.iterable.iterable.channel": ["model.iterable.stg_iterable__channel_tmp"], "source.iterable.iterable.event": ["model.iterable.stg_iterable__event_tmp"], "source.iterable.iterable.event_extension": ["model.iterable.stg_iterable__event_extension_tmp"], "source.iterable.iterable.journey": ["model.iterable.stg_iterable__journey_tmp"], "source.iterable.iterable.list": ["model.iterable.stg_iterable__list_tmp"], "source.iterable.iterable.message_type": ["model.iterable.stg_iterable__message_type_tmp"], "source.iterable.iterable.template_history": ["model.iterable.stg_iterable__template_history_tmp"], "source.iterable.iterable.user_history": ["model.iterable.stg_iterable__user_history_tmp"], "source.iterable.iterable.user_unsubscribed_channel": [], "source.iterable.iterable.user_unsubscribed_message_type": [], "source.iterable.iterable.user_unsubscribed_channel_history": ["model.iterable.stg_iterable__user_unsubscribed_channel_tmp"], "source.iterable.iterable.user_unsubscribed_message_type_history": ["model.iterable.stg_iterable__user_unsub_message_type_tmp"], "source.iterable.iterable.list_user": ["model.iterable.stg_iterable__list_user_tmp"]}, "group_map": {}, "saved_queries": {}, "semantic_models": {}, "unit_tests": {}, "functions": {}} \ No newline at end of file From 40c8f71056af3b0bb6b2389ab66279bbb4293ec9 Mon Sep 17 00:00:00 2001 From: Savage Fivetran Date: Thu, 10 Sep 2026 15:51:42 -0700 Subject: [PATCH 03/11] add_data_to_vars --- integration_tests/dbt_project.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/integration_tests/dbt_project.yml b/integration_tests/dbt_project.yml index 0464478..7dbbba7 100644 --- a/integration_tests/dbt_project.yml +++ b/integration_tests/dbt_project.yml @@ -12,6 +12,7 @@ vars: iterable_channel_identifier: "channel_data" iterable_event_identifier: "event_data" iterable_event_extension_identifier: "event_extension_data" + iterable_journey_identifier: "journey_data" iterable_list_identifier: "list_data" iterable_list_user_identifier: "list_user_data" iterable_message_type_identifier: "message_type_data" From 19cefcdfedad85731ce8b35e1c1ba58bafb6add3 Mon Sep 17 00:00:00 2001 From: Savage Fivetran Date: Mon, 14 Sep 2026 14:02:57 -0700 Subject: [PATCH 04/11] remove_rate_calculations --- CHANGELOG.md | 5 +- integration_tests/seeds/journey_data.csv | 11 +++-- .../int_iterable__journey_event_metrics.sql | 3 +- models/iterable.yml | 48 ++++++++----------- models/iterable__journeys.sql | 33 +------------ 5 files changed, 32 insertions(+), 68 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0355e21..8f0e7d9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,15 +3,16 @@ [PR #84](https://github.com/fivetran/dbt_iterable/pull/84) includes the following updates: ## Schema/Data Change -**5 total changes • 0 possible breaking changes** +**6 total changes • 0 possible breaking changes** | Data Model(s) | Change type | Old | New | Notes | | ------------- | ----------- | --- | --- | ----- | -| `iterable__journeys` | New model | | | Journey-grain rollup of engagement metrics, unique users, and derived rates. | +| `iterable__journeys` | New model | | | Journey-grain rollup of engagement metrics and unique users. | | `iterable__campaigns` | New fields | | `journey_id`, `journey_name`, `journey_type` | | | `int_iterable__journey_event_metrics` | New model | | | Aggregates campaign engagement metrics to the journey grain. | | `int_iterable__recurring_campaigns` | New field | | `journey_id` | | | `stg_iterable__journey` | New model | | | Staging model for the new `journey` source table. | +| `stg_iterable__journey_tmp` | New model | | | Temporary staging model for the new `journey` source table. | # dbt_iterable v1.5.1 diff --git a/integration_tests/seeds/journey_data.csv b/integration_tests/seeds/journey_data.csv index 1c37ea0..3c7b2c1 100644 --- a/integration_tests/seeds/journey_data.csv +++ b/integration_tests/seeds/journey_data.csv @@ -1,5 +1,6 @@ -id,name,journey_type,description,creator_user_id,enabled,is_archived,lifetime_limit,simultaneous_limit,start_tile_id,trigger_event_names,created_at,updated_at,_fivetran_synced,draft_name -157274,Welcome Series,Triggered,Onboarding sequence sent to new subscribers over their first week,jimmy.neutron@goddard.com,true,false,1,1,44001,"[""signUp""]",2021-06-01 09:14:22.000,2021-06-11 13:30:58.412,2021-06-11 13:32:03.771,Welcome Series draft -28801,Automation,Triggered,Behavioral automation triggered by in-app activity,jimmy.neutron@goddard.com,true,false,5,2,44002,"[""customEvent"",""emailOpen""]",2021-05-18 11:02:47.000,2021-06-09 17:45:10.220,2021-06-11 13:32:03.771,Automation draft -83250,Workflow - Survey,Blast,Post-purchase survey invitation,carl.wheezer@goddard.com,true,false,,1,44003,"[""purchase""]",2021-04-27 15:39:05.000,2021-06-02 08:21:36.905,2021-06-11 13:32:03.771, -900001,Audience Split - Dormant Users,Triggered,Splits dormant users into re-engagement branches and updates their profile fields. Sends no messages.,carl.wheezer@goddard.com,false,true,,,44004,[],2021-03-15 10:00:00.000,2021-05-20 12:11:44.310,2021-06-11 13:32:03.771, +id,name,journey_type,description,creator_user_id,enabled,is_archived,lifetime_limit,simultaneous_limit,start_tile_id,trigger_event_names,created_at,updated_at,_fivetran_deleted,_fivetran_synced,draft_name +157274,Welcome Series,Triggered,Onboarding sequence sent to new subscribers over their first week,jimmy.neutron@goddard.com,true,false,1,1,44001,"[""signUp""]",2021-06-01 09:14:22.000,2021-06-11 13:30:58.412,FALSE,2021-06-11 13:32:03.771,Welcome Series draft +28801,Automation,Triggered,Behavioral automation triggered by in-app activity,jimmy.neutron@goddard.com,true,false,5,2,44002,"[""customEvent"",""emailOpen""]",2021-05-18 11:02:47.000,2021-06-09 17:45:10.220,FALSE,2021-06-11 13:32:03.771,Automation draft +83250,Workflow - Survey,Blast,Post-purchase survey invitation,carl.wheezer@goddard.com,true,false,,1,44003,"[""purchase""]",2021-04-27 15:39:05.000,2021-06-02 08:21:36.905,FALSE,2021-06-11 13:32:03.771, +900001,Audience Split - Dormant Users,Triggered,Splits dormant users into re-engagement branches and updates their profile fields. Sends no messages.,carl.wheezer@goddard.com,false,true,,,44004,[],2021-03-15 10:00:00.000,2021-05-20 12:11:44.310,FALSE,2021-06-11 13:32:03.771, +900002,Deleted Journey,Triggered,Journey deleted in the source and excluded from staging output,carl.wheezer@goddard.com,false,false,,,44005,"[""signUp""]",2021-02-08 08:45:12.000,2021-04-02 16:20:31.118,TRUE,2021-06-11 13:32:03.771, diff --git a/models/intermediate/int_iterable__journey_event_metrics.sql b/models/intermediate/int_iterable__journey_event_metrics.sql index 25d5409..1f96fee 100644 --- a/models/intermediate/int_iterable__journey_event_metrics.sql +++ b/models/intermediate/int_iterable__journey_event_metrics.sql @@ -31,7 +31,8 @@ with user_campaign as ( max(user_campaign.last_event_at) as last_event_at {% for col in user_campaign_columns if col.name|lower not in non_agg_columns %} , sum(user_campaign.{{ col.name }}) as {{ col.name }} - , count(distinct case when user_campaign.{{ col.name }} > 0 then user_campaign.user_email else null end) as unique_{{ col.name }} + -- counts distinct users; campaign_event_metrics counts distinct emails + , count(distinct case when user_campaign.{{ col.name }} > 0 then user_campaign.unique_user_key else null end) as unique_{{ col.name }} {% endfor %} from user_campaign diff --git a/models/iterable.yml b/models/iterable.yml index 9dc6354..863935f 100644 --- a/models/iterable.yml +++ b/models/iterable.yml @@ -364,91 +364,83 @@ models: - name: total_emailclick description: Total email clicks within the journey - name: unique_total_emailclick - description: Unique email clicks within the journey + description: Count of distinct users with email clicks within the journey - name: total_emailunsubscribe description: Total email unsubscribe events within the journey - name: unique_total_emailunsubscribe - description: Unique total email unsubscribe events within the journey + description: Count of distinct users with email unsubscribe events within the journey - name: total_emailcomplaint description: Total email complaints within the journey - name: unique_total_emailcomplaint - description: Unique total email complaints within the journey + description: Count of distinct users with email complaints within the journey - name: total_customevent description: Total custom events within the journey - name: unique_total_customevent - description: Unique total custom events within the journey + description: Count of distinct users with custom events within the journey - name: total_emailsubscribe description: Total email subscribe events within the journey - name: unique_total_emailsubscribe - description: Unique total email subscribe events within the journey + description: Count of distinct users with email subscribe events within the journey - name: total_emailopen description: Total email open events within the journey - name: unique_total_emailopen - description: Unique total email open events within the journey + description: Count of distinct users with email open events within the journey - name: total_pushsend description: Total push send events within the journey - name: unique_total_pushsend - description: Unique total push send events within the journey + description: Count of distinct users with push send events within the journey - name: total_smsbounce description: Total sms bounce events within the journey - name: unique_total_smsbounce - description: Unique total sms bounce events within the journey + description: Count of distinct users with sms bounce events within the journey - name: total_pushbounce description: Total push bounce events within the journey - name: unique_total_pushbounce - description: Unique total push bounce events within the journey + description: Count of distinct users with push bounce events within the journey - name: total_inappsendskip description: Total in app send skip events within the journey - name: unique_total_inappsendskip - description: Unique total in app send skip events within the journey + description: Count of distinct users with in app send skip events within the journey - name: total_smssend description: Total sms send events within the journey - name: unique_total_smssend - description: Unique total sms send events within the journey + description: Count of distinct users with sms send events within the journey - name: total_inappsend description: Total in app send events within the journey - name: unique_total_inappsend - description: Unique total in app send events within the journey + description: Count of distinct users with in app send events within the journey - name: total_pushopen description: Total push open events within the journey - name: unique_total_pushopen - description: Unique total push open events within the journey + description: Count of distinct users with push open events within the journey - name: total_emailsend description: Total email send events within the journey - name: unique_total_emailsend - description: Unique total email send events within the journey + description: Count of distinct users with email send events within the journey - name: total_pushsendskip description: Total push send skip events within the journey - name: unique_total_pushsendskip - description: Unique total push send skip events within the journey + description: Count of distinct users with push send skip events within the journey - name: total_inappopen description: Total in app open events within the journey - name: unique_total_inappopen - description: Unique total in app open events within the journey + description: Count of distinct users with in app open events within the journey - name: total_emailsendskip description: Total email send skip events within the journey - name: unique_total_emailsendskip - description: Unique total email send skip events within the journey + description: Count of distinct users with email send skip events within the journey - name: total_emailbounce description: Total email bounce events within the journey - name: unique_total_emailbounce - description: Unique total email bounce events within the journey + description: Count of distinct users with email bounce events within the journey - name: total_inappclick description: Total in app click events within the journey - name: unique_total_inappclick - description: Unique total in app click events within the journey + description: Count of distinct users with in app click events within the journey - name: total_pushuninstall description: Total push uninstall events within the journey - name: unique_total_pushuninstall - description: Unique total push uninstall events within the journey - - name: email_open_rate - description: Share of emails sent within the journey that were opened. Only present when both emailSend and emailOpen are included in the `iterable__event_metrics` variable. - - name: email_click_rate - description: Share of emails sent within the journey that were clicked. Only present when both emailSend and emailClick are included in the `iterable__event_metrics` variable. - - name: email_bounce_rate - description: Share of emails sent within the journey that bounced. Only present when both emailSend and emailBounce are included in the `iterable__event_metrics` variable. - - name: email_unsubscribe_rate - description: Share of emails sent within the journey that resulted in an unsubscribe. Only present when both emailSend and emailUnSubscribe are included in the `iterable__event_metrics` variable. + description: Count of distinct users with push uninstall events within the journey - name: iterable__list_user_history description: > diff --git a/models/iterable__journeys.sql b/models/iterable__journeys.sql index 2afc24b..a86e092 100644 --- a/models/iterable__journeys.sql +++ b/models/iterable__journeys.sql @@ -1,7 +1,5 @@ {{ config(enabled=var('iterable__using_journey', True)) }} -{%- set event_metrics = var('iterable__event_metrics') | map('lower') | list %} - with journey as ( select * @@ -28,35 +26,6 @@ with journey as ( on journey.journey_id = journey_metrics.journey_id and journey.source_relation = journey_metrics.source_relation -), add_rates as ( - - -- Engagement rates as a share of emails sent. Each rate is emitted only when both its - -- numerator and denominator events are present in the `iterable__event_metrics` variable, - -- since that list is user-configurable and may not include every email event. - {%- set rate_expressions = [] %} - {%- if 'emailsend' in event_metrics %} - {%- if 'emailopen' in event_metrics %} - {%- do rate_expressions.append('total_emailopen / nullif(total_emailsend, 0) as email_open_rate') %} - {%- endif %} - {%- if 'emailclick' in event_metrics %} - {%- do rate_expressions.append('total_emailclick / nullif(total_emailsend, 0) as email_click_rate') %} - {%- endif %} - {%- if 'emailbounce' in event_metrics %} - {%- do rate_expressions.append('total_emailbounce / nullif(total_emailsend, 0) as email_bounce_rate') %} - {%- endif %} - {%- if 'emailunsubscribe' in event_metrics %} - {%- do rate_expressions.append('total_emailunsubscribe / nullif(total_emailsend, 0) as email_unsubscribe_rate') %} - {%- endif %} - {%- endif %} - - select - * - {% for rate in rate_expressions %} - , {{ rate }} - {% endfor %} - - from journey_join - ), add_surrogate_key as ( {% set surrogate_key_fields = ['journey_id', 'source_relation'] %} @@ -65,7 +34,7 @@ with journey as ( *, {{ dbt_utils.generate_surrogate_key(surrogate_key_fields) }} as unique_journey_id - from add_rates + from journey_join ) select * From 0a66a5341c1eef7a8820abe29b70065788489f93 Mon Sep 17 00:00:00 2001 From: fivetran-data-model-bot Date: Mon, 14 Sep 2026 21:06:23 +0000 Subject: [PATCH 05/11] Generate dbt docs via GitHub Actions --- docs/catalog.json | 2 +- docs/manifest.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/catalog.json b/docs/catalog.json index 3b436ff..2e33b6e 100644 --- a/docs/catalog.json +++ b/docs/catalog.json @@ -1 +1 @@ -{"metadata": {"dbt_schema_version": "https://schemas.getdbt.com/dbt/catalog/v1.json", "dbt_version": "1.12.4", "generated_at": "2026-09-10T22:23:30.455429Z", "invocation_id": "5d6e507e-b2ab-4c2e-82a3-c9b3883d2ddc", "invocation_started_at": "2026-09-10T22:23:28.447126Z", "env": {}}, "nodes": {"seed.iterable_integration_tests.campaign_history_data": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "campaign_history_data", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"id": {"type": "integer", "index": 1, "name": "id", "comment": null}, "updated_at": {"type": "text", "index": 2, "name": "updated_at", "comment": null}, "template_id": {"type": "integer", "index": 3, "name": "template_id", "comment": null}, "recurring_campaign_id": {"type": "integer", "index": 4, "name": "recurring_campaign_id", "comment": null}, "campaign_state": {"type": "text", "index": 5, "name": "campaign_state", "comment": null}, "created_at": {"type": "text", "index": 6, "name": "created_at", "comment": null}, "created_by_user_id": {"type": "text", "index": 7, "name": "created_by_user_id", "comment": null}, "ended_at": {"type": "integer", "index": 8, "name": "ended_at", "comment": null}, "name": {"type": "text", "index": 9, "name": "name", "comment": null}, "send_size": {"type": "integer", "index": 10, "name": "send_size", "comment": null}, "start_at": {"type": "integer", "index": 11, "name": "start_at", "comment": null}, "type": {"type": "text", "index": 12, "name": "type", "comment": null}, "workflow_id": {"type": "integer", "index": 13, "name": "workflow_id", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 14, "name": "_fivetran_synced", "comment": null}, "updated_by_user_id": {"type": "integer", "index": 15, "name": "updated_by_user_id", "comment": null}, "message_medium": {"type": "text", "index": 16, "name": "message_medium", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.iterable_integration_tests.campaign_history_data"}, "seed.iterable_integration_tests.campaign_label_history_data": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "campaign_label_history_data", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"campaign_id": {"type": "integer", "index": 1, "name": "campaign_id", "comment": null}, "label": {"type": "text", "index": 2, "name": "label", "comment": null}, "updated_at": {"type": "text", "index": 3, "name": "updated_at", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 4, "name": "_fivetran_synced", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.iterable_integration_tests.campaign_label_history_data"}, "seed.iterable_integration_tests.campaign_list_history_data": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "campaign_list_history_data", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"list_id": {"type": "integer", "index": 1, "name": "list_id", "comment": null}, "campaign_id": {"type": "integer", "index": 2, "name": "campaign_id", "comment": null}, "updated_at": {"type": "text", "index": 3, "name": "updated_at", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 4, "name": "_fivetran_synced", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.iterable_integration_tests.campaign_list_history_data"}, "seed.iterable_integration_tests.campaign_metrics_data": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "campaign_metrics_data", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"date": {"type": "date", "index": 1, "name": "date", "comment": null}, "id": {"type": "integer", "index": 2, "name": "id", "comment": null}, "_fivetran_deleted": {"type": "boolean", "index": 3, "name": "_fivetran_deleted", "comment": null}, "average_order_value": {"type": "integer", "index": 4, "name": "average_order_value", "comment": null}, "purchases": {"type": "integer", "index": 5, "name": "purchases", "comment": null}, "revenue": {"type": "integer", "index": 6, "name": "revenue", "comment": null}, "revenue_m": {"type": "integer", "index": 7, "name": "revenue_m", "comment": null}, "total_app_uninstalls": {"type": "integer", "index": 8, "name": "total_app_uninstalls", "comment": null}, "total_complaints": {"type": "integer", "index": 9, "name": "total_complaints", "comment": null}, "total_email_bounced": {"type": "integer", "index": 10, "name": "total_email_bounced", "comment": null}, "total_email_clicked": {"type": "integer", "index": 11, "name": "total_email_clicked", "comment": null}, "total_email_delivered": {"type": "integer", "index": 12, "name": "total_email_delivered", "comment": null}, "total_email_opens": {"type": "integer", "index": 13, "name": "total_email_opens", "comment": null}, "total_email_sends": {"type": "integer", "index": 14, "name": "total_email_sends", "comment": null}, "total_hosted_unsubscribe_clicks": {"type": "integer", "index": 15, "name": "total_hosted_unsubscribe_clicks", "comment": null}, "total_purchases": {"type": "integer", "index": 16, "name": "total_purchases", "comment": null}, "total_pushes_bounced": {"type": "integer", "index": 17, "name": "total_pushes_bounced", "comment": null}, "total_pushes_delivered": {"type": "integer", "index": 18, "name": "total_pushes_delivered", "comment": null}, "total_pushes_opened": {"type": "integer", "index": 19, "name": "total_pushes_opened", "comment": null}, "total_pushes_sent": {"type": "integer", "index": 20, "name": "total_pushes_sent", "comment": null}, "total_unsubscribes": {"type": "integer", "index": 21, "name": "total_unsubscribes", "comment": null}, "unique_email_bounced": {"type": "integer", "index": 22, "name": "unique_email_bounced", "comment": null}, "unique_email_clicks": {"type": "integer", "index": 23, "name": "unique_email_clicks", "comment": null}, "unique_email_opens_or_clicks": {"type": "integer", "index": 24, "name": "unique_email_opens_or_clicks", "comment": null}, "unique_hosted_unsubscribe_clicks": {"type": "integer", "index": 25, "name": "unique_hosted_unsubscribe_clicks", "comment": null}, "unique_purchases": {"type": "integer", "index": 26, "name": "unique_purchases", "comment": null}, "unique_pushes_bounced": {"type": "integer", "index": 27, "name": "unique_pushes_bounced", "comment": null}, "unique_pushes_opened": {"type": "integer", "index": 28, "name": "unique_pushes_opened", "comment": null}, "unique_pushes_sent": {"type": "integer", "index": 29, "name": "unique_pushes_sent", "comment": null}, "unique_unsubscribes": {"type": "integer", "index": 30, "name": "unique_unsubscribes", "comment": null}, "total_push_send_skips": {"type": "integer", "index": 31, "name": "total_push_send_skips", "comment": null}, "total_in_app_opens": {"type": "integer", "index": 32, "name": "total_in_app_opens", "comment": null}, "unique_in_apps_delivered": {"type": "integer", "index": 33, "name": "unique_in_apps_delivered", "comment": null}, "unique_in_app_sends": {"type": "integer", "index": 34, "name": "unique_in_app_sends", "comment": null}, "total_in_app_closes": {"type": "integer", "index": 35, "name": "total_in_app_closes", "comment": null}, "total_inbox_impressions": {"type": "integer", "index": 36, "name": "total_inbox_impressions", "comment": null}, "unique_pushes_delivered": {"type": "integer", "index": 37, "name": "unique_pushes_delivered", "comment": null}, "unique_in_app_clicks": {"type": "integer", "index": 38, "name": "unique_in_app_clicks", "comment": null}, "unique_emails_delivered": {"type": "integer", "index": 39, "name": "unique_emails_delivered", "comment": null}, "total_in_app_clicks": {"type": "integer", "index": 40, "name": "total_in_app_clicks", "comment": null}, "total_in_app_deletes": {"type": "integer", "index": 41, "name": "total_in_app_deletes", "comment": null}, "total_in_app_sent": {"type": "integer", "index": 42, "name": "total_in_app_sent", "comment": null}, "total_in_apps_delivered": {"type": "integer", "index": 43, "name": "total_in_apps_delivered", "comment": null}, "unique_in_app_opens": {"type": "integer", "index": 44, "name": "unique_in_app_opens", "comment": null}, "total_email_holdout": {"type": "integer", "index": 45, "name": "total_email_holdout", "comment": null}, "total_email_send_skips": {"type": "integer", "index": 46, "name": "total_email_send_skips", "comment": null}, "unique_email_sends": {"type": "integer", "index": 47, "name": "unique_email_sends", "comment": null}, "unique_emails_opens": {"type": "integer", "index": 48, "name": "unique_emails_opens", "comment": null}, "total_in_app_holdout": {"type": "integer", "index": 49, "name": "total_in_app_holdout", "comment": null}, "total_in_app_send_skips": {"type": "integer", "index": 50, "name": "total_in_app_send_skips", "comment": null}, "total_push_holdout": {"type": "integer", "index": 51, "name": "total_push_holdout", "comment": null}, "_fivetran_synced": {"type": "text", "index": 52, "name": "_fivetran_synced", "comment": null}, "total_sms_holdout": {"type": "integer", "index": 53, "name": "total_sms_holdout", "comment": null}, "unique_sms_sent": {"type": "integer", "index": 54, "name": "unique_sms_sent", "comment": null}, "total_sms_delivered": {"type": "integer", "index": 55, "name": "total_sms_delivered", "comment": null}, "total_sms_sent": {"type": "integer", "index": 56, "name": "total_sms_sent", "comment": null}, "total_inbound_sms": {"type": "integer", "index": 57, "name": "total_inbound_sms", "comment": null}, "total_sms_bounced": {"type": "integer", "index": 58, "name": "total_sms_bounced", "comment": null}, "total_sms_send_skips": {"type": "integer", "index": 59, "name": "total_sms_send_skips", "comment": null}, "unique_inbound_sms": {"type": "integer", "index": 60, "name": "unique_inbound_sms", "comment": null}, "unique_sms_delivered": {"type": "integer", "index": 61, "name": "unique_sms_delivered", "comment": null}, "unique_sms_bounced": {"type": "integer", "index": 62, "name": "unique_sms_bounced", "comment": null}, "revenue_m_sms_": {"type": "integer", "index": 63, "name": "revenue_m_sms_", "comment": null}, "purchases_m_sms_": {"type": "integer", "index": 64, "name": "purchases_m_sms_", "comment": null}, "purchases_m_email_": {"type": "integer", "index": 65, "name": "purchases_m_email_", "comment": null}, "revenue_m_push_": {"type": "integer", "index": 66, "name": "revenue_m_push_", "comment": null}, "revenue_m_email_": {"type": "integer", "index": 67, "name": "revenue_m_email_", "comment": null}, "purchases_m_push_": {"type": "integer", "index": 68, "name": "purchases_m_push_", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.iterable_integration_tests.campaign_metrics_data"}, "seed.iterable_integration_tests.campaign_suppression_list_history_data": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "campaign_suppression_list_history_data", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"suppressed_list_id": {"type": "integer", "index": 1, "name": "suppressed_list_id", "comment": null}, "campaign_id": {"type": "integer", "index": 2, "name": "campaign_id", "comment": null}, "updated_at": {"type": "text", "index": 3, "name": "updated_at", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 4, "name": "_fivetran_synced", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.iterable_integration_tests.campaign_suppression_list_history_data"}, "seed.iterable_integration_tests.channel_data": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "channel_data", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"id": {"type": "bigint", "index": 1, "name": "id", "comment": null}, "name": {"type": "text", "index": 2, "name": "name", "comment": null}, "channel_type": {"type": "text", "index": 3, "name": "channel_type", "comment": null}, "message_medium": {"type": "text", "index": 4, "name": "message_medium", "comment": null}, "_fivetran_deleted": {"type": "boolean", "index": 5, "name": "_fivetran_deleted", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 6, "name": "_fivetran_synced", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.iterable_integration_tests.channel_data"}, "seed.iterable_integration_tests.event_data": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "event_data", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"_fivetran_id": {"type": "text", "index": 1, "name": "_fivetran_id", "comment": null}, "email": {"type": "text", "index": 2, "name": "email", "comment": null}, "campaign_id": {"type": "integer", "index": 3, "name": "campaign_id", "comment": null}, "message_id": {"type": "integer", "index": 4, "name": "message_id", "comment": null}, "content_id": {"type": "integer", "index": 5, "name": "content_id", "comment": null}, "created_at": {"type": "timestamp without time zone", "index": 6, "name": "created_at", "comment": null}, "event_name": {"type": "text", "index": 7, "name": "event_name", "comment": null}, "ip": {"type": "integer", "index": 8, "name": "ip", "comment": null}, "message_bus_id": {"type": "integer", "index": 9, "name": "message_bus_id", "comment": null}, "message_type_id": {"type": "integer", "index": 10, "name": "message_type_id", "comment": null}, "recipient_state": {"type": "integer", "index": 11, "name": "recipient_state", "comment": null}, "status": {"type": "integer", "index": 12, "name": "status", "comment": null}, "unsub_source": {"type": "integer", "index": 13, "name": "unsub_source", "comment": null}, "user_agent": {"type": "integer", "index": 14, "name": "user_agent", "comment": null}, "user_agent_device": {"type": "integer", "index": 15, "name": "user_agent_device", "comment": null}, "transactional_data": {"type": "character varying(100)", "index": 16, "name": "transactional_data", "comment": null}, "additional_properties": {"type": "text", "index": 17, "name": "additional_properties", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 18, "name": "_fivetran_synced", "comment": null}, "_fivetran_user_id": {"type": "integer", "index": 19, "name": "_fivetran_user_id", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.iterable_integration_tests.event_data"}, "seed.iterable_integration_tests.event_extension_data": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "event_extension_data", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"_fivetran_id": {"type": "text", "index": 1, "name": "_fivetran_id", "comment": null}, "app_already_running": {"type": "integer", "index": 2, "name": "app_already_running", "comment": null}, "badge": {"type": "integer", "index": 3, "name": "badge", "comment": null}, "canonical_url_id": {"type": "integer", "index": 4, "name": "canonical_url_id", "comment": null}, "content_available": {"type": "integer", "index": 5, "name": "content_available", "comment": null}, "content_id": {"type": "integer", "index": 6, "name": "content_id", "comment": null}, "device": {"type": "integer", "index": 7, "name": "device", "comment": null}, "email_id": {"type": "text", "index": 8, "name": "email_id", "comment": null}, "email_subject": {"type": "text", "index": 9, "name": "email_subject", "comment": null}, "experiment_id": {"type": "integer", "index": 10, "name": "experiment_id", "comment": null}, "from_phone_number_id": {"type": "integer", "index": 11, "name": "from_phone_number_id", "comment": null}, "from_smssender_id": {"type": "integer", "index": 12, "name": "from_smssender_id", "comment": null}, "image_url": {"type": "integer", "index": 13, "name": "image_url", "comment": null}, "is_ghost_push": {"type": "integer", "index": 14, "name": "is_ghost_push", "comment": null}, "link_id": {"type": "integer", "index": 15, "name": "link_id", "comment": null}, "link_url": {"type": "integer", "index": 16, "name": "link_url", "comment": null}, "platform_endpoint": {"type": "integer", "index": 17, "name": "platform_endpoint", "comment": null}, "push_message": {"type": "integer", "index": 18, "name": "push_message", "comment": null}, "region": {"type": "text", "index": 19, "name": "region", "comment": null}, "sms_message": {"type": "integer", "index": 20, "name": "sms_message", "comment": null}, "sound": {"type": "integer", "index": 21, "name": "sound", "comment": null}, "to_phone_number": {"type": "integer", "index": 22, "name": "to_phone_number", "comment": null}, "url": {"type": "integer", "index": 23, "name": "url", "comment": null}, "workflow_id": {"type": "integer", "index": 24, "name": "workflow_id", "comment": null}, "workflow_name": {"type": "text", "index": 25, "name": "workflow_name", "comment": null}, "locale": {"type": "integer", "index": 26, "name": "locale", "comment": null}, "deeplink_android": {"type": "integer", "index": 27, "name": "deeplink_android", "comment": null}, "deeplink_ios": {"type": "integer", "index": 28, "name": "deeplink_ios", "comment": null}, "payload": {"type": "character varying(100)", "index": 29, "name": "payload", "comment": null}, "sms_provider_response_status": {"type": "integer", "index": 30, "name": "sms_provider_response_status", "comment": null}, "sms_provider_response_message": {"type": "integer", "index": 31, "name": "sms_provider_response_message", "comment": null}, "sms_provider_response_code": {"type": "integer", "index": 32, "name": "sms_provider_response_code", "comment": null}, "sms_provider_response_more_info": {"type": "integer", "index": 33, "name": "sms_provider_response_more_info", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 34, "name": "_fivetran_synced", "comment": null}, "catalog_collection_count": {"type": "integer", "index": 35, "name": "catalog_collection_count", "comment": null}, "catalog_lookup_count": {"type": "integer", "index": 36, "name": "catalog_lookup_count", "comment": null}, "city": {"type": "text", "index": 37, "name": "city", "comment": null}, "clicked_url": {"type": "text", "index": 38, "name": "clicked_url", "comment": null}, "country": {"type": "text", "index": 39, "name": "country", "comment": null}, "error_code": {"type": "integer", "index": 40, "name": "error_code", "comment": null}, "expires_at": {"type": "text", "index": 41, "name": "expires_at", "comment": null}, "from_phone_number": {"type": "integer", "index": 42, "name": "from_phone_number", "comment": null}, "in_app_body": {"type": "text", "index": 43, "name": "in_app_body", "comment": null}, "is_sms_estimation": {"type": "boolean", "index": 44, "name": "is_sms_estimation", "comment": null}, "labels": {"type": "text", "index": 45, "name": "labels", "comment": null}, "message_context": {"type": "text", "index": 46, "name": "message_context", "comment": null}, "message_status": {"type": "text", "index": 47, "name": "message_status", "comment": null}, "mms_send_count": {"type": "integer", "index": 48, "name": "mms_send_count", "comment": null}, "product_recommendation_count": {"type": "integer", "index": 49, "name": "product_recommendation_count", "comment": null}, "proxy_source": {"type": "text", "index": 50, "name": "proxy_source", "comment": null}, "reason": {"type": "text", "index": 51, "name": "reason", "comment": null}, "sms_send_count": {"type": "integer", "index": 52, "name": "sms_send_count", "comment": null}, "web_push_body": {"type": "text", "index": 53, "name": "web_push_body", "comment": null}, "web_push_click_action": {"type": "text", "index": 54, "name": "web_push_click_action", "comment": null}, "web_push_icon": {"type": "text", "index": 55, "name": "web_push_icon", "comment": null}, "web_push_message": {"type": "text", "index": 56, "name": "web_push_message", "comment": null}, "_fivetran_user_id": {"type": "integer", "index": 57, "name": "_fivetran_user_id", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.iterable_integration_tests.event_extension_data"}, "seed.iterable_integration_tests.journey_data": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "journey_data", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"id": {"type": "bigint", "index": 1, "name": "id", "comment": null}, "name": {"type": "text", "index": 2, "name": "name", "comment": null}, "journey_type": {"type": "text", "index": 3, "name": "journey_type", "comment": null}, "description": {"type": "text", "index": 4, "name": "description", "comment": null}, "creator_user_id": {"type": "text", "index": 5, "name": "creator_user_id", "comment": null}, "enabled": {"type": "boolean", "index": 6, "name": "enabled", "comment": null}, "is_archived": {"type": "boolean", "index": 7, "name": "is_archived", "comment": null}, "lifetime_limit": {"type": "bigint", "index": 8, "name": "lifetime_limit", "comment": null}, "simultaneous_limit": {"type": "bigint", "index": 9, "name": "simultaneous_limit", "comment": null}, "start_tile_id": {"type": "bigint", "index": 10, "name": "start_tile_id", "comment": null}, "trigger_event_names": {"type": "text", "index": 11, "name": "trigger_event_names", "comment": null}, "created_at": {"type": "timestamp without time zone", "index": 12, "name": "created_at", "comment": null}, "updated_at": {"type": "timestamp without time zone", "index": 13, "name": "updated_at", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 14, "name": "_fivetran_synced", "comment": null}, "draft_name": {"type": "text", "index": 15, "name": "draft_name", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.iterable_integration_tests.journey_data"}, "seed.iterable_integration_tests.list_data": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "list_data", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"id": {"type": "integer", "index": 1, "name": "id", "comment": null}, "name": {"type": "text", "index": 2, "name": "name", "comment": null}, "created_at": {"type": "text", "index": 3, "name": "created_at", "comment": null}, "list_type": {"type": "text", "index": 4, "name": "list_type", "comment": null}, "_fivetran_deleted": {"type": "boolean", "index": 5, "name": "_fivetran_deleted", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 6, "name": "_fivetran_synced", "comment": null}, "description": {"type": "text", "index": 7, "name": "description", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.iterable_integration_tests.list_data"}, "seed.iterable_integration_tests.list_user_data": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "list_user_data", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"_fivetran_id": {"type": "text", "index": 1, "name": "_fivetran_id", "comment": null}, "index": {"type": "bigint", "index": 2, "name": "index", "comment": null}, "list_id": {"type": "bigint", "index": 3, "name": "list_id", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 4, "name": "_fivetran_synced", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.iterable_integration_tests.list_user_data"}, "seed.iterable_integration_tests.message_type_data": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "message_type_data", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"id": {"type": "bigint", "index": 1, "name": "id", "comment": null}, "name": {"type": "text", "index": 2, "name": "name", "comment": null}, "channel_id": {"type": "bigint", "index": 3, "name": "channel_id", "comment": null}, "_fivetran_deleted": {"type": "boolean", "index": 4, "name": "_fivetran_deleted", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 5, "name": "_fivetran_synced", "comment": null}, "created_at": {"type": "timestamp without time zone", "index": 6, "name": "created_at", "comment": null}, "frequency_cap": {"type": "integer", "index": 7, "name": "frequency_cap", "comment": null}, "rate_limit_per_minute": {"type": "integer", "index": 8, "name": "rate_limit_per_minute", "comment": null}, "subscription_policy": {"type": "text", "index": 9, "name": "subscription_policy", "comment": null}, "updated_at": {"type": "timestamp without time zone", "index": 10, "name": "updated_at", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.iterable_integration_tests.message_type_data"}, "seed.iterable_integration_tests.template_history_data": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "template_history_data", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"id": {"type": "integer", "index": 1, "name": "id", "comment": null}, "updated_at": {"type": "text", "index": 2, "name": "updated_at", "comment": null}, "message_type_id": {"type": "integer", "index": 3, "name": "message_type_id", "comment": null}, "client_template_id": {"type": "integer", "index": 4, "name": "client_template_id", "comment": null}, "created_at": {"type": "text", "index": 5, "name": "created_at", "comment": null}, "creator_user_id": {"type": "text", "index": 6, "name": "creator_user_id", "comment": null}, "name": {"type": "text", "index": 7, "name": "name", "comment": null}, "template_type": {"type": "text", "index": 8, "name": "template_type", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 9, "name": "_fivetran_synced", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.iterable_integration_tests.template_history_data"}, "seed.iterable_integration_tests.user_history_bq_json_data": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "user_history_bq_json_data", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"email": {"type": "text", "index": 1, "name": "email", "comment": null}, "updated_at": {"type": "text", "index": 2, "name": "updated_at", "comment": null}, "first_name": {"type": "integer", "index": 3, "name": "first_name", "comment": null}, "last_name": {"type": "integer", "index": 4, "name": "last_name", "comment": null}, "phone_number": {"type": "integer", "index": 5, "name": "phone_number", "comment": null}, "user_id": {"type": "integer", "index": 6, "name": "user_id", "comment": null}, "signup_date": {"type": "text", "index": 7, "name": "signup_date", "comment": null}, "signup_source": {"type": "text", "index": 8, "name": "signup_source", "comment": null}, "phone_number_carrier": {"type": "integer", "index": 9, "name": "phone_number_carrier", "comment": null}, "phone_number_country_code_iso": {"type": "integer", "index": 10, "name": "phone_number_country_code_iso", "comment": null}, "phone_number_line_type": {"type": "integer", "index": 11, "name": "phone_number_line_type", "comment": null}, "phone_number_updated_at": {"type": "integer", "index": 12, "name": "phone_number_updated_at", "comment": null}, "_fivetran_synced": {"type": "text", "index": 13, "name": "_fivetran_synced", "comment": null}, "email_list_ids": {"type": "text", "index": 14, "name": "email_list_ids", "comment": null}, "iterable_user_id": {"type": "integer", "index": 15, "name": "iterable_user_id", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.iterable_integration_tests.user_history_bq_json_data"}, "seed.iterable_integration_tests.user_history_data": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "user_history_data", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"email": {"type": "text", "index": 1, "name": "email", "comment": null}, "updated_at": {"type": "timestamp without time zone", "index": 2, "name": "updated_at", "comment": null}, "first_name": {"type": "integer", "index": 3, "name": "first_name", "comment": null}, "last_name": {"type": "integer", "index": 4, "name": "last_name", "comment": null}, "phone_number": {"type": "integer", "index": 5, "name": "phone_number", "comment": null}, "user_id": {"type": "integer", "index": 6, "name": "user_id", "comment": null}, "signup_date": {"type": "text", "index": 7, "name": "signup_date", "comment": null}, "signup_source": {"type": "text", "index": 8, "name": "signup_source", "comment": null}, "phone_number_carrier": {"type": "integer", "index": 9, "name": "phone_number_carrier", "comment": null}, "phone_number_country_code_iso": {"type": "integer", "index": 10, "name": "phone_number_country_code_iso", "comment": null}, "phone_number_line_type": {"type": "integer", "index": 11, "name": "phone_number_line_type", "comment": null}, "phone_number_updated_at": {"type": "integer", "index": 12, "name": "phone_number_updated_at", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 13, "name": "_fivetran_synced", "comment": null}, "email_list_ids": {"type": "text", "index": 14, "name": "email_list_ids", "comment": null}, "iterable_user_id": {"type": "integer", "index": 15, "name": "iterable_user_id", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.iterable_integration_tests.user_history_data"}, "seed.iterable_integration_tests.user_unsubscribed_channel_data": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "user_unsubscribed_channel_data", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"_fivetran_id": {"type": "text", "index": 1, "name": "_fivetran_id", "comment": null}, "channel_id": {"type": "integer", "index": 2, "name": "channel_id", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 3, "name": "_fivetran_synced", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.iterable_integration_tests.user_unsubscribed_channel_data"}, "seed.iterable_integration_tests.user_unsubscribed_channel_history_data": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "user_unsubscribed_channel_history_data", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"email": {"type": "text", "index": 1, "name": "email", "comment": null}, "channel_id": {"type": "bigint", "index": 2, "name": "channel_id", "comment": null}, "updated_at": {"type": "text", "index": 3, "name": "updated_at", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 4, "name": "_fivetran_synced", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.iterable_integration_tests.user_unsubscribed_channel_history_data"}, "seed.iterable_integration_tests.user_unsubscribed_message_type_data": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "user_unsubscribed_message_type_data", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"_fivetran_id": {"type": "text", "index": 1, "name": "_fivetran_id", "comment": null}, "message_type_id": {"type": "integer", "index": 2, "name": "message_type_id", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 3, "name": "_fivetran_synced", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.iterable_integration_tests.user_unsubscribed_message_type_data"}, "seed.iterable_integration_tests.user_unsubscribed_message_type_history_data": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "user_unsubscribed_message_type_history_data", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"message_type_id": {"type": "integer", "index": 1, "name": "message_type_id", "comment": null}, "email": {"type": "text", "index": 2, "name": "email", "comment": null}, "updated_at": {"type": "text", "index": 3, "name": "updated_at", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 4, "name": "_fivetran_synced", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.iterable_integration_tests.user_unsubscribed_message_type_history_data"}, "model.iterable.int_iterable__campaign_event_metrics": {"metadata": {"type": "VIEW", "schema": "public_iterable_dev", "name": "int_iterable__campaign_event_metrics", "database": "postgres", "comment": "Table that generates relevant total and unique campaign/experiment level aggregations.", "owner": "postgres"}, "columns": {"source_relation": {"type": "text", "index": 1, "name": "source_relation", "comment": null}, "campaign_id": {"type": "text", "index": 2, "name": "campaign_id", "comment": null}, "template_id": {"type": "text", "index": 3, "name": "template_id", "comment": null}, "experiment_id": {"type": "integer", "index": 4, "name": "experiment_id", "comment": null}, "count_unique_users": {"type": "bigint", "index": 5, "name": "count_unique_users", "comment": null}, "total_emailclick": {"type": "numeric", "index": 6, "name": "total_emailclick", "comment": null}, "unique_total_emailclick": {"type": "bigint", "index": 7, "name": "unique_total_emailclick", "comment": null}, "total_emailunsubscribe": {"type": "numeric", "index": 8, "name": "total_emailunsubscribe", "comment": null}, "unique_total_emailunsubscribe": {"type": "bigint", "index": 9, "name": "unique_total_emailunsubscribe", "comment": null}, "total_emailcomplaint": {"type": "numeric", "index": 10, "name": "total_emailcomplaint", "comment": null}, "unique_total_emailcomplaint": {"type": "bigint", "index": 11, "name": "unique_total_emailcomplaint", "comment": null}, "total_customevent": {"type": "numeric", "index": 12, "name": "total_customevent", "comment": null}, "unique_total_customevent": {"type": "bigint", "index": 13, "name": "unique_total_customevent", "comment": null}, "total_emailsubscribe": {"type": "numeric", "index": 14, "name": "total_emailsubscribe", "comment": null}, "unique_total_emailsubscribe": {"type": "bigint", "index": 15, "name": "unique_total_emailsubscribe", "comment": null}, "total_emailopen": {"type": "numeric", "index": 16, "name": "total_emailopen", "comment": null}, "unique_total_emailopen": {"type": "bigint", "index": 17, "name": "unique_total_emailopen", "comment": null}, "total_pushsend": {"type": "numeric", "index": 18, "name": "total_pushsend", "comment": null}, "unique_total_pushsend": {"type": "bigint", "index": 19, "name": "unique_total_pushsend", "comment": null}, "total_smsbounce": {"type": "numeric", "index": 20, "name": "total_smsbounce", "comment": null}, "unique_total_smsbounce": {"type": "bigint", "index": 21, "name": "unique_total_smsbounce", "comment": null}, "total_pushbounce": {"type": "numeric", "index": 22, "name": "total_pushbounce", "comment": null}, "unique_total_pushbounce": {"type": "bigint", "index": 23, "name": "unique_total_pushbounce", "comment": null}, "total_inappsendskip": {"type": "numeric", "index": 24, "name": "total_inappsendskip", "comment": null}, "unique_total_inappsendskip": {"type": "bigint", "index": 25, "name": "unique_total_inappsendskip", "comment": null}, "total_smssend": {"type": "numeric", "index": 26, "name": "total_smssend", "comment": null}, "unique_total_smssend": {"type": "bigint", "index": 27, "name": "unique_total_smssend", "comment": null}, "total_inappsend": {"type": "numeric", "index": 28, "name": "total_inappsend", "comment": null}, "unique_total_inappsend": {"type": "bigint", "index": 29, "name": "unique_total_inappsend", "comment": null}, "total_pushopen": {"type": "numeric", "index": 30, "name": "total_pushopen", "comment": null}, "unique_total_pushopen": {"type": "bigint", "index": 31, "name": "unique_total_pushopen", "comment": null}, "total_emailsend": {"type": "numeric", "index": 32, "name": "total_emailsend", "comment": null}, "unique_total_emailsend": {"type": "bigint", "index": 33, "name": "unique_total_emailsend", "comment": null}, "total_pushsendskip": {"type": "numeric", "index": 34, "name": "total_pushsendskip", "comment": null}, "unique_total_pushsendskip": {"type": "bigint", "index": 35, "name": "unique_total_pushsendskip", "comment": null}, "total_inappopen": {"type": "numeric", "index": 36, "name": "total_inappopen", "comment": null}, "unique_total_inappopen": {"type": "bigint", "index": 37, "name": "unique_total_inappopen", "comment": null}, "total_emailsendskip": {"type": "numeric", "index": 38, "name": "total_emailsendskip", "comment": null}, "unique_total_emailsendskip": {"type": "bigint", "index": 39, "name": "unique_total_emailsendskip", "comment": null}, "total_emailbounce": {"type": "numeric", "index": 40, "name": "total_emailbounce", "comment": null}, "unique_total_emailbounce": {"type": "bigint", "index": 41, "name": "unique_total_emailbounce", "comment": null}, "total_inappclick": {"type": "numeric", "index": 42, "name": "total_inappclick", "comment": null}, "unique_total_inappclick": {"type": "bigint", "index": 43, "name": "unique_total_inappclick", "comment": null}, "total_pushuninstall": {"type": "numeric", "index": 44, "name": "total_pushuninstall", "comment": null}, "unique_total_pushuninstall": {"type": "bigint", "index": 45, "name": "unique_total_pushuninstall", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.int_iterable__campaign_event_metrics"}, "model.iterable.int_iterable__campaign_labels": {"metadata": {"type": "VIEW", "schema": "public_iterable_dev", "name": "int_iterable__campaign_labels", "database": "postgres", "comment": "Table that provides the distinct string aggregation of labels for each campaign.", "owner": "postgres"}, "columns": {"source_relation": {"type": "text", "index": 1, "name": "source_relation", "comment": null}, "campaign_id": {"type": "text", "index": 2, "name": "campaign_id", "comment": null}, "labels": {"type": "text", "index": 3, "name": "labels", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.int_iterable__campaign_labels"}, "model.iterable.int_iterable__campaign_lists": {"metadata": {"type": "VIEW", "schema": "public_iterable_dev", "name": "int_iterable__campaign_lists", "database": "postgres", "comment": "Table that identifies the suppressed and send lists associated with a campaign.", "owner": "postgres"}, "columns": {"source_relation": {"type": "text", "index": 1, "name": "source_relation", "comment": null}, "list_id": {"type": "text", "index": 2, "name": "list_id", "comment": null}, "campaign_id": {"type": "text", "index": 3, "name": "campaign_id", "comment": null}, "updated_at": {"type": "text", "index": 4, "name": "updated_at", "comment": null}, "list_activity": {"type": "text", "index": 5, "name": "list_activity", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.int_iterable__campaign_lists"}, "model.iterable.int_iterable__journey_event_metrics": {"metadata": {"type": "VIEW", "schema": "public_iterable_dev", "name": "int_iterable__journey_event_metrics", "database": "postgres", "comment": "Table that generates relevant total and unique journey level aggregations, rolled up from the user/campaign grain via the campaign's journey reference.", "owner": "postgres"}, "columns": {"source_relation": {"type": "text", "index": 1, "name": "source_relation", "comment": null}, "journey_id": {"type": "text", "index": 2, "name": "journey_id", "comment": null}, "count_total_campaigns": {"type": "bigint", "index": 3, "name": "count_total_campaigns", "comment": null}, "count_unique_users": {"type": "bigint", "index": 4, "name": "count_unique_users", "comment": null}, "first_event_at": {"type": "timestamp without time zone", "index": 5, "name": "first_event_at", "comment": null}, "last_event_at": {"type": "timestamp without time zone", "index": 6, "name": "last_event_at", "comment": null}, "total_emailclick": {"type": "numeric", "index": 7, "name": "total_emailclick", "comment": null}, "unique_total_emailclick": {"type": "bigint", "index": 8, "name": "unique_total_emailclick", "comment": null}, "total_emailunsubscribe": {"type": "numeric", "index": 9, "name": "total_emailunsubscribe", "comment": null}, "unique_total_emailunsubscribe": {"type": "bigint", "index": 10, "name": "unique_total_emailunsubscribe", "comment": null}, "total_emailcomplaint": {"type": "numeric", "index": 11, "name": "total_emailcomplaint", "comment": null}, "unique_total_emailcomplaint": {"type": "bigint", "index": 12, "name": "unique_total_emailcomplaint", "comment": null}, "total_customevent": {"type": "numeric", "index": 13, "name": "total_customevent", "comment": null}, "unique_total_customevent": {"type": "bigint", "index": 14, "name": "unique_total_customevent", "comment": null}, "total_emailsubscribe": {"type": "numeric", "index": 15, "name": "total_emailsubscribe", "comment": null}, "unique_total_emailsubscribe": {"type": "bigint", "index": 16, "name": "unique_total_emailsubscribe", "comment": null}, "total_emailopen": {"type": "numeric", "index": 17, "name": "total_emailopen", "comment": null}, "unique_total_emailopen": {"type": "bigint", "index": 18, "name": "unique_total_emailopen", "comment": null}, "total_pushsend": {"type": "numeric", "index": 19, "name": "total_pushsend", "comment": null}, "unique_total_pushsend": {"type": "bigint", "index": 20, "name": "unique_total_pushsend", "comment": null}, "total_smsbounce": {"type": "numeric", "index": 21, "name": "total_smsbounce", "comment": null}, "unique_total_smsbounce": {"type": "bigint", "index": 22, "name": "unique_total_smsbounce", "comment": null}, "total_pushbounce": {"type": "numeric", "index": 23, "name": "total_pushbounce", "comment": null}, "unique_total_pushbounce": {"type": "bigint", "index": 24, "name": "unique_total_pushbounce", "comment": null}, "total_inappsendskip": {"type": "numeric", "index": 25, "name": "total_inappsendskip", "comment": null}, "unique_total_inappsendskip": {"type": "bigint", "index": 26, "name": "unique_total_inappsendskip", "comment": null}, "total_smssend": {"type": "numeric", "index": 27, "name": "total_smssend", "comment": null}, "unique_total_smssend": {"type": "bigint", "index": 28, "name": "unique_total_smssend", "comment": null}, "total_inappsend": {"type": "numeric", "index": 29, "name": "total_inappsend", "comment": null}, "unique_total_inappsend": {"type": "bigint", "index": 30, "name": "unique_total_inappsend", "comment": null}, "total_pushopen": {"type": "numeric", "index": 31, "name": "total_pushopen", "comment": null}, "unique_total_pushopen": {"type": "bigint", "index": 32, "name": "unique_total_pushopen", "comment": null}, "total_emailsend": {"type": "numeric", "index": 33, "name": "total_emailsend", "comment": null}, "unique_total_emailsend": {"type": "bigint", "index": 34, "name": "unique_total_emailsend", "comment": null}, "total_pushsendskip": {"type": "numeric", "index": 35, "name": "total_pushsendskip", "comment": null}, "unique_total_pushsendskip": {"type": "bigint", "index": 36, "name": "unique_total_pushsendskip", "comment": null}, "total_inappopen": {"type": "numeric", "index": 37, "name": "total_inappopen", "comment": null}, "unique_total_inappopen": {"type": "bigint", "index": 38, "name": "unique_total_inappopen", "comment": null}, "total_emailsendskip": {"type": "numeric", "index": 39, "name": "total_emailsendskip", "comment": null}, "unique_total_emailsendskip": {"type": "bigint", "index": 40, "name": "unique_total_emailsendskip", "comment": null}, "total_emailbounce": {"type": "numeric", "index": 41, "name": "total_emailbounce", "comment": null}, "unique_total_emailbounce": {"type": "bigint", "index": 42, "name": "unique_total_emailbounce", "comment": null}, "total_inappclick": {"type": "numeric", "index": 43, "name": "total_inappclick", "comment": null}, "unique_total_inappclick": {"type": "bigint", "index": 44, "name": "unique_total_inappclick", "comment": null}, "total_pushuninstall": {"type": "numeric", "index": 45, "name": "total_pushuninstall", "comment": null}, "unique_total_pushuninstall": {"type": "bigint", "index": 46, "name": "unique_total_pushuninstall", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.int_iterable__journey_event_metrics"}, "model.iterable.int_iterable__latest_campaign": {"metadata": {"type": "VIEW", "schema": "public_iterable_dev", "name": "int_iterable__latest_campaign", "database": "postgres", "comment": "Table that filters out historical versions of the campaign, and returns the most recent campaign version.", "owner": "postgres"}, "columns": {"source_relation": {"type": "text", "index": 1, "name": "source_relation", "comment": null}, "campaign_id": {"type": "text", "index": 2, "name": "campaign_id", "comment": null}, "updated_at": {"type": "text", "index": 3, "name": "updated_at", "comment": null}, "campaign_name": {"type": "text", "index": 4, "name": "campaign_name", "comment": null}, "campaign_state": {"type": "text", "index": 5, "name": "campaign_state", "comment": null}, "campaign_type": {"type": "text", "index": 6, "name": "campaign_type", "comment": null}, "send_size": {"type": "integer", "index": 7, "name": "send_size", "comment": null}, "start_at": {"type": "integer", "index": 8, "name": "start_at", "comment": null}, "ended_at": {"type": "integer", "index": 9, "name": "ended_at", "comment": null}, "created_at": {"type": "text", "index": 10, "name": "created_at", "comment": null}, "message_medium": {"type": "text", "index": 11, "name": "message_medium", "comment": null}, "recurring_campaign_id": {"type": "text", "index": 12, "name": "recurring_campaign_id", "comment": null}, "created_by_user_id": {"type": "text", "index": 13, "name": "created_by_user_id", "comment": null}, "updated_by_user_id": {"type": "text", "index": 14, "name": "updated_by_user_id", "comment": null}, "template_id": {"type": "text", "index": 15, "name": "template_id", "comment": null}, "workflow_id": {"type": "integer", "index": 16, "name": "workflow_id", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 17, "name": "_fivetran_synced", "comment": null}, "latest_campaign_index": {"type": "bigint", "index": 18, "name": "latest_campaign_index", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.int_iterable__latest_campaign"}, "model.iterable.int_iterable__latest_template": {"metadata": {"type": "VIEW", "schema": "public_iterable_dev", "name": "int_iterable__latest_template", "database": "postgres", "comment": "Table that provides the most recent version of the template as well as joining relevant message type information.", "owner": "postgres"}, "columns": {"source_relation": {"type": "text", "index": 1, "name": "source_relation", "comment": null}, "template_id": {"type": "text", "index": 2, "name": "template_id", "comment": null}, "template_name": {"type": "text", "index": 3, "name": "template_name", "comment": null}, "template_type": {"type": "text", "index": 4, "name": "template_type", "comment": null}, "created_at": {"type": "text", "index": 5, "name": "created_at", "comment": null}, "client_template_id": {"type": "text", "index": 6, "name": "client_template_id", "comment": null}, "creator_user_id": {"type": "text", "index": 7, "name": "creator_user_id", "comment": null}, "message_type_id": {"type": "text", "index": 8, "name": "message_type_id", "comment": null}, "updated_at": {"type": "text", "index": 9, "name": "updated_at", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 10, "name": "_fivetran_synced", "comment": null}, "latest_template_index": {"type": "bigint", "index": 11, "name": "latest_template_index", "comment": null}, "message_type_name": {"type": "text", "index": 12, "name": "message_type_name", "comment": null}, "channel_id": {"type": "text", "index": 13, "name": "channel_id", "comment": null}, "channel_name": {"type": "text", "index": 14, "name": "channel_name", "comment": null}, "channel_type": {"type": "text", "index": 15, "name": "channel_type", "comment": null}, "message_medium": {"type": "text", "index": 16, "name": "message_medium", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.int_iterable__latest_template"}, "model.iterable.int_iterable__latest_user": {"metadata": {"type": "VIEW", "schema": "public_iterable_dev", "name": "int_iterable__latest_user", "database": "postgres", "comment": "Table that filters out historical versions of the user, and returns only the most recent version.", "owner": "postgres"}, "columns": {"source_relation": {"type": "text", "index": 1, "name": "source_relation", "comment": null}, "_fivetran_user_id": {"type": "text", "index": 2, "name": "_fivetran_user_id", "comment": null}, "email": {"type": "text", "index": 3, "name": "email", "comment": null}, "updated_at": {"type": "timestamp without time zone", "index": 4, "name": "updated_at", "comment": null}, "user_id": {"type": "text", "index": 5, "name": "user_id", "comment": null}, "first_name": {"type": "integer", "index": 6, "name": "first_name", "comment": null}, "last_name": {"type": "integer", "index": 7, "name": "last_name", "comment": null}, "email_list_ids": {"type": "text", "index": 8, "name": "email_list_ids", "comment": null}, "phone_number": {"type": "integer", "index": 9, "name": "phone_number", "comment": null}, "signup_date": {"type": "text", "index": 10, "name": "signup_date", "comment": null}, "signup_source": {"type": "text", "index": 11, "name": "signup_source", "comment": null}, "iterable_user_id": {"type": "text", "index": 12, "name": "iterable_user_id", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 13, "name": "_fivetran_synced", "comment": null}, "unique_user_key": {"type": "text", "index": 14, "name": "unique_user_key", "comment": null}, "latest_user_index": {"type": "bigint", "index": 15, "name": "latest_user_index", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.int_iterable__latest_user"}, "model.iterable.int_iterable__list_user_history": {"metadata": {"type": "BASE TABLE", "schema": "public_iterable_dev", "name": "int_iterable__list_user_history", "database": "postgres", "comment": "Table that provides a history of all lists the user has been associated with.", "owner": "postgres"}, "columns": {"source_relation": {"type": "text", "index": 1, "name": "source_relation", "comment": null}, "_fivetran_user_id": {"type": "text", "index": 2, "name": "_fivetran_user_id", "comment": null}, "unique_user_key": {"type": "text", "index": 3, "name": "unique_user_key", "comment": null}, "email": {"type": "text", "index": 4, "name": "email", "comment": null}, "user_id": {"type": "text", "index": 5, "name": "user_id", "comment": null}, "first_name": {"type": "integer", "index": 6, "name": "first_name", "comment": null}, "last_name": {"type": "integer", "index": 7, "name": "last_name", "comment": null}, "email_list_ids": {"type": "text", "index": 8, "name": "email_list_ids", "comment": null}, "phone_number": {"type": "integer", "index": 9, "name": "phone_number", "comment": null}, "signup_date": {"type": "text", "index": 10, "name": "signup_date", "comment": null}, "signup_source": {"type": "text", "index": 11, "name": "signup_source", "comment": null}, "updated_at": {"type": "timestamp without time zone", "index": 12, "name": "updated_at", "comment": null}, "is_current": {"type": "boolean", "index": 13, "name": "is_current", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.int_iterable__list_user_history"}, "model.iterable.int_iterable__list_user_unnest": {"metadata": {"type": "BASE TABLE", "schema": "public_iterable_dev", "name": "int_iterable__list_user_unnest", "database": "postgres", "comment": "Table that unnests the `email_list_id` field for each user to create a new record for each user and the unique list it was associated with at a unique update. Due to the unnesting functions varying greatly between warehouses, conditional logic is applied throughout the model to appropriately accommodate the model being ran within Redshift, Snowflake, BigQuery, and Postgres.\n", "owner": "postgres"}, "columns": {"source_relation": {"type": "text", "index": 1, "name": "source_relation", "comment": null}, "_fivetran_user_id": {"type": "text", "index": 2, "name": "_fivetran_user_id", "comment": null}, "unique_user_key": {"type": "text", "index": 3, "name": "unique_user_key", "comment": null}, "user_id": {"type": "text", "index": 4, "name": "user_id", "comment": null}, "email": {"type": "text", "index": 5, "name": "email", "comment": null}, "first_name": {"type": "integer", "index": 6, "name": "first_name", "comment": null}, "last_name": {"type": "integer", "index": 7, "name": "last_name", "comment": null}, "signup_date": {"type": "text", "index": 8, "name": "signup_date", "comment": null}, "signup_source": {"type": "text", "index": 9, "name": "signup_source", "comment": null}, "updated_at": {"type": "timestamp without time zone", "index": 10, "name": "updated_at", "comment": null}, "phone_number": {"type": "integer", "index": 11, "name": "phone_number", "comment": null}, "is_current": {"type": "boolean", "index": 12, "name": "is_current", "comment": null}, "email_list_ids": {"type": "text", "index": 13, "name": "email_list_ids", "comment": null}, "list_id": {"type": "integer", "index": 14, "name": "list_id", "comment": null}, "unique_key": {"type": "text", "index": 15, "name": "unique_key", "comment": null}, "date_day": {"type": "date", "index": 16, "name": "date_day", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.int_iterable__list_user_unnest"}, "model.iterable.int_iterable__message_type_channel": {"metadata": {"type": "VIEW", "schema": "public_iterable_dev", "name": "int_iterable__message_type_channel", "database": "postgres", "comment": "Table that joins the message type and channel records together into one comprehensive model to be referenced downstream.", "owner": "postgres"}, "columns": {"source_relation": {"type": "text", "index": 1, "name": "source_relation", "comment": null}, "channel_id": {"type": "text", "index": 2, "name": "channel_id", "comment": null}, "channel_name": {"type": "text", "index": 3, "name": "channel_name", "comment": null}, "channel_type": {"type": "text", "index": 4, "name": "channel_type", "comment": null}, "message_medium": {"type": "text", "index": 5, "name": "message_medium", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 6, "name": "_fivetran_synced", "comment": null}, "message_type_name": {"type": "text", "index": 7, "name": "message_type_name", "comment": null}, "message_type_id": {"type": "text", "index": 8, "name": "message_type_id", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.int_iterable__message_type_channel"}, "model.iterable.int_iterable__recurring_campaigns": {"metadata": {"type": "VIEW", "schema": "public_iterable_dev", "name": "int_iterable__recurring_campaigns", "database": "postgres", "comment": "Table that identifies when a campaign is associated with a recurring campaign and provides additional enriched recurring campaign information.", "owner": "postgres"}, "columns": {"source_relation": {"type": "text", "index": 1, "name": "source_relation", "comment": null}, "campaign_id": {"type": "text", "index": 2, "name": "campaign_id", "comment": null}, "campaign_name": {"type": "text", "index": 3, "name": "campaign_name", "comment": null}, "updated_at": {"type": "text", "index": 4, "name": "updated_at", "comment": null}, "campaign_state": {"type": "text", "index": 5, "name": "campaign_state", "comment": null}, "campaign_type": {"type": "text", "index": 6, "name": "campaign_type", "comment": null}, "send_size": {"type": "integer", "index": 7, "name": "send_size", "comment": null}, "start_at": {"type": "integer", "index": 8, "name": "start_at", "comment": null}, "ended_at": {"type": "integer", "index": 9, "name": "ended_at", "comment": null}, "created_at": {"type": "text", "index": 10, "name": "created_at", "comment": null}, "created_by_user_id": {"type": "text", "index": 11, "name": "created_by_user_id", "comment": null}, "template_id": {"type": "text", "index": 12, "name": "template_id", "comment": null}, "recurring_campaign_id": {"type": "text", "index": 13, "name": "recurring_campaign_id", "comment": null}, "journey_id": {"type": "text", "index": 14, "name": "journey_id", "comment": null}, "recurring_campaign_name": {"type": "text", "index": 15, "name": "recurring_campaign_name", "comment": null}, "recurring_campaign_state": {"type": "text", "index": 16, "name": "recurring_campaign_state", "comment": null}, "recurring_campaign_send_size": {"type": "integer", "index": 17, "name": "recurring_campaign_send_size", "comment": null}, "recurring_campaign_start_at": {"type": "integer", "index": 18, "name": "recurring_campaign_start_at", "comment": null}, "is_campaign_recurring": {"type": "boolean", "index": 19, "name": "is_campaign_recurring", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.int_iterable__recurring_campaigns"}, "model.iterable.int_iterable__user_event_metrics": {"metadata": {"type": "VIEW", "schema": "public_iterable_dev", "name": "int_iterable__user_event_metrics", "database": "postgres", "comment": "Table that generates user aggregations at the campaign level.", "owner": "postgres"}, "columns": {"source_relation": {"type": "text", "index": 1, "name": "source_relation", "comment": null}, "_fivetran_user_id": {"type": "text", "index": 2, "name": "_fivetran_user_id", "comment": null}, "unique_user_key": {"type": "text", "index": 3, "name": "unique_user_key", "comment": null}, "user_id": {"type": "text", "index": 4, "name": "user_id", "comment": null}, "user_email": {"type": "text", "index": 5, "name": "user_email", "comment": null}, "count_total_campaigns": {"type": "bigint", "index": 6, "name": "count_total_campaigns", "comment": null}, "first_event_at": {"type": "timestamp without time zone", "index": 7, "name": "first_event_at", "comment": null}, "last_event_at": {"type": "timestamp without time zone", "index": 8, "name": "last_event_at", "comment": null}, "total_emailclick": {"type": "numeric", "index": 9, "name": "total_emailclick", "comment": null}, "total_emailunsubscribe": {"type": "numeric", "index": 10, "name": "total_emailunsubscribe", "comment": null}, "total_emailcomplaint": {"type": "numeric", "index": 11, "name": "total_emailcomplaint", "comment": null}, "total_customevent": {"type": "numeric", "index": 12, "name": "total_customevent", "comment": null}, "total_emailsubscribe": {"type": "numeric", "index": 13, "name": "total_emailsubscribe", "comment": null}, "total_emailopen": {"type": "numeric", "index": 14, "name": "total_emailopen", "comment": null}, "total_pushsend": {"type": "numeric", "index": 15, "name": "total_pushsend", "comment": null}, "total_smsbounce": {"type": "numeric", "index": 16, "name": "total_smsbounce", "comment": null}, "total_pushbounce": {"type": "numeric", "index": 17, "name": "total_pushbounce", "comment": null}, "total_inappsendskip": {"type": "numeric", "index": 18, "name": "total_inappsendskip", "comment": null}, "total_smssend": {"type": "numeric", "index": 19, "name": "total_smssend", "comment": null}, "total_inappsend": {"type": "numeric", "index": 20, "name": "total_inappsend", "comment": null}, "total_pushopen": {"type": "numeric", "index": 21, "name": "total_pushopen", "comment": null}, "total_emailsend": {"type": "numeric", "index": 22, "name": "total_emailsend", "comment": null}, "total_pushsendskip": {"type": "numeric", "index": 23, "name": "total_pushsendskip", "comment": null}, "total_inappopen": {"type": "numeric", "index": 24, "name": "total_inappopen", "comment": null}, "total_emailsendskip": {"type": "numeric", "index": 25, "name": "total_emailsendskip", "comment": null}, "total_emailbounce": {"type": "numeric", "index": 26, "name": "total_emailbounce", "comment": null}, "total_inappclick": {"type": "numeric", "index": 27, "name": "total_inappclick", "comment": null}, "total_pushuninstall": {"type": "numeric", "index": 28, "name": "total_pushuninstall", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.int_iterable__user_event_metrics"}, "model.iterable.iterable__campaigns": {"metadata": {"type": "BASE TABLE", "schema": "public_iterable_dev", "name": "iterable__campaigns", "database": "postgres", "comment": "Table that provides aggregations for campaigns at the template and if available, the experiment grain.", "owner": "postgres"}, "columns": {"source_relation": {"type": "text", "index": 1, "name": "source_relation", "comment": "Identifies the record's source."}, "campaign_id": {"type": "text", "index": 2, "name": "campaign_id", "comment": "Unique identifier of the campaign record"}, "campaign_name": {"type": "text", "index": 3, "name": "campaign_name", "comment": "User defined name of the campaign."}, "updated_at": {"type": "text", "index": 4, "name": "updated_at", "comment": "Last update timestamp"}, "campaign_state": {"type": "text", "index": 5, "name": "campaign_state", "comment": "State of the campaign. Can be Draft, Ready, Scheduled, Running, Finished, Starting, Aborted or Recurring"}, "campaign_type": {"type": "text", "index": 6, "name": "campaign_type", "comment": "The campaign type. Can be Blast or Triggered"}, "send_size": {"type": "integer", "index": 7, "name": "send_size", "comment": "Size of the campaign. Number of individuals included in the campaign"}, "start_at": {"type": "integer", "index": 8, "name": "start_at", "comment": "Start timestamp"}, "ended_at": {"type": "integer", "index": 9, "name": "ended_at", "comment": "Ended timestamp"}, "created_at": {"type": "text", "index": 10, "name": "created_at", "comment": "Creation timestamp"}, "created_by_user_id": {"type": "text", "index": 11, "name": "created_by_user_id", "comment": "Reference to the user who created the campaign"}, "template_id": {"type": "text", "index": 12, "name": "template_id", "comment": "Reference to the campaign template"}, "recurring_campaign_id": {"type": "text", "index": 13, "name": "recurring_campaign_id", "comment": "Unique identifier of the recurring campaign (if applicable)"}, "journey_id": {"type": "text", "index": 14, "name": "journey_id", "comment": "Reference to the journey the campaign belongs to, if applicable"}, "recurring_campaign_name": {"type": "text", "index": 15, "name": "recurring_campaign_name", "comment": "Name of the recurring campaign (if applicable)"}, "recurring_campaign_state": {"type": "text", "index": 16, "name": "recurring_campaign_state", "comment": "State of the recurring campaign (if applicable)"}, "recurring_campaign_send_size": {"type": "integer", "index": 17, "name": "recurring_campaign_send_size", "comment": "Size of the recurring campaign. Number of individuals included in the recurring campaign (if applicable)"}, "recurring_campaign_start_at": {"type": "integer", "index": 18, "name": "recurring_campaign_start_at", "comment": "Timestamp of when the recurring campaign started (if applicable)"}, "is_campaign_recurring": {"type": "boolean", "index": 19, "name": "is_campaign_recurring", "comment": "Boolean indicating if the campaign is a recurring campaign"}, "experiment_id": {"type": "integer", "index": 20, "name": "experiment_id", "comment": "Reference to the experiment used if the event is an experiment"}, "count_unique_users": {"type": "bigint", "index": 21, "name": "count_unique_users", "comment": "Count of total unique users within the campaign/experiment"}, "total_emailclick": {"type": "numeric", "index": 22, "name": "total_emailclick", "comment": "Total email clicks within the campaign/experiment"}, "unique_total_emailclick": {"type": "bigint", "index": 23, "name": "unique_total_emailclick", "comment": "Unique email clicks within the campaign/experiment"}, "total_emailunsubscribe": {"type": "numeric", "index": 24, "name": "total_emailunsubscribe", "comment": "Total email unsubscribe events within the campaign/experiment"}, "unique_total_emailunsubscribe": {"type": "bigint", "index": 25, "name": "unique_total_emailunsubscribe", "comment": "Unique total email unsubscribe events within the campaign/experiment"}, "total_emailcomplaint": {"type": "numeric", "index": 26, "name": "total_emailcomplaint", "comment": "Total email complaints within the campaign/experiment"}, "unique_total_emailcomplaint": {"type": "bigint", "index": 27, "name": "unique_total_emailcomplaint", "comment": "Unique total email complaints within the campaign/experiment"}, "total_customevent": {"type": "numeric", "index": 28, "name": "total_customevent", "comment": "Total custom events within the campaign/experiment"}, "unique_total_customevent": {"type": "bigint", "index": 29, "name": "unique_total_customevent", "comment": "Unique total custom events within the campaign/experiment"}, "total_emailsubscribe": {"type": "numeric", "index": 30, "name": "total_emailsubscribe", "comment": "Total email subscribe events within the campaign/experiment"}, "unique_total_emailsubscribe": {"type": "bigint", "index": 31, "name": "unique_total_emailsubscribe", "comment": "Unique total email subscribe events within the campaign/experiment"}, "total_emailopen": {"type": "numeric", "index": 32, "name": "total_emailopen", "comment": "Total email open events within the campaign/experiment"}, "unique_total_emailopen": {"type": "bigint", "index": 33, "name": "unique_total_emailopen", "comment": "Unique total email open events within the campaign/experiment"}, "total_pushsend": {"type": "numeric", "index": 34, "name": "total_pushsend", "comment": "Total push send event within the campaign/experiment"}, "unique_total_pushsend": {"type": "bigint", "index": 35, "name": "unique_total_pushsend", "comment": "Unique total push send events within the campaign/experiment"}, "total_smsbounce": {"type": "numeric", "index": 36, "name": "total_smsbounce", "comment": "Total sms bounce events within the campaign/experiment"}, "unique_total_smsbounce": {"type": "bigint", "index": 37, "name": "unique_total_smsbounce", "comment": "Unique total sms bounce events within the campaign/experiment"}, "total_pushbounce": {"type": "numeric", "index": 38, "name": "total_pushbounce", "comment": "Total push bounce events within the campaign/experiment"}, "unique_total_pushbounce": {"type": "bigint", "index": 39, "name": "unique_total_pushbounce", "comment": "Unique total push bounce events within the campaign/experiment"}, "total_inappsendskip": {"type": "numeric", "index": 40, "name": "total_inappsendskip", "comment": "Total in app send skip events within the campaign/experiment"}, "unique_total_inappsendskip": {"type": "bigint", "index": 41, "name": "unique_total_inappsendskip", "comment": "Unique total in app send skip events within the campaign/experiment"}, "total_smssend": {"type": "numeric", "index": 42, "name": "total_smssend", "comment": "Total sms send events within the campaign/experiment"}, "unique_total_smssend": {"type": "bigint", "index": 43, "name": "unique_total_smssend", "comment": "Unique total sms send events within the campaign/experiment"}, "total_inappsend": {"type": "numeric", "index": 44, "name": "total_inappsend", "comment": "Total in app send events within the campaign/experiment"}, "unique_total_inappsend": {"type": "bigint", "index": 45, "name": "unique_total_inappsend", "comment": "Unique total in app send events within the campaign/experiment"}, "total_pushopen": {"type": "numeric", "index": 46, "name": "total_pushopen", "comment": "Total push open events within the campaign/experiment"}, "unique_total_pushopen": {"type": "bigint", "index": 47, "name": "unique_total_pushopen", "comment": "Unique total push open events within the campaign/experiment"}, "total_emailsend": {"type": "numeric", "index": 48, "name": "total_emailsend", "comment": "Total email send events within the campaign/experiment"}, "unique_total_emailsend": {"type": "bigint", "index": 49, "name": "unique_total_emailsend", "comment": "Unique total email send events within the campaign/experiment"}, "total_pushsendskip": {"type": "numeric", "index": 50, "name": "total_pushsendskip", "comment": "Total push send skip events within the campaign/experiment"}, "unique_total_pushsendskip": {"type": "bigint", "index": 51, "name": "unique_total_pushsendskip", "comment": "Unique total push send skip events within the campaign/experiment"}, "total_inappopen": {"type": "numeric", "index": 52, "name": "total_inappopen", "comment": "Total in app open events within the campaign/experiment"}, "unique_total_inappopen": {"type": "bigint", "index": 53, "name": "unique_total_inappopen", "comment": "Unique total in app open events within the campaign/experiment"}, "total_emailsendskip": {"type": "numeric", "index": 54, "name": "total_emailsendskip", "comment": "Total email send skip events within the campaign/experiment"}, "unique_total_emailsendskip": {"type": "bigint", "index": 55, "name": "unique_total_emailsendskip", "comment": "Unique total email send skip events within the campaign/experiment"}, "total_emailbounce": {"type": "numeric", "index": 56, "name": "total_emailbounce", "comment": "Total email bounce events within the campaign/experiment"}, "unique_total_emailbounce": {"type": "bigint", "index": 57, "name": "unique_total_emailbounce", "comment": "Unique total email bounce events within the campaign/experiment"}, "total_inappclick": {"type": "numeric", "index": 58, "name": "total_inappclick", "comment": "Total in app click events within the campaign/experiment"}, "unique_total_inappclick": {"type": "bigint", "index": 59, "name": "unique_total_inappclick", "comment": "Unique total in app click events within the campaign/experiment"}, "total_pushuninstall": {"type": "numeric", "index": 60, "name": "total_pushuninstall", "comment": "Total push uninstall events within the campaign/experiment"}, "unique_total_pushuninstall": {"type": "bigint", "index": 61, "name": "unique_total_pushuninstall", "comment": "Unique total push uninstall events within the campaign/experiment"}, "count_send_lists": {"type": "bigint", "index": 62, "name": "count_send_lists", "comment": "Count of send lists within the campaign/experiment"}, "count_suppress_lists": {"type": "bigint", "index": 63, "name": "count_suppress_lists", "comment": "Count of suppress lists within the campaign/experiment"}, "labels": {"type": "text", "index": 64, "name": "labels", "comment": "List of labels associated with the campaign/experiment"}, "journey_name": {"type": "text", "index": 65, "name": "journey_name", "comment": "User defined name of the journey the campaign belongs to, if applicable"}, "journey_type": {"type": "text", "index": 66, "name": "journey_type", "comment": "The type of the journey the campaign belongs to, if applicable"}, "template_name": {"type": "text", "index": 67, "name": "template_name", "comment": "Name of the template associated with the campaign/experiment"}, "template_creator_user_id": {"type": "text", "index": 68, "name": "template_creator_user_id", "comment": "The creator user id of the template associated with the campaign/experiment"}, "message_medium": {"type": "text", "index": 69, "name": "message_medium", "comment": "The medium which the message was provided"}, "message_type_name": {"type": "text", "index": 70, "name": "message_type_name", "comment": "The message type name associated with the campaign/experiment"}, "channel_name": {"type": "text", "index": 71, "name": "channel_name", "comment": "The channel name associated with the campaign/experiment"}, "channel_id": {"type": "text", "index": 72, "name": "channel_id", "comment": "The channel identifier associated with the campaign/experiment"}, "channel_type": {"type": "text", "index": 73, "name": "channel_type", "comment": "The channel type associated with the campaign/experiment"}, "unique_campaign_version_id": {"type": "text", "index": 74, "name": "unique_campaign_version_id", "comment": "Unique identifier combining campaign_id, template_id, source_relation, and if available, experiment_id."}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.iterable__campaigns"}, "model.iterable.iterable__events": {"metadata": {"type": "BASE TABLE", "schema": "public_iterable_dev", "name": "iterable__events", "database": "postgres", "comment": "Table that provides a comprehensive view of all events with enriched information such as the campaign, user effected, and template used.", "owner": "postgres"}, "columns": {"source_relation": {"type": "text", "index": 1, "name": "source_relation", "comment": "Identifies the record's source."}, "event_id": {"type": "text", "index": 2, "name": "event_id", "comment": "Unique id of the event generated by Fivetran"}, "unique_event_id": {"type": "text", "index": 3, "name": "unique_event_id", "comment": "A unique surrogate key of event_id, _fivetran_user_id, and source_relation."}, "_fivetran_user_id": {"type": "text", "index": 4, "name": "_fivetran_user_id", "comment": "A Fivetran-created unique identifier for the new Iterable schema in Aug 2023, for users, derived from hashing user_id and/or email, depending on project type."}, "unique_user_key": {"type": "text", "index": 5, "name": "unique_user_key", "comment": "The unique identifier of the user. With the new schema (Aug 2023), it is the _fivetran_user_id. This is a hash of user_id and/or email, depending on project type. If using the old schema, it is email."}, "campaign_id": {"type": "text", "index": 6, "name": "campaign_id", "comment": "Reference to the campaign from which the event originated"}, "content_id": {"type": "text", "index": 7, "name": "content_id", "comment": "Reference to the content the event is associated with"}, "created_at": {"type": "timestamp without time zone", "index": 8, "name": "created_at", "comment": "Creation timestamp"}, "created_on": {"type": "date", "index": 9, "name": "created_on", "comment": "Day when the event was created"}, "email": {"type": "text", "index": 10, "name": "email", "comment": "The user's email. User identifier, for email-based projects. Previously was the unique identifier for user records, for the old Iterable schema before the August 2023 updates."}, "additional_properties": {"type": "text", "index": 11, "name": "additional_properties", "comment": "json object containing addition event properties"}, "event_name": {"type": "text", "index": 12, "name": "event_name", "comment": "Name provided to the individual event"}, "message_bus_id": {"type": "text", "index": 13, "name": "message_bus_id", "comment": "Reference to the message bus associated with the event"}, "message_id": {"type": "text", "index": 14, "name": "message_id", "comment": "Reference to the message the event is associated with"}, "message_type_id": {"type": "text", "index": 15, "name": "message_type_id", "comment": "Reference to the type of message the event is associated with"}, "recipient_state": {"type": "integer", "index": 16, "name": "recipient_state", "comment": "The state of the recipient upon receiving the event"}, "status": {"type": "integer", "index": 17, "name": "status", "comment": "Status of the event"}, "transactional_data": {"type": "character varying(100)", "index": 18, "name": "transactional_data", "comment": "Transactional data associated with the event"}, "unsub_source": {"type": "integer", "index": 19, "name": "unsub_source", "comment": "Source of the unsubscribe event"}, "user_agent": {"type": "integer", "index": 20, "name": "user_agent", "comment": "User agent associated with the event"}, "user_agent_device": {"type": "integer", "index": 21, "name": "user_agent_device", "comment": "The device of the user agent"}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 22, "name": "_fivetran_synced", "comment": "Timestamp of when the event record was synced by Fivetran"}, "campaign_name": {"type": "text", "index": 23, "name": "campaign_name", "comment": "The name of the campaign"}, "campaign_type": {"type": "text", "index": 24, "name": "campaign_type", "comment": "The type of campaign"}, "is_campaign_recurring": {"type": "boolean", "index": 25, "name": "is_campaign_recurring", "comment": "Boolean indicating if the campaign is recurrent"}, "recurring_campaign_name": {"type": "text", "index": 26, "name": "recurring_campaign_name", "comment": "The name of the recurring campaign (if applicable)"}, "recurring_campaign_id": {"type": "text", "index": 27, "name": "recurring_campaign_id", "comment": "The campaign if of the recurring campaign (if applicable)"}, "user_id": {"type": "text", "index": 28, "name": "user_id", "comment": "User identifier, for userID-based projects."}, "user_full_name": {"type": "text", "index": 29, "name": "user_full_name", "comment": "Full name of the user"}, "message_type_name": {"type": "text", "index": 30, "name": "message_type_name", "comment": "Name of the message type"}, "message_medium": {"type": "text", "index": 31, "name": "message_medium", "comment": "Medium of the message"}, "channel_id": {"type": "text", "index": 32, "name": "channel_id", "comment": "Unique identifier of the channel"}, "channel_name": {"type": "text", "index": 33, "name": "channel_name", "comment": "The channel name"}, "channel_type": {"type": "text", "index": 34, "name": "channel_type", "comment": "The type of channel"}, "is_app_already_running": {"type": "integer", "index": 35, "name": "is_app_already_running", "comment": "Boolean indicating if the app is already running"}, "badge": {"type": "integer", "index": 36, "name": "badge", "comment": "Badge associated with the event"}, "catalog_collection_count": {"type": "integer", "index": 37, "name": "catalog_collection_count", "comment": "The count of products or items collected in a catalog associated with the event."}, "catalog_lookup_count": {"type": "integer", "index": 38, "name": "catalog_lookup_count", "comment": "The count of times a catalog was looked up or queried during the event."}, "canonical_url_id": {"type": "text", "index": 39, "name": "canonical_url_id", "comment": "Reference to the url associated with the event"}, "is_content_available": {"type": "integer", "index": 40, "name": "is_content_available", "comment": "Content available from the event"}, "device": {"type": "integer", "index": 41, "name": "device", "comment": "The device associated with the event"}, "email_id": {"type": "text", "index": 42, "name": "email_id", "comment": "Reference to the email associated with the event"}, "email_subject": {"type": "text", "index": 43, "name": "email_subject", "comment": "Subject of the email associated with the event"}, "experiment_id": {"type": "integer", "index": 44, "name": "experiment_id", "comment": "Reference to the experiment used if the event is an experiment"}, "from_phone_number_id": {"type": "integer", "index": 45, "name": "from_phone_number_id", "comment": "Reference to the phone number which the event is from"}, "from_smssender_id": {"type": "integer", "index": 46, "name": "from_smssender_id", "comment": "Reference to the sms sender which the event is from"}, "link_id": {"type": "text", "index": 47, "name": "link_id", "comment": "Reference to the link associated with the event"}, "link_url": {"type": "integer", "index": 48, "name": "link_url", "comment": "Url of the link associated with the event"}, "locale": {"type": "integer", "index": 49, "name": "locale", "comment": "Locale associated with the event"}, "payload": {"type": "character varying(100)", "index": 50, "name": "payload", "comment": "Payload resulted from the event"}, "platform_endpoint": {"type": "integer", "index": 51, "name": "platform_endpoint", "comment": "The specific platform endpoint of the event"}, "push_message": {"type": "integer", "index": 52, "name": "push_message", "comment": "Boolean indicating if the event is a push message"}, "region": {"type": "text", "index": 53, "name": "region", "comment": "Region of the event"}, "sms_message": {"type": "integer", "index": 54, "name": "sms_message", "comment": "Boolean indicating if the event is an sms message"}, "to_phone_number": {"type": "integer", "index": 55, "name": "to_phone_number", "comment": "To phone number associated with the event"}, "url": {"type": "integer", "index": 56, "name": "url", "comment": "Url associated with the event"}, "workflow_id": {"type": "text", "index": 57, "name": "workflow_id", "comment": "Reference to the workflow which the event originated"}, "workflow_name": {"type": "text", "index": 58, "name": "workflow_name", "comment": "Name of the workflow which the event originated"}, "city": {"type": "text", "index": 59, "name": "city", "comment": "The city associated with the event, which could be the location of the recipient."}, "clicked_url": {"type": "text", "index": 60, "name": "clicked_url", "comment": "The URL that was clicked by the recipient in response to the marketing message."}, "country": {"type": "text", "index": 61, "name": "country", "comment": "The country associated with the event, which could be the location of the recipient."}, "error_code": {"type": "integer", "index": 62, "name": "error_code", "comment": "The error code or message indicating any issues or errors encountered during the event."}, "expires_at": {"type": "text", "index": 63, "name": "expires_at", "comment": "The date and time when the event or message is set to expire or become invalid."}, "from_phone_number": {"type": "integer", "index": 64, "name": "from_phone_number", "comment": "The phone number from which the SMS message was sent."}, "in_app_body": {"type": "text", "index": 65, "name": "in_app_body", "comment": "The content or body of an in-app message that was sent as part of the event."}, "is_sms_estimation": {"type": "boolean", "index": 66, "name": "is_sms_estimation", "comment": "A boolean indicating whether the SMS message is an estimation or not."}, "labels": {"type": "text", "index": 67, "name": "labels", "comment": "Any labels or tags associated with the event, which can be used for categorization or organization."}, "message_status": {"type": "text", "index": 68, "name": "message_status", "comment": "The status of the marketing message, such as sent, delivered, opened, etc."}, "mms_send_count": {"type": "integer", "index": 69, "name": "mms_send_count", "comment": "The count of multimedia messages (MMS) sent as part of the event."}, "reason": {"type": "text", "index": 70, "name": "reason", "comment": "The reason or cause associated with a specific event or action."}, "sms_send_count": {"type": "integer", "index": 71, "name": "sms_send_count", "comment": "The count of SMS messages sent as part of the event."}, "template_id": {"type": "text", "index": 72, "name": "template_id", "comment": "Unique identifier of the template"}, "template_name": {"type": "text", "index": 73, "name": "template_name", "comment": "User defined name of the template"}, "template_creator_user_id": {"type": "text", "index": 74, "name": "template_creator_user_id", "comment": "Reference to the user who created the template"}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.iterable__events"}, "model.iterable.iterable__journeys": {"metadata": {"type": "BASE TABLE", "schema": "public_iterable_dev", "name": "iterable__journeys", "database": "postgres", "comment": "Table that provides aggregations for journeys, formerly known as workflows. Metrics are rolled up from the user/campaign grain via each campaign's journey reference. Journeys which generate no events, such as those that only split audiences or update user fields, are still included with null metrics. The grain of this table is one record per journey.\n", "owner": "postgres"}, "columns": {"source_relation": {"type": "text", "index": 1, "name": "source_relation", "comment": "Identifies the record's source."}, "journey_id": {"type": "text", "index": 2, "name": "journey_id", "comment": "Unique identifier of the journey"}, "journey_name": {"type": "text", "index": 3, "name": "journey_name", "comment": "User defined name of the journey"}, "journey_type": {"type": "text", "index": 4, "name": "journey_type", "comment": "The journey type"}, "journey_description": {"type": "text", "index": 5, "name": "journey_description", "comment": "Information about the journey"}, "creator_user_id": {"type": "text", "index": 6, "name": "creator_user_id", "comment": "Reference to the user who created the journey"}, "is_enabled": {"type": "boolean", "index": 7, "name": "is_enabled", "comment": "Boolean indicating if the journey is currently enabled"}, "is_archived": {"type": "boolean", "index": 8, "name": "is_archived", "comment": "Boolean indicating if the journey has been archived"}, "lifetime_limit": {"type": "integer", "index": 9, "name": "lifetime_limit", "comment": "Maximum number of times a user may enter the journey over their lifetime"}, "simultaneous_limit": {"type": "integer", "index": 10, "name": "simultaneous_limit", "comment": "Maximum number of times a user may be in the journey at the same time"}, "start_tile_id": {"type": "text", "index": 11, "name": "start_tile_id", "comment": "Reference to the tile which begins the journey"}, "trigger_event_names": {"type": "text", "index": 12, "name": "trigger_event_names", "comment": "The event names which trigger a user's entry into the journey"}, "created_at": {"type": "timestamp without time zone", "index": 13, "name": "created_at", "comment": "Creation timestamp"}, "updated_at": {"type": "timestamp without time zone", "index": 14, "name": "updated_at", "comment": "Last update timestamp"}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 15, "name": "_fivetran_synced", "comment": "The time when a record was last updated by Fivetran."}, "count_total_campaigns": {"type": "bigint", "index": 16, "name": "count_total_campaigns", "comment": "Count of distinct campaigns within the journey that generated events"}, "count_unique_users": {"type": "bigint", "index": 17, "name": "count_unique_users", "comment": "Count of total unique users within the journey"}, "first_event_at": {"type": "timestamp without time zone", "index": 18, "name": "first_event_at", "comment": "Timestamp of the first event generated by any campaign in the journey"}, "last_event_at": {"type": "timestamp without time zone", "index": 19, "name": "last_event_at", "comment": "Timestamp of the most recent event generated by any campaign in the journey"}, "total_emailclick": {"type": "numeric", "index": 20, "name": "total_emailclick", "comment": "Total email clicks within the journey"}, "unique_total_emailclick": {"type": "bigint", "index": 21, "name": "unique_total_emailclick", "comment": "Unique email clicks within the journey"}, "total_emailunsubscribe": {"type": "numeric", "index": 22, "name": "total_emailunsubscribe", "comment": "Total email unsubscribe events within the journey"}, "unique_total_emailunsubscribe": {"type": "bigint", "index": 23, "name": "unique_total_emailunsubscribe", "comment": "Unique total email unsubscribe events within the journey"}, "total_emailcomplaint": {"type": "numeric", "index": 24, "name": "total_emailcomplaint", "comment": "Total email complaints within the journey"}, "unique_total_emailcomplaint": {"type": "bigint", "index": 25, "name": "unique_total_emailcomplaint", "comment": "Unique total email complaints within the journey"}, "total_customevent": {"type": "numeric", "index": 26, "name": "total_customevent", "comment": "Total custom events within the journey"}, "unique_total_customevent": {"type": "bigint", "index": 27, "name": "unique_total_customevent", "comment": "Unique total custom events within the journey"}, "total_emailsubscribe": {"type": "numeric", "index": 28, "name": "total_emailsubscribe", "comment": "Total email subscribe events within the journey"}, "unique_total_emailsubscribe": {"type": "bigint", "index": 29, "name": "unique_total_emailsubscribe", "comment": "Unique total email subscribe events within the journey"}, "total_emailopen": {"type": "numeric", "index": 30, "name": "total_emailopen", "comment": "Total email open events within the journey"}, "unique_total_emailopen": {"type": "bigint", "index": 31, "name": "unique_total_emailopen", "comment": "Unique total email open events within the journey"}, "total_pushsend": {"type": "numeric", "index": 32, "name": "total_pushsend", "comment": "Total push send events within the journey"}, "unique_total_pushsend": {"type": "bigint", "index": 33, "name": "unique_total_pushsend", "comment": "Unique total push send events within the journey"}, "total_smsbounce": {"type": "numeric", "index": 34, "name": "total_smsbounce", "comment": "Total sms bounce events within the journey"}, "unique_total_smsbounce": {"type": "bigint", "index": 35, "name": "unique_total_smsbounce", "comment": "Unique total sms bounce events within the journey"}, "total_pushbounce": {"type": "numeric", "index": 36, "name": "total_pushbounce", "comment": "Total push bounce events within the journey"}, "unique_total_pushbounce": {"type": "bigint", "index": 37, "name": "unique_total_pushbounce", "comment": "Unique total push bounce events within the journey"}, "total_inappsendskip": {"type": "numeric", "index": 38, "name": "total_inappsendskip", "comment": "Total in app send skip events within the journey"}, "unique_total_inappsendskip": {"type": "bigint", "index": 39, "name": "unique_total_inappsendskip", "comment": "Unique total in app send skip events within the journey"}, "total_smssend": {"type": "numeric", "index": 40, "name": "total_smssend", "comment": "Total sms send events within the journey"}, "unique_total_smssend": {"type": "bigint", "index": 41, "name": "unique_total_smssend", "comment": "Unique total sms send events within the journey"}, "total_inappsend": {"type": "numeric", "index": 42, "name": "total_inappsend", "comment": "Total in app send events within the journey"}, "unique_total_inappsend": {"type": "bigint", "index": 43, "name": "unique_total_inappsend", "comment": "Unique total in app send events within the journey"}, "total_pushopen": {"type": "numeric", "index": 44, "name": "total_pushopen", "comment": "Total push open events within the journey"}, "unique_total_pushopen": {"type": "bigint", "index": 45, "name": "unique_total_pushopen", "comment": "Unique total push open events within the journey"}, "total_emailsend": {"type": "numeric", "index": 46, "name": "total_emailsend", "comment": "Total email send events within the journey"}, "unique_total_emailsend": {"type": "bigint", "index": 47, "name": "unique_total_emailsend", "comment": "Unique total email send events within the journey"}, "total_pushsendskip": {"type": "numeric", "index": 48, "name": "total_pushsendskip", "comment": "Total push send skip events within the journey"}, "unique_total_pushsendskip": {"type": "bigint", "index": 49, "name": "unique_total_pushsendskip", "comment": "Unique total push send skip events within the journey"}, "total_inappopen": {"type": "numeric", "index": 50, "name": "total_inappopen", "comment": "Total in app open events within the journey"}, "unique_total_inappopen": {"type": "bigint", "index": 51, "name": "unique_total_inappopen", "comment": "Unique total in app open events within the journey"}, "total_emailsendskip": {"type": "numeric", "index": 52, "name": "total_emailsendskip", "comment": "Total email send skip events within the journey"}, "unique_total_emailsendskip": {"type": "bigint", "index": 53, "name": "unique_total_emailsendskip", "comment": "Unique total email send skip events within the journey"}, "total_emailbounce": {"type": "numeric", "index": 54, "name": "total_emailbounce", "comment": "Total email bounce events within the journey"}, "unique_total_emailbounce": {"type": "bigint", "index": 55, "name": "unique_total_emailbounce", "comment": "Unique total email bounce events within the journey"}, "total_inappclick": {"type": "numeric", "index": 56, "name": "total_inappclick", "comment": "Total in app click events within the journey"}, "unique_total_inappclick": {"type": "bigint", "index": 57, "name": "unique_total_inappclick", "comment": "Unique total in app click events within the journey"}, "total_pushuninstall": {"type": "numeric", "index": 58, "name": "total_pushuninstall", "comment": "Total push uninstall events within the journey"}, "unique_total_pushuninstall": {"type": "bigint", "index": 59, "name": "unique_total_pushuninstall", "comment": "Unique total push uninstall events within the journey"}, "email_open_rate": {"type": "numeric", "index": 60, "name": "email_open_rate", "comment": "Share of emails sent within the journey that were opened. Only present when both emailSend and emailOpen are included in the `iterable__event_metrics` variable."}, "email_click_rate": {"type": "numeric", "index": 61, "name": "email_click_rate", "comment": "Share of emails sent within the journey that were clicked. Only present when both emailSend and emailClick are included in the `iterable__event_metrics` variable."}, "email_bounce_rate": {"type": "numeric", "index": 62, "name": "email_bounce_rate", "comment": "Share of emails sent within the journey that bounced. Only present when both emailSend and emailBounce are included in the `iterable__event_metrics` variable."}, "email_unsubscribe_rate": {"type": "numeric", "index": 63, "name": "email_unsubscribe_rate", "comment": "Share of emails sent within the journey that resulted in an unsubscribe. Only present when both emailSend and emailUnSubscribe are included in the `iterable__event_metrics` variable."}, "unique_journey_id": {"type": "text", "index": 64, "name": "unique_journey_id", "comment": "Unique identifier combining journey_id and source_relation."}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.iterable__journeys"}, "model.iterable.iterable__list_user_history": {"metadata": {"type": "BASE TABLE", "schema": "public_iterable_dev", "name": "iterable__list_user_history", "database": "postgres", "comment": "Table that recreates the `list_user_history` source table. Additionally, this table provides an `is_current` field to identify the current lists associated with the user. The table coalesces list_id values from both the direct list_user relationships and the unnested email_list_ids from user history to ensure comprehensive list coverage. The grain of this table is at the user/list/updated_at level.\n", "owner": "postgres"}, "columns": {"source_relation": {"type": "text", "index": 1, "name": "source_relation", "comment": "Identifies the record's source."}, "unique_user_key": {"type": "text", "index": 2, "name": "unique_user_key", "comment": "The unique identifier of the user. With the new schema (Aug 2023), it is the _fivetran_user_id. This is a hash of user_id and/or email, depending on project type. If using the old schema, it is email."}, "_fivetran_user_id": {"type": "text", "index": 3, "name": "_fivetran_user_id", "comment": "A Fivetran-created unique identifier for the new Iterable schema in Aug 2023, for users, derived from hashing user_id and/or email, depending on project type."}, "user_id": {"type": "text", "index": 4, "name": "user_id", "comment": "User identifier, for userID-based projects."}, "user_email": {"type": "text", "index": 5, "name": "user_email", "comment": "Email of the user if it exists."}, "user_first_name": {"type": "integer", "index": 6, "name": "user_first_name", "comment": "First name of the user"}, "user_last_name": {"type": "integer", "index": 7, "name": "user_last_name", "comment": "Last name of the user"}, "user_signup_date": {"type": "text", "index": 8, "name": "user_signup_date", "comment": "Timestamp of when the user signed up"}, "user_signup_source": {"type": "text", "index": 9, "name": "user_signup_source", "comment": "Source where the user signed up"}, "user_updated_at": {"type": "timestamp without time zone", "index": 10, "name": "user_updated_at", "comment": "Last update timestamp"}, "list_id": {"type": "bigint", "index": 11, "name": "list_id", "comment": "The list associated with the user. Uses coalesced values prioritizing `list_id` from `LIST_USER` over the unnested `email_list_ids` from `USER_HISTORY` for comprehensive list coverage."}, "is_current": {"type": "boolean", "index": 12, "name": "is_current", "comment": "Boolean indicating if the current list is active"}, "list_name": {"type": "text", "index": 13, "name": "list_name", "comment": "Name of the list associated with the user"}, "list_type": {"type": "text", "index": 14, "name": "list_type", "comment": "Type of list associated with the user"}, "list_created_at": {"type": "text", "index": 15, "name": "list_created_at", "comment": "Date the list was created"}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.iterable__list_user_history"}, "model.iterable.iterable__user_campaign": {"metadata": {"type": "BASE TABLE", "schema": "public_iterable_dev", "name": "iterable__user_campaign", "database": "postgres", "comment": "Table that provides total and unique metrics for a user associated with particular campaigns and if available, experiments.", "owner": "postgres"}, "columns": {"source_relation": {"type": "text", "index": 1, "name": "source_relation", "comment": "Identifies the record's source."}, "_fivetran_user_id": {"type": "text", "index": 2, "name": "_fivetran_user_id", "comment": "A Fivetran-created unique identifier for the new Iterable schema in Aug 2023, for users, derived from hashing user_id and/or email, depending on project type."}, "unique_user_key": {"type": "text", "index": 3, "name": "unique_user_key", "comment": "The unique identifier of the user. With the new schema (Aug 2023), it is the _fivetran_user_id. This is a hash of user_id and/or email, depending on project type. If using the old schema, it is email."}, "user_id": {"type": "text", "index": 4, "name": "user_id", "comment": "User identifier, for userID-based projects."}, "campaign_id": {"type": "text", "index": 5, "name": "campaign_id", "comment": "The unique identifier of the campaign which the user metrics are associated"}, "experiment_id": {"type": "integer", "index": 6, "name": "experiment_id", "comment": "The unique experiment variation of the campaign"}, "user_email": {"type": "text", "index": 7, "name": "user_email", "comment": "Email of the user if it exists."}, "user_full_name": {"type": "text", "index": 8, "name": "user_full_name", "comment": "The users first and last name"}, "campaign_name": {"type": "text", "index": 9, "name": "campaign_name", "comment": "The name of the campaign which the user metrics are associated"}, "template_id": {"type": "text", "index": 10, "name": "template_id", "comment": "The unique identifier of the template used within the campaign"}, "template_name": {"type": "text", "index": 11, "name": "template_name", "comment": "The name of the template used for the campaign"}, "recurring_campaign_id": {"type": "text", "index": 12, "name": "recurring_campaign_id", "comment": "The unique identifier of the recurring campaign which the campaign is tied to"}, "recurring_campaign_name": {"type": "text", "index": 13, "name": "recurring_campaign_name", "comment": "The name of the recurring campaign which the campaign is tied to"}, "first_event_at": {"type": "timestamp without time zone", "index": 14, "name": "first_event_at", "comment": "Timestamp of the first campaign/experiment event associated with the user"}, "last_event_at": {"type": "timestamp without time zone", "index": 15, "name": "last_event_at", "comment": "Timestamp of the most recent campaign/experiment event associated with the user"}, "first_open_or_click_event_at": {"type": "timestamp without time zone", "index": 16, "name": "first_open_or_click_event_at", "comment": "The time of the first open or click time. This is the first time a user interacts with a campaign, recording the earliest occurring event out of 'emailOpen', 'emailClick', and 'pushOpen'."}, "total_emailclick": {"type": "bigint", "index": 17, "name": "total_emailclick", "comment": "Total email clicks events the user took within the campaign/experiment"}, "total_emailunsubscribe": {"type": "bigint", "index": 18, "name": "total_emailunsubscribe", "comment": "Total email unsubscription events the user performed within the campaign/experiment"}, "total_emailcomplaint": {"type": "bigint", "index": 19, "name": "total_emailcomplaint", "comment": "Total email complaint events the user performed within the campaign/experiment"}, "total_customevent": {"type": "bigint", "index": 20, "name": "total_customevent", "comment": "Total custom events associated with the user within the campaign/experiment"}, "total_emailsubscribe": {"type": "bigint", "index": 21, "name": "total_emailsubscribe", "comment": "Total email subscription events associate with the user within the campaign/experiment"}, "total_emailopen": {"type": "bigint", "index": 22, "name": "total_emailopen", "comment": "Total email open events the user performed within the campaign/experiment"}, "total_pushsend": {"type": "bigint", "index": 23, "name": "total_pushsend", "comment": "Total push send events the user performed within the campaign/experiment"}, "total_smsbounce": {"type": "bigint", "index": 24, "name": "total_smsbounce", "comment": "Total sms bounce events associated with the user within the campaign/experiment"}, "total_pushbounce": {"type": "bigint", "index": 25, "name": "total_pushbounce", "comment": "Total push bounce events associated with the user within the campaign/experiment"}, "total_inappsendskip": {"type": "bigint", "index": 26, "name": "total_inappsendskip", "comment": "Total in app send skip events the user performed within the campaign/experiment"}, "total_smssend": {"type": "bigint", "index": 27, "name": "total_smssend", "comment": "Total sms send events associated with the user within the campaign/experiment"}, "total_inappsend": {"type": "bigint", "index": 28, "name": "total_inappsend", "comment": "Total in app send events associated with the user within the campaign/experiment"}, "total_pushopen": {"type": "bigint", "index": 29, "name": "total_pushopen", "comment": "Total push open events the user performed within the campaign/experiment"}, "total_emailsend": {"type": "bigint", "index": 30, "name": "total_emailsend", "comment": "Total email send event associated with the user within the campaign/experiment"}, "total_pushsendskip": {"type": "bigint", "index": 31, "name": "total_pushsendskip", "comment": "Total push send skip events associated with the user within the campaign/experiment"}, "total_inappopen": {"type": "bigint", "index": 32, "name": "total_inappopen", "comment": "Total in app open events associated with the user within the campaign/experiment"}, "total_emailsendskip": {"type": "bigint", "index": 33, "name": "total_emailsendskip", "comment": "Total email send skip events associated with the user within the campaign/experiment"}, "total_emailbounce": {"type": "bigint", "index": 34, "name": "total_emailbounce", "comment": "Total email bounce events associated with the user within the campaign/experiment"}, "total_inappclick": {"type": "bigint", "index": 35, "name": "total_inappclick", "comment": "Total in app click events associated with the user within the campaign/experiment"}, "total_pushuninstall": {"type": "bigint", "index": 36, "name": "total_pushuninstall", "comment": "Total push uninstall events associated with the user within the campaign/experiment"}, "unique_user_campaign_id": {"type": "text", "index": 37, "name": "unique_user_campaign_id", "comment": "Unique ID combining source_relation, unique_user_key, campaign_id, and if available, experiment_id."}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.iterable__user_campaign"}, "model.iterable.iterable__user_unsubscriptions": {"metadata": {"type": "BASE TABLE", "schema": "public_iterable_dev", "name": "iterable__user_unsubscriptions", "database": "postgres", "comment": "Table that generates the total channel and message types a user has chosen to unsubscribe.", "owner": "postgres"}, "columns": {"source_relation": {"type": "text", "index": 1, "name": "source_relation", "comment": "Identifies the record's source."}, "_fivetran_user_id": {"type": "text", "index": 2, "name": "_fivetran_user_id", "comment": "A Fivetran-created unique identifier for the new Iterable schema in Aug 2023, for users, derived from hashing user_id and/or email, depending on project type."}, "unique_user_key": {"type": "text", "index": 3, "name": "unique_user_key", "comment": "The unique identifier of the user. With the new schema (Aug 2023), it is the _fivetran_user_id. This is a hash of user_id and/or email, depending on project type. If using the old schema, it is email."}, "channel_id": {"type": "text", "index": 4, "name": "channel_id", "comment": "Unique identifier of the channel which the user is unsubscribed"}, "message_type_id": {"type": "text", "index": 5, "name": "message_type_id", "comment": "Unique identifier of the message type which the user is unsubscribed"}, "updated_at": {"type": "timestamp without time zone", "index": 6, "name": "updated_at", "comment": "Timestamp of when the user unsubscribed from the channel or message type"}, "channel_name": {"type": "text", "index": 7, "name": "channel_name", "comment": "The name of the channel which the user is unsubscribed"}, "message_type_name": {"type": "text", "index": 8, "name": "message_type_name", "comment": "The name of the message type which the user is unsubscribed"}, "channel_type": {"type": "text", "index": 9, "name": "channel_type", "comment": "The channel type which the user is unsubscribed"}, "message_medium": {"type": "text", "index": 10, "name": "message_medium", "comment": "The medium type the message was provided which the user is unsubscribed"}, "is_unsubscribed_channel_wide": {"type": "boolean", "index": 11, "name": "is_unsubscribed_channel_wide", "comment": "Boolean indicating if the user unsubscribed at the channel level (i.e. unsubscribed to all message types) or if they unsubscribed from only an individual message type.\n"}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.iterable__user_unsubscriptions"}, "model.iterable.iterable__users": {"metadata": {"type": "BASE TABLE", "schema": "public_iterable_dev", "name": "iterable__users", "database": "postgres", "comment": "Table that provides unique user enriched information.", "owner": "postgres"}, "columns": {"source_relation": {"type": "text", "index": 1, "name": "source_relation", "comment": "Identifies the record's source."}, "user_id": {"type": "text", "index": 2, "name": "user_id", "comment": "User identifier, for userID-based projects."}, "_fivetran_user_id": {"type": "text", "index": 3, "name": "_fivetran_user_id", "comment": "A Fivetran-created unique identifier for the new Iterable schema in Aug 2023, for users, derived from hashing user_id and/or email, depending on project type."}, "unique_user_key": {"type": "text", "index": 4, "name": "unique_user_key", "comment": "The unique identifier of the user. With the new schema (Aug 2023), it is the _fivetran_user_id. This is a hash of user_id and/or email, depending on project type. If using the old schema, it is email."}, "email": {"type": "text", "index": 5, "name": "email", "comment": "The user's email. User identifier, for email-based projects. Previously was the unique identifier for user records, for the old Iterable schema before the August 2023 updates."}, "first_name": {"type": "integer", "index": 6, "name": "first_name", "comment": "First name of the user"}, "last_name": {"type": "integer", "index": 7, "name": "last_name", "comment": "Last name of the user"}, "signup_date": {"type": "text", "index": 8, "name": "signup_date", "comment": "Timestamp of when the user signed up"}, "signup_source": {"type": "text", "index": 9, "name": "signup_source", "comment": "Source where the user signed up"}, "updated_at": {"type": "timestamp without time zone", "index": 10, "name": "updated_at", "comment": "Last update timestamp"}, "phone_number": {"type": "integer", "index": 11, "name": "phone_number", "comment": "Phone number associated with the user"}, "email_list_ids": {"type": "text", "index": 12, "name": "email_list_ids", "comment": "Array of all email lists associated with the user, derived from the list_user table relationships"}, "count_lists": {"type": "bigint", "index": 13, "name": "count_lists", "comment": "Total count of lists associated with the user"}, "count_total_campaigns": {"type": "bigint", "index": 14, "name": "count_total_campaigns", "comment": "Count of all campaigns the user has been in"}, "first_event_at": {"type": "timestamp without time zone", "index": 15, "name": "first_event_at", "comment": "The first event the user ever encountered"}, "last_event_at": {"type": "timestamp without time zone", "index": 16, "name": "last_event_at", "comment": "The most recent event the user has encountered"}, "total_emailclick": {"type": "numeric", "index": 17, "name": "total_emailclick", "comment": "Total number of email clicks the user has performed"}, "total_emailunsubscribe": {"type": "numeric", "index": 18, "name": "total_emailunsubscribe", "comment": "Total unsubscription events the user has performed"}, "total_emailcomplaint": {"type": "numeric", "index": 19, "name": "total_emailcomplaint", "comment": "Total email complaints the user has performed"}, "total_customevent": {"type": "numeric", "index": 20, "name": "total_customevent", "comment": "Total custom events associated with the user"}, "total_emailsubscribe": {"type": "numeric", "index": 21, "name": "total_emailsubscribe", "comment": "Total subscription events the user has performed"}, "total_emailopen": {"type": "numeric", "index": 22, "name": "total_emailopen", "comment": "Total email opened events the user has performed"}, "total_pushsend": {"type": "numeric", "index": 23, "name": "total_pushsend", "comment": "The push send events the user has experienced"}, "total_smsbounce": {"type": "numeric", "index": 24, "name": "total_smsbounce", "comment": "Total sms bounces that are associated with the user"}, "total_pushbounce": {"type": "numeric", "index": 25, "name": "total_pushbounce", "comment": "Total number of push bounces associated with the user"}, "total_inappsendskip": {"type": "numeric", "index": 26, "name": "total_inappsendskip", "comment": "Total in app send skips associated with the user"}, "total_smssend": {"type": "numeric", "index": 27, "name": "total_smssend", "comment": "Total sms sends that the user has experienced"}, "total_inappsend": {"type": "numeric", "index": 28, "name": "total_inappsend", "comment": "Total in app sends the user has experienced"}, "total_pushopen": {"type": "numeric", "index": 29, "name": "total_pushopen", "comment": "Total push messages the user has opened"}, "total_emailsend": {"type": "numeric", "index": 30, "name": "total_emailsend", "comment": "Total emails that have been sent to the user"}, "total_pushsendskip": {"type": "numeric", "index": 31, "name": "total_pushsendskip", "comment": "Total push sends the user has skipped"}, "total_inappopen": {"type": "numeric", "index": 32, "name": "total_inappopen", "comment": "Total in app opens the user has performed"}, "total_emailsendskip": {"type": "numeric", "index": 33, "name": "total_emailsendskip", "comment": "Total email sends the user has skipped"}, "total_emailbounce": {"type": "numeric", "index": 34, "name": "total_emailbounce", "comment": "Total number of emails that have bounced from the user"}, "total_inappclick": {"type": "numeric", "index": 35, "name": "total_inappclick", "comment": "Total in app clicks associated with the user"}, "total_pushuninstall": {"type": "numeric", "index": 36, "name": "total_pushuninstall", "comment": "Total push uninstall events the user has performed"}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.iterable__users"}, "model.iterable.stg_iterable__campaign_history": {"metadata": {"type": "BASE TABLE", "schema": "public_iterable_dev", "name": "stg_iterable__campaign_history", "database": "postgres", "comment": "Table containing a history of campaigns.", "owner": "postgres"}, "columns": {"source_relation": {"type": "text", "index": 1, "name": "source_relation", "comment": "Identifies the record's source."}, "campaign_id": {"type": "text", "index": 2, "name": "campaign_id", "comment": "Unique identifier of the campaign record"}, "updated_at": {"type": "text", "index": 3, "name": "updated_at", "comment": "Last update timestamp"}, "campaign_name": {"type": "text", "index": 4, "name": "campaign_name", "comment": "User defined name of the campaign."}, "campaign_state": {"type": "text", "index": 5, "name": "campaign_state", "comment": "State of the campaign. Can be Draft, Ready, Scheduled, Running, Finished, Starting, Aborted or Recurring"}, "campaign_type": {"type": "text", "index": 6, "name": "campaign_type", "comment": "The campaign type. Can be Blast or Triggered"}, "send_size": {"type": "integer", "index": 7, "name": "send_size", "comment": "Size of the campaign. Number of individuals included in the campaign"}, "start_at": {"type": "integer", "index": 8, "name": "start_at", "comment": "Start timestamp"}, "ended_at": {"type": "integer", "index": 9, "name": "ended_at", "comment": "Ended timestamp"}, "created_at": {"type": "text", "index": 10, "name": "created_at", "comment": "Creation timestamp"}, "message_medium": {"type": "text", "index": 11, "name": "message_medium", "comment": "The medium that this message was sent via, for example Email or InApp"}, "recurring_campaign_id": {"type": "text", "index": 12, "name": "recurring_campaign_id", "comment": "Reference to the recurring campaign, if applicable"}, "created_by_user_id": {"type": "text", "index": 13, "name": "created_by_user_id", "comment": "Reference to the user who created the campaign"}, "updated_by_user_id": {"type": "text", "index": 14, "name": "updated_by_user_id", "comment": "ID of the user who updated this record"}, "template_id": {"type": "text", "index": 15, "name": "template_id", "comment": "Reference to the campaign template"}, "workflow_id": {"type": "integer", "index": 16, "name": "workflow_id", "comment": "Reference to the workflow which the event originated"}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 17, "name": "_fivetran_synced", "comment": "The time when a record was last updated by Fivetran."}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.stg_iterable__campaign_history"}, "model.iterable.stg_iterable__campaign_history_tmp": {"metadata": {"type": "VIEW", "schema": "public_iterable_dev", "name": "stg_iterable__campaign_history_tmp", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"id": {"type": "integer", "index": 1, "name": "id", "comment": null}, "updated_at": {"type": "text", "index": 2, "name": "updated_at", "comment": null}, "template_id": {"type": "integer", "index": 3, "name": "template_id", "comment": null}, "recurring_campaign_id": {"type": "integer", "index": 4, "name": "recurring_campaign_id", "comment": null}, "campaign_state": {"type": "text", "index": 5, "name": "campaign_state", "comment": null}, "created_at": {"type": "text", "index": 6, "name": "created_at", "comment": null}, "created_by_user_id": {"type": "text", "index": 7, "name": "created_by_user_id", "comment": null}, "ended_at": {"type": "integer", "index": 8, "name": "ended_at", "comment": null}, "name": {"type": "text", "index": 9, "name": "name", "comment": null}, "send_size": {"type": "integer", "index": 10, "name": "send_size", "comment": null}, "start_at": {"type": "integer", "index": 11, "name": "start_at", "comment": null}, "type": {"type": "text", "index": 12, "name": "type", "comment": null}, "workflow_id": {"type": "integer", "index": 13, "name": "workflow_id", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 14, "name": "_fivetran_synced", "comment": null}, "updated_by_user_id": {"type": "integer", "index": 15, "name": "updated_by_user_id", "comment": null}, "message_medium": {"type": "text", "index": 16, "name": "message_medium", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.stg_iterable__campaign_history_tmp"}, "model.iterable.stg_iterable__campaign_label_history": {"metadata": {"type": "BASE TABLE", "schema": "public_iterable_dev", "name": "stg_iterable__campaign_label_history", "database": "postgres", "comment": "Table containing a history of labels.", "owner": "postgres"}, "columns": {"source_relation": {"type": "text", "index": 1, "name": "source_relation", "comment": "Identifies the record's source."}, "campaign_id": {"type": "text", "index": 2, "name": "campaign_id", "comment": "Reference to the campaign associated with the label"}, "label": {"type": "text", "index": 3, "name": "label", "comment": "Name of the label"}, "updated_at": {"type": "text", "index": 4, "name": "updated_at", "comment": "Last update timestamp"}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 5, "name": "_fivetran_synced", "comment": "The time when a record was last updated by Fivetran."}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.stg_iterable__campaign_label_history"}, "model.iterable.stg_iterable__campaign_label_history_tmp": {"metadata": {"type": "VIEW", "schema": "public_iterable_dev", "name": "stg_iterable__campaign_label_history_tmp", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"campaign_id": {"type": "integer", "index": 1, "name": "campaign_id", "comment": null}, "label": {"type": "text", "index": 2, "name": "label", "comment": null}, "updated_at": {"type": "text", "index": 3, "name": "updated_at", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 4, "name": "_fivetran_synced", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.stg_iterable__campaign_label_history_tmp"}, "model.iterable.stg_iterable__campaign_list_history": {"metadata": {"type": "BASE TABLE", "schema": "public_iterable_dev", "name": "stg_iterable__campaign_list_history", "database": "postgres", "comment": "Table containing a history of lists.", "owner": "postgres"}, "columns": {"source_relation": {"type": "text", "index": 1, "name": "source_relation", "comment": "Identifies the record's source."}, "campaign_id": {"type": "text", "index": 2, "name": "campaign_id", "comment": "Reference to the campaign associated with the label"}, "list_id": {"type": "text", "index": 3, "name": "list_id", "comment": "Reference to the list used"}, "updated_at": {"type": "text", "index": 4, "name": "updated_at", "comment": "Last update timestamp"}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 5, "name": "_fivetran_synced", "comment": "The time when a record was last updated by Fivetran."}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.stg_iterable__campaign_list_history"}, "model.iterable.stg_iterable__campaign_list_history_tmp": {"metadata": {"type": "VIEW", "schema": "public_iterable_dev", "name": "stg_iterable__campaign_list_history_tmp", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"list_id": {"type": "integer", "index": 1, "name": "list_id", "comment": null}, "campaign_id": {"type": "integer", "index": 2, "name": "campaign_id", "comment": null}, "updated_at": {"type": "text", "index": 3, "name": "updated_at", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 4, "name": "_fivetran_synced", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.stg_iterable__campaign_list_history_tmp"}, "model.iterable.stg_iterable__campaign_suppression_list_history": {"metadata": {"type": "BASE TABLE", "schema": "public_iterable_dev", "name": "stg_iterable__campaign_suppression_list_history", "database": "postgres", "comment": "Table containing a history of suppression lists.", "owner": "postgres"}, "columns": {"source_relation": {"type": "text", "index": 1, "name": "source_relation", "comment": "Identifies the record's source."}, "campaign_id": {"type": "text", "index": 2, "name": "campaign_id", "comment": "Reference to the campaign associated with the label"}, "suppressed_list_id": {"type": "text", "index": 3, "name": "suppressed_list_id", "comment": "Reference to the list used"}, "updated_at": {"type": "text", "index": 4, "name": "updated_at", "comment": "Last update timestamp"}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 5, "name": "_fivetran_synced", "comment": "The time when a record was last updated by Fivetran."}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.stg_iterable__campaign_suppression_list_history"}, "model.iterable.stg_iterable__campaign_suppression_list_history_tmp": {"metadata": {"type": "VIEW", "schema": "public_iterable_dev", "name": "stg_iterable__campaign_suppression_list_history_tmp", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"suppressed_list_id": {"type": "integer", "index": 1, "name": "suppressed_list_id", "comment": null}, "campaign_id": {"type": "integer", "index": 2, "name": "campaign_id", "comment": null}, "updated_at": {"type": "text", "index": 3, "name": "updated_at", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 4, "name": "_fivetran_synced", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.stg_iterable__campaign_suppression_list_history_tmp"}, "model.iterable.stg_iterable__channel": {"metadata": {"type": "BASE TABLE", "schema": "public_iterable_dev", "name": "stg_iterable__channel", "database": "postgres", "comment": "Table containing unique channels.", "owner": "postgres"}, "columns": {"source_relation": {"type": "text", "index": 1, "name": "source_relation", "comment": "Identifies the record's source."}, "channel_id": {"type": "text", "index": 2, "name": "channel_id", "comment": "Unique identifier of the channel"}, "channel_name": {"type": "text", "index": 3, "name": "channel_name", "comment": "User defined name of the channel"}, "channel_type": {"type": "text", "index": 4, "name": "channel_type", "comment": "The channel type"}, "message_medium": {"type": "text", "index": 5, "name": "message_medium", "comment": "The message medium associated with the channel"}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 6, "name": "_fivetran_synced", "comment": "The time when a record was last updated by Fivetran."}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.stg_iterable__channel"}, "model.iterable.stg_iterable__channel_tmp": {"metadata": {"type": "VIEW", "schema": "public_iterable_dev", "name": "stg_iterable__channel_tmp", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"id": {"type": "bigint", "index": 1, "name": "id", "comment": null}, "name": {"type": "text", "index": 2, "name": "name", "comment": null}, "channel_type": {"type": "text", "index": 3, "name": "channel_type", "comment": null}, "message_medium": {"type": "text", "index": 4, "name": "message_medium", "comment": null}, "_fivetran_deleted": {"type": "boolean", "index": 5, "name": "_fivetran_deleted", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 6, "name": "_fivetran_synced", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.stg_iterable__channel_tmp"}, "model.iterable.stg_iterable__event": {"metadata": {"type": "VIEW", "schema": "public_iterable_dev", "name": "stg_iterable__event", "database": "postgres", "comment": "Table containing individual events within campaigns.", "owner": "postgres"}, "columns": {"source_relation": {"type": "text", "index": 1, "name": "source_relation", "comment": "Identifies the record's source."}, "event_id": {"type": "text", "index": 2, "name": "event_id", "comment": "A Fivetran-created unique identifier derived from hashing campaign_id, created_at, and event_name."}, "unique_event_id": {"type": "text", "index": 3, "name": "unique_event_id", "comment": "A surrogate key made up of event_id, _fivetran_user_id, and source_relation."}, "_fivetran_user_id": {"type": "text", "index": 4, "name": "_fivetran_user_id", "comment": "A Fivetran-created unique identifier for users, derived from hashing user_id and/or email, depending on project type. This exists for users of the new schema starting Aug 2023. In the old schema, the unique identifier is email."}, "unique_user_key": {"type": "text", "index": 5, "name": "unique_user_key", "comment": "The unique identifier of the user. With the new schema (Aug 2023), it is the _fivetran_user_id. This is a hash of user_id and/or email, depending on project type. If using the old schema, it is email."}, "campaign_id": {"type": "text", "index": 6, "name": "campaign_id", "comment": "Reference to the campaign from which the event originated"}, "content_id": {"type": "text", "index": 7, "name": "content_id", "comment": "Reference to the content the event is associated with"}, "created_at": {"type": "timestamp without time zone", "index": 8, "name": "created_at", "comment": "Creation timestamp"}, "created_on": {"type": "date", "index": 9, "name": "created_on", "comment": "Creation date"}, "email": {"type": "text", "index": 10, "name": "email", "comment": "Reference to the unique user the event was applied to"}, "additional_properties": {"type": "text", "index": 11, "name": "additional_properties", "comment": "json object containing addition event properties"}, "event_name": {"type": "text", "index": 12, "name": "event_name", "comment": "Name provided to the individual event"}, "message_bus_id": {"type": "text", "index": 13, "name": "message_bus_id", "comment": "Reference to the message bus associated with the event"}, "message_id": {"type": "text", "index": 14, "name": "message_id", "comment": "Reference to the message the event is associated with"}, "message_type_id": {"type": "text", "index": 15, "name": "message_type_id", "comment": "Reference to the type of message the event is associated with"}, "recipient_state": {"type": "integer", "index": 16, "name": "recipient_state", "comment": "The state of the recipient upon receiving the event"}, "status": {"type": "integer", "index": 17, "name": "status", "comment": "Status of the event"}, "transactional_data": {"type": "character varying(100)", "index": 18, "name": "transactional_data", "comment": "Transactional data associated with the event"}, "unsub_source": {"type": "integer", "index": 19, "name": "unsub_source", "comment": "Source of the unsubscribe event"}, "user_agent": {"type": "integer", "index": 20, "name": "user_agent", "comment": "User agent associated with the event"}, "user_agent_device": {"type": "integer", "index": 21, "name": "user_agent_device", "comment": "The device of the user agent"}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 22, "name": "_fivetran_synced", "comment": "The time when a record was last updated by Fivetran."}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.stg_iterable__event"}, "model.iterable.stg_iterable__event_extension": {"metadata": {"type": "VIEW", "schema": "public_iterable_dev", "name": "stg_iterable__event_extension", "database": "postgres", "comment": "Table containing addition properties from the event table.", "owner": "postgres"}, "columns": {"source_relation": {"type": "text", "index": 1, "name": "source_relation", "comment": "Identifies the record's source."}, "event_id": {"type": "text", "index": 2, "name": "event_id", "comment": "A Fivetran-created unique identifier derived from hashing campaign_id, created_at, and event_name."}, "unique_event_id": {"type": "text", "index": 3, "name": "unique_event_id", "comment": "A surrogate key made up of event_id, _fivetran_user_id, and source_relation."}, "is_app_already_running": {"type": "integer", "index": 4, "name": "is_app_already_running", "comment": "Boolean indicating if the app is currently running or not"}, "badge": {"type": "integer", "index": 5, "name": "badge", "comment": "Badge associated with the event"}, "catalog_collection_count": {"type": "integer", "index": 6, "name": "catalog_collection_count", "comment": "The count of products or items collected in a catalog associated with the event."}, "catalog_lookup_count": {"type": "integer", "index": 7, "name": "catalog_lookup_count", "comment": "The count of times a catalog was looked up or queried during the event."}, "canonical_url_id": {"type": "text", "index": 8, "name": "canonical_url_id", "comment": "Reference to the url associated with the event"}, "is_content_available": {"type": "integer", "index": 9, "name": "is_content_available", "comment": "Content available from the event"}, "content_id": {"type": "text", "index": 10, "name": "content_id", "comment": "Reference to the content associated with the event"}, "device": {"type": "integer", "index": 11, "name": "device", "comment": "The device associated with the event"}, "email_id": {"type": "text", "index": 12, "name": "email_id", "comment": "Reference to the email associated with the event"}, "email_subject": {"type": "text", "index": 13, "name": "email_subject", "comment": "Subject of the email associated with the event"}, "experiment_id": {"type": "integer", "index": 14, "name": "experiment_id", "comment": "Reference to the experiment used if the event is an experiment"}, "from_phone_number_id": {"type": "integer", "index": 15, "name": "from_phone_number_id", "comment": "Reference to the phone number which the event is from"}, "from_smssender_id": {"type": "integer", "index": 16, "name": "from_smssender_id", "comment": "Reference to the sms sender which the event is from"}, "link_id": {"type": "text", "index": 17, "name": "link_id", "comment": "Reference to the link associated with the event"}, "link_url": {"type": "integer", "index": 18, "name": "link_url", "comment": "Url of the link associated with the event"}, "locale": {"type": "integer", "index": 19, "name": "locale", "comment": "Locale associated with the event"}, "payload": {"type": "character varying(100)", "index": 20, "name": "payload", "comment": "Payload resulted from the event"}, "platform_endpoint": {"type": "integer", "index": 21, "name": "platform_endpoint", "comment": "The specific platform endpoint of the event"}, "push_message": {"type": "integer", "index": 22, "name": "push_message", "comment": "Boolean indicating if the event is a push message"}, "region": {"type": "text", "index": 23, "name": "region", "comment": "Region of the event"}, "sms_message": {"type": "integer", "index": 24, "name": "sms_message", "comment": "Boolean indicating if the event is an sms message"}, "to_phone_number": {"type": "integer", "index": 25, "name": "to_phone_number", "comment": "To phone number associated with the event"}, "url": {"type": "integer", "index": 26, "name": "url", "comment": "Url associated with the event"}, "workflow_id": {"type": "text", "index": 27, "name": "workflow_id", "comment": "Reference to the workflow which the event originated"}, "workflow_name": {"type": "text", "index": 28, "name": "workflow_name", "comment": "Name of the workflow which the event originated"}, "city": {"type": "text", "index": 29, "name": "city", "comment": "The city associated with the event, which could be the location of the recipient."}, "clicked_url": {"type": "text", "index": 30, "name": "clicked_url", "comment": "The URL that was clicked by the recipient in response to the marketing message."}, "country": {"type": "text", "index": 31, "name": "country", "comment": "The country associated with the event, which could be the location of the recipient."}, "error_code": {"type": "integer", "index": 32, "name": "error_code", "comment": "The error code or message indicating any issues or errors encountered during the event."}, "expires_at": {"type": "text", "index": 33, "name": "expires_at", "comment": "The date and time when the event or message is set to expire or become invalid."}, "from_phone_number": {"type": "integer", "index": 34, "name": "from_phone_number", "comment": "The phone number from which the SMS message was sent."}, "in_app_body": {"type": "text", "index": 35, "name": "in_app_body", "comment": "The content or body of an in-app message that was sent as part of the event."}, "is_sms_estimation": {"type": "boolean", "index": 36, "name": "is_sms_estimation", "comment": "A boolean indicating whether the SMS message is an estimation or not."}, "labels": {"type": "text", "index": 37, "name": "labels", "comment": "Any labels or tags associated with the event, which can be used for categorization or organization."}, "message_status": {"type": "text", "index": 38, "name": "message_status", "comment": "The status of the marketing message, such as sent, delivered, opened, etc."}, "mms_send_count": {"type": "integer", "index": 39, "name": "mms_send_count", "comment": "The count of multimedia messages (MMS) sent as part of the event."}, "reason": {"type": "text", "index": 40, "name": "reason", "comment": "The reason or cause associated with a specific event or action."}, "sms_send_count": {"type": "integer", "index": 41, "name": "sms_send_count", "comment": "The count of SMS messages sent as part of the event."}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 42, "name": "_fivetran_synced", "comment": "The time when a record was last updated by Fivetran."}, "_fivetran_user_id": {"type": "text", "index": 43, "name": "_fivetran_user_id", "comment": "A Fivetran-created unique identifier for users, derived from hashing user_id and/or email, depending on project type. This exists for users of the new schema starting Aug 2023. In the old schema, the unique identifier is email."}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.stg_iterable__event_extension"}, "model.iterable.stg_iterable__event_extension_tmp": {"metadata": {"type": "VIEW", "schema": "public_iterable_dev", "name": "stg_iterable__event_extension_tmp", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"_fivetran_id": {"type": "text", "index": 1, "name": "_fivetran_id", "comment": null}, "app_already_running": {"type": "integer", "index": 2, "name": "app_already_running", "comment": null}, "badge": {"type": "integer", "index": 3, "name": "badge", "comment": null}, "canonical_url_id": {"type": "integer", "index": 4, "name": "canonical_url_id", "comment": null}, "content_available": {"type": "integer", "index": 5, "name": "content_available", "comment": null}, "content_id": {"type": "integer", "index": 6, "name": "content_id", "comment": null}, "device": {"type": "integer", "index": 7, "name": "device", "comment": null}, "email_id": {"type": "text", "index": 8, "name": "email_id", "comment": null}, "email_subject": {"type": "text", "index": 9, "name": "email_subject", "comment": null}, "experiment_id": {"type": "integer", "index": 10, "name": "experiment_id", "comment": null}, "from_phone_number_id": {"type": "integer", "index": 11, "name": "from_phone_number_id", "comment": null}, "from_smssender_id": {"type": "integer", "index": 12, "name": "from_smssender_id", "comment": null}, "image_url": {"type": "integer", "index": 13, "name": "image_url", "comment": null}, "is_ghost_push": {"type": "integer", "index": 14, "name": "is_ghost_push", "comment": null}, "link_id": {"type": "integer", "index": 15, "name": "link_id", "comment": null}, "link_url": {"type": "integer", "index": 16, "name": "link_url", "comment": null}, "platform_endpoint": {"type": "integer", "index": 17, "name": "platform_endpoint", "comment": null}, "push_message": {"type": "integer", "index": 18, "name": "push_message", "comment": null}, "region": {"type": "text", "index": 19, "name": "region", "comment": null}, "sms_message": {"type": "integer", "index": 20, "name": "sms_message", "comment": null}, "sound": {"type": "integer", "index": 21, "name": "sound", "comment": null}, "to_phone_number": {"type": "integer", "index": 22, "name": "to_phone_number", "comment": null}, "url": {"type": "integer", "index": 23, "name": "url", "comment": null}, "workflow_id": {"type": "integer", "index": 24, "name": "workflow_id", "comment": null}, "workflow_name": {"type": "text", "index": 25, "name": "workflow_name", "comment": null}, "locale": {"type": "integer", "index": 26, "name": "locale", "comment": null}, "deeplink_android": {"type": "integer", "index": 27, "name": "deeplink_android", "comment": null}, "deeplink_ios": {"type": "integer", "index": 28, "name": "deeplink_ios", "comment": null}, "payload": {"type": "character varying(100)", "index": 29, "name": "payload", "comment": null}, "sms_provider_response_status": {"type": "integer", "index": 30, "name": "sms_provider_response_status", "comment": null}, "sms_provider_response_message": {"type": "integer", "index": 31, "name": "sms_provider_response_message", "comment": null}, "sms_provider_response_code": {"type": "integer", "index": 32, "name": "sms_provider_response_code", "comment": null}, "sms_provider_response_more_info": {"type": "integer", "index": 33, "name": "sms_provider_response_more_info", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 34, "name": "_fivetran_synced", "comment": null}, "catalog_collection_count": {"type": "integer", "index": 35, "name": "catalog_collection_count", "comment": null}, "catalog_lookup_count": {"type": "integer", "index": 36, "name": "catalog_lookup_count", "comment": null}, "city": {"type": "text", "index": 37, "name": "city", "comment": null}, "clicked_url": {"type": "text", "index": 38, "name": "clicked_url", "comment": null}, "country": {"type": "text", "index": 39, "name": "country", "comment": null}, "error_code": {"type": "integer", "index": 40, "name": "error_code", "comment": null}, "expires_at": {"type": "text", "index": 41, "name": "expires_at", "comment": null}, "from_phone_number": {"type": "integer", "index": 42, "name": "from_phone_number", "comment": null}, "in_app_body": {"type": "text", "index": 43, "name": "in_app_body", "comment": null}, "is_sms_estimation": {"type": "boolean", "index": 44, "name": "is_sms_estimation", "comment": null}, "labels": {"type": "text", "index": 45, "name": "labels", "comment": null}, "message_context": {"type": "text", "index": 46, "name": "message_context", "comment": null}, "message_status": {"type": "text", "index": 47, "name": "message_status", "comment": null}, "mms_send_count": {"type": "integer", "index": 48, "name": "mms_send_count", "comment": null}, "product_recommendation_count": {"type": "integer", "index": 49, "name": "product_recommendation_count", "comment": null}, "proxy_source": {"type": "text", "index": 50, "name": "proxy_source", "comment": null}, "reason": {"type": "text", "index": 51, "name": "reason", "comment": null}, "sms_send_count": {"type": "integer", "index": 52, "name": "sms_send_count", "comment": null}, "web_push_body": {"type": "text", "index": 53, "name": "web_push_body", "comment": null}, "web_push_click_action": {"type": "text", "index": 54, "name": "web_push_click_action", "comment": null}, "web_push_icon": {"type": "text", "index": 55, "name": "web_push_icon", "comment": null}, "web_push_message": {"type": "text", "index": 56, "name": "web_push_message", "comment": null}, "_fivetran_user_id": {"type": "integer", "index": 57, "name": "_fivetran_user_id", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.stg_iterable__event_extension_tmp"}, "model.iterable.stg_iterable__event_tmp": {"metadata": {"type": "VIEW", "schema": "public_iterable_dev", "name": "stg_iterable__event_tmp", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"_fivetran_id": {"type": "text", "index": 1, "name": "_fivetran_id", "comment": null}, "email": {"type": "text", "index": 2, "name": "email", "comment": null}, "campaign_id": {"type": "integer", "index": 3, "name": "campaign_id", "comment": null}, "message_id": {"type": "integer", "index": 4, "name": "message_id", "comment": null}, "content_id": {"type": "integer", "index": 5, "name": "content_id", "comment": null}, "created_at": {"type": "timestamp without time zone", "index": 6, "name": "created_at", "comment": null}, "event_name": {"type": "text", "index": 7, "name": "event_name", "comment": null}, "ip": {"type": "integer", "index": 8, "name": "ip", "comment": null}, "message_bus_id": {"type": "integer", "index": 9, "name": "message_bus_id", "comment": null}, "message_type_id": {"type": "integer", "index": 10, "name": "message_type_id", "comment": null}, "recipient_state": {"type": "integer", "index": 11, "name": "recipient_state", "comment": null}, "status": {"type": "integer", "index": 12, "name": "status", "comment": null}, "unsub_source": {"type": "integer", "index": 13, "name": "unsub_source", "comment": null}, "user_agent": {"type": "integer", "index": 14, "name": "user_agent", "comment": null}, "user_agent_device": {"type": "integer", "index": 15, "name": "user_agent_device", "comment": null}, "transactional_data": {"type": "character varying(100)", "index": 16, "name": "transactional_data", "comment": null}, "additional_properties": {"type": "text", "index": 17, "name": "additional_properties", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 18, "name": "_fivetran_synced", "comment": null}, "_fivetran_user_id": {"type": "integer", "index": 19, "name": "_fivetran_user_id", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.stg_iterable__event_tmp"}, "model.iterable.stg_iterable__journey": {"metadata": {"type": "BASE TABLE", "schema": "public_iterable_dev", "name": "stg_iterable__journey", "database": "postgres", "comment": "Table containing unique journeys, formerly known as workflows.", "owner": "postgres"}, "columns": {"source_relation": {"type": "text", "index": 1, "name": "source_relation", "comment": "Identifies the record's source."}, "journey_id": {"type": "text", "index": 2, "name": "journey_id", "comment": "Unique identifier of the journey"}, "journey_name": {"type": "text", "index": 3, "name": "journey_name", "comment": "User defined name of the journey"}, "journey_type": {"type": "text", "index": 4, "name": "journey_type", "comment": "The journey type"}, "journey_description": {"type": "text", "index": 5, "name": "journey_description", "comment": "Information about the journey"}, "creator_user_id": {"type": "text", "index": 6, "name": "creator_user_id", "comment": "Reference to the user who created the journey"}, "is_enabled": {"type": "boolean", "index": 7, "name": "is_enabled", "comment": "Boolean indicating if the journey is currently enabled"}, "is_archived": {"type": "boolean", "index": 8, "name": "is_archived", "comment": "Boolean indicating if the journey has been archived"}, "lifetime_limit": {"type": "integer", "index": 9, "name": "lifetime_limit", "comment": "Maximum number of times a user may enter the journey over their lifetime"}, "simultaneous_limit": {"type": "integer", "index": 10, "name": "simultaneous_limit", "comment": "Maximum number of times a user may be in the journey at the same time"}, "start_tile_id": {"type": "text", "index": 11, "name": "start_tile_id", "comment": "Reference to the tile which begins the journey"}, "trigger_event_names": {"type": "text", "index": 12, "name": "trigger_event_names", "comment": "The event names which trigger a user's entry into the journey"}, "created_at": {"type": "timestamp without time zone", "index": 13, "name": "created_at", "comment": "Creation timestamp"}, "updated_at": {"type": "timestamp without time zone", "index": 14, "name": "updated_at", "comment": "Last update timestamp"}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 15, "name": "_fivetran_synced", "comment": "The time when a record was last updated by Fivetran."}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.stg_iterable__journey"}, "model.iterable.stg_iterable__journey_tmp": {"metadata": {"type": "VIEW", "schema": "public_iterable_dev", "name": "stg_iterable__journey_tmp", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"_dbt_source_relation": {"type": "text", "index": 1, "name": "_dbt_source_relation", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.stg_iterable__journey_tmp"}, "model.iterable.stg_iterable__list": {"metadata": {"type": "BASE TABLE", "schema": "public_iterable_dev", "name": "stg_iterable__list", "database": "postgres", "comment": "Table containing users and the lists the users are associated with.", "owner": "postgres"}, "columns": {"source_relation": {"type": "text", "index": 1, "name": "source_relation", "comment": "Identifies the record's source."}, "list_id": {"type": "integer", "index": 2, "name": "list_id", "comment": "Unique identifier of the list"}, "list_name": {"type": "text", "index": 3, "name": "list_name", "comment": "User defined name of the list"}, "list_type": {"type": "text", "index": 4, "name": "list_type", "comment": "The list type"}, "created_at": {"type": "text", "index": 5, "name": "created_at", "comment": "Creation timestamp"}, "list_description": {"type": "text", "index": 6, "name": "list_description", "comment": "Information about the list"}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 7, "name": "_fivetran_synced", "comment": "The time when a record was last updated by Fivetran."}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.stg_iterable__list"}, "model.iterable.stg_iterable__list_tmp": {"metadata": {"type": "VIEW", "schema": "public_iterable_dev", "name": "stg_iterable__list_tmp", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"id": {"type": "integer", "index": 1, "name": "id", "comment": null}, "name": {"type": "text", "index": 2, "name": "name", "comment": null}, "created_at": {"type": "text", "index": 3, "name": "created_at", "comment": null}, "list_type": {"type": "text", "index": 4, "name": "list_type", "comment": null}, "_fivetran_deleted": {"type": "boolean", "index": 5, "name": "_fivetran_deleted", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 6, "name": "_fivetran_synced", "comment": null}, "description": {"type": "text", "index": 7, "name": "description", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.stg_iterable__list_tmp"}, "model.iterable.stg_iterable__list_user": {"metadata": {"type": "BASE TABLE", "schema": "public_iterable_dev", "name": "stg_iterable__list_user", "database": "postgres", "comment": "Table containing the relationship between users and lists they belong to.", "owner": "postgres"}, "columns": {"source_relation": {"type": "text", "index": 1, "name": "source_relation", "comment": "Identifies the record's source."}, "_fivetran_user_id": {"type": "text", "index": 2, "name": "_fivetran_user_id", "comment": "Unique identifier of the list-user relationship record, serving as a foreign key to `stg_iterable__user_history._fivetran_id`."}, "list_user_index": {"type": "bigint", "index": 3, "name": "list_user_index", "comment": "Index of the record"}, "list_id": {"type": "bigint", "index": 4, "name": "list_id", "comment": "Reference to the list that the user belongs to"}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 5, "name": "_fivetran_synced", "comment": "The time when a record was last updated by Fivetran."}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.stg_iterable__list_user"}, "model.iterable.stg_iterable__list_user_tmp": {"metadata": {"type": "VIEW", "schema": "public_iterable_dev", "name": "stg_iterable__list_user_tmp", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"_fivetran_id": {"type": "text", "index": 1, "name": "_fivetran_id", "comment": null}, "index": {"type": "bigint", "index": 2, "name": "index", "comment": null}, "list_id": {"type": "bigint", "index": 3, "name": "list_id", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 4, "name": "_fivetran_synced", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.stg_iterable__list_user_tmp"}, "model.iterable.stg_iterable__message_type": {"metadata": {"type": "BASE TABLE", "schema": "public_iterable_dev", "name": "stg_iterable__message_type", "database": "postgres", "comment": "Table containing unique message types.", "owner": "postgres"}, "columns": {"source_relation": {"type": "text", "index": 1, "name": "source_relation", "comment": "Identifies the record's source."}, "message_type_id": {"type": "text", "index": 2, "name": "message_type_id", "comment": "Unique identifier of the message type"}, "message_type_name": {"type": "text", "index": 3, "name": "message_type_name", "comment": "User defined name of the message type"}, "channel_id": {"type": "text", "index": 4, "name": "channel_id", "comment": "Channel that this message type belongs to"}, "message_type_created_at": {"type": "timestamp without time zone", "index": 5, "name": "message_type_created_at", "comment": "Time when the message type was initially created"}, "frequency_cap": {"type": "integer", "index": 6, "name": "frequency_cap", "comment": "The maximum number of times a message of this type can be sent to a recipient within a specified time period to prevent over-messaging"}, "rate_limit_per_minute": {"type": "integer", "index": 7, "name": "rate_limit_per_minute", "comment": "The maximum number of messages of this type that can be sent to recipients in a minute, ensuring controlled message delivery"}, "subscription_policy": {"type": "text", "index": 8, "name": "subscription_policy", "comment": "Information about the policy or rules governing how users can subscribe to or unsubscribe from this specific message type, like OptOut"}, "message_type_updated_at": {"type": "timestamp without time zone", "index": 9, "name": "message_type_updated_at", "comment": "Time when the message type was last updated or modified"}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 10, "name": "_fivetran_synced", "comment": "The time when a record was last updated by Fivetran."}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.stg_iterable__message_type"}, "model.iterable.stg_iterable__message_type_tmp": {"metadata": {"type": "VIEW", "schema": "public_iterable_dev", "name": "stg_iterable__message_type_tmp", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"id": {"type": "bigint", "index": 1, "name": "id", "comment": null}, "name": {"type": "text", "index": 2, "name": "name", "comment": null}, "channel_id": {"type": "bigint", "index": 3, "name": "channel_id", "comment": null}, "_fivetran_deleted": {"type": "boolean", "index": 4, "name": "_fivetran_deleted", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 5, "name": "_fivetran_synced", "comment": null}, "created_at": {"type": "timestamp without time zone", "index": 6, "name": "created_at", "comment": null}, "frequency_cap": {"type": "integer", "index": 7, "name": "frequency_cap", "comment": null}, "rate_limit_per_minute": {"type": "integer", "index": 8, "name": "rate_limit_per_minute", "comment": null}, "subscription_policy": {"type": "text", "index": 9, "name": "subscription_policy", "comment": null}, "updated_at": {"type": "timestamp without time zone", "index": 10, "name": "updated_at", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.stg_iterable__message_type_tmp"}, "model.iterable.stg_iterable__template_history": {"metadata": {"type": "BASE TABLE", "schema": "public_iterable_dev", "name": "stg_iterable__template_history", "database": "postgres", "comment": "Table containing unique templates used across campaigns.", "owner": "postgres"}, "columns": {"source_relation": {"type": "text", "index": 1, "name": "source_relation", "comment": "Identifies the record's source."}, "template_id": {"type": "text", "index": 2, "name": "template_id", "comment": "Unique identifier of the template"}, "template_name": {"type": "text", "index": 3, "name": "template_name", "comment": "User defined name of the template"}, "template_type": {"type": "text", "index": 4, "name": "template_type", "comment": "The type of the template"}, "created_at": {"type": "text", "index": 5, "name": "created_at", "comment": "Creation timestamp"}, "client_template_id": {"type": "text", "index": 6, "name": "client_template_id", "comment": "Reference to the client template"}, "creator_user_id": {"type": "text", "index": 7, "name": "creator_user_id", "comment": "Reference to the user who created the template"}, "message_type_id": {"type": "text", "index": 8, "name": "message_type_id", "comment": "Reference to the message type associated with the template"}, "updated_at": {"type": "text", "index": 9, "name": "updated_at", "comment": "Last update timestamp"}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 10, "name": "_fivetran_synced", "comment": "The time when a record was last updated by Fivetran."}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.stg_iterable__template_history"}, "model.iterable.stg_iterable__template_history_tmp": {"metadata": {"type": "VIEW", "schema": "public_iterable_dev", "name": "stg_iterable__template_history_tmp", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"id": {"type": "integer", "index": 1, "name": "id", "comment": null}, "updated_at": {"type": "text", "index": 2, "name": "updated_at", "comment": null}, "message_type_id": {"type": "integer", "index": 3, "name": "message_type_id", "comment": null}, "client_template_id": {"type": "integer", "index": 4, "name": "client_template_id", "comment": null}, "created_at": {"type": "text", "index": 5, "name": "created_at", "comment": null}, "creator_user_id": {"type": "text", "index": 6, "name": "creator_user_id", "comment": null}, "name": {"type": "text", "index": 7, "name": "name", "comment": null}, "template_type": {"type": "text", "index": 8, "name": "template_type", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 9, "name": "_fivetran_synced", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.stg_iterable__template_history_tmp"}, "model.iterable.stg_iterable__user_history": {"metadata": {"type": "VIEW", "schema": "public_iterable_dev", "name": "stg_iterable__user_history", "database": "postgres", "comment": "Table containing individual user history information.", "owner": "postgres"}, "columns": {"source_relation": {"type": "text", "index": 1, "name": "source_relation", "comment": "Identifies the record's source."}, "_fivetran_user_id": {"type": "text", "index": 2, "name": "_fivetran_user_id", "comment": "A Fivetran-created unique identifier for users, derived from hashing user_id and/or email, depending on project type. This exists for users of the new schema starting Aug 2023. In the old schema, the unique identifier is email."}, "email": {"type": "text", "index": 3, "name": "email", "comment": "The user's email. User identifier, for email-based projects. Previously was the unique identifier for user records, for the old Iterable schema before the August 2023 updates."}, "updated_at": {"type": "timestamp without time zone", "index": 4, "name": "updated_at", "comment": "Last update timestamp"}, "user_id": {"type": "text", "index": 5, "name": "user_id", "comment": "User identifier, for userID-based projects."}, "first_name": {"type": "integer", "index": 6, "name": "first_name", "comment": "First name of the user"}, "last_name": {"type": "integer", "index": 7, "name": "last_name", "comment": "Last name of the user"}, "email_list_ids": {"type": "text", "index": 8, "name": "email_list_ids", "comment": "[DEPRECATED October 13, 2025. Use LIST_USER source instead.] Array of references to the lists associated with the user.\n"}, "phone_number": {"type": "integer", "index": 9, "name": "phone_number", "comment": "Phone number associated with the user"}, "signup_date": {"type": "text", "index": 10, "name": "signup_date", "comment": "Timestamp of when the user signed up"}, "signup_source": {"type": "text", "index": 11, "name": "signup_source", "comment": "Source where the user signed up"}, "iterable_user_id": {"type": "text", "index": 12, "name": "iterable_user_id", "comment": "Another user identifier, for userID-based projects"}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 13, "name": "_fivetran_synced", "comment": "The time when a record was last updated by Fivetran."}, "unique_user_key": {"type": "text", "index": 14, "name": "unique_user_key", "comment": "The unique identifier of the user. With the new schema (Aug 2023), it is the _fivetran_user_id. This is a hash of user_id and/or email, depending on project type. If using the old schema, it is email."}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.stg_iterable__user_history"}, "model.iterable.stg_iterable__user_history_tmp": {"metadata": {"type": "VIEW", "schema": "public_iterable_dev", "name": "stg_iterable__user_history_tmp", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"email": {"type": "text", "index": 1, "name": "email", "comment": null}, "updated_at": {"type": "timestamp without time zone", "index": 2, "name": "updated_at", "comment": null}, "first_name": {"type": "integer", "index": 3, "name": "first_name", "comment": null}, "last_name": {"type": "integer", "index": 4, "name": "last_name", "comment": null}, "phone_number": {"type": "integer", "index": 5, "name": "phone_number", "comment": null}, "user_id": {"type": "integer", "index": 6, "name": "user_id", "comment": null}, "signup_date": {"type": "text", "index": 7, "name": "signup_date", "comment": null}, "signup_source": {"type": "text", "index": 8, "name": "signup_source", "comment": null}, "phone_number_carrier": {"type": "integer", "index": 9, "name": "phone_number_carrier", "comment": null}, "phone_number_country_code_iso": {"type": "integer", "index": 10, "name": "phone_number_country_code_iso", "comment": null}, "phone_number_line_type": {"type": "integer", "index": 11, "name": "phone_number_line_type", "comment": null}, "phone_number_updated_at": {"type": "integer", "index": 12, "name": "phone_number_updated_at", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 13, "name": "_fivetran_synced", "comment": null}, "email_list_ids": {"type": "text", "index": 14, "name": "email_list_ids", "comment": null}, "iterable_user_id": {"type": "integer", "index": 15, "name": "iterable_user_id", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.stg_iterable__user_history_tmp"}, "model.iterable.stg_iterable__user_unsub_message_type": {"metadata": {"type": "BASE TABLE", "schema": "public_iterable_dev", "name": "stg_iterable__user_unsub_message_type", "database": "postgres", "comment": "Table containing the message types from which a user has unsubscribed. \"Unsubscribed\" is shortened to \"unsub\" for postgres compatibility.", "owner": "postgres"}, "columns": {"source_relation": {"type": "text", "index": 1, "name": "source_relation", "comment": "Identifies the record's source."}, "_fivetran_user_id": {"type": "text", "index": 2, "name": "_fivetran_user_id", "comment": "A Fivetran-created unique identifier for users, derived from hashing user_id and/or email, depending on project type. This exists for users of the new schema starting Aug 2023. In the old schema, the unique identifier is email."}, "unique_user_key": {"type": "text", "index": 3, "name": "unique_user_key", "comment": "The unique identifier of the user. With the new schema (Aug 2023), it is the _fivetran_user_id. This is a hash of user_id and/or email, depending on project type. If using the old schema, it is email."}, "message_type_id": {"type": "text", "index": 4, "name": "message_type_id", "comment": "Reference to the message type from which the user unsubscribed"}, "unsub_message_type_unique_key": {"type": "text", "index": 5, "name": "unsub_message_type_unique_key", "comment": "A surrogate key providing a unique key for each record. If using user_unsubscribed_message_type_history, it uses '_fivetran_id', 'email', 'message_type_id', 'updated_at', and 'source_relation'. If not using the history table, it uses '_fivetran_id', 'message_type_id', and 'source_relation'."}, "latest_batch_index": {"type": "integer", "index": 6, "name": "latest_batch_index", "comment": "Indexes each user record based on the most recent available."}, "updated_at": {"type": "timestamp without time zone", "index": 7, "name": "updated_at", "comment": "Last update timestamp"}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 8, "name": "_fivetran_synced", "comment": "The time when a record was last updated by Fivetran."}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.stg_iterable__user_unsub_message_type"}, "model.iterable.stg_iterable__user_unsub_message_type_tmp": {"metadata": {"type": "VIEW", "schema": "public_iterable_dev", "name": "stg_iterable__user_unsub_message_type_tmp", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"_fivetran_id": {"type": "text", "index": 1, "name": "_fivetran_id", "comment": null}, "message_type_id": {"type": "integer", "index": 2, "name": "message_type_id", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 3, "name": "_fivetran_synced", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.stg_iterable__user_unsub_message_type_tmp"}, "model.iterable.stg_iterable__user_unsubscribed_channel": {"metadata": {"type": "BASE TABLE", "schema": "public_iterable_dev", "name": "stg_iterable__user_unsubscribed_channel", "database": "postgres", "comment": "Table containing the history of channels from which a user has unsubscribed.", "owner": "postgres"}, "columns": {"source_relation": {"type": "text", "index": 1, "name": "source_relation", "comment": "Identifies the record's source."}, "_fivetran_user_id": {"type": "text", "index": 2, "name": "_fivetran_user_id", "comment": "A Fivetran-created unique identifier for users, derived from hashing user_id and/or email, depending on project type. This exists for users of the new schema starting Aug 2023. In the old schema, the unique identifier is email."}, "unique_user_key": {"type": "text", "index": 3, "name": "unique_user_key", "comment": "The unique identifier of the user. With the new schema (Aug 2023), it is the _fivetran_user_id. This is a hash of user_id and/or email, depending on project type. If using the old schema, it is email."}, "channel_id": {"type": "text", "index": 4, "name": "channel_id", "comment": "Reference to the channel from which the user unsubscribed"}, "unsub_channel_unique_key": {"type": "text", "index": 5, "name": "unsub_channel_unique_key", "comment": "A surrogate key providing a unique key for each record. If using user_unsubscribed_channel_history, it uses '_fivetran_id', 'channel_id', 'email', 'updated_at', and 'source_relation'. If not using the history table, it uses '_fivetran_id', 'channel_id', and 'source_relation'."}, "latest_batch_index": {"type": "integer", "index": 6, "name": "latest_batch_index", "comment": "Indexes each user record based on the most recent available."}, "updated_at": {"type": "timestamp without time zone", "index": 7, "name": "updated_at", "comment": "Last update timestamp"}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 8, "name": "_fivetran_synced", "comment": "The time when a record was last updated by Fivetran."}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.stg_iterable__user_unsubscribed_channel"}, "model.iterable.stg_iterable__user_unsubscribed_channel_tmp": {"metadata": {"type": "VIEW", "schema": "public_iterable_dev", "name": "stg_iterable__user_unsubscribed_channel_tmp", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"_fivetran_id": {"type": "text", "index": 1, "name": "_fivetran_id", "comment": null}, "channel_id": {"type": "integer", "index": 2, "name": "channel_id", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 3, "name": "_fivetran_synced", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.stg_iterable__user_unsubscribed_channel_tmp"}}, "sources": {"source.iterable.iterable.campaign_history": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "campaign_history_data", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"id": {"type": "integer", "index": 1, "name": "id", "comment": null}, "updated_at": {"type": "text", "index": 2, "name": "updated_at", "comment": null}, "template_id": {"type": "integer", "index": 3, "name": "template_id", "comment": null}, "recurring_campaign_id": {"type": "integer", "index": 4, "name": "recurring_campaign_id", "comment": null}, "campaign_state": {"type": "text", "index": 5, "name": "campaign_state", "comment": null}, "created_at": {"type": "text", "index": 6, "name": "created_at", "comment": null}, "created_by_user_id": {"type": "text", "index": 7, "name": "created_by_user_id", "comment": null}, "ended_at": {"type": "integer", "index": 8, "name": "ended_at", "comment": null}, "name": {"type": "text", "index": 9, "name": "name", "comment": null}, "send_size": {"type": "integer", "index": 10, "name": "send_size", "comment": null}, "start_at": {"type": "integer", "index": 11, "name": "start_at", "comment": null}, "type": {"type": "text", "index": 12, "name": "type", "comment": null}, "workflow_id": {"type": "integer", "index": 13, "name": "workflow_id", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 14, "name": "_fivetran_synced", "comment": null}, "updated_by_user_id": {"type": "integer", "index": 15, "name": "updated_by_user_id", "comment": null}, "message_medium": {"type": "text", "index": 16, "name": "message_medium", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.iterable.iterable.campaign_history"}, "source.iterable.iterable.campaign_label_history": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "campaign_label_history_data", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"campaign_id": {"type": "integer", "index": 1, "name": "campaign_id", "comment": null}, "label": {"type": "text", "index": 2, "name": "label", "comment": null}, "updated_at": {"type": "text", "index": 3, "name": "updated_at", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 4, "name": "_fivetran_synced", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.iterable.iterable.campaign_label_history"}, "source.iterable.iterable.campaign_list_history": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "campaign_list_history_data", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"list_id": {"type": "integer", "index": 1, "name": "list_id", "comment": null}, "campaign_id": {"type": "integer", "index": 2, "name": "campaign_id", "comment": null}, "updated_at": {"type": "text", "index": 3, "name": "updated_at", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 4, "name": "_fivetran_synced", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.iterable.iterable.campaign_list_history"}, "source.iterable.iterable.campaign_suppression_list_history": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "campaign_suppression_list_history_data", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"suppressed_list_id": {"type": "integer", "index": 1, "name": "suppressed_list_id", "comment": null}, "campaign_id": {"type": "integer", "index": 2, "name": "campaign_id", "comment": null}, "updated_at": {"type": "text", "index": 3, "name": "updated_at", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 4, "name": "_fivetran_synced", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.iterable.iterable.campaign_suppression_list_history"}, "source.iterable.iterable.channel": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "channel_data", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"id": {"type": "bigint", "index": 1, "name": "id", "comment": null}, "name": {"type": "text", "index": 2, "name": "name", "comment": null}, "channel_type": {"type": "text", "index": 3, "name": "channel_type", "comment": null}, "message_medium": {"type": "text", "index": 4, "name": "message_medium", "comment": null}, "_fivetran_deleted": {"type": "boolean", "index": 5, "name": "_fivetran_deleted", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 6, "name": "_fivetran_synced", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.iterable.iterable.channel"}, "source.iterable.iterable.event": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "event_data", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"_fivetran_id": {"type": "text", "index": 1, "name": "_fivetran_id", "comment": null}, "email": {"type": "text", "index": 2, "name": "email", "comment": null}, "campaign_id": {"type": "integer", "index": 3, "name": "campaign_id", "comment": null}, "message_id": {"type": "integer", "index": 4, "name": "message_id", "comment": null}, "content_id": {"type": "integer", "index": 5, "name": "content_id", "comment": null}, "created_at": {"type": "timestamp without time zone", "index": 6, "name": "created_at", "comment": null}, "event_name": {"type": "text", "index": 7, "name": "event_name", "comment": null}, "ip": {"type": "integer", "index": 8, "name": "ip", "comment": null}, "message_bus_id": {"type": "integer", "index": 9, "name": "message_bus_id", "comment": null}, "message_type_id": {"type": "integer", "index": 10, "name": "message_type_id", "comment": null}, "recipient_state": {"type": "integer", "index": 11, "name": "recipient_state", "comment": null}, "status": {"type": "integer", "index": 12, "name": "status", "comment": null}, "unsub_source": {"type": "integer", "index": 13, "name": "unsub_source", "comment": null}, "user_agent": {"type": "integer", "index": 14, "name": "user_agent", "comment": null}, "user_agent_device": {"type": "integer", "index": 15, "name": "user_agent_device", "comment": null}, "transactional_data": {"type": "character varying(100)", "index": 16, "name": "transactional_data", "comment": null}, "additional_properties": {"type": "text", "index": 17, "name": "additional_properties", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 18, "name": "_fivetran_synced", "comment": null}, "_fivetran_user_id": {"type": "integer", "index": 19, "name": "_fivetran_user_id", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.iterable.iterable.event"}, "source.iterable.iterable.event_extension": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "event_extension_data", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"_fivetran_id": {"type": "text", "index": 1, "name": "_fivetran_id", "comment": null}, "app_already_running": {"type": "integer", "index": 2, "name": "app_already_running", "comment": null}, "badge": {"type": "integer", "index": 3, "name": "badge", "comment": null}, "canonical_url_id": {"type": "integer", "index": 4, "name": "canonical_url_id", "comment": null}, "content_available": {"type": "integer", "index": 5, "name": "content_available", "comment": null}, "content_id": {"type": "integer", "index": 6, "name": "content_id", "comment": null}, "device": {"type": "integer", "index": 7, "name": "device", "comment": null}, "email_id": {"type": "text", "index": 8, "name": "email_id", "comment": null}, "email_subject": {"type": "text", "index": 9, "name": "email_subject", "comment": null}, "experiment_id": {"type": "integer", "index": 10, "name": "experiment_id", "comment": null}, "from_phone_number_id": {"type": "integer", "index": 11, "name": "from_phone_number_id", "comment": null}, "from_smssender_id": {"type": "integer", "index": 12, "name": "from_smssender_id", "comment": null}, "image_url": {"type": "integer", "index": 13, "name": "image_url", "comment": null}, "is_ghost_push": {"type": "integer", "index": 14, "name": "is_ghost_push", "comment": null}, "link_id": {"type": "integer", "index": 15, "name": "link_id", "comment": null}, "link_url": {"type": "integer", "index": 16, "name": "link_url", "comment": null}, "platform_endpoint": {"type": "integer", "index": 17, "name": "platform_endpoint", "comment": null}, "push_message": {"type": "integer", "index": 18, "name": "push_message", "comment": null}, "region": {"type": "text", "index": 19, "name": "region", "comment": null}, "sms_message": {"type": "integer", "index": 20, "name": "sms_message", "comment": null}, "sound": {"type": "integer", "index": 21, "name": "sound", "comment": null}, "to_phone_number": {"type": "integer", "index": 22, "name": "to_phone_number", "comment": null}, "url": {"type": "integer", "index": 23, "name": "url", "comment": null}, "workflow_id": {"type": "integer", "index": 24, "name": "workflow_id", "comment": null}, "workflow_name": {"type": "text", "index": 25, "name": "workflow_name", "comment": null}, "locale": {"type": "integer", "index": 26, "name": "locale", "comment": null}, "deeplink_android": {"type": "integer", "index": 27, "name": "deeplink_android", "comment": null}, "deeplink_ios": {"type": "integer", "index": 28, "name": "deeplink_ios", "comment": null}, "payload": {"type": "character varying(100)", "index": 29, "name": "payload", "comment": null}, "sms_provider_response_status": {"type": "integer", "index": 30, "name": "sms_provider_response_status", "comment": null}, "sms_provider_response_message": {"type": "integer", "index": 31, "name": "sms_provider_response_message", "comment": null}, "sms_provider_response_code": {"type": "integer", "index": 32, "name": "sms_provider_response_code", "comment": null}, "sms_provider_response_more_info": {"type": "integer", "index": 33, "name": "sms_provider_response_more_info", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 34, "name": "_fivetran_synced", "comment": null}, "catalog_collection_count": {"type": "integer", "index": 35, "name": "catalog_collection_count", "comment": null}, "catalog_lookup_count": {"type": "integer", "index": 36, "name": "catalog_lookup_count", "comment": null}, "city": {"type": "text", "index": 37, "name": "city", "comment": null}, "clicked_url": {"type": "text", "index": 38, "name": "clicked_url", "comment": null}, "country": {"type": "text", "index": 39, "name": "country", "comment": null}, "error_code": {"type": "integer", "index": 40, "name": "error_code", "comment": null}, "expires_at": {"type": "text", "index": 41, "name": "expires_at", "comment": null}, "from_phone_number": {"type": "integer", "index": 42, "name": "from_phone_number", "comment": null}, "in_app_body": {"type": "text", "index": 43, "name": "in_app_body", "comment": null}, "is_sms_estimation": {"type": "boolean", "index": 44, "name": "is_sms_estimation", "comment": null}, "labels": {"type": "text", "index": 45, "name": "labels", "comment": null}, "message_context": {"type": "text", "index": 46, "name": "message_context", "comment": null}, "message_status": {"type": "text", "index": 47, "name": "message_status", "comment": null}, "mms_send_count": {"type": "integer", "index": 48, "name": "mms_send_count", "comment": null}, "product_recommendation_count": {"type": "integer", "index": 49, "name": "product_recommendation_count", "comment": null}, "proxy_source": {"type": "text", "index": 50, "name": "proxy_source", "comment": null}, "reason": {"type": "text", "index": 51, "name": "reason", "comment": null}, "sms_send_count": {"type": "integer", "index": 52, "name": "sms_send_count", "comment": null}, "web_push_body": {"type": "text", "index": 53, "name": "web_push_body", "comment": null}, "web_push_click_action": {"type": "text", "index": 54, "name": "web_push_click_action", "comment": null}, "web_push_icon": {"type": "text", "index": 55, "name": "web_push_icon", "comment": null}, "web_push_message": {"type": "text", "index": 56, "name": "web_push_message", "comment": null}, "_fivetran_user_id": {"type": "integer", "index": 57, "name": "_fivetran_user_id", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.iterable.iterable.event_extension"}, "source.iterable.iterable.list": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "list_data", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"id": {"type": "integer", "index": 1, "name": "id", "comment": null}, "name": {"type": "text", "index": 2, "name": "name", "comment": null}, "created_at": {"type": "text", "index": 3, "name": "created_at", "comment": null}, "list_type": {"type": "text", "index": 4, "name": "list_type", "comment": null}, "_fivetran_deleted": {"type": "boolean", "index": 5, "name": "_fivetran_deleted", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 6, "name": "_fivetran_synced", "comment": null}, "description": {"type": "text", "index": 7, "name": "description", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.iterable.iterable.list"}, "source.iterable.iterable.list_user": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "list_user_data", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"_fivetran_id": {"type": "text", "index": 1, "name": "_fivetran_id", "comment": null}, "index": {"type": "bigint", "index": 2, "name": "index", "comment": null}, "list_id": {"type": "bigint", "index": 3, "name": "list_id", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 4, "name": "_fivetran_synced", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.iterable.iterable.list_user"}, "source.iterable.iterable.message_type": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "message_type_data", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"id": {"type": "bigint", "index": 1, "name": "id", "comment": null}, "name": {"type": "text", "index": 2, "name": "name", "comment": null}, "channel_id": {"type": "bigint", "index": 3, "name": "channel_id", "comment": null}, "_fivetran_deleted": {"type": "boolean", "index": 4, "name": "_fivetran_deleted", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 5, "name": "_fivetran_synced", "comment": null}, "created_at": {"type": "timestamp without time zone", "index": 6, "name": "created_at", "comment": null}, "frequency_cap": {"type": "integer", "index": 7, "name": "frequency_cap", "comment": null}, "rate_limit_per_minute": {"type": "integer", "index": 8, "name": "rate_limit_per_minute", "comment": null}, "subscription_policy": {"type": "text", "index": 9, "name": "subscription_policy", "comment": null}, "updated_at": {"type": "timestamp without time zone", "index": 10, "name": "updated_at", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.iterable.iterable.message_type"}, "source.iterable.iterable.template_history": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "template_history_data", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"id": {"type": "integer", "index": 1, "name": "id", "comment": null}, "updated_at": {"type": "text", "index": 2, "name": "updated_at", "comment": null}, "message_type_id": {"type": "integer", "index": 3, "name": "message_type_id", "comment": null}, "client_template_id": {"type": "integer", "index": 4, "name": "client_template_id", "comment": null}, "created_at": {"type": "text", "index": 5, "name": "created_at", "comment": null}, "creator_user_id": {"type": "text", "index": 6, "name": "creator_user_id", "comment": null}, "name": {"type": "text", "index": 7, "name": "name", "comment": null}, "template_type": {"type": "text", "index": 8, "name": "template_type", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 9, "name": "_fivetran_synced", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.iterable.iterable.template_history"}, "source.iterable.iterable.user_history": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "user_history_data", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"email": {"type": "text", "index": 1, "name": "email", "comment": null}, "updated_at": {"type": "timestamp without time zone", "index": 2, "name": "updated_at", "comment": null}, "first_name": {"type": "integer", "index": 3, "name": "first_name", "comment": null}, "last_name": {"type": "integer", "index": 4, "name": "last_name", "comment": null}, "phone_number": {"type": "integer", "index": 5, "name": "phone_number", "comment": null}, "user_id": {"type": "integer", "index": 6, "name": "user_id", "comment": null}, "signup_date": {"type": "text", "index": 7, "name": "signup_date", "comment": null}, "signup_source": {"type": "text", "index": 8, "name": "signup_source", "comment": null}, "phone_number_carrier": {"type": "integer", "index": 9, "name": "phone_number_carrier", "comment": null}, "phone_number_country_code_iso": {"type": "integer", "index": 10, "name": "phone_number_country_code_iso", "comment": null}, "phone_number_line_type": {"type": "integer", "index": 11, "name": "phone_number_line_type", "comment": null}, "phone_number_updated_at": {"type": "integer", "index": 12, "name": "phone_number_updated_at", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 13, "name": "_fivetran_synced", "comment": null}, "email_list_ids": {"type": "text", "index": 14, "name": "email_list_ids", "comment": null}, "iterable_user_id": {"type": "integer", "index": 15, "name": "iterable_user_id", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.iterable.iterable.user_history"}, "source.iterable.iterable.user_unsubscribed_channel": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "user_unsubscribed_channel_data", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"_fivetran_id": {"type": "text", "index": 1, "name": "_fivetran_id", "comment": null}, "channel_id": {"type": "integer", "index": 2, "name": "channel_id", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 3, "name": "_fivetran_synced", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.iterable.iterable.user_unsubscribed_channel"}, "source.iterable.iterable.user_unsubscribed_channel_history": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "user_unsubscribed_channel_history_data", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"email": {"type": "text", "index": 1, "name": "email", "comment": null}, "channel_id": {"type": "bigint", "index": 2, "name": "channel_id", "comment": null}, "updated_at": {"type": "text", "index": 3, "name": "updated_at", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 4, "name": "_fivetran_synced", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.iterable.iterable.user_unsubscribed_channel_history"}, "source.iterable.iterable.user_unsubscribed_message_type": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "user_unsubscribed_message_type_data", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"_fivetran_id": {"type": "text", "index": 1, "name": "_fivetran_id", "comment": null}, "message_type_id": {"type": "integer", "index": 2, "name": "message_type_id", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 3, "name": "_fivetran_synced", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.iterable.iterable.user_unsubscribed_message_type"}, "source.iterable.iterable.user_unsubscribed_message_type_history": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "user_unsubscribed_message_type_history_data", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"message_type_id": {"type": "integer", "index": 1, "name": "message_type_id", "comment": null}, "email": {"type": "text", "index": 2, "name": "email", "comment": null}, "updated_at": {"type": "text", "index": 3, "name": "updated_at", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 4, "name": "_fivetran_synced", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.iterable.iterable.user_unsubscribed_message_type_history"}}, "errors": null} \ No newline at end of file +{"metadata": {"dbt_schema_version": "https://schemas.getdbt.com/dbt/catalog/v1.json", "dbt_version": "1.12.4", "generated_at": "2026-09-14T21:06:23.075373Z", "invocation_id": "9ff5dbb1-4114-401f-b8d6-f22217b143f8", "invocation_started_at": "2026-09-14T21:06:19.711000Z", "env": {}}, "nodes": {"seed.iterable_integration_tests.campaign_history_data": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "campaign_history_data", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"id": {"type": "integer", "index": 1, "name": "id", "comment": null}, "updated_at": {"type": "text", "index": 2, "name": "updated_at", "comment": null}, "template_id": {"type": "integer", "index": 3, "name": "template_id", "comment": null}, "recurring_campaign_id": {"type": "integer", "index": 4, "name": "recurring_campaign_id", "comment": null}, "campaign_state": {"type": "text", "index": 5, "name": "campaign_state", "comment": null}, "created_at": {"type": "text", "index": 6, "name": "created_at", "comment": null}, "created_by_user_id": {"type": "text", "index": 7, "name": "created_by_user_id", "comment": null}, "ended_at": {"type": "integer", "index": 8, "name": "ended_at", "comment": null}, "name": {"type": "text", "index": 9, "name": "name", "comment": null}, "send_size": {"type": "integer", "index": 10, "name": "send_size", "comment": null}, "start_at": {"type": "integer", "index": 11, "name": "start_at", "comment": null}, "type": {"type": "text", "index": 12, "name": "type", "comment": null}, "workflow_id": {"type": "integer", "index": 13, "name": "workflow_id", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 14, "name": "_fivetran_synced", "comment": null}, "updated_by_user_id": {"type": "integer", "index": 15, "name": "updated_by_user_id", "comment": null}, "message_medium": {"type": "text", "index": 16, "name": "message_medium", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.iterable_integration_tests.campaign_history_data"}, "seed.iterable_integration_tests.campaign_label_history_data": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "campaign_label_history_data", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"campaign_id": {"type": "integer", "index": 1, "name": "campaign_id", "comment": null}, "label": {"type": "text", "index": 2, "name": "label", "comment": null}, "updated_at": {"type": "text", "index": 3, "name": "updated_at", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 4, "name": "_fivetran_synced", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.iterable_integration_tests.campaign_label_history_data"}, "seed.iterable_integration_tests.campaign_list_history_data": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "campaign_list_history_data", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"list_id": {"type": "integer", "index": 1, "name": "list_id", "comment": null}, "campaign_id": {"type": "integer", "index": 2, "name": "campaign_id", "comment": null}, "updated_at": {"type": "text", "index": 3, "name": "updated_at", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 4, "name": "_fivetran_synced", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.iterable_integration_tests.campaign_list_history_data"}, "seed.iterable_integration_tests.campaign_metrics_data": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "campaign_metrics_data", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"date": {"type": "date", "index": 1, "name": "date", "comment": null}, "id": {"type": "integer", "index": 2, "name": "id", "comment": null}, "_fivetran_deleted": {"type": "boolean", "index": 3, "name": "_fivetran_deleted", "comment": null}, "average_order_value": {"type": "integer", "index": 4, "name": "average_order_value", "comment": null}, "purchases": {"type": "integer", "index": 5, "name": "purchases", "comment": null}, "revenue": {"type": "integer", "index": 6, "name": "revenue", "comment": null}, "revenue_m": {"type": "integer", "index": 7, "name": "revenue_m", "comment": null}, "total_app_uninstalls": {"type": "integer", "index": 8, "name": "total_app_uninstalls", "comment": null}, "total_complaints": {"type": "integer", "index": 9, "name": "total_complaints", "comment": null}, "total_email_bounced": {"type": "integer", "index": 10, "name": "total_email_bounced", "comment": null}, "total_email_clicked": {"type": "integer", "index": 11, "name": "total_email_clicked", "comment": null}, "total_email_delivered": {"type": "integer", "index": 12, "name": "total_email_delivered", "comment": null}, "total_email_opens": {"type": "integer", "index": 13, "name": "total_email_opens", "comment": null}, "total_email_sends": {"type": "integer", "index": 14, "name": "total_email_sends", "comment": null}, "total_hosted_unsubscribe_clicks": {"type": "integer", "index": 15, "name": "total_hosted_unsubscribe_clicks", "comment": null}, "total_purchases": {"type": "integer", "index": 16, "name": "total_purchases", "comment": null}, "total_pushes_bounced": {"type": "integer", "index": 17, "name": "total_pushes_bounced", "comment": null}, "total_pushes_delivered": {"type": "integer", "index": 18, "name": "total_pushes_delivered", "comment": null}, "total_pushes_opened": {"type": "integer", "index": 19, "name": "total_pushes_opened", "comment": null}, "total_pushes_sent": {"type": "integer", "index": 20, "name": "total_pushes_sent", "comment": null}, "total_unsubscribes": {"type": "integer", "index": 21, "name": "total_unsubscribes", "comment": null}, "unique_email_bounced": {"type": "integer", "index": 22, "name": "unique_email_bounced", "comment": null}, "unique_email_clicks": {"type": "integer", "index": 23, "name": "unique_email_clicks", "comment": null}, "unique_email_opens_or_clicks": {"type": "integer", "index": 24, "name": "unique_email_opens_or_clicks", "comment": null}, "unique_hosted_unsubscribe_clicks": {"type": "integer", "index": 25, "name": "unique_hosted_unsubscribe_clicks", "comment": null}, "unique_purchases": {"type": "integer", "index": 26, "name": "unique_purchases", "comment": null}, "unique_pushes_bounced": {"type": "integer", "index": 27, "name": "unique_pushes_bounced", "comment": null}, "unique_pushes_opened": {"type": "integer", "index": 28, "name": "unique_pushes_opened", "comment": null}, "unique_pushes_sent": {"type": "integer", "index": 29, "name": "unique_pushes_sent", "comment": null}, "unique_unsubscribes": {"type": "integer", "index": 30, "name": "unique_unsubscribes", "comment": null}, "total_push_send_skips": {"type": "integer", "index": 31, "name": "total_push_send_skips", "comment": null}, "total_in_app_opens": {"type": "integer", "index": 32, "name": "total_in_app_opens", "comment": null}, "unique_in_apps_delivered": {"type": "integer", "index": 33, "name": "unique_in_apps_delivered", "comment": null}, "unique_in_app_sends": {"type": "integer", "index": 34, "name": "unique_in_app_sends", "comment": null}, "total_in_app_closes": {"type": "integer", "index": 35, "name": "total_in_app_closes", "comment": null}, "total_inbox_impressions": {"type": "integer", "index": 36, "name": "total_inbox_impressions", "comment": null}, "unique_pushes_delivered": {"type": "integer", "index": 37, "name": "unique_pushes_delivered", "comment": null}, "unique_in_app_clicks": {"type": "integer", "index": 38, "name": "unique_in_app_clicks", "comment": null}, "unique_emails_delivered": {"type": "integer", "index": 39, "name": "unique_emails_delivered", "comment": null}, "total_in_app_clicks": {"type": "integer", "index": 40, "name": "total_in_app_clicks", "comment": null}, "total_in_app_deletes": {"type": "integer", "index": 41, "name": "total_in_app_deletes", "comment": null}, "total_in_app_sent": {"type": "integer", "index": 42, "name": "total_in_app_sent", "comment": null}, "total_in_apps_delivered": {"type": "integer", "index": 43, "name": "total_in_apps_delivered", "comment": null}, "unique_in_app_opens": {"type": "integer", "index": 44, "name": "unique_in_app_opens", "comment": null}, "total_email_holdout": {"type": "integer", "index": 45, "name": "total_email_holdout", "comment": null}, "total_email_send_skips": {"type": "integer", "index": 46, "name": "total_email_send_skips", "comment": null}, "unique_email_sends": {"type": "integer", "index": 47, "name": "unique_email_sends", "comment": null}, "unique_emails_opens": {"type": "integer", "index": 48, "name": "unique_emails_opens", "comment": null}, "total_in_app_holdout": {"type": "integer", "index": 49, "name": "total_in_app_holdout", "comment": null}, "total_in_app_send_skips": {"type": "integer", "index": 50, "name": "total_in_app_send_skips", "comment": null}, "total_push_holdout": {"type": "integer", "index": 51, "name": "total_push_holdout", "comment": null}, "_fivetran_synced": {"type": "text", "index": 52, "name": "_fivetran_synced", "comment": null}, "total_sms_holdout": {"type": "integer", "index": 53, "name": "total_sms_holdout", "comment": null}, "unique_sms_sent": {"type": "integer", "index": 54, "name": "unique_sms_sent", "comment": null}, "total_sms_delivered": {"type": "integer", "index": 55, "name": "total_sms_delivered", "comment": null}, "total_sms_sent": {"type": "integer", "index": 56, "name": "total_sms_sent", "comment": null}, "total_inbound_sms": {"type": "integer", "index": 57, "name": "total_inbound_sms", "comment": null}, "total_sms_bounced": {"type": "integer", "index": 58, "name": "total_sms_bounced", "comment": null}, "total_sms_send_skips": {"type": "integer", "index": 59, "name": "total_sms_send_skips", "comment": null}, "unique_inbound_sms": {"type": "integer", "index": 60, "name": "unique_inbound_sms", "comment": null}, "unique_sms_delivered": {"type": "integer", "index": 61, "name": "unique_sms_delivered", "comment": null}, "unique_sms_bounced": {"type": "integer", "index": 62, "name": "unique_sms_bounced", "comment": null}, "revenue_m_sms_": {"type": "integer", "index": 63, "name": "revenue_m_sms_", "comment": null}, "purchases_m_sms_": {"type": "integer", "index": 64, "name": "purchases_m_sms_", "comment": null}, "purchases_m_email_": {"type": "integer", "index": 65, "name": "purchases_m_email_", "comment": null}, "revenue_m_push_": {"type": "integer", "index": 66, "name": "revenue_m_push_", "comment": null}, "revenue_m_email_": {"type": "integer", "index": 67, "name": "revenue_m_email_", "comment": null}, "purchases_m_push_": {"type": "integer", "index": 68, "name": "purchases_m_push_", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.iterable_integration_tests.campaign_metrics_data"}, "seed.iterable_integration_tests.campaign_suppression_list_history_data": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "campaign_suppression_list_history_data", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"suppressed_list_id": {"type": "integer", "index": 1, "name": "suppressed_list_id", "comment": null}, "campaign_id": {"type": "integer", "index": 2, "name": "campaign_id", "comment": null}, "updated_at": {"type": "text", "index": 3, "name": "updated_at", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 4, "name": "_fivetran_synced", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.iterable_integration_tests.campaign_suppression_list_history_data"}, "seed.iterable_integration_tests.channel_data": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "channel_data", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"id": {"type": "bigint", "index": 1, "name": "id", "comment": null}, "name": {"type": "text", "index": 2, "name": "name", "comment": null}, "channel_type": {"type": "text", "index": 3, "name": "channel_type", "comment": null}, "message_medium": {"type": "text", "index": 4, "name": "message_medium", "comment": null}, "_fivetran_deleted": {"type": "boolean", "index": 5, "name": "_fivetran_deleted", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 6, "name": "_fivetran_synced", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.iterable_integration_tests.channel_data"}, "seed.iterable_integration_tests.event_data": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "event_data", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"_fivetran_id": {"type": "text", "index": 1, "name": "_fivetran_id", "comment": null}, "email": {"type": "text", "index": 2, "name": "email", "comment": null}, "campaign_id": {"type": "integer", "index": 3, "name": "campaign_id", "comment": null}, "message_id": {"type": "integer", "index": 4, "name": "message_id", "comment": null}, "content_id": {"type": "integer", "index": 5, "name": "content_id", "comment": null}, "created_at": {"type": "timestamp without time zone", "index": 6, "name": "created_at", "comment": null}, "event_name": {"type": "text", "index": 7, "name": "event_name", "comment": null}, "ip": {"type": "integer", "index": 8, "name": "ip", "comment": null}, "message_bus_id": {"type": "integer", "index": 9, "name": "message_bus_id", "comment": null}, "message_type_id": {"type": "integer", "index": 10, "name": "message_type_id", "comment": null}, "recipient_state": {"type": "integer", "index": 11, "name": "recipient_state", "comment": null}, "status": {"type": "integer", "index": 12, "name": "status", "comment": null}, "unsub_source": {"type": "integer", "index": 13, "name": "unsub_source", "comment": null}, "user_agent": {"type": "integer", "index": 14, "name": "user_agent", "comment": null}, "user_agent_device": {"type": "integer", "index": 15, "name": "user_agent_device", "comment": null}, "transactional_data": {"type": "character varying(100)", "index": 16, "name": "transactional_data", "comment": null}, "additional_properties": {"type": "text", "index": 17, "name": "additional_properties", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 18, "name": "_fivetran_synced", "comment": null}, "_fivetran_user_id": {"type": "integer", "index": 19, "name": "_fivetran_user_id", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.iterable_integration_tests.event_data"}, "seed.iterable_integration_tests.event_extension_data": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "event_extension_data", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"_fivetran_id": {"type": "text", "index": 1, "name": "_fivetran_id", "comment": null}, "app_already_running": {"type": "integer", "index": 2, "name": "app_already_running", "comment": null}, "badge": {"type": "integer", "index": 3, "name": "badge", "comment": null}, "canonical_url_id": {"type": "integer", "index": 4, "name": "canonical_url_id", "comment": null}, "content_available": {"type": "integer", "index": 5, "name": "content_available", "comment": null}, "content_id": {"type": "integer", "index": 6, "name": "content_id", "comment": null}, "device": {"type": "integer", "index": 7, "name": "device", "comment": null}, "email_id": {"type": "text", "index": 8, "name": "email_id", "comment": null}, "email_subject": {"type": "text", "index": 9, "name": "email_subject", "comment": null}, "experiment_id": {"type": "integer", "index": 10, "name": "experiment_id", "comment": null}, "from_phone_number_id": {"type": "integer", "index": 11, "name": "from_phone_number_id", "comment": null}, "from_smssender_id": {"type": "integer", "index": 12, "name": "from_smssender_id", "comment": null}, "image_url": {"type": "integer", "index": 13, "name": "image_url", "comment": null}, "is_ghost_push": {"type": "integer", "index": 14, "name": "is_ghost_push", "comment": null}, "link_id": {"type": "integer", "index": 15, "name": "link_id", "comment": null}, "link_url": {"type": "integer", "index": 16, "name": "link_url", "comment": null}, "platform_endpoint": {"type": "integer", "index": 17, "name": "platform_endpoint", "comment": null}, "push_message": {"type": "integer", "index": 18, "name": "push_message", "comment": null}, "region": {"type": "text", "index": 19, "name": "region", "comment": null}, "sms_message": {"type": "integer", "index": 20, "name": "sms_message", "comment": null}, "sound": {"type": "integer", "index": 21, "name": "sound", "comment": null}, "to_phone_number": {"type": "integer", "index": 22, "name": "to_phone_number", "comment": null}, "url": {"type": "integer", "index": 23, "name": "url", "comment": null}, "workflow_id": {"type": "integer", "index": 24, "name": "workflow_id", "comment": null}, "workflow_name": {"type": "text", "index": 25, "name": "workflow_name", "comment": null}, "locale": {"type": "integer", "index": 26, "name": "locale", "comment": null}, "deeplink_android": {"type": "integer", "index": 27, "name": "deeplink_android", "comment": null}, "deeplink_ios": {"type": "integer", "index": 28, "name": "deeplink_ios", "comment": null}, "payload": {"type": "character varying(100)", "index": 29, "name": "payload", "comment": null}, "sms_provider_response_status": {"type": "integer", "index": 30, "name": "sms_provider_response_status", "comment": null}, "sms_provider_response_message": {"type": "integer", "index": 31, "name": "sms_provider_response_message", "comment": null}, "sms_provider_response_code": {"type": "integer", "index": 32, "name": "sms_provider_response_code", "comment": null}, "sms_provider_response_more_info": {"type": "integer", "index": 33, "name": "sms_provider_response_more_info", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 34, "name": "_fivetran_synced", "comment": null}, "catalog_collection_count": {"type": "integer", "index": 35, "name": "catalog_collection_count", "comment": null}, "catalog_lookup_count": {"type": "integer", "index": 36, "name": "catalog_lookup_count", "comment": null}, "city": {"type": "text", "index": 37, "name": "city", "comment": null}, "clicked_url": {"type": "text", "index": 38, "name": "clicked_url", "comment": null}, "country": {"type": "text", "index": 39, "name": "country", "comment": null}, "error_code": {"type": "integer", "index": 40, "name": "error_code", "comment": null}, "expires_at": {"type": "text", "index": 41, "name": "expires_at", "comment": null}, "from_phone_number": {"type": "integer", "index": 42, "name": "from_phone_number", "comment": null}, "in_app_body": {"type": "text", "index": 43, "name": "in_app_body", "comment": null}, "is_sms_estimation": {"type": "boolean", "index": 44, "name": "is_sms_estimation", "comment": null}, "labels": {"type": "text", "index": 45, "name": "labels", "comment": null}, "message_context": {"type": "text", "index": 46, "name": "message_context", "comment": null}, "message_status": {"type": "text", "index": 47, "name": "message_status", "comment": null}, "mms_send_count": {"type": "integer", "index": 48, "name": "mms_send_count", "comment": null}, "product_recommendation_count": {"type": "integer", "index": 49, "name": "product_recommendation_count", "comment": null}, "proxy_source": {"type": "text", "index": 50, "name": "proxy_source", "comment": null}, "reason": {"type": "text", "index": 51, "name": "reason", "comment": null}, "sms_send_count": {"type": "integer", "index": 52, "name": "sms_send_count", "comment": null}, "web_push_body": {"type": "text", "index": 53, "name": "web_push_body", "comment": null}, "web_push_click_action": {"type": "text", "index": 54, "name": "web_push_click_action", "comment": null}, "web_push_icon": {"type": "text", "index": 55, "name": "web_push_icon", "comment": null}, "web_push_message": {"type": "text", "index": 56, "name": "web_push_message", "comment": null}, "_fivetran_user_id": {"type": "integer", "index": 57, "name": "_fivetran_user_id", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.iterable_integration_tests.event_extension_data"}, "seed.iterable_integration_tests.journey_data": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "journey_data", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"id": {"type": "bigint", "index": 1, "name": "id", "comment": null}, "name": {"type": "text", "index": 2, "name": "name", "comment": null}, "journey_type": {"type": "text", "index": 3, "name": "journey_type", "comment": null}, "description": {"type": "text", "index": 4, "name": "description", "comment": null}, "creator_user_id": {"type": "text", "index": 5, "name": "creator_user_id", "comment": null}, "enabled": {"type": "boolean", "index": 6, "name": "enabled", "comment": null}, "is_archived": {"type": "boolean", "index": 7, "name": "is_archived", "comment": null}, "lifetime_limit": {"type": "bigint", "index": 8, "name": "lifetime_limit", "comment": null}, "simultaneous_limit": {"type": "bigint", "index": 9, "name": "simultaneous_limit", "comment": null}, "start_tile_id": {"type": "bigint", "index": 10, "name": "start_tile_id", "comment": null}, "trigger_event_names": {"type": "text", "index": 11, "name": "trigger_event_names", "comment": null}, "created_at": {"type": "timestamp without time zone", "index": 12, "name": "created_at", "comment": null}, "updated_at": {"type": "timestamp without time zone", "index": 13, "name": "updated_at", "comment": null}, "_fivetran_deleted": {"type": "boolean", "index": 14, "name": "_fivetran_deleted", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 15, "name": "_fivetran_synced", "comment": null}, "draft_name": {"type": "text", "index": 16, "name": "draft_name", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.iterable_integration_tests.journey_data"}, "seed.iterable_integration_tests.list_data": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "list_data", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"id": {"type": "integer", "index": 1, "name": "id", "comment": null}, "name": {"type": "text", "index": 2, "name": "name", "comment": null}, "created_at": {"type": "text", "index": 3, "name": "created_at", "comment": null}, "list_type": {"type": "text", "index": 4, "name": "list_type", "comment": null}, "_fivetran_deleted": {"type": "boolean", "index": 5, "name": "_fivetran_deleted", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 6, "name": "_fivetran_synced", "comment": null}, "description": {"type": "text", "index": 7, "name": "description", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.iterable_integration_tests.list_data"}, "seed.iterable_integration_tests.list_user_data": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "list_user_data", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"_fivetran_id": {"type": "text", "index": 1, "name": "_fivetran_id", "comment": null}, "index": {"type": "bigint", "index": 2, "name": "index", "comment": null}, "list_id": {"type": "bigint", "index": 3, "name": "list_id", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 4, "name": "_fivetran_synced", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.iterable_integration_tests.list_user_data"}, "seed.iterable_integration_tests.message_type_data": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "message_type_data", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"id": {"type": "bigint", "index": 1, "name": "id", "comment": null}, "name": {"type": "text", "index": 2, "name": "name", "comment": null}, "channel_id": {"type": "bigint", "index": 3, "name": "channel_id", "comment": null}, "_fivetran_deleted": {"type": "boolean", "index": 4, "name": "_fivetran_deleted", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 5, "name": "_fivetran_synced", "comment": null}, "created_at": {"type": "timestamp without time zone", "index": 6, "name": "created_at", "comment": null}, "frequency_cap": {"type": "integer", "index": 7, "name": "frequency_cap", "comment": null}, "rate_limit_per_minute": {"type": "integer", "index": 8, "name": "rate_limit_per_minute", "comment": null}, "subscription_policy": {"type": "text", "index": 9, "name": "subscription_policy", "comment": null}, "updated_at": {"type": "timestamp without time zone", "index": 10, "name": "updated_at", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.iterable_integration_tests.message_type_data"}, "seed.iterable_integration_tests.template_history_data": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "template_history_data", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"id": {"type": "integer", "index": 1, "name": "id", "comment": null}, "updated_at": {"type": "text", "index": 2, "name": "updated_at", "comment": null}, "message_type_id": {"type": "integer", "index": 3, "name": "message_type_id", "comment": null}, "client_template_id": {"type": "integer", "index": 4, "name": "client_template_id", "comment": null}, "created_at": {"type": "text", "index": 5, "name": "created_at", "comment": null}, "creator_user_id": {"type": "text", "index": 6, "name": "creator_user_id", "comment": null}, "name": {"type": "text", "index": 7, "name": "name", "comment": null}, "template_type": {"type": "text", "index": 8, "name": "template_type", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 9, "name": "_fivetran_synced", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.iterable_integration_tests.template_history_data"}, "seed.iterable_integration_tests.user_history_bq_json_data": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "user_history_bq_json_data", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"email": {"type": "text", "index": 1, "name": "email", "comment": null}, "updated_at": {"type": "text", "index": 2, "name": "updated_at", "comment": null}, "first_name": {"type": "integer", "index": 3, "name": "first_name", "comment": null}, "last_name": {"type": "integer", "index": 4, "name": "last_name", "comment": null}, "phone_number": {"type": "integer", "index": 5, "name": "phone_number", "comment": null}, "user_id": {"type": "integer", "index": 6, "name": "user_id", "comment": null}, "signup_date": {"type": "text", "index": 7, "name": "signup_date", "comment": null}, "signup_source": {"type": "text", "index": 8, "name": "signup_source", "comment": null}, "phone_number_carrier": {"type": "integer", "index": 9, "name": "phone_number_carrier", "comment": null}, "phone_number_country_code_iso": {"type": "integer", "index": 10, "name": "phone_number_country_code_iso", "comment": null}, "phone_number_line_type": {"type": "integer", "index": 11, "name": "phone_number_line_type", "comment": null}, "phone_number_updated_at": {"type": "integer", "index": 12, "name": "phone_number_updated_at", "comment": null}, "_fivetran_synced": {"type": "text", "index": 13, "name": "_fivetran_synced", "comment": null}, "email_list_ids": {"type": "text", "index": 14, "name": "email_list_ids", "comment": null}, "iterable_user_id": {"type": "integer", "index": 15, "name": "iterable_user_id", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.iterable_integration_tests.user_history_bq_json_data"}, "seed.iterable_integration_tests.user_history_data": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "user_history_data", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"email": {"type": "text", "index": 1, "name": "email", "comment": null}, "updated_at": {"type": "timestamp without time zone", "index": 2, "name": "updated_at", "comment": null}, "first_name": {"type": "integer", "index": 3, "name": "first_name", "comment": null}, "last_name": {"type": "integer", "index": 4, "name": "last_name", "comment": null}, "phone_number": {"type": "integer", "index": 5, "name": "phone_number", "comment": null}, "user_id": {"type": "integer", "index": 6, "name": "user_id", "comment": null}, "signup_date": {"type": "text", "index": 7, "name": "signup_date", "comment": null}, "signup_source": {"type": "text", "index": 8, "name": "signup_source", "comment": null}, "phone_number_carrier": {"type": "integer", "index": 9, "name": "phone_number_carrier", "comment": null}, "phone_number_country_code_iso": {"type": "integer", "index": 10, "name": "phone_number_country_code_iso", "comment": null}, "phone_number_line_type": {"type": "integer", "index": 11, "name": "phone_number_line_type", "comment": null}, "phone_number_updated_at": {"type": "integer", "index": 12, "name": "phone_number_updated_at", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 13, "name": "_fivetran_synced", "comment": null}, "email_list_ids": {"type": "text", "index": 14, "name": "email_list_ids", "comment": null}, "iterable_user_id": {"type": "integer", "index": 15, "name": "iterable_user_id", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.iterable_integration_tests.user_history_data"}, "seed.iterable_integration_tests.user_unsubscribed_channel_data": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "user_unsubscribed_channel_data", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"_fivetran_id": {"type": "text", "index": 1, "name": "_fivetran_id", "comment": null}, "channel_id": {"type": "integer", "index": 2, "name": "channel_id", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 3, "name": "_fivetran_synced", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.iterable_integration_tests.user_unsubscribed_channel_data"}, "seed.iterable_integration_tests.user_unsubscribed_channel_history_data": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "user_unsubscribed_channel_history_data", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"email": {"type": "text", "index": 1, "name": "email", "comment": null}, "channel_id": {"type": "bigint", "index": 2, "name": "channel_id", "comment": null}, "updated_at": {"type": "text", "index": 3, "name": "updated_at", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 4, "name": "_fivetran_synced", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.iterable_integration_tests.user_unsubscribed_channel_history_data"}, "seed.iterable_integration_tests.user_unsubscribed_message_type_data": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "user_unsubscribed_message_type_data", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"_fivetran_id": {"type": "text", "index": 1, "name": "_fivetran_id", "comment": null}, "message_type_id": {"type": "integer", "index": 2, "name": "message_type_id", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 3, "name": "_fivetran_synced", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.iterable_integration_tests.user_unsubscribed_message_type_data"}, "seed.iterable_integration_tests.user_unsubscribed_message_type_history_data": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "user_unsubscribed_message_type_history_data", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"message_type_id": {"type": "integer", "index": 1, "name": "message_type_id", "comment": null}, "email": {"type": "text", "index": 2, "name": "email", "comment": null}, "updated_at": {"type": "text", "index": 3, "name": "updated_at", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 4, "name": "_fivetran_synced", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.iterable_integration_tests.user_unsubscribed_message_type_history_data"}, "model.iterable.int_iterable__campaign_event_metrics": {"metadata": {"type": "VIEW", "schema": "public_iterable_dev", "name": "int_iterable__campaign_event_metrics", "database": "postgres", "comment": "Table that generates relevant total and unique campaign/experiment level aggregations.", "owner": "postgres"}, "columns": {"source_relation": {"type": "text", "index": 1, "name": "source_relation", "comment": null}, "campaign_id": {"type": "text", "index": 2, "name": "campaign_id", "comment": null}, "template_id": {"type": "text", "index": 3, "name": "template_id", "comment": null}, "experiment_id": {"type": "integer", "index": 4, "name": "experiment_id", "comment": null}, "count_unique_users": {"type": "bigint", "index": 5, "name": "count_unique_users", "comment": null}, "total_emailclick": {"type": "numeric", "index": 6, "name": "total_emailclick", "comment": null}, "unique_total_emailclick": {"type": "bigint", "index": 7, "name": "unique_total_emailclick", "comment": null}, "total_emailunsubscribe": {"type": "numeric", "index": 8, "name": "total_emailunsubscribe", "comment": null}, "unique_total_emailunsubscribe": {"type": "bigint", "index": 9, "name": "unique_total_emailunsubscribe", "comment": null}, "total_emailcomplaint": {"type": "numeric", "index": 10, "name": "total_emailcomplaint", "comment": null}, "unique_total_emailcomplaint": {"type": "bigint", "index": 11, "name": "unique_total_emailcomplaint", "comment": null}, "total_customevent": {"type": "numeric", "index": 12, "name": "total_customevent", "comment": null}, "unique_total_customevent": {"type": "bigint", "index": 13, "name": "unique_total_customevent", "comment": null}, "total_emailsubscribe": {"type": "numeric", "index": 14, "name": "total_emailsubscribe", "comment": null}, "unique_total_emailsubscribe": {"type": "bigint", "index": 15, "name": "unique_total_emailsubscribe", "comment": null}, "total_emailopen": {"type": "numeric", "index": 16, "name": "total_emailopen", "comment": null}, "unique_total_emailopen": {"type": "bigint", "index": 17, "name": "unique_total_emailopen", "comment": null}, "total_pushsend": {"type": "numeric", "index": 18, "name": "total_pushsend", "comment": null}, "unique_total_pushsend": {"type": "bigint", "index": 19, "name": "unique_total_pushsend", "comment": null}, "total_smsbounce": {"type": "numeric", "index": 20, "name": "total_smsbounce", "comment": null}, "unique_total_smsbounce": {"type": "bigint", "index": 21, "name": "unique_total_smsbounce", "comment": null}, "total_pushbounce": {"type": "numeric", "index": 22, "name": "total_pushbounce", "comment": null}, "unique_total_pushbounce": {"type": "bigint", "index": 23, "name": "unique_total_pushbounce", "comment": null}, "total_inappsendskip": {"type": "numeric", "index": 24, "name": "total_inappsendskip", "comment": null}, "unique_total_inappsendskip": {"type": "bigint", "index": 25, "name": "unique_total_inappsendskip", "comment": null}, "total_smssend": {"type": "numeric", "index": 26, "name": "total_smssend", "comment": null}, "unique_total_smssend": {"type": "bigint", "index": 27, "name": "unique_total_smssend", "comment": null}, "total_inappsend": {"type": "numeric", "index": 28, "name": "total_inappsend", "comment": null}, "unique_total_inappsend": {"type": "bigint", "index": 29, "name": "unique_total_inappsend", "comment": null}, "total_pushopen": {"type": "numeric", "index": 30, "name": "total_pushopen", "comment": null}, "unique_total_pushopen": {"type": "bigint", "index": 31, "name": "unique_total_pushopen", "comment": null}, "total_emailsend": {"type": "numeric", "index": 32, "name": "total_emailsend", "comment": null}, "unique_total_emailsend": {"type": "bigint", "index": 33, "name": "unique_total_emailsend", "comment": null}, "total_pushsendskip": {"type": "numeric", "index": 34, "name": "total_pushsendskip", "comment": null}, "unique_total_pushsendskip": {"type": "bigint", "index": 35, "name": "unique_total_pushsendskip", "comment": null}, "total_inappopen": {"type": "numeric", "index": 36, "name": "total_inappopen", "comment": null}, "unique_total_inappopen": {"type": "bigint", "index": 37, "name": "unique_total_inappopen", "comment": null}, "total_emailsendskip": {"type": "numeric", "index": 38, "name": "total_emailsendskip", "comment": null}, "unique_total_emailsendskip": {"type": "bigint", "index": 39, "name": "unique_total_emailsendskip", "comment": null}, "total_emailbounce": {"type": "numeric", "index": 40, "name": "total_emailbounce", "comment": null}, "unique_total_emailbounce": {"type": "bigint", "index": 41, "name": "unique_total_emailbounce", "comment": null}, "total_inappclick": {"type": "numeric", "index": 42, "name": "total_inappclick", "comment": null}, "unique_total_inappclick": {"type": "bigint", "index": 43, "name": "unique_total_inappclick", "comment": null}, "total_pushuninstall": {"type": "numeric", "index": 44, "name": "total_pushuninstall", "comment": null}, "unique_total_pushuninstall": {"type": "bigint", "index": 45, "name": "unique_total_pushuninstall", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.int_iterable__campaign_event_metrics"}, "model.iterable.int_iterable__campaign_labels": {"metadata": {"type": "VIEW", "schema": "public_iterable_dev", "name": "int_iterable__campaign_labels", "database": "postgres", "comment": "Table that provides the distinct string aggregation of labels for each campaign.", "owner": "postgres"}, "columns": {"source_relation": {"type": "text", "index": 1, "name": "source_relation", "comment": null}, "campaign_id": {"type": "text", "index": 2, "name": "campaign_id", "comment": null}, "labels": {"type": "text", "index": 3, "name": "labels", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.int_iterable__campaign_labels"}, "model.iterable.int_iterable__campaign_lists": {"metadata": {"type": "VIEW", "schema": "public_iterable_dev", "name": "int_iterable__campaign_lists", "database": "postgres", "comment": "Table that identifies the suppressed and send lists associated with a campaign.", "owner": "postgres"}, "columns": {"source_relation": {"type": "text", "index": 1, "name": "source_relation", "comment": null}, "list_id": {"type": "text", "index": 2, "name": "list_id", "comment": null}, "campaign_id": {"type": "text", "index": 3, "name": "campaign_id", "comment": null}, "updated_at": {"type": "text", "index": 4, "name": "updated_at", "comment": null}, "list_activity": {"type": "text", "index": 5, "name": "list_activity", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.int_iterable__campaign_lists"}, "model.iterable.int_iterable__journey_event_metrics": {"metadata": {"type": "VIEW", "schema": "public_iterable_dev", "name": "int_iterable__journey_event_metrics", "database": "postgres", "comment": "Table that generates relevant total and unique journey level aggregations, rolled up from the user/campaign grain via the campaign's journey reference.", "owner": "postgres"}, "columns": {"source_relation": {"type": "text", "index": 1, "name": "source_relation", "comment": null}, "journey_id": {"type": "text", "index": 2, "name": "journey_id", "comment": null}, "count_total_campaigns": {"type": "bigint", "index": 3, "name": "count_total_campaigns", "comment": null}, "count_unique_users": {"type": "bigint", "index": 4, "name": "count_unique_users", "comment": null}, "first_event_at": {"type": "timestamp without time zone", "index": 5, "name": "first_event_at", "comment": null}, "last_event_at": {"type": "timestamp without time zone", "index": 6, "name": "last_event_at", "comment": null}, "total_emailclick": {"type": "numeric", "index": 7, "name": "total_emailclick", "comment": null}, "unique_total_emailclick": {"type": "bigint", "index": 8, "name": "unique_total_emailclick", "comment": null}, "total_emailunsubscribe": {"type": "numeric", "index": 9, "name": "total_emailunsubscribe", "comment": null}, "unique_total_emailunsubscribe": {"type": "bigint", "index": 10, "name": "unique_total_emailunsubscribe", "comment": null}, "total_emailcomplaint": {"type": "numeric", "index": 11, "name": "total_emailcomplaint", "comment": null}, "unique_total_emailcomplaint": {"type": "bigint", "index": 12, "name": "unique_total_emailcomplaint", "comment": null}, "total_customevent": {"type": "numeric", "index": 13, "name": "total_customevent", "comment": null}, "unique_total_customevent": {"type": "bigint", "index": 14, "name": "unique_total_customevent", "comment": null}, "total_emailsubscribe": {"type": "numeric", "index": 15, "name": "total_emailsubscribe", "comment": null}, "unique_total_emailsubscribe": {"type": "bigint", "index": 16, "name": "unique_total_emailsubscribe", "comment": null}, "total_emailopen": {"type": "numeric", "index": 17, "name": "total_emailopen", "comment": null}, "unique_total_emailopen": {"type": "bigint", "index": 18, "name": "unique_total_emailopen", "comment": null}, "total_pushsend": {"type": "numeric", "index": 19, "name": "total_pushsend", "comment": null}, "unique_total_pushsend": {"type": "bigint", "index": 20, "name": "unique_total_pushsend", "comment": null}, "total_smsbounce": {"type": "numeric", "index": 21, "name": "total_smsbounce", "comment": null}, "unique_total_smsbounce": {"type": "bigint", "index": 22, "name": "unique_total_smsbounce", "comment": null}, "total_pushbounce": {"type": "numeric", "index": 23, "name": "total_pushbounce", "comment": null}, "unique_total_pushbounce": {"type": "bigint", "index": 24, "name": "unique_total_pushbounce", "comment": null}, "total_inappsendskip": {"type": "numeric", "index": 25, "name": "total_inappsendskip", "comment": null}, "unique_total_inappsendskip": {"type": "bigint", "index": 26, "name": "unique_total_inappsendskip", "comment": null}, "total_smssend": {"type": "numeric", "index": 27, "name": "total_smssend", "comment": null}, "unique_total_smssend": {"type": "bigint", "index": 28, "name": "unique_total_smssend", "comment": null}, "total_inappsend": {"type": "numeric", "index": 29, "name": "total_inappsend", "comment": null}, "unique_total_inappsend": {"type": "bigint", "index": 30, "name": "unique_total_inappsend", "comment": null}, "total_pushopen": {"type": "numeric", "index": 31, "name": "total_pushopen", "comment": null}, "unique_total_pushopen": {"type": "bigint", "index": 32, "name": "unique_total_pushopen", "comment": null}, "total_emailsend": {"type": "numeric", "index": 33, "name": "total_emailsend", "comment": null}, "unique_total_emailsend": {"type": "bigint", "index": 34, "name": "unique_total_emailsend", "comment": null}, "total_pushsendskip": {"type": "numeric", "index": 35, "name": "total_pushsendskip", "comment": null}, "unique_total_pushsendskip": {"type": "bigint", "index": 36, "name": "unique_total_pushsendskip", "comment": null}, "total_inappopen": {"type": "numeric", "index": 37, "name": "total_inappopen", "comment": null}, "unique_total_inappopen": {"type": "bigint", "index": 38, "name": "unique_total_inappopen", "comment": null}, "total_emailsendskip": {"type": "numeric", "index": 39, "name": "total_emailsendskip", "comment": null}, "unique_total_emailsendskip": {"type": "bigint", "index": 40, "name": "unique_total_emailsendskip", "comment": null}, "total_emailbounce": {"type": "numeric", "index": 41, "name": "total_emailbounce", "comment": null}, "unique_total_emailbounce": {"type": "bigint", "index": 42, "name": "unique_total_emailbounce", "comment": null}, "total_inappclick": {"type": "numeric", "index": 43, "name": "total_inappclick", "comment": null}, "unique_total_inappclick": {"type": "bigint", "index": 44, "name": "unique_total_inappclick", "comment": null}, "total_pushuninstall": {"type": "numeric", "index": 45, "name": "total_pushuninstall", "comment": null}, "unique_total_pushuninstall": {"type": "bigint", "index": 46, "name": "unique_total_pushuninstall", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.int_iterable__journey_event_metrics"}, "model.iterable.int_iterable__latest_campaign": {"metadata": {"type": "VIEW", "schema": "public_iterable_dev", "name": "int_iterable__latest_campaign", "database": "postgres", "comment": "Table that filters out historical versions of the campaign, and returns the most recent campaign version.", "owner": "postgres"}, "columns": {"source_relation": {"type": "text", "index": 1, "name": "source_relation", "comment": null}, "campaign_id": {"type": "text", "index": 2, "name": "campaign_id", "comment": null}, "updated_at": {"type": "text", "index": 3, "name": "updated_at", "comment": null}, "campaign_name": {"type": "text", "index": 4, "name": "campaign_name", "comment": null}, "campaign_state": {"type": "text", "index": 5, "name": "campaign_state", "comment": null}, "campaign_type": {"type": "text", "index": 6, "name": "campaign_type", "comment": null}, "send_size": {"type": "integer", "index": 7, "name": "send_size", "comment": null}, "start_at": {"type": "integer", "index": 8, "name": "start_at", "comment": null}, "ended_at": {"type": "integer", "index": 9, "name": "ended_at", "comment": null}, "created_at": {"type": "text", "index": 10, "name": "created_at", "comment": null}, "message_medium": {"type": "text", "index": 11, "name": "message_medium", "comment": null}, "recurring_campaign_id": {"type": "text", "index": 12, "name": "recurring_campaign_id", "comment": null}, "created_by_user_id": {"type": "text", "index": 13, "name": "created_by_user_id", "comment": null}, "updated_by_user_id": {"type": "text", "index": 14, "name": "updated_by_user_id", "comment": null}, "template_id": {"type": "text", "index": 15, "name": "template_id", "comment": null}, "workflow_id": {"type": "integer", "index": 16, "name": "workflow_id", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 17, "name": "_fivetran_synced", "comment": null}, "latest_campaign_index": {"type": "bigint", "index": 18, "name": "latest_campaign_index", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.int_iterable__latest_campaign"}, "model.iterable.int_iterable__latest_template": {"metadata": {"type": "VIEW", "schema": "public_iterable_dev", "name": "int_iterable__latest_template", "database": "postgres", "comment": "Table that provides the most recent version of the template as well as joining relevant message type information.", "owner": "postgres"}, "columns": {"source_relation": {"type": "text", "index": 1, "name": "source_relation", "comment": null}, "template_id": {"type": "text", "index": 2, "name": "template_id", "comment": null}, "template_name": {"type": "text", "index": 3, "name": "template_name", "comment": null}, "template_type": {"type": "text", "index": 4, "name": "template_type", "comment": null}, "created_at": {"type": "text", "index": 5, "name": "created_at", "comment": null}, "client_template_id": {"type": "text", "index": 6, "name": "client_template_id", "comment": null}, "creator_user_id": {"type": "text", "index": 7, "name": "creator_user_id", "comment": null}, "message_type_id": {"type": "text", "index": 8, "name": "message_type_id", "comment": null}, "updated_at": {"type": "text", "index": 9, "name": "updated_at", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 10, "name": "_fivetran_synced", "comment": null}, "latest_template_index": {"type": "bigint", "index": 11, "name": "latest_template_index", "comment": null}, "message_type_name": {"type": "text", "index": 12, "name": "message_type_name", "comment": null}, "channel_id": {"type": "text", "index": 13, "name": "channel_id", "comment": null}, "channel_name": {"type": "text", "index": 14, "name": "channel_name", "comment": null}, "channel_type": {"type": "text", "index": 15, "name": "channel_type", "comment": null}, "message_medium": {"type": "text", "index": 16, "name": "message_medium", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.int_iterable__latest_template"}, "model.iterable.int_iterable__latest_user": {"metadata": {"type": "VIEW", "schema": "public_iterable_dev", "name": "int_iterable__latest_user", "database": "postgres", "comment": "Table that filters out historical versions of the user, and returns only the most recent version.", "owner": "postgres"}, "columns": {"source_relation": {"type": "text", "index": 1, "name": "source_relation", "comment": null}, "_fivetran_user_id": {"type": "text", "index": 2, "name": "_fivetran_user_id", "comment": null}, "email": {"type": "text", "index": 3, "name": "email", "comment": null}, "updated_at": {"type": "timestamp without time zone", "index": 4, "name": "updated_at", "comment": null}, "user_id": {"type": "text", "index": 5, "name": "user_id", "comment": null}, "first_name": {"type": "integer", "index": 6, "name": "first_name", "comment": null}, "last_name": {"type": "integer", "index": 7, "name": "last_name", "comment": null}, "email_list_ids": {"type": "text", "index": 8, "name": "email_list_ids", "comment": null}, "phone_number": {"type": "integer", "index": 9, "name": "phone_number", "comment": null}, "signup_date": {"type": "text", "index": 10, "name": "signup_date", "comment": null}, "signup_source": {"type": "text", "index": 11, "name": "signup_source", "comment": null}, "iterable_user_id": {"type": "text", "index": 12, "name": "iterable_user_id", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 13, "name": "_fivetran_synced", "comment": null}, "unique_user_key": {"type": "text", "index": 14, "name": "unique_user_key", "comment": null}, "latest_user_index": {"type": "bigint", "index": 15, "name": "latest_user_index", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.int_iterable__latest_user"}, "model.iterable.int_iterable__list_user_history": {"metadata": {"type": "BASE TABLE", "schema": "public_iterable_dev", "name": "int_iterable__list_user_history", "database": "postgres", "comment": "Table that provides a history of all lists the user has been associated with.", "owner": "postgres"}, "columns": {"source_relation": {"type": "text", "index": 1, "name": "source_relation", "comment": null}, "_fivetran_user_id": {"type": "text", "index": 2, "name": "_fivetran_user_id", "comment": null}, "unique_user_key": {"type": "text", "index": 3, "name": "unique_user_key", "comment": null}, "email": {"type": "text", "index": 4, "name": "email", "comment": null}, "user_id": {"type": "text", "index": 5, "name": "user_id", "comment": null}, "first_name": {"type": "integer", "index": 6, "name": "first_name", "comment": null}, "last_name": {"type": "integer", "index": 7, "name": "last_name", "comment": null}, "email_list_ids": {"type": "text", "index": 8, "name": "email_list_ids", "comment": null}, "phone_number": {"type": "integer", "index": 9, "name": "phone_number", "comment": null}, "signup_date": {"type": "text", "index": 10, "name": "signup_date", "comment": null}, "signup_source": {"type": "text", "index": 11, "name": "signup_source", "comment": null}, "updated_at": {"type": "timestamp without time zone", "index": 12, "name": "updated_at", "comment": null}, "is_current": {"type": "boolean", "index": 13, "name": "is_current", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.int_iterable__list_user_history"}, "model.iterable.int_iterable__list_user_unnest": {"metadata": {"type": "BASE TABLE", "schema": "public_iterable_dev", "name": "int_iterable__list_user_unnest", "database": "postgres", "comment": "Table that unnests the `email_list_id` field for each user to create a new record for each user and the unique list it was associated with at a unique update. Due to the unnesting functions varying greatly between warehouses, conditional logic is applied throughout the model to appropriately accommodate the model being ran within Redshift, Snowflake, BigQuery, and Postgres.\n", "owner": "postgres"}, "columns": {"source_relation": {"type": "text", "index": 1, "name": "source_relation", "comment": null}, "_fivetran_user_id": {"type": "text", "index": 2, "name": "_fivetran_user_id", "comment": null}, "unique_user_key": {"type": "text", "index": 3, "name": "unique_user_key", "comment": null}, "user_id": {"type": "text", "index": 4, "name": "user_id", "comment": null}, "email": {"type": "text", "index": 5, "name": "email", "comment": null}, "first_name": {"type": "integer", "index": 6, "name": "first_name", "comment": null}, "last_name": {"type": "integer", "index": 7, "name": "last_name", "comment": null}, "signup_date": {"type": "text", "index": 8, "name": "signup_date", "comment": null}, "signup_source": {"type": "text", "index": 9, "name": "signup_source", "comment": null}, "updated_at": {"type": "timestamp without time zone", "index": 10, "name": "updated_at", "comment": null}, "phone_number": {"type": "integer", "index": 11, "name": "phone_number", "comment": null}, "is_current": {"type": "boolean", "index": 12, "name": "is_current", "comment": null}, "email_list_ids": {"type": "text", "index": 13, "name": "email_list_ids", "comment": null}, "list_id": {"type": "integer", "index": 14, "name": "list_id", "comment": null}, "unique_key": {"type": "text", "index": 15, "name": "unique_key", "comment": null}, "date_day": {"type": "date", "index": 16, "name": "date_day", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.int_iterable__list_user_unnest"}, "model.iterable.int_iterable__message_type_channel": {"metadata": {"type": "VIEW", "schema": "public_iterable_dev", "name": "int_iterable__message_type_channel", "database": "postgres", "comment": "Table that joins the message type and channel records together into one comprehensive model to be referenced downstream.", "owner": "postgres"}, "columns": {"source_relation": {"type": "text", "index": 1, "name": "source_relation", "comment": null}, "channel_id": {"type": "text", "index": 2, "name": "channel_id", "comment": null}, "channel_name": {"type": "text", "index": 3, "name": "channel_name", "comment": null}, "channel_type": {"type": "text", "index": 4, "name": "channel_type", "comment": null}, "message_medium": {"type": "text", "index": 5, "name": "message_medium", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 6, "name": "_fivetran_synced", "comment": null}, "message_type_name": {"type": "text", "index": 7, "name": "message_type_name", "comment": null}, "message_type_id": {"type": "text", "index": 8, "name": "message_type_id", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.int_iterable__message_type_channel"}, "model.iterable.int_iterable__recurring_campaigns": {"metadata": {"type": "VIEW", "schema": "public_iterable_dev", "name": "int_iterable__recurring_campaigns", "database": "postgres", "comment": "Table that identifies when a campaign is associated with a recurring campaign and provides additional enriched recurring campaign information.", "owner": "postgres"}, "columns": {"source_relation": {"type": "text", "index": 1, "name": "source_relation", "comment": null}, "campaign_id": {"type": "text", "index": 2, "name": "campaign_id", "comment": null}, "campaign_name": {"type": "text", "index": 3, "name": "campaign_name", "comment": null}, "updated_at": {"type": "text", "index": 4, "name": "updated_at", "comment": null}, "campaign_state": {"type": "text", "index": 5, "name": "campaign_state", "comment": null}, "campaign_type": {"type": "text", "index": 6, "name": "campaign_type", "comment": null}, "send_size": {"type": "integer", "index": 7, "name": "send_size", "comment": null}, "start_at": {"type": "integer", "index": 8, "name": "start_at", "comment": null}, "ended_at": {"type": "integer", "index": 9, "name": "ended_at", "comment": null}, "created_at": {"type": "text", "index": 10, "name": "created_at", "comment": null}, "created_by_user_id": {"type": "text", "index": 11, "name": "created_by_user_id", "comment": null}, "template_id": {"type": "text", "index": 12, "name": "template_id", "comment": null}, "recurring_campaign_id": {"type": "text", "index": 13, "name": "recurring_campaign_id", "comment": null}, "journey_id": {"type": "text", "index": 14, "name": "journey_id", "comment": null}, "recurring_campaign_name": {"type": "text", "index": 15, "name": "recurring_campaign_name", "comment": null}, "recurring_campaign_state": {"type": "text", "index": 16, "name": "recurring_campaign_state", "comment": null}, "recurring_campaign_send_size": {"type": "integer", "index": 17, "name": "recurring_campaign_send_size", "comment": null}, "recurring_campaign_start_at": {"type": "integer", "index": 18, "name": "recurring_campaign_start_at", "comment": null}, "is_campaign_recurring": {"type": "boolean", "index": 19, "name": "is_campaign_recurring", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.int_iterable__recurring_campaigns"}, "model.iterable.int_iterable__user_event_metrics": {"metadata": {"type": "VIEW", "schema": "public_iterable_dev", "name": "int_iterable__user_event_metrics", "database": "postgres", "comment": "Table that generates user aggregations at the campaign level.", "owner": "postgres"}, "columns": {"source_relation": {"type": "text", "index": 1, "name": "source_relation", "comment": null}, "_fivetran_user_id": {"type": "text", "index": 2, "name": "_fivetran_user_id", "comment": null}, "unique_user_key": {"type": "text", "index": 3, "name": "unique_user_key", "comment": null}, "user_id": {"type": "text", "index": 4, "name": "user_id", "comment": null}, "user_email": {"type": "text", "index": 5, "name": "user_email", "comment": null}, "count_total_campaigns": {"type": "bigint", "index": 6, "name": "count_total_campaigns", "comment": null}, "first_event_at": {"type": "timestamp without time zone", "index": 7, "name": "first_event_at", "comment": null}, "last_event_at": {"type": "timestamp without time zone", "index": 8, "name": "last_event_at", "comment": null}, "total_emailclick": {"type": "numeric", "index": 9, "name": "total_emailclick", "comment": null}, "total_emailunsubscribe": {"type": "numeric", "index": 10, "name": "total_emailunsubscribe", "comment": null}, "total_emailcomplaint": {"type": "numeric", "index": 11, "name": "total_emailcomplaint", "comment": null}, "total_customevent": {"type": "numeric", "index": 12, "name": "total_customevent", "comment": null}, "total_emailsubscribe": {"type": "numeric", "index": 13, "name": "total_emailsubscribe", "comment": null}, "total_emailopen": {"type": "numeric", "index": 14, "name": "total_emailopen", "comment": null}, "total_pushsend": {"type": "numeric", "index": 15, "name": "total_pushsend", "comment": null}, "total_smsbounce": {"type": "numeric", "index": 16, "name": "total_smsbounce", "comment": null}, "total_pushbounce": {"type": "numeric", "index": 17, "name": "total_pushbounce", "comment": null}, "total_inappsendskip": {"type": "numeric", "index": 18, "name": "total_inappsendskip", "comment": null}, "total_smssend": {"type": "numeric", "index": 19, "name": "total_smssend", "comment": null}, "total_inappsend": {"type": "numeric", "index": 20, "name": "total_inappsend", "comment": null}, "total_pushopen": {"type": "numeric", "index": 21, "name": "total_pushopen", "comment": null}, "total_emailsend": {"type": "numeric", "index": 22, "name": "total_emailsend", "comment": null}, "total_pushsendskip": {"type": "numeric", "index": 23, "name": "total_pushsendskip", "comment": null}, "total_inappopen": {"type": "numeric", "index": 24, "name": "total_inappopen", "comment": null}, "total_emailsendskip": {"type": "numeric", "index": 25, "name": "total_emailsendskip", "comment": null}, "total_emailbounce": {"type": "numeric", "index": 26, "name": "total_emailbounce", "comment": null}, "total_inappclick": {"type": "numeric", "index": 27, "name": "total_inappclick", "comment": null}, "total_pushuninstall": {"type": "numeric", "index": 28, "name": "total_pushuninstall", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.int_iterable__user_event_metrics"}, "model.iterable.iterable__campaigns": {"metadata": {"type": "BASE TABLE", "schema": "public_iterable_dev", "name": "iterable__campaigns", "database": "postgres", "comment": "Table that provides aggregations for campaigns at the template and if available, the experiment grain.", "owner": "postgres"}, "columns": {"source_relation": {"type": "text", "index": 1, "name": "source_relation", "comment": "Identifies the record's source."}, "campaign_id": {"type": "text", "index": 2, "name": "campaign_id", "comment": "Unique identifier of the campaign record"}, "campaign_name": {"type": "text", "index": 3, "name": "campaign_name", "comment": "User defined name of the campaign."}, "updated_at": {"type": "text", "index": 4, "name": "updated_at", "comment": "Last update timestamp"}, "campaign_state": {"type": "text", "index": 5, "name": "campaign_state", "comment": "State of the campaign. Can be Draft, Ready, Scheduled, Running, Finished, Starting, Aborted or Recurring"}, "campaign_type": {"type": "text", "index": 6, "name": "campaign_type", "comment": "The campaign type. Can be Blast or Triggered"}, "send_size": {"type": "integer", "index": 7, "name": "send_size", "comment": "Size of the campaign. Number of individuals included in the campaign"}, "start_at": {"type": "integer", "index": 8, "name": "start_at", "comment": "Start timestamp"}, "ended_at": {"type": "integer", "index": 9, "name": "ended_at", "comment": "Ended timestamp"}, "created_at": {"type": "text", "index": 10, "name": "created_at", "comment": "Creation timestamp"}, "created_by_user_id": {"type": "text", "index": 11, "name": "created_by_user_id", "comment": "Reference to the user who created the campaign"}, "template_id": {"type": "text", "index": 12, "name": "template_id", "comment": "Reference to the campaign template"}, "recurring_campaign_id": {"type": "text", "index": 13, "name": "recurring_campaign_id", "comment": "Unique identifier of the recurring campaign (if applicable)"}, "journey_id": {"type": "text", "index": 14, "name": "journey_id", "comment": "Reference to the journey the campaign belongs to, if applicable"}, "recurring_campaign_name": {"type": "text", "index": 15, "name": "recurring_campaign_name", "comment": "Name of the recurring campaign (if applicable)"}, "recurring_campaign_state": {"type": "text", "index": 16, "name": "recurring_campaign_state", "comment": "State of the recurring campaign (if applicable)"}, "recurring_campaign_send_size": {"type": "integer", "index": 17, "name": "recurring_campaign_send_size", "comment": "Size of the recurring campaign. Number of individuals included in the recurring campaign (if applicable)"}, "recurring_campaign_start_at": {"type": "integer", "index": 18, "name": "recurring_campaign_start_at", "comment": "Timestamp of when the recurring campaign started (if applicable)"}, "is_campaign_recurring": {"type": "boolean", "index": 19, "name": "is_campaign_recurring", "comment": "Boolean indicating if the campaign is a recurring campaign"}, "experiment_id": {"type": "integer", "index": 20, "name": "experiment_id", "comment": "Reference to the experiment used if the event is an experiment"}, "count_unique_users": {"type": "bigint", "index": 21, "name": "count_unique_users", "comment": "Count of total unique users within the campaign/experiment"}, "total_emailclick": {"type": "numeric", "index": 22, "name": "total_emailclick", "comment": "Total email clicks within the campaign/experiment"}, "unique_total_emailclick": {"type": "bigint", "index": 23, "name": "unique_total_emailclick", "comment": "Unique email clicks within the campaign/experiment"}, "total_emailunsubscribe": {"type": "numeric", "index": 24, "name": "total_emailunsubscribe", "comment": "Total email unsubscribe events within the campaign/experiment"}, "unique_total_emailunsubscribe": {"type": "bigint", "index": 25, "name": "unique_total_emailunsubscribe", "comment": "Unique total email unsubscribe events within the campaign/experiment"}, "total_emailcomplaint": {"type": "numeric", "index": 26, "name": "total_emailcomplaint", "comment": "Total email complaints within the campaign/experiment"}, "unique_total_emailcomplaint": {"type": "bigint", "index": 27, "name": "unique_total_emailcomplaint", "comment": "Unique total email complaints within the campaign/experiment"}, "total_customevent": {"type": "numeric", "index": 28, "name": "total_customevent", "comment": "Total custom events within the campaign/experiment"}, "unique_total_customevent": {"type": "bigint", "index": 29, "name": "unique_total_customevent", "comment": "Unique total custom events within the campaign/experiment"}, "total_emailsubscribe": {"type": "numeric", "index": 30, "name": "total_emailsubscribe", "comment": "Total email subscribe events within the campaign/experiment"}, "unique_total_emailsubscribe": {"type": "bigint", "index": 31, "name": "unique_total_emailsubscribe", "comment": "Unique total email subscribe events within the campaign/experiment"}, "total_emailopen": {"type": "numeric", "index": 32, "name": "total_emailopen", "comment": "Total email open events within the campaign/experiment"}, "unique_total_emailopen": {"type": "bigint", "index": 33, "name": "unique_total_emailopen", "comment": "Unique total email open events within the campaign/experiment"}, "total_pushsend": {"type": "numeric", "index": 34, "name": "total_pushsend", "comment": "Total push send event within the campaign/experiment"}, "unique_total_pushsend": {"type": "bigint", "index": 35, "name": "unique_total_pushsend", "comment": "Unique total push send events within the campaign/experiment"}, "total_smsbounce": {"type": "numeric", "index": 36, "name": "total_smsbounce", "comment": "Total sms bounce events within the campaign/experiment"}, "unique_total_smsbounce": {"type": "bigint", "index": 37, "name": "unique_total_smsbounce", "comment": "Unique total sms bounce events within the campaign/experiment"}, "total_pushbounce": {"type": "numeric", "index": 38, "name": "total_pushbounce", "comment": "Total push bounce events within the campaign/experiment"}, "unique_total_pushbounce": {"type": "bigint", "index": 39, "name": "unique_total_pushbounce", "comment": "Unique total push bounce events within the campaign/experiment"}, "total_inappsendskip": {"type": "numeric", "index": 40, "name": "total_inappsendskip", "comment": "Total in app send skip events within the campaign/experiment"}, "unique_total_inappsendskip": {"type": "bigint", "index": 41, "name": "unique_total_inappsendskip", "comment": "Unique total in app send skip events within the campaign/experiment"}, "total_smssend": {"type": "numeric", "index": 42, "name": "total_smssend", "comment": "Total sms send events within the campaign/experiment"}, "unique_total_smssend": {"type": "bigint", "index": 43, "name": "unique_total_smssend", "comment": "Unique total sms send events within the campaign/experiment"}, "total_inappsend": {"type": "numeric", "index": 44, "name": "total_inappsend", "comment": "Total in app send events within the campaign/experiment"}, "unique_total_inappsend": {"type": "bigint", "index": 45, "name": "unique_total_inappsend", "comment": "Unique total in app send events within the campaign/experiment"}, "total_pushopen": {"type": "numeric", "index": 46, "name": "total_pushopen", "comment": "Total push open events within the campaign/experiment"}, "unique_total_pushopen": {"type": "bigint", "index": 47, "name": "unique_total_pushopen", "comment": "Unique total push open events within the campaign/experiment"}, "total_emailsend": {"type": "numeric", "index": 48, "name": "total_emailsend", "comment": "Total email send events within the campaign/experiment"}, "unique_total_emailsend": {"type": "bigint", "index": 49, "name": "unique_total_emailsend", "comment": "Unique total email send events within the campaign/experiment"}, "total_pushsendskip": {"type": "numeric", "index": 50, "name": "total_pushsendskip", "comment": "Total push send skip events within the campaign/experiment"}, "unique_total_pushsendskip": {"type": "bigint", "index": 51, "name": "unique_total_pushsendskip", "comment": "Unique total push send skip events within the campaign/experiment"}, "total_inappopen": {"type": "numeric", "index": 52, "name": "total_inappopen", "comment": "Total in app open events within the campaign/experiment"}, "unique_total_inappopen": {"type": "bigint", "index": 53, "name": "unique_total_inappopen", "comment": "Unique total in app open events within the campaign/experiment"}, "total_emailsendskip": {"type": "numeric", "index": 54, "name": "total_emailsendskip", "comment": "Total email send skip events within the campaign/experiment"}, "unique_total_emailsendskip": {"type": "bigint", "index": 55, "name": "unique_total_emailsendskip", "comment": "Unique total email send skip events within the campaign/experiment"}, "total_emailbounce": {"type": "numeric", "index": 56, "name": "total_emailbounce", "comment": "Total email bounce events within the campaign/experiment"}, "unique_total_emailbounce": {"type": "bigint", "index": 57, "name": "unique_total_emailbounce", "comment": "Unique total email bounce events within the campaign/experiment"}, "total_inappclick": {"type": "numeric", "index": 58, "name": "total_inappclick", "comment": "Total in app click events within the campaign/experiment"}, "unique_total_inappclick": {"type": "bigint", "index": 59, "name": "unique_total_inappclick", "comment": "Unique total in app click events within the campaign/experiment"}, "total_pushuninstall": {"type": "numeric", "index": 60, "name": "total_pushuninstall", "comment": "Total push uninstall events within the campaign/experiment"}, "unique_total_pushuninstall": {"type": "bigint", "index": 61, "name": "unique_total_pushuninstall", "comment": "Unique total push uninstall events within the campaign/experiment"}, "count_send_lists": {"type": "bigint", "index": 62, "name": "count_send_lists", "comment": "Count of send lists within the campaign/experiment"}, "count_suppress_lists": {"type": "bigint", "index": 63, "name": "count_suppress_lists", "comment": "Count of suppress lists within the campaign/experiment"}, "labels": {"type": "text", "index": 64, "name": "labels", "comment": "List of labels associated with the campaign/experiment"}, "journey_name": {"type": "text", "index": 65, "name": "journey_name", "comment": "User defined name of the journey the campaign belongs to, if applicable"}, "journey_type": {"type": "text", "index": 66, "name": "journey_type", "comment": "The type of the journey the campaign belongs to, if applicable"}, "template_name": {"type": "text", "index": 67, "name": "template_name", "comment": "Name of the template associated with the campaign/experiment"}, "template_creator_user_id": {"type": "text", "index": 68, "name": "template_creator_user_id", "comment": "The creator user id of the template associated with the campaign/experiment"}, "message_medium": {"type": "text", "index": 69, "name": "message_medium", "comment": "The medium which the message was provided"}, "message_type_name": {"type": "text", "index": 70, "name": "message_type_name", "comment": "The message type name associated with the campaign/experiment"}, "channel_name": {"type": "text", "index": 71, "name": "channel_name", "comment": "The channel name associated with the campaign/experiment"}, "channel_id": {"type": "text", "index": 72, "name": "channel_id", "comment": "The channel identifier associated with the campaign/experiment"}, "channel_type": {"type": "text", "index": 73, "name": "channel_type", "comment": "The channel type associated with the campaign/experiment"}, "unique_campaign_version_id": {"type": "text", "index": 74, "name": "unique_campaign_version_id", "comment": "Unique identifier combining campaign_id, template_id, source_relation, and if available, experiment_id."}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.iterable__campaigns"}, "model.iterable.iterable__events": {"metadata": {"type": "BASE TABLE", "schema": "public_iterable_dev", "name": "iterable__events", "database": "postgres", "comment": "Table that provides a comprehensive view of all events with enriched information such as the campaign, user effected, and template used.", "owner": "postgres"}, "columns": {"source_relation": {"type": "text", "index": 1, "name": "source_relation", "comment": "Identifies the record's source."}, "event_id": {"type": "text", "index": 2, "name": "event_id", "comment": "Unique id of the event generated by Fivetran"}, "unique_event_id": {"type": "text", "index": 3, "name": "unique_event_id", "comment": "A unique surrogate key of event_id, _fivetran_user_id, and source_relation."}, "_fivetran_user_id": {"type": "text", "index": 4, "name": "_fivetran_user_id", "comment": "A Fivetran-created unique identifier for the new Iterable schema in Aug 2023, for users, derived from hashing user_id and/or email, depending on project type."}, "unique_user_key": {"type": "text", "index": 5, "name": "unique_user_key", "comment": "The unique identifier of the user. With the new schema (Aug 2023), it is the _fivetran_user_id. This is a hash of user_id and/or email, depending on project type. If using the old schema, it is email."}, "campaign_id": {"type": "text", "index": 6, "name": "campaign_id", "comment": "Reference to the campaign from which the event originated"}, "content_id": {"type": "text", "index": 7, "name": "content_id", "comment": "Reference to the content the event is associated with"}, "created_at": {"type": "timestamp without time zone", "index": 8, "name": "created_at", "comment": "Creation timestamp"}, "created_on": {"type": "date", "index": 9, "name": "created_on", "comment": "Day when the event was created"}, "email": {"type": "text", "index": 10, "name": "email", "comment": "The user's email. User identifier, for email-based projects. Previously was the unique identifier for user records, for the old Iterable schema before the August 2023 updates."}, "additional_properties": {"type": "text", "index": 11, "name": "additional_properties", "comment": "json object containing addition event properties"}, "event_name": {"type": "text", "index": 12, "name": "event_name", "comment": "Name provided to the individual event"}, "message_bus_id": {"type": "text", "index": 13, "name": "message_bus_id", "comment": "Reference to the message bus associated with the event"}, "message_id": {"type": "text", "index": 14, "name": "message_id", "comment": "Reference to the message the event is associated with"}, "message_type_id": {"type": "text", "index": 15, "name": "message_type_id", "comment": "Reference to the type of message the event is associated with"}, "recipient_state": {"type": "integer", "index": 16, "name": "recipient_state", "comment": "The state of the recipient upon receiving the event"}, "status": {"type": "integer", "index": 17, "name": "status", "comment": "Status of the event"}, "transactional_data": {"type": "character varying(100)", "index": 18, "name": "transactional_data", "comment": "Transactional data associated with the event"}, "unsub_source": {"type": "integer", "index": 19, "name": "unsub_source", "comment": "Source of the unsubscribe event"}, "user_agent": {"type": "integer", "index": 20, "name": "user_agent", "comment": "User agent associated with the event"}, "user_agent_device": {"type": "integer", "index": 21, "name": "user_agent_device", "comment": "The device of the user agent"}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 22, "name": "_fivetran_synced", "comment": "Timestamp of when the event record was synced by Fivetran"}, "campaign_name": {"type": "text", "index": 23, "name": "campaign_name", "comment": "The name of the campaign"}, "campaign_type": {"type": "text", "index": 24, "name": "campaign_type", "comment": "The type of campaign"}, "is_campaign_recurring": {"type": "boolean", "index": 25, "name": "is_campaign_recurring", "comment": "Boolean indicating if the campaign is recurrent"}, "recurring_campaign_name": {"type": "text", "index": 26, "name": "recurring_campaign_name", "comment": "The name of the recurring campaign (if applicable)"}, "recurring_campaign_id": {"type": "text", "index": 27, "name": "recurring_campaign_id", "comment": "The campaign if of the recurring campaign (if applicable)"}, "user_id": {"type": "text", "index": 28, "name": "user_id", "comment": "User identifier, for userID-based projects."}, "user_full_name": {"type": "text", "index": 29, "name": "user_full_name", "comment": "Full name of the user"}, "message_type_name": {"type": "text", "index": 30, "name": "message_type_name", "comment": "Name of the message type"}, "message_medium": {"type": "text", "index": 31, "name": "message_medium", "comment": "Medium of the message"}, "channel_id": {"type": "text", "index": 32, "name": "channel_id", "comment": "Unique identifier of the channel"}, "channel_name": {"type": "text", "index": 33, "name": "channel_name", "comment": "The channel name"}, "channel_type": {"type": "text", "index": 34, "name": "channel_type", "comment": "The type of channel"}, "is_app_already_running": {"type": "integer", "index": 35, "name": "is_app_already_running", "comment": "Boolean indicating if the app is already running"}, "badge": {"type": "integer", "index": 36, "name": "badge", "comment": "Badge associated with the event"}, "catalog_collection_count": {"type": "integer", "index": 37, "name": "catalog_collection_count", "comment": "The count of products or items collected in a catalog associated with the event."}, "catalog_lookup_count": {"type": "integer", "index": 38, "name": "catalog_lookup_count", "comment": "The count of times a catalog was looked up or queried during the event."}, "canonical_url_id": {"type": "text", "index": 39, "name": "canonical_url_id", "comment": "Reference to the url associated with the event"}, "is_content_available": {"type": "integer", "index": 40, "name": "is_content_available", "comment": "Content available from the event"}, "device": {"type": "integer", "index": 41, "name": "device", "comment": "The device associated with the event"}, "email_id": {"type": "text", "index": 42, "name": "email_id", "comment": "Reference to the email associated with the event"}, "email_subject": {"type": "text", "index": 43, "name": "email_subject", "comment": "Subject of the email associated with the event"}, "experiment_id": {"type": "integer", "index": 44, "name": "experiment_id", "comment": "Reference to the experiment used if the event is an experiment"}, "from_phone_number_id": {"type": "integer", "index": 45, "name": "from_phone_number_id", "comment": "Reference to the phone number which the event is from"}, "from_smssender_id": {"type": "integer", "index": 46, "name": "from_smssender_id", "comment": "Reference to the sms sender which the event is from"}, "link_id": {"type": "text", "index": 47, "name": "link_id", "comment": "Reference to the link associated with the event"}, "link_url": {"type": "integer", "index": 48, "name": "link_url", "comment": "Url of the link associated with the event"}, "locale": {"type": "integer", "index": 49, "name": "locale", "comment": "Locale associated with the event"}, "payload": {"type": "character varying(100)", "index": 50, "name": "payload", "comment": "Payload resulted from the event"}, "platform_endpoint": {"type": "integer", "index": 51, "name": "platform_endpoint", "comment": "The specific platform endpoint of the event"}, "push_message": {"type": "integer", "index": 52, "name": "push_message", "comment": "Boolean indicating if the event is a push message"}, "region": {"type": "text", "index": 53, "name": "region", "comment": "Region of the event"}, "sms_message": {"type": "integer", "index": 54, "name": "sms_message", "comment": "Boolean indicating if the event is an sms message"}, "to_phone_number": {"type": "integer", "index": 55, "name": "to_phone_number", "comment": "To phone number associated with the event"}, "url": {"type": "integer", "index": 56, "name": "url", "comment": "Url associated with the event"}, "workflow_id": {"type": "text", "index": 57, "name": "workflow_id", "comment": "Reference to the workflow which the event originated"}, "workflow_name": {"type": "text", "index": 58, "name": "workflow_name", "comment": "Name of the workflow which the event originated"}, "city": {"type": "text", "index": 59, "name": "city", "comment": "The city associated with the event, which could be the location of the recipient."}, "clicked_url": {"type": "text", "index": 60, "name": "clicked_url", "comment": "The URL that was clicked by the recipient in response to the marketing message."}, "country": {"type": "text", "index": 61, "name": "country", "comment": "The country associated with the event, which could be the location of the recipient."}, "error_code": {"type": "integer", "index": 62, "name": "error_code", "comment": "The error code or message indicating any issues or errors encountered during the event."}, "expires_at": {"type": "text", "index": 63, "name": "expires_at", "comment": "The date and time when the event or message is set to expire or become invalid."}, "from_phone_number": {"type": "integer", "index": 64, "name": "from_phone_number", "comment": "The phone number from which the SMS message was sent."}, "in_app_body": {"type": "text", "index": 65, "name": "in_app_body", "comment": "The content or body of an in-app message that was sent as part of the event."}, "is_sms_estimation": {"type": "boolean", "index": 66, "name": "is_sms_estimation", "comment": "A boolean indicating whether the SMS message is an estimation or not."}, "labels": {"type": "text", "index": 67, "name": "labels", "comment": "Any labels or tags associated with the event, which can be used for categorization or organization."}, "message_status": {"type": "text", "index": 68, "name": "message_status", "comment": "The status of the marketing message, such as sent, delivered, opened, etc."}, "mms_send_count": {"type": "integer", "index": 69, "name": "mms_send_count", "comment": "The count of multimedia messages (MMS) sent as part of the event."}, "reason": {"type": "text", "index": 70, "name": "reason", "comment": "The reason or cause associated with a specific event or action."}, "sms_send_count": {"type": "integer", "index": 71, "name": "sms_send_count", "comment": "The count of SMS messages sent as part of the event."}, "template_id": {"type": "text", "index": 72, "name": "template_id", "comment": "Unique identifier of the template"}, "template_name": {"type": "text", "index": 73, "name": "template_name", "comment": "User defined name of the template"}, "template_creator_user_id": {"type": "text", "index": 74, "name": "template_creator_user_id", "comment": "Reference to the user who created the template"}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.iterable__events"}, "model.iterable.iterable__journeys": {"metadata": {"type": "BASE TABLE", "schema": "public_iterable_dev", "name": "iterable__journeys", "database": "postgres", "comment": "Table that provides aggregations for journeys, formerly known as workflows. Metrics are rolled up from the user/campaign grain via each campaign's journey reference. Journeys which generate no events, such as those that only split audiences or update user fields, are still included with null metrics. The grain of this table is one record per journey.\n", "owner": "postgres"}, "columns": {"source_relation": {"type": "text", "index": 1, "name": "source_relation", "comment": "Identifies the record's source."}, "journey_id": {"type": "text", "index": 2, "name": "journey_id", "comment": "Unique identifier of the journey"}, "journey_name": {"type": "text", "index": 3, "name": "journey_name", "comment": "User defined name of the journey"}, "journey_type": {"type": "text", "index": 4, "name": "journey_type", "comment": "The journey type"}, "journey_description": {"type": "text", "index": 5, "name": "journey_description", "comment": "Information about the journey"}, "creator_user_id": {"type": "text", "index": 6, "name": "creator_user_id", "comment": "Reference to the user who created the journey"}, "is_enabled": {"type": "boolean", "index": 7, "name": "is_enabled", "comment": "Boolean indicating if the journey is currently enabled"}, "is_archived": {"type": "boolean", "index": 8, "name": "is_archived", "comment": "Boolean indicating if the journey has been archived"}, "lifetime_limit": {"type": "bigint", "index": 9, "name": "lifetime_limit", "comment": "Maximum number of times a user may enter the journey over their lifetime"}, "simultaneous_limit": {"type": "bigint", "index": 10, "name": "simultaneous_limit", "comment": "Maximum number of times a user may be in the journey at the same time"}, "start_tile_id": {"type": "text", "index": 11, "name": "start_tile_id", "comment": "Reference to the tile which begins the journey"}, "trigger_event_names": {"type": "text", "index": 12, "name": "trigger_event_names", "comment": "The event names which trigger a user's entry into the journey"}, "created_at": {"type": "timestamp without time zone", "index": 13, "name": "created_at", "comment": "Creation timestamp"}, "updated_at": {"type": "timestamp without time zone", "index": 14, "name": "updated_at", "comment": "Last update timestamp"}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 15, "name": "_fivetran_synced", "comment": "The time when a record was last updated by Fivetran."}, "count_total_campaigns": {"type": "bigint", "index": 16, "name": "count_total_campaigns", "comment": "Count of distinct campaigns within the journey that generated events"}, "count_unique_users": {"type": "bigint", "index": 17, "name": "count_unique_users", "comment": "Count of total unique users within the journey"}, "first_event_at": {"type": "timestamp without time zone", "index": 18, "name": "first_event_at", "comment": "Timestamp of the first event generated by any campaign in the journey"}, "last_event_at": {"type": "timestamp without time zone", "index": 19, "name": "last_event_at", "comment": "Timestamp of the most recent event generated by any campaign in the journey"}, "total_emailclick": {"type": "numeric", "index": 20, "name": "total_emailclick", "comment": "Total email clicks within the journey"}, "unique_total_emailclick": {"type": "bigint", "index": 21, "name": "unique_total_emailclick", "comment": "Count of distinct users with email clicks within the journey"}, "total_emailunsubscribe": {"type": "numeric", "index": 22, "name": "total_emailunsubscribe", "comment": "Total email unsubscribe events within the journey"}, "unique_total_emailunsubscribe": {"type": "bigint", "index": 23, "name": "unique_total_emailunsubscribe", "comment": "Count of distinct users with email unsubscribe events within the journey"}, "total_emailcomplaint": {"type": "numeric", "index": 24, "name": "total_emailcomplaint", "comment": "Total email complaints within the journey"}, "unique_total_emailcomplaint": {"type": "bigint", "index": 25, "name": "unique_total_emailcomplaint", "comment": "Count of distinct users with email complaints within the journey"}, "total_customevent": {"type": "numeric", "index": 26, "name": "total_customevent", "comment": "Total custom events within the journey"}, "unique_total_customevent": {"type": "bigint", "index": 27, "name": "unique_total_customevent", "comment": "Count of distinct users with custom events within the journey"}, "total_emailsubscribe": {"type": "numeric", "index": 28, "name": "total_emailsubscribe", "comment": "Total email subscribe events within the journey"}, "unique_total_emailsubscribe": {"type": "bigint", "index": 29, "name": "unique_total_emailsubscribe", "comment": "Count of distinct users with email subscribe events within the journey"}, "total_emailopen": {"type": "numeric", "index": 30, "name": "total_emailopen", "comment": "Total email open events within the journey"}, "unique_total_emailopen": {"type": "bigint", "index": 31, "name": "unique_total_emailopen", "comment": "Count of distinct users with email open events within the journey"}, "total_pushsend": {"type": "numeric", "index": 32, "name": "total_pushsend", "comment": "Total push send events within the journey"}, "unique_total_pushsend": {"type": "bigint", "index": 33, "name": "unique_total_pushsend", "comment": "Count of distinct users with push send events within the journey"}, "total_smsbounce": {"type": "numeric", "index": 34, "name": "total_smsbounce", "comment": "Total sms bounce events within the journey"}, "unique_total_smsbounce": {"type": "bigint", "index": 35, "name": "unique_total_smsbounce", "comment": "Count of distinct users with sms bounce events within the journey"}, "total_pushbounce": {"type": "numeric", "index": 36, "name": "total_pushbounce", "comment": "Total push bounce events within the journey"}, "unique_total_pushbounce": {"type": "bigint", "index": 37, "name": "unique_total_pushbounce", "comment": "Count of distinct users with push bounce events within the journey"}, "total_inappsendskip": {"type": "numeric", "index": 38, "name": "total_inappsendskip", "comment": "Total in app send skip events within the journey"}, "unique_total_inappsendskip": {"type": "bigint", "index": 39, "name": "unique_total_inappsendskip", "comment": "Count of distinct users with in app send skip events within the journey"}, "total_smssend": {"type": "numeric", "index": 40, "name": "total_smssend", "comment": "Total sms send events within the journey"}, "unique_total_smssend": {"type": "bigint", "index": 41, "name": "unique_total_smssend", "comment": "Count of distinct users with sms send events within the journey"}, "total_inappsend": {"type": "numeric", "index": 42, "name": "total_inappsend", "comment": "Total in app send events within the journey"}, "unique_total_inappsend": {"type": "bigint", "index": 43, "name": "unique_total_inappsend", "comment": "Count of distinct users with in app send events within the journey"}, "total_pushopen": {"type": "numeric", "index": 44, "name": "total_pushopen", "comment": "Total push open events within the journey"}, "unique_total_pushopen": {"type": "bigint", "index": 45, "name": "unique_total_pushopen", "comment": "Count of distinct users with push open events within the journey"}, "total_emailsend": {"type": "numeric", "index": 46, "name": "total_emailsend", "comment": "Total email send events within the journey"}, "unique_total_emailsend": {"type": "bigint", "index": 47, "name": "unique_total_emailsend", "comment": "Count of distinct users with email send events within the journey"}, "total_pushsendskip": {"type": "numeric", "index": 48, "name": "total_pushsendskip", "comment": "Total push send skip events within the journey"}, "unique_total_pushsendskip": {"type": "bigint", "index": 49, "name": "unique_total_pushsendskip", "comment": "Count of distinct users with push send skip events within the journey"}, "total_inappopen": {"type": "numeric", "index": 50, "name": "total_inappopen", "comment": "Total in app open events within the journey"}, "unique_total_inappopen": {"type": "bigint", "index": 51, "name": "unique_total_inappopen", "comment": "Count of distinct users with in app open events within the journey"}, "total_emailsendskip": {"type": "numeric", "index": 52, "name": "total_emailsendskip", "comment": "Total email send skip events within the journey"}, "unique_total_emailsendskip": {"type": "bigint", "index": 53, "name": "unique_total_emailsendskip", "comment": "Count of distinct users with email send skip events within the journey"}, "total_emailbounce": {"type": "numeric", "index": 54, "name": "total_emailbounce", "comment": "Total email bounce events within the journey"}, "unique_total_emailbounce": {"type": "bigint", "index": 55, "name": "unique_total_emailbounce", "comment": "Count of distinct users with email bounce events within the journey"}, "total_inappclick": {"type": "numeric", "index": 56, "name": "total_inappclick", "comment": "Total in app click events within the journey"}, "unique_total_inappclick": {"type": "bigint", "index": 57, "name": "unique_total_inappclick", "comment": "Count of distinct users with in app click events within the journey"}, "total_pushuninstall": {"type": "numeric", "index": 58, "name": "total_pushuninstall", "comment": "Total push uninstall events within the journey"}, "unique_total_pushuninstall": {"type": "bigint", "index": 59, "name": "unique_total_pushuninstall", "comment": "Count of distinct users with push uninstall events within the journey"}, "unique_journey_id": {"type": "text", "index": 60, "name": "unique_journey_id", "comment": "Unique identifier combining journey_id and source_relation."}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.iterable__journeys"}, "model.iterable.iterable__list_user_history": {"metadata": {"type": "BASE TABLE", "schema": "public_iterable_dev", "name": "iterable__list_user_history", "database": "postgres", "comment": "Table that recreates the `list_user_history` source table. Additionally, this table provides an `is_current` field to identify the current lists associated with the user. The table coalesces list_id values from both the direct list_user relationships and the unnested email_list_ids from user history to ensure comprehensive list coverage. The grain of this table is at the user/list/updated_at level.\n", "owner": "postgres"}, "columns": {"source_relation": {"type": "text", "index": 1, "name": "source_relation", "comment": "Identifies the record's source."}, "unique_user_key": {"type": "text", "index": 2, "name": "unique_user_key", "comment": "The unique identifier of the user. With the new schema (Aug 2023), it is the _fivetran_user_id. This is a hash of user_id and/or email, depending on project type. If using the old schema, it is email."}, "_fivetran_user_id": {"type": "text", "index": 3, "name": "_fivetran_user_id", "comment": "A Fivetran-created unique identifier for the new Iterable schema in Aug 2023, for users, derived from hashing user_id and/or email, depending on project type."}, "user_id": {"type": "text", "index": 4, "name": "user_id", "comment": "User identifier, for userID-based projects."}, "user_email": {"type": "text", "index": 5, "name": "user_email", "comment": "Email of the user if it exists."}, "user_first_name": {"type": "integer", "index": 6, "name": "user_first_name", "comment": "First name of the user"}, "user_last_name": {"type": "integer", "index": 7, "name": "user_last_name", "comment": "Last name of the user"}, "user_signup_date": {"type": "text", "index": 8, "name": "user_signup_date", "comment": "Timestamp of when the user signed up"}, "user_signup_source": {"type": "text", "index": 9, "name": "user_signup_source", "comment": "Source where the user signed up"}, "user_updated_at": {"type": "timestamp without time zone", "index": 10, "name": "user_updated_at", "comment": "Last update timestamp"}, "list_id": {"type": "bigint", "index": 11, "name": "list_id", "comment": "The list associated with the user. Uses coalesced values prioritizing `list_id` from `LIST_USER` over the unnested `email_list_ids` from `USER_HISTORY` for comprehensive list coverage."}, "is_current": {"type": "boolean", "index": 12, "name": "is_current", "comment": "Boolean indicating if the current list is active"}, "list_name": {"type": "text", "index": 13, "name": "list_name", "comment": "Name of the list associated with the user"}, "list_type": {"type": "text", "index": 14, "name": "list_type", "comment": "Type of list associated with the user"}, "list_created_at": {"type": "text", "index": 15, "name": "list_created_at", "comment": "Date the list was created"}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.iterable__list_user_history"}, "model.iterable.iterable__user_campaign": {"metadata": {"type": "BASE TABLE", "schema": "public_iterable_dev", "name": "iterable__user_campaign", "database": "postgres", "comment": "Table that provides total and unique metrics for a user associated with particular campaigns and if available, experiments.", "owner": "postgres"}, "columns": {"source_relation": {"type": "text", "index": 1, "name": "source_relation", "comment": "Identifies the record's source."}, "_fivetran_user_id": {"type": "text", "index": 2, "name": "_fivetran_user_id", "comment": "A Fivetran-created unique identifier for the new Iterable schema in Aug 2023, for users, derived from hashing user_id and/or email, depending on project type."}, "unique_user_key": {"type": "text", "index": 3, "name": "unique_user_key", "comment": "The unique identifier of the user. With the new schema (Aug 2023), it is the _fivetran_user_id. This is a hash of user_id and/or email, depending on project type. If using the old schema, it is email."}, "user_id": {"type": "text", "index": 4, "name": "user_id", "comment": "User identifier, for userID-based projects."}, "campaign_id": {"type": "text", "index": 5, "name": "campaign_id", "comment": "The unique identifier of the campaign which the user metrics are associated"}, "experiment_id": {"type": "integer", "index": 6, "name": "experiment_id", "comment": "The unique experiment variation of the campaign"}, "user_email": {"type": "text", "index": 7, "name": "user_email", "comment": "Email of the user if it exists."}, "user_full_name": {"type": "text", "index": 8, "name": "user_full_name", "comment": "The users first and last name"}, "campaign_name": {"type": "text", "index": 9, "name": "campaign_name", "comment": "The name of the campaign which the user metrics are associated"}, "template_id": {"type": "text", "index": 10, "name": "template_id", "comment": "The unique identifier of the template used within the campaign"}, "template_name": {"type": "text", "index": 11, "name": "template_name", "comment": "The name of the template used for the campaign"}, "recurring_campaign_id": {"type": "text", "index": 12, "name": "recurring_campaign_id", "comment": "The unique identifier of the recurring campaign which the campaign is tied to"}, "recurring_campaign_name": {"type": "text", "index": 13, "name": "recurring_campaign_name", "comment": "The name of the recurring campaign which the campaign is tied to"}, "first_event_at": {"type": "timestamp without time zone", "index": 14, "name": "first_event_at", "comment": "Timestamp of the first campaign/experiment event associated with the user"}, "last_event_at": {"type": "timestamp without time zone", "index": 15, "name": "last_event_at", "comment": "Timestamp of the most recent campaign/experiment event associated with the user"}, "first_open_or_click_event_at": {"type": "timestamp without time zone", "index": 16, "name": "first_open_or_click_event_at", "comment": "The time of the first open or click time. This is the first time a user interacts with a campaign, recording the earliest occurring event out of 'emailOpen', 'emailClick', and 'pushOpen'."}, "total_emailclick": {"type": "bigint", "index": 17, "name": "total_emailclick", "comment": "Total email clicks events the user took within the campaign/experiment"}, "total_emailunsubscribe": {"type": "bigint", "index": 18, "name": "total_emailunsubscribe", "comment": "Total email unsubscription events the user performed within the campaign/experiment"}, "total_emailcomplaint": {"type": "bigint", "index": 19, "name": "total_emailcomplaint", "comment": "Total email complaint events the user performed within the campaign/experiment"}, "total_customevent": {"type": "bigint", "index": 20, "name": "total_customevent", "comment": "Total custom events associated with the user within the campaign/experiment"}, "total_emailsubscribe": {"type": "bigint", "index": 21, "name": "total_emailsubscribe", "comment": "Total email subscription events associate with the user within the campaign/experiment"}, "total_emailopen": {"type": "bigint", "index": 22, "name": "total_emailopen", "comment": "Total email open events the user performed within the campaign/experiment"}, "total_pushsend": {"type": "bigint", "index": 23, "name": "total_pushsend", "comment": "Total push send events the user performed within the campaign/experiment"}, "total_smsbounce": {"type": "bigint", "index": 24, "name": "total_smsbounce", "comment": "Total sms bounce events associated with the user within the campaign/experiment"}, "total_pushbounce": {"type": "bigint", "index": 25, "name": "total_pushbounce", "comment": "Total push bounce events associated with the user within the campaign/experiment"}, "total_inappsendskip": {"type": "bigint", "index": 26, "name": "total_inappsendskip", "comment": "Total in app send skip events the user performed within the campaign/experiment"}, "total_smssend": {"type": "bigint", "index": 27, "name": "total_smssend", "comment": "Total sms send events associated with the user within the campaign/experiment"}, "total_inappsend": {"type": "bigint", "index": 28, "name": "total_inappsend", "comment": "Total in app send events associated with the user within the campaign/experiment"}, "total_pushopen": {"type": "bigint", "index": 29, "name": "total_pushopen", "comment": "Total push open events the user performed within the campaign/experiment"}, "total_emailsend": {"type": "bigint", "index": 30, "name": "total_emailsend", "comment": "Total email send event associated with the user within the campaign/experiment"}, "total_pushsendskip": {"type": "bigint", "index": 31, "name": "total_pushsendskip", "comment": "Total push send skip events associated with the user within the campaign/experiment"}, "total_inappopen": {"type": "bigint", "index": 32, "name": "total_inappopen", "comment": "Total in app open events associated with the user within the campaign/experiment"}, "total_emailsendskip": {"type": "bigint", "index": 33, "name": "total_emailsendskip", "comment": "Total email send skip events associated with the user within the campaign/experiment"}, "total_emailbounce": {"type": "bigint", "index": 34, "name": "total_emailbounce", "comment": "Total email bounce events associated with the user within the campaign/experiment"}, "total_inappclick": {"type": "bigint", "index": 35, "name": "total_inappclick", "comment": "Total in app click events associated with the user within the campaign/experiment"}, "total_pushuninstall": {"type": "bigint", "index": 36, "name": "total_pushuninstall", "comment": "Total push uninstall events associated with the user within the campaign/experiment"}, "unique_user_campaign_id": {"type": "text", "index": 37, "name": "unique_user_campaign_id", "comment": "Unique ID combining source_relation, unique_user_key, campaign_id, and if available, experiment_id."}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.iterable__user_campaign"}, "model.iterable.iterable__user_unsubscriptions": {"metadata": {"type": "BASE TABLE", "schema": "public_iterable_dev", "name": "iterable__user_unsubscriptions", "database": "postgres", "comment": "Table that generates the total channel and message types a user has chosen to unsubscribe.", "owner": "postgres"}, "columns": {"source_relation": {"type": "text", "index": 1, "name": "source_relation", "comment": "Identifies the record's source."}, "_fivetran_user_id": {"type": "text", "index": 2, "name": "_fivetran_user_id", "comment": "A Fivetran-created unique identifier for the new Iterable schema in Aug 2023, for users, derived from hashing user_id and/or email, depending on project type."}, "unique_user_key": {"type": "text", "index": 3, "name": "unique_user_key", "comment": "The unique identifier of the user. With the new schema (Aug 2023), it is the _fivetran_user_id. This is a hash of user_id and/or email, depending on project type. If using the old schema, it is email."}, "channel_id": {"type": "text", "index": 4, "name": "channel_id", "comment": "Unique identifier of the channel which the user is unsubscribed"}, "message_type_id": {"type": "text", "index": 5, "name": "message_type_id", "comment": "Unique identifier of the message type which the user is unsubscribed"}, "updated_at": {"type": "timestamp without time zone", "index": 6, "name": "updated_at", "comment": "Timestamp of when the user unsubscribed from the channel or message type"}, "channel_name": {"type": "text", "index": 7, "name": "channel_name", "comment": "The name of the channel which the user is unsubscribed"}, "message_type_name": {"type": "text", "index": 8, "name": "message_type_name", "comment": "The name of the message type which the user is unsubscribed"}, "channel_type": {"type": "text", "index": 9, "name": "channel_type", "comment": "The channel type which the user is unsubscribed"}, "message_medium": {"type": "text", "index": 10, "name": "message_medium", "comment": "The medium type the message was provided which the user is unsubscribed"}, "is_unsubscribed_channel_wide": {"type": "boolean", "index": 11, "name": "is_unsubscribed_channel_wide", "comment": "Boolean indicating if the user unsubscribed at the channel level (i.e. unsubscribed to all message types) or if they unsubscribed from only an individual message type.\n"}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.iterable__user_unsubscriptions"}, "model.iterable.iterable__users": {"metadata": {"type": "BASE TABLE", "schema": "public_iterable_dev", "name": "iterable__users", "database": "postgres", "comment": "Table that provides unique user enriched information.", "owner": "postgres"}, "columns": {"source_relation": {"type": "text", "index": 1, "name": "source_relation", "comment": "Identifies the record's source."}, "user_id": {"type": "text", "index": 2, "name": "user_id", "comment": "User identifier, for userID-based projects."}, "_fivetran_user_id": {"type": "text", "index": 3, "name": "_fivetran_user_id", "comment": "A Fivetran-created unique identifier for the new Iterable schema in Aug 2023, for users, derived from hashing user_id and/or email, depending on project type."}, "unique_user_key": {"type": "text", "index": 4, "name": "unique_user_key", "comment": "The unique identifier of the user. With the new schema (Aug 2023), it is the _fivetran_user_id. This is a hash of user_id and/or email, depending on project type. If using the old schema, it is email."}, "email": {"type": "text", "index": 5, "name": "email", "comment": "The user's email. User identifier, for email-based projects. Previously was the unique identifier for user records, for the old Iterable schema before the August 2023 updates."}, "first_name": {"type": "integer", "index": 6, "name": "first_name", "comment": "First name of the user"}, "last_name": {"type": "integer", "index": 7, "name": "last_name", "comment": "Last name of the user"}, "signup_date": {"type": "text", "index": 8, "name": "signup_date", "comment": "Timestamp of when the user signed up"}, "signup_source": {"type": "text", "index": 9, "name": "signup_source", "comment": "Source where the user signed up"}, "updated_at": {"type": "timestamp without time zone", "index": 10, "name": "updated_at", "comment": "Last update timestamp"}, "phone_number": {"type": "integer", "index": 11, "name": "phone_number", "comment": "Phone number associated with the user"}, "email_list_ids": {"type": "text", "index": 12, "name": "email_list_ids", "comment": "Array of all email lists associated with the user, derived from the list_user table relationships"}, "count_lists": {"type": "bigint", "index": 13, "name": "count_lists", "comment": "Total count of lists associated with the user"}, "count_total_campaigns": {"type": "bigint", "index": 14, "name": "count_total_campaigns", "comment": "Count of all campaigns the user has been in"}, "first_event_at": {"type": "timestamp without time zone", "index": 15, "name": "first_event_at", "comment": "The first event the user ever encountered"}, "last_event_at": {"type": "timestamp without time zone", "index": 16, "name": "last_event_at", "comment": "The most recent event the user has encountered"}, "total_emailclick": {"type": "numeric", "index": 17, "name": "total_emailclick", "comment": "Total number of email clicks the user has performed"}, "total_emailunsubscribe": {"type": "numeric", "index": 18, "name": "total_emailunsubscribe", "comment": "Total unsubscription events the user has performed"}, "total_emailcomplaint": {"type": "numeric", "index": 19, "name": "total_emailcomplaint", "comment": "Total email complaints the user has performed"}, "total_customevent": {"type": "numeric", "index": 20, "name": "total_customevent", "comment": "Total custom events associated with the user"}, "total_emailsubscribe": {"type": "numeric", "index": 21, "name": "total_emailsubscribe", "comment": "Total subscription events the user has performed"}, "total_emailopen": {"type": "numeric", "index": 22, "name": "total_emailopen", "comment": "Total email opened events the user has performed"}, "total_pushsend": {"type": "numeric", "index": 23, "name": "total_pushsend", "comment": "The push send events the user has experienced"}, "total_smsbounce": {"type": "numeric", "index": 24, "name": "total_smsbounce", "comment": "Total sms bounces that are associated with the user"}, "total_pushbounce": {"type": "numeric", "index": 25, "name": "total_pushbounce", "comment": "Total number of push bounces associated with the user"}, "total_inappsendskip": {"type": "numeric", "index": 26, "name": "total_inappsendskip", "comment": "Total in app send skips associated with the user"}, "total_smssend": {"type": "numeric", "index": 27, "name": "total_smssend", "comment": "Total sms sends that the user has experienced"}, "total_inappsend": {"type": "numeric", "index": 28, "name": "total_inappsend", "comment": "Total in app sends the user has experienced"}, "total_pushopen": {"type": "numeric", "index": 29, "name": "total_pushopen", "comment": "Total push messages the user has opened"}, "total_emailsend": {"type": "numeric", "index": 30, "name": "total_emailsend", "comment": "Total emails that have been sent to the user"}, "total_pushsendskip": {"type": "numeric", "index": 31, "name": "total_pushsendskip", "comment": "Total push sends the user has skipped"}, "total_inappopen": {"type": "numeric", "index": 32, "name": "total_inappopen", "comment": "Total in app opens the user has performed"}, "total_emailsendskip": {"type": "numeric", "index": 33, "name": "total_emailsendskip", "comment": "Total email sends the user has skipped"}, "total_emailbounce": {"type": "numeric", "index": 34, "name": "total_emailbounce", "comment": "Total number of emails that have bounced from the user"}, "total_inappclick": {"type": "numeric", "index": 35, "name": "total_inappclick", "comment": "Total in app clicks associated with the user"}, "total_pushuninstall": {"type": "numeric", "index": 36, "name": "total_pushuninstall", "comment": "Total push uninstall events the user has performed"}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.iterable__users"}, "model.iterable.stg_iterable__campaign_history": {"metadata": {"type": "BASE TABLE", "schema": "public_iterable_dev", "name": "stg_iterable__campaign_history", "database": "postgres", "comment": "Table containing a history of campaigns.", "owner": "postgres"}, "columns": {"source_relation": {"type": "text", "index": 1, "name": "source_relation", "comment": "Identifies the record's source."}, "campaign_id": {"type": "text", "index": 2, "name": "campaign_id", "comment": "Unique identifier of the campaign record"}, "updated_at": {"type": "text", "index": 3, "name": "updated_at", "comment": "Last update timestamp"}, "campaign_name": {"type": "text", "index": 4, "name": "campaign_name", "comment": "User defined name of the campaign."}, "campaign_state": {"type": "text", "index": 5, "name": "campaign_state", "comment": "State of the campaign. Can be Draft, Ready, Scheduled, Running, Finished, Starting, Aborted or Recurring"}, "campaign_type": {"type": "text", "index": 6, "name": "campaign_type", "comment": "The campaign type. Can be Blast or Triggered"}, "send_size": {"type": "integer", "index": 7, "name": "send_size", "comment": "Size of the campaign. Number of individuals included in the campaign"}, "start_at": {"type": "integer", "index": 8, "name": "start_at", "comment": "Start timestamp"}, "ended_at": {"type": "integer", "index": 9, "name": "ended_at", "comment": "Ended timestamp"}, "created_at": {"type": "text", "index": 10, "name": "created_at", "comment": "Creation timestamp"}, "message_medium": {"type": "text", "index": 11, "name": "message_medium", "comment": "The medium that this message was sent via, for example Email or InApp"}, "recurring_campaign_id": {"type": "text", "index": 12, "name": "recurring_campaign_id", "comment": "Reference to the recurring campaign, if applicable"}, "created_by_user_id": {"type": "text", "index": 13, "name": "created_by_user_id", "comment": "Reference to the user who created the campaign"}, "updated_by_user_id": {"type": "text", "index": 14, "name": "updated_by_user_id", "comment": "ID of the user who updated this record"}, "template_id": {"type": "text", "index": 15, "name": "template_id", "comment": "Reference to the campaign template"}, "workflow_id": {"type": "integer", "index": 16, "name": "workflow_id", "comment": "Reference to the workflow which the event originated"}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 17, "name": "_fivetran_synced", "comment": "The time when a record was last updated by Fivetran."}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.stg_iterable__campaign_history"}, "model.iterable.stg_iterable__campaign_history_tmp": {"metadata": {"type": "VIEW", "schema": "public_iterable_dev", "name": "stg_iterable__campaign_history_tmp", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"id": {"type": "integer", "index": 1, "name": "id", "comment": null}, "updated_at": {"type": "text", "index": 2, "name": "updated_at", "comment": null}, "template_id": {"type": "integer", "index": 3, "name": "template_id", "comment": null}, "recurring_campaign_id": {"type": "integer", "index": 4, "name": "recurring_campaign_id", "comment": null}, "campaign_state": {"type": "text", "index": 5, "name": "campaign_state", "comment": null}, "created_at": {"type": "text", "index": 6, "name": "created_at", "comment": null}, "created_by_user_id": {"type": "text", "index": 7, "name": "created_by_user_id", "comment": null}, "ended_at": {"type": "integer", "index": 8, "name": "ended_at", "comment": null}, "name": {"type": "text", "index": 9, "name": "name", "comment": null}, "send_size": {"type": "integer", "index": 10, "name": "send_size", "comment": null}, "start_at": {"type": "integer", "index": 11, "name": "start_at", "comment": null}, "type": {"type": "text", "index": 12, "name": "type", "comment": null}, "workflow_id": {"type": "integer", "index": 13, "name": "workflow_id", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 14, "name": "_fivetran_synced", "comment": null}, "updated_by_user_id": {"type": "integer", "index": 15, "name": "updated_by_user_id", "comment": null}, "message_medium": {"type": "text", "index": 16, "name": "message_medium", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.stg_iterable__campaign_history_tmp"}, "model.iterable.stg_iterable__campaign_label_history": {"metadata": {"type": "BASE TABLE", "schema": "public_iterable_dev", "name": "stg_iterable__campaign_label_history", "database": "postgres", "comment": "Table containing a history of labels.", "owner": "postgres"}, "columns": {"source_relation": {"type": "text", "index": 1, "name": "source_relation", "comment": "Identifies the record's source."}, "campaign_id": {"type": "text", "index": 2, "name": "campaign_id", "comment": "Reference to the campaign associated with the label"}, "label": {"type": "text", "index": 3, "name": "label", "comment": "Name of the label"}, "updated_at": {"type": "text", "index": 4, "name": "updated_at", "comment": "Last update timestamp"}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 5, "name": "_fivetran_synced", "comment": "The time when a record was last updated by Fivetran."}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.stg_iterable__campaign_label_history"}, "model.iterable.stg_iterable__campaign_label_history_tmp": {"metadata": {"type": "VIEW", "schema": "public_iterable_dev", "name": "stg_iterable__campaign_label_history_tmp", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"campaign_id": {"type": "integer", "index": 1, "name": "campaign_id", "comment": null}, "label": {"type": "text", "index": 2, "name": "label", "comment": null}, "updated_at": {"type": "text", "index": 3, "name": "updated_at", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 4, "name": "_fivetran_synced", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.stg_iterable__campaign_label_history_tmp"}, "model.iterable.stg_iterable__campaign_list_history": {"metadata": {"type": "BASE TABLE", "schema": "public_iterable_dev", "name": "stg_iterable__campaign_list_history", "database": "postgres", "comment": "Table containing a history of lists.", "owner": "postgres"}, "columns": {"source_relation": {"type": "text", "index": 1, "name": "source_relation", "comment": "Identifies the record's source."}, "campaign_id": {"type": "text", "index": 2, "name": "campaign_id", "comment": "Reference to the campaign associated with the label"}, "list_id": {"type": "text", "index": 3, "name": "list_id", "comment": "Reference to the list used"}, "updated_at": {"type": "text", "index": 4, "name": "updated_at", "comment": "Last update timestamp"}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 5, "name": "_fivetran_synced", "comment": "The time when a record was last updated by Fivetran."}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.stg_iterable__campaign_list_history"}, "model.iterable.stg_iterable__campaign_list_history_tmp": {"metadata": {"type": "VIEW", "schema": "public_iterable_dev", "name": "stg_iterable__campaign_list_history_tmp", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"list_id": {"type": "integer", "index": 1, "name": "list_id", "comment": null}, "campaign_id": {"type": "integer", "index": 2, "name": "campaign_id", "comment": null}, "updated_at": {"type": "text", "index": 3, "name": "updated_at", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 4, "name": "_fivetran_synced", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.stg_iterable__campaign_list_history_tmp"}, "model.iterable.stg_iterable__campaign_suppression_list_history": {"metadata": {"type": "BASE TABLE", "schema": "public_iterable_dev", "name": "stg_iterable__campaign_suppression_list_history", "database": "postgres", "comment": "Table containing a history of suppression lists.", "owner": "postgres"}, "columns": {"source_relation": {"type": "text", "index": 1, "name": "source_relation", "comment": "Identifies the record's source."}, "campaign_id": {"type": "text", "index": 2, "name": "campaign_id", "comment": "Reference to the campaign associated with the label"}, "suppressed_list_id": {"type": "text", "index": 3, "name": "suppressed_list_id", "comment": "Reference to the list used"}, "updated_at": {"type": "text", "index": 4, "name": "updated_at", "comment": "Last update timestamp"}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 5, "name": "_fivetran_synced", "comment": "The time when a record was last updated by Fivetran."}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.stg_iterable__campaign_suppression_list_history"}, "model.iterable.stg_iterable__campaign_suppression_list_history_tmp": {"metadata": {"type": "VIEW", "schema": "public_iterable_dev", "name": "stg_iterable__campaign_suppression_list_history_tmp", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"suppressed_list_id": {"type": "integer", "index": 1, "name": "suppressed_list_id", "comment": null}, "campaign_id": {"type": "integer", "index": 2, "name": "campaign_id", "comment": null}, "updated_at": {"type": "text", "index": 3, "name": "updated_at", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 4, "name": "_fivetran_synced", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.stg_iterable__campaign_suppression_list_history_tmp"}, "model.iterable.stg_iterable__channel": {"metadata": {"type": "BASE TABLE", "schema": "public_iterable_dev", "name": "stg_iterable__channel", "database": "postgres", "comment": "Table containing unique channels.", "owner": "postgres"}, "columns": {"source_relation": {"type": "text", "index": 1, "name": "source_relation", "comment": "Identifies the record's source."}, "channel_id": {"type": "text", "index": 2, "name": "channel_id", "comment": "Unique identifier of the channel"}, "channel_name": {"type": "text", "index": 3, "name": "channel_name", "comment": "User defined name of the channel"}, "channel_type": {"type": "text", "index": 4, "name": "channel_type", "comment": "The channel type"}, "message_medium": {"type": "text", "index": 5, "name": "message_medium", "comment": "The message medium associated with the channel"}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 6, "name": "_fivetran_synced", "comment": "The time when a record was last updated by Fivetran."}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.stg_iterable__channel"}, "model.iterable.stg_iterable__channel_tmp": {"metadata": {"type": "VIEW", "schema": "public_iterable_dev", "name": "stg_iterable__channel_tmp", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"id": {"type": "bigint", "index": 1, "name": "id", "comment": null}, "name": {"type": "text", "index": 2, "name": "name", "comment": null}, "channel_type": {"type": "text", "index": 3, "name": "channel_type", "comment": null}, "message_medium": {"type": "text", "index": 4, "name": "message_medium", "comment": null}, "_fivetran_deleted": {"type": "boolean", "index": 5, "name": "_fivetran_deleted", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 6, "name": "_fivetran_synced", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.stg_iterable__channel_tmp"}, "model.iterable.stg_iterable__event": {"metadata": {"type": "VIEW", "schema": "public_iterable_dev", "name": "stg_iterable__event", "database": "postgres", "comment": "Table containing individual events within campaigns.", "owner": "postgres"}, "columns": {"source_relation": {"type": "text", "index": 1, "name": "source_relation", "comment": "Identifies the record's source."}, "event_id": {"type": "text", "index": 2, "name": "event_id", "comment": "A Fivetran-created unique identifier derived from hashing campaign_id, created_at, and event_name."}, "unique_event_id": {"type": "text", "index": 3, "name": "unique_event_id", "comment": "A surrogate key made up of event_id, _fivetran_user_id, and source_relation."}, "_fivetran_user_id": {"type": "text", "index": 4, "name": "_fivetran_user_id", "comment": "A Fivetran-created unique identifier for users, derived from hashing user_id and/or email, depending on project type. This exists for users of the new schema starting Aug 2023. In the old schema, the unique identifier is email."}, "unique_user_key": {"type": "text", "index": 5, "name": "unique_user_key", "comment": "The unique identifier of the user. With the new schema (Aug 2023), it is the _fivetran_user_id. This is a hash of user_id and/or email, depending on project type. If using the old schema, it is email."}, "campaign_id": {"type": "text", "index": 6, "name": "campaign_id", "comment": "Reference to the campaign from which the event originated"}, "content_id": {"type": "text", "index": 7, "name": "content_id", "comment": "Reference to the content the event is associated with"}, "created_at": {"type": "timestamp without time zone", "index": 8, "name": "created_at", "comment": "Creation timestamp"}, "created_on": {"type": "date", "index": 9, "name": "created_on", "comment": "Creation date"}, "email": {"type": "text", "index": 10, "name": "email", "comment": "Reference to the unique user the event was applied to"}, "additional_properties": {"type": "text", "index": 11, "name": "additional_properties", "comment": "json object containing addition event properties"}, "event_name": {"type": "text", "index": 12, "name": "event_name", "comment": "Name provided to the individual event"}, "message_bus_id": {"type": "text", "index": 13, "name": "message_bus_id", "comment": "Reference to the message bus associated with the event"}, "message_id": {"type": "text", "index": 14, "name": "message_id", "comment": "Reference to the message the event is associated with"}, "message_type_id": {"type": "text", "index": 15, "name": "message_type_id", "comment": "Reference to the type of message the event is associated with"}, "recipient_state": {"type": "integer", "index": 16, "name": "recipient_state", "comment": "The state of the recipient upon receiving the event"}, "status": {"type": "integer", "index": 17, "name": "status", "comment": "Status of the event"}, "transactional_data": {"type": "character varying(100)", "index": 18, "name": "transactional_data", "comment": "Transactional data associated with the event"}, "unsub_source": {"type": "integer", "index": 19, "name": "unsub_source", "comment": "Source of the unsubscribe event"}, "user_agent": {"type": "integer", "index": 20, "name": "user_agent", "comment": "User agent associated with the event"}, "user_agent_device": {"type": "integer", "index": 21, "name": "user_agent_device", "comment": "The device of the user agent"}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 22, "name": "_fivetran_synced", "comment": "The time when a record was last updated by Fivetran."}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.stg_iterable__event"}, "model.iterable.stg_iterable__event_extension": {"metadata": {"type": "VIEW", "schema": "public_iterable_dev", "name": "stg_iterable__event_extension", "database": "postgres", "comment": "Table containing addition properties from the event table.", "owner": "postgres"}, "columns": {"source_relation": {"type": "text", "index": 1, "name": "source_relation", "comment": "Identifies the record's source."}, "event_id": {"type": "text", "index": 2, "name": "event_id", "comment": "A Fivetran-created unique identifier derived from hashing campaign_id, created_at, and event_name."}, "unique_event_id": {"type": "text", "index": 3, "name": "unique_event_id", "comment": "A surrogate key made up of event_id, _fivetran_user_id, and source_relation."}, "is_app_already_running": {"type": "integer", "index": 4, "name": "is_app_already_running", "comment": "Boolean indicating if the app is currently running or not"}, "badge": {"type": "integer", "index": 5, "name": "badge", "comment": "Badge associated with the event"}, "catalog_collection_count": {"type": "integer", "index": 6, "name": "catalog_collection_count", "comment": "The count of products or items collected in a catalog associated with the event."}, "catalog_lookup_count": {"type": "integer", "index": 7, "name": "catalog_lookup_count", "comment": "The count of times a catalog was looked up or queried during the event."}, "canonical_url_id": {"type": "text", "index": 8, "name": "canonical_url_id", "comment": "Reference to the url associated with the event"}, "is_content_available": {"type": "integer", "index": 9, "name": "is_content_available", "comment": "Content available from the event"}, "content_id": {"type": "text", "index": 10, "name": "content_id", "comment": "Reference to the content associated with the event"}, "device": {"type": "integer", "index": 11, "name": "device", "comment": "The device associated with the event"}, "email_id": {"type": "text", "index": 12, "name": "email_id", "comment": "Reference to the email associated with the event"}, "email_subject": {"type": "text", "index": 13, "name": "email_subject", "comment": "Subject of the email associated with the event"}, "experiment_id": {"type": "integer", "index": 14, "name": "experiment_id", "comment": "Reference to the experiment used if the event is an experiment"}, "from_phone_number_id": {"type": "integer", "index": 15, "name": "from_phone_number_id", "comment": "Reference to the phone number which the event is from"}, "from_smssender_id": {"type": "integer", "index": 16, "name": "from_smssender_id", "comment": "Reference to the sms sender which the event is from"}, "link_id": {"type": "text", "index": 17, "name": "link_id", "comment": "Reference to the link associated with the event"}, "link_url": {"type": "integer", "index": 18, "name": "link_url", "comment": "Url of the link associated with the event"}, "locale": {"type": "integer", "index": 19, "name": "locale", "comment": "Locale associated with the event"}, "payload": {"type": "character varying(100)", "index": 20, "name": "payload", "comment": "Payload resulted from the event"}, "platform_endpoint": {"type": "integer", "index": 21, "name": "platform_endpoint", "comment": "The specific platform endpoint of the event"}, "push_message": {"type": "integer", "index": 22, "name": "push_message", "comment": "Boolean indicating if the event is a push message"}, "region": {"type": "text", "index": 23, "name": "region", "comment": "Region of the event"}, "sms_message": {"type": "integer", "index": 24, "name": "sms_message", "comment": "Boolean indicating if the event is an sms message"}, "to_phone_number": {"type": "integer", "index": 25, "name": "to_phone_number", "comment": "To phone number associated with the event"}, "url": {"type": "integer", "index": 26, "name": "url", "comment": "Url associated with the event"}, "workflow_id": {"type": "text", "index": 27, "name": "workflow_id", "comment": "Reference to the workflow which the event originated"}, "workflow_name": {"type": "text", "index": 28, "name": "workflow_name", "comment": "Name of the workflow which the event originated"}, "city": {"type": "text", "index": 29, "name": "city", "comment": "The city associated with the event, which could be the location of the recipient."}, "clicked_url": {"type": "text", "index": 30, "name": "clicked_url", "comment": "The URL that was clicked by the recipient in response to the marketing message."}, "country": {"type": "text", "index": 31, "name": "country", "comment": "The country associated with the event, which could be the location of the recipient."}, "error_code": {"type": "integer", "index": 32, "name": "error_code", "comment": "The error code or message indicating any issues or errors encountered during the event."}, "expires_at": {"type": "text", "index": 33, "name": "expires_at", "comment": "The date and time when the event or message is set to expire or become invalid."}, "from_phone_number": {"type": "integer", "index": 34, "name": "from_phone_number", "comment": "The phone number from which the SMS message was sent."}, "in_app_body": {"type": "text", "index": 35, "name": "in_app_body", "comment": "The content or body of an in-app message that was sent as part of the event."}, "is_sms_estimation": {"type": "boolean", "index": 36, "name": "is_sms_estimation", "comment": "A boolean indicating whether the SMS message is an estimation or not."}, "labels": {"type": "text", "index": 37, "name": "labels", "comment": "Any labels or tags associated with the event, which can be used for categorization or organization."}, "message_status": {"type": "text", "index": 38, "name": "message_status", "comment": "The status of the marketing message, such as sent, delivered, opened, etc."}, "mms_send_count": {"type": "integer", "index": 39, "name": "mms_send_count", "comment": "The count of multimedia messages (MMS) sent as part of the event."}, "reason": {"type": "text", "index": 40, "name": "reason", "comment": "The reason or cause associated with a specific event or action."}, "sms_send_count": {"type": "integer", "index": 41, "name": "sms_send_count", "comment": "The count of SMS messages sent as part of the event."}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 42, "name": "_fivetran_synced", "comment": "The time when a record was last updated by Fivetran."}, "_fivetran_user_id": {"type": "text", "index": 43, "name": "_fivetran_user_id", "comment": "A Fivetran-created unique identifier for users, derived from hashing user_id and/or email, depending on project type. This exists for users of the new schema starting Aug 2023. In the old schema, the unique identifier is email."}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.stg_iterable__event_extension"}, "model.iterable.stg_iterable__event_extension_tmp": {"metadata": {"type": "VIEW", "schema": "public_iterable_dev", "name": "stg_iterable__event_extension_tmp", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"_fivetran_id": {"type": "text", "index": 1, "name": "_fivetran_id", "comment": null}, "app_already_running": {"type": "integer", "index": 2, "name": "app_already_running", "comment": null}, "badge": {"type": "integer", "index": 3, "name": "badge", "comment": null}, "canonical_url_id": {"type": "integer", "index": 4, "name": "canonical_url_id", "comment": null}, "content_available": {"type": "integer", "index": 5, "name": "content_available", "comment": null}, "content_id": {"type": "integer", "index": 6, "name": "content_id", "comment": null}, "device": {"type": "integer", "index": 7, "name": "device", "comment": null}, "email_id": {"type": "text", "index": 8, "name": "email_id", "comment": null}, "email_subject": {"type": "text", "index": 9, "name": "email_subject", "comment": null}, "experiment_id": {"type": "integer", "index": 10, "name": "experiment_id", "comment": null}, "from_phone_number_id": {"type": "integer", "index": 11, "name": "from_phone_number_id", "comment": null}, "from_smssender_id": {"type": "integer", "index": 12, "name": "from_smssender_id", "comment": null}, "image_url": {"type": "integer", "index": 13, "name": "image_url", "comment": null}, "is_ghost_push": {"type": "integer", "index": 14, "name": "is_ghost_push", "comment": null}, "link_id": {"type": "integer", "index": 15, "name": "link_id", "comment": null}, "link_url": {"type": "integer", "index": 16, "name": "link_url", "comment": null}, "platform_endpoint": {"type": "integer", "index": 17, "name": "platform_endpoint", "comment": null}, "push_message": {"type": "integer", "index": 18, "name": "push_message", "comment": null}, "region": {"type": "text", "index": 19, "name": "region", "comment": null}, "sms_message": {"type": "integer", "index": 20, "name": "sms_message", "comment": null}, "sound": {"type": "integer", "index": 21, "name": "sound", "comment": null}, "to_phone_number": {"type": "integer", "index": 22, "name": "to_phone_number", "comment": null}, "url": {"type": "integer", "index": 23, "name": "url", "comment": null}, "workflow_id": {"type": "integer", "index": 24, "name": "workflow_id", "comment": null}, "workflow_name": {"type": "text", "index": 25, "name": "workflow_name", "comment": null}, "locale": {"type": "integer", "index": 26, "name": "locale", "comment": null}, "deeplink_android": {"type": "integer", "index": 27, "name": "deeplink_android", "comment": null}, "deeplink_ios": {"type": "integer", "index": 28, "name": "deeplink_ios", "comment": null}, "payload": {"type": "character varying(100)", "index": 29, "name": "payload", "comment": null}, "sms_provider_response_status": {"type": "integer", "index": 30, "name": "sms_provider_response_status", "comment": null}, "sms_provider_response_message": {"type": "integer", "index": 31, "name": "sms_provider_response_message", "comment": null}, "sms_provider_response_code": {"type": "integer", "index": 32, "name": "sms_provider_response_code", "comment": null}, "sms_provider_response_more_info": {"type": "integer", "index": 33, "name": "sms_provider_response_more_info", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 34, "name": "_fivetran_synced", "comment": null}, "catalog_collection_count": {"type": "integer", "index": 35, "name": "catalog_collection_count", "comment": null}, "catalog_lookup_count": {"type": "integer", "index": 36, "name": "catalog_lookup_count", "comment": null}, "city": {"type": "text", "index": 37, "name": "city", "comment": null}, "clicked_url": {"type": "text", "index": 38, "name": "clicked_url", "comment": null}, "country": {"type": "text", "index": 39, "name": "country", "comment": null}, "error_code": {"type": "integer", "index": 40, "name": "error_code", "comment": null}, "expires_at": {"type": "text", "index": 41, "name": "expires_at", "comment": null}, "from_phone_number": {"type": "integer", "index": 42, "name": "from_phone_number", "comment": null}, "in_app_body": {"type": "text", "index": 43, "name": "in_app_body", "comment": null}, "is_sms_estimation": {"type": "boolean", "index": 44, "name": "is_sms_estimation", "comment": null}, "labels": {"type": "text", "index": 45, "name": "labels", "comment": null}, "message_context": {"type": "text", "index": 46, "name": "message_context", "comment": null}, "message_status": {"type": "text", "index": 47, "name": "message_status", "comment": null}, "mms_send_count": {"type": "integer", "index": 48, "name": "mms_send_count", "comment": null}, "product_recommendation_count": {"type": "integer", "index": 49, "name": "product_recommendation_count", "comment": null}, "proxy_source": {"type": "text", "index": 50, "name": "proxy_source", "comment": null}, "reason": {"type": "text", "index": 51, "name": "reason", "comment": null}, "sms_send_count": {"type": "integer", "index": 52, "name": "sms_send_count", "comment": null}, "web_push_body": {"type": "text", "index": 53, "name": "web_push_body", "comment": null}, "web_push_click_action": {"type": "text", "index": 54, "name": "web_push_click_action", "comment": null}, "web_push_icon": {"type": "text", "index": 55, "name": "web_push_icon", "comment": null}, "web_push_message": {"type": "text", "index": 56, "name": "web_push_message", "comment": null}, "_fivetran_user_id": {"type": "integer", "index": 57, "name": "_fivetran_user_id", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.stg_iterable__event_extension_tmp"}, "model.iterable.stg_iterable__event_tmp": {"metadata": {"type": "VIEW", "schema": "public_iterable_dev", "name": "stg_iterable__event_tmp", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"_fivetran_id": {"type": "text", "index": 1, "name": "_fivetran_id", "comment": null}, "email": {"type": "text", "index": 2, "name": "email", "comment": null}, "campaign_id": {"type": "integer", "index": 3, "name": "campaign_id", "comment": null}, "message_id": {"type": "integer", "index": 4, "name": "message_id", "comment": null}, "content_id": {"type": "integer", "index": 5, "name": "content_id", "comment": null}, "created_at": {"type": "timestamp without time zone", "index": 6, "name": "created_at", "comment": null}, "event_name": {"type": "text", "index": 7, "name": "event_name", "comment": null}, "ip": {"type": "integer", "index": 8, "name": "ip", "comment": null}, "message_bus_id": {"type": "integer", "index": 9, "name": "message_bus_id", "comment": null}, "message_type_id": {"type": "integer", "index": 10, "name": "message_type_id", "comment": null}, "recipient_state": {"type": "integer", "index": 11, "name": "recipient_state", "comment": null}, "status": {"type": "integer", "index": 12, "name": "status", "comment": null}, "unsub_source": {"type": "integer", "index": 13, "name": "unsub_source", "comment": null}, "user_agent": {"type": "integer", "index": 14, "name": "user_agent", "comment": null}, "user_agent_device": {"type": "integer", "index": 15, "name": "user_agent_device", "comment": null}, "transactional_data": {"type": "character varying(100)", "index": 16, "name": "transactional_data", "comment": null}, "additional_properties": {"type": "text", "index": 17, "name": "additional_properties", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 18, "name": "_fivetran_synced", "comment": null}, "_fivetran_user_id": {"type": "integer", "index": 19, "name": "_fivetran_user_id", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.stg_iterable__event_tmp"}, "model.iterable.stg_iterable__journey": {"metadata": {"type": "BASE TABLE", "schema": "public_iterable_dev", "name": "stg_iterable__journey", "database": "postgres", "comment": "Table containing unique journeys, formerly known as workflows.", "owner": "postgres"}, "columns": {"source_relation": {"type": "text", "index": 1, "name": "source_relation", "comment": "Identifies the record's source."}, "journey_id": {"type": "text", "index": 2, "name": "journey_id", "comment": "Unique identifier of the journey"}, "journey_name": {"type": "text", "index": 3, "name": "journey_name", "comment": "User defined name of the journey"}, "journey_type": {"type": "text", "index": 4, "name": "journey_type", "comment": "The journey type"}, "journey_description": {"type": "text", "index": 5, "name": "journey_description", "comment": "Information about the journey"}, "creator_user_id": {"type": "text", "index": 6, "name": "creator_user_id", "comment": "Reference to the user who created the journey"}, "is_enabled": {"type": "boolean", "index": 7, "name": "is_enabled", "comment": "Boolean indicating if the journey is currently enabled"}, "is_archived": {"type": "boolean", "index": 8, "name": "is_archived", "comment": "Boolean indicating if the journey has been archived"}, "lifetime_limit": {"type": "bigint", "index": 9, "name": "lifetime_limit", "comment": "Maximum number of times a user may enter the journey over their lifetime"}, "simultaneous_limit": {"type": "bigint", "index": 10, "name": "simultaneous_limit", "comment": "Maximum number of times a user may be in the journey at the same time"}, "start_tile_id": {"type": "text", "index": 11, "name": "start_tile_id", "comment": "Reference to the tile which begins the journey"}, "trigger_event_names": {"type": "text", "index": 12, "name": "trigger_event_names", "comment": "The event names which trigger a user's entry into the journey"}, "created_at": {"type": "timestamp without time zone", "index": 13, "name": "created_at", "comment": "Creation timestamp"}, "updated_at": {"type": "timestamp without time zone", "index": 14, "name": "updated_at", "comment": "Last update timestamp"}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 15, "name": "_fivetran_synced", "comment": "The time when a record was last updated by Fivetran."}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.stg_iterable__journey"}, "model.iterable.stg_iterable__journey_tmp": {"metadata": {"type": "VIEW", "schema": "public_iterable_dev", "name": "stg_iterable__journey_tmp", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"id": {"type": "bigint", "index": 1, "name": "id", "comment": null}, "name": {"type": "text", "index": 2, "name": "name", "comment": null}, "journey_type": {"type": "text", "index": 3, "name": "journey_type", "comment": null}, "description": {"type": "text", "index": 4, "name": "description", "comment": null}, "creator_user_id": {"type": "text", "index": 5, "name": "creator_user_id", "comment": null}, "enabled": {"type": "boolean", "index": 6, "name": "enabled", "comment": null}, "is_archived": {"type": "boolean", "index": 7, "name": "is_archived", "comment": null}, "lifetime_limit": {"type": "bigint", "index": 8, "name": "lifetime_limit", "comment": null}, "simultaneous_limit": {"type": "bigint", "index": 9, "name": "simultaneous_limit", "comment": null}, "start_tile_id": {"type": "bigint", "index": 10, "name": "start_tile_id", "comment": null}, "trigger_event_names": {"type": "text", "index": 11, "name": "trigger_event_names", "comment": null}, "created_at": {"type": "timestamp without time zone", "index": 12, "name": "created_at", "comment": null}, "updated_at": {"type": "timestamp without time zone", "index": 13, "name": "updated_at", "comment": null}, "_fivetran_deleted": {"type": "boolean", "index": 14, "name": "_fivetran_deleted", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 15, "name": "_fivetran_synced", "comment": null}, "draft_name": {"type": "text", "index": 16, "name": "draft_name", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.stg_iterable__journey_tmp"}, "model.iterable.stg_iterable__list": {"metadata": {"type": "BASE TABLE", "schema": "public_iterable_dev", "name": "stg_iterable__list", "database": "postgres", "comment": "Table containing users and the lists the users are associated with.", "owner": "postgres"}, "columns": {"source_relation": {"type": "text", "index": 1, "name": "source_relation", "comment": "Identifies the record's source."}, "list_id": {"type": "integer", "index": 2, "name": "list_id", "comment": "Unique identifier of the list"}, "list_name": {"type": "text", "index": 3, "name": "list_name", "comment": "User defined name of the list"}, "list_type": {"type": "text", "index": 4, "name": "list_type", "comment": "The list type"}, "created_at": {"type": "text", "index": 5, "name": "created_at", "comment": "Creation timestamp"}, "list_description": {"type": "text", "index": 6, "name": "list_description", "comment": "Information about the list"}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 7, "name": "_fivetran_synced", "comment": "The time when a record was last updated by Fivetran."}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.stg_iterable__list"}, "model.iterable.stg_iterable__list_tmp": {"metadata": {"type": "VIEW", "schema": "public_iterable_dev", "name": "stg_iterable__list_tmp", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"id": {"type": "integer", "index": 1, "name": "id", "comment": null}, "name": {"type": "text", "index": 2, "name": "name", "comment": null}, "created_at": {"type": "text", "index": 3, "name": "created_at", "comment": null}, "list_type": {"type": "text", "index": 4, "name": "list_type", "comment": null}, "_fivetran_deleted": {"type": "boolean", "index": 5, "name": "_fivetran_deleted", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 6, "name": "_fivetran_synced", "comment": null}, "description": {"type": "text", "index": 7, "name": "description", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.stg_iterable__list_tmp"}, "model.iterable.stg_iterable__list_user": {"metadata": {"type": "BASE TABLE", "schema": "public_iterable_dev", "name": "stg_iterable__list_user", "database": "postgres", "comment": "Table containing the relationship between users and lists they belong to.", "owner": "postgres"}, "columns": {"source_relation": {"type": "text", "index": 1, "name": "source_relation", "comment": "Identifies the record's source."}, "_fivetran_user_id": {"type": "text", "index": 2, "name": "_fivetran_user_id", "comment": "Unique identifier of the list-user relationship record, serving as a foreign key to `stg_iterable__user_history._fivetran_id`."}, "list_user_index": {"type": "bigint", "index": 3, "name": "list_user_index", "comment": "Index of the record"}, "list_id": {"type": "bigint", "index": 4, "name": "list_id", "comment": "Reference to the list that the user belongs to"}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 5, "name": "_fivetran_synced", "comment": "The time when a record was last updated by Fivetran."}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.stg_iterable__list_user"}, "model.iterable.stg_iterable__list_user_tmp": {"metadata": {"type": "VIEW", "schema": "public_iterable_dev", "name": "stg_iterable__list_user_tmp", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"_fivetran_id": {"type": "text", "index": 1, "name": "_fivetran_id", "comment": null}, "index": {"type": "bigint", "index": 2, "name": "index", "comment": null}, "list_id": {"type": "bigint", "index": 3, "name": "list_id", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 4, "name": "_fivetran_synced", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.stg_iterable__list_user_tmp"}, "model.iterable.stg_iterable__message_type": {"metadata": {"type": "BASE TABLE", "schema": "public_iterable_dev", "name": "stg_iterable__message_type", "database": "postgres", "comment": "Table containing unique message types.", "owner": "postgres"}, "columns": {"source_relation": {"type": "text", "index": 1, "name": "source_relation", "comment": "Identifies the record's source."}, "message_type_id": {"type": "text", "index": 2, "name": "message_type_id", "comment": "Unique identifier of the message type"}, "message_type_name": {"type": "text", "index": 3, "name": "message_type_name", "comment": "User defined name of the message type"}, "channel_id": {"type": "text", "index": 4, "name": "channel_id", "comment": "Channel that this message type belongs to"}, "message_type_created_at": {"type": "timestamp without time zone", "index": 5, "name": "message_type_created_at", "comment": "Time when the message type was initially created"}, "frequency_cap": {"type": "integer", "index": 6, "name": "frequency_cap", "comment": "The maximum number of times a message of this type can be sent to a recipient within a specified time period to prevent over-messaging"}, "rate_limit_per_minute": {"type": "integer", "index": 7, "name": "rate_limit_per_minute", "comment": "The maximum number of messages of this type that can be sent to recipients in a minute, ensuring controlled message delivery"}, "subscription_policy": {"type": "text", "index": 8, "name": "subscription_policy", "comment": "Information about the policy or rules governing how users can subscribe to or unsubscribe from this specific message type, like OptOut"}, "message_type_updated_at": {"type": "timestamp without time zone", "index": 9, "name": "message_type_updated_at", "comment": "Time when the message type was last updated or modified"}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 10, "name": "_fivetran_synced", "comment": "The time when a record was last updated by Fivetran."}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.stg_iterable__message_type"}, "model.iterable.stg_iterable__message_type_tmp": {"metadata": {"type": "VIEW", "schema": "public_iterable_dev", "name": "stg_iterable__message_type_tmp", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"id": {"type": "bigint", "index": 1, "name": "id", "comment": null}, "name": {"type": "text", "index": 2, "name": "name", "comment": null}, "channel_id": {"type": "bigint", "index": 3, "name": "channel_id", "comment": null}, "_fivetran_deleted": {"type": "boolean", "index": 4, "name": "_fivetran_deleted", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 5, "name": "_fivetran_synced", "comment": null}, "created_at": {"type": "timestamp without time zone", "index": 6, "name": "created_at", "comment": null}, "frequency_cap": {"type": "integer", "index": 7, "name": "frequency_cap", "comment": null}, "rate_limit_per_minute": {"type": "integer", "index": 8, "name": "rate_limit_per_minute", "comment": null}, "subscription_policy": {"type": "text", "index": 9, "name": "subscription_policy", "comment": null}, "updated_at": {"type": "timestamp without time zone", "index": 10, "name": "updated_at", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.stg_iterable__message_type_tmp"}, "model.iterable.stg_iterable__template_history": {"metadata": {"type": "BASE TABLE", "schema": "public_iterable_dev", "name": "stg_iterable__template_history", "database": "postgres", "comment": "Table containing unique templates used across campaigns.", "owner": "postgres"}, "columns": {"source_relation": {"type": "text", "index": 1, "name": "source_relation", "comment": "Identifies the record's source."}, "template_id": {"type": "text", "index": 2, "name": "template_id", "comment": "Unique identifier of the template"}, "template_name": {"type": "text", "index": 3, "name": "template_name", "comment": "User defined name of the template"}, "template_type": {"type": "text", "index": 4, "name": "template_type", "comment": "The type of the template"}, "created_at": {"type": "text", "index": 5, "name": "created_at", "comment": "Creation timestamp"}, "client_template_id": {"type": "text", "index": 6, "name": "client_template_id", "comment": "Reference to the client template"}, "creator_user_id": {"type": "text", "index": 7, "name": "creator_user_id", "comment": "Reference to the user who created the template"}, "message_type_id": {"type": "text", "index": 8, "name": "message_type_id", "comment": "Reference to the message type associated with the template"}, "updated_at": {"type": "text", "index": 9, "name": "updated_at", "comment": "Last update timestamp"}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 10, "name": "_fivetran_synced", "comment": "The time when a record was last updated by Fivetran."}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.stg_iterable__template_history"}, "model.iterable.stg_iterable__template_history_tmp": {"metadata": {"type": "VIEW", "schema": "public_iterable_dev", "name": "stg_iterable__template_history_tmp", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"id": {"type": "integer", "index": 1, "name": "id", "comment": null}, "updated_at": {"type": "text", "index": 2, "name": "updated_at", "comment": null}, "message_type_id": {"type": "integer", "index": 3, "name": "message_type_id", "comment": null}, "client_template_id": {"type": "integer", "index": 4, "name": "client_template_id", "comment": null}, "created_at": {"type": "text", "index": 5, "name": "created_at", "comment": null}, "creator_user_id": {"type": "text", "index": 6, "name": "creator_user_id", "comment": null}, "name": {"type": "text", "index": 7, "name": "name", "comment": null}, "template_type": {"type": "text", "index": 8, "name": "template_type", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 9, "name": "_fivetran_synced", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.stg_iterable__template_history_tmp"}, "model.iterable.stg_iterable__user_history": {"metadata": {"type": "VIEW", "schema": "public_iterable_dev", "name": "stg_iterable__user_history", "database": "postgres", "comment": "Table containing individual user history information.", "owner": "postgres"}, "columns": {"source_relation": {"type": "text", "index": 1, "name": "source_relation", "comment": "Identifies the record's source."}, "_fivetran_user_id": {"type": "text", "index": 2, "name": "_fivetran_user_id", "comment": "A Fivetran-created unique identifier for users, derived from hashing user_id and/or email, depending on project type. This exists for users of the new schema starting Aug 2023. In the old schema, the unique identifier is email."}, "email": {"type": "text", "index": 3, "name": "email", "comment": "The user's email. User identifier, for email-based projects. Previously was the unique identifier for user records, for the old Iterable schema before the August 2023 updates."}, "updated_at": {"type": "timestamp without time zone", "index": 4, "name": "updated_at", "comment": "Last update timestamp"}, "user_id": {"type": "text", "index": 5, "name": "user_id", "comment": "User identifier, for userID-based projects."}, "first_name": {"type": "integer", "index": 6, "name": "first_name", "comment": "First name of the user"}, "last_name": {"type": "integer", "index": 7, "name": "last_name", "comment": "Last name of the user"}, "email_list_ids": {"type": "text", "index": 8, "name": "email_list_ids", "comment": "[DEPRECATED October 13, 2025. Use LIST_USER source instead.] Array of references to the lists associated with the user.\n"}, "phone_number": {"type": "integer", "index": 9, "name": "phone_number", "comment": "Phone number associated with the user"}, "signup_date": {"type": "text", "index": 10, "name": "signup_date", "comment": "Timestamp of when the user signed up"}, "signup_source": {"type": "text", "index": 11, "name": "signup_source", "comment": "Source where the user signed up"}, "iterable_user_id": {"type": "text", "index": 12, "name": "iterable_user_id", "comment": "Another user identifier, for userID-based projects"}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 13, "name": "_fivetran_synced", "comment": "The time when a record was last updated by Fivetran."}, "unique_user_key": {"type": "text", "index": 14, "name": "unique_user_key", "comment": "The unique identifier of the user. With the new schema (Aug 2023), it is the _fivetran_user_id. This is a hash of user_id and/or email, depending on project type. If using the old schema, it is email."}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.stg_iterable__user_history"}, "model.iterable.stg_iterable__user_history_tmp": {"metadata": {"type": "VIEW", "schema": "public_iterable_dev", "name": "stg_iterable__user_history_tmp", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"email": {"type": "text", "index": 1, "name": "email", "comment": null}, "updated_at": {"type": "timestamp without time zone", "index": 2, "name": "updated_at", "comment": null}, "first_name": {"type": "integer", "index": 3, "name": "first_name", "comment": null}, "last_name": {"type": "integer", "index": 4, "name": "last_name", "comment": null}, "phone_number": {"type": "integer", "index": 5, "name": "phone_number", "comment": null}, "user_id": {"type": "integer", "index": 6, "name": "user_id", "comment": null}, "signup_date": {"type": "text", "index": 7, "name": "signup_date", "comment": null}, "signup_source": {"type": "text", "index": 8, "name": "signup_source", "comment": null}, "phone_number_carrier": {"type": "integer", "index": 9, "name": "phone_number_carrier", "comment": null}, "phone_number_country_code_iso": {"type": "integer", "index": 10, "name": "phone_number_country_code_iso", "comment": null}, "phone_number_line_type": {"type": "integer", "index": 11, "name": "phone_number_line_type", "comment": null}, "phone_number_updated_at": {"type": "integer", "index": 12, "name": "phone_number_updated_at", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 13, "name": "_fivetran_synced", "comment": null}, "email_list_ids": {"type": "text", "index": 14, "name": "email_list_ids", "comment": null}, "iterable_user_id": {"type": "integer", "index": 15, "name": "iterable_user_id", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.stg_iterable__user_history_tmp"}, "model.iterable.stg_iterable__user_unsub_message_type": {"metadata": {"type": "BASE TABLE", "schema": "public_iterable_dev", "name": "stg_iterable__user_unsub_message_type", "database": "postgres", "comment": "Table containing the message types from which a user has unsubscribed. \"Unsubscribed\" is shortened to \"unsub\" for postgres compatibility.", "owner": "postgres"}, "columns": {"source_relation": {"type": "text", "index": 1, "name": "source_relation", "comment": "Identifies the record's source."}, "_fivetran_user_id": {"type": "text", "index": 2, "name": "_fivetran_user_id", "comment": "A Fivetran-created unique identifier for users, derived from hashing user_id and/or email, depending on project type. This exists for users of the new schema starting Aug 2023. In the old schema, the unique identifier is email."}, "unique_user_key": {"type": "text", "index": 3, "name": "unique_user_key", "comment": "The unique identifier of the user. With the new schema (Aug 2023), it is the _fivetran_user_id. This is a hash of user_id and/or email, depending on project type. If using the old schema, it is email."}, "message_type_id": {"type": "text", "index": 4, "name": "message_type_id", "comment": "Reference to the message type from which the user unsubscribed"}, "unsub_message_type_unique_key": {"type": "text", "index": 5, "name": "unsub_message_type_unique_key", "comment": "A surrogate key providing a unique key for each record. If using user_unsubscribed_message_type_history, it uses '_fivetran_id', 'email', 'message_type_id', 'updated_at', and 'source_relation'. If not using the history table, it uses '_fivetran_id', 'message_type_id', and 'source_relation'."}, "latest_batch_index": {"type": "integer", "index": 6, "name": "latest_batch_index", "comment": "Indexes each user record based on the most recent available."}, "updated_at": {"type": "timestamp without time zone", "index": 7, "name": "updated_at", "comment": "Last update timestamp"}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 8, "name": "_fivetran_synced", "comment": "The time when a record was last updated by Fivetran."}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.stg_iterable__user_unsub_message_type"}, "model.iterable.stg_iterable__user_unsub_message_type_tmp": {"metadata": {"type": "VIEW", "schema": "public_iterable_dev", "name": "stg_iterable__user_unsub_message_type_tmp", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"_fivetran_id": {"type": "text", "index": 1, "name": "_fivetran_id", "comment": null}, "message_type_id": {"type": "integer", "index": 2, "name": "message_type_id", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 3, "name": "_fivetran_synced", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.stg_iterable__user_unsub_message_type_tmp"}, "model.iterable.stg_iterable__user_unsubscribed_channel": {"metadata": {"type": "BASE TABLE", "schema": "public_iterable_dev", "name": "stg_iterable__user_unsubscribed_channel", "database": "postgres", "comment": "Table containing the history of channels from which a user has unsubscribed.", "owner": "postgres"}, "columns": {"source_relation": {"type": "text", "index": 1, "name": "source_relation", "comment": "Identifies the record's source."}, "_fivetran_user_id": {"type": "text", "index": 2, "name": "_fivetran_user_id", "comment": "A Fivetran-created unique identifier for users, derived from hashing user_id and/or email, depending on project type. This exists for users of the new schema starting Aug 2023. In the old schema, the unique identifier is email."}, "unique_user_key": {"type": "text", "index": 3, "name": "unique_user_key", "comment": "The unique identifier of the user. With the new schema (Aug 2023), it is the _fivetran_user_id. This is a hash of user_id and/or email, depending on project type. If using the old schema, it is email."}, "channel_id": {"type": "text", "index": 4, "name": "channel_id", "comment": "Reference to the channel from which the user unsubscribed"}, "unsub_channel_unique_key": {"type": "text", "index": 5, "name": "unsub_channel_unique_key", "comment": "A surrogate key providing a unique key for each record. If using user_unsubscribed_channel_history, it uses '_fivetran_id', 'channel_id', 'email', 'updated_at', and 'source_relation'. If not using the history table, it uses '_fivetran_id', 'channel_id', and 'source_relation'."}, "latest_batch_index": {"type": "integer", "index": 6, "name": "latest_batch_index", "comment": "Indexes each user record based on the most recent available."}, "updated_at": {"type": "timestamp without time zone", "index": 7, "name": "updated_at", "comment": "Last update timestamp"}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 8, "name": "_fivetran_synced", "comment": "The time when a record was last updated by Fivetran."}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.stg_iterable__user_unsubscribed_channel"}, "model.iterable.stg_iterable__user_unsubscribed_channel_tmp": {"metadata": {"type": "VIEW", "schema": "public_iterable_dev", "name": "stg_iterable__user_unsubscribed_channel_tmp", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"_fivetran_id": {"type": "text", "index": 1, "name": "_fivetran_id", "comment": null}, "channel_id": {"type": "integer", "index": 2, "name": "channel_id", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 3, "name": "_fivetran_synced", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.stg_iterable__user_unsubscribed_channel_tmp"}}, "sources": {"source.iterable.iterable.campaign_history": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "campaign_history_data", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"id": {"type": "integer", "index": 1, "name": "id", "comment": null}, "updated_at": {"type": "text", "index": 2, "name": "updated_at", "comment": null}, "template_id": {"type": "integer", "index": 3, "name": "template_id", "comment": null}, "recurring_campaign_id": {"type": "integer", "index": 4, "name": "recurring_campaign_id", "comment": null}, "campaign_state": {"type": "text", "index": 5, "name": "campaign_state", "comment": null}, "created_at": {"type": "text", "index": 6, "name": "created_at", "comment": null}, "created_by_user_id": {"type": "text", "index": 7, "name": "created_by_user_id", "comment": null}, "ended_at": {"type": "integer", "index": 8, "name": "ended_at", "comment": null}, "name": {"type": "text", "index": 9, "name": "name", "comment": null}, "send_size": {"type": "integer", "index": 10, "name": "send_size", "comment": null}, "start_at": {"type": "integer", "index": 11, "name": "start_at", "comment": null}, "type": {"type": "text", "index": 12, "name": "type", "comment": null}, "workflow_id": {"type": "integer", "index": 13, "name": "workflow_id", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 14, "name": "_fivetran_synced", "comment": null}, "updated_by_user_id": {"type": "integer", "index": 15, "name": "updated_by_user_id", "comment": null}, "message_medium": {"type": "text", "index": 16, "name": "message_medium", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.iterable.iterable.campaign_history"}, "source.iterable.iterable.campaign_label_history": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "campaign_label_history_data", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"campaign_id": {"type": "integer", "index": 1, "name": "campaign_id", "comment": null}, "label": {"type": "text", "index": 2, "name": "label", "comment": null}, "updated_at": {"type": "text", "index": 3, "name": "updated_at", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 4, "name": "_fivetran_synced", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.iterable.iterable.campaign_label_history"}, "source.iterable.iterable.campaign_list_history": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "campaign_list_history_data", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"list_id": {"type": "integer", "index": 1, "name": "list_id", "comment": null}, "campaign_id": {"type": "integer", "index": 2, "name": "campaign_id", "comment": null}, "updated_at": {"type": "text", "index": 3, "name": "updated_at", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 4, "name": "_fivetran_synced", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.iterable.iterable.campaign_list_history"}, "source.iterable.iterable.campaign_suppression_list_history": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "campaign_suppression_list_history_data", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"suppressed_list_id": {"type": "integer", "index": 1, "name": "suppressed_list_id", "comment": null}, "campaign_id": {"type": "integer", "index": 2, "name": "campaign_id", "comment": null}, "updated_at": {"type": "text", "index": 3, "name": "updated_at", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 4, "name": "_fivetran_synced", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.iterable.iterable.campaign_suppression_list_history"}, "source.iterable.iterable.channel": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "channel_data", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"id": {"type": "bigint", "index": 1, "name": "id", "comment": null}, "name": {"type": "text", "index": 2, "name": "name", "comment": null}, "channel_type": {"type": "text", "index": 3, "name": "channel_type", "comment": null}, "message_medium": {"type": "text", "index": 4, "name": "message_medium", "comment": null}, "_fivetran_deleted": {"type": "boolean", "index": 5, "name": "_fivetran_deleted", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 6, "name": "_fivetran_synced", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.iterable.iterable.channel"}, "source.iterable.iterable.event": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "event_data", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"_fivetran_id": {"type": "text", "index": 1, "name": "_fivetran_id", "comment": null}, "email": {"type": "text", "index": 2, "name": "email", "comment": null}, "campaign_id": {"type": "integer", "index": 3, "name": "campaign_id", "comment": null}, "message_id": {"type": "integer", "index": 4, "name": "message_id", "comment": null}, "content_id": {"type": "integer", "index": 5, "name": "content_id", "comment": null}, "created_at": {"type": "timestamp without time zone", "index": 6, "name": "created_at", "comment": null}, "event_name": {"type": "text", "index": 7, "name": "event_name", "comment": null}, "ip": {"type": "integer", "index": 8, "name": "ip", "comment": null}, "message_bus_id": {"type": "integer", "index": 9, "name": "message_bus_id", "comment": null}, "message_type_id": {"type": "integer", "index": 10, "name": "message_type_id", "comment": null}, "recipient_state": {"type": "integer", "index": 11, "name": "recipient_state", "comment": null}, "status": {"type": "integer", "index": 12, "name": "status", "comment": null}, "unsub_source": {"type": "integer", "index": 13, "name": "unsub_source", "comment": null}, "user_agent": {"type": "integer", "index": 14, "name": "user_agent", "comment": null}, "user_agent_device": {"type": "integer", "index": 15, "name": "user_agent_device", "comment": null}, "transactional_data": {"type": "character varying(100)", "index": 16, "name": "transactional_data", "comment": null}, "additional_properties": {"type": "text", "index": 17, "name": "additional_properties", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 18, "name": "_fivetran_synced", "comment": null}, "_fivetran_user_id": {"type": "integer", "index": 19, "name": "_fivetran_user_id", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.iterable.iterable.event"}, "source.iterable.iterable.event_extension": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "event_extension_data", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"_fivetran_id": {"type": "text", "index": 1, "name": "_fivetran_id", "comment": null}, "app_already_running": {"type": "integer", "index": 2, "name": "app_already_running", "comment": null}, "badge": {"type": "integer", "index": 3, "name": "badge", "comment": null}, "canonical_url_id": {"type": "integer", "index": 4, "name": "canonical_url_id", "comment": null}, "content_available": {"type": "integer", "index": 5, "name": "content_available", "comment": null}, "content_id": {"type": "integer", "index": 6, "name": "content_id", "comment": null}, "device": {"type": "integer", "index": 7, "name": "device", "comment": null}, "email_id": {"type": "text", "index": 8, "name": "email_id", "comment": null}, "email_subject": {"type": "text", "index": 9, "name": "email_subject", "comment": null}, "experiment_id": {"type": "integer", "index": 10, "name": "experiment_id", "comment": null}, "from_phone_number_id": {"type": "integer", "index": 11, "name": "from_phone_number_id", "comment": null}, "from_smssender_id": {"type": "integer", "index": 12, "name": "from_smssender_id", "comment": null}, "image_url": {"type": "integer", "index": 13, "name": "image_url", "comment": null}, "is_ghost_push": {"type": "integer", "index": 14, "name": "is_ghost_push", "comment": null}, "link_id": {"type": "integer", "index": 15, "name": "link_id", "comment": null}, "link_url": {"type": "integer", "index": 16, "name": "link_url", "comment": null}, "platform_endpoint": {"type": "integer", "index": 17, "name": "platform_endpoint", "comment": null}, "push_message": {"type": "integer", "index": 18, "name": "push_message", "comment": null}, "region": {"type": "text", "index": 19, "name": "region", "comment": null}, "sms_message": {"type": "integer", "index": 20, "name": "sms_message", "comment": null}, "sound": {"type": "integer", "index": 21, "name": "sound", "comment": null}, "to_phone_number": {"type": "integer", "index": 22, "name": "to_phone_number", "comment": null}, "url": {"type": "integer", "index": 23, "name": "url", "comment": null}, "workflow_id": {"type": "integer", "index": 24, "name": "workflow_id", "comment": null}, "workflow_name": {"type": "text", "index": 25, "name": "workflow_name", "comment": null}, "locale": {"type": "integer", "index": 26, "name": "locale", "comment": null}, "deeplink_android": {"type": "integer", "index": 27, "name": "deeplink_android", "comment": null}, "deeplink_ios": {"type": "integer", "index": 28, "name": "deeplink_ios", "comment": null}, "payload": {"type": "character varying(100)", "index": 29, "name": "payload", "comment": null}, "sms_provider_response_status": {"type": "integer", "index": 30, "name": "sms_provider_response_status", "comment": null}, "sms_provider_response_message": {"type": "integer", "index": 31, "name": "sms_provider_response_message", "comment": null}, "sms_provider_response_code": {"type": "integer", "index": 32, "name": "sms_provider_response_code", "comment": null}, "sms_provider_response_more_info": {"type": "integer", "index": 33, "name": "sms_provider_response_more_info", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 34, "name": "_fivetran_synced", "comment": null}, "catalog_collection_count": {"type": "integer", "index": 35, "name": "catalog_collection_count", "comment": null}, "catalog_lookup_count": {"type": "integer", "index": 36, "name": "catalog_lookup_count", "comment": null}, "city": {"type": "text", "index": 37, "name": "city", "comment": null}, "clicked_url": {"type": "text", "index": 38, "name": "clicked_url", "comment": null}, "country": {"type": "text", "index": 39, "name": "country", "comment": null}, "error_code": {"type": "integer", "index": 40, "name": "error_code", "comment": null}, "expires_at": {"type": "text", "index": 41, "name": "expires_at", "comment": null}, "from_phone_number": {"type": "integer", "index": 42, "name": "from_phone_number", "comment": null}, "in_app_body": {"type": "text", "index": 43, "name": "in_app_body", "comment": null}, "is_sms_estimation": {"type": "boolean", "index": 44, "name": "is_sms_estimation", "comment": null}, "labels": {"type": "text", "index": 45, "name": "labels", "comment": null}, "message_context": {"type": "text", "index": 46, "name": "message_context", "comment": null}, "message_status": {"type": "text", "index": 47, "name": "message_status", "comment": null}, "mms_send_count": {"type": "integer", "index": 48, "name": "mms_send_count", "comment": null}, "product_recommendation_count": {"type": "integer", "index": 49, "name": "product_recommendation_count", "comment": null}, "proxy_source": {"type": "text", "index": 50, "name": "proxy_source", "comment": null}, "reason": {"type": "text", "index": 51, "name": "reason", "comment": null}, "sms_send_count": {"type": "integer", "index": 52, "name": "sms_send_count", "comment": null}, "web_push_body": {"type": "text", "index": 53, "name": "web_push_body", "comment": null}, "web_push_click_action": {"type": "text", "index": 54, "name": "web_push_click_action", "comment": null}, "web_push_icon": {"type": "text", "index": 55, "name": "web_push_icon", "comment": null}, "web_push_message": {"type": "text", "index": 56, "name": "web_push_message", "comment": null}, "_fivetran_user_id": {"type": "integer", "index": 57, "name": "_fivetran_user_id", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.iterable.iterable.event_extension"}, "source.iterable.iterable.journey": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "journey_data", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"id": {"type": "bigint", "index": 1, "name": "id", "comment": null}, "name": {"type": "text", "index": 2, "name": "name", "comment": null}, "journey_type": {"type": "text", "index": 3, "name": "journey_type", "comment": null}, "description": {"type": "text", "index": 4, "name": "description", "comment": null}, "creator_user_id": {"type": "text", "index": 5, "name": "creator_user_id", "comment": null}, "enabled": {"type": "boolean", "index": 6, "name": "enabled", "comment": null}, "is_archived": {"type": "boolean", "index": 7, "name": "is_archived", "comment": null}, "lifetime_limit": {"type": "bigint", "index": 8, "name": "lifetime_limit", "comment": null}, "simultaneous_limit": {"type": "bigint", "index": 9, "name": "simultaneous_limit", "comment": null}, "start_tile_id": {"type": "bigint", "index": 10, "name": "start_tile_id", "comment": null}, "trigger_event_names": {"type": "text", "index": 11, "name": "trigger_event_names", "comment": null}, "created_at": {"type": "timestamp without time zone", "index": 12, "name": "created_at", "comment": null}, "updated_at": {"type": "timestamp without time zone", "index": 13, "name": "updated_at", "comment": null}, "_fivetran_deleted": {"type": "boolean", "index": 14, "name": "_fivetran_deleted", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 15, "name": "_fivetran_synced", "comment": null}, "draft_name": {"type": "text", "index": 16, "name": "draft_name", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.iterable.iterable.journey"}, "source.iterable.iterable.list": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "list_data", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"id": {"type": "integer", "index": 1, "name": "id", "comment": null}, "name": {"type": "text", "index": 2, "name": "name", "comment": null}, "created_at": {"type": "text", "index": 3, "name": "created_at", "comment": null}, "list_type": {"type": "text", "index": 4, "name": "list_type", "comment": null}, "_fivetran_deleted": {"type": "boolean", "index": 5, "name": "_fivetran_deleted", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 6, "name": "_fivetran_synced", "comment": null}, "description": {"type": "text", "index": 7, "name": "description", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.iterable.iterable.list"}, "source.iterable.iterable.list_user": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "list_user_data", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"_fivetran_id": {"type": "text", "index": 1, "name": "_fivetran_id", "comment": null}, "index": {"type": "bigint", "index": 2, "name": "index", "comment": null}, "list_id": {"type": "bigint", "index": 3, "name": "list_id", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 4, "name": "_fivetran_synced", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.iterable.iterable.list_user"}, "source.iterable.iterable.message_type": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "message_type_data", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"id": {"type": "bigint", "index": 1, "name": "id", "comment": null}, "name": {"type": "text", "index": 2, "name": "name", "comment": null}, "channel_id": {"type": "bigint", "index": 3, "name": "channel_id", "comment": null}, "_fivetran_deleted": {"type": "boolean", "index": 4, "name": "_fivetran_deleted", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 5, "name": "_fivetran_synced", "comment": null}, "created_at": {"type": "timestamp without time zone", "index": 6, "name": "created_at", "comment": null}, "frequency_cap": {"type": "integer", "index": 7, "name": "frequency_cap", "comment": null}, "rate_limit_per_minute": {"type": "integer", "index": 8, "name": "rate_limit_per_minute", "comment": null}, "subscription_policy": {"type": "text", "index": 9, "name": "subscription_policy", "comment": null}, "updated_at": {"type": "timestamp without time zone", "index": 10, "name": "updated_at", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.iterable.iterable.message_type"}, "source.iterable.iterable.template_history": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "template_history_data", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"id": {"type": "integer", "index": 1, "name": "id", "comment": null}, "updated_at": {"type": "text", "index": 2, "name": "updated_at", "comment": null}, "message_type_id": {"type": "integer", "index": 3, "name": "message_type_id", "comment": null}, "client_template_id": {"type": "integer", "index": 4, "name": "client_template_id", "comment": null}, "created_at": {"type": "text", "index": 5, "name": "created_at", "comment": null}, "creator_user_id": {"type": "text", "index": 6, "name": "creator_user_id", "comment": null}, "name": {"type": "text", "index": 7, "name": "name", "comment": null}, "template_type": {"type": "text", "index": 8, "name": "template_type", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 9, "name": "_fivetran_synced", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.iterable.iterable.template_history"}, "source.iterable.iterable.user_history": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "user_history_data", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"email": {"type": "text", "index": 1, "name": "email", "comment": null}, "updated_at": {"type": "timestamp without time zone", "index": 2, "name": "updated_at", "comment": null}, "first_name": {"type": "integer", "index": 3, "name": "first_name", "comment": null}, "last_name": {"type": "integer", "index": 4, "name": "last_name", "comment": null}, "phone_number": {"type": "integer", "index": 5, "name": "phone_number", "comment": null}, "user_id": {"type": "integer", "index": 6, "name": "user_id", "comment": null}, "signup_date": {"type": "text", "index": 7, "name": "signup_date", "comment": null}, "signup_source": {"type": "text", "index": 8, "name": "signup_source", "comment": null}, "phone_number_carrier": {"type": "integer", "index": 9, "name": "phone_number_carrier", "comment": null}, "phone_number_country_code_iso": {"type": "integer", "index": 10, "name": "phone_number_country_code_iso", "comment": null}, "phone_number_line_type": {"type": "integer", "index": 11, "name": "phone_number_line_type", "comment": null}, "phone_number_updated_at": {"type": "integer", "index": 12, "name": "phone_number_updated_at", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 13, "name": "_fivetran_synced", "comment": null}, "email_list_ids": {"type": "text", "index": 14, "name": "email_list_ids", "comment": null}, "iterable_user_id": {"type": "integer", "index": 15, "name": "iterable_user_id", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.iterable.iterable.user_history"}, "source.iterable.iterable.user_unsubscribed_channel": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "user_unsubscribed_channel_data", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"_fivetran_id": {"type": "text", "index": 1, "name": "_fivetran_id", "comment": null}, "channel_id": {"type": "integer", "index": 2, "name": "channel_id", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 3, "name": "_fivetran_synced", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.iterable.iterable.user_unsubscribed_channel"}, "source.iterable.iterable.user_unsubscribed_channel_history": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "user_unsubscribed_channel_history_data", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"email": {"type": "text", "index": 1, "name": "email", "comment": null}, "channel_id": {"type": "bigint", "index": 2, "name": "channel_id", "comment": null}, "updated_at": {"type": "text", "index": 3, "name": "updated_at", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 4, "name": "_fivetran_synced", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.iterable.iterable.user_unsubscribed_channel_history"}, "source.iterable.iterable.user_unsubscribed_message_type": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "user_unsubscribed_message_type_data", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"_fivetran_id": {"type": "text", "index": 1, "name": "_fivetran_id", "comment": null}, "message_type_id": {"type": "integer", "index": 2, "name": "message_type_id", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 3, "name": "_fivetran_synced", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.iterable.iterable.user_unsubscribed_message_type"}, "source.iterable.iterable.user_unsubscribed_message_type_history": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "user_unsubscribed_message_type_history_data", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"message_type_id": {"type": "integer", "index": 1, "name": "message_type_id", "comment": null}, "email": {"type": "text", "index": 2, "name": "email", "comment": null}, "updated_at": {"type": "text", "index": 3, "name": "updated_at", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 4, "name": "_fivetran_synced", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.iterable.iterable.user_unsubscribed_message_type_history"}}, "errors": null} \ No newline at end of file diff --git a/docs/manifest.json b/docs/manifest.json index b8136d9..776d4a0 100644 --- a/docs/manifest.json +++ b/docs/manifest.json @@ -1 +1 @@ -{"metadata": {"dbt_schema_version": "https://schemas.getdbt.com/dbt/manifest/v12.json", "dbt_version": "1.12.4", "generated_at": "2026-09-10T22:23:28.896440Z", "invocation_id": "5d6e507e-b2ab-4c2e-82a3-c9b3883d2ddc", "invocation_started_at": "2026-09-10T22:23:21.776886+00:00", "env": {}, "project_name": "iterable_integration_tests", "project_id": "726648524a3768595307d45548dac26e", "user_id": null, "send_anonymous_usage_stats": false, "adapter_type": "postgres", "quoting": {"database": true, "schema": true, "identifier": true, "column": null}, "run_started_at": "2026-09-10T22:23:21.777067+00:00"}, "nodes": {"seed.iterable_integration_tests.campaign_metrics_data": {"database": "postgres", "schema": "public", "name": "campaign_metrics_data", "resource_type": "seed", "package_name": "iterable_integration_tests", "path": "campaign_metrics_data.csv", "original_file_path": "seeds/campaign_metrics_data.csv", "unique_id": "seed.iterable_integration_tests.campaign_metrics_data", "fqn": ["iterable_integration_tests", "campaign_metrics_data"], "alias": "campaign_metrics_data", "checksum": {"name": "sha256", "checksum": "45e8e7be3941e10f43112fac7bd78f0b6a63c070090062f65b2ffabe481b8c4e"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "seed", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": false, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "delimiter": ",", "quote_columns": false}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": false, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"docs": {"show": false}, "quote_columns": "{{ target.type == 'redshift' or var('fivetran_using_source_casing', false) }}"}, "created_at": 1789079003.3322992, "relation_name": "\"postgres\".\"public\".\"campaign_metrics_data\"", "raw_code": "", "doc_blocks": [], "root_path": "/home/runner/work/dbt_iterable/dbt_iterable/integration_tests", "depends_on": {"macros": []}}, "seed.iterable_integration_tests.campaign_list_history_data": {"database": "postgres", "schema": "public", "name": "campaign_list_history_data", "resource_type": "seed", "package_name": "iterable_integration_tests", "path": "campaign_list_history_data.csv", "original_file_path": "seeds/campaign_list_history_data.csv", "unique_id": "seed.iterable_integration_tests.campaign_list_history_data", "fqn": ["iterable_integration_tests", "campaign_list_history_data"], "alias": "campaign_list_history_data", "checksum": {"name": "sha256", "checksum": "206581e614bf60f37345cbf1bd5e0cacac8a2f329a7dfc521b809c3e6d72e728"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "seed", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {"_fivetran_synced": "timestamp"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": false, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "delimiter": ",", "quote_columns": false}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": false, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"docs": {"show": false}, "quote_columns": "{{ target.type == 'redshift' or var('fivetran_using_source_casing', false) }}", "column_types": {"_fivetran_synced": "timestamp"}}, "created_at": 1789079003.337283, "relation_name": "\"postgres\".\"public\".\"campaign_list_history_data\"", "raw_code": "", "doc_blocks": [], "root_path": "/home/runner/work/dbt_iterable/dbt_iterable/integration_tests", "depends_on": {"macros": []}}, "seed.iterable_integration_tests.user_unsubscribed_message_type_history_data": {"database": "postgres", "schema": "public", "name": "user_unsubscribed_message_type_history_data", "resource_type": "seed", "package_name": "iterable_integration_tests", "path": "user_unsubscribed_message_type_history_data.csv", "original_file_path": "seeds/user_unsubscribed_message_type_history_data.csv", "unique_id": "seed.iterable_integration_tests.user_unsubscribed_message_type_history_data", "fqn": ["iterable_integration_tests", "user_unsubscribed_message_type_history_data"], "alias": "user_unsubscribed_message_type_history_data", "checksum": {"name": "sha256", "checksum": "1e6883673b9a6f44966d10891cece60a739773fadf44302ccf2aad5290222687"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "seed", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {"_fivetran_synced": "timestamp"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": false, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "delimiter": ",", "quote_columns": false}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": false, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"docs": {"show": false}, "quote_columns": "{{ target.type == 'redshift' or var('fivetran_using_source_casing', false) }}", "column_types": {"_fivetran_synced": "timestamp"}}, "created_at": 1789079003.339468, "relation_name": "\"postgres\".\"public\".\"user_unsubscribed_message_type_history_data\"", "raw_code": "", "doc_blocks": [], "root_path": "/home/runner/work/dbt_iterable/dbt_iterable/integration_tests", "depends_on": {"macros": []}}, "seed.iterable_integration_tests.user_unsubscribed_channel_history_data": {"database": "postgres", "schema": "public", "name": "user_unsubscribed_channel_history_data", "resource_type": "seed", "package_name": "iterable_integration_tests", "path": "user_unsubscribed_channel_history_data.csv", "original_file_path": "seeds/user_unsubscribed_channel_history_data.csv", "unique_id": "seed.iterable_integration_tests.user_unsubscribed_channel_history_data", "fqn": ["iterable_integration_tests", "user_unsubscribed_channel_history_data"], "alias": "user_unsubscribed_channel_history_data", "checksum": {"name": "sha256", "checksum": "a1b532e561033f6ff137e5a1bde082263903493b763e9358a2a2ba151360e00e"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "seed", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {"channel_id": "bigint", "_fivetran_synced": "timestamp"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": false, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "delimiter": ",", "quote_columns": false}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": false, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"docs": {"show": false}, "quote_columns": "{{ target.type == 'redshift' or var('fivetran_using_source_casing', false) }}", "column_types": {"channel_id": "{%- if target.type == 'bigquery' -%} INT64 {%- else -%} bigint {%- endif -%}", "_fivetran_synced": "timestamp"}}, "created_at": 1789079003.3418727, "relation_name": "\"postgres\".\"public\".\"user_unsubscribed_channel_history_data\"", "raw_code": "", "doc_blocks": [], "root_path": "/home/runner/work/dbt_iterable/dbt_iterable/integration_tests", "depends_on": {"macros": []}}, "seed.iterable_integration_tests.campaign_suppression_list_history_data": {"database": "postgres", "schema": "public", "name": "campaign_suppression_list_history_data", "resource_type": "seed", "package_name": "iterable_integration_tests", "path": "campaign_suppression_list_history_data.csv", "original_file_path": "seeds/campaign_suppression_list_history_data.csv", "unique_id": "seed.iterable_integration_tests.campaign_suppression_list_history_data", "fqn": ["iterable_integration_tests", "campaign_suppression_list_history_data"], "alias": "campaign_suppression_list_history_data", "checksum": {"name": "sha256", "checksum": "c9eaab0efe0e47ef695b57f71b41f23cf527c87610d7770be604e461fe7c9846"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "seed", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {"_fivetran_synced": "timestamp"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": false, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "delimiter": ",", "quote_columns": false}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": false, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"docs": {"show": false}, "quote_columns": "{{ target.type == 'redshift' or var('fivetran_using_source_casing', false) }}", "column_types": {"_fivetran_synced": "timestamp"}}, "created_at": 1789079003.344041, "relation_name": "\"postgres\".\"public\".\"campaign_suppression_list_history_data\"", "raw_code": "", "doc_blocks": [], "root_path": "/home/runner/work/dbt_iterable/dbt_iterable/integration_tests", "depends_on": {"macros": []}}, "seed.iterable_integration_tests.channel_data": {"database": "postgres", "schema": "public", "name": "channel_data", "resource_type": "seed", "package_name": "iterable_integration_tests", "path": "channel_data.csv", "original_file_path": "seeds/channel_data.csv", "unique_id": "seed.iterable_integration_tests.channel_data", "fqn": ["iterable_integration_tests", "channel_data"], "alias": "channel_data", "checksum": {"name": "sha256", "checksum": "a77e21fb127c0ff7fc652eb5ffc6b3559fde3d63c2c5291a68f10fefcc2fac37"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "seed", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {"id": "bigint", "_fivetran_synced": "timestamp"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": false, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "delimiter": ",", "quote_columns": false}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": false, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"docs": {"show": false}, "quote_columns": "{{ target.type == 'redshift' or var('fivetran_using_source_casing', false) }}", "column_types": {"id": "{%- if target.type == 'bigquery' -%} INT64 {%- else -%} bigint {%- endif -%}", "_fivetran_synced": "timestamp"}}, "created_at": 1789079003.3461516, "relation_name": "\"postgres\".\"public\".\"channel_data\"", "raw_code": "", "doc_blocks": [], "root_path": "/home/runner/work/dbt_iterable/dbt_iterable/integration_tests", "depends_on": {"macros": []}}, "seed.iterable_integration_tests.template_history_data": {"database": "postgres", "schema": "public", "name": "template_history_data", "resource_type": "seed", "package_name": "iterable_integration_tests", "path": "template_history_data.csv", "original_file_path": "seeds/template_history_data.csv", "unique_id": "seed.iterable_integration_tests.template_history_data", "fqn": ["iterable_integration_tests", "template_history_data"], "alias": "template_history_data", "checksum": {"name": "sha256", "checksum": "0f0c442398531afc5fb4c18f12f0d0f694eb3453cb09e0c6c48ba340b110f4a6"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "seed", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {"_fivetran_synced": "timestamp"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": false, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "delimiter": ",", "quote_columns": false}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": false, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"docs": {"show": false}, "quote_columns": "{{ target.type == 'redshift' or var('fivetran_using_source_casing', false) }}", "column_types": {"_fivetran_synced": "timestamp"}}, "created_at": 1789079003.3482864, "relation_name": "\"postgres\".\"public\".\"template_history_data\"", "raw_code": "", "doc_blocks": [], "root_path": "/home/runner/work/dbt_iterable/dbt_iterable/integration_tests", "depends_on": {"macros": []}}, "seed.iterable_integration_tests.message_type_data": {"database": "postgres", "schema": "public", "name": "message_type_data", "resource_type": "seed", "package_name": "iterable_integration_tests", "path": "message_type_data.csv", "original_file_path": "seeds/message_type_data.csv", "unique_id": "seed.iterable_integration_tests.message_type_data", "fqn": ["iterable_integration_tests", "message_type_data"], "alias": "message_type_data", "checksum": {"name": "sha256", "checksum": "84228c8c4a13092ca90bdf9579856968f5265c49f456d01b8510834ae3520bce"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "seed", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {"id": "bigint", "channel_id": "bigint", "_fivetran_synced": "timestamp"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": false, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "delimiter": ",", "quote_columns": false}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": false, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"docs": {"show": false}, "quote_columns": "{{ target.type == 'redshift' or var('fivetran_using_source_casing', false) }}", "column_types": {"id": "{%- if target.type == 'bigquery' -%} INT64 {%- else -%} bigint {%- endif -%}", "channel_id": "{%- if target.type == 'bigquery' -%} INT64 {%- else -%} bigint {%- endif -%}", "_fivetran_synced": "timestamp"}}, "created_at": 1789079003.3504887, "relation_name": "\"postgres\".\"public\".\"message_type_data\"", "raw_code": "", "doc_blocks": [], "root_path": "/home/runner/work/dbt_iterable/dbt_iterable/integration_tests", "depends_on": {"macros": []}}, "seed.iterable_integration_tests.event_data": {"database": "postgres", "schema": "public", "name": "event_data", "resource_type": "seed", "package_name": "iterable_integration_tests", "path": "event_data.csv", "original_file_path": "seeds/event_data.csv", "unique_id": "seed.iterable_integration_tests.event_data", "fqn": ["iterable_integration_tests", "event_data"], "alias": "event_data", "checksum": {"name": "sha256", "checksum": "c886615b369d98135814bac7c4070be9d58b4aa6eb9a90a5caa5ddc4454ab0ed"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "seed", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {"transactional_data": "varchar(100)", "created_at": "timestamp", "_fivetran_synced": "timestamp"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": false, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "delimiter": ",", "quote_columns": false}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": false, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"docs": {"show": false}, "quote_columns": "{{ target.type == 'redshift' or var('fivetran_using_source_casing', false) }}", "column_types": {"transactional_data": "{{ 'varchar(100)' if target.type in ('redshift', 'postgres') else 'string'}}", "created_at": "timestamp", "_fivetran_synced": "timestamp"}}, "created_at": 1789079003.3526897, "relation_name": "\"postgres\".\"public\".\"event_data\"", "raw_code": "", "doc_blocks": [], "root_path": "/home/runner/work/dbt_iterable/dbt_iterable/integration_tests", "depends_on": {"macros": []}}, "seed.iterable_integration_tests.list_user_data": {"database": "postgres", "schema": "public", "name": "list_user_data", "resource_type": "seed", "package_name": "iterable_integration_tests", "path": "list_user_data.csv", "original_file_path": "seeds/list_user_data.csv", "unique_id": "seed.iterable_integration_tests.list_user_data", "fqn": ["iterable_integration_tests", "list_user_data"], "alias": "list_user_data", "checksum": {"name": "sha256", "checksum": "2dbd80b8fb4338602a543026ede3f5a0797c0a4cf13c4724a877bb60ac6a4793"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "seed", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {"list_id": "bigint", "index": "bigint", "_fivetran_synced": "timestamp"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": false, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "delimiter": ",", "quote_columns": false}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": false, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"docs": {"show": false}, "quote_columns": "{{ target.type == 'redshift' or var('fivetran_using_source_casing', false) }}", "column_types": {"list_id": "{%- if target.type == 'bigquery' -%} INT64 {%- else -%} bigint {%- endif -%}", "index": "{%- if target.type == 'bigquery' -%} INT64 {%- else -%} bigint {%- endif -%}", "_fivetran_synced": "timestamp"}}, "created_at": 1789079003.3548837, "relation_name": "\"postgres\".\"public\".\"list_user_data\"", "raw_code": "", "doc_blocks": [], "root_path": "/home/runner/work/dbt_iterable/dbt_iterable/integration_tests", "depends_on": {"macros": []}}, "seed.iterable_integration_tests.user_history_bq_json_data": {"database": "postgres", "schema": "public", "name": "user_history_bq_json_data", "resource_type": "seed", "package_name": "iterable_integration_tests", "path": "user_history_bq_json_data.csv", "original_file_path": "seeds/user_history_bq_json_data.csv", "unique_id": "seed.iterable_integration_tests.user_history_bq_json_data", "fqn": ["iterable_integration_tests", "user_history_bq_json_data"], "alias": "user_history_bq_json_data", "checksum": {"name": "sha256", "checksum": "d2689731ace45d1a5c13930bcc8b80f7b3a02993f8ee4c58bfcf754b734a5caa"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "seed", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": false, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "delimiter": ",", "quote_columns": false}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": false, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"docs": {"show": false}, "quote_columns": "{{ target.type == 'redshift' or var('fivetran_using_source_casing', false) }}"}, "created_at": 1789079003.357003, "relation_name": "\"postgres\".\"public\".\"user_history_bq_json_data\"", "raw_code": "", "doc_blocks": [], "root_path": "/home/runner/work/dbt_iterable/dbt_iterable/integration_tests", "depends_on": {"macros": []}}, "seed.iterable_integration_tests.user_unsubscribed_message_type_data": {"database": "postgres", "schema": "public", "name": "user_unsubscribed_message_type_data", "resource_type": "seed", "package_name": "iterable_integration_tests", "path": "user_unsubscribed_message_type_data.csv", "original_file_path": "seeds/user_unsubscribed_message_type_data.csv", "unique_id": "seed.iterable_integration_tests.user_unsubscribed_message_type_data", "fqn": ["iterable_integration_tests", "user_unsubscribed_message_type_data"], "alias": "user_unsubscribed_message_type_data", "checksum": {"name": "sha256", "checksum": "473f01110084e53b2115bd09606172cb87559359ccd66775f60209851bfdac12"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "seed", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {"_fivetran_synced": "timestamp"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": false, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "delimiter": ",", "quote_columns": false}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": false, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"docs": {"show": false}, "quote_columns": "{{ target.type == 'redshift' or var('fivetran_using_source_casing', false) }}", "column_types": {"_fivetran_synced": "timestamp"}}, "created_at": 1789079003.3590732, "relation_name": "\"postgres\".\"public\".\"user_unsubscribed_message_type_data\"", "raw_code": "", "doc_blocks": [], "root_path": "/home/runner/work/dbt_iterable/dbt_iterable/integration_tests", "depends_on": {"macros": []}}, "seed.iterable_integration_tests.journey_data": {"database": "postgres", "schema": "public", "name": "journey_data", "resource_type": "seed", "package_name": "iterable_integration_tests", "path": "journey_data.csv", "original_file_path": "seeds/journey_data.csv", "unique_id": "seed.iterable_integration_tests.journey_data", "fqn": ["iterable_integration_tests", "journey_data"], "alias": "journey_data", "checksum": {"name": "sha256", "checksum": "b2265e4981c1414ffb3c839029d79f1bd926e13c48ba1337f7198042448fdb71"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "seed", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {"id": "bigint", "lifetime_limit": "bigint", "simultaneous_limit": "bigint", "start_tile_id": "bigint", "created_at": "timestamp", "updated_at": "timestamp", "_fivetran_synced": "timestamp"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": false, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "delimiter": ",", "quote_columns": false}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": false, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"docs": {"show": false}, "quote_columns": "{{ target.type == 'redshift' or var('fivetran_using_source_casing', false) }}", "column_types": {"id": "{%- if target.type == 'bigquery' -%} INT64 {%- else -%} bigint {%- endif -%}", "lifetime_limit": "{%- if target.type == 'bigquery' -%} INT64 {%- else -%} bigint {%- endif -%}", "simultaneous_limit": "{%- if target.type == 'bigquery' -%} INT64 {%- else -%} bigint {%- endif -%}", "start_tile_id": "{%- if target.type == 'bigquery' -%} INT64 {%- else -%} bigint {%- endif -%}", "created_at": "timestamp", "updated_at": "timestamp", "_fivetran_synced": "timestamp"}}, "created_at": 1789079003.36133, "relation_name": "\"postgres\".\"public\".\"journey_data\"", "raw_code": "", "doc_blocks": [], "root_path": "/home/runner/work/dbt_iterable/dbt_iterable/integration_tests", "depends_on": {"macros": []}}, "seed.iterable_integration_tests.campaign_history_data": {"database": "postgres", "schema": "public", "name": "campaign_history_data", "resource_type": "seed", "package_name": "iterable_integration_tests", "path": "campaign_history_data.csv", "original_file_path": "seeds/campaign_history_data.csv", "unique_id": "seed.iterable_integration_tests.campaign_history_data", "fqn": ["iterable_integration_tests", "campaign_history_data"], "alias": "campaign_history_data", "checksum": {"name": "sha256", "checksum": "06adf392dab227dbabbda6782b710213ceea5a30d87990d0cbabe92ba0a955c4"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "seed", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {"_fivetran_synced": "timestamp"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": false, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "delimiter": ",", "quote_columns": false}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": false, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"docs": {"show": false}, "quote_columns": "{{ target.type == 'redshift' or var('fivetran_using_source_casing', false) }}", "column_types": {"_fivetran_synced": "timestamp"}}, "created_at": 1789079003.3635008, "relation_name": "\"postgres\".\"public\".\"campaign_history_data\"", "raw_code": "", "doc_blocks": [], "root_path": "/home/runner/work/dbt_iterable/dbt_iterable/integration_tests", "depends_on": {"macros": []}}, "seed.iterable_integration_tests.list_data": {"database": "postgres", "schema": "public", "name": "list_data", "resource_type": "seed", "package_name": "iterable_integration_tests", "path": "list_data.csv", "original_file_path": "seeds/list_data.csv", "unique_id": "seed.iterable_integration_tests.list_data", "fqn": ["iterable_integration_tests", "list_data"], "alias": "list_data", "checksum": {"name": "sha256", "checksum": "9d817c52008be5fbdb25cde6fa5855f8222f41a436ba7e2e5ed564e319cb64fd"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "seed", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {"_fivetran_synced": "timestamp"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": false, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "delimiter": ",", "quote_columns": false}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": false, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"docs": {"show": false}, "quote_columns": "{{ target.type == 'redshift' or var('fivetran_using_source_casing', false) }}", "column_types": {"_fivetran_synced": "timestamp"}}, "created_at": 1789079003.3656101, "relation_name": "\"postgres\".\"public\".\"list_data\"", "raw_code": "", "doc_blocks": [], "root_path": "/home/runner/work/dbt_iterable/dbt_iterable/integration_tests", "depends_on": {"macros": []}}, "seed.iterable_integration_tests.event_extension_data": {"database": "postgres", "schema": "public", "name": "event_extension_data", "resource_type": "seed", "package_name": "iterable_integration_tests", "path": "event_extension_data.csv", "original_file_path": "seeds/event_extension_data.csv", "unique_id": "seed.iterable_integration_tests.event_extension_data", "fqn": ["iterable_integration_tests", "event_extension_data"], "alias": "event_extension_data", "checksum": {"name": "sha256", "checksum": "e0ed2a4a9661ad12bdd9d9a2221df3fd32f2da5fad39e9d0f6f01cbc819ffa9a"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "seed", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {"payload": "varchar(100)", "_fivetran_synced": "timestamp"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": false, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "delimiter": ",", "quote_columns": false}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": false, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"docs": {"show": false}, "quote_columns": "{{ target.type == 'redshift' or var('fivetran_using_source_casing', false) }}", "column_types": {"payload": "{{ 'varchar(100)' if target.type in ('redshift', 'postgres') else 'string'}}", "_fivetran_synced": "timestamp"}}, "created_at": 1789079003.3677528, "relation_name": "\"postgres\".\"public\".\"event_extension_data\"", "raw_code": "", "doc_blocks": [], "root_path": "/home/runner/work/dbt_iterable/dbt_iterable/integration_tests", "depends_on": {"macros": []}}, "seed.iterable_integration_tests.user_unsubscribed_channel_data": {"database": "postgres", "schema": "public", "name": "user_unsubscribed_channel_data", "resource_type": "seed", "package_name": "iterable_integration_tests", "path": "user_unsubscribed_channel_data.csv", "original_file_path": "seeds/user_unsubscribed_channel_data.csv", "unique_id": "seed.iterable_integration_tests.user_unsubscribed_channel_data", "fqn": ["iterable_integration_tests", "user_unsubscribed_channel_data"], "alias": "user_unsubscribed_channel_data", "checksum": {"name": "sha256", "checksum": "4c6abacf719352d79d0da89751296fc2665d65546ee2c1ad45d142918c750f28"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "seed", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {"_fivetran_synced": "timestamp"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": false, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "delimiter": ",", "quote_columns": false}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": false, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"docs": {"show": false}, "quote_columns": "{{ target.type == 'redshift' or var('fivetran_using_source_casing', false) }}", "column_types": {"_fivetran_synced": "timestamp"}}, "created_at": 1789079003.3699496, "relation_name": "\"postgres\".\"public\".\"user_unsubscribed_channel_data\"", "raw_code": "", "doc_blocks": [], "root_path": "/home/runner/work/dbt_iterable/dbt_iterable/integration_tests", "depends_on": {"macros": []}}, "seed.iterable_integration_tests.campaign_label_history_data": {"database": "postgres", "schema": "public", "name": "campaign_label_history_data", "resource_type": "seed", "package_name": "iterable_integration_tests", "path": "campaign_label_history_data.csv", "original_file_path": "seeds/campaign_label_history_data.csv", "unique_id": "seed.iterable_integration_tests.campaign_label_history_data", "fqn": ["iterable_integration_tests", "campaign_label_history_data"], "alias": "campaign_label_history_data", "checksum": {"name": "sha256", "checksum": "30ed21c883f801eb859d0280b90d45cb3dd020cdb708f4ef4aeca772372bf077"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "seed", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {"_fivetran_synced": "timestamp"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": false, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "delimiter": ",", "quote_columns": false}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": false, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"docs": {"show": false}, "quote_columns": "{{ target.type == 'redshift' or var('fivetran_using_source_casing', false) }}", "column_types": {"_fivetran_synced": "timestamp"}}, "created_at": 1789079003.3720965, "relation_name": "\"postgres\".\"public\".\"campaign_label_history_data\"", "raw_code": "", "doc_blocks": [], "root_path": "/home/runner/work/dbt_iterable/dbt_iterable/integration_tests", "depends_on": {"macros": []}}, "seed.iterable_integration_tests.user_history_data": {"database": "postgres", "schema": "public", "name": "user_history_data", "resource_type": "seed", "package_name": "iterable_integration_tests", "path": "user_history_data.csv", "original_file_path": "seeds/user_history_data.csv", "unique_id": "seed.iterable_integration_tests.user_history_data", "fqn": ["iterable_integration_tests", "user_history_data"], "alias": "user_history_data", "checksum": {"name": "sha256", "checksum": "708bd35a21174cf05f0b4370079a339061c0b9292690ac4facd43b1d2bdff186"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "seed", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {"updated_at": "timestamp", "_fivetran_synced": "timestamp"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": false, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "delimiter": ",", "quote_columns": false}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": false, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"docs": {"show": false}, "quote_columns": "{{ target.type == 'redshift' or var('fivetran_using_source_casing', false) }}", "column_types": {"updated_at": "timestamp", "_fivetran_synced": "timestamp"}}, "created_at": 1789079003.3742623, "relation_name": "\"postgres\".\"public\".\"user_history_data\"", "raw_code": "", "doc_blocks": [], "root_path": "/home/runner/work/dbt_iterable/dbt_iterable/integration_tests", "depends_on": {"macros": []}}, "model.iterable.iterable__users": {"database": "postgres", "schema": "public_iterable_dev", "name": "iterable__users", "resource_type": "model", "package_name": "iterable", "path": "iterable__users.sql", "original_file_path": "models/iterable__users.sql", "unique_id": "model.iterable.iterable__users", "fqn": ["iterable", "iterable__users"], "alias": "iterable__users", "checksum": {"name": "sha256", "checksum": "da23dacdef77d357083015551b25b1e1013e549ccea451e28820df44f3ac4f5a"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "table", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "Table that provides unique user enriched information.", "columns": {"source_relation": {"name": "source_relation", "description": "Identifies the record's source.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": ["doc.iterable.source_relation"]}, "unique_user_key": {"name": "unique_user_key", "description": "The unique identifier of the user. With the new schema (Aug 2023), it is the _fivetran_user_id. This is a hash of user_id and/or email, depending on project type. If using the old schema, it is email.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "_fivetran_user_id": {"name": "_fivetran_user_id", "description": "A Fivetran-created unique identifier for the new Iterable schema in Aug 2023, for users, derived from hashing user_id and/or email, depending on project type.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "email": {"name": "email", "description": "The user's email. User identifier, for email-based projects. Previously was the unique identifier for user records, for the old Iterable schema before the August 2023 updates.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "first_name": {"name": "first_name", "description": "First name of the user", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "last_name": {"name": "last_name", "description": "Last name of the user", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "user_id": {"name": "user_id", "description": "User identifier, for userID-based projects.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "signup_date": {"name": "signup_date", "description": "Timestamp of when the user signed up", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "signup_source": {"name": "signup_source", "description": "Source where the user signed up", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "updated_at": {"name": "updated_at", "description": "Last update timestamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "phone_number": {"name": "phone_number", "description": "Phone number associated with the user", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "email_list_ids": {"name": "email_list_ids", "description": "Array of all email lists associated with the user, derived from the list_user table relationships", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "count_lists": {"name": "count_lists", "description": "Total count of lists associated with the user", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "count_total_campaigns": {"name": "count_total_campaigns", "description": "Count of all campaigns the user has been in", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "first_event_at": {"name": "first_event_at", "description": "The first event the user ever encountered", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "last_event_at": {"name": "last_event_at", "description": "The most recent event the user has encountered", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_emailclick": {"name": "total_emailclick", "description": "Total number of email clicks the user has performed", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_emailunsubscribe": {"name": "total_emailunsubscribe", "description": "Total unsubscription events the user has performed", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_emailcomplaint": {"name": "total_emailcomplaint", "description": "Total email complaints the user has performed", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_customevent": {"name": "total_customevent", "description": "Total custom events associated with the user", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_emailsubscribe": {"name": "total_emailsubscribe", "description": "Total subscription events the user has performed", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_emailopen": {"name": "total_emailopen", "description": "Total email opened events the user has performed", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_pushsend": {"name": "total_pushsend", "description": "The push send events the user has experienced", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_smsbounce": {"name": "total_smsbounce", "description": "Total sms bounces that are associated with the user", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_pushbounce": {"name": "total_pushbounce", "description": "Total number of push bounces associated with the user", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_inappsendskip": {"name": "total_inappsendskip", "description": "Total in app send skips associated with the user", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_smssend": {"name": "total_smssend", "description": "Total sms sends that the user has experienced", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_inappsend": {"name": "total_inappsend", "description": "Total in app sends the user has experienced", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_pushopen": {"name": "total_pushopen", "description": "Total push messages the user has opened", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_emailsend": {"name": "total_emailsend", "description": "Total emails that have been sent to the user", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_pushsendskip": {"name": "total_pushsendskip", "description": "Total push sends the user has skipped", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_inappopen": {"name": "total_inappopen", "description": "Total in app opens the user has performed", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_emailsendskip": {"name": "total_emailsendskip", "description": "Total email sends the user has skipped", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_emailbounce": {"name": "total_emailbounce", "description": "Total number of emails that have bounced from the user", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_inappclick": {"name": "total_inappclick", "description": "Total in app clicks associated with the user", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_pushuninstall": {"name": "total_pushuninstall", "description": "Total push uninstall events the user has performed", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "iterable://models/iterable.yml", "build_path": null, "unrendered_config": {"materialized": "table", "schema": "iterable_{{ var('directed_schema','dev') }}", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789079004.2267928, "relation_name": "\"postgres\".\"public_iterable_dev\".\"iterable__users\"", "raw_code": "{% set passthrough_column_count = var('iterable_user_history_pass_through_columns') | length %}\n\nwith user_event_metrics as (\n\n select *\n from {{ ref('int_iterable__user_event_metrics') }}\n\n), list_users as (\n\n select *\n from {{ ref('stg_iterable__list_user') }}\n order by list_id -- so the list ids will aggregate in the right order\n\n), list_user_aggregated as (\n\n select\n source_relation,\n _fivetran_user_id,\n count(*) as count_lists,\n {{ dbt.concat([\"'['\", fivetran_utils.string_agg(field_to_agg=\"cast(list_id as \" ~ dbt.type_string() ~ \")\", delimiter=\"','\"), \"']'\"]) }} as email_list_ids\n from list_users\n group by 1, 2 \n\n), user_history_unnest as (\n -- this has all the user fields we're looking to pass through\n\n select *\n from {{ ref('int_iterable__list_user_unnest') }}\n\n -- limit to current lists they are a member of. each list-user combo is a unique row, which we will roll up\n where is_current\n\n), user_with_list_metrics as (\n\n select\n source_relation,\n user_id,\n _fivetran_user_id,\n unique_user_key,\n email,\n first_name,\n last_name,\n signup_date,\n signup_source,\n updated_at,\n phone_number,\n email_list_ids\n\n --The below script allows for pass through columns.\n {{ fivetran_utils.persist_pass_through_columns(pass_through_variable='iterable_user_history_pass_through_columns') }}\n\n , count(distinct list_id) as count_lists\n\n from user_history_unnest\n -- roll up to the user\n {{ dbt_utils.group_by(n = 12 + passthrough_column_count) }}\n\n), user_join as (\n\n select\n user_with_list_metrics.source_relation,\n user_with_list_metrics.user_id,\n user_with_list_metrics._fivetran_user_id,\n user_with_list_metrics.unique_user_key,\n user_with_list_metrics.email,\n user_with_list_metrics.first_name,\n user_with_list_metrics.last_name,\n user_with_list_metrics.signup_date,\n user_with_list_metrics.signup_source,\n user_with_list_metrics.updated_at,\n user_with_list_metrics.phone_number,\n coalesce(list_user_aggregated.email_list_ids, user_with_list_metrics.email_list_ids, '[]') as email_list_ids,\n coalesce(list_user_aggregated.count_lists, user_with_list_metrics.count_lists, 0) as count_lists,\n {{ dbt_utils.star(from=ref('int_iterable__user_event_metrics'), except=['source_relation','unique_user_key','_fivetran_user_id','user_id','user_email']) }}\n {{ fivetran_utils.persist_pass_through_columns(pass_through_variable='iterable_user_history_pass_through_columns', identifier='user_with_list_metrics') }}\n\n from user_with_list_metrics\n left join user_event_metrics\n on user_with_list_metrics.unique_user_key = user_event_metrics.unique_user_key\n and user_with_list_metrics.source_relation = user_event_metrics.source_relation\n left join list_user_aggregated\n -- use _fivetran_user_id since in list_user it is a primary key\n on user_with_list_metrics._fivetran_user_id = list_user_aggregated._fivetran_user_id\n and user_with_list_metrics.source_relation = list_user_aggregated.source_relation\n)\n\nselect *\nfrom user_join", "doc_blocks": [], "language": "sql", "refs": [{"name": "int_iterable__user_event_metrics", "package": null, "version": null}, {"name": "stg_iterable__list_user", "package": null, "version": null}, {"name": "int_iterable__list_user_unnest", "package": null, "version": null}, {"name": "int_iterable__user_event_metrics", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.type_string", "macro.fivetran_utils.string_agg", "macro.dbt.concat", "macro.fivetran_utils.persist_pass_through_columns", "macro.dbt_utils.group_by", "macro.dbt_utils.star"], "nodes": ["model.iterable.int_iterable__user_event_metrics", "model.iterable.stg_iterable__list_user", "model.iterable.int_iterable__list_user_unnest"]}, "compiled_path": "target/compiled/iterable/models/iterable__users.sql", "compiled": true, "compiled_code": "\n\nwith user_event_metrics as (\n\n select *\n from \"postgres\".\"public_iterable_dev\".\"int_iterable__user_event_metrics\"\n\n), list_users as (\n\n select *\n from \"postgres\".\"public_iterable_dev\".\"stg_iterable__list_user\"\n order by list_id -- so the list ids will aggregate in the right order\n\n), list_user_aggregated as (\n\n select\n source_relation,\n _fivetran_user_id,\n count(*) as count_lists,\n '[' || \n string_agg(cast(list_id as TEXT), ',')\n\n || ']' as email_list_ids\n from list_users\n group by 1, 2 \n\n), user_history_unnest as (\n -- this has all the user fields we're looking to pass through\n\n select *\n from \"postgres\".\"public_iterable_dev\".\"int_iterable__list_user_unnest\"\n\n -- limit to current lists they are a member of. each list-user combo is a unique row, which we will roll up\n where is_current\n\n), user_with_list_metrics as (\n\n select\n source_relation,\n user_id,\n _fivetran_user_id,\n unique_user_key,\n email,\n first_name,\n last_name,\n signup_date,\n signup_source,\n updated_at,\n phone_number,\n email_list_ids\n\n --The below script allows for pass through columns.\n \n\n\n\n\n\n , count(distinct list_id) as count_lists\n\n from user_history_unnest\n -- roll up to the user\n group by 1,2,3,4,5,6,7,8,9,10,11,12\n\n), user_join as (\n\n select\n user_with_list_metrics.source_relation,\n user_with_list_metrics.user_id,\n user_with_list_metrics._fivetran_user_id,\n user_with_list_metrics.unique_user_key,\n user_with_list_metrics.email,\n user_with_list_metrics.first_name,\n user_with_list_metrics.last_name,\n user_with_list_metrics.signup_date,\n user_with_list_metrics.signup_source,\n user_with_list_metrics.updated_at,\n user_with_list_metrics.phone_number,\n coalesce(list_user_aggregated.email_list_ids, user_with_list_metrics.email_list_ids, '[]') as email_list_ids,\n coalesce(list_user_aggregated.count_lists, user_with_list_metrics.count_lists, 0) as count_lists,\n \"count_total_campaigns\",\n \"first_event_at\",\n \"last_event_at\",\n \"total_emailclick\",\n \"total_emailunsubscribe\",\n \"total_emailcomplaint\",\n \"total_customevent\",\n \"total_emailsubscribe\",\n \"total_emailopen\",\n \"total_pushsend\",\n \"total_smsbounce\",\n \"total_pushbounce\",\n \"total_inappsendskip\",\n \"total_smssend\",\n \"total_inappsend\",\n \"total_pushopen\",\n \"total_emailsend\",\n \"total_pushsendskip\",\n \"total_inappopen\",\n \"total_emailsendskip\",\n \"total_emailbounce\",\n \"total_inappclick\",\n \"total_pushuninstall\"\n \n\n\n\n\n\n from user_with_list_metrics\n left join user_event_metrics\n on user_with_list_metrics.unique_user_key = user_event_metrics.unique_user_key\n and user_with_list_metrics.source_relation = user_event_metrics.source_relation\n left join list_user_aggregated\n -- use _fivetran_user_id since in list_user it is a primary key\n on user_with_list_metrics._fivetran_user_id = list_user_aggregated._fivetran_user_id\n and user_with_list_metrics.source_relation = list_user_aggregated.source_relation\n)\n\nselect *\nfrom user_join", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.iterable__list_user_history": {"database": "postgres", "schema": "public_iterable_dev", "name": "iterable__list_user_history", "resource_type": "model", "package_name": "iterable", "path": "iterable__list_user_history.sql", "original_file_path": "models/iterable__list_user_history.sql", "unique_id": "model.iterable.iterable__list_user_history", "fqn": ["iterable", "iterable__list_user_history"], "alias": "iterable__list_user_history", "checksum": {"name": "sha256", "checksum": "9c0778ad02c86e2145ba4189534ea1eabf07b41bb3aa414934fa554ae4af4e1c"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "table", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "Table that recreates the `list_user_history` source table. Additionally, this table provides an `is_current` field to identify the current lists associated with the user. The table coalesces list_id values from both the direct list_user relationships and the unnested email_list_ids from user history to ensure comprehensive list coverage. The grain of this table is at the user/list/updated_at level.\n", "columns": {"source_relation": {"name": "source_relation", "description": "Identifies the record's source.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": ["doc.iterable.source_relation"]}, "unique_user_key": {"name": "unique_user_key", "description": "The unique identifier of the user. With the new schema (Aug 2023), it is the _fivetran_user_id. This is a hash of user_id and/or email, depending on project type. If using the old schema, it is email.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "_fivetran_user_id": {"name": "_fivetran_user_id", "description": "A Fivetran-created unique identifier for the new Iterable schema in Aug 2023, for users, derived from hashing user_id and/or email, depending on project type.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "user_email": {"name": "user_email", "description": "Email of the user if it exists.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "user_first_name": {"name": "user_first_name", "description": "First name of the user", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "user_last_name": {"name": "user_last_name", "description": "Last name of the user", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "user_id": {"name": "user_id", "description": "User identifier, for userID-based projects.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "user_signup_date": {"name": "user_signup_date", "description": "Timestamp of when the user signed up", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "user_signup_source": {"name": "user_signup_source", "description": "Source where the user signed up", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "user_updated_at": {"name": "user_updated_at", "description": "Last update timestamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "list_id": {"name": "list_id", "description": "The list associated with the user. Uses coalesced values prioritizing `list_id` from `LIST_USER` over the unnested `email_list_ids` from `USER_HISTORY` for comprehensive list coverage.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "is_current": {"name": "is_current", "description": "Boolean indicating if the current list is active", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "list_name": {"name": "list_name", "description": "Name of the list associated with the user", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "list_type": {"name": "list_type", "description": "Type of list associated with the user", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "list_created_at": {"name": "list_created_at", "description": "Date the list was created", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "iterable://models/iterable.yml", "build_path": null, "unrendered_config": {"materialized": "table", "schema": "iterable_{{ var('directed_schema','dev') }}", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789079004.2212896, "relation_name": "\"postgres\".\"public_iterable_dev\".\"iterable__list_user_history\"", "raw_code": "with user_history_unnest as (\n\n select *\n from {{ ref('int_iterable__list_user_unnest') }}\n\n), list_users as (\n\n select *\n from {{ ref('stg_iterable__list_user') }}\n\n), lists as (\n\n select *\n from {{ ref('stg_iterable__list') }}\n\n), final as (\n select distinct\n user_history_unnest.source_relation,\n user_history_unnest.unique_user_key,\n user_history_unnest._fivetran_user_id,\n user_history_unnest.user_id,\n user_history_unnest.email as user_email,\n user_history_unnest.first_name as user_first_name,\n user_history_unnest.last_name as user_last_name,\n user_history_unnest.signup_date as user_signup_date,\n user_history_unnest.signup_source as user_signup_source,\n user_history_unnest.updated_at as user_updated_at,\n coalesce(list_users.list_id, user_history_unnest.list_id) as list_id,\n user_history_unnest.is_current,\n lists.list_name,\n lists.list_type,\n lists.created_at as list_created_at\n\n --The below script allows for pass through columns.\n {{ fivetran_utils.persist_pass_through_columns(pass_through_variable='iterable_user_history_pass_through_columns', identifier='user_history_unnest') }}\n\n from user_history_unnest\n left join list_users\n on list_users.source_relation = user_history_unnest.source_relation\n and list_users._fivetran_user_id = user_history_unnest._fivetran_user_id\n left join lists\n on lists.source_relation = user_history_unnest.source_relation\n and lists.list_id = coalesce(list_users.list_id, user_history_unnest.list_id)\n)\n\nselect *\nfrom final", "doc_blocks": [], "language": "sql", "refs": [{"name": "int_iterable__list_user_unnest", "package": null, "version": null}, {"name": "stg_iterable__list_user", "package": null, "version": null}, {"name": "stg_iterable__list", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.fivetran_utils.persist_pass_through_columns"], "nodes": ["model.iterable.int_iterable__list_user_unnest", "model.iterable.stg_iterable__list_user", "model.iterable.stg_iterable__list"]}, "compiled_path": "target/compiled/iterable/models/iterable__list_user_history.sql", "compiled": true, "compiled_code": "with user_history_unnest as (\n\n select *\n from \"postgres\".\"public_iterable_dev\".\"int_iterable__list_user_unnest\"\n\n), list_users as (\n\n select *\n from \"postgres\".\"public_iterable_dev\".\"stg_iterable__list_user\"\n\n), lists as (\n\n select *\n from \"postgres\".\"public_iterable_dev\".\"stg_iterable__list\"\n\n), final as (\n select distinct\n user_history_unnest.source_relation,\n user_history_unnest.unique_user_key,\n user_history_unnest._fivetran_user_id,\n user_history_unnest.user_id,\n user_history_unnest.email as user_email,\n user_history_unnest.first_name as user_first_name,\n user_history_unnest.last_name as user_last_name,\n user_history_unnest.signup_date as user_signup_date,\n user_history_unnest.signup_source as user_signup_source,\n user_history_unnest.updated_at as user_updated_at,\n coalesce(list_users.list_id, user_history_unnest.list_id) as list_id,\n user_history_unnest.is_current,\n lists.list_name,\n lists.list_type,\n lists.created_at as list_created_at\n\n --The below script allows for pass through columns.\n \n\n\n\n\n\n from user_history_unnest\n left join list_users\n on list_users.source_relation = user_history_unnest.source_relation\n and list_users._fivetran_user_id = user_history_unnest._fivetran_user_id\n left join lists\n on lists.source_relation = user_history_unnest.source_relation\n and lists.list_id = coalesce(list_users.list_id, user_history_unnest.list_id)\n)\n\nselect *\nfrom final", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.iterable__events": {"database": "postgres", "schema": "public_iterable_dev", "name": "iterable__events", "resource_type": "model", "package_name": "iterable", "path": "iterable__events.sql", "original_file_path": "models/iterable__events.sql", "unique_id": "model.iterable.iterable__events", "fqn": ["iterable", "iterable__events"], "alias": "iterable__events", "checksum": {"name": "sha256", "checksum": "d516cb05680b528ba689ac2a2e34bfee8bbd7ede3c7d8ccfea16a28232d39c44"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "incremental", "incremental_strategy": "delete+insert", "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": ["unique_event_id"], "on_schema_change": "fail", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}, "partition_by": {"field": "created_on", "data_type": "date"}, "file_format": "delta"}, "tags": [], "description": "Table that provides a comprehensive view of all events with enriched information such as the campaign, user effected, and template used.", "columns": {"source_relation": {"name": "source_relation", "description": "Identifies the record's source.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": ["doc.iterable.source_relation"]}, "event_id": {"name": "event_id", "description": "Unique id of the event generated by Fivetran", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_event_id": {"name": "unique_event_id", "description": "A unique surrogate key of event_id, _fivetran_user_id, and source_relation.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_user_key": {"name": "unique_user_key", "description": "The unique identifier of the user. With the new schema (Aug 2023), it is the _fivetran_user_id. This is a hash of user_id and/or email, depending on project type. If using the old schema, it is email.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "_fivetran_user_id": {"name": "_fivetran_user_id", "description": "A Fivetran-created unique identifier for the new Iterable schema in Aug 2023, for users, derived from hashing user_id and/or email, depending on project type.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "campaign_id": {"name": "campaign_id", "description": "Reference to the campaign from which the event originated", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "content_id": {"name": "content_id", "description": "Reference to the content the event is associated with", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "created_at": {"name": "created_at", "description": "Creation timestamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "email": {"name": "email", "description": "The user's email. User identifier, for email-based projects. Previously was the unique identifier for user records, for the old Iterable schema before the August 2023 updates.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "additional_properties": {"name": "additional_properties", "description": "json object containing addition event properties", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "event_name": {"name": "event_name", "description": "Name provided to the individual event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "message_bus_id": {"name": "message_bus_id", "description": "Reference to the message bus associated with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "message_id": {"name": "message_id", "description": "Reference to the message the event is associated with", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "message_type_id": {"name": "message_type_id", "description": "Reference to the type of message the event is associated with", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "recipient_state": {"name": "recipient_state", "description": "The state of the recipient upon receiving the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "status": {"name": "status", "description": "Status of the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "transactional_data": {"name": "transactional_data", "description": "Transactional data associated with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unsub_source": {"name": "unsub_source", "description": "Source of the unsubscribe event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "user_agent": {"name": "user_agent", "description": "User agent associated with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "user_agent_device": {"name": "user_agent_device", "description": "The device of the user agent", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "Timestamp of when the event record was synced by Fivetran", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "campaign_name": {"name": "campaign_name", "description": "The name of the campaign", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "campaign_type": {"name": "campaign_type", "description": "The type of campaign", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "is_campaign_recurring": {"name": "is_campaign_recurring", "description": "Boolean indicating if the campaign is recurrent", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "recurring_campaign_name": {"name": "recurring_campaign_name", "description": "The name of the recurring campaign (if applicable)", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "recurring_campaign_id": {"name": "recurring_campaign_id", "description": "The campaign if of the recurring campaign (if applicable)", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "user_id": {"name": "user_id", "description": "User identifier, for userID-based projects.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "user_full_name": {"name": "user_full_name", "description": "Full name of the user", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "message_type_name": {"name": "message_type_name", "description": "Name of the message type", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "message_medium": {"name": "message_medium", "description": "Medium of the message", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "channel_id": {"name": "channel_id", "description": "Unique identifier of the channel", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "channel_name": {"name": "channel_name", "description": "The channel name", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "channel_type": {"name": "channel_type", "description": "The type of channel", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "is_app_already_running": {"name": "is_app_already_running", "description": "Boolean indicating if the app is already running", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "badge": {"name": "badge", "description": "Badge associated with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "canonical_url_id": {"name": "canonical_url_id", "description": "Reference to the url associated with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "is_content_available": {"name": "is_content_available", "description": "Content available from the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "device": {"name": "device", "description": "The device associated with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "email_id": {"name": "email_id", "description": "Reference to the email associated with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "email_subject": {"name": "email_subject", "description": "Subject of the email associated with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "experiment_id": {"name": "experiment_id", "description": "Reference to the experiment used if the event is an experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "from_phone_number_id": {"name": "from_phone_number_id", "description": "Reference to the phone number which the event is from", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "from_smssender_id": {"name": "from_smssender_id", "description": "Reference to the sms sender which the event is from", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "link_id": {"name": "link_id", "description": "Reference to the link associated with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "link_url": {"name": "link_url", "description": "Url of the link associated with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "locale": {"name": "locale", "description": "Locale associated with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "payload": {"name": "payload", "description": "Payload resulted from the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "platform_endpoint": {"name": "platform_endpoint", "description": "The specific platform endpoint of the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "push_message": {"name": "push_message", "description": "Boolean indicating if the event is a push message", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "region": {"name": "region", "description": "Region of the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "sms_message": {"name": "sms_message", "description": "Boolean indicating if the event is an sms message", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "to_phone_number": {"name": "to_phone_number", "description": "To phone number associated with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "url": {"name": "url", "description": "Url associated with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "workflow_id": {"name": "workflow_id", "description": "Reference to the workflow which the event originated", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "workflow_name": {"name": "workflow_name", "description": "Name of the workflow which the event originated", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "catalog_collection_count": {"name": "catalog_collection_count", "description": "The count of products or items collected in a catalog associated with the event.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "catalog_lookup_count": {"name": "catalog_lookup_count", "description": "The count of times a catalog was looked up or queried during the event.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "template_id": {"name": "template_id", "description": "Unique identifier of the template", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "template_name": {"name": "template_name", "description": "User defined name of the template", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "template_creator_user_id": {"name": "template_creator_user_id", "description": "Reference to the user who created the template", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "created_on": {"name": "created_on", "description": "Day when the event was created", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "city": {"name": "city", "description": "The city associated with the event, which could be the location of the recipient.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "clicked_url": {"name": "clicked_url", "description": "The URL that was clicked by the recipient in response to the marketing message.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "country": {"name": "country", "description": "The country associated with the event, which could be the location of the recipient.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "error_code": {"name": "error_code", "description": "The error code or message indicating any issues or errors encountered during the event.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "expires_at": {"name": "expires_at", "description": "The date and time when the event or message is set to expire or become invalid.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "from_phone_number": {"name": "from_phone_number", "description": "The phone number from which the SMS message was sent.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "in_app_body": {"name": "in_app_body", "description": "The content or body of an in-app message that was sent as part of the event.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "is_sms_estimation": {"name": "is_sms_estimation", "description": "A boolean indicating whether the SMS message is an estimation or not.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "labels": {"name": "labels", "description": "Any labels or tags associated with the event, which can be used for categorization or organization.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "message_status": {"name": "message_status", "description": "The status of the marketing message, such as sent, delivered, opened, etc.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "mms_send_count": {"name": "mms_send_count", "description": "The count of multimedia messages (MMS) sent as part of the event.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "reason": {"name": "reason", "description": "The reason or cause associated with a specific event or action.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "sms_send_count": {"name": "sms_send_count", "description": "The count of SMS messages sent as part of the event.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "iterable://models/iterable.yml", "build_path": null, "unrendered_config": {"materialized": "incremental", "schema": "iterable_{{ var('directed_schema','dev') }}", "unique_key": "['unique_event_id']", "incremental_strategy": "CondExpr(test=Compare(expr=Getattr(node=Name(name='target', ctx='load'), attr='type', ctx='load'), ops=[Operand(op='in', expr=Tuple(items=[Const(value='bigquery'), Const(value='spark'), Const(value='databricks')], ctx='load'))]), expr1=Const(value='insert_overwrite'), expr2=Const(value='delete+insert'))", "partition_by": "CondExpr(test=Compare(expr=Getattr(node=Name(name='target', ctx='load'), attr='type', ctx='load'), ops=[Operand(op='notin', expr=Tuple(items=[Const(value='spark'), Const(value='databricks'), Const(value='duckdb')], ctx='load'))]), expr1=Dict(items=[Pair(key=Const(value='field'), value=Const(value='created_on')), Pair(key=Const(value='data_type'), value=Const(value='date'))]), expr2=List(items=[Const(value='created_on')]))", "file_format": "delta", "on_schema_change": "fail", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789079004.2127106, "relation_name": "\"postgres\".\"public_iterable_dev\".\"iterable__events\"", "raw_code": "{{ config(\n materialized='incremental',\n unique_key=['unique_event_id'],\n incremental_strategy='insert_overwrite' if target.type in ('bigquery', 'spark', 'databricks') else 'delete+insert',\n partition_by={\"field\": \"created_on\", \"data_type\": \"date\"} if target.type not in ('spark', 'databricks', 'duckdb') else ['created_on'],\n file_format='delta',\n on_schema_change='fail'\n ) \n}}\n\n{% set using_event_extension = var('iterable__using_event_extension', True) %}\n\nwith events as (\n\n select *\n from {{ ref('stg_iterable__event') }}\n\n {% if is_incremental() %}\n where created_on >= {{ iterable.iterable_lookback(\n from_date=\"max(created_on)\",\n datepart='day', \n interval=var('iterable_lookback_window', 7)) }}\n {% endif %}\n\n), campaign as (\n\n select *\n from {{ ref('int_iterable__recurring_campaigns') }}\n\n\n{% if using_event_extension %}\n), event_extension as (\n\n select *\n from {{ ref('stg_iterable__event_extension') }}\n{% endif %}\n\n), users as (\n\n select *\n from {{ ref('int_iterable__latest_user') }}\n\n), message_type_channel as (\n\n select *\n from {{ ref('int_iterable__message_type_channel') }}\n\n), template as (\n\n select *\n from {{ ref('int_iterable__latest_template') }}\n\n), event_join as (\n\n select \n events.*,\n campaign.campaign_name,\n campaign.campaign_type,\n campaign.is_campaign_recurring,\n campaign.recurring_campaign_name,\n campaign.recurring_campaign_id,\n\n users.user_id,\n users.first_name || ' ' || users.last_name as user_full_name,\n\n message_type_channel.message_type_name,\n message_type_channel.message_medium,\n message_type_channel.channel_id,\n message_type_channel.channel_name,\n message_type_channel.channel_type\n\n {% if using_event_extension %}\n {% set exclude_fields = [\"source_relation\", \"unique_user_key\",\"_fivetran_user_id\",\"event_id\", \"content_id\", \"_fivetran_synced\", \"unique_event_id\"] %}\n , {{ dbt_utils.star(from=ref('stg_iterable__event_extension'), except=exclude_fields, relation_alias=\"event_extension\") }}\n {% endif %}\n\n ,\n campaign.template_id,\n template.template_name,\n template.creator_user_id as template_creator_user_id\n \n from events\n\n {% if using_event_extension %}\n left join event_extension\n on events.unique_event_id = event_extension.unique_event_id\n and events.source_relation = event_extension.source_relation\n {% endif %}\n\n left join campaign\n on events.campaign_id = campaign.campaign_id\n and events.source_relation = campaign.source_relation\n left join users\n on events.unique_user_key = users.unique_user_key -- unique_user_key = _fivetran_user_id if exists, otherwise email\n and events.source_relation = users.source_relation\n left join message_type_channel\n on events.message_type_id = message_type_channel.message_type_id\n and events.source_relation = message_type_channel.source_relation\n left join template\n on campaign.template_id = template.template_id\n and events.source_relation = template.source_relation\n)\n\nselect *\nfrom event_join", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__event", "package": null, "version": null}, {"name": "int_iterable__recurring_campaigns", "package": null, "version": null}, {"name": "stg_iterable__event_extension", "package": null, "version": null}, {"name": "int_iterable__latest_user", "package": null, "version": null}, {"name": "int_iterable__message_type_channel", "package": null, "version": null}, {"name": "int_iterable__latest_template", "package": null, "version": null}, {"name": "stg_iterable__event_extension", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.is_incremental", "macro.dbt_utils.star", "macro.iterable.iterable_lookback"], "nodes": ["model.iterable.stg_iterable__event", "model.iterable.int_iterable__recurring_campaigns", "model.iterable.stg_iterable__event_extension", "model.iterable.int_iterable__latest_user", "model.iterable.int_iterable__message_type_channel", "model.iterable.int_iterable__latest_template"]}, "compiled_path": "target/compiled/iterable/models/iterable__events.sql", "compiled": true, "compiled_code": "\n\n\n\nwith events as (\n\n select *\n from \"postgres\".\"public_iterable_dev\".\"stg_iterable__event\"\n\n \n where created_on >= \n\n\n\n \n\n \n\n cast('2020-07-12' as date) + ((interval '1 day') * (-7))\n\n\n\n\n \n\n), campaign as (\n\n select *\n from \"postgres\".\"public_iterable_dev\".\"int_iterable__recurring_campaigns\"\n\n\n\n), event_extension as (\n\n select *\n from \"postgres\".\"public_iterable_dev\".\"stg_iterable__event_extension\"\n\n\n), users as (\n\n select *\n from \"postgres\".\"public_iterable_dev\".\"int_iterable__latest_user\"\n\n), message_type_channel as (\n\n select *\n from \"postgres\".\"public_iterable_dev\".\"int_iterable__message_type_channel\"\n\n), template as (\n\n select *\n from \"postgres\".\"public_iterable_dev\".\"int_iterable__latest_template\"\n\n), event_join as (\n\n select \n events.*,\n campaign.campaign_name,\n campaign.campaign_type,\n campaign.is_campaign_recurring,\n campaign.recurring_campaign_name,\n campaign.recurring_campaign_id,\n\n users.user_id,\n users.first_name || ' ' || users.last_name as user_full_name,\n\n message_type_channel.message_type_name,\n message_type_channel.message_medium,\n message_type_channel.channel_id,\n message_type_channel.channel_name,\n message_type_channel.channel_type\n\n \n \n , event_extension.\"is_app_already_running\",\n event_extension.\"badge\",\n event_extension.\"catalog_collection_count\",\n event_extension.\"catalog_lookup_count\",\n event_extension.\"canonical_url_id\",\n event_extension.\"is_content_available\",\n event_extension.\"device\",\n event_extension.\"email_id\",\n event_extension.\"email_subject\",\n event_extension.\"experiment_id\",\n event_extension.\"from_phone_number_id\",\n event_extension.\"from_smssender_id\",\n event_extension.\"link_id\",\n event_extension.\"link_url\",\n event_extension.\"locale\",\n event_extension.\"payload\",\n event_extension.\"platform_endpoint\",\n event_extension.\"push_message\",\n event_extension.\"region\",\n event_extension.\"sms_message\",\n event_extension.\"to_phone_number\",\n event_extension.\"url\",\n event_extension.\"workflow_id\",\n event_extension.\"workflow_name\",\n event_extension.\"city\",\n event_extension.\"clicked_url\",\n event_extension.\"country\",\n event_extension.\"error_code\",\n event_extension.\"expires_at\",\n event_extension.\"from_phone_number\",\n event_extension.\"in_app_body\",\n event_extension.\"is_sms_estimation\",\n event_extension.\"labels\",\n event_extension.\"message_status\",\n event_extension.\"mms_send_count\",\n event_extension.\"reason\",\n event_extension.\"sms_send_count\"\n \n\n ,\n campaign.template_id,\n template.template_name,\n template.creator_user_id as template_creator_user_id\n \n from events\n\n \n left join event_extension\n on events.unique_event_id = event_extension.unique_event_id\n and events.source_relation = event_extension.source_relation\n \n\n left join campaign\n on events.campaign_id = campaign.campaign_id\n and events.source_relation = campaign.source_relation\n left join users\n on events.unique_user_key = users.unique_user_key -- unique_user_key = _fivetran_user_id if exists, otherwise email\n and events.source_relation = users.source_relation\n left join message_type_channel\n on events.message_type_id = message_type_channel.message_type_id\n and events.source_relation = message_type_channel.source_relation\n left join template\n on campaign.template_id = template.template_id\n and events.source_relation = template.source_relation\n)\n\nselect *\nfrom event_join", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.iterable__user_campaign": {"database": "postgres", "schema": "public_iterable_dev", "name": "iterable__user_campaign", "resource_type": "model", "package_name": "iterable", "path": "iterable__user_campaign.sql", "original_file_path": "models/iterable__user_campaign.sql", "unique_id": "model.iterable.iterable__user_campaign", "fqn": ["iterable", "iterable__user_campaign"], "alias": "iterable__user_campaign", "checksum": {"name": "sha256", "checksum": "343ed0b8ab547da53812f4a8426cfd7b93f81ce3886680c4182a2596f1ea8632"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "table", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "Table that provides total and unique metrics for a user associated with particular campaigns and if available, experiments.", "columns": {"source_relation": {"name": "source_relation", "description": "Identifies the record's source.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": ["doc.iterable.source_relation"]}, "unique_user_campaign_id": {"name": "unique_user_campaign_id", "description": "Unique ID combining source_relation, unique_user_key, campaign_id, and if available, experiment_id.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "_fivetran_user_id": {"name": "_fivetran_user_id", "description": "A Fivetran-created unique identifier for the new Iterable schema in Aug 2023, for users, derived from hashing user_id and/or email, depending on project type.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_user_key": {"name": "unique_user_key", "description": "The unique identifier of the user. With the new schema (Aug 2023), it is the _fivetran_user_id. This is a hash of user_id and/or email, depending on project type. If using the old schema, it is email.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "user_id": {"name": "user_id", "description": "User identifier, for userID-based projects.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "user_email": {"name": "user_email", "description": "Email of the user if it exists.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "user_full_name": {"name": "user_full_name", "description": "The users first and last name", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "campaign_id": {"name": "campaign_id", "description": "The unique identifier of the campaign which the user metrics are associated", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "campaign_name": {"name": "campaign_name", "description": "The name of the campaign which the user metrics are associated", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "template_id": {"name": "template_id", "description": "The unique identifier of the template used within the campaign", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "template_name": {"name": "template_name", "description": "The name of the template used for the campaign", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "experiment_id": {"name": "experiment_id", "description": "The unique experiment variation of the campaign", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "recurring_campaign_id": {"name": "recurring_campaign_id", "description": "The unique identifier of the recurring campaign which the campaign is tied to", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "recurring_campaign_name": {"name": "recurring_campaign_name", "description": "The name of the recurring campaign which the campaign is tied to", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "first_event_at": {"name": "first_event_at", "description": "Timestamp of the first campaign/experiment event associated with the user", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "last_event_at": {"name": "last_event_at", "description": "Timestamp of the most recent campaign/experiment event associated with the user", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_emailclick": {"name": "total_emailclick", "description": "Total email clicks events the user took within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_emailunsubscribe": {"name": "total_emailunsubscribe", "description": "Total email unsubscription events the user performed within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_emailcomplaint": {"name": "total_emailcomplaint", "description": "Total email complaint events the user performed within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_customevent": {"name": "total_customevent", "description": "Total custom events associated with the user within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_emailsubscribe": {"name": "total_emailsubscribe", "description": "Total email subscription events associate with the user within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_emailopen": {"name": "total_emailopen", "description": "Total email open events the user performed within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_pushsend": {"name": "total_pushsend", "description": "Total push send events the user performed within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_smsbounce": {"name": "total_smsbounce", "description": "Total sms bounce events associated with the user within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_pushbounce": {"name": "total_pushbounce", "description": "Total push bounce events associated with the user within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_inappsendskip": {"name": "total_inappsendskip", "description": "Total in app send skip events the user performed within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_smssend": {"name": "total_smssend", "description": "Total sms send events associated with the user within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_inappsend": {"name": "total_inappsend", "description": "Total in app send events associated with the user within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_pushopen": {"name": "total_pushopen", "description": "Total push open events the user performed within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_emailsend": {"name": "total_emailsend", "description": "Total email send event associated with the user within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_pushsendskip": {"name": "total_pushsendskip", "description": "Total push send skip events associated with the user within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_inappopen": {"name": "total_inappopen", "description": "Total in app open events associated with the user within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_emailsendskip": {"name": "total_emailsendskip", "description": "Total email send skip events associated with the user within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_emailbounce": {"name": "total_emailbounce", "description": "Total email bounce events associated with the user within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_inappclick": {"name": "total_inappclick", "description": "Total in app click events associated with the user within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_pushuninstall": {"name": "total_pushuninstall", "description": "Total push uninstall events associated with the user within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "first_open_or_click_event_at": {"name": "first_open_or_click_event_at", "description": "The time of the first open or click time. This is the first time a user interacts with a campaign, recording the earliest occurring event out of 'emailOpen', 'emailClick', and 'pushOpen'.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "iterable://models/iterable.yml", "build_path": null, "unrendered_config": {"materialized": "table", "schema": "iterable_{{ var('directed_schema','dev') }}", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789079004.2231557, "relation_name": "\"postgres\".\"public_iterable_dev\".\"iterable__user_campaign\"", "raw_code": "{% set using_event_extension = var('iterable__using_event_extension', True) %}\n\nwith events as (\n\n select *\n from {{ ref('iterable__events') }}\n\n), pivot_out_events as (\n\n-- this will be at the user-campaign-experiment variation level\n-- if experiment_id is null, the user-campaign interactions happened outside of an experiment\n-- if campaign_id is null, the user interactions are organic\n select\n source_relation,\n _fivetran_user_id,\n unique_user_key,\n user_id,\n campaign_id,\n\n {{ \"experiment_id,\" if using_event_extension }}\n\n email as user_email,\n user_full_name,\n case when campaign_id is null then 'organic' else campaign_name end as campaign_name,\n template_id,\n template_name,\n\n recurring_campaign_id,\n recurring_campaign_name,\n\n min(created_at) as first_event_at,\n max(created_at) as last_event_at,\n min(case when event_name in ('emailOpen', 'emailClick', 'pushOpen') then created_at end) as first_open_or_click_event_at\n\n\n -- count up the number of instances of each metric\n -- `iterable__event_metrics` is set by default to all events brought in by fivetran+iterable\n -- https://fivetran.com/docs/applications/iterable#schemanotes\n {% for em in var('iterable__event_metrics') %}\n , sum(case when lower(event_name) = '{{ em | lower }}' then 1 else 0 end)\n as {{ 'total_' ~ em | replace(' ', '_') | replace('(', '') | replace(')', '') | lower }}\n {% endfor %}\n\n from events\n\n {{ dbt_utils.group_by(n=13 if using_event_extension else 12 ) }}\n\n), add_surrogate_key as (\n\n {% set surrogate_key_fields = ['source_relation', 'unique_user_key', 'campaign_id'] %}\n {% do surrogate_key_fields.append('experiment_id') if var('iterable__using_event_extension', True) %}\n\n select \n *,\n {{ dbt_utils.generate_surrogate_key(surrogate_key_fields) }} as unique_user_campaign_id\n\n from pivot_out_events\n)\n\nselect *\nfrom add_surrogate_key", "doc_blocks": [], "language": "sql", "refs": [{"name": "iterable__events", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt_utils.group_by", "macro.dbt_utils.generate_surrogate_key"], "nodes": ["model.iterable.iterable__events"]}, "compiled_path": "target/compiled/iterable/models/iterable__user_campaign.sql", "compiled": true, "compiled_code": "\n\nwith events as (\n\n select *\n from \"postgres\".\"public_iterable_dev\".\"iterable__events\"\n\n), pivot_out_events as (\n\n-- this will be at the user-campaign-experiment variation level\n-- if experiment_id is null, the user-campaign interactions happened outside of an experiment\n-- if campaign_id is null, the user interactions are organic\n select\n source_relation,\n _fivetran_user_id,\n unique_user_key,\n user_id,\n campaign_id,\n\n experiment_id,\n\n email as user_email,\n user_full_name,\n case when campaign_id is null then 'organic' else campaign_name end as campaign_name,\n template_id,\n template_name,\n\n recurring_campaign_id,\n recurring_campaign_name,\n\n min(created_at) as first_event_at,\n max(created_at) as last_event_at,\n min(case when event_name in ('emailOpen', 'emailClick', 'pushOpen') then created_at end) as first_open_or_click_event_at\n\n\n -- count up the number of instances of each metric\n -- `iterable__event_metrics` is set by default to all events brought in by fivetran+iterable\n -- https://fivetran.com/docs/applications/iterable#schemanotes\n \n , sum(case when lower(event_name) = 'emailclick' then 1 else 0 end)\n as total_emailclick\n \n , sum(case when lower(event_name) = 'emailunsubscribe' then 1 else 0 end)\n as total_emailunsubscribe\n \n , sum(case when lower(event_name) = 'emailcomplaint' then 1 else 0 end)\n as total_emailcomplaint\n \n , sum(case when lower(event_name) = 'customevent' then 1 else 0 end)\n as total_customevent\n \n , sum(case when lower(event_name) = 'emailsubscribe' then 1 else 0 end)\n as total_emailsubscribe\n \n , sum(case when lower(event_name) = 'emailopen' then 1 else 0 end)\n as total_emailopen\n \n , sum(case when lower(event_name) = 'pushsend' then 1 else 0 end)\n as total_pushsend\n \n , sum(case when lower(event_name) = 'smsbounce' then 1 else 0 end)\n as total_smsbounce\n \n , sum(case when lower(event_name) = 'pushbounce' then 1 else 0 end)\n as total_pushbounce\n \n , sum(case when lower(event_name) = 'inappsendskip' then 1 else 0 end)\n as total_inappsendskip\n \n , sum(case when lower(event_name) = 'smssend' then 1 else 0 end)\n as total_smssend\n \n , sum(case when lower(event_name) = 'inappsend' then 1 else 0 end)\n as total_inappsend\n \n , sum(case when lower(event_name) = 'pushopen' then 1 else 0 end)\n as total_pushopen\n \n , sum(case when lower(event_name) = 'emailsend' then 1 else 0 end)\n as total_emailsend\n \n , sum(case when lower(event_name) = 'pushsendskip' then 1 else 0 end)\n as total_pushsendskip\n \n , sum(case when lower(event_name) = 'inappopen' then 1 else 0 end)\n as total_inappopen\n \n , sum(case when lower(event_name) = 'emailsendskip' then 1 else 0 end)\n as total_emailsendskip\n \n , sum(case when lower(event_name) = 'emailbounce' then 1 else 0 end)\n as total_emailbounce\n \n , sum(case when lower(event_name) = 'inappclick' then 1 else 0 end)\n as total_inappclick\n \n , sum(case when lower(event_name) = 'pushuninstall' then 1 else 0 end)\n as total_pushuninstall\n \n\n from events\n\n group by 1,2,3,4,5,6,7,8,9,10,11,12,13\n\n), add_surrogate_key as (\n\n \n \n\n select \n *,\n md5(cast(coalesce(cast(source_relation as TEXT), '_dbt_utils_surrogate_key_null_') || '-' || coalesce(cast(unique_user_key as TEXT), '_dbt_utils_surrogate_key_null_') || '-' || coalesce(cast(campaign_id as TEXT), '_dbt_utils_surrogate_key_null_') || '-' || coalesce(cast(experiment_id as TEXT), '_dbt_utils_surrogate_key_null_') as TEXT)) as unique_user_campaign_id\n\n from pivot_out_events\n)\n\nselect *\nfrom add_surrogate_key", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.iterable__user_unsubscriptions": {"database": "postgres", "schema": "public_iterable_dev", "name": "iterable__user_unsubscriptions", "resource_type": "model", "package_name": "iterable", "path": "iterable__user_unsubscriptions.sql", "original_file_path": "models/iterable__user_unsubscriptions.sql", "unique_id": "model.iterable.iterable__user_unsubscriptions", "fqn": ["iterable", "iterable__user_unsubscriptions"], "alias": "iterable__user_unsubscriptions", "checksum": {"name": "sha256", "checksum": "9ffdcfb7996a2147cd7739fc5ac7a1bd2e0db91e0ffc76d1458f53046fc4598f"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "table", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "Table that generates the total channel and message types a user has chosen to unsubscribe.", "columns": {"source_relation": {"name": "source_relation", "description": "Identifies the record's source.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": ["doc.iterable.source_relation"]}, "_fivetran_user_id": {"name": "_fivetran_user_id", "description": "A Fivetran-created unique identifier for the new Iterable schema in Aug 2023, for users, derived from hashing user_id and/or email, depending on project type.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_user_key": {"name": "unique_user_key", "description": "The unique identifier of the user. With the new schema (Aug 2023), it is the _fivetran_user_id. This is a hash of user_id and/or email, depending on project type. If using the old schema, it is email.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "channel_id": {"name": "channel_id", "description": "Unique identifier of the channel which the user is unsubscribed", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "message_type_id": {"name": "message_type_id", "description": "Unique identifier of the message type which the user is unsubscribed", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "channel_name": {"name": "channel_name", "description": "The name of the channel which the user is unsubscribed", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "message_type_name": {"name": "message_type_name", "description": "The name of the message type which the user is unsubscribed", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "channel_type": {"name": "channel_type", "description": "The channel type which the user is unsubscribed", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "message_medium": {"name": "message_medium", "description": "The medium type the message was provided which the user is unsubscribed", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "updated_at": {"name": "updated_at", "description": "Timestamp of when the user unsubscribed from the channel or message type", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "is_unsubscribed_channel_wide": {"name": "is_unsubscribed_channel_wide", "description": "Boolean indicating if the user unsubscribed at the channel level (i.e. unsubscribed to all message types) or if they unsubscribed from only an individual message type.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "iterable://models/iterable.yml", "build_path": null, "unrendered_config": {"materialized": "table", "schema": "iterable_{{ var('directed_schema','dev') }}", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789079004.2240705, "relation_name": "\"postgres\".\"public_iterable_dev\".\"iterable__user_unsubscriptions\"", "raw_code": "{% set using_user_unsubscribed_message_type = var('iterable__using_user_unsubscribed_message_type', True) %}\n\nwith message_type_channel as (\n\n select *\n from {{ ref('int_iterable__message_type_channel') }}\n\n), user_unsubscribed_channel as (\n\n select\n *\n from {{ ref('stg_iterable__user_unsubscribed_channel') }}\n where latest_batch_index = 1\n\n{% if using_user_unsubscribed_message_type %}\n), user_unsubscribed_message_type as (\n\n select\n *\n from {{ ref('stg_iterable__user_unsub_message_type') }}\n where latest_batch_index = 1\n\n{% endif %}\n\n), combine as (\n\n select\n source_relation,\n _fivetran_user_id,\n unique_user_key,\n channel_id,\n cast(null as {{ dbt.type_string() }}) as message_type_id,\n updated_at\n from user_unsubscribed_channel\n\n{% if using_user_unsubscribed_message_type %}\n\n union all\n\n select\n source_relation,\n _fivetran_user_id,\n unique_user_key,\n cast(null as {{ dbt.type_string() }}) as channel_id,\n message_type_id,\n updated_at\n from user_unsubscribed_message_type\n{% endif %}\n\n), final as (\n\n select\n combine.source_relation,\n combine._fivetran_user_id,\n combine.unique_user_key,\n -- coalescing since message_type -> channel goes up a grain\n coalesce(combine.channel_id, message_type_channel.channel_id) as channel_id,\n coalesce(combine.message_type_id, message_type_channel.message_type_id) as message_type_id,\n combine.updated_at,\n message_type_channel.channel_name,\n message_type_channel.message_type_name,\n message_type_channel.channel_type,\n message_type_channel.message_medium,\n case when combine.channel_id is not null then true else false end as is_unsubscribed_channel_wide\n\n from combine\n\n -- unsubscribing from an entire channel unsubscribes a user from all message types in that channel\n join message_type_channel\n on combine.source_relation = message_type_channel.source_relation\n and (combine.channel_id = message_type_channel.channel_id\n or combine.message_type_id = message_type_channel.message_type_id)\n)\n\nselect *\nfrom final", "doc_blocks": [], "language": "sql", "refs": [{"name": "int_iterable__message_type_channel", "package": null, "version": null}, {"name": "stg_iterable__user_unsubscribed_channel", "package": null, "version": null}, {"name": "stg_iterable__user_unsub_message_type", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.type_string"], "nodes": ["model.iterable.int_iterable__message_type_channel", "model.iterable.stg_iterable__user_unsubscribed_channel", "model.iterable.stg_iterable__user_unsub_message_type"]}, "compiled_path": "target/compiled/iterable/models/iterable__user_unsubscriptions.sql", "compiled": true, "compiled_code": "\n\nwith message_type_channel as (\n\n select *\n from \"postgres\".\"public_iterable_dev\".\"int_iterable__message_type_channel\"\n\n), user_unsubscribed_channel as (\n\n select\n *\n from \"postgres\".\"public_iterable_dev\".\"stg_iterable__user_unsubscribed_channel\"\n where latest_batch_index = 1\n\n\n), user_unsubscribed_message_type as (\n\n select\n *\n from \"postgres\".\"public_iterable_dev\".\"stg_iterable__user_unsub_message_type\"\n where latest_batch_index = 1\n\n\n\n), combine as (\n\n select\n source_relation,\n _fivetran_user_id,\n unique_user_key,\n channel_id,\n cast(null as TEXT) as message_type_id,\n updated_at\n from user_unsubscribed_channel\n\n\n\n union all\n\n select\n source_relation,\n _fivetran_user_id,\n unique_user_key,\n cast(null as TEXT) as channel_id,\n message_type_id,\n updated_at\n from user_unsubscribed_message_type\n\n\n), final as (\n\n select\n combine.source_relation,\n combine._fivetran_user_id,\n combine.unique_user_key,\n -- coalescing since message_type -> channel goes up a grain\n coalesce(combine.channel_id, message_type_channel.channel_id) as channel_id,\n coalesce(combine.message_type_id, message_type_channel.message_type_id) as message_type_id,\n combine.updated_at,\n message_type_channel.channel_name,\n message_type_channel.message_type_name,\n message_type_channel.channel_type,\n message_type_channel.message_medium,\n case when combine.channel_id is not null then true else false end as is_unsubscribed_channel_wide\n\n from combine\n\n -- unsubscribing from an entire channel unsubscribes a user from all message types in that channel\n join message_type_channel\n on combine.source_relation = message_type_channel.source_relation\n and (combine.channel_id = message_type_channel.channel_id\n or combine.message_type_id = message_type_channel.message_type_id)\n)\n\nselect *\nfrom final", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.iterable__journeys": {"database": "postgres", "schema": "public_iterable_dev", "name": "iterable__journeys", "resource_type": "model", "package_name": "iterable", "path": "iterable__journeys.sql", "original_file_path": "models/iterable__journeys.sql", "unique_id": "model.iterable.iterable__journeys", "fqn": ["iterable", "iterable__journeys"], "alias": "iterable__journeys", "checksum": {"name": "sha256", "checksum": "40ff36423bf5dfa1aa7c15f92e5c0103b2c8010bcb03fe666a72a9d002ac9dbc"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "table", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "Table that provides aggregations for journeys, formerly known as workflows. Metrics are rolled up from the user/campaign grain via each campaign's journey reference. Journeys which generate no events, such as those that only split audiences or update user fields, are still included with null metrics. The grain of this table is one record per journey.\n", "columns": {"source_relation": {"name": "source_relation", "description": "Identifies the record's source.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": ["doc.iterable.source_relation"]}, "journey_id": {"name": "journey_id", "description": "Unique identifier of the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_journey_id": {"name": "unique_journey_id", "description": "Unique identifier combining journey_id and source_relation.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "journey_name": {"name": "journey_name", "description": "User defined name of the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "journey_type": {"name": "journey_type", "description": "The journey type", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "journey_description": {"name": "journey_description", "description": "Information about the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "creator_user_id": {"name": "creator_user_id", "description": "Reference to the user who created the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "is_enabled": {"name": "is_enabled", "description": "Boolean indicating if the journey is currently enabled", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "is_archived": {"name": "is_archived", "description": "Boolean indicating if the journey has been archived", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "lifetime_limit": {"name": "lifetime_limit", "description": "Maximum number of times a user may enter the journey over their lifetime", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "simultaneous_limit": {"name": "simultaneous_limit", "description": "Maximum number of times a user may be in the journey at the same time", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "start_tile_id": {"name": "start_tile_id", "description": "Reference to the tile which begins the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "trigger_event_names": {"name": "trigger_event_names", "description": "The event names which trigger a user's entry into the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "created_at": {"name": "created_at", "description": "Creation timestamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "updated_at": {"name": "updated_at", "description": "Last update timestamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "The time when a record was last updated by Fivetran.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": ["doc.iterable._fivetran_synced"]}, "count_total_campaigns": {"name": "count_total_campaigns", "description": "Count of distinct campaigns within the journey that generated events", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "count_unique_users": {"name": "count_unique_users", "description": "Count of total unique users within the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "first_event_at": {"name": "first_event_at", "description": "Timestamp of the first event generated by any campaign in the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "last_event_at": {"name": "last_event_at", "description": "Timestamp of the most recent event generated by any campaign in the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_emailclick": {"name": "total_emailclick", "description": "Total email clicks within the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_total_emailclick": {"name": "unique_total_emailclick", "description": "Unique email clicks within the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_emailunsubscribe": {"name": "total_emailunsubscribe", "description": "Total email unsubscribe events within the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_total_emailunsubscribe": {"name": "unique_total_emailunsubscribe", "description": "Unique total email unsubscribe events within the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_emailcomplaint": {"name": "total_emailcomplaint", "description": "Total email complaints within the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_total_emailcomplaint": {"name": "unique_total_emailcomplaint", "description": "Unique total email complaints within the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_customevent": {"name": "total_customevent", "description": "Total custom events within the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_total_customevent": {"name": "unique_total_customevent", "description": "Unique total custom events within the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_emailsubscribe": {"name": "total_emailsubscribe", "description": "Total email subscribe events within the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_total_emailsubscribe": {"name": "unique_total_emailsubscribe", "description": "Unique total email subscribe events within the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_emailopen": {"name": "total_emailopen", "description": "Total email open events within the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_total_emailopen": {"name": "unique_total_emailopen", "description": "Unique total email open events within the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_pushsend": {"name": "total_pushsend", "description": "Total push send events within the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_total_pushsend": {"name": "unique_total_pushsend", "description": "Unique total push send events within the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_smsbounce": {"name": "total_smsbounce", "description": "Total sms bounce events within the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_total_smsbounce": {"name": "unique_total_smsbounce", "description": "Unique total sms bounce events within the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_pushbounce": {"name": "total_pushbounce", "description": "Total push bounce events within the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_total_pushbounce": {"name": "unique_total_pushbounce", "description": "Unique total push bounce events within the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_inappsendskip": {"name": "total_inappsendskip", "description": "Total in app send skip events within the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_total_inappsendskip": {"name": "unique_total_inappsendskip", "description": "Unique total in app send skip events within the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_smssend": {"name": "total_smssend", "description": "Total sms send events within the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_total_smssend": {"name": "unique_total_smssend", "description": "Unique total sms send events within the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_inappsend": {"name": "total_inappsend", "description": "Total in app send events within the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_total_inappsend": {"name": "unique_total_inappsend", "description": "Unique total in app send events within the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_pushopen": {"name": "total_pushopen", "description": "Total push open events within the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_total_pushopen": {"name": "unique_total_pushopen", "description": "Unique total push open events within the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_emailsend": {"name": "total_emailsend", "description": "Total email send events within the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_total_emailsend": {"name": "unique_total_emailsend", "description": "Unique total email send events within the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_pushsendskip": {"name": "total_pushsendskip", "description": "Total push send skip events within the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_total_pushsendskip": {"name": "unique_total_pushsendskip", "description": "Unique total push send skip events within the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_inappopen": {"name": "total_inappopen", "description": "Total in app open events within the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_total_inappopen": {"name": "unique_total_inappopen", "description": "Unique total in app open events within the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_emailsendskip": {"name": "total_emailsendskip", "description": "Total email send skip events within the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_total_emailsendskip": {"name": "unique_total_emailsendskip", "description": "Unique total email send skip events within the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_emailbounce": {"name": "total_emailbounce", "description": "Total email bounce events within the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_total_emailbounce": {"name": "unique_total_emailbounce", "description": "Unique total email bounce events within the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_inappclick": {"name": "total_inappclick", "description": "Total in app click events within the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_total_inappclick": {"name": "unique_total_inappclick", "description": "Unique total in app click events within the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_pushuninstall": {"name": "total_pushuninstall", "description": "Total push uninstall events within the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_total_pushuninstall": {"name": "unique_total_pushuninstall", "description": "Unique total push uninstall events within the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "email_open_rate": {"name": "email_open_rate", "description": "Share of emails sent within the journey that were opened. Only present when both emailSend and emailOpen are included in the `iterable__event_metrics` variable.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "email_click_rate": {"name": "email_click_rate", "description": "Share of emails sent within the journey that were clicked. Only present when both emailSend and emailClick are included in the `iterable__event_metrics` variable.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "email_bounce_rate": {"name": "email_bounce_rate", "description": "Share of emails sent within the journey that bounced. Only present when both emailSend and emailBounce are included in the `iterable__event_metrics` variable.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "email_unsubscribe_rate": {"name": "email_unsubscribe_rate", "description": "Share of emails sent within the journey that resulted in an unsubscribe. Only present when both emailSend and emailUnSubscribe are included in the `iterable__event_metrics` variable.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "iterable://models/iterable.yml", "build_path": null, "unrendered_config": {"materialized": "table", "schema": "iterable_{{ var('directed_schema','dev') }}", "enabled": "var('iterable__using_journey', True)", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789079004.2184186, "relation_name": "\"postgres\".\"public_iterable_dev\".\"iterable__journeys\"", "raw_code": "{{ config(enabled=var('iterable__using_journey', True)) }}\n\n{%- set event_metrics = var('iterable__event_metrics') | map('lower') | list %}\n\nwith journey as (\n\n select *\n from {{ ref('stg_iterable__journey') }}\n\n), journey_metrics as (\n\n select *\n from {{ ref('int_iterable__journey_event_metrics') }}\n\n), journey_join as (\n\n {% set exclude_fields = ['source_relation', 'journey_id'] %} -- these are in journey\n\n -- left join so journeys that generate no events, such as audience-splitting or\n -- field-update journeys, are still reported with null metrics\n select\n journey.*,\n {{ dbt_utils.star(from=ref('int_iterable__journey_event_metrics'), except=exclude_fields, relation_alias=\"journey_metrics\") }}\n\n from journey\n\n left join journey_metrics\n on journey.journey_id = journey_metrics.journey_id\n and journey.source_relation = journey_metrics.source_relation\n\n), add_rates as (\n\n -- Engagement rates as a share of emails sent. Each rate is emitted only when both its\n -- numerator and denominator events are present in the `iterable__event_metrics` variable,\n -- since that list is user-configurable and may not include every email event.\n {%- set rate_expressions = [] %}\n {%- if 'emailsend' in event_metrics %}\n {%- if 'emailopen' in event_metrics %}\n {%- do rate_expressions.append('total_emailopen / nullif(total_emailsend, 0) as email_open_rate') %}\n {%- endif %}\n {%- if 'emailclick' in event_metrics %}\n {%- do rate_expressions.append('total_emailclick / nullif(total_emailsend, 0) as email_click_rate') %}\n {%- endif %}\n {%- if 'emailbounce' in event_metrics %}\n {%- do rate_expressions.append('total_emailbounce / nullif(total_emailsend, 0) as email_bounce_rate') %}\n {%- endif %}\n {%- if 'emailunsubscribe' in event_metrics %}\n {%- do rate_expressions.append('total_emailunsubscribe / nullif(total_emailsend, 0) as email_unsubscribe_rate') %}\n {%- endif %}\n {%- endif %}\n\n select\n *\n {% for rate in rate_expressions %}\n , {{ rate }}\n {% endfor %}\n\n from journey_join\n\n), add_surrogate_key as (\n\n {% set surrogate_key_fields = ['journey_id', 'source_relation'] %}\n\n select\n *,\n {{ dbt_utils.generate_surrogate_key(surrogate_key_fields) }} as unique_journey_id\n\n from add_rates\n)\n\nselect *\nfrom add_surrogate_key", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__journey", "package": null, "version": null}, {"name": "int_iterable__journey_event_metrics", "package": null, "version": null}, {"name": "int_iterable__journey_event_metrics", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt_utils.star", "macro.dbt_utils.generate_surrogate_key"], "nodes": ["model.iterable.stg_iterable__journey", "model.iterable.int_iterable__journey_event_metrics"]}, "compiled_path": "target/compiled/iterable/models/iterable__journeys.sql", "compiled": true, "compiled_code": "\n\nwith journey as (\n\n select *\n from \"postgres\".\"public_iterable_dev\".\"stg_iterable__journey\"\n\n), journey_metrics as (\n\n select *\n from \"postgres\".\"public_iterable_dev\".\"int_iterable__journey_event_metrics\"\n\n), journey_join as (\n\n -- these are in journey\n\n -- left join so journeys that generate no events, such as audience-splitting or\n -- field-update journeys, are still reported with null metrics\n select\n journey.*,\n journey_metrics.\"count_total_campaigns\",\n journey_metrics.\"count_unique_users\",\n journey_metrics.\"first_event_at\",\n journey_metrics.\"last_event_at\",\n journey_metrics.\"total_emailclick\",\n journey_metrics.\"unique_total_emailclick\",\n journey_metrics.\"total_emailunsubscribe\",\n journey_metrics.\"unique_total_emailunsubscribe\",\n journey_metrics.\"total_emailcomplaint\",\n journey_metrics.\"unique_total_emailcomplaint\",\n journey_metrics.\"total_customevent\",\n journey_metrics.\"unique_total_customevent\",\n journey_metrics.\"total_emailsubscribe\",\n journey_metrics.\"unique_total_emailsubscribe\",\n journey_metrics.\"total_emailopen\",\n journey_metrics.\"unique_total_emailopen\",\n journey_metrics.\"total_pushsend\",\n journey_metrics.\"unique_total_pushsend\",\n journey_metrics.\"total_smsbounce\",\n journey_metrics.\"unique_total_smsbounce\",\n journey_metrics.\"total_pushbounce\",\n journey_metrics.\"unique_total_pushbounce\",\n journey_metrics.\"total_inappsendskip\",\n journey_metrics.\"unique_total_inappsendskip\",\n journey_metrics.\"total_smssend\",\n journey_metrics.\"unique_total_smssend\",\n journey_metrics.\"total_inappsend\",\n journey_metrics.\"unique_total_inappsend\",\n journey_metrics.\"total_pushopen\",\n journey_metrics.\"unique_total_pushopen\",\n journey_metrics.\"total_emailsend\",\n journey_metrics.\"unique_total_emailsend\",\n journey_metrics.\"total_pushsendskip\",\n journey_metrics.\"unique_total_pushsendskip\",\n journey_metrics.\"total_inappopen\",\n journey_metrics.\"unique_total_inappopen\",\n journey_metrics.\"total_emailsendskip\",\n journey_metrics.\"unique_total_emailsendskip\",\n journey_metrics.\"total_emailbounce\",\n journey_metrics.\"unique_total_emailbounce\",\n journey_metrics.\"total_inappclick\",\n journey_metrics.\"unique_total_inappclick\",\n journey_metrics.\"total_pushuninstall\",\n journey_metrics.\"unique_total_pushuninstall\"\n\n from journey\n\n left join journey_metrics\n on journey.journey_id = journey_metrics.journey_id\n and journey.source_relation = journey_metrics.source_relation\n\n), add_rates as (\n\n -- Engagement rates as a share of emails sent. Each rate is emitted only when both its\n -- numerator and denominator events are present in the `iterable__event_metrics` variable,\n -- since that list is user-configurable and may not include every email event.\n\n select\n *\n \n , total_emailopen / nullif(total_emailsend, 0) as email_open_rate\n \n , total_emailclick / nullif(total_emailsend, 0) as email_click_rate\n \n , total_emailbounce / nullif(total_emailsend, 0) as email_bounce_rate\n \n , total_emailunsubscribe / nullif(total_emailsend, 0) as email_unsubscribe_rate\n \n\n from journey_join\n\n), add_surrogate_key as (\n\n \n\n select\n *,\n md5(cast(coalesce(cast(journey_id as TEXT), '_dbt_utils_surrogate_key_null_') || '-' || coalesce(cast(source_relation as TEXT), '_dbt_utils_surrogate_key_null_') as TEXT)) as unique_journey_id\n\n from add_rates\n)\n\nselect *\nfrom add_surrogate_key", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": ["unique_journey_id"], "time_spine": null}, "model.iterable.iterable__campaigns": {"database": "postgres", "schema": "public_iterable_dev", "name": "iterable__campaigns", "resource_type": "model", "package_name": "iterable", "path": "iterable__campaigns.sql", "original_file_path": "models/iterable__campaigns.sql", "unique_id": "model.iterable.iterable__campaigns", "fqn": ["iterable", "iterable__campaigns"], "alias": "iterable__campaigns", "checksum": {"name": "sha256", "checksum": "8a06f641cc3e4a6fcf53c1ff0571db0c9b0e7212a2a2ff5ea9111e035a96b0cc"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "table", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "Table that provides aggregations for campaigns at the template and if available, the experiment grain.", "columns": {"source_relation": {"name": "source_relation", "description": "Identifies the record's source.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": ["doc.iterable.source_relation"]}, "campaign_id": {"name": "campaign_id", "description": "Unique identifier of the campaign record", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_campaign_version_id": {"name": "unique_campaign_version_id", "description": "Unique identifier combining campaign_id, template_id, source_relation, and if available, experiment_id.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "campaign_name": {"name": "campaign_name", "description": "User defined name of the campaign.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "updated_at": {"name": "updated_at", "description": "Last update timestamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "campaign_state": {"name": "campaign_state", "description": "State of the campaign. Can be Draft, Ready, Scheduled, Running, Finished, Starting, Aborted or Recurring", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "campaign_type": {"name": "campaign_type", "description": "The campaign type. Can be Blast or Triggered", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "send_size": {"name": "send_size", "description": "Size of the campaign. Number of individuals included in the campaign", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "start_at": {"name": "start_at", "description": "Start timestamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "ended_at": {"name": "ended_at", "description": "Ended timestamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "created_at": {"name": "created_at", "description": "Creation timestamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "created_by_user_id": {"name": "created_by_user_id", "description": "Reference to the user who created the campaign", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "template_id": {"name": "template_id", "description": "Reference to the campaign template", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "recurring_campaign_id": {"name": "recurring_campaign_id", "description": "Unique identifier of the recurring campaign (if applicable)", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "recurring_campaign_name": {"name": "recurring_campaign_name", "description": "Name of the recurring campaign (if applicable)", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "recurring_campaign_state": {"name": "recurring_campaign_state", "description": "State of the recurring campaign (if applicable)", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "recurring_campaign_send_size": {"name": "recurring_campaign_send_size", "description": "Size of the recurring campaign. Number of individuals included in the recurring campaign (if applicable)", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "recurring_campaign_start_at": {"name": "recurring_campaign_start_at", "description": "Timestamp of when the recurring campaign started (if applicable)", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "is_campaign_recurring": {"name": "is_campaign_recurring", "description": "Boolean indicating if the campaign is a recurring campaign", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "experiment_id": {"name": "experiment_id", "description": "Reference to the experiment used if the event is an experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "count_unique_users": {"name": "count_unique_users", "description": "Count of total unique users within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_emailclick": {"name": "total_emailclick", "description": "Total email clicks within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_total_emailclick": {"name": "unique_total_emailclick", "description": "Unique email clicks within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_emailunsubscribe": {"name": "total_emailunsubscribe", "description": "Total email unsubscribe events within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_total_emailunsubscribe": {"name": "unique_total_emailunsubscribe", "description": "Unique total email unsubscribe events within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_emailcomplaint": {"name": "total_emailcomplaint", "description": "Total email complaints within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_total_emailcomplaint": {"name": "unique_total_emailcomplaint", "description": "Unique total email complaints within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_customevent": {"name": "total_customevent", "description": "Total custom events within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_total_customevent": {"name": "unique_total_customevent", "description": "Unique total custom events within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_emailsubscribe": {"name": "total_emailsubscribe", "description": "Total email subscribe events within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_total_emailsubscribe": {"name": "unique_total_emailsubscribe", "description": "Unique total email subscribe events within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_emailopen": {"name": "total_emailopen", "description": "Total email open events within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_total_emailopen": {"name": "unique_total_emailopen", "description": "Unique total email open events within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_pushsend": {"name": "total_pushsend", "description": "Total push send event within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_total_pushsend": {"name": "unique_total_pushsend", "description": "Unique total push send events within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_smsbounce": {"name": "total_smsbounce", "description": "Total sms bounce events within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_total_smsbounce": {"name": "unique_total_smsbounce", "description": "Unique total sms bounce events within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_pushbounce": {"name": "total_pushbounce", "description": "Total push bounce events within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_total_pushbounce": {"name": "unique_total_pushbounce", "description": "Unique total push bounce events within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_inappsendskip": {"name": "total_inappsendskip", "description": "Total in app send skip events within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_total_inappsendskip": {"name": "unique_total_inappsendskip", "description": "Unique total in app send skip events within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_smssend": {"name": "total_smssend", "description": "Total sms send events within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_total_smssend": {"name": "unique_total_smssend", "description": "Unique total sms send events within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_inappsend": {"name": "total_inappsend", "description": "Total in app send events within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_total_inappsend": {"name": "unique_total_inappsend", "description": "Unique total in app send events within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_pushopen": {"name": "total_pushopen", "description": "Total push open events within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_total_pushopen": {"name": "unique_total_pushopen", "description": "Unique total push open events within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_emailsend": {"name": "total_emailsend", "description": "Total email send events within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_total_emailsend": {"name": "unique_total_emailsend", "description": "Unique total email send events within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_pushsendskip": {"name": "total_pushsendskip", "description": "Total push send skip events within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_total_pushsendskip": {"name": "unique_total_pushsendskip", "description": "Unique total push send skip events within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_inappopen": {"name": "total_inappopen", "description": "Total in app open events within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_total_inappopen": {"name": "unique_total_inappopen", "description": "Unique total in app open events within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_emailsendskip": {"name": "total_emailsendskip", "description": "Total email send skip events within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_total_emailsendskip": {"name": "unique_total_emailsendskip", "description": "Unique total email send skip events within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_emailbounce": {"name": "total_emailbounce", "description": "Total email bounce events within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_total_emailbounce": {"name": "unique_total_emailbounce", "description": "Unique total email bounce events within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_inappclick": {"name": "total_inappclick", "description": "Total in app click events within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_total_inappclick": {"name": "unique_total_inappclick", "description": "Unique total in app click events within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_pushuninstall": {"name": "total_pushuninstall", "description": "Total push uninstall events within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_total_pushuninstall": {"name": "unique_total_pushuninstall", "description": "Unique total push uninstall events within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "count_send_lists": {"name": "count_send_lists", "description": "Count of send lists within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "count_suppress_lists": {"name": "count_suppress_lists", "description": "Count of suppress lists within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "labels": {"name": "labels", "description": "List of labels associated with the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "journey_id": {"name": "journey_id", "description": "Reference to the journey the campaign belongs to, if applicable", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "journey_name": {"name": "journey_name", "description": "User defined name of the journey the campaign belongs to, if applicable", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "journey_type": {"name": "journey_type", "description": "The type of the journey the campaign belongs to, if applicable", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "template_name": {"name": "template_name", "description": "Name of the template associated with the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "template_creator_user_id": {"name": "template_creator_user_id", "description": "The creator user id of the template associated with the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "message_medium": {"name": "message_medium", "description": "The medium which the message was provided", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "message_type_name": {"name": "message_type_name", "description": "The message type name associated with the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "channel_name": {"name": "channel_name", "description": "The channel name associated with the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "channel_id": {"name": "channel_id", "description": "The channel identifier associated with the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "channel_type": {"name": "channel_type", "description": "The channel type associated with the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "iterable://models/iterable.yml", "build_path": null, "unrendered_config": {"materialized": "table", "schema": "iterable_{{ var('directed_schema','dev') }}", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789079004.200406, "relation_name": "\"postgres\".\"public_iterable_dev\".\"iterable__campaigns\"", "raw_code": "with campaign_event_metrics as (\n\n select *\n from {{ ref('int_iterable__campaign_event_metrics') }}\n\n), campaign_list_metrics as (\n\n select\n source_relation,\n campaign_id,\n sum(case when list_activity = 'send' then 1 else 0 end) as count_send_lists,\n sum(case when list_activity = 'suppress' then 1 else 0 end) as count_suppress_lists\n\n from {{ ref('int_iterable__campaign_lists') }}\n {{ dbt_utils.group_by(n=2) }}\n\n), campaign as (\n\n select *\n from {{ ref('int_iterable__recurring_campaigns') }}\n \n{% if var('iterable__using_campaign_label_history', true) %}\n), campaign_labels as (\n\n select *\n from {{ ref('int_iterable__campaign_labels') }}\n\n{% endif %}\n\n), template as (\n -- rebringing this in (it is brought in iterable__events) in case any campaigns don't have events yet\n -- this will result in some DAG ugliness but maintains template info for non-sent campaigns\n select *\n from {{ ref('int_iterable__latest_template') }}\n\n{% if var('iterable__using_journey', true) %}\n), journey as (\n\n select *\n from {{ ref('stg_iterable__journey') }}\n\n{% endif %}\n\n), campaign_join as (\n\n {% set exclude_fields = ['source_relation', 'campaign_id', 'template_id'] %} -- these are in campaigns\n\n -- this query will be at the campaign and experiment(if available) variation grain\n select\n campaign.*,\n {{ dbt_utils.star(from=ref('int_iterable__campaign_event_metrics'), except=exclude_fields, relation_alias=\"campaign_event_metrics\") }}\n , \n campaign_list_metrics.count_send_lists,\n campaign_list_metrics.count_suppress_lists,\n {% if var('iterable__using_campaign_label_history', true) %}\n campaign_labels.labels,\n {% endif %}\n {% if var('iterable__using_journey', true) %}\n journey.journey_name,\n journey.journey_type,\n {% endif %}\n template.template_name,\n template.creator_user_id as template_creator_user_id,\n template.message_medium,\n template.message_type_name,\n template.channel_name,\n template.channel_id,\n template.channel_type\n\n from campaign\n left join campaign_event_metrics\n on campaign.campaign_id = campaign_event_metrics.campaign_id\n and campaign.template_id = campaign_event_metrics.template_id\n and campaign.source_relation = campaign_event_metrics.source_relation\n left join campaign_list_metrics\n on campaign.campaign_id = campaign_list_metrics.campaign_id\n and campaign.source_relation = campaign_list_metrics.source_relation\n\n {% if var('iterable__using_campaign_label_history', true) %}\n left join campaign_labels\n on campaign.campaign_id = campaign_labels.campaign_id\n and campaign.source_relation = campaign_labels.source_relation\n {% endif %}\n\n left join template\n on campaign.template_id = template.template_id\n and campaign.source_relation = template.source_relation\n\n {% if var('iterable__using_journey', true) %}\n left join journey\n on campaign.journey_id = journey.journey_id\n and campaign.source_relation = journey.source_relation\n {% endif %}\n\n), add_surrogate_key as (\n\n {% set surrogate_key_fields = ['campaign_id', 'template_id', 'source_relation'] %}\n {% do surrogate_key_fields.append('experiment_id') if var('iterable__using_event_extension', True) %}\n\n select \n *,\n {{ dbt_utils.generate_surrogate_key(surrogate_key_fields) }} as unique_campaign_version_id\n\n from campaign_join\n)\n\nselect *\nfrom add_surrogate_key", "doc_blocks": [], "language": "sql", "refs": [{"name": "int_iterable__campaign_event_metrics", "package": null, "version": null}, {"name": "int_iterable__campaign_lists", "package": null, "version": null}, {"name": "int_iterable__recurring_campaigns", "package": null, "version": null}, {"name": "int_iterable__campaign_labels", "package": null, "version": null}, {"name": "int_iterable__latest_template", "package": null, "version": null}, {"name": "stg_iterable__journey", "package": null, "version": null}, {"name": "int_iterable__campaign_event_metrics", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt_utils.group_by", "macro.dbt_utils.star", "macro.dbt_utils.generate_surrogate_key"], "nodes": ["model.iterable.int_iterable__campaign_event_metrics", "model.iterable.int_iterable__campaign_lists", "model.iterable.int_iterable__recurring_campaigns", "model.iterable.int_iterable__campaign_labels", "model.iterable.int_iterable__latest_template", "model.iterable.stg_iterable__journey"]}, "compiled_path": "target/compiled/iterable/models/iterable__campaigns.sql", "compiled": true, "compiled_code": "with campaign_event_metrics as (\n\n select *\n from \"postgres\".\"public_iterable_dev\".\"int_iterable__campaign_event_metrics\"\n\n), campaign_list_metrics as (\n\n select\n source_relation,\n campaign_id,\n sum(case when list_activity = 'send' then 1 else 0 end) as count_send_lists,\n sum(case when list_activity = 'suppress' then 1 else 0 end) as count_suppress_lists\n\n from \"postgres\".\"public_iterable_dev\".\"int_iterable__campaign_lists\"\n group by 1,2\n\n), campaign as (\n\n select *\n from \"postgres\".\"public_iterable_dev\".\"int_iterable__recurring_campaigns\"\n \n\n), campaign_labels as (\n\n select *\n from \"postgres\".\"public_iterable_dev\".\"int_iterable__campaign_labels\"\n\n\n\n), template as (\n -- rebringing this in (it is brought in iterable__events) in case any campaigns don't have events yet\n -- this will result in some DAG ugliness but maintains template info for non-sent campaigns\n select *\n from \"postgres\".\"public_iterable_dev\".\"int_iterable__latest_template\"\n\n\n), journey as (\n\n select *\n from \"postgres\".\"public_iterable_dev\".\"stg_iterable__journey\"\n\n\n\n), campaign_join as (\n\n -- these are in campaigns\n\n -- this query will be at the campaign and experiment(if available) variation grain\n select\n campaign.*,\n campaign_event_metrics.\"experiment_id\",\n campaign_event_metrics.\"count_unique_users\",\n campaign_event_metrics.\"total_emailclick\",\n campaign_event_metrics.\"unique_total_emailclick\",\n campaign_event_metrics.\"total_emailunsubscribe\",\n campaign_event_metrics.\"unique_total_emailunsubscribe\",\n campaign_event_metrics.\"total_emailcomplaint\",\n campaign_event_metrics.\"unique_total_emailcomplaint\",\n campaign_event_metrics.\"total_customevent\",\n campaign_event_metrics.\"unique_total_customevent\",\n campaign_event_metrics.\"total_emailsubscribe\",\n campaign_event_metrics.\"unique_total_emailsubscribe\",\n campaign_event_metrics.\"total_emailopen\",\n campaign_event_metrics.\"unique_total_emailopen\",\n campaign_event_metrics.\"total_pushsend\",\n campaign_event_metrics.\"unique_total_pushsend\",\n campaign_event_metrics.\"total_smsbounce\",\n campaign_event_metrics.\"unique_total_smsbounce\",\n campaign_event_metrics.\"total_pushbounce\",\n campaign_event_metrics.\"unique_total_pushbounce\",\n campaign_event_metrics.\"total_inappsendskip\",\n campaign_event_metrics.\"unique_total_inappsendskip\",\n campaign_event_metrics.\"total_smssend\",\n campaign_event_metrics.\"unique_total_smssend\",\n campaign_event_metrics.\"total_inappsend\",\n campaign_event_metrics.\"unique_total_inappsend\",\n campaign_event_metrics.\"total_pushopen\",\n campaign_event_metrics.\"unique_total_pushopen\",\n campaign_event_metrics.\"total_emailsend\",\n campaign_event_metrics.\"unique_total_emailsend\",\n campaign_event_metrics.\"total_pushsendskip\",\n campaign_event_metrics.\"unique_total_pushsendskip\",\n campaign_event_metrics.\"total_inappopen\",\n campaign_event_metrics.\"unique_total_inappopen\",\n campaign_event_metrics.\"total_emailsendskip\",\n campaign_event_metrics.\"unique_total_emailsendskip\",\n campaign_event_metrics.\"total_emailbounce\",\n campaign_event_metrics.\"unique_total_emailbounce\",\n campaign_event_metrics.\"total_inappclick\",\n campaign_event_metrics.\"unique_total_inappclick\",\n campaign_event_metrics.\"total_pushuninstall\",\n campaign_event_metrics.\"unique_total_pushuninstall\"\n , \n campaign_list_metrics.count_send_lists,\n campaign_list_metrics.count_suppress_lists,\n \n campaign_labels.labels,\n \n \n journey.journey_name,\n journey.journey_type,\n \n template.template_name,\n template.creator_user_id as template_creator_user_id,\n template.message_medium,\n template.message_type_name,\n template.channel_name,\n template.channel_id,\n template.channel_type\n\n from campaign\n left join campaign_event_metrics\n on campaign.campaign_id = campaign_event_metrics.campaign_id\n and campaign.template_id = campaign_event_metrics.template_id\n and campaign.source_relation = campaign_event_metrics.source_relation\n left join campaign_list_metrics\n on campaign.campaign_id = campaign_list_metrics.campaign_id\n and campaign.source_relation = campaign_list_metrics.source_relation\n\n \n left join campaign_labels\n on campaign.campaign_id = campaign_labels.campaign_id\n and campaign.source_relation = campaign_labels.source_relation\n \n\n left join template\n on campaign.template_id = template.template_id\n and campaign.source_relation = template.source_relation\n\n \n left join journey\n on campaign.journey_id = journey.journey_id\n and campaign.source_relation = journey.source_relation\n \n\n), add_surrogate_key as (\n\n \n \n\n select \n *,\n md5(cast(coalesce(cast(campaign_id as TEXT), '_dbt_utils_surrogate_key_null_') || '-' || coalesce(cast(template_id as TEXT), '_dbt_utils_surrogate_key_null_') || '-' || coalesce(cast(source_relation as TEXT), '_dbt_utils_surrogate_key_null_') || '-' || coalesce(cast(experiment_id as TEXT), '_dbt_utils_surrogate_key_null_') as TEXT)) as unique_campaign_version_id\n\n from campaign_join\n)\n\nselect *\nfrom add_surrogate_key", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.int_iterable__campaign_labels": {"database": "postgres", "schema": "public_iterable_dev", "name": "int_iterable__campaign_labels", "resource_type": "model", "package_name": "iterable", "path": "intermediate/int_iterable__campaign_labels.sql", "original_file_path": "models/intermediate/int_iterable__campaign_labels.sql", "unique_id": "model.iterable.int_iterable__campaign_labels", "fqn": ["iterable", "intermediate", "int_iterable__campaign_labels"], "alias": "int_iterable__campaign_labels", "checksum": {"name": "sha256", "checksum": "64ae8d410bd6673399326348a650a7facc7b6631aa34fbb01a1598cb96c7d012"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "Table that provides the distinct string aggregation of labels for each campaign.", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "iterable://models/intermediate/int_iterable.yml", "build_path": null, "unrendered_config": {"materialized": "view", "schema": "iterable_{{ var('directed_schema','dev') }}", "enabled": "var('iterable__using_campaign_label_history', True)", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789079004.295383, "relation_name": "\"postgres\".\"public_iterable_dev\".\"int_iterable__campaign_labels\"", "raw_code": "{{ config(enabled=var('iterable__using_campaign_label_history', True)) }}\n\nwith campaign_label_history as (\n\n select *\n from {{ ref('stg_iterable__campaign_label_history') }}\n\n), order_campaign_labels as (\n\n select \n *,\n rank() over(partition by campaign_id{{ fivetran_utils.partition_by_source_relation(package_name='iterable') }} order by updated_at desc) as latest_label_batch_index\n\n from campaign_label_history\n\n), latest_labels as (\n\n select *\n from order_campaign_labels\n where latest_label_batch_index = 1\n\n), aggregate_labels as (\n\n select\n source_relation,\n campaign_id,\n {{ fivetran_utils.string_agg('distinct label', \"', '\") }} as labels\n\n from latest_labels\n {{ dbt_utils.group_by(n=2) }}\n)\n\nselect * from aggregate_labels", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__campaign_label_history", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.fivetran_utils.partition_by_source_relation", "macro.fivetran_utils.string_agg", "macro.dbt_utils.group_by"], "nodes": ["model.iterable.stg_iterable__campaign_label_history"]}, "compiled_path": "target/compiled/iterable/models/intermediate/int_iterable__campaign_labels.sql", "compiled": true, "compiled_code": "\n\nwith campaign_label_history as (\n\n select *\n from \"postgres\".\"public_iterable_dev\".\"stg_iterable__campaign_label_history\"\n\n), order_campaign_labels as (\n\n select \n *,\n rank() over(partition by campaign_id order by updated_at desc) as latest_label_batch_index\n\n from campaign_label_history\n\n), latest_labels as (\n\n select *\n from order_campaign_labels\n where latest_label_batch_index = 1\n\n), aggregate_labels as (\n\n select\n source_relation,\n campaign_id,\n \n string_agg(distinct label, ', ')\n\n as labels\n\n from latest_labels\n group by 1,2\n)\n\nselect * from aggregate_labels", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.int_iterable__journey_event_metrics": {"database": "postgres", "schema": "public_iterable_dev", "name": "int_iterable__journey_event_metrics", "resource_type": "model", "package_name": "iterable", "path": "intermediate/int_iterable__journey_event_metrics.sql", "original_file_path": "models/intermediate/int_iterable__journey_event_metrics.sql", "unique_id": "model.iterable.int_iterable__journey_event_metrics", "fqn": ["iterable", "intermediate", "int_iterable__journey_event_metrics"], "alias": "int_iterable__journey_event_metrics", "checksum": {"name": "sha256", "checksum": "6a1f0f32043a423287b962d9f2ab46aeda312c047c09256447a7068f8830353d"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "Table that generates relevant total and unique journey level aggregations, rolled up from the user/campaign grain via the campaign's journey reference.", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "iterable://models/intermediate/int_iterable.yml", "build_path": null, "unrendered_config": {"materialized": "view", "schema": "iterable_{{ var('directed_schema','dev') }}", "enabled": "var('iterable__using_journey', True)", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789079004.295994, "relation_name": "\"postgres\".\"public_iterable_dev\".\"int_iterable__journey_event_metrics\"", "raw_code": "{{ config(enabled=var('iterable__using_journey', True)) }}\n\nwith user_campaign as (\n select *\n from {{ ref('iterable__user_campaign') }}\n\n), campaign as (\n\n select\n source_relation,\n campaign_id,\n journey_id\n\n from {{ ref('int_iterable__recurring_campaigns') }}\n where journey_id is not null\n\n), journey_event_metrics as (\n{%- set user_campaign_columns = adapter.get_columns_in_relation(ref('iterable__user_campaign')) %}\n{%- set non_agg_columns = ['source_relation', 'unique_user_key', 'user_id', '_fivetran_user_id',\n 'user_email', 'user_full_name', 'campaign_id', 'campaign_name', 'recurring_campaign_id',\n 'recurring_campaign_name', 'first_event_at', 'last_event_at', 'template_id', 'template_name',\n 'experiment_id', 'unique_user_campaign_id', 'first_open_or_click_event_at'\n ] %}\n\n select\n campaign.source_relation,\n campaign.journey_id,\n count(distinct user_campaign.campaign_id) as count_total_campaigns,\n count(distinct user_campaign.unique_user_key) as count_unique_users,\n min(user_campaign.first_event_at) as first_event_at,\n max(user_campaign.last_event_at) as last_event_at\n {% for col in user_campaign_columns if col.name|lower not in non_agg_columns %}\n , sum(user_campaign.{{ col.name }}) as {{ col.name }}\n , count(distinct case when user_campaign.{{ col.name }} > 0 then user_campaign.user_email else null end) as unique_{{ col.name }}\n {% endfor %}\n\n from user_campaign\n\n inner join campaign\n on user_campaign.campaign_id = campaign.campaign_id\n and user_campaign.source_relation = campaign.source_relation\n\n {{ dbt_utils.group_by(n=2) }}\n)\n\nselect *\nfrom journey_event_metrics", "doc_blocks": [], "language": "sql", "refs": [{"name": "iterable__user_campaign", "package": null, "version": null}, {"name": "int_iterable__recurring_campaigns", "package": null, "version": null}, {"name": "iterable__user_campaign", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt_utils.group_by"], "nodes": ["model.iterable.iterable__user_campaign", "model.iterable.int_iterable__recurring_campaigns"]}, "compiled_path": "target/compiled/iterable/models/intermediate/int_iterable__journey_event_metrics.sql", "compiled": true, "compiled_code": "\n\nwith user_campaign as (\n select *\n from \"postgres\".\"public_iterable_dev\".\"iterable__user_campaign\"\n\n), campaign as (\n\n select\n source_relation,\n campaign_id,\n journey_id\n\n from \"postgres\".\"public_iterable_dev\".\"int_iterable__recurring_campaigns\"\n where journey_id is not null\n\n), journey_event_metrics as (\n\n select\n campaign.source_relation,\n campaign.journey_id,\n count(distinct user_campaign.campaign_id) as count_total_campaigns,\n count(distinct user_campaign.unique_user_key) as count_unique_users,\n min(user_campaign.first_event_at) as first_event_at,\n max(user_campaign.last_event_at) as last_event_at\n \n , sum(user_campaign.total_emailclick) as total_emailclick\n , count(distinct case when user_campaign.total_emailclick > 0 then user_campaign.user_email else null end) as unique_total_emailclick\n \n , sum(user_campaign.total_emailunsubscribe) as total_emailunsubscribe\n , count(distinct case when user_campaign.total_emailunsubscribe > 0 then user_campaign.user_email else null end) as unique_total_emailunsubscribe\n \n , sum(user_campaign.total_emailcomplaint) as total_emailcomplaint\n , count(distinct case when user_campaign.total_emailcomplaint > 0 then user_campaign.user_email else null end) as unique_total_emailcomplaint\n \n , sum(user_campaign.total_customevent) as total_customevent\n , count(distinct case when user_campaign.total_customevent > 0 then user_campaign.user_email else null end) as unique_total_customevent\n \n , sum(user_campaign.total_emailsubscribe) as total_emailsubscribe\n , count(distinct case when user_campaign.total_emailsubscribe > 0 then user_campaign.user_email else null end) as unique_total_emailsubscribe\n \n , sum(user_campaign.total_emailopen) as total_emailopen\n , count(distinct case when user_campaign.total_emailopen > 0 then user_campaign.user_email else null end) as unique_total_emailopen\n \n , sum(user_campaign.total_pushsend) as total_pushsend\n , count(distinct case when user_campaign.total_pushsend > 0 then user_campaign.user_email else null end) as unique_total_pushsend\n \n , sum(user_campaign.total_smsbounce) as total_smsbounce\n , count(distinct case when user_campaign.total_smsbounce > 0 then user_campaign.user_email else null end) as unique_total_smsbounce\n \n , sum(user_campaign.total_pushbounce) as total_pushbounce\n , count(distinct case when user_campaign.total_pushbounce > 0 then user_campaign.user_email else null end) as unique_total_pushbounce\n \n , sum(user_campaign.total_inappsendskip) as total_inappsendskip\n , count(distinct case when user_campaign.total_inappsendskip > 0 then user_campaign.user_email else null end) as unique_total_inappsendskip\n \n , sum(user_campaign.total_smssend) as total_smssend\n , count(distinct case when user_campaign.total_smssend > 0 then user_campaign.user_email else null end) as unique_total_smssend\n \n , sum(user_campaign.total_inappsend) as total_inappsend\n , count(distinct case when user_campaign.total_inappsend > 0 then user_campaign.user_email else null end) as unique_total_inappsend\n \n , sum(user_campaign.total_pushopen) as total_pushopen\n , count(distinct case when user_campaign.total_pushopen > 0 then user_campaign.user_email else null end) as unique_total_pushopen\n \n , sum(user_campaign.total_emailsend) as total_emailsend\n , count(distinct case when user_campaign.total_emailsend > 0 then user_campaign.user_email else null end) as unique_total_emailsend\n \n , sum(user_campaign.total_pushsendskip) as total_pushsendskip\n , count(distinct case when user_campaign.total_pushsendskip > 0 then user_campaign.user_email else null end) as unique_total_pushsendskip\n \n , sum(user_campaign.total_inappopen) as total_inappopen\n , count(distinct case when user_campaign.total_inappopen > 0 then user_campaign.user_email else null end) as unique_total_inappopen\n \n , sum(user_campaign.total_emailsendskip) as total_emailsendskip\n , count(distinct case when user_campaign.total_emailsendskip > 0 then user_campaign.user_email else null end) as unique_total_emailsendskip\n \n , sum(user_campaign.total_emailbounce) as total_emailbounce\n , count(distinct case when user_campaign.total_emailbounce > 0 then user_campaign.user_email else null end) as unique_total_emailbounce\n \n , sum(user_campaign.total_inappclick) as total_inappclick\n , count(distinct case when user_campaign.total_inappclick > 0 then user_campaign.user_email else null end) as unique_total_inappclick\n \n , sum(user_campaign.total_pushuninstall) as total_pushuninstall\n , count(distinct case when user_campaign.total_pushuninstall > 0 then user_campaign.user_email else null end) as unique_total_pushuninstall\n \n\n from user_campaign\n\n inner join campaign\n on user_campaign.campaign_id = campaign.campaign_id\n and user_campaign.source_relation = campaign.source_relation\n\n group by 1,2\n)\n\nselect *\nfrom journey_event_metrics", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.int_iterable__list_user_unnest": {"database": "postgres", "schema": "public_iterable_dev", "name": "int_iterable__list_user_unnest", "resource_type": "model", "package_name": "iterable", "path": "intermediate/int_iterable__list_user_unnest.sql", "original_file_path": "models/intermediate/int_iterable__list_user_unnest.sql", "unique_id": "model.iterable.int_iterable__list_user_unnest", "fqn": ["iterable", "intermediate", "int_iterable__list_user_unnest"], "alias": "int_iterable__list_user_unnest", "checksum": {"name": "sha256", "checksum": "82ec833586106f02efef7fe24516f3323171e61f1083323e97c892f21ddfa263"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "incremental", "incremental_strategy": "delete+insert", "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": "unique_key", "on_schema_change": "fail", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}, "partition_by": {"field": "date_day", "data_type": "date"}, "file_format": "delta"}, "tags": [], "description": "Table that unnests the `email_list_id` field for each user to create a new record for each user and the unique list it was associated with at a unique update. Due to the unnesting functions varying greatly between warehouses, conditional logic is applied throughout the model to appropriately accommodate the model being ran within Redshift, Snowflake, BigQuery, and Postgres.\n", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "iterable://models/intermediate/int_iterable.yml", "build_path": null, "unrendered_config": {"materialized": "incremental", "schema": "iterable_{{ var('directed_schema','dev') }}", "unique_key": "unique_key", "incremental_strategy": "CondExpr(test=Compare(expr=Getattr(node=Name(name='target', ctx='load'), attr='type', ctx='load'), ops=[Operand(op='in', expr=Tuple(items=[Const(value='bigquery'), Const(value='spark'), Const(value='databricks')], ctx='load'))]), expr1=Const(value='insert_overwrite'), expr2=Const(value='delete+insert'))", "partition_by": "CondExpr(test=Compare(expr=Getattr(node=Name(name='target', ctx='load'), attr='type', ctx='load'), ops=[Operand(op='notin', expr=Tuple(items=[Const(value='spark'), Const(value='databricks'), Const(value='duckdb')], ctx='load'))]), expr1=Dict(items=[Pair(key=Const(value='field'), value=Const(value='date_day')), Pair(key=Const(value='data_type'), value=Const(value='date'))]), expr2=List(items=[Const(value='date_day')]))", "file_format": "delta", "on_schema_change": "fail", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789079004.2974107, "relation_name": "\"postgres\".\"public_iterable_dev\".\"int_iterable__list_user_unnest\"", "raw_code": "{{ config(\n materialized='incremental',\n unique_key='unique_key',\n incremental_strategy='insert_overwrite' if target.type in ('bigquery', 'spark', 'databricks') else 'delete+insert',\n partition_by={\"field\": \"date_day\", \"data_type\": \"date\"} if target.type not in ('spark', 'databricks', 'duckdb') else ['date_day'],\n file_format='delta',\n on_schema_change='fail'\n )\n}}\n\nwith user_history as (\n\n select *\n from {{ ref('int_iterable__list_user_history') }} as user_history\n\n {% if is_incremental() %}\n {# the only rows we potentially want to overwrite are active ones #}\n where user_history.updated_at >= coalesce((select min(updated_at) from {{ this }} where is_current), '2010-01-01')\n {% endif %}\n\n{% if target.type == 'redshift' %}\n{# using PartiQL syntax to work with redshift's SUPER types #}\n), redshift_parse_email_lists as (\n\n select\n source_relation,\n _fivetran_user_id,\n unique_user_key,\n email,\n first_name,\n last_name,\n user_id,\n signup_date,\n signup_source,\n phone_number,\n updated_at,\n is_current,\n email_list_ids,\n {# let's not remove empty array-rows #}\n json_parse(case when email_list_ids = '[]' then '[\"is_null\"]' else email_list_ids end) as super_email_list_ids\n\n --The below script allows for pass through columns.\n {{ fivetran_utils.persist_pass_through_columns(pass_through_variable='iterable_user_history_pass_through_columns', identifier='user_history') }}\n\n from user_history\n\n), unnest_email_array as (\n\n select\n source_relation,\n _fivetran_user_id,\n unique_user_key,\n email,\n first_name,\n last_name,\n user_id,\n signup_date,\n signup_source,\n phone_number,\n updated_at,\n is_current,\n {# go back to strings #}\n cast(email_list_ids as {{ dbt.type_string() }}) as email_list_ids,\n cast(email_list_id as {{ dbt.type_string() }}) as email_list_id\n\n --The below script allows for pass through columns.\n {{ fivetran_utils.persist_pass_through_columns(pass_through_variable='iterable_user_history_pass_through_columns', identifier='emails') }}\n\n from redshift_parse_email_lists as emails, emails.super_email_list_ids as email_list_id\n\n{% else %}\n), unnest_email_array as (\n\n select\n source_relation,\n _fivetran_user_id,\n unique_user_key,\n email,\n first_name,\n last_name,\n user_id,\n signup_date,\n signup_source,\n phone_number,\n updated_at,\n is_current,\n email_list_ids,\n case when email_list_ids != '[]' then\n {% if target.type == 'snowflake' %}\n email_list_id.value\n {% elif target.type in ('spark','databricks') %}\n email_list_id.col\n {% else %} email_list_id {% endif %}\n else null\n end as email_list_id\n\n --The below script allows for pass through columns.\n {{ fivetran_utils.persist_pass_through_columns(pass_through_variable='iterable_user_history_pass_through_columns', identifier='user_history') }}\n\n from user_history\n\n {% if target.type == 'snowflake' %}\n cross join\n table(flatten(input => parse_json(\n case when email_list_ids = '[]' then '[\"is_null\"]' {# to not remove empty array-rows #}\n else email_list_ids end))) as email_list_id\n {% elif target.type == 'bigquery' %}\n cross join\n unnest(JSON_EXTRACT_STRING_ARRAY(\n case when email_list_ids = '[]' then '[\"is_null\"]' {# to not remove empty array-rows #}\n else email_list_ids end)) as email_list_id\n {% elif target.type in ('spark','databricks') %}\n cross join\n lateral explode_outer(from_json(\n case when email_list_ids = '[]' then '[\"is_null\"]' {# to not remove empty array-rows #}\n else email_list_ids end, 'array')) as email_list_id\n {% elif target.type == 'duckdb' %}\n cross join\n unnest(from_json(cast((\n case when email_list_ids = '[]' then '[\"is_null\"]' {# to not remove empty array-rows #}\n else email_list_ids end) as varchar), '[\"VARCHAR\"]')) as t(email_list_id)\n {% else %} {# target is postgres #}\n cross join\n json_array_elements_text(cast((\n case when email_list_ids = '[]' then '[\"is_null\"]' {# to not remove empty array-rows #}\n else email_list_ids end) as json)) as email_list_id\n {%- endif %}\n\n{%- endif -%}\n), adjust_nulls as (\n\n select\n source_relation,\n _fivetran_user_id,\n unique_user_key,\n email,\n first_name,\n last_name,\n user_id,\n signup_date,\n signup_source,\n updated_at,\n phone_number,\n is_current,\n case when email_list_ids = '[\"is_null\"]' then '[]' else email_list_ids end as email_list_ids,\n cast(NULLIF(email_list_id, 'is_null') as {{ dbt.type_int() }}) as list_id\n\n --The below script allows for pass through columns.\n {{ fivetran_utils.persist_pass_through_columns(pass_through_variable='iterable_user_history_pass_through_columns', identifier='unnest_email_array') }}\n\n from unnest_email_array\n\n), final as (\n\n select\n source_relation,\n _fivetran_user_id,\n unique_user_key,\n user_id,\n email,\n first_name,\n last_name,\n signup_date,\n signup_source,\n updated_at,\n phone_number,\n is_current,\n email_list_ids,\n list_id,\n {{ dbt_utils.generate_surrogate_key([\"source_relation\", \"unique_user_key\", \"list_id\", \"updated_at\"]) }} as unique_key,\n cast( {{ dbt.date_trunc('day', 'updated_at') }} as date) as date_day\n\n --The below script allows for pass through columns.\n {{ fivetran_utils.persist_pass_through_columns(pass_through_variable='iterable_user_history_pass_through_columns', identifier='adjust_nulls') }}\n\n from adjust_nulls\n)\n\nselect *\nfrom final", "doc_blocks": [], "language": "sql", "refs": [{"name": "int_iterable__list_user_history", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.is_incremental", "macro.fivetran_utils.persist_pass_through_columns", "macro.dbt.type_int", "macro.dbt_utils.generate_surrogate_key", "macro.dbt.date_trunc"], "nodes": ["model.iterable.int_iterable__list_user_history"]}, "compiled_path": "target/compiled/iterable/models/intermediate/int_iterable__list_user_unnest.sql", "compiled": true, "compiled_code": "\n\nwith user_history as (\n\n select *\n from \"postgres\".\"public_iterable_dev\".\"int_iterable__list_user_history\" as user_history\n\n \n \n where user_history.updated_at >= coalesce((select min(updated_at) from \"postgres\".\"public_iterable_dev\".\"int_iterable__list_user_unnest\" where is_current), '2010-01-01')\n \n\n\n), unnest_email_array as (\n\n select\n source_relation,\n _fivetran_user_id,\n unique_user_key,\n email,\n first_name,\n last_name,\n user_id,\n signup_date,\n signup_source,\n phone_number,\n updated_at,\n is_current,\n email_list_ids,\n case when email_list_ids != '[]' then\n email_list_id \n else null\n end as email_list_id\n\n --The below script allows for pass through columns.\n \n\n\n\n\n\n from user_history\n\n \n cross join\n json_array_elements_text(cast((\n case when email_list_ids = '[]' then '[\"is_null\"]' \n else email_list_ids end) as json)) as email_list_id), adjust_nulls as (\n\n select\n source_relation,\n _fivetran_user_id,\n unique_user_key,\n email,\n first_name,\n last_name,\n user_id,\n signup_date,\n signup_source,\n updated_at,\n phone_number,\n is_current,\n case when email_list_ids = '[\"is_null\"]' then '[]' else email_list_ids end as email_list_ids,\n cast(NULLIF(email_list_id, 'is_null') as integer) as list_id\n\n --The below script allows for pass through columns.\n \n\n\n\n\n\n from unnest_email_array\n\n), final as (\n\n select\n source_relation,\n _fivetran_user_id,\n unique_user_key,\n user_id,\n email,\n first_name,\n last_name,\n signup_date,\n signup_source,\n updated_at,\n phone_number,\n is_current,\n email_list_ids,\n list_id,\n md5(cast(coalesce(cast(source_relation as TEXT), '_dbt_utils_surrogate_key_null_') || '-' || coalesce(cast(unique_user_key as TEXT), '_dbt_utils_surrogate_key_null_') || '-' || coalesce(cast(list_id as TEXT), '_dbt_utils_surrogate_key_null_') || '-' || coalesce(cast(updated_at as TEXT), '_dbt_utils_surrogate_key_null_') as TEXT)) as unique_key,\n cast( date_trunc('day', updated_at) as date) as date_day\n\n --The below script allows for pass through columns.\n \n\n\n\n\n\n from adjust_nulls\n)\n\nselect *\nfrom final", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.int_iterable__latest_template": {"database": "postgres", "schema": "public_iterable_dev", "name": "int_iterable__latest_template", "resource_type": "model", "package_name": "iterable", "path": "intermediate/int_iterable__latest_template.sql", "original_file_path": "models/intermediate/int_iterable__latest_template.sql", "unique_id": "model.iterable.int_iterable__latest_template", "fqn": ["iterable", "intermediate", "int_iterable__latest_template"], "alias": "int_iterable__latest_template", "checksum": {"name": "sha256", "checksum": "44d385d803b47bd9be4b5bfc6d78b88689e9c113d478ba8feb96f91717f45b3b"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "Table that provides the most recent version of the template as well as joining relevant message type information.", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "iterable://models/intermediate/int_iterable.yml", "build_path": null, "unrendered_config": {"materialized": "view", "schema": "iterable_{{ var('directed_schema','dev') }}", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789079004.2965682, "relation_name": "\"postgres\".\"public_iterable_dev\".\"int_iterable__latest_template\"", "raw_code": "with template_history as (\n select *\n from {{ ref('stg_iterable__template_history') }}\n\n), order_template as (\n select\n *,\n row_number() over(partition by template_id{{ fivetran_utils.partition_by_source_relation(package_name='iterable') }} order by updated_at desc) as latest_template_index\n from template_history\n\n), latest_template as (\n\n select *\n from order_template\n where latest_template_index = 1\n\n), message_type_channel as (\n\n select *\n from {{ ref('int_iterable__message_type_channel') }}\n\n), template_join as (\n\n select \n latest_template.*,\n message_type_channel.message_type_name,\n message_type_channel.channel_id,\n message_type_channel.channel_name,\n message_type_channel.channel_type,\n message_type_channel.message_medium\n\n from latest_template \n left join message_type_channel\n on latest_template.message_type_id = message_type_channel.message_type_id\n and latest_template.source_relation = message_type_channel.source_relation\n)\n\nselect *\nfrom template_join", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__template_history", "package": null, "version": null}, {"name": "int_iterable__message_type_channel", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.fivetran_utils.partition_by_source_relation"], "nodes": ["model.iterable.stg_iterable__template_history", "model.iterable.int_iterable__message_type_channel"]}, "compiled_path": "target/compiled/iterable/models/intermediate/int_iterable__latest_template.sql", "compiled": true, "compiled_code": "with template_history as (\n select *\n from \"postgres\".\"public_iterable_dev\".\"stg_iterable__template_history\"\n\n), order_template as (\n select\n *,\n row_number() over(partition by template_id order by updated_at desc) as latest_template_index\n from template_history\n\n), latest_template as (\n\n select *\n from order_template\n where latest_template_index = 1\n\n), message_type_channel as (\n\n select *\n from \"postgres\".\"public_iterable_dev\".\"int_iterable__message_type_channel\"\n\n), template_join as (\n\n select \n latest_template.*,\n message_type_channel.message_type_name,\n message_type_channel.channel_id,\n message_type_channel.channel_name,\n message_type_channel.channel_type,\n message_type_channel.message_medium\n\n from latest_template \n left join message_type_channel\n on latest_template.message_type_id = message_type_channel.message_type_id\n and latest_template.source_relation = message_type_channel.source_relation\n)\n\nselect *\nfrom template_join", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.int_iterable__campaign_event_metrics": {"database": "postgres", "schema": "public_iterable_dev", "name": "int_iterable__campaign_event_metrics", "resource_type": "model", "package_name": "iterable", "path": "intermediate/int_iterable__campaign_event_metrics.sql", "original_file_path": "models/intermediate/int_iterable__campaign_event_metrics.sql", "unique_id": "model.iterable.int_iterable__campaign_event_metrics", "fqn": ["iterable", "intermediate", "int_iterable__campaign_event_metrics"], "alias": "int_iterable__campaign_event_metrics", "checksum": {"name": "sha256", "checksum": "81038e93b6f7f8151fb0d719780a87ebc5bd95b613431564e7c470121a174e26"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "Table that generates relevant total and unique campaign/experiment level aggregations.", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "iterable://models/intermediate/int_iterable.yml", "build_path": null, "unrendered_config": {"materialized": "view", "schema": "iterable_{{ var('directed_schema','dev') }}", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789079004.2950556, "relation_name": "\"postgres\".\"public_iterable_dev\".\"int_iterable__campaign_event_metrics\"", "raw_code": "with user_campaign as (\n select *\n from {{ ref('iterable__user_campaign') }}\n\n), campaign_user_event_metrics as (\n{%- set using_event_extension = var('iterable__using_event_extension', True) %}\n{%- set user_campaign_columns = adapter.get_columns_in_relation(ref('iterable__user_campaign')) %}\n{%- set non_agg_columns = ['source_relation', 'unique_user_key', 'user_id', '_fivetran_user_id', \n 'user_email', 'user_full_name', 'campaign_id', 'campaign_name', 'recurring_campaign_id', \n 'recurring_campaign_name', 'first_event_at', 'last_event_at', 'template_id', 'template_name', \n 'experiment_id', 'unique_user_campaign_id', 'first_open_or_click_event_at'\n ] %}\n\n select\n source_relation,\n campaign_id,\n template_id\n {{ \", experiment_id\" if using_event_extension }}\n , count(distinct unique_user_key) as count_unique_users\n {% for col in user_campaign_columns if col.name|lower not in non_agg_columns %}\n , sum({{ col.name }}) as {{ col.name }}\n , count(distinct case when {{ col.name }} > 0 then user_email else null end) as unique_{{ col.name }}\n {% endfor %}\n \n from user_campaign\n \n {{ dbt_utils.group_by(n=4 if using_event_extension else 3) }}\n)\n\nselect *\nfrom campaign_user_event_metrics", "doc_blocks": [], "language": "sql", "refs": [{"name": "iterable__user_campaign", "package": null, "version": null}, {"name": "iterable__user_campaign", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt_utils.group_by"], "nodes": ["model.iterable.iterable__user_campaign"]}, "compiled_path": "target/compiled/iterable/models/intermediate/int_iterable__campaign_event_metrics.sql", "compiled": true, "compiled_code": "with user_campaign as (\n select *\n from \"postgres\".\"public_iterable_dev\".\"iterable__user_campaign\"\n\n), campaign_user_event_metrics as (\n\n select\n source_relation,\n campaign_id,\n template_id\n , experiment_id\n , count(distinct unique_user_key) as count_unique_users\n \n , sum(total_emailclick) as total_emailclick\n , count(distinct case when total_emailclick > 0 then user_email else null end) as unique_total_emailclick\n \n , sum(total_emailunsubscribe) as total_emailunsubscribe\n , count(distinct case when total_emailunsubscribe > 0 then user_email else null end) as unique_total_emailunsubscribe\n \n , sum(total_emailcomplaint) as total_emailcomplaint\n , count(distinct case when total_emailcomplaint > 0 then user_email else null end) as unique_total_emailcomplaint\n \n , sum(total_customevent) as total_customevent\n , count(distinct case when total_customevent > 0 then user_email else null end) as unique_total_customevent\n \n , sum(total_emailsubscribe) as total_emailsubscribe\n , count(distinct case when total_emailsubscribe > 0 then user_email else null end) as unique_total_emailsubscribe\n \n , sum(total_emailopen) as total_emailopen\n , count(distinct case when total_emailopen > 0 then user_email else null end) as unique_total_emailopen\n \n , sum(total_pushsend) as total_pushsend\n , count(distinct case when total_pushsend > 0 then user_email else null end) as unique_total_pushsend\n \n , sum(total_smsbounce) as total_smsbounce\n , count(distinct case when total_smsbounce > 0 then user_email else null end) as unique_total_smsbounce\n \n , sum(total_pushbounce) as total_pushbounce\n , count(distinct case when total_pushbounce > 0 then user_email else null end) as unique_total_pushbounce\n \n , sum(total_inappsendskip) as total_inappsendskip\n , count(distinct case when total_inappsendskip > 0 then user_email else null end) as unique_total_inappsendskip\n \n , sum(total_smssend) as total_smssend\n , count(distinct case when total_smssend > 0 then user_email else null end) as unique_total_smssend\n \n , sum(total_inappsend) as total_inappsend\n , count(distinct case when total_inappsend > 0 then user_email else null end) as unique_total_inappsend\n \n , sum(total_pushopen) as total_pushopen\n , count(distinct case when total_pushopen > 0 then user_email else null end) as unique_total_pushopen\n \n , sum(total_emailsend) as total_emailsend\n , count(distinct case when total_emailsend > 0 then user_email else null end) as unique_total_emailsend\n \n , sum(total_pushsendskip) as total_pushsendskip\n , count(distinct case when total_pushsendskip > 0 then user_email else null end) as unique_total_pushsendskip\n \n , sum(total_inappopen) as total_inappopen\n , count(distinct case when total_inappopen > 0 then user_email else null end) as unique_total_inappopen\n \n , sum(total_emailsendskip) as total_emailsendskip\n , count(distinct case when total_emailsendskip > 0 then user_email else null end) as unique_total_emailsendskip\n \n , sum(total_emailbounce) as total_emailbounce\n , count(distinct case when total_emailbounce > 0 then user_email else null end) as unique_total_emailbounce\n \n , sum(total_inappclick) as total_inappclick\n , count(distinct case when total_inappclick > 0 then user_email else null end) as unique_total_inappclick\n \n , sum(total_pushuninstall) as total_pushuninstall\n , count(distinct case when total_pushuninstall > 0 then user_email else null end) as unique_total_pushuninstall\n \n \n from user_campaign\n \n group by 1,2,3,4\n)\n\nselect *\nfrom campaign_user_event_metrics", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.int_iterable__campaign_lists": {"database": "postgres", "schema": "public_iterable_dev", "name": "int_iterable__campaign_lists", "resource_type": "model", "package_name": "iterable", "path": "intermediate/int_iterable__campaign_lists.sql", "original_file_path": "models/intermediate/int_iterable__campaign_lists.sql", "unique_id": "model.iterable.int_iterable__campaign_lists", "fqn": ["iterable", "intermediate", "int_iterable__campaign_lists"], "alias": "int_iterable__campaign_lists", "checksum": {"name": "sha256", "checksum": "33c167f12bf4fadb7316af985f2b60ee9989ade1a428d684037465d1a449685e"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "Table that identifies the suppressed and send lists associated with a campaign.", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "iterable://models/intermediate/int_iterable.yml", "build_path": null, "unrendered_config": {"materialized": "view", "schema": "iterable_{{ var('directed_schema','dev') }}", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789079004.2956827, "relation_name": "\"postgres\".\"public_iterable_dev\".\"int_iterable__campaign_lists\"", "raw_code": "with \n\n{% if var('iterable__using_campaign_suppression_list_history', True) %}\n\ncampaign_suppression_list_history as (\n\n select *\n from {{ ref('stg_iterable__campaign_suppression_list_history') }}\n\n), \n\n{% endif %}\n\ncampaign_send_list_history as (\n\n select *\n from {{ ref('stg_iterable__campaign_list_history') }}\n\n), combine_list_histories as (\n\n{% if var('iterable__using_campaign_suppression_list_history', True) %}\n\n select\n source_relation,\n suppressed_list_id as list_id,\n campaign_id,\n updated_at,\n 'suppress' as list_activity\n from campaign_suppression_list_history\n\n union all\n\n{% endif %}\n\n select\n source_relation,\n list_id,\n campaign_id,\n updated_at,\n 'send' as list_activity\n from campaign_send_list_history\n\n), order_campaign_list_history as (\n\n select\n *,\n row_number() over(partition by list_id, campaign_id{{ fivetran_utils.partition_by_source_relation(package_name='iterable') }} order by updated_at desc) as latest_list_index\n from combine_list_histories\n\n), latest_campaign_list_history as (\n\n select\n source_relation,\n list_id,\n campaign_id,\n updated_at,\n list_activity\n\n from order_campaign_list_history\n where latest_list_index = 1\n)\n\nselect *\nfrom latest_campaign_list_history", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__campaign_suppression_list_history", "package": null, "version": null}, {"name": "stg_iterable__campaign_list_history", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.fivetran_utils.partition_by_source_relation"], "nodes": ["model.iterable.stg_iterable__campaign_suppression_list_history", "model.iterable.stg_iterable__campaign_list_history"]}, "compiled_path": "target/compiled/iterable/models/intermediate/int_iterable__campaign_lists.sql", "compiled": true, "compiled_code": "with \n\n\n\ncampaign_suppression_list_history as (\n\n select *\n from \"postgres\".\"public_iterable_dev\".\"stg_iterable__campaign_suppression_list_history\"\n\n), \n\n\n\ncampaign_send_list_history as (\n\n select *\n from \"postgres\".\"public_iterable_dev\".\"stg_iterable__campaign_list_history\"\n\n), combine_list_histories as (\n\n\n\n select\n source_relation,\n suppressed_list_id as list_id,\n campaign_id,\n updated_at,\n 'suppress' as list_activity\n from campaign_suppression_list_history\n\n union all\n\n\n\n select\n source_relation,\n list_id,\n campaign_id,\n updated_at,\n 'send' as list_activity\n from campaign_send_list_history\n\n), order_campaign_list_history as (\n\n select\n *,\n row_number() over(partition by list_id, campaign_id order by updated_at desc) as latest_list_index\n from combine_list_histories\n\n), latest_campaign_list_history as (\n\n select\n source_relation,\n list_id,\n campaign_id,\n updated_at,\n list_activity\n\n from order_campaign_list_history\n where latest_list_index = 1\n)\n\nselect *\nfrom latest_campaign_list_history", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.int_iterable__recurring_campaigns": {"database": "postgres", "schema": "public_iterable_dev", "name": "int_iterable__recurring_campaigns", "resource_type": "model", "package_name": "iterable", "path": "intermediate/int_iterable__recurring_campaigns.sql", "original_file_path": "models/intermediate/int_iterable__recurring_campaigns.sql", "unique_id": "model.iterable.int_iterable__recurring_campaigns", "fqn": ["iterable", "intermediate", "int_iterable__recurring_campaigns"], "alias": "int_iterable__recurring_campaigns", "checksum": {"name": "sha256", "checksum": "177c12b9779cfd975d0de322b8ccfc36bdecb1f509262c02ca1c8cb7035926d8"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "Table that identifies when a campaign is associated with a recurring campaign and provides additional enriched recurring campaign information.", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "iterable://models/intermediate/int_iterable.yml", "build_path": null, "unrendered_config": {"materialized": "view", "schema": "iterable_{{ var('directed_schema','dev') }}", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789079004.297988, "relation_name": "\"postgres\".\"public_iterable_dev\".\"int_iterable__recurring_campaigns\"", "raw_code": "with latest_campaign as (\n\n select * \n from {{ ref('int_iterable__latest_campaign') }}\n\n), recurring_campaign_join as (\n select\n latest_campaign.source_relation,\n latest_campaign.campaign_id,\n latest_campaign.campaign_name,\n latest_campaign.updated_at,\n latest_campaign.campaign_state,\n latest_campaign.campaign_type,\n latest_campaign.send_size,\n latest_campaign.start_at,\n latest_campaign.ended_at,\n latest_campaign.created_at,\n latest_campaign.created_by_user_id,\n latest_campaign.template_id,\n latest_campaign.recurring_campaign_id,\n {% if var('iterable__using_journey', true) %}\n -- cast to string so this matches journey_id in stg_iterable__journey; workflow_id arrives\n -- numeric from campaign_history but as a string from event_extension\n cast(latest_campaign.workflow_id as {{ dbt.type_string() }}) as journey_id,\n {% endif %}\n\n recurring_campaign.campaign_name as recurring_campaign_name,\n recurring_campaign.campaign_state as recurring_campaign_state,\n recurring_campaign.send_size as recurring_campaign_send_size,\n recurring_campaign.start_at as recurring_campaign_start_at\n\n from latest_campaign\n\n left join latest_campaign as recurring_campaign\n on latest_campaign.recurring_campaign_id = recurring_campaign.campaign_id\n and latest_campaign.source_relation = recurring_campaign.source_relation\n\n), final as (\n\n select\n recurring_campaign_join.*,\n case when latest_campaign.recurring_campaign_id is not null then true \n else false end as is_campaign_recurring\n\n from recurring_campaign_join\n left join latest_campaign on recurring_campaign_join.campaign_id = latest_campaign.recurring_campaign_id\n and recurring_campaign_join.template_id = latest_campaign.template_id\n and recurring_campaign_join.source_relation = latest_campaign.source_relation\n)\n\nselect *\nfrom final", "doc_blocks": [], "language": "sql", "refs": [{"name": "int_iterable__latest_campaign", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.type_string"], "nodes": ["model.iterable.int_iterable__latest_campaign"]}, "compiled_path": "target/compiled/iterable/models/intermediate/int_iterable__recurring_campaigns.sql", "compiled": true, "compiled_code": "with latest_campaign as (\n\n select * \n from \"postgres\".\"public_iterable_dev\".\"int_iterable__latest_campaign\"\n\n), recurring_campaign_join as (\n select\n latest_campaign.source_relation,\n latest_campaign.campaign_id,\n latest_campaign.campaign_name,\n latest_campaign.updated_at,\n latest_campaign.campaign_state,\n latest_campaign.campaign_type,\n latest_campaign.send_size,\n latest_campaign.start_at,\n latest_campaign.ended_at,\n latest_campaign.created_at,\n latest_campaign.created_by_user_id,\n latest_campaign.template_id,\n latest_campaign.recurring_campaign_id,\n \n -- cast to string so this matches journey_id in stg_iterable__journey; workflow_id arrives\n -- numeric from campaign_history but as a string from event_extension\n cast(latest_campaign.workflow_id as TEXT) as journey_id,\n \n\n recurring_campaign.campaign_name as recurring_campaign_name,\n recurring_campaign.campaign_state as recurring_campaign_state,\n recurring_campaign.send_size as recurring_campaign_send_size,\n recurring_campaign.start_at as recurring_campaign_start_at\n\n from latest_campaign\n\n left join latest_campaign as recurring_campaign\n on latest_campaign.recurring_campaign_id = recurring_campaign.campaign_id\n and latest_campaign.source_relation = recurring_campaign.source_relation\n\n), final as (\n\n select\n recurring_campaign_join.*,\n case when latest_campaign.recurring_campaign_id is not null then true \n else false end as is_campaign_recurring\n\n from recurring_campaign_join\n left join latest_campaign on recurring_campaign_join.campaign_id = latest_campaign.recurring_campaign_id\n and recurring_campaign_join.template_id = latest_campaign.template_id\n and recurring_campaign_join.source_relation = latest_campaign.source_relation\n)\n\nselect *\nfrom final", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.int_iterable__list_user_history": {"database": "postgres", "schema": "public_iterable_dev", "name": "int_iterable__list_user_history", "resource_type": "model", "package_name": "iterable", "path": "intermediate/int_iterable__list_user_history.sql", "original_file_path": "models/intermediate/int_iterable__list_user_history.sql", "unique_id": "model.iterable.int_iterable__list_user_history", "fqn": ["iterable", "intermediate", "int_iterable__list_user_history"], "alias": "int_iterable__list_user_history", "checksum": {"name": "sha256", "checksum": "26b2bd189944dfea25bb63edf9e3da03a3e8169e3501b894716e8d1f8e1df5a0"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "table", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "Table that provides a history of all lists the user has been associated with.", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "iterable://models/intermediate/int_iterable.yml", "build_path": null, "unrendered_config": {"materialized": "table", "schema": "iterable_{{ var('directed_schema','dev') }}", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789079004.297139, "relation_name": "\"postgres\".\"public_iterable_dev\".\"int_iterable__list_user_history\"", "raw_code": "-- this model will serve to extract only email-list changes\nwith user_history as (\n\n select *\n from {{ ref('stg_iterable__user_history') }}\n\n), previous_email_list_ids as (\n\n select\n *,\n lag(email_list_ids) over(partition by unique_user_key{{ fivetran_utils.partition_by_source_relation(package_name='iterable') }} order by updated_at asc) as previous_ids -- partition by email instead of unique_user_key here since this model is only for email-list users\n\n from user_history\n\n), only_new_email_list_ids as (\n\n select\n source_relation,\n _fivetran_user_id,\n unique_user_key,\n user_id,\n email,\n first_name,\n last_name,\n email_list_ids,\n phone_number,\n signup_date,\n signup_source,\n updated_at\n\n --The below script allows for pass through columns.\n {{ fivetran_utils.persist_pass_through_columns(pass_through_variable='iterable_user_history_pass_through_columns', identifier='previous_email_list_ids') }}\n\n from previous_email_list_ids\n where email_list_ids != coalesce(previous_ids, 'this is new') -- list ids are always stored in their arrays in numerical order\n\n), most_recent_list_ids as (\n\n select\n *,\n row_number() over(partition by email{{ fivetran_utils.partition_by_source_relation(package_name='iterable') }} order by updated_at desc) as latest_user_index\n\n from only_new_email_list_ids\n\n), final as (\n\n select\n source_relation,\n _fivetran_user_id,\n unique_user_key,\n email,\n user_id,\n first_name,\n last_name,\n email_list_ids,\n phone_number,\n signup_date,\n signup_source,\n updated_at,\n latest_user_index = 1 as is_current\n\n --The below script allows for pass through columns.\n {{ fivetran_utils.persist_pass_through_columns(pass_through_variable='iterable_user_history_pass_through_columns', identifier='most_recent_list_ids') }}\n\n from most_recent_list_ids\n)\n\nselect * from final", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__user_history", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.fivetran_utils.partition_by_source_relation", "macro.fivetran_utils.persist_pass_through_columns"], "nodes": ["model.iterable.stg_iterable__user_history"]}, "compiled_path": "target/compiled/iterable/models/intermediate/int_iterable__list_user_history.sql", "compiled": true, "compiled_code": "-- this model will serve to extract only email-list changes\nwith user_history as (\n\n select *\n from \"postgres\".\"public_iterable_dev\".\"stg_iterable__user_history\"\n\n), previous_email_list_ids as (\n\n select\n *,\n lag(email_list_ids) over(partition by unique_user_key order by updated_at asc) as previous_ids -- partition by email instead of unique_user_key here since this model is only for email-list users\n\n from user_history\n\n), only_new_email_list_ids as (\n\n select\n source_relation,\n _fivetran_user_id,\n unique_user_key,\n user_id,\n email,\n first_name,\n last_name,\n email_list_ids,\n phone_number,\n signup_date,\n signup_source,\n updated_at\n\n --The below script allows for pass through columns.\n \n\n\n\n\n\n from previous_email_list_ids\n where email_list_ids != coalesce(previous_ids, 'this is new') -- list ids are always stored in their arrays in numerical order\n\n), most_recent_list_ids as (\n\n select\n *,\n row_number() over(partition by email order by updated_at desc) as latest_user_index\n\n from only_new_email_list_ids\n\n), final as (\n\n select\n source_relation,\n _fivetran_user_id,\n unique_user_key,\n email,\n user_id,\n first_name,\n last_name,\n email_list_ids,\n phone_number,\n signup_date,\n signup_source,\n updated_at,\n latest_user_index = 1 as is_current\n\n --The below script allows for pass through columns.\n \n\n\n\n\n\n from most_recent_list_ids\n)\n\nselect * from final", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.int_iterable__message_type_channel": {"database": "postgres", "schema": "public_iterable_dev", "name": "int_iterable__message_type_channel", "resource_type": "model", "package_name": "iterable", "path": "intermediate/int_iterable__message_type_channel.sql", "original_file_path": "models/intermediate/int_iterable__message_type_channel.sql", "unique_id": "model.iterable.int_iterable__message_type_channel", "fqn": ["iterable", "intermediate", "int_iterable__message_type_channel"], "alias": "int_iterable__message_type_channel", "checksum": {"name": "sha256", "checksum": "9f54e0a46c508fbe16514b8e598ee614b3462649f85582b5513905f6392d728d"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "Table that joins the message type and channel records together into one comprehensive model to be referenced downstream.", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "iterable://models/intermediate/int_iterable.yml", "build_path": null, "unrendered_config": {"materialized": "view", "schema": "iterable_{{ var('directed_schema','dev') }}", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789079004.297692, "relation_name": "\"postgres\".\"public_iterable_dev\".\"int_iterable__message_type_channel\"", "raw_code": "with message_type as (\n\n select *\n from {{ ref('stg_iterable__message_type') }}\n\n), channel as (\n\n select *\n from {{ ref('stg_iterable__channel') }}\n\n), final as (\n\n select \n channel.*,\n message_type.message_type_name,\n message_type.message_type_id\n from channel\n left join message_type\n on channel.channel_id = message_type.channel_id\n and channel.source_relation = message_type.source_relation\n)\n\nselect *\nfrom final", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__message_type", "package": null, "version": null}, {"name": "stg_iterable__channel", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": [], "nodes": ["model.iterable.stg_iterable__message_type", "model.iterable.stg_iterable__channel"]}, "compiled_path": "target/compiled/iterable/models/intermediate/int_iterable__message_type_channel.sql", "compiled": true, "compiled_code": "with message_type as (\n\n select *\n from \"postgres\".\"public_iterable_dev\".\"stg_iterable__message_type\"\n\n), channel as (\n\n select *\n from \"postgres\".\"public_iterable_dev\".\"stg_iterable__channel\"\n\n), final as (\n\n select \n channel.*,\n message_type.message_type_name,\n message_type.message_type_id\n from channel\n left join message_type\n on channel.channel_id = message_type.channel_id\n and channel.source_relation = message_type.source_relation\n)\n\nselect *\nfrom final", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.int_iterable__user_event_metrics": {"database": "postgres", "schema": "public_iterable_dev", "name": "int_iterable__user_event_metrics", "resource_type": "model", "package_name": "iterable", "path": "intermediate/int_iterable__user_event_metrics.sql", "original_file_path": "models/intermediate/int_iterable__user_event_metrics.sql", "unique_id": "model.iterable.int_iterable__user_event_metrics", "fqn": ["iterable", "intermediate", "int_iterable__user_event_metrics"], "alias": "int_iterable__user_event_metrics", "checksum": {"name": "sha256", "checksum": "56af49e00fd9cad13663d8bf802187ff1d12561fb1fd9d3732d182703b34ca4d"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "Table that generates user aggregations at the campaign level.", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "iterable://models/intermediate/int_iterable.yml", "build_path": null, "unrendered_config": {"materialized": "view", "schema": "iterable_{{ var('directed_schema','dev') }}", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789079004.2982738, "relation_name": "\"postgres\".\"public_iterable_dev\".\"int_iterable__user_event_metrics\"", "raw_code": "with user_campaign as (\n\n select *\n from {{ ref('iterable__user_campaign') }}\n\n), user_event_metrics as (\n\n{%- set user_campaign_columns = adapter.get_columns_in_relation(ref('iterable__user_campaign')) %}\n{%- set non_agg_columns = ['source_relation', 'unique_user_key', 'user_id', '_fivetran_user_id', \n 'user_email', 'user_full_name', 'campaign_id', 'campaign_name', 'recurring_campaign_id', \n 'recurring_campaign_name', 'first_event_at', 'last_event_at', 'template_id', 'template_name', \n 'experiment_id', 'unique_user_campaign_id', 'first_open_or_click_event_at'\n ] %}\n\n select\n source_relation,\n _fivetran_user_id,\n unique_user_key,\n user_id,\n user_email,\n count(distinct campaign_id) as count_total_campaigns,\n min(first_event_at) as first_event_at,\n max(last_event_at) as last_event_at\n\n {% for col in user_campaign_columns if col.name|lower not in non_agg_columns %}\n , sum({{ col.name }}) as {{ col.name }}\n {% endfor %}\n\n from user_campaign\n {{ dbt_utils.group_by(n=5) }}\n\n)\n\nselect *\nfrom user_event_metrics", "doc_blocks": [], "language": "sql", "refs": [{"name": "iterable__user_campaign", "package": null, "version": null}, {"name": "iterable__user_campaign", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt_utils.group_by"], "nodes": ["model.iterable.iterable__user_campaign"]}, "compiled_path": "target/compiled/iterable/models/intermediate/int_iterable__user_event_metrics.sql", "compiled": true, "compiled_code": "with user_campaign as (\n\n select *\n from \"postgres\".\"public_iterable_dev\".\"iterable__user_campaign\"\n\n), user_event_metrics as (\n\n select\n source_relation,\n _fivetran_user_id,\n unique_user_key,\n user_id,\n user_email,\n count(distinct campaign_id) as count_total_campaigns,\n min(first_event_at) as first_event_at,\n max(last_event_at) as last_event_at\n\n \n , sum(total_emailclick) as total_emailclick\n \n , sum(total_emailunsubscribe) as total_emailunsubscribe\n \n , sum(total_emailcomplaint) as total_emailcomplaint\n \n , sum(total_customevent) as total_customevent\n \n , sum(total_emailsubscribe) as total_emailsubscribe\n \n , sum(total_emailopen) as total_emailopen\n \n , sum(total_pushsend) as total_pushsend\n \n , sum(total_smsbounce) as total_smsbounce\n \n , sum(total_pushbounce) as total_pushbounce\n \n , sum(total_inappsendskip) as total_inappsendskip\n \n , sum(total_smssend) as total_smssend\n \n , sum(total_inappsend) as total_inappsend\n \n , sum(total_pushopen) as total_pushopen\n \n , sum(total_emailsend) as total_emailsend\n \n , sum(total_pushsendskip) as total_pushsendskip\n \n , sum(total_inappopen) as total_inappopen\n \n , sum(total_emailsendskip) as total_emailsendskip\n \n , sum(total_emailbounce) as total_emailbounce\n \n , sum(total_inappclick) as total_inappclick\n \n , sum(total_pushuninstall) as total_pushuninstall\n \n\n from user_campaign\n group by 1,2,3,4,5\n\n)\n\nselect *\nfrom user_event_metrics", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.int_iterable__latest_user": {"database": "postgres", "schema": "public_iterable_dev", "name": "int_iterable__latest_user", "resource_type": "model", "package_name": "iterable", "path": "intermediate/int_iterable__latest_user.sql", "original_file_path": "models/intermediate/int_iterable__latest_user.sql", "unique_id": "model.iterable.int_iterable__latest_user", "fqn": ["iterable", "intermediate", "int_iterable__latest_user"], "alias": "int_iterable__latest_user", "checksum": {"name": "sha256", "checksum": "580070cfbe396b904d0dc15669eefe5b9f017005d0aa91aa2c3d96b4e4686e81"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "Table that filters out historical versions of the user, and returns only the most recent version.", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "iterable://models/intermediate/int_iterable.yml", "build_path": null, "unrendered_config": {"materialized": "view", "schema": "iterable_{{ var('directed_schema','dev') }}", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789079004.2968426, "relation_name": "\"postgres\".\"public_iterable_dev\".\"int_iterable__latest_user\"", "raw_code": "with user_history as (\n select *\n from {{ ref('stg_iterable__user_history') }}\n\n), latest_user as (\n select\n *,\n row_number() over(partition by unique_user_key{{ fivetran_utils.partition_by_source_relation(package_name='iterable') }} order by updated_at desc) as latest_user_index\n from user_history\n)\n\nselect *\nfrom latest_user\nwhere latest_user_index = 1", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__user_history", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.fivetran_utils.partition_by_source_relation"], "nodes": ["model.iterable.stg_iterable__user_history"]}, "compiled_path": "target/compiled/iterable/models/intermediate/int_iterable__latest_user.sql", "compiled": true, "compiled_code": "with user_history as (\n select *\n from \"postgres\".\"public_iterable_dev\".\"stg_iterable__user_history\"\n\n), latest_user as (\n select\n *,\n row_number() over(partition by unique_user_key order by updated_at desc) as latest_user_index\n from user_history\n)\n\nselect *\nfrom latest_user\nwhere latest_user_index = 1", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.int_iterable__latest_campaign": {"database": "postgres", "schema": "public_iterable_dev", "name": "int_iterable__latest_campaign", "resource_type": "model", "package_name": "iterable", "path": "intermediate/int_iterable__latest_campaign.sql", "original_file_path": "models/intermediate/int_iterable__latest_campaign.sql", "unique_id": "model.iterable.int_iterable__latest_campaign", "fqn": ["iterable", "intermediate", "int_iterable__latest_campaign"], "alias": "int_iterable__latest_campaign", "checksum": {"name": "sha256", "checksum": "8063c9ccdfe6dee1694944607534fbb31bafe2856073ac2f5ea58aa513714e4f"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "Table that filters out historical versions of the campaign, and returns the most recent campaign version.", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "iterable://models/intermediate/int_iterable.yml", "build_path": null, "unrendered_config": {"materialized": "view", "schema": "iterable_{{ var('directed_schema','dev') }}", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789079004.2962873, "relation_name": "\"postgres\".\"public_iterable_dev\".\"int_iterable__latest_campaign\"", "raw_code": "with campaign_history as (\n select *\n from {{ ref('stg_iterable__campaign_history') }}\n\n), latest_campaign as (\n select\n *,\n row_number() over(partition by campaign_id{{ fivetran_utils.partition_by_source_relation(package_name='iterable') }} order by updated_at desc) as latest_campaign_index\n from campaign_history\n)\n\nselect *\nfrom latest_campaign\nwhere latest_campaign_index = 1", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__campaign_history", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.fivetran_utils.partition_by_source_relation"], "nodes": ["model.iterable.stg_iterable__campaign_history"]}, "compiled_path": "target/compiled/iterable/models/intermediate/int_iterable__latest_campaign.sql", "compiled": true, "compiled_code": "with campaign_history as (\n select *\n from \"postgres\".\"public_iterable_dev\".\"stg_iterable__campaign_history\"\n\n), latest_campaign as (\n select\n *,\n row_number() over(partition by campaign_id order by updated_at desc) as latest_campaign_index\n from campaign_history\n)\n\nselect *\nfrom latest_campaign\nwhere latest_campaign_index = 1", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.stg_iterable__message_type": {"database": "postgres", "schema": "public_iterable_dev", "name": "stg_iterable__message_type", "resource_type": "model", "package_name": "iterable", "path": "staging/stg_iterable__message_type.sql", "original_file_path": "models/staging/stg_iterable__message_type.sql", "unique_id": "model.iterable.stg_iterable__message_type", "fqn": ["iterable", "staging", "stg_iterable__message_type"], "alias": "stg_iterable__message_type", "checksum": {"name": "sha256", "checksum": "046caf2bcc8a01dd2b8ef46a5dfb52e02b8bebe01e892de5d658910c97d5e6a4"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "table", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "Table containing unique message types.", "columns": {"source_relation": {"name": "source_relation", "description": "Identifies the record's source.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": ["doc.iterable.source_relation"]}, "message_type_id": {"name": "message_type_id", "description": "Unique identifier of the message type", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "message_type_name": {"name": "message_type_name", "description": "User defined name of the message type", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "channel_id": {"name": "channel_id", "description": "Channel that this message type belongs to", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "message_type_created_at": {"name": "message_type_created_at", "description": "Time when the message type was initially created", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "frequency_cap": {"name": "frequency_cap", "description": "The maximum number of times a message of this type can be sent to a recipient within a specified time period to prevent over-messaging", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "rate_limit_per_minute": {"name": "rate_limit_per_minute", "description": "The maximum number of messages of this type that can be sent to recipients in a minute, ensuring controlled message delivery", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "subscription_policy": {"name": "subscription_policy", "description": "Information about the policy or rules governing how users can subscribe to or unsubscribe from this specific message type, like OptOut", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "message_type_updated_at": {"name": "message_type_updated_at", "description": "Time when the message type was last updated or modified", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "The time when a record was last updated by Fivetran.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": ["doc.iterable._fivetran_synced"]}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "iterable://models/staging/stg_iterable.yml", "build_path": null, "unrendered_config": {"materialized": "table", "schema": "iterable_{{ var('directed_schema','dev') }}", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789079004.3078182, "relation_name": "\"postgres\".\"public_iterable_dev\".\"stg_iterable__message_type\"", "raw_code": "with base as (\n\n select * \n from {{ ref('stg_iterable__message_type_tmp') }}\n\n),\n\nfields as (\n\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_iterable/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_iterable/macros/).\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_iterable__message_type_tmp')),\n staging_columns=get_message_type_columns()\n )\n }}\n {{ fivetran_utils.apply_source_relation(package_name='iterable') }}\n\n from base\n),\n\nfinal as (\n\n select\n source_relation,\n cast(id as {{ dbt.type_string() }} ) as message_type_id,\n name as message_type_name,\n cast(channel_id as {{ dbt.type_string() }} ) as channel_id,\n created_at as message_type_created_at,\n frequency_cap,\n rate_limit_per_minute,\n subscription_policy,\n updated_at as message_type_updated_at,\n _fivetran_synced\n from fields\n where not coalesce(_fivetran_deleted, true)\n)\n\nselect * \nfrom final", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__message_type_tmp", "package": null, "version": null}, {"name": "stg_iterable__message_type_tmp", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.iterable.get_message_type_columns", "macro.fivetran_utils.fill_staging_columns", "macro.fivetran_utils.apply_source_relation", "macro.dbt.type_string"], "nodes": ["model.iterable.stg_iterable__message_type_tmp"]}, "compiled_path": "target/compiled/iterable/models/staging/stg_iterable__message_type.sql", "compiled": true, "compiled_code": "with base as (\n\n select * \n from \"postgres\".\"public_iterable_dev\".\"stg_iterable__message_type_tmp\"\n\n),\n\nfields as (\n\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_iterable/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_iterable/macros/).\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n \n _fivetran_deleted as _fivetran_deleted,\n _fivetran_synced as _fivetran_synced,\n channel_id as channel_id,\n id as id,\n name as name,\n created_at as created_at,\n frequency_cap as frequency_cap,\n rate_limit_per_minute as rate_limit_per_minute,\n subscription_policy as subscription_policy,\n updated_at as updated_at\n \n\n\n\n\n \n \n\n\n\n\n\n, cast('postgres.public' as TEXT) as source_relation\n\n\n from base\n),\n\nfinal as (\n\n select\n source_relation,\n cast(id as TEXT ) as message_type_id,\n name as message_type_name,\n cast(channel_id as TEXT ) as channel_id,\n created_at as message_type_created_at,\n frequency_cap,\n rate_limit_per_minute,\n subscription_policy,\n updated_at as message_type_updated_at,\n _fivetran_synced\n from fields\n where not coalesce(_fivetran_deleted, true)\n)\n\nselect * \nfrom final", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.stg_iterable__event": {"database": "postgres", "schema": "public_iterable_dev", "name": "stg_iterable__event", "resource_type": "model", "package_name": "iterable", "path": "staging/stg_iterable__event.sql", "original_file_path": "models/staging/stg_iterable__event.sql", "unique_id": "model.iterable.stg_iterable__event", "fqn": ["iterable", "staging", "stg_iterable__event"], "alias": "stg_iterable__event", "checksum": {"name": "sha256", "checksum": "22ba2d21012d8301984a6fcea5b9f40f9579f5565aaea7417f7458f6fd37937b"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "Table containing individual events within campaigns.", "columns": {"source_relation": {"name": "source_relation", "description": "Identifies the record's source.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": ["doc.iterable.source_relation"]}, "event_id": {"name": "event_id", "description": "A Fivetran-created unique identifier derived from hashing campaign_id, created_at, and event_name.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_event_id": {"name": "unique_event_id", "description": "A surrogate key made up of event_id, _fivetran_user_id, and source_relation.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "campaign_id": {"name": "campaign_id", "description": "Reference to the campaign from which the event originated", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "content_id": {"name": "content_id", "description": "Reference to the content the event is associated with", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "created_at": {"name": "created_at", "description": "Creation timestamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "created_on": {"name": "created_on", "description": "Creation date", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "email": {"name": "email", "description": "Reference to the unique user the event was applied to", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "additional_properties": {"name": "additional_properties", "description": "json object containing addition event properties", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "event_name": {"name": "event_name", "description": "Name provided to the individual event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "message_bus_id": {"name": "message_bus_id", "description": "Reference to the message bus associated with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "message_id": {"name": "message_id", "description": "Reference to the message the event is associated with", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "message_type_id": {"name": "message_type_id", "description": "Reference to the type of message the event is associated with", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "recipient_state": {"name": "recipient_state", "description": "The state of the recipient upon receiving the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "status": {"name": "status", "description": "Status of the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "transactional_data": {"name": "transactional_data", "description": "Transactional data associated with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unsub_source": {"name": "unsub_source", "description": "Source of the unsubscribe event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "user_agent": {"name": "user_agent", "description": "User agent associated with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "user_agent_device": {"name": "user_agent_device", "description": "The device of the user agent", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "_fivetran_user_id": {"name": "_fivetran_user_id", "description": "A Fivetran-created unique identifier for users, derived from hashing user_id and/or email, depending on project type. This exists for users of the new schema starting Aug 2023. In the old schema, the unique identifier is email.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_user_key": {"name": "unique_user_key", "description": "The unique identifier of the user. With the new schema (Aug 2023), it is the _fivetran_user_id. This is a hash of user_id and/or email, depending on project type. If using the old schema, it is email.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "The time when a record was last updated by Fivetran.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": ["doc.iterable._fivetran_synced"]}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "iterable://models/staging/stg_iterable.yml", "build_path": null, "unrendered_config": {"materialized": "view", "schema": "iterable_{{ var('directed_schema','dev') }}", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789079004.3031285, "relation_name": "\"postgres\".\"public_iterable_dev\".\"stg_iterable__event\"", "raw_code": "{{ config( materialized = 'view' ) }}\n\nwith base as (\n\n select * \n from {{ ref('stg_iterable__event_tmp') }}\n\n),\n\nfields as (\n\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_iterable/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_iterable/macros/).\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_iterable__event_tmp')),\n staging_columns=get_event_columns()\n )\n }}\n {{ fivetran_utils.apply_source_relation(package_name='iterable') }}\n \n from base\n),\n\nfinal as (\n\n select\n source_relation,\n cast(_fivetran_id as {{ dbt.type_string() }} ) as event_id,\n {{ dbt_utils.generate_surrogate_key(['_fivetran_id','_fivetran_user_id','source_relation']) }} as unique_event_id,\n cast(_fivetran_user_id as {{ dbt.type_string() }} ) as _fivetran_user_id,\n coalesce(cast(_fivetran_user_id as {{ dbt.type_string() }} ) , email) as unique_user_key,\n cast(campaign_id as {{ dbt.type_string() }} ) as campaign_id,\n cast(content_id as {{ dbt.type_string() }} ) as content_id,\n created_at,\n cast( {{ dbt.date_trunc('day', 'created_at') }} as date) as created_on,\n lower(email) as email,\n additional_properties,\n event_name,\n cast(message_bus_id as {{ dbt.type_string() }} ) as message_bus_id,\n cast(message_id as {{ dbt.type_string() }} ) as message_id,\n cast(message_type_id as {{ dbt.type_string() }} ) as message_type_id,\n recipient_state,\n status,\n transactional_data,\n unsub_source,\n user_agent,\n user_agent_device,\n _fivetran_synced\n\n from fields\n)\n\nselect *\nfrom final", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__event_tmp", "package": null, "version": null}, {"name": "stg_iterable__event_tmp", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.iterable.get_event_columns", "macro.fivetran_utils.fill_staging_columns", "macro.fivetran_utils.apply_source_relation", "macro.dbt.type_string", "macro.dbt_utils.generate_surrogate_key", "macro.dbt.date_trunc"], "nodes": ["model.iterable.stg_iterable__event_tmp"]}, "compiled_path": "target/compiled/iterable/models/staging/stg_iterable__event.sql", "compiled": true, "compiled_code": "\n\nwith base as (\n\n select * \n from \"postgres\".\"public_iterable_dev\".\"stg_iterable__event_tmp\"\n\n),\n\nfields as (\n\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_iterable/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_iterable/macros/).\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n \n _fivetran_id as _fivetran_id,\n _fivetran_user_id as _fivetran_user_id,\n _fivetran_synced as _fivetran_synced,\n campaign_id as campaign_id,\n content_id as content_id,\n created_at as created_at,\n email as email,\n event_name as event_name,\n message_bus_id as message_bus_id,\n message_id as message_id,\n message_type_id as message_type_id,\n recipient_state as recipient_state,\n status as status,\n unsub_source as unsub_source,\n user_agent as user_agent,\n user_agent_device as user_agent_device,\n transactional_data as transactional_data,\n additional_properties as additional_properties\n \n\n\n\n\n \n \n\n\n\n\n\n, cast('postgres.public' as TEXT) as source_relation\n\n \n from base\n),\n\nfinal as (\n\n select\n source_relation,\n cast(_fivetran_id as TEXT ) as event_id,\n md5(cast(coalesce(cast(_fivetran_id as TEXT), '_dbt_utils_surrogate_key_null_') || '-' || coalesce(cast(_fivetran_user_id as TEXT), '_dbt_utils_surrogate_key_null_') || '-' || coalesce(cast(source_relation as TEXT), '_dbt_utils_surrogate_key_null_') as TEXT)) as unique_event_id,\n cast(_fivetran_user_id as TEXT ) as _fivetran_user_id,\n coalesce(cast(_fivetran_user_id as TEXT ) , email) as unique_user_key,\n cast(campaign_id as TEXT ) as campaign_id,\n cast(content_id as TEXT ) as content_id,\n created_at,\n cast( date_trunc('day', created_at) as date) as created_on,\n lower(email) as email,\n additional_properties,\n event_name,\n cast(message_bus_id as TEXT ) as message_bus_id,\n cast(message_id as TEXT ) as message_id,\n cast(message_type_id as TEXT ) as message_type_id,\n recipient_state,\n status,\n transactional_data,\n unsub_source,\n user_agent,\n user_agent_device,\n _fivetran_synced\n\n from fields\n)\n\nselect *\nfrom final", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.stg_iterable__user_unsubscribed_channel": {"database": "postgres", "schema": "public_iterable_dev", "name": "stg_iterable__user_unsubscribed_channel", "resource_type": "model", "package_name": "iterable", "path": "staging/stg_iterable__user_unsubscribed_channel.sql", "original_file_path": "models/staging/stg_iterable__user_unsubscribed_channel.sql", "unique_id": "model.iterable.stg_iterable__user_unsubscribed_channel", "fqn": ["iterable", "staging", "stg_iterable__user_unsubscribed_channel"], "alias": "stg_iterable__user_unsubscribed_channel", "checksum": {"name": "sha256", "checksum": "5c639597d14f4bb7072df74e39c2b8aaa7bf1e29c6204243035014d14a0bc6f2"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "table", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "Table containing the history of channels from which a user has unsubscribed.", "columns": {"source_relation": {"name": "source_relation", "description": "Identifies the record's source.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": ["doc.iterable.source_relation"]}, "channel_id": {"name": "channel_id", "description": "Reference to the channel from which the user unsubscribed", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unsub_channel_unique_key": {"name": "unsub_channel_unique_key", "description": "A surrogate key providing a unique key for each record. If using user_unsubscribed_channel_history, it uses '_fivetran_id', 'channel_id', 'email', 'updated_at', and 'source_relation'. If not using the history table, it uses '_fivetran_id', 'channel_id', and 'source_relation'.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "_fivetran_user_id": {"name": "_fivetran_user_id", "description": "A Fivetran-created unique identifier for users, derived from hashing user_id and/or email, depending on project type. This exists for users of the new schema starting Aug 2023. In the old schema, the unique identifier is email.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_user_key": {"name": "unique_user_key", "description": "The unique identifier of the user. With the new schema (Aug 2023), it is the _fivetran_user_id. This is a hash of user_id and/or email, depending on project type. If using the old schema, it is email.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "latest_batch_index": {"name": "latest_batch_index", "description": "Indexes each user record based on the most recent available.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "updated_at": {"name": "updated_at", "description": "Last update timestamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "The time when a record was last updated by Fivetran.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": ["doc.iterable._fivetran_synced"]}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "iterable://models/staging/stg_iterable.yml", "build_path": null, "unrendered_config": {"materialized": "table", "schema": "iterable_{{ var('directed_schema','dev') }}", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789079004.3115592, "relation_name": "\"postgres\".\"public_iterable_dev\".\"stg_iterable__user_unsubscribed_channel\"", "raw_code": "with base as (\n select *\n from {{ ref('stg_iterable__user_unsubscribed_channel_tmp') }}\n\n),\n\nfields as (\n\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_iterable/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_iterable/macros/).\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_iterable__user_unsubscribed_channel_tmp')),\n staging_columns=get_user_unsubscribed_channel_columns()\n )\n }}\n {{ fivetran_utils.apply_source_relation(package_name='iterable') }}\n\n from base\n),\n\nfinal as (\n\n select\n source_relation,\n cast(_fivetran_id as {{ dbt.type_string() }} ) as _fivetran_user_id,\n coalesce(cast(_fivetran_id as {{ dbt.type_string() }} ), email) as unique_user_key,\n cast(channel_id as {{ dbt.type_string() }} ) as channel_id,\n {{ dbt_utils.generate_surrogate_key(['_fivetran_id', 'channel_id', 'email', 'updated_at', 'source_relation']) }} as unsub_channel_unique_key,\n\n {% if does_table_exist('user_unsubscribed_channel') == false %}\n rank() over(partition by email, channel_id{{ fivetran_utils.partition_by_source_relation(package_name='iterable') }} order by updated_at desc) as latest_batch_index,\n {% else %}\n 1 as latest_batch_index,\n {% endif %}\n\n updated_at,\n _fivetran_synced\n\n from fields\n)\n\n\nselect *\nfrom final", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__user_unsubscribed_channel_tmp", "package": null, "version": null}, {"name": "stg_iterable__user_unsubscribed_channel_tmp", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.iterable.get_user_unsubscribed_channel_columns", "macro.fivetran_utils.fill_staging_columns", "macro.fivetran_utils.apply_source_relation", "macro.dbt.type_string", "macro.dbt_utils.generate_surrogate_key", "macro.iterable.does_table_exist"], "nodes": ["model.iterable.stg_iterable__user_unsubscribed_channel_tmp"]}, "compiled_path": "target/compiled/iterable/models/staging/stg_iterable__user_unsubscribed_channel.sql", "compiled": true, "compiled_code": "with base as (\n select *\n from \"postgres\".\"public_iterable_dev\".\"stg_iterable__user_unsubscribed_channel_tmp\"\n\n),\n\nfields as (\n\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_iterable/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_iterable/macros/).\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n \n _fivetran_synced as _fivetran_synced,\n _fivetran_id as _fivetran_id,\n channel_id as channel_id,\n cast(null as TEXT) as email,\n cast(null as timestamp) as updated_at\n \n\n\n\n\n \n \n\n\n\n\n\n, cast('postgres.public' as TEXT) as source_relation\n\n\n from base\n),\n\nfinal as (\n\n select\n source_relation,\n cast(_fivetran_id as TEXT ) as _fivetran_user_id,\n coalesce(cast(_fivetran_id as TEXT ), email) as unique_user_key,\n cast(channel_id as TEXT ) as channel_id,\n md5(cast(coalesce(cast(_fivetran_id as TEXT), '_dbt_utils_surrogate_key_null_') || '-' || coalesce(cast(channel_id as TEXT), '_dbt_utils_surrogate_key_null_') || '-' || coalesce(cast(email as TEXT), '_dbt_utils_surrogate_key_null_') || '-' || coalesce(cast(updated_at as TEXT), '_dbt_utils_surrogate_key_null_') || '-' || coalesce(cast(source_relation as TEXT), '_dbt_utils_surrogate_key_null_') as TEXT)) as unsub_channel_unique_key,\n\n \n 1 as latest_batch_index,\n \n\n updated_at,\n _fivetran_synced\n\n from fields\n)\n\n\nselect *\nfrom final", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.stg_iterable__campaign_history": {"database": "postgres", "schema": "public_iterable_dev", "name": "stg_iterable__campaign_history", "resource_type": "model", "package_name": "iterable", "path": "staging/stg_iterable__campaign_history.sql", "original_file_path": "models/staging/stg_iterable__campaign_history.sql", "unique_id": "model.iterable.stg_iterable__campaign_history", "fqn": ["iterable", "staging", "stg_iterable__campaign_history"], "alias": "stg_iterable__campaign_history", "checksum": {"name": "sha256", "checksum": "7e7aecc134f0b697da58c7cd663aadf6de586a55c84369c2a7274811b2bb368b"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "table", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "Table containing a history of campaigns.", "columns": {"source_relation": {"name": "source_relation", "description": "Identifies the record's source.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": ["doc.iterable.source_relation"]}, "campaign_id": {"name": "campaign_id", "description": "Unique identifier of the campaign record", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "updated_at": {"name": "updated_at", "description": "Last update timestamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "campaign_name": {"name": "campaign_name", "description": "User defined name of the campaign.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "campaign_state": {"name": "campaign_state", "description": "State of the campaign. Can be Draft, Ready, Scheduled, Running, Finished, Starting, Aborted or Recurring", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "campaign_type": {"name": "campaign_type", "description": "The campaign type. Can be Blast or Triggered", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "send_size": {"name": "send_size", "description": "Size of the campaign. Number of individuals included in the campaign", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "start_at": {"name": "start_at", "description": "Start timestamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "ended_at": {"name": "ended_at", "description": "Ended timestamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "created_at": {"name": "created_at", "description": "Creation timestamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "recurring_campaign_id": {"name": "recurring_campaign_id", "description": "Reference to the recurring campaign, if applicable", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "created_by_user_id": {"name": "created_by_user_id", "description": "Reference to the user who created the campaign", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "template_id": {"name": "template_id", "description": "Reference to the campaign template", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "updated_by_user_id": {"name": "updated_by_user_id", "description": "ID of the user who updated this record", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "message_medium": {"name": "message_medium", "description": "The medium that this message was sent via, for example Email or InApp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "workflow_id": {"name": "workflow_id", "description": "Reference to the workflow which the event originated", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "The time when a record was last updated by Fivetran.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": ["doc.iterable._fivetran_synced"]}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "iterable://models/staging/stg_iterable.yml", "build_path": null, "unrendered_config": {"materialized": "table", "schema": "iterable_{{ var('directed_schema','dev') }}", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789079004.2995934, "relation_name": "\"postgres\".\"public_iterable_dev\".\"stg_iterable__campaign_history\"", "raw_code": "with base as (\n\n select * \n from {{ ref('stg_iterable__campaign_history_tmp') }}\n\n),\n\nfields as (\n\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_iterable/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_iterable/macros/).\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_iterable__campaign_history_tmp')),\n staging_columns=get_campaign_history_columns()\n )\n }}\n {{ fivetran_utils.apply_source_relation(package_name='iterable') }}\n \n from base\n),\n\nfinal as (\n\n select\n source_relation,\n cast(id as {{ dbt.type_string() }}) as campaign_id,\n updated_at,\n name as campaign_name,\n campaign_state,\n type as campaign_type,\n send_size,\n start_at,\n ended_at,\n created_at,\n message_medium,\n cast(recurring_campaign_id as {{ dbt.type_string() }}) as recurring_campaign_id,\n cast(created_by_user_id as {{ dbt.type_string() }} ) as created_by_user_id,\n cast(updated_by_user_id as {{ dbt.type_string() }} ) as updated_by_user_id,\n cast(template_id as {{ dbt.type_string() }}) as template_id,\n workflow_id,\n _fivetran_synced\n\n from fields\n)\n\nselect * \nfrom final", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__campaign_history_tmp", "package": null, "version": null}, {"name": "stg_iterable__campaign_history_tmp", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.iterable.get_campaign_history_columns", "macro.fivetran_utils.fill_staging_columns", "macro.fivetran_utils.apply_source_relation", "macro.dbt.type_string"], "nodes": ["model.iterable.stg_iterable__campaign_history_tmp"]}, "compiled_path": "target/compiled/iterable/models/staging/stg_iterable__campaign_history.sql", "compiled": true, "compiled_code": "with base as (\n\n select * \n from \"postgres\".\"public_iterable_dev\".\"stg_iterable__campaign_history_tmp\"\n\n),\n\nfields as (\n\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_iterable/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_iterable/macros/).\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n \n _fivetran_synced as _fivetran_synced,\n campaign_state as campaign_state,\n created_at as created_at,\n created_by_user_id as created_by_user_id,\n updated_by_user_id as updated_by_user_id,\n ended_at as ended_at,\n id as id,\n name as name,\n recurring_campaign_id as recurring_campaign_id,\n send_size as send_size,\n start_at as start_at,\n template_id as template_id,\n type as type,\n updated_at as updated_at,\n workflow_id as workflow_id,\n message_medium as message_medium\n \n\n\n\n\n \n \n\n\n\n\n\n, cast('postgres.public' as TEXT) as source_relation\n\n \n from base\n),\n\nfinal as (\n\n select\n source_relation,\n cast(id as TEXT) as campaign_id,\n updated_at,\n name as campaign_name,\n campaign_state,\n type as campaign_type,\n send_size,\n start_at,\n ended_at,\n created_at,\n message_medium,\n cast(recurring_campaign_id as TEXT) as recurring_campaign_id,\n cast(created_by_user_id as TEXT ) as created_by_user_id,\n cast(updated_by_user_id as TEXT ) as updated_by_user_id,\n cast(template_id as TEXT) as template_id,\n workflow_id,\n _fivetran_synced\n\n from fields\n)\n\nselect * \nfrom final", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.stg_iterable__campaign_label_history": {"database": "postgres", "schema": "public_iterable_dev", "name": "stg_iterable__campaign_label_history", "resource_type": "model", "package_name": "iterable", "path": "staging/stg_iterable__campaign_label_history.sql", "original_file_path": "models/staging/stg_iterable__campaign_label_history.sql", "unique_id": "model.iterable.stg_iterable__campaign_label_history", "fqn": ["iterable", "staging", "stg_iterable__campaign_label_history"], "alias": "stg_iterable__campaign_label_history", "checksum": {"name": "sha256", "checksum": "2001c425039c576063482caa3d4a72f39c5cd8aff32ffee63f083977f1f0c35f"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "table", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "Table containing a history of labels.", "columns": {"source_relation": {"name": "source_relation", "description": "Identifies the record's source.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": ["doc.iterable.source_relation"]}, "campaign_id": {"name": "campaign_id", "description": "Reference to the campaign associated with the label", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "label": {"name": "label", "description": "Name of the label", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "updated_at": {"name": "updated_at", "description": "Last update timestamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "The time when a record was last updated by Fivetran.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": ["doc.iterable._fivetran_synced"]}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "iterable://models/staging/stg_iterable.yml", "build_path": null, "unrendered_config": {"materialized": "table", "schema": "iterable_{{ var('directed_schema','dev') }}", "enabled": "var('iterable__using_campaign_label_history', True)", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789079004.3003542, "relation_name": "\"postgres\".\"public_iterable_dev\".\"stg_iterable__campaign_label_history\"", "raw_code": "{{ config(enabled=var('iterable__using_campaign_label_history', True)) }}\n\nwith base as (\n\n select * \n from {{ ref('stg_iterable__campaign_label_history_tmp') }}\n\n),\n\nfields as (\n\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_iterable/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_iterable/macros/).\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_iterable__campaign_label_history_tmp')),\n staging_columns=get_campaign_label_history_columns()\n )\n }}\n {{ fivetran_utils.apply_source_relation(package_name='iterable') }}\n \n from base\n),\n\nfinal as (\n\n select\n source_relation,\n cast(campaign_id as {{ dbt.type_string() }}) as campaign_id,\n label,\n updated_at,\n _fivetran_synced\n from fields\n)\n\nselect * \nfrom final", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__campaign_label_history_tmp", "package": null, "version": null}, {"name": "stg_iterable__campaign_label_history_tmp", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.iterable.get_campaign_label_history_columns", "macro.fivetran_utils.fill_staging_columns", "macro.fivetran_utils.apply_source_relation", "macro.dbt.type_string"], "nodes": ["model.iterable.stg_iterable__campaign_label_history_tmp"]}, "compiled_path": "target/compiled/iterable/models/staging/stg_iterable__campaign_label_history.sql", "compiled": true, "compiled_code": "\n\nwith base as (\n\n select * \n from \"postgres\".\"public_iterable_dev\".\"stg_iterable__campaign_label_history_tmp\"\n\n),\n\nfields as (\n\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_iterable/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_iterable/macros/).\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n \n _fivetran_synced as _fivetran_synced,\n campaign_id as campaign_id,\n label as label,\n updated_at as updated_at\n \n\n\n\n\n \n \n\n\n\n\n\n, cast('postgres.public' as TEXT) as source_relation\n\n \n from base\n),\n\nfinal as (\n\n select\n source_relation,\n cast(campaign_id as TEXT) as campaign_id,\n label,\n updated_at,\n _fivetran_synced\n from fields\n)\n\nselect * \nfrom final", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.stg_iterable__template_history": {"database": "postgres", "schema": "public_iterable_dev", "name": "stg_iterable__template_history", "resource_type": "model", "package_name": "iterable", "path": "staging/stg_iterable__template_history.sql", "original_file_path": "models/staging/stg_iterable__template_history.sql", "unique_id": "model.iterable.stg_iterable__template_history", "fqn": ["iterable", "staging", "stg_iterable__template_history"], "alias": "stg_iterable__template_history", "checksum": {"name": "sha256", "checksum": "f0eaf9d44d7959a04ba079cbf711646772487aeafc89414b097dd5f230b44910"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "table", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "Table containing unique templates used across campaigns.", "columns": {"source_relation": {"name": "source_relation", "description": "Identifies the record's source.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": ["doc.iterable.source_relation"]}, "template_id": {"name": "template_id", "description": "Unique identifier of the template", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "template_name": {"name": "template_name", "description": "User defined name of the template", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "template_type": {"name": "template_type", "description": "The type of the template", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "created_at": {"name": "created_at", "description": "Creation timestamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "client_template_id": {"name": "client_template_id", "description": "Reference to the client template", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "creator_user_id": {"name": "creator_user_id", "description": "Reference to the user who created the template", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "message_type_id": {"name": "message_type_id", "description": "Reference to the message type associated with the template", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "updated_at": {"name": "updated_at", "description": "Last update timestamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "The time when a record was last updated by Fivetran.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": ["doc.iterable._fivetran_synced"]}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "iterable://models/staging/stg_iterable.yml", "build_path": null, "unrendered_config": {"materialized": "table", "schema": "iterable_{{ var('directed_schema','dev') }}", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789079004.3088174, "relation_name": "\"postgres\".\"public_iterable_dev\".\"stg_iterable__template_history\"", "raw_code": "with base as (\n\n select * \n from {{ ref('stg_iterable__template_history_tmp') }}\n\n),\n\nfields as (\n\n select\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_iterable__template_history_tmp')),\n staging_columns=get_template_history_columns()\n )\n }}\n {{ fivetran_utils.apply_source_relation(package_name='iterable') }}\n\n from base\n),\n\nfinal as (\n\n select\n source_relation,\n cast(id as {{ dbt.type_string() }} ) as template_id,\n name as template_name,\n template_type,\n created_at,\n cast(client_template_id as {{ dbt.type_string() }} ) as client_template_id,\n cast(creator_user_id as {{ dbt.type_string() }} ) as creator_user_id,\n cast(message_type_id as {{ dbt.type_string() }} ) as message_type_id,\n updated_at,\n _fivetran_synced\n from fields\n)\n\nselect * \nfrom final", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__template_history_tmp", "package": null, "version": null}, {"name": "stg_iterable__template_history_tmp", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.iterable.get_template_history_columns", "macro.fivetran_utils.fill_staging_columns", "macro.fivetran_utils.apply_source_relation", "macro.dbt.type_string"], "nodes": ["model.iterable.stg_iterable__template_history_tmp"]}, "compiled_path": "target/compiled/iterable/models/staging/stg_iterable__template_history.sql", "compiled": true, "compiled_code": "with base as (\n\n select * \n from \"postgres\".\"public_iterable_dev\".\"stg_iterable__template_history_tmp\"\n\n),\n\nfields as (\n\n select\n \n _fivetran_synced as _fivetran_synced,\n client_template_id as client_template_id,\n created_at as created_at,\n creator_user_id as creator_user_id,\n id as id,\n message_type_id as message_type_id,\n name as name,\n template_type as template_type,\n updated_at as updated_at\n \n\n\n\n\n \n \n\n\n\n\n\n, cast('postgres.public' as TEXT) as source_relation\n\n\n from base\n),\n\nfinal as (\n\n select\n source_relation,\n cast(id as TEXT ) as template_id,\n name as template_name,\n template_type,\n created_at,\n cast(client_template_id as TEXT ) as client_template_id,\n cast(creator_user_id as TEXT ) as creator_user_id,\n cast(message_type_id as TEXT ) as message_type_id,\n updated_at,\n _fivetran_synced\n from fields\n)\n\nselect * \nfrom final", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.stg_iterable__journey": {"database": "postgres", "schema": "public_iterable_dev", "name": "stg_iterable__journey", "resource_type": "model", "package_name": "iterable", "path": "staging/stg_iterable__journey.sql", "original_file_path": "models/staging/stg_iterable__journey.sql", "unique_id": "model.iterable.stg_iterable__journey", "fqn": ["iterable", "staging", "stg_iterable__journey"], "alias": "stg_iterable__journey", "checksum": {"name": "sha256", "checksum": "d53993c3137351b54f560a3e0194593ea0d2787d328e2bc6cfe13977b35a3906"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "table", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "Table containing unique journeys, formerly known as workflows.", "columns": {"source_relation": {"name": "source_relation", "description": "Identifies the record's source.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": ["doc.iterable.source_relation"]}, "journey_id": {"name": "journey_id", "description": "Unique identifier of the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "journey_name": {"name": "journey_name", "description": "User defined name of the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "journey_type": {"name": "journey_type", "description": "The journey type", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "journey_description": {"name": "journey_description", "description": "Information about the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "creator_user_id": {"name": "creator_user_id", "description": "Reference to the user who created the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "is_enabled": {"name": "is_enabled", "description": "Boolean indicating if the journey is currently enabled", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "is_archived": {"name": "is_archived", "description": "Boolean indicating if the journey has been archived", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "lifetime_limit": {"name": "lifetime_limit", "description": "Maximum number of times a user may enter the journey over their lifetime", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "simultaneous_limit": {"name": "simultaneous_limit", "description": "Maximum number of times a user may be in the journey at the same time", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "start_tile_id": {"name": "start_tile_id", "description": "Reference to the tile which begins the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "trigger_event_names": {"name": "trigger_event_names", "description": "The event names which trigger a user's entry into the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "created_at": {"name": "created_at", "description": "Creation timestamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "updated_at": {"name": "updated_at", "description": "Last update timestamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "The time when a record was last updated by Fivetran.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": ["doc.iterable._fivetran_synced"]}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "iterable://models/staging/stg_iterable.yml", "build_path": null, "unrendered_config": {"materialized": "table", "schema": "iterable_{{ var('directed_schema','dev') }}", "enabled": "var('iterable__using_journey', True)", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789079004.305471, "relation_name": "\"postgres\".\"public_iterable_dev\".\"stg_iterable__journey\"", "raw_code": "{{ config(enabled=var('iterable__using_journey', True)) }}\n\n{% set source_columns_in_relation = adapter.get_columns_in_relation(ref('stg_iterable__journey_tmp')) %}\n\nwith base as (\n\n select *\n from {{ ref('stg_iterable__journey_tmp') }}\n\n),\n\nfields as (\n\n select\n\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=source_columns_in_relation,\n staging_columns=get_journey_columns()\n )\n }}\n {{ fivetran_utils.apply_source_relation(package_name='iterable') }}\n\n from base\n),\n\nfinal as (\n\n select\n source_relation,\n cast(id as {{ dbt.type_string() }} ) as journey_id,\n name as journey_name,\n journey_type,\n description as journey_description,\n cast(creator_user_id as {{ dbt.type_string() }} ) as creator_user_id,\n enabled as is_enabled,\n is_archived,\n lifetime_limit,\n simultaneous_limit,\n cast(start_tile_id as {{ dbt.type_string() }} ) as start_tile_id,\n {{ iterable.json_to_string(\"trigger_event_names\", source_columns_in_relation) }} as trigger_event_names,\n created_at,\n updated_at,\n _fivetran_synced\n\n --The below script allows for pass through columns.\n {{ fivetran_utils.fill_pass_through_columns('iterable_journey_pass_through_columns') }}\n\n from fields\n where not coalesce(_fivetran_deleted, false)\n)\n\nselect *\nfrom final", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__journey_tmp", "package": null, "version": null}, {"name": "stg_iterable__journey_tmp", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.iterable.get_journey_columns", "macro.fivetran_utils.fill_staging_columns", "macro.fivetran_utils.apply_source_relation", "macro.dbt.type_string", "macro.iterable.json_to_string", "macro.fivetran_utils.fill_pass_through_columns"], "nodes": ["model.iterable.stg_iterable__journey_tmp"]}, "compiled_path": "target/compiled/iterable/models/staging/stg_iterable__journey.sql", "compiled": true, "compiled_code": "\n\n\n\nwith base as (\n\n select *\n from \"postgres\".\"public_iterable_dev\".\"stg_iterable__journey_tmp\"\n\n),\n\nfields as (\n\n select\n\n \n cast(null as boolean) as _fivetran_deleted,\n cast(null as timestamp) as _fivetran_synced,\n cast(null as timestamp) as created_at,\n cast(null as TEXT) as creator_user_id,\n cast(null as TEXT) as description,\n cast(null as boolean) as enabled,\n cast(null as integer) as id,\n cast(null as boolean) as is_archived,\n cast(null as TEXT) as journey_type,\n cast(null as integer) as lifetime_limit,\n cast(null as TEXT) as name,\n cast(null as integer) as simultaneous_limit,\n cast(null as integer) as start_tile_id,\n cast(null as TEXT) as trigger_event_names,\n cast(null as timestamp) as updated_at\n \n\n\n\n\n \n \n\n\n\n\n\n, cast('postgres.public' as TEXT) as source_relation\n\n\n from base\n),\n\nfinal as (\n\n select\n source_relation,\n cast(id as TEXT ) as journey_id,\n name as journey_name,\n journey_type,\n description as journey_description,\n cast(creator_user_id as TEXT ) as creator_user_id,\n enabled as is_enabled,\n is_archived,\n lifetime_limit,\n simultaneous_limit,\n cast(start_tile_id as TEXT ) as start_tile_id,\n cast(trigger_event_names as TEXT) as trigger_event_names,\n created_at,\n updated_at,\n _fivetran_synced\n\n --The below script allows for pass through columns.\n \n\n\n\n\n\n from fields\n where not coalesce(_fivetran_deleted, false)\n)\n\nselect *\nfrom final", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.stg_iterable__user_history": {"database": "postgres", "schema": "public_iterable_dev", "name": "stg_iterable__user_history", "resource_type": "model", "package_name": "iterable", "path": "staging/stg_iterable__user_history.sql", "original_file_path": "models/staging/stg_iterable__user_history.sql", "unique_id": "model.iterable.stg_iterable__user_history", "fqn": ["iterable", "staging", "stg_iterable__user_history"], "alias": "stg_iterable__user_history", "checksum": {"name": "sha256", "checksum": "632b1ddaf71b0cb861ae314c40c6a68a25371b8646d2fa2334c4eb7149227251"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "Table containing individual user history information.", "columns": {"source_relation": {"name": "source_relation", "description": "Identifies the record's source.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": ["doc.iterable.source_relation"]}, "unique_user_key": {"name": "unique_user_key", "description": "The unique identifier of the user. With the new schema (Aug 2023), it is the _fivetran_user_id. This is a hash of user_id and/or email, depending on project type. If using the old schema, it is email.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "email": {"name": "email", "description": "The user's email. User identifier, for email-based projects. Previously was the unique identifier for user records, for the old Iterable schema before the August 2023 updates.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "user_id": {"name": "user_id", "description": "User identifier, for userID-based projects.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "first_name": {"name": "first_name", "description": "First name of the user", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "last_name": {"name": "last_name", "description": "Last name of the user", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "email_list_ids": {"name": "email_list_ids", "description": "[DEPRECATED October 13, 2025. Use LIST_USER source instead.] Array of references to the lists associated with the user.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "signup_date": {"name": "signup_date", "description": "Timestamp of when the user signed up", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "signup_source": {"name": "signup_source", "description": "Source where the user signed up", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "updated_at": {"name": "updated_at", "description": "Last update timestamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "phone_number": {"name": "phone_number", "description": "Phone number associated with the user", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "iterable_user_id": {"name": "iterable_user_id", "description": "Another user identifier, for userID-based projects", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "_fivetran_user_id": {"name": "_fivetran_user_id", "description": "A Fivetran-created unique identifier for users, derived from hashing user_id and/or email, depending on project type. This exists for users of the new schema starting Aug 2023. In the old schema, the unique identifier is email.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "The time when a record was last updated by Fivetran.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": ["doc.iterable._fivetran_synced"]}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "iterable://models/staging/stg_iterable.yml", "build_path": null, "unrendered_config": {"materialized": "view", "schema": "iterable_{{ var('directed_schema','dev') }}", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789079004.3105521, "relation_name": "\"postgres\".\"public_iterable_dev\".\"stg_iterable__user_history\"", "raw_code": "{{ config(materialized='view') }}\n{% set source_columns_in_relation = adapter.get_columns_in_relation(ref('stg_iterable__user_history_tmp')) %}\n\n\nwith base as (\n\n select * \n from {{ ref('stg_iterable__user_history_tmp') }}\n\n),\n\nfields as (\n\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_iterable/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_iterable/macros/).\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=source_columns_in_relation,\n staging_columns=get_user_history_columns()\n )\n }}\n {{ fivetran_utils.apply_source_relation(package_name='iterable') }}\n\n from base\n),\n\nfinal as (\n\n select\n source_relation,\n cast(_fivetran_id as {{ dbt.type_string() }} ) as _fivetran_user_id,\n lower(email) as email,\n updated_at,\n cast(user_id as {{ dbt.type_string() }} ) as user_id,\n first_name,\n last_name,\n {{ iterable.json_to_string(\"email_list_ids\", source_columns_in_relation) }} as email_list_ids,\n phone_number,\n signup_date,\n signup_source,\n cast(iterable_user_id as {{ dbt.type_string() }} ) as iterable_user_id,\n _fivetran_synced,\n coalesce(cast(_fivetran_id as {{ dbt.type_string() }} ) , email) as unique_user_key\n\n {{ fivetran_utils.fill_pass_through_columns('iterable_user_history_pass_through_columns') }}\n\n from fields\n)\n\nselect *\nfrom final", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__user_history_tmp", "package": null, "version": null}, {"name": "stg_iterable__user_history_tmp", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.iterable.get_user_history_columns", "macro.fivetran_utils.fill_staging_columns", "macro.fivetran_utils.apply_source_relation", "macro.dbt.type_string", "macro.iterable.json_to_string", "macro.fivetran_utils.fill_pass_through_columns"], "nodes": ["model.iterable.stg_iterable__user_history_tmp"]}, "compiled_path": "target/compiled/iterable/models/staging/stg_iterable__user_history.sql", "compiled": true, "compiled_code": "\n\n\n\nwith base as (\n\n select * \n from \"postgres\".\"public_iterable_dev\".\"stg_iterable__user_history_tmp\"\n\n),\n\nfields as (\n\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_iterable/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_iterable/macros/).\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n \n cast(null as TEXT) as _fivetran_id,\n _fivetran_synced as _fivetran_synced,\n email as email,\n email_list_ids as email_list_ids,\n first_name as first_name,\n last_name as last_name,\n phone_number as phone_number,\n signup_date as signup_date,\n signup_source as signup_source,\n updated_at as updated_at,\n user_id as user_id,\n iterable_user_id as iterable_user_id\n \n\n\n\n\n \n \n\n\n\n\n\n, cast('postgres.public' as TEXT) as source_relation\n\n\n from base\n),\n\nfinal as (\n\n select\n source_relation,\n cast(_fivetran_id as TEXT ) as _fivetran_user_id,\n lower(email) as email,\n updated_at,\n cast(user_id as TEXT ) as user_id,\n first_name,\n last_name,\n cast(email_list_ids as TEXT) as email_list_ids,\n phone_number,\n signup_date,\n signup_source,\n cast(iterable_user_id as TEXT ) as iterable_user_id,\n _fivetran_synced,\n coalesce(cast(_fivetran_id as TEXT ) , email) as unique_user_key\n\n \n\n\n\n\n\n from fields\n)\n\nselect *\nfrom final", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.stg_iterable__user_unsub_message_type": {"database": "postgres", "schema": "public_iterable_dev", "name": "stg_iterable__user_unsub_message_type", "resource_type": "model", "package_name": "iterable", "path": "staging/stg_iterable__user_unsub_message_type.sql", "original_file_path": "models/staging/stg_iterable__user_unsub_message_type.sql", "unique_id": "model.iterable.stg_iterable__user_unsub_message_type", "fqn": ["iterable", "staging", "stg_iterable__user_unsub_message_type"], "alias": "stg_iterable__user_unsub_message_type", "checksum": {"name": "sha256", "checksum": "82bd48604365ec4a7a3309f2ce007e169add2c902675e5d1da155edc32a6bb71"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "table", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "Table containing the message types from which a user has unsubscribed. \"Unsubscribed\" is shortened to \"unsub\" for postgres compatibility.", "columns": {"source_relation": {"name": "source_relation", "description": "Identifies the record's source.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": ["doc.iterable.source_relation"]}, "message_type_id": {"name": "message_type_id", "description": "Reference to the message type from which the user unsubscribed", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unsub_message_type_unique_key": {"name": "unsub_message_type_unique_key", "description": "A surrogate key providing a unique key for each record. If using user_unsubscribed_message_type_history, it uses '_fivetran_id', 'email', 'message_type_id', 'updated_at', and 'source_relation'. If not using the history table, it uses '_fivetran_id', 'message_type_id', and 'source_relation'.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "_fivetran_user_id": {"name": "_fivetran_user_id", "description": "A Fivetran-created unique identifier for users, derived from hashing user_id and/or email, depending on project type. This exists for users of the new schema starting Aug 2023. In the old schema, the unique identifier is email.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_user_key": {"name": "unique_user_key", "description": "The unique identifier of the user. With the new schema (Aug 2023), it is the _fivetran_user_id. This is a hash of user_id and/or email, depending on project type. If using the old schema, it is email.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "latest_batch_index": {"name": "latest_batch_index", "description": "Indexes each user record based on the most recent available.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "updated_at": {"name": "updated_at", "description": "Last update timestamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "The time when a record was last updated by Fivetran.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": ["doc.iterable._fivetran_synced"]}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "iterable://models/staging/stg_iterable.yml", "build_path": null, "unrendered_config": {"materialized": "table", "schema": "iterable_{{ var('directed_schema','dev') }}", "enabled": "var('iterable__using_user_unsubscribed_message_type', True)", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789079004.3123887, "relation_name": "\"postgres\".\"public_iterable_dev\".\"stg_iterable__user_unsub_message_type\"", "raw_code": "{{ config(enabled=var('iterable__using_user_unsubscribed_message_type', True)) }}\n\nwith base as (\n\n select * \n from {{ ref('stg_iterable__user_unsub_message_type_tmp') }}\n\n),\n\nfields as (\n\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_iterable/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_iterable/macros/).\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_iterable__user_unsub_message_type_tmp')),\n staging_columns=get_user_unsubscribed_message_type_columns()\n )\n }}\n {{ fivetran_utils.apply_source_relation(package_name='iterable') }}\n\n from base\n),\n\nfinal as (\n\n select\n source_relation,\n cast(_fivetran_id as {{ dbt.type_string() }} ) as _fivetran_user_id,\n coalesce(cast(_fivetran_id as {{ dbt.type_string() }} ), email) as unique_user_key,\n cast(message_type_id as {{ dbt.type_string() }} ) as message_type_id,\n {{ dbt_utils.generate_surrogate_key(['_fivetran_id', 'email', 'message_type_id','updated_at','source_relation']) }} as unsub_message_type_unique_key,\n\n {% if does_table_exist('user_unsubscribed_message_type') == false %}\n rank() over(partition by email, message_type_id{{ fivetran_utils.partition_by_source_relation(package_name='iterable') }} order by updated_at desc) as latest_batch_index,\n {% else %}\n 1 as latest_batch_index,\n {% endif %}\n\n updated_at,\n _fivetran_synced\n\n from fields\n)\n\nselect *\nfrom final", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__user_unsub_message_type_tmp", "package": null, "version": null}, {"name": "stg_iterable__user_unsub_message_type_tmp", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.iterable.get_user_unsubscribed_message_type_columns", "macro.fivetran_utils.fill_staging_columns", "macro.fivetran_utils.apply_source_relation", "macro.dbt.type_string", "macro.dbt_utils.generate_surrogate_key", "macro.iterable.does_table_exist"], "nodes": ["model.iterable.stg_iterable__user_unsub_message_type_tmp"]}, "compiled_path": "target/compiled/iterable/models/staging/stg_iterable__user_unsub_message_type.sql", "compiled": true, "compiled_code": "\n\nwith base as (\n\n select * \n from \"postgres\".\"public_iterable_dev\".\"stg_iterable__user_unsub_message_type_tmp\"\n\n),\n\nfields as (\n\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_iterable/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_iterable/macros/).\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n \n _fivetran_synced as _fivetran_synced,\n _fivetran_id as _fivetran_id,\n message_type_id as message_type_id,\n cast(null as TEXT) as email,\n cast(null as timestamp) as updated_at\n \n\n\n\n\n \n \n\n\n\n\n\n, cast('postgres.public' as TEXT) as source_relation\n\n\n from base\n),\n\nfinal as (\n\n select\n source_relation,\n cast(_fivetran_id as TEXT ) as _fivetran_user_id,\n coalesce(cast(_fivetran_id as TEXT ), email) as unique_user_key,\n cast(message_type_id as TEXT ) as message_type_id,\n md5(cast(coalesce(cast(_fivetran_id as TEXT), '_dbt_utils_surrogate_key_null_') || '-' || coalesce(cast(email as TEXT), '_dbt_utils_surrogate_key_null_') || '-' || coalesce(cast(message_type_id as TEXT), '_dbt_utils_surrogate_key_null_') || '-' || coalesce(cast(updated_at as TEXT), '_dbt_utils_surrogate_key_null_') || '-' || coalesce(cast(source_relation as TEXT), '_dbt_utils_surrogate_key_null_') as TEXT)) as unsub_message_type_unique_key,\n\n \n 1 as latest_batch_index,\n \n\n updated_at,\n _fivetran_synced\n\n from fields\n)\n\nselect *\nfrom final", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.stg_iterable__list": {"database": "postgres", "schema": "public_iterable_dev", "name": "stg_iterable__list", "resource_type": "model", "package_name": "iterable", "path": "staging/stg_iterable__list.sql", "original_file_path": "models/staging/stg_iterable__list.sql", "unique_id": "model.iterable.stg_iterable__list", "fqn": ["iterable", "staging", "stg_iterable__list"], "alias": "stg_iterable__list", "checksum": {"name": "sha256", "checksum": "b2a6869e5186282b7f5c8173ecba41c0324c1dc31df78db2418f51f2578eaa21"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "table", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "Table containing users and the lists the users are associated with.", "columns": {"source_relation": {"name": "source_relation", "description": "Identifies the record's source.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": ["doc.iterable.source_relation"]}, "list_id": {"name": "list_id", "description": "Unique identifier of the list", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "list_name": {"name": "list_name", "description": "User defined name of the list", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "list_type": {"name": "list_type", "description": "The list type", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "created_at": {"name": "created_at", "description": "Creation timestamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "list_description": {"name": "list_description", "description": "Information about the list", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "The time when a record was last updated by Fivetran.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": ["doc.iterable._fivetran_synced"]}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "iterable://models/staging/stg_iterable.yml", "build_path": null, "unrendered_config": {"materialized": "table", "schema": "iterable_{{ var('directed_schema','dev') }}", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789079004.3062253, "relation_name": "\"postgres\".\"public_iterable_dev\".\"stg_iterable__list\"", "raw_code": "with base as (\n\n select * \n from {{ ref('stg_iterable__list_tmp') }}\n\n),\n\nfields as (\n\n select\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_iterable__list_tmp')),\n staging_columns=get_list_columns()\n )\n }}\n {{ fivetran_utils.apply_source_relation(package_name='iterable') }}\n \n from base\n),\n\nfinal as (\n\n select\n source_relation,\n id as list_id,\n name as list_name,\n list_type,\n created_at,\n description as list_description,\n _fivetran_synced\n from fields\n where not coalesce(_fivetran_deleted, true)\n)\n\nselect * \nfrom final", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__list_tmp", "package": null, "version": null}, {"name": "stg_iterable__list_tmp", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.iterable.get_list_columns", "macro.fivetran_utils.fill_staging_columns", "macro.fivetran_utils.apply_source_relation"], "nodes": ["model.iterable.stg_iterable__list_tmp"]}, "compiled_path": "target/compiled/iterable/models/staging/stg_iterable__list.sql", "compiled": true, "compiled_code": "with base as (\n\n select * \n from \"postgres\".\"public_iterable_dev\".\"stg_iterable__list_tmp\"\n\n),\n\nfields as (\n\n select\n \n _fivetran_deleted as _fivetran_deleted,\n _fivetran_synced as _fivetran_synced,\n created_at as created_at,\n id as id,\n list_type as list_type,\n description as description,\n name as name\n \n\n\n\n\n \n \n\n\n\n\n\n, cast('postgres.public' as TEXT) as source_relation\n\n \n from base\n),\n\nfinal as (\n\n select\n source_relation,\n id as list_id,\n name as list_name,\n list_type,\n created_at,\n description as list_description,\n _fivetran_synced\n from fields\n where not coalesce(_fivetran_deleted, true)\n)\n\nselect * \nfrom final", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.stg_iterable__list_user": {"database": "postgres", "schema": "public_iterable_dev", "name": "stg_iterable__list_user", "resource_type": "model", "package_name": "iterable", "path": "staging/stg_iterable__list_user.sql", "original_file_path": "models/staging/stg_iterable__list_user.sql", "unique_id": "model.iterable.stg_iterable__list_user", "fqn": ["iterable", "staging", "stg_iterable__list_user"], "alias": "stg_iterable__list_user", "checksum": {"name": "sha256", "checksum": "f3fe66e05562725c91948ac2023c649573560043aa82c03fe93f6232f6600954"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "table", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "Table containing the relationship between users and lists they belong to.", "columns": {"source_relation": {"name": "source_relation", "description": "Identifies the record's source.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": ["doc.iterable.source_relation"]}, "_fivetran_user_id": {"name": "_fivetran_user_id", "description": "Unique identifier of the list-user relationship record, serving as a foreign key to `stg_iterable__user_history._fivetran_id`.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "list_user_index": {"name": "list_user_index", "description": "Index of the record", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "list_id": {"name": "list_id", "description": "Reference to the list that the user belongs to", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "The time when a record was last updated by Fivetran.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": ["doc.iterable._fivetran_synced"]}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "iterable://models/staging/stg_iterable.yml", "build_path": null, "unrendered_config": {"materialized": "table", "schema": "iterable_{{ var('directed_schema','dev') }}", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789079004.3096058, "relation_name": "\"postgres\".\"public_iterable_dev\".\"stg_iterable__list_user\"", "raw_code": "{% set source_columns_in_relation = adapter.get_columns_in_relation(ref('stg_iterable__list_user_tmp')) %}\n\nwith base as (\n\n select *\n from {{ ref('stg_iterable__list_user_tmp') }}\n\n),\n\nfields as (\n\n select\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=source_columns_in_relation,\n staging_columns=get_list_user_columns()\n )\n }}\n {{ fivetran_utils.apply_source_relation(package_name='iterable') }}\n\n from base\n),\n\nfinal as (\n\n select\n source_relation,\n cast(_fivetran_id as {{ dbt.type_string() }} ) as _fivetran_user_id,\n index as list_user_index,\n list_id,\n _fivetran_synced\n\n from fields\n)\n\nselect *\nfrom final", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__list_user_tmp", "package": null, "version": null}, {"name": "stg_iterable__list_user_tmp", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.iterable.get_list_user_columns", "macro.fivetran_utils.fill_staging_columns", "macro.fivetran_utils.apply_source_relation", "macro.dbt.type_string"], "nodes": ["model.iterable.stg_iterable__list_user_tmp"]}, "compiled_path": "target/compiled/iterable/models/staging/stg_iterable__list_user.sql", "compiled": true, "compiled_code": "\n\nwith base as (\n\n select *\n from \"postgres\".\"public_iterable_dev\".\"stg_iterable__list_user_tmp\"\n\n),\n\nfields as (\n\n select\n \n _fivetran_id as _fivetran_id,\n _fivetran_synced as _fivetran_synced,\n index as index,\n list_id as list_id\n \n\n\n\n\n \n \n\n\n\n\n\n, cast('postgres.public' as TEXT) as source_relation\n\n\n from base\n),\n\nfinal as (\n\n select\n source_relation,\n cast(_fivetran_id as TEXT ) as _fivetran_user_id,\n index as list_user_index,\n list_id,\n _fivetran_synced\n\n from fields\n)\n\nselect *\nfrom final", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.stg_iterable__campaign_suppression_list_history": {"database": "postgres", "schema": "public_iterable_dev", "name": "stg_iterable__campaign_suppression_list_history", "resource_type": "model", "package_name": "iterable", "path": "staging/stg_iterable__campaign_suppression_list_history.sql", "original_file_path": "models/staging/stg_iterable__campaign_suppression_list_history.sql", "unique_id": "model.iterable.stg_iterable__campaign_suppression_list_history", "fqn": ["iterable", "staging", "stg_iterable__campaign_suppression_list_history"], "alias": "stg_iterable__campaign_suppression_list_history", "checksum": {"name": "sha256", "checksum": "695d57ff7cf14d55ef6881ee9184e873c2cdc7fd61bfd9fbb0cb3330fe055ae0"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "table", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "Table containing a history of suppression lists.", "columns": {"source_relation": {"name": "source_relation", "description": "Identifies the record's source.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": ["doc.iterable.source_relation"]}, "campaign_id": {"name": "campaign_id", "description": "Reference to the campaign associated with the label", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "suppressed_list_id": {"name": "suppressed_list_id", "description": "Reference to the list used", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "updated_at": {"name": "updated_at", "description": "Last update timestamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "The time when a record was last updated by Fivetran.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": ["doc.iterable._fivetran_synced"]}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "iterable://models/staging/stg_iterable.yml", "build_path": null, "unrendered_config": {"materialized": "table", "schema": "iterable_{{ var('directed_schema','dev') }}", "enabled": "var('iterable__using_campaign_suppression_list_history', True)", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789079004.3016183, "relation_name": "\"postgres\".\"public_iterable_dev\".\"stg_iterable__campaign_suppression_list_history\"", "raw_code": "{{ config(enabled=var('iterable__using_campaign_suppression_list_history', True)) }}\n\nwith base as (\n\n select * \n from {{ ref('stg_iterable__campaign_suppression_list_history_tmp') }}\n\n),\n\nfields as (\n\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_iterable/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_iterable/macros/).\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_iterable__campaign_suppression_list_history_tmp')),\n staging_columns=get_campaign_suppression_list_history_columns()\n )\n }}\n {{ fivetran_utils.apply_source_relation(package_name='iterable') }}\n\n from base\n),\n\nfinal as (\n\n select\n source_relation,\n cast(campaign_id as {{ dbt.type_string() }}) as campaign_id,\n cast(suppressed_list_id as {{ dbt.type_string() }}) as suppressed_list_id,\n updated_at,\n _fivetran_synced\n from fields\n)\n\nselect * \nfrom final", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__campaign_suppression_list_history_tmp", "package": null, "version": null}, {"name": "stg_iterable__campaign_suppression_list_history_tmp", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.iterable.get_campaign_suppression_list_history_columns", "macro.fivetran_utils.fill_staging_columns", "macro.fivetran_utils.apply_source_relation", "macro.dbt.type_string"], "nodes": ["model.iterable.stg_iterable__campaign_suppression_list_history_tmp"]}, "compiled_path": "target/compiled/iterable/models/staging/stg_iterable__campaign_suppression_list_history.sql", "compiled": true, "compiled_code": "\n\nwith base as (\n\n select * \n from \"postgres\".\"public_iterable_dev\".\"stg_iterable__campaign_suppression_list_history_tmp\"\n\n),\n\nfields as (\n\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_iterable/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_iterable/macros/).\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n \n _fivetran_synced as _fivetran_synced,\n campaign_id as campaign_id,\n suppressed_list_id as suppressed_list_id,\n updated_at as updated_at\n \n\n\n\n\n \n \n\n\n\n\n\n, cast('postgres.public' as TEXT) as source_relation\n\n\n from base\n),\n\nfinal as (\n\n select\n source_relation,\n cast(campaign_id as TEXT) as campaign_id,\n cast(suppressed_list_id as TEXT) as suppressed_list_id,\n updated_at,\n _fivetran_synced\n from fields\n)\n\nselect * \nfrom final", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.stg_iterable__event_extension": {"database": "postgres", "schema": "public_iterable_dev", "name": "stg_iterable__event_extension", "resource_type": "model", "package_name": "iterable", "path": "staging/stg_iterable__event_extension.sql", "original_file_path": "models/staging/stg_iterable__event_extension.sql", "unique_id": "model.iterable.stg_iterable__event_extension", "fqn": ["iterable", "staging", "stg_iterable__event_extension"], "alias": "stg_iterable__event_extension", "checksum": {"name": "sha256", "checksum": "006d3abf1fe12ef7312b3f02d07a13a483883e57acfe0fceedb3e6a9f71372ff"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "Table containing addition properties from the event table.", "columns": {"source_relation": {"name": "source_relation", "description": "Identifies the record's source.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": ["doc.iterable.source_relation"]}, "event_id": {"name": "event_id", "description": "A Fivetran-created unique identifier derived from hashing campaign_id, created_at, and event_name.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_event_id": {"name": "unique_event_id", "description": "A surrogate key made up of event_id, _fivetran_user_id, and source_relation.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "is_app_already_running": {"name": "is_app_already_running", "description": "Boolean indicating if the app is currently running or not", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "badge": {"name": "badge", "description": "Badge associated with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "canonical_url_id": {"name": "canonical_url_id", "description": "Reference to the url associated with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "is_content_available": {"name": "is_content_available", "description": "Content available from the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "content_id": {"name": "content_id", "description": "Reference to the content associated with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "device": {"name": "device", "description": "The device associated with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "email_id": {"name": "email_id", "description": "Reference to the email associated with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "email_subject": {"name": "email_subject", "description": "Subject of the email associated with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "experiment_id": {"name": "experiment_id", "description": "Reference to the experiment used if the event is an experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "from_phone_number_id": {"name": "from_phone_number_id", "description": "Reference to the phone number which the event is from", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "from_smssender_id": {"name": "from_smssender_id", "description": "Reference to the sms sender which the event is from", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "link_id": {"name": "link_id", "description": "Reference to the link associated with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "link_url": {"name": "link_url", "description": "Url of the link associated with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "locale": {"name": "locale", "description": "Locale associated with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "payload": {"name": "payload", "description": "Payload resulted from the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "platform_endpoint": {"name": "platform_endpoint", "description": "The specific platform endpoint of the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "push_message": {"name": "push_message", "description": "Boolean indicating if the event is a push message", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "region": {"name": "region", "description": "Region of the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "sms_message": {"name": "sms_message", "description": "Boolean indicating if the event is an sms message", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "to_phone_number": {"name": "to_phone_number", "description": "To phone number associated with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "url": {"name": "url", "description": "Url associated with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "workflow_id": {"name": "workflow_id", "description": "Reference to the workflow which the event originated", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "workflow_name": {"name": "workflow_name", "description": "Name of the workflow which the event originated", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "catalog_collection_count": {"name": "catalog_collection_count", "description": "The count of products or items collected in a catalog associated with the event.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "catalog_lookup_count": {"name": "catalog_lookup_count", "description": "The count of times a catalog was looked up or queried during the event.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "city": {"name": "city", "description": "The city associated with the event, which could be the location of the recipient.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "clicked_url": {"name": "clicked_url", "description": "The URL that was clicked by the recipient in response to the marketing message.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "country": {"name": "country", "description": "The country associated with the event, which could be the location of the recipient.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "error_code": {"name": "error_code", "description": "The error code or message indicating any issues or errors encountered during the event.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "expires_at": {"name": "expires_at", "description": "The date and time when the event or message is set to expire or become invalid.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "from_phone_number": {"name": "from_phone_number", "description": "The phone number from which the SMS message was sent.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "in_app_body": {"name": "in_app_body", "description": "The content or body of an in-app message that was sent as part of the event.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "is_sms_estimation": {"name": "is_sms_estimation", "description": "A boolean indicating whether the SMS message is an estimation or not.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "labels": {"name": "labels", "description": "Any labels or tags associated with the event, which can be used for categorization or organization.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "message_status": {"name": "message_status", "description": "The status of the marketing message, such as sent, delivered, opened, etc.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "mms_send_count": {"name": "mms_send_count", "description": "The count of multimedia messages (MMS) sent as part of the event.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "reason": {"name": "reason", "description": "The reason or cause associated with a specific event or action.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "sms_send_count": {"name": "sms_send_count", "description": "The count of SMS messages sent as part of the event.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "_fivetran_user_id": {"name": "_fivetran_user_id", "description": "A Fivetran-created unique identifier for users, derived from hashing user_id and/or email, depending on project type. This exists for users of the new schema starting Aug 2023. In the old schema, the unique identifier is email.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "The time when a record was last updated by Fivetran.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": ["doc.iterable._fivetran_synced"]}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "iterable://models/staging/stg_iterable.yml", "build_path": null, "unrendered_config": {"materialized": "view", "schema": "iterable_{{ var('directed_schema','dev') }}", "enabled": "var('iterable__using_event_extension', True)", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789079004.304681, "relation_name": "\"postgres\".\"public_iterable_dev\".\"stg_iterable__event_extension\"", "raw_code": "{{ config(\n enabled=var('iterable__using_event_extension', True),\n materialized='view'\n) }}\n\nwith base as (\n\n select * \n from {{ ref('stg_iterable__event_extension_tmp') }}\n\n),\n\nfields as (\n\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_iterable/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_iterable/macros/).\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_iterable__event_extension_tmp')),\n staging_columns=get_event_extension_columns()\n )\n }}\n {{ fivetran_utils.apply_source_relation(package_name='iterable') }}\n\n from base\n),\n\nfinal as (\n select\n source_relation,\n cast(_fivetran_id as {{ dbt.type_string() }} ) as event_id,\n {{ dbt_utils.generate_surrogate_key(['_fivetran_id','_fivetran_user_id','source_relation']) }} as unique_event_id,\n app_already_running as is_app_already_running,\n badge,\n catalog_collection_count,\n catalog_lookup_count,\n cast(canonical_url_id as {{ dbt.type_string() }} ) as canonical_url_id,\n content_available as is_content_available,\n cast(content_id as {{ dbt.type_string() }} ) as content_id,\n device,\n cast(email_id as {{ dbt.type_string() }}) as email_id,\n email_subject,\n experiment_id,\n from_phone_number_id,\n from_smssender_id,\n cast(link_id as {{ dbt.type_string() }} ) as link_id,\n link_url,\n locale,\n payload,\n platform_endpoint,\n push_message,\n region,\n sms_message,\n to_phone_number,\n url,\n cast(workflow_id as {{ dbt.type_string() }} ) as workflow_id,\n workflow_name,\n city,\n clicked_url,\n country,\n error_code,\n expires_at,\n from_phone_number,\n in_app_body,\n is_sms_estimation,\n labels,\n message_status,\n mms_send_count,\n reason,\n sms_send_count,\n _fivetran_synced,\n cast(_fivetran_user_id as {{ dbt.type_string() }} ) as _fivetran_user_id\n\n --The below script allows for pass through columns.\n {{ fivetran_utils.fill_pass_through_columns('iterable_event_extension_pass_through_columns') }}\n\n from fields\n)\n\nselect *\nfrom final", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__event_extension_tmp", "package": null, "version": null}, {"name": "stg_iterable__event_extension_tmp", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.iterable.get_event_extension_columns", "macro.fivetran_utils.fill_staging_columns", "macro.fivetran_utils.apply_source_relation", "macro.dbt.type_string", "macro.dbt_utils.generate_surrogate_key", "macro.fivetran_utils.fill_pass_through_columns"], "nodes": ["model.iterable.stg_iterable__event_extension_tmp"]}, "compiled_path": "target/compiled/iterable/models/staging/stg_iterable__event_extension.sql", "compiled": true, "compiled_code": "\n\nwith base as (\n\n select * \n from \"postgres\".\"public_iterable_dev\".\"stg_iterable__event_extension_tmp\"\n\n),\n\nfields as (\n\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_iterable/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_iterable/macros/).\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n \n _fivetran_id as _fivetran_id,\n _fivetran_synced as _fivetran_synced,\n app_already_running as app_already_running,\n badge as badge,\n catalog_collection_count as catalog_collection_count,\n catalog_lookup_count as catalog_lookup_count,\n canonical_url_id as canonical_url_id,\n content_available as content_available,\n content_id as content_id,\n device as device,\n email_id as email_id,\n email_subject as email_subject,\n experiment_id as experiment_id,\n from_phone_number_id as from_phone_number_id,\n from_smssender_id as from_smssender_id,\n link_id as link_id,\n link_url as link_url,\n locale as locale,\n payload as payload,\n platform_endpoint as platform_endpoint,\n push_message as push_message,\n region as region,\n sms_message as sms_message,\n to_phone_number as to_phone_number,\n url as url,\n workflow_id as workflow_id,\n workflow_name as workflow_name,\n city as city,\n clicked_url as clicked_url,\n country as country,\n error_code as error_code,\n expires_at as expires_at,\n from_phone_number as from_phone_number,\n in_app_body as in_app_body,\n is_sms_estimation as is_sms_estimation,\n labels as labels,\n message_status as message_status,\n mms_send_count as mms_send_count,\n reason as reason,\n sms_send_count as sms_send_count,\n _fivetran_user_id as _fivetran_user_id\n \n\n\n\n\n \n \n\n\n\n\n\n, cast('postgres.public' as TEXT) as source_relation\n\n\n from base\n),\n\nfinal as (\n select\n source_relation,\n cast(_fivetran_id as TEXT ) as event_id,\n md5(cast(coalesce(cast(_fivetran_id as TEXT), '_dbt_utils_surrogate_key_null_') || '-' || coalesce(cast(_fivetran_user_id as TEXT), '_dbt_utils_surrogate_key_null_') || '-' || coalesce(cast(source_relation as TEXT), '_dbt_utils_surrogate_key_null_') as TEXT)) as unique_event_id,\n app_already_running as is_app_already_running,\n badge,\n catalog_collection_count,\n catalog_lookup_count,\n cast(canonical_url_id as TEXT ) as canonical_url_id,\n content_available as is_content_available,\n cast(content_id as TEXT ) as content_id,\n device,\n cast(email_id as TEXT) as email_id,\n email_subject,\n experiment_id,\n from_phone_number_id,\n from_smssender_id,\n cast(link_id as TEXT ) as link_id,\n link_url,\n locale,\n payload,\n platform_endpoint,\n push_message,\n region,\n sms_message,\n to_phone_number,\n url,\n cast(workflow_id as TEXT ) as workflow_id,\n workflow_name,\n city,\n clicked_url,\n country,\n error_code,\n expires_at,\n from_phone_number,\n in_app_body,\n is_sms_estimation,\n labels,\n message_status,\n mms_send_count,\n reason,\n sms_send_count,\n _fivetran_synced,\n cast(_fivetran_user_id as TEXT ) as _fivetran_user_id\n\n --The below script allows for pass through columns.\n \n\n\n\n\n\n from fields\n)\n\nselect *\nfrom final", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.stg_iterable__campaign_list_history": {"database": "postgres", "schema": "public_iterable_dev", "name": "stg_iterable__campaign_list_history", "resource_type": "model", "package_name": "iterable", "path": "staging/stg_iterable__campaign_list_history.sql", "original_file_path": "models/staging/stg_iterable__campaign_list_history.sql", "unique_id": "model.iterable.stg_iterable__campaign_list_history", "fqn": ["iterable", "staging", "stg_iterable__campaign_list_history"], "alias": "stg_iterable__campaign_list_history", "checksum": {"name": "sha256", "checksum": "c7db9c46a66fec00d9fbd6492c0ea17397ec80a12d85fa2d63b9f04f09c45013"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "table", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "Table containing a history of lists.", "columns": {"source_relation": {"name": "source_relation", "description": "Identifies the record's source.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": ["doc.iterable.source_relation"]}, "campaign_id": {"name": "campaign_id", "description": "Reference to the campaign associated with the label", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "list_id": {"name": "list_id", "description": "Reference to the list used", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "updated_at": {"name": "updated_at", "description": "Last update timestamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "The time when a record was last updated by Fivetran.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": ["doc.iterable._fivetran_synced"]}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "iterable://models/staging/stg_iterable.yml", "build_path": null, "unrendered_config": {"materialized": "table", "schema": "iterable_{{ var('directed_schema','dev') }}", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789079004.3008409, "relation_name": "\"postgres\".\"public_iterable_dev\".\"stg_iterable__campaign_list_history\"", "raw_code": "with base as (\n\n select * \n from {{ ref('stg_iterable__campaign_list_history_tmp') }}\n\n),\n\nfields as (\n\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_iterable/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_iterable/macros/).\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_iterable__campaign_list_history_tmp')),\n staging_columns=get_campaign_list_history_columns()\n )\n }}\n {{ fivetran_utils.apply_source_relation(package_name='iterable') }}\n \n from base\n),\n\nfinal as (\n\n select\n source_relation,\n cast(campaign_id as {{ dbt.type_string() }}) as campaign_id,\n cast(list_id as {{ dbt.type_string() }}) as list_id,\n updated_at,\n _fivetran_synced\n from fields\n)\n\nselect * \nfrom final", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__campaign_list_history_tmp", "package": null, "version": null}, {"name": "stg_iterable__campaign_list_history_tmp", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.iterable.get_campaign_list_history_columns", "macro.fivetran_utils.fill_staging_columns", "macro.fivetran_utils.apply_source_relation", "macro.dbt.type_string"], "nodes": ["model.iterable.stg_iterable__campaign_list_history_tmp"]}, "compiled_path": "target/compiled/iterable/models/staging/stg_iterable__campaign_list_history.sql", "compiled": true, "compiled_code": "with base as (\n\n select * \n from \"postgres\".\"public_iterable_dev\".\"stg_iterable__campaign_list_history_tmp\"\n\n),\n\nfields as (\n\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_iterable/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_iterable/macros/).\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n \n _fivetran_synced as _fivetran_synced,\n campaign_id as campaign_id,\n list_id as list_id,\n updated_at as updated_at\n \n\n\n\n\n \n \n\n\n\n\n\n, cast('postgres.public' as TEXT) as source_relation\n\n \n from base\n),\n\nfinal as (\n\n select\n source_relation,\n cast(campaign_id as TEXT) as campaign_id,\n cast(list_id as TEXT) as list_id,\n updated_at,\n _fivetran_synced\n from fields\n)\n\nselect * \nfrom final", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.stg_iterable__channel": {"database": "postgres", "schema": "public_iterable_dev", "name": "stg_iterable__channel", "resource_type": "model", "package_name": "iterable", "path": "staging/stg_iterable__channel.sql", "original_file_path": "models/staging/stg_iterable__channel.sql", "unique_id": "model.iterable.stg_iterable__channel", "fqn": ["iterable", "staging", "stg_iterable__channel"], "alias": "stg_iterable__channel", "checksum": {"name": "sha256", "checksum": "1ade77557691cabd1c65676182adaf401d8dde9ee42a6918d1ea7a124159cbf2"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "table", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "Table containing unique channels.", "columns": {"source_relation": {"name": "source_relation", "description": "Identifies the record's source.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": ["doc.iterable.source_relation"]}, "channel_id": {"name": "channel_id", "description": "Unique identifier of the channel", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "channel_name": {"name": "channel_name", "description": "User defined name of the channel", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "channel_type": {"name": "channel_type", "description": "The channel type", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "message_medium": {"name": "message_medium", "description": "The message medium associated with the channel", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "The time when a record was last updated by Fivetran.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": ["doc.iterable._fivetran_synced"]}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "iterable://models/staging/stg_iterable.yml", "build_path": null, "unrendered_config": {"materialized": "table", "schema": "iterable_{{ var('directed_schema','dev') }}", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789079004.3021634, "relation_name": "\"postgres\".\"public_iterable_dev\".\"stg_iterable__channel\"", "raw_code": "with base as (\n\n select *\n from {{ ref('stg_iterable__channel_tmp') }}\n\n),\n\nfields as (\n\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns\n that are expected/needed (staging_columns from dbt_iterable/models/tmp/) and compares it with columns\n in the source (source_columns from dbt_iterable/macros/).\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_iterable__channel_tmp')),\n staging_columns=get_channel_columns()\n )\n }}\n {{ fivetran_utils.apply_source_relation(package_name='iterable') }}\n\n from base\n\n),\n\nfinal as (\n\n select\n source_relation,\n cast(id as {{ dbt.type_string() }} ) as channel_id,\n name as channel_name,\n channel_type,\n message_medium,\n _fivetran_synced\n\n from fields\n where not coalesce(_fivetran_deleted, false)\n)\n\nselect * \nfrom final", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__channel_tmp", "package": null, "version": null}, {"name": "stg_iterable__channel_tmp", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.iterable.get_channel_columns", "macro.fivetran_utils.fill_staging_columns", "macro.fivetran_utils.apply_source_relation", "macro.dbt.type_string"], "nodes": ["model.iterable.stg_iterable__channel_tmp"]}, "compiled_path": "target/compiled/iterable/models/staging/stg_iterable__channel.sql", "compiled": true, "compiled_code": "with base as (\n\n select *\n from \"postgres\".\"public_iterable_dev\".\"stg_iterable__channel_tmp\"\n\n),\n\nfields as (\n\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns\n that are expected/needed (staging_columns from dbt_iterable/models/tmp/) and compares it with columns\n in the source (source_columns from dbt_iterable/macros/).\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n \n _fivetran_deleted as _fivetran_deleted,\n _fivetran_synced as _fivetran_synced,\n channel_type as channel_type,\n id as id,\n message_medium as message_medium,\n name as name\n \n\n\n\n\n \n \n\n\n\n\n\n, cast('postgres.public' as TEXT) as source_relation\n\n\n from base\n\n),\n\nfinal as (\n\n select\n source_relation,\n cast(id as TEXT ) as channel_id,\n name as channel_name,\n channel_type,\n message_medium,\n _fivetran_synced\n\n from fields\n where not coalesce(_fivetran_deleted, false)\n)\n\nselect * \nfrom final", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.stg_iterable__message_type_tmp": {"database": "postgres", "schema": "public_iterable_dev", "name": "stg_iterable__message_type_tmp", "resource_type": "model", "package_name": "iterable", "path": "staging/tmp/stg_iterable__message_type_tmp.sql", "original_file_path": "models/staging/tmp/stg_iterable__message_type_tmp.sql", "unique_id": "model.iterable.stg_iterable__message_type_tmp", "fqn": ["iterable", "staging", "tmp", "stg_iterable__message_type_tmp"], "alias": "stg_iterable__message_type_tmp", "checksum": {"name": "sha256", "checksum": "fda7a978e7b71b46f37e4878898c6655526f0531d36f74968c7bbb56ec4200e5"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"materialized": "view", "schema": "iterable_{{ var('directed_schema','dev') }}", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789079003.9030004, "relation_name": "\"postgres\".\"public_iterable_dev\".\"stg_iterable__message_type_tmp\"", "raw_code": "{{\n fivetran_utils.union_connections(\n connection_dictionary='iterable_sources',\n single_source_name='iterable',\n single_table_name='message_type'\n )\n}}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["iterable", "message_type"], ["iterable", "message_type"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.fivetran_utils.union_connections"], "nodes": ["source.iterable.iterable.message_type"]}, "compiled_path": "target/compiled/iterable/models/staging/tmp/stg_iterable__message_type_tmp.sql", "compiled": true, "compiled_code": "\n\n\n-- ** Values passed to adapter.get_relation:\n -- full-identifier_var: iterable_message_type_identifier\n -- database: postgres \n -- schema: public\n -- identifier: message_type_data\n\n\n select\n \"id\",\n \"name\",\n \"channel_id\",\n \"_fivetran_deleted\",\n \"_fivetran_synced\",\n \"created_at\",\n \"frequency_cap\",\n \"rate_limit_per_minute\",\n \"subscription_policy\",\n \"updated_at\"\n from \"postgres\".\"public\".\"message_type_data\" as source_table\n\n ", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.stg_iterable__event_extension_tmp": {"database": "postgres", "schema": "public_iterable_dev", "name": "stg_iterable__event_extension_tmp", "resource_type": "model", "package_name": "iterable", "path": "staging/tmp/stg_iterable__event_extension_tmp.sql", "original_file_path": "models/staging/tmp/stg_iterable__event_extension_tmp.sql", "unique_id": "model.iterable.stg_iterable__event_extension_tmp", "fqn": ["iterable", "staging", "tmp", "stg_iterable__event_extension_tmp"], "alias": "stg_iterable__event_extension_tmp", "checksum": {"name": "sha256", "checksum": "09d92da24c5304acbb0f0ebc81fe49e70458d1319cb1c2090f5f9ce0b87ecb29"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"materialized": "view", "schema": "iterable_{{ var('directed_schema','dev') }}", "enabled": "var('iterable__using_event_extension', True)", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789079003.9174972, "relation_name": "\"postgres\".\"public_iterable_dev\".\"stg_iterable__event_extension_tmp\"", "raw_code": "{{ config(enabled=var('iterable__using_event_extension', True)) }}\n\n{{\n fivetran_utils.union_connections(\n connection_dictionary='iterable_sources',\n single_source_name='iterable',\n single_table_name='event_extension'\n )\n}}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["iterable", "event_extension"], ["iterable", "event_extension"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.fivetran_utils.union_connections"], "nodes": ["source.iterable.iterable.event_extension"]}, "compiled_path": "target/compiled/iterable/models/staging/tmp/stg_iterable__event_extension_tmp.sql", "compiled": true, "compiled_code": "\n\n\n\n\n-- ** Values passed to adapter.get_relation:\n -- full-identifier_var: iterable_event_extension_identifier\n -- database: postgres \n -- schema: public\n -- identifier: event_extension_data\n\n\n select\n \"_fivetran_id\",\n \"app_already_running\",\n \"badge\",\n \"canonical_url_id\",\n \"content_available\",\n \"content_id\",\n \"device\",\n \"email_id\",\n \"email_subject\",\n \"experiment_id\",\n \"from_phone_number_id\",\n \"from_smssender_id\",\n \"image_url\",\n \"is_ghost_push\",\n \"link_id\",\n \"link_url\",\n \"platform_endpoint\",\n \"push_message\",\n \"region\",\n \"sms_message\",\n \"sound\",\n \"to_phone_number\",\n \"url\",\n \"workflow_id\",\n \"workflow_name\",\n \"locale\",\n \"deeplink_android\",\n \"deeplink_ios\",\n \"payload\",\n \"sms_provider_response_status\",\n \"sms_provider_response_message\",\n \"sms_provider_response_code\",\n \"sms_provider_response_more_info\",\n \"_fivetran_synced\",\n \"catalog_collection_count\",\n \"catalog_lookup_count\",\n \"city\",\n \"clicked_url\",\n \"country\",\n \"error_code\",\n \"expires_at\",\n \"from_phone_number\",\n \"in_app_body\",\n \"is_sms_estimation\",\n \"labels\",\n \"message_context\",\n \"message_status\",\n \"mms_send_count\",\n \"product_recommendation_count\",\n \"proxy_source\",\n \"reason\",\n \"sms_send_count\",\n \"web_push_body\",\n \"web_push_click_action\",\n \"web_push_icon\",\n \"web_push_message\",\n \"_fivetran_user_id\"\n from \"postgres\".\"public\".\"event_extension_data\" as source_table\n\n ", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.stg_iterable__user_unsub_message_type_tmp": {"database": "postgres", "schema": "public_iterable_dev", "name": "stg_iterable__user_unsub_message_type_tmp", "resource_type": "model", "package_name": "iterable", "path": "staging/tmp/stg_iterable__user_unsub_message_type_tmp.sql", "original_file_path": "models/staging/tmp/stg_iterable__user_unsub_message_type_tmp.sql", "unique_id": "model.iterable.stg_iterable__user_unsub_message_type_tmp", "fqn": ["iterable", "staging", "tmp", "stg_iterable__user_unsub_message_type_tmp"], "alias": "stg_iterable__user_unsub_message_type_tmp", "checksum": {"name": "sha256", "checksum": "ddb46e159ed22f011676fbe7e00ba9271a493bc5185d286261ae30fa0b183636"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"materialized": "view", "schema": "iterable_{{ var('directed_schema','dev') }}", "enabled": "var('iterable__using_user_unsubscribed_message_type', True)", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789079003.9226346, "relation_name": "\"postgres\".\"public_iterable_dev\".\"stg_iterable__user_unsub_message_type_tmp\"", "raw_code": "{{ config(enabled=var('iterable__using_user_unsubscribed_message_type', True)) }}\n\n{{\n fivetran_utils.union_connections(\n connection_dictionary='iterable_sources',\n single_source_name='iterable',\n single_table_name='user_unsubscribed_message_type' if does_table_exist('user_unsubscribed_message_type') else 'user_unsubscribed_message_type_history'\n )\n}}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["iterable", "user_unsubscribed_message_type_history"], ["iterable", "user_unsubscribed_message_type_history"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.iterable.does_table_exist", "macro.fivetran_utils.union_connections"], "nodes": ["source.iterable.iterable.user_unsubscribed_message_type_history"]}, "compiled_path": "target/compiled/iterable/models/staging/tmp/stg_iterable__user_unsub_message_type_tmp.sql", "compiled": true, "compiled_code": "\n\n\n\n\n-- ** Values passed to adapter.get_relation:\n -- full-identifier_var: iterable_user_unsubscribed_message_type_identifier\n -- database: postgres \n -- schema: public\n -- identifier: user_unsubscribed_message_type_data\n\n\n select\n \"_fivetran_id\",\n \"message_type_id\",\n \"_fivetran_synced\"\n from \"postgres\".\"public\".\"user_unsubscribed_message_type_data\" as source_table\n\n ", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.stg_iterable__campaign_list_history_tmp": {"database": "postgres", "schema": "public_iterable_dev", "name": "stg_iterable__campaign_list_history_tmp", "resource_type": "model", "package_name": "iterable", "path": "staging/tmp/stg_iterable__campaign_list_history_tmp.sql", "original_file_path": "models/staging/tmp/stg_iterable__campaign_list_history_tmp.sql", "unique_id": "model.iterable.stg_iterable__campaign_list_history_tmp", "fqn": ["iterable", "staging", "tmp", "stg_iterable__campaign_list_history_tmp"], "alias": "stg_iterable__campaign_list_history_tmp", "checksum": {"name": "sha256", "checksum": "c26b6a07e1d280b2d5dea6ddbff02200d527e798d8af0a8105be30c0e7d013f7"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"materialized": "view", "schema": "iterable_{{ var('directed_schema','dev') }}", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789079003.9280632, "relation_name": "\"postgres\".\"public_iterable_dev\".\"stg_iterable__campaign_list_history_tmp\"", "raw_code": "{{\n fivetran_utils.union_connections(\n connection_dictionary='iterable_sources',\n single_source_name='iterable',\n single_table_name='campaign_list_history'\n )\n}}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["iterable", "campaign_list_history"], ["iterable", "campaign_list_history"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.fivetran_utils.union_connections"], "nodes": ["source.iterable.iterable.campaign_list_history"]}, "compiled_path": "target/compiled/iterable/models/staging/tmp/stg_iterable__campaign_list_history_tmp.sql", "compiled": true, "compiled_code": "\n\n\n-- ** Values passed to adapter.get_relation:\n -- full-identifier_var: iterable_campaign_list_history_identifier\n -- database: postgres \n -- schema: public\n -- identifier: campaign_list_history_data\n\n\n select\n \"list_id\",\n \"campaign_id\",\n \"updated_at\",\n \"_fivetran_synced\"\n from \"postgres\".\"public\".\"campaign_list_history_data\" as source_table\n\n ", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.stg_iterable__list_user_tmp": {"database": "postgres", "schema": "public_iterable_dev", "name": "stg_iterable__list_user_tmp", "resource_type": "model", "package_name": "iterable", "path": "staging/tmp/stg_iterable__list_user_tmp.sql", "original_file_path": "models/staging/tmp/stg_iterable__list_user_tmp.sql", "unique_id": "model.iterable.stg_iterable__list_user_tmp", "fqn": ["iterable", "staging", "tmp", "stg_iterable__list_user_tmp"], "alias": "stg_iterable__list_user_tmp", "checksum": {"name": "sha256", "checksum": "5c8b455013c26cfd4094b38e210edeb911a22dc0f05544e65fb48c350c2725fe"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"materialized": "view", "schema": "iterable_{{ var('directed_schema','dev') }}", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789079003.9325027, "relation_name": "\"postgres\".\"public_iterable_dev\".\"stg_iterable__list_user_tmp\"", "raw_code": "{{\n fivetran_utils.union_connections(\n connection_dictionary='iterable_sources',\n single_source_name='iterable',\n single_table_name='list_user'\n )\n}}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["iterable", "list_user"], ["iterable", "list_user"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.fivetran_utils.union_connections"], "nodes": ["source.iterable.iterable.list_user"]}, "compiled_path": "target/compiled/iterable/models/staging/tmp/stg_iterable__list_user_tmp.sql", "compiled": true, "compiled_code": "\n\n\n-- ** Values passed to adapter.get_relation:\n -- full-identifier_var: iterable_list_user_identifier\n -- database: postgres \n -- schema: public\n -- identifier: list_user_data\n\n\n select\n \"_fivetran_id\",\n \"index\",\n \"list_id\",\n \"_fivetran_synced\"\n from \"postgres\".\"public\".\"list_user_data\" as source_table\n\n ", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.stg_iterable__user_history_tmp": {"database": "postgres", "schema": "public_iterable_dev", "name": "stg_iterable__user_history_tmp", "resource_type": "model", "package_name": "iterable", "path": "staging/tmp/stg_iterable__user_history_tmp.sql", "original_file_path": "models/staging/tmp/stg_iterable__user_history_tmp.sql", "unique_id": "model.iterable.stg_iterable__user_history_tmp", "fqn": ["iterable", "staging", "tmp", "stg_iterable__user_history_tmp"], "alias": "stg_iterable__user_history_tmp", "checksum": {"name": "sha256", "checksum": "cc04d0fbef9ff5cd4f72ae66c9cffd316c5e134ecd81dc216dcf682b34eb587b"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"materialized": "view", "schema": "iterable_{{ var('directed_schema','dev') }}", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789079003.937289, "relation_name": "\"postgres\".\"public_iterable_dev\".\"stg_iterable__user_history_tmp\"", "raw_code": "{{\n fivetran_utils.union_connections(\n connection_dictionary='iterable_sources',\n single_source_name='iterable',\n single_table_name='user_history'\n )\n}}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["iterable", "user_history"], ["iterable", "user_history"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.fivetran_utils.union_connections"], "nodes": ["source.iterable.iterable.user_history"]}, "compiled_path": "target/compiled/iterable/models/staging/tmp/stg_iterable__user_history_tmp.sql", "compiled": true, "compiled_code": "\n\n\n-- ** Values passed to adapter.get_relation:\n -- full-identifier_var: iterable_user_history_identifier\n -- database: postgres \n -- schema: public\n -- identifier: user_history_data\n\n\n select\n \"email\",\n \"updated_at\",\n \"first_name\",\n \"last_name\",\n \"phone_number\",\n \"user_id\",\n \"signup_date\",\n \"signup_source\",\n \"phone_number_carrier\",\n \"phone_number_country_code_iso\",\n \"phone_number_line_type\",\n \"phone_number_updated_at\",\n \"_fivetran_synced\",\n \"email_list_ids\",\n \"iterable_user_id\"\n from \"postgres\".\"public\".\"user_history_data\" as source_table\n\n ", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.stg_iterable__campaign_history_tmp": {"database": "postgres", "schema": "public_iterable_dev", "name": "stg_iterable__campaign_history_tmp", "resource_type": "model", "package_name": "iterable", "path": "staging/tmp/stg_iterable__campaign_history_tmp.sql", "original_file_path": "models/staging/tmp/stg_iterable__campaign_history_tmp.sql", "unique_id": "model.iterable.stg_iterable__campaign_history_tmp", "fqn": ["iterable", "staging", "tmp", "stg_iterable__campaign_history_tmp"], "alias": "stg_iterable__campaign_history_tmp", "checksum": {"name": "sha256", "checksum": "a37ade72efad4e5d8b38cc0548f4a4c79d38a4a337ce71f236581bda47f94696"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"materialized": "view", "schema": "iterable_{{ var('directed_schema','dev') }}", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789079003.941746, "relation_name": "\"postgres\".\"public_iterable_dev\".\"stg_iterable__campaign_history_tmp\"", "raw_code": "{{\n fivetran_utils.union_connections(\n connection_dictionary='iterable_sources',\n single_source_name='iterable',\n single_table_name='campaign_history'\n )\n}}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["iterable", "campaign_history"], ["iterable", "campaign_history"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.fivetran_utils.union_connections"], "nodes": ["source.iterable.iterable.campaign_history"]}, "compiled_path": "target/compiled/iterable/models/staging/tmp/stg_iterable__campaign_history_tmp.sql", "compiled": true, "compiled_code": "\n\n\n-- ** Values passed to adapter.get_relation:\n -- full-identifier_var: iterable_campaign_history_identifier\n -- database: postgres \n -- schema: public\n -- identifier: campaign_history_data\n\n\n select\n \"id\",\n \"updated_at\",\n \"template_id\",\n \"recurring_campaign_id\",\n \"campaign_state\",\n \"created_at\",\n \"created_by_user_id\",\n \"ended_at\",\n \"name\",\n \"send_size\",\n \"start_at\",\n \"type\",\n \"workflow_id\",\n \"_fivetran_synced\",\n \"updated_by_user_id\",\n \"message_medium\"\n from \"postgres\".\"public\".\"campaign_history_data\" as source_table\n\n ", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.stg_iterable__template_history_tmp": {"database": "postgres", "schema": "public_iterable_dev", "name": "stg_iterable__template_history_tmp", "resource_type": "model", "package_name": "iterable", "path": "staging/tmp/stg_iterable__template_history_tmp.sql", "original_file_path": "models/staging/tmp/stg_iterable__template_history_tmp.sql", "unique_id": "model.iterable.stg_iterable__template_history_tmp", "fqn": ["iterable", "staging", "tmp", "stg_iterable__template_history_tmp"], "alias": "stg_iterable__template_history_tmp", "checksum": {"name": "sha256", "checksum": "b37299e696c1cd6388ad85a4042f9b8a5364b969e7c4fdb42f03e4c4803e9a7f"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"materialized": "view", "schema": "iterable_{{ var('directed_schema','dev') }}", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789079003.946246, "relation_name": "\"postgres\".\"public_iterable_dev\".\"stg_iterable__template_history_tmp\"", "raw_code": "{{\n fivetran_utils.union_connections(\n connection_dictionary='iterable_sources',\n single_source_name='iterable',\n single_table_name='template_history'\n )\n}}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["iterable", "template_history"], ["iterable", "template_history"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.fivetran_utils.union_connections"], "nodes": ["source.iterable.iterable.template_history"]}, "compiled_path": "target/compiled/iterable/models/staging/tmp/stg_iterable__template_history_tmp.sql", "compiled": true, "compiled_code": "\n\n\n-- ** Values passed to adapter.get_relation:\n -- full-identifier_var: iterable_template_history_identifier\n -- database: postgres \n -- schema: public\n -- identifier: template_history_data\n\n\n select\n \"id\",\n \"updated_at\",\n \"message_type_id\",\n \"client_template_id\",\n \"created_at\",\n \"creator_user_id\",\n \"name\",\n \"template_type\",\n \"_fivetran_synced\"\n from \"postgres\".\"public\".\"template_history_data\" as source_table\n\n ", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.stg_iterable__event_tmp": {"database": "postgres", "schema": "public_iterable_dev", "name": "stg_iterable__event_tmp", "resource_type": "model", "package_name": "iterable", "path": "staging/tmp/stg_iterable__event_tmp.sql", "original_file_path": "models/staging/tmp/stg_iterable__event_tmp.sql", "unique_id": "model.iterable.stg_iterable__event_tmp", "fqn": ["iterable", "staging", "tmp", "stg_iterable__event_tmp"], "alias": "stg_iterable__event_tmp", "checksum": {"name": "sha256", "checksum": "31555eb22bfca797c1f1a4f1503da21f7620762d199e7e32b2d268c03e139f65"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"materialized": "view", "schema": "iterable_{{ var('directed_schema','dev') }}", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789079003.950569, "relation_name": "\"postgres\".\"public_iterable_dev\".\"stg_iterable__event_tmp\"", "raw_code": "{{\n fivetran_utils.union_connections(\n connection_dictionary='iterable_sources',\n single_source_name='iterable',\n single_table_name='event'\n )\n}}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["iterable", "event"], ["iterable", "event"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.fivetran_utils.union_connections"], "nodes": ["source.iterable.iterable.event"]}, "compiled_path": "target/compiled/iterable/models/staging/tmp/stg_iterable__event_tmp.sql", "compiled": true, "compiled_code": "\n\n\n-- ** Values passed to adapter.get_relation:\n -- full-identifier_var: iterable_event_identifier\n -- database: postgres \n -- schema: public\n -- identifier: event_data\n\n\n select\n \"_fivetran_id\",\n \"email\",\n \"campaign_id\",\n \"message_id\",\n \"content_id\",\n \"created_at\",\n \"event_name\",\n \"ip\",\n \"message_bus_id\",\n \"message_type_id\",\n \"recipient_state\",\n \"status\",\n \"unsub_source\",\n \"user_agent\",\n \"user_agent_device\",\n \"transactional_data\",\n \"additional_properties\",\n \"_fivetran_synced\",\n \"_fivetran_user_id\"\n from \"postgres\".\"public\".\"event_data\" as source_table\n\n ", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.stg_iterable__journey_tmp": {"database": "postgres", "schema": "public_iterable_dev", "name": "stg_iterable__journey_tmp", "resource_type": "model", "package_name": "iterable", "path": "staging/tmp/stg_iterable__journey_tmp.sql", "original_file_path": "models/staging/tmp/stg_iterable__journey_tmp.sql", "unique_id": "model.iterable.stg_iterable__journey_tmp", "fqn": ["iterable", "staging", "tmp", "stg_iterable__journey_tmp"], "alias": "stg_iterable__journey_tmp", "checksum": {"name": "sha256", "checksum": "9e10fed335359755ce1488a7df46c9bfd4a08b029e757c4e81c8c2f8cce28961"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"materialized": "view", "schema": "iterable_{{ var('directed_schema','dev') }}", "enabled": "var('iterable__using_journey', True)", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789079003.9550436, "relation_name": "\"postgres\".\"public_iterable_dev\".\"stg_iterable__journey_tmp\"", "raw_code": "{{ config(enabled=var('iterable__using_journey', True)) }}\n\n{{\n fivetran_utils.union_connections(\n connection_dictionary='iterable_sources',\n single_source_name='iterable',\n single_table_name='journey'\n )\n}}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["iterable", "journey"], ["iterable", "journey"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.fivetran_utils.union_connections"], "nodes": ["source.iterable.iterable.journey"]}, "compiled_path": "target/compiled/iterable/models/staging/tmp/stg_iterable__journey_tmp.sql", "compiled": true, "compiled_code": "\n\n\n\n\n-- ** Values passed to adapter.get_relation:\n -- full-identifier_var: iterable_journey_identifier\n -- database: postgres \n -- schema: public\n -- identifier: journey\n\n\n \n \n\n select\n cast(null as TEXT) as _dbt_source_relation\n limit 0", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.stg_iterable__campaign_suppression_list_history_tmp": {"database": "postgres", "schema": "public_iterable_dev", "name": "stg_iterable__campaign_suppression_list_history_tmp", "resource_type": "model", "package_name": "iterable", "path": "staging/tmp/stg_iterable__campaign_suppression_list_history_tmp.sql", "original_file_path": "models/staging/tmp/stg_iterable__campaign_suppression_list_history_tmp.sql", "unique_id": "model.iterable.stg_iterable__campaign_suppression_list_history_tmp", "fqn": ["iterable", "staging", "tmp", "stg_iterable__campaign_suppression_list_history_tmp"], "alias": "stg_iterable__campaign_suppression_list_history_tmp", "checksum": {"name": "sha256", "checksum": "3c5a325cac70574f2defa9fa09b436c03a3fe8a3dede5729ca95451b410d636c"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"materialized": "view", "schema": "iterable_{{ var('directed_schema','dev') }}", "enabled": "var('iterable__using_campaign_suppression_list_history', True)", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789079003.9601126, "relation_name": "\"postgres\".\"public_iterable_dev\".\"stg_iterable__campaign_suppression_list_history_tmp\"", "raw_code": "{{ config(enabled=var('iterable__using_campaign_suppression_list_history', True)) }}\n\n{{\n fivetran_utils.union_connections(\n connection_dictionary='iterable_sources',\n single_source_name='iterable',\n single_table_name='campaign_suppression_list_history'\n )\n}}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["iterable", "campaign_suppression_list_history"], ["iterable", "campaign_suppression_list_history"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.fivetran_utils.union_connections"], "nodes": ["source.iterable.iterable.campaign_suppression_list_history"]}, "compiled_path": "target/compiled/iterable/models/staging/tmp/stg_iterable__campaign_suppression_list_history_tmp.sql", "compiled": true, "compiled_code": "\n\n\n\n\n-- ** Values passed to adapter.get_relation:\n -- full-identifier_var: iterable_campaign_suppression_list_history_identifier\n -- database: postgres \n -- schema: public\n -- identifier: campaign_suppression_list_history_data\n\n\n select\n \"suppressed_list_id\",\n \"campaign_id\",\n \"updated_at\",\n \"_fivetran_synced\"\n from \"postgres\".\"public\".\"campaign_suppression_list_history_data\" as source_table\n\n ", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.stg_iterable__campaign_label_history_tmp": {"database": "postgres", "schema": "public_iterable_dev", "name": "stg_iterable__campaign_label_history_tmp", "resource_type": "model", "package_name": "iterable", "path": "staging/tmp/stg_iterable__campaign_label_history_tmp.sql", "original_file_path": "models/staging/tmp/stg_iterable__campaign_label_history_tmp.sql", "unique_id": "model.iterable.stg_iterable__campaign_label_history_tmp", "fqn": ["iterable", "staging", "tmp", "stg_iterable__campaign_label_history_tmp"], "alias": "stg_iterable__campaign_label_history_tmp", "checksum": {"name": "sha256", "checksum": "08e70c9938c895459cabba65b1992d360775e26ea2b8275e408bcf21e814bd58"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"materialized": "view", "schema": "iterable_{{ var('directed_schema','dev') }}", "enabled": "var('iterable__using_campaign_label_history', True)", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789079003.9651775, "relation_name": "\"postgres\".\"public_iterable_dev\".\"stg_iterable__campaign_label_history_tmp\"", "raw_code": "{{ config(enabled=var('iterable__using_campaign_label_history', True)) }}\n\n{{\n fivetran_utils.union_connections(\n connection_dictionary='iterable_sources',\n single_source_name='iterable',\n single_table_name='campaign_label_history'\n )\n}}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["iterable", "campaign_label_history"], ["iterable", "campaign_label_history"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.fivetran_utils.union_connections"], "nodes": ["source.iterable.iterable.campaign_label_history"]}, "compiled_path": "target/compiled/iterable/models/staging/tmp/stg_iterable__campaign_label_history_tmp.sql", "compiled": true, "compiled_code": "\n\n\n\n\n-- ** Values passed to adapter.get_relation:\n -- full-identifier_var: iterable_campaign_label_history_identifier\n -- database: postgres \n -- schema: public\n -- identifier: campaign_label_history_data\n\n\n select\n \"campaign_id\",\n \"label\",\n \"updated_at\",\n \"_fivetran_synced\"\n from \"postgres\".\"public\".\"campaign_label_history_data\" as source_table\n\n ", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.stg_iterable__list_tmp": {"database": "postgres", "schema": "public_iterable_dev", "name": "stg_iterable__list_tmp", "resource_type": "model", "package_name": "iterable", "path": "staging/tmp/stg_iterable__list_tmp.sql", "original_file_path": "models/staging/tmp/stg_iterable__list_tmp.sql", "unique_id": "model.iterable.stg_iterable__list_tmp", "fqn": ["iterable", "staging", "tmp", "stg_iterable__list_tmp"], "alias": "stg_iterable__list_tmp", "checksum": {"name": "sha256", "checksum": "95fbbf63205ef9000c19e76270c8ab96e23c4f9d8072f3892a08f20648a42b5a"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"materialized": "view", "schema": "iterable_{{ var('directed_schema','dev') }}", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789079003.9701025, "relation_name": "\"postgres\".\"public_iterable_dev\".\"stg_iterable__list_tmp\"", "raw_code": "{{\n fivetran_utils.union_connections(\n connection_dictionary='iterable_sources',\n single_source_name='iterable',\n single_table_name='list'\n )\n}}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["iterable", "list"], ["iterable", "list"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.fivetran_utils.union_connections"], "nodes": ["source.iterable.iterable.list"]}, "compiled_path": "target/compiled/iterable/models/staging/tmp/stg_iterable__list_tmp.sql", "compiled": true, "compiled_code": "\n\n\n-- ** Values passed to adapter.get_relation:\n -- full-identifier_var: iterable_list_identifier\n -- database: postgres \n -- schema: public\n -- identifier: list_data\n\n\n select\n \"id\",\n \"name\",\n \"created_at\",\n \"list_type\",\n \"_fivetran_deleted\",\n \"_fivetran_synced\",\n \"description\"\n from \"postgres\".\"public\".\"list_data\" as source_table\n\n ", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.stg_iterable__channel_tmp": {"database": "postgres", "schema": "public_iterable_dev", "name": "stg_iterable__channel_tmp", "resource_type": "model", "package_name": "iterable", "path": "staging/tmp/stg_iterable__channel_tmp.sql", "original_file_path": "models/staging/tmp/stg_iterable__channel_tmp.sql", "unique_id": "model.iterable.stg_iterable__channel_tmp", "fqn": ["iterable", "staging", "tmp", "stg_iterable__channel_tmp"], "alias": "stg_iterable__channel_tmp", "checksum": {"name": "sha256", "checksum": "0516bc3567b725378b33829b8c3e7dc1b6680922f2d1e7824a913b82ca617905"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"materialized": "view", "schema": "iterable_{{ var('directed_schema','dev') }}", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789079003.9745605, "relation_name": "\"postgres\".\"public_iterable_dev\".\"stg_iterable__channel_tmp\"", "raw_code": "{{\n fivetran_utils.union_connections(\n connection_dictionary='iterable_sources',\n single_source_name='iterable',\n single_table_name='channel'\n )\n}}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["iterable", "channel"], ["iterable", "channel"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.fivetran_utils.union_connections"], "nodes": ["source.iterable.iterable.channel"]}, "compiled_path": "target/compiled/iterable/models/staging/tmp/stg_iterable__channel_tmp.sql", "compiled": true, "compiled_code": "\n\n\n-- ** Values passed to adapter.get_relation:\n -- full-identifier_var: iterable_channel_identifier\n -- database: postgres \n -- schema: public\n -- identifier: channel_data\n\n\n select\n \"id\",\n \"name\",\n \"channel_type\",\n \"message_medium\",\n \"_fivetran_deleted\",\n \"_fivetran_synced\"\n from \"postgres\".\"public\".\"channel_data\" as source_table\n\n ", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.stg_iterable__user_unsubscribed_channel_tmp": {"database": "postgres", "schema": "public_iterable_dev", "name": "stg_iterable__user_unsubscribed_channel_tmp", "resource_type": "model", "package_name": "iterable", "path": "staging/tmp/stg_iterable__user_unsubscribed_channel_tmp.sql", "original_file_path": "models/staging/tmp/stg_iterable__user_unsubscribed_channel_tmp.sql", "unique_id": "model.iterable.stg_iterable__user_unsubscribed_channel_tmp", "fqn": ["iterable", "staging", "tmp", "stg_iterable__user_unsubscribed_channel_tmp"], "alias": "stg_iterable__user_unsubscribed_channel_tmp", "checksum": {"name": "sha256", "checksum": "a8d43331a84f0d1dae8511478d01cded7dfb389fef925f7173f50eb6b6b9c142"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"materialized": "view", "schema": "iterable_{{ var('directed_schema','dev') }}", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789079003.979078, "relation_name": "\"postgres\".\"public_iterable_dev\".\"stg_iterable__user_unsubscribed_channel_tmp\"", "raw_code": "{{\n fivetran_utils.union_connections(\n connection_dictionary='iterable_sources',\n single_source_name='iterable',\n single_table_name='user_unsubscribed_channel' if does_table_exist('user_unsubscribed_channel') else 'user_unsubscribed_channel_history'\n )\n}}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["iterable", "user_unsubscribed_channel_history"], ["iterable", "user_unsubscribed_channel_history"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.iterable.does_table_exist", "macro.fivetran_utils.union_connections"], "nodes": ["source.iterable.iterable.user_unsubscribed_channel_history"]}, "compiled_path": "target/compiled/iterable/models/staging/tmp/stg_iterable__user_unsubscribed_channel_tmp.sql", "compiled": true, "compiled_code": "\n\n\n-- ** Values passed to adapter.get_relation:\n -- full-identifier_var: iterable_user_unsubscribed_channel_identifier\n -- database: postgres \n -- schema: public\n -- identifier: user_unsubscribed_channel_data\n\n\n select\n \"_fivetran_id\",\n \"channel_id\",\n \"_fivetran_synced\"\n from \"postgres\".\"public\".\"user_unsubscribed_channel_data\" as source_table\n\n ", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "test.iterable.not_null_iterable__campaigns_campaign_id.03c9448919": {"database": "postgres", "schema": "public_dbt_test__audit", "name": "not_null_iterable__campaigns_campaign_id", "resource_type": "test", "package_name": "iterable", "path": "not_null_iterable__campaigns_campaign_id.sql", "original_file_path": "models/iterable.yml", "unique_id": "test.iterable.not_null_iterable__campaigns_campaign_id.03c9448919", "fqn": ["iterable", "not_null_iterable__campaigns_campaign_id"], "alias": "not_null_iterable__campaigns_campaign_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "sql_header": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {}, "created_at": 1789079004.283278, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "iterable__campaigns", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.iterable.iterable__campaigns"]}, "compiled_path": "target/compiled/iterable/models/iterable.yml/not_null_iterable__campaigns_campaign_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect campaign_id\nfrom \"postgres\".\"public_iterable_dev\".\"iterable__campaigns\"\nwhere campaign_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "campaign_id", "file_key_name": "models.iterable__campaigns", "attached_node": "model.iterable.iterable__campaigns", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "campaign_id", "model": "{{ get_where_subquery(ref('iterable__campaigns')) }}"}, "namespace": null}}, "test.iterable.not_null_iterable__events_event_id.ed1d28a650": {"database": "postgres", "schema": "public_dbt_test__audit", "name": "not_null_iterable__events_event_id", "resource_type": "test", "package_name": "iterable", "path": "not_null_iterable__events_event_id.sql", "original_file_path": "models/iterable.yml", "unique_id": "test.iterable.not_null_iterable__events_event_id.ed1d28a650", "fqn": ["iterable", "not_null_iterable__events_event_id"], "alias": "not_null_iterable__events_event_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "sql_header": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {}, "created_at": 1789079004.285318, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "iterable__events", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.iterable.iterable__events"]}, "compiled_path": "target/compiled/iterable/models/iterable.yml/not_null_iterable__events_event_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect event_id\nfrom \"postgres\".\"public_iterable_dev\".\"iterable__events\"\nwhere event_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "event_id", "file_key_name": "models.iterable__events", "attached_node": "model.iterable.iterable__events", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "event_id", "model": "{{ get_where_subquery(ref('iterable__events')) }}"}, "namespace": null}}, "test.iterable.not_null_iterable__journeys_journey_id.b5c6b8783a": {"database": "postgres", "schema": "public_dbt_test__audit", "name": "not_null_iterable__journeys_journey_id", "resource_type": "test", "package_name": "iterable", "path": "not_null_iterable__journeys_journey_id.sql", "original_file_path": "models/iterable.yml", "unique_id": "test.iterable.not_null_iterable__journeys_journey_id.b5c6b8783a", "fqn": ["iterable", "not_null_iterable__journeys_journey_id"], "alias": "not_null_iterable__journeys_journey_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "sql_header": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {}, "created_at": 1789079004.2870908, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "iterable__journeys", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.iterable.iterable__journeys"]}, "compiled_path": "target/compiled/iterable/models/iterable.yml/not_null_iterable__journeys_journey_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect journey_id\nfrom \"postgres\".\"public_iterable_dev\".\"iterable__journeys\"\nwhere journey_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "journey_id", "file_key_name": "models.iterable__journeys", "attached_node": "model.iterable.iterable__journeys", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "journey_id", "model": "{{ get_where_subquery(ref('iterable__journeys')) }}"}, "namespace": null}}, "test.iterable.unique_iterable__journeys_unique_journey_id.ba86841246": {"database": "postgres", "schema": "public_dbt_test__audit", "name": "unique_iterable__journeys_unique_journey_id", "resource_type": "test", "package_name": "iterable", "path": "unique_iterable__journeys_unique_journey_id.sql", "original_file_path": "models/iterable.yml", "unique_id": "test.iterable.unique_iterable__journeys_unique_journey_id.ba86841246", "fqn": ["iterable", "unique_iterable__journeys_unique_journey_id"], "alias": "unique_iterable__journeys_unique_journey_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "sql_header": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {}, "created_at": 1789079004.2887745, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "iterable__journeys", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.iterable.iterable__journeys"]}, "compiled_path": "target/compiled/iterable/models/iterable.yml/unique_iterable__journeys_unique_journey_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n unique_journey_id as unique_field,\n count(*) as n_records\n\nfrom \"postgres\".\"public_iterable_dev\".\"iterable__journeys\"\nwhere unique_journey_id is not null\ngroup by unique_journey_id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "unique_journey_id", "file_key_name": "models.iterable__journeys", "attached_node": "model.iterable.iterable__journeys", "test_metadata": {"name": "unique", "kwargs": {"column_name": "unique_journey_id", "model": "{{ get_where_subquery(ref('iterable__journeys')) }}"}, "namespace": null}}, "test.iterable.not_null_iterable__user_unsubscriptions_unique_user_key.f8db72932b": {"database": "postgres", "schema": "public_dbt_test__audit", "name": "not_null_iterable__user_unsubscriptions_unique_user_key", "resource_type": "test", "package_name": "iterable", "path": "not_null_iterable__user_unsubscriptions_unique_user_key.sql", "original_file_path": "models/iterable.yml", "unique_id": "test.iterable.not_null_iterable__user_unsubscriptions_unique_user_key.f8db72932b", "fqn": ["iterable", "not_null_iterable__user_unsubscriptions_unique_user_key"], "alias": "not_null_iterable__user_unsubscriptions_unique_user_key", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "sql_header": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {}, "created_at": 1789079004.2914467, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "iterable__user_unsubscriptions", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.iterable.iterable__user_unsubscriptions"]}, "compiled_path": "target/compiled/iterable/models/iterable.yml/not_null_iterable__user_unsubscriptions_unique_user_key.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect unique_user_key\nfrom \"postgres\".\"public_iterable_dev\".\"iterable__user_unsubscriptions\"\nwhere unique_user_key is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "unique_user_key", "file_key_name": "models.iterable__user_unsubscriptions", "attached_node": "model.iterable.iterable__user_unsubscriptions", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "unique_user_key", "model": "{{ get_where_subquery(ref('iterable__user_unsubscriptions')) }}"}, "namespace": null}}, "test.iterable.not_null_iterable__users_unique_user_key.4ca37a26c8": {"database": "postgres", "schema": "public_dbt_test__audit", "name": "not_null_iterable__users_unique_user_key", "resource_type": "test", "package_name": "iterable", "path": "not_null_iterable__users_unique_user_key.sql", "original_file_path": "models/iterable.yml", "unique_id": "test.iterable.not_null_iterable__users_unique_user_key.4ca37a26c8", "fqn": ["iterable", "not_null_iterable__users_unique_user_key"], "alias": "not_null_iterable__users_unique_user_key", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "sql_header": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {}, "created_at": 1789079004.293257, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "iterable__users", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.iterable.iterable__users"]}, "compiled_path": "target/compiled/iterable/models/iterable.yml/not_null_iterable__users_unique_user_key.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect unique_user_key\nfrom \"postgres\".\"public_iterable_dev\".\"iterable__users\"\nwhere unique_user_key is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "unique_user_key", "file_key_name": "models.iterable__users", "attached_node": "model.iterable.iterable__users", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "unique_user_key", "model": "{{ get_where_subquery(ref('iterable__users')) }}"}, "namespace": null}}, "test.iterable.not_null_stg_iterable__campaign_history_campaign_id.b7c36e4525": {"database": "postgres", "schema": "public_dbt_test__audit", "name": "not_null_stg_iterable__campaign_history_campaign_id", "resource_type": "test", "package_name": "iterable", "path": "not_null_stg_iterable__campaign_history_campaign_id.sql", "original_file_path": "models/staging/stg_iterable.yml", "unique_id": "test.iterable.not_null_stg_iterable__campaign_history_campaign_id.b7c36e4525", "fqn": ["iterable", "staging", "not_null_stg_iterable__campaign_history_campaign_id"], "alias": "not_null_stg_iterable__campaign_history_campaign_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "sql_header": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {}, "created_at": 1789079004.313116, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__campaign_history", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.iterable.stg_iterable__campaign_history"]}, "compiled_path": "target/compiled/iterable/models/staging/stg_iterable.yml/not_null_stg_iterable__campaign_history_campaign_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect campaign_id\nfrom \"postgres\".\"public_iterable_dev\".\"stg_iterable__campaign_history\"\nwhere campaign_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "campaign_id", "file_key_name": "models.stg_iterable__campaign_history", "attached_node": "model.iterable.stg_iterable__campaign_history", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "campaign_id", "model": "{{ get_where_subquery(ref('stg_iterable__campaign_history')) }}"}, "namespace": null}}, "test.iterable.not_null_stg_iterable__campaign_label_history_campaign_id.1918cef89a": {"database": "postgres", "schema": "public_dbt_test__audit", "name": "not_null_stg_iterable__campaign_label_history_campaign_id", "resource_type": "test", "package_name": "iterable", "path": "not_null_stg_iterable__campaign_label_history_campaign_id.sql", "original_file_path": "models/staging/stg_iterable.yml", "unique_id": "test.iterable.not_null_stg_iterable__campaign_label_history_campaign_id.1918cef89a", "fqn": ["iterable", "staging", "not_null_stg_iterable__campaign_label_history_campaign_id"], "alias": "not_null_stg_iterable__campaign_label_history_campaign_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "sql_header": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {}, "created_at": 1789079004.314922, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__campaign_label_history", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.iterable.stg_iterable__campaign_label_history"]}, "compiled_path": "target/compiled/iterable/models/staging/stg_iterable.yml/not_null_stg_iterable__campaign_label_history_campaign_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect campaign_id\nfrom \"postgres\".\"public_iterable_dev\".\"stg_iterable__campaign_label_history\"\nwhere campaign_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "campaign_id", "file_key_name": "models.stg_iterable__campaign_label_history", "attached_node": "model.iterable.stg_iterable__campaign_label_history", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "campaign_id", "model": "{{ get_where_subquery(ref('stg_iterable__campaign_label_history')) }}"}, "namespace": null}}, "test.iterable.not_null_stg_iterable__campaign_list_history_campaign_id.208f9bf9ed": {"database": "postgres", "schema": "public_dbt_test__audit", "name": "not_null_stg_iterable__campaign_list_history_campaign_id", "resource_type": "test", "package_name": "iterable", "path": "not_null_stg_iterable__campaign_list_history_campaign_id.sql", "original_file_path": "models/staging/stg_iterable.yml", "unique_id": "test.iterable.not_null_stg_iterable__campaign_list_history_campaign_id.208f9bf9ed", "fqn": ["iterable", "staging", "not_null_stg_iterable__campaign_list_history_campaign_id"], "alias": "not_null_stg_iterable__campaign_list_history_campaign_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "sql_header": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {}, "created_at": 1789079004.3166952, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__campaign_list_history", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.iterable.stg_iterable__campaign_list_history"]}, "compiled_path": "target/compiled/iterable/models/staging/stg_iterable.yml/not_null_stg_iterable__campaign_list_history_campaign_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect campaign_id\nfrom \"postgres\".\"public_iterable_dev\".\"stg_iterable__campaign_list_history\"\nwhere campaign_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "campaign_id", "file_key_name": "models.stg_iterable__campaign_list_history", "attached_node": "model.iterable.stg_iterable__campaign_list_history", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "campaign_id", "model": "{{ get_where_subquery(ref('stg_iterable__campaign_list_history')) }}"}, "namespace": null}}, "test.iterable.not_null_stg_iterable__campaign_suppression_list_history_campaign_id.3921289710": {"database": "postgres", "schema": "public_dbt_test__audit", "name": "not_null_stg_iterable__campaign_suppression_list_history_campaign_id", "resource_type": "test", "package_name": "iterable", "path": "not_null_stg_iterable__campaig_3ce753a10225cac67c8a1434b5541997.sql", "original_file_path": "models/staging/stg_iterable.yml", "unique_id": "test.iterable.not_null_stg_iterable__campaign_suppression_list_history_campaign_id.3921289710", "fqn": ["iterable", "staging", "not_null_stg_iterable__campaign_suppression_list_history_campaign_id"], "alias": "not_null_stg_iterable__campaig_3ce753a10225cac67c8a1434b5541997", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "not_null_stg_iterable__campaig_3ce753a10225cac67c8a1434b5541997", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "sql_header": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"alias": "not_null_stg_iterable__campaig_3ce753a10225cac67c8a1434b5541997"}, "created_at": 1789079004.3184543, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"not_null_stg_iterable__campaig_3ce753a10225cac67c8a1434b5541997\") }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__campaign_suppression_list_history", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.iterable.stg_iterable__campaign_suppression_list_history"]}, "compiled_path": "target/compiled/iterable/models/staging/stg_iterable.yml/not_null_stg_iterable__campaig_3ce753a10225cac67c8a1434b5541997.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect campaign_id\nfrom \"postgres\".\"public_iterable_dev\".\"stg_iterable__campaign_suppression_list_history\"\nwhere campaign_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "campaign_id", "file_key_name": "models.stg_iterable__campaign_suppression_list_history", "attached_node": "model.iterable.stg_iterable__campaign_suppression_list_history", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "campaign_id", "model": "{{ get_where_subquery(ref('stg_iterable__campaign_suppression_list_history')) }}"}, "namespace": null}}, "test.iterable.not_null_stg_iterable__channel_channel_id.182ceb9636": {"database": "postgres", "schema": "public_dbt_test__audit", "name": "not_null_stg_iterable__channel_channel_id", "resource_type": "test", "package_name": "iterable", "path": "not_null_stg_iterable__channel_channel_id.sql", "original_file_path": "models/staging/stg_iterable.yml", "unique_id": "test.iterable.not_null_stg_iterable__channel_channel_id.182ceb9636", "fqn": ["iterable", "staging", "not_null_stg_iterable__channel_channel_id"], "alias": "not_null_stg_iterable__channel_channel_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "sql_header": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {}, "created_at": 1789079004.3201542, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__channel", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.iterable.stg_iterable__channel"]}, "compiled_path": "target/compiled/iterable/models/staging/stg_iterable.yml/not_null_stg_iterable__channel_channel_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect channel_id\nfrom \"postgres\".\"public_iterable_dev\".\"stg_iterable__channel\"\nwhere channel_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "channel_id", "file_key_name": "models.stg_iterable__channel", "attached_node": "model.iterable.stg_iterable__channel", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "channel_id", "model": "{{ get_where_subquery(ref('stg_iterable__channel')) }}"}, "namespace": null}}, "test.iterable.not_null_stg_iterable__event_event_id.370cd4bc9d": {"database": "postgres", "schema": "public_dbt_test__audit", "name": "not_null_stg_iterable__event_event_id", "resource_type": "test", "package_name": "iterable", "path": "not_null_stg_iterable__event_event_id.sql", "original_file_path": "models/staging/stg_iterable.yml", "unique_id": "test.iterable.not_null_stg_iterable__event_event_id.370cd4bc9d", "fqn": ["iterable", "staging", "not_null_stg_iterable__event_event_id"], "alias": "not_null_stg_iterable__event_event_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "sql_header": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {}, "created_at": 1789079004.3218014, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__event", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.iterable.stg_iterable__event"]}, "compiled_path": "target/compiled/iterable/models/staging/stg_iterable.yml/not_null_stg_iterable__event_event_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect event_id\nfrom \"postgres\".\"public_iterable_dev\".\"stg_iterable__event\"\nwhere event_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "event_id", "file_key_name": "models.stg_iterable__event", "attached_node": "model.iterable.stg_iterable__event", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "event_id", "model": "{{ get_where_subquery(ref('stg_iterable__event')) }}"}, "namespace": null}}, "test.iterable.not_null_stg_iterable__event_unique_event_id.e2b46d3bb6": {"database": "postgres", "schema": "public_dbt_test__audit", "name": "not_null_stg_iterable__event_unique_event_id", "resource_type": "test", "package_name": "iterable", "path": "not_null_stg_iterable__event_unique_event_id.sql", "original_file_path": "models/staging/stg_iterable.yml", "unique_id": "test.iterable.not_null_stg_iterable__event_unique_event_id.e2b46d3bb6", "fqn": ["iterable", "staging", "not_null_stg_iterable__event_unique_event_id"], "alias": "not_null_stg_iterable__event_unique_event_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "sql_header": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {}, "created_at": 1789079004.3235013, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__event", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.iterable.stg_iterable__event"]}, "compiled_path": "target/compiled/iterable/models/staging/stg_iterable.yml/not_null_stg_iterable__event_unique_event_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect unique_event_id\nfrom \"postgres\".\"public_iterable_dev\".\"stg_iterable__event\"\nwhere unique_event_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "unique_event_id", "file_key_name": "models.stg_iterable__event", "attached_node": "model.iterable.stg_iterable__event", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "unique_event_id", "model": "{{ get_where_subquery(ref('stg_iterable__event')) }}"}, "namespace": null}}, "test.iterable.not_null_stg_iterable__event_extension_event_id.144dedcd30": {"database": "postgres", "schema": "public_dbt_test__audit", "name": "not_null_stg_iterable__event_extension_event_id", "resource_type": "test", "package_name": "iterable", "path": "not_null_stg_iterable__event_extension_event_id.sql", "original_file_path": "models/staging/stg_iterable.yml", "unique_id": "test.iterable.not_null_stg_iterable__event_extension_event_id.144dedcd30", "fqn": ["iterable", "staging", "not_null_stg_iterable__event_extension_event_id"], "alias": "not_null_stg_iterable__event_extension_event_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "sql_header": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {}, "created_at": 1789079004.3252597, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__event_extension", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.iterable.stg_iterable__event_extension"]}, "compiled_path": "target/compiled/iterable/models/staging/stg_iterable.yml/not_null_stg_iterable__event_extension_event_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect event_id\nfrom \"postgres\".\"public_iterable_dev\".\"stg_iterable__event_extension\"\nwhere event_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "event_id", "file_key_name": "models.stg_iterable__event_extension", "attached_node": "model.iterable.stg_iterable__event_extension", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "event_id", "model": "{{ get_where_subquery(ref('stg_iterable__event_extension')) }}"}, "namespace": null}}, "test.iterable.not_null_stg_iterable__journey_journey_id.cc38bd633c": {"database": "postgres", "schema": "public_dbt_test__audit", "name": "not_null_stg_iterable__journey_journey_id", "resource_type": "test", "package_name": "iterable", "path": "not_null_stg_iterable__journey_journey_id.sql", "original_file_path": "models/staging/stg_iterable.yml", "unique_id": "test.iterable.not_null_stg_iterable__journey_journey_id.cc38bd633c", "fqn": ["iterable", "staging", "not_null_stg_iterable__journey_journey_id"], "alias": "not_null_stg_iterable__journey_journey_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "sql_header": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {}, "created_at": 1789079004.326939, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__journey", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.iterable.stg_iterable__journey"]}, "compiled_path": "target/compiled/iterable/models/staging/stg_iterable.yml/not_null_stg_iterable__journey_journey_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect journey_id\nfrom \"postgres\".\"public_iterable_dev\".\"stg_iterable__journey\"\nwhere journey_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "journey_id", "file_key_name": "models.stg_iterable__journey", "attached_node": "model.iterable.stg_iterable__journey", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "journey_id", "model": "{{ get_where_subquery(ref('stg_iterable__journey')) }}"}, "namespace": null}}, "test.iterable.not_null_stg_iterable__list_list_id.47029d839a": {"database": "postgres", "schema": "public_dbt_test__audit", "name": "not_null_stg_iterable__list_list_id", "resource_type": "test", "package_name": "iterable", "path": "not_null_stg_iterable__list_list_id.sql", "original_file_path": "models/staging/stg_iterable.yml", "unique_id": "test.iterable.not_null_stg_iterable__list_list_id.47029d839a", "fqn": ["iterable", "staging", "not_null_stg_iterable__list_list_id"], "alias": "not_null_stg_iterable__list_list_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "sql_header": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {}, "created_at": 1789079004.3286154, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__list", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.iterable.stg_iterable__list"]}, "compiled_path": "target/compiled/iterable/models/staging/stg_iterable.yml/not_null_stg_iterable__list_list_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect list_id\nfrom \"postgres\".\"public_iterable_dev\".\"stg_iterable__list\"\nwhere list_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "list_id", "file_key_name": "models.stg_iterable__list", "attached_node": "model.iterable.stg_iterable__list", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "list_id", "model": "{{ get_where_subquery(ref('stg_iterable__list')) }}"}, "namespace": null}}, "test.iterable.not_null_stg_iterable__message_type_message_type_id.75eaa6fa62": {"database": "postgres", "schema": "public_dbt_test__audit", "name": "not_null_stg_iterable__message_type_message_type_id", "resource_type": "test", "package_name": "iterable", "path": "not_null_stg_iterable__message_type_message_type_id.sql", "original_file_path": "models/staging/stg_iterable.yml", "unique_id": "test.iterable.not_null_stg_iterable__message_type_message_type_id.75eaa6fa62", "fqn": ["iterable", "staging", "not_null_stg_iterable__message_type_message_type_id"], "alias": "not_null_stg_iterable__message_type_message_type_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "sql_header": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {}, "created_at": 1789079004.3303366, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__message_type", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.iterable.stg_iterable__message_type"]}, "compiled_path": "target/compiled/iterable/models/staging/stg_iterable.yml/not_null_stg_iterable__message_type_message_type_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect message_type_id\nfrom \"postgres\".\"public_iterable_dev\".\"stg_iterable__message_type\"\nwhere message_type_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "message_type_id", "file_key_name": "models.stg_iterable__message_type", "attached_node": "model.iterable.stg_iterable__message_type", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "message_type_id", "model": "{{ get_where_subquery(ref('stg_iterable__message_type')) }}"}, "namespace": null}}, "test.iterable.not_null_stg_iterable__template_history_template_id.14b24a1dfe": {"database": "postgres", "schema": "public_dbt_test__audit", "name": "not_null_stg_iterable__template_history_template_id", "resource_type": "test", "package_name": "iterable", "path": "not_null_stg_iterable__template_history_template_id.sql", "original_file_path": "models/staging/stg_iterable.yml", "unique_id": "test.iterable.not_null_stg_iterable__template_history_template_id.14b24a1dfe", "fqn": ["iterable", "staging", "not_null_stg_iterable__template_history_template_id"], "alias": "not_null_stg_iterable__template_history_template_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "sql_header": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {}, "created_at": 1789079004.332152, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__template_history", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.iterable.stg_iterable__template_history"]}, "compiled_path": "target/compiled/iterable/models/staging/stg_iterable.yml/not_null_stg_iterable__template_history_template_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect template_id\nfrom \"postgres\".\"public_iterable_dev\".\"stg_iterable__template_history\"\nwhere template_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "template_id", "file_key_name": "models.stg_iterable__template_history", "attached_node": "model.iterable.stg_iterable__template_history", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "template_id", "model": "{{ get_where_subquery(ref('stg_iterable__template_history')) }}"}, "namespace": null}}, "test.iterable.not_null_stg_iterable__list_user__fivetran_user_id.cca4b34c07": {"database": "postgres", "schema": "public_dbt_test__audit", "name": "not_null_stg_iterable__list_user__fivetran_user_id", "resource_type": "test", "package_name": "iterable", "path": "not_null_stg_iterable__list_user__fivetran_user_id.sql", "original_file_path": "models/staging/stg_iterable.yml", "unique_id": "test.iterable.not_null_stg_iterable__list_user__fivetran_user_id.cca4b34c07", "fqn": ["iterable", "staging", "not_null_stg_iterable__list_user__fivetran_user_id"], "alias": "not_null_stg_iterable__list_user__fivetran_user_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "sql_header": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {}, "created_at": 1789079004.3338337, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__list_user", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.iterable.stg_iterable__list_user"]}, "compiled_path": "target/compiled/iterable/models/staging/stg_iterable.yml/not_null_stg_iterable__list_user__fivetran_user_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect _fivetran_user_id\nfrom \"postgres\".\"public_iterable_dev\".\"stg_iterable__list_user\"\nwhere _fivetran_user_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "_fivetran_user_id", "file_key_name": "models.stg_iterable__list_user", "attached_node": "model.iterable.stg_iterable__list_user", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "_fivetran_user_id", "model": "{{ get_where_subquery(ref('stg_iterable__list_user')) }}"}, "namespace": null}}, "test.iterable.not_null_stg_iterable__user_history_unique_user_key.2845af2127": {"database": "postgres", "schema": "public_dbt_test__audit", "name": "not_null_stg_iterable__user_history_unique_user_key", "resource_type": "test", "package_name": "iterable", "path": "not_null_stg_iterable__user_history_unique_user_key.sql", "original_file_path": "models/staging/stg_iterable.yml", "unique_id": "test.iterable.not_null_stg_iterable__user_history_unique_user_key.2845af2127", "fqn": ["iterable", "staging", "not_null_stg_iterable__user_history_unique_user_key"], "alias": "not_null_stg_iterable__user_history_unique_user_key", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "sql_header": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {}, "created_at": 1789079004.3355062, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__user_history", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.iterable.stg_iterable__user_history"]}, "compiled_path": "target/compiled/iterable/models/staging/stg_iterable.yml/not_null_stg_iterable__user_history_unique_user_key.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect unique_user_key\nfrom \"postgres\".\"public_iterable_dev\".\"stg_iterable__user_history\"\nwhere unique_user_key is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "unique_user_key", "file_key_name": "models.stg_iterable__user_history", "attached_node": "model.iterable.stg_iterable__user_history", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "unique_user_key", "model": "{{ get_where_subquery(ref('stg_iterable__user_history')) }}"}, "namespace": null}}, "test.iterable.not_null_stg_iterable__user_unsubscribed_channel_channel_id.da0ed9e9be": {"database": "postgres", "schema": "public_dbt_test__audit", "name": "not_null_stg_iterable__user_unsubscribed_channel_channel_id", "resource_type": "test", "package_name": "iterable", "path": "not_null_stg_iterable__user_unsubscribed_channel_channel_id.sql", "original_file_path": "models/staging/stg_iterable.yml", "unique_id": "test.iterable.not_null_stg_iterable__user_unsubscribed_channel_channel_id.da0ed9e9be", "fqn": ["iterable", "staging", "not_null_stg_iterable__user_unsubscribed_channel_channel_id"], "alias": "not_null_stg_iterable__user_unsubscribed_channel_channel_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "sql_header": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {}, "created_at": 1789079004.3371725, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__user_unsubscribed_channel", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.iterable.stg_iterable__user_unsubscribed_channel"]}, "compiled_path": "target/compiled/iterable/models/staging/stg_iterable.yml/not_null_stg_iterable__user_unsubscribed_channel_channel_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect channel_id\nfrom \"postgres\".\"public_iterable_dev\".\"stg_iterable__user_unsubscribed_channel\"\nwhere channel_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "channel_id", "file_key_name": "models.stg_iterable__user_unsubscribed_channel", "attached_node": "model.iterable.stg_iterable__user_unsubscribed_channel", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "channel_id", "model": "{{ get_where_subquery(ref('stg_iterable__user_unsubscribed_channel')) }}"}, "namespace": null}}, "test.iterable.not_null_stg_iterable__user_unsub_message_type_message_type_id.268a89ea6f": {"database": "postgres", "schema": "public_dbt_test__audit", "name": "not_null_stg_iterable__user_unsub_message_type_message_type_id", "resource_type": "test", "package_name": "iterable", "path": "not_null_stg_iterable__user_unsub_message_type_message_type_id.sql", "original_file_path": "models/staging/stg_iterable.yml", "unique_id": "test.iterable.not_null_stg_iterable__user_unsub_message_type_message_type_id.268a89ea6f", "fqn": ["iterable", "staging", "not_null_stg_iterable__user_unsub_message_type_message_type_id"], "alias": "not_null_stg_iterable__user_unsub_message_type_message_type_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "sql_header": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {}, "created_at": 1789079004.3389616, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__user_unsub_message_type", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.iterable.stg_iterable__user_unsub_message_type"]}, "compiled_path": "target/compiled/iterable/models/staging/stg_iterable.yml/not_null_stg_iterable__user_unsub_message_type_message_type_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect message_type_id\nfrom \"postgres\".\"public_iterable_dev\".\"stg_iterable__user_unsub_message_type\"\nwhere message_type_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "message_type_id", "file_key_name": "models.stg_iterable__user_unsub_message_type", "attached_node": "model.iterable.stg_iterable__user_unsub_message_type", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "message_type_id", "model": "{{ get_where_subquery(ref('stg_iterable__user_unsub_message_type')) }}"}, "namespace": null}}}, "sources": {"source.iterable.iterable.campaign_history": {"database": "postgres", "schema": "public", "name": "campaign_history", "resource_type": "source", "package_name": "iterable", "path": "models/staging/src_iterable.yml", "original_file_path": "models/staging/src_iterable.yml", "unique_id": "source.iterable.iterable.campaign_history", "fqn": ["iterable", "staging", "iterable", "campaign_history"], "source_name": "iterable", "source_description": "", "loader": "fivetran", "identifier": "campaign_history_data", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Table containing a history of campaigns.", "columns": {"id": {"name": "id", "description": "Unique identifier of the campaign record", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "updated_at": {"name": "updated_at", "description": "Last update's timestamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "name": {"name": "name", "description": "User defined name of the campaign.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "campaign_state": {"name": "campaign_state", "description": "State of the campaign. Can be Draft, Ready, Scheduled, Running, Finished, Starting, Aborted or Recurring", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "type": {"name": "type", "description": "The campaign type. Can be Blast or Triggered", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "send_size": {"name": "send_size", "description": "Size of the campaign. Number of individuals included in the campaign", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "start_at": {"name": "start_at", "description": "Start timestamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "ended_at": {"name": "ended_at", "description": "Ended timestamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "created_at": {"name": "created_at", "description": "Creation timestamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "recurring_campaign_id": {"name": "recurring_campaign_id", "description": "Reference to the recurring campaign, if applicable", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "created_by_user_id": {"name": "created_by_user_id", "description": "Reference to the user who created the campaign", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "template_id": {"name": "template_id", "description": "Reference to the campaign template", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "updated_by_user_id": {"name": "updated_by_user_id", "description": "ID of the user who updated this record", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "message_medium": {"name": "message_medium", "description": "The medium that this message was sent via, for example Email or InApp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": "_fivetran_synced", "loaded_at_query": null, "meta": {}, "tags": [], "static_analysis": null}, "patch_path": null, "unrendered_config": {"loaded_at_field": "_fivetran_synced", "enabled": true, "loaded_at_query": null, "meta": {}, "tags": []}, "relation_name": "\"postgres\".\"public\".\"campaign_history_data\"", "created_at": 1789079004.4525154, "unrendered_database": "{% if target.type != 'spark' %}{{ var('iterable_database', target.database)}}{% endif %}", "unrendered_schema": "{{var ('iterable_schema', 'iterable')}}", "doc_blocks": []}, "source.iterable.iterable.campaign_label_history": {"database": "postgres", "schema": "public", "name": "campaign_label_history", "resource_type": "source", "package_name": "iterable", "path": "models/staging/src_iterable.yml", "original_file_path": "models/staging/src_iterable.yml", "unique_id": "source.iterable.iterable.campaign_label_history", "fqn": ["iterable", "staging", "iterable", "campaign_label_history"], "source_name": "iterable", "source_description": "", "loader": "fivetran", "identifier": "campaign_label_history_data", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Table containing a history of labels.", "columns": {"campaign_id": {"name": "campaign_id", "description": "Reference to the campaign associated with the label", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "label": {"name": "label", "description": "Name of the label", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "updated_at": {"name": "updated_at", "description": "Last update timestamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": "_fivetran_synced", "loaded_at_query": null, "meta": {}, "tags": [], "static_analysis": null}, "patch_path": null, "unrendered_config": {"loaded_at_field": "_fivetran_synced", "enabled": true, "loaded_at_query": null, "meta": {}, "tags": []}, "relation_name": "\"postgres\".\"public\".\"campaign_label_history_data\"", "created_at": 1789079004.453962, "unrendered_database": "{% if target.type != 'spark' %}{{ var('iterable_database', target.database)}}{% endif %}", "unrendered_schema": "{{var ('iterable_schema', 'iterable')}}", "doc_blocks": []}, "source.iterable.iterable.campaign_list_history": {"database": "postgres", "schema": "public", "name": "campaign_list_history", "resource_type": "source", "package_name": "iterable", "path": "models/staging/src_iterable.yml", "original_file_path": "models/staging/src_iterable.yml", "unique_id": "source.iterable.iterable.campaign_list_history", "fqn": ["iterable", "staging", "iterable", "campaign_list_history"], "source_name": "iterable", "source_description": "", "loader": "fivetran", "identifier": "campaign_list_history_data", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Table containing a history of lists.", "columns": {"campaign_id": {"name": "campaign_id", "description": "Reference to the campaign associated with the label", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "list_id": {"name": "list_id", "description": "Reference to the list used", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "updated_at": {"name": "updated_at", "description": "Last update timestamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": "_fivetran_synced", "loaded_at_query": null, "meta": {}, "tags": [], "static_analysis": null}, "patch_path": null, "unrendered_config": {"loaded_at_field": "_fivetran_synced", "enabled": true, "loaded_at_query": null, "meta": {}, "tags": []}, "relation_name": "\"postgres\".\"public\".\"campaign_list_history_data\"", "created_at": 1789079004.45436, "unrendered_database": "{% if target.type != 'spark' %}{{ var('iterable_database', target.database)}}{% endif %}", "unrendered_schema": "{{var ('iterable_schema', 'iterable')}}", "doc_blocks": []}, "source.iterable.iterable.campaign_suppression_list_history": {"database": "postgres", "schema": "public", "name": "campaign_suppression_list_history", "resource_type": "source", "package_name": "iterable", "path": "models/staging/src_iterable.yml", "original_file_path": "models/staging/src_iterable.yml", "unique_id": "source.iterable.iterable.campaign_suppression_list_history", "fqn": ["iterable", "staging", "iterable", "campaign_suppression_list_history"], "source_name": "iterable", "source_description": "", "loader": "fivetran", "identifier": "campaign_suppression_list_history_data", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Table containing a history of suppression lists.\n", "columns": {"campaign_id": {"name": "campaign_id", "description": "Reference to the campaign associated with the label", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "suppressed_list_id": {"name": "suppressed_list_id", "description": "Reference to the list used", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "updated_at": {"name": "updated_at", "description": "Last update timestamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": "_fivetran_synced", "loaded_at_query": null, "meta": {}, "tags": [], "static_analysis": null}, "patch_path": null, "unrendered_config": {"loaded_at_field": "_fivetran_synced", "enabled": true, "loaded_at_query": null, "meta": {}, "tags": []}, "relation_name": "\"postgres\".\"public\".\"campaign_suppression_list_history_data\"", "created_at": 1789079004.454741, "unrendered_database": "{% if target.type != 'spark' %}{{ var('iterable_database', target.database)}}{% endif %}", "unrendered_schema": "{{var ('iterable_schema', 'iterable')}}", "doc_blocks": []}, "source.iterable.iterable.channel": {"database": "postgres", "schema": "public", "name": "channel", "resource_type": "source", "package_name": "iterable", "path": "models/staging/src_iterable.yml", "original_file_path": "models/staging/src_iterable.yml", "unique_id": "source.iterable.iterable.channel", "fqn": ["iterable", "staging", "iterable", "channel"], "source_name": "iterable", "source_description": "", "loader": "fivetran", "identifier": "channel_data", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Table containing unique channels.", "columns": {"id": {"name": "id", "description": "Unique identifier of the channel", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "name": {"name": "name", "description": "User defined name of the channel", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "channel_type": {"name": "channel_type", "description": "The channel type", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "message_medium": {"name": "message_medium", "description": "The message medium associated with the channel", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": "_fivetran_synced", "loaded_at_query": null, "meta": {}, "tags": [], "static_analysis": null}, "patch_path": null, "unrendered_config": {"loaded_at_field": "_fivetran_synced", "enabled": true, "loaded_at_query": null, "meta": {}, "tags": []}, "relation_name": "\"postgres\".\"public\".\"channel_data\"", "created_at": 1789079004.4552507, "unrendered_database": "{% if target.type != 'spark' %}{{ var('iterable_database', target.database)}}{% endif %}", "unrendered_schema": "{{var ('iterable_schema', 'iterable')}}", "doc_blocks": []}, "source.iterable.iterable.event": {"database": "postgres", "schema": "public", "name": "event", "resource_type": "source", "package_name": "iterable", "path": "models/staging/src_iterable.yml", "original_file_path": "models/staging/src_iterable.yml", "unique_id": "source.iterable.iterable.event", "fqn": ["iterable", "staging", "iterable", "event"], "source_name": "iterable", "source_description": "", "loader": "fivetran", "identifier": "event_data", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Table containing individual events within campaigns.", "columns": {"_fivetran_id": {"name": "_fivetran_id", "description": "A Fivetran-created unique identifier derived from hashing campaign_id, created_at, and event_name.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "campaign_id": {"name": "campaign_id", "description": "Reference to the campaign from which the event originated", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "content_id": {"name": "content_id", "description": "Reference to the content the event is associated with.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "created_at": {"name": "created_at", "description": "Creation timestamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "email": {"name": "email", "description": "The user's email. User identifier, for email-based projects. Previously was the unique identifier for user records, for Iterable customers before August 2023. Exists if using the history version of the table.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "additional_properties": {"name": "additional_properties", "description": "json object containing addition event properties", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "event_name": {"name": "event_name", "description": "Name provided to the individual event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "message_bus_id": {"name": "message_bus_id", "description": "Reference to the message bus associated with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "message_id": {"name": "message_id", "description": "Reference to the message the event is associated with", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "message_type_id": {"name": "message_type_id", "description": "Reference to the type of message the event is associated with", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "recipient_state": {"name": "recipient_state", "description": "The state of the recipient upon receiving the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "status": {"name": "status", "description": "Status of the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "transactional_data": {"name": "transactional_data", "description": "Transactional data associated with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unsub_source": {"name": "unsub_source", "description": "Source of the unsubscribe event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "user_agent": {"name": "user_agent", "description": "User agent associated with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "user_agent_device": {"name": "user_agent_device", "description": "The device of the user agent", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "_fivetran_user_id": {"name": "_fivetran_user_id", "description": "A Fivetran-created unique identifier for users, derived from hashing user_id and/or email, depending on project type.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": "_fivetran_synced", "loaded_at_query": null, "meta": {}, "tags": [], "static_analysis": null}, "patch_path": null, "unrendered_config": {"loaded_at_field": "_fivetran_synced", "enabled": true, "loaded_at_query": null, "meta": {}, "tags": []}, "relation_name": "\"postgres\".\"public\".\"event_data\"", "created_at": 1789079004.4556756, "unrendered_database": "{% if target.type != 'spark' %}{{ var('iterable_database', target.database)}}{% endif %}", "unrendered_schema": "{{var ('iterable_schema', 'iterable')}}", "doc_blocks": []}, "source.iterable.iterable.event_extension": {"database": "postgres", "schema": "public", "name": "event_extension", "resource_type": "source", "package_name": "iterable", "path": "models/staging/src_iterable.yml", "original_file_path": "models/staging/src_iterable.yml", "unique_id": "source.iterable.iterable.event_extension", "fqn": ["iterable", "staging", "iterable", "event_extension"], "source_name": "iterable", "source_description": "", "loader": "fivetran", "identifier": "event_extension_data", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Table containing additional properties from the event table.", "columns": {"_fivetran_id": {"name": "_fivetran_id", "description": "A Fivetran-created unique identifier derived from hashing campaign_id, created_at, and event_name.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "app_already_running": {"name": "app_already_running", "description": "Boolean indicating if the app is currently running or not", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "badge": {"name": "badge", "description": "Badge associated with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "canonical_url_id": {"name": "canonical_url_id", "description": "Reference to the url associated with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "content_available": {"name": "content_available", "description": "Content available from the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "content_id": {"name": "content_id", "description": "Reference to the content associated with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "deeplink_android": {"name": "deeplink_android", "description": "Deeplink associated with the event from an android device", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "deeplink_ios": {"name": "deeplink_ios", "description": "Deeplink associated with the event from an ios device", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "device": {"name": "device", "description": "The device associated with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "email_id": {"name": "email_id", "description": "Reference to the email associated with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "email_subject": {"name": "email_subject", "description": "Subject of the email associated with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "experiment_id": {"name": "experiment_id", "description": "Reference to the experiment used if the event is an experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "from_phone_number_id": {"name": "from_phone_number_id", "description": "Reference to the phone number which the event is from", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "from_smssender_id": {"name": "from_smssender_id", "description": "Reference to the sms sender which the event is from", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "image_url": {"name": "image_url", "description": "Image url of the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "is_ghost_push": {"name": "is_ghost_push", "description": "Boolean indicating if the event is a result of a ghost push", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "link_id": {"name": "link_id", "description": "Reference to the link associated with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "link_url": {"name": "link_url", "description": "Url of the link associated with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "locale": {"name": "locale", "description": "Locale associated with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "payload": {"name": "payload", "description": "Payload resulted from the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "platform_endpoint": {"name": "platform_endpoint", "description": "The specific platform endpoint of the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "push_message": {"name": "push_message", "description": "Boolean indicating if the event is a push message", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "region": {"name": "region", "description": "Region of the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "sms_message": {"name": "sms_message", "description": "Boolean indicating if the event is an sms message", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "sms_provider_response_code": {"name": "sms_provider_response_code", "description": "sms provider response code from the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "sms_provider_response_message": {"name": "sms_provider_response_message", "description": "sms provider response message from the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "sms_provider_response_more_info": {"name": "sms_provider_response_more_info", "description": "sms provider response addition info from the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "sms_provider_response_status": {"name": "sms_provider_response_status", "description": "Status of the sms provider response from the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "sound": {"name": "sound", "description": "Boolean indicating if a sound was used with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "to_phone_number": {"name": "to_phone_number", "description": "To phone number associated with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "url": {"name": "url", "description": "Url associated with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "workflow_id": {"name": "workflow_id", "description": "Reference to the workflow which the event originated", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "workflow_name": {"name": "workflow_name", "description": "Name of the workflow which the event originated", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "catalog_collection_count": {"name": "catalog_collection_count", "description": "The count of products or items collected in a catalog associated with the event.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "catalog_lookup_count": {"name": "catalog_lookup_count", "description": "The count of times a catalog was looked up or queried during the event.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "city": {"name": "city", "description": "The city associated with the event, which could be the location of the recipient.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "clicked_url": {"name": "clicked_url", "description": "The URL that was clicked by the recipient in response to the marketing message.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "country": {"name": "country", "description": "The country associated with the event, which could be the location of the recipient.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "error_code": {"name": "error_code", "description": "The error code or message indicating any issues or errors encountered during the event.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "expires_at": {"name": "expires_at", "description": "The date and time when the event or message is set to expire or become invalid.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "from_phone_number": {"name": "from_phone_number", "description": "The phone number from which the SMS message was sent.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "in_app_body": {"name": "in_app_body", "description": "The content or body of an in-app message that was sent as part of the event.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "is_sms_estimation": {"name": "is_sms_estimation", "description": "A boolean indicating whether the SMS message is an estimation or not.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "labels": {"name": "labels", "description": "Any labels or tags associated with the event, which can be used for categorization or organization.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "message_context": {"name": "message_context", "description": "Additional contextual information related to the marketing message or event.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "message_status": {"name": "message_status", "description": "The status of the marketing message, such as sent, delivered, opened, etc.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "mms_send_count": {"name": "mms_send_count", "description": "The count of multimedia messages (MMS) sent as part of the event.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "product_recommendation_count": {"name": "product_recommendation_count", "description": "The count of product recommendations included in the message.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "proxy_source": {"name": "proxy_source", "description": "Information about the source or proxy used for sending the message.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "reason": {"name": "reason", "description": "The reason or cause associated with a specific event or action.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "sms_send_count": {"name": "sms_send_count", "description": "The count of SMS messages sent as part of the event.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "web_push_body": {"name": "web_push_body", "description": "The content or body of a web push notification sent as part of the event.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "web_push_click_action": {"name": "web_push_click_action", "description": "The action triggered when a recipient clicks a web push notification.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "web_push_icon": {"name": "web_push_icon", "description": "The icon or image associated with the web push notification.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "web_push_message": {"name": "web_push_message", "description": "The message or notification sent to web users as part of the event.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": "_fivetran_synced", "loaded_at_query": null, "meta": {}, "tags": [], "static_analysis": null}, "patch_path": null, "unrendered_config": {"loaded_at_field": "_fivetran_synced", "enabled": true, "loaded_at_query": null, "meta": {}, "tags": []}, "relation_name": "\"postgres\".\"public\".\"event_extension_data\"", "created_at": 1789079004.4562557, "unrendered_database": "{% if target.type != 'spark' %}{{ var('iterable_database', target.database)}}{% endif %}", "unrendered_schema": "{{var ('iterable_schema', 'iterable')}}", "doc_blocks": []}, "source.iterable.iterable.journey": {"database": "postgres", "schema": "public", "name": "journey", "resource_type": "source", "package_name": "iterable", "path": "models/staging/src_iterable.yml", "original_file_path": "models/staging/src_iterable.yml", "unique_id": "source.iterable.iterable.journey", "fqn": ["iterable", "staging", "iterable", "journey"], "source_name": "iterable", "source_description": "", "loader": "fivetran", "identifier": "journey", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Table containing unique journeys, formerly known as workflows.", "columns": {"id": {"name": "id", "description": "Unique identifier of the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "name": {"name": "name", "description": "User defined name of the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "journey_type": {"name": "journey_type", "description": "The journey type", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "description": {"name": "description", "description": "Information about the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "creator_user_id": {"name": "creator_user_id", "description": "Reference to the user who created the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "enabled": {"name": "enabled", "description": "Boolean indicating if the journey is currently enabled", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "is_archived": {"name": "is_archived", "description": "Boolean indicating if the journey has been archived", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "lifetime_limit": {"name": "lifetime_limit", "description": "Maximum number of times a user may enter the journey over their lifetime", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "simultaneous_limit": {"name": "simultaneous_limit", "description": "Maximum number of times a user may be in the journey at the same time", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "start_tile_id": {"name": "start_tile_id", "description": "Reference to the tile which begins the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "trigger_event_names": {"name": "trigger_event_names", "description": "The event names which trigger a user's entry into the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "created_at": {"name": "created_at", "description": "Creation timestamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "updated_at": {"name": "updated_at", "description": "Last update timestamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": "_fivetran_synced", "loaded_at_query": null, "meta": {}, "tags": [], "static_analysis": null}, "patch_path": null, "unrendered_config": {"loaded_at_field": "_fivetran_synced", "enabled": true, "loaded_at_query": null, "meta": {}, "tags": []}, "relation_name": "\"postgres\".\"public\".\"journey\"", "created_at": 1789079004.4566548, "unrendered_database": "{% if target.type != 'spark' %}{{ var('iterable_database', target.database)}}{% endif %}", "unrendered_schema": "{{var ('iterable_schema', 'iterable')}}", "doc_blocks": []}, "source.iterable.iterable.list": {"database": "postgres", "schema": "public", "name": "list", "resource_type": "source", "package_name": "iterable", "path": "models/staging/src_iterable.yml", "original_file_path": "models/staging/src_iterable.yml", "unique_id": "source.iterable.iterable.list", "fqn": ["iterable", "staging", "iterable", "list"], "source_name": "iterable", "source_description": "", "loader": "fivetran", "identifier": "list_data", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Table containing users and the lists the users are associated with.", "columns": {"id": {"name": "id", "description": "Unique identifier of the list", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "name": {"name": "name", "description": "User defined name of the list", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "list_type": {"name": "list_type", "description": "The list type", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "created_at": {"name": "created_at", "description": "Creation timestamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "description": {"name": "description", "description": "Information about the list", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": "_fivetran_synced", "loaded_at_query": null, "meta": {}, "tags": [], "static_analysis": null}, "patch_path": null, "unrendered_config": {"loaded_at_field": "_fivetran_synced", "enabled": true, "loaded_at_query": null, "meta": {}, "tags": []}, "relation_name": "\"postgres\".\"public\".\"list_data\"", "created_at": 1789079004.4570384, "unrendered_database": "{% if target.type != 'spark' %}{{ var('iterable_database', target.database)}}{% endif %}", "unrendered_schema": "{{var ('iterable_schema', 'iterable')}}", "doc_blocks": []}, "source.iterable.iterable.message_type": {"database": "postgres", "schema": "public", "name": "message_type", "resource_type": "source", "package_name": "iterable", "path": "models/staging/src_iterable.yml", "original_file_path": "models/staging/src_iterable.yml", "unique_id": "source.iterable.iterable.message_type", "fqn": ["iterable", "staging", "iterable", "message_type"], "source_name": "iterable", "source_description": "", "loader": "fivetran", "identifier": "message_type_data", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Table containing unique message types.", "columns": {"id": {"name": "id", "description": "Unique identifier of the message type", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "name": {"name": "name", "description": "User defined name of the message type", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "channel_id": {"name": "channel_id", "description": "Channel that this message type belongs to", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "created_at": {"name": "created_at", "description": "Time when the message type was initially created", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "frequency_cap": {"name": "frequency_cap", "description": "The maximum number of times a message of this type can be sent to a recipient within a specified time period to prevent over-messaging", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "rate_limit_per_minute": {"name": "rate_limit_per_minute", "description": "The maximum number of messages of this type that can be sent to recipients in a minute, ensuring controlled message delivery", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "subscription_policy": {"name": "subscription_policy", "description": "Information about the policy or rules governing how users can subscribe to or unsubscribe from this specific message type, like OptOut", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "updated_at": {"name": "updated_at", "description": "Time when the message type was last updated or modified", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": "_fivetran_synced", "loaded_at_query": null, "meta": {}, "tags": [], "static_analysis": null}, "patch_path": null, "unrendered_config": {"loaded_at_field": "_fivetran_synced", "enabled": true, "loaded_at_query": null, "meta": {}, "tags": []}, "relation_name": "\"postgres\".\"public\".\"message_type_data\"", "created_at": 1789079004.4574254, "unrendered_database": "{% if target.type != 'spark' %}{{ var('iterable_database', target.database)}}{% endif %}", "unrendered_schema": "{{var ('iterable_schema', 'iterable')}}", "doc_blocks": []}, "source.iterable.iterable.template_history": {"database": "postgres", "schema": "public", "name": "template_history", "resource_type": "source", "package_name": "iterable", "path": "models/staging/src_iterable.yml", "original_file_path": "models/staging/src_iterable.yml", "unique_id": "source.iterable.iterable.template_history", "fqn": ["iterable", "staging", "iterable", "template_history"], "source_name": "iterable", "source_description": "", "loader": "fivetran", "identifier": "template_history_data", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Table containing unique templates used across campaigns.", "columns": {"id": {"name": "id", "description": "Unique identifier of the template", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "name": {"name": "name", "description": "User defined name of the template", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "template_type": {"name": "template_type", "description": "The type of the template", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "created_at": {"name": "created_at", "description": "Creation timestamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "client_template_id": {"name": "client_template_id", "description": "Reference to the client template", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "creator_user_id": {"name": "creator_user_id", "description": "Reference to the user who created the template", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "message_type_id": {"name": "message_type_id", "description": "Reference to the message type associated with the template", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "updated_at": {"name": "updated_at", "description": "Last update timestamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": "_fivetran_synced", "loaded_at_query": null, "meta": {}, "tags": [], "static_analysis": null}, "patch_path": null, "unrendered_config": {"loaded_at_field": "_fivetran_synced", "enabled": true, "loaded_at_query": null, "meta": {}, "tags": []}, "relation_name": "\"postgres\".\"public\".\"template_history_data\"", "created_at": 1789079004.4578168, "unrendered_database": "{% if target.type != 'spark' %}{{ var('iterable_database', target.database)}}{% endif %}", "unrendered_schema": "{{var ('iterable_schema', 'iterable')}}", "doc_blocks": []}, "source.iterable.iterable.user_history": {"database": "postgres", "schema": "public", "name": "user_history", "resource_type": "source", "package_name": "iterable", "path": "models/staging/src_iterable.yml", "original_file_path": "models/staging/src_iterable.yml", "unique_id": "source.iterable.iterable.user_history", "fqn": ["iterable", "staging", "iterable", "user_history"], "source_name": "iterable", "source_description": "", "loader": "fivetran", "identifier": "user_history_data", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Table containing individual user history information.", "columns": {"email": {"name": "email", "description": "The user's email. Previously was the unique identifier for the user records, for Iterable customers before August 2023. This has since been replaced by iterable_user_id.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "user_id": {"name": "user_id", "description": "User defined identifier of the user. This is not a unique field", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "iterable_user_id": {"name": "iterable_user_id", "description": "The unique identifier of the user", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "first_name": {"name": "first_name", "description": "First name of the user", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "last_name": {"name": "last_name", "description": "Last name of the user", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "email_list_ids": {"name": "email_list_ids", "description": "[DEPRECATED October 13, 2025 Use LIST_USER source instead.] Array of references to the lists associated with the user\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "signup_date": {"name": "signup_date", "description": "Timestamp of when the user signed up", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "signup_source": {"name": "signup_source", "description": "Source where the user signed up", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "updated_at": {"name": "updated_at", "description": "Last update timestamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": "_fivetran_synced", "loaded_at_query": null, "meta": {}, "tags": [], "static_analysis": null}, "patch_path": null, "unrendered_config": {"loaded_at_field": "_fivetran_synced", "enabled": true, "loaded_at_query": null, "meta": {}, "tags": []}, "relation_name": "\"postgres\".\"public\".\"user_history_data\"", "created_at": 1789079004.4582138, "unrendered_database": "{% if target.type != 'spark' %}{{ var('iterable_database', target.database)}}{% endif %}", "unrendered_schema": "{{var ('iterable_schema', 'iterable')}}", "doc_blocks": []}, "source.iterable.iterable.user_unsubscribed_channel": {"database": "postgres", "schema": "public", "name": "user_unsubscribed_channel", "resource_type": "source", "package_name": "iterable", "path": "models/staging/src_iterable.yml", "original_file_path": "models/staging/src_iterable.yml", "unique_id": "source.iterable.iterable.user_unsubscribed_channel", "fqn": ["iterable", "staging", "iterable", "user_unsubscribed_channel"], "source_name": "iterable", "source_description": "", "loader": "fivetran", "identifier": "user_unsubscribed_channel_data", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Table containing the channels from which a user has unsubscribed.", "columns": {"_fivetran_id": {"name": "_fivetran_id", "description": "A Fivetran-created unique identifier for users, derived from hashing user_id and/or email, depending on project type.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "channel_id": {"name": "channel_id", "description": "Reference to the channel from which the user unsubscribed", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": "_fivetran_synced", "loaded_at_query": null, "meta": {}, "tags": [], "static_analysis": null}, "patch_path": null, "unrendered_config": {"loaded_at_field": "_fivetran_synced", "enabled": true, "loaded_at_query": null, "meta": {}, "tags": []}, "relation_name": "\"postgres\".\"public\".\"user_unsubscribed_channel_data\"", "created_at": 1789079004.4585803, "unrendered_database": "{% if target.type != 'spark' %}{{ var('iterable_database', target.database)}}{% endif %}", "unrendered_schema": "{{var ('iterable_schema', 'iterable')}}", "doc_blocks": []}, "source.iterable.iterable.user_unsubscribed_message_type": {"database": "postgres", "schema": "public", "name": "user_unsubscribed_message_type", "resource_type": "source", "package_name": "iterable", "path": "models/staging/src_iterable.yml", "original_file_path": "models/staging/src_iterable.yml", "unique_id": "source.iterable.iterable.user_unsubscribed_message_type", "fqn": ["iterable", "staging", "iterable", "user_unsubscribed_message_type"], "source_name": "iterable", "source_description": "", "loader": "fivetran", "identifier": "user_unsubscribed_message_type_data", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Table containing the message types from which a user has unsubscribed.", "columns": {"_fivetran_id": {"name": "_fivetran_id", "description": "A Fivetran-created unique identifier for users, derived from hashing user_id and/or email, depending on project type.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "message_type_id": {"name": "message_type_id", "description": "Reference to the message type from which the user unsubscribed", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": "_fivetran_synced", "loaded_at_query": null, "meta": {}, "tags": [], "static_analysis": null}, "patch_path": null, "unrendered_config": {"loaded_at_field": "_fivetran_synced", "enabled": true, "loaded_at_query": null, "meta": {}, "tags": []}, "relation_name": "\"postgres\".\"public\".\"user_unsubscribed_message_type_data\"", "created_at": 1789079004.458988, "unrendered_database": "{% if target.type != 'spark' %}{{ var('iterable_database', target.database)}}{% endif %}", "unrendered_schema": "{{var ('iterable_schema', 'iterable')}}", "doc_blocks": []}, "source.iterable.iterable.user_unsubscribed_channel_history": {"database": "postgres", "schema": "public", "name": "user_unsubscribed_channel_history", "resource_type": "source", "package_name": "iterable", "path": "models/staging/src_iterable.yml", "original_file_path": "models/staging/src_iterable.yml", "unique_id": "source.iterable.iterable.user_unsubscribed_channel_history", "fqn": ["iterable", "staging", "iterable", "user_unsubscribed_channel_history"], "source_name": "iterable", "source_description": "", "loader": "fivetran", "identifier": "user_unsubscribed_channel_history_data", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Table containing the history of channels from which a user has unsubscribed.", "columns": {"channel_id": {"name": "channel_id", "description": "Reference to the channel from which the user unsubscribed", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "email": {"name": "email", "description": "Unique identifier of the user", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "updated_at": {"name": "updated_at", "description": "Last update timestamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": "_fivetran_synced", "loaded_at_query": null, "meta": {}, "tags": [], "static_analysis": null}, "patch_path": null, "unrendered_config": {"loaded_at_field": "_fivetran_synced", "enabled": true, "loaded_at_query": null, "meta": {}, "tags": []}, "relation_name": "\"postgres\".\"public\".\"user_unsubscribed_channel_history_data\"", "created_at": 1789079004.459353, "unrendered_database": "{% if target.type != 'spark' %}{{ var('iterable_database', target.database)}}{% endif %}", "unrendered_schema": "{{var ('iterable_schema', 'iterable')}}", "doc_blocks": []}, "source.iterable.iterable.user_unsubscribed_message_type_history": {"database": "postgres", "schema": "public", "name": "user_unsubscribed_message_type_history", "resource_type": "source", "package_name": "iterable", "path": "models/staging/src_iterable.yml", "original_file_path": "models/staging/src_iterable.yml", "unique_id": "source.iterable.iterable.user_unsubscribed_message_type_history", "fqn": ["iterable", "staging", "iterable", "user_unsubscribed_message_type_history"], "source_name": "iterable", "source_description": "", "loader": "fivetran", "identifier": "user_unsubscribed_message_type_history_data", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Table containing the history of message types from which a user has unsubscribed.", "columns": {"message_type_id": {"name": "message_type_id", "description": "Reference to the message type from which the user unsubscribed", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "email": {"name": "email", "description": "Unique identifier of the user", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "updated_at": {"name": "updated_at", "description": "Last update timestamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": "_fivetran_synced", "loaded_at_query": null, "meta": {}, "tags": [], "static_analysis": null}, "patch_path": null, "unrendered_config": {"loaded_at_field": "_fivetran_synced", "enabled": true, "loaded_at_query": null, "meta": {}, "tags": []}, "relation_name": "\"postgres\".\"public\".\"user_unsubscribed_message_type_history_data\"", "created_at": 1789079004.4597125, "unrendered_database": "{% if target.type != 'spark' %}{{ var('iterable_database', target.database)}}{% endif %}", "unrendered_schema": "{{var ('iterable_schema', 'iterable')}}", "doc_blocks": []}, "source.iterable.iterable.list_user": {"database": "postgres", "schema": "public", "name": "list_user", "resource_type": "source", "package_name": "iterable", "path": "models/staging/src_iterable.yml", "original_file_path": "models/staging/src_iterable.yml", "unique_id": "source.iterable.iterable.list_user", "fqn": ["iterable", "staging", "iterable", "list_user"], "source_name": "iterable", "source_description": "", "loader": "fivetran", "identifier": "list_user_data", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Table containing the relationship between users and lists they belong to.", "columns": {"_fivetran_id": {"name": "_fivetran_id", "description": "Unique identifier of the list-user relationship record, serving as a foreign key to `user_history._fivetran_id`.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "index": {"name": "index", "description": "Index of the record", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "list_id": {"name": "list_id", "description": "Reference to the list that the user belongs to", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "Timestamp when the record was last synced by Fivetran", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": "_fivetran_synced", "loaded_at_query": null, "meta": {}, "tags": [], "static_analysis": null}, "patch_path": null, "unrendered_config": {"loaded_at_field": "_fivetran_synced", "enabled": true, "loaded_at_query": null, "meta": {}, "tags": []}, "relation_name": "\"postgres\".\"public\".\"list_user_data\"", "created_at": 1789079004.4600847, "unrendered_database": "{% if target.type != 'spark' %}{{ var('iterable_database', target.database)}}{% endif %}", "unrendered_schema": "{{var ('iterable_schema', 'iterable')}}", "doc_blocks": []}}, "macros": {"macro.dbt_postgres.postgres__current_timestamp": {"name": "postgres__current_timestamp", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/timestamps.sql", "original_file_path": "macros/timestamps.sql", "unique_id": "macro.dbt_postgres.postgres__current_timestamp", "macro_sql": "{% macro postgres__current_timestamp() -%}\n now()\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789079002.2570221, "supported_languages": null}, "macro.dbt_postgres.postgres__snapshot_string_as_time": {"name": "postgres__snapshot_string_as_time", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/timestamps.sql", "original_file_path": "macros/timestamps.sql", "unique_id": "macro.dbt_postgres.postgres__snapshot_string_as_time", "macro_sql": "{% macro postgres__snapshot_string_as_time(timestamp) -%}\n {%- set result = \"'\" ~ timestamp ~ \"'::timestamp without time zone\" -%}\n {{ return(result) }}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "timestamp", "type": null, "description": ""}], "created_at": 1789079002.2572875, "supported_languages": null}, "macro.dbt_postgres.postgres__snapshot_get_time": {"name": "postgres__snapshot_get_time", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/timestamps.sql", "original_file_path": "macros/timestamps.sql", "unique_id": "macro.dbt_postgres.postgres__snapshot_get_time", "macro_sql": "{% macro postgres__snapshot_get_time() -%}\n {{ current_timestamp() }}::timestamp without time zone\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.current_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789079002.2574263, "supported_languages": null}, "macro.dbt_postgres.postgres__current_timestamp_backcompat": {"name": "postgres__current_timestamp_backcompat", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/timestamps.sql", "original_file_path": "macros/timestamps.sql", "unique_id": "macro.dbt_postgres.postgres__current_timestamp_backcompat", "macro_sql": "{% macro postgres__current_timestamp_backcompat() %}\n current_timestamp::{{ type_timestamp() }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.type_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789079002.257558, "supported_languages": null}, "macro.dbt_postgres.postgres__current_timestamp_in_utc_backcompat": {"name": "postgres__current_timestamp_in_utc_backcompat", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/timestamps.sql", "original_file_path": "macros/timestamps.sql", "unique_id": "macro.dbt_postgres.postgres__current_timestamp_in_utc_backcompat", "macro_sql": "{% macro postgres__current_timestamp_in_utc_backcompat() %}\n (current_timestamp at time zone 'utc')::{{ type_timestamp() }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.type_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789079002.257687, "supported_languages": null}, "macro.dbt_postgres.postgres__get_catalog_relations": {"name": "postgres__get_catalog_relations", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/catalog.sql", "original_file_path": "macros/catalog.sql", "unique_id": "macro.dbt_postgres.postgres__get_catalog_relations", "macro_sql": "{% macro postgres__get_catalog_relations(information_schema, relations) -%}\n {%- call statement('catalog', fetch_result=True) -%}\n\n {#\n If the user has multiple databases set and the first one is wrong, this will fail.\n But we won't fail in the case where there are multiple quoting-difference-only dbs, which is better.\n #}\n {% set database = information_schema.database %}\n {{ adapter.verify_database(database) }}\n\n select\n '{{ database }}' as table_database,\n sch.nspname as table_schema,\n tbl.relname as table_name,\n case tbl.relkind\n when 'v' then 'VIEW'\n when 'm' then 'MATERIALIZED VIEW'\n else 'BASE TABLE'\n end as table_type,\n tbl_desc.description as table_comment,\n col.attname as column_name,\n col.attnum as column_index,\n pg_catalog.format_type(col.atttypid, col.atttypmod) as column_type,\n col_desc.description as column_comment,\n pg_get_userbyid(tbl.relowner) as table_owner\n\n from pg_catalog.pg_namespace sch\n join pg_catalog.pg_class tbl on tbl.relnamespace = sch.oid\n join pg_catalog.pg_attribute col on col.attrelid = tbl.oid\n left outer join pg_catalog.pg_description tbl_desc on (tbl_desc.objoid = tbl.oid and tbl_desc.objsubid = 0)\n left outer join pg_catalog.pg_description col_desc on (col_desc.objoid = tbl.oid and col_desc.objsubid = col.attnum)\n where (\n {%- for relation in relations -%}\n {%- if relation.identifier -%}\n (upper(sch.nspname) = upper('{{ relation.schema }}') and\n upper(tbl.relname) = upper('{{ relation.identifier }}'))\n {%- else-%}\n upper(sch.nspname) = upper('{{ relation.schema }}')\n {%- endif -%}\n {%- if not loop.last %} or {% endif -%}\n {%- endfor -%}\n )\n and not pg_is_other_temp_schema(sch.oid) -- not a temporary schema belonging to another session\n and tbl.relpersistence in ('p', 'u') -- [p]ermanent table or [u]nlogged table. Exclude [t]emporary tables\n and tbl.relkind in ('r', 'v', 'f', 'p', 'm') -- o[r]dinary table, [v]iew, [f]oreign table, [p]artitioned table, [m]aterialized view. Other values are [i]ndex, [S]equence, [c]omposite type, [t]OAST table\n and col.attnum > 0 -- negative numbers are used for system columns such as oid\n and not col.attisdropped -- column as not been dropped\n\n order by\n sch.nspname,\n tbl.relname,\n col.attnum\n\n {%- endcall -%}\n\n {{ return(load_result('catalog').table) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "information_schema", "type": null, "description": ""}, {"name": "relations", "type": null, "description": ""}], "created_at": 1789079002.2589054, "supported_languages": null}, "macro.dbt_postgres.postgres__get_catalog": {"name": "postgres__get_catalog", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/catalog.sql", "original_file_path": "macros/catalog.sql", "unique_id": "macro.dbt_postgres.postgres__get_catalog", "macro_sql": "{% macro postgres__get_catalog(information_schema, schemas) -%}\n {%- set relations = [] -%}\n {%- for schema in schemas -%}\n {%- set dummy = relations.append({'schema': schema}) -%}\n {%- endfor -%}\n {{ return(postgres__get_catalog_relations(information_schema, relations)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__get_catalog_relations"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "information_schema", "type": null, "description": ""}, {"name": "schemas", "type": null, "description": ""}], "created_at": 1789079002.2593236, "supported_languages": null}, "macro.dbt_postgres.postgres__get_relations": {"name": "postgres__get_relations", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/relations.sql", "original_file_path": "macros/relations.sql", "unique_id": "macro.dbt_postgres.postgres__get_relations", "macro_sql": "{% macro postgres__get_relations() -%}\n\n {#\n -- in pg_depend, objid is the dependent, refobjid is the referenced object\n -- > a pg_depend entry indicates that the referenced object cannot be\n -- > dropped without also dropping the dependent object.\n #}\n\n {%- call statement('relations', fetch_result=True) -%}\n select distinct\n dependent_namespace.nspname as dependent_schema,\n dependent_class.relname as dependent_name,\n referenced_namespace.nspname as referenced_schema,\n referenced_class.relname as referenced_name\n\n -- Query for views: views are entries in pg_class with an entry in pg_rewrite, but we avoid\n -- a seq scan on pg_rewrite by leveraging the fact there is an \"internal\" row in pg_depend for\n -- the view...\n from pg_class as dependent_class\n join pg_namespace as dependent_namespace on dependent_namespace.oid = dependent_class.relnamespace\n join pg_depend as dependent_depend on dependent_depend.refobjid = dependent_class.oid\n and dependent_depend.classid = 'pg_rewrite'::regclass\n and dependent_depend.refclassid = 'pg_class'::regclass\n and dependent_depend.deptype = 'i'\n\n -- ... and via pg_depend (that has a row per column, hence the need for \"distinct\" above, and\n -- making sure to exclude the internal row to avoid a view appearing to depend on itself)...\n join pg_depend as joining_depend on joining_depend.objid = dependent_depend.objid\n and joining_depend.classid = 'pg_rewrite'::regclass\n and joining_depend.refclassid = 'pg_class'::regclass\n and joining_depend.refobjid != dependent_depend.refobjid\n\n -- ... we can find the tables they query from in pg_class, but excluding system tables. Note we\n -- don't need need to exclude _dependent_ system tables, because they only query from other\n -- system tables, and so are automatically excluded by excluding _referenced_ system tables\n join pg_class as referenced_class on referenced_class.oid = joining_depend.refobjid\n join pg_namespace as referenced_namespace on referenced_namespace.oid = referenced_class.relnamespace\n and referenced_namespace.nspname != 'information_schema'\n and referenced_namespace.nspname not like 'pg\\_%'\n\n order by\n dependent_schema, dependent_name, referenced_schema, referenced_name;\n\n {%- endcall -%}\n\n {{ return(load_result('relations').table) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789079002.2598848, "supported_languages": null}, "macro.dbt_postgres.postgres_get_relations": {"name": "postgres_get_relations", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/relations.sql", "original_file_path": "macros/relations.sql", "unique_id": "macro.dbt_postgres.postgres_get_relations", "macro_sql": "{% macro postgres_get_relations() %}\n {{ return(postgres__get_relations()) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__get_relations"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789079002.2600472, "supported_languages": null}, "macro.dbt_postgres.postgres__create_table_as": {"name": "postgres__create_table_as", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "unique_id": "macro.dbt_postgres.postgres__create_table_as", "macro_sql": "{% macro postgres__create_table_as(temporary, relation, sql) -%}\n {%- set unlogged = config.get('unlogged', default=false) -%}\n {%- set sql_header = config.get('sql_header', none) -%}\n\n {{ sql_header if sql_header is not none }}\n\n create {% if temporary -%}\n temporary\n {%- elif unlogged -%}\n unlogged\n {%- endif %} table {{ relation }}\n {% set contract_config = config.get('contract') %}\n {% if contract_config.enforced %}\n {{ get_assert_columns_equivalent(sql) }}\n {% endif -%}\n {% if contract_config.enforced and (not temporary) -%}\n {{ get_table_columns_and_constraints() }} ;\n insert into {{ relation }} (\n {{ adapter.dispatch('get_column_names', 'dbt')() }}\n )\n {%- set sql = get_select_subquery(sql) %}\n {% else %}\n as\n {% endif %}\n (\n {{ sql }}\n );\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.get_assert_columns_equivalent", "macro.dbt.get_table_columns_and_constraints", "macro.dbt.default__get_column_names", "macro.dbt.get_select_subquery"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "temporary", "type": null, "description": ""}, {"name": "relation", "type": null, "description": ""}, {"name": "sql", "type": null, "description": ""}], "created_at": 1789079002.262571, "supported_languages": null}, "macro.dbt_postgres.postgres__get_create_index_sql": {"name": "postgres__get_create_index_sql", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "unique_id": "macro.dbt_postgres.postgres__get_create_index_sql", "macro_sql": "{% macro postgres__get_create_index_sql(relation, index_dict) -%}\n {%- set index_config = adapter.parse_index(index_dict) -%}\n {%- set comma_separated_columns = \", \".join(index_config.columns) -%}\n {%- set index_name = index_config.render(relation) -%}\n\n create {% if index_config.unique -%}\n unique\n {%- endif %} index if not exists\n \"{{ index_name }}\"\n on {{ relation }} {% if index_config.type -%}\n using {{ index_config.type }}\n {%- endif %}\n ({{ comma_separated_columns }})\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "index_dict", "type": null, "description": ""}], "created_at": 1789079002.2631474, "supported_languages": null}, "macro.dbt_postgres.postgres__create_schema": {"name": "postgres__create_schema", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "unique_id": "macro.dbt_postgres.postgres__create_schema", "macro_sql": "{% macro postgres__create_schema(relation) -%}\n {% if relation.database -%}\n {{ adapter.verify_database(relation.database) }}\n {%- endif -%}\n {%- call statement('create_schema') -%}\n create schema if not exists {{ relation.without_identifier().include(database=False) }}\n {%- endcall -%}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789079002.2635005, "supported_languages": null}, "macro.dbt_postgres.postgres__drop_schema": {"name": "postgres__drop_schema", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "unique_id": "macro.dbt_postgres.postgres__drop_schema", "macro_sql": "{% macro postgres__drop_schema(relation) -%}\n {% if relation.database -%}\n {{ adapter.verify_database(relation.database) }}\n {%- endif -%}\n {%- call statement('drop_schema') -%}\n drop schema if exists {{ relation.without_identifier().include(database=False) }} cascade\n {%- endcall -%}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789079002.2638617, "supported_languages": null}, "macro.dbt_postgres.postgres__get_columns_in_relation": {"name": "postgres__get_columns_in_relation", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "unique_id": "macro.dbt_postgres.postgres__get_columns_in_relation", "macro_sql": "{% macro postgres__get_columns_in_relation(relation) -%}\n {% call statement('get_columns_in_relation', fetch_result=True) %}\n select\n column_name,\n data_type,\n character_maximum_length,\n numeric_precision,\n numeric_scale\n\n from {{ relation.information_schema('columns') }}\n where table_name = '{{ relation.identifier }}'\n {% if relation.schema %}\n and table_schema = '{{ relation.schema }}'\n {% endif %}\n order by ordinal_position\n\n {% endcall %}\n {% set table = load_result('get_columns_in_relation').table %}\n {{ return(sql_convert_columns_in_relation(table)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement", "macro.dbt.sql_convert_columns_in_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789079002.2643924, "supported_languages": null}, "macro.dbt_postgres.postgres__list_relations_without_caching": {"name": "postgres__list_relations_without_caching", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "unique_id": "macro.dbt_postgres.postgres__list_relations_without_caching", "macro_sql": "{% macro postgres__list_relations_without_caching(schema_relation) %}\n {% call statement('list_relations_without_caching', fetch_result=True) -%}\n select\n '{{ schema_relation.database }}' as database,\n tablename as name,\n schemaname as schema,\n 'table' as type\n from pg_tables\n where schemaname ilike '{{ schema_relation.schema }}'\n union all\n select\n '{{ schema_relation.database }}' as database,\n viewname as name,\n schemaname as schema,\n 'view' as type\n from pg_views\n where schemaname ilike '{{ schema_relation.schema }}'\n union all\n select\n '{{ schema_relation.database }}' as database,\n matviewname as name,\n schemaname as schema,\n 'materialized_view' as type\n from pg_matviews\n where schemaname ilike '{{ schema_relation.schema }}'\n union all\n select distinct\n '{{ schema_relation.database }}' as database,\n proname as name,\n ns.nspname as schema,\n 'function' as type\n from pg_proc\n join pg_namespace as ns on pronamespace = ns.oid\n where ns.nspname ilike '{{ schema_relation.schema }}'\n {% endcall %}\n {{ return(load_result('list_relations_without_caching').table) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "schema_relation", "type": null, "description": ""}], "created_at": 1789079002.2649593, "supported_languages": null}, "macro.dbt_postgres.postgres__information_schema_name": {"name": "postgres__information_schema_name", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "unique_id": "macro.dbt_postgres.postgres__information_schema_name", "macro_sql": "{% macro postgres__information_schema_name(database) -%}\n {% if database_name -%}\n {{ adapter.verify_database(database_name) }}\n {%- endif -%}\n information_schema\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "database", "type": null, "description": ""}], "created_at": 1789079002.265158, "supported_languages": null}, "macro.dbt_postgres.postgres__list_schemas": {"name": "postgres__list_schemas", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "unique_id": "macro.dbt_postgres.postgres__list_schemas", "macro_sql": "{% macro postgres__list_schemas(database) %}\n {% if database -%}\n {{ adapter.verify_database(database) }}\n {%- endif -%}\n {% call statement('list_schemas', fetch_result=True, auto_begin=False) %}\n select distinct nspname from pg_namespace\n {% endcall %}\n {{ return(load_result('list_schemas').table) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "database", "type": null, "description": ""}], "created_at": 1789079002.2655349, "supported_languages": null}, "macro.dbt_postgres.postgres__check_schema_exists": {"name": "postgres__check_schema_exists", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "unique_id": "macro.dbt_postgres.postgres__check_schema_exists", "macro_sql": "{% macro postgres__check_schema_exists(information_schema, schema) -%}\n {% if information_schema.database -%}\n {{ adapter.verify_database(information_schema.database) }}\n {%- endif -%}\n {% call statement('check_schema_exists', fetch_result=True, auto_begin=False) %}\n select count(*) from pg_namespace where nspname = '{{ schema }}'\n {% endcall %}\n {{ return(load_result('check_schema_exists').table) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "information_schema", "type": null, "description": ""}, {"name": "schema", "type": null, "description": ""}], "created_at": 1789079002.2659714, "supported_languages": null}, "macro.dbt_postgres.postgres__make_relation_with_suffix": {"name": "postgres__make_relation_with_suffix", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "unique_id": "macro.dbt_postgres.postgres__make_relation_with_suffix", "macro_sql": "{% macro postgres__make_relation_with_suffix(base_relation, suffix, dstring) %}\n {% if dstring %}\n {% set dt = modules.datetime.datetime.now() %}\n {% set dtstring = dt.strftime(\"%H%M%S%f\") %}\n {% set suffix = suffix ~ dtstring %}\n {% endif %}\n {% set suffix_length = suffix|length %}\n {% set relation_max_name_length = base_relation.relation_max_name_length() %}\n {% if suffix_length > relation_max_name_length %}\n {% do exceptions.raise_compiler_error('Relation suffix is too long (' ~ suffix_length ~ ' characters). Maximum length is ' ~ relation_max_name_length ~ ' characters.') %}\n {% endif %}\n {% set identifier = base_relation.identifier[:relation_max_name_length - suffix_length] ~ suffix %}\n\n {{ return(base_relation.incorporate(path={\"identifier\": identifier })) }}\n\n {% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "base_relation", "type": null, "description": ""}, {"name": "suffix", "type": null, "description": ""}, {"name": "dstring", "type": null, "description": ""}], "created_at": 1789079002.2669744, "supported_languages": null}, "macro.dbt_postgres.postgres__make_intermediate_relation": {"name": "postgres__make_intermediate_relation", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "unique_id": "macro.dbt_postgres.postgres__make_intermediate_relation", "macro_sql": "{% macro postgres__make_intermediate_relation(base_relation, suffix) %}\n {{ return(postgres__make_relation_with_suffix(base_relation, suffix, dstring=False)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__make_relation_with_suffix"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "base_relation", "type": null, "description": ""}, {"name": "suffix", "type": null, "description": ""}], "created_at": 1789079002.267209, "supported_languages": null}, "macro.dbt_postgres.postgres__make_temp_relation": {"name": "postgres__make_temp_relation", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "unique_id": "macro.dbt_postgres.postgres__make_temp_relation", "macro_sql": "{% macro postgres__make_temp_relation(base_relation, suffix) %}\n {% set temp_relation = postgres__make_relation_with_suffix(base_relation, suffix, dstring=True) %}\n {{ return(temp_relation.incorporate(path={\"schema\": none,\n \"database\": none})) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__make_relation_with_suffix"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "base_relation", "type": null, "description": ""}, {"name": "suffix", "type": null, "description": ""}], "created_at": 1789079002.2675655, "supported_languages": null}, "macro.dbt_postgres.postgres__make_backup_relation": {"name": "postgres__make_backup_relation", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "unique_id": "macro.dbt_postgres.postgres__make_backup_relation", "macro_sql": "{% macro postgres__make_backup_relation(base_relation, backup_relation_type, suffix) %}\n {% set backup_relation = postgres__make_relation_with_suffix(base_relation, suffix, dstring=False) %}\n {{ return(backup_relation.incorporate(type=backup_relation_type)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__make_relation_with_suffix"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "base_relation", "type": null, "description": ""}, {"name": "backup_relation_type", "type": null, "description": ""}, {"name": "suffix", "type": null, "description": ""}], "created_at": 1789079002.2678816, "supported_languages": null}, "macro.dbt_postgres.postgres_escape_comment": {"name": "postgres_escape_comment", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "unique_id": "macro.dbt_postgres.postgres_escape_comment", "macro_sql": "{% macro postgres_escape_comment(comment) -%}\n {% if comment is not string %}\n {% do exceptions.raise_compiler_error('cannot escape a non-string: ' ~ comment) %}\n {% endif %}\n {%- set magic = '$dbt_comment_literal_block$' -%}\n {%- if magic in comment -%}\n {%- do exceptions.raise_compiler_error('The string ' ~ magic ~ ' is not allowed in comments.') -%}\n {%- endif -%}\n {{ magic }}{{ comment }}{{ magic }}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "comment", "type": null, "description": ""}], "created_at": 1789079002.268371, "supported_languages": null}, "macro.dbt_postgres.postgres__alter_relation_comment": {"name": "postgres__alter_relation_comment", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "unique_id": "macro.dbt_postgres.postgres__alter_relation_comment", "macro_sql": "{% macro postgres__alter_relation_comment(relation, comment) %}\n {% set escaped_comment = postgres_escape_comment(comment) %}\n {% if relation.type == 'materialized_view' -%}\n {% set relation_type = \"materialized view\" %}\n {%- else -%}\n {%- set relation_type = relation.type -%}\n {%- endif -%}\n comment on {{ relation_type }} {{ relation }} is {{ escaped_comment }};\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres_escape_comment"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "comment", "type": null, "description": ""}], "created_at": 1789079002.2687976, "supported_languages": null}, "macro.dbt_postgres.postgres__alter_column_comment": {"name": "postgres__alter_column_comment", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "unique_id": "macro.dbt_postgres.postgres__alter_column_comment", "macro_sql": "{% macro postgres__alter_column_comment(relation, column_dict) %}\n {% set existing_columns = adapter.get_columns_in_relation(relation) | map(attribute=\"name\") | list %}\n {% for column_name in column_dict if (column_name in existing_columns) %}\n {% set comment = column_dict[column_name]['description'] %}\n {% set escaped_comment = postgres_escape_comment(comment) %}\n comment on column {{ relation }}.{{ adapter.quote(column_name) if column_dict[column_name]['quote'] else column_name }} is {{ escaped_comment }};\n {% endfor %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres_escape_comment"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "column_dict", "type": null, "description": ""}], "created_at": 1789079002.2694628, "supported_languages": null}, "macro.dbt_postgres.postgres__get_show_grant_sql": {"name": "postgres__get_show_grant_sql", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "unique_id": "macro.dbt_postgres.postgres__get_show_grant_sql", "macro_sql": "\n\n{%- macro postgres__get_show_grant_sql(relation) -%}\n select grantee, privilege_type\n from {{ relation.information_schema('role_table_grants') }}\n where grantor = current_role\n and grantee != current_role\n and table_schema = '{{ relation.schema }}'\n and table_name = '{{ relation.identifier }}'\n{%- endmacro -%}\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789079002.2696931, "supported_languages": null}, "macro.dbt_postgres.postgres__copy_grants": {"name": "postgres__copy_grants", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "unique_id": "macro.dbt_postgres.postgres__copy_grants", "macro_sql": "{% macro postgres__copy_grants() %}\n {{ return(False) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789079002.2698298, "supported_languages": null}, "macro.dbt_postgres.postgres__get_show_indexes_sql": {"name": "postgres__get_show_indexes_sql", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "unique_id": "macro.dbt_postgres.postgres__get_show_indexes_sql", "macro_sql": "{% macro postgres__get_show_indexes_sql(relation) %}\n select\n i.relname as name,\n m.amname as method,\n ix.indisunique as \"unique\",\n array_to_string(array_agg(a.attname), ',') as column_names\n from pg_index ix\n join pg_class i\n on i.oid = ix.indexrelid\n join pg_am m\n on m.oid=i.relam\n join pg_class t\n on t.oid = ix.indrelid\n join pg_namespace n\n on n.oid = t.relnamespace\n join pg_attribute a\n on a.attrelid = t.oid\n and a.attnum = ANY(ix.indkey)\n where t.relname = '{{ relation.identifier }}'\n and n.nspname = '{{ relation.schema }}'\n and t.relkind in ('r', 'm')\n group by 1, 2, 3\n order by 1, 2, 3\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789079002.2700377, "supported_languages": null}, "macro.dbt_postgres.postgres__get_drop_index_sql": {"name": "postgres__get_drop_index_sql", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "unique_id": "macro.dbt_postgres.postgres__get_drop_index_sql", "macro_sql": "\n\n\n{%- macro postgres__get_drop_index_sql(relation, index_name) -%}\n drop index if exists \"{{ relation.schema }}\".\"{{ index_name }}\"\n{%- endmacro -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "index_name", "type": null, "description": ""}], "created_at": 1789079002.2702043, "supported_languages": null}, "macro.dbt_postgres.postgres__get_create_materialized_view_as_sql": {"name": "postgres__get_create_materialized_view_as_sql", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/relations/materialized_view/create.sql", "original_file_path": "macros/relations/materialized_view/create.sql", "unique_id": "macro.dbt_postgres.postgres__get_create_materialized_view_as_sql", "macro_sql": "{% macro postgres__get_create_materialized_view_as_sql(relation, sql) %}\n create materialized view if not exists {{ relation }} as {{ sql }};\n\n {% for _index_dict in config.get('indexes', []) -%}\n {{- get_create_index_sql(relation, _index_dict) -}}{{ ';' if not loop.last else \"\" }}\n {%- endfor -%}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_create_index_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "sql", "type": null, "description": ""}], "created_at": 1789079002.2707057, "supported_languages": null}, "macro.dbt_postgres.postgres__get_alter_materialized_view_as_sql": {"name": "postgres__get_alter_materialized_view_as_sql", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/relations/materialized_view/alter.sql", "original_file_path": "macros/relations/materialized_view/alter.sql", "unique_id": "macro.dbt_postgres.postgres__get_alter_materialized_view_as_sql", "macro_sql": "{% macro postgres__get_alter_materialized_view_as_sql(\n relation,\n configuration_changes,\n sql,\n existing_relation,\n backup_relation,\n intermediate_relation\n) %}\n\n -- apply a full refresh immediately if needed\n {% if configuration_changes.requires_full_refresh %}\n\n {{ get_replace_sql(existing_relation, relation, sql) }}\n\n -- otherwise apply individual changes as needed\n {% else %}\n\n {{ postgres__update_indexes_on_materialized_view(relation, configuration_changes.indexes) }}\n\n {%- endif -%}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_replace_sql", "macro.dbt_postgres.postgres__update_indexes_on_materialized_view"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "configuration_changes", "type": null, "description": ""}, {"name": "sql", "type": null, "description": ""}, {"name": "existing_relation", "type": null, "description": ""}, {"name": "backup_relation", "type": null, "description": ""}, {"name": "intermediate_relation", "type": null, "description": ""}], "created_at": 1789079002.2713287, "supported_languages": null}, "macro.dbt_postgres.postgres__update_indexes_on_materialized_view": {"name": "postgres__update_indexes_on_materialized_view", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/relations/materialized_view/alter.sql", "original_file_path": "macros/relations/materialized_view/alter.sql", "unique_id": "macro.dbt_postgres.postgres__update_indexes_on_materialized_view", "macro_sql": "\n\n\n{%- macro postgres__update_indexes_on_materialized_view(relation, index_changes) -%}\n {{- log(\"Applying UPDATE INDEXES to: \" ~ relation) -}}\n\n {%- for _index_change in index_changes -%}\n {%- set _index = _index_change.context -%}\n\n {%- if _index_change.action == \"drop\" -%}\n\n {{ postgres__get_drop_index_sql(relation, _index.name) }}\n\n {%- elif _index_change.action == \"create\" -%}\n\n {{ postgres__get_create_index_sql(relation, _index.as_node_config) }}\n\n {%- endif -%}\n\t{{ ';' if not loop.last else \"\" }}\n\n {%- endfor -%}\n\n{%- endmacro -%}\n\n\n", "depends_on": {"macros": ["macro.dbt_postgres.postgres__get_drop_index_sql", "macro.dbt_postgres.postgres__get_create_index_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "index_changes", "type": null, "description": ""}], "created_at": 1789079002.2719471, "supported_languages": null}, "macro.dbt_postgres.postgres__get_materialized_view_configuration_changes": {"name": "postgres__get_materialized_view_configuration_changes", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/relations/materialized_view/alter.sql", "original_file_path": "macros/relations/materialized_view/alter.sql", "unique_id": "macro.dbt_postgres.postgres__get_materialized_view_configuration_changes", "macro_sql": "{% macro postgres__get_materialized_view_configuration_changes(existing_relation, new_config) %}\n {% set _existing_materialized_view = postgres__describe_materialized_view(existing_relation) %}\n {% set _configuration_changes = existing_relation.get_materialized_view_config_change_collection(_existing_materialized_view, new_config.model) %}\n {% do return(_configuration_changes) %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__describe_materialized_view"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "existing_relation", "type": null, "description": ""}, {"name": "new_config", "type": null, "description": ""}], "created_at": 1789079002.272282, "supported_languages": null}, "macro.dbt_postgres.postgres__get_rename_materialized_view_sql": {"name": "postgres__get_rename_materialized_view_sql", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/relations/materialized_view/rename.sql", "original_file_path": "macros/relations/materialized_view/rename.sql", "unique_id": "macro.dbt_postgres.postgres__get_rename_materialized_view_sql", "macro_sql": "{% macro postgres__get_rename_materialized_view_sql(relation, new_name) %}\n alter materialized view {{ relation }} rename to {{ new_name }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "new_name", "type": null, "description": ""}], "created_at": 1789079002.2724977, "supported_languages": null}, "macro.dbt_postgres.postgres__refresh_materialized_view": {"name": "postgres__refresh_materialized_view", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/relations/materialized_view/refresh.sql", "original_file_path": "macros/relations/materialized_view/refresh.sql", "unique_id": "macro.dbt_postgres.postgres__refresh_materialized_view", "macro_sql": "{% macro postgres__refresh_materialized_view(relation) %}\n refresh materialized view {{ relation }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789079002.272665, "supported_languages": null}, "macro.dbt_postgres.postgres__drop_materialized_view": {"name": "postgres__drop_materialized_view", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/relations/materialized_view/drop.sql", "original_file_path": "macros/relations/materialized_view/drop.sql", "unique_id": "macro.dbt_postgres.postgres__drop_materialized_view", "macro_sql": "{% macro postgres__drop_materialized_view(relation) -%}\n drop materialized view if exists {{ relation }} cascade\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789079002.2728298, "supported_languages": null}, "macro.dbt_postgres.postgres__describe_materialized_view": {"name": "postgres__describe_materialized_view", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/relations/materialized_view/describe.sql", "original_file_path": "macros/relations/materialized_view/describe.sql", "unique_id": "macro.dbt_postgres.postgres__describe_materialized_view", "macro_sql": "{% macro postgres__describe_materialized_view(relation) %}\n -- for now just get the indexes, we don't need the name or the query yet\n {% set _indexes = run_query(get_show_indexes_sql(relation)) %}\n {% do return({'indexes': _indexes}) %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.run_query", "macro.dbt.get_show_indexes_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789079002.2732463, "supported_languages": null}, "macro.dbt_postgres.postgres__get_rename_view_sql": {"name": "postgres__get_rename_view_sql", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/relations/view/rename.sql", "original_file_path": "macros/relations/view/rename.sql", "unique_id": "macro.dbt_postgres.postgres__get_rename_view_sql", "macro_sql": "{% macro postgres__get_rename_view_sql(relation, new_name) %}\n alter view {{ relation }} rename to {{ new_name }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "new_name", "type": null, "description": ""}], "created_at": 1789079002.2734535, "supported_languages": null}, "macro.dbt_postgres.postgres__drop_view": {"name": "postgres__drop_view", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/relations/view/drop.sql", "original_file_path": "macros/relations/view/drop.sql", "unique_id": "macro.dbt_postgres.postgres__drop_view", "macro_sql": "{% macro postgres__drop_view(relation) -%}\n drop view if exists {{ relation }} cascade\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789079002.2736154, "supported_languages": null}, "macro.dbt_postgres.postgres__get_replace_view_sql": {"name": "postgres__get_replace_view_sql", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/relations/view/replace.sql", "original_file_path": "macros/relations/view/replace.sql", "unique_id": "macro.dbt_postgres.postgres__get_replace_view_sql", "macro_sql": "{% macro postgres__get_replace_view_sql(relation, sql) -%}\n\n {%- set sql_header = config.get('sql_header', none) -%}\n {{ sql_header if sql_header is not none }}\n\n create or replace view {{ relation }}\n {% set contract_config = config.get('contract') %}\n {% if contract_config.enforced %}\n {{ get_assert_columns_equivalent(sql) }}\n {%- endif %}\n as (\n {{ sql }}\n );\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.get_assert_columns_equivalent"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "sql", "type": null, "description": ""}], "created_at": 1789079002.2742078, "supported_languages": null}, "macro.dbt_postgres.postgres__get_rename_table_sql": {"name": "postgres__get_rename_table_sql", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/relations/table/rename.sql", "original_file_path": "macros/relations/table/rename.sql", "unique_id": "macro.dbt_postgres.postgres__get_rename_table_sql", "macro_sql": "{% macro postgres__get_rename_table_sql(relation, new_name) %}\n alter table {{ relation }} rename to {{ new_name }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "new_name", "type": null, "description": ""}], "created_at": 1789079002.2744124, "supported_languages": null}, "macro.dbt_postgres.postgres__drop_table": {"name": "postgres__drop_table", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/relations/table/drop.sql", "original_file_path": "macros/relations/table/drop.sql", "unique_id": "macro.dbt_postgres.postgres__drop_table", "macro_sql": "{% macro postgres__drop_table(relation) -%}\n drop table if exists {{ relation }} cascade\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789079002.2745757, "supported_languages": null}, "macro.dbt_postgres.postgres__get_replace_table_sql": {"name": "postgres__get_replace_table_sql", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/relations/table/replace.sql", "original_file_path": "macros/relations/table/replace.sql", "unique_id": "macro.dbt_postgres.postgres__get_replace_table_sql", "macro_sql": "{% macro postgres__get_replace_table_sql(relation, sql) -%}\n\n {%- set sql_header = config.get('sql_header', none) -%}\n {{ sql_header if sql_header is not none }}\n\n create or replace table {{ relation }}\n {% set contract_config = config.get('contract') %}\n {% if contract_config.enforced %}\n {{ get_assert_columns_equivalent(sql) }}\n {{ get_table_columns_and_constraints() }}\n {%- set sql = get_select_subquery(sql) %}\n {% endif %}\n as (\n {{ sql }}\n );\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.get_assert_columns_equivalent", "macro.dbt.get_table_columns_and_constraints", "macro.dbt.get_select_subquery"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "sql", "type": null, "description": ""}], "created_at": 1789079002.2752702, "supported_languages": null}, "macro.dbt_postgres.postgres__get_incremental_default_sql": {"name": "postgres__get_incremental_default_sql", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/materializations/incremental_strategies.sql", "original_file_path": "macros/materializations/incremental_strategies.sql", "unique_id": "macro.dbt_postgres.postgres__get_incremental_default_sql", "macro_sql": "{% macro postgres__get_incremental_default_sql(arg_dict) %}\n\n {% if arg_dict[\"unique_key\"] %}\n {% do return(get_incremental_delete_insert_sql(arg_dict)) %}\n {% else %}\n {% do return(get_incremental_append_sql(arg_dict)) %}\n {% endif %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_incremental_delete_insert_sql", "macro.dbt.get_incremental_append_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "arg_dict", "type": null, "description": ""}], "created_at": 1789079002.2757597, "supported_languages": null}, "macro.dbt_postgres.postgres__get_incremental_microbatch_sql": {"name": "postgres__get_incremental_microbatch_sql", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/materializations/incremental_strategies.sql", "original_file_path": "macros/materializations/incremental_strategies.sql", "unique_id": "macro.dbt_postgres.postgres__get_incremental_microbatch_sql", "macro_sql": "{% macro postgres__get_incremental_microbatch_sql(arg_dict) %}\n\n {% if arg_dict[\"unique_key\"] %}\n {% do return(adapter.dispatch('get_incremental_merge_sql', 'dbt')(arg_dict)) %}\n {% else %}\n {{ exceptions.raise_compiler_error(\"dbt-postgres 'microbatch' requires a `unique_key` config\") }}\n {% endif %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_incremental_merge_sql", "macro.dbt.default__get_incremental_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "arg_dict", "type": null, "description": ""}], "created_at": 1789079002.2761407, "supported_languages": null}, "macro.dbt_postgres.postgres__snapshot_merge_sql": {"name": "postgres__snapshot_merge_sql", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/materializations/snapshot_merge.sql", "original_file_path": "macros/materializations/snapshot_merge.sql", "unique_id": "macro.dbt_postgres.postgres__snapshot_merge_sql", "macro_sql": "{% macro postgres__snapshot_merge_sql(target, source, insert_cols) -%}\n {%- set insert_cols_csv = insert_cols | join(', ') -%}\n\n {%- set columns = config.get(\"snapshot_table_column_names\") or get_snapshot_table_column_names() -%}\n\n update {{ target }}\n set {{ columns.dbt_valid_to }} = DBT_INTERNAL_SOURCE.{{ columns.dbt_valid_to }}\n from {{ source }} as DBT_INTERNAL_SOURCE\n where DBT_INTERNAL_SOURCE.{{ columns.dbt_scd_id }}::text = {{ target }}.{{ columns.dbt_scd_id }}::text\n and DBT_INTERNAL_SOURCE.dbt_change_type::text in ('update'::text, 'delete'::text)\n {% if config.get(\"dbt_valid_to_current\") %}\n and ({{ target }}.{{ columns.dbt_valid_to }} = {{ config.get('dbt_valid_to_current') }} or {{ target }}.{{ columns.dbt_valid_to }} is null);\n {% else %}\n and {{ target }}.{{ columns.dbt_valid_to }} is null;\n {% endif %}\n\n\n insert into {{ target }} ({{ insert_cols_csv }})\n select {% for column in insert_cols -%}\n DBT_INTERNAL_SOURCE.{{ column }} {%- if not loop.last %}, {%- endif %}\n {%- endfor %}\n from {{ source }} as DBT_INTERNAL_SOURCE\n where DBT_INTERNAL_SOURCE.dbt_change_type::text = 'insert'::text;\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_snapshot_table_column_names"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "target", "type": null, "description": ""}, {"name": "source", "type": null, "description": ""}, {"name": "insert_cols", "type": null, "description": ""}], "created_at": 1789079002.2774005, "supported_languages": null}, "macro.dbt_postgres.postgres__formatted_scalar_function_args_sql": {"name": "postgres__formatted_scalar_function_args_sql", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/materializations/functions/scalar.sql", "original_file_path": "macros/materializations/functions/scalar.sql", "unique_id": "macro.dbt_postgres.postgres__formatted_scalar_function_args_sql", "macro_sql": "{% macro postgres__formatted_scalar_function_args_sql() %}\n {% set args = [] %}\n {% for arg in model.arguments -%}\n {% set default_value = arg.get('default_value', none) %}\n {% if default_value != none %}\n {%- do args.append(arg.name ~ ' ' ~ arg.data_type ~ ' DEFAULT ' ~ default_value) -%}\n {% else %}\n {%- do args.append(arg.name ~ ' ' ~ arg.data_type) -%}\n {% endif %}\n {%- endfor %}\n {{ args | join(', ') }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789079002.278216, "supported_languages": null}, "macro.dbt_postgres.postgres__last_day": {"name": "postgres__last_day", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/utils/last_day.sql", "original_file_path": "macros/utils/last_day.sql", "unique_id": "macro.dbt_postgres.postgres__last_day", "macro_sql": "{% macro postgres__last_day(date, datepart) -%}\n\n {%- if datepart == 'quarter' -%}\n -- postgres dateadd does not support quarter interval.\n cast(\n {{dbt.dateadd('day', '-1',\n dbt.dateadd('month', '3', dbt.date_trunc(datepart, date))\n )}}\n as date)\n {%- else -%}\n {{dbt.default_last_day(date, datepart)}}\n {%- endif -%}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.dateadd", "macro.dbt.date_trunc", "macro.dbt.default_last_day"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "date", "type": null, "description": ""}, {"name": "datepart", "type": null, "description": ""}], "created_at": 1789079002.278745, "supported_languages": null}, "macro.dbt_postgres.postgres__listagg": {"name": "postgres__listagg", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/utils/listagg.sql", "original_file_path": "macros/utils/listagg.sql", "unique_id": "macro.dbt_postgres.postgres__listagg", "macro_sql": "{% macro postgres__listagg(measure, delimiter_text, order_by_clause, limit_num) -%}\n\n {% if limit_num -%}\n array_to_string(\n (array_agg(\n {{ measure }}\n {% if order_by_clause -%}\n {{ order_by_clause }}\n {%- endif %}\n ))[1:{{ limit_num }}],\n {{ delimiter_text }}\n )\n {%- else %}\n string_agg(\n {{ measure }},\n {{ delimiter_text }}\n {% if order_by_clause -%}\n {{ order_by_clause }}\n {%- endif %}\n )\n {%- endif %}\n\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "measure", "type": null, "description": ""}, {"name": "delimiter_text", "type": null, "description": ""}, {"name": "order_by_clause", "type": null, "description": ""}, {"name": "limit_num", "type": null, "description": ""}], "created_at": 1789079002.2793276, "supported_languages": null}, "macro.dbt_postgres.postgres__any_value": {"name": "postgres__any_value", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/utils/any_value.sql", "original_file_path": "macros/utils/any_value.sql", "unique_id": "macro.dbt_postgres.postgres__any_value", "macro_sql": "{% macro postgres__any_value(expression) -%}\n\n min({{ expression }})\n\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "expression", "type": null, "description": ""}], "created_at": 1789079002.2795053, "supported_languages": null}, "macro.dbt_postgres.postgres__datediff": {"name": "postgres__datediff", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/utils/datediff.sql", "original_file_path": "macros/utils/datediff.sql", "unique_id": "macro.dbt_postgres.postgres__datediff", "macro_sql": "{% macro postgres__datediff(first_date, second_date, datepart) -%}\n\n {% if datepart == 'year' %}\n (date_part('year', ({{second_date}})::date) - date_part('year', ({{first_date}})::date))\n {% elif datepart == 'quarter' %}\n ({{ datediff(first_date, second_date, 'year') }} * 4 + date_part('quarter', ({{second_date}})::date) - date_part('quarter', ({{first_date}})::date))\n {% elif datepart == 'month' %}\n ({{ datediff(first_date, second_date, 'year') }} * 12 + date_part('month', ({{second_date}})::date) - date_part('month', ({{first_date}})::date))\n {% elif datepart == 'day' %}\n (({{second_date}})::date - ({{first_date}})::date)\n {% elif datepart == 'week' %}\n ({{ datediff(first_date, second_date, 'day') }} / 7 + case\n when date_part('dow', ({{first_date}})::timestamp) <= date_part('dow', ({{second_date}})::timestamp) then\n case when {{first_date}} <= {{second_date}} then 0 else -1 end\n else\n case when {{first_date}} <= {{second_date}} then 1 else 0 end\n end)\n {% elif datepart == 'hour' %}\n ({{ datediff(first_date, second_date, 'day') }} * 24 + date_part('hour', ({{second_date}})::timestamp) - date_part('hour', ({{first_date}})::timestamp))\n {% elif datepart == 'minute' %}\n ({{ datediff(first_date, second_date, 'hour') }} * 60 + date_part('minute', ({{second_date}})::timestamp) - date_part('minute', ({{first_date}})::timestamp))\n {% elif datepart == 'second' %}\n ({{ datediff(first_date, second_date, 'minute') }} * 60 + floor(date_part('second', ({{second_date}})::timestamp)) - floor(date_part('second', ({{first_date}})::timestamp)))\n {% elif datepart == 'millisecond' %}\n ({{ datediff(first_date, second_date, 'minute') }} * 60000 + floor(date_part('millisecond', ({{second_date}})::timestamp)) - floor(date_part('millisecond', ({{first_date}})::timestamp)))\n {% elif datepart == 'microsecond' %}\n ({{ datediff(first_date, second_date, 'minute') }} * 60000000 + floor(date_part('microsecond', ({{second_date}})::timestamp)) - floor(date_part('microsecond', ({{first_date}})::timestamp)))\n {% else %}\n {{ exceptions.raise_compiler_error(\"Unsupported datepart for macro datediff in postgres: {!r}\".format(datepart)) }}\n {% endif %}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.datediff"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "first_date", "type": null, "description": ""}, {"name": "second_date", "type": null, "description": ""}, {"name": "datepart", "type": null, "description": ""}], "created_at": 1789079002.2817757, "supported_languages": null}, "macro.dbt_postgres.postgres__equals": {"name": "postgres__equals", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/utils/equals.sql", "original_file_path": "macros/utils/equals.sql", "unique_id": "macro.dbt_postgres.postgres__equals", "macro_sql": "{% macro postgres__equals(expr1, expr2) -%}\n{%- if adapter.behavior.enable_truthy_nulls_equals_macro.no_warn %}\n ({{ expr1 }} IS NOT DISTINCT FROM {{ expr2 }})\n{%- else -%}\n ({{ expr1 }} = {{ expr2 }})\n{%- endif %}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "expr1", "type": null, "description": ""}, {"name": "expr2", "type": null, "description": ""}], "created_at": 1789079002.2821772, "supported_languages": null}, "macro.dbt_postgres.postgres__dateadd": {"name": "postgres__dateadd", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/utils/dateadd.sql", "original_file_path": "macros/utils/dateadd.sql", "unique_id": "macro.dbt_postgres.postgres__dateadd", "macro_sql": "{% macro postgres__dateadd(datepart, interval, from_date_or_timestamp) %}\n\n {{ from_date_or_timestamp }} + ((interval '1 {{ datepart }}') * ({{ interval }}))\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "datepart", "type": null, "description": ""}, {"name": "interval", "type": null, "description": ""}, {"name": "from_date_or_timestamp", "type": null, "description": ""}], "created_at": 1789079002.2824275, "supported_languages": null}, "macro.dbt_postgres.postgres__split_part": {"name": "postgres__split_part", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/utils/split_part.sql", "original_file_path": "macros/utils/split_part.sql", "unique_id": "macro.dbt_postgres.postgres__split_part", "macro_sql": "{% macro postgres__split_part(string_text, delimiter_text, part_number) %}\n\n {% if part_number >= 0 %}\n {{ dbt.default__split_part(string_text, delimiter_text, part_number) }}\n {% else %}\n {{ dbt._split_part_negative(string_text, delimiter_text, part_number) }}\n {% endif %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__split_part", "macro.dbt._split_part_negative"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "string_text", "type": null, "description": ""}, {"name": "delimiter_text", "type": null, "description": ""}, {"name": "part_number", "type": null, "description": ""}], "created_at": 1789079002.282883, "supported_languages": null}, "macro.dbt.get_fixture_sql": {"name": "get_fixture_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/unit_test_sql/get_fixture_sql.sql", "original_file_path": "macros/unit_test_sql/get_fixture_sql.sql", "unique_id": "macro.dbt.get_fixture_sql", "macro_sql": "{% macro get_fixture_sql(rows, column_name_to_data_types) %}\n-- Fixture for {{ model.name }}\n{% set default_row = {} %}\n\n{%- if not column_name_to_data_types -%}\n{#-- Use defer_relation IFF it is available in the manifest and 'this' is missing from the database --#}\n{%- set this_or_defer_relation = defer_relation if (defer_relation and not load_relation(this)) else this -%}\n{%- set columns_in_relation = adapter.get_columns_in_relation(this_or_defer_relation) -%}\n\n{%- set column_name_to_data_types = {} -%}\n{%- set column_name_to_quoted = {} -%}\n{%- for column in columns_in_relation -%}\n\n{#-- This needs to be a case-insensitive comparison --#}\n{%- do column_name_to_data_types.update({column.name|lower: column.data_type}) -%}\n{%- do column_name_to_quoted.update({column.name|lower: column.quoted}) -%}\n{%- endfor -%}\n{%- endif -%}\n\n{%- if not column_name_to_data_types -%}\n {{ exceptions.raise_compiler_error(\"Not able to get columns for unit test '\" ~ model.name ~ \"' from relation \" ~ this ~ \" because the relation doesn't exist\") }}\n{%- endif -%}\n\n{%- for column_name, column_type in column_name_to_data_types.items() -%}\n {%- do default_row.update({column_name: (safe_cast(\"null\", column_type) | trim )}) -%}\n{%- endfor -%}\n\n{{ validate_fixture_rows(rows, row_number) }}\n\n{%- for row in rows -%}\n{%- set formatted_row = format_row(row, column_name_to_data_types) -%}\n{%- set default_row_copy = default_row.copy() -%}\n{%- do default_row_copy.update(formatted_row) -%}\nselect\n{%- for column_name, column_value in default_row_copy.items() %} {{ column_value }} as {{ column_name_to_quoted[column_name] }}{% if not loop.last -%}, {%- endif %}\n{%- endfor %}\n{%- if not loop.last %}\nunion all\n{% endif %}\n{%- endfor -%}\n\n{%- if (rows | length) == 0 -%}\n select\n {%- for column_name, column_value in default_row.items() %} {{ column_value }} as {{ column_name_to_quoted[column_name] }}{% if not loop.last -%},{%- endif %}\n {%- endfor %}\n limit 0\n{%- endif -%}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.load_relation", "macro.dbt.safe_cast", "macro.dbt.validate_fixture_rows", "macro.dbt.format_row"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "rows", "type": null, "description": ""}, {"name": "column_name_to_data_types", "type": null, "description": ""}], "created_at": 1789079002.2857778, "supported_languages": null}, "macro.dbt.get_expected_sql": {"name": "get_expected_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/unit_test_sql/get_fixture_sql.sql", "original_file_path": "macros/unit_test_sql/get_fixture_sql.sql", "unique_id": "macro.dbt.get_expected_sql", "macro_sql": "{% macro get_expected_sql(rows, column_name_to_data_types, column_name_to_quoted) %}\n\n{%- if (rows | length) == 0 -%}\n select * from dbt_internal_unit_test_actual\n limit 0\n{%- else -%}\n{%- for row in rows -%}\n{%- set formatted_row = format_row(row, column_name_to_data_types) -%}\nselect\n{%- for column_name, column_value in formatted_row.items() %} {{ column_value }} as {{ column_name_to_quoted[column_name] }}{% if not loop.last -%}, {%- endif %}\n{%- endfor %}\n{%- if not loop.last %}\nunion all\n{% endif %}\n{%- endfor -%}\n{%- endif -%}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.format_row"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "rows", "type": null, "description": ""}, {"name": "column_name_to_data_types", "type": null, "description": ""}, {"name": "column_name_to_quoted", "type": null, "description": ""}], "created_at": 1789079002.2866004, "supported_languages": null}, "macro.dbt.format_row": {"name": "format_row", "resource_type": "macro", "package_name": "dbt", "path": "macros/unit_test_sql/get_fixture_sql.sql", "original_file_path": "macros/unit_test_sql/get_fixture_sql.sql", "unique_id": "macro.dbt.format_row", "macro_sql": "\n\n{%- macro format_row(row, column_name_to_data_types) -%}\n {#-- generate case-insensitive formatted row --#}\n {% set formatted_row = {} %}\n {%- for column_name, column_value in row.items() -%}\n {% set column_name = column_name|lower %}\n\n {%- if column_name not in column_name_to_data_types %}\n {#-- if user-provided row contains column name that relation does not contain, raise an error --#}\n {% set fixture_name = \"expected output\" if model.resource_type == 'unit_test' else (\"'\" ~ model.name ~ \"'\") %}\n {{ exceptions.raise_compiler_error(\n \"Invalid column name: '\" ~ column_name ~ \"' in unit test fixture for \" ~ fixture_name ~ \".\"\n \"\\nAccepted columns for \" ~ fixture_name ~ \" are: \" ~ (column_name_to_data_types.keys()|list)\n ) }}\n {%- endif -%}\n\n {%- set column_type = column_name_to_data_types[column_name] %}\n\n {#-- For string fixture values, strip varchar length to prevent silent truncation (GH-11974) --#}\n {%- if column_value is string and 'varying' in column_type -%}\n {%- set column_type = column_type.split('(')[0] -%}\n {%- endif -%}\n\n {#-- sanitize column_value: wrap yaml strings in quotes, apply cast --#}\n {%- set column_value_clean = column_value -%}\n {%- if column_value is string -%}\n {%- set column_value_clean = dbt.string_literal(dbt.escape_single_quotes(column_value)) -%}\n {%- elif column_value is none -%}\n {%- set column_value_clean = 'null' -%}\n {%- endif -%}\n\n {%- set row_update = {column_name: safe_cast(column_value_clean, column_type) } -%}\n {%- do formatted_row.update(row_update) -%}\n {%- endfor -%}\n {{ return(formatted_row) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt.string_literal", "macro.dbt.escape_single_quotes", "macro.dbt.safe_cast"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "row", "type": null, "description": ""}, {"name": "column_name_to_data_types", "type": null, "description": ""}], "created_at": 1789079002.2880273, "supported_languages": null}, "macro.dbt.validate_fixture_rows": {"name": "validate_fixture_rows", "resource_type": "macro", "package_name": "dbt", "path": "macros/unit_test_sql/get_fixture_sql.sql", "original_file_path": "macros/unit_test_sql/get_fixture_sql.sql", "unique_id": "macro.dbt.validate_fixture_rows", "macro_sql": "{%- macro validate_fixture_rows(rows, row_number) -%}\n {{ return(adapter.dispatch('validate_fixture_rows', 'dbt')(rows, row_number)) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt.default__validate_fixture_rows"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "rows", "type": null, "description": ""}, {"name": "row_number", "type": null, "description": ""}], "created_at": 1789079002.2882745, "supported_languages": null}, "macro.dbt.default__validate_fixture_rows": {"name": "default__validate_fixture_rows", "resource_type": "macro", "package_name": "dbt", "path": "macros/unit_test_sql/get_fixture_sql.sql", "original_file_path": "macros/unit_test_sql/get_fixture_sql.sql", "unique_id": "macro.dbt.default__validate_fixture_rows", "macro_sql": "{%- macro default__validate_fixture_rows(rows, row_number) -%}\n {# This is an abstract method for adapter overrides as needed #}\n{%- endmacro -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "rows", "type": null, "description": ""}, {"name": "row_number", "type": null, "description": ""}], "created_at": 1789079002.2883933, "supported_languages": null}, "macro.dbt.get_create_sql": {"name": "get_create_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/create.sql", "original_file_path": "macros/relations/create.sql", "unique_id": "macro.dbt.get_create_sql", "macro_sql": "{%- macro get_create_sql(relation, sql) -%}\n {{- log('Applying CREATE to: ' ~ relation) -}}\n {{- adapter.dispatch('get_create_sql', 'dbt')(relation, sql) -}}\n{%- endmacro -%}\n\n\n", "depends_on": {"macros": ["macro.dbt.default__get_create_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "sql", "type": null, "description": ""}], "created_at": 1789079002.288821, "supported_languages": null}, "macro.dbt.default__get_create_sql": {"name": "default__get_create_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/create.sql", "original_file_path": "macros/relations/create.sql", "unique_id": "macro.dbt.default__get_create_sql", "macro_sql": "{%- macro default__get_create_sql(relation, sql) -%}\n\n {%- if relation.is_view -%}\n {{ get_create_view_as_sql(relation, sql) }}\n\n {%- elif relation.is_table -%}\n {{ get_create_table_as_sql(False, relation, sql) }}\n\n {%- elif relation.is_materialized_view -%}\n {{ get_create_materialized_view_as_sql(relation, sql) }}\n\n {%- else -%}\n {{- exceptions.raise_compiler_error(\"`get_create_sql` has not been implemented for: \" ~ relation.type ) -}}\n\n {%- endif -%}\n\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt.get_create_view_as_sql", "macro.dbt.get_create_table_as_sql", "macro.dbt.get_create_materialized_view_as_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "sql", "type": null, "description": ""}], "created_at": 1789079002.289322, "supported_languages": null}, "macro.dbt.drop_schema_named": {"name": "drop_schema_named", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/schema.sql", "original_file_path": "macros/relations/schema.sql", "unique_id": "macro.dbt.drop_schema_named", "macro_sql": "{% macro drop_schema_named(schema_name) %}\n {{ return(adapter.dispatch('drop_schema_named', 'dbt') (schema_name)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__drop_schema_named"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "schema_name", "type": null, "description": ""}], "created_at": 1789079002.2896163, "supported_languages": null}, "macro.dbt.default__drop_schema_named": {"name": "default__drop_schema_named", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/schema.sql", "original_file_path": "macros/relations/schema.sql", "unique_id": "macro.dbt.default__drop_schema_named", "macro_sql": "{% macro default__drop_schema_named(schema_name) %}\n {% set schema_relation = api.Relation.create(schema=schema_name) %}\n {{ adapter.drop_schema(schema_relation) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "schema_name", "type": null, "description": ""}], "created_at": 1789079002.2898684, "supported_languages": null}, "macro.dbt.get_create_intermediate_sql": {"name": "get_create_intermediate_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/create_intermediate.sql", "original_file_path": "macros/relations/create_intermediate.sql", "unique_id": "macro.dbt.get_create_intermediate_sql", "macro_sql": "{%- macro get_create_intermediate_sql(relation, sql) -%}\n {{- log('Applying CREATE INTERMEDIATE to: ' ~ relation) -}}\n {{- adapter.dispatch('get_create_intermediate_sql', 'dbt')(relation, sql) -}}\n{%- endmacro -%}\n\n\n", "depends_on": {"macros": ["macro.dbt.default__get_create_intermediate_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "sql", "type": null, "description": ""}], "created_at": 1789079002.2902362, "supported_languages": null}, "macro.dbt.default__get_create_intermediate_sql": {"name": "default__get_create_intermediate_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/create_intermediate.sql", "original_file_path": "macros/relations/create_intermediate.sql", "unique_id": "macro.dbt.default__get_create_intermediate_sql", "macro_sql": "{%- macro default__get_create_intermediate_sql(relation, sql) -%}\n\n -- get the standard intermediate name\n {% set intermediate_relation = make_intermediate_relation(relation) %}\n\n -- drop any pre-existing intermediate\n {{ get_drop_sql(intermediate_relation) }};\n\n {{ get_create_sql(intermediate_relation, sql) }}\n\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt.make_intermediate_relation", "macro.dbt.get_drop_sql", "macro.dbt.get_create_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "sql", "type": null, "description": ""}], "created_at": 1789079002.2905192, "supported_languages": null}, "macro.dbt.get_drop_backup_sql": {"name": "get_drop_backup_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/drop_backup.sql", "original_file_path": "macros/relations/drop_backup.sql", "unique_id": "macro.dbt.get_drop_backup_sql", "macro_sql": "{%- macro get_drop_backup_sql(relation) -%}\n {{- log('Applying DROP BACKUP to: ' ~ relation) -}}\n {{- adapter.dispatch('get_drop_backup_sql', 'dbt')(relation) -}}\n{%- endmacro -%}\n\n\n", "depends_on": {"macros": ["macro.dbt.default__get_drop_backup_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789079002.2908583, "supported_languages": null}, "macro.dbt.default__get_drop_backup_sql": {"name": "default__get_drop_backup_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/drop_backup.sql", "original_file_path": "macros/relations/drop_backup.sql", "unique_id": "macro.dbt.default__get_drop_backup_sql", "macro_sql": "{%- macro default__get_drop_backup_sql(relation) -%}\n\n -- get the standard backup name\n {% set backup_relation = make_backup_relation(relation, relation.type) %}\n\n {{ get_drop_sql(backup_relation) }}\n\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt.make_backup_relation", "macro.dbt.get_drop_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789079002.291096, "supported_languages": null}, "macro.dbt.get_rename_sql": {"name": "get_rename_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/rename.sql", "original_file_path": "macros/relations/rename.sql", "unique_id": "macro.dbt.get_rename_sql", "macro_sql": "{%- macro get_rename_sql(relation, new_name) -%}\n {{- log('Applying RENAME to: ' ~ relation) -}}\n {{- adapter.dispatch('get_rename_sql', 'dbt')(relation, new_name) -}}\n{%- endmacro -%}\n\n\n", "depends_on": {"macros": ["macro.dbt.default__get_rename_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "new_name", "type": null, "description": ""}], "created_at": 1789079002.291591, "supported_languages": null}, "macro.dbt.default__get_rename_sql": {"name": "default__get_rename_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/rename.sql", "original_file_path": "macros/relations/rename.sql", "unique_id": "macro.dbt.default__get_rename_sql", "macro_sql": "{%- macro default__get_rename_sql(relation, new_name) -%}\n\n {%- if relation.is_view -%}\n {{ get_rename_view_sql(relation, new_name) }}\n\n {%- elif relation.is_table -%}\n {{ get_rename_table_sql(relation, new_name) }}\n\n {%- elif relation.is_materialized_view -%}\n {{ get_rename_materialized_view_sql(relation, new_name) }}\n\n {%- else -%}\n {{- exceptions.raise_compiler_error(\"`get_rename_sql` has not been implemented for: \" ~ relation.type ) -}}\n\n {%- endif -%}\n\n{%- endmacro -%}\n\n\n", "depends_on": {"macros": ["macro.dbt.get_rename_view_sql", "macro.dbt.get_rename_table_sql", "macro.dbt.get_rename_materialized_view_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "new_name", "type": null, "description": ""}], "created_at": 1789079002.2920942, "supported_languages": null}, "macro.dbt.rename_relation": {"name": "rename_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/rename.sql", "original_file_path": "macros/relations/rename.sql", "unique_id": "macro.dbt.rename_relation", "macro_sql": "{% macro rename_relation(from_relation, to_relation) -%}\n {{ return(adapter.dispatch('rename_relation', 'dbt')(from_relation, to_relation)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__rename_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "from_relation", "type": null, "description": ""}, {"name": "to_relation", "type": null, "description": ""}], "created_at": 1789079002.2923234, "supported_languages": null}, "macro.dbt.default__rename_relation": {"name": "default__rename_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/rename.sql", "original_file_path": "macros/relations/rename.sql", "unique_id": "macro.dbt.default__rename_relation", "macro_sql": "{% macro default__rename_relation(from_relation, to_relation) -%}\n {% set target_name = adapter.quote_as_configured(to_relation.identifier, 'identifier') %}\n {% call statement('rename_relation') -%}\n alter table {{ from_relation.render() }} rename to {{ target_name }}\n {%- endcall %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "from_relation", "type": null, "description": ""}, {"name": "to_relation", "type": null, "description": ""}], "created_at": 1789079002.2926528, "supported_languages": null}, "macro.dbt.get_drop_sql": {"name": "get_drop_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/drop.sql", "original_file_path": "macros/relations/drop.sql", "unique_id": "macro.dbt.get_drop_sql", "macro_sql": "{%- macro get_drop_sql(relation) -%}\n {{- log('Applying DROP to: ' ~ relation) -}}\n {{- adapter.dispatch('get_drop_sql', 'dbt')(relation) -}}\n{%- endmacro -%}\n\n\n", "depends_on": {"macros": ["macro.dbt.default__get_drop_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789079002.2931483, "supported_languages": null}, "macro.dbt.default__get_drop_sql": {"name": "default__get_drop_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/drop.sql", "original_file_path": "macros/relations/drop.sql", "unique_id": "macro.dbt.default__get_drop_sql", "macro_sql": "{%- macro default__get_drop_sql(relation) -%}\n\n {%- if relation.is_view -%}\n {{ drop_view(relation) }}\n\n {%- elif relation.is_table -%}\n {{ drop_table(relation) }}\n\n {%- elif relation.is_materialized_view -%}\n {{ drop_materialized_view(relation) }}\n\n {%- else -%}\n drop {{ relation.type }} if exists {{ relation.render() }} cascade\n\n {%- endif -%}\n\n{%- endmacro -%}\n\n\n", "depends_on": {"macros": ["macro.dbt.drop_view", "macro.dbt.drop_table", "macro.dbt.drop_materialized_view"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789079002.2936616, "supported_languages": null}, "macro.dbt.drop_relation": {"name": "drop_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/drop.sql", "original_file_path": "macros/relations/drop.sql", "unique_id": "macro.dbt.drop_relation", "macro_sql": "{% macro drop_relation(relation) -%}\n {{ return(adapter.dispatch('drop_relation', 'dbt')(relation)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__drop_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789079002.2938826, "supported_languages": null}, "macro.dbt.default__drop_relation": {"name": "default__drop_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/drop.sql", "original_file_path": "macros/relations/drop.sql", "unique_id": "macro.dbt.default__drop_relation", "macro_sql": "{% macro default__drop_relation(relation) -%}\n {% call statement('drop_relation', auto_begin=False) -%}\n {{ get_drop_sql(relation) }}\n {%- endcall %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement", "macro.dbt.get_drop_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789079002.294117, "supported_languages": null}, "macro.dbt.drop_relation_if_exists": {"name": "drop_relation_if_exists", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/drop.sql", "original_file_path": "macros/relations/drop.sql", "unique_id": "macro.dbt.drop_relation_if_exists", "macro_sql": "{% macro drop_relation_if_exists(relation) %}\n {% if relation is not none %}\n {{ adapter.drop_relation(relation) }}\n {% endif %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789079002.2943323, "supported_languages": null}, "macro.dbt.get_rename_intermediate_sql": {"name": "get_rename_intermediate_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/rename_intermediate.sql", "original_file_path": "macros/relations/rename_intermediate.sql", "unique_id": "macro.dbt.get_rename_intermediate_sql", "macro_sql": "{%- macro get_rename_intermediate_sql(relation) -%}\n {{- log('Applying RENAME INTERMEDIATE to: ' ~ relation) -}}\n {{- adapter.dispatch('get_rename_intermediate_sql', 'dbt')(relation) -}}\n{%- endmacro -%}\n\n\n", "depends_on": {"macros": ["macro.dbt.default__get_rename_intermediate_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789079002.2946672, "supported_languages": null}, "macro.dbt.default__get_rename_intermediate_sql": {"name": "default__get_rename_intermediate_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/rename_intermediate.sql", "original_file_path": "macros/relations/rename_intermediate.sql", "unique_id": "macro.dbt.default__get_rename_intermediate_sql", "macro_sql": "{%- macro default__get_rename_intermediate_sql(relation) -%}\n\n -- get the standard intermediate name\n {% set intermediate_relation = make_intermediate_relation(relation) %}\n\n {{ get_rename_sql(intermediate_relation, relation.identifier) }}\n\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt.make_intermediate_relation", "macro.dbt.get_rename_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789079002.2949185, "supported_languages": null}, "macro.dbt.get_replace_sql": {"name": "get_replace_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/replace.sql", "original_file_path": "macros/relations/replace.sql", "unique_id": "macro.dbt.get_replace_sql", "macro_sql": "{% macro get_replace_sql(existing_relation, target_relation, sql) %}\n {{- log('Applying REPLACE to: ' ~ existing_relation) -}}\n {{- adapter.dispatch('get_replace_sql', 'dbt')(existing_relation, target_relation, sql) -}}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_replace_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "existing_relation", "type": null, "description": ""}, {"name": "target_relation", "type": null, "description": ""}, {"name": "sql", "type": null, "description": ""}], "created_at": 1789079002.2955065, "supported_languages": null}, "macro.dbt.default__get_replace_sql": {"name": "default__get_replace_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/replace.sql", "original_file_path": "macros/relations/replace.sql", "unique_id": "macro.dbt.default__get_replace_sql", "macro_sql": "{% macro default__get_replace_sql(existing_relation, target_relation, sql) %}\n\n {# /* use a create or replace statement if possible */ #}\n\n {% set is_replaceable = existing_relation.type == target_relation.type and existing_relation.can_be_replaced %}\n\n {% if is_replaceable and existing_relation.is_view %}\n {{ get_replace_view_sql(target_relation, sql) }}\n\n {% elif is_replaceable and existing_relation.is_table %}\n {{ get_replace_table_sql(target_relation, sql) }}\n\n {% elif is_replaceable and existing_relation.is_materialized_view %}\n {{ get_replace_materialized_view_sql(target_relation, sql) }}\n\n {# /* a create or replace statement is not possible, so try to stage and/or backup to be safe */ #}\n\n {# /* create target_relation as an intermediate relation, then swap it out with the existing one using a backup */ #}\n {%- elif target_relation.can_be_renamed and existing_relation.can_be_renamed -%}\n {{ get_create_intermediate_sql(target_relation, sql) }};\n {{ get_create_backup_sql(existing_relation) }};\n {{ get_rename_intermediate_sql(target_relation) }};\n {{ get_drop_backup_sql(existing_relation) }}\n\n {# /* create target_relation as an intermediate relation, then swap it out with the existing one without using a backup */ #}\n {%- elif target_relation.can_be_renamed -%}\n {{ get_create_intermediate_sql(target_relation, sql) }};\n {{ get_drop_sql(existing_relation) }};\n {{ get_rename_intermediate_sql(target_relation) }}\n\n {# /* create target_relation in place by first backing up the existing relation */ #}\n {%- elif existing_relation.can_be_renamed -%}\n {{ get_create_backup_sql(existing_relation) }};\n {{ get_create_sql(target_relation, sql) }};\n {{ get_drop_backup_sql(existing_relation) }}\n\n {# /* no renaming is allowed, so just drop and create */ #}\n {%- else -%}\n {{ get_drop_sql(existing_relation) }};\n {{ get_create_sql(target_relation, sql) }}\n\n {%- endif -%}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_replace_view_sql", "macro.dbt.get_replace_table_sql", "macro.dbt.get_replace_materialized_view_sql", "macro.dbt.get_create_intermediate_sql", "macro.dbt.get_create_backup_sql", "macro.dbt.get_rename_intermediate_sql", "macro.dbt.get_drop_backup_sql", "macro.dbt.get_drop_sql", "macro.dbt.get_create_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "existing_relation", "type": null, "description": ""}, {"name": "target_relation", "type": null, "description": ""}, {"name": "sql", "type": null, "description": ""}], "created_at": 1789079002.296818, "supported_languages": null}, "macro.dbt.get_create_backup_sql": {"name": "get_create_backup_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/create_backup.sql", "original_file_path": "macros/relations/create_backup.sql", "unique_id": "macro.dbt.get_create_backup_sql", "macro_sql": "{%- macro get_create_backup_sql(relation) -%}\n {{- log('Applying CREATE BACKUP to: ' ~ relation) -}}\n {{- adapter.dispatch('get_create_backup_sql', 'dbt')(relation) -}}\n{%- endmacro -%}\n\n\n", "depends_on": {"macros": ["macro.dbt.default__get_create_backup_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789079002.2971876, "supported_languages": null}, "macro.dbt.default__get_create_backup_sql": {"name": "default__get_create_backup_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/create_backup.sql", "original_file_path": "macros/relations/create_backup.sql", "unique_id": "macro.dbt.default__get_create_backup_sql", "macro_sql": "{%- macro default__get_create_backup_sql(relation) -%}\n\n -- get the standard backup name\n {% set backup_relation = make_backup_relation(relation, relation.type) %}\n\n -- drop any pre-existing backup\n {{ get_drop_sql(backup_relation) }};\n\n {{ get_rename_sql(relation, backup_relation.identifier) }}\n\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt.make_backup_relation", "macro.dbt.get_drop_sql", "macro.dbt.get_rename_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789079002.2974837, "supported_languages": null}, "macro.dbt.get_create_materialized_view_as_sql": {"name": "get_create_materialized_view_as_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/materialized_view/create.sql", "original_file_path": "macros/relations/materialized_view/create.sql", "unique_id": "macro.dbt.get_create_materialized_view_as_sql", "macro_sql": "{% macro get_create_materialized_view_as_sql(relation, sql) -%}\n {{- adapter.dispatch('get_create_materialized_view_as_sql', 'dbt')(relation, sql) -}}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__get_create_materialized_view_as_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "sql", "type": null, "description": ""}], "created_at": 1789079002.2977755, "supported_languages": null}, "macro.dbt.default__get_create_materialized_view_as_sql": {"name": "default__get_create_materialized_view_as_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/materialized_view/create.sql", "original_file_path": "macros/relations/materialized_view/create.sql", "unique_id": "macro.dbt.default__get_create_materialized_view_as_sql", "macro_sql": "{% macro default__get_create_materialized_view_as_sql(relation, sql) -%}\n {{ exceptions.raise_compiler_error(\n \"`get_create_materialized_view_as_sql` has not been implemented for this adapter.\"\n ) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "sql", "type": null, "description": ""}], "created_at": 1789079002.2979584, "supported_languages": null}, "macro.dbt.get_alter_materialized_view_as_sql": {"name": "get_alter_materialized_view_as_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/materialized_view/alter.sql", "original_file_path": "macros/relations/materialized_view/alter.sql", "unique_id": "macro.dbt.get_alter_materialized_view_as_sql", "macro_sql": "{% macro get_alter_materialized_view_as_sql(\n relation,\n configuration_changes,\n sql,\n existing_relation,\n backup_relation,\n intermediate_relation\n) %}\n {{- log('Applying ALTER to: ' ~ relation) -}}\n {{- adapter.dispatch('get_alter_materialized_view_as_sql', 'dbt')(\n relation,\n configuration_changes,\n sql,\n existing_relation,\n backup_relation,\n intermediate_relation\n ) -}}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__get_alter_materialized_view_as_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "configuration_changes", "type": null, "description": ""}, {"name": "sql", "type": null, "description": ""}, {"name": "existing_relation", "type": null, "description": ""}, {"name": "backup_relation", "type": null, "description": ""}, {"name": "intermediate_relation", "type": null, "description": ""}], "created_at": 1789079002.2985215, "supported_languages": null}, "macro.dbt.default__get_alter_materialized_view_as_sql": {"name": "default__get_alter_materialized_view_as_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/materialized_view/alter.sql", "original_file_path": "macros/relations/materialized_view/alter.sql", "unique_id": "macro.dbt.default__get_alter_materialized_view_as_sql", "macro_sql": "{% macro default__get_alter_materialized_view_as_sql(\n relation,\n configuration_changes,\n sql,\n existing_relation,\n backup_relation,\n intermediate_relation\n) %}\n {{ exceptions.raise_compiler_error(\"Materialized views have not been implemented for this adapter.\") }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "configuration_changes", "type": null, "description": ""}, {"name": "sql", "type": null, "description": ""}, {"name": "existing_relation", "type": null, "description": ""}, {"name": "backup_relation", "type": null, "description": ""}, {"name": "intermediate_relation", "type": null, "description": ""}], "created_at": 1789079002.298731, "supported_languages": null}, "macro.dbt.get_materialized_view_configuration_changes": {"name": "get_materialized_view_configuration_changes", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/materialized_view/alter.sql", "original_file_path": "macros/relations/materialized_view/alter.sql", "unique_id": "macro.dbt.get_materialized_view_configuration_changes", "macro_sql": "{% macro get_materialized_view_configuration_changes(existing_relation, new_config) %}\n /* {#\n It's recommended that configuration changes be formatted as follows:\n {\"\": [{\"action\": \"\", \"context\": ...}]}\n\n For example:\n {\n \"indexes\": [\n {\"action\": \"drop\", \"context\": \"index_abc\"},\n {\"action\": \"create\", \"context\": {\"columns\": [\"column_1\", \"column_2\"], \"type\": \"hash\", \"unique\": True}},\n ],\n }\n\n Either way, `get_materialized_view_configuration_changes` needs to align with `get_alter_materialized_view_as_sql`.\n #} */\n {{- log('Determining configuration changes on: ' ~ existing_relation) -}}\n {%- do return(adapter.dispatch('get_materialized_view_configuration_changes', 'dbt')(existing_relation, new_config)) -%}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__get_materialized_view_configuration_changes"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "existing_relation", "type": null, "description": ""}, {"name": "new_config", "type": null, "description": ""}], "created_at": 1789079002.2990553, "supported_languages": null}, "macro.dbt.default__get_materialized_view_configuration_changes": {"name": "default__get_materialized_view_configuration_changes", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/materialized_view/alter.sql", "original_file_path": "macros/relations/materialized_view/alter.sql", "unique_id": "macro.dbt.default__get_materialized_view_configuration_changes", "macro_sql": "{% macro default__get_materialized_view_configuration_changes(existing_relation, new_config) %}\n {{ exceptions.raise_compiler_error(\"Materialized views have not been implemented for this adapter.\") }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "existing_relation", "type": null, "description": ""}, {"name": "new_config", "type": null, "description": ""}], "created_at": 1789079002.2992241, "supported_languages": null}, "macro.dbt.get_rename_materialized_view_sql": {"name": "get_rename_materialized_view_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/materialized_view/rename.sql", "original_file_path": "macros/relations/materialized_view/rename.sql", "unique_id": "macro.dbt.get_rename_materialized_view_sql", "macro_sql": "{% macro get_rename_materialized_view_sql(relation, new_name) %}\n {{- adapter.dispatch('get_rename_materialized_view_sql', 'dbt')(relation, new_name) -}}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__get_rename_materialized_view_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "new_name", "type": null, "description": ""}], "created_at": 1789079002.2995155, "supported_languages": null}, "macro.dbt.default__get_rename_materialized_view_sql": {"name": "default__get_rename_materialized_view_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/materialized_view/rename.sql", "original_file_path": "macros/relations/materialized_view/rename.sql", "unique_id": "macro.dbt.default__get_rename_materialized_view_sql", "macro_sql": "{% macro default__get_rename_materialized_view_sql(relation, new_name) %}\n {{ exceptions.raise_compiler_error(\n \"`get_rename_materialized_view_sql` has not been implemented for this adapter.\"\n ) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "new_name", "type": null, "description": ""}], "created_at": 1789079002.2997448, "supported_languages": null}, "macro.dbt.refresh_materialized_view": {"name": "refresh_materialized_view", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/materialized_view/refresh.sql", "original_file_path": "macros/relations/materialized_view/refresh.sql", "unique_id": "macro.dbt.refresh_materialized_view", "macro_sql": "{% macro refresh_materialized_view(relation) %}\n {{- log('Applying REFRESH to: ' ~ relation) -}}\n {{- adapter.dispatch('refresh_materialized_view', 'dbt')(relation) -}}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__refresh_materialized_view"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789079002.3000793, "supported_languages": null}, "macro.dbt.default__refresh_materialized_view": {"name": "default__refresh_materialized_view", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/materialized_view/refresh.sql", "original_file_path": "macros/relations/materialized_view/refresh.sql", "unique_id": "macro.dbt.default__refresh_materialized_view", "macro_sql": "{% macro default__refresh_materialized_view(relation) %}\n {{ exceptions.raise_compiler_error(\"`refresh_materialized_view` has not been implemented for this adapter.\") }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789079002.3002305, "supported_languages": null}, "macro.dbt.drop_materialized_view": {"name": "drop_materialized_view", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/materialized_view/drop.sql", "original_file_path": "macros/relations/materialized_view/drop.sql", "unique_id": "macro.dbt.drop_materialized_view", "macro_sql": "{% macro drop_materialized_view(relation) -%}\n {{- adapter.dispatch('drop_materialized_view', 'dbt')(relation) -}}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__drop_materialized_view"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789079002.3004944, "supported_languages": null}, "macro.dbt.default__drop_materialized_view": {"name": "default__drop_materialized_view", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/materialized_view/drop.sql", "original_file_path": "macros/relations/materialized_view/drop.sql", "unique_id": "macro.dbt.default__drop_materialized_view", "macro_sql": "{% macro default__drop_materialized_view(relation) -%}\n drop materialized view if exists {{ relation.render() }} cascade\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789079002.3006368, "supported_languages": null}, "macro.dbt.get_replace_materialized_view_sql": {"name": "get_replace_materialized_view_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/materialized_view/replace.sql", "original_file_path": "macros/relations/materialized_view/replace.sql", "unique_id": "macro.dbt.get_replace_materialized_view_sql", "macro_sql": "{% macro get_replace_materialized_view_sql(relation, sql) %}\n {{- adapter.dispatch('get_replace_materialized_view_sql', 'dbt')(relation, sql) -}}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_replace_materialized_view_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "sql", "type": null, "description": ""}], "created_at": 1789079002.3009353, "supported_languages": null}, "macro.dbt.default__get_replace_materialized_view_sql": {"name": "default__get_replace_materialized_view_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/materialized_view/replace.sql", "original_file_path": "macros/relations/materialized_view/replace.sql", "unique_id": "macro.dbt.default__get_replace_materialized_view_sql", "macro_sql": "{% macro default__get_replace_materialized_view_sql(relation, sql) %}\n {{ exceptions.raise_compiler_error(\n \"`get_replace_materialized_view_sql` has not been implemented for this adapter.\"\n ) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "sql", "type": null, "description": ""}], "created_at": 1789079002.3011053, "supported_languages": null}, "macro.dbt.get_create_view_as_sql": {"name": "get_create_view_as_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/view/create.sql", "original_file_path": "macros/relations/view/create.sql", "unique_id": "macro.dbt.get_create_view_as_sql", "macro_sql": "{% macro get_create_view_as_sql(relation, sql) -%}\n {{ adapter.dispatch('get_create_view_as_sql', 'dbt')(relation, sql) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_create_view_as_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "sql", "type": null, "description": ""}], "created_at": 1789079002.3014977, "supported_languages": null}, "macro.dbt.default__get_create_view_as_sql": {"name": "default__get_create_view_as_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/view/create.sql", "original_file_path": "macros/relations/view/create.sql", "unique_id": "macro.dbt.default__get_create_view_as_sql", "macro_sql": "{% macro default__get_create_view_as_sql(relation, sql) -%}\n {{ return(create_view_as(relation, sql)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.create_view_as"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "sql", "type": null, "description": ""}], "created_at": 1789079002.301691, "supported_languages": null}, "macro.dbt.create_view_as": {"name": "create_view_as", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/view/create.sql", "original_file_path": "macros/relations/view/create.sql", "unique_id": "macro.dbt.create_view_as", "macro_sql": "{% macro create_view_as(relation, sql) -%}\n {{ adapter.dispatch('create_view_as', 'dbt')(relation, sql) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__create_view_as"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "sql", "type": null, "description": ""}], "created_at": 1789079002.3019042, "supported_languages": null}, "macro.dbt.default__create_view_as": {"name": "default__create_view_as", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/view/create.sql", "original_file_path": "macros/relations/view/create.sql", "unique_id": "macro.dbt.default__create_view_as", "macro_sql": "{% macro default__create_view_as(relation, sql) -%}\n {%- set sql_header = config.get('sql_header', none) -%}\n\n {{ sql_header if sql_header is not none }}\n create view {{ relation.render() }}\n {% set contract_config = config.get('contract') %}\n {% if contract_config.enforced %}\n {{ get_assert_columns_equivalent(sql) }}\n {%- endif %}\n as (\n {{ sql }}\n );\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.get_assert_columns_equivalent"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "sql", "type": null, "description": ""}], "created_at": 1789079002.3023841, "supported_languages": null}, "macro.dbt.get_rename_view_sql": {"name": "get_rename_view_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/view/rename.sql", "original_file_path": "macros/relations/view/rename.sql", "unique_id": "macro.dbt.get_rename_view_sql", "macro_sql": "{% macro get_rename_view_sql(relation, new_name) %}\n {{- adapter.dispatch('get_rename_view_sql', 'dbt')(relation, new_name) -}}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__get_rename_view_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "new_name", "type": null, "description": ""}], "created_at": 1789079002.3026745, "supported_languages": null}, "macro.dbt.default__get_rename_view_sql": {"name": "default__get_rename_view_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/view/rename.sql", "original_file_path": "macros/relations/view/rename.sql", "unique_id": "macro.dbt.default__get_rename_view_sql", "macro_sql": "{% macro default__get_rename_view_sql(relation, new_name) %}\n {{ exceptions.raise_compiler_error(\n \"`get_rename_view_sql` has not been implemented for this adapter.\"\n ) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "new_name", "type": null, "description": ""}], "created_at": 1789079002.3028383, "supported_languages": null}, "macro.dbt.drop_view": {"name": "drop_view", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/view/drop.sql", "original_file_path": "macros/relations/view/drop.sql", "unique_id": "macro.dbt.drop_view", "macro_sql": "{% macro drop_view(relation) -%}\n {{- adapter.dispatch('drop_view', 'dbt')(relation) -}}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__drop_view"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789079002.3031137, "supported_languages": null}, "macro.dbt.default__drop_view": {"name": "default__drop_view", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/view/drop.sql", "original_file_path": "macros/relations/view/drop.sql", "unique_id": "macro.dbt.default__drop_view", "macro_sql": "{% macro default__drop_view(relation) -%}\n drop view if exists {{ relation.render() }} cascade\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789079002.3032537, "supported_languages": null}, "macro.dbt.get_replace_view_sql": {"name": "get_replace_view_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/view/replace.sql", "original_file_path": "macros/relations/view/replace.sql", "unique_id": "macro.dbt.get_replace_view_sql", "macro_sql": "{% macro get_replace_view_sql(relation, sql) %}\n {{- adapter.dispatch('get_replace_view_sql', 'dbt')(relation, sql) -}}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__get_replace_view_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "sql", "type": null, "description": ""}], "created_at": 1789079002.3037887, "supported_languages": null}, "macro.dbt.default__get_replace_view_sql": {"name": "default__get_replace_view_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/view/replace.sql", "original_file_path": "macros/relations/view/replace.sql", "unique_id": "macro.dbt.default__get_replace_view_sql", "macro_sql": "{% macro default__get_replace_view_sql(relation, sql) %}\n {{ exceptions.raise_compiler_error(\n \"`get_replace_view_sql` has not been implemented for this adapter.\"\n ) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "sql", "type": null, "description": ""}], "created_at": 1789079002.3040278, "supported_languages": null}, "macro.dbt.create_or_replace_view": {"name": "create_or_replace_view", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/view/replace.sql", "original_file_path": "macros/relations/view/replace.sql", "unique_id": "macro.dbt.create_or_replace_view", "macro_sql": "{% macro create_or_replace_view() %}\n {%- set identifier = model['alias'] -%}\n\n {%- set old_relation = adapter.get_relation(database=database, schema=schema, identifier=identifier) -%}\n {%- set exists_as_view = (old_relation is not none and old_relation.is_view) -%}\n\n {%- set target_relation = api.Relation.create(\n identifier=identifier, schema=schema, database=database,\n type='view') -%}\n {% set grant_config = config.get('grants') %}\n\n {{ run_hooks(pre_hooks) }}\n\n -- If there's a table with the same name and we weren't told to full refresh,\n -- that's an error. If we were told to full refresh, drop it. This behavior differs\n -- for Snowflake and BigQuery, so multiple dispatch is used.\n {%- if old_relation is not none and old_relation.is_table -%}\n {{ handle_existing_table(should_full_refresh(), old_relation) }}\n {%- endif -%}\n\n -- build model\n {% call statement('main') -%}\n {{ get_create_view_as_sql(target_relation, sql) }}\n {%- endcall %}\n\n {% set should_revoke = should_revoke(exists_as_view, full_refresh_mode=True) %}\n {% do apply_grants(target_relation, grant_config, should_revoke=should_revoke) %}\n\n {{ run_hooks(post_hooks) }}\n\n {{ return({'relations': [target_relation]}) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.run_hooks", "macro.dbt.handle_existing_table", "macro.dbt.should_full_refresh", "macro.dbt.statement", "macro.dbt.get_create_view_as_sql", "macro.dbt.should_revoke", "macro.dbt.apply_grants"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789079002.3052475, "supported_languages": null}, "macro.dbt.handle_existing_table": {"name": "handle_existing_table", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/view/replace.sql", "original_file_path": "macros/relations/view/replace.sql", "unique_id": "macro.dbt.handle_existing_table", "macro_sql": "{% macro handle_existing_table(full_refresh, old_relation) %}\n {{ adapter.dispatch('handle_existing_table', 'dbt')(full_refresh, old_relation) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__handle_existing_table"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "full_refresh", "type": null, "description": ""}, {"name": "old_relation", "type": null, "description": ""}], "created_at": 1789079002.3054748, "supported_languages": null}, "macro.dbt.default__handle_existing_table": {"name": "default__handle_existing_table", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/view/replace.sql", "original_file_path": "macros/relations/view/replace.sql", "unique_id": "macro.dbt.default__handle_existing_table", "macro_sql": "{% macro default__handle_existing_table(full_refresh, old_relation) %}\n {{ log(\"Dropping relation \" ~ old_relation.render() ~ \" because it is of type \" ~ old_relation.type) }}\n {{ adapter.drop_relation(old_relation) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "full_refresh", "type": null, "description": ""}, {"name": "old_relation", "type": null, "description": ""}], "created_at": 1789079002.305741, "supported_languages": null}, "macro.dbt.get_table_columns_and_constraints": {"name": "get_table_columns_and_constraints", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/column/columns_spec_ddl.sql", "original_file_path": "macros/relations/column/columns_spec_ddl.sql", "unique_id": "macro.dbt.get_table_columns_and_constraints", "macro_sql": "{%- macro get_table_columns_and_constraints() -%}\n {{ adapter.dispatch('get_table_columns_and_constraints', 'dbt')() }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt.default__get_table_columns_and_constraints"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789079002.3065531, "supported_languages": null}, "macro.dbt.default__get_table_columns_and_constraints": {"name": "default__get_table_columns_and_constraints", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/column/columns_spec_ddl.sql", "original_file_path": "macros/relations/column/columns_spec_ddl.sql", "unique_id": "macro.dbt.default__get_table_columns_and_constraints", "macro_sql": "{% macro default__get_table_columns_and_constraints() -%}\n {{ return(table_columns_and_constraints()) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.table_columns_and_constraints"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789079002.3066955, "supported_languages": null}, "macro.dbt.table_columns_and_constraints": {"name": "table_columns_and_constraints", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/column/columns_spec_ddl.sql", "original_file_path": "macros/relations/column/columns_spec_ddl.sql", "unique_id": "macro.dbt.table_columns_and_constraints", "macro_sql": "{% macro table_columns_and_constraints() %}\n {# loop through user_provided_columns to create DDL with data types and constraints #}\n {%- set raw_column_constraints = adapter.render_raw_columns_constraints(raw_columns=model['columns']) -%}\n {%- set raw_model_constraints = adapter.render_raw_model_constraints(raw_constraints=model['constraints']) -%}\n (\n {% for c in raw_column_constraints -%}\n {{ c }}{{ \",\" if not loop.last or raw_model_constraints }}\n {% endfor %}\n {% for c in raw_model_constraints -%}\n {{ c }}{{ \",\" if not loop.last }}\n {% endfor -%}\n )\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789079002.307296, "supported_languages": null}, "macro.dbt.get_assert_columns_equivalent": {"name": "get_assert_columns_equivalent", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/column/columns_spec_ddl.sql", "original_file_path": "macros/relations/column/columns_spec_ddl.sql", "unique_id": "macro.dbt.get_assert_columns_equivalent", "macro_sql": "\n\n{%- macro get_assert_columns_equivalent(sql) -%}\n {{ adapter.dispatch('get_assert_columns_equivalent', 'dbt')(sql) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt.default__get_assert_columns_equivalent"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "sql", "type": null, "description": ""}], "created_at": 1789079002.3074875, "supported_languages": null}, "macro.dbt.default__get_assert_columns_equivalent": {"name": "default__get_assert_columns_equivalent", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/column/columns_spec_ddl.sql", "original_file_path": "macros/relations/column/columns_spec_ddl.sql", "unique_id": "macro.dbt.default__get_assert_columns_equivalent", "macro_sql": "{% macro default__get_assert_columns_equivalent(sql) -%}\n {{ return(assert_columns_equivalent(sql)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.assert_columns_equivalent"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "sql", "type": null, "description": ""}], "created_at": 1789079002.307646, "supported_languages": null}, "macro.dbt.assert_columns_equivalent": {"name": "assert_columns_equivalent", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/column/columns_spec_ddl.sql", "original_file_path": "macros/relations/column/columns_spec_ddl.sql", "unique_id": "macro.dbt.assert_columns_equivalent", "macro_sql": "{% macro assert_columns_equivalent(sql) %}\n\n {#-- First ensure the user has defined 'columns' in yaml specification --#}\n {%- set user_defined_columns = model['columns'] -%}\n {%- if not user_defined_columns -%}\n {{ exceptions.raise_contract_error([], []) }}\n {%- endif -%}\n\n {#-- Obtain the column schema provided by sql file. #}\n {%- set sql_file_provided_columns = get_column_schema_from_query(sql, config.get('sql_header', none)) -%}\n {#--Obtain the column schema provided by the schema file by generating an 'empty schema' query from the model's columns. #}\n {%- set schema_file_provided_columns = get_column_schema_from_query(get_empty_schema_sql(user_defined_columns)) -%}\n\n {#-- create dictionaries with name and formatted data type and strings for exception #}\n {%- set sql_columns = format_columns(sql_file_provided_columns) -%}\n {%- set yaml_columns = format_columns(schema_file_provided_columns) -%}\n\n {%- if sql_columns|length != yaml_columns|length -%}\n {%- do exceptions.raise_contract_error(yaml_columns, sql_columns) -%}\n {%- endif -%}\n\n {%- for sql_col in sql_columns -%}\n {%- set yaml_col = [] -%}\n {%- for this_col in yaml_columns -%}\n {%- if this_col['name'] == sql_col['name'] -%}\n {%- do yaml_col.append(this_col) -%}\n {%- break -%}\n {%- endif -%}\n {%- endfor -%}\n {%- if not yaml_col -%}\n {#-- Column with name not found in yaml #}\n {%- do exceptions.raise_contract_error(yaml_columns, sql_columns) -%}\n {%- endif -%}\n {%- if sql_col['formatted'] != yaml_col[0]['formatted'] -%}\n {#-- Column data types don't match #}\n {%- do exceptions.raise_contract_error(yaml_columns, sql_columns) -%}\n {%- endif -%}\n {%- endfor -%}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_column_schema_from_query", "macro.dbt.get_empty_schema_sql", "macro.dbt.format_columns"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "sql", "type": null, "description": ""}], "created_at": 1789079002.3090608, "supported_languages": null}, "macro.dbt.format_columns": {"name": "format_columns", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/column/columns_spec_ddl.sql", "original_file_path": "macros/relations/column/columns_spec_ddl.sql", "unique_id": "macro.dbt.format_columns", "macro_sql": "{% macro format_columns(columns) %}\n {% set formatted_columns = [] %}\n {% for column in columns %}\n {%- set formatted_column = adapter.dispatch('format_column', 'dbt')(column) -%}\n {%- do formatted_columns.append(formatted_column) -%}\n {% endfor %}\n {{ return(formatted_columns) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__format_column"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "columns", "type": null, "description": ""}], "created_at": 1789079002.3094876, "supported_languages": null}, "macro.dbt.default__format_column": {"name": "default__format_column", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/column/columns_spec_ddl.sql", "original_file_path": "macros/relations/column/columns_spec_ddl.sql", "unique_id": "macro.dbt.default__format_column", "macro_sql": "{% macro default__format_column(column) -%}\n {% set data_type = column.dtype %}\n {% set formatted = column.column.lower() ~ \" \" ~ data_type %}\n {{ return({'name': column.name, 'data_type': data_type, 'formatted': formatted}) }}\n{%- endmacro -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "column", "type": null, "description": ""}], "created_at": 1789079002.3098695, "supported_languages": null}, "macro.dbt.get_create_table_as_sql": {"name": "get_create_table_as_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/table/create.sql", "original_file_path": "macros/relations/table/create.sql", "unique_id": "macro.dbt.get_create_table_as_sql", "macro_sql": "{% macro get_create_table_as_sql(temporary, relation, sql) -%}\n {{ adapter.dispatch('get_create_table_as_sql', 'dbt')(temporary, relation, sql) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_create_table_as_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "temporary", "type": null, "description": ""}, {"name": "relation", "type": null, "description": ""}, {"name": "sql", "type": null, "description": ""}], "created_at": 1789079002.3105526, "supported_languages": null}, "macro.dbt.default__get_create_table_as_sql": {"name": "default__get_create_table_as_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/table/create.sql", "original_file_path": "macros/relations/table/create.sql", "unique_id": "macro.dbt.default__get_create_table_as_sql", "macro_sql": "{% macro default__get_create_table_as_sql(temporary, relation, sql) -%}\n {{ return(create_table_as(temporary, relation, sql)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.create_table_as"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "temporary", "type": null, "description": ""}, {"name": "relation", "type": null, "description": ""}, {"name": "sql", "type": null, "description": ""}], "created_at": 1789079002.3107624, "supported_languages": null}, "macro.dbt.create_table_as": {"name": "create_table_as", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/table/create.sql", "original_file_path": "macros/relations/table/create.sql", "unique_id": "macro.dbt.create_table_as", "macro_sql": "{% macro create_table_as(temporary, relation, compiled_code, language='sql') -%}\n {# backward compatibility for create_table_as that does not support language #}\n {% if language == \"sql\" %}\n {{ adapter.dispatch('create_table_as', 'dbt')(temporary, relation, compiled_code)}}\n {% else %}\n {{ adapter.dispatch('create_table_as', 'dbt')(temporary, relation, compiled_code, language) }}\n {% endif %}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__create_table_as"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "temporary", "type": null, "description": ""}, {"name": "relation", "type": null, "description": ""}, {"name": "compiled_code", "type": null, "description": ""}, {"name": "language", "type": null, "description": ""}], "created_at": 1789079002.3113205, "supported_languages": null}, "macro.dbt.default__create_table_as": {"name": "default__create_table_as", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/table/create.sql", "original_file_path": "macros/relations/table/create.sql", "unique_id": "macro.dbt.default__create_table_as", "macro_sql": "{% macro default__create_table_as(temporary, relation, sql) -%}\n {%- set sql_header = config.get('sql_header', none) -%}\n\n {{ sql_header if sql_header is not none }}\n\n create {% if temporary: -%}temporary{%- endif %} table\n {{ relation.include(database=(not temporary), schema=(not temporary)) }}\n {% set contract_config = config.get('contract') %}\n {% if contract_config.enforced and (not temporary) %}\n {{ get_assert_columns_equivalent(sql) }}\n {{ get_table_columns_and_constraints() }}\n {%- set sql = get_select_subquery(sql) %}\n {% endif %}\n as (\n {{ sql }}\n );\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.get_assert_columns_equivalent", "macro.dbt.get_table_columns_and_constraints", "macro.dbt.get_select_subquery"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "temporary", "type": null, "description": ""}, {"name": "relation", "type": null, "description": ""}, {"name": "sql", "type": null, "description": ""}], "created_at": 1789079002.3121114, "supported_languages": null}, "macro.dbt.default__get_column_names": {"name": "default__get_column_names", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/table/create.sql", "original_file_path": "macros/relations/table/create.sql", "unique_id": "macro.dbt.default__get_column_names", "macro_sql": "{% macro default__get_column_names() %}\n {#- loop through user_provided_columns to get column names -#}\n {%- set user_provided_columns = model['columns'] -%}\n {%- for i in user_provided_columns %}\n {%- set col = user_provided_columns[i] -%}\n {%- set col_name = adapter.quote(col['name']) if col.get('quote') else col['name'] -%}\n {{ col_name }}{{ \", \" if not loop.last }}\n {%- endfor -%}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789079002.3126292, "supported_languages": null}, "macro.dbt.get_select_subquery": {"name": "get_select_subquery", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/table/create.sql", "original_file_path": "macros/relations/table/create.sql", "unique_id": "macro.dbt.get_select_subquery", "macro_sql": "{% macro get_select_subquery(sql) %}\n {{ return(adapter.dispatch('get_select_subquery', 'dbt')(sql)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_select_subquery"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "sql", "type": null, "description": ""}], "created_at": 1789079002.3128371, "supported_languages": null}, "macro.dbt.default__get_select_subquery": {"name": "default__get_select_subquery", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/table/create.sql", "original_file_path": "macros/relations/table/create.sql", "unique_id": "macro.dbt.default__get_select_subquery", "macro_sql": "{% macro default__get_select_subquery(sql) %}\n select {{ adapter.dispatch('get_column_names', 'dbt')() }}\n from (\n {{ sql }}\n ) as model_subq\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_column_names"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "sql", "type": null, "description": ""}], "created_at": 1789079002.3130522, "supported_languages": null}, "macro.dbt.get_rename_table_sql": {"name": "get_rename_table_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/table/rename.sql", "original_file_path": "macros/relations/table/rename.sql", "unique_id": "macro.dbt.get_rename_table_sql", "macro_sql": "{% macro get_rename_table_sql(relation, new_name) %}\n {{- adapter.dispatch('get_rename_table_sql', 'dbt')(relation, new_name) -}}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__get_rename_table_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "new_name", "type": null, "description": ""}], "created_at": 1789079002.3133519, "supported_languages": null}, "macro.dbt.default__get_rename_table_sql": {"name": "default__get_rename_table_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/table/rename.sql", "original_file_path": "macros/relations/table/rename.sql", "unique_id": "macro.dbt.default__get_rename_table_sql", "macro_sql": "{% macro default__get_rename_table_sql(relation, new_name) %}\n {{ exceptions.raise_compiler_error(\n \"`get_rename_table_sql` has not been implemented for this adapter.\"\n ) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "new_name", "type": null, "description": ""}], "created_at": 1789079002.3135197, "supported_languages": null}, "macro.dbt.drop_table": {"name": "drop_table", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/table/drop.sql", "original_file_path": "macros/relations/table/drop.sql", "unique_id": "macro.dbt.drop_table", "macro_sql": "{% macro drop_table(relation) -%}\n {{- adapter.dispatch('drop_table', 'dbt')(relation) -}}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__drop_table"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789079002.3137906, "supported_languages": null}, "macro.dbt.default__drop_table": {"name": "default__drop_table", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/table/drop.sql", "original_file_path": "macros/relations/table/drop.sql", "unique_id": "macro.dbt.default__drop_table", "macro_sql": "{% macro default__drop_table(relation) -%}\n drop table if exists {{ relation.render() }} cascade\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789079002.3139474, "supported_languages": null}, "macro.dbt.get_replace_table_sql": {"name": "get_replace_table_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/table/replace.sql", "original_file_path": "macros/relations/table/replace.sql", "unique_id": "macro.dbt.get_replace_table_sql", "macro_sql": "{% macro get_replace_table_sql(relation, sql) %}\n {{- adapter.dispatch('get_replace_table_sql', 'dbt')(relation, sql) -}}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__get_replace_table_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "sql", "type": null, "description": ""}], "created_at": 1789079002.3142426, "supported_languages": null}, "macro.dbt.default__get_replace_table_sql": {"name": "default__get_replace_table_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/table/replace.sql", "original_file_path": "macros/relations/table/replace.sql", "unique_id": "macro.dbt.default__get_replace_table_sql", "macro_sql": "{% macro default__get_replace_table_sql(relation, sql) %}\n {{ exceptions.raise_compiler_error(\n \"`get_replace_table_sql` has not been implemented for this adapter.\"\n ) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "sql", "type": null, "description": ""}], "created_at": 1789079002.3144107, "supported_languages": null}, "macro.dbt.default__test_relationships": {"name": "default__test_relationships", "resource_type": "macro", "package_name": "dbt", "path": "macros/generic_test_sql/relationships.sql", "original_file_path": "macros/generic_test_sql/relationships.sql", "unique_id": "macro.dbt.default__test_relationships", "macro_sql": "{% macro default__test_relationships(model, column_name, to, field) %}\n\nwith child as (\n select {{ column_name }} as from_field\n from {{ model }}\n where {{ column_name }} is not null\n),\n\nparent as (\n select {{ field }} as to_field\n from {{ to }}\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "column_name", "type": null, "description": ""}, {"name": "to", "type": null, "description": ""}, {"name": "field", "type": null, "description": ""}], "created_at": 1789079002.3147297, "supported_languages": null}, "macro.dbt.default__test_accepted_values": {"name": "default__test_accepted_values", "resource_type": "macro", "package_name": "dbt", "path": "macros/generic_test_sql/accepted_values.sql", "original_file_path": "macros/generic_test_sql/accepted_values.sql", "unique_id": "macro.dbt.default__test_accepted_values", "macro_sql": "{% macro default__test_accepted_values(model, column_name, values, quote=True) %}\n\nwith all_values as (\n\n select\n {{ column_name }} as value_field,\n count(*) as n_records\n\n from {{ model }}\n group by {{ column_name }}\n\n)\n\nselect *\nfrom all_values\nwhere value_field not in (\n {% for value in values -%}\n {% if quote -%}\n '{{ value }}'\n {%- else -%}\n {{ value }}\n {%- endif -%}\n {%- if not loop.last -%},{%- endif %}\n {%- endfor %}\n)\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "column_name", "type": null, "description": ""}, {"name": "values", "type": null, "description": ""}, {"name": "quote", "type": null, "description": ""}], "created_at": 1789079002.3153062, "supported_languages": null}, "macro.dbt.default__test_not_null": {"name": "default__test_not_null", "resource_type": "macro", "package_name": "dbt", "path": "macros/generic_test_sql/not_null.sql", "original_file_path": "macros/generic_test_sql/not_null.sql", "unique_id": "macro.dbt.default__test_not_null", "macro_sql": "{% macro default__test_not_null(model, column_name) %}\n\n{% set column_list = '*' if should_store_failures() else column_name %}\n\nselect {{ column_list }}\nfrom {{ model }}\nwhere {{ column_name }} is null\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.should_store_failures"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "column_name", "type": null, "description": ""}], "created_at": 1789079002.3156385, "supported_languages": null}, "macro.dbt.default__test_unique": {"name": "default__test_unique", "resource_type": "macro", "package_name": "dbt", "path": "macros/generic_test_sql/unique.sql", "original_file_path": "macros/generic_test_sql/unique.sql", "unique_id": "macro.dbt.default__test_unique", "macro_sql": "{% macro default__test_unique(model, column_name) %}\n\nselect\n {{ column_name }} as unique_field,\n count(*) as n_records\n\nfrom {{ model }}\nwhere {{ column_name }} is not null\ngroup by {{ column_name }}\nhaving count(*) > 1\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "column_name", "type": null, "description": ""}], "created_at": 1789079002.3159103, "supported_languages": null}, "macro.dbt.set_sql_header": {"name": "set_sql_header", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/configs.sql", "original_file_path": "macros/materializations/configs.sql", "unique_id": "macro.dbt.set_sql_header", "macro_sql": "{% macro set_sql_header(config) -%}\n {{ config.set('sql_header', caller()) }}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "config", "type": null, "description": ""}], "created_at": 1789079002.3162365, "supported_languages": null}, "macro.dbt.should_full_refresh": {"name": "should_full_refresh", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/configs.sql", "original_file_path": "macros/materializations/configs.sql", "unique_id": "macro.dbt.should_full_refresh", "macro_sql": "{% macro should_full_refresh() %}\n {% set config_full_refresh = config.get('full_refresh') %}\n {% if config_full_refresh is none %}\n {% set config_full_refresh = flags.FULL_REFRESH %}\n {% endif %}\n {% do return(config_full_refresh) %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789079002.3166535, "supported_languages": null}, "macro.dbt.should_store_failures": {"name": "should_store_failures", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/configs.sql", "original_file_path": "macros/materializations/configs.sql", "unique_id": "macro.dbt.should_store_failures", "macro_sql": "{% macro should_store_failures() %}\n {% set config_store_failures = config.get('store_failures') %}\n {% if config_store_failures is none %}\n {% set config_store_failures = flags.STORE_FAILURES %}\n {% endif %}\n {% do return(config_store_failures) %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789079002.3170006, "supported_languages": null}, "macro.dbt.run_hooks": {"name": "run_hooks", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/hooks.sql", "original_file_path": "macros/materializations/hooks.sql", "unique_id": "macro.dbt.run_hooks", "macro_sql": "{% macro run_hooks(hooks, inside_transaction=True) %}\n {% for hook in hooks | selectattr('transaction', 'equalto', inside_transaction) %}\n {% if not inside_transaction and loop.first %}\n {% call statement(auto_begin=inside_transaction) %}\n commit;\n {% endcall %}\n {% endif %}\n {% set rendered = render(hook.get('sql')) | trim %}\n {% if (rendered | length) > 0 %}\n {% call statement(auto_begin=inside_transaction) %}\n {{ rendered }}\n {% endcall %}\n {% endif %}\n {% endfor %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "hooks", "type": null, "description": ""}, {"name": "inside_transaction", "type": null, "description": ""}], "created_at": 1789079002.3179517, "supported_languages": null}, "macro.dbt.make_hook_config": {"name": "make_hook_config", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/hooks.sql", "original_file_path": "macros/materializations/hooks.sql", "unique_id": "macro.dbt.make_hook_config", "macro_sql": "{% macro make_hook_config(sql, inside_transaction) %}\n {{ tojson({\"sql\": sql, \"transaction\": inside_transaction}) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "sql", "type": null, "description": ""}, {"name": "inside_transaction", "type": null, "description": ""}], "created_at": 1789079002.3181753, "supported_languages": null}, "macro.dbt.before_begin": {"name": "before_begin", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/hooks.sql", "original_file_path": "macros/materializations/hooks.sql", "unique_id": "macro.dbt.before_begin", "macro_sql": "{% macro before_begin(sql) %}\n {{ make_hook_config(sql, inside_transaction=False) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.make_hook_config"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "sql", "type": null, "description": ""}], "created_at": 1789079002.318342, "supported_languages": null}, "macro.dbt.in_transaction": {"name": "in_transaction", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/hooks.sql", "original_file_path": "macros/materializations/hooks.sql", "unique_id": "macro.dbt.in_transaction", "macro_sql": "{% macro in_transaction(sql) %}\n {{ make_hook_config(sql, inside_transaction=True) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.make_hook_config"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "sql", "type": null, "description": ""}], "created_at": 1789079002.318511, "supported_languages": null}, "macro.dbt.after_commit": {"name": "after_commit", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/hooks.sql", "original_file_path": "macros/materializations/hooks.sql", "unique_id": "macro.dbt.after_commit", "macro_sql": "{% macro after_commit(sql) %}\n {{ make_hook_config(sql, inside_transaction=False) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.make_hook_config"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "sql", "type": null, "description": ""}], "created_at": 1789079002.3186748, "supported_languages": null}, "macro.dbt.materialization_seed_default": {"name": "materialization_seed_default", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/seeds/seed.sql", "original_file_path": "macros/materializations/seeds/seed.sql", "unique_id": "macro.dbt.materialization_seed_default", "macro_sql": "{% materialization seed, default %}\n\n {%- set identifier = model['alias'] -%}\n {%- set full_refresh_mode = (should_full_refresh()) -%}\n\n {%- set old_relation = adapter.get_relation(database=database, schema=schema, identifier=identifier) -%}\n\n {%- set exists_as_table = (old_relation is not none and old_relation.is_table) -%}\n {%- set exists_as_view = (old_relation is not none and old_relation.is_view) -%}\n\n {%- set grant_config = config.get('grants') -%}\n {%- set agate_table = load_agate_table() -%}\n -- grab current tables grants config for comparison later on\n\n {%- do store_result('agate_table', response='OK', agate_table=agate_table) -%}\n\n {{ run_hooks(pre_hooks, inside_transaction=False) }}\n\n -- `BEGIN` happens here:\n {{ run_hooks(pre_hooks, inside_transaction=True) }}\n\n -- build model\n {% set create_table_sql = \"\" %}\n {% if exists_as_view %}\n {{ exceptions.raise_compiler_error(\"Cannot seed to '{}', it is a view\".format(old_relation.render())) }}\n {% elif exists_as_table %}\n {% set create_table_sql = reset_csv_table(model, full_refresh_mode, old_relation, agate_table) %}\n {% else %}\n {% set create_table_sql = create_csv_table(model, agate_table) %}\n {% endif %}\n\n {% set code = 'CREATE' if full_refresh_mode else 'INSERT' %}\n {% set rows_affected = (agate_table.rows | length) %}\n {% set sql = \"\" %}\n {% if rows_affected > 0 %}\n {% set sql = load_csv_rows(model, agate_table) %}\n {% endif %}\n\n {% call noop_statement('main', code ~ ' ' ~ rows_affected, code, rows_affected) %}\n {{ get_csv_sql(create_table_sql, sql) }};\n {% endcall %}\n\n {% set target_relation = this.incorporate(type='table') %}\n\n {% set should_revoke = should_revoke(old_relation, full_refresh_mode) %}\n {% do apply_grants(target_relation, grant_config, should_revoke=should_revoke) %}\n\n {% do persist_docs(target_relation, model) %}\n\n {% if full_refresh_mode or not exists_as_table %}\n {% do create_indexes(target_relation) %}\n {% endif %}\n\n {{ run_hooks(post_hooks, inside_transaction=True) }}\n\n -- `COMMIT` happens here\n {{ adapter.commit() }}\n\n {{ run_hooks(post_hooks, inside_transaction=False) }}\n\n {{ return({'relations': [target_relation]}) }}\n\n{% endmaterialization %}", "depends_on": {"macros": ["macro.dbt.should_full_refresh", "macro.dbt.run_hooks", "macro.dbt.reset_csv_table", "macro.dbt.create_csv_table", "macro.dbt.load_csv_rows", "macro.dbt.noop_statement", "macro.dbt.get_csv_sql", "macro.dbt.should_revoke", "macro.dbt.apply_grants", "macro.dbt.persist_docs", "macro.dbt.create_indexes"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "supported_languages", "type": null, "description": ""}], "created_at": 1789079002.3216689, "supported_languages": ["sql"]}, "macro.dbt.create_csv_table": {"name": "create_csv_table", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "unique_id": "macro.dbt.create_csv_table", "macro_sql": "{% macro create_csv_table(model, agate_table) -%}\n {{ adapter.dispatch('create_csv_table', 'dbt')(model, agate_table) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__create_csv_table"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "agate_table", "type": null, "description": ""}], "created_at": 1789079002.3227544, "supported_languages": null}, "macro.dbt.default__create_csv_table": {"name": "default__create_csv_table", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "unique_id": "macro.dbt.default__create_csv_table", "macro_sql": "{% macro default__create_csv_table(model, agate_table) %}\n {%- set column_override = model['config'].get('column_types', {}) -%}\n {%- set quote_seed_column = model['config'].get('quote_columns', None) -%}\n\n {% set sql %}\n create table {{ this.render() }} (\n {%- for col_name in agate_table.column_names -%}\n {%- set inferred_type = adapter.convert_type(agate_table, loop.index0) -%}\n {%- set type = column_override.get(col_name, inferred_type) -%}\n {%- set column_name = (col_name | string) -%}\n {{ adapter.quote_seed_column(column_name, quote_seed_column) }} {{ type }} {%- if not loop.last -%}, {%- endif -%}\n {%- endfor -%}\n )\n {% endset %}\n\n {% call statement('_') -%}\n {{ sql }}\n {%- endcall %}\n\n {{ return(sql) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "agate_table", "type": null, "description": ""}], "created_at": 1789079002.3237627, "supported_languages": null}, "macro.dbt.reset_csv_table": {"name": "reset_csv_table", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "unique_id": "macro.dbt.reset_csv_table", "macro_sql": "{% macro reset_csv_table(model, full_refresh, old_relation, agate_table) -%}\n {{ adapter.dispatch('reset_csv_table', 'dbt')(model, full_refresh, old_relation, agate_table) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__reset_csv_table"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "full_refresh", "type": null, "description": ""}, {"name": "old_relation", "type": null, "description": ""}, {"name": "agate_table", "type": null, "description": ""}], "created_at": 1789079002.324041, "supported_languages": null}, "macro.dbt.default__reset_csv_table": {"name": "default__reset_csv_table", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "unique_id": "macro.dbt.default__reset_csv_table", "macro_sql": "{% macro default__reset_csv_table(model, full_refresh, old_relation, agate_table) %}\n {% set sql = \"\" %}\n {% if full_refresh %}\n {{ adapter.drop_relation(old_relation) }}\n {% set sql = create_csv_table(model, agate_table) %}\n {% else %}\n {{ adapter.truncate_relation(old_relation) }}\n {% set sql = \"truncate table \" ~ old_relation.render() %}\n {% endif %}\n\n {{ return(sql) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.create_csv_table"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "full_refresh", "type": null, "description": ""}, {"name": "old_relation", "type": null, "description": ""}, {"name": "agate_table", "type": null, "description": ""}], "created_at": 1789079002.3245916, "supported_languages": null}, "macro.dbt.get_csv_sql": {"name": "get_csv_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "unique_id": "macro.dbt.get_csv_sql", "macro_sql": "{% macro get_csv_sql(create_or_truncate_sql, insert_sql) %}\n {{ adapter.dispatch('get_csv_sql', 'dbt')(create_or_truncate_sql, insert_sql) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_csv_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "create_or_truncate_sql", "type": null, "description": ""}, {"name": "insert_sql", "type": null, "description": ""}], "created_at": 1789079002.3248084, "supported_languages": null}, "macro.dbt.default__get_csv_sql": {"name": "default__get_csv_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "unique_id": "macro.dbt.default__get_csv_sql", "macro_sql": "{% macro default__get_csv_sql(create_or_truncate_sql, insert_sql) %}\n {{ create_or_truncate_sql }};\n -- dbt seed --\n {{ insert_sql }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "create_or_truncate_sql", "type": null, "description": ""}, {"name": "insert_sql", "type": null, "description": ""}], "created_at": 1789079002.3249767, "supported_languages": null}, "macro.dbt.get_binding_char": {"name": "get_binding_char", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "unique_id": "macro.dbt.get_binding_char", "macro_sql": "{% macro get_binding_char() -%}\n {{ adapter.dispatch('get_binding_char', 'dbt')() }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_binding_char"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789079002.325138, "supported_languages": null}, "macro.dbt.default__get_binding_char": {"name": "default__get_binding_char", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "unique_id": "macro.dbt.default__get_binding_char", "macro_sql": "{% macro default__get_binding_char() %}\n {{ return('%s') }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789079002.3252742, "supported_languages": null}, "macro.dbt.get_batch_size": {"name": "get_batch_size", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "unique_id": "macro.dbt.get_batch_size", "macro_sql": "{% macro get_batch_size() -%}\n {{ return(adapter.dispatch('get_batch_size', 'dbt')()) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_batch_size"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789079002.3254507, "supported_languages": null}, "macro.dbt.default__get_batch_size": {"name": "default__get_batch_size", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "unique_id": "macro.dbt.default__get_batch_size", "macro_sql": "{% macro default__get_batch_size() %}\n {{ return(10000) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789079002.3255858, "supported_languages": null}, "macro.dbt.get_seed_column_quoted_csv": {"name": "get_seed_column_quoted_csv", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "unique_id": "macro.dbt.get_seed_column_quoted_csv", "macro_sql": "{% macro get_seed_column_quoted_csv(model, column_names) %}\n {%- set quote_seed_column = model['config'].get('quote_columns', None) -%}\n {% set quoted = [] %}\n {% for col in column_names -%}\n {%- do quoted.append(adapter.quote_seed_column(col, quote_seed_column)) -%}\n {%- endfor %}\n\n {%- set dest_cols_csv = quoted | join(', ') -%}\n {{ return(dest_cols_csv) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "column_names", "type": null, "description": ""}], "created_at": 1789079002.3261583, "supported_languages": null}, "macro.dbt.load_csv_rows": {"name": "load_csv_rows", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "unique_id": "macro.dbt.load_csv_rows", "macro_sql": "{% macro load_csv_rows(model, agate_table) -%}\n {{ adapter.dispatch('load_csv_rows', 'dbt')(model, agate_table) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__load_csv_rows"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "agate_table", "type": null, "description": ""}], "created_at": 1789079002.3263714, "supported_languages": null}, "macro.dbt.default__load_csv_rows": {"name": "default__load_csv_rows", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "unique_id": "macro.dbt.default__load_csv_rows", "macro_sql": "{% macro default__load_csv_rows(model, agate_table) %}\n\n {% set batch_size = get_batch_size() %}\n\n {% set cols_sql = get_seed_column_quoted_csv(model, agate_table.column_names) %}\n {% set bindings = [] %}\n\n {% set statements = [] %}\n\n {% for chunk in agate_table.rows | batch(batch_size) %}\n {% set bindings = [] %}\n\n {% for row in chunk %}\n {% do bindings.extend(row) %}\n {% endfor %}\n\n {% set sql %}\n insert into {{ this.render() }} ({{ cols_sql }}) values\n {% for row in chunk -%}\n ({%- for column in agate_table.column_names -%}\n {{ get_binding_char() }}\n {%- if not loop.last%},{%- endif %}\n {%- endfor -%})\n {%- if not loop.last%},{%- endif %}\n {%- endfor %}\n {% endset %}\n\n {% do adapter.add_query(sql, bindings=bindings, abridge_sql_log=True) %}\n\n {% if loop.index0 == 0 %}\n {% do statements.append(sql) %}\n {% endif %}\n {% endfor %}\n\n {# Return SQL so we can render it out into the compiled files #}\n {{ return(statements[0]) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_batch_size", "macro.dbt.get_seed_column_quoted_csv", "macro.dbt.get_binding_char"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "agate_table", "type": null, "description": ""}], "created_at": 1789079002.32779, "supported_languages": null}, "macro.dbt.materialization_unit_default": {"name": "materialization_unit_default", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/tests/unit.sql", "original_file_path": "macros/materializations/tests/unit.sql", "unique_id": "macro.dbt.materialization_unit_default", "macro_sql": "{%- materialization unit, default -%}\n\n {% set relations = [] %}\n {% set sql_header = config.get('sql_header') if flags.REQUIRE_SQL_HEADER_IN_TEST_CONFIGS else none %}\n\n {% set expected_rows = config.get('expected_rows') %}\n {% set expected_sql = config.get('expected_sql') %}\n {% set tested_expected_column_names = expected_rows[0].keys() if (expected_rows | length ) > 0 else get_columns_in_query(sql) %}\n\n {%- set target_relation = this.incorporate(type='table') -%}\n {%- set temp_relation = make_temp_relation(target_relation)-%}\n {% do run_query(get_create_table_as_sql(True, temp_relation, get_empty_subquery_sql(sql))) %}\n {%- set columns_in_relation = adapter.get_columns_in_relation(temp_relation) -%}\n {%- set column_name_to_data_types = {} -%}\n {%- set column_name_to_quoted = {} -%}\n {%- for column in columns_in_relation -%}\n {%- do column_name_to_data_types.update({column.name|lower: column.data_type}) -%}\n {%- do column_name_to_quoted.update({column.name|lower: column.quoted}) -%}\n {%- endfor -%}\n\n {%- set expected_column_names_quoted = [] -%}\n {%- for column_name in tested_expected_column_names -%}\n {%- do expected_column_names_quoted.append(column_name_to_quoted[column_name|lower]) -%}\n {%- endfor -%}\n\n {% if not expected_sql %}\n {% set expected_sql = get_expected_sql(expected_rows, column_name_to_data_types, column_name_to_quoted) %}\n {% endif %}\n {% set unit_test_sql = get_unit_test_sql(sql, expected_sql, expected_column_names_quoted) %}\n\n {% call statement('main', fetch_result=True) -%}\n\n {% if sql_header %}{{ sql_header }}{% endif %}\n {{ unit_test_sql }}\n\n {%- endcall %}\n\n {% do adapter.drop_relation(temp_relation) %}\n\n {{ return({'relations': relations}) }}\n\n{%- endmaterialization -%}", "depends_on": {"macros": ["macro.dbt.get_columns_in_query", "macro.dbt.make_temp_relation", "macro.dbt.run_query", "macro.dbt.get_create_table_as_sql", "macro.dbt.get_empty_subquery_sql", "macro.dbt.get_expected_sql", "macro.dbt.get_unit_test_sql", "macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "supported_languages", "type": null, "description": ""}], "created_at": 1789079002.3301504, "supported_languages": ["sql"]}, "macro.dbt.materialization_test_default": {"name": "materialization_test_default", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/tests/test.sql", "original_file_path": "macros/materializations/tests/test.sql", "unique_id": "macro.dbt.materialization_test_default", "macro_sql": "{%- materialization test, default -%}\n\n {% set relations = [] %}\n {% set limit = config.get('limit') %}\n {% set sql_header = config.get('sql_header') if flags.REQUIRE_SQL_HEADER_IN_TEST_CONFIGS else none %}\n\n {% set sql_with_limit %}\n {{ get_limit_subquery_sql(sql, limit) }}\n {% endset %}\n\n {% if should_store_failures() %}\n\n {% set identifier = model['alias'] %}\n {% set old_relation = adapter.get_relation(database=database, schema=schema, identifier=identifier) %}\n\n {% set store_failures_as = config.get('store_failures_as') %}\n -- if `--store-failures` is invoked via command line and `store_failures_as` is not set,\n -- config.get('store_failures_as', 'table') returns None, not 'table'\n {% if store_failures_as == none %}{% set store_failures_as = 'table' %}{% endif %}\n {% if store_failures_as not in ['table', 'view'] %}\n {{ exceptions.raise_compiler_error(\n \"'\" ~ store_failures_as ~ \"' is not a valid value for `store_failures_as`. \"\n \"Accepted values are: ['ephemeral', 'table', 'view']\"\n ) }}\n {% endif %}\n\n {% set target_relation = api.Relation.create(\n identifier=identifier, schema=schema, database=database, type=store_failures_as) -%} %}\n\n {% if old_relation %}\n {% do adapter.drop_relation(old_relation) %}\n {% endif %}\n\n {% call statement(auto_begin=True) %}\n {% if sql_header %}{{ sql_header }}{% endif %}\n {{ get_create_sql(target_relation, sql_with_limit) }}\n {% endcall %}\n\n {% do relations.append(target_relation) %}\n\n {# Since the test failures have already been saved to the database, reuse that result rather than querying again #}\n {% set main_sql %}\n select *\n from {{ target_relation }}\n {% endset %}\n\n {{ adapter.commit() }}\n\n {% else %}\n\n {% set main_sql = sql_with_limit %}\n\n {% endif %}\n\n {% set fail_calc = config.get('fail_calc') %}\n {% set warn_if = config.get('warn_if') %}\n {% set error_if = config.get('error_if') %}\n\n {% call statement('main', fetch_result=True) -%}\n\n {% if sql_header %}{{ sql_header }}{% endif %}\n {# The limit has already been included above, and we do not want to duplicate it again. We also want to be safe for macro overrides treating `limit` as a required parameter. #}\n {{ get_test_sql(main_sql, fail_calc, warn_if, error_if, limit=none)}}\n\n {%- endcall %}\n\n {{ return({'relations': relations}) }}\n\n{%- endmaterialization -%}", "depends_on": {"macros": ["macro.dbt.get_limit_subquery_sql", "macro.dbt.should_store_failures", "macro.dbt.statement", "macro.dbt.get_create_sql", "macro.dbt.get_test_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "supported_languages", "type": null, "description": ""}], "created_at": 1789079002.3330054, "supported_languages": ["sql"]}, "macro.dbt.get_test_sql": {"name": "get_test_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/tests/helpers.sql", "original_file_path": "macros/materializations/tests/helpers.sql", "unique_id": "macro.dbt.get_test_sql", "macro_sql": "{% macro get_test_sql(main_sql, fail_calc, warn_if, error_if, limit) -%}\n {{ adapter.dispatch('get_test_sql', 'dbt')(main_sql, fail_calc, warn_if, error_if, limit) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_test_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "main_sql", "type": null, "description": ""}, {"name": "fail_calc", "type": null, "description": ""}, {"name": "warn_if", "type": null, "description": ""}, {"name": "error_if", "type": null, "description": ""}, {"name": "limit", "type": null, "description": ""}], "created_at": 1789079002.33362, "supported_languages": null}, "macro.dbt.default__get_test_sql": {"name": "default__get_test_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/tests/helpers.sql", "original_file_path": "macros/materializations/tests/helpers.sql", "unique_id": "macro.dbt.default__get_test_sql", "macro_sql": "{% macro default__get_test_sql(main_sql, fail_calc, warn_if, error_if, limit) -%}\n select\n {{ fail_calc }} as failures,\n {{ fail_calc }} {{ warn_if }} as should_warn,\n {{ fail_calc }} {{ error_if }} as should_error\n from (\n {{ main_sql }}\n {{ \"limit \" ~ limit if limit != none }}\n ) dbt_internal_test\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "main_sql", "type": null, "description": ""}, {"name": "fail_calc", "type": null, "description": ""}, {"name": "warn_if", "type": null, "description": ""}, {"name": "error_if", "type": null, "description": ""}, {"name": "limit", "type": null, "description": ""}], "created_at": 1789079002.3339863, "supported_languages": null}, "macro.dbt.get_unit_test_sql": {"name": "get_unit_test_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/tests/helpers.sql", "original_file_path": "macros/materializations/tests/helpers.sql", "unique_id": "macro.dbt.get_unit_test_sql", "macro_sql": "{% macro get_unit_test_sql(main_sql, expected_fixture_sql, expected_column_names) -%}\n {{ adapter.dispatch('get_unit_test_sql', 'dbt')(main_sql, expected_fixture_sql, expected_column_names) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_unit_test_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "main_sql", "type": null, "description": ""}, {"name": "expected_fixture_sql", "type": null, "description": ""}, {"name": "expected_column_names", "type": null, "description": ""}], "created_at": 1789079002.3342268, "supported_languages": null}, "macro.dbt.default__get_unit_test_sql": {"name": "default__get_unit_test_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/tests/helpers.sql", "original_file_path": "macros/materializations/tests/helpers.sql", "unique_id": "macro.dbt.default__get_unit_test_sql", "macro_sql": "{% macro default__get_unit_test_sql(main_sql, expected_fixture_sql, expected_column_names) -%}\n-- Build actual result given inputs\nwith dbt_internal_unit_test_actual as (\n select\n {% for expected_column_name in expected_column_names %}{{expected_column_name}}{% if not loop.last -%},{% endif %}{%- endfor -%}, {{ dbt.string_literal(\"actual\") }} as {{ adapter.quote(\"actual_or_expected\") }}\n from (\n {{ main_sql }}\n ) _dbt_internal_unit_test_actual\n),\n-- Build expected result\ndbt_internal_unit_test_expected as (\n select\n {% for expected_column_name in expected_column_names %}{{expected_column_name}}{% if not loop.last -%}, {% endif %}{%- endfor -%}, {{ dbt.string_literal(\"expected\") }} as {{ adapter.quote(\"actual_or_expected\") }}\n from (\n {{ expected_fixture_sql }}\n ) _dbt_internal_unit_test_expected\n)\n-- Union actual and expected results\nselect * from dbt_internal_unit_test_actual\nunion all\nselect * from dbt_internal_unit_test_expected\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.string_literal"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "main_sql", "type": null, "description": ""}, {"name": "expected_fixture_sql", "type": null, "description": ""}, {"name": "expected_column_names", "type": null, "description": ""}], "created_at": 1789079002.3349123, "supported_languages": null}, "macro.dbt.get_where_subquery": {"name": "get_where_subquery", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/tests/where_subquery.sql", "original_file_path": "macros/materializations/tests/where_subquery.sql", "unique_id": "macro.dbt.get_where_subquery", "macro_sql": "{% macro get_where_subquery(relation) -%}\n {% do return(adapter.dispatch('get_where_subquery', 'dbt')(relation)) %}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_where_subquery"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789079002.3352835, "supported_languages": null}, "macro.dbt.default__get_where_subquery": {"name": "default__get_where_subquery", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/tests/where_subquery.sql", "original_file_path": "macros/materializations/tests/where_subquery.sql", "unique_id": "macro.dbt.default__get_where_subquery", "macro_sql": "{% macro default__get_where_subquery(relation) -%}\n {% set where = config.get('where', '') %}\n {% if where %}\n {%- set filtered -%}\n (select * from {{ relation }} where {{ where }}) dbt_subquery\n {%- endset -%}\n {% do return(filtered) %}\n {%- else -%}\n {% do return(relation) %}\n {%- endif -%}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789079002.3357115, "supported_languages": null}, "macro.dbt.materialization_snapshot_default": {"name": "materialization_snapshot_default", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/snapshot.sql", "original_file_path": "macros/materializations/snapshots/snapshot.sql", "unique_id": "macro.dbt.materialization_snapshot_default", "macro_sql": "{% materialization snapshot, default %}\n\n {%- set target_table = model.get('alias', model.get('name')) -%}\n\n {%- set strategy_name = config.get('strategy') -%}\n {%- set unique_key = config.get('unique_key') %}\n -- grab current tables grants config for comparision later on\n {%- set grant_config = config.get('grants') -%}\n\n {% set target_relation_exists, target_relation = get_or_create_relation(\n database=model.database,\n schema=model.schema,\n identifier=target_table,\n type='table') -%}\n\n {%- if not target_relation.is_table -%}\n {% do exceptions.relation_wrong_type(target_relation, 'table') %}\n {%- endif -%}\n\n\n {{ run_hooks(pre_hooks, inside_transaction=False) }}\n\n {{ run_hooks(pre_hooks, inside_transaction=True) }}\n\n {% set strategy_macro = strategy_dispatch(strategy_name) %}\n {# The model['config'] parameter below is no longer used, but passing anyway for compatibility #}\n {# It was a dictionary of config, instead of the config object from the context #}\n {% set strategy = strategy_macro(model, \"snapshotted_data\", \"source_data\", model['config'], target_relation_exists) %}\n\n {% if not target_relation_exists %}\n\n {% set build_sql = build_snapshot_table(strategy, model['compiled_code']) %}\n {% set build_or_select_sql = build_sql %}\n {% set final_sql = create_table_as(False, target_relation, build_sql) %}\n\n {% else %}\n\n {% set columns = config.get(\"snapshot_table_column_names\") or get_snapshot_table_column_names() %}\n\n {{ adapter.assert_valid_snapshot_target_given_strategy(target_relation, columns, strategy) }}\n\n {% set build_or_select_sql = snapshot_staging_table(strategy, sql, target_relation) %}\n {% set staging_table = build_snapshot_staging_table(strategy, sql, target_relation) %}\n\n -- this may no-op if the database does not require column expansion\n {% do adapter.expand_target_column_types(from_relation=staging_table,\n to_relation=target_relation) %}\n\n {% set remove_columns = ['dbt_change_type', 'DBT_CHANGE_TYPE', 'dbt_unique_key', 'DBT_UNIQUE_KEY'] %}\n {% if unique_key | is_list %}\n {% for key in strategy.unique_key %}\n {{ remove_columns.append('dbt_unique_key_' + loop.index|string) }}\n {{ remove_columns.append('DBT_UNIQUE_KEY_' + loop.index|string) }}\n {% endfor %}\n {% endif %}\n\n {% set missing_columns = adapter.get_missing_columns(staging_table, target_relation)\n | rejectattr('name', 'in', remove_columns)\n | list %}\n\n {% do create_columns(target_relation, missing_columns) %}\n\n {% set source_columns = adapter.get_columns_in_relation(staging_table)\n | rejectattr('name', 'in', remove_columns)\n | list %}\n\n {% set quoted_source_columns = [] %}\n {% for column in source_columns %}\n {% do quoted_source_columns.append(adapter.quote(column.name)) %}\n {% endfor %}\n\n {% set final_sql = snapshot_merge_sql(\n target = target_relation,\n source = staging_table,\n insert_cols = quoted_source_columns\n )\n %}\n\n {% endif %}\n\n\n {{ check_time_data_types(build_or_select_sql) }}\n\n {% call statement('main') %}\n {{ final_sql }}\n {% endcall %}\n\n {% set should_revoke = should_revoke(target_relation_exists, full_refresh_mode=False) %}\n {% do apply_grants(target_relation, grant_config, should_revoke=should_revoke) %}\n\n {% do persist_docs(target_relation, model) %}\n\n {% if not target_relation_exists %}\n {% do create_indexes(target_relation) %}\n {% endif %}\n\n {{ run_hooks(post_hooks, inside_transaction=True) }}\n\n {{ adapter.commit() }}\n\n {% if staging_table is defined %}\n {% do post_snapshot(staging_table) %}\n {% endif %}\n\n {{ run_hooks(post_hooks, inside_transaction=False) }}\n\n {{ return({'relations': [target_relation]}) }}\n\n{% endmaterialization %}", "depends_on": {"macros": ["macro.dbt.get_or_create_relation", "macro.dbt.run_hooks", "macro.dbt.strategy_dispatch", "macro.dbt.build_snapshot_table", "macro.dbt.create_table_as", "macro.dbt.get_snapshot_table_column_names", "macro.dbt.snapshot_staging_table", "macro.dbt.build_snapshot_staging_table", "macro.dbt.create_columns", "macro.dbt.snapshot_merge_sql", "macro.dbt.check_time_data_types", "macro.dbt.statement", "macro.dbt.should_revoke", "macro.dbt.apply_grants", "macro.dbt.persist_docs", "macro.dbt.create_indexes", "macro.dbt.post_snapshot"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "supported_languages", "type": null, "description": ""}], "created_at": 1789079002.3400931, "supported_languages": ["sql"]}, "macro.dbt.strategy_dispatch": {"name": "strategy_dispatch", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/strategies.sql", "original_file_path": "macros/materializations/snapshots/strategies.sql", "unique_id": "macro.dbt.strategy_dispatch", "macro_sql": "{% macro strategy_dispatch(name) -%}\n{% set original_name = name %}\n {% if '.' in name %}\n {% set package_name, name = name.split(\".\", 1) %}\n {% else %}\n {% set package_name = none %}\n {% endif %}\n\n {% if package_name is none %}\n {% set package_context = context %}\n {% elif package_name in context %}\n {% set package_context = context[package_name] %}\n {% else %}\n {% set error_msg %}\n Could not find package '{{package_name}}', called with '{{original_name}}'\n {% endset %}\n {{ exceptions.raise_compiler_error(error_msg | trim) }}\n {% endif %}\n\n {%- set search_name = 'snapshot_' ~ name ~ '_strategy' -%}\n\n {% if search_name not in package_context %}\n {% set error_msg %}\n The specified strategy macro '{{name}}' was not found in package '{{ package_name }}'\n {% endset %}\n {{ exceptions.raise_compiler_error(error_msg | trim) }}\n {% endif %}\n {{ return(package_context[search_name]) }}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "name", "type": null, "description": ""}], "created_at": 1789079002.3424258, "supported_languages": null}, "macro.dbt.snapshot_hash_arguments": {"name": "snapshot_hash_arguments", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/strategies.sql", "original_file_path": "macros/materializations/snapshots/strategies.sql", "unique_id": "macro.dbt.snapshot_hash_arguments", "macro_sql": "{% macro snapshot_hash_arguments(args) -%}\n {{ adapter.dispatch('snapshot_hash_arguments', 'dbt')(args) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__snapshot_hash_arguments"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "args", "type": null, "description": ""}], "created_at": 1789079002.3426273, "supported_languages": null}, "macro.dbt.default__snapshot_hash_arguments": {"name": "default__snapshot_hash_arguments", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/strategies.sql", "original_file_path": "macros/materializations/snapshots/strategies.sql", "unique_id": "macro.dbt.default__snapshot_hash_arguments", "macro_sql": "{% macro default__snapshot_hash_arguments(args) -%}\n md5({%- for arg in args -%}\n coalesce(cast({{ arg }} as varchar ), '')\n {% if not loop.last %} || '|' || {% endif %}\n {%- endfor -%})\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "args", "type": null, "description": ""}], "created_at": 1789079002.3428915, "supported_languages": null}, "macro.dbt.snapshot_timestamp_strategy": {"name": "snapshot_timestamp_strategy", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/strategies.sql", "original_file_path": "macros/materializations/snapshots/strategies.sql", "unique_id": "macro.dbt.snapshot_timestamp_strategy", "macro_sql": "{% macro snapshot_timestamp_strategy(node, snapshotted_rel, current_rel, model_config, target_exists) %}\n {# The model_config parameter is no longer used, but is passed in anyway for compatibility. #}\n {% set primary_key = config.get('unique_key') %}\n {% set updated_at = config.get('updated_at') %}\n {% set hard_deletes = adapter.get_hard_deletes_behavior(config) %}\n {% set invalidate_hard_deletes = hard_deletes == 'invalidate' %}\n {% set columns = config.get(\"snapshot_table_column_names\") or get_snapshot_table_column_names() %}\n\n {#/*\n The snapshot relation might not have an {{ updated_at }} value if the\n snapshot strategy is changed from `check` to `timestamp`. We\n should use a dbt-created column for the comparison in the snapshot\n table instead of assuming that the user-supplied {{ updated_at }}\n will be present in the historical data.\n\n See https://github.com/dbt-labs/dbt-core/issues/2350\n */ #}\n {% set row_changed_expr -%}\n ({{ snapshotted_rel }}.{{ columns.dbt_valid_from }} < {{ current_rel }}.{{ updated_at }})\n {%- endset %}\n\n {% set scd_args = api.Relation.scd_args(primary_key, updated_at) %}\n {% set scd_id_expr = snapshot_hash_arguments(scd_args) %}\n\n {% do return({\n \"unique_key\": primary_key,\n \"updated_at\": updated_at,\n \"row_changed\": row_changed_expr,\n \"scd_id\": scd_id_expr,\n \"invalidate_hard_deletes\": invalidate_hard_deletes,\n \"hard_deletes\": hard_deletes\n }) %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_snapshot_table_column_names", "macro.dbt.snapshot_hash_arguments"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "node", "type": null, "description": ""}, {"name": "snapshotted_rel", "type": null, "description": ""}, {"name": "current_rel", "type": null, "description": ""}, {"name": "model_config", "type": null, "description": ""}, {"name": "target_exists", "type": null, "description": ""}], "created_at": 1789079002.3439653, "supported_languages": null}, "macro.dbt.snapshot_string_as_time": {"name": "snapshot_string_as_time", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/strategies.sql", "original_file_path": "macros/materializations/snapshots/strategies.sql", "unique_id": "macro.dbt.snapshot_string_as_time", "macro_sql": "{% macro snapshot_string_as_time(timestamp) -%}\n {{ adapter.dispatch('snapshot_string_as_time', 'dbt')(timestamp) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__snapshot_string_as_time"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "timestamp", "type": null, "description": ""}], "created_at": 1789079002.344164, "supported_languages": null}, "macro.dbt.default__snapshot_string_as_time": {"name": "default__snapshot_string_as_time", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/strategies.sql", "original_file_path": "macros/materializations/snapshots/strategies.sql", "unique_id": "macro.dbt.default__snapshot_string_as_time", "macro_sql": "{% macro default__snapshot_string_as_time(timestamp) %}\n {% do exceptions.raise_not_implemented(\n 'snapshot_string_as_time macro not implemented for adapter '+adapter.type()\n ) %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "timestamp", "type": null, "description": ""}], "created_at": 1789079002.3443594, "supported_languages": null}, "macro.dbt.snapshot_check_all_get_existing_columns": {"name": "snapshot_check_all_get_existing_columns", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/strategies.sql", "original_file_path": "macros/materializations/snapshots/strategies.sql", "unique_id": "macro.dbt.snapshot_check_all_get_existing_columns", "macro_sql": "{% macro snapshot_check_all_get_existing_columns(node, target_exists, check_cols_config) -%}\n {%- if not target_exists -%}\n {#-- no table yet -> return whatever the query does --#}\n {{ return((false, query_columns)) }}\n {%- endif -%}\n\n {#-- handle any schema changes --#}\n {%- set target_relation = adapter.get_relation(database=node.database, schema=node.schema, identifier=node.alias) -%}\n\n {% if check_cols_config == 'all' %}\n {%- set query_columns = get_columns_in_query(node['compiled_code']) -%}\n\n {% elif check_cols_config is iterable and (check_cols_config | length) > 0 %}\n {#-- query for proper casing/quoting, to support comparison below --#}\n {%- set select_check_cols_from_target -%}\n {#-- N.B. The whitespace below is necessary to avoid edge case issue with comments --#}\n {#-- See: https://github.com/dbt-labs/dbt-core/issues/6781 --#}\n select {{ check_cols_config | join(', ') }} from (\n {{ node['compiled_code'] }}\n ) subq\n {%- endset -%}\n {% set query_columns = get_columns_in_query(select_check_cols_from_target) %}\n\n {% else %}\n {% do exceptions.raise_compiler_error(\"Invalid value for 'check_cols': \" ~ check_cols_config) %}\n {% endif %}\n\n {%- set existing_cols = adapter.get_columns_in_relation(target_relation) | map(attribute = 'name') | list -%}\n {%- set ns = namespace() -%} {#-- handle for-loop scoping with a namespace --#}\n {%- set ns.column_added = false -%}\n\n {%- set intersection = [] -%}\n {%- for col in query_columns -%}\n {%- if col in existing_cols -%}\n {%- do intersection.append(adapter.quote(col)) -%}\n {%- else -%}\n {% set ns.column_added = true %}\n {%- endif -%}\n {%- endfor -%}\n {{ return((ns.column_added, intersection)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.get_columns_in_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "node", "type": null, "description": ""}, {"name": "target_exists", "type": null, "description": ""}, {"name": "check_cols_config", "type": null, "description": ""}], "created_at": 1789079002.3459015, "supported_languages": null}, "macro.dbt.snapshot_check_strategy": {"name": "snapshot_check_strategy", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/strategies.sql", "original_file_path": "macros/materializations/snapshots/strategies.sql", "unique_id": "macro.dbt.snapshot_check_strategy", "macro_sql": "{% macro snapshot_check_strategy(node, snapshotted_rel, current_rel, model_config, target_exists) %}\n {# The model_config parameter is no longer used, but is passed in anyway for compatibility. #}\n {% set check_cols_config = config.get('check_cols') %}\n {% set primary_key = config.get('unique_key') %}\n {% set hard_deletes = adapter.get_hard_deletes_behavior(config) %}\n {% set invalidate_hard_deletes = hard_deletes == 'invalidate' %}\n {% set updated_at = config.get('updated_at') or snapshot_get_time() %}\n\n {% set column_added = false %}\n\n {% set column_added, check_cols = snapshot_check_all_get_existing_columns(node, target_exists, check_cols_config) %}\n\n {%- set row_changed_expr -%}\n (\n {%- if column_added -%}\n {{ get_true_sql() }}\n {%- else -%}\n {%- for col in check_cols -%}\n {{ snapshotted_rel }}.{{ col }} != {{ current_rel }}.{{ col }}\n or\n (\n (({{ snapshotted_rel }}.{{ col }} is null) and not ({{ current_rel }}.{{ col }} is null))\n or\n ((not {{ snapshotted_rel }}.{{ col }} is null) and ({{ current_rel }}.{{ col }} is null))\n )\n {%- if not loop.last %} or {% endif -%}\n {%- endfor -%}\n {%- endif -%}\n )\n {%- endset %}\n\n {% set scd_args = api.Relation.scd_args(primary_key, updated_at) %}\n {% set scd_id_expr = snapshot_hash_arguments(scd_args) %}\n\n {% do return({\n \"unique_key\": primary_key,\n \"updated_at\": updated_at,\n \"row_changed\": row_changed_expr,\n \"scd_id\": scd_id_expr,\n \"invalidate_hard_deletes\": invalidate_hard_deletes,\n \"hard_deletes\": hard_deletes\n }) %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.snapshot_get_time", "macro.dbt.snapshot_check_all_get_existing_columns", "macro.dbt.get_true_sql", "macro.dbt.snapshot_hash_arguments"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "node", "type": null, "description": ""}, {"name": "snapshotted_rel", "type": null, "description": ""}, {"name": "current_rel", "type": null, "description": ""}, {"name": "model_config", "type": null, "description": ""}, {"name": "target_exists", "type": null, "description": ""}], "created_at": 1789079002.3475437, "supported_languages": null}, "macro.dbt.snapshot_merge_sql": {"name": "snapshot_merge_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/snapshot_merge.sql", "original_file_path": "macros/materializations/snapshots/snapshot_merge.sql", "unique_id": "macro.dbt.snapshot_merge_sql", "macro_sql": "{% macro snapshot_merge_sql(target, source, insert_cols) -%}\n {{ adapter.dispatch('snapshot_merge_sql', 'dbt')(target, source, insert_cols) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__snapshot_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "target", "type": null, "description": ""}, {"name": "source", "type": null, "description": ""}, {"name": "insert_cols", "type": null, "description": ""}], "created_at": 1789079002.348046, "supported_languages": null}, "macro.dbt.default__snapshot_merge_sql": {"name": "default__snapshot_merge_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/snapshot_merge.sql", "original_file_path": "macros/materializations/snapshots/snapshot_merge.sql", "unique_id": "macro.dbt.default__snapshot_merge_sql", "macro_sql": "{% macro default__snapshot_merge_sql(target, source, insert_cols) -%}\n {%- set insert_cols_csv = insert_cols | join(', ') -%}\n\n {%- set columns = config.get(\"snapshot_table_column_names\") or get_snapshot_table_column_names() -%}\n\n merge into {{ target.render() }} as DBT_INTERNAL_DEST\n using {{ source }} as DBT_INTERNAL_SOURCE\n on DBT_INTERNAL_SOURCE.{{ columns.dbt_scd_id }} = DBT_INTERNAL_DEST.{{ columns.dbt_scd_id }}\n\n when matched\n {% if config.get(\"dbt_valid_to_current\") %}\n\t{% set source_unique_key = (\"DBT_INTERNAL_DEST.\" ~ columns.dbt_valid_to) | trim %}\n\t{% set target_unique_key = config.get('dbt_valid_to_current') | trim %}\n\tand ({{ equals(source_unique_key, target_unique_key) }} or {{ source_unique_key }} is null)\n\n {% else %}\n and DBT_INTERNAL_DEST.{{ columns.dbt_valid_to }} is null\n {% endif %}\n and DBT_INTERNAL_SOURCE.dbt_change_type in ('update', 'delete')\n then update\n set {{ columns.dbt_valid_to }} = DBT_INTERNAL_SOURCE.{{ columns.dbt_valid_to }}\n\n when not matched\n and DBT_INTERNAL_SOURCE.dbt_change_type = 'insert'\n then insert ({{ insert_cols_csv }})\n values ({{ insert_cols_csv }})\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_snapshot_table_column_names", "macro.dbt.equals"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "target", "type": null, "description": ""}, {"name": "source", "type": null, "description": ""}, {"name": "insert_cols", "type": null, "description": ""}], "created_at": 1789079002.348955, "supported_languages": null}, "macro.dbt.create_columns": {"name": "create_columns", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "unique_id": "macro.dbt.create_columns", "macro_sql": "{% macro create_columns(relation, columns) %}\n {{ adapter.dispatch('create_columns', 'dbt')(relation, columns) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__create_columns"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "columns", "type": null, "description": ""}], "created_at": 1789079002.3512747, "supported_languages": null}, "macro.dbt.default__create_columns": {"name": "default__create_columns", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "unique_id": "macro.dbt.default__create_columns", "macro_sql": "{% macro default__create_columns(relation, columns) %}\n {% for column in columns %}\n {% call statement() %}\n alter table {{ relation.render() }} add column {{ adapter.quote(column.name) }} {{ column.expanded_data_type }};\n {% endcall %}\n {% endfor %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "columns", "type": null, "description": ""}], "created_at": 1789079002.3516555, "supported_languages": null}, "macro.dbt.post_snapshot": {"name": "post_snapshot", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "unique_id": "macro.dbt.post_snapshot", "macro_sql": "{% macro post_snapshot(staging_relation) %}\n {{ adapter.dispatch('post_snapshot', 'dbt')(staging_relation) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__post_snapshot"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "staging_relation", "type": null, "description": ""}], "created_at": 1789079002.3518636, "supported_languages": null}, "macro.dbt.default__post_snapshot": {"name": "default__post_snapshot", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "unique_id": "macro.dbt.default__post_snapshot", "macro_sql": "{% macro default__post_snapshot(staging_relation) %}\n {# no-op #}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "staging_relation", "type": null, "description": ""}], "created_at": 1789079002.3519778, "supported_languages": null}, "macro.dbt.get_true_sql": {"name": "get_true_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "unique_id": "macro.dbt.get_true_sql", "macro_sql": "{% macro get_true_sql() %}\n {{ adapter.dispatch('get_true_sql', 'dbt')() }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_true_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789079002.3521442, "supported_languages": null}, "macro.dbt.default__get_true_sql": {"name": "default__get_true_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "unique_id": "macro.dbt.default__get_true_sql", "macro_sql": "{% macro default__get_true_sql() %}\n {{ return('TRUE') }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789079002.3522823, "supported_languages": null}, "macro.dbt.snapshot_staging_table": {"name": "snapshot_staging_table", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "unique_id": "macro.dbt.snapshot_staging_table", "macro_sql": "{% macro snapshot_staging_table(strategy, source_sql, target_relation) -%}\n {{ adapter.dispatch('snapshot_staging_table', 'dbt')(strategy, source_sql, target_relation) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__snapshot_staging_table"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "strategy", "type": null, "description": ""}, {"name": "source_sql", "type": null, "description": ""}, {"name": "target_relation", "type": null, "description": ""}], "created_at": 1789079002.3525074, "supported_languages": null}, "macro.dbt.get_snapshot_table_column_names": {"name": "get_snapshot_table_column_names", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "unique_id": "macro.dbt.get_snapshot_table_column_names", "macro_sql": "{% macro get_snapshot_table_column_names() %}\n {{ return({'dbt_valid_to': 'dbt_valid_to', 'dbt_valid_from': 'dbt_valid_from', 'dbt_scd_id': 'dbt_scd_id', 'dbt_updated_at': 'dbt_updated_at', 'dbt_is_deleted': 'dbt_is_deleted'}) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789079002.3527787, "supported_languages": null}, "macro.dbt.default__snapshot_staging_table": {"name": "default__snapshot_staging_table", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "unique_id": "macro.dbt.default__snapshot_staging_table", "macro_sql": "{% macro default__snapshot_staging_table(strategy, source_sql, target_relation) -%}\n {% set columns = config.get('snapshot_table_column_names') or get_snapshot_table_column_names() %}\n {% if strategy.hard_deletes == 'new_record' %}\n {% set new_scd_id = snapshot_hash_arguments([columns.dbt_scd_id, snapshot_get_time()]) %}\n {% endif %}\n with snapshot_query as (\n\n {{ source_sql }}\n\n ),\n\n snapshotted_data as (\n\n select *, {{ unique_key_fields(strategy.unique_key) }}\n from {{ target_relation }}\n where\n {% if config.get('dbt_valid_to_current') %}\n\t\t{% set source_unique_key = columns.dbt_valid_to | trim %}\n\t\t{% set target_unique_key = config.get('dbt_valid_to_current') | trim %}\n\n\t\t{# The exact equals semantics between NULL values depends on the current behavior flag set. Also, update records if the source field is null #}\n ( {{ equals(source_unique_key, target_unique_key) }} or {{ source_unique_key }} is null )\n {% else %}\n {{ columns.dbt_valid_to }} is null\n {% endif %}\n\n ),\n\n insertions_source_data as (\n\n select *, {{ unique_key_fields(strategy.unique_key) }},\n {{ strategy.updated_at }} as {{ columns.dbt_updated_at }},\n {{ strategy.updated_at }} as {{ columns.dbt_valid_from }},\n {{ get_dbt_valid_to_current(strategy, columns) }},\n {{ strategy.scd_id }} as {{ columns.dbt_scd_id }}\n\n from snapshot_query\n ),\n\n updates_source_data as (\n\n select *, {{ unique_key_fields(strategy.unique_key) }},\n {{ strategy.updated_at }} as {{ columns.dbt_updated_at }},\n {{ strategy.updated_at }} as {{ columns.dbt_valid_from }},\n {{ strategy.updated_at }} as {{ columns.dbt_valid_to }}\n\n from snapshot_query\n ),\n\n {%- if strategy.hard_deletes == 'invalidate' or strategy.hard_deletes == 'new_record' %}\n\n deletes_source_data as (\n\n select *, {{ unique_key_fields(strategy.unique_key) }}\n from snapshot_query\n ),\n {% endif %}\n\n insertions as (\n\n select\n 'insert' as dbt_change_type,\n source_data.*\n {%- if strategy.hard_deletes == 'new_record' -%}\n ,'False' as {{ columns.dbt_is_deleted }}\n {%- endif %}\n\n from insertions_source_data as source_data\n left outer join snapshotted_data\n on {{ unique_key_join_on(strategy.unique_key, \"snapshotted_data\", \"source_data\") }}\n where {{ unique_key_is_null(strategy.unique_key, \"snapshotted_data\") }}\n or ({{ unique_key_is_not_null(strategy.unique_key, \"snapshotted_data\") }} and (\n {{ strategy.row_changed }} {%- if strategy.hard_deletes == 'new_record' -%} or snapshotted_data.{{ columns.dbt_is_deleted }} = 'True' {% endif %}\n )\n\n )\n\n ),\n\n updates as (\n\n select\n 'update' as dbt_change_type,\n source_data.*,\n snapshotted_data.{{ columns.dbt_scd_id }}\n {%- if strategy.hard_deletes == 'new_record' -%}\n , snapshotted_data.{{ columns.dbt_is_deleted }}\n {%- endif %}\n\n from updates_source_data as source_data\n join snapshotted_data\n on {{ unique_key_join_on(strategy.unique_key, \"snapshotted_data\", \"source_data\") }}\n where (\n {{ strategy.row_changed }} {%- if strategy.hard_deletes == 'new_record' -%} or snapshotted_data.{{ columns.dbt_is_deleted }} = 'True' {% endif %}\n )\n )\n\n {%- if strategy.hard_deletes == 'invalidate' or strategy.hard_deletes == 'new_record' %}\n ,\n deletes as (\n\n select\n 'delete' as dbt_change_type,\n source_data.*,\n {{ snapshot_get_time() }} as {{ columns.dbt_valid_from }},\n {{ snapshot_get_time() }} as {{ columns.dbt_updated_at }},\n {{ snapshot_get_time() }} as {{ columns.dbt_valid_to }},\n snapshotted_data.{{ columns.dbt_scd_id }}\n {%- if strategy.hard_deletes == 'new_record' -%}\n , snapshotted_data.{{ columns.dbt_is_deleted }}\n {%- endif %}\n from snapshotted_data\n left join deletes_source_data as source_data\n on {{ unique_key_join_on(strategy.unique_key, \"snapshotted_data\", \"source_data\") }}\n where {{ unique_key_is_null(strategy.unique_key, \"source_data\") }}\n\n {%- if strategy.hard_deletes == 'new_record' %}\n and not (\n --avoid updating the record's valid_to if the latest entry is marked as deleted\n snapshotted_data.{{ columns.dbt_is_deleted }} = 'True'\n and\n {% if config.get('dbt_valid_to_current') -%}\n snapshotted_data.{{ columns.dbt_valid_to }} = {{ config.get('dbt_valid_to_current') }}\n {%- else -%}\n snapshotted_data.{{ columns.dbt_valid_to }} is null\n {%- endif %}\n )\n {%- endif %}\n )\n {%- endif %}\n\n {%- if strategy.hard_deletes == 'new_record' %}\n {% set snapshotted_cols = get_list_of_column_names(get_columns_in_relation(target_relation)) %}\n {% set source_col_names = get_columns_in_query(source_sql) %}\n ,\n deletion_records as (\n\n select\n 'insert' as dbt_change_type,\n {%- for col_name in source_col_names -%}\n {%- if col_name in snapshotted_cols -%}\n snapshotted_data.{{ adapter.quote(col_name) }},\n {%- else -%}\n source_data.{{ adapter.quote(col_name) }},\n {%- endif -%}\n {% endfor -%}\n {%- if strategy.unique_key | is_list -%}\n {%- for key in strategy.unique_key -%}\n snapshotted_data.{{ key }} as dbt_unique_key_{{ loop.index }},\n {% endfor -%}\n {%- else -%}\n snapshotted_data.dbt_unique_key as dbt_unique_key,\n {% endif -%}\n {{ snapshot_get_time() }} as {{ columns.dbt_valid_from }},\n {{ snapshot_get_time() }} as {{ columns.dbt_updated_at }},\n snapshotted_data.{{ columns.dbt_valid_to }} as {{ columns.dbt_valid_to }},\n {{ new_scd_id }} as {{ columns.dbt_scd_id }},\n 'True' as {{ columns.dbt_is_deleted }}\n from snapshotted_data\n left join deletes_source_data as source_data\n on {{ unique_key_join_on(strategy.unique_key, \"snapshotted_data\", \"source_data\") }}\n where {{ unique_key_is_null(strategy.unique_key, \"source_data\") }}\n and not (\n --avoid inserting a new record if the latest one is marked as deleted\n snapshotted_data.{{ columns.dbt_is_deleted }} = 'True'\n and\n {% if config.get('dbt_valid_to_current') -%}\n snapshotted_data.{{ columns.dbt_valid_to }} = {{ config.get('dbt_valid_to_current') }}\n {%- else -%}\n snapshotted_data.{{ columns.dbt_valid_to }} is null\n {%- endif %}\n )\n\n )\n {%- endif %}\n\n select * from insertions\n union all\n select * from updates\n {%- if strategy.hard_deletes == 'invalidate' or strategy.hard_deletes == 'new_record' %}\n union all\n select * from deletes\n {%- endif %}\n {%- if strategy.hard_deletes == 'new_record' %}\n union all\n select * from deletion_records\n {%- endif %}\n\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.get_snapshot_table_column_names", "macro.dbt.snapshot_hash_arguments", "macro.dbt.snapshot_get_time", "macro.dbt.unique_key_fields", "macro.dbt.equals", "macro.dbt.get_dbt_valid_to_current", "macro.dbt.unique_key_join_on", "macro.dbt.unique_key_is_null", "macro.dbt.unique_key_is_not_null", "macro.dbt.get_list_of_column_names", "macro.dbt.get_columns_in_relation", "macro.dbt.get_columns_in_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "strategy", "type": null, "description": ""}, {"name": "source_sql", "type": null, "description": ""}, {"name": "target_relation", "type": null, "description": ""}], "created_at": 1789079002.3576024, "supported_languages": null}, "macro.dbt.build_snapshot_table": {"name": "build_snapshot_table", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "unique_id": "macro.dbt.build_snapshot_table", "macro_sql": "{% macro build_snapshot_table(strategy, sql) -%}\n {{ adapter.dispatch('build_snapshot_table', 'dbt')(strategy, sql) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__build_snapshot_table"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "strategy", "type": null, "description": ""}, {"name": "sql", "type": null, "description": ""}], "created_at": 1789079002.357863, "supported_languages": null}, "macro.dbt.default__build_snapshot_table": {"name": "default__build_snapshot_table", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "unique_id": "macro.dbt.default__build_snapshot_table", "macro_sql": "{% macro default__build_snapshot_table(strategy, sql) %}\n {% set columns = config.get('snapshot_table_column_names') or get_snapshot_table_column_names() %}\n\n select *,\n {{ strategy.scd_id }} as {{ columns.dbt_scd_id }},\n {{ strategy.updated_at }} as {{ columns.dbt_updated_at }},\n {{ strategy.updated_at }} as {{ columns.dbt_valid_from }},\n {{ get_dbt_valid_to_current(strategy, columns) }}\n {%- if strategy.hard_deletes == 'new_record' -%}\n , 'False' as {{ columns.dbt_is_deleted }}\n {% endif -%}\n from (\n {{ sql }}\n ) sbq\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_snapshot_table_column_names", "macro.dbt.get_dbt_valid_to_current"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "strategy", "type": null, "description": ""}, {"name": "sql", "type": null, "description": ""}], "created_at": 1789079002.3584268, "supported_languages": null}, "macro.dbt.build_snapshot_staging_table": {"name": "build_snapshot_staging_table", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "unique_id": "macro.dbt.build_snapshot_staging_table", "macro_sql": "{% macro build_snapshot_staging_table(strategy, sql, target_relation) %}\n {% set temp_relation = make_temp_relation(target_relation) %}\n\n {% set select = snapshot_staging_table(strategy, sql, target_relation) %}\n\n {% call statement('build_snapshot_staging_relation') %}\n {{ create_table_as(True, temp_relation, select) }}\n {% endcall %}\n\n {% do return(temp_relation) %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.make_temp_relation", "macro.dbt.snapshot_staging_table", "macro.dbt.statement", "macro.dbt.create_table_as"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "strategy", "type": null, "description": ""}, {"name": "sql", "type": null, "description": ""}, {"name": "target_relation", "type": null, "description": ""}], "created_at": 1789079002.358916, "supported_languages": null}, "macro.dbt.get_updated_at_column_data_type": {"name": "get_updated_at_column_data_type", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "unique_id": "macro.dbt.get_updated_at_column_data_type", "macro_sql": "{% macro get_updated_at_column_data_type(snapshot_sql) %}\n {% set snapshot_sql_column_schema = get_column_schema_from_query(snapshot_sql) %}\n {% set dbt_updated_at_data_type = null %}\n {% set ns = namespace() -%} {#-- handle for-loop scoping with a namespace --#}\n {% set ns.dbt_updated_at_data_type = null -%}\n {% for column in snapshot_sql_column_schema %}\n {% if ((column.column == 'dbt_updated_at') or (column.column == 'DBT_UPDATED_AT')) %}\n {% set ns.dbt_updated_at_data_type = column.dtype %}\n {% endif %}\n {% endfor %}\n {{ return(ns.dbt_updated_at_data_type or none) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_column_schema_from_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "snapshot_sql", "type": null, "description": ""}], "created_at": 1789079002.3595746, "supported_languages": null}, "macro.dbt.check_time_data_types": {"name": "check_time_data_types", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "unique_id": "macro.dbt.check_time_data_types", "macro_sql": "{% macro check_time_data_types(sql) %}\n {% set dbt_updated_at_data_type = get_updated_at_column_data_type(sql) %}\n {% set snapshot_get_time_data_type = get_snapshot_get_time_data_type() %}\n {% if snapshot_get_time_data_type is not none and dbt_updated_at_data_type is not none and snapshot_get_time_data_type != dbt_updated_at_data_type %}\n {% if exceptions.warn_snapshot_timestamp_data_types %}\n {{ exceptions.warn_snapshot_timestamp_data_types(snapshot_get_time_data_type, dbt_updated_at_data_type) }}\n {% endif %}\n {% endif %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_updated_at_column_data_type", "macro.dbt.get_snapshot_get_time_data_type"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "sql", "type": null, "description": ""}], "created_at": 1789079002.360061, "supported_languages": null}, "macro.dbt.get_dbt_valid_to_current": {"name": "get_dbt_valid_to_current", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "unique_id": "macro.dbt.get_dbt_valid_to_current", "macro_sql": "{% macro get_dbt_valid_to_current(strategy, columns) %}\n {% set dbt_valid_to_current = config.get('dbt_valid_to_current') or \"null\" %}\n coalesce(nullif({{ strategy.updated_at }}, {{ strategy.updated_at }}), {{dbt_valid_to_current}})\n as {{ columns.dbt_valid_to }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "strategy", "type": null, "description": ""}, {"name": "columns", "type": null, "description": ""}], "created_at": 1789079002.3603709, "supported_languages": null}, "macro.dbt.unique_key_fields": {"name": "unique_key_fields", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "unique_id": "macro.dbt.unique_key_fields", "macro_sql": "{% macro unique_key_fields(unique_key) %}\n {% if unique_key | is_list %}\n {% for key in unique_key %}\n {{ key }} as dbt_unique_key_{{ loop.index }}\n {%- if not loop.last %} , {%- endif %}\n {% endfor %}\n {% else %}\n {{ unique_key }} as dbt_unique_key\n {% endif %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "unique_key", "type": null, "description": ""}], "created_at": 1789079002.3607528, "supported_languages": null}, "macro.dbt.unique_key_join_on": {"name": "unique_key_join_on", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "unique_id": "macro.dbt.unique_key_join_on", "macro_sql": "{% macro unique_key_join_on(unique_key, identifier, from_identifier) %}\n {% if unique_key | is_list %}\n {% for key in unique_key %}\n\t {% set source_unique_key = (identifier ~ \".dbt_unique_key_\" ~ loop.index) | trim %}\n\t {% set target_unique_key = (from_identifier ~ \".dbt_unique_key_\" ~ loop.index) | trim %}\n\t {{ equals(source_unique_key, target_unique_key) }}\n {%- if not loop.last %} and {%- endif %}\n {% endfor %}\n {% else %}\n {{ identifier }}.dbt_unique_key = {{ from_identifier }}.dbt_unique_key\n {% endif %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.equals"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "unique_key", "type": null, "description": ""}, {"name": "identifier", "type": null, "description": ""}, {"name": "from_identifier", "type": null, "description": ""}], "created_at": 1789079002.3614004, "supported_languages": null}, "macro.dbt.unique_key_is_null": {"name": "unique_key_is_null", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "unique_id": "macro.dbt.unique_key_is_null", "macro_sql": "{% macro unique_key_is_null(unique_key, identifier) %}\n {% if unique_key | is_list %}\n {{ identifier }}.dbt_unique_key_1 is null\n {% else %}\n {{ identifier }}.dbt_unique_key is null\n {% endif %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "unique_key", "type": null, "description": ""}, {"name": "identifier", "type": null, "description": ""}], "created_at": 1789079002.3616514, "supported_languages": null}, "macro.dbt.unique_key_is_not_null": {"name": "unique_key_is_not_null", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "unique_id": "macro.dbt.unique_key_is_not_null", "macro_sql": "{% macro unique_key_is_not_null(unique_key, identifier) %}\n {% if unique_key | is_list %}\n {{ identifier }}.dbt_unique_key_1 is not null\n {% else %}\n {{ identifier }}.dbt_unique_key is not null\n {% endif %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "unique_key", "type": null, "description": ""}, {"name": "identifier", "type": null, "description": ""}], "created_at": 1789079002.3619041, "supported_languages": null}, "macro.dbt.get_aggregate_function_create_replace_signature": {"name": "get_aggregate_function_create_replace_signature", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/functions/aggregate.sql", "original_file_path": "macros/materializations/functions/aggregate.sql", "unique_id": "macro.dbt.get_aggregate_function_create_replace_signature", "macro_sql": "{% macro get_aggregate_function_create_replace_signature(target_relation) %}\n {{ return(adapter.dispatch('get_aggregate_function_create_replace_signature', 'dbt')(target_relation)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_aggregate_function_create_replace_signature"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "target_relation", "type": null, "description": ""}], "created_at": 1789079002.3626397, "supported_languages": null}, "macro.dbt.default__get_aggregate_function_create_replace_signature": {"name": "default__get_aggregate_function_create_replace_signature", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/functions/aggregate.sql", "original_file_path": "macros/materializations/functions/aggregate.sql", "unique_id": "macro.dbt.default__get_aggregate_function_create_replace_signature", "macro_sql": "{% macro default__get_aggregate_function_create_replace_signature(target_relation) %}\n CREATE OR REPLACE AGGREGATE FUNCTION {{ target_relation.render() }} ({{ get_formatted_aggregate_function_args()}})\n RETURNS {{ model.returns.data_type }}\n {{ get_function_language_specifier() }}\n {{ get_aggregate_function_volatility_specifier() }}\n {% if model.get('language') == 'python' %}\n {{ get_function_python_options() }}\n {% endif %}\n AS\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_formatted_aggregate_function_args", "macro.dbt.get_function_language_specifier", "macro.dbt.get_aggregate_function_volatility_specifier", "macro.dbt.get_function_python_options"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "target_relation", "type": null, "description": ""}], "created_at": 1789079002.36306, "supported_languages": null}, "macro.dbt.get_formatted_aggregate_function_args": {"name": "get_formatted_aggregate_function_args", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/functions/aggregate.sql", "original_file_path": "macros/materializations/functions/aggregate.sql", "unique_id": "macro.dbt.get_formatted_aggregate_function_args", "macro_sql": "{% macro get_formatted_aggregate_function_args() %}\n {{ return(adapter.dispatch('get_formatted_aggregate_function_args', 'dbt')()) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_formatted_aggregate_function_args"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789079002.3632562, "supported_languages": null}, "macro.dbt.default__get_formatted_aggregate_function_args": {"name": "default__get_formatted_aggregate_function_args", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/functions/aggregate.sql", "original_file_path": "macros/materializations/functions/aggregate.sql", "unique_id": "macro.dbt.default__get_formatted_aggregate_function_args", "macro_sql": "{% macro default__get_formatted_aggregate_function_args() %}\n {# conveniently we can reuse the sql scalar function args #}\n {{ formatted_scalar_function_args_sql() }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.formatted_scalar_function_args_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789079002.3633945, "supported_languages": null}, "macro.dbt.get_function_language_specifier": {"name": "get_function_language_specifier", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/functions/aggregate.sql", "original_file_path": "macros/materializations/functions/aggregate.sql", "unique_id": "macro.dbt.get_function_language_specifier", "macro_sql": "{% macro get_function_language_specifier() %}\n {{ return(adapter.dispatch('get_function_language_specifier', 'dbt')()) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_function_language_specifier"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789079002.3635805, "supported_languages": null}, "macro.dbt.default__get_function_language_specifier": {"name": "default__get_function_language_specifier", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/functions/aggregate.sql", "original_file_path": "macros/materializations/functions/aggregate.sql", "unique_id": "macro.dbt.default__get_function_language_specifier", "macro_sql": "{% macro default__get_function_language_specifier() %}\n {% set language = model.get('language') %}\n {% if language == 'sql' %}\n {# generally you dont need to specify the language for sql functions #}\n {% elif language == 'python' %}\n LANGUAGE PYTHON\n {% elif language == 'javascript' %}\n LANGUAGE js\n {% else %}\n {{ 'LANGUAGE ' ~ language.upper() }}\n {% endif %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789079002.3642616, "supported_languages": null}, "macro.dbt.get_aggregate_function_volatility_specifier": {"name": "get_aggregate_function_volatility_specifier", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/functions/aggregate.sql", "original_file_path": "macros/materializations/functions/aggregate.sql", "unique_id": "macro.dbt.get_aggregate_function_volatility_specifier", "macro_sql": "{% macro get_aggregate_function_volatility_specifier() %}\n {{ return(adapter.dispatch('get_aggregate_function_volatility_specifier', 'dbt')()) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_aggregate_function_volatility_specifier"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789079002.3644545, "supported_languages": null}, "macro.dbt.default__get_aggregate_function_volatility_specifier": {"name": "default__get_aggregate_function_volatility_specifier", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/functions/aggregate.sql", "original_file_path": "macros/materializations/functions/aggregate.sql", "unique_id": "macro.dbt.default__get_aggregate_function_volatility_specifier", "macro_sql": "{% macro default__get_aggregate_function_volatility_specifier() %}\n {{ scalar_function_volatility_sql() }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.scalar_function_volatility_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789079002.3645809, "supported_languages": null}, "macro.dbt.get_function_python_options": {"name": "get_function_python_options", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/functions/aggregate.sql", "original_file_path": "macros/materializations/functions/aggregate.sql", "unique_id": "macro.dbt.get_function_python_options", "macro_sql": "{% macro get_function_python_options() %}\n {{ return(adapter.dispatch('get_function_python_options', 'dbt')()) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_function_python_options"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789079002.3647623, "supported_languages": null}, "macro.dbt.default__get_function_python_options": {"name": "default__get_function_python_options", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/functions/aggregate.sql", "original_file_path": "macros/materializations/functions/aggregate.sql", "unique_id": "macro.dbt.default__get_function_python_options", "macro_sql": "{% macro default__get_function_python_options() %}\n RUNTIME_VERSION = '{{ model.config.get('runtime_version') }}'\n HANDLER = '{{ model.config.get('entry_point') }}'\n {% set packages = model.config.get('packages', []) %}\n {% if packages %}\n PACKAGES = ('{{ packages | join(\"','\") }}')\n {% endif %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789079002.3651896, "supported_languages": null}, "macro.dbt.scalar_function_sql": {"name": "scalar_function_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/functions/scalar.sql", "original_file_path": "macros/materializations/functions/scalar.sql", "unique_id": "macro.dbt.scalar_function_sql", "macro_sql": "{% macro scalar_function_sql(target_relation) %}\n {{ return(adapter.dispatch('scalar_function_sql', 'dbt')(target_relation)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__scalar_function_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "target_relation", "type": null, "description": ""}], "created_at": 1789079002.366085, "supported_languages": null}, "macro.dbt.default__scalar_function_sql": {"name": "default__scalar_function_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/functions/scalar.sql", "original_file_path": "macros/materializations/functions/scalar.sql", "unique_id": "macro.dbt.default__scalar_function_sql", "macro_sql": "{% macro default__scalar_function_sql(target_relation) %}\n {{ scalar_function_create_replace_signature_sql(target_relation) }}\n {{ scalar_function_body_sql() }};\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.scalar_function_create_replace_signature_sql", "macro.dbt.scalar_function_body_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "target_relation", "type": null, "description": ""}], "created_at": 1789079002.3662713, "supported_languages": null}, "macro.dbt.scalar_function_create_replace_signature_sql": {"name": "scalar_function_create_replace_signature_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/functions/scalar.sql", "original_file_path": "macros/materializations/functions/scalar.sql", "unique_id": "macro.dbt.scalar_function_create_replace_signature_sql", "macro_sql": "{% macro scalar_function_create_replace_signature_sql(target_relation) %}\n {{ return(adapter.dispatch('scalar_function_create_replace_signature_sql', 'dbt')(target_relation)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__scalar_function_create_replace_signature_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "target_relation", "type": null, "description": ""}], "created_at": 1789079002.3664813, "supported_languages": null}, "macro.dbt.default__scalar_function_create_replace_signature_sql": {"name": "default__scalar_function_create_replace_signature_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/functions/scalar.sql", "original_file_path": "macros/materializations/functions/scalar.sql", "unique_id": "macro.dbt.default__scalar_function_create_replace_signature_sql", "macro_sql": "{% macro default__scalar_function_create_replace_signature_sql(target_relation) %}\n CREATE OR REPLACE FUNCTION {{ target_relation.render() }} ({{ formatted_scalar_function_args_sql()}})\n RETURNS {{ model.returns.data_type }}\n {{ scalar_function_volatility_sql() }}\n AS\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.formatted_scalar_function_args_sql", "macro.dbt.scalar_function_volatility_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "target_relation", "type": null, "description": ""}], "created_at": 1789079002.3667233, "supported_languages": null}, "macro.dbt.formatted_scalar_function_args_sql": {"name": "formatted_scalar_function_args_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/functions/scalar.sql", "original_file_path": "macros/materializations/functions/scalar.sql", "unique_id": "macro.dbt.formatted_scalar_function_args_sql", "macro_sql": "{% macro formatted_scalar_function_args_sql() %}\n {{ return(adapter.dispatch('formatted_scalar_function_args_sql', 'dbt')()) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__formatted_scalar_function_args_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789079002.3669243, "supported_languages": null}, "macro.dbt.formatted_scalar_function_args_javascript": {"name": "formatted_scalar_function_args_javascript", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/functions/scalar.sql", "original_file_path": "macros/materializations/functions/scalar.sql", "unique_id": "macro.dbt.formatted_scalar_function_args_javascript", "macro_sql": "{% macro formatted_scalar_function_args_javascript() %}\n {{ return(adapter.dispatch('formatted_scalar_function_args_javascript', 'dbt')()) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__formatted_scalar_function_args_javascript"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789079002.367109, "supported_languages": null}, "macro.dbt.default__formatted_scalar_function_args_sql": {"name": "default__formatted_scalar_function_args_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/functions/scalar.sql", "original_file_path": "macros/materializations/functions/scalar.sql", "unique_id": "macro.dbt.default__formatted_scalar_function_args_sql", "macro_sql": "{% macro default__formatted_scalar_function_args_sql() %}\n {% set args = [] %}\n {% for arg in model.arguments -%}\n {%- do args.append(arg.name ~ ' ' ~ arg.data_type) -%}\n {%- endfor %}\n {{ args | join(', ') }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789079002.367479, "supported_languages": null}, "macro.dbt.default__formatted_scalar_function_args_javascript": {"name": "default__formatted_scalar_function_args_javascript", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/functions/scalar.sql", "original_file_path": "macros/materializations/functions/scalar.sql", "unique_id": "macro.dbt.default__formatted_scalar_function_args_javascript", "macro_sql": "{% macro default__formatted_scalar_function_args_javascript() %}\n {% set msg = \"formatted_scalar_function_args_javascript not implemented for adapter \" ~ adapter.type() %}\n {% do exceptions.raise_compiler_error(msg) %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789079002.367712, "supported_languages": null}, "macro.dbt.scalar_function_body_sql": {"name": "scalar_function_body_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/functions/scalar.sql", "original_file_path": "macros/materializations/functions/scalar.sql", "unique_id": "macro.dbt.scalar_function_body_sql", "macro_sql": "{% macro scalar_function_body_sql() %}\n {{ return(adapter.dispatch('scalar_function_body_sql', 'dbt')()) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__scalar_function_body_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789079002.3679092, "supported_languages": null}, "macro.dbt.default__scalar_function_body_sql": {"name": "default__scalar_function_body_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/functions/scalar.sql", "original_file_path": "macros/materializations/functions/scalar.sql", "unique_id": "macro.dbt.default__scalar_function_body_sql", "macro_sql": "{% macro default__scalar_function_body_sql() %}\n $$\n {{ model.compiled_code }}\n $$ LANGUAGE SQL\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789079002.368032, "supported_languages": null}, "macro.dbt.scalar_function_volatility_sql": {"name": "scalar_function_volatility_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/functions/scalar.sql", "original_file_path": "macros/materializations/functions/scalar.sql", "unique_id": "macro.dbt.scalar_function_volatility_sql", "macro_sql": "{% macro scalar_function_volatility_sql() %}\n {{ return(adapter.dispatch('scalar_function_volatility_sql', 'dbt')()) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__scalar_function_volatility_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789079002.3682153, "supported_languages": null}, "macro.dbt.scalar_function_volatility_javascript": {"name": "scalar_function_volatility_javascript", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/functions/scalar.sql", "original_file_path": "macros/materializations/functions/scalar.sql", "unique_id": "macro.dbt.scalar_function_volatility_javascript", "macro_sql": "{% macro scalar_function_volatility_javascript() %}\n {{ return(adapter.dispatch('scalar_function_volatility_javascript', 'dbt')()) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__scalar_function_volatility_javascript"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789079002.3683994, "supported_languages": null}, "macro.dbt.default__scalar_function_volatility_javascript": {"name": "default__scalar_function_volatility_javascript", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/functions/scalar.sql", "original_file_path": "macros/materializations/functions/scalar.sql", "unique_id": "macro.dbt.default__scalar_function_volatility_javascript", "macro_sql": "{% macro default__scalar_function_volatility_javascript() %}\n {% set volatility = model.config.get('volatility') %}\n {% if volatility != none %}\n {% set msg = \"Volatility is not supported by \" ~ adapter.type() ~ \" in javascript UDF and will be ignored\" %}\n {% do exceptions.warn(msg) %}\n {% endif %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789079002.4130635, "supported_languages": null}, "macro.dbt.default__scalar_function_volatility_sql": {"name": "default__scalar_function_volatility_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/functions/scalar.sql", "original_file_path": "macros/materializations/functions/scalar.sql", "unique_id": "macro.dbt.default__scalar_function_volatility_sql", "macro_sql": "{% macro default__scalar_function_volatility_sql() %}\n {% set volatility = model.config.get('volatility') %}\n {% if volatility == 'deterministic' %}\n IMMUTABLE\n {% elif volatility == 'stable' %}\n STABLE\n {% elif volatility == 'non-deterministic' %}\n VOLATILE\n {% elif volatility != none %}\n {# This shouldn't happen unless a new volatility is invented #}\n {% do unsupported_volatility_warning(volatility) %}\n {% endif %}\n {# If no volatility is set, don't add anything and let the data warehouse default it #}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.unsupported_volatility_warning"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789079002.4136775, "supported_languages": null}, "macro.dbt.unsupported_volatility_warning": {"name": "unsupported_volatility_warning", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/functions/scalar.sql", "original_file_path": "macros/materializations/functions/scalar.sql", "unique_id": "macro.dbt.unsupported_volatility_warning", "macro_sql": "{% macro unsupported_volatility_warning(volatility) %}\n {{ return(adapter.dispatch('unsupported_volatility_warning', 'dbt')(volatility)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__unsupported_volatility_warning"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "volatility", "type": null, "description": ""}], "created_at": 1789079002.4139616, "supported_languages": null}, "macro.dbt.default__unsupported_volatility_warning": {"name": "default__unsupported_volatility_warning", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/functions/scalar.sql", "original_file_path": "macros/materializations/functions/scalar.sql", "unique_id": "macro.dbt.default__unsupported_volatility_warning", "macro_sql": "{% macro default__unsupported_volatility_warning(volatility) %}\n {% set msg = \"Found `\" ~ volatility ~ \"` volatility specified on function `\" ~ model.name ~ \"`. This volatility is not supported by \" ~ adapter.type() ~ \", and will be ignored\" %}\n {% do exceptions.warn(msg) %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "volatility", "type": null, "description": ""}], "created_at": 1789079002.4143333, "supported_languages": null}, "macro.dbt.materialization_function_default": {"name": "materialization_function_default", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/functions/function.sql", "original_file_path": "macros/materializations/functions/function.sql", "unique_id": "macro.dbt.materialization_function_default", "macro_sql": "{% materialization function, default, supported_languages=['sql', 'python', 'javascript'] %}\n {% set existing_relation = load_cached_relation(this) %}\n {% set target_relation = this.incorporate(type=this.Function) %}\n\n {{ run_hooks(pre_hooks) }}\n\n {% set function_config = this.get_function_config(model) %}\n {% set macro_name = this.get_function_macro_name(function_config) %}\n\n {# Doing this aliasing of adapter.dispatch is a hacky way to disable the static analysis of actually calling adapter.dispatch #}\n {# This is necessary because the static analysis breaks being able to dynamically pass a macro_name #}\n {% set _dispatch = adapter.dispatch %}\n\n {% set build_sql = _dispatch(macro_name, 'dbt')(target_relation) %}\n {{ function_execute_build_sql(build_sql, existing_relation, target_relation) }}\n {{ run_hooks(post_hooks) }}\n\n {{ return({'relations': [target_relation]}) }}\n\n{% endmaterialization %}", "depends_on": {"macros": ["macro.dbt.load_cached_relation", "macro.dbt.run_hooks", "macro.dbt.function_execute_build_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "supported_languages", "type": null, "description": ""}], "created_at": 1789079002.4155967, "supported_languages": ["sql", "python", "javascript"]}, "macro.dbt.function_execute_build_sql": {"name": "function_execute_build_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/functions/helpers.sql", "original_file_path": "macros/materializations/functions/helpers.sql", "unique_id": "macro.dbt.function_execute_build_sql", "macro_sql": "{% macro function_execute_build_sql(build_sql, existing_relation, target_relation) %}\n {{ return(adapter.dispatch('function_execute_build_sql', 'dbt')(build_sql, existing_relation, target_relation)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__function_execute_build_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "build_sql", "type": null, "description": ""}, {"name": "existing_relation", "type": null, "description": ""}, {"name": "target_relation", "type": null, "description": ""}], "created_at": 1789079002.4161081, "supported_languages": null}, "macro.dbt.default__function_execute_build_sql": {"name": "default__function_execute_build_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/functions/helpers.sql", "original_file_path": "macros/materializations/functions/helpers.sql", "unique_id": "macro.dbt.default__function_execute_build_sql", "macro_sql": "{% macro default__function_execute_build_sql(build_sql, existing_relation, target_relation) %}\n\n {% set grant_config = config.get('grants') %}\n\n {% call statement(name=\"main\") %}\n {{ build_sql }}\n {% endcall %}\n\n {% set should_revoke = should_revoke(existing_relation, full_refresh_mode=True) %}\n {% do apply_grants(target_relation, grant_config, should_revoke=should_revoke) %}\n\n {% do persist_docs(target_relation, model) %}\n\n {{ adapter.commit() }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement", "macro.dbt.should_revoke", "macro.dbt.apply_grants", "macro.dbt.persist_docs"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "build_sql", "type": null, "description": ""}, {"name": "existing_relation", "type": null, "description": ""}, {"name": "target_relation", "type": null, "description": ""}], "created_at": 1789079002.4167948, "supported_languages": null}, "macro.dbt.materialization_table_default": {"name": "materialization_table_default", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/table.sql", "original_file_path": "macros/materializations/models/table.sql", "unique_id": "macro.dbt.materialization_table_default", "macro_sql": "{% materialization table, default %}\n\n {%- set existing_relation = load_cached_relation(this) -%}\n {%- set target_relation = this.incorporate(type='table') %}\n {%- set intermediate_relation = make_intermediate_relation(target_relation) -%}\n -- the intermediate_relation should not already exist in the database; get_relation\n -- will return None in that case. Otherwise, we get a relation that we can drop\n -- later, before we try to use this name for the current operation\n {%- set preexisting_intermediate_relation = load_cached_relation(intermediate_relation) -%}\n /*\n See ../view/view.sql for more information about this relation.\n */\n {%- set backup_relation_type = 'table' if existing_relation is none else existing_relation.type -%}\n {%- set backup_relation = make_backup_relation(target_relation, backup_relation_type) -%}\n -- as above, the backup_relation should not already exist\n {%- set preexisting_backup_relation = load_cached_relation(backup_relation) -%}\n -- grab current tables grants config for comparision later on\n {% set grant_config = config.get('grants') %}\n\n -- drop the temp relations if they exist already in the database\n {{ drop_relation_if_exists(preexisting_intermediate_relation) }}\n {{ drop_relation_if_exists(preexisting_backup_relation) }}\n\n {{ run_hooks(pre_hooks, inside_transaction=False) }}\n\n -- `BEGIN` happens here:\n {{ run_hooks(pre_hooks, inside_transaction=True) }}\n\n -- build model\n {% call statement('main') -%}\n {{ get_create_table_as_sql(False, intermediate_relation, sql) }}\n {%- endcall %}\n\n {% do create_indexes(intermediate_relation) %}\n\n -- cleanup\n {% if existing_relation is not none %}\n /* Do the equivalent of rename_if_exists. 'existing_relation' could have been dropped\n since the variable was first set. */\n {% set existing_relation = load_cached_relation(existing_relation) %}\n {% if existing_relation is not none %}\n {{ adapter.rename_relation(existing_relation, backup_relation) }}\n {% endif %}\n {% endif %}\n\n {{ adapter.rename_relation(intermediate_relation, target_relation) }}\n\n {{ run_hooks(post_hooks, inside_transaction=True) }}\n\n {% set should_revoke = should_revoke(existing_relation, full_refresh_mode=True) %}\n {% do apply_grants(target_relation, grant_config, should_revoke=should_revoke) %}\n\n {% do persist_docs(target_relation, model) %}\n\n -- `COMMIT` happens here\n {{ adapter.commit() }}\n\n -- finally, drop the existing/backup relation after the commit\n {{ drop_relation_if_exists(backup_relation) }}\n\n {{ run_hooks(post_hooks, inside_transaction=False) }}\n\n {{ return({'relations': [target_relation]}) }}\n{% endmaterialization %}", "depends_on": {"macros": ["macro.dbt.load_cached_relation", "macro.dbt.make_intermediate_relation", "macro.dbt.make_backup_relation", "macro.dbt.drop_relation_if_exists", "macro.dbt.run_hooks", "macro.dbt.statement", "macro.dbt.get_create_table_as_sql", "macro.dbt.create_indexes", "macro.dbt.should_revoke", "macro.dbt.apply_grants", "macro.dbt.persist_docs"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "supported_languages", "type": null, "description": ""}], "created_at": 1789079002.4195416, "supported_languages": ["sql"]}, "macro.dbt.materialization_materialized_view_default": {"name": "materialization_materialized_view_default", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/materialized_view.sql", "original_file_path": "macros/materializations/models/materialized_view.sql", "unique_id": "macro.dbt.materialization_materialized_view_default", "macro_sql": "{% materialization materialized_view, default %}\n {% set existing_relation = load_cached_relation(this) %}\n {% set target_relation = this.incorporate(type=this.MaterializedView) %}\n {% set intermediate_relation = make_intermediate_relation(target_relation) %}\n {% set backup_relation_type = target_relation.MaterializedView if existing_relation is none else existing_relation.type %}\n {% set backup_relation = make_backup_relation(target_relation, backup_relation_type) %}\n\n {{ materialized_view_setup(backup_relation, intermediate_relation, pre_hooks) }}\n\n {% set build_sql = materialized_view_get_build_sql(existing_relation, target_relation, backup_relation, intermediate_relation) %}\n\n {% if build_sql == '' %}\n {{ materialized_view_execute_no_op(target_relation) }}\n {% else %}\n {{ materialized_view_execute_build_sql(build_sql, existing_relation, target_relation, post_hooks) }}\n {% endif %}\n\n {{ materialized_view_teardown(backup_relation, intermediate_relation, post_hooks) }}\n\n {{ return({'relations': [target_relation]}) }}\n\n{% endmaterialization %}", "depends_on": {"macros": ["macro.dbt.load_cached_relation", "macro.dbt.make_intermediate_relation", "macro.dbt.make_backup_relation", "macro.dbt.materialized_view_setup", "macro.dbt.materialized_view_get_build_sql", "macro.dbt.materialized_view_execute_no_op", "macro.dbt.materialized_view_execute_build_sql", "macro.dbt.materialized_view_teardown"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "supported_languages", "type": null, "description": ""}], "created_at": 1789079002.4214869, "supported_languages": ["sql"]}, "macro.dbt.materialized_view_setup": {"name": "materialized_view_setup", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/materialized_view.sql", "original_file_path": "macros/materializations/models/materialized_view.sql", "unique_id": "macro.dbt.materialized_view_setup", "macro_sql": "{% macro materialized_view_setup(backup_relation, intermediate_relation, pre_hooks) %}\n\n -- backup_relation and intermediate_relation should not already exist in the database\n -- it's possible these exist because of a previous run that exited unexpectedly\n {% set preexisting_backup_relation = load_cached_relation(backup_relation) %}\n {% set preexisting_intermediate_relation = load_cached_relation(intermediate_relation) %}\n\n -- drop the temp relations if they exist already in the database\n {{ drop_relation_if_exists(preexisting_backup_relation) }}\n {{ drop_relation_if_exists(preexisting_intermediate_relation) }}\n\n {{ run_hooks(pre_hooks, inside_transaction=False) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.load_cached_relation", "macro.dbt.drop_relation_if_exists", "macro.dbt.run_hooks"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "backup_relation", "type": null, "description": ""}, {"name": "intermediate_relation", "type": null, "description": ""}, {"name": "pre_hooks", "type": null, "description": ""}], "created_at": 1789079002.4220145, "supported_languages": null}, "macro.dbt.materialized_view_teardown": {"name": "materialized_view_teardown", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/materialized_view.sql", "original_file_path": "macros/materializations/models/materialized_view.sql", "unique_id": "macro.dbt.materialized_view_teardown", "macro_sql": "{% macro materialized_view_teardown(backup_relation, intermediate_relation, post_hooks) %}\n\n -- drop the temp relations if they exist to leave the database clean for the next run\n {{ drop_relation_if_exists(backup_relation) }}\n {{ drop_relation_if_exists(intermediate_relation) }}\n\n {{ run_hooks(post_hooks, inside_transaction=False) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.drop_relation_if_exists", "macro.dbt.run_hooks"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "backup_relation", "type": null, "description": ""}, {"name": "intermediate_relation", "type": null, "description": ""}, {"name": "post_hooks", "type": null, "description": ""}], "created_at": 1789079002.4223387, "supported_languages": null}, "macro.dbt.materialized_view_get_build_sql": {"name": "materialized_view_get_build_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/materialized_view.sql", "original_file_path": "macros/materializations/models/materialized_view.sql", "unique_id": "macro.dbt.materialized_view_get_build_sql", "macro_sql": "{% macro materialized_view_get_build_sql(existing_relation, target_relation, backup_relation, intermediate_relation) %}\n\n {% set full_refresh_mode = should_full_refresh() %}\n\n -- determine the scenario we're in: create, full_refresh, alter, refresh data\n {% if existing_relation is none %}\n {% set build_sql = get_create_materialized_view_as_sql(target_relation, sql) %}\n {% elif full_refresh_mode or not existing_relation.is_materialized_view %}\n {% set build_sql = get_replace_sql(existing_relation, target_relation, sql) %}\n {% else %}\n\n -- get config options\n {% set on_configuration_change = config.get('on_configuration_change') %}\n {% set configuration_changes = get_materialized_view_configuration_changes(existing_relation, config) %}\n\n {% if configuration_changes is none %}\n {% set build_sql = refresh_materialized_view(target_relation) %}\n\n {% elif on_configuration_change == 'apply' %}\n {% set build_sql = get_alter_materialized_view_as_sql(target_relation, configuration_changes, sql, existing_relation, backup_relation, intermediate_relation) %}\n {% elif on_configuration_change == 'continue' %}\n {% set build_sql = '' %}\n {{ exceptions.warn(\"Configuration changes were identified and `on_configuration_change` was set to `continue` for `\" ~ target_relation.render() ~ \"`\") }}\n {% elif on_configuration_change == 'fail' %}\n {{ exceptions.raise_fail_fast_error(\"Configuration changes were identified and `on_configuration_change` was set to `fail` for `\" ~ target_relation.render() ~ \"`\") }}\n\n {% else %}\n -- this only happens if the user provides a value other than `apply`, 'skip', 'fail'\n {{ exceptions.raise_compiler_error(\"Unexpected configuration scenario\") }}\n\n {% endif %}\n\n {% endif %}\n\n {% do return(build_sql) %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.should_full_refresh", "macro.dbt.get_create_materialized_view_as_sql", "macro.dbt.get_replace_sql", "macro.dbt.get_materialized_view_configuration_changes", "macro.dbt.refresh_materialized_view", "macro.dbt.get_alter_materialized_view_as_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "existing_relation", "type": null, "description": ""}, {"name": "target_relation", "type": null, "description": ""}, {"name": "backup_relation", "type": null, "description": ""}, {"name": "intermediate_relation", "type": null, "description": ""}], "created_at": 1789079002.4239593, "supported_languages": null}, "macro.dbt.materialized_view_execute_no_op": {"name": "materialized_view_execute_no_op", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/materialized_view.sql", "original_file_path": "macros/materializations/models/materialized_view.sql", "unique_id": "macro.dbt.materialized_view_execute_no_op", "macro_sql": "{% macro materialized_view_execute_no_op(target_relation) %}\n {% do store_raw_result(\n name=\"main\",\n message=\"skip \" ~ target_relation,\n code=\"skip\",\n rows_affected=\"-1\"\n ) %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "target_relation", "type": null, "description": ""}], "created_at": 1789079002.4242656, "supported_languages": null}, "macro.dbt.materialized_view_execute_build_sql": {"name": "materialized_view_execute_build_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/materialized_view.sql", "original_file_path": "macros/materializations/models/materialized_view.sql", "unique_id": "macro.dbt.materialized_view_execute_build_sql", "macro_sql": "{% macro materialized_view_execute_build_sql(build_sql, existing_relation, target_relation, post_hooks) %}\n\n -- `BEGIN` happens here:\n {{ run_hooks(pre_hooks, inside_transaction=True) }}\n\n {% set grant_config = config.get('grants') %}\n\n {% call statement(name=\"main\") %}\n {{ build_sql }}\n {% endcall %}\n\n {% set should_revoke = should_revoke(existing_relation, full_refresh_mode=True) %}\n {% do apply_grants(target_relation, grant_config, should_revoke=should_revoke) %}\n\n {% do persist_docs(target_relation, model) %}\n\n {{ run_hooks(post_hooks, inside_transaction=True) }}\n\n {{ adapter.commit() }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.run_hooks", "macro.dbt.statement", "macro.dbt.should_revoke", "macro.dbt.apply_grants", "macro.dbt.persist_docs"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "build_sql", "type": null, "description": ""}, {"name": "existing_relation", "type": null, "description": ""}, {"name": "target_relation", "type": null, "description": ""}, {"name": "post_hooks", "type": null, "description": ""}], "created_at": 1789079002.4250581, "supported_languages": null}, "macro.dbt.materialization_view_default": {"name": "materialization_view_default", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/view.sql", "original_file_path": "macros/materializations/models/view.sql", "unique_id": "macro.dbt.materialization_view_default", "macro_sql": "{%- materialization view, default -%}\n\n {%- set existing_relation = load_cached_relation(this) -%}\n {%- set target_relation = this.incorporate(type='view') -%}\n {%- set intermediate_relation = make_intermediate_relation(target_relation) -%}\n\n -- the intermediate_relation should not already exist in the database; get_relation\n -- will return None in that case. Otherwise, we get a relation that we can drop\n -- later, before we try to use this name for the current operation\n {%- set preexisting_intermediate_relation = load_cached_relation(intermediate_relation) -%}\n /*\n This relation (probably) doesn't exist yet. If it does exist, it's a leftover from\n a previous run, and we're going to try to drop it immediately. At the end of this\n materialization, we're going to rename the \"existing_relation\" to this identifier,\n and then we're going to drop it. In order to make sure we run the correct one of:\n - drop view ...\n - drop table ...\n\n We need to set the type of this relation to be the type of the existing_relation, if it exists,\n or else \"view\" as a sane default if it does not. Note that if the existing_relation does not\n exist, then there is nothing to move out of the way and subsequentally drop. In that case,\n this relation will be effectively unused.\n */\n {%- set backup_relation_type = 'view' if existing_relation is none else existing_relation.type -%}\n {%- set backup_relation = make_backup_relation(target_relation, backup_relation_type) -%}\n -- as above, the backup_relation should not already exist\n {%- set preexisting_backup_relation = load_cached_relation(backup_relation) -%}\n -- grab current tables grants config for comparision later on\n {% set grant_config = config.get('grants') %}\n\n {{ run_hooks(pre_hooks, inside_transaction=False) }}\n\n -- drop the temp relations if they exist already in the database\n {{ drop_relation_if_exists(preexisting_intermediate_relation) }}\n {{ drop_relation_if_exists(preexisting_backup_relation) }}\n\n -- `BEGIN` happens here:\n {{ run_hooks(pre_hooks, inside_transaction=True) }}\n\n -- build model\n {% call statement('main') -%}\n {{ get_create_view_as_sql(intermediate_relation, sql) }}\n {%- endcall %}\n\n -- cleanup\n -- move the existing view out of the way\n {% if existing_relation is not none %}\n /* Do the equivalent of rename_if_exists. 'existing_relation' could have been dropped\n since the variable was first set. */\n {% set existing_relation = load_cached_relation(existing_relation) %}\n {% if existing_relation is not none %}\n {{ adapter.rename_relation(existing_relation, backup_relation) }}\n {% endif %}\n {% endif %}\n {{ adapter.rename_relation(intermediate_relation, target_relation) }}\n\n {% set should_revoke = should_revoke(existing_relation, full_refresh_mode=True) %}\n {% do apply_grants(target_relation, grant_config, should_revoke=should_revoke) %}\n\n {% do persist_docs(target_relation, model) %}\n\n {{ run_hooks(post_hooks, inside_transaction=True) }}\n\n {{ adapter.commit() }}\n\n {{ drop_relation_if_exists(backup_relation) }}\n\n {{ run_hooks(post_hooks, inside_transaction=False) }}\n\n {{ return({'relations': [target_relation]}) }}\n\n{%- endmaterialization -%}", "depends_on": {"macros": ["macro.dbt.load_cached_relation", "macro.dbt.make_intermediate_relation", "macro.dbt.make_backup_relation", "macro.dbt.run_hooks", "macro.dbt.drop_relation_if_exists", "macro.dbt.statement", "macro.dbt.get_create_view_as_sql", "macro.dbt.should_revoke", "macro.dbt.apply_grants", "macro.dbt.persist_docs"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "supported_languages", "type": null, "description": ""}], "created_at": 1789079002.4274516, "supported_languages": ["sql"]}, "macro.dbt.materialization_clone_default": {"name": "materialization_clone_default", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/clone/clone.sql", "original_file_path": "macros/materializations/models/clone/clone.sql", "unique_id": "macro.dbt.materialization_clone_default", "macro_sql": "{%- materialization clone, default -%}\n\n {%- set relations = {'relations': []} -%}\n\n {%- if not defer_relation -%}\n -- nothing to do\n {{ log(\"No relation found in state manifest for \" ~ model.unique_id, info=True) }}\n {{ return(relations) }}\n {%- endif -%}\n\n {%- set existing_relation = load_cached_relation(this) -%}\n\n {%- if existing_relation and not flags.FULL_REFRESH -%}\n -- noop!\n {{ log(\"Relation \" ~ existing_relation ~ \" already exists\", info=True) }}\n {{ return(relations) }}\n {%- endif -%}\n\n {%- set other_existing_relation = load_cached_relation(defer_relation) -%}\n\n -- If this is a database that can do zero-copy cloning of tables, and the other relation is a table, then this will be a table\n -- Otherwise, this will be a view\n\n {% set can_clone_table = can_clone_table() %}\n {%- set grant_config = config.get('grants') -%}\n\n {%- if other_existing_relation and other_existing_relation.type == 'table' and can_clone_table -%}\n\n {%- set target_relation = this.incorporate(type='table') -%}\n {% if existing_relation is not none and not existing_relation.is_table %}\n {{ log(\"Dropping relation \" ~ existing_relation.render() ~ \" because it is of type \" ~ existing_relation.type) }}\n {{ drop_relation_if_exists(existing_relation) }}\n {% endif %}\n\n -- as a general rule, data platforms that can clone tables can also do atomic 'create or replace'\n {% if target_relation.database == defer_relation.database and\n target_relation.schema == defer_relation.schema and\n target_relation.identifier == defer_relation.identifier %}\n {{ log(\"Target relation and defer relation are the same, skipping clone for relation: \" ~ target_relation.render()) }}\n {% else %}\n {% call statement('main') %}\n {{ create_or_replace_clone(target_relation, defer_relation) }}\n {% endcall %}\n {% endif %}\n {% set should_revoke = should_revoke(existing_relation, full_refresh_mode=True) %}\n {% do apply_grants(target_relation, grant_config, should_revoke=should_revoke) %}\n {% do persist_docs(target_relation, model) %}\n\n {{ return({'relations': [target_relation]}) }}\n\n {%- else -%}\n\n {%- set target_relation = this.incorporate(type='view') -%}\n\n -- reuse the view materialization\n -- TODO: support actual dispatch for materialization macros\n -- Tracking ticket: https://github.com/dbt-labs/dbt-core/issues/7799\n {% set search_name = \"materialization_view_\" ~ adapter.type() %}\n {% if not search_name in context %}\n {% set search_name = \"materialization_view_default\" %}\n {% endif %}\n {% set materialization_macro = context[search_name] %}\n {% set relations = materialization_macro() %}\n {{ return(relations) }}\n\n {%- endif -%}\n\n{%- endmaterialization -%}", "depends_on": {"macros": ["macro.dbt.load_cached_relation", "macro.dbt.can_clone_table", "macro.dbt.drop_relation_if_exists", "macro.dbt.statement", "macro.dbt.create_or_replace_clone", "macro.dbt.should_revoke", "macro.dbt.apply_grants", "macro.dbt.persist_docs"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "supported_languages", "type": null, "description": ""}], "created_at": 1789079002.4304426, "supported_languages": ["sql"]}, "macro.dbt.can_clone_table": {"name": "can_clone_table", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/clone/can_clone_table.sql", "original_file_path": "macros/materializations/models/clone/can_clone_table.sql", "unique_id": "macro.dbt.can_clone_table", "macro_sql": "{% macro can_clone_table() %}\n {{ return(adapter.dispatch('can_clone_table', 'dbt')()) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__can_clone_table"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789079002.430764, "supported_languages": null}, "macro.dbt.default__can_clone_table": {"name": "default__can_clone_table", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/clone/can_clone_table.sql", "original_file_path": "macros/materializations/models/clone/can_clone_table.sql", "unique_id": "macro.dbt.default__can_clone_table", "macro_sql": "{% macro default__can_clone_table() %}\n {{ return(False) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789079002.430922, "supported_languages": null}, "macro.dbt.create_or_replace_clone": {"name": "create_or_replace_clone", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/clone/create_or_replace_clone.sql", "original_file_path": "macros/materializations/models/clone/create_or_replace_clone.sql", "unique_id": "macro.dbt.create_or_replace_clone", "macro_sql": "{% macro create_or_replace_clone(this_relation, defer_relation) %}\n {{ return(adapter.dispatch('create_or_replace_clone', 'dbt')(this_relation, defer_relation)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__create_or_replace_clone"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "this_relation", "type": null, "description": ""}, {"name": "defer_relation", "type": null, "description": ""}], "created_at": 1789079002.4312456, "supported_languages": null}, "macro.dbt.default__create_or_replace_clone": {"name": "default__create_or_replace_clone", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/clone/create_or_replace_clone.sql", "original_file_path": "macros/materializations/models/clone/create_or_replace_clone.sql", "unique_id": "macro.dbt.default__create_or_replace_clone", "macro_sql": "{% macro default__create_or_replace_clone(this_relation, defer_relation) %}\n create or replace table {{ this_relation.render() }} clone {{ defer_relation.render() }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "this_relation", "type": null, "description": ""}, {"name": "defer_relation", "type": null, "description": ""}], "created_at": 1789079002.4314494, "supported_languages": null}, "macro.dbt.materialization_incremental_default": {"name": "materialization_incremental_default", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/incremental.sql", "original_file_path": "macros/materializations/models/incremental/incremental.sql", "unique_id": "macro.dbt.materialization_incremental_default", "macro_sql": "{% materialization incremental, default -%}\n\n -- relations\n {%- set existing_relation = load_cached_relation(this) -%}\n {%- set target_relation = this.incorporate(type='table') -%}\n {%- set temp_relation = make_temp_relation(target_relation)-%}\n {%- set intermediate_relation = make_intermediate_relation(target_relation)-%}\n {%- set backup_relation_type = 'table' if existing_relation is none else existing_relation.type -%}\n {%- set backup_relation = make_backup_relation(target_relation, backup_relation_type) -%}\n\n -- configs\n {%- set unique_key = config.get('unique_key') -%}\n {%- set full_refresh_mode = (should_full_refresh() or existing_relation.is_view) -%}\n {%- set on_schema_change = incremental_validate_on_schema_change(config.get('on_schema_change'), default='ignore') -%}\n\n -- the temp_ and backup_ relations should not already exist in the database; get_relation\n -- will return None in that case. Otherwise, we get a relation that we can drop\n -- later, before we try to use this name for the current operation. This has to happen before\n -- BEGIN, in a separate transaction\n {%- set preexisting_intermediate_relation = load_cached_relation(intermediate_relation)-%}\n {%- set preexisting_backup_relation = load_cached_relation(backup_relation) -%}\n -- grab current tables grants config for comparision later on\n {% set grant_config = config.get('grants') %}\n {{ drop_relation_if_exists(preexisting_intermediate_relation) }}\n {{ drop_relation_if_exists(preexisting_backup_relation) }}\n\n {{ run_hooks(pre_hooks, inside_transaction=False) }}\n\n -- `BEGIN` happens here:\n {{ run_hooks(pre_hooks, inside_transaction=True) }}\n\n {% set to_drop = [] %}\n\n {% set incremental_strategy = config.get('incremental_strategy') or 'default' %}\n {% set strategy_sql_macro_func = adapter.get_incremental_strategy_macro(context, incremental_strategy) %}\n\n {% if existing_relation is none %}\n {% set build_sql = get_create_table_as_sql(False, target_relation, sql) %}\n {% set relation_for_indexes = target_relation %}\n {% elif full_refresh_mode %}\n {% set build_sql = get_create_table_as_sql(False, intermediate_relation, sql) %}\n {% set relation_for_indexes = intermediate_relation %}\n {% set need_swap = true %}\n {% else %}\n {% do run_query(get_create_table_as_sql(True, temp_relation, sql)) %}\n {% set relation_for_indexes = temp_relation %}\n {% set contract_config = config.get('contract') %}\n {% if not contract_config or not contract_config.enforced %}\n {% do adapter.expand_target_column_types(\n from_relation=temp_relation,\n to_relation=target_relation) %}\n {% endif %}\n {#-- Process schema changes. Returns dict of changes if successful. Use source columns for upserting/merging --#}\n {% set dest_columns = process_schema_changes(on_schema_change, temp_relation, existing_relation) %}\n {% if not dest_columns %}\n {% set dest_columns = adapter.get_columns_in_relation(existing_relation) %}\n {% endif %}\n\n {#-- Get the incremental_strategy, the macro to use for the strategy, and build the sql --#}\n {% set incremental_predicates = config.get('predicates', none) or config.get('incremental_predicates', none) %}\n {% set strategy_arg_dict = ({'target_relation': target_relation, 'temp_relation': temp_relation, 'unique_key': unique_key, 'dest_columns': dest_columns, 'incremental_predicates': incremental_predicates }) %}\n {% set build_sql = strategy_sql_macro_func(strategy_arg_dict) %}\n\n {% endif %}\n\n {% call statement(\"main\") %}\n {{ build_sql }}\n {% endcall %}\n\n {% if existing_relation is none or existing_relation.is_view or should_full_refresh() %}\n {% do create_indexes(relation_for_indexes) %}\n {% endif %}\n\n {% if need_swap %}\n {% do adapter.rename_relation(target_relation, backup_relation) %}\n {% do adapter.rename_relation(intermediate_relation, target_relation) %}\n {% do to_drop.append(backup_relation) %}\n {% endif %}\n\n {% set should_revoke = should_revoke(existing_relation, full_refresh_mode) %}\n {% do apply_grants(target_relation, grant_config, should_revoke=should_revoke) %}\n\n {% do persist_docs(target_relation, model) %}\n\n {{ run_hooks(post_hooks, inside_transaction=True) }}\n\n -- `COMMIT` happens here\n {% do adapter.commit() %}\n\n {% for rel in to_drop %}\n {% do adapter.drop_relation(rel) %}\n {% endfor %}\n\n {{ run_hooks(post_hooks, inside_transaction=False) }}\n\n {{ return({'relations': [target_relation]}) }}\n\n{%- endmaterialization %}", "depends_on": {"macros": ["macro.dbt.load_cached_relation", "macro.dbt.make_temp_relation", "macro.dbt.make_intermediate_relation", "macro.dbt.make_backup_relation", "macro.dbt.should_full_refresh", "macro.dbt.incremental_validate_on_schema_change", "macro.dbt.drop_relation_if_exists", "macro.dbt.run_hooks", "macro.dbt.get_create_table_as_sql", "macro.dbt.run_query", "macro.dbt.process_schema_changes", "macro.dbt.statement", "macro.dbt.create_indexes", "macro.dbt.should_revoke", "macro.dbt.apply_grants", "macro.dbt.persist_docs"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "supported_languages", "type": null, "description": ""}], "created_at": 1789079002.4362128, "supported_languages": ["sql"]}, "macro.dbt.get_quoted_csv": {"name": "get_quoted_csv", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/column_helpers.sql", "original_file_path": "macros/materializations/models/incremental/column_helpers.sql", "unique_id": "macro.dbt.get_quoted_csv", "macro_sql": "{% macro get_quoted_csv(column_names) %}\n\n {% set quoted = [] %}\n {% for col in column_names -%}\n {%- do quoted.append(adapter.quote(col)) -%}\n {%- endfor %}\n\n {%- set dest_cols_csv = quoted | join(', ') -%}\n {{ return(dest_cols_csv) }}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "column_names", "type": null, "description": ""}], "created_at": 1789079002.4372199, "supported_languages": null}, "macro.dbt.diff_columns": {"name": "diff_columns", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/column_helpers.sql", "original_file_path": "macros/materializations/models/incremental/column_helpers.sql", "unique_id": "macro.dbt.diff_columns", "macro_sql": "{% macro diff_columns(source_columns, target_columns) %}\n\n {% set result = [] %}\n {% set source_names = source_columns | map(attribute = 'column') | list %}\n {% set target_names = target_columns | map(attribute = 'column') | list %}\n\n {# --check whether the name attribute exists in the target - this does not perform a data type check #}\n {% for sc in source_columns %}\n {% if sc.name not in target_names %}\n {{ result.append(sc) }}\n {% endif %}\n {% endfor %}\n\n {{ return(result) }}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "source_columns", "type": null, "description": ""}, {"name": "target_columns", "type": null, "description": ""}], "created_at": 1789079002.437854, "supported_languages": null}, "macro.dbt.diff_column_data_types": {"name": "diff_column_data_types", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/column_helpers.sql", "original_file_path": "macros/materializations/models/incremental/column_helpers.sql", "unique_id": "macro.dbt.diff_column_data_types", "macro_sql": "{% macro diff_column_data_types(source_columns, target_columns) %}\n {{ return(adapter.dispatch('diff_column_data_types', 'dbt')(source_columns, target_columns)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__diff_column_data_types"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "source_columns", "type": null, "description": ""}, {"name": "target_columns", "type": null, "description": ""}], "created_at": 1789079002.438105, "supported_languages": null}, "macro.dbt.default__diff_column_data_types": {"name": "default__diff_column_data_types", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/column_helpers.sql", "original_file_path": "macros/materializations/models/incremental/column_helpers.sql", "unique_id": "macro.dbt.default__diff_column_data_types", "macro_sql": "{% macro default__diff_column_data_types(source_columns, target_columns) %}\n {% set result = [] %}\n {% for sc in source_columns %}\n {% set tc = target_columns | selectattr(\"name\", \"equalto\", sc.name) | list | first %}\n {% if tc %}\n {% if sc.expanded_data_type != tc.expanded_data_type and not sc.can_expand_to(other_column=tc) %}\n {{ result.append( { 'column_name': tc.name, 'new_type': sc.expanded_data_type } ) }}\n {% endif %}\n {% endif %}\n {% endfor %}\n\n {{ return(result) }}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "source_columns", "type": null, "description": ""}, {"name": "target_columns", "type": null, "description": ""}], "created_at": 1789079002.4388213, "supported_languages": null}, "macro.dbt.get_merge_update_columns": {"name": "get_merge_update_columns", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/column_helpers.sql", "original_file_path": "macros/materializations/models/incremental/column_helpers.sql", "unique_id": "macro.dbt.get_merge_update_columns", "macro_sql": "{% macro get_merge_update_columns(merge_update_columns, merge_exclude_columns, dest_columns) %}\n {{ return(adapter.dispatch('get_merge_update_columns', 'dbt')(merge_update_columns, merge_exclude_columns, dest_columns)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_merge_update_columns"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "merge_update_columns", "type": null, "description": ""}, {"name": "merge_exclude_columns", "type": null, "description": ""}, {"name": "dest_columns", "type": null, "description": ""}], "created_at": 1789079002.439103, "supported_languages": null}, "macro.dbt.default__get_merge_update_columns": {"name": "default__get_merge_update_columns", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/column_helpers.sql", "original_file_path": "macros/materializations/models/incremental/column_helpers.sql", "unique_id": "macro.dbt.default__get_merge_update_columns", "macro_sql": "{% macro default__get_merge_update_columns(merge_update_columns, merge_exclude_columns, dest_columns) %}\n {%- set default_cols = dest_columns | map(attribute=\"quoted\") | list -%}\n\n {%- if merge_update_columns and merge_exclude_columns -%}\n {{ exceptions.raise_compiler_error(\n 'Model cannot specify merge_update_columns and merge_exclude_columns. Please update model to use only one config'\n )}}\n {%- elif merge_update_columns -%}\n {%- set update_columns = merge_update_columns -%}\n {%- elif merge_exclude_columns -%}\n {%- set update_columns = [] -%}\n {%- for column in dest_columns -%}\n {% if column.column | lower not in merge_exclude_columns | map(\"lower\") | list %}\n {%- do update_columns.append(column.quoted) -%}\n {% endif %}\n {%- endfor -%}\n {%- else -%}\n {%- set update_columns = default_cols -%}\n {%- endif -%}\n\n {{ return(update_columns) }}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "merge_update_columns", "type": null, "description": ""}, {"name": "merge_exclude_columns", "type": null, "description": ""}, {"name": "dest_columns", "type": null, "description": ""}], "created_at": 1789079002.4399292, "supported_languages": null}, "macro.dbt.get_incremental_append_sql": {"name": "get_incremental_append_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "unique_id": "macro.dbt.get_incremental_append_sql", "macro_sql": "{% macro get_incremental_append_sql(arg_dict) %}\n\n {{ return(adapter.dispatch('get_incremental_append_sql', 'dbt')(arg_dict)) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_incremental_append_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "arg_dict", "type": null, "description": ""}], "created_at": 1789079002.4406548, "supported_languages": null}, "macro.dbt.default__get_incremental_append_sql": {"name": "default__get_incremental_append_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "unique_id": "macro.dbt.default__get_incremental_append_sql", "macro_sql": "{% macro default__get_incremental_append_sql(arg_dict) %}\n\n {% do return(get_insert_into_sql(arg_dict[\"target_relation\"], arg_dict[\"temp_relation\"], arg_dict[\"dest_columns\"])) %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_insert_into_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "arg_dict", "type": null, "description": ""}], "created_at": 1789079002.440939, "supported_languages": null}, "macro.dbt.get_incremental_delete_insert_sql": {"name": "get_incremental_delete_insert_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "unique_id": "macro.dbt.get_incremental_delete_insert_sql", "macro_sql": "{% macro get_incremental_delete_insert_sql(arg_dict) %}\n\n {{ return(adapter.dispatch('get_incremental_delete_insert_sql', 'dbt')(arg_dict)) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_incremental_delete_insert_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "arg_dict", "type": null, "description": ""}], "created_at": 1789079002.4411602, "supported_languages": null}, "macro.dbt.default__get_incremental_delete_insert_sql": {"name": "default__get_incremental_delete_insert_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "unique_id": "macro.dbt.default__get_incremental_delete_insert_sql", "macro_sql": "{% macro default__get_incremental_delete_insert_sql(arg_dict) %}\n\n {% do return(get_delete_insert_merge_sql(arg_dict[\"target_relation\"], arg_dict[\"temp_relation\"], arg_dict[\"unique_key\"], arg_dict[\"dest_columns\"], arg_dict[\"incremental_predicates\"])) %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_delete_insert_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "arg_dict", "type": null, "description": ""}], "created_at": 1789079002.441484, "supported_languages": null}, "macro.dbt.get_incremental_merge_sql": {"name": "get_incremental_merge_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "unique_id": "macro.dbt.get_incremental_merge_sql", "macro_sql": "{% macro get_incremental_merge_sql(arg_dict) %}\n\n {{ return(adapter.dispatch('get_incremental_merge_sql', 'dbt')(arg_dict)) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_incremental_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "arg_dict", "type": null, "description": ""}], "created_at": 1789079002.4416997, "supported_languages": null}, "macro.dbt.default__get_incremental_merge_sql": {"name": "default__get_incremental_merge_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "unique_id": "macro.dbt.default__get_incremental_merge_sql", "macro_sql": "{% macro default__get_incremental_merge_sql(arg_dict) %}\n\n {% do return(get_merge_sql(arg_dict[\"target_relation\"], arg_dict[\"temp_relation\"], arg_dict[\"unique_key\"], arg_dict[\"dest_columns\"], arg_dict[\"incremental_predicates\"])) %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "arg_dict", "type": null, "description": ""}], "created_at": 1789079002.4420376, "supported_languages": null}, "macro.dbt.get_incremental_insert_overwrite_sql": {"name": "get_incremental_insert_overwrite_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "unique_id": "macro.dbt.get_incremental_insert_overwrite_sql", "macro_sql": "{% macro get_incremental_insert_overwrite_sql(arg_dict) %}\n\n {{ return(adapter.dispatch('get_incremental_insert_overwrite_sql', 'dbt')(arg_dict)) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_incremental_insert_overwrite_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "arg_dict", "type": null, "description": ""}], "created_at": 1789079002.4422526, "supported_languages": null}, "macro.dbt.default__get_incremental_insert_overwrite_sql": {"name": "default__get_incremental_insert_overwrite_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "unique_id": "macro.dbt.default__get_incremental_insert_overwrite_sql", "macro_sql": "{% macro default__get_incremental_insert_overwrite_sql(arg_dict) %}\n\n {% do return(get_insert_overwrite_merge_sql(arg_dict[\"target_relation\"], arg_dict[\"temp_relation\"], arg_dict[\"dest_columns\"], arg_dict[\"incremental_predicates\"])) %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_insert_overwrite_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "arg_dict", "type": null, "description": ""}], "created_at": 1789079002.442622, "supported_languages": null}, "macro.dbt.get_incremental_default_sql": {"name": "get_incremental_default_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "unique_id": "macro.dbt.get_incremental_default_sql", "macro_sql": "{% macro get_incremental_default_sql(arg_dict) %}\n\n {{ return(adapter.dispatch('get_incremental_default_sql', 'dbt')(arg_dict)) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__get_incremental_default_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "arg_dict", "type": null, "description": ""}], "created_at": 1789079002.4428341, "supported_languages": null}, "macro.dbt.default__get_incremental_default_sql": {"name": "default__get_incremental_default_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "unique_id": "macro.dbt.default__get_incremental_default_sql", "macro_sql": "{% macro default__get_incremental_default_sql(arg_dict) %}\n\n {% do return(get_incremental_append_sql(arg_dict)) %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_incremental_append_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "arg_dict", "type": null, "description": ""}], "created_at": 1789079002.4430218, "supported_languages": null}, "macro.dbt.get_incremental_microbatch_sql": {"name": "get_incremental_microbatch_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "unique_id": "macro.dbt.get_incremental_microbatch_sql", "macro_sql": "{% macro get_incremental_microbatch_sql(arg_dict) %}\n\n {{ return(adapter.dispatch('get_incremental_microbatch_sql', 'dbt')(arg_dict)) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__get_incremental_microbatch_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "arg_dict", "type": null, "description": ""}], "created_at": 1789079002.4432294, "supported_languages": null}, "macro.dbt.default__get_incremental_microbatch_sql": {"name": "default__get_incremental_microbatch_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "unique_id": "macro.dbt.default__get_incremental_microbatch_sql", "macro_sql": "{% macro default__get_incremental_microbatch_sql(arg_dict) %}\n\n {{ exceptions.raise_not_implemented('microbatch materialization strategy not implemented for adapter ' + adapter.type()) }}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "arg_dict", "type": null, "description": ""}], "created_at": 1789079002.4434178, "supported_languages": null}, "macro.dbt.get_insert_into_sql": {"name": "get_insert_into_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "unique_id": "macro.dbt.get_insert_into_sql", "macro_sql": "{% macro get_insert_into_sql(target_relation, temp_relation, dest_columns) %}\n\n {%- set dest_cols_csv = get_quoted_csv(dest_columns | map(attribute=\"name\")) -%}\n\n insert into {{ target_relation }} ({{ dest_cols_csv }})\n (\n select {{ dest_cols_csv }}\n from {{ temp_relation }}\n )\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_quoted_csv"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "target_relation", "type": null, "description": ""}, {"name": "temp_relation", "type": null, "description": ""}, {"name": "dest_columns", "type": null, "description": ""}], "created_at": 1789079002.443732, "supported_languages": null}, "macro.dbt.incremental_validate_on_schema_change": {"name": "incremental_validate_on_schema_change", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/on_schema_change.sql", "original_file_path": "macros/materializations/models/incremental/on_schema_change.sql", "unique_id": "macro.dbt.incremental_validate_on_schema_change", "macro_sql": "{% macro incremental_validate_on_schema_change(on_schema_change, default='ignore') %}\n\n {% if on_schema_change not in ['sync_all_columns', 'append_new_columns', 'fail', 'ignore'] %}\n\n {% set log_message = 'Invalid value for on_schema_change (%s) specified. Setting default value of %s.' % (on_schema_change, default) %}\n {% do log(log_message) %}\n\n {{ return(default) }}\n\n {% else %}\n\n {{ return(on_schema_change) }}\n\n {% endif %}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "on_schema_change", "type": null, "description": ""}, {"name": "default", "type": null, "description": ""}], "created_at": 1789079002.44526, "supported_languages": null}, "macro.dbt.check_for_schema_changes": {"name": "check_for_schema_changes", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/on_schema_change.sql", "original_file_path": "macros/materializations/models/incremental/on_schema_change.sql", "unique_id": "macro.dbt.check_for_schema_changes", "macro_sql": "{% macro check_for_schema_changes(source_relation, target_relation) %}\n {{ return(adapter.dispatch('check_for_schema_changes', 'dbt')(source_relation, target_relation)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__check_for_schema_changes"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "source_relation", "type": null, "description": ""}, {"name": "target_relation", "type": null, "description": ""}], "created_at": 1789079002.4455228, "supported_languages": null}, "macro.dbt.default__check_for_schema_changes": {"name": "default__check_for_schema_changes", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/on_schema_change.sql", "original_file_path": "macros/materializations/models/incremental/on_schema_change.sql", "unique_id": "macro.dbt.default__check_for_schema_changes", "macro_sql": "{% macro default__check_for_schema_changes(source_relation, target_relation) %}\n\n {% set schema_changed = False %}\n\n {%- set source_columns = adapter.get_columns_in_relation(source_relation) -%}\n {%- set target_columns = adapter.get_columns_in_relation(target_relation) -%}\n {%- set source_not_in_target = diff_columns(source_columns, target_columns) -%}\n {%- set target_not_in_source = diff_columns(target_columns, source_columns) -%}\n\n {% set new_target_types = diff_column_data_types(source_columns, target_columns) %}\n\n {% if source_not_in_target != [] %}\n {% set schema_changed = True %}\n {% elif target_not_in_source != [] or new_target_types != [] %}\n {% set schema_changed = True %}\n {% elif new_target_types != [] %}\n {% set schema_changed = True %}\n {% endif %}\n\n {% set changes_dict = {\n 'schema_changed': schema_changed,\n 'source_not_in_target': source_not_in_target,\n 'target_not_in_source': target_not_in_source,\n 'source_columns': source_columns,\n 'target_columns': target_columns,\n 'new_target_types': new_target_types\n } %}\n\n {% set msg %}\n In {{ target_relation }}:\n Schema changed: {{ schema_changed }}\n Source columns not in target: {{ source_not_in_target }}\n Target columns not in source: {{ target_not_in_source }}\n New column types: {{ new_target_types }}\n {% endset %}\n\n {% do log(msg) %}\n\n {{ return(changes_dict) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.diff_columns", "macro.dbt.diff_column_data_types"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "source_relation", "type": null, "description": ""}, {"name": "target_relation", "type": null, "description": ""}], "created_at": 1789079002.4468977, "supported_languages": null}, "macro.dbt.sync_column_schemas": {"name": "sync_column_schemas", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/on_schema_change.sql", "original_file_path": "macros/materializations/models/incremental/on_schema_change.sql", "unique_id": "macro.dbt.sync_column_schemas", "macro_sql": "{% macro sync_column_schemas(on_schema_change, target_relation, schema_changes_dict) %}\n {{ return(adapter.dispatch('sync_column_schemas', 'dbt')(on_schema_change, target_relation, schema_changes_dict)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__sync_column_schemas"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "on_schema_change", "type": null, "description": ""}, {"name": "target_relation", "type": null, "description": ""}, {"name": "schema_changes_dict", "type": null, "description": ""}], "created_at": 1789079002.4471827, "supported_languages": null}, "macro.dbt.default__sync_column_schemas": {"name": "default__sync_column_schemas", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/on_schema_change.sql", "original_file_path": "macros/materializations/models/incremental/on_schema_change.sql", "unique_id": "macro.dbt.default__sync_column_schemas", "macro_sql": "{% macro default__sync_column_schemas(on_schema_change, target_relation, schema_changes_dict) %}\n\n {%- set add_to_target_arr = schema_changes_dict['source_not_in_target'] -%}\n {%- set remove_from_target_arr = schema_changes_dict['target_not_in_source'] -%}\n {%- set new_target_types = schema_changes_dict['new_target_types'] -%}\n\n {%- if on_schema_change == 'append_new_columns'-%}\n {%- if add_to_target_arr | length > 0 -%}\n {%- do alter_relation_add_remove_columns(target_relation, add_to_target_arr, none) -%}\n {%- endif -%}\n\n {% elif on_schema_change == 'sync_all_columns' %}\n\n {% if add_to_target_arr | length > 0 or remove_from_target_arr | length > 0 %}\n {%- do alter_relation_add_remove_columns(target_relation, add_to_target_arr, remove_from_target_arr) -%}\n {% endif %}\n\n {% if new_target_types != [] %}\n {% for ntt in new_target_types %}\n {% set column_name = ntt['column_name'] %}\n {% set new_type = ntt['new_type'] %}\n {% do alter_column_type(target_relation, column_name, new_type) %}\n {% endfor %}\n {% endif %}\n\n {% endif %}\n\n {% set schema_change_message %}\n In {{ target_relation }}:\n Schema change approach: {{ on_schema_change }}\n Columns added: {{ add_to_target_arr }}\n Columns removed: {{ remove_from_target_arr }}\n Data types changed: {{ new_target_types }}\n {% endset %}\n\n {% do log(schema_change_message) %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.alter_relation_add_remove_columns", "macro.dbt.alter_column_type"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "on_schema_change", "type": null, "description": ""}, {"name": "target_relation", "type": null, "description": ""}, {"name": "schema_changes_dict", "type": null, "description": ""}], "created_at": 1789079002.4485164, "supported_languages": null}, "macro.dbt.process_schema_changes": {"name": "process_schema_changes", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/on_schema_change.sql", "original_file_path": "macros/materializations/models/incremental/on_schema_change.sql", "unique_id": "macro.dbt.process_schema_changes", "macro_sql": "{% macro process_schema_changes(on_schema_change, source_relation, target_relation) %}\n {{ return(adapter.dispatch('process_schema_changes', 'dbt')(on_schema_change, source_relation, target_relation)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__process_schema_changes"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "on_schema_change", "type": null, "description": ""}, {"name": "source_relation", "type": null, "description": ""}, {"name": "target_relation", "type": null, "description": ""}], "created_at": 1789079002.448906, "supported_languages": null}, "macro.dbt.default__process_schema_changes": {"name": "default__process_schema_changes", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/on_schema_change.sql", "original_file_path": "macros/materializations/models/incremental/on_schema_change.sql", "unique_id": "macro.dbt.default__process_schema_changes", "macro_sql": "{% macro default__process_schema_changes(on_schema_change, source_relation, target_relation) %}\n\n {% if on_schema_change == 'ignore' %}\n\n {{ return({}) }}\n\n {% else %}\n\n {% set schema_changes_dict = check_for_schema_changes(source_relation, target_relation) %}\n\n {% if schema_changes_dict['schema_changed'] %}\n\n {% if on_schema_change == 'fail' %}\n\n {% set fail_msg %}\n The source and target schemas on this incremental model are out of sync!\n They can be reconciled in several ways:\n - set the `on_schema_change` config to either append_new_columns or sync_all_columns, depending on your situation.\n - Re-run the incremental model with `full_refresh: True` to update the target schema.\n - update the schema manually and re-run the process.\n\n Additional troubleshooting context:\n Source columns not in target: {{ schema_changes_dict['source_not_in_target'] }}\n Target columns not in source: {{ schema_changes_dict['target_not_in_source'] }}\n New column types: {{ schema_changes_dict['new_target_types'] }}\n {% endset %}\n\n {% do exceptions.raise_compiler_error(fail_msg) %}\n\n {# -- unless we ignore, run the sync operation per the config #}\n {% else %}\n\n {% do sync_column_schemas(on_schema_change, target_relation, schema_changes_dict) %}\n\n {% endif %}\n\n {% endif %}\n\n {{ return(schema_changes_dict['source_columns']) }}\n\n {% endif %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.check_for_schema_changes", "macro.dbt.sync_column_schemas"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "on_schema_change", "type": null, "description": ""}, {"name": "source_relation", "type": null, "description": ""}, {"name": "target_relation", "type": null, "description": ""}], "created_at": 1789079002.4498558, "supported_languages": null}, "macro.dbt.get_merge_sql": {"name": "get_merge_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/merge.sql", "original_file_path": "macros/materializations/models/incremental/merge.sql", "unique_id": "macro.dbt.get_merge_sql", "macro_sql": "{% macro get_merge_sql(target, source, unique_key, dest_columns, incremental_predicates=none) -%}\n -- back compat for old kwarg name\n {% set incremental_predicates = kwargs.get('predicates', incremental_predicates) %}\n {{ adapter.dispatch('get_merge_sql', 'dbt')(target, source, unique_key, dest_columns, incremental_predicates) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "target", "type": null, "description": ""}, {"name": "source", "type": null, "description": ""}, {"name": "unique_key", "type": null, "description": ""}, {"name": "dest_columns", "type": null, "description": ""}, {"name": "incremental_predicates", "type": null, "description": ""}], "created_at": 1789079002.4511206, "supported_languages": null}, "macro.dbt.get_merge_unique_key_match": {"name": "get_merge_unique_key_match", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/merge.sql", "original_file_path": "macros/materializations/models/incremental/merge.sql", "unique_id": "macro.dbt.get_merge_unique_key_match", "macro_sql": "{% macro get_merge_unique_key_match(source_unique_key, target_unique_key) %}\n {{ return(adapter.dispatch('get_merge_unique_key_match', 'dbt')(source_unique_key, target_unique_key)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_merge_unique_key_match"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "source_unique_key", "type": null, "description": ""}, {"name": "target_unique_key", "type": null, "description": ""}], "created_at": 1789079002.451369, "supported_languages": null}, "macro.dbt.default__get_merge_unique_key_match": {"name": "default__get_merge_unique_key_match", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/merge.sql", "original_file_path": "macros/materializations/models/incremental/merge.sql", "unique_id": "macro.dbt.default__get_merge_unique_key_match", "macro_sql": "{% macro default__get_merge_unique_key_match(source_unique_key, target_unique_key) -%}\n {{ return(equals(source_unique_key, target_unique_key) | trim) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.equals"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "source_unique_key", "type": null, "description": ""}, {"name": "target_unique_key", "type": null, "description": ""}], "created_at": 1789079002.451568, "supported_languages": null}, "macro.dbt.default__get_merge_sql": {"name": "default__get_merge_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/merge.sql", "original_file_path": "macros/materializations/models/incremental/merge.sql", "unique_id": "macro.dbt.default__get_merge_sql", "macro_sql": "{% macro default__get_merge_sql(target, source, unique_key, dest_columns, incremental_predicates=none) -%}\n {%- set predicates = [] if incremental_predicates is none else [] + incremental_predicates -%}\n {%- set dest_cols_csv = get_quoted_csv(dest_columns | map(attribute=\"name\")) -%}\n {%- set merge_update_columns = config.get('merge_update_columns') -%}\n {%- set merge_exclude_columns = config.get('merge_exclude_columns') -%}\n {%- set update_columns = get_merge_update_columns(merge_update_columns, merge_exclude_columns, dest_columns) -%}\n {%- set sql_header = config.get('sql_header', none) -%}\n\n {% if unique_key %}\n {% if unique_key is sequence and unique_key is not mapping and unique_key is not string %}\n {% for key in unique_key %}\n {% set this_key_match %}\n DBT_INTERNAL_SOURCE.{{ key }} = DBT_INTERNAL_DEST.{{ key }}\n {% endset %}\n {% do predicates.append(this_key_match) %}\n {% endfor %}\n {% else %}\n {% set source_unique_key = (\"DBT_INTERNAL_SOURCE.\" ~ unique_key) | trim %}\n {% set target_unique_key = (\"DBT_INTERNAL_DEST.\" ~ unique_key) | trim %}\n {% set unique_key_match = get_merge_unique_key_match(source_unique_key, target_unique_key) %}\n {% do predicates.append(unique_key_match) %}\n {% endif %}\n {% else %}\n {% do predicates.append('FALSE') %}\n {% endif %}\n\n {{ sql_header if sql_header is not none }}\n\n merge into {{ target }} as DBT_INTERNAL_DEST\n using {{ source }} as DBT_INTERNAL_SOURCE\n on {{\"(\" ~ predicates | join(\") and (\") ~ \")\"}}\n\n {% if unique_key %}\n when matched then update set\n {% for column_name in update_columns -%}\n {{ column_name }} = DBT_INTERNAL_SOURCE.{{ column_name }}\n {%- if not loop.last %}, {%- endif %}\n {%- endfor %}\n {% endif %}\n\n when not matched then insert\n ({{ dest_cols_csv }})\n values\n ({{ dest_cols_csv }})\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_quoted_csv", "macro.dbt.get_merge_update_columns", "macro.dbt.get_merge_unique_key_match"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "target", "type": null, "description": ""}, {"name": "source", "type": null, "description": ""}, {"name": "unique_key", "type": null, "description": ""}, {"name": "dest_columns", "type": null, "description": ""}, {"name": "incremental_predicates", "type": null, "description": ""}], "created_at": 1789079002.4534802, "supported_languages": null}, "macro.dbt.get_delete_insert_merge_sql": {"name": "get_delete_insert_merge_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/merge.sql", "original_file_path": "macros/materializations/models/incremental/merge.sql", "unique_id": "macro.dbt.get_delete_insert_merge_sql", "macro_sql": "{% macro get_delete_insert_merge_sql(target, source, unique_key, dest_columns, incremental_predicates) -%}\n {{ adapter.dispatch('get_delete_insert_merge_sql', 'dbt')(target, source, unique_key, dest_columns, incremental_predicates) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_delete_insert_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "target", "type": null, "description": ""}, {"name": "source", "type": null, "description": ""}, {"name": "unique_key", "type": null, "description": ""}, {"name": "dest_columns", "type": null, "description": ""}, {"name": "incremental_predicates", "type": null, "description": ""}], "created_at": 1789079002.4537852, "supported_languages": null}, "macro.dbt.default__get_delete_insert_merge_sql": {"name": "default__get_delete_insert_merge_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/merge.sql", "original_file_path": "macros/materializations/models/incremental/merge.sql", "unique_id": "macro.dbt.default__get_delete_insert_merge_sql", "macro_sql": "{% macro default__get_delete_insert_merge_sql(target, source, unique_key, dest_columns, incremental_predicates) -%}\n\n {%- set dest_cols_csv = get_quoted_csv(dest_columns | map(attribute=\"name\")) -%}\n\n {% if unique_key %}\n {% if unique_key is string %}\n {% set unique_key = [unique_key] %}\n {% endif %}\n\n {%- set unique_key_str = unique_key|join(', ') -%}\n\n delete from {{ target }} as DBT_INTERNAL_DEST\n where ({{ unique_key_str }}) in (\n select distinct {{ unique_key_str }}\n from {{ source }} as DBT_INTERNAL_SOURCE\n )\n {%- if incremental_predicates %}\n {% for predicate in incremental_predicates %}\n and {{ predicate }}\n {% endfor %}\n {%- endif -%};\n\n {% endif %}\n\n insert into {{ target }} ({{ dest_cols_csv }})\n (\n select {{ dest_cols_csv }}\n from {{ source }}\n )\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.get_quoted_csv"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "target", "type": null, "description": ""}, {"name": "source", "type": null, "description": ""}, {"name": "unique_key", "type": null, "description": ""}, {"name": "dest_columns", "type": null, "description": ""}, {"name": "incremental_predicates", "type": null, "description": ""}], "created_at": 1789079002.4546173, "supported_languages": null}, "macro.dbt.get_insert_overwrite_merge_sql": {"name": "get_insert_overwrite_merge_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/merge.sql", "original_file_path": "macros/materializations/models/incremental/merge.sql", "unique_id": "macro.dbt.get_insert_overwrite_merge_sql", "macro_sql": "{% macro get_insert_overwrite_merge_sql(target, source, dest_columns, predicates, include_sql_header=false) -%}\n {{ adapter.dispatch('get_insert_overwrite_merge_sql', 'dbt')(target, source, dest_columns, predicates, include_sql_header) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_insert_overwrite_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "target", "type": null, "description": ""}, {"name": "source", "type": null, "description": ""}, {"name": "dest_columns", "type": null, "description": ""}, {"name": "predicates", "type": null, "description": ""}, {"name": "include_sql_header", "type": null, "description": ""}], "created_at": 1789079002.4549224, "supported_languages": null}, "macro.dbt.default__get_insert_overwrite_merge_sql": {"name": "default__get_insert_overwrite_merge_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/merge.sql", "original_file_path": "macros/materializations/models/incremental/merge.sql", "unique_id": "macro.dbt.default__get_insert_overwrite_merge_sql", "macro_sql": "{% macro default__get_insert_overwrite_merge_sql(target, source, dest_columns, predicates, include_sql_header) -%}\n {#-- The only time include_sql_header is True: --#}\n {#-- BigQuery + insert_overwrite strategy + \"static\" partitions config --#}\n {#-- We should consider including the sql header at the materialization level instead --#}\n\n {%- set predicates = [] if predicates is none else [] + predicates -%}\n {%- set dest_cols_csv = get_quoted_csv(dest_columns | map(attribute=\"name\")) -%}\n {%- set sql_header = config.get('sql_header', none) -%}\n\n {{ sql_header if sql_header is not none and include_sql_header }}\n\n merge into {{ target }} as DBT_INTERNAL_DEST\n using {{ source }} as DBT_INTERNAL_SOURCE\n on FALSE\n\n when not matched by source\n {% if predicates %} and {{ predicates | join(' and ') }} {% endif %}\n then delete\n\n when not matched then insert\n ({{ dest_cols_csv }})\n values\n ({{ dest_cols_csv }})\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_quoted_csv"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "target", "type": null, "description": ""}, {"name": "source", "type": null, "description": ""}, {"name": "dest_columns", "type": null, "description": ""}, {"name": "predicates", "type": null, "description": ""}, {"name": "include_sql_header", "type": null, "description": ""}], "created_at": 1789079002.4556448, "supported_languages": null}, "macro.dbt.is_incremental": {"name": "is_incremental", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/is_incremental.sql", "original_file_path": "macros/materializations/models/incremental/is_incremental.sql", "unique_id": "macro.dbt.is_incremental", "macro_sql": "{% macro is_incremental() %}\n {#-- do not run introspective queries in parsing #}\n {% if not execute %}\n {{ return(False) }}\n {% else %}\n {% set relation = adapter.get_relation(this.database, this.schema, this.table) %}\n {{ return(relation is not none\n and relation.type == 'table'\n and model.config.materialized == 'incremental'\n and not should_full_refresh()) }}\n {% endif %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.should_full_refresh"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789079002.456344, "supported_languages": null}, "macro.dbt.date": {"name": "date", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/date.sql", "original_file_path": "macros/utils/date.sql", "unique_id": "macro.dbt.date", "macro_sql": "{% macro date(year, month, day) %}\n {{ return(adapter.dispatch('date', 'dbt') (year, month, day)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__date"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "year", "type": null, "description": ""}, {"name": "month", "type": null, "description": ""}, {"name": "day", "type": null, "description": ""}], "created_at": 1789079002.4567199, "supported_languages": null}, "macro.dbt.default__date": {"name": "default__date", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/date.sql", "original_file_path": "macros/utils/date.sql", "unique_id": "macro.dbt.default__date", "macro_sql": "{% macro default__date(year, month, day) -%}\n {%- set dt = modules.datetime.date(year, month, day) -%}\n {%- set iso_8601_formatted_date = dt.strftime('%Y-%m-%d') -%}\n to_date('{{ iso_8601_formatted_date }}', 'YYYY-MM-DD')\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "year", "type": null, "description": ""}, {"name": "month", "type": null, "description": ""}, {"name": "day", "type": null, "description": ""}], "created_at": 1789079002.4571254, "supported_languages": null}, "macro.dbt.safe_cast": {"name": "safe_cast", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/safe_cast.sql", "original_file_path": "macros/utils/safe_cast.sql", "unique_id": "macro.dbt.safe_cast", "macro_sql": "{% macro safe_cast(field, type) %}\n {{ return(adapter.dispatch('safe_cast', 'dbt') (field, type)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__safe_cast"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field", "type": null, "description": ""}, {"name": "type", "type": null, "description": ""}], "created_at": 1789079002.4574938, "supported_languages": null}, "macro.dbt.default__safe_cast": {"name": "default__safe_cast", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/safe_cast.sql", "original_file_path": "macros/utils/safe_cast.sql", "unique_id": "macro.dbt.default__safe_cast", "macro_sql": "{% macro default__safe_cast(field, type) %}\n {# most databases don't support this function yet\n so we just need to use cast #}\n cast({{field}} as {{type}})\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field", "type": null, "description": ""}, {"name": "type", "type": null, "description": ""}], "created_at": 1789079002.4576626, "supported_languages": null}, "macro.dbt.array_concat": {"name": "array_concat", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/array_concat.sql", "original_file_path": "macros/utils/array_concat.sql", "unique_id": "macro.dbt.array_concat", "macro_sql": "{% macro array_concat(array_1, array_2) -%}\n {{ return(adapter.dispatch('array_concat', 'dbt')(array_1, array_2)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__array_concat"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "array_1", "type": null, "description": ""}, {"name": "array_2", "type": null, "description": ""}], "created_at": 1789079002.458088, "supported_languages": null}, "macro.dbt.default__array_concat": {"name": "default__array_concat", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/array_concat.sql", "original_file_path": "macros/utils/array_concat.sql", "unique_id": "macro.dbt.default__array_concat", "macro_sql": "{% macro default__array_concat(array_1, array_2) -%}\n array_cat({{ array_1 }}, {{ array_2 }})\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "array_1", "type": null, "description": ""}, {"name": "array_2", "type": null, "description": ""}], "created_at": 1789079002.4582636, "supported_languages": null}, "macro.dbt.escape_single_quotes": {"name": "escape_single_quotes", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/escape_single_quotes.sql", "original_file_path": "macros/utils/escape_single_quotes.sql", "unique_id": "macro.dbt.escape_single_quotes", "macro_sql": "{% macro escape_single_quotes(expression) %}\n {{ return(adapter.dispatch('escape_single_quotes', 'dbt') (expression)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__escape_single_quotes"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "expression", "type": null, "description": ""}], "created_at": 1789079002.4585736, "supported_languages": null}, "macro.dbt.default__escape_single_quotes": {"name": "default__escape_single_quotes", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/escape_single_quotes.sql", "original_file_path": "macros/utils/escape_single_quotes.sql", "unique_id": "macro.dbt.default__escape_single_quotes", "macro_sql": "{% macro default__escape_single_quotes(expression) -%}\n{{ expression | replace(\"'\",\"''\") }}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "expression", "type": null, "description": ""}], "created_at": 1789079002.4587443, "supported_languages": null}, "macro.dbt.type_string": {"name": "type_string", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "unique_id": "macro.dbt.type_string", "macro_sql": "\n\n{%- macro type_string() -%}\n {{ return(adapter.dispatch('type_string', 'dbt')()) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt.default__type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789079002.4595191, "supported_languages": null}, "macro.dbt.default__type_string": {"name": "default__type_string", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "unique_id": "macro.dbt.default__type_string", "macro_sql": "{% macro default__type_string() %}\n {{ return(api.Column.translate_type(\"string\")) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789079002.4596999, "supported_languages": null}, "macro.dbt.type_timestamp": {"name": "type_timestamp", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "unique_id": "macro.dbt.type_timestamp", "macro_sql": "\n\n{%- macro type_timestamp() -%}\n {{ return(adapter.dispatch('type_timestamp', 'dbt')()) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt.default__type_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789079002.4599044, "supported_languages": null}, "macro.dbt.default__type_timestamp": {"name": "default__type_timestamp", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "unique_id": "macro.dbt.default__type_timestamp", "macro_sql": "{% macro default__type_timestamp() %}\n {{ return(api.Column.translate_type(\"timestamp\")) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789079002.4600813, "supported_languages": null}, "macro.dbt.type_float": {"name": "type_float", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "unique_id": "macro.dbt.type_float", "macro_sql": "\n\n{%- macro type_float() -%}\n {{ return(adapter.dispatch('type_float', 'dbt')()) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt.default__type_float"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789079002.4602618, "supported_languages": null}, "macro.dbt.default__type_float": {"name": "default__type_float", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "unique_id": "macro.dbt.default__type_float", "macro_sql": "{% macro default__type_float() %}\n {{ return(api.Column.translate_type(\"float\")) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789079002.460434, "supported_languages": null}, "macro.dbt.type_numeric": {"name": "type_numeric", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "unique_id": "macro.dbt.type_numeric", "macro_sql": "\n\n{%- macro type_numeric() -%}\n {{ return(adapter.dispatch('type_numeric', 'dbt')()) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt.default__type_numeric"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789079002.460614, "supported_languages": null}, "macro.dbt.default__type_numeric": {"name": "default__type_numeric", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "unique_id": "macro.dbt.default__type_numeric", "macro_sql": "{% macro default__type_numeric() %}\n {{ return(api.Column.numeric_type(\"numeric\", 28, 6)) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789079002.4608138, "supported_languages": null}, "macro.dbt.type_bigint": {"name": "type_bigint", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "unique_id": "macro.dbt.type_bigint", "macro_sql": "\n\n{%- macro type_bigint() -%}\n {{ return(adapter.dispatch('type_bigint', 'dbt')()) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt.default__type_bigint"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789079002.4610393, "supported_languages": null}, "macro.dbt.default__type_bigint": {"name": "default__type_bigint", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "unique_id": "macro.dbt.default__type_bigint", "macro_sql": "{% macro default__type_bigint() %}\n {{ return(api.Column.translate_type(\"bigint\")) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789079002.461235, "supported_languages": null}, "macro.dbt.type_int": {"name": "type_int", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "unique_id": "macro.dbt.type_int", "macro_sql": "\n\n{%- macro type_int() -%}\n {{ return(adapter.dispatch('type_int', 'dbt')()) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt.default__type_int"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789079002.4614277, "supported_languages": null}, "macro.dbt.default__type_int": {"name": "default__type_int", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "unique_id": "macro.dbt.default__type_int", "macro_sql": "{%- macro default__type_int() -%}\n {{ return(api.Column.translate_type(\"integer\")) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789079002.461596, "supported_languages": null}, "macro.dbt.type_boolean": {"name": "type_boolean", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "unique_id": "macro.dbt.type_boolean", "macro_sql": "\n\n{%- macro type_boolean() -%}\n {{ return(adapter.dispatch('type_boolean', 'dbt')()) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt.default__type_boolean"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789079002.4618785, "supported_languages": null}, "macro.dbt.default__type_boolean": {"name": "default__type_boolean", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "unique_id": "macro.dbt.default__type_boolean", "macro_sql": "{%- macro default__type_boolean() -%}\n {{ return(api.Column.translate_type(\"boolean\")) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789079002.4620564, "supported_languages": null}, "macro.dbt.array_append": {"name": "array_append", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/array_append.sql", "original_file_path": "macros/utils/array_append.sql", "unique_id": "macro.dbt.array_append", "macro_sql": "{% macro array_append(array, new_element) -%}\n {{ return(adapter.dispatch('array_append', 'dbt')(array, new_element)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__array_append"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "array", "type": null, "description": ""}, {"name": "new_element", "type": null, "description": ""}], "created_at": 1789079002.4623775, "supported_languages": null}, "macro.dbt.default__array_append": {"name": "default__array_append", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/array_append.sql", "original_file_path": "macros/utils/array_append.sql", "unique_id": "macro.dbt.default__array_append", "macro_sql": "{% macro default__array_append(array, new_element) -%}\n array_append({{ array }}, {{ new_element }})\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "array", "type": null, "description": ""}, {"name": "new_element", "type": null, "description": ""}], "created_at": 1789079002.4625401, "supported_languages": null}, "macro.dbt.get_powers_of_two": {"name": "get_powers_of_two", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/generate_series.sql", "original_file_path": "macros/utils/generate_series.sql", "unique_id": "macro.dbt.get_powers_of_two", "macro_sql": "{% macro get_powers_of_two(upper_bound) %}\n {{ return(adapter.dispatch('get_powers_of_two', 'dbt')(upper_bound)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_powers_of_two"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "upper_bound", "type": null, "description": ""}], "created_at": 1789079002.4630446, "supported_languages": null}, "macro.dbt.default__get_powers_of_two": {"name": "default__get_powers_of_two", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/generate_series.sql", "original_file_path": "macros/utils/generate_series.sql", "unique_id": "macro.dbt.default__get_powers_of_two", "macro_sql": "{% macro default__get_powers_of_two(upper_bound) %}\n\n {% if upper_bound <= 0 %}\n {{ exceptions.raise_compiler_error(\"upper bound must be positive\") }}\n {% endif %}\n\n {% for _ in range(1, 100) %}\n {% if upper_bound <= 2 ** loop.index %}{{ return(loop.index) }}{% endif %}\n {% endfor %}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "upper_bound", "type": null, "description": ""}], "created_at": 1789079002.4635308, "supported_languages": null}, "macro.dbt.generate_series": {"name": "generate_series", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/generate_series.sql", "original_file_path": "macros/utils/generate_series.sql", "unique_id": "macro.dbt.generate_series", "macro_sql": "{% macro generate_series(upper_bound) %}\n {{ return(adapter.dispatch('generate_series', 'dbt')(upper_bound)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__generate_series"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "upper_bound", "type": null, "description": ""}], "created_at": 1789079002.4637523, "supported_languages": null}, "macro.dbt.default__generate_series": {"name": "default__generate_series", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/generate_series.sql", "original_file_path": "macros/utils/generate_series.sql", "unique_id": "macro.dbt.default__generate_series", "macro_sql": "{% macro default__generate_series(upper_bound) %}\n\n {% set n = dbt.get_powers_of_two(upper_bound) %}\n\n with p as (\n select 0 as generated_number union all select 1\n ), unioned as (\n\n select\n\n {% for i in range(n) %}\n p{{i}}.generated_number * power(2, {{i}})\n {% if not loop.last %} + {% endif %}\n {% endfor %}\n + 1\n as generated_number\n\n from\n\n {% for i in range(n) %}\n p as p{{i}}\n {% if not loop.last %} cross join {% endif %}\n {% endfor %}\n\n )\n\n select *\n from unioned\n where generated_number <= {{upper_bound}}\n order by generated_number\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_powers_of_two"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "upper_bound", "type": null, "description": ""}], "created_at": 1789079002.464358, "supported_languages": null}, "macro.dbt.right": {"name": "right", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/right.sql", "original_file_path": "macros/utils/right.sql", "unique_id": "macro.dbt.right", "macro_sql": "{% macro right(string_text, length_expression) -%}\n {{ return(adapter.dispatch('right', 'dbt') (string_text, length_expression)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__right"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "string_text", "type": null, "description": ""}, {"name": "length_expression", "type": null, "description": ""}], "created_at": 1789079002.464685, "supported_languages": null}, "macro.dbt.default__right": {"name": "default__right", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/right.sql", "original_file_path": "macros/utils/right.sql", "unique_id": "macro.dbt.default__right", "macro_sql": "{% macro default__right(string_text, length_expression) %}\n\n right(\n {{ string_text }},\n {{ length_expression }}\n )\n\n{%- endmacro -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "string_text", "type": null, "description": ""}, {"name": "length_expression", "type": null, "description": ""}], "created_at": 1789079002.464867, "supported_languages": null}, "macro.dbt.hash": {"name": "hash", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/hash.sql", "original_file_path": "macros/utils/hash.sql", "unique_id": "macro.dbt.hash", "macro_sql": "{% macro hash(field) -%}\n {{ return(adapter.dispatch('hash', 'dbt') (field)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__hash"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field", "type": null, "description": ""}], "created_at": 1789079002.4651608, "supported_languages": null}, "macro.dbt.default__hash": {"name": "default__hash", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/hash.sql", "original_file_path": "macros/utils/hash.sql", "unique_id": "macro.dbt.default__hash", "macro_sql": "{% macro default__hash(field) -%}\n md5(cast({{ field }} as {{ api.Column.translate_type('string') }}))\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field", "type": null, "description": ""}], "created_at": 1789079002.4653463, "supported_languages": null}, "macro.dbt.intersect": {"name": "intersect", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/intersect.sql", "original_file_path": "macros/utils/intersect.sql", "unique_id": "macro.dbt.intersect", "macro_sql": "{% macro intersect() %}\n {{ return(adapter.dispatch('intersect', 'dbt')()) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__intersect"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789079002.4656005, "supported_languages": null}, "macro.dbt.default__intersect": {"name": "default__intersect", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/intersect.sql", "original_file_path": "macros/utils/intersect.sql", "unique_id": "macro.dbt.default__intersect", "macro_sql": "{% macro default__intersect() %}\n\n intersect\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789079002.4656954, "supported_languages": null}, "macro.dbt.last_day": {"name": "last_day", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/last_day.sql", "original_file_path": "macros/utils/last_day.sql", "unique_id": "macro.dbt.last_day", "macro_sql": "{% macro last_day(date, datepart) %}\n {{ return(adapter.dispatch('last_day', 'dbt') (date, datepart)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__last_day"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "date", "type": null, "description": ""}, {"name": "datepart", "type": null, "description": ""}], "created_at": 1789079002.4660559, "supported_languages": null}, "macro.dbt.default_last_day": {"name": "default_last_day", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/last_day.sql", "original_file_path": "macros/utils/last_day.sql", "unique_id": "macro.dbt.default_last_day", "macro_sql": "\n\n{%- macro default_last_day(date, datepart) -%}\n cast(\n {{dbt.dateadd('day', '-1',\n dbt.dateadd(datepart, '1', dbt.date_trunc(datepart, date))\n )}}\n as date)\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt.dateadd", "macro.dbt.date_trunc"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "date", "type": null, "description": ""}, {"name": "datepart", "type": null, "description": ""}], "created_at": 1789079002.4663496, "supported_languages": null}, "macro.dbt.default__last_day": {"name": "default__last_day", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/last_day.sql", "original_file_path": "macros/utils/last_day.sql", "unique_id": "macro.dbt.default__last_day", "macro_sql": "{% macro default__last_day(date, datepart) -%}\n {{dbt.default_last_day(date, datepart)}}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default_last_day"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "date", "type": null, "description": ""}, {"name": "datepart", "type": null, "description": ""}], "created_at": 1789079002.4666002, "supported_languages": null}, "macro.dbt.listagg": {"name": "listagg", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/listagg.sql", "original_file_path": "macros/utils/listagg.sql", "unique_id": "macro.dbt.listagg", "macro_sql": "{% macro listagg(measure, delimiter_text=\"','\", order_by_clause=none, limit_num=none) -%}\n {{ return(adapter.dispatch('listagg', 'dbt') (measure, delimiter_text, order_by_clause, limit_num)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__listagg"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "measure", "type": null, "description": ""}, {"name": "delimiter_text", "type": null, "description": ""}, {"name": "order_by_clause", "type": null, "description": ""}, {"name": "limit_num", "type": null, "description": ""}], "created_at": 1789079002.4671068, "supported_languages": null}, "macro.dbt.default__listagg": {"name": "default__listagg", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/listagg.sql", "original_file_path": "macros/utils/listagg.sql", "unique_id": "macro.dbt.default__listagg", "macro_sql": "{% macro default__listagg(measure, delimiter_text, order_by_clause, limit_num) -%}\n\n {% if limit_num -%}\n array_to_string(\n array_slice(\n array_agg(\n {{ measure }}\n ){% if order_by_clause -%}\n within group ({{ order_by_clause }})\n {%- endif %}\n ,0\n ,{{ limit_num }}\n ),\n {{ delimiter_text }}\n )\n {%- else %}\n listagg(\n {{ measure }},\n {{ delimiter_text }}\n )\n {% if order_by_clause -%}\n within group ({{ order_by_clause }})\n {%- endif %}\n {%- endif %}\n\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "measure", "type": null, "description": ""}, {"name": "delimiter_text", "type": null, "description": ""}, {"name": "order_by_clause", "type": null, "description": ""}, {"name": "limit_num", "type": null, "description": ""}], "created_at": 1789079002.4675732, "supported_languages": null}, "macro.dbt.cast_bool_to_text": {"name": "cast_bool_to_text", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/cast_bool_to_text.sql", "original_file_path": "macros/utils/cast_bool_to_text.sql", "unique_id": "macro.dbt.cast_bool_to_text", "macro_sql": "{% macro cast_bool_to_text(field) %}\n {{ adapter.dispatch('cast_bool_to_text', 'dbt') (field) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__cast_bool_to_text"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field", "type": null, "description": ""}], "created_at": 1789079002.467865, "supported_languages": null}, "macro.dbt.default__cast_bool_to_text": {"name": "default__cast_bool_to_text", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/cast_bool_to_text.sql", "original_file_path": "macros/utils/cast_bool_to_text.sql", "unique_id": "macro.dbt.default__cast_bool_to_text", "macro_sql": "{% macro default__cast_bool_to_text(field) %}\n cast({{ field }} as {{ api.Column.translate_type('string') }})\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field", "type": null, "description": ""}], "created_at": 1789079002.4680538, "supported_languages": null}, "macro.dbt.date_trunc": {"name": "date_trunc", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/date_trunc.sql", "original_file_path": "macros/utils/date_trunc.sql", "unique_id": "macro.dbt.date_trunc", "macro_sql": "{% macro date_trunc(datepart, date) -%}\n {{ return(adapter.dispatch('date_trunc', 'dbt') (datepart, date)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__date_trunc"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "datepart", "type": null, "description": ""}, {"name": "date", "type": null, "description": ""}], "created_at": 1789079002.4683542, "supported_languages": null}, "macro.dbt.default__date_trunc": {"name": "default__date_trunc", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/date_trunc.sql", "original_file_path": "macros/utils/date_trunc.sql", "unique_id": "macro.dbt.default__date_trunc", "macro_sql": "{% macro default__date_trunc(datepart, date) -%}\n date_trunc('{{datepart}}', {{date}})\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "datepart", "type": null, "description": ""}, {"name": "date", "type": null, "description": ""}], "created_at": 1789079002.4685102, "supported_languages": null}, "macro.dbt.position": {"name": "position", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/position.sql", "original_file_path": "macros/utils/position.sql", "unique_id": "macro.dbt.position", "macro_sql": "{% macro position(substring_text, string_text) -%}\n {{ return(adapter.dispatch('position', 'dbt') (substring_text, string_text)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__position"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "substring_text", "type": null, "description": ""}, {"name": "string_text", "type": null, "description": ""}], "created_at": 1789079002.4688153, "supported_languages": null}, "macro.dbt.default__position": {"name": "default__position", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/position.sql", "original_file_path": "macros/utils/position.sql", "unique_id": "macro.dbt.default__position", "macro_sql": "{% macro default__position(substring_text, string_text) %}\n\n position(\n {{ substring_text }} in {{ string_text }}\n )\n\n{%- endmacro -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "substring_text", "type": null, "description": ""}, {"name": "string_text", "type": null, "description": ""}], "created_at": 1789079002.4689987, "supported_languages": null}, "macro.dbt.any_value": {"name": "any_value", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/any_value.sql", "original_file_path": "macros/utils/any_value.sql", "unique_id": "macro.dbt.any_value", "macro_sql": "{% macro any_value(expression) -%}\n {{ return(adapter.dispatch('any_value', 'dbt') (expression)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__any_value"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "expression", "type": null, "description": ""}], "created_at": 1789079002.4692762, "supported_languages": null}, "macro.dbt.default__any_value": {"name": "default__any_value", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/any_value.sql", "original_file_path": "macros/utils/any_value.sql", "unique_id": "macro.dbt.default__any_value", "macro_sql": "{% macro default__any_value(expression) -%}\n\n any_value({{ expression }})\n\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "expression", "type": null, "description": ""}], "created_at": 1789079002.4694006, "supported_languages": null}, "macro.dbt.length": {"name": "length", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/length.sql", "original_file_path": "macros/utils/length.sql", "unique_id": "macro.dbt.length", "macro_sql": "{% macro length(expression) -%}\n {{ return(adapter.dispatch('length', 'dbt') (expression)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__length"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "expression", "type": null, "description": ""}], "created_at": 1789079002.4696698, "supported_languages": null}, "macro.dbt.default__length": {"name": "default__length", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/length.sql", "original_file_path": "macros/utils/length.sql", "unique_id": "macro.dbt.default__length", "macro_sql": "{% macro default__length(expression) %}\n\n length(\n {{ expression }}\n )\n\n{%- endmacro -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "expression", "type": null, "description": ""}], "created_at": 1789079002.4697967, "supported_languages": null}, "macro.dbt.cast": {"name": "cast", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/cast.sql", "original_file_path": "macros/utils/cast.sql", "unique_id": "macro.dbt.cast", "macro_sql": "{% macro cast(field, type) %}\n {{ return(adapter.dispatch('cast', 'dbt') (field, type)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__cast"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field", "type": null, "description": ""}, {"name": "type", "type": null, "description": ""}], "created_at": 1789079002.4701216, "supported_languages": null}, "macro.dbt.default__cast": {"name": "default__cast", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/cast.sql", "original_file_path": "macros/utils/cast.sql", "unique_id": "macro.dbt.default__cast", "macro_sql": "{% macro default__cast(field, type) %}\n cast({{field}} as {{type}})\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field", "type": null, "description": ""}, {"name": "type", "type": null, "description": ""}], "created_at": 1789079002.4702766, "supported_languages": null}, "macro.dbt.get_intervals_between": {"name": "get_intervals_between", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/date_spine.sql", "original_file_path": "macros/utils/date_spine.sql", "unique_id": "macro.dbt.get_intervals_between", "macro_sql": "{% macro get_intervals_between(start_date, end_date, datepart) -%}\n {{ return(adapter.dispatch('get_intervals_between', 'dbt')(start_date, end_date, datepart)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_intervals_between"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "start_date", "type": null, "description": ""}, {"name": "end_date", "type": null, "description": ""}, {"name": "datepart", "type": null, "description": ""}], "created_at": 1789079002.4708948, "supported_languages": null}, "macro.dbt.default__get_intervals_between": {"name": "default__get_intervals_between", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/date_spine.sql", "original_file_path": "macros/utils/date_spine.sql", "unique_id": "macro.dbt.default__get_intervals_between", "macro_sql": "{% macro default__get_intervals_between(start_date, end_date, datepart) -%}\n {%- call statement('get_intervals_between', fetch_result=True) %}\n\n select {{ dbt.datediff(start_date, end_date, datepart) }}\n\n {%- endcall -%}\n\n {%- set value_list = load_result('get_intervals_between') -%}\n\n {%- if value_list and value_list['data'] -%}\n {%- set values = value_list['data'] | map(attribute=0) | list %}\n {{ return(values[0]) }}\n {%- else -%}\n {{ return(1) }}\n {%- endif -%}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.statement", "macro.dbt.datediff"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "start_date", "type": null, "description": ""}, {"name": "end_date", "type": null, "description": ""}, {"name": "datepart", "type": null, "description": ""}], "created_at": 1789079002.4715726, "supported_languages": null}, "macro.dbt.date_spine": {"name": "date_spine", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/date_spine.sql", "original_file_path": "macros/utils/date_spine.sql", "unique_id": "macro.dbt.date_spine", "macro_sql": "{% macro date_spine(datepart, start_date, end_date) %}\n {{ return(adapter.dispatch('date_spine', 'dbt')(datepart, start_date, end_date)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__date_spine"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "datepart", "type": null, "description": ""}, {"name": "start_date", "type": null, "description": ""}, {"name": "end_date", "type": null, "description": ""}], "created_at": 1789079002.4718554, "supported_languages": null}, "macro.dbt.default__date_spine": {"name": "default__date_spine", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/date_spine.sql", "original_file_path": "macros/utils/date_spine.sql", "unique_id": "macro.dbt.default__date_spine", "macro_sql": "{% macro default__date_spine(datepart, start_date, end_date) %}\n\n\n {# call as follows:\n\n date_spine(\n \"day\",\n \"to_date('01/01/2016', 'mm/dd/yyyy')\",\n \"dbt.dateadd(week, 1, current_date)\"\n ) #}\n\n\n with rawdata as (\n\n {{dbt.generate_series(\n dbt.get_intervals_between(start_date, end_date, datepart)\n )}}\n\n ),\n\n all_periods as (\n\n select (\n {{\n dbt.dateadd(\n datepart,\n \"row_number() over (order by 1) - 1\",\n start_date\n )\n }}\n ) as date_{{datepart}}\n from rawdata\n\n ),\n\n filtered as (\n\n select *\n from all_periods\n where date_{{datepart}} <= {{ end_date }}\n\n )\n\n select * from filtered\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.generate_series", "macro.dbt.get_intervals_between", "macro.dbt.dateadd"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "datepart", "type": null, "description": ""}, {"name": "start_date", "type": null, "description": ""}, {"name": "end_date", "type": null, "description": ""}], "created_at": 1789079002.472265, "supported_languages": null}, "macro.dbt.datediff": {"name": "datediff", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/datediff.sql", "original_file_path": "macros/utils/datediff.sql", "unique_id": "macro.dbt.datediff", "macro_sql": "{% macro datediff(first_date, second_date, datepart) %}\n {{ return(adapter.dispatch('datediff', 'dbt')(first_date, second_date, datepart)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__datediff"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "first_date", "type": null, "description": ""}, {"name": "second_date", "type": null, "description": ""}, {"name": "datepart", "type": null, "description": ""}], "created_at": 1789079002.472613, "supported_languages": null}, "macro.dbt.default__datediff": {"name": "default__datediff", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/datediff.sql", "original_file_path": "macros/utils/datediff.sql", "unique_id": "macro.dbt.default__datediff", "macro_sql": "{% macro default__datediff(first_date, second_date, datepart) -%}\n\n datediff(\n {{ datepart }},\n {{ first_date }},\n {{ second_date }}\n )\n\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "first_date", "type": null, "description": ""}, {"name": "second_date", "type": null, "description": ""}, {"name": "datepart", "type": null, "description": ""}], "created_at": 1789079002.4728134, "supported_languages": null}, "macro.dbt.equals": {"name": "equals", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/equals.sql", "original_file_path": "macros/utils/equals.sql", "unique_id": "macro.dbt.equals", "macro_sql": "{% macro equals(expr1, expr2) %}\n {{ return(adapter.dispatch('equals', 'dbt') (expr1, expr2)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__equals"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "expr1", "type": null, "description": ""}, {"name": "expr2", "type": null, "description": ""}], "created_at": 1789079002.4732223, "supported_languages": null}, "macro.dbt.default__equals": {"name": "default__equals", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/equals.sql", "original_file_path": "macros/utils/equals.sql", "unique_id": "macro.dbt.default__equals", "macro_sql": "{% macro default__equals(expr1, expr2) -%}\n{%- if adapter.behavior.enable_truthy_nulls_equals_macro.no_warn %}\n case when (({{ expr1 }} = {{ expr2 }}) or ({{ expr1 }} is null and {{ expr2 }} is null))\n then 0\n else 1\n end = 0\n{%- else -%}\n ({{ expr1 }} = {{ expr2 }})\n{%- endif %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "expr1", "type": null, "description": ""}, {"name": "expr2", "type": null, "description": ""}], "created_at": 1789079002.4735522, "supported_languages": null}, "macro.dbt.dateadd": {"name": "dateadd", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/dateadd.sql", "original_file_path": "macros/utils/dateadd.sql", "unique_id": "macro.dbt.dateadd", "macro_sql": "{% macro dateadd(datepart, interval, from_date_or_timestamp) %}\n {{ return(adapter.dispatch('dateadd', 'dbt')(datepart, interval, from_date_or_timestamp)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__dateadd"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "datepart", "type": null, "description": ""}, {"name": "interval", "type": null, "description": ""}, {"name": "from_date_or_timestamp", "type": null, "description": ""}], "created_at": 1789079002.4739265, "supported_languages": null}, "macro.dbt.default__dateadd": {"name": "default__dateadd", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/dateadd.sql", "original_file_path": "macros/utils/dateadd.sql", "unique_id": "macro.dbt.default__dateadd", "macro_sql": "{% macro default__dateadd(datepart, interval, from_date_or_timestamp) %}\n\n dateadd(\n {{ datepart }},\n {{ interval }},\n {{ from_date_or_timestamp }}\n )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "datepart", "type": null, "description": ""}, {"name": "interval", "type": null, "description": ""}, {"name": "from_date_or_timestamp", "type": null, "description": ""}], "created_at": 1789079002.4741225, "supported_languages": null}, "macro.dbt.concat": {"name": "concat", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/concat.sql", "original_file_path": "macros/utils/concat.sql", "unique_id": "macro.dbt.concat", "macro_sql": "{% macro concat(fields) -%}\n {{ return(adapter.dispatch('concat', 'dbt')(fields)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__concat"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "fields", "type": null, "description": ""}], "created_at": 1789079002.4743998, "supported_languages": null}, "macro.dbt.default__concat": {"name": "default__concat", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/concat.sql", "original_file_path": "macros/utils/concat.sql", "unique_id": "macro.dbt.default__concat", "macro_sql": "{% macro default__concat(fields) -%}\n {{ fields|join(' || ') }}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "fields", "type": null, "description": ""}], "created_at": 1789079002.4745483, "supported_languages": null}, "macro.dbt.array_construct": {"name": "array_construct", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/array_construct.sql", "original_file_path": "macros/utils/array_construct.sql", "unique_id": "macro.dbt.array_construct", "macro_sql": "{% macro array_construct(inputs=[], data_type=api.Column.translate_type('integer')) -%}\n {{ return(adapter.dispatch('array_construct', 'dbt')(inputs, data_type)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__array_construct"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "inputs", "type": null, "description": ""}, {"name": "data_type", "type": null, "description": ""}], "created_at": 1789079002.474967, "supported_languages": null}, "macro.dbt.default__array_construct": {"name": "default__array_construct", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/array_construct.sql", "original_file_path": "macros/utils/array_construct.sql", "unique_id": "macro.dbt.default__array_construct", "macro_sql": "{% macro default__array_construct(inputs, data_type) -%}\n {% if inputs|length > 0 %}\n array[ {{ inputs|join(' , ') }} ]\n {% else %}\n array[]::{{data_type}}[]\n {% endif %}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "inputs", "type": null, "description": ""}, {"name": "data_type", "type": null, "description": ""}], "created_at": 1789079002.4752433, "supported_languages": null}, "macro.dbt.split_part": {"name": "split_part", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/split_part.sql", "original_file_path": "macros/utils/split_part.sql", "unique_id": "macro.dbt.split_part", "macro_sql": "{% macro split_part(string_text, delimiter_text, part_number) %}\n {{ return(adapter.dispatch('split_part', 'dbt') (string_text, delimiter_text, part_number)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__split_part"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "string_text", "type": null, "description": ""}, {"name": "delimiter_text", "type": null, "description": ""}, {"name": "part_number", "type": null, "description": ""}], "created_at": 1789079002.4756436, "supported_languages": null}, "macro.dbt.default__split_part": {"name": "default__split_part", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/split_part.sql", "original_file_path": "macros/utils/split_part.sql", "unique_id": "macro.dbt.default__split_part", "macro_sql": "{% macro default__split_part(string_text, delimiter_text, part_number) %}\n\n split_part(\n {{ string_text }},\n {{ delimiter_text }},\n {{ part_number }}\n )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "string_text", "type": null, "description": ""}, {"name": "delimiter_text", "type": null, "description": ""}, {"name": "part_number", "type": null, "description": ""}], "created_at": 1789079002.4759305, "supported_languages": null}, "macro.dbt._split_part_negative": {"name": "_split_part_negative", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/split_part.sql", "original_file_path": "macros/utils/split_part.sql", "unique_id": "macro.dbt._split_part_negative", "macro_sql": "{% macro _split_part_negative(string_text, delimiter_text, part_number) %}\n\n split_part(\n {{ string_text }},\n {{ delimiter_text }},\n length({{ string_text }})\n - length(\n replace({{ string_text }}, {{ delimiter_text }}, '')\n ) + 2 + {{ part_number }}\n )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "string_text", "type": null, "description": ""}, {"name": "delimiter_text", "type": null, "description": ""}, {"name": "part_number", "type": null, "description": ""}], "created_at": 1789079002.4761846, "supported_languages": null}, "macro.dbt.bool_or": {"name": "bool_or", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/bool_or.sql", "original_file_path": "macros/utils/bool_or.sql", "unique_id": "macro.dbt.bool_or", "macro_sql": "{% macro bool_or(expression) -%}\n {{ return(adapter.dispatch('bool_or', 'dbt') (expression)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__bool_or"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "expression", "type": null, "description": ""}], "created_at": 1789079002.4764621, "supported_languages": null}, "macro.dbt.default__bool_or": {"name": "default__bool_or", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/bool_or.sql", "original_file_path": "macros/utils/bool_or.sql", "unique_id": "macro.dbt.default__bool_or", "macro_sql": "{% macro default__bool_or(expression) -%}\n\n bool_or({{ expression }})\n\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "expression", "type": null, "description": ""}], "created_at": 1789079002.4765906, "supported_languages": null}, "macro.dbt.replace": {"name": "replace", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/replace.sql", "original_file_path": "macros/utils/replace.sql", "unique_id": "macro.dbt.replace", "macro_sql": "{% macro replace(field, old_chars, new_chars) -%}\n {{ return(adapter.dispatch('replace', 'dbt') (field, old_chars, new_chars)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__replace"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field", "type": null, "description": ""}, {"name": "old_chars", "type": null, "description": ""}, {"name": "new_chars", "type": null, "description": ""}], "created_at": 1789079002.4769425, "supported_languages": null}, "macro.dbt.default__replace": {"name": "default__replace", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/replace.sql", "original_file_path": "macros/utils/replace.sql", "unique_id": "macro.dbt.default__replace", "macro_sql": "{% macro default__replace(field, old_chars, new_chars) %}\n\n replace(\n {{ field }},\n {{ old_chars }},\n {{ new_chars }}\n )\n\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field", "type": null, "description": ""}, {"name": "old_chars", "type": null, "description": ""}, {"name": "new_chars", "type": null, "description": ""}], "created_at": 1789079002.4771366, "supported_languages": null}, "macro.dbt.string_literal": {"name": "string_literal", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/literal.sql", "original_file_path": "macros/utils/literal.sql", "unique_id": "macro.dbt.string_literal", "macro_sql": "{%- macro string_literal(value) -%}\n {{ return(adapter.dispatch('string_literal', 'dbt') (value)) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt.default__string_literal"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "value", "type": null, "description": ""}], "created_at": 1789079002.4774163, "supported_languages": null}, "macro.dbt.default__string_literal": {"name": "default__string_literal", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/literal.sql", "original_file_path": "macros/utils/literal.sql", "unique_id": "macro.dbt.default__string_literal", "macro_sql": "{% macro default__string_literal(value) -%}\n '{{ value }}'\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "value", "type": null, "description": ""}], "created_at": 1789079002.477542, "supported_languages": null}, "macro.dbt.except": {"name": "except", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/except.sql", "original_file_path": "macros/utils/except.sql", "unique_id": "macro.dbt.except", "macro_sql": "{% macro except() %}\n {{ return(adapter.dispatch('except', 'dbt')()) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__except"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789079002.4777899, "supported_languages": null}, "macro.dbt.default__except": {"name": "default__except", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/except.sql", "original_file_path": "macros/utils/except.sql", "unique_id": "macro.dbt.default__except", "macro_sql": "{% macro default__except() %}\n\n except\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789079002.4779012, "supported_languages": null}, "macro.dbt.statement": {"name": "statement", "resource_type": "macro", "package_name": "dbt", "path": "macros/etc/statement.sql", "original_file_path": "macros/etc/statement.sql", "unique_id": "macro.dbt.statement", "macro_sql": "\n{%- macro statement(name=None, fetch_result=False, auto_begin=True, language='sql') -%}\n {%- if execute: -%}\n {%- set compiled_code = caller() -%}\n\n {%- if name == 'main' -%}\n {{ log('Writing runtime {} for node \"{}\"'.format(language, model['unique_id'])) }}\n {{ write(compiled_code) }}\n {%- endif -%}\n {%- if language == 'sql'-%}\n {%- set res, table = adapter.execute(compiled_code, auto_begin=auto_begin, fetch=fetch_result) -%}\n {%- elif language == 'python' -%}\n {%- set res = submit_python_job(model, compiled_code) -%}\n {#-- TODO: What should table be for python models? --#}\n {%- set table = None -%}\n {%- else -%}\n {% do exceptions.raise_compiler_error(\"statement macro didn't get supported language\") %}\n {%- endif -%}\n\n {%- if name is not none -%}\n {{ store_result(name, response=res, agate_table=table) }}\n {%- endif -%}\n\n {%- endif -%}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "name", "type": null, "description": ""}, {"name": "fetch_result", "type": null, "description": ""}, {"name": "auto_begin", "type": null, "description": ""}, {"name": "language", "type": null, "description": ""}], "created_at": 1789079002.4793038, "supported_languages": null}, "macro.dbt.noop_statement": {"name": "noop_statement", "resource_type": "macro", "package_name": "dbt", "path": "macros/etc/statement.sql", "original_file_path": "macros/etc/statement.sql", "unique_id": "macro.dbt.noop_statement", "macro_sql": "{% macro noop_statement(name=None, message=None, code=None, rows_affected=None, res=None) -%}\n {%- set sql = caller() -%}\n\n {%- if name == 'main' -%}\n {{ log('Writing runtime SQL for node \"{}\"'.format(model['unique_id'])) }}\n {{ write(sql) }}\n {%- endif -%}\n\n {%- if name is not none -%}\n {{ store_raw_result(name, message=message, code=code, rows_affected=rows_affected, agate_table=res) }}\n {%- endif -%}\n\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "name", "type": null, "description": ""}, {"name": "message", "type": null, "description": ""}, {"name": "code", "type": null, "description": ""}, {"name": "rows_affected", "type": null, "description": ""}, {"name": "res", "type": null, "description": ""}], "created_at": 1789079002.480022, "supported_languages": null}, "macro.dbt.run_query": {"name": "run_query", "resource_type": "macro", "package_name": "dbt", "path": "macros/etc/statement.sql", "original_file_path": "macros/etc/statement.sql", "unique_id": "macro.dbt.run_query", "macro_sql": "{% macro run_query(sql) %}\n {% call statement(\"run_query_statement\", fetch_result=true, auto_begin=false) %}\n {{ sql }}\n {% endcall %}\n\n {% do return(load_result(\"run_query_statement\").table) %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "sql", "type": null, "description": ""}], "created_at": 1789079002.4803503, "supported_languages": null}, "macro.dbt.convert_datetime": {"name": "convert_datetime", "resource_type": "macro", "package_name": "dbt", "path": "macros/etc/datetime.sql", "original_file_path": "macros/etc/datetime.sql", "unique_id": "macro.dbt.convert_datetime", "macro_sql": "{% macro convert_datetime(date_str, date_fmt) %}\n\n {% set error_msg -%}\n The provided partition date '{{ date_str }}' does not match the expected format '{{ date_fmt }}'\n {%- endset %}\n\n {% set res = try_or_compiler_error(error_msg, modules.datetime.datetime.strptime, date_str.strip(), date_fmt) %}\n {{ return(res) }}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "date_str", "type": null, "description": ""}, {"name": "date_fmt", "type": null, "description": ""}], "created_at": 1789079002.4811838, "supported_languages": null}, "macro.dbt.dates_in_range": {"name": "dates_in_range", "resource_type": "macro", "package_name": "dbt", "path": "macros/etc/datetime.sql", "original_file_path": "macros/etc/datetime.sql", "unique_id": "macro.dbt.dates_in_range", "macro_sql": "{% macro dates_in_range(start_date_str, end_date_str=none, in_fmt=\"%Y%m%d\", out_fmt=\"%Y%m%d\") %}\n {% set end_date_str = start_date_str if end_date_str is none else end_date_str %}\n\n {% set start_date = convert_datetime(start_date_str, in_fmt) %}\n {% set end_date = convert_datetime(end_date_str, in_fmt) %}\n\n {% set day_count = (end_date - start_date).days %}\n {% if day_count < 0 %}\n {% set msg -%}\n Partition start date is after the end date ({{ start_date }}, {{ end_date }})\n {%- endset %}\n\n {{ exceptions.raise_compiler_error(msg, model) }}\n {% endif %}\n\n {% set date_list = [] %}\n {% for i in range(0, day_count + 1) %}\n {% set the_date = (modules.datetime.timedelta(days=i) + start_date) %}\n {% if not out_fmt %}\n {% set _ = date_list.append(the_date) %}\n {% else %}\n {% set _ = date_list.append(the_date.strftime(out_fmt)) %}\n {% endif %}\n {% endfor %}\n\n {{ return(date_list) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.convert_datetime"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "start_date_str", "type": null, "description": ""}, {"name": "end_date_str", "type": null, "description": ""}, {"name": "in_fmt", "type": null, "description": ""}, {"name": "out_fmt", "type": null, "description": ""}], "created_at": 1789079002.4825168, "supported_languages": null}, "macro.dbt.partition_range": {"name": "partition_range", "resource_type": "macro", "package_name": "dbt", "path": "macros/etc/datetime.sql", "original_file_path": "macros/etc/datetime.sql", "unique_id": "macro.dbt.partition_range", "macro_sql": "{% macro partition_range(raw_partition_date, date_fmt='%Y%m%d') %}\n {% set partition_range = (raw_partition_date | string).split(\",\") %}\n\n {% if (partition_range | length) == 1 %}\n {% set start_date = partition_range[0] %}\n {% set end_date = none %}\n {% elif (partition_range | length) == 2 %}\n {% set start_date = partition_range[0] %}\n {% set end_date = partition_range[1] %}\n {% else %}\n {{ exceptions.raise_compiler_error(\"Invalid partition time. Expected format: {Start Date}[,{End Date}]. Got: \" ~ raw_partition_date) }}\n {% endif %}\n\n {{ return(dates_in_range(start_date, end_date, in_fmt=date_fmt)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.dates_in_range"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "raw_partition_date", "type": null, "description": ""}, {"name": "date_fmt", "type": null, "description": ""}], "created_at": 1789079002.4833634, "supported_languages": null}, "macro.dbt.py_current_timestring": {"name": "py_current_timestring", "resource_type": "macro", "package_name": "dbt", "path": "macros/etc/datetime.sql", "original_file_path": "macros/etc/datetime.sql", "unique_id": "macro.dbt.py_current_timestring", "macro_sql": "{% macro py_current_timestring() %}\n {% set dt = modules.datetime.datetime.now() %}\n {% do return(dt.strftime(\"%Y%m%d%H%M%S%f\")) %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789079002.4836247, "supported_languages": null}, "macro.dbt.resolve_model_name": {"name": "resolve_model_name", "resource_type": "macro", "package_name": "dbt", "path": "macros/python_model/python.sql", "original_file_path": "macros/python_model/python.sql", "unique_id": "macro.dbt.resolve_model_name", "macro_sql": "{% macro resolve_model_name(input_model_name) %}\n {{ return(adapter.dispatch('resolve_model_name', 'dbt')(input_model_name)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__resolve_model_name"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "input_model_name", "type": null, "description": ""}], "created_at": 1789079002.4845457, "supported_languages": null}, "macro.dbt.default__resolve_model_name": {"name": "default__resolve_model_name", "resource_type": "macro", "package_name": "dbt", "path": "macros/python_model/python.sql", "original_file_path": "macros/python_model/python.sql", "unique_id": "macro.dbt.default__resolve_model_name", "macro_sql": "\n\n{%- macro default__resolve_model_name(input_model_name) -%}\n {{ input_model_name | string | replace('\"', '\\\"') }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "input_model_name", "type": null, "description": ""}], "created_at": 1789079002.4847345, "supported_languages": null}, "macro.dbt.build_ref_function": {"name": "build_ref_function", "resource_type": "macro", "package_name": "dbt", "path": "macros/python_model/python.sql", "original_file_path": "macros/python_model/python.sql", "unique_id": "macro.dbt.build_ref_function", "macro_sql": "{% macro build_ref_function(model) %}\n\n {%- set ref_dict = {} -%}\n {%- for _ref in model.refs -%}\n {% set _ref_args = [_ref.get('package'), _ref['name']] if _ref.get('package') else [_ref['name'],] %}\n {%- set resolved = ref(*_ref_args, v=_ref.get('version')) -%}\n\n {#\n We want to get the string of the returned relation by calling .render() in order to skip sample/empty\n mode rendering logic. However, people override the default ref macro, and often return a string instead\n of a relation (like the ref macro does by default). Thus, to make sure we dont blow things up, we have\n to ensure the resolved relation has a .render() method.\n #}\n {%- if resolved.render is defined and resolved.render is callable -%}\n {%- set resolved = resolved.render() -%}\n {%- endif -%}\n\n {%- if _ref.get('version') -%}\n {% do _ref_args.extend([\"v\" ~ _ref['version']]) %}\n {%- endif -%}\n {%- do ref_dict.update({_ref_args | join('.'): resolve_model_name(resolved)}) -%}\n {%- endfor -%}\n\ndef ref(*args, **kwargs):\n refs = {{ ref_dict | tojson }}\n key = '.'.join(args)\n version = kwargs.get(\"v\") or kwargs.get(\"version\")\n if version:\n key += f\".v{version}\"\n dbt_load_df_function = kwargs.get(\"dbt_load_df_function\")\n return dbt_load_df_function(refs[key])\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.resolve_model_name"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}], "created_at": 1789079002.4857903, "supported_languages": null}, "macro.dbt.build_source_function": {"name": "build_source_function", "resource_type": "macro", "package_name": "dbt", "path": "macros/python_model/python.sql", "original_file_path": "macros/python_model/python.sql", "unique_id": "macro.dbt.build_source_function", "macro_sql": "{% macro build_source_function(model) %}\n\n {%- set source_dict = {} -%}\n {%- for _source in model.sources -%}\n {%- set resolved = source(*_source) -%}\n {%- do source_dict.update({_source | join('.'): resolve_model_name(resolved)}) -%}\n {%- endfor -%}\n\ndef source(*args, dbt_load_df_function):\n sources = {{ source_dict | tojson }}\n key = '.'.join(args)\n return dbt_load_df_function(sources[key])\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.resolve_model_name"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}], "created_at": 1789079002.4862778, "supported_languages": null}, "macro.dbt.build_config_dict": {"name": "build_config_dict", "resource_type": "macro", "package_name": "dbt", "path": "macros/python_model/python.sql", "original_file_path": "macros/python_model/python.sql", "unique_id": "macro.dbt.build_config_dict", "macro_sql": "{% macro build_config_dict(model) %}\n {%- set config_dict = {} -%}\n {% set config_dbt_used = zip(model.config.config_keys_used, model.config.config_keys_defaults) | list %}\n {%- for key, default in config_dbt_used -%}\n {# weird type testing with enum, would be much easier to write this logic in Python! #}\n {%- if key == \"language\" -%}\n {%- set value = \"python\" -%}\n {%- endif -%}\n {%- set value = model.config.get(key, default) -%}\n {%- do config_dict.update({key: value}) -%}\n {%- endfor -%}\n {# Handle dbt.config.meta_get() calls - use separate dict to avoid overwriting native configs #}\n {%- set meta_dict = {} -%}\n {%- if model.config.meta_keys_used -%}\n {% set meta_dbt_used = zip(model.config.meta_keys_used, model.config.meta_keys_defaults) | list %}\n {%- for key, default in meta_dbt_used -%}\n {%- if model.config.meta and key in model.config.meta -%}\n {%- set value = model.config.meta[key] -%}\n {%- else -%}\n {%- set value = default -%}\n {%- endif -%}\n {%- do meta_dict.update({key: value}) -%}\n {%- endfor -%}\n {%- endif -%}\nconfig_dict = {{ config_dict }}\nmeta_dict = {{ meta_dict }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}], "created_at": 1789079002.487545, "supported_languages": null}, "macro.dbt.py_script_postfix": {"name": "py_script_postfix", "resource_type": "macro", "package_name": "dbt", "path": "macros/python_model/python.sql", "original_file_path": "macros/python_model/python.sql", "unique_id": "macro.dbt.py_script_postfix", "macro_sql": "{% macro py_script_postfix(model) %}\n# This part is user provided model code\n# you will need to copy the next section to run the code\n# COMMAND ----------\n# this part is dbt logic for get ref work, do not modify\n\n{{ build_ref_function(model ) }}\n{{ build_source_function(model ) }}\n{{ build_config_dict(model) }}\n\nclass config:\n def __init__(self, *args, **kwargs):\n pass\n\n @staticmethod\n def get(key, default=None):\n return config_dict.get(key, default)\n\n @staticmethod\n def meta_get(key, default=None):\n return meta_dict.get(key, default)\n\nclass this:\n \"\"\"dbt.this() or dbt.this.identifier\"\"\"\n database = \"{{ this.database }}\"\n schema = \"{{ this.schema }}\"\n identifier = \"{{ this.identifier }}\"\n {% set this_relation_name = resolve_model_name(this) %}\n def __repr__(self):\n return '{{ this_relation_name }}'\n\n\nclass dbtObj:\n def __init__(self, load_df_function) -> None:\n self.source = lambda *args: source(*args, dbt_load_df_function=load_df_function)\n self.ref = lambda *args, **kwargs: ref(*args, **kwargs, dbt_load_df_function=load_df_function)\n self.config = config\n self.this = this()\n self.is_incremental = {{ is_incremental() }}\n\n# COMMAND ----------\n{{py_script_comment()}}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.build_ref_function", "macro.dbt.build_source_function", "macro.dbt.build_config_dict", "macro.dbt.resolve_model_name", "macro.dbt.is_incremental", "macro.dbt.py_script_comment"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}], "created_at": 1789079002.488393, "supported_languages": null}, "macro.dbt.py_script_comment": {"name": "py_script_comment", "resource_type": "macro", "package_name": "dbt", "path": "macros/python_model/python.sql", "original_file_path": "macros/python_model/python.sql", "unique_id": "macro.dbt.py_script_comment", "macro_sql": "{%macro py_script_comment()%}\n{%endmacro%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789079002.4885023, "supported_languages": null}, "macro.dbt.generate_schema_name": {"name": "generate_schema_name", "resource_type": "macro", "package_name": "dbt", "path": "macros/get_custom_name/get_custom_schema.sql", "original_file_path": "macros/get_custom_name/get_custom_schema.sql", "unique_id": "macro.dbt.generate_schema_name", "macro_sql": "{% macro generate_schema_name(custom_schema_name=none, node=none) -%}\n {{ return(adapter.dispatch('generate_schema_name', 'dbt')(custom_schema_name, node)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__generate_schema_name"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "custom_schema_name", "type": null, "description": ""}, {"name": "node", "type": null, "description": ""}], "created_at": 1789079002.4890165, "supported_languages": null}, "macro.dbt.default__generate_schema_name": {"name": "default__generate_schema_name", "resource_type": "macro", "package_name": "dbt", "path": "macros/get_custom_name/get_custom_schema.sql", "original_file_path": "macros/get_custom_name/get_custom_schema.sql", "unique_id": "macro.dbt.default__generate_schema_name", "macro_sql": "{% macro default__generate_schema_name(custom_schema_name, node) -%}\n\n {%- set default_schema = target.schema -%}\n {%- if custom_schema_name is none -%}\n\n {{ default_schema }}\n\n {%- else -%}\n\n {{ default_schema }}_{{ custom_schema_name | trim }}\n\n {%- endif -%}\n\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "custom_schema_name", "type": null, "description": ""}, {"name": "node", "type": null, "description": ""}], "created_at": 1789079002.4893236, "supported_languages": null}, "macro.dbt.generate_schema_name_for_env": {"name": "generate_schema_name_for_env", "resource_type": "macro", "package_name": "dbt", "path": "macros/get_custom_name/get_custom_schema.sql", "original_file_path": "macros/get_custom_name/get_custom_schema.sql", "unique_id": "macro.dbt.generate_schema_name_for_env", "macro_sql": "{% macro generate_schema_name_for_env(custom_schema_name, node) -%}\n\n {%- set default_schema = target.schema -%}\n {%- if target.name == 'prod' and custom_schema_name is not none -%}\n\n {{ custom_schema_name | trim }}\n\n {%- else -%}\n\n {{ default_schema }}\n\n {%- endif -%}\n\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "custom_schema_name", "type": null, "description": ""}, {"name": "node", "type": null, "description": ""}], "created_at": 1789079002.4896421, "supported_languages": null}, "macro.dbt.generate_latest_version_pointer_alias": {"name": "generate_latest_version_pointer_alias", "resource_type": "macro", "package_name": "dbt", "path": "macros/get_custom_name/get_latest_version_pointer_alias.sql", "original_file_path": "macros/get_custom_name/get_latest_version_pointer_alias.sql", "unique_id": "macro.dbt.generate_latest_version_pointer_alias", "macro_sql": "{% macro generate_latest_version_pointer_alias(custom_alias_name=none, node=none) -%}\n {% do return(adapter.dispatch('generate_latest_version_pointer_alias', 'dbt')(custom_alias_name, node)) %}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__generate_latest_version_pointer_alias"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "custom_alias_name", "type": null, "description": ""}, {"name": "node", "type": null, "description": ""}], "created_at": 1789079002.4900584, "supported_languages": null}, "macro.dbt.default__generate_latest_version_pointer_alias": {"name": "default__generate_latest_version_pointer_alias", "resource_type": "macro", "package_name": "dbt", "path": "macros/get_custom_name/get_latest_version_pointer_alias.sql", "original_file_path": "macros/get_custom_name/get_latest_version_pointer_alias.sql", "unique_id": "macro.dbt.default__generate_latest_version_pointer_alias", "macro_sql": "{% macro default__generate_latest_version_pointer_alias(custom_alias_name=none, node=none) -%}\n {%- if custom_alias_name -%}\n {{ custom_alias_name | trim }}\n {%- else -%}\n {{ node.name }}\n {%- endif -%}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "custom_alias_name", "type": null, "description": ""}, {"name": "node", "type": null, "description": ""}], "created_at": 1789079002.49031, "supported_languages": null}, "macro.dbt.generate_database_name": {"name": "generate_database_name", "resource_type": "macro", "package_name": "dbt", "path": "macros/get_custom_name/get_custom_database.sql", "original_file_path": "macros/get_custom_name/get_custom_database.sql", "unique_id": "macro.dbt.generate_database_name", "macro_sql": "{% macro generate_database_name(custom_database_name=none, node=none) -%}\n {% do return(adapter.dispatch('generate_database_name', 'dbt')(custom_database_name, node)) %}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__generate_database_name"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "custom_database_name", "type": null, "description": ""}, {"name": "node", "type": null, "description": ""}], "created_at": 1789079002.490748, "supported_languages": null}, "macro.dbt.default__generate_database_name": {"name": "default__generate_database_name", "resource_type": "macro", "package_name": "dbt", "path": "macros/get_custom_name/get_custom_database.sql", "original_file_path": "macros/get_custom_name/get_custom_database.sql", "unique_id": "macro.dbt.default__generate_database_name", "macro_sql": "{% macro default__generate_database_name(custom_database_name=none, node=none) -%}\n {%- set default_database = target.database -%}\n {%- if node is not none and node|attr('database') -%}\n {%- set catalog_relation = adapter.build_catalog_relation(node) -%}\n {%- if catalog_relation and catalog_relation|attr('catalog_database') -%}\n {{ return(catalog_relation.catalog_database) }}\n {%- endif -%}\n {%- endif -%}\n {%- if custom_database_name is none -%}\n\n {{ default_database }}\n\n {%- else -%}\n\n {{ custom_database_name }}\n\n {%- endif -%}\n\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "custom_database_name", "type": null, "description": ""}, {"name": "node", "type": null, "description": ""}], "created_at": 1789079002.4913616, "supported_languages": null}, "macro.dbt.generate_alias_name": {"name": "generate_alias_name", "resource_type": "macro", "package_name": "dbt", "path": "macros/get_custom_name/get_custom_alias.sql", "original_file_path": "macros/get_custom_name/get_custom_alias.sql", "unique_id": "macro.dbt.generate_alias_name", "macro_sql": "{% macro generate_alias_name(custom_alias_name=none, node=none) -%}\n {% do return(adapter.dispatch('generate_alias_name', 'dbt')(custom_alias_name, node)) %}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__generate_alias_name"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "custom_alias_name", "type": null, "description": ""}, {"name": "node", "type": null, "description": ""}], "created_at": 1789079002.4917898, "supported_languages": null}, "macro.dbt.default__generate_alias_name": {"name": "default__generate_alias_name", "resource_type": "macro", "package_name": "dbt", "path": "macros/get_custom_name/get_custom_alias.sql", "original_file_path": "macros/get_custom_name/get_custom_alias.sql", "unique_id": "macro.dbt.default__generate_alias_name", "macro_sql": "{% macro default__generate_alias_name(custom_alias_name=none, node=none) -%}\n\n {%- if custom_alias_name -%}\n\n {{ custom_alias_name | trim }}\n\n {%- elif node.version -%}\n\n {{ return(node.name ~ \"_v\" ~ (node.version | replace(\".\", \"_\"))) }}\n\n {%- else -%}\n\n {{ node.name }}\n\n {%- endif -%}\n\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "custom_alias_name", "type": null, "description": ""}, {"name": "node", "type": null, "description": ""}], "created_at": 1789079002.492237, "supported_languages": null}, "macro.dbt.get_show_sql": {"name": "get_show_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/show.sql", "original_file_path": "macros/adapters/show.sql", "unique_id": "macro.dbt.get_show_sql", "macro_sql": "{% macro get_show_sql(compiled_code, sql_header, limit) -%}\n {%- if sql_header is not none -%}\n {{ sql_header }}\n {%- endif %}\n {{ get_limit_subquery_sql(compiled_code, limit) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_limit_subquery_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "compiled_code", "type": null, "description": ""}, {"name": "sql_header", "type": null, "description": ""}, {"name": "limit", "type": null, "description": ""}], "created_at": 1789079002.4926755, "supported_languages": null}, "macro.dbt.get_limit_subquery_sql": {"name": "get_limit_subquery_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/show.sql", "original_file_path": "macros/adapters/show.sql", "unique_id": "macro.dbt.get_limit_subquery_sql", "macro_sql": "\n{%- macro get_limit_subquery_sql(sql, limit) -%}\n {{ adapter.dispatch('get_limit_sql', 'dbt')(sql, limit) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt.default__get_limit_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "sql", "type": null, "description": ""}, {"name": "limit", "type": null, "description": ""}], "created_at": 1789079002.4929054, "supported_languages": null}, "macro.dbt.default__get_limit_sql": {"name": "default__get_limit_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/show.sql", "original_file_path": "macros/adapters/show.sql", "unique_id": "macro.dbt.default__get_limit_sql", "macro_sql": "{% macro default__get_limit_sql(sql, limit) %}\n {{ sql }}\n {% if limit is not none %}\n limit {{ limit }}\n {%- endif -%}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "sql", "type": null, "description": ""}, {"name": "limit", "type": null, "description": ""}], "created_at": 1789079002.4931324, "supported_languages": null}, "macro.dbt.current_timestamp": {"name": "current_timestamp", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/timestamps.sql", "original_file_path": "macros/adapters/timestamps.sql", "unique_id": "macro.dbt.current_timestamp", "macro_sql": "{%- macro current_timestamp() -%}\n {{ adapter.dispatch('current_timestamp', 'dbt')() }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt_postgres.postgres__current_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789079002.4936426, "supported_languages": null}, "macro.dbt.default__current_timestamp": {"name": "default__current_timestamp", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/timestamps.sql", "original_file_path": "macros/adapters/timestamps.sql", "unique_id": "macro.dbt.default__current_timestamp", "macro_sql": "{% macro default__current_timestamp() -%}\n {{ exceptions.raise_not_implemented(\n 'current_timestamp macro not implemented for adapter ' + adapter.type()) }}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789079002.4938266, "supported_languages": null}, "macro.dbt.snapshot_get_time": {"name": "snapshot_get_time", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/timestamps.sql", "original_file_path": "macros/adapters/timestamps.sql", "unique_id": "macro.dbt.snapshot_get_time", "macro_sql": "\n\n{%- macro snapshot_get_time() -%}\n {{ adapter.dispatch('snapshot_get_time', 'dbt')() }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt_postgres.postgres__snapshot_get_time"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789079002.4940886, "supported_languages": null}, "macro.dbt.default__snapshot_get_time": {"name": "default__snapshot_get_time", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/timestamps.sql", "original_file_path": "macros/adapters/timestamps.sql", "unique_id": "macro.dbt.default__snapshot_get_time", "macro_sql": "{% macro default__snapshot_get_time() %}\n {{ current_timestamp() }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.current_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789079002.4942272, "supported_languages": null}, "macro.dbt.get_snapshot_get_time_data_type": {"name": "get_snapshot_get_time_data_type", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/timestamps.sql", "original_file_path": "macros/adapters/timestamps.sql", "unique_id": "macro.dbt.get_snapshot_get_time_data_type", "macro_sql": "{% macro get_snapshot_get_time_data_type() %}\n {% set snapshot_time = adapter.dispatch('snapshot_get_time', 'dbt')() %}\n {% set time_data_type_sql = 'select ' ~ snapshot_time ~ ' as dbt_snapshot_time' %}\n {% set snapshot_time_column_schema = get_column_schema_from_query(time_data_type_sql) %}\n {% set time_data_type = snapshot_time_column_schema[0].dtype %}\n {{ return(time_data_type or none) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.snapshot_get_time", "macro.dbt_postgres.postgres__snapshot_get_time", "macro.dbt.get_column_schema_from_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789079002.4946923, "supported_languages": null}, "macro.dbt.current_timestamp_backcompat": {"name": "current_timestamp_backcompat", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/timestamps.sql", "original_file_path": "macros/adapters/timestamps.sql", "unique_id": "macro.dbt.current_timestamp_backcompat", "macro_sql": "{% macro current_timestamp_backcompat() %}\n {{ return(adapter.dispatch('current_timestamp_backcompat', 'dbt')()) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__current_timestamp_backcompat"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789079002.4948962, "supported_languages": null}, "macro.dbt.default__current_timestamp_backcompat": {"name": "default__current_timestamp_backcompat", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/timestamps.sql", "original_file_path": "macros/adapters/timestamps.sql", "unique_id": "macro.dbt.default__current_timestamp_backcompat", "macro_sql": "{% macro default__current_timestamp_backcompat() %}\n current_timestamp::timestamp\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789079002.4949946, "supported_languages": null}, "macro.dbt.current_timestamp_in_utc_backcompat": {"name": "current_timestamp_in_utc_backcompat", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/timestamps.sql", "original_file_path": "macros/adapters/timestamps.sql", "unique_id": "macro.dbt.current_timestamp_in_utc_backcompat", "macro_sql": "{% macro current_timestamp_in_utc_backcompat() %}\n {{ return(adapter.dispatch('current_timestamp_in_utc_backcompat', 'dbt')()) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__current_timestamp_in_utc_backcompat"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789079002.4951758, "supported_languages": null}, "macro.dbt.default__current_timestamp_in_utc_backcompat": {"name": "default__current_timestamp_in_utc_backcompat", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/timestamps.sql", "original_file_path": "macros/adapters/timestamps.sql", "unique_id": "macro.dbt.default__current_timestamp_in_utc_backcompat", "macro_sql": "{% macro default__current_timestamp_in_utc_backcompat() %}\n {{ return(adapter.dispatch('current_timestamp_backcompat', 'dbt')()) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.current_timestamp_backcompat", "macro.dbt_postgres.postgres__current_timestamp_backcompat"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789079002.495359, "supported_languages": null}, "macro.dbt.create_schema": {"name": "create_schema", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/schema.sql", "original_file_path": "macros/adapters/schema.sql", "unique_id": "macro.dbt.create_schema", "macro_sql": "{% macro create_schema(relation) -%}\n {{ adapter.dispatch('create_schema', 'dbt')(relation) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__create_schema"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789079002.495715, "supported_languages": null}, "macro.dbt.default__create_schema": {"name": "default__create_schema", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/schema.sql", "original_file_path": "macros/adapters/schema.sql", "unique_id": "macro.dbt.default__create_schema", "macro_sql": "{% macro default__create_schema(relation) -%}\n {%- call statement('create_schema') -%}\n create schema if not exists {{ relation.without_identifier() }}\n {% endcall %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789079002.495942, "supported_languages": null}, "macro.dbt.drop_schema": {"name": "drop_schema", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/schema.sql", "original_file_path": "macros/adapters/schema.sql", "unique_id": "macro.dbt.drop_schema", "macro_sql": "{% macro drop_schema(relation) -%}\n {{ adapter.dispatch('drop_schema', 'dbt')(relation) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__drop_schema"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789079002.4961252, "supported_languages": null}, "macro.dbt.default__drop_schema": {"name": "default__drop_schema", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/schema.sql", "original_file_path": "macros/adapters/schema.sql", "unique_id": "macro.dbt.default__drop_schema", "macro_sql": "{% macro default__drop_schema(relation) -%}\n {%- call statement('drop_schema') -%}\n drop schema if exists {{ relation.without_identifier() }} cascade\n {% endcall %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789079002.4963293, "supported_languages": null}, "macro.dbt.copy_grants": {"name": "copy_grants", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "unique_id": "macro.dbt.copy_grants", "macro_sql": "{% macro copy_grants() %}\n {{ return(adapter.dispatch('copy_grants', 'dbt')()) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__copy_grants"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789079002.497558, "supported_languages": null}, "macro.dbt.default__copy_grants": {"name": "default__copy_grants", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "unique_id": "macro.dbt.default__copy_grants", "macro_sql": "{% macro default__copy_grants() %}\n {{ return(True) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789079002.497701, "supported_languages": null}, "macro.dbt.support_multiple_grantees_per_dcl_statement": {"name": "support_multiple_grantees_per_dcl_statement", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "unique_id": "macro.dbt.support_multiple_grantees_per_dcl_statement", "macro_sql": "{% macro support_multiple_grantees_per_dcl_statement() %}\n {{ return(adapter.dispatch('support_multiple_grantees_per_dcl_statement', 'dbt')()) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__support_multiple_grantees_per_dcl_statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789079002.497902, "supported_languages": null}, "macro.dbt.default__support_multiple_grantees_per_dcl_statement": {"name": "default__support_multiple_grantees_per_dcl_statement", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "unique_id": "macro.dbt.default__support_multiple_grantees_per_dcl_statement", "macro_sql": "\n\n{%- macro default__support_multiple_grantees_per_dcl_statement() -%}\n {{ return(True) }}\n{%- endmacro -%}\n\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789079002.4980433, "supported_languages": null}, "macro.dbt.should_revoke": {"name": "should_revoke", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "unique_id": "macro.dbt.should_revoke", "macro_sql": "{% macro should_revoke(existing_relation, full_refresh_mode=True) %}\n\n {% if not existing_relation %}\n {#-- The table doesn't already exist, so no grants to copy over --#}\n {{ return(False) }}\n {% elif full_refresh_mode %}\n {#-- The object is being REPLACED -- whether grants are copied over depends on the value of user config --#}\n {{ return(copy_grants()) }}\n {% else %}\n {#-- The table is being merged/upserted/inserted -- grants will be carried over --#}\n {{ return(True) }}\n {% endif %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.copy_grants"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "existing_relation", "type": null, "description": ""}, {"name": "full_refresh_mode", "type": null, "description": ""}], "created_at": 1789079002.4985101, "supported_languages": null}, "macro.dbt.get_show_grant_sql": {"name": "get_show_grant_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "unique_id": "macro.dbt.get_show_grant_sql", "macro_sql": "{% macro get_show_grant_sql(relation) %}\n {{ return(adapter.dispatch(\"get_show_grant_sql\", \"dbt\")(relation)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__get_show_grant_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789079002.4987285, "supported_languages": null}, "macro.dbt.default__get_show_grant_sql": {"name": "default__get_show_grant_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "unique_id": "macro.dbt.default__get_show_grant_sql", "macro_sql": "{% macro default__get_show_grant_sql(relation) %}\n show grants on {{ relation.render() }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789079002.4988847, "supported_languages": null}, "macro.dbt.get_grant_sql": {"name": "get_grant_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "unique_id": "macro.dbt.get_grant_sql", "macro_sql": "{% macro get_grant_sql(relation, privilege, grantees) %}\n {{ return(adapter.dispatch('get_grant_sql', 'dbt')(relation, privilege, grantees)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_grant_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "privilege", "type": null, "description": ""}, {"name": "grantees", "type": null, "description": ""}], "created_at": 1789079002.4991384, "supported_languages": null}, "macro.dbt.default__get_grant_sql": {"name": "default__get_grant_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "unique_id": "macro.dbt.default__get_grant_sql", "macro_sql": "\n\n{%- macro default__get_grant_sql(relation, privilege, grantees) -%}\n grant {{ privilege }} on {{ relation.render() }} to {{ grantees | join(', ') }}\n{%- endmacro -%}\n\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "privilege", "type": null, "description": ""}, {"name": "grantees", "type": null, "description": ""}], "created_at": 1789079002.4993806, "supported_languages": null}, "macro.dbt.get_revoke_sql": {"name": "get_revoke_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "unique_id": "macro.dbt.get_revoke_sql", "macro_sql": "{% macro get_revoke_sql(relation, privilege, grantees) %}\n {{ return(adapter.dispatch('get_revoke_sql', 'dbt')(relation, privilege, grantees)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_revoke_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "privilege", "type": null, "description": ""}, {"name": "grantees", "type": null, "description": ""}], "created_at": 1789079002.499642, "supported_languages": null}, "macro.dbt.default__get_revoke_sql": {"name": "default__get_revoke_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "unique_id": "macro.dbt.default__get_revoke_sql", "macro_sql": "\n\n{%- macro default__get_revoke_sql(relation, privilege, grantees) -%}\n {%- set quoted_grantees = [] -%}\n {%- for grantee in grantees -%}\n {%- do quoted_grantees.append(adapter.quote(grantee)) -%}\n {%- endfor -%}\n revoke {{ privilege }} on {{ relation.render() }} from {{ quoted_grantees | join(', ') }}\n{%- endmacro -%}\n\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "privilege", "type": null, "description": ""}, {"name": "grantees", "type": null, "description": ""}], "created_at": 1789079002.500081, "supported_languages": null}, "macro.dbt.get_dcl_statement_list": {"name": "get_dcl_statement_list", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "unique_id": "macro.dbt.get_dcl_statement_list", "macro_sql": "{% macro get_dcl_statement_list(relation, grant_config, get_dcl_macro) %}\n {{ return(adapter.dispatch('get_dcl_statement_list', 'dbt')(relation, grant_config, get_dcl_macro)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_dcl_statement_list"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "grant_config", "type": null, "description": ""}, {"name": "get_dcl_macro", "type": null, "description": ""}], "created_at": 1789079002.5003345, "supported_languages": null}, "macro.dbt.default__get_dcl_statement_list": {"name": "default__get_dcl_statement_list", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "unique_id": "macro.dbt.default__get_dcl_statement_list", "macro_sql": "\n\n{%- macro default__get_dcl_statement_list(relation, grant_config, get_dcl_macro) -%}\n {#\n -- Unpack grant_config into specific privileges and the set of users who need them granted/revoked.\n -- Depending on whether this database supports multiple grantees per statement, pass in the list of\n -- all grantees per privilege, or (if not) template one statement per privilege-grantee pair.\n -- `get_dcl_macro` will be either `get_grant_sql` or `get_revoke_sql`\n #}\n {%- set dcl_statements = [] -%}\n {%- for privilege, grantees in grant_config.items() %}\n {%- if support_multiple_grantees_per_dcl_statement() and grantees -%}\n {%- set dcl = get_dcl_macro(relation, privilege, grantees) -%}\n {%- do dcl_statements.append(dcl) -%}\n {%- else -%}\n {%- for grantee in grantees -%}\n {% set dcl = get_dcl_macro(relation, privilege, [grantee]) %}\n {%- do dcl_statements.append(dcl) -%}\n {% endfor -%}\n {%- endif -%}\n {%- endfor -%}\n {{ return(dcl_statements) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.support_multiple_grantees_per_dcl_statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "grant_config", "type": null, "description": ""}, {"name": "get_dcl_macro", "type": null, "description": ""}], "created_at": 1789079002.5010939, "supported_languages": null}, "macro.dbt.call_dcl_statements": {"name": "call_dcl_statements", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "unique_id": "macro.dbt.call_dcl_statements", "macro_sql": "{% macro call_dcl_statements(dcl_statement_list) %}\n {{ return(adapter.dispatch(\"call_dcl_statements\", \"dbt\")(dcl_statement_list)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__call_dcl_statements"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "dcl_statement_list", "type": null, "description": ""}], "created_at": 1789079002.5013094, "supported_languages": null}, "macro.dbt.default__call_dcl_statements": {"name": "default__call_dcl_statements", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "unique_id": "macro.dbt.default__call_dcl_statements", "macro_sql": "{% macro default__call_dcl_statements(dcl_statement_list) %}\n {#\n -- By default, supply all grant + revoke statements in a single semicolon-separated block,\n -- so that they're all processed together.\n\n -- Some databases do not support this. Those adapters will need to override this macro\n -- to run each statement individually.\n #}\n {% call statement('grants') %}\n {% for dcl_statement in dcl_statement_list %}\n {{ dcl_statement }};\n {% endfor %}\n {% endcall %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "dcl_statement_list", "type": null, "description": ""}], "created_at": 1789079002.501583, "supported_languages": null}, "macro.dbt.apply_grants": {"name": "apply_grants", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "unique_id": "macro.dbt.apply_grants", "macro_sql": "{% macro apply_grants(relation, grant_config, should_revoke) %}\n {{ return(adapter.dispatch(\"apply_grants\", \"dbt\")(relation, grant_config, should_revoke)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__apply_grants"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "grant_config", "type": null, "description": ""}, {"name": "should_revoke", "type": null, "description": ""}], "created_at": 1789079002.5018415, "supported_languages": null}, "macro.dbt.default__apply_grants": {"name": "default__apply_grants", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "unique_id": "macro.dbt.default__apply_grants", "macro_sql": "{% macro default__apply_grants(relation, grant_config, should_revoke=True) %}\n {#-- If grant_config is {} or None, this is a no-op --#}\n {% if grant_config %}\n {% if should_revoke %}\n {#-- We think previous grants may have carried over --#}\n {#-- Show current grants and calculate diffs --#}\n {% set current_grants_table = run_query(get_show_grant_sql(relation)) %}\n {% set current_grants_dict = adapter.standardize_grants_dict(current_grants_table) %}\n {% set needs_granting = diff_of_two_dicts(grant_config, current_grants_dict) %}\n {% set needs_revoking = diff_of_two_dicts(current_grants_dict, grant_config) %}\n {% if not (needs_granting or needs_revoking) %}\n {{ log('On ' ~ relation.render() ~': All grants are in place, no revocation or granting needed.')}}\n {% endif %}\n {% else %}\n {#-- We don't think there's any chance of previous grants having carried over. --#}\n {#-- Jump straight to granting what the user has configured. --#}\n {% set needs_revoking = {} %}\n {% set needs_granting = grant_config %}\n {% endif %}\n {% if needs_granting or needs_revoking %}\n {% set revoke_statement_list = get_dcl_statement_list(relation, needs_revoking, get_revoke_sql) %}\n {% set grant_statement_list = get_dcl_statement_list(relation, needs_granting, get_grant_sql) %}\n {% set dcl_statement_list = revoke_statement_list + grant_statement_list %}\n {% if dcl_statement_list %}\n {{ call_dcl_statements(dcl_statement_list) }}\n {% endif %}\n {% endif %}\n {% endif %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.run_query", "macro.dbt.get_show_grant_sql", "macro.dbt.get_dcl_statement_list", "macro.dbt.call_dcl_statements"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "grant_config", "type": null, "description": ""}, {"name": "should_revoke", "type": null, "description": ""}], "created_at": 1789079002.5031998, "supported_languages": null}, "macro.dbt.is_core_v2": {"name": "is_core_v2", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/runtime.sql", "original_file_path": "macros/adapters/runtime.sql", "unique_id": "macro.dbt.is_core_v2", "macro_sql": "{% macro is_core_v2() -%}\n {%- set major_version = (dbt_version.split('.') | first) | int -%}\n {{ return(major_version == 2) }}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789079002.5035512, "supported_languages": null}, "macro.dbt.alter_column_comment": {"name": "alter_column_comment", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/persist_docs.sql", "original_file_path": "macros/adapters/persist_docs.sql", "unique_id": "macro.dbt.alter_column_comment", "macro_sql": "{% macro alter_column_comment(relation, column_dict) -%}\n {{ return(adapter.dispatch('alter_column_comment', 'dbt')(relation, column_dict)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__alter_column_comment"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "column_dict", "type": null, "description": ""}], "created_at": 1789079002.5042725, "supported_languages": null}, "macro.dbt.default__alter_column_comment": {"name": "default__alter_column_comment", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/persist_docs.sql", "original_file_path": "macros/adapters/persist_docs.sql", "unique_id": "macro.dbt.default__alter_column_comment", "macro_sql": "{% macro default__alter_column_comment(relation, column_dict) -%}\n {{ exceptions.raise_not_implemented(\n 'alter_column_comment macro not implemented for adapter '+adapter.type()) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "column_dict", "type": null, "description": ""}], "created_at": 1789079002.5044653, "supported_languages": null}, "macro.dbt.alter_relation_comment": {"name": "alter_relation_comment", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/persist_docs.sql", "original_file_path": "macros/adapters/persist_docs.sql", "unique_id": "macro.dbt.alter_relation_comment", "macro_sql": "{% macro alter_relation_comment(relation, relation_comment) -%}\n {{ return(adapter.dispatch('alter_relation_comment', 'dbt')(relation, relation_comment)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__alter_relation_comment"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "relation_comment", "type": null, "description": ""}], "created_at": 1789079002.504693, "supported_languages": null}, "macro.dbt.default__alter_relation_comment": {"name": "default__alter_relation_comment", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/persist_docs.sql", "original_file_path": "macros/adapters/persist_docs.sql", "unique_id": "macro.dbt.default__alter_relation_comment", "macro_sql": "{% macro default__alter_relation_comment(relation, relation_comment) -%}\n {{ exceptions.raise_not_implemented(\n 'alter_relation_comment macro not implemented for adapter '+adapter.type()) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "relation_comment", "type": null, "description": ""}], "created_at": 1789079002.5049126, "supported_languages": null}, "macro.dbt.persist_docs": {"name": "persist_docs", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/persist_docs.sql", "original_file_path": "macros/adapters/persist_docs.sql", "unique_id": "macro.dbt.persist_docs", "macro_sql": "{% macro persist_docs(relation, model, for_relation=true, for_columns=true) -%}\n {{ return(adapter.dispatch('persist_docs', 'dbt')(relation, model, for_relation, for_columns)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__persist_docs"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "model", "type": null, "description": ""}, {"name": "for_relation", "type": null, "description": ""}, {"name": "for_columns", "type": null, "description": ""}], "created_at": 1789079002.5052104, "supported_languages": null}, "macro.dbt.validate_doc_columns": {"name": "validate_doc_columns", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/persist_docs.sql", "original_file_path": "macros/adapters/persist_docs.sql", "unique_id": "macro.dbt.validate_doc_columns", "macro_sql": "{% macro validate_doc_columns(relation, column_dict, existing_column_names) %}\n {% set existing_lower = existing_column_names | map(\"lower\") | list %}\n {% set missing = [] %}\n {% set filtered = {} %}\n {% for col_name in column_dict %}\n {% set is_quoted = column_dict[col_name]['quote'] %}\n {% if is_quoted %}\n {% set present = col_name in existing_column_names %}\n {% else %}\n {% set present = col_name | lower in existing_lower %}\n {% endif %}\n {% if present %}\n {% do filtered.update({col_name: column_dict[col_name]}) %}\n {% else %}\n {% do missing.append(col_name) %}\n {% endif %}\n {% endfor %}\n {% if missing | length > 0 %}\n {{ exceptions.warn(\"In relation \" ~ relation.render() ~ \": The following columns are specified in the schema but are not present in the database: \" ~ missing | join(\", \")) }}\n {% endif %}\n {{ return(filtered) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "column_dict", "type": null, "description": ""}, {"name": "existing_column_names", "type": null, "description": ""}], "created_at": 1789079002.5063727, "supported_languages": null}, "macro.dbt.default__persist_docs": {"name": "default__persist_docs", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/persist_docs.sql", "original_file_path": "macros/adapters/persist_docs.sql", "unique_id": "macro.dbt.default__persist_docs", "macro_sql": "{% macro default__persist_docs(relation, model, for_relation, for_columns) -%}\n {% if for_relation and config.persist_relation_docs() and model.description %}\n {% do run_query(alter_relation_comment(relation, model.description)) %}\n {% endif %}\n\n {% if for_columns and config.persist_column_docs() and model.columns %}\n {% set existing_columns = adapter.get_columns_in_relation(relation) | map(attribute=\"name\") | list %}\n {% set filtered_columns = validate_doc_columns(relation, model.columns, existing_columns) %}\n {% set alter_comment_sql = alter_column_comment(relation, filtered_columns) %}\n {% if alter_comment_sql and alter_comment_sql | trim | length > 0 %}\n {% do run_query(alter_comment_sql) %}\n {% endif %}\n {% endif %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.run_query", "macro.dbt.alter_relation_comment", "macro.dbt.validate_doc_columns", "macro.dbt.alter_column_comment"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "model", "type": null, "description": ""}, {"name": "for_relation", "type": null, "description": ""}, {"name": "for_columns", "type": null, "description": ""}], "created_at": 1789079002.5073495, "supported_languages": null}, "macro.dbt.get_columns_in_relation": {"name": "get_columns_in_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "unique_id": "macro.dbt.get_columns_in_relation", "macro_sql": "{% macro get_columns_in_relation(relation) -%}\n {{ return(adapter.dispatch('get_columns_in_relation', 'dbt')(relation)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__get_columns_in_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789079002.5086434, "supported_languages": null}, "macro.dbt.default__get_columns_in_relation": {"name": "default__get_columns_in_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "unique_id": "macro.dbt.default__get_columns_in_relation", "macro_sql": "{% macro default__get_columns_in_relation(relation) -%}\n {{ exceptions.raise_not_implemented(\n 'get_columns_in_relation macro not implemented for adapter '+adapter.type()) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789079002.508836, "supported_languages": null}, "macro.dbt.sql_convert_columns_in_relation": {"name": "sql_convert_columns_in_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "unique_id": "macro.dbt.sql_convert_columns_in_relation", "macro_sql": "{% macro sql_convert_columns_in_relation(table) -%}\n {% set columns = [] %}\n {% for row in table %}\n {% do columns.append(api.Column(*row)) %}\n {% endfor %}\n {{ return(columns) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "table", "type": null, "description": ""}], "created_at": 1789079002.5092123, "supported_languages": null}, "macro.dbt.get_list_of_column_names": {"name": "get_list_of_column_names", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "unique_id": "macro.dbt.get_list_of_column_names", "macro_sql": "\n\n{%- macro get_list_of_column_names(columns) -%}\n {% set col_names = [] %}\n {% for col in columns %}\n {% do col_names.append(col.name) %}\n {% endfor %}\n {{ return(col_names) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "columns", "type": null, "description": ""}], "created_at": 1789079002.509544, "supported_languages": null}, "macro.dbt.get_empty_subquery_sql": {"name": "get_empty_subquery_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "unique_id": "macro.dbt.get_empty_subquery_sql", "macro_sql": "{% macro get_empty_subquery_sql(select_sql, select_sql_header=none) -%}\n {{ return(adapter.dispatch('get_empty_subquery_sql', 'dbt')(select_sql, select_sql_header)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_empty_subquery_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "select_sql", "type": null, "description": ""}, {"name": "select_sql_header", "type": null, "description": ""}], "created_at": 1789079002.5097857, "supported_languages": null}, "macro.dbt.default__get_empty_subquery_sql": {"name": "default__get_empty_subquery_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "unique_id": "macro.dbt.default__get_empty_subquery_sql", "macro_sql": "{% macro default__get_empty_subquery_sql(select_sql, select_sql_header=none) %}\n {%- if select_sql_header is not none -%}\n {{ select_sql_header }}\n {%- endif -%}\n select * from (\n {{ select_sql }}\n ) as __dbt_sbq\n where false\n limit 0\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "select_sql", "type": null, "description": ""}, {"name": "select_sql_header", "type": null, "description": ""}], "created_at": 1789079002.5100405, "supported_languages": null}, "macro.dbt.get_empty_schema_sql": {"name": "get_empty_schema_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "unique_id": "macro.dbt.get_empty_schema_sql", "macro_sql": "{% macro get_empty_schema_sql(columns) -%}\n {{ return(adapter.dispatch('get_empty_schema_sql', 'dbt')(columns)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_empty_schema_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "columns", "type": null, "description": ""}], "created_at": 1789079002.5102458, "supported_languages": null}, "macro.dbt.default__get_empty_schema_sql": {"name": "default__get_empty_schema_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "unique_id": "macro.dbt.default__get_empty_schema_sql", "macro_sql": "{% macro default__get_empty_schema_sql(columns) %}\n {%- set col_err = [] -%}\n {%- set col_naked_numeric = [] -%}\n select\n {% for i in columns %}\n {%- set col = columns[i] -%}\n {%- if col['data_type'] is not defined -%}\n {%- do col_err.append(col['name']) -%}\n {#-- If this column's type is just 'numeric' then it is missing precision/scale, raise a warning --#}\n {%- elif col['data_type'].strip().lower() in ('numeric', 'decimal', 'number') -%}\n {%- do col_naked_numeric.append(col['name']) -%}\n {%- endif -%}\n {% set col_name = adapter.quote(col['name']) if col.get('quote') else col['name'] %}\n {{ cast('null', col['data_type']) }} as {{ col_name }}{{ \", \" if not loop.last }}\n {%- endfor -%}\n {%- if (col_err | length) > 0 -%}\n {{ exceptions.column_type_missing(column_names=col_err) }}\n {%- elif (col_naked_numeric | length) > 0 -%}\n {{ exceptions.warn(\"Detected columns with numeric type and unspecified precision/scale, this can lead to unintended rounding: \" ~ col_naked_numeric ~ \"`\") }}\n {%- endif -%}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.cast"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "columns", "type": null, "description": ""}], "created_at": 1789079002.511528, "supported_languages": null}, "macro.dbt.get_column_schema_from_query": {"name": "get_column_schema_from_query", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "unique_id": "macro.dbt.get_column_schema_from_query", "macro_sql": "{% macro get_column_schema_from_query(select_sql, select_sql_header=none) -%}\n {% set columns = [] %}\n {# -- Using an 'empty subquery' here to get the same schema as the given select_sql statement, without necessitating a data scan.#}\n {% set sql = get_empty_subquery_sql(select_sql, select_sql_header) %}\n {% set column_schema = adapter.get_column_schema_from_query(sql) %}\n {{ return(column_schema) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_empty_subquery_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "select_sql", "type": null, "description": ""}, {"name": "select_sql_header", "type": null, "description": ""}], "created_at": 1789079002.5119407, "supported_languages": null}, "macro.dbt.get_columns_in_query": {"name": "get_columns_in_query", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "unique_id": "macro.dbt.get_columns_in_query", "macro_sql": "{% macro get_columns_in_query(select_sql) -%}\n {{ return(adapter.dispatch('get_columns_in_query', 'dbt')(select_sql)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_columns_in_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "select_sql", "type": null, "description": ""}], "created_at": 1789079002.512151, "supported_languages": null}, "macro.dbt.default__get_columns_in_query": {"name": "default__get_columns_in_query", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "unique_id": "macro.dbt.default__get_columns_in_query", "macro_sql": "{% macro default__get_columns_in_query(select_sql) %}\n {% call statement('get_columns_in_query', fetch_result=True, auto_begin=False) -%}\n {{ get_empty_subquery_sql(select_sql) }}\n {% endcall %}\n {{ return(load_result('get_columns_in_query').table.columns | map(attribute='name') | list) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement", "macro.dbt.get_empty_subquery_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "select_sql", "type": null, "description": ""}], "created_at": 1789079002.5125313, "supported_languages": null}, "macro.dbt.alter_column_type": {"name": "alter_column_type", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "unique_id": "macro.dbt.alter_column_type", "macro_sql": "{% macro alter_column_type(relation, column_name, new_column_type) -%}\n {{ return(adapter.dispatch('alter_column_type', 'dbt')(relation, column_name, new_column_type)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__alter_column_type"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "column_name", "type": null, "description": ""}, {"name": "new_column_type", "type": null, "description": ""}], "created_at": 1789079002.5127854, "supported_languages": null}, "macro.dbt.default__alter_column_type": {"name": "default__alter_column_type", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "unique_id": "macro.dbt.default__alter_column_type", "macro_sql": "{% macro default__alter_column_type(relation, column_name, new_column_type) -%}\n {#\n 1. Create a new column (w/ temp name and correct type)\n 2. Copy data over to it\n 3. Drop the existing column (cascade!)\n 4. Rename the new column to existing column\n #}\n {%- set tmp_column = column_name + \"__dbt_alter\" -%}\n\n {% call statement('alter_column_type') %}\n alter table {{ relation.render() }} add column {{ adapter.quote(tmp_column) }} {{ new_column_type }};\n update {{ relation.render() }} set {{ adapter.quote(tmp_column) }} = {{ adapter.quote(column_name) }};\n alter table {{ relation.render() }} drop column {{ adapter.quote(column_name) }} cascade;\n alter table {{ relation.render() }} rename column {{ adapter.quote(tmp_column) }} to {{ adapter.quote(column_name) }}\n {% endcall %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "column_name", "type": null, "description": ""}, {"name": "new_column_type", "type": null, "description": ""}], "created_at": 1789079002.5135987, "supported_languages": null}, "macro.dbt.alter_relation_add_remove_columns": {"name": "alter_relation_add_remove_columns", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "unique_id": "macro.dbt.alter_relation_add_remove_columns", "macro_sql": "{% macro alter_relation_add_remove_columns(relation, add_columns = none, remove_columns = none) -%}\n {{ return(adapter.dispatch('alter_relation_add_remove_columns', 'dbt')(relation, add_columns, remove_columns)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__alter_relation_add_remove_columns"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "add_columns", "type": null, "description": ""}, {"name": "remove_columns", "type": null, "description": ""}], "created_at": 1789079002.5139062, "supported_languages": null}, "macro.dbt.default__alter_relation_add_remove_columns": {"name": "default__alter_relation_add_remove_columns", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "unique_id": "macro.dbt.default__alter_relation_add_remove_columns", "macro_sql": "{% macro default__alter_relation_add_remove_columns(relation, add_columns, remove_columns) %}\n\n {% if add_columns is none %}\n {% set add_columns = [] %}\n {% endif %}\n {% if remove_columns is none %}\n {% set remove_columns = [] %}\n {% endif %}\n\n {% set sql -%}\n\n alter {{ relation.type }} {{ relation.render() }}\n\n {% for column in add_columns %}\n add column {{ column.quoted }} {{ column.expanded_data_type }}{{ ',' if not loop.last }}\n {% endfor %}{{ ',' if add_columns and remove_columns }}\n\n {% for column in remove_columns %}\n drop column {{ column.quoted }}{{ ',' if not loop.last }}\n {% endfor %}\n\n {%- endset -%}\n\n {% do run_query(sql) %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "add_columns", "type": null, "description": ""}, {"name": "remove_columns", "type": null, "description": ""}], "created_at": 1789079002.5147784, "supported_languages": null}, "macro.dbt.get_create_index_sql": {"name": "get_create_index_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/indexes.sql", "original_file_path": "macros/adapters/indexes.sql", "unique_id": "macro.dbt.get_create_index_sql", "macro_sql": "{% macro get_create_index_sql(relation, index_dict) -%}\n {{ return(adapter.dispatch('get_create_index_sql', 'dbt')(relation, index_dict)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__get_create_index_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "index_dict", "type": null, "description": ""}], "created_at": 1789079002.5153437, "supported_languages": null}, "macro.dbt.default__get_create_index_sql": {"name": "default__get_create_index_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/indexes.sql", "original_file_path": "macros/adapters/indexes.sql", "unique_id": "macro.dbt.default__get_create_index_sql", "macro_sql": "{% macro default__get_create_index_sql(relation, index_dict) -%}\n {% do return(None) %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "index_dict", "type": null, "description": ""}], "created_at": 1789079002.5155072, "supported_languages": null}, "macro.dbt.create_indexes": {"name": "create_indexes", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/indexes.sql", "original_file_path": "macros/adapters/indexes.sql", "unique_id": "macro.dbt.create_indexes", "macro_sql": "{% macro create_indexes(relation) -%}\n {{ adapter.dispatch('create_indexes', 'dbt')(relation) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__create_indexes"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789079002.5156906, "supported_languages": null}, "macro.dbt.default__create_indexes": {"name": "default__create_indexes", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/indexes.sql", "original_file_path": "macros/adapters/indexes.sql", "unique_id": "macro.dbt.default__create_indexes", "macro_sql": "{% macro default__create_indexes(relation) -%}\n {%- set _indexes = config.get('indexes', default=[]) -%}\n\n {% for _index_dict in _indexes %}\n {% set create_index_sql = get_create_index_sql(relation, _index_dict) %}\n {% if create_index_sql %}\n {% do run_query(create_index_sql) %}\n {% endif %}\n {% endfor %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_create_index_sql", "macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789079002.5161498, "supported_languages": null}, "macro.dbt.get_drop_index_sql": {"name": "get_drop_index_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/indexes.sql", "original_file_path": "macros/adapters/indexes.sql", "unique_id": "macro.dbt.get_drop_index_sql", "macro_sql": "{% macro get_drop_index_sql(relation, index_name) -%}\n {{ adapter.dispatch('get_drop_index_sql', 'dbt')(relation, index_name) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__get_drop_index_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "index_name", "type": null, "description": ""}], "created_at": 1789079002.51636, "supported_languages": null}, "macro.dbt.default__get_drop_index_sql": {"name": "default__get_drop_index_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/indexes.sql", "original_file_path": "macros/adapters/indexes.sql", "unique_id": "macro.dbt.default__get_drop_index_sql", "macro_sql": "{% macro default__get_drop_index_sql(relation, index_name) -%}\n {{ exceptions.raise_compiler_error(\"`get_drop_index_sql has not been implemented for this adapter.\") }}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "index_name", "type": null, "description": ""}], "created_at": 1789079002.5165179, "supported_languages": null}, "macro.dbt.get_show_indexes_sql": {"name": "get_show_indexes_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/indexes.sql", "original_file_path": "macros/adapters/indexes.sql", "unique_id": "macro.dbt.get_show_indexes_sql", "macro_sql": "{% macro get_show_indexes_sql(relation) -%}\n {{ adapter.dispatch('get_show_indexes_sql', 'dbt')(relation) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__get_show_indexes_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789079002.516696, "supported_languages": null}, "macro.dbt.default__get_show_indexes_sql": {"name": "default__get_show_indexes_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/indexes.sql", "original_file_path": "macros/adapters/indexes.sql", "unique_id": "macro.dbt.default__get_show_indexes_sql", "macro_sql": "{% macro default__get_show_indexes_sql(relation) -%}\n {{ exceptions.raise_compiler_error(\"`get_show_indexes_sql has not been implemented for this adapter.\") }}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789079002.5168426, "supported_languages": null}, "macro.dbt.get_catalog_relations": {"name": "get_catalog_relations", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "unique_id": "macro.dbt.get_catalog_relations", "macro_sql": "{% macro get_catalog_relations(information_schema, relations) -%}\n {{ return(adapter.dispatch('get_catalog_relations', 'dbt')(information_schema, relations)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__get_catalog_relations"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "information_schema", "type": null, "description": ""}, {"name": "relations", "type": null, "description": ""}], "created_at": 1789079002.5178187, "supported_languages": null}, "macro.dbt.default__get_catalog_relations": {"name": "default__get_catalog_relations", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "unique_id": "macro.dbt.default__get_catalog_relations", "macro_sql": "{% macro default__get_catalog_relations(information_schema, relations) -%}\n {% set typename = adapter.type() %}\n {% set msg -%}\n get_catalog_relations not implemented for {{ typename }}\n {%- endset %}\n\n {{ exceptions.raise_compiler_error(msg) }}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "information_schema", "type": null, "description": ""}, {"name": "relations", "type": null, "description": ""}], "created_at": 1789079002.5181391, "supported_languages": null}, "macro.dbt.get_catalog": {"name": "get_catalog", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "unique_id": "macro.dbt.get_catalog", "macro_sql": "{% macro get_catalog(information_schema, schemas) -%}\n {{ return(adapter.dispatch('get_catalog', 'dbt')(information_schema, schemas)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__get_catalog"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "information_schema", "type": null, "description": ""}, {"name": "schemas", "type": null, "description": ""}], "created_at": 1789079002.5183685, "supported_languages": null}, "macro.dbt.default__get_catalog": {"name": "default__get_catalog", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "unique_id": "macro.dbt.default__get_catalog", "macro_sql": "{% macro default__get_catalog(information_schema, schemas) -%}\n\n {% set typename = adapter.type() %}\n {% set msg -%}\n get_catalog not implemented for {{ typename }}\n {%- endset %}\n\n {{ exceptions.raise_compiler_error(msg) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "information_schema", "type": null, "description": ""}, {"name": "schemas", "type": null, "description": ""}], "created_at": 1789079002.518662, "supported_languages": null}, "macro.dbt.information_schema_name": {"name": "information_schema_name", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "unique_id": "macro.dbt.information_schema_name", "macro_sql": "{% macro information_schema_name(database) %}\n {{ return(adapter.dispatch('information_schema_name', 'dbt')(database)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__information_schema_name"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "database", "type": null, "description": ""}], "created_at": 1789079002.5188832, "supported_languages": null}, "macro.dbt.default__information_schema_name": {"name": "default__information_schema_name", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "unique_id": "macro.dbt.default__information_schema_name", "macro_sql": "{% macro default__information_schema_name(database) -%}\n {%- if database -%}\n {{ database }}.INFORMATION_SCHEMA\n {%- else -%}\n INFORMATION_SCHEMA\n {%- endif -%}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "database", "type": null, "description": ""}], "created_at": 1789079002.519149, "supported_languages": null}, "macro.dbt.list_schemas": {"name": "list_schemas", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "unique_id": "macro.dbt.list_schemas", "macro_sql": "{% macro list_schemas(database) -%}\n {{ return(adapter.dispatch('list_schemas', 'dbt')(database)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__list_schemas"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "database", "type": null, "description": ""}], "created_at": 1789079002.5193582, "supported_languages": null}, "macro.dbt.default__list_schemas": {"name": "default__list_schemas", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "unique_id": "macro.dbt.default__list_schemas", "macro_sql": "{% macro default__list_schemas(database) -%}\n {% set sql %}\n select distinct schema_name\n from {{ information_schema_name(database) }}.SCHEMATA\n where catalog_name ilike '{{ database }}'\n {% endset %}\n {{ return(run_query(sql)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.information_schema_name", "macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "database", "type": null, "description": ""}], "created_at": 1789079002.5196397, "supported_languages": null}, "macro.dbt.check_schema_exists": {"name": "check_schema_exists", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "unique_id": "macro.dbt.check_schema_exists", "macro_sql": "{% macro check_schema_exists(information_schema, schema) -%}\n {{ return(adapter.dispatch('check_schema_exists', 'dbt')(information_schema, schema)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__check_schema_exists"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "information_schema", "type": null, "description": ""}, {"name": "schema", "type": null, "description": ""}], "created_at": 1789079002.5198758, "supported_languages": null}, "macro.dbt.default__check_schema_exists": {"name": "default__check_schema_exists", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "unique_id": "macro.dbt.default__check_schema_exists", "macro_sql": "{% macro default__check_schema_exists(information_schema, schema) -%}\n {% set sql -%}\n select count(*)\n from {{ information_schema.replace(information_schema_view='SCHEMATA') }}\n where catalog_name='{{ information_schema.database }}'\n and schema_name='{{ schema }}'\n {%- endset %}\n {{ return(run_query(sql)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.replace", "macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "information_schema", "type": null, "description": ""}, {"name": "schema", "type": null, "description": ""}], "created_at": 1789079002.5202107, "supported_languages": null}, "macro.dbt.list_relations_without_caching": {"name": "list_relations_without_caching", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "unique_id": "macro.dbt.list_relations_without_caching", "macro_sql": "{% macro list_relations_without_caching(schema_relation) %}\n {{ return(adapter.dispatch('list_relations_without_caching', 'dbt')(schema_relation)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__list_relations_without_caching"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "schema_relation", "type": null, "description": ""}], "created_at": 1789079002.5204122, "supported_languages": null}, "macro.dbt.default__list_relations_without_caching": {"name": "default__list_relations_without_caching", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "unique_id": "macro.dbt.default__list_relations_without_caching", "macro_sql": "{% macro default__list_relations_without_caching(schema_relation) %}\n {{ exceptions.raise_not_implemented(\n 'list_relations_without_caching macro not implemented for adapter '+adapter.type()) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "schema_relation", "type": null, "description": ""}], "created_at": 1789079002.5205922, "supported_languages": null}, "macro.dbt.list_function_relations_without_caching": {"name": "list_function_relations_without_caching", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "unique_id": "macro.dbt.list_function_relations_without_caching", "macro_sql": "{% macro list_function_relations_without_caching(schema_relation) %}\n {{ return(adapter.dispatch('list_function_relations_without_caching', 'dbt')(schema_relation)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__list_function_relations_without_caching"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "schema_relation", "type": null, "description": ""}], "created_at": 1789079002.5207915, "supported_languages": null}, "macro.dbt.default__list_function_relations_without_caching": {"name": "default__list_function_relations_without_caching", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "unique_id": "macro.dbt.default__list_function_relations_without_caching", "macro_sql": "{% macro default__list_function_relations_without_caching(schema_relation) %}\n {{ exceptions.raise_not_implemented(\n 'list_function_relations_without_caching macro not implemented for adapter '+adapter.type()) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "schema_relation", "type": null, "description": ""}], "created_at": 1789079002.5209994, "supported_languages": null}, "macro.dbt.get_catalog_for_single_relation": {"name": "get_catalog_for_single_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "unique_id": "macro.dbt.get_catalog_for_single_relation", "macro_sql": "{% macro get_catalog_for_single_relation(relation) %}\n {{ return(adapter.dispatch('get_catalog_for_single_relation', 'dbt')(relation)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_catalog_for_single_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789079002.5212057, "supported_languages": null}, "macro.dbt.default__get_catalog_for_single_relation": {"name": "default__get_catalog_for_single_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "unique_id": "macro.dbt.default__get_catalog_for_single_relation", "macro_sql": "{% macro default__get_catalog_for_single_relation(relation) %}\n {{ exceptions.raise_not_implemented(\n 'get_catalog_for_single_relation macro not implemented for adapter '+adapter.type()) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789079002.5213861, "supported_languages": null}, "macro.dbt.get_relations": {"name": "get_relations", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "unique_id": "macro.dbt.get_relations", "macro_sql": "{% macro get_relations() %}\n {{ return(adapter.dispatch('get_relations', 'dbt')()) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__get_relations"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789079002.5215683, "supported_languages": null}, "macro.dbt.default__get_relations": {"name": "default__get_relations", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "unique_id": "macro.dbt.default__get_relations", "macro_sql": "{% macro default__get_relations() %}\n {{ exceptions.raise_not_implemented(\n 'get_relations macro not implemented for adapter '+adapter.type()) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789079002.521747, "supported_languages": null}, "macro.dbt.get_relation_last_modified": {"name": "get_relation_last_modified", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "unique_id": "macro.dbt.get_relation_last_modified", "macro_sql": "{% macro get_relation_last_modified(information_schema, relations) %}\n {{ return(adapter.dispatch('get_relation_last_modified', 'dbt')(information_schema, relations)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_relation_last_modified"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "information_schema", "type": null, "description": ""}, {"name": "relations", "type": null, "description": ""}], "created_at": 1789079002.5219953, "supported_languages": null}, "macro.dbt.default__get_relation_last_modified": {"name": "default__get_relation_last_modified", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "unique_id": "macro.dbt.default__get_relation_last_modified", "macro_sql": "{% macro default__get_relation_last_modified(information_schema, relations) %}\n {{ exceptions.raise_not_implemented(\n 'get_relation_last_modified macro not implemented for adapter ' + adapter.type()) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "information_schema", "type": null, "description": ""}, {"name": "relations", "type": null, "description": ""}], "created_at": 1789079002.522189, "supported_languages": null}, "macro.dbt.validate_sql": {"name": "validate_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/validate_sql.sql", "original_file_path": "macros/adapters/validate_sql.sql", "unique_id": "macro.dbt.validate_sql", "macro_sql": "{% macro validate_sql(sql) -%}\n {{ return(adapter.dispatch('validate_sql', 'dbt')(sql)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__validate_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "sql", "type": null, "description": ""}], "created_at": 1789079002.5225139, "supported_languages": null}, "macro.dbt.default__validate_sql": {"name": "default__validate_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/validate_sql.sql", "original_file_path": "macros/adapters/validate_sql.sql", "unique_id": "macro.dbt.default__validate_sql", "macro_sql": "{% macro default__validate_sql(sql) -%}\n {% call statement('validate_sql') -%}\n explain {{ sql }}\n {% endcall %}\n {{ return(load_result('validate_sql')) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "sql", "type": null, "description": ""}], "created_at": 1789079002.5228722, "supported_languages": null}, "macro.dbt.collect_freshness": {"name": "collect_freshness", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/freshness.sql", "original_file_path": "macros/adapters/freshness.sql", "unique_id": "macro.dbt.collect_freshness", "macro_sql": "{% macro collect_freshness(source, loaded_at_field, filter) %}\n {{ return(adapter.dispatch('collect_freshness', 'dbt')(source, loaded_at_field, filter))}}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__collect_freshness"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "source", "type": null, "description": ""}, {"name": "loaded_at_field", "type": null, "description": ""}, {"name": "filter", "type": null, "description": ""}], "created_at": 1789079002.5233634, "supported_languages": null}, "macro.dbt.default__collect_freshness": {"name": "default__collect_freshness", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/freshness.sql", "original_file_path": "macros/adapters/freshness.sql", "unique_id": "macro.dbt.default__collect_freshness", "macro_sql": "{% macro default__collect_freshness(source, loaded_at_field, filter) %}\n {% call statement('collect_freshness', fetch_result=True, auto_begin=False) -%}\n select\n max({{ loaded_at_field }}) as max_loaded_at,\n {{ current_timestamp() }} as snapshotted_at\n from {{ source }}\n {% if filter %}\n where {{ filter }}\n {% endif %}\n {% endcall %}\n {{ return(load_result('collect_freshness')) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement", "macro.dbt.current_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "source", "type": null, "description": ""}, {"name": "loaded_at_field", "type": null, "description": ""}, {"name": "filter", "type": null, "description": ""}], "created_at": 1789079002.5238206, "supported_languages": null}, "macro.dbt.collect_freshness_custom_sql": {"name": "collect_freshness_custom_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/freshness.sql", "original_file_path": "macros/adapters/freshness.sql", "unique_id": "macro.dbt.collect_freshness_custom_sql", "macro_sql": "{% macro collect_freshness_custom_sql(source, loaded_at_query) %}\n {{ return(adapter.dispatch('collect_freshness_custom_sql', 'dbt')(source, loaded_at_query))}}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__collect_freshness_custom_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "source", "type": null, "description": ""}, {"name": "loaded_at_query", "type": null, "description": ""}], "created_at": 1789079002.5240703, "supported_languages": null}, "macro.dbt.default__collect_freshness_custom_sql": {"name": "default__collect_freshness_custom_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/freshness.sql", "original_file_path": "macros/adapters/freshness.sql", "unique_id": "macro.dbt.default__collect_freshness_custom_sql", "macro_sql": "{% macro default__collect_freshness_custom_sql(source, loaded_at_query) %}\n {% call statement('collect_freshness_custom_sql', fetch_result=True, auto_begin=False) -%}\n with source_query as (\n {{ loaded_at_query }}\n )\n select\n (select * from source_query) as max_loaded_at,\n {{ current_timestamp() }} as snapshotted_at\n {% endcall %}\n {{ return(load_result('collect_freshness_custom_sql')) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement", "macro.dbt.current_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "source", "type": null, "description": ""}, {"name": "loaded_at_query", "type": null, "description": ""}], "created_at": 1789079002.5244246, "supported_languages": null}, "macro.dbt.make_intermediate_relation": {"name": "make_intermediate_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "unique_id": "macro.dbt.make_intermediate_relation", "macro_sql": "{% macro make_intermediate_relation(base_relation, suffix='__dbt_tmp') %}\n {{ return(adapter.dispatch('make_intermediate_relation', 'dbt')(base_relation, suffix)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__make_intermediate_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "base_relation", "type": null, "description": ""}, {"name": "suffix", "type": null, "description": ""}], "created_at": 1789079002.525204, "supported_languages": null}, "macro.dbt.default__make_intermediate_relation": {"name": "default__make_intermediate_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "unique_id": "macro.dbt.default__make_intermediate_relation", "macro_sql": "{% macro default__make_intermediate_relation(base_relation, suffix) %}\n {{ return(default__make_temp_relation(base_relation, suffix)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__make_temp_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "base_relation", "type": null, "description": ""}, {"name": "suffix", "type": null, "description": ""}], "created_at": 1789079002.525397, "supported_languages": null}, "macro.dbt.make_temp_relation": {"name": "make_temp_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "unique_id": "macro.dbt.make_temp_relation", "macro_sql": "{% macro make_temp_relation(base_relation, suffix='__dbt_tmp') %}\n {#-- This ensures microbatch batches get unique temp relations to avoid clobbering --#}\n {% if suffix == '__dbt_tmp' and model.batch %}\n {% set suffix = suffix ~ '_' ~ model.batch.id %}\n {% endif %}\n\n {{ return(adapter.dispatch('make_temp_relation', 'dbt')(base_relation, suffix)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__make_temp_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "base_relation", "type": null, "description": ""}, {"name": "suffix", "type": null, "description": ""}], "created_at": 1789079002.5258265, "supported_languages": null}, "macro.dbt.default__make_temp_relation": {"name": "default__make_temp_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "unique_id": "macro.dbt.default__make_temp_relation", "macro_sql": "{% macro default__make_temp_relation(base_relation, suffix) %}\n {%- set temp_identifier = base_relation.identifier ~ suffix -%}\n {%- set temp_relation = base_relation.incorporate(\n path={\"identifier\": temp_identifier}) -%}\n\n {{ return(temp_relation) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "base_relation", "type": null, "description": ""}, {"name": "suffix", "type": null, "description": ""}], "created_at": 1789079002.526186, "supported_languages": null}, "macro.dbt.make_backup_relation": {"name": "make_backup_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "unique_id": "macro.dbt.make_backup_relation", "macro_sql": "{% macro make_backup_relation(base_relation, backup_relation_type, suffix='__dbt_backup') %}\n {{ return(adapter.dispatch('make_backup_relation', 'dbt')(base_relation, backup_relation_type, suffix)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__make_backup_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "base_relation", "type": null, "description": ""}, {"name": "backup_relation_type", "type": null, "description": ""}, {"name": "suffix", "type": null, "description": ""}], "created_at": 1789079002.5264564, "supported_languages": null}, "macro.dbt.default__make_backup_relation": {"name": "default__make_backup_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "unique_id": "macro.dbt.default__make_backup_relation", "macro_sql": "{% macro default__make_backup_relation(base_relation, backup_relation_type, suffix) %}\n {%- set backup_identifier = base_relation.identifier ~ suffix -%}\n {%- set backup_relation = base_relation.incorporate(\n path={\"identifier\": backup_identifier},\n type=backup_relation_type\n ) -%}\n {{ return(backup_relation) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "base_relation", "type": null, "description": ""}, {"name": "backup_relation_type", "type": null, "description": ""}, {"name": "suffix", "type": null, "description": ""}], "created_at": 1789079002.5268204, "supported_languages": null}, "macro.dbt.truncate_relation": {"name": "truncate_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "unique_id": "macro.dbt.truncate_relation", "macro_sql": "{% macro truncate_relation(relation) -%}\n {{ return(adapter.dispatch('truncate_relation', 'dbt')(relation)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__truncate_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789079002.5270357, "supported_languages": null}, "macro.dbt.default__truncate_relation": {"name": "default__truncate_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "unique_id": "macro.dbt.default__truncate_relation", "macro_sql": "{% macro default__truncate_relation(relation) -%}\n {% call statement('truncate_relation') -%}\n truncate table {{ relation.render() }}\n {%- endcall %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789079002.527242, "supported_languages": null}, "macro.dbt.get_or_create_relation": {"name": "get_or_create_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "unique_id": "macro.dbt.get_or_create_relation", "macro_sql": "{% macro get_or_create_relation(database, schema, identifier, type) -%}\n {{ return(adapter.dispatch('get_or_create_relation', 'dbt')(database, schema, identifier, type)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_or_create_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "database", "type": null, "description": ""}, {"name": "schema", "type": null, "description": ""}, {"name": "identifier", "type": null, "description": ""}, {"name": "type", "type": null, "description": ""}], "created_at": 1789079002.5275087, "supported_languages": null}, "macro.dbt.default__get_or_create_relation": {"name": "default__get_or_create_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "unique_id": "macro.dbt.default__get_or_create_relation", "macro_sql": "{% macro default__get_or_create_relation(database, schema, identifier, type) %}\n {%- set target_relation = adapter.get_relation(database=database, schema=schema, identifier=identifier) %}\n\n {% if target_relation %}\n {% do return([true, target_relation]) %}\n {% endif %}\n\n {%- set new_relation = api.Relation.create(\n database=database,\n schema=schema,\n identifier=identifier,\n type=type\n ) -%}\n {% do return([false, new_relation]) %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "database", "type": null, "description": ""}, {"name": "schema", "type": null, "description": ""}, {"name": "identifier", "type": null, "description": ""}, {"name": "type", "type": null, "description": ""}], "created_at": 1789079002.5281987, "supported_languages": null}, "macro.dbt.load_cached_relation": {"name": "load_cached_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "unique_id": "macro.dbt.load_cached_relation", "macro_sql": "{% macro load_cached_relation(relation) %}\n {% do return(adapter.get_relation(\n database=relation.database,\n schema=relation.schema,\n identifier=relation.identifier\n )) -%}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789079002.5284553, "supported_languages": null}, "macro.dbt.load_relation": {"name": "load_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "unique_id": "macro.dbt.load_relation", "macro_sql": "{% macro load_relation(relation) %}\n {{ return(load_cached_relation(relation)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.load_cached_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789079002.5286186, "supported_languages": null}, "macro.dbt.test_unique": {"name": "test_unique", "resource_type": "macro", "package_name": "dbt", "path": "tests/generic/builtin.sql", "original_file_path": "tests/generic/builtin.sql", "unique_id": "macro.dbt.test_unique", "macro_sql": "{% test unique(model, column_name) %}\n {% set macro = adapter.dispatch('test_unique', 'dbt') %}\n {{ macro(model, column_name) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt.default__test_unique"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789079002.5291333, "supported_languages": null}, "macro.dbt.test_not_null": {"name": "test_not_null", "resource_type": "macro", "package_name": "dbt", "path": "tests/generic/builtin.sql", "original_file_path": "tests/generic/builtin.sql", "unique_id": "macro.dbt.test_not_null", "macro_sql": "{% test not_null(model, column_name) %}\n {% set macro = adapter.dispatch('test_not_null', 'dbt') %}\n {{ macro(model, column_name) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt.default__test_not_null"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789079002.529417, "supported_languages": null}, "macro.dbt.test_accepted_values": {"name": "test_accepted_values", "resource_type": "macro", "package_name": "dbt", "path": "tests/generic/builtin.sql", "original_file_path": "tests/generic/builtin.sql", "unique_id": "macro.dbt.test_accepted_values", "macro_sql": "{% test accepted_values(model, column_name, values, quote=True) %}\n {% set macro = adapter.dispatch('test_accepted_values', 'dbt') %}\n {{ macro(model, column_name, values, quote) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt.default__test_accepted_values"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789079002.5297556, "supported_languages": null}, "macro.dbt.test_relationships": {"name": "test_relationships", "resource_type": "macro", "package_name": "dbt", "path": "tests/generic/builtin.sql", "original_file_path": "tests/generic/builtin.sql", "unique_id": "macro.dbt.test_relationships", "macro_sql": "{% test relationships(model, column_name, to, field) %}\n {% set macro = adapter.dispatch('test_relationships', 'dbt') %}\n {{ macro(model, column_name, to, field) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt.default__test_relationships"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789079002.5301135, "supported_languages": null}, "macro.dbt_utils.slugify": {"name": "slugify", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/jinja_helpers/slugify.sql", "original_file_path": "macros/jinja_helpers/slugify.sql", "unique_id": "macro.dbt_utils.slugify", "macro_sql": "{% macro slugify(string) %}\n\n{% if not string %}\n{{ return('') }}\n{% endif %}\n\n{#- Lower case the string -#}\n{% set string = string | lower %}\n{#- Replace spaces and dashes with underscores -#}\n{% set string = modules.re.sub('[ -]+', '_', string) %}\n{#- Only take letters, numbers, and underscores -#}\n{% set string = modules.re.sub('[^a-z0-9_]+', '', string) %}\n{#- Prepends \"_\" if string begins with a number -#}\n{% set string = modules.re.sub('^[0-9]', '_' + string[0], string) %}\n\n{{ return(string) }}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "string", "type": null, "description": ""}], "created_at": 1789079002.5309591, "supported_languages": null}, "macro.dbt_utils.log_info": {"name": "log_info", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/jinja_helpers/log_info.sql", "original_file_path": "macros/jinja_helpers/log_info.sql", "unique_id": "macro.dbt_utils.log_info", "macro_sql": "{% macro log_info(message) %}\n {{ return(adapter.dispatch('log_info', 'dbt_utils')(message)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__log_info"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "message", "type": null, "description": ""}], "created_at": 1789079002.5312538, "supported_languages": null}, "macro.dbt_utils.default__log_info": {"name": "default__log_info", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/jinja_helpers/log_info.sql", "original_file_path": "macros/jinja_helpers/log_info.sql", "unique_id": "macro.dbt_utils.default__log_info", "macro_sql": "{% macro default__log_info(message) %}\n {{ log(dbt_utils.pretty_log_format(message), info=True) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.pretty_log_format"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "message", "type": null, "description": ""}], "created_at": 1789079002.5314488, "supported_languages": null}, "macro.dbt_utils.pretty_log_format": {"name": "pretty_log_format", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/jinja_helpers/pretty_log_format.sql", "original_file_path": "macros/jinja_helpers/pretty_log_format.sql", "unique_id": "macro.dbt_utils.pretty_log_format", "macro_sql": "{% macro pretty_log_format(message) %}\n {{ return(adapter.dispatch('pretty_log_format', 'dbt_utils')(message)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__pretty_log_format"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "message", "type": null, "description": ""}], "created_at": 1789079002.531745, "supported_languages": null}, "macro.dbt_utils.default__pretty_log_format": {"name": "default__pretty_log_format", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/jinja_helpers/pretty_log_format.sql", "original_file_path": "macros/jinja_helpers/pretty_log_format.sql", "unique_id": "macro.dbt_utils.default__pretty_log_format", "macro_sql": "{% macro default__pretty_log_format(message) %}\n {{ return( dbt_utils.pretty_time() ~ ' + ' ~ message) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.pretty_time"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "message", "type": null, "description": ""}], "created_at": 1789079002.5319529, "supported_languages": null}, "macro.dbt_utils._is_ephemeral": {"name": "_is_ephemeral", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/jinja_helpers/_is_ephemeral.sql", "original_file_path": "macros/jinja_helpers/_is_ephemeral.sql", "unique_id": "macro.dbt_utils._is_ephemeral", "macro_sql": "{% macro _is_ephemeral(obj, macro) %}\n {%- if obj.is_cte -%}\n {% set ephemeral_prefix = api.Relation.add_ephemeral_prefix('') %}\n {% if obj.name.startswith(ephemeral_prefix) %}\n {% set model_name = obj.name[(ephemeral_prefix|length):] %}\n {% else %}\n {% set model_name = obj.name %}\n {%- endif -%}\n {% set error_message %}\nThe `{{ macro }}` macro cannot be used with ephemeral models, as it relies on the information schema.\n\n`{{ model_name }}` is an ephemeral model. Consider making it a view or table instead.\n {% endset %}\n {%- do exceptions.raise_compiler_error(error_message) -%}\n {%- endif -%}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "obj", "type": null, "description": ""}, {"name": "macro", "type": null, "description": ""}], "created_at": 1789079002.5327363, "supported_languages": null}, "macro.dbt_utils._is_relation": {"name": "_is_relation", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/jinja_helpers/_is_relation.sql", "original_file_path": "macros/jinja_helpers/_is_relation.sql", "unique_id": "macro.dbt_utils._is_relation", "macro_sql": "{% macro _is_relation(obj, macro) %}\n {%- if not (obj is mapping and obj.get('metadata', {}).get('type', '').endswith('Relation')) -%}\n {%- do exceptions.raise_compiler_error(\"Macro \" ~ macro ~ \" expected a Relation but received the value: \" ~ obj) -%}\n {%- endif -%}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "obj", "type": null, "description": ""}, {"name": "macro", "type": null, "description": ""}], "created_at": 1789079002.5332377, "supported_languages": null}, "macro.dbt_utils.pretty_time": {"name": "pretty_time", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/jinja_helpers/pretty_time.sql", "original_file_path": "macros/jinja_helpers/pretty_time.sql", "unique_id": "macro.dbt_utils.pretty_time", "macro_sql": "{% macro pretty_time(format='%H:%M:%S') %}\n {{ return(adapter.dispatch('pretty_time', 'dbt_utils')(format)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__pretty_time"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "format", "type": null, "description": ""}], "created_at": 1789079002.5335429, "supported_languages": null}, "macro.dbt_utils.default__pretty_time": {"name": "default__pretty_time", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/jinja_helpers/pretty_time.sql", "original_file_path": "macros/jinja_helpers/pretty_time.sql", "unique_id": "macro.dbt_utils.default__pretty_time", "macro_sql": "{% macro default__pretty_time(format='%H:%M:%S') %}\n {{ return(modules.datetime.datetime.now().strftime(format)) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "format", "type": null, "description": ""}], "created_at": 1789079002.5337617, "supported_languages": null}, "macro.dbt_utils.test_not_constant": {"name": "test_not_constant", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/not_constant.sql", "original_file_path": "macros/generic_tests/not_constant.sql", "unique_id": "macro.dbt_utils.test_not_constant", "macro_sql": "{% test not_constant(model, column_name, group_by_columns = []) %}\n {{ return(adapter.dispatch('test_not_constant', 'dbt_utils')(model, column_name, group_by_columns)) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_not_constant"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "column_name", "type": null, "description": ""}, {"name": "group_by_columns", "type": null, "description": ""}], "created_at": 1789079002.5342243, "supported_languages": null}, "macro.dbt_utils.default__test_not_constant": {"name": "default__test_not_constant", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/not_constant.sql", "original_file_path": "macros/generic_tests/not_constant.sql", "unique_id": "macro.dbt_utils.default__test_not_constant", "macro_sql": "{% macro default__test_not_constant(model, column_name, group_by_columns) %}\n\n{% if group_by_columns|length() > 0 %}\n {% set select_gb_cols = group_by_columns|join(' ,') + ', ' %}\n {% set groupby_gb_cols = 'group by ' + group_by_columns|join(',') %}\n{% endif %}\n\n\nselect\n {# In TSQL, subquery aggregate columns need aliases #}\n {# thus: a filler col name, 'filler_column' #}\n {{select_gb_cols}}\n count(distinct {{ column_name }}) as filler_column\n\nfrom {{ model }}\n\n {{groupby_gb_cols}}\n\nhaving count(distinct {{ column_name }}) = 1\n\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "column_name", "type": null, "description": ""}, {"name": "group_by_columns", "type": null, "description": ""}], "created_at": 1789079002.5348208, "supported_languages": null}, "macro.dbt_utils.test_equality": {"name": "test_equality", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/equality.sql", "original_file_path": "macros/generic_tests/equality.sql", "unique_id": "macro.dbt_utils.test_equality", "macro_sql": "{% test equality(model, compare_model, compare_columns=None, exclude_columns=None, precision = None) %}\n {{ return(adapter.dispatch('test_equality', 'dbt_utils')(model, compare_model, compare_columns, exclude_columns, precision)) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_equality"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "compare_model", "type": null, "description": ""}, {"name": "compare_columns", "type": null, "description": ""}, {"name": "exclude_columns", "type": null, "description": ""}, {"name": "precision", "type": null, "description": ""}], "created_at": 1789079002.5360937, "supported_languages": null}, "macro.dbt_utils.default__test_equality": {"name": "default__test_equality", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/equality.sql", "original_file_path": "macros/generic_tests/equality.sql", "unique_id": "macro.dbt_utils.default__test_equality", "macro_sql": "{% macro default__test_equality(model, compare_model, compare_columns=None, exclude_columns=None, precision = None) %}\n\n{%- if compare_columns and exclude_columns -%}\n {{ exceptions.raise_compiler_error(\"Both a compare and an ignore list were provided to the `equality` macro. Only one is allowed\") }}\n{%- endif -%}\n\n{% set set_diff %}\n count(*) + coalesce(abs(\n sum(case when which_diff = 'a_minus_b' then 1 else 0 end) -\n sum(case when which_diff = 'b_minus_a' then 1 else 0 end)\n ), 0)\n{% endset %}\n\n{#-- Needs to be set at parse time, before we return '' below --#}\n{{ config(fail_calc = set_diff) }}\n\n{#-- Prevent querying of db in parsing mode. This works because this macro does not create any new refs. #}\n{%- if not execute -%}\n {{ return('') }}\n{% endif %}\n\n\n\n-- setup\n{%- do dbt_utils._is_relation(model, 'test_equality') -%}\n\n{# Ensure there are no extra columns in the compare_model vs model #}\n{%- if not compare_columns -%}\n {%- do dbt_utils._is_ephemeral(model, 'test_equality') -%}\n {%- do dbt_utils._is_ephemeral(compare_model, 'test_equality') -%}\n\n {%- set model_columns = adapter.get_columns_in_relation(model) -%}\n {%- set compare_model_columns = adapter.get_columns_in_relation(compare_model) -%}\n\n\n {%- if exclude_columns -%}\n {#-- Lower case ignore columns for easier comparison --#}\n {%- set exclude_columns = exclude_columns | map(\"lower\") | list %}\n\n {# Filter out the excluded columns #}\n {%- set include_columns = [] %}\n {%- set include_model_columns = [] %}\n {%- for column in model_columns -%}\n {%- if column.name | lower not in exclude_columns -%}\n {% do include_columns.append(column) %}\n {%- endif %}\n {%- endfor %}\n {%- for column in compare_model_columns -%}\n {%- if column.name | lower not in exclude_columns -%}\n {% do include_model_columns.append(column) %}\n {%- endif %}\n {%- endfor %}\n\n {%- set compare_columns_set = set(include_columns | map(attribute='quoted') | map(\"lower\")) %}\n {%- set compare_model_columns_set = set(include_model_columns | map(attribute='quoted') | map(\"lower\")) %}\n {%- else -%}\n {%- set compare_columns_set = set(model_columns | map(attribute='quoted') | map(\"lower\")) %}\n {%- set compare_model_columns_set = set(compare_model_columns | map(attribute='quoted') | map(\"lower\")) %}\n {%- endif -%}\n\n {% if compare_columns_set != compare_model_columns_set %}\n {{ exceptions.raise_compiler_error(compare_model ~\" has less columns than \" ~ model ~ \", please ensure they have the same columns or use the `compare_columns` or `exclude_columns` arguments to subset them.\") }}\n {% endif %}\n\n\n{% endif %}\n\n{%- if not precision -%}\n {%- if not compare_columns -%}\n {# \n You cannot get the columns in an ephemeral model (due to not existing in the information schema),\n so if the user does not provide an explicit list of columns we must error in the case it is ephemeral\n #}\n {%- do dbt_utils._is_ephemeral(model, 'test_equality') -%}\n {%- set compare_columns = adapter.get_columns_in_relation(model)-%}\n\n {%- if exclude_columns -%}\n {#-- Lower case ignore columns for easier comparison --#}\n {%- set exclude_columns = exclude_columns | map(\"lower\") | list %}\n\n {# Filter out the excluded columns #}\n {%- set include_columns = [] %}\n {%- for column in compare_columns -%}\n {%- if column.name | lower not in exclude_columns -%}\n {% do include_columns.append(column) %}\n {%- endif %}\n {%- endfor %}\n\n {%- set compare_columns = include_columns | map(attribute='quoted') %}\n {%- else -%} {# Compare columns provided #}\n {%- set compare_columns = compare_columns | map(attribute='quoted') %}\n {%- endif -%}\n {%- endif -%}\n\n {% set compare_cols_csv = compare_columns | join(', ') %}\n\n{% else %} {# Precision required #}\n {#-\n If rounding is required, we need to get the types, so it cannot be ephemeral even if they provide column names\n -#}\n {%- do dbt_utils._is_ephemeral(model, 'test_equality') -%}\n {%- set columns = adapter.get_columns_in_relation(model) -%}\n\n {% set columns_list = [] %}\n {%- for col in columns -%}\n {%- if (\n (col.name|lower in compare_columns|map('lower') or not compare_columns) and\n (col.name|lower not in exclude_columns|map('lower') or not exclude_columns)\n ) -%}\n {# Databricks double type is not picked up by any number type checks in dbt #}\n {%- if col.is_float() or col.is_numeric() or col.data_type == 'double' -%}\n {# Cast is required due to postgres not having round for a double precision number #}\n {%- do columns_list.append('round(cast(' ~ col.quoted ~ ' as ' ~ dbt.type_numeric() ~ '),' ~ precision ~ ') as ' ~ col.quoted) -%}\n {%- else -%} {# Non-numeric type #}\n {%- do columns_list.append(col.quoted) -%}\n {%- endif -%}\n {% endif %}\n {%- endfor -%}\n\n {% set compare_cols_csv = columns_list | join(', ') %}\n\n{% endif %}\n\nwith a as (\n\n select * from {{ model }}\n\n),\n\nb as (\n\n select * from {{ compare_model }}\n\n),\n\na_minus_b as (\n\n select {{compare_cols_csv}} from a\n {{ dbt.except() }}\n select {{compare_cols_csv}} from b\n\n),\n\nb_minus_a as (\n\n select {{compare_cols_csv}} from b\n {{ dbt.except() }}\n select {{compare_cols_csv}} from a\n\n),\n\nunioned as (\n\n select 'a_minus_b' as which_diff, a_minus_b.* from a_minus_b\n union all\n select 'b_minus_a' as which_diff, b_minus_a.* from b_minus_a\n\n)\n\nselect * from unioned\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils._is_relation", "macro.dbt_utils._is_ephemeral", "macro.dbt.type_numeric", "macro.dbt.except"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "compare_model", "type": null, "description": ""}, {"name": "compare_columns", "type": null, "description": ""}, {"name": "exclude_columns", "type": null, "description": ""}, {"name": "precision", "type": null, "description": ""}], "created_at": 1789079002.5404835, "supported_languages": null}, "macro.dbt_utils.test_not_empty_string": {"name": "test_not_empty_string", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/not_empty_string.sql", "original_file_path": "macros/generic_tests/not_empty_string.sql", "unique_id": "macro.dbt_utils.test_not_empty_string", "macro_sql": "{% test not_empty_string(model, column_name, trim_whitespace=true) %}\n\n {{ return(adapter.dispatch('test_not_empty_string', 'dbt_utils')(model, column_name, trim_whitespace)) }}\n\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_not_empty_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "column_name", "type": null, "description": ""}, {"name": "trim_whitespace", "type": null, "description": ""}], "created_at": 1789079002.5409687, "supported_languages": null}, "macro.dbt_utils.default__test_not_empty_string": {"name": "default__test_not_empty_string", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/not_empty_string.sql", "original_file_path": "macros/generic_tests/not_empty_string.sql", "unique_id": "macro.dbt_utils.default__test_not_empty_string", "macro_sql": "{% macro default__test_not_empty_string(model, column_name, trim_whitespace=true) %}\n\n with\n \n all_values as (\n\n select \n\n\n {% if trim_whitespace == true -%}\n\n trim({{ column_name }}) as {{ column_name }}\n\n {%- else -%}\n\n {{ column_name }}\n\n {%- endif %}\n \n from {{ model }}\n\n ),\n\n errors as (\n\n select * from all_values\n where {{ column_name }} = ''\n\n )\n\n select * from errors\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "column_name", "type": null, "description": ""}, {"name": "trim_whitespace", "type": null, "description": ""}], "created_at": 1789079002.5413277, "supported_languages": null}, "macro.dbt_utils.test_recency": {"name": "test_recency", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/recency.sql", "original_file_path": "macros/generic_tests/recency.sql", "unique_id": "macro.dbt_utils.test_recency", "macro_sql": "{% test recency(model, field, datepart, interval, ignore_time_component=False, group_by_columns = []) %}\n {{ return(adapter.dispatch('test_recency', 'dbt_utils')(model, field, datepart, interval, ignore_time_component, group_by_columns)) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_recency"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "field", "type": null, "description": ""}, {"name": "datepart", "type": null, "description": ""}, {"name": "interval", "type": null, "description": ""}, {"name": "ignore_time_component", "type": null, "description": ""}, {"name": "group_by_columns", "type": null, "description": ""}], "created_at": 1789079002.541952, "supported_languages": null}, "macro.dbt_utils.default__test_recency": {"name": "default__test_recency", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/recency.sql", "original_file_path": "macros/generic_tests/recency.sql", "unique_id": "macro.dbt_utils.default__test_recency", "macro_sql": "{% macro default__test_recency(model, field, datepart, interval, ignore_time_component, group_by_columns) %}\n\n{% set empty_invocation = flags.EMPTY is defined and flags.EMPTY %}\n\n{% set threshold = 'cast(' ~ dbt.dateadd(datepart, interval * -1, dbt.current_timestamp()) ~ ' as ' ~ ('date' if ignore_time_component else dbt.type_timestamp()) ~ ')' %}\n\n{% if group_by_columns|length() > 0 %}\n {% set select_gb_cols = group_by_columns|join(' ,') + ', ' %}\n {% set groupby_gb_cols = 'group by ' + group_by_columns|join(',') %}\n{% endif %}\n\n\nwith recency as (\n\n select \n\n {{ select_gb_cols }}\n {% if ignore_time_component %}\n cast(max({{ field }}) as date) as most_recent\n {%- else %}\n max({{ field }}) as most_recent\n {%- endif %}\n\n from {{ model }}\n\n {{ groupby_gb_cols }}\n\n)\n\nselect\n\n {{ select_gb_cols }}\n most_recent,\n {{ threshold }} as threshold\n\nfrom recency\nwhere most_recent < {{ threshold }}\n{%- if not empty_invocation %}\n or most_recent is null\n{%- endif %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.dateadd", "macro.dbt.current_timestamp", "macro.dbt.type_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "field", "type": null, "description": ""}, {"name": "datepart", "type": null, "description": ""}, {"name": "interval", "type": null, "description": ""}, {"name": "ignore_time_component", "type": null, "description": ""}, {"name": "group_by_columns", "type": null, "description": ""}], "created_at": 1789079002.5430305, "supported_languages": null}, "macro.dbt_utils.test_at_least_one": {"name": "test_at_least_one", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/at_least_one.sql", "original_file_path": "macros/generic_tests/at_least_one.sql", "unique_id": "macro.dbt_utils.test_at_least_one", "macro_sql": "{% test at_least_one(model, column_name, group_by_columns = []) %}\n {{ return(adapter.dispatch('test_at_least_one', 'dbt_utils')(model, column_name, group_by_columns)) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_at_least_one"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "column_name", "type": null, "description": ""}, {"name": "group_by_columns", "type": null, "description": ""}], "created_at": 1789079002.5435686, "supported_languages": null}, "macro.dbt_utils.default__test_at_least_one": {"name": "default__test_at_least_one", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/at_least_one.sql", "original_file_path": "macros/generic_tests/at_least_one.sql", "unique_id": "macro.dbt_utils.default__test_at_least_one", "macro_sql": "{% macro default__test_at_least_one(model, column_name, group_by_columns) %}\n\n{% set pruned_cols = [column_name] %}\n\n{% if group_by_columns|length() > 0 %}\n\n {% set select_gb_cols = group_by_columns|join(' ,') + ', ' %}\n {% set groupby_gb_cols = 'group by ' + group_by_columns|join(',') %}\n {% set pruned_cols = group_by_columns %}\n\n {% if column_name not in pruned_cols %}\n {% do pruned_cols.append(column_name) %}\n {% endif %}\n\n{% endif %}\n\n{% set select_pruned_cols = pruned_cols|join(' ,') %}\n\nselect *\nfrom (\n with pruned_rows as (\n select\n {{ select_pruned_cols }}\n from {{ model }}\n {% if group_by_columns|length() == 0 %}\n where {{ column_name }} is not null\n limit 1\n {% endif %}\n )\n select\n {# In TSQL, subquery aggregate columns need aliases #}\n {# thus: a filler col name, 'filler_column' #}\n {{select_gb_cols}}\n count({{ column_name }}) as filler_column\n\n from pruned_rows\n\n {{groupby_gb_cols}}\n\n having count({{ column_name }}) = 0\n\n) validation_errors\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "column_name", "type": null, "description": ""}, {"name": "group_by_columns", "type": null, "description": ""}], "created_at": 1789079002.5445306, "supported_languages": null}, "macro.dbt_utils.test_unique_combination_of_columns": {"name": "test_unique_combination_of_columns", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/unique_combination_of_columns.sql", "original_file_path": "macros/generic_tests/unique_combination_of_columns.sql", "unique_id": "macro.dbt_utils.test_unique_combination_of_columns", "macro_sql": "{% test unique_combination_of_columns(model, combination_of_columns, quote_columns=false) %}\n {{ return(adapter.dispatch('test_unique_combination_of_columns', 'dbt_utils')(model, combination_of_columns, quote_columns)) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_unique_combination_of_columns"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "combination_of_columns", "type": null, "description": ""}, {"name": "quote_columns", "type": null, "description": ""}], "created_at": 1789079002.5450234, "supported_languages": null}, "macro.dbt_utils.default__test_unique_combination_of_columns": {"name": "default__test_unique_combination_of_columns", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/unique_combination_of_columns.sql", "original_file_path": "macros/generic_tests/unique_combination_of_columns.sql", "unique_id": "macro.dbt_utils.default__test_unique_combination_of_columns", "macro_sql": "{% macro default__test_unique_combination_of_columns(model, combination_of_columns, quote_columns=false) %}\n\n{% if not quote_columns %}\n {%- set column_list=combination_of_columns %}\n{% elif quote_columns %}\n {%- set column_list=[] %}\n {% for column in combination_of_columns -%}\n {% do column_list.append( adapter.quote(column) ) %}\n {%- endfor %}\n{% else %}\n {{ exceptions.raise_compiler_error(\n \"`quote_columns` argument for unique_combination_of_columns test must be one of [True, False] Got: '\" ~ quote ~\"'.'\"\n ) }}\n{% endif %}\n\n{%- set columns_csv=column_list | join(', ') %}\n\n\nwith validation_errors as (\n\n select\n {{ columns_csv }}\n from {{ model }}\n group by {{ columns_csv }}\n having count(*) > 1\n\n)\n\nselect *\nfrom validation_errors\n\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "combination_of_columns", "type": null, "description": ""}, {"name": "quote_columns", "type": null, "description": ""}], "created_at": 1789079002.5457141, "supported_languages": null}, "macro.dbt_utils.test_fewer_rows_than": {"name": "test_fewer_rows_than", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/fewer_rows_than.sql", "original_file_path": "macros/generic_tests/fewer_rows_than.sql", "unique_id": "macro.dbt_utils.test_fewer_rows_than", "macro_sql": "{% test fewer_rows_than(model, compare_model, group_by_columns = []) %}\n {{ return(adapter.dispatch('test_fewer_rows_than', 'dbt_utils')(model, compare_model, group_by_columns)) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_fewer_rows_than"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "compare_model", "type": null, "description": ""}, {"name": "group_by_columns", "type": null, "description": ""}], "created_at": 1789079002.5463417, "supported_languages": null}, "macro.dbt_utils.default__test_fewer_rows_than": {"name": "default__test_fewer_rows_than", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/fewer_rows_than.sql", "original_file_path": "macros/generic_tests/fewer_rows_than.sql", "unique_id": "macro.dbt_utils.default__test_fewer_rows_than", "macro_sql": "{% macro default__test_fewer_rows_than(model, compare_model, group_by_columns) %}\n\n{{ config(fail_calc = 'sum(coalesce(row_count_delta, 0))') }}\n\n{% if group_by_columns|length() > 0 %}\n {% set select_gb_cols = group_by_columns|join(' ,') + ', ' %}\n {% set join_gb_cols %}\n {% for c in group_by_columns %}\n and a.{{c}} = b.{{c}}\n {% endfor %}\n {% endset %}\n {% set groupby_gb_cols = 'group by ' + group_by_columns|join(',') %}\n{% endif %}\n\n{#-- We must add a fake join key in case additional grouping variables are not provided --#}\n{#-- Redshift does not allow for dynamically created join conditions (e.g. full join on 1 = 1 --#}\n{#-- The same logic is used in equal_rowcount. In case of changes, maintain consistent logic --#}\n{% set group_by_columns = ['id_dbtutils_test_fewer_rows_than'] + group_by_columns %}\n{% set groupby_gb_cols = 'group by ' + group_by_columns|join(',') %}\n\n\nwith a as (\n\n select \n {{select_gb_cols}}\n 1 as id_dbtutils_test_fewer_rows_than,\n count(*) as count_our_model \n from {{ model }}\n {{ groupby_gb_cols }}\n\n),\nb as (\n\n select \n {{select_gb_cols}}\n 1 as id_dbtutils_test_fewer_rows_than,\n count(*) as count_comparison_model \n from {{ compare_model }}\n {{ groupby_gb_cols }}\n\n),\ncounts as (\n\n select\n\n {% for c in group_by_columns -%}\n a.{{c}} as {{c}}_a,\n b.{{c}} as {{c}}_b,\n {% endfor %}\n\n count_our_model,\n count_comparison_model\n from a\n full join b on \n a.id_dbtutils_test_fewer_rows_than = b.id_dbtutils_test_fewer_rows_than\n {{ join_gb_cols }}\n\n),\nfinal as (\n\n select *,\n case\n -- fail the test if we have more rows than the reference model and return the row count delta\n when count_our_model > count_comparison_model then (count_our_model - count_comparison_model)\n -- fail the test if they are the same number\n when count_our_model = count_comparison_model then 1\n -- pass the test if the delta is positive (i.e. return the number 0)\n else 0\n end as row_count_delta\n from counts\n\n)\n\nselect * from final\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "compare_model", "type": null, "description": ""}, {"name": "group_by_columns", "type": null, "description": ""}], "created_at": 1789079002.54755, "supported_languages": null}, "macro.dbt_utils.test_not_null_proportion": {"name": "test_not_null_proportion", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/not_null_proportion.sql", "original_file_path": "macros/generic_tests/not_null_proportion.sql", "unique_id": "macro.dbt_utils.test_not_null_proportion", "macro_sql": "{% macro test_not_null_proportion(model, group_by_columns = []) %}\n {{ return(adapter.dispatch('test_not_null_proportion', 'dbt_utils')(model, group_by_columns, **kwargs)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_not_null_proportion"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "group_by_columns", "type": null, "description": ""}], "created_at": 1789079002.5480835, "supported_languages": null}, "macro.dbt_utils.default__test_not_null_proportion": {"name": "default__test_not_null_proportion", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/not_null_proportion.sql", "original_file_path": "macros/generic_tests/not_null_proportion.sql", "unique_id": "macro.dbt_utils.default__test_not_null_proportion", "macro_sql": "{% macro default__test_not_null_proportion(model, group_by_columns) %}\n\n{% set column_name = kwargs.get('column_name', kwargs.get('arg')) %}\n{% set at_least = kwargs.get('at_least', kwargs.get('arg')) %}\n{% set at_most = kwargs.get('at_most', kwargs.get('arg', 1)) %}\n\n{% if group_by_columns|length() > 0 %}\n {% set select_gb_cols = group_by_columns|join(' ,') + ', ' %}\n {% set groupby_gb_cols = 'group by ' + group_by_columns|join(',') %}\n{% endif %}\n\nwith validation as (\n select\n {{select_gb_cols}}\n sum(case when {{ column_name }} is null then 0 else 1 end) / cast(count(*) as {{ dbt.type_numeric() }}) as not_null_proportion\n from {{ model }}\n {{groupby_gb_cols}}\n),\nvalidation_errors as (\n select\n {{select_gb_cols}}\n not_null_proportion\n from validation\n where not_null_proportion < {{ at_least }} or not_null_proportion > {{ at_most }}\n)\nselect\n *\nfrom validation_errors\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.type_numeric"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "group_by_columns", "type": null, "description": ""}], "created_at": 1789079002.5490062, "supported_languages": null}, "macro.dbt_utils.test_equal_rowcount": {"name": "test_equal_rowcount", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/equal_rowcount.sql", "original_file_path": "macros/generic_tests/equal_rowcount.sql", "unique_id": "macro.dbt_utils.test_equal_rowcount", "macro_sql": "{% test equal_rowcount(model, compare_model, group_by_columns = []) %}\n {{ return(adapter.dispatch('test_equal_rowcount', 'dbt_utils')(model, compare_model, group_by_columns)) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_equal_rowcount"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "compare_model", "type": null, "description": ""}, {"name": "group_by_columns", "type": null, "description": ""}], "created_at": 1789079002.5496573, "supported_languages": null}, "macro.dbt_utils.default__test_equal_rowcount": {"name": "default__test_equal_rowcount", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/equal_rowcount.sql", "original_file_path": "macros/generic_tests/equal_rowcount.sql", "unique_id": "macro.dbt_utils.default__test_equal_rowcount", "macro_sql": "{% macro default__test_equal_rowcount(model, compare_model, group_by_columns) %}\n\n{#-- Needs to be set at parse time, before we return '' below --#}\n{{ config(fail_calc = 'sum(coalesce(diff_count, 0))') }}\n\n{#-- Prevent querying of db in parsing mode. This works because this macro does not create any new refs. #}\n{%- if not execute -%}\n {{ return('') }}\n{% endif %}\n\n{% if group_by_columns|length() > 0 %}\n {% set select_gb_cols = group_by_columns|join(', ') + ', ' %}\n {% set join_gb_cols %}\n {% for c in group_by_columns %}\n and a.{{c}} = b.{{c}}\n {% endfor %}\n {% endset %}\n {% set groupby_gb_cols = 'group by ' + group_by_columns|join(',') %}\n{% endif %}\n\n{#-- We must add a fake join key in case additional grouping variables are not provided --#}\n{#-- Redshift does not allow for dynamically created join conditions (e.g. full join on 1 = 1 --#}\n{#-- The same logic is used in fewer_rows_than. In case of changes, maintain consistent logic --#}\n{% set group_by_columns = ['id_dbtutils_test_equal_rowcount'] + group_by_columns %}\n{% set groupby_gb_cols = 'group by ' + group_by_columns|join(',') %}\n\nwith a as (\n\n select \n {{select_gb_cols}}\n 1 as id_dbtutils_test_equal_rowcount,\n count(*) as count_a \n from {{ model }}\n {{groupby_gb_cols}}\n\n\n),\nb as (\n\n select \n {{select_gb_cols}}\n 1 as id_dbtutils_test_equal_rowcount,\n count(*) as count_b \n from {{ compare_model }}\n {{groupby_gb_cols}}\n\n),\nfinal as (\n\n select\n \n {% for c in group_by_columns -%}\n a.{{c}} as {{c}}_a,\n b.{{c}} as {{c}}_b,\n {% endfor %}\n\n count_a,\n count_b,\n abs(count_a - count_b) as diff_count\n\n from a\n full join b\n on\n a.id_dbtutils_test_equal_rowcount = b.id_dbtutils_test_equal_rowcount\n {{join_gb_cols}}\n\n\n)\n\nselect * from final\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "compare_model", "type": null, "description": ""}, {"name": "group_by_columns", "type": null, "description": ""}], "created_at": 1789079002.5508635, "supported_languages": null}, "macro.dbt_utils.test_sequential_values": {"name": "test_sequential_values", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/sequential_values.sql", "original_file_path": "macros/generic_tests/sequential_values.sql", "unique_id": "macro.dbt_utils.test_sequential_values", "macro_sql": "{% test sequential_values(model, column_name, interval=1, datepart=None, group_by_columns = []) %}\n\n {{ return(adapter.dispatch('test_sequential_values', 'dbt_utils')(model, column_name, interval, datepart, group_by_columns)) }}\n\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_sequential_values"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "column_name", "type": null, "description": ""}, {"name": "interval", "type": null, "description": ""}, {"name": "datepart", "type": null, "description": ""}, {"name": "group_by_columns", "type": null, "description": ""}], "created_at": 1789079002.55147, "supported_languages": null}, "macro.dbt_utils.default__test_sequential_values": {"name": "default__test_sequential_values", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/sequential_values.sql", "original_file_path": "macros/generic_tests/sequential_values.sql", "unique_id": "macro.dbt_utils.default__test_sequential_values", "macro_sql": "{% macro default__test_sequential_values(model, column_name, interval=1, datepart=None, group_by_columns = []) %}\n\n{% set previous_column_name = \"previous_\" ~ dbt_utils.slugify(column_name) %}\n\n{% if group_by_columns|length() > 0 %}\n {% set select_gb_cols = group_by_columns|join(',') + ', ' %}\n {% set partition_gb_cols = 'partition by ' + group_by_columns|join(',') %}\n{% endif %}\n\nwith windowed as (\n\n select\n {{ select_gb_cols }}\n {{ column_name }},\n lag({{ column_name }}) over (\n {{partition_gb_cols}}\n order by {{ column_name }}\n ) as {{ previous_column_name }}\n from {{ model }}\n),\n\nvalidation_errors as (\n select\n *\n from windowed\n {% if datepart %}\n where not(cast({{ column_name }} as {{ dbt.type_timestamp() }})= cast({{ dbt.dateadd(datepart, interval, previous_column_name) }} as {{ dbt.type_timestamp() }}))\n {% else %}\n where not({{ column_name }} = {{ previous_column_name }} + {{ interval }})\n {% endif %}\n)\n\nselect *\nfrom validation_errors\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.slugify", "macro.dbt.type_timestamp", "macro.dbt.dateadd"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "column_name", "type": null, "description": ""}, {"name": "interval", "type": null, "description": ""}, {"name": "datepart", "type": null, "description": ""}, {"name": "group_by_columns", "type": null, "description": ""}], "created_at": 1789079002.552503, "supported_languages": null}, "macro.dbt_utils.test_mutually_exclusive_ranges": {"name": "test_mutually_exclusive_ranges", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/mutually_exclusive_ranges.sql", "original_file_path": "macros/generic_tests/mutually_exclusive_ranges.sql", "unique_id": "macro.dbt_utils.test_mutually_exclusive_ranges", "macro_sql": "{% test mutually_exclusive_ranges(model, lower_bound_column, upper_bound_column, partition_by=None, gaps='allowed', zero_length_range_allowed=False) %}\n {{ return(adapter.dispatch('test_mutually_exclusive_ranges', 'dbt_utils')(model, lower_bound_column, upper_bound_column, partition_by, gaps, zero_length_range_allowed)) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_mutually_exclusive_ranges"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "lower_bound_column", "type": null, "description": ""}, {"name": "upper_bound_column", "type": null, "description": ""}, {"name": "partition_by", "type": null, "description": ""}, {"name": "gaps", "type": null, "description": ""}, {"name": "zero_length_range_allowed", "type": null, "description": ""}], "created_at": 1789079002.5533931, "supported_languages": null}, "macro.dbt_utils.default__test_mutually_exclusive_ranges": {"name": "default__test_mutually_exclusive_ranges", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/mutually_exclusive_ranges.sql", "original_file_path": "macros/generic_tests/mutually_exclusive_ranges.sql", "unique_id": "macro.dbt_utils.default__test_mutually_exclusive_ranges", "macro_sql": "{% macro default__test_mutually_exclusive_ranges(model, lower_bound_column, upper_bound_column, partition_by=None, gaps='allowed', zero_length_range_allowed=False) %}\n{% if gaps == 'not_allowed' %}\n {% set allow_gaps_operator='=' %}\n {% set allow_gaps_operator_in_words='equal_to' %}\n{% elif gaps == 'allowed' %}\n {% set allow_gaps_operator='<=' %}\n {% set allow_gaps_operator_in_words='less_than_or_equal_to' %}\n{% elif gaps == 'required' %}\n {% set allow_gaps_operator='<' %}\n {% set allow_gaps_operator_in_words='less_than' %}\n{% else %}\n {{ exceptions.raise_compiler_error(\n \"`gaps` argument for mutually_exclusive_ranges test must be one of ['not_allowed', 'allowed', 'required'] Got: '\" ~ gaps ~\"'.'\"\n ) }}\n{% endif %}\n{% if not zero_length_range_allowed %}\n {% set allow_zero_length_operator='<' %}\n {% set allow_zero_length_operator_in_words='less_than' %}\n{% elif zero_length_range_allowed %}\n {% set allow_zero_length_operator='<=' %}\n {% set allow_zero_length_operator_in_words='less_than_or_equal_to' %}\n{% else %}\n {{ exceptions.raise_compiler_error(\n \"`zero_length_range_allowed` argument for mutually_exclusive_ranges test must be one of [true, false] Got: '\" ~ zero_length_range_allowed ~\"'.'\"\n ) }}\n{% endif %}\n\n{% set partition_clause=\"partition by \" ~ partition_by if partition_by else '' %}\n\nwith window_functions as (\n\n select\n {% if partition_by %}\n {{ partition_by }} as partition_by_col,\n {% endif %}\n {{ lower_bound_column }} as lower_bound,\n {{ upper_bound_column }} as upper_bound,\n\n lead({{ lower_bound_column }}) over (\n {{ partition_clause }}\n order by {{ lower_bound_column }}, {{ upper_bound_column }}\n ) as next_lower_bound,\n\n row_number() over (\n {{ partition_clause }}\n order by {{ lower_bound_column }} desc, {{ upper_bound_column }} desc\n ) = 1 as is_last_record\n\n from {{ model }}\n\n),\n\ncalc as (\n -- We want to return records where one of our assumptions fails, so we'll use\n -- the `not` function with `and` statements so we can write our assumptions more cleanly\n select\n *,\n\n -- For each record: lower_bound should be < upper_bound.\n -- Coalesce it to return an error on the null case (implicit assumption\n -- these columns are not_null)\n coalesce(\n lower_bound {{ allow_zero_length_operator }} upper_bound,\n false\n ) as lower_bound_{{ allow_zero_length_operator_in_words }}_upper_bound,\n\n -- For each record: upper_bound {{ allow_gaps_operator }} the next lower_bound.\n -- Coalesce it to handle null cases for the last record.\n coalesce(\n upper_bound {{ allow_gaps_operator }} next_lower_bound,\n is_last_record,\n false\n ) as upper_bound_{{ allow_gaps_operator_in_words }}_next_lower_bound\n\n from window_functions\n\n),\n\nvalidation_errors as (\n\n select\n *\n from calc\n\n where not(\n -- THE FOLLOWING SHOULD BE TRUE --\n lower_bound_{{ allow_zero_length_operator_in_words }}_upper_bound\n and upper_bound_{{ allow_gaps_operator_in_words }}_next_lower_bound\n )\n)\n\nselect * from validation_errors\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "lower_bound_column", "type": null, "description": ""}, {"name": "upper_bound_column", "type": null, "description": ""}, {"name": "partition_by", "type": null, "description": ""}, {"name": "gaps", "type": null, "description": ""}, {"name": "zero_length_range_allowed", "type": null, "description": ""}], "created_at": 1789079002.5553744, "supported_languages": null}, "macro.dbt_utils.test_cardinality_equality": {"name": "test_cardinality_equality", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/cardinality_equality.sql", "original_file_path": "macros/generic_tests/cardinality_equality.sql", "unique_id": "macro.dbt_utils.test_cardinality_equality", "macro_sql": "{% test cardinality_equality(model, column_name, to, field) %}\n {{ return(adapter.dispatch('test_cardinality_equality', 'dbt_utils')(model, column_name, to, field)) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_cardinality_equality"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "column_name", "type": null, "description": ""}, {"name": "to", "type": null, "description": ""}, {"name": "field", "type": null, "description": ""}], "created_at": 1789079002.555836, "supported_languages": null}, "macro.dbt_utils.default__test_cardinality_equality": {"name": "default__test_cardinality_equality", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/cardinality_equality.sql", "original_file_path": "macros/generic_tests/cardinality_equality.sql", "unique_id": "macro.dbt_utils.default__test_cardinality_equality", "macro_sql": "{% macro default__test_cardinality_equality(model, column_name, to, field) %}\n\n{# T-SQL does not let you use numbers as aliases for columns #}\n{# Thus, no \"GROUP BY 1\" #}\n\nwith table_a as (\nselect\n {{ column_name }},\n count(*) as num_rows\nfrom {{ model }}\ngroup by {{ column_name }}\n),\n\ntable_b as (\nselect\n {{ field }},\n count(*) as num_rows\nfrom {{ to }}\ngroup by {{ field }}\n),\n\nexcept_a as (\n select *\n from table_a\n {{ dbt.except() }}\n select *\n from table_b\n),\n\nexcept_b as (\n select *\n from table_b\n {{ dbt.except() }}\n select *\n from table_a\n),\n\nunioned as (\n select *\n from except_a\n union all\n select *\n from except_b\n)\n\nselect *\nfrom unioned\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.except"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "column_name", "type": null, "description": ""}, {"name": "to", "type": null, "description": ""}, {"name": "field", "type": null, "description": ""}], "created_at": 1789079002.556247, "supported_languages": null}, "macro.dbt_utils.test_relationships_where": {"name": "test_relationships_where", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/relationships_where.sql", "original_file_path": "macros/generic_tests/relationships_where.sql", "unique_id": "macro.dbt_utils.test_relationships_where", "macro_sql": "{% test relationships_where(model, column_name, to, field, from_condition=\"1=1\", to_condition=\"1=1\") %}\n {{ return(adapter.dispatch('test_relationships_where', 'dbt_utils')(model, column_name, to, field, from_condition, to_condition)) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_relationships_where"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "column_name", "type": null, "description": ""}, {"name": "to", "type": null, "description": ""}, {"name": "field", "type": null, "description": ""}, {"name": "from_condition", "type": null, "description": ""}, {"name": "to_condition", "type": null, "description": ""}], "created_at": 1789079002.5567567, "supported_languages": null}, "macro.dbt_utils.default__test_relationships_where": {"name": "default__test_relationships_where", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/relationships_where.sql", "original_file_path": "macros/generic_tests/relationships_where.sql", "unique_id": "macro.dbt_utils.default__test_relationships_where", "macro_sql": "{% macro default__test_relationships_where(model, column_name, to, field, from_condition=\"1=1\", to_condition=\"1=1\") %}\n\n{# T-SQL has no boolean data type so we use 1=1 which returns TRUE #}\n{# ref https://stackoverflow.com/a/7170753/3842610 #}\n\nwith left_table as (\n\n select\n {{column_name}} as id\n\n from {{model}}\n\n where {{column_name}} is not null\n and {{from_condition}}\n\n),\n\nright_table as (\n\n select\n {{field}} as id\n\n from {{to}}\n\n where {{field}} is not null\n and {{to_condition}}\n\n),\n\nexceptions as (\n\n select\n left_table.id,\n right_table.id as right_id\n\n from left_table\n\n left join right_table\n on left_table.id = right_table.id\n\n where right_table.id is null\n\n)\n\nselect * from exceptions\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "column_name", "type": null, "description": ""}, {"name": "to", "type": null, "description": ""}, {"name": "field", "type": null, "description": ""}, {"name": "from_condition", "type": null, "description": ""}, {"name": "to_condition", "type": null, "description": ""}], "created_at": 1789079002.5571518, "supported_languages": null}, "macro.dbt_utils.test_expression_is_true": {"name": "test_expression_is_true", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/expression_is_true.sql", "original_file_path": "macros/generic_tests/expression_is_true.sql", "unique_id": "macro.dbt_utils.test_expression_is_true", "macro_sql": "{% test expression_is_true(model, expression, column_name=None) %}\n {{ return(adapter.dispatch('test_expression_is_true', 'dbt_utils')(model, expression, column_name)) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_expression_is_true"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "expression", "type": null, "description": ""}, {"name": "column_name", "type": null, "description": ""}], "created_at": 1789079002.5575602, "supported_languages": null}, "macro.dbt_utils.default__test_expression_is_true": {"name": "default__test_expression_is_true", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/expression_is_true.sql", "original_file_path": "macros/generic_tests/expression_is_true.sql", "unique_id": "macro.dbt_utils.default__test_expression_is_true", "macro_sql": "{% macro default__test_expression_is_true(model, expression, column_name) %}\n\n{% set column_list = '*' if should_store_failures() else \"1\" %}\n\nselect\n {{ column_list }}\nfrom {{ model }}\n{% if column_name is none %}\nwhere not({{ expression }})\n{%- else %}\nwhere not({{ column_name }} {{ expression }})\n{%- endif %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.should_store_failures"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "expression", "type": null, "description": ""}, {"name": "column_name", "type": null, "description": ""}], "created_at": 1789079002.5579948, "supported_languages": null}, "macro.dbt_utils.test_not_accepted_values": {"name": "test_not_accepted_values", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/not_accepted_values.sql", "original_file_path": "macros/generic_tests/not_accepted_values.sql", "unique_id": "macro.dbt_utils.test_not_accepted_values", "macro_sql": "{% test not_accepted_values(model, column_name, values, quote=True) %}\n {{ return(adapter.dispatch('test_not_accepted_values', 'dbt_utils')(model, column_name, values, quote)) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_not_accepted_values"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "column_name", "type": null, "description": ""}, {"name": "values", "type": null, "description": ""}, {"name": "quote", "type": null, "description": ""}], "created_at": 1789079002.5584416, "supported_languages": null}, "macro.dbt_utils.default__test_not_accepted_values": {"name": "default__test_not_accepted_values", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/not_accepted_values.sql", "original_file_path": "macros/generic_tests/not_accepted_values.sql", "unique_id": "macro.dbt_utils.default__test_not_accepted_values", "macro_sql": "{% macro default__test_not_accepted_values(model, column_name, values, quote=True) %}\nwith all_values as (\n\n select distinct\n {{ column_name }} as value_field\n\n from {{ model }}\n\n),\n\nvalidation_errors as (\n\n select\n value_field\n\n from all_values\n where value_field in (\n {% for value in values -%}\n {% if quote -%}\n '{{ value }}'\n {%- else -%}\n {{ value }}\n {%- endif -%}\n {%- if not loop.last -%},{%- endif %}\n {%- endfor %}\n )\n\n)\n\nselect *\nfrom validation_errors\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "column_name", "type": null, "description": ""}, {"name": "values", "type": null, "description": ""}, {"name": "quote", "type": null, "description": ""}], "created_at": 1789079002.5588915, "supported_languages": null}, "macro.dbt_utils.test_accepted_range": {"name": "test_accepted_range", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/accepted_range.sql", "original_file_path": "macros/generic_tests/accepted_range.sql", "unique_id": "macro.dbt_utils.test_accepted_range", "macro_sql": "{% test accepted_range(model, column_name, min_value=none, max_value=none, inclusive=true) %}\n {{ return(adapter.dispatch('test_accepted_range', 'dbt_utils')(model, column_name, min_value, max_value, inclusive)) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_accepted_range"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "column_name", "type": null, "description": ""}, {"name": "min_value", "type": null, "description": ""}, {"name": "max_value", "type": null, "description": ""}, {"name": "inclusive", "type": null, "description": ""}], "created_at": 1789079002.5594022, "supported_languages": null}, "macro.dbt_utils.default__test_accepted_range": {"name": "default__test_accepted_range", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/accepted_range.sql", "original_file_path": "macros/generic_tests/accepted_range.sql", "unique_id": "macro.dbt_utils.default__test_accepted_range", "macro_sql": "{% macro default__test_accepted_range(model, column_name, min_value=none, max_value=none, inclusive=true) %}\n\nwith meet_condition as(\n select *\n from {{ model }}\n),\n\nvalidation_errors as (\n select *\n from meet_condition\n where\n -- never true, defaults to an empty result set. Exists to ensure any combo of the `or` clauses below succeeds\n 1 = 2\n\n {%- if min_value is not none %}\n -- records with a value >= min_value are permitted. The `not` flips this to find records that don't meet the rule.\n or not {{ column_name }} > {{- \"=\" if inclusive }} {{ min_value }}\n {%- endif %}\n\n {%- if max_value is not none %}\n -- records with a value <= max_value are permitted. The `not` flips this to find records that don't meet the rule.\n or not {{ column_name }} < {{- \"=\" if inclusive }} {{ max_value }}\n {%- endif %}\n)\n\nselect *\nfrom validation_errors\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "column_name", "type": null, "description": ""}, {"name": "min_value", "type": null, "description": ""}, {"name": "max_value", "type": null, "description": ""}, {"name": "inclusive", "type": null, "description": ""}], "created_at": 1789079002.559936, "supported_languages": null}, "macro.dbt_utils.get_url_parameter": {"name": "get_url_parameter", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/web/get_url_parameter.sql", "original_file_path": "macros/web/get_url_parameter.sql", "unique_id": "macro.dbt_utils.get_url_parameter", "macro_sql": "{% macro get_url_parameter(field, url_parameter) -%}\n {{ return(adapter.dispatch('get_url_parameter', 'dbt_utils')(field, url_parameter)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__get_url_parameter"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field", "type": null, "description": ""}, {"name": "url_parameter", "type": null, "description": ""}], "created_at": 1789079002.5602832, "supported_languages": null}, "macro.dbt_utils.default__get_url_parameter": {"name": "default__get_url_parameter", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/web/get_url_parameter.sql", "original_file_path": "macros/web/get_url_parameter.sql", "unique_id": "macro.dbt_utils.default__get_url_parameter", "macro_sql": "{% macro default__get_url_parameter(field, url_parameter) -%}\n\n{%- set formatted_url_parameter = \"'\" + url_parameter + \"='\" -%}\n\n{%- set split = dbt.split_part(dbt.split_part(field, formatted_url_parameter, 2), \"'&'\", 1) -%}\n\nnullif({{ split }},'')\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.split_part"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field", "type": null, "description": ""}, {"name": "url_parameter", "type": null, "description": ""}], "created_at": 1789079002.5606549, "supported_languages": null}, "macro.dbt_utils.get_url_host": {"name": "get_url_host", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/web/get_url_host.sql", "original_file_path": "macros/web/get_url_host.sql", "unique_id": "macro.dbt_utils.get_url_host", "macro_sql": "{% macro get_url_host(field) -%}\n {{ return(adapter.dispatch('get_url_host', 'dbt_utils')(field)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__get_url_host"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field", "type": null, "description": ""}], "created_at": 1789079002.5610063, "supported_languages": null}, "macro.dbt_utils.default__get_url_host": {"name": "default__get_url_host", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/web/get_url_host.sql", "original_file_path": "macros/web/get_url_host.sql", "unique_id": "macro.dbt_utils.default__get_url_host", "macro_sql": "{% macro default__get_url_host(field) -%}\n\n{%- set parsed =\n dbt.split_part(\n dbt.split_part(\n dbt.replace(\n dbt.replace(\n dbt.replace(field, \"'android-app://'\", \"''\"\n ), \"'http://'\", \"''\"\n ), \"'https://'\", \"''\"\n ), \"'/'\", 1\n ), \"'?'\", 1\n )\n\n-%}\n\n\n {{ dbt.safe_cast(\n parsed,\n dbt.type_string()\n )}}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.split_part", "macro.dbt.replace", "macro.dbt.safe_cast", "macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field", "type": null, "description": ""}], "created_at": 1789079002.5615854, "supported_languages": null}, "macro.dbt_utils.get_url_path": {"name": "get_url_path", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/web/get_url_path.sql", "original_file_path": "macros/web/get_url_path.sql", "unique_id": "macro.dbt_utils.get_url_path", "macro_sql": "{% macro get_url_path(field) -%}\n {{ return(adapter.dispatch('get_url_path', 'dbt_utils')(field)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__get_url_path"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field", "type": null, "description": ""}], "created_at": 1789079002.5619912, "supported_languages": null}, "macro.dbt_utils.default__get_url_path": {"name": "default__get_url_path", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/web/get_url_path.sql", "original_file_path": "macros/web/get_url_path.sql", "unique_id": "macro.dbt_utils.default__get_url_path", "macro_sql": "{% macro default__get_url_path(field) -%}\n\n {%- set stripped_url =\n dbt.replace(\n dbt.replace(field, \"'http://'\", \"''\"), \"'https://'\", \"''\")\n -%}\n\n {%- set first_slash_pos -%}\n coalesce(\n nullif({{ dbt.position(\"'/'\", stripped_url) }}, 0),\n {{ dbt.position(\"'?'\", stripped_url) }} - 1\n )\n {%- endset -%}\n\n {%- set parsed_path =\n dbt.split_part(\n dbt.right(\n stripped_url,\n dbt.length(stripped_url) ~ \"-\" ~ first_slash_pos\n ),\n \"'?'\", 1\n )\n -%}\n\n {{ dbt.safe_cast(\n parsed_path,\n dbt.type_string()\n )}}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.replace", "macro.dbt.position", "macro.dbt.split_part", "macro.dbt.right", "macro.dbt.length", "macro.dbt.safe_cast", "macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field", "type": null, "description": ""}], "created_at": 1789079002.5627022, "supported_languages": null}, "macro.dbt_utils.get_column_values": {"name": "get_column_values", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_column_values.sql", "original_file_path": "macros/sql/get_column_values.sql", "unique_id": "macro.dbt_utils.get_column_values", "macro_sql": "{% macro get_column_values(table, column, order_by='count(*) desc', max_records=none, default=none, where=none) -%}\n {{ return(adapter.dispatch('get_column_values', 'dbt_utils')(table, column, order_by, max_records, default, where)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__get_column_values"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "table", "type": null, "description": ""}, {"name": "column", "type": null, "description": ""}, {"name": "order_by", "type": null, "description": ""}, {"name": "max_records", "type": null, "description": ""}, {"name": "default", "type": null, "description": ""}, {"name": "where", "type": null, "description": ""}], "created_at": 1789079002.563491, "supported_languages": null}, "macro.dbt_utils.default__get_column_values": {"name": "default__get_column_values", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_column_values.sql", "original_file_path": "macros/sql/get_column_values.sql", "unique_id": "macro.dbt_utils.default__get_column_values", "macro_sql": "{% macro default__get_column_values(table, column, order_by='count(*) desc', max_records=none, default=none, where=none) -%}\n {#-- Prevent querying of db in parsing mode. This works because this macro does not create any new refs. #}\n {%- if not execute -%}\n {% set default = [] if not default %}\n {{ return(default) }}\n {% endif %}\n\n {%- do dbt_utils._is_ephemeral(table, 'get_column_values') -%}\n\n {# Not all relations are tables. Renaming for internal clarity without breaking functionality for anyone using named arguments #}\n {# TODO: Change the method signature in a future 0.x.0 release #}\n {%- set target_relation = table -%}\n\n {# adapter.load_relation is a convenience wrapper to avoid building a Relation when we already have one #}\n {% set relation_exists = (load_relation(target_relation)) is not none %}\n\n {%- call statement('get_column_values', fetch_result=true) %}\n\n {%- if not relation_exists and default is none -%}\n\n {{ exceptions.raise_compiler_error(\"In get_column_values(): relation \" ~ target_relation ~ \" does not exist and no default value was provided.\") }}\n\n {%- elif not relation_exists and default is not none -%}\n\n {{ log(\"Relation \" ~ target_relation ~ \" does not exist. Returning the default value: \" ~ default) }}\n\n {{ return(default) }}\n\n {%- else -%}\n\n\n select\n {{ column }} as value\n\n from {{ target_relation }}\n\n {% if where is not none %}\n where {{ where }}\n {% endif %}\n\n group by {{ column }}\n order by {{ order_by }}\n\n {% if max_records is not none %}\n limit {{ max_records }}\n {% endif %}\n\n {% endif %}\n\n {%- endcall -%}\n\n {%- set value_list = load_result('get_column_values') -%}\n\n {%- if value_list and value_list['data'] -%}\n {%- set values = value_list['data'] | map(attribute=0) | list %}\n {{ return(values) }}\n {%- else -%}\n {{ return(default) }}\n {%- endif -%}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_utils._is_ephemeral", "macro.dbt.load_relation", "macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "table", "type": null, "description": ""}, {"name": "column", "type": null, "description": ""}, {"name": "order_by", "type": null, "description": ""}, {"name": "max_records", "type": null, "description": ""}, {"name": "default", "type": null, "description": ""}, {"name": "where", "type": null, "description": ""}], "created_at": 1789079002.5651813, "supported_languages": null}, "macro.dbt_utils.star": {"name": "star", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/star.sql", "original_file_path": "macros/sql/star.sql", "unique_id": "macro.dbt_utils.star", "macro_sql": "{% macro star(from, relation_alias=False, except=[], prefix='', suffix='', quote_identifiers=True, unquote_aliases=False, rename={}) -%}\r\n {{ return(adapter.dispatch('star', 'dbt_utils')(from, relation_alias, except, prefix, suffix, quote_identifiers, unquote_aliases, rename)) }}\r\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__star"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "from", "type": null, "description": ""}, {"name": "relation_alias", "type": null, "description": ""}, {"name": "except", "type": null, "description": ""}, {"name": "prefix", "type": null, "description": ""}, {"name": "suffix", "type": null, "description": ""}, {"name": "quote_identifiers", "type": null, "description": ""}, {"name": "unquote_aliases", "type": null, "description": ""}, {"name": "rename", "type": null, "description": ""}], "created_at": 1789079002.5661552, "supported_languages": null}, "macro.dbt_utils.default__star": {"name": "default__star", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/star.sql", "original_file_path": "macros/sql/star.sql", "unique_id": "macro.dbt_utils.default__star", "macro_sql": "{% macro default__star(from, relation_alias=False, except=[], prefix='', suffix='', quote_identifiers=True, unquote_aliases=False, rename={}) -%}\r\n {%- do dbt_utils._is_relation(from, 'star') -%}\r\n {%- do dbt_utils._is_ephemeral(from, 'star') -%}\r\n\r\n {#-- Prevent querying of db in parsing mode. This works because this macro does not create any new refs. #}\r\n {%- if not execute -%}\r\n {% do return('*') %}\r\n {%- endif -%}\r\n\r\n {% set cols = dbt_utils.get_filtered_columns_in_relation(from, except) %}\r\n\r\n {%- set rename_lower = {} -%}\r\n {%- for key, val in rename.items() -%}\r\n {%- do rename_lower.update({key.lower(): val}) -%}\r\n {%- endfor -%}\r\n\r\n {%- if cols|length <= 0 -%}\r\n {% if flags.WHICH == 'compile' %}\r\n {% set response %}\r\n*\r\n/* No columns were returned. Maybe the relation doesn't exist yet\r\nor all columns were excluded. This star is only output during\r\ndbt compile, and exists to keep SQLFluff happy. */\r\n {% endset %}\r\n {% do return(response) %}\r\n {% else %}\r\n {% do return(\"/* no columns returned from star() macro */\") %}\r\n {% endif %}\r\n {%- else -%}\r\n {%- for col in cols %}\r\n {%- if relation_alias %}{{ relation_alias }}.{% else %}{%- endif -%}\r\n {%- if quote_identifiers -%}\r\n {{ adapter.quote(col)|trim }}\r\n {%- if col.lower() in rename_lower %} as {{ rename_lower[col.lower()] }}\r\n {%- elif unquote_aliases %} as {{ (prefix ~ col ~ suffix)|trim }}\r\n {%- elif prefix!='' or suffix!='' %} as {{ adapter.quote(prefix ~ col ~ suffix)|trim }}\r\n {%- endif -%}\r\n {%- else -%}\r\n {{ col|trim }}\r\n {%- if col.lower() in rename_lower %} as {{ rename_lower[col.lower()] }}\r\n {%- elif prefix!='' or suffix!='' %} as {{ (prefix ~ col ~ suffix)|trim }}\r\n {%- endif -%}\r\n {%- endif -%}\r\n {%- if not loop.last %},{{ '\\n ' }}{%- endif -%}\r\n {%- endfor -%}\r\n {% endif %}\r\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_utils._is_relation", "macro.dbt_utils._is_ephemeral", "macro.dbt_utils.get_filtered_columns_in_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "from", "type": null, "description": ""}, {"name": "relation_alias", "type": null, "description": ""}, {"name": "except", "type": null, "description": ""}, {"name": "prefix", "type": null, "description": ""}, {"name": "suffix", "type": null, "description": ""}, {"name": "quote_identifiers", "type": null, "description": ""}, {"name": "unquote_aliases", "type": null, "description": ""}, {"name": "rename", "type": null, "description": ""}], "created_at": 1789079002.5684385, "supported_languages": null}, "macro.dbt_utils.get_table_types_sql": {"name": "get_table_types_sql", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_table_types_sql.sql", "original_file_path": "macros/sql/get_table_types_sql.sql", "unique_id": "macro.dbt_utils.get_table_types_sql", "macro_sql": "{%- macro get_table_types_sql() -%}\n {{ return(adapter.dispatch('get_table_types_sql', 'dbt_utils')()) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt_utils.postgres__get_table_types_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789079002.568854, "supported_languages": null}, "macro.dbt_utils.default__get_table_types_sql": {"name": "default__get_table_types_sql", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_table_types_sql.sql", "original_file_path": "macros/sql/get_table_types_sql.sql", "unique_id": "macro.dbt_utils.default__get_table_types_sql", "macro_sql": "{% macro default__get_table_types_sql() %}\n case table_type\n when 'BASE TABLE' then 'table'\n when 'EXTERNAL TABLE' then 'external'\n when 'MATERIALIZED VIEW' then 'materializedview'\n else lower(table_type)\n end as {{ adapter.quote('table_type') }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789079002.5690289, "supported_languages": null}, "macro.dbt_utils.postgres__get_table_types_sql": {"name": "postgres__get_table_types_sql", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_table_types_sql.sql", "original_file_path": "macros/sql/get_table_types_sql.sql", "unique_id": "macro.dbt_utils.postgres__get_table_types_sql", "macro_sql": "{% macro postgres__get_table_types_sql() %}\n case table_type\n when 'BASE TABLE' then 'table'\n when 'FOREIGN' then 'external'\n when 'MATERIALIZED VIEW' then 'materializedview'\n else lower(table_type)\n end as {{ adapter.quote('table_type') }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789079002.5691931, "supported_languages": null}, "macro.dbt_utils.databricks__get_table_types_sql": {"name": "databricks__get_table_types_sql", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_table_types_sql.sql", "original_file_path": "macros/sql/get_table_types_sql.sql", "unique_id": "macro.dbt_utils.databricks__get_table_types_sql", "macro_sql": "{% macro databricks__get_table_types_sql() %}\n case table_type\n when 'MANAGED' then 'table'\n when 'BASE TABLE' then 'table'\n when 'MATERIALIZED VIEW' then 'materializedview'\n else lower(table_type)\n end as {{ adapter.quote('table_type') }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789079002.5693538, "supported_languages": null}, "macro.dbt_utils.get_tables_by_pattern_sql": {"name": "get_tables_by_pattern_sql", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_tables_by_pattern_sql.sql", "original_file_path": "macros/sql/get_tables_by_pattern_sql.sql", "unique_id": "macro.dbt_utils.get_tables_by_pattern_sql", "macro_sql": "{% macro get_tables_by_pattern_sql(schema_pattern, table_pattern, exclude='', database=target.database) %}\n {{ return(adapter.dispatch('get_tables_by_pattern_sql', 'dbt_utils')\n (schema_pattern, table_pattern, exclude, database)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__get_tables_by_pattern_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "schema_pattern", "type": null, "description": ""}, {"name": "table_pattern", "type": null, "description": ""}, {"name": "exclude", "type": null, "description": ""}, {"name": "database", "type": null, "description": ""}], "created_at": 1789079002.5702503, "supported_languages": null}, "macro.dbt_utils.default__get_tables_by_pattern_sql": {"name": "default__get_tables_by_pattern_sql", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_tables_by_pattern_sql.sql", "original_file_path": "macros/sql/get_tables_by_pattern_sql.sql", "unique_id": "macro.dbt_utils.default__get_tables_by_pattern_sql", "macro_sql": "{% macro default__get_tables_by_pattern_sql(schema_pattern, table_pattern, exclude='', database=target.database) %}\n\n select distinct\n table_schema as {{ adapter.quote('table_schema') }},\n table_name as {{ adapter.quote('table_name') }},\n {{ dbt_utils.get_table_types_sql() }}\n from {{ database }}.information_schema.tables\n where table_schema ilike '{{ schema_pattern }}'\n and table_name ilike '{{ table_pattern }}'\n and table_name not ilike '{{ exclude }}'\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.get_table_types_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "schema_pattern", "type": null, "description": ""}, {"name": "table_pattern", "type": null, "description": ""}, {"name": "exclude", "type": null, "description": ""}, {"name": "database", "type": null, "description": ""}], "created_at": 1789079002.5706558, "supported_languages": null}, "macro.dbt_utils.redshift__get_tables_by_pattern_sql": {"name": "redshift__get_tables_by_pattern_sql", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_tables_by_pattern_sql.sql", "original_file_path": "macros/sql/get_tables_by_pattern_sql.sql", "unique_id": "macro.dbt_utils.redshift__get_tables_by_pattern_sql", "macro_sql": "{% macro redshift__get_tables_by_pattern_sql(schema_pattern, table_pattern, exclude='', database=target.database) %}\n\n {% set sql %}\n select distinct\n table_schema as {{ adapter.quote('table_schema') }},\n table_name as {{ adapter.quote('table_name') }},\n {{ dbt_utils.get_table_types_sql() }}\n from \"{{ database }}\".\"information_schema\".\"tables\"\n where table_schema ilike '{{ schema_pattern }}'\n and table_name ilike '{{ table_pattern }}'\n and table_name not ilike '{{ exclude }}'\n union all\n select distinct\n schemaname as {{ adapter.quote('table_schema') }},\n tablename as {{ adapter.quote('table_name') }},\n 'external' as {{ adapter.quote('table_type') }}\n from svv_external_tables\n where redshift_database_name = '{{ database }}'\n and schemaname ilike '{{ schema_pattern }}'\n and table_name ilike '{{ table_pattern }}'\n and table_name not ilike '{{ exclude }}'\n {% endset %}\n\n {{ return(sql) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.get_table_types_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "schema_pattern", "type": null, "description": ""}, {"name": "table_pattern", "type": null, "description": ""}, {"name": "exclude", "type": null, "description": ""}, {"name": "database", "type": null, "description": ""}], "created_at": 1789079002.571403, "supported_languages": null}, "macro.dbt_utils.bigquery__get_tables_by_pattern_sql": {"name": "bigquery__get_tables_by_pattern_sql", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_tables_by_pattern_sql.sql", "original_file_path": "macros/sql/get_tables_by_pattern_sql.sql", "unique_id": "macro.dbt_utils.bigquery__get_tables_by_pattern_sql", "macro_sql": "{% macro bigquery__get_tables_by_pattern_sql(schema_pattern, table_pattern, exclude='', database=target.database) %}\n\n {% if '%' in schema_pattern %}\n {% set schemata=dbt_utils._bigquery__get_matching_schemata(schema_pattern, database) %}\n {% else %}\n {% set schemata=[schema_pattern] %}\n {% endif %}\n\n {% set sql %}\n {% for schema in schemata %}\n select distinct\n table_schema,\n table_name,\n {{ dbt_utils.get_table_types_sql() }}\n\n from {{ adapter.quote(database) }}.{{ schema }}.INFORMATION_SCHEMA.TABLES\n where lower(table_name) like lower ('{{ table_pattern }}')\n and lower(table_name) not like lower ('{{ exclude }}')\n\n {% if not loop.last %} union all {% endif %}\n\n {% endfor %}\n {% endset %}\n\n {{ return(sql) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils._bigquery__get_matching_schemata", "macro.dbt_utils.get_table_types_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "schema_pattern", "type": null, "description": ""}, {"name": "table_pattern", "type": null, "description": ""}, {"name": "exclude", "type": null, "description": ""}, {"name": "database", "type": null, "description": ""}], "created_at": 1789079002.5722122, "supported_languages": null}, "macro.dbt_utils._bigquery__get_matching_schemata": {"name": "_bigquery__get_matching_schemata", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_tables_by_pattern_sql.sql", "original_file_path": "macros/sql/get_tables_by_pattern_sql.sql", "unique_id": "macro.dbt_utils._bigquery__get_matching_schemata", "macro_sql": "{% macro _bigquery__get_matching_schemata(schema_pattern, database) %}\n {% if execute %}\n\n {% set sql %}\n select schema_name from {{ adapter.quote(database) }}.INFORMATION_SCHEMA.SCHEMATA\n where lower(schema_name) like lower('{{ schema_pattern }}')\n {% endset %}\n\n {% set results=run_query(sql) %}\n\n {% set schemata=results.columns['schema_name'].values() %}\n\n {{ return(schemata) }}\n\n {% else %}\n\n {{ return([]) }}\n\n {% endif %}\n\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "schema_pattern", "type": null, "description": ""}, {"name": "database", "type": null, "description": ""}], "created_at": 1789079002.5727665, "supported_languages": null}, "macro.dbt_utils.get_tables_by_prefix_sql": {"name": "get_tables_by_prefix_sql", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_tables_by_prefix_sql.sql", "original_file_path": "macros/sql/get_tables_by_prefix_sql.sql", "unique_id": "macro.dbt_utils.get_tables_by_prefix_sql", "macro_sql": "{% macro get_tables_by_prefix_sql(schema, prefix, exclude='', database=target.database) %}\n {{ return(adapter.dispatch('get_tables_by_prefix_sql', 'dbt_utils')(schema, prefix, exclude, database)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__get_tables_by_prefix_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "schema", "type": null, "description": ""}, {"name": "prefix", "type": null, "description": ""}, {"name": "exclude", "type": null, "description": ""}, {"name": "database", "type": null, "description": ""}], "created_at": 1789079002.573207, "supported_languages": null}, "macro.dbt_utils.default__get_tables_by_prefix_sql": {"name": "default__get_tables_by_prefix_sql", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_tables_by_prefix_sql.sql", "original_file_path": "macros/sql/get_tables_by_prefix_sql.sql", "unique_id": "macro.dbt_utils.default__get_tables_by_prefix_sql", "macro_sql": "{% macro default__get_tables_by_prefix_sql(schema, prefix, exclude='', database=target.database) %}\n\n {{ dbt_utils.get_tables_by_pattern_sql(\n schema_pattern = schema,\n table_pattern = prefix ~ '%',\n exclude = exclude,\n database = database\n ) }}\n \n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.get_tables_by_pattern_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "schema", "type": null, "description": ""}, {"name": "prefix", "type": null, "description": ""}, {"name": "exclude", "type": null, "description": ""}, {"name": "database", "type": null, "description": ""}], "created_at": 1789079002.5735152, "supported_languages": null}, "macro.dbt_utils.degrees_to_radians": {"name": "degrees_to_radians", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/haversine_distance.sql", "original_file_path": "macros/sql/haversine_distance.sql", "unique_id": "macro.dbt_utils.degrees_to_radians", "macro_sql": "{% macro degrees_to_radians(degrees) -%}\n acos(-1) * {{degrees}} / 180\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "degrees", "type": null, "description": ""}], "created_at": 1789079002.574017, "supported_languages": null}, "macro.dbt_utils.haversine_distance": {"name": "haversine_distance", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/haversine_distance.sql", "original_file_path": "macros/sql/haversine_distance.sql", "unique_id": "macro.dbt_utils.haversine_distance", "macro_sql": "{% macro haversine_distance(lat1, lon1, lat2, lon2, unit='mi') -%}\n {{ return(adapter.dispatch('haversine_distance', 'dbt_utils')(lat1,lon1,lat2,lon2,unit)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__haversine_distance"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "lat1", "type": null, "description": ""}, {"name": "lon1", "type": null, "description": ""}, {"name": "lat2", "type": null, "description": ""}, {"name": "lon2", "type": null, "description": ""}, {"name": "unit", "type": null, "description": ""}], "created_at": 1789079002.5743196, "supported_languages": null}, "macro.dbt_utils.default__haversine_distance": {"name": "default__haversine_distance", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/haversine_distance.sql", "original_file_path": "macros/sql/haversine_distance.sql", "unique_id": "macro.dbt_utils.default__haversine_distance", "macro_sql": "{% macro default__haversine_distance(lat1, lon1, lat2, lon2, unit='mi') -%}\n{%- if unit == 'mi' %}\n {% set conversion_rate = 1 %}\n{% elif unit == 'km' %}\n {% set conversion_rate = 1.60934 %}\n{% else %}\n {{ exceptions.raise_compiler_error(\"unit input must be one of 'mi' or 'km'. Got \" ~ unit) }}\n{% endif %}\n\n 2 * 3961 * asin(sqrt(power((sin(radians(({{ lat2 }} - {{ lat1 }}) / 2))), 2) +\n cos(radians({{lat1}})) * cos(radians({{lat2}})) *\n power((sin(radians(({{ lon2 }} - {{ lon1 }}) / 2))), 2))) * {{ conversion_rate }}\n\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "lat1", "type": null, "description": ""}, {"name": "lon1", "type": null, "description": ""}, {"name": "lat2", "type": null, "description": ""}, {"name": "lon2", "type": null, "description": ""}, {"name": "unit", "type": null, "description": ""}], "created_at": 1789079002.5750463, "supported_languages": null}, "macro.dbt_utils.bigquery__haversine_distance": {"name": "bigquery__haversine_distance", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/haversine_distance.sql", "original_file_path": "macros/sql/haversine_distance.sql", "unique_id": "macro.dbt_utils.bigquery__haversine_distance", "macro_sql": "{% macro bigquery__haversine_distance(lat1, lon1, lat2, lon2, unit='mi') -%}\n{% set radians_lat1 = dbt_utils.degrees_to_radians(lat1) %}\n{% set radians_lat2 = dbt_utils.degrees_to_radians(lat2) %}\n{% set radians_lon1 = dbt_utils.degrees_to_radians(lon1) %}\n{% set radians_lon2 = dbt_utils.degrees_to_radians(lon2) %}\n{%- if unit == 'mi' %}\n {% set conversion_rate = 1 %}\n{% elif unit == 'km' %}\n {% set conversion_rate = 1.60934 %}\n{% else %}\n {{ exceptions.raise_compiler_error(\"unit input must be one of 'mi' or 'km'. Got \" ~ unit) }}\n{% endif %}\n 2 * 3961 * asin(sqrt(power(sin(({{ radians_lat2 }} - {{ radians_lat1 }}) / 2), 2) +\n cos({{ radians_lat1 }}) * cos({{ radians_lat2 }}) *\n power(sin(({{ radians_lon2 }} - {{ radians_lon1 }}) / 2), 2))) * {{ conversion_rate }}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.degrees_to_radians"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "lat1", "type": null, "description": ""}, {"name": "lon1", "type": null, "description": ""}, {"name": "lat2", "type": null, "description": ""}, {"name": "lon2", "type": null, "description": ""}, {"name": "unit", "type": null, "description": ""}], "created_at": 1789079002.5759451, "supported_languages": null}, "macro.dbt_utils.get_powers_of_two": {"name": "get_powers_of_two", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/generate_series.sql", "original_file_path": "macros/sql/generate_series.sql", "unique_id": "macro.dbt_utils.get_powers_of_two", "macro_sql": "{% macro get_powers_of_two(upper_bound) %}\n {{ return(adapter.dispatch('get_powers_of_two', 'dbt_utils')(upper_bound)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__get_powers_of_two"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "upper_bound", "type": null, "description": ""}], "created_at": 1789079002.5764487, "supported_languages": null}, "macro.dbt_utils.default__get_powers_of_two": {"name": "default__get_powers_of_two", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/generate_series.sql", "original_file_path": "macros/sql/generate_series.sql", "unique_id": "macro.dbt_utils.default__get_powers_of_two", "macro_sql": "{% macro default__get_powers_of_two(upper_bound) %}\n\n {% if upper_bound <= 0 %}\n {{ exceptions.raise_compiler_error(\"upper bound must be positive\") }}\n {% endif %}\n\n {% for _ in range(1, 100) %}\n {% if upper_bound <= 2 ** loop.index %}{{ return(loop.index) }}{% endif %}\n {% endfor %}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "upper_bound", "type": null, "description": ""}], "created_at": 1789079002.5769205, "supported_languages": null}, "macro.dbt_utils.generate_series": {"name": "generate_series", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/generate_series.sql", "original_file_path": "macros/sql/generate_series.sql", "unique_id": "macro.dbt_utils.generate_series", "macro_sql": "{% macro generate_series(upper_bound) %}\n {{ return(adapter.dispatch('generate_series', 'dbt_utils')(upper_bound)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__generate_series"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "upper_bound", "type": null, "description": ""}], "created_at": 1789079002.577136, "supported_languages": null}, "macro.dbt_utils.default__generate_series": {"name": "default__generate_series", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/generate_series.sql", "original_file_path": "macros/sql/generate_series.sql", "unique_id": "macro.dbt_utils.default__generate_series", "macro_sql": "{% macro default__generate_series(upper_bound) %}\n\n {% set n = dbt_utils.get_powers_of_two(upper_bound) %}\n\n with p as (\n select 0 as generated_number union all select 1\n ), unioned as (\n\n select\n\n {% for i in range(n) %}\n p{{i}}.generated_number * power(2, {{i}})\n {% if not loop.last %} + {% endif %}\n {% endfor %}\n + 1\n as generated_number\n\n from\n\n {% for i in range(n) %}\n p as p{{i}}\n {% if not loop.last %} cross join {% endif %}\n {% endfor %}\n\n )\n\n select *\n from unioned\n where generated_number <= {{upper_bound}}\n order by generated_number\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.get_powers_of_two"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "upper_bound", "type": null, "description": ""}], "created_at": 1789079002.5777092, "supported_languages": null}, "macro.dbt_utils.safe_subtract": {"name": "safe_subtract", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/safe_subtract.sql", "original_file_path": "macros/sql/safe_subtract.sql", "unique_id": "macro.dbt_utils.safe_subtract", "macro_sql": "{%- macro safe_subtract(field_list) -%}\n {{ return(adapter.dispatch('safe_subtract', 'dbt_utils')(field_list)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__safe_subtract"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field_list", "type": null, "description": ""}], "created_at": 1789079002.578098, "supported_languages": null}, "macro.dbt_utils.default__safe_subtract": {"name": "default__safe_subtract", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/safe_subtract.sql", "original_file_path": "macros/sql/safe_subtract.sql", "unique_id": "macro.dbt_utils.default__safe_subtract", "macro_sql": "\n\n{%- macro default__safe_subtract(field_list) -%}\n\n{%- if field_list is not iterable or field_list is string or field_list is mapping -%}\n\n{%- set error_message = '\nWarning: the `safe_subtract` macro takes a single list argument instead of \\\nstring arguments. The {}.{} model triggered this warning. \\\n'.format(model.package_name, model.name) -%}\n\n{%- do exceptions.raise_compiler_error(error_message) -%}\n\n{%- endif -%}\n\n{% set fields = [] %}\n\n{%- for field in field_list -%}\n\n {% do fields.append(\"coalesce(\" ~ field ~ \", 0)\") %}\n\n{%- endfor -%}\n\n{{ fields|join(' -\\n ') }}\n\n{%- endmacro -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field_list", "type": null, "description": ""}], "created_at": 1789079002.5786984, "supported_languages": null}, "macro.dbt_utils.deduplicate": {"name": "deduplicate", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/deduplicate.sql", "original_file_path": "macros/sql/deduplicate.sql", "unique_id": "macro.dbt_utils.deduplicate", "macro_sql": "{%- macro deduplicate(relation, partition_by, order_by) -%}\n {{ return(adapter.dispatch('deduplicate', 'dbt_utils')(relation, partition_by, order_by)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.postgres__deduplicate"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "partition_by", "type": null, "description": ""}, {"name": "order_by", "type": null, "description": ""}], "created_at": 1789079002.5793436, "supported_languages": null}, "macro.dbt_utils.default__deduplicate": {"name": "default__deduplicate", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/deduplicate.sql", "original_file_path": "macros/sql/deduplicate.sql", "unique_id": "macro.dbt_utils.default__deduplicate", "macro_sql": "\n\n{%- macro default__deduplicate(relation, partition_by, order_by) -%}\n\n with row_numbered as (\n select\n _inner.*,\n row_number() over (\n partition by {{ partition_by }}\n order by {{ order_by }}\n ) as rn\n from {{ relation }} as _inner\n )\n\n select\n distinct data.*\n from {{ relation }} as data\n {#\n -- Not all DBs will support natural joins but the ones that do include:\n -- Oracle, MySQL, SQLite, Redshift, Teradata, Materialize, Databricks\n -- Apache Spark, SingleStore, Vertica\n -- Those that do not appear to support natural joins include:\n -- SQLServer, Trino, Presto, Rockset, Athena\n #}\n natural join row_numbered\n where row_numbered.rn = 1\n\n{%- endmacro -%}\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "partition_by", "type": null, "description": ""}, {"name": "order_by", "type": null, "description": ""}], "created_at": 1789079002.5795953, "supported_languages": null}, "macro.dbt_utils.redshift__deduplicate": {"name": "redshift__deduplicate", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/deduplicate.sql", "original_file_path": "macros/sql/deduplicate.sql", "unique_id": "macro.dbt_utils.redshift__deduplicate", "macro_sql": "{% macro redshift__deduplicate(relation, partition_by, order_by) -%}\n\n select *\n from {{ relation }} as tt\n qualify\n row_number() over (\n partition by {{ partition_by }}\n order by {{ order_by }}\n ) = 1\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "partition_by", "type": null, "description": ""}, {"name": "order_by", "type": null, "description": ""}], "created_at": 1789079002.5797887, "supported_languages": null}, "macro.dbt_utils.postgres__deduplicate": {"name": "postgres__deduplicate", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/deduplicate.sql", "original_file_path": "macros/sql/deduplicate.sql", "unique_id": "macro.dbt_utils.postgres__deduplicate", "macro_sql": "\n{%- macro postgres__deduplicate(relation, partition_by, order_by) -%}\n\n select\n distinct on ({{ partition_by }}) *\n from {{ relation }}\n order by {{ partition_by }}{{ ',' ~ order_by }}\n\n{%- endmacro -%}\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "partition_by", "type": null, "description": ""}, {"name": "order_by", "type": null, "description": ""}], "created_at": 1789079002.5800192, "supported_languages": null}, "macro.dbt_utils.snowflake__deduplicate": {"name": "snowflake__deduplicate", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/deduplicate.sql", "original_file_path": "macros/sql/deduplicate.sql", "unique_id": "macro.dbt_utils.snowflake__deduplicate", "macro_sql": "\n{%- macro snowflake__deduplicate(relation, partition_by, order_by) -%}\n\n select *\n from {{ relation }}\n qualify\n row_number() over (\n partition by {{ partition_by }}\n order by {{ order_by }}\n ) = 1\n\n{%- endmacro -%}\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "partition_by", "type": null, "description": ""}, {"name": "order_by", "type": null, "description": ""}], "created_at": 1789079002.5802147, "supported_languages": null}, "macro.dbt_utils.databricks__deduplicate": {"name": "databricks__deduplicate", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/deduplicate.sql", "original_file_path": "macros/sql/deduplicate.sql", "unique_id": "macro.dbt_utils.databricks__deduplicate", "macro_sql": "\n{%- macro databricks__deduplicate(relation, partition_by, order_by) -%}\n\n select *\n from {{ relation }}\n qualify\n row_number() over (\n partition by {{ partition_by }}\n order by {{ order_by }}\n ) = 1\n\n{%- endmacro -%}\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "partition_by", "type": null, "description": ""}, {"name": "order_by", "type": null, "description": ""}], "created_at": 1789079002.5804057, "supported_languages": null}, "macro.dbt_utils.bigquery__deduplicate": {"name": "bigquery__deduplicate", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/deduplicate.sql", "original_file_path": "macros/sql/deduplicate.sql", "unique_id": "macro.dbt_utils.bigquery__deduplicate", "macro_sql": "\n{%- macro bigquery__deduplicate(relation, partition_by, order_by) -%}\n\n select unique.*\n from (\n select\n array_agg (\n original\n order by {{ order_by }}\n limit 1\n )[offset(0)] unique\n from {{ relation }} original\n group by {{ partition_by }}\n )\n\n{%- endmacro -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "partition_by", "type": null, "description": ""}, {"name": "order_by", "type": null, "description": ""}], "created_at": 1789079002.580601, "supported_languages": null}, "macro.dbt_utils.generate_surrogate_key": {"name": "generate_surrogate_key", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/generate_surrogate_key.sql", "original_file_path": "macros/sql/generate_surrogate_key.sql", "unique_id": "macro.dbt_utils.generate_surrogate_key", "macro_sql": "{%- macro generate_surrogate_key(field_list) -%}\n {{ return(adapter.dispatch('generate_surrogate_key', 'dbt_utils')(field_list)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__generate_surrogate_key"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field_list", "type": null, "description": ""}], "created_at": 1789079002.5810168, "supported_languages": null}, "macro.dbt_utils.default__generate_surrogate_key": {"name": "default__generate_surrogate_key", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/generate_surrogate_key.sql", "original_file_path": "macros/sql/generate_surrogate_key.sql", "unique_id": "macro.dbt_utils.default__generate_surrogate_key", "macro_sql": "\n\n{%- macro default__generate_surrogate_key(field_list) -%}\n\n{%- if var('surrogate_key_treat_nulls_as_empty_strings', False) -%}\n {%- set default_null_value = \"\" -%}\n{%- else -%}\n {%- set default_null_value = '_dbt_utils_surrogate_key_null_' -%}\n{%- endif -%}\n\n{%- set fields = [] -%}\n\n{%- for field in field_list -%}\n\n {%- do fields.append(\n \"coalesce(cast(\" ~ field ~ \" as \" ~ dbt.type_string() ~ \"), '\" ~ default_null_value ~\"')\"\n ) -%}\n\n {%- if not loop.last %}\n {%- do fields.append(\"'-'\") -%}\n {%- endif -%}\n\n{%- endfor -%}\n\n{{ dbt.hash(dbt.concat(fields)) }}\n\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt.type_string", "macro.dbt.hash", "macro.dbt.concat"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field_list", "type": null, "description": ""}], "created_at": 1789079002.5818076, "supported_languages": null}, "macro.dbt_utils.pivot": {"name": "pivot", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/pivot.sql", "original_file_path": "macros/sql/pivot.sql", "unique_id": "macro.dbt_utils.pivot", "macro_sql": "{% macro pivot(column,\n values,\n alias=True,\n agg='sum',\n cmp='=',\n prefix='',\n suffix='',\n then_value=1,\n else_value=0,\n quote_identifiers=True,\n distinct=False) %}\n {{ return(adapter.dispatch('pivot', 'dbt_utils')(column, values, alias, agg, cmp, prefix, suffix, then_value, else_value, quote_identifiers, distinct)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__pivot"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "column", "type": null, "description": ""}, {"name": "values", "type": null, "description": ""}, {"name": "alias", "type": null, "description": ""}, {"name": "agg", "type": null, "description": ""}, {"name": "cmp", "type": null, "description": ""}, {"name": "prefix", "type": null, "description": ""}, {"name": "suffix", "type": null, "description": ""}, {"name": "then_value", "type": null, "description": ""}, {"name": "else_value", "type": null, "description": ""}, {"name": "quote_identifiers", "type": null, "description": ""}, {"name": "distinct", "type": null, "description": ""}], "created_at": 1789079002.58268, "supported_languages": null}, "macro.dbt_utils.default__pivot": {"name": "default__pivot", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/pivot.sql", "original_file_path": "macros/sql/pivot.sql", "unique_id": "macro.dbt_utils.default__pivot", "macro_sql": "{% macro default__pivot(column,\n values,\n alias=True,\n agg='sum',\n cmp='=',\n prefix='',\n suffix='',\n then_value=1,\n else_value=0,\n quote_identifiers=True,\n distinct=False) %}\n {% for value in values %}\n {{ agg }}(\n {% if distinct %} distinct {% endif %}\n case\n when {{ column }} {{ cmp }} '{{ dbt.escape_single_quotes(value) }}'\n then {{ then_value }}\n else {{ else_value }}\n end\n )\n {% if alias %}\n {% if quote_identifiers %}\n as {{ adapter.quote(prefix ~ value ~ suffix) }}\n {% else %}\n as {{ dbt_utils.slugify(prefix ~ value ~ suffix) }}\n {% endif %}\n {% endif %}\n {% if not loop.last %},{% endif %}\n {% endfor %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.escape_single_quotes", "macro.dbt_utils.slugify"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "column", "type": null, "description": ""}, {"name": "values", "type": null, "description": ""}, {"name": "alias", "type": null, "description": ""}, {"name": "agg", "type": null, "description": ""}, {"name": "cmp", "type": null, "description": ""}, {"name": "prefix", "type": null, "description": ""}, {"name": "suffix", "type": null, "description": ""}, {"name": "then_value", "type": null, "description": ""}, {"name": "else_value", "type": null, "description": ""}, {"name": "quote_identifiers", "type": null, "description": ""}, {"name": "distinct", "type": null, "description": ""}], "created_at": 1789079002.5835996, "supported_languages": null}, "macro.dbt_utils.nullcheck_table": {"name": "nullcheck_table", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/nullcheck_table.sql", "original_file_path": "macros/sql/nullcheck_table.sql", "unique_id": "macro.dbt_utils.nullcheck_table", "macro_sql": "{% macro nullcheck_table(relation) %}\n {{ return(adapter.dispatch('nullcheck_table', 'dbt_utils')(relation)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__nullcheck_table"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789079002.5839736, "supported_languages": null}, "macro.dbt_utils.default__nullcheck_table": {"name": "default__nullcheck_table", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/nullcheck_table.sql", "original_file_path": "macros/sql/nullcheck_table.sql", "unique_id": "macro.dbt_utils.default__nullcheck_table", "macro_sql": "{% macro default__nullcheck_table(relation) %}\n\n {%- do dbt_utils._is_relation(relation, 'nullcheck_table') -%}\n {%- do dbt_utils._is_ephemeral(relation, 'nullcheck_table') -%}\n {% set cols = adapter.get_columns_in_relation(relation) %}\n\n select {{ dbt_utils.nullcheck(cols) }}\n from {{relation}}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils._is_relation", "macro.dbt_utils._is_ephemeral", "macro.dbt_utils.nullcheck"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789079002.5843594, "supported_languages": null}, "macro.dbt_utils.get_relations_by_pattern": {"name": "get_relations_by_pattern", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_relations_by_pattern.sql", "original_file_path": "macros/sql/get_relations_by_pattern.sql", "unique_id": "macro.dbt_utils.get_relations_by_pattern", "macro_sql": "{% macro get_relations_by_pattern(schema_pattern, table_pattern, exclude='', database=target.database) %}\n {{ return(adapter.dispatch('get_relations_by_pattern', 'dbt_utils')(schema_pattern, table_pattern, exclude, database)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__get_relations_by_pattern"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "schema_pattern", "type": null, "description": ""}, {"name": "table_pattern", "type": null, "description": ""}, {"name": "exclude", "type": null, "description": ""}, {"name": "database", "type": null, "description": ""}], "created_at": 1789079002.5848813, "supported_languages": null}, "macro.dbt_utils.default__get_relations_by_pattern": {"name": "default__get_relations_by_pattern", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_relations_by_pattern.sql", "original_file_path": "macros/sql/get_relations_by_pattern.sql", "unique_id": "macro.dbt_utils.default__get_relations_by_pattern", "macro_sql": "{% macro default__get_relations_by_pattern(schema_pattern, table_pattern, exclude='', database=target.database) %}\n\n {%- call statement('get_tables', fetch_result=True) %}\n\n {{ dbt_utils.get_tables_by_pattern_sql(schema_pattern, table_pattern, exclude, database) }}\n\n {%- endcall -%}\n\n {%- set table_list = load_result('get_tables') -%}\n\n {%- if table_list and table_list['table'] -%}\n {%- set tbl_relations = [] -%}\n {%- for row in table_list['table'] -%}\n {%- set tbl_relation = api.Relation.create(\n database=database,\n schema=row.table_schema,\n identifier=row.table_name,\n type=row.table_type\n ) -%}\n {%- do tbl_relations.append(tbl_relation) -%}\n {%- endfor -%}\n\n {{ return(tbl_relations) }}\n {%- else -%}\n {{ return([]) }}\n {%- endif -%}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement", "macro.dbt_utils.get_tables_by_pattern_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "schema_pattern", "type": null, "description": ""}, {"name": "table_pattern", "type": null, "description": ""}, {"name": "exclude", "type": null, "description": ""}, {"name": "database", "type": null, "description": ""}], "created_at": 1789079002.5858164, "supported_languages": null}, "macro.dbt_utils.get_query_results_as_dict": {"name": "get_query_results_as_dict", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_query_results_as_dict.sql", "original_file_path": "macros/sql/get_query_results_as_dict.sql", "unique_id": "macro.dbt_utils.get_query_results_as_dict", "macro_sql": "{% macro get_query_results_as_dict(query) %}\n {{ return(adapter.dispatch('get_query_results_as_dict', 'dbt_utils')(query)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__get_query_results_as_dict"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "query", "type": null, "description": ""}], "created_at": 1789079002.5862136, "supported_languages": null}, "macro.dbt_utils.default__get_query_results_as_dict": {"name": "default__get_query_results_as_dict", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_query_results_as_dict.sql", "original_file_path": "macros/sql/get_query_results_as_dict.sql", "unique_id": "macro.dbt_utils.default__get_query_results_as_dict", "macro_sql": "{% macro default__get_query_results_as_dict(query) %}\n\n{# This macro returns a dictionary of the form {column_name: (tuple_of_results)} #}\n\n {%- call statement('get_query_results', fetch_result=True,auto_begin=false) -%}\n\n {{ query }}\n\n {%- endcall -%}\n\n {% set sql_results={} %}\n\n {%- if execute -%}\n {% set sql_results_table = load_result('get_query_results').table.columns %}\n {% for column_name, column in sql_results_table.items() %}\n {% do sql_results.update({column_name: column.values()}) %}\n {% endfor %}\n {%- endif -%}\n\n {{ return(sql_results) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "query", "type": null, "description": ""}], "created_at": 1789079002.5868652, "supported_languages": null}, "macro.dbt_utils.union_relations": {"name": "union_relations", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/union.sql", "original_file_path": "macros/sql/union.sql", "unique_id": "macro.dbt_utils.union_relations", "macro_sql": "{%- macro union_relations(relations, column_override=none, include=[], exclude=[], source_column_name='_dbt_source_relation', where=none) -%}\n {{ return(adapter.dispatch('union_relations', 'dbt_utils')(relations, column_override, include, exclude, source_column_name, where)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__union_relations"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relations", "type": null, "description": ""}, {"name": "column_override", "type": null, "description": ""}, {"name": "include", "type": null, "description": ""}, {"name": "exclude", "type": null, "description": ""}, {"name": "source_column_name", "type": null, "description": ""}, {"name": "where", "type": null, "description": ""}], "created_at": 1789079002.5880215, "supported_languages": null}, "macro.dbt_utils.default__union_relations": {"name": "default__union_relations", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/union.sql", "original_file_path": "macros/sql/union.sql", "unique_id": "macro.dbt_utils.default__union_relations", "macro_sql": "\n\n{%- macro default__union_relations(relations, column_override=none, include=[], exclude=[], source_column_name='_dbt_source_relation', where=none) -%}\n\n {%- if exclude and include -%}\n {{ exceptions.raise_compiler_error(\"Both an exclude and include list were provided to the `union` macro. Only one is allowed\") }}\n {%- endif -%}\n\n {#-- Prevent querying of db in parsing mode. This works because this macro does not create any new refs. -#}\n {%- if not execute %}\n {{ return('') }}\n {% endif -%}\n\n {%- set column_override = column_override if column_override is not none else {} -%}\n\n {%- set relation_columns = {} -%}\n {%- set column_superset = {} -%}\n {%- set all_excludes = [] -%}\n {%- set all_includes = [] -%}\n\n {%- if exclude -%}\n {%- for exc in exclude -%}\n {%- do all_excludes.append(exc | lower) -%}\n {%- endfor -%}\n {%- endif -%}\n\n {%- if include -%}\n {%- for inc in include -%}\n {%- do all_includes.append(inc | lower) -%}\n {%- endfor -%}\n {%- endif -%}\n\n {%- for relation in relations -%}\n\n {%- do relation_columns.update({relation: []}) -%}\n\n {%- do dbt_utils._is_relation(relation, 'union_relations') -%}\n {%- do dbt_utils._is_ephemeral(relation, 'union_relations') -%}\n {%- set cols = adapter.get_columns_in_relation(relation) -%}\n {%- for col in cols -%}\n\n {#- If an exclude list was provided and the column is in the list, do nothing -#}\n {%- if exclude and col.column | lower in all_excludes -%}\n\n {#- If an include list was provided and the column is not in the list, do nothing -#}\n {%- elif include and col.column | lower not in all_includes -%}\n\n {#- Otherwise add the column to the column superset -#}\n {%- else -%}\n\n {#- update the list of columns in this relation -#}\n {%- do relation_columns[relation].append(col.column) -%}\n\n {%- if col.column in column_superset -%}\n\n {%- set stored = column_superset[col.column] -%}\n {%- if col.is_string() and stored.is_string() and col.string_size() > stored.string_size() -%}\n\n {%- do column_superset.update({col.column: col}) -%}\n\n {%- endif %}\n\n {%- else -%}\n\n {%- do column_superset.update({col.column: col}) -%}\n\n {%- endif -%}\n\n {%- endif -%}\n\n {%- endfor -%}\n {%- endfor -%}\n\n {%- set ordered_column_names = column_superset.keys() -%}\n {%- set dbt_command = flags.WHICH -%}\n\n\n {% if dbt_command in ['run', 'build'] %}\n {% if (include | length > 0 or exclude | length > 0) and not column_superset.keys() %}\n {%- set relations_string -%}\n {%- for relation in relations -%}\n {{ relation.name }}\n {%- if not loop.last %}, {% endif -%}\n {%- endfor -%}\n {%- endset -%}\n\n {%- set error_message -%}\n There were no columns found to union for relations {{ relations_string }}\n {%- endset -%}\n\n {{ exceptions.raise_compiler_error(error_message) }}\n {%- endif -%}\n {%- endif -%}\n\n {%- for relation in relations %}\n\n (\n select\n\n {%- if source_column_name is not none %}\n cast({{ dbt.string_literal(relation.render()) }} as {{ dbt.type_string() }}) as {{ source_column_name }},\n {%- endif %}\n\n /* No columns from any of the relations.\n This star is only output during dbt compile, and exists to keep SQLFluff happy. */\n {% if dbt_command == 'compile' and ordered_column_names|length == 0 %}\n *\n {% endif %}\n\n {% for col_name in ordered_column_names -%}\n\n {%- set col = column_superset[col_name] %}\n {%- set col_type = column_override.get(col.column, col.data_type) %}\n {%- set col_name = adapter.quote(col_name) if col_name in relation_columns[relation] else 'null' %}\n cast({{ col_name }} as {{ col_type }}) as {{ col.quoted }} {% if not loop.last %},{% endif -%}\n\n {%- endfor %}\n\n from {{ relation }}\n\n {% if where -%}\n where {{ where }}\n {%- endif %}\n )\n\n {% if not loop.last -%}\n union all\n {% endif -%}\n\n {%- endfor -%}\n\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt_utils._is_relation", "macro.dbt_utils._is_ephemeral", "macro.dbt.string_literal", "macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relations", "type": null, "description": ""}, {"name": "column_override", "type": null, "description": ""}, {"name": "include", "type": null, "description": ""}, {"name": "exclude", "type": null, "description": ""}, {"name": "source_column_name", "type": null, "description": ""}, {"name": "where", "type": null, "description": ""}], "created_at": 1789079002.5919771, "supported_languages": null}, "macro.dbt_utils.unpivot": {"name": "unpivot", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/unpivot.sql", "original_file_path": "macros/sql/unpivot.sql", "unique_id": "macro.dbt_utils.unpivot", "macro_sql": "{% macro unpivot(relation=none, cast_to='varchar', exclude=none, remove=none, field_name='field_name', value_name='value', quote_identifiers=False) -%}\n {{ return(adapter.dispatch('unpivot', 'dbt_utils')(relation, cast_to, exclude, remove, field_name, value_name, quote_identifiers)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__unpivot"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "cast_to", "type": null, "description": ""}, {"name": "exclude", "type": null, "description": ""}, {"name": "remove", "type": null, "description": ""}, {"name": "field_name", "type": null, "description": ""}, {"name": "value_name", "type": null, "description": ""}, {"name": "quote_identifiers", "type": null, "description": ""}], "created_at": 1789079002.5928705, "supported_languages": null}, "macro.dbt_utils.default__unpivot": {"name": "default__unpivot", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/unpivot.sql", "original_file_path": "macros/sql/unpivot.sql", "unique_id": "macro.dbt_utils.default__unpivot", "macro_sql": "{% macro default__unpivot(relation=none, cast_to='varchar', exclude=none, remove=none, field_name='field_name', value_name='value', quote_identifiers=False) -%}\n\n {% if not relation %}\n {{ exceptions.raise_compiler_error(\"Error: argument `relation` is required for `unpivot` macro.\") }}\n {% endif %}\n\n {%- set exclude = exclude if exclude is not none else [] %}\n {%- set remove = remove if remove is not none else [] %}\n\n {%- set include_cols = [] %}\n\n {%- set table_columns = {} %}\n\n {%- do table_columns.update({relation: []}) %}\n\n {%- do dbt_utils._is_relation(relation, 'unpivot') -%}\n {%- do dbt_utils._is_ephemeral(relation, 'unpivot') -%}\n {%- set cols = adapter.get_columns_in_relation(relation) %}\n\n {%- for col in cols -%}\n {%- if col.column.lower() not in remove|map('lower') and col.column.lower() not in exclude|map('lower') -%}\n {% do include_cols.append(col) %}\n {%- endif %}\n {%- endfor %}\n\n\n {%- for col in include_cols -%}\n {%- set current_col_name = adapter.quote(col.column) if quote_identifiers else col.column -%}\n select\n {%- for exclude_col in exclude %}\n {{ adapter.quote(exclude_col) if quote_identifiers else exclude_col }},\n {%- endfor %}\n\n cast('{{ col.column }}' as {{ dbt.type_string() }}) as {{ adapter.quote(field_name) if quote_identifiers else field_name }},\n cast( {% if col.data_type == 'boolean' %}\n {{ dbt.cast_bool_to_text(current_col_name) }}\n {% else %}\n {{ current_col_name }}\n {% endif %}\n as {{ cast_to }}) as {{ adapter.quote(value_name) if quote_identifiers else value_name }}\n\n from {{ relation }}\n\n {% if not loop.last -%}\n union all\n {% endif -%}\n {%- endfor -%}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_utils._is_relation", "macro.dbt_utils._is_ephemeral", "macro.dbt.type_string", "macro.dbt.cast_bool_to_text"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "cast_to", "type": null, "description": ""}, {"name": "exclude", "type": null, "description": ""}, {"name": "remove", "type": null, "description": ""}, {"name": "field_name", "type": null, "description": ""}, {"name": "value_name", "type": null, "description": ""}, {"name": "quote_identifiers", "type": null, "description": ""}], "created_at": 1789079002.5948963, "supported_languages": null}, "macro.dbt_utils.nullcheck": {"name": "nullcheck", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/nullcheck.sql", "original_file_path": "macros/sql/nullcheck.sql", "unique_id": "macro.dbt_utils.nullcheck", "macro_sql": "{% macro nullcheck(cols) %}\n {{ return(adapter.dispatch('nullcheck', 'dbt_utils')(cols)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__nullcheck"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "cols", "type": null, "description": ""}], "created_at": 1789079002.5952697, "supported_languages": null}, "macro.dbt_utils.default__nullcheck": {"name": "default__nullcheck", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/nullcheck.sql", "original_file_path": "macros/sql/nullcheck.sql", "unique_id": "macro.dbt_utils.default__nullcheck", "macro_sql": "{% macro default__nullcheck(cols) %}\n{%- for col in cols %}\n\n {% if col.is_string() -%}\n\n nullif({{col.name}},'') as {{col.name}}\n\n {%- else -%}\n\n {{col.name}}\n\n {%- endif -%}\n\n{%- if not loop.last -%} , {%- endif -%}\n\n{%- endfor -%}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "cols", "type": null, "description": ""}], "created_at": 1789079002.5956466, "supported_languages": null}, "macro.dbt_utils.get_intervals_between": {"name": "get_intervals_between", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/date_spine.sql", "original_file_path": "macros/sql/date_spine.sql", "unique_id": "macro.dbt_utils.get_intervals_between", "macro_sql": "{% macro get_intervals_between(start_date, end_date, datepart) -%}\n {{ return(adapter.dispatch('get_intervals_between', 'dbt_utils')(start_date, end_date, datepart)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__get_intervals_between"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "start_date", "type": null, "description": ""}, {"name": "end_date", "type": null, "description": ""}, {"name": "datepart", "type": null, "description": ""}], "created_at": 1789079002.5961967, "supported_languages": null}, "macro.dbt_utils.default__get_intervals_between": {"name": "default__get_intervals_between", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/date_spine.sql", "original_file_path": "macros/sql/date_spine.sql", "unique_id": "macro.dbt_utils.default__get_intervals_between", "macro_sql": "{% macro default__get_intervals_between(start_date, end_date, datepart) -%}\n {%- call statement('get_intervals_between', fetch_result=True) %}\n\n select {{ dbt.datediff(start_date, end_date, datepart) }}\n\n {%- endcall -%}\n\n {%- set value_list = load_result('get_intervals_between') -%}\n\n {%- if value_list and value_list['data'] -%}\n {%- set values = value_list['data'] | map(attribute=0) | list %}\n {{ return(values[0]) }}\n {%- else -%}\n {{ return(1) }}\n {%- endif -%}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.statement", "macro.dbt.datediff"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "start_date", "type": null, "description": ""}, {"name": "end_date", "type": null, "description": ""}, {"name": "datepart", "type": null, "description": ""}], "created_at": 1789079002.596843, "supported_languages": null}, "macro.dbt_utils.date_spine": {"name": "date_spine", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/date_spine.sql", "original_file_path": "macros/sql/date_spine.sql", "unique_id": "macro.dbt_utils.date_spine", "macro_sql": "{% macro date_spine(datepart, start_date, end_date) %}\n {{ return(adapter.dispatch('date_spine', 'dbt_utils')(datepart, start_date, end_date)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__date_spine"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "datepart", "type": null, "description": ""}, {"name": "start_date", "type": null, "description": ""}, {"name": "end_date", "type": null, "description": ""}], "created_at": 1789079002.5971134, "supported_languages": null}, "macro.dbt_utils.default__date_spine": {"name": "default__date_spine", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/date_spine.sql", "original_file_path": "macros/sql/date_spine.sql", "unique_id": "macro.dbt_utils.default__date_spine", "macro_sql": "{% macro default__date_spine(datepart, start_date, end_date) %}\n\n\n{# call as follows:\n\ndate_spine(\n \"day\",\n \"to_date('01/01/2016', 'mm/dd/yyyy')\",\n \"dbt.dateadd(week, 1, current_date)\"\n) #}\n\n\nwith rawdata as (\n\n {{dbt_utils.generate_series(\n dbt_utils.get_intervals_between(start_date, end_date, datepart)\n )}}\n\n),\n\nall_periods as (\n\n select (\n {{\n dbt.dateadd(\n datepart,\n \"row_number() over (order by generated_number) - 1\",\n start_date\n )\n }}\n ) as date_{{datepart}}\n from rawdata\n\n),\n\nfiltered as (\n\n select *\n from all_periods\n where date_{{datepart}} <= {{ end_date }}\n\n)\n\nselect * from filtered\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.generate_series", "macro.dbt_utils.get_intervals_between", "macro.dbt.dateadd"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "datepart", "type": null, "description": ""}, {"name": "start_date", "type": null, "description": ""}, {"name": "end_date", "type": null, "description": ""}], "created_at": 1789079002.597508, "supported_languages": null}, "macro.dbt_utils.get_filtered_columns_in_relation": {"name": "get_filtered_columns_in_relation", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_filtered_columns_in_relation.sql", "original_file_path": "macros/sql/get_filtered_columns_in_relation.sql", "unique_id": "macro.dbt_utils.get_filtered_columns_in_relation", "macro_sql": "{% macro get_filtered_columns_in_relation(from, except=[]) -%}\n {{ return(adapter.dispatch('get_filtered_columns_in_relation', 'dbt_utils')(from, except)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__get_filtered_columns_in_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "from", "type": null, "description": ""}, {"name": "except", "type": null, "description": ""}], "created_at": 1789079002.5979629, "supported_languages": null}, "macro.dbt_utils.default__get_filtered_columns_in_relation": {"name": "default__get_filtered_columns_in_relation", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_filtered_columns_in_relation.sql", "original_file_path": "macros/sql/get_filtered_columns_in_relation.sql", "unique_id": "macro.dbt_utils.default__get_filtered_columns_in_relation", "macro_sql": "{% macro default__get_filtered_columns_in_relation(from, except=[]) -%}\n {%- do dbt_utils._is_relation(from, 'get_filtered_columns_in_relation') -%}\n {%- do dbt_utils._is_ephemeral(from, 'get_filtered_columns_in_relation') -%}\n\n {# -- Prevent querying of db in parsing mode. This works because this macro does not create any new refs. #}\n {%- if not execute -%}\n {{ return([]) }}\n {% endif %}\n\n {%- set include_cols = [] %}\n {%- set cols = adapter.get_columns_in_relation(from) -%}\n {%- set except = except | map(\"lower\") | list %}\n {%- for col in cols -%}\n {%- if col.column|lower not in except -%}\n {% do include_cols.append(col.column) %}\n {%- endif %}\n {%- endfor %}\n\n {{ return(include_cols) }}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_utils._is_relation", "macro.dbt_utils._is_ephemeral"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "from", "type": null, "description": ""}, {"name": "except", "type": null, "description": ""}], "created_at": 1789079002.5987585, "supported_languages": null}, "macro.dbt_utils.surrogate_key": {"name": "surrogate_key", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/surrogate_key.sql", "original_file_path": "macros/sql/surrogate_key.sql", "unique_id": "macro.dbt_utils.surrogate_key", "macro_sql": "{%- macro surrogate_key(field_list) -%}\n {% set frustrating_jinja_feature = varargs %}\n {{ return(adapter.dispatch('surrogate_key', 'dbt_utils')(field_list, *varargs)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__surrogate_key"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field_list", "type": null, "description": ""}], "created_at": 1789079002.599153, "supported_languages": null}, "macro.dbt_utils.default__surrogate_key": {"name": "default__surrogate_key", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/surrogate_key.sql", "original_file_path": "macros/sql/surrogate_key.sql", "unique_id": "macro.dbt_utils.default__surrogate_key", "macro_sql": "\n\n{%- macro default__surrogate_key(field_list) -%}\n\n{%- set error_message = '\nWarning: `dbt_utils.surrogate_key` has been replaced by \\\n`dbt_utils.generate_surrogate_key`. The new macro treats null values \\\ndifferently to empty strings. To restore the behaviour of the original \\\nmacro, add a global variable in dbt_project.yml called \\\n`surrogate_key_treat_nulls_as_empty_strings` to your \\\ndbt_project.yml file with a value of True. \\\nThe {}.{} model triggered this warning. \\\n'.format(model.package_name, model.name) -%}\n\n{%- do exceptions.raise_compiler_error(error_message) -%}\n\n{%- endmacro -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field_list", "type": null, "description": ""}], "created_at": 1789079002.5994153, "supported_languages": null}, "macro.dbt_utils.get_single_value": {"name": "get_single_value", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_single_value.sql", "original_file_path": "macros/sql/get_single_value.sql", "unique_id": "macro.dbt_utils.get_single_value", "macro_sql": "{% macro get_single_value(query, default=none) %}\n {{ return(adapter.dispatch('get_single_value', 'dbt_utils')(query, default)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__get_single_value"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "query", "type": null, "description": ""}, {"name": "default", "type": null, "description": ""}], "created_at": 1789079002.599868, "supported_languages": null}, "macro.dbt_utils.default__get_single_value": {"name": "default__get_single_value", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_single_value.sql", "original_file_path": "macros/sql/get_single_value.sql", "unique_id": "macro.dbt_utils.default__get_single_value", "macro_sql": "{% macro default__get_single_value(query, default) %}\n\n{# This macro returns the (0, 0) record in a query, i.e. the first row of the first column #}\n\n {%- call statement('get_query_result', fetch_result=True, auto_begin=false) -%}\n\n {{ query }}\n\n {%- endcall -%}\n\n {%- if execute -%}\n\n {% set r = load_result('get_query_result').table.columns[0].values() %}\n {% if r | length == 0 %}\n {% do print('Query `' ~ query ~ '` returned no rows. Using the default value: ' ~ default) %}\n {% set sql_result = default %}\n {% else %}\n {% set sql_result = r[0] %}\n {% endif %}\n \n {%- else -%}\n \n {% set sql_result = default %}\n \n {%- endif -%}\n\n {% do return(sql_result) %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "query", "type": null, "description": ""}, {"name": "default", "type": null, "description": ""}], "created_at": 1789079002.6007543, "supported_languages": null}, "macro.dbt_utils.width_bucket": {"name": "width_bucket", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/width_bucket.sql", "original_file_path": "macros/sql/width_bucket.sql", "unique_id": "macro.dbt_utils.width_bucket", "macro_sql": "{% macro width_bucket(expr, min_value, max_value, num_buckets) %}\n {{ return(adapter.dispatch('width_bucket', 'dbt_utils') (expr, min_value, max_value, num_buckets)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__width_bucket"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "expr", "type": null, "description": ""}, {"name": "min_value", "type": null, "description": ""}, {"name": "max_value", "type": null, "description": ""}, {"name": "num_buckets", "type": null, "description": ""}], "created_at": 1789079002.6012616, "supported_languages": null}, "macro.dbt_utils.default__width_bucket": {"name": "default__width_bucket", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/width_bucket.sql", "original_file_path": "macros/sql/width_bucket.sql", "unique_id": "macro.dbt_utils.default__width_bucket", "macro_sql": "{% macro default__width_bucket(expr, min_value, max_value, num_buckets) -%}\n\n {% set bin_size -%}\n (( {{ max_value }} - {{ min_value }} ) / {{ num_buckets }} )\n {%- endset %}\n (\n -- to break ties when the amount is eaxtly at the bucket egde\n case\n when\n mod(\n {{ dbt.safe_cast(expr, dbt.type_numeric() ) }},\n {{ dbt.safe_cast(bin_size, dbt.type_numeric() ) }}\n ) = 0\n then 1\n else 0\n end\n ) +\n -- Anything over max_value goes the N+1 bucket\n least(\n ceil(\n ({{ expr }} - {{ min_value }})/{{ bin_size }}\n ),\n {{ num_buckets }} + 1\n )\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.safe_cast", "macro.dbt.type_numeric"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "expr", "type": null, "description": ""}, {"name": "min_value", "type": null, "description": ""}, {"name": "max_value", "type": null, "description": ""}, {"name": "num_buckets", "type": null, "description": ""}], "created_at": 1789079002.6017702, "supported_languages": null}, "macro.dbt_utils.snowflake__width_bucket": {"name": "snowflake__width_bucket", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/width_bucket.sql", "original_file_path": "macros/sql/width_bucket.sql", "unique_id": "macro.dbt_utils.snowflake__width_bucket", "macro_sql": "{% macro snowflake__width_bucket(expr, min_value, max_value, num_buckets) %}\n width_bucket({{ expr }}, {{ min_value }}, {{ max_value }}, {{ num_buckets }} )\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "expr", "type": null, "description": ""}, {"name": "min_value", "type": null, "description": ""}, {"name": "max_value", "type": null, "description": ""}, {"name": "num_buckets", "type": null, "description": ""}], "created_at": 1789079002.6020038, "supported_languages": null}, "macro.dbt_utils.get_relations_by_prefix": {"name": "get_relations_by_prefix", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_relations_by_prefix.sql", "original_file_path": "macros/sql/get_relations_by_prefix.sql", "unique_id": "macro.dbt_utils.get_relations_by_prefix", "macro_sql": "{% macro get_relations_by_prefix(schema, prefix, exclude='', database=target.database) %}\n {{ return(adapter.dispatch('get_relations_by_prefix', 'dbt_utils')(schema, prefix, exclude, database)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__get_relations_by_prefix"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "schema", "type": null, "description": ""}, {"name": "prefix", "type": null, "description": ""}, {"name": "exclude", "type": null, "description": ""}, {"name": "database", "type": null, "description": ""}], "created_at": 1789079002.602514, "supported_languages": null}, "macro.dbt_utils.default__get_relations_by_prefix": {"name": "default__get_relations_by_prefix", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_relations_by_prefix.sql", "original_file_path": "macros/sql/get_relations_by_prefix.sql", "unique_id": "macro.dbt_utils.default__get_relations_by_prefix", "macro_sql": "{% macro default__get_relations_by_prefix(schema, prefix, exclude='', database=target.database) %}\n\n {%- call statement('get_tables', fetch_result=True) %}\n\n {{ dbt_utils.get_tables_by_prefix_sql(schema, prefix, exclude, database) }}\n\n {%- endcall -%}\n\n {%- set table_list = load_result('get_tables') -%}\n\n {%- if table_list and table_list['table'] -%}\n {%- set tbl_relations = [] -%}\n {%- for row in table_list['table'] -%}\n {%- set tbl_relation = api.Relation.create(\n database=database,\n schema=row.table_schema,\n identifier=row.table_name,\n type=row.table_type\n ) -%}\n {%- do tbl_relations.append(tbl_relation) -%}\n {%- endfor -%}\n\n {{ return(tbl_relations) }}\n {%- else -%}\n {{ return([]) }}\n {%- endif -%}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement", "macro.dbt_utils.get_tables_by_prefix_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "schema", "type": null, "description": ""}, {"name": "prefix", "type": null, "description": ""}, {"name": "exclude", "type": null, "description": ""}, {"name": "database", "type": null, "description": ""}], "created_at": 1789079002.6034594, "supported_languages": null}, "macro.dbt_utils.safe_divide": {"name": "safe_divide", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/safe_divide.sql", "original_file_path": "macros/sql/safe_divide.sql", "unique_id": "macro.dbt_utils.safe_divide", "macro_sql": "{% macro safe_divide(numerator, denominator) -%}\n {{ return(adapter.dispatch('safe_divide', 'dbt_utils')(numerator, denominator)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__safe_divide"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "numerator", "type": null, "description": ""}, {"name": "denominator", "type": null, "description": ""}], "created_at": 1789079002.6037753, "supported_languages": null}, "macro.dbt_utils.default__safe_divide": {"name": "default__safe_divide", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/safe_divide.sql", "original_file_path": "macros/sql/safe_divide.sql", "unique_id": "macro.dbt_utils.default__safe_divide", "macro_sql": "{% macro default__safe_divide(numerator, denominator) %}\n ( {{ numerator }} ) / nullif( ( {{ denominator }} ), 0)\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "numerator", "type": null, "description": ""}, {"name": "denominator", "type": null, "description": ""}], "created_at": 1789079002.6039474, "supported_languages": null}, "macro.dbt_utils.safe_add": {"name": "safe_add", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/safe_add.sql", "original_file_path": "macros/sql/safe_add.sql", "unique_id": "macro.dbt_utils.safe_add", "macro_sql": "{%- macro safe_add(field_list) -%}\n {{ return(adapter.dispatch('safe_add', 'dbt_utils')(field_list)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__safe_add"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field_list", "type": null, "description": ""}], "created_at": 1789079002.6043015, "supported_languages": null}, "macro.dbt_utils.default__safe_add": {"name": "default__safe_add", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/safe_add.sql", "original_file_path": "macros/sql/safe_add.sql", "unique_id": "macro.dbt_utils.default__safe_add", "macro_sql": "\n\n{%- macro default__safe_add(field_list) -%}\n\n{%- if field_list is not iterable or field_list is string or field_list is mapping -%}\n\n{%- set error_message = '\nWarning: the `safe_add` macro now takes a single list argument instead of \\\nstring arguments. The {}.{} model triggered this warning. \\\n'.format(model.package_name, model.name) -%}\n\n{%- do exceptions.warn(error_message) -%}\n\n{%- endif -%}\n\n{% set fields = [] %}\n\n{%- for field in field_list -%}\n\n {% do fields.append(\"coalesce(\" ~ field ~ \", 0)\") %}\n\n{%- endfor -%}\n\n{{ fields|join(' +\\n ') }}\n\n{%- endmacro -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field_list", "type": null, "description": ""}], "created_at": 1789079002.6049035, "supported_languages": null}, "macro.dbt_utils.group_by": {"name": "group_by", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/groupby.sql", "original_file_path": "macros/sql/groupby.sql", "unique_id": "macro.dbt_utils.group_by", "macro_sql": "{%- macro group_by(n) -%}\n {{ return(adapter.dispatch('group_by', 'dbt_utils')(n)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__group_by"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "n", "type": null, "description": ""}], "created_at": 1789079002.6052134, "supported_languages": null}, "macro.dbt_utils.default__group_by": {"name": "default__group_by", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/groupby.sql", "original_file_path": "macros/sql/groupby.sql", "unique_id": "macro.dbt_utils.default__group_by", "macro_sql": "\n\n{%- macro default__group_by(n) -%}\n\n group by {% for i in range(1, n + 1) -%}\n {{ i }}{{ ',' if not loop.last }} \n {%- endfor -%}\n\n{%- endmacro -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "n", "type": null, "description": ""}], "created_at": 1789079002.6055007, "supported_languages": null}, "macro.iterable.iterable_lookback": {"name": "iterable_lookback", "resource_type": "macro", "package_name": "iterable", "path": "macros/iterable_lookback.sql", "original_file_path": "macros/iterable_lookback.sql", "unique_id": "macro.iterable.iterable_lookback", "macro_sql": "{% macro iterable_lookback(from_date, datepart, interval, safety_date='2020-01-01') %}\n\n{{ adapter.dispatch('iterable_lookback', 'iterable') (from_date, datepart, interval, safety_date='2020-01-01') }}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.iterable.default__iterable_lookback"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "from_date", "type": null, "description": ""}, {"name": "datepart", "type": null, "description": ""}, {"name": "interval", "type": null, "description": ""}, {"name": "safety_date", "type": null, "description": ""}], "created_at": 1789079002.605946, "supported_languages": null}, "macro.iterable.default__iterable_lookback": {"name": "default__iterable_lookback", "resource_type": "macro", "package_name": "iterable", "path": "macros/iterable_lookback.sql", "original_file_path": "macros/iterable_lookback.sql", "unique_id": "macro.iterable.default__iterable_lookback", "macro_sql": "{% macro default__iterable_lookback(from_date, datepart, interval, safety_date='2020-01-01') %}\n\n {% set sql_statement %}\n select coalesce({{ from_date }}, {{ \"'\" ~ safety_date ~ \"'\" }})\n from {{ this }}\n {%- endset -%}\n\n {%- set result = dbt_utils.get_single_value(sql_statement) %}\n\n {{ dbt.dateadd(datepart=datepart, interval=-interval, from_date_or_timestamp=\"cast('\" ~ result ~ \"' as date)\") }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.get_single_value", "macro.dbt.dateadd"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "from_date", "type": null, "description": ""}, {"name": "datepart", "type": null, "description": ""}, {"name": "interval", "type": null, "description": ""}, {"name": "safety_date", "type": null, "description": ""}], "created_at": 1789079002.6065092, "supported_languages": null}, "macro.iterable.get_campaign_list_history_columns": {"name": "get_campaign_list_history_columns", "resource_type": "macro", "package_name": "iterable", "path": "macros/staging/get_campaign_list_history_columns.sql", "original_file_path": "macros/staging/get_campaign_list_history_columns.sql", "unique_id": "macro.iterable.get_campaign_list_history_columns", "macro_sql": "{% macro get_campaign_list_history_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"campaign_id\", \"datatype\": dbt.type_int()},\n {\"name\": \"list_id\", \"datatype\": dbt.type_int()},\n {\"name\": \"updated_at\", \"datatype\": dbt.type_timestamp()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.type_timestamp", "macro.dbt.type_int"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789079002.6071563, "supported_languages": null}, "macro.iterable.get_list_columns": {"name": "get_list_columns", "resource_type": "macro", "package_name": "iterable", "path": "macros/staging/get_list_columns.sql", "original_file_path": "macros/staging/get_list_columns.sql", "unique_id": "macro.iterable.get_list_columns", "macro_sql": "{% macro get_list_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_deleted\", \"datatype\": \"boolean\"},\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"created_at\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"id\", \"datatype\": dbt.type_int()},\n {\"name\": \"list_type\", \"datatype\": dbt.type_string()},\n {\"name\": \"description\", \"datatype\": dbt.type_string()},\n {\"name\": \"name\", \"datatype\": dbt.type_string()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.type_timestamp", "macro.dbt.type_int", "macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789079002.608066, "supported_languages": null}, "macro.iterable.get_campaign_history_columns": {"name": "get_campaign_history_columns", "resource_type": "macro", "package_name": "iterable", "path": "macros/staging/get_campaign_history_columns.sql", "original_file_path": "macros/staging/get_campaign_history_columns.sql", "unique_id": "macro.iterable.get_campaign_history_columns", "macro_sql": "{% macro get_campaign_history_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"campaign_state\", \"datatype\": dbt.type_string()},\n {\"name\": \"created_at\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"created_by_user_id\", \"datatype\": dbt.type_string()},\n {\"name\": \"updated_by_user_id\", \"datatype\": dbt.type_string()},\n {\"name\": \"ended_at\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"id\", \"datatype\": dbt.type_int()},\n {\"name\": \"name\", \"datatype\": dbt.type_string()},\n {\"name\": \"recurring_campaign_id\", \"datatype\": dbt.type_int()},\n {\"name\": \"send_size\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"start_at\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"template_id\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"type\", \"datatype\": dbt.type_string()},\n {\"name\": \"updated_at\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"workflow_id\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"message_medium\", \"datatype\": dbt.type_string()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.type_timestamp", "macro.dbt.type_string", "macro.dbt.type_int", "macro.dbt.type_numeric"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789079002.60978, "supported_languages": null}, "macro.iterable.get_event_columns": {"name": "get_event_columns", "resource_type": "macro", "package_name": "iterable", "path": "macros/staging/get_event_columns.sql", "original_file_path": "macros/staging/get_event_columns.sql", "unique_id": "macro.iterable.get_event_columns", "macro_sql": "{% macro get_event_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_id\", \"datatype\": dbt.type_string()},\n {\"name\": \"_fivetran_user_id\", \"datatype\": dbt.type_string()},\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"campaign_id\", \"datatype\": dbt.type_int()},\n {\"name\": \"content_id\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"created_at\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"email\", \"datatype\": dbt.type_string()},\n {\"name\": \"event_name\", \"datatype\": dbt.type_string()},\n {\"name\": \"message_bus_id\", \"datatype\": dbt.type_string()},\n {\"name\": \"message_id\", \"datatype\": dbt.type_string()},\n {\"name\": \"message_type_id\", \"datatype\": dbt.type_int()},\n {\"name\": \"recipient_state\", \"datatype\": dbt.type_string()},\n {\"name\": \"status\", \"datatype\": dbt.type_string()},\n {\"name\": \"unsub_source\", \"datatype\": dbt.type_string()},\n {\"name\": \"user_agent\", \"datatype\": dbt.type_string()},\n {\"name\": \"user_agent_device\", \"datatype\": dbt.type_string()},\n {\"name\": \"transactional_data\", \"datatype\": dbt.type_string()},\n {\"name\": \"additional_properties\", \"datatype\": dbt.type_string()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.type_string", "macro.dbt.type_timestamp", "macro.dbt.type_int", "macro.dbt.type_numeric"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789079002.6116905, "supported_languages": null}, "macro.iterable.get_event_extension_columns": {"name": "get_event_extension_columns", "resource_type": "macro", "package_name": "iterable", "path": "macros/staging/get_event_extension_columns.sql", "original_file_path": "macros/staging/get_event_extension_columns.sql", "unique_id": "macro.iterable.get_event_extension_columns", "macro_sql": "{% macro get_event_extension_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_id\", \"datatype\": dbt.type_string()},\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"app_already_running\", \"datatype\": \"boolean\"},\n {\"name\": \"badge\", \"datatype\": dbt.type_string()},\n {\"name\": \"catalog_collection_count\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"catalog_lookup_count\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"canonical_url_id\", \"datatype\": dbt.type_string()},\n {\"name\": \"content_available\", \"datatype\": \"boolean\"},\n {\"name\": \"content_id\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"device\", \"datatype\": dbt.type_string()},\n {\"name\": \"email_id\", \"datatype\": dbt.type_string()},\n {\"name\": \"email_subject\", \"datatype\": dbt.type_string()},\n {\"name\": \"experiment_id\", \"datatype\": dbt.type_string()},\n {\"name\": \"from_phone_number_id\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"from_smssender_id\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"link_id\", \"datatype\": dbt.type_string()},\n {\"name\": \"link_url\", \"datatype\": dbt.type_string()},\n {\"name\": \"locale\", \"datatype\": dbt.type_string()},\n {\"name\": \"payload\", \"datatype\": dbt.type_string()},\n {\"name\": \"platform_endpoint\", \"datatype\": dbt.type_string()},\n {\"name\": \"push_message\", \"datatype\": dbt.type_string()},\n {\"name\": \"region\", \"datatype\": dbt.type_string()},\n {\"name\": \"sms_message\", \"datatype\": dbt.type_string()},\n {\"name\": \"to_phone_number\", \"datatype\": dbt.type_string()},\n {\"name\": \"url\", \"datatype\": dbt.type_string()},\n {\"name\": \"workflow_id\", \"datatype\": dbt.type_string()},\n {\"name\": \"workflow_name\", \"datatype\": dbt.type_string()},\n {\"name\": \"city\", \"datatype\": dbt.type_string()},\n {\"name\": \"clicked_url\", \"datatype\": dbt.type_string()},\n {\"name\": \"country\", \"datatype\": dbt.type_string()},\n {\"name\": \"error_code\", \"datatype\": dbt.type_string()},\n {\"name\": \"expires_at\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"from_phone_number\", \"datatype\": dbt.type_string()},\n {\"name\": \"in_app_body\", \"datatype\": dbt.type_string()},\n {\"name\": \"is_sms_estimation\", \"datatype\": \"boolean\"},\n {\"name\": \"labels\", \"datatype\": dbt.type_string()},\n {\"name\": \"message_status\", \"datatype\": dbt.type_string()},\n {\"name\": \"mms_send_count\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"reason\", \"datatype\": dbt.type_string()},\n {\"name\": \"sms_send_count\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"_fivetran_user_id\", \"datatype\": dbt.type_string()}\n] %}\n\n{{ fivetran_utils.add_pass_through_columns(columns, var('iterable_event_extension_pass_through_columns')) }}\n\n{{ return(columns) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.type_string", "macro.dbt.type_timestamp", "macro.dbt.type_numeric", "macro.fivetran_utils.add_pass_through_columns"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789079002.615833, "supported_languages": null}, "macro.iterable.get_campaign_label_history_columns": {"name": "get_campaign_label_history_columns", "resource_type": "macro", "package_name": "iterable", "path": "macros/staging/get_campaign_label_history_columns.sql", "original_file_path": "macros/staging/get_campaign_label_history_columns.sql", "unique_id": "macro.iterable.get_campaign_label_history_columns", "macro_sql": "{% macro get_campaign_label_history_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"campaign_id\", \"datatype\": dbt.type_int()},\n {\"name\": \"label\", \"datatype\": dbt.type_string()},\n {\"name\": \"updated_at\", \"datatype\": dbt.type_timestamp()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.type_timestamp", "macro.dbt.type_int", "macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789079002.6164954, "supported_languages": null}, "macro.iterable.get_template_history_columns": {"name": "get_template_history_columns", "resource_type": "macro", "package_name": "iterable", "path": "macros/staging/get_template_history_columns.sql", "original_file_path": "macros/staging/get_template_history_columns.sql", "unique_id": "macro.iterable.get_template_history_columns", "macro_sql": "{% macro get_template_history_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"client_template_id\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"created_at\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"creator_user_id\", \"datatype\": dbt.type_string()},\n {\"name\": \"id\", \"datatype\": dbt.type_int()},\n {\"name\": \"message_type_id\", \"datatype\": dbt.type_int()},\n {\"name\": \"name\", \"datatype\": dbt.type_string()},\n {\"name\": \"template_type\", \"datatype\": dbt.type_string()},\n {\"name\": \"updated_at\", \"datatype\": dbt.type_timestamp()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.type_timestamp", "macro.dbt.type_numeric", "macro.dbt.type_string", "macro.dbt.type_int"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789079002.6175673, "supported_languages": null}, "macro.iterable.get_journey_columns": {"name": "get_journey_columns", "resource_type": "macro", "package_name": "iterable", "path": "macros/staging/get_journey_columns.sql", "original_file_path": "macros/staging/get_journey_columns.sql", "unique_id": "macro.iterable.get_journey_columns", "macro_sql": "{% macro get_journey_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_deleted\", \"datatype\": \"boolean\"},\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"created_at\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"creator_user_id\", \"datatype\": dbt.type_string()},\n {\"name\": \"description\", \"datatype\": dbt.type_string()},\n {\"name\": \"enabled\", \"datatype\": \"boolean\"},\n {\"name\": \"id\", \"datatype\": dbt.type_int()},\n {\"name\": \"is_archived\", \"datatype\": \"boolean\"},\n {\"name\": \"journey_type\", \"datatype\": dbt.type_string()},\n {\"name\": \"lifetime_limit\", \"datatype\": dbt.type_int()},\n {\"name\": \"name\", \"datatype\": dbt.type_string()},\n {\"name\": \"simultaneous_limit\", \"datatype\": dbt.type_int()},\n {\"name\": \"start_tile_id\", \"datatype\": dbt.type_int()},\n {\"name\": \"trigger_event_names\", \"datatype\": dbt.type_string()},\n {\"name\": \"updated_at\", \"datatype\": dbt.type_timestamp()}\n] %}\n\n{{ fivetran_utils.add_pass_through_columns(columns, var('iterable_journey_pass_through_columns')) }}\n\n{{ return(columns) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.type_timestamp", "macro.dbt.type_string", "macro.dbt.type_int", "macro.fivetran_utils.add_pass_through_columns"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789079002.6192496, "supported_languages": null}, "macro.iterable.get_list_user_columns": {"name": "get_list_user_columns", "resource_type": "macro", "package_name": "iterable", "path": "macros/staging/get_list_user_columns.sql", "original_file_path": "macros/staging/get_list_user_columns.sql", "unique_id": "macro.iterable.get_list_user_columns", "macro_sql": "{% macro get_list_user_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_id\", \"datatype\": dbt.type_string()},\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"index\", \"datatype\": dbt.type_int()},\n {\"name\": \"list_id\", \"datatype\": dbt.type_int()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.type_string", "macro.dbt.type_timestamp", "macro.dbt.type_int"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789079002.6198719, "supported_languages": null}, "macro.iterable.json_to_string": {"name": "json_to_string", "resource_type": "macro", "package_name": "iterable", "path": "macros/staging/json_to_string.sql", "original_file_path": "macros/staging/json_to_string.sql", "unique_id": "macro.iterable.json_to_string", "macro_sql": "{%- macro json_to_string(column, column_list) -%}\n {{ return(adapter.dispatch('json_to_string', 'iterable')(column, column_list)) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.iterable.default__json_to_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "column", "type": null, "description": ""}, {"name": "column_list", "type": null, "description": ""}], "created_at": 1789079002.6202912, "supported_languages": null}, "macro.iterable.default__json_to_string": {"name": "default__json_to_string", "resource_type": "macro", "package_name": "iterable", "path": "macros/staging/json_to_string.sql", "original_file_path": "macros/staging/json_to_string.sql", "unique_id": "macro.iterable.default__json_to_string", "macro_sql": "{%- macro default__json_to_string(column, column_list) -%}\n cast({{ column }} as {{ dbt.type_string() }})\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "column", "type": null, "description": ""}, {"name": "column_list", "type": null, "description": ""}], "created_at": 1789079002.620468, "supported_languages": null}, "macro.iterable.bigquery__json_to_string": {"name": "bigquery__json_to_string", "resource_type": "macro", "package_name": "iterable", "path": "macros/staging/json_to_string.sql", "original_file_path": "macros/staging/json_to_string.sql", "unique_id": "macro.iterable.bigquery__json_to_string", "macro_sql": "{%- macro bigquery__json_to_string(column, column_list) -%}\n {%- set columns = column_list -%}\n {%- set ns = namespace(column_type='string') -%}\n\n {%- for col in columns -%}\n {%- if col.name|lower == column|lower -%}\n {%- set ns.column_type = col.dtype|lower -%}\n {%- endif -%}\n {%- endfor -%}\n\n {%- if ns.column_type == 'json' -%}\n to_json_string({{ column }})\n {%- else -%}\n cast({{ column }} as {{ dbt.type_string() }})\n {%- endif -%}\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "column", "type": null, "description": ""}, {"name": "column_list", "type": null, "description": ""}], "created_at": 1789079002.6210716, "supported_languages": null}, "macro.iterable.get_user_unsubscribed_message_type_columns": {"name": "get_user_unsubscribed_message_type_columns", "resource_type": "macro", "package_name": "iterable", "path": "macros/staging/get_user_unsubscribed_message_type_columns.sql", "original_file_path": "macros/staging/get_user_unsubscribed_message_type_columns.sql", "unique_id": "macro.iterable.get_user_unsubscribed_message_type_columns", "macro_sql": "{% macro get_user_unsubscribed_message_type_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"_fivetran_id\", \"datatype\": dbt.type_string()},\n {\"name\": \"message_type_id\", \"datatype\": dbt.type_string()},\n {\"name\": \"email\", \"datatype\": dbt.type_string()},\n {\"name\": \"updated_at\", \"datatype\": dbt.type_timestamp()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.type_timestamp", "macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789079002.6217852, "supported_languages": null}, "macro.iterable.does_table_exist": {"name": "does_table_exist", "resource_type": "macro", "package_name": "iterable", "path": "macros/staging/does_table_exist.sql", "original_file_path": "macros/staging/does_table_exist.sql", "unique_id": "macro.iterable.does_table_exist", "macro_sql": "{%- macro does_table_exist(table_name) -%}\n {%- if execute -%} -- returns true when dbt is in execute mode\n {%- set ns = namespace(has_table=false) -%} -- declare boolean namespace and default value \n {%- for node in graph.sources.values() -%} -- grab sources from the dictionary of nodes \n -- call the database for the matching table\n {%- if node.name | lower == table_name | lower -%} \n {%- set source_relation = adapter.get_relation(\n database=node.database,\n schema=node.schema,\n identifier=node.identifier ) -%}\n {% endif %}\n {%- if source_relation == None -%} \n {{ return(False) }} -- return false if relation identified by the database.schema.identifier does not exist for the given table name\n {% endif %}\n {%- endfor -%}\n {{ return(True) }}\n {%- endif -%} \n{%- endmacro -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "table_name", "type": null, "description": ""}], "created_at": 1789079002.6226323, "supported_languages": null}, "macro.iterable.get_user_history_columns": {"name": "get_user_history_columns", "resource_type": "macro", "package_name": "iterable", "path": "macros/staging/get_user_history_columns.sql", "original_file_path": "macros/staging/get_user_history_columns.sql", "unique_id": "macro.iterable.get_user_history_columns", "macro_sql": "{% macro get_user_history_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_id\", \"datatype\": dbt.type_string()},\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"email\", \"datatype\": dbt.type_string()},\n {\"name\": \"email_list_ids\", \"datatype\": dbt.type_string()},\n {\"name\": \"first_name\", \"datatype\": dbt.type_string()},\n {\"name\": \"last_name\", \"datatype\": dbt.type_string()},\n {\"name\": \"phone_number\", \"datatype\": dbt.type_string()},\n {\"name\": \"signup_date\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"signup_source\", \"datatype\": dbt.type_string()},\n {\"name\": \"updated_at\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"user_id\", \"datatype\": dbt.type_string()},\n {\"name\": \"iterable_user_id\", \"datatype\": dbt.type_string()}\n\n] %}\n\n{{ fivetran_utils.add_pass_through_columns(columns, var('iterable_user_history_pass_through_columns')) }}\n\n{{ return(columns) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.type_string", "macro.dbt.type_timestamp", "macro.fivetran_utils.add_pass_through_columns"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789079002.62412, "supported_languages": null}, "macro.iterable.get_campaign_suppression_list_history_columns": {"name": "get_campaign_suppression_list_history_columns", "resource_type": "macro", "package_name": "iterable", "path": "macros/staging/get_campaign_suppression_list_history_columns.sql", "original_file_path": "macros/staging/get_campaign_suppression_list_history_columns.sql", "unique_id": "macro.iterable.get_campaign_suppression_list_history_columns", "macro_sql": "{% macro get_campaign_suppression_list_history_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"campaign_id\", \"datatype\": dbt.type_int()},\n {\"name\": \"suppressed_list_id\", \"datatype\": dbt.type_int()},\n {\"name\": \"updated_at\", \"datatype\": dbt.type_timestamp()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.type_timestamp", "macro.dbt.type_int"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789079002.6247473, "supported_languages": null}, "macro.iterable.get_user_unsubscribed_channel_columns": {"name": "get_user_unsubscribed_channel_columns", "resource_type": "macro", "package_name": "iterable", "path": "macros/staging/get_user_unsubscribed_channel_columns.sql", "original_file_path": "macros/staging/get_user_unsubscribed_channel_columns.sql", "unique_id": "macro.iterable.get_user_unsubscribed_channel_columns", "macro_sql": "{% macro get_user_unsubscribed_channel_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"_fivetran_id\", \"datatype\": dbt.type_string()},\n {\"name\": \"channel_id\", \"datatype\": dbt.type_int()},\n {\"name\": \"email\", \"datatype\": dbt.type_string()},\n {\"name\": \"updated_at\", \"datatype\": dbt.type_timestamp()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.type_timestamp", "macro.dbt.type_string", "macro.dbt.type_int"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789079002.6254733, "supported_languages": null}, "macro.iterable.get_message_type_columns": {"name": "get_message_type_columns", "resource_type": "macro", "package_name": "iterable", "path": "macros/staging/get_message_type_columns.sql", "original_file_path": "macros/staging/get_message_type_columns.sql", "unique_id": "macro.iterable.get_message_type_columns", "macro_sql": "{% macro get_message_type_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_deleted\", \"datatype\": \"boolean\"},\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"channel_id\", \"datatype\": dbt.type_int()},\n {\"name\": \"id\", \"datatype\": dbt.type_int()},\n {\"name\": \"name\", \"datatype\": dbt.type_string()},\n {\"name\": \"created_at\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"frequency_cap\", \"datatype\": dbt.type_string()},\n {\"name\": \"rate_limit_per_minute\", \"datatype\": dbt.type_string()},\n {\"name\": \"subscription_policy\", \"datatype\": dbt.type_string()},\n {\"name\": \"updated_at\", \"datatype\": dbt.type_timestamp()},\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.type_timestamp", "macro.dbt.type_int", "macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789079002.6267033, "supported_languages": null}, "macro.iterable.get_channel_columns": {"name": "get_channel_columns", "resource_type": "macro", "package_name": "iterable", "path": "macros/staging/get_channel_columns.sql", "original_file_path": "macros/staging/get_channel_columns.sql", "unique_id": "macro.iterable.get_channel_columns", "macro_sql": "{% macro get_channel_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_deleted\", \"datatype\": \"boolean\"},\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"channel_type\", \"datatype\": dbt.type_string()},\n {\"name\": \"id\", \"datatype\": dbt.type_int()},\n {\"name\": \"message_medium\", \"datatype\": dbt.type_string()},\n {\"name\": \"name\", \"datatype\": dbt.type_string()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.type_timestamp", "macro.dbt.type_string", "macro.dbt.type_int"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789079002.6275144, "supported_languages": null}, "macro.fivetran_utils.enabled_vars_one_true": {"name": "enabled_vars_one_true", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/enabled_vars_one_true.sql", "original_file_path": "macros/enabled_vars_one_true.sql", "unique_id": "macro.fivetran_utils.enabled_vars_one_true", "macro_sql": "{% macro enabled_vars_one_true(vars) %}\n\n{% for v in vars %}\n \n {% if var(v, False) == True %}\n {{ return(True) }}\n {% endif %}\n\n{% endfor %}\n\n{{ return(False) }}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "vars", "type": null, "description": ""}], "created_at": 1789079002.6279666, "supported_languages": null}, "macro.fivetran_utils.json_parse": {"name": "json_parse", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/json_parse.sql", "original_file_path": "macros/json_parse.sql", "unique_id": "macro.fivetran_utils.json_parse", "macro_sql": "{% macro json_parse(string, string_path) -%}\n\n{{ adapter.dispatch('json_parse', 'fivetran_utils') (string, string_path) }}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.postgres__json_parse"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "string", "type": null, "description": ""}, {"name": "string_path", "type": null, "description": ""}], "created_at": 1789079002.6286838, "supported_languages": null}, "macro.fivetran_utils.default__json_parse": {"name": "default__json_parse", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/json_parse.sql", "original_file_path": "macros/json_parse.sql", "unique_id": "macro.fivetran_utils.default__json_parse", "macro_sql": "{% macro default__json_parse(string, string_path) %}\n\n json_extract_path_text({{string}}, {%- for s in string_path -%}'{{ s }}'{%- if not loop.last -%},{%- endif -%}{%- endfor -%} )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "string", "type": null, "description": ""}, {"name": "string_path", "type": null, "description": ""}], "created_at": 1789079002.6289861, "supported_languages": null}, "macro.fivetran_utils.redshift__json_parse": {"name": "redshift__json_parse", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/json_parse.sql", "original_file_path": "macros/json_parse.sql", "unique_id": "macro.fivetran_utils.redshift__json_parse", "macro_sql": "{% macro redshift__json_parse(string, string_path) %}\n\n json_extract_path_text({{string}}, {%- for s in string_path -%}'{{ s }}'{%- if not loop.last -%},{%- endif -%}{%- endfor -%} )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "string", "type": null, "description": ""}, {"name": "string_path", "type": null, "description": ""}], "created_at": 1789079002.6292741, "supported_languages": null}, "macro.fivetran_utils.bigquery__json_parse": {"name": "bigquery__json_parse", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/json_parse.sql", "original_file_path": "macros/json_parse.sql", "unique_id": "macro.fivetran_utils.bigquery__json_parse", "macro_sql": "{% macro bigquery__json_parse(string, string_path) %}\n\n \n json_extract_scalar({{string}}, '$.{%- for s in string_path -%}{{ s }}{%- if not loop.last -%}.{%- endif -%}{%- endfor -%} ')\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "string", "type": null, "description": ""}, {"name": "string_path", "type": null, "description": ""}], "created_at": 1789079002.6295512, "supported_languages": null}, "macro.fivetran_utils.postgres__json_parse": {"name": "postgres__json_parse", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/json_parse.sql", "original_file_path": "macros/json_parse.sql", "unique_id": "macro.fivetran_utils.postgres__json_parse", "macro_sql": "{% macro postgres__json_parse(string, string_path) %}\n\n {{string}}::json #>> '{ {%- for s in string_path -%}{{ s }}{%- if not loop.last -%},{%- endif -%}{%- endfor -%} }'\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "string", "type": null, "description": ""}, {"name": "string_path", "type": null, "description": ""}], "created_at": 1789079002.6298263, "supported_languages": null}, "macro.fivetran_utils.snowflake__json_parse": {"name": "snowflake__json_parse", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/json_parse.sql", "original_file_path": "macros/json_parse.sql", "unique_id": "macro.fivetran_utils.snowflake__json_parse", "macro_sql": "{% macro snowflake__json_parse(string, string_path) %}\n\n parse_json( {{string}} ) {%- for s in string_path -%}{% if s is number %}[{{ s }}]{% else %}['{{ s }}']{% endif %}{%- endfor -%}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "string", "type": null, "description": ""}, {"name": "string_path", "type": null, "description": ""}], "created_at": 1789079002.630143, "supported_languages": null}, "macro.fivetran_utils.spark__json_parse": {"name": "spark__json_parse", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/json_parse.sql", "original_file_path": "macros/json_parse.sql", "unique_id": "macro.fivetran_utils.spark__json_parse", "macro_sql": "{% macro spark__json_parse(string, string_path) %}\n\n {{string}} : {%- for s in string_path -%}{% if s is number %}[{{ s }}]{% else %}['{{ s }}']{% endif %}{%- endfor -%}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "string", "type": null, "description": ""}, {"name": "string_path", "type": null, "description": ""}], "created_at": 1789079002.6304452, "supported_languages": null}, "macro.fivetran_utils.sqlserver__json_parse": {"name": "sqlserver__json_parse", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/json_parse.sql", "original_file_path": "macros/json_parse.sql", "unique_id": "macro.fivetran_utils.sqlserver__json_parse", "macro_sql": "{% macro sqlserver__json_parse(string, string_path) %}\n\n json_value({{string}}, '$.{%- for s in string_path -%}{{ s }}{%- if not loop.last -%}.{%- endif -%}{%- endfor -%} ')\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "string", "type": null, "description": ""}, {"name": "string_path", "type": null, "description": ""}], "created_at": 1789079002.630716, "supported_languages": null}, "macro.fivetran_utils.duckdb__json_parse": {"name": "duckdb__json_parse", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/json_parse.sql", "original_file_path": "macros/json_parse.sql", "unique_id": "macro.fivetran_utils.duckdb__json_parse", "macro_sql": "{% macro duckdb__json_parse(string, string_path) %}\n\n json_extract_string({{string}}, '${%- for s in string_path -%}{% if s is number %}[{{ s }}]{% else %}.{{ s }}{% endif %}{%- endfor -%}')\n \n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "string", "type": null, "description": ""}, {"name": "string_path", "type": null, "description": ""}], "created_at": 1789079002.6310365, "supported_languages": null}, "macro.fivetran_utils.union_relations_custom": {"name": "union_relations_custom", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/union_relations_custom.sql", "original_file_path": "macros/union_relations_custom.sql", "unique_id": "macro.fivetran_utils.union_relations_custom", "macro_sql": "{%- macro union_relations_custom(relations, aliases=none, column_override=none, include=[], exclude=[], source_column_name='_dbt_source_relation', where=none) -%}\n {{ return(adapter.dispatch('union_relations_custom', 'fivetran_utils')(relations, aliases, column_override, include, exclude, source_column_name, where)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.default__union_relations_custom"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relations", "type": null, "description": ""}, {"name": "aliases", "type": null, "description": ""}, {"name": "column_override", "type": null, "description": ""}, {"name": "include", "type": null, "description": ""}, {"name": "exclude", "type": null, "description": ""}, {"name": "source_column_name", "type": null, "description": ""}, {"name": "where", "type": null, "description": ""}], "created_at": 1789079002.6322722, "supported_languages": null}, "macro.fivetran_utils.default__union_relations_custom": {"name": "default__union_relations_custom", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/union_relations_custom.sql", "original_file_path": "macros/union_relations_custom.sql", "unique_id": "macro.fivetran_utils.default__union_relations_custom", "macro_sql": "\n\n{%- macro default__union_relations_custom(relations, aliases=none, column_override=none, include=[], exclude=[], source_column_name='_dbt_source_relation', where=none) -%}\n\n {%- if exclude and include -%}\n {{ exceptions.raise_compiler_error(\"Both an exclude and include list were provided to the `union` macro. Only one is allowed\") }}\n {%- endif -%}\n\n {#-- Prevent querying of db in parsing mode. This works because this macro does not create any new refs. -#}\n {%- if not execute %}\n {{ return('') }}\n {% endif -%}\n\n {%- set column_override = column_override if column_override is not none else {} -%}\n\n {%- set relation_columns = {} -%}\n {%- set column_superset = {} -%}\n {%- set all_excludes = [] -%}\n {%- set all_includes = [] -%}\n\n {%- if exclude -%}\n {%- for exc in exclude -%}\n {%- do all_excludes.append(exc | lower) -%}\n {%- endfor -%}\n {%- endif -%}\n\n {%- if include -%}\n {%- for inc in include -%}\n {%- do all_includes.append(inc | lower) -%}\n {%- endfor -%}\n {%- endif -%}\n\n {%- for relation in relations -%}\n\n {%- do relation_columns.update({relation: []}) -%}\n\n {%- do dbt_utils._is_relation(relation, 'union_relations_custom') -%}\n {%- do dbt_utils._is_ephemeral(relation, 'union_relations_custom') -%}\n {%- set cols = adapter.get_columns_in_relation(relation) -%}\n {%- for col in cols -%}\n\n {#- If an exclude list was provided and the column is in the list, do nothing -#}\n {%- if exclude and col.column | lower in all_excludes -%}\n\n {#- If an include list was provided and the column is not in the list, do nothing -#}\n {%- elif include and col.column | lower not in all_includes -%}\n\n {#- Otherwise add the column to the column superset -#}\n {%- else -%}\n\n {#- update the list of columns in this relation -#}\n {%- do relation_columns[relation].append(col.column) -%}\n\n {%- if col.column in column_superset -%}\n\n {%- set stored = column_superset[col.column] -%}\n {%- if col.is_string() and stored.is_string() and col.string_size() > stored.string_size() -%}\n\n {%- do column_superset.update({col.column: col}) -%}\n\n {%- endif %}\n\n {%- else -%}\n\n {%- do column_superset.update({col.column: col}) -%}\n\n {%- endif -%}\n\n {%- endif -%}\n\n {%- endfor -%}\n {%- endfor -%}\n\n {%- set ordered_column_names = column_superset.keys() -%}\n {%- set dbt_command = flags.WHICH -%}\n\n\n {% if dbt_command in ['run', 'build'] %}\n {% if (include | length > 0 or exclude | length > 0) and not column_superset.keys() %}\n {%- set relations_string -%}\n {%- for relation in relations -%}\n {{ relation.name }}\n {%- if not loop.last %}, {% endif -%}\n {%- endfor -%}\n {%- endset -%}\n\n {%- set error_message -%}\n There were no columns found to union for relations {{ relations_string }}\n {%- endset -%}\n\n {{ exceptions.raise_compiler_error(error_message) }}\n {%- endif -%}\n {%- endif -%}\n\n {%- for relation in relations %}\n\n (\n select\n\n {%- if source_column_name is not none %}\n {# dbt_utils union_relations includes the table in the source_relation. For Fivetran dbt package purposes the table should not be included in the source relation. #}\n cast({{ dbt.string_literal(relation.database ~ '.' ~ relation.schema) }} as {{ dbt.type_string() }}) as {{ source_column_name }},\n {%- endif %}\n\n {% for col_name in ordered_column_names -%}\n\n {%- set col = column_superset[col_name] %}\n {%- set col_type = column_override.get(col.column, col.data_type) %}\n {%- set col_name = adapter.quote(col_name) if col_name in relation_columns[relation] else 'null' %}\n cast({{ col_name }} as {{ col_type }}) as {{ col.quoted }} {% if not loop.last %},{% endif -%}\n\n {%- endfor %}\n \n {# This alias is a change from dbt_utils union_relations code. Avoids errors if the table is named a reserved keyword #}\n from {{ aliases[loop.index0] if aliases else relation }} as unioned_relation_{{ loop.index }}\n\n {% if where -%}\n where {{ where }}\n {%- endif %}\n )\n\n {% if not loop.last -%}\n union all\n {% endif -%}\n\n {%- endfor -%}\n\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt_utils._is_relation", "macro.dbt_utils._is_ephemeral", "macro.dbt.string_literal", "macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relations", "type": null, "description": ""}, {"name": "aliases", "type": null, "description": ""}, {"name": "column_override", "type": null, "description": ""}, {"name": "include", "type": null, "description": ""}, {"name": "exclude", "type": null, "description": ""}, {"name": "source_column_name", "type": null, "description": ""}, {"name": "where", "type": null, "description": ""}], "created_at": 1789079002.6362786, "supported_languages": null}, "macro.fivetran_utils.seed_data_helper": {"name": "seed_data_helper", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/seed_data_helper.sql", "original_file_path": "macros/seed_data_helper.sql", "unique_id": "macro.fivetran_utils.seed_data_helper", "macro_sql": "{% macro seed_data_helper(seed_name, warehouses) %}\n\n{% if target.type in warehouses %}\n {% for w in warehouses %}\n {% if target.type == w %}\n {{ return(ref(seed_name ~ \"_\" ~ w ~ \"\")) }}\n {% endif %}\n {% endfor %}\n{% else %}\n{{ return(ref(seed_name)) }}\n{% endif %}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "seed_name", "type": null, "description": ""}, {"name": "warehouses", "type": null, "description": ""}], "created_at": 1789079002.6369662, "supported_languages": null}, "macro.fivetran_utils.drop_schemas_automation": {"name": "drop_schemas_automation", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/drop_schemas_automation.sql", "original_file_path": "macros/drop_schemas_automation.sql", "unique_id": "macro.fivetran_utils.drop_schemas_automation", "macro_sql": "{% macro drop_schemas_automation(drop_target_schema=true) %}\n {{ return(adapter.dispatch('drop_schemas_automation', 'fivetran_utils')(drop_target_schema)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.default__drop_schemas_automation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "drop_target_schema", "type": null, "description": ""}], "created_at": 1789079002.6374838, "supported_languages": null}, "macro.fivetran_utils.default__drop_schemas_automation": {"name": "default__drop_schemas_automation", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/drop_schemas_automation.sql", "original_file_path": "macros/drop_schemas_automation.sql", "unique_id": "macro.fivetran_utils.default__drop_schemas_automation", "macro_sql": "{% macro default__drop_schemas_automation(drop_target_schema=true) %}\n\n{% set fetch_list_sql %}\n {% if target.type not in ('databricks', 'spark') %}\n select schema_name\n from \n {{ wrap_in_quotes(target.database) }}.INFORMATION_SCHEMA.SCHEMATA\n where lower(schema_name) like '{{ target.schema | lower }}{%- if not drop_target_schema -%}_{%- endif -%}%'\n {% else %}\n SHOW SCHEMAS LIKE '{{ target.schema }}{%- if not drop_target_schema -%}_{%- endif -%}*'\n {% endif %}\n{% endset %}\n\n{% set results = run_query(fetch_list_sql) %}\n\n{% if execute %}\n {% set results_list = results.columns[0].values() %}\n{% else %}\n {% set results_list = [] %}\n{% endif %}\n\n{% for schema_to_drop in results_list %}\n {% do adapter.drop_schema(api.Relation.create(database=target.database, schema=schema_to_drop)) %}\n {{ print('Schema ' ~ schema_to_drop ~ ' successfully dropped from the ' ~ target.database ~ ' database.\\n')}}\n{% endfor %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.wrap_in_quotes", "macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "drop_target_schema", "type": null, "description": ""}], "created_at": 1789079002.6386201, "supported_languages": null}, "macro.fivetran_utils.duckdb__drop_schemas_automation": {"name": "duckdb__drop_schemas_automation", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/drop_schemas_automation.sql", "original_file_path": "macros/drop_schemas_automation.sql", "unique_id": "macro.fivetran_utils.duckdb__drop_schemas_automation", "macro_sql": "{% macro duckdb__drop_schemas_automation(drop_target_schema=true) %}\n\n {{ print('Not dropping any schemas in DuckDB.\\n') }}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "drop_target_schema", "type": null, "description": ""}], "created_at": 1789079002.638801, "supported_languages": null}, "macro.fivetran_utils.ceiling": {"name": "ceiling", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/ceiling.sql", "original_file_path": "macros/ceiling.sql", "unique_id": "macro.fivetran_utils.ceiling", "macro_sql": "{% macro ceiling(num) -%}\n\n{{ adapter.dispatch('ceiling', 'fivetran_utils') (num) }}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.default__ceiling"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "num", "type": null, "description": ""}], "created_at": 1789079002.6391003, "supported_languages": null}, "macro.fivetran_utils.default__ceiling": {"name": "default__ceiling", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/ceiling.sql", "original_file_path": "macros/ceiling.sql", "unique_id": "macro.fivetran_utils.default__ceiling", "macro_sql": "{% macro default__ceiling(num) %}\n ceiling({{ num }})\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "num", "type": null, "description": ""}], "created_at": 1789079002.6392298, "supported_languages": null}, "macro.fivetran_utils.snowflake__ceiling": {"name": "snowflake__ceiling", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/ceiling.sql", "original_file_path": "macros/ceiling.sql", "unique_id": "macro.fivetran_utils.snowflake__ceiling", "macro_sql": "{% macro snowflake__ceiling(num) %}\n ceil({{ num }})\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "num", "type": null, "description": ""}], "created_at": 1789079002.6393535, "supported_languages": null}, "macro.fivetran_utils.fill_pass_through_columns": {"name": "fill_pass_through_columns", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/fill_pass_through_columns.sql", "original_file_path": "macros/fill_pass_through_columns.sql", "unique_id": "macro.fivetran_utils.fill_pass_through_columns", "macro_sql": "{% macro fill_pass_through_columns(pass_through_variable) %}\n\n{% if var(pass_through_variable) %}\n {% for field in var(pass_through_variable) %}\n {% if field is mapping %}\n {% if field.transform_sql %}\n , {{ field.transform_sql }} as {{ field.alias if field.alias else field.name }}\n {% else %}\n , {{ field.alias if field.alias else field.name }}\n {% endif %}\n {% else %}\n , {{ field }}\n {% endif %}\n {% endfor %}\n{% endif %}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "pass_through_variable", "type": null, "description": ""}], "created_at": 1789079002.64011, "supported_languages": null}, "macro.fivetran_utils.persist_pass_through_columns": {"name": "persist_pass_through_columns", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/persist_pass_through_columns.sql", "original_file_path": "macros/persist_pass_through_columns.sql", "unique_id": "macro.fivetran_utils.persist_pass_through_columns", "macro_sql": "{% macro persist_pass_through_columns(pass_through_variable, identifier=none, transform='') %}\n\n{% if var(pass_through_variable, none) %}\n {% for field in var(pass_through_variable) %}\n , {{ transform ~ '(' ~ (identifier ~ '.' if identifier else '') ~ (field.alias if field.alias else field.name) ~ ')' }} as {{ field.alias if field.alias else field.name }}\n {% endfor %}\n{% endif %}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "pass_through_variable", "type": null, "description": ""}, {"name": "identifier", "type": null, "description": ""}, {"name": "transform", "type": null, "description": ""}], "created_at": 1789079002.640789, "supported_languages": null}, "macro.fivetran_utils.try_cast": {"name": "try_cast", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/try_cast.sql", "original_file_path": "macros/try_cast.sql", "unique_id": "macro.fivetran_utils.try_cast", "macro_sql": "{% macro try_cast(field, type) %}\n {{ adapter.dispatch('try_cast', 'fivetran_utils') (field, type) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.postgres__try_cast"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field", "type": null, "description": ""}, {"name": "type", "type": null, "description": ""}], "created_at": 1789079002.641354, "supported_languages": null}, "macro.fivetran_utils.default__try_cast": {"name": "default__try_cast", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/try_cast.sql", "original_file_path": "macros/try_cast.sql", "unique_id": "macro.fivetran_utils.default__try_cast", "macro_sql": "{% macro default__try_cast(field, type) %}\n {# most databases don't support this function yet\n so we just need to use cast #}\n cast({{field}} as {{type}})\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field", "type": null, "description": ""}, {"name": "type", "type": null, "description": ""}], "created_at": 1789079002.6415267, "supported_languages": null}, "macro.fivetran_utils.redshift__try_cast": {"name": "redshift__try_cast", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/try_cast.sql", "original_file_path": "macros/try_cast.sql", "unique_id": "macro.fivetran_utils.redshift__try_cast", "macro_sql": "{% macro redshift__try_cast(field, type) %}\n{%- if type == 'numeric' -%}\n\n case\n when trim({{field}}) ~ '^(0|[1-9][0-9]*)$' then trim({{field}})\n else null\n end::{{type}}\n\n{% else %}\n {{ exceptions.raise_compiler_error(\n \"non-numeric datatypes are not currently supported\") }}\n\n{% endif %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field", "type": null, "description": ""}, {"name": "type", "type": null, "description": ""}], "created_at": 1789079002.641872, "supported_languages": null}, "macro.fivetran_utils.postgres__try_cast": {"name": "postgres__try_cast", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/try_cast.sql", "original_file_path": "macros/try_cast.sql", "unique_id": "macro.fivetran_utils.postgres__try_cast", "macro_sql": "{% macro postgres__try_cast(field, type) %}\n{%- if type == 'numeric' -%}\n\n case\n when replace(cast({{field}} as varchar),cast(' ' as varchar),cast('' as varchar)) ~ '^(0|[1-9][0-9]*)$' \n then replace(cast({{field}} as varchar),cast(' ' as varchar),cast('' as varchar))\n else null\n end::{{type}}\n\n{% else %}\n {{ exceptions.raise_compiler_error(\n \"non-numeric datatypes are not currently supported\") }}\n\n{% endif %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field", "type": null, "description": ""}, {"name": "type", "type": null, "description": ""}], "created_at": 1789079002.6422074, "supported_languages": null}, "macro.fivetran_utils.snowflake__try_cast": {"name": "snowflake__try_cast", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/try_cast.sql", "original_file_path": "macros/try_cast.sql", "unique_id": "macro.fivetran_utils.snowflake__try_cast", "macro_sql": "{% macro snowflake__try_cast(field, type) %}\n try_cast(cast({{field}} as varchar) as {{type}})\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field", "type": null, "description": ""}, {"name": "type", "type": null, "description": ""}], "created_at": 1789079002.6423724, "supported_languages": null}, "macro.fivetran_utils.bigquery__try_cast": {"name": "bigquery__try_cast", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/try_cast.sql", "original_file_path": "macros/try_cast.sql", "unique_id": "macro.fivetran_utils.bigquery__try_cast", "macro_sql": "{% macro bigquery__try_cast(field, type) %}\n safe_cast({{field}} as {{type}})\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field", "type": null, "description": ""}, {"name": "type", "type": null, "description": ""}], "created_at": 1789079002.642593, "supported_languages": null}, "macro.fivetran_utils.spark__try_cast": {"name": "spark__try_cast", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/try_cast.sql", "original_file_path": "macros/try_cast.sql", "unique_id": "macro.fivetran_utils.spark__try_cast", "macro_sql": "{% macro spark__try_cast(field, type) %}\n try_cast({{field}} as {{type}})\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field", "type": null, "description": ""}, {"name": "type", "type": null, "description": ""}], "created_at": 1789079002.642744, "supported_languages": null}, "macro.fivetran_utils.sqlserver__try_cast": {"name": "sqlserver__try_cast", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/try_cast.sql", "original_file_path": "macros/try_cast.sql", "unique_id": "macro.fivetran_utils.sqlserver__try_cast", "macro_sql": "{% macro sqlserver__try_cast(field, type) %}\n try_cast({{field}} as {{type}})\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field", "type": null, "description": ""}, {"name": "type", "type": null, "description": ""}], "created_at": 1789079002.6429071, "supported_languages": null}, "macro.fivetran_utils.fivetran_date_spine": {"name": "fivetran_date_spine", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/fivetran_date_spine.sql", "original_file_path": "macros/fivetran_date_spine.sql", "unique_id": "macro.fivetran_utils.fivetran_date_spine", "macro_sql": "{% macro fivetran_date_spine(datepart, start_date, end_date) -%}\n\n{{ return(adapter.dispatch('fivetran_date_spine', 'fivetran_utils') (datepart, start_date, end_date)) }}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.default__fivetran_date_spine"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "datepart", "type": null, "description": ""}, {"name": "start_date", "type": null, "description": ""}, {"name": "end_date", "type": null, "description": ""}], "created_at": 1789079002.6434743, "supported_languages": null}, "macro.fivetran_utils.default__fivetran_date_spine": {"name": "default__fivetran_date_spine", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/fivetran_date_spine.sql", "original_file_path": "macros/fivetran_date_spine.sql", "unique_id": "macro.fivetran_utils.default__fivetran_date_spine", "macro_sql": "{% macro default__fivetran_date_spine(datepart, start_date, end_date) %}\n\n {{ dbt_utils.date_spine(datepart, start_date, end_date) }}\n \n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.date_spine"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "datepart", "type": null, "description": ""}, {"name": "start_date", "type": null, "description": ""}, {"name": "end_date", "type": null, "description": ""}], "created_at": 1789079002.6436815, "supported_languages": null}, "macro.fivetran_utils.sqlserver__fivetran_date_spine": {"name": "sqlserver__fivetran_date_spine", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/fivetran_date_spine.sql", "original_file_path": "macros/fivetran_date_spine.sql", "unique_id": "macro.fivetran_utils.sqlserver__fivetran_date_spine", "macro_sql": "{% macro sqlserver__fivetran_date_spine(datepart, start_date, end_date) -%}\n\n {% set date_spine_query %}\n with\n\n l0 as (\n\n select c\n from (select 1 union all select 1) as d(c)\n\n ),\n l1 as (\n\n select\n 1 as c\n from l0 as a\n cross join l0 as b\n\n ),\n\n l2 as (\n\n select 1 as c\n from l1 as a\n cross join l1 as b\n ),\n\n l3 as (\n\n select 1 as c\n from l2 as a\n cross join l2 as b\n ),\n\n l4 as (\n\n select 1 as c\n from l3 as a\n cross join l3 as b\n ),\n\n l5 as (\n\n select 1 as c\n from l4 as a\n cross join l4 as b\n ),\n\n nums as (\n\n select row_number() over (order by (select null)) as rownum\n from l5\n ),\n\n rawdata as (\n\n select top ({{dbt.datediff(start_date, end_date, datepart)}}) rownum -1 as n\n from nums\n order by rownum\n ),\n\n all_periods as (\n\n select (\n {{\n dbt.dateadd(\n datepart,\n 'n',\n start_date\n )\n }}\n ) as date_{{datepart}}\n from rawdata\n ),\n\n filtered as (\n\n select *\n from all_periods\n where date_{{datepart}} <= {{ end_date }}\n\n )\n\n select * from filtered\n order by 1\n\n {% endset %}\n\n {% set results = run_query(date_spine_query) %}\n\n {% if execute %}\n\n {% set results_list = results.columns[0].values() %}\n \n {% else %}\n\n {% set results_list = [] %}\n\n {% endif %}\n\n {%- for date_field in results_list %}\n select cast('{{ date_field }}' as date) as date_{{datepart}} {{ 'union all ' if not loop.last else '' }}\n {% endfor -%}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.datediff", "macro.dbt.dateadd", "macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "datepart", "type": null, "description": ""}, {"name": "start_date", "type": null, "description": ""}, {"name": "end_date", "type": null, "description": ""}], "created_at": 1789079002.644612, "supported_languages": null}, "macro.fivetran_utils.partition_by_source_relation": {"name": "partition_by_source_relation", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/partition_by_source_relation.sql", "original_file_path": "macros/partition_by_source_relation.sql", "unique_id": "macro.fivetran_utils.partition_by_source_relation", "macro_sql": "{% macro partition_by_source_relation(package_name, has_other_partitions='yes', alias=None, package_prefix_union_variable=true) %}\n {{ return(adapter.dispatch('partition_by_source_relation', 'fivetran_utils')(package_name, has_other_partitions, alias, package_prefix_union_variable)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.default__partition_by_source_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "package_name", "type": null, "description": ""}, {"name": "has_other_partitions", "type": null, "description": ""}, {"name": "alias", "type": null, "description": ""}, {"name": "package_prefix_union_variable", "type": null, "description": ""}], "created_at": 1789079002.6451993, "supported_languages": null}, "macro.fivetran_utils.default__partition_by_source_relation": {"name": "default__partition_by_source_relation", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/partition_by_source_relation.sql", "original_file_path": "macros/partition_by_source_relation.sql", "unique_id": "macro.fivetran_utils.default__partition_by_source_relation", "macro_sql": "{% macro default__partition_by_source_relation(package_name, has_other_partitions='yes', alias=None, package_prefix_union_variable=true) -%}\n\n{%- if package_prefix_union_variable %}\n {%- set union_schemas_var = package_name ~ '_union_schemas' -%}\n {%- set union_databases_var = package_name ~ '_union_databases' -%}\n{%- else %}\n {%- set union_schemas_var = 'union_schemas' -%}\n {%- set union_databases_var = 'union_databases' -%}\n{%- endif -%}\n\n{%- set is_unioning = var(union_schemas_var, [])|length > 1 or var(union_databases_var, [])|length > 1 or var(package_name ~ '_sources', [])|length > 1 -%}\n{%- set prefix = '' if alias is none else alias ~ '.' -%}\n\n{%- if has_other_partitions == 'no' -%}\n {{- 'partition by ' ~ prefix ~ 'source_relation' if is_unioning else '' -}}\n{%- else -%}\n {{- ', ' ~ prefix ~ 'source_relation' if is_unioning else '' -}}\n{%- endif -%}\n\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "package_name", "type": null, "description": ""}, {"name": "has_other_partitions", "type": null, "description": ""}, {"name": "alias", "type": null, "description": ""}, {"name": "package_prefix_union_variable", "type": null, "description": ""}], "created_at": 1789079002.6461935, "supported_languages": null}, "macro.fivetran_utils.fill_staging_columns": {"name": "fill_staging_columns", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/fill_staging_columns.sql", "original_file_path": "macros/fill_staging_columns.sql", "unique_id": "macro.fivetran_utils.fill_staging_columns", "macro_sql": "{% macro fill_staging_columns(source_columns, staging_columns) %}\n\n{%- set source_column_names = source_columns|map(attribute='name')|map('lower')|list -%}\n{%- set using_source_casing = var('fivetran_using_source_casing', false) -%}\n\n{%- for column in staging_columns %}\n {%- if column.name|lower in source_column_names %}\n {%- if using_source_casing %}\n {%- set column_alias = column.alias if 'alias' in column else column.name %}\n {{ adapter.quote(column.name) }} as {{ adapter.quote(column_alias|upper if target.type == 'snowflake' else column_alias) }}\n {%- else %}\n {{ fivetran_utils.quote_column(column) }} as\n {%- if 'alias' in column %} {{ column.alias }}{% else %} {{ fivetran_utils.quote_column(column) }}{% endif %}\n {%- endif %}\n {%- else %}\n cast(null as {{ column.datatype }}) as\n {%- if 'alias' in column %} {{ column.alias }}{% else %} {{ fivetran_utils.quote_column(column) }}{% endif %}\n {%- endif %}{{ ',' if not loop.last }}\n{%- endfor %}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.quote_column"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "source_columns", "type": null, "description": ""}, {"name": "staging_columns", "type": null, "description": ""}], "created_at": 1789079002.6478019, "supported_languages": null}, "macro.fivetran_utils.quote_column": {"name": "quote_column", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/fill_staging_columns.sql", "original_file_path": "macros/fill_staging_columns.sql", "unique_id": "macro.fivetran_utils.quote_column", "macro_sql": "{% macro quote_column(column) %}\n {%- if 'quote' in column %}\n {%- if column.quote %}\n {%- if target.type in ('bigquery', 'spark', 'databricks') %}\n `{{ column.name }}`\n {%- elif target.type == 'snowflake' %}\n \"{{ column.name | upper }}\"\n {%- else %}\n \"{{ column.name }}\"\n {%- endif %}\n {%- else %}{{ column.name }}\n {%- endif %}\n {%- else %}{{ column.name }}\n {%- endif %}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "column", "type": null, "description": ""}], "created_at": 1789079002.648729, "supported_languages": null}, "macro.fivetran_utils.union_connections": {"name": "union_connections", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/union_connections.sql", "original_file_path": "macros/union_connections.sql", "unique_id": "macro.fivetran_utils.union_connections", "macro_sql": "{% macro union_connections(connection_dictionary, single_source_name, single_table_name, default_identifier=single_table_name) %}\n\n{{ adapter.dispatch('union_connections', 'fivetran_utils') (connection_dictionary, single_source_name, single_table_name, default_identifier) }}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.default__union_connections"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "connection_dictionary", "type": null, "description": ""}, {"name": "single_source_name", "type": null, "description": ""}, {"name": "single_table_name", "type": null, "description": ""}, {"name": "default_identifier", "type": null, "description": ""}], "created_at": 1789079002.6496115, "supported_languages": null}, "macro.fivetran_utils.default__union_connections": {"name": "default__union_connections", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/union_connections.sql", "original_file_path": "macros/union_connections.sql", "unique_id": "macro.fivetran_utils.default__union_connections", "macro_sql": "{% macro default__union_connections(connection_dictionary, single_source_name, single_table_name, default_identifier=single_table_name) %}\n\n{%- set exception_warning = \"\\n\\nPlease be aware: The \" ~ single_source_name|upper ~ \".\" ~ single_table_name|upper ~ \" table was not found in your schema(s). The Fivetran Data Model will create a completely empty staging model as to not break downstream transformations. To turn off these warnings, set the `fivetran__remove_empty_table_warnings` variable to TRUE (see https://github.com/fivetran/dbt_fivetran_utils/tree/releases/v0.4.latest#union_connections-source for details).\\n\"%}\n{%- set using_empty_table_warnings = (execute and not var('fivetran__remove_empty_table_warnings', false)) %}\n{%- set connections = var(connection_dictionary, []) %}\n{%- set using_unioning = connections | length > 0 %}\n{%- set identifier_var = single_source_name + \"_\" + single_table_name + \"_identifier\" %}\n\n{%- if using_unioning %}\n{# For unioning #}\n {%- set relations = [] -%}\n {%- for connection in connections -%}\n\n {% if var('has_defined_sources', false) %}\n {%- set database = source(connection.name, single_table_name).database %}\n {%- set schema = source(connection.name, single_table_name).schema %}\n {%- set identifier = source(connection.name, single_table_name).identifier %}\n {%- else %}\n {%- set database = connection.database if connection.database else target.database %}\n {%- set schema = connection.schema if connection.schema else single_source_name %}\n {%- set identifier = var(identifier_var, default_identifier) %}\n {%- endif %}\n \n {%- set relation=adapter.get_relation(\n database=database,\n schema=schema,\n identifier=identifier\n )\n -%}\n\n {%- if relation is not none -%}\n {%- do relations.append(relation) -%}\n {%- endif -%}\n\n -- ** Values passed to adapter.get_relation:\n {{ '-- database: ' ~ database }}\n {{ '-- schema: ' ~ schema }}\n {{ '-- identifier: ' ~ identifier ~ '\\n' }}\n\n {%- endfor -%}\n\n {%- if relations | length > 0 -%}\n {{ fivetran_utils.union_relations_custom(relations, source_column_name='_dbt_source_relation') }}\n\n {%- else -%}\n {{ exceptions.warn(exception_warning) if using_empty_table_warnings }}\n\n select\n cast(null as {{ dbt.type_string() }}) as _dbt_source_relation\n limit {{ '0' if target.type != 'redshift' else '1' }}\n {%- endif -%}\n\n{% else %}\n{# Not unioning #}\n\n {%- set database = source(single_source_name, single_table_name).database %}\n {%- set schema = source(single_source_name, single_table_name).schema %}\n {%- set identifier = var(identifier_var, default_identifier) %}\n\n {%- set relation=adapter.get_relation(\n database=database,\n schema=schema,\n identifier=identifier\n )\n -%}\n\n -- ** Values passed to adapter.get_relation:\n {{ '-- full-identifier_var: ' ~ identifier_var }}\n {{ '-- database: ' ~ database }} \n {{ '-- schema: ' ~ schema }}\n {{ '-- identifier: ' ~ identifier ~ '\\n' }}\n\n {% if relation is not none -%}\n select\n {{ dbt_utils.star(from=source(single_source_name, single_table_name)) }}\n from {{ source(single_source_name, single_table_name) }} as source_table\n\n {% else %}\n {{ exceptions.warn(exception_warning) if using_empty_table_warnings }}\n\n select\n cast(null as {{ dbt.type_string() }}) as _dbt_source_relation\n limit {{ '0' if target.type != 'redshift' else '1' }}\n {%- endif -%}\n{% endif -%}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.union_relations_custom", "macro.dbt.type_string", "macro.dbt_utils.star"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "connection_dictionary", "type": null, "description": ""}, {"name": "single_source_name", "type": null, "description": ""}, {"name": "single_table_name", "type": null, "description": ""}, {"name": "default_identifier", "type": null, "description": ""}], "created_at": 1789079002.6526597, "supported_languages": null}, "macro.fivetran_utils.source_relation": {"name": "source_relation", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/source_relation.sql", "original_file_path": "macros/source_relation.sql", "unique_id": "macro.fivetran_utils.source_relation", "macro_sql": "{% macro source_relation(union_schema_variable='union_schemas', union_database_variable='union_databases') -%}\n\n{{ adapter.dispatch('source_relation', 'fivetran_utils') (union_schema_variable, union_database_variable) }}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.default__source_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "union_schema_variable", "type": null, "description": ""}, {"name": "union_database_variable", "type": null, "description": ""}], "created_at": 1789079002.6531384, "supported_languages": null}, "macro.fivetran_utils.default__source_relation": {"name": "default__source_relation", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/source_relation.sql", "original_file_path": "macros/source_relation.sql", "unique_id": "macro.fivetran_utils.default__source_relation", "macro_sql": "{% macro default__source_relation(union_schema_variable, union_database_variable) %}\n\n{% if var(union_schema_variable, none) %}\n, case\n {% for schema in var(union_schema_variable) %}\n when lower(replace(replace(_dbt_source_relation,'\"',''),'`','')) like '%.{{ schema|lower }}.%' then '{{ schema|lower }}'\n {% endfor %}\n end as source_relation\n{% elif var(union_database_variable, none) %}\n, case\n {% for database in var(union_database_variable) %}\n when lower(replace(replace(_dbt_source_relation,'\"',''),'`','')) like '%{{ database|lower }}.%' then '{{ database|lower }}'\n {% endfor %}\n end as source_relation\n{% else %}\n, cast('' as {{ dbt.type_string() }}) as source_relation\n{% endif %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "union_schema_variable", "type": null, "description": ""}, {"name": "union_database_variable", "type": null, "description": ""}], "created_at": 1789079002.653778, "supported_languages": null}, "macro.fivetran_utils.apply_source_relation": {"name": "apply_source_relation", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/apply_source_relation.sql", "original_file_path": "macros/apply_source_relation.sql", "unique_id": "macro.fivetran_utils.apply_source_relation", "macro_sql": "{% macro apply_source_relation(package_name, use_package_prefix=true) -%}\n\n{{ adapter.dispatch('apply_source_relation', 'fivetran_utils') (package_name, use_package_prefix) }}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.default__apply_source_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "package_name", "type": null, "description": ""}, {"name": "use_package_prefix", "type": null, "description": ""}], "created_at": 1789079002.6542802, "supported_languages": null}, "macro.fivetran_utils.default__apply_source_relation": {"name": "default__apply_source_relation", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/apply_source_relation.sql", "original_file_path": "macros/apply_source_relation.sql", "unique_id": "macro.fivetran_utils.default__apply_source_relation", "macro_sql": "{% macro default__apply_source_relation(package_name, use_package_prefix=true) -%}\n\n{% set sources_var = package_name ~ '_sources' %}\n{% set database_var = package_name ~ '_database' %}\n{% set schema_var = package_name ~ '_schema' %}\n\n{% if use_package_prefix %}\n {% set union_schemas_var = package_name ~ '_union_schemas' %}\n {% set union_databases_var = package_name ~ '_union_databases' %}\n{% else %}\n {% set union_schemas_var = 'union_schemas' %}\n {% set union_databases_var = 'union_databases' %}\n{% endif %}\n\n{% if var(sources_var, []) | length > 0 %}\n, _dbt_source_relation as source_relation\n{% elif var(union_schemas_var, []) | length > 0 or var(union_databases_var, []) | length > 0 %}\n{{ fivetran_utils.source_relation(union_schema_variable=union_schemas_var, union_database_variable=union_databases_var) }}\n{% else %}\n{% set database = var(database_var, target.database) %}\n{% set schema = var(schema_var, package_name) %}\n, cast('{{ database ~ \".\" ~ schema }}' as {{ dbt.type_string() }}) as source_relation\n{% endif %}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.source_relation", "macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "package_name", "type": null, "description": ""}, {"name": "use_package_prefix", "type": null, "description": ""}], "created_at": 1789079002.655495, "supported_languages": null}, "macro.fivetran_utils.calculated_fields": {"name": "calculated_fields", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/calculated_fields.sql", "original_file_path": "macros/calculated_fields.sql", "unique_id": "macro.fivetran_utils.calculated_fields", "macro_sql": "{% macro calculated_fields(variable) -%}\n\n{% if var(variable, none) %}\n {% for field in var(variable) %}\n , {{ field.transform_sql }} as {{ field.name }} \n {% endfor %}\n{% endif %}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "variable", "type": null, "description": ""}], "created_at": 1789079002.6559367, "supported_languages": null}, "macro.fivetran_utils.union_data": {"name": "union_data", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/union_data.sql", "original_file_path": "macros/union_data.sql", "unique_id": "macro.fivetran_utils.union_data", "macro_sql": "{%- macro union_data(table_identifier, database_variable, schema_variable, default_database, default_schema, default_variable, union_schema_variable='union_schemas', union_database_variable='union_databases') -%}\n\n{{ adapter.dispatch('union_data', 'fivetran_utils') (\n table_identifier, \n database_variable, \n schema_variable, \n default_database, \n default_schema, \n default_variable,\n union_schema_variable,\n union_database_variable\n ) }}\n\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.fivetran_utils.default__union_data"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "table_identifier", "type": null, "description": ""}, {"name": "database_variable", "type": null, "description": ""}, {"name": "schema_variable", "type": null, "description": ""}, {"name": "default_database", "type": null, "description": ""}, {"name": "default_schema", "type": null, "description": ""}, {"name": "default_variable", "type": null, "description": ""}, {"name": "union_schema_variable", "type": null, "description": ""}, {"name": "union_database_variable", "type": null, "description": ""}], "created_at": 1789079002.6572013, "supported_languages": null}, "macro.fivetran_utils.default__union_data": {"name": "default__union_data", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/union_data.sql", "original_file_path": "macros/union_data.sql", "unique_id": "macro.fivetran_utils.default__union_data", "macro_sql": "{%- macro default__union_data(\n table_identifier, \n database_variable, \n schema_variable, \n default_database, \n default_schema, \n default_variable,\n union_schema_variable,\n union_database_variable\n ) -%}\n\n{%- if var(union_schema_variable, none) -%}\n\n {%- set relations = [] -%}\n \n {%- if var(union_schema_variable) is string -%}\n {%- set trimmed = var(union_schema_variable)|trim('[')|trim(']') -%}\n {%- set schemas = trimmed.split(',')|map('trim',\" \")|map('trim','\"')|map('trim',\"'\") -%}\n {%- else -%}\n {%- set schemas = var(union_schema_variable) -%}\n {%- endif -%}\n\n {%- for schema in var(union_schema_variable) -%}\n {%- set relation=adapter.get_relation(\n database=source(schema, table_identifier).database if var('has_defined_sources', false) else var(database_variable, default_database),\n schema=source(schema, table_identifier).schema if var('has_defined_sources', false) else schema,\n identifier=source(schema, table_identifier).identifier if var('has_defined_sources', false) else table_identifier\n ) -%}\n \n {%- set relation_exists=relation is not none -%}\n\n {%- if relation_exists -%}\n {%- do relations.append(relation) -%}\n {%- endif -%}\n\n {%- endfor -%}\n \n {%- if relations != [] -%}\n {{ dbt_utils.union_relations(relations) }}\n {%- else -%}\n {% if execute and not var('fivetran__remove_empty_table_warnings', false) -%}\n {{ exceptions.warn(\"\\n\\nPlease be aware: The \" ~ table_identifier|upper ~ \" table was not found in your \" ~ default_schema|upper ~ \" schema(s). The Fivetran dbt package will create a completely empty \" ~ table_identifier|upper ~ \" staging model as to not break downstream transformations. To turn off these warnings, set the `fivetran__remove_empty_table_warnings` variable to TRUE (see https://github.com/fivetran/dbt_fivetran_utils/tree/releases/v0.4.latest#union_data-source for details).\\n\") }}\n {% endif -%}\n select \n cast(null as {{ dbt.type_string() }}) as _dbt_source_relation\n limit 0\n {%- endif -%}\n\n{%- elif var(union_database_variable, none) -%}\n\n {%- set relations = [] -%}\n\n {%- for database in var(union_database_variable) -%}\n {%- set relation=adapter.get_relation(\n database=source(schema, table_identifier).database if var('has_defined_sources', false) else database,\n schema=source(schema, table_identifier).schema if var('has_defined_sources', false) else var(schema_variable, default_schema),\n identifier=source(schema, table_identifier).identifier if var('has_defined_sources', false) else table_identifier\n ) -%}\n\n {%- set relation_exists=relation is not none -%}\n\n {%- if relation_exists -%}\n {%- do relations.append(relation) -%}\n {%- endif -%}\n\n {%- endfor -%}\n\n {%- if relations != [] -%}\n {{ dbt_utils.union_relations(relations) }}\n {%- else -%}\n {% if execute and not var('fivetran__remove_empty_table_warnings', false) -%}\n {{ exceptions.warn(\"\\n\\nPlease be aware: The \" ~ table_identifier|upper ~ \" table was not found in your \" ~ default_schema|upper ~ \" schema(s). The Fivetran dbt package will create a completely empty \" ~ table_identifier|upper ~ \" staging model as to not break downstream transformations. To turn off these warnings, set the `fivetran__remove_empty_table_warnings` variable to TRUE (see https://github.com/fivetran/dbt_fivetran_utils/tree/releases/v0.4.latest#union_data-source for details).\\n\") }}\n {% endif -%}\n select \n cast(null as {{ dbt.type_string() }}) as _dbt_source_relation\n limit 0\n {%- endif -%}\n\n{%- else -%}\n {% set exception_schemas = {\"linkedin_company_pages\": \"linkedin_pages\", \"instagram_business_pages\": \"instagram_business\"} %}\n {% set relation = namespace(value=\"\") %}\n {% if default_schema in exception_schemas.keys() %}\n {% for corrected_schema_name in exception_schemas.items() %} \n {% if default_schema in corrected_schema_name %}\n {# In order for this macro to effectively work within upstream integration tests (mainly used by the Fivetran dbt package maintainers), this identifier variable selection is required to use the macro with different identifier names. #}\n {% set identifier_var = corrected_schema_name[1] + \"_\" + table_identifier + \"_identifier\" %}\n {%- set relation.value=adapter.get_relation(\n database=source(corrected_schema_name[1], table_identifier).database,\n schema=source(corrected_schema_name[1], table_identifier).schema,\n identifier=var(identifier_var, table_identifier)\n ) -%}\n {% endif %}\n {% endfor %}\n {% else %}\n {# In order for this macro to effectively work within upstream integration tests (mainly used by the Fivetran dbt package maintainers), this identifier variable selection is required to use the macro with different identifier names. #}\n {% set identifier_var = default_schema + \"_\" + table_identifier + \"_identifier\" %}\n {# Unfortunately the Twitter Organic identifiers were misspelled. As such, we will need to account for this in the model. This will be adjusted in the Twitter Organic package, but to ensure backwards compatibility, this needs to be included. #}\n {% if var(identifier_var, none) is none %} \n {% set identifier_var = default_schema + \"_\" + table_identifier + \"_identifer\" %}\n {% endif %}\n {%- set relation.value=adapter.get_relation(\n database=source(default_schema, table_identifier).database,\n schema=source(default_schema, table_identifier).schema,\n identifier=var(identifier_var, table_identifier)\n ) -%}\n {% endif %}\n{%- set table_exists=relation.value is not none -%}\n\n{%- if table_exists -%}\n select * \n from {{ relation.value }}\n{%- else -%}\n {% if execute and not var('fivetran__remove_empty_table_warnings', false) -%}\n {{ exceptions.warn(\"\\n\\nPlease be aware: The \" ~ table_identifier|upper ~ \" table was not found in your \" ~ default_schema|upper ~ \" schema(s). The Fivetran dbt package will create a completely empty \" ~ table_identifier|upper ~ \" staging model as to not break downstream transformations. To turn off these warnings, set the `fivetran__remove_empty_table_warnings` variable to TRUE (see https://github.com/fivetran/dbt_fivetran_utils/tree/releases/v0.4.latest#union_data-source for details).\\n\") }}\n {% endif -%}\n select \n cast(null as {{ dbt.type_string() }}) as _dbt_source_relation\n limit 0\n{%- endif -%}\n{%- endif -%}\n\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt_utils.union_relations", "macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "table_identifier", "type": null, "description": ""}, {"name": "database_variable", "type": null, "description": ""}, {"name": "schema_variable", "type": null, "description": ""}, {"name": "default_database", "type": null, "description": ""}, {"name": "default_schema", "type": null, "description": ""}, {"name": "default_variable", "type": null, "description": ""}, {"name": "union_schema_variable", "type": null, "description": ""}, {"name": "union_database_variable", "type": null, "description": ""}], "created_at": 1789079002.6621914, "supported_languages": null}, "macro.fivetran_utils.pivot_json_extract": {"name": "pivot_json_extract", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/pivot_json_extract.sql", "original_file_path": "macros/pivot_json_extract.sql", "unique_id": "macro.fivetran_utils.pivot_json_extract", "macro_sql": "{% macro pivot_json_extract(string, list_of_properties) %}\n\n{%- for property in list_of_properties -%}\n{%- if property is mapping -%}\nreplace( {{ fivetran_utils.json_extract(string, property.name) }}, '\"', '') as {{ property.alias if property.alias else property.name | replace(' ', '_') | replace('.', '_') | lower }}\n\n{%- else -%}\nreplace( {{ fivetran_utils.json_extract(string, property) }}, '\"', '') as {{ property | replace(' ', '_') | lower }}\n\n{%- endif -%}\n{%- if not loop.last -%},{%- endif %}\n{% endfor -%}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.json_extract"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "string", "type": null, "description": ""}, {"name": "list_of_properties", "type": null, "description": ""}], "created_at": 1789079002.6630838, "supported_languages": null}, "macro.fivetran_utils.add_dbt_source_relation": {"name": "add_dbt_source_relation", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/add_dbt_source_relation.sql", "original_file_path": "macros/add_dbt_source_relation.sql", "unique_id": "macro.fivetran_utils.add_dbt_source_relation", "macro_sql": "{% macro add_dbt_source_relation() %}\n\n{% if var('union_schemas', none) or var('union_databases', none) %}\n, _dbt_source_relation\n{% endif %}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789079002.6633952, "supported_languages": null}, "macro.fivetran_utils.array_agg": {"name": "array_agg", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/array_agg.sql", "original_file_path": "macros/array_agg.sql", "unique_id": "macro.fivetran_utils.array_agg", "macro_sql": "{% macro array_agg(field_to_agg) -%}\n\n{{ adapter.dispatch('array_agg', 'fivetran_utils') (field_to_agg) }}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.default__array_agg"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field_to_agg", "type": null, "description": ""}], "created_at": 1789079002.6636777, "supported_languages": null}, "macro.fivetran_utils.default__array_agg": {"name": "default__array_agg", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/array_agg.sql", "original_file_path": "macros/array_agg.sql", "unique_id": "macro.fivetran_utils.default__array_agg", "macro_sql": "{% macro default__array_agg(field_to_agg) %}\n array_agg({{ field_to_agg }})\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field_to_agg", "type": null, "description": ""}], "created_at": 1789079002.6638064, "supported_languages": null}, "macro.fivetran_utils.redshift__array_agg": {"name": "redshift__array_agg", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/array_agg.sql", "original_file_path": "macros/array_agg.sql", "unique_id": "macro.fivetran_utils.redshift__array_agg", "macro_sql": "{% macro redshift__array_agg(field_to_agg) %}\n listagg({{ field_to_agg }}, ',')\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field_to_agg", "type": null, "description": ""}], "created_at": 1789079002.6639533, "supported_languages": null}, "macro.fivetran_utils.collect_freshness": {"name": "collect_freshness", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/collect_freshness.sql", "original_file_path": "macros/collect_freshness.sql", "unique_id": "macro.fivetran_utils.collect_freshness", "macro_sql": "{% macro collect_freshness(source, loaded_at_field, filter) %}\n {{ return(adapter.dispatch('collect_freshness')(source, loaded_at_field, filter))}}\n{% endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.default__collect_freshness"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "source", "type": null, "description": ""}, {"name": "loaded_at_field", "type": null, "description": ""}, {"name": "filter", "type": null, "description": ""}], "created_at": 1789079002.664469, "supported_languages": null}, "macro.fivetran_utils.default__collect_freshness": {"name": "default__collect_freshness", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/collect_freshness.sql", "original_file_path": "macros/collect_freshness.sql", "unique_id": "macro.fivetran_utils.default__collect_freshness", "macro_sql": "{% macro default__collect_freshness(source, loaded_at_field, filter) %}\n {% call statement('collect_freshness', fetch_result=True, auto_begin=False) -%}\n\n {%- set enabled_array = [] -%}\n {% for node in graph.sources.values() %}\n {% if node.identifier == source.identifier %}\n {% if (node.meta['is_enabled'] | default(true)) %}\n {%- do enabled_array.append(1) -%}\n {% endif %}\n {% endif %}\n {% endfor %}\n {% set is_enabled = (enabled_array != []) %}\n\n select\n {% if is_enabled %}\n max({{ loaded_at_field }})\n {% else %} \n {{ current_timestamp() }} {% endif %} as max_loaded_at,\n {{ current_timestamp() }} as snapshotted_at\n\n {% if is_enabled %}\n from {{ source }}\n {% if filter %}\n where {{ filter }}\n {% endif %}\n {% endif %}\n\n {% endcall %}\n\n {% if dbt_version.split('.') | map('int') | list >= [1, 5, 0] %}\n {{ return(load_result('collect_freshness')) }}\n {% else %}\n {{ return(load_result('collect_freshness').table) }}\n {% endif %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement", "macro.dbt.current_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "source", "type": null, "description": ""}, {"name": "loaded_at_field", "type": null, "description": ""}, {"name": "filter", "type": null, "description": ""}], "created_at": 1789079002.6658003, "supported_languages": null}, "macro.fivetran_utils.first_value": {"name": "first_value", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/first_value.sql", "original_file_path": "macros/first_value.sql", "unique_id": "macro.fivetran_utils.first_value", "macro_sql": "{% macro first_value(first_value_field, partition_field, order_by_field, order=\"asc\") -%}\n\n{{ adapter.dispatch('first_value', 'fivetran_utils') (first_value_field, partition_field, order_by_field, order) }}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.default__first_value"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "first_value_field", "type": null, "description": ""}, {"name": "partition_field", "type": null, "description": ""}, {"name": "order_by_field", "type": null, "description": ""}, {"name": "order", "type": null, "description": ""}], "created_at": 1789079002.666261, "supported_languages": null}, "macro.fivetran_utils.default__first_value": {"name": "default__first_value", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/first_value.sql", "original_file_path": "macros/first_value.sql", "unique_id": "macro.fivetran_utils.default__first_value", "macro_sql": "{% macro default__first_value(first_value_field, partition_field, order_by_field, order=\"asc\") %}\n\n first_value( {{ first_value_field }} ignore nulls ) over (partition by {{ partition_field }} order by {{ order_by_field }} {{ order }} )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "first_value_field", "type": null, "description": ""}, {"name": "partition_field", "type": null, "description": ""}, {"name": "order_by_field", "type": null, "description": ""}, {"name": "order", "type": null, "description": ""}], "created_at": 1789079002.6664991, "supported_languages": null}, "macro.fivetran_utils.redshift__first_value": {"name": "redshift__first_value", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/first_value.sql", "original_file_path": "macros/first_value.sql", "unique_id": "macro.fivetran_utils.redshift__first_value", "macro_sql": "{% macro redshift__first_value(first_value_field, partition_field, order_by_field, order=\"asc\") %}\n\n first_value( {{ first_value_field }} ignore nulls ) over (partition by {{ partition_field }} order by {{ order_by_field }} {{ order }} , {{ partition_field }} rows unbounded preceding )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "first_value_field", "type": null, "description": ""}, {"name": "partition_field", "type": null, "description": ""}, {"name": "order_by_field", "type": null, "description": ""}, {"name": "order", "type": null, "description": ""}], "created_at": 1789079002.6667573, "supported_languages": null}, "macro.fivetran_utils.union_relations": {"name": "union_relations", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/union_relations.sql", "original_file_path": "macros/union_relations.sql", "unique_id": "macro.fivetran_utils.union_relations", "macro_sql": "{%- macro union_relations(relations, aliases=none, column_override=none, include=[], exclude=[], source_column_name=none) -%}\n\n {%- if exclude and include -%}\n {{ exceptions.raise_compiler_error(\"Both an exclude and include list were provided to the `union` macro. Only one is allowed\") }}\n {%- endif -%}\n\n {#-- Prevent querying of db in parsing mode. This works because this macro does not create any new refs. -#}\n {%- if not execute %}\n {{ return('') }}\n {% endif -%}\n\n {%- set column_override = column_override if column_override is not none else {} -%}\n {%- set source_column_name = source_column_name if source_column_name is not none else '_dbt_source_relation' -%}\n\n {%- set relation_columns = {} -%}\n {%- set column_superset = {} -%}\n\n {%- for relation in relations -%}\n\n {%- do relation_columns.update({relation: []}) -%}\n\n {%- do dbt_utils._is_relation(relation, 'union_relations') -%}\n {%- set cols = adapter.get_columns_in_relation(relation) -%}\n {%- for col in cols -%}\n\n {#- If an exclude list was provided and the column is in the list, do nothing -#}\n {%- if exclude and col.column in exclude -%}\n\n {#- If an include list was provided and the column is not in the list, do nothing -#}\n {%- elif include and col.column not in include -%}\n\n {#- Otherwise add the column to the column superset -#}\n {%- else -%}\n\n {#- update the list of columns in this relation -#}\n {%- do relation_columns[relation].append(col.column) -%}\n\n {%- if col.column in column_superset -%}\n\n {%- set stored = column_superset[col.column] -%}\n {%- if col.is_string() and stored.is_string() and col.string_size() > stored.string_size() -%}\n\n {%- do column_superset.update({col.column: col}) -%}\n\n {%- endif %}\n\n {%- else -%}\n\n {%- do column_superset.update({col.column: col}) -%}\n\n {%- endif -%}\n\n {%- endif -%}\n\n {%- endfor -%}\n {%- endfor -%}\n\n {%- set ordered_column_names = column_superset.keys() -%}\n\n {%- for relation in relations %}\n\n (\n select\n\n cast({{ dbt.string_literal(relation) }} as {{ dbt.type_string() }}) as {{ source_column_name }},\n {% for col_name in ordered_column_names -%}\n\n {%- set col = column_superset[col_name] %}\n {%- set col_type = column_override.get(col.column, col.data_type) %}\n {%- set col_name = adapter.quote(col_name) if col_name in relation_columns[relation] else 'null' %}\n cast({{ col_name }} as {{ col_type }}) as {{ col.quoted }} {% if not loop.last %},{% endif -%}\n\n {%- endfor %}\n\n from {{ aliases[loop.index0] if aliases else relation }}\n )\n\n {% if not loop.last -%}\n union all\n {% endif -%}\n\n {%- endfor -%}\n\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt_utils._is_relation", "macro.dbt.string_literal", "macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relations", "type": null, "description": ""}, {"name": "aliases", "type": null, "description": ""}, {"name": "column_override", "type": null, "description": ""}, {"name": "include", "type": null, "description": ""}, {"name": "exclude", "type": null, "description": ""}, {"name": "source_column_name", "type": null, "description": ""}], "created_at": 1789079002.669988, "supported_languages": null}, "macro.fivetran_utils.union_tables": {"name": "union_tables", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/union_relations.sql", "original_file_path": "macros/union_relations.sql", "unique_id": "macro.fivetran_utils.union_tables", "macro_sql": "{%- macro union_tables(tables, column_override=none, include=[], exclude=[], source_column_name='_dbt_source_table') -%}\n\n {%- do exceptions.warn(\"Warning: the `union_tables` macro is no longer supported and will be deprecated in a future release of dbt-utils. Use the `union_relations` macro instead\") -%}\n\n {{ return(dbt_utils.union_relations(tables, column_override, include, exclude, source_column_name)) }}\n\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt_utils.union_relations"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "tables", "type": null, "description": ""}, {"name": "column_override", "type": null, "description": ""}, {"name": "include", "type": null, "description": ""}, {"name": "exclude", "type": null, "description": ""}, {"name": "source_column_name", "type": null, "description": ""}], "created_at": 1789079002.670405, "supported_languages": null}, "macro.fivetran_utils.timestamp_diff": {"name": "timestamp_diff", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/timestamp_diff.sql", "original_file_path": "macros/timestamp_diff.sql", "unique_id": "macro.fivetran_utils.timestamp_diff", "macro_sql": "{% macro timestamp_diff(first_date, second_date, datepart) %}\n {{ adapter.dispatch('timestamp_diff', 'fivetran_utils')(first_date, second_date, datepart) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.postgres__timestamp_diff"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "first_date", "type": null, "description": ""}, {"name": "second_date", "type": null, "description": ""}, {"name": "datepart", "type": null, "description": ""}], "created_at": 1789079002.67127, "supported_languages": null}, "macro.fivetran_utils.default__timestamp_diff": {"name": "default__timestamp_diff", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/timestamp_diff.sql", "original_file_path": "macros/timestamp_diff.sql", "unique_id": "macro.fivetran_utils.default__timestamp_diff", "macro_sql": "{% macro default__timestamp_diff(first_date, second_date, datepart) %}\n\n datediff(\n {{ datepart }},\n {{ first_date }},\n {{ second_date }}\n )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "first_date", "type": null, "description": ""}, {"name": "second_date", "type": null, "description": ""}, {"name": "datepart", "type": null, "description": ""}], "created_at": 1789079002.6714733, "supported_languages": null}, "macro.fivetran_utils.redshift__timestamp_diff": {"name": "redshift__timestamp_diff", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/timestamp_diff.sql", "original_file_path": "macros/timestamp_diff.sql", "unique_id": "macro.fivetran_utils.redshift__timestamp_diff", "macro_sql": "{% macro redshift__timestamp_diff(first_date, second_date, datepart) %}\n\n datediff(\n {{ datepart }},\n {{ first_date }},\n {{ second_date }}\n )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "first_date", "type": null, "description": ""}, {"name": "second_date", "type": null, "description": ""}, {"name": "datepart", "type": null, "description": ""}], "created_at": 1789079002.6716733, "supported_languages": null}, "macro.fivetran_utils.bigquery__timestamp_diff": {"name": "bigquery__timestamp_diff", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/timestamp_diff.sql", "original_file_path": "macros/timestamp_diff.sql", "unique_id": "macro.fivetran_utils.bigquery__timestamp_diff", "macro_sql": "{% macro bigquery__timestamp_diff(first_date, second_date, datepart) %}\n\n timestamp_diff(\n {{second_date}},\n {{first_date}},\n {{datepart}}\n )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "first_date", "type": null, "description": ""}, {"name": "second_date", "type": null, "description": ""}, {"name": "datepart", "type": null, "description": ""}], "created_at": 1789079002.671876, "supported_languages": null}, "macro.fivetran_utils.postgres__timestamp_diff": {"name": "postgres__timestamp_diff", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/timestamp_diff.sql", "original_file_path": "macros/timestamp_diff.sql", "unique_id": "macro.fivetran_utils.postgres__timestamp_diff", "macro_sql": "{% macro postgres__timestamp_diff(first_date, second_date, datepart) %}\n\n {% if datepart == 'year' %}\n (date_part('year', ({{second_date}})::date) - date_part('year', ({{first_date}})::date))\n {% elif datepart == 'quarter' %}\n ({{ dbt.datediff(first_date, second_date, 'year') }} * 4 + date_part('quarter', ({{second_date}})::date) - date_part('quarter', ({{first_date}})::date))\n {% elif datepart == 'month' %}\n ({{ dbt.datediff(first_date, second_date, 'year') }} * 12 + date_part('month', ({{second_date}})::date) - date_part('month', ({{first_date}})::date))\n {% elif datepart == 'day' %}\n (({{second_date}})::date - ({{first_date}})::date)\n {% elif datepart == 'week' %}\n ({{ dbt.datediff(first_date, second_date, 'day') }} / 7 + case\n when date_part('dow', ({{first_date}})::timestamp) <= date_part('dow', ({{second_date}})::timestamp) then\n case when {{first_date}} <= {{second_date}} then 0 else -1 end\n else\n case when {{first_date}} <= {{second_date}} then 1 else 0 end\n end)\n {% elif datepart == 'hour' %}\n ({{ dbt.datediff(first_date, second_date, 'day') }} * 24 + date_part('hour', ({{second_date}})::timestamp) - date_part('hour', ({{first_date}})::timestamp))\n {% elif datepart == 'minute' %}\n ({{ dbt.datediff(first_date, second_date, 'hour') }} * 60 + date_part('minute', ({{second_date}})::timestamp) - date_part('minute', ({{first_date}})::timestamp))\n {% elif datepart == 'second' %}\n ({{ dbt.datediff(first_date, second_date, 'minute') }} * 60 + floor(date_part('second', ({{second_date}})::timestamp)) - floor(date_part('second', ({{first_date}})::timestamp)))\n {% elif datepart == 'millisecond' %}\n ({{ dbt.datediff(first_date, second_date, 'minute') }} * 60000 + floor(date_part('millisecond', ({{second_date}})::timestamp)) - floor(date_part('millisecond', ({{first_date}})::timestamp)))\n {% elif datepart == 'microsecond' %}\n ({{ dbt.datediff(first_date, second_date, 'minute') }} * 60000000 + floor(date_part('microsecond', ({{second_date}})::timestamp)) - floor(date_part('microsecond', ({{first_date}})::timestamp)))\n {% else %}\n {{ exceptions.raise_compiler_error(\"Unsupported datepart for macro datediff in postgres: {!r}\".format(datepart)) }}\n {% endif %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.datediff"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "first_date", "type": null, "description": ""}, {"name": "second_date", "type": null, "description": ""}, {"name": "datepart", "type": null, "description": ""}], "created_at": 1789079002.6736941, "supported_languages": null}, "macro.fivetran_utils.duckdb__timestamp_diff": {"name": "duckdb__timestamp_diff", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/timestamp_diff.sql", "original_file_path": "macros/timestamp_diff.sql", "unique_id": "macro.fivetran_utils.duckdb__timestamp_diff", "macro_sql": "{% macro duckdb__timestamp_diff(first_date, second_date, datepart) %}\n\n datediff('{{ datepart }}', {{ first_date }}, {{ second_date }})\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "first_date", "type": null, "description": ""}, {"name": "second_date", "type": null, "description": ""}, {"name": "datepart", "type": null, "description": ""}], "created_at": 1789079002.6739137, "supported_languages": null}, "macro.fivetran_utils.add_pass_through_columns": {"name": "add_pass_through_columns", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/add_pass_through_columns.sql", "original_file_path": "macros/add_pass_through_columns.sql", "unique_id": "macro.fivetran_utils.add_pass_through_columns", "macro_sql": "{% macro add_pass_through_columns(base_columns, pass_through_var) %}\n\n {% if pass_through_var %}\n\n {% for column in pass_through_var %}\n\n {% if column is mapping %}\n\n {% if column.alias %}\n\n {% do base_columns.append({ \"name\": column.name, \"alias\": column.alias, \"datatype\": column.datatype if column.datatype else dbt.type_string()}) %}\n\n {% else %}\n\n {% do base_columns.append({ \"name\": column.name, \"datatype\": column.datatype if column.datatype else dbt.type_string()}) %}\n \n {% endif %}\n\n {% else %}\n\n {% do base_columns.append({ \"name\": column, \"datatype\": dbt.type_string()}) %}\n\n {% endif %}\n\n {% endfor %}\n\n {% endif %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "base_columns", "type": null, "description": ""}, {"name": "pass_through_var", "type": null, "description": ""}], "created_at": 1789079002.6750205, "supported_languages": null}, "macro.fivetran_utils.timestamp_add": {"name": "timestamp_add", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/timestamp_add.sql", "original_file_path": "macros/timestamp_add.sql", "unique_id": "macro.fivetran_utils.timestamp_add", "macro_sql": "{% macro timestamp_add(datepart, interval, from_timestamp) -%}\n\n{{ adapter.dispatch('timestamp_add', 'fivetran_utils') (datepart, interval, from_timestamp) }}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.postgres__timestamp_add"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "datepart", "type": null, "description": ""}, {"name": "interval", "type": null, "description": ""}, {"name": "from_timestamp", "type": null, "description": ""}], "created_at": 1789079002.6755133, "supported_languages": null}, "macro.fivetran_utils.default__timestamp_add": {"name": "default__timestamp_add", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/timestamp_add.sql", "original_file_path": "macros/timestamp_add.sql", "unique_id": "macro.fivetran_utils.default__timestamp_add", "macro_sql": "{% macro default__timestamp_add(datepart, interval, from_timestamp) %}\n\n timestampadd(\n {{ datepart }},\n {{ interval }},\n {{ from_timestamp }}\n )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "datepart", "type": null, "description": ""}, {"name": "interval", "type": null, "description": ""}, {"name": "from_timestamp", "type": null, "description": ""}], "created_at": 1789079002.6757073, "supported_languages": null}, "macro.fivetran_utils.bigquery__timestamp_add": {"name": "bigquery__timestamp_add", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/timestamp_add.sql", "original_file_path": "macros/timestamp_add.sql", "unique_id": "macro.fivetran_utils.bigquery__timestamp_add", "macro_sql": "{% macro bigquery__timestamp_add(datepart, interval, from_timestamp) %}\n\n timestamp_add({{ from_timestamp }}, interval {{ interval }} {{ datepart }})\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "datepart", "type": null, "description": ""}, {"name": "interval", "type": null, "description": ""}, {"name": "from_timestamp", "type": null, "description": ""}], "created_at": 1789079002.6759095, "supported_languages": null}, "macro.fivetran_utils.redshift__timestamp_add": {"name": "redshift__timestamp_add", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/timestamp_add.sql", "original_file_path": "macros/timestamp_add.sql", "unique_id": "macro.fivetran_utils.redshift__timestamp_add", "macro_sql": "{% macro redshift__timestamp_add(datepart, interval, from_timestamp) %}\n\n dateadd(\n {{ datepart }},\n {{ interval }},\n {{ from_timestamp }}\n )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "datepart", "type": null, "description": ""}, {"name": "interval", "type": null, "description": ""}, {"name": "from_timestamp", "type": null, "description": ""}], "created_at": 1789079002.6760979, "supported_languages": null}, "macro.fivetran_utils.postgres__timestamp_add": {"name": "postgres__timestamp_add", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/timestamp_add.sql", "original_file_path": "macros/timestamp_add.sql", "unique_id": "macro.fivetran_utils.postgres__timestamp_add", "macro_sql": "{% macro postgres__timestamp_add(datepart, interval, from_timestamp) %}\n\n {{ from_timestamp }} + ((interval '1 {{ datepart }}') * ({{ interval }}))\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "datepart", "type": null, "description": ""}, {"name": "interval", "type": null, "description": ""}, {"name": "from_timestamp", "type": null, "description": ""}], "created_at": 1789079002.6762831, "supported_languages": null}, "macro.fivetran_utils.spark__timestamp_add": {"name": "spark__timestamp_add", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/timestamp_add.sql", "original_file_path": "macros/timestamp_add.sql", "unique_id": "macro.fivetran_utils.spark__timestamp_add", "macro_sql": "{% macro spark__timestamp_add(datepart, interval, from_timestamp) %}\n\n {{ dbt.dateadd(datepart, interval, from_timestamp) }}\n \n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.dateadd"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "datepart", "type": null, "description": ""}, {"name": "interval", "type": null, "description": ""}, {"name": "from_timestamp", "type": null, "description": ""}], "created_at": 1789079002.6764884, "supported_languages": null}, "macro.fivetran_utils.duckdb__timestamp_add": {"name": "duckdb__timestamp_add", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/timestamp_add.sql", "original_file_path": "macros/timestamp_add.sql", "unique_id": "macro.fivetran_utils.duckdb__timestamp_add", "macro_sql": "{% macro duckdb__timestamp_add(datepart, interval, from_timestamp) %}\n\n {{ from_timestamp }} + ((interval '1 {{ datepart }}') * ({{ interval }}))\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "datepart", "type": null, "description": ""}, {"name": "interval", "type": null, "description": ""}, {"name": "from_timestamp", "type": null, "description": ""}], "created_at": 1789079002.676744, "supported_languages": null}, "macro.fivetran_utils.enabled_vars": {"name": "enabled_vars", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/enabled_vars.sql", "original_file_path": "macros/enabled_vars.sql", "unique_id": "macro.fivetran_utils.enabled_vars", "macro_sql": "{% macro enabled_vars(vars) %}\n\n{% for v in vars %}\n \n {% if var(v, True) == False %}\n {{ return(False) }}\n {% endif %}\n\n{% endfor %}\n\n{{ return(True) }}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "vars", "type": null, "description": ""}], "created_at": 1789079002.6772094, "supported_languages": null}, "macro.fivetran_utils.wrap_in_quotes": {"name": "wrap_in_quotes", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/wrap_in_quotes.sql", "original_file_path": "macros/wrap_in_quotes.sql", "unique_id": "macro.fivetran_utils.wrap_in_quotes", "macro_sql": "{%- macro wrap_in_quotes(object_to_quote) -%}\n\n{{ return(adapter.dispatch('wrap_in_quotes', 'fivetran_utils')(object_to_quote)) }}\n\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.fivetran_utils.postgres__wrap_in_quotes"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "object_to_quote", "type": null, "description": ""}], "created_at": 1789079002.6775901, "supported_languages": null}, "macro.fivetran_utils.default__wrap_in_quotes": {"name": "default__wrap_in_quotes", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/wrap_in_quotes.sql", "original_file_path": "macros/wrap_in_quotes.sql", "unique_id": "macro.fivetran_utils.default__wrap_in_quotes", "macro_sql": "{%- macro default__wrap_in_quotes(object_to_quote) -%}\n{# bigquery, spark, databricks #}\n `{{ object_to_quote }}`\n{%- endmacro -%}\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "object_to_quote", "type": null, "description": ""}], "created_at": 1789079002.677725, "supported_languages": null}, "macro.fivetran_utils.snowflake__wrap_in_quotes": {"name": "snowflake__wrap_in_quotes", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/wrap_in_quotes.sql", "original_file_path": "macros/wrap_in_quotes.sql", "unique_id": "macro.fivetran_utils.snowflake__wrap_in_quotes", "macro_sql": "{%- macro snowflake__wrap_in_quotes(object_to_quote) -%}\n \"{{ object_to_quote | upper }}\"\n{%- endmacro -%}\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "object_to_quote", "type": null, "description": ""}], "created_at": 1789079002.6778789, "supported_languages": null}, "macro.fivetran_utils.redshift__wrap_in_quotes": {"name": "redshift__wrap_in_quotes", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/wrap_in_quotes.sql", "original_file_path": "macros/wrap_in_quotes.sql", "unique_id": "macro.fivetran_utils.redshift__wrap_in_quotes", "macro_sql": "{%- macro redshift__wrap_in_quotes(object_to_quote) -%}\n \"{{ object_to_quote }}\"\n{%- endmacro -%}\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "object_to_quote", "type": null, "description": ""}], "created_at": 1789079002.6780076, "supported_languages": null}, "macro.fivetran_utils.postgres__wrap_in_quotes": {"name": "postgres__wrap_in_quotes", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/wrap_in_quotes.sql", "original_file_path": "macros/wrap_in_quotes.sql", "unique_id": "macro.fivetran_utils.postgres__wrap_in_quotes", "macro_sql": "{%- macro postgres__wrap_in_quotes(object_to_quote) -%}\n \"{{ object_to_quote }}\"\n{%- endmacro -%}\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "object_to_quote", "type": null, "description": ""}], "created_at": 1789079002.6781273, "supported_languages": null}, "macro.fivetran_utils.duckdb__wrap_in_quotes": {"name": "duckdb__wrap_in_quotes", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/wrap_in_quotes.sql", "original_file_path": "macros/wrap_in_quotes.sql", "unique_id": "macro.fivetran_utils.duckdb__wrap_in_quotes", "macro_sql": "{%- macro duckdb__wrap_in_quotes(object_to_quote) -%}\n \"{{ object_to_quote }}\"\n{%- endmacro -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "object_to_quote", "type": null, "description": ""}], "created_at": 1789079002.6782448, "supported_languages": null}, "macro.fivetran_utils.json_extract": {"name": "json_extract", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/json_extract.sql", "original_file_path": "macros/json_extract.sql", "unique_id": "macro.fivetran_utils.json_extract", "macro_sql": "{% macro json_extract(string, string_path) -%}\n\n{{ adapter.dispatch('json_extract', 'fivetran_utils') (string, string_path) }}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.postgres__json_extract"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "string", "type": null, "description": ""}, {"name": "string_path", "type": null, "description": ""}], "created_at": 1789079002.6786852, "supported_languages": null}, "macro.fivetran_utils.default__json_extract": {"name": "default__json_extract", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/json_extract.sql", "original_file_path": "macros/json_extract.sql", "unique_id": "macro.fivetran_utils.default__json_extract", "macro_sql": "{% macro default__json_extract(string, string_path) %}\n\n json_extract_path_text({{string}}, {{ \"'\" ~ string_path ~ \"'\" }} )\n \n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "string", "type": null, "description": ""}, {"name": "string_path", "type": null, "description": ""}], "created_at": 1789079002.6788843, "supported_languages": null}, "macro.fivetran_utils.snowflake__json_extract": {"name": "snowflake__json_extract", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/json_extract.sql", "original_file_path": "macros/json_extract.sql", "unique_id": "macro.fivetran_utils.snowflake__json_extract", "macro_sql": "{% macro snowflake__json_extract(string, string_path) %}\n\n json_extract_path_text(try_parse_json( {{string}} ), {{ \"'\" ~ string_path ~ \"'\" }} )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "string", "type": null, "description": ""}, {"name": "string_path", "type": null, "description": ""}], "created_at": 1789079002.6790762, "supported_languages": null}, "macro.fivetran_utils.redshift__json_extract": {"name": "redshift__json_extract", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/json_extract.sql", "original_file_path": "macros/json_extract.sql", "unique_id": "macro.fivetran_utils.redshift__json_extract", "macro_sql": "{% macro redshift__json_extract(string, string_path) %}\n\n case when is_valid_json( {{string}} ) then json_extract_path_text({{string}}, {{ \"'\" ~ string_path ~ \"'\" }} ) else null end\n \n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "string", "type": null, "description": ""}, {"name": "string_path", "type": null, "description": ""}], "created_at": 1789079002.6792724, "supported_languages": null}, "macro.fivetran_utils.bigquery__json_extract": {"name": "bigquery__json_extract", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/json_extract.sql", "original_file_path": "macros/json_extract.sql", "unique_id": "macro.fivetran_utils.bigquery__json_extract", "macro_sql": "{% macro bigquery__json_extract(string, string_path) %}\n\n json_extract_scalar({{string}}, {{ \"'$.\" ~ string_path ~ \"'\" }} )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "string", "type": null, "description": ""}, {"name": "string_path", "type": null, "description": ""}], "created_at": 1789079002.6794467, "supported_languages": null}, "macro.fivetran_utils.postgres__json_extract": {"name": "postgres__json_extract", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/json_extract.sql", "original_file_path": "macros/json_extract.sql", "unique_id": "macro.fivetran_utils.postgres__json_extract", "macro_sql": "{% macro postgres__json_extract(string, string_path) %}\n\n {{string}}::json->>{{\"'\" ~ string_path ~ \"'\" }}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "string", "type": null, "description": ""}, {"name": "string_path", "type": null, "description": ""}], "created_at": 1789079002.6796188, "supported_languages": null}, "macro.fivetran_utils.extract_url_parameter": {"name": "extract_url_parameter", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/extract_url_parameter.sql", "original_file_path": "macros/extract_url_parameter.sql", "unique_id": "macro.fivetran_utils.extract_url_parameter", "macro_sql": "{% macro extract_url_parameter(field, url_parameter) -%}\n\n{{ adapter.dispatch('extract_url_parameter', 'fivetran_utils') (field, url_parameter) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.default__extract_url_parameter"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field", "type": null, "description": ""}, {"name": "url_parameter", "type": null, "description": ""}], "created_at": 1789079002.6799707, "supported_languages": null}, "macro.fivetran_utils.default__extract_url_parameter": {"name": "default__extract_url_parameter", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/extract_url_parameter.sql", "original_file_path": "macros/extract_url_parameter.sql", "unique_id": "macro.fivetran_utils.default__extract_url_parameter", "macro_sql": "{% macro default__extract_url_parameter(field, url_parameter) -%}\n\n{{ dbt_utils.get_url_parameter(field, url_parameter) }}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.get_url_parameter"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field", "type": null, "description": ""}, {"name": "url_parameter", "type": null, "description": ""}], "created_at": 1789079002.680214, "supported_languages": null}, "macro.fivetran_utils.spark__extract_url_parameter": {"name": "spark__extract_url_parameter", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/extract_url_parameter.sql", "original_file_path": "macros/extract_url_parameter.sql", "unique_id": "macro.fivetran_utils.spark__extract_url_parameter", "macro_sql": "{% macro spark__extract_url_parameter(field, url_parameter) -%}\n\n{%- set formatted_url_parameter = \"'\" + url_parameter + \"=([^&]+)'\" -%}\nnullif(regexp_extract({{ field }}, {{ formatted_url_parameter }}, 1), '')\n\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field", "type": null, "description": ""}, {"name": "url_parameter", "type": null, "description": ""}], "created_at": 1789079002.6804454, "supported_languages": null}, "macro.fivetran_utils.string_agg": {"name": "string_agg", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/string_agg.sql", "original_file_path": "macros/string_agg.sql", "unique_id": "macro.fivetran_utils.string_agg", "macro_sql": "{% macro string_agg(field_to_agg, delimiter) -%}\n\n{{ adapter.dispatch('string_agg', 'fivetran_utils') (field_to_agg, delimiter) }}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.default__string_agg"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field_to_agg", "type": null, "description": ""}, {"name": "delimiter", "type": null, "description": ""}], "created_at": 1789079002.680818, "supported_languages": null}, "macro.fivetran_utils.default__string_agg": {"name": "default__string_agg", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/string_agg.sql", "original_file_path": "macros/string_agg.sql", "unique_id": "macro.fivetran_utils.default__string_agg", "macro_sql": "{% macro default__string_agg(field_to_agg, delimiter) %}\n string_agg({{ field_to_agg }}, {{ delimiter }})\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field_to_agg", "type": null, "description": ""}, {"name": "delimiter", "type": null, "description": ""}], "created_at": 1789079002.6809967, "supported_languages": null}, "macro.fivetran_utils.snowflake__string_agg": {"name": "snowflake__string_agg", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/string_agg.sql", "original_file_path": "macros/string_agg.sql", "unique_id": "macro.fivetran_utils.snowflake__string_agg", "macro_sql": "{% macro snowflake__string_agg(field_to_agg, delimiter) %}\n listagg({{ field_to_agg }}, {{ delimiter }})\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field_to_agg", "type": null, "description": ""}, {"name": "delimiter", "type": null, "description": ""}], "created_at": 1789079002.681155, "supported_languages": null}, "macro.fivetran_utils.redshift__string_agg": {"name": "redshift__string_agg", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/string_agg.sql", "original_file_path": "macros/string_agg.sql", "unique_id": "macro.fivetran_utils.redshift__string_agg", "macro_sql": "{% macro redshift__string_agg(field_to_agg, delimiter) %}\n listagg({{ field_to_agg }}, {{ delimiter }})\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field_to_agg", "type": null, "description": ""}, {"name": "delimiter", "type": null, "description": ""}], "created_at": 1789079002.681306, "supported_languages": null}, "macro.fivetran_utils.spark__string_agg": {"name": "spark__string_agg", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/string_agg.sql", "original_file_path": "macros/string_agg.sql", "unique_id": "macro.fivetran_utils.spark__string_agg", "macro_sql": "{% macro spark__string_agg(field_to_agg, delimiter) %}\n -- collect set will remove duplicates\n replace(replace(replace(cast( collect_set({{ field_to_agg }}) as string), '[', ''), ']', ''), ', ', {{ delimiter }} )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field_to_agg", "type": null, "description": ""}, {"name": "delimiter", "type": null, "description": ""}], "created_at": 1789079002.6814616, "supported_languages": null}, "macro.fivetran_utils.max_bool": {"name": "max_bool", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/max_bool.sql", "original_file_path": "macros/max_bool.sql", "unique_id": "macro.fivetran_utils.max_bool", "macro_sql": "{% macro max_bool(boolean_field) -%}\n\n{{ adapter.dispatch('max_bool', 'fivetran_utils') (boolean_field) }}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.default__max_bool"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "boolean_field", "type": null, "description": ""}], "created_at": 1789079002.6818273, "supported_languages": null}, "macro.fivetran_utils.default__max_bool": {"name": "default__max_bool", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/max_bool.sql", "original_file_path": "macros/max_bool.sql", "unique_id": "macro.fivetran_utils.default__max_bool", "macro_sql": "{% macro default__max_bool(boolean_field) %}\n\n bool_or( {{ boolean_field }} )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "boolean_field", "type": null, "description": ""}], "created_at": 1789079002.681972, "supported_languages": null}, "macro.fivetran_utils.snowflake__max_bool": {"name": "snowflake__max_bool", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/max_bool.sql", "original_file_path": "macros/max_bool.sql", "unique_id": "macro.fivetran_utils.snowflake__max_bool", "macro_sql": "{% macro snowflake__max_bool(boolean_field) %}\n\n max( {{ boolean_field }} )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "boolean_field", "type": null, "description": ""}], "created_at": 1789079002.6820974, "supported_languages": null}, "macro.fivetran_utils.bigquery__max_bool": {"name": "bigquery__max_bool", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/max_bool.sql", "original_file_path": "macros/max_bool.sql", "unique_id": "macro.fivetran_utils.bigquery__max_bool", "macro_sql": "{% macro bigquery__max_bool(boolean_field) %}\n\n max( {{ boolean_field }} )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "boolean_field", "type": null, "description": ""}], "created_at": 1789079002.6822197, "supported_languages": null}, "macro.fivetran_utils.empty_variable_warning": {"name": "empty_variable_warning", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/empty_variable_warning.sql", "original_file_path": "macros/empty_variable_warning.sql", "unique_id": "macro.fivetran_utils.empty_variable_warning", "macro_sql": "{% macro empty_variable_warning(variable, downstream_model) %}\n\n{% if not var(variable) %}\n{{ log(\n \"\"\"\n Warning: You have passed an empty list to the \"\"\" ~ variable ~ \"\"\".\n As a result, you won't see the history of any columns in the \"\"\" ~ downstream_model ~ \"\"\" model.\n \"\"\",\n info=True\n) }}\n{% endif %}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "variable", "type": null, "description": ""}, {"name": "downstream_model", "type": null, "description": ""}], "created_at": 1789079002.6826477, "supported_languages": null}, "macro.fivetran_utils.dummy_coalesce_value": {"name": "dummy_coalesce_value", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/dummy_coalesce_value.sql", "original_file_path": "macros/dummy_coalesce_value.sql", "unique_id": "macro.fivetran_utils.dummy_coalesce_value", "macro_sql": "{% macro dummy_coalesce_value(column) %}\n\n{% set coalesce_value = {\n 'STRING': \"'DUMMY_STRING'\",\n 'BOOLEAN': 'null',\n 'INT': 999999999,\n 'FLOAT': 999999999.99,\n 'TIMESTAMP': 'cast(\"2099-12-31\" as timestamp)',\n 'DATE': 'cast(\"2099-12-31\" as date)',\n} %}\n\n{% if column.is_float() %}\n{{ return(coalesce_value['FLOAT']) }}\n\n{% elif column.is_numeric() %}\n{{ return(coalesce_value['INT']) }}\n\n{% elif column.is_string() %}\n{{ return(coalesce_value['STRING']) }}\n\n{% elif column.data_type|lower == 'boolean' %}\n{{ return(coalesce_value['BOOLEAN']) }}\n\n{% elif 'timestamp' in column.data_type|lower %}\n{{ return(coalesce_value['TIMESTAMP']) }}\n\n{% elif 'date' in column.data_type|lower %}\n{{ return(coalesce_value['DATE']) }}\n\n{% elif 'int' in column.data_type|lower %}\n{{ return(coalesce_value['INT']) }}\n\n{% endif %}\n\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "column", "type": null, "description": ""}], "created_at": 1789079002.6841924, "supported_languages": null}, "macro.fivetran_utils.percentile": {"name": "percentile", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/percentile.sql", "original_file_path": "macros/percentile.sql", "unique_id": "macro.fivetran_utils.percentile", "macro_sql": "{% macro percentile(percentile_field, partition_field, percent) -%}\n\n{{ adapter.dispatch('percentile', 'fivetran_utils') (percentile_field, partition_field, percent) }}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.postgres__percentile"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "percentile_field", "type": null, "description": ""}, {"name": "partition_field", "type": null, "description": ""}, {"name": "percent", "type": null, "description": ""}], "created_at": 1789079002.6847045, "supported_languages": null}, "macro.fivetran_utils.default__percentile": {"name": "default__percentile", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/percentile.sql", "original_file_path": "macros/percentile.sql", "unique_id": "macro.fivetran_utils.default__percentile", "macro_sql": "{% macro default__percentile(percentile_field, partition_field, percent) %}\n\n percentile_cont( \n {{ percent }} )\n within group ( order by {{ percentile_field }} )\n over ( partition by {{ partition_field }} )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "percentile_field", "type": null, "description": ""}, {"name": "partition_field", "type": null, "description": ""}, {"name": "percent", "type": null, "description": ""}], "created_at": 1789079002.6849139, "supported_languages": null}, "macro.fivetran_utils.redshift__percentile": {"name": "redshift__percentile", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/percentile.sql", "original_file_path": "macros/percentile.sql", "unique_id": "macro.fivetran_utils.redshift__percentile", "macro_sql": "{% macro redshift__percentile(percentile_field, partition_field, percent) %}\n\n percentile_cont( \n {{ percent }} )\n within group ( order by {{ percentile_field }} )\n over ( partition by {{ partition_field }} )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "percentile_field", "type": null, "description": ""}, {"name": "partition_field", "type": null, "description": ""}, {"name": "percent", "type": null, "description": ""}], "created_at": 1789079002.685109, "supported_languages": null}, "macro.fivetran_utils.bigquery__percentile": {"name": "bigquery__percentile", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/percentile.sql", "original_file_path": "macros/percentile.sql", "unique_id": "macro.fivetran_utils.bigquery__percentile", "macro_sql": "{% macro bigquery__percentile(percentile_field, partition_field, percent) %}\n\n percentile_cont( \n {{ percentile_field }}, \n {{ percent }}) \n over (partition by {{ partition_field }} \n )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "percentile_field", "type": null, "description": ""}, {"name": "partition_field", "type": null, "description": ""}, {"name": "percent", "type": null, "description": ""}], "created_at": 1789079002.6852984, "supported_languages": null}, "macro.fivetran_utils.postgres__percentile": {"name": "postgres__percentile", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/percentile.sql", "original_file_path": "macros/percentile.sql", "unique_id": "macro.fivetran_utils.postgres__percentile", "macro_sql": "{% macro postgres__percentile(percentile_field, partition_field, percent) %}\n\n percentile_cont( \n {{ percent }} )\n within group ( order by {{ percentile_field }} )\n /* have to group by partition field */\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "percentile_field", "type": null, "description": ""}, {"name": "partition_field", "type": null, "description": ""}, {"name": "percent", "type": null, "description": ""}], "created_at": 1789079002.6854696, "supported_languages": null}, "macro.fivetran_utils.spark__percentile": {"name": "spark__percentile", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/percentile.sql", "original_file_path": "macros/percentile.sql", "unique_id": "macro.fivetran_utils.spark__percentile", "macro_sql": "{% macro spark__percentile(percentile_field, partition_field, percent) %}\n\n percentile( \n {{ percentile_field }}, \n {{ percent }}) \n over (partition by {{ partition_field }} \n )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "percentile_field", "type": null, "description": ""}, {"name": "partition_field", "type": null, "description": ""}, {"name": "percent", "type": null, "description": ""}], "created_at": 1789079002.6856575, "supported_languages": null}, "macro.fivetran_utils.duckdb__percentile": {"name": "duckdb__percentile", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/percentile.sql", "original_file_path": "macros/percentile.sql", "unique_id": "macro.fivetran_utils.duckdb__percentile", "macro_sql": "{% macro duckdb__percentile(percentile_field, partition_field, percent) %}\n\n quantile_cont(\n {{ percentile_field }},\n {{ percent }})\n over (partition by {{ partition_field }}\n )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "percentile_field", "type": null, "description": ""}, {"name": "partition_field", "type": null, "description": ""}, {"name": "percent", "type": null, "description": ""}], "created_at": 1789079002.6858437, "supported_languages": null}, "macro.fivetran_utils.remove_prefix_from_columns": {"name": "remove_prefix_from_columns", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/remove_prefix_from_columns.sql", "original_file_path": "macros/remove_prefix_from_columns.sql", "unique_id": "macro.fivetran_utils.remove_prefix_from_columns", "macro_sql": "{% macro remove_prefix_from_columns(columns, prefix='', exclude=[]) %}\n\n {%- for col in columns if col.name not in exclude -%}\n {%- if col.name[:prefix|length]|lower == prefix -%}\n {{ col.name }} as {{ col.name[prefix|length:] }}\n {%- else -%}\n {{ col.name }}\n {%- endif -%}\n {%- if not loop.last -%},{%- endif %}\n {% endfor -%}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "columns", "type": null, "description": ""}, {"name": "prefix", "type": null, "description": ""}, {"name": "exclude", "type": null, "description": ""}], "created_at": 1789079002.6865199, "supported_languages": null}, "macro.fivetran_utils.snowflake_seed_data": {"name": "snowflake_seed_data", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/snowflake_seed_data.sql", "original_file_path": "macros/snowflake_seed_data.sql", "unique_id": "macro.fivetran_utils.snowflake_seed_data", "macro_sql": "{% macro snowflake_seed_data(seed_name) %}\n\n{% if target.type == 'snowflake' %}\n{{ return(ref(seed_name ~ '_snowflake')) }}\n{% else %}\n{{ return(ref(seed_name)) }}\n{% endif %}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "seed_name", "type": null, "description": ""}], "created_at": 1789079002.6869526, "supported_languages": null}}, "docs": {"doc.dbt.__overview__": {"name": "__overview__", "resource_type": "doc", "package_name": "dbt", "path": "overview.md", "original_file_path": "docs/overview.md", "unique_id": "doc.dbt.__overview__", "block_contents": "### Welcome!\n\nWelcome to the auto-generated documentation for your dbt project!\n\n### Navigation\n\nYou can use the `Project` and `Database` navigation tabs on the left side of the window to explore the models\nin your project.\n\n#### Project Tab\nThe `Project` tab mirrors the directory structure of your dbt project. In this tab, you can see all of the\nmodels defined in your dbt project, as well as models imported from dbt packages.\n\n#### Database Tab\nThe `Database` tab also exposes your models, but in a format that looks more like a database explorer. This view\nshows relations (tables and views) grouped into database schemas. Note that ephemeral models are _not_ shown\nin this interface, as they do not exist in the database.\n\n### Graph Exploration\nYou can click the blue icon on the bottom-right corner of the page to view the lineage graph of your models.\n\nOn model pages, you'll see the immediate parents and children of the model you're exploring. By clicking the `Expand`\nbutton at the top-right of this lineage pane, you'll be able to see all of the models that are used to build,\nor are built from, the model you're exploring.\n\nOnce expanded, you'll be able to use the `--select` and `--exclude` model selection syntax to filter the\nmodels in the graph. For more information on model selection, check out the [dbt docs](https://docs.getdbt.com/docs/model-selection-syntax).\n\nNote that you can also right-click on models to interactively filter and explore the graph.\n\n---\n\n### More information\n\n- [What is dbt](https://docs.getdbt.com/docs/introduction)?\n- Read the [dbt viewpoint](https://docs.getdbt.com/docs/viewpoint)\n- [Installation](https://docs.getdbt.com/docs/installation)\n- Join the [dbt Community](https://www.getdbt.com/community/) for questions and discussion"}, "doc.iterable.source_relation": {"name": "source_relation", "resource_type": "doc", "package_name": "iterable", "path": "docs.md", "original_file_path": "models/docs.md", "unique_id": "doc.iterable.source_relation", "block_contents": "Identifies the record's source."}, "doc.iterable._fivetran_synced": {"name": "_fivetran_synced", "resource_type": "doc", "package_name": "iterable", "path": "docs.md", "original_file_path": "models/docs.md", "unique_id": "doc.iterable._fivetran_synced", "block_contents": "The time when a record was last updated by Fivetran."}}, "exposures": {}, "metrics": {}, "groups": {}, "selectors": {}, "disabled": {"test.iterable_integration_tests.consistency_campaigns": [{"database": "postgres", "schema": "public_dbt_test__audit", "name": "consistency_campaigns", "resource_type": "test", "package_name": "iterable_integration_tests", "path": "consistency/consistency_campaigns.sql", "original_file_path": "tests/consistency/consistency_campaigns.sql", "unique_id": "test.iterable_integration_tests.consistency_campaigns", "fqn": ["iterable_integration_tests", "consistency", "consistency_campaigns"], "alias": "consistency_campaigns", "checksum": {"name": "sha256", "checksum": "30e008529ef9f5fa6d8697bbcff2562fc9b176d571cc310458e67e8c82a46185"}, "config": {"enabled": false, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": ["fivetran_validations"], "meta": {}, "group": null, "static_analysis": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "sql_header": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": ["fivetran_validations"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"tags": "fivetran_validations", "enabled": "var('fivetran_validation_tests_enabled', False)"}, "created_at": 1789079003.1515768, "relation_name": null, "raw_code": "{{ config(\n tags=\"fivetran_validations\",\n enabled=var('fivetran_validation_tests_enabled', false)\n) }}\n\n{% set exclude_cols = ['labels'] + var('consistency_test_exclude_metrics', []) %}\n{% set fields = dbt_utils.star(from=ref('iterable__campaigns'), except=exclude_cols) %}\n\n-- this test ensures the iterable__campaigns end model matches the prior version\nwith prod as (\n select {{ fields }}\n from {{ target.schema }}_iterable_prod.iterable__campaigns\n where date(updated_at) < date({{ dbt.current_timestamp() }})\n),\n\ndev as (\n select {{ fields }}\n from {{ target.schema }}_iterable_dev.iterable__campaigns\n where date(updated_at) < date({{ dbt.current_timestamp() }})\n),\n\nprod_not_in_dev as (\n -- rows from prod not found in dev\n select * from prod\n except distinct\n select * from dev\n),\n\ndev_not_in_prod as (\n -- rows from dev not found in prod\n select * from dev\n except distinct\n select * from prod\n),\n\nfinal as (\n select\n *,\n 'from prod' as source\n from prod_not_in_dev\n\n union all -- union since we only care if rows are produced\n\n select\n *,\n 'from dev' as source\n from dev_not_in_prod\n)\n\nselect *\nfrom final", "doc_blocks": [], "language": "sql", "refs": [{"name": "iterable__campaigns", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt_utils.star", "macro.dbt.current_timestamp"], "nodes": []}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}}], "test.iterable_integration_tests.consistency_user_unsubscriptions": [{"database": "postgres", "schema": "public_dbt_test__audit", "name": "consistency_user_unsubscriptions", "resource_type": "test", "package_name": "iterable_integration_tests", "path": "consistency/consistency_user_unsubscriptions.sql", "original_file_path": "tests/consistency/consistency_user_unsubscriptions.sql", "unique_id": "test.iterable_integration_tests.consistency_user_unsubscriptions", "fqn": ["iterable_integration_tests", "consistency", "consistency_user_unsubscriptions"], "alias": "consistency_user_unsubscriptions", "checksum": {"name": "sha256", "checksum": "32d0be8a7f721a49100a7f4b1046a8ecb1d75b86f4ad1a484d53a1d03343bc40"}, "config": {"enabled": false, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": ["fivetran_validations"], "meta": {}, "group": null, "static_analysis": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "sql_header": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": ["fivetran_validations"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"tags": "fivetran_validations", "enabled": "var('fivetran_validation_tests_enabled', False)"}, "created_at": 1789079003.187948, "relation_name": null, "raw_code": "{{ config(\n tags=\"fivetran_validations\",\n enabled=var('fivetran_validation_tests_enabled', false)\n) }}\n\n{% set exclude_cols = var('consistency_test_exclude_metrics', []) %}\n{% set fields = dbt_utils.star(from=ref('iterable__user_unsubscriptions'), except=exclude_cols) %}\n\n-- this test ensures the iterable__user_unsubscriptions end model matches the prior version\nwith prod as (\n select {{ fields }}\n from {{ target.schema }}_iterable_prod.iterable__user_unsubscriptions\n),\n\ndev as (\n select {{ fields }}\n from {{ target.schema }}_iterable_dev.iterable__user_unsubscriptions\n),\n\nprod_not_in_dev as (\n -- rows from prod not found in dev\n select * from prod\n except distinct\n select * from dev\n),\n\ndev_not_in_prod as (\n -- rows from dev not found in prod\n select * from dev\n except distinct\n select * from prod\n),\n\nfinal as (\n select\n *,\n 'from prod' as source\n from prod_not_in_dev\n\n union all -- union since we only care if rows are produced\n\n select\n *,\n 'from dev' as source\n from dev_not_in_prod\n)\n\nselect *\nfrom final", "doc_blocks": [], "language": "sql", "refs": [{"name": "iterable__user_unsubscriptions", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt_utils.star"], "nodes": []}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}}], "test.iterable_integration_tests.consistency_list_user_history": [{"database": "postgres", "schema": "public_dbt_test__audit", "name": "consistency_list_user_history", "resource_type": "test", "package_name": "iterable_integration_tests", "path": "consistency/consistency_list_user_history.sql", "original_file_path": "tests/consistency/consistency_list_user_history.sql", "unique_id": "test.iterable_integration_tests.consistency_list_user_history", "fqn": ["iterable_integration_tests", "consistency", "consistency_list_user_history"], "alias": "consistency_list_user_history", "checksum": {"name": "sha256", "checksum": "e0081cf1366801020e3c9fbdc71e989f2bdd7b713ee328c2f4a5e9b97355601e"}, "config": {"enabled": false, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": ["fivetran_validations"], "meta": {}, "group": null, "static_analysis": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "sql_header": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": ["fivetran_validations"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"tags": "fivetran_validations", "enabled": "var('fivetran_validation_tests_enabled', False)"}, "created_at": 1789079003.1927247, "relation_name": null, "raw_code": "{{ config(\n tags=\"fivetran_validations\",\n enabled=var('fivetran_validation_tests_enabled', false)\n) }}\n\n{% set exclude_cols = var('consistency_test_exclude_metrics', []) %}\n{% set fields = dbt_utils.star(from=ref('iterable__list_user_history'), except=exclude_cols) %}\n\n-- this test ensures the iterable__list_user_history end model matches the prior version\nwith prod as (\n select {{ fields }}\n from {{ target.schema }}_iterable_prod.iterable__list_user_history\n),\n\ndev as (\n select {{ fields }}\n from {{ target.schema }}_iterable_dev.iterable__list_user_history\n),\n\nprod_not_in_dev as (\n -- rows from prod not found in dev\n select * from prod\n except distinct\n select * from dev\n),\n\ndev_not_in_prod as (\n -- rows from dev not found in prod\n select * from dev\n except distinct\n select * from prod\n),\n\nfinal as (\n select\n *,\n 'from prod' as source\n from prod_not_in_dev\n\n union all -- union since we only care if rows are produced\n\n select\n *,\n 'from dev' as source\n from dev_not_in_prod\n)\n\nselect *\nfrom final", "doc_blocks": [], "language": "sql", "refs": [{"name": "iterable__list_user_history", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt_utils.star"], "nodes": []}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}}], "test.iterable_integration_tests.consistency_users": [{"database": "postgres", "schema": "public_dbt_test__audit", "name": "consistency_users", "resource_type": "test", "package_name": "iterable_integration_tests", "path": "consistency/consistency_users.sql", "original_file_path": "tests/consistency/consistency_users.sql", "unique_id": "test.iterable_integration_tests.consistency_users", "fqn": ["iterable_integration_tests", "consistency", "consistency_users"], "alias": "consistency_users", "checksum": {"name": "sha256", "checksum": "d367ccd8f7d79248da78ce29fc8f08876913df08b89866895cce315f46ef81e3"}, "config": {"enabled": false, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": ["fivetran_validations"], "meta": {}, "group": null, "static_analysis": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "sql_header": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": ["fivetran_validations"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"tags": "fivetran_validations", "enabled": "var('fivetran_validation_tests_enabled', False)"}, "created_at": 1789079003.1975255, "relation_name": null, "raw_code": "{{ config(\n tags=\"fivetran_validations\",\n enabled=var('fivetran_validation_tests_enabled', false)\n) }}\n\n{% set exclude_cols = var('consistency_test_exclude_metrics', []) %}\n{% set fields = dbt_utils.star(from=ref('iterable__users'), except=exclude_cols) %}\n\n-- this test ensures the iterable__users end model matches the prior version\nwith prod as (\n select {{ fields }}\n from {{ target.schema }}_iterable_prod.iterable__users\n where date(updated_at) < date({{ dbt.current_timestamp() }})\n),\n\ndev as (\n select {{ fields }}\n from {{ target.schema }}_iterable_dev.iterable__users\n where date(updated_at) < date({{ dbt.current_timestamp() }})\n),\n\nprod_not_in_dev as (\n -- rows from prod not found in dev\n select * from prod\n except distinct\n select * from dev\n),\n\ndev_not_in_prod as (\n -- rows from dev not found in prod\n select * from dev\n except distinct\n select * from prod\n),\n\nfinal as (\n select\n *,\n 'from prod' as source\n from prod_not_in_dev\n\n union all -- union since we only care if rows are produced\n\n select\n *,\n 'from dev' as source\n from dev_not_in_prod\n)\n\nselect *\nfrom final", "doc_blocks": [], "language": "sql", "refs": [{"name": "iterable__users", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt_utils.star", "macro.dbt.current_timestamp"], "nodes": []}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}}], "test.iterable_integration_tests.consistency_user_unsubscribes_pre_aug_2023": [{"database": "postgres", "schema": "public_dbt_test__audit", "name": "consistency_user_unsubscribes_pre_aug_2023", "resource_type": "test", "package_name": "iterable_integration_tests", "path": "consistency/consistency_user_unsubscribes_pre_aug_2023.sql", "original_file_path": "tests/consistency/consistency_user_unsubscribes_pre_aug_2023.sql", "unique_id": "test.iterable_integration_tests.consistency_user_unsubscribes_pre_aug_2023", "fqn": ["iterable_integration_tests", "consistency", "consistency_user_unsubscribes_pre_aug_2023"], "alias": "consistency_user_unsubscribes_pre_aug_2023", "checksum": {"name": "sha256", "checksum": "0d85b35d94066e59119f57fbe930a19353dfbb79b4e812b54de9c19520a58402"}, "config": {"enabled": false, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": ["fivetran_validations"], "meta": {}, "group": null, "static_analysis": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "sql_header": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": ["fivetran_validations"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"tags": "fivetran_validations", "enabled": "var('fivetran_validation_tests_enabled', False)"}, "created_at": 1789079003.2030814, "relation_name": null, "raw_code": "-- These validation tests were designed to work with the pre-August 2023 version of the Iterable connector.\n-- You will thus need to comment out `iterable_user_unsubscribed_channel_identifier` and `iterable_user_unsubscribed_message_type_identifier` in the `integration_tests/dbt_project.yml` to run and validate these tests. \n\n{{ config(\n tags=\"fivetran_validations\",\n enabled=var('fivetran_validation_tests_enabled', false)\n) }}\n\n\nwith prod as (\n\n select \n unique_user_key, \n coalesce(count(distinct unique_user_key), 0) as unique_user_records_prod, \n coalesce(count(distinct channel_id), 0) as channels_prod, \n coalesce(count(distinct message_type_id), 0) as message_types_prod\n from {{ target.schema }}_iterable_prod.iterable__user_unsubscriptions\n where channel_id is not null\n and message_type_id is not null\n group by 1\n),\n\ndev as (\n\n select \n unique_user_key, \n coalesce(count(distinct unique_user_key), 0) as unique_user_records_dev, \n coalesce(count(distinct channel_id), 0) as channels_dev, \n coalesce(count(distinct message_type_id), 0) as message_types_dev\n from {{ target.schema }}_iterable_dev.iterable__user_unsubscriptions\n where channel_id is not null\n and message_type_id is not null\n group by 1\n),\n\nfinal as (\n\n select \n prod.unique_user_key,\n unique_user_records_prod,\n unique_user_records_dev,\n channels_prod,\n channels_dev,\n message_types_prod,\n message_types_dev\n from prod\n full outer join dev\n on prod.unique_user_key = dev.unique_user_key\n) \n\nselect *\nfrom final\nwhere unique_user_records_prod != unique_user_records_dev\n and channels_prod != channels_dev \n and message_types_prod != message_types_dev", "doc_blocks": [], "language": "sql", "refs": [], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": [], "nodes": []}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}}], "test.iterable_integration_tests.consistency_user_campaign": [{"database": "postgres", "schema": "public_dbt_test__audit", "name": "consistency_user_campaign", "resource_type": "test", "package_name": "iterable_integration_tests", "path": "consistency/consistency_user_campaign.sql", "original_file_path": "tests/consistency/consistency_user_campaign.sql", "unique_id": "test.iterable_integration_tests.consistency_user_campaign", "fqn": ["iterable_integration_tests", "consistency", "consistency_user_campaign"], "alias": "consistency_user_campaign", "checksum": {"name": "sha256", "checksum": "8663f2c250688a8303d2ef38dc723e2fc62d996396b4b07e13c05feeb48cd97c"}, "config": {"enabled": false, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": ["fivetran_validations"], "meta": {}, "group": null, "static_analysis": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "sql_header": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": ["fivetran_validations"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"tags": "fivetran_validations", "enabled": "var('fivetran_validation_tests_enabled', False)"}, "created_at": 1789079003.2065723, "relation_name": null, "raw_code": "{{ config(\n tags=\"fivetran_validations\",\n enabled=var('fivetran_validation_tests_enabled', false)\n) }}\n\n{% set exclude_cols = var('consistency_test_exclude_metrics', []) %}\n{% set fields = dbt_utils.star(from=ref('iterable__user_campaign'), except=exclude_cols) %}\n\n-- this test ensures the iterable__user_campaign end model matches the prior version\nwith prod as (\n select {{ fields }}\n from {{ target.schema }}_iterable_prod.iterable__user_campaign\n where date(first_event_at) < date({{ dbt.current_timestamp() }})\n),\n\ndev as (\n select {{ fields }}\n from {{ target.schema }}_iterable_dev.iterable__user_campaign\n where date(first_event_at) < date({{ dbt.current_timestamp() }})\n),\n\nprod_not_in_dev as (\n -- rows from prod not found in dev\n select * from prod\n except distinct\n select * from dev\n),\n\ndev_not_in_prod as (\n -- rows from dev not found in prod\n select * from dev\n except distinct\n select * from prod\n),\n\nfinal as (\n select\n *,\n 'from prod' as source\n from prod_not_in_dev\n\n union all -- union since we only care if rows are produced\n\n select\n *,\n 'from dev' as source\n from dev_not_in_prod\n)\n\nselect *\nfrom final", "doc_blocks": [], "language": "sql", "refs": [{"name": "iterable__user_campaign", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt_utils.star", "macro.dbt.current_timestamp"], "nodes": []}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}}], "test.iterable_integration_tests.consistency_events": [{"database": "postgres", "schema": "public_dbt_test__audit", "name": "consistency_events", "resource_type": "test", "package_name": "iterable_integration_tests", "path": "consistency/consistency_events.sql", "original_file_path": "tests/consistency/consistency_events.sql", "unique_id": "test.iterable_integration_tests.consistency_events", "fqn": ["iterable_integration_tests", "consistency", "consistency_events"], "alias": "consistency_events", "checksum": {"name": "sha256", "checksum": "6e82de77a605ca7613eb3563f2158ad172785552d38cbf3617136a816c073b36"}, "config": {"enabled": false, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": ["fivetran_validations"], "meta": {}, "group": null, "static_analysis": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "sql_header": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": ["fivetran_validations"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"tags": "fivetran_validations", "enabled": "var('fivetran_validation_tests_enabled', False)"}, "created_at": 1789079003.2119424, "relation_name": null, "raw_code": "{{ config(\n tags=\"fivetran_validations\",\n enabled=var('fivetran_validation_tests_enabled', false)\n) }}\n\n-- exclude JSON fields\n{% set exclude_cols = ['additional_properties', 'transactional_data'] + var('consistency_test_exclude_metrics', []) %}\n{% set fields = dbt_utils.star(from=ref('iterable__events'), except=exclude_cols) %}\n\n-- this test ensures the iterable__events end model matches the prior version\nwith prod as (\n select {{ fields }}\n from {{ target.schema }}_iterable_prod.iterable__events\n where date(created_at) < date({{ dbt.current_timestamp() }})\n),\n\ndev as (\n select {{ fields }}\n from {{ target.schema }}_iterable_dev.iterable__events\n where date(created_at) < date({{ dbt.current_timestamp() }})\n),\n\nprod_not_in_dev as (\n -- rows from prod not found in dev\n select * from prod\n except distinct\n select * from dev\n),\n\ndev_not_in_prod as (\n -- rows from dev not found in prod\n select * from dev\n except distinct\n select * from prod\n),\n\nfinal as (\n select\n *,\n 'from prod' as source\n from prod_not_in_dev\n\n union all -- union since we only care if rows are produced\n\n select\n *,\n 'from dev' as source\n from dev_not_in_prod\n)\n\nselect *\nfrom final", "doc_blocks": [], "language": "sql", "refs": [{"name": "iterable__events", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt_utils.star", "macro.dbt.current_timestamp"], "nodes": []}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}}], "test.iterable_integration_tests.consistency_journeys": [{"database": "postgres", "schema": "public_dbt_test__audit", "name": "consistency_journeys", "resource_type": "test", "package_name": "iterable_integration_tests", "path": "consistency/consistency_journeys.sql", "original_file_path": "tests/consistency/consistency_journeys.sql", "unique_id": "test.iterable_integration_tests.consistency_journeys", "fqn": ["iterable_integration_tests", "consistency", "consistency_journeys"], "alias": "consistency_journeys", "checksum": {"name": "sha256", "checksum": "93a73b2e7e1d608a1116fddcec932e15ce18a57fb099872a13b4f97ca006d18f"}, "config": {"enabled": false, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": ["fivetran_validations"], "meta": {}, "group": null, "static_analysis": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "sql_header": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": ["fivetran_validations"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"tags": "fivetran_validations", "enabled": "var('fivetran_validation_tests_enabled', False)"}, "created_at": 1789079003.2183816, "relation_name": null, "raw_code": "{{ config(\n tags=\"fivetran_validations\",\n enabled=var('fivetran_validation_tests_enabled', false)\n) }}\n\n{% set exclude_cols = ['trigger_event_names'] + var('consistency_test_exclude_metrics', []) %}\n{% set fields = dbt_utils.star(from=ref('iterable__journeys'), except=exclude_cols) %}\n\n-- this test ensures the iterable__journeys end model matches the prior version\nwith prod as (\n select {{ fields }}\n from {{ target.schema }}_iterable_prod.iterable__journeys\n where date(updated_at) < date({{ dbt.current_timestamp() }})\n),\n\ndev as (\n select {{ fields }}\n from {{ target.schema }}_iterable_dev.iterable__journeys\n where date(updated_at) < date({{ dbt.current_timestamp() }})\n),\n\nprod_not_in_dev as (\n -- rows from prod not found in dev\n select * from prod\n except distinct\n select * from dev\n),\n\ndev_not_in_prod as (\n -- rows from dev not found in prod\n select * from dev\n except distinct\n select * from prod\n),\n\nfinal as (\n select\n *,\n 'from prod' as source\n from prod_not_in_dev\n\n union all -- union since we only care if rows are produced\n\n select\n *,\n 'from dev' as source\n from dev_not_in_prod\n)\n\nselect *\nfrom final", "doc_blocks": [], "language": "sql", "refs": [{"name": "iterable__journeys", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt_utils.star", "macro.dbt.current_timestamp"], "nodes": []}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}}], "test.iterable_integration_tests.user_unsubscribe_count_match_pre_aug_2023": [{"database": "postgres", "schema": "public_dbt_test__audit", "name": "user_unsubscribe_count_match_pre_aug_2023", "resource_type": "test", "package_name": "iterable_integration_tests", "path": "integrity/user_unsubscribe_count_match_pre_aug_2023.sql", "original_file_path": "tests/integrity/user_unsubscribe_count_match_pre_aug_2023.sql", "unique_id": "test.iterable_integration_tests.user_unsubscribe_count_match_pre_aug_2023", "fqn": ["iterable_integration_tests", "integrity", "user_unsubscribe_count_match_pre_aug_2023"], "alias": "user_unsubscribe_count_match_pre_aug_2023", "checksum": {"name": "sha256", "checksum": "6b37518965460a9c0b7161808527fa4b6f240a6ead0827a3950705267ebd236f"}, "config": {"enabled": false, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": ["fivetran_validations"], "meta": {}, "group": null, "static_analysis": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "sql_header": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": ["fivetran_validations"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"tags": "fivetran_validations", "enabled": "var('fivetran_validation_tests_enabled', False)"}, "created_at": 1789079003.2240984, "relation_name": null, "raw_code": "-- These validation tests were designed to work with the pre-August 2023 version of the Iterable connector.\n-- You will thus need to comment out `iterable_user_unsubscribed_channel_identifier` and `iterable_user_unsubscribed_message_type_identifier` in the `integration_tests/dbt_project.yml` to run and validate these tests. \n\n{{ config(\n tags=\"fivetran_validations\",\n enabled=var('fivetran_validation_tests_enabled', false)\n) }}\n\nwith unsub_channels as (\n\n select \n unique_user_key, \n channel_id\n from {{ ref('stg_iterable__user_unsubscribed_channel') }}\n group by 1, 2\n),\n\nunsub_messages as (\n\n select \n unique_user_key, \n message_type_id\n from {{ ref('stg_iterable__user_unsub_message_type') }}\n group by 1, 2\n),\n\nchannel_message_combos as (\n\n select channel_id, message_type_id \n from {{ ref('stg_iterable__message_type') }}\n group by 1, 2\n),\n\nmessage_channel_unsubs as (\n\n select \n unsub_channels.unique_user_key as unique_user_key_source,\n channel_message_combos.channel_id as channel_source,\n channel_message_combos.message_type_id as message_type_source\n from unsub_channels \n inner join channel_message_combos\n on unsub_channels.channel_id = channel_message_combos.channel_id\n\n union all\n\n select \n unsub_messages.unique_user_key as unique_user_key_source,\n channel_message_combos.channel_id as channel_source,\n channel_message_combos.message_type_id as message_type_source\n from unsub_messages\n inner join channel_message_combos\n on unsub_messages.message_type_id = channel_message_combos.message_type_id\n\n),\n\nsource_counts as (\n\n select unique_user_key_source, channel_source, message_type_source, count(*) as source_count\n from message_channel_unsubs \n group by 1, 2, 3\n),\n\nend_model_counts as (\n\n select unique_user_key as unique_user_key_end, channel_id as channel_end, message_type_id as message_type_end, count(*) as end_count\n from {{ ref('iterable__user_unsubscriptions') }}\n group by 1, 2, 3 \n)\n\nselect * \nfrom source_counts\ninner join end_model_counts \n on source_counts.unique_user_key_source = end_model_counts.unique_user_key_end\nwhere source_counts.channel_source = end_model_counts.channel_end\n and source_counts.message_type_source = end_model_counts.message_type_end\n and source_counts.source_count != end_model_counts.end_count", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__user_unsubscribed_channel", "package": null, "version": null}, {"name": "stg_iterable__user_unsub_message_type", "package": null, "version": null}, {"name": "stg_iterable__message_type", "package": null, "version": null}, {"name": "iterable__user_unsubscriptions", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": [], "nodes": []}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}}], "model.iterable.int_iterable__custom_events": [{"database": "postgres", "schema": "public_iterable_dev", "name": "int_iterable__custom_events", "resource_type": "model", "package_name": "iterable", "path": "intermediate/int_iterable__custom_events.sql", "original_file_path": "models/intermediate/int_iterable__custom_events.sql", "unique_id": "model.iterable.int_iterable__custom_events", "fqn": ["iterable", "intermediate", "int_iterable__custom_events"], "alias": "int_iterable__custom_events", "checksum": {"name": "sha256", "checksum": "0f0f1330b62dd5a320f37f7e30dae86a90c57e07c135369a259cfcba61875a16"}, "config": {"enabled": false, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "incremental", "incremental_strategy": "merge", "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": "event_id", "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}, "file_format": "delta"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"materialized": "incremental", "schema": "iterable_{{ var('directed_schema','dev') }}", "unique_key": "event_id", "incremental_strategy": "merge", "file_format": "delta", "enabled": "False", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789079003.6617742, "relation_name": "\"postgres\".\"public_iterable_dev\".\"int_iterable__custom_events\"", "raw_code": "{{\n config(\n materialized='incremental',\n unique_key='event_id',\n incremental_strategy = 'merge',\n file_format = 'delta',\n enabled=false\n )\n}}\n\n-- leave this alone for now....setting enabled to false\nwith events as (\n\n select *\n from {{ ref('stg_iterable__event') }}\n\n where lower(event_name) = 'customevent'\n {% if is_incremental() %}\n and updated_at > ( select max(updated_at) from {{ this }} )\n {% endif %}\n\n), custom_events as (\n\n select \n events.*\n {# {{ dbt.split_part(string_text='additional_properties', delimiter_text=' : \"{', part_number=1) }} #}\n\n {% if target.type == 'snowflake' %}\n ,\n additional_properties.key as custom_event_name,\n additional_properties.value as custom_event_metadata\n {% endif %}\n from events\n\n \n {% if target.type == 'snowflake' %}\n cross join \n table(flatten(additional_properties)) as additional_properties\n where additional_properties.key != '_id'\n {% endif %}\n)\n\nselect *\nfrom custom_events", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__event", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.is_incremental"], "nodes": []}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}]}, "parent_map": {"seed.iterable_integration_tests.campaign_metrics_data": [], "seed.iterable_integration_tests.campaign_list_history_data": [], "seed.iterable_integration_tests.user_unsubscribed_message_type_history_data": [], "seed.iterable_integration_tests.user_unsubscribed_channel_history_data": [], "seed.iterable_integration_tests.campaign_suppression_list_history_data": [], "seed.iterable_integration_tests.channel_data": [], "seed.iterable_integration_tests.template_history_data": [], "seed.iterable_integration_tests.message_type_data": [], "seed.iterable_integration_tests.event_data": [], "seed.iterable_integration_tests.list_user_data": [], "seed.iterable_integration_tests.user_history_bq_json_data": [], "seed.iterable_integration_tests.user_unsubscribed_message_type_data": [], "seed.iterable_integration_tests.journey_data": [], "seed.iterable_integration_tests.campaign_history_data": [], "seed.iterable_integration_tests.list_data": [], "seed.iterable_integration_tests.event_extension_data": [], "seed.iterable_integration_tests.user_unsubscribed_channel_data": [], "seed.iterable_integration_tests.campaign_label_history_data": [], "seed.iterable_integration_tests.user_history_data": [], "model.iterable.iterable__users": ["model.iterable.int_iterable__list_user_unnest", "model.iterable.int_iterable__user_event_metrics", "model.iterable.stg_iterable__list_user"], "model.iterable.iterable__list_user_history": ["model.iterable.int_iterable__list_user_unnest", "model.iterable.stg_iterable__list", "model.iterable.stg_iterable__list_user"], "model.iterable.iterable__events": ["model.iterable.int_iterable__latest_template", "model.iterable.int_iterable__latest_user", "model.iterable.int_iterable__message_type_channel", "model.iterable.int_iterable__recurring_campaigns", "model.iterable.stg_iterable__event", "model.iterable.stg_iterable__event_extension"], "model.iterable.iterable__user_campaign": ["model.iterable.iterable__events"], "model.iterable.iterable__user_unsubscriptions": ["model.iterable.int_iterable__message_type_channel", "model.iterable.stg_iterable__user_unsub_message_type", "model.iterable.stg_iterable__user_unsubscribed_channel"], "model.iterable.iterable__journeys": ["model.iterable.int_iterable__journey_event_metrics", "model.iterable.stg_iterable__journey"], "model.iterable.iterable__campaigns": ["model.iterable.int_iterable__campaign_event_metrics", "model.iterable.int_iterable__campaign_labels", "model.iterable.int_iterable__campaign_lists", "model.iterable.int_iterable__latest_template", "model.iterable.int_iterable__recurring_campaigns", "model.iterable.stg_iterable__journey"], "model.iterable.int_iterable__campaign_labels": ["model.iterable.stg_iterable__campaign_label_history"], "model.iterable.int_iterable__journey_event_metrics": ["model.iterable.int_iterable__recurring_campaigns", "model.iterable.iterable__user_campaign"], "model.iterable.int_iterable__list_user_unnest": ["model.iterable.int_iterable__list_user_history"], "model.iterable.int_iterable__latest_template": ["model.iterable.int_iterable__message_type_channel", "model.iterable.stg_iterable__template_history"], "model.iterable.int_iterable__campaign_event_metrics": ["model.iterable.iterable__user_campaign"], "model.iterable.int_iterable__campaign_lists": ["model.iterable.stg_iterable__campaign_list_history", "model.iterable.stg_iterable__campaign_suppression_list_history"], "model.iterable.int_iterable__recurring_campaigns": ["model.iterable.int_iterable__latest_campaign"], "model.iterable.int_iterable__list_user_history": ["model.iterable.stg_iterable__user_history"], "model.iterable.int_iterable__message_type_channel": ["model.iterable.stg_iterable__channel", "model.iterable.stg_iterable__message_type"], "model.iterable.int_iterable__user_event_metrics": ["model.iterable.iterable__user_campaign"], "model.iterable.int_iterable__latest_user": ["model.iterable.stg_iterable__user_history"], "model.iterable.int_iterable__latest_campaign": ["model.iterable.stg_iterable__campaign_history"], "model.iterable.stg_iterable__message_type": ["model.iterable.stg_iterable__message_type_tmp"], "model.iterable.stg_iterable__event": ["model.iterable.stg_iterable__event_tmp"], "model.iterable.stg_iterable__user_unsubscribed_channel": ["model.iterable.stg_iterable__user_unsubscribed_channel_tmp"], "model.iterable.stg_iterable__campaign_history": ["model.iterable.stg_iterable__campaign_history_tmp"], "model.iterable.stg_iterable__campaign_label_history": ["model.iterable.stg_iterable__campaign_label_history_tmp"], "model.iterable.stg_iterable__template_history": ["model.iterable.stg_iterable__template_history_tmp"], "model.iterable.stg_iterable__journey": ["model.iterable.stg_iterable__journey_tmp"], "model.iterable.stg_iterable__user_history": ["model.iterable.stg_iterable__user_history_tmp"], "model.iterable.stg_iterable__user_unsub_message_type": ["model.iterable.stg_iterable__user_unsub_message_type_tmp"], "model.iterable.stg_iterable__list": ["model.iterable.stg_iterable__list_tmp"], "model.iterable.stg_iterable__list_user": ["model.iterable.stg_iterable__list_user_tmp"], "model.iterable.stg_iterable__campaign_suppression_list_history": ["model.iterable.stg_iterable__campaign_suppression_list_history_tmp"], "model.iterable.stg_iterable__event_extension": ["model.iterable.stg_iterable__event_extension_tmp"], "model.iterable.stg_iterable__campaign_list_history": ["model.iterable.stg_iterable__campaign_list_history_tmp"], "model.iterable.stg_iterable__channel": ["model.iterable.stg_iterable__channel_tmp"], "model.iterable.stg_iterable__message_type_tmp": ["source.iterable.iterable.message_type"], "model.iterable.stg_iterable__event_extension_tmp": ["source.iterable.iterable.event_extension"], "model.iterable.stg_iterable__user_unsub_message_type_tmp": ["source.iterable.iterable.user_unsubscribed_message_type_history"], "model.iterable.stg_iterable__campaign_list_history_tmp": ["source.iterable.iterable.campaign_list_history"], "model.iterable.stg_iterable__list_user_tmp": ["source.iterable.iterable.list_user"], "model.iterable.stg_iterable__user_history_tmp": ["source.iterable.iterable.user_history"], "model.iterable.stg_iterable__campaign_history_tmp": ["source.iterable.iterable.campaign_history"], "model.iterable.stg_iterable__template_history_tmp": ["source.iterable.iterable.template_history"], "model.iterable.stg_iterable__event_tmp": ["source.iterable.iterable.event"], "model.iterable.stg_iterable__journey_tmp": ["source.iterable.iterable.journey"], "model.iterable.stg_iterable__campaign_suppression_list_history_tmp": ["source.iterable.iterable.campaign_suppression_list_history"], "model.iterable.stg_iterable__campaign_label_history_tmp": ["source.iterable.iterable.campaign_label_history"], "model.iterable.stg_iterable__list_tmp": ["source.iterable.iterable.list"], "model.iterable.stg_iterable__channel_tmp": ["source.iterable.iterable.channel"], "model.iterable.stg_iterable__user_unsubscribed_channel_tmp": ["source.iterable.iterable.user_unsubscribed_channel_history"], "test.iterable.not_null_iterable__campaigns_campaign_id.03c9448919": ["model.iterable.iterable__campaigns"], "test.iterable.not_null_iterable__events_event_id.ed1d28a650": ["model.iterable.iterable__events"], "test.iterable.not_null_iterable__journeys_journey_id.b5c6b8783a": ["model.iterable.iterable__journeys"], "test.iterable.unique_iterable__journeys_unique_journey_id.ba86841246": ["model.iterable.iterable__journeys"], "test.iterable.not_null_iterable__user_unsubscriptions_unique_user_key.f8db72932b": ["model.iterable.iterable__user_unsubscriptions"], "test.iterable.not_null_iterable__users_unique_user_key.4ca37a26c8": ["model.iterable.iterable__users"], "test.iterable.not_null_stg_iterable__campaign_history_campaign_id.b7c36e4525": ["model.iterable.stg_iterable__campaign_history"], "test.iterable.not_null_stg_iterable__campaign_label_history_campaign_id.1918cef89a": ["model.iterable.stg_iterable__campaign_label_history"], "test.iterable.not_null_stg_iterable__campaign_list_history_campaign_id.208f9bf9ed": ["model.iterable.stg_iterable__campaign_list_history"], "test.iterable.not_null_stg_iterable__campaign_suppression_list_history_campaign_id.3921289710": ["model.iterable.stg_iterable__campaign_suppression_list_history"], "test.iterable.not_null_stg_iterable__channel_channel_id.182ceb9636": ["model.iterable.stg_iterable__channel"], "test.iterable.not_null_stg_iterable__event_event_id.370cd4bc9d": ["model.iterable.stg_iterable__event"], "test.iterable.not_null_stg_iterable__event_unique_event_id.e2b46d3bb6": ["model.iterable.stg_iterable__event"], "test.iterable.not_null_stg_iterable__event_extension_event_id.144dedcd30": ["model.iterable.stg_iterable__event_extension"], "test.iterable.not_null_stg_iterable__journey_journey_id.cc38bd633c": ["model.iterable.stg_iterable__journey"], "test.iterable.not_null_stg_iterable__list_list_id.47029d839a": ["model.iterable.stg_iterable__list"], "test.iterable.not_null_stg_iterable__message_type_message_type_id.75eaa6fa62": ["model.iterable.stg_iterable__message_type"], "test.iterable.not_null_stg_iterable__template_history_template_id.14b24a1dfe": ["model.iterable.stg_iterable__template_history"], "test.iterable.not_null_stg_iterable__list_user__fivetran_user_id.cca4b34c07": ["model.iterable.stg_iterable__list_user"], "test.iterable.not_null_stg_iterable__user_history_unique_user_key.2845af2127": ["model.iterable.stg_iterable__user_history"], "test.iterable.not_null_stg_iterable__user_unsubscribed_channel_channel_id.da0ed9e9be": ["model.iterable.stg_iterable__user_unsubscribed_channel"], "test.iterable.not_null_stg_iterable__user_unsub_message_type_message_type_id.268a89ea6f": ["model.iterable.stg_iterable__user_unsub_message_type"], "source.iterable.iterable.campaign_history": [], "source.iterable.iterable.campaign_label_history": [], "source.iterable.iterable.campaign_list_history": [], "source.iterable.iterable.campaign_suppression_list_history": [], "source.iterable.iterable.channel": [], "source.iterable.iterable.event": [], "source.iterable.iterable.event_extension": [], "source.iterable.iterable.journey": [], "source.iterable.iterable.list": [], "source.iterable.iterable.message_type": [], "source.iterable.iterable.template_history": [], "source.iterable.iterable.user_history": [], "source.iterable.iterable.user_unsubscribed_channel": [], "source.iterable.iterable.user_unsubscribed_message_type": [], "source.iterable.iterable.user_unsubscribed_channel_history": [], "source.iterable.iterable.user_unsubscribed_message_type_history": [], "source.iterable.iterable.list_user": []}, "child_map": {"seed.iterable_integration_tests.campaign_metrics_data": [], "seed.iterable_integration_tests.campaign_list_history_data": [], "seed.iterable_integration_tests.user_unsubscribed_message_type_history_data": [], "seed.iterable_integration_tests.user_unsubscribed_channel_history_data": [], "seed.iterable_integration_tests.campaign_suppression_list_history_data": [], "seed.iterable_integration_tests.channel_data": [], "seed.iterable_integration_tests.template_history_data": [], "seed.iterable_integration_tests.message_type_data": [], "seed.iterable_integration_tests.event_data": [], "seed.iterable_integration_tests.list_user_data": [], "seed.iterable_integration_tests.user_history_bq_json_data": [], "seed.iterable_integration_tests.user_unsubscribed_message_type_data": [], "seed.iterable_integration_tests.journey_data": [], "seed.iterable_integration_tests.campaign_history_data": [], "seed.iterable_integration_tests.list_data": [], "seed.iterable_integration_tests.event_extension_data": [], "seed.iterable_integration_tests.user_unsubscribed_channel_data": [], "seed.iterable_integration_tests.campaign_label_history_data": [], "seed.iterable_integration_tests.user_history_data": [], "model.iterable.iterable__users": ["test.iterable.not_null_iterable__users_unique_user_key.4ca37a26c8"], "model.iterable.iterable__list_user_history": [], "model.iterable.iterable__events": ["model.iterable.iterable__user_campaign", "test.iterable.not_null_iterable__events_event_id.ed1d28a650"], "model.iterable.iterable__user_campaign": ["model.iterable.int_iterable__campaign_event_metrics", "model.iterable.int_iterable__journey_event_metrics", "model.iterable.int_iterable__user_event_metrics"], "model.iterable.iterable__user_unsubscriptions": ["test.iterable.not_null_iterable__user_unsubscriptions_unique_user_key.f8db72932b"], "model.iterable.iterable__journeys": ["test.iterable.not_null_iterable__journeys_journey_id.b5c6b8783a", "test.iterable.unique_iterable__journeys_unique_journey_id.ba86841246"], "model.iterable.iterable__campaigns": ["test.iterable.not_null_iterable__campaigns_campaign_id.03c9448919"], "model.iterable.int_iterable__campaign_labels": ["model.iterable.iterable__campaigns"], "model.iterable.int_iterable__journey_event_metrics": ["model.iterable.iterable__journeys"], "model.iterable.int_iterable__list_user_unnest": ["model.iterable.iterable__list_user_history", "model.iterable.iterable__users"], "model.iterable.int_iterable__latest_template": ["model.iterable.iterable__campaigns", "model.iterable.iterable__events"], "model.iterable.int_iterable__campaign_event_metrics": ["model.iterable.iterable__campaigns"], "model.iterable.int_iterable__campaign_lists": ["model.iterable.iterable__campaigns"], "model.iterable.int_iterable__recurring_campaigns": ["model.iterable.int_iterable__journey_event_metrics", "model.iterable.iterable__campaigns", "model.iterable.iterable__events"], "model.iterable.int_iterable__list_user_history": ["model.iterable.int_iterable__list_user_unnest"], "model.iterable.int_iterable__message_type_channel": ["model.iterable.int_iterable__latest_template", "model.iterable.iterable__events", "model.iterable.iterable__user_unsubscriptions"], "model.iterable.int_iterable__user_event_metrics": ["model.iterable.iterable__users"], "model.iterable.int_iterable__latest_user": ["model.iterable.iterable__events"], "model.iterable.int_iterable__latest_campaign": ["model.iterable.int_iterable__recurring_campaigns"], "model.iterable.stg_iterable__message_type": ["model.iterable.int_iterable__message_type_channel", "test.iterable.not_null_stg_iterable__message_type_message_type_id.75eaa6fa62"], "model.iterable.stg_iterable__event": ["model.iterable.iterable__events", "test.iterable.not_null_stg_iterable__event_event_id.370cd4bc9d", "test.iterable.not_null_stg_iterable__event_unique_event_id.e2b46d3bb6"], "model.iterable.stg_iterable__user_unsubscribed_channel": ["model.iterable.iterable__user_unsubscriptions", "test.iterable.not_null_stg_iterable__user_unsubscribed_channel_channel_id.da0ed9e9be"], "model.iterable.stg_iterable__campaign_history": ["model.iterable.int_iterable__latest_campaign", "test.iterable.not_null_stg_iterable__campaign_history_campaign_id.b7c36e4525"], "model.iterable.stg_iterable__campaign_label_history": ["model.iterable.int_iterable__campaign_labels", "test.iterable.not_null_stg_iterable__campaign_label_history_campaign_id.1918cef89a"], "model.iterable.stg_iterable__template_history": ["model.iterable.int_iterable__latest_template", "test.iterable.not_null_stg_iterable__template_history_template_id.14b24a1dfe"], "model.iterable.stg_iterable__journey": ["model.iterable.iterable__campaigns", "model.iterable.iterable__journeys", "test.iterable.not_null_stg_iterable__journey_journey_id.cc38bd633c"], "model.iterable.stg_iterable__user_history": ["model.iterable.int_iterable__latest_user", "model.iterable.int_iterable__list_user_history", "test.iterable.not_null_stg_iterable__user_history_unique_user_key.2845af2127"], "model.iterable.stg_iterable__user_unsub_message_type": ["model.iterable.iterable__user_unsubscriptions", "test.iterable.not_null_stg_iterable__user_unsub_message_type_message_type_id.268a89ea6f"], "model.iterable.stg_iterable__list": ["model.iterable.iterable__list_user_history", "test.iterable.not_null_stg_iterable__list_list_id.47029d839a"], "model.iterable.stg_iterable__list_user": ["model.iterable.iterable__list_user_history", "model.iterable.iterable__users", "test.iterable.not_null_stg_iterable__list_user__fivetran_user_id.cca4b34c07"], "model.iterable.stg_iterable__campaign_suppression_list_history": ["model.iterable.int_iterable__campaign_lists", "test.iterable.not_null_stg_iterable__campaign_suppression_list_history_campaign_id.3921289710"], "model.iterable.stg_iterable__event_extension": ["model.iterable.iterable__events", "test.iterable.not_null_stg_iterable__event_extension_event_id.144dedcd30"], "model.iterable.stg_iterable__campaign_list_history": ["model.iterable.int_iterable__campaign_lists", "test.iterable.not_null_stg_iterable__campaign_list_history_campaign_id.208f9bf9ed"], "model.iterable.stg_iterable__channel": ["model.iterable.int_iterable__message_type_channel", "test.iterable.not_null_stg_iterable__channel_channel_id.182ceb9636"], "model.iterable.stg_iterable__message_type_tmp": ["model.iterable.stg_iterable__message_type"], "model.iterable.stg_iterable__event_extension_tmp": ["model.iterable.stg_iterable__event_extension"], "model.iterable.stg_iterable__user_unsub_message_type_tmp": ["model.iterable.stg_iterable__user_unsub_message_type"], "model.iterable.stg_iterable__campaign_list_history_tmp": ["model.iterable.stg_iterable__campaign_list_history"], "model.iterable.stg_iterable__list_user_tmp": ["model.iterable.stg_iterable__list_user"], "model.iterable.stg_iterable__user_history_tmp": ["model.iterable.stg_iterable__user_history"], "model.iterable.stg_iterable__campaign_history_tmp": ["model.iterable.stg_iterable__campaign_history"], "model.iterable.stg_iterable__template_history_tmp": ["model.iterable.stg_iterable__template_history"], "model.iterable.stg_iterable__event_tmp": ["model.iterable.stg_iterable__event"], "model.iterable.stg_iterable__journey_tmp": ["model.iterable.stg_iterable__journey"], "model.iterable.stg_iterable__campaign_suppression_list_history_tmp": ["model.iterable.stg_iterable__campaign_suppression_list_history"], "model.iterable.stg_iterable__campaign_label_history_tmp": ["model.iterable.stg_iterable__campaign_label_history"], "model.iterable.stg_iterable__list_tmp": ["model.iterable.stg_iterable__list"], "model.iterable.stg_iterable__channel_tmp": ["model.iterable.stg_iterable__channel"], "model.iterable.stg_iterable__user_unsubscribed_channel_tmp": ["model.iterable.stg_iterable__user_unsubscribed_channel"], "test.iterable.not_null_iterable__campaigns_campaign_id.03c9448919": [], "test.iterable.not_null_iterable__events_event_id.ed1d28a650": [], "test.iterable.not_null_iterable__journeys_journey_id.b5c6b8783a": [], "test.iterable.unique_iterable__journeys_unique_journey_id.ba86841246": [], "test.iterable.not_null_iterable__user_unsubscriptions_unique_user_key.f8db72932b": [], "test.iterable.not_null_iterable__users_unique_user_key.4ca37a26c8": [], "test.iterable.not_null_stg_iterable__campaign_history_campaign_id.b7c36e4525": [], "test.iterable.not_null_stg_iterable__campaign_label_history_campaign_id.1918cef89a": [], "test.iterable.not_null_stg_iterable__campaign_list_history_campaign_id.208f9bf9ed": [], "test.iterable.not_null_stg_iterable__campaign_suppression_list_history_campaign_id.3921289710": [], "test.iterable.not_null_stg_iterable__channel_channel_id.182ceb9636": [], "test.iterable.not_null_stg_iterable__event_event_id.370cd4bc9d": [], "test.iterable.not_null_stg_iterable__event_unique_event_id.e2b46d3bb6": [], "test.iterable.not_null_stg_iterable__event_extension_event_id.144dedcd30": [], "test.iterable.not_null_stg_iterable__journey_journey_id.cc38bd633c": [], "test.iterable.not_null_stg_iterable__list_list_id.47029d839a": [], "test.iterable.not_null_stg_iterable__message_type_message_type_id.75eaa6fa62": [], "test.iterable.not_null_stg_iterable__template_history_template_id.14b24a1dfe": [], "test.iterable.not_null_stg_iterable__list_user__fivetran_user_id.cca4b34c07": [], "test.iterable.not_null_stg_iterable__user_history_unique_user_key.2845af2127": [], "test.iterable.not_null_stg_iterable__user_unsubscribed_channel_channel_id.da0ed9e9be": [], "test.iterable.not_null_stg_iterable__user_unsub_message_type_message_type_id.268a89ea6f": [], "source.iterable.iterable.campaign_history": ["model.iterable.stg_iterable__campaign_history_tmp"], "source.iterable.iterable.campaign_label_history": ["model.iterable.stg_iterable__campaign_label_history_tmp"], "source.iterable.iterable.campaign_list_history": ["model.iterable.stg_iterable__campaign_list_history_tmp"], "source.iterable.iterable.campaign_suppression_list_history": ["model.iterable.stg_iterable__campaign_suppression_list_history_tmp"], "source.iterable.iterable.channel": ["model.iterable.stg_iterable__channel_tmp"], "source.iterable.iterable.event": ["model.iterable.stg_iterable__event_tmp"], "source.iterable.iterable.event_extension": ["model.iterable.stg_iterable__event_extension_tmp"], "source.iterable.iterable.journey": ["model.iterable.stg_iterable__journey_tmp"], "source.iterable.iterable.list": ["model.iterable.stg_iterable__list_tmp"], "source.iterable.iterable.message_type": ["model.iterable.stg_iterable__message_type_tmp"], "source.iterable.iterable.template_history": ["model.iterable.stg_iterable__template_history_tmp"], "source.iterable.iterable.user_history": ["model.iterable.stg_iterable__user_history_tmp"], "source.iterable.iterable.user_unsubscribed_channel": [], "source.iterable.iterable.user_unsubscribed_message_type": [], "source.iterable.iterable.user_unsubscribed_channel_history": ["model.iterable.stg_iterable__user_unsubscribed_channel_tmp"], "source.iterable.iterable.user_unsubscribed_message_type_history": ["model.iterable.stg_iterable__user_unsub_message_type_tmp"], "source.iterable.iterable.list_user": ["model.iterable.stg_iterable__list_user_tmp"]}, "group_map": {}, "saved_queries": {}, "semantic_models": {}, "unit_tests": {}, "functions": {}} \ No newline at end of file +{"metadata": {"dbt_schema_version": "https://schemas.getdbt.com/dbt/manifest/v12.json", "dbt_version": "1.12.4", "generated_at": "2026-09-14T21:06:20.431882Z", "invocation_id": "9ff5dbb1-4114-401f-b8d6-f22217b143f8", "invocation_started_at": "2026-09-14T21:06:08.871486+00:00", "env": {}, "project_name": "iterable_integration_tests", "project_id": "726648524a3768595307d45548dac26e", "user_id": null, "send_anonymous_usage_stats": false, "adapter_type": "postgres", "quoting": {"database": true, "schema": true, "identifier": true, "column": null}, "run_started_at": "2026-09-14T21:06:08.871810+00:00"}, "nodes": {"seed.iterable_integration_tests.campaign_metrics_data": {"database": "postgres", "schema": "public", "name": "campaign_metrics_data", "resource_type": "seed", "package_name": "iterable_integration_tests", "path": "campaign_metrics_data.csv", "original_file_path": "seeds/campaign_metrics_data.csv", "unique_id": "seed.iterable_integration_tests.campaign_metrics_data", "fqn": ["iterable_integration_tests", "campaign_metrics_data"], "alias": "campaign_metrics_data", "checksum": {"name": "sha256", "checksum": "45e8e7be3941e10f43112fac7bd78f0b6a63c070090062f65b2ffabe481b8c4e"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "seed", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": false, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "delimiter": ",", "quote_columns": false}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": false, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"docs": {"show": false}, "quote_columns": "{{ target.type == 'redshift' or var('fivetran_using_source_casing', false) }}"}, "created_at": 1789419971.401272, "relation_name": "\"postgres\".\"public\".\"campaign_metrics_data\"", "raw_code": "", "doc_blocks": [], "root_path": "/home/runner/work/dbt_iterable/dbt_iterable/integration_tests", "depends_on": {"macros": []}}, "seed.iterable_integration_tests.campaign_list_history_data": {"database": "postgres", "schema": "public", "name": "campaign_list_history_data", "resource_type": "seed", "package_name": "iterable_integration_tests", "path": "campaign_list_history_data.csv", "original_file_path": "seeds/campaign_list_history_data.csv", "unique_id": "seed.iterable_integration_tests.campaign_list_history_data", "fqn": ["iterable_integration_tests", "campaign_list_history_data"], "alias": "campaign_list_history_data", "checksum": {"name": "sha256", "checksum": "206581e614bf60f37345cbf1bd5e0cacac8a2f329a7dfc521b809c3e6d72e728"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "seed", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {"_fivetran_synced": "timestamp"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": false, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "delimiter": ",", "quote_columns": false}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": false, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"docs": {"show": false}, "quote_columns": "{{ target.type == 'redshift' or var('fivetran_using_source_casing', false) }}", "column_types": {"_fivetran_synced": "timestamp"}}, "created_at": 1789419971.40975, "relation_name": "\"postgres\".\"public\".\"campaign_list_history_data\"", "raw_code": "", "doc_blocks": [], "root_path": "/home/runner/work/dbt_iterable/dbt_iterable/integration_tests", "depends_on": {"macros": []}}, "seed.iterable_integration_tests.user_unsubscribed_message_type_history_data": {"database": "postgres", "schema": "public", "name": "user_unsubscribed_message_type_history_data", "resource_type": "seed", "package_name": "iterable_integration_tests", "path": "user_unsubscribed_message_type_history_data.csv", "original_file_path": "seeds/user_unsubscribed_message_type_history_data.csv", "unique_id": "seed.iterable_integration_tests.user_unsubscribed_message_type_history_data", "fqn": ["iterable_integration_tests", "user_unsubscribed_message_type_history_data"], "alias": "user_unsubscribed_message_type_history_data", "checksum": {"name": "sha256", "checksum": "1e6883673b9a6f44966d10891cece60a739773fadf44302ccf2aad5290222687"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "seed", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {"_fivetran_synced": "timestamp"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": false, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "delimiter": ",", "quote_columns": false}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": false, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"docs": {"show": false}, "quote_columns": "{{ target.type == 'redshift' or var('fivetran_using_source_casing', false) }}", "column_types": {"_fivetran_synced": "timestamp"}}, "created_at": 1789419971.4135346, "relation_name": "\"postgres\".\"public\".\"user_unsubscribed_message_type_history_data\"", "raw_code": "", "doc_blocks": [], "root_path": "/home/runner/work/dbt_iterable/dbt_iterable/integration_tests", "depends_on": {"macros": []}}, "seed.iterable_integration_tests.user_unsubscribed_channel_history_data": {"database": "postgres", "schema": "public", "name": "user_unsubscribed_channel_history_data", "resource_type": "seed", "package_name": "iterable_integration_tests", "path": "user_unsubscribed_channel_history_data.csv", "original_file_path": "seeds/user_unsubscribed_channel_history_data.csv", "unique_id": "seed.iterable_integration_tests.user_unsubscribed_channel_history_data", "fqn": ["iterable_integration_tests", "user_unsubscribed_channel_history_data"], "alias": "user_unsubscribed_channel_history_data", "checksum": {"name": "sha256", "checksum": "a1b532e561033f6ff137e5a1bde082263903493b763e9358a2a2ba151360e00e"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "seed", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {"channel_id": "bigint", "_fivetran_synced": "timestamp"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": false, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "delimiter": ",", "quote_columns": false}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": false, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"docs": {"show": false}, "quote_columns": "{{ target.type == 'redshift' or var('fivetran_using_source_casing', false) }}", "column_types": {"channel_id": "{%- if target.type == 'bigquery' -%} INT64 {%- else -%} bigint {%- endif -%}", "_fivetran_synced": "timestamp"}}, "created_at": 1789419971.417569, "relation_name": "\"postgres\".\"public\".\"user_unsubscribed_channel_history_data\"", "raw_code": "", "doc_blocks": [], "root_path": "/home/runner/work/dbt_iterable/dbt_iterable/integration_tests", "depends_on": {"macros": []}}, "seed.iterable_integration_tests.campaign_suppression_list_history_data": {"database": "postgres", "schema": "public", "name": "campaign_suppression_list_history_data", "resource_type": "seed", "package_name": "iterable_integration_tests", "path": "campaign_suppression_list_history_data.csv", "original_file_path": "seeds/campaign_suppression_list_history_data.csv", "unique_id": "seed.iterable_integration_tests.campaign_suppression_list_history_data", "fqn": ["iterable_integration_tests", "campaign_suppression_list_history_data"], "alias": "campaign_suppression_list_history_data", "checksum": {"name": "sha256", "checksum": "c9eaab0efe0e47ef695b57f71b41f23cf527c87610d7770be604e461fe7c9846"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "seed", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {"_fivetran_synced": "timestamp"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": false, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "delimiter": ",", "quote_columns": false}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": false, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"docs": {"show": false}, "quote_columns": "{{ target.type == 'redshift' or var('fivetran_using_source_casing', false) }}", "column_types": {"_fivetran_synced": "timestamp"}}, "created_at": 1789419971.421073, "relation_name": "\"postgres\".\"public\".\"campaign_suppression_list_history_data\"", "raw_code": "", "doc_blocks": [], "root_path": "/home/runner/work/dbt_iterable/dbt_iterable/integration_tests", "depends_on": {"macros": []}}, "seed.iterable_integration_tests.channel_data": {"database": "postgres", "schema": "public", "name": "channel_data", "resource_type": "seed", "package_name": "iterable_integration_tests", "path": "channel_data.csv", "original_file_path": "seeds/channel_data.csv", "unique_id": "seed.iterable_integration_tests.channel_data", "fqn": ["iterable_integration_tests", "channel_data"], "alias": "channel_data", "checksum": {"name": "sha256", "checksum": "a77e21fb127c0ff7fc652eb5ffc6b3559fde3d63c2c5291a68f10fefcc2fac37"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "seed", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {"id": "bigint", "_fivetran_synced": "timestamp"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": false, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "delimiter": ",", "quote_columns": false}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": false, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"docs": {"show": false}, "quote_columns": "{{ target.type == 'redshift' or var('fivetran_using_source_casing', false) }}", "column_types": {"id": "{%- if target.type == 'bigquery' -%} INT64 {%- else -%} bigint {%- endif -%}", "_fivetran_synced": "timestamp"}}, "created_at": 1789419971.4244945, "relation_name": "\"postgres\".\"public\".\"channel_data\"", "raw_code": "", "doc_blocks": [], "root_path": "/home/runner/work/dbt_iterable/dbt_iterable/integration_tests", "depends_on": {"macros": []}}, "seed.iterable_integration_tests.template_history_data": {"database": "postgres", "schema": "public", "name": "template_history_data", "resource_type": "seed", "package_name": "iterable_integration_tests", "path": "template_history_data.csv", "original_file_path": "seeds/template_history_data.csv", "unique_id": "seed.iterable_integration_tests.template_history_data", "fqn": ["iterable_integration_tests", "template_history_data"], "alias": "template_history_data", "checksum": {"name": "sha256", "checksum": "0f0c442398531afc5fb4c18f12f0d0f694eb3453cb09e0c6c48ba340b110f4a6"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "seed", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {"_fivetran_synced": "timestamp"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": false, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "delimiter": ",", "quote_columns": false}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": false, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"docs": {"show": false}, "quote_columns": "{{ target.type == 'redshift' or var('fivetran_using_source_casing', false) }}", "column_types": {"_fivetran_synced": "timestamp"}}, "created_at": 1789419971.427927, "relation_name": "\"postgres\".\"public\".\"template_history_data\"", "raw_code": "", "doc_blocks": [], "root_path": "/home/runner/work/dbt_iterable/dbt_iterable/integration_tests", "depends_on": {"macros": []}}, "seed.iterable_integration_tests.message_type_data": {"database": "postgres", "schema": "public", "name": "message_type_data", "resource_type": "seed", "package_name": "iterable_integration_tests", "path": "message_type_data.csv", "original_file_path": "seeds/message_type_data.csv", "unique_id": "seed.iterable_integration_tests.message_type_data", "fqn": ["iterable_integration_tests", "message_type_data"], "alias": "message_type_data", "checksum": {"name": "sha256", "checksum": "84228c8c4a13092ca90bdf9579856968f5265c49f456d01b8510834ae3520bce"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "seed", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {"id": "bigint", "channel_id": "bigint", "_fivetran_synced": "timestamp"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": false, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "delimiter": ",", "quote_columns": false}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": false, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"docs": {"show": false}, "quote_columns": "{{ target.type == 'redshift' or var('fivetran_using_source_casing', false) }}", "column_types": {"id": "{%- if target.type == 'bigquery' -%} INT64 {%- else -%} bigint {%- endif -%}", "channel_id": "{%- if target.type == 'bigquery' -%} INT64 {%- else -%} bigint {%- endif -%}", "_fivetran_synced": "timestamp"}}, "created_at": 1789419971.4314775, "relation_name": "\"postgres\".\"public\".\"message_type_data\"", "raw_code": "", "doc_blocks": [], "root_path": "/home/runner/work/dbt_iterable/dbt_iterable/integration_tests", "depends_on": {"macros": []}}, "seed.iterable_integration_tests.event_data": {"database": "postgres", "schema": "public", "name": "event_data", "resource_type": "seed", "package_name": "iterable_integration_tests", "path": "event_data.csv", "original_file_path": "seeds/event_data.csv", "unique_id": "seed.iterable_integration_tests.event_data", "fqn": ["iterable_integration_tests", "event_data"], "alias": "event_data", "checksum": {"name": "sha256", "checksum": "c886615b369d98135814bac7c4070be9d58b4aa6eb9a90a5caa5ddc4454ab0ed"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "seed", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {"transactional_data": "varchar(100)", "created_at": "timestamp", "_fivetran_synced": "timestamp"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": false, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "delimiter": ",", "quote_columns": false}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": false, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"docs": {"show": false}, "quote_columns": "{{ target.type == 'redshift' or var('fivetran_using_source_casing', false) }}", "column_types": {"transactional_data": "{{ 'varchar(100)' if target.type in ('redshift', 'postgres') else 'string'}}", "created_at": "timestamp", "_fivetran_synced": "timestamp"}}, "created_at": 1789419971.4349418, "relation_name": "\"postgres\".\"public\".\"event_data\"", "raw_code": "", "doc_blocks": [], "root_path": "/home/runner/work/dbt_iterable/dbt_iterable/integration_tests", "depends_on": {"macros": []}}, "seed.iterable_integration_tests.list_user_data": {"database": "postgres", "schema": "public", "name": "list_user_data", "resource_type": "seed", "package_name": "iterable_integration_tests", "path": "list_user_data.csv", "original_file_path": "seeds/list_user_data.csv", "unique_id": "seed.iterable_integration_tests.list_user_data", "fqn": ["iterable_integration_tests", "list_user_data"], "alias": "list_user_data", "checksum": {"name": "sha256", "checksum": "2dbd80b8fb4338602a543026ede3f5a0797c0a4cf13c4724a877bb60ac6a4793"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "seed", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {"list_id": "bigint", "index": "bigint", "_fivetran_synced": "timestamp"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": false, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "delimiter": ",", "quote_columns": false}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": false, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"docs": {"show": false}, "quote_columns": "{{ target.type == 'redshift' or var('fivetran_using_source_casing', false) }}", "column_types": {"list_id": "{%- if target.type == 'bigquery' -%} INT64 {%- else -%} bigint {%- endif -%}", "index": "{%- if target.type == 'bigquery' -%} INT64 {%- else -%} bigint {%- endif -%}", "_fivetran_synced": "timestamp"}}, "created_at": 1789419971.4384034, "relation_name": "\"postgres\".\"public\".\"list_user_data\"", "raw_code": "", "doc_blocks": [], "root_path": "/home/runner/work/dbt_iterable/dbt_iterable/integration_tests", "depends_on": {"macros": []}}, "seed.iterable_integration_tests.user_history_bq_json_data": {"database": "postgres", "schema": "public", "name": "user_history_bq_json_data", "resource_type": "seed", "package_name": "iterable_integration_tests", "path": "user_history_bq_json_data.csv", "original_file_path": "seeds/user_history_bq_json_data.csv", "unique_id": "seed.iterable_integration_tests.user_history_bq_json_data", "fqn": ["iterable_integration_tests", "user_history_bq_json_data"], "alias": "user_history_bq_json_data", "checksum": {"name": "sha256", "checksum": "d2689731ace45d1a5c13930bcc8b80f7b3a02993f8ee4c58bfcf754b734a5caa"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "seed", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": false, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "delimiter": ",", "quote_columns": false}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": false, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"docs": {"show": false}, "quote_columns": "{{ target.type == 'redshift' or var('fivetran_using_source_casing', false) }}"}, "created_at": 1789419971.441816, "relation_name": "\"postgres\".\"public\".\"user_history_bq_json_data\"", "raw_code": "", "doc_blocks": [], "root_path": "/home/runner/work/dbt_iterable/dbt_iterable/integration_tests", "depends_on": {"macros": []}}, "seed.iterable_integration_tests.user_unsubscribed_message_type_data": {"database": "postgres", "schema": "public", "name": "user_unsubscribed_message_type_data", "resource_type": "seed", "package_name": "iterable_integration_tests", "path": "user_unsubscribed_message_type_data.csv", "original_file_path": "seeds/user_unsubscribed_message_type_data.csv", "unique_id": "seed.iterable_integration_tests.user_unsubscribed_message_type_data", "fqn": ["iterable_integration_tests", "user_unsubscribed_message_type_data"], "alias": "user_unsubscribed_message_type_data", "checksum": {"name": "sha256", "checksum": "473f01110084e53b2115bd09606172cb87559359ccd66775f60209851bfdac12"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "seed", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {"_fivetran_synced": "timestamp"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": false, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "delimiter": ",", "quote_columns": false}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": false, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"docs": {"show": false}, "quote_columns": "{{ target.type == 'redshift' or var('fivetran_using_source_casing', false) }}", "column_types": {"_fivetran_synced": "timestamp"}}, "created_at": 1789419971.445178, "relation_name": "\"postgres\".\"public\".\"user_unsubscribed_message_type_data\"", "raw_code": "", "doc_blocks": [], "root_path": "/home/runner/work/dbt_iterable/dbt_iterable/integration_tests", "depends_on": {"macros": []}}, "seed.iterable_integration_tests.journey_data": {"database": "postgres", "schema": "public", "name": "journey_data", "resource_type": "seed", "package_name": "iterable_integration_tests", "path": "journey_data.csv", "original_file_path": "seeds/journey_data.csv", "unique_id": "seed.iterable_integration_tests.journey_data", "fqn": ["iterable_integration_tests", "journey_data"], "alias": "journey_data", "checksum": {"name": "sha256", "checksum": "763e5d9e7d86016bfdb9b0ad32da7c2d9685721719cb13b0b518415664bbb6d8"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "seed", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {"id": "bigint", "lifetime_limit": "bigint", "simultaneous_limit": "bigint", "start_tile_id": "bigint", "created_at": "timestamp", "updated_at": "timestamp", "_fivetran_synced": "timestamp"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": false, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "delimiter": ",", "quote_columns": false}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": false, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"docs": {"show": false}, "quote_columns": "{{ target.type == 'redshift' or var('fivetran_using_source_casing', false) }}", "column_types": {"id": "{%- if target.type == 'bigquery' -%} INT64 {%- else -%} bigint {%- endif -%}", "lifetime_limit": "{%- if target.type == 'bigquery' -%} INT64 {%- else -%} bigint {%- endif -%}", "simultaneous_limit": "{%- if target.type == 'bigquery' -%} INT64 {%- else -%} bigint {%- endif -%}", "start_tile_id": "{%- if target.type == 'bigquery' -%} INT64 {%- else -%} bigint {%- endif -%}", "created_at": "timestamp", "updated_at": "timestamp", "_fivetran_synced": "timestamp"}}, "created_at": 1789419971.4488525, "relation_name": "\"postgres\".\"public\".\"journey_data\"", "raw_code": "", "doc_blocks": [], "root_path": "/home/runner/work/dbt_iterable/dbt_iterable/integration_tests", "depends_on": {"macros": []}}, "seed.iterable_integration_tests.campaign_history_data": {"database": "postgres", "schema": "public", "name": "campaign_history_data", "resource_type": "seed", "package_name": "iterable_integration_tests", "path": "campaign_history_data.csv", "original_file_path": "seeds/campaign_history_data.csv", "unique_id": "seed.iterable_integration_tests.campaign_history_data", "fqn": ["iterable_integration_tests", "campaign_history_data"], "alias": "campaign_history_data", "checksum": {"name": "sha256", "checksum": "06adf392dab227dbabbda6782b710213ceea5a30d87990d0cbabe92ba0a955c4"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "seed", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {"_fivetran_synced": "timestamp"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": false, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "delimiter": ",", "quote_columns": false}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": false, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"docs": {"show": false}, "quote_columns": "{{ target.type == 'redshift' or var('fivetran_using_source_casing', false) }}", "column_types": {"_fivetran_synced": "timestamp"}}, "created_at": 1789419971.4523542, "relation_name": "\"postgres\".\"public\".\"campaign_history_data\"", "raw_code": "", "doc_blocks": [], "root_path": "/home/runner/work/dbt_iterable/dbt_iterable/integration_tests", "depends_on": {"macros": []}}, "seed.iterable_integration_tests.list_data": {"database": "postgres", "schema": "public", "name": "list_data", "resource_type": "seed", "package_name": "iterable_integration_tests", "path": "list_data.csv", "original_file_path": "seeds/list_data.csv", "unique_id": "seed.iterable_integration_tests.list_data", "fqn": ["iterable_integration_tests", "list_data"], "alias": "list_data", "checksum": {"name": "sha256", "checksum": "9d817c52008be5fbdb25cde6fa5855f8222f41a436ba7e2e5ed564e319cb64fd"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "seed", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {"_fivetran_synced": "timestamp"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": false, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "delimiter": ",", "quote_columns": false}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": false, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"docs": {"show": false}, "quote_columns": "{{ target.type == 'redshift' or var('fivetran_using_source_casing', false) }}", "column_types": {"_fivetran_synced": "timestamp"}}, "created_at": 1789419971.455781, "relation_name": "\"postgres\".\"public\".\"list_data\"", "raw_code": "", "doc_blocks": [], "root_path": "/home/runner/work/dbt_iterable/dbt_iterable/integration_tests", "depends_on": {"macros": []}}, "seed.iterable_integration_tests.event_extension_data": {"database": "postgres", "schema": "public", "name": "event_extension_data", "resource_type": "seed", "package_name": "iterable_integration_tests", "path": "event_extension_data.csv", "original_file_path": "seeds/event_extension_data.csv", "unique_id": "seed.iterable_integration_tests.event_extension_data", "fqn": ["iterable_integration_tests", "event_extension_data"], "alias": "event_extension_data", "checksum": {"name": "sha256", "checksum": "e0ed2a4a9661ad12bdd9d9a2221df3fd32f2da5fad39e9d0f6f01cbc819ffa9a"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "seed", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {"payload": "varchar(100)", "_fivetran_synced": "timestamp"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": false, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "delimiter": ",", "quote_columns": false}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": false, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"docs": {"show": false}, "quote_columns": "{{ target.type == 'redshift' or var('fivetran_using_source_casing', false) }}", "column_types": {"payload": "{{ 'varchar(100)' if target.type in ('redshift', 'postgres') else 'string'}}", "_fivetran_synced": "timestamp"}}, "created_at": 1789419971.4594202, "relation_name": "\"postgres\".\"public\".\"event_extension_data\"", "raw_code": "", "doc_blocks": [], "root_path": "/home/runner/work/dbt_iterable/dbt_iterable/integration_tests", "depends_on": {"macros": []}}, "seed.iterable_integration_tests.user_unsubscribed_channel_data": {"database": "postgres", "schema": "public", "name": "user_unsubscribed_channel_data", "resource_type": "seed", "package_name": "iterable_integration_tests", "path": "user_unsubscribed_channel_data.csv", "original_file_path": "seeds/user_unsubscribed_channel_data.csv", "unique_id": "seed.iterable_integration_tests.user_unsubscribed_channel_data", "fqn": ["iterable_integration_tests", "user_unsubscribed_channel_data"], "alias": "user_unsubscribed_channel_data", "checksum": {"name": "sha256", "checksum": "4c6abacf719352d79d0da89751296fc2665d65546ee2c1ad45d142918c750f28"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "seed", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {"_fivetran_synced": "timestamp"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": false, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "delimiter": ",", "quote_columns": false}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": false, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"docs": {"show": false}, "quote_columns": "{{ target.type == 'redshift' or var('fivetran_using_source_casing', false) }}", "column_types": {"_fivetran_synced": "timestamp"}}, "created_at": 1789419971.4630718, "relation_name": "\"postgres\".\"public\".\"user_unsubscribed_channel_data\"", "raw_code": "", "doc_blocks": [], "root_path": "/home/runner/work/dbt_iterable/dbt_iterable/integration_tests", "depends_on": {"macros": []}}, "seed.iterable_integration_tests.campaign_label_history_data": {"database": "postgres", "schema": "public", "name": "campaign_label_history_data", "resource_type": "seed", "package_name": "iterable_integration_tests", "path": "campaign_label_history_data.csv", "original_file_path": "seeds/campaign_label_history_data.csv", "unique_id": "seed.iterable_integration_tests.campaign_label_history_data", "fqn": ["iterable_integration_tests", "campaign_label_history_data"], "alias": "campaign_label_history_data", "checksum": {"name": "sha256", "checksum": "30ed21c883f801eb859d0280b90d45cb3dd020cdb708f4ef4aeca772372bf077"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "seed", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {"_fivetran_synced": "timestamp"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": false, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "delimiter": ",", "quote_columns": false}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": false, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"docs": {"show": false}, "quote_columns": "{{ target.type == 'redshift' or var('fivetran_using_source_casing', false) }}", "column_types": {"_fivetran_synced": "timestamp"}}, "created_at": 1789419971.466485, "relation_name": "\"postgres\".\"public\".\"campaign_label_history_data\"", "raw_code": "", "doc_blocks": [], "root_path": "/home/runner/work/dbt_iterable/dbt_iterable/integration_tests", "depends_on": {"macros": []}}, "seed.iterable_integration_tests.user_history_data": {"database": "postgres", "schema": "public", "name": "user_history_data", "resource_type": "seed", "package_name": "iterable_integration_tests", "path": "user_history_data.csv", "original_file_path": "seeds/user_history_data.csv", "unique_id": "seed.iterable_integration_tests.user_history_data", "fqn": ["iterable_integration_tests", "user_history_data"], "alias": "user_history_data", "checksum": {"name": "sha256", "checksum": "708bd35a21174cf05f0b4370079a339061c0b9292690ac4facd43b1d2bdff186"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "seed", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {"updated_at": "timestamp", "_fivetran_synced": "timestamp"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": false, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "delimiter": ",", "quote_columns": false}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": false, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"docs": {"show": false}, "quote_columns": "{{ target.type == 'redshift' or var('fivetran_using_source_casing', false) }}", "column_types": {"updated_at": "timestamp", "_fivetran_synced": "timestamp"}}, "created_at": 1789419971.4698994, "relation_name": "\"postgres\".\"public\".\"user_history_data\"", "raw_code": "", "doc_blocks": [], "root_path": "/home/runner/work/dbt_iterable/dbt_iterable/integration_tests", "depends_on": {"macros": []}}, "model.iterable.iterable__users": {"database": "postgres", "schema": "public_iterable_dev", "name": "iterable__users", "resource_type": "model", "package_name": "iterable", "path": "iterable__users.sql", "original_file_path": "models/iterable__users.sql", "unique_id": "model.iterable.iterable__users", "fqn": ["iterable", "iterable__users"], "alias": "iterable__users", "checksum": {"name": "sha256", "checksum": "da23dacdef77d357083015551b25b1e1013e549ccea451e28820df44f3ac4f5a"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "table", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "Table that provides unique user enriched information.", "columns": {"source_relation": {"name": "source_relation", "description": "Identifies the record's source.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": ["doc.iterable.source_relation"]}, "unique_user_key": {"name": "unique_user_key", "description": "The unique identifier of the user. With the new schema (Aug 2023), it is the _fivetran_user_id. This is a hash of user_id and/or email, depending on project type. If using the old schema, it is email.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "_fivetran_user_id": {"name": "_fivetran_user_id", "description": "A Fivetran-created unique identifier for the new Iterable schema in Aug 2023, for users, derived from hashing user_id and/or email, depending on project type.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "email": {"name": "email", "description": "The user's email. User identifier, for email-based projects. Previously was the unique identifier for user records, for the old Iterable schema before the August 2023 updates.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "first_name": {"name": "first_name", "description": "First name of the user", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "last_name": {"name": "last_name", "description": "Last name of the user", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "user_id": {"name": "user_id", "description": "User identifier, for userID-based projects.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "signup_date": {"name": "signup_date", "description": "Timestamp of when the user signed up", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "signup_source": {"name": "signup_source", "description": "Source where the user signed up", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "updated_at": {"name": "updated_at", "description": "Last update timestamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "phone_number": {"name": "phone_number", "description": "Phone number associated with the user", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "email_list_ids": {"name": "email_list_ids", "description": "Array of all email lists associated with the user, derived from the list_user table relationships", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "count_lists": {"name": "count_lists", "description": "Total count of lists associated with the user", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "count_total_campaigns": {"name": "count_total_campaigns", "description": "Count of all campaigns the user has been in", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "first_event_at": {"name": "first_event_at", "description": "The first event the user ever encountered", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "last_event_at": {"name": "last_event_at", "description": "The most recent event the user has encountered", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_emailclick": {"name": "total_emailclick", "description": "Total number of email clicks the user has performed", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_emailunsubscribe": {"name": "total_emailunsubscribe", "description": "Total unsubscription events the user has performed", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_emailcomplaint": {"name": "total_emailcomplaint", "description": "Total email complaints the user has performed", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_customevent": {"name": "total_customevent", "description": "Total custom events associated with the user", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_emailsubscribe": {"name": "total_emailsubscribe", "description": "Total subscription events the user has performed", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_emailopen": {"name": "total_emailopen", "description": "Total email opened events the user has performed", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_pushsend": {"name": "total_pushsend", "description": "The push send events the user has experienced", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_smsbounce": {"name": "total_smsbounce", "description": "Total sms bounces that are associated with the user", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_pushbounce": {"name": "total_pushbounce", "description": "Total number of push bounces associated with the user", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_inappsendskip": {"name": "total_inappsendskip", "description": "Total in app send skips associated with the user", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_smssend": {"name": "total_smssend", "description": "Total sms sends that the user has experienced", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_inappsend": {"name": "total_inappsend", "description": "Total in app sends the user has experienced", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_pushopen": {"name": "total_pushopen", "description": "Total push messages the user has opened", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_emailsend": {"name": "total_emailsend", "description": "Total emails that have been sent to the user", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_pushsendskip": {"name": "total_pushsendskip", "description": "Total push sends the user has skipped", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_inappopen": {"name": "total_inappopen", "description": "Total in app opens the user has performed", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_emailsendskip": {"name": "total_emailsendskip", "description": "Total email sends the user has skipped", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_emailbounce": {"name": "total_emailbounce", "description": "Total number of emails that have bounced from the user", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_inappclick": {"name": "total_inappclick", "description": "Total in app clicks associated with the user", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_pushuninstall": {"name": "total_pushuninstall", "description": "Total push uninstall events the user has performed", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "iterable://models/iterable.yml", "build_path": null, "unrendered_config": {"materialized": "table", "schema": "iterable_{{ var('directed_schema','dev') }}", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789419972.8753684, "relation_name": "\"postgres\".\"public_iterable_dev\".\"iterable__users\"", "raw_code": "{% set passthrough_column_count = var('iterable_user_history_pass_through_columns') | length %}\n\nwith user_event_metrics as (\n\n select *\n from {{ ref('int_iterable__user_event_metrics') }}\n\n), list_users as (\n\n select *\n from {{ ref('stg_iterable__list_user') }}\n order by list_id -- so the list ids will aggregate in the right order\n\n), list_user_aggregated as (\n\n select\n source_relation,\n _fivetran_user_id,\n count(*) as count_lists,\n {{ dbt.concat([\"'['\", fivetran_utils.string_agg(field_to_agg=\"cast(list_id as \" ~ dbt.type_string() ~ \")\", delimiter=\"','\"), \"']'\"]) }} as email_list_ids\n from list_users\n group by 1, 2 \n\n), user_history_unnest as (\n -- this has all the user fields we're looking to pass through\n\n select *\n from {{ ref('int_iterable__list_user_unnest') }}\n\n -- limit to current lists they are a member of. each list-user combo is a unique row, which we will roll up\n where is_current\n\n), user_with_list_metrics as (\n\n select\n source_relation,\n user_id,\n _fivetran_user_id,\n unique_user_key,\n email,\n first_name,\n last_name,\n signup_date,\n signup_source,\n updated_at,\n phone_number,\n email_list_ids\n\n --The below script allows for pass through columns.\n {{ fivetran_utils.persist_pass_through_columns(pass_through_variable='iterable_user_history_pass_through_columns') }}\n\n , count(distinct list_id) as count_lists\n\n from user_history_unnest\n -- roll up to the user\n {{ dbt_utils.group_by(n = 12 + passthrough_column_count) }}\n\n), user_join as (\n\n select\n user_with_list_metrics.source_relation,\n user_with_list_metrics.user_id,\n user_with_list_metrics._fivetran_user_id,\n user_with_list_metrics.unique_user_key,\n user_with_list_metrics.email,\n user_with_list_metrics.first_name,\n user_with_list_metrics.last_name,\n user_with_list_metrics.signup_date,\n user_with_list_metrics.signup_source,\n user_with_list_metrics.updated_at,\n user_with_list_metrics.phone_number,\n coalesce(list_user_aggregated.email_list_ids, user_with_list_metrics.email_list_ids, '[]') as email_list_ids,\n coalesce(list_user_aggregated.count_lists, user_with_list_metrics.count_lists, 0) as count_lists,\n {{ dbt_utils.star(from=ref('int_iterable__user_event_metrics'), except=['source_relation','unique_user_key','_fivetran_user_id','user_id','user_email']) }}\n {{ fivetran_utils.persist_pass_through_columns(pass_through_variable='iterable_user_history_pass_through_columns', identifier='user_with_list_metrics') }}\n\n from user_with_list_metrics\n left join user_event_metrics\n on user_with_list_metrics.unique_user_key = user_event_metrics.unique_user_key\n and user_with_list_metrics.source_relation = user_event_metrics.source_relation\n left join list_user_aggregated\n -- use _fivetran_user_id since in list_user it is a primary key\n on user_with_list_metrics._fivetran_user_id = list_user_aggregated._fivetran_user_id\n and user_with_list_metrics.source_relation = list_user_aggregated.source_relation\n)\n\nselect *\nfrom user_join", "doc_blocks": [], "language": "sql", "refs": [{"name": "int_iterable__user_event_metrics", "package": null, "version": null}, {"name": "stg_iterable__list_user", "package": null, "version": null}, {"name": "int_iterable__list_user_unnest", "package": null, "version": null}, {"name": "int_iterable__user_event_metrics", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.type_string", "macro.fivetran_utils.string_agg", "macro.dbt.concat", "macro.fivetran_utils.persist_pass_through_columns", "macro.dbt_utils.group_by", "macro.dbt_utils.star"], "nodes": ["model.iterable.int_iterable__user_event_metrics", "model.iterable.stg_iterable__list_user", "model.iterable.int_iterable__list_user_unnest"]}, "compiled_path": "target/compiled/iterable/models/iterable__users.sql", "compiled": true, "compiled_code": "\n\nwith user_event_metrics as (\n\n select *\n from \"postgres\".\"public_iterable_dev\".\"int_iterable__user_event_metrics\"\n\n), list_users as (\n\n select *\n from \"postgres\".\"public_iterable_dev\".\"stg_iterable__list_user\"\n order by list_id -- so the list ids will aggregate in the right order\n\n), list_user_aggregated as (\n\n select\n source_relation,\n _fivetran_user_id,\n count(*) as count_lists,\n '[' || \n string_agg(cast(list_id as TEXT), ',')\n\n || ']' as email_list_ids\n from list_users\n group by 1, 2 \n\n), user_history_unnest as (\n -- this has all the user fields we're looking to pass through\n\n select *\n from \"postgres\".\"public_iterable_dev\".\"int_iterable__list_user_unnest\"\n\n -- limit to current lists they are a member of. each list-user combo is a unique row, which we will roll up\n where is_current\n\n), user_with_list_metrics as (\n\n select\n source_relation,\n user_id,\n _fivetran_user_id,\n unique_user_key,\n email,\n first_name,\n last_name,\n signup_date,\n signup_source,\n updated_at,\n phone_number,\n email_list_ids\n\n --The below script allows for pass through columns.\n \n\n\n\n\n\n , count(distinct list_id) as count_lists\n\n from user_history_unnest\n -- roll up to the user\n group by 1,2,3,4,5,6,7,8,9,10,11,12\n\n), user_join as (\n\n select\n user_with_list_metrics.source_relation,\n user_with_list_metrics.user_id,\n user_with_list_metrics._fivetran_user_id,\n user_with_list_metrics.unique_user_key,\n user_with_list_metrics.email,\n user_with_list_metrics.first_name,\n user_with_list_metrics.last_name,\n user_with_list_metrics.signup_date,\n user_with_list_metrics.signup_source,\n user_with_list_metrics.updated_at,\n user_with_list_metrics.phone_number,\n coalesce(list_user_aggregated.email_list_ids, user_with_list_metrics.email_list_ids, '[]') as email_list_ids,\n coalesce(list_user_aggregated.count_lists, user_with_list_metrics.count_lists, 0) as count_lists,\n \"count_total_campaigns\",\n \"first_event_at\",\n \"last_event_at\",\n \"total_emailclick\",\n \"total_emailunsubscribe\",\n \"total_emailcomplaint\",\n \"total_customevent\",\n \"total_emailsubscribe\",\n \"total_emailopen\",\n \"total_pushsend\",\n \"total_smsbounce\",\n \"total_pushbounce\",\n \"total_inappsendskip\",\n \"total_smssend\",\n \"total_inappsend\",\n \"total_pushopen\",\n \"total_emailsend\",\n \"total_pushsendskip\",\n \"total_inappopen\",\n \"total_emailsendskip\",\n \"total_emailbounce\",\n \"total_inappclick\",\n \"total_pushuninstall\"\n \n\n\n\n\n\n from user_with_list_metrics\n left join user_event_metrics\n on user_with_list_metrics.unique_user_key = user_event_metrics.unique_user_key\n and user_with_list_metrics.source_relation = user_event_metrics.source_relation\n left join list_user_aggregated\n -- use _fivetran_user_id since in list_user it is a primary key\n on user_with_list_metrics._fivetran_user_id = list_user_aggregated._fivetran_user_id\n and user_with_list_metrics.source_relation = list_user_aggregated.source_relation\n)\n\nselect *\nfrom user_join", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.iterable__list_user_history": {"database": "postgres", "schema": "public_iterable_dev", "name": "iterable__list_user_history", "resource_type": "model", "package_name": "iterable", "path": "iterable__list_user_history.sql", "original_file_path": "models/iterable__list_user_history.sql", "unique_id": "model.iterable.iterable__list_user_history", "fqn": ["iterable", "iterable__list_user_history"], "alias": "iterable__list_user_history", "checksum": {"name": "sha256", "checksum": "9c0778ad02c86e2145ba4189534ea1eabf07b41bb3aa414934fa554ae4af4e1c"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "table", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "Table that recreates the `list_user_history` source table. Additionally, this table provides an `is_current` field to identify the current lists associated with the user. The table coalesces list_id values from both the direct list_user relationships and the unnested email_list_ids from user history to ensure comprehensive list coverage. The grain of this table is at the user/list/updated_at level.\n", "columns": {"source_relation": {"name": "source_relation", "description": "Identifies the record's source.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": ["doc.iterable.source_relation"]}, "unique_user_key": {"name": "unique_user_key", "description": "The unique identifier of the user. With the new schema (Aug 2023), it is the _fivetran_user_id. This is a hash of user_id and/or email, depending on project type. If using the old schema, it is email.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "_fivetran_user_id": {"name": "_fivetran_user_id", "description": "A Fivetran-created unique identifier for the new Iterable schema in Aug 2023, for users, derived from hashing user_id and/or email, depending on project type.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "user_email": {"name": "user_email", "description": "Email of the user if it exists.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "user_first_name": {"name": "user_first_name", "description": "First name of the user", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "user_last_name": {"name": "user_last_name", "description": "Last name of the user", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "user_id": {"name": "user_id", "description": "User identifier, for userID-based projects.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "user_signup_date": {"name": "user_signup_date", "description": "Timestamp of when the user signed up", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "user_signup_source": {"name": "user_signup_source", "description": "Source where the user signed up", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "user_updated_at": {"name": "user_updated_at", "description": "Last update timestamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "list_id": {"name": "list_id", "description": "The list associated with the user. Uses coalesced values prioritizing `list_id` from `LIST_USER` over the unnested `email_list_ids` from `USER_HISTORY` for comprehensive list coverage.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "is_current": {"name": "is_current", "description": "Boolean indicating if the current list is active", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "list_name": {"name": "list_name", "description": "Name of the list associated with the user", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "list_type": {"name": "list_type", "description": "Type of list associated with the user", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "list_created_at": {"name": "list_created_at", "description": "Date the list was created", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "iterable://models/iterable.yml", "build_path": null, "unrendered_config": {"materialized": "table", "schema": "iterable_{{ var('directed_schema','dev') }}", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789419972.8669116, "relation_name": "\"postgres\".\"public_iterable_dev\".\"iterable__list_user_history\"", "raw_code": "with user_history_unnest as (\n\n select *\n from {{ ref('int_iterable__list_user_unnest') }}\n\n), list_users as (\n\n select *\n from {{ ref('stg_iterable__list_user') }}\n\n), lists as (\n\n select *\n from {{ ref('stg_iterable__list') }}\n\n), final as (\n select distinct\n user_history_unnest.source_relation,\n user_history_unnest.unique_user_key,\n user_history_unnest._fivetran_user_id,\n user_history_unnest.user_id,\n user_history_unnest.email as user_email,\n user_history_unnest.first_name as user_first_name,\n user_history_unnest.last_name as user_last_name,\n user_history_unnest.signup_date as user_signup_date,\n user_history_unnest.signup_source as user_signup_source,\n user_history_unnest.updated_at as user_updated_at,\n coalesce(list_users.list_id, user_history_unnest.list_id) as list_id,\n user_history_unnest.is_current,\n lists.list_name,\n lists.list_type,\n lists.created_at as list_created_at\n\n --The below script allows for pass through columns.\n {{ fivetran_utils.persist_pass_through_columns(pass_through_variable='iterable_user_history_pass_through_columns', identifier='user_history_unnest') }}\n\n from user_history_unnest\n left join list_users\n on list_users.source_relation = user_history_unnest.source_relation\n and list_users._fivetran_user_id = user_history_unnest._fivetran_user_id\n left join lists\n on lists.source_relation = user_history_unnest.source_relation\n and lists.list_id = coalesce(list_users.list_id, user_history_unnest.list_id)\n)\n\nselect *\nfrom final", "doc_blocks": [], "language": "sql", "refs": [{"name": "int_iterable__list_user_unnest", "package": null, "version": null}, {"name": "stg_iterable__list_user", "package": null, "version": null}, {"name": "stg_iterable__list", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.fivetran_utils.persist_pass_through_columns"], "nodes": ["model.iterable.int_iterable__list_user_unnest", "model.iterable.stg_iterable__list_user", "model.iterable.stg_iterable__list"]}, "compiled_path": "target/compiled/iterable/models/iterable__list_user_history.sql", "compiled": true, "compiled_code": "with user_history_unnest as (\n\n select *\n from \"postgres\".\"public_iterable_dev\".\"int_iterable__list_user_unnest\"\n\n), list_users as (\n\n select *\n from \"postgres\".\"public_iterable_dev\".\"stg_iterable__list_user\"\n\n), lists as (\n\n select *\n from \"postgres\".\"public_iterable_dev\".\"stg_iterable__list\"\n\n), final as (\n select distinct\n user_history_unnest.source_relation,\n user_history_unnest.unique_user_key,\n user_history_unnest._fivetran_user_id,\n user_history_unnest.user_id,\n user_history_unnest.email as user_email,\n user_history_unnest.first_name as user_first_name,\n user_history_unnest.last_name as user_last_name,\n user_history_unnest.signup_date as user_signup_date,\n user_history_unnest.signup_source as user_signup_source,\n user_history_unnest.updated_at as user_updated_at,\n coalesce(list_users.list_id, user_history_unnest.list_id) as list_id,\n user_history_unnest.is_current,\n lists.list_name,\n lists.list_type,\n lists.created_at as list_created_at\n\n --The below script allows for pass through columns.\n \n\n\n\n\n\n from user_history_unnest\n left join list_users\n on list_users.source_relation = user_history_unnest.source_relation\n and list_users._fivetran_user_id = user_history_unnest._fivetran_user_id\n left join lists\n on lists.source_relation = user_history_unnest.source_relation\n and lists.list_id = coalesce(list_users.list_id, user_history_unnest.list_id)\n)\n\nselect *\nfrom final", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.iterable__events": {"database": "postgres", "schema": "public_iterable_dev", "name": "iterable__events", "resource_type": "model", "package_name": "iterable", "path": "iterable__events.sql", "original_file_path": "models/iterable__events.sql", "unique_id": "model.iterable.iterable__events", "fqn": ["iterable", "iterable__events"], "alias": "iterable__events", "checksum": {"name": "sha256", "checksum": "d516cb05680b528ba689ac2a2e34bfee8bbd7ede3c7d8ccfea16a28232d39c44"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "incremental", "incremental_strategy": "delete+insert", "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": ["unique_event_id"], "on_schema_change": "fail", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}, "partition_by": {"field": "created_on", "data_type": "date"}, "file_format": "delta"}, "tags": [], "description": "Table that provides a comprehensive view of all events with enriched information such as the campaign, user effected, and template used.", "columns": {"source_relation": {"name": "source_relation", "description": "Identifies the record's source.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": ["doc.iterable.source_relation"]}, "event_id": {"name": "event_id", "description": "Unique id of the event generated by Fivetran", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_event_id": {"name": "unique_event_id", "description": "A unique surrogate key of event_id, _fivetran_user_id, and source_relation.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_user_key": {"name": "unique_user_key", "description": "The unique identifier of the user. With the new schema (Aug 2023), it is the _fivetran_user_id. This is a hash of user_id and/or email, depending on project type. If using the old schema, it is email.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "_fivetran_user_id": {"name": "_fivetran_user_id", "description": "A Fivetran-created unique identifier for the new Iterable schema in Aug 2023, for users, derived from hashing user_id and/or email, depending on project type.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "campaign_id": {"name": "campaign_id", "description": "Reference to the campaign from which the event originated", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "content_id": {"name": "content_id", "description": "Reference to the content the event is associated with", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "created_at": {"name": "created_at", "description": "Creation timestamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "email": {"name": "email", "description": "The user's email. User identifier, for email-based projects. Previously was the unique identifier for user records, for the old Iterable schema before the August 2023 updates.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "additional_properties": {"name": "additional_properties", "description": "json object containing addition event properties", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "event_name": {"name": "event_name", "description": "Name provided to the individual event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "message_bus_id": {"name": "message_bus_id", "description": "Reference to the message bus associated with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "message_id": {"name": "message_id", "description": "Reference to the message the event is associated with", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "message_type_id": {"name": "message_type_id", "description": "Reference to the type of message the event is associated with", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "recipient_state": {"name": "recipient_state", "description": "The state of the recipient upon receiving the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "status": {"name": "status", "description": "Status of the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "transactional_data": {"name": "transactional_data", "description": "Transactional data associated with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unsub_source": {"name": "unsub_source", "description": "Source of the unsubscribe event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "user_agent": {"name": "user_agent", "description": "User agent associated with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "user_agent_device": {"name": "user_agent_device", "description": "The device of the user agent", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "Timestamp of when the event record was synced by Fivetran", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "campaign_name": {"name": "campaign_name", "description": "The name of the campaign", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "campaign_type": {"name": "campaign_type", "description": "The type of campaign", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "is_campaign_recurring": {"name": "is_campaign_recurring", "description": "Boolean indicating if the campaign is recurrent", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "recurring_campaign_name": {"name": "recurring_campaign_name", "description": "The name of the recurring campaign (if applicable)", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "recurring_campaign_id": {"name": "recurring_campaign_id", "description": "The campaign if of the recurring campaign (if applicable)", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "user_id": {"name": "user_id", "description": "User identifier, for userID-based projects.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "user_full_name": {"name": "user_full_name", "description": "Full name of the user", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "message_type_name": {"name": "message_type_name", "description": "Name of the message type", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "message_medium": {"name": "message_medium", "description": "Medium of the message", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "channel_id": {"name": "channel_id", "description": "Unique identifier of the channel", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "channel_name": {"name": "channel_name", "description": "The channel name", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "channel_type": {"name": "channel_type", "description": "The type of channel", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "is_app_already_running": {"name": "is_app_already_running", "description": "Boolean indicating if the app is already running", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "badge": {"name": "badge", "description": "Badge associated with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "canonical_url_id": {"name": "canonical_url_id", "description": "Reference to the url associated with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "is_content_available": {"name": "is_content_available", "description": "Content available from the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "device": {"name": "device", "description": "The device associated with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "email_id": {"name": "email_id", "description": "Reference to the email associated with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "email_subject": {"name": "email_subject", "description": "Subject of the email associated with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "experiment_id": {"name": "experiment_id", "description": "Reference to the experiment used if the event is an experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "from_phone_number_id": {"name": "from_phone_number_id", "description": "Reference to the phone number which the event is from", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "from_smssender_id": {"name": "from_smssender_id", "description": "Reference to the sms sender which the event is from", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "link_id": {"name": "link_id", "description": "Reference to the link associated with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "link_url": {"name": "link_url", "description": "Url of the link associated with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "locale": {"name": "locale", "description": "Locale associated with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "payload": {"name": "payload", "description": "Payload resulted from the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "platform_endpoint": {"name": "platform_endpoint", "description": "The specific platform endpoint of the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "push_message": {"name": "push_message", "description": "Boolean indicating if the event is a push message", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "region": {"name": "region", "description": "Region of the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "sms_message": {"name": "sms_message", "description": "Boolean indicating if the event is an sms message", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "to_phone_number": {"name": "to_phone_number", "description": "To phone number associated with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "url": {"name": "url", "description": "Url associated with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "workflow_id": {"name": "workflow_id", "description": "Reference to the workflow which the event originated", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "workflow_name": {"name": "workflow_name", "description": "Name of the workflow which the event originated", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "catalog_collection_count": {"name": "catalog_collection_count", "description": "The count of products or items collected in a catalog associated with the event.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "catalog_lookup_count": {"name": "catalog_lookup_count", "description": "The count of times a catalog was looked up or queried during the event.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "template_id": {"name": "template_id", "description": "Unique identifier of the template", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "template_name": {"name": "template_name", "description": "User defined name of the template", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "template_creator_user_id": {"name": "template_creator_user_id", "description": "Reference to the user who created the template", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "created_on": {"name": "created_on", "description": "Day when the event was created", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "city": {"name": "city", "description": "The city associated with the event, which could be the location of the recipient.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "clicked_url": {"name": "clicked_url", "description": "The URL that was clicked by the recipient in response to the marketing message.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "country": {"name": "country", "description": "The country associated with the event, which could be the location of the recipient.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "error_code": {"name": "error_code", "description": "The error code or message indicating any issues or errors encountered during the event.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "expires_at": {"name": "expires_at", "description": "The date and time when the event or message is set to expire or become invalid.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "from_phone_number": {"name": "from_phone_number", "description": "The phone number from which the SMS message was sent.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "in_app_body": {"name": "in_app_body", "description": "The content or body of an in-app message that was sent as part of the event.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "is_sms_estimation": {"name": "is_sms_estimation", "description": "A boolean indicating whether the SMS message is an estimation or not.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "labels": {"name": "labels", "description": "Any labels or tags associated with the event, which can be used for categorization or organization.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "message_status": {"name": "message_status", "description": "The status of the marketing message, such as sent, delivered, opened, etc.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "mms_send_count": {"name": "mms_send_count", "description": "The count of multimedia messages (MMS) sent as part of the event.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "reason": {"name": "reason", "description": "The reason or cause associated with a specific event or action.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "sms_send_count": {"name": "sms_send_count", "description": "The count of SMS messages sent as part of the event.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "iterable://models/iterable.yml", "build_path": null, "unrendered_config": {"materialized": "incremental", "schema": "iterable_{{ var('directed_schema','dev') }}", "unique_key": "['unique_event_id']", "incremental_strategy": "CondExpr(test=Compare(expr=Getattr(node=Name(name='target', ctx='load'), attr='type', ctx='load'), ops=[Operand(op='in', expr=Tuple(items=[Const(value='bigquery'), Const(value='spark'), Const(value='databricks')], ctx='load'))]), expr1=Const(value='insert_overwrite'), expr2=Const(value='delete+insert'))", "partition_by": "CondExpr(test=Compare(expr=Getattr(node=Name(name='target', ctx='load'), attr='type', ctx='load'), ops=[Operand(op='notin', expr=Tuple(items=[Const(value='spark'), Const(value='databricks'), Const(value='duckdb')], ctx='load'))]), expr1=Dict(items=[Pair(key=Const(value='field'), value=Const(value='created_on')), Pair(key=Const(value='data_type'), value=Const(value='date'))]), expr2=List(items=[Const(value='created_on')]))", "file_format": "delta", "on_schema_change": "fail", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789419972.8543146, "relation_name": "\"postgres\".\"public_iterable_dev\".\"iterable__events\"", "raw_code": "{{ config(\n materialized='incremental',\n unique_key=['unique_event_id'],\n incremental_strategy='insert_overwrite' if target.type in ('bigquery', 'spark', 'databricks') else 'delete+insert',\n partition_by={\"field\": \"created_on\", \"data_type\": \"date\"} if target.type not in ('spark', 'databricks', 'duckdb') else ['created_on'],\n file_format='delta',\n on_schema_change='fail'\n ) \n}}\n\n{% set using_event_extension = var('iterable__using_event_extension', True) %}\n\nwith events as (\n\n select *\n from {{ ref('stg_iterable__event') }}\n\n {% if is_incremental() %}\n where created_on >= {{ iterable.iterable_lookback(\n from_date=\"max(created_on)\",\n datepart='day', \n interval=var('iterable_lookback_window', 7)) }}\n {% endif %}\n\n), campaign as (\n\n select *\n from {{ ref('int_iterable__recurring_campaigns') }}\n\n\n{% if using_event_extension %}\n), event_extension as (\n\n select *\n from {{ ref('stg_iterable__event_extension') }}\n{% endif %}\n\n), users as (\n\n select *\n from {{ ref('int_iterable__latest_user') }}\n\n), message_type_channel as (\n\n select *\n from {{ ref('int_iterable__message_type_channel') }}\n\n), template as (\n\n select *\n from {{ ref('int_iterable__latest_template') }}\n\n), event_join as (\n\n select \n events.*,\n campaign.campaign_name,\n campaign.campaign_type,\n campaign.is_campaign_recurring,\n campaign.recurring_campaign_name,\n campaign.recurring_campaign_id,\n\n users.user_id,\n users.first_name || ' ' || users.last_name as user_full_name,\n\n message_type_channel.message_type_name,\n message_type_channel.message_medium,\n message_type_channel.channel_id,\n message_type_channel.channel_name,\n message_type_channel.channel_type\n\n {% if using_event_extension %}\n {% set exclude_fields = [\"source_relation\", \"unique_user_key\",\"_fivetran_user_id\",\"event_id\", \"content_id\", \"_fivetran_synced\", \"unique_event_id\"] %}\n , {{ dbt_utils.star(from=ref('stg_iterable__event_extension'), except=exclude_fields, relation_alias=\"event_extension\") }}\n {% endif %}\n\n ,\n campaign.template_id,\n template.template_name,\n template.creator_user_id as template_creator_user_id\n \n from events\n\n {% if using_event_extension %}\n left join event_extension\n on events.unique_event_id = event_extension.unique_event_id\n and events.source_relation = event_extension.source_relation\n {% endif %}\n\n left join campaign\n on events.campaign_id = campaign.campaign_id\n and events.source_relation = campaign.source_relation\n left join users\n on events.unique_user_key = users.unique_user_key -- unique_user_key = _fivetran_user_id if exists, otherwise email\n and events.source_relation = users.source_relation\n left join message_type_channel\n on events.message_type_id = message_type_channel.message_type_id\n and events.source_relation = message_type_channel.source_relation\n left join template\n on campaign.template_id = template.template_id\n and events.source_relation = template.source_relation\n)\n\nselect *\nfrom event_join", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__event", "package": null, "version": null}, {"name": "int_iterable__recurring_campaigns", "package": null, "version": null}, {"name": "stg_iterable__event_extension", "package": null, "version": null}, {"name": "int_iterable__latest_user", "package": null, "version": null}, {"name": "int_iterable__message_type_channel", "package": null, "version": null}, {"name": "int_iterable__latest_template", "package": null, "version": null}, {"name": "stg_iterable__event_extension", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.is_incremental", "macro.dbt_utils.star", "macro.iterable.iterable_lookback"], "nodes": ["model.iterable.stg_iterable__event", "model.iterable.int_iterable__recurring_campaigns", "model.iterable.stg_iterable__event_extension", "model.iterable.int_iterable__latest_user", "model.iterable.int_iterable__message_type_channel", "model.iterable.int_iterable__latest_template"]}, "compiled_path": "target/compiled/iterable/models/iterable__events.sql", "compiled": true, "compiled_code": "\n\n\n\nwith events as (\n\n select *\n from \"postgres\".\"public_iterable_dev\".\"stg_iterable__event\"\n\n \n where created_on >= \n\n\n\n \n\n \n\n cast('2020-07-12' as date) + ((interval '1 day') * (-7))\n\n\n\n\n \n\n), campaign as (\n\n select *\n from \"postgres\".\"public_iterable_dev\".\"int_iterable__recurring_campaigns\"\n\n\n\n), event_extension as (\n\n select *\n from \"postgres\".\"public_iterable_dev\".\"stg_iterable__event_extension\"\n\n\n), users as (\n\n select *\n from \"postgres\".\"public_iterable_dev\".\"int_iterable__latest_user\"\n\n), message_type_channel as (\n\n select *\n from \"postgres\".\"public_iterable_dev\".\"int_iterable__message_type_channel\"\n\n), template as (\n\n select *\n from \"postgres\".\"public_iterable_dev\".\"int_iterable__latest_template\"\n\n), event_join as (\n\n select \n events.*,\n campaign.campaign_name,\n campaign.campaign_type,\n campaign.is_campaign_recurring,\n campaign.recurring_campaign_name,\n campaign.recurring_campaign_id,\n\n users.user_id,\n users.first_name || ' ' || users.last_name as user_full_name,\n\n message_type_channel.message_type_name,\n message_type_channel.message_medium,\n message_type_channel.channel_id,\n message_type_channel.channel_name,\n message_type_channel.channel_type\n\n \n \n , event_extension.\"is_app_already_running\",\n event_extension.\"badge\",\n event_extension.\"catalog_collection_count\",\n event_extension.\"catalog_lookup_count\",\n event_extension.\"canonical_url_id\",\n event_extension.\"is_content_available\",\n event_extension.\"device\",\n event_extension.\"email_id\",\n event_extension.\"email_subject\",\n event_extension.\"experiment_id\",\n event_extension.\"from_phone_number_id\",\n event_extension.\"from_smssender_id\",\n event_extension.\"link_id\",\n event_extension.\"link_url\",\n event_extension.\"locale\",\n event_extension.\"payload\",\n event_extension.\"platform_endpoint\",\n event_extension.\"push_message\",\n event_extension.\"region\",\n event_extension.\"sms_message\",\n event_extension.\"to_phone_number\",\n event_extension.\"url\",\n event_extension.\"workflow_id\",\n event_extension.\"workflow_name\",\n event_extension.\"city\",\n event_extension.\"clicked_url\",\n event_extension.\"country\",\n event_extension.\"error_code\",\n event_extension.\"expires_at\",\n event_extension.\"from_phone_number\",\n event_extension.\"in_app_body\",\n event_extension.\"is_sms_estimation\",\n event_extension.\"labels\",\n event_extension.\"message_status\",\n event_extension.\"mms_send_count\",\n event_extension.\"reason\",\n event_extension.\"sms_send_count\"\n \n\n ,\n campaign.template_id,\n template.template_name,\n template.creator_user_id as template_creator_user_id\n \n from events\n\n \n left join event_extension\n on events.unique_event_id = event_extension.unique_event_id\n and events.source_relation = event_extension.source_relation\n \n\n left join campaign\n on events.campaign_id = campaign.campaign_id\n and events.source_relation = campaign.source_relation\n left join users\n on events.unique_user_key = users.unique_user_key -- unique_user_key = _fivetran_user_id if exists, otherwise email\n and events.source_relation = users.source_relation\n left join message_type_channel\n on events.message_type_id = message_type_channel.message_type_id\n and events.source_relation = message_type_channel.source_relation\n left join template\n on campaign.template_id = template.template_id\n and events.source_relation = template.source_relation\n)\n\nselect *\nfrom event_join", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.iterable__user_campaign": {"database": "postgres", "schema": "public_iterable_dev", "name": "iterable__user_campaign", "resource_type": "model", "package_name": "iterable", "path": "iterable__user_campaign.sql", "original_file_path": "models/iterable__user_campaign.sql", "unique_id": "model.iterable.iterable__user_campaign", "fqn": ["iterable", "iterable__user_campaign"], "alias": "iterable__user_campaign", "checksum": {"name": "sha256", "checksum": "343ed0b8ab547da53812f4a8426cfd7b93f81ce3886680c4182a2596f1ea8632"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "table", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "Table that provides total and unique metrics for a user associated with particular campaigns and if available, experiments.", "columns": {"source_relation": {"name": "source_relation", "description": "Identifies the record's source.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": ["doc.iterable.source_relation"]}, "unique_user_campaign_id": {"name": "unique_user_campaign_id", "description": "Unique ID combining source_relation, unique_user_key, campaign_id, and if available, experiment_id.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "_fivetran_user_id": {"name": "_fivetran_user_id", "description": "A Fivetran-created unique identifier for the new Iterable schema in Aug 2023, for users, derived from hashing user_id and/or email, depending on project type.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_user_key": {"name": "unique_user_key", "description": "The unique identifier of the user. With the new schema (Aug 2023), it is the _fivetran_user_id. This is a hash of user_id and/or email, depending on project type. If using the old schema, it is email.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "user_id": {"name": "user_id", "description": "User identifier, for userID-based projects.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "user_email": {"name": "user_email", "description": "Email of the user if it exists.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "user_full_name": {"name": "user_full_name", "description": "The users first and last name", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "campaign_id": {"name": "campaign_id", "description": "The unique identifier of the campaign which the user metrics are associated", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "campaign_name": {"name": "campaign_name", "description": "The name of the campaign which the user metrics are associated", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "template_id": {"name": "template_id", "description": "The unique identifier of the template used within the campaign", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "template_name": {"name": "template_name", "description": "The name of the template used for the campaign", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "experiment_id": {"name": "experiment_id", "description": "The unique experiment variation of the campaign", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "recurring_campaign_id": {"name": "recurring_campaign_id", "description": "The unique identifier of the recurring campaign which the campaign is tied to", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "recurring_campaign_name": {"name": "recurring_campaign_name", "description": "The name of the recurring campaign which the campaign is tied to", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "first_event_at": {"name": "first_event_at", "description": "Timestamp of the first campaign/experiment event associated with the user", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "last_event_at": {"name": "last_event_at", "description": "Timestamp of the most recent campaign/experiment event associated with the user", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_emailclick": {"name": "total_emailclick", "description": "Total email clicks events the user took within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_emailunsubscribe": {"name": "total_emailunsubscribe", "description": "Total email unsubscription events the user performed within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_emailcomplaint": {"name": "total_emailcomplaint", "description": "Total email complaint events the user performed within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_customevent": {"name": "total_customevent", "description": "Total custom events associated with the user within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_emailsubscribe": {"name": "total_emailsubscribe", "description": "Total email subscription events associate with the user within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_emailopen": {"name": "total_emailopen", "description": "Total email open events the user performed within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_pushsend": {"name": "total_pushsend", "description": "Total push send events the user performed within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_smsbounce": {"name": "total_smsbounce", "description": "Total sms bounce events associated with the user within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_pushbounce": {"name": "total_pushbounce", "description": "Total push bounce events associated with the user within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_inappsendskip": {"name": "total_inappsendskip", "description": "Total in app send skip events the user performed within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_smssend": {"name": "total_smssend", "description": "Total sms send events associated with the user within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_inappsend": {"name": "total_inappsend", "description": "Total in app send events associated with the user within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_pushopen": {"name": "total_pushopen", "description": "Total push open events the user performed within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_emailsend": {"name": "total_emailsend", "description": "Total email send event associated with the user within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_pushsendskip": {"name": "total_pushsendskip", "description": "Total push send skip events associated with the user within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_inappopen": {"name": "total_inappopen", "description": "Total in app open events associated with the user within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_emailsendskip": {"name": "total_emailsendskip", "description": "Total email send skip events associated with the user within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_emailbounce": {"name": "total_emailbounce", "description": "Total email bounce events associated with the user within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_inappclick": {"name": "total_inappclick", "description": "Total in app click events associated with the user within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_pushuninstall": {"name": "total_pushuninstall", "description": "Total push uninstall events associated with the user within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "first_open_or_click_event_at": {"name": "first_open_or_click_event_at", "description": "The time of the first open or click time. This is the first time a user interacts with a campaign, recording the earliest occurring event out of 'emailOpen', 'emailClick', and 'pushOpen'.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "iterable://models/iterable.yml", "build_path": null, "unrendered_config": {"materialized": "table", "schema": "iterable_{{ var('directed_schema','dev') }}", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789419972.869712, "relation_name": "\"postgres\".\"public_iterable_dev\".\"iterable__user_campaign\"", "raw_code": "{% set using_event_extension = var('iterable__using_event_extension', True) %}\n\nwith events as (\n\n select *\n from {{ ref('iterable__events') }}\n\n), pivot_out_events as (\n\n-- this will be at the user-campaign-experiment variation level\n-- if experiment_id is null, the user-campaign interactions happened outside of an experiment\n-- if campaign_id is null, the user interactions are organic\n select\n source_relation,\n _fivetran_user_id,\n unique_user_key,\n user_id,\n campaign_id,\n\n {{ \"experiment_id,\" if using_event_extension }}\n\n email as user_email,\n user_full_name,\n case when campaign_id is null then 'organic' else campaign_name end as campaign_name,\n template_id,\n template_name,\n\n recurring_campaign_id,\n recurring_campaign_name,\n\n min(created_at) as first_event_at,\n max(created_at) as last_event_at,\n min(case when event_name in ('emailOpen', 'emailClick', 'pushOpen') then created_at end) as first_open_or_click_event_at\n\n\n -- count up the number of instances of each metric\n -- `iterable__event_metrics` is set by default to all events brought in by fivetran+iterable\n -- https://fivetran.com/docs/applications/iterable#schemanotes\n {% for em in var('iterable__event_metrics') %}\n , sum(case when lower(event_name) = '{{ em | lower }}' then 1 else 0 end)\n as {{ 'total_' ~ em | replace(' ', '_') | replace('(', '') | replace(')', '') | lower }}\n {% endfor %}\n\n from events\n\n {{ dbt_utils.group_by(n=13 if using_event_extension else 12 ) }}\n\n), add_surrogate_key as (\n\n {% set surrogate_key_fields = ['source_relation', 'unique_user_key', 'campaign_id'] %}\n {% do surrogate_key_fields.append('experiment_id') if var('iterable__using_event_extension', True) %}\n\n select \n *,\n {{ dbt_utils.generate_surrogate_key(surrogate_key_fields) }} as unique_user_campaign_id\n\n from pivot_out_events\n)\n\nselect *\nfrom add_surrogate_key", "doc_blocks": [], "language": "sql", "refs": [{"name": "iterable__events", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt_utils.group_by", "macro.dbt_utils.generate_surrogate_key"], "nodes": ["model.iterable.iterable__events"]}, "compiled_path": "target/compiled/iterable/models/iterable__user_campaign.sql", "compiled": true, "compiled_code": "\n\nwith events as (\n\n select *\n from \"postgres\".\"public_iterable_dev\".\"iterable__events\"\n\n), pivot_out_events as (\n\n-- this will be at the user-campaign-experiment variation level\n-- if experiment_id is null, the user-campaign interactions happened outside of an experiment\n-- if campaign_id is null, the user interactions are organic\n select\n source_relation,\n _fivetran_user_id,\n unique_user_key,\n user_id,\n campaign_id,\n\n experiment_id,\n\n email as user_email,\n user_full_name,\n case when campaign_id is null then 'organic' else campaign_name end as campaign_name,\n template_id,\n template_name,\n\n recurring_campaign_id,\n recurring_campaign_name,\n\n min(created_at) as first_event_at,\n max(created_at) as last_event_at,\n min(case when event_name in ('emailOpen', 'emailClick', 'pushOpen') then created_at end) as first_open_or_click_event_at\n\n\n -- count up the number of instances of each metric\n -- `iterable__event_metrics` is set by default to all events brought in by fivetran+iterable\n -- https://fivetran.com/docs/applications/iterable#schemanotes\n \n , sum(case when lower(event_name) = 'emailclick' then 1 else 0 end)\n as total_emailclick\n \n , sum(case when lower(event_name) = 'emailunsubscribe' then 1 else 0 end)\n as total_emailunsubscribe\n \n , sum(case when lower(event_name) = 'emailcomplaint' then 1 else 0 end)\n as total_emailcomplaint\n \n , sum(case when lower(event_name) = 'customevent' then 1 else 0 end)\n as total_customevent\n \n , sum(case when lower(event_name) = 'emailsubscribe' then 1 else 0 end)\n as total_emailsubscribe\n \n , sum(case when lower(event_name) = 'emailopen' then 1 else 0 end)\n as total_emailopen\n \n , sum(case when lower(event_name) = 'pushsend' then 1 else 0 end)\n as total_pushsend\n \n , sum(case when lower(event_name) = 'smsbounce' then 1 else 0 end)\n as total_smsbounce\n \n , sum(case when lower(event_name) = 'pushbounce' then 1 else 0 end)\n as total_pushbounce\n \n , sum(case when lower(event_name) = 'inappsendskip' then 1 else 0 end)\n as total_inappsendskip\n \n , sum(case when lower(event_name) = 'smssend' then 1 else 0 end)\n as total_smssend\n \n , sum(case when lower(event_name) = 'inappsend' then 1 else 0 end)\n as total_inappsend\n \n , sum(case when lower(event_name) = 'pushopen' then 1 else 0 end)\n as total_pushopen\n \n , sum(case when lower(event_name) = 'emailsend' then 1 else 0 end)\n as total_emailsend\n \n , sum(case when lower(event_name) = 'pushsendskip' then 1 else 0 end)\n as total_pushsendskip\n \n , sum(case when lower(event_name) = 'inappopen' then 1 else 0 end)\n as total_inappopen\n \n , sum(case when lower(event_name) = 'emailsendskip' then 1 else 0 end)\n as total_emailsendskip\n \n , sum(case when lower(event_name) = 'emailbounce' then 1 else 0 end)\n as total_emailbounce\n \n , sum(case when lower(event_name) = 'inappclick' then 1 else 0 end)\n as total_inappclick\n \n , sum(case when lower(event_name) = 'pushuninstall' then 1 else 0 end)\n as total_pushuninstall\n \n\n from events\n\n group by 1,2,3,4,5,6,7,8,9,10,11,12,13\n\n), add_surrogate_key as (\n\n \n \n\n select \n *,\n md5(cast(coalesce(cast(source_relation as TEXT), '_dbt_utils_surrogate_key_null_') || '-' || coalesce(cast(unique_user_key as TEXT), '_dbt_utils_surrogate_key_null_') || '-' || coalesce(cast(campaign_id as TEXT), '_dbt_utils_surrogate_key_null_') || '-' || coalesce(cast(experiment_id as TEXT), '_dbt_utils_surrogate_key_null_') as TEXT)) as unique_user_campaign_id\n\n from pivot_out_events\n)\n\nselect *\nfrom add_surrogate_key", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.iterable__user_unsubscriptions": {"database": "postgres", "schema": "public_iterable_dev", "name": "iterable__user_unsubscriptions", "resource_type": "model", "package_name": "iterable", "path": "iterable__user_unsubscriptions.sql", "original_file_path": "models/iterable__user_unsubscriptions.sql", "unique_id": "model.iterable.iterable__user_unsubscriptions", "fqn": ["iterable", "iterable__user_unsubscriptions"], "alias": "iterable__user_unsubscriptions", "checksum": {"name": "sha256", "checksum": "9ffdcfb7996a2147cd7739fc5ac7a1bd2e0db91e0ffc76d1458f53046fc4598f"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "table", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "Table that generates the total channel and message types a user has chosen to unsubscribe.", "columns": {"source_relation": {"name": "source_relation", "description": "Identifies the record's source.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": ["doc.iterable.source_relation"]}, "_fivetran_user_id": {"name": "_fivetran_user_id", "description": "A Fivetran-created unique identifier for the new Iterable schema in Aug 2023, for users, derived from hashing user_id and/or email, depending on project type.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_user_key": {"name": "unique_user_key", "description": "The unique identifier of the user. With the new schema (Aug 2023), it is the _fivetran_user_id. This is a hash of user_id and/or email, depending on project type. If using the old schema, it is email.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "channel_id": {"name": "channel_id", "description": "Unique identifier of the channel which the user is unsubscribed", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "message_type_id": {"name": "message_type_id", "description": "Unique identifier of the message type which the user is unsubscribed", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "channel_name": {"name": "channel_name", "description": "The name of the channel which the user is unsubscribed", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "message_type_name": {"name": "message_type_name", "description": "The name of the message type which the user is unsubscribed", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "channel_type": {"name": "channel_type", "description": "The channel type which the user is unsubscribed", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "message_medium": {"name": "message_medium", "description": "The medium type the message was provided which the user is unsubscribed", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "updated_at": {"name": "updated_at", "description": "Timestamp of when the user unsubscribed from the channel or message type", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "is_unsubscribed_channel_wide": {"name": "is_unsubscribed_channel_wide", "description": "Boolean indicating if the user unsubscribed at the channel level (i.e. unsubscribed to all message types) or if they unsubscribed from only an individual message type.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "iterable://models/iterable.yml", "build_path": null, "unrendered_config": {"materialized": "table", "schema": "iterable_{{ var('directed_schema','dev') }}", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789419972.8711505, "relation_name": "\"postgres\".\"public_iterable_dev\".\"iterable__user_unsubscriptions\"", "raw_code": "{% set using_user_unsubscribed_message_type = var('iterable__using_user_unsubscribed_message_type', True) %}\n\nwith message_type_channel as (\n\n select *\n from {{ ref('int_iterable__message_type_channel') }}\n\n), user_unsubscribed_channel as (\n\n select\n *\n from {{ ref('stg_iterable__user_unsubscribed_channel') }}\n where latest_batch_index = 1\n\n{% if using_user_unsubscribed_message_type %}\n), user_unsubscribed_message_type as (\n\n select\n *\n from {{ ref('stg_iterable__user_unsub_message_type') }}\n where latest_batch_index = 1\n\n{% endif %}\n\n), combine as (\n\n select\n source_relation,\n _fivetran_user_id,\n unique_user_key,\n channel_id,\n cast(null as {{ dbt.type_string() }}) as message_type_id,\n updated_at\n from user_unsubscribed_channel\n\n{% if using_user_unsubscribed_message_type %}\n\n union all\n\n select\n source_relation,\n _fivetran_user_id,\n unique_user_key,\n cast(null as {{ dbt.type_string() }}) as channel_id,\n message_type_id,\n updated_at\n from user_unsubscribed_message_type\n{% endif %}\n\n), final as (\n\n select\n combine.source_relation,\n combine._fivetran_user_id,\n combine.unique_user_key,\n -- coalescing since message_type -> channel goes up a grain\n coalesce(combine.channel_id, message_type_channel.channel_id) as channel_id,\n coalesce(combine.message_type_id, message_type_channel.message_type_id) as message_type_id,\n combine.updated_at,\n message_type_channel.channel_name,\n message_type_channel.message_type_name,\n message_type_channel.channel_type,\n message_type_channel.message_medium,\n case when combine.channel_id is not null then true else false end as is_unsubscribed_channel_wide\n\n from combine\n\n -- unsubscribing from an entire channel unsubscribes a user from all message types in that channel\n join message_type_channel\n on combine.source_relation = message_type_channel.source_relation\n and (combine.channel_id = message_type_channel.channel_id\n or combine.message_type_id = message_type_channel.message_type_id)\n)\n\nselect *\nfrom final", "doc_blocks": [], "language": "sql", "refs": [{"name": "int_iterable__message_type_channel", "package": null, "version": null}, {"name": "stg_iterable__user_unsubscribed_channel", "package": null, "version": null}, {"name": "stg_iterable__user_unsub_message_type", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.type_string"], "nodes": ["model.iterable.int_iterable__message_type_channel", "model.iterable.stg_iterable__user_unsubscribed_channel", "model.iterable.stg_iterable__user_unsub_message_type"]}, "compiled_path": "target/compiled/iterable/models/iterable__user_unsubscriptions.sql", "compiled": true, "compiled_code": "\n\nwith message_type_channel as (\n\n select *\n from \"postgres\".\"public_iterable_dev\".\"int_iterable__message_type_channel\"\n\n), user_unsubscribed_channel as (\n\n select\n *\n from \"postgres\".\"public_iterable_dev\".\"stg_iterable__user_unsubscribed_channel\"\n where latest_batch_index = 1\n\n\n), user_unsubscribed_message_type as (\n\n select\n *\n from \"postgres\".\"public_iterable_dev\".\"stg_iterable__user_unsub_message_type\"\n where latest_batch_index = 1\n\n\n\n), combine as (\n\n select\n source_relation,\n _fivetran_user_id,\n unique_user_key,\n channel_id,\n cast(null as TEXT) as message_type_id,\n updated_at\n from user_unsubscribed_channel\n\n\n\n union all\n\n select\n source_relation,\n _fivetran_user_id,\n unique_user_key,\n cast(null as TEXT) as channel_id,\n message_type_id,\n updated_at\n from user_unsubscribed_message_type\n\n\n), final as (\n\n select\n combine.source_relation,\n combine._fivetran_user_id,\n combine.unique_user_key,\n -- coalescing since message_type -> channel goes up a grain\n coalesce(combine.channel_id, message_type_channel.channel_id) as channel_id,\n coalesce(combine.message_type_id, message_type_channel.message_type_id) as message_type_id,\n combine.updated_at,\n message_type_channel.channel_name,\n message_type_channel.message_type_name,\n message_type_channel.channel_type,\n message_type_channel.message_medium,\n case when combine.channel_id is not null then true else false end as is_unsubscribed_channel_wide\n\n from combine\n\n -- unsubscribing from an entire channel unsubscribes a user from all message types in that channel\n join message_type_channel\n on combine.source_relation = message_type_channel.source_relation\n and (combine.channel_id = message_type_channel.channel_id\n or combine.message_type_id = message_type_channel.message_type_id)\n)\n\nselect *\nfrom final", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.iterable__journeys": {"database": "postgres", "schema": "public_iterable_dev", "name": "iterable__journeys", "resource_type": "model", "package_name": "iterable", "path": "iterable__journeys.sql", "original_file_path": "models/iterable__journeys.sql", "unique_id": "model.iterable.iterable__journeys", "fqn": ["iterable", "iterable__journeys"], "alias": "iterable__journeys", "checksum": {"name": "sha256", "checksum": "cc93337c06625ef9675afae4540f52c2cb0cb78669a9a881f650742e8679380b"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "table", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "Table that provides aggregations for journeys, formerly known as workflows. Metrics are rolled up from the user/campaign grain via each campaign's journey reference. Journeys which generate no events, such as those that only split audiences or update user fields, are still included with null metrics. The grain of this table is one record per journey.\n", "columns": {"source_relation": {"name": "source_relation", "description": "Identifies the record's source.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": ["doc.iterable.source_relation"]}, "journey_id": {"name": "journey_id", "description": "Unique identifier of the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_journey_id": {"name": "unique_journey_id", "description": "Unique identifier combining journey_id and source_relation.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "journey_name": {"name": "journey_name", "description": "User defined name of the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "journey_type": {"name": "journey_type", "description": "The journey type", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "journey_description": {"name": "journey_description", "description": "Information about the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "creator_user_id": {"name": "creator_user_id", "description": "Reference to the user who created the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "is_enabled": {"name": "is_enabled", "description": "Boolean indicating if the journey is currently enabled", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "is_archived": {"name": "is_archived", "description": "Boolean indicating if the journey has been archived", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "lifetime_limit": {"name": "lifetime_limit", "description": "Maximum number of times a user may enter the journey over their lifetime", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "simultaneous_limit": {"name": "simultaneous_limit", "description": "Maximum number of times a user may be in the journey at the same time", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "start_tile_id": {"name": "start_tile_id", "description": "Reference to the tile which begins the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "trigger_event_names": {"name": "trigger_event_names", "description": "The event names which trigger a user's entry into the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "created_at": {"name": "created_at", "description": "Creation timestamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "updated_at": {"name": "updated_at", "description": "Last update timestamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "The time when a record was last updated by Fivetran.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": ["doc.iterable._fivetran_synced"]}, "count_total_campaigns": {"name": "count_total_campaigns", "description": "Count of distinct campaigns within the journey that generated events", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "count_unique_users": {"name": "count_unique_users", "description": "Count of total unique users within the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "first_event_at": {"name": "first_event_at", "description": "Timestamp of the first event generated by any campaign in the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "last_event_at": {"name": "last_event_at", "description": "Timestamp of the most recent event generated by any campaign in the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_emailclick": {"name": "total_emailclick", "description": "Total email clicks within the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_total_emailclick": {"name": "unique_total_emailclick", "description": "Count of distinct users with email clicks within the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_emailunsubscribe": {"name": "total_emailunsubscribe", "description": "Total email unsubscribe events within the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_total_emailunsubscribe": {"name": "unique_total_emailunsubscribe", "description": "Count of distinct users with email unsubscribe events within the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_emailcomplaint": {"name": "total_emailcomplaint", "description": "Total email complaints within the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_total_emailcomplaint": {"name": "unique_total_emailcomplaint", "description": "Count of distinct users with email complaints within the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_customevent": {"name": "total_customevent", "description": "Total custom events within the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_total_customevent": {"name": "unique_total_customevent", "description": "Count of distinct users with custom events within the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_emailsubscribe": {"name": "total_emailsubscribe", "description": "Total email subscribe events within the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_total_emailsubscribe": {"name": "unique_total_emailsubscribe", "description": "Count of distinct users with email subscribe events within the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_emailopen": {"name": "total_emailopen", "description": "Total email open events within the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_total_emailopen": {"name": "unique_total_emailopen", "description": "Count of distinct users with email open events within the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_pushsend": {"name": "total_pushsend", "description": "Total push send events within the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_total_pushsend": {"name": "unique_total_pushsend", "description": "Count of distinct users with push send events within the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_smsbounce": {"name": "total_smsbounce", "description": "Total sms bounce events within the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_total_smsbounce": {"name": "unique_total_smsbounce", "description": "Count of distinct users with sms bounce events within the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_pushbounce": {"name": "total_pushbounce", "description": "Total push bounce events within the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_total_pushbounce": {"name": "unique_total_pushbounce", "description": "Count of distinct users with push bounce events within the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_inappsendskip": {"name": "total_inappsendskip", "description": "Total in app send skip events within the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_total_inappsendskip": {"name": "unique_total_inappsendskip", "description": "Count of distinct users with in app send skip events within the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_smssend": {"name": "total_smssend", "description": "Total sms send events within the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_total_smssend": {"name": "unique_total_smssend", "description": "Count of distinct users with sms send events within the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_inappsend": {"name": "total_inappsend", "description": "Total in app send events within the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_total_inappsend": {"name": "unique_total_inappsend", "description": "Count of distinct users with in app send events within the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_pushopen": {"name": "total_pushopen", "description": "Total push open events within the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_total_pushopen": {"name": "unique_total_pushopen", "description": "Count of distinct users with push open events within the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_emailsend": {"name": "total_emailsend", "description": "Total email send events within the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_total_emailsend": {"name": "unique_total_emailsend", "description": "Count of distinct users with email send events within the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_pushsendskip": {"name": "total_pushsendskip", "description": "Total push send skip events within the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_total_pushsendskip": {"name": "unique_total_pushsendskip", "description": "Count of distinct users with push send skip events within the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_inappopen": {"name": "total_inappopen", "description": "Total in app open events within the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_total_inappopen": {"name": "unique_total_inappopen", "description": "Count of distinct users with in app open events within the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_emailsendskip": {"name": "total_emailsendskip", "description": "Total email send skip events within the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_total_emailsendskip": {"name": "unique_total_emailsendskip", "description": "Count of distinct users with email send skip events within the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_emailbounce": {"name": "total_emailbounce", "description": "Total email bounce events within the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_total_emailbounce": {"name": "unique_total_emailbounce", "description": "Count of distinct users with email bounce events within the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_inappclick": {"name": "total_inappclick", "description": "Total in app click events within the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_total_inappclick": {"name": "unique_total_inappclick", "description": "Count of distinct users with in app click events within the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_pushuninstall": {"name": "total_pushuninstall", "description": "Total push uninstall events within the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_total_pushuninstall": {"name": "unique_total_pushuninstall", "description": "Count of distinct users with push uninstall events within the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "iterable://models/iterable.yml", "build_path": null, "unrendered_config": {"materialized": "table", "schema": "iterable_{{ var('directed_schema','dev') }}", "enabled": "var('iterable__using_journey', True)", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789419972.8623235, "relation_name": "\"postgres\".\"public_iterable_dev\".\"iterable__journeys\"", "raw_code": "{{ config(enabled=var('iterable__using_journey', True)) }}\n\nwith journey as (\n\n select *\n from {{ ref('stg_iterable__journey') }}\n\n), journey_metrics as (\n\n select *\n from {{ ref('int_iterable__journey_event_metrics') }}\n\n), journey_join as (\n\n {% set exclude_fields = ['source_relation', 'journey_id'] %} -- these are in journey\n\n -- left join so journeys that generate no events, such as audience-splitting or\n -- field-update journeys, are still reported with null metrics\n select\n journey.*,\n {{ dbt_utils.star(from=ref('int_iterable__journey_event_metrics'), except=exclude_fields, relation_alias=\"journey_metrics\") }}\n\n from journey\n\n left join journey_metrics\n on journey.journey_id = journey_metrics.journey_id\n and journey.source_relation = journey_metrics.source_relation\n\n), add_surrogate_key as (\n\n {% set surrogate_key_fields = ['journey_id', 'source_relation'] %}\n\n select\n *,\n {{ dbt_utils.generate_surrogate_key(surrogate_key_fields) }} as unique_journey_id\n\n from journey_join\n)\n\nselect *\nfrom add_surrogate_key", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__journey", "package": null, "version": null}, {"name": "int_iterable__journey_event_metrics", "package": null, "version": null}, {"name": "int_iterable__journey_event_metrics", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt_utils.star", "macro.dbt_utils.generate_surrogate_key"], "nodes": ["model.iterable.stg_iterable__journey", "model.iterable.int_iterable__journey_event_metrics"]}, "compiled_path": "target/compiled/iterable/models/iterable__journeys.sql", "compiled": true, "compiled_code": "\n\nwith journey as (\n\n select *\n from \"postgres\".\"public_iterable_dev\".\"stg_iterable__journey\"\n\n), journey_metrics as (\n\n select *\n from \"postgres\".\"public_iterable_dev\".\"int_iterable__journey_event_metrics\"\n\n), journey_join as (\n\n -- these are in journey\n\n -- left join so journeys that generate no events, such as audience-splitting or\n -- field-update journeys, are still reported with null metrics\n select\n journey.*,\n journey_metrics.\"count_total_campaigns\",\n journey_metrics.\"count_unique_users\",\n journey_metrics.\"first_event_at\",\n journey_metrics.\"last_event_at\",\n journey_metrics.\"total_emailclick\",\n journey_metrics.\"unique_total_emailclick\",\n journey_metrics.\"total_emailunsubscribe\",\n journey_metrics.\"unique_total_emailunsubscribe\",\n journey_metrics.\"total_emailcomplaint\",\n journey_metrics.\"unique_total_emailcomplaint\",\n journey_metrics.\"total_customevent\",\n journey_metrics.\"unique_total_customevent\",\n journey_metrics.\"total_emailsubscribe\",\n journey_metrics.\"unique_total_emailsubscribe\",\n journey_metrics.\"total_emailopen\",\n journey_metrics.\"unique_total_emailopen\",\n journey_metrics.\"total_pushsend\",\n journey_metrics.\"unique_total_pushsend\",\n journey_metrics.\"total_smsbounce\",\n journey_metrics.\"unique_total_smsbounce\",\n journey_metrics.\"total_pushbounce\",\n journey_metrics.\"unique_total_pushbounce\",\n journey_metrics.\"total_inappsendskip\",\n journey_metrics.\"unique_total_inappsendskip\",\n journey_metrics.\"total_smssend\",\n journey_metrics.\"unique_total_smssend\",\n journey_metrics.\"total_inappsend\",\n journey_metrics.\"unique_total_inappsend\",\n journey_metrics.\"total_pushopen\",\n journey_metrics.\"unique_total_pushopen\",\n journey_metrics.\"total_emailsend\",\n journey_metrics.\"unique_total_emailsend\",\n journey_metrics.\"total_pushsendskip\",\n journey_metrics.\"unique_total_pushsendskip\",\n journey_metrics.\"total_inappopen\",\n journey_metrics.\"unique_total_inappopen\",\n journey_metrics.\"total_emailsendskip\",\n journey_metrics.\"unique_total_emailsendskip\",\n journey_metrics.\"total_emailbounce\",\n journey_metrics.\"unique_total_emailbounce\",\n journey_metrics.\"total_inappclick\",\n journey_metrics.\"unique_total_inappclick\",\n journey_metrics.\"total_pushuninstall\",\n journey_metrics.\"unique_total_pushuninstall\"\n\n from journey\n\n left join journey_metrics\n on journey.journey_id = journey_metrics.journey_id\n and journey.source_relation = journey_metrics.source_relation\n\n), add_surrogate_key as (\n\n \n\n select\n *,\n md5(cast(coalesce(cast(journey_id as TEXT), '_dbt_utils_surrogate_key_null_') || '-' || coalesce(cast(source_relation as TEXT), '_dbt_utils_surrogate_key_null_') as TEXT)) as unique_journey_id\n\n from journey_join\n)\n\nselect *\nfrom add_surrogate_key", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": ["unique_journey_id"], "time_spine": null}, "model.iterable.iterable__campaigns": {"database": "postgres", "schema": "public_iterable_dev", "name": "iterable__campaigns", "resource_type": "model", "package_name": "iterable", "path": "iterable__campaigns.sql", "original_file_path": "models/iterable__campaigns.sql", "unique_id": "model.iterable.iterable__campaigns", "fqn": ["iterable", "iterable__campaigns"], "alias": "iterable__campaigns", "checksum": {"name": "sha256", "checksum": "8a06f641cc3e4a6fcf53c1ff0571db0c9b0e7212a2a2ff5ea9111e035a96b0cc"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "table", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "Table that provides aggregations for campaigns at the template and if available, the experiment grain.", "columns": {"source_relation": {"name": "source_relation", "description": "Identifies the record's source.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": ["doc.iterable.source_relation"]}, "campaign_id": {"name": "campaign_id", "description": "Unique identifier of the campaign record", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_campaign_version_id": {"name": "unique_campaign_version_id", "description": "Unique identifier combining campaign_id, template_id, source_relation, and if available, experiment_id.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "campaign_name": {"name": "campaign_name", "description": "User defined name of the campaign.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "updated_at": {"name": "updated_at", "description": "Last update timestamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "campaign_state": {"name": "campaign_state", "description": "State of the campaign. Can be Draft, Ready, Scheduled, Running, Finished, Starting, Aborted or Recurring", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "campaign_type": {"name": "campaign_type", "description": "The campaign type. Can be Blast or Triggered", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "send_size": {"name": "send_size", "description": "Size of the campaign. Number of individuals included in the campaign", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "start_at": {"name": "start_at", "description": "Start timestamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "ended_at": {"name": "ended_at", "description": "Ended timestamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "created_at": {"name": "created_at", "description": "Creation timestamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "created_by_user_id": {"name": "created_by_user_id", "description": "Reference to the user who created the campaign", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "template_id": {"name": "template_id", "description": "Reference to the campaign template", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "recurring_campaign_id": {"name": "recurring_campaign_id", "description": "Unique identifier of the recurring campaign (if applicable)", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "recurring_campaign_name": {"name": "recurring_campaign_name", "description": "Name of the recurring campaign (if applicable)", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "recurring_campaign_state": {"name": "recurring_campaign_state", "description": "State of the recurring campaign (if applicable)", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "recurring_campaign_send_size": {"name": "recurring_campaign_send_size", "description": "Size of the recurring campaign. Number of individuals included in the recurring campaign (if applicable)", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "recurring_campaign_start_at": {"name": "recurring_campaign_start_at", "description": "Timestamp of when the recurring campaign started (if applicable)", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "is_campaign_recurring": {"name": "is_campaign_recurring", "description": "Boolean indicating if the campaign is a recurring campaign", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "experiment_id": {"name": "experiment_id", "description": "Reference to the experiment used if the event is an experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "count_unique_users": {"name": "count_unique_users", "description": "Count of total unique users within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_emailclick": {"name": "total_emailclick", "description": "Total email clicks within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_total_emailclick": {"name": "unique_total_emailclick", "description": "Unique email clicks within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_emailunsubscribe": {"name": "total_emailunsubscribe", "description": "Total email unsubscribe events within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_total_emailunsubscribe": {"name": "unique_total_emailunsubscribe", "description": "Unique total email unsubscribe events within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_emailcomplaint": {"name": "total_emailcomplaint", "description": "Total email complaints within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_total_emailcomplaint": {"name": "unique_total_emailcomplaint", "description": "Unique total email complaints within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_customevent": {"name": "total_customevent", "description": "Total custom events within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_total_customevent": {"name": "unique_total_customevent", "description": "Unique total custom events within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_emailsubscribe": {"name": "total_emailsubscribe", "description": "Total email subscribe events within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_total_emailsubscribe": {"name": "unique_total_emailsubscribe", "description": "Unique total email subscribe events within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_emailopen": {"name": "total_emailopen", "description": "Total email open events within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_total_emailopen": {"name": "unique_total_emailopen", "description": "Unique total email open events within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_pushsend": {"name": "total_pushsend", "description": "Total push send event within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_total_pushsend": {"name": "unique_total_pushsend", "description": "Unique total push send events within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_smsbounce": {"name": "total_smsbounce", "description": "Total sms bounce events within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_total_smsbounce": {"name": "unique_total_smsbounce", "description": "Unique total sms bounce events within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_pushbounce": {"name": "total_pushbounce", "description": "Total push bounce events within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_total_pushbounce": {"name": "unique_total_pushbounce", "description": "Unique total push bounce events within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_inappsendskip": {"name": "total_inappsendskip", "description": "Total in app send skip events within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_total_inappsendskip": {"name": "unique_total_inappsendskip", "description": "Unique total in app send skip events within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_smssend": {"name": "total_smssend", "description": "Total sms send events within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_total_smssend": {"name": "unique_total_smssend", "description": "Unique total sms send events within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_inappsend": {"name": "total_inappsend", "description": "Total in app send events within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_total_inappsend": {"name": "unique_total_inappsend", "description": "Unique total in app send events within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_pushopen": {"name": "total_pushopen", "description": "Total push open events within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_total_pushopen": {"name": "unique_total_pushopen", "description": "Unique total push open events within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_emailsend": {"name": "total_emailsend", "description": "Total email send events within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_total_emailsend": {"name": "unique_total_emailsend", "description": "Unique total email send events within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_pushsendskip": {"name": "total_pushsendskip", "description": "Total push send skip events within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_total_pushsendskip": {"name": "unique_total_pushsendskip", "description": "Unique total push send skip events within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_inappopen": {"name": "total_inappopen", "description": "Total in app open events within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_total_inappopen": {"name": "unique_total_inappopen", "description": "Unique total in app open events within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_emailsendskip": {"name": "total_emailsendskip", "description": "Total email send skip events within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_total_emailsendskip": {"name": "unique_total_emailsendskip", "description": "Unique total email send skip events within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_emailbounce": {"name": "total_emailbounce", "description": "Total email bounce events within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_total_emailbounce": {"name": "unique_total_emailbounce", "description": "Unique total email bounce events within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_inappclick": {"name": "total_inappclick", "description": "Total in app click events within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_total_inappclick": {"name": "unique_total_inappclick", "description": "Unique total in app click events within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_pushuninstall": {"name": "total_pushuninstall", "description": "Total push uninstall events within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_total_pushuninstall": {"name": "unique_total_pushuninstall", "description": "Unique total push uninstall events within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "count_send_lists": {"name": "count_send_lists", "description": "Count of send lists within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "count_suppress_lists": {"name": "count_suppress_lists", "description": "Count of suppress lists within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "labels": {"name": "labels", "description": "List of labels associated with the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "journey_id": {"name": "journey_id", "description": "Reference to the journey the campaign belongs to, if applicable", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "journey_name": {"name": "journey_name", "description": "User defined name of the journey the campaign belongs to, if applicable", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "journey_type": {"name": "journey_type", "description": "The type of the journey the campaign belongs to, if applicable", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "template_name": {"name": "template_name", "description": "Name of the template associated with the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "template_creator_user_id": {"name": "template_creator_user_id", "description": "The creator user id of the template associated with the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "message_medium": {"name": "message_medium", "description": "The medium which the message was provided", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "message_type_name": {"name": "message_type_name", "description": "The message type name associated with the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "channel_name": {"name": "channel_name", "description": "The channel name associated with the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "channel_id": {"name": "channel_id", "description": "The channel identifier associated with the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "channel_type": {"name": "channel_type", "description": "The channel type associated with the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "iterable://models/iterable.yml", "build_path": null, "unrendered_config": {"materialized": "table", "schema": "iterable_{{ var('directed_schema','dev') }}", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789419972.834093, "relation_name": "\"postgres\".\"public_iterable_dev\".\"iterable__campaigns\"", "raw_code": "with campaign_event_metrics as (\n\n select *\n from {{ ref('int_iterable__campaign_event_metrics') }}\n\n), campaign_list_metrics as (\n\n select\n source_relation,\n campaign_id,\n sum(case when list_activity = 'send' then 1 else 0 end) as count_send_lists,\n sum(case when list_activity = 'suppress' then 1 else 0 end) as count_suppress_lists\n\n from {{ ref('int_iterable__campaign_lists') }}\n {{ dbt_utils.group_by(n=2) }}\n\n), campaign as (\n\n select *\n from {{ ref('int_iterable__recurring_campaigns') }}\n \n{% if var('iterable__using_campaign_label_history', true) %}\n), campaign_labels as (\n\n select *\n from {{ ref('int_iterable__campaign_labels') }}\n\n{% endif %}\n\n), template as (\n -- rebringing this in (it is brought in iterable__events) in case any campaigns don't have events yet\n -- this will result in some DAG ugliness but maintains template info for non-sent campaigns\n select *\n from {{ ref('int_iterable__latest_template') }}\n\n{% if var('iterable__using_journey', true) %}\n), journey as (\n\n select *\n from {{ ref('stg_iterable__journey') }}\n\n{% endif %}\n\n), campaign_join as (\n\n {% set exclude_fields = ['source_relation', 'campaign_id', 'template_id'] %} -- these are in campaigns\n\n -- this query will be at the campaign and experiment(if available) variation grain\n select\n campaign.*,\n {{ dbt_utils.star(from=ref('int_iterable__campaign_event_metrics'), except=exclude_fields, relation_alias=\"campaign_event_metrics\") }}\n , \n campaign_list_metrics.count_send_lists,\n campaign_list_metrics.count_suppress_lists,\n {% if var('iterable__using_campaign_label_history', true) %}\n campaign_labels.labels,\n {% endif %}\n {% if var('iterable__using_journey', true) %}\n journey.journey_name,\n journey.journey_type,\n {% endif %}\n template.template_name,\n template.creator_user_id as template_creator_user_id,\n template.message_medium,\n template.message_type_name,\n template.channel_name,\n template.channel_id,\n template.channel_type\n\n from campaign\n left join campaign_event_metrics\n on campaign.campaign_id = campaign_event_metrics.campaign_id\n and campaign.template_id = campaign_event_metrics.template_id\n and campaign.source_relation = campaign_event_metrics.source_relation\n left join campaign_list_metrics\n on campaign.campaign_id = campaign_list_metrics.campaign_id\n and campaign.source_relation = campaign_list_metrics.source_relation\n\n {% if var('iterable__using_campaign_label_history', true) %}\n left join campaign_labels\n on campaign.campaign_id = campaign_labels.campaign_id\n and campaign.source_relation = campaign_labels.source_relation\n {% endif %}\n\n left join template\n on campaign.template_id = template.template_id\n and campaign.source_relation = template.source_relation\n\n {% if var('iterable__using_journey', true) %}\n left join journey\n on campaign.journey_id = journey.journey_id\n and campaign.source_relation = journey.source_relation\n {% endif %}\n\n), add_surrogate_key as (\n\n {% set surrogate_key_fields = ['campaign_id', 'template_id', 'source_relation'] %}\n {% do surrogate_key_fields.append('experiment_id') if var('iterable__using_event_extension', True) %}\n\n select \n *,\n {{ dbt_utils.generate_surrogate_key(surrogate_key_fields) }} as unique_campaign_version_id\n\n from campaign_join\n)\n\nselect *\nfrom add_surrogate_key", "doc_blocks": [], "language": "sql", "refs": [{"name": "int_iterable__campaign_event_metrics", "package": null, "version": null}, {"name": "int_iterable__campaign_lists", "package": null, "version": null}, {"name": "int_iterable__recurring_campaigns", "package": null, "version": null}, {"name": "int_iterable__campaign_labels", "package": null, "version": null}, {"name": "int_iterable__latest_template", "package": null, "version": null}, {"name": "stg_iterable__journey", "package": null, "version": null}, {"name": "int_iterable__campaign_event_metrics", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt_utils.group_by", "macro.dbt_utils.star", "macro.dbt_utils.generate_surrogate_key"], "nodes": ["model.iterable.int_iterable__campaign_event_metrics", "model.iterable.int_iterable__campaign_lists", "model.iterable.int_iterable__recurring_campaigns", "model.iterable.int_iterable__campaign_labels", "model.iterable.int_iterable__latest_template", "model.iterable.stg_iterable__journey"]}, "compiled_path": "target/compiled/iterable/models/iterable__campaigns.sql", "compiled": true, "compiled_code": "with campaign_event_metrics as (\n\n select *\n from \"postgres\".\"public_iterable_dev\".\"int_iterable__campaign_event_metrics\"\n\n), campaign_list_metrics as (\n\n select\n source_relation,\n campaign_id,\n sum(case when list_activity = 'send' then 1 else 0 end) as count_send_lists,\n sum(case when list_activity = 'suppress' then 1 else 0 end) as count_suppress_lists\n\n from \"postgres\".\"public_iterable_dev\".\"int_iterable__campaign_lists\"\n group by 1,2\n\n), campaign as (\n\n select *\n from \"postgres\".\"public_iterable_dev\".\"int_iterable__recurring_campaigns\"\n \n\n), campaign_labels as (\n\n select *\n from \"postgres\".\"public_iterable_dev\".\"int_iterable__campaign_labels\"\n\n\n\n), template as (\n -- rebringing this in (it is brought in iterable__events) in case any campaigns don't have events yet\n -- this will result in some DAG ugliness but maintains template info for non-sent campaigns\n select *\n from \"postgres\".\"public_iterable_dev\".\"int_iterable__latest_template\"\n\n\n), journey as (\n\n select *\n from \"postgres\".\"public_iterable_dev\".\"stg_iterable__journey\"\n\n\n\n), campaign_join as (\n\n -- these are in campaigns\n\n -- this query will be at the campaign and experiment(if available) variation grain\n select\n campaign.*,\n campaign_event_metrics.\"experiment_id\",\n campaign_event_metrics.\"count_unique_users\",\n campaign_event_metrics.\"total_emailclick\",\n campaign_event_metrics.\"unique_total_emailclick\",\n campaign_event_metrics.\"total_emailunsubscribe\",\n campaign_event_metrics.\"unique_total_emailunsubscribe\",\n campaign_event_metrics.\"total_emailcomplaint\",\n campaign_event_metrics.\"unique_total_emailcomplaint\",\n campaign_event_metrics.\"total_customevent\",\n campaign_event_metrics.\"unique_total_customevent\",\n campaign_event_metrics.\"total_emailsubscribe\",\n campaign_event_metrics.\"unique_total_emailsubscribe\",\n campaign_event_metrics.\"total_emailopen\",\n campaign_event_metrics.\"unique_total_emailopen\",\n campaign_event_metrics.\"total_pushsend\",\n campaign_event_metrics.\"unique_total_pushsend\",\n campaign_event_metrics.\"total_smsbounce\",\n campaign_event_metrics.\"unique_total_smsbounce\",\n campaign_event_metrics.\"total_pushbounce\",\n campaign_event_metrics.\"unique_total_pushbounce\",\n campaign_event_metrics.\"total_inappsendskip\",\n campaign_event_metrics.\"unique_total_inappsendskip\",\n campaign_event_metrics.\"total_smssend\",\n campaign_event_metrics.\"unique_total_smssend\",\n campaign_event_metrics.\"total_inappsend\",\n campaign_event_metrics.\"unique_total_inappsend\",\n campaign_event_metrics.\"total_pushopen\",\n campaign_event_metrics.\"unique_total_pushopen\",\n campaign_event_metrics.\"total_emailsend\",\n campaign_event_metrics.\"unique_total_emailsend\",\n campaign_event_metrics.\"total_pushsendskip\",\n campaign_event_metrics.\"unique_total_pushsendskip\",\n campaign_event_metrics.\"total_inappopen\",\n campaign_event_metrics.\"unique_total_inappopen\",\n campaign_event_metrics.\"total_emailsendskip\",\n campaign_event_metrics.\"unique_total_emailsendskip\",\n campaign_event_metrics.\"total_emailbounce\",\n campaign_event_metrics.\"unique_total_emailbounce\",\n campaign_event_metrics.\"total_inappclick\",\n campaign_event_metrics.\"unique_total_inappclick\",\n campaign_event_metrics.\"total_pushuninstall\",\n campaign_event_metrics.\"unique_total_pushuninstall\"\n , \n campaign_list_metrics.count_send_lists,\n campaign_list_metrics.count_suppress_lists,\n \n campaign_labels.labels,\n \n \n journey.journey_name,\n journey.journey_type,\n \n template.template_name,\n template.creator_user_id as template_creator_user_id,\n template.message_medium,\n template.message_type_name,\n template.channel_name,\n template.channel_id,\n template.channel_type\n\n from campaign\n left join campaign_event_metrics\n on campaign.campaign_id = campaign_event_metrics.campaign_id\n and campaign.template_id = campaign_event_metrics.template_id\n and campaign.source_relation = campaign_event_metrics.source_relation\n left join campaign_list_metrics\n on campaign.campaign_id = campaign_list_metrics.campaign_id\n and campaign.source_relation = campaign_list_metrics.source_relation\n\n \n left join campaign_labels\n on campaign.campaign_id = campaign_labels.campaign_id\n and campaign.source_relation = campaign_labels.source_relation\n \n\n left join template\n on campaign.template_id = template.template_id\n and campaign.source_relation = template.source_relation\n\n \n left join journey\n on campaign.journey_id = journey.journey_id\n and campaign.source_relation = journey.source_relation\n \n\n), add_surrogate_key as (\n\n \n \n\n select \n *,\n md5(cast(coalesce(cast(campaign_id as TEXT), '_dbt_utils_surrogate_key_null_') || '-' || coalesce(cast(template_id as TEXT), '_dbt_utils_surrogate_key_null_') || '-' || coalesce(cast(source_relation as TEXT), '_dbt_utils_surrogate_key_null_') || '-' || coalesce(cast(experiment_id as TEXT), '_dbt_utils_surrogate_key_null_') as TEXT)) as unique_campaign_version_id\n\n from campaign_join\n)\n\nselect *\nfrom add_surrogate_key", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.int_iterable__campaign_labels": {"database": "postgres", "schema": "public_iterable_dev", "name": "int_iterable__campaign_labels", "resource_type": "model", "package_name": "iterable", "path": "intermediate/int_iterable__campaign_labels.sql", "original_file_path": "models/intermediate/int_iterable__campaign_labels.sql", "unique_id": "model.iterable.int_iterable__campaign_labels", "fqn": ["iterable", "intermediate", "int_iterable__campaign_labels"], "alias": "int_iterable__campaign_labels", "checksum": {"name": "sha256", "checksum": "64ae8d410bd6673399326348a650a7facc7b6631aa34fbb01a1598cb96c7d012"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "Table that provides the distinct string aggregation of labels for each campaign.", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "iterable://models/intermediate/int_iterable.yml", "build_path": null, "unrendered_config": {"materialized": "view", "schema": "iterable_{{ var('directed_schema','dev') }}", "enabled": "var('iterable__using_campaign_label_history', True)", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789419972.9844291, "relation_name": "\"postgres\".\"public_iterable_dev\".\"int_iterable__campaign_labels\"", "raw_code": "{{ config(enabled=var('iterable__using_campaign_label_history', True)) }}\n\nwith campaign_label_history as (\n\n select *\n from {{ ref('stg_iterable__campaign_label_history') }}\n\n), order_campaign_labels as (\n\n select \n *,\n rank() over(partition by campaign_id{{ fivetran_utils.partition_by_source_relation(package_name='iterable') }} order by updated_at desc) as latest_label_batch_index\n\n from campaign_label_history\n\n), latest_labels as (\n\n select *\n from order_campaign_labels\n where latest_label_batch_index = 1\n\n), aggregate_labels as (\n\n select\n source_relation,\n campaign_id,\n {{ fivetran_utils.string_agg('distinct label', \"', '\") }} as labels\n\n from latest_labels\n {{ dbt_utils.group_by(n=2) }}\n)\n\nselect * from aggregate_labels", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__campaign_label_history", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.fivetran_utils.partition_by_source_relation", "macro.fivetran_utils.string_agg", "macro.dbt_utils.group_by"], "nodes": ["model.iterable.stg_iterable__campaign_label_history"]}, "compiled_path": "target/compiled/iterable/models/intermediate/int_iterable__campaign_labels.sql", "compiled": true, "compiled_code": "\n\nwith campaign_label_history as (\n\n select *\n from \"postgres\".\"public_iterable_dev\".\"stg_iterable__campaign_label_history\"\n\n), order_campaign_labels as (\n\n select \n *,\n rank() over(partition by campaign_id order by updated_at desc) as latest_label_batch_index\n\n from campaign_label_history\n\n), latest_labels as (\n\n select *\n from order_campaign_labels\n where latest_label_batch_index = 1\n\n), aggregate_labels as (\n\n select\n source_relation,\n campaign_id,\n \n string_agg(distinct label, ', ')\n\n as labels\n\n from latest_labels\n group by 1,2\n)\n\nselect * from aggregate_labels", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.int_iterable__journey_event_metrics": {"database": "postgres", "schema": "public_iterable_dev", "name": "int_iterable__journey_event_metrics", "resource_type": "model", "package_name": "iterable", "path": "intermediate/int_iterable__journey_event_metrics.sql", "original_file_path": "models/intermediate/int_iterable__journey_event_metrics.sql", "unique_id": "model.iterable.int_iterable__journey_event_metrics", "fqn": ["iterable", "intermediate", "int_iterable__journey_event_metrics"], "alias": "int_iterable__journey_event_metrics", "checksum": {"name": "sha256", "checksum": "bfde0156d4c1044ca7bc2993a11f34370dba3692b6d75b001ed4a9ba799b38b4"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "Table that generates relevant total and unique journey level aggregations, rolled up from the user/campaign grain via the campaign's journey reference.", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "iterable://models/intermediate/int_iterable.yml", "build_path": null, "unrendered_config": {"materialized": "view", "schema": "iterable_{{ var('directed_schema','dev') }}", "enabled": "var('iterable__using_journey', True)", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789419972.9853535, "relation_name": "\"postgres\".\"public_iterable_dev\".\"int_iterable__journey_event_metrics\"", "raw_code": "{{ config(enabled=var('iterable__using_journey', True)) }}\n\nwith user_campaign as (\n select *\n from {{ ref('iterable__user_campaign') }}\n\n), campaign as (\n\n select\n source_relation,\n campaign_id,\n journey_id\n\n from {{ ref('int_iterable__recurring_campaigns') }}\n where journey_id is not null\n\n), journey_event_metrics as (\n{%- set user_campaign_columns = adapter.get_columns_in_relation(ref('iterable__user_campaign')) %}\n{%- set non_agg_columns = ['source_relation', 'unique_user_key', 'user_id', '_fivetran_user_id',\n 'user_email', 'user_full_name', 'campaign_id', 'campaign_name', 'recurring_campaign_id',\n 'recurring_campaign_name', 'first_event_at', 'last_event_at', 'template_id', 'template_name',\n 'experiment_id', 'unique_user_campaign_id', 'first_open_or_click_event_at'\n ] %}\n\n select\n campaign.source_relation,\n campaign.journey_id,\n count(distinct user_campaign.campaign_id) as count_total_campaigns,\n count(distinct user_campaign.unique_user_key) as count_unique_users,\n min(user_campaign.first_event_at) as first_event_at,\n max(user_campaign.last_event_at) as last_event_at\n {% for col in user_campaign_columns if col.name|lower not in non_agg_columns %}\n , sum(user_campaign.{{ col.name }}) as {{ col.name }}\n -- counts distinct users; campaign_event_metrics counts distinct emails\n , count(distinct case when user_campaign.{{ col.name }} > 0 then user_campaign.unique_user_key else null end) as unique_{{ col.name }}\n {% endfor %}\n\n from user_campaign\n\n inner join campaign\n on user_campaign.campaign_id = campaign.campaign_id\n and user_campaign.source_relation = campaign.source_relation\n\n {{ dbt_utils.group_by(n=2) }}\n)\n\nselect *\nfrom journey_event_metrics", "doc_blocks": [], "language": "sql", "refs": [{"name": "iterable__user_campaign", "package": null, "version": null}, {"name": "int_iterable__recurring_campaigns", "package": null, "version": null}, {"name": "iterable__user_campaign", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt_utils.group_by"], "nodes": ["model.iterable.iterable__user_campaign", "model.iterable.int_iterable__recurring_campaigns"]}, "compiled_path": "target/compiled/iterable/models/intermediate/int_iterable__journey_event_metrics.sql", "compiled": true, "compiled_code": "\n\nwith user_campaign as (\n select *\n from \"postgres\".\"public_iterable_dev\".\"iterable__user_campaign\"\n\n), campaign as (\n\n select\n source_relation,\n campaign_id,\n journey_id\n\n from \"postgres\".\"public_iterable_dev\".\"int_iterable__recurring_campaigns\"\n where journey_id is not null\n\n), journey_event_metrics as (\n\n select\n campaign.source_relation,\n campaign.journey_id,\n count(distinct user_campaign.campaign_id) as count_total_campaigns,\n count(distinct user_campaign.unique_user_key) as count_unique_users,\n min(user_campaign.first_event_at) as first_event_at,\n max(user_campaign.last_event_at) as last_event_at\n \n , sum(user_campaign.total_emailclick) as total_emailclick\n -- counts distinct users; campaign_event_metrics counts distinct emails\n , count(distinct case when user_campaign.total_emailclick > 0 then user_campaign.unique_user_key else null end) as unique_total_emailclick\n \n , sum(user_campaign.total_emailunsubscribe) as total_emailunsubscribe\n -- counts distinct users; campaign_event_metrics counts distinct emails\n , count(distinct case when user_campaign.total_emailunsubscribe > 0 then user_campaign.unique_user_key else null end) as unique_total_emailunsubscribe\n \n , sum(user_campaign.total_emailcomplaint) as total_emailcomplaint\n -- counts distinct users; campaign_event_metrics counts distinct emails\n , count(distinct case when user_campaign.total_emailcomplaint > 0 then user_campaign.unique_user_key else null end) as unique_total_emailcomplaint\n \n , sum(user_campaign.total_customevent) as total_customevent\n -- counts distinct users; campaign_event_metrics counts distinct emails\n , count(distinct case when user_campaign.total_customevent > 0 then user_campaign.unique_user_key else null end) as unique_total_customevent\n \n , sum(user_campaign.total_emailsubscribe) as total_emailsubscribe\n -- counts distinct users; campaign_event_metrics counts distinct emails\n , count(distinct case when user_campaign.total_emailsubscribe > 0 then user_campaign.unique_user_key else null end) as unique_total_emailsubscribe\n \n , sum(user_campaign.total_emailopen) as total_emailopen\n -- counts distinct users; campaign_event_metrics counts distinct emails\n , count(distinct case when user_campaign.total_emailopen > 0 then user_campaign.unique_user_key else null end) as unique_total_emailopen\n \n , sum(user_campaign.total_pushsend) as total_pushsend\n -- counts distinct users; campaign_event_metrics counts distinct emails\n , count(distinct case when user_campaign.total_pushsend > 0 then user_campaign.unique_user_key else null end) as unique_total_pushsend\n \n , sum(user_campaign.total_smsbounce) as total_smsbounce\n -- counts distinct users; campaign_event_metrics counts distinct emails\n , count(distinct case when user_campaign.total_smsbounce > 0 then user_campaign.unique_user_key else null end) as unique_total_smsbounce\n \n , sum(user_campaign.total_pushbounce) as total_pushbounce\n -- counts distinct users; campaign_event_metrics counts distinct emails\n , count(distinct case when user_campaign.total_pushbounce > 0 then user_campaign.unique_user_key else null end) as unique_total_pushbounce\n \n , sum(user_campaign.total_inappsendskip) as total_inappsendskip\n -- counts distinct users; campaign_event_metrics counts distinct emails\n , count(distinct case when user_campaign.total_inappsendskip > 0 then user_campaign.unique_user_key else null end) as unique_total_inappsendskip\n \n , sum(user_campaign.total_smssend) as total_smssend\n -- counts distinct users; campaign_event_metrics counts distinct emails\n , count(distinct case when user_campaign.total_smssend > 0 then user_campaign.unique_user_key else null end) as unique_total_smssend\n \n , sum(user_campaign.total_inappsend) as total_inappsend\n -- counts distinct users; campaign_event_metrics counts distinct emails\n , count(distinct case when user_campaign.total_inappsend > 0 then user_campaign.unique_user_key else null end) as unique_total_inappsend\n \n , sum(user_campaign.total_pushopen) as total_pushopen\n -- counts distinct users; campaign_event_metrics counts distinct emails\n , count(distinct case when user_campaign.total_pushopen > 0 then user_campaign.unique_user_key else null end) as unique_total_pushopen\n \n , sum(user_campaign.total_emailsend) as total_emailsend\n -- counts distinct users; campaign_event_metrics counts distinct emails\n , count(distinct case when user_campaign.total_emailsend > 0 then user_campaign.unique_user_key else null end) as unique_total_emailsend\n \n , sum(user_campaign.total_pushsendskip) as total_pushsendskip\n -- counts distinct users; campaign_event_metrics counts distinct emails\n , count(distinct case when user_campaign.total_pushsendskip > 0 then user_campaign.unique_user_key else null end) as unique_total_pushsendskip\n \n , sum(user_campaign.total_inappopen) as total_inappopen\n -- counts distinct users; campaign_event_metrics counts distinct emails\n , count(distinct case when user_campaign.total_inappopen > 0 then user_campaign.unique_user_key else null end) as unique_total_inappopen\n \n , sum(user_campaign.total_emailsendskip) as total_emailsendskip\n -- counts distinct users; campaign_event_metrics counts distinct emails\n , count(distinct case when user_campaign.total_emailsendskip > 0 then user_campaign.unique_user_key else null end) as unique_total_emailsendskip\n \n , sum(user_campaign.total_emailbounce) as total_emailbounce\n -- counts distinct users; campaign_event_metrics counts distinct emails\n , count(distinct case when user_campaign.total_emailbounce > 0 then user_campaign.unique_user_key else null end) as unique_total_emailbounce\n \n , sum(user_campaign.total_inappclick) as total_inappclick\n -- counts distinct users; campaign_event_metrics counts distinct emails\n , count(distinct case when user_campaign.total_inappclick > 0 then user_campaign.unique_user_key else null end) as unique_total_inappclick\n \n , sum(user_campaign.total_pushuninstall) as total_pushuninstall\n -- counts distinct users; campaign_event_metrics counts distinct emails\n , count(distinct case when user_campaign.total_pushuninstall > 0 then user_campaign.unique_user_key else null end) as unique_total_pushuninstall\n \n\n from user_campaign\n\n inner join campaign\n on user_campaign.campaign_id = campaign.campaign_id\n and user_campaign.source_relation = campaign.source_relation\n\n group by 1,2\n)\n\nselect *\nfrom journey_event_metrics", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.int_iterable__list_user_unnest": {"database": "postgres", "schema": "public_iterable_dev", "name": "int_iterable__list_user_unnest", "resource_type": "model", "package_name": "iterable", "path": "intermediate/int_iterable__list_user_unnest.sql", "original_file_path": "models/intermediate/int_iterable__list_user_unnest.sql", "unique_id": "model.iterable.int_iterable__list_user_unnest", "fqn": ["iterable", "intermediate", "int_iterable__list_user_unnest"], "alias": "int_iterable__list_user_unnest", "checksum": {"name": "sha256", "checksum": "82ec833586106f02efef7fe24516f3323171e61f1083323e97c892f21ddfa263"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "incremental", "incremental_strategy": "delete+insert", "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": "unique_key", "on_schema_change": "fail", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}, "partition_by": {"field": "date_day", "data_type": "date"}, "file_format": "delta"}, "tags": [], "description": "Table that unnests the `email_list_id` field for each user to create a new record for each user and the unique list it was associated with at a unique update. Due to the unnesting functions varying greatly between warehouses, conditional logic is applied throughout the model to appropriately accommodate the model being ran within Redshift, Snowflake, BigQuery, and Postgres.\n", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "iterable://models/intermediate/int_iterable.yml", "build_path": null, "unrendered_config": {"materialized": "incremental", "schema": "iterable_{{ var('directed_schema','dev') }}", "unique_key": "unique_key", "incremental_strategy": "CondExpr(test=Compare(expr=Getattr(node=Name(name='target', ctx='load'), attr='type', ctx='load'), ops=[Operand(op='in', expr=Tuple(items=[Const(value='bigquery'), Const(value='spark'), Const(value='databricks')], ctx='load'))]), expr1=Const(value='insert_overwrite'), expr2=Const(value='delete+insert'))", "partition_by": "CondExpr(test=Compare(expr=Getattr(node=Name(name='target', ctx='load'), attr='type', ctx='load'), ops=[Operand(op='notin', expr=Tuple(items=[Const(value='spark'), Const(value='databricks'), Const(value='duckdb')], ctx='load'))]), expr1=Dict(items=[Pair(key=Const(value='field'), value=Const(value='date_day')), Pair(key=Const(value='data_type'), value=Const(value='date'))]), expr2=List(items=[Const(value='date_day')]))", "file_format": "delta", "on_schema_change": "fail", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789419972.9876084, "relation_name": "\"postgres\".\"public_iterable_dev\".\"int_iterable__list_user_unnest\"", "raw_code": "{{ config(\n materialized='incremental',\n unique_key='unique_key',\n incremental_strategy='insert_overwrite' if target.type in ('bigquery', 'spark', 'databricks') else 'delete+insert',\n partition_by={\"field\": \"date_day\", \"data_type\": \"date\"} if target.type not in ('spark', 'databricks', 'duckdb') else ['date_day'],\n file_format='delta',\n on_schema_change='fail'\n )\n}}\n\nwith user_history as (\n\n select *\n from {{ ref('int_iterable__list_user_history') }} as user_history\n\n {% if is_incremental() %}\n {# the only rows we potentially want to overwrite are active ones #}\n where user_history.updated_at >= coalesce((select min(updated_at) from {{ this }} where is_current), '2010-01-01')\n {% endif %}\n\n{% if target.type == 'redshift' %}\n{# using PartiQL syntax to work with redshift's SUPER types #}\n), redshift_parse_email_lists as (\n\n select\n source_relation,\n _fivetran_user_id,\n unique_user_key,\n email,\n first_name,\n last_name,\n user_id,\n signup_date,\n signup_source,\n phone_number,\n updated_at,\n is_current,\n email_list_ids,\n {# let's not remove empty array-rows #}\n json_parse(case when email_list_ids = '[]' then '[\"is_null\"]' else email_list_ids end) as super_email_list_ids\n\n --The below script allows for pass through columns.\n {{ fivetran_utils.persist_pass_through_columns(pass_through_variable='iterable_user_history_pass_through_columns', identifier='user_history') }}\n\n from user_history\n\n), unnest_email_array as (\n\n select\n source_relation,\n _fivetran_user_id,\n unique_user_key,\n email,\n first_name,\n last_name,\n user_id,\n signup_date,\n signup_source,\n phone_number,\n updated_at,\n is_current,\n {# go back to strings #}\n cast(email_list_ids as {{ dbt.type_string() }}) as email_list_ids,\n cast(email_list_id as {{ dbt.type_string() }}) as email_list_id\n\n --The below script allows for pass through columns.\n {{ fivetran_utils.persist_pass_through_columns(pass_through_variable='iterable_user_history_pass_through_columns', identifier='emails') }}\n\n from redshift_parse_email_lists as emails, emails.super_email_list_ids as email_list_id\n\n{% else %}\n), unnest_email_array as (\n\n select\n source_relation,\n _fivetran_user_id,\n unique_user_key,\n email,\n first_name,\n last_name,\n user_id,\n signup_date,\n signup_source,\n phone_number,\n updated_at,\n is_current,\n email_list_ids,\n case when email_list_ids != '[]' then\n {% if target.type == 'snowflake' %}\n email_list_id.value\n {% elif target.type in ('spark','databricks') %}\n email_list_id.col\n {% else %} email_list_id {% endif %}\n else null\n end as email_list_id\n\n --The below script allows for pass through columns.\n {{ fivetran_utils.persist_pass_through_columns(pass_through_variable='iterable_user_history_pass_through_columns', identifier='user_history') }}\n\n from user_history\n\n {% if target.type == 'snowflake' %}\n cross join\n table(flatten(input => parse_json(\n case when email_list_ids = '[]' then '[\"is_null\"]' {# to not remove empty array-rows #}\n else email_list_ids end))) as email_list_id\n {% elif target.type == 'bigquery' %}\n cross join\n unnest(JSON_EXTRACT_STRING_ARRAY(\n case when email_list_ids = '[]' then '[\"is_null\"]' {# to not remove empty array-rows #}\n else email_list_ids end)) as email_list_id\n {% elif target.type in ('spark','databricks') %}\n cross join\n lateral explode_outer(from_json(\n case when email_list_ids = '[]' then '[\"is_null\"]' {# to not remove empty array-rows #}\n else email_list_ids end, 'array')) as email_list_id\n {% elif target.type == 'duckdb' %}\n cross join\n unnest(from_json(cast((\n case when email_list_ids = '[]' then '[\"is_null\"]' {# to not remove empty array-rows #}\n else email_list_ids end) as varchar), '[\"VARCHAR\"]')) as t(email_list_id)\n {% else %} {# target is postgres #}\n cross join\n json_array_elements_text(cast((\n case when email_list_ids = '[]' then '[\"is_null\"]' {# to not remove empty array-rows #}\n else email_list_ids end) as json)) as email_list_id\n {%- endif %}\n\n{%- endif -%}\n), adjust_nulls as (\n\n select\n source_relation,\n _fivetran_user_id,\n unique_user_key,\n email,\n first_name,\n last_name,\n user_id,\n signup_date,\n signup_source,\n updated_at,\n phone_number,\n is_current,\n case when email_list_ids = '[\"is_null\"]' then '[]' else email_list_ids end as email_list_ids,\n cast(NULLIF(email_list_id, 'is_null') as {{ dbt.type_int() }}) as list_id\n\n --The below script allows for pass through columns.\n {{ fivetran_utils.persist_pass_through_columns(pass_through_variable='iterable_user_history_pass_through_columns', identifier='unnest_email_array') }}\n\n from unnest_email_array\n\n), final as (\n\n select\n source_relation,\n _fivetran_user_id,\n unique_user_key,\n user_id,\n email,\n first_name,\n last_name,\n signup_date,\n signup_source,\n updated_at,\n phone_number,\n is_current,\n email_list_ids,\n list_id,\n {{ dbt_utils.generate_surrogate_key([\"source_relation\", \"unique_user_key\", \"list_id\", \"updated_at\"]) }} as unique_key,\n cast( {{ dbt.date_trunc('day', 'updated_at') }} as date) as date_day\n\n --The below script allows for pass through columns.\n {{ fivetran_utils.persist_pass_through_columns(pass_through_variable='iterable_user_history_pass_through_columns', identifier='adjust_nulls') }}\n\n from adjust_nulls\n)\n\nselect *\nfrom final", "doc_blocks": [], "language": "sql", "refs": [{"name": "int_iterable__list_user_history", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.is_incremental", "macro.fivetran_utils.persist_pass_through_columns", "macro.dbt.type_int", "macro.dbt_utils.generate_surrogate_key", "macro.dbt.date_trunc"], "nodes": ["model.iterable.int_iterable__list_user_history"]}, "compiled_path": "target/compiled/iterable/models/intermediate/int_iterable__list_user_unnest.sql", "compiled": true, "compiled_code": "\n\nwith user_history as (\n\n select *\n from \"postgres\".\"public_iterable_dev\".\"int_iterable__list_user_history\" as user_history\n\n \n \n where user_history.updated_at >= coalesce((select min(updated_at) from \"postgres\".\"public_iterable_dev\".\"int_iterable__list_user_unnest\" where is_current), '2010-01-01')\n \n\n\n), unnest_email_array as (\n\n select\n source_relation,\n _fivetran_user_id,\n unique_user_key,\n email,\n first_name,\n last_name,\n user_id,\n signup_date,\n signup_source,\n phone_number,\n updated_at,\n is_current,\n email_list_ids,\n case when email_list_ids != '[]' then\n email_list_id \n else null\n end as email_list_id\n\n --The below script allows for pass through columns.\n \n\n\n\n\n\n from user_history\n\n \n cross join\n json_array_elements_text(cast((\n case when email_list_ids = '[]' then '[\"is_null\"]' \n else email_list_ids end) as json)) as email_list_id), adjust_nulls as (\n\n select\n source_relation,\n _fivetran_user_id,\n unique_user_key,\n email,\n first_name,\n last_name,\n user_id,\n signup_date,\n signup_source,\n updated_at,\n phone_number,\n is_current,\n case when email_list_ids = '[\"is_null\"]' then '[]' else email_list_ids end as email_list_ids,\n cast(NULLIF(email_list_id, 'is_null') as integer) as list_id\n\n --The below script allows for pass through columns.\n \n\n\n\n\n\n from unnest_email_array\n\n), final as (\n\n select\n source_relation,\n _fivetran_user_id,\n unique_user_key,\n user_id,\n email,\n first_name,\n last_name,\n signup_date,\n signup_source,\n updated_at,\n phone_number,\n is_current,\n email_list_ids,\n list_id,\n md5(cast(coalesce(cast(source_relation as TEXT), '_dbt_utils_surrogate_key_null_') || '-' || coalesce(cast(unique_user_key as TEXT), '_dbt_utils_surrogate_key_null_') || '-' || coalesce(cast(list_id as TEXT), '_dbt_utils_surrogate_key_null_') || '-' || coalesce(cast(updated_at as TEXT), '_dbt_utils_surrogate_key_null_') as TEXT)) as unique_key,\n cast( date_trunc('day', updated_at) as date) as date_day\n\n --The below script allows for pass through columns.\n \n\n\n\n\n\n from adjust_nulls\n)\n\nselect *\nfrom final", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.int_iterable__latest_template": {"database": "postgres", "schema": "public_iterable_dev", "name": "int_iterable__latest_template", "resource_type": "model", "package_name": "iterable", "path": "intermediate/int_iterable__latest_template.sql", "original_file_path": "models/intermediate/int_iterable__latest_template.sql", "unique_id": "model.iterable.int_iterable__latest_template", "fqn": ["iterable", "intermediate", "int_iterable__latest_template"], "alias": "int_iterable__latest_template", "checksum": {"name": "sha256", "checksum": "44d385d803b47bd9be4b5bfc6d78b88689e9c113d478ba8feb96f91717f45b3b"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "Table that provides the most recent version of the template as well as joining relevant message type information.", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "iterable://models/intermediate/int_iterable.yml", "build_path": null, "unrendered_config": {"materialized": "view", "schema": "iterable_{{ var('directed_schema','dev') }}", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789419972.9862804, "relation_name": "\"postgres\".\"public_iterable_dev\".\"int_iterable__latest_template\"", "raw_code": "with template_history as (\n select *\n from {{ ref('stg_iterable__template_history') }}\n\n), order_template as (\n select\n *,\n row_number() over(partition by template_id{{ fivetran_utils.partition_by_source_relation(package_name='iterable') }} order by updated_at desc) as latest_template_index\n from template_history\n\n), latest_template as (\n\n select *\n from order_template\n where latest_template_index = 1\n\n), message_type_channel as (\n\n select *\n from {{ ref('int_iterable__message_type_channel') }}\n\n), template_join as (\n\n select \n latest_template.*,\n message_type_channel.message_type_name,\n message_type_channel.channel_id,\n message_type_channel.channel_name,\n message_type_channel.channel_type,\n message_type_channel.message_medium\n\n from latest_template \n left join message_type_channel\n on latest_template.message_type_id = message_type_channel.message_type_id\n and latest_template.source_relation = message_type_channel.source_relation\n)\n\nselect *\nfrom template_join", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__template_history", "package": null, "version": null}, {"name": "int_iterable__message_type_channel", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.fivetran_utils.partition_by_source_relation"], "nodes": ["model.iterable.stg_iterable__template_history", "model.iterable.int_iterable__message_type_channel"]}, "compiled_path": "target/compiled/iterable/models/intermediate/int_iterable__latest_template.sql", "compiled": true, "compiled_code": "with template_history as (\n select *\n from \"postgres\".\"public_iterable_dev\".\"stg_iterable__template_history\"\n\n), order_template as (\n select\n *,\n row_number() over(partition by template_id order by updated_at desc) as latest_template_index\n from template_history\n\n), latest_template as (\n\n select *\n from order_template\n where latest_template_index = 1\n\n), message_type_channel as (\n\n select *\n from \"postgres\".\"public_iterable_dev\".\"int_iterable__message_type_channel\"\n\n), template_join as (\n\n select \n latest_template.*,\n message_type_channel.message_type_name,\n message_type_channel.channel_id,\n message_type_channel.channel_name,\n message_type_channel.channel_type,\n message_type_channel.message_medium\n\n from latest_template \n left join message_type_channel\n on latest_template.message_type_id = message_type_channel.message_type_id\n and latest_template.source_relation = message_type_channel.source_relation\n)\n\nselect *\nfrom template_join", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.int_iterable__campaign_event_metrics": {"database": "postgres", "schema": "public_iterable_dev", "name": "int_iterable__campaign_event_metrics", "resource_type": "model", "package_name": "iterable", "path": "intermediate/int_iterable__campaign_event_metrics.sql", "original_file_path": "models/intermediate/int_iterable__campaign_event_metrics.sql", "unique_id": "model.iterable.int_iterable__campaign_event_metrics", "fqn": ["iterable", "intermediate", "int_iterable__campaign_event_metrics"], "alias": "int_iterable__campaign_event_metrics", "checksum": {"name": "sha256", "checksum": "81038e93b6f7f8151fb0d719780a87ebc5bd95b613431564e7c470121a174e26"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "Table that generates relevant total and unique campaign/experiment level aggregations.", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "iterable://models/intermediate/int_iterable.yml", "build_path": null, "unrendered_config": {"materialized": "view", "schema": "iterable_{{ var('directed_schema','dev') }}", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789419972.9839199, "relation_name": "\"postgres\".\"public_iterable_dev\".\"int_iterable__campaign_event_metrics\"", "raw_code": "with user_campaign as (\n select *\n from {{ ref('iterable__user_campaign') }}\n\n), campaign_user_event_metrics as (\n{%- set using_event_extension = var('iterable__using_event_extension', True) %}\n{%- set user_campaign_columns = adapter.get_columns_in_relation(ref('iterable__user_campaign')) %}\n{%- set non_agg_columns = ['source_relation', 'unique_user_key', 'user_id', '_fivetran_user_id', \n 'user_email', 'user_full_name', 'campaign_id', 'campaign_name', 'recurring_campaign_id', \n 'recurring_campaign_name', 'first_event_at', 'last_event_at', 'template_id', 'template_name', \n 'experiment_id', 'unique_user_campaign_id', 'first_open_or_click_event_at'\n ] %}\n\n select\n source_relation,\n campaign_id,\n template_id\n {{ \", experiment_id\" if using_event_extension }}\n , count(distinct unique_user_key) as count_unique_users\n {% for col in user_campaign_columns if col.name|lower not in non_agg_columns %}\n , sum({{ col.name }}) as {{ col.name }}\n , count(distinct case when {{ col.name }} > 0 then user_email else null end) as unique_{{ col.name }}\n {% endfor %}\n \n from user_campaign\n \n {{ dbt_utils.group_by(n=4 if using_event_extension else 3) }}\n)\n\nselect *\nfrom campaign_user_event_metrics", "doc_blocks": [], "language": "sql", "refs": [{"name": "iterable__user_campaign", "package": null, "version": null}, {"name": "iterable__user_campaign", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt_utils.group_by"], "nodes": ["model.iterable.iterable__user_campaign"]}, "compiled_path": "target/compiled/iterable/models/intermediate/int_iterable__campaign_event_metrics.sql", "compiled": true, "compiled_code": "with user_campaign as (\n select *\n from \"postgres\".\"public_iterable_dev\".\"iterable__user_campaign\"\n\n), campaign_user_event_metrics as (\n\n select\n source_relation,\n campaign_id,\n template_id\n , experiment_id\n , count(distinct unique_user_key) as count_unique_users\n \n , sum(total_emailclick) as total_emailclick\n , count(distinct case when total_emailclick > 0 then user_email else null end) as unique_total_emailclick\n \n , sum(total_emailunsubscribe) as total_emailunsubscribe\n , count(distinct case when total_emailunsubscribe > 0 then user_email else null end) as unique_total_emailunsubscribe\n \n , sum(total_emailcomplaint) as total_emailcomplaint\n , count(distinct case when total_emailcomplaint > 0 then user_email else null end) as unique_total_emailcomplaint\n \n , sum(total_customevent) as total_customevent\n , count(distinct case when total_customevent > 0 then user_email else null end) as unique_total_customevent\n \n , sum(total_emailsubscribe) as total_emailsubscribe\n , count(distinct case when total_emailsubscribe > 0 then user_email else null end) as unique_total_emailsubscribe\n \n , sum(total_emailopen) as total_emailopen\n , count(distinct case when total_emailopen > 0 then user_email else null end) as unique_total_emailopen\n \n , sum(total_pushsend) as total_pushsend\n , count(distinct case when total_pushsend > 0 then user_email else null end) as unique_total_pushsend\n \n , sum(total_smsbounce) as total_smsbounce\n , count(distinct case when total_smsbounce > 0 then user_email else null end) as unique_total_smsbounce\n \n , sum(total_pushbounce) as total_pushbounce\n , count(distinct case when total_pushbounce > 0 then user_email else null end) as unique_total_pushbounce\n \n , sum(total_inappsendskip) as total_inappsendskip\n , count(distinct case when total_inappsendskip > 0 then user_email else null end) as unique_total_inappsendskip\n \n , sum(total_smssend) as total_smssend\n , count(distinct case when total_smssend > 0 then user_email else null end) as unique_total_smssend\n \n , sum(total_inappsend) as total_inappsend\n , count(distinct case when total_inappsend > 0 then user_email else null end) as unique_total_inappsend\n \n , sum(total_pushopen) as total_pushopen\n , count(distinct case when total_pushopen > 0 then user_email else null end) as unique_total_pushopen\n \n , sum(total_emailsend) as total_emailsend\n , count(distinct case when total_emailsend > 0 then user_email else null end) as unique_total_emailsend\n \n , sum(total_pushsendskip) as total_pushsendskip\n , count(distinct case when total_pushsendskip > 0 then user_email else null end) as unique_total_pushsendskip\n \n , sum(total_inappopen) as total_inappopen\n , count(distinct case when total_inappopen > 0 then user_email else null end) as unique_total_inappopen\n \n , sum(total_emailsendskip) as total_emailsendskip\n , count(distinct case when total_emailsendskip > 0 then user_email else null end) as unique_total_emailsendskip\n \n , sum(total_emailbounce) as total_emailbounce\n , count(distinct case when total_emailbounce > 0 then user_email else null end) as unique_total_emailbounce\n \n , sum(total_inappclick) as total_inappclick\n , count(distinct case when total_inappclick > 0 then user_email else null end) as unique_total_inappclick\n \n , sum(total_pushuninstall) as total_pushuninstall\n , count(distinct case when total_pushuninstall > 0 then user_email else null end) as unique_total_pushuninstall\n \n \n from user_campaign\n \n group by 1,2,3,4\n)\n\nselect *\nfrom campaign_user_event_metrics", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.int_iterable__campaign_lists": {"database": "postgres", "schema": "public_iterable_dev", "name": "int_iterable__campaign_lists", "resource_type": "model", "package_name": "iterable", "path": "intermediate/int_iterable__campaign_lists.sql", "original_file_path": "models/intermediate/int_iterable__campaign_lists.sql", "unique_id": "model.iterable.int_iterable__campaign_lists", "fqn": ["iterable", "intermediate", "int_iterable__campaign_lists"], "alias": "int_iterable__campaign_lists", "checksum": {"name": "sha256", "checksum": "33c167f12bf4fadb7316af985f2b60ee9989ade1a428d684037465d1a449685e"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "Table that identifies the suppressed and send lists associated with a campaign.", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "iterable://models/intermediate/int_iterable.yml", "build_path": null, "unrendered_config": {"materialized": "view", "schema": "iterable_{{ var('directed_schema','dev') }}", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789419972.984904, "relation_name": "\"postgres\".\"public_iterable_dev\".\"int_iterable__campaign_lists\"", "raw_code": "with \n\n{% if var('iterable__using_campaign_suppression_list_history', True) %}\n\ncampaign_suppression_list_history as (\n\n select *\n from {{ ref('stg_iterable__campaign_suppression_list_history') }}\n\n), \n\n{% endif %}\n\ncampaign_send_list_history as (\n\n select *\n from {{ ref('stg_iterable__campaign_list_history') }}\n\n), combine_list_histories as (\n\n{% if var('iterable__using_campaign_suppression_list_history', True) %}\n\n select\n source_relation,\n suppressed_list_id as list_id,\n campaign_id,\n updated_at,\n 'suppress' as list_activity\n from campaign_suppression_list_history\n\n union all\n\n{% endif %}\n\n select\n source_relation,\n list_id,\n campaign_id,\n updated_at,\n 'send' as list_activity\n from campaign_send_list_history\n\n), order_campaign_list_history as (\n\n select\n *,\n row_number() over(partition by list_id, campaign_id{{ fivetran_utils.partition_by_source_relation(package_name='iterable') }} order by updated_at desc) as latest_list_index\n from combine_list_histories\n\n), latest_campaign_list_history as (\n\n select\n source_relation,\n list_id,\n campaign_id,\n updated_at,\n list_activity\n\n from order_campaign_list_history\n where latest_list_index = 1\n)\n\nselect *\nfrom latest_campaign_list_history", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__campaign_suppression_list_history", "package": null, "version": null}, {"name": "stg_iterable__campaign_list_history", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.fivetran_utils.partition_by_source_relation"], "nodes": ["model.iterable.stg_iterable__campaign_suppression_list_history", "model.iterable.stg_iterable__campaign_list_history"]}, "compiled_path": "target/compiled/iterable/models/intermediate/int_iterable__campaign_lists.sql", "compiled": true, "compiled_code": "with \n\n\n\ncampaign_suppression_list_history as (\n\n select *\n from \"postgres\".\"public_iterable_dev\".\"stg_iterable__campaign_suppression_list_history\"\n\n), \n\n\n\ncampaign_send_list_history as (\n\n select *\n from \"postgres\".\"public_iterable_dev\".\"stg_iterable__campaign_list_history\"\n\n), combine_list_histories as (\n\n\n\n select\n source_relation,\n suppressed_list_id as list_id,\n campaign_id,\n updated_at,\n 'suppress' as list_activity\n from campaign_suppression_list_history\n\n union all\n\n\n\n select\n source_relation,\n list_id,\n campaign_id,\n updated_at,\n 'send' as list_activity\n from campaign_send_list_history\n\n), order_campaign_list_history as (\n\n select\n *,\n row_number() over(partition by list_id, campaign_id order by updated_at desc) as latest_list_index\n from combine_list_histories\n\n), latest_campaign_list_history as (\n\n select\n source_relation,\n list_id,\n campaign_id,\n updated_at,\n list_activity\n\n from order_campaign_list_history\n where latest_list_index = 1\n)\n\nselect *\nfrom latest_campaign_list_history", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.int_iterable__recurring_campaigns": {"database": "postgres", "schema": "public_iterable_dev", "name": "int_iterable__recurring_campaigns", "resource_type": "model", "package_name": "iterable", "path": "intermediate/int_iterable__recurring_campaigns.sql", "original_file_path": "models/intermediate/int_iterable__recurring_campaigns.sql", "unique_id": "model.iterable.int_iterable__recurring_campaigns", "fqn": ["iterable", "intermediate", "int_iterable__recurring_campaigns"], "alias": "int_iterable__recurring_campaigns", "checksum": {"name": "sha256", "checksum": "177c12b9779cfd975d0de322b8ccfc36bdecb1f509262c02ca1c8cb7035926d8"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "Table that identifies when a campaign is associated with a recurring campaign and provides additional enriched recurring campaign information.", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "iterable://models/intermediate/int_iterable.yml", "build_path": null, "unrendered_config": {"materialized": "view", "schema": "iterable_{{ var('directed_schema','dev') }}", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789419972.9884887, "relation_name": "\"postgres\".\"public_iterable_dev\".\"int_iterable__recurring_campaigns\"", "raw_code": "with latest_campaign as (\n\n select * \n from {{ ref('int_iterable__latest_campaign') }}\n\n), recurring_campaign_join as (\n select\n latest_campaign.source_relation,\n latest_campaign.campaign_id,\n latest_campaign.campaign_name,\n latest_campaign.updated_at,\n latest_campaign.campaign_state,\n latest_campaign.campaign_type,\n latest_campaign.send_size,\n latest_campaign.start_at,\n latest_campaign.ended_at,\n latest_campaign.created_at,\n latest_campaign.created_by_user_id,\n latest_campaign.template_id,\n latest_campaign.recurring_campaign_id,\n {% if var('iterable__using_journey', true) %}\n -- cast to string so this matches journey_id in stg_iterable__journey; workflow_id arrives\n -- numeric from campaign_history but as a string from event_extension\n cast(latest_campaign.workflow_id as {{ dbt.type_string() }}) as journey_id,\n {% endif %}\n\n recurring_campaign.campaign_name as recurring_campaign_name,\n recurring_campaign.campaign_state as recurring_campaign_state,\n recurring_campaign.send_size as recurring_campaign_send_size,\n recurring_campaign.start_at as recurring_campaign_start_at\n\n from latest_campaign\n\n left join latest_campaign as recurring_campaign\n on latest_campaign.recurring_campaign_id = recurring_campaign.campaign_id\n and latest_campaign.source_relation = recurring_campaign.source_relation\n\n), final as (\n\n select\n recurring_campaign_join.*,\n case when latest_campaign.recurring_campaign_id is not null then true \n else false end as is_campaign_recurring\n\n from recurring_campaign_join\n left join latest_campaign on recurring_campaign_join.campaign_id = latest_campaign.recurring_campaign_id\n and recurring_campaign_join.template_id = latest_campaign.template_id\n and recurring_campaign_join.source_relation = latest_campaign.source_relation\n)\n\nselect *\nfrom final", "doc_blocks": [], "language": "sql", "refs": [{"name": "int_iterable__latest_campaign", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.type_string"], "nodes": ["model.iterable.int_iterable__latest_campaign"]}, "compiled_path": "target/compiled/iterable/models/intermediate/int_iterable__recurring_campaigns.sql", "compiled": true, "compiled_code": "with latest_campaign as (\n\n select * \n from \"postgres\".\"public_iterable_dev\".\"int_iterable__latest_campaign\"\n\n), recurring_campaign_join as (\n select\n latest_campaign.source_relation,\n latest_campaign.campaign_id,\n latest_campaign.campaign_name,\n latest_campaign.updated_at,\n latest_campaign.campaign_state,\n latest_campaign.campaign_type,\n latest_campaign.send_size,\n latest_campaign.start_at,\n latest_campaign.ended_at,\n latest_campaign.created_at,\n latest_campaign.created_by_user_id,\n latest_campaign.template_id,\n latest_campaign.recurring_campaign_id,\n \n -- cast to string so this matches journey_id in stg_iterable__journey; workflow_id arrives\n -- numeric from campaign_history but as a string from event_extension\n cast(latest_campaign.workflow_id as TEXT) as journey_id,\n \n\n recurring_campaign.campaign_name as recurring_campaign_name,\n recurring_campaign.campaign_state as recurring_campaign_state,\n recurring_campaign.send_size as recurring_campaign_send_size,\n recurring_campaign.start_at as recurring_campaign_start_at\n\n from latest_campaign\n\n left join latest_campaign as recurring_campaign\n on latest_campaign.recurring_campaign_id = recurring_campaign.campaign_id\n and latest_campaign.source_relation = recurring_campaign.source_relation\n\n), final as (\n\n select\n recurring_campaign_join.*,\n case when latest_campaign.recurring_campaign_id is not null then true \n else false end as is_campaign_recurring\n\n from recurring_campaign_join\n left join latest_campaign on recurring_campaign_join.campaign_id = latest_campaign.recurring_campaign_id\n and recurring_campaign_join.template_id = latest_campaign.template_id\n and recurring_campaign_join.source_relation = latest_campaign.source_relation\n)\n\nselect *\nfrom final", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.int_iterable__list_user_history": {"database": "postgres", "schema": "public_iterable_dev", "name": "int_iterable__list_user_history", "resource_type": "model", "package_name": "iterable", "path": "intermediate/int_iterable__list_user_history.sql", "original_file_path": "models/intermediate/int_iterable__list_user_history.sql", "unique_id": "model.iterable.int_iterable__list_user_history", "fqn": ["iterable", "intermediate", "int_iterable__list_user_history"], "alias": "int_iterable__list_user_history", "checksum": {"name": "sha256", "checksum": "26b2bd189944dfea25bb63edf9e3da03a3e8169e3501b894716e8d1f8e1df5a0"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "table", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "Table that provides a history of all lists the user has been associated with.", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "iterable://models/intermediate/int_iterable.yml", "build_path": null, "unrendered_config": {"materialized": "table", "schema": "iterable_{{ var('directed_schema','dev') }}", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789419972.987178, "relation_name": "\"postgres\".\"public_iterable_dev\".\"int_iterable__list_user_history\"", "raw_code": "-- this model will serve to extract only email-list changes\nwith user_history as (\n\n select *\n from {{ ref('stg_iterable__user_history') }}\n\n), previous_email_list_ids as (\n\n select\n *,\n lag(email_list_ids) over(partition by unique_user_key{{ fivetran_utils.partition_by_source_relation(package_name='iterable') }} order by updated_at asc) as previous_ids -- partition by email instead of unique_user_key here since this model is only for email-list users\n\n from user_history\n\n), only_new_email_list_ids as (\n\n select\n source_relation,\n _fivetran_user_id,\n unique_user_key,\n user_id,\n email,\n first_name,\n last_name,\n email_list_ids,\n phone_number,\n signup_date,\n signup_source,\n updated_at\n\n --The below script allows for pass through columns.\n {{ fivetran_utils.persist_pass_through_columns(pass_through_variable='iterable_user_history_pass_through_columns', identifier='previous_email_list_ids') }}\n\n from previous_email_list_ids\n where email_list_ids != coalesce(previous_ids, 'this is new') -- list ids are always stored in their arrays in numerical order\n\n), most_recent_list_ids as (\n\n select\n *,\n row_number() over(partition by email{{ fivetran_utils.partition_by_source_relation(package_name='iterable') }} order by updated_at desc) as latest_user_index\n\n from only_new_email_list_ids\n\n), final as (\n\n select\n source_relation,\n _fivetran_user_id,\n unique_user_key,\n email,\n user_id,\n first_name,\n last_name,\n email_list_ids,\n phone_number,\n signup_date,\n signup_source,\n updated_at,\n latest_user_index = 1 as is_current\n\n --The below script allows for pass through columns.\n {{ fivetran_utils.persist_pass_through_columns(pass_through_variable='iterable_user_history_pass_through_columns', identifier='most_recent_list_ids') }}\n\n from most_recent_list_ids\n)\n\nselect * from final", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__user_history", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.fivetran_utils.partition_by_source_relation", "macro.fivetran_utils.persist_pass_through_columns"], "nodes": ["model.iterable.stg_iterable__user_history"]}, "compiled_path": "target/compiled/iterable/models/intermediate/int_iterable__list_user_history.sql", "compiled": true, "compiled_code": "-- this model will serve to extract only email-list changes\nwith user_history as (\n\n select *\n from \"postgres\".\"public_iterable_dev\".\"stg_iterable__user_history\"\n\n), previous_email_list_ids as (\n\n select\n *,\n lag(email_list_ids) over(partition by unique_user_key order by updated_at asc) as previous_ids -- partition by email instead of unique_user_key here since this model is only for email-list users\n\n from user_history\n\n), only_new_email_list_ids as (\n\n select\n source_relation,\n _fivetran_user_id,\n unique_user_key,\n user_id,\n email,\n first_name,\n last_name,\n email_list_ids,\n phone_number,\n signup_date,\n signup_source,\n updated_at\n\n --The below script allows for pass through columns.\n \n\n\n\n\n\n from previous_email_list_ids\n where email_list_ids != coalesce(previous_ids, 'this is new') -- list ids are always stored in their arrays in numerical order\n\n), most_recent_list_ids as (\n\n select\n *,\n row_number() over(partition by email order by updated_at desc) as latest_user_index\n\n from only_new_email_list_ids\n\n), final as (\n\n select\n source_relation,\n _fivetran_user_id,\n unique_user_key,\n email,\n user_id,\n first_name,\n last_name,\n email_list_ids,\n phone_number,\n signup_date,\n signup_source,\n updated_at,\n latest_user_index = 1 as is_current\n\n --The below script allows for pass through columns.\n \n\n\n\n\n\n from most_recent_list_ids\n)\n\nselect * from final", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.int_iterable__message_type_channel": {"database": "postgres", "schema": "public_iterable_dev", "name": "int_iterable__message_type_channel", "resource_type": "model", "package_name": "iterable", "path": "intermediate/int_iterable__message_type_channel.sql", "original_file_path": "models/intermediate/int_iterable__message_type_channel.sql", "unique_id": "model.iterable.int_iterable__message_type_channel", "fqn": ["iterable", "intermediate", "int_iterable__message_type_channel"], "alias": "int_iterable__message_type_channel", "checksum": {"name": "sha256", "checksum": "9f54e0a46c508fbe16514b8e598ee614b3462649f85582b5513905f6392d728d"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "Table that joins the message type and channel records together into one comprehensive model to be referenced downstream.", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "iterable://models/intermediate/int_iterable.yml", "build_path": null, "unrendered_config": {"materialized": "view", "schema": "iterable_{{ var('directed_schema','dev') }}", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789419972.9880633, "relation_name": "\"postgres\".\"public_iterable_dev\".\"int_iterable__message_type_channel\"", "raw_code": "with message_type as (\n\n select *\n from {{ ref('stg_iterable__message_type') }}\n\n), channel as (\n\n select *\n from {{ ref('stg_iterable__channel') }}\n\n), final as (\n\n select \n channel.*,\n message_type.message_type_name,\n message_type.message_type_id\n from channel\n left join message_type\n on channel.channel_id = message_type.channel_id\n and channel.source_relation = message_type.source_relation\n)\n\nselect *\nfrom final", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__message_type", "package": null, "version": null}, {"name": "stg_iterable__channel", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": [], "nodes": ["model.iterable.stg_iterable__message_type", "model.iterable.stg_iterable__channel"]}, "compiled_path": "target/compiled/iterable/models/intermediate/int_iterable__message_type_channel.sql", "compiled": true, "compiled_code": "with message_type as (\n\n select *\n from \"postgres\".\"public_iterable_dev\".\"stg_iterable__message_type\"\n\n), channel as (\n\n select *\n from \"postgres\".\"public_iterable_dev\".\"stg_iterable__channel\"\n\n), final as (\n\n select \n channel.*,\n message_type.message_type_name,\n message_type.message_type_id\n from channel\n left join message_type\n on channel.channel_id = message_type.channel_id\n and channel.source_relation = message_type.source_relation\n)\n\nselect *\nfrom final", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.int_iterable__user_event_metrics": {"database": "postgres", "schema": "public_iterable_dev", "name": "int_iterable__user_event_metrics", "resource_type": "model", "package_name": "iterable", "path": "intermediate/int_iterable__user_event_metrics.sql", "original_file_path": "models/intermediate/int_iterable__user_event_metrics.sql", "unique_id": "model.iterable.int_iterable__user_event_metrics", "fqn": ["iterable", "intermediate", "int_iterable__user_event_metrics"], "alias": "int_iterable__user_event_metrics", "checksum": {"name": "sha256", "checksum": "56af49e00fd9cad13663d8bf802187ff1d12561fb1fd9d3732d182703b34ca4d"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "Table that generates user aggregations at the campaign level.", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "iterable://models/intermediate/int_iterable.yml", "build_path": null, "unrendered_config": {"materialized": "view", "schema": "iterable_{{ var('directed_schema','dev') }}", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789419972.9889438, "relation_name": "\"postgres\".\"public_iterable_dev\".\"int_iterable__user_event_metrics\"", "raw_code": "with user_campaign as (\n\n select *\n from {{ ref('iterable__user_campaign') }}\n\n), user_event_metrics as (\n\n{%- set user_campaign_columns = adapter.get_columns_in_relation(ref('iterable__user_campaign')) %}\n{%- set non_agg_columns = ['source_relation', 'unique_user_key', 'user_id', '_fivetran_user_id', \n 'user_email', 'user_full_name', 'campaign_id', 'campaign_name', 'recurring_campaign_id', \n 'recurring_campaign_name', 'first_event_at', 'last_event_at', 'template_id', 'template_name', \n 'experiment_id', 'unique_user_campaign_id', 'first_open_or_click_event_at'\n ] %}\n\n select\n source_relation,\n _fivetran_user_id,\n unique_user_key,\n user_id,\n user_email,\n count(distinct campaign_id) as count_total_campaigns,\n min(first_event_at) as first_event_at,\n max(last_event_at) as last_event_at\n\n {% for col in user_campaign_columns if col.name|lower not in non_agg_columns %}\n , sum({{ col.name }}) as {{ col.name }}\n {% endfor %}\n\n from user_campaign\n {{ dbt_utils.group_by(n=5) }}\n\n)\n\nselect *\nfrom user_event_metrics", "doc_blocks": [], "language": "sql", "refs": [{"name": "iterable__user_campaign", "package": null, "version": null}, {"name": "iterable__user_campaign", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt_utils.group_by"], "nodes": ["model.iterable.iterable__user_campaign"]}, "compiled_path": "target/compiled/iterable/models/intermediate/int_iterable__user_event_metrics.sql", "compiled": true, "compiled_code": "with user_campaign as (\n\n select *\n from \"postgres\".\"public_iterable_dev\".\"iterable__user_campaign\"\n\n), user_event_metrics as (\n\n select\n source_relation,\n _fivetran_user_id,\n unique_user_key,\n user_id,\n user_email,\n count(distinct campaign_id) as count_total_campaigns,\n min(first_event_at) as first_event_at,\n max(last_event_at) as last_event_at\n\n \n , sum(total_emailclick) as total_emailclick\n \n , sum(total_emailunsubscribe) as total_emailunsubscribe\n \n , sum(total_emailcomplaint) as total_emailcomplaint\n \n , sum(total_customevent) as total_customevent\n \n , sum(total_emailsubscribe) as total_emailsubscribe\n \n , sum(total_emailopen) as total_emailopen\n \n , sum(total_pushsend) as total_pushsend\n \n , sum(total_smsbounce) as total_smsbounce\n \n , sum(total_pushbounce) as total_pushbounce\n \n , sum(total_inappsendskip) as total_inappsendskip\n \n , sum(total_smssend) as total_smssend\n \n , sum(total_inappsend) as total_inappsend\n \n , sum(total_pushopen) as total_pushopen\n \n , sum(total_emailsend) as total_emailsend\n \n , sum(total_pushsendskip) as total_pushsendskip\n \n , sum(total_inappopen) as total_inappopen\n \n , sum(total_emailsendskip) as total_emailsendskip\n \n , sum(total_emailbounce) as total_emailbounce\n \n , sum(total_inappclick) as total_inappclick\n \n , sum(total_pushuninstall) as total_pushuninstall\n \n\n from user_campaign\n group by 1,2,3,4,5\n\n)\n\nselect *\nfrom user_event_metrics", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.int_iterable__latest_user": {"database": "postgres", "schema": "public_iterable_dev", "name": "int_iterable__latest_user", "resource_type": "model", "package_name": "iterable", "path": "intermediate/int_iterable__latest_user.sql", "original_file_path": "models/intermediate/int_iterable__latest_user.sql", "unique_id": "model.iterable.int_iterable__latest_user", "fqn": ["iterable", "intermediate", "int_iterable__latest_user"], "alias": "int_iterable__latest_user", "checksum": {"name": "sha256", "checksum": "580070cfbe396b904d0dc15669eefe5b9f017005d0aa91aa2c3d96b4e4686e81"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "Table that filters out historical versions of the user, and returns only the most recent version.", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "iterable://models/intermediate/int_iterable.yml", "build_path": null, "unrendered_config": {"materialized": "view", "schema": "iterable_{{ var('directed_schema','dev') }}", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789419972.9867206, "relation_name": "\"postgres\".\"public_iterable_dev\".\"int_iterable__latest_user\"", "raw_code": "with user_history as (\n select *\n from {{ ref('stg_iterable__user_history') }}\n\n), latest_user as (\n select\n *,\n row_number() over(partition by unique_user_key{{ fivetran_utils.partition_by_source_relation(package_name='iterable') }} order by updated_at desc) as latest_user_index\n from user_history\n)\n\nselect *\nfrom latest_user\nwhere latest_user_index = 1", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__user_history", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.fivetran_utils.partition_by_source_relation"], "nodes": ["model.iterable.stg_iterable__user_history"]}, "compiled_path": "target/compiled/iterable/models/intermediate/int_iterable__latest_user.sql", "compiled": true, "compiled_code": "with user_history as (\n select *\n from \"postgres\".\"public_iterable_dev\".\"stg_iterable__user_history\"\n\n), latest_user as (\n select\n *,\n row_number() over(partition by unique_user_key order by updated_at desc) as latest_user_index\n from user_history\n)\n\nselect *\nfrom latest_user\nwhere latest_user_index = 1", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.int_iterable__latest_campaign": {"database": "postgres", "schema": "public_iterable_dev", "name": "int_iterable__latest_campaign", "resource_type": "model", "package_name": "iterable", "path": "intermediate/int_iterable__latest_campaign.sql", "original_file_path": "models/intermediate/int_iterable__latest_campaign.sql", "unique_id": "model.iterable.int_iterable__latest_campaign", "fqn": ["iterable", "intermediate", "int_iterable__latest_campaign"], "alias": "int_iterable__latest_campaign", "checksum": {"name": "sha256", "checksum": "8063c9ccdfe6dee1694944607534fbb31bafe2856073ac2f5ea58aa513714e4f"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "Table that filters out historical versions of the campaign, and returns the most recent campaign version.", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "iterable://models/intermediate/int_iterable.yml", "build_path": null, "unrendered_config": {"materialized": "view", "schema": "iterable_{{ var('directed_schema','dev') }}", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789419972.9858222, "relation_name": "\"postgres\".\"public_iterable_dev\".\"int_iterable__latest_campaign\"", "raw_code": "with campaign_history as (\n select *\n from {{ ref('stg_iterable__campaign_history') }}\n\n), latest_campaign as (\n select\n *,\n row_number() over(partition by campaign_id{{ fivetran_utils.partition_by_source_relation(package_name='iterable') }} order by updated_at desc) as latest_campaign_index\n from campaign_history\n)\n\nselect *\nfrom latest_campaign\nwhere latest_campaign_index = 1", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__campaign_history", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.fivetran_utils.partition_by_source_relation"], "nodes": ["model.iterable.stg_iterable__campaign_history"]}, "compiled_path": "target/compiled/iterable/models/intermediate/int_iterable__latest_campaign.sql", "compiled": true, "compiled_code": "with campaign_history as (\n select *\n from \"postgres\".\"public_iterable_dev\".\"stg_iterable__campaign_history\"\n\n), latest_campaign as (\n select\n *,\n row_number() over(partition by campaign_id order by updated_at desc) as latest_campaign_index\n from campaign_history\n)\n\nselect *\nfrom latest_campaign\nwhere latest_campaign_index = 1", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.stg_iterable__message_type": {"database": "postgres", "schema": "public_iterable_dev", "name": "stg_iterable__message_type", "resource_type": "model", "package_name": "iterable", "path": "staging/stg_iterable__message_type.sql", "original_file_path": "models/staging/stg_iterable__message_type.sql", "unique_id": "model.iterable.stg_iterable__message_type", "fqn": ["iterable", "staging", "stg_iterable__message_type"], "alias": "stg_iterable__message_type", "checksum": {"name": "sha256", "checksum": "046caf2bcc8a01dd2b8ef46a5dfb52e02b8bebe01e892de5d658910c97d5e6a4"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "table", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "Table containing unique message types.", "columns": {"source_relation": {"name": "source_relation", "description": "Identifies the record's source.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": ["doc.iterable.source_relation"]}, "message_type_id": {"name": "message_type_id", "description": "Unique identifier of the message type", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "message_type_name": {"name": "message_type_name", "description": "User defined name of the message type", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "channel_id": {"name": "channel_id", "description": "Channel that this message type belongs to", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "message_type_created_at": {"name": "message_type_created_at", "description": "Time when the message type was initially created", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "frequency_cap": {"name": "frequency_cap", "description": "The maximum number of times a message of this type can be sent to a recipient within a specified time period to prevent over-messaging", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "rate_limit_per_minute": {"name": "rate_limit_per_minute", "description": "The maximum number of messages of this type that can be sent to recipients in a minute, ensuring controlled message delivery", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "subscription_policy": {"name": "subscription_policy", "description": "Information about the policy or rules governing how users can subscribe to or unsubscribe from this specific message type, like OptOut", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "message_type_updated_at": {"name": "message_type_updated_at", "description": "Time when the message type was last updated or modified", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "The time when a record was last updated by Fivetran.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": ["doc.iterable._fivetran_synced"]}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "iterable://models/staging/stg_iterable.yml", "build_path": null, "unrendered_config": {"materialized": "table", "schema": "iterable_{{ var('directed_schema','dev') }}", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789419973.0037835, "relation_name": "\"postgres\".\"public_iterable_dev\".\"stg_iterable__message_type\"", "raw_code": "with base as (\n\n select * \n from {{ ref('stg_iterable__message_type_tmp') }}\n\n),\n\nfields as (\n\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_iterable/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_iterable/macros/).\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_iterable__message_type_tmp')),\n staging_columns=get_message_type_columns()\n )\n }}\n {{ fivetran_utils.apply_source_relation(package_name='iterable') }}\n\n from base\n),\n\nfinal as (\n\n select\n source_relation,\n cast(id as {{ dbt.type_string() }} ) as message_type_id,\n name as message_type_name,\n cast(channel_id as {{ dbt.type_string() }} ) as channel_id,\n created_at as message_type_created_at,\n frequency_cap,\n rate_limit_per_minute,\n subscription_policy,\n updated_at as message_type_updated_at,\n _fivetran_synced\n from fields\n where not coalesce(_fivetran_deleted, true)\n)\n\nselect * \nfrom final", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__message_type_tmp", "package": null, "version": null}, {"name": "stg_iterable__message_type_tmp", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.iterable.get_message_type_columns", "macro.fivetran_utils.fill_staging_columns", "macro.fivetran_utils.apply_source_relation", "macro.dbt.type_string"], "nodes": ["model.iterable.stg_iterable__message_type_tmp"]}, "compiled_path": "target/compiled/iterable/models/staging/stg_iterable__message_type.sql", "compiled": true, "compiled_code": "with base as (\n\n select * \n from \"postgres\".\"public_iterable_dev\".\"stg_iterable__message_type_tmp\"\n\n),\n\nfields as (\n\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_iterable/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_iterable/macros/).\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n \n _fivetran_deleted as _fivetran_deleted,\n _fivetran_synced as _fivetran_synced,\n channel_id as channel_id,\n id as id,\n name as name,\n created_at as created_at,\n frequency_cap as frequency_cap,\n rate_limit_per_minute as rate_limit_per_minute,\n subscription_policy as subscription_policy,\n updated_at as updated_at\n \n\n\n\n\n \n \n\n\n\n\n\n, cast('postgres.public' as TEXT) as source_relation\n\n\n from base\n),\n\nfinal as (\n\n select\n source_relation,\n cast(id as TEXT ) as message_type_id,\n name as message_type_name,\n cast(channel_id as TEXT ) as channel_id,\n created_at as message_type_created_at,\n frequency_cap,\n rate_limit_per_minute,\n subscription_policy,\n updated_at as message_type_updated_at,\n _fivetran_synced\n from fields\n where not coalesce(_fivetran_deleted, true)\n)\n\nselect * \nfrom final", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.stg_iterable__event": {"database": "postgres", "schema": "public_iterable_dev", "name": "stg_iterable__event", "resource_type": "model", "package_name": "iterable", "path": "staging/stg_iterable__event.sql", "original_file_path": "models/staging/stg_iterable__event.sql", "unique_id": "model.iterable.stg_iterable__event", "fqn": ["iterable", "staging", "stg_iterable__event"], "alias": "stg_iterable__event", "checksum": {"name": "sha256", "checksum": "22ba2d21012d8301984a6fcea5b9f40f9579f5565aaea7417f7458f6fd37937b"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "Table containing individual events within campaigns.", "columns": {"source_relation": {"name": "source_relation", "description": "Identifies the record's source.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": ["doc.iterable.source_relation"]}, "event_id": {"name": "event_id", "description": "A Fivetran-created unique identifier derived from hashing campaign_id, created_at, and event_name.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_event_id": {"name": "unique_event_id", "description": "A surrogate key made up of event_id, _fivetran_user_id, and source_relation.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "campaign_id": {"name": "campaign_id", "description": "Reference to the campaign from which the event originated", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "content_id": {"name": "content_id", "description": "Reference to the content the event is associated with", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "created_at": {"name": "created_at", "description": "Creation timestamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "created_on": {"name": "created_on", "description": "Creation date", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "email": {"name": "email", "description": "Reference to the unique user the event was applied to", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "additional_properties": {"name": "additional_properties", "description": "json object containing addition event properties", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "event_name": {"name": "event_name", "description": "Name provided to the individual event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "message_bus_id": {"name": "message_bus_id", "description": "Reference to the message bus associated with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "message_id": {"name": "message_id", "description": "Reference to the message the event is associated with", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "message_type_id": {"name": "message_type_id", "description": "Reference to the type of message the event is associated with", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "recipient_state": {"name": "recipient_state", "description": "The state of the recipient upon receiving the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "status": {"name": "status", "description": "Status of the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "transactional_data": {"name": "transactional_data", "description": "Transactional data associated with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unsub_source": {"name": "unsub_source", "description": "Source of the unsubscribe event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "user_agent": {"name": "user_agent", "description": "User agent associated with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "user_agent_device": {"name": "user_agent_device", "description": "The device of the user agent", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "_fivetran_user_id": {"name": "_fivetran_user_id", "description": "A Fivetran-created unique identifier for users, derived from hashing user_id and/or email, depending on project type. This exists for users of the new schema starting Aug 2023. In the old schema, the unique identifier is email.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_user_key": {"name": "unique_user_key", "description": "The unique identifier of the user. With the new schema (Aug 2023), it is the _fivetran_user_id. This is a hash of user_id and/or email, depending on project type. If using the old schema, it is email.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "The time when a record was last updated by Fivetran.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": ["doc.iterable._fivetran_synced"]}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "iterable://models/staging/stg_iterable.yml", "build_path": null, "unrendered_config": {"materialized": "view", "schema": "iterable_{{ var('directed_schema','dev') }}", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789419972.996312, "relation_name": "\"postgres\".\"public_iterable_dev\".\"stg_iterable__event\"", "raw_code": "{{ config( materialized = 'view' ) }}\n\nwith base as (\n\n select * \n from {{ ref('stg_iterable__event_tmp') }}\n\n),\n\nfields as (\n\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_iterable/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_iterable/macros/).\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_iterable__event_tmp')),\n staging_columns=get_event_columns()\n )\n }}\n {{ fivetran_utils.apply_source_relation(package_name='iterable') }}\n \n from base\n),\n\nfinal as (\n\n select\n source_relation,\n cast(_fivetran_id as {{ dbt.type_string() }} ) as event_id,\n {{ dbt_utils.generate_surrogate_key(['_fivetran_id','_fivetran_user_id','source_relation']) }} as unique_event_id,\n cast(_fivetran_user_id as {{ dbt.type_string() }} ) as _fivetran_user_id,\n coalesce(cast(_fivetran_user_id as {{ dbt.type_string() }} ) , email) as unique_user_key,\n cast(campaign_id as {{ dbt.type_string() }} ) as campaign_id,\n cast(content_id as {{ dbt.type_string() }} ) as content_id,\n created_at,\n cast( {{ dbt.date_trunc('day', 'created_at') }} as date) as created_on,\n lower(email) as email,\n additional_properties,\n event_name,\n cast(message_bus_id as {{ dbt.type_string() }} ) as message_bus_id,\n cast(message_id as {{ dbt.type_string() }} ) as message_id,\n cast(message_type_id as {{ dbt.type_string() }} ) as message_type_id,\n recipient_state,\n status,\n transactional_data,\n unsub_source,\n user_agent,\n user_agent_device,\n _fivetran_synced\n\n from fields\n)\n\nselect *\nfrom final", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__event_tmp", "package": null, "version": null}, {"name": "stg_iterable__event_tmp", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.iterable.get_event_columns", "macro.fivetran_utils.fill_staging_columns", "macro.fivetran_utils.apply_source_relation", "macro.dbt.type_string", "macro.dbt_utils.generate_surrogate_key", "macro.dbt.date_trunc"], "nodes": ["model.iterable.stg_iterable__event_tmp"]}, "compiled_path": "target/compiled/iterable/models/staging/stg_iterable__event.sql", "compiled": true, "compiled_code": "\n\nwith base as (\n\n select * \n from \"postgres\".\"public_iterable_dev\".\"stg_iterable__event_tmp\"\n\n),\n\nfields as (\n\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_iterable/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_iterable/macros/).\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n \n _fivetran_id as _fivetran_id,\n _fivetran_user_id as _fivetran_user_id,\n _fivetran_synced as _fivetran_synced,\n campaign_id as campaign_id,\n content_id as content_id,\n created_at as created_at,\n email as email,\n event_name as event_name,\n message_bus_id as message_bus_id,\n message_id as message_id,\n message_type_id as message_type_id,\n recipient_state as recipient_state,\n status as status,\n unsub_source as unsub_source,\n user_agent as user_agent,\n user_agent_device as user_agent_device,\n transactional_data as transactional_data,\n additional_properties as additional_properties\n \n\n\n\n\n \n \n\n\n\n\n\n, cast('postgres.public' as TEXT) as source_relation\n\n \n from base\n),\n\nfinal as (\n\n select\n source_relation,\n cast(_fivetran_id as TEXT ) as event_id,\n md5(cast(coalesce(cast(_fivetran_id as TEXT), '_dbt_utils_surrogate_key_null_') || '-' || coalesce(cast(_fivetran_user_id as TEXT), '_dbt_utils_surrogate_key_null_') || '-' || coalesce(cast(source_relation as TEXT), '_dbt_utils_surrogate_key_null_') as TEXT)) as unique_event_id,\n cast(_fivetran_user_id as TEXT ) as _fivetran_user_id,\n coalesce(cast(_fivetran_user_id as TEXT ) , email) as unique_user_key,\n cast(campaign_id as TEXT ) as campaign_id,\n cast(content_id as TEXT ) as content_id,\n created_at,\n cast( date_trunc('day', created_at) as date) as created_on,\n lower(email) as email,\n additional_properties,\n event_name,\n cast(message_bus_id as TEXT ) as message_bus_id,\n cast(message_id as TEXT ) as message_id,\n cast(message_type_id as TEXT ) as message_type_id,\n recipient_state,\n status,\n transactional_data,\n unsub_source,\n user_agent,\n user_agent_device,\n _fivetran_synced\n\n from fields\n)\n\nselect *\nfrom final", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.stg_iterable__user_unsubscribed_channel": {"database": "postgres", "schema": "public_iterable_dev", "name": "stg_iterable__user_unsubscribed_channel", "resource_type": "model", "package_name": "iterable", "path": "staging/stg_iterable__user_unsubscribed_channel.sql", "original_file_path": "models/staging/stg_iterable__user_unsubscribed_channel.sql", "unique_id": "model.iterable.stg_iterable__user_unsubscribed_channel", "fqn": ["iterable", "staging", "stg_iterable__user_unsubscribed_channel"], "alias": "stg_iterable__user_unsubscribed_channel", "checksum": {"name": "sha256", "checksum": "5c639597d14f4bb7072df74e39c2b8aaa7bf1e29c6204243035014d14a0bc6f2"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "table", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "Table containing the history of channels from which a user has unsubscribed.", "columns": {"source_relation": {"name": "source_relation", "description": "Identifies the record's source.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": ["doc.iterable.source_relation"]}, "channel_id": {"name": "channel_id", "description": "Reference to the channel from which the user unsubscribed", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unsub_channel_unique_key": {"name": "unsub_channel_unique_key", "description": "A surrogate key providing a unique key for each record. If using user_unsubscribed_channel_history, it uses '_fivetran_id', 'channel_id', 'email', 'updated_at', and 'source_relation'. If not using the history table, it uses '_fivetran_id', 'channel_id', and 'source_relation'.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "_fivetran_user_id": {"name": "_fivetran_user_id", "description": "A Fivetran-created unique identifier for users, derived from hashing user_id and/or email, depending on project type. This exists for users of the new schema starting Aug 2023. In the old schema, the unique identifier is email.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_user_key": {"name": "unique_user_key", "description": "The unique identifier of the user. With the new schema (Aug 2023), it is the _fivetran_user_id. This is a hash of user_id and/or email, depending on project type. If using the old schema, it is email.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "latest_batch_index": {"name": "latest_batch_index", "description": "Indexes each user record based on the most recent available.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "updated_at": {"name": "updated_at", "description": "Last update timestamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "The time when a record was last updated by Fivetran.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": ["doc.iterable._fivetran_synced"]}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "iterable://models/staging/stg_iterable.yml", "build_path": null, "unrendered_config": {"materialized": "table", "schema": "iterable_{{ var('directed_schema','dev') }}", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789419973.0096774, "relation_name": "\"postgres\".\"public_iterable_dev\".\"stg_iterable__user_unsubscribed_channel\"", "raw_code": "with base as (\n select *\n from {{ ref('stg_iterable__user_unsubscribed_channel_tmp') }}\n\n),\n\nfields as (\n\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_iterable/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_iterable/macros/).\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_iterable__user_unsubscribed_channel_tmp')),\n staging_columns=get_user_unsubscribed_channel_columns()\n )\n }}\n {{ fivetran_utils.apply_source_relation(package_name='iterable') }}\n\n from base\n),\n\nfinal as (\n\n select\n source_relation,\n cast(_fivetran_id as {{ dbt.type_string() }} ) as _fivetran_user_id,\n coalesce(cast(_fivetran_id as {{ dbt.type_string() }} ), email) as unique_user_key,\n cast(channel_id as {{ dbt.type_string() }} ) as channel_id,\n {{ dbt_utils.generate_surrogate_key(['_fivetran_id', 'channel_id', 'email', 'updated_at', 'source_relation']) }} as unsub_channel_unique_key,\n\n {% if does_table_exist('user_unsubscribed_channel') == false %}\n rank() over(partition by email, channel_id{{ fivetran_utils.partition_by_source_relation(package_name='iterable') }} order by updated_at desc) as latest_batch_index,\n {% else %}\n 1 as latest_batch_index,\n {% endif %}\n\n updated_at,\n _fivetran_synced\n\n from fields\n)\n\n\nselect *\nfrom final", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__user_unsubscribed_channel_tmp", "package": null, "version": null}, {"name": "stg_iterable__user_unsubscribed_channel_tmp", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.iterable.get_user_unsubscribed_channel_columns", "macro.fivetran_utils.fill_staging_columns", "macro.fivetran_utils.apply_source_relation", "macro.dbt.type_string", "macro.dbt_utils.generate_surrogate_key", "macro.iterable.does_table_exist"], "nodes": ["model.iterable.stg_iterable__user_unsubscribed_channel_tmp"]}, "compiled_path": "target/compiled/iterable/models/staging/stg_iterable__user_unsubscribed_channel.sql", "compiled": true, "compiled_code": "with base as (\n select *\n from \"postgres\".\"public_iterable_dev\".\"stg_iterable__user_unsubscribed_channel_tmp\"\n\n),\n\nfields as (\n\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_iterable/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_iterable/macros/).\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n \n _fivetran_synced as _fivetran_synced,\n _fivetran_id as _fivetran_id,\n channel_id as channel_id,\n cast(null as TEXT) as email,\n cast(null as timestamp) as updated_at\n \n\n\n\n\n \n \n\n\n\n\n\n, cast('postgres.public' as TEXT) as source_relation\n\n\n from base\n),\n\nfinal as (\n\n select\n source_relation,\n cast(_fivetran_id as TEXT ) as _fivetran_user_id,\n coalesce(cast(_fivetran_id as TEXT ), email) as unique_user_key,\n cast(channel_id as TEXT ) as channel_id,\n md5(cast(coalesce(cast(_fivetran_id as TEXT), '_dbt_utils_surrogate_key_null_') || '-' || coalesce(cast(channel_id as TEXT), '_dbt_utils_surrogate_key_null_') || '-' || coalesce(cast(email as TEXT), '_dbt_utils_surrogate_key_null_') || '-' || coalesce(cast(updated_at as TEXT), '_dbt_utils_surrogate_key_null_') || '-' || coalesce(cast(source_relation as TEXT), '_dbt_utils_surrogate_key_null_') as TEXT)) as unsub_channel_unique_key,\n\n \n 1 as latest_batch_index,\n \n\n updated_at,\n _fivetran_synced\n\n from fields\n)\n\n\nselect *\nfrom final", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.stg_iterable__campaign_history": {"database": "postgres", "schema": "public_iterable_dev", "name": "stg_iterable__campaign_history", "resource_type": "model", "package_name": "iterable", "path": "staging/stg_iterable__campaign_history.sql", "original_file_path": "models/staging/stg_iterable__campaign_history.sql", "unique_id": "model.iterable.stg_iterable__campaign_history", "fqn": ["iterable", "staging", "stg_iterable__campaign_history"], "alias": "stg_iterable__campaign_history", "checksum": {"name": "sha256", "checksum": "7e7aecc134f0b697da58c7cd663aadf6de586a55c84369c2a7274811b2bb368b"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "table", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "Table containing a history of campaigns.", "columns": {"source_relation": {"name": "source_relation", "description": "Identifies the record's source.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": ["doc.iterable.source_relation"]}, "campaign_id": {"name": "campaign_id", "description": "Unique identifier of the campaign record", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "updated_at": {"name": "updated_at", "description": "Last update timestamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "campaign_name": {"name": "campaign_name", "description": "User defined name of the campaign.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "campaign_state": {"name": "campaign_state", "description": "State of the campaign. Can be Draft, Ready, Scheduled, Running, Finished, Starting, Aborted or Recurring", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "campaign_type": {"name": "campaign_type", "description": "The campaign type. Can be Blast or Triggered", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "send_size": {"name": "send_size", "description": "Size of the campaign. Number of individuals included in the campaign", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "start_at": {"name": "start_at", "description": "Start timestamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "ended_at": {"name": "ended_at", "description": "Ended timestamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "created_at": {"name": "created_at", "description": "Creation timestamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "recurring_campaign_id": {"name": "recurring_campaign_id", "description": "Reference to the recurring campaign, if applicable", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "created_by_user_id": {"name": "created_by_user_id", "description": "Reference to the user who created the campaign", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "template_id": {"name": "template_id", "description": "Reference to the campaign template", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "updated_by_user_id": {"name": "updated_by_user_id", "description": "ID of the user who updated this record", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "message_medium": {"name": "message_medium", "description": "The medium that this message was sent via, for example Email or InApp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "workflow_id": {"name": "workflow_id", "description": "Reference to the workflow which the event originated", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "The time when a record was last updated by Fivetran.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": ["doc.iterable._fivetran_synced"]}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "iterable://models/staging/stg_iterable.yml", "build_path": null, "unrendered_config": {"materialized": "table", "schema": "iterable_{{ var('directed_schema','dev') }}", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789419972.9909596, "relation_name": "\"postgres\".\"public_iterable_dev\".\"stg_iterable__campaign_history\"", "raw_code": "with base as (\n\n select * \n from {{ ref('stg_iterable__campaign_history_tmp') }}\n\n),\n\nfields as (\n\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_iterable/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_iterable/macros/).\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_iterable__campaign_history_tmp')),\n staging_columns=get_campaign_history_columns()\n )\n }}\n {{ fivetran_utils.apply_source_relation(package_name='iterable') }}\n \n from base\n),\n\nfinal as (\n\n select\n source_relation,\n cast(id as {{ dbt.type_string() }}) as campaign_id,\n updated_at,\n name as campaign_name,\n campaign_state,\n type as campaign_type,\n send_size,\n start_at,\n ended_at,\n created_at,\n message_medium,\n cast(recurring_campaign_id as {{ dbt.type_string() }}) as recurring_campaign_id,\n cast(created_by_user_id as {{ dbt.type_string() }} ) as created_by_user_id,\n cast(updated_by_user_id as {{ dbt.type_string() }} ) as updated_by_user_id,\n cast(template_id as {{ dbt.type_string() }}) as template_id,\n workflow_id,\n _fivetran_synced\n\n from fields\n)\n\nselect * \nfrom final", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__campaign_history_tmp", "package": null, "version": null}, {"name": "stg_iterable__campaign_history_tmp", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.iterable.get_campaign_history_columns", "macro.fivetran_utils.fill_staging_columns", "macro.fivetran_utils.apply_source_relation", "macro.dbt.type_string"], "nodes": ["model.iterable.stg_iterable__campaign_history_tmp"]}, "compiled_path": "target/compiled/iterable/models/staging/stg_iterable__campaign_history.sql", "compiled": true, "compiled_code": "with base as (\n\n select * \n from \"postgres\".\"public_iterable_dev\".\"stg_iterable__campaign_history_tmp\"\n\n),\n\nfields as (\n\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_iterable/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_iterable/macros/).\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n \n _fivetran_synced as _fivetran_synced,\n campaign_state as campaign_state,\n created_at as created_at,\n created_by_user_id as created_by_user_id,\n updated_by_user_id as updated_by_user_id,\n ended_at as ended_at,\n id as id,\n name as name,\n recurring_campaign_id as recurring_campaign_id,\n send_size as send_size,\n start_at as start_at,\n template_id as template_id,\n type as type,\n updated_at as updated_at,\n workflow_id as workflow_id,\n message_medium as message_medium\n \n\n\n\n\n \n \n\n\n\n\n\n, cast('postgres.public' as TEXT) as source_relation\n\n \n from base\n),\n\nfinal as (\n\n select\n source_relation,\n cast(id as TEXT) as campaign_id,\n updated_at,\n name as campaign_name,\n campaign_state,\n type as campaign_type,\n send_size,\n start_at,\n ended_at,\n created_at,\n message_medium,\n cast(recurring_campaign_id as TEXT) as recurring_campaign_id,\n cast(created_by_user_id as TEXT ) as created_by_user_id,\n cast(updated_by_user_id as TEXT ) as updated_by_user_id,\n cast(template_id as TEXT) as template_id,\n workflow_id,\n _fivetran_synced\n\n from fields\n)\n\nselect * \nfrom final", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.stg_iterable__campaign_label_history": {"database": "postgres", "schema": "public_iterable_dev", "name": "stg_iterable__campaign_label_history", "resource_type": "model", "package_name": "iterable", "path": "staging/stg_iterable__campaign_label_history.sql", "original_file_path": "models/staging/stg_iterable__campaign_label_history.sql", "unique_id": "model.iterable.stg_iterable__campaign_label_history", "fqn": ["iterable", "staging", "stg_iterable__campaign_label_history"], "alias": "stg_iterable__campaign_label_history", "checksum": {"name": "sha256", "checksum": "2001c425039c576063482caa3d4a72f39c5cd8aff32ffee63f083977f1f0c35f"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "table", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "Table containing a history of labels.", "columns": {"source_relation": {"name": "source_relation", "description": "Identifies the record's source.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": ["doc.iterable.source_relation"]}, "campaign_id": {"name": "campaign_id", "description": "Reference to the campaign associated with the label", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "label": {"name": "label", "description": "Name of the label", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "updated_at": {"name": "updated_at", "description": "Last update timestamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "The time when a record was last updated by Fivetran.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": ["doc.iterable._fivetran_synced"]}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "iterable://models/staging/stg_iterable.yml", "build_path": null, "unrendered_config": {"materialized": "table", "schema": "iterable_{{ var('directed_schema','dev') }}", "enabled": "var('iterable__using_campaign_label_history', True)", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789419972.992077, "relation_name": "\"postgres\".\"public_iterable_dev\".\"stg_iterable__campaign_label_history\"", "raw_code": "{{ config(enabled=var('iterable__using_campaign_label_history', True)) }}\n\nwith base as (\n\n select * \n from {{ ref('stg_iterable__campaign_label_history_tmp') }}\n\n),\n\nfields as (\n\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_iterable/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_iterable/macros/).\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_iterable__campaign_label_history_tmp')),\n staging_columns=get_campaign_label_history_columns()\n )\n }}\n {{ fivetran_utils.apply_source_relation(package_name='iterable') }}\n \n from base\n),\n\nfinal as (\n\n select\n source_relation,\n cast(campaign_id as {{ dbt.type_string() }}) as campaign_id,\n label,\n updated_at,\n _fivetran_synced\n from fields\n)\n\nselect * \nfrom final", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__campaign_label_history_tmp", "package": null, "version": null}, {"name": "stg_iterable__campaign_label_history_tmp", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.iterable.get_campaign_label_history_columns", "macro.fivetran_utils.fill_staging_columns", "macro.fivetran_utils.apply_source_relation", "macro.dbt.type_string"], "nodes": ["model.iterable.stg_iterable__campaign_label_history_tmp"]}, "compiled_path": "target/compiled/iterable/models/staging/stg_iterable__campaign_label_history.sql", "compiled": true, "compiled_code": "\n\nwith base as (\n\n select * \n from \"postgres\".\"public_iterable_dev\".\"stg_iterable__campaign_label_history_tmp\"\n\n),\n\nfields as (\n\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_iterable/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_iterable/macros/).\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n \n _fivetran_synced as _fivetran_synced,\n campaign_id as campaign_id,\n label as label,\n updated_at as updated_at\n \n\n\n\n\n \n \n\n\n\n\n\n, cast('postgres.public' as TEXT) as source_relation\n\n \n from base\n),\n\nfinal as (\n\n select\n source_relation,\n cast(campaign_id as TEXT) as campaign_id,\n label,\n updated_at,\n _fivetran_synced\n from fields\n)\n\nselect * \nfrom final", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.stg_iterable__template_history": {"database": "postgres", "schema": "public_iterable_dev", "name": "stg_iterable__template_history", "resource_type": "model", "package_name": "iterable", "path": "staging/stg_iterable__template_history.sql", "original_file_path": "models/staging/stg_iterable__template_history.sql", "unique_id": "model.iterable.stg_iterable__template_history", "fqn": ["iterable", "staging", "stg_iterable__template_history"], "alias": "stg_iterable__template_history", "checksum": {"name": "sha256", "checksum": "f0eaf9d44d7959a04ba079cbf711646772487aeafc89414b097dd5f230b44910"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "table", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "Table containing unique templates used across campaigns.", "columns": {"source_relation": {"name": "source_relation", "description": "Identifies the record's source.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": ["doc.iterable.source_relation"]}, "template_id": {"name": "template_id", "description": "Unique identifier of the template", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "template_name": {"name": "template_name", "description": "User defined name of the template", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "template_type": {"name": "template_type", "description": "The type of the template", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "created_at": {"name": "created_at", "description": "Creation timestamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "client_template_id": {"name": "client_template_id", "description": "Reference to the client template", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "creator_user_id": {"name": "creator_user_id", "description": "Reference to the user who created the template", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "message_type_id": {"name": "message_type_id", "description": "Reference to the message type associated with the template", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "updated_at": {"name": "updated_at", "description": "Last update timestamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "The time when a record was last updated by Fivetran.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": ["doc.iterable._fivetran_synced"]}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "iterable://models/staging/stg_iterable.yml", "build_path": null, "unrendered_config": {"materialized": "table", "schema": "iterable_{{ var('directed_schema','dev') }}", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789419973.0053911, "relation_name": "\"postgres\".\"public_iterable_dev\".\"stg_iterable__template_history\"", "raw_code": "with base as (\n\n select * \n from {{ ref('stg_iterable__template_history_tmp') }}\n\n),\n\nfields as (\n\n select\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_iterable__template_history_tmp')),\n staging_columns=get_template_history_columns()\n )\n }}\n {{ fivetran_utils.apply_source_relation(package_name='iterable') }}\n\n from base\n),\n\nfinal as (\n\n select\n source_relation,\n cast(id as {{ dbt.type_string() }} ) as template_id,\n name as template_name,\n template_type,\n created_at,\n cast(client_template_id as {{ dbt.type_string() }} ) as client_template_id,\n cast(creator_user_id as {{ dbt.type_string() }} ) as creator_user_id,\n cast(message_type_id as {{ dbt.type_string() }} ) as message_type_id,\n updated_at,\n _fivetran_synced\n from fields\n)\n\nselect * \nfrom final", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__template_history_tmp", "package": null, "version": null}, {"name": "stg_iterable__template_history_tmp", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.iterable.get_template_history_columns", "macro.fivetran_utils.fill_staging_columns", "macro.fivetran_utils.apply_source_relation", "macro.dbt.type_string"], "nodes": ["model.iterable.stg_iterable__template_history_tmp"]}, "compiled_path": "target/compiled/iterable/models/staging/stg_iterable__template_history.sql", "compiled": true, "compiled_code": "with base as (\n\n select * \n from \"postgres\".\"public_iterable_dev\".\"stg_iterable__template_history_tmp\"\n\n),\n\nfields as (\n\n select\n \n _fivetran_synced as _fivetran_synced,\n client_template_id as client_template_id,\n created_at as created_at,\n creator_user_id as creator_user_id,\n id as id,\n message_type_id as message_type_id,\n name as name,\n template_type as template_type,\n updated_at as updated_at\n \n\n\n\n\n \n \n\n\n\n\n\n, cast('postgres.public' as TEXT) as source_relation\n\n\n from base\n),\n\nfinal as (\n\n select\n source_relation,\n cast(id as TEXT ) as template_id,\n name as template_name,\n template_type,\n created_at,\n cast(client_template_id as TEXT ) as client_template_id,\n cast(creator_user_id as TEXT ) as creator_user_id,\n cast(message_type_id as TEXT ) as message_type_id,\n updated_at,\n _fivetran_synced\n from fields\n)\n\nselect * \nfrom final", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.stg_iterable__journey": {"database": "postgres", "schema": "public_iterable_dev", "name": "stg_iterable__journey", "resource_type": "model", "package_name": "iterable", "path": "staging/stg_iterable__journey.sql", "original_file_path": "models/staging/stg_iterable__journey.sql", "unique_id": "model.iterable.stg_iterable__journey", "fqn": ["iterable", "staging", "stg_iterable__journey"], "alias": "stg_iterable__journey", "checksum": {"name": "sha256", "checksum": "d53993c3137351b54f560a3e0194593ea0d2787d328e2bc6cfe13977b35a3906"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "table", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "Table containing unique journeys, formerly known as workflows.", "columns": {"source_relation": {"name": "source_relation", "description": "Identifies the record's source.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": ["doc.iterable.source_relation"]}, "journey_id": {"name": "journey_id", "description": "Unique identifier of the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "journey_name": {"name": "journey_name", "description": "User defined name of the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "journey_type": {"name": "journey_type", "description": "The journey type", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "journey_description": {"name": "journey_description", "description": "Information about the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "creator_user_id": {"name": "creator_user_id", "description": "Reference to the user who created the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "is_enabled": {"name": "is_enabled", "description": "Boolean indicating if the journey is currently enabled", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "is_archived": {"name": "is_archived", "description": "Boolean indicating if the journey has been archived", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "lifetime_limit": {"name": "lifetime_limit", "description": "Maximum number of times a user may enter the journey over their lifetime", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "simultaneous_limit": {"name": "simultaneous_limit", "description": "Maximum number of times a user may be in the journey at the same time", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "start_tile_id": {"name": "start_tile_id", "description": "Reference to the tile which begins the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "trigger_event_names": {"name": "trigger_event_names", "description": "The event names which trigger a user's entry into the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "created_at": {"name": "created_at", "description": "Creation timestamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "updated_at": {"name": "updated_at", "description": "Last update timestamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "The time when a record was last updated by Fivetran.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": ["doc.iterable._fivetran_synced"]}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "iterable://models/staging/stg_iterable.yml", "build_path": null, "unrendered_config": {"materialized": "table", "schema": "iterable_{{ var('directed_schema','dev') }}", "enabled": "var('iterable__using_journey', True)", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789419973.0000467, "relation_name": "\"postgres\".\"public_iterable_dev\".\"stg_iterable__journey\"", "raw_code": "{{ config(enabled=var('iterable__using_journey', True)) }}\n\n{% set source_columns_in_relation = adapter.get_columns_in_relation(ref('stg_iterable__journey_tmp')) %}\n\nwith base as (\n\n select *\n from {{ ref('stg_iterable__journey_tmp') }}\n\n),\n\nfields as (\n\n select\n\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=source_columns_in_relation,\n staging_columns=get_journey_columns()\n )\n }}\n {{ fivetran_utils.apply_source_relation(package_name='iterable') }}\n\n from base\n),\n\nfinal as (\n\n select\n source_relation,\n cast(id as {{ dbt.type_string() }} ) as journey_id,\n name as journey_name,\n journey_type,\n description as journey_description,\n cast(creator_user_id as {{ dbt.type_string() }} ) as creator_user_id,\n enabled as is_enabled,\n is_archived,\n lifetime_limit,\n simultaneous_limit,\n cast(start_tile_id as {{ dbt.type_string() }} ) as start_tile_id,\n {{ iterable.json_to_string(\"trigger_event_names\", source_columns_in_relation) }} as trigger_event_names,\n created_at,\n updated_at,\n _fivetran_synced\n\n --The below script allows for pass through columns.\n {{ fivetran_utils.fill_pass_through_columns('iterable_journey_pass_through_columns') }}\n\n from fields\n where not coalesce(_fivetran_deleted, false)\n)\n\nselect *\nfrom final", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__journey_tmp", "package": null, "version": null}, {"name": "stg_iterable__journey_tmp", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.iterable.get_journey_columns", "macro.fivetran_utils.fill_staging_columns", "macro.fivetran_utils.apply_source_relation", "macro.dbt.type_string", "macro.iterable.json_to_string", "macro.fivetran_utils.fill_pass_through_columns"], "nodes": ["model.iterable.stg_iterable__journey_tmp"]}, "compiled_path": "target/compiled/iterable/models/staging/stg_iterable__journey.sql", "compiled": true, "compiled_code": "\n\n\n\nwith base as (\n\n select *\n from \"postgres\".\"public_iterable_dev\".\"stg_iterable__journey_tmp\"\n\n),\n\nfields as (\n\n select\n\n \n _fivetran_deleted as _fivetran_deleted,\n _fivetran_synced as _fivetran_synced,\n created_at as created_at,\n creator_user_id as creator_user_id,\n description as description,\n enabled as enabled,\n id as id,\n is_archived as is_archived,\n journey_type as journey_type,\n lifetime_limit as lifetime_limit,\n name as name,\n simultaneous_limit as simultaneous_limit,\n start_tile_id as start_tile_id,\n trigger_event_names as trigger_event_names,\n updated_at as updated_at\n \n\n\n\n\n \n \n\n\n\n\n\n, cast('postgres.public' as TEXT) as source_relation\n\n\n from base\n),\n\nfinal as (\n\n select\n source_relation,\n cast(id as TEXT ) as journey_id,\n name as journey_name,\n journey_type,\n description as journey_description,\n cast(creator_user_id as TEXT ) as creator_user_id,\n enabled as is_enabled,\n is_archived,\n lifetime_limit,\n simultaneous_limit,\n cast(start_tile_id as TEXT ) as start_tile_id,\n cast(trigger_event_names as TEXT) as trigger_event_names,\n created_at,\n updated_at,\n _fivetran_synced\n\n --The below script allows for pass through columns.\n \n\n\n\n\n\n from fields\n where not coalesce(_fivetran_deleted, false)\n)\n\nselect *\nfrom final", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.stg_iterable__user_history": {"database": "postgres", "schema": "public_iterable_dev", "name": "stg_iterable__user_history", "resource_type": "model", "package_name": "iterable", "path": "staging/stg_iterable__user_history.sql", "original_file_path": "models/staging/stg_iterable__user_history.sql", "unique_id": "model.iterable.stg_iterable__user_history", "fqn": ["iterable", "staging", "stg_iterable__user_history"], "alias": "stg_iterable__user_history", "checksum": {"name": "sha256", "checksum": "632b1ddaf71b0cb861ae314c40c6a68a25371b8646d2fa2334c4eb7149227251"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "Table containing individual user history information.", "columns": {"source_relation": {"name": "source_relation", "description": "Identifies the record's source.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": ["doc.iterable.source_relation"]}, "unique_user_key": {"name": "unique_user_key", "description": "The unique identifier of the user. With the new schema (Aug 2023), it is the _fivetran_user_id. This is a hash of user_id and/or email, depending on project type. If using the old schema, it is email.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "email": {"name": "email", "description": "The user's email. User identifier, for email-based projects. Previously was the unique identifier for user records, for the old Iterable schema before the August 2023 updates.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "user_id": {"name": "user_id", "description": "User identifier, for userID-based projects.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "first_name": {"name": "first_name", "description": "First name of the user", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "last_name": {"name": "last_name", "description": "Last name of the user", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "email_list_ids": {"name": "email_list_ids", "description": "[DEPRECATED October 13, 2025. Use LIST_USER source instead.] Array of references to the lists associated with the user.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "signup_date": {"name": "signup_date", "description": "Timestamp of when the user signed up", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "signup_source": {"name": "signup_source", "description": "Source where the user signed up", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "updated_at": {"name": "updated_at", "description": "Last update timestamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "phone_number": {"name": "phone_number", "description": "Phone number associated with the user", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "iterable_user_id": {"name": "iterable_user_id", "description": "Another user identifier, for userID-based projects", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "_fivetran_user_id": {"name": "_fivetran_user_id", "description": "A Fivetran-created unique identifier for users, derived from hashing user_id and/or email, depending on project type. This exists for users of the new schema starting Aug 2023. In the old schema, the unique identifier is email.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "The time when a record was last updated by Fivetran.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": ["doc.iterable._fivetran_synced"]}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "iterable://models/staging/stg_iterable.yml", "build_path": null, "unrendered_config": {"materialized": "view", "schema": "iterable_{{ var('directed_schema','dev') }}", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789419973.0080664, "relation_name": "\"postgres\".\"public_iterable_dev\".\"stg_iterable__user_history\"", "raw_code": "{{ config(materialized='view') }}\n{% set source_columns_in_relation = adapter.get_columns_in_relation(ref('stg_iterable__user_history_tmp')) %}\n\n\nwith base as (\n\n select * \n from {{ ref('stg_iterable__user_history_tmp') }}\n\n),\n\nfields as (\n\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_iterable/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_iterable/macros/).\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=source_columns_in_relation,\n staging_columns=get_user_history_columns()\n )\n }}\n {{ fivetran_utils.apply_source_relation(package_name='iterable') }}\n\n from base\n),\n\nfinal as (\n\n select\n source_relation,\n cast(_fivetran_id as {{ dbt.type_string() }} ) as _fivetran_user_id,\n lower(email) as email,\n updated_at,\n cast(user_id as {{ dbt.type_string() }} ) as user_id,\n first_name,\n last_name,\n {{ iterable.json_to_string(\"email_list_ids\", source_columns_in_relation) }} as email_list_ids,\n phone_number,\n signup_date,\n signup_source,\n cast(iterable_user_id as {{ dbt.type_string() }} ) as iterable_user_id,\n _fivetran_synced,\n coalesce(cast(_fivetran_id as {{ dbt.type_string() }} ) , email) as unique_user_key\n\n {{ fivetran_utils.fill_pass_through_columns('iterable_user_history_pass_through_columns') }}\n\n from fields\n)\n\nselect *\nfrom final", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__user_history_tmp", "package": null, "version": null}, {"name": "stg_iterable__user_history_tmp", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.iterable.get_user_history_columns", "macro.fivetran_utils.fill_staging_columns", "macro.fivetran_utils.apply_source_relation", "macro.dbt.type_string", "macro.iterable.json_to_string", "macro.fivetran_utils.fill_pass_through_columns"], "nodes": ["model.iterable.stg_iterable__user_history_tmp"]}, "compiled_path": "target/compiled/iterable/models/staging/stg_iterable__user_history.sql", "compiled": true, "compiled_code": "\n\n\n\nwith base as (\n\n select * \n from \"postgres\".\"public_iterable_dev\".\"stg_iterable__user_history_tmp\"\n\n),\n\nfields as (\n\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_iterable/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_iterable/macros/).\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n \n cast(null as TEXT) as _fivetran_id,\n _fivetran_synced as _fivetran_synced,\n email as email,\n email_list_ids as email_list_ids,\n first_name as first_name,\n last_name as last_name,\n phone_number as phone_number,\n signup_date as signup_date,\n signup_source as signup_source,\n updated_at as updated_at,\n user_id as user_id,\n iterable_user_id as iterable_user_id\n \n\n\n\n\n \n \n\n\n\n\n\n, cast('postgres.public' as TEXT) as source_relation\n\n\n from base\n),\n\nfinal as (\n\n select\n source_relation,\n cast(_fivetran_id as TEXT ) as _fivetran_user_id,\n lower(email) as email,\n updated_at,\n cast(user_id as TEXT ) as user_id,\n first_name,\n last_name,\n cast(email_list_ids as TEXT) as email_list_ids,\n phone_number,\n signup_date,\n signup_source,\n cast(iterable_user_id as TEXT ) as iterable_user_id,\n _fivetran_synced,\n coalesce(cast(_fivetran_id as TEXT ) , email) as unique_user_key\n\n \n\n\n\n\n\n from fields\n)\n\nselect *\nfrom final", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.stg_iterable__user_unsub_message_type": {"database": "postgres", "schema": "public_iterable_dev", "name": "stg_iterable__user_unsub_message_type", "resource_type": "model", "package_name": "iterable", "path": "staging/stg_iterable__user_unsub_message_type.sql", "original_file_path": "models/staging/stg_iterable__user_unsub_message_type.sql", "unique_id": "model.iterable.stg_iterable__user_unsub_message_type", "fqn": ["iterable", "staging", "stg_iterable__user_unsub_message_type"], "alias": "stg_iterable__user_unsub_message_type", "checksum": {"name": "sha256", "checksum": "82bd48604365ec4a7a3309f2ce007e169add2c902675e5d1da155edc32a6bb71"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "table", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "Table containing the message types from which a user has unsubscribed. \"Unsubscribed\" is shortened to \"unsub\" for postgres compatibility.", "columns": {"source_relation": {"name": "source_relation", "description": "Identifies the record's source.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": ["doc.iterable.source_relation"]}, "message_type_id": {"name": "message_type_id", "description": "Reference to the message type from which the user unsubscribed", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unsub_message_type_unique_key": {"name": "unsub_message_type_unique_key", "description": "A surrogate key providing a unique key for each record. If using user_unsubscribed_message_type_history, it uses '_fivetran_id', 'email', 'message_type_id', 'updated_at', and 'source_relation'. If not using the history table, it uses '_fivetran_id', 'message_type_id', and 'source_relation'.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "_fivetran_user_id": {"name": "_fivetran_user_id", "description": "A Fivetran-created unique identifier for users, derived from hashing user_id and/or email, depending on project type. This exists for users of the new schema starting Aug 2023. In the old schema, the unique identifier is email.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_user_key": {"name": "unique_user_key", "description": "The unique identifier of the user. With the new schema (Aug 2023), it is the _fivetran_user_id. This is a hash of user_id and/or email, depending on project type. If using the old schema, it is email.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "latest_batch_index": {"name": "latest_batch_index", "description": "Indexes each user record based on the most recent available.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "updated_at": {"name": "updated_at", "description": "Last update timestamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "The time when a record was last updated by Fivetran.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": ["doc.iterable._fivetran_synced"]}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "iterable://models/staging/stg_iterable.yml", "build_path": null, "unrendered_config": {"materialized": "table", "schema": "iterable_{{ var('directed_schema','dev') }}", "enabled": "var('iterable__using_user_unsubscribed_message_type', True)", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789419973.010908, "relation_name": "\"postgres\".\"public_iterable_dev\".\"stg_iterable__user_unsub_message_type\"", "raw_code": "{{ config(enabled=var('iterable__using_user_unsubscribed_message_type', True)) }}\n\nwith base as (\n\n select * \n from {{ ref('stg_iterable__user_unsub_message_type_tmp') }}\n\n),\n\nfields as (\n\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_iterable/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_iterable/macros/).\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_iterable__user_unsub_message_type_tmp')),\n staging_columns=get_user_unsubscribed_message_type_columns()\n )\n }}\n {{ fivetran_utils.apply_source_relation(package_name='iterable') }}\n\n from base\n),\n\nfinal as (\n\n select\n source_relation,\n cast(_fivetran_id as {{ dbt.type_string() }} ) as _fivetran_user_id,\n coalesce(cast(_fivetran_id as {{ dbt.type_string() }} ), email) as unique_user_key,\n cast(message_type_id as {{ dbt.type_string() }} ) as message_type_id,\n {{ dbt_utils.generate_surrogate_key(['_fivetran_id', 'email', 'message_type_id','updated_at','source_relation']) }} as unsub_message_type_unique_key,\n\n {% if does_table_exist('user_unsubscribed_message_type') == false %}\n rank() over(partition by email, message_type_id{{ fivetran_utils.partition_by_source_relation(package_name='iterable') }} order by updated_at desc) as latest_batch_index,\n {% else %}\n 1 as latest_batch_index,\n {% endif %}\n\n updated_at,\n _fivetran_synced\n\n from fields\n)\n\nselect *\nfrom final", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__user_unsub_message_type_tmp", "package": null, "version": null}, {"name": "stg_iterable__user_unsub_message_type_tmp", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.iterable.get_user_unsubscribed_message_type_columns", "macro.fivetran_utils.fill_staging_columns", "macro.fivetran_utils.apply_source_relation", "macro.dbt.type_string", "macro.dbt_utils.generate_surrogate_key", "macro.iterable.does_table_exist"], "nodes": ["model.iterable.stg_iterable__user_unsub_message_type_tmp"]}, "compiled_path": "target/compiled/iterable/models/staging/stg_iterable__user_unsub_message_type.sql", "compiled": true, "compiled_code": "\n\nwith base as (\n\n select * \n from \"postgres\".\"public_iterable_dev\".\"stg_iterable__user_unsub_message_type_tmp\"\n\n),\n\nfields as (\n\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_iterable/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_iterable/macros/).\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n \n _fivetran_synced as _fivetran_synced,\n _fivetran_id as _fivetran_id,\n message_type_id as message_type_id,\n cast(null as TEXT) as email,\n cast(null as timestamp) as updated_at\n \n\n\n\n\n \n \n\n\n\n\n\n, cast('postgres.public' as TEXT) as source_relation\n\n\n from base\n),\n\nfinal as (\n\n select\n source_relation,\n cast(_fivetran_id as TEXT ) as _fivetran_user_id,\n coalesce(cast(_fivetran_id as TEXT ), email) as unique_user_key,\n cast(message_type_id as TEXT ) as message_type_id,\n md5(cast(coalesce(cast(_fivetran_id as TEXT), '_dbt_utils_surrogate_key_null_') || '-' || coalesce(cast(email as TEXT), '_dbt_utils_surrogate_key_null_') || '-' || coalesce(cast(message_type_id as TEXT), '_dbt_utils_surrogate_key_null_') || '-' || coalesce(cast(updated_at as TEXT), '_dbt_utils_surrogate_key_null_') || '-' || coalesce(cast(source_relation as TEXT), '_dbt_utils_surrogate_key_null_') as TEXT)) as unsub_message_type_unique_key,\n\n \n 1 as latest_batch_index,\n \n\n updated_at,\n _fivetran_synced\n\n from fields\n)\n\nselect *\nfrom final", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.stg_iterable__list": {"database": "postgres", "schema": "public_iterable_dev", "name": "stg_iterable__list", "resource_type": "model", "package_name": "iterable", "path": "staging/stg_iterable__list.sql", "original_file_path": "models/staging/stg_iterable__list.sql", "unique_id": "model.iterable.stg_iterable__list", "fqn": ["iterable", "staging", "stg_iterable__list"], "alias": "stg_iterable__list", "checksum": {"name": "sha256", "checksum": "b2a6869e5186282b7f5c8173ecba41c0324c1dc31df78db2418f51f2578eaa21"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "table", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "Table containing users and the lists the users are associated with.", "columns": {"source_relation": {"name": "source_relation", "description": "Identifies the record's source.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": ["doc.iterable.source_relation"]}, "list_id": {"name": "list_id", "description": "Unique identifier of the list", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "list_name": {"name": "list_name", "description": "User defined name of the list", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "list_type": {"name": "list_type", "description": "The list type", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "created_at": {"name": "created_at", "description": "Creation timestamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "list_description": {"name": "list_description", "description": "Information about the list", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "The time when a record was last updated by Fivetran.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": ["doc.iterable._fivetran_synced"]}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "iterable://models/staging/stg_iterable.yml", "build_path": null, "unrendered_config": {"materialized": "table", "schema": "iterable_{{ var('directed_schema','dev') }}", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789419973.0012348, "relation_name": "\"postgres\".\"public_iterable_dev\".\"stg_iterable__list\"", "raw_code": "with base as (\n\n select * \n from {{ ref('stg_iterable__list_tmp') }}\n\n),\n\nfields as (\n\n select\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_iterable__list_tmp')),\n staging_columns=get_list_columns()\n )\n }}\n {{ fivetran_utils.apply_source_relation(package_name='iterable') }}\n \n from base\n),\n\nfinal as (\n\n select\n source_relation,\n id as list_id,\n name as list_name,\n list_type,\n created_at,\n description as list_description,\n _fivetran_synced\n from fields\n where not coalesce(_fivetran_deleted, true)\n)\n\nselect * \nfrom final", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__list_tmp", "package": null, "version": null}, {"name": "stg_iterable__list_tmp", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.iterable.get_list_columns", "macro.fivetran_utils.fill_staging_columns", "macro.fivetran_utils.apply_source_relation"], "nodes": ["model.iterable.stg_iterable__list_tmp"]}, "compiled_path": "target/compiled/iterable/models/staging/stg_iterable__list.sql", "compiled": true, "compiled_code": "with base as (\n\n select * \n from \"postgres\".\"public_iterable_dev\".\"stg_iterable__list_tmp\"\n\n),\n\nfields as (\n\n select\n \n _fivetran_deleted as _fivetran_deleted,\n _fivetran_synced as _fivetran_synced,\n created_at as created_at,\n id as id,\n list_type as list_type,\n description as description,\n name as name\n \n\n\n\n\n \n \n\n\n\n\n\n, cast('postgres.public' as TEXT) as source_relation\n\n \n from base\n),\n\nfinal as (\n\n select\n source_relation,\n id as list_id,\n name as list_name,\n list_type,\n created_at,\n description as list_description,\n _fivetran_synced\n from fields\n where not coalesce(_fivetran_deleted, true)\n)\n\nselect * \nfrom final", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.stg_iterable__list_user": {"database": "postgres", "schema": "public_iterable_dev", "name": "stg_iterable__list_user", "resource_type": "model", "package_name": "iterable", "path": "staging/stg_iterable__list_user.sql", "original_file_path": "models/staging/stg_iterable__list_user.sql", "unique_id": "model.iterable.stg_iterable__list_user", "fqn": ["iterable", "staging", "stg_iterable__list_user"], "alias": "stg_iterable__list_user", "checksum": {"name": "sha256", "checksum": "f3fe66e05562725c91948ac2023c649573560043aa82c03fe93f6232f6600954"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "table", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "Table containing the relationship between users and lists they belong to.", "columns": {"source_relation": {"name": "source_relation", "description": "Identifies the record's source.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": ["doc.iterable.source_relation"]}, "_fivetran_user_id": {"name": "_fivetran_user_id", "description": "Unique identifier of the list-user relationship record, serving as a foreign key to `stg_iterable__user_history._fivetran_id`.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "list_user_index": {"name": "list_user_index", "description": "Index of the record", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "list_id": {"name": "list_id", "description": "Reference to the list that the user belongs to", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "The time when a record was last updated by Fivetran.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": ["doc.iterable._fivetran_synced"]}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "iterable://models/staging/stg_iterable.yml", "build_path": null, "unrendered_config": {"materialized": "table", "schema": "iterable_{{ var('directed_schema','dev') }}", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789419973.0065777, "relation_name": "\"postgres\".\"public_iterable_dev\".\"stg_iterable__list_user\"", "raw_code": "{% set source_columns_in_relation = adapter.get_columns_in_relation(ref('stg_iterable__list_user_tmp')) %}\n\nwith base as (\n\n select *\n from {{ ref('stg_iterable__list_user_tmp') }}\n\n),\n\nfields as (\n\n select\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=source_columns_in_relation,\n staging_columns=get_list_user_columns()\n )\n }}\n {{ fivetran_utils.apply_source_relation(package_name='iterable') }}\n\n from base\n),\n\nfinal as (\n\n select\n source_relation,\n cast(_fivetran_id as {{ dbt.type_string() }} ) as _fivetran_user_id,\n index as list_user_index,\n list_id,\n _fivetran_synced\n\n from fields\n)\n\nselect *\nfrom final", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__list_user_tmp", "package": null, "version": null}, {"name": "stg_iterable__list_user_tmp", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.iterable.get_list_user_columns", "macro.fivetran_utils.fill_staging_columns", "macro.fivetran_utils.apply_source_relation", "macro.dbt.type_string"], "nodes": ["model.iterable.stg_iterable__list_user_tmp"]}, "compiled_path": "target/compiled/iterable/models/staging/stg_iterable__list_user.sql", "compiled": true, "compiled_code": "\n\nwith base as (\n\n select *\n from \"postgres\".\"public_iterable_dev\".\"stg_iterable__list_user_tmp\"\n\n),\n\nfields as (\n\n select\n \n _fivetran_id as _fivetran_id,\n _fivetran_synced as _fivetran_synced,\n index as index,\n list_id as list_id\n \n\n\n\n\n \n \n\n\n\n\n\n, cast('postgres.public' as TEXT) as source_relation\n\n\n from base\n),\n\nfinal as (\n\n select\n source_relation,\n cast(_fivetran_id as TEXT ) as _fivetran_user_id,\n index as list_user_index,\n list_id,\n _fivetran_synced\n\n from fields\n)\n\nselect *\nfrom final", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.stg_iterable__campaign_suppression_list_history": {"database": "postgres", "schema": "public_iterable_dev", "name": "stg_iterable__campaign_suppression_list_history", "resource_type": "model", "package_name": "iterable", "path": "staging/stg_iterable__campaign_suppression_list_history.sql", "original_file_path": "models/staging/stg_iterable__campaign_suppression_list_history.sql", "unique_id": "model.iterable.stg_iterable__campaign_suppression_list_history", "fqn": ["iterable", "staging", "stg_iterable__campaign_suppression_list_history"], "alias": "stg_iterable__campaign_suppression_list_history", "checksum": {"name": "sha256", "checksum": "695d57ff7cf14d55ef6881ee9184e873c2cdc7fd61bfd9fbb0cb3330fe055ae0"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "table", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "Table containing a history of suppression lists.", "columns": {"source_relation": {"name": "source_relation", "description": "Identifies the record's source.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": ["doc.iterable.source_relation"]}, "campaign_id": {"name": "campaign_id", "description": "Reference to the campaign associated with the label", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "suppressed_list_id": {"name": "suppressed_list_id", "description": "Reference to the list used", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "updated_at": {"name": "updated_at", "description": "Last update timestamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "The time when a record was last updated by Fivetran.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": ["doc.iterable._fivetran_synced"]}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "iterable://models/staging/stg_iterable.yml", "build_path": null, "unrendered_config": {"materialized": "table", "schema": "iterable_{{ var('directed_schema','dev') }}", "enabled": "var('iterable__using_campaign_suppression_list_history', True)", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789419972.9940054, "relation_name": "\"postgres\".\"public_iterable_dev\".\"stg_iterable__campaign_suppression_list_history\"", "raw_code": "{{ config(enabled=var('iterable__using_campaign_suppression_list_history', True)) }}\n\nwith base as (\n\n select * \n from {{ ref('stg_iterable__campaign_suppression_list_history_tmp') }}\n\n),\n\nfields as (\n\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_iterable/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_iterable/macros/).\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_iterable__campaign_suppression_list_history_tmp')),\n staging_columns=get_campaign_suppression_list_history_columns()\n )\n }}\n {{ fivetran_utils.apply_source_relation(package_name='iterable') }}\n\n from base\n),\n\nfinal as (\n\n select\n source_relation,\n cast(campaign_id as {{ dbt.type_string() }}) as campaign_id,\n cast(suppressed_list_id as {{ dbt.type_string() }}) as suppressed_list_id,\n updated_at,\n _fivetran_synced\n from fields\n)\n\nselect * \nfrom final", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__campaign_suppression_list_history_tmp", "package": null, "version": null}, {"name": "stg_iterable__campaign_suppression_list_history_tmp", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.iterable.get_campaign_suppression_list_history_columns", "macro.fivetran_utils.fill_staging_columns", "macro.fivetran_utils.apply_source_relation", "macro.dbt.type_string"], "nodes": ["model.iterable.stg_iterable__campaign_suppression_list_history_tmp"]}, "compiled_path": "target/compiled/iterable/models/staging/stg_iterable__campaign_suppression_list_history.sql", "compiled": true, "compiled_code": "\n\nwith base as (\n\n select * \n from \"postgres\".\"public_iterable_dev\".\"stg_iterable__campaign_suppression_list_history_tmp\"\n\n),\n\nfields as (\n\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_iterable/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_iterable/macros/).\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n \n _fivetran_synced as _fivetran_synced,\n campaign_id as campaign_id,\n suppressed_list_id as suppressed_list_id,\n updated_at as updated_at\n \n\n\n\n\n \n \n\n\n\n\n\n, cast('postgres.public' as TEXT) as source_relation\n\n\n from base\n),\n\nfinal as (\n\n select\n source_relation,\n cast(campaign_id as TEXT) as campaign_id,\n cast(suppressed_list_id as TEXT) as suppressed_list_id,\n updated_at,\n _fivetran_synced\n from fields\n)\n\nselect * \nfrom final", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.stg_iterable__event_extension": {"database": "postgres", "schema": "public_iterable_dev", "name": "stg_iterable__event_extension", "resource_type": "model", "package_name": "iterable", "path": "staging/stg_iterable__event_extension.sql", "original_file_path": "models/staging/stg_iterable__event_extension.sql", "unique_id": "model.iterable.stg_iterable__event_extension", "fqn": ["iterable", "staging", "stg_iterable__event_extension"], "alias": "stg_iterable__event_extension", "checksum": {"name": "sha256", "checksum": "006d3abf1fe12ef7312b3f02d07a13a483883e57acfe0fceedb3e6a9f71372ff"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "Table containing addition properties from the event table.", "columns": {"source_relation": {"name": "source_relation", "description": "Identifies the record's source.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": ["doc.iterable.source_relation"]}, "event_id": {"name": "event_id", "description": "A Fivetran-created unique identifier derived from hashing campaign_id, created_at, and event_name.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_event_id": {"name": "unique_event_id", "description": "A surrogate key made up of event_id, _fivetran_user_id, and source_relation.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "is_app_already_running": {"name": "is_app_already_running", "description": "Boolean indicating if the app is currently running or not", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "badge": {"name": "badge", "description": "Badge associated with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "canonical_url_id": {"name": "canonical_url_id", "description": "Reference to the url associated with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "is_content_available": {"name": "is_content_available", "description": "Content available from the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "content_id": {"name": "content_id", "description": "Reference to the content associated with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "device": {"name": "device", "description": "The device associated with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "email_id": {"name": "email_id", "description": "Reference to the email associated with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "email_subject": {"name": "email_subject", "description": "Subject of the email associated with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "experiment_id": {"name": "experiment_id", "description": "Reference to the experiment used if the event is an experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "from_phone_number_id": {"name": "from_phone_number_id", "description": "Reference to the phone number which the event is from", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "from_smssender_id": {"name": "from_smssender_id", "description": "Reference to the sms sender which the event is from", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "link_id": {"name": "link_id", "description": "Reference to the link associated with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "link_url": {"name": "link_url", "description": "Url of the link associated with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "locale": {"name": "locale", "description": "Locale associated with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "payload": {"name": "payload", "description": "Payload resulted from the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "platform_endpoint": {"name": "platform_endpoint", "description": "The specific platform endpoint of the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "push_message": {"name": "push_message", "description": "Boolean indicating if the event is a push message", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "region": {"name": "region", "description": "Region of the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "sms_message": {"name": "sms_message", "description": "Boolean indicating if the event is an sms message", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "to_phone_number": {"name": "to_phone_number", "description": "To phone number associated with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "url": {"name": "url", "description": "Url associated with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "workflow_id": {"name": "workflow_id", "description": "Reference to the workflow which the event originated", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "workflow_name": {"name": "workflow_name", "description": "Name of the workflow which the event originated", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "catalog_collection_count": {"name": "catalog_collection_count", "description": "The count of products or items collected in a catalog associated with the event.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "catalog_lookup_count": {"name": "catalog_lookup_count", "description": "The count of times a catalog was looked up or queried during the event.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "city": {"name": "city", "description": "The city associated with the event, which could be the location of the recipient.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "clicked_url": {"name": "clicked_url", "description": "The URL that was clicked by the recipient in response to the marketing message.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "country": {"name": "country", "description": "The country associated with the event, which could be the location of the recipient.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "error_code": {"name": "error_code", "description": "The error code or message indicating any issues or errors encountered during the event.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "expires_at": {"name": "expires_at", "description": "The date and time when the event or message is set to expire or become invalid.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "from_phone_number": {"name": "from_phone_number", "description": "The phone number from which the SMS message was sent.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "in_app_body": {"name": "in_app_body", "description": "The content or body of an in-app message that was sent as part of the event.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "is_sms_estimation": {"name": "is_sms_estimation", "description": "A boolean indicating whether the SMS message is an estimation or not.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "labels": {"name": "labels", "description": "Any labels or tags associated with the event, which can be used for categorization or organization.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "message_status": {"name": "message_status", "description": "The status of the marketing message, such as sent, delivered, opened, etc.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "mms_send_count": {"name": "mms_send_count", "description": "The count of multimedia messages (MMS) sent as part of the event.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "reason": {"name": "reason", "description": "The reason or cause associated with a specific event or action.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "sms_send_count": {"name": "sms_send_count", "description": "The count of SMS messages sent as part of the event.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "_fivetran_user_id": {"name": "_fivetran_user_id", "description": "A Fivetran-created unique identifier for users, derived from hashing user_id and/or email, depending on project type. This exists for users of the new schema starting Aug 2023. In the old schema, the unique identifier is email.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "The time when a record was last updated by Fivetran.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": ["doc.iterable._fivetran_synced"]}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "iterable://models/staging/stg_iterable.yml", "build_path": null, "unrendered_config": {"materialized": "view", "schema": "iterable_{{ var('directed_schema','dev') }}", "enabled": "var('iterable__using_event_extension', True)", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789419972.9988177, "relation_name": "\"postgres\".\"public_iterable_dev\".\"stg_iterable__event_extension\"", "raw_code": "{{ config(\n enabled=var('iterable__using_event_extension', True),\n materialized='view'\n) }}\n\nwith base as (\n\n select * \n from {{ ref('stg_iterable__event_extension_tmp') }}\n\n),\n\nfields as (\n\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_iterable/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_iterable/macros/).\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_iterable__event_extension_tmp')),\n staging_columns=get_event_extension_columns()\n )\n }}\n {{ fivetran_utils.apply_source_relation(package_name='iterable') }}\n\n from base\n),\n\nfinal as (\n select\n source_relation,\n cast(_fivetran_id as {{ dbt.type_string() }} ) as event_id,\n {{ dbt_utils.generate_surrogate_key(['_fivetran_id','_fivetran_user_id','source_relation']) }} as unique_event_id,\n app_already_running as is_app_already_running,\n badge,\n catalog_collection_count,\n catalog_lookup_count,\n cast(canonical_url_id as {{ dbt.type_string() }} ) as canonical_url_id,\n content_available as is_content_available,\n cast(content_id as {{ dbt.type_string() }} ) as content_id,\n device,\n cast(email_id as {{ dbt.type_string() }}) as email_id,\n email_subject,\n experiment_id,\n from_phone_number_id,\n from_smssender_id,\n cast(link_id as {{ dbt.type_string() }} ) as link_id,\n link_url,\n locale,\n payload,\n platform_endpoint,\n push_message,\n region,\n sms_message,\n to_phone_number,\n url,\n cast(workflow_id as {{ dbt.type_string() }} ) as workflow_id,\n workflow_name,\n city,\n clicked_url,\n country,\n error_code,\n expires_at,\n from_phone_number,\n in_app_body,\n is_sms_estimation,\n labels,\n message_status,\n mms_send_count,\n reason,\n sms_send_count,\n _fivetran_synced,\n cast(_fivetran_user_id as {{ dbt.type_string() }} ) as _fivetran_user_id\n\n --The below script allows for pass through columns.\n {{ fivetran_utils.fill_pass_through_columns('iterable_event_extension_pass_through_columns') }}\n\n from fields\n)\n\nselect *\nfrom final", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__event_extension_tmp", "package": null, "version": null}, {"name": "stg_iterable__event_extension_tmp", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.iterable.get_event_extension_columns", "macro.fivetran_utils.fill_staging_columns", "macro.fivetran_utils.apply_source_relation", "macro.dbt.type_string", "macro.dbt_utils.generate_surrogate_key", "macro.fivetran_utils.fill_pass_through_columns"], "nodes": ["model.iterable.stg_iterable__event_extension_tmp"]}, "compiled_path": "target/compiled/iterable/models/staging/stg_iterable__event_extension.sql", "compiled": true, "compiled_code": "\n\nwith base as (\n\n select * \n from \"postgres\".\"public_iterable_dev\".\"stg_iterable__event_extension_tmp\"\n\n),\n\nfields as (\n\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_iterable/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_iterable/macros/).\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n \n _fivetran_id as _fivetran_id,\n _fivetran_synced as _fivetran_synced,\n app_already_running as app_already_running,\n badge as badge,\n catalog_collection_count as catalog_collection_count,\n catalog_lookup_count as catalog_lookup_count,\n canonical_url_id as canonical_url_id,\n content_available as content_available,\n content_id as content_id,\n device as device,\n email_id as email_id,\n email_subject as email_subject,\n experiment_id as experiment_id,\n from_phone_number_id as from_phone_number_id,\n from_smssender_id as from_smssender_id,\n link_id as link_id,\n link_url as link_url,\n locale as locale,\n payload as payload,\n platform_endpoint as platform_endpoint,\n push_message as push_message,\n region as region,\n sms_message as sms_message,\n to_phone_number as to_phone_number,\n url as url,\n workflow_id as workflow_id,\n workflow_name as workflow_name,\n city as city,\n clicked_url as clicked_url,\n country as country,\n error_code as error_code,\n expires_at as expires_at,\n from_phone_number as from_phone_number,\n in_app_body as in_app_body,\n is_sms_estimation as is_sms_estimation,\n labels as labels,\n message_status as message_status,\n mms_send_count as mms_send_count,\n reason as reason,\n sms_send_count as sms_send_count,\n _fivetran_user_id as _fivetran_user_id\n \n\n\n\n\n \n \n\n\n\n\n\n, cast('postgres.public' as TEXT) as source_relation\n\n\n from base\n),\n\nfinal as (\n select\n source_relation,\n cast(_fivetran_id as TEXT ) as event_id,\n md5(cast(coalesce(cast(_fivetran_id as TEXT), '_dbt_utils_surrogate_key_null_') || '-' || coalesce(cast(_fivetran_user_id as TEXT), '_dbt_utils_surrogate_key_null_') || '-' || coalesce(cast(source_relation as TEXT), '_dbt_utils_surrogate_key_null_') as TEXT)) as unique_event_id,\n app_already_running as is_app_already_running,\n badge,\n catalog_collection_count,\n catalog_lookup_count,\n cast(canonical_url_id as TEXT ) as canonical_url_id,\n content_available as is_content_available,\n cast(content_id as TEXT ) as content_id,\n device,\n cast(email_id as TEXT) as email_id,\n email_subject,\n experiment_id,\n from_phone_number_id,\n from_smssender_id,\n cast(link_id as TEXT ) as link_id,\n link_url,\n locale,\n payload,\n platform_endpoint,\n push_message,\n region,\n sms_message,\n to_phone_number,\n url,\n cast(workflow_id as TEXT ) as workflow_id,\n workflow_name,\n city,\n clicked_url,\n country,\n error_code,\n expires_at,\n from_phone_number,\n in_app_body,\n is_sms_estimation,\n labels,\n message_status,\n mms_send_count,\n reason,\n sms_send_count,\n _fivetran_synced,\n cast(_fivetran_user_id as TEXT ) as _fivetran_user_id\n\n --The below script allows for pass through columns.\n \n\n\n\n\n\n from fields\n)\n\nselect *\nfrom final", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.stg_iterable__campaign_list_history": {"database": "postgres", "schema": "public_iterable_dev", "name": "stg_iterable__campaign_list_history", "resource_type": "model", "package_name": "iterable", "path": "staging/stg_iterable__campaign_list_history.sql", "original_file_path": "models/staging/stg_iterable__campaign_list_history.sql", "unique_id": "model.iterable.stg_iterable__campaign_list_history", "fqn": ["iterable", "staging", "stg_iterable__campaign_list_history"], "alias": "stg_iterable__campaign_list_history", "checksum": {"name": "sha256", "checksum": "c7db9c46a66fec00d9fbd6492c0ea17397ec80a12d85fa2d63b9f04f09c45013"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "table", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "Table containing a history of lists.", "columns": {"source_relation": {"name": "source_relation", "description": "Identifies the record's source.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": ["doc.iterable.source_relation"]}, "campaign_id": {"name": "campaign_id", "description": "Reference to the campaign associated with the label", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "list_id": {"name": "list_id", "description": "Reference to the list used", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "updated_at": {"name": "updated_at", "description": "Last update timestamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "The time when a record was last updated by Fivetran.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": ["doc.iterable._fivetran_synced"]}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "iterable://models/staging/stg_iterable.yml", "build_path": null, "unrendered_config": {"materialized": "table", "schema": "iterable_{{ var('directed_schema','dev') }}", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789419972.99285, "relation_name": "\"postgres\".\"public_iterable_dev\".\"stg_iterable__campaign_list_history\"", "raw_code": "with base as (\n\n select * \n from {{ ref('stg_iterable__campaign_list_history_tmp') }}\n\n),\n\nfields as (\n\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_iterable/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_iterable/macros/).\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_iterable__campaign_list_history_tmp')),\n staging_columns=get_campaign_list_history_columns()\n )\n }}\n {{ fivetran_utils.apply_source_relation(package_name='iterable') }}\n \n from base\n),\n\nfinal as (\n\n select\n source_relation,\n cast(campaign_id as {{ dbt.type_string() }}) as campaign_id,\n cast(list_id as {{ dbt.type_string() }}) as list_id,\n updated_at,\n _fivetran_synced\n from fields\n)\n\nselect * \nfrom final", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__campaign_list_history_tmp", "package": null, "version": null}, {"name": "stg_iterable__campaign_list_history_tmp", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.iterable.get_campaign_list_history_columns", "macro.fivetran_utils.fill_staging_columns", "macro.fivetran_utils.apply_source_relation", "macro.dbt.type_string"], "nodes": ["model.iterable.stg_iterable__campaign_list_history_tmp"]}, "compiled_path": "target/compiled/iterable/models/staging/stg_iterable__campaign_list_history.sql", "compiled": true, "compiled_code": "with base as (\n\n select * \n from \"postgres\".\"public_iterable_dev\".\"stg_iterable__campaign_list_history_tmp\"\n\n),\n\nfields as (\n\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_iterable/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_iterable/macros/).\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n \n _fivetran_synced as _fivetran_synced,\n campaign_id as campaign_id,\n list_id as list_id,\n updated_at as updated_at\n \n\n\n\n\n \n \n\n\n\n\n\n, cast('postgres.public' as TEXT) as source_relation\n\n \n from base\n),\n\nfinal as (\n\n select\n source_relation,\n cast(campaign_id as TEXT) as campaign_id,\n cast(list_id as TEXT) as list_id,\n updated_at,\n _fivetran_synced\n from fields\n)\n\nselect * \nfrom final", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.stg_iterable__channel": {"database": "postgres", "schema": "public_iterable_dev", "name": "stg_iterable__channel", "resource_type": "model", "package_name": "iterable", "path": "staging/stg_iterable__channel.sql", "original_file_path": "models/staging/stg_iterable__channel.sql", "unique_id": "model.iterable.stg_iterable__channel", "fqn": ["iterable", "staging", "stg_iterable__channel"], "alias": "stg_iterable__channel", "checksum": {"name": "sha256", "checksum": "1ade77557691cabd1c65676182adaf401d8dde9ee42a6918d1ea7a124159cbf2"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "table", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "Table containing unique channels.", "columns": {"source_relation": {"name": "source_relation", "description": "Identifies the record's source.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": ["doc.iterable.source_relation"]}, "channel_id": {"name": "channel_id", "description": "Unique identifier of the channel", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "channel_name": {"name": "channel_name", "description": "User defined name of the channel", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "channel_type": {"name": "channel_type", "description": "The channel type", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "message_medium": {"name": "message_medium", "description": "The message medium associated with the channel", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "The time when a record was last updated by Fivetran.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": ["doc.iterable._fivetran_synced"]}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "iterable://models/staging/stg_iterable.yml", "build_path": null, "unrendered_config": {"materialized": "table", "schema": "iterable_{{ var('directed_schema','dev') }}", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789419972.9948025, "relation_name": "\"postgres\".\"public_iterable_dev\".\"stg_iterable__channel\"", "raw_code": "with base as (\n\n select *\n from {{ ref('stg_iterable__channel_tmp') }}\n\n),\n\nfields as (\n\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns\n that are expected/needed (staging_columns from dbt_iterable/models/tmp/) and compares it with columns\n in the source (source_columns from dbt_iterable/macros/).\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_iterable__channel_tmp')),\n staging_columns=get_channel_columns()\n )\n }}\n {{ fivetran_utils.apply_source_relation(package_name='iterable') }}\n\n from base\n\n),\n\nfinal as (\n\n select\n source_relation,\n cast(id as {{ dbt.type_string() }} ) as channel_id,\n name as channel_name,\n channel_type,\n message_medium,\n _fivetran_synced\n\n from fields\n where not coalesce(_fivetran_deleted, false)\n)\n\nselect * \nfrom final", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__channel_tmp", "package": null, "version": null}, {"name": "stg_iterable__channel_tmp", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.iterable.get_channel_columns", "macro.fivetran_utils.fill_staging_columns", "macro.fivetran_utils.apply_source_relation", "macro.dbt.type_string"], "nodes": ["model.iterable.stg_iterable__channel_tmp"]}, "compiled_path": "target/compiled/iterable/models/staging/stg_iterable__channel.sql", "compiled": true, "compiled_code": "with base as (\n\n select *\n from \"postgres\".\"public_iterable_dev\".\"stg_iterable__channel_tmp\"\n\n),\n\nfields as (\n\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns\n that are expected/needed (staging_columns from dbt_iterable/models/tmp/) and compares it with columns\n in the source (source_columns from dbt_iterable/macros/).\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n \n _fivetran_deleted as _fivetran_deleted,\n _fivetran_synced as _fivetran_synced,\n channel_type as channel_type,\n id as id,\n message_medium as message_medium,\n name as name\n \n\n\n\n\n \n \n\n\n\n\n\n, cast('postgres.public' as TEXT) as source_relation\n\n\n from base\n\n),\n\nfinal as (\n\n select\n source_relation,\n cast(id as TEXT ) as channel_id,\n name as channel_name,\n channel_type,\n message_medium,\n _fivetran_synced\n\n from fields\n where not coalesce(_fivetran_deleted, false)\n)\n\nselect * \nfrom final", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.stg_iterable__message_type_tmp": {"database": "postgres", "schema": "public_iterable_dev", "name": "stg_iterable__message_type_tmp", "resource_type": "model", "package_name": "iterable", "path": "staging/tmp/stg_iterable__message_type_tmp.sql", "original_file_path": "models/staging/tmp/stg_iterable__message_type_tmp.sql", "unique_id": "model.iterable.stg_iterable__message_type_tmp", "fqn": ["iterable", "staging", "tmp", "stg_iterable__message_type_tmp"], "alias": "stg_iterable__message_type_tmp", "checksum": {"name": "sha256", "checksum": "fda7a978e7b71b46f37e4878898c6655526f0531d36f74968c7bbb56ec4200e5"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"materialized": "view", "schema": "iterable_{{ var('directed_schema','dev') }}", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789419972.3429694, "relation_name": "\"postgres\".\"public_iterable_dev\".\"stg_iterable__message_type_tmp\"", "raw_code": "{{\n fivetran_utils.union_connections(\n connection_dictionary='iterable_sources',\n single_source_name='iterable',\n single_table_name='message_type'\n )\n}}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["iterable", "message_type"], ["iterable", "message_type"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.fivetran_utils.union_connections"], "nodes": ["source.iterable.iterable.message_type"]}, "compiled_path": "target/compiled/iterable/models/staging/tmp/stg_iterable__message_type_tmp.sql", "compiled": true, "compiled_code": "\n\n\n-- ** Values passed to adapter.get_relation:\n -- full-identifier_var: iterable_message_type_identifier\n -- database: postgres \n -- schema: public\n -- identifier: message_type_data\n\n\n select\n \"id\",\n \"name\",\n \"channel_id\",\n \"_fivetran_deleted\",\n \"_fivetran_synced\",\n \"created_at\",\n \"frequency_cap\",\n \"rate_limit_per_minute\",\n \"subscription_policy\",\n \"updated_at\"\n from \"postgres\".\"public\".\"message_type_data\" as source_table\n\n ", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.stg_iterable__event_extension_tmp": {"database": "postgres", "schema": "public_iterable_dev", "name": "stg_iterable__event_extension_tmp", "resource_type": "model", "package_name": "iterable", "path": "staging/tmp/stg_iterable__event_extension_tmp.sql", "original_file_path": "models/staging/tmp/stg_iterable__event_extension_tmp.sql", "unique_id": "model.iterable.stg_iterable__event_extension_tmp", "fqn": ["iterable", "staging", "tmp", "stg_iterable__event_extension_tmp"], "alias": "stg_iterable__event_extension_tmp", "checksum": {"name": "sha256", "checksum": "09d92da24c5304acbb0f0ebc81fe49e70458d1319cb1c2090f5f9ce0b87ecb29"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"materialized": "view", "schema": "iterable_{{ var('directed_schema','dev') }}", "enabled": "var('iterable__using_event_extension', True)", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789419972.367434, "relation_name": "\"postgres\".\"public_iterable_dev\".\"stg_iterable__event_extension_tmp\"", "raw_code": "{{ config(enabled=var('iterable__using_event_extension', True)) }}\n\n{{\n fivetran_utils.union_connections(\n connection_dictionary='iterable_sources',\n single_source_name='iterable',\n single_table_name='event_extension'\n )\n}}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["iterable", "event_extension"], ["iterable", "event_extension"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.fivetran_utils.union_connections"], "nodes": ["source.iterable.iterable.event_extension"]}, "compiled_path": "target/compiled/iterable/models/staging/tmp/stg_iterable__event_extension_tmp.sql", "compiled": true, "compiled_code": "\n\n\n\n\n-- ** Values passed to adapter.get_relation:\n -- full-identifier_var: iterable_event_extension_identifier\n -- database: postgres \n -- schema: public\n -- identifier: event_extension_data\n\n\n select\n \"_fivetran_id\",\n \"app_already_running\",\n \"badge\",\n \"canonical_url_id\",\n \"content_available\",\n \"content_id\",\n \"device\",\n \"email_id\",\n \"email_subject\",\n \"experiment_id\",\n \"from_phone_number_id\",\n \"from_smssender_id\",\n \"image_url\",\n \"is_ghost_push\",\n \"link_id\",\n \"link_url\",\n \"platform_endpoint\",\n \"push_message\",\n \"region\",\n \"sms_message\",\n \"sound\",\n \"to_phone_number\",\n \"url\",\n \"workflow_id\",\n \"workflow_name\",\n \"locale\",\n \"deeplink_android\",\n \"deeplink_ios\",\n \"payload\",\n \"sms_provider_response_status\",\n \"sms_provider_response_message\",\n \"sms_provider_response_code\",\n \"sms_provider_response_more_info\",\n \"_fivetran_synced\",\n \"catalog_collection_count\",\n \"catalog_lookup_count\",\n \"city\",\n \"clicked_url\",\n \"country\",\n \"error_code\",\n \"expires_at\",\n \"from_phone_number\",\n \"in_app_body\",\n \"is_sms_estimation\",\n \"labels\",\n \"message_context\",\n \"message_status\",\n \"mms_send_count\",\n \"product_recommendation_count\",\n \"proxy_source\",\n \"reason\",\n \"sms_send_count\",\n \"web_push_body\",\n \"web_push_click_action\",\n \"web_push_icon\",\n \"web_push_message\",\n \"_fivetran_user_id\"\n from \"postgres\".\"public\".\"event_extension_data\" as source_table\n\n ", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.stg_iterable__user_unsub_message_type_tmp": {"database": "postgres", "schema": "public_iterable_dev", "name": "stg_iterable__user_unsub_message_type_tmp", "resource_type": "model", "package_name": "iterable", "path": "staging/tmp/stg_iterable__user_unsub_message_type_tmp.sql", "original_file_path": "models/staging/tmp/stg_iterable__user_unsub_message_type_tmp.sql", "unique_id": "model.iterable.stg_iterable__user_unsub_message_type_tmp", "fqn": ["iterable", "staging", "tmp", "stg_iterable__user_unsub_message_type_tmp"], "alias": "stg_iterable__user_unsub_message_type_tmp", "checksum": {"name": "sha256", "checksum": "ddb46e159ed22f011676fbe7e00ba9271a493bc5185d286261ae30fa0b183636"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"materialized": "view", "schema": "iterable_{{ var('directed_schema','dev') }}", "enabled": "var('iterable__using_user_unsubscribed_message_type', True)", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789419972.3760748, "relation_name": "\"postgres\".\"public_iterable_dev\".\"stg_iterable__user_unsub_message_type_tmp\"", "raw_code": "{{ config(enabled=var('iterable__using_user_unsubscribed_message_type', True)) }}\n\n{{\n fivetran_utils.union_connections(\n connection_dictionary='iterable_sources',\n single_source_name='iterable',\n single_table_name='user_unsubscribed_message_type' if does_table_exist('user_unsubscribed_message_type') else 'user_unsubscribed_message_type_history'\n )\n}}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["iterable", "user_unsubscribed_message_type_history"], ["iterable", "user_unsubscribed_message_type_history"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.iterable.does_table_exist", "macro.fivetran_utils.union_connections"], "nodes": ["source.iterable.iterable.user_unsubscribed_message_type_history"]}, "compiled_path": "target/compiled/iterable/models/staging/tmp/stg_iterable__user_unsub_message_type_tmp.sql", "compiled": true, "compiled_code": "\n\n\n\n\n-- ** Values passed to adapter.get_relation:\n -- full-identifier_var: iterable_user_unsubscribed_message_type_identifier\n -- database: postgres \n -- schema: public\n -- identifier: user_unsubscribed_message_type_data\n\n\n select\n \"_fivetran_id\",\n \"message_type_id\",\n \"_fivetran_synced\"\n from \"postgres\".\"public\".\"user_unsubscribed_message_type_data\" as source_table\n\n ", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.stg_iterable__campaign_list_history_tmp": {"database": "postgres", "schema": "public_iterable_dev", "name": "stg_iterable__campaign_list_history_tmp", "resource_type": "model", "package_name": "iterable", "path": "staging/tmp/stg_iterable__campaign_list_history_tmp.sql", "original_file_path": "models/staging/tmp/stg_iterable__campaign_list_history_tmp.sql", "unique_id": "model.iterable.stg_iterable__campaign_list_history_tmp", "fqn": ["iterable", "staging", "tmp", "stg_iterable__campaign_list_history_tmp"], "alias": "stg_iterable__campaign_list_history_tmp", "checksum": {"name": "sha256", "checksum": "c26b6a07e1d280b2d5dea6ddbff02200d527e798d8af0a8105be30c0e7d013f7"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"materialized": "view", "schema": "iterable_{{ var('directed_schema','dev') }}", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789419972.3849025, "relation_name": "\"postgres\".\"public_iterable_dev\".\"stg_iterable__campaign_list_history_tmp\"", "raw_code": "{{\n fivetran_utils.union_connections(\n connection_dictionary='iterable_sources',\n single_source_name='iterable',\n single_table_name='campaign_list_history'\n )\n}}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["iterable", "campaign_list_history"], ["iterable", "campaign_list_history"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.fivetran_utils.union_connections"], "nodes": ["source.iterable.iterable.campaign_list_history"]}, "compiled_path": "target/compiled/iterable/models/staging/tmp/stg_iterable__campaign_list_history_tmp.sql", "compiled": true, "compiled_code": "\n\n\n-- ** Values passed to adapter.get_relation:\n -- full-identifier_var: iterable_campaign_list_history_identifier\n -- database: postgres \n -- schema: public\n -- identifier: campaign_list_history_data\n\n\n select\n \"list_id\",\n \"campaign_id\",\n \"updated_at\",\n \"_fivetran_synced\"\n from \"postgres\".\"public\".\"campaign_list_history_data\" as source_table\n\n ", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.stg_iterable__list_user_tmp": {"database": "postgres", "schema": "public_iterable_dev", "name": "stg_iterable__list_user_tmp", "resource_type": "model", "package_name": "iterable", "path": "staging/tmp/stg_iterable__list_user_tmp.sql", "original_file_path": "models/staging/tmp/stg_iterable__list_user_tmp.sql", "unique_id": "model.iterable.stg_iterable__list_user_tmp", "fqn": ["iterable", "staging", "tmp", "stg_iterable__list_user_tmp"], "alias": "stg_iterable__list_user_tmp", "checksum": {"name": "sha256", "checksum": "5c8b455013c26cfd4094b38e210edeb911a22dc0f05544e65fb48c350c2725fe"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"materialized": "view", "schema": "iterable_{{ var('directed_schema','dev') }}", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789419972.392174, "relation_name": "\"postgres\".\"public_iterable_dev\".\"stg_iterable__list_user_tmp\"", "raw_code": "{{\n fivetran_utils.union_connections(\n connection_dictionary='iterable_sources',\n single_source_name='iterable',\n single_table_name='list_user'\n )\n}}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["iterable", "list_user"], ["iterable", "list_user"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.fivetran_utils.union_connections"], "nodes": ["source.iterable.iterable.list_user"]}, "compiled_path": "target/compiled/iterable/models/staging/tmp/stg_iterable__list_user_tmp.sql", "compiled": true, "compiled_code": "\n\n\n-- ** Values passed to adapter.get_relation:\n -- full-identifier_var: iterable_list_user_identifier\n -- database: postgres \n -- schema: public\n -- identifier: list_user_data\n\n\n select\n \"_fivetran_id\",\n \"index\",\n \"list_id\",\n \"_fivetran_synced\"\n from \"postgres\".\"public\".\"list_user_data\" as source_table\n\n ", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.stg_iterable__user_history_tmp": {"database": "postgres", "schema": "public_iterable_dev", "name": "stg_iterable__user_history_tmp", "resource_type": "model", "package_name": "iterable", "path": "staging/tmp/stg_iterable__user_history_tmp.sql", "original_file_path": "models/staging/tmp/stg_iterable__user_history_tmp.sql", "unique_id": "model.iterable.stg_iterable__user_history_tmp", "fqn": ["iterable", "staging", "tmp", "stg_iterable__user_history_tmp"], "alias": "stg_iterable__user_history_tmp", "checksum": {"name": "sha256", "checksum": "cc04d0fbef9ff5cd4f72ae66c9cffd316c5e134ecd81dc216dcf682b34eb587b"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"materialized": "view", "schema": "iterable_{{ var('directed_schema','dev') }}", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789419972.4000025, "relation_name": "\"postgres\".\"public_iterable_dev\".\"stg_iterable__user_history_tmp\"", "raw_code": "{{\n fivetran_utils.union_connections(\n connection_dictionary='iterable_sources',\n single_source_name='iterable',\n single_table_name='user_history'\n )\n}}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["iterable", "user_history"], ["iterable", "user_history"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.fivetran_utils.union_connections"], "nodes": ["source.iterable.iterable.user_history"]}, "compiled_path": "target/compiled/iterable/models/staging/tmp/stg_iterable__user_history_tmp.sql", "compiled": true, "compiled_code": "\n\n\n-- ** Values passed to adapter.get_relation:\n -- full-identifier_var: iterable_user_history_identifier\n -- database: postgres \n -- schema: public\n -- identifier: user_history_data\n\n\n select\n \"email\",\n \"updated_at\",\n \"first_name\",\n \"last_name\",\n \"phone_number\",\n \"user_id\",\n \"signup_date\",\n \"signup_source\",\n \"phone_number_carrier\",\n \"phone_number_country_code_iso\",\n \"phone_number_line_type\",\n \"phone_number_updated_at\",\n \"_fivetran_synced\",\n \"email_list_ids\",\n \"iterable_user_id\"\n from \"postgres\".\"public\".\"user_history_data\" as source_table\n\n ", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.stg_iterable__campaign_history_tmp": {"database": "postgres", "schema": "public_iterable_dev", "name": "stg_iterable__campaign_history_tmp", "resource_type": "model", "package_name": "iterable", "path": "staging/tmp/stg_iterable__campaign_history_tmp.sql", "original_file_path": "models/staging/tmp/stg_iterable__campaign_history_tmp.sql", "unique_id": "model.iterable.stg_iterable__campaign_history_tmp", "fqn": ["iterable", "staging", "tmp", "stg_iterable__campaign_history_tmp"], "alias": "stg_iterable__campaign_history_tmp", "checksum": {"name": "sha256", "checksum": "a37ade72efad4e5d8b38cc0548f4a4c79d38a4a337ce71f236581bda47f94696"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"materialized": "view", "schema": "iterable_{{ var('directed_schema','dev') }}", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789419972.4069493, "relation_name": "\"postgres\".\"public_iterable_dev\".\"stg_iterable__campaign_history_tmp\"", "raw_code": "{{\n fivetran_utils.union_connections(\n connection_dictionary='iterable_sources',\n single_source_name='iterable',\n single_table_name='campaign_history'\n )\n}}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["iterable", "campaign_history"], ["iterable", "campaign_history"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.fivetran_utils.union_connections"], "nodes": ["source.iterable.iterable.campaign_history"]}, "compiled_path": "target/compiled/iterable/models/staging/tmp/stg_iterable__campaign_history_tmp.sql", "compiled": true, "compiled_code": "\n\n\n-- ** Values passed to adapter.get_relation:\n -- full-identifier_var: iterable_campaign_history_identifier\n -- database: postgres \n -- schema: public\n -- identifier: campaign_history_data\n\n\n select\n \"id\",\n \"updated_at\",\n \"template_id\",\n \"recurring_campaign_id\",\n \"campaign_state\",\n \"created_at\",\n \"created_by_user_id\",\n \"ended_at\",\n \"name\",\n \"send_size\",\n \"start_at\",\n \"type\",\n \"workflow_id\",\n \"_fivetran_synced\",\n \"updated_by_user_id\",\n \"message_medium\"\n from \"postgres\".\"public\".\"campaign_history_data\" as source_table\n\n ", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.stg_iterable__template_history_tmp": {"database": "postgres", "schema": "public_iterable_dev", "name": "stg_iterable__template_history_tmp", "resource_type": "model", "package_name": "iterable", "path": "staging/tmp/stg_iterable__template_history_tmp.sql", "original_file_path": "models/staging/tmp/stg_iterable__template_history_tmp.sql", "unique_id": "model.iterable.stg_iterable__template_history_tmp", "fqn": ["iterable", "staging", "tmp", "stg_iterable__template_history_tmp"], "alias": "stg_iterable__template_history_tmp", "checksum": {"name": "sha256", "checksum": "b37299e696c1cd6388ad85a4042f9b8a5364b969e7c4fdb42f03e4c4803e9a7f"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"materialized": "view", "schema": "iterable_{{ var('directed_schema','dev') }}", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789419972.4137557, "relation_name": "\"postgres\".\"public_iterable_dev\".\"stg_iterable__template_history_tmp\"", "raw_code": "{{\n fivetran_utils.union_connections(\n connection_dictionary='iterable_sources',\n single_source_name='iterable',\n single_table_name='template_history'\n )\n}}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["iterable", "template_history"], ["iterable", "template_history"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.fivetran_utils.union_connections"], "nodes": ["source.iterable.iterable.template_history"]}, "compiled_path": "target/compiled/iterable/models/staging/tmp/stg_iterable__template_history_tmp.sql", "compiled": true, "compiled_code": "\n\n\n-- ** Values passed to adapter.get_relation:\n -- full-identifier_var: iterable_template_history_identifier\n -- database: postgres \n -- schema: public\n -- identifier: template_history_data\n\n\n select\n \"id\",\n \"updated_at\",\n \"message_type_id\",\n \"client_template_id\",\n \"created_at\",\n \"creator_user_id\",\n \"name\",\n \"template_type\",\n \"_fivetran_synced\"\n from \"postgres\".\"public\".\"template_history_data\" as source_table\n\n ", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.stg_iterable__event_tmp": {"database": "postgres", "schema": "public_iterable_dev", "name": "stg_iterable__event_tmp", "resource_type": "model", "package_name": "iterable", "path": "staging/tmp/stg_iterable__event_tmp.sql", "original_file_path": "models/staging/tmp/stg_iterable__event_tmp.sql", "unique_id": "model.iterable.stg_iterable__event_tmp", "fqn": ["iterable", "staging", "tmp", "stg_iterable__event_tmp"], "alias": "stg_iterable__event_tmp", "checksum": {"name": "sha256", "checksum": "31555eb22bfca797c1f1a4f1503da21f7620762d199e7e32b2d268c03e139f65"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"materialized": "view", "schema": "iterable_{{ var('directed_schema','dev') }}", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789419972.420351, "relation_name": "\"postgres\".\"public_iterable_dev\".\"stg_iterable__event_tmp\"", "raw_code": "{{\n fivetran_utils.union_connections(\n connection_dictionary='iterable_sources',\n single_source_name='iterable',\n single_table_name='event'\n )\n}}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["iterable", "event"], ["iterable", "event"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.fivetran_utils.union_connections"], "nodes": ["source.iterable.iterable.event"]}, "compiled_path": "target/compiled/iterable/models/staging/tmp/stg_iterable__event_tmp.sql", "compiled": true, "compiled_code": "\n\n\n-- ** Values passed to adapter.get_relation:\n -- full-identifier_var: iterable_event_identifier\n -- database: postgres \n -- schema: public\n -- identifier: event_data\n\n\n select\n \"_fivetran_id\",\n \"email\",\n \"campaign_id\",\n \"message_id\",\n \"content_id\",\n \"created_at\",\n \"event_name\",\n \"ip\",\n \"message_bus_id\",\n \"message_type_id\",\n \"recipient_state\",\n \"status\",\n \"unsub_source\",\n \"user_agent\",\n \"user_agent_device\",\n \"transactional_data\",\n \"additional_properties\",\n \"_fivetran_synced\",\n \"_fivetran_user_id\"\n from \"postgres\".\"public\".\"event_data\" as source_table\n\n ", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.stg_iterable__journey_tmp": {"database": "postgres", "schema": "public_iterable_dev", "name": "stg_iterable__journey_tmp", "resource_type": "model", "package_name": "iterable", "path": "staging/tmp/stg_iterable__journey_tmp.sql", "original_file_path": "models/staging/tmp/stg_iterable__journey_tmp.sql", "unique_id": "model.iterable.stg_iterable__journey_tmp", "fqn": ["iterable", "staging", "tmp", "stg_iterable__journey_tmp"], "alias": "stg_iterable__journey_tmp", "checksum": {"name": "sha256", "checksum": "9e10fed335359755ce1488a7df46c9bfd4a08b029e757c4e81c8c2f8cce28961"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"materialized": "view", "schema": "iterable_{{ var('directed_schema','dev') }}", "enabled": "var('iterable__using_journey', True)", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789419972.4271295, "relation_name": "\"postgres\".\"public_iterable_dev\".\"stg_iterable__journey_tmp\"", "raw_code": "{{ config(enabled=var('iterable__using_journey', True)) }}\n\n{{\n fivetran_utils.union_connections(\n connection_dictionary='iterable_sources',\n single_source_name='iterable',\n single_table_name='journey'\n )\n}}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["iterable", "journey"], ["iterable", "journey"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.fivetran_utils.union_connections"], "nodes": ["source.iterable.iterable.journey"]}, "compiled_path": "target/compiled/iterable/models/staging/tmp/stg_iterable__journey_tmp.sql", "compiled": true, "compiled_code": "\n\n\n\n\n-- ** Values passed to adapter.get_relation:\n -- full-identifier_var: iterable_journey_identifier\n -- database: postgres \n -- schema: public\n -- identifier: journey_data\n\n\n select\n \"id\",\n \"name\",\n \"journey_type\",\n \"description\",\n \"creator_user_id\",\n \"enabled\",\n \"is_archived\",\n \"lifetime_limit\",\n \"simultaneous_limit\",\n \"start_tile_id\",\n \"trigger_event_names\",\n \"created_at\",\n \"updated_at\",\n \"_fivetran_deleted\",\n \"_fivetran_synced\",\n \"draft_name\"\n from \"postgres\".\"public\".\"journey_data\" as source_table\n\n ", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.stg_iterable__campaign_suppression_list_history_tmp": {"database": "postgres", "schema": "public_iterable_dev", "name": "stg_iterable__campaign_suppression_list_history_tmp", "resource_type": "model", "package_name": "iterable", "path": "staging/tmp/stg_iterable__campaign_suppression_list_history_tmp.sql", "original_file_path": "models/staging/tmp/stg_iterable__campaign_suppression_list_history_tmp.sql", "unique_id": "model.iterable.stg_iterable__campaign_suppression_list_history_tmp", "fqn": ["iterable", "staging", "tmp", "stg_iterable__campaign_suppression_list_history_tmp"], "alias": "stg_iterable__campaign_suppression_list_history_tmp", "checksum": {"name": "sha256", "checksum": "3c5a325cac70574f2defa9fa09b436c03a3fe8a3dede5729ca95451b410d636c"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"materialized": "view", "schema": "iterable_{{ var('directed_schema','dev') }}", "enabled": "var('iterable__using_campaign_suppression_list_history', True)", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789419972.434969, "relation_name": "\"postgres\".\"public_iterable_dev\".\"stg_iterable__campaign_suppression_list_history_tmp\"", "raw_code": "{{ config(enabled=var('iterable__using_campaign_suppression_list_history', True)) }}\n\n{{\n fivetran_utils.union_connections(\n connection_dictionary='iterable_sources',\n single_source_name='iterable',\n single_table_name='campaign_suppression_list_history'\n )\n}}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["iterable", "campaign_suppression_list_history"], ["iterable", "campaign_suppression_list_history"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.fivetran_utils.union_connections"], "nodes": ["source.iterable.iterable.campaign_suppression_list_history"]}, "compiled_path": "target/compiled/iterable/models/staging/tmp/stg_iterable__campaign_suppression_list_history_tmp.sql", "compiled": true, "compiled_code": "\n\n\n\n\n-- ** Values passed to adapter.get_relation:\n -- full-identifier_var: iterable_campaign_suppression_list_history_identifier\n -- database: postgres \n -- schema: public\n -- identifier: campaign_suppression_list_history_data\n\n\n select\n \"suppressed_list_id\",\n \"campaign_id\",\n \"updated_at\",\n \"_fivetran_synced\"\n from \"postgres\".\"public\".\"campaign_suppression_list_history_data\" as source_table\n\n ", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.stg_iterable__campaign_label_history_tmp": {"database": "postgres", "schema": "public_iterable_dev", "name": "stg_iterable__campaign_label_history_tmp", "resource_type": "model", "package_name": "iterable", "path": "staging/tmp/stg_iterable__campaign_label_history_tmp.sql", "original_file_path": "models/staging/tmp/stg_iterable__campaign_label_history_tmp.sql", "unique_id": "model.iterable.stg_iterable__campaign_label_history_tmp", "fqn": ["iterable", "staging", "tmp", "stg_iterable__campaign_label_history_tmp"], "alias": "stg_iterable__campaign_label_history_tmp", "checksum": {"name": "sha256", "checksum": "08e70c9938c895459cabba65b1992d360775e26ea2b8275e408bcf21e814bd58"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"materialized": "view", "schema": "iterable_{{ var('directed_schema','dev') }}", "enabled": "var('iterable__using_campaign_label_history', True)", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789419972.4428432, "relation_name": "\"postgres\".\"public_iterable_dev\".\"stg_iterable__campaign_label_history_tmp\"", "raw_code": "{{ config(enabled=var('iterable__using_campaign_label_history', True)) }}\n\n{{\n fivetran_utils.union_connections(\n connection_dictionary='iterable_sources',\n single_source_name='iterable',\n single_table_name='campaign_label_history'\n )\n}}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["iterable", "campaign_label_history"], ["iterable", "campaign_label_history"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.fivetran_utils.union_connections"], "nodes": ["source.iterable.iterable.campaign_label_history"]}, "compiled_path": "target/compiled/iterable/models/staging/tmp/stg_iterable__campaign_label_history_tmp.sql", "compiled": true, "compiled_code": "\n\n\n\n\n-- ** Values passed to adapter.get_relation:\n -- full-identifier_var: iterable_campaign_label_history_identifier\n -- database: postgres \n -- schema: public\n -- identifier: campaign_label_history_data\n\n\n select\n \"campaign_id\",\n \"label\",\n \"updated_at\",\n \"_fivetran_synced\"\n from \"postgres\".\"public\".\"campaign_label_history_data\" as source_table\n\n ", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.stg_iterable__list_tmp": {"database": "postgres", "schema": "public_iterable_dev", "name": "stg_iterable__list_tmp", "resource_type": "model", "package_name": "iterable", "path": "staging/tmp/stg_iterable__list_tmp.sql", "original_file_path": "models/staging/tmp/stg_iterable__list_tmp.sql", "unique_id": "model.iterable.stg_iterable__list_tmp", "fqn": ["iterable", "staging", "tmp", "stg_iterable__list_tmp"], "alias": "stg_iterable__list_tmp", "checksum": {"name": "sha256", "checksum": "95fbbf63205ef9000c19e76270c8ab96e23c4f9d8072f3892a08f20648a42b5a"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"materialized": "view", "schema": "iterable_{{ var('directed_schema','dev') }}", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789419972.4504495, "relation_name": "\"postgres\".\"public_iterable_dev\".\"stg_iterable__list_tmp\"", "raw_code": "{{\n fivetran_utils.union_connections(\n connection_dictionary='iterable_sources',\n single_source_name='iterable',\n single_table_name='list'\n )\n}}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["iterable", "list"], ["iterable", "list"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.fivetran_utils.union_connections"], "nodes": ["source.iterable.iterable.list"]}, "compiled_path": "target/compiled/iterable/models/staging/tmp/stg_iterable__list_tmp.sql", "compiled": true, "compiled_code": "\n\n\n-- ** Values passed to adapter.get_relation:\n -- full-identifier_var: iterable_list_identifier\n -- database: postgres \n -- schema: public\n -- identifier: list_data\n\n\n select\n \"id\",\n \"name\",\n \"created_at\",\n \"list_type\",\n \"_fivetran_deleted\",\n \"_fivetran_synced\",\n \"description\"\n from \"postgres\".\"public\".\"list_data\" as source_table\n\n ", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.stg_iterable__channel_tmp": {"database": "postgres", "schema": "public_iterable_dev", "name": "stg_iterable__channel_tmp", "resource_type": "model", "package_name": "iterable", "path": "staging/tmp/stg_iterable__channel_tmp.sql", "original_file_path": "models/staging/tmp/stg_iterable__channel_tmp.sql", "unique_id": "model.iterable.stg_iterable__channel_tmp", "fqn": ["iterable", "staging", "tmp", "stg_iterable__channel_tmp"], "alias": "stg_iterable__channel_tmp", "checksum": {"name": "sha256", "checksum": "0516bc3567b725378b33829b8c3e7dc1b6680922f2d1e7824a913b82ca617905"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"materialized": "view", "schema": "iterable_{{ var('directed_schema','dev') }}", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789419972.457246, "relation_name": "\"postgres\".\"public_iterable_dev\".\"stg_iterable__channel_tmp\"", "raw_code": "{{\n fivetran_utils.union_connections(\n connection_dictionary='iterable_sources',\n single_source_name='iterable',\n single_table_name='channel'\n )\n}}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["iterable", "channel"], ["iterable", "channel"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.fivetran_utils.union_connections"], "nodes": ["source.iterable.iterable.channel"]}, "compiled_path": "target/compiled/iterable/models/staging/tmp/stg_iterable__channel_tmp.sql", "compiled": true, "compiled_code": "\n\n\n-- ** Values passed to adapter.get_relation:\n -- full-identifier_var: iterable_channel_identifier\n -- database: postgres \n -- schema: public\n -- identifier: channel_data\n\n\n select\n \"id\",\n \"name\",\n \"channel_type\",\n \"message_medium\",\n \"_fivetran_deleted\",\n \"_fivetran_synced\"\n from \"postgres\".\"public\".\"channel_data\" as source_table\n\n ", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.stg_iterable__user_unsubscribed_channel_tmp": {"database": "postgres", "schema": "public_iterable_dev", "name": "stg_iterable__user_unsubscribed_channel_tmp", "resource_type": "model", "package_name": "iterable", "path": "staging/tmp/stg_iterable__user_unsubscribed_channel_tmp.sql", "original_file_path": "models/staging/tmp/stg_iterable__user_unsubscribed_channel_tmp.sql", "unique_id": "model.iterable.stg_iterable__user_unsubscribed_channel_tmp", "fqn": ["iterable", "staging", "tmp", "stg_iterable__user_unsubscribed_channel_tmp"], "alias": "stg_iterable__user_unsubscribed_channel_tmp", "checksum": {"name": "sha256", "checksum": "a8d43331a84f0d1dae8511478d01cded7dfb389fef925f7173f50eb6b6b9c142"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"materialized": "view", "schema": "iterable_{{ var('directed_schema','dev') }}", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789419972.4644868, "relation_name": "\"postgres\".\"public_iterable_dev\".\"stg_iterable__user_unsubscribed_channel_tmp\"", "raw_code": "{{\n fivetran_utils.union_connections(\n connection_dictionary='iterable_sources',\n single_source_name='iterable',\n single_table_name='user_unsubscribed_channel' if does_table_exist('user_unsubscribed_channel') else 'user_unsubscribed_channel_history'\n )\n}}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["iterable", "user_unsubscribed_channel_history"], ["iterable", "user_unsubscribed_channel_history"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.iterable.does_table_exist", "macro.fivetran_utils.union_connections"], "nodes": ["source.iterable.iterable.user_unsubscribed_channel_history"]}, "compiled_path": "target/compiled/iterable/models/staging/tmp/stg_iterable__user_unsubscribed_channel_tmp.sql", "compiled": true, "compiled_code": "\n\n\n-- ** Values passed to adapter.get_relation:\n -- full-identifier_var: iterable_user_unsubscribed_channel_identifier\n -- database: postgres \n -- schema: public\n -- identifier: user_unsubscribed_channel_data\n\n\n select\n \"_fivetran_id\",\n \"channel_id\",\n \"_fivetran_synced\"\n from \"postgres\".\"public\".\"user_unsubscribed_channel_data\" as source_table\n\n ", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "test.iterable.not_null_iterable__campaigns_campaign_id.03c9448919": {"database": "postgres", "schema": "public_dbt_test__audit", "name": "not_null_iterable__campaigns_campaign_id", "resource_type": "test", "package_name": "iterable", "path": "not_null_iterable__campaigns_campaign_id.sql", "original_file_path": "models/iterable.yml", "unique_id": "test.iterable.not_null_iterable__campaigns_campaign_id.03c9448919", "fqn": ["iterable", "not_null_iterable__campaigns_campaign_id"], "alias": "not_null_iterable__campaigns_campaign_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "sql_header": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {}, "created_at": 1789419972.965412, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "iterable__campaigns", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.iterable.iterable__campaigns"]}, "compiled_path": "target/compiled/iterable/models/iterable.yml/not_null_iterable__campaigns_campaign_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect campaign_id\nfrom \"postgres\".\"public_iterable_dev\".\"iterable__campaigns\"\nwhere campaign_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "campaign_id", "file_key_name": "models.iterable__campaigns", "attached_node": "model.iterable.iterable__campaigns", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "campaign_id", "model": "{{ get_where_subquery(ref('iterable__campaigns')) }}"}, "namespace": null}}, "test.iterable.not_null_iterable__events_event_id.ed1d28a650": {"database": "postgres", "schema": "public_dbt_test__audit", "name": "not_null_iterable__events_event_id", "resource_type": "test", "package_name": "iterable", "path": "not_null_iterable__events_event_id.sql", "original_file_path": "models/iterable.yml", "unique_id": "test.iterable.not_null_iterable__events_event_id.ed1d28a650", "fqn": ["iterable", "not_null_iterable__events_event_id"], "alias": "not_null_iterable__events_event_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "sql_header": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {}, "created_at": 1789419972.9686646, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "iterable__events", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.iterable.iterable__events"]}, "compiled_path": "target/compiled/iterable/models/iterable.yml/not_null_iterable__events_event_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect event_id\nfrom \"postgres\".\"public_iterable_dev\".\"iterable__events\"\nwhere event_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "event_id", "file_key_name": "models.iterable__events", "attached_node": "model.iterable.iterable__events", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "event_id", "model": "{{ get_where_subquery(ref('iterable__events')) }}"}, "namespace": null}}, "test.iterable.not_null_iterable__journeys_journey_id.b5c6b8783a": {"database": "postgres", "schema": "public_dbt_test__audit", "name": "not_null_iterable__journeys_journey_id", "resource_type": "test", "package_name": "iterable", "path": "not_null_iterable__journeys_journey_id.sql", "original_file_path": "models/iterable.yml", "unique_id": "test.iterable.not_null_iterable__journeys_journey_id.b5c6b8783a", "fqn": ["iterable", "not_null_iterable__journeys_journey_id"], "alias": "not_null_iterable__journeys_journey_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "sql_header": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {}, "created_at": 1789419972.9713824, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "iterable__journeys", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.iterable.iterable__journeys"]}, "compiled_path": "target/compiled/iterable/models/iterable.yml/not_null_iterable__journeys_journey_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect journey_id\nfrom \"postgres\".\"public_iterable_dev\".\"iterable__journeys\"\nwhere journey_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "journey_id", "file_key_name": "models.iterable__journeys", "attached_node": "model.iterable.iterable__journeys", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "journey_id", "model": "{{ get_where_subquery(ref('iterable__journeys')) }}"}, "namespace": null}}, "test.iterable.unique_iterable__journeys_unique_journey_id.ba86841246": {"database": "postgres", "schema": "public_dbt_test__audit", "name": "unique_iterable__journeys_unique_journey_id", "resource_type": "test", "package_name": "iterable", "path": "unique_iterable__journeys_unique_journey_id.sql", "original_file_path": "models/iterable.yml", "unique_id": "test.iterable.unique_iterable__journeys_unique_journey_id.ba86841246", "fqn": ["iterable", "unique_iterable__journeys_unique_journey_id"], "alias": "unique_iterable__journeys_unique_journey_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "sql_header": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {}, "created_at": 1789419972.9740286, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "iterable__journeys", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.iterable.iterable__journeys"]}, "compiled_path": "target/compiled/iterable/models/iterable.yml/unique_iterable__journeys_unique_journey_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n unique_journey_id as unique_field,\n count(*) as n_records\n\nfrom \"postgres\".\"public_iterable_dev\".\"iterable__journeys\"\nwhere unique_journey_id is not null\ngroup by unique_journey_id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "unique_journey_id", "file_key_name": "models.iterable__journeys", "attached_node": "model.iterable.iterable__journeys", "test_metadata": {"name": "unique", "kwargs": {"column_name": "unique_journey_id", "model": "{{ get_where_subquery(ref('iterable__journeys')) }}"}, "namespace": null}}, "test.iterable.not_null_iterable__user_unsubscriptions_unique_user_key.f8db72932b": {"database": "postgres", "schema": "public_dbt_test__audit", "name": "not_null_iterable__user_unsubscriptions_unique_user_key", "resource_type": "test", "package_name": "iterable", "path": "not_null_iterable__user_unsubscriptions_unique_user_key.sql", "original_file_path": "models/iterable.yml", "unique_id": "test.iterable.not_null_iterable__user_unsubscriptions_unique_user_key.f8db72932b", "fqn": ["iterable", "not_null_iterable__user_unsubscriptions_unique_user_key"], "alias": "not_null_iterable__user_unsubscriptions_unique_user_key", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "sql_header": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {}, "created_at": 1789419972.9767356, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "iterable__user_unsubscriptions", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.iterable.iterable__user_unsubscriptions"]}, "compiled_path": "target/compiled/iterable/models/iterable.yml/not_null_iterable__user_unsubscriptions_unique_user_key.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect unique_user_key\nfrom \"postgres\".\"public_iterable_dev\".\"iterable__user_unsubscriptions\"\nwhere unique_user_key is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "unique_user_key", "file_key_name": "models.iterable__user_unsubscriptions", "attached_node": "model.iterable.iterable__user_unsubscriptions", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "unique_user_key", "model": "{{ get_where_subquery(ref('iterable__user_unsubscriptions')) }}"}, "namespace": null}}, "test.iterable.not_null_iterable__users_unique_user_key.4ca37a26c8": {"database": "postgres", "schema": "public_dbt_test__audit", "name": "not_null_iterable__users_unique_user_key", "resource_type": "test", "package_name": "iterable", "path": "not_null_iterable__users_unique_user_key.sql", "original_file_path": "models/iterable.yml", "unique_id": "test.iterable.not_null_iterable__users_unique_user_key.4ca37a26c8", "fqn": ["iterable", "not_null_iterable__users_unique_user_key"], "alias": "not_null_iterable__users_unique_user_key", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "sql_header": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {}, "created_at": 1789419972.981004, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "iterable__users", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.iterable.iterable__users"]}, "compiled_path": "target/compiled/iterable/models/iterable.yml/not_null_iterable__users_unique_user_key.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect unique_user_key\nfrom \"postgres\".\"public_iterable_dev\".\"iterable__users\"\nwhere unique_user_key is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "unique_user_key", "file_key_name": "models.iterable__users", "attached_node": "model.iterable.iterable__users", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "unique_user_key", "model": "{{ get_where_subquery(ref('iterable__users')) }}"}, "namespace": null}}, "test.iterable.not_null_stg_iterable__campaign_history_campaign_id.b7c36e4525": {"database": "postgres", "schema": "public_dbt_test__audit", "name": "not_null_stg_iterable__campaign_history_campaign_id", "resource_type": "test", "package_name": "iterable", "path": "not_null_stg_iterable__campaign_history_campaign_id.sql", "original_file_path": "models/staging/stg_iterable.yml", "unique_id": "test.iterable.not_null_stg_iterable__campaign_history_campaign_id.b7c36e4525", "fqn": ["iterable", "staging", "not_null_stg_iterable__campaign_history_campaign_id"], "alias": "not_null_stg_iterable__campaign_history_campaign_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "sql_header": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {}, "created_at": 1789419973.0121, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__campaign_history", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.iterable.stg_iterable__campaign_history"]}, "compiled_path": "target/compiled/iterable/models/staging/stg_iterable.yml/not_null_stg_iterable__campaign_history_campaign_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect campaign_id\nfrom \"postgres\".\"public_iterable_dev\".\"stg_iterable__campaign_history\"\nwhere campaign_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "campaign_id", "file_key_name": "models.stg_iterable__campaign_history", "attached_node": "model.iterable.stg_iterable__campaign_history", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "campaign_id", "model": "{{ get_where_subquery(ref('stg_iterable__campaign_history')) }}"}, "namespace": null}}, "test.iterable.not_null_stg_iterable__campaign_label_history_campaign_id.1918cef89a": {"database": "postgres", "schema": "public_dbt_test__audit", "name": "not_null_stg_iterable__campaign_label_history_campaign_id", "resource_type": "test", "package_name": "iterable", "path": "not_null_stg_iterable__campaign_label_history_campaign_id.sql", "original_file_path": "models/staging/stg_iterable.yml", "unique_id": "test.iterable.not_null_stg_iterable__campaign_label_history_campaign_id.1918cef89a", "fqn": ["iterable", "staging", "not_null_stg_iterable__campaign_label_history_campaign_id"], "alias": "not_null_stg_iterable__campaign_label_history_campaign_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "sql_header": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {}, "created_at": 1789419973.015028, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__campaign_label_history", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.iterable.stg_iterable__campaign_label_history"]}, "compiled_path": "target/compiled/iterable/models/staging/stg_iterable.yml/not_null_stg_iterable__campaign_label_history_campaign_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect campaign_id\nfrom \"postgres\".\"public_iterable_dev\".\"stg_iterable__campaign_label_history\"\nwhere campaign_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "campaign_id", "file_key_name": "models.stg_iterable__campaign_label_history", "attached_node": "model.iterable.stg_iterable__campaign_label_history", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "campaign_id", "model": "{{ get_where_subquery(ref('stg_iterable__campaign_label_history')) }}"}, "namespace": null}}, "test.iterable.not_null_stg_iterable__campaign_list_history_campaign_id.208f9bf9ed": {"database": "postgres", "schema": "public_dbt_test__audit", "name": "not_null_stg_iterable__campaign_list_history_campaign_id", "resource_type": "test", "package_name": "iterable", "path": "not_null_stg_iterable__campaign_list_history_campaign_id.sql", "original_file_path": "models/staging/stg_iterable.yml", "unique_id": "test.iterable.not_null_stg_iterable__campaign_list_history_campaign_id.208f9bf9ed", "fqn": ["iterable", "staging", "not_null_stg_iterable__campaign_list_history_campaign_id"], "alias": "not_null_stg_iterable__campaign_list_history_campaign_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "sql_header": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {}, "created_at": 1789419973.0178063, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__campaign_list_history", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.iterable.stg_iterable__campaign_list_history"]}, "compiled_path": "target/compiled/iterable/models/staging/stg_iterable.yml/not_null_stg_iterable__campaign_list_history_campaign_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect campaign_id\nfrom \"postgres\".\"public_iterable_dev\".\"stg_iterable__campaign_list_history\"\nwhere campaign_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "campaign_id", "file_key_name": "models.stg_iterable__campaign_list_history", "attached_node": "model.iterable.stg_iterable__campaign_list_history", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "campaign_id", "model": "{{ get_where_subquery(ref('stg_iterable__campaign_list_history')) }}"}, "namespace": null}}, "test.iterable.not_null_stg_iterable__campaign_suppression_list_history_campaign_id.3921289710": {"database": "postgres", "schema": "public_dbt_test__audit", "name": "not_null_stg_iterable__campaign_suppression_list_history_campaign_id", "resource_type": "test", "package_name": "iterable", "path": "not_null_stg_iterable__campaig_3ce753a10225cac67c8a1434b5541997.sql", "original_file_path": "models/staging/stg_iterable.yml", "unique_id": "test.iterable.not_null_stg_iterable__campaign_suppression_list_history_campaign_id.3921289710", "fqn": ["iterable", "staging", "not_null_stg_iterable__campaign_suppression_list_history_campaign_id"], "alias": "not_null_stg_iterable__campaig_3ce753a10225cac67c8a1434b5541997", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "not_null_stg_iterable__campaig_3ce753a10225cac67c8a1434b5541997", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "sql_header": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"alias": "not_null_stg_iterable__campaig_3ce753a10225cac67c8a1434b5541997"}, "created_at": 1789419973.0204892, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"not_null_stg_iterable__campaig_3ce753a10225cac67c8a1434b5541997\") }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__campaign_suppression_list_history", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.iterable.stg_iterable__campaign_suppression_list_history"]}, "compiled_path": "target/compiled/iterable/models/staging/stg_iterable.yml/not_null_stg_iterable__campaig_3ce753a10225cac67c8a1434b5541997.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect campaign_id\nfrom \"postgres\".\"public_iterable_dev\".\"stg_iterable__campaign_suppression_list_history\"\nwhere campaign_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "campaign_id", "file_key_name": "models.stg_iterable__campaign_suppression_list_history", "attached_node": "model.iterable.stg_iterable__campaign_suppression_list_history", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "campaign_id", "model": "{{ get_where_subquery(ref('stg_iterable__campaign_suppression_list_history')) }}"}, "namespace": null}}, "test.iterable.not_null_stg_iterable__channel_channel_id.182ceb9636": {"database": "postgres", "schema": "public_dbt_test__audit", "name": "not_null_stg_iterable__channel_channel_id", "resource_type": "test", "package_name": "iterable", "path": "not_null_stg_iterable__channel_channel_id.sql", "original_file_path": "models/staging/stg_iterable.yml", "unique_id": "test.iterable.not_null_stg_iterable__channel_channel_id.182ceb9636", "fqn": ["iterable", "staging", "not_null_stg_iterable__channel_channel_id"], "alias": "not_null_stg_iterable__channel_channel_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "sql_header": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {}, "created_at": 1789419973.0230997, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__channel", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.iterable.stg_iterable__channel"]}, "compiled_path": "target/compiled/iterable/models/staging/stg_iterable.yml/not_null_stg_iterable__channel_channel_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect channel_id\nfrom \"postgres\".\"public_iterable_dev\".\"stg_iterable__channel\"\nwhere channel_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "channel_id", "file_key_name": "models.stg_iterable__channel", "attached_node": "model.iterable.stg_iterable__channel", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "channel_id", "model": "{{ get_where_subquery(ref('stg_iterable__channel')) }}"}, "namespace": null}}, "test.iterable.not_null_stg_iterable__event_event_id.370cd4bc9d": {"database": "postgres", "schema": "public_dbt_test__audit", "name": "not_null_stg_iterable__event_event_id", "resource_type": "test", "package_name": "iterable", "path": "not_null_stg_iterable__event_event_id.sql", "original_file_path": "models/staging/stg_iterable.yml", "unique_id": "test.iterable.not_null_stg_iterable__event_event_id.370cd4bc9d", "fqn": ["iterable", "staging", "not_null_stg_iterable__event_event_id"], "alias": "not_null_stg_iterable__event_event_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "sql_header": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {}, "created_at": 1789419973.025781, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__event", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.iterable.stg_iterable__event"]}, "compiled_path": "target/compiled/iterable/models/staging/stg_iterable.yml/not_null_stg_iterable__event_event_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect event_id\nfrom \"postgres\".\"public_iterable_dev\".\"stg_iterable__event\"\nwhere event_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "event_id", "file_key_name": "models.stg_iterable__event", "attached_node": "model.iterable.stg_iterable__event", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "event_id", "model": "{{ get_where_subquery(ref('stg_iterable__event')) }}"}, "namespace": null}}, "test.iterable.not_null_stg_iterable__event_unique_event_id.e2b46d3bb6": {"database": "postgres", "schema": "public_dbt_test__audit", "name": "not_null_stg_iterable__event_unique_event_id", "resource_type": "test", "package_name": "iterable", "path": "not_null_stg_iterable__event_unique_event_id.sql", "original_file_path": "models/staging/stg_iterable.yml", "unique_id": "test.iterable.not_null_stg_iterable__event_unique_event_id.e2b46d3bb6", "fqn": ["iterable", "staging", "not_null_stg_iterable__event_unique_event_id"], "alias": "not_null_stg_iterable__event_unique_event_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "sql_header": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {}, "created_at": 1789419973.0284214, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__event", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.iterable.stg_iterable__event"]}, "compiled_path": "target/compiled/iterable/models/staging/stg_iterable.yml/not_null_stg_iterable__event_unique_event_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect unique_event_id\nfrom \"postgres\".\"public_iterable_dev\".\"stg_iterable__event\"\nwhere unique_event_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "unique_event_id", "file_key_name": "models.stg_iterable__event", "attached_node": "model.iterable.stg_iterable__event", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "unique_event_id", "model": "{{ get_where_subquery(ref('stg_iterable__event')) }}"}, "namespace": null}}, "test.iterable.not_null_stg_iterable__event_extension_event_id.144dedcd30": {"database": "postgres", "schema": "public_dbt_test__audit", "name": "not_null_stg_iterable__event_extension_event_id", "resource_type": "test", "package_name": "iterable", "path": "not_null_stg_iterable__event_extension_event_id.sql", "original_file_path": "models/staging/stg_iterable.yml", "unique_id": "test.iterable.not_null_stg_iterable__event_extension_event_id.144dedcd30", "fqn": ["iterable", "staging", "not_null_stg_iterable__event_extension_event_id"], "alias": "not_null_stg_iterable__event_extension_event_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "sql_header": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {}, "created_at": 1789419973.0311732, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__event_extension", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.iterable.stg_iterable__event_extension"]}, "compiled_path": "target/compiled/iterable/models/staging/stg_iterable.yml/not_null_stg_iterable__event_extension_event_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect event_id\nfrom \"postgres\".\"public_iterable_dev\".\"stg_iterable__event_extension\"\nwhere event_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "event_id", "file_key_name": "models.stg_iterable__event_extension", "attached_node": "model.iterable.stg_iterable__event_extension", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "event_id", "model": "{{ get_where_subquery(ref('stg_iterable__event_extension')) }}"}, "namespace": null}}, "test.iterable.not_null_stg_iterable__journey_journey_id.cc38bd633c": {"database": "postgres", "schema": "public_dbt_test__audit", "name": "not_null_stg_iterable__journey_journey_id", "resource_type": "test", "package_name": "iterable", "path": "not_null_stg_iterable__journey_journey_id.sql", "original_file_path": "models/staging/stg_iterable.yml", "unique_id": "test.iterable.not_null_stg_iterable__journey_journey_id.cc38bd633c", "fqn": ["iterable", "staging", "not_null_stg_iterable__journey_journey_id"], "alias": "not_null_stg_iterable__journey_journey_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "sql_header": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {}, "created_at": 1789419973.033802, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__journey", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.iterable.stg_iterable__journey"]}, "compiled_path": "target/compiled/iterable/models/staging/stg_iterable.yml/not_null_stg_iterable__journey_journey_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect journey_id\nfrom \"postgres\".\"public_iterable_dev\".\"stg_iterable__journey\"\nwhere journey_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "journey_id", "file_key_name": "models.stg_iterable__journey", "attached_node": "model.iterable.stg_iterable__journey", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "journey_id", "model": "{{ get_where_subquery(ref('stg_iterable__journey')) }}"}, "namespace": null}}, "test.iterable.not_null_stg_iterable__list_list_id.47029d839a": {"database": "postgres", "schema": "public_dbt_test__audit", "name": "not_null_stg_iterable__list_list_id", "resource_type": "test", "package_name": "iterable", "path": "not_null_stg_iterable__list_list_id.sql", "original_file_path": "models/staging/stg_iterable.yml", "unique_id": "test.iterable.not_null_stg_iterable__list_list_id.47029d839a", "fqn": ["iterable", "staging", "not_null_stg_iterable__list_list_id"], "alias": "not_null_stg_iterable__list_list_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "sql_header": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {}, "created_at": 1789419973.0363896, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__list", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.iterable.stg_iterable__list"]}, "compiled_path": "target/compiled/iterable/models/staging/stg_iterable.yml/not_null_stg_iterable__list_list_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect list_id\nfrom \"postgres\".\"public_iterable_dev\".\"stg_iterable__list\"\nwhere list_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "list_id", "file_key_name": "models.stg_iterable__list", "attached_node": "model.iterable.stg_iterable__list", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "list_id", "model": "{{ get_where_subquery(ref('stg_iterable__list')) }}"}, "namespace": null}}, "test.iterable.not_null_stg_iterable__message_type_message_type_id.75eaa6fa62": {"database": "postgres", "schema": "public_dbt_test__audit", "name": "not_null_stg_iterable__message_type_message_type_id", "resource_type": "test", "package_name": "iterable", "path": "not_null_stg_iterable__message_type_message_type_id.sql", "original_file_path": "models/staging/stg_iterable.yml", "unique_id": "test.iterable.not_null_stg_iterable__message_type_message_type_id.75eaa6fa62", "fqn": ["iterable", "staging", "not_null_stg_iterable__message_type_message_type_id"], "alias": "not_null_stg_iterable__message_type_message_type_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "sql_header": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {}, "created_at": 1789419973.039041, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__message_type", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.iterable.stg_iterable__message_type"]}, "compiled_path": "target/compiled/iterable/models/staging/stg_iterable.yml/not_null_stg_iterable__message_type_message_type_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect message_type_id\nfrom \"postgres\".\"public_iterable_dev\".\"stg_iterable__message_type\"\nwhere message_type_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "message_type_id", "file_key_name": "models.stg_iterable__message_type", "attached_node": "model.iterable.stg_iterable__message_type", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "message_type_id", "model": "{{ get_where_subquery(ref('stg_iterable__message_type')) }}"}, "namespace": null}}, "test.iterable.not_null_stg_iterable__template_history_template_id.14b24a1dfe": {"database": "postgres", "schema": "public_dbt_test__audit", "name": "not_null_stg_iterable__template_history_template_id", "resource_type": "test", "package_name": "iterable", "path": "not_null_stg_iterable__template_history_template_id.sql", "original_file_path": "models/staging/stg_iterable.yml", "unique_id": "test.iterable.not_null_stg_iterable__template_history_template_id.14b24a1dfe", "fqn": ["iterable", "staging", "not_null_stg_iterable__template_history_template_id"], "alias": "not_null_stg_iterable__template_history_template_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "sql_header": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {}, "created_at": 1789419973.0418298, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__template_history", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.iterable.stg_iterable__template_history"]}, "compiled_path": "target/compiled/iterable/models/staging/stg_iterable.yml/not_null_stg_iterable__template_history_template_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect template_id\nfrom \"postgres\".\"public_iterable_dev\".\"stg_iterable__template_history\"\nwhere template_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "template_id", "file_key_name": "models.stg_iterable__template_history", "attached_node": "model.iterable.stg_iterable__template_history", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "template_id", "model": "{{ get_where_subquery(ref('stg_iterable__template_history')) }}"}, "namespace": null}}, "test.iterable.not_null_stg_iterable__list_user__fivetran_user_id.cca4b34c07": {"database": "postgres", "schema": "public_dbt_test__audit", "name": "not_null_stg_iterable__list_user__fivetran_user_id", "resource_type": "test", "package_name": "iterable", "path": "not_null_stg_iterable__list_user__fivetran_user_id.sql", "original_file_path": "models/staging/stg_iterable.yml", "unique_id": "test.iterable.not_null_stg_iterable__list_user__fivetran_user_id.cca4b34c07", "fqn": ["iterable", "staging", "not_null_stg_iterable__list_user__fivetran_user_id"], "alias": "not_null_stg_iterable__list_user__fivetran_user_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "sql_header": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {}, "created_at": 1789419973.0444615, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__list_user", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.iterable.stg_iterable__list_user"]}, "compiled_path": "target/compiled/iterable/models/staging/stg_iterable.yml/not_null_stg_iterable__list_user__fivetran_user_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect _fivetran_user_id\nfrom \"postgres\".\"public_iterable_dev\".\"stg_iterable__list_user\"\nwhere _fivetran_user_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "_fivetran_user_id", "file_key_name": "models.stg_iterable__list_user", "attached_node": "model.iterable.stg_iterable__list_user", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "_fivetran_user_id", "model": "{{ get_where_subquery(ref('stg_iterable__list_user')) }}"}, "namespace": null}}, "test.iterable.not_null_stg_iterable__user_history_unique_user_key.2845af2127": {"database": "postgres", "schema": "public_dbt_test__audit", "name": "not_null_stg_iterable__user_history_unique_user_key", "resource_type": "test", "package_name": "iterable", "path": "not_null_stg_iterable__user_history_unique_user_key.sql", "original_file_path": "models/staging/stg_iterable.yml", "unique_id": "test.iterable.not_null_stg_iterable__user_history_unique_user_key.2845af2127", "fqn": ["iterable", "staging", "not_null_stg_iterable__user_history_unique_user_key"], "alias": "not_null_stg_iterable__user_history_unique_user_key", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "sql_header": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {}, "created_at": 1789419973.047116, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__user_history", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.iterable.stg_iterable__user_history"]}, "compiled_path": "target/compiled/iterable/models/staging/stg_iterable.yml/not_null_stg_iterable__user_history_unique_user_key.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect unique_user_key\nfrom \"postgres\".\"public_iterable_dev\".\"stg_iterable__user_history\"\nwhere unique_user_key is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "unique_user_key", "file_key_name": "models.stg_iterable__user_history", "attached_node": "model.iterable.stg_iterable__user_history", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "unique_user_key", "model": "{{ get_where_subquery(ref('stg_iterable__user_history')) }}"}, "namespace": null}}, "test.iterable.not_null_stg_iterable__user_unsubscribed_channel_channel_id.da0ed9e9be": {"database": "postgres", "schema": "public_dbt_test__audit", "name": "not_null_stg_iterable__user_unsubscribed_channel_channel_id", "resource_type": "test", "package_name": "iterable", "path": "not_null_stg_iterable__user_unsubscribed_channel_channel_id.sql", "original_file_path": "models/staging/stg_iterable.yml", "unique_id": "test.iterable.not_null_stg_iterable__user_unsubscribed_channel_channel_id.da0ed9e9be", "fqn": ["iterable", "staging", "not_null_stg_iterable__user_unsubscribed_channel_channel_id"], "alias": "not_null_stg_iterable__user_unsubscribed_channel_channel_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "sql_header": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {}, "created_at": 1789419973.0497231, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__user_unsubscribed_channel", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.iterable.stg_iterable__user_unsubscribed_channel"]}, "compiled_path": "target/compiled/iterable/models/staging/stg_iterable.yml/not_null_stg_iterable__user_unsubscribed_channel_channel_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect channel_id\nfrom \"postgres\".\"public_iterable_dev\".\"stg_iterable__user_unsubscribed_channel\"\nwhere channel_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "channel_id", "file_key_name": "models.stg_iterable__user_unsubscribed_channel", "attached_node": "model.iterable.stg_iterable__user_unsubscribed_channel", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "channel_id", "model": "{{ get_where_subquery(ref('stg_iterable__user_unsubscribed_channel')) }}"}, "namespace": null}}, "test.iterable.not_null_stg_iterable__user_unsub_message_type_message_type_id.268a89ea6f": {"database": "postgres", "schema": "public_dbt_test__audit", "name": "not_null_stg_iterable__user_unsub_message_type_message_type_id", "resource_type": "test", "package_name": "iterable", "path": "not_null_stg_iterable__user_unsub_message_type_message_type_id.sql", "original_file_path": "models/staging/stg_iterable.yml", "unique_id": "test.iterable.not_null_stg_iterable__user_unsub_message_type_message_type_id.268a89ea6f", "fqn": ["iterable", "staging", "not_null_stg_iterable__user_unsub_message_type_message_type_id"], "alias": "not_null_stg_iterable__user_unsub_message_type_message_type_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "sql_header": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {}, "created_at": 1789419973.0523486, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__user_unsub_message_type", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.iterable.stg_iterable__user_unsub_message_type"]}, "compiled_path": "target/compiled/iterable/models/staging/stg_iterable.yml/not_null_stg_iterable__user_unsub_message_type_message_type_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect message_type_id\nfrom \"postgres\".\"public_iterable_dev\".\"stg_iterable__user_unsub_message_type\"\nwhere message_type_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "message_type_id", "file_key_name": "models.stg_iterable__user_unsub_message_type", "attached_node": "model.iterable.stg_iterable__user_unsub_message_type", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "message_type_id", "model": "{{ get_where_subquery(ref('stg_iterable__user_unsub_message_type')) }}"}, "namespace": null}}}, "sources": {"source.iterable.iterable.campaign_history": {"database": "postgres", "schema": "public", "name": "campaign_history", "resource_type": "source", "package_name": "iterable", "path": "models/staging/src_iterable.yml", "original_file_path": "models/staging/src_iterable.yml", "unique_id": "source.iterable.iterable.campaign_history", "fqn": ["iterable", "staging", "iterable", "campaign_history"], "source_name": "iterable", "source_description": "", "loader": "fivetran", "identifier": "campaign_history_data", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Table containing a history of campaigns.", "columns": {"id": {"name": "id", "description": "Unique identifier of the campaign record", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "updated_at": {"name": "updated_at", "description": "Last update's timestamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "name": {"name": "name", "description": "User defined name of the campaign.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "campaign_state": {"name": "campaign_state", "description": "State of the campaign. Can be Draft, Ready, Scheduled, Running, Finished, Starting, Aborted or Recurring", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "type": {"name": "type", "description": "The campaign type. Can be Blast or Triggered", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "send_size": {"name": "send_size", "description": "Size of the campaign. Number of individuals included in the campaign", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "start_at": {"name": "start_at", "description": "Start timestamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "ended_at": {"name": "ended_at", "description": "Ended timestamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "created_at": {"name": "created_at", "description": "Creation timestamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "recurring_campaign_id": {"name": "recurring_campaign_id", "description": "Reference to the recurring campaign, if applicable", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "created_by_user_id": {"name": "created_by_user_id", "description": "Reference to the user who created the campaign", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "template_id": {"name": "template_id", "description": "Reference to the campaign template", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "updated_by_user_id": {"name": "updated_by_user_id", "description": "ID of the user who updated this record", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "message_medium": {"name": "message_medium", "description": "The medium that this message was sent via, for example Email or InApp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": "_fivetran_synced", "loaded_at_query": null, "meta": {}, "tags": [], "static_analysis": null}, "patch_path": null, "unrendered_config": {"loaded_at_field": "_fivetran_synced", "enabled": true, "loaded_at_query": null, "meta": {}, "tags": []}, "relation_name": "\"postgres\".\"public\".\"campaign_history_data\"", "created_at": 1789419973.2336032, "unrendered_database": "{% if target.type != 'spark' %}{{ var('iterable_database', target.database)}}{% endif %}", "unrendered_schema": "{{var ('iterable_schema', 'iterable')}}", "doc_blocks": []}, "source.iterable.iterable.campaign_label_history": {"database": "postgres", "schema": "public", "name": "campaign_label_history", "resource_type": "source", "package_name": "iterable", "path": "models/staging/src_iterable.yml", "original_file_path": "models/staging/src_iterable.yml", "unique_id": "source.iterable.iterable.campaign_label_history", "fqn": ["iterable", "staging", "iterable", "campaign_label_history"], "source_name": "iterable", "source_description": "", "loader": "fivetran", "identifier": "campaign_label_history_data", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Table containing a history of labels.", "columns": {"campaign_id": {"name": "campaign_id", "description": "Reference to the campaign associated with the label", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "label": {"name": "label", "description": "Name of the label", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "updated_at": {"name": "updated_at", "description": "Last update timestamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": "_fivetran_synced", "loaded_at_query": null, "meta": {}, "tags": [], "static_analysis": null}, "patch_path": null, "unrendered_config": {"loaded_at_field": "_fivetran_synced", "enabled": true, "loaded_at_query": null, "meta": {}, "tags": []}, "relation_name": "\"postgres\".\"public\".\"campaign_label_history_data\"", "created_at": 1789419973.2358623, "unrendered_database": "{% if target.type != 'spark' %}{{ var('iterable_database', target.database)}}{% endif %}", "unrendered_schema": "{{var ('iterable_schema', 'iterable')}}", "doc_blocks": []}, "source.iterable.iterable.campaign_list_history": {"database": "postgres", "schema": "public", "name": "campaign_list_history", "resource_type": "source", "package_name": "iterable", "path": "models/staging/src_iterable.yml", "original_file_path": "models/staging/src_iterable.yml", "unique_id": "source.iterable.iterable.campaign_list_history", "fqn": ["iterable", "staging", "iterable", "campaign_list_history"], "source_name": "iterable", "source_description": "", "loader": "fivetran", "identifier": "campaign_list_history_data", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Table containing a history of lists.", "columns": {"campaign_id": {"name": "campaign_id", "description": "Reference to the campaign associated with the label", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "list_id": {"name": "list_id", "description": "Reference to the list used", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "updated_at": {"name": "updated_at", "description": "Last update timestamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": "_fivetran_synced", "loaded_at_query": null, "meta": {}, "tags": [], "static_analysis": null}, "patch_path": null, "unrendered_config": {"loaded_at_field": "_fivetran_synced", "enabled": true, "loaded_at_query": null, "meta": {}, "tags": []}, "relation_name": "\"postgres\".\"public\".\"campaign_list_history_data\"", "created_at": 1789419973.236487, "unrendered_database": "{% if target.type != 'spark' %}{{ var('iterable_database', target.database)}}{% endif %}", "unrendered_schema": "{{var ('iterable_schema', 'iterable')}}", "doc_blocks": []}, "source.iterable.iterable.campaign_suppression_list_history": {"database": "postgres", "schema": "public", "name": "campaign_suppression_list_history", "resource_type": "source", "package_name": "iterable", "path": "models/staging/src_iterable.yml", "original_file_path": "models/staging/src_iterable.yml", "unique_id": "source.iterable.iterable.campaign_suppression_list_history", "fqn": ["iterable", "staging", "iterable", "campaign_suppression_list_history"], "source_name": "iterable", "source_description": "", "loader": "fivetran", "identifier": "campaign_suppression_list_history_data", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Table containing a history of suppression lists.\n", "columns": {"campaign_id": {"name": "campaign_id", "description": "Reference to the campaign associated with the label", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "suppressed_list_id": {"name": "suppressed_list_id", "description": "Reference to the list used", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "updated_at": {"name": "updated_at", "description": "Last update timestamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": "_fivetran_synced", "loaded_at_query": null, "meta": {}, "tags": [], "static_analysis": null}, "patch_path": null, "unrendered_config": {"loaded_at_field": "_fivetran_synced", "enabled": true, "loaded_at_query": null, "meta": {}, "tags": []}, "relation_name": "\"postgres\".\"public\".\"campaign_suppression_list_history_data\"", "created_at": 1789419973.237084, "unrendered_database": "{% if target.type != 'spark' %}{{ var('iterable_database', target.database)}}{% endif %}", "unrendered_schema": "{{var ('iterable_schema', 'iterable')}}", "doc_blocks": []}, "source.iterable.iterable.channel": {"database": "postgres", "schema": "public", "name": "channel", "resource_type": "source", "package_name": "iterable", "path": "models/staging/src_iterable.yml", "original_file_path": "models/staging/src_iterable.yml", "unique_id": "source.iterable.iterable.channel", "fqn": ["iterable", "staging", "iterable", "channel"], "source_name": "iterable", "source_description": "", "loader": "fivetran", "identifier": "channel_data", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Table containing unique channels.", "columns": {"id": {"name": "id", "description": "Unique identifier of the channel", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "name": {"name": "name", "description": "User defined name of the channel", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "channel_type": {"name": "channel_type", "description": "The channel type", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "message_medium": {"name": "message_medium", "description": "The message medium associated with the channel", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": "_fivetran_synced", "loaded_at_query": null, "meta": {}, "tags": [], "static_analysis": null}, "patch_path": null, "unrendered_config": {"loaded_at_field": "_fivetran_synced", "enabled": true, "loaded_at_query": null, "meta": {}, "tags": []}, "relation_name": "\"postgres\".\"public\".\"channel_data\"", "created_at": 1789419973.2379124, "unrendered_database": "{% if target.type != 'spark' %}{{ var('iterable_database', target.database)}}{% endif %}", "unrendered_schema": "{{var ('iterable_schema', 'iterable')}}", "doc_blocks": []}, "source.iterable.iterable.event": {"database": "postgres", "schema": "public", "name": "event", "resource_type": "source", "package_name": "iterable", "path": "models/staging/src_iterable.yml", "original_file_path": "models/staging/src_iterable.yml", "unique_id": "source.iterable.iterable.event", "fqn": ["iterable", "staging", "iterable", "event"], "source_name": "iterable", "source_description": "", "loader": "fivetran", "identifier": "event_data", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Table containing individual events within campaigns.", "columns": {"_fivetran_id": {"name": "_fivetran_id", "description": "A Fivetran-created unique identifier derived from hashing campaign_id, created_at, and event_name.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "campaign_id": {"name": "campaign_id", "description": "Reference to the campaign from which the event originated", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "content_id": {"name": "content_id", "description": "Reference to the content the event is associated with.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "created_at": {"name": "created_at", "description": "Creation timestamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "email": {"name": "email", "description": "The user's email. User identifier, for email-based projects. Previously was the unique identifier for user records, for Iterable customers before August 2023. Exists if using the history version of the table.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "additional_properties": {"name": "additional_properties", "description": "json object containing addition event properties", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "event_name": {"name": "event_name", "description": "Name provided to the individual event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "message_bus_id": {"name": "message_bus_id", "description": "Reference to the message bus associated with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "message_id": {"name": "message_id", "description": "Reference to the message the event is associated with", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "message_type_id": {"name": "message_type_id", "description": "Reference to the type of message the event is associated with", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "recipient_state": {"name": "recipient_state", "description": "The state of the recipient upon receiving the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "status": {"name": "status", "description": "Status of the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "transactional_data": {"name": "transactional_data", "description": "Transactional data associated with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unsub_source": {"name": "unsub_source", "description": "Source of the unsubscribe event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "user_agent": {"name": "user_agent", "description": "User agent associated with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "user_agent_device": {"name": "user_agent_device", "description": "The device of the user agent", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "_fivetran_user_id": {"name": "_fivetran_user_id", "description": "A Fivetran-created unique identifier for users, derived from hashing user_id and/or email, depending on project type.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": "_fivetran_synced", "loaded_at_query": null, "meta": {}, "tags": [], "static_analysis": null}, "patch_path": null, "unrendered_config": {"loaded_at_field": "_fivetran_synced", "enabled": true, "loaded_at_query": null, "meta": {}, "tags": []}, "relation_name": "\"postgres\".\"public\".\"event_data\"", "created_at": 1789419973.2385807, "unrendered_database": "{% if target.type != 'spark' %}{{ var('iterable_database', target.database)}}{% endif %}", "unrendered_schema": "{{var ('iterable_schema', 'iterable')}}", "doc_blocks": []}, "source.iterable.iterable.event_extension": {"database": "postgres", "schema": "public", "name": "event_extension", "resource_type": "source", "package_name": "iterable", "path": "models/staging/src_iterable.yml", "original_file_path": "models/staging/src_iterable.yml", "unique_id": "source.iterable.iterable.event_extension", "fqn": ["iterable", "staging", "iterable", "event_extension"], "source_name": "iterable", "source_description": "", "loader": "fivetran", "identifier": "event_extension_data", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Table containing additional properties from the event table.", "columns": {"_fivetran_id": {"name": "_fivetran_id", "description": "A Fivetran-created unique identifier derived from hashing campaign_id, created_at, and event_name.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "app_already_running": {"name": "app_already_running", "description": "Boolean indicating if the app is currently running or not", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "badge": {"name": "badge", "description": "Badge associated with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "canonical_url_id": {"name": "canonical_url_id", "description": "Reference to the url associated with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "content_available": {"name": "content_available", "description": "Content available from the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "content_id": {"name": "content_id", "description": "Reference to the content associated with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "deeplink_android": {"name": "deeplink_android", "description": "Deeplink associated with the event from an android device", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "deeplink_ios": {"name": "deeplink_ios", "description": "Deeplink associated with the event from an ios device", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "device": {"name": "device", "description": "The device associated with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "email_id": {"name": "email_id", "description": "Reference to the email associated with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "email_subject": {"name": "email_subject", "description": "Subject of the email associated with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "experiment_id": {"name": "experiment_id", "description": "Reference to the experiment used if the event is an experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "from_phone_number_id": {"name": "from_phone_number_id", "description": "Reference to the phone number which the event is from", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "from_smssender_id": {"name": "from_smssender_id", "description": "Reference to the sms sender which the event is from", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "image_url": {"name": "image_url", "description": "Image url of the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "is_ghost_push": {"name": "is_ghost_push", "description": "Boolean indicating if the event is a result of a ghost push", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "link_id": {"name": "link_id", "description": "Reference to the link associated with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "link_url": {"name": "link_url", "description": "Url of the link associated with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "locale": {"name": "locale", "description": "Locale associated with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "payload": {"name": "payload", "description": "Payload resulted from the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "platform_endpoint": {"name": "platform_endpoint", "description": "The specific platform endpoint of the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "push_message": {"name": "push_message", "description": "Boolean indicating if the event is a push message", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "region": {"name": "region", "description": "Region of the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "sms_message": {"name": "sms_message", "description": "Boolean indicating if the event is an sms message", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "sms_provider_response_code": {"name": "sms_provider_response_code", "description": "sms provider response code from the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "sms_provider_response_message": {"name": "sms_provider_response_message", "description": "sms provider response message from the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "sms_provider_response_more_info": {"name": "sms_provider_response_more_info", "description": "sms provider response addition info from the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "sms_provider_response_status": {"name": "sms_provider_response_status", "description": "Status of the sms provider response from the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "sound": {"name": "sound", "description": "Boolean indicating if a sound was used with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "to_phone_number": {"name": "to_phone_number", "description": "To phone number associated with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "url": {"name": "url", "description": "Url associated with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "workflow_id": {"name": "workflow_id", "description": "Reference to the workflow which the event originated", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "workflow_name": {"name": "workflow_name", "description": "Name of the workflow which the event originated", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "catalog_collection_count": {"name": "catalog_collection_count", "description": "The count of products or items collected in a catalog associated with the event.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "catalog_lookup_count": {"name": "catalog_lookup_count", "description": "The count of times a catalog was looked up or queried during the event.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "city": {"name": "city", "description": "The city associated with the event, which could be the location of the recipient.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "clicked_url": {"name": "clicked_url", "description": "The URL that was clicked by the recipient in response to the marketing message.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "country": {"name": "country", "description": "The country associated with the event, which could be the location of the recipient.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "error_code": {"name": "error_code", "description": "The error code or message indicating any issues or errors encountered during the event.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "expires_at": {"name": "expires_at", "description": "The date and time when the event or message is set to expire or become invalid.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "from_phone_number": {"name": "from_phone_number", "description": "The phone number from which the SMS message was sent.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "in_app_body": {"name": "in_app_body", "description": "The content or body of an in-app message that was sent as part of the event.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "is_sms_estimation": {"name": "is_sms_estimation", "description": "A boolean indicating whether the SMS message is an estimation or not.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "labels": {"name": "labels", "description": "Any labels or tags associated with the event, which can be used for categorization or organization.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "message_context": {"name": "message_context", "description": "Additional contextual information related to the marketing message or event.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "message_status": {"name": "message_status", "description": "The status of the marketing message, such as sent, delivered, opened, etc.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "mms_send_count": {"name": "mms_send_count", "description": "The count of multimedia messages (MMS) sent as part of the event.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "product_recommendation_count": {"name": "product_recommendation_count", "description": "The count of product recommendations included in the message.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "proxy_source": {"name": "proxy_source", "description": "Information about the source or proxy used for sending the message.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "reason": {"name": "reason", "description": "The reason or cause associated with a specific event or action.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "sms_send_count": {"name": "sms_send_count", "description": "The count of SMS messages sent as part of the event.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "web_push_body": {"name": "web_push_body", "description": "The content or body of a web push notification sent as part of the event.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "web_push_click_action": {"name": "web_push_click_action", "description": "The action triggered when a recipient clicks a web push notification.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "web_push_icon": {"name": "web_push_icon", "description": "The icon or image associated with the web push notification.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "web_push_message": {"name": "web_push_message", "description": "The message or notification sent to web users as part of the event.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": "_fivetran_synced", "loaded_at_query": null, "meta": {}, "tags": [], "static_analysis": null}, "patch_path": null, "unrendered_config": {"loaded_at_field": "_fivetran_synced", "enabled": true, "loaded_at_query": null, "meta": {}, "tags": []}, "relation_name": "\"postgres\".\"public\".\"event_extension_data\"", "created_at": 1789419973.2395086, "unrendered_database": "{% if target.type != 'spark' %}{{ var('iterable_database', target.database)}}{% endif %}", "unrendered_schema": "{{var ('iterable_schema', 'iterable')}}", "doc_blocks": []}, "source.iterable.iterable.journey": {"database": "postgres", "schema": "public", "name": "journey", "resource_type": "source", "package_name": "iterable", "path": "models/staging/src_iterable.yml", "original_file_path": "models/staging/src_iterable.yml", "unique_id": "source.iterable.iterable.journey", "fqn": ["iterable", "staging", "iterable", "journey"], "source_name": "iterable", "source_description": "", "loader": "fivetran", "identifier": "journey_data", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Table containing unique journeys, formerly known as workflows.", "columns": {"id": {"name": "id", "description": "Unique identifier of the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "name": {"name": "name", "description": "User defined name of the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "journey_type": {"name": "journey_type", "description": "The journey type", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "description": {"name": "description", "description": "Information about the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "creator_user_id": {"name": "creator_user_id", "description": "Reference to the user who created the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "enabled": {"name": "enabled", "description": "Boolean indicating if the journey is currently enabled", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "is_archived": {"name": "is_archived", "description": "Boolean indicating if the journey has been archived", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "lifetime_limit": {"name": "lifetime_limit", "description": "Maximum number of times a user may enter the journey over their lifetime", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "simultaneous_limit": {"name": "simultaneous_limit", "description": "Maximum number of times a user may be in the journey at the same time", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "start_tile_id": {"name": "start_tile_id", "description": "Reference to the tile which begins the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "trigger_event_names": {"name": "trigger_event_names", "description": "The event names which trigger a user's entry into the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "created_at": {"name": "created_at", "description": "Creation timestamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "updated_at": {"name": "updated_at", "description": "Last update timestamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": "_fivetran_synced", "loaded_at_query": null, "meta": {}, "tags": [], "static_analysis": null}, "patch_path": null, "unrendered_config": {"loaded_at_field": "_fivetran_synced", "enabled": true, "loaded_at_query": null, "meta": {}, "tags": []}, "relation_name": "\"postgres\".\"public\".\"journey_data\"", "created_at": 1789419973.2401497, "unrendered_database": "{% if target.type != 'spark' %}{{ var('iterable_database', target.database)}}{% endif %}", "unrendered_schema": "{{var ('iterable_schema', 'iterable')}}", "doc_blocks": []}, "source.iterable.iterable.list": {"database": "postgres", "schema": "public", "name": "list", "resource_type": "source", "package_name": "iterable", "path": "models/staging/src_iterable.yml", "original_file_path": "models/staging/src_iterable.yml", "unique_id": "source.iterable.iterable.list", "fqn": ["iterable", "staging", "iterable", "list"], "source_name": "iterable", "source_description": "", "loader": "fivetran", "identifier": "list_data", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Table containing users and the lists the users are associated with.", "columns": {"id": {"name": "id", "description": "Unique identifier of the list", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "name": {"name": "name", "description": "User defined name of the list", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "list_type": {"name": "list_type", "description": "The list type", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "created_at": {"name": "created_at", "description": "Creation timestamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "description": {"name": "description", "description": "Information about the list", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": "_fivetran_synced", "loaded_at_query": null, "meta": {}, "tags": [], "static_analysis": null}, "patch_path": null, "unrendered_config": {"loaded_at_field": "_fivetran_synced", "enabled": true, "loaded_at_query": null, "meta": {}, "tags": []}, "relation_name": "\"postgres\".\"public\".\"list_data\"", "created_at": 1789419973.240721, "unrendered_database": "{% if target.type != 'spark' %}{{ var('iterable_database', target.database)}}{% endif %}", "unrendered_schema": "{{var ('iterable_schema', 'iterable')}}", "doc_blocks": []}, "source.iterable.iterable.message_type": {"database": "postgres", "schema": "public", "name": "message_type", "resource_type": "source", "package_name": "iterable", "path": "models/staging/src_iterable.yml", "original_file_path": "models/staging/src_iterable.yml", "unique_id": "source.iterable.iterable.message_type", "fqn": ["iterable", "staging", "iterable", "message_type"], "source_name": "iterable", "source_description": "", "loader": "fivetran", "identifier": "message_type_data", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Table containing unique message types.", "columns": {"id": {"name": "id", "description": "Unique identifier of the message type", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "name": {"name": "name", "description": "User defined name of the message type", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "channel_id": {"name": "channel_id", "description": "Channel that this message type belongs to", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "created_at": {"name": "created_at", "description": "Time when the message type was initially created", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "frequency_cap": {"name": "frequency_cap", "description": "The maximum number of times a message of this type can be sent to a recipient within a specified time period to prevent over-messaging", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "rate_limit_per_minute": {"name": "rate_limit_per_minute", "description": "The maximum number of messages of this type that can be sent to recipients in a minute, ensuring controlled message delivery", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "subscription_policy": {"name": "subscription_policy", "description": "Information about the policy or rules governing how users can subscribe to or unsubscribe from this specific message type, like OptOut", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "updated_at": {"name": "updated_at", "description": "Time when the message type was last updated or modified", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": "_fivetran_synced", "loaded_at_query": null, "meta": {}, "tags": [], "static_analysis": null}, "patch_path": null, "unrendered_config": {"loaded_at_field": "_fivetran_synced", "enabled": true, "loaded_at_query": null, "meta": {}, "tags": []}, "relation_name": "\"postgres\".\"public\".\"message_type_data\"", "created_at": 1789419973.241323, "unrendered_database": "{% if target.type != 'spark' %}{{ var('iterable_database', target.database)}}{% endif %}", "unrendered_schema": "{{var ('iterable_schema', 'iterable')}}", "doc_blocks": []}, "source.iterable.iterable.template_history": {"database": "postgres", "schema": "public", "name": "template_history", "resource_type": "source", "package_name": "iterable", "path": "models/staging/src_iterable.yml", "original_file_path": "models/staging/src_iterable.yml", "unique_id": "source.iterable.iterable.template_history", "fqn": ["iterable", "staging", "iterable", "template_history"], "source_name": "iterable", "source_description": "", "loader": "fivetran", "identifier": "template_history_data", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Table containing unique templates used across campaigns.", "columns": {"id": {"name": "id", "description": "Unique identifier of the template", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "name": {"name": "name", "description": "User defined name of the template", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "template_type": {"name": "template_type", "description": "The type of the template", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "created_at": {"name": "created_at", "description": "Creation timestamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "client_template_id": {"name": "client_template_id", "description": "Reference to the client template", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "creator_user_id": {"name": "creator_user_id", "description": "Reference to the user who created the template", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "message_type_id": {"name": "message_type_id", "description": "Reference to the message type associated with the template", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "updated_at": {"name": "updated_at", "description": "Last update timestamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": "_fivetran_synced", "loaded_at_query": null, "meta": {}, "tags": [], "static_analysis": null}, "patch_path": null, "unrendered_config": {"loaded_at_field": "_fivetran_synced", "enabled": true, "loaded_at_query": null, "meta": {}, "tags": []}, "relation_name": "\"postgres\".\"public\".\"template_history_data\"", "created_at": 1789419973.2419236, "unrendered_database": "{% if target.type != 'spark' %}{{ var('iterable_database', target.database)}}{% endif %}", "unrendered_schema": "{{var ('iterable_schema', 'iterable')}}", "doc_blocks": []}, "source.iterable.iterable.user_history": {"database": "postgres", "schema": "public", "name": "user_history", "resource_type": "source", "package_name": "iterable", "path": "models/staging/src_iterable.yml", "original_file_path": "models/staging/src_iterable.yml", "unique_id": "source.iterable.iterable.user_history", "fqn": ["iterable", "staging", "iterable", "user_history"], "source_name": "iterable", "source_description": "", "loader": "fivetran", "identifier": "user_history_data", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Table containing individual user history information.", "columns": {"email": {"name": "email", "description": "The user's email. Previously was the unique identifier for the user records, for Iterable customers before August 2023. This has since been replaced by iterable_user_id.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "user_id": {"name": "user_id", "description": "User defined identifier of the user. This is not a unique field", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "iterable_user_id": {"name": "iterable_user_id", "description": "The unique identifier of the user", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "first_name": {"name": "first_name", "description": "First name of the user", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "last_name": {"name": "last_name", "description": "Last name of the user", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "email_list_ids": {"name": "email_list_ids", "description": "[DEPRECATED October 13, 2025 Use LIST_USER source instead.] Array of references to the lists associated with the user\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "signup_date": {"name": "signup_date", "description": "Timestamp of when the user signed up", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "signup_source": {"name": "signup_source", "description": "Source where the user signed up", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "updated_at": {"name": "updated_at", "description": "Last update timestamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": "_fivetran_synced", "loaded_at_query": null, "meta": {}, "tags": [], "static_analysis": null}, "patch_path": null, "unrendered_config": {"loaded_at_field": "_fivetran_synced", "enabled": true, "loaded_at_query": null, "meta": {}, "tags": []}, "relation_name": "\"postgres\".\"public\".\"user_history_data\"", "created_at": 1789419973.242516, "unrendered_database": "{% if target.type != 'spark' %}{{ var('iterable_database', target.database)}}{% endif %}", "unrendered_schema": "{{var ('iterable_schema', 'iterable')}}", "doc_blocks": []}, "source.iterable.iterable.user_unsubscribed_channel": {"database": "postgres", "schema": "public", "name": "user_unsubscribed_channel", "resource_type": "source", "package_name": "iterable", "path": "models/staging/src_iterable.yml", "original_file_path": "models/staging/src_iterable.yml", "unique_id": "source.iterable.iterable.user_unsubscribed_channel", "fqn": ["iterable", "staging", "iterable", "user_unsubscribed_channel"], "source_name": "iterable", "source_description": "", "loader": "fivetran", "identifier": "user_unsubscribed_channel_data", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Table containing the channels from which a user has unsubscribed.", "columns": {"_fivetran_id": {"name": "_fivetran_id", "description": "A Fivetran-created unique identifier for users, derived from hashing user_id and/or email, depending on project type.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "channel_id": {"name": "channel_id", "description": "Reference to the channel from which the user unsubscribed", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": "_fivetran_synced", "loaded_at_query": null, "meta": {}, "tags": [], "static_analysis": null}, "patch_path": null, "unrendered_config": {"loaded_at_field": "_fivetran_synced", "enabled": true, "loaded_at_query": null, "meta": {}, "tags": []}, "relation_name": "\"postgres\".\"public\".\"user_unsubscribed_channel_data\"", "created_at": 1789419973.2430851, "unrendered_database": "{% if target.type != 'spark' %}{{ var('iterable_database', target.database)}}{% endif %}", "unrendered_schema": "{{var ('iterable_schema', 'iterable')}}", "doc_blocks": []}, "source.iterable.iterable.user_unsubscribed_message_type": {"database": "postgres", "schema": "public", "name": "user_unsubscribed_message_type", "resource_type": "source", "package_name": "iterable", "path": "models/staging/src_iterable.yml", "original_file_path": "models/staging/src_iterable.yml", "unique_id": "source.iterable.iterable.user_unsubscribed_message_type", "fqn": ["iterable", "staging", "iterable", "user_unsubscribed_message_type"], "source_name": "iterable", "source_description": "", "loader": "fivetran", "identifier": "user_unsubscribed_message_type_data", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Table containing the message types from which a user has unsubscribed.", "columns": {"_fivetran_id": {"name": "_fivetran_id", "description": "A Fivetran-created unique identifier for users, derived from hashing user_id and/or email, depending on project type.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "message_type_id": {"name": "message_type_id", "description": "Reference to the message type from which the user unsubscribed", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": "_fivetran_synced", "loaded_at_query": null, "meta": {}, "tags": [], "static_analysis": null}, "patch_path": null, "unrendered_config": {"loaded_at_field": "_fivetran_synced", "enabled": true, "loaded_at_query": null, "meta": {}, "tags": []}, "relation_name": "\"postgres\".\"public\".\"user_unsubscribed_message_type_data\"", "created_at": 1789419973.243675, "unrendered_database": "{% if target.type != 'spark' %}{{ var('iterable_database', target.database)}}{% endif %}", "unrendered_schema": "{{var ('iterable_schema', 'iterable')}}", "doc_blocks": []}, "source.iterable.iterable.user_unsubscribed_channel_history": {"database": "postgres", "schema": "public", "name": "user_unsubscribed_channel_history", "resource_type": "source", "package_name": "iterable", "path": "models/staging/src_iterable.yml", "original_file_path": "models/staging/src_iterable.yml", "unique_id": "source.iterable.iterable.user_unsubscribed_channel_history", "fqn": ["iterable", "staging", "iterable", "user_unsubscribed_channel_history"], "source_name": "iterable", "source_description": "", "loader": "fivetran", "identifier": "user_unsubscribed_channel_history_data", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Table containing the history of channels from which a user has unsubscribed.", "columns": {"channel_id": {"name": "channel_id", "description": "Reference to the channel from which the user unsubscribed", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "email": {"name": "email", "description": "Unique identifier of the user", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "updated_at": {"name": "updated_at", "description": "Last update timestamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": "_fivetran_synced", "loaded_at_query": null, "meta": {}, "tags": [], "static_analysis": null}, "patch_path": null, "unrendered_config": {"loaded_at_field": "_fivetran_synced", "enabled": true, "loaded_at_query": null, "meta": {}, "tags": []}, "relation_name": "\"postgres\".\"public\".\"user_unsubscribed_channel_history_data\"", "created_at": 1789419973.24428, "unrendered_database": "{% if target.type != 'spark' %}{{ var('iterable_database', target.database)}}{% endif %}", "unrendered_schema": "{{var ('iterable_schema', 'iterable')}}", "doc_blocks": []}, "source.iterable.iterable.user_unsubscribed_message_type_history": {"database": "postgres", "schema": "public", "name": "user_unsubscribed_message_type_history", "resource_type": "source", "package_name": "iterable", "path": "models/staging/src_iterable.yml", "original_file_path": "models/staging/src_iterable.yml", "unique_id": "source.iterable.iterable.user_unsubscribed_message_type_history", "fqn": ["iterable", "staging", "iterable", "user_unsubscribed_message_type_history"], "source_name": "iterable", "source_description": "", "loader": "fivetran", "identifier": "user_unsubscribed_message_type_history_data", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Table containing the history of message types from which a user has unsubscribed.", "columns": {"message_type_id": {"name": "message_type_id", "description": "Reference to the message type from which the user unsubscribed", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "email": {"name": "email", "description": "Unique identifier of the user", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "updated_at": {"name": "updated_at", "description": "Last update timestamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": "_fivetran_synced", "loaded_at_query": null, "meta": {}, "tags": [], "static_analysis": null}, "patch_path": null, "unrendered_config": {"loaded_at_field": "_fivetran_synced", "enabled": true, "loaded_at_query": null, "meta": {}, "tags": []}, "relation_name": "\"postgres\".\"public\".\"user_unsubscribed_message_type_history_data\"", "created_at": 1789419973.2448606, "unrendered_database": "{% if target.type != 'spark' %}{{ var('iterable_database', target.database)}}{% endif %}", "unrendered_schema": "{{var ('iterable_schema', 'iterable')}}", "doc_blocks": []}, "source.iterable.iterable.list_user": {"database": "postgres", "schema": "public", "name": "list_user", "resource_type": "source", "package_name": "iterable", "path": "models/staging/src_iterable.yml", "original_file_path": "models/staging/src_iterable.yml", "unique_id": "source.iterable.iterable.list_user", "fqn": ["iterable", "staging", "iterable", "list_user"], "source_name": "iterable", "source_description": "", "loader": "fivetran", "identifier": "list_user_data", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Table containing the relationship between users and lists they belong to.", "columns": {"_fivetran_id": {"name": "_fivetran_id", "description": "Unique identifier of the list-user relationship record, serving as a foreign key to `user_history._fivetran_id`.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "index": {"name": "index", "description": "Index of the record", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "list_id": {"name": "list_id", "description": "Reference to the list that the user belongs to", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "Timestamp when the record was last synced by Fivetran", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": "_fivetran_synced", "loaded_at_query": null, "meta": {}, "tags": [], "static_analysis": null}, "patch_path": null, "unrendered_config": {"loaded_at_field": "_fivetran_synced", "enabled": true, "loaded_at_query": null, "meta": {}, "tags": []}, "relation_name": "\"postgres\".\"public\".\"list_user_data\"", "created_at": 1789419973.2454312, "unrendered_database": "{% if target.type != 'spark' %}{{ var('iterable_database', target.database)}}{% endif %}", "unrendered_schema": "{{var ('iterable_schema', 'iterable')}}", "doc_blocks": []}}, "macros": {"macro.dbt_postgres.postgres__current_timestamp": {"name": "postgres__current_timestamp", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/timestamps.sql", "original_file_path": "macros/timestamps.sql", "unique_id": "macro.dbt_postgres.postgres__current_timestamp", "macro_sql": "{% macro postgres__current_timestamp() -%}\n now()\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789419969.6603098, "supported_languages": null}, "macro.dbt_postgres.postgres__snapshot_string_as_time": {"name": "postgres__snapshot_string_as_time", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/timestamps.sql", "original_file_path": "macros/timestamps.sql", "unique_id": "macro.dbt_postgres.postgres__snapshot_string_as_time", "macro_sql": "{% macro postgres__snapshot_string_as_time(timestamp) -%}\n {%- set result = \"'\" ~ timestamp ~ \"'::timestamp without time zone\" -%}\n {{ return(result) }}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "timestamp", "type": null, "description": ""}], "created_at": 1789419969.6607194, "supported_languages": null}, "macro.dbt_postgres.postgres__snapshot_get_time": {"name": "postgres__snapshot_get_time", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/timestamps.sql", "original_file_path": "macros/timestamps.sql", "unique_id": "macro.dbt_postgres.postgres__snapshot_get_time", "macro_sql": "{% macro postgres__snapshot_get_time() -%}\n {{ current_timestamp() }}::timestamp without time zone\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.current_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789419969.660946, "supported_languages": null}, "macro.dbt_postgres.postgres__current_timestamp_backcompat": {"name": "postgres__current_timestamp_backcompat", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/timestamps.sql", "original_file_path": "macros/timestamps.sql", "unique_id": "macro.dbt_postgres.postgres__current_timestamp_backcompat", "macro_sql": "{% macro postgres__current_timestamp_backcompat() %}\n current_timestamp::{{ type_timestamp() }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.type_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789419969.6611397, "supported_languages": null}, "macro.dbt_postgres.postgres__current_timestamp_in_utc_backcompat": {"name": "postgres__current_timestamp_in_utc_backcompat", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/timestamps.sql", "original_file_path": "macros/timestamps.sql", "unique_id": "macro.dbt_postgres.postgres__current_timestamp_in_utc_backcompat", "macro_sql": "{% macro postgres__current_timestamp_in_utc_backcompat() %}\n (current_timestamp at time zone 'utc')::{{ type_timestamp() }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.type_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789419969.661326, "supported_languages": null}, "macro.dbt_postgres.postgres__get_catalog_relations": {"name": "postgres__get_catalog_relations", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/catalog.sql", "original_file_path": "macros/catalog.sql", "unique_id": "macro.dbt_postgres.postgres__get_catalog_relations", "macro_sql": "{% macro postgres__get_catalog_relations(information_schema, relations) -%}\n {%- call statement('catalog', fetch_result=True) -%}\n\n {#\n If the user has multiple databases set and the first one is wrong, this will fail.\n But we won't fail in the case where there are multiple quoting-difference-only dbs, which is better.\n #}\n {% set database = information_schema.database %}\n {{ adapter.verify_database(database) }}\n\n select\n '{{ database }}' as table_database,\n sch.nspname as table_schema,\n tbl.relname as table_name,\n case tbl.relkind\n when 'v' then 'VIEW'\n when 'm' then 'MATERIALIZED VIEW'\n else 'BASE TABLE'\n end as table_type,\n tbl_desc.description as table_comment,\n col.attname as column_name,\n col.attnum as column_index,\n pg_catalog.format_type(col.atttypid, col.atttypmod) as column_type,\n col_desc.description as column_comment,\n pg_get_userbyid(tbl.relowner) as table_owner\n\n from pg_catalog.pg_namespace sch\n join pg_catalog.pg_class tbl on tbl.relnamespace = sch.oid\n join pg_catalog.pg_attribute col on col.attrelid = tbl.oid\n left outer join pg_catalog.pg_description tbl_desc on (tbl_desc.objoid = tbl.oid and tbl_desc.objsubid = 0)\n left outer join pg_catalog.pg_description col_desc on (col_desc.objoid = tbl.oid and col_desc.objsubid = col.attnum)\n where (\n {%- for relation in relations -%}\n {%- if relation.identifier -%}\n (upper(sch.nspname) = upper('{{ relation.schema }}') and\n upper(tbl.relname) = upper('{{ relation.identifier }}'))\n {%- else-%}\n upper(sch.nspname) = upper('{{ relation.schema }}')\n {%- endif -%}\n {%- if not loop.last %} or {% endif -%}\n {%- endfor -%}\n )\n and not pg_is_other_temp_schema(sch.oid) -- not a temporary schema belonging to another session\n and tbl.relpersistence in ('p', 'u') -- [p]ermanent table or [u]nlogged table. Exclude [t]emporary tables\n and tbl.relkind in ('r', 'v', 'f', 'p', 'm') -- o[r]dinary table, [v]iew, [f]oreign table, [p]artitioned table, [m]aterialized view. Other values are [i]ndex, [S]equence, [c]omposite type, [t]OAST table\n and col.attnum > 0 -- negative numbers are used for system columns such as oid\n and not col.attisdropped -- column as not been dropped\n\n order by\n sch.nspname,\n tbl.relname,\n col.attnum\n\n {%- endcall -%}\n\n {{ return(load_result('catalog').table) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "information_schema", "type": null, "description": ""}, {"name": "relations", "type": null, "description": ""}], "created_at": 1789419969.6632376, "supported_languages": null}, "macro.dbt_postgres.postgres__get_catalog": {"name": "postgres__get_catalog", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/catalog.sql", "original_file_path": "macros/catalog.sql", "unique_id": "macro.dbt_postgres.postgres__get_catalog", "macro_sql": "{% macro postgres__get_catalog(information_schema, schemas) -%}\n {%- set relations = [] -%}\n {%- for schema in schemas -%}\n {%- set dummy = relations.append({'schema': schema}) -%}\n {%- endfor -%}\n {{ return(postgres__get_catalog_relations(information_schema, relations)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__get_catalog_relations"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "information_schema", "type": null, "description": ""}, {"name": "schemas", "type": null, "description": ""}], "created_at": 1789419969.663897, "supported_languages": null}, "macro.dbt_postgres.postgres__get_relations": {"name": "postgres__get_relations", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/relations.sql", "original_file_path": "macros/relations.sql", "unique_id": "macro.dbt_postgres.postgres__get_relations", "macro_sql": "{% macro postgres__get_relations() -%}\n\n {#\n -- in pg_depend, objid is the dependent, refobjid is the referenced object\n -- > a pg_depend entry indicates that the referenced object cannot be\n -- > dropped without also dropping the dependent object.\n #}\n\n {%- call statement('relations', fetch_result=True) -%}\n select distinct\n dependent_namespace.nspname as dependent_schema,\n dependent_class.relname as dependent_name,\n referenced_namespace.nspname as referenced_schema,\n referenced_class.relname as referenced_name\n\n -- Query for views: views are entries in pg_class with an entry in pg_rewrite, but we avoid\n -- a seq scan on pg_rewrite by leveraging the fact there is an \"internal\" row in pg_depend for\n -- the view...\n from pg_class as dependent_class\n join pg_namespace as dependent_namespace on dependent_namespace.oid = dependent_class.relnamespace\n join pg_depend as dependent_depend on dependent_depend.refobjid = dependent_class.oid\n and dependent_depend.classid = 'pg_rewrite'::regclass\n and dependent_depend.refclassid = 'pg_class'::regclass\n and dependent_depend.deptype = 'i'\n\n -- ... and via pg_depend (that has a row per column, hence the need for \"distinct\" above, and\n -- making sure to exclude the internal row to avoid a view appearing to depend on itself)...\n join pg_depend as joining_depend on joining_depend.objid = dependent_depend.objid\n and joining_depend.classid = 'pg_rewrite'::regclass\n and joining_depend.refclassid = 'pg_class'::regclass\n and joining_depend.refobjid != dependent_depend.refobjid\n\n -- ... we can find the tables they query from in pg_class, but excluding system tables. Note we\n -- don't need need to exclude _dependent_ system tables, because they only query from other\n -- system tables, and so are automatically excluded by excluding _referenced_ system tables\n join pg_class as referenced_class on referenced_class.oid = joining_depend.refobjid\n join pg_namespace as referenced_namespace on referenced_namespace.oid = referenced_class.relnamespace\n and referenced_namespace.nspname != 'information_schema'\n and referenced_namespace.nspname not like 'pg\\_%'\n\n order by\n dependent_schema, dependent_name, referenced_schema, referenced_name;\n\n {%- endcall -%}\n\n {{ return(load_result('relations').table) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789419969.6648376, "supported_languages": null}, "macro.dbt_postgres.postgres_get_relations": {"name": "postgres_get_relations", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/relations.sql", "original_file_path": "macros/relations.sql", "unique_id": "macro.dbt_postgres.postgres_get_relations", "macro_sql": "{% macro postgres_get_relations() %}\n {{ return(postgres__get_relations()) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__get_relations"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789419969.6650686, "supported_languages": null}, "macro.dbt_postgres.postgres__create_table_as": {"name": "postgres__create_table_as", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "unique_id": "macro.dbt_postgres.postgres__create_table_as", "macro_sql": "{% macro postgres__create_table_as(temporary, relation, sql) -%}\n {%- set unlogged = config.get('unlogged', default=false) -%}\n {%- set sql_header = config.get('sql_header', none) -%}\n\n {{ sql_header if sql_header is not none }}\n\n create {% if temporary -%}\n temporary\n {%- elif unlogged -%}\n unlogged\n {%- endif %} table {{ relation }}\n {% set contract_config = config.get('contract') %}\n {% if contract_config.enforced %}\n {{ get_assert_columns_equivalent(sql) }}\n {% endif -%}\n {% if contract_config.enforced and (not temporary) -%}\n {{ get_table_columns_and_constraints() }} ;\n insert into {{ relation }} (\n {{ adapter.dispatch('get_column_names', 'dbt')() }}\n )\n {%- set sql = get_select_subquery(sql) %}\n {% else %}\n as\n {% endif %}\n (\n {{ sql }}\n );\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.get_assert_columns_equivalent", "macro.dbt.get_table_columns_and_constraints", "macro.dbt.default__get_column_names", "macro.dbt.get_select_subquery"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "temporary", "type": null, "description": ""}, {"name": "relation", "type": null, "description": ""}, {"name": "sql", "type": null, "description": ""}], "created_at": 1789419969.6691167, "supported_languages": null}, "macro.dbt_postgres.postgres__get_create_index_sql": {"name": "postgres__get_create_index_sql", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "unique_id": "macro.dbt_postgres.postgres__get_create_index_sql", "macro_sql": "{% macro postgres__get_create_index_sql(relation, index_dict) -%}\n {%- set index_config = adapter.parse_index(index_dict) -%}\n {%- set comma_separated_columns = \", \".join(index_config.columns) -%}\n {%- set index_name = index_config.render(relation) -%}\n\n create {% if index_config.unique -%}\n unique\n {%- endif %} index if not exists\n \"{{ index_name }}\"\n on {{ relation }} {% if index_config.type -%}\n using {{ index_config.type }}\n {%- endif %}\n ({{ comma_separated_columns }})\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "index_dict", "type": null, "description": ""}], "created_at": 1789419969.6699846, "supported_languages": null}, "macro.dbt_postgres.postgres__create_schema": {"name": "postgres__create_schema", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "unique_id": "macro.dbt_postgres.postgres__create_schema", "macro_sql": "{% macro postgres__create_schema(relation) -%}\n {% if relation.database -%}\n {{ adapter.verify_database(relation.database) }}\n {%- endif -%}\n {%- call statement('create_schema') -%}\n create schema if not exists {{ relation.without_identifier().include(database=False) }}\n {%- endcall -%}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789419969.6705961, "supported_languages": null}, "macro.dbt_postgres.postgres__drop_schema": {"name": "postgres__drop_schema", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "unique_id": "macro.dbt_postgres.postgres__drop_schema", "macro_sql": "{% macro postgres__drop_schema(relation) -%}\n {% if relation.database -%}\n {{ adapter.verify_database(relation.database) }}\n {%- endif -%}\n {%- call statement('drop_schema') -%}\n drop schema if exists {{ relation.without_identifier().include(database=False) }} cascade\n {%- endcall -%}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789419969.6712496, "supported_languages": null}, "macro.dbt_postgres.postgres__get_columns_in_relation": {"name": "postgres__get_columns_in_relation", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "unique_id": "macro.dbt_postgres.postgres__get_columns_in_relation", "macro_sql": "{% macro postgres__get_columns_in_relation(relation) -%}\n {% call statement('get_columns_in_relation', fetch_result=True) %}\n select\n column_name,\n data_type,\n character_maximum_length,\n numeric_precision,\n numeric_scale\n\n from {{ relation.information_schema('columns') }}\n where table_name = '{{ relation.identifier }}'\n {% if relation.schema %}\n and table_schema = '{{ relation.schema }}'\n {% endif %}\n order by ordinal_position\n\n {% endcall %}\n {% set table = load_result('get_columns_in_relation').table %}\n {{ return(sql_convert_columns_in_relation(table)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement", "macro.dbt.sql_convert_columns_in_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789419969.6720796, "supported_languages": null}, "macro.dbt_postgres.postgres__list_relations_without_caching": {"name": "postgres__list_relations_without_caching", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "unique_id": "macro.dbt_postgres.postgres__list_relations_without_caching", "macro_sql": "{% macro postgres__list_relations_without_caching(schema_relation) %}\n {% call statement('list_relations_without_caching', fetch_result=True) -%}\n select\n '{{ schema_relation.database }}' as database,\n tablename as name,\n schemaname as schema,\n 'table' as type\n from pg_tables\n where schemaname ilike '{{ schema_relation.schema }}'\n union all\n select\n '{{ schema_relation.database }}' as database,\n viewname as name,\n schemaname as schema,\n 'view' as type\n from pg_views\n where schemaname ilike '{{ schema_relation.schema }}'\n union all\n select\n '{{ schema_relation.database }}' as database,\n matviewname as name,\n schemaname as schema,\n 'materialized_view' as type\n from pg_matviews\n where schemaname ilike '{{ schema_relation.schema }}'\n union all\n select distinct\n '{{ schema_relation.database }}' as database,\n proname as name,\n ns.nspname as schema,\n 'function' as type\n from pg_proc\n join pg_namespace as ns on pronamespace = ns.oid\n where ns.nspname ilike '{{ schema_relation.schema }}'\n {% endcall %}\n {{ return(load_result('list_relations_without_caching').table) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "schema_relation", "type": null, "description": ""}], "created_at": 1789419969.6729307, "supported_languages": null}, "macro.dbt_postgres.postgres__information_schema_name": {"name": "postgres__information_schema_name", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "unique_id": "macro.dbt_postgres.postgres__information_schema_name", "macro_sql": "{% macro postgres__information_schema_name(database) -%}\n {% if database_name -%}\n {{ adapter.verify_database(database_name) }}\n {%- endif -%}\n information_schema\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "database", "type": null, "description": ""}], "created_at": 1789419969.6732242, "supported_languages": null}, "macro.dbt_postgres.postgres__list_schemas": {"name": "postgres__list_schemas", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "unique_id": "macro.dbt_postgres.postgres__list_schemas", "macro_sql": "{% macro postgres__list_schemas(database) %}\n {% if database -%}\n {{ adapter.verify_database(database) }}\n {%- endif -%}\n {% call statement('list_schemas', fetch_result=True, auto_begin=False) %}\n select distinct nspname from pg_namespace\n {% endcall %}\n {{ return(load_result('list_schemas').table) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "database", "type": null, "description": ""}], "created_at": 1789419969.6738021, "supported_languages": null}, "macro.dbt_postgres.postgres__check_schema_exists": {"name": "postgres__check_schema_exists", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "unique_id": "macro.dbt_postgres.postgres__check_schema_exists", "macro_sql": "{% macro postgres__check_schema_exists(information_schema, schema) -%}\n {% if information_schema.database -%}\n {{ adapter.verify_database(information_schema.database) }}\n {%- endif -%}\n {% call statement('check_schema_exists', fetch_result=True, auto_begin=False) %}\n select count(*) from pg_namespace where nspname = '{{ schema }}'\n {% endcall %}\n {{ return(load_result('check_schema_exists').table) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "information_schema", "type": null, "description": ""}, {"name": "schema", "type": null, "description": ""}], "created_at": 1789419969.6744528, "supported_languages": null}, "macro.dbt_postgres.postgres__make_relation_with_suffix": {"name": "postgres__make_relation_with_suffix", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "unique_id": "macro.dbt_postgres.postgres__make_relation_with_suffix", "macro_sql": "{% macro postgres__make_relation_with_suffix(base_relation, suffix, dstring) %}\n {% if dstring %}\n {% set dt = modules.datetime.datetime.now() %}\n {% set dtstring = dt.strftime(\"%H%M%S%f\") %}\n {% set suffix = suffix ~ dtstring %}\n {% endif %}\n {% set suffix_length = suffix|length %}\n {% set relation_max_name_length = base_relation.relation_max_name_length() %}\n {% if suffix_length > relation_max_name_length %}\n {% do exceptions.raise_compiler_error('Relation suffix is too long (' ~ suffix_length ~ ' characters). Maximum length is ' ~ relation_max_name_length ~ ' characters.') %}\n {% endif %}\n {% set identifier = base_relation.identifier[:relation_max_name_length - suffix_length] ~ suffix %}\n\n {{ return(base_relation.incorporate(path={\"identifier\": identifier })) }}\n\n {% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "base_relation", "type": null, "description": ""}, {"name": "suffix", "type": null, "description": ""}, {"name": "dstring", "type": null, "description": ""}], "created_at": 1789419969.6759813, "supported_languages": null}, "macro.dbt_postgres.postgres__make_intermediate_relation": {"name": "postgres__make_intermediate_relation", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "unique_id": "macro.dbt_postgres.postgres__make_intermediate_relation", "macro_sql": "{% macro postgres__make_intermediate_relation(base_relation, suffix) %}\n {{ return(postgres__make_relation_with_suffix(base_relation, suffix, dstring=False)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__make_relation_with_suffix"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "base_relation", "type": null, "description": ""}, {"name": "suffix", "type": null, "description": ""}], "created_at": 1789419969.6763268, "supported_languages": null}, "macro.dbt_postgres.postgres__make_temp_relation": {"name": "postgres__make_temp_relation", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "unique_id": "macro.dbt_postgres.postgres__make_temp_relation", "macro_sql": "{% macro postgres__make_temp_relation(base_relation, suffix) %}\n {% set temp_relation = postgres__make_relation_with_suffix(base_relation, suffix, dstring=True) %}\n {{ return(temp_relation.incorporate(path={\"schema\": none,\n \"database\": none})) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__make_relation_with_suffix"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "base_relation", "type": null, "description": ""}, {"name": "suffix", "type": null, "description": ""}], "created_at": 1789419969.676878, "supported_languages": null}, "macro.dbt_postgres.postgres__make_backup_relation": {"name": "postgres__make_backup_relation", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "unique_id": "macro.dbt_postgres.postgres__make_backup_relation", "macro_sql": "{% macro postgres__make_backup_relation(base_relation, backup_relation_type, suffix) %}\n {% set backup_relation = postgres__make_relation_with_suffix(base_relation, suffix, dstring=False) %}\n {{ return(backup_relation.incorporate(type=backup_relation_type)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__make_relation_with_suffix"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "base_relation", "type": null, "description": ""}, {"name": "backup_relation_type", "type": null, "description": ""}, {"name": "suffix", "type": null, "description": ""}], "created_at": 1789419969.6773393, "supported_languages": null}, "macro.dbt_postgres.postgres_escape_comment": {"name": "postgres_escape_comment", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "unique_id": "macro.dbt_postgres.postgres_escape_comment", "macro_sql": "{% macro postgres_escape_comment(comment) -%}\n {% if comment is not string %}\n {% do exceptions.raise_compiler_error('cannot escape a non-string: ' ~ comment) %}\n {% endif %}\n {%- set magic = '$dbt_comment_literal_block$' -%}\n {%- if magic in comment -%}\n {%- do exceptions.raise_compiler_error('The string ' ~ magic ~ ' is not allowed in comments.') -%}\n {%- endif -%}\n {{ magic }}{{ comment }}{{ magic }}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "comment", "type": null, "description": ""}], "created_at": 1789419969.6780698, "supported_languages": null}, "macro.dbt_postgres.postgres__alter_relation_comment": {"name": "postgres__alter_relation_comment", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "unique_id": "macro.dbt_postgres.postgres__alter_relation_comment", "macro_sql": "{% macro postgres__alter_relation_comment(relation, comment) %}\n {% set escaped_comment = postgres_escape_comment(comment) %}\n {% if relation.type == 'materialized_view' -%}\n {% set relation_type = \"materialized view\" %}\n {%- else -%}\n {%- set relation_type = relation.type -%}\n {%- endif -%}\n comment on {{ relation_type }} {{ relation }} is {{ escaped_comment }};\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres_escape_comment"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "comment", "type": null, "description": ""}], "created_at": 1789419969.678695, "supported_languages": null}, "macro.dbt_postgres.postgres__alter_column_comment": {"name": "postgres__alter_column_comment", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "unique_id": "macro.dbt_postgres.postgres__alter_column_comment", "macro_sql": "{% macro postgres__alter_column_comment(relation, column_dict) %}\n {% set existing_columns = adapter.get_columns_in_relation(relation) | map(attribute=\"name\") | list %}\n {% for column_name in column_dict if (column_name in existing_columns) %}\n {% set comment = column_dict[column_name]['description'] %}\n {% set escaped_comment = postgres_escape_comment(comment) %}\n comment on column {{ relation }}.{{ adapter.quote(column_name) if column_dict[column_name]['quote'] else column_name }} is {{ escaped_comment }};\n {% endfor %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres_escape_comment"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "column_dict", "type": null, "description": ""}], "created_at": 1789419969.6796932, "supported_languages": null}, "macro.dbt_postgres.postgres__get_show_grant_sql": {"name": "postgres__get_show_grant_sql", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "unique_id": "macro.dbt_postgres.postgres__get_show_grant_sql", "macro_sql": "\n\n{%- macro postgres__get_show_grant_sql(relation) -%}\n select grantee, privilege_type\n from {{ relation.information_schema('role_table_grants') }}\n where grantor = current_role\n and grantee != current_role\n and table_schema = '{{ relation.schema }}'\n and table_name = '{{ relation.identifier }}'\n{%- endmacro -%}\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789419969.6800566, "supported_languages": null}, "macro.dbt_postgres.postgres__copy_grants": {"name": "postgres__copy_grants", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "unique_id": "macro.dbt_postgres.postgres__copy_grants", "macro_sql": "{% macro postgres__copy_grants() %}\n {{ return(False) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789419969.680255, "supported_languages": null}, "macro.dbt_postgres.postgres__get_show_indexes_sql": {"name": "postgres__get_show_indexes_sql", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "unique_id": "macro.dbt_postgres.postgres__get_show_indexes_sql", "macro_sql": "{% macro postgres__get_show_indexes_sql(relation) %}\n select\n i.relname as name,\n m.amname as method,\n ix.indisunique as \"unique\",\n array_to_string(array_agg(a.attname), ',') as column_names\n from pg_index ix\n join pg_class i\n on i.oid = ix.indexrelid\n join pg_am m\n on m.oid=i.relam\n join pg_class t\n on t.oid = ix.indrelid\n join pg_namespace n\n on n.oid = t.relnamespace\n join pg_attribute a\n on a.attrelid = t.oid\n and a.attnum = ANY(ix.indkey)\n where t.relname = '{{ relation.identifier }}'\n and n.nspname = '{{ relation.schema }}'\n and t.relkind in ('r', 'm')\n group by 1, 2, 3\n order by 1, 2, 3\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789419969.6805992, "supported_languages": null}, "macro.dbt_postgres.postgres__get_drop_index_sql": {"name": "postgres__get_drop_index_sql", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "unique_id": "macro.dbt_postgres.postgres__get_drop_index_sql", "macro_sql": "\n\n\n{%- macro postgres__get_drop_index_sql(relation, index_name) -%}\n drop index if exists \"{{ relation.schema }}\".\"{{ index_name }}\"\n{%- endmacro -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "index_name", "type": null, "description": ""}], "created_at": 1789419969.6808674, "supported_languages": null}, "macro.dbt_postgres.postgres__get_create_materialized_view_as_sql": {"name": "postgres__get_create_materialized_view_as_sql", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/relations/materialized_view/create.sql", "original_file_path": "macros/relations/materialized_view/create.sql", "unique_id": "macro.dbt_postgres.postgres__get_create_materialized_view_as_sql", "macro_sql": "{% macro postgres__get_create_materialized_view_as_sql(relation, sql) %}\n create materialized view if not exists {{ relation }} as {{ sql }};\n\n {% for _index_dict in config.get('indexes', []) -%}\n {{- get_create_index_sql(relation, _index_dict) -}}{{ ';' if not loop.last else \"\" }}\n {%- endfor -%}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_create_index_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "sql", "type": null, "description": ""}], "created_at": 1789419969.6816542, "supported_languages": null}, "macro.dbt_postgres.postgres__get_alter_materialized_view_as_sql": {"name": "postgres__get_alter_materialized_view_as_sql", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/relations/materialized_view/alter.sql", "original_file_path": "macros/relations/materialized_view/alter.sql", "unique_id": "macro.dbt_postgres.postgres__get_alter_materialized_view_as_sql", "macro_sql": "{% macro postgres__get_alter_materialized_view_as_sql(\n relation,\n configuration_changes,\n sql,\n existing_relation,\n backup_relation,\n intermediate_relation\n) %}\n\n -- apply a full refresh immediately if needed\n {% if configuration_changes.requires_full_refresh %}\n\n {{ get_replace_sql(existing_relation, relation, sql) }}\n\n -- otherwise apply individual changes as needed\n {% else %}\n\n {{ postgres__update_indexes_on_materialized_view(relation, configuration_changes.indexes) }}\n\n {%- endif -%}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_replace_sql", "macro.dbt_postgres.postgres__update_indexes_on_materialized_view"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "configuration_changes", "type": null, "description": ""}, {"name": "sql", "type": null, "description": ""}, {"name": "existing_relation", "type": null, "description": ""}, {"name": "backup_relation", "type": null, "description": ""}, {"name": "intermediate_relation", "type": null, "description": ""}], "created_at": 1789419969.6827197, "supported_languages": null}, "macro.dbt_postgres.postgres__update_indexes_on_materialized_view": {"name": "postgres__update_indexes_on_materialized_view", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/relations/materialized_view/alter.sql", "original_file_path": "macros/relations/materialized_view/alter.sql", "unique_id": "macro.dbt_postgres.postgres__update_indexes_on_materialized_view", "macro_sql": "\n\n\n{%- macro postgres__update_indexes_on_materialized_view(relation, index_changes) -%}\n {{- log(\"Applying UPDATE INDEXES to: \" ~ relation) -}}\n\n {%- for _index_change in index_changes -%}\n {%- set _index = _index_change.context -%}\n\n {%- if _index_change.action == \"drop\" -%}\n\n {{ postgres__get_drop_index_sql(relation, _index.name) }}\n\n {%- elif _index_change.action == \"create\" -%}\n\n {{ postgres__get_create_index_sql(relation, _index.as_node_config) }}\n\n {%- endif -%}\n\t{{ ';' if not loop.last else \"\" }}\n\n {%- endfor -%}\n\n{%- endmacro -%}\n\n\n", "depends_on": {"macros": ["macro.dbt_postgres.postgres__get_drop_index_sql", "macro.dbt_postgres.postgres__get_create_index_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "index_changes", "type": null, "description": ""}], "created_at": 1789419969.6836293, "supported_languages": null}, "macro.dbt_postgres.postgres__get_materialized_view_configuration_changes": {"name": "postgres__get_materialized_view_configuration_changes", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/relations/materialized_view/alter.sql", "original_file_path": "macros/relations/materialized_view/alter.sql", "unique_id": "macro.dbt_postgres.postgres__get_materialized_view_configuration_changes", "macro_sql": "{% macro postgres__get_materialized_view_configuration_changes(existing_relation, new_config) %}\n {% set _existing_materialized_view = postgres__describe_materialized_view(existing_relation) %}\n {% set _configuration_changes = existing_relation.get_materialized_view_config_change_collection(_existing_materialized_view, new_config.model) %}\n {% do return(_configuration_changes) %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__describe_materialized_view"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "existing_relation", "type": null, "description": ""}, {"name": "new_config", "type": null, "description": ""}], "created_at": 1789419969.6841438, "supported_languages": null}, "macro.dbt_postgres.postgres__get_rename_materialized_view_sql": {"name": "postgres__get_rename_materialized_view_sql", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/relations/materialized_view/rename.sql", "original_file_path": "macros/relations/materialized_view/rename.sql", "unique_id": "macro.dbt_postgres.postgres__get_rename_materialized_view_sql", "macro_sql": "{% macro postgres__get_rename_materialized_view_sql(relation, new_name) %}\n alter materialized view {{ relation }} rename to {{ new_name }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "new_name", "type": null, "description": ""}], "created_at": 1789419969.6844664, "supported_languages": null}, "macro.dbt_postgres.postgres__refresh_materialized_view": {"name": "postgres__refresh_materialized_view", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/relations/materialized_view/refresh.sql", "original_file_path": "macros/relations/materialized_view/refresh.sql", "unique_id": "macro.dbt_postgres.postgres__refresh_materialized_view", "macro_sql": "{% macro postgres__refresh_materialized_view(relation) %}\n refresh materialized view {{ relation }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789419969.684712, "supported_languages": null}, "macro.dbt_postgres.postgres__drop_materialized_view": {"name": "postgres__drop_materialized_view", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/relations/materialized_view/drop.sql", "original_file_path": "macros/relations/materialized_view/drop.sql", "unique_id": "macro.dbt_postgres.postgres__drop_materialized_view", "macro_sql": "{% macro postgres__drop_materialized_view(relation) -%}\n drop materialized view if exists {{ relation }} cascade\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789419969.6849651, "supported_languages": null}, "macro.dbt_postgres.postgres__describe_materialized_view": {"name": "postgres__describe_materialized_view", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/relations/materialized_view/describe.sql", "original_file_path": "macros/relations/materialized_view/describe.sql", "unique_id": "macro.dbt_postgres.postgres__describe_materialized_view", "macro_sql": "{% macro postgres__describe_materialized_view(relation) %}\n -- for now just get the indexes, we don't need the name or the query yet\n {% set _indexes = run_query(get_show_indexes_sql(relation)) %}\n {% do return({'indexes': _indexes}) %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.run_query", "macro.dbt.get_show_indexes_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789419969.6856048, "supported_languages": null}, "macro.dbt_postgres.postgres__get_rename_view_sql": {"name": "postgres__get_rename_view_sql", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/relations/view/rename.sql", "original_file_path": "macros/relations/view/rename.sql", "unique_id": "macro.dbt_postgres.postgres__get_rename_view_sql", "macro_sql": "{% macro postgres__get_rename_view_sql(relation, new_name) %}\n alter view {{ relation }} rename to {{ new_name }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "new_name", "type": null, "description": ""}], "created_at": 1789419969.6859329, "supported_languages": null}, "macro.dbt_postgres.postgres__drop_view": {"name": "postgres__drop_view", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/relations/view/drop.sql", "original_file_path": "macros/relations/view/drop.sql", "unique_id": "macro.dbt_postgres.postgres__drop_view", "macro_sql": "{% macro postgres__drop_view(relation) -%}\n drop view if exists {{ relation }} cascade\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789419969.686179, "supported_languages": null}, "macro.dbt_postgres.postgres__get_replace_view_sql": {"name": "postgres__get_replace_view_sql", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/relations/view/replace.sql", "original_file_path": "macros/relations/view/replace.sql", "unique_id": "macro.dbt_postgres.postgres__get_replace_view_sql", "macro_sql": "{% macro postgres__get_replace_view_sql(relation, sql) -%}\n\n {%- set sql_header = config.get('sql_header', none) -%}\n {{ sql_header if sql_header is not none }}\n\n create or replace view {{ relation }}\n {% set contract_config = config.get('contract') %}\n {% if contract_config.enforced %}\n {{ get_assert_columns_equivalent(sql) }}\n {%- endif %}\n as (\n {{ sql }}\n );\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.get_assert_columns_equivalent"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "sql", "type": null, "description": ""}], "created_at": 1789419969.687095, "supported_languages": null}, "macro.dbt_postgres.postgres__get_rename_table_sql": {"name": "postgres__get_rename_table_sql", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/relations/table/rename.sql", "original_file_path": "macros/relations/table/rename.sql", "unique_id": "macro.dbt_postgres.postgres__get_rename_table_sql", "macro_sql": "{% macro postgres__get_rename_table_sql(relation, new_name) %}\n alter table {{ relation }} rename to {{ new_name }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "new_name", "type": null, "description": ""}], "created_at": 1789419969.6874127, "supported_languages": null}, "macro.dbt_postgres.postgres__drop_table": {"name": "postgres__drop_table", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/relations/table/drop.sql", "original_file_path": "macros/relations/table/drop.sql", "unique_id": "macro.dbt_postgres.postgres__drop_table", "macro_sql": "{% macro postgres__drop_table(relation) -%}\n drop table if exists {{ relation }} cascade\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789419969.6876535, "supported_languages": null}, "macro.dbt_postgres.postgres__get_replace_table_sql": {"name": "postgres__get_replace_table_sql", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/relations/table/replace.sql", "original_file_path": "macros/relations/table/replace.sql", "unique_id": "macro.dbt_postgres.postgres__get_replace_table_sql", "macro_sql": "{% macro postgres__get_replace_table_sql(relation, sql) -%}\n\n {%- set sql_header = config.get('sql_header', none) -%}\n {{ sql_header if sql_header is not none }}\n\n create or replace table {{ relation }}\n {% set contract_config = config.get('contract') %}\n {% if contract_config.enforced %}\n {{ get_assert_columns_equivalent(sql) }}\n {{ get_table_columns_and_constraints() }}\n {%- set sql = get_select_subquery(sql) %}\n {% endif %}\n as (\n {{ sql }}\n );\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.get_assert_columns_equivalent", "macro.dbt.get_table_columns_and_constraints", "macro.dbt.get_select_subquery"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "sql", "type": null, "description": ""}], "created_at": 1789419969.6887176, "supported_languages": null}, "macro.dbt_postgres.postgres__get_incremental_default_sql": {"name": "postgres__get_incremental_default_sql", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/materializations/incremental_strategies.sql", "original_file_path": "macros/materializations/incremental_strategies.sql", "unique_id": "macro.dbt_postgres.postgres__get_incremental_default_sql", "macro_sql": "{% macro postgres__get_incremental_default_sql(arg_dict) %}\n\n {% if arg_dict[\"unique_key\"] %}\n {% do return(get_incremental_delete_insert_sql(arg_dict)) %}\n {% else %}\n {% do return(get_incremental_append_sql(arg_dict)) %}\n {% endif %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_incremental_delete_insert_sql", "macro.dbt.get_incremental_append_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "arg_dict", "type": null, "description": ""}], "created_at": 1789419969.689497, "supported_languages": null}, "macro.dbt_postgres.postgres__get_incremental_microbatch_sql": {"name": "postgres__get_incremental_microbatch_sql", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/materializations/incremental_strategies.sql", "original_file_path": "macros/materializations/incremental_strategies.sql", "unique_id": "macro.dbt_postgres.postgres__get_incremental_microbatch_sql", "macro_sql": "{% macro postgres__get_incremental_microbatch_sql(arg_dict) %}\n\n {% if arg_dict[\"unique_key\"] %}\n {% do return(adapter.dispatch('get_incremental_merge_sql', 'dbt')(arg_dict)) %}\n {% else %}\n {{ exceptions.raise_compiler_error(\"dbt-postgres 'microbatch' requires a `unique_key` config\") }}\n {% endif %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_incremental_merge_sql", "macro.dbt.default__get_incremental_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "arg_dict", "type": null, "description": ""}], "created_at": 1789419969.6900623, "supported_languages": null}, "macro.dbt_postgres.postgres__snapshot_merge_sql": {"name": "postgres__snapshot_merge_sql", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/materializations/snapshot_merge.sql", "original_file_path": "macros/materializations/snapshot_merge.sql", "unique_id": "macro.dbt_postgres.postgres__snapshot_merge_sql", "macro_sql": "{% macro postgres__snapshot_merge_sql(target, source, insert_cols) -%}\n {%- set insert_cols_csv = insert_cols | join(', ') -%}\n\n {%- set columns = config.get(\"snapshot_table_column_names\") or get_snapshot_table_column_names() -%}\n\n update {{ target }}\n set {{ columns.dbt_valid_to }} = DBT_INTERNAL_SOURCE.{{ columns.dbt_valid_to }}\n from {{ source }} as DBT_INTERNAL_SOURCE\n where DBT_INTERNAL_SOURCE.{{ columns.dbt_scd_id }}::text = {{ target }}.{{ columns.dbt_scd_id }}::text\n and DBT_INTERNAL_SOURCE.dbt_change_type::text in ('update'::text, 'delete'::text)\n {% if config.get(\"dbt_valid_to_current\") %}\n and ({{ target }}.{{ columns.dbt_valid_to }} = {{ config.get('dbt_valid_to_current') }} or {{ target }}.{{ columns.dbt_valid_to }} is null);\n {% else %}\n and {{ target }}.{{ columns.dbt_valid_to }} is null;\n {% endif %}\n\n\n insert into {{ target }} ({{ insert_cols_csv }})\n select {% for column in insert_cols -%}\n DBT_INTERNAL_SOURCE.{{ column }} {%- if not loop.last %}, {%- endif %}\n {%- endfor %}\n from {{ source }} as DBT_INTERNAL_SOURCE\n where DBT_INTERNAL_SOURCE.dbt_change_type::text = 'insert'::text;\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_snapshot_table_column_names"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "target", "type": null, "description": ""}, {"name": "source", "type": null, "description": ""}, {"name": "insert_cols", "type": null, "description": ""}], "created_at": 1789419969.6919851, "supported_languages": null}, "macro.dbt_postgres.postgres__formatted_scalar_function_args_sql": {"name": "postgres__formatted_scalar_function_args_sql", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/materializations/functions/scalar.sql", "original_file_path": "macros/materializations/functions/scalar.sql", "unique_id": "macro.dbt_postgres.postgres__formatted_scalar_function_args_sql", "macro_sql": "{% macro postgres__formatted_scalar_function_args_sql() %}\n {% set args = [] %}\n {% for arg in model.arguments -%}\n {% set default_value = arg.get('default_value', none) %}\n {% if default_value != none %}\n {%- do args.append(arg.name ~ ' ' ~ arg.data_type ~ ' DEFAULT ' ~ default_value) -%}\n {% else %}\n {%- do args.append(arg.name ~ ' ' ~ arg.data_type) -%}\n {% endif %}\n {%- endfor %}\n {{ args | join(', ') }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789419969.693192, "supported_languages": null}, "macro.dbt_postgres.postgres__last_day": {"name": "postgres__last_day", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/utils/last_day.sql", "original_file_path": "macros/utils/last_day.sql", "unique_id": "macro.dbt_postgres.postgres__last_day", "macro_sql": "{% macro postgres__last_day(date, datepart) -%}\n\n {%- if datepart == 'quarter' -%}\n -- postgres dateadd does not support quarter interval.\n cast(\n {{dbt.dateadd('day', '-1',\n dbt.dateadd('month', '3', dbt.date_trunc(datepart, date))\n )}}\n as date)\n {%- else -%}\n {{dbt.default_last_day(date, datepart)}}\n {%- endif -%}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.dateadd", "macro.dbt.date_trunc", "macro.dbt.default_last_day"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "date", "type": null, "description": ""}, {"name": "datepart", "type": null, "description": ""}], "created_at": 1789419969.6940668, "supported_languages": null}, "macro.dbt_postgres.postgres__listagg": {"name": "postgres__listagg", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/utils/listagg.sql", "original_file_path": "macros/utils/listagg.sql", "unique_id": "macro.dbt_postgres.postgres__listagg", "macro_sql": "{% macro postgres__listagg(measure, delimiter_text, order_by_clause, limit_num) -%}\n\n {% if limit_num -%}\n array_to_string(\n (array_agg(\n {{ measure }}\n {% if order_by_clause -%}\n {{ order_by_clause }}\n {%- endif %}\n ))[1:{{ limit_num }}],\n {{ delimiter_text }}\n )\n {%- else %}\n string_agg(\n {{ measure }},\n {{ delimiter_text }}\n {% if order_by_clause -%}\n {{ order_by_clause }}\n {%- endif %}\n )\n {%- endif %}\n\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "measure", "type": null, "description": ""}, {"name": "delimiter_text", "type": null, "description": ""}, {"name": "order_by_clause", "type": null, "description": ""}, {"name": "limit_num", "type": null, "description": ""}], "created_at": 1789419969.6949735, "supported_languages": null}, "macro.dbt_postgres.postgres__any_value": {"name": "postgres__any_value", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/utils/any_value.sql", "original_file_path": "macros/utils/any_value.sql", "unique_id": "macro.dbt_postgres.postgres__any_value", "macro_sql": "{% macro postgres__any_value(expression) -%}\n\n min({{ expression }})\n\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "expression", "type": null, "description": ""}], "created_at": 1789419969.6952403, "supported_languages": null}, "macro.dbt_postgres.postgres__datediff": {"name": "postgres__datediff", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/utils/datediff.sql", "original_file_path": "macros/utils/datediff.sql", "unique_id": "macro.dbt_postgres.postgres__datediff", "macro_sql": "{% macro postgres__datediff(first_date, second_date, datepart) -%}\n\n {% if datepart == 'year' %}\n (date_part('year', ({{second_date}})::date) - date_part('year', ({{first_date}})::date))\n {% elif datepart == 'quarter' %}\n ({{ datediff(first_date, second_date, 'year') }} * 4 + date_part('quarter', ({{second_date}})::date) - date_part('quarter', ({{first_date}})::date))\n {% elif datepart == 'month' %}\n ({{ datediff(first_date, second_date, 'year') }} * 12 + date_part('month', ({{second_date}})::date) - date_part('month', ({{first_date}})::date))\n {% elif datepart == 'day' %}\n (({{second_date}})::date - ({{first_date}})::date)\n {% elif datepart == 'week' %}\n ({{ datediff(first_date, second_date, 'day') }} / 7 + case\n when date_part('dow', ({{first_date}})::timestamp) <= date_part('dow', ({{second_date}})::timestamp) then\n case when {{first_date}} <= {{second_date}} then 0 else -1 end\n else\n case when {{first_date}} <= {{second_date}} then 1 else 0 end\n end)\n {% elif datepart == 'hour' %}\n ({{ datediff(first_date, second_date, 'day') }} * 24 + date_part('hour', ({{second_date}})::timestamp) - date_part('hour', ({{first_date}})::timestamp))\n {% elif datepart == 'minute' %}\n ({{ datediff(first_date, second_date, 'hour') }} * 60 + date_part('minute', ({{second_date}})::timestamp) - date_part('minute', ({{first_date}})::timestamp))\n {% elif datepart == 'second' %}\n ({{ datediff(first_date, second_date, 'minute') }} * 60 + floor(date_part('second', ({{second_date}})::timestamp)) - floor(date_part('second', ({{first_date}})::timestamp)))\n {% elif datepart == 'millisecond' %}\n ({{ datediff(first_date, second_date, 'minute') }} * 60000 + floor(date_part('millisecond', ({{second_date}})::timestamp)) - floor(date_part('millisecond', ({{first_date}})::timestamp)))\n {% elif datepart == 'microsecond' %}\n ({{ datediff(first_date, second_date, 'minute') }} * 60000000 + floor(date_part('microsecond', ({{second_date}})::timestamp)) - floor(date_part('microsecond', ({{first_date}})::timestamp)))\n {% else %}\n {{ exceptions.raise_compiler_error(\"Unsupported datepart for macro datediff in postgres: {!r}\".format(datepart)) }}\n {% endif %}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.datediff"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "first_date", "type": null, "description": ""}, {"name": "second_date", "type": null, "description": ""}, {"name": "datepart", "type": null, "description": ""}], "created_at": 1789419969.6988246, "supported_languages": null}, "macro.dbt_postgres.postgres__equals": {"name": "postgres__equals", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/utils/equals.sql", "original_file_path": "macros/utils/equals.sql", "unique_id": "macro.dbt_postgres.postgres__equals", "macro_sql": "{% macro postgres__equals(expr1, expr2) -%}\n{%- if adapter.behavior.enable_truthy_nulls_equals_macro.no_warn %}\n ({{ expr1 }} IS NOT DISTINCT FROM {{ expr2 }})\n{%- else -%}\n ({{ expr1 }} = {{ expr2 }})\n{%- endif %}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "expr1", "type": null, "description": ""}, {"name": "expr2", "type": null, "description": ""}], "created_at": 1789419969.6994255, "supported_languages": null}, "macro.dbt_postgres.postgres__dateadd": {"name": "postgres__dateadd", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/utils/dateadd.sql", "original_file_path": "macros/utils/dateadd.sql", "unique_id": "macro.dbt_postgres.postgres__dateadd", "macro_sql": "{% macro postgres__dateadd(datepart, interval, from_date_or_timestamp) %}\n\n {{ from_date_or_timestamp }} + ((interval '1 {{ datepart }}') * ({{ interval }}))\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "datepart", "type": null, "description": ""}, {"name": "interval", "type": null, "description": ""}, {"name": "from_date_or_timestamp", "type": null, "description": ""}], "created_at": 1789419969.6998165, "supported_languages": null}, "macro.dbt_postgres.postgres__split_part": {"name": "postgres__split_part", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/utils/split_part.sql", "original_file_path": "macros/utils/split_part.sql", "unique_id": "macro.dbt_postgres.postgres__split_part", "macro_sql": "{% macro postgres__split_part(string_text, delimiter_text, part_number) %}\n\n {% if part_number >= 0 %}\n {{ dbt.default__split_part(string_text, delimiter_text, part_number) }}\n {% else %}\n {{ dbt._split_part_negative(string_text, delimiter_text, part_number) }}\n {% endif %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__split_part", "macro.dbt._split_part_negative"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "string_text", "type": null, "description": ""}, {"name": "delimiter_text", "type": null, "description": ""}, {"name": "part_number", "type": null, "description": ""}], "created_at": 1789419969.7004929, "supported_languages": null}, "macro.dbt.get_fixture_sql": {"name": "get_fixture_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/unit_test_sql/get_fixture_sql.sql", "original_file_path": "macros/unit_test_sql/get_fixture_sql.sql", "unique_id": "macro.dbt.get_fixture_sql", "macro_sql": "{% macro get_fixture_sql(rows, column_name_to_data_types) %}\n-- Fixture for {{ model.name }}\n{% set default_row = {} %}\n\n{%- if not column_name_to_data_types -%}\n{#-- Use defer_relation IFF it is available in the manifest and 'this' is missing from the database --#}\n{%- set this_or_defer_relation = defer_relation if (defer_relation and not load_relation(this)) else this -%}\n{%- set columns_in_relation = adapter.get_columns_in_relation(this_or_defer_relation) -%}\n\n{%- set column_name_to_data_types = {} -%}\n{%- set column_name_to_quoted = {} -%}\n{%- for column in columns_in_relation -%}\n\n{#-- This needs to be a case-insensitive comparison --#}\n{%- do column_name_to_data_types.update({column.name|lower: column.data_type}) -%}\n{%- do column_name_to_quoted.update({column.name|lower: column.quoted}) -%}\n{%- endfor -%}\n{%- endif -%}\n\n{%- if not column_name_to_data_types -%}\n {{ exceptions.raise_compiler_error(\"Not able to get columns for unit test '\" ~ model.name ~ \"' from relation \" ~ this ~ \" because the relation doesn't exist\") }}\n{%- endif -%}\n\n{%- for column_name, column_type in column_name_to_data_types.items() -%}\n {%- do default_row.update({column_name: (safe_cast(\"null\", column_type) | trim )}) -%}\n{%- endfor -%}\n\n{{ validate_fixture_rows(rows, row_number) }}\n\n{%- for row in rows -%}\n{%- set formatted_row = format_row(row, column_name_to_data_types) -%}\n{%- set default_row_copy = default_row.copy() -%}\n{%- do default_row_copy.update(formatted_row) -%}\nselect\n{%- for column_name, column_value in default_row_copy.items() %} {{ column_value }} as {{ column_name_to_quoted[column_name] }}{% if not loop.last -%}, {%- endif %}\n{%- endfor %}\n{%- if not loop.last %}\nunion all\n{% endif %}\n{%- endfor -%}\n\n{%- if (rows | length) == 0 -%}\n select\n {%- for column_name, column_value in default_row.items() %} {{ column_value }} as {{ column_name_to_quoted[column_name] }}{% if not loop.last -%},{%- endif %}\n {%- endfor %}\n limit 0\n{%- endif -%}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.load_relation", "macro.dbt.safe_cast", "macro.dbt.validate_fixture_rows", "macro.dbt.format_row"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "rows", "type": null, "description": ""}, {"name": "column_name_to_data_types", "type": null, "description": ""}], "created_at": 1789419969.7050138, "supported_languages": null}, "macro.dbt.get_expected_sql": {"name": "get_expected_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/unit_test_sql/get_fixture_sql.sql", "original_file_path": "macros/unit_test_sql/get_fixture_sql.sql", "unique_id": "macro.dbt.get_expected_sql", "macro_sql": "{% macro get_expected_sql(rows, column_name_to_data_types, column_name_to_quoted) %}\n\n{%- if (rows | length) == 0 -%}\n select * from dbt_internal_unit_test_actual\n limit 0\n{%- else -%}\n{%- for row in rows -%}\n{%- set formatted_row = format_row(row, column_name_to_data_types) -%}\nselect\n{%- for column_name, column_value in formatted_row.items() %} {{ column_value }} as {{ column_name_to_quoted[column_name] }}{% if not loop.last -%}, {%- endif %}\n{%- endfor %}\n{%- if not loop.last %}\nunion all\n{% endif %}\n{%- endfor -%}\n{%- endif -%}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.format_row"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "rows", "type": null, "description": ""}, {"name": "column_name_to_data_types", "type": null, "description": ""}, {"name": "column_name_to_quoted", "type": null, "description": ""}], "created_at": 1789419969.7063153, "supported_languages": null}, "macro.dbt.format_row": {"name": "format_row", "resource_type": "macro", "package_name": "dbt", "path": "macros/unit_test_sql/get_fixture_sql.sql", "original_file_path": "macros/unit_test_sql/get_fixture_sql.sql", "unique_id": "macro.dbt.format_row", "macro_sql": "\n\n{%- macro format_row(row, column_name_to_data_types) -%}\n {#-- generate case-insensitive formatted row --#}\n {% set formatted_row = {} %}\n {%- for column_name, column_value in row.items() -%}\n {% set column_name = column_name|lower %}\n\n {%- if column_name not in column_name_to_data_types %}\n {#-- if user-provided row contains column name that relation does not contain, raise an error --#}\n {% set fixture_name = \"expected output\" if model.resource_type == 'unit_test' else (\"'\" ~ model.name ~ \"'\") %}\n {{ exceptions.raise_compiler_error(\n \"Invalid column name: '\" ~ column_name ~ \"' in unit test fixture for \" ~ fixture_name ~ \".\"\n \"\\nAccepted columns for \" ~ fixture_name ~ \" are: \" ~ (column_name_to_data_types.keys()|list)\n ) }}\n {%- endif -%}\n\n {%- set column_type = column_name_to_data_types[column_name] %}\n\n {#-- For string fixture values, strip varchar length to prevent silent truncation (GH-11974) --#}\n {%- if column_value is string and 'varying' in column_type -%}\n {%- set column_type = column_type.split('(')[0] -%}\n {%- endif -%}\n\n {#-- sanitize column_value: wrap yaml strings in quotes, apply cast --#}\n {%- set column_value_clean = column_value -%}\n {%- if column_value is string -%}\n {%- set column_value_clean = dbt.string_literal(dbt.escape_single_quotes(column_value)) -%}\n {%- elif column_value is none -%}\n {%- set column_value_clean = 'null' -%}\n {%- endif -%}\n\n {%- set row_update = {column_name: safe_cast(column_value_clean, column_type) } -%}\n {%- do formatted_row.update(row_update) -%}\n {%- endfor -%}\n {{ return(formatted_row) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt.string_literal", "macro.dbt.escape_single_quotes", "macro.dbt.safe_cast"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "row", "type": null, "description": ""}, {"name": "column_name_to_data_types", "type": null, "description": ""}], "created_at": 1789419969.708449, "supported_languages": null}, "macro.dbt.validate_fixture_rows": {"name": "validate_fixture_rows", "resource_type": "macro", "package_name": "dbt", "path": "macros/unit_test_sql/get_fixture_sql.sql", "original_file_path": "macros/unit_test_sql/get_fixture_sql.sql", "unique_id": "macro.dbt.validate_fixture_rows", "macro_sql": "{%- macro validate_fixture_rows(rows, row_number) -%}\n {{ return(adapter.dispatch('validate_fixture_rows', 'dbt')(rows, row_number)) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt.default__validate_fixture_rows"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "rows", "type": null, "description": ""}, {"name": "row_number", "type": null, "description": ""}], "created_at": 1789419969.7088354, "supported_languages": null}, "macro.dbt.default__validate_fixture_rows": {"name": "default__validate_fixture_rows", "resource_type": "macro", "package_name": "dbt", "path": "macros/unit_test_sql/get_fixture_sql.sql", "original_file_path": "macros/unit_test_sql/get_fixture_sql.sql", "unique_id": "macro.dbt.default__validate_fixture_rows", "macro_sql": "{%- macro default__validate_fixture_rows(rows, row_number) -%}\n {# This is an abstract method for adapter overrides as needed #}\n{%- endmacro -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "rows", "type": null, "description": ""}, {"name": "row_number", "type": null, "description": ""}], "created_at": 1789419969.709003, "supported_languages": null}, "macro.dbt.get_create_sql": {"name": "get_create_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/create.sql", "original_file_path": "macros/relations/create.sql", "unique_id": "macro.dbt.get_create_sql", "macro_sql": "{%- macro get_create_sql(relation, sql) -%}\n {{- log('Applying CREATE to: ' ~ relation) -}}\n {{- adapter.dispatch('get_create_sql', 'dbt')(relation, sql) -}}\n{%- endmacro -%}\n\n\n", "depends_on": {"macros": ["macro.dbt.default__get_create_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "sql", "type": null, "description": ""}], "created_at": 1789419969.7096822, "supported_languages": null}, "macro.dbt.default__get_create_sql": {"name": "default__get_create_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/create.sql", "original_file_path": "macros/relations/create.sql", "unique_id": "macro.dbt.default__get_create_sql", "macro_sql": "{%- macro default__get_create_sql(relation, sql) -%}\n\n {%- if relation.is_view -%}\n {{ get_create_view_as_sql(relation, sql) }}\n\n {%- elif relation.is_table -%}\n {{ get_create_table_as_sql(False, relation, sql) }}\n\n {%- elif relation.is_materialized_view -%}\n {{ get_create_materialized_view_as_sql(relation, sql) }}\n\n {%- else -%}\n {{- exceptions.raise_compiler_error(\"`get_create_sql` has not been implemented for: \" ~ relation.type ) -}}\n\n {%- endif -%}\n\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt.get_create_view_as_sql", "macro.dbt.get_create_table_as_sql", "macro.dbt.get_create_materialized_view_as_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "sql", "type": null, "description": ""}], "created_at": 1789419969.7104392, "supported_languages": null}, "macro.dbt.drop_schema_named": {"name": "drop_schema_named", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/schema.sql", "original_file_path": "macros/relations/schema.sql", "unique_id": "macro.dbt.drop_schema_named", "macro_sql": "{% macro drop_schema_named(schema_name) %}\n {{ return(adapter.dispatch('drop_schema_named', 'dbt') (schema_name)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__drop_schema_named"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "schema_name", "type": null, "description": ""}], "created_at": 1789419969.7109118, "supported_languages": null}, "macro.dbt.default__drop_schema_named": {"name": "default__drop_schema_named", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/schema.sql", "original_file_path": "macros/relations/schema.sql", "unique_id": "macro.dbt.default__drop_schema_named", "macro_sql": "{% macro default__drop_schema_named(schema_name) %}\n {% set schema_relation = api.Relation.create(schema=schema_name) %}\n {{ adapter.drop_schema(schema_relation) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "schema_name", "type": null, "description": ""}], "created_at": 1789419969.7112796, "supported_languages": null}, "macro.dbt.get_create_intermediate_sql": {"name": "get_create_intermediate_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/create_intermediate.sql", "original_file_path": "macros/relations/create_intermediate.sql", "unique_id": "macro.dbt.get_create_intermediate_sql", "macro_sql": "{%- macro get_create_intermediate_sql(relation, sql) -%}\n {{- log('Applying CREATE INTERMEDIATE to: ' ~ relation) -}}\n {{- adapter.dispatch('get_create_intermediate_sql', 'dbt')(relation, sql) -}}\n{%- endmacro -%}\n\n\n", "depends_on": {"macros": ["macro.dbt.default__get_create_intermediate_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "sql", "type": null, "description": ""}], "created_at": 1789419969.7118554, "supported_languages": null}, "macro.dbt.default__get_create_intermediate_sql": {"name": "default__get_create_intermediate_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/create_intermediate.sql", "original_file_path": "macros/relations/create_intermediate.sql", "unique_id": "macro.dbt.default__get_create_intermediate_sql", "macro_sql": "{%- macro default__get_create_intermediate_sql(relation, sql) -%}\n\n -- get the standard intermediate name\n {% set intermediate_relation = make_intermediate_relation(relation) %}\n\n -- drop any pre-existing intermediate\n {{ get_drop_sql(intermediate_relation) }};\n\n {{ get_create_sql(intermediate_relation, sql) }}\n\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt.make_intermediate_relation", "macro.dbt.get_drop_sql", "macro.dbt.get_create_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "sql", "type": null, "description": ""}], "created_at": 1789419969.712286, "supported_languages": null}, "macro.dbt.get_drop_backup_sql": {"name": "get_drop_backup_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/drop_backup.sql", "original_file_path": "macros/relations/drop_backup.sql", "unique_id": "macro.dbt.get_drop_backup_sql", "macro_sql": "{%- macro get_drop_backup_sql(relation) -%}\n {{- log('Applying DROP BACKUP to: ' ~ relation) -}}\n {{- adapter.dispatch('get_drop_backup_sql', 'dbt')(relation) -}}\n{%- endmacro -%}\n\n\n", "depends_on": {"macros": ["macro.dbt.default__get_drop_backup_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789419969.7128158, "supported_languages": null}, "macro.dbt.default__get_drop_backup_sql": {"name": "default__get_drop_backup_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/drop_backup.sql", "original_file_path": "macros/relations/drop_backup.sql", "unique_id": "macro.dbt.default__get_drop_backup_sql", "macro_sql": "{%- macro default__get_drop_backup_sql(relation) -%}\n\n -- get the standard backup name\n {% set backup_relation = make_backup_relation(relation, relation.type) %}\n\n {{ get_drop_sql(backup_relation) }}\n\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt.make_backup_relation", "macro.dbt.get_drop_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789419969.7131705, "supported_languages": null}, "macro.dbt.get_rename_sql": {"name": "get_rename_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/rename.sql", "original_file_path": "macros/relations/rename.sql", "unique_id": "macro.dbt.get_rename_sql", "macro_sql": "{%- macro get_rename_sql(relation, new_name) -%}\n {{- log('Applying RENAME to: ' ~ relation) -}}\n {{- adapter.dispatch('get_rename_sql', 'dbt')(relation, new_name) -}}\n{%- endmacro -%}\n\n\n", "depends_on": {"macros": ["macro.dbt.default__get_rename_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "new_name", "type": null, "description": ""}], "created_at": 1789419969.713961, "supported_languages": null}, "macro.dbt.default__get_rename_sql": {"name": "default__get_rename_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/rename.sql", "original_file_path": "macros/relations/rename.sql", "unique_id": "macro.dbt.default__get_rename_sql", "macro_sql": "{%- macro default__get_rename_sql(relation, new_name) -%}\n\n {%- if relation.is_view -%}\n {{ get_rename_view_sql(relation, new_name) }}\n\n {%- elif relation.is_table -%}\n {{ get_rename_table_sql(relation, new_name) }}\n\n {%- elif relation.is_materialized_view -%}\n {{ get_rename_materialized_view_sql(relation, new_name) }}\n\n {%- else -%}\n {{- exceptions.raise_compiler_error(\"`get_rename_sql` has not been implemented for: \" ~ relation.type ) -}}\n\n {%- endif -%}\n\n{%- endmacro -%}\n\n\n", "depends_on": {"macros": ["macro.dbt.get_rename_view_sql", "macro.dbt.get_rename_table_sql", "macro.dbt.get_rename_materialized_view_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "new_name", "type": null, "description": ""}], "created_at": 1789419969.7146962, "supported_languages": null}, "macro.dbt.rename_relation": {"name": "rename_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/rename.sql", "original_file_path": "macros/relations/rename.sql", "unique_id": "macro.dbt.rename_relation", "macro_sql": "{% macro rename_relation(from_relation, to_relation) -%}\n {{ return(adapter.dispatch('rename_relation', 'dbt')(from_relation, to_relation)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__rename_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "from_relation", "type": null, "description": ""}, {"name": "to_relation", "type": null, "description": ""}], "created_at": 1789419969.7150657, "supported_languages": null}, "macro.dbt.default__rename_relation": {"name": "default__rename_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/rename.sql", "original_file_path": "macros/relations/rename.sql", "unique_id": "macro.dbt.default__rename_relation", "macro_sql": "{% macro default__rename_relation(from_relation, to_relation) -%}\n {% set target_name = adapter.quote_as_configured(to_relation.identifier, 'identifier') %}\n {% call statement('rename_relation') -%}\n alter table {{ from_relation.render() }} rename to {{ target_name }}\n {%- endcall %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "from_relation", "type": null, "description": ""}, {"name": "to_relation", "type": null, "description": ""}], "created_at": 1789419969.7155674, "supported_languages": null}, "macro.dbt.get_drop_sql": {"name": "get_drop_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/drop.sql", "original_file_path": "macros/relations/drop.sql", "unique_id": "macro.dbt.get_drop_sql", "macro_sql": "{%- macro get_drop_sql(relation) -%}\n {{- log('Applying DROP to: ' ~ relation) -}}\n {{- adapter.dispatch('get_drop_sql', 'dbt')(relation) -}}\n{%- endmacro -%}\n\n\n", "depends_on": {"macros": ["macro.dbt.default__get_drop_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789419969.7163553, "supported_languages": null}, "macro.dbt.default__get_drop_sql": {"name": "default__get_drop_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/drop.sql", "original_file_path": "macros/relations/drop.sql", "unique_id": "macro.dbt.default__get_drop_sql", "macro_sql": "{%- macro default__get_drop_sql(relation) -%}\n\n {%- if relation.is_view -%}\n {{ drop_view(relation) }}\n\n {%- elif relation.is_table -%}\n {{ drop_table(relation) }}\n\n {%- elif relation.is_materialized_view -%}\n {{ drop_materialized_view(relation) }}\n\n {%- else -%}\n drop {{ relation.type }} if exists {{ relation.render() }} cascade\n\n {%- endif -%}\n\n{%- endmacro -%}\n\n\n", "depends_on": {"macros": ["macro.dbt.drop_view", "macro.dbt.drop_table", "macro.dbt.drop_materialized_view"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789419969.717155, "supported_languages": null}, "macro.dbt.drop_relation": {"name": "drop_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/drop.sql", "original_file_path": "macros/relations/drop.sql", "unique_id": "macro.dbt.drop_relation", "macro_sql": "{% macro drop_relation(relation) -%}\n {{ return(adapter.dispatch('drop_relation', 'dbt')(relation)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__drop_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789419969.71747, "supported_languages": null}, "macro.dbt.default__drop_relation": {"name": "default__drop_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/drop.sql", "original_file_path": "macros/relations/drop.sql", "unique_id": "macro.dbt.default__drop_relation", "macro_sql": "{% macro default__drop_relation(relation) -%}\n {% call statement('drop_relation', auto_begin=False) -%}\n {{ get_drop_sql(relation) }}\n {%- endcall %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement", "macro.dbt.get_drop_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789419969.7178218, "supported_languages": null}, "macro.dbt.drop_relation_if_exists": {"name": "drop_relation_if_exists", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/drop.sql", "original_file_path": "macros/relations/drop.sql", "unique_id": "macro.dbt.drop_relation_if_exists", "macro_sql": "{% macro drop_relation_if_exists(relation) %}\n {% if relation is not none %}\n {{ adapter.drop_relation(relation) }}\n {% endif %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789419969.718146, "supported_languages": null}, "macro.dbt.get_rename_intermediate_sql": {"name": "get_rename_intermediate_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/rename_intermediate.sql", "original_file_path": "macros/relations/rename_intermediate.sql", "unique_id": "macro.dbt.get_rename_intermediate_sql", "macro_sql": "{%- macro get_rename_intermediate_sql(relation) -%}\n {{- log('Applying RENAME INTERMEDIATE to: ' ~ relation) -}}\n {{- adapter.dispatch('get_rename_intermediate_sql', 'dbt')(relation) -}}\n{%- endmacro -%}\n\n\n", "depends_on": {"macros": ["macro.dbt.default__get_rename_intermediate_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789419969.718669, "supported_languages": null}, "macro.dbt.default__get_rename_intermediate_sql": {"name": "default__get_rename_intermediate_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/rename_intermediate.sql", "original_file_path": "macros/relations/rename_intermediate.sql", "unique_id": "macro.dbt.default__get_rename_intermediate_sql", "macro_sql": "{%- macro default__get_rename_intermediate_sql(relation) -%}\n\n -- get the standard intermediate name\n {% set intermediate_relation = make_intermediate_relation(relation) %}\n\n {{ get_rename_sql(intermediate_relation, relation.identifier) }}\n\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt.make_intermediate_relation", "macro.dbt.get_rename_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789419969.7190359, "supported_languages": null}, "macro.dbt.get_replace_sql": {"name": "get_replace_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/replace.sql", "original_file_path": "macros/relations/replace.sql", "unique_id": "macro.dbt.get_replace_sql", "macro_sql": "{% macro get_replace_sql(existing_relation, target_relation, sql) %}\n {{- log('Applying REPLACE to: ' ~ existing_relation) -}}\n {{- adapter.dispatch('get_replace_sql', 'dbt')(existing_relation, target_relation, sql) -}}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_replace_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "existing_relation", "type": null, "description": ""}, {"name": "target_relation", "type": null, "description": ""}, {"name": "sql", "type": null, "description": ""}], "created_at": 1789419969.719966, "supported_languages": null}, "macro.dbt.default__get_replace_sql": {"name": "default__get_replace_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/replace.sql", "original_file_path": "macros/relations/replace.sql", "unique_id": "macro.dbt.default__get_replace_sql", "macro_sql": "{% macro default__get_replace_sql(existing_relation, target_relation, sql) %}\n\n {# /* use a create or replace statement if possible */ #}\n\n {% set is_replaceable = existing_relation.type == target_relation.type and existing_relation.can_be_replaced %}\n\n {% if is_replaceable and existing_relation.is_view %}\n {{ get_replace_view_sql(target_relation, sql) }}\n\n {% elif is_replaceable and existing_relation.is_table %}\n {{ get_replace_table_sql(target_relation, sql) }}\n\n {% elif is_replaceable and existing_relation.is_materialized_view %}\n {{ get_replace_materialized_view_sql(target_relation, sql) }}\n\n {# /* a create or replace statement is not possible, so try to stage and/or backup to be safe */ #}\n\n {# /* create target_relation as an intermediate relation, then swap it out with the existing one using a backup */ #}\n {%- elif target_relation.can_be_renamed and existing_relation.can_be_renamed -%}\n {{ get_create_intermediate_sql(target_relation, sql) }};\n {{ get_create_backup_sql(existing_relation) }};\n {{ get_rename_intermediate_sql(target_relation) }};\n {{ get_drop_backup_sql(existing_relation) }}\n\n {# /* create target_relation as an intermediate relation, then swap it out with the existing one without using a backup */ #}\n {%- elif target_relation.can_be_renamed -%}\n {{ get_create_intermediate_sql(target_relation, sql) }};\n {{ get_drop_sql(existing_relation) }};\n {{ get_rename_intermediate_sql(target_relation) }}\n\n {# /* create target_relation in place by first backing up the existing relation */ #}\n {%- elif existing_relation.can_be_renamed -%}\n {{ get_create_backup_sql(existing_relation) }};\n {{ get_create_sql(target_relation, sql) }};\n {{ get_drop_backup_sql(existing_relation) }}\n\n {# /* no renaming is allowed, so just drop and create */ #}\n {%- else -%}\n {{ get_drop_sql(existing_relation) }};\n {{ get_create_sql(target_relation, sql) }}\n\n {%- endif -%}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_replace_view_sql", "macro.dbt.get_replace_table_sql", "macro.dbt.get_replace_materialized_view_sql", "macro.dbt.get_create_intermediate_sql", "macro.dbt.get_create_backup_sql", "macro.dbt.get_rename_intermediate_sql", "macro.dbt.get_drop_backup_sql", "macro.dbt.get_drop_sql", "macro.dbt.get_create_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "existing_relation", "type": null, "description": ""}, {"name": "target_relation", "type": null, "description": ""}, {"name": "sql", "type": null, "description": ""}], "created_at": 1789419969.721968, "supported_languages": null}, "macro.dbt.get_create_backup_sql": {"name": "get_create_backup_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/create_backup.sql", "original_file_path": "macros/relations/create_backup.sql", "unique_id": "macro.dbt.get_create_backup_sql", "macro_sql": "{%- macro get_create_backup_sql(relation) -%}\n {{- log('Applying CREATE BACKUP to: ' ~ relation) -}}\n {{- adapter.dispatch('get_create_backup_sql', 'dbt')(relation) -}}\n{%- endmacro -%}\n\n\n", "depends_on": {"macros": ["macro.dbt.default__get_create_backup_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789419969.7225244, "supported_languages": null}, "macro.dbt.default__get_create_backup_sql": {"name": "default__get_create_backup_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/create_backup.sql", "original_file_path": "macros/relations/create_backup.sql", "unique_id": "macro.dbt.default__get_create_backup_sql", "macro_sql": "{%- macro default__get_create_backup_sql(relation) -%}\n\n -- get the standard backup name\n {% set backup_relation = make_backup_relation(relation, relation.type) %}\n\n -- drop any pre-existing backup\n {{ get_drop_sql(backup_relation) }};\n\n {{ get_rename_sql(relation, backup_relation.identifier) }}\n\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt.make_backup_relation", "macro.dbt.get_drop_sql", "macro.dbt.get_rename_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789419969.7229872, "supported_languages": null}, "macro.dbt.get_create_materialized_view_as_sql": {"name": "get_create_materialized_view_as_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/materialized_view/create.sql", "original_file_path": "macros/relations/materialized_view/create.sql", "unique_id": "macro.dbt.get_create_materialized_view_as_sql", "macro_sql": "{% macro get_create_materialized_view_as_sql(relation, sql) -%}\n {{- adapter.dispatch('get_create_materialized_view_as_sql', 'dbt')(relation, sql) -}}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__get_create_materialized_view_as_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "sql", "type": null, "description": ""}], "created_at": 1789419969.723438, "supported_languages": null}, "macro.dbt.default__get_create_materialized_view_as_sql": {"name": "default__get_create_materialized_view_as_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/materialized_view/create.sql", "original_file_path": "macros/relations/materialized_view/create.sql", "unique_id": "macro.dbt.default__get_create_materialized_view_as_sql", "macro_sql": "{% macro default__get_create_materialized_view_as_sql(relation, sql) -%}\n {{ exceptions.raise_compiler_error(\n \"`get_create_materialized_view_as_sql` has not been implemented for this adapter.\"\n ) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "sql", "type": null, "description": ""}], "created_at": 1789419969.7236788, "supported_languages": null}, "macro.dbt.get_alter_materialized_view_as_sql": {"name": "get_alter_materialized_view_as_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/materialized_view/alter.sql", "original_file_path": "macros/relations/materialized_view/alter.sql", "unique_id": "macro.dbt.get_alter_materialized_view_as_sql", "macro_sql": "{% macro get_alter_materialized_view_as_sql(\n relation,\n configuration_changes,\n sql,\n existing_relation,\n backup_relation,\n intermediate_relation\n) %}\n {{- log('Applying ALTER to: ' ~ relation) -}}\n {{- adapter.dispatch('get_alter_materialized_view_as_sql', 'dbt')(\n relation,\n configuration_changes,\n sql,\n existing_relation,\n backup_relation,\n intermediate_relation\n ) -}}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__get_alter_materialized_view_as_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "configuration_changes", "type": null, "description": ""}, {"name": "sql", "type": null, "description": ""}, {"name": "existing_relation", "type": null, "description": ""}, {"name": "backup_relation", "type": null, "description": ""}, {"name": "intermediate_relation", "type": null, "description": ""}], "created_at": 1789419969.724588, "supported_languages": null}, "macro.dbt.default__get_alter_materialized_view_as_sql": {"name": "default__get_alter_materialized_view_as_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/materialized_view/alter.sql", "original_file_path": "macros/relations/materialized_view/alter.sql", "unique_id": "macro.dbt.default__get_alter_materialized_view_as_sql", "macro_sql": "{% macro default__get_alter_materialized_view_as_sql(\n relation,\n configuration_changes,\n sql,\n existing_relation,\n backup_relation,\n intermediate_relation\n) %}\n {{ exceptions.raise_compiler_error(\"Materialized views have not been implemented for this adapter.\") }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "configuration_changes", "type": null, "description": ""}, {"name": "sql", "type": null, "description": ""}, {"name": "existing_relation", "type": null, "description": ""}, {"name": "backup_relation", "type": null, "description": ""}, {"name": "intermediate_relation", "type": null, "description": ""}], "created_at": 1789419969.7249272, "supported_languages": null}, "macro.dbt.get_materialized_view_configuration_changes": {"name": "get_materialized_view_configuration_changes", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/materialized_view/alter.sql", "original_file_path": "macros/relations/materialized_view/alter.sql", "unique_id": "macro.dbt.get_materialized_view_configuration_changes", "macro_sql": "{% macro get_materialized_view_configuration_changes(existing_relation, new_config) %}\n /* {#\n It's recommended that configuration changes be formatted as follows:\n {\"\": [{\"action\": \"\", \"context\": ...}]}\n\n For example:\n {\n \"indexes\": [\n {\"action\": \"drop\", \"context\": \"index_abc\"},\n {\"action\": \"create\", \"context\": {\"columns\": [\"column_1\", \"column_2\"], \"type\": \"hash\", \"unique\": True}},\n ],\n }\n\n Either way, `get_materialized_view_configuration_changes` needs to align with `get_alter_materialized_view_as_sql`.\n #} */\n {{- log('Determining configuration changes on: ' ~ existing_relation) -}}\n {%- do return(adapter.dispatch('get_materialized_view_configuration_changes', 'dbt')(existing_relation, new_config)) -%}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__get_materialized_view_configuration_changes"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "existing_relation", "type": null, "description": ""}, {"name": "new_config", "type": null, "description": ""}], "created_at": 1789419969.7254078, "supported_languages": null}, "macro.dbt.default__get_materialized_view_configuration_changes": {"name": "default__get_materialized_view_configuration_changes", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/materialized_view/alter.sql", "original_file_path": "macros/relations/materialized_view/alter.sql", "unique_id": "macro.dbt.default__get_materialized_view_configuration_changes", "macro_sql": "{% macro default__get_materialized_view_configuration_changes(existing_relation, new_config) %}\n {{ exceptions.raise_compiler_error(\"Materialized views have not been implemented for this adapter.\") }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "existing_relation", "type": null, "description": ""}, {"name": "new_config", "type": null, "description": ""}], "created_at": 1789419969.7256496, "supported_languages": null}, "macro.dbt.get_rename_materialized_view_sql": {"name": "get_rename_materialized_view_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/materialized_view/rename.sql", "original_file_path": "macros/relations/materialized_view/rename.sql", "unique_id": "macro.dbt.get_rename_materialized_view_sql", "macro_sql": "{% macro get_rename_materialized_view_sql(relation, new_name) %}\n {{- adapter.dispatch('get_rename_materialized_view_sql', 'dbt')(relation, new_name) -}}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__get_rename_materialized_view_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "new_name", "type": null, "description": ""}], "created_at": 1789419969.726123, "supported_languages": null}, "macro.dbt.default__get_rename_materialized_view_sql": {"name": "default__get_rename_materialized_view_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/materialized_view/rename.sql", "original_file_path": "macros/relations/materialized_view/rename.sql", "unique_id": "macro.dbt.default__get_rename_materialized_view_sql", "macro_sql": "{% macro default__get_rename_materialized_view_sql(relation, new_name) %}\n {{ exceptions.raise_compiler_error(\n \"`get_rename_materialized_view_sql` has not been implemented for this adapter.\"\n ) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "new_name", "type": null, "description": ""}], "created_at": 1789419969.726489, "supported_languages": null}, "macro.dbt.refresh_materialized_view": {"name": "refresh_materialized_view", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/materialized_view/refresh.sql", "original_file_path": "macros/relations/materialized_view/refresh.sql", "unique_id": "macro.dbt.refresh_materialized_view", "macro_sql": "{% macro refresh_materialized_view(relation) %}\n {{- log('Applying REFRESH to: ' ~ relation) -}}\n {{- adapter.dispatch('refresh_materialized_view', 'dbt')(relation) -}}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__refresh_materialized_view"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789419969.7270083, "supported_languages": null}, "macro.dbt.default__refresh_materialized_view": {"name": "default__refresh_materialized_view", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/materialized_view/refresh.sql", "original_file_path": "macros/relations/materialized_view/refresh.sql", "unique_id": "macro.dbt.default__refresh_materialized_view", "macro_sql": "{% macro default__refresh_materialized_view(relation) %}\n {{ exceptions.raise_compiler_error(\"`refresh_materialized_view` has not been implemented for this adapter.\") }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789419969.727234, "supported_languages": null}, "macro.dbt.drop_materialized_view": {"name": "drop_materialized_view", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/materialized_view/drop.sql", "original_file_path": "macros/relations/materialized_view/drop.sql", "unique_id": "macro.dbt.drop_materialized_view", "macro_sql": "{% macro drop_materialized_view(relation) -%}\n {{- adapter.dispatch('drop_materialized_view', 'dbt')(relation) -}}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__drop_materialized_view"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789419969.7276456, "supported_languages": null}, "macro.dbt.default__drop_materialized_view": {"name": "default__drop_materialized_view", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/materialized_view/drop.sql", "original_file_path": "macros/relations/materialized_view/drop.sql", "unique_id": "macro.dbt.default__drop_materialized_view", "macro_sql": "{% macro default__drop_materialized_view(relation) -%}\n drop materialized view if exists {{ relation.render() }} cascade\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789419969.727871, "supported_languages": null}, "macro.dbt.get_replace_materialized_view_sql": {"name": "get_replace_materialized_view_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/materialized_view/replace.sql", "original_file_path": "macros/relations/materialized_view/replace.sql", "unique_id": "macro.dbt.get_replace_materialized_view_sql", "macro_sql": "{% macro get_replace_materialized_view_sql(relation, sql) %}\n {{- adapter.dispatch('get_replace_materialized_view_sql', 'dbt')(relation, sql) -}}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_replace_materialized_view_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "sql", "type": null, "description": ""}], "created_at": 1789419969.7283099, "supported_languages": null}, "macro.dbt.default__get_replace_materialized_view_sql": {"name": "default__get_replace_materialized_view_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/materialized_view/replace.sql", "original_file_path": "macros/relations/materialized_view/replace.sql", "unique_id": "macro.dbt.default__get_replace_materialized_view_sql", "macro_sql": "{% macro default__get_replace_materialized_view_sql(relation, sql) %}\n {{ exceptions.raise_compiler_error(\n \"`get_replace_materialized_view_sql` has not been implemented for this adapter.\"\n ) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "sql", "type": null, "description": ""}], "created_at": 1789419969.7285535, "supported_languages": null}, "macro.dbt.get_create_view_as_sql": {"name": "get_create_view_as_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/view/create.sql", "original_file_path": "macros/relations/view/create.sql", "unique_id": "macro.dbt.get_create_view_as_sql", "macro_sql": "{% macro get_create_view_as_sql(relation, sql) -%}\n {{ adapter.dispatch('get_create_view_as_sql', 'dbt')(relation, sql) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_create_view_as_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "sql", "type": null, "description": ""}], "created_at": 1789419969.7291777, "supported_languages": null}, "macro.dbt.default__get_create_view_as_sql": {"name": "default__get_create_view_as_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/view/create.sql", "original_file_path": "macros/relations/view/create.sql", "unique_id": "macro.dbt.default__get_create_view_as_sql", "macro_sql": "{% macro default__get_create_view_as_sql(relation, sql) -%}\n {{ return(create_view_as(relation, sql)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.create_view_as"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "sql", "type": null, "description": ""}], "created_at": 1789419969.7294936, "supported_languages": null}, "macro.dbt.create_view_as": {"name": "create_view_as", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/view/create.sql", "original_file_path": "macros/relations/view/create.sql", "unique_id": "macro.dbt.create_view_as", "macro_sql": "{% macro create_view_as(relation, sql) -%}\n {{ adapter.dispatch('create_view_as', 'dbt')(relation, sql) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__create_view_as"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "sql", "type": null, "description": ""}], "created_at": 1789419969.7298527, "supported_languages": null}, "macro.dbt.default__create_view_as": {"name": "default__create_view_as", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/view/create.sql", "original_file_path": "macros/relations/view/create.sql", "unique_id": "macro.dbt.default__create_view_as", "macro_sql": "{% macro default__create_view_as(relation, sql) -%}\n {%- set sql_header = config.get('sql_header', none) -%}\n\n {{ sql_header if sql_header is not none }}\n create view {{ relation.render() }}\n {% set contract_config = config.get('contract') %}\n {% if contract_config.enforced %}\n {{ get_assert_columns_equivalent(sql) }}\n {%- endif %}\n as (\n {{ sql }}\n );\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.get_assert_columns_equivalent"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "sql", "type": null, "description": ""}], "created_at": 1789419969.7306013, "supported_languages": null}, "macro.dbt.get_rename_view_sql": {"name": "get_rename_view_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/view/rename.sql", "original_file_path": "macros/relations/view/rename.sql", "unique_id": "macro.dbt.get_rename_view_sql", "macro_sql": "{% macro get_rename_view_sql(relation, new_name) %}\n {{- adapter.dispatch('get_rename_view_sql', 'dbt')(relation, new_name) -}}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__get_rename_view_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "new_name", "type": null, "description": ""}], "created_at": 1789419969.731083, "supported_languages": null}, "macro.dbt.default__get_rename_view_sql": {"name": "default__get_rename_view_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/view/rename.sql", "original_file_path": "macros/relations/view/rename.sql", "unique_id": "macro.dbt.default__get_rename_view_sql", "macro_sql": "{% macro default__get_rename_view_sql(relation, new_name) %}\n {{ exceptions.raise_compiler_error(\n \"`get_rename_view_sql` has not been implemented for this adapter.\"\n ) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "new_name", "type": null, "description": ""}], "created_at": 1789419969.7313294, "supported_languages": null}, "macro.dbt.drop_view": {"name": "drop_view", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/view/drop.sql", "original_file_path": "macros/relations/view/drop.sql", "unique_id": "macro.dbt.drop_view", "macro_sql": "{% macro drop_view(relation) -%}\n {{- adapter.dispatch('drop_view', 'dbt')(relation) -}}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__drop_view"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789419969.7317321, "supported_languages": null}, "macro.dbt.default__drop_view": {"name": "default__drop_view", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/view/drop.sql", "original_file_path": "macros/relations/view/drop.sql", "unique_id": "macro.dbt.default__drop_view", "macro_sql": "{% macro default__drop_view(relation) -%}\n drop view if exists {{ relation.render() }} cascade\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789419969.7319567, "supported_languages": null}, "macro.dbt.get_replace_view_sql": {"name": "get_replace_view_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/view/replace.sql", "original_file_path": "macros/relations/view/replace.sql", "unique_id": "macro.dbt.get_replace_view_sql", "macro_sql": "{% macro get_replace_view_sql(relation, sql) %}\n {{- adapter.dispatch('get_replace_view_sql', 'dbt')(relation, sql) -}}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__get_replace_view_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "sql", "type": null, "description": ""}], "created_at": 1789419969.732838, "supported_languages": null}, "macro.dbt.default__get_replace_view_sql": {"name": "default__get_replace_view_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/view/replace.sql", "original_file_path": "macros/relations/view/replace.sql", "unique_id": "macro.dbt.default__get_replace_view_sql", "macro_sql": "{% macro default__get_replace_view_sql(relation, sql) %}\n {{ exceptions.raise_compiler_error(\n \"`get_replace_view_sql` has not been implemented for this adapter.\"\n ) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "sql", "type": null, "description": ""}], "created_at": 1789419969.7332017, "supported_languages": null}, "macro.dbt.create_or_replace_view": {"name": "create_or_replace_view", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/view/replace.sql", "original_file_path": "macros/relations/view/replace.sql", "unique_id": "macro.dbt.create_or_replace_view", "macro_sql": "{% macro create_or_replace_view() %}\n {%- set identifier = model['alias'] -%}\n\n {%- set old_relation = adapter.get_relation(database=database, schema=schema, identifier=identifier) -%}\n {%- set exists_as_view = (old_relation is not none and old_relation.is_view) -%}\n\n {%- set target_relation = api.Relation.create(\n identifier=identifier, schema=schema, database=database,\n type='view') -%}\n {% set grant_config = config.get('grants') %}\n\n {{ run_hooks(pre_hooks) }}\n\n -- If there's a table with the same name and we weren't told to full refresh,\n -- that's an error. If we were told to full refresh, drop it. This behavior differs\n -- for Snowflake and BigQuery, so multiple dispatch is used.\n {%- if old_relation is not none and old_relation.is_table -%}\n {{ handle_existing_table(should_full_refresh(), old_relation) }}\n {%- endif -%}\n\n -- build model\n {% call statement('main') -%}\n {{ get_create_view_as_sql(target_relation, sql) }}\n {%- endcall %}\n\n {% set should_revoke = should_revoke(exists_as_view, full_refresh_mode=True) %}\n {% do apply_grants(target_relation, grant_config, should_revoke=should_revoke) %}\n\n {{ run_hooks(post_hooks) }}\n\n {{ return({'relations': [target_relation]}) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.run_hooks", "macro.dbt.handle_existing_table", "macro.dbt.should_full_refresh", "macro.dbt.statement", "macro.dbt.get_create_view_as_sql", "macro.dbt.should_revoke", "macro.dbt.apply_grants"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789419969.7350934, "supported_languages": null}, "macro.dbt.handle_existing_table": {"name": "handle_existing_table", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/view/replace.sql", "original_file_path": "macros/relations/view/replace.sql", "unique_id": "macro.dbt.handle_existing_table", "macro_sql": "{% macro handle_existing_table(full_refresh, old_relation) %}\n {{ adapter.dispatch('handle_existing_table', 'dbt')(full_refresh, old_relation) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__handle_existing_table"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "full_refresh", "type": null, "description": ""}, {"name": "old_relation", "type": null, "description": ""}], "created_at": 1789419969.735429, "supported_languages": null}, "macro.dbt.default__handle_existing_table": {"name": "default__handle_existing_table", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/view/replace.sql", "original_file_path": "macros/relations/view/replace.sql", "unique_id": "macro.dbt.default__handle_existing_table", "macro_sql": "{% macro default__handle_existing_table(full_refresh, old_relation) %}\n {{ log(\"Dropping relation \" ~ old_relation.render() ~ \" because it is of type \" ~ old_relation.type) }}\n {{ adapter.drop_relation(old_relation) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "full_refresh", "type": null, "description": ""}, {"name": "old_relation", "type": null, "description": ""}], "created_at": 1789419969.7358475, "supported_languages": null}, "macro.dbt.get_table_columns_and_constraints": {"name": "get_table_columns_and_constraints", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/column/columns_spec_ddl.sql", "original_file_path": "macros/relations/column/columns_spec_ddl.sql", "unique_id": "macro.dbt.get_table_columns_and_constraints", "macro_sql": "{%- macro get_table_columns_and_constraints() -%}\n {{ adapter.dispatch('get_table_columns_and_constraints', 'dbt')() }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt.default__get_table_columns_and_constraints"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789419969.7372105, "supported_languages": null}, "macro.dbt.default__get_table_columns_and_constraints": {"name": "default__get_table_columns_and_constraints", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/column/columns_spec_ddl.sql", "original_file_path": "macros/relations/column/columns_spec_ddl.sql", "unique_id": "macro.dbt.default__get_table_columns_and_constraints", "macro_sql": "{% macro default__get_table_columns_and_constraints() -%}\n {{ return(table_columns_and_constraints()) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.table_columns_and_constraints"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789419969.7374206, "supported_languages": null}, "macro.dbt.table_columns_and_constraints": {"name": "table_columns_and_constraints", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/column/columns_spec_ddl.sql", "original_file_path": "macros/relations/column/columns_spec_ddl.sql", "unique_id": "macro.dbt.table_columns_and_constraints", "macro_sql": "{% macro table_columns_and_constraints() %}\n {# loop through user_provided_columns to create DDL with data types and constraints #}\n {%- set raw_column_constraints = adapter.render_raw_columns_constraints(raw_columns=model['columns']) -%}\n {%- set raw_model_constraints = adapter.render_raw_model_constraints(raw_constraints=model['constraints']) -%}\n (\n {% for c in raw_column_constraints -%}\n {{ c }}{{ \",\" if not loop.last or raw_model_constraints }}\n {% endfor %}\n {% for c in raw_model_constraints -%}\n {{ c }}{{ \",\" if not loop.last }}\n {% endfor -%}\n )\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789419969.7383256, "supported_languages": null}, "macro.dbt.get_assert_columns_equivalent": {"name": "get_assert_columns_equivalent", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/column/columns_spec_ddl.sql", "original_file_path": "macros/relations/column/columns_spec_ddl.sql", "unique_id": "macro.dbt.get_assert_columns_equivalent", "macro_sql": "\n\n{%- macro get_assert_columns_equivalent(sql) -%}\n {{ adapter.dispatch('get_assert_columns_equivalent', 'dbt')(sql) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt.default__get_assert_columns_equivalent"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "sql", "type": null, "description": ""}], "created_at": 1789419969.7386127, "supported_languages": null}, "macro.dbt.default__get_assert_columns_equivalent": {"name": "default__get_assert_columns_equivalent", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/column/columns_spec_ddl.sql", "original_file_path": "macros/relations/column/columns_spec_ddl.sql", "unique_id": "macro.dbt.default__get_assert_columns_equivalent", "macro_sql": "{% macro default__get_assert_columns_equivalent(sql) -%}\n {{ return(assert_columns_equivalent(sql)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.assert_columns_equivalent"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "sql", "type": null, "description": ""}], "created_at": 1789419969.7388546, "supported_languages": null}, "macro.dbt.assert_columns_equivalent": {"name": "assert_columns_equivalent", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/column/columns_spec_ddl.sql", "original_file_path": "macros/relations/column/columns_spec_ddl.sql", "unique_id": "macro.dbt.assert_columns_equivalent", "macro_sql": "{% macro assert_columns_equivalent(sql) %}\n\n {#-- First ensure the user has defined 'columns' in yaml specification --#}\n {%- set user_defined_columns = model['columns'] -%}\n {%- if not user_defined_columns -%}\n {{ exceptions.raise_contract_error([], []) }}\n {%- endif -%}\n\n {#-- Obtain the column schema provided by sql file. #}\n {%- set sql_file_provided_columns = get_column_schema_from_query(sql, config.get('sql_header', none)) -%}\n {#--Obtain the column schema provided by the schema file by generating an 'empty schema' query from the model's columns. #}\n {%- set schema_file_provided_columns = get_column_schema_from_query(get_empty_schema_sql(user_defined_columns)) -%}\n\n {#-- create dictionaries with name and formatted data type and strings for exception #}\n {%- set sql_columns = format_columns(sql_file_provided_columns) -%}\n {%- set yaml_columns = format_columns(schema_file_provided_columns) -%}\n\n {%- if sql_columns|length != yaml_columns|length -%}\n {%- do exceptions.raise_contract_error(yaml_columns, sql_columns) -%}\n {%- endif -%}\n\n {%- for sql_col in sql_columns -%}\n {%- set yaml_col = [] -%}\n {%- for this_col in yaml_columns -%}\n {%- if this_col['name'] == sql_col['name'] -%}\n {%- do yaml_col.append(this_col) -%}\n {%- break -%}\n {%- endif -%}\n {%- endfor -%}\n {%- if not yaml_col -%}\n {#-- Column with name not found in yaml #}\n {%- do exceptions.raise_contract_error(yaml_columns, sql_columns) -%}\n {%- endif -%}\n {%- if sql_col['formatted'] != yaml_col[0]['formatted'] -%}\n {#-- Column data types don't match #}\n {%- do exceptions.raise_contract_error(yaml_columns, sql_columns) -%}\n {%- endif -%}\n {%- endfor -%}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_column_schema_from_query", "macro.dbt.get_empty_schema_sql", "macro.dbt.format_columns"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "sql", "type": null, "description": ""}], "created_at": 1789419969.7409651, "supported_languages": null}, "macro.dbt.format_columns": {"name": "format_columns", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/column/columns_spec_ddl.sql", "original_file_path": "macros/relations/column/columns_spec_ddl.sql", "unique_id": "macro.dbt.format_columns", "macro_sql": "{% macro format_columns(columns) %}\n {% set formatted_columns = [] %}\n {% for column in columns %}\n {%- set formatted_column = adapter.dispatch('format_column', 'dbt')(column) -%}\n {%- do formatted_columns.append(formatted_column) -%}\n {% endfor %}\n {{ return(formatted_columns) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__format_column"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "columns", "type": null, "description": ""}], "created_at": 1789419969.741598, "supported_languages": null}, "macro.dbt.default__format_column": {"name": "default__format_column", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/column/columns_spec_ddl.sql", "original_file_path": "macros/relations/column/columns_spec_ddl.sql", "unique_id": "macro.dbt.default__format_column", "macro_sql": "{% macro default__format_column(column) -%}\n {% set data_type = column.dtype %}\n {% set formatted = column.column.lower() ~ \" \" ~ data_type %}\n {{ return({'name': column.name, 'data_type': data_type, 'formatted': formatted}) }}\n{%- endmacro -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "column", "type": null, "description": ""}], "created_at": 1789419969.7421756, "supported_languages": null}, "macro.dbt.get_create_table_as_sql": {"name": "get_create_table_as_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/table/create.sql", "original_file_path": "macros/relations/table/create.sql", "unique_id": "macro.dbt.get_create_table_as_sql", "macro_sql": "{% macro get_create_table_as_sql(temporary, relation, sql) -%}\n {{ adapter.dispatch('get_create_table_as_sql', 'dbt')(temporary, relation, sql) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_create_table_as_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "temporary", "type": null, "description": ""}, {"name": "relation", "type": null, "description": ""}, {"name": "sql", "type": null, "description": ""}], "created_at": 1789419969.7433088, "supported_languages": null}, "macro.dbt.default__get_create_table_as_sql": {"name": "default__get_create_table_as_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/table/create.sql", "original_file_path": "macros/relations/table/create.sql", "unique_id": "macro.dbt.default__get_create_table_as_sql", "macro_sql": "{% macro default__get_create_table_as_sql(temporary, relation, sql) -%}\n {{ return(create_table_as(temporary, relation, sql)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.create_table_as"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "temporary", "type": null, "description": ""}, {"name": "relation", "type": null, "description": ""}, {"name": "sql", "type": null, "description": ""}], "created_at": 1789419969.7436247, "supported_languages": null}, "macro.dbt.create_table_as": {"name": "create_table_as", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/table/create.sql", "original_file_path": "macros/relations/table/create.sql", "unique_id": "macro.dbt.create_table_as", "macro_sql": "{% macro create_table_as(temporary, relation, compiled_code, language='sql') -%}\n {# backward compatibility for create_table_as that does not support language #}\n {% if language == \"sql\" %}\n {{ adapter.dispatch('create_table_as', 'dbt')(temporary, relation, compiled_code)}}\n {% else %}\n {{ adapter.dispatch('create_table_as', 'dbt')(temporary, relation, compiled_code, language) }}\n {% endif %}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__create_table_as"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "temporary", "type": null, "description": ""}, {"name": "relation", "type": null, "description": ""}, {"name": "compiled_code", "type": null, "description": ""}, {"name": "language", "type": null, "description": ""}], "created_at": 1789419969.7444918, "supported_languages": null}, "macro.dbt.default__create_table_as": {"name": "default__create_table_as", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/table/create.sql", "original_file_path": "macros/relations/table/create.sql", "unique_id": "macro.dbt.default__create_table_as", "macro_sql": "{% macro default__create_table_as(temporary, relation, sql) -%}\n {%- set sql_header = config.get('sql_header', none) -%}\n\n {{ sql_header if sql_header is not none }}\n\n create {% if temporary: -%}temporary{%- endif %} table\n {{ relation.include(database=(not temporary), schema=(not temporary)) }}\n {% set contract_config = config.get('contract') %}\n {% if contract_config.enforced and (not temporary) %}\n {{ get_assert_columns_equivalent(sql) }}\n {{ get_table_columns_and_constraints() }}\n {%- set sql = get_select_subquery(sql) %}\n {% endif %}\n as (\n {{ sql }}\n );\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.get_assert_columns_equivalent", "macro.dbt.get_table_columns_and_constraints", "macro.dbt.get_select_subquery"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "temporary", "type": null, "description": ""}, {"name": "relation", "type": null, "description": ""}, {"name": "sql", "type": null, "description": ""}], "created_at": 1789419969.74567, "supported_languages": null}, "macro.dbt.default__get_column_names": {"name": "default__get_column_names", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/table/create.sql", "original_file_path": "macros/relations/table/create.sql", "unique_id": "macro.dbt.default__get_column_names", "macro_sql": "{% macro default__get_column_names() %}\n {#- loop through user_provided_columns to get column names -#}\n {%- set user_provided_columns = model['columns'] -%}\n {%- for i in user_provided_columns %}\n {%- set col = user_provided_columns[i] -%}\n {%- set col_name = adapter.quote(col['name']) if col.get('quote') else col['name'] -%}\n {{ col_name }}{{ \", \" if not loop.last }}\n {%- endfor -%}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789419969.7464666, "supported_languages": null}, "macro.dbt.get_select_subquery": {"name": "get_select_subquery", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/table/create.sql", "original_file_path": "macros/relations/table/create.sql", "unique_id": "macro.dbt.get_select_subquery", "macro_sql": "{% macro get_select_subquery(sql) %}\n {{ return(adapter.dispatch('get_select_subquery', 'dbt')(sql)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_select_subquery"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "sql", "type": null, "description": ""}], "created_at": 1789419969.746796, "supported_languages": null}, "macro.dbt.default__get_select_subquery": {"name": "default__get_select_subquery", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/table/create.sql", "original_file_path": "macros/relations/table/create.sql", "unique_id": "macro.dbt.default__get_select_subquery", "macro_sql": "{% macro default__get_select_subquery(sql) %}\n select {{ adapter.dispatch('get_column_names', 'dbt')() }}\n from (\n {{ sql }}\n ) as model_subq\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_column_names"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "sql", "type": null, "description": ""}], "created_at": 1789419969.7470894, "supported_languages": null}, "macro.dbt.get_rename_table_sql": {"name": "get_rename_table_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/table/rename.sql", "original_file_path": "macros/relations/table/rename.sql", "unique_id": "macro.dbt.get_rename_table_sql", "macro_sql": "{% macro get_rename_table_sql(relation, new_name) %}\n {{- adapter.dispatch('get_rename_table_sql', 'dbt')(relation, new_name) -}}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__get_rename_table_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "new_name", "type": null, "description": ""}], "created_at": 1789419969.7475626, "supported_languages": null}, "macro.dbt.default__get_rename_table_sql": {"name": "default__get_rename_table_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/table/rename.sql", "original_file_path": "macros/relations/table/rename.sql", "unique_id": "macro.dbt.default__get_rename_table_sql", "macro_sql": "{% macro default__get_rename_table_sql(relation, new_name) %}\n {{ exceptions.raise_compiler_error(\n \"`get_rename_table_sql` has not been implemented for this adapter.\"\n ) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "new_name", "type": null, "description": ""}], "created_at": 1789419969.747816, "supported_languages": null}, "macro.dbt.drop_table": {"name": "drop_table", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/table/drop.sql", "original_file_path": "macros/relations/table/drop.sql", "unique_id": "macro.dbt.drop_table", "macro_sql": "{% macro drop_table(relation) -%}\n {{- adapter.dispatch('drop_table', 'dbt')(relation) -}}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__drop_table"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789419969.748231, "supported_languages": null}, "macro.dbt.default__drop_table": {"name": "default__drop_table", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/table/drop.sql", "original_file_path": "macros/relations/table/drop.sql", "unique_id": "macro.dbt.default__drop_table", "macro_sql": "{% macro default__drop_table(relation) -%}\n drop table if exists {{ relation.render() }} cascade\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789419969.7484407, "supported_languages": null}, "macro.dbt.get_replace_table_sql": {"name": "get_replace_table_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/table/replace.sql", "original_file_path": "macros/relations/table/replace.sql", "unique_id": "macro.dbt.get_replace_table_sql", "macro_sql": "{% macro get_replace_table_sql(relation, sql) %}\n {{- adapter.dispatch('get_replace_table_sql', 'dbt')(relation, sql) -}}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__get_replace_table_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "sql", "type": null, "description": ""}], "created_at": 1789419969.7489023, "supported_languages": null}, "macro.dbt.default__get_replace_table_sql": {"name": "default__get_replace_table_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/table/replace.sql", "original_file_path": "macros/relations/table/replace.sql", "unique_id": "macro.dbt.default__get_replace_table_sql", "macro_sql": "{% macro default__get_replace_table_sql(relation, sql) %}\n {{ exceptions.raise_compiler_error(\n \"`get_replace_table_sql` has not been implemented for this adapter.\"\n ) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "sql", "type": null, "description": ""}], "created_at": 1789419969.7491539, "supported_languages": null}, "macro.dbt.default__test_relationships": {"name": "default__test_relationships", "resource_type": "macro", "package_name": "dbt", "path": "macros/generic_test_sql/relationships.sql", "original_file_path": "macros/generic_test_sql/relationships.sql", "unique_id": "macro.dbt.default__test_relationships", "macro_sql": "{% macro default__test_relationships(model, column_name, to, field) %}\n\nwith child as (\n select {{ column_name }} as from_field\n from {{ model }}\n where {{ column_name }} is not null\n),\n\nparent as (\n select {{ field }} as to_field\n from {{ to }}\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "column_name", "type": null, "description": ""}, {"name": "to", "type": null, "description": ""}, {"name": "field", "type": null, "description": ""}], "created_at": 1789419969.7496397, "supported_languages": null}, "macro.dbt.default__test_accepted_values": {"name": "default__test_accepted_values", "resource_type": "macro", "package_name": "dbt", "path": "macros/generic_test_sql/accepted_values.sql", "original_file_path": "macros/generic_test_sql/accepted_values.sql", "unique_id": "macro.dbt.default__test_accepted_values", "macro_sql": "{% macro default__test_accepted_values(model, column_name, values, quote=True) %}\n\nwith all_values as (\n\n select\n {{ column_name }} as value_field,\n count(*) as n_records\n\n from {{ model }}\n group by {{ column_name }}\n\n)\n\nselect *\nfrom all_values\nwhere value_field not in (\n {% for value in values -%}\n {% if quote -%}\n '{{ value }}'\n {%- else -%}\n {{ value }}\n {%- endif -%}\n {%- if not loop.last -%},{%- endif %}\n {%- endfor %}\n)\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "column_name", "type": null, "description": ""}, {"name": "values", "type": null, "description": ""}, {"name": "quote", "type": null, "description": ""}], "created_at": 1789419969.7505133, "supported_languages": null}, "macro.dbt.default__test_not_null": {"name": "default__test_not_null", "resource_type": "macro", "package_name": "dbt", "path": "macros/generic_test_sql/not_null.sql", "original_file_path": "macros/generic_test_sql/not_null.sql", "unique_id": "macro.dbt.default__test_not_null", "macro_sql": "{% macro default__test_not_null(model, column_name) %}\n\n{% set column_list = '*' if should_store_failures() else column_name %}\n\nselect {{ column_list }}\nfrom {{ model }}\nwhere {{ column_name }} is null\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.should_store_failures"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "column_name", "type": null, "description": ""}], "created_at": 1789419969.7510307, "supported_languages": null}, "macro.dbt.default__test_unique": {"name": "default__test_unique", "resource_type": "macro", "package_name": "dbt", "path": "macros/generic_test_sql/unique.sql", "original_file_path": "macros/generic_test_sql/unique.sql", "unique_id": "macro.dbt.default__test_unique", "macro_sql": "{% macro default__test_unique(model, column_name) %}\n\nselect\n {{ column_name }} as unique_field,\n count(*) as n_records\n\nfrom {{ model }}\nwhere {{ column_name }} is not null\ngroup by {{ column_name }}\nhaving count(*) > 1\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "column_name", "type": null, "description": ""}], "created_at": 1789419969.7514231, "supported_languages": null}, "macro.dbt.set_sql_header": {"name": "set_sql_header", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/configs.sql", "original_file_path": "macros/materializations/configs.sql", "unique_id": "macro.dbt.set_sql_header", "macro_sql": "{% macro set_sql_header(config) -%}\n {{ config.set('sql_header', caller()) }}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "config", "type": null, "description": ""}], "created_at": 1789419969.7519364, "supported_languages": null}, "macro.dbt.should_full_refresh": {"name": "should_full_refresh", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/configs.sql", "original_file_path": "macros/materializations/configs.sql", "unique_id": "macro.dbt.should_full_refresh", "macro_sql": "{% macro should_full_refresh() %}\n {% set config_full_refresh = config.get('full_refresh') %}\n {% if config_full_refresh is none %}\n {% set config_full_refresh = flags.FULL_REFRESH %}\n {% endif %}\n {% do return(config_full_refresh) %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789419969.7525644, "supported_languages": null}, "macro.dbt.should_store_failures": {"name": "should_store_failures", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/configs.sql", "original_file_path": "macros/materializations/configs.sql", "unique_id": "macro.dbt.should_store_failures", "macro_sql": "{% macro should_store_failures() %}\n {% set config_store_failures = config.get('store_failures') %}\n {% if config_store_failures is none %}\n {% set config_store_failures = flags.STORE_FAILURES %}\n {% endif %}\n {% do return(config_store_failures) %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789419969.7530746, "supported_languages": null}, "macro.dbt.run_hooks": {"name": "run_hooks", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/hooks.sql", "original_file_path": "macros/materializations/hooks.sql", "unique_id": "macro.dbt.run_hooks", "macro_sql": "{% macro run_hooks(hooks, inside_transaction=True) %}\n {% for hook in hooks | selectattr('transaction', 'equalto', inside_transaction) %}\n {% if not inside_transaction and loop.first %}\n {% call statement(auto_begin=inside_transaction) %}\n commit;\n {% endcall %}\n {% endif %}\n {% set rendered = render(hook.get('sql')) | trim %}\n {% if (rendered | length) > 0 %}\n {% call statement(auto_begin=inside_transaction) %}\n {{ rendered }}\n {% endcall %}\n {% endif %}\n {% endfor %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "hooks", "type": null, "description": ""}, {"name": "inside_transaction", "type": null, "description": ""}], "created_at": 1789419969.7545285, "supported_languages": null}, "macro.dbt.make_hook_config": {"name": "make_hook_config", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/hooks.sql", "original_file_path": "macros/materializations/hooks.sql", "unique_id": "macro.dbt.make_hook_config", "macro_sql": "{% macro make_hook_config(sql, inside_transaction) %}\n {{ tojson({\"sql\": sql, \"transaction\": inside_transaction}) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "sql", "type": null, "description": ""}, {"name": "inside_transaction", "type": null, "description": ""}], "created_at": 1789419969.7548862, "supported_languages": null}, "macro.dbt.before_begin": {"name": "before_begin", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/hooks.sql", "original_file_path": "macros/materializations/hooks.sql", "unique_id": "macro.dbt.before_begin", "macro_sql": "{% macro before_begin(sql) %}\n {{ make_hook_config(sql, inside_transaction=False) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.make_hook_config"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "sql", "type": null, "description": ""}], "created_at": 1789419969.7551308, "supported_languages": null}, "macro.dbt.in_transaction": {"name": "in_transaction", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/hooks.sql", "original_file_path": "macros/materializations/hooks.sql", "unique_id": "macro.dbt.in_transaction", "macro_sql": "{% macro in_transaction(sql) %}\n {{ make_hook_config(sql, inside_transaction=True) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.make_hook_config"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "sql", "type": null, "description": ""}], "created_at": 1789419969.755368, "supported_languages": null}, "macro.dbt.after_commit": {"name": "after_commit", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/hooks.sql", "original_file_path": "macros/materializations/hooks.sql", "unique_id": "macro.dbt.after_commit", "macro_sql": "{% macro after_commit(sql) %}\n {{ make_hook_config(sql, inside_transaction=False) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.make_hook_config"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "sql", "type": null, "description": ""}], "created_at": 1789419969.7556021, "supported_languages": null}, "macro.dbt.materialization_seed_default": {"name": "materialization_seed_default", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/seeds/seed.sql", "original_file_path": "macros/materializations/seeds/seed.sql", "unique_id": "macro.dbt.materialization_seed_default", "macro_sql": "{% materialization seed, default %}\n\n {%- set identifier = model['alias'] -%}\n {%- set full_refresh_mode = (should_full_refresh()) -%}\n\n {%- set old_relation = adapter.get_relation(database=database, schema=schema, identifier=identifier) -%}\n\n {%- set exists_as_table = (old_relation is not none and old_relation.is_table) -%}\n {%- set exists_as_view = (old_relation is not none and old_relation.is_view) -%}\n\n {%- set grant_config = config.get('grants') -%}\n {%- set agate_table = load_agate_table() -%}\n -- grab current tables grants config for comparison later on\n\n {%- do store_result('agate_table', response='OK', agate_table=agate_table) -%}\n\n {{ run_hooks(pre_hooks, inside_transaction=False) }}\n\n -- `BEGIN` happens here:\n {{ run_hooks(pre_hooks, inside_transaction=True) }}\n\n -- build model\n {% set create_table_sql = \"\" %}\n {% if exists_as_view %}\n {{ exceptions.raise_compiler_error(\"Cannot seed to '{}', it is a view\".format(old_relation.render())) }}\n {% elif exists_as_table %}\n {% set create_table_sql = reset_csv_table(model, full_refresh_mode, old_relation, agate_table) %}\n {% else %}\n {% set create_table_sql = create_csv_table(model, agate_table) %}\n {% endif %}\n\n {% set code = 'CREATE' if full_refresh_mode else 'INSERT' %}\n {% set rows_affected = (agate_table.rows | length) %}\n {% set sql = \"\" %}\n {% if rows_affected > 0 %}\n {% set sql = load_csv_rows(model, agate_table) %}\n {% endif %}\n\n {% call noop_statement('main', code ~ ' ' ~ rows_affected, code, rows_affected) %}\n {{ get_csv_sql(create_table_sql, sql) }};\n {% endcall %}\n\n {% set target_relation = this.incorporate(type='table') %}\n\n {% set should_revoke = should_revoke(old_relation, full_refresh_mode) %}\n {% do apply_grants(target_relation, grant_config, should_revoke=should_revoke) %}\n\n {% do persist_docs(target_relation, model) %}\n\n {% if full_refresh_mode or not exists_as_table %}\n {% do create_indexes(target_relation) %}\n {% endif %}\n\n {{ run_hooks(post_hooks, inside_transaction=True) }}\n\n -- `COMMIT` happens here\n {{ adapter.commit() }}\n\n {{ run_hooks(post_hooks, inside_transaction=False) }}\n\n {{ return({'relations': [target_relation]}) }}\n\n{% endmaterialization %}", "depends_on": {"macros": ["macro.dbt.should_full_refresh", "macro.dbt.run_hooks", "macro.dbt.reset_csv_table", "macro.dbt.create_csv_table", "macro.dbt.load_csv_rows", "macro.dbt.noop_statement", "macro.dbt.get_csv_sql", "macro.dbt.should_revoke", "macro.dbt.apply_grants", "macro.dbt.persist_docs", "macro.dbt.create_indexes"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "supported_languages", "type": null, "description": ""}], "created_at": 1789419969.7602792, "supported_languages": ["sql"]}, "macro.dbt.create_csv_table": {"name": "create_csv_table", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "unique_id": "macro.dbt.create_csv_table", "macro_sql": "{% macro create_csv_table(model, agate_table) -%}\n {{ adapter.dispatch('create_csv_table', 'dbt')(model, agate_table) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__create_csv_table"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "agate_table", "type": null, "description": ""}], "created_at": 1789419969.7620363, "supported_languages": null}, "macro.dbt.default__create_csv_table": {"name": "default__create_csv_table", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "unique_id": "macro.dbt.default__create_csv_table", "macro_sql": "{% macro default__create_csv_table(model, agate_table) %}\n {%- set column_override = model['config'].get('column_types', {}) -%}\n {%- set quote_seed_column = model['config'].get('quote_columns', None) -%}\n\n {% set sql %}\n create table {{ this.render() }} (\n {%- for col_name in agate_table.column_names -%}\n {%- set inferred_type = adapter.convert_type(agate_table, loop.index0) -%}\n {%- set type = column_override.get(col_name, inferred_type) -%}\n {%- set column_name = (col_name | string) -%}\n {{ adapter.quote_seed_column(column_name, quote_seed_column) }} {{ type }} {%- if not loop.last -%}, {%- endif -%}\n {%- endfor -%}\n )\n {% endset %}\n\n {% call statement('_') -%}\n {{ sql }}\n {%- endcall %}\n\n {{ return(sql) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "agate_table", "type": null, "description": ""}], "created_at": 1789419969.7635393, "supported_languages": null}, "macro.dbt.reset_csv_table": {"name": "reset_csv_table", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "unique_id": "macro.dbt.reset_csv_table", "macro_sql": "{% macro reset_csv_table(model, full_refresh, old_relation, agate_table) -%}\n {{ adapter.dispatch('reset_csv_table', 'dbt')(model, full_refresh, old_relation, agate_table) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__reset_csv_table"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "full_refresh", "type": null, "description": ""}, {"name": "old_relation", "type": null, "description": ""}, {"name": "agate_table", "type": null, "description": ""}], "created_at": 1789419969.7639542, "supported_languages": null}, "macro.dbt.default__reset_csv_table": {"name": "default__reset_csv_table", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "unique_id": "macro.dbt.default__reset_csv_table", "macro_sql": "{% macro default__reset_csv_table(model, full_refresh, old_relation, agate_table) %}\n {% set sql = \"\" %}\n {% if full_refresh %}\n {{ adapter.drop_relation(old_relation) }}\n {% set sql = create_csv_table(model, agate_table) %}\n {% else %}\n {{ adapter.truncate_relation(old_relation) }}\n {% set sql = \"truncate table \" ~ old_relation.render() %}\n {% endif %}\n\n {{ return(sql) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.create_csv_table"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "full_refresh", "type": null, "description": ""}, {"name": "old_relation", "type": null, "description": ""}, {"name": "agate_table", "type": null, "description": ""}], "created_at": 1789419969.764779, "supported_languages": null}, "macro.dbt.get_csv_sql": {"name": "get_csv_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "unique_id": "macro.dbt.get_csv_sql", "macro_sql": "{% macro get_csv_sql(create_or_truncate_sql, insert_sql) %}\n {{ adapter.dispatch('get_csv_sql', 'dbt')(create_or_truncate_sql, insert_sql) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_csv_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "create_or_truncate_sql", "type": null, "description": ""}, {"name": "insert_sql", "type": null, "description": ""}], "created_at": 1789419969.7651043, "supported_languages": null}, "macro.dbt.default__get_csv_sql": {"name": "default__get_csv_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "unique_id": "macro.dbt.default__get_csv_sql", "macro_sql": "{% macro default__get_csv_sql(create_or_truncate_sql, insert_sql) %}\n {{ create_or_truncate_sql }};\n -- dbt seed --\n {{ insert_sql }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "create_or_truncate_sql", "type": null, "description": ""}, {"name": "insert_sql", "type": null, "description": ""}], "created_at": 1789419969.765333, "supported_languages": null}, "macro.dbt.get_binding_char": {"name": "get_binding_char", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "unique_id": "macro.dbt.get_binding_char", "macro_sql": "{% macro get_binding_char() -%}\n {{ adapter.dispatch('get_binding_char', 'dbt')() }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_binding_char"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789419969.7655702, "supported_languages": null}, "macro.dbt.default__get_binding_char": {"name": "default__get_binding_char", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "unique_id": "macro.dbt.default__get_binding_char", "macro_sql": "{% macro default__get_binding_char() %}\n {{ return('%s') }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789419969.765779, "supported_languages": null}, "macro.dbt.get_batch_size": {"name": "get_batch_size", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "unique_id": "macro.dbt.get_batch_size", "macro_sql": "{% macro get_batch_size() -%}\n {{ return(adapter.dispatch('get_batch_size', 'dbt')()) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_batch_size"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789419969.7660427, "supported_languages": null}, "macro.dbt.default__get_batch_size": {"name": "default__get_batch_size", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "unique_id": "macro.dbt.default__get_batch_size", "macro_sql": "{% macro default__get_batch_size() %}\n {{ return(10000) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789419969.7662413, "supported_languages": null}, "macro.dbt.get_seed_column_quoted_csv": {"name": "get_seed_column_quoted_csv", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "unique_id": "macro.dbt.get_seed_column_quoted_csv", "macro_sql": "{% macro get_seed_column_quoted_csv(model, column_names) %}\n {%- set quote_seed_column = model['config'].get('quote_columns', None) -%}\n {% set quoted = [] %}\n {% for col in column_names -%}\n {%- do quoted.append(adapter.quote_seed_column(col, quote_seed_column)) -%}\n {%- endfor %}\n\n {%- set dest_cols_csv = quoted | join(', ') -%}\n {{ return(dest_cols_csv) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "column_names", "type": null, "description": ""}], "created_at": 1789419969.7670484, "supported_languages": null}, "macro.dbt.load_csv_rows": {"name": "load_csv_rows", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "unique_id": "macro.dbt.load_csv_rows", "macro_sql": "{% macro load_csv_rows(model, agate_table) -%}\n {{ adapter.dispatch('load_csv_rows', 'dbt')(model, agate_table) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__load_csv_rows"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "agate_table", "type": null, "description": ""}], "created_at": 1789419969.767361, "supported_languages": null}, "macro.dbt.default__load_csv_rows": {"name": "default__load_csv_rows", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "unique_id": "macro.dbt.default__load_csv_rows", "macro_sql": "{% macro default__load_csv_rows(model, agate_table) %}\n\n {% set batch_size = get_batch_size() %}\n\n {% set cols_sql = get_seed_column_quoted_csv(model, agate_table.column_names) %}\n {% set bindings = [] %}\n\n {% set statements = [] %}\n\n {% for chunk in agate_table.rows | batch(batch_size) %}\n {% set bindings = [] %}\n\n {% for row in chunk %}\n {% do bindings.extend(row) %}\n {% endfor %}\n\n {% set sql %}\n insert into {{ this.render() }} ({{ cols_sql }}) values\n {% for row in chunk -%}\n ({%- for column in agate_table.column_names -%}\n {{ get_binding_char() }}\n {%- if not loop.last%},{%- endif %}\n {%- endfor -%})\n {%- if not loop.last%},{%- endif %}\n {%- endfor %}\n {% endset %}\n\n {% do adapter.add_query(sql, bindings=bindings, abridge_sql_log=True) %}\n\n {% if loop.index0 == 0 %}\n {% do statements.append(sql) %}\n {% endif %}\n {% endfor %}\n\n {# Return SQL so we can render it out into the compiled files #}\n {{ return(statements[0]) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_batch_size", "macro.dbt.get_seed_column_quoted_csv", "macro.dbt.get_binding_char"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "agate_table", "type": null, "description": ""}], "created_at": 1789419969.7694707, "supported_languages": null}, "macro.dbt.materialization_unit_default": {"name": "materialization_unit_default", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/tests/unit.sql", "original_file_path": "macros/materializations/tests/unit.sql", "unique_id": "macro.dbt.materialization_unit_default", "macro_sql": "{%- materialization unit, default -%}\n\n {% set relations = [] %}\n {% set sql_header = config.get('sql_header') if flags.REQUIRE_SQL_HEADER_IN_TEST_CONFIGS else none %}\n\n {% set expected_rows = config.get('expected_rows') %}\n {% set expected_sql = config.get('expected_sql') %}\n {% set tested_expected_column_names = expected_rows[0].keys() if (expected_rows | length ) > 0 else get_columns_in_query(sql) %}\n\n {%- set target_relation = this.incorporate(type='table') -%}\n {%- set temp_relation = make_temp_relation(target_relation)-%}\n {% do run_query(get_create_table_as_sql(True, temp_relation, get_empty_subquery_sql(sql))) %}\n {%- set columns_in_relation = adapter.get_columns_in_relation(temp_relation) -%}\n {%- set column_name_to_data_types = {} -%}\n {%- set column_name_to_quoted = {} -%}\n {%- for column in columns_in_relation -%}\n {%- do column_name_to_data_types.update({column.name|lower: column.data_type}) -%}\n {%- do column_name_to_quoted.update({column.name|lower: column.quoted}) -%}\n {%- endfor -%}\n\n {%- set expected_column_names_quoted = [] -%}\n {%- for column_name in tested_expected_column_names -%}\n {%- do expected_column_names_quoted.append(column_name_to_quoted[column_name|lower]) -%}\n {%- endfor -%}\n\n {% if not expected_sql %}\n {% set expected_sql = get_expected_sql(expected_rows, column_name_to_data_types, column_name_to_quoted) %}\n {% endif %}\n {% set unit_test_sql = get_unit_test_sql(sql, expected_sql, expected_column_names_quoted) %}\n\n {% call statement('main', fetch_result=True) -%}\n\n {% if sql_header %}{{ sql_header }}{% endif %}\n {{ unit_test_sql }}\n\n {%- endcall %}\n\n {% do adapter.drop_relation(temp_relation) %}\n\n {{ return({'relations': relations}) }}\n\n{%- endmaterialization -%}", "depends_on": {"macros": ["macro.dbt.get_columns_in_query", "macro.dbt.make_temp_relation", "macro.dbt.run_query", "macro.dbt.get_create_table_as_sql", "macro.dbt.get_empty_subquery_sql", "macro.dbt.get_expected_sql", "macro.dbt.get_unit_test_sql", "macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "supported_languages", "type": null, "description": ""}], "created_at": 1789419969.7730067, "supported_languages": ["sql"]}, "macro.dbt.materialization_test_default": {"name": "materialization_test_default", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/tests/test.sql", "original_file_path": "macros/materializations/tests/test.sql", "unique_id": "macro.dbt.materialization_test_default", "macro_sql": "{%- materialization test, default -%}\n\n {% set relations = [] %}\n {% set limit = config.get('limit') %}\n {% set sql_header = config.get('sql_header') if flags.REQUIRE_SQL_HEADER_IN_TEST_CONFIGS else none %}\n\n {% set sql_with_limit %}\n {{ get_limit_subquery_sql(sql, limit) }}\n {% endset %}\n\n {% if should_store_failures() %}\n\n {% set identifier = model['alias'] %}\n {% set old_relation = adapter.get_relation(database=database, schema=schema, identifier=identifier) %}\n\n {% set store_failures_as = config.get('store_failures_as') %}\n -- if `--store-failures` is invoked via command line and `store_failures_as` is not set,\n -- config.get('store_failures_as', 'table') returns None, not 'table'\n {% if store_failures_as == none %}{% set store_failures_as = 'table' %}{% endif %}\n {% if store_failures_as not in ['table', 'view'] %}\n {{ exceptions.raise_compiler_error(\n \"'\" ~ store_failures_as ~ \"' is not a valid value for `store_failures_as`. \"\n \"Accepted values are: ['ephemeral', 'table', 'view']\"\n ) }}\n {% endif %}\n\n {% set target_relation = api.Relation.create(\n identifier=identifier, schema=schema, database=database, type=store_failures_as) -%} %}\n\n {% if old_relation %}\n {% do adapter.drop_relation(old_relation) %}\n {% endif %}\n\n {% call statement(auto_begin=True) %}\n {% if sql_header %}{{ sql_header }}{% endif %}\n {{ get_create_sql(target_relation, sql_with_limit) }}\n {% endcall %}\n\n {% do relations.append(target_relation) %}\n\n {# Since the test failures have already been saved to the database, reuse that result rather than querying again #}\n {% set main_sql %}\n select *\n from {{ target_relation }}\n {% endset %}\n\n {{ adapter.commit() }}\n\n {% else %}\n\n {% set main_sql = sql_with_limit %}\n\n {% endif %}\n\n {% set fail_calc = config.get('fail_calc') %}\n {% set warn_if = config.get('warn_if') %}\n {% set error_if = config.get('error_if') %}\n\n {% call statement('main', fetch_result=True) -%}\n\n {% if sql_header %}{{ sql_header }}{% endif %}\n {# The limit has already been included above, and we do not want to duplicate it again. We also want to be safe for macro overrides treating `limit` as a required parameter. #}\n {{ get_test_sql(main_sql, fail_calc, warn_if, error_if, limit=none)}}\n\n {%- endcall %}\n\n {{ return({'relations': relations}) }}\n\n{%- endmaterialization -%}", "depends_on": {"macros": ["macro.dbt.get_limit_subquery_sql", "macro.dbt.should_store_failures", "macro.dbt.statement", "macro.dbt.get_create_sql", "macro.dbt.get_test_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "supported_languages", "type": null, "description": ""}], "created_at": 1789419969.7772431, "supported_languages": ["sql"]}, "macro.dbt.get_test_sql": {"name": "get_test_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/tests/helpers.sql", "original_file_path": "macros/materializations/tests/helpers.sql", "unique_id": "macro.dbt.get_test_sql", "macro_sql": "{% macro get_test_sql(main_sql, fail_calc, warn_if, error_if, limit) -%}\n {{ adapter.dispatch('get_test_sql', 'dbt')(main_sql, fail_calc, warn_if, error_if, limit) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_test_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "main_sql", "type": null, "description": ""}, {"name": "fail_calc", "type": null, "description": ""}, {"name": "warn_if", "type": null, "description": ""}, {"name": "error_if", "type": null, "description": ""}, {"name": "limit", "type": null, "description": ""}], "created_at": 1789419969.778241, "supported_languages": null}, "macro.dbt.default__get_test_sql": {"name": "default__get_test_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/tests/helpers.sql", "original_file_path": "macros/materializations/tests/helpers.sql", "unique_id": "macro.dbt.default__get_test_sql", "macro_sql": "{% macro default__get_test_sql(main_sql, fail_calc, warn_if, error_if, limit) -%}\n select\n {{ fail_calc }} as failures,\n {{ fail_calc }} {{ warn_if }} as should_warn,\n {{ fail_calc }} {{ error_if }} as should_error\n from (\n {{ main_sql }}\n {{ \"limit \" ~ limit if limit != none }}\n ) dbt_internal_test\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "main_sql", "type": null, "description": ""}, {"name": "fail_calc", "type": null, "description": ""}, {"name": "warn_if", "type": null, "description": ""}, {"name": "error_if", "type": null, "description": ""}, {"name": "limit", "type": null, "description": ""}], "created_at": 1789419969.7787776, "supported_languages": null}, "macro.dbt.get_unit_test_sql": {"name": "get_unit_test_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/tests/helpers.sql", "original_file_path": "macros/materializations/tests/helpers.sql", "unique_id": "macro.dbt.get_unit_test_sql", "macro_sql": "{% macro get_unit_test_sql(main_sql, expected_fixture_sql, expected_column_names) -%}\n {{ adapter.dispatch('get_unit_test_sql', 'dbt')(main_sql, expected_fixture_sql, expected_column_names) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_unit_test_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "main_sql", "type": null, "description": ""}, {"name": "expected_fixture_sql", "type": null, "description": ""}, {"name": "expected_column_names", "type": null, "description": ""}], "created_at": 1789419969.7791338, "supported_languages": null}, "macro.dbt.default__get_unit_test_sql": {"name": "default__get_unit_test_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/tests/helpers.sql", "original_file_path": "macros/materializations/tests/helpers.sql", "unique_id": "macro.dbt.default__get_unit_test_sql", "macro_sql": "{% macro default__get_unit_test_sql(main_sql, expected_fixture_sql, expected_column_names) -%}\n-- Build actual result given inputs\nwith dbt_internal_unit_test_actual as (\n select\n {% for expected_column_name in expected_column_names %}{{expected_column_name}}{% if not loop.last -%},{% endif %}{%- endfor -%}, {{ dbt.string_literal(\"actual\") }} as {{ adapter.quote(\"actual_or_expected\") }}\n from (\n {{ main_sql }}\n ) _dbt_internal_unit_test_actual\n),\n-- Build expected result\ndbt_internal_unit_test_expected as (\n select\n {% for expected_column_name in expected_column_names %}{{expected_column_name}}{% if not loop.last -%}, {% endif %}{%- endfor -%}, {{ dbt.string_literal(\"expected\") }} as {{ adapter.quote(\"actual_or_expected\") }}\n from (\n {{ expected_fixture_sql }}\n ) _dbt_internal_unit_test_expected\n)\n-- Union actual and expected results\nselect * from dbt_internal_unit_test_actual\nunion all\nselect * from dbt_internal_unit_test_expected\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.string_literal"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "main_sql", "type": null, "description": ""}, {"name": "expected_fixture_sql", "type": null, "description": ""}, {"name": "expected_column_names", "type": null, "description": ""}], "created_at": 1789419969.7801359, "supported_languages": null}, "macro.dbt.get_where_subquery": {"name": "get_where_subquery", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/tests/where_subquery.sql", "original_file_path": "macros/materializations/tests/where_subquery.sql", "unique_id": "macro.dbt.get_where_subquery", "macro_sql": "{% macro get_where_subquery(relation) -%}\n {% do return(adapter.dispatch('get_where_subquery', 'dbt')(relation)) %}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_where_subquery"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789419969.7806976, "supported_languages": null}, "macro.dbt.default__get_where_subquery": {"name": "default__get_where_subquery", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/tests/where_subquery.sql", "original_file_path": "macros/materializations/tests/where_subquery.sql", "unique_id": "macro.dbt.default__get_where_subquery", "macro_sql": "{% macro default__get_where_subquery(relation) -%}\n {% set where = config.get('where', '') %}\n {% if where %}\n {%- set filtered -%}\n (select * from {{ relation }} where {{ where }}) dbt_subquery\n {%- endset -%}\n {% do return(filtered) %}\n {%- else -%}\n {% do return(relation) %}\n {%- endif -%}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789419969.7813437, "supported_languages": null}, "macro.dbt.materialization_snapshot_default": {"name": "materialization_snapshot_default", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/snapshot.sql", "original_file_path": "macros/materializations/snapshots/snapshot.sql", "unique_id": "macro.dbt.materialization_snapshot_default", "macro_sql": "{% materialization snapshot, default %}\n\n {%- set target_table = model.get('alias', model.get('name')) -%}\n\n {%- set strategy_name = config.get('strategy') -%}\n {%- set unique_key = config.get('unique_key') %}\n -- grab current tables grants config for comparision later on\n {%- set grant_config = config.get('grants') -%}\n\n {% set target_relation_exists, target_relation = get_or_create_relation(\n database=model.database,\n schema=model.schema,\n identifier=target_table,\n type='table') -%}\n\n {%- if not target_relation.is_table -%}\n {% do exceptions.relation_wrong_type(target_relation, 'table') %}\n {%- endif -%}\n\n\n {{ run_hooks(pre_hooks, inside_transaction=False) }}\n\n {{ run_hooks(pre_hooks, inside_transaction=True) }}\n\n {% set strategy_macro = strategy_dispatch(strategy_name) %}\n {# The model['config'] parameter below is no longer used, but passing anyway for compatibility #}\n {# It was a dictionary of config, instead of the config object from the context #}\n {% set strategy = strategy_macro(model, \"snapshotted_data\", \"source_data\", model['config'], target_relation_exists) %}\n\n {% if not target_relation_exists %}\n\n {% set build_sql = build_snapshot_table(strategy, model['compiled_code']) %}\n {% set build_or_select_sql = build_sql %}\n {% set final_sql = create_table_as(False, target_relation, build_sql) %}\n\n {% else %}\n\n {% set columns = config.get(\"snapshot_table_column_names\") or get_snapshot_table_column_names() %}\n\n {{ adapter.assert_valid_snapshot_target_given_strategy(target_relation, columns, strategy) }}\n\n {% set build_or_select_sql = snapshot_staging_table(strategy, sql, target_relation) %}\n {% set staging_table = build_snapshot_staging_table(strategy, sql, target_relation) %}\n\n -- this may no-op if the database does not require column expansion\n {% do adapter.expand_target_column_types(from_relation=staging_table,\n to_relation=target_relation) %}\n\n {% set remove_columns = ['dbt_change_type', 'DBT_CHANGE_TYPE', 'dbt_unique_key', 'DBT_UNIQUE_KEY'] %}\n {% if unique_key | is_list %}\n {% for key in strategy.unique_key %}\n {{ remove_columns.append('dbt_unique_key_' + loop.index|string) }}\n {{ remove_columns.append('DBT_UNIQUE_KEY_' + loop.index|string) }}\n {% endfor %}\n {% endif %}\n\n {% set missing_columns = adapter.get_missing_columns(staging_table, target_relation)\n | rejectattr('name', 'in', remove_columns)\n | list %}\n\n {% do create_columns(target_relation, missing_columns) %}\n\n {% set source_columns = adapter.get_columns_in_relation(staging_table)\n | rejectattr('name', 'in', remove_columns)\n | list %}\n\n {% set quoted_source_columns = [] %}\n {% for column in source_columns %}\n {% do quoted_source_columns.append(adapter.quote(column.name)) %}\n {% endfor %}\n\n {% set final_sql = snapshot_merge_sql(\n target = target_relation,\n source = staging_table,\n insert_cols = quoted_source_columns\n )\n %}\n\n {% endif %}\n\n\n {{ check_time_data_types(build_or_select_sql) }}\n\n {% call statement('main') %}\n {{ final_sql }}\n {% endcall %}\n\n {% set should_revoke = should_revoke(target_relation_exists, full_refresh_mode=False) %}\n {% do apply_grants(target_relation, grant_config, should_revoke=should_revoke) %}\n\n {% do persist_docs(target_relation, model) %}\n\n {% if not target_relation_exists %}\n {% do create_indexes(target_relation) %}\n {% endif %}\n\n {{ run_hooks(post_hooks, inside_transaction=True) }}\n\n {{ adapter.commit() }}\n\n {% if staging_table is defined %}\n {% do post_snapshot(staging_table) %}\n {% endif %}\n\n {{ run_hooks(post_hooks, inside_transaction=False) }}\n\n {{ return({'relations': [target_relation]}) }}\n\n{% endmaterialization %}", "depends_on": {"macros": ["macro.dbt.get_or_create_relation", "macro.dbt.run_hooks", "macro.dbt.strategy_dispatch", "macro.dbt.build_snapshot_table", "macro.dbt.create_table_as", "macro.dbt.get_snapshot_table_column_names", "macro.dbt.snapshot_staging_table", "macro.dbt.build_snapshot_staging_table", "macro.dbt.create_columns", "macro.dbt.snapshot_merge_sql", "macro.dbt.check_time_data_types", "macro.dbt.statement", "macro.dbt.should_revoke", "macro.dbt.apply_grants", "macro.dbt.persist_docs", "macro.dbt.create_indexes", "macro.dbt.post_snapshot"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "supported_languages", "type": null, "description": ""}], "created_at": 1789419969.7881088, "supported_languages": ["sql"]}, "macro.dbt.strategy_dispatch": {"name": "strategy_dispatch", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/strategies.sql", "original_file_path": "macros/materializations/snapshots/strategies.sql", "unique_id": "macro.dbt.strategy_dispatch", "macro_sql": "{% macro strategy_dispatch(name) -%}\n{% set original_name = name %}\n {% if '.' in name %}\n {% set package_name, name = name.split(\".\", 1) %}\n {% else %}\n {% set package_name = none %}\n {% endif %}\n\n {% if package_name is none %}\n {% set package_context = context %}\n {% elif package_name in context %}\n {% set package_context = context[package_name] %}\n {% else %}\n {% set error_msg %}\n Could not find package '{{package_name}}', called with '{{original_name}}'\n {% endset %}\n {{ exceptions.raise_compiler_error(error_msg | trim) }}\n {% endif %}\n\n {%- set search_name = 'snapshot_' ~ name ~ '_strategy' -%}\n\n {% if search_name not in package_context %}\n {% set error_msg %}\n The specified strategy macro '{{name}}' was not found in package '{{ package_name }}'\n {% endset %}\n {{ exceptions.raise_compiler_error(error_msg | trim) }}\n {% endif %}\n {{ return(package_context[search_name]) }}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "name", "type": null, "description": ""}], "created_at": 1789419969.7917945, "supported_languages": null}, "macro.dbt.snapshot_hash_arguments": {"name": "snapshot_hash_arguments", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/strategies.sql", "original_file_path": "macros/materializations/snapshots/strategies.sql", "unique_id": "macro.dbt.snapshot_hash_arguments", "macro_sql": "{% macro snapshot_hash_arguments(args) -%}\n {{ adapter.dispatch('snapshot_hash_arguments', 'dbt')(args) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__snapshot_hash_arguments"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "args", "type": null, "description": ""}], "created_at": 1789419969.7921126, "supported_languages": null}, "macro.dbt.default__snapshot_hash_arguments": {"name": "default__snapshot_hash_arguments", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/strategies.sql", "original_file_path": "macros/materializations/snapshots/strategies.sql", "unique_id": "macro.dbt.default__snapshot_hash_arguments", "macro_sql": "{% macro default__snapshot_hash_arguments(args) -%}\n md5({%- for arg in args -%}\n coalesce(cast({{ arg }} as varchar ), '')\n {% if not loop.last %} || '|' || {% endif %}\n {%- endfor -%})\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "args", "type": null, "description": ""}], "created_at": 1789419969.7924986, "supported_languages": null}, "macro.dbt.snapshot_timestamp_strategy": {"name": "snapshot_timestamp_strategy", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/strategies.sql", "original_file_path": "macros/materializations/snapshots/strategies.sql", "unique_id": "macro.dbt.snapshot_timestamp_strategy", "macro_sql": "{% macro snapshot_timestamp_strategy(node, snapshotted_rel, current_rel, model_config, target_exists) %}\n {# The model_config parameter is no longer used, but is passed in anyway for compatibility. #}\n {% set primary_key = config.get('unique_key') %}\n {% set updated_at = config.get('updated_at') %}\n {% set hard_deletes = adapter.get_hard_deletes_behavior(config) %}\n {% set invalidate_hard_deletes = hard_deletes == 'invalidate' %}\n {% set columns = config.get(\"snapshot_table_column_names\") or get_snapshot_table_column_names() %}\n\n {#/*\n The snapshot relation might not have an {{ updated_at }} value if the\n snapshot strategy is changed from `check` to `timestamp`. We\n should use a dbt-created column for the comparison in the snapshot\n table instead of assuming that the user-supplied {{ updated_at }}\n will be present in the historical data.\n\n See https://github.com/dbt-labs/dbt-core/issues/2350\n */ #}\n {% set row_changed_expr -%}\n ({{ snapshotted_rel }}.{{ columns.dbt_valid_from }} < {{ current_rel }}.{{ updated_at }})\n {%- endset %}\n\n {% set scd_args = api.Relation.scd_args(primary_key, updated_at) %}\n {% set scd_id_expr = snapshot_hash_arguments(scd_args) %}\n\n {% do return({\n \"unique_key\": primary_key,\n \"updated_at\": updated_at,\n \"row_changed\": row_changed_expr,\n \"scd_id\": scd_id_expr,\n \"invalidate_hard_deletes\": invalidate_hard_deletes,\n \"hard_deletes\": hard_deletes\n }) %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_snapshot_table_column_names", "macro.dbt.snapshot_hash_arguments"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "node", "type": null, "description": ""}, {"name": "snapshotted_rel", "type": null, "description": ""}, {"name": "current_rel", "type": null, "description": ""}, {"name": "model_config", "type": null, "description": ""}, {"name": "target_exists", "type": null, "description": ""}], "created_at": 1789419969.7941194, "supported_languages": null}, "macro.dbt.snapshot_string_as_time": {"name": "snapshot_string_as_time", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/strategies.sql", "original_file_path": "macros/materializations/snapshots/strategies.sql", "unique_id": "macro.dbt.snapshot_string_as_time", "macro_sql": "{% macro snapshot_string_as_time(timestamp) -%}\n {{ adapter.dispatch('snapshot_string_as_time', 'dbt')(timestamp) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__snapshot_string_as_time"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "timestamp", "type": null, "description": ""}], "created_at": 1789419969.7944117, "supported_languages": null}, "macro.dbt.default__snapshot_string_as_time": {"name": "default__snapshot_string_as_time", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/strategies.sql", "original_file_path": "macros/materializations/snapshots/strategies.sql", "unique_id": "macro.dbt.default__snapshot_string_as_time", "macro_sql": "{% macro default__snapshot_string_as_time(timestamp) %}\n {% do exceptions.raise_not_implemented(\n 'snapshot_string_as_time macro not implemented for adapter '+adapter.type()\n ) %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "timestamp", "type": null, "description": ""}], "created_at": 1789419969.794699, "supported_languages": null}, "macro.dbt.snapshot_check_all_get_existing_columns": {"name": "snapshot_check_all_get_existing_columns", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/strategies.sql", "original_file_path": "macros/materializations/snapshots/strategies.sql", "unique_id": "macro.dbt.snapshot_check_all_get_existing_columns", "macro_sql": "{% macro snapshot_check_all_get_existing_columns(node, target_exists, check_cols_config) -%}\n {%- if not target_exists -%}\n {#-- no table yet -> return whatever the query does --#}\n {{ return((false, query_columns)) }}\n {%- endif -%}\n\n {#-- handle any schema changes --#}\n {%- set target_relation = adapter.get_relation(database=node.database, schema=node.schema, identifier=node.alias) -%}\n\n {% if check_cols_config == 'all' %}\n {%- set query_columns = get_columns_in_query(node['compiled_code']) -%}\n\n {% elif check_cols_config is iterable and (check_cols_config | length) > 0 %}\n {#-- query for proper casing/quoting, to support comparison below --#}\n {%- set select_check_cols_from_target -%}\n {#-- N.B. The whitespace below is necessary to avoid edge case issue with comments --#}\n {#-- See: https://github.com/dbt-labs/dbt-core/issues/6781 --#}\n select {{ check_cols_config | join(', ') }} from (\n {{ node['compiled_code'] }}\n ) subq\n {%- endset -%}\n {% set query_columns = get_columns_in_query(select_check_cols_from_target) %}\n\n {% else %}\n {% do exceptions.raise_compiler_error(\"Invalid value for 'check_cols': \" ~ check_cols_config) %}\n {% endif %}\n\n {%- set existing_cols = adapter.get_columns_in_relation(target_relation) | map(attribute = 'name') | list -%}\n {%- set ns = namespace() -%} {#-- handle for-loop scoping with a namespace --#}\n {%- set ns.column_added = false -%}\n\n {%- set intersection = [] -%}\n {%- for col in query_columns -%}\n {%- if col in existing_cols -%}\n {%- do intersection.append(adapter.quote(col)) -%}\n {%- else -%}\n {% set ns.column_added = true %}\n {%- endif -%}\n {%- endfor -%}\n {{ return((ns.column_added, intersection)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.get_columns_in_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "node", "type": null, "description": ""}, {"name": "target_exists", "type": null, "description": ""}, {"name": "check_cols_config", "type": null, "description": ""}], "created_at": 1789419969.7970452, "supported_languages": null}, "macro.dbt.snapshot_check_strategy": {"name": "snapshot_check_strategy", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/strategies.sql", "original_file_path": "macros/materializations/snapshots/strategies.sql", "unique_id": "macro.dbt.snapshot_check_strategy", "macro_sql": "{% macro snapshot_check_strategy(node, snapshotted_rel, current_rel, model_config, target_exists) %}\n {# The model_config parameter is no longer used, but is passed in anyway for compatibility. #}\n {% set check_cols_config = config.get('check_cols') %}\n {% set primary_key = config.get('unique_key') %}\n {% set hard_deletes = adapter.get_hard_deletes_behavior(config) %}\n {% set invalidate_hard_deletes = hard_deletes == 'invalidate' %}\n {% set updated_at = config.get('updated_at') or snapshot_get_time() %}\n\n {% set column_added = false %}\n\n {% set column_added, check_cols = snapshot_check_all_get_existing_columns(node, target_exists, check_cols_config) %}\n\n {%- set row_changed_expr -%}\n (\n {%- if column_added -%}\n {{ get_true_sql() }}\n {%- else -%}\n {%- for col in check_cols -%}\n {{ snapshotted_rel }}.{{ col }} != {{ current_rel }}.{{ col }}\n or\n (\n (({{ snapshotted_rel }}.{{ col }} is null) and not ({{ current_rel }}.{{ col }} is null))\n or\n ((not {{ snapshotted_rel }}.{{ col }} is null) and ({{ current_rel }}.{{ col }} is null))\n )\n {%- if not loop.last %} or {% endif -%}\n {%- endfor -%}\n {%- endif -%}\n )\n {%- endset %}\n\n {% set scd_args = api.Relation.scd_args(primary_key, updated_at) %}\n {% set scd_id_expr = snapshot_hash_arguments(scd_args) %}\n\n {% do return({\n \"unique_key\": primary_key,\n \"updated_at\": updated_at,\n \"row_changed\": row_changed_expr,\n \"scd_id\": scd_id_expr,\n \"invalidate_hard_deletes\": invalidate_hard_deletes,\n \"hard_deletes\": hard_deletes\n }) %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.snapshot_get_time", "macro.dbt.snapshot_check_all_get_existing_columns", "macro.dbt.get_true_sql", "macro.dbt.snapshot_hash_arguments"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "node", "type": null, "description": ""}, {"name": "snapshotted_rel", "type": null, "description": ""}, {"name": "current_rel", "type": null, "description": ""}, {"name": "model_config", "type": null, "description": ""}, {"name": "target_exists", "type": null, "description": ""}], "created_at": 1789419969.7995465, "supported_languages": null}, "macro.dbt.snapshot_merge_sql": {"name": "snapshot_merge_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/snapshot_merge.sql", "original_file_path": "macros/materializations/snapshots/snapshot_merge.sql", "unique_id": "macro.dbt.snapshot_merge_sql", "macro_sql": "{% macro snapshot_merge_sql(target, source, insert_cols) -%}\n {{ adapter.dispatch('snapshot_merge_sql', 'dbt')(target, source, insert_cols) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__snapshot_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "target", "type": null, "description": ""}, {"name": "source", "type": null, "description": ""}, {"name": "insert_cols", "type": null, "description": ""}], "created_at": 1789419969.8003557, "supported_languages": null}, "macro.dbt.default__snapshot_merge_sql": {"name": "default__snapshot_merge_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/snapshot_merge.sql", "original_file_path": "macros/materializations/snapshots/snapshot_merge.sql", "unique_id": "macro.dbt.default__snapshot_merge_sql", "macro_sql": "{% macro default__snapshot_merge_sql(target, source, insert_cols) -%}\n {%- set insert_cols_csv = insert_cols | join(', ') -%}\n\n {%- set columns = config.get(\"snapshot_table_column_names\") or get_snapshot_table_column_names() -%}\n\n merge into {{ target.render() }} as DBT_INTERNAL_DEST\n using {{ source }} as DBT_INTERNAL_SOURCE\n on DBT_INTERNAL_SOURCE.{{ columns.dbt_scd_id }} = DBT_INTERNAL_DEST.{{ columns.dbt_scd_id }}\n\n when matched\n {% if config.get(\"dbt_valid_to_current\") %}\n\t{% set source_unique_key = (\"DBT_INTERNAL_DEST.\" ~ columns.dbt_valid_to) | trim %}\n\t{% set target_unique_key = config.get('dbt_valid_to_current') | trim %}\n\tand ({{ equals(source_unique_key, target_unique_key) }} or {{ source_unique_key }} is null)\n\n {% else %}\n and DBT_INTERNAL_DEST.{{ columns.dbt_valid_to }} is null\n {% endif %}\n and DBT_INTERNAL_SOURCE.dbt_change_type in ('update', 'delete')\n then update\n set {{ columns.dbt_valid_to }} = DBT_INTERNAL_SOURCE.{{ columns.dbt_valid_to }}\n\n when not matched\n and DBT_INTERNAL_SOURCE.dbt_change_type = 'insert'\n then insert ({{ insert_cols_csv }})\n values ({{ insert_cols_csv }})\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_snapshot_table_column_names", "macro.dbt.equals"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "target", "type": null, "description": ""}, {"name": "source", "type": null, "description": ""}, {"name": "insert_cols", "type": null, "description": ""}], "created_at": 1789419969.8017497, "supported_languages": null}, "macro.dbt.create_columns": {"name": "create_columns", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "unique_id": "macro.dbt.create_columns", "macro_sql": "{% macro create_columns(relation, columns) %}\n {{ adapter.dispatch('create_columns', 'dbt')(relation, columns) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__create_columns"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "columns", "type": null, "description": ""}], "created_at": 1789419969.8055305, "supported_languages": null}, "macro.dbt.default__create_columns": {"name": "default__create_columns", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "unique_id": "macro.dbt.default__create_columns", "macro_sql": "{% macro default__create_columns(relation, columns) %}\n {% for column in columns %}\n {% call statement() %}\n alter table {{ relation.render() }} add column {{ adapter.quote(column.name) }} {{ column.expanded_data_type }};\n {% endcall %}\n {% endfor %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "columns", "type": null, "description": ""}], "created_at": 1789419969.8061185, "supported_languages": null}, "macro.dbt.post_snapshot": {"name": "post_snapshot", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "unique_id": "macro.dbt.post_snapshot", "macro_sql": "{% macro post_snapshot(staging_relation) %}\n {{ adapter.dispatch('post_snapshot', 'dbt')(staging_relation) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__post_snapshot"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "staging_relation", "type": null, "description": ""}], "created_at": 1789419969.8064182, "supported_languages": null}, "macro.dbt.default__post_snapshot": {"name": "default__post_snapshot", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "unique_id": "macro.dbt.default__post_snapshot", "macro_sql": "{% macro default__post_snapshot(staging_relation) %}\n {# no-op #}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "staging_relation", "type": null, "description": ""}], "created_at": 1789419969.806579, "supported_languages": null}, "macro.dbt.get_true_sql": {"name": "get_true_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "unique_id": "macro.dbt.get_true_sql", "macro_sql": "{% macro get_true_sql() %}\n {{ adapter.dispatch('get_true_sql', 'dbt')() }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_true_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789419969.8068397, "supported_languages": null}, "macro.dbt.default__get_true_sql": {"name": "default__get_true_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "unique_id": "macro.dbt.default__get_true_sql", "macro_sql": "{% macro default__get_true_sql() %}\n {{ return('TRUE') }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789419969.8070347, "supported_languages": null}, "macro.dbt.snapshot_staging_table": {"name": "snapshot_staging_table", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "unique_id": "macro.dbt.snapshot_staging_table", "macro_sql": "{% macro snapshot_staging_table(strategy, source_sql, target_relation) -%}\n {{ adapter.dispatch('snapshot_staging_table', 'dbt')(strategy, source_sql, target_relation) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__snapshot_staging_table"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "strategy", "type": null, "description": ""}, {"name": "source_sql", "type": null, "description": ""}, {"name": "target_relation", "type": null, "description": ""}], "created_at": 1789419969.807372, "supported_languages": null}, "macro.dbt.get_snapshot_table_column_names": {"name": "get_snapshot_table_column_names", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "unique_id": "macro.dbt.get_snapshot_table_column_names", "macro_sql": "{% macro get_snapshot_table_column_names() %}\n {{ return({'dbt_valid_to': 'dbt_valid_to', 'dbt_valid_from': 'dbt_valid_from', 'dbt_scd_id': 'dbt_scd_id', 'dbt_updated_at': 'dbt_updated_at', 'dbt_is_deleted': 'dbt_is_deleted'}) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789419969.807814, "supported_languages": null}, "macro.dbt.default__snapshot_staging_table": {"name": "default__snapshot_staging_table", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "unique_id": "macro.dbt.default__snapshot_staging_table", "macro_sql": "{% macro default__snapshot_staging_table(strategy, source_sql, target_relation) -%}\n {% set columns = config.get('snapshot_table_column_names') or get_snapshot_table_column_names() %}\n {% if strategy.hard_deletes == 'new_record' %}\n {% set new_scd_id = snapshot_hash_arguments([columns.dbt_scd_id, snapshot_get_time()]) %}\n {% endif %}\n with snapshot_query as (\n\n {{ source_sql }}\n\n ),\n\n snapshotted_data as (\n\n select *, {{ unique_key_fields(strategy.unique_key) }}\n from {{ target_relation }}\n where\n {% if config.get('dbt_valid_to_current') %}\n\t\t{% set source_unique_key = columns.dbt_valid_to | trim %}\n\t\t{% set target_unique_key = config.get('dbt_valid_to_current') | trim %}\n\n\t\t{# The exact equals semantics between NULL values depends on the current behavior flag set. Also, update records if the source field is null #}\n ( {{ equals(source_unique_key, target_unique_key) }} or {{ source_unique_key }} is null )\n {% else %}\n {{ columns.dbt_valid_to }} is null\n {% endif %}\n\n ),\n\n insertions_source_data as (\n\n select *, {{ unique_key_fields(strategy.unique_key) }},\n {{ strategy.updated_at }} as {{ columns.dbt_updated_at }},\n {{ strategy.updated_at }} as {{ columns.dbt_valid_from }},\n {{ get_dbt_valid_to_current(strategy, columns) }},\n {{ strategy.scd_id }} as {{ columns.dbt_scd_id }}\n\n from snapshot_query\n ),\n\n updates_source_data as (\n\n select *, {{ unique_key_fields(strategy.unique_key) }},\n {{ strategy.updated_at }} as {{ columns.dbt_updated_at }},\n {{ strategy.updated_at }} as {{ columns.dbt_valid_from }},\n {{ strategy.updated_at }} as {{ columns.dbt_valid_to }}\n\n from snapshot_query\n ),\n\n {%- if strategy.hard_deletes == 'invalidate' or strategy.hard_deletes == 'new_record' %}\n\n deletes_source_data as (\n\n select *, {{ unique_key_fields(strategy.unique_key) }}\n from snapshot_query\n ),\n {% endif %}\n\n insertions as (\n\n select\n 'insert' as dbt_change_type,\n source_data.*\n {%- if strategy.hard_deletes == 'new_record' -%}\n ,'False' as {{ columns.dbt_is_deleted }}\n {%- endif %}\n\n from insertions_source_data as source_data\n left outer join snapshotted_data\n on {{ unique_key_join_on(strategy.unique_key, \"snapshotted_data\", \"source_data\") }}\n where {{ unique_key_is_null(strategy.unique_key, \"snapshotted_data\") }}\n or ({{ unique_key_is_not_null(strategy.unique_key, \"snapshotted_data\") }} and (\n {{ strategy.row_changed }} {%- if strategy.hard_deletes == 'new_record' -%} or snapshotted_data.{{ columns.dbt_is_deleted }} = 'True' {% endif %}\n )\n\n )\n\n ),\n\n updates as (\n\n select\n 'update' as dbt_change_type,\n source_data.*,\n snapshotted_data.{{ columns.dbt_scd_id }}\n {%- if strategy.hard_deletes == 'new_record' -%}\n , snapshotted_data.{{ columns.dbt_is_deleted }}\n {%- endif %}\n\n from updates_source_data as source_data\n join snapshotted_data\n on {{ unique_key_join_on(strategy.unique_key, \"snapshotted_data\", \"source_data\") }}\n where (\n {{ strategy.row_changed }} {%- if strategy.hard_deletes == 'new_record' -%} or snapshotted_data.{{ columns.dbt_is_deleted }} = 'True' {% endif %}\n )\n )\n\n {%- if strategy.hard_deletes == 'invalidate' or strategy.hard_deletes == 'new_record' %}\n ,\n deletes as (\n\n select\n 'delete' as dbt_change_type,\n source_data.*,\n {{ snapshot_get_time() }} as {{ columns.dbt_valid_from }},\n {{ snapshot_get_time() }} as {{ columns.dbt_updated_at }},\n {{ snapshot_get_time() }} as {{ columns.dbt_valid_to }},\n snapshotted_data.{{ columns.dbt_scd_id }}\n {%- if strategy.hard_deletes == 'new_record' -%}\n , snapshotted_data.{{ columns.dbt_is_deleted }}\n {%- endif %}\n from snapshotted_data\n left join deletes_source_data as source_data\n on {{ unique_key_join_on(strategy.unique_key, \"snapshotted_data\", \"source_data\") }}\n where {{ unique_key_is_null(strategy.unique_key, \"source_data\") }}\n\n {%- if strategy.hard_deletes == 'new_record' %}\n and not (\n --avoid updating the record's valid_to if the latest entry is marked as deleted\n snapshotted_data.{{ columns.dbt_is_deleted }} = 'True'\n and\n {% if config.get('dbt_valid_to_current') -%}\n snapshotted_data.{{ columns.dbt_valid_to }} = {{ config.get('dbt_valid_to_current') }}\n {%- else -%}\n snapshotted_data.{{ columns.dbt_valid_to }} is null\n {%- endif %}\n )\n {%- endif %}\n )\n {%- endif %}\n\n {%- if strategy.hard_deletes == 'new_record' %}\n {% set snapshotted_cols = get_list_of_column_names(get_columns_in_relation(target_relation)) %}\n {% set source_col_names = get_columns_in_query(source_sql) %}\n ,\n deletion_records as (\n\n select\n 'insert' as dbt_change_type,\n {%- for col_name in source_col_names -%}\n {%- if col_name in snapshotted_cols -%}\n snapshotted_data.{{ adapter.quote(col_name) }},\n {%- else -%}\n source_data.{{ adapter.quote(col_name) }},\n {%- endif -%}\n {% endfor -%}\n {%- if strategy.unique_key | is_list -%}\n {%- for key in strategy.unique_key -%}\n snapshotted_data.{{ key }} as dbt_unique_key_{{ loop.index }},\n {% endfor -%}\n {%- else -%}\n snapshotted_data.dbt_unique_key as dbt_unique_key,\n {% endif -%}\n {{ snapshot_get_time() }} as {{ columns.dbt_valid_from }},\n {{ snapshot_get_time() }} as {{ columns.dbt_updated_at }},\n snapshotted_data.{{ columns.dbt_valid_to }} as {{ columns.dbt_valid_to }},\n {{ new_scd_id }} as {{ columns.dbt_scd_id }},\n 'True' as {{ columns.dbt_is_deleted }}\n from snapshotted_data\n left join deletes_source_data as source_data\n on {{ unique_key_join_on(strategy.unique_key, \"snapshotted_data\", \"source_data\") }}\n where {{ unique_key_is_null(strategy.unique_key, \"source_data\") }}\n and not (\n --avoid inserting a new record if the latest one is marked as deleted\n snapshotted_data.{{ columns.dbt_is_deleted }} = 'True'\n and\n {% if config.get('dbt_valid_to_current') -%}\n snapshotted_data.{{ columns.dbt_valid_to }} = {{ config.get('dbt_valid_to_current') }}\n {%- else -%}\n snapshotted_data.{{ columns.dbt_valid_to }} is null\n {%- endif %}\n )\n\n )\n {%- endif %}\n\n select * from insertions\n union all\n select * from updates\n {%- if strategy.hard_deletes == 'invalidate' or strategy.hard_deletes == 'new_record' %}\n union all\n select * from deletes\n {%- endif %}\n {%- if strategy.hard_deletes == 'new_record' %}\n union all\n select * from deletion_records\n {%- endif %}\n\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.get_snapshot_table_column_names", "macro.dbt.snapshot_hash_arguments", "macro.dbt.snapshot_get_time", "macro.dbt.unique_key_fields", "macro.dbt.equals", "macro.dbt.get_dbt_valid_to_current", "macro.dbt.unique_key_join_on", "macro.dbt.unique_key_is_null", "macro.dbt.unique_key_is_not_null", "macro.dbt.get_list_of_column_names", "macro.dbt.get_columns_in_relation", "macro.dbt.get_columns_in_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "strategy", "type": null, "description": ""}, {"name": "source_sql", "type": null, "description": ""}, {"name": "target_relation", "type": null, "description": ""}], "created_at": 1789419969.8150897, "supported_languages": null}, "macro.dbt.build_snapshot_table": {"name": "build_snapshot_table", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "unique_id": "macro.dbt.build_snapshot_table", "macro_sql": "{% macro build_snapshot_table(strategy, sql) -%}\n {{ adapter.dispatch('build_snapshot_table', 'dbt')(strategy, sql) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__build_snapshot_table"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "strategy", "type": null, "description": ""}, {"name": "sql", "type": null, "description": ""}], "created_at": 1789419969.8154979, "supported_languages": null}, "macro.dbt.default__build_snapshot_table": {"name": "default__build_snapshot_table", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "unique_id": "macro.dbt.default__build_snapshot_table", "macro_sql": "{% macro default__build_snapshot_table(strategy, sql) %}\n {% set columns = config.get('snapshot_table_column_names') or get_snapshot_table_column_names() %}\n\n select *,\n {{ strategy.scd_id }} as {{ columns.dbt_scd_id }},\n {{ strategy.updated_at }} as {{ columns.dbt_updated_at }},\n {{ strategy.updated_at }} as {{ columns.dbt_valid_from }},\n {{ get_dbt_valid_to_current(strategy, columns) }}\n {%- if strategy.hard_deletes == 'new_record' -%}\n , 'False' as {{ columns.dbt_is_deleted }}\n {% endif -%}\n from (\n {{ sql }}\n ) sbq\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_snapshot_table_column_names", "macro.dbt.get_dbt_valid_to_current"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "strategy", "type": null, "description": ""}, {"name": "sql", "type": null, "description": ""}], "created_at": 1789419969.8163733, "supported_languages": null}, "macro.dbt.build_snapshot_staging_table": {"name": "build_snapshot_staging_table", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "unique_id": "macro.dbt.build_snapshot_staging_table", "macro_sql": "{% macro build_snapshot_staging_table(strategy, sql, target_relation) %}\n {% set temp_relation = make_temp_relation(target_relation) %}\n\n {% set select = snapshot_staging_table(strategy, sql, target_relation) %}\n\n {% call statement('build_snapshot_staging_relation') %}\n {{ create_table_as(True, temp_relation, select) }}\n {% endcall %}\n\n {% do return(temp_relation) %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.make_temp_relation", "macro.dbt.snapshot_staging_table", "macro.dbt.statement", "macro.dbt.create_table_as"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "strategy", "type": null, "description": ""}, {"name": "sql", "type": null, "description": ""}, {"name": "target_relation", "type": null, "description": ""}], "created_at": 1789419969.8171027, "supported_languages": null}, "macro.dbt.get_updated_at_column_data_type": {"name": "get_updated_at_column_data_type", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "unique_id": "macro.dbt.get_updated_at_column_data_type", "macro_sql": "{% macro get_updated_at_column_data_type(snapshot_sql) %}\n {% set snapshot_sql_column_schema = get_column_schema_from_query(snapshot_sql) %}\n {% set dbt_updated_at_data_type = null %}\n {% set ns = namespace() -%} {#-- handle for-loop scoping with a namespace --#}\n {% set ns.dbt_updated_at_data_type = null -%}\n {% for column in snapshot_sql_column_schema %}\n {% if ((column.column == 'dbt_updated_at') or (column.column == 'DBT_UPDATED_AT')) %}\n {% set ns.dbt_updated_at_data_type = column.dtype %}\n {% endif %}\n {% endfor %}\n {{ return(ns.dbt_updated_at_data_type or none) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_column_schema_from_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "snapshot_sql", "type": null, "description": ""}], "created_at": 1789419969.8180866, "supported_languages": null}, "macro.dbt.check_time_data_types": {"name": "check_time_data_types", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "unique_id": "macro.dbt.check_time_data_types", "macro_sql": "{% macro check_time_data_types(sql) %}\n {% set dbt_updated_at_data_type = get_updated_at_column_data_type(sql) %}\n {% set snapshot_get_time_data_type = get_snapshot_get_time_data_type() %}\n {% if snapshot_get_time_data_type is not none and dbt_updated_at_data_type is not none and snapshot_get_time_data_type != dbt_updated_at_data_type %}\n {% if exceptions.warn_snapshot_timestamp_data_types %}\n {{ exceptions.warn_snapshot_timestamp_data_types(snapshot_get_time_data_type, dbt_updated_at_data_type) }}\n {% endif %}\n {% endif %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_updated_at_column_data_type", "macro.dbt.get_snapshot_get_time_data_type"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "sql", "type": null, "description": ""}], "created_at": 1789419969.8188083, "supported_languages": null}, "macro.dbt.get_dbt_valid_to_current": {"name": "get_dbt_valid_to_current", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "unique_id": "macro.dbt.get_dbt_valid_to_current", "macro_sql": "{% macro get_dbt_valid_to_current(strategy, columns) %}\n {% set dbt_valid_to_current = config.get('dbt_valid_to_current') or \"null\" %}\n coalesce(nullif({{ strategy.updated_at }}, {{ strategy.updated_at }}), {{dbt_valid_to_current}})\n as {{ columns.dbt_valid_to }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "strategy", "type": null, "description": ""}, {"name": "columns", "type": null, "description": ""}], "created_at": 1789419969.8192756, "supported_languages": null}, "macro.dbt.unique_key_fields": {"name": "unique_key_fields", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "unique_id": "macro.dbt.unique_key_fields", "macro_sql": "{% macro unique_key_fields(unique_key) %}\n {% if unique_key | is_list %}\n {% for key in unique_key %}\n {{ key }} as dbt_unique_key_{{ loop.index }}\n {%- if not loop.last %} , {%- endif %}\n {% endfor %}\n {% else %}\n {{ unique_key }} as dbt_unique_key\n {% endif %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "unique_key", "type": null, "description": ""}], "created_at": 1789419969.81985, "supported_languages": null}, "macro.dbt.unique_key_join_on": {"name": "unique_key_join_on", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "unique_id": "macro.dbt.unique_key_join_on", "macro_sql": "{% macro unique_key_join_on(unique_key, identifier, from_identifier) %}\n {% if unique_key | is_list %}\n {% for key in unique_key %}\n\t {% set source_unique_key = (identifier ~ \".dbt_unique_key_\" ~ loop.index) | trim %}\n\t {% set target_unique_key = (from_identifier ~ \".dbt_unique_key_\" ~ loop.index) | trim %}\n\t {{ equals(source_unique_key, target_unique_key) }}\n {%- if not loop.last %} and {%- endif %}\n {% endfor %}\n {% else %}\n {{ identifier }}.dbt_unique_key = {{ from_identifier }}.dbt_unique_key\n {% endif %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.equals"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "unique_key", "type": null, "description": ""}, {"name": "identifier", "type": null, "description": ""}, {"name": "from_identifier", "type": null, "description": ""}], "created_at": 1789419969.8208044, "supported_languages": null}, "macro.dbt.unique_key_is_null": {"name": "unique_key_is_null", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "unique_id": "macro.dbt.unique_key_is_null", "macro_sql": "{% macro unique_key_is_null(unique_key, identifier) %}\n {% if unique_key | is_list %}\n {{ identifier }}.dbt_unique_key_1 is null\n {% else %}\n {{ identifier }}.dbt_unique_key is null\n {% endif %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "unique_key", "type": null, "description": ""}, {"name": "identifier", "type": null, "description": ""}], "created_at": 1789419969.821157, "supported_languages": null}, "macro.dbt.unique_key_is_not_null": {"name": "unique_key_is_not_null", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "unique_id": "macro.dbt.unique_key_is_not_null", "macro_sql": "{% macro unique_key_is_not_null(unique_key, identifier) %}\n {% if unique_key | is_list %}\n {{ identifier }}.dbt_unique_key_1 is not null\n {% else %}\n {{ identifier }}.dbt_unique_key is not null\n {% endif %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "unique_key", "type": null, "description": ""}, {"name": "identifier", "type": null, "description": ""}], "created_at": 1789419969.8214967, "supported_languages": null}, "macro.dbt.get_aggregate_function_create_replace_signature": {"name": "get_aggregate_function_create_replace_signature", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/functions/aggregate.sql", "original_file_path": "macros/materializations/functions/aggregate.sql", "unique_id": "macro.dbt.get_aggregate_function_create_replace_signature", "macro_sql": "{% macro get_aggregate_function_create_replace_signature(target_relation) %}\n {{ return(adapter.dispatch('get_aggregate_function_create_replace_signature', 'dbt')(target_relation)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_aggregate_function_create_replace_signature"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "target_relation", "type": null, "description": ""}], "created_at": 1789419969.8227062, "supported_languages": null}, "macro.dbt.default__get_aggregate_function_create_replace_signature": {"name": "default__get_aggregate_function_create_replace_signature", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/functions/aggregate.sql", "original_file_path": "macros/materializations/functions/aggregate.sql", "unique_id": "macro.dbt.default__get_aggregate_function_create_replace_signature", "macro_sql": "{% macro default__get_aggregate_function_create_replace_signature(target_relation) %}\n CREATE OR REPLACE AGGREGATE FUNCTION {{ target_relation.render() }} ({{ get_formatted_aggregate_function_args()}})\n RETURNS {{ model.returns.data_type }}\n {{ get_function_language_specifier() }}\n {{ get_aggregate_function_volatility_specifier() }}\n {% if model.get('language') == 'python' %}\n {{ get_function_python_options() }}\n {% endif %}\n AS\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_formatted_aggregate_function_args", "macro.dbt.get_function_language_specifier", "macro.dbt.get_aggregate_function_volatility_specifier", "macro.dbt.get_function_python_options"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "target_relation", "type": null, "description": ""}], "created_at": 1789419969.8233306, "supported_languages": null}, "macro.dbt.get_formatted_aggregate_function_args": {"name": "get_formatted_aggregate_function_args", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/functions/aggregate.sql", "original_file_path": "macros/materializations/functions/aggregate.sql", "unique_id": "macro.dbt.get_formatted_aggregate_function_args", "macro_sql": "{% macro get_formatted_aggregate_function_args() %}\n {{ return(adapter.dispatch('get_formatted_aggregate_function_args', 'dbt')()) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_formatted_aggregate_function_args"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789419969.8236132, "supported_languages": null}, "macro.dbt.default__get_formatted_aggregate_function_args": {"name": "default__get_formatted_aggregate_function_args", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/functions/aggregate.sql", "original_file_path": "macros/materializations/functions/aggregate.sql", "unique_id": "macro.dbt.default__get_formatted_aggregate_function_args", "macro_sql": "{% macro default__get_formatted_aggregate_function_args() %}\n {# conveniently we can reuse the sql scalar function args #}\n {{ formatted_scalar_function_args_sql() }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.formatted_scalar_function_args_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789419969.8238158, "supported_languages": null}, "macro.dbt.get_function_language_specifier": {"name": "get_function_language_specifier", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/functions/aggregate.sql", "original_file_path": "macros/materializations/functions/aggregate.sql", "unique_id": "macro.dbt.get_function_language_specifier", "macro_sql": "{% macro get_function_language_specifier() %}\n {{ return(adapter.dispatch('get_function_language_specifier', 'dbt')()) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_function_language_specifier"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789419969.8240852, "supported_languages": null}, "macro.dbt.default__get_function_language_specifier": {"name": "default__get_function_language_specifier", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/functions/aggregate.sql", "original_file_path": "macros/materializations/functions/aggregate.sql", "unique_id": "macro.dbt.default__get_function_language_specifier", "macro_sql": "{% macro default__get_function_language_specifier() %}\n {% set language = model.get('language') %}\n {% if language == 'sql' %}\n {# generally you dont need to specify the language for sql functions #}\n {% elif language == 'python' %}\n LANGUAGE PYTHON\n {% elif language == 'javascript' %}\n LANGUAGE js\n {% else %}\n {{ 'LANGUAGE ' ~ language.upper() }}\n {% endif %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789419969.825275, "supported_languages": null}, "macro.dbt.get_aggregate_function_volatility_specifier": {"name": "get_aggregate_function_volatility_specifier", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/functions/aggregate.sql", "original_file_path": "macros/materializations/functions/aggregate.sql", "unique_id": "macro.dbt.get_aggregate_function_volatility_specifier", "macro_sql": "{% macro get_aggregate_function_volatility_specifier() %}\n {{ return(adapter.dispatch('get_aggregate_function_volatility_specifier', 'dbt')()) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_aggregate_function_volatility_specifier"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789419969.8255734, "supported_languages": null}, "macro.dbt.default__get_aggregate_function_volatility_specifier": {"name": "default__get_aggregate_function_volatility_specifier", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/functions/aggregate.sql", "original_file_path": "macros/materializations/functions/aggregate.sql", "unique_id": "macro.dbt.default__get_aggregate_function_volatility_specifier", "macro_sql": "{% macro default__get_aggregate_function_volatility_specifier() %}\n {{ scalar_function_volatility_sql() }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.scalar_function_volatility_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789419969.8257716, "supported_languages": null}, "macro.dbt.get_function_python_options": {"name": "get_function_python_options", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/functions/aggregate.sql", "original_file_path": "macros/materializations/functions/aggregate.sql", "unique_id": "macro.dbt.get_function_python_options", "macro_sql": "{% macro get_function_python_options() %}\n {{ return(adapter.dispatch('get_function_python_options', 'dbt')()) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_function_python_options"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789419969.8260462, "supported_languages": null}, "macro.dbt.default__get_function_python_options": {"name": "default__get_function_python_options", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/functions/aggregate.sql", "original_file_path": "macros/materializations/functions/aggregate.sql", "unique_id": "macro.dbt.default__get_function_python_options", "macro_sql": "{% macro default__get_function_python_options() %}\n RUNTIME_VERSION = '{{ model.config.get('runtime_version') }}'\n HANDLER = '{{ model.config.get('entry_point') }}'\n {% set packages = model.config.get('packages', []) %}\n {% if packages %}\n PACKAGES = ('{{ packages | join(\"','\") }}')\n {% endif %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789419969.8266501, "supported_languages": null}, "macro.dbt.scalar_function_sql": {"name": "scalar_function_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/functions/scalar.sql", "original_file_path": "macros/materializations/functions/scalar.sql", "unique_id": "macro.dbt.scalar_function_sql", "macro_sql": "{% macro scalar_function_sql(target_relation) %}\n {{ return(adapter.dispatch('scalar_function_sql', 'dbt')(target_relation)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__scalar_function_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "target_relation", "type": null, "description": ""}], "created_at": 1789419969.8281016, "supported_languages": null}, "macro.dbt.default__scalar_function_sql": {"name": "default__scalar_function_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/functions/scalar.sql", "original_file_path": "macros/materializations/functions/scalar.sql", "unique_id": "macro.dbt.default__scalar_function_sql", "macro_sql": "{% macro default__scalar_function_sql(target_relation) %}\n {{ scalar_function_create_replace_signature_sql(target_relation) }}\n {{ scalar_function_body_sql() }};\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.scalar_function_create_replace_signature_sql", "macro.dbt.scalar_function_body_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "target_relation", "type": null, "description": ""}], "created_at": 1789419969.8283668, "supported_languages": null}, "macro.dbt.scalar_function_create_replace_signature_sql": {"name": "scalar_function_create_replace_signature_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/functions/scalar.sql", "original_file_path": "macros/materializations/functions/scalar.sql", "unique_id": "macro.dbt.scalar_function_create_replace_signature_sql", "macro_sql": "{% macro scalar_function_create_replace_signature_sql(target_relation) %}\n {{ return(adapter.dispatch('scalar_function_create_replace_signature_sql', 'dbt')(target_relation)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__scalar_function_create_replace_signature_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "target_relation", "type": null, "description": ""}], "created_at": 1789419969.828672, "supported_languages": null}, "macro.dbt.default__scalar_function_create_replace_signature_sql": {"name": "default__scalar_function_create_replace_signature_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/functions/scalar.sql", "original_file_path": "macros/materializations/functions/scalar.sql", "unique_id": "macro.dbt.default__scalar_function_create_replace_signature_sql", "macro_sql": "{% macro default__scalar_function_create_replace_signature_sql(target_relation) %}\n CREATE OR REPLACE FUNCTION {{ target_relation.render() }} ({{ formatted_scalar_function_args_sql()}})\n RETURNS {{ model.returns.data_type }}\n {{ scalar_function_volatility_sql() }}\n AS\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.formatted_scalar_function_args_sql", "macro.dbt.scalar_function_volatility_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "target_relation", "type": null, "description": ""}], "created_at": 1789419969.8290424, "supported_languages": null}, "macro.dbt.formatted_scalar_function_args_sql": {"name": "formatted_scalar_function_args_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/functions/scalar.sql", "original_file_path": "macros/materializations/functions/scalar.sql", "unique_id": "macro.dbt.formatted_scalar_function_args_sql", "macro_sql": "{% macro formatted_scalar_function_args_sql() %}\n {{ return(adapter.dispatch('formatted_scalar_function_args_sql', 'dbt')()) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__formatted_scalar_function_args_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789419969.82932, "supported_languages": null}, "macro.dbt.formatted_scalar_function_args_javascript": {"name": "formatted_scalar_function_args_javascript", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/functions/scalar.sql", "original_file_path": "macros/materializations/functions/scalar.sql", "unique_id": "macro.dbt.formatted_scalar_function_args_javascript", "macro_sql": "{% macro formatted_scalar_function_args_javascript() %}\n {{ return(adapter.dispatch('formatted_scalar_function_args_javascript', 'dbt')()) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__formatted_scalar_function_args_javascript"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789419969.8295906, "supported_languages": null}, "macro.dbt.default__formatted_scalar_function_args_sql": {"name": "default__formatted_scalar_function_args_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/functions/scalar.sql", "original_file_path": "macros/materializations/functions/scalar.sql", "unique_id": "macro.dbt.default__formatted_scalar_function_args_sql", "macro_sql": "{% macro default__formatted_scalar_function_args_sql() %}\n {% set args = [] %}\n {% for arg in model.arguments -%}\n {%- do args.append(arg.name ~ ' ' ~ arg.data_type) -%}\n {%- endfor %}\n {{ args | join(', ') }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789419969.8301442, "supported_languages": null}, "macro.dbt.default__formatted_scalar_function_args_javascript": {"name": "default__formatted_scalar_function_args_javascript", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/functions/scalar.sql", "original_file_path": "macros/materializations/functions/scalar.sql", "unique_id": "macro.dbt.default__formatted_scalar_function_args_javascript", "macro_sql": "{% macro default__formatted_scalar_function_args_javascript() %}\n {% set msg = \"formatted_scalar_function_args_javascript not implemented for adapter \" ~ adapter.type() %}\n {% do exceptions.raise_compiler_error(msg) %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789419969.8304963, "supported_languages": null}, "macro.dbt.scalar_function_body_sql": {"name": "scalar_function_body_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/functions/scalar.sql", "original_file_path": "macros/materializations/functions/scalar.sql", "unique_id": "macro.dbt.scalar_function_body_sql", "macro_sql": "{% macro scalar_function_body_sql() %}\n {{ return(adapter.dispatch('scalar_function_body_sql', 'dbt')()) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__scalar_function_body_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789419969.830789, "supported_languages": null}, "macro.dbt.default__scalar_function_body_sql": {"name": "default__scalar_function_body_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/functions/scalar.sql", "original_file_path": "macros/materializations/functions/scalar.sql", "unique_id": "macro.dbt.default__scalar_function_body_sql", "macro_sql": "{% macro default__scalar_function_body_sql() %}\n $$\n {{ model.compiled_code }}\n $$ LANGUAGE SQL\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789419969.830968, "supported_languages": null}, "macro.dbt.scalar_function_volatility_sql": {"name": "scalar_function_volatility_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/functions/scalar.sql", "original_file_path": "macros/materializations/functions/scalar.sql", "unique_id": "macro.dbt.scalar_function_volatility_sql", "macro_sql": "{% macro scalar_function_volatility_sql() %}\n {{ return(adapter.dispatch('scalar_function_volatility_sql', 'dbt')()) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__scalar_function_volatility_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789419969.8312378, "supported_languages": null}, "macro.dbt.scalar_function_volatility_javascript": {"name": "scalar_function_volatility_javascript", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/functions/scalar.sql", "original_file_path": "macros/materializations/functions/scalar.sql", "unique_id": "macro.dbt.scalar_function_volatility_javascript", "macro_sql": "{% macro scalar_function_volatility_javascript() %}\n {{ return(adapter.dispatch('scalar_function_volatility_javascript', 'dbt')()) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__scalar_function_volatility_javascript"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789419969.8315058, "supported_languages": null}, "macro.dbt.default__scalar_function_volatility_javascript": {"name": "default__scalar_function_volatility_javascript", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/functions/scalar.sql", "original_file_path": "macros/materializations/functions/scalar.sql", "unique_id": "macro.dbt.default__scalar_function_volatility_javascript", "macro_sql": "{% macro default__scalar_function_volatility_javascript() %}\n {% set volatility = model.config.get('volatility') %}\n {% if volatility != none %}\n {% set msg = \"Volatility is not supported by \" ~ adapter.type() ~ \" in javascript UDF and will be ignored\" %}\n {% do exceptions.warn(msg) %}\n {% endif %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789419969.912686, "supported_languages": null}, "macro.dbt.default__scalar_function_volatility_sql": {"name": "default__scalar_function_volatility_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/functions/scalar.sql", "original_file_path": "macros/materializations/functions/scalar.sql", "unique_id": "macro.dbt.default__scalar_function_volatility_sql", "macro_sql": "{% macro default__scalar_function_volatility_sql() %}\n {% set volatility = model.config.get('volatility') %}\n {% if volatility == 'deterministic' %}\n IMMUTABLE\n {% elif volatility == 'stable' %}\n STABLE\n {% elif volatility == 'non-deterministic' %}\n VOLATILE\n {% elif volatility != none %}\n {# This shouldn't happen unless a new volatility is invented #}\n {% do unsupported_volatility_warning(volatility) %}\n {% endif %}\n {# If no volatility is set, don't add anything and let the data warehouse default it #}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.unsupported_volatility_warning"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789419969.9135878, "supported_languages": null}, "macro.dbt.unsupported_volatility_warning": {"name": "unsupported_volatility_warning", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/functions/scalar.sql", "original_file_path": "macros/materializations/functions/scalar.sql", "unique_id": "macro.dbt.unsupported_volatility_warning", "macro_sql": "{% macro unsupported_volatility_warning(volatility) %}\n {{ return(adapter.dispatch('unsupported_volatility_warning', 'dbt')(volatility)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__unsupported_volatility_warning"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "volatility", "type": null, "description": ""}], "created_at": 1789419969.9139822, "supported_languages": null}, "macro.dbt.default__unsupported_volatility_warning": {"name": "default__unsupported_volatility_warning", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/functions/scalar.sql", "original_file_path": "macros/materializations/functions/scalar.sql", "unique_id": "macro.dbt.default__unsupported_volatility_warning", "macro_sql": "{% macro default__unsupported_volatility_warning(volatility) %}\n {% set msg = \"Found `\" ~ volatility ~ \"` volatility specified on function `\" ~ model.name ~ \"`. This volatility is not supported by \" ~ adapter.type() ~ \", and will be ignored\" %}\n {% do exceptions.warn(msg) %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "volatility", "type": null, "description": ""}], "created_at": 1789419969.9144661, "supported_languages": null}, "macro.dbt.materialization_function_default": {"name": "materialization_function_default", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/functions/function.sql", "original_file_path": "macros/materializations/functions/function.sql", "unique_id": "macro.dbt.materialization_function_default", "macro_sql": "{% materialization function, default, supported_languages=['sql', 'python', 'javascript'] %}\n {% set existing_relation = load_cached_relation(this) %}\n {% set target_relation = this.incorporate(type=this.Function) %}\n\n {{ run_hooks(pre_hooks) }}\n\n {% set function_config = this.get_function_config(model) %}\n {% set macro_name = this.get_function_macro_name(function_config) %}\n\n {# Doing this aliasing of adapter.dispatch is a hacky way to disable the static analysis of actually calling adapter.dispatch #}\n {# This is necessary because the static analysis breaks being able to dynamically pass a macro_name #}\n {% set _dispatch = adapter.dispatch %}\n\n {% set build_sql = _dispatch(macro_name, 'dbt')(target_relation) %}\n {{ function_execute_build_sql(build_sql, existing_relation, target_relation) }}\n {{ run_hooks(post_hooks) }}\n\n {{ return({'relations': [target_relation]}) }}\n\n{% endmaterialization %}", "depends_on": {"macros": ["macro.dbt.load_cached_relation", "macro.dbt.run_hooks", "macro.dbt.function_execute_build_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "supported_languages", "type": null, "description": ""}], "created_at": 1789419969.916229, "supported_languages": ["sql", "python", "javascript"]}, "macro.dbt.function_execute_build_sql": {"name": "function_execute_build_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/functions/helpers.sql", "original_file_path": "macros/materializations/functions/helpers.sql", "unique_id": "macro.dbt.function_execute_build_sql", "macro_sql": "{% macro function_execute_build_sql(build_sql, existing_relation, target_relation) %}\n {{ return(adapter.dispatch('function_execute_build_sql', 'dbt')(build_sql, existing_relation, target_relation)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__function_execute_build_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "build_sql", "type": null, "description": ""}, {"name": "existing_relation", "type": null, "description": ""}, {"name": "target_relation", "type": null, "description": ""}], "created_at": 1789419969.916977, "supported_languages": null}, "macro.dbt.default__function_execute_build_sql": {"name": "default__function_execute_build_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/functions/helpers.sql", "original_file_path": "macros/materializations/functions/helpers.sql", "unique_id": "macro.dbt.default__function_execute_build_sql", "macro_sql": "{% macro default__function_execute_build_sql(build_sql, existing_relation, target_relation) %}\n\n {% set grant_config = config.get('grants') %}\n\n {% call statement(name=\"main\") %}\n {{ build_sql }}\n {% endcall %}\n\n {% set should_revoke = should_revoke(existing_relation, full_refresh_mode=True) %}\n {% do apply_grants(target_relation, grant_config, should_revoke=should_revoke) %}\n\n {% do persist_docs(target_relation, model) %}\n\n {{ adapter.commit() }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement", "macro.dbt.should_revoke", "macro.dbt.apply_grants", "macro.dbt.persist_docs"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "build_sql", "type": null, "description": ""}, {"name": "existing_relation", "type": null, "description": ""}, {"name": "target_relation", "type": null, "description": ""}], "created_at": 1789419969.917903, "supported_languages": null}, "macro.dbt.materialization_table_default": {"name": "materialization_table_default", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/table.sql", "original_file_path": "macros/materializations/models/table.sql", "unique_id": "macro.dbt.materialization_table_default", "macro_sql": "{% materialization table, default %}\n\n {%- set existing_relation = load_cached_relation(this) -%}\n {%- set target_relation = this.incorporate(type='table') %}\n {%- set intermediate_relation = make_intermediate_relation(target_relation) -%}\n -- the intermediate_relation should not already exist in the database; get_relation\n -- will return None in that case. Otherwise, we get a relation that we can drop\n -- later, before we try to use this name for the current operation\n {%- set preexisting_intermediate_relation = load_cached_relation(intermediate_relation) -%}\n /*\n See ../view/view.sql for more information about this relation.\n */\n {%- set backup_relation_type = 'table' if existing_relation is none else existing_relation.type -%}\n {%- set backup_relation = make_backup_relation(target_relation, backup_relation_type) -%}\n -- as above, the backup_relation should not already exist\n {%- set preexisting_backup_relation = load_cached_relation(backup_relation) -%}\n -- grab current tables grants config for comparision later on\n {% set grant_config = config.get('grants') %}\n\n -- drop the temp relations if they exist already in the database\n {{ drop_relation_if_exists(preexisting_intermediate_relation) }}\n {{ drop_relation_if_exists(preexisting_backup_relation) }}\n\n {{ run_hooks(pre_hooks, inside_transaction=False) }}\n\n -- `BEGIN` happens here:\n {{ run_hooks(pre_hooks, inside_transaction=True) }}\n\n -- build model\n {% call statement('main') -%}\n {{ get_create_table_as_sql(False, intermediate_relation, sql) }}\n {%- endcall %}\n\n {% do create_indexes(intermediate_relation) %}\n\n -- cleanup\n {% if existing_relation is not none %}\n /* Do the equivalent of rename_if_exists. 'existing_relation' could have been dropped\n since the variable was first set. */\n {% set existing_relation = load_cached_relation(existing_relation) %}\n {% if existing_relation is not none %}\n {{ adapter.rename_relation(existing_relation, backup_relation) }}\n {% endif %}\n {% endif %}\n\n {{ adapter.rename_relation(intermediate_relation, target_relation) }}\n\n {{ run_hooks(post_hooks, inside_transaction=True) }}\n\n {% set should_revoke = should_revoke(existing_relation, full_refresh_mode=True) %}\n {% do apply_grants(target_relation, grant_config, should_revoke=should_revoke) %}\n\n {% do persist_docs(target_relation, model) %}\n\n -- `COMMIT` happens here\n {{ adapter.commit() }}\n\n -- finally, drop the existing/backup relation after the commit\n {{ drop_relation_if_exists(backup_relation) }}\n\n {{ run_hooks(post_hooks, inside_transaction=False) }}\n\n {{ return({'relations': [target_relation]}) }}\n{% endmaterialization %}", "depends_on": {"macros": ["macro.dbt.load_cached_relation", "macro.dbt.make_intermediate_relation", "macro.dbt.make_backup_relation", "macro.dbt.drop_relation_if_exists", "macro.dbt.run_hooks", "macro.dbt.statement", "macro.dbt.get_create_table_as_sql", "macro.dbt.create_indexes", "macro.dbt.should_revoke", "macro.dbt.apply_grants", "macro.dbt.persist_docs"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "supported_languages", "type": null, "description": ""}], "created_at": 1789419969.9217157, "supported_languages": ["sql"]}, "macro.dbt.materialization_materialized_view_default": {"name": "materialization_materialized_view_default", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/materialized_view.sql", "original_file_path": "macros/materializations/models/materialized_view.sql", "unique_id": "macro.dbt.materialization_materialized_view_default", "macro_sql": "{% materialization materialized_view, default %}\n {% set existing_relation = load_cached_relation(this) %}\n {% set target_relation = this.incorporate(type=this.MaterializedView) %}\n {% set intermediate_relation = make_intermediate_relation(target_relation) %}\n {% set backup_relation_type = target_relation.MaterializedView if existing_relation is none else existing_relation.type %}\n {% set backup_relation = make_backup_relation(target_relation, backup_relation_type) %}\n\n {{ materialized_view_setup(backup_relation, intermediate_relation, pre_hooks) }}\n\n {% set build_sql = materialized_view_get_build_sql(existing_relation, target_relation, backup_relation, intermediate_relation) %}\n\n {% if build_sql == '' %}\n {{ materialized_view_execute_no_op(target_relation) }}\n {% else %}\n {{ materialized_view_execute_build_sql(build_sql, existing_relation, target_relation, post_hooks) }}\n {% endif %}\n\n {{ materialized_view_teardown(backup_relation, intermediate_relation, post_hooks) }}\n\n {{ return({'relations': [target_relation]}) }}\n\n{% endmaterialization %}", "depends_on": {"macros": ["macro.dbt.load_cached_relation", "macro.dbt.make_intermediate_relation", "macro.dbt.make_backup_relation", "macro.dbt.materialized_view_setup", "macro.dbt.materialized_view_get_build_sql", "macro.dbt.materialized_view_execute_no_op", "macro.dbt.materialized_view_execute_build_sql", "macro.dbt.materialized_view_teardown"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "supported_languages", "type": null, "description": ""}], "created_at": 1789419969.9244769, "supported_languages": ["sql"]}, "macro.dbt.materialized_view_setup": {"name": "materialized_view_setup", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/materialized_view.sql", "original_file_path": "macros/materializations/models/materialized_view.sql", "unique_id": "macro.dbt.materialized_view_setup", "macro_sql": "{% macro materialized_view_setup(backup_relation, intermediate_relation, pre_hooks) %}\n\n -- backup_relation and intermediate_relation should not already exist in the database\n -- it's possible these exist because of a previous run that exited unexpectedly\n {% set preexisting_backup_relation = load_cached_relation(backup_relation) %}\n {% set preexisting_intermediate_relation = load_cached_relation(intermediate_relation) %}\n\n -- drop the temp relations if they exist already in the database\n {{ drop_relation_if_exists(preexisting_backup_relation) }}\n {{ drop_relation_if_exists(preexisting_intermediate_relation) }}\n\n {{ run_hooks(pre_hooks, inside_transaction=False) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.load_cached_relation", "macro.dbt.drop_relation_if_exists", "macro.dbt.run_hooks"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "backup_relation", "type": null, "description": ""}, {"name": "intermediate_relation", "type": null, "description": ""}, {"name": "pre_hooks", "type": null, "description": ""}], "created_at": 1789419969.925181, "supported_languages": null}, "macro.dbt.materialized_view_teardown": {"name": "materialized_view_teardown", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/materialized_view.sql", "original_file_path": "macros/materializations/models/materialized_view.sql", "unique_id": "macro.dbt.materialized_view_teardown", "macro_sql": "{% macro materialized_view_teardown(backup_relation, intermediate_relation, post_hooks) %}\n\n -- drop the temp relations if they exist to leave the database clean for the next run\n {{ drop_relation_if_exists(backup_relation) }}\n {{ drop_relation_if_exists(intermediate_relation) }}\n\n {{ run_hooks(post_hooks, inside_transaction=False) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.drop_relation_if_exists", "macro.dbt.run_hooks"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "backup_relation", "type": null, "description": ""}, {"name": "intermediate_relation", "type": null, "description": ""}, {"name": "post_hooks", "type": null, "description": ""}], "created_at": 1789419969.9256136, "supported_languages": null}, "macro.dbt.materialized_view_get_build_sql": {"name": "materialized_view_get_build_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/materialized_view.sql", "original_file_path": "macros/materializations/models/materialized_view.sql", "unique_id": "macro.dbt.materialized_view_get_build_sql", "macro_sql": "{% macro materialized_view_get_build_sql(existing_relation, target_relation, backup_relation, intermediate_relation) %}\n\n {% set full_refresh_mode = should_full_refresh() %}\n\n -- determine the scenario we're in: create, full_refresh, alter, refresh data\n {% if existing_relation is none %}\n {% set build_sql = get_create_materialized_view_as_sql(target_relation, sql) %}\n {% elif full_refresh_mode or not existing_relation.is_materialized_view %}\n {% set build_sql = get_replace_sql(existing_relation, target_relation, sql) %}\n {% else %}\n\n -- get config options\n {% set on_configuration_change = config.get('on_configuration_change') %}\n {% set configuration_changes = get_materialized_view_configuration_changes(existing_relation, config) %}\n\n {% if configuration_changes is none %}\n {% set build_sql = refresh_materialized_view(target_relation) %}\n\n {% elif on_configuration_change == 'apply' %}\n {% set build_sql = get_alter_materialized_view_as_sql(target_relation, configuration_changes, sql, existing_relation, backup_relation, intermediate_relation) %}\n {% elif on_configuration_change == 'continue' %}\n {% set build_sql = '' %}\n {{ exceptions.warn(\"Configuration changes were identified and `on_configuration_change` was set to `continue` for `\" ~ target_relation.render() ~ \"`\") }}\n {% elif on_configuration_change == 'fail' %}\n {{ exceptions.raise_fail_fast_error(\"Configuration changes were identified and `on_configuration_change` was set to `fail` for `\" ~ target_relation.render() ~ \"`\") }}\n\n {% else %}\n -- this only happens if the user provides a value other than `apply`, 'skip', 'fail'\n {{ exceptions.raise_compiler_error(\"Unexpected configuration scenario\") }}\n\n {% endif %}\n\n {% endif %}\n\n {% do return(build_sql) %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.should_full_refresh", "macro.dbt.get_create_materialized_view_as_sql", "macro.dbt.get_replace_sql", "macro.dbt.get_materialized_view_configuration_changes", "macro.dbt.refresh_materialized_view", "macro.dbt.get_alter_materialized_view_as_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "existing_relation", "type": null, "description": ""}, {"name": "target_relation", "type": null, "description": ""}, {"name": "backup_relation", "type": null, "description": ""}, {"name": "intermediate_relation", "type": null, "description": ""}], "created_at": 1789419969.9277997, "supported_languages": null}, "macro.dbt.materialized_view_execute_no_op": {"name": "materialized_view_execute_no_op", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/materialized_view.sql", "original_file_path": "macros/materializations/models/materialized_view.sql", "unique_id": "macro.dbt.materialized_view_execute_no_op", "macro_sql": "{% macro materialized_view_execute_no_op(target_relation) %}\n {% do store_raw_result(\n name=\"main\",\n message=\"skip \" ~ target_relation,\n code=\"skip\",\n rows_affected=\"-1\"\n ) %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "target_relation", "type": null, "description": ""}], "created_at": 1789419969.9282238, "supported_languages": null}, "macro.dbt.materialized_view_execute_build_sql": {"name": "materialized_view_execute_build_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/materialized_view.sql", "original_file_path": "macros/materializations/models/materialized_view.sql", "unique_id": "macro.dbt.materialized_view_execute_build_sql", "macro_sql": "{% macro materialized_view_execute_build_sql(build_sql, existing_relation, target_relation, post_hooks) %}\n\n -- `BEGIN` happens here:\n {{ run_hooks(pre_hooks, inside_transaction=True) }}\n\n {% set grant_config = config.get('grants') %}\n\n {% call statement(name=\"main\") %}\n {{ build_sql }}\n {% endcall %}\n\n {% set should_revoke = should_revoke(existing_relation, full_refresh_mode=True) %}\n {% do apply_grants(target_relation, grant_config, should_revoke=should_revoke) %}\n\n {% do persist_docs(target_relation, model) %}\n\n {{ run_hooks(post_hooks, inside_transaction=True) }}\n\n {{ adapter.commit() }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.run_hooks", "macro.dbt.statement", "macro.dbt.should_revoke", "macro.dbt.apply_grants", "macro.dbt.persist_docs"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "build_sql", "type": null, "description": ""}, {"name": "existing_relation", "type": null, "description": ""}, {"name": "target_relation", "type": null, "description": ""}, {"name": "post_hooks", "type": null, "description": ""}], "created_at": 1789419969.929306, "supported_languages": null}, "macro.dbt.materialization_view_default": {"name": "materialization_view_default", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/view.sql", "original_file_path": "macros/materializations/models/view.sql", "unique_id": "macro.dbt.materialization_view_default", "macro_sql": "{%- materialization view, default -%}\n\n {%- set existing_relation = load_cached_relation(this) -%}\n {%- set target_relation = this.incorporate(type='view') -%}\n {%- set intermediate_relation = make_intermediate_relation(target_relation) -%}\n\n -- the intermediate_relation should not already exist in the database; get_relation\n -- will return None in that case. Otherwise, we get a relation that we can drop\n -- later, before we try to use this name for the current operation\n {%- set preexisting_intermediate_relation = load_cached_relation(intermediate_relation) -%}\n /*\n This relation (probably) doesn't exist yet. If it does exist, it's a leftover from\n a previous run, and we're going to try to drop it immediately. At the end of this\n materialization, we're going to rename the \"existing_relation\" to this identifier,\n and then we're going to drop it. In order to make sure we run the correct one of:\n - drop view ...\n - drop table ...\n\n We need to set the type of this relation to be the type of the existing_relation, if it exists,\n or else \"view\" as a sane default if it does not. Note that if the existing_relation does not\n exist, then there is nothing to move out of the way and subsequentally drop. In that case,\n this relation will be effectively unused.\n */\n {%- set backup_relation_type = 'view' if existing_relation is none else existing_relation.type -%}\n {%- set backup_relation = make_backup_relation(target_relation, backup_relation_type) -%}\n -- as above, the backup_relation should not already exist\n {%- set preexisting_backup_relation = load_cached_relation(backup_relation) -%}\n -- grab current tables grants config for comparision later on\n {% set grant_config = config.get('grants') %}\n\n {{ run_hooks(pre_hooks, inside_transaction=False) }}\n\n -- drop the temp relations if they exist already in the database\n {{ drop_relation_if_exists(preexisting_intermediate_relation) }}\n {{ drop_relation_if_exists(preexisting_backup_relation) }}\n\n -- `BEGIN` happens here:\n {{ run_hooks(pre_hooks, inside_transaction=True) }}\n\n -- build model\n {% call statement('main') -%}\n {{ get_create_view_as_sql(intermediate_relation, sql) }}\n {%- endcall %}\n\n -- cleanup\n -- move the existing view out of the way\n {% if existing_relation is not none %}\n /* Do the equivalent of rename_if_exists. 'existing_relation' could have been dropped\n since the variable was first set. */\n {% set existing_relation = load_cached_relation(existing_relation) %}\n {% if existing_relation is not none %}\n {{ adapter.rename_relation(existing_relation, backup_relation) }}\n {% endif %}\n {% endif %}\n {{ adapter.rename_relation(intermediate_relation, target_relation) }}\n\n {% set should_revoke = should_revoke(existing_relation, full_refresh_mode=True) %}\n {% do apply_grants(target_relation, grant_config, should_revoke=should_revoke) %}\n\n {% do persist_docs(target_relation, model) %}\n\n {{ run_hooks(post_hooks, inside_transaction=True) }}\n\n {{ adapter.commit() }}\n\n {{ drop_relation_if_exists(backup_relation) }}\n\n {{ run_hooks(post_hooks, inside_transaction=False) }}\n\n {{ return({'relations': [target_relation]}) }}\n\n{%- endmaterialization -%}", "depends_on": {"macros": ["macro.dbt.load_cached_relation", "macro.dbt.make_intermediate_relation", "macro.dbt.make_backup_relation", "macro.dbt.run_hooks", "macro.dbt.drop_relation_if_exists", "macro.dbt.statement", "macro.dbt.get_create_view_as_sql", "macro.dbt.should_revoke", "macro.dbt.apply_grants", "macro.dbt.persist_docs"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "supported_languages", "type": null, "description": ""}], "created_at": 1789419969.9330938, "supported_languages": ["sql"]}, "macro.dbt.materialization_clone_default": {"name": "materialization_clone_default", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/clone/clone.sql", "original_file_path": "macros/materializations/models/clone/clone.sql", "unique_id": "macro.dbt.materialization_clone_default", "macro_sql": "{%- materialization clone, default -%}\n\n {%- set relations = {'relations': []} -%}\n\n {%- if not defer_relation -%}\n -- nothing to do\n {{ log(\"No relation found in state manifest for \" ~ model.unique_id, info=True) }}\n {{ return(relations) }}\n {%- endif -%}\n\n {%- set existing_relation = load_cached_relation(this) -%}\n\n {%- if existing_relation and not flags.FULL_REFRESH -%}\n -- noop!\n {{ log(\"Relation \" ~ existing_relation ~ \" already exists\", info=True) }}\n {{ return(relations) }}\n {%- endif -%}\n\n {%- set other_existing_relation = load_cached_relation(defer_relation) -%}\n\n -- If this is a database that can do zero-copy cloning of tables, and the other relation is a table, then this will be a table\n -- Otherwise, this will be a view\n\n {% set can_clone_table = can_clone_table() %}\n {%- set grant_config = config.get('grants') -%}\n\n {%- if other_existing_relation and other_existing_relation.type == 'table' and can_clone_table -%}\n\n {%- set target_relation = this.incorporate(type='table') -%}\n {% if existing_relation is not none and not existing_relation.is_table %}\n {{ log(\"Dropping relation \" ~ existing_relation.render() ~ \" because it is of type \" ~ existing_relation.type) }}\n {{ drop_relation_if_exists(existing_relation) }}\n {% endif %}\n\n -- as a general rule, data platforms that can clone tables can also do atomic 'create or replace'\n {% if target_relation.database == defer_relation.database and\n target_relation.schema == defer_relation.schema and\n target_relation.identifier == defer_relation.identifier %}\n {{ log(\"Target relation and defer relation are the same, skipping clone for relation: \" ~ target_relation.render()) }}\n {% else %}\n {% call statement('main') %}\n {{ create_or_replace_clone(target_relation, defer_relation) }}\n {% endcall %}\n {% endif %}\n {% set should_revoke = should_revoke(existing_relation, full_refresh_mode=True) %}\n {% do apply_grants(target_relation, grant_config, should_revoke=should_revoke) %}\n {% do persist_docs(target_relation, model) %}\n\n {{ return({'relations': [target_relation]}) }}\n\n {%- else -%}\n\n {%- set target_relation = this.incorporate(type='view') -%}\n\n -- reuse the view materialization\n -- TODO: support actual dispatch for materialization macros\n -- Tracking ticket: https://github.com/dbt-labs/dbt-core/issues/7799\n {% set search_name = \"materialization_view_\" ~ adapter.type() %}\n {% if not search_name in context %}\n {% set search_name = \"materialization_view_default\" %}\n {% endif %}\n {% set materialization_macro = context[search_name] %}\n {% set relations = materialization_macro() %}\n {{ return(relations) }}\n\n {%- endif -%}\n\n{%- endmaterialization -%}", "depends_on": {"macros": ["macro.dbt.load_cached_relation", "macro.dbt.can_clone_table", "macro.dbt.drop_relation_if_exists", "macro.dbt.statement", "macro.dbt.create_or_replace_clone", "macro.dbt.should_revoke", "macro.dbt.apply_grants", "macro.dbt.persist_docs"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "supported_languages", "type": null, "description": ""}], "created_at": 1789419969.9377556, "supported_languages": ["sql"]}, "macro.dbt.can_clone_table": {"name": "can_clone_table", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/clone/can_clone_table.sql", "original_file_path": "macros/materializations/models/clone/can_clone_table.sql", "unique_id": "macro.dbt.can_clone_table", "macro_sql": "{% macro can_clone_table() %}\n {{ return(adapter.dispatch('can_clone_table', 'dbt')()) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__can_clone_table"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789419969.9382653, "supported_languages": null}, "macro.dbt.default__can_clone_table": {"name": "default__can_clone_table", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/clone/can_clone_table.sql", "original_file_path": "macros/materializations/models/clone/can_clone_table.sql", "unique_id": "macro.dbt.default__can_clone_table", "macro_sql": "{% macro default__can_clone_table() %}\n {{ return(False) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789419969.938477, "supported_languages": null}, "macro.dbt.create_or_replace_clone": {"name": "create_or_replace_clone", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/clone/create_or_replace_clone.sql", "original_file_path": "macros/materializations/models/clone/create_or_replace_clone.sql", "unique_id": "macro.dbt.create_or_replace_clone", "macro_sql": "{% macro create_or_replace_clone(this_relation, defer_relation) %}\n {{ return(adapter.dispatch('create_or_replace_clone', 'dbt')(this_relation, defer_relation)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__create_or_replace_clone"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "this_relation", "type": null, "description": ""}, {"name": "defer_relation", "type": null, "description": ""}], "created_at": 1789419969.9390147, "supported_languages": null}, "macro.dbt.default__create_or_replace_clone": {"name": "default__create_or_replace_clone", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/clone/create_or_replace_clone.sql", "original_file_path": "macros/materializations/models/clone/create_or_replace_clone.sql", "unique_id": "macro.dbt.default__create_or_replace_clone", "macro_sql": "{% macro default__create_or_replace_clone(this_relation, defer_relation) %}\n create or replace table {{ this_relation.render() }} clone {{ defer_relation.render() }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "this_relation", "type": null, "description": ""}, {"name": "defer_relation", "type": null, "description": ""}], "created_at": 1789419969.9393194, "supported_languages": null}, "macro.dbt.materialization_incremental_default": {"name": "materialization_incremental_default", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/incremental.sql", "original_file_path": "macros/materializations/models/incremental/incremental.sql", "unique_id": "macro.dbt.materialization_incremental_default", "macro_sql": "{% materialization incremental, default -%}\n\n -- relations\n {%- set existing_relation = load_cached_relation(this) -%}\n {%- set target_relation = this.incorporate(type='table') -%}\n {%- set temp_relation = make_temp_relation(target_relation)-%}\n {%- set intermediate_relation = make_intermediate_relation(target_relation)-%}\n {%- set backup_relation_type = 'table' if existing_relation is none else existing_relation.type -%}\n {%- set backup_relation = make_backup_relation(target_relation, backup_relation_type) -%}\n\n -- configs\n {%- set unique_key = config.get('unique_key') -%}\n {%- set full_refresh_mode = (should_full_refresh() or existing_relation.is_view) -%}\n {%- set on_schema_change = incremental_validate_on_schema_change(config.get('on_schema_change'), default='ignore') -%}\n\n -- the temp_ and backup_ relations should not already exist in the database; get_relation\n -- will return None in that case. Otherwise, we get a relation that we can drop\n -- later, before we try to use this name for the current operation. This has to happen before\n -- BEGIN, in a separate transaction\n {%- set preexisting_intermediate_relation = load_cached_relation(intermediate_relation)-%}\n {%- set preexisting_backup_relation = load_cached_relation(backup_relation) -%}\n -- grab current tables grants config for comparision later on\n {% set grant_config = config.get('grants') %}\n {{ drop_relation_if_exists(preexisting_intermediate_relation) }}\n {{ drop_relation_if_exists(preexisting_backup_relation) }}\n\n {{ run_hooks(pre_hooks, inside_transaction=False) }}\n\n -- `BEGIN` happens here:\n {{ run_hooks(pre_hooks, inside_transaction=True) }}\n\n {% set to_drop = [] %}\n\n {% set incremental_strategy = config.get('incremental_strategy') or 'default' %}\n {% set strategy_sql_macro_func = adapter.get_incremental_strategy_macro(context, incremental_strategy) %}\n\n {% if existing_relation is none %}\n {% set build_sql = get_create_table_as_sql(False, target_relation, sql) %}\n {% set relation_for_indexes = target_relation %}\n {% elif full_refresh_mode %}\n {% set build_sql = get_create_table_as_sql(False, intermediate_relation, sql) %}\n {% set relation_for_indexes = intermediate_relation %}\n {% set need_swap = true %}\n {% else %}\n {% do run_query(get_create_table_as_sql(True, temp_relation, sql)) %}\n {% set relation_for_indexes = temp_relation %}\n {% set contract_config = config.get('contract') %}\n {% if not contract_config or not contract_config.enforced %}\n {% do adapter.expand_target_column_types(\n from_relation=temp_relation,\n to_relation=target_relation) %}\n {% endif %}\n {#-- Process schema changes. Returns dict of changes if successful. Use source columns for upserting/merging --#}\n {% set dest_columns = process_schema_changes(on_schema_change, temp_relation, existing_relation) %}\n {% if not dest_columns %}\n {% set dest_columns = adapter.get_columns_in_relation(existing_relation) %}\n {% endif %}\n\n {#-- Get the incremental_strategy, the macro to use for the strategy, and build the sql --#}\n {% set incremental_predicates = config.get('predicates', none) or config.get('incremental_predicates', none) %}\n {% set strategy_arg_dict = ({'target_relation': target_relation, 'temp_relation': temp_relation, 'unique_key': unique_key, 'dest_columns': dest_columns, 'incremental_predicates': incremental_predicates }) %}\n {% set build_sql = strategy_sql_macro_func(strategy_arg_dict) %}\n\n {% endif %}\n\n {% call statement(\"main\") %}\n {{ build_sql }}\n {% endcall %}\n\n {% if existing_relation is none or existing_relation.is_view or should_full_refresh() %}\n {% do create_indexes(relation_for_indexes) %}\n {% endif %}\n\n {% if need_swap %}\n {% do adapter.rename_relation(target_relation, backup_relation) %}\n {% do adapter.rename_relation(intermediate_relation, target_relation) %}\n {% do to_drop.append(backup_relation) %}\n {% endif %}\n\n {% set should_revoke = should_revoke(existing_relation, full_refresh_mode) %}\n {% do apply_grants(target_relation, grant_config, should_revoke=should_revoke) %}\n\n {% do persist_docs(target_relation, model) %}\n\n {{ run_hooks(post_hooks, inside_transaction=True) }}\n\n -- `COMMIT` happens here\n {% do adapter.commit() %}\n\n {% for rel in to_drop %}\n {% do adapter.drop_relation(rel) %}\n {% endfor %}\n\n {{ run_hooks(post_hooks, inside_transaction=False) }}\n\n {{ return({'relations': [target_relation]}) }}\n\n{%- endmaterialization %}", "depends_on": {"macros": ["macro.dbt.load_cached_relation", "macro.dbt.make_temp_relation", "macro.dbt.make_intermediate_relation", "macro.dbt.make_backup_relation", "macro.dbt.should_full_refresh", "macro.dbt.incremental_validate_on_schema_change", "macro.dbt.drop_relation_if_exists", "macro.dbt.run_hooks", "macro.dbt.get_create_table_as_sql", "macro.dbt.run_query", "macro.dbt.process_schema_changes", "macro.dbt.statement", "macro.dbt.create_indexes", "macro.dbt.should_revoke", "macro.dbt.apply_grants", "macro.dbt.persist_docs"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "supported_languages", "type": null, "description": ""}], "created_at": 1789419969.9466803, "supported_languages": ["sql"]}, "macro.dbt.get_quoted_csv": {"name": "get_quoted_csv", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/column_helpers.sql", "original_file_path": "macros/materializations/models/incremental/column_helpers.sql", "unique_id": "macro.dbt.get_quoted_csv", "macro_sql": "{% macro get_quoted_csv(column_names) %}\n\n {% set quoted = [] %}\n {% for col in column_names -%}\n {%- do quoted.append(adapter.quote(col)) -%}\n {%- endfor %}\n\n {%- set dest_cols_csv = quoted | join(', ') -%}\n {{ return(dest_cols_csv) }}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "column_names", "type": null, "description": ""}], "created_at": 1789419969.9482968, "supported_languages": null}, "macro.dbt.diff_columns": {"name": "diff_columns", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/column_helpers.sql", "original_file_path": "macros/materializations/models/incremental/column_helpers.sql", "unique_id": "macro.dbt.diff_columns", "macro_sql": "{% macro diff_columns(source_columns, target_columns) %}\n\n {% set result = [] %}\n {% set source_names = source_columns | map(attribute = 'column') | list %}\n {% set target_names = target_columns | map(attribute = 'column') | list %}\n\n {# --check whether the name attribute exists in the target - this does not perform a data type check #}\n {% for sc in source_columns %}\n {% if sc.name not in target_names %}\n {{ result.append(sc) }}\n {% endif %}\n {% endfor %}\n\n {{ return(result) }}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "source_columns", "type": null, "description": ""}, {"name": "target_columns", "type": null, "description": ""}], "created_at": 1789419969.949273, "supported_languages": null}, "macro.dbt.diff_column_data_types": {"name": "diff_column_data_types", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/column_helpers.sql", "original_file_path": "macros/materializations/models/incremental/column_helpers.sql", "unique_id": "macro.dbt.diff_column_data_types", "macro_sql": "{% macro diff_column_data_types(source_columns, target_columns) %}\n {{ return(adapter.dispatch('diff_column_data_types', 'dbt')(source_columns, target_columns)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__diff_column_data_types"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "source_columns", "type": null, "description": ""}, {"name": "target_columns", "type": null, "description": ""}], "created_at": 1789419969.9496572, "supported_languages": null}, "macro.dbt.default__diff_column_data_types": {"name": "default__diff_column_data_types", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/column_helpers.sql", "original_file_path": "macros/materializations/models/incremental/column_helpers.sql", "unique_id": "macro.dbt.default__diff_column_data_types", "macro_sql": "{% macro default__diff_column_data_types(source_columns, target_columns) %}\n {% set result = [] %}\n {% for sc in source_columns %}\n {% set tc = target_columns | selectattr(\"name\", \"equalto\", sc.name) | list | first %}\n {% if tc %}\n {% if sc.expanded_data_type != tc.expanded_data_type and not sc.can_expand_to(other_column=tc) %}\n {{ result.append( { 'column_name': tc.name, 'new_type': sc.expanded_data_type } ) }}\n {% endif %}\n {% endif %}\n {% endfor %}\n\n {{ return(result) }}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "source_columns", "type": null, "description": ""}, {"name": "target_columns", "type": null, "description": ""}], "created_at": 1789419969.9507935, "supported_languages": null}, "macro.dbt.get_merge_update_columns": {"name": "get_merge_update_columns", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/column_helpers.sql", "original_file_path": "macros/materializations/models/incremental/column_helpers.sql", "unique_id": "macro.dbt.get_merge_update_columns", "macro_sql": "{% macro get_merge_update_columns(merge_update_columns, merge_exclude_columns, dest_columns) %}\n {{ return(adapter.dispatch('get_merge_update_columns', 'dbt')(merge_update_columns, merge_exclude_columns, dest_columns)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_merge_update_columns"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "merge_update_columns", "type": null, "description": ""}, {"name": "merge_exclude_columns", "type": null, "description": ""}, {"name": "dest_columns", "type": null, "description": ""}], "created_at": 1789419969.9512172, "supported_languages": null}, "macro.dbt.default__get_merge_update_columns": {"name": "default__get_merge_update_columns", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/column_helpers.sql", "original_file_path": "macros/materializations/models/incremental/column_helpers.sql", "unique_id": "macro.dbt.default__get_merge_update_columns", "macro_sql": "{% macro default__get_merge_update_columns(merge_update_columns, merge_exclude_columns, dest_columns) %}\n {%- set default_cols = dest_columns | map(attribute=\"quoted\") | list -%}\n\n {%- if merge_update_columns and merge_exclude_columns -%}\n {{ exceptions.raise_compiler_error(\n 'Model cannot specify merge_update_columns and merge_exclude_columns. Please update model to use only one config'\n )}}\n {%- elif merge_update_columns -%}\n {%- set update_columns = merge_update_columns -%}\n {%- elif merge_exclude_columns -%}\n {%- set update_columns = [] -%}\n {%- for column in dest_columns -%}\n {% if column.column | lower not in merge_exclude_columns | map(\"lower\") | list %}\n {%- do update_columns.append(column.quoted) -%}\n {% endif %}\n {%- endfor -%}\n {%- else -%}\n {%- set update_columns = default_cols -%}\n {%- endif -%}\n\n {{ return(update_columns) }}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "merge_update_columns", "type": null, "description": ""}, {"name": "merge_exclude_columns", "type": null, "description": ""}, {"name": "dest_columns", "type": null, "description": ""}], "created_at": 1789419969.9524493, "supported_languages": null}, "macro.dbt.get_incremental_append_sql": {"name": "get_incremental_append_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "unique_id": "macro.dbt.get_incremental_append_sql", "macro_sql": "{% macro get_incremental_append_sql(arg_dict) %}\n\n {{ return(adapter.dispatch('get_incremental_append_sql', 'dbt')(arg_dict)) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_incremental_append_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "arg_dict", "type": null, "description": ""}], "created_at": 1789419969.953631, "supported_languages": null}, "macro.dbt.default__get_incremental_append_sql": {"name": "default__get_incremental_append_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "unique_id": "macro.dbt.default__get_incremental_append_sql", "macro_sql": "{% macro default__get_incremental_append_sql(arg_dict) %}\n\n {% do return(get_insert_into_sql(arg_dict[\"target_relation\"], arg_dict[\"temp_relation\"], arg_dict[\"dest_columns\"])) %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_insert_into_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "arg_dict", "type": null, "description": ""}], "created_at": 1789419969.954063, "supported_languages": null}, "macro.dbt.get_incremental_delete_insert_sql": {"name": "get_incremental_delete_insert_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "unique_id": "macro.dbt.get_incremental_delete_insert_sql", "macro_sql": "{% macro get_incremental_delete_insert_sql(arg_dict) %}\n\n {{ return(adapter.dispatch('get_incremental_delete_insert_sql', 'dbt')(arg_dict)) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_incremental_delete_insert_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "arg_dict", "type": null, "description": ""}], "created_at": 1789419969.9543812, "supported_languages": null}, "macro.dbt.default__get_incremental_delete_insert_sql": {"name": "default__get_incremental_delete_insert_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "unique_id": "macro.dbt.default__get_incremental_delete_insert_sql", "macro_sql": "{% macro default__get_incremental_delete_insert_sql(arg_dict) %}\n\n {% do return(get_delete_insert_merge_sql(arg_dict[\"target_relation\"], arg_dict[\"temp_relation\"], arg_dict[\"unique_key\"], arg_dict[\"dest_columns\"], arg_dict[\"incremental_predicates\"])) %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_delete_insert_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "arg_dict", "type": null, "description": ""}], "created_at": 1789419969.954882, "supported_languages": null}, "macro.dbt.get_incremental_merge_sql": {"name": "get_incremental_merge_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "unique_id": "macro.dbt.get_incremental_merge_sql", "macro_sql": "{% macro get_incremental_merge_sql(arg_dict) %}\n\n {{ return(adapter.dispatch('get_incremental_merge_sql', 'dbt')(arg_dict)) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_incremental_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "arg_dict", "type": null, "description": ""}], "created_at": 1789419969.9551916, "supported_languages": null}, "macro.dbt.default__get_incremental_merge_sql": {"name": "default__get_incremental_merge_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "unique_id": "macro.dbt.default__get_incremental_merge_sql", "macro_sql": "{% macro default__get_incremental_merge_sql(arg_dict) %}\n\n {% do return(get_merge_sql(arg_dict[\"target_relation\"], arg_dict[\"temp_relation\"], arg_dict[\"unique_key\"], arg_dict[\"dest_columns\"], arg_dict[\"incremental_predicates\"])) %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "arg_dict", "type": null, "description": ""}], "created_at": 1789419969.9556708, "supported_languages": null}, "macro.dbt.get_incremental_insert_overwrite_sql": {"name": "get_incremental_insert_overwrite_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "unique_id": "macro.dbt.get_incremental_insert_overwrite_sql", "macro_sql": "{% macro get_incremental_insert_overwrite_sql(arg_dict) %}\n\n {{ return(adapter.dispatch('get_incremental_insert_overwrite_sql', 'dbt')(arg_dict)) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_incremental_insert_overwrite_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "arg_dict", "type": null, "description": ""}], "created_at": 1789419969.956, "supported_languages": null}, "macro.dbt.default__get_incremental_insert_overwrite_sql": {"name": "default__get_incremental_insert_overwrite_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "unique_id": "macro.dbt.default__get_incremental_insert_overwrite_sql", "macro_sql": "{% macro default__get_incremental_insert_overwrite_sql(arg_dict) %}\n\n {% do return(get_insert_overwrite_merge_sql(arg_dict[\"target_relation\"], arg_dict[\"temp_relation\"], arg_dict[\"dest_columns\"], arg_dict[\"incremental_predicates\"])) %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_insert_overwrite_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "arg_dict", "type": null, "description": ""}], "created_at": 1789419969.9565802, "supported_languages": null}, "macro.dbt.get_incremental_default_sql": {"name": "get_incremental_default_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "unique_id": "macro.dbt.get_incremental_default_sql", "macro_sql": "{% macro get_incremental_default_sql(arg_dict) %}\n\n {{ return(adapter.dispatch('get_incremental_default_sql', 'dbt')(arg_dict)) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__get_incremental_default_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "arg_dict", "type": null, "description": ""}], "created_at": 1789419969.9569142, "supported_languages": null}, "macro.dbt.default__get_incremental_default_sql": {"name": "default__get_incremental_default_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "unique_id": "macro.dbt.default__get_incremental_default_sql", "macro_sql": "{% macro default__get_incremental_default_sql(arg_dict) %}\n\n {% do return(get_incremental_append_sql(arg_dict)) %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_incremental_append_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "arg_dict", "type": null, "description": ""}], "created_at": 1789419969.957171, "supported_languages": null}, "macro.dbt.get_incremental_microbatch_sql": {"name": "get_incremental_microbatch_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "unique_id": "macro.dbt.get_incremental_microbatch_sql", "macro_sql": "{% macro get_incremental_microbatch_sql(arg_dict) %}\n\n {{ return(adapter.dispatch('get_incremental_microbatch_sql', 'dbt')(arg_dict)) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__get_incremental_microbatch_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "arg_dict", "type": null, "description": ""}], "created_at": 1789419969.9574838, "supported_languages": null}, "macro.dbt.default__get_incremental_microbatch_sql": {"name": "default__get_incremental_microbatch_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "unique_id": "macro.dbt.default__get_incremental_microbatch_sql", "macro_sql": "{% macro default__get_incremental_microbatch_sql(arg_dict) %}\n\n {{ exceptions.raise_not_implemented('microbatch materialization strategy not implemented for adapter ' + adapter.type()) }}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "arg_dict", "type": null, "description": ""}], "created_at": 1789419969.9577765, "supported_languages": null}, "macro.dbt.get_insert_into_sql": {"name": "get_insert_into_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "unique_id": "macro.dbt.get_insert_into_sql", "macro_sql": "{% macro get_insert_into_sql(target_relation, temp_relation, dest_columns) %}\n\n {%- set dest_cols_csv = get_quoted_csv(dest_columns | map(attribute=\"name\")) -%}\n\n insert into {{ target_relation }} ({{ dest_cols_csv }})\n (\n select {{ dest_cols_csv }}\n from {{ temp_relation }}\n )\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_quoted_csv"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "target_relation", "type": null, "description": ""}, {"name": "temp_relation", "type": null, "description": ""}, {"name": "dest_columns", "type": null, "description": ""}], "created_at": 1789419969.958262, "supported_languages": null}, "macro.dbt.incremental_validate_on_schema_change": {"name": "incremental_validate_on_schema_change", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/on_schema_change.sql", "original_file_path": "macros/materializations/models/incremental/on_schema_change.sql", "unique_id": "macro.dbt.incremental_validate_on_schema_change", "macro_sql": "{% macro incremental_validate_on_schema_change(on_schema_change, default='ignore') %}\n\n {% if on_schema_change not in ['sync_all_columns', 'append_new_columns', 'fail', 'ignore'] %}\n\n {% set log_message = 'Invalid value for on_schema_change (%s) specified. Setting default value of %s.' % (on_schema_change, default) %}\n {% do log(log_message) %}\n\n {{ return(default) }}\n\n {% else %}\n\n {{ return(on_schema_change) }}\n\n {% endif %}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "on_schema_change", "type": null, "description": ""}, {"name": "default", "type": null, "description": ""}], "created_at": 1789419969.960536, "supported_languages": null}, "macro.dbt.check_for_schema_changes": {"name": "check_for_schema_changes", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/on_schema_change.sql", "original_file_path": "macros/materializations/models/incremental/on_schema_change.sql", "unique_id": "macro.dbt.check_for_schema_changes", "macro_sql": "{% macro check_for_schema_changes(source_relation, target_relation) %}\n {{ return(adapter.dispatch('check_for_schema_changes', 'dbt')(source_relation, target_relation)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__check_for_schema_changes"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "source_relation", "type": null, "description": ""}, {"name": "target_relation", "type": null, "description": ""}], "created_at": 1789419969.9609404, "supported_languages": null}, "macro.dbt.default__check_for_schema_changes": {"name": "default__check_for_schema_changes", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/on_schema_change.sql", "original_file_path": "macros/materializations/models/incremental/on_schema_change.sql", "unique_id": "macro.dbt.default__check_for_schema_changes", "macro_sql": "{% macro default__check_for_schema_changes(source_relation, target_relation) %}\n\n {% set schema_changed = False %}\n\n {%- set source_columns = adapter.get_columns_in_relation(source_relation) -%}\n {%- set target_columns = adapter.get_columns_in_relation(target_relation) -%}\n {%- set source_not_in_target = diff_columns(source_columns, target_columns) -%}\n {%- set target_not_in_source = diff_columns(target_columns, source_columns) -%}\n\n {% set new_target_types = diff_column_data_types(source_columns, target_columns) %}\n\n {% if source_not_in_target != [] %}\n {% set schema_changed = True %}\n {% elif target_not_in_source != [] or new_target_types != [] %}\n {% set schema_changed = True %}\n {% elif new_target_types != [] %}\n {% set schema_changed = True %}\n {% endif %}\n\n {% set changes_dict = {\n 'schema_changed': schema_changed,\n 'source_not_in_target': source_not_in_target,\n 'target_not_in_source': target_not_in_source,\n 'source_columns': source_columns,\n 'target_columns': target_columns,\n 'new_target_types': new_target_types\n } %}\n\n {% set msg %}\n In {{ target_relation }}:\n Schema changed: {{ schema_changed }}\n Source columns not in target: {{ source_not_in_target }}\n Target columns not in source: {{ target_not_in_source }}\n New column types: {{ new_target_types }}\n {% endset %}\n\n {% do log(msg) %}\n\n {{ return(changes_dict) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.diff_columns", "macro.dbt.diff_column_data_types"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "source_relation", "type": null, "description": ""}, {"name": "target_relation", "type": null, "description": ""}], "created_at": 1789419969.9630034, "supported_languages": null}, "macro.dbt.sync_column_schemas": {"name": "sync_column_schemas", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/on_schema_change.sql", "original_file_path": "macros/materializations/models/incremental/on_schema_change.sql", "unique_id": "macro.dbt.sync_column_schemas", "macro_sql": "{% macro sync_column_schemas(on_schema_change, target_relation, schema_changes_dict) %}\n {{ return(adapter.dispatch('sync_column_schemas', 'dbt')(on_schema_change, target_relation, schema_changes_dict)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__sync_column_schemas"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "on_schema_change", "type": null, "description": ""}, {"name": "target_relation", "type": null, "description": ""}, {"name": "schema_changes_dict", "type": null, "description": ""}], "created_at": 1789419969.9634666, "supported_languages": null}, "macro.dbt.default__sync_column_schemas": {"name": "default__sync_column_schemas", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/on_schema_change.sql", "original_file_path": "macros/materializations/models/incremental/on_schema_change.sql", "unique_id": "macro.dbt.default__sync_column_schemas", "macro_sql": "{% macro default__sync_column_schemas(on_schema_change, target_relation, schema_changes_dict) %}\n\n {%- set add_to_target_arr = schema_changes_dict['source_not_in_target'] -%}\n {%- set remove_from_target_arr = schema_changes_dict['target_not_in_source'] -%}\n {%- set new_target_types = schema_changes_dict['new_target_types'] -%}\n\n {%- if on_schema_change == 'append_new_columns'-%}\n {%- if add_to_target_arr | length > 0 -%}\n {%- do alter_relation_add_remove_columns(target_relation, add_to_target_arr, none) -%}\n {%- endif -%}\n\n {% elif on_schema_change == 'sync_all_columns' %}\n\n {% if add_to_target_arr | length > 0 or remove_from_target_arr | length > 0 %}\n {%- do alter_relation_add_remove_columns(target_relation, add_to_target_arr, remove_from_target_arr) -%}\n {% endif %}\n\n {% if new_target_types != [] %}\n {% for ntt in new_target_types %}\n {% set column_name = ntt['column_name'] %}\n {% set new_type = ntt['new_type'] %}\n {% do alter_column_type(target_relation, column_name, new_type) %}\n {% endfor %}\n {% endif %}\n\n {% endif %}\n\n {% set schema_change_message %}\n In {{ target_relation }}:\n Schema change approach: {{ on_schema_change }}\n Columns added: {{ add_to_target_arr }}\n Columns removed: {{ remove_from_target_arr }}\n Data types changed: {{ new_target_types }}\n {% endset %}\n\n {% do log(schema_change_message) %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.alter_relation_add_remove_columns", "macro.dbt.alter_column_type"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "on_schema_change", "type": null, "description": ""}, {"name": "target_relation", "type": null, "description": ""}, {"name": "schema_changes_dict", "type": null, "description": ""}], "created_at": 1789419969.9654822, "supported_languages": null}, "macro.dbt.process_schema_changes": {"name": "process_schema_changes", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/on_schema_change.sql", "original_file_path": "macros/materializations/models/incremental/on_schema_change.sql", "unique_id": "macro.dbt.process_schema_changes", "macro_sql": "{% macro process_schema_changes(on_schema_change, source_relation, target_relation) %}\n {{ return(adapter.dispatch('process_schema_changes', 'dbt')(on_schema_change, source_relation, target_relation)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__process_schema_changes"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "on_schema_change", "type": null, "description": ""}, {"name": "source_relation", "type": null, "description": ""}, {"name": "target_relation", "type": null, "description": ""}], "created_at": 1789419969.9660704, "supported_languages": null}, "macro.dbt.default__process_schema_changes": {"name": "default__process_schema_changes", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/on_schema_change.sql", "original_file_path": "macros/materializations/models/incremental/on_schema_change.sql", "unique_id": "macro.dbt.default__process_schema_changes", "macro_sql": "{% macro default__process_schema_changes(on_schema_change, source_relation, target_relation) %}\n\n {% if on_schema_change == 'ignore' %}\n\n {{ return({}) }}\n\n {% else %}\n\n {% set schema_changes_dict = check_for_schema_changes(source_relation, target_relation) %}\n\n {% if schema_changes_dict['schema_changed'] %}\n\n {% if on_schema_change == 'fail' %}\n\n {% set fail_msg %}\n The source and target schemas on this incremental model are out of sync!\n They can be reconciled in several ways:\n - set the `on_schema_change` config to either append_new_columns or sync_all_columns, depending on your situation.\n - Re-run the incremental model with `full_refresh: True` to update the target schema.\n - update the schema manually and re-run the process.\n\n Additional troubleshooting context:\n Source columns not in target: {{ schema_changes_dict['source_not_in_target'] }}\n Target columns not in source: {{ schema_changes_dict['target_not_in_source'] }}\n New column types: {{ schema_changes_dict['new_target_types'] }}\n {% endset %}\n\n {% do exceptions.raise_compiler_error(fail_msg) %}\n\n {# -- unless we ignore, run the sync operation per the config #}\n {% else %}\n\n {% do sync_column_schemas(on_schema_change, target_relation, schema_changes_dict) %}\n\n {% endif %}\n\n {% endif %}\n\n {{ return(schema_changes_dict['source_columns']) }}\n\n {% endif %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.check_for_schema_changes", "macro.dbt.sync_column_schemas"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "on_schema_change", "type": null, "description": ""}, {"name": "source_relation", "type": null, "description": ""}, {"name": "target_relation", "type": null, "description": ""}], "created_at": 1789419969.967516, "supported_languages": null}, "macro.dbt.get_merge_sql": {"name": "get_merge_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/merge.sql", "original_file_path": "macros/materializations/models/incremental/merge.sql", "unique_id": "macro.dbt.get_merge_sql", "macro_sql": "{% macro get_merge_sql(target, source, unique_key, dest_columns, incremental_predicates=none) -%}\n -- back compat for old kwarg name\n {% set incremental_predicates = kwargs.get('predicates', incremental_predicates) %}\n {{ adapter.dispatch('get_merge_sql', 'dbt')(target, source, unique_key, dest_columns, incremental_predicates) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "target", "type": null, "description": ""}, {"name": "source", "type": null, "description": ""}, {"name": "unique_key", "type": null, "description": ""}, {"name": "dest_columns", "type": null, "description": ""}, {"name": "incremental_predicates", "type": null, "description": ""}], "created_at": 1789419969.9695494, "supported_languages": null}, "macro.dbt.get_merge_unique_key_match": {"name": "get_merge_unique_key_match", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/merge.sql", "original_file_path": "macros/materializations/models/incremental/merge.sql", "unique_id": "macro.dbt.get_merge_unique_key_match", "macro_sql": "{% macro get_merge_unique_key_match(source_unique_key, target_unique_key) %}\n {{ return(adapter.dispatch('get_merge_unique_key_match', 'dbt')(source_unique_key, target_unique_key)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_merge_unique_key_match"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "source_unique_key", "type": null, "description": ""}, {"name": "target_unique_key", "type": null, "description": ""}], "created_at": 1789419969.9699316, "supported_languages": null}, "macro.dbt.default__get_merge_unique_key_match": {"name": "default__get_merge_unique_key_match", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/merge.sql", "original_file_path": "macros/materializations/models/incremental/merge.sql", "unique_id": "macro.dbt.default__get_merge_unique_key_match", "macro_sql": "{% macro default__get_merge_unique_key_match(source_unique_key, target_unique_key) -%}\n {{ return(equals(source_unique_key, target_unique_key) | trim) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.equals"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "source_unique_key", "type": null, "description": ""}, {"name": "target_unique_key", "type": null, "description": ""}], "created_at": 1789419969.9702244, "supported_languages": null}, "macro.dbt.default__get_merge_sql": {"name": "default__get_merge_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/merge.sql", "original_file_path": "macros/materializations/models/incremental/merge.sql", "unique_id": "macro.dbt.default__get_merge_sql", "macro_sql": "{% macro default__get_merge_sql(target, source, unique_key, dest_columns, incremental_predicates=none) -%}\n {%- set predicates = [] if incremental_predicates is none else [] + incremental_predicates -%}\n {%- set dest_cols_csv = get_quoted_csv(dest_columns | map(attribute=\"name\")) -%}\n {%- set merge_update_columns = config.get('merge_update_columns') -%}\n {%- set merge_exclude_columns = config.get('merge_exclude_columns') -%}\n {%- set update_columns = get_merge_update_columns(merge_update_columns, merge_exclude_columns, dest_columns) -%}\n {%- set sql_header = config.get('sql_header', none) -%}\n\n {% if unique_key %}\n {% if unique_key is sequence and unique_key is not mapping and unique_key is not string %}\n {% for key in unique_key %}\n {% set this_key_match %}\n DBT_INTERNAL_SOURCE.{{ key }} = DBT_INTERNAL_DEST.{{ key }}\n {% endset %}\n {% do predicates.append(this_key_match) %}\n {% endfor %}\n {% else %}\n {% set source_unique_key = (\"DBT_INTERNAL_SOURCE.\" ~ unique_key) | trim %}\n {% set target_unique_key = (\"DBT_INTERNAL_DEST.\" ~ unique_key) | trim %}\n {% set unique_key_match = get_merge_unique_key_match(source_unique_key, target_unique_key) %}\n {% do predicates.append(unique_key_match) %}\n {% endif %}\n {% else %}\n {% do predicates.append('FALSE') %}\n {% endif %}\n\n {{ sql_header if sql_header is not none }}\n\n merge into {{ target }} as DBT_INTERNAL_DEST\n using {{ source }} as DBT_INTERNAL_SOURCE\n on {{\"(\" ~ predicates | join(\") and (\") ~ \")\"}}\n\n {% if unique_key %}\n when matched then update set\n {% for column_name in update_columns -%}\n {{ column_name }} = DBT_INTERNAL_SOURCE.{{ column_name }}\n {%- if not loop.last %}, {%- endif %}\n {%- endfor %}\n {% endif %}\n\n when not matched then insert\n ({{ dest_cols_csv }})\n values\n ({{ dest_cols_csv }})\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_quoted_csv", "macro.dbt.get_merge_update_columns", "macro.dbt.get_merge_unique_key_match"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "target", "type": null, "description": ""}, {"name": "source", "type": null, "description": ""}, {"name": "unique_key", "type": null, "description": ""}, {"name": "dest_columns", "type": null, "description": ""}, {"name": "incremental_predicates", "type": null, "description": ""}], "created_at": 1789419969.97315, "supported_languages": null}, "macro.dbt.get_delete_insert_merge_sql": {"name": "get_delete_insert_merge_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/merge.sql", "original_file_path": "macros/materializations/models/incremental/merge.sql", "unique_id": "macro.dbt.get_delete_insert_merge_sql", "macro_sql": "{% macro get_delete_insert_merge_sql(target, source, unique_key, dest_columns, incremental_predicates) -%}\n {{ adapter.dispatch('get_delete_insert_merge_sql', 'dbt')(target, source, unique_key, dest_columns, incremental_predicates) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_delete_insert_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "target", "type": null, "description": ""}, {"name": "source", "type": null, "description": ""}, {"name": "unique_key", "type": null, "description": ""}, {"name": "dest_columns", "type": null, "description": ""}, {"name": "incremental_predicates", "type": null, "description": ""}], "created_at": 1789419969.973619, "supported_languages": null}, "macro.dbt.default__get_delete_insert_merge_sql": {"name": "default__get_delete_insert_merge_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/merge.sql", "original_file_path": "macros/materializations/models/incremental/merge.sql", "unique_id": "macro.dbt.default__get_delete_insert_merge_sql", "macro_sql": "{% macro default__get_delete_insert_merge_sql(target, source, unique_key, dest_columns, incremental_predicates) -%}\n\n {%- set dest_cols_csv = get_quoted_csv(dest_columns | map(attribute=\"name\")) -%}\n\n {% if unique_key %}\n {% if unique_key is string %}\n {% set unique_key = [unique_key] %}\n {% endif %}\n\n {%- set unique_key_str = unique_key|join(', ') -%}\n\n delete from {{ target }} as DBT_INTERNAL_DEST\n where ({{ unique_key_str }}) in (\n select distinct {{ unique_key_str }}\n from {{ source }} as DBT_INTERNAL_SOURCE\n )\n {%- if incremental_predicates %}\n {% for predicate in incremental_predicates %}\n and {{ predicate }}\n {% endfor %}\n {%- endif -%};\n\n {% endif %}\n\n insert into {{ target }} ({{ dest_cols_csv }})\n (\n select {{ dest_cols_csv }}\n from {{ source }}\n )\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.get_quoted_csv"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "target", "type": null, "description": ""}, {"name": "source", "type": null, "description": ""}, {"name": "unique_key", "type": null, "description": ""}, {"name": "dest_columns", "type": null, "description": ""}, {"name": "incremental_predicates", "type": null, "description": ""}], "created_at": 1789419969.9748542, "supported_languages": null}, "macro.dbt.get_insert_overwrite_merge_sql": {"name": "get_insert_overwrite_merge_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/merge.sql", "original_file_path": "macros/materializations/models/incremental/merge.sql", "unique_id": "macro.dbt.get_insert_overwrite_merge_sql", "macro_sql": "{% macro get_insert_overwrite_merge_sql(target, source, dest_columns, predicates, include_sql_header=false) -%}\n {{ adapter.dispatch('get_insert_overwrite_merge_sql', 'dbt')(target, source, dest_columns, predicates, include_sql_header) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_insert_overwrite_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "target", "type": null, "description": ""}, {"name": "source", "type": null, "description": ""}, {"name": "dest_columns", "type": null, "description": ""}, {"name": "predicates", "type": null, "description": ""}, {"name": "include_sql_header", "type": null, "description": ""}], "created_at": 1789419969.9753141, "supported_languages": null}, "macro.dbt.default__get_insert_overwrite_merge_sql": {"name": "default__get_insert_overwrite_merge_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/merge.sql", "original_file_path": "macros/materializations/models/incremental/merge.sql", "unique_id": "macro.dbt.default__get_insert_overwrite_merge_sql", "macro_sql": "{% macro default__get_insert_overwrite_merge_sql(target, source, dest_columns, predicates, include_sql_header) -%}\n {#-- The only time include_sql_header is True: --#}\n {#-- BigQuery + insert_overwrite strategy + \"static\" partitions config --#}\n {#-- We should consider including the sql header at the materialization level instead --#}\n\n {%- set predicates = [] if predicates is none else [] + predicates -%}\n {%- set dest_cols_csv = get_quoted_csv(dest_columns | map(attribute=\"name\")) -%}\n {%- set sql_header = config.get('sql_header', none) -%}\n\n {{ sql_header if sql_header is not none and include_sql_header }}\n\n merge into {{ target }} as DBT_INTERNAL_DEST\n using {{ source }} as DBT_INTERNAL_SOURCE\n on FALSE\n\n when not matched by source\n {% if predicates %} and {{ predicates | join(' and ') }} {% endif %}\n then delete\n\n when not matched then insert\n ({{ dest_cols_csv }})\n values\n ({{ dest_cols_csv }})\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_quoted_csv"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "target", "type": null, "description": ""}, {"name": "source", "type": null, "description": ""}, {"name": "dest_columns", "type": null, "description": ""}, {"name": "predicates", "type": null, "description": ""}, {"name": "include_sql_header", "type": null, "description": ""}], "created_at": 1789419969.9764168, "supported_languages": null}, "macro.dbt.is_incremental": {"name": "is_incremental", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/is_incremental.sql", "original_file_path": "macros/materializations/models/incremental/is_incremental.sql", "unique_id": "macro.dbt.is_incremental", "macro_sql": "{% macro is_incremental() %}\n {#-- do not run introspective queries in parsing #}\n {% if not execute %}\n {{ return(False) }}\n {% else %}\n {% set relation = adapter.get_relation(this.database, this.schema, this.table) %}\n {{ return(relation is not none\n and relation.type == 'table'\n and model.config.materialized == 'incremental'\n and not should_full_refresh()) }}\n {% endif %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.should_full_refresh"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789419969.9774632, "supported_languages": null}, "macro.dbt.date": {"name": "date", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/date.sql", "original_file_path": "macros/utils/date.sql", "unique_id": "macro.dbt.date", "macro_sql": "{% macro date(year, month, day) %}\n {{ return(adapter.dispatch('date', 'dbt') (year, month, day)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__date"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "year", "type": null, "description": ""}, {"name": "month", "type": null, "description": ""}, {"name": "day", "type": null, "description": ""}], "created_at": 1789419969.9780452, "supported_languages": null}, "macro.dbt.default__date": {"name": "default__date", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/date.sql", "original_file_path": "macros/utils/date.sql", "unique_id": "macro.dbt.default__date", "macro_sql": "{% macro default__date(year, month, day) -%}\n {%- set dt = modules.datetime.date(year, month, day) -%}\n {%- set iso_8601_formatted_date = dt.strftime('%Y-%m-%d') -%}\n to_date('{{ iso_8601_formatted_date }}', 'YYYY-MM-DD')\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "year", "type": null, "description": ""}, {"name": "month", "type": null, "description": ""}, {"name": "day", "type": null, "description": ""}], "created_at": 1789419969.9785342, "supported_languages": null}, "macro.dbt.safe_cast": {"name": "safe_cast", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/safe_cast.sql", "original_file_path": "macros/utils/safe_cast.sql", "unique_id": "macro.dbt.safe_cast", "macro_sql": "{% macro safe_cast(field, type) %}\n {{ return(adapter.dispatch('safe_cast', 'dbt') (field, type)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__safe_cast"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field", "type": null, "description": ""}, {"name": "type", "type": null, "description": ""}], "created_at": 1789419969.979055, "supported_languages": null}, "macro.dbt.default__safe_cast": {"name": "default__safe_cast", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/safe_cast.sql", "original_file_path": "macros/utils/safe_cast.sql", "unique_id": "macro.dbt.default__safe_cast", "macro_sql": "{% macro default__safe_cast(field, type) %}\n {# most databases don't support this function yet\n so we just need to use cast #}\n cast({{field}} as {{type}})\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field", "type": null, "description": ""}, {"name": "type", "type": null, "description": ""}], "created_at": 1789419969.979303, "supported_languages": null}, "macro.dbt.array_concat": {"name": "array_concat", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/array_concat.sql", "original_file_path": "macros/utils/array_concat.sql", "unique_id": "macro.dbt.array_concat", "macro_sql": "{% macro array_concat(array_1, array_2) -%}\n {{ return(adapter.dispatch('array_concat', 'dbt')(array_1, array_2)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__array_concat"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "array_1", "type": null, "description": ""}, {"name": "array_2", "type": null, "description": ""}], "created_at": 1789419969.979942, "supported_languages": null}, "macro.dbt.default__array_concat": {"name": "default__array_concat", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/array_concat.sql", "original_file_path": "macros/utils/array_concat.sql", "unique_id": "macro.dbt.default__array_concat", "macro_sql": "{% macro default__array_concat(array_1, array_2) -%}\n array_cat({{ array_1 }}, {{ array_2 }})\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "array_1", "type": null, "description": ""}, {"name": "array_2", "type": null, "description": ""}], "created_at": 1789419969.9801867, "supported_languages": null}, "macro.dbt.escape_single_quotes": {"name": "escape_single_quotes", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/escape_single_quotes.sql", "original_file_path": "macros/utils/escape_single_quotes.sql", "unique_id": "macro.dbt.escape_single_quotes", "macro_sql": "{% macro escape_single_quotes(expression) %}\n {{ return(adapter.dispatch('escape_single_quotes', 'dbt') (expression)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__escape_single_quotes"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "expression", "type": null, "description": ""}], "created_at": 1789419969.9806497, "supported_languages": null}, "macro.dbt.default__escape_single_quotes": {"name": "default__escape_single_quotes", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/escape_single_quotes.sql", "original_file_path": "macros/utils/escape_single_quotes.sql", "unique_id": "macro.dbt.default__escape_single_quotes", "macro_sql": "{% macro default__escape_single_quotes(expression) -%}\n{{ expression | replace(\"'\",\"''\") }}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "expression", "type": null, "description": ""}], "created_at": 1789419969.9809098, "supported_languages": null}, "macro.dbt.type_string": {"name": "type_string", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "unique_id": "macro.dbt.type_string", "macro_sql": "\n\n{%- macro type_string() -%}\n {{ return(adapter.dispatch('type_string', 'dbt')()) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt.default__type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789419969.9821744, "supported_languages": null}, "macro.dbt.default__type_string": {"name": "default__type_string", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "unique_id": "macro.dbt.default__type_string", "macro_sql": "{% macro default__type_string() %}\n {{ return(api.Column.translate_type(\"string\")) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789419969.9824505, "supported_languages": null}, "macro.dbt.type_timestamp": {"name": "type_timestamp", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "unique_id": "macro.dbt.type_timestamp", "macro_sql": "\n\n{%- macro type_timestamp() -%}\n {{ return(adapter.dispatch('type_timestamp', 'dbt')()) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt.default__type_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789419969.9827302, "supported_languages": null}, "macro.dbt.default__type_timestamp": {"name": "default__type_timestamp", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "unique_id": "macro.dbt.default__type_timestamp", "macro_sql": "{% macro default__type_timestamp() %}\n {{ return(api.Column.translate_type(\"timestamp\")) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789419969.9830105, "supported_languages": null}, "macro.dbt.type_float": {"name": "type_float", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "unique_id": "macro.dbt.type_float", "macro_sql": "\n\n{%- macro type_float() -%}\n {{ return(adapter.dispatch('type_float', 'dbt')()) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt.default__type_float"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789419969.9832873, "supported_languages": null}, "macro.dbt.default__type_float": {"name": "default__type_float", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "unique_id": "macro.dbt.default__type_float", "macro_sql": "{% macro default__type_float() %}\n {{ return(api.Column.translate_type(\"float\")) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789419969.9835439, "supported_languages": null}, "macro.dbt.type_numeric": {"name": "type_numeric", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "unique_id": "macro.dbt.type_numeric", "macro_sql": "\n\n{%- macro type_numeric() -%}\n {{ return(adapter.dispatch('type_numeric', 'dbt')()) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt.default__type_numeric"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789419969.9838324, "supported_languages": null}, "macro.dbt.default__type_numeric": {"name": "default__type_numeric", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "unique_id": "macro.dbt.default__type_numeric", "macro_sql": "{% macro default__type_numeric() %}\n {{ return(api.Column.numeric_type(\"numeric\", 28, 6)) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789419969.9841347, "supported_languages": null}, "macro.dbt.type_bigint": {"name": "type_bigint", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "unique_id": "macro.dbt.type_bigint", "macro_sql": "\n\n{%- macro type_bigint() -%}\n {{ return(adapter.dispatch('type_bigint', 'dbt')()) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt.default__type_bigint"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789419969.984404, "supported_languages": null}, "macro.dbt.default__type_bigint": {"name": "default__type_bigint", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "unique_id": "macro.dbt.default__type_bigint", "macro_sql": "{% macro default__type_bigint() %}\n {{ return(api.Column.translate_type(\"bigint\")) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789419969.984655, "supported_languages": null}, "macro.dbt.type_int": {"name": "type_int", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "unique_id": "macro.dbt.type_int", "macro_sql": "\n\n{%- macro type_int() -%}\n {{ return(adapter.dispatch('type_int', 'dbt')()) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt.default__type_int"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789419969.9849381, "supported_languages": null}, "macro.dbt.default__type_int": {"name": "default__type_int", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "unique_id": "macro.dbt.default__type_int", "macro_sql": "{%- macro default__type_int() -%}\n {{ return(api.Column.translate_type(\"integer\")) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789419969.9851813, "supported_languages": null}, "macro.dbt.type_boolean": {"name": "type_boolean", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "unique_id": "macro.dbt.type_boolean", "macro_sql": "\n\n{%- macro type_boolean() -%}\n {{ return(adapter.dispatch('type_boolean', 'dbt')()) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt.default__type_boolean"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789419969.985575, "supported_languages": null}, "macro.dbt.default__type_boolean": {"name": "default__type_boolean", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "unique_id": "macro.dbt.default__type_boolean", "macro_sql": "{%- macro default__type_boolean() -%}\n {{ return(api.Column.translate_type(\"boolean\")) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789419969.9858387, "supported_languages": null}, "macro.dbt.array_append": {"name": "array_append", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/array_append.sql", "original_file_path": "macros/utils/array_append.sql", "unique_id": "macro.dbt.array_append", "macro_sql": "{% macro array_append(array, new_element) -%}\n {{ return(adapter.dispatch('array_append', 'dbt')(array, new_element)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__array_append"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "array", "type": null, "description": ""}, {"name": "new_element", "type": null, "description": ""}], "created_at": 1789419969.986344, "supported_languages": null}, "macro.dbt.default__array_append": {"name": "default__array_append", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/array_append.sql", "original_file_path": "macros/utils/array_append.sql", "unique_id": "macro.dbt.default__array_append", "macro_sql": "{% macro default__array_append(array, new_element) -%}\n array_append({{ array }}, {{ new_element }})\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "array", "type": null, "description": ""}, {"name": "new_element", "type": null, "description": ""}], "created_at": 1789419969.9865801, "supported_languages": null}, "macro.dbt.get_powers_of_two": {"name": "get_powers_of_two", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/generate_series.sql", "original_file_path": "macros/utils/generate_series.sql", "unique_id": "macro.dbt.get_powers_of_two", "macro_sql": "{% macro get_powers_of_two(upper_bound) %}\n {{ return(adapter.dispatch('get_powers_of_two', 'dbt')(upper_bound)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_powers_of_two"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "upper_bound", "type": null, "description": ""}], "created_at": 1789419969.9873536, "supported_languages": null}, "macro.dbt.default__get_powers_of_two": {"name": "default__get_powers_of_two", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/generate_series.sql", "original_file_path": "macros/utils/generate_series.sql", "unique_id": "macro.dbt.default__get_powers_of_two", "macro_sql": "{% macro default__get_powers_of_two(upper_bound) %}\n\n {% if upper_bound <= 0 %}\n {{ exceptions.raise_compiler_error(\"upper bound must be positive\") }}\n {% endif %}\n\n {% for _ in range(1, 100) %}\n {% if upper_bound <= 2 ** loop.index %}{{ return(loop.index) }}{% endif %}\n {% endfor %}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "upper_bound", "type": null, "description": ""}], "created_at": 1789419969.9880776, "supported_languages": null}, "macro.dbt.generate_series": {"name": "generate_series", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/generate_series.sql", "original_file_path": "macros/utils/generate_series.sql", "unique_id": "macro.dbt.generate_series", "macro_sql": "{% macro generate_series(upper_bound) %}\n {{ return(adapter.dispatch('generate_series', 'dbt')(upper_bound)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__generate_series"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "upper_bound", "type": null, "description": ""}], "created_at": 1789419969.9884021, "supported_languages": null}, "macro.dbt.default__generate_series": {"name": "default__generate_series", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/generate_series.sql", "original_file_path": "macros/utils/generate_series.sql", "unique_id": "macro.dbt.default__generate_series", "macro_sql": "{% macro default__generate_series(upper_bound) %}\n\n {% set n = dbt.get_powers_of_two(upper_bound) %}\n\n with p as (\n select 0 as generated_number union all select 1\n ), unioned as (\n\n select\n\n {% for i in range(n) %}\n p{{i}}.generated_number * power(2, {{i}})\n {% if not loop.last %} + {% endif %}\n {% endfor %}\n + 1\n as generated_number\n\n from\n\n {% for i in range(n) %}\n p as p{{i}}\n {% if not loop.last %} cross join {% endif %}\n {% endfor %}\n\n )\n\n select *\n from unioned\n where generated_number <= {{upper_bound}}\n order by generated_number\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_powers_of_two"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "upper_bound", "type": null, "description": ""}], "created_at": 1789419969.9892685, "supported_languages": null}, "macro.dbt.right": {"name": "right", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/right.sql", "original_file_path": "macros/utils/right.sql", "unique_id": "macro.dbt.right", "macro_sql": "{% macro right(string_text, length_expression) -%}\n {{ return(adapter.dispatch('right', 'dbt') (string_text, length_expression)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__right"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "string_text", "type": null, "description": ""}, {"name": "length_expression", "type": null, "description": ""}], "created_at": 1789419969.9897828, "supported_languages": null}, "macro.dbt.default__right": {"name": "default__right", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/right.sql", "original_file_path": "macros/utils/right.sql", "unique_id": "macro.dbt.default__right", "macro_sql": "{% macro default__right(string_text, length_expression) %}\n\n right(\n {{ string_text }},\n {{ length_expression }}\n )\n\n{%- endmacro -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "string_text", "type": null, "description": ""}, {"name": "length_expression", "type": null, "description": ""}], "created_at": 1789419969.990026, "supported_languages": null}, "macro.dbt.hash": {"name": "hash", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/hash.sql", "original_file_path": "macros/utils/hash.sql", "unique_id": "macro.dbt.hash", "macro_sql": "{% macro hash(field) -%}\n {{ return(adapter.dispatch('hash', 'dbt') (field)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__hash"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field", "type": null, "description": ""}], "created_at": 1789419969.9904604, "supported_languages": null}, "macro.dbt.default__hash": {"name": "default__hash", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/hash.sql", "original_file_path": "macros/utils/hash.sql", "unique_id": "macro.dbt.default__hash", "macro_sql": "{% macro default__hash(field) -%}\n md5(cast({{ field }} as {{ api.Column.translate_type('string') }}))\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field", "type": null, "description": ""}], "created_at": 1789419969.9907305, "supported_languages": null}, "macro.dbt.intersect": {"name": "intersect", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/intersect.sql", "original_file_path": "macros/utils/intersect.sql", "unique_id": "macro.dbt.intersect", "macro_sql": "{% macro intersect() %}\n {{ return(adapter.dispatch('intersect', 'dbt')()) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__intersect"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789419969.9911244, "supported_languages": null}, "macro.dbt.default__intersect": {"name": "default__intersect", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/intersect.sql", "original_file_path": "macros/utils/intersect.sql", "unique_id": "macro.dbt.default__intersect", "macro_sql": "{% macro default__intersect() %}\n\n intersect\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789419969.9912574, "supported_languages": null}, "macro.dbt.last_day": {"name": "last_day", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/last_day.sql", "original_file_path": "macros/utils/last_day.sql", "unique_id": "macro.dbt.last_day", "macro_sql": "{% macro last_day(date, datepart) %}\n {{ return(adapter.dispatch('last_day', 'dbt') (date, datepart)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__last_day"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "date", "type": null, "description": ""}, {"name": "datepart", "type": null, "description": ""}], "created_at": 1789419969.9917865, "supported_languages": null}, "macro.dbt.default_last_day": {"name": "default_last_day", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/last_day.sql", "original_file_path": "macros/utils/last_day.sql", "unique_id": "macro.dbt.default_last_day", "macro_sql": "\n\n{%- macro default_last_day(date, datepart) -%}\n cast(\n {{dbt.dateadd('day', '-1',\n dbt.dateadd(datepart, '1', dbt.date_trunc(datepart, date))\n )}}\n as date)\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt.dateadd", "macro.dbt.date_trunc"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "date", "type": null, "description": ""}, {"name": "datepart", "type": null, "description": ""}], "created_at": 1789419969.992245, "supported_languages": null}, "macro.dbt.default__last_day": {"name": "default__last_day", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/last_day.sql", "original_file_path": "macros/utils/last_day.sql", "unique_id": "macro.dbt.default__last_day", "macro_sql": "{% macro default__last_day(date, datepart) -%}\n {{dbt.default_last_day(date, datepart)}}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default_last_day"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "date", "type": null, "description": ""}, {"name": "datepart", "type": null, "description": ""}], "created_at": 1789419969.9926338, "supported_languages": null}, "macro.dbt.listagg": {"name": "listagg", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/listagg.sql", "original_file_path": "macros/utils/listagg.sql", "unique_id": "macro.dbt.listagg", "macro_sql": "{% macro listagg(measure, delimiter_text=\"','\", order_by_clause=none, limit_num=none) -%}\n {{ return(adapter.dispatch('listagg', 'dbt') (measure, delimiter_text, order_by_clause, limit_num)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__listagg"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "measure", "type": null, "description": ""}, {"name": "delimiter_text", "type": null, "description": ""}, {"name": "order_by_clause", "type": null, "description": ""}, {"name": "limit_num", "type": null, "description": ""}], "created_at": 1789419969.993429, "supported_languages": null}, "macro.dbt.default__listagg": {"name": "default__listagg", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/listagg.sql", "original_file_path": "macros/utils/listagg.sql", "unique_id": "macro.dbt.default__listagg", "macro_sql": "{% macro default__listagg(measure, delimiter_text, order_by_clause, limit_num) -%}\n\n {% if limit_num -%}\n array_to_string(\n array_slice(\n array_agg(\n {{ measure }}\n ){% if order_by_clause -%}\n within group ({{ order_by_clause }})\n {%- endif %}\n ,0\n ,{{ limit_num }}\n ),\n {{ delimiter_text }}\n )\n {%- else %}\n listagg(\n {{ measure }},\n {{ delimiter_text }}\n )\n {% if order_by_clause -%}\n within group ({{ order_by_clause }})\n {%- endif %}\n {%- endif %}\n\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "measure", "type": null, "description": ""}, {"name": "delimiter_text", "type": null, "description": ""}, {"name": "order_by_clause", "type": null, "description": ""}, {"name": "limit_num", "type": null, "description": ""}], "created_at": 1789419969.9941344, "supported_languages": null}, "macro.dbt.cast_bool_to_text": {"name": "cast_bool_to_text", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/cast_bool_to_text.sql", "original_file_path": "macros/utils/cast_bool_to_text.sql", "unique_id": "macro.dbt.cast_bool_to_text", "macro_sql": "{% macro cast_bool_to_text(field) %}\n {{ adapter.dispatch('cast_bool_to_text', 'dbt') (field) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__cast_bool_to_text"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field", "type": null, "description": ""}], "created_at": 1789419969.9945636, "supported_languages": null}, "macro.dbt.default__cast_bool_to_text": {"name": "default__cast_bool_to_text", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/cast_bool_to_text.sql", "original_file_path": "macros/utils/cast_bool_to_text.sql", "unique_id": "macro.dbt.default__cast_bool_to_text", "macro_sql": "{% macro default__cast_bool_to_text(field) %}\n cast({{ field }} as {{ api.Column.translate_type('string') }})\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field", "type": null, "description": ""}], "created_at": 1789419969.9948516, "supported_languages": null}, "macro.dbt.date_trunc": {"name": "date_trunc", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/date_trunc.sql", "original_file_path": "macros/utils/date_trunc.sql", "unique_id": "macro.dbt.date_trunc", "macro_sql": "{% macro date_trunc(datepart, date) -%}\n {{ return(adapter.dispatch('date_trunc', 'dbt') (datepart, date)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__date_trunc"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "datepart", "type": null, "description": ""}, {"name": "date", "type": null, "description": ""}], "created_at": 1789419969.995333, "supported_languages": null}, "macro.dbt.default__date_trunc": {"name": "default__date_trunc", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/date_trunc.sql", "original_file_path": "macros/utils/date_trunc.sql", "unique_id": "macro.dbt.default__date_trunc", "macro_sql": "{% macro default__date_trunc(datepart, date) -%}\n date_trunc('{{datepart}}', {{date}})\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "datepart", "type": null, "description": ""}, {"name": "date", "type": null, "description": ""}], "created_at": 1789419969.9955602, "supported_languages": null}, "macro.dbt.position": {"name": "position", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/position.sql", "original_file_path": "macros/utils/position.sql", "unique_id": "macro.dbt.position", "macro_sql": "{% macro position(substring_text, string_text) -%}\n {{ return(adapter.dispatch('position', 'dbt') (substring_text, string_text)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__position"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "substring_text", "type": null, "description": ""}, {"name": "string_text", "type": null, "description": ""}], "created_at": 1789419969.9960523, "supported_languages": null}, "macro.dbt.default__position": {"name": "default__position", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/position.sql", "original_file_path": "macros/utils/position.sql", "unique_id": "macro.dbt.default__position", "macro_sql": "{% macro default__position(substring_text, string_text) %}\n\n position(\n {{ substring_text }} in {{ string_text }}\n )\n\n{%- endmacro -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "substring_text", "type": null, "description": ""}, {"name": "string_text", "type": null, "description": ""}], "created_at": 1789419969.9962938, "supported_languages": null}, "macro.dbt.any_value": {"name": "any_value", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/any_value.sql", "original_file_path": "macros/utils/any_value.sql", "unique_id": "macro.dbt.any_value", "macro_sql": "{% macro any_value(expression) -%}\n {{ return(adapter.dispatch('any_value', 'dbt') (expression)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__any_value"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "expression", "type": null, "description": ""}], "created_at": 1789419969.9967084, "supported_languages": null}, "macro.dbt.default__any_value": {"name": "default__any_value", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/any_value.sql", "original_file_path": "macros/utils/any_value.sql", "unique_id": "macro.dbt.default__any_value", "macro_sql": "{% macro default__any_value(expression) -%}\n\n any_value({{ expression }})\n\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "expression", "type": null, "description": ""}], "created_at": 1789419969.9969172, "supported_languages": null}, "macro.dbt.length": {"name": "length", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/length.sql", "original_file_path": "macros/utils/length.sql", "unique_id": "macro.dbt.length", "macro_sql": "{% macro length(expression) -%}\n {{ return(adapter.dispatch('length', 'dbt') (expression)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__length"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "expression", "type": null, "description": ""}], "created_at": 1789419969.9973385, "supported_languages": null}, "macro.dbt.default__length": {"name": "default__length", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/length.sql", "original_file_path": "macros/utils/length.sql", "unique_id": "macro.dbt.default__length", "macro_sql": "{% macro default__length(expression) %}\n\n length(\n {{ expression }}\n )\n\n{%- endmacro -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "expression", "type": null, "description": ""}], "created_at": 1789419969.997521, "supported_languages": null}, "macro.dbt.cast": {"name": "cast", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/cast.sql", "original_file_path": "macros/utils/cast.sql", "unique_id": "macro.dbt.cast", "macro_sql": "{% macro cast(field, type) %}\n {{ return(adapter.dispatch('cast', 'dbt') (field, type)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__cast"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field", "type": null, "description": ""}, {"name": "type", "type": null, "description": ""}], "created_at": 1789419969.9980087, "supported_languages": null}, "macro.dbt.default__cast": {"name": "default__cast", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/cast.sql", "original_file_path": "macros/utils/cast.sql", "unique_id": "macro.dbt.default__cast", "macro_sql": "{% macro default__cast(field, type) %}\n cast({{field}} as {{type}})\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field", "type": null, "description": ""}, {"name": "type", "type": null, "description": ""}], "created_at": 1789419969.9982414, "supported_languages": null}, "macro.dbt.get_intervals_between": {"name": "get_intervals_between", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/date_spine.sql", "original_file_path": "macros/utils/date_spine.sql", "unique_id": "macro.dbt.get_intervals_between", "macro_sql": "{% macro get_intervals_between(start_date, end_date, datepart) -%}\n {{ return(adapter.dispatch('get_intervals_between', 'dbt')(start_date, end_date, datepart)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_intervals_between"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "start_date", "type": null, "description": ""}, {"name": "end_date", "type": null, "description": ""}, {"name": "datepart", "type": null, "description": ""}], "created_at": 1789419969.9992216, "supported_languages": null}, "macro.dbt.default__get_intervals_between": {"name": "default__get_intervals_between", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/date_spine.sql", "original_file_path": "macros/utils/date_spine.sql", "unique_id": "macro.dbt.default__get_intervals_between", "macro_sql": "{% macro default__get_intervals_between(start_date, end_date, datepart) -%}\n {%- call statement('get_intervals_between', fetch_result=True) %}\n\n select {{ dbt.datediff(start_date, end_date, datepart) }}\n\n {%- endcall -%}\n\n {%- set value_list = load_result('get_intervals_between') -%}\n\n {%- if value_list and value_list['data'] -%}\n {%- set values = value_list['data'] | map(attribute=0) | list %}\n {{ return(values[0]) }}\n {%- else -%}\n {{ return(1) }}\n {%- endif -%}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.statement", "macro.dbt.datediff"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "start_date", "type": null, "description": ""}, {"name": "end_date", "type": null, "description": ""}, {"name": "datepart", "type": null, "description": ""}], "created_at": 1789419970.0002573, "supported_languages": null}, "macro.dbt.date_spine": {"name": "date_spine", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/date_spine.sql", "original_file_path": "macros/utils/date_spine.sql", "unique_id": "macro.dbt.date_spine", "macro_sql": "{% macro date_spine(datepart, start_date, end_date) %}\n {{ return(adapter.dispatch('date_spine', 'dbt')(datepart, start_date, end_date)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__date_spine"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "datepart", "type": null, "description": ""}, {"name": "start_date", "type": null, "description": ""}, {"name": "end_date", "type": null, "description": ""}], "created_at": 1789419970.000665, "supported_languages": null}, "macro.dbt.default__date_spine": {"name": "default__date_spine", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/date_spine.sql", "original_file_path": "macros/utils/date_spine.sql", "unique_id": "macro.dbt.default__date_spine", "macro_sql": "{% macro default__date_spine(datepart, start_date, end_date) %}\n\n\n {# call as follows:\n\n date_spine(\n \"day\",\n \"to_date('01/01/2016', 'mm/dd/yyyy')\",\n \"dbt.dateadd(week, 1, current_date)\"\n ) #}\n\n\n with rawdata as (\n\n {{dbt.generate_series(\n dbt.get_intervals_between(start_date, end_date, datepart)\n )}}\n\n ),\n\n all_periods as (\n\n select (\n {{\n dbt.dateadd(\n datepart,\n \"row_number() over (order by 1) - 1\",\n start_date\n )\n }}\n ) as date_{{datepart}}\n from rawdata\n\n ),\n\n filtered as (\n\n select *\n from all_periods\n where date_{{datepart}} <= {{ end_date }}\n\n )\n\n select * from filtered\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.generate_series", "macro.dbt.get_intervals_between", "macro.dbt.dateadd"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "datepart", "type": null, "description": ""}, {"name": "start_date", "type": null, "description": ""}, {"name": "end_date", "type": null, "description": ""}], "created_at": 1789419970.0012987, "supported_languages": null}, "macro.dbt.datediff": {"name": "datediff", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/datediff.sql", "original_file_path": "macros/utils/datediff.sql", "unique_id": "macro.dbt.datediff", "macro_sql": "{% macro datediff(first_date, second_date, datepart) %}\n {{ return(adapter.dispatch('datediff', 'dbt')(first_date, second_date, datepart)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__datediff"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "first_date", "type": null, "description": ""}, {"name": "second_date", "type": null, "description": ""}, {"name": "datepart", "type": null, "description": ""}], "created_at": 1789419970.0018606, "supported_languages": null}, "macro.dbt.default__datediff": {"name": "default__datediff", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/datediff.sql", "original_file_path": "macros/utils/datediff.sql", "unique_id": "macro.dbt.default__datediff", "macro_sql": "{% macro default__datediff(first_date, second_date, datepart) -%}\n\n datediff(\n {{ datepart }},\n {{ first_date }},\n {{ second_date }}\n )\n\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "first_date", "type": null, "description": ""}, {"name": "second_date", "type": null, "description": ""}, {"name": "datepart", "type": null, "description": ""}], "created_at": 1789419970.0021486, "supported_languages": null}, "macro.dbt.equals": {"name": "equals", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/equals.sql", "original_file_path": "macros/utils/equals.sql", "unique_id": "macro.dbt.equals", "macro_sql": "{% macro equals(expr1, expr2) %}\n {{ return(adapter.dispatch('equals', 'dbt') (expr1, expr2)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__equals"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "expr1", "type": null, "description": ""}, {"name": "expr2", "type": null, "description": ""}], "created_at": 1789419970.0026934, "supported_languages": null}, "macro.dbt.default__equals": {"name": "default__equals", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/equals.sql", "original_file_path": "macros/utils/equals.sql", "unique_id": "macro.dbt.default__equals", "macro_sql": "{% macro default__equals(expr1, expr2) -%}\n{%- if adapter.behavior.enable_truthy_nulls_equals_macro.no_warn %}\n case when (({{ expr1 }} = {{ expr2 }}) or ({{ expr1 }} is null and {{ expr2 }} is null))\n then 0\n else 1\n end = 0\n{%- else -%}\n ({{ expr1 }} = {{ expr2 }})\n{%- endif %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "expr1", "type": null, "description": ""}, {"name": "expr2", "type": null, "description": ""}], "created_at": 1789419970.0032241, "supported_languages": null}, "macro.dbt.dateadd": {"name": "dateadd", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/dateadd.sql", "original_file_path": "macros/utils/dateadd.sql", "unique_id": "macro.dbt.dateadd", "macro_sql": "{% macro dateadd(datepart, interval, from_date_or_timestamp) %}\n {{ return(adapter.dispatch('dateadd', 'dbt')(datepart, interval, from_date_or_timestamp)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__dateadd"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "datepart", "type": null, "description": ""}, {"name": "interval", "type": null, "description": ""}, {"name": "from_date_or_timestamp", "type": null, "description": ""}], "created_at": 1789419970.0037777, "supported_languages": null}, "macro.dbt.default__dateadd": {"name": "default__dateadd", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/dateadd.sql", "original_file_path": "macros/utils/dateadd.sql", "unique_id": "macro.dbt.default__dateadd", "macro_sql": "{% macro default__dateadd(datepart, interval, from_date_or_timestamp) %}\n\n dateadd(\n {{ datepart }},\n {{ interval }},\n {{ from_date_or_timestamp }}\n )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "datepart", "type": null, "description": ""}, {"name": "interval", "type": null, "description": ""}, {"name": "from_date_or_timestamp", "type": null, "description": ""}], "created_at": 1789419970.0040722, "supported_languages": null}, "macro.dbt.concat": {"name": "concat", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/concat.sql", "original_file_path": "macros/utils/concat.sql", "unique_id": "macro.dbt.concat", "macro_sql": "{% macro concat(fields) -%}\n {{ return(adapter.dispatch('concat', 'dbt')(fields)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__concat"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "fields", "type": null, "description": ""}], "created_at": 1789419970.0044928, "supported_languages": null}, "macro.dbt.default__concat": {"name": "default__concat", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/concat.sql", "original_file_path": "macros/utils/concat.sql", "unique_id": "macro.dbt.default__concat", "macro_sql": "{% macro default__concat(fields) -%}\n {{ fields|join(' || ') }}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "fields", "type": null, "description": ""}], "created_at": 1789419970.004716, "supported_languages": null}, "macro.dbt.array_construct": {"name": "array_construct", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/array_construct.sql", "original_file_path": "macros/utils/array_construct.sql", "unique_id": "macro.dbt.array_construct", "macro_sql": "{% macro array_construct(inputs=[], data_type=api.Column.translate_type('integer')) -%}\n {{ return(adapter.dispatch('array_construct', 'dbt')(inputs, data_type)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__array_construct"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "inputs", "type": null, "description": ""}, {"name": "data_type", "type": null, "description": ""}], "created_at": 1789419970.005378, "supported_languages": null}, "macro.dbt.default__array_construct": {"name": "default__array_construct", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/array_construct.sql", "original_file_path": "macros/utils/array_construct.sql", "unique_id": "macro.dbt.default__array_construct", "macro_sql": "{% macro default__array_construct(inputs, data_type) -%}\n {% if inputs|length > 0 %}\n array[ {{ inputs|join(' , ') }} ]\n {% else %}\n array[]::{{data_type}}[]\n {% endif %}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "inputs", "type": null, "description": ""}, {"name": "data_type", "type": null, "description": ""}], "created_at": 1789419970.0058234, "supported_languages": null}, "macro.dbt.split_part": {"name": "split_part", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/split_part.sql", "original_file_path": "macros/utils/split_part.sql", "unique_id": "macro.dbt.split_part", "macro_sql": "{% macro split_part(string_text, delimiter_text, part_number) %}\n {{ return(adapter.dispatch('split_part', 'dbt') (string_text, delimiter_text, part_number)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__split_part"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "string_text", "type": null, "description": ""}, {"name": "delimiter_text", "type": null, "description": ""}, {"name": "part_number", "type": null, "description": ""}], "created_at": 1789419970.0064726, "supported_languages": null}, "macro.dbt.default__split_part": {"name": "default__split_part", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/split_part.sql", "original_file_path": "macros/utils/split_part.sql", "unique_id": "macro.dbt.default__split_part", "macro_sql": "{% macro default__split_part(string_text, delimiter_text, part_number) %}\n\n split_part(\n {{ string_text }},\n {{ delimiter_text }},\n {{ part_number }}\n )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "string_text", "type": null, "description": ""}, {"name": "delimiter_text", "type": null, "description": ""}, {"name": "part_number", "type": null, "description": ""}], "created_at": 1789419970.0069113, "supported_languages": null}, "macro.dbt._split_part_negative": {"name": "_split_part_negative", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/split_part.sql", "original_file_path": "macros/utils/split_part.sql", "unique_id": "macro.dbt._split_part_negative", "macro_sql": "{% macro _split_part_negative(string_text, delimiter_text, part_number) %}\n\n split_part(\n {{ string_text }},\n {{ delimiter_text }},\n length({{ string_text }})\n - length(\n replace({{ string_text }}, {{ delimiter_text }}, '')\n ) + 2 + {{ part_number }}\n )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "string_text", "type": null, "description": ""}, {"name": "delimiter_text", "type": null, "description": ""}, {"name": "part_number", "type": null, "description": ""}], "created_at": 1789419970.0073, "supported_languages": null}, "macro.dbt.bool_or": {"name": "bool_or", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/bool_or.sql", "original_file_path": "macros/utils/bool_or.sql", "unique_id": "macro.dbt.bool_or", "macro_sql": "{% macro bool_or(expression) -%}\n {{ return(adapter.dispatch('bool_or', 'dbt') (expression)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__bool_or"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "expression", "type": null, "description": ""}], "created_at": 1789419970.007722, "supported_languages": null}, "macro.dbt.default__bool_or": {"name": "default__bool_or", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/bool_or.sql", "original_file_path": "macros/utils/bool_or.sql", "unique_id": "macro.dbt.default__bool_or", "macro_sql": "{% macro default__bool_or(expression) -%}\n\n bool_or({{ expression }})\n\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "expression", "type": null, "description": ""}], "created_at": 1789419970.0079277, "supported_languages": null}, "macro.dbt.replace": {"name": "replace", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/replace.sql", "original_file_path": "macros/utils/replace.sql", "unique_id": "macro.dbt.replace", "macro_sql": "{% macro replace(field, old_chars, new_chars) -%}\n {{ return(adapter.dispatch('replace', 'dbt') (field, old_chars, new_chars)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__replace"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field", "type": null, "description": ""}, {"name": "old_chars", "type": null, "description": ""}, {"name": "new_chars", "type": null, "description": ""}], "created_at": 1789419970.0084572, "supported_languages": null}, "macro.dbt.default__replace": {"name": "default__replace", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/replace.sql", "original_file_path": "macros/utils/replace.sql", "unique_id": "macro.dbt.default__replace", "macro_sql": "{% macro default__replace(field, old_chars, new_chars) %}\n\n replace(\n {{ field }},\n {{ old_chars }},\n {{ new_chars }}\n )\n\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field", "type": null, "description": ""}, {"name": "old_chars", "type": null, "description": ""}, {"name": "new_chars", "type": null, "description": ""}], "created_at": 1789419970.0087657, "supported_languages": null}, "macro.dbt.string_literal": {"name": "string_literal", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/literal.sql", "original_file_path": "macros/utils/literal.sql", "unique_id": "macro.dbt.string_literal", "macro_sql": "{%- macro string_literal(value) -%}\n {{ return(adapter.dispatch('string_literal', 'dbt') (value)) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt.default__string_literal"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "value", "type": null, "description": ""}], "created_at": 1789419970.009197, "supported_languages": null}, "macro.dbt.default__string_literal": {"name": "default__string_literal", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/literal.sql", "original_file_path": "macros/utils/literal.sql", "unique_id": "macro.dbt.default__string_literal", "macro_sql": "{% macro default__string_literal(value) -%}\n '{{ value }}'\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "value", "type": null, "description": ""}], "created_at": 1789419970.0093763, "supported_languages": null}, "macro.dbt.except": {"name": "except", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/except.sql", "original_file_path": "macros/utils/except.sql", "unique_id": "macro.dbt.except", "macro_sql": "{% macro except() %}\n {{ return(adapter.dispatch('except', 'dbt')()) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__except"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789419970.0097656, "supported_languages": null}, "macro.dbt.default__except": {"name": "default__except", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/except.sql", "original_file_path": "macros/utils/except.sql", "unique_id": "macro.dbt.default__except", "macro_sql": "{% macro default__except() %}\n\n except\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789419970.0099034, "supported_languages": null}, "macro.dbt.statement": {"name": "statement", "resource_type": "macro", "package_name": "dbt", "path": "macros/etc/statement.sql", "original_file_path": "macros/etc/statement.sql", "unique_id": "macro.dbt.statement", "macro_sql": "\n{%- macro statement(name=None, fetch_result=False, auto_begin=True, language='sql') -%}\n {%- if execute: -%}\n {%- set compiled_code = caller() -%}\n\n {%- if name == 'main' -%}\n {{ log('Writing runtime {} for node \"{}\"'.format(language, model['unique_id'])) }}\n {{ write(compiled_code) }}\n {%- endif -%}\n {%- if language == 'sql'-%}\n {%- set res, table = adapter.execute(compiled_code, auto_begin=auto_begin, fetch=fetch_result) -%}\n {%- elif language == 'python' -%}\n {%- set res = submit_python_job(model, compiled_code) -%}\n {#-- TODO: What should table be for python models? --#}\n {%- set table = None -%}\n {%- else -%}\n {% do exceptions.raise_compiler_error(\"statement macro didn't get supported language\") %}\n {%- endif -%}\n\n {%- if name is not none -%}\n {{ store_result(name, response=res, agate_table=table) }}\n {%- endif -%}\n\n {%- endif -%}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "name", "type": null, "description": ""}, {"name": "fetch_result", "type": null, "description": ""}, {"name": "auto_begin", "type": null, "description": ""}, {"name": "language", "type": null, "description": ""}], "created_at": 1789419970.0121055, "supported_languages": null}, "macro.dbt.noop_statement": {"name": "noop_statement", "resource_type": "macro", "package_name": "dbt", "path": "macros/etc/statement.sql", "original_file_path": "macros/etc/statement.sql", "unique_id": "macro.dbt.noop_statement", "macro_sql": "{% macro noop_statement(name=None, message=None, code=None, rows_affected=None, res=None) -%}\n {%- set sql = caller() -%}\n\n {%- if name == 'main' -%}\n {{ log('Writing runtime SQL for node \"{}\"'.format(model['unique_id'])) }}\n {{ write(sql) }}\n {%- endif -%}\n\n {%- if name is not none -%}\n {{ store_raw_result(name, message=message, code=code, rows_affected=rows_affected, agate_table=res) }}\n {%- endif -%}\n\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "name", "type": null, "description": ""}, {"name": "message", "type": null, "description": ""}, {"name": "code", "type": null, "description": ""}, {"name": "rows_affected", "type": null, "description": ""}, {"name": "res", "type": null, "description": ""}], "created_at": 1789419970.0132244, "supported_languages": null}, "macro.dbt.run_query": {"name": "run_query", "resource_type": "macro", "package_name": "dbt", "path": "macros/etc/statement.sql", "original_file_path": "macros/etc/statement.sql", "unique_id": "macro.dbt.run_query", "macro_sql": "{% macro run_query(sql) %}\n {% call statement(\"run_query_statement\", fetch_result=true, auto_begin=false) %}\n {{ sql }}\n {% endcall %}\n\n {% do return(load_result(\"run_query_statement\").table) %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "sql", "type": null, "description": ""}], "created_at": 1789419970.0137255, "supported_languages": null}, "macro.dbt.convert_datetime": {"name": "convert_datetime", "resource_type": "macro", "package_name": "dbt", "path": "macros/etc/datetime.sql", "original_file_path": "macros/etc/datetime.sql", "unique_id": "macro.dbt.convert_datetime", "macro_sql": "{% macro convert_datetime(date_str, date_fmt) %}\n\n {% set error_msg -%}\n The provided partition date '{{ date_str }}' does not match the expected format '{{ date_fmt }}'\n {%- endset %}\n\n {% set res = try_or_compiler_error(error_msg, modules.datetime.datetime.strptime, date_str.strip(), date_fmt) %}\n {{ return(res) }}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "date_str", "type": null, "description": ""}, {"name": "date_fmt", "type": null, "description": ""}], "created_at": 1789419970.0150523, "supported_languages": null}, "macro.dbt.dates_in_range": {"name": "dates_in_range", "resource_type": "macro", "package_name": "dbt", "path": "macros/etc/datetime.sql", "original_file_path": "macros/etc/datetime.sql", "unique_id": "macro.dbt.dates_in_range", "macro_sql": "{% macro dates_in_range(start_date_str, end_date_str=none, in_fmt=\"%Y%m%d\", out_fmt=\"%Y%m%d\") %}\n {% set end_date_str = start_date_str if end_date_str is none else end_date_str %}\n\n {% set start_date = convert_datetime(start_date_str, in_fmt) %}\n {% set end_date = convert_datetime(end_date_str, in_fmt) %}\n\n {% set day_count = (end_date - start_date).days %}\n {% if day_count < 0 %}\n {% set msg -%}\n Partition start date is after the end date ({{ start_date }}, {{ end_date }})\n {%- endset %}\n\n {{ exceptions.raise_compiler_error(msg, model) }}\n {% endif %}\n\n {% set date_list = [] %}\n {% for i in range(0, day_count + 1) %}\n {% set the_date = (modules.datetime.timedelta(days=i) + start_date) %}\n {% if not out_fmt %}\n {% set _ = date_list.append(the_date) %}\n {% else %}\n {% set _ = date_list.append(the_date.strftime(out_fmt)) %}\n {% endif %}\n {% endfor %}\n\n {{ return(date_list) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.convert_datetime"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "start_date_str", "type": null, "description": ""}, {"name": "end_date_str", "type": null, "description": ""}, {"name": "in_fmt", "type": null, "description": ""}, {"name": "out_fmt", "type": null, "description": ""}], "created_at": 1789419970.017063, "supported_languages": null}, "macro.dbt.partition_range": {"name": "partition_range", "resource_type": "macro", "package_name": "dbt", "path": "macros/etc/datetime.sql", "original_file_path": "macros/etc/datetime.sql", "unique_id": "macro.dbt.partition_range", "macro_sql": "{% macro partition_range(raw_partition_date, date_fmt='%Y%m%d') %}\n {% set partition_range = (raw_partition_date | string).split(\",\") %}\n\n {% if (partition_range | length) == 1 %}\n {% set start_date = partition_range[0] %}\n {% set end_date = none %}\n {% elif (partition_range | length) == 2 %}\n {% set start_date = partition_range[0] %}\n {% set end_date = partition_range[1] %}\n {% else %}\n {{ exceptions.raise_compiler_error(\"Invalid partition time. Expected format: {Start Date}[,{End Date}]. Got: \" ~ raw_partition_date) }}\n {% endif %}\n\n {{ return(dates_in_range(start_date, end_date, in_fmt=date_fmt)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.dates_in_range"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "raw_partition_date", "type": null, "description": ""}, {"name": "date_fmt", "type": null, "description": ""}], "created_at": 1789419970.018334, "supported_languages": null}, "macro.dbt.py_current_timestring": {"name": "py_current_timestring", "resource_type": "macro", "package_name": "dbt", "path": "macros/etc/datetime.sql", "original_file_path": "macros/etc/datetime.sql", "unique_id": "macro.dbt.py_current_timestring", "macro_sql": "{% macro py_current_timestring() %}\n {% set dt = modules.datetime.datetime.now() %}\n {% do return(dt.strftime(\"%Y%m%d%H%M%S%f\")) %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789419970.0187304, "supported_languages": null}, "macro.dbt.resolve_model_name": {"name": "resolve_model_name", "resource_type": "macro", "package_name": "dbt", "path": "macros/python_model/python.sql", "original_file_path": "macros/python_model/python.sql", "unique_id": "macro.dbt.resolve_model_name", "macro_sql": "{% macro resolve_model_name(input_model_name) %}\n {{ return(adapter.dispatch('resolve_model_name', 'dbt')(input_model_name)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__resolve_model_name"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "input_model_name", "type": null, "description": ""}], "created_at": 1789419970.020206, "supported_languages": null}, "macro.dbt.default__resolve_model_name": {"name": "default__resolve_model_name", "resource_type": "macro", "package_name": "dbt", "path": "macros/python_model/python.sql", "original_file_path": "macros/python_model/python.sql", "unique_id": "macro.dbt.default__resolve_model_name", "macro_sql": "\n\n{%- macro default__resolve_model_name(input_model_name) -%}\n {{ input_model_name | string | replace('\"', '\\\"') }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "input_model_name", "type": null, "description": ""}], "created_at": 1789419970.020481, "supported_languages": null}, "macro.dbt.build_ref_function": {"name": "build_ref_function", "resource_type": "macro", "package_name": "dbt", "path": "macros/python_model/python.sql", "original_file_path": "macros/python_model/python.sql", "unique_id": "macro.dbt.build_ref_function", "macro_sql": "{% macro build_ref_function(model) %}\n\n {%- set ref_dict = {} -%}\n {%- for _ref in model.refs -%}\n {% set _ref_args = [_ref.get('package'), _ref['name']] if _ref.get('package') else [_ref['name'],] %}\n {%- set resolved = ref(*_ref_args, v=_ref.get('version')) -%}\n\n {#\n We want to get the string of the returned relation by calling .render() in order to skip sample/empty\n mode rendering logic. However, people override the default ref macro, and often return a string instead\n of a relation (like the ref macro does by default). Thus, to make sure we dont blow things up, we have\n to ensure the resolved relation has a .render() method.\n #}\n {%- if resolved.render is defined and resolved.render is callable -%}\n {%- set resolved = resolved.render() -%}\n {%- endif -%}\n\n {%- if _ref.get('version') -%}\n {% do _ref_args.extend([\"v\" ~ _ref['version']]) %}\n {%- endif -%}\n {%- do ref_dict.update({_ref_args | join('.'): resolve_model_name(resolved)}) -%}\n {%- endfor -%}\n\ndef ref(*args, **kwargs):\n refs = {{ ref_dict | tojson }}\n key = '.'.join(args)\n version = kwargs.get(\"v\") or kwargs.get(\"version\")\n if version:\n key += f\".v{version}\"\n dbt_load_df_function = kwargs.get(\"dbt_load_df_function\")\n return dbt_load_df_function(refs[key])\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.resolve_model_name"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}], "created_at": 1789419970.022125, "supported_languages": null}, "macro.dbt.build_source_function": {"name": "build_source_function", "resource_type": "macro", "package_name": "dbt", "path": "macros/python_model/python.sql", "original_file_path": "macros/python_model/python.sql", "unique_id": "macro.dbt.build_source_function", "macro_sql": "{% macro build_source_function(model) %}\n\n {%- set source_dict = {} -%}\n {%- for _source in model.sources -%}\n {%- set resolved = source(*_source) -%}\n {%- do source_dict.update({_source | join('.'): resolve_model_name(resolved)}) -%}\n {%- endfor -%}\n\ndef source(*args, dbt_load_df_function):\n sources = {{ source_dict | tojson }}\n key = '.'.join(args)\n return dbt_load_df_function(sources[key])\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.resolve_model_name"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}], "created_at": 1789419970.0228443, "supported_languages": null}, "macro.dbt.build_config_dict": {"name": "build_config_dict", "resource_type": "macro", "package_name": "dbt", "path": "macros/python_model/python.sql", "original_file_path": "macros/python_model/python.sql", "unique_id": "macro.dbt.build_config_dict", "macro_sql": "{% macro build_config_dict(model) %}\n {%- set config_dict = {} -%}\n {% set config_dbt_used = zip(model.config.config_keys_used, model.config.config_keys_defaults) | list %}\n {%- for key, default in config_dbt_used -%}\n {# weird type testing with enum, would be much easier to write this logic in Python! #}\n {%- if key == \"language\" -%}\n {%- set value = \"python\" -%}\n {%- endif -%}\n {%- set value = model.config.get(key, default) -%}\n {%- do config_dict.update({key: value}) -%}\n {%- endfor -%}\n {# Handle dbt.config.meta_get() calls - use separate dict to avoid overwriting native configs #}\n {%- set meta_dict = {} -%}\n {%- if model.config.meta_keys_used -%}\n {% set meta_dbt_used = zip(model.config.meta_keys_used, model.config.meta_keys_defaults) | list %}\n {%- for key, default in meta_dbt_used -%}\n {%- if model.config.meta and key in model.config.meta -%}\n {%- set value = model.config.meta[key] -%}\n {%- else -%}\n {%- set value = default -%}\n {%- endif -%}\n {%- do meta_dict.update({key: value}) -%}\n {%- endfor -%}\n {%- endif -%}\nconfig_dict = {{ config_dict }}\nmeta_dict = {{ meta_dict }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}], "created_at": 1789419970.0248766, "supported_languages": null}, "macro.dbt.py_script_postfix": {"name": "py_script_postfix", "resource_type": "macro", "package_name": "dbt", "path": "macros/python_model/python.sql", "original_file_path": "macros/python_model/python.sql", "unique_id": "macro.dbt.py_script_postfix", "macro_sql": "{% macro py_script_postfix(model) %}\n# This part is user provided model code\n# you will need to copy the next section to run the code\n# COMMAND ----------\n# this part is dbt logic for get ref work, do not modify\n\n{{ build_ref_function(model ) }}\n{{ build_source_function(model ) }}\n{{ build_config_dict(model) }}\n\nclass config:\n def __init__(self, *args, **kwargs):\n pass\n\n @staticmethod\n def get(key, default=None):\n return config_dict.get(key, default)\n\n @staticmethod\n def meta_get(key, default=None):\n return meta_dict.get(key, default)\n\nclass this:\n \"\"\"dbt.this() or dbt.this.identifier\"\"\"\n database = \"{{ this.database }}\"\n schema = \"{{ this.schema }}\"\n identifier = \"{{ this.identifier }}\"\n {% set this_relation_name = resolve_model_name(this) %}\n def __repr__(self):\n return '{{ this_relation_name }}'\n\n\nclass dbtObj:\n def __init__(self, load_df_function) -> None:\n self.source = lambda *args: source(*args, dbt_load_df_function=load_df_function)\n self.ref = lambda *args, **kwargs: ref(*args, **kwargs, dbt_load_df_function=load_df_function)\n self.config = config\n self.this = this()\n self.is_incremental = {{ is_incremental() }}\n\n# COMMAND ----------\n{{py_script_comment()}}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.build_ref_function", "macro.dbt.build_source_function", "macro.dbt.build_config_dict", "macro.dbt.resolve_model_name", "macro.dbt.is_incremental", "macro.dbt.py_script_comment"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}], "created_at": 1789419970.0264177, "supported_languages": null}, "macro.dbt.py_script_comment": {"name": "py_script_comment", "resource_type": "macro", "package_name": "dbt", "path": "macros/python_model/python.sql", "original_file_path": "macros/python_model/python.sql", "unique_id": "macro.dbt.py_script_comment", "macro_sql": "{%macro py_script_comment()%}\n{%endmacro%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789419970.0265741, "supported_languages": null}, "macro.dbt.generate_schema_name": {"name": "generate_schema_name", "resource_type": "macro", "package_name": "dbt", "path": "macros/get_custom_name/get_custom_schema.sql", "original_file_path": "macros/get_custom_name/get_custom_schema.sql", "unique_id": "macro.dbt.generate_schema_name", "macro_sql": "{% macro generate_schema_name(custom_schema_name=none, node=none) -%}\n {{ return(adapter.dispatch('generate_schema_name', 'dbt')(custom_schema_name, node)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__generate_schema_name"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "custom_schema_name", "type": null, "description": ""}, {"name": "node", "type": null, "description": ""}], "created_at": 1789419970.0273879, "supported_languages": null}, "macro.dbt.default__generate_schema_name": {"name": "default__generate_schema_name", "resource_type": "macro", "package_name": "dbt", "path": "macros/get_custom_name/get_custom_schema.sql", "original_file_path": "macros/get_custom_name/get_custom_schema.sql", "unique_id": "macro.dbt.default__generate_schema_name", "macro_sql": "{% macro default__generate_schema_name(custom_schema_name, node) -%}\n\n {%- set default_schema = target.schema -%}\n {%- if custom_schema_name is none -%}\n\n {{ default_schema }}\n\n {%- else -%}\n\n {{ default_schema }}_{{ custom_schema_name | trim }}\n\n {%- endif -%}\n\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "custom_schema_name", "type": null, "description": ""}, {"name": "node", "type": null, "description": ""}], "created_at": 1789419970.027869, "supported_languages": null}, "macro.dbt.generate_schema_name_for_env": {"name": "generate_schema_name_for_env", "resource_type": "macro", "package_name": "dbt", "path": "macros/get_custom_name/get_custom_schema.sql", "original_file_path": "macros/get_custom_name/get_custom_schema.sql", "unique_id": "macro.dbt.generate_schema_name_for_env", "macro_sql": "{% macro generate_schema_name_for_env(custom_schema_name, node) -%}\n\n {%- set default_schema = target.schema -%}\n {%- if target.name == 'prod' and custom_schema_name is not none -%}\n\n {{ custom_schema_name | trim }}\n\n {%- else -%}\n\n {{ default_schema }}\n\n {%- endif -%}\n\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "custom_schema_name", "type": null, "description": ""}, {"name": "node", "type": null, "description": ""}], "created_at": 1789419970.0283597, "supported_languages": null}, "macro.dbt.generate_latest_version_pointer_alias": {"name": "generate_latest_version_pointer_alias", "resource_type": "macro", "package_name": "dbt", "path": "macros/get_custom_name/get_latest_version_pointer_alias.sql", "original_file_path": "macros/get_custom_name/get_latest_version_pointer_alias.sql", "unique_id": "macro.dbt.generate_latest_version_pointer_alias", "macro_sql": "{% macro generate_latest_version_pointer_alias(custom_alias_name=none, node=none) -%}\n {% do return(adapter.dispatch('generate_latest_version_pointer_alias', 'dbt')(custom_alias_name, node)) %}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__generate_latest_version_pointer_alias"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "custom_alias_name", "type": null, "description": ""}, {"name": "node", "type": null, "description": ""}], "created_at": 1789419970.0290043, "supported_languages": null}, "macro.dbt.default__generate_latest_version_pointer_alias": {"name": "default__generate_latest_version_pointer_alias", "resource_type": "macro", "package_name": "dbt", "path": "macros/get_custom_name/get_latest_version_pointer_alias.sql", "original_file_path": "macros/get_custom_name/get_latest_version_pointer_alias.sql", "unique_id": "macro.dbt.default__generate_latest_version_pointer_alias", "macro_sql": "{% macro default__generate_latest_version_pointer_alias(custom_alias_name=none, node=none) -%}\n {%- if custom_alias_name -%}\n {{ custom_alias_name | trim }}\n {%- else -%}\n {{ node.name }}\n {%- endif -%}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "custom_alias_name", "type": null, "description": ""}, {"name": "node", "type": null, "description": ""}], "created_at": 1789419970.0293775, "supported_languages": null}, "macro.dbt.generate_database_name": {"name": "generate_database_name", "resource_type": "macro", "package_name": "dbt", "path": "macros/get_custom_name/get_custom_database.sql", "original_file_path": "macros/get_custom_name/get_custom_database.sql", "unique_id": "macro.dbt.generate_database_name", "macro_sql": "{% macro generate_database_name(custom_database_name=none, node=none) -%}\n {% do return(adapter.dispatch('generate_database_name', 'dbt')(custom_database_name, node)) %}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__generate_database_name"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "custom_database_name", "type": null, "description": ""}, {"name": "node", "type": null, "description": ""}], "created_at": 1789419970.030082, "supported_languages": null}, "macro.dbt.default__generate_database_name": {"name": "default__generate_database_name", "resource_type": "macro", "package_name": "dbt", "path": "macros/get_custom_name/get_custom_database.sql", "original_file_path": "macros/get_custom_name/get_custom_database.sql", "unique_id": "macro.dbt.default__generate_database_name", "macro_sql": "{% macro default__generate_database_name(custom_database_name=none, node=none) -%}\n {%- set default_database = target.database -%}\n {%- if node is not none and node|attr('database') -%}\n {%- set catalog_relation = adapter.build_catalog_relation(node) -%}\n {%- if catalog_relation and catalog_relation|attr('catalog_database') -%}\n {{ return(catalog_relation.catalog_database) }}\n {%- endif -%}\n {%- endif -%}\n {%- if custom_database_name is none -%}\n\n {{ default_database }}\n\n {%- else -%}\n\n {{ custom_database_name }}\n\n {%- endif -%}\n\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "custom_database_name", "type": null, "description": ""}, {"name": "node", "type": null, "description": ""}], "created_at": 1789419970.0309992, "supported_languages": null}, "macro.dbt.generate_alias_name": {"name": "generate_alias_name", "resource_type": "macro", "package_name": "dbt", "path": "macros/get_custom_name/get_custom_alias.sql", "original_file_path": "macros/get_custom_name/get_custom_alias.sql", "unique_id": "macro.dbt.generate_alias_name", "macro_sql": "{% macro generate_alias_name(custom_alias_name=none, node=none) -%}\n {% do return(adapter.dispatch('generate_alias_name', 'dbt')(custom_alias_name, node)) %}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__generate_alias_name"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "custom_alias_name", "type": null, "description": ""}, {"name": "node", "type": null, "description": ""}], "created_at": 1789419970.0316403, "supported_languages": null}, "macro.dbt.default__generate_alias_name": {"name": "default__generate_alias_name", "resource_type": "macro", "package_name": "dbt", "path": "macros/get_custom_name/get_custom_alias.sql", "original_file_path": "macros/get_custom_name/get_custom_alias.sql", "unique_id": "macro.dbt.default__generate_alias_name", "macro_sql": "{% macro default__generate_alias_name(custom_alias_name=none, node=none) -%}\n\n {%- if custom_alias_name -%}\n\n {{ custom_alias_name | trim }}\n\n {%- elif node.version -%}\n\n {{ return(node.name ~ \"_v\" ~ (node.version | replace(\".\", \"_\"))) }}\n\n {%- else -%}\n\n {{ node.name }}\n\n {%- endif -%}\n\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "custom_alias_name", "type": null, "description": ""}, {"name": "node", "type": null, "description": ""}], "created_at": 1789419970.0322967, "supported_languages": null}, "macro.dbt.get_show_sql": {"name": "get_show_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/show.sql", "original_file_path": "macros/adapters/show.sql", "unique_id": "macro.dbt.get_show_sql", "macro_sql": "{% macro get_show_sql(compiled_code, sql_header, limit) -%}\n {%- if sql_header is not none -%}\n {{ sql_header }}\n {%- endif %}\n {{ get_limit_subquery_sql(compiled_code, limit) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_limit_subquery_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "compiled_code", "type": null, "description": ""}, {"name": "sql_header", "type": null, "description": ""}, {"name": "limit", "type": null, "description": ""}], "created_at": 1789419970.0329645, "supported_languages": null}, "macro.dbt.get_limit_subquery_sql": {"name": "get_limit_subquery_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/show.sql", "original_file_path": "macros/adapters/show.sql", "unique_id": "macro.dbt.get_limit_subquery_sql", "macro_sql": "\n{%- macro get_limit_subquery_sql(sql, limit) -%}\n {{ adapter.dispatch('get_limit_sql', 'dbt')(sql, limit) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt.default__get_limit_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "sql", "type": null, "description": ""}, {"name": "limit", "type": null, "description": ""}], "created_at": 1789419970.0332882, "supported_languages": null}, "macro.dbt.default__get_limit_sql": {"name": "default__get_limit_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/show.sql", "original_file_path": "macros/adapters/show.sql", "unique_id": "macro.dbt.default__get_limit_sql", "macro_sql": "{% macro default__get_limit_sql(sql, limit) %}\n {{ sql }}\n {% if limit is not none %}\n limit {{ limit }}\n {%- endif -%}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "sql", "type": null, "description": ""}, {"name": "limit", "type": null, "description": ""}], "created_at": 1789419970.0336146, "supported_languages": null}, "macro.dbt.current_timestamp": {"name": "current_timestamp", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/timestamps.sql", "original_file_path": "macros/adapters/timestamps.sql", "unique_id": "macro.dbt.current_timestamp", "macro_sql": "{%- macro current_timestamp() -%}\n {{ adapter.dispatch('current_timestamp', 'dbt')() }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt_postgres.postgres__current_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789419970.0344322, "supported_languages": null}, "macro.dbt.default__current_timestamp": {"name": "default__current_timestamp", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/timestamps.sql", "original_file_path": "macros/adapters/timestamps.sql", "unique_id": "macro.dbt.default__current_timestamp", "macro_sql": "{% macro default__current_timestamp() -%}\n {{ exceptions.raise_not_implemented(\n 'current_timestamp macro not implemented for adapter ' + adapter.type()) }}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789419970.034704, "supported_languages": null}, "macro.dbt.snapshot_get_time": {"name": "snapshot_get_time", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/timestamps.sql", "original_file_path": "macros/adapters/timestamps.sql", "unique_id": "macro.dbt.snapshot_get_time", "macro_sql": "\n\n{%- macro snapshot_get_time() -%}\n {{ adapter.dispatch('snapshot_get_time', 'dbt')() }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt_postgres.postgres__snapshot_get_time"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789419970.0351, "supported_languages": null}, "macro.dbt.default__snapshot_get_time": {"name": "default__snapshot_get_time", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/timestamps.sql", "original_file_path": "macros/adapters/timestamps.sql", "unique_id": "macro.dbt.default__snapshot_get_time", "macro_sql": "{% macro default__snapshot_get_time() %}\n {{ current_timestamp() }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.current_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789419970.0352936, "supported_languages": null}, "macro.dbt.get_snapshot_get_time_data_type": {"name": "get_snapshot_get_time_data_type", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/timestamps.sql", "original_file_path": "macros/adapters/timestamps.sql", "unique_id": "macro.dbt.get_snapshot_get_time_data_type", "macro_sql": "{% macro get_snapshot_get_time_data_type() %}\n {% set snapshot_time = adapter.dispatch('snapshot_get_time', 'dbt')() %}\n {% set time_data_type_sql = 'select ' ~ snapshot_time ~ ' as dbt_snapshot_time' %}\n {% set snapshot_time_column_schema = get_column_schema_from_query(time_data_type_sql) %}\n {% set time_data_type = snapshot_time_column_schema[0].dtype %}\n {{ return(time_data_type or none) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.snapshot_get_time", "macro.dbt_postgres.postgres__snapshot_get_time", "macro.dbt.get_column_schema_from_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789419970.0360167, "supported_languages": null}, "macro.dbt.current_timestamp_backcompat": {"name": "current_timestamp_backcompat", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/timestamps.sql", "original_file_path": "macros/adapters/timestamps.sql", "unique_id": "macro.dbt.current_timestamp_backcompat", "macro_sql": "{% macro current_timestamp_backcompat() %}\n {{ return(adapter.dispatch('current_timestamp_backcompat', 'dbt')()) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__current_timestamp_backcompat"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789419970.0363114, "supported_languages": null}, "macro.dbt.default__current_timestamp_backcompat": {"name": "default__current_timestamp_backcompat", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/timestamps.sql", "original_file_path": "macros/adapters/timestamps.sql", "unique_id": "macro.dbt.default__current_timestamp_backcompat", "macro_sql": "{% macro default__current_timestamp_backcompat() %}\n current_timestamp::timestamp\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789419970.0364454, "supported_languages": null}, "macro.dbt.current_timestamp_in_utc_backcompat": {"name": "current_timestamp_in_utc_backcompat", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/timestamps.sql", "original_file_path": "macros/adapters/timestamps.sql", "unique_id": "macro.dbt.current_timestamp_in_utc_backcompat", "macro_sql": "{% macro current_timestamp_in_utc_backcompat() %}\n {{ return(adapter.dispatch('current_timestamp_in_utc_backcompat', 'dbt')()) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__current_timestamp_in_utc_backcompat"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789419970.0367174, "supported_languages": null}, "macro.dbt.default__current_timestamp_in_utc_backcompat": {"name": "default__current_timestamp_in_utc_backcompat", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/timestamps.sql", "original_file_path": "macros/adapters/timestamps.sql", "unique_id": "macro.dbt.default__current_timestamp_in_utc_backcompat", "macro_sql": "{% macro default__current_timestamp_in_utc_backcompat() %}\n {{ return(adapter.dispatch('current_timestamp_backcompat', 'dbt')()) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.current_timestamp_backcompat", "macro.dbt_postgres.postgres__current_timestamp_backcompat"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789419970.037009, "supported_languages": null}, "macro.dbt.create_schema": {"name": "create_schema", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/schema.sql", "original_file_path": "macros/adapters/schema.sql", "unique_id": "macro.dbt.create_schema", "macro_sql": "{% macro create_schema(relation) -%}\n {{ adapter.dispatch('create_schema', 'dbt')(relation) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__create_schema"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789419970.0375476, "supported_languages": null}, "macro.dbt.default__create_schema": {"name": "default__create_schema", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/schema.sql", "original_file_path": "macros/adapters/schema.sql", "unique_id": "macro.dbt.default__create_schema", "macro_sql": "{% macro default__create_schema(relation) -%}\n {%- call statement('create_schema') -%}\n create schema if not exists {{ relation.without_identifier() }}\n {% endcall %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789419970.0378861, "supported_languages": null}, "macro.dbt.drop_schema": {"name": "drop_schema", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/schema.sql", "original_file_path": "macros/adapters/schema.sql", "unique_id": "macro.dbt.drop_schema", "macro_sql": "{% macro drop_schema(relation) -%}\n {{ adapter.dispatch('drop_schema', 'dbt')(relation) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__drop_schema"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789419970.0381587, "supported_languages": null}, "macro.dbt.default__drop_schema": {"name": "default__drop_schema", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/schema.sql", "original_file_path": "macros/adapters/schema.sql", "unique_id": "macro.dbt.default__drop_schema", "macro_sql": "{% macro default__drop_schema(relation) -%}\n {%- call statement('drop_schema') -%}\n drop schema if exists {{ relation.without_identifier() }} cascade\n {% endcall %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789419970.0384579, "supported_languages": null}, "macro.dbt.copy_grants": {"name": "copy_grants", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "unique_id": "macro.dbt.copy_grants", "macro_sql": "{% macro copy_grants() %}\n {{ return(adapter.dispatch('copy_grants', 'dbt')()) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__copy_grants"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789419970.040408, "supported_languages": null}, "macro.dbt.default__copy_grants": {"name": "default__copy_grants", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "unique_id": "macro.dbt.default__copy_grants", "macro_sql": "{% macro default__copy_grants() %}\n {{ return(True) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789419970.0406137, "supported_languages": null}, "macro.dbt.support_multiple_grantees_per_dcl_statement": {"name": "support_multiple_grantees_per_dcl_statement", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "unique_id": "macro.dbt.support_multiple_grantees_per_dcl_statement", "macro_sql": "{% macro support_multiple_grantees_per_dcl_statement() %}\n {{ return(adapter.dispatch('support_multiple_grantees_per_dcl_statement', 'dbt')()) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__support_multiple_grantees_per_dcl_statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789419970.0409005, "supported_languages": null}, "macro.dbt.default__support_multiple_grantees_per_dcl_statement": {"name": "default__support_multiple_grantees_per_dcl_statement", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "unique_id": "macro.dbt.default__support_multiple_grantees_per_dcl_statement", "macro_sql": "\n\n{%- macro default__support_multiple_grantees_per_dcl_statement() -%}\n {{ return(True) }}\n{%- endmacro -%}\n\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789419970.0410933, "supported_languages": null}, "macro.dbt.should_revoke": {"name": "should_revoke", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "unique_id": "macro.dbt.should_revoke", "macro_sql": "{% macro should_revoke(existing_relation, full_refresh_mode=True) %}\n\n {% if not existing_relation %}\n {#-- The table doesn't already exist, so no grants to copy over --#}\n {{ return(False) }}\n {% elif full_refresh_mode %}\n {#-- The object is being REPLACED -- whether grants are copied over depends on the value of user config --#}\n {{ return(copy_grants()) }}\n {% else %}\n {#-- The table is being merged/upserted/inserted -- grants will be carried over --#}\n {{ return(True) }}\n {% endif %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.copy_grants"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "existing_relation", "type": null, "description": ""}, {"name": "full_refresh_mode", "type": null, "description": ""}], "created_at": 1789419970.0418012, "supported_languages": null}, "macro.dbt.get_show_grant_sql": {"name": "get_show_grant_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "unique_id": "macro.dbt.get_show_grant_sql", "macro_sql": "{% macro get_show_grant_sql(relation) %}\n {{ return(adapter.dispatch(\"get_show_grant_sql\", \"dbt\")(relation)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__get_show_grant_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789419970.0421302, "supported_languages": null}, "macro.dbt.default__get_show_grant_sql": {"name": "default__get_show_grant_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "unique_id": "macro.dbt.default__get_show_grant_sql", "macro_sql": "{% macro default__get_show_grant_sql(relation) %}\n show grants on {{ relation.render() }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789419970.0423384, "supported_languages": null}, "macro.dbt.get_grant_sql": {"name": "get_grant_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "unique_id": "macro.dbt.get_grant_sql", "macro_sql": "{% macro get_grant_sql(relation, privilege, grantees) %}\n {{ return(adapter.dispatch('get_grant_sql', 'dbt')(relation, privilege, grantees)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_grant_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "privilege", "type": null, "description": ""}, {"name": "grantees", "type": null, "description": ""}], "created_at": 1789419970.0427134, "supported_languages": null}, "macro.dbt.default__get_grant_sql": {"name": "default__get_grant_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "unique_id": "macro.dbt.default__get_grant_sql", "macro_sql": "\n\n{%- macro default__get_grant_sql(relation, privilege, grantees) -%}\n grant {{ privilege }} on {{ relation.render() }} to {{ grantees | join(', ') }}\n{%- endmacro -%}\n\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "privilege", "type": null, "description": ""}, {"name": "grantees", "type": null, "description": ""}], "created_at": 1789419970.0430818, "supported_languages": null}, "macro.dbt.get_revoke_sql": {"name": "get_revoke_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "unique_id": "macro.dbt.get_revoke_sql", "macro_sql": "{% macro get_revoke_sql(relation, privilege, grantees) %}\n {{ return(adapter.dispatch('get_revoke_sql', 'dbt')(relation, privilege, grantees)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_revoke_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "privilege", "type": null, "description": ""}, {"name": "grantees", "type": null, "description": ""}], "created_at": 1789419970.043477, "supported_languages": null}, "macro.dbt.default__get_revoke_sql": {"name": "default__get_revoke_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "unique_id": "macro.dbt.default__get_revoke_sql", "macro_sql": "\n\n{%- macro default__get_revoke_sql(relation, privilege, grantees) -%}\n {%- set quoted_grantees = [] -%}\n {%- for grantee in grantees -%}\n {%- do quoted_grantees.append(adapter.quote(grantee)) -%}\n {%- endfor -%}\n revoke {{ privilege }} on {{ relation.render() }} from {{ quoted_grantees | join(', ') }}\n{%- endmacro -%}\n\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "privilege", "type": null, "description": ""}, {"name": "grantees", "type": null, "description": ""}], "created_at": 1789419970.0441334, "supported_languages": null}, "macro.dbt.get_dcl_statement_list": {"name": "get_dcl_statement_list", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "unique_id": "macro.dbt.get_dcl_statement_list", "macro_sql": "{% macro get_dcl_statement_list(relation, grant_config, get_dcl_macro) %}\n {{ return(adapter.dispatch('get_dcl_statement_list', 'dbt')(relation, grant_config, get_dcl_macro)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_dcl_statement_list"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "grant_config", "type": null, "description": ""}, {"name": "get_dcl_macro", "type": null, "description": ""}], "created_at": 1789419970.0445328, "supported_languages": null}, "macro.dbt.default__get_dcl_statement_list": {"name": "default__get_dcl_statement_list", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "unique_id": "macro.dbt.default__get_dcl_statement_list", "macro_sql": "\n\n{%- macro default__get_dcl_statement_list(relation, grant_config, get_dcl_macro) -%}\n {#\n -- Unpack grant_config into specific privileges and the set of users who need them granted/revoked.\n -- Depending on whether this database supports multiple grantees per statement, pass in the list of\n -- all grantees per privilege, or (if not) template one statement per privilege-grantee pair.\n -- `get_dcl_macro` will be either `get_grant_sql` or `get_revoke_sql`\n #}\n {%- set dcl_statements = [] -%}\n {%- for privilege, grantees in grant_config.items() %}\n {%- if support_multiple_grantees_per_dcl_statement() and grantees -%}\n {%- set dcl = get_dcl_macro(relation, privilege, grantees) -%}\n {%- do dcl_statements.append(dcl) -%}\n {%- else -%}\n {%- for grantee in grantees -%}\n {% set dcl = get_dcl_macro(relation, privilege, [grantee]) %}\n {%- do dcl_statements.append(dcl) -%}\n {% endfor -%}\n {%- endif -%}\n {%- endfor -%}\n {{ return(dcl_statements) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.support_multiple_grantees_per_dcl_statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "grant_config", "type": null, "description": ""}, {"name": "get_dcl_macro", "type": null, "description": ""}], "created_at": 1789419970.0456746, "supported_languages": null}, "macro.dbt.call_dcl_statements": {"name": "call_dcl_statements", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "unique_id": "macro.dbt.call_dcl_statements", "macro_sql": "{% macro call_dcl_statements(dcl_statement_list) %}\n {{ return(adapter.dispatch(\"call_dcl_statements\", \"dbt\")(dcl_statement_list)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__call_dcl_statements"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "dcl_statement_list", "type": null, "description": ""}], "created_at": 1789419970.0460289, "supported_languages": null}, "macro.dbt.default__call_dcl_statements": {"name": "default__call_dcl_statements", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "unique_id": "macro.dbt.default__call_dcl_statements", "macro_sql": "{% macro default__call_dcl_statements(dcl_statement_list) %}\n {#\n -- By default, supply all grant + revoke statements in a single semicolon-separated block,\n -- so that they're all processed together.\n\n -- Some databases do not support this. Those adapters will need to override this macro\n -- to run each statement individually.\n #}\n {% call statement('grants') %}\n {% for dcl_statement in dcl_statement_list %}\n {{ dcl_statement }};\n {% endfor %}\n {% endcall %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "dcl_statement_list", "type": null, "description": ""}], "created_at": 1789419970.0464423, "supported_languages": null}, "macro.dbt.apply_grants": {"name": "apply_grants", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "unique_id": "macro.dbt.apply_grants", "macro_sql": "{% macro apply_grants(relation, grant_config, should_revoke) %}\n {{ return(adapter.dispatch(\"apply_grants\", \"dbt\")(relation, grant_config, should_revoke)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__apply_grants"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "grant_config", "type": null, "description": ""}, {"name": "should_revoke", "type": null, "description": ""}], "created_at": 1789419970.046846, "supported_languages": null}, "macro.dbt.default__apply_grants": {"name": "default__apply_grants", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "unique_id": "macro.dbt.default__apply_grants", "macro_sql": "{% macro default__apply_grants(relation, grant_config, should_revoke=True) %}\n {#-- If grant_config is {} or None, this is a no-op --#}\n {% if grant_config %}\n {% if should_revoke %}\n {#-- We think previous grants may have carried over --#}\n {#-- Show current grants and calculate diffs --#}\n {% set current_grants_table = run_query(get_show_grant_sql(relation)) %}\n {% set current_grants_dict = adapter.standardize_grants_dict(current_grants_table) %}\n {% set needs_granting = diff_of_two_dicts(grant_config, current_grants_dict) %}\n {% set needs_revoking = diff_of_two_dicts(current_grants_dict, grant_config) %}\n {% if not (needs_granting or needs_revoking) %}\n {{ log('On ' ~ relation.render() ~': All grants are in place, no revocation or granting needed.')}}\n {% endif %}\n {% else %}\n {#-- We don't think there's any chance of previous grants having carried over. --#}\n {#-- Jump straight to granting what the user has configured. --#}\n {% set needs_revoking = {} %}\n {% set needs_granting = grant_config %}\n {% endif %}\n {% if needs_granting or needs_revoking %}\n {% set revoke_statement_list = get_dcl_statement_list(relation, needs_revoking, get_revoke_sql) %}\n {% set grant_statement_list = get_dcl_statement_list(relation, needs_granting, get_grant_sql) %}\n {% set dcl_statement_list = revoke_statement_list + grant_statement_list %}\n {% if dcl_statement_list %}\n {{ call_dcl_statements(dcl_statement_list) }}\n {% endif %}\n {% endif %}\n {% endif %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.run_query", "macro.dbt.get_show_grant_sql", "macro.dbt.get_dcl_statement_list", "macro.dbt.call_dcl_statements"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "grant_config", "type": null, "description": ""}, {"name": "should_revoke", "type": null, "description": ""}], "created_at": 1789419970.0488684, "supported_languages": null}, "macro.dbt.is_core_v2": {"name": "is_core_v2", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/runtime.sql", "original_file_path": "macros/adapters/runtime.sql", "unique_id": "macro.dbt.is_core_v2", "macro_sql": "{% macro is_core_v2() -%}\n {%- set major_version = (dbt_version.split('.') | first) | int -%}\n {{ return(major_version == 2) }}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789419970.0494182, "supported_languages": null}, "macro.dbt.alter_column_comment": {"name": "alter_column_comment", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/persist_docs.sql", "original_file_path": "macros/adapters/persist_docs.sql", "unique_id": "macro.dbt.alter_column_comment", "macro_sql": "{% macro alter_column_comment(relation, column_dict) -%}\n {{ return(adapter.dispatch('alter_column_comment', 'dbt')(relation, column_dict)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__alter_column_comment"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "column_dict", "type": null, "description": ""}], "created_at": 1789419970.0505648, "supported_languages": null}, "macro.dbt.default__alter_column_comment": {"name": "default__alter_column_comment", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/persist_docs.sql", "original_file_path": "macros/adapters/persist_docs.sql", "unique_id": "macro.dbt.default__alter_column_comment", "macro_sql": "{% macro default__alter_column_comment(relation, column_dict) -%}\n {{ exceptions.raise_not_implemented(\n 'alter_column_comment macro not implemented for adapter '+adapter.type()) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "column_dict", "type": null, "description": ""}], "created_at": 1789419970.0508785, "supported_languages": null}, "macro.dbt.alter_relation_comment": {"name": "alter_relation_comment", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/persist_docs.sql", "original_file_path": "macros/adapters/persist_docs.sql", "unique_id": "macro.dbt.alter_relation_comment", "macro_sql": "{% macro alter_relation_comment(relation, relation_comment) -%}\n {{ return(adapter.dispatch('alter_relation_comment', 'dbt')(relation, relation_comment)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__alter_relation_comment"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "relation_comment", "type": null, "description": ""}], "created_at": 1789419970.0512254, "supported_languages": null}, "macro.dbt.default__alter_relation_comment": {"name": "default__alter_relation_comment", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/persist_docs.sql", "original_file_path": "macros/adapters/persist_docs.sql", "unique_id": "macro.dbt.default__alter_relation_comment", "macro_sql": "{% macro default__alter_relation_comment(relation, relation_comment) -%}\n {{ exceptions.raise_not_implemented(\n 'alter_relation_comment macro not implemented for adapter '+adapter.type()) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "relation_comment", "type": null, "description": ""}], "created_at": 1789419970.0515165, "supported_languages": null}, "macro.dbt.persist_docs": {"name": "persist_docs", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/persist_docs.sql", "original_file_path": "macros/adapters/persist_docs.sql", "unique_id": "macro.dbt.persist_docs", "macro_sql": "{% macro persist_docs(relation, model, for_relation=true, for_columns=true) -%}\n {{ return(adapter.dispatch('persist_docs', 'dbt')(relation, model, for_relation, for_columns)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__persist_docs"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "model", "type": null, "description": ""}, {"name": "for_relation", "type": null, "description": ""}, {"name": "for_columns", "type": null, "description": ""}], "created_at": 1789419970.0519845, "supported_languages": null}, "macro.dbt.validate_doc_columns": {"name": "validate_doc_columns", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/persist_docs.sql", "original_file_path": "macros/adapters/persist_docs.sql", "unique_id": "macro.dbt.validate_doc_columns", "macro_sql": "{% macro validate_doc_columns(relation, column_dict, existing_column_names) %}\n {% set existing_lower = existing_column_names | map(\"lower\") | list %}\n {% set missing = [] %}\n {% set filtered = {} %}\n {% for col_name in column_dict %}\n {% set is_quoted = column_dict[col_name]['quote'] %}\n {% if is_quoted %}\n {% set present = col_name in existing_column_names %}\n {% else %}\n {% set present = col_name | lower in existing_lower %}\n {% endif %}\n {% if present %}\n {% do filtered.update({col_name: column_dict[col_name]}) %}\n {% else %}\n {% do missing.append(col_name) %}\n {% endif %}\n {% endfor %}\n {% if missing | length > 0 %}\n {{ exceptions.warn(\"In relation \" ~ relation.render() ~ \": The following columns are specified in the schema but are not present in the database: \" ~ missing | join(\", \")) }}\n {% endif %}\n {{ return(filtered) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "column_dict", "type": null, "description": ""}, {"name": "existing_column_names", "type": null, "description": ""}], "created_at": 1789419970.0537276, "supported_languages": null}, "macro.dbt.default__persist_docs": {"name": "default__persist_docs", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/persist_docs.sql", "original_file_path": "macros/adapters/persist_docs.sql", "unique_id": "macro.dbt.default__persist_docs", "macro_sql": "{% macro default__persist_docs(relation, model, for_relation, for_columns) -%}\n {% if for_relation and config.persist_relation_docs() and model.description %}\n {% do run_query(alter_relation_comment(relation, model.description)) %}\n {% endif %}\n\n {% if for_columns and config.persist_column_docs() and model.columns %}\n {% set existing_columns = adapter.get_columns_in_relation(relation) | map(attribute=\"name\") | list %}\n {% set filtered_columns = validate_doc_columns(relation, model.columns, existing_columns) %}\n {% set alter_comment_sql = alter_column_comment(relation, filtered_columns) %}\n {% if alter_comment_sql and alter_comment_sql | trim | length > 0 %}\n {% do run_query(alter_comment_sql) %}\n {% endif %}\n {% endif %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.run_query", "macro.dbt.alter_relation_comment", "macro.dbt.validate_doc_columns", "macro.dbt.alter_column_comment"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "model", "type": null, "description": ""}, {"name": "for_relation", "type": null, "description": ""}, {"name": "for_columns", "type": null, "description": ""}], "created_at": 1789419970.0552213, "supported_languages": null}, "macro.dbt.get_columns_in_relation": {"name": "get_columns_in_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "unique_id": "macro.dbt.get_columns_in_relation", "macro_sql": "{% macro get_columns_in_relation(relation) -%}\n {{ return(adapter.dispatch('get_columns_in_relation', 'dbt')(relation)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__get_columns_in_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789419970.0573475, "supported_languages": null}, "macro.dbt.default__get_columns_in_relation": {"name": "default__get_columns_in_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "unique_id": "macro.dbt.default__get_columns_in_relation", "macro_sql": "{% macro default__get_columns_in_relation(relation) -%}\n {{ exceptions.raise_not_implemented(\n 'get_columns_in_relation macro not implemented for adapter '+adapter.type()) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789419970.057635, "supported_languages": null}, "macro.dbt.sql_convert_columns_in_relation": {"name": "sql_convert_columns_in_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "unique_id": "macro.dbt.sql_convert_columns_in_relation", "macro_sql": "{% macro sql_convert_columns_in_relation(table) -%}\n {% set columns = [] %}\n {% for row in table %}\n {% do columns.append(api.Column(*row)) %}\n {% endfor %}\n {{ return(columns) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "table", "type": null, "description": ""}], "created_at": 1789419970.0581777, "supported_languages": null}, "macro.dbt.get_list_of_column_names": {"name": "get_list_of_column_names", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "unique_id": "macro.dbt.get_list_of_column_names", "macro_sql": "\n\n{%- macro get_list_of_column_names(columns) -%}\n {% set col_names = [] %}\n {% for col in columns %}\n {% do col_names.append(col.name) %}\n {% endfor %}\n {{ return(col_names) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "columns", "type": null, "description": ""}], "created_at": 1789419970.0586672, "supported_languages": null}, "macro.dbt.get_empty_subquery_sql": {"name": "get_empty_subquery_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "unique_id": "macro.dbt.get_empty_subquery_sql", "macro_sql": "{% macro get_empty_subquery_sql(select_sql, select_sql_header=none) -%}\n {{ return(adapter.dispatch('get_empty_subquery_sql', 'dbt')(select_sql, select_sql_header)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_empty_subquery_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "select_sql", "type": null, "description": ""}, {"name": "select_sql_header", "type": null, "description": ""}], "created_at": 1789419970.0590475, "supported_languages": null}, "macro.dbt.default__get_empty_subquery_sql": {"name": "default__get_empty_subquery_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "unique_id": "macro.dbt.default__get_empty_subquery_sql", "macro_sql": "{% macro default__get_empty_subquery_sql(select_sql, select_sql_header=none) %}\n {%- if select_sql_header is not none -%}\n {{ select_sql_header }}\n {%- endif -%}\n select * from (\n {{ select_sql }}\n ) as __dbt_sbq\n where false\n limit 0\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "select_sql", "type": null, "description": ""}, {"name": "select_sql_header", "type": null, "description": ""}], "created_at": 1789419970.059394, "supported_languages": null}, "macro.dbt.get_empty_schema_sql": {"name": "get_empty_schema_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "unique_id": "macro.dbt.get_empty_schema_sql", "macro_sql": "{% macro get_empty_schema_sql(columns) -%}\n {{ return(adapter.dispatch('get_empty_schema_sql', 'dbt')(columns)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_empty_schema_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "columns", "type": null, "description": ""}], "created_at": 1789419970.0596964, "supported_languages": null}, "macro.dbt.default__get_empty_schema_sql": {"name": "default__get_empty_schema_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "unique_id": "macro.dbt.default__get_empty_schema_sql", "macro_sql": "{% macro default__get_empty_schema_sql(columns) %}\n {%- set col_err = [] -%}\n {%- set col_naked_numeric = [] -%}\n select\n {% for i in columns %}\n {%- set col = columns[i] -%}\n {%- if col['data_type'] is not defined -%}\n {%- do col_err.append(col['name']) -%}\n {#-- If this column's type is just 'numeric' then it is missing precision/scale, raise a warning --#}\n {%- elif col['data_type'].strip().lower() in ('numeric', 'decimal', 'number') -%}\n {%- do col_naked_numeric.append(col['name']) -%}\n {%- endif -%}\n {% set col_name = adapter.quote(col['name']) if col.get('quote') else col['name'] %}\n {{ cast('null', col['data_type']) }} as {{ col_name }}{{ \", \" if not loop.last }}\n {%- endfor -%}\n {%- if (col_err | length) > 0 -%}\n {{ exceptions.column_type_missing(column_names=col_err) }}\n {%- elif (col_naked_numeric | length) > 0 -%}\n {{ exceptions.warn(\"Detected columns with numeric type and unspecified precision/scale, this can lead to unintended rounding: \" ~ col_naked_numeric ~ \"`\") }}\n {%- endif -%}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.cast"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "columns", "type": null, "description": ""}], "created_at": 1789419970.0616338, "supported_languages": null}, "macro.dbt.get_column_schema_from_query": {"name": "get_column_schema_from_query", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "unique_id": "macro.dbt.get_column_schema_from_query", "macro_sql": "{% macro get_column_schema_from_query(select_sql, select_sql_header=none) -%}\n {% set columns = [] %}\n {# -- Using an 'empty subquery' here to get the same schema as the given select_sql statement, without necessitating a data scan.#}\n {% set sql = get_empty_subquery_sql(select_sql, select_sql_header) %}\n {% set column_schema = adapter.get_column_schema_from_query(sql) %}\n {{ return(column_schema) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_empty_subquery_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "select_sql", "type": null, "description": ""}, {"name": "select_sql_header", "type": null, "description": ""}], "created_at": 1789419970.0622218, "supported_languages": null}, "macro.dbt.get_columns_in_query": {"name": "get_columns_in_query", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "unique_id": "macro.dbt.get_columns_in_query", "macro_sql": "{% macro get_columns_in_query(select_sql) -%}\n {{ return(adapter.dispatch('get_columns_in_query', 'dbt')(select_sql)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_columns_in_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "select_sql", "type": null, "description": ""}], "created_at": 1789419970.0625303, "supported_languages": null}, "macro.dbt.default__get_columns_in_query": {"name": "default__get_columns_in_query", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "unique_id": "macro.dbt.default__get_columns_in_query", "macro_sql": "{% macro default__get_columns_in_query(select_sql) %}\n {% call statement('get_columns_in_query', fetch_result=True, auto_begin=False) -%}\n {{ get_empty_subquery_sql(select_sql) }}\n {% endcall %}\n {{ return(load_result('get_columns_in_query').table.columns | map(attribute='name') | list) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement", "macro.dbt.get_empty_subquery_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "select_sql", "type": null, "description": ""}], "created_at": 1789419970.0631173, "supported_languages": null}, "macro.dbt.alter_column_type": {"name": "alter_column_type", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "unique_id": "macro.dbt.alter_column_type", "macro_sql": "{% macro alter_column_type(relation, column_name, new_column_type) -%}\n {{ return(adapter.dispatch('alter_column_type', 'dbt')(relation, column_name, new_column_type)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__alter_column_type"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "column_name", "type": null, "description": ""}, {"name": "new_column_type", "type": null, "description": ""}], "created_at": 1789419970.0635023, "supported_languages": null}, "macro.dbt.default__alter_column_type": {"name": "default__alter_column_type", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "unique_id": "macro.dbt.default__alter_column_type", "macro_sql": "{% macro default__alter_column_type(relation, column_name, new_column_type) -%}\n {#\n 1. Create a new column (w/ temp name and correct type)\n 2. Copy data over to it\n 3. Drop the existing column (cascade!)\n 4. Rename the new column to existing column\n #}\n {%- set tmp_column = column_name + \"__dbt_alter\" -%}\n\n {% call statement('alter_column_type') %}\n alter table {{ relation.render() }} add column {{ adapter.quote(tmp_column) }} {{ new_column_type }};\n update {{ relation.render() }} set {{ adapter.quote(tmp_column) }} = {{ adapter.quote(column_name) }};\n alter table {{ relation.render() }} drop column {{ adapter.quote(column_name) }} cascade;\n alter table {{ relation.render() }} rename column {{ adapter.quote(tmp_column) }} to {{ adapter.quote(column_name) }}\n {% endcall %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "column_name", "type": null, "description": ""}, {"name": "new_column_type", "type": null, "description": ""}], "created_at": 1789419970.06472, "supported_languages": null}, "macro.dbt.alter_relation_add_remove_columns": {"name": "alter_relation_add_remove_columns", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "unique_id": "macro.dbt.alter_relation_add_remove_columns", "macro_sql": "{% macro alter_relation_add_remove_columns(relation, add_columns = none, remove_columns = none) -%}\n {{ return(adapter.dispatch('alter_relation_add_remove_columns', 'dbt')(relation, add_columns, remove_columns)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__alter_relation_add_remove_columns"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "add_columns", "type": null, "description": ""}, {"name": "remove_columns", "type": null, "description": ""}], "created_at": 1789419970.0651748, "supported_languages": null}, "macro.dbt.default__alter_relation_add_remove_columns": {"name": "default__alter_relation_add_remove_columns", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "unique_id": "macro.dbt.default__alter_relation_add_remove_columns", "macro_sql": "{% macro default__alter_relation_add_remove_columns(relation, add_columns, remove_columns) %}\n\n {% if add_columns is none %}\n {% set add_columns = [] %}\n {% endif %}\n {% if remove_columns is none %}\n {% set remove_columns = [] %}\n {% endif %}\n\n {% set sql -%}\n\n alter {{ relation.type }} {{ relation.render() }}\n\n {% for column in add_columns %}\n add column {{ column.quoted }} {{ column.expanded_data_type }}{{ ',' if not loop.last }}\n {% endfor %}{{ ',' if add_columns and remove_columns }}\n\n {% for column in remove_columns %}\n drop column {{ column.quoted }}{{ ',' if not loop.last }}\n {% endfor %}\n\n {%- endset -%}\n\n {% do run_query(sql) %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "add_columns", "type": null, "description": ""}, {"name": "remove_columns", "type": null, "description": ""}], "created_at": 1789419970.0664952, "supported_languages": null}, "macro.dbt.get_create_index_sql": {"name": "get_create_index_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/indexes.sql", "original_file_path": "macros/adapters/indexes.sql", "unique_id": "macro.dbt.get_create_index_sql", "macro_sql": "{% macro get_create_index_sql(relation, index_dict) -%}\n {{ return(adapter.dispatch('get_create_index_sql', 'dbt')(relation, index_dict)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__get_create_index_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "index_dict", "type": null, "description": ""}], "created_at": 1789419970.0673947, "supported_languages": null}, "macro.dbt.default__get_create_index_sql": {"name": "default__get_create_index_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/indexes.sql", "original_file_path": "macros/adapters/indexes.sql", "unique_id": "macro.dbt.default__get_create_index_sql", "macro_sql": "{% macro default__get_create_index_sql(relation, index_dict) -%}\n {% do return(None) %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "index_dict", "type": null, "description": ""}], "created_at": 1789419970.0676408, "supported_languages": null}, "macro.dbt.create_indexes": {"name": "create_indexes", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/indexes.sql", "original_file_path": "macros/adapters/indexes.sql", "unique_id": "macro.dbt.create_indexes", "macro_sql": "{% macro create_indexes(relation) -%}\n {{ adapter.dispatch('create_indexes', 'dbt')(relation) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__create_indexes"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789419970.0679262, "supported_languages": null}, "macro.dbt.default__create_indexes": {"name": "default__create_indexes", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/indexes.sql", "original_file_path": "macros/adapters/indexes.sql", "unique_id": "macro.dbt.default__create_indexes", "macro_sql": "{% macro default__create_indexes(relation) -%}\n {%- set _indexes = config.get('indexes', default=[]) -%}\n\n {% for _index_dict in _indexes %}\n {% set create_index_sql = get_create_index_sql(relation, _index_dict) %}\n {% if create_index_sql %}\n {% do run_query(create_index_sql) %}\n {% endif %}\n {% endfor %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_create_index_sql", "macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789419970.0685906, "supported_languages": null}, "macro.dbt.get_drop_index_sql": {"name": "get_drop_index_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/indexes.sql", "original_file_path": "macros/adapters/indexes.sql", "unique_id": "macro.dbt.get_drop_index_sql", "macro_sql": "{% macro get_drop_index_sql(relation, index_name) -%}\n {{ adapter.dispatch('get_drop_index_sql', 'dbt')(relation, index_name) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__get_drop_index_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "index_name", "type": null, "description": ""}], "created_at": 1789419970.068955, "supported_languages": null}, "macro.dbt.default__get_drop_index_sql": {"name": "default__get_drop_index_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/indexes.sql", "original_file_path": "macros/adapters/indexes.sql", "unique_id": "macro.dbt.default__get_drop_index_sql", "macro_sql": "{% macro default__get_drop_index_sql(relation, index_name) -%}\n {{ exceptions.raise_compiler_error(\"`get_drop_index_sql has not been implemented for this adapter.\") }}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "index_name", "type": null, "description": ""}], "created_at": 1789419970.0691931, "supported_languages": null}, "macro.dbt.get_show_indexes_sql": {"name": "get_show_indexes_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/indexes.sql", "original_file_path": "macros/adapters/indexes.sql", "unique_id": "macro.dbt.get_show_indexes_sql", "macro_sql": "{% macro get_show_indexes_sql(relation) -%}\n {{ adapter.dispatch('get_show_indexes_sql', 'dbt')(relation) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__get_show_indexes_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789419970.0694559, "supported_languages": null}, "macro.dbt.default__get_show_indexes_sql": {"name": "default__get_show_indexes_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/indexes.sql", "original_file_path": "macros/adapters/indexes.sql", "unique_id": "macro.dbt.default__get_show_indexes_sql", "macro_sql": "{% macro default__get_show_indexes_sql(relation) -%}\n {{ exceptions.raise_compiler_error(\"`get_show_indexes_sql has not been implemented for this adapter.\") }}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789419970.0696683, "supported_languages": null}, "macro.dbt.get_catalog_relations": {"name": "get_catalog_relations", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "unique_id": "macro.dbt.get_catalog_relations", "macro_sql": "{% macro get_catalog_relations(information_schema, relations) -%}\n {{ return(adapter.dispatch('get_catalog_relations', 'dbt')(information_schema, relations)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__get_catalog_relations"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "information_schema", "type": null, "description": ""}, {"name": "relations", "type": null, "description": ""}], "created_at": 1789419970.0712187, "supported_languages": null}, "macro.dbt.default__get_catalog_relations": {"name": "default__get_catalog_relations", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "unique_id": "macro.dbt.default__get_catalog_relations", "macro_sql": "{% macro default__get_catalog_relations(information_schema, relations) -%}\n {% set typename = adapter.type() %}\n {% set msg -%}\n get_catalog_relations not implemented for {{ typename }}\n {%- endset %}\n\n {{ exceptions.raise_compiler_error(msg) }}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "information_schema", "type": null, "description": ""}, {"name": "relations", "type": null, "description": ""}], "created_at": 1789419970.0716634, "supported_languages": null}, "macro.dbt.get_catalog": {"name": "get_catalog", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "unique_id": "macro.dbt.get_catalog", "macro_sql": "{% macro get_catalog(information_schema, schemas) -%}\n {{ return(adapter.dispatch('get_catalog', 'dbt')(information_schema, schemas)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__get_catalog"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "information_schema", "type": null, "description": ""}, {"name": "schemas", "type": null, "description": ""}], "created_at": 1789419970.0720227, "supported_languages": null}, "macro.dbt.default__get_catalog": {"name": "default__get_catalog", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "unique_id": "macro.dbt.default__get_catalog", "macro_sql": "{% macro default__get_catalog(information_schema, schemas) -%}\n\n {% set typename = adapter.type() %}\n {% set msg -%}\n get_catalog not implemented for {{ typename }}\n {%- endset %}\n\n {{ exceptions.raise_compiler_error(msg) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "information_schema", "type": null, "description": ""}, {"name": "schemas", "type": null, "description": ""}], "created_at": 1789419970.072448, "supported_languages": null}, "macro.dbt.information_schema_name": {"name": "information_schema_name", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "unique_id": "macro.dbt.information_schema_name", "macro_sql": "{% macro information_schema_name(database) %}\n {{ return(adapter.dispatch('information_schema_name', 'dbt')(database)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__information_schema_name"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "database", "type": null, "description": ""}], "created_at": 1789419970.072767, "supported_languages": null}, "macro.dbt.default__information_schema_name": {"name": "default__information_schema_name", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "unique_id": "macro.dbt.default__information_schema_name", "macro_sql": "{% macro default__information_schema_name(database) -%}\n {%- if database -%}\n {{ database }}.INFORMATION_SCHEMA\n {%- else -%}\n INFORMATION_SCHEMA\n {%- endif -%}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "database", "type": null, "description": ""}], "created_at": 1789419970.0731676, "supported_languages": null}, "macro.dbt.list_schemas": {"name": "list_schemas", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "unique_id": "macro.dbt.list_schemas", "macro_sql": "{% macro list_schemas(database) -%}\n {{ return(adapter.dispatch('list_schemas', 'dbt')(database)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__list_schemas"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "database", "type": null, "description": ""}], "created_at": 1789419970.0734704, "supported_languages": null}, "macro.dbt.default__list_schemas": {"name": "default__list_schemas", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "unique_id": "macro.dbt.default__list_schemas", "macro_sql": "{% macro default__list_schemas(database) -%}\n {% set sql %}\n select distinct schema_name\n from {{ information_schema_name(database) }}.SCHEMATA\n where catalog_name ilike '{{ database }}'\n {% endset %}\n {{ return(run_query(sql)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.information_schema_name", "macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "database", "type": null, "description": ""}], "created_at": 1789419970.073884, "supported_languages": null}, "macro.dbt.check_schema_exists": {"name": "check_schema_exists", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "unique_id": "macro.dbt.check_schema_exists", "macro_sql": "{% macro check_schema_exists(information_schema, schema) -%}\n {{ return(adapter.dispatch('check_schema_exists', 'dbt')(information_schema, schema)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__check_schema_exists"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "information_schema", "type": null, "description": ""}, {"name": "schema", "type": null, "description": ""}], "created_at": 1789419970.0742223, "supported_languages": null}, "macro.dbt.default__check_schema_exists": {"name": "default__check_schema_exists", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "unique_id": "macro.dbt.default__check_schema_exists", "macro_sql": "{% macro default__check_schema_exists(information_schema, schema) -%}\n {% set sql -%}\n select count(*)\n from {{ information_schema.replace(information_schema_view='SCHEMATA') }}\n where catalog_name='{{ information_schema.database }}'\n and schema_name='{{ schema }}'\n {%- endset %}\n {{ return(run_query(sql)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.replace", "macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "information_schema", "type": null, "description": ""}, {"name": "schema", "type": null, "description": ""}], "created_at": 1789419970.0747192, "supported_languages": null}, "macro.dbt.list_relations_without_caching": {"name": "list_relations_without_caching", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "unique_id": "macro.dbt.list_relations_without_caching", "macro_sql": "{% macro list_relations_without_caching(schema_relation) %}\n {{ return(adapter.dispatch('list_relations_without_caching', 'dbt')(schema_relation)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__list_relations_without_caching"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "schema_relation", "type": null, "description": ""}], "created_at": 1789419970.0750427, "supported_languages": null}, "macro.dbt.default__list_relations_without_caching": {"name": "default__list_relations_without_caching", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "unique_id": "macro.dbt.default__list_relations_without_caching", "macro_sql": "{% macro default__list_relations_without_caching(schema_relation) %}\n {{ exceptions.raise_not_implemented(\n 'list_relations_without_caching macro not implemented for adapter '+adapter.type()) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "schema_relation", "type": null, "description": ""}], "created_at": 1789419970.0753095, "supported_languages": null}, "macro.dbt.list_function_relations_without_caching": {"name": "list_function_relations_without_caching", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "unique_id": "macro.dbt.list_function_relations_without_caching", "macro_sql": "{% macro list_function_relations_without_caching(schema_relation) %}\n {{ return(adapter.dispatch('list_function_relations_without_caching', 'dbt')(schema_relation)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__list_function_relations_without_caching"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "schema_relation", "type": null, "description": ""}], "created_at": 1789419970.07561, "supported_languages": null}, "macro.dbt.default__list_function_relations_without_caching": {"name": "default__list_function_relations_without_caching", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "unique_id": "macro.dbt.default__list_function_relations_without_caching", "macro_sql": "{% macro default__list_function_relations_without_caching(schema_relation) %}\n {{ exceptions.raise_not_implemented(\n 'list_function_relations_without_caching macro not implemented for adapter '+adapter.type()) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "schema_relation", "type": null, "description": ""}], "created_at": 1789419970.0758948, "supported_languages": null}, "macro.dbt.get_catalog_for_single_relation": {"name": "get_catalog_for_single_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "unique_id": "macro.dbt.get_catalog_for_single_relation", "macro_sql": "{% macro get_catalog_for_single_relation(relation) %}\n {{ return(adapter.dispatch('get_catalog_for_single_relation', 'dbt')(relation)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_catalog_for_single_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789419970.0761974, "supported_languages": null}, "macro.dbt.default__get_catalog_for_single_relation": {"name": "default__get_catalog_for_single_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "unique_id": "macro.dbt.default__get_catalog_for_single_relation", "macro_sql": "{% macro default__get_catalog_for_single_relation(relation) %}\n {{ exceptions.raise_not_implemented(\n 'get_catalog_for_single_relation macro not implemented for adapter '+adapter.type()) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789419970.0764635, "supported_languages": null}, "macro.dbt.get_relations": {"name": "get_relations", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "unique_id": "macro.dbt.get_relations", "macro_sql": "{% macro get_relations() %}\n {{ return(adapter.dispatch('get_relations', 'dbt')()) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__get_relations"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789419970.076754, "supported_languages": null}, "macro.dbt.default__get_relations": {"name": "default__get_relations", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "unique_id": "macro.dbt.default__get_relations", "macro_sql": "{% macro default__get_relations() %}\n {{ exceptions.raise_not_implemented(\n 'get_relations macro not implemented for adapter '+adapter.type()) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789419970.07701, "supported_languages": null}, "macro.dbt.get_relation_last_modified": {"name": "get_relation_last_modified", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "unique_id": "macro.dbt.get_relation_last_modified", "macro_sql": "{% macro get_relation_last_modified(information_schema, relations) %}\n {{ return(adapter.dispatch('get_relation_last_modified', 'dbt')(information_schema, relations)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_relation_last_modified"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "information_schema", "type": null, "description": ""}, {"name": "relations", "type": null, "description": ""}], "created_at": 1789419970.0773468, "supported_languages": null}, "macro.dbt.default__get_relation_last_modified": {"name": "default__get_relation_last_modified", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "unique_id": "macro.dbt.default__get_relation_last_modified", "macro_sql": "{% macro default__get_relation_last_modified(information_schema, relations) %}\n {{ exceptions.raise_not_implemented(\n 'get_relation_last_modified macro not implemented for adapter ' + adapter.type()) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "information_schema", "type": null, "description": ""}, {"name": "relations", "type": null, "description": ""}], "created_at": 1789419970.0776322, "supported_languages": null}, "macro.dbt.validate_sql": {"name": "validate_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/validate_sql.sql", "original_file_path": "macros/adapters/validate_sql.sql", "unique_id": "macro.dbt.validate_sql", "macro_sql": "{% macro validate_sql(sql) -%}\n {{ return(adapter.dispatch('validate_sql', 'dbt')(sql)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__validate_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "sql", "type": null, "description": ""}], "created_at": 1789419970.0781584, "supported_languages": null}, "macro.dbt.default__validate_sql": {"name": "default__validate_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/validate_sql.sql", "original_file_path": "macros/adapters/validate_sql.sql", "unique_id": "macro.dbt.default__validate_sql", "macro_sql": "{% macro default__validate_sql(sql) -%}\n {% call statement('validate_sql') -%}\n explain {{ sql }}\n {% endcall %}\n {{ return(load_result('validate_sql')) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "sql", "type": null, "description": ""}], "created_at": 1789419970.0786576, "supported_languages": null}, "macro.dbt.collect_freshness": {"name": "collect_freshness", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/freshness.sql", "original_file_path": "macros/adapters/freshness.sql", "unique_id": "macro.dbt.collect_freshness", "macro_sql": "{% macro collect_freshness(source, loaded_at_field, filter) %}\n {{ return(adapter.dispatch('collect_freshness', 'dbt')(source, loaded_at_field, filter))}}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__collect_freshness"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "source", "type": null, "description": ""}, {"name": "loaded_at_field", "type": null, "description": ""}, {"name": "filter", "type": null, "description": ""}], "created_at": 1789419970.0794632, "supported_languages": null}, "macro.dbt.default__collect_freshness": {"name": "default__collect_freshness", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/freshness.sql", "original_file_path": "macros/adapters/freshness.sql", "unique_id": "macro.dbt.default__collect_freshness", "macro_sql": "{% macro default__collect_freshness(source, loaded_at_field, filter) %}\n {% call statement('collect_freshness', fetch_result=True, auto_begin=False) -%}\n select\n max({{ loaded_at_field }}) as max_loaded_at,\n {{ current_timestamp() }} as snapshotted_at\n from {{ source }}\n {% if filter %}\n where {{ filter }}\n {% endif %}\n {% endcall %}\n {{ return(load_result('collect_freshness')) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement", "macro.dbt.current_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "source", "type": null, "description": ""}, {"name": "loaded_at_field", "type": null, "description": ""}, {"name": "filter", "type": null, "description": ""}], "created_at": 1789419970.0801651, "supported_languages": null}, "macro.dbt.collect_freshness_custom_sql": {"name": "collect_freshness_custom_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/freshness.sql", "original_file_path": "macros/adapters/freshness.sql", "unique_id": "macro.dbt.collect_freshness_custom_sql", "macro_sql": "{% macro collect_freshness_custom_sql(source, loaded_at_query) %}\n {{ return(adapter.dispatch('collect_freshness_custom_sql', 'dbt')(source, loaded_at_query))}}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__collect_freshness_custom_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "source", "type": null, "description": ""}, {"name": "loaded_at_query", "type": null, "description": ""}], "created_at": 1789419970.080524, "supported_languages": null}, "macro.dbt.default__collect_freshness_custom_sql": {"name": "default__collect_freshness_custom_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/freshness.sql", "original_file_path": "macros/adapters/freshness.sql", "unique_id": "macro.dbt.default__collect_freshness_custom_sql", "macro_sql": "{% macro default__collect_freshness_custom_sql(source, loaded_at_query) %}\n {% call statement('collect_freshness_custom_sql', fetch_result=True, auto_begin=False) -%}\n with source_query as (\n {{ loaded_at_query }}\n )\n select\n (select * from source_query) as max_loaded_at,\n {{ current_timestamp() }} as snapshotted_at\n {% endcall %}\n {{ return(load_result('collect_freshness_custom_sql')) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement", "macro.dbt.current_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "source", "type": null, "description": ""}, {"name": "loaded_at_query", "type": null, "description": ""}], "created_at": 1789419970.0810604, "supported_languages": null}, "macro.dbt.make_intermediate_relation": {"name": "make_intermediate_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "unique_id": "macro.dbt.make_intermediate_relation", "macro_sql": "{% macro make_intermediate_relation(base_relation, suffix='__dbt_tmp') %}\n {{ return(adapter.dispatch('make_intermediate_relation', 'dbt')(base_relation, suffix)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__make_intermediate_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "base_relation", "type": null, "description": ""}, {"name": "suffix", "type": null, "description": ""}], "created_at": 1789419970.082259, "supported_languages": null}, "macro.dbt.default__make_intermediate_relation": {"name": "default__make_intermediate_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "unique_id": "macro.dbt.default__make_intermediate_relation", "macro_sql": "{% macro default__make_intermediate_relation(base_relation, suffix) %}\n {{ return(default__make_temp_relation(base_relation, suffix)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__make_temp_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "base_relation", "type": null, "description": ""}, {"name": "suffix", "type": null, "description": ""}], "created_at": 1789419970.0825424, "supported_languages": null}, "macro.dbt.make_temp_relation": {"name": "make_temp_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "unique_id": "macro.dbt.make_temp_relation", "macro_sql": "{% macro make_temp_relation(base_relation, suffix='__dbt_tmp') %}\n {#-- This ensures microbatch batches get unique temp relations to avoid clobbering --#}\n {% if suffix == '__dbt_tmp' and model.batch %}\n {% set suffix = suffix ~ '_' ~ model.batch.id %}\n {% endif %}\n\n {{ return(adapter.dispatch('make_temp_relation', 'dbt')(base_relation, suffix)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__make_temp_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "base_relation", "type": null, "description": ""}, {"name": "suffix", "type": null, "description": ""}], "created_at": 1789419970.083203, "supported_languages": null}, "macro.dbt.default__make_temp_relation": {"name": "default__make_temp_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "unique_id": "macro.dbt.default__make_temp_relation", "macro_sql": "{% macro default__make_temp_relation(base_relation, suffix) %}\n {%- set temp_identifier = base_relation.identifier ~ suffix -%}\n {%- set temp_relation = base_relation.incorporate(\n path={\"identifier\": temp_identifier}) -%}\n\n {{ return(temp_relation) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "base_relation", "type": null, "description": ""}, {"name": "suffix", "type": null, "description": ""}], "created_at": 1789419970.0836916, "supported_languages": null}, "macro.dbt.make_backup_relation": {"name": "make_backup_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "unique_id": "macro.dbt.make_backup_relation", "macro_sql": "{% macro make_backup_relation(base_relation, backup_relation_type, suffix='__dbt_backup') %}\n {{ return(adapter.dispatch('make_backup_relation', 'dbt')(base_relation, backup_relation_type, suffix)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__make_backup_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "base_relation", "type": null, "description": ""}, {"name": "backup_relation_type", "type": null, "description": ""}, {"name": "suffix", "type": null, "description": ""}], "created_at": 1789419970.0841098, "supported_languages": null}, "macro.dbt.default__make_backup_relation": {"name": "default__make_backup_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "unique_id": "macro.dbt.default__make_backup_relation", "macro_sql": "{% macro default__make_backup_relation(base_relation, backup_relation_type, suffix) %}\n {%- set backup_identifier = base_relation.identifier ~ suffix -%}\n {%- set backup_relation = base_relation.incorporate(\n path={\"identifier\": backup_identifier},\n type=backup_relation_type\n ) -%}\n {{ return(backup_relation) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "base_relation", "type": null, "description": ""}, {"name": "backup_relation_type", "type": null, "description": ""}, {"name": "suffix", "type": null, "description": ""}], "created_at": 1789419970.0846465, "supported_languages": null}, "macro.dbt.truncate_relation": {"name": "truncate_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "unique_id": "macro.dbt.truncate_relation", "macro_sql": "{% macro truncate_relation(relation) -%}\n {{ return(adapter.dispatch('truncate_relation', 'dbt')(relation)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__truncate_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789419970.0849671, "supported_languages": null}, "macro.dbt.default__truncate_relation": {"name": "default__truncate_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "unique_id": "macro.dbt.default__truncate_relation", "macro_sql": "{% macro default__truncate_relation(relation) -%}\n {% call statement('truncate_relation') -%}\n truncate table {{ relation.render() }}\n {%- endcall %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789419970.085268, "supported_languages": null}, "macro.dbt.get_or_create_relation": {"name": "get_or_create_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "unique_id": "macro.dbt.get_or_create_relation", "macro_sql": "{% macro get_or_create_relation(database, schema, identifier, type) -%}\n {{ return(adapter.dispatch('get_or_create_relation', 'dbt')(database, schema, identifier, type)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_or_create_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "database", "type": null, "description": ""}, {"name": "schema", "type": null, "description": ""}, {"name": "identifier", "type": null, "description": ""}, {"name": "type", "type": null, "description": ""}], "created_at": 1789419970.0856714, "supported_languages": null}, "macro.dbt.default__get_or_create_relation": {"name": "default__get_or_create_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "unique_id": "macro.dbt.default__get_or_create_relation", "macro_sql": "{% macro default__get_or_create_relation(database, schema, identifier, type) %}\n {%- set target_relation = adapter.get_relation(database=database, schema=schema, identifier=identifier) %}\n\n {% if target_relation %}\n {% do return([true, target_relation]) %}\n {% endif %}\n\n {%- set new_relation = api.Relation.create(\n database=database,\n schema=schema,\n identifier=identifier,\n type=type\n ) -%}\n {% do return([false, new_relation]) %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "database", "type": null, "description": ""}, {"name": "schema", "type": null, "description": ""}, {"name": "identifier", "type": null, "description": ""}, {"name": "type", "type": null, "description": ""}], "created_at": 1789419970.0867057, "supported_languages": null}, "macro.dbt.load_cached_relation": {"name": "load_cached_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "unique_id": "macro.dbt.load_cached_relation", "macro_sql": "{% macro load_cached_relation(relation) %}\n {% do return(adapter.get_relation(\n database=relation.database,\n schema=relation.schema,\n identifier=relation.identifier\n )) -%}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789419970.08711, "supported_languages": null}, "macro.dbt.load_relation": {"name": "load_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "unique_id": "macro.dbt.load_relation", "macro_sql": "{% macro load_relation(relation) %}\n {{ return(load_cached_relation(relation)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.load_cached_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789419970.0873506, "supported_languages": null}, "macro.dbt.test_unique": {"name": "test_unique", "resource_type": "macro", "package_name": "dbt", "path": "tests/generic/builtin.sql", "original_file_path": "tests/generic/builtin.sql", "unique_id": "macro.dbt.test_unique", "macro_sql": "{% test unique(model, column_name) %}\n {% set macro = adapter.dispatch('test_unique', 'dbt') %}\n {{ macro(model, column_name) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt.default__test_unique"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789419970.08813, "supported_languages": null}, "macro.dbt.test_not_null": {"name": "test_not_null", "resource_type": "macro", "package_name": "dbt", "path": "tests/generic/builtin.sql", "original_file_path": "tests/generic/builtin.sql", "unique_id": "macro.dbt.test_not_null", "macro_sql": "{% test not_null(model, column_name) %}\n {% set macro = adapter.dispatch('test_not_null', 'dbt') %}\n {{ macro(model, column_name) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt.default__test_not_null"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789419970.0885499, "supported_languages": null}, "macro.dbt.test_accepted_values": {"name": "test_accepted_values", "resource_type": "macro", "package_name": "dbt", "path": "tests/generic/builtin.sql", "original_file_path": "tests/generic/builtin.sql", "unique_id": "macro.dbt.test_accepted_values", "macro_sql": "{% test accepted_values(model, column_name, values, quote=True) %}\n {% set macro = adapter.dispatch('test_accepted_values', 'dbt') %}\n {{ macro(model, column_name, values, quote) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt.default__test_accepted_values"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789419970.0890837, "supported_languages": null}, "macro.dbt.test_relationships": {"name": "test_relationships", "resource_type": "macro", "package_name": "dbt", "path": "tests/generic/builtin.sql", "original_file_path": "tests/generic/builtin.sql", "unique_id": "macro.dbt.test_relationships", "macro_sql": "{% test relationships(model, column_name, to, field) %}\n {% set macro = adapter.dispatch('test_relationships', 'dbt') %}\n {{ macro(model, column_name, to, field) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt.default__test_relationships"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789419970.089578, "supported_languages": null}, "macro.dbt_utils.slugify": {"name": "slugify", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/jinja_helpers/slugify.sql", "original_file_path": "macros/jinja_helpers/slugify.sql", "unique_id": "macro.dbt_utils.slugify", "macro_sql": "{% macro slugify(string) %}\n\n{% if not string %}\n{{ return('') }}\n{% endif %}\n\n{#- Lower case the string -#}\n{% set string = string | lower %}\n{#- Replace spaces and dashes with underscores -#}\n{% set string = modules.re.sub('[ -]+', '_', string) %}\n{#- Only take letters, numbers, and underscores -#}\n{% set string = modules.re.sub('[^a-z0-9_]+', '', string) %}\n{#- Prepends \"_\" if string begins with a number -#}\n{% set string = modules.re.sub('^[0-9]', '_' + string[0], string) %}\n\n{{ return(string) }}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "string", "type": null, "description": ""}], "created_at": 1789419970.0909166, "supported_languages": null}, "macro.dbt_utils.log_info": {"name": "log_info", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/jinja_helpers/log_info.sql", "original_file_path": "macros/jinja_helpers/log_info.sql", "unique_id": "macro.dbt_utils.log_info", "macro_sql": "{% macro log_info(message) %}\n {{ return(adapter.dispatch('log_info', 'dbt_utils')(message)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__log_info"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "message", "type": null, "description": ""}], "created_at": 1789419970.0913713, "supported_languages": null}, "macro.dbt_utils.default__log_info": {"name": "default__log_info", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/jinja_helpers/log_info.sql", "original_file_path": "macros/jinja_helpers/log_info.sql", "unique_id": "macro.dbt_utils.default__log_info", "macro_sql": "{% macro default__log_info(message) %}\n {{ log(dbt_utils.pretty_log_format(message), info=True) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.pretty_log_format"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "message", "type": null, "description": ""}], "created_at": 1789419970.091657, "supported_languages": null}, "macro.dbt_utils.pretty_log_format": {"name": "pretty_log_format", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/jinja_helpers/pretty_log_format.sql", "original_file_path": "macros/jinja_helpers/pretty_log_format.sql", "unique_id": "macro.dbt_utils.pretty_log_format", "macro_sql": "{% macro pretty_log_format(message) %}\n {{ return(adapter.dispatch('pretty_log_format', 'dbt_utils')(message)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__pretty_log_format"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "message", "type": null, "description": ""}], "created_at": 1789419970.0921354, "supported_languages": null}, "macro.dbt_utils.default__pretty_log_format": {"name": "default__pretty_log_format", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/jinja_helpers/pretty_log_format.sql", "original_file_path": "macros/jinja_helpers/pretty_log_format.sql", "unique_id": "macro.dbt_utils.default__pretty_log_format", "macro_sql": "{% macro default__pretty_log_format(message) %}\n {{ return( dbt_utils.pretty_time() ~ ' + ' ~ message) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.pretty_time"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "message", "type": null, "description": ""}], "created_at": 1789419970.092416, "supported_languages": null}, "macro.dbt_utils._is_ephemeral": {"name": "_is_ephemeral", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/jinja_helpers/_is_ephemeral.sql", "original_file_path": "macros/jinja_helpers/_is_ephemeral.sql", "unique_id": "macro.dbt_utils._is_ephemeral", "macro_sql": "{% macro _is_ephemeral(obj, macro) %}\n {%- if obj.is_cte -%}\n {% set ephemeral_prefix = api.Relation.add_ephemeral_prefix('') %}\n {% if obj.name.startswith(ephemeral_prefix) %}\n {% set model_name = obj.name[(ephemeral_prefix|length):] %}\n {% else %}\n {% set model_name = obj.name %}\n {%- endif -%}\n {% set error_message %}\nThe `{{ macro }}` macro cannot be used with ephemeral models, as it relies on the information schema.\n\n`{{ model_name }}` is an ephemeral model. Consider making it a view or table instead.\n {% endset %}\n {%- do exceptions.raise_compiler_error(error_message) -%}\n {%- endif -%}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "obj", "type": null, "description": ""}, {"name": "macro", "type": null, "description": ""}], "created_at": 1789419970.0936399, "supported_languages": null}, "macro.dbt_utils._is_relation": {"name": "_is_relation", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/jinja_helpers/_is_relation.sql", "original_file_path": "macros/jinja_helpers/_is_relation.sql", "unique_id": "macro.dbt_utils._is_relation", "macro_sql": "{% macro _is_relation(obj, macro) %}\n {%- if not (obj is mapping and obj.get('metadata', {}).get('type', '').endswith('Relation')) -%}\n {%- do exceptions.raise_compiler_error(\"Macro \" ~ macro ~ \" expected a Relation but received the value: \" ~ obj) -%}\n {%- endif -%}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "obj", "type": null, "description": ""}, {"name": "macro", "type": null, "description": ""}], "created_at": 1789419970.094421, "supported_languages": null}, "macro.dbt_utils.pretty_time": {"name": "pretty_time", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/jinja_helpers/pretty_time.sql", "original_file_path": "macros/jinja_helpers/pretty_time.sql", "unique_id": "macro.dbt_utils.pretty_time", "macro_sql": "{% macro pretty_time(format='%H:%M:%S') %}\n {{ return(adapter.dispatch('pretty_time', 'dbt_utils')(format)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__pretty_time"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "format", "type": null, "description": ""}], "created_at": 1789419970.0949068, "supported_languages": null}, "macro.dbt_utils.default__pretty_time": {"name": "default__pretty_time", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/jinja_helpers/pretty_time.sql", "original_file_path": "macros/jinja_helpers/pretty_time.sql", "unique_id": "macro.dbt_utils.default__pretty_time", "macro_sql": "{% macro default__pretty_time(format='%H:%M:%S') %}\n {{ return(modules.datetime.datetime.now().strftime(format)) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "format", "type": null, "description": ""}], "created_at": 1789419970.095233, "supported_languages": null}, "macro.dbt_utils.test_not_constant": {"name": "test_not_constant", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/not_constant.sql", "original_file_path": "macros/generic_tests/not_constant.sql", "unique_id": "macro.dbt_utils.test_not_constant", "macro_sql": "{% test not_constant(model, column_name, group_by_columns = []) %}\n {{ return(adapter.dispatch('test_not_constant', 'dbt_utils')(model, column_name, group_by_columns)) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_not_constant"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "column_name", "type": null, "description": ""}, {"name": "group_by_columns", "type": null, "description": ""}], "created_at": 1789419970.0959167, "supported_languages": null}, "macro.dbt_utils.default__test_not_constant": {"name": "default__test_not_constant", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/not_constant.sql", "original_file_path": "macros/generic_tests/not_constant.sql", "unique_id": "macro.dbt_utils.default__test_not_constant", "macro_sql": "{% macro default__test_not_constant(model, column_name, group_by_columns) %}\n\n{% if group_by_columns|length() > 0 %}\n {% set select_gb_cols = group_by_columns|join(' ,') + ', ' %}\n {% set groupby_gb_cols = 'group by ' + group_by_columns|join(',') %}\n{% endif %}\n\n\nselect\n {# In TSQL, subquery aggregate columns need aliases #}\n {# thus: a filler col name, 'filler_column' #}\n {{select_gb_cols}}\n count(distinct {{ column_name }}) as filler_column\n\nfrom {{ model }}\n\n {{groupby_gb_cols}}\n\nhaving count(distinct {{ column_name }}) = 1\n\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "column_name", "type": null, "description": ""}, {"name": "group_by_columns", "type": null, "description": ""}], "created_at": 1789419970.096837, "supported_languages": null}, "macro.dbt_utils.test_equality": {"name": "test_equality", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/equality.sql", "original_file_path": "macros/generic_tests/equality.sql", "unique_id": "macro.dbt_utils.test_equality", "macro_sql": "{% test equality(model, compare_model, compare_columns=None, exclude_columns=None, precision = None) %}\n {{ return(adapter.dispatch('test_equality', 'dbt_utils')(model, compare_model, compare_columns, exclude_columns, precision)) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_equality"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "compare_model", "type": null, "description": ""}, {"name": "compare_columns", "type": null, "description": ""}, {"name": "exclude_columns", "type": null, "description": ""}, {"name": "precision", "type": null, "description": ""}], "created_at": 1789419970.098978, "supported_languages": null}, "macro.dbt_utils.default__test_equality": {"name": "default__test_equality", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/equality.sql", "original_file_path": "macros/generic_tests/equality.sql", "unique_id": "macro.dbt_utils.default__test_equality", "macro_sql": "{% macro default__test_equality(model, compare_model, compare_columns=None, exclude_columns=None, precision = None) %}\n\n{%- if compare_columns and exclude_columns -%}\n {{ exceptions.raise_compiler_error(\"Both a compare and an ignore list were provided to the `equality` macro. Only one is allowed\") }}\n{%- endif -%}\n\n{% set set_diff %}\n count(*) + coalesce(abs(\n sum(case when which_diff = 'a_minus_b' then 1 else 0 end) -\n sum(case when which_diff = 'b_minus_a' then 1 else 0 end)\n ), 0)\n{% endset %}\n\n{#-- Needs to be set at parse time, before we return '' below --#}\n{{ config(fail_calc = set_diff) }}\n\n{#-- Prevent querying of db in parsing mode. This works because this macro does not create any new refs. #}\n{%- if not execute -%}\n {{ return('') }}\n{% endif %}\n\n\n\n-- setup\n{%- do dbt_utils._is_relation(model, 'test_equality') -%}\n\n{# Ensure there are no extra columns in the compare_model vs model #}\n{%- if not compare_columns -%}\n {%- do dbt_utils._is_ephemeral(model, 'test_equality') -%}\n {%- do dbt_utils._is_ephemeral(compare_model, 'test_equality') -%}\n\n {%- set model_columns = adapter.get_columns_in_relation(model) -%}\n {%- set compare_model_columns = adapter.get_columns_in_relation(compare_model) -%}\n\n\n {%- if exclude_columns -%}\n {#-- Lower case ignore columns for easier comparison --#}\n {%- set exclude_columns = exclude_columns | map(\"lower\") | list %}\n\n {# Filter out the excluded columns #}\n {%- set include_columns = [] %}\n {%- set include_model_columns = [] %}\n {%- for column in model_columns -%}\n {%- if column.name | lower not in exclude_columns -%}\n {% do include_columns.append(column) %}\n {%- endif %}\n {%- endfor %}\n {%- for column in compare_model_columns -%}\n {%- if column.name | lower not in exclude_columns -%}\n {% do include_model_columns.append(column) %}\n {%- endif %}\n {%- endfor %}\n\n {%- set compare_columns_set = set(include_columns | map(attribute='quoted') | map(\"lower\")) %}\n {%- set compare_model_columns_set = set(include_model_columns | map(attribute='quoted') | map(\"lower\")) %}\n {%- else -%}\n {%- set compare_columns_set = set(model_columns | map(attribute='quoted') | map(\"lower\")) %}\n {%- set compare_model_columns_set = set(compare_model_columns | map(attribute='quoted') | map(\"lower\")) %}\n {%- endif -%}\n\n {% if compare_columns_set != compare_model_columns_set %}\n {{ exceptions.raise_compiler_error(compare_model ~\" has less columns than \" ~ model ~ \", please ensure they have the same columns or use the `compare_columns` or `exclude_columns` arguments to subset them.\") }}\n {% endif %}\n\n\n{% endif %}\n\n{%- if not precision -%}\n {%- if not compare_columns -%}\n {# \n You cannot get the columns in an ephemeral model (due to not existing in the information schema),\n so if the user does not provide an explicit list of columns we must error in the case it is ephemeral\n #}\n {%- do dbt_utils._is_ephemeral(model, 'test_equality') -%}\n {%- set compare_columns = adapter.get_columns_in_relation(model)-%}\n\n {%- if exclude_columns -%}\n {#-- Lower case ignore columns for easier comparison --#}\n {%- set exclude_columns = exclude_columns | map(\"lower\") | list %}\n\n {# Filter out the excluded columns #}\n {%- set include_columns = [] %}\n {%- for column in compare_columns -%}\n {%- if column.name | lower not in exclude_columns -%}\n {% do include_columns.append(column) %}\n {%- endif %}\n {%- endfor %}\n\n {%- set compare_columns = include_columns | map(attribute='quoted') %}\n {%- else -%} {# Compare columns provided #}\n {%- set compare_columns = compare_columns | map(attribute='quoted') %}\n {%- endif -%}\n {%- endif -%}\n\n {% set compare_cols_csv = compare_columns | join(', ') %}\n\n{% else %} {# Precision required #}\n {#-\n If rounding is required, we need to get the types, so it cannot be ephemeral even if they provide column names\n -#}\n {%- do dbt_utils._is_ephemeral(model, 'test_equality') -%}\n {%- set columns = adapter.get_columns_in_relation(model) -%}\n\n {% set columns_list = [] %}\n {%- for col in columns -%}\n {%- if (\n (col.name|lower in compare_columns|map('lower') or not compare_columns) and\n (col.name|lower not in exclude_columns|map('lower') or not exclude_columns)\n ) -%}\n {# Databricks double type is not picked up by any number type checks in dbt #}\n {%- if col.is_float() or col.is_numeric() or col.data_type == 'double' -%}\n {# Cast is required due to postgres not having round for a double precision number #}\n {%- do columns_list.append('round(cast(' ~ col.quoted ~ ' as ' ~ dbt.type_numeric() ~ '),' ~ precision ~ ') as ' ~ col.quoted) -%}\n {%- else -%} {# Non-numeric type #}\n {%- do columns_list.append(col.quoted) -%}\n {%- endif -%}\n {% endif %}\n {%- endfor -%}\n\n {% set compare_cols_csv = columns_list | join(', ') %}\n\n{% endif %}\n\nwith a as (\n\n select * from {{ model }}\n\n),\n\nb as (\n\n select * from {{ compare_model }}\n\n),\n\na_minus_b as (\n\n select {{compare_cols_csv}} from a\n {{ dbt.except() }}\n select {{compare_cols_csv}} from b\n\n),\n\nb_minus_a as (\n\n select {{compare_cols_csv}} from b\n {{ dbt.except() }}\n select {{compare_cols_csv}} from a\n\n),\n\nunioned as (\n\n select 'a_minus_b' as which_diff, a_minus_b.* from a_minus_b\n union all\n select 'b_minus_a' as which_diff, b_minus_a.* from b_minus_a\n\n)\n\nselect * from unioned\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils._is_relation", "macro.dbt_utils._is_ephemeral", "macro.dbt.type_numeric", "macro.dbt.except"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "compare_model", "type": null, "description": ""}, {"name": "compare_columns", "type": null, "description": ""}, {"name": "exclude_columns", "type": null, "description": ""}, {"name": "precision", "type": null, "description": ""}], "created_at": 1789419970.105605, "supported_languages": null}, "macro.dbt_utils.test_not_empty_string": {"name": "test_not_empty_string", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/not_empty_string.sql", "original_file_path": "macros/generic_tests/not_empty_string.sql", "unique_id": "macro.dbt_utils.test_not_empty_string", "macro_sql": "{% test not_empty_string(model, column_name, trim_whitespace=true) %}\n\n {{ return(adapter.dispatch('test_not_empty_string', 'dbt_utils')(model, column_name, trim_whitespace)) }}\n\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_not_empty_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "column_name", "type": null, "description": ""}, {"name": "trim_whitespace", "type": null, "description": ""}], "created_at": 1789419970.1063948, "supported_languages": null}, "macro.dbt_utils.default__test_not_empty_string": {"name": "default__test_not_empty_string", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/not_empty_string.sql", "original_file_path": "macros/generic_tests/not_empty_string.sql", "unique_id": "macro.dbt_utils.default__test_not_empty_string", "macro_sql": "{% macro default__test_not_empty_string(model, column_name, trim_whitespace=true) %}\n\n with\n \n all_values as (\n\n select \n\n\n {% if trim_whitespace == true -%}\n\n trim({{ column_name }}) as {{ column_name }}\n\n {%- else -%}\n\n {{ column_name }}\n\n {%- endif %}\n \n from {{ model }}\n\n ),\n\n errors as (\n\n select * from all_values\n where {{ column_name }} = ''\n\n )\n\n select * from errors\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "column_name", "type": null, "description": ""}, {"name": "trim_whitespace", "type": null, "description": ""}], "created_at": 1789419970.1069813, "supported_languages": null}, "macro.dbt_utils.test_recency": {"name": "test_recency", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/recency.sql", "original_file_path": "macros/generic_tests/recency.sql", "unique_id": "macro.dbt_utils.test_recency", "macro_sql": "{% test recency(model, field, datepart, interval, ignore_time_component=False, group_by_columns = []) %}\n {{ return(adapter.dispatch('test_recency', 'dbt_utils')(model, field, datepart, interval, ignore_time_component, group_by_columns)) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_recency"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "field", "type": null, "description": ""}, {"name": "datepart", "type": null, "description": ""}, {"name": "interval", "type": null, "description": ""}, {"name": "ignore_time_component", "type": null, "description": ""}, {"name": "group_by_columns", "type": null, "description": ""}], "created_at": 1789419970.1079965, "supported_languages": null}, "macro.dbt_utils.default__test_recency": {"name": "default__test_recency", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/recency.sql", "original_file_path": "macros/generic_tests/recency.sql", "unique_id": "macro.dbt_utils.default__test_recency", "macro_sql": "{% macro default__test_recency(model, field, datepart, interval, ignore_time_component, group_by_columns) %}\n\n{% set empty_invocation = flags.EMPTY is defined and flags.EMPTY %}\n\n{% set threshold = 'cast(' ~ dbt.dateadd(datepart, interval * -1, dbt.current_timestamp()) ~ ' as ' ~ ('date' if ignore_time_component else dbt.type_timestamp()) ~ ')' %}\n\n{% if group_by_columns|length() > 0 %}\n {% set select_gb_cols = group_by_columns|join(' ,') + ', ' %}\n {% set groupby_gb_cols = 'group by ' + group_by_columns|join(',') %}\n{% endif %}\n\n\nwith recency as (\n\n select \n\n {{ select_gb_cols }}\n {% if ignore_time_component %}\n cast(max({{ field }}) as date) as most_recent\n {%- else %}\n max({{ field }}) as most_recent\n {%- endif %}\n\n from {{ model }}\n\n {{ groupby_gb_cols }}\n\n)\n\nselect\n\n {{ select_gb_cols }}\n most_recent,\n {{ threshold }} as threshold\n\nfrom recency\nwhere most_recent < {{ threshold }}\n{%- if not empty_invocation %}\n or most_recent is null\n{%- endif %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.dateadd", "macro.dbt.current_timestamp", "macro.dbt.type_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "field", "type": null, "description": ""}, {"name": "datepart", "type": null, "description": ""}, {"name": "interval", "type": null, "description": ""}, {"name": "ignore_time_component", "type": null, "description": ""}, {"name": "group_by_columns", "type": null, "description": ""}], "created_at": 1789419970.1096337, "supported_languages": null}, "macro.dbt_utils.test_at_least_one": {"name": "test_at_least_one", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/at_least_one.sql", "original_file_path": "macros/generic_tests/at_least_one.sql", "unique_id": "macro.dbt_utils.test_at_least_one", "macro_sql": "{% test at_least_one(model, column_name, group_by_columns = []) %}\n {{ return(adapter.dispatch('test_at_least_one', 'dbt_utils')(model, column_name, group_by_columns)) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_at_least_one"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "column_name", "type": null, "description": ""}, {"name": "group_by_columns", "type": null, "description": ""}], "created_at": 1789419970.1105194, "supported_languages": null}, "macro.dbt_utils.default__test_at_least_one": {"name": "default__test_at_least_one", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/at_least_one.sql", "original_file_path": "macros/generic_tests/at_least_one.sql", "unique_id": "macro.dbt_utils.default__test_at_least_one", "macro_sql": "{% macro default__test_at_least_one(model, column_name, group_by_columns) %}\n\n{% set pruned_cols = [column_name] %}\n\n{% if group_by_columns|length() > 0 %}\n\n {% set select_gb_cols = group_by_columns|join(' ,') + ', ' %}\n {% set groupby_gb_cols = 'group by ' + group_by_columns|join(',') %}\n {% set pruned_cols = group_by_columns %}\n\n {% if column_name not in pruned_cols %}\n {% do pruned_cols.append(column_name) %}\n {% endif %}\n\n{% endif %}\n\n{% set select_pruned_cols = pruned_cols|join(' ,') %}\n\nselect *\nfrom (\n with pruned_rows as (\n select\n {{ select_pruned_cols }}\n from {{ model }}\n {% if group_by_columns|length() == 0 %}\n where {{ column_name }} is not null\n limit 1\n {% endif %}\n )\n select\n {# In TSQL, subquery aggregate columns need aliases #}\n {# thus: a filler col name, 'filler_column' #}\n {{select_gb_cols}}\n count({{ column_name }}) as filler_column\n\n from pruned_rows\n\n {{groupby_gb_cols}}\n\n having count({{ column_name }}) = 0\n\n) validation_errors\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "column_name", "type": null, "description": ""}, {"name": "group_by_columns", "type": null, "description": ""}], "created_at": 1789419970.112022, "supported_languages": null}, "macro.dbt_utils.test_unique_combination_of_columns": {"name": "test_unique_combination_of_columns", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/unique_combination_of_columns.sql", "original_file_path": "macros/generic_tests/unique_combination_of_columns.sql", "unique_id": "macro.dbt_utils.test_unique_combination_of_columns", "macro_sql": "{% test unique_combination_of_columns(model, combination_of_columns, quote_columns=false) %}\n {{ return(adapter.dispatch('test_unique_combination_of_columns', 'dbt_utils')(model, combination_of_columns, quote_columns)) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_unique_combination_of_columns"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "combination_of_columns", "type": null, "description": ""}, {"name": "quote_columns", "type": null, "description": ""}], "created_at": 1789419970.1127985, "supported_languages": null}, "macro.dbt_utils.default__test_unique_combination_of_columns": {"name": "default__test_unique_combination_of_columns", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/unique_combination_of_columns.sql", "original_file_path": "macros/generic_tests/unique_combination_of_columns.sql", "unique_id": "macro.dbt_utils.default__test_unique_combination_of_columns", "macro_sql": "{% macro default__test_unique_combination_of_columns(model, combination_of_columns, quote_columns=false) %}\n\n{% if not quote_columns %}\n {%- set column_list=combination_of_columns %}\n{% elif quote_columns %}\n {%- set column_list=[] %}\n {% for column in combination_of_columns -%}\n {% do column_list.append( adapter.quote(column) ) %}\n {%- endfor %}\n{% else %}\n {{ exceptions.raise_compiler_error(\n \"`quote_columns` argument for unique_combination_of_columns test must be one of [True, False] Got: '\" ~ quote ~\"'.'\"\n ) }}\n{% endif %}\n\n{%- set columns_csv=column_list | join(', ') %}\n\n\nwith validation_errors as (\n\n select\n {{ columns_csv }}\n from {{ model }}\n group by {{ columns_csv }}\n having count(*) > 1\n\n)\n\nselect *\nfrom validation_errors\n\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "combination_of_columns", "type": null, "description": ""}, {"name": "quote_columns", "type": null, "description": ""}], "created_at": 1789419970.1138506, "supported_languages": null}, "macro.dbt_utils.test_fewer_rows_than": {"name": "test_fewer_rows_than", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/fewer_rows_than.sql", "original_file_path": "macros/generic_tests/fewer_rows_than.sql", "unique_id": "macro.dbt_utils.test_fewer_rows_than", "macro_sql": "{% test fewer_rows_than(model, compare_model, group_by_columns = []) %}\n {{ return(adapter.dispatch('test_fewer_rows_than', 'dbt_utils')(model, compare_model, group_by_columns)) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_fewer_rows_than"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "compare_model", "type": null, "description": ""}, {"name": "group_by_columns", "type": null, "description": ""}], "created_at": 1789419970.1148787, "supported_languages": null}, "macro.dbt_utils.default__test_fewer_rows_than": {"name": "default__test_fewer_rows_than", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/fewer_rows_than.sql", "original_file_path": "macros/generic_tests/fewer_rows_than.sql", "unique_id": "macro.dbt_utils.default__test_fewer_rows_than", "macro_sql": "{% macro default__test_fewer_rows_than(model, compare_model, group_by_columns) %}\n\n{{ config(fail_calc = 'sum(coalesce(row_count_delta, 0))') }}\n\n{% if group_by_columns|length() > 0 %}\n {% set select_gb_cols = group_by_columns|join(' ,') + ', ' %}\n {% set join_gb_cols %}\n {% for c in group_by_columns %}\n and a.{{c}} = b.{{c}}\n {% endfor %}\n {% endset %}\n {% set groupby_gb_cols = 'group by ' + group_by_columns|join(',') %}\n{% endif %}\n\n{#-- We must add a fake join key in case additional grouping variables are not provided --#}\n{#-- Redshift does not allow for dynamically created join conditions (e.g. full join on 1 = 1 --#}\n{#-- The same logic is used in equal_rowcount. In case of changes, maintain consistent logic --#}\n{% set group_by_columns = ['id_dbtutils_test_fewer_rows_than'] + group_by_columns %}\n{% set groupby_gb_cols = 'group by ' + group_by_columns|join(',') %}\n\n\nwith a as (\n\n select \n {{select_gb_cols}}\n 1 as id_dbtutils_test_fewer_rows_than,\n count(*) as count_our_model \n from {{ model }}\n {{ groupby_gb_cols }}\n\n),\nb as (\n\n select \n {{select_gb_cols}}\n 1 as id_dbtutils_test_fewer_rows_than,\n count(*) as count_comparison_model \n from {{ compare_model }}\n {{ groupby_gb_cols }}\n\n),\ncounts as (\n\n select\n\n {% for c in group_by_columns -%}\n a.{{c}} as {{c}}_a,\n b.{{c}} as {{c}}_b,\n {% endfor %}\n\n count_our_model,\n count_comparison_model\n from a\n full join b on \n a.id_dbtutils_test_fewer_rows_than = b.id_dbtutils_test_fewer_rows_than\n {{ join_gb_cols }}\n\n),\nfinal as (\n\n select *,\n case\n -- fail the test if we have more rows than the reference model and return the row count delta\n when count_our_model > count_comparison_model then (count_our_model - count_comparison_model)\n -- fail the test if they are the same number\n when count_our_model = count_comparison_model then 1\n -- pass the test if the delta is positive (i.e. return the number 0)\n else 0\n end as row_count_delta\n from counts\n\n)\n\nselect * from final\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "compare_model", "type": null, "description": ""}, {"name": "group_by_columns", "type": null, "description": ""}], "created_at": 1789419970.1167653, "supported_languages": null}, "macro.dbt_utils.test_not_null_proportion": {"name": "test_not_null_proportion", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/not_null_proportion.sql", "original_file_path": "macros/generic_tests/not_null_proportion.sql", "unique_id": "macro.dbt_utils.test_not_null_proportion", "macro_sql": "{% macro test_not_null_proportion(model, group_by_columns = []) %}\n {{ return(adapter.dispatch('test_not_null_proportion', 'dbt_utils')(model, group_by_columns, **kwargs)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_not_null_proportion"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "group_by_columns", "type": null, "description": ""}], "created_at": 1789419970.1175728, "supported_languages": null}, "macro.dbt_utils.default__test_not_null_proportion": {"name": "default__test_not_null_proportion", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/not_null_proportion.sql", "original_file_path": "macros/generic_tests/not_null_proportion.sql", "unique_id": "macro.dbt_utils.default__test_not_null_proportion", "macro_sql": "{% macro default__test_not_null_proportion(model, group_by_columns) %}\n\n{% set column_name = kwargs.get('column_name', kwargs.get('arg')) %}\n{% set at_least = kwargs.get('at_least', kwargs.get('arg')) %}\n{% set at_most = kwargs.get('at_most', kwargs.get('arg', 1)) %}\n\n{% if group_by_columns|length() > 0 %}\n {% set select_gb_cols = group_by_columns|join(' ,') + ', ' %}\n {% set groupby_gb_cols = 'group by ' + group_by_columns|join(',') %}\n{% endif %}\n\nwith validation as (\n select\n {{select_gb_cols}}\n sum(case when {{ column_name }} is null then 0 else 1 end) / cast(count(*) as {{ dbt.type_numeric() }}) as not_null_proportion\n from {{ model }}\n {{groupby_gb_cols}}\n),\nvalidation_errors as (\n select\n {{select_gb_cols}}\n not_null_proportion\n from validation\n where not_null_proportion < {{ at_least }} or not_null_proportion > {{ at_most }}\n)\nselect\n *\nfrom validation_errors\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.type_numeric"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "group_by_columns", "type": null, "description": ""}], "created_at": 1789419970.1189756, "supported_languages": null}, "macro.dbt_utils.test_equal_rowcount": {"name": "test_equal_rowcount", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/equal_rowcount.sql", "original_file_path": "macros/generic_tests/equal_rowcount.sql", "unique_id": "macro.dbt_utils.test_equal_rowcount", "macro_sql": "{% test equal_rowcount(model, compare_model, group_by_columns = []) %}\n {{ return(adapter.dispatch('test_equal_rowcount', 'dbt_utils')(model, compare_model, group_by_columns)) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_equal_rowcount"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "compare_model", "type": null, "description": ""}, {"name": "group_by_columns", "type": null, "description": ""}], "created_at": 1789419970.1200182, "supported_languages": null}, "macro.dbt_utils.default__test_equal_rowcount": {"name": "default__test_equal_rowcount", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/equal_rowcount.sql", "original_file_path": "macros/generic_tests/equal_rowcount.sql", "unique_id": "macro.dbt_utils.default__test_equal_rowcount", "macro_sql": "{% macro default__test_equal_rowcount(model, compare_model, group_by_columns) %}\n\n{#-- Needs to be set at parse time, before we return '' below --#}\n{{ config(fail_calc = 'sum(coalesce(diff_count, 0))') }}\n\n{#-- Prevent querying of db in parsing mode. This works because this macro does not create any new refs. #}\n{%- if not execute -%}\n {{ return('') }}\n{% endif %}\n\n{% if group_by_columns|length() > 0 %}\n {% set select_gb_cols = group_by_columns|join(', ') + ', ' %}\n {% set join_gb_cols %}\n {% for c in group_by_columns %}\n and a.{{c}} = b.{{c}}\n {% endfor %}\n {% endset %}\n {% set groupby_gb_cols = 'group by ' + group_by_columns|join(',') %}\n{% endif %}\n\n{#-- We must add a fake join key in case additional grouping variables are not provided --#}\n{#-- Redshift does not allow for dynamically created join conditions (e.g. full join on 1 = 1 --#}\n{#-- The same logic is used in fewer_rows_than. In case of changes, maintain consistent logic --#}\n{% set group_by_columns = ['id_dbtutils_test_equal_rowcount'] + group_by_columns %}\n{% set groupby_gb_cols = 'group by ' + group_by_columns|join(',') %}\n\nwith a as (\n\n select \n {{select_gb_cols}}\n 1 as id_dbtutils_test_equal_rowcount,\n count(*) as count_a \n from {{ model }}\n {{groupby_gb_cols}}\n\n\n),\nb as (\n\n select \n {{select_gb_cols}}\n 1 as id_dbtutils_test_equal_rowcount,\n count(*) as count_b \n from {{ compare_model }}\n {{groupby_gb_cols}}\n\n),\nfinal as (\n\n select\n \n {% for c in group_by_columns -%}\n a.{{c}} as {{c}}_a,\n b.{{c}} as {{c}}_b,\n {% endfor %}\n\n count_a,\n count_b,\n abs(count_a - count_b) as diff_count\n\n from a\n full join b\n on\n a.id_dbtutils_test_equal_rowcount = b.id_dbtutils_test_equal_rowcount\n {{join_gb_cols}}\n\n\n)\n\nselect * from final\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "compare_model", "type": null, "description": ""}, {"name": "group_by_columns", "type": null, "description": ""}], "created_at": 1789419970.1218333, "supported_languages": null}, "macro.dbt_utils.test_sequential_values": {"name": "test_sequential_values", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/sequential_values.sql", "original_file_path": "macros/generic_tests/sequential_values.sql", "unique_id": "macro.dbt_utils.test_sequential_values", "macro_sql": "{% test sequential_values(model, column_name, interval=1, datepart=None, group_by_columns = []) %}\n\n {{ return(adapter.dispatch('test_sequential_values', 'dbt_utils')(model, column_name, interval, datepart, group_by_columns)) }}\n\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_sequential_values"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "column_name", "type": null, "description": ""}, {"name": "interval", "type": null, "description": ""}, {"name": "datepart", "type": null, "description": ""}, {"name": "group_by_columns", "type": null, "description": ""}], "created_at": 1789419970.1228077, "supported_languages": null}, "macro.dbt_utils.default__test_sequential_values": {"name": "default__test_sequential_values", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/sequential_values.sql", "original_file_path": "macros/generic_tests/sequential_values.sql", "unique_id": "macro.dbt_utils.default__test_sequential_values", "macro_sql": "{% macro default__test_sequential_values(model, column_name, interval=1, datepart=None, group_by_columns = []) %}\n\n{% set previous_column_name = \"previous_\" ~ dbt_utils.slugify(column_name) %}\n\n{% if group_by_columns|length() > 0 %}\n {% set select_gb_cols = group_by_columns|join(',') + ', ' %}\n {% set partition_gb_cols = 'partition by ' + group_by_columns|join(',') %}\n{% endif %}\n\nwith windowed as (\n\n select\n {{ select_gb_cols }}\n {{ column_name }},\n lag({{ column_name }}) over (\n {{partition_gb_cols}}\n order by {{ column_name }}\n ) as {{ previous_column_name }}\n from {{ model }}\n),\n\nvalidation_errors as (\n select\n *\n from windowed\n {% if datepart %}\n where not(cast({{ column_name }} as {{ dbt.type_timestamp() }})= cast({{ dbt.dateadd(datepart, interval, previous_column_name) }} as {{ dbt.type_timestamp() }}))\n {% else %}\n where not({{ column_name }} = {{ previous_column_name }} + {{ interval }})\n {% endif %}\n)\n\nselect *\nfrom validation_errors\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.slugify", "macro.dbt.type_timestamp", "macro.dbt.dateadd"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "column_name", "type": null, "description": ""}, {"name": "interval", "type": null, "description": ""}, {"name": "datepart", "type": null, "description": ""}, {"name": "group_by_columns", "type": null, "description": ""}], "created_at": 1789419970.1243303, "supported_languages": null}, "macro.dbt_utils.test_mutually_exclusive_ranges": {"name": "test_mutually_exclusive_ranges", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/mutually_exclusive_ranges.sql", "original_file_path": "macros/generic_tests/mutually_exclusive_ranges.sql", "unique_id": "macro.dbt_utils.test_mutually_exclusive_ranges", "macro_sql": "{% test mutually_exclusive_ranges(model, lower_bound_column, upper_bound_column, partition_by=None, gaps='allowed', zero_length_range_allowed=False) %}\n {{ return(adapter.dispatch('test_mutually_exclusive_ranges', 'dbt_utils')(model, lower_bound_column, upper_bound_column, partition_by, gaps, zero_length_range_allowed)) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_mutually_exclusive_ranges"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "lower_bound_column", "type": null, "description": ""}, {"name": "upper_bound_column", "type": null, "description": ""}, {"name": "partition_by", "type": null, "description": ""}, {"name": "gaps", "type": null, "description": ""}, {"name": "zero_length_range_allowed", "type": null, "description": ""}], "created_at": 1789419970.1257756, "supported_languages": null}, "macro.dbt_utils.default__test_mutually_exclusive_ranges": {"name": "default__test_mutually_exclusive_ranges", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/mutually_exclusive_ranges.sql", "original_file_path": "macros/generic_tests/mutually_exclusive_ranges.sql", "unique_id": "macro.dbt_utils.default__test_mutually_exclusive_ranges", "macro_sql": "{% macro default__test_mutually_exclusive_ranges(model, lower_bound_column, upper_bound_column, partition_by=None, gaps='allowed', zero_length_range_allowed=False) %}\n{% if gaps == 'not_allowed' %}\n {% set allow_gaps_operator='=' %}\n {% set allow_gaps_operator_in_words='equal_to' %}\n{% elif gaps == 'allowed' %}\n {% set allow_gaps_operator='<=' %}\n {% set allow_gaps_operator_in_words='less_than_or_equal_to' %}\n{% elif gaps == 'required' %}\n {% set allow_gaps_operator='<' %}\n {% set allow_gaps_operator_in_words='less_than' %}\n{% else %}\n {{ exceptions.raise_compiler_error(\n \"`gaps` argument for mutually_exclusive_ranges test must be one of ['not_allowed', 'allowed', 'required'] Got: '\" ~ gaps ~\"'.'\"\n ) }}\n{% endif %}\n{% if not zero_length_range_allowed %}\n {% set allow_zero_length_operator='<' %}\n {% set allow_zero_length_operator_in_words='less_than' %}\n{% elif zero_length_range_allowed %}\n {% set allow_zero_length_operator='<=' %}\n {% set allow_zero_length_operator_in_words='less_than_or_equal_to' %}\n{% else %}\n {{ exceptions.raise_compiler_error(\n \"`zero_length_range_allowed` argument for mutually_exclusive_ranges test must be one of [true, false] Got: '\" ~ zero_length_range_allowed ~\"'.'\"\n ) }}\n{% endif %}\n\n{% set partition_clause=\"partition by \" ~ partition_by if partition_by else '' %}\n\nwith window_functions as (\n\n select\n {% if partition_by %}\n {{ partition_by }} as partition_by_col,\n {% endif %}\n {{ lower_bound_column }} as lower_bound,\n {{ upper_bound_column }} as upper_bound,\n\n lead({{ lower_bound_column }}) over (\n {{ partition_clause }}\n order by {{ lower_bound_column }}, {{ upper_bound_column }}\n ) as next_lower_bound,\n\n row_number() over (\n {{ partition_clause }}\n order by {{ lower_bound_column }} desc, {{ upper_bound_column }} desc\n ) = 1 as is_last_record\n\n from {{ model }}\n\n),\n\ncalc as (\n -- We want to return records where one of our assumptions fails, so we'll use\n -- the `not` function with `and` statements so we can write our assumptions more cleanly\n select\n *,\n\n -- For each record: lower_bound should be < upper_bound.\n -- Coalesce it to return an error on the null case (implicit assumption\n -- these columns are not_null)\n coalesce(\n lower_bound {{ allow_zero_length_operator }} upper_bound,\n false\n ) as lower_bound_{{ allow_zero_length_operator_in_words }}_upper_bound,\n\n -- For each record: upper_bound {{ allow_gaps_operator }} the next lower_bound.\n -- Coalesce it to handle null cases for the last record.\n coalesce(\n upper_bound {{ allow_gaps_operator }} next_lower_bound,\n is_last_record,\n false\n ) as upper_bound_{{ allow_gaps_operator_in_words }}_next_lower_bound\n\n from window_functions\n\n),\n\nvalidation_errors as (\n\n select\n *\n from calc\n\n where not(\n -- THE FOLLOWING SHOULD BE TRUE --\n lower_bound_{{ allow_zero_length_operator_in_words }}_upper_bound\n and upper_bound_{{ allow_gaps_operator_in_words }}_next_lower_bound\n )\n)\n\nselect * from validation_errors\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "lower_bound_column", "type": null, "description": ""}, {"name": "upper_bound_column", "type": null, "description": ""}, {"name": "partition_by", "type": null, "description": ""}, {"name": "gaps", "type": null, "description": ""}, {"name": "zero_length_range_allowed", "type": null, "description": ""}], "created_at": 1789419970.1290267, "supported_languages": null}, "macro.dbt_utils.test_cardinality_equality": {"name": "test_cardinality_equality", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/cardinality_equality.sql", "original_file_path": "macros/generic_tests/cardinality_equality.sql", "unique_id": "macro.dbt_utils.test_cardinality_equality", "macro_sql": "{% test cardinality_equality(model, column_name, to, field) %}\n {{ return(adapter.dispatch('test_cardinality_equality', 'dbt_utils')(model, column_name, to, field)) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_cardinality_equality"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "column_name", "type": null, "description": ""}, {"name": "to", "type": null, "description": ""}, {"name": "field", "type": null, "description": ""}], "created_at": 1789419970.1297812, "supported_languages": null}, "macro.dbt_utils.default__test_cardinality_equality": {"name": "default__test_cardinality_equality", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/cardinality_equality.sql", "original_file_path": "macros/generic_tests/cardinality_equality.sql", "unique_id": "macro.dbt_utils.default__test_cardinality_equality", "macro_sql": "{% macro default__test_cardinality_equality(model, column_name, to, field) %}\n\n{# T-SQL does not let you use numbers as aliases for columns #}\n{# Thus, no \"GROUP BY 1\" #}\n\nwith table_a as (\nselect\n {{ column_name }},\n count(*) as num_rows\nfrom {{ model }}\ngroup by {{ column_name }}\n),\n\ntable_b as (\nselect\n {{ field }},\n count(*) as num_rows\nfrom {{ to }}\ngroup by {{ field }}\n),\n\nexcept_a as (\n select *\n from table_a\n {{ dbt.except() }}\n select *\n from table_b\n),\n\nexcept_b as (\n select *\n from table_b\n {{ dbt.except() }}\n select *\n from table_a\n),\n\nunioned as (\n select *\n from except_a\n union all\n select *\n from except_b\n)\n\nselect *\nfrom unioned\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.except"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "column_name", "type": null, "description": ""}, {"name": "to", "type": null, "description": ""}, {"name": "field", "type": null, "description": ""}], "created_at": 1789419970.130413, "supported_languages": null}, "macro.dbt_utils.test_relationships_where": {"name": "test_relationships_where", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/relationships_where.sql", "original_file_path": "macros/generic_tests/relationships_where.sql", "unique_id": "macro.dbt_utils.test_relationships_where", "macro_sql": "{% test relationships_where(model, column_name, to, field, from_condition=\"1=1\", to_condition=\"1=1\") %}\n {{ return(adapter.dispatch('test_relationships_where', 'dbt_utils')(model, column_name, to, field, from_condition, to_condition)) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_relationships_where"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "column_name", "type": null, "description": ""}, {"name": "to", "type": null, "description": ""}, {"name": "field", "type": null, "description": ""}, {"name": "from_condition", "type": null, "description": ""}, {"name": "to_condition", "type": null, "description": ""}], "created_at": 1789419970.1312592, "supported_languages": null}, "macro.dbt_utils.default__test_relationships_where": {"name": "default__test_relationships_where", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/relationships_where.sql", "original_file_path": "macros/generic_tests/relationships_where.sql", "unique_id": "macro.dbt_utils.default__test_relationships_where", "macro_sql": "{% macro default__test_relationships_where(model, column_name, to, field, from_condition=\"1=1\", to_condition=\"1=1\") %}\n\n{# T-SQL has no boolean data type so we use 1=1 which returns TRUE #}\n{# ref https://stackoverflow.com/a/7170753/3842610 #}\n\nwith left_table as (\n\n select\n {{column_name}} as id\n\n from {{model}}\n\n where {{column_name}} is not null\n and {{from_condition}}\n\n),\n\nright_table as (\n\n select\n {{field}} as id\n\n from {{to}}\n\n where {{field}} is not null\n and {{to_condition}}\n\n),\n\nexceptions as (\n\n select\n left_table.id,\n right_table.id as right_id\n\n from left_table\n\n left join right_table\n on left_table.id = right_table.id\n\n where right_table.id is null\n\n)\n\nselect * from exceptions\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "column_name", "type": null, "description": ""}, {"name": "to", "type": null, "description": ""}, {"name": "field", "type": null, "description": ""}, {"name": "from_condition", "type": null, "description": ""}, {"name": "to_condition", "type": null, "description": ""}], "created_at": 1789419970.1318703, "supported_languages": null}, "macro.dbt_utils.test_expression_is_true": {"name": "test_expression_is_true", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/expression_is_true.sql", "original_file_path": "macros/generic_tests/expression_is_true.sql", "unique_id": "macro.dbt_utils.test_expression_is_true", "macro_sql": "{% test expression_is_true(model, expression, column_name=None) %}\n {{ return(adapter.dispatch('test_expression_is_true', 'dbt_utils')(model, expression, column_name)) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_expression_is_true"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "expression", "type": null, "description": ""}, {"name": "column_name", "type": null, "description": ""}], "created_at": 1789419970.1325073, "supported_languages": null}, "macro.dbt_utils.default__test_expression_is_true": {"name": "default__test_expression_is_true", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/expression_is_true.sql", "original_file_path": "macros/generic_tests/expression_is_true.sql", "unique_id": "macro.dbt_utils.default__test_expression_is_true", "macro_sql": "{% macro default__test_expression_is_true(model, expression, column_name) %}\n\n{% set column_list = '*' if should_store_failures() else \"1\" %}\n\nselect\n {{ column_list }}\nfrom {{ model }}\n{% if column_name is none %}\nwhere not({{ expression }})\n{%- else %}\nwhere not({{ column_name }} {{ expression }})\n{%- endif %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.should_store_failures"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "expression", "type": null, "description": ""}, {"name": "column_name", "type": null, "description": ""}], "created_at": 1789419970.1331348, "supported_languages": null}, "macro.dbt_utils.test_not_accepted_values": {"name": "test_not_accepted_values", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/not_accepted_values.sql", "original_file_path": "macros/generic_tests/not_accepted_values.sql", "unique_id": "macro.dbt_utils.test_not_accepted_values", "macro_sql": "{% test not_accepted_values(model, column_name, values, quote=True) %}\n {{ return(adapter.dispatch('test_not_accepted_values', 'dbt_utils')(model, column_name, values, quote)) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_not_accepted_values"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "column_name", "type": null, "description": ""}, {"name": "values", "type": null, "description": ""}, {"name": "quote", "type": null, "description": ""}], "created_at": 1789419970.1338518, "supported_languages": null}, "macro.dbt_utils.default__test_not_accepted_values": {"name": "default__test_not_accepted_values", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/not_accepted_values.sql", "original_file_path": "macros/generic_tests/not_accepted_values.sql", "unique_id": "macro.dbt_utils.default__test_not_accepted_values", "macro_sql": "{% macro default__test_not_accepted_values(model, column_name, values, quote=True) %}\nwith all_values as (\n\n select distinct\n {{ column_name }} as value_field\n\n from {{ model }}\n\n),\n\nvalidation_errors as (\n\n select\n value_field\n\n from all_values\n where value_field in (\n {% for value in values -%}\n {% if quote -%}\n '{{ value }}'\n {%- else -%}\n {{ value }}\n {%- endif -%}\n {%- if not loop.last -%},{%- endif %}\n {%- endfor %}\n )\n\n)\n\nselect *\nfrom validation_errors\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "column_name", "type": null, "description": ""}, {"name": "values", "type": null, "description": ""}, {"name": "quote", "type": null, "description": ""}], "created_at": 1789419970.134517, "supported_languages": null}, "macro.dbt_utils.test_accepted_range": {"name": "test_accepted_range", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/accepted_range.sql", "original_file_path": "macros/generic_tests/accepted_range.sql", "unique_id": "macro.dbt_utils.test_accepted_range", "macro_sql": "{% test accepted_range(model, column_name, min_value=none, max_value=none, inclusive=true) %}\n {{ return(adapter.dispatch('test_accepted_range', 'dbt_utils')(model, column_name, min_value, max_value, inclusive)) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_accepted_range"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "column_name", "type": null, "description": ""}, {"name": "min_value", "type": null, "description": ""}, {"name": "max_value", "type": null, "description": ""}, {"name": "inclusive", "type": null, "description": ""}], "created_at": 1789419970.1353366, "supported_languages": null}, "macro.dbt_utils.default__test_accepted_range": {"name": "default__test_accepted_range", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/accepted_range.sql", "original_file_path": "macros/generic_tests/accepted_range.sql", "unique_id": "macro.dbt_utils.default__test_accepted_range", "macro_sql": "{% macro default__test_accepted_range(model, column_name, min_value=none, max_value=none, inclusive=true) %}\n\nwith meet_condition as(\n select *\n from {{ model }}\n),\n\nvalidation_errors as (\n select *\n from meet_condition\n where\n -- never true, defaults to an empty result set. Exists to ensure any combo of the `or` clauses below succeeds\n 1 = 2\n\n {%- if min_value is not none %}\n -- records with a value >= min_value are permitted. The `not` flips this to find records that don't meet the rule.\n or not {{ column_name }} > {{- \"=\" if inclusive }} {{ min_value }}\n {%- endif %}\n\n {%- if max_value is not none %}\n -- records with a value <= max_value are permitted. The `not` flips this to find records that don't meet the rule.\n or not {{ column_name }} < {{- \"=\" if inclusive }} {{ max_value }}\n {%- endif %}\n)\n\nselect *\nfrom validation_errors\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "column_name", "type": null, "description": ""}, {"name": "min_value", "type": null, "description": ""}, {"name": "max_value", "type": null, "description": ""}, {"name": "inclusive", "type": null, "description": ""}], "created_at": 1789419970.1361694, "supported_languages": null}, "macro.dbt_utils.get_url_parameter": {"name": "get_url_parameter", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/web/get_url_parameter.sql", "original_file_path": "macros/web/get_url_parameter.sql", "unique_id": "macro.dbt_utils.get_url_parameter", "macro_sql": "{% macro get_url_parameter(field, url_parameter) -%}\n {{ return(adapter.dispatch('get_url_parameter', 'dbt_utils')(field, url_parameter)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__get_url_parameter"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field", "type": null, "description": ""}, {"name": "url_parameter", "type": null, "description": ""}], "created_at": 1789419970.1367085, "supported_languages": null}, "macro.dbt_utils.default__get_url_parameter": {"name": "default__get_url_parameter", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/web/get_url_parameter.sql", "original_file_path": "macros/web/get_url_parameter.sql", "unique_id": "macro.dbt_utils.default__get_url_parameter", "macro_sql": "{% macro default__get_url_parameter(field, url_parameter) -%}\n\n{%- set formatted_url_parameter = \"'\" + url_parameter + \"='\" -%}\n\n{%- set split = dbt.split_part(dbt.split_part(field, formatted_url_parameter, 2), \"'&'\", 1) -%}\n\nnullif({{ split }},'')\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.split_part"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field", "type": null, "description": ""}, {"name": "url_parameter", "type": null, "description": ""}], "created_at": 1789419970.1373038, "supported_languages": null}, "macro.dbt_utils.get_url_host": {"name": "get_url_host", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/web/get_url_host.sql", "original_file_path": "macros/web/get_url_host.sql", "unique_id": "macro.dbt_utils.get_url_host", "macro_sql": "{% macro get_url_host(field) -%}\n {{ return(adapter.dispatch('get_url_host', 'dbt_utils')(field)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__get_url_host"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field", "type": null, "description": ""}], "created_at": 1789419970.13785, "supported_languages": null}, "macro.dbt_utils.default__get_url_host": {"name": "default__get_url_host", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/web/get_url_host.sql", "original_file_path": "macros/web/get_url_host.sql", "unique_id": "macro.dbt_utils.default__get_url_host", "macro_sql": "{% macro default__get_url_host(field) -%}\n\n{%- set parsed =\n dbt.split_part(\n dbt.split_part(\n dbt.replace(\n dbt.replace(\n dbt.replace(field, \"'android-app://'\", \"''\"\n ), \"'http://'\", \"''\"\n ), \"'https://'\", \"''\"\n ), \"'/'\", 1\n ), \"'?'\", 1\n )\n\n-%}\n\n\n {{ dbt.safe_cast(\n parsed,\n dbt.type_string()\n )}}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.split_part", "macro.dbt.replace", "macro.dbt.safe_cast", "macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field", "type": null, "description": ""}], "created_at": 1789419970.1388009, "supported_languages": null}, "macro.dbt_utils.get_url_path": {"name": "get_url_path", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/web/get_url_path.sql", "original_file_path": "macros/web/get_url_path.sql", "unique_id": "macro.dbt_utils.get_url_path", "macro_sql": "{% macro get_url_path(field) -%}\n {{ return(adapter.dispatch('get_url_path', 'dbt_utils')(field)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__get_url_path"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field", "type": null, "description": ""}], "created_at": 1789419970.139395, "supported_languages": null}, "macro.dbt_utils.default__get_url_path": {"name": "default__get_url_path", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/web/get_url_path.sql", "original_file_path": "macros/web/get_url_path.sql", "unique_id": "macro.dbt_utils.default__get_url_path", "macro_sql": "{% macro default__get_url_path(field) -%}\n\n {%- set stripped_url =\n dbt.replace(\n dbt.replace(field, \"'http://'\", \"''\"), \"'https://'\", \"''\")\n -%}\n\n {%- set first_slash_pos -%}\n coalesce(\n nullif({{ dbt.position(\"'/'\", stripped_url) }}, 0),\n {{ dbt.position(\"'?'\", stripped_url) }} - 1\n )\n {%- endset -%}\n\n {%- set parsed_path =\n dbt.split_part(\n dbt.right(\n stripped_url,\n dbt.length(stripped_url) ~ \"-\" ~ first_slash_pos\n ),\n \"'?'\", 1\n )\n -%}\n\n {{ dbt.safe_cast(\n parsed_path,\n dbt.type_string()\n )}}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.replace", "macro.dbt.position", "macro.dbt.split_part", "macro.dbt.right", "macro.dbt.length", "macro.dbt.safe_cast", "macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field", "type": null, "description": ""}], "created_at": 1789419970.1406825, "supported_languages": null}, "macro.dbt_utils.get_column_values": {"name": "get_column_values", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_column_values.sql", "original_file_path": "macros/sql/get_column_values.sql", "unique_id": "macro.dbt_utils.get_column_values", "macro_sql": "{% macro get_column_values(table, column, order_by='count(*) desc', max_records=none, default=none, where=none) -%}\n {{ return(adapter.dispatch('get_column_values', 'dbt_utils')(table, column, order_by, max_records, default, where)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__get_column_values"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "table", "type": null, "description": ""}, {"name": "column", "type": null, "description": ""}, {"name": "order_by", "type": null, "description": ""}, {"name": "max_records", "type": null, "description": ""}, {"name": "default", "type": null, "description": ""}, {"name": "where", "type": null, "description": ""}], "created_at": 1789419970.142035, "supported_languages": null}, "macro.dbt_utils.default__get_column_values": {"name": "default__get_column_values", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_column_values.sql", "original_file_path": "macros/sql/get_column_values.sql", "unique_id": "macro.dbt_utils.default__get_column_values", "macro_sql": "{% macro default__get_column_values(table, column, order_by='count(*) desc', max_records=none, default=none, where=none) -%}\n {#-- Prevent querying of db in parsing mode. This works because this macro does not create any new refs. #}\n {%- if not execute -%}\n {% set default = [] if not default %}\n {{ return(default) }}\n {% endif %}\n\n {%- do dbt_utils._is_ephemeral(table, 'get_column_values') -%}\n\n {# Not all relations are tables. Renaming for internal clarity without breaking functionality for anyone using named arguments #}\n {# TODO: Change the method signature in a future 0.x.0 release #}\n {%- set target_relation = table -%}\n\n {# adapter.load_relation is a convenience wrapper to avoid building a Relation when we already have one #}\n {% set relation_exists = (load_relation(target_relation)) is not none %}\n\n {%- call statement('get_column_values', fetch_result=true) %}\n\n {%- if not relation_exists and default is none -%}\n\n {{ exceptions.raise_compiler_error(\"In get_column_values(): relation \" ~ target_relation ~ \" does not exist and no default value was provided.\") }}\n\n {%- elif not relation_exists and default is not none -%}\n\n {{ log(\"Relation \" ~ target_relation ~ \" does not exist. Returning the default value: \" ~ default) }}\n\n {{ return(default) }}\n\n {%- else -%}\n\n\n select\n {{ column }} as value\n\n from {{ target_relation }}\n\n {% if where is not none %}\n where {{ where }}\n {% endif %}\n\n group by {{ column }}\n order by {{ order_by }}\n\n {% if max_records is not none %}\n limit {{ max_records }}\n {% endif %}\n\n {% endif %}\n\n {%- endcall -%}\n\n {%- set value_list = load_result('get_column_values') -%}\n\n {%- if value_list and value_list['data'] -%}\n {%- set values = value_list['data'] | map(attribute=0) | list %}\n {{ return(values) }}\n {%- else -%}\n {{ return(default) }}\n {%- endif -%}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_utils._is_ephemeral", "macro.dbt.load_relation", "macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "table", "type": null, "description": ""}, {"name": "column", "type": null, "description": ""}, {"name": "order_by", "type": null, "description": ""}, {"name": "max_records", "type": null, "description": ""}, {"name": "default", "type": null, "description": ""}, {"name": "where", "type": null, "description": ""}], "created_at": 1789419970.144614, "supported_languages": null}, "macro.dbt_utils.star": {"name": "star", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/star.sql", "original_file_path": "macros/sql/star.sql", "unique_id": "macro.dbt_utils.star", "macro_sql": "{% macro star(from, relation_alias=False, except=[], prefix='', suffix='', quote_identifiers=True, unquote_aliases=False, rename={}) -%}\r\n {{ return(adapter.dispatch('star', 'dbt_utils')(from, relation_alias, except, prefix, suffix, quote_identifiers, unquote_aliases, rename)) }}\r\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__star"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "from", "type": null, "description": ""}, {"name": "relation_alias", "type": null, "description": ""}, {"name": "except", "type": null, "description": ""}, {"name": "prefix", "type": null, "description": ""}, {"name": "suffix", "type": null, "description": ""}, {"name": "quote_identifiers", "type": null, "description": ""}, {"name": "unquote_aliases", "type": null, "description": ""}, {"name": "rename", "type": null, "description": ""}], "created_at": 1789419970.1463027, "supported_languages": null}, "macro.dbt_utils.default__star": {"name": "default__star", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/star.sql", "original_file_path": "macros/sql/star.sql", "unique_id": "macro.dbt_utils.default__star", "macro_sql": "{% macro default__star(from, relation_alias=False, except=[], prefix='', suffix='', quote_identifiers=True, unquote_aliases=False, rename={}) -%}\r\n {%- do dbt_utils._is_relation(from, 'star') -%}\r\n {%- do dbt_utils._is_ephemeral(from, 'star') -%}\r\n\r\n {#-- Prevent querying of db in parsing mode. This works because this macro does not create any new refs. #}\r\n {%- if not execute -%}\r\n {% do return('*') %}\r\n {%- endif -%}\r\n\r\n {% set cols = dbt_utils.get_filtered_columns_in_relation(from, except) %}\r\n\r\n {%- set rename_lower = {} -%}\r\n {%- for key, val in rename.items() -%}\r\n {%- do rename_lower.update({key.lower(): val}) -%}\r\n {%- endfor -%}\r\n\r\n {%- if cols|length <= 0 -%}\r\n {% if flags.WHICH == 'compile' %}\r\n {% set response %}\r\n*\r\n/* No columns were returned. Maybe the relation doesn't exist yet\r\nor all columns were excluded. This star is only output during\r\ndbt compile, and exists to keep SQLFluff happy. */\r\n {% endset %}\r\n {% do return(response) %}\r\n {% else %}\r\n {% do return(\"/* no columns returned from star() macro */\") %}\r\n {% endif %}\r\n {%- else -%}\r\n {%- for col in cols %}\r\n {%- if relation_alias %}{{ relation_alias }}.{% else %}{%- endif -%}\r\n {%- if quote_identifiers -%}\r\n {{ adapter.quote(col)|trim }}\r\n {%- if col.lower() in rename_lower %} as {{ rename_lower[col.lower()] }}\r\n {%- elif unquote_aliases %} as {{ (prefix ~ col ~ suffix)|trim }}\r\n {%- elif prefix!='' or suffix!='' %} as {{ adapter.quote(prefix ~ col ~ suffix)|trim }}\r\n {%- endif -%}\r\n {%- else -%}\r\n {{ col|trim }}\r\n {%- if col.lower() in rename_lower %} as {{ rename_lower[col.lower()] }}\r\n {%- elif prefix!='' or suffix!='' %} as {{ (prefix ~ col ~ suffix)|trim }}\r\n {%- endif -%}\r\n {%- endif -%}\r\n {%- if not loop.last %},{{ '\\n ' }}{%- endif -%}\r\n {%- endfor -%}\r\n {% endif %}\r\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_utils._is_relation", "macro.dbt_utils._is_ephemeral", "macro.dbt_utils.get_filtered_columns_in_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "from", "type": null, "description": ""}, {"name": "relation_alias", "type": null, "description": ""}, {"name": "except", "type": null, "description": ""}, {"name": "prefix", "type": null, "description": ""}, {"name": "suffix", "type": null, "description": ""}, {"name": "quote_identifiers", "type": null, "description": ""}, {"name": "unquote_aliases", "type": null, "description": ""}, {"name": "rename", "type": null, "description": ""}], "created_at": 1789419970.1497917, "supported_languages": null}, "macro.dbt_utils.get_table_types_sql": {"name": "get_table_types_sql", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_table_types_sql.sql", "original_file_path": "macros/sql/get_table_types_sql.sql", "unique_id": "macro.dbt_utils.get_table_types_sql", "macro_sql": "{%- macro get_table_types_sql() -%}\n {{ return(adapter.dispatch('get_table_types_sql', 'dbt_utils')()) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt_utils.postgres__get_table_types_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789419970.1504443, "supported_languages": null}, "macro.dbt_utils.default__get_table_types_sql": {"name": "default__get_table_types_sql", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_table_types_sql.sql", "original_file_path": "macros/sql/get_table_types_sql.sql", "unique_id": "macro.dbt_utils.default__get_table_types_sql", "macro_sql": "{% macro default__get_table_types_sql() %}\n case table_type\n when 'BASE TABLE' then 'table'\n when 'EXTERNAL TABLE' then 'external'\n when 'MATERIALIZED VIEW' then 'materializedview'\n else lower(table_type)\n end as {{ adapter.quote('table_type') }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789419970.1507018, "supported_languages": null}, "macro.dbt_utils.postgres__get_table_types_sql": {"name": "postgres__get_table_types_sql", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_table_types_sql.sql", "original_file_path": "macros/sql/get_table_types_sql.sql", "unique_id": "macro.dbt_utils.postgres__get_table_types_sql", "macro_sql": "{% macro postgres__get_table_types_sql() %}\n case table_type\n when 'BASE TABLE' then 'table'\n when 'FOREIGN' then 'external'\n when 'MATERIALIZED VIEW' then 'materializedview'\n else lower(table_type)\n end as {{ adapter.quote('table_type') }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789419970.1509905, "supported_languages": null}, "macro.dbt_utils.databricks__get_table_types_sql": {"name": "databricks__get_table_types_sql", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_table_types_sql.sql", "original_file_path": "macros/sql/get_table_types_sql.sql", "unique_id": "macro.dbt_utils.databricks__get_table_types_sql", "macro_sql": "{% macro databricks__get_table_types_sql() %}\n case table_type\n when 'MANAGED' then 'table'\n when 'BASE TABLE' then 'table'\n when 'MATERIALIZED VIEW' then 'materializedview'\n else lower(table_type)\n end as {{ adapter.quote('table_type') }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789419970.151238, "supported_languages": null}, "macro.dbt_utils.get_tables_by_pattern_sql": {"name": "get_tables_by_pattern_sql", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_tables_by_pattern_sql.sql", "original_file_path": "macros/sql/get_tables_by_pattern_sql.sql", "unique_id": "macro.dbt_utils.get_tables_by_pattern_sql", "macro_sql": "{% macro get_tables_by_pattern_sql(schema_pattern, table_pattern, exclude='', database=target.database) %}\n {{ return(adapter.dispatch('get_tables_by_pattern_sql', 'dbt_utils')\n (schema_pattern, table_pattern, exclude, database)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__get_tables_by_pattern_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "schema_pattern", "type": null, "description": ""}, {"name": "table_pattern", "type": null, "description": ""}, {"name": "exclude", "type": null, "description": ""}, {"name": "database", "type": null, "description": ""}], "created_at": 1789419970.1526752, "supported_languages": null}, "macro.dbt_utils.default__get_tables_by_pattern_sql": {"name": "default__get_tables_by_pattern_sql", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_tables_by_pattern_sql.sql", "original_file_path": "macros/sql/get_tables_by_pattern_sql.sql", "unique_id": "macro.dbt_utils.default__get_tables_by_pattern_sql", "macro_sql": "{% macro default__get_tables_by_pattern_sql(schema_pattern, table_pattern, exclude='', database=target.database) %}\n\n select distinct\n table_schema as {{ adapter.quote('table_schema') }},\n table_name as {{ adapter.quote('table_name') }},\n {{ dbt_utils.get_table_types_sql() }}\n from {{ database }}.information_schema.tables\n where table_schema ilike '{{ schema_pattern }}'\n and table_name ilike '{{ table_pattern }}'\n and table_name not ilike '{{ exclude }}'\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.get_table_types_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "schema_pattern", "type": null, "description": ""}, {"name": "table_pattern", "type": null, "description": ""}, {"name": "exclude", "type": null, "description": ""}, {"name": "database", "type": null, "description": ""}], "created_at": 1789419970.1533122, "supported_languages": null}, "macro.dbt_utils.redshift__get_tables_by_pattern_sql": {"name": "redshift__get_tables_by_pattern_sql", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_tables_by_pattern_sql.sql", "original_file_path": "macros/sql/get_tables_by_pattern_sql.sql", "unique_id": "macro.dbt_utils.redshift__get_tables_by_pattern_sql", "macro_sql": "{% macro redshift__get_tables_by_pattern_sql(schema_pattern, table_pattern, exclude='', database=target.database) %}\n\n {% set sql %}\n select distinct\n table_schema as {{ adapter.quote('table_schema') }},\n table_name as {{ adapter.quote('table_name') }},\n {{ dbt_utils.get_table_types_sql() }}\n from \"{{ database }}\".\"information_schema\".\"tables\"\n where table_schema ilike '{{ schema_pattern }}'\n and table_name ilike '{{ table_pattern }}'\n and table_name not ilike '{{ exclude }}'\n union all\n select distinct\n schemaname as {{ adapter.quote('table_schema') }},\n tablename as {{ adapter.quote('table_name') }},\n 'external' as {{ adapter.quote('table_type') }}\n from svv_external_tables\n where redshift_database_name = '{{ database }}'\n and schemaname ilike '{{ schema_pattern }}'\n and table_name ilike '{{ table_pattern }}'\n and table_name not ilike '{{ exclude }}'\n {% endset %}\n\n {{ return(sql) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.get_table_types_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "schema_pattern", "type": null, "description": ""}, {"name": "table_pattern", "type": null, "description": ""}, {"name": "exclude", "type": null, "description": ""}, {"name": "database", "type": null, "description": ""}], "created_at": 1789419970.154469, "supported_languages": null}, "macro.dbt_utils.bigquery__get_tables_by_pattern_sql": {"name": "bigquery__get_tables_by_pattern_sql", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_tables_by_pattern_sql.sql", "original_file_path": "macros/sql/get_tables_by_pattern_sql.sql", "unique_id": "macro.dbt_utils.bigquery__get_tables_by_pattern_sql", "macro_sql": "{% macro bigquery__get_tables_by_pattern_sql(schema_pattern, table_pattern, exclude='', database=target.database) %}\n\n {% if '%' in schema_pattern %}\n {% set schemata=dbt_utils._bigquery__get_matching_schemata(schema_pattern, database) %}\n {% else %}\n {% set schemata=[schema_pattern] %}\n {% endif %}\n\n {% set sql %}\n {% for schema in schemata %}\n select distinct\n table_schema,\n table_name,\n {{ dbt_utils.get_table_types_sql() }}\n\n from {{ adapter.quote(database) }}.{{ schema }}.INFORMATION_SCHEMA.TABLES\n where lower(table_name) like lower ('{{ table_pattern }}')\n and lower(table_name) not like lower ('{{ exclude }}')\n\n {% if not loop.last %} union all {% endif %}\n\n {% endfor %}\n {% endset %}\n\n {{ return(sql) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils._bigquery__get_matching_schemata", "macro.dbt_utils.get_table_types_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "schema_pattern", "type": null, "description": ""}, {"name": "table_pattern", "type": null, "description": ""}, {"name": "exclude", "type": null, "description": ""}, {"name": "database", "type": null, "description": ""}], "created_at": 1789419970.1557012, "supported_languages": null}, "macro.dbt_utils._bigquery__get_matching_schemata": {"name": "_bigquery__get_matching_schemata", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_tables_by_pattern_sql.sql", "original_file_path": "macros/sql/get_tables_by_pattern_sql.sql", "unique_id": "macro.dbt_utils._bigquery__get_matching_schemata", "macro_sql": "{% macro _bigquery__get_matching_schemata(schema_pattern, database) %}\n {% if execute %}\n\n {% set sql %}\n select schema_name from {{ adapter.quote(database) }}.INFORMATION_SCHEMA.SCHEMATA\n where lower(schema_name) like lower('{{ schema_pattern }}')\n {% endset %}\n\n {% set results=run_query(sql) %}\n\n {% set schemata=results.columns['schema_name'].values() %}\n\n {{ return(schemata) }}\n\n {% else %}\n\n {{ return([]) }}\n\n {% endif %}\n\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "schema_pattern", "type": null, "description": ""}, {"name": "database", "type": null, "description": ""}], "created_at": 1789419970.1565714, "supported_languages": null}, "macro.dbt_utils.get_tables_by_prefix_sql": {"name": "get_tables_by_prefix_sql", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_tables_by_prefix_sql.sql", "original_file_path": "macros/sql/get_tables_by_prefix_sql.sql", "unique_id": "macro.dbt_utils.get_tables_by_prefix_sql", "macro_sql": "{% macro get_tables_by_prefix_sql(schema, prefix, exclude='', database=target.database) %}\n {{ return(adapter.dispatch('get_tables_by_prefix_sql', 'dbt_utils')(schema, prefix, exclude, database)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__get_tables_by_prefix_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "schema", "type": null, "description": ""}, {"name": "prefix", "type": null, "description": ""}, {"name": "exclude", "type": null, "description": ""}, {"name": "database", "type": null, "description": ""}], "created_at": 1789419970.157258, "supported_languages": null}, "macro.dbt_utils.default__get_tables_by_prefix_sql": {"name": "default__get_tables_by_prefix_sql", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_tables_by_prefix_sql.sql", "original_file_path": "macros/sql/get_tables_by_prefix_sql.sql", "unique_id": "macro.dbt_utils.default__get_tables_by_prefix_sql", "macro_sql": "{% macro default__get_tables_by_prefix_sql(schema, prefix, exclude='', database=target.database) %}\n\n {{ dbt_utils.get_tables_by_pattern_sql(\n schema_pattern = schema,\n table_pattern = prefix ~ '%',\n exclude = exclude,\n database = database\n ) }}\n \n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.get_tables_by_pattern_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "schema", "type": null, "description": ""}, {"name": "prefix", "type": null, "description": ""}, {"name": "exclude", "type": null, "description": ""}, {"name": "database", "type": null, "description": ""}], "created_at": 1789419970.157757, "supported_languages": null}, "macro.dbt_utils.degrees_to_radians": {"name": "degrees_to_radians", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/haversine_distance.sql", "original_file_path": "macros/sql/haversine_distance.sql", "unique_id": "macro.dbt_utils.degrees_to_radians", "macro_sql": "{% macro degrees_to_radians(degrees) -%}\n acos(-1) * {{degrees}} / 180\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "degrees", "type": null, "description": ""}], "created_at": 1789419970.1585302, "supported_languages": null}, "macro.dbt_utils.haversine_distance": {"name": "haversine_distance", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/haversine_distance.sql", "original_file_path": "macros/sql/haversine_distance.sql", "unique_id": "macro.dbt_utils.haversine_distance", "macro_sql": "{% macro haversine_distance(lat1, lon1, lat2, lon2, unit='mi') -%}\n {{ return(adapter.dispatch('haversine_distance', 'dbt_utils')(lat1,lon1,lat2,lon2,unit)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__haversine_distance"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "lat1", "type": null, "description": ""}, {"name": "lon1", "type": null, "description": ""}, {"name": "lat2", "type": null, "description": ""}, {"name": "lon2", "type": null, "description": ""}, {"name": "unit", "type": null, "description": ""}], "created_at": 1789419970.1590133, "supported_languages": null}, "macro.dbt_utils.default__haversine_distance": {"name": "default__haversine_distance", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/haversine_distance.sql", "original_file_path": "macros/sql/haversine_distance.sql", "unique_id": "macro.dbt_utils.default__haversine_distance", "macro_sql": "{% macro default__haversine_distance(lat1, lon1, lat2, lon2, unit='mi') -%}\n{%- if unit == 'mi' %}\n {% set conversion_rate = 1 %}\n{% elif unit == 'km' %}\n {% set conversion_rate = 1.60934 %}\n{% else %}\n {{ exceptions.raise_compiler_error(\"unit input must be one of 'mi' or 'km'. Got \" ~ unit) }}\n{% endif %}\n\n 2 * 3961 * asin(sqrt(power((sin(radians(({{ lat2 }} - {{ lat1 }}) / 2))), 2) +\n cos(radians({{lat1}})) * cos(radians({{lat2}})) *\n power((sin(radians(({{ lon2 }} - {{ lon1 }}) / 2))), 2))) * {{ conversion_rate }}\n\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "lat1", "type": null, "description": ""}, {"name": "lon1", "type": null, "description": ""}, {"name": "lat2", "type": null, "description": ""}, {"name": "lon2", "type": null, "description": ""}, {"name": "unit", "type": null, "description": ""}], "created_at": 1789419970.1601026, "supported_languages": null}, "macro.dbt_utils.bigquery__haversine_distance": {"name": "bigquery__haversine_distance", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/haversine_distance.sql", "original_file_path": "macros/sql/haversine_distance.sql", "unique_id": "macro.dbt_utils.bigquery__haversine_distance", "macro_sql": "{% macro bigquery__haversine_distance(lat1, lon1, lat2, lon2, unit='mi') -%}\n{% set radians_lat1 = dbt_utils.degrees_to_radians(lat1) %}\n{% set radians_lat2 = dbt_utils.degrees_to_radians(lat2) %}\n{% set radians_lon1 = dbt_utils.degrees_to_radians(lon1) %}\n{% set radians_lon2 = dbt_utils.degrees_to_radians(lon2) %}\n{%- if unit == 'mi' %}\n {% set conversion_rate = 1 %}\n{% elif unit == 'km' %}\n {% set conversion_rate = 1.60934 %}\n{% else %}\n {{ exceptions.raise_compiler_error(\"unit input must be one of 'mi' or 'km'. Got \" ~ unit) }}\n{% endif %}\n 2 * 3961 * asin(sqrt(power(sin(({{ radians_lat2 }} - {{ radians_lat1 }}) / 2), 2) +\n cos({{ radians_lat1 }}) * cos({{ radians_lat2 }}) *\n power(sin(({{ radians_lon2 }} - {{ radians_lon1 }}) / 2), 2))) * {{ conversion_rate }}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.degrees_to_radians"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "lat1", "type": null, "description": ""}, {"name": "lon1", "type": null, "description": ""}, {"name": "lat2", "type": null, "description": ""}, {"name": "lon2", "type": null, "description": ""}, {"name": "unit", "type": null, "description": ""}], "created_at": 1789419970.1616569, "supported_languages": null}, "macro.dbt_utils.get_powers_of_two": {"name": "get_powers_of_two", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/generate_series.sql", "original_file_path": "macros/sql/generate_series.sql", "unique_id": "macro.dbt_utils.get_powers_of_two", "macro_sql": "{% macro get_powers_of_two(upper_bound) %}\n {{ return(adapter.dispatch('get_powers_of_two', 'dbt_utils')(upper_bound)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__get_powers_of_two"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "upper_bound", "type": null, "description": ""}], "created_at": 1789419970.1633306, "supported_languages": null}, "macro.dbt_utils.default__get_powers_of_two": {"name": "default__get_powers_of_two", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/generate_series.sql", "original_file_path": "macros/sql/generate_series.sql", "unique_id": "macro.dbt_utils.default__get_powers_of_two", "macro_sql": "{% macro default__get_powers_of_two(upper_bound) %}\n\n {% if upper_bound <= 0 %}\n {{ exceptions.raise_compiler_error(\"upper bound must be positive\") }}\n {% endif %}\n\n {% for _ in range(1, 100) %}\n {% if upper_bound <= 2 ** loop.index %}{{ return(loop.index) }}{% endif %}\n {% endfor %}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "upper_bound", "type": null, "description": ""}], "created_at": 1789419970.16448, "supported_languages": null}, "macro.dbt_utils.generate_series": {"name": "generate_series", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/generate_series.sql", "original_file_path": "macros/sql/generate_series.sql", "unique_id": "macro.dbt_utils.generate_series", "macro_sql": "{% macro generate_series(upper_bound) %}\n {{ return(adapter.dispatch('generate_series', 'dbt_utils')(upper_bound)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__generate_series"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "upper_bound", "type": null, "description": ""}], "created_at": 1789419970.1648226, "supported_languages": null}, "macro.dbt_utils.default__generate_series": {"name": "default__generate_series", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/generate_series.sql", "original_file_path": "macros/sql/generate_series.sql", "unique_id": "macro.dbt_utils.default__generate_series", "macro_sql": "{% macro default__generate_series(upper_bound) %}\n\n {% set n = dbt_utils.get_powers_of_two(upper_bound) %}\n\n with p as (\n select 0 as generated_number union all select 1\n ), unioned as (\n\n select\n\n {% for i in range(n) %}\n p{{i}}.generated_number * power(2, {{i}})\n {% if not loop.last %} + {% endif %}\n {% endfor %}\n + 1\n as generated_number\n\n from\n\n {% for i in range(n) %}\n p as p{{i}}\n {% if not loop.last %} cross join {% endif %}\n {% endfor %}\n\n )\n\n select *\n from unioned\n where generated_number <= {{upper_bound}}\n order by generated_number\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.get_powers_of_two"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "upper_bound", "type": null, "description": ""}], "created_at": 1789419970.165868, "supported_languages": null}, "macro.dbt_utils.safe_subtract": {"name": "safe_subtract", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/safe_subtract.sql", "original_file_path": "macros/sql/safe_subtract.sql", "unique_id": "macro.dbt_utils.safe_subtract", "macro_sql": "{%- macro safe_subtract(field_list) -%}\n {{ return(adapter.dispatch('safe_subtract', 'dbt_utils')(field_list)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__safe_subtract"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field_list", "type": null, "description": ""}], "created_at": 1789419970.1664667, "supported_languages": null}, "macro.dbt_utils.default__safe_subtract": {"name": "default__safe_subtract", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/safe_subtract.sql", "original_file_path": "macros/sql/safe_subtract.sql", "unique_id": "macro.dbt_utils.default__safe_subtract", "macro_sql": "\n\n{%- macro default__safe_subtract(field_list) -%}\n\n{%- if field_list is not iterable or field_list is string or field_list is mapping -%}\n\n{%- set error_message = '\nWarning: the `safe_subtract` macro takes a single list argument instead of \\\nstring arguments. The {}.{} model triggered this warning. \\\n'.format(model.package_name, model.name) -%}\n\n{%- do exceptions.raise_compiler_error(error_message) -%}\n\n{%- endif -%}\n\n{% set fields = [] %}\n\n{%- for field in field_list -%}\n\n {% do fields.append(\"coalesce(\" ~ field ~ \", 0)\") %}\n\n{%- endfor -%}\n\n{{ fields|join(' -\\n ') }}\n\n{%- endmacro -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field_list", "type": null, "description": ""}], "created_at": 1789419970.1673956, "supported_languages": null}, "macro.dbt_utils.deduplicate": {"name": "deduplicate", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/deduplicate.sql", "original_file_path": "macros/sql/deduplicate.sql", "unique_id": "macro.dbt_utils.deduplicate", "macro_sql": "{%- macro deduplicate(relation, partition_by, order_by) -%}\n {{ return(adapter.dispatch('deduplicate', 'dbt_utils')(relation, partition_by, order_by)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.postgres__deduplicate"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "partition_by", "type": null, "description": ""}, {"name": "order_by", "type": null, "description": ""}], "created_at": 1789419970.1684108, "supported_languages": null}, "macro.dbt_utils.default__deduplicate": {"name": "default__deduplicate", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/deduplicate.sql", "original_file_path": "macros/sql/deduplicate.sql", "unique_id": "macro.dbt_utils.default__deduplicate", "macro_sql": "\n\n{%- macro default__deduplicate(relation, partition_by, order_by) -%}\n\n with row_numbered as (\n select\n _inner.*,\n row_number() over (\n partition by {{ partition_by }}\n order by {{ order_by }}\n ) as rn\n from {{ relation }} as _inner\n )\n\n select\n distinct data.*\n from {{ relation }} as data\n {#\n -- Not all DBs will support natural joins but the ones that do include:\n -- Oracle, MySQL, SQLite, Redshift, Teradata, Materialize, Databricks\n -- Apache Spark, SingleStore, Vertica\n -- Those that do not appear to support natural joins include:\n -- SQLServer, Trino, Presto, Rockset, Athena\n #}\n natural join row_numbered\n where row_numbered.rn = 1\n\n{%- endmacro -%}\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "partition_by", "type": null, "description": ""}, {"name": "order_by", "type": null, "description": ""}], "created_at": 1789419970.1688013, "supported_languages": null}, "macro.dbt_utils.redshift__deduplicate": {"name": "redshift__deduplicate", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/deduplicate.sql", "original_file_path": "macros/sql/deduplicate.sql", "unique_id": "macro.dbt_utils.redshift__deduplicate", "macro_sql": "{% macro redshift__deduplicate(relation, partition_by, order_by) -%}\n\n select *\n from {{ relation }} as tt\n qualify\n row_number() over (\n partition by {{ partition_by }}\n order by {{ order_by }}\n ) = 1\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "partition_by", "type": null, "description": ""}, {"name": "order_by", "type": null, "description": ""}], "created_at": 1789419970.1690912, "supported_languages": null}, "macro.dbt_utils.postgres__deduplicate": {"name": "postgres__deduplicate", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/deduplicate.sql", "original_file_path": "macros/sql/deduplicate.sql", "unique_id": "macro.dbt_utils.postgres__deduplicate", "macro_sql": "\n{%- macro postgres__deduplicate(relation, partition_by, order_by) -%}\n\n select\n distinct on ({{ partition_by }}) *\n from {{ relation }}\n order by {{ partition_by }}{{ ',' ~ order_by }}\n\n{%- endmacro -%}\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "partition_by", "type": null, "description": ""}, {"name": "order_by", "type": null, "description": ""}], "created_at": 1789419970.1694088, "supported_languages": null}, "macro.dbt_utils.snowflake__deduplicate": {"name": "snowflake__deduplicate", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/deduplicate.sql", "original_file_path": "macros/sql/deduplicate.sql", "unique_id": "macro.dbt_utils.snowflake__deduplicate", "macro_sql": "\n{%- macro snowflake__deduplicate(relation, partition_by, order_by) -%}\n\n select *\n from {{ relation }}\n qualify\n row_number() over (\n partition by {{ partition_by }}\n order by {{ order_by }}\n ) = 1\n\n{%- endmacro -%}\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "partition_by", "type": null, "description": ""}, {"name": "order_by", "type": null, "description": ""}], "created_at": 1789419970.1696918, "supported_languages": null}, "macro.dbt_utils.databricks__deduplicate": {"name": "databricks__deduplicate", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/deduplicate.sql", "original_file_path": "macros/sql/deduplicate.sql", "unique_id": "macro.dbt_utils.databricks__deduplicate", "macro_sql": "\n{%- macro databricks__deduplicate(relation, partition_by, order_by) -%}\n\n select *\n from {{ relation }}\n qualify\n row_number() over (\n partition by {{ partition_by }}\n order by {{ order_by }}\n ) = 1\n\n{%- endmacro -%}\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "partition_by", "type": null, "description": ""}, {"name": "order_by", "type": null, "description": ""}], "created_at": 1789419970.169992, "supported_languages": null}, "macro.dbt_utils.bigquery__deduplicate": {"name": "bigquery__deduplicate", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/deduplicate.sql", "original_file_path": "macros/sql/deduplicate.sql", "unique_id": "macro.dbt_utils.bigquery__deduplicate", "macro_sql": "\n{%- macro bigquery__deduplicate(relation, partition_by, order_by) -%}\n\n select unique.*\n from (\n select\n array_agg (\n original\n order by {{ order_by }}\n limit 1\n )[offset(0)] unique\n from {{ relation }} original\n group by {{ partition_by }}\n )\n\n{%- endmacro -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "partition_by", "type": null, "description": ""}, {"name": "order_by", "type": null, "description": ""}], "created_at": 1789419970.1702886, "supported_languages": null}, "macro.dbt_utils.generate_surrogate_key": {"name": "generate_surrogate_key", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/generate_surrogate_key.sql", "original_file_path": "macros/sql/generate_surrogate_key.sql", "unique_id": "macro.dbt_utils.generate_surrogate_key", "macro_sql": "{%- macro generate_surrogate_key(field_list) -%}\n {{ return(adapter.dispatch('generate_surrogate_key', 'dbt_utils')(field_list)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__generate_surrogate_key"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field_list", "type": null, "description": ""}], "created_at": 1789419970.1709435, "supported_languages": null}, "macro.dbt_utils.default__generate_surrogate_key": {"name": "default__generate_surrogate_key", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/generate_surrogate_key.sql", "original_file_path": "macros/sql/generate_surrogate_key.sql", "unique_id": "macro.dbt_utils.default__generate_surrogate_key", "macro_sql": "\n\n{%- macro default__generate_surrogate_key(field_list) -%}\n\n{%- if var('surrogate_key_treat_nulls_as_empty_strings', False) -%}\n {%- set default_null_value = \"\" -%}\n{%- else -%}\n {%- set default_null_value = '_dbt_utils_surrogate_key_null_' -%}\n{%- endif -%}\n\n{%- set fields = [] -%}\n\n{%- for field in field_list -%}\n\n {%- do fields.append(\n \"coalesce(cast(\" ~ field ~ \" as \" ~ dbt.type_string() ~ \"), '\" ~ default_null_value ~\"')\"\n ) -%}\n\n {%- if not loop.last %}\n {%- do fields.append(\"'-'\") -%}\n {%- endif -%}\n\n{%- endfor -%}\n\n{{ dbt.hash(dbt.concat(fields)) }}\n\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt.type_string", "macro.dbt.hash", "macro.dbt.concat"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field_list", "type": null, "description": ""}], "created_at": 1789419970.17226, "supported_languages": null}, "macro.dbt_utils.pivot": {"name": "pivot", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/pivot.sql", "original_file_path": "macros/sql/pivot.sql", "unique_id": "macro.dbt_utils.pivot", "macro_sql": "{% macro pivot(column,\n values,\n alias=True,\n agg='sum',\n cmp='=',\n prefix='',\n suffix='',\n then_value=1,\n else_value=0,\n quote_identifiers=True,\n distinct=False) %}\n {{ return(adapter.dispatch('pivot', 'dbt_utils')(column, values, alias, agg, cmp, prefix, suffix, then_value, else_value, quote_identifiers, distinct)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__pivot"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "column", "type": null, "description": ""}, {"name": "values", "type": null, "description": ""}, {"name": "alias", "type": null, "description": ""}, {"name": "agg", "type": null, "description": ""}, {"name": "cmp", "type": null, "description": ""}, {"name": "prefix", "type": null, "description": ""}, {"name": "suffix", "type": null, "description": ""}, {"name": "then_value", "type": null, "description": ""}, {"name": "else_value", "type": null, "description": ""}, {"name": "quote_identifiers", "type": null, "description": ""}, {"name": "distinct", "type": null, "description": ""}], "created_at": 1789419970.1736946, "supported_languages": null}, "macro.dbt_utils.default__pivot": {"name": "default__pivot", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/pivot.sql", "original_file_path": "macros/sql/pivot.sql", "unique_id": "macro.dbt_utils.default__pivot", "macro_sql": "{% macro default__pivot(column,\n values,\n alias=True,\n agg='sum',\n cmp='=',\n prefix='',\n suffix='',\n then_value=1,\n else_value=0,\n quote_identifiers=True,\n distinct=False) %}\n {% for value in values %}\n {{ agg }}(\n {% if distinct %} distinct {% endif %}\n case\n when {{ column }} {{ cmp }} '{{ dbt.escape_single_quotes(value) }}'\n then {{ then_value }}\n else {{ else_value }}\n end\n )\n {% if alias %}\n {% if quote_identifiers %}\n as {{ adapter.quote(prefix ~ value ~ suffix) }}\n {% else %}\n as {{ dbt_utils.slugify(prefix ~ value ~ suffix) }}\n {% endif %}\n {% endif %}\n {% if not loop.last %},{% endif %}\n {% endfor %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.escape_single_quotes", "macro.dbt_utils.slugify"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "column", "type": null, "description": ""}, {"name": "values", "type": null, "description": ""}, {"name": "alias", "type": null, "description": ""}, {"name": "agg", "type": null, "description": ""}, {"name": "cmp", "type": null, "description": ""}, {"name": "prefix", "type": null, "description": ""}, {"name": "suffix", "type": null, "description": ""}, {"name": "then_value", "type": null, "description": ""}, {"name": "else_value", "type": null, "description": ""}, {"name": "quote_identifiers", "type": null, "description": ""}, {"name": "distinct", "type": null, "description": ""}], "created_at": 1789419970.1751275, "supported_languages": null}, "macro.dbt_utils.nullcheck_table": {"name": "nullcheck_table", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/nullcheck_table.sql", "original_file_path": "macros/sql/nullcheck_table.sql", "unique_id": "macro.dbt_utils.nullcheck_table", "macro_sql": "{% macro nullcheck_table(relation) %}\n {{ return(adapter.dispatch('nullcheck_table', 'dbt_utils')(relation)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__nullcheck_table"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789419970.1756542, "supported_languages": null}, "macro.dbt_utils.default__nullcheck_table": {"name": "default__nullcheck_table", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/nullcheck_table.sql", "original_file_path": "macros/sql/nullcheck_table.sql", "unique_id": "macro.dbt_utils.default__nullcheck_table", "macro_sql": "{% macro default__nullcheck_table(relation) %}\n\n {%- do dbt_utils._is_relation(relation, 'nullcheck_table') -%}\n {%- do dbt_utils._is_ephemeral(relation, 'nullcheck_table') -%}\n {% set cols = adapter.get_columns_in_relation(relation) %}\n\n select {{ dbt_utils.nullcheck(cols) }}\n from {{relation}}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils._is_relation", "macro.dbt_utils._is_ephemeral", "macro.dbt_utils.nullcheck"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789419970.1762486, "supported_languages": null}, "macro.dbt_utils.get_relations_by_pattern": {"name": "get_relations_by_pattern", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_relations_by_pattern.sql", "original_file_path": "macros/sql/get_relations_by_pattern.sql", "unique_id": "macro.dbt_utils.get_relations_by_pattern", "macro_sql": "{% macro get_relations_by_pattern(schema_pattern, table_pattern, exclude='', database=target.database) %}\n {{ return(adapter.dispatch('get_relations_by_pattern', 'dbt_utils')(schema_pattern, table_pattern, exclude, database)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__get_relations_by_pattern"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "schema_pattern", "type": null, "description": ""}, {"name": "table_pattern", "type": null, "description": ""}, {"name": "exclude", "type": null, "description": ""}, {"name": "database", "type": null, "description": ""}], "created_at": 1789419970.177084, "supported_languages": null}, "macro.dbt_utils.default__get_relations_by_pattern": {"name": "default__get_relations_by_pattern", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_relations_by_pattern.sql", "original_file_path": "macros/sql/get_relations_by_pattern.sql", "unique_id": "macro.dbt_utils.default__get_relations_by_pattern", "macro_sql": "{% macro default__get_relations_by_pattern(schema_pattern, table_pattern, exclude='', database=target.database) %}\n\n {%- call statement('get_tables', fetch_result=True) %}\n\n {{ dbt_utils.get_tables_by_pattern_sql(schema_pattern, table_pattern, exclude, database) }}\n\n {%- endcall -%}\n\n {%- set table_list = load_result('get_tables') -%}\n\n {%- if table_list and table_list['table'] -%}\n {%- set tbl_relations = [] -%}\n {%- for row in table_list['table'] -%}\n {%- set tbl_relation = api.Relation.create(\n database=database,\n schema=row.table_schema,\n identifier=row.table_name,\n type=row.table_type\n ) -%}\n {%- do tbl_relations.append(tbl_relation) -%}\n {%- endfor -%}\n\n {{ return(tbl_relations) }}\n {%- else -%}\n {{ return([]) }}\n {%- endif -%}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement", "macro.dbt_utils.get_tables_by_pattern_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "schema_pattern", "type": null, "description": ""}, {"name": "table_pattern", "type": null, "description": ""}, {"name": "exclude", "type": null, "description": ""}, {"name": "database", "type": null, "description": ""}], "created_at": 1789419970.1785138, "supported_languages": null}, "macro.dbt_utils.get_query_results_as_dict": {"name": "get_query_results_as_dict", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_query_results_as_dict.sql", "original_file_path": "macros/sql/get_query_results_as_dict.sql", "unique_id": "macro.dbt_utils.get_query_results_as_dict", "macro_sql": "{% macro get_query_results_as_dict(query) %}\n {{ return(adapter.dispatch('get_query_results_as_dict', 'dbt_utils')(query)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__get_query_results_as_dict"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "query", "type": null, "description": ""}], "created_at": 1789419970.1791317, "supported_languages": null}, "macro.dbt_utils.default__get_query_results_as_dict": {"name": "default__get_query_results_as_dict", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_query_results_as_dict.sql", "original_file_path": "macros/sql/get_query_results_as_dict.sql", "unique_id": "macro.dbt_utils.default__get_query_results_as_dict", "macro_sql": "{% macro default__get_query_results_as_dict(query) %}\n\n{# This macro returns a dictionary of the form {column_name: (tuple_of_results)} #}\n\n {%- call statement('get_query_results', fetch_result=True,auto_begin=false) -%}\n\n {{ query }}\n\n {%- endcall -%}\n\n {% set sql_results={} %}\n\n {%- if execute -%}\n {% set sql_results_table = load_result('get_query_results').table.columns %}\n {% for column_name, column in sql_results_table.items() %}\n {% do sql_results.update({column_name: column.values()}) %}\n {% endfor %}\n {%- endif -%}\n\n {{ return(sql_results) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "query", "type": null, "description": ""}], "created_at": 1789419970.1801202, "supported_languages": null}, "macro.dbt_utils.union_relations": {"name": "union_relations", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/union.sql", "original_file_path": "macros/sql/union.sql", "unique_id": "macro.dbt_utils.union_relations", "macro_sql": "{%- macro union_relations(relations, column_override=none, include=[], exclude=[], source_column_name='_dbt_source_relation', where=none) -%}\n {{ return(adapter.dispatch('union_relations', 'dbt_utils')(relations, column_override, include, exclude, source_column_name, where)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__union_relations"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relations", "type": null, "description": ""}, {"name": "column_override", "type": null, "description": ""}, {"name": "include", "type": null, "description": ""}, {"name": "exclude", "type": null, "description": ""}, {"name": "source_column_name", "type": null, "description": ""}, {"name": "where", "type": null, "description": ""}], "created_at": 1789419970.1820025, "supported_languages": null}, "macro.dbt_utils.default__union_relations": {"name": "default__union_relations", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/union.sql", "original_file_path": "macros/sql/union.sql", "unique_id": "macro.dbt_utils.default__union_relations", "macro_sql": "\n\n{%- macro default__union_relations(relations, column_override=none, include=[], exclude=[], source_column_name='_dbt_source_relation', where=none) -%}\n\n {%- if exclude and include -%}\n {{ exceptions.raise_compiler_error(\"Both an exclude and include list were provided to the `union` macro. Only one is allowed\") }}\n {%- endif -%}\n\n {#-- Prevent querying of db in parsing mode. This works because this macro does not create any new refs. -#}\n {%- if not execute %}\n {{ return('') }}\n {% endif -%}\n\n {%- set column_override = column_override if column_override is not none else {} -%}\n\n {%- set relation_columns = {} -%}\n {%- set column_superset = {} -%}\n {%- set all_excludes = [] -%}\n {%- set all_includes = [] -%}\n\n {%- if exclude -%}\n {%- for exc in exclude -%}\n {%- do all_excludes.append(exc | lower) -%}\n {%- endfor -%}\n {%- endif -%}\n\n {%- if include -%}\n {%- for inc in include -%}\n {%- do all_includes.append(inc | lower) -%}\n {%- endfor -%}\n {%- endif -%}\n\n {%- for relation in relations -%}\n\n {%- do relation_columns.update({relation: []}) -%}\n\n {%- do dbt_utils._is_relation(relation, 'union_relations') -%}\n {%- do dbt_utils._is_ephemeral(relation, 'union_relations') -%}\n {%- set cols = adapter.get_columns_in_relation(relation) -%}\n {%- for col in cols -%}\n\n {#- If an exclude list was provided and the column is in the list, do nothing -#}\n {%- if exclude and col.column | lower in all_excludes -%}\n\n {#- If an include list was provided and the column is not in the list, do nothing -#}\n {%- elif include and col.column | lower not in all_includes -%}\n\n {#- Otherwise add the column to the column superset -#}\n {%- else -%}\n\n {#- update the list of columns in this relation -#}\n {%- do relation_columns[relation].append(col.column) -%}\n\n {%- if col.column in column_superset -%}\n\n {%- set stored = column_superset[col.column] -%}\n {%- if col.is_string() and stored.is_string() and col.string_size() > stored.string_size() -%}\n\n {%- do column_superset.update({col.column: col}) -%}\n\n {%- endif %}\n\n {%- else -%}\n\n {%- do column_superset.update({col.column: col}) -%}\n\n {%- endif -%}\n\n {%- endif -%}\n\n {%- endfor -%}\n {%- endfor -%}\n\n {%- set ordered_column_names = column_superset.keys() -%}\n {%- set dbt_command = flags.WHICH -%}\n\n\n {% if dbt_command in ['run', 'build'] %}\n {% if (include | length > 0 or exclude | length > 0) and not column_superset.keys() %}\n {%- set relations_string -%}\n {%- for relation in relations -%}\n {{ relation.name }}\n {%- if not loop.last %}, {% endif -%}\n {%- endfor -%}\n {%- endset -%}\n\n {%- set error_message -%}\n There were no columns found to union for relations {{ relations_string }}\n {%- endset -%}\n\n {{ exceptions.raise_compiler_error(error_message) }}\n {%- endif -%}\n {%- endif -%}\n\n {%- for relation in relations %}\n\n (\n select\n\n {%- if source_column_name is not none %}\n cast({{ dbt.string_literal(relation.render()) }} as {{ dbt.type_string() }}) as {{ source_column_name }},\n {%- endif %}\n\n /* No columns from any of the relations.\n This star is only output during dbt compile, and exists to keep SQLFluff happy. */\n {% if dbt_command == 'compile' and ordered_column_names|length == 0 %}\n *\n {% endif %}\n\n {% for col_name in ordered_column_names -%}\n\n {%- set col = column_superset[col_name] %}\n {%- set col_type = column_override.get(col.column, col.data_type) %}\n {%- set col_name = adapter.quote(col_name) if col_name in relation_columns[relation] else 'null' %}\n cast({{ col_name }} as {{ col_type }}) as {{ col.quoted }} {% if not loop.last %},{% endif -%}\n\n {%- endfor %}\n\n from {{ relation }}\n\n {% if where -%}\n where {{ where }}\n {%- endif %}\n )\n\n {% if not loop.last -%}\n union all\n {% endif -%}\n\n {%- endfor -%}\n\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt_utils._is_relation", "macro.dbt_utils._is_ephemeral", "macro.dbt.string_literal", "macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relations", "type": null, "description": ""}, {"name": "column_override", "type": null, "description": ""}, {"name": "include", "type": null, "description": ""}, {"name": "exclude", "type": null, "description": ""}, {"name": "source_column_name", "type": null, "description": ""}, {"name": "where", "type": null, "description": ""}], "created_at": 1789419970.1880152, "supported_languages": null}, "macro.dbt_utils.unpivot": {"name": "unpivot", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/unpivot.sql", "original_file_path": "macros/sql/unpivot.sql", "unique_id": "macro.dbt_utils.unpivot", "macro_sql": "{% macro unpivot(relation=none, cast_to='varchar', exclude=none, remove=none, field_name='field_name', value_name='value', quote_identifiers=False) -%}\n {{ return(adapter.dispatch('unpivot', 'dbt_utils')(relation, cast_to, exclude, remove, field_name, value_name, quote_identifiers)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__unpivot"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "cast_to", "type": null, "description": ""}, {"name": "exclude", "type": null, "description": ""}, {"name": "remove", "type": null, "description": ""}, {"name": "field_name", "type": null, "description": ""}, {"name": "value_name", "type": null, "description": ""}, {"name": "quote_identifiers", "type": null, "description": ""}], "created_at": 1789419970.189446, "supported_languages": null}, "macro.dbt_utils.default__unpivot": {"name": "default__unpivot", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/unpivot.sql", "original_file_path": "macros/sql/unpivot.sql", "unique_id": "macro.dbt_utils.default__unpivot", "macro_sql": "{% macro default__unpivot(relation=none, cast_to='varchar', exclude=none, remove=none, field_name='field_name', value_name='value', quote_identifiers=False) -%}\n\n {% if not relation %}\n {{ exceptions.raise_compiler_error(\"Error: argument `relation` is required for `unpivot` macro.\") }}\n {% endif %}\n\n {%- set exclude = exclude if exclude is not none else [] %}\n {%- set remove = remove if remove is not none else [] %}\n\n {%- set include_cols = [] %}\n\n {%- set table_columns = {} %}\n\n {%- do table_columns.update({relation: []}) %}\n\n {%- do dbt_utils._is_relation(relation, 'unpivot') -%}\n {%- do dbt_utils._is_ephemeral(relation, 'unpivot') -%}\n {%- set cols = adapter.get_columns_in_relation(relation) %}\n\n {%- for col in cols -%}\n {%- if col.column.lower() not in remove|map('lower') and col.column.lower() not in exclude|map('lower') -%}\n {% do include_cols.append(col) %}\n {%- endif %}\n {%- endfor %}\n\n\n {%- for col in include_cols -%}\n {%- set current_col_name = adapter.quote(col.column) if quote_identifiers else col.column -%}\n select\n {%- for exclude_col in exclude %}\n {{ adapter.quote(exclude_col) if quote_identifiers else exclude_col }},\n {%- endfor %}\n\n cast('{{ col.column }}' as {{ dbt.type_string() }}) as {{ adapter.quote(field_name) if quote_identifiers else field_name }},\n cast( {% if col.data_type == 'boolean' %}\n {{ dbt.cast_bool_to_text(current_col_name) }}\n {% else %}\n {{ current_col_name }}\n {% endif %}\n as {{ cast_to }}) as {{ adapter.quote(value_name) if quote_identifiers else value_name }}\n\n from {{ relation }}\n\n {% if not loop.last -%}\n union all\n {% endif -%}\n {%- endfor -%}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_utils._is_relation", "macro.dbt_utils._is_ephemeral", "macro.dbt.type_string", "macro.dbt.cast_bool_to_text"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "cast_to", "type": null, "description": ""}, {"name": "exclude", "type": null, "description": ""}, {"name": "remove", "type": null, "description": ""}, {"name": "field_name", "type": null, "description": ""}, {"name": "value_name", "type": null, "description": ""}, {"name": "quote_identifiers", "type": null, "description": ""}], "created_at": 1789419970.1925266, "supported_languages": null}, "macro.dbt_utils.nullcheck": {"name": "nullcheck", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/nullcheck.sql", "original_file_path": "macros/sql/nullcheck.sql", "unique_id": "macro.dbt_utils.nullcheck", "macro_sql": "{% macro nullcheck(cols) %}\n {{ return(adapter.dispatch('nullcheck', 'dbt_utils')(cols)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__nullcheck"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "cols", "type": null, "description": ""}], "created_at": 1789419970.1931334, "supported_languages": null}, "macro.dbt_utils.default__nullcheck": {"name": "default__nullcheck", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/nullcheck.sql", "original_file_path": "macros/sql/nullcheck.sql", "unique_id": "macro.dbt_utils.default__nullcheck", "macro_sql": "{% macro default__nullcheck(cols) %}\n{%- for col in cols %}\n\n {% if col.is_string() -%}\n\n nullif({{col.name}},'') as {{col.name}}\n\n {%- else -%}\n\n {{col.name}}\n\n {%- endif -%}\n\n{%- if not loop.last -%} , {%- endif -%}\n\n{%- endfor -%}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "cols", "type": null, "description": ""}], "created_at": 1789419970.1936965, "supported_languages": null}, "macro.dbt_utils.get_intervals_between": {"name": "get_intervals_between", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/date_spine.sql", "original_file_path": "macros/sql/date_spine.sql", "unique_id": "macro.dbt_utils.get_intervals_between", "macro_sql": "{% macro get_intervals_between(start_date, end_date, datepart) -%}\n {{ return(adapter.dispatch('get_intervals_between', 'dbt_utils')(start_date, end_date, datepart)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__get_intervals_between"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "start_date", "type": null, "description": ""}, {"name": "end_date", "type": null, "description": ""}, {"name": "datepart", "type": null, "description": ""}], "created_at": 1789419970.1945612, "supported_languages": null}, "macro.dbt_utils.default__get_intervals_between": {"name": "default__get_intervals_between", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/date_spine.sql", "original_file_path": "macros/sql/date_spine.sql", "unique_id": "macro.dbt_utils.default__get_intervals_between", "macro_sql": "{% macro default__get_intervals_between(start_date, end_date, datepart) -%}\n {%- call statement('get_intervals_between', fetch_result=True) %}\n\n select {{ dbt.datediff(start_date, end_date, datepart) }}\n\n {%- endcall -%}\n\n {%- set value_list = load_result('get_intervals_between') -%}\n\n {%- if value_list and value_list['data'] -%}\n {%- set values = value_list['data'] | map(attribute=0) | list %}\n {{ return(values[0]) }}\n {%- else -%}\n {{ return(1) }}\n {%- endif -%}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.statement", "macro.dbt.datediff"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "start_date", "type": null, "description": ""}, {"name": "end_date", "type": null, "description": ""}, {"name": "datepart", "type": null, "description": ""}], "created_at": 1789419970.1956027, "supported_languages": null}, "macro.dbt_utils.date_spine": {"name": "date_spine", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/date_spine.sql", "original_file_path": "macros/sql/date_spine.sql", "unique_id": "macro.dbt_utils.date_spine", "macro_sql": "{% macro date_spine(datepart, start_date, end_date) %}\n {{ return(adapter.dispatch('date_spine', 'dbt_utils')(datepart, start_date, end_date)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__date_spine"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "datepart", "type": null, "description": ""}, {"name": "start_date", "type": null, "description": ""}, {"name": "end_date", "type": null, "description": ""}], "created_at": 1789419970.1960735, "supported_languages": null}, "macro.dbt_utils.default__date_spine": {"name": "default__date_spine", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/date_spine.sql", "original_file_path": "macros/sql/date_spine.sql", "unique_id": "macro.dbt_utils.default__date_spine", "macro_sql": "{% macro default__date_spine(datepart, start_date, end_date) %}\n\n\n{# call as follows:\n\ndate_spine(\n \"day\",\n \"to_date('01/01/2016', 'mm/dd/yyyy')\",\n \"dbt.dateadd(week, 1, current_date)\"\n) #}\n\n\nwith rawdata as (\n\n {{dbt_utils.generate_series(\n dbt_utils.get_intervals_between(start_date, end_date, datepart)\n )}}\n\n),\n\nall_periods as (\n\n select (\n {{\n dbt.dateadd(\n datepart,\n \"row_number() over (order by generated_number) - 1\",\n start_date\n )\n }}\n ) as date_{{datepart}}\n from rawdata\n\n),\n\nfiltered as (\n\n select *\n from all_periods\n where date_{{datepart}} <= {{ end_date }}\n\n)\n\nselect * from filtered\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.generate_series", "macro.dbt_utils.get_intervals_between", "macro.dbt.dateadd"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "datepart", "type": null, "description": ""}, {"name": "start_date", "type": null, "description": ""}, {"name": "end_date", "type": null, "description": ""}], "created_at": 1789419970.1966858, "supported_languages": null}, "macro.dbt_utils.get_filtered_columns_in_relation": {"name": "get_filtered_columns_in_relation", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_filtered_columns_in_relation.sql", "original_file_path": "macros/sql/get_filtered_columns_in_relation.sql", "unique_id": "macro.dbt_utils.get_filtered_columns_in_relation", "macro_sql": "{% macro get_filtered_columns_in_relation(from, except=[]) -%}\n {{ return(adapter.dispatch('get_filtered_columns_in_relation', 'dbt_utils')(from, except)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__get_filtered_columns_in_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "from", "type": null, "description": ""}, {"name": "except", "type": null, "description": ""}], "created_at": 1789419970.1975007, "supported_languages": null}, "macro.dbt_utils.default__get_filtered_columns_in_relation": {"name": "default__get_filtered_columns_in_relation", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_filtered_columns_in_relation.sql", "original_file_path": "macros/sql/get_filtered_columns_in_relation.sql", "unique_id": "macro.dbt_utils.default__get_filtered_columns_in_relation", "macro_sql": "{% macro default__get_filtered_columns_in_relation(from, except=[]) -%}\n {%- do dbt_utils._is_relation(from, 'get_filtered_columns_in_relation') -%}\n {%- do dbt_utils._is_ephemeral(from, 'get_filtered_columns_in_relation') -%}\n\n {# -- Prevent querying of db in parsing mode. This works because this macro does not create any new refs. #}\n {%- if not execute -%}\n {{ return([]) }}\n {% endif %}\n\n {%- set include_cols = [] %}\n {%- set cols = adapter.get_columns_in_relation(from) -%}\n {%- set except = except | map(\"lower\") | list %}\n {%- for col in cols -%}\n {%- if col.column|lower not in except -%}\n {% do include_cols.append(col.column) %}\n {%- endif %}\n {%- endfor %}\n\n {{ return(include_cols) }}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_utils._is_relation", "macro.dbt_utils._is_ephemeral"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "from", "type": null, "description": ""}, {"name": "except", "type": null, "description": ""}], "created_at": 1789419970.1987174, "supported_languages": null}, "macro.dbt_utils.surrogate_key": {"name": "surrogate_key", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/surrogate_key.sql", "original_file_path": "macros/sql/surrogate_key.sql", "unique_id": "macro.dbt_utils.surrogate_key", "macro_sql": "{%- macro surrogate_key(field_list) -%}\n {% set frustrating_jinja_feature = varargs %}\n {{ return(adapter.dispatch('surrogate_key', 'dbt_utils')(field_list, *varargs)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__surrogate_key"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field_list", "type": null, "description": ""}], "created_at": 1789419970.1993313, "supported_languages": null}, "macro.dbt_utils.default__surrogate_key": {"name": "default__surrogate_key", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/surrogate_key.sql", "original_file_path": "macros/sql/surrogate_key.sql", "unique_id": "macro.dbt_utils.default__surrogate_key", "macro_sql": "\n\n{%- macro default__surrogate_key(field_list) -%}\n\n{%- set error_message = '\nWarning: `dbt_utils.surrogate_key` has been replaced by \\\n`dbt_utils.generate_surrogate_key`. The new macro treats null values \\\ndifferently to empty strings. To restore the behaviour of the original \\\nmacro, add a global variable in dbt_project.yml called \\\n`surrogate_key_treat_nulls_as_empty_strings` to your \\\ndbt_project.yml file with a value of True. \\\nThe {}.{} model triggered this warning. \\\n'.format(model.package_name, model.name) -%}\n\n{%- do exceptions.raise_compiler_error(error_message) -%}\n\n{%- endmacro -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field_list", "type": null, "description": ""}], "created_at": 1789419970.1997309, "supported_languages": null}, "macro.dbt_utils.get_single_value": {"name": "get_single_value", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_single_value.sql", "original_file_path": "macros/sql/get_single_value.sql", "unique_id": "macro.dbt_utils.get_single_value", "macro_sql": "{% macro get_single_value(query, default=none) %}\n {{ return(adapter.dispatch('get_single_value', 'dbt_utils')(query, default)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__get_single_value"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "query", "type": null, "description": ""}, {"name": "default", "type": null, "description": ""}], "created_at": 1789419970.2004452, "supported_languages": null}, "macro.dbt_utils.default__get_single_value": {"name": "default__get_single_value", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_single_value.sql", "original_file_path": "macros/sql/get_single_value.sql", "unique_id": "macro.dbt_utils.default__get_single_value", "macro_sql": "{% macro default__get_single_value(query, default) %}\n\n{# This macro returns the (0, 0) record in a query, i.e. the first row of the first column #}\n\n {%- call statement('get_query_result', fetch_result=True, auto_begin=false) -%}\n\n {{ query }}\n\n {%- endcall -%}\n\n {%- if execute -%}\n\n {% set r = load_result('get_query_result').table.columns[0].values() %}\n {% if r | length == 0 %}\n {% do print('Query `' ~ query ~ '` returned no rows. Using the default value: ' ~ default) %}\n {% set sql_result = default %}\n {% else %}\n {% set sql_result = r[0] %}\n {% endif %}\n \n {%- else -%}\n \n {% set sql_result = default %}\n \n {%- endif -%}\n\n {% do return(sql_result) %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "query", "type": null, "description": ""}, {"name": "default", "type": null, "description": ""}], "created_at": 1789419970.201815, "supported_languages": null}, "macro.dbt_utils.width_bucket": {"name": "width_bucket", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/width_bucket.sql", "original_file_path": "macros/sql/width_bucket.sql", "unique_id": "macro.dbt_utils.width_bucket", "macro_sql": "{% macro width_bucket(expr, min_value, max_value, num_buckets) %}\n {{ return(adapter.dispatch('width_bucket', 'dbt_utils') (expr, min_value, max_value, num_buckets)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__width_bucket"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "expr", "type": null, "description": ""}, {"name": "min_value", "type": null, "description": ""}, {"name": "max_value", "type": null, "description": ""}, {"name": "num_buckets", "type": null, "description": ""}], "created_at": 1789419970.2025871, "supported_languages": null}, "macro.dbt_utils.default__width_bucket": {"name": "default__width_bucket", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/width_bucket.sql", "original_file_path": "macros/sql/width_bucket.sql", "unique_id": "macro.dbt_utils.default__width_bucket", "macro_sql": "{% macro default__width_bucket(expr, min_value, max_value, num_buckets) -%}\n\n {% set bin_size -%}\n (( {{ max_value }} - {{ min_value }} ) / {{ num_buckets }} )\n {%- endset %}\n (\n -- to break ties when the amount is eaxtly at the bucket egde\n case\n when\n mod(\n {{ dbt.safe_cast(expr, dbt.type_numeric() ) }},\n {{ dbt.safe_cast(bin_size, dbt.type_numeric() ) }}\n ) = 0\n then 1\n else 0\n end\n ) +\n -- Anything over max_value goes the N+1 bucket\n least(\n ceil(\n ({{ expr }} - {{ min_value }})/{{ bin_size }}\n ),\n {{ num_buckets }} + 1\n )\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.safe_cast", "macro.dbt.type_numeric"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "expr", "type": null, "description": ""}, {"name": "min_value", "type": null, "description": ""}, {"name": "max_value", "type": null, "description": ""}, {"name": "num_buckets", "type": null, "description": ""}], "created_at": 1789419970.2033854, "supported_languages": null}, "macro.dbt_utils.snowflake__width_bucket": {"name": "snowflake__width_bucket", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/width_bucket.sql", "original_file_path": "macros/sql/width_bucket.sql", "unique_id": "macro.dbt_utils.snowflake__width_bucket", "macro_sql": "{% macro snowflake__width_bucket(expr, min_value, max_value, num_buckets) %}\n width_bucket({{ expr }}, {{ min_value }}, {{ max_value }}, {{ num_buckets }} )\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "expr", "type": null, "description": ""}, {"name": "min_value", "type": null, "description": ""}, {"name": "max_value", "type": null, "description": ""}, {"name": "num_buckets", "type": null, "description": ""}], "created_at": 1789419970.2037158, "supported_languages": null}, "macro.dbt_utils.get_relations_by_prefix": {"name": "get_relations_by_prefix", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_relations_by_prefix.sql", "original_file_path": "macros/sql/get_relations_by_prefix.sql", "unique_id": "macro.dbt_utils.get_relations_by_prefix", "macro_sql": "{% macro get_relations_by_prefix(schema, prefix, exclude='', database=target.database) %}\n {{ return(adapter.dispatch('get_relations_by_prefix', 'dbt_utils')(schema, prefix, exclude, database)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__get_relations_by_prefix"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "schema", "type": null, "description": ""}, {"name": "prefix", "type": null, "description": ""}, {"name": "exclude", "type": null, "description": ""}, {"name": "database", "type": null, "description": ""}], "created_at": 1789419970.2045453, "supported_languages": null}, "macro.dbt_utils.default__get_relations_by_prefix": {"name": "default__get_relations_by_prefix", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_relations_by_prefix.sql", "original_file_path": "macros/sql/get_relations_by_prefix.sql", "unique_id": "macro.dbt_utils.default__get_relations_by_prefix", "macro_sql": "{% macro default__get_relations_by_prefix(schema, prefix, exclude='', database=target.database) %}\n\n {%- call statement('get_tables', fetch_result=True) %}\n\n {{ dbt_utils.get_tables_by_prefix_sql(schema, prefix, exclude, database) }}\n\n {%- endcall -%}\n\n {%- set table_list = load_result('get_tables') -%}\n\n {%- if table_list and table_list['table'] -%}\n {%- set tbl_relations = [] -%}\n {%- for row in table_list['table'] -%}\n {%- set tbl_relation = api.Relation.create(\n database=database,\n schema=row.table_schema,\n identifier=row.table_name,\n type=row.table_type\n ) -%}\n {%- do tbl_relations.append(tbl_relation) -%}\n {%- endfor -%}\n\n {{ return(tbl_relations) }}\n {%- else -%}\n {{ return([]) }}\n {%- endif -%}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement", "macro.dbt_utils.get_tables_by_prefix_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "schema", "type": null, "description": ""}, {"name": "prefix", "type": null, "description": ""}, {"name": "exclude", "type": null, "description": ""}, {"name": "database", "type": null, "description": ""}], "created_at": 1789419970.20598, "supported_languages": null}, "macro.dbt_utils.safe_divide": {"name": "safe_divide", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/safe_divide.sql", "original_file_path": "macros/sql/safe_divide.sql", "unique_id": "macro.dbt_utils.safe_divide", "macro_sql": "{% macro safe_divide(numerator, denominator) -%}\n {{ return(adapter.dispatch('safe_divide', 'dbt_utils')(numerator, denominator)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__safe_divide"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "numerator", "type": null, "description": ""}, {"name": "denominator", "type": null, "description": ""}], "created_at": 1789419970.2064703, "supported_languages": null}, "macro.dbt_utils.default__safe_divide": {"name": "default__safe_divide", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/safe_divide.sql", "original_file_path": "macros/sql/safe_divide.sql", "unique_id": "macro.dbt_utils.default__safe_divide", "macro_sql": "{% macro default__safe_divide(numerator, denominator) %}\n ( {{ numerator }} ) / nullif( ( {{ denominator }} ), 0)\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "numerator", "type": null, "description": ""}, {"name": "denominator", "type": null, "description": ""}], "created_at": 1789419970.2067022, "supported_languages": null}, "macro.dbt_utils.safe_add": {"name": "safe_add", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/safe_add.sql", "original_file_path": "macros/sql/safe_add.sql", "unique_id": "macro.dbt_utils.safe_add", "macro_sql": "{%- macro safe_add(field_list) -%}\n {{ return(adapter.dispatch('safe_add', 'dbt_utils')(field_list)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__safe_add"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field_list", "type": null, "description": ""}], "created_at": 1789419970.2072692, "supported_languages": null}, "macro.dbt_utils.default__safe_add": {"name": "default__safe_add", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/safe_add.sql", "original_file_path": "macros/sql/safe_add.sql", "unique_id": "macro.dbt_utils.default__safe_add", "macro_sql": "\n\n{%- macro default__safe_add(field_list) -%}\n\n{%- if field_list is not iterable or field_list is string or field_list is mapping -%}\n\n{%- set error_message = '\nWarning: the `safe_add` macro now takes a single list argument instead of \\\nstring arguments. The {}.{} model triggered this warning. \\\n'.format(model.package_name, model.name) -%}\n\n{%- do exceptions.warn(error_message) -%}\n\n{%- endif -%}\n\n{% set fields = [] %}\n\n{%- for field in field_list -%}\n\n {% do fields.append(\"coalesce(\" ~ field ~ \", 0)\") %}\n\n{%- endfor -%}\n\n{{ fields|join(' +\\n ') }}\n\n{%- endmacro -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field_list", "type": null, "description": ""}], "created_at": 1789419970.2081864, "supported_languages": null}, "macro.dbt_utils.group_by": {"name": "group_by", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/groupby.sql", "original_file_path": "macros/sql/groupby.sql", "unique_id": "macro.dbt_utils.group_by", "macro_sql": "{%- macro group_by(n) -%}\n {{ return(adapter.dispatch('group_by', 'dbt_utils')(n)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__group_by"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "n", "type": null, "description": ""}], "created_at": 1789419970.2086656, "supported_languages": null}, "macro.dbt_utils.default__group_by": {"name": "default__group_by", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/groupby.sql", "original_file_path": "macros/sql/groupby.sql", "unique_id": "macro.dbt_utils.default__group_by", "macro_sql": "\n\n{%- macro default__group_by(n) -%}\n\n group by {% for i in range(1, n + 1) -%}\n {{ i }}{{ ',' if not loop.last }} \n {%- endfor -%}\n\n{%- endmacro -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "n", "type": null, "description": ""}], "created_at": 1789419970.209102, "supported_languages": null}, "macro.iterable.iterable_lookback": {"name": "iterable_lookback", "resource_type": "macro", "package_name": "iterable", "path": "macros/iterable_lookback.sql", "original_file_path": "macros/iterable_lookback.sql", "unique_id": "macro.iterable.iterable_lookback", "macro_sql": "{% macro iterable_lookback(from_date, datepart, interval, safety_date='2020-01-01') %}\n\n{{ adapter.dispatch('iterable_lookback', 'iterable') (from_date, datepart, interval, safety_date='2020-01-01') }}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.iterable.default__iterable_lookback"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "from_date", "type": null, "description": ""}, {"name": "datepart", "type": null, "description": ""}, {"name": "interval", "type": null, "description": ""}, {"name": "safety_date", "type": null, "description": ""}], "created_at": 1789419970.2098029, "supported_languages": null}, "macro.iterable.default__iterable_lookback": {"name": "default__iterable_lookback", "resource_type": "macro", "package_name": "iterable", "path": "macros/iterable_lookback.sql", "original_file_path": "macros/iterable_lookback.sql", "unique_id": "macro.iterable.default__iterable_lookback", "macro_sql": "{% macro default__iterable_lookback(from_date, datepart, interval, safety_date='2020-01-01') %}\n\n {% set sql_statement %}\n select coalesce({{ from_date }}, {{ \"'\" ~ safety_date ~ \"'\" }})\n from {{ this }}\n {%- endset -%}\n\n {%- set result = dbt_utils.get_single_value(sql_statement) %}\n\n {{ dbt.dateadd(datepart=datepart, interval=-interval, from_date_or_timestamp=\"cast('\" ~ result ~ \"' as date)\") }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.get_single_value", "macro.dbt.dateadd"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "from_date", "type": null, "description": ""}, {"name": "datepart", "type": null, "description": ""}, {"name": "interval", "type": null, "description": ""}, {"name": "safety_date", "type": null, "description": ""}], "created_at": 1789419970.2106757, "supported_languages": null}, "macro.iterable.get_campaign_list_history_columns": {"name": "get_campaign_list_history_columns", "resource_type": "macro", "package_name": "iterable", "path": "macros/staging/get_campaign_list_history_columns.sql", "original_file_path": "macros/staging/get_campaign_list_history_columns.sql", "unique_id": "macro.iterable.get_campaign_list_history_columns", "macro_sql": "{% macro get_campaign_list_history_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"campaign_id\", \"datatype\": dbt.type_int()},\n {\"name\": \"list_id\", \"datatype\": dbt.type_int()},\n {\"name\": \"updated_at\", \"datatype\": dbt.type_timestamp()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.type_timestamp", "macro.dbt.type_int"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789419970.211694, "supported_languages": null}, "macro.iterable.get_list_columns": {"name": "get_list_columns", "resource_type": "macro", "package_name": "iterable", "path": "macros/staging/get_list_columns.sql", "original_file_path": "macros/staging/get_list_columns.sql", "unique_id": "macro.iterable.get_list_columns", "macro_sql": "{% macro get_list_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_deleted\", \"datatype\": \"boolean\"},\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"created_at\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"id\", \"datatype\": dbt.type_int()},\n {\"name\": \"list_type\", \"datatype\": dbt.type_string()},\n {\"name\": \"description\", \"datatype\": dbt.type_string()},\n {\"name\": \"name\", \"datatype\": dbt.type_string()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.type_timestamp", "macro.dbt.type_int", "macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789419970.2131503, "supported_languages": null}, "macro.iterable.get_campaign_history_columns": {"name": "get_campaign_history_columns", "resource_type": "macro", "package_name": "iterable", "path": "macros/staging/get_campaign_history_columns.sql", "original_file_path": "macros/staging/get_campaign_history_columns.sql", "unique_id": "macro.iterable.get_campaign_history_columns", "macro_sql": "{% macro get_campaign_history_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"campaign_state\", \"datatype\": dbt.type_string()},\n {\"name\": \"created_at\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"created_by_user_id\", \"datatype\": dbt.type_string()},\n {\"name\": \"updated_by_user_id\", \"datatype\": dbt.type_string()},\n {\"name\": \"ended_at\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"id\", \"datatype\": dbt.type_int()},\n {\"name\": \"name\", \"datatype\": dbt.type_string()},\n {\"name\": \"recurring_campaign_id\", \"datatype\": dbt.type_int()},\n {\"name\": \"send_size\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"start_at\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"template_id\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"type\", \"datatype\": dbt.type_string()},\n {\"name\": \"updated_at\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"workflow_id\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"message_medium\", \"datatype\": dbt.type_string()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.type_timestamp", "macro.dbt.type_string", "macro.dbt.type_int", "macro.dbt.type_numeric"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789419970.21598, "supported_languages": null}, "macro.iterable.get_event_columns": {"name": "get_event_columns", "resource_type": "macro", "package_name": "iterable", "path": "macros/staging/get_event_columns.sql", "original_file_path": "macros/staging/get_event_columns.sql", "unique_id": "macro.iterable.get_event_columns", "macro_sql": "{% macro get_event_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_id\", \"datatype\": dbt.type_string()},\n {\"name\": \"_fivetran_user_id\", \"datatype\": dbt.type_string()},\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"campaign_id\", \"datatype\": dbt.type_int()},\n {\"name\": \"content_id\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"created_at\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"email\", \"datatype\": dbt.type_string()},\n {\"name\": \"event_name\", \"datatype\": dbt.type_string()},\n {\"name\": \"message_bus_id\", \"datatype\": dbt.type_string()},\n {\"name\": \"message_id\", \"datatype\": dbt.type_string()},\n {\"name\": \"message_type_id\", \"datatype\": dbt.type_int()},\n {\"name\": \"recipient_state\", \"datatype\": dbt.type_string()},\n {\"name\": \"status\", \"datatype\": dbt.type_string()},\n {\"name\": \"unsub_source\", \"datatype\": dbt.type_string()},\n {\"name\": \"user_agent\", \"datatype\": dbt.type_string()},\n {\"name\": \"user_agent_device\", \"datatype\": dbt.type_string()},\n {\"name\": \"transactional_data\", \"datatype\": dbt.type_string()},\n {\"name\": \"additional_properties\", \"datatype\": dbt.type_string()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.type_string", "macro.dbt.type_timestamp", "macro.dbt.type_int", "macro.dbt.type_numeric"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789419970.2191105, "supported_languages": null}, "macro.iterable.get_event_extension_columns": {"name": "get_event_extension_columns", "resource_type": "macro", "package_name": "iterable", "path": "macros/staging/get_event_extension_columns.sql", "original_file_path": "macros/staging/get_event_extension_columns.sql", "unique_id": "macro.iterable.get_event_extension_columns", "macro_sql": "{% macro get_event_extension_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_id\", \"datatype\": dbt.type_string()},\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"app_already_running\", \"datatype\": \"boolean\"},\n {\"name\": \"badge\", \"datatype\": dbt.type_string()},\n {\"name\": \"catalog_collection_count\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"catalog_lookup_count\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"canonical_url_id\", \"datatype\": dbt.type_string()},\n {\"name\": \"content_available\", \"datatype\": \"boolean\"},\n {\"name\": \"content_id\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"device\", \"datatype\": dbt.type_string()},\n {\"name\": \"email_id\", \"datatype\": dbt.type_string()},\n {\"name\": \"email_subject\", \"datatype\": dbt.type_string()},\n {\"name\": \"experiment_id\", \"datatype\": dbt.type_string()},\n {\"name\": \"from_phone_number_id\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"from_smssender_id\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"link_id\", \"datatype\": dbt.type_string()},\n {\"name\": \"link_url\", \"datatype\": dbt.type_string()},\n {\"name\": \"locale\", \"datatype\": dbt.type_string()},\n {\"name\": \"payload\", \"datatype\": dbt.type_string()},\n {\"name\": \"platform_endpoint\", \"datatype\": dbt.type_string()},\n {\"name\": \"push_message\", \"datatype\": dbt.type_string()},\n {\"name\": \"region\", \"datatype\": dbt.type_string()},\n {\"name\": \"sms_message\", \"datatype\": dbt.type_string()},\n {\"name\": \"to_phone_number\", \"datatype\": dbt.type_string()},\n {\"name\": \"url\", \"datatype\": dbt.type_string()},\n {\"name\": \"workflow_id\", \"datatype\": dbt.type_string()},\n {\"name\": \"workflow_name\", \"datatype\": dbt.type_string()},\n {\"name\": \"city\", \"datatype\": dbt.type_string()},\n {\"name\": \"clicked_url\", \"datatype\": dbt.type_string()},\n {\"name\": \"country\", \"datatype\": dbt.type_string()},\n {\"name\": \"error_code\", \"datatype\": dbt.type_string()},\n {\"name\": \"expires_at\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"from_phone_number\", \"datatype\": dbt.type_string()},\n {\"name\": \"in_app_body\", \"datatype\": dbt.type_string()},\n {\"name\": \"is_sms_estimation\", \"datatype\": \"boolean\"},\n {\"name\": \"labels\", \"datatype\": dbt.type_string()},\n {\"name\": \"message_status\", \"datatype\": dbt.type_string()},\n {\"name\": \"mms_send_count\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"reason\", \"datatype\": dbt.type_string()},\n {\"name\": \"sms_send_count\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"_fivetran_user_id\", \"datatype\": dbt.type_string()}\n] %}\n\n{{ fivetran_utils.add_pass_through_columns(columns, var('iterable_event_extension_pass_through_columns')) }}\n\n{{ return(columns) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.type_string", "macro.dbt.type_timestamp", "macro.dbt.type_numeric", "macro.fivetran_utils.add_pass_through_columns"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789419970.2259147, "supported_languages": null}, "macro.iterable.get_campaign_label_history_columns": {"name": "get_campaign_label_history_columns", "resource_type": "macro", "package_name": "iterable", "path": "macros/staging/get_campaign_label_history_columns.sql", "original_file_path": "macros/staging/get_campaign_label_history_columns.sql", "unique_id": "macro.iterable.get_campaign_label_history_columns", "macro_sql": "{% macro get_campaign_label_history_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"campaign_id\", \"datatype\": dbt.type_int()},\n {\"name\": \"label\", \"datatype\": dbt.type_string()},\n {\"name\": \"updated_at\", \"datatype\": dbt.type_timestamp()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.type_timestamp", "macro.dbt.type_int", "macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789419970.226999, "supported_languages": null}, "macro.iterable.get_template_history_columns": {"name": "get_template_history_columns", "resource_type": "macro", "package_name": "iterable", "path": "macros/staging/get_template_history_columns.sql", "original_file_path": "macros/staging/get_template_history_columns.sql", "unique_id": "macro.iterable.get_template_history_columns", "macro_sql": "{% macro get_template_history_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"client_template_id\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"created_at\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"creator_user_id\", \"datatype\": dbt.type_string()},\n {\"name\": \"id\", \"datatype\": dbt.type_int()},\n {\"name\": \"message_type_id\", \"datatype\": dbt.type_int()},\n {\"name\": \"name\", \"datatype\": dbt.type_string()},\n {\"name\": \"template_type\", \"datatype\": dbt.type_string()},\n {\"name\": \"updated_at\", \"datatype\": dbt.type_timestamp()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.type_timestamp", "macro.dbt.type_numeric", "macro.dbt.type_string", "macro.dbt.type_int"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789419970.228786, "supported_languages": null}, "macro.iterable.get_journey_columns": {"name": "get_journey_columns", "resource_type": "macro", "package_name": "iterable", "path": "macros/staging/get_journey_columns.sql", "original_file_path": "macros/staging/get_journey_columns.sql", "unique_id": "macro.iterable.get_journey_columns", "macro_sql": "{% macro get_journey_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_deleted\", \"datatype\": \"boolean\"},\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"created_at\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"creator_user_id\", \"datatype\": dbt.type_string()},\n {\"name\": \"description\", \"datatype\": dbt.type_string()},\n {\"name\": \"enabled\", \"datatype\": \"boolean\"},\n {\"name\": \"id\", \"datatype\": dbt.type_int()},\n {\"name\": \"is_archived\", \"datatype\": \"boolean\"},\n {\"name\": \"journey_type\", \"datatype\": dbt.type_string()},\n {\"name\": \"lifetime_limit\", \"datatype\": dbt.type_int()},\n {\"name\": \"name\", \"datatype\": dbt.type_string()},\n {\"name\": \"simultaneous_limit\", \"datatype\": dbt.type_int()},\n {\"name\": \"start_tile_id\", \"datatype\": dbt.type_int()},\n {\"name\": \"trigger_event_names\", \"datatype\": dbt.type_string()},\n {\"name\": \"updated_at\", \"datatype\": dbt.type_timestamp()}\n] %}\n\n{{ fivetran_utils.add_pass_through_columns(columns, var('iterable_journey_pass_through_columns')) }}\n\n{{ return(columns) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.type_timestamp", "macro.dbt.type_string", "macro.dbt.type_int", "macro.fivetran_utils.add_pass_through_columns"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789419970.231595, "supported_languages": null}, "macro.iterable.get_list_user_columns": {"name": "get_list_user_columns", "resource_type": "macro", "package_name": "iterable", "path": "macros/staging/get_list_user_columns.sql", "original_file_path": "macros/staging/get_list_user_columns.sql", "unique_id": "macro.iterable.get_list_user_columns", "macro_sql": "{% macro get_list_user_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_id\", \"datatype\": dbt.type_string()},\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"index\", \"datatype\": dbt.type_int()},\n {\"name\": \"list_id\", \"datatype\": dbt.type_int()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.type_string", "macro.dbt.type_timestamp", "macro.dbt.type_int"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789419970.2326193, "supported_languages": null}, "macro.iterable.json_to_string": {"name": "json_to_string", "resource_type": "macro", "package_name": "iterable", "path": "macros/staging/json_to_string.sql", "original_file_path": "macros/staging/json_to_string.sql", "unique_id": "macro.iterable.json_to_string", "macro_sql": "{%- macro json_to_string(column, column_list) -%}\n {{ return(adapter.dispatch('json_to_string', 'iterable')(column, column_list)) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.iterable.default__json_to_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "column", "type": null, "description": ""}, {"name": "column_list", "type": null, "description": ""}], "created_at": 1789419970.2333, "supported_languages": null}, "macro.iterable.default__json_to_string": {"name": "default__json_to_string", "resource_type": "macro", "package_name": "iterable", "path": "macros/staging/json_to_string.sql", "original_file_path": "macros/staging/json_to_string.sql", "unique_id": "macro.iterable.default__json_to_string", "macro_sql": "{%- macro default__json_to_string(column, column_list) -%}\n cast({{ column }} as {{ dbt.type_string() }})\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "column", "type": null, "description": ""}, {"name": "column_list", "type": null, "description": ""}], "created_at": 1789419970.2335684, "supported_languages": null}, "macro.iterable.bigquery__json_to_string": {"name": "bigquery__json_to_string", "resource_type": "macro", "package_name": "iterable", "path": "macros/staging/json_to_string.sql", "original_file_path": "macros/staging/json_to_string.sql", "unique_id": "macro.iterable.bigquery__json_to_string", "macro_sql": "{%- macro bigquery__json_to_string(column, column_list) -%}\n {%- set columns = column_list -%}\n {%- set ns = namespace(column_type='string') -%}\n\n {%- for col in columns -%}\n {%- if col.name|lower == column|lower -%}\n {%- set ns.column_type = col.dtype|lower -%}\n {%- endif -%}\n {%- endfor -%}\n\n {%- if ns.column_type == 'json' -%}\n to_json_string({{ column }})\n {%- else -%}\n cast({{ column }} as {{ dbt.type_string() }})\n {%- endif -%}\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "column", "type": null, "description": ""}, {"name": "column_list", "type": null, "description": ""}], "created_at": 1789419970.2344882, "supported_languages": null}, "macro.iterable.get_user_unsubscribed_message_type_columns": {"name": "get_user_unsubscribed_message_type_columns", "resource_type": "macro", "package_name": "iterable", "path": "macros/staging/get_user_unsubscribed_message_type_columns.sql", "original_file_path": "macros/staging/get_user_unsubscribed_message_type_columns.sql", "unique_id": "macro.iterable.get_user_unsubscribed_message_type_columns", "macro_sql": "{% macro get_user_unsubscribed_message_type_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"_fivetran_id\", \"datatype\": dbt.type_string()},\n {\"name\": \"message_type_id\", \"datatype\": dbt.type_string()},\n {\"name\": \"email\", \"datatype\": dbt.type_string()},\n {\"name\": \"updated_at\", \"datatype\": dbt.type_timestamp()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.type_timestamp", "macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789419970.2356412, "supported_languages": null}, "macro.iterable.does_table_exist": {"name": "does_table_exist", "resource_type": "macro", "package_name": "iterable", "path": "macros/staging/does_table_exist.sql", "original_file_path": "macros/staging/does_table_exist.sql", "unique_id": "macro.iterable.does_table_exist", "macro_sql": "{%- macro does_table_exist(table_name) -%}\n {%- if execute -%} -- returns true when dbt is in execute mode\n {%- set ns = namespace(has_table=false) -%} -- declare boolean namespace and default value \n {%- for node in graph.sources.values() -%} -- grab sources from the dictionary of nodes \n -- call the database for the matching table\n {%- if node.name | lower == table_name | lower -%} \n {%- set source_relation = adapter.get_relation(\n database=node.database,\n schema=node.schema,\n identifier=node.identifier ) -%}\n {% endif %}\n {%- if source_relation == None -%} \n {{ return(False) }} -- return false if relation identified by the database.schema.identifier does not exist for the given table name\n {% endif %}\n {%- endfor -%}\n {{ return(True) }}\n {%- endif -%} \n{%- endmacro -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "table_name", "type": null, "description": ""}], "created_at": 1789419970.2369773, "supported_languages": null}, "macro.iterable.get_user_history_columns": {"name": "get_user_history_columns", "resource_type": "macro", "package_name": "iterable", "path": "macros/staging/get_user_history_columns.sql", "original_file_path": "macros/staging/get_user_history_columns.sql", "unique_id": "macro.iterable.get_user_history_columns", "macro_sql": "{% macro get_user_history_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_id\", \"datatype\": dbt.type_string()},\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"email\", \"datatype\": dbt.type_string()},\n {\"name\": \"email_list_ids\", \"datatype\": dbt.type_string()},\n {\"name\": \"first_name\", \"datatype\": dbt.type_string()},\n {\"name\": \"last_name\", \"datatype\": dbt.type_string()},\n {\"name\": \"phone_number\", \"datatype\": dbt.type_string()},\n {\"name\": \"signup_date\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"signup_source\", \"datatype\": dbt.type_string()},\n {\"name\": \"updated_at\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"user_id\", \"datatype\": dbt.type_string()},\n {\"name\": \"iterable_user_id\", \"datatype\": dbt.type_string()}\n\n] %}\n\n{{ fivetran_utils.add_pass_through_columns(columns, var('iterable_user_history_pass_through_columns')) }}\n\n{{ return(columns) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.type_string", "macro.dbt.type_timestamp", "macro.fivetran_utils.add_pass_through_columns"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789419970.2393436, "supported_languages": null}, "macro.iterable.get_campaign_suppression_list_history_columns": {"name": "get_campaign_suppression_list_history_columns", "resource_type": "macro", "package_name": "iterable", "path": "macros/staging/get_campaign_suppression_list_history_columns.sql", "original_file_path": "macros/staging/get_campaign_suppression_list_history_columns.sql", "unique_id": "macro.iterable.get_campaign_suppression_list_history_columns", "macro_sql": "{% macro get_campaign_suppression_list_history_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"campaign_id\", \"datatype\": dbt.type_int()},\n {\"name\": \"suppressed_list_id\", \"datatype\": dbt.type_int()},\n {\"name\": \"updated_at\", \"datatype\": dbt.type_timestamp()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.type_timestamp", "macro.dbt.type_int"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789419970.2403543, "supported_languages": null}, "macro.iterable.get_user_unsubscribed_channel_columns": {"name": "get_user_unsubscribed_channel_columns", "resource_type": "macro", "package_name": "iterable", "path": "macros/staging/get_user_unsubscribed_channel_columns.sql", "original_file_path": "macros/staging/get_user_unsubscribed_channel_columns.sql", "unique_id": "macro.iterable.get_user_unsubscribed_channel_columns", "macro_sql": "{% macro get_user_unsubscribed_channel_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"_fivetran_id\", \"datatype\": dbt.type_string()},\n {\"name\": \"channel_id\", \"datatype\": dbt.type_int()},\n {\"name\": \"email\", \"datatype\": dbt.type_string()},\n {\"name\": \"updated_at\", \"datatype\": dbt.type_timestamp()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.type_timestamp", "macro.dbt.type_string", "macro.dbt.type_int"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789419970.2414885, "supported_languages": null}, "macro.iterable.get_message_type_columns": {"name": "get_message_type_columns", "resource_type": "macro", "package_name": "iterable", "path": "macros/staging/get_message_type_columns.sql", "original_file_path": "macros/staging/get_message_type_columns.sql", "unique_id": "macro.iterable.get_message_type_columns", "macro_sql": "{% macro get_message_type_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_deleted\", \"datatype\": \"boolean\"},\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"channel_id\", \"datatype\": dbt.type_int()},\n {\"name\": \"id\", \"datatype\": dbt.type_int()},\n {\"name\": \"name\", \"datatype\": dbt.type_string()},\n {\"name\": \"created_at\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"frequency_cap\", \"datatype\": dbt.type_string()},\n {\"name\": \"rate_limit_per_minute\", \"datatype\": dbt.type_string()},\n {\"name\": \"subscription_policy\", \"datatype\": dbt.type_string()},\n {\"name\": \"updated_at\", \"datatype\": dbt.type_timestamp()},\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.type_timestamp", "macro.dbt.type_int", "macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789419970.2435055, "supported_languages": null}, "macro.iterable.get_channel_columns": {"name": "get_channel_columns", "resource_type": "macro", "package_name": "iterable", "path": "macros/staging/get_channel_columns.sql", "original_file_path": "macros/staging/get_channel_columns.sql", "unique_id": "macro.iterable.get_channel_columns", "macro_sql": "{% macro get_channel_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_deleted\", \"datatype\": \"boolean\"},\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"channel_type\", \"datatype\": dbt.type_string()},\n {\"name\": \"id\", \"datatype\": dbt.type_int()},\n {\"name\": \"message_medium\", \"datatype\": dbt.type_string()},\n {\"name\": \"name\", \"datatype\": dbt.type_string()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.type_timestamp", "macro.dbt.type_string", "macro.dbt.type_int"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789419970.2448218, "supported_languages": null}, "macro.fivetran_utils.enabled_vars_one_true": {"name": "enabled_vars_one_true", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/enabled_vars_one_true.sql", "original_file_path": "macros/enabled_vars_one_true.sql", "unique_id": "macro.fivetran_utils.enabled_vars_one_true", "macro_sql": "{% macro enabled_vars_one_true(vars) %}\n\n{% for v in vars %}\n \n {% if var(v, False) == True %}\n {{ return(True) }}\n {% endif %}\n\n{% endfor %}\n\n{{ return(False) }}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "vars", "type": null, "description": ""}], "created_at": 1789419970.2455053, "supported_languages": null}, "macro.fivetran_utils.json_parse": {"name": "json_parse", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/json_parse.sql", "original_file_path": "macros/json_parse.sql", "unique_id": "macro.fivetran_utils.json_parse", "macro_sql": "{% macro json_parse(string, string_path) -%}\n\n{{ adapter.dispatch('json_parse', 'fivetran_utils') (string, string_path) }}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.postgres__json_parse"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "string", "type": null, "description": ""}, {"name": "string_path", "type": null, "description": ""}], "created_at": 1789419970.2466562, "supported_languages": null}, "macro.fivetran_utils.default__json_parse": {"name": "default__json_parse", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/json_parse.sql", "original_file_path": "macros/json_parse.sql", "unique_id": "macro.fivetran_utils.default__json_parse", "macro_sql": "{% macro default__json_parse(string, string_path) %}\n\n json_extract_path_text({{string}}, {%- for s in string_path -%}'{{ s }}'{%- if not loop.last -%},{%- endif -%}{%- endfor -%} )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "string", "type": null, "description": ""}, {"name": "string_path", "type": null, "description": ""}], "created_at": 1789419970.2471104, "supported_languages": null}, "macro.fivetran_utils.redshift__json_parse": {"name": "redshift__json_parse", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/json_parse.sql", "original_file_path": "macros/json_parse.sql", "unique_id": "macro.fivetran_utils.redshift__json_parse", "macro_sql": "{% macro redshift__json_parse(string, string_path) %}\n\n json_extract_path_text({{string}}, {%- for s in string_path -%}'{{ s }}'{%- if not loop.last -%},{%- endif -%}{%- endfor -%} )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "string", "type": null, "description": ""}, {"name": "string_path", "type": null, "description": ""}], "created_at": 1789419970.2475336, "supported_languages": null}, "macro.fivetran_utils.bigquery__json_parse": {"name": "bigquery__json_parse", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/json_parse.sql", "original_file_path": "macros/json_parse.sql", "unique_id": "macro.fivetran_utils.bigquery__json_parse", "macro_sql": "{% macro bigquery__json_parse(string, string_path) %}\n\n \n json_extract_scalar({{string}}, '$.{%- for s in string_path -%}{{ s }}{%- if not loop.last -%}.{%- endif -%}{%- endfor -%} ')\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "string", "type": null, "description": ""}, {"name": "string_path", "type": null, "description": ""}], "created_at": 1789419970.247945, "supported_languages": null}, "macro.fivetran_utils.postgres__json_parse": {"name": "postgres__json_parse", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/json_parse.sql", "original_file_path": "macros/json_parse.sql", "unique_id": "macro.fivetran_utils.postgres__json_parse", "macro_sql": "{% macro postgres__json_parse(string, string_path) %}\n\n {{string}}::json #>> '{ {%- for s in string_path -%}{{ s }}{%- if not loop.last -%},{%- endif -%}{%- endfor -%} }'\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "string", "type": null, "description": ""}, {"name": "string_path", "type": null, "description": ""}], "created_at": 1789419970.2483394, "supported_languages": null}, "macro.fivetran_utils.snowflake__json_parse": {"name": "snowflake__json_parse", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/json_parse.sql", "original_file_path": "macros/json_parse.sql", "unique_id": "macro.fivetran_utils.snowflake__json_parse", "macro_sql": "{% macro snowflake__json_parse(string, string_path) %}\n\n parse_json( {{string}} ) {%- for s in string_path -%}{% if s is number %}[{{ s }}]{% else %}['{{ s }}']{% endif %}{%- endfor -%}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "string", "type": null, "description": ""}, {"name": "string_path", "type": null, "description": ""}], "created_at": 1789419970.2487967, "supported_languages": null}, "macro.fivetran_utils.spark__json_parse": {"name": "spark__json_parse", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/json_parse.sql", "original_file_path": "macros/json_parse.sql", "unique_id": "macro.fivetran_utils.spark__json_parse", "macro_sql": "{% macro spark__json_parse(string, string_path) %}\n\n {{string}} : {%- for s in string_path -%}{% if s is number %}[{{ s }}]{% else %}['{{ s }}']{% endif %}{%- endfor -%}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "string", "type": null, "description": ""}, {"name": "string_path", "type": null, "description": ""}], "created_at": 1789419970.2492352, "supported_languages": null}, "macro.fivetran_utils.sqlserver__json_parse": {"name": "sqlserver__json_parse", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/json_parse.sql", "original_file_path": "macros/json_parse.sql", "unique_id": "macro.fivetran_utils.sqlserver__json_parse", "macro_sql": "{% macro sqlserver__json_parse(string, string_path) %}\n\n json_value({{string}}, '$.{%- for s in string_path -%}{{ s }}{%- if not loop.last -%}.{%- endif -%}{%- endfor -%} ')\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "string", "type": null, "description": ""}, {"name": "string_path", "type": null, "description": ""}], "created_at": 1789419970.2496235, "supported_languages": null}, "macro.fivetran_utils.duckdb__json_parse": {"name": "duckdb__json_parse", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/json_parse.sql", "original_file_path": "macros/json_parse.sql", "unique_id": "macro.fivetran_utils.duckdb__json_parse", "macro_sql": "{% macro duckdb__json_parse(string, string_path) %}\n\n json_extract_string({{string}}, '${%- for s in string_path -%}{% if s is number %}[{{ s }}]{% else %}.{{ s }}{% endif %}{%- endfor -%}')\n \n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "string", "type": null, "description": ""}, {"name": "string_path", "type": null, "description": ""}], "created_at": 1789419970.2500758, "supported_languages": null}, "macro.fivetran_utils.union_relations_custom": {"name": "union_relations_custom", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/union_relations_custom.sql", "original_file_path": "macros/union_relations_custom.sql", "unique_id": "macro.fivetran_utils.union_relations_custom", "macro_sql": "{%- macro union_relations_custom(relations, aliases=none, column_override=none, include=[], exclude=[], source_column_name='_dbt_source_relation', where=none) -%}\n {{ return(adapter.dispatch('union_relations_custom', 'fivetran_utils')(relations, aliases, column_override, include, exclude, source_column_name, where)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.default__union_relations_custom"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relations", "type": null, "description": ""}, {"name": "aliases", "type": null, "description": ""}, {"name": "column_override", "type": null, "description": ""}, {"name": "include", "type": null, "description": ""}, {"name": "exclude", "type": null, "description": ""}, {"name": "source_column_name", "type": null, "description": ""}, {"name": "where", "type": null, "description": ""}], "created_at": 1789419970.2520802, "supported_languages": null}, "macro.fivetran_utils.default__union_relations_custom": {"name": "default__union_relations_custom", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/union_relations_custom.sql", "original_file_path": "macros/union_relations_custom.sql", "unique_id": "macro.fivetran_utils.default__union_relations_custom", "macro_sql": "\n\n{%- macro default__union_relations_custom(relations, aliases=none, column_override=none, include=[], exclude=[], source_column_name='_dbt_source_relation', where=none) -%}\n\n {%- if exclude and include -%}\n {{ exceptions.raise_compiler_error(\"Both an exclude and include list were provided to the `union` macro. Only one is allowed\") }}\n {%- endif -%}\n\n {#-- Prevent querying of db in parsing mode. This works because this macro does not create any new refs. -#}\n {%- if not execute %}\n {{ return('') }}\n {% endif -%}\n\n {%- set column_override = column_override if column_override is not none else {} -%}\n\n {%- set relation_columns = {} -%}\n {%- set column_superset = {} -%}\n {%- set all_excludes = [] -%}\n {%- set all_includes = [] -%}\n\n {%- if exclude -%}\n {%- for exc in exclude -%}\n {%- do all_excludes.append(exc | lower) -%}\n {%- endfor -%}\n {%- endif -%}\n\n {%- if include -%}\n {%- for inc in include -%}\n {%- do all_includes.append(inc | lower) -%}\n {%- endfor -%}\n {%- endif -%}\n\n {%- for relation in relations -%}\n\n {%- do relation_columns.update({relation: []}) -%}\n\n {%- do dbt_utils._is_relation(relation, 'union_relations_custom') -%}\n {%- do dbt_utils._is_ephemeral(relation, 'union_relations_custom') -%}\n {%- set cols = adapter.get_columns_in_relation(relation) -%}\n {%- for col in cols -%}\n\n {#- If an exclude list was provided and the column is in the list, do nothing -#}\n {%- if exclude and col.column | lower in all_excludes -%}\n\n {#- If an include list was provided and the column is not in the list, do nothing -#}\n {%- elif include and col.column | lower not in all_includes -%}\n\n {#- Otherwise add the column to the column superset -#}\n {%- else -%}\n\n {#- update the list of columns in this relation -#}\n {%- do relation_columns[relation].append(col.column) -%}\n\n {%- if col.column in column_superset -%}\n\n {%- set stored = column_superset[col.column] -%}\n {%- if col.is_string() and stored.is_string() and col.string_size() > stored.string_size() -%}\n\n {%- do column_superset.update({col.column: col}) -%}\n\n {%- endif %}\n\n {%- else -%}\n\n {%- do column_superset.update({col.column: col}) -%}\n\n {%- endif -%}\n\n {%- endif -%}\n\n {%- endfor -%}\n {%- endfor -%}\n\n {%- set ordered_column_names = column_superset.keys() -%}\n {%- set dbt_command = flags.WHICH -%}\n\n\n {% if dbt_command in ['run', 'build'] %}\n {% if (include | length > 0 or exclude | length > 0) and not column_superset.keys() %}\n {%- set relations_string -%}\n {%- for relation in relations -%}\n {{ relation.name }}\n {%- if not loop.last %}, {% endif -%}\n {%- endfor -%}\n {%- endset -%}\n\n {%- set error_message -%}\n There were no columns found to union for relations {{ relations_string }}\n {%- endset -%}\n\n {{ exceptions.raise_compiler_error(error_message) }}\n {%- endif -%}\n {%- endif -%}\n\n {%- for relation in relations %}\n\n (\n select\n\n {%- if source_column_name is not none %}\n {# dbt_utils union_relations includes the table in the source_relation. For Fivetran dbt package purposes the table should not be included in the source relation. #}\n cast({{ dbt.string_literal(relation.database ~ '.' ~ relation.schema) }} as {{ dbt.type_string() }}) as {{ source_column_name }},\n {%- endif %}\n\n {% for col_name in ordered_column_names -%}\n\n {%- set col = column_superset[col_name] %}\n {%- set col_type = column_override.get(col.column, col.data_type) %}\n {%- set col_name = adapter.quote(col_name) if col_name in relation_columns[relation] else 'null' %}\n cast({{ col_name }} as {{ col_type }}) as {{ col.quoted }} {% if not loop.last %},{% endif -%}\n\n {%- endfor %}\n \n {# This alias is a change from dbt_utils union_relations code. Avoids errors if the table is named a reserved keyword #}\n from {{ aliases[loop.index0] if aliases else relation }} as unioned_relation_{{ loop.index }}\n\n {% if where -%}\n where {{ where }}\n {%- endif %}\n )\n\n {% if not loop.last -%}\n union all\n {% endif -%}\n\n {%- endfor -%}\n\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt_utils._is_relation", "macro.dbt_utils._is_ephemeral", "macro.dbt.string_literal", "macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relations", "type": null, "description": ""}, {"name": "aliases", "type": null, "description": ""}, {"name": "column_override", "type": null, "description": ""}, {"name": "include", "type": null, "description": ""}, {"name": "exclude", "type": null, "description": ""}, {"name": "source_column_name", "type": null, "description": ""}, {"name": "where", "type": null, "description": ""}], "created_at": 1789419970.2581773, "supported_languages": null}, "macro.fivetran_utils.seed_data_helper": {"name": "seed_data_helper", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/seed_data_helper.sql", "original_file_path": "macros/seed_data_helper.sql", "unique_id": "macro.fivetran_utils.seed_data_helper", "macro_sql": "{% macro seed_data_helper(seed_name, warehouses) %}\n\n{% if target.type in warehouses %}\n {% for w in warehouses %}\n {% if target.type == w %}\n {{ return(ref(seed_name ~ \"_\" ~ w ~ \"\")) }}\n {% endif %}\n {% endfor %}\n{% else %}\n{{ return(ref(seed_name)) }}\n{% endif %}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "seed_name", "type": null, "description": ""}, {"name": "warehouses", "type": null, "description": ""}], "created_at": 1789419970.2592802, "supported_languages": null}, "macro.fivetran_utils.drop_schemas_automation": {"name": "drop_schemas_automation", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/drop_schemas_automation.sql", "original_file_path": "macros/drop_schemas_automation.sql", "unique_id": "macro.fivetran_utils.drop_schemas_automation", "macro_sql": "{% macro drop_schemas_automation(drop_target_schema=true) %}\n {{ return(adapter.dispatch('drop_schemas_automation', 'fivetran_utils')(drop_target_schema)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.default__drop_schemas_automation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "drop_target_schema", "type": null, "description": ""}], "created_at": 1789419970.2601256, "supported_languages": null}, "macro.fivetran_utils.default__drop_schemas_automation": {"name": "default__drop_schemas_automation", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/drop_schemas_automation.sql", "original_file_path": "macros/drop_schemas_automation.sql", "unique_id": "macro.fivetran_utils.default__drop_schemas_automation", "macro_sql": "{% macro default__drop_schemas_automation(drop_target_schema=true) %}\n\n{% set fetch_list_sql %}\n {% if target.type not in ('databricks', 'spark') %}\n select schema_name\n from \n {{ wrap_in_quotes(target.database) }}.INFORMATION_SCHEMA.SCHEMATA\n where lower(schema_name) like '{{ target.schema | lower }}{%- if not drop_target_schema -%}_{%- endif -%}%'\n {% else %}\n SHOW SCHEMAS LIKE '{{ target.schema }}{%- if not drop_target_schema -%}_{%- endif -%}*'\n {% endif %}\n{% endset %}\n\n{% set results = run_query(fetch_list_sql) %}\n\n{% if execute %}\n {% set results_list = results.columns[0].values() %}\n{% else %}\n {% set results_list = [] %}\n{% endif %}\n\n{% for schema_to_drop in results_list %}\n {% do adapter.drop_schema(api.Relation.create(database=target.database, schema=schema_to_drop)) %}\n {{ print('Schema ' ~ schema_to_drop ~ ' successfully dropped from the ' ~ target.database ~ ' database.\\n')}}\n{% endfor %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.wrap_in_quotes", "macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "drop_target_schema", "type": null, "description": ""}], "created_at": 1789419970.2618947, "supported_languages": null}, "macro.fivetran_utils.duckdb__drop_schemas_automation": {"name": "duckdb__drop_schemas_automation", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/drop_schemas_automation.sql", "original_file_path": "macros/drop_schemas_automation.sql", "unique_id": "macro.fivetran_utils.duckdb__drop_schemas_automation", "macro_sql": "{% macro duckdb__drop_schemas_automation(drop_target_schema=true) %}\n\n {{ print('Not dropping any schemas in DuckDB.\\n') }}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "drop_target_schema", "type": null, "description": ""}], "created_at": 1789419970.2621756, "supported_languages": null}, "macro.fivetran_utils.ceiling": {"name": "ceiling", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/ceiling.sql", "original_file_path": "macros/ceiling.sql", "unique_id": "macro.fivetran_utils.ceiling", "macro_sql": "{% macro ceiling(num) -%}\n\n{{ adapter.dispatch('ceiling', 'fivetran_utils') (num) }}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.default__ceiling"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "num", "type": null, "description": ""}], "created_at": 1789419970.2626162, "supported_languages": null}, "macro.fivetran_utils.default__ceiling": {"name": "default__ceiling", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/ceiling.sql", "original_file_path": "macros/ceiling.sql", "unique_id": "macro.fivetran_utils.default__ceiling", "macro_sql": "{% macro default__ceiling(num) %}\n ceiling({{ num }})\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "num", "type": null, "description": ""}], "created_at": 1789419970.2628174, "supported_languages": null}, "macro.fivetran_utils.snowflake__ceiling": {"name": "snowflake__ceiling", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/ceiling.sql", "original_file_path": "macros/ceiling.sql", "unique_id": "macro.fivetran_utils.snowflake__ceiling", "macro_sql": "{% macro snowflake__ceiling(num) %}\n ceil({{ num }})\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "num", "type": null, "description": ""}], "created_at": 1789419970.2629945, "supported_languages": null}, "macro.fivetran_utils.fill_pass_through_columns": {"name": "fill_pass_through_columns", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/fill_pass_through_columns.sql", "original_file_path": "macros/fill_pass_through_columns.sql", "unique_id": "macro.fivetran_utils.fill_pass_through_columns", "macro_sql": "{% macro fill_pass_through_columns(pass_through_variable) %}\n\n{% if var(pass_through_variable) %}\n {% for field in var(pass_through_variable) %}\n {% if field is mapping %}\n {% if field.transform_sql %}\n , {{ field.transform_sql }} as {{ field.alias if field.alias else field.name }}\n {% else %}\n , {{ field.alias if field.alias else field.name }}\n {% endif %}\n {% else %}\n , {{ field }}\n {% endif %}\n {% endfor %}\n{% endif %}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "pass_through_variable", "type": null, "description": ""}], "created_at": 1789419970.2641497, "supported_languages": null}, "macro.fivetran_utils.persist_pass_through_columns": {"name": "persist_pass_through_columns", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/persist_pass_through_columns.sql", "original_file_path": "macros/persist_pass_through_columns.sql", "unique_id": "macro.fivetran_utils.persist_pass_through_columns", "macro_sql": "{% macro persist_pass_through_columns(pass_through_variable, identifier=none, transform='') %}\n\n{% if var(pass_through_variable, none) %}\n {% for field in var(pass_through_variable) %}\n , {{ transform ~ '(' ~ (identifier ~ '.' if identifier else '') ~ (field.alias if field.alias else field.name) ~ ')' }} as {{ field.alias if field.alias else field.name }}\n {% endfor %}\n{% endif %}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "pass_through_variable", "type": null, "description": ""}, {"name": "identifier", "type": null, "description": ""}, {"name": "transform", "type": null, "description": ""}], "created_at": 1789419970.265262, "supported_languages": null}, "macro.fivetran_utils.try_cast": {"name": "try_cast", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/try_cast.sql", "original_file_path": "macros/try_cast.sql", "unique_id": "macro.fivetran_utils.try_cast", "macro_sql": "{% macro try_cast(field, type) %}\n {{ adapter.dispatch('try_cast', 'fivetran_utils') (field, type) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.postgres__try_cast"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field", "type": null, "description": ""}, {"name": "type", "type": null, "description": ""}], "created_at": 1789419970.2661786, "supported_languages": null}, "macro.fivetran_utils.default__try_cast": {"name": "default__try_cast", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/try_cast.sql", "original_file_path": "macros/try_cast.sql", "unique_id": "macro.fivetran_utils.default__try_cast", "macro_sql": "{% macro default__try_cast(field, type) %}\n {# most databases don't support this function yet\n so we just need to use cast #}\n cast({{field}} as {{type}})\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field", "type": null, "description": ""}, {"name": "type", "type": null, "description": ""}], "created_at": 1789419970.2664347, "supported_languages": null}, "macro.fivetran_utils.redshift__try_cast": {"name": "redshift__try_cast", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/try_cast.sql", "original_file_path": "macros/try_cast.sql", "unique_id": "macro.fivetran_utils.redshift__try_cast", "macro_sql": "{% macro redshift__try_cast(field, type) %}\n{%- if type == 'numeric' -%}\n\n case\n when trim({{field}}) ~ '^(0|[1-9][0-9]*)$' then trim({{field}})\n else null\n end::{{type}}\n\n{% else %}\n {{ exceptions.raise_compiler_error(\n \"non-numeric datatypes are not currently supported\") }}\n\n{% endif %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field", "type": null, "description": ""}, {"name": "type", "type": null, "description": ""}], "created_at": 1789419970.2669196, "supported_languages": null}, "macro.fivetran_utils.postgres__try_cast": {"name": "postgres__try_cast", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/try_cast.sql", "original_file_path": "macros/try_cast.sql", "unique_id": "macro.fivetran_utils.postgres__try_cast", "macro_sql": "{% macro postgres__try_cast(field, type) %}\n{%- if type == 'numeric' -%}\n\n case\n when replace(cast({{field}} as varchar),cast(' ' as varchar),cast('' as varchar)) ~ '^(0|[1-9][0-9]*)$' \n then replace(cast({{field}} as varchar),cast(' ' as varchar),cast('' as varchar))\n else null\n end::{{type}}\n\n{% else %}\n {{ exceptions.raise_compiler_error(\n \"non-numeric datatypes are not currently supported\") }}\n\n{% endif %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field", "type": null, "description": ""}, {"name": "type", "type": null, "description": ""}], "created_at": 1789419970.2674005, "supported_languages": null}, "macro.fivetran_utils.snowflake__try_cast": {"name": "snowflake__try_cast", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/try_cast.sql", "original_file_path": "macros/try_cast.sql", "unique_id": "macro.fivetran_utils.snowflake__try_cast", "macro_sql": "{% macro snowflake__try_cast(field, type) %}\n try_cast(cast({{field}} as varchar) as {{type}})\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field", "type": null, "description": ""}, {"name": "type", "type": null, "description": ""}], "created_at": 1789419970.2676237, "supported_languages": null}, "macro.fivetran_utils.bigquery__try_cast": {"name": "bigquery__try_cast", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/try_cast.sql", "original_file_path": "macros/try_cast.sql", "unique_id": "macro.fivetran_utils.bigquery__try_cast", "macro_sql": "{% macro bigquery__try_cast(field, type) %}\n safe_cast({{field}} as {{type}})\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field", "type": null, "description": ""}, {"name": "type", "type": null, "description": ""}], "created_at": 1789419970.2679844, "supported_languages": null}, "macro.fivetran_utils.spark__try_cast": {"name": "spark__try_cast", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/try_cast.sql", "original_file_path": "macros/try_cast.sql", "unique_id": "macro.fivetran_utils.spark__try_cast", "macro_sql": "{% macro spark__try_cast(field, type) %}\n try_cast({{field}} as {{type}})\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field", "type": null, "description": ""}, {"name": "type", "type": null, "description": ""}], "created_at": 1789419970.2682095, "supported_languages": null}, "macro.fivetran_utils.sqlserver__try_cast": {"name": "sqlserver__try_cast", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/try_cast.sql", "original_file_path": "macros/try_cast.sql", "unique_id": "macro.fivetran_utils.sqlserver__try_cast", "macro_sql": "{% macro sqlserver__try_cast(field, type) %}\n try_cast({{field}} as {{type}})\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field", "type": null, "description": ""}, {"name": "type", "type": null, "description": ""}], "created_at": 1789419970.2684226, "supported_languages": null}, "macro.fivetran_utils.fivetran_date_spine": {"name": "fivetran_date_spine", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/fivetran_date_spine.sql", "original_file_path": "macros/fivetran_date_spine.sql", "unique_id": "macro.fivetran_utils.fivetran_date_spine", "macro_sql": "{% macro fivetran_date_spine(datepart, start_date, end_date) -%}\n\n{{ return(adapter.dispatch('fivetran_date_spine', 'fivetran_utils') (datepart, start_date, end_date)) }}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.default__fivetran_date_spine"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "datepart", "type": null, "description": ""}, {"name": "start_date", "type": null, "description": ""}, {"name": "end_date", "type": null, "description": ""}], "created_at": 1789419970.2693393, "supported_languages": null}, "macro.fivetran_utils.default__fivetran_date_spine": {"name": "default__fivetran_date_spine", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/fivetran_date_spine.sql", "original_file_path": "macros/fivetran_date_spine.sql", "unique_id": "macro.fivetran_utils.default__fivetran_date_spine", "macro_sql": "{% macro default__fivetran_date_spine(datepart, start_date, end_date) %}\n\n {{ dbt_utils.date_spine(datepart, start_date, end_date) }}\n \n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.date_spine"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "datepart", "type": null, "description": ""}, {"name": "start_date", "type": null, "description": ""}, {"name": "end_date", "type": null, "description": ""}], "created_at": 1789419970.2696517, "supported_languages": null}, "macro.fivetran_utils.sqlserver__fivetran_date_spine": {"name": "sqlserver__fivetran_date_spine", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/fivetran_date_spine.sql", "original_file_path": "macros/fivetran_date_spine.sql", "unique_id": "macro.fivetran_utils.sqlserver__fivetran_date_spine", "macro_sql": "{% macro sqlserver__fivetran_date_spine(datepart, start_date, end_date) -%}\n\n {% set date_spine_query %}\n with\n\n l0 as (\n\n select c\n from (select 1 union all select 1) as d(c)\n\n ),\n l1 as (\n\n select\n 1 as c\n from l0 as a\n cross join l0 as b\n\n ),\n\n l2 as (\n\n select 1 as c\n from l1 as a\n cross join l1 as b\n ),\n\n l3 as (\n\n select 1 as c\n from l2 as a\n cross join l2 as b\n ),\n\n l4 as (\n\n select 1 as c\n from l3 as a\n cross join l3 as b\n ),\n\n l5 as (\n\n select 1 as c\n from l4 as a\n cross join l4 as b\n ),\n\n nums as (\n\n select row_number() over (order by (select null)) as rownum\n from l5\n ),\n\n rawdata as (\n\n select top ({{dbt.datediff(start_date, end_date, datepart)}}) rownum -1 as n\n from nums\n order by rownum\n ),\n\n all_periods as (\n\n select (\n {{\n dbt.dateadd(\n datepart,\n 'n',\n start_date\n )\n }}\n ) as date_{{datepart}}\n from rawdata\n ),\n\n filtered as (\n\n select *\n from all_periods\n where date_{{datepart}} <= {{ end_date }}\n\n )\n\n select * from filtered\n order by 1\n\n {% endset %}\n\n {% set results = run_query(date_spine_query) %}\n\n {% if execute %}\n\n {% set results_list = results.columns[0].values() %}\n \n {% else %}\n\n {% set results_list = [] %}\n\n {% endif %}\n\n {%- for date_field in results_list %}\n select cast('{{ date_field }}' as date) as date_{{datepart}} {{ 'union all ' if not loop.last else '' }}\n {% endfor -%}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.datediff", "macro.dbt.dateadd", "macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "datepart", "type": null, "description": ""}, {"name": "start_date", "type": null, "description": ""}, {"name": "end_date", "type": null, "description": ""}], "created_at": 1789419970.2710762, "supported_languages": null}, "macro.fivetran_utils.partition_by_source_relation": {"name": "partition_by_source_relation", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/partition_by_source_relation.sql", "original_file_path": "macros/partition_by_source_relation.sql", "unique_id": "macro.fivetran_utils.partition_by_source_relation", "macro_sql": "{% macro partition_by_source_relation(package_name, has_other_partitions='yes', alias=None, package_prefix_union_variable=true) %}\n {{ return(adapter.dispatch('partition_by_source_relation', 'fivetran_utils')(package_name, has_other_partitions, alias, package_prefix_union_variable)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.default__partition_by_source_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "package_name", "type": null, "description": ""}, {"name": "has_other_partitions", "type": null, "description": ""}, {"name": "alias", "type": null, "description": ""}, {"name": "package_prefix_union_variable", "type": null, "description": ""}], "created_at": 1789419970.2720149, "supported_languages": null}, "macro.fivetran_utils.default__partition_by_source_relation": {"name": "default__partition_by_source_relation", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/partition_by_source_relation.sql", "original_file_path": "macros/partition_by_source_relation.sql", "unique_id": "macro.fivetran_utils.default__partition_by_source_relation", "macro_sql": "{% macro default__partition_by_source_relation(package_name, has_other_partitions='yes', alias=None, package_prefix_union_variable=true) -%}\n\n{%- if package_prefix_union_variable %}\n {%- set union_schemas_var = package_name ~ '_union_schemas' -%}\n {%- set union_databases_var = package_name ~ '_union_databases' -%}\n{%- else %}\n {%- set union_schemas_var = 'union_schemas' -%}\n {%- set union_databases_var = 'union_databases' -%}\n{%- endif -%}\n\n{%- set is_unioning = var(union_schemas_var, [])|length > 1 or var(union_databases_var, [])|length > 1 or var(package_name ~ '_sources', [])|length > 1 -%}\n{%- set prefix = '' if alias is none else alias ~ '.' -%}\n\n{%- if has_other_partitions == 'no' -%}\n {{- 'partition by ' ~ prefix ~ 'source_relation' if is_unioning else '' -}}\n{%- else -%}\n {{- ', ' ~ prefix ~ 'source_relation' if is_unioning else '' -}}\n{%- endif -%}\n\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "package_name", "type": null, "description": ""}, {"name": "has_other_partitions", "type": null, "description": ""}, {"name": "alias", "type": null, "description": ""}, {"name": "package_prefix_union_variable", "type": null, "description": ""}], "created_at": 1789419970.2735422, "supported_languages": null}, "macro.fivetran_utils.fill_staging_columns": {"name": "fill_staging_columns", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/fill_staging_columns.sql", "original_file_path": "macros/fill_staging_columns.sql", "unique_id": "macro.fivetran_utils.fill_staging_columns", "macro_sql": "{% macro fill_staging_columns(source_columns, staging_columns) %}\n\n{%- set source_column_names = source_columns|map(attribute='name')|map('lower')|list -%}\n{%- set using_source_casing = var('fivetran_using_source_casing', false) -%}\n\n{%- for column in staging_columns %}\n {%- if column.name|lower in source_column_names %}\n {%- if using_source_casing %}\n {%- set column_alias = column.alias if 'alias' in column else column.name %}\n {{ adapter.quote(column.name) }} as {{ adapter.quote(column_alias|upper if target.type == 'snowflake' else column_alias) }}\n {%- else %}\n {{ fivetran_utils.quote_column(column) }} as\n {%- if 'alias' in column %} {{ column.alias }}{% else %} {{ fivetran_utils.quote_column(column) }}{% endif %}\n {%- endif %}\n {%- else %}\n cast(null as {{ column.datatype }}) as\n {%- if 'alias' in column %} {{ column.alias }}{% else %} {{ fivetran_utils.quote_column(column) }}{% endif %}\n {%- endif %}{{ ',' if not loop.last }}\n{%- endfor %}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.quote_column"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "source_columns", "type": null, "description": ""}, {"name": "staging_columns", "type": null, "description": ""}], "created_at": 1789419970.2760534, "supported_languages": null}, "macro.fivetran_utils.quote_column": {"name": "quote_column", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/fill_staging_columns.sql", "original_file_path": "macros/fill_staging_columns.sql", "unique_id": "macro.fivetran_utils.quote_column", "macro_sql": "{% macro quote_column(column) %}\n {%- if 'quote' in column %}\n {%- if column.quote %}\n {%- if target.type in ('bigquery', 'spark', 'databricks') %}\n `{{ column.name }}`\n {%- elif target.type == 'snowflake' %}\n \"{{ column.name | upper }}\"\n {%- else %}\n \"{{ column.name }}\"\n {%- endif %}\n {%- else %}{{ column.name }}\n {%- endif %}\n {%- else %}{{ column.name }}\n {%- endif %}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "column", "type": null, "description": ""}], "created_at": 1789419970.2775865, "supported_languages": null}, "macro.fivetran_utils.union_connections": {"name": "union_connections", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/union_connections.sql", "original_file_path": "macros/union_connections.sql", "unique_id": "macro.fivetran_utils.union_connections", "macro_sql": "{% macro union_connections(connection_dictionary, single_source_name, single_table_name, default_identifier=single_table_name) %}\n\n{{ adapter.dispatch('union_connections', 'fivetran_utils') (connection_dictionary, single_source_name, single_table_name, default_identifier) }}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.default__union_connections"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "connection_dictionary", "type": null, "description": ""}, {"name": "single_source_name", "type": null, "description": ""}, {"name": "single_table_name", "type": null, "description": ""}, {"name": "default_identifier", "type": null, "description": ""}], "created_at": 1789419970.2790241, "supported_languages": null}, "macro.fivetran_utils.default__union_connections": {"name": "default__union_connections", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/union_connections.sql", "original_file_path": "macros/union_connections.sql", "unique_id": "macro.fivetran_utils.default__union_connections", "macro_sql": "{% macro default__union_connections(connection_dictionary, single_source_name, single_table_name, default_identifier=single_table_name) %}\n\n{%- set exception_warning = \"\\n\\nPlease be aware: The \" ~ single_source_name|upper ~ \".\" ~ single_table_name|upper ~ \" table was not found in your schema(s). The Fivetran Data Model will create a completely empty staging model as to not break downstream transformations. To turn off these warnings, set the `fivetran__remove_empty_table_warnings` variable to TRUE (see https://github.com/fivetran/dbt_fivetran_utils/tree/releases/v0.4.latest#union_connections-source for details).\\n\"%}\n{%- set using_empty_table_warnings = (execute and not var('fivetran__remove_empty_table_warnings', false)) %}\n{%- set connections = var(connection_dictionary, []) %}\n{%- set using_unioning = connections | length > 0 %}\n{%- set identifier_var = single_source_name + \"_\" + single_table_name + \"_identifier\" %}\n\n{%- if using_unioning %}\n{# For unioning #}\n {%- set relations = [] -%}\n {%- for connection in connections -%}\n\n {% if var('has_defined_sources', false) %}\n {%- set database = source(connection.name, single_table_name).database %}\n {%- set schema = source(connection.name, single_table_name).schema %}\n {%- set identifier = source(connection.name, single_table_name).identifier %}\n {%- else %}\n {%- set database = connection.database if connection.database else target.database %}\n {%- set schema = connection.schema if connection.schema else single_source_name %}\n {%- set identifier = var(identifier_var, default_identifier) %}\n {%- endif %}\n \n {%- set relation=adapter.get_relation(\n database=database,\n schema=schema,\n identifier=identifier\n )\n -%}\n\n {%- if relation is not none -%}\n {%- do relations.append(relation) -%}\n {%- endif -%}\n\n -- ** Values passed to adapter.get_relation:\n {{ '-- database: ' ~ database }}\n {{ '-- schema: ' ~ schema }}\n {{ '-- identifier: ' ~ identifier ~ '\\n' }}\n\n {%- endfor -%}\n\n {%- if relations | length > 0 -%}\n {{ fivetran_utils.union_relations_custom(relations, source_column_name='_dbt_source_relation') }}\n\n {%- else -%}\n {{ exceptions.warn(exception_warning) if using_empty_table_warnings }}\n\n select\n cast(null as {{ dbt.type_string() }}) as _dbt_source_relation\n limit {{ '0' if target.type != 'redshift' else '1' }}\n {%- endif -%}\n\n{% else %}\n{# Not unioning #}\n\n {%- set database = source(single_source_name, single_table_name).database %}\n {%- set schema = source(single_source_name, single_table_name).schema %}\n {%- set identifier = var(identifier_var, default_identifier) %}\n\n {%- set relation=adapter.get_relation(\n database=database,\n schema=schema,\n identifier=identifier\n )\n -%}\n\n -- ** Values passed to adapter.get_relation:\n {{ '-- full-identifier_var: ' ~ identifier_var }}\n {{ '-- database: ' ~ database }} \n {{ '-- schema: ' ~ schema }}\n {{ '-- identifier: ' ~ identifier ~ '\\n' }}\n\n {% if relation is not none -%}\n select\n {{ dbt_utils.star(from=source(single_source_name, single_table_name)) }}\n from {{ source(single_source_name, single_table_name) }} as source_table\n\n {% else %}\n {{ exceptions.warn(exception_warning) if using_empty_table_warnings }}\n\n select\n cast(null as {{ dbt.type_string() }}) as _dbt_source_relation\n limit {{ '0' if target.type != 'redshift' else '1' }}\n {%- endif -%}\n{% endif -%}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.union_relations_custom", "macro.dbt.type_string", "macro.dbt_utils.star"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "connection_dictionary", "type": null, "description": ""}, {"name": "single_source_name", "type": null, "description": ""}, {"name": "single_table_name", "type": null, "description": ""}, {"name": "default_identifier", "type": null, "description": ""}], "created_at": 1789419970.2836392, "supported_languages": null}, "macro.fivetran_utils.source_relation": {"name": "source_relation", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/source_relation.sql", "original_file_path": "macros/source_relation.sql", "unique_id": "macro.fivetran_utils.source_relation", "macro_sql": "{% macro source_relation(union_schema_variable='union_schemas', union_database_variable='union_databases') -%}\n\n{{ adapter.dispatch('source_relation', 'fivetran_utils') (union_schema_variable, union_database_variable) }}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.default__source_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "union_schema_variable", "type": null, "description": ""}, {"name": "union_database_variable", "type": null, "description": ""}], "created_at": 1789419970.284378, "supported_languages": null}, "macro.fivetran_utils.default__source_relation": {"name": "default__source_relation", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/source_relation.sql", "original_file_path": "macros/source_relation.sql", "unique_id": "macro.fivetran_utils.default__source_relation", "macro_sql": "{% macro default__source_relation(union_schema_variable, union_database_variable) %}\n\n{% if var(union_schema_variable, none) %}\n, case\n {% for schema in var(union_schema_variable) %}\n when lower(replace(replace(_dbt_source_relation,'\"',''),'`','')) like '%.{{ schema|lower }}.%' then '{{ schema|lower }}'\n {% endfor %}\n end as source_relation\n{% elif var(union_database_variable, none) %}\n, case\n {% for database in var(union_database_variable) %}\n when lower(replace(replace(_dbt_source_relation,'\"',''),'`','')) like '%{{ database|lower }}.%' then '{{ database|lower }}'\n {% endfor %}\n end as source_relation\n{% else %}\n, cast('' as {{ dbt.type_string() }}) as source_relation\n{% endif %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "union_schema_variable", "type": null, "description": ""}, {"name": "union_database_variable", "type": null, "description": ""}], "created_at": 1789419970.2853503, "supported_languages": null}, "macro.fivetran_utils.apply_source_relation": {"name": "apply_source_relation", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/apply_source_relation.sql", "original_file_path": "macros/apply_source_relation.sql", "unique_id": "macro.fivetran_utils.apply_source_relation", "macro_sql": "{% macro apply_source_relation(package_name, use_package_prefix=true) -%}\n\n{{ adapter.dispatch('apply_source_relation', 'fivetran_utils') (package_name, use_package_prefix) }}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.default__apply_source_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "package_name", "type": null, "description": ""}, {"name": "use_package_prefix", "type": null, "description": ""}], "created_at": 1789419970.2861254, "supported_languages": null}, "macro.fivetran_utils.default__apply_source_relation": {"name": "default__apply_source_relation", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/apply_source_relation.sql", "original_file_path": "macros/apply_source_relation.sql", "unique_id": "macro.fivetran_utils.default__apply_source_relation", "macro_sql": "{% macro default__apply_source_relation(package_name, use_package_prefix=true) -%}\n\n{% set sources_var = package_name ~ '_sources' %}\n{% set database_var = package_name ~ '_database' %}\n{% set schema_var = package_name ~ '_schema' %}\n\n{% if use_package_prefix %}\n {% set union_schemas_var = package_name ~ '_union_schemas' %}\n {% set union_databases_var = package_name ~ '_union_databases' %}\n{% else %}\n {% set union_schemas_var = 'union_schemas' %}\n {% set union_databases_var = 'union_databases' %}\n{% endif %}\n\n{% if var(sources_var, []) | length > 0 %}\n, _dbt_source_relation as source_relation\n{% elif var(union_schemas_var, []) | length > 0 or var(union_databases_var, []) | length > 0 %}\n{{ fivetran_utils.source_relation(union_schema_variable=union_schemas_var, union_database_variable=union_databases_var) }}\n{% else %}\n{% set database = var(database_var, target.database) %}\n{% set schema = var(schema_var, package_name) %}\n, cast('{{ database ~ \".\" ~ schema }}' as {{ dbt.type_string() }}) as source_relation\n{% endif %}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.source_relation", "macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "package_name", "type": null, "description": ""}, {"name": "use_package_prefix", "type": null, "description": ""}], "created_at": 1789419970.28795, "supported_languages": null}, "macro.fivetran_utils.calculated_fields": {"name": "calculated_fields", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/calculated_fields.sql", "original_file_path": "macros/calculated_fields.sql", "unique_id": "macro.fivetran_utils.calculated_fields", "macro_sql": "{% macro calculated_fields(variable) -%}\n\n{% if var(variable, none) %}\n {% for field in var(variable) %}\n , {{ field.transform_sql }} as {{ field.name }} \n {% endfor %}\n{% endif %}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "variable", "type": null, "description": ""}], "created_at": 1789419970.2886033, "supported_languages": null}, "macro.fivetran_utils.union_data": {"name": "union_data", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/union_data.sql", "original_file_path": "macros/union_data.sql", "unique_id": "macro.fivetran_utils.union_data", "macro_sql": "{%- macro union_data(table_identifier, database_variable, schema_variable, default_database, default_schema, default_variable, union_schema_variable='union_schemas', union_database_variable='union_databases') -%}\n\n{{ adapter.dispatch('union_data', 'fivetran_utils') (\n table_identifier, \n database_variable, \n schema_variable, \n default_database, \n default_schema, \n default_variable,\n union_schema_variable,\n union_database_variable\n ) }}\n\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.fivetran_utils.default__union_data"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "table_identifier", "type": null, "description": ""}, {"name": "database_variable", "type": null, "description": ""}, {"name": "schema_variable", "type": null, "description": ""}, {"name": "default_database", "type": null, "description": ""}, {"name": "default_schema", "type": null, "description": ""}, {"name": "default_variable", "type": null, "description": ""}, {"name": "union_schema_variable", "type": null, "description": ""}, {"name": "union_database_variable", "type": null, "description": ""}], "created_at": 1789419970.290683, "supported_languages": null}, "macro.fivetran_utils.default__union_data": {"name": "default__union_data", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/union_data.sql", "original_file_path": "macros/union_data.sql", "unique_id": "macro.fivetran_utils.default__union_data", "macro_sql": "{%- macro default__union_data(\n table_identifier, \n database_variable, \n schema_variable, \n default_database, \n default_schema, \n default_variable,\n union_schema_variable,\n union_database_variable\n ) -%}\n\n{%- if var(union_schema_variable, none) -%}\n\n {%- set relations = [] -%}\n \n {%- if var(union_schema_variable) is string -%}\n {%- set trimmed = var(union_schema_variable)|trim('[')|trim(']') -%}\n {%- set schemas = trimmed.split(',')|map('trim',\" \")|map('trim','\"')|map('trim',\"'\") -%}\n {%- else -%}\n {%- set schemas = var(union_schema_variable) -%}\n {%- endif -%}\n\n {%- for schema in var(union_schema_variable) -%}\n {%- set relation=adapter.get_relation(\n database=source(schema, table_identifier).database if var('has_defined_sources', false) else var(database_variable, default_database),\n schema=source(schema, table_identifier).schema if var('has_defined_sources', false) else schema,\n identifier=source(schema, table_identifier).identifier if var('has_defined_sources', false) else table_identifier\n ) -%}\n \n {%- set relation_exists=relation is not none -%}\n\n {%- if relation_exists -%}\n {%- do relations.append(relation) -%}\n {%- endif -%}\n\n {%- endfor -%}\n \n {%- if relations != [] -%}\n {{ dbt_utils.union_relations(relations) }}\n {%- else -%}\n {% if execute and not var('fivetran__remove_empty_table_warnings', false) -%}\n {{ exceptions.warn(\"\\n\\nPlease be aware: The \" ~ table_identifier|upper ~ \" table was not found in your \" ~ default_schema|upper ~ \" schema(s). The Fivetran dbt package will create a completely empty \" ~ table_identifier|upper ~ \" staging model as to not break downstream transformations. To turn off these warnings, set the `fivetran__remove_empty_table_warnings` variable to TRUE (see https://github.com/fivetran/dbt_fivetran_utils/tree/releases/v0.4.latest#union_data-source for details).\\n\") }}\n {% endif -%}\n select \n cast(null as {{ dbt.type_string() }}) as _dbt_source_relation\n limit 0\n {%- endif -%}\n\n{%- elif var(union_database_variable, none) -%}\n\n {%- set relations = [] -%}\n\n {%- for database in var(union_database_variable) -%}\n {%- set relation=adapter.get_relation(\n database=source(schema, table_identifier).database if var('has_defined_sources', false) else database,\n schema=source(schema, table_identifier).schema if var('has_defined_sources', false) else var(schema_variable, default_schema),\n identifier=source(schema, table_identifier).identifier if var('has_defined_sources', false) else table_identifier\n ) -%}\n\n {%- set relation_exists=relation is not none -%}\n\n {%- if relation_exists -%}\n {%- do relations.append(relation) -%}\n {%- endif -%}\n\n {%- endfor -%}\n\n {%- if relations != [] -%}\n {{ dbt_utils.union_relations(relations) }}\n {%- else -%}\n {% if execute and not var('fivetran__remove_empty_table_warnings', false) -%}\n {{ exceptions.warn(\"\\n\\nPlease be aware: The \" ~ table_identifier|upper ~ \" table was not found in your \" ~ default_schema|upper ~ \" schema(s). The Fivetran dbt package will create a completely empty \" ~ table_identifier|upper ~ \" staging model as to not break downstream transformations. To turn off these warnings, set the `fivetran__remove_empty_table_warnings` variable to TRUE (see https://github.com/fivetran/dbt_fivetran_utils/tree/releases/v0.4.latest#union_data-source for details).\\n\") }}\n {% endif -%}\n select \n cast(null as {{ dbt.type_string() }}) as _dbt_source_relation\n limit 0\n {%- endif -%}\n\n{%- else -%}\n {% set exception_schemas = {\"linkedin_company_pages\": \"linkedin_pages\", \"instagram_business_pages\": \"instagram_business\"} %}\n {% set relation = namespace(value=\"\") %}\n {% if default_schema in exception_schemas.keys() %}\n {% for corrected_schema_name in exception_schemas.items() %} \n {% if default_schema in corrected_schema_name %}\n {# In order for this macro to effectively work within upstream integration tests (mainly used by the Fivetran dbt package maintainers), this identifier variable selection is required to use the macro with different identifier names. #}\n {% set identifier_var = corrected_schema_name[1] + \"_\" + table_identifier + \"_identifier\" %}\n {%- set relation.value=adapter.get_relation(\n database=source(corrected_schema_name[1], table_identifier).database,\n schema=source(corrected_schema_name[1], table_identifier).schema,\n identifier=var(identifier_var, table_identifier)\n ) -%}\n {% endif %}\n {% endfor %}\n {% else %}\n {# In order for this macro to effectively work within upstream integration tests (mainly used by the Fivetran dbt package maintainers), this identifier variable selection is required to use the macro with different identifier names. #}\n {% set identifier_var = default_schema + \"_\" + table_identifier + \"_identifier\" %}\n {# Unfortunately the Twitter Organic identifiers were misspelled. As such, we will need to account for this in the model. This will be adjusted in the Twitter Organic package, but to ensure backwards compatibility, this needs to be included. #}\n {% if var(identifier_var, none) is none %} \n {% set identifier_var = default_schema + \"_\" + table_identifier + \"_identifer\" %}\n {% endif %}\n {%- set relation.value=adapter.get_relation(\n database=source(default_schema, table_identifier).database,\n schema=source(default_schema, table_identifier).schema,\n identifier=var(identifier_var, table_identifier)\n ) -%}\n {% endif %}\n{%- set table_exists=relation.value is not none -%}\n\n{%- if table_exists -%}\n select * \n from {{ relation.value }}\n{%- else -%}\n {% if execute and not var('fivetran__remove_empty_table_warnings', false) -%}\n {{ exceptions.warn(\"\\n\\nPlease be aware: The \" ~ table_identifier|upper ~ \" table was not found in your \" ~ default_schema|upper ~ \" schema(s). The Fivetran dbt package will create a completely empty \" ~ table_identifier|upper ~ \" staging model as to not break downstream transformations. To turn off these warnings, set the `fivetran__remove_empty_table_warnings` variable to TRUE (see https://github.com/fivetran/dbt_fivetran_utils/tree/releases/v0.4.latest#union_data-source for details).\\n\") }}\n {% endif -%}\n select \n cast(null as {{ dbt.type_string() }}) as _dbt_source_relation\n limit 0\n{%- endif -%}\n{%- endif -%}\n\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt_utils.union_relations", "macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "table_identifier", "type": null, "description": ""}, {"name": "database_variable", "type": null, "description": ""}, {"name": "schema_variable", "type": null, "description": ""}, {"name": "default_database", "type": null, "description": ""}, {"name": "default_schema", "type": null, "description": ""}, {"name": "default_variable", "type": null, "description": ""}, {"name": "union_schema_variable", "type": null, "description": ""}, {"name": "union_database_variable", "type": null, "description": ""}], "created_at": 1789419970.2984629, "supported_languages": null}, "macro.fivetran_utils.pivot_json_extract": {"name": "pivot_json_extract", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/pivot_json_extract.sql", "original_file_path": "macros/pivot_json_extract.sql", "unique_id": "macro.fivetran_utils.pivot_json_extract", "macro_sql": "{% macro pivot_json_extract(string, list_of_properties) %}\n\n{%- for property in list_of_properties -%}\n{%- if property is mapping -%}\nreplace( {{ fivetran_utils.json_extract(string, property.name) }}, '\"', '') as {{ property.alias if property.alias else property.name | replace(' ', '_') | replace('.', '_') | lower }}\n\n{%- else -%}\nreplace( {{ fivetran_utils.json_extract(string, property) }}, '\"', '') as {{ property | replace(' ', '_') | lower }}\n\n{%- endif -%}\n{%- if not loop.last -%},{%- endif %}\n{% endfor -%}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.json_extract"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "string", "type": null, "description": ""}, {"name": "list_of_properties", "type": null, "description": ""}], "created_at": 1789419970.2999218, "supported_languages": null}, "macro.fivetran_utils.add_dbt_source_relation": {"name": "add_dbt_source_relation", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/add_dbt_source_relation.sql", "original_file_path": "macros/add_dbt_source_relation.sql", "unique_id": "macro.fivetran_utils.add_dbt_source_relation", "macro_sql": "{% macro add_dbt_source_relation() %}\n\n{% if var('union_schemas', none) or var('union_databases', none) %}\n, _dbt_source_relation\n{% endif %}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789419970.3004234, "supported_languages": null}, "macro.fivetran_utils.array_agg": {"name": "array_agg", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/array_agg.sql", "original_file_path": "macros/array_agg.sql", "unique_id": "macro.fivetran_utils.array_agg", "macro_sql": "{% macro array_agg(field_to_agg) -%}\n\n{{ adapter.dispatch('array_agg', 'fivetran_utils') (field_to_agg) }}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.default__array_agg"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field_to_agg", "type": null, "description": ""}], "created_at": 1789419970.3009062, "supported_languages": null}, "macro.fivetran_utils.default__array_agg": {"name": "default__array_agg", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/array_agg.sql", "original_file_path": "macros/array_agg.sql", "unique_id": "macro.fivetran_utils.default__array_agg", "macro_sql": "{% macro default__array_agg(field_to_agg) %}\n array_agg({{ field_to_agg }})\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field_to_agg", "type": null, "description": ""}], "created_at": 1789419970.3011067, "supported_languages": null}, "macro.fivetran_utils.redshift__array_agg": {"name": "redshift__array_agg", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/array_agg.sql", "original_file_path": "macros/array_agg.sql", "unique_id": "macro.fivetran_utils.redshift__array_agg", "macro_sql": "{% macro redshift__array_agg(field_to_agg) %}\n listagg({{ field_to_agg }}, ',')\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field_to_agg", "type": null, "description": ""}], "created_at": 1789419970.3012834, "supported_languages": null}, "macro.fivetran_utils.collect_freshness": {"name": "collect_freshness", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/collect_freshness.sql", "original_file_path": "macros/collect_freshness.sql", "unique_id": "macro.fivetran_utils.collect_freshness", "macro_sql": "{% macro collect_freshness(source, loaded_at_field, filter) %}\n {{ return(adapter.dispatch('collect_freshness')(source, loaded_at_field, filter))}}\n{% endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.default__collect_freshness"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "source", "type": null, "description": ""}, {"name": "loaded_at_field", "type": null, "description": ""}, {"name": "filter", "type": null, "description": ""}], "created_at": 1789419970.3021262, "supported_languages": null}, "macro.fivetran_utils.default__collect_freshness": {"name": "default__collect_freshness", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/collect_freshness.sql", "original_file_path": "macros/collect_freshness.sql", "unique_id": "macro.fivetran_utils.default__collect_freshness", "macro_sql": "{% macro default__collect_freshness(source, loaded_at_field, filter) %}\n {% call statement('collect_freshness', fetch_result=True, auto_begin=False) -%}\n\n {%- set enabled_array = [] -%}\n {% for node in graph.sources.values() %}\n {% if node.identifier == source.identifier %}\n {% if (node.meta['is_enabled'] | default(true)) %}\n {%- do enabled_array.append(1) -%}\n {% endif %}\n {% endif %}\n {% endfor %}\n {% set is_enabled = (enabled_array != []) %}\n\n select\n {% if is_enabled %}\n max({{ loaded_at_field }})\n {% else %} \n {{ current_timestamp() }} {% endif %} as max_loaded_at,\n {{ current_timestamp() }} as snapshotted_at\n\n {% if is_enabled %}\n from {{ source }}\n {% if filter %}\n where {{ filter }}\n {% endif %}\n {% endif %}\n\n {% endcall %}\n\n {% if dbt_version.split('.') | map('int') | list >= [1, 5, 0] %}\n {{ return(load_result('collect_freshness')) }}\n {% else %}\n {{ return(load_result('collect_freshness').table) }}\n {% endif %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement", "macro.dbt.current_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "source", "type": null, "description": ""}, {"name": "loaded_at_field", "type": null, "description": ""}, {"name": "filter", "type": null, "description": ""}], "created_at": 1789419970.3042202, "supported_languages": null}, "macro.fivetran_utils.first_value": {"name": "first_value", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/first_value.sql", "original_file_path": "macros/first_value.sql", "unique_id": "macro.fivetran_utils.first_value", "macro_sql": "{% macro first_value(first_value_field, partition_field, order_by_field, order=\"asc\") -%}\n\n{{ adapter.dispatch('first_value', 'fivetran_utils') (first_value_field, partition_field, order_by_field, order) }}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.default__first_value"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "first_value_field", "type": null, "description": ""}, {"name": "partition_field", "type": null, "description": ""}, {"name": "order_by_field", "type": null, "description": ""}, {"name": "order", "type": null, "description": ""}], "created_at": 1789419970.3049972, "supported_languages": null}, "macro.fivetran_utils.default__first_value": {"name": "default__first_value", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/first_value.sql", "original_file_path": "macros/first_value.sql", "unique_id": "macro.fivetran_utils.default__first_value", "macro_sql": "{% macro default__first_value(first_value_field, partition_field, order_by_field, order=\"asc\") %}\n\n first_value( {{ first_value_field }} ignore nulls ) over (partition by {{ partition_field }} order by {{ order_by_field }} {{ order }} )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "first_value_field", "type": null, "description": ""}, {"name": "partition_field", "type": null, "description": ""}, {"name": "order_by_field", "type": null, "description": ""}, {"name": "order", "type": null, "description": ""}], "created_at": 1789419970.3053699, "supported_languages": null}, "macro.fivetran_utils.redshift__first_value": {"name": "redshift__first_value", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/first_value.sql", "original_file_path": "macros/first_value.sql", "unique_id": "macro.fivetran_utils.redshift__first_value", "macro_sql": "{% macro redshift__first_value(first_value_field, partition_field, order_by_field, order=\"asc\") %}\n\n first_value( {{ first_value_field }} ignore nulls ) over (partition by {{ partition_field }} order by {{ order_by_field }} {{ order }} , {{ partition_field }} rows unbounded preceding )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "first_value_field", "type": null, "description": ""}, {"name": "partition_field", "type": null, "description": ""}, {"name": "order_by_field", "type": null, "description": ""}, {"name": "order", "type": null, "description": ""}], "created_at": 1789419970.3057737, "supported_languages": null}, "macro.fivetran_utils.union_relations": {"name": "union_relations", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/union_relations.sql", "original_file_path": "macros/union_relations.sql", "unique_id": "macro.fivetran_utils.union_relations", "macro_sql": "{%- macro union_relations(relations, aliases=none, column_override=none, include=[], exclude=[], source_column_name=none) -%}\n\n {%- if exclude and include -%}\n {{ exceptions.raise_compiler_error(\"Both an exclude and include list were provided to the `union` macro. Only one is allowed\") }}\n {%- endif -%}\n\n {#-- Prevent querying of db in parsing mode. This works because this macro does not create any new refs. -#}\n {%- if not execute %}\n {{ return('') }}\n {% endif -%}\n\n {%- set column_override = column_override if column_override is not none else {} -%}\n {%- set source_column_name = source_column_name if source_column_name is not none else '_dbt_source_relation' -%}\n\n {%- set relation_columns = {} -%}\n {%- set column_superset = {} -%}\n\n {%- for relation in relations -%}\n\n {%- do relation_columns.update({relation: []}) -%}\n\n {%- do dbt_utils._is_relation(relation, 'union_relations') -%}\n {%- set cols = adapter.get_columns_in_relation(relation) -%}\n {%- for col in cols -%}\n\n {#- If an exclude list was provided and the column is in the list, do nothing -#}\n {%- if exclude and col.column in exclude -%}\n\n {#- If an include list was provided and the column is not in the list, do nothing -#}\n {%- elif include and col.column not in include -%}\n\n {#- Otherwise add the column to the column superset -#}\n {%- else -%}\n\n {#- update the list of columns in this relation -#}\n {%- do relation_columns[relation].append(col.column) -%}\n\n {%- if col.column in column_superset -%}\n\n {%- set stored = column_superset[col.column] -%}\n {%- if col.is_string() and stored.is_string() and col.string_size() > stored.string_size() -%}\n\n {%- do column_superset.update({col.column: col}) -%}\n\n {%- endif %}\n\n {%- else -%}\n\n {%- do column_superset.update({col.column: col}) -%}\n\n {%- endif -%}\n\n {%- endif -%}\n\n {%- endfor -%}\n {%- endfor -%}\n\n {%- set ordered_column_names = column_superset.keys() -%}\n\n {%- for relation in relations %}\n\n (\n select\n\n cast({{ dbt.string_literal(relation) }} as {{ dbt.type_string() }}) as {{ source_column_name }},\n {% for col_name in ordered_column_names -%}\n\n {%- set col = column_superset[col_name] %}\n {%- set col_type = column_override.get(col.column, col.data_type) %}\n {%- set col_name = adapter.quote(col_name) if col_name in relation_columns[relation] else 'null' %}\n cast({{ col_name }} as {{ col_type }}) as {{ col.quoted }} {% if not loop.last %},{% endif -%}\n\n {%- endfor %}\n\n from {{ aliases[loop.index0] if aliases else relation }}\n )\n\n {% if not loop.last -%}\n union all\n {% endif -%}\n\n {%- endfor -%}\n\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt_utils._is_relation", "macro.dbt.string_literal", "macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relations", "type": null, "description": ""}, {"name": "aliases", "type": null, "description": ""}, {"name": "column_override", "type": null, "description": ""}, {"name": "include", "type": null, "description": ""}, {"name": "exclude", "type": null, "description": ""}, {"name": "source_column_name", "type": null, "description": ""}], "created_at": 1789419970.3109229, "supported_languages": null}, "macro.fivetran_utils.union_tables": {"name": "union_tables", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/union_relations.sql", "original_file_path": "macros/union_relations.sql", "unique_id": "macro.fivetran_utils.union_tables", "macro_sql": "{%- macro union_tables(tables, column_override=none, include=[], exclude=[], source_column_name='_dbt_source_table') -%}\n\n {%- do exceptions.warn(\"Warning: the `union_tables` macro is no longer supported and will be deprecated in a future release of dbt-utils. Use the `union_relations` macro instead\") -%}\n\n {{ return(dbt_utils.union_relations(tables, column_override, include, exclude, source_column_name)) }}\n\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt_utils.union_relations"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "tables", "type": null, "description": ""}, {"name": "column_override", "type": null, "description": ""}, {"name": "include", "type": null, "description": ""}, {"name": "exclude", "type": null, "description": ""}, {"name": "source_column_name", "type": null, "description": ""}], "created_at": 1789419970.3116043, "supported_languages": null}, "macro.fivetran_utils.timestamp_diff": {"name": "timestamp_diff", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/timestamp_diff.sql", "original_file_path": "macros/timestamp_diff.sql", "unique_id": "macro.fivetran_utils.timestamp_diff", "macro_sql": "{% macro timestamp_diff(first_date, second_date, datepart) %}\n {{ adapter.dispatch('timestamp_diff', 'fivetran_utils')(first_date, second_date, datepart) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.postgres__timestamp_diff"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "first_date", "type": null, "description": ""}, {"name": "second_date", "type": null, "description": ""}, {"name": "datepart", "type": null, "description": ""}], "created_at": 1789419970.313058, "supported_languages": null}, "macro.fivetran_utils.default__timestamp_diff": {"name": "default__timestamp_diff", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/timestamp_diff.sql", "original_file_path": "macros/timestamp_diff.sql", "unique_id": "macro.fivetran_utils.default__timestamp_diff", "macro_sql": "{% macro default__timestamp_diff(first_date, second_date, datepart) %}\n\n datediff(\n {{ datepart }},\n {{ first_date }},\n {{ second_date }}\n )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "first_date", "type": null, "description": ""}, {"name": "second_date", "type": null, "description": ""}, {"name": "datepart", "type": null, "description": ""}], "created_at": 1789419970.3133752, "supported_languages": null}, "macro.fivetran_utils.redshift__timestamp_diff": {"name": "redshift__timestamp_diff", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/timestamp_diff.sql", "original_file_path": "macros/timestamp_diff.sql", "unique_id": "macro.fivetran_utils.redshift__timestamp_diff", "macro_sql": "{% macro redshift__timestamp_diff(first_date, second_date, datepart) %}\n\n datediff(\n {{ datepart }},\n {{ first_date }},\n {{ second_date }}\n )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "first_date", "type": null, "description": ""}, {"name": "second_date", "type": null, "description": ""}, {"name": "datepart", "type": null, "description": ""}], "created_at": 1789419970.3136637, "supported_languages": null}, "macro.fivetran_utils.bigquery__timestamp_diff": {"name": "bigquery__timestamp_diff", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/timestamp_diff.sql", "original_file_path": "macros/timestamp_diff.sql", "unique_id": "macro.fivetran_utils.bigquery__timestamp_diff", "macro_sql": "{% macro bigquery__timestamp_diff(first_date, second_date, datepart) %}\n\n timestamp_diff(\n {{second_date}},\n {{first_date}},\n {{datepart}}\n )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "first_date", "type": null, "description": ""}, {"name": "second_date", "type": null, "description": ""}, {"name": "datepart", "type": null, "description": ""}], "created_at": 1789419970.3139544, "supported_languages": null}, "macro.fivetran_utils.postgres__timestamp_diff": {"name": "postgres__timestamp_diff", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/timestamp_diff.sql", "original_file_path": "macros/timestamp_diff.sql", "unique_id": "macro.fivetran_utils.postgres__timestamp_diff", "macro_sql": "{% macro postgres__timestamp_diff(first_date, second_date, datepart) %}\n\n {% if datepart == 'year' %}\n (date_part('year', ({{second_date}})::date) - date_part('year', ({{first_date}})::date))\n {% elif datepart == 'quarter' %}\n ({{ dbt.datediff(first_date, second_date, 'year') }} * 4 + date_part('quarter', ({{second_date}})::date) - date_part('quarter', ({{first_date}})::date))\n {% elif datepart == 'month' %}\n ({{ dbt.datediff(first_date, second_date, 'year') }} * 12 + date_part('month', ({{second_date}})::date) - date_part('month', ({{first_date}})::date))\n {% elif datepart == 'day' %}\n (({{second_date}})::date - ({{first_date}})::date)\n {% elif datepart == 'week' %}\n ({{ dbt.datediff(first_date, second_date, 'day') }} / 7 + case\n when date_part('dow', ({{first_date}})::timestamp) <= date_part('dow', ({{second_date}})::timestamp) then\n case when {{first_date}} <= {{second_date}} then 0 else -1 end\n else\n case when {{first_date}} <= {{second_date}} then 1 else 0 end\n end)\n {% elif datepart == 'hour' %}\n ({{ dbt.datediff(first_date, second_date, 'day') }} * 24 + date_part('hour', ({{second_date}})::timestamp) - date_part('hour', ({{first_date}})::timestamp))\n {% elif datepart == 'minute' %}\n ({{ dbt.datediff(first_date, second_date, 'hour') }} * 60 + date_part('minute', ({{second_date}})::timestamp) - date_part('minute', ({{first_date}})::timestamp))\n {% elif datepart == 'second' %}\n ({{ dbt.datediff(first_date, second_date, 'minute') }} * 60 + floor(date_part('second', ({{second_date}})::timestamp)) - floor(date_part('second', ({{first_date}})::timestamp)))\n {% elif datepart == 'millisecond' %}\n ({{ dbt.datediff(first_date, second_date, 'minute') }} * 60000 + floor(date_part('millisecond', ({{second_date}})::timestamp)) - floor(date_part('millisecond', ({{first_date}})::timestamp)))\n {% elif datepart == 'microsecond' %}\n ({{ dbt.datediff(first_date, second_date, 'minute') }} * 60000000 + floor(date_part('microsecond', ({{second_date}})::timestamp)) - floor(date_part('microsecond', ({{first_date}})::timestamp)))\n {% else %}\n {{ exceptions.raise_compiler_error(\"Unsupported datepart for macro datediff in postgres: {!r}\".format(datepart)) }}\n {% endif %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.datediff"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "first_date", "type": null, "description": ""}, {"name": "second_date", "type": null, "description": ""}, {"name": "datepart", "type": null, "description": ""}], "created_at": 1789419970.3168256, "supported_languages": null}, "macro.fivetran_utils.duckdb__timestamp_diff": {"name": "duckdb__timestamp_diff", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/timestamp_diff.sql", "original_file_path": "macros/timestamp_diff.sql", "unique_id": "macro.fivetran_utils.duckdb__timestamp_diff", "macro_sql": "{% macro duckdb__timestamp_diff(first_date, second_date, datepart) %}\n\n datediff('{{ datepart }}', {{ first_date }}, {{ second_date }})\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "first_date", "type": null, "description": ""}, {"name": "second_date", "type": null, "description": ""}, {"name": "datepart", "type": null, "description": ""}], "created_at": 1789419970.3171628, "supported_languages": null}, "macro.fivetran_utils.add_pass_through_columns": {"name": "add_pass_through_columns", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/add_pass_through_columns.sql", "original_file_path": "macros/add_pass_through_columns.sql", "unique_id": "macro.fivetran_utils.add_pass_through_columns", "macro_sql": "{% macro add_pass_through_columns(base_columns, pass_through_var) %}\n\n {% if pass_through_var %}\n\n {% for column in pass_through_var %}\n\n {% if column is mapping %}\n\n {% if column.alias %}\n\n {% do base_columns.append({ \"name\": column.name, \"alias\": column.alias, \"datatype\": column.datatype if column.datatype else dbt.type_string()}) %}\n\n {% else %}\n\n {% do base_columns.append({ \"name\": column.name, \"datatype\": column.datatype if column.datatype else dbt.type_string()}) %}\n \n {% endif %}\n\n {% else %}\n\n {% do base_columns.append({ \"name\": column, \"datatype\": dbt.type_string()}) %}\n\n {% endif %}\n\n {% endfor %}\n\n {% endif %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "base_columns", "type": null, "description": ""}, {"name": "pass_through_var", "type": null, "description": ""}], "created_at": 1789419970.3189714, "supported_languages": null}, "macro.fivetran_utils.timestamp_add": {"name": "timestamp_add", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/timestamp_add.sql", "original_file_path": "macros/timestamp_add.sql", "unique_id": "macro.fivetran_utils.timestamp_add", "macro_sql": "{% macro timestamp_add(datepart, interval, from_timestamp) -%}\n\n{{ adapter.dispatch('timestamp_add', 'fivetran_utils') (datepart, interval, from_timestamp) }}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.postgres__timestamp_add"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "datepart", "type": null, "description": ""}, {"name": "interval", "type": null, "description": ""}, {"name": "from_timestamp", "type": null, "description": ""}], "created_at": 1789419970.3197963, "supported_languages": null}, "macro.fivetran_utils.default__timestamp_add": {"name": "default__timestamp_add", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/timestamp_add.sql", "original_file_path": "macros/timestamp_add.sql", "unique_id": "macro.fivetran_utils.default__timestamp_add", "macro_sql": "{% macro default__timestamp_add(datepart, interval, from_timestamp) %}\n\n timestampadd(\n {{ datepart }},\n {{ interval }},\n {{ from_timestamp }}\n )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "datepart", "type": null, "description": ""}, {"name": "interval", "type": null, "description": ""}, {"name": "from_timestamp", "type": null, "description": ""}], "created_at": 1789419970.320093, "supported_languages": null}, "macro.fivetran_utils.bigquery__timestamp_add": {"name": "bigquery__timestamp_add", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/timestamp_add.sql", "original_file_path": "macros/timestamp_add.sql", "unique_id": "macro.fivetran_utils.bigquery__timestamp_add", "macro_sql": "{% macro bigquery__timestamp_add(datepart, interval, from_timestamp) %}\n\n timestamp_add({{ from_timestamp }}, interval {{ interval }} {{ datepart }})\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "datepart", "type": null, "description": ""}, {"name": "interval", "type": null, "description": ""}, {"name": "from_timestamp", "type": null, "description": ""}], "created_at": 1789419970.3203657, "supported_languages": null}, "macro.fivetran_utils.redshift__timestamp_add": {"name": "redshift__timestamp_add", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/timestamp_add.sql", "original_file_path": "macros/timestamp_add.sql", "unique_id": "macro.fivetran_utils.redshift__timestamp_add", "macro_sql": "{% macro redshift__timestamp_add(datepart, interval, from_timestamp) %}\n\n dateadd(\n {{ datepart }},\n {{ interval }},\n {{ from_timestamp }}\n )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "datepart", "type": null, "description": ""}, {"name": "interval", "type": null, "description": ""}, {"name": "from_timestamp", "type": null, "description": ""}], "created_at": 1789419970.3206377, "supported_languages": null}, "macro.fivetran_utils.postgres__timestamp_add": {"name": "postgres__timestamp_add", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/timestamp_add.sql", "original_file_path": "macros/timestamp_add.sql", "unique_id": "macro.fivetran_utils.postgres__timestamp_add", "macro_sql": "{% macro postgres__timestamp_add(datepart, interval, from_timestamp) %}\n\n {{ from_timestamp }} + ((interval '1 {{ datepart }}') * ({{ interval }}))\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "datepart", "type": null, "description": ""}, {"name": "interval", "type": null, "description": ""}, {"name": "from_timestamp", "type": null, "description": ""}], "created_at": 1789419970.3209527, "supported_languages": null}, "macro.fivetran_utils.spark__timestamp_add": {"name": "spark__timestamp_add", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/timestamp_add.sql", "original_file_path": "macros/timestamp_add.sql", "unique_id": "macro.fivetran_utils.spark__timestamp_add", "macro_sql": "{% macro spark__timestamp_add(datepart, interval, from_timestamp) %}\n\n {{ dbt.dateadd(datepart, interval, from_timestamp) }}\n \n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.dateadd"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "datepart", "type": null, "description": ""}, {"name": "interval", "type": null, "description": ""}, {"name": "from_timestamp", "type": null, "description": ""}], "created_at": 1789419970.3212624, "supported_languages": null}, "macro.fivetran_utils.duckdb__timestamp_add": {"name": "duckdb__timestamp_add", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/timestamp_add.sql", "original_file_path": "macros/timestamp_add.sql", "unique_id": "macro.fivetran_utils.duckdb__timestamp_add", "macro_sql": "{% macro duckdb__timestamp_add(datepart, interval, from_timestamp) %}\n\n {{ from_timestamp }} + ((interval '1 {{ datepart }}') * ({{ interval }}))\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "datepart", "type": null, "description": ""}, {"name": "interval", "type": null, "description": ""}, {"name": "from_timestamp", "type": null, "description": ""}], "created_at": 1789419970.3216758, "supported_languages": null}, "macro.fivetran_utils.enabled_vars": {"name": "enabled_vars", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/enabled_vars.sql", "original_file_path": "macros/enabled_vars.sql", "unique_id": "macro.fivetran_utils.enabled_vars", "macro_sql": "{% macro enabled_vars(vars) %}\n\n{% for v in vars %}\n \n {% if var(v, True) == False %}\n {{ return(False) }}\n {% endif %}\n\n{% endfor %}\n\n{{ return(True) }}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "vars", "type": null, "description": ""}], "created_at": 1789419970.3223777, "supported_languages": null}, "macro.fivetran_utils.wrap_in_quotes": {"name": "wrap_in_quotes", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/wrap_in_quotes.sql", "original_file_path": "macros/wrap_in_quotes.sql", "unique_id": "macro.fivetran_utils.wrap_in_quotes", "macro_sql": "{%- macro wrap_in_quotes(object_to_quote) -%}\n\n{{ return(adapter.dispatch('wrap_in_quotes', 'fivetran_utils')(object_to_quote)) }}\n\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.fivetran_utils.postgres__wrap_in_quotes"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "object_to_quote", "type": null, "description": ""}], "created_at": 1789419970.3230097, "supported_languages": null}, "macro.fivetran_utils.default__wrap_in_quotes": {"name": "default__wrap_in_quotes", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/wrap_in_quotes.sql", "original_file_path": "macros/wrap_in_quotes.sql", "unique_id": "macro.fivetran_utils.default__wrap_in_quotes", "macro_sql": "{%- macro default__wrap_in_quotes(object_to_quote) -%}\n{# bigquery, spark, databricks #}\n `{{ object_to_quote }}`\n{%- endmacro -%}\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "object_to_quote", "type": null, "description": ""}], "created_at": 1789419970.323213, "supported_languages": null}, "macro.fivetran_utils.snowflake__wrap_in_quotes": {"name": "snowflake__wrap_in_quotes", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/wrap_in_quotes.sql", "original_file_path": "macros/wrap_in_quotes.sql", "unique_id": "macro.fivetran_utils.snowflake__wrap_in_quotes", "macro_sql": "{%- macro snowflake__wrap_in_quotes(object_to_quote) -%}\n \"{{ object_to_quote | upper }}\"\n{%- endmacro -%}\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "object_to_quote", "type": null, "description": ""}], "created_at": 1789419970.323412, "supported_languages": null}, "macro.fivetran_utils.redshift__wrap_in_quotes": {"name": "redshift__wrap_in_quotes", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/wrap_in_quotes.sql", "original_file_path": "macros/wrap_in_quotes.sql", "unique_id": "macro.fivetran_utils.redshift__wrap_in_quotes", "macro_sql": "{%- macro redshift__wrap_in_quotes(object_to_quote) -%}\n \"{{ object_to_quote }}\"\n{%- endmacro -%}\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "object_to_quote", "type": null, "description": ""}], "created_at": 1789419970.3235865, "supported_languages": null}, "macro.fivetran_utils.postgres__wrap_in_quotes": {"name": "postgres__wrap_in_quotes", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/wrap_in_quotes.sql", "original_file_path": "macros/wrap_in_quotes.sql", "unique_id": "macro.fivetran_utils.postgres__wrap_in_quotes", "macro_sql": "{%- macro postgres__wrap_in_quotes(object_to_quote) -%}\n \"{{ object_to_quote }}\"\n{%- endmacro -%}\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "object_to_quote", "type": null, "description": ""}], "created_at": 1789419970.323777, "supported_languages": null}, "macro.fivetran_utils.duckdb__wrap_in_quotes": {"name": "duckdb__wrap_in_quotes", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/wrap_in_quotes.sql", "original_file_path": "macros/wrap_in_quotes.sql", "unique_id": "macro.fivetran_utils.duckdb__wrap_in_quotes", "macro_sql": "{%- macro duckdb__wrap_in_quotes(object_to_quote) -%}\n \"{{ object_to_quote }}\"\n{%- endmacro -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "object_to_quote", "type": null, "description": ""}], "created_at": 1789419970.323951, "supported_languages": null}, "macro.fivetran_utils.json_extract": {"name": "json_extract", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/json_extract.sql", "original_file_path": "macros/json_extract.sql", "unique_id": "macro.fivetran_utils.json_extract", "macro_sql": "{% macro json_extract(string, string_path) -%}\n\n{{ adapter.dispatch('json_extract', 'fivetran_utils') (string, string_path) }}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.postgres__json_extract"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "string", "type": null, "description": ""}, {"name": "string_path", "type": null, "description": ""}], "created_at": 1789419970.3246508, "supported_languages": null}, "macro.fivetran_utils.default__json_extract": {"name": "default__json_extract", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/json_extract.sql", "original_file_path": "macros/json_extract.sql", "unique_id": "macro.fivetran_utils.default__json_extract", "macro_sql": "{% macro default__json_extract(string, string_path) %}\n\n json_extract_path_text({{string}}, {{ \"'\" ~ string_path ~ \"'\" }} )\n \n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "string", "type": null, "description": ""}, {"name": "string_path", "type": null, "description": ""}], "created_at": 1789419970.324972, "supported_languages": null}, "macro.fivetran_utils.snowflake__json_extract": {"name": "snowflake__json_extract", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/json_extract.sql", "original_file_path": "macros/json_extract.sql", "unique_id": "macro.fivetran_utils.snowflake__json_extract", "macro_sql": "{% macro snowflake__json_extract(string, string_path) %}\n\n json_extract_path_text(try_parse_json( {{string}} ), {{ \"'\" ~ string_path ~ \"'\" }} )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "string", "type": null, "description": ""}, {"name": "string_path", "type": null, "description": ""}], "created_at": 1789419970.3252537, "supported_languages": null}, "macro.fivetran_utils.redshift__json_extract": {"name": "redshift__json_extract", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/json_extract.sql", "original_file_path": "macros/json_extract.sql", "unique_id": "macro.fivetran_utils.redshift__json_extract", "macro_sql": "{% macro redshift__json_extract(string, string_path) %}\n\n case when is_valid_json( {{string}} ) then json_extract_path_text({{string}}, {{ \"'\" ~ string_path ~ \"'\" }} ) else null end\n \n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "string", "type": null, "description": ""}, {"name": "string_path", "type": null, "description": ""}], "created_at": 1789419970.3255424, "supported_languages": null}, "macro.fivetran_utils.bigquery__json_extract": {"name": "bigquery__json_extract", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/json_extract.sql", "original_file_path": "macros/json_extract.sql", "unique_id": "macro.fivetran_utils.bigquery__json_extract", "macro_sql": "{% macro bigquery__json_extract(string, string_path) %}\n\n json_extract_scalar({{string}}, {{ \"'$.\" ~ string_path ~ \"'\" }} )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "string", "type": null, "description": ""}, {"name": "string_path", "type": null, "description": ""}], "created_at": 1789419970.3258178, "supported_languages": null}, "macro.fivetran_utils.postgres__json_extract": {"name": "postgres__json_extract", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/json_extract.sql", "original_file_path": "macros/json_extract.sql", "unique_id": "macro.fivetran_utils.postgres__json_extract", "macro_sql": "{% macro postgres__json_extract(string, string_path) %}\n\n {{string}}::json->>{{\"'\" ~ string_path ~ \"'\" }}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "string", "type": null, "description": ""}, {"name": "string_path", "type": null, "description": ""}], "created_at": 1789419970.3260827, "supported_languages": null}, "macro.fivetran_utils.extract_url_parameter": {"name": "extract_url_parameter", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/extract_url_parameter.sql", "original_file_path": "macros/extract_url_parameter.sql", "unique_id": "macro.fivetran_utils.extract_url_parameter", "macro_sql": "{% macro extract_url_parameter(field, url_parameter) -%}\n\n{{ adapter.dispatch('extract_url_parameter', 'fivetran_utils') (field, url_parameter) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.default__extract_url_parameter"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field", "type": null, "description": ""}, {"name": "url_parameter", "type": null, "description": ""}], "created_at": 1789419970.3266187, "supported_languages": null}, "macro.fivetran_utils.default__extract_url_parameter": {"name": "default__extract_url_parameter", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/extract_url_parameter.sql", "original_file_path": "macros/extract_url_parameter.sql", "unique_id": "macro.fivetran_utils.default__extract_url_parameter", "macro_sql": "{% macro default__extract_url_parameter(field, url_parameter) -%}\n\n{{ dbt_utils.get_url_parameter(field, url_parameter) }}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.get_url_parameter"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field", "type": null, "description": ""}, {"name": "url_parameter", "type": null, "description": ""}], "created_at": 1789419970.3270378, "supported_languages": null}, "macro.fivetran_utils.spark__extract_url_parameter": {"name": "spark__extract_url_parameter", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/extract_url_parameter.sql", "original_file_path": "macros/extract_url_parameter.sql", "unique_id": "macro.fivetran_utils.spark__extract_url_parameter", "macro_sql": "{% macro spark__extract_url_parameter(field, url_parameter) -%}\n\n{%- set formatted_url_parameter = \"'\" + url_parameter + \"=([^&]+)'\" -%}\nnullif(regexp_extract({{ field }}, {{ formatted_url_parameter }}, 1), '')\n\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field", "type": null, "description": ""}, {"name": "url_parameter", "type": null, "description": ""}], "created_at": 1789419970.3273969, "supported_languages": null}, "macro.fivetran_utils.string_agg": {"name": "string_agg", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/string_agg.sql", "original_file_path": "macros/string_agg.sql", "unique_id": "macro.fivetran_utils.string_agg", "macro_sql": "{% macro string_agg(field_to_agg, delimiter) -%}\n\n{{ adapter.dispatch('string_agg', 'fivetran_utils') (field_to_agg, delimiter) }}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.default__string_agg"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field_to_agg", "type": null, "description": ""}, {"name": "delimiter", "type": null, "description": ""}], "created_at": 1789419970.3279977, "supported_languages": null}, "macro.fivetran_utils.default__string_agg": {"name": "default__string_agg", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/string_agg.sql", "original_file_path": "macros/string_agg.sql", "unique_id": "macro.fivetran_utils.default__string_agg", "macro_sql": "{% macro default__string_agg(field_to_agg, delimiter) %}\n string_agg({{ field_to_agg }}, {{ delimiter }})\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field_to_agg", "type": null, "description": ""}, {"name": "delimiter", "type": null, "description": ""}], "created_at": 1789419970.3282316, "supported_languages": null}, "macro.fivetran_utils.snowflake__string_agg": {"name": "snowflake__string_agg", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/string_agg.sql", "original_file_path": "macros/string_agg.sql", "unique_id": "macro.fivetran_utils.snowflake__string_agg", "macro_sql": "{% macro snowflake__string_agg(field_to_agg, delimiter) %}\n listagg({{ field_to_agg }}, {{ delimiter }})\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field_to_agg", "type": null, "description": ""}, {"name": "delimiter", "type": null, "description": ""}], "created_at": 1789419970.3284545, "supported_languages": null}, "macro.fivetran_utils.redshift__string_agg": {"name": "redshift__string_agg", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/string_agg.sql", "original_file_path": "macros/string_agg.sql", "unique_id": "macro.fivetran_utils.redshift__string_agg", "macro_sql": "{% macro redshift__string_agg(field_to_agg, delimiter) %}\n listagg({{ field_to_agg }}, {{ delimiter }})\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field_to_agg", "type": null, "description": ""}, {"name": "delimiter", "type": null, "description": ""}], "created_at": 1789419970.32868, "supported_languages": null}, "macro.fivetran_utils.spark__string_agg": {"name": "spark__string_agg", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/string_agg.sql", "original_file_path": "macros/string_agg.sql", "unique_id": "macro.fivetran_utils.spark__string_agg", "macro_sql": "{% macro spark__string_agg(field_to_agg, delimiter) %}\n -- collect set will remove duplicates\n replace(replace(replace(cast( collect_set({{ field_to_agg }}) as string), '[', ''), ']', ''), ', ', {{ delimiter }} )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field_to_agg", "type": null, "description": ""}, {"name": "delimiter", "type": null, "description": ""}], "created_at": 1789419970.3289607, "supported_languages": null}, "macro.fivetran_utils.max_bool": {"name": "max_bool", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/max_bool.sql", "original_file_path": "macros/max_bool.sql", "unique_id": "macro.fivetran_utils.max_bool", "macro_sql": "{% macro max_bool(boolean_field) -%}\n\n{{ adapter.dispatch('max_bool', 'fivetran_utils') (boolean_field) }}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.default__max_bool"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "boolean_field", "type": null, "description": ""}], "created_at": 1789419970.3294427, "supported_languages": null}, "macro.fivetran_utils.default__max_bool": {"name": "default__max_bool", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/max_bool.sql", "original_file_path": "macros/max_bool.sql", "unique_id": "macro.fivetran_utils.default__max_bool", "macro_sql": "{% macro default__max_bool(boolean_field) %}\n\n bool_or( {{ boolean_field }} )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "boolean_field", "type": null, "description": ""}], "created_at": 1789419970.3296287, "supported_languages": null}, "macro.fivetran_utils.snowflake__max_bool": {"name": "snowflake__max_bool", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/max_bool.sql", "original_file_path": "macros/max_bool.sql", "unique_id": "macro.fivetran_utils.snowflake__max_bool", "macro_sql": "{% macro snowflake__max_bool(boolean_field) %}\n\n max( {{ boolean_field }} )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "boolean_field", "type": null, "description": ""}], "created_at": 1789419970.329817, "supported_languages": null}, "macro.fivetran_utils.bigquery__max_bool": {"name": "bigquery__max_bool", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/max_bool.sql", "original_file_path": "macros/max_bool.sql", "unique_id": "macro.fivetran_utils.bigquery__max_bool", "macro_sql": "{% macro bigquery__max_bool(boolean_field) %}\n\n max( {{ boolean_field }} )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "boolean_field", "type": null, "description": ""}], "created_at": 1789419970.329993, "supported_languages": null}, "macro.fivetran_utils.empty_variable_warning": {"name": "empty_variable_warning", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/empty_variable_warning.sql", "original_file_path": "macros/empty_variable_warning.sql", "unique_id": "macro.fivetran_utils.empty_variable_warning", "macro_sql": "{% macro empty_variable_warning(variable, downstream_model) %}\n\n{% if not var(variable) %}\n{{ log(\n \"\"\"\n Warning: You have passed an empty list to the \"\"\" ~ variable ~ \"\"\".\n As a result, you won't see the history of any columns in the \"\"\" ~ downstream_model ~ \"\"\" model.\n \"\"\",\n info=True\n) }}\n{% endif %}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "variable", "type": null, "description": ""}, {"name": "downstream_model", "type": null, "description": ""}], "created_at": 1789419970.3306928, "supported_languages": null}, "macro.fivetran_utils.dummy_coalesce_value": {"name": "dummy_coalesce_value", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/dummy_coalesce_value.sql", "original_file_path": "macros/dummy_coalesce_value.sql", "unique_id": "macro.fivetran_utils.dummy_coalesce_value", "macro_sql": "{% macro dummy_coalesce_value(column) %}\n\n{% set coalesce_value = {\n 'STRING': \"'DUMMY_STRING'\",\n 'BOOLEAN': 'null',\n 'INT': 999999999,\n 'FLOAT': 999999999.99,\n 'TIMESTAMP': 'cast(\"2099-12-31\" as timestamp)',\n 'DATE': 'cast(\"2099-12-31\" as date)',\n} %}\n\n{% if column.is_float() %}\n{{ return(coalesce_value['FLOAT']) }}\n\n{% elif column.is_numeric() %}\n{{ return(coalesce_value['INT']) }}\n\n{% elif column.is_string() %}\n{{ return(coalesce_value['STRING']) }}\n\n{% elif column.data_type|lower == 'boolean' %}\n{{ return(coalesce_value['BOOLEAN']) }}\n\n{% elif 'timestamp' in column.data_type|lower %}\n{{ return(coalesce_value['TIMESTAMP']) }}\n\n{% elif 'date' in column.data_type|lower %}\n{{ return(coalesce_value['DATE']) }}\n\n{% elif 'int' in column.data_type|lower %}\n{{ return(coalesce_value['INT']) }}\n\n{% endif %}\n\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "column", "type": null, "description": ""}], "created_at": 1789419970.3331523, "supported_languages": null}, "macro.fivetran_utils.percentile": {"name": "percentile", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/percentile.sql", "original_file_path": "macros/percentile.sql", "unique_id": "macro.fivetran_utils.percentile", "macro_sql": "{% macro percentile(percentile_field, partition_field, percent) -%}\n\n{{ adapter.dispatch('percentile', 'fivetran_utils') (percentile_field, partition_field, percent) }}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.postgres__percentile"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "percentile_field", "type": null, "description": ""}, {"name": "partition_field", "type": null, "description": ""}, {"name": "percent", "type": null, "description": ""}], "created_at": 1789419970.3339937, "supported_languages": null}, "macro.fivetran_utils.default__percentile": {"name": "default__percentile", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/percentile.sql", "original_file_path": "macros/percentile.sql", "unique_id": "macro.fivetran_utils.default__percentile", "macro_sql": "{% macro default__percentile(percentile_field, partition_field, percent) %}\n\n percentile_cont( \n {{ percent }} )\n within group ( order by {{ percentile_field }} )\n over ( partition by {{ partition_field }} )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "percentile_field", "type": null, "description": ""}, {"name": "partition_field", "type": null, "description": ""}, {"name": "percent", "type": null, "description": ""}], "created_at": 1789419970.3342988, "supported_languages": null}, "macro.fivetran_utils.redshift__percentile": {"name": "redshift__percentile", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/percentile.sql", "original_file_path": "macros/percentile.sql", "unique_id": "macro.fivetran_utils.redshift__percentile", "macro_sql": "{% macro redshift__percentile(percentile_field, partition_field, percent) %}\n\n percentile_cont( \n {{ percent }} )\n within group ( order by {{ percentile_field }} )\n over ( partition by {{ partition_field }} )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "percentile_field", "type": null, "description": ""}, {"name": "partition_field", "type": null, "description": ""}, {"name": "percent", "type": null, "description": ""}], "created_at": 1789419970.3345826, "supported_languages": null}, "macro.fivetran_utils.bigquery__percentile": {"name": "bigquery__percentile", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/percentile.sql", "original_file_path": "macros/percentile.sql", "unique_id": "macro.fivetran_utils.bigquery__percentile", "macro_sql": "{% macro bigquery__percentile(percentile_field, partition_field, percent) %}\n\n percentile_cont( \n {{ percentile_field }}, \n {{ percent }}) \n over (partition by {{ partition_field }} \n )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "percentile_field", "type": null, "description": ""}, {"name": "partition_field", "type": null, "description": ""}, {"name": "percent", "type": null, "description": ""}], "created_at": 1789419970.3348994, "supported_languages": null}, "macro.fivetran_utils.postgres__percentile": {"name": "postgres__percentile", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/percentile.sql", "original_file_path": "macros/percentile.sql", "unique_id": "macro.fivetran_utils.postgres__percentile", "macro_sql": "{% macro postgres__percentile(percentile_field, partition_field, percent) %}\n\n percentile_cont( \n {{ percent }} )\n within group ( order by {{ percentile_field }} )\n /* have to group by partition field */\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "percentile_field", "type": null, "description": ""}, {"name": "partition_field", "type": null, "description": ""}, {"name": "percent", "type": null, "description": ""}], "created_at": 1789419970.33516, "supported_languages": null}, "macro.fivetran_utils.spark__percentile": {"name": "spark__percentile", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/percentile.sql", "original_file_path": "macros/percentile.sql", "unique_id": "macro.fivetran_utils.spark__percentile", "macro_sql": "{% macro spark__percentile(percentile_field, partition_field, percent) %}\n\n percentile( \n {{ percentile_field }}, \n {{ percent }}) \n over (partition by {{ partition_field }} \n )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "percentile_field", "type": null, "description": ""}, {"name": "partition_field", "type": null, "description": ""}, {"name": "percent", "type": null, "description": ""}], "created_at": 1789419970.3354373, "supported_languages": null}, "macro.fivetran_utils.duckdb__percentile": {"name": "duckdb__percentile", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/percentile.sql", "original_file_path": "macros/percentile.sql", "unique_id": "macro.fivetran_utils.duckdb__percentile", "macro_sql": "{% macro duckdb__percentile(percentile_field, partition_field, percent) %}\n\n quantile_cont(\n {{ percentile_field }},\n {{ percent }})\n over (partition by {{ partition_field }}\n )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "percentile_field", "type": null, "description": ""}, {"name": "partition_field", "type": null, "description": ""}, {"name": "percent", "type": null, "description": ""}], "created_at": 1789419970.3357112, "supported_languages": null}, "macro.fivetran_utils.remove_prefix_from_columns": {"name": "remove_prefix_from_columns", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/remove_prefix_from_columns.sql", "original_file_path": "macros/remove_prefix_from_columns.sql", "unique_id": "macro.fivetran_utils.remove_prefix_from_columns", "macro_sql": "{% macro remove_prefix_from_columns(columns, prefix='', exclude=[]) %}\n\n {%- for col in columns if col.name not in exclude -%}\n {%- if col.name[:prefix|length]|lower == prefix -%}\n {{ col.name }} as {{ col.name[prefix|length:] }}\n {%- else -%}\n {{ col.name }}\n {%- endif -%}\n {%- if not loop.last -%},{%- endif %}\n {% endfor -%}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "columns", "type": null, "description": ""}, {"name": "prefix", "type": null, "description": ""}, {"name": "exclude", "type": null, "description": ""}], "created_at": 1789419970.3368154, "supported_languages": null}, "macro.fivetran_utils.snowflake_seed_data": {"name": "snowflake_seed_data", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/snowflake_seed_data.sql", "original_file_path": "macros/snowflake_seed_data.sql", "unique_id": "macro.fivetran_utils.snowflake_seed_data", "macro_sql": "{% macro snowflake_seed_data(seed_name) %}\n\n{% if target.type == 'snowflake' %}\n{{ return(ref(seed_name ~ '_snowflake')) }}\n{% else %}\n{{ return(ref(seed_name)) }}\n{% endif %}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "seed_name", "type": null, "description": ""}], "created_at": 1789419970.3374858, "supported_languages": null}}, "docs": {"doc.dbt.__overview__": {"name": "__overview__", "resource_type": "doc", "package_name": "dbt", "path": "overview.md", "original_file_path": "docs/overview.md", "unique_id": "doc.dbt.__overview__", "block_contents": "### Welcome!\n\nWelcome to the auto-generated documentation for your dbt project!\n\n### Navigation\n\nYou can use the `Project` and `Database` navigation tabs on the left side of the window to explore the models\nin your project.\n\n#### Project Tab\nThe `Project` tab mirrors the directory structure of your dbt project. In this tab, you can see all of the\nmodels defined in your dbt project, as well as models imported from dbt packages.\n\n#### Database Tab\nThe `Database` tab also exposes your models, but in a format that looks more like a database explorer. This view\nshows relations (tables and views) grouped into database schemas. Note that ephemeral models are _not_ shown\nin this interface, as they do not exist in the database.\n\n### Graph Exploration\nYou can click the blue icon on the bottom-right corner of the page to view the lineage graph of your models.\n\nOn model pages, you'll see the immediate parents and children of the model you're exploring. By clicking the `Expand`\nbutton at the top-right of this lineage pane, you'll be able to see all of the models that are used to build,\nor are built from, the model you're exploring.\n\nOnce expanded, you'll be able to use the `--select` and `--exclude` model selection syntax to filter the\nmodels in the graph. For more information on model selection, check out the [dbt docs](https://docs.getdbt.com/docs/model-selection-syntax).\n\nNote that you can also right-click on models to interactively filter and explore the graph.\n\n---\n\n### More information\n\n- [What is dbt](https://docs.getdbt.com/docs/introduction)?\n- Read the [dbt viewpoint](https://docs.getdbt.com/docs/viewpoint)\n- [Installation](https://docs.getdbt.com/docs/installation)\n- Join the [dbt Community](https://www.getdbt.com/community/) for questions and discussion"}, "doc.iterable.source_relation": {"name": "source_relation", "resource_type": "doc", "package_name": "iterable", "path": "docs.md", "original_file_path": "models/docs.md", "unique_id": "doc.iterable.source_relation", "block_contents": "Identifies the record's source."}, "doc.iterable._fivetran_synced": {"name": "_fivetran_synced", "resource_type": "doc", "package_name": "iterable", "path": "docs.md", "original_file_path": "models/docs.md", "unique_id": "doc.iterable._fivetran_synced", "block_contents": "The time when a record was last updated by Fivetran."}}, "exposures": {}, "metrics": {}, "groups": {}, "selectors": {}, "disabled": {"test.iterable_integration_tests.consistency_campaigns": [{"database": "postgres", "schema": "public_dbt_test__audit", "name": "consistency_campaigns", "resource_type": "test", "package_name": "iterable_integration_tests", "path": "consistency/consistency_campaigns.sql", "original_file_path": "tests/consistency/consistency_campaigns.sql", "unique_id": "test.iterable_integration_tests.consistency_campaigns", "fqn": ["iterable_integration_tests", "consistency", "consistency_campaigns"], "alias": "consistency_campaigns", "checksum": {"name": "sha256", "checksum": "30e008529ef9f5fa6d8697bbcff2562fc9b176d571cc310458e67e8c82a46185"}, "config": {"enabled": false, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": ["fivetran_validations"], "meta": {}, "group": null, "static_analysis": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "sql_header": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": ["fivetran_validations"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"tags": "fivetran_validations", "enabled": "var('fivetran_validation_tests_enabled', False)"}, "created_at": 1789419971.1009398, "relation_name": null, "raw_code": "{{ config(\n tags=\"fivetran_validations\",\n enabled=var('fivetran_validation_tests_enabled', false)\n) }}\n\n{% set exclude_cols = ['labels'] + var('consistency_test_exclude_metrics', []) %}\n{% set fields = dbt_utils.star(from=ref('iterable__campaigns'), except=exclude_cols) %}\n\n-- this test ensures the iterable__campaigns end model matches the prior version\nwith prod as (\n select {{ fields }}\n from {{ target.schema }}_iterable_prod.iterable__campaigns\n where date(updated_at) < date({{ dbt.current_timestamp() }})\n),\n\ndev as (\n select {{ fields }}\n from {{ target.schema }}_iterable_dev.iterable__campaigns\n where date(updated_at) < date({{ dbt.current_timestamp() }})\n),\n\nprod_not_in_dev as (\n -- rows from prod not found in dev\n select * from prod\n except distinct\n select * from dev\n),\n\ndev_not_in_prod as (\n -- rows from dev not found in prod\n select * from dev\n except distinct\n select * from prod\n),\n\nfinal as (\n select\n *,\n 'from prod' as source\n from prod_not_in_dev\n\n union all -- union since we only care if rows are produced\n\n select\n *,\n 'from dev' as source\n from dev_not_in_prod\n)\n\nselect *\nfrom final", "doc_blocks": [], "language": "sql", "refs": [{"name": "iterable__campaigns", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt_utils.star", "macro.dbt.current_timestamp"], "nodes": []}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}}], "test.iterable_integration_tests.consistency_user_unsubscriptions": [{"database": "postgres", "schema": "public_dbt_test__audit", "name": "consistency_user_unsubscriptions", "resource_type": "test", "package_name": "iterable_integration_tests", "path": "consistency/consistency_user_unsubscriptions.sql", "original_file_path": "tests/consistency/consistency_user_unsubscriptions.sql", "unique_id": "test.iterable_integration_tests.consistency_user_unsubscriptions", "fqn": ["iterable_integration_tests", "consistency", "consistency_user_unsubscriptions"], "alias": "consistency_user_unsubscriptions", "checksum": {"name": "sha256", "checksum": "32d0be8a7f721a49100a7f4b1046a8ecb1d75b86f4ad1a484d53a1d03343bc40"}, "config": {"enabled": false, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": ["fivetran_validations"], "meta": {}, "group": null, "static_analysis": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "sql_header": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": ["fivetran_validations"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"tags": "fivetran_validations", "enabled": "var('fivetran_validation_tests_enabled', False)"}, "created_at": 1789419971.1605198, "relation_name": null, "raw_code": "{{ config(\n tags=\"fivetran_validations\",\n enabled=var('fivetran_validation_tests_enabled', false)\n) }}\n\n{% set exclude_cols = var('consistency_test_exclude_metrics', []) %}\n{% set fields = dbt_utils.star(from=ref('iterable__user_unsubscriptions'), except=exclude_cols) %}\n\n-- this test ensures the iterable__user_unsubscriptions end model matches the prior version\nwith prod as (\n select {{ fields }}\n from {{ target.schema }}_iterable_prod.iterable__user_unsubscriptions\n),\n\ndev as (\n select {{ fields }}\n from {{ target.schema }}_iterable_dev.iterable__user_unsubscriptions\n),\n\nprod_not_in_dev as (\n -- rows from prod not found in dev\n select * from prod\n except distinct\n select * from dev\n),\n\ndev_not_in_prod as (\n -- rows from dev not found in prod\n select * from dev\n except distinct\n select * from prod\n),\n\nfinal as (\n select\n *,\n 'from prod' as source\n from prod_not_in_dev\n\n union all -- union since we only care if rows are produced\n\n select\n *,\n 'from dev' as source\n from dev_not_in_prod\n)\n\nselect *\nfrom final", "doc_blocks": [], "language": "sql", "refs": [{"name": "iterable__user_unsubscriptions", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt_utils.star"], "nodes": []}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}}], "test.iterable_integration_tests.consistency_list_user_history": [{"database": "postgres", "schema": "public_dbt_test__audit", "name": "consistency_list_user_history", "resource_type": "test", "package_name": "iterable_integration_tests", "path": "consistency/consistency_list_user_history.sql", "original_file_path": "tests/consistency/consistency_list_user_history.sql", "unique_id": "test.iterable_integration_tests.consistency_list_user_history", "fqn": ["iterable_integration_tests", "consistency", "consistency_list_user_history"], "alias": "consistency_list_user_history", "checksum": {"name": "sha256", "checksum": "e0081cf1366801020e3c9fbdc71e989f2bdd7b713ee328c2f4a5e9b97355601e"}, "config": {"enabled": false, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": ["fivetran_validations"], "meta": {}, "group": null, "static_analysis": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "sql_header": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": ["fivetran_validations"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"tags": "fivetran_validations", "enabled": "var('fivetran_validation_tests_enabled', False)"}, "created_at": 1789419971.1684618, "relation_name": null, "raw_code": "{{ config(\n tags=\"fivetran_validations\",\n enabled=var('fivetran_validation_tests_enabled', false)\n) }}\n\n{% set exclude_cols = var('consistency_test_exclude_metrics', []) %}\n{% set fields = dbt_utils.star(from=ref('iterable__list_user_history'), except=exclude_cols) %}\n\n-- this test ensures the iterable__list_user_history end model matches the prior version\nwith prod as (\n select {{ fields }}\n from {{ target.schema }}_iterable_prod.iterable__list_user_history\n),\n\ndev as (\n select {{ fields }}\n from {{ target.schema }}_iterable_dev.iterable__list_user_history\n),\n\nprod_not_in_dev as (\n -- rows from prod not found in dev\n select * from prod\n except distinct\n select * from dev\n),\n\ndev_not_in_prod as (\n -- rows from dev not found in prod\n select * from dev\n except distinct\n select * from prod\n),\n\nfinal as (\n select\n *,\n 'from prod' as source\n from prod_not_in_dev\n\n union all -- union since we only care if rows are produced\n\n select\n *,\n 'from dev' as source\n from dev_not_in_prod\n)\n\nselect *\nfrom final", "doc_blocks": [], "language": "sql", "refs": [{"name": "iterable__list_user_history", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt_utils.star"], "nodes": []}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}}], "test.iterable_integration_tests.consistency_users": [{"database": "postgres", "schema": "public_dbt_test__audit", "name": "consistency_users", "resource_type": "test", "package_name": "iterable_integration_tests", "path": "consistency/consistency_users.sql", "original_file_path": "tests/consistency/consistency_users.sql", "unique_id": "test.iterable_integration_tests.consistency_users", "fqn": ["iterable_integration_tests", "consistency", "consistency_users"], "alias": "consistency_users", "checksum": {"name": "sha256", "checksum": "d367ccd8f7d79248da78ce29fc8f08876913df08b89866895cce315f46ef81e3"}, "config": {"enabled": false, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": ["fivetran_validations"], "meta": {}, "group": null, "static_analysis": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "sql_header": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": ["fivetran_validations"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"tags": "fivetran_validations", "enabled": "var('fivetran_validation_tests_enabled', False)"}, "created_at": 1789419971.176836, "relation_name": null, "raw_code": "{{ config(\n tags=\"fivetran_validations\",\n enabled=var('fivetran_validation_tests_enabled', false)\n) }}\n\n{% set exclude_cols = var('consistency_test_exclude_metrics', []) %}\n{% set fields = dbt_utils.star(from=ref('iterable__users'), except=exclude_cols) %}\n\n-- this test ensures the iterable__users end model matches the prior version\nwith prod as (\n select {{ fields }}\n from {{ target.schema }}_iterable_prod.iterable__users\n where date(updated_at) < date({{ dbt.current_timestamp() }})\n),\n\ndev as (\n select {{ fields }}\n from {{ target.schema }}_iterable_dev.iterable__users\n where date(updated_at) < date({{ dbt.current_timestamp() }})\n),\n\nprod_not_in_dev as (\n -- rows from prod not found in dev\n select * from prod\n except distinct\n select * from dev\n),\n\ndev_not_in_prod as (\n -- rows from dev not found in prod\n select * from dev\n except distinct\n select * from prod\n),\n\nfinal as (\n select\n *,\n 'from prod' as source\n from prod_not_in_dev\n\n union all -- union since we only care if rows are produced\n\n select\n *,\n 'from dev' as source\n from dev_not_in_prod\n)\n\nselect *\nfrom final", "doc_blocks": [], "language": "sql", "refs": [{"name": "iterable__users", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt_utils.star", "macro.dbt.current_timestamp"], "nodes": []}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}}], "test.iterable_integration_tests.consistency_user_unsubscribes_pre_aug_2023": [{"database": "postgres", "schema": "public_dbt_test__audit", "name": "consistency_user_unsubscribes_pre_aug_2023", "resource_type": "test", "package_name": "iterable_integration_tests", "path": "consistency/consistency_user_unsubscribes_pre_aug_2023.sql", "original_file_path": "tests/consistency/consistency_user_unsubscribes_pre_aug_2023.sql", "unique_id": "test.iterable_integration_tests.consistency_user_unsubscribes_pre_aug_2023", "fqn": ["iterable_integration_tests", "consistency", "consistency_user_unsubscribes_pre_aug_2023"], "alias": "consistency_user_unsubscribes_pre_aug_2023", "checksum": {"name": "sha256", "checksum": "0d85b35d94066e59119f57fbe930a19353dfbb79b4e812b54de9c19520a58402"}, "config": {"enabled": false, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": ["fivetran_validations"], "meta": {}, "group": null, "static_analysis": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "sql_header": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": ["fivetran_validations"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"tags": "fivetran_validations", "enabled": "var('fivetran_validation_tests_enabled', False)"}, "created_at": 1789419971.186075, "relation_name": null, "raw_code": "-- These validation tests were designed to work with the pre-August 2023 version of the Iterable connector.\n-- You will thus need to comment out `iterable_user_unsubscribed_channel_identifier` and `iterable_user_unsubscribed_message_type_identifier` in the `integration_tests/dbt_project.yml` to run and validate these tests. \n\n{{ config(\n tags=\"fivetran_validations\",\n enabled=var('fivetran_validation_tests_enabled', false)\n) }}\n\n\nwith prod as (\n\n select \n unique_user_key, \n coalesce(count(distinct unique_user_key), 0) as unique_user_records_prod, \n coalesce(count(distinct channel_id), 0) as channels_prod, \n coalesce(count(distinct message_type_id), 0) as message_types_prod\n from {{ target.schema }}_iterable_prod.iterable__user_unsubscriptions\n where channel_id is not null\n and message_type_id is not null\n group by 1\n),\n\ndev as (\n\n select \n unique_user_key, \n coalesce(count(distinct unique_user_key), 0) as unique_user_records_dev, \n coalesce(count(distinct channel_id), 0) as channels_dev, \n coalesce(count(distinct message_type_id), 0) as message_types_dev\n from {{ target.schema }}_iterable_dev.iterable__user_unsubscriptions\n where channel_id is not null\n and message_type_id is not null\n group by 1\n),\n\nfinal as (\n\n select \n prod.unique_user_key,\n unique_user_records_prod,\n unique_user_records_dev,\n channels_prod,\n channels_dev,\n message_types_prod,\n message_types_dev\n from prod\n full outer join dev\n on prod.unique_user_key = dev.unique_user_key\n) \n\nselect *\nfrom final\nwhere unique_user_records_prod != unique_user_records_dev\n and channels_prod != channels_dev \n and message_types_prod != message_types_dev", "doc_blocks": [], "language": "sql", "refs": [], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": [], "nodes": []}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}}], "test.iterable_integration_tests.consistency_user_campaign": [{"database": "postgres", "schema": "public_dbt_test__audit", "name": "consistency_user_campaign", "resource_type": "test", "package_name": "iterable_integration_tests", "path": "consistency/consistency_user_campaign.sql", "original_file_path": "tests/consistency/consistency_user_campaign.sql", "unique_id": "test.iterable_integration_tests.consistency_user_campaign", "fqn": ["iterable_integration_tests", "consistency", "consistency_user_campaign"], "alias": "consistency_user_campaign", "checksum": {"name": "sha256", "checksum": "8663f2c250688a8303d2ef38dc723e2fc62d996396b4b07e13c05feeb48cd97c"}, "config": {"enabled": false, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": ["fivetran_validations"], "meta": {}, "group": null, "static_analysis": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "sql_header": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": ["fivetran_validations"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"tags": "fivetran_validations", "enabled": "var('fivetran_validation_tests_enabled', False)"}, "created_at": 1789419971.1919909, "relation_name": null, "raw_code": "{{ config(\n tags=\"fivetran_validations\",\n enabled=var('fivetran_validation_tests_enabled', false)\n) }}\n\n{% set exclude_cols = var('consistency_test_exclude_metrics', []) %}\n{% set fields = dbt_utils.star(from=ref('iterable__user_campaign'), except=exclude_cols) %}\n\n-- this test ensures the iterable__user_campaign end model matches the prior version\nwith prod as (\n select {{ fields }}\n from {{ target.schema }}_iterable_prod.iterable__user_campaign\n where date(first_event_at) < date({{ dbt.current_timestamp() }})\n),\n\ndev as (\n select {{ fields }}\n from {{ target.schema }}_iterable_dev.iterable__user_campaign\n where date(first_event_at) < date({{ dbt.current_timestamp() }})\n),\n\nprod_not_in_dev as (\n -- rows from prod not found in dev\n select * from prod\n except distinct\n select * from dev\n),\n\ndev_not_in_prod as (\n -- rows from dev not found in prod\n select * from dev\n except distinct\n select * from prod\n),\n\nfinal as (\n select\n *,\n 'from prod' as source\n from prod_not_in_dev\n\n union all -- union since we only care if rows are produced\n\n select\n *,\n 'from dev' as source\n from dev_not_in_prod\n)\n\nselect *\nfrom final", "doc_blocks": [], "language": "sql", "refs": [{"name": "iterable__user_campaign", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt_utils.star", "macro.dbt.current_timestamp"], "nodes": []}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}}], "test.iterable_integration_tests.consistency_events": [{"database": "postgres", "schema": "public_dbt_test__audit", "name": "consistency_events", "resource_type": "test", "package_name": "iterable_integration_tests", "path": "consistency/consistency_events.sql", "original_file_path": "tests/consistency/consistency_events.sql", "unique_id": "test.iterable_integration_tests.consistency_events", "fqn": ["iterable_integration_tests", "consistency", "consistency_events"], "alias": "consistency_events", "checksum": {"name": "sha256", "checksum": "6e82de77a605ca7613eb3563f2158ad172785552d38cbf3617136a816c073b36"}, "config": {"enabled": false, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": ["fivetran_validations"], "meta": {}, "group": null, "static_analysis": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "sql_header": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": ["fivetran_validations"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"tags": "fivetran_validations", "enabled": "var('fivetran_validation_tests_enabled', False)"}, "created_at": 1789419971.20116, "relation_name": null, "raw_code": "{{ config(\n tags=\"fivetran_validations\",\n enabled=var('fivetran_validation_tests_enabled', false)\n) }}\n\n-- exclude JSON fields\n{% set exclude_cols = ['additional_properties', 'transactional_data'] + var('consistency_test_exclude_metrics', []) %}\n{% set fields = dbt_utils.star(from=ref('iterable__events'), except=exclude_cols) %}\n\n-- this test ensures the iterable__events end model matches the prior version\nwith prod as (\n select {{ fields }}\n from {{ target.schema }}_iterable_prod.iterable__events\n where date(created_at) < date({{ dbt.current_timestamp() }})\n),\n\ndev as (\n select {{ fields }}\n from {{ target.schema }}_iterable_dev.iterable__events\n where date(created_at) < date({{ dbt.current_timestamp() }})\n),\n\nprod_not_in_dev as (\n -- rows from prod not found in dev\n select * from prod\n except distinct\n select * from dev\n),\n\ndev_not_in_prod as (\n -- rows from dev not found in prod\n select * from dev\n except distinct\n select * from prod\n),\n\nfinal as (\n select\n *,\n 'from prod' as source\n from prod_not_in_dev\n\n union all -- union since we only care if rows are produced\n\n select\n *,\n 'from dev' as source\n from dev_not_in_prod\n)\n\nselect *\nfrom final", "doc_blocks": [], "language": "sql", "refs": [{"name": "iterable__events", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt_utils.star", "macro.dbt.current_timestamp"], "nodes": []}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}}], "test.iterable_integration_tests.consistency_journeys": [{"database": "postgres", "schema": "public_dbt_test__audit", "name": "consistency_journeys", "resource_type": "test", "package_name": "iterable_integration_tests", "path": "consistency/consistency_journeys.sql", "original_file_path": "tests/consistency/consistency_journeys.sql", "unique_id": "test.iterable_integration_tests.consistency_journeys", "fqn": ["iterable_integration_tests", "consistency", "consistency_journeys"], "alias": "consistency_journeys", "checksum": {"name": "sha256", "checksum": "93a73b2e7e1d608a1116fddcec932e15ce18a57fb099872a13b4f97ca006d18f"}, "config": {"enabled": false, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": ["fivetran_validations"], "meta": {}, "group": null, "static_analysis": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "sql_header": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": ["fivetran_validations"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"tags": "fivetran_validations", "enabled": "var('fivetran_validation_tests_enabled', False)"}, "created_at": 1789419971.212363, "relation_name": null, "raw_code": "{{ config(\n tags=\"fivetran_validations\",\n enabled=var('fivetran_validation_tests_enabled', false)\n) }}\n\n{% set exclude_cols = ['trigger_event_names'] + var('consistency_test_exclude_metrics', []) %}\n{% set fields = dbt_utils.star(from=ref('iterable__journeys'), except=exclude_cols) %}\n\n-- this test ensures the iterable__journeys end model matches the prior version\nwith prod as (\n select {{ fields }}\n from {{ target.schema }}_iterable_prod.iterable__journeys\n where date(updated_at) < date({{ dbt.current_timestamp() }})\n),\n\ndev as (\n select {{ fields }}\n from {{ target.schema }}_iterable_dev.iterable__journeys\n where date(updated_at) < date({{ dbt.current_timestamp() }})\n),\n\nprod_not_in_dev as (\n -- rows from prod not found in dev\n select * from prod\n except distinct\n select * from dev\n),\n\ndev_not_in_prod as (\n -- rows from dev not found in prod\n select * from dev\n except distinct\n select * from prod\n),\n\nfinal as (\n select\n *,\n 'from prod' as source\n from prod_not_in_dev\n\n union all -- union since we only care if rows are produced\n\n select\n *,\n 'from dev' as source\n from dev_not_in_prod\n)\n\nselect *\nfrom final", "doc_blocks": [], "language": "sql", "refs": [{"name": "iterable__journeys", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt_utils.star", "macro.dbt.current_timestamp"], "nodes": []}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}}], "test.iterable_integration_tests.user_unsubscribe_count_match_pre_aug_2023": [{"database": "postgres", "schema": "public_dbt_test__audit", "name": "user_unsubscribe_count_match_pre_aug_2023", "resource_type": "test", "package_name": "iterable_integration_tests", "path": "integrity/user_unsubscribe_count_match_pre_aug_2023.sql", "original_file_path": "tests/integrity/user_unsubscribe_count_match_pre_aug_2023.sql", "unique_id": "test.iterable_integration_tests.user_unsubscribe_count_match_pre_aug_2023", "fqn": ["iterable_integration_tests", "integrity", "user_unsubscribe_count_match_pre_aug_2023"], "alias": "user_unsubscribe_count_match_pre_aug_2023", "checksum": {"name": "sha256", "checksum": "6b37518965460a9c0b7161808527fa4b6f240a6ead0827a3950705267ebd236f"}, "config": {"enabled": false, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": ["fivetran_validations"], "meta": {}, "group": null, "static_analysis": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "sql_header": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": ["fivetran_validations"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"tags": "fivetran_validations", "enabled": "var('fivetran_validation_tests_enabled', False)"}, "created_at": 1789419971.221897, "relation_name": null, "raw_code": "-- These validation tests were designed to work with the pre-August 2023 version of the Iterable connector.\n-- You will thus need to comment out `iterable_user_unsubscribed_channel_identifier` and `iterable_user_unsubscribed_message_type_identifier` in the `integration_tests/dbt_project.yml` to run and validate these tests. \n\n{{ config(\n tags=\"fivetran_validations\",\n enabled=var('fivetran_validation_tests_enabled', false)\n) }}\n\nwith unsub_channels as (\n\n select \n unique_user_key, \n channel_id\n from {{ ref('stg_iterable__user_unsubscribed_channel') }}\n group by 1, 2\n),\n\nunsub_messages as (\n\n select \n unique_user_key, \n message_type_id\n from {{ ref('stg_iterable__user_unsub_message_type') }}\n group by 1, 2\n),\n\nchannel_message_combos as (\n\n select channel_id, message_type_id \n from {{ ref('stg_iterable__message_type') }}\n group by 1, 2\n),\n\nmessage_channel_unsubs as (\n\n select \n unsub_channels.unique_user_key as unique_user_key_source,\n channel_message_combos.channel_id as channel_source,\n channel_message_combos.message_type_id as message_type_source\n from unsub_channels \n inner join channel_message_combos\n on unsub_channels.channel_id = channel_message_combos.channel_id\n\n union all\n\n select \n unsub_messages.unique_user_key as unique_user_key_source,\n channel_message_combos.channel_id as channel_source,\n channel_message_combos.message_type_id as message_type_source\n from unsub_messages\n inner join channel_message_combos\n on unsub_messages.message_type_id = channel_message_combos.message_type_id\n\n),\n\nsource_counts as (\n\n select unique_user_key_source, channel_source, message_type_source, count(*) as source_count\n from message_channel_unsubs \n group by 1, 2, 3\n),\n\nend_model_counts as (\n\n select unique_user_key as unique_user_key_end, channel_id as channel_end, message_type_id as message_type_end, count(*) as end_count\n from {{ ref('iterable__user_unsubscriptions') }}\n group by 1, 2, 3 \n)\n\nselect * \nfrom source_counts\ninner join end_model_counts \n on source_counts.unique_user_key_source = end_model_counts.unique_user_key_end\nwhere source_counts.channel_source = end_model_counts.channel_end\n and source_counts.message_type_source = end_model_counts.message_type_end\n and source_counts.source_count != end_model_counts.end_count", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__user_unsubscribed_channel", "package": null, "version": null}, {"name": "stg_iterable__user_unsub_message_type", "package": null, "version": null}, {"name": "stg_iterable__message_type", "package": null, "version": null}, {"name": "iterable__user_unsubscriptions", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": [], "nodes": []}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}}], "model.iterable.int_iterable__custom_events": [{"database": "postgres", "schema": "public_iterable_dev", "name": "int_iterable__custom_events", "resource_type": "model", "package_name": "iterable", "path": "intermediate/int_iterable__custom_events.sql", "original_file_path": "models/intermediate/int_iterable__custom_events.sql", "unique_id": "model.iterable.int_iterable__custom_events", "fqn": ["iterable", "intermediate", "int_iterable__custom_events"], "alias": "int_iterable__custom_events", "checksum": {"name": "sha256", "checksum": "0f0f1330b62dd5a320f37f7e30dae86a90c57e07c135369a259cfcba61875a16"}, "config": {"enabled": false, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "incremental", "incremental_strategy": "merge", "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": "event_id", "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}, "file_format": "delta"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"materialized": "incremental", "schema": "iterable_{{ var('directed_schema','dev') }}", "unique_key": "event_id", "incremental_strategy": "merge", "file_format": "delta", "enabled": "False", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789419971.9475832, "relation_name": "\"postgres\".\"public_iterable_dev\".\"int_iterable__custom_events\"", "raw_code": "{{\n config(\n materialized='incremental',\n unique_key='event_id',\n incremental_strategy = 'merge',\n file_format = 'delta',\n enabled=false\n )\n}}\n\n-- leave this alone for now....setting enabled to false\nwith events as (\n\n select *\n from {{ ref('stg_iterable__event') }}\n\n where lower(event_name) = 'customevent'\n {% if is_incremental() %}\n and updated_at > ( select max(updated_at) from {{ this }} )\n {% endif %}\n\n), custom_events as (\n\n select \n events.*\n {# {{ dbt.split_part(string_text='additional_properties', delimiter_text=' : \"{', part_number=1) }} #}\n\n {% if target.type == 'snowflake' %}\n ,\n additional_properties.key as custom_event_name,\n additional_properties.value as custom_event_metadata\n {% endif %}\n from events\n\n \n {% if target.type == 'snowflake' %}\n cross join \n table(flatten(additional_properties)) as additional_properties\n where additional_properties.key != '_id'\n {% endif %}\n)\n\nselect *\nfrom custom_events", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__event", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.is_incremental"], "nodes": []}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}]}, "parent_map": {"seed.iterable_integration_tests.campaign_metrics_data": [], "seed.iterable_integration_tests.campaign_list_history_data": [], "seed.iterable_integration_tests.user_unsubscribed_message_type_history_data": [], "seed.iterable_integration_tests.user_unsubscribed_channel_history_data": [], "seed.iterable_integration_tests.campaign_suppression_list_history_data": [], "seed.iterable_integration_tests.channel_data": [], "seed.iterable_integration_tests.template_history_data": [], "seed.iterable_integration_tests.message_type_data": [], "seed.iterable_integration_tests.event_data": [], "seed.iterable_integration_tests.list_user_data": [], "seed.iterable_integration_tests.user_history_bq_json_data": [], "seed.iterable_integration_tests.user_unsubscribed_message_type_data": [], "seed.iterable_integration_tests.journey_data": [], "seed.iterable_integration_tests.campaign_history_data": [], "seed.iterable_integration_tests.list_data": [], "seed.iterable_integration_tests.event_extension_data": [], "seed.iterable_integration_tests.user_unsubscribed_channel_data": [], "seed.iterable_integration_tests.campaign_label_history_data": [], "seed.iterable_integration_tests.user_history_data": [], "model.iterable.iterable__users": ["model.iterable.int_iterable__list_user_unnest", "model.iterable.int_iterable__user_event_metrics", "model.iterable.stg_iterable__list_user"], "model.iterable.iterable__list_user_history": ["model.iterable.int_iterable__list_user_unnest", "model.iterable.stg_iterable__list", "model.iterable.stg_iterable__list_user"], "model.iterable.iterable__events": ["model.iterable.int_iterable__latest_template", "model.iterable.int_iterable__latest_user", "model.iterable.int_iterable__message_type_channel", "model.iterable.int_iterable__recurring_campaigns", "model.iterable.stg_iterable__event", "model.iterable.stg_iterable__event_extension"], "model.iterable.iterable__user_campaign": ["model.iterable.iterable__events"], "model.iterable.iterable__user_unsubscriptions": ["model.iterable.int_iterable__message_type_channel", "model.iterable.stg_iterable__user_unsub_message_type", "model.iterable.stg_iterable__user_unsubscribed_channel"], "model.iterable.iterable__journeys": ["model.iterable.int_iterable__journey_event_metrics", "model.iterable.stg_iterable__journey"], "model.iterable.iterable__campaigns": ["model.iterable.int_iterable__campaign_event_metrics", "model.iterable.int_iterable__campaign_labels", "model.iterable.int_iterable__campaign_lists", "model.iterable.int_iterable__latest_template", "model.iterable.int_iterable__recurring_campaigns", "model.iterable.stg_iterable__journey"], "model.iterable.int_iterable__campaign_labels": ["model.iterable.stg_iterable__campaign_label_history"], "model.iterable.int_iterable__journey_event_metrics": ["model.iterable.int_iterable__recurring_campaigns", "model.iterable.iterable__user_campaign"], "model.iterable.int_iterable__list_user_unnest": ["model.iterable.int_iterable__list_user_history"], "model.iterable.int_iterable__latest_template": ["model.iterable.int_iterable__message_type_channel", "model.iterable.stg_iterable__template_history"], "model.iterable.int_iterable__campaign_event_metrics": ["model.iterable.iterable__user_campaign"], "model.iterable.int_iterable__campaign_lists": ["model.iterable.stg_iterable__campaign_list_history", "model.iterable.stg_iterable__campaign_suppression_list_history"], "model.iterable.int_iterable__recurring_campaigns": ["model.iterable.int_iterable__latest_campaign"], "model.iterable.int_iterable__list_user_history": ["model.iterable.stg_iterable__user_history"], "model.iterable.int_iterable__message_type_channel": ["model.iterable.stg_iterable__channel", "model.iterable.stg_iterable__message_type"], "model.iterable.int_iterable__user_event_metrics": ["model.iterable.iterable__user_campaign"], "model.iterable.int_iterable__latest_user": ["model.iterable.stg_iterable__user_history"], "model.iterable.int_iterable__latest_campaign": ["model.iterable.stg_iterable__campaign_history"], "model.iterable.stg_iterable__message_type": ["model.iterable.stg_iterable__message_type_tmp"], "model.iterable.stg_iterable__event": ["model.iterable.stg_iterable__event_tmp"], "model.iterable.stg_iterable__user_unsubscribed_channel": ["model.iterable.stg_iterable__user_unsubscribed_channel_tmp"], "model.iterable.stg_iterable__campaign_history": ["model.iterable.stg_iterable__campaign_history_tmp"], "model.iterable.stg_iterable__campaign_label_history": ["model.iterable.stg_iterable__campaign_label_history_tmp"], "model.iterable.stg_iterable__template_history": ["model.iterable.stg_iterable__template_history_tmp"], "model.iterable.stg_iterable__journey": ["model.iterable.stg_iterable__journey_tmp"], "model.iterable.stg_iterable__user_history": ["model.iterable.stg_iterable__user_history_tmp"], "model.iterable.stg_iterable__user_unsub_message_type": ["model.iterable.stg_iterable__user_unsub_message_type_tmp"], "model.iterable.stg_iterable__list": ["model.iterable.stg_iterable__list_tmp"], "model.iterable.stg_iterable__list_user": ["model.iterable.stg_iterable__list_user_tmp"], "model.iterable.stg_iterable__campaign_suppression_list_history": ["model.iterable.stg_iterable__campaign_suppression_list_history_tmp"], "model.iterable.stg_iterable__event_extension": ["model.iterable.stg_iterable__event_extension_tmp"], "model.iterable.stg_iterable__campaign_list_history": ["model.iterable.stg_iterable__campaign_list_history_tmp"], "model.iterable.stg_iterable__channel": ["model.iterable.stg_iterable__channel_tmp"], "model.iterable.stg_iterable__message_type_tmp": ["source.iterable.iterable.message_type"], "model.iterable.stg_iterable__event_extension_tmp": ["source.iterable.iterable.event_extension"], "model.iterable.stg_iterable__user_unsub_message_type_tmp": ["source.iterable.iterable.user_unsubscribed_message_type_history"], "model.iterable.stg_iterable__campaign_list_history_tmp": ["source.iterable.iterable.campaign_list_history"], "model.iterable.stg_iterable__list_user_tmp": ["source.iterable.iterable.list_user"], "model.iterable.stg_iterable__user_history_tmp": ["source.iterable.iterable.user_history"], "model.iterable.stg_iterable__campaign_history_tmp": ["source.iterable.iterable.campaign_history"], "model.iterable.stg_iterable__template_history_tmp": ["source.iterable.iterable.template_history"], "model.iterable.stg_iterable__event_tmp": ["source.iterable.iterable.event"], "model.iterable.stg_iterable__journey_tmp": ["source.iterable.iterable.journey"], "model.iterable.stg_iterable__campaign_suppression_list_history_tmp": ["source.iterable.iterable.campaign_suppression_list_history"], "model.iterable.stg_iterable__campaign_label_history_tmp": ["source.iterable.iterable.campaign_label_history"], "model.iterable.stg_iterable__list_tmp": ["source.iterable.iterable.list"], "model.iterable.stg_iterable__channel_tmp": ["source.iterable.iterable.channel"], "model.iterable.stg_iterable__user_unsubscribed_channel_tmp": ["source.iterable.iterable.user_unsubscribed_channel_history"], "test.iterable.not_null_iterable__campaigns_campaign_id.03c9448919": ["model.iterable.iterable__campaigns"], "test.iterable.not_null_iterable__events_event_id.ed1d28a650": ["model.iterable.iterable__events"], "test.iterable.not_null_iterable__journeys_journey_id.b5c6b8783a": ["model.iterable.iterable__journeys"], "test.iterable.unique_iterable__journeys_unique_journey_id.ba86841246": ["model.iterable.iterable__journeys"], "test.iterable.not_null_iterable__user_unsubscriptions_unique_user_key.f8db72932b": ["model.iterable.iterable__user_unsubscriptions"], "test.iterable.not_null_iterable__users_unique_user_key.4ca37a26c8": ["model.iterable.iterable__users"], "test.iterable.not_null_stg_iterable__campaign_history_campaign_id.b7c36e4525": ["model.iterable.stg_iterable__campaign_history"], "test.iterable.not_null_stg_iterable__campaign_label_history_campaign_id.1918cef89a": ["model.iterable.stg_iterable__campaign_label_history"], "test.iterable.not_null_stg_iterable__campaign_list_history_campaign_id.208f9bf9ed": ["model.iterable.stg_iterable__campaign_list_history"], "test.iterable.not_null_stg_iterable__campaign_suppression_list_history_campaign_id.3921289710": ["model.iterable.stg_iterable__campaign_suppression_list_history"], "test.iterable.not_null_stg_iterable__channel_channel_id.182ceb9636": ["model.iterable.stg_iterable__channel"], "test.iterable.not_null_stg_iterable__event_event_id.370cd4bc9d": ["model.iterable.stg_iterable__event"], "test.iterable.not_null_stg_iterable__event_unique_event_id.e2b46d3bb6": ["model.iterable.stg_iterable__event"], "test.iterable.not_null_stg_iterable__event_extension_event_id.144dedcd30": ["model.iterable.stg_iterable__event_extension"], "test.iterable.not_null_stg_iterable__journey_journey_id.cc38bd633c": ["model.iterable.stg_iterable__journey"], "test.iterable.not_null_stg_iterable__list_list_id.47029d839a": ["model.iterable.stg_iterable__list"], "test.iterable.not_null_stg_iterable__message_type_message_type_id.75eaa6fa62": ["model.iterable.stg_iterable__message_type"], "test.iterable.not_null_stg_iterable__template_history_template_id.14b24a1dfe": ["model.iterable.stg_iterable__template_history"], "test.iterable.not_null_stg_iterable__list_user__fivetran_user_id.cca4b34c07": ["model.iterable.stg_iterable__list_user"], "test.iterable.not_null_stg_iterable__user_history_unique_user_key.2845af2127": ["model.iterable.stg_iterable__user_history"], "test.iterable.not_null_stg_iterable__user_unsubscribed_channel_channel_id.da0ed9e9be": ["model.iterable.stg_iterable__user_unsubscribed_channel"], "test.iterable.not_null_stg_iterable__user_unsub_message_type_message_type_id.268a89ea6f": ["model.iterable.stg_iterable__user_unsub_message_type"], "source.iterable.iterable.campaign_history": [], "source.iterable.iterable.campaign_label_history": [], "source.iterable.iterable.campaign_list_history": [], "source.iterable.iterable.campaign_suppression_list_history": [], "source.iterable.iterable.channel": [], "source.iterable.iterable.event": [], "source.iterable.iterable.event_extension": [], "source.iterable.iterable.journey": [], "source.iterable.iterable.list": [], "source.iterable.iterable.message_type": [], "source.iterable.iterable.template_history": [], "source.iterable.iterable.user_history": [], "source.iterable.iterable.user_unsubscribed_channel": [], "source.iterable.iterable.user_unsubscribed_message_type": [], "source.iterable.iterable.user_unsubscribed_channel_history": [], "source.iterable.iterable.user_unsubscribed_message_type_history": [], "source.iterable.iterable.list_user": []}, "child_map": {"seed.iterable_integration_tests.campaign_metrics_data": [], "seed.iterable_integration_tests.campaign_list_history_data": [], "seed.iterable_integration_tests.user_unsubscribed_message_type_history_data": [], "seed.iterable_integration_tests.user_unsubscribed_channel_history_data": [], "seed.iterable_integration_tests.campaign_suppression_list_history_data": [], "seed.iterable_integration_tests.channel_data": [], "seed.iterable_integration_tests.template_history_data": [], "seed.iterable_integration_tests.message_type_data": [], "seed.iterable_integration_tests.event_data": [], "seed.iterable_integration_tests.list_user_data": [], "seed.iterable_integration_tests.user_history_bq_json_data": [], "seed.iterable_integration_tests.user_unsubscribed_message_type_data": [], "seed.iterable_integration_tests.journey_data": [], "seed.iterable_integration_tests.campaign_history_data": [], "seed.iterable_integration_tests.list_data": [], "seed.iterable_integration_tests.event_extension_data": [], "seed.iterable_integration_tests.user_unsubscribed_channel_data": [], "seed.iterable_integration_tests.campaign_label_history_data": [], "seed.iterable_integration_tests.user_history_data": [], "model.iterable.iterable__users": ["test.iterable.not_null_iterable__users_unique_user_key.4ca37a26c8"], "model.iterable.iterable__list_user_history": [], "model.iterable.iterable__events": ["model.iterable.iterable__user_campaign", "test.iterable.not_null_iterable__events_event_id.ed1d28a650"], "model.iterable.iterable__user_campaign": ["model.iterable.int_iterable__campaign_event_metrics", "model.iterable.int_iterable__journey_event_metrics", "model.iterable.int_iterable__user_event_metrics"], "model.iterable.iterable__user_unsubscriptions": ["test.iterable.not_null_iterable__user_unsubscriptions_unique_user_key.f8db72932b"], "model.iterable.iterable__journeys": ["test.iterable.not_null_iterable__journeys_journey_id.b5c6b8783a", "test.iterable.unique_iterable__journeys_unique_journey_id.ba86841246"], "model.iterable.iterable__campaigns": ["test.iterable.not_null_iterable__campaigns_campaign_id.03c9448919"], "model.iterable.int_iterable__campaign_labels": ["model.iterable.iterable__campaigns"], "model.iterable.int_iterable__journey_event_metrics": ["model.iterable.iterable__journeys"], "model.iterable.int_iterable__list_user_unnest": ["model.iterable.iterable__list_user_history", "model.iterable.iterable__users"], "model.iterable.int_iterable__latest_template": ["model.iterable.iterable__campaigns", "model.iterable.iterable__events"], "model.iterable.int_iterable__campaign_event_metrics": ["model.iterable.iterable__campaigns"], "model.iterable.int_iterable__campaign_lists": ["model.iterable.iterable__campaigns"], "model.iterable.int_iterable__recurring_campaigns": ["model.iterable.int_iterable__journey_event_metrics", "model.iterable.iterable__campaigns", "model.iterable.iterable__events"], "model.iterable.int_iterable__list_user_history": ["model.iterable.int_iterable__list_user_unnest"], "model.iterable.int_iterable__message_type_channel": ["model.iterable.int_iterable__latest_template", "model.iterable.iterable__events", "model.iterable.iterable__user_unsubscriptions"], "model.iterable.int_iterable__user_event_metrics": ["model.iterable.iterable__users"], "model.iterable.int_iterable__latest_user": ["model.iterable.iterable__events"], "model.iterable.int_iterable__latest_campaign": ["model.iterable.int_iterable__recurring_campaigns"], "model.iterable.stg_iterable__message_type": ["model.iterable.int_iterable__message_type_channel", "test.iterable.not_null_stg_iterable__message_type_message_type_id.75eaa6fa62"], "model.iterable.stg_iterable__event": ["model.iterable.iterable__events", "test.iterable.not_null_stg_iterable__event_event_id.370cd4bc9d", "test.iterable.not_null_stg_iterable__event_unique_event_id.e2b46d3bb6"], "model.iterable.stg_iterable__user_unsubscribed_channel": ["model.iterable.iterable__user_unsubscriptions", "test.iterable.not_null_stg_iterable__user_unsubscribed_channel_channel_id.da0ed9e9be"], "model.iterable.stg_iterable__campaign_history": ["model.iterable.int_iterable__latest_campaign", "test.iterable.not_null_stg_iterable__campaign_history_campaign_id.b7c36e4525"], "model.iterable.stg_iterable__campaign_label_history": ["model.iterable.int_iterable__campaign_labels", "test.iterable.not_null_stg_iterable__campaign_label_history_campaign_id.1918cef89a"], "model.iterable.stg_iterable__template_history": ["model.iterable.int_iterable__latest_template", "test.iterable.not_null_stg_iterable__template_history_template_id.14b24a1dfe"], "model.iterable.stg_iterable__journey": ["model.iterable.iterable__campaigns", "model.iterable.iterable__journeys", "test.iterable.not_null_stg_iterable__journey_journey_id.cc38bd633c"], "model.iterable.stg_iterable__user_history": ["model.iterable.int_iterable__latest_user", "model.iterable.int_iterable__list_user_history", "test.iterable.not_null_stg_iterable__user_history_unique_user_key.2845af2127"], "model.iterable.stg_iterable__user_unsub_message_type": ["model.iterable.iterable__user_unsubscriptions", "test.iterable.not_null_stg_iterable__user_unsub_message_type_message_type_id.268a89ea6f"], "model.iterable.stg_iterable__list": ["model.iterable.iterable__list_user_history", "test.iterable.not_null_stg_iterable__list_list_id.47029d839a"], "model.iterable.stg_iterable__list_user": ["model.iterable.iterable__list_user_history", "model.iterable.iterable__users", "test.iterable.not_null_stg_iterable__list_user__fivetran_user_id.cca4b34c07"], "model.iterable.stg_iterable__campaign_suppression_list_history": ["model.iterable.int_iterable__campaign_lists", "test.iterable.not_null_stg_iterable__campaign_suppression_list_history_campaign_id.3921289710"], "model.iterable.stg_iterable__event_extension": ["model.iterable.iterable__events", "test.iterable.not_null_stg_iterable__event_extension_event_id.144dedcd30"], "model.iterable.stg_iterable__campaign_list_history": ["model.iterable.int_iterable__campaign_lists", "test.iterable.not_null_stg_iterable__campaign_list_history_campaign_id.208f9bf9ed"], "model.iterable.stg_iterable__channel": ["model.iterable.int_iterable__message_type_channel", "test.iterable.not_null_stg_iterable__channel_channel_id.182ceb9636"], "model.iterable.stg_iterable__message_type_tmp": ["model.iterable.stg_iterable__message_type"], "model.iterable.stg_iterable__event_extension_tmp": ["model.iterable.stg_iterable__event_extension"], "model.iterable.stg_iterable__user_unsub_message_type_tmp": ["model.iterable.stg_iterable__user_unsub_message_type"], "model.iterable.stg_iterable__campaign_list_history_tmp": ["model.iterable.stg_iterable__campaign_list_history"], "model.iterable.stg_iterable__list_user_tmp": ["model.iterable.stg_iterable__list_user"], "model.iterable.stg_iterable__user_history_tmp": ["model.iterable.stg_iterable__user_history"], "model.iterable.stg_iterable__campaign_history_tmp": ["model.iterable.stg_iterable__campaign_history"], "model.iterable.stg_iterable__template_history_tmp": ["model.iterable.stg_iterable__template_history"], "model.iterable.stg_iterable__event_tmp": ["model.iterable.stg_iterable__event"], "model.iterable.stg_iterable__journey_tmp": ["model.iterable.stg_iterable__journey"], "model.iterable.stg_iterable__campaign_suppression_list_history_tmp": ["model.iterable.stg_iterable__campaign_suppression_list_history"], "model.iterable.stg_iterable__campaign_label_history_tmp": ["model.iterable.stg_iterable__campaign_label_history"], "model.iterable.stg_iterable__list_tmp": ["model.iterable.stg_iterable__list"], "model.iterable.stg_iterable__channel_tmp": ["model.iterable.stg_iterable__channel"], "model.iterable.stg_iterable__user_unsubscribed_channel_tmp": ["model.iterable.stg_iterable__user_unsubscribed_channel"], "test.iterable.not_null_iterable__campaigns_campaign_id.03c9448919": [], "test.iterable.not_null_iterable__events_event_id.ed1d28a650": [], "test.iterable.not_null_iterable__journeys_journey_id.b5c6b8783a": [], "test.iterable.unique_iterable__journeys_unique_journey_id.ba86841246": [], "test.iterable.not_null_iterable__user_unsubscriptions_unique_user_key.f8db72932b": [], "test.iterable.not_null_iterable__users_unique_user_key.4ca37a26c8": [], "test.iterable.not_null_stg_iterable__campaign_history_campaign_id.b7c36e4525": [], "test.iterable.not_null_stg_iterable__campaign_label_history_campaign_id.1918cef89a": [], "test.iterable.not_null_stg_iterable__campaign_list_history_campaign_id.208f9bf9ed": [], "test.iterable.not_null_stg_iterable__campaign_suppression_list_history_campaign_id.3921289710": [], "test.iterable.not_null_stg_iterable__channel_channel_id.182ceb9636": [], "test.iterable.not_null_stg_iterable__event_event_id.370cd4bc9d": [], "test.iterable.not_null_stg_iterable__event_unique_event_id.e2b46d3bb6": [], "test.iterable.not_null_stg_iterable__event_extension_event_id.144dedcd30": [], "test.iterable.not_null_stg_iterable__journey_journey_id.cc38bd633c": [], "test.iterable.not_null_stg_iterable__list_list_id.47029d839a": [], "test.iterable.not_null_stg_iterable__message_type_message_type_id.75eaa6fa62": [], "test.iterable.not_null_stg_iterable__template_history_template_id.14b24a1dfe": [], "test.iterable.not_null_stg_iterable__list_user__fivetran_user_id.cca4b34c07": [], "test.iterable.not_null_stg_iterable__user_history_unique_user_key.2845af2127": [], "test.iterable.not_null_stg_iterable__user_unsubscribed_channel_channel_id.da0ed9e9be": [], "test.iterable.not_null_stg_iterable__user_unsub_message_type_message_type_id.268a89ea6f": [], "source.iterable.iterable.campaign_history": ["model.iterable.stg_iterable__campaign_history_tmp"], "source.iterable.iterable.campaign_label_history": ["model.iterable.stg_iterable__campaign_label_history_tmp"], "source.iterable.iterable.campaign_list_history": ["model.iterable.stg_iterable__campaign_list_history_tmp"], "source.iterable.iterable.campaign_suppression_list_history": ["model.iterable.stg_iterable__campaign_suppression_list_history_tmp"], "source.iterable.iterable.channel": ["model.iterable.stg_iterable__channel_tmp"], "source.iterable.iterable.event": ["model.iterable.stg_iterable__event_tmp"], "source.iterable.iterable.event_extension": ["model.iterable.stg_iterable__event_extension_tmp"], "source.iterable.iterable.journey": ["model.iterable.stg_iterable__journey_tmp"], "source.iterable.iterable.list": ["model.iterable.stg_iterable__list_tmp"], "source.iterable.iterable.message_type": ["model.iterable.stg_iterable__message_type_tmp"], "source.iterable.iterable.template_history": ["model.iterable.stg_iterable__template_history_tmp"], "source.iterable.iterable.user_history": ["model.iterable.stg_iterable__user_history_tmp"], "source.iterable.iterable.user_unsubscribed_channel": [], "source.iterable.iterable.user_unsubscribed_message_type": [], "source.iterable.iterable.user_unsubscribed_channel_history": ["model.iterable.stg_iterable__user_unsubscribed_channel_tmp"], "source.iterable.iterable.user_unsubscribed_message_type_history": ["model.iterable.stg_iterable__user_unsub_message_type_tmp"], "source.iterable.iterable.list_user": ["model.iterable.stg_iterable__list_user_tmp"]}, "group_map": {}, "saved_queries": {}, "semantic_models": {}, "unit_tests": {}, "functions": {}} \ No newline at end of file From db35e6c0e5935aef99c278d7b6557ae2fc4e22b2 Mon Sep 17 00:00:00 2001 From: Savage Fivetran Date: Mon, 14 Sep 2026 14:15:17 -0700 Subject: [PATCH 06/11] update_readme --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index a66fcbd..bf2ff84 100644 --- a/README.md +++ b/README.md @@ -159,6 +159,10 @@ vars: - name: "event_extension_field" alias: "renamed_field" transform_sql: "cast(renamed_field as string)" + iterable_journey_pass_through_columns: + - name: "draft_created_at" + alias: "draft_created_timestamp" + - name: "draft_name" iterable_user_history_pass_through_columns: - name: "user_attribute" alias: "renamed_user_attribute" From 8b600174fc13e558da9d465866d32cbbe88a760e Mon Sep 17 00:00:00 2001 From: Savage Fivetran Date: Mon, 14 Sep 2026 14:44:57 -0700 Subject: [PATCH 07/11] Apply batched suggestions from code review Co-authored-by: Avinash Kunnath <108772760+fivetran-avinash@users.noreply.github.com> --- README.md | 2 +- models/staging/src_iterable.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index bf2ff84..27ca650 100644 --- a/README.md +++ b/README.md @@ -73,7 +73,7 @@ Include the following Iterable package version in your `packages.yml` file. ```yaml packages: - package: fivetran/iterable - version: [">=1.5.0", "<1.6.0"] + version: [">=1.6.0", "<1.7.0"] ``` #### Database Incremental Strategies diff --git a/models/staging/src_iterable.yml b/models/staging/src_iterable.yml index e60625a..c4c7255 100644 --- a/models/staging/src_iterable.yml +++ b/models/staging/src_iterable.yml @@ -260,7 +260,7 @@ sources: - name: name description: User defined name of the journey - name: journey_type - description: The journey type + description: Whether the journey is published or a draft. - name: description description: Information about the journey - name: creator_user_id From a7793ebd1b59354ce2fea7fe683080b48bd314b9 Mon Sep 17 00:00:00 2001 From: Savage Fivetran Date: Mon, 14 Sep 2026 14:47:51 -0700 Subject: [PATCH 08/11] update_yml --- models/staging/stg_iterable.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/models/staging/stg_iterable.yml b/models/staging/stg_iterable.yml index f3257e2..e662b8c 100644 --- a/models/staging/stg_iterable.yml +++ b/models/staging/stg_iterable.yml @@ -263,7 +263,7 @@ models: - name: journey_name description: User defined name of the journey - name: journey_type - description: The journey type + description: Whether the journey is published or a draft - name: journey_description description: Information about the journey - name: creator_user_id From 3c0c0592f6d919eb18e90585b4c84d764af7a721 Mon Sep 17 00:00:00 2001 From: fivetran-data-model-bot Date: Mon, 14 Sep 2026 21:49:40 +0000 Subject: [PATCH 09/11] Generate dbt docs via GitHub Actions --- docs/catalog.json | 2 +- docs/manifest.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/catalog.json b/docs/catalog.json index 2e33b6e..aaa0f2d 100644 --- a/docs/catalog.json +++ b/docs/catalog.json @@ -1 +1 @@ -{"metadata": {"dbt_schema_version": "https://schemas.getdbt.com/dbt/catalog/v1.json", "dbt_version": "1.12.4", "generated_at": "2026-09-14T21:06:23.075373Z", "invocation_id": "9ff5dbb1-4114-401f-b8d6-f22217b143f8", "invocation_started_at": "2026-09-14T21:06:19.711000Z", "env": {}}, "nodes": {"seed.iterable_integration_tests.campaign_history_data": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "campaign_history_data", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"id": {"type": "integer", "index": 1, "name": "id", "comment": null}, "updated_at": {"type": "text", "index": 2, "name": "updated_at", "comment": null}, "template_id": {"type": "integer", "index": 3, "name": "template_id", "comment": null}, "recurring_campaign_id": {"type": "integer", "index": 4, "name": "recurring_campaign_id", "comment": null}, "campaign_state": {"type": "text", "index": 5, "name": "campaign_state", "comment": null}, "created_at": {"type": "text", "index": 6, "name": "created_at", "comment": null}, "created_by_user_id": {"type": "text", "index": 7, "name": "created_by_user_id", "comment": null}, "ended_at": {"type": "integer", "index": 8, "name": "ended_at", "comment": null}, "name": {"type": "text", "index": 9, "name": "name", "comment": null}, "send_size": {"type": "integer", "index": 10, "name": "send_size", "comment": null}, "start_at": {"type": "integer", "index": 11, "name": "start_at", "comment": null}, "type": {"type": "text", "index": 12, "name": "type", "comment": null}, "workflow_id": {"type": "integer", "index": 13, "name": "workflow_id", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 14, "name": "_fivetran_synced", "comment": null}, "updated_by_user_id": {"type": "integer", "index": 15, "name": "updated_by_user_id", "comment": null}, "message_medium": {"type": "text", "index": 16, "name": "message_medium", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.iterable_integration_tests.campaign_history_data"}, "seed.iterable_integration_tests.campaign_label_history_data": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "campaign_label_history_data", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"campaign_id": {"type": "integer", "index": 1, "name": "campaign_id", "comment": null}, "label": {"type": "text", "index": 2, "name": "label", "comment": null}, "updated_at": {"type": "text", "index": 3, "name": "updated_at", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 4, "name": "_fivetran_synced", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.iterable_integration_tests.campaign_label_history_data"}, "seed.iterable_integration_tests.campaign_list_history_data": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "campaign_list_history_data", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"list_id": {"type": "integer", "index": 1, "name": "list_id", "comment": null}, "campaign_id": {"type": "integer", "index": 2, "name": "campaign_id", "comment": null}, "updated_at": {"type": "text", "index": 3, "name": "updated_at", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 4, "name": "_fivetran_synced", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.iterable_integration_tests.campaign_list_history_data"}, "seed.iterable_integration_tests.campaign_metrics_data": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "campaign_metrics_data", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"date": {"type": "date", "index": 1, "name": "date", "comment": null}, "id": {"type": "integer", "index": 2, "name": "id", "comment": null}, "_fivetran_deleted": {"type": "boolean", "index": 3, "name": "_fivetran_deleted", "comment": null}, "average_order_value": {"type": "integer", "index": 4, "name": "average_order_value", "comment": null}, "purchases": {"type": "integer", "index": 5, "name": "purchases", "comment": null}, "revenue": {"type": "integer", "index": 6, "name": "revenue", "comment": null}, "revenue_m": {"type": "integer", "index": 7, "name": "revenue_m", "comment": null}, "total_app_uninstalls": {"type": "integer", "index": 8, "name": "total_app_uninstalls", "comment": null}, "total_complaints": {"type": "integer", "index": 9, "name": "total_complaints", "comment": null}, "total_email_bounced": {"type": "integer", "index": 10, "name": "total_email_bounced", "comment": null}, "total_email_clicked": {"type": "integer", "index": 11, "name": "total_email_clicked", "comment": null}, "total_email_delivered": {"type": "integer", "index": 12, "name": "total_email_delivered", "comment": null}, "total_email_opens": {"type": "integer", "index": 13, "name": "total_email_opens", "comment": null}, "total_email_sends": {"type": "integer", "index": 14, "name": "total_email_sends", "comment": null}, "total_hosted_unsubscribe_clicks": {"type": "integer", "index": 15, "name": "total_hosted_unsubscribe_clicks", "comment": null}, "total_purchases": {"type": "integer", "index": 16, "name": "total_purchases", "comment": null}, "total_pushes_bounced": {"type": "integer", "index": 17, "name": "total_pushes_bounced", "comment": null}, "total_pushes_delivered": {"type": "integer", "index": 18, "name": "total_pushes_delivered", "comment": null}, "total_pushes_opened": {"type": "integer", "index": 19, "name": "total_pushes_opened", "comment": null}, "total_pushes_sent": {"type": "integer", "index": 20, "name": "total_pushes_sent", "comment": null}, "total_unsubscribes": {"type": "integer", "index": 21, "name": "total_unsubscribes", "comment": null}, "unique_email_bounced": {"type": "integer", "index": 22, "name": "unique_email_bounced", "comment": null}, "unique_email_clicks": {"type": "integer", "index": 23, "name": "unique_email_clicks", "comment": null}, "unique_email_opens_or_clicks": {"type": "integer", "index": 24, "name": "unique_email_opens_or_clicks", "comment": null}, "unique_hosted_unsubscribe_clicks": {"type": "integer", "index": 25, "name": "unique_hosted_unsubscribe_clicks", "comment": null}, "unique_purchases": {"type": "integer", "index": 26, "name": "unique_purchases", "comment": null}, "unique_pushes_bounced": {"type": "integer", "index": 27, "name": "unique_pushes_bounced", "comment": null}, "unique_pushes_opened": {"type": "integer", "index": 28, "name": "unique_pushes_opened", "comment": null}, "unique_pushes_sent": {"type": "integer", "index": 29, "name": "unique_pushes_sent", "comment": null}, "unique_unsubscribes": {"type": "integer", "index": 30, "name": "unique_unsubscribes", "comment": null}, "total_push_send_skips": {"type": "integer", "index": 31, "name": "total_push_send_skips", "comment": null}, "total_in_app_opens": {"type": "integer", "index": 32, "name": "total_in_app_opens", "comment": null}, "unique_in_apps_delivered": {"type": "integer", "index": 33, "name": "unique_in_apps_delivered", "comment": null}, "unique_in_app_sends": {"type": "integer", "index": 34, "name": "unique_in_app_sends", "comment": null}, "total_in_app_closes": {"type": "integer", "index": 35, "name": "total_in_app_closes", "comment": null}, "total_inbox_impressions": {"type": "integer", "index": 36, "name": "total_inbox_impressions", "comment": null}, "unique_pushes_delivered": {"type": "integer", "index": 37, "name": "unique_pushes_delivered", "comment": null}, "unique_in_app_clicks": {"type": "integer", "index": 38, "name": "unique_in_app_clicks", "comment": null}, "unique_emails_delivered": {"type": "integer", "index": 39, "name": "unique_emails_delivered", "comment": null}, "total_in_app_clicks": {"type": "integer", "index": 40, "name": "total_in_app_clicks", "comment": null}, "total_in_app_deletes": {"type": "integer", "index": 41, "name": "total_in_app_deletes", "comment": null}, "total_in_app_sent": {"type": "integer", "index": 42, "name": "total_in_app_sent", "comment": null}, "total_in_apps_delivered": {"type": "integer", "index": 43, "name": "total_in_apps_delivered", "comment": null}, "unique_in_app_opens": {"type": "integer", "index": 44, "name": "unique_in_app_opens", "comment": null}, "total_email_holdout": {"type": "integer", "index": 45, "name": "total_email_holdout", "comment": null}, "total_email_send_skips": {"type": "integer", "index": 46, "name": "total_email_send_skips", "comment": null}, "unique_email_sends": {"type": "integer", "index": 47, "name": "unique_email_sends", "comment": null}, "unique_emails_opens": {"type": "integer", "index": 48, "name": "unique_emails_opens", "comment": null}, "total_in_app_holdout": {"type": "integer", "index": 49, "name": "total_in_app_holdout", "comment": null}, "total_in_app_send_skips": {"type": "integer", "index": 50, "name": "total_in_app_send_skips", "comment": null}, "total_push_holdout": {"type": "integer", "index": 51, "name": "total_push_holdout", "comment": null}, "_fivetran_synced": {"type": "text", "index": 52, "name": "_fivetran_synced", "comment": null}, "total_sms_holdout": {"type": "integer", "index": 53, "name": "total_sms_holdout", "comment": null}, "unique_sms_sent": {"type": "integer", "index": 54, "name": "unique_sms_sent", "comment": null}, "total_sms_delivered": {"type": "integer", "index": 55, "name": "total_sms_delivered", "comment": null}, "total_sms_sent": {"type": "integer", "index": 56, "name": "total_sms_sent", "comment": null}, "total_inbound_sms": {"type": "integer", "index": 57, "name": "total_inbound_sms", "comment": null}, "total_sms_bounced": {"type": "integer", "index": 58, "name": "total_sms_bounced", "comment": null}, "total_sms_send_skips": {"type": "integer", "index": 59, "name": "total_sms_send_skips", "comment": null}, "unique_inbound_sms": {"type": "integer", "index": 60, "name": "unique_inbound_sms", "comment": null}, "unique_sms_delivered": {"type": "integer", "index": 61, "name": "unique_sms_delivered", "comment": null}, "unique_sms_bounced": {"type": "integer", "index": 62, "name": "unique_sms_bounced", "comment": null}, "revenue_m_sms_": {"type": "integer", "index": 63, "name": "revenue_m_sms_", "comment": null}, "purchases_m_sms_": {"type": "integer", "index": 64, "name": "purchases_m_sms_", "comment": null}, "purchases_m_email_": {"type": "integer", "index": 65, "name": "purchases_m_email_", "comment": null}, "revenue_m_push_": {"type": "integer", "index": 66, "name": "revenue_m_push_", "comment": null}, "revenue_m_email_": {"type": "integer", "index": 67, "name": "revenue_m_email_", "comment": null}, "purchases_m_push_": {"type": "integer", "index": 68, "name": "purchases_m_push_", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.iterable_integration_tests.campaign_metrics_data"}, "seed.iterable_integration_tests.campaign_suppression_list_history_data": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "campaign_suppression_list_history_data", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"suppressed_list_id": {"type": "integer", "index": 1, "name": "suppressed_list_id", "comment": null}, "campaign_id": {"type": "integer", "index": 2, "name": "campaign_id", "comment": null}, "updated_at": {"type": "text", "index": 3, "name": "updated_at", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 4, "name": "_fivetran_synced", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.iterable_integration_tests.campaign_suppression_list_history_data"}, "seed.iterable_integration_tests.channel_data": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "channel_data", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"id": {"type": "bigint", "index": 1, "name": "id", "comment": null}, "name": {"type": "text", "index": 2, "name": "name", "comment": null}, "channel_type": {"type": "text", "index": 3, "name": "channel_type", "comment": null}, "message_medium": {"type": "text", "index": 4, "name": "message_medium", "comment": null}, "_fivetran_deleted": {"type": "boolean", "index": 5, "name": "_fivetran_deleted", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 6, "name": "_fivetran_synced", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.iterable_integration_tests.channel_data"}, "seed.iterable_integration_tests.event_data": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "event_data", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"_fivetran_id": {"type": "text", "index": 1, "name": "_fivetran_id", "comment": null}, "email": {"type": "text", "index": 2, "name": "email", "comment": null}, "campaign_id": {"type": "integer", "index": 3, "name": "campaign_id", "comment": null}, "message_id": {"type": "integer", "index": 4, "name": "message_id", "comment": null}, "content_id": {"type": "integer", "index": 5, "name": "content_id", "comment": null}, "created_at": {"type": "timestamp without time zone", "index": 6, "name": "created_at", "comment": null}, "event_name": {"type": "text", "index": 7, "name": "event_name", "comment": null}, "ip": {"type": "integer", "index": 8, "name": "ip", "comment": null}, "message_bus_id": {"type": "integer", "index": 9, "name": "message_bus_id", "comment": null}, "message_type_id": {"type": "integer", "index": 10, "name": "message_type_id", "comment": null}, "recipient_state": {"type": "integer", "index": 11, "name": "recipient_state", "comment": null}, "status": {"type": "integer", "index": 12, "name": "status", "comment": null}, "unsub_source": {"type": "integer", "index": 13, "name": "unsub_source", "comment": null}, "user_agent": {"type": "integer", "index": 14, "name": "user_agent", "comment": null}, "user_agent_device": {"type": "integer", "index": 15, "name": "user_agent_device", "comment": null}, "transactional_data": {"type": "character varying(100)", "index": 16, "name": "transactional_data", "comment": null}, "additional_properties": {"type": "text", "index": 17, "name": "additional_properties", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 18, "name": "_fivetran_synced", "comment": null}, "_fivetran_user_id": {"type": "integer", "index": 19, "name": "_fivetran_user_id", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.iterable_integration_tests.event_data"}, "seed.iterable_integration_tests.event_extension_data": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "event_extension_data", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"_fivetran_id": {"type": "text", "index": 1, "name": "_fivetran_id", "comment": null}, "app_already_running": {"type": "integer", "index": 2, "name": "app_already_running", "comment": null}, "badge": {"type": "integer", "index": 3, "name": "badge", "comment": null}, "canonical_url_id": {"type": "integer", "index": 4, "name": "canonical_url_id", "comment": null}, "content_available": {"type": "integer", "index": 5, "name": "content_available", "comment": null}, "content_id": {"type": "integer", "index": 6, "name": "content_id", "comment": null}, "device": {"type": "integer", "index": 7, "name": "device", "comment": null}, "email_id": {"type": "text", "index": 8, "name": "email_id", "comment": null}, "email_subject": {"type": "text", "index": 9, "name": "email_subject", "comment": null}, "experiment_id": {"type": "integer", "index": 10, "name": "experiment_id", "comment": null}, "from_phone_number_id": {"type": "integer", "index": 11, "name": "from_phone_number_id", "comment": null}, "from_smssender_id": {"type": "integer", "index": 12, "name": "from_smssender_id", "comment": null}, "image_url": {"type": "integer", "index": 13, "name": "image_url", "comment": null}, "is_ghost_push": {"type": "integer", "index": 14, "name": "is_ghost_push", "comment": null}, "link_id": {"type": "integer", "index": 15, "name": "link_id", "comment": null}, "link_url": {"type": "integer", "index": 16, "name": "link_url", "comment": null}, "platform_endpoint": {"type": "integer", "index": 17, "name": "platform_endpoint", "comment": null}, "push_message": {"type": "integer", "index": 18, "name": "push_message", "comment": null}, "region": {"type": "text", "index": 19, "name": "region", "comment": null}, "sms_message": {"type": "integer", "index": 20, "name": "sms_message", "comment": null}, "sound": {"type": "integer", "index": 21, "name": "sound", "comment": null}, "to_phone_number": {"type": "integer", "index": 22, "name": "to_phone_number", "comment": null}, "url": {"type": "integer", "index": 23, "name": "url", "comment": null}, "workflow_id": {"type": "integer", "index": 24, "name": "workflow_id", "comment": null}, "workflow_name": {"type": "text", "index": 25, "name": "workflow_name", "comment": null}, "locale": {"type": "integer", "index": 26, "name": "locale", "comment": null}, "deeplink_android": {"type": "integer", "index": 27, "name": "deeplink_android", "comment": null}, "deeplink_ios": {"type": "integer", "index": 28, "name": "deeplink_ios", "comment": null}, "payload": {"type": "character varying(100)", "index": 29, "name": "payload", "comment": null}, "sms_provider_response_status": {"type": "integer", "index": 30, "name": "sms_provider_response_status", "comment": null}, "sms_provider_response_message": {"type": "integer", "index": 31, "name": "sms_provider_response_message", "comment": null}, "sms_provider_response_code": {"type": "integer", "index": 32, "name": "sms_provider_response_code", "comment": null}, "sms_provider_response_more_info": {"type": "integer", "index": 33, "name": "sms_provider_response_more_info", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 34, "name": "_fivetran_synced", "comment": null}, "catalog_collection_count": {"type": "integer", "index": 35, "name": "catalog_collection_count", "comment": null}, "catalog_lookup_count": {"type": "integer", "index": 36, "name": "catalog_lookup_count", "comment": null}, "city": {"type": "text", "index": 37, "name": "city", "comment": null}, "clicked_url": {"type": "text", "index": 38, "name": "clicked_url", "comment": null}, "country": {"type": "text", "index": 39, "name": "country", "comment": null}, "error_code": {"type": "integer", "index": 40, "name": "error_code", "comment": null}, "expires_at": {"type": "text", "index": 41, "name": "expires_at", "comment": null}, "from_phone_number": {"type": "integer", "index": 42, "name": "from_phone_number", "comment": null}, "in_app_body": {"type": "text", "index": 43, "name": "in_app_body", "comment": null}, "is_sms_estimation": {"type": "boolean", "index": 44, "name": "is_sms_estimation", "comment": null}, "labels": {"type": "text", "index": 45, "name": "labels", "comment": null}, "message_context": {"type": "text", "index": 46, "name": "message_context", "comment": null}, "message_status": {"type": "text", "index": 47, "name": "message_status", "comment": null}, "mms_send_count": {"type": "integer", "index": 48, "name": "mms_send_count", "comment": null}, "product_recommendation_count": {"type": "integer", "index": 49, "name": "product_recommendation_count", "comment": null}, "proxy_source": {"type": "text", "index": 50, "name": "proxy_source", "comment": null}, "reason": {"type": "text", "index": 51, "name": "reason", "comment": null}, "sms_send_count": {"type": "integer", "index": 52, "name": "sms_send_count", "comment": null}, "web_push_body": {"type": "text", "index": 53, "name": "web_push_body", "comment": null}, "web_push_click_action": {"type": "text", "index": 54, "name": "web_push_click_action", "comment": null}, "web_push_icon": {"type": "text", "index": 55, "name": "web_push_icon", "comment": null}, "web_push_message": {"type": "text", "index": 56, "name": "web_push_message", "comment": null}, "_fivetran_user_id": {"type": "integer", "index": 57, "name": "_fivetran_user_id", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.iterable_integration_tests.event_extension_data"}, "seed.iterable_integration_tests.journey_data": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "journey_data", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"id": {"type": "bigint", "index": 1, "name": "id", "comment": null}, "name": {"type": "text", "index": 2, "name": "name", "comment": null}, "journey_type": {"type": "text", "index": 3, "name": "journey_type", "comment": null}, "description": {"type": "text", "index": 4, "name": "description", "comment": null}, "creator_user_id": {"type": "text", "index": 5, "name": "creator_user_id", "comment": null}, "enabled": {"type": "boolean", "index": 6, "name": "enabled", "comment": null}, "is_archived": {"type": "boolean", "index": 7, "name": "is_archived", "comment": null}, "lifetime_limit": {"type": "bigint", "index": 8, "name": "lifetime_limit", "comment": null}, "simultaneous_limit": {"type": "bigint", "index": 9, "name": "simultaneous_limit", "comment": null}, "start_tile_id": {"type": "bigint", "index": 10, "name": "start_tile_id", "comment": null}, "trigger_event_names": {"type": "text", "index": 11, "name": "trigger_event_names", "comment": null}, "created_at": {"type": "timestamp without time zone", "index": 12, "name": "created_at", "comment": null}, "updated_at": {"type": "timestamp without time zone", "index": 13, "name": "updated_at", "comment": null}, "_fivetran_deleted": {"type": "boolean", "index": 14, "name": "_fivetran_deleted", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 15, "name": "_fivetran_synced", "comment": null}, "draft_name": {"type": "text", "index": 16, "name": "draft_name", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.iterable_integration_tests.journey_data"}, "seed.iterable_integration_tests.list_data": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "list_data", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"id": {"type": "integer", "index": 1, "name": "id", "comment": null}, "name": {"type": "text", "index": 2, "name": "name", "comment": null}, "created_at": {"type": "text", "index": 3, "name": "created_at", "comment": null}, "list_type": {"type": "text", "index": 4, "name": "list_type", "comment": null}, "_fivetran_deleted": {"type": "boolean", "index": 5, "name": "_fivetran_deleted", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 6, "name": "_fivetran_synced", "comment": null}, "description": {"type": "text", "index": 7, "name": "description", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.iterable_integration_tests.list_data"}, "seed.iterable_integration_tests.list_user_data": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "list_user_data", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"_fivetran_id": {"type": "text", "index": 1, "name": "_fivetran_id", "comment": null}, "index": {"type": "bigint", "index": 2, "name": "index", "comment": null}, "list_id": {"type": "bigint", "index": 3, "name": "list_id", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 4, "name": "_fivetran_synced", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.iterable_integration_tests.list_user_data"}, "seed.iterable_integration_tests.message_type_data": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "message_type_data", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"id": {"type": "bigint", "index": 1, "name": "id", "comment": null}, "name": {"type": "text", "index": 2, "name": "name", "comment": null}, "channel_id": {"type": "bigint", "index": 3, "name": "channel_id", "comment": null}, "_fivetran_deleted": {"type": "boolean", "index": 4, "name": "_fivetran_deleted", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 5, "name": "_fivetran_synced", "comment": null}, "created_at": {"type": "timestamp without time zone", "index": 6, "name": "created_at", "comment": null}, "frequency_cap": {"type": "integer", "index": 7, "name": "frequency_cap", "comment": null}, "rate_limit_per_minute": {"type": "integer", "index": 8, "name": "rate_limit_per_minute", "comment": null}, "subscription_policy": {"type": "text", "index": 9, "name": "subscription_policy", "comment": null}, "updated_at": {"type": "timestamp without time zone", "index": 10, "name": "updated_at", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.iterable_integration_tests.message_type_data"}, "seed.iterable_integration_tests.template_history_data": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "template_history_data", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"id": {"type": "integer", "index": 1, "name": "id", "comment": null}, "updated_at": {"type": "text", "index": 2, "name": "updated_at", "comment": null}, "message_type_id": {"type": "integer", "index": 3, "name": "message_type_id", "comment": null}, "client_template_id": {"type": "integer", "index": 4, "name": "client_template_id", "comment": null}, "created_at": {"type": "text", "index": 5, "name": "created_at", "comment": null}, "creator_user_id": {"type": "text", "index": 6, "name": "creator_user_id", "comment": null}, "name": {"type": "text", "index": 7, "name": "name", "comment": null}, "template_type": {"type": "text", "index": 8, "name": "template_type", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 9, "name": "_fivetran_synced", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.iterable_integration_tests.template_history_data"}, "seed.iterable_integration_tests.user_history_bq_json_data": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "user_history_bq_json_data", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"email": {"type": "text", "index": 1, "name": "email", "comment": null}, "updated_at": {"type": "text", "index": 2, "name": "updated_at", "comment": null}, "first_name": {"type": "integer", "index": 3, "name": "first_name", "comment": null}, "last_name": {"type": "integer", "index": 4, "name": "last_name", "comment": null}, "phone_number": {"type": "integer", "index": 5, "name": "phone_number", "comment": null}, "user_id": {"type": "integer", "index": 6, "name": "user_id", "comment": null}, "signup_date": {"type": "text", "index": 7, "name": "signup_date", "comment": null}, "signup_source": {"type": "text", "index": 8, "name": "signup_source", "comment": null}, "phone_number_carrier": {"type": "integer", "index": 9, "name": "phone_number_carrier", "comment": null}, "phone_number_country_code_iso": {"type": "integer", "index": 10, "name": "phone_number_country_code_iso", "comment": null}, "phone_number_line_type": {"type": "integer", "index": 11, "name": "phone_number_line_type", "comment": null}, "phone_number_updated_at": {"type": "integer", "index": 12, "name": "phone_number_updated_at", "comment": null}, "_fivetran_synced": {"type": "text", "index": 13, "name": "_fivetran_synced", "comment": null}, "email_list_ids": {"type": "text", "index": 14, "name": "email_list_ids", "comment": null}, "iterable_user_id": {"type": "integer", "index": 15, "name": "iterable_user_id", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.iterable_integration_tests.user_history_bq_json_data"}, "seed.iterable_integration_tests.user_history_data": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "user_history_data", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"email": {"type": "text", "index": 1, "name": "email", "comment": null}, "updated_at": {"type": "timestamp without time zone", "index": 2, "name": "updated_at", "comment": null}, "first_name": {"type": "integer", "index": 3, "name": "first_name", "comment": null}, "last_name": {"type": "integer", "index": 4, "name": "last_name", "comment": null}, "phone_number": {"type": "integer", "index": 5, "name": "phone_number", "comment": null}, "user_id": {"type": "integer", "index": 6, "name": "user_id", "comment": null}, "signup_date": {"type": "text", "index": 7, "name": "signup_date", "comment": null}, "signup_source": {"type": "text", "index": 8, "name": "signup_source", "comment": null}, "phone_number_carrier": {"type": "integer", "index": 9, "name": "phone_number_carrier", "comment": null}, "phone_number_country_code_iso": {"type": "integer", "index": 10, "name": "phone_number_country_code_iso", "comment": null}, "phone_number_line_type": {"type": "integer", "index": 11, "name": "phone_number_line_type", "comment": null}, "phone_number_updated_at": {"type": "integer", "index": 12, "name": "phone_number_updated_at", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 13, "name": "_fivetran_synced", "comment": null}, "email_list_ids": {"type": "text", "index": 14, "name": "email_list_ids", "comment": null}, "iterable_user_id": {"type": "integer", "index": 15, "name": "iterable_user_id", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.iterable_integration_tests.user_history_data"}, "seed.iterable_integration_tests.user_unsubscribed_channel_data": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "user_unsubscribed_channel_data", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"_fivetran_id": {"type": "text", "index": 1, "name": "_fivetran_id", "comment": null}, "channel_id": {"type": "integer", "index": 2, "name": "channel_id", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 3, "name": "_fivetran_synced", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.iterable_integration_tests.user_unsubscribed_channel_data"}, "seed.iterable_integration_tests.user_unsubscribed_channel_history_data": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "user_unsubscribed_channel_history_data", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"email": {"type": "text", "index": 1, "name": "email", "comment": null}, "channel_id": {"type": "bigint", "index": 2, "name": "channel_id", "comment": null}, "updated_at": {"type": "text", "index": 3, "name": "updated_at", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 4, "name": "_fivetran_synced", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.iterable_integration_tests.user_unsubscribed_channel_history_data"}, "seed.iterable_integration_tests.user_unsubscribed_message_type_data": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "user_unsubscribed_message_type_data", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"_fivetran_id": {"type": "text", "index": 1, "name": "_fivetran_id", "comment": null}, "message_type_id": {"type": "integer", "index": 2, "name": "message_type_id", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 3, "name": "_fivetran_synced", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.iterable_integration_tests.user_unsubscribed_message_type_data"}, "seed.iterable_integration_tests.user_unsubscribed_message_type_history_data": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "user_unsubscribed_message_type_history_data", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"message_type_id": {"type": "integer", "index": 1, "name": "message_type_id", "comment": null}, "email": {"type": "text", "index": 2, "name": "email", "comment": null}, "updated_at": {"type": "text", "index": 3, "name": "updated_at", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 4, "name": "_fivetran_synced", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.iterable_integration_tests.user_unsubscribed_message_type_history_data"}, "model.iterable.int_iterable__campaign_event_metrics": {"metadata": {"type": "VIEW", "schema": "public_iterable_dev", "name": "int_iterable__campaign_event_metrics", "database": "postgres", "comment": "Table that generates relevant total and unique campaign/experiment level aggregations.", "owner": "postgres"}, "columns": {"source_relation": {"type": "text", "index": 1, "name": "source_relation", "comment": null}, "campaign_id": {"type": "text", "index": 2, "name": "campaign_id", "comment": null}, "template_id": {"type": "text", "index": 3, "name": "template_id", "comment": null}, "experiment_id": {"type": "integer", "index": 4, "name": "experiment_id", "comment": null}, "count_unique_users": {"type": "bigint", "index": 5, "name": "count_unique_users", "comment": null}, "total_emailclick": {"type": "numeric", "index": 6, "name": "total_emailclick", "comment": null}, "unique_total_emailclick": {"type": "bigint", "index": 7, "name": "unique_total_emailclick", "comment": null}, "total_emailunsubscribe": {"type": "numeric", "index": 8, "name": "total_emailunsubscribe", "comment": null}, "unique_total_emailunsubscribe": {"type": "bigint", "index": 9, "name": "unique_total_emailunsubscribe", "comment": null}, "total_emailcomplaint": {"type": "numeric", "index": 10, "name": "total_emailcomplaint", "comment": null}, "unique_total_emailcomplaint": {"type": "bigint", "index": 11, "name": "unique_total_emailcomplaint", "comment": null}, "total_customevent": {"type": "numeric", "index": 12, "name": "total_customevent", "comment": null}, "unique_total_customevent": {"type": "bigint", "index": 13, "name": "unique_total_customevent", "comment": null}, "total_emailsubscribe": {"type": "numeric", "index": 14, "name": "total_emailsubscribe", "comment": null}, "unique_total_emailsubscribe": {"type": "bigint", "index": 15, "name": "unique_total_emailsubscribe", "comment": null}, "total_emailopen": {"type": "numeric", "index": 16, "name": "total_emailopen", "comment": null}, "unique_total_emailopen": {"type": "bigint", "index": 17, "name": "unique_total_emailopen", "comment": null}, "total_pushsend": {"type": "numeric", "index": 18, "name": "total_pushsend", "comment": null}, "unique_total_pushsend": {"type": "bigint", "index": 19, "name": "unique_total_pushsend", "comment": null}, "total_smsbounce": {"type": "numeric", "index": 20, "name": "total_smsbounce", "comment": null}, "unique_total_smsbounce": {"type": "bigint", "index": 21, "name": "unique_total_smsbounce", "comment": null}, "total_pushbounce": {"type": "numeric", "index": 22, "name": "total_pushbounce", "comment": null}, "unique_total_pushbounce": {"type": "bigint", "index": 23, "name": "unique_total_pushbounce", "comment": null}, "total_inappsendskip": {"type": "numeric", "index": 24, "name": "total_inappsendskip", "comment": null}, "unique_total_inappsendskip": {"type": "bigint", "index": 25, "name": "unique_total_inappsendskip", "comment": null}, "total_smssend": {"type": "numeric", "index": 26, "name": "total_smssend", "comment": null}, "unique_total_smssend": {"type": "bigint", "index": 27, "name": "unique_total_smssend", "comment": null}, "total_inappsend": {"type": "numeric", "index": 28, "name": "total_inappsend", "comment": null}, "unique_total_inappsend": {"type": "bigint", "index": 29, "name": "unique_total_inappsend", "comment": null}, "total_pushopen": {"type": "numeric", "index": 30, "name": "total_pushopen", "comment": null}, "unique_total_pushopen": {"type": "bigint", "index": 31, "name": "unique_total_pushopen", "comment": null}, "total_emailsend": {"type": "numeric", "index": 32, "name": "total_emailsend", "comment": null}, "unique_total_emailsend": {"type": "bigint", "index": 33, "name": "unique_total_emailsend", "comment": null}, "total_pushsendskip": {"type": "numeric", "index": 34, "name": "total_pushsendskip", "comment": null}, "unique_total_pushsendskip": {"type": "bigint", "index": 35, "name": "unique_total_pushsendskip", "comment": null}, "total_inappopen": {"type": "numeric", "index": 36, "name": "total_inappopen", "comment": null}, "unique_total_inappopen": {"type": "bigint", "index": 37, "name": "unique_total_inappopen", "comment": null}, "total_emailsendskip": {"type": "numeric", "index": 38, "name": "total_emailsendskip", "comment": null}, "unique_total_emailsendskip": {"type": "bigint", "index": 39, "name": "unique_total_emailsendskip", "comment": null}, "total_emailbounce": {"type": "numeric", "index": 40, "name": "total_emailbounce", "comment": null}, "unique_total_emailbounce": {"type": "bigint", "index": 41, "name": "unique_total_emailbounce", "comment": null}, "total_inappclick": {"type": "numeric", "index": 42, "name": "total_inappclick", "comment": null}, "unique_total_inappclick": {"type": "bigint", "index": 43, "name": "unique_total_inappclick", "comment": null}, "total_pushuninstall": {"type": "numeric", "index": 44, "name": "total_pushuninstall", "comment": null}, "unique_total_pushuninstall": {"type": "bigint", "index": 45, "name": "unique_total_pushuninstall", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.int_iterable__campaign_event_metrics"}, "model.iterable.int_iterable__campaign_labels": {"metadata": {"type": "VIEW", "schema": "public_iterable_dev", "name": "int_iterable__campaign_labels", "database": "postgres", "comment": "Table that provides the distinct string aggregation of labels for each campaign.", "owner": "postgres"}, "columns": {"source_relation": {"type": "text", "index": 1, "name": "source_relation", "comment": null}, "campaign_id": {"type": "text", "index": 2, "name": "campaign_id", "comment": null}, "labels": {"type": "text", "index": 3, "name": "labels", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.int_iterable__campaign_labels"}, "model.iterable.int_iterable__campaign_lists": {"metadata": {"type": "VIEW", "schema": "public_iterable_dev", "name": "int_iterable__campaign_lists", "database": "postgres", "comment": "Table that identifies the suppressed and send lists associated with a campaign.", "owner": "postgres"}, "columns": {"source_relation": {"type": "text", "index": 1, "name": "source_relation", "comment": null}, "list_id": {"type": "text", "index": 2, "name": "list_id", "comment": null}, "campaign_id": {"type": "text", "index": 3, "name": "campaign_id", "comment": null}, "updated_at": {"type": "text", "index": 4, "name": "updated_at", "comment": null}, "list_activity": {"type": "text", "index": 5, "name": "list_activity", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.int_iterable__campaign_lists"}, "model.iterable.int_iterable__journey_event_metrics": {"metadata": {"type": "VIEW", "schema": "public_iterable_dev", "name": "int_iterable__journey_event_metrics", "database": "postgres", "comment": "Table that generates relevant total and unique journey level aggregations, rolled up from the user/campaign grain via the campaign's journey reference.", "owner": "postgres"}, "columns": {"source_relation": {"type": "text", "index": 1, "name": "source_relation", "comment": null}, "journey_id": {"type": "text", "index": 2, "name": "journey_id", "comment": null}, "count_total_campaigns": {"type": "bigint", "index": 3, "name": "count_total_campaigns", "comment": null}, "count_unique_users": {"type": "bigint", "index": 4, "name": "count_unique_users", "comment": null}, "first_event_at": {"type": "timestamp without time zone", "index": 5, "name": "first_event_at", "comment": null}, "last_event_at": {"type": "timestamp without time zone", "index": 6, "name": "last_event_at", "comment": null}, "total_emailclick": {"type": "numeric", "index": 7, "name": "total_emailclick", "comment": null}, "unique_total_emailclick": {"type": "bigint", "index": 8, "name": "unique_total_emailclick", "comment": null}, "total_emailunsubscribe": {"type": "numeric", "index": 9, "name": "total_emailunsubscribe", "comment": null}, "unique_total_emailunsubscribe": {"type": "bigint", "index": 10, "name": "unique_total_emailunsubscribe", "comment": null}, "total_emailcomplaint": {"type": "numeric", "index": 11, "name": "total_emailcomplaint", "comment": null}, "unique_total_emailcomplaint": {"type": "bigint", "index": 12, "name": "unique_total_emailcomplaint", "comment": null}, "total_customevent": {"type": "numeric", "index": 13, "name": "total_customevent", "comment": null}, "unique_total_customevent": {"type": "bigint", "index": 14, "name": "unique_total_customevent", "comment": null}, "total_emailsubscribe": {"type": "numeric", "index": 15, "name": "total_emailsubscribe", "comment": null}, "unique_total_emailsubscribe": {"type": "bigint", "index": 16, "name": "unique_total_emailsubscribe", "comment": null}, "total_emailopen": {"type": "numeric", "index": 17, "name": "total_emailopen", "comment": null}, "unique_total_emailopen": {"type": "bigint", "index": 18, "name": "unique_total_emailopen", "comment": null}, "total_pushsend": {"type": "numeric", "index": 19, "name": "total_pushsend", "comment": null}, "unique_total_pushsend": {"type": "bigint", "index": 20, "name": "unique_total_pushsend", "comment": null}, "total_smsbounce": {"type": "numeric", "index": 21, "name": "total_smsbounce", "comment": null}, "unique_total_smsbounce": {"type": "bigint", "index": 22, "name": "unique_total_smsbounce", "comment": null}, "total_pushbounce": {"type": "numeric", "index": 23, "name": "total_pushbounce", "comment": null}, "unique_total_pushbounce": {"type": "bigint", "index": 24, "name": "unique_total_pushbounce", "comment": null}, "total_inappsendskip": {"type": "numeric", "index": 25, "name": "total_inappsendskip", "comment": null}, "unique_total_inappsendskip": {"type": "bigint", "index": 26, "name": "unique_total_inappsendskip", "comment": null}, "total_smssend": {"type": "numeric", "index": 27, "name": "total_smssend", "comment": null}, "unique_total_smssend": {"type": "bigint", "index": 28, "name": "unique_total_smssend", "comment": null}, "total_inappsend": {"type": "numeric", "index": 29, "name": "total_inappsend", "comment": null}, "unique_total_inappsend": {"type": "bigint", "index": 30, "name": "unique_total_inappsend", "comment": null}, "total_pushopen": {"type": "numeric", "index": 31, "name": "total_pushopen", "comment": null}, "unique_total_pushopen": {"type": "bigint", "index": 32, "name": "unique_total_pushopen", "comment": null}, "total_emailsend": {"type": "numeric", "index": 33, "name": "total_emailsend", "comment": null}, "unique_total_emailsend": {"type": "bigint", "index": 34, "name": "unique_total_emailsend", "comment": null}, "total_pushsendskip": {"type": "numeric", "index": 35, "name": "total_pushsendskip", "comment": null}, "unique_total_pushsendskip": {"type": "bigint", "index": 36, "name": "unique_total_pushsendskip", "comment": null}, "total_inappopen": {"type": "numeric", "index": 37, "name": "total_inappopen", "comment": null}, "unique_total_inappopen": {"type": "bigint", "index": 38, "name": "unique_total_inappopen", "comment": null}, "total_emailsendskip": {"type": "numeric", "index": 39, "name": "total_emailsendskip", "comment": null}, "unique_total_emailsendskip": {"type": "bigint", "index": 40, "name": "unique_total_emailsendskip", "comment": null}, "total_emailbounce": {"type": "numeric", "index": 41, "name": "total_emailbounce", "comment": null}, "unique_total_emailbounce": {"type": "bigint", "index": 42, "name": "unique_total_emailbounce", "comment": null}, "total_inappclick": {"type": "numeric", "index": 43, "name": "total_inappclick", "comment": null}, "unique_total_inappclick": {"type": "bigint", "index": 44, "name": "unique_total_inappclick", "comment": null}, "total_pushuninstall": {"type": "numeric", "index": 45, "name": "total_pushuninstall", "comment": null}, "unique_total_pushuninstall": {"type": "bigint", "index": 46, "name": "unique_total_pushuninstall", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.int_iterable__journey_event_metrics"}, "model.iterable.int_iterable__latest_campaign": {"metadata": {"type": "VIEW", "schema": "public_iterable_dev", "name": "int_iterable__latest_campaign", "database": "postgres", "comment": "Table that filters out historical versions of the campaign, and returns the most recent campaign version.", "owner": "postgres"}, "columns": {"source_relation": {"type": "text", "index": 1, "name": "source_relation", "comment": null}, "campaign_id": {"type": "text", "index": 2, "name": "campaign_id", "comment": null}, "updated_at": {"type": "text", "index": 3, "name": "updated_at", "comment": null}, "campaign_name": {"type": "text", "index": 4, "name": "campaign_name", "comment": null}, "campaign_state": {"type": "text", "index": 5, "name": "campaign_state", "comment": null}, "campaign_type": {"type": "text", "index": 6, "name": "campaign_type", "comment": null}, "send_size": {"type": "integer", "index": 7, "name": "send_size", "comment": null}, "start_at": {"type": "integer", "index": 8, "name": "start_at", "comment": null}, "ended_at": {"type": "integer", "index": 9, "name": "ended_at", "comment": null}, "created_at": {"type": "text", "index": 10, "name": "created_at", "comment": null}, "message_medium": {"type": "text", "index": 11, "name": "message_medium", "comment": null}, "recurring_campaign_id": {"type": "text", "index": 12, "name": "recurring_campaign_id", "comment": null}, "created_by_user_id": {"type": "text", "index": 13, "name": "created_by_user_id", "comment": null}, "updated_by_user_id": {"type": "text", "index": 14, "name": "updated_by_user_id", "comment": null}, "template_id": {"type": "text", "index": 15, "name": "template_id", "comment": null}, "workflow_id": {"type": "integer", "index": 16, "name": "workflow_id", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 17, "name": "_fivetran_synced", "comment": null}, "latest_campaign_index": {"type": "bigint", "index": 18, "name": "latest_campaign_index", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.int_iterable__latest_campaign"}, "model.iterable.int_iterable__latest_template": {"metadata": {"type": "VIEW", "schema": "public_iterable_dev", "name": "int_iterable__latest_template", "database": "postgres", "comment": "Table that provides the most recent version of the template as well as joining relevant message type information.", "owner": "postgres"}, "columns": {"source_relation": {"type": "text", "index": 1, "name": "source_relation", "comment": null}, "template_id": {"type": "text", "index": 2, "name": "template_id", "comment": null}, "template_name": {"type": "text", "index": 3, "name": "template_name", "comment": null}, "template_type": {"type": "text", "index": 4, "name": "template_type", "comment": null}, "created_at": {"type": "text", "index": 5, "name": "created_at", "comment": null}, "client_template_id": {"type": "text", "index": 6, "name": "client_template_id", "comment": null}, "creator_user_id": {"type": "text", "index": 7, "name": "creator_user_id", "comment": null}, "message_type_id": {"type": "text", "index": 8, "name": "message_type_id", "comment": null}, "updated_at": {"type": "text", "index": 9, "name": "updated_at", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 10, "name": "_fivetran_synced", "comment": null}, "latest_template_index": {"type": "bigint", "index": 11, "name": "latest_template_index", "comment": null}, "message_type_name": {"type": "text", "index": 12, "name": "message_type_name", "comment": null}, "channel_id": {"type": "text", "index": 13, "name": "channel_id", "comment": null}, "channel_name": {"type": "text", "index": 14, "name": "channel_name", "comment": null}, "channel_type": {"type": "text", "index": 15, "name": "channel_type", "comment": null}, "message_medium": {"type": "text", "index": 16, "name": "message_medium", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.int_iterable__latest_template"}, "model.iterable.int_iterable__latest_user": {"metadata": {"type": "VIEW", "schema": "public_iterable_dev", "name": "int_iterable__latest_user", "database": "postgres", "comment": "Table that filters out historical versions of the user, and returns only the most recent version.", "owner": "postgres"}, "columns": {"source_relation": {"type": "text", "index": 1, "name": "source_relation", "comment": null}, "_fivetran_user_id": {"type": "text", "index": 2, "name": "_fivetran_user_id", "comment": null}, "email": {"type": "text", "index": 3, "name": "email", "comment": null}, "updated_at": {"type": "timestamp without time zone", "index": 4, "name": "updated_at", "comment": null}, "user_id": {"type": "text", "index": 5, "name": "user_id", "comment": null}, "first_name": {"type": "integer", "index": 6, "name": "first_name", "comment": null}, "last_name": {"type": "integer", "index": 7, "name": "last_name", "comment": null}, "email_list_ids": {"type": "text", "index": 8, "name": "email_list_ids", "comment": null}, "phone_number": {"type": "integer", "index": 9, "name": "phone_number", "comment": null}, "signup_date": {"type": "text", "index": 10, "name": "signup_date", "comment": null}, "signup_source": {"type": "text", "index": 11, "name": "signup_source", "comment": null}, "iterable_user_id": {"type": "text", "index": 12, "name": "iterable_user_id", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 13, "name": "_fivetran_synced", "comment": null}, "unique_user_key": {"type": "text", "index": 14, "name": "unique_user_key", "comment": null}, "latest_user_index": {"type": "bigint", "index": 15, "name": "latest_user_index", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.int_iterable__latest_user"}, "model.iterable.int_iterable__list_user_history": {"metadata": {"type": "BASE TABLE", "schema": "public_iterable_dev", "name": "int_iterable__list_user_history", "database": "postgres", "comment": "Table that provides a history of all lists the user has been associated with.", "owner": "postgres"}, "columns": {"source_relation": {"type": "text", "index": 1, "name": "source_relation", "comment": null}, "_fivetran_user_id": {"type": "text", "index": 2, "name": "_fivetran_user_id", "comment": null}, "unique_user_key": {"type": "text", "index": 3, "name": "unique_user_key", "comment": null}, "email": {"type": "text", "index": 4, "name": "email", "comment": null}, "user_id": {"type": "text", "index": 5, "name": "user_id", "comment": null}, "first_name": {"type": "integer", "index": 6, "name": "first_name", "comment": null}, "last_name": {"type": "integer", "index": 7, "name": "last_name", "comment": null}, "email_list_ids": {"type": "text", "index": 8, "name": "email_list_ids", "comment": null}, "phone_number": {"type": "integer", "index": 9, "name": "phone_number", "comment": null}, "signup_date": {"type": "text", "index": 10, "name": "signup_date", "comment": null}, "signup_source": {"type": "text", "index": 11, "name": "signup_source", "comment": null}, "updated_at": {"type": "timestamp without time zone", "index": 12, "name": "updated_at", "comment": null}, "is_current": {"type": "boolean", "index": 13, "name": "is_current", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.int_iterable__list_user_history"}, "model.iterable.int_iterable__list_user_unnest": {"metadata": {"type": "BASE TABLE", "schema": "public_iterable_dev", "name": "int_iterable__list_user_unnest", "database": "postgres", "comment": "Table that unnests the `email_list_id` field for each user to create a new record for each user and the unique list it was associated with at a unique update. Due to the unnesting functions varying greatly between warehouses, conditional logic is applied throughout the model to appropriately accommodate the model being ran within Redshift, Snowflake, BigQuery, and Postgres.\n", "owner": "postgres"}, "columns": {"source_relation": {"type": "text", "index": 1, "name": "source_relation", "comment": null}, "_fivetran_user_id": {"type": "text", "index": 2, "name": "_fivetran_user_id", "comment": null}, "unique_user_key": {"type": "text", "index": 3, "name": "unique_user_key", "comment": null}, "user_id": {"type": "text", "index": 4, "name": "user_id", "comment": null}, "email": {"type": "text", "index": 5, "name": "email", "comment": null}, "first_name": {"type": "integer", "index": 6, "name": "first_name", "comment": null}, "last_name": {"type": "integer", "index": 7, "name": "last_name", "comment": null}, "signup_date": {"type": "text", "index": 8, "name": "signup_date", "comment": null}, "signup_source": {"type": "text", "index": 9, "name": "signup_source", "comment": null}, "updated_at": {"type": "timestamp without time zone", "index": 10, "name": "updated_at", "comment": null}, "phone_number": {"type": "integer", "index": 11, "name": "phone_number", "comment": null}, "is_current": {"type": "boolean", "index": 12, "name": "is_current", "comment": null}, "email_list_ids": {"type": "text", "index": 13, "name": "email_list_ids", "comment": null}, "list_id": {"type": "integer", "index": 14, "name": "list_id", "comment": null}, "unique_key": {"type": "text", "index": 15, "name": "unique_key", "comment": null}, "date_day": {"type": "date", "index": 16, "name": "date_day", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.int_iterable__list_user_unnest"}, "model.iterable.int_iterable__message_type_channel": {"metadata": {"type": "VIEW", "schema": "public_iterable_dev", "name": "int_iterable__message_type_channel", "database": "postgres", "comment": "Table that joins the message type and channel records together into one comprehensive model to be referenced downstream.", "owner": "postgres"}, "columns": {"source_relation": {"type": "text", "index": 1, "name": "source_relation", "comment": null}, "channel_id": {"type": "text", "index": 2, "name": "channel_id", "comment": null}, "channel_name": {"type": "text", "index": 3, "name": "channel_name", "comment": null}, "channel_type": {"type": "text", "index": 4, "name": "channel_type", "comment": null}, "message_medium": {"type": "text", "index": 5, "name": "message_medium", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 6, "name": "_fivetran_synced", "comment": null}, "message_type_name": {"type": "text", "index": 7, "name": "message_type_name", "comment": null}, "message_type_id": {"type": "text", "index": 8, "name": "message_type_id", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.int_iterable__message_type_channel"}, "model.iterable.int_iterable__recurring_campaigns": {"metadata": {"type": "VIEW", "schema": "public_iterable_dev", "name": "int_iterable__recurring_campaigns", "database": "postgres", "comment": "Table that identifies when a campaign is associated with a recurring campaign and provides additional enriched recurring campaign information.", "owner": "postgres"}, "columns": {"source_relation": {"type": "text", "index": 1, "name": "source_relation", "comment": null}, "campaign_id": {"type": "text", "index": 2, "name": "campaign_id", "comment": null}, "campaign_name": {"type": "text", "index": 3, "name": "campaign_name", "comment": null}, "updated_at": {"type": "text", "index": 4, "name": "updated_at", "comment": null}, "campaign_state": {"type": "text", "index": 5, "name": "campaign_state", "comment": null}, "campaign_type": {"type": "text", "index": 6, "name": "campaign_type", "comment": null}, "send_size": {"type": "integer", "index": 7, "name": "send_size", "comment": null}, "start_at": {"type": "integer", "index": 8, "name": "start_at", "comment": null}, "ended_at": {"type": "integer", "index": 9, "name": "ended_at", "comment": null}, "created_at": {"type": "text", "index": 10, "name": "created_at", "comment": null}, "created_by_user_id": {"type": "text", "index": 11, "name": "created_by_user_id", "comment": null}, "template_id": {"type": "text", "index": 12, "name": "template_id", "comment": null}, "recurring_campaign_id": {"type": "text", "index": 13, "name": "recurring_campaign_id", "comment": null}, "journey_id": {"type": "text", "index": 14, "name": "journey_id", "comment": null}, "recurring_campaign_name": {"type": "text", "index": 15, "name": "recurring_campaign_name", "comment": null}, "recurring_campaign_state": {"type": "text", "index": 16, "name": "recurring_campaign_state", "comment": null}, "recurring_campaign_send_size": {"type": "integer", "index": 17, "name": "recurring_campaign_send_size", "comment": null}, "recurring_campaign_start_at": {"type": "integer", "index": 18, "name": "recurring_campaign_start_at", "comment": null}, "is_campaign_recurring": {"type": "boolean", "index": 19, "name": "is_campaign_recurring", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.int_iterable__recurring_campaigns"}, "model.iterable.int_iterable__user_event_metrics": {"metadata": {"type": "VIEW", "schema": "public_iterable_dev", "name": "int_iterable__user_event_metrics", "database": "postgres", "comment": "Table that generates user aggregations at the campaign level.", "owner": "postgres"}, "columns": {"source_relation": {"type": "text", "index": 1, "name": "source_relation", "comment": null}, "_fivetran_user_id": {"type": "text", "index": 2, "name": "_fivetran_user_id", "comment": null}, "unique_user_key": {"type": "text", "index": 3, "name": "unique_user_key", "comment": null}, "user_id": {"type": "text", "index": 4, "name": "user_id", "comment": null}, "user_email": {"type": "text", "index": 5, "name": "user_email", "comment": null}, "count_total_campaigns": {"type": "bigint", "index": 6, "name": "count_total_campaigns", "comment": null}, "first_event_at": {"type": "timestamp without time zone", "index": 7, "name": "first_event_at", "comment": null}, "last_event_at": {"type": "timestamp without time zone", "index": 8, "name": "last_event_at", "comment": null}, "total_emailclick": {"type": "numeric", "index": 9, "name": "total_emailclick", "comment": null}, "total_emailunsubscribe": {"type": "numeric", "index": 10, "name": "total_emailunsubscribe", "comment": null}, "total_emailcomplaint": {"type": "numeric", "index": 11, "name": "total_emailcomplaint", "comment": null}, "total_customevent": {"type": "numeric", "index": 12, "name": "total_customevent", "comment": null}, "total_emailsubscribe": {"type": "numeric", "index": 13, "name": "total_emailsubscribe", "comment": null}, "total_emailopen": {"type": "numeric", "index": 14, "name": "total_emailopen", "comment": null}, "total_pushsend": {"type": "numeric", "index": 15, "name": "total_pushsend", "comment": null}, "total_smsbounce": {"type": "numeric", "index": 16, "name": "total_smsbounce", "comment": null}, "total_pushbounce": {"type": "numeric", "index": 17, "name": "total_pushbounce", "comment": null}, "total_inappsendskip": {"type": "numeric", "index": 18, "name": "total_inappsendskip", "comment": null}, "total_smssend": {"type": "numeric", "index": 19, "name": "total_smssend", "comment": null}, "total_inappsend": {"type": "numeric", "index": 20, "name": "total_inappsend", "comment": null}, "total_pushopen": {"type": "numeric", "index": 21, "name": "total_pushopen", "comment": null}, "total_emailsend": {"type": "numeric", "index": 22, "name": "total_emailsend", "comment": null}, "total_pushsendskip": {"type": "numeric", "index": 23, "name": "total_pushsendskip", "comment": null}, "total_inappopen": {"type": "numeric", "index": 24, "name": "total_inappopen", "comment": null}, "total_emailsendskip": {"type": "numeric", "index": 25, "name": "total_emailsendskip", "comment": null}, "total_emailbounce": {"type": "numeric", "index": 26, "name": "total_emailbounce", "comment": null}, "total_inappclick": {"type": "numeric", "index": 27, "name": "total_inappclick", "comment": null}, "total_pushuninstall": {"type": "numeric", "index": 28, "name": "total_pushuninstall", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.int_iterable__user_event_metrics"}, "model.iterable.iterable__campaigns": {"metadata": {"type": "BASE TABLE", "schema": "public_iterable_dev", "name": "iterable__campaigns", "database": "postgres", "comment": "Table that provides aggregations for campaigns at the template and if available, the experiment grain.", "owner": "postgres"}, "columns": {"source_relation": {"type": "text", "index": 1, "name": "source_relation", "comment": "Identifies the record's source."}, "campaign_id": {"type": "text", "index": 2, "name": "campaign_id", "comment": "Unique identifier of the campaign record"}, "campaign_name": {"type": "text", "index": 3, "name": "campaign_name", "comment": "User defined name of the campaign."}, "updated_at": {"type": "text", "index": 4, "name": "updated_at", "comment": "Last update timestamp"}, "campaign_state": {"type": "text", "index": 5, "name": "campaign_state", "comment": "State of the campaign. Can be Draft, Ready, Scheduled, Running, Finished, Starting, Aborted or Recurring"}, "campaign_type": {"type": "text", "index": 6, "name": "campaign_type", "comment": "The campaign type. Can be Blast or Triggered"}, "send_size": {"type": "integer", "index": 7, "name": "send_size", "comment": "Size of the campaign. Number of individuals included in the campaign"}, "start_at": {"type": "integer", "index": 8, "name": "start_at", "comment": "Start timestamp"}, "ended_at": {"type": "integer", "index": 9, "name": "ended_at", "comment": "Ended timestamp"}, "created_at": {"type": "text", "index": 10, "name": "created_at", "comment": "Creation timestamp"}, "created_by_user_id": {"type": "text", "index": 11, "name": "created_by_user_id", "comment": "Reference to the user who created the campaign"}, "template_id": {"type": "text", "index": 12, "name": "template_id", "comment": "Reference to the campaign template"}, "recurring_campaign_id": {"type": "text", "index": 13, "name": "recurring_campaign_id", "comment": "Unique identifier of the recurring campaign (if applicable)"}, "journey_id": {"type": "text", "index": 14, "name": "journey_id", "comment": "Reference to the journey the campaign belongs to, if applicable"}, "recurring_campaign_name": {"type": "text", "index": 15, "name": "recurring_campaign_name", "comment": "Name of the recurring campaign (if applicable)"}, "recurring_campaign_state": {"type": "text", "index": 16, "name": "recurring_campaign_state", "comment": "State of the recurring campaign (if applicable)"}, "recurring_campaign_send_size": {"type": "integer", "index": 17, "name": "recurring_campaign_send_size", "comment": "Size of the recurring campaign. Number of individuals included in the recurring campaign (if applicable)"}, "recurring_campaign_start_at": {"type": "integer", "index": 18, "name": "recurring_campaign_start_at", "comment": "Timestamp of when the recurring campaign started (if applicable)"}, "is_campaign_recurring": {"type": "boolean", "index": 19, "name": "is_campaign_recurring", "comment": "Boolean indicating if the campaign is a recurring campaign"}, "experiment_id": {"type": "integer", "index": 20, "name": "experiment_id", "comment": "Reference to the experiment used if the event is an experiment"}, "count_unique_users": {"type": "bigint", "index": 21, "name": "count_unique_users", "comment": "Count of total unique users within the campaign/experiment"}, "total_emailclick": {"type": "numeric", "index": 22, "name": "total_emailclick", "comment": "Total email clicks within the campaign/experiment"}, "unique_total_emailclick": {"type": "bigint", "index": 23, "name": "unique_total_emailclick", "comment": "Unique email clicks within the campaign/experiment"}, "total_emailunsubscribe": {"type": "numeric", "index": 24, "name": "total_emailunsubscribe", "comment": "Total email unsubscribe events within the campaign/experiment"}, "unique_total_emailunsubscribe": {"type": "bigint", "index": 25, "name": "unique_total_emailunsubscribe", "comment": "Unique total email unsubscribe events within the campaign/experiment"}, "total_emailcomplaint": {"type": "numeric", "index": 26, "name": "total_emailcomplaint", "comment": "Total email complaints within the campaign/experiment"}, "unique_total_emailcomplaint": {"type": "bigint", "index": 27, "name": "unique_total_emailcomplaint", "comment": "Unique total email complaints within the campaign/experiment"}, "total_customevent": {"type": "numeric", "index": 28, "name": "total_customevent", "comment": "Total custom events within the campaign/experiment"}, "unique_total_customevent": {"type": "bigint", "index": 29, "name": "unique_total_customevent", "comment": "Unique total custom events within the campaign/experiment"}, "total_emailsubscribe": {"type": "numeric", "index": 30, "name": "total_emailsubscribe", "comment": "Total email subscribe events within the campaign/experiment"}, "unique_total_emailsubscribe": {"type": "bigint", "index": 31, "name": "unique_total_emailsubscribe", "comment": "Unique total email subscribe events within the campaign/experiment"}, "total_emailopen": {"type": "numeric", "index": 32, "name": "total_emailopen", "comment": "Total email open events within the campaign/experiment"}, "unique_total_emailopen": {"type": "bigint", "index": 33, "name": "unique_total_emailopen", "comment": "Unique total email open events within the campaign/experiment"}, "total_pushsend": {"type": "numeric", "index": 34, "name": "total_pushsend", "comment": "Total push send event within the campaign/experiment"}, "unique_total_pushsend": {"type": "bigint", "index": 35, "name": "unique_total_pushsend", "comment": "Unique total push send events within the campaign/experiment"}, "total_smsbounce": {"type": "numeric", "index": 36, "name": "total_smsbounce", "comment": "Total sms bounce events within the campaign/experiment"}, "unique_total_smsbounce": {"type": "bigint", "index": 37, "name": "unique_total_smsbounce", "comment": "Unique total sms bounce events within the campaign/experiment"}, "total_pushbounce": {"type": "numeric", "index": 38, "name": "total_pushbounce", "comment": "Total push bounce events within the campaign/experiment"}, "unique_total_pushbounce": {"type": "bigint", "index": 39, "name": "unique_total_pushbounce", "comment": "Unique total push bounce events within the campaign/experiment"}, "total_inappsendskip": {"type": "numeric", "index": 40, "name": "total_inappsendskip", "comment": "Total in app send skip events within the campaign/experiment"}, "unique_total_inappsendskip": {"type": "bigint", "index": 41, "name": "unique_total_inappsendskip", "comment": "Unique total in app send skip events within the campaign/experiment"}, "total_smssend": {"type": "numeric", "index": 42, "name": "total_smssend", "comment": "Total sms send events within the campaign/experiment"}, "unique_total_smssend": {"type": "bigint", "index": 43, "name": "unique_total_smssend", "comment": "Unique total sms send events within the campaign/experiment"}, "total_inappsend": {"type": "numeric", "index": 44, "name": "total_inappsend", "comment": "Total in app send events within the campaign/experiment"}, "unique_total_inappsend": {"type": "bigint", "index": 45, "name": "unique_total_inappsend", "comment": "Unique total in app send events within the campaign/experiment"}, "total_pushopen": {"type": "numeric", "index": 46, "name": "total_pushopen", "comment": "Total push open events within the campaign/experiment"}, "unique_total_pushopen": {"type": "bigint", "index": 47, "name": "unique_total_pushopen", "comment": "Unique total push open events within the campaign/experiment"}, "total_emailsend": {"type": "numeric", "index": 48, "name": "total_emailsend", "comment": "Total email send events within the campaign/experiment"}, "unique_total_emailsend": {"type": "bigint", "index": 49, "name": "unique_total_emailsend", "comment": "Unique total email send events within the campaign/experiment"}, "total_pushsendskip": {"type": "numeric", "index": 50, "name": "total_pushsendskip", "comment": "Total push send skip events within the campaign/experiment"}, "unique_total_pushsendskip": {"type": "bigint", "index": 51, "name": "unique_total_pushsendskip", "comment": "Unique total push send skip events within the campaign/experiment"}, "total_inappopen": {"type": "numeric", "index": 52, "name": "total_inappopen", "comment": "Total in app open events within the campaign/experiment"}, "unique_total_inappopen": {"type": "bigint", "index": 53, "name": "unique_total_inappopen", "comment": "Unique total in app open events within the campaign/experiment"}, "total_emailsendskip": {"type": "numeric", "index": 54, "name": "total_emailsendskip", "comment": "Total email send skip events within the campaign/experiment"}, "unique_total_emailsendskip": {"type": "bigint", "index": 55, "name": "unique_total_emailsendskip", "comment": "Unique total email send skip events within the campaign/experiment"}, "total_emailbounce": {"type": "numeric", "index": 56, "name": "total_emailbounce", "comment": "Total email bounce events within the campaign/experiment"}, "unique_total_emailbounce": {"type": "bigint", "index": 57, "name": "unique_total_emailbounce", "comment": "Unique total email bounce events within the campaign/experiment"}, "total_inappclick": {"type": "numeric", "index": 58, "name": "total_inappclick", "comment": "Total in app click events within the campaign/experiment"}, "unique_total_inappclick": {"type": "bigint", "index": 59, "name": "unique_total_inappclick", "comment": "Unique total in app click events within the campaign/experiment"}, "total_pushuninstall": {"type": "numeric", "index": 60, "name": "total_pushuninstall", "comment": "Total push uninstall events within the campaign/experiment"}, "unique_total_pushuninstall": {"type": "bigint", "index": 61, "name": "unique_total_pushuninstall", "comment": "Unique total push uninstall events within the campaign/experiment"}, "count_send_lists": {"type": "bigint", "index": 62, "name": "count_send_lists", "comment": "Count of send lists within the campaign/experiment"}, "count_suppress_lists": {"type": "bigint", "index": 63, "name": "count_suppress_lists", "comment": "Count of suppress lists within the campaign/experiment"}, "labels": {"type": "text", "index": 64, "name": "labels", "comment": "List of labels associated with the campaign/experiment"}, "journey_name": {"type": "text", "index": 65, "name": "journey_name", "comment": "User defined name of the journey the campaign belongs to, if applicable"}, "journey_type": {"type": "text", "index": 66, "name": "journey_type", "comment": "The type of the journey the campaign belongs to, if applicable"}, "template_name": {"type": "text", "index": 67, "name": "template_name", "comment": "Name of the template associated with the campaign/experiment"}, "template_creator_user_id": {"type": "text", "index": 68, "name": "template_creator_user_id", "comment": "The creator user id of the template associated with the campaign/experiment"}, "message_medium": {"type": "text", "index": 69, "name": "message_medium", "comment": "The medium which the message was provided"}, "message_type_name": {"type": "text", "index": 70, "name": "message_type_name", "comment": "The message type name associated with the campaign/experiment"}, "channel_name": {"type": "text", "index": 71, "name": "channel_name", "comment": "The channel name associated with the campaign/experiment"}, "channel_id": {"type": "text", "index": 72, "name": "channel_id", "comment": "The channel identifier associated with the campaign/experiment"}, "channel_type": {"type": "text", "index": 73, "name": "channel_type", "comment": "The channel type associated with the campaign/experiment"}, "unique_campaign_version_id": {"type": "text", "index": 74, "name": "unique_campaign_version_id", "comment": "Unique identifier combining campaign_id, template_id, source_relation, and if available, experiment_id."}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.iterable__campaigns"}, "model.iterable.iterable__events": {"metadata": {"type": "BASE TABLE", "schema": "public_iterable_dev", "name": "iterable__events", "database": "postgres", "comment": "Table that provides a comprehensive view of all events with enriched information such as the campaign, user effected, and template used.", "owner": "postgres"}, "columns": {"source_relation": {"type": "text", "index": 1, "name": "source_relation", "comment": "Identifies the record's source."}, "event_id": {"type": "text", "index": 2, "name": "event_id", "comment": "Unique id of the event generated by Fivetran"}, "unique_event_id": {"type": "text", "index": 3, "name": "unique_event_id", "comment": "A unique surrogate key of event_id, _fivetran_user_id, and source_relation."}, "_fivetran_user_id": {"type": "text", "index": 4, "name": "_fivetran_user_id", "comment": "A Fivetran-created unique identifier for the new Iterable schema in Aug 2023, for users, derived from hashing user_id and/or email, depending on project type."}, "unique_user_key": {"type": "text", "index": 5, "name": "unique_user_key", "comment": "The unique identifier of the user. With the new schema (Aug 2023), it is the _fivetran_user_id. This is a hash of user_id and/or email, depending on project type. If using the old schema, it is email."}, "campaign_id": {"type": "text", "index": 6, "name": "campaign_id", "comment": "Reference to the campaign from which the event originated"}, "content_id": {"type": "text", "index": 7, "name": "content_id", "comment": "Reference to the content the event is associated with"}, "created_at": {"type": "timestamp without time zone", "index": 8, "name": "created_at", "comment": "Creation timestamp"}, "created_on": {"type": "date", "index": 9, "name": "created_on", "comment": "Day when the event was created"}, "email": {"type": "text", "index": 10, "name": "email", "comment": "The user's email. User identifier, for email-based projects. Previously was the unique identifier for user records, for the old Iterable schema before the August 2023 updates."}, "additional_properties": {"type": "text", "index": 11, "name": "additional_properties", "comment": "json object containing addition event properties"}, "event_name": {"type": "text", "index": 12, "name": "event_name", "comment": "Name provided to the individual event"}, "message_bus_id": {"type": "text", "index": 13, "name": "message_bus_id", "comment": "Reference to the message bus associated with the event"}, "message_id": {"type": "text", "index": 14, "name": "message_id", "comment": "Reference to the message the event is associated with"}, "message_type_id": {"type": "text", "index": 15, "name": "message_type_id", "comment": "Reference to the type of message the event is associated with"}, "recipient_state": {"type": "integer", "index": 16, "name": "recipient_state", "comment": "The state of the recipient upon receiving the event"}, "status": {"type": "integer", "index": 17, "name": "status", "comment": "Status of the event"}, "transactional_data": {"type": "character varying(100)", "index": 18, "name": "transactional_data", "comment": "Transactional data associated with the event"}, "unsub_source": {"type": "integer", "index": 19, "name": "unsub_source", "comment": "Source of the unsubscribe event"}, "user_agent": {"type": "integer", "index": 20, "name": "user_agent", "comment": "User agent associated with the event"}, "user_agent_device": {"type": "integer", "index": 21, "name": "user_agent_device", "comment": "The device of the user agent"}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 22, "name": "_fivetran_synced", "comment": "Timestamp of when the event record was synced by Fivetran"}, "campaign_name": {"type": "text", "index": 23, "name": "campaign_name", "comment": "The name of the campaign"}, "campaign_type": {"type": "text", "index": 24, "name": "campaign_type", "comment": "The type of campaign"}, "is_campaign_recurring": {"type": "boolean", "index": 25, "name": "is_campaign_recurring", "comment": "Boolean indicating if the campaign is recurrent"}, "recurring_campaign_name": {"type": "text", "index": 26, "name": "recurring_campaign_name", "comment": "The name of the recurring campaign (if applicable)"}, "recurring_campaign_id": {"type": "text", "index": 27, "name": "recurring_campaign_id", "comment": "The campaign if of the recurring campaign (if applicable)"}, "user_id": {"type": "text", "index": 28, "name": "user_id", "comment": "User identifier, for userID-based projects."}, "user_full_name": {"type": "text", "index": 29, "name": "user_full_name", "comment": "Full name of the user"}, "message_type_name": {"type": "text", "index": 30, "name": "message_type_name", "comment": "Name of the message type"}, "message_medium": {"type": "text", "index": 31, "name": "message_medium", "comment": "Medium of the message"}, "channel_id": {"type": "text", "index": 32, "name": "channel_id", "comment": "Unique identifier of the channel"}, "channel_name": {"type": "text", "index": 33, "name": "channel_name", "comment": "The channel name"}, "channel_type": {"type": "text", "index": 34, "name": "channel_type", "comment": "The type of channel"}, "is_app_already_running": {"type": "integer", "index": 35, "name": "is_app_already_running", "comment": "Boolean indicating if the app is already running"}, "badge": {"type": "integer", "index": 36, "name": "badge", "comment": "Badge associated with the event"}, "catalog_collection_count": {"type": "integer", "index": 37, "name": "catalog_collection_count", "comment": "The count of products or items collected in a catalog associated with the event."}, "catalog_lookup_count": {"type": "integer", "index": 38, "name": "catalog_lookup_count", "comment": "The count of times a catalog was looked up or queried during the event."}, "canonical_url_id": {"type": "text", "index": 39, "name": "canonical_url_id", "comment": "Reference to the url associated with the event"}, "is_content_available": {"type": "integer", "index": 40, "name": "is_content_available", "comment": "Content available from the event"}, "device": {"type": "integer", "index": 41, "name": "device", "comment": "The device associated with the event"}, "email_id": {"type": "text", "index": 42, "name": "email_id", "comment": "Reference to the email associated with the event"}, "email_subject": {"type": "text", "index": 43, "name": "email_subject", "comment": "Subject of the email associated with the event"}, "experiment_id": {"type": "integer", "index": 44, "name": "experiment_id", "comment": "Reference to the experiment used if the event is an experiment"}, "from_phone_number_id": {"type": "integer", "index": 45, "name": "from_phone_number_id", "comment": "Reference to the phone number which the event is from"}, "from_smssender_id": {"type": "integer", "index": 46, "name": "from_smssender_id", "comment": "Reference to the sms sender which the event is from"}, "link_id": {"type": "text", "index": 47, "name": "link_id", "comment": "Reference to the link associated with the event"}, "link_url": {"type": "integer", "index": 48, "name": "link_url", "comment": "Url of the link associated with the event"}, "locale": {"type": "integer", "index": 49, "name": "locale", "comment": "Locale associated with the event"}, "payload": {"type": "character varying(100)", "index": 50, "name": "payload", "comment": "Payload resulted from the event"}, "platform_endpoint": {"type": "integer", "index": 51, "name": "platform_endpoint", "comment": "The specific platform endpoint of the event"}, "push_message": {"type": "integer", "index": 52, "name": "push_message", "comment": "Boolean indicating if the event is a push message"}, "region": {"type": "text", "index": 53, "name": "region", "comment": "Region of the event"}, "sms_message": {"type": "integer", "index": 54, "name": "sms_message", "comment": "Boolean indicating if the event is an sms message"}, "to_phone_number": {"type": "integer", "index": 55, "name": "to_phone_number", "comment": "To phone number associated with the event"}, "url": {"type": "integer", "index": 56, "name": "url", "comment": "Url associated with the event"}, "workflow_id": {"type": "text", "index": 57, "name": "workflow_id", "comment": "Reference to the workflow which the event originated"}, "workflow_name": {"type": "text", "index": 58, "name": "workflow_name", "comment": "Name of the workflow which the event originated"}, "city": {"type": "text", "index": 59, "name": "city", "comment": "The city associated with the event, which could be the location of the recipient."}, "clicked_url": {"type": "text", "index": 60, "name": "clicked_url", "comment": "The URL that was clicked by the recipient in response to the marketing message."}, "country": {"type": "text", "index": 61, "name": "country", "comment": "The country associated with the event, which could be the location of the recipient."}, "error_code": {"type": "integer", "index": 62, "name": "error_code", "comment": "The error code or message indicating any issues or errors encountered during the event."}, "expires_at": {"type": "text", "index": 63, "name": "expires_at", "comment": "The date and time when the event or message is set to expire or become invalid."}, "from_phone_number": {"type": "integer", "index": 64, "name": "from_phone_number", "comment": "The phone number from which the SMS message was sent."}, "in_app_body": {"type": "text", "index": 65, "name": "in_app_body", "comment": "The content or body of an in-app message that was sent as part of the event."}, "is_sms_estimation": {"type": "boolean", "index": 66, "name": "is_sms_estimation", "comment": "A boolean indicating whether the SMS message is an estimation or not."}, "labels": {"type": "text", "index": 67, "name": "labels", "comment": "Any labels or tags associated with the event, which can be used for categorization or organization."}, "message_status": {"type": "text", "index": 68, "name": "message_status", "comment": "The status of the marketing message, such as sent, delivered, opened, etc."}, "mms_send_count": {"type": "integer", "index": 69, "name": "mms_send_count", "comment": "The count of multimedia messages (MMS) sent as part of the event."}, "reason": {"type": "text", "index": 70, "name": "reason", "comment": "The reason or cause associated with a specific event or action."}, "sms_send_count": {"type": "integer", "index": 71, "name": "sms_send_count", "comment": "The count of SMS messages sent as part of the event."}, "template_id": {"type": "text", "index": 72, "name": "template_id", "comment": "Unique identifier of the template"}, "template_name": {"type": "text", "index": 73, "name": "template_name", "comment": "User defined name of the template"}, "template_creator_user_id": {"type": "text", "index": 74, "name": "template_creator_user_id", "comment": "Reference to the user who created the template"}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.iterable__events"}, "model.iterable.iterable__journeys": {"metadata": {"type": "BASE TABLE", "schema": "public_iterable_dev", "name": "iterable__journeys", "database": "postgres", "comment": "Table that provides aggregations for journeys, formerly known as workflows. Metrics are rolled up from the user/campaign grain via each campaign's journey reference. Journeys which generate no events, such as those that only split audiences or update user fields, are still included with null metrics. The grain of this table is one record per journey.\n", "owner": "postgres"}, "columns": {"source_relation": {"type": "text", "index": 1, "name": "source_relation", "comment": "Identifies the record's source."}, "journey_id": {"type": "text", "index": 2, "name": "journey_id", "comment": "Unique identifier of the journey"}, "journey_name": {"type": "text", "index": 3, "name": "journey_name", "comment": "User defined name of the journey"}, "journey_type": {"type": "text", "index": 4, "name": "journey_type", "comment": "The journey type"}, "journey_description": {"type": "text", "index": 5, "name": "journey_description", "comment": "Information about the journey"}, "creator_user_id": {"type": "text", "index": 6, "name": "creator_user_id", "comment": "Reference to the user who created the journey"}, "is_enabled": {"type": "boolean", "index": 7, "name": "is_enabled", "comment": "Boolean indicating if the journey is currently enabled"}, "is_archived": {"type": "boolean", "index": 8, "name": "is_archived", "comment": "Boolean indicating if the journey has been archived"}, "lifetime_limit": {"type": "bigint", "index": 9, "name": "lifetime_limit", "comment": "Maximum number of times a user may enter the journey over their lifetime"}, "simultaneous_limit": {"type": "bigint", "index": 10, "name": "simultaneous_limit", "comment": "Maximum number of times a user may be in the journey at the same time"}, "start_tile_id": {"type": "text", "index": 11, "name": "start_tile_id", "comment": "Reference to the tile which begins the journey"}, "trigger_event_names": {"type": "text", "index": 12, "name": "trigger_event_names", "comment": "The event names which trigger a user's entry into the journey"}, "created_at": {"type": "timestamp without time zone", "index": 13, "name": "created_at", "comment": "Creation timestamp"}, "updated_at": {"type": "timestamp without time zone", "index": 14, "name": "updated_at", "comment": "Last update timestamp"}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 15, "name": "_fivetran_synced", "comment": "The time when a record was last updated by Fivetran."}, "count_total_campaigns": {"type": "bigint", "index": 16, "name": "count_total_campaigns", "comment": "Count of distinct campaigns within the journey that generated events"}, "count_unique_users": {"type": "bigint", "index": 17, "name": "count_unique_users", "comment": "Count of total unique users within the journey"}, "first_event_at": {"type": "timestamp without time zone", "index": 18, "name": "first_event_at", "comment": "Timestamp of the first event generated by any campaign in the journey"}, "last_event_at": {"type": "timestamp without time zone", "index": 19, "name": "last_event_at", "comment": "Timestamp of the most recent event generated by any campaign in the journey"}, "total_emailclick": {"type": "numeric", "index": 20, "name": "total_emailclick", "comment": "Total email clicks within the journey"}, "unique_total_emailclick": {"type": "bigint", "index": 21, "name": "unique_total_emailclick", "comment": "Count of distinct users with email clicks within the journey"}, "total_emailunsubscribe": {"type": "numeric", "index": 22, "name": "total_emailunsubscribe", "comment": "Total email unsubscribe events within the journey"}, "unique_total_emailunsubscribe": {"type": "bigint", "index": 23, "name": "unique_total_emailunsubscribe", "comment": "Count of distinct users with email unsubscribe events within the journey"}, "total_emailcomplaint": {"type": "numeric", "index": 24, "name": "total_emailcomplaint", "comment": "Total email complaints within the journey"}, "unique_total_emailcomplaint": {"type": "bigint", "index": 25, "name": "unique_total_emailcomplaint", "comment": "Count of distinct users with email complaints within the journey"}, "total_customevent": {"type": "numeric", "index": 26, "name": "total_customevent", "comment": "Total custom events within the journey"}, "unique_total_customevent": {"type": "bigint", "index": 27, "name": "unique_total_customevent", "comment": "Count of distinct users with custom events within the journey"}, "total_emailsubscribe": {"type": "numeric", "index": 28, "name": "total_emailsubscribe", "comment": "Total email subscribe events within the journey"}, "unique_total_emailsubscribe": {"type": "bigint", "index": 29, "name": "unique_total_emailsubscribe", "comment": "Count of distinct users with email subscribe events within the journey"}, "total_emailopen": {"type": "numeric", "index": 30, "name": "total_emailopen", "comment": "Total email open events within the journey"}, "unique_total_emailopen": {"type": "bigint", "index": 31, "name": "unique_total_emailopen", "comment": "Count of distinct users with email open events within the journey"}, "total_pushsend": {"type": "numeric", "index": 32, "name": "total_pushsend", "comment": "Total push send events within the journey"}, "unique_total_pushsend": {"type": "bigint", "index": 33, "name": "unique_total_pushsend", "comment": "Count of distinct users with push send events within the journey"}, "total_smsbounce": {"type": "numeric", "index": 34, "name": "total_smsbounce", "comment": "Total sms bounce events within the journey"}, "unique_total_smsbounce": {"type": "bigint", "index": 35, "name": "unique_total_smsbounce", "comment": "Count of distinct users with sms bounce events within the journey"}, "total_pushbounce": {"type": "numeric", "index": 36, "name": "total_pushbounce", "comment": "Total push bounce events within the journey"}, "unique_total_pushbounce": {"type": "bigint", "index": 37, "name": "unique_total_pushbounce", "comment": "Count of distinct users with push bounce events within the journey"}, "total_inappsendskip": {"type": "numeric", "index": 38, "name": "total_inappsendskip", "comment": "Total in app send skip events within the journey"}, "unique_total_inappsendskip": {"type": "bigint", "index": 39, "name": "unique_total_inappsendskip", "comment": "Count of distinct users with in app send skip events within the journey"}, "total_smssend": {"type": "numeric", "index": 40, "name": "total_smssend", "comment": "Total sms send events within the journey"}, "unique_total_smssend": {"type": "bigint", "index": 41, "name": "unique_total_smssend", "comment": "Count of distinct users with sms send events within the journey"}, "total_inappsend": {"type": "numeric", "index": 42, "name": "total_inappsend", "comment": "Total in app send events within the journey"}, "unique_total_inappsend": {"type": "bigint", "index": 43, "name": "unique_total_inappsend", "comment": "Count of distinct users with in app send events within the journey"}, "total_pushopen": {"type": "numeric", "index": 44, "name": "total_pushopen", "comment": "Total push open events within the journey"}, "unique_total_pushopen": {"type": "bigint", "index": 45, "name": "unique_total_pushopen", "comment": "Count of distinct users with push open events within the journey"}, "total_emailsend": {"type": "numeric", "index": 46, "name": "total_emailsend", "comment": "Total email send events within the journey"}, "unique_total_emailsend": {"type": "bigint", "index": 47, "name": "unique_total_emailsend", "comment": "Count of distinct users with email send events within the journey"}, "total_pushsendskip": {"type": "numeric", "index": 48, "name": "total_pushsendskip", "comment": "Total push send skip events within the journey"}, "unique_total_pushsendskip": {"type": "bigint", "index": 49, "name": "unique_total_pushsendskip", "comment": "Count of distinct users with push send skip events within the journey"}, "total_inappopen": {"type": "numeric", "index": 50, "name": "total_inappopen", "comment": "Total in app open events within the journey"}, "unique_total_inappopen": {"type": "bigint", "index": 51, "name": "unique_total_inappopen", "comment": "Count of distinct users with in app open events within the journey"}, "total_emailsendskip": {"type": "numeric", "index": 52, "name": "total_emailsendskip", "comment": "Total email send skip events within the journey"}, "unique_total_emailsendskip": {"type": "bigint", "index": 53, "name": "unique_total_emailsendskip", "comment": "Count of distinct users with email send skip events within the journey"}, "total_emailbounce": {"type": "numeric", "index": 54, "name": "total_emailbounce", "comment": "Total email bounce events within the journey"}, "unique_total_emailbounce": {"type": "bigint", "index": 55, "name": "unique_total_emailbounce", "comment": "Count of distinct users with email bounce events within the journey"}, "total_inappclick": {"type": "numeric", "index": 56, "name": "total_inappclick", "comment": "Total in app click events within the journey"}, "unique_total_inappclick": {"type": "bigint", "index": 57, "name": "unique_total_inappclick", "comment": "Count of distinct users with in app click events within the journey"}, "total_pushuninstall": {"type": "numeric", "index": 58, "name": "total_pushuninstall", "comment": "Total push uninstall events within the journey"}, "unique_total_pushuninstall": {"type": "bigint", "index": 59, "name": "unique_total_pushuninstall", "comment": "Count of distinct users with push uninstall events within the journey"}, "unique_journey_id": {"type": "text", "index": 60, "name": "unique_journey_id", "comment": "Unique identifier combining journey_id and source_relation."}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.iterable__journeys"}, "model.iterable.iterable__list_user_history": {"metadata": {"type": "BASE TABLE", "schema": "public_iterable_dev", "name": "iterable__list_user_history", "database": "postgres", "comment": "Table that recreates the `list_user_history` source table. Additionally, this table provides an `is_current` field to identify the current lists associated with the user. The table coalesces list_id values from both the direct list_user relationships and the unnested email_list_ids from user history to ensure comprehensive list coverage. The grain of this table is at the user/list/updated_at level.\n", "owner": "postgres"}, "columns": {"source_relation": {"type": "text", "index": 1, "name": "source_relation", "comment": "Identifies the record's source."}, "unique_user_key": {"type": "text", "index": 2, "name": "unique_user_key", "comment": "The unique identifier of the user. With the new schema (Aug 2023), it is the _fivetran_user_id. This is a hash of user_id and/or email, depending on project type. If using the old schema, it is email."}, "_fivetran_user_id": {"type": "text", "index": 3, "name": "_fivetran_user_id", "comment": "A Fivetran-created unique identifier for the new Iterable schema in Aug 2023, for users, derived from hashing user_id and/or email, depending on project type."}, "user_id": {"type": "text", "index": 4, "name": "user_id", "comment": "User identifier, for userID-based projects."}, "user_email": {"type": "text", "index": 5, "name": "user_email", "comment": "Email of the user if it exists."}, "user_first_name": {"type": "integer", "index": 6, "name": "user_first_name", "comment": "First name of the user"}, "user_last_name": {"type": "integer", "index": 7, "name": "user_last_name", "comment": "Last name of the user"}, "user_signup_date": {"type": "text", "index": 8, "name": "user_signup_date", "comment": "Timestamp of when the user signed up"}, "user_signup_source": {"type": "text", "index": 9, "name": "user_signup_source", "comment": "Source where the user signed up"}, "user_updated_at": {"type": "timestamp without time zone", "index": 10, "name": "user_updated_at", "comment": "Last update timestamp"}, "list_id": {"type": "bigint", "index": 11, "name": "list_id", "comment": "The list associated with the user. Uses coalesced values prioritizing `list_id` from `LIST_USER` over the unnested `email_list_ids` from `USER_HISTORY` for comprehensive list coverage."}, "is_current": {"type": "boolean", "index": 12, "name": "is_current", "comment": "Boolean indicating if the current list is active"}, "list_name": {"type": "text", "index": 13, "name": "list_name", "comment": "Name of the list associated with the user"}, "list_type": {"type": "text", "index": 14, "name": "list_type", "comment": "Type of list associated with the user"}, "list_created_at": {"type": "text", "index": 15, "name": "list_created_at", "comment": "Date the list was created"}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.iterable__list_user_history"}, "model.iterable.iterable__user_campaign": {"metadata": {"type": "BASE TABLE", "schema": "public_iterable_dev", "name": "iterable__user_campaign", "database": "postgres", "comment": "Table that provides total and unique metrics for a user associated with particular campaigns and if available, experiments.", "owner": "postgres"}, "columns": {"source_relation": {"type": "text", "index": 1, "name": "source_relation", "comment": "Identifies the record's source."}, "_fivetran_user_id": {"type": "text", "index": 2, "name": "_fivetran_user_id", "comment": "A Fivetran-created unique identifier for the new Iterable schema in Aug 2023, for users, derived from hashing user_id and/or email, depending on project type."}, "unique_user_key": {"type": "text", "index": 3, "name": "unique_user_key", "comment": "The unique identifier of the user. With the new schema (Aug 2023), it is the _fivetran_user_id. This is a hash of user_id and/or email, depending on project type. If using the old schema, it is email."}, "user_id": {"type": "text", "index": 4, "name": "user_id", "comment": "User identifier, for userID-based projects."}, "campaign_id": {"type": "text", "index": 5, "name": "campaign_id", "comment": "The unique identifier of the campaign which the user metrics are associated"}, "experiment_id": {"type": "integer", "index": 6, "name": "experiment_id", "comment": "The unique experiment variation of the campaign"}, "user_email": {"type": "text", "index": 7, "name": "user_email", "comment": "Email of the user if it exists."}, "user_full_name": {"type": "text", "index": 8, "name": "user_full_name", "comment": "The users first and last name"}, "campaign_name": {"type": "text", "index": 9, "name": "campaign_name", "comment": "The name of the campaign which the user metrics are associated"}, "template_id": {"type": "text", "index": 10, "name": "template_id", "comment": "The unique identifier of the template used within the campaign"}, "template_name": {"type": "text", "index": 11, "name": "template_name", "comment": "The name of the template used for the campaign"}, "recurring_campaign_id": {"type": "text", "index": 12, "name": "recurring_campaign_id", "comment": "The unique identifier of the recurring campaign which the campaign is tied to"}, "recurring_campaign_name": {"type": "text", "index": 13, "name": "recurring_campaign_name", "comment": "The name of the recurring campaign which the campaign is tied to"}, "first_event_at": {"type": "timestamp without time zone", "index": 14, "name": "first_event_at", "comment": "Timestamp of the first campaign/experiment event associated with the user"}, "last_event_at": {"type": "timestamp without time zone", "index": 15, "name": "last_event_at", "comment": "Timestamp of the most recent campaign/experiment event associated with the user"}, "first_open_or_click_event_at": {"type": "timestamp without time zone", "index": 16, "name": "first_open_or_click_event_at", "comment": "The time of the first open or click time. This is the first time a user interacts with a campaign, recording the earliest occurring event out of 'emailOpen', 'emailClick', and 'pushOpen'."}, "total_emailclick": {"type": "bigint", "index": 17, "name": "total_emailclick", "comment": "Total email clicks events the user took within the campaign/experiment"}, "total_emailunsubscribe": {"type": "bigint", "index": 18, "name": "total_emailunsubscribe", "comment": "Total email unsubscription events the user performed within the campaign/experiment"}, "total_emailcomplaint": {"type": "bigint", "index": 19, "name": "total_emailcomplaint", "comment": "Total email complaint events the user performed within the campaign/experiment"}, "total_customevent": {"type": "bigint", "index": 20, "name": "total_customevent", "comment": "Total custom events associated with the user within the campaign/experiment"}, "total_emailsubscribe": {"type": "bigint", "index": 21, "name": "total_emailsubscribe", "comment": "Total email subscription events associate with the user within the campaign/experiment"}, "total_emailopen": {"type": "bigint", "index": 22, "name": "total_emailopen", "comment": "Total email open events the user performed within the campaign/experiment"}, "total_pushsend": {"type": "bigint", "index": 23, "name": "total_pushsend", "comment": "Total push send events the user performed within the campaign/experiment"}, "total_smsbounce": {"type": "bigint", "index": 24, "name": "total_smsbounce", "comment": "Total sms bounce events associated with the user within the campaign/experiment"}, "total_pushbounce": {"type": "bigint", "index": 25, "name": "total_pushbounce", "comment": "Total push bounce events associated with the user within the campaign/experiment"}, "total_inappsendskip": {"type": "bigint", "index": 26, "name": "total_inappsendskip", "comment": "Total in app send skip events the user performed within the campaign/experiment"}, "total_smssend": {"type": "bigint", "index": 27, "name": "total_smssend", "comment": "Total sms send events associated with the user within the campaign/experiment"}, "total_inappsend": {"type": "bigint", "index": 28, "name": "total_inappsend", "comment": "Total in app send events associated with the user within the campaign/experiment"}, "total_pushopen": {"type": "bigint", "index": 29, "name": "total_pushopen", "comment": "Total push open events the user performed within the campaign/experiment"}, "total_emailsend": {"type": "bigint", "index": 30, "name": "total_emailsend", "comment": "Total email send event associated with the user within the campaign/experiment"}, "total_pushsendskip": {"type": "bigint", "index": 31, "name": "total_pushsendskip", "comment": "Total push send skip events associated with the user within the campaign/experiment"}, "total_inappopen": {"type": "bigint", "index": 32, "name": "total_inappopen", "comment": "Total in app open events associated with the user within the campaign/experiment"}, "total_emailsendskip": {"type": "bigint", "index": 33, "name": "total_emailsendskip", "comment": "Total email send skip events associated with the user within the campaign/experiment"}, "total_emailbounce": {"type": "bigint", "index": 34, "name": "total_emailbounce", "comment": "Total email bounce events associated with the user within the campaign/experiment"}, "total_inappclick": {"type": "bigint", "index": 35, "name": "total_inappclick", "comment": "Total in app click events associated with the user within the campaign/experiment"}, "total_pushuninstall": {"type": "bigint", "index": 36, "name": "total_pushuninstall", "comment": "Total push uninstall events associated with the user within the campaign/experiment"}, "unique_user_campaign_id": {"type": "text", "index": 37, "name": "unique_user_campaign_id", "comment": "Unique ID combining source_relation, unique_user_key, campaign_id, and if available, experiment_id."}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.iterable__user_campaign"}, "model.iterable.iterable__user_unsubscriptions": {"metadata": {"type": "BASE TABLE", "schema": "public_iterable_dev", "name": "iterable__user_unsubscriptions", "database": "postgres", "comment": "Table that generates the total channel and message types a user has chosen to unsubscribe.", "owner": "postgres"}, "columns": {"source_relation": {"type": "text", "index": 1, "name": "source_relation", "comment": "Identifies the record's source."}, "_fivetran_user_id": {"type": "text", "index": 2, "name": "_fivetran_user_id", "comment": "A Fivetran-created unique identifier for the new Iterable schema in Aug 2023, for users, derived from hashing user_id and/or email, depending on project type."}, "unique_user_key": {"type": "text", "index": 3, "name": "unique_user_key", "comment": "The unique identifier of the user. With the new schema (Aug 2023), it is the _fivetran_user_id. This is a hash of user_id and/or email, depending on project type. If using the old schema, it is email."}, "channel_id": {"type": "text", "index": 4, "name": "channel_id", "comment": "Unique identifier of the channel which the user is unsubscribed"}, "message_type_id": {"type": "text", "index": 5, "name": "message_type_id", "comment": "Unique identifier of the message type which the user is unsubscribed"}, "updated_at": {"type": "timestamp without time zone", "index": 6, "name": "updated_at", "comment": "Timestamp of when the user unsubscribed from the channel or message type"}, "channel_name": {"type": "text", "index": 7, "name": "channel_name", "comment": "The name of the channel which the user is unsubscribed"}, "message_type_name": {"type": "text", "index": 8, "name": "message_type_name", "comment": "The name of the message type which the user is unsubscribed"}, "channel_type": {"type": "text", "index": 9, "name": "channel_type", "comment": "The channel type which the user is unsubscribed"}, "message_medium": {"type": "text", "index": 10, "name": "message_medium", "comment": "The medium type the message was provided which the user is unsubscribed"}, "is_unsubscribed_channel_wide": {"type": "boolean", "index": 11, "name": "is_unsubscribed_channel_wide", "comment": "Boolean indicating if the user unsubscribed at the channel level (i.e. unsubscribed to all message types) or if they unsubscribed from only an individual message type.\n"}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.iterable__user_unsubscriptions"}, "model.iterable.iterable__users": {"metadata": {"type": "BASE TABLE", "schema": "public_iterable_dev", "name": "iterable__users", "database": "postgres", "comment": "Table that provides unique user enriched information.", "owner": "postgres"}, "columns": {"source_relation": {"type": "text", "index": 1, "name": "source_relation", "comment": "Identifies the record's source."}, "user_id": {"type": "text", "index": 2, "name": "user_id", "comment": "User identifier, for userID-based projects."}, "_fivetran_user_id": {"type": "text", "index": 3, "name": "_fivetran_user_id", "comment": "A Fivetran-created unique identifier for the new Iterable schema in Aug 2023, for users, derived from hashing user_id and/or email, depending on project type."}, "unique_user_key": {"type": "text", "index": 4, "name": "unique_user_key", "comment": "The unique identifier of the user. With the new schema (Aug 2023), it is the _fivetran_user_id. This is a hash of user_id and/or email, depending on project type. If using the old schema, it is email."}, "email": {"type": "text", "index": 5, "name": "email", "comment": "The user's email. User identifier, for email-based projects. Previously was the unique identifier for user records, for the old Iterable schema before the August 2023 updates."}, "first_name": {"type": "integer", "index": 6, "name": "first_name", "comment": "First name of the user"}, "last_name": {"type": "integer", "index": 7, "name": "last_name", "comment": "Last name of the user"}, "signup_date": {"type": "text", "index": 8, "name": "signup_date", "comment": "Timestamp of when the user signed up"}, "signup_source": {"type": "text", "index": 9, "name": "signup_source", "comment": "Source where the user signed up"}, "updated_at": {"type": "timestamp without time zone", "index": 10, "name": "updated_at", "comment": "Last update timestamp"}, "phone_number": {"type": "integer", "index": 11, "name": "phone_number", "comment": "Phone number associated with the user"}, "email_list_ids": {"type": "text", "index": 12, "name": "email_list_ids", "comment": "Array of all email lists associated with the user, derived from the list_user table relationships"}, "count_lists": {"type": "bigint", "index": 13, "name": "count_lists", "comment": "Total count of lists associated with the user"}, "count_total_campaigns": {"type": "bigint", "index": 14, "name": "count_total_campaigns", "comment": "Count of all campaigns the user has been in"}, "first_event_at": {"type": "timestamp without time zone", "index": 15, "name": "first_event_at", "comment": "The first event the user ever encountered"}, "last_event_at": {"type": "timestamp without time zone", "index": 16, "name": "last_event_at", "comment": "The most recent event the user has encountered"}, "total_emailclick": {"type": "numeric", "index": 17, "name": "total_emailclick", "comment": "Total number of email clicks the user has performed"}, "total_emailunsubscribe": {"type": "numeric", "index": 18, "name": "total_emailunsubscribe", "comment": "Total unsubscription events the user has performed"}, "total_emailcomplaint": {"type": "numeric", "index": 19, "name": "total_emailcomplaint", "comment": "Total email complaints the user has performed"}, "total_customevent": {"type": "numeric", "index": 20, "name": "total_customevent", "comment": "Total custom events associated with the user"}, "total_emailsubscribe": {"type": "numeric", "index": 21, "name": "total_emailsubscribe", "comment": "Total subscription events the user has performed"}, "total_emailopen": {"type": "numeric", "index": 22, "name": "total_emailopen", "comment": "Total email opened events the user has performed"}, "total_pushsend": {"type": "numeric", "index": 23, "name": "total_pushsend", "comment": "The push send events the user has experienced"}, "total_smsbounce": {"type": "numeric", "index": 24, "name": "total_smsbounce", "comment": "Total sms bounces that are associated with the user"}, "total_pushbounce": {"type": "numeric", "index": 25, "name": "total_pushbounce", "comment": "Total number of push bounces associated with the user"}, "total_inappsendskip": {"type": "numeric", "index": 26, "name": "total_inappsendskip", "comment": "Total in app send skips associated with the user"}, "total_smssend": {"type": "numeric", "index": 27, "name": "total_smssend", "comment": "Total sms sends that the user has experienced"}, "total_inappsend": {"type": "numeric", "index": 28, "name": "total_inappsend", "comment": "Total in app sends the user has experienced"}, "total_pushopen": {"type": "numeric", "index": 29, "name": "total_pushopen", "comment": "Total push messages the user has opened"}, "total_emailsend": {"type": "numeric", "index": 30, "name": "total_emailsend", "comment": "Total emails that have been sent to the user"}, "total_pushsendskip": {"type": "numeric", "index": 31, "name": "total_pushsendskip", "comment": "Total push sends the user has skipped"}, "total_inappopen": {"type": "numeric", "index": 32, "name": "total_inappopen", "comment": "Total in app opens the user has performed"}, "total_emailsendskip": {"type": "numeric", "index": 33, "name": "total_emailsendskip", "comment": "Total email sends the user has skipped"}, "total_emailbounce": {"type": "numeric", "index": 34, "name": "total_emailbounce", "comment": "Total number of emails that have bounced from the user"}, "total_inappclick": {"type": "numeric", "index": 35, "name": "total_inappclick", "comment": "Total in app clicks associated with the user"}, "total_pushuninstall": {"type": "numeric", "index": 36, "name": "total_pushuninstall", "comment": "Total push uninstall events the user has performed"}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.iterable__users"}, "model.iterable.stg_iterable__campaign_history": {"metadata": {"type": "BASE TABLE", "schema": "public_iterable_dev", "name": "stg_iterable__campaign_history", "database": "postgres", "comment": "Table containing a history of campaigns.", "owner": "postgres"}, "columns": {"source_relation": {"type": "text", "index": 1, "name": "source_relation", "comment": "Identifies the record's source."}, "campaign_id": {"type": "text", "index": 2, "name": "campaign_id", "comment": "Unique identifier of the campaign record"}, "updated_at": {"type": "text", "index": 3, "name": "updated_at", "comment": "Last update timestamp"}, "campaign_name": {"type": "text", "index": 4, "name": "campaign_name", "comment": "User defined name of the campaign."}, "campaign_state": {"type": "text", "index": 5, "name": "campaign_state", "comment": "State of the campaign. Can be Draft, Ready, Scheduled, Running, Finished, Starting, Aborted or Recurring"}, "campaign_type": {"type": "text", "index": 6, "name": "campaign_type", "comment": "The campaign type. Can be Blast or Triggered"}, "send_size": {"type": "integer", "index": 7, "name": "send_size", "comment": "Size of the campaign. Number of individuals included in the campaign"}, "start_at": {"type": "integer", "index": 8, "name": "start_at", "comment": "Start timestamp"}, "ended_at": {"type": "integer", "index": 9, "name": "ended_at", "comment": "Ended timestamp"}, "created_at": {"type": "text", "index": 10, "name": "created_at", "comment": "Creation timestamp"}, "message_medium": {"type": "text", "index": 11, "name": "message_medium", "comment": "The medium that this message was sent via, for example Email or InApp"}, "recurring_campaign_id": {"type": "text", "index": 12, "name": "recurring_campaign_id", "comment": "Reference to the recurring campaign, if applicable"}, "created_by_user_id": {"type": "text", "index": 13, "name": "created_by_user_id", "comment": "Reference to the user who created the campaign"}, "updated_by_user_id": {"type": "text", "index": 14, "name": "updated_by_user_id", "comment": "ID of the user who updated this record"}, "template_id": {"type": "text", "index": 15, "name": "template_id", "comment": "Reference to the campaign template"}, "workflow_id": {"type": "integer", "index": 16, "name": "workflow_id", "comment": "Reference to the workflow which the event originated"}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 17, "name": "_fivetran_synced", "comment": "The time when a record was last updated by Fivetran."}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.stg_iterable__campaign_history"}, "model.iterable.stg_iterable__campaign_history_tmp": {"metadata": {"type": "VIEW", "schema": "public_iterable_dev", "name": "stg_iterable__campaign_history_tmp", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"id": {"type": "integer", "index": 1, "name": "id", "comment": null}, "updated_at": {"type": "text", "index": 2, "name": "updated_at", "comment": null}, "template_id": {"type": "integer", "index": 3, "name": "template_id", "comment": null}, "recurring_campaign_id": {"type": "integer", "index": 4, "name": "recurring_campaign_id", "comment": null}, "campaign_state": {"type": "text", "index": 5, "name": "campaign_state", "comment": null}, "created_at": {"type": "text", "index": 6, "name": "created_at", "comment": null}, "created_by_user_id": {"type": "text", "index": 7, "name": "created_by_user_id", "comment": null}, "ended_at": {"type": "integer", "index": 8, "name": "ended_at", "comment": null}, "name": {"type": "text", "index": 9, "name": "name", "comment": null}, "send_size": {"type": "integer", "index": 10, "name": "send_size", "comment": null}, "start_at": {"type": "integer", "index": 11, "name": "start_at", "comment": null}, "type": {"type": "text", "index": 12, "name": "type", "comment": null}, "workflow_id": {"type": "integer", "index": 13, "name": "workflow_id", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 14, "name": "_fivetran_synced", "comment": null}, "updated_by_user_id": {"type": "integer", "index": 15, "name": "updated_by_user_id", "comment": null}, "message_medium": {"type": "text", "index": 16, "name": "message_medium", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.stg_iterable__campaign_history_tmp"}, "model.iterable.stg_iterable__campaign_label_history": {"metadata": {"type": "BASE TABLE", "schema": "public_iterable_dev", "name": "stg_iterable__campaign_label_history", "database": "postgres", "comment": "Table containing a history of labels.", "owner": "postgres"}, "columns": {"source_relation": {"type": "text", "index": 1, "name": "source_relation", "comment": "Identifies the record's source."}, "campaign_id": {"type": "text", "index": 2, "name": "campaign_id", "comment": "Reference to the campaign associated with the label"}, "label": {"type": "text", "index": 3, "name": "label", "comment": "Name of the label"}, "updated_at": {"type": "text", "index": 4, "name": "updated_at", "comment": "Last update timestamp"}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 5, "name": "_fivetran_synced", "comment": "The time when a record was last updated by Fivetran."}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.stg_iterable__campaign_label_history"}, "model.iterable.stg_iterable__campaign_label_history_tmp": {"metadata": {"type": "VIEW", "schema": "public_iterable_dev", "name": "stg_iterable__campaign_label_history_tmp", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"campaign_id": {"type": "integer", "index": 1, "name": "campaign_id", "comment": null}, "label": {"type": "text", "index": 2, "name": "label", "comment": null}, "updated_at": {"type": "text", "index": 3, "name": "updated_at", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 4, "name": "_fivetran_synced", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.stg_iterable__campaign_label_history_tmp"}, "model.iterable.stg_iterable__campaign_list_history": {"metadata": {"type": "BASE TABLE", "schema": "public_iterable_dev", "name": "stg_iterable__campaign_list_history", "database": "postgres", "comment": "Table containing a history of lists.", "owner": "postgres"}, "columns": {"source_relation": {"type": "text", "index": 1, "name": "source_relation", "comment": "Identifies the record's source."}, "campaign_id": {"type": "text", "index": 2, "name": "campaign_id", "comment": "Reference to the campaign associated with the label"}, "list_id": {"type": "text", "index": 3, "name": "list_id", "comment": "Reference to the list used"}, "updated_at": {"type": "text", "index": 4, "name": "updated_at", "comment": "Last update timestamp"}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 5, "name": "_fivetran_synced", "comment": "The time when a record was last updated by Fivetran."}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.stg_iterable__campaign_list_history"}, "model.iterable.stg_iterable__campaign_list_history_tmp": {"metadata": {"type": "VIEW", "schema": "public_iterable_dev", "name": "stg_iterable__campaign_list_history_tmp", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"list_id": {"type": "integer", "index": 1, "name": "list_id", "comment": null}, "campaign_id": {"type": "integer", "index": 2, "name": "campaign_id", "comment": null}, "updated_at": {"type": "text", "index": 3, "name": "updated_at", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 4, "name": "_fivetran_synced", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.stg_iterable__campaign_list_history_tmp"}, "model.iterable.stg_iterable__campaign_suppression_list_history": {"metadata": {"type": "BASE TABLE", "schema": "public_iterable_dev", "name": "stg_iterable__campaign_suppression_list_history", "database": "postgres", "comment": "Table containing a history of suppression lists.", "owner": "postgres"}, "columns": {"source_relation": {"type": "text", "index": 1, "name": "source_relation", "comment": "Identifies the record's source."}, "campaign_id": {"type": "text", "index": 2, "name": "campaign_id", "comment": "Reference to the campaign associated with the label"}, "suppressed_list_id": {"type": "text", "index": 3, "name": "suppressed_list_id", "comment": "Reference to the list used"}, "updated_at": {"type": "text", "index": 4, "name": "updated_at", "comment": "Last update timestamp"}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 5, "name": "_fivetran_synced", "comment": "The time when a record was last updated by Fivetran."}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.stg_iterable__campaign_suppression_list_history"}, "model.iterable.stg_iterable__campaign_suppression_list_history_tmp": {"metadata": {"type": "VIEW", "schema": "public_iterable_dev", "name": "stg_iterable__campaign_suppression_list_history_tmp", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"suppressed_list_id": {"type": "integer", "index": 1, "name": "suppressed_list_id", "comment": null}, "campaign_id": {"type": "integer", "index": 2, "name": "campaign_id", "comment": null}, "updated_at": {"type": "text", "index": 3, "name": "updated_at", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 4, "name": "_fivetran_synced", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.stg_iterable__campaign_suppression_list_history_tmp"}, "model.iterable.stg_iterable__channel": {"metadata": {"type": "BASE TABLE", "schema": "public_iterable_dev", "name": "stg_iterable__channel", "database": "postgres", "comment": "Table containing unique channels.", "owner": "postgres"}, "columns": {"source_relation": {"type": "text", "index": 1, "name": "source_relation", "comment": "Identifies the record's source."}, "channel_id": {"type": "text", "index": 2, "name": "channel_id", "comment": "Unique identifier of the channel"}, "channel_name": {"type": "text", "index": 3, "name": "channel_name", "comment": "User defined name of the channel"}, "channel_type": {"type": "text", "index": 4, "name": "channel_type", "comment": "The channel type"}, "message_medium": {"type": "text", "index": 5, "name": "message_medium", "comment": "The message medium associated with the channel"}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 6, "name": "_fivetran_synced", "comment": "The time when a record was last updated by Fivetran."}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.stg_iterable__channel"}, "model.iterable.stg_iterable__channel_tmp": {"metadata": {"type": "VIEW", "schema": "public_iterable_dev", "name": "stg_iterable__channel_tmp", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"id": {"type": "bigint", "index": 1, "name": "id", "comment": null}, "name": {"type": "text", "index": 2, "name": "name", "comment": null}, "channel_type": {"type": "text", "index": 3, "name": "channel_type", "comment": null}, "message_medium": {"type": "text", "index": 4, "name": "message_medium", "comment": null}, "_fivetran_deleted": {"type": "boolean", "index": 5, "name": "_fivetran_deleted", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 6, "name": "_fivetran_synced", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.stg_iterable__channel_tmp"}, "model.iterable.stg_iterable__event": {"metadata": {"type": "VIEW", "schema": "public_iterable_dev", "name": "stg_iterable__event", "database": "postgres", "comment": "Table containing individual events within campaigns.", "owner": "postgres"}, "columns": {"source_relation": {"type": "text", "index": 1, "name": "source_relation", "comment": "Identifies the record's source."}, "event_id": {"type": "text", "index": 2, "name": "event_id", "comment": "A Fivetran-created unique identifier derived from hashing campaign_id, created_at, and event_name."}, "unique_event_id": {"type": "text", "index": 3, "name": "unique_event_id", "comment": "A surrogate key made up of event_id, _fivetran_user_id, and source_relation."}, "_fivetran_user_id": {"type": "text", "index": 4, "name": "_fivetran_user_id", "comment": "A Fivetran-created unique identifier for users, derived from hashing user_id and/or email, depending on project type. This exists for users of the new schema starting Aug 2023. In the old schema, the unique identifier is email."}, "unique_user_key": {"type": "text", "index": 5, "name": "unique_user_key", "comment": "The unique identifier of the user. With the new schema (Aug 2023), it is the _fivetran_user_id. This is a hash of user_id and/or email, depending on project type. If using the old schema, it is email."}, "campaign_id": {"type": "text", "index": 6, "name": "campaign_id", "comment": "Reference to the campaign from which the event originated"}, "content_id": {"type": "text", "index": 7, "name": "content_id", "comment": "Reference to the content the event is associated with"}, "created_at": {"type": "timestamp without time zone", "index": 8, "name": "created_at", "comment": "Creation timestamp"}, "created_on": {"type": "date", "index": 9, "name": "created_on", "comment": "Creation date"}, "email": {"type": "text", "index": 10, "name": "email", "comment": "Reference to the unique user the event was applied to"}, "additional_properties": {"type": "text", "index": 11, "name": "additional_properties", "comment": "json object containing addition event properties"}, "event_name": {"type": "text", "index": 12, "name": "event_name", "comment": "Name provided to the individual event"}, "message_bus_id": {"type": "text", "index": 13, "name": "message_bus_id", "comment": "Reference to the message bus associated with the event"}, "message_id": {"type": "text", "index": 14, "name": "message_id", "comment": "Reference to the message the event is associated with"}, "message_type_id": {"type": "text", "index": 15, "name": "message_type_id", "comment": "Reference to the type of message the event is associated with"}, "recipient_state": {"type": "integer", "index": 16, "name": "recipient_state", "comment": "The state of the recipient upon receiving the event"}, "status": {"type": "integer", "index": 17, "name": "status", "comment": "Status of the event"}, "transactional_data": {"type": "character varying(100)", "index": 18, "name": "transactional_data", "comment": "Transactional data associated with the event"}, "unsub_source": {"type": "integer", "index": 19, "name": "unsub_source", "comment": "Source of the unsubscribe event"}, "user_agent": {"type": "integer", "index": 20, "name": "user_agent", "comment": "User agent associated with the event"}, "user_agent_device": {"type": "integer", "index": 21, "name": "user_agent_device", "comment": "The device of the user agent"}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 22, "name": "_fivetran_synced", "comment": "The time when a record was last updated by Fivetran."}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.stg_iterable__event"}, "model.iterable.stg_iterable__event_extension": {"metadata": {"type": "VIEW", "schema": "public_iterable_dev", "name": "stg_iterable__event_extension", "database": "postgres", "comment": "Table containing addition properties from the event table.", "owner": "postgres"}, "columns": {"source_relation": {"type": "text", "index": 1, "name": "source_relation", "comment": "Identifies the record's source."}, "event_id": {"type": "text", "index": 2, "name": "event_id", "comment": "A Fivetran-created unique identifier derived from hashing campaign_id, created_at, and event_name."}, "unique_event_id": {"type": "text", "index": 3, "name": "unique_event_id", "comment": "A surrogate key made up of event_id, _fivetran_user_id, and source_relation."}, "is_app_already_running": {"type": "integer", "index": 4, "name": "is_app_already_running", "comment": "Boolean indicating if the app is currently running or not"}, "badge": {"type": "integer", "index": 5, "name": "badge", "comment": "Badge associated with the event"}, "catalog_collection_count": {"type": "integer", "index": 6, "name": "catalog_collection_count", "comment": "The count of products or items collected in a catalog associated with the event."}, "catalog_lookup_count": {"type": "integer", "index": 7, "name": "catalog_lookup_count", "comment": "The count of times a catalog was looked up or queried during the event."}, "canonical_url_id": {"type": "text", "index": 8, "name": "canonical_url_id", "comment": "Reference to the url associated with the event"}, "is_content_available": {"type": "integer", "index": 9, "name": "is_content_available", "comment": "Content available from the event"}, "content_id": {"type": "text", "index": 10, "name": "content_id", "comment": "Reference to the content associated with the event"}, "device": {"type": "integer", "index": 11, "name": "device", "comment": "The device associated with the event"}, "email_id": {"type": "text", "index": 12, "name": "email_id", "comment": "Reference to the email associated with the event"}, "email_subject": {"type": "text", "index": 13, "name": "email_subject", "comment": "Subject of the email associated with the event"}, "experiment_id": {"type": "integer", "index": 14, "name": "experiment_id", "comment": "Reference to the experiment used if the event is an experiment"}, "from_phone_number_id": {"type": "integer", "index": 15, "name": "from_phone_number_id", "comment": "Reference to the phone number which the event is from"}, "from_smssender_id": {"type": "integer", "index": 16, "name": "from_smssender_id", "comment": "Reference to the sms sender which the event is from"}, "link_id": {"type": "text", "index": 17, "name": "link_id", "comment": "Reference to the link associated with the event"}, "link_url": {"type": "integer", "index": 18, "name": "link_url", "comment": "Url of the link associated with the event"}, "locale": {"type": "integer", "index": 19, "name": "locale", "comment": "Locale associated with the event"}, "payload": {"type": "character varying(100)", "index": 20, "name": "payload", "comment": "Payload resulted from the event"}, "platform_endpoint": {"type": "integer", "index": 21, "name": "platform_endpoint", "comment": "The specific platform endpoint of the event"}, "push_message": {"type": "integer", "index": 22, "name": "push_message", "comment": "Boolean indicating if the event is a push message"}, "region": {"type": "text", "index": 23, "name": "region", "comment": "Region of the event"}, "sms_message": {"type": "integer", "index": 24, "name": "sms_message", "comment": "Boolean indicating if the event is an sms message"}, "to_phone_number": {"type": "integer", "index": 25, "name": "to_phone_number", "comment": "To phone number associated with the event"}, "url": {"type": "integer", "index": 26, "name": "url", "comment": "Url associated with the event"}, "workflow_id": {"type": "text", "index": 27, "name": "workflow_id", "comment": "Reference to the workflow which the event originated"}, "workflow_name": {"type": "text", "index": 28, "name": "workflow_name", "comment": "Name of the workflow which the event originated"}, "city": {"type": "text", "index": 29, "name": "city", "comment": "The city associated with the event, which could be the location of the recipient."}, "clicked_url": {"type": "text", "index": 30, "name": "clicked_url", "comment": "The URL that was clicked by the recipient in response to the marketing message."}, "country": {"type": "text", "index": 31, "name": "country", "comment": "The country associated with the event, which could be the location of the recipient."}, "error_code": {"type": "integer", "index": 32, "name": "error_code", "comment": "The error code or message indicating any issues or errors encountered during the event."}, "expires_at": {"type": "text", "index": 33, "name": "expires_at", "comment": "The date and time when the event or message is set to expire or become invalid."}, "from_phone_number": {"type": "integer", "index": 34, "name": "from_phone_number", "comment": "The phone number from which the SMS message was sent."}, "in_app_body": {"type": "text", "index": 35, "name": "in_app_body", "comment": "The content or body of an in-app message that was sent as part of the event."}, "is_sms_estimation": {"type": "boolean", "index": 36, "name": "is_sms_estimation", "comment": "A boolean indicating whether the SMS message is an estimation or not."}, "labels": {"type": "text", "index": 37, "name": "labels", "comment": "Any labels or tags associated with the event, which can be used for categorization or organization."}, "message_status": {"type": "text", "index": 38, "name": "message_status", "comment": "The status of the marketing message, such as sent, delivered, opened, etc."}, "mms_send_count": {"type": "integer", "index": 39, "name": "mms_send_count", "comment": "The count of multimedia messages (MMS) sent as part of the event."}, "reason": {"type": "text", "index": 40, "name": "reason", "comment": "The reason or cause associated with a specific event or action."}, "sms_send_count": {"type": "integer", "index": 41, "name": "sms_send_count", "comment": "The count of SMS messages sent as part of the event."}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 42, "name": "_fivetran_synced", "comment": "The time when a record was last updated by Fivetran."}, "_fivetran_user_id": {"type": "text", "index": 43, "name": "_fivetran_user_id", "comment": "A Fivetran-created unique identifier for users, derived from hashing user_id and/or email, depending on project type. This exists for users of the new schema starting Aug 2023. In the old schema, the unique identifier is email."}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.stg_iterable__event_extension"}, "model.iterable.stg_iterable__event_extension_tmp": {"metadata": {"type": "VIEW", "schema": "public_iterable_dev", "name": "stg_iterable__event_extension_tmp", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"_fivetran_id": {"type": "text", "index": 1, "name": "_fivetran_id", "comment": null}, "app_already_running": {"type": "integer", "index": 2, "name": "app_already_running", "comment": null}, "badge": {"type": "integer", "index": 3, "name": "badge", "comment": null}, "canonical_url_id": {"type": "integer", "index": 4, "name": "canonical_url_id", "comment": null}, "content_available": {"type": "integer", "index": 5, "name": "content_available", "comment": null}, "content_id": {"type": "integer", "index": 6, "name": "content_id", "comment": null}, "device": {"type": "integer", "index": 7, "name": "device", "comment": null}, "email_id": {"type": "text", "index": 8, "name": "email_id", "comment": null}, "email_subject": {"type": "text", "index": 9, "name": "email_subject", "comment": null}, "experiment_id": {"type": "integer", "index": 10, "name": "experiment_id", "comment": null}, "from_phone_number_id": {"type": "integer", "index": 11, "name": "from_phone_number_id", "comment": null}, "from_smssender_id": {"type": "integer", "index": 12, "name": "from_smssender_id", "comment": null}, "image_url": {"type": "integer", "index": 13, "name": "image_url", "comment": null}, "is_ghost_push": {"type": "integer", "index": 14, "name": "is_ghost_push", "comment": null}, "link_id": {"type": "integer", "index": 15, "name": "link_id", "comment": null}, "link_url": {"type": "integer", "index": 16, "name": "link_url", "comment": null}, "platform_endpoint": {"type": "integer", "index": 17, "name": "platform_endpoint", "comment": null}, "push_message": {"type": "integer", "index": 18, "name": "push_message", "comment": null}, "region": {"type": "text", "index": 19, "name": "region", "comment": null}, "sms_message": {"type": "integer", "index": 20, "name": "sms_message", "comment": null}, "sound": {"type": "integer", "index": 21, "name": "sound", "comment": null}, "to_phone_number": {"type": "integer", "index": 22, "name": "to_phone_number", "comment": null}, "url": {"type": "integer", "index": 23, "name": "url", "comment": null}, "workflow_id": {"type": "integer", "index": 24, "name": "workflow_id", "comment": null}, "workflow_name": {"type": "text", "index": 25, "name": "workflow_name", "comment": null}, "locale": {"type": "integer", "index": 26, "name": "locale", "comment": null}, "deeplink_android": {"type": "integer", "index": 27, "name": "deeplink_android", "comment": null}, "deeplink_ios": {"type": "integer", "index": 28, "name": "deeplink_ios", "comment": null}, "payload": {"type": "character varying(100)", "index": 29, "name": "payload", "comment": null}, "sms_provider_response_status": {"type": "integer", "index": 30, "name": "sms_provider_response_status", "comment": null}, "sms_provider_response_message": {"type": "integer", "index": 31, "name": "sms_provider_response_message", "comment": null}, "sms_provider_response_code": {"type": "integer", "index": 32, "name": "sms_provider_response_code", "comment": null}, "sms_provider_response_more_info": {"type": "integer", "index": 33, "name": "sms_provider_response_more_info", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 34, "name": "_fivetran_synced", "comment": null}, "catalog_collection_count": {"type": "integer", "index": 35, "name": "catalog_collection_count", "comment": null}, "catalog_lookup_count": {"type": "integer", "index": 36, "name": "catalog_lookup_count", "comment": null}, "city": {"type": "text", "index": 37, "name": "city", "comment": null}, "clicked_url": {"type": "text", "index": 38, "name": "clicked_url", "comment": null}, "country": {"type": "text", "index": 39, "name": "country", "comment": null}, "error_code": {"type": "integer", "index": 40, "name": "error_code", "comment": null}, "expires_at": {"type": "text", "index": 41, "name": "expires_at", "comment": null}, "from_phone_number": {"type": "integer", "index": 42, "name": "from_phone_number", "comment": null}, "in_app_body": {"type": "text", "index": 43, "name": "in_app_body", "comment": null}, "is_sms_estimation": {"type": "boolean", "index": 44, "name": "is_sms_estimation", "comment": null}, "labels": {"type": "text", "index": 45, "name": "labels", "comment": null}, "message_context": {"type": "text", "index": 46, "name": "message_context", "comment": null}, "message_status": {"type": "text", "index": 47, "name": "message_status", "comment": null}, "mms_send_count": {"type": "integer", "index": 48, "name": "mms_send_count", "comment": null}, "product_recommendation_count": {"type": "integer", "index": 49, "name": "product_recommendation_count", "comment": null}, "proxy_source": {"type": "text", "index": 50, "name": "proxy_source", "comment": null}, "reason": {"type": "text", "index": 51, "name": "reason", "comment": null}, "sms_send_count": {"type": "integer", "index": 52, "name": "sms_send_count", "comment": null}, "web_push_body": {"type": "text", "index": 53, "name": "web_push_body", "comment": null}, "web_push_click_action": {"type": "text", "index": 54, "name": "web_push_click_action", "comment": null}, "web_push_icon": {"type": "text", "index": 55, "name": "web_push_icon", "comment": null}, "web_push_message": {"type": "text", "index": 56, "name": "web_push_message", "comment": null}, "_fivetran_user_id": {"type": "integer", "index": 57, "name": "_fivetran_user_id", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.stg_iterable__event_extension_tmp"}, "model.iterable.stg_iterable__event_tmp": {"metadata": {"type": "VIEW", "schema": "public_iterable_dev", "name": "stg_iterable__event_tmp", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"_fivetran_id": {"type": "text", "index": 1, "name": "_fivetran_id", "comment": null}, "email": {"type": "text", "index": 2, "name": "email", "comment": null}, "campaign_id": {"type": "integer", "index": 3, "name": "campaign_id", "comment": null}, "message_id": {"type": "integer", "index": 4, "name": "message_id", "comment": null}, "content_id": {"type": "integer", "index": 5, "name": "content_id", "comment": null}, "created_at": {"type": "timestamp without time zone", "index": 6, "name": "created_at", "comment": null}, "event_name": {"type": "text", "index": 7, "name": "event_name", "comment": null}, "ip": {"type": "integer", "index": 8, "name": "ip", "comment": null}, "message_bus_id": {"type": "integer", "index": 9, "name": "message_bus_id", "comment": null}, "message_type_id": {"type": "integer", "index": 10, "name": "message_type_id", "comment": null}, "recipient_state": {"type": "integer", "index": 11, "name": "recipient_state", "comment": null}, "status": {"type": "integer", "index": 12, "name": "status", "comment": null}, "unsub_source": {"type": "integer", "index": 13, "name": "unsub_source", "comment": null}, "user_agent": {"type": "integer", "index": 14, "name": "user_agent", "comment": null}, "user_agent_device": {"type": "integer", "index": 15, "name": "user_agent_device", "comment": null}, "transactional_data": {"type": "character varying(100)", "index": 16, "name": "transactional_data", "comment": null}, "additional_properties": {"type": "text", "index": 17, "name": "additional_properties", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 18, "name": "_fivetran_synced", "comment": null}, "_fivetran_user_id": {"type": "integer", "index": 19, "name": "_fivetran_user_id", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.stg_iterable__event_tmp"}, "model.iterable.stg_iterable__journey": {"metadata": {"type": "BASE TABLE", "schema": "public_iterable_dev", "name": "stg_iterable__journey", "database": "postgres", "comment": "Table containing unique journeys, formerly known as workflows.", "owner": "postgres"}, "columns": {"source_relation": {"type": "text", "index": 1, "name": "source_relation", "comment": "Identifies the record's source."}, "journey_id": {"type": "text", "index": 2, "name": "journey_id", "comment": "Unique identifier of the journey"}, "journey_name": {"type": "text", "index": 3, "name": "journey_name", "comment": "User defined name of the journey"}, "journey_type": {"type": "text", "index": 4, "name": "journey_type", "comment": "The journey type"}, "journey_description": {"type": "text", "index": 5, "name": "journey_description", "comment": "Information about the journey"}, "creator_user_id": {"type": "text", "index": 6, "name": "creator_user_id", "comment": "Reference to the user who created the journey"}, "is_enabled": {"type": "boolean", "index": 7, "name": "is_enabled", "comment": "Boolean indicating if the journey is currently enabled"}, "is_archived": {"type": "boolean", "index": 8, "name": "is_archived", "comment": "Boolean indicating if the journey has been archived"}, "lifetime_limit": {"type": "bigint", "index": 9, "name": "lifetime_limit", "comment": "Maximum number of times a user may enter the journey over their lifetime"}, "simultaneous_limit": {"type": "bigint", "index": 10, "name": "simultaneous_limit", "comment": "Maximum number of times a user may be in the journey at the same time"}, "start_tile_id": {"type": "text", "index": 11, "name": "start_tile_id", "comment": "Reference to the tile which begins the journey"}, "trigger_event_names": {"type": "text", "index": 12, "name": "trigger_event_names", "comment": "The event names which trigger a user's entry into the journey"}, "created_at": {"type": "timestamp without time zone", "index": 13, "name": "created_at", "comment": "Creation timestamp"}, "updated_at": {"type": "timestamp without time zone", "index": 14, "name": "updated_at", "comment": "Last update timestamp"}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 15, "name": "_fivetran_synced", "comment": "The time when a record was last updated by Fivetran."}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.stg_iterable__journey"}, "model.iterable.stg_iterable__journey_tmp": {"metadata": {"type": "VIEW", "schema": "public_iterable_dev", "name": "stg_iterable__journey_tmp", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"id": {"type": "bigint", "index": 1, "name": "id", "comment": null}, "name": {"type": "text", "index": 2, "name": "name", "comment": null}, "journey_type": {"type": "text", "index": 3, "name": "journey_type", "comment": null}, "description": {"type": "text", "index": 4, "name": "description", "comment": null}, "creator_user_id": {"type": "text", "index": 5, "name": "creator_user_id", "comment": null}, "enabled": {"type": "boolean", "index": 6, "name": "enabled", "comment": null}, "is_archived": {"type": "boolean", "index": 7, "name": "is_archived", "comment": null}, "lifetime_limit": {"type": "bigint", "index": 8, "name": "lifetime_limit", "comment": null}, "simultaneous_limit": {"type": "bigint", "index": 9, "name": "simultaneous_limit", "comment": null}, "start_tile_id": {"type": "bigint", "index": 10, "name": "start_tile_id", "comment": null}, "trigger_event_names": {"type": "text", "index": 11, "name": "trigger_event_names", "comment": null}, "created_at": {"type": "timestamp without time zone", "index": 12, "name": "created_at", "comment": null}, "updated_at": {"type": "timestamp without time zone", "index": 13, "name": "updated_at", "comment": null}, "_fivetran_deleted": {"type": "boolean", "index": 14, "name": "_fivetran_deleted", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 15, "name": "_fivetran_synced", "comment": null}, "draft_name": {"type": "text", "index": 16, "name": "draft_name", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.stg_iterable__journey_tmp"}, "model.iterable.stg_iterable__list": {"metadata": {"type": "BASE TABLE", "schema": "public_iterable_dev", "name": "stg_iterable__list", "database": "postgres", "comment": "Table containing users and the lists the users are associated with.", "owner": "postgres"}, "columns": {"source_relation": {"type": "text", "index": 1, "name": "source_relation", "comment": "Identifies the record's source."}, "list_id": {"type": "integer", "index": 2, "name": "list_id", "comment": "Unique identifier of the list"}, "list_name": {"type": "text", "index": 3, "name": "list_name", "comment": "User defined name of the list"}, "list_type": {"type": "text", "index": 4, "name": "list_type", "comment": "The list type"}, "created_at": {"type": "text", "index": 5, "name": "created_at", "comment": "Creation timestamp"}, "list_description": {"type": "text", "index": 6, "name": "list_description", "comment": "Information about the list"}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 7, "name": "_fivetran_synced", "comment": "The time when a record was last updated by Fivetran."}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.stg_iterable__list"}, "model.iterable.stg_iterable__list_tmp": {"metadata": {"type": "VIEW", "schema": "public_iterable_dev", "name": "stg_iterable__list_tmp", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"id": {"type": "integer", "index": 1, "name": "id", "comment": null}, "name": {"type": "text", "index": 2, "name": "name", "comment": null}, "created_at": {"type": "text", "index": 3, "name": "created_at", "comment": null}, "list_type": {"type": "text", "index": 4, "name": "list_type", "comment": null}, "_fivetran_deleted": {"type": "boolean", "index": 5, "name": "_fivetran_deleted", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 6, "name": "_fivetran_synced", "comment": null}, "description": {"type": "text", "index": 7, "name": "description", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.stg_iterable__list_tmp"}, "model.iterable.stg_iterable__list_user": {"metadata": {"type": "BASE TABLE", "schema": "public_iterable_dev", "name": "stg_iterable__list_user", "database": "postgres", "comment": "Table containing the relationship between users and lists they belong to.", "owner": "postgres"}, "columns": {"source_relation": {"type": "text", "index": 1, "name": "source_relation", "comment": "Identifies the record's source."}, "_fivetran_user_id": {"type": "text", "index": 2, "name": "_fivetran_user_id", "comment": "Unique identifier of the list-user relationship record, serving as a foreign key to `stg_iterable__user_history._fivetran_id`."}, "list_user_index": {"type": "bigint", "index": 3, "name": "list_user_index", "comment": "Index of the record"}, "list_id": {"type": "bigint", "index": 4, "name": "list_id", "comment": "Reference to the list that the user belongs to"}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 5, "name": "_fivetran_synced", "comment": "The time when a record was last updated by Fivetran."}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.stg_iterable__list_user"}, "model.iterable.stg_iterable__list_user_tmp": {"metadata": {"type": "VIEW", "schema": "public_iterable_dev", "name": "stg_iterable__list_user_tmp", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"_fivetran_id": {"type": "text", "index": 1, "name": "_fivetran_id", "comment": null}, "index": {"type": "bigint", "index": 2, "name": "index", "comment": null}, "list_id": {"type": "bigint", "index": 3, "name": "list_id", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 4, "name": "_fivetran_synced", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.stg_iterable__list_user_tmp"}, "model.iterable.stg_iterable__message_type": {"metadata": {"type": "BASE TABLE", "schema": "public_iterable_dev", "name": "stg_iterable__message_type", "database": "postgres", "comment": "Table containing unique message types.", "owner": "postgres"}, "columns": {"source_relation": {"type": "text", "index": 1, "name": "source_relation", "comment": "Identifies the record's source."}, "message_type_id": {"type": "text", "index": 2, "name": "message_type_id", "comment": "Unique identifier of the message type"}, "message_type_name": {"type": "text", "index": 3, "name": "message_type_name", "comment": "User defined name of the message type"}, "channel_id": {"type": "text", "index": 4, "name": "channel_id", "comment": "Channel that this message type belongs to"}, "message_type_created_at": {"type": "timestamp without time zone", "index": 5, "name": "message_type_created_at", "comment": "Time when the message type was initially created"}, "frequency_cap": {"type": "integer", "index": 6, "name": "frequency_cap", "comment": "The maximum number of times a message of this type can be sent to a recipient within a specified time period to prevent over-messaging"}, "rate_limit_per_minute": {"type": "integer", "index": 7, "name": "rate_limit_per_minute", "comment": "The maximum number of messages of this type that can be sent to recipients in a minute, ensuring controlled message delivery"}, "subscription_policy": {"type": "text", "index": 8, "name": "subscription_policy", "comment": "Information about the policy or rules governing how users can subscribe to or unsubscribe from this specific message type, like OptOut"}, "message_type_updated_at": {"type": "timestamp without time zone", "index": 9, "name": "message_type_updated_at", "comment": "Time when the message type was last updated or modified"}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 10, "name": "_fivetran_synced", "comment": "The time when a record was last updated by Fivetran."}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.stg_iterable__message_type"}, "model.iterable.stg_iterable__message_type_tmp": {"metadata": {"type": "VIEW", "schema": "public_iterable_dev", "name": "stg_iterable__message_type_tmp", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"id": {"type": "bigint", "index": 1, "name": "id", "comment": null}, "name": {"type": "text", "index": 2, "name": "name", "comment": null}, "channel_id": {"type": "bigint", "index": 3, "name": "channel_id", "comment": null}, "_fivetran_deleted": {"type": "boolean", "index": 4, "name": "_fivetran_deleted", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 5, "name": "_fivetran_synced", "comment": null}, "created_at": {"type": "timestamp without time zone", "index": 6, "name": "created_at", "comment": null}, "frequency_cap": {"type": "integer", "index": 7, "name": "frequency_cap", "comment": null}, "rate_limit_per_minute": {"type": "integer", "index": 8, "name": "rate_limit_per_minute", "comment": null}, "subscription_policy": {"type": "text", "index": 9, "name": "subscription_policy", "comment": null}, "updated_at": {"type": "timestamp without time zone", "index": 10, "name": "updated_at", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.stg_iterable__message_type_tmp"}, "model.iterable.stg_iterable__template_history": {"metadata": {"type": "BASE TABLE", "schema": "public_iterable_dev", "name": "stg_iterable__template_history", "database": "postgres", "comment": "Table containing unique templates used across campaigns.", "owner": "postgres"}, "columns": {"source_relation": {"type": "text", "index": 1, "name": "source_relation", "comment": "Identifies the record's source."}, "template_id": {"type": "text", "index": 2, "name": "template_id", "comment": "Unique identifier of the template"}, "template_name": {"type": "text", "index": 3, "name": "template_name", "comment": "User defined name of the template"}, "template_type": {"type": "text", "index": 4, "name": "template_type", "comment": "The type of the template"}, "created_at": {"type": "text", "index": 5, "name": "created_at", "comment": "Creation timestamp"}, "client_template_id": {"type": "text", "index": 6, "name": "client_template_id", "comment": "Reference to the client template"}, "creator_user_id": {"type": "text", "index": 7, "name": "creator_user_id", "comment": "Reference to the user who created the template"}, "message_type_id": {"type": "text", "index": 8, "name": "message_type_id", "comment": "Reference to the message type associated with the template"}, "updated_at": {"type": "text", "index": 9, "name": "updated_at", "comment": "Last update timestamp"}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 10, "name": "_fivetran_synced", "comment": "The time when a record was last updated by Fivetran."}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.stg_iterable__template_history"}, "model.iterable.stg_iterable__template_history_tmp": {"metadata": {"type": "VIEW", "schema": "public_iterable_dev", "name": "stg_iterable__template_history_tmp", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"id": {"type": "integer", "index": 1, "name": "id", "comment": null}, "updated_at": {"type": "text", "index": 2, "name": "updated_at", "comment": null}, "message_type_id": {"type": "integer", "index": 3, "name": "message_type_id", "comment": null}, "client_template_id": {"type": "integer", "index": 4, "name": "client_template_id", "comment": null}, "created_at": {"type": "text", "index": 5, "name": "created_at", "comment": null}, "creator_user_id": {"type": "text", "index": 6, "name": "creator_user_id", "comment": null}, "name": {"type": "text", "index": 7, "name": "name", "comment": null}, "template_type": {"type": "text", "index": 8, "name": "template_type", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 9, "name": "_fivetran_synced", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.stg_iterable__template_history_tmp"}, "model.iterable.stg_iterable__user_history": {"metadata": {"type": "VIEW", "schema": "public_iterable_dev", "name": "stg_iterable__user_history", "database": "postgres", "comment": "Table containing individual user history information.", "owner": "postgres"}, "columns": {"source_relation": {"type": "text", "index": 1, "name": "source_relation", "comment": "Identifies the record's source."}, "_fivetran_user_id": {"type": "text", "index": 2, "name": "_fivetran_user_id", "comment": "A Fivetran-created unique identifier for users, derived from hashing user_id and/or email, depending on project type. This exists for users of the new schema starting Aug 2023. In the old schema, the unique identifier is email."}, "email": {"type": "text", "index": 3, "name": "email", "comment": "The user's email. User identifier, for email-based projects. Previously was the unique identifier for user records, for the old Iterable schema before the August 2023 updates."}, "updated_at": {"type": "timestamp without time zone", "index": 4, "name": "updated_at", "comment": "Last update timestamp"}, "user_id": {"type": "text", "index": 5, "name": "user_id", "comment": "User identifier, for userID-based projects."}, "first_name": {"type": "integer", "index": 6, "name": "first_name", "comment": "First name of the user"}, "last_name": {"type": "integer", "index": 7, "name": "last_name", "comment": "Last name of the user"}, "email_list_ids": {"type": "text", "index": 8, "name": "email_list_ids", "comment": "[DEPRECATED October 13, 2025. Use LIST_USER source instead.] Array of references to the lists associated with the user.\n"}, "phone_number": {"type": "integer", "index": 9, "name": "phone_number", "comment": "Phone number associated with the user"}, "signup_date": {"type": "text", "index": 10, "name": "signup_date", "comment": "Timestamp of when the user signed up"}, "signup_source": {"type": "text", "index": 11, "name": "signup_source", "comment": "Source where the user signed up"}, "iterable_user_id": {"type": "text", "index": 12, "name": "iterable_user_id", "comment": "Another user identifier, for userID-based projects"}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 13, "name": "_fivetran_synced", "comment": "The time when a record was last updated by Fivetran."}, "unique_user_key": {"type": "text", "index": 14, "name": "unique_user_key", "comment": "The unique identifier of the user. With the new schema (Aug 2023), it is the _fivetran_user_id. This is a hash of user_id and/or email, depending on project type. If using the old schema, it is email."}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.stg_iterable__user_history"}, "model.iterable.stg_iterable__user_history_tmp": {"metadata": {"type": "VIEW", "schema": "public_iterable_dev", "name": "stg_iterable__user_history_tmp", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"email": {"type": "text", "index": 1, "name": "email", "comment": null}, "updated_at": {"type": "timestamp without time zone", "index": 2, "name": "updated_at", "comment": null}, "first_name": {"type": "integer", "index": 3, "name": "first_name", "comment": null}, "last_name": {"type": "integer", "index": 4, "name": "last_name", "comment": null}, "phone_number": {"type": "integer", "index": 5, "name": "phone_number", "comment": null}, "user_id": {"type": "integer", "index": 6, "name": "user_id", "comment": null}, "signup_date": {"type": "text", "index": 7, "name": "signup_date", "comment": null}, "signup_source": {"type": "text", "index": 8, "name": "signup_source", "comment": null}, "phone_number_carrier": {"type": "integer", "index": 9, "name": "phone_number_carrier", "comment": null}, "phone_number_country_code_iso": {"type": "integer", "index": 10, "name": "phone_number_country_code_iso", "comment": null}, "phone_number_line_type": {"type": "integer", "index": 11, "name": "phone_number_line_type", "comment": null}, "phone_number_updated_at": {"type": "integer", "index": 12, "name": "phone_number_updated_at", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 13, "name": "_fivetran_synced", "comment": null}, "email_list_ids": {"type": "text", "index": 14, "name": "email_list_ids", "comment": null}, "iterable_user_id": {"type": "integer", "index": 15, "name": "iterable_user_id", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.stg_iterable__user_history_tmp"}, "model.iterable.stg_iterable__user_unsub_message_type": {"metadata": {"type": "BASE TABLE", "schema": "public_iterable_dev", "name": "stg_iterable__user_unsub_message_type", "database": "postgres", "comment": "Table containing the message types from which a user has unsubscribed. \"Unsubscribed\" is shortened to \"unsub\" for postgres compatibility.", "owner": "postgres"}, "columns": {"source_relation": {"type": "text", "index": 1, "name": "source_relation", "comment": "Identifies the record's source."}, "_fivetran_user_id": {"type": "text", "index": 2, "name": "_fivetran_user_id", "comment": "A Fivetran-created unique identifier for users, derived from hashing user_id and/or email, depending on project type. This exists for users of the new schema starting Aug 2023. In the old schema, the unique identifier is email."}, "unique_user_key": {"type": "text", "index": 3, "name": "unique_user_key", "comment": "The unique identifier of the user. With the new schema (Aug 2023), it is the _fivetran_user_id. This is a hash of user_id and/or email, depending on project type. If using the old schema, it is email."}, "message_type_id": {"type": "text", "index": 4, "name": "message_type_id", "comment": "Reference to the message type from which the user unsubscribed"}, "unsub_message_type_unique_key": {"type": "text", "index": 5, "name": "unsub_message_type_unique_key", "comment": "A surrogate key providing a unique key for each record. If using user_unsubscribed_message_type_history, it uses '_fivetran_id', 'email', 'message_type_id', 'updated_at', and 'source_relation'. If not using the history table, it uses '_fivetran_id', 'message_type_id', and 'source_relation'."}, "latest_batch_index": {"type": "integer", "index": 6, "name": "latest_batch_index", "comment": "Indexes each user record based on the most recent available."}, "updated_at": {"type": "timestamp without time zone", "index": 7, "name": "updated_at", "comment": "Last update timestamp"}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 8, "name": "_fivetran_synced", "comment": "The time when a record was last updated by Fivetran."}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.stg_iterable__user_unsub_message_type"}, "model.iterable.stg_iterable__user_unsub_message_type_tmp": {"metadata": {"type": "VIEW", "schema": "public_iterable_dev", "name": "stg_iterable__user_unsub_message_type_tmp", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"_fivetran_id": {"type": "text", "index": 1, "name": "_fivetran_id", "comment": null}, "message_type_id": {"type": "integer", "index": 2, "name": "message_type_id", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 3, "name": "_fivetran_synced", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.stg_iterable__user_unsub_message_type_tmp"}, "model.iterable.stg_iterable__user_unsubscribed_channel": {"metadata": {"type": "BASE TABLE", "schema": "public_iterable_dev", "name": "stg_iterable__user_unsubscribed_channel", "database": "postgres", "comment": "Table containing the history of channels from which a user has unsubscribed.", "owner": "postgres"}, "columns": {"source_relation": {"type": "text", "index": 1, "name": "source_relation", "comment": "Identifies the record's source."}, "_fivetran_user_id": {"type": "text", "index": 2, "name": "_fivetran_user_id", "comment": "A Fivetran-created unique identifier for users, derived from hashing user_id and/or email, depending on project type. This exists for users of the new schema starting Aug 2023. In the old schema, the unique identifier is email."}, "unique_user_key": {"type": "text", "index": 3, "name": "unique_user_key", "comment": "The unique identifier of the user. With the new schema (Aug 2023), it is the _fivetran_user_id. This is a hash of user_id and/or email, depending on project type. If using the old schema, it is email."}, "channel_id": {"type": "text", "index": 4, "name": "channel_id", "comment": "Reference to the channel from which the user unsubscribed"}, "unsub_channel_unique_key": {"type": "text", "index": 5, "name": "unsub_channel_unique_key", "comment": "A surrogate key providing a unique key for each record. If using user_unsubscribed_channel_history, it uses '_fivetran_id', 'channel_id', 'email', 'updated_at', and 'source_relation'. If not using the history table, it uses '_fivetran_id', 'channel_id', and 'source_relation'."}, "latest_batch_index": {"type": "integer", "index": 6, "name": "latest_batch_index", "comment": "Indexes each user record based on the most recent available."}, "updated_at": {"type": "timestamp without time zone", "index": 7, "name": "updated_at", "comment": "Last update timestamp"}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 8, "name": "_fivetran_synced", "comment": "The time when a record was last updated by Fivetran."}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.stg_iterable__user_unsubscribed_channel"}, "model.iterable.stg_iterable__user_unsubscribed_channel_tmp": {"metadata": {"type": "VIEW", "schema": "public_iterable_dev", "name": "stg_iterable__user_unsubscribed_channel_tmp", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"_fivetran_id": {"type": "text", "index": 1, "name": "_fivetran_id", "comment": null}, "channel_id": {"type": "integer", "index": 2, "name": "channel_id", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 3, "name": "_fivetran_synced", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.stg_iterable__user_unsubscribed_channel_tmp"}}, "sources": {"source.iterable.iterable.campaign_history": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "campaign_history_data", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"id": {"type": "integer", "index": 1, "name": "id", "comment": null}, "updated_at": {"type": "text", "index": 2, "name": "updated_at", "comment": null}, "template_id": {"type": "integer", "index": 3, "name": "template_id", "comment": null}, "recurring_campaign_id": {"type": "integer", "index": 4, "name": "recurring_campaign_id", "comment": null}, "campaign_state": {"type": "text", "index": 5, "name": "campaign_state", "comment": null}, "created_at": {"type": "text", "index": 6, "name": "created_at", "comment": null}, "created_by_user_id": {"type": "text", "index": 7, "name": "created_by_user_id", "comment": null}, "ended_at": {"type": "integer", "index": 8, "name": "ended_at", "comment": null}, "name": {"type": "text", "index": 9, "name": "name", "comment": null}, "send_size": {"type": "integer", "index": 10, "name": "send_size", "comment": null}, "start_at": {"type": "integer", "index": 11, "name": "start_at", "comment": null}, "type": {"type": "text", "index": 12, "name": "type", "comment": null}, "workflow_id": {"type": "integer", "index": 13, "name": "workflow_id", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 14, "name": "_fivetran_synced", "comment": null}, "updated_by_user_id": {"type": "integer", "index": 15, "name": "updated_by_user_id", "comment": null}, "message_medium": {"type": "text", "index": 16, "name": "message_medium", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.iterable.iterable.campaign_history"}, "source.iterable.iterable.campaign_label_history": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "campaign_label_history_data", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"campaign_id": {"type": "integer", "index": 1, "name": "campaign_id", "comment": null}, "label": {"type": "text", "index": 2, "name": "label", "comment": null}, "updated_at": {"type": "text", "index": 3, "name": "updated_at", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 4, "name": "_fivetran_synced", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.iterable.iterable.campaign_label_history"}, "source.iterable.iterable.campaign_list_history": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "campaign_list_history_data", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"list_id": {"type": "integer", "index": 1, "name": "list_id", "comment": null}, "campaign_id": {"type": "integer", "index": 2, "name": "campaign_id", "comment": null}, "updated_at": {"type": "text", "index": 3, "name": "updated_at", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 4, "name": "_fivetran_synced", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.iterable.iterable.campaign_list_history"}, "source.iterable.iterable.campaign_suppression_list_history": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "campaign_suppression_list_history_data", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"suppressed_list_id": {"type": "integer", "index": 1, "name": "suppressed_list_id", "comment": null}, "campaign_id": {"type": "integer", "index": 2, "name": "campaign_id", "comment": null}, "updated_at": {"type": "text", "index": 3, "name": "updated_at", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 4, "name": "_fivetran_synced", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.iterable.iterable.campaign_suppression_list_history"}, "source.iterable.iterable.channel": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "channel_data", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"id": {"type": "bigint", "index": 1, "name": "id", "comment": null}, "name": {"type": "text", "index": 2, "name": "name", "comment": null}, "channel_type": {"type": "text", "index": 3, "name": "channel_type", "comment": null}, "message_medium": {"type": "text", "index": 4, "name": "message_medium", "comment": null}, "_fivetran_deleted": {"type": "boolean", "index": 5, "name": "_fivetran_deleted", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 6, "name": "_fivetran_synced", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.iterable.iterable.channel"}, "source.iterable.iterable.event": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "event_data", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"_fivetran_id": {"type": "text", "index": 1, "name": "_fivetran_id", "comment": null}, "email": {"type": "text", "index": 2, "name": "email", "comment": null}, "campaign_id": {"type": "integer", "index": 3, "name": "campaign_id", "comment": null}, "message_id": {"type": "integer", "index": 4, "name": "message_id", "comment": null}, "content_id": {"type": "integer", "index": 5, "name": "content_id", "comment": null}, "created_at": {"type": "timestamp without time zone", "index": 6, "name": "created_at", "comment": null}, "event_name": {"type": "text", "index": 7, "name": "event_name", "comment": null}, "ip": {"type": "integer", "index": 8, "name": "ip", "comment": null}, "message_bus_id": {"type": "integer", "index": 9, "name": "message_bus_id", "comment": null}, "message_type_id": {"type": "integer", "index": 10, "name": "message_type_id", "comment": null}, "recipient_state": {"type": "integer", "index": 11, "name": "recipient_state", "comment": null}, "status": {"type": "integer", "index": 12, "name": "status", "comment": null}, "unsub_source": {"type": "integer", "index": 13, "name": "unsub_source", "comment": null}, "user_agent": {"type": "integer", "index": 14, "name": "user_agent", "comment": null}, "user_agent_device": {"type": "integer", "index": 15, "name": "user_agent_device", "comment": null}, "transactional_data": {"type": "character varying(100)", "index": 16, "name": "transactional_data", "comment": null}, "additional_properties": {"type": "text", "index": 17, "name": "additional_properties", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 18, "name": "_fivetran_synced", "comment": null}, "_fivetran_user_id": {"type": "integer", "index": 19, "name": "_fivetran_user_id", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.iterable.iterable.event"}, "source.iterable.iterable.event_extension": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "event_extension_data", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"_fivetran_id": {"type": "text", "index": 1, "name": "_fivetran_id", "comment": null}, "app_already_running": {"type": "integer", "index": 2, "name": "app_already_running", "comment": null}, "badge": {"type": "integer", "index": 3, "name": "badge", "comment": null}, "canonical_url_id": {"type": "integer", "index": 4, "name": "canonical_url_id", "comment": null}, "content_available": {"type": "integer", "index": 5, "name": "content_available", "comment": null}, "content_id": {"type": "integer", "index": 6, "name": "content_id", "comment": null}, "device": {"type": "integer", "index": 7, "name": "device", "comment": null}, "email_id": {"type": "text", "index": 8, "name": "email_id", "comment": null}, "email_subject": {"type": "text", "index": 9, "name": "email_subject", "comment": null}, "experiment_id": {"type": "integer", "index": 10, "name": "experiment_id", "comment": null}, "from_phone_number_id": {"type": "integer", "index": 11, "name": "from_phone_number_id", "comment": null}, "from_smssender_id": {"type": "integer", "index": 12, "name": "from_smssender_id", "comment": null}, "image_url": {"type": "integer", "index": 13, "name": "image_url", "comment": null}, "is_ghost_push": {"type": "integer", "index": 14, "name": "is_ghost_push", "comment": null}, "link_id": {"type": "integer", "index": 15, "name": "link_id", "comment": null}, "link_url": {"type": "integer", "index": 16, "name": "link_url", "comment": null}, "platform_endpoint": {"type": "integer", "index": 17, "name": "platform_endpoint", "comment": null}, "push_message": {"type": "integer", "index": 18, "name": "push_message", "comment": null}, "region": {"type": "text", "index": 19, "name": "region", "comment": null}, "sms_message": {"type": "integer", "index": 20, "name": "sms_message", "comment": null}, "sound": {"type": "integer", "index": 21, "name": "sound", "comment": null}, "to_phone_number": {"type": "integer", "index": 22, "name": "to_phone_number", "comment": null}, "url": {"type": "integer", "index": 23, "name": "url", "comment": null}, "workflow_id": {"type": "integer", "index": 24, "name": "workflow_id", "comment": null}, "workflow_name": {"type": "text", "index": 25, "name": "workflow_name", "comment": null}, "locale": {"type": "integer", "index": 26, "name": "locale", "comment": null}, "deeplink_android": {"type": "integer", "index": 27, "name": "deeplink_android", "comment": null}, "deeplink_ios": {"type": "integer", "index": 28, "name": "deeplink_ios", "comment": null}, "payload": {"type": "character varying(100)", "index": 29, "name": "payload", "comment": null}, "sms_provider_response_status": {"type": "integer", "index": 30, "name": "sms_provider_response_status", "comment": null}, "sms_provider_response_message": {"type": "integer", "index": 31, "name": "sms_provider_response_message", "comment": null}, "sms_provider_response_code": {"type": "integer", "index": 32, "name": "sms_provider_response_code", "comment": null}, "sms_provider_response_more_info": {"type": "integer", "index": 33, "name": "sms_provider_response_more_info", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 34, "name": "_fivetran_synced", "comment": null}, "catalog_collection_count": {"type": "integer", "index": 35, "name": "catalog_collection_count", "comment": null}, "catalog_lookup_count": {"type": "integer", "index": 36, "name": "catalog_lookup_count", "comment": null}, "city": {"type": "text", "index": 37, "name": "city", "comment": null}, "clicked_url": {"type": "text", "index": 38, "name": "clicked_url", "comment": null}, "country": {"type": "text", "index": 39, "name": "country", "comment": null}, "error_code": {"type": "integer", "index": 40, "name": "error_code", "comment": null}, "expires_at": {"type": "text", "index": 41, "name": "expires_at", "comment": null}, "from_phone_number": {"type": "integer", "index": 42, "name": "from_phone_number", "comment": null}, "in_app_body": {"type": "text", "index": 43, "name": "in_app_body", "comment": null}, "is_sms_estimation": {"type": "boolean", "index": 44, "name": "is_sms_estimation", "comment": null}, "labels": {"type": "text", "index": 45, "name": "labels", "comment": null}, "message_context": {"type": "text", "index": 46, "name": "message_context", "comment": null}, "message_status": {"type": "text", "index": 47, "name": "message_status", "comment": null}, "mms_send_count": {"type": "integer", "index": 48, "name": "mms_send_count", "comment": null}, "product_recommendation_count": {"type": "integer", "index": 49, "name": "product_recommendation_count", "comment": null}, "proxy_source": {"type": "text", "index": 50, "name": "proxy_source", "comment": null}, "reason": {"type": "text", "index": 51, "name": "reason", "comment": null}, "sms_send_count": {"type": "integer", "index": 52, "name": "sms_send_count", "comment": null}, "web_push_body": {"type": "text", "index": 53, "name": "web_push_body", "comment": null}, "web_push_click_action": {"type": "text", "index": 54, "name": "web_push_click_action", "comment": null}, "web_push_icon": {"type": "text", "index": 55, "name": "web_push_icon", "comment": null}, "web_push_message": {"type": "text", "index": 56, "name": "web_push_message", "comment": null}, "_fivetran_user_id": {"type": "integer", "index": 57, "name": "_fivetran_user_id", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.iterable.iterable.event_extension"}, "source.iterable.iterable.journey": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "journey_data", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"id": {"type": "bigint", "index": 1, "name": "id", "comment": null}, "name": {"type": "text", "index": 2, "name": "name", "comment": null}, "journey_type": {"type": "text", "index": 3, "name": "journey_type", "comment": null}, "description": {"type": "text", "index": 4, "name": "description", "comment": null}, "creator_user_id": {"type": "text", "index": 5, "name": "creator_user_id", "comment": null}, "enabled": {"type": "boolean", "index": 6, "name": "enabled", "comment": null}, "is_archived": {"type": "boolean", "index": 7, "name": "is_archived", "comment": null}, "lifetime_limit": {"type": "bigint", "index": 8, "name": "lifetime_limit", "comment": null}, "simultaneous_limit": {"type": "bigint", "index": 9, "name": "simultaneous_limit", "comment": null}, "start_tile_id": {"type": "bigint", "index": 10, "name": "start_tile_id", "comment": null}, "trigger_event_names": {"type": "text", "index": 11, "name": "trigger_event_names", "comment": null}, "created_at": {"type": "timestamp without time zone", "index": 12, "name": "created_at", "comment": null}, "updated_at": {"type": "timestamp without time zone", "index": 13, "name": "updated_at", "comment": null}, "_fivetran_deleted": {"type": "boolean", "index": 14, "name": "_fivetran_deleted", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 15, "name": "_fivetran_synced", "comment": null}, "draft_name": {"type": "text", "index": 16, "name": "draft_name", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.iterable.iterable.journey"}, "source.iterable.iterable.list": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "list_data", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"id": {"type": "integer", "index": 1, "name": "id", "comment": null}, "name": {"type": "text", "index": 2, "name": "name", "comment": null}, "created_at": {"type": "text", "index": 3, "name": "created_at", "comment": null}, "list_type": {"type": "text", "index": 4, "name": "list_type", "comment": null}, "_fivetran_deleted": {"type": "boolean", "index": 5, "name": "_fivetran_deleted", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 6, "name": "_fivetran_synced", "comment": null}, "description": {"type": "text", "index": 7, "name": "description", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.iterable.iterable.list"}, "source.iterable.iterable.list_user": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "list_user_data", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"_fivetran_id": {"type": "text", "index": 1, "name": "_fivetran_id", "comment": null}, "index": {"type": "bigint", "index": 2, "name": "index", "comment": null}, "list_id": {"type": "bigint", "index": 3, "name": "list_id", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 4, "name": "_fivetran_synced", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.iterable.iterable.list_user"}, "source.iterable.iterable.message_type": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "message_type_data", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"id": {"type": "bigint", "index": 1, "name": "id", "comment": null}, "name": {"type": "text", "index": 2, "name": "name", "comment": null}, "channel_id": {"type": "bigint", "index": 3, "name": "channel_id", "comment": null}, "_fivetran_deleted": {"type": "boolean", "index": 4, "name": "_fivetran_deleted", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 5, "name": "_fivetran_synced", "comment": null}, "created_at": {"type": "timestamp without time zone", "index": 6, "name": "created_at", "comment": null}, "frequency_cap": {"type": "integer", "index": 7, "name": "frequency_cap", "comment": null}, "rate_limit_per_minute": {"type": "integer", "index": 8, "name": "rate_limit_per_minute", "comment": null}, "subscription_policy": {"type": "text", "index": 9, "name": "subscription_policy", "comment": null}, "updated_at": {"type": "timestamp without time zone", "index": 10, "name": "updated_at", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.iterable.iterable.message_type"}, "source.iterable.iterable.template_history": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "template_history_data", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"id": {"type": "integer", "index": 1, "name": "id", "comment": null}, "updated_at": {"type": "text", "index": 2, "name": "updated_at", "comment": null}, "message_type_id": {"type": "integer", "index": 3, "name": "message_type_id", "comment": null}, "client_template_id": {"type": "integer", "index": 4, "name": "client_template_id", "comment": null}, "created_at": {"type": "text", "index": 5, "name": "created_at", "comment": null}, "creator_user_id": {"type": "text", "index": 6, "name": "creator_user_id", "comment": null}, "name": {"type": "text", "index": 7, "name": "name", "comment": null}, "template_type": {"type": "text", "index": 8, "name": "template_type", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 9, "name": "_fivetran_synced", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.iterable.iterable.template_history"}, "source.iterable.iterable.user_history": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "user_history_data", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"email": {"type": "text", "index": 1, "name": "email", "comment": null}, "updated_at": {"type": "timestamp without time zone", "index": 2, "name": "updated_at", "comment": null}, "first_name": {"type": "integer", "index": 3, "name": "first_name", "comment": null}, "last_name": {"type": "integer", "index": 4, "name": "last_name", "comment": null}, "phone_number": {"type": "integer", "index": 5, "name": "phone_number", "comment": null}, "user_id": {"type": "integer", "index": 6, "name": "user_id", "comment": null}, "signup_date": {"type": "text", "index": 7, "name": "signup_date", "comment": null}, "signup_source": {"type": "text", "index": 8, "name": "signup_source", "comment": null}, "phone_number_carrier": {"type": "integer", "index": 9, "name": "phone_number_carrier", "comment": null}, "phone_number_country_code_iso": {"type": "integer", "index": 10, "name": "phone_number_country_code_iso", "comment": null}, "phone_number_line_type": {"type": "integer", "index": 11, "name": "phone_number_line_type", "comment": null}, "phone_number_updated_at": {"type": "integer", "index": 12, "name": "phone_number_updated_at", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 13, "name": "_fivetran_synced", "comment": null}, "email_list_ids": {"type": "text", "index": 14, "name": "email_list_ids", "comment": null}, "iterable_user_id": {"type": "integer", "index": 15, "name": "iterable_user_id", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.iterable.iterable.user_history"}, "source.iterable.iterable.user_unsubscribed_channel": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "user_unsubscribed_channel_data", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"_fivetran_id": {"type": "text", "index": 1, "name": "_fivetran_id", "comment": null}, "channel_id": {"type": "integer", "index": 2, "name": "channel_id", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 3, "name": "_fivetran_synced", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.iterable.iterable.user_unsubscribed_channel"}, "source.iterable.iterable.user_unsubscribed_channel_history": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "user_unsubscribed_channel_history_data", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"email": {"type": "text", "index": 1, "name": "email", "comment": null}, "channel_id": {"type": "bigint", "index": 2, "name": "channel_id", "comment": null}, "updated_at": {"type": "text", "index": 3, "name": "updated_at", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 4, "name": "_fivetran_synced", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.iterable.iterable.user_unsubscribed_channel_history"}, "source.iterable.iterable.user_unsubscribed_message_type": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "user_unsubscribed_message_type_data", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"_fivetran_id": {"type": "text", "index": 1, "name": "_fivetran_id", "comment": null}, "message_type_id": {"type": "integer", "index": 2, "name": "message_type_id", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 3, "name": "_fivetran_synced", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.iterable.iterable.user_unsubscribed_message_type"}, "source.iterable.iterable.user_unsubscribed_message_type_history": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "user_unsubscribed_message_type_history_data", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"message_type_id": {"type": "integer", "index": 1, "name": "message_type_id", "comment": null}, "email": {"type": "text", "index": 2, "name": "email", "comment": null}, "updated_at": {"type": "text", "index": 3, "name": "updated_at", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 4, "name": "_fivetran_synced", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.iterable.iterable.user_unsubscribed_message_type_history"}}, "errors": null} \ No newline at end of file +{"metadata": {"dbt_schema_version": "https://schemas.getdbt.com/dbt/catalog/v1.json", "dbt_version": "1.12.4", "generated_at": "2026-09-14T21:49:40.370410Z", "invocation_id": "6a6c3f91-5f13-44f5-8829-b38d77182ae4", "invocation_started_at": "2026-09-14T21:49:36.845076Z", "env": {}}, "nodes": {"seed.iterable_integration_tests.campaign_history_data": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "campaign_history_data", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"id": {"type": "integer", "index": 1, "name": "id", "comment": null}, "updated_at": {"type": "text", "index": 2, "name": "updated_at", "comment": null}, "template_id": {"type": "integer", "index": 3, "name": "template_id", "comment": null}, "recurring_campaign_id": {"type": "integer", "index": 4, "name": "recurring_campaign_id", "comment": null}, "campaign_state": {"type": "text", "index": 5, "name": "campaign_state", "comment": null}, "created_at": {"type": "text", "index": 6, "name": "created_at", "comment": null}, "created_by_user_id": {"type": "text", "index": 7, "name": "created_by_user_id", "comment": null}, "ended_at": {"type": "integer", "index": 8, "name": "ended_at", "comment": null}, "name": {"type": "text", "index": 9, "name": "name", "comment": null}, "send_size": {"type": "integer", "index": 10, "name": "send_size", "comment": null}, "start_at": {"type": "integer", "index": 11, "name": "start_at", "comment": null}, "type": {"type": "text", "index": 12, "name": "type", "comment": null}, "workflow_id": {"type": "integer", "index": 13, "name": "workflow_id", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 14, "name": "_fivetran_synced", "comment": null}, "updated_by_user_id": {"type": "integer", "index": 15, "name": "updated_by_user_id", "comment": null}, "message_medium": {"type": "text", "index": 16, "name": "message_medium", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.iterable_integration_tests.campaign_history_data"}, "seed.iterable_integration_tests.campaign_label_history_data": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "campaign_label_history_data", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"campaign_id": {"type": "integer", "index": 1, "name": "campaign_id", "comment": null}, "label": {"type": "text", "index": 2, "name": "label", "comment": null}, "updated_at": {"type": "text", "index": 3, "name": "updated_at", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 4, "name": "_fivetran_synced", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.iterable_integration_tests.campaign_label_history_data"}, "seed.iterable_integration_tests.campaign_list_history_data": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "campaign_list_history_data", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"list_id": {"type": "integer", "index": 1, "name": "list_id", "comment": null}, "campaign_id": {"type": "integer", "index": 2, "name": "campaign_id", "comment": null}, "updated_at": {"type": "text", "index": 3, "name": "updated_at", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 4, "name": "_fivetran_synced", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.iterable_integration_tests.campaign_list_history_data"}, "seed.iterable_integration_tests.campaign_metrics_data": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "campaign_metrics_data", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"date": {"type": "date", "index": 1, "name": "date", "comment": null}, "id": {"type": "integer", "index": 2, "name": "id", "comment": null}, "_fivetran_deleted": {"type": "boolean", "index": 3, "name": "_fivetran_deleted", "comment": null}, "average_order_value": {"type": "integer", "index": 4, "name": "average_order_value", "comment": null}, "purchases": {"type": "integer", "index": 5, "name": "purchases", "comment": null}, "revenue": {"type": "integer", "index": 6, "name": "revenue", "comment": null}, "revenue_m": {"type": "integer", "index": 7, "name": "revenue_m", "comment": null}, "total_app_uninstalls": {"type": "integer", "index": 8, "name": "total_app_uninstalls", "comment": null}, "total_complaints": {"type": "integer", "index": 9, "name": "total_complaints", "comment": null}, "total_email_bounced": {"type": "integer", "index": 10, "name": "total_email_bounced", "comment": null}, "total_email_clicked": {"type": "integer", "index": 11, "name": "total_email_clicked", "comment": null}, "total_email_delivered": {"type": "integer", "index": 12, "name": "total_email_delivered", "comment": null}, "total_email_opens": {"type": "integer", "index": 13, "name": "total_email_opens", "comment": null}, "total_email_sends": {"type": "integer", "index": 14, "name": "total_email_sends", "comment": null}, "total_hosted_unsubscribe_clicks": {"type": "integer", "index": 15, "name": "total_hosted_unsubscribe_clicks", "comment": null}, "total_purchases": {"type": "integer", "index": 16, "name": "total_purchases", "comment": null}, "total_pushes_bounced": {"type": "integer", "index": 17, "name": "total_pushes_bounced", "comment": null}, "total_pushes_delivered": {"type": "integer", "index": 18, "name": "total_pushes_delivered", "comment": null}, "total_pushes_opened": {"type": "integer", "index": 19, "name": "total_pushes_opened", "comment": null}, "total_pushes_sent": {"type": "integer", "index": 20, "name": "total_pushes_sent", "comment": null}, "total_unsubscribes": {"type": "integer", "index": 21, "name": "total_unsubscribes", "comment": null}, "unique_email_bounced": {"type": "integer", "index": 22, "name": "unique_email_bounced", "comment": null}, "unique_email_clicks": {"type": "integer", "index": 23, "name": "unique_email_clicks", "comment": null}, "unique_email_opens_or_clicks": {"type": "integer", "index": 24, "name": "unique_email_opens_or_clicks", "comment": null}, "unique_hosted_unsubscribe_clicks": {"type": "integer", "index": 25, "name": "unique_hosted_unsubscribe_clicks", "comment": null}, "unique_purchases": {"type": "integer", "index": 26, "name": "unique_purchases", "comment": null}, "unique_pushes_bounced": {"type": "integer", "index": 27, "name": "unique_pushes_bounced", "comment": null}, "unique_pushes_opened": {"type": "integer", "index": 28, "name": "unique_pushes_opened", "comment": null}, "unique_pushes_sent": {"type": "integer", "index": 29, "name": "unique_pushes_sent", "comment": null}, "unique_unsubscribes": {"type": "integer", "index": 30, "name": "unique_unsubscribes", "comment": null}, "total_push_send_skips": {"type": "integer", "index": 31, "name": "total_push_send_skips", "comment": null}, "total_in_app_opens": {"type": "integer", "index": 32, "name": "total_in_app_opens", "comment": null}, "unique_in_apps_delivered": {"type": "integer", "index": 33, "name": "unique_in_apps_delivered", "comment": null}, "unique_in_app_sends": {"type": "integer", "index": 34, "name": "unique_in_app_sends", "comment": null}, "total_in_app_closes": {"type": "integer", "index": 35, "name": "total_in_app_closes", "comment": null}, "total_inbox_impressions": {"type": "integer", "index": 36, "name": "total_inbox_impressions", "comment": null}, "unique_pushes_delivered": {"type": "integer", "index": 37, "name": "unique_pushes_delivered", "comment": null}, "unique_in_app_clicks": {"type": "integer", "index": 38, "name": "unique_in_app_clicks", "comment": null}, "unique_emails_delivered": {"type": "integer", "index": 39, "name": "unique_emails_delivered", "comment": null}, "total_in_app_clicks": {"type": "integer", "index": 40, "name": "total_in_app_clicks", "comment": null}, "total_in_app_deletes": {"type": "integer", "index": 41, "name": "total_in_app_deletes", "comment": null}, "total_in_app_sent": {"type": "integer", "index": 42, "name": "total_in_app_sent", "comment": null}, "total_in_apps_delivered": {"type": "integer", "index": 43, "name": "total_in_apps_delivered", "comment": null}, "unique_in_app_opens": {"type": "integer", "index": 44, "name": "unique_in_app_opens", "comment": null}, "total_email_holdout": {"type": "integer", "index": 45, "name": "total_email_holdout", "comment": null}, "total_email_send_skips": {"type": "integer", "index": 46, "name": "total_email_send_skips", "comment": null}, "unique_email_sends": {"type": "integer", "index": 47, "name": "unique_email_sends", "comment": null}, "unique_emails_opens": {"type": "integer", "index": 48, "name": "unique_emails_opens", "comment": null}, "total_in_app_holdout": {"type": "integer", "index": 49, "name": "total_in_app_holdout", "comment": null}, "total_in_app_send_skips": {"type": "integer", "index": 50, "name": "total_in_app_send_skips", "comment": null}, "total_push_holdout": {"type": "integer", "index": 51, "name": "total_push_holdout", "comment": null}, "_fivetran_synced": {"type": "text", "index": 52, "name": "_fivetran_synced", "comment": null}, "total_sms_holdout": {"type": "integer", "index": 53, "name": "total_sms_holdout", "comment": null}, "unique_sms_sent": {"type": "integer", "index": 54, "name": "unique_sms_sent", "comment": null}, "total_sms_delivered": {"type": "integer", "index": 55, "name": "total_sms_delivered", "comment": null}, "total_sms_sent": {"type": "integer", "index": 56, "name": "total_sms_sent", "comment": null}, "total_inbound_sms": {"type": "integer", "index": 57, "name": "total_inbound_sms", "comment": null}, "total_sms_bounced": {"type": "integer", "index": 58, "name": "total_sms_bounced", "comment": null}, "total_sms_send_skips": {"type": "integer", "index": 59, "name": "total_sms_send_skips", "comment": null}, "unique_inbound_sms": {"type": "integer", "index": 60, "name": "unique_inbound_sms", "comment": null}, "unique_sms_delivered": {"type": "integer", "index": 61, "name": "unique_sms_delivered", "comment": null}, "unique_sms_bounced": {"type": "integer", "index": 62, "name": "unique_sms_bounced", "comment": null}, "revenue_m_sms_": {"type": "integer", "index": 63, "name": "revenue_m_sms_", "comment": null}, "purchases_m_sms_": {"type": "integer", "index": 64, "name": "purchases_m_sms_", "comment": null}, "purchases_m_email_": {"type": "integer", "index": 65, "name": "purchases_m_email_", "comment": null}, "revenue_m_push_": {"type": "integer", "index": 66, "name": "revenue_m_push_", "comment": null}, "revenue_m_email_": {"type": "integer", "index": 67, "name": "revenue_m_email_", "comment": null}, "purchases_m_push_": {"type": "integer", "index": 68, "name": "purchases_m_push_", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.iterable_integration_tests.campaign_metrics_data"}, "seed.iterable_integration_tests.campaign_suppression_list_history_data": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "campaign_suppression_list_history_data", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"suppressed_list_id": {"type": "integer", "index": 1, "name": "suppressed_list_id", "comment": null}, "campaign_id": {"type": "integer", "index": 2, "name": "campaign_id", "comment": null}, "updated_at": {"type": "text", "index": 3, "name": "updated_at", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 4, "name": "_fivetran_synced", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.iterable_integration_tests.campaign_suppression_list_history_data"}, "seed.iterable_integration_tests.channel_data": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "channel_data", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"id": {"type": "bigint", "index": 1, "name": "id", "comment": null}, "name": {"type": "text", "index": 2, "name": "name", "comment": null}, "channel_type": {"type": "text", "index": 3, "name": "channel_type", "comment": null}, "message_medium": {"type": "text", "index": 4, "name": "message_medium", "comment": null}, "_fivetran_deleted": {"type": "boolean", "index": 5, "name": "_fivetran_deleted", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 6, "name": "_fivetran_synced", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.iterable_integration_tests.channel_data"}, "seed.iterable_integration_tests.event_data": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "event_data", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"_fivetran_id": {"type": "text", "index": 1, "name": "_fivetran_id", "comment": null}, "email": {"type": "text", "index": 2, "name": "email", "comment": null}, "campaign_id": {"type": "integer", "index": 3, "name": "campaign_id", "comment": null}, "message_id": {"type": "integer", "index": 4, "name": "message_id", "comment": null}, "content_id": {"type": "integer", "index": 5, "name": "content_id", "comment": null}, "created_at": {"type": "timestamp without time zone", "index": 6, "name": "created_at", "comment": null}, "event_name": {"type": "text", "index": 7, "name": "event_name", "comment": null}, "ip": {"type": "integer", "index": 8, "name": "ip", "comment": null}, "message_bus_id": {"type": "integer", "index": 9, "name": "message_bus_id", "comment": null}, "message_type_id": {"type": "integer", "index": 10, "name": "message_type_id", "comment": null}, "recipient_state": {"type": "integer", "index": 11, "name": "recipient_state", "comment": null}, "status": {"type": "integer", "index": 12, "name": "status", "comment": null}, "unsub_source": {"type": "integer", "index": 13, "name": "unsub_source", "comment": null}, "user_agent": {"type": "integer", "index": 14, "name": "user_agent", "comment": null}, "user_agent_device": {"type": "integer", "index": 15, "name": "user_agent_device", "comment": null}, "transactional_data": {"type": "character varying(100)", "index": 16, "name": "transactional_data", "comment": null}, "additional_properties": {"type": "text", "index": 17, "name": "additional_properties", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 18, "name": "_fivetran_synced", "comment": null}, "_fivetran_user_id": {"type": "integer", "index": 19, "name": "_fivetran_user_id", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.iterable_integration_tests.event_data"}, "seed.iterable_integration_tests.event_extension_data": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "event_extension_data", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"_fivetran_id": {"type": "text", "index": 1, "name": "_fivetran_id", "comment": null}, "app_already_running": {"type": "integer", "index": 2, "name": "app_already_running", "comment": null}, "badge": {"type": "integer", "index": 3, "name": "badge", "comment": null}, "canonical_url_id": {"type": "integer", "index": 4, "name": "canonical_url_id", "comment": null}, "content_available": {"type": "integer", "index": 5, "name": "content_available", "comment": null}, "content_id": {"type": "integer", "index": 6, "name": "content_id", "comment": null}, "device": {"type": "integer", "index": 7, "name": "device", "comment": null}, "email_id": {"type": "text", "index": 8, "name": "email_id", "comment": null}, "email_subject": {"type": "text", "index": 9, "name": "email_subject", "comment": null}, "experiment_id": {"type": "integer", "index": 10, "name": "experiment_id", "comment": null}, "from_phone_number_id": {"type": "integer", "index": 11, "name": "from_phone_number_id", "comment": null}, "from_smssender_id": {"type": "integer", "index": 12, "name": "from_smssender_id", "comment": null}, "image_url": {"type": "integer", "index": 13, "name": "image_url", "comment": null}, "is_ghost_push": {"type": "integer", "index": 14, "name": "is_ghost_push", "comment": null}, "link_id": {"type": "integer", "index": 15, "name": "link_id", "comment": null}, "link_url": {"type": "integer", "index": 16, "name": "link_url", "comment": null}, "platform_endpoint": {"type": "integer", "index": 17, "name": "platform_endpoint", "comment": null}, "push_message": {"type": "integer", "index": 18, "name": "push_message", "comment": null}, "region": {"type": "text", "index": 19, "name": "region", "comment": null}, "sms_message": {"type": "integer", "index": 20, "name": "sms_message", "comment": null}, "sound": {"type": "integer", "index": 21, "name": "sound", "comment": null}, "to_phone_number": {"type": "integer", "index": 22, "name": "to_phone_number", "comment": null}, "url": {"type": "integer", "index": 23, "name": "url", "comment": null}, "workflow_id": {"type": "integer", "index": 24, "name": "workflow_id", "comment": null}, "workflow_name": {"type": "text", "index": 25, "name": "workflow_name", "comment": null}, "locale": {"type": "integer", "index": 26, "name": "locale", "comment": null}, "deeplink_android": {"type": "integer", "index": 27, "name": "deeplink_android", "comment": null}, "deeplink_ios": {"type": "integer", "index": 28, "name": "deeplink_ios", "comment": null}, "payload": {"type": "character varying(100)", "index": 29, "name": "payload", "comment": null}, "sms_provider_response_status": {"type": "integer", "index": 30, "name": "sms_provider_response_status", "comment": null}, "sms_provider_response_message": {"type": "integer", "index": 31, "name": "sms_provider_response_message", "comment": null}, "sms_provider_response_code": {"type": "integer", "index": 32, "name": "sms_provider_response_code", "comment": null}, "sms_provider_response_more_info": {"type": "integer", "index": 33, "name": "sms_provider_response_more_info", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 34, "name": "_fivetran_synced", "comment": null}, "catalog_collection_count": {"type": "integer", "index": 35, "name": "catalog_collection_count", "comment": null}, "catalog_lookup_count": {"type": "integer", "index": 36, "name": "catalog_lookup_count", "comment": null}, "city": {"type": "text", "index": 37, "name": "city", "comment": null}, "clicked_url": {"type": "text", "index": 38, "name": "clicked_url", "comment": null}, "country": {"type": "text", "index": 39, "name": "country", "comment": null}, "error_code": {"type": "integer", "index": 40, "name": "error_code", "comment": null}, "expires_at": {"type": "text", "index": 41, "name": "expires_at", "comment": null}, "from_phone_number": {"type": "integer", "index": 42, "name": "from_phone_number", "comment": null}, "in_app_body": {"type": "text", "index": 43, "name": "in_app_body", "comment": null}, "is_sms_estimation": {"type": "boolean", "index": 44, "name": "is_sms_estimation", "comment": null}, "labels": {"type": "text", "index": 45, "name": "labels", "comment": null}, "message_context": {"type": "text", "index": 46, "name": "message_context", "comment": null}, "message_status": {"type": "text", "index": 47, "name": "message_status", "comment": null}, "mms_send_count": {"type": "integer", "index": 48, "name": "mms_send_count", "comment": null}, "product_recommendation_count": {"type": "integer", "index": 49, "name": "product_recommendation_count", "comment": null}, "proxy_source": {"type": "text", "index": 50, "name": "proxy_source", "comment": null}, "reason": {"type": "text", "index": 51, "name": "reason", "comment": null}, "sms_send_count": {"type": "integer", "index": 52, "name": "sms_send_count", "comment": null}, "web_push_body": {"type": "text", "index": 53, "name": "web_push_body", "comment": null}, "web_push_click_action": {"type": "text", "index": 54, "name": "web_push_click_action", "comment": null}, "web_push_icon": {"type": "text", "index": 55, "name": "web_push_icon", "comment": null}, "web_push_message": {"type": "text", "index": 56, "name": "web_push_message", "comment": null}, "_fivetran_user_id": {"type": "integer", "index": 57, "name": "_fivetran_user_id", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.iterable_integration_tests.event_extension_data"}, "seed.iterable_integration_tests.journey_data": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "journey_data", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"id": {"type": "bigint", "index": 1, "name": "id", "comment": null}, "name": {"type": "text", "index": 2, "name": "name", "comment": null}, "journey_type": {"type": "text", "index": 3, "name": "journey_type", "comment": null}, "description": {"type": "text", "index": 4, "name": "description", "comment": null}, "creator_user_id": {"type": "text", "index": 5, "name": "creator_user_id", "comment": null}, "enabled": {"type": "boolean", "index": 6, "name": "enabled", "comment": null}, "is_archived": {"type": "boolean", "index": 7, "name": "is_archived", "comment": null}, "lifetime_limit": {"type": "bigint", "index": 8, "name": "lifetime_limit", "comment": null}, "simultaneous_limit": {"type": "bigint", "index": 9, "name": "simultaneous_limit", "comment": null}, "start_tile_id": {"type": "bigint", "index": 10, "name": "start_tile_id", "comment": null}, "trigger_event_names": {"type": "text", "index": 11, "name": "trigger_event_names", "comment": null}, "created_at": {"type": "timestamp without time zone", "index": 12, "name": "created_at", "comment": null}, "updated_at": {"type": "timestamp without time zone", "index": 13, "name": "updated_at", "comment": null}, "_fivetran_deleted": {"type": "boolean", "index": 14, "name": "_fivetran_deleted", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 15, "name": "_fivetran_synced", "comment": null}, "draft_name": {"type": "text", "index": 16, "name": "draft_name", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.iterable_integration_tests.journey_data"}, "seed.iterable_integration_tests.list_data": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "list_data", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"id": {"type": "integer", "index": 1, "name": "id", "comment": null}, "name": {"type": "text", "index": 2, "name": "name", "comment": null}, "created_at": {"type": "text", "index": 3, "name": "created_at", "comment": null}, "list_type": {"type": "text", "index": 4, "name": "list_type", "comment": null}, "_fivetran_deleted": {"type": "boolean", "index": 5, "name": "_fivetran_deleted", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 6, "name": "_fivetran_synced", "comment": null}, "description": {"type": "text", "index": 7, "name": "description", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.iterable_integration_tests.list_data"}, "seed.iterable_integration_tests.list_user_data": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "list_user_data", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"_fivetran_id": {"type": "text", "index": 1, "name": "_fivetran_id", "comment": null}, "index": {"type": "bigint", "index": 2, "name": "index", "comment": null}, "list_id": {"type": "bigint", "index": 3, "name": "list_id", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 4, "name": "_fivetran_synced", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.iterable_integration_tests.list_user_data"}, "seed.iterable_integration_tests.message_type_data": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "message_type_data", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"id": {"type": "bigint", "index": 1, "name": "id", "comment": null}, "name": {"type": "text", "index": 2, "name": "name", "comment": null}, "channel_id": {"type": "bigint", "index": 3, "name": "channel_id", "comment": null}, "_fivetran_deleted": {"type": "boolean", "index": 4, "name": "_fivetran_deleted", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 5, "name": "_fivetran_synced", "comment": null}, "created_at": {"type": "timestamp without time zone", "index": 6, "name": "created_at", "comment": null}, "frequency_cap": {"type": "integer", "index": 7, "name": "frequency_cap", "comment": null}, "rate_limit_per_minute": {"type": "integer", "index": 8, "name": "rate_limit_per_minute", "comment": null}, "subscription_policy": {"type": "text", "index": 9, "name": "subscription_policy", "comment": null}, "updated_at": {"type": "timestamp without time zone", "index": 10, "name": "updated_at", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.iterable_integration_tests.message_type_data"}, "seed.iterable_integration_tests.template_history_data": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "template_history_data", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"id": {"type": "integer", "index": 1, "name": "id", "comment": null}, "updated_at": {"type": "text", "index": 2, "name": "updated_at", "comment": null}, "message_type_id": {"type": "integer", "index": 3, "name": "message_type_id", "comment": null}, "client_template_id": {"type": "integer", "index": 4, "name": "client_template_id", "comment": null}, "created_at": {"type": "text", "index": 5, "name": "created_at", "comment": null}, "creator_user_id": {"type": "text", "index": 6, "name": "creator_user_id", "comment": null}, "name": {"type": "text", "index": 7, "name": "name", "comment": null}, "template_type": {"type": "text", "index": 8, "name": "template_type", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 9, "name": "_fivetran_synced", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.iterable_integration_tests.template_history_data"}, "seed.iterable_integration_tests.user_history_bq_json_data": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "user_history_bq_json_data", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"email": {"type": "text", "index": 1, "name": "email", "comment": null}, "updated_at": {"type": "text", "index": 2, "name": "updated_at", "comment": null}, "first_name": {"type": "integer", "index": 3, "name": "first_name", "comment": null}, "last_name": {"type": "integer", "index": 4, "name": "last_name", "comment": null}, "phone_number": {"type": "integer", "index": 5, "name": "phone_number", "comment": null}, "user_id": {"type": "integer", "index": 6, "name": "user_id", "comment": null}, "signup_date": {"type": "text", "index": 7, "name": "signup_date", "comment": null}, "signup_source": {"type": "text", "index": 8, "name": "signup_source", "comment": null}, "phone_number_carrier": {"type": "integer", "index": 9, "name": "phone_number_carrier", "comment": null}, "phone_number_country_code_iso": {"type": "integer", "index": 10, "name": "phone_number_country_code_iso", "comment": null}, "phone_number_line_type": {"type": "integer", "index": 11, "name": "phone_number_line_type", "comment": null}, "phone_number_updated_at": {"type": "integer", "index": 12, "name": "phone_number_updated_at", "comment": null}, "_fivetran_synced": {"type": "text", "index": 13, "name": "_fivetran_synced", "comment": null}, "email_list_ids": {"type": "text", "index": 14, "name": "email_list_ids", "comment": null}, "iterable_user_id": {"type": "integer", "index": 15, "name": "iterable_user_id", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.iterable_integration_tests.user_history_bq_json_data"}, "seed.iterable_integration_tests.user_history_data": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "user_history_data", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"email": {"type": "text", "index": 1, "name": "email", "comment": null}, "updated_at": {"type": "timestamp without time zone", "index": 2, "name": "updated_at", "comment": null}, "first_name": {"type": "integer", "index": 3, "name": "first_name", "comment": null}, "last_name": {"type": "integer", "index": 4, "name": "last_name", "comment": null}, "phone_number": {"type": "integer", "index": 5, "name": "phone_number", "comment": null}, "user_id": {"type": "integer", "index": 6, "name": "user_id", "comment": null}, "signup_date": {"type": "text", "index": 7, "name": "signup_date", "comment": null}, "signup_source": {"type": "text", "index": 8, "name": "signup_source", "comment": null}, "phone_number_carrier": {"type": "integer", "index": 9, "name": "phone_number_carrier", "comment": null}, "phone_number_country_code_iso": {"type": "integer", "index": 10, "name": "phone_number_country_code_iso", "comment": null}, "phone_number_line_type": {"type": "integer", "index": 11, "name": "phone_number_line_type", "comment": null}, "phone_number_updated_at": {"type": "integer", "index": 12, "name": "phone_number_updated_at", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 13, "name": "_fivetran_synced", "comment": null}, "email_list_ids": {"type": "text", "index": 14, "name": "email_list_ids", "comment": null}, "iterable_user_id": {"type": "integer", "index": 15, "name": "iterable_user_id", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.iterable_integration_tests.user_history_data"}, "seed.iterable_integration_tests.user_unsubscribed_channel_data": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "user_unsubscribed_channel_data", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"_fivetran_id": {"type": "text", "index": 1, "name": "_fivetran_id", "comment": null}, "channel_id": {"type": "integer", "index": 2, "name": "channel_id", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 3, "name": "_fivetran_synced", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.iterable_integration_tests.user_unsubscribed_channel_data"}, "seed.iterable_integration_tests.user_unsubscribed_channel_history_data": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "user_unsubscribed_channel_history_data", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"email": {"type": "text", "index": 1, "name": "email", "comment": null}, "channel_id": {"type": "bigint", "index": 2, "name": "channel_id", "comment": null}, "updated_at": {"type": "text", "index": 3, "name": "updated_at", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 4, "name": "_fivetran_synced", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.iterable_integration_tests.user_unsubscribed_channel_history_data"}, "seed.iterable_integration_tests.user_unsubscribed_message_type_data": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "user_unsubscribed_message_type_data", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"_fivetran_id": {"type": "text", "index": 1, "name": "_fivetran_id", "comment": null}, "message_type_id": {"type": "integer", "index": 2, "name": "message_type_id", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 3, "name": "_fivetran_synced", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.iterable_integration_tests.user_unsubscribed_message_type_data"}, "seed.iterable_integration_tests.user_unsubscribed_message_type_history_data": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "user_unsubscribed_message_type_history_data", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"message_type_id": {"type": "integer", "index": 1, "name": "message_type_id", "comment": null}, "email": {"type": "text", "index": 2, "name": "email", "comment": null}, "updated_at": {"type": "text", "index": 3, "name": "updated_at", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 4, "name": "_fivetran_synced", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.iterable_integration_tests.user_unsubscribed_message_type_history_data"}, "model.iterable.int_iterable__campaign_event_metrics": {"metadata": {"type": "VIEW", "schema": "public_iterable_dev", "name": "int_iterable__campaign_event_metrics", "database": "postgres", "comment": "Table that generates relevant total and unique campaign/experiment level aggregations.", "owner": "postgres"}, "columns": {"source_relation": {"type": "text", "index": 1, "name": "source_relation", "comment": null}, "campaign_id": {"type": "text", "index": 2, "name": "campaign_id", "comment": null}, "template_id": {"type": "text", "index": 3, "name": "template_id", "comment": null}, "experiment_id": {"type": "integer", "index": 4, "name": "experiment_id", "comment": null}, "count_unique_users": {"type": "bigint", "index": 5, "name": "count_unique_users", "comment": null}, "total_emailclick": {"type": "numeric", "index": 6, "name": "total_emailclick", "comment": null}, "unique_total_emailclick": {"type": "bigint", "index": 7, "name": "unique_total_emailclick", "comment": null}, "total_emailunsubscribe": {"type": "numeric", "index": 8, "name": "total_emailunsubscribe", "comment": null}, "unique_total_emailunsubscribe": {"type": "bigint", "index": 9, "name": "unique_total_emailunsubscribe", "comment": null}, "total_emailcomplaint": {"type": "numeric", "index": 10, "name": "total_emailcomplaint", "comment": null}, "unique_total_emailcomplaint": {"type": "bigint", "index": 11, "name": "unique_total_emailcomplaint", "comment": null}, "total_customevent": {"type": "numeric", "index": 12, "name": "total_customevent", "comment": null}, "unique_total_customevent": {"type": "bigint", "index": 13, "name": "unique_total_customevent", "comment": null}, "total_emailsubscribe": {"type": "numeric", "index": 14, "name": "total_emailsubscribe", "comment": null}, "unique_total_emailsubscribe": {"type": "bigint", "index": 15, "name": "unique_total_emailsubscribe", "comment": null}, "total_emailopen": {"type": "numeric", "index": 16, "name": "total_emailopen", "comment": null}, "unique_total_emailopen": {"type": "bigint", "index": 17, "name": "unique_total_emailopen", "comment": null}, "total_pushsend": {"type": "numeric", "index": 18, "name": "total_pushsend", "comment": null}, "unique_total_pushsend": {"type": "bigint", "index": 19, "name": "unique_total_pushsend", "comment": null}, "total_smsbounce": {"type": "numeric", "index": 20, "name": "total_smsbounce", "comment": null}, "unique_total_smsbounce": {"type": "bigint", "index": 21, "name": "unique_total_smsbounce", "comment": null}, "total_pushbounce": {"type": "numeric", "index": 22, "name": "total_pushbounce", "comment": null}, "unique_total_pushbounce": {"type": "bigint", "index": 23, "name": "unique_total_pushbounce", "comment": null}, "total_inappsendskip": {"type": "numeric", "index": 24, "name": "total_inappsendskip", "comment": null}, "unique_total_inappsendskip": {"type": "bigint", "index": 25, "name": "unique_total_inappsendskip", "comment": null}, "total_smssend": {"type": "numeric", "index": 26, "name": "total_smssend", "comment": null}, "unique_total_smssend": {"type": "bigint", "index": 27, "name": "unique_total_smssend", "comment": null}, "total_inappsend": {"type": "numeric", "index": 28, "name": "total_inappsend", "comment": null}, "unique_total_inappsend": {"type": "bigint", "index": 29, "name": "unique_total_inappsend", "comment": null}, "total_pushopen": {"type": "numeric", "index": 30, "name": "total_pushopen", "comment": null}, "unique_total_pushopen": {"type": "bigint", "index": 31, "name": "unique_total_pushopen", "comment": null}, "total_emailsend": {"type": "numeric", "index": 32, "name": "total_emailsend", "comment": null}, "unique_total_emailsend": {"type": "bigint", "index": 33, "name": "unique_total_emailsend", "comment": null}, "total_pushsendskip": {"type": "numeric", "index": 34, "name": "total_pushsendskip", "comment": null}, "unique_total_pushsendskip": {"type": "bigint", "index": 35, "name": "unique_total_pushsendskip", "comment": null}, "total_inappopen": {"type": "numeric", "index": 36, "name": "total_inappopen", "comment": null}, "unique_total_inappopen": {"type": "bigint", "index": 37, "name": "unique_total_inappopen", "comment": null}, "total_emailsendskip": {"type": "numeric", "index": 38, "name": "total_emailsendskip", "comment": null}, "unique_total_emailsendskip": {"type": "bigint", "index": 39, "name": "unique_total_emailsendskip", "comment": null}, "total_emailbounce": {"type": "numeric", "index": 40, "name": "total_emailbounce", "comment": null}, "unique_total_emailbounce": {"type": "bigint", "index": 41, "name": "unique_total_emailbounce", "comment": null}, "total_inappclick": {"type": "numeric", "index": 42, "name": "total_inappclick", "comment": null}, "unique_total_inappclick": {"type": "bigint", "index": 43, "name": "unique_total_inappclick", "comment": null}, "total_pushuninstall": {"type": "numeric", "index": 44, "name": "total_pushuninstall", "comment": null}, "unique_total_pushuninstall": {"type": "bigint", "index": 45, "name": "unique_total_pushuninstall", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.int_iterable__campaign_event_metrics"}, "model.iterable.int_iterable__campaign_labels": {"metadata": {"type": "VIEW", "schema": "public_iterable_dev", "name": "int_iterable__campaign_labels", "database": "postgres", "comment": "Table that provides the distinct string aggregation of labels for each campaign.", "owner": "postgres"}, "columns": {"source_relation": {"type": "text", "index": 1, "name": "source_relation", "comment": null}, "campaign_id": {"type": "text", "index": 2, "name": "campaign_id", "comment": null}, "labels": {"type": "text", "index": 3, "name": "labels", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.int_iterable__campaign_labels"}, "model.iterable.int_iterable__campaign_lists": {"metadata": {"type": "VIEW", "schema": "public_iterable_dev", "name": "int_iterable__campaign_lists", "database": "postgres", "comment": "Table that identifies the suppressed and send lists associated with a campaign.", "owner": "postgres"}, "columns": {"source_relation": {"type": "text", "index": 1, "name": "source_relation", "comment": null}, "list_id": {"type": "text", "index": 2, "name": "list_id", "comment": null}, "campaign_id": {"type": "text", "index": 3, "name": "campaign_id", "comment": null}, "updated_at": {"type": "text", "index": 4, "name": "updated_at", "comment": null}, "list_activity": {"type": "text", "index": 5, "name": "list_activity", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.int_iterable__campaign_lists"}, "model.iterable.int_iterable__journey_event_metrics": {"metadata": {"type": "VIEW", "schema": "public_iterable_dev", "name": "int_iterable__journey_event_metrics", "database": "postgres", "comment": "Table that generates relevant total and unique journey level aggregations, rolled up from the user/campaign grain via the campaign's journey reference.", "owner": "postgres"}, "columns": {"source_relation": {"type": "text", "index": 1, "name": "source_relation", "comment": null}, "journey_id": {"type": "text", "index": 2, "name": "journey_id", "comment": null}, "count_total_campaigns": {"type": "bigint", "index": 3, "name": "count_total_campaigns", "comment": null}, "count_unique_users": {"type": "bigint", "index": 4, "name": "count_unique_users", "comment": null}, "first_event_at": {"type": "timestamp without time zone", "index": 5, "name": "first_event_at", "comment": null}, "last_event_at": {"type": "timestamp without time zone", "index": 6, "name": "last_event_at", "comment": null}, "total_emailclick": {"type": "numeric", "index": 7, "name": "total_emailclick", "comment": null}, "unique_total_emailclick": {"type": "bigint", "index": 8, "name": "unique_total_emailclick", "comment": null}, "total_emailunsubscribe": {"type": "numeric", "index": 9, "name": "total_emailunsubscribe", "comment": null}, "unique_total_emailunsubscribe": {"type": "bigint", "index": 10, "name": "unique_total_emailunsubscribe", "comment": null}, "total_emailcomplaint": {"type": "numeric", "index": 11, "name": "total_emailcomplaint", "comment": null}, "unique_total_emailcomplaint": {"type": "bigint", "index": 12, "name": "unique_total_emailcomplaint", "comment": null}, "total_customevent": {"type": "numeric", "index": 13, "name": "total_customevent", "comment": null}, "unique_total_customevent": {"type": "bigint", "index": 14, "name": "unique_total_customevent", "comment": null}, "total_emailsubscribe": {"type": "numeric", "index": 15, "name": "total_emailsubscribe", "comment": null}, "unique_total_emailsubscribe": {"type": "bigint", "index": 16, "name": "unique_total_emailsubscribe", "comment": null}, "total_emailopen": {"type": "numeric", "index": 17, "name": "total_emailopen", "comment": null}, "unique_total_emailopen": {"type": "bigint", "index": 18, "name": "unique_total_emailopen", "comment": null}, "total_pushsend": {"type": "numeric", "index": 19, "name": "total_pushsend", "comment": null}, "unique_total_pushsend": {"type": "bigint", "index": 20, "name": "unique_total_pushsend", "comment": null}, "total_smsbounce": {"type": "numeric", "index": 21, "name": "total_smsbounce", "comment": null}, "unique_total_smsbounce": {"type": "bigint", "index": 22, "name": "unique_total_smsbounce", "comment": null}, "total_pushbounce": {"type": "numeric", "index": 23, "name": "total_pushbounce", "comment": null}, "unique_total_pushbounce": {"type": "bigint", "index": 24, "name": "unique_total_pushbounce", "comment": null}, "total_inappsendskip": {"type": "numeric", "index": 25, "name": "total_inappsendskip", "comment": null}, "unique_total_inappsendskip": {"type": "bigint", "index": 26, "name": "unique_total_inappsendskip", "comment": null}, "total_smssend": {"type": "numeric", "index": 27, "name": "total_smssend", "comment": null}, "unique_total_smssend": {"type": "bigint", "index": 28, "name": "unique_total_smssend", "comment": null}, "total_inappsend": {"type": "numeric", "index": 29, "name": "total_inappsend", "comment": null}, "unique_total_inappsend": {"type": "bigint", "index": 30, "name": "unique_total_inappsend", "comment": null}, "total_pushopen": {"type": "numeric", "index": 31, "name": "total_pushopen", "comment": null}, "unique_total_pushopen": {"type": "bigint", "index": 32, "name": "unique_total_pushopen", "comment": null}, "total_emailsend": {"type": "numeric", "index": 33, "name": "total_emailsend", "comment": null}, "unique_total_emailsend": {"type": "bigint", "index": 34, "name": "unique_total_emailsend", "comment": null}, "total_pushsendskip": {"type": "numeric", "index": 35, "name": "total_pushsendskip", "comment": null}, "unique_total_pushsendskip": {"type": "bigint", "index": 36, "name": "unique_total_pushsendskip", "comment": null}, "total_inappopen": {"type": "numeric", "index": 37, "name": "total_inappopen", "comment": null}, "unique_total_inappopen": {"type": "bigint", "index": 38, "name": "unique_total_inappopen", "comment": null}, "total_emailsendskip": {"type": "numeric", "index": 39, "name": "total_emailsendskip", "comment": null}, "unique_total_emailsendskip": {"type": "bigint", "index": 40, "name": "unique_total_emailsendskip", "comment": null}, "total_emailbounce": {"type": "numeric", "index": 41, "name": "total_emailbounce", "comment": null}, "unique_total_emailbounce": {"type": "bigint", "index": 42, "name": "unique_total_emailbounce", "comment": null}, "total_inappclick": {"type": "numeric", "index": 43, "name": "total_inappclick", "comment": null}, "unique_total_inappclick": {"type": "bigint", "index": 44, "name": "unique_total_inappclick", "comment": null}, "total_pushuninstall": {"type": "numeric", "index": 45, "name": "total_pushuninstall", "comment": null}, "unique_total_pushuninstall": {"type": "bigint", "index": 46, "name": "unique_total_pushuninstall", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.int_iterable__journey_event_metrics"}, "model.iterable.int_iterable__latest_campaign": {"metadata": {"type": "VIEW", "schema": "public_iterable_dev", "name": "int_iterable__latest_campaign", "database": "postgres", "comment": "Table that filters out historical versions of the campaign, and returns the most recent campaign version.", "owner": "postgres"}, "columns": {"source_relation": {"type": "text", "index": 1, "name": "source_relation", "comment": null}, "campaign_id": {"type": "text", "index": 2, "name": "campaign_id", "comment": null}, "updated_at": {"type": "text", "index": 3, "name": "updated_at", "comment": null}, "campaign_name": {"type": "text", "index": 4, "name": "campaign_name", "comment": null}, "campaign_state": {"type": "text", "index": 5, "name": "campaign_state", "comment": null}, "campaign_type": {"type": "text", "index": 6, "name": "campaign_type", "comment": null}, "send_size": {"type": "integer", "index": 7, "name": "send_size", "comment": null}, "start_at": {"type": "integer", "index": 8, "name": "start_at", "comment": null}, "ended_at": {"type": "integer", "index": 9, "name": "ended_at", "comment": null}, "created_at": {"type": "text", "index": 10, "name": "created_at", "comment": null}, "message_medium": {"type": "text", "index": 11, "name": "message_medium", "comment": null}, "recurring_campaign_id": {"type": "text", "index": 12, "name": "recurring_campaign_id", "comment": null}, "created_by_user_id": {"type": "text", "index": 13, "name": "created_by_user_id", "comment": null}, "updated_by_user_id": {"type": "text", "index": 14, "name": "updated_by_user_id", "comment": null}, "template_id": {"type": "text", "index": 15, "name": "template_id", "comment": null}, "workflow_id": {"type": "integer", "index": 16, "name": "workflow_id", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 17, "name": "_fivetran_synced", "comment": null}, "latest_campaign_index": {"type": "bigint", "index": 18, "name": "latest_campaign_index", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.int_iterable__latest_campaign"}, "model.iterable.int_iterable__latest_template": {"metadata": {"type": "VIEW", "schema": "public_iterable_dev", "name": "int_iterable__latest_template", "database": "postgres", "comment": "Table that provides the most recent version of the template as well as joining relevant message type information.", "owner": "postgres"}, "columns": {"source_relation": {"type": "text", "index": 1, "name": "source_relation", "comment": null}, "template_id": {"type": "text", "index": 2, "name": "template_id", "comment": null}, "template_name": {"type": "text", "index": 3, "name": "template_name", "comment": null}, "template_type": {"type": "text", "index": 4, "name": "template_type", "comment": null}, "created_at": {"type": "text", "index": 5, "name": "created_at", "comment": null}, "client_template_id": {"type": "text", "index": 6, "name": "client_template_id", "comment": null}, "creator_user_id": {"type": "text", "index": 7, "name": "creator_user_id", "comment": null}, "message_type_id": {"type": "text", "index": 8, "name": "message_type_id", "comment": null}, "updated_at": {"type": "text", "index": 9, "name": "updated_at", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 10, "name": "_fivetran_synced", "comment": null}, "latest_template_index": {"type": "bigint", "index": 11, "name": "latest_template_index", "comment": null}, "message_type_name": {"type": "text", "index": 12, "name": "message_type_name", "comment": null}, "channel_id": {"type": "text", "index": 13, "name": "channel_id", "comment": null}, "channel_name": {"type": "text", "index": 14, "name": "channel_name", "comment": null}, "channel_type": {"type": "text", "index": 15, "name": "channel_type", "comment": null}, "message_medium": {"type": "text", "index": 16, "name": "message_medium", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.int_iterable__latest_template"}, "model.iterable.int_iterable__latest_user": {"metadata": {"type": "VIEW", "schema": "public_iterable_dev", "name": "int_iterable__latest_user", "database": "postgres", "comment": "Table that filters out historical versions of the user, and returns only the most recent version.", "owner": "postgres"}, "columns": {"source_relation": {"type": "text", "index": 1, "name": "source_relation", "comment": null}, "_fivetran_user_id": {"type": "text", "index": 2, "name": "_fivetran_user_id", "comment": null}, "email": {"type": "text", "index": 3, "name": "email", "comment": null}, "updated_at": {"type": "timestamp without time zone", "index": 4, "name": "updated_at", "comment": null}, "user_id": {"type": "text", "index": 5, "name": "user_id", "comment": null}, "first_name": {"type": "integer", "index": 6, "name": "first_name", "comment": null}, "last_name": {"type": "integer", "index": 7, "name": "last_name", "comment": null}, "email_list_ids": {"type": "text", "index": 8, "name": "email_list_ids", "comment": null}, "phone_number": {"type": "integer", "index": 9, "name": "phone_number", "comment": null}, "signup_date": {"type": "text", "index": 10, "name": "signup_date", "comment": null}, "signup_source": {"type": "text", "index": 11, "name": "signup_source", "comment": null}, "iterable_user_id": {"type": "text", "index": 12, "name": "iterable_user_id", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 13, "name": "_fivetran_synced", "comment": null}, "unique_user_key": {"type": "text", "index": 14, "name": "unique_user_key", "comment": null}, "latest_user_index": {"type": "bigint", "index": 15, "name": "latest_user_index", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.int_iterable__latest_user"}, "model.iterable.int_iterable__list_user_history": {"metadata": {"type": "BASE TABLE", "schema": "public_iterable_dev", "name": "int_iterable__list_user_history", "database": "postgres", "comment": "Table that provides a history of all lists the user has been associated with.", "owner": "postgres"}, "columns": {"source_relation": {"type": "text", "index": 1, "name": "source_relation", "comment": null}, "_fivetran_user_id": {"type": "text", "index": 2, "name": "_fivetran_user_id", "comment": null}, "unique_user_key": {"type": "text", "index": 3, "name": "unique_user_key", "comment": null}, "email": {"type": "text", "index": 4, "name": "email", "comment": null}, "user_id": {"type": "text", "index": 5, "name": "user_id", "comment": null}, "first_name": {"type": "integer", "index": 6, "name": "first_name", "comment": null}, "last_name": {"type": "integer", "index": 7, "name": "last_name", "comment": null}, "email_list_ids": {"type": "text", "index": 8, "name": "email_list_ids", "comment": null}, "phone_number": {"type": "integer", "index": 9, "name": "phone_number", "comment": null}, "signup_date": {"type": "text", "index": 10, "name": "signup_date", "comment": null}, "signup_source": {"type": "text", "index": 11, "name": "signup_source", "comment": null}, "updated_at": {"type": "timestamp without time zone", "index": 12, "name": "updated_at", "comment": null}, "is_current": {"type": "boolean", "index": 13, "name": "is_current", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.int_iterable__list_user_history"}, "model.iterable.int_iterable__list_user_unnest": {"metadata": {"type": "BASE TABLE", "schema": "public_iterable_dev", "name": "int_iterable__list_user_unnest", "database": "postgres", "comment": "Table that unnests the `email_list_id` field for each user to create a new record for each user and the unique list it was associated with at a unique update. Due to the unnesting functions varying greatly between warehouses, conditional logic is applied throughout the model to appropriately accommodate the model being ran within Redshift, Snowflake, BigQuery, and Postgres.\n", "owner": "postgres"}, "columns": {"source_relation": {"type": "text", "index": 1, "name": "source_relation", "comment": null}, "_fivetran_user_id": {"type": "text", "index": 2, "name": "_fivetran_user_id", "comment": null}, "unique_user_key": {"type": "text", "index": 3, "name": "unique_user_key", "comment": null}, "user_id": {"type": "text", "index": 4, "name": "user_id", "comment": null}, "email": {"type": "text", "index": 5, "name": "email", "comment": null}, "first_name": {"type": "integer", "index": 6, "name": "first_name", "comment": null}, "last_name": {"type": "integer", "index": 7, "name": "last_name", "comment": null}, "signup_date": {"type": "text", "index": 8, "name": "signup_date", "comment": null}, "signup_source": {"type": "text", "index": 9, "name": "signup_source", "comment": null}, "updated_at": {"type": "timestamp without time zone", "index": 10, "name": "updated_at", "comment": null}, "phone_number": {"type": "integer", "index": 11, "name": "phone_number", "comment": null}, "is_current": {"type": "boolean", "index": 12, "name": "is_current", "comment": null}, "email_list_ids": {"type": "text", "index": 13, "name": "email_list_ids", "comment": null}, "list_id": {"type": "integer", "index": 14, "name": "list_id", "comment": null}, "unique_key": {"type": "text", "index": 15, "name": "unique_key", "comment": null}, "date_day": {"type": "date", "index": 16, "name": "date_day", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.int_iterable__list_user_unnest"}, "model.iterable.int_iterable__message_type_channel": {"metadata": {"type": "VIEW", "schema": "public_iterable_dev", "name": "int_iterable__message_type_channel", "database": "postgres", "comment": "Table that joins the message type and channel records together into one comprehensive model to be referenced downstream.", "owner": "postgres"}, "columns": {"source_relation": {"type": "text", "index": 1, "name": "source_relation", "comment": null}, "channel_id": {"type": "text", "index": 2, "name": "channel_id", "comment": null}, "channel_name": {"type": "text", "index": 3, "name": "channel_name", "comment": null}, "channel_type": {"type": "text", "index": 4, "name": "channel_type", "comment": null}, "message_medium": {"type": "text", "index": 5, "name": "message_medium", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 6, "name": "_fivetran_synced", "comment": null}, "message_type_name": {"type": "text", "index": 7, "name": "message_type_name", "comment": null}, "message_type_id": {"type": "text", "index": 8, "name": "message_type_id", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.int_iterable__message_type_channel"}, "model.iterable.int_iterable__recurring_campaigns": {"metadata": {"type": "VIEW", "schema": "public_iterable_dev", "name": "int_iterable__recurring_campaigns", "database": "postgres", "comment": "Table that identifies when a campaign is associated with a recurring campaign and provides additional enriched recurring campaign information.", "owner": "postgres"}, "columns": {"source_relation": {"type": "text", "index": 1, "name": "source_relation", "comment": null}, "campaign_id": {"type": "text", "index": 2, "name": "campaign_id", "comment": null}, "campaign_name": {"type": "text", "index": 3, "name": "campaign_name", "comment": null}, "updated_at": {"type": "text", "index": 4, "name": "updated_at", "comment": null}, "campaign_state": {"type": "text", "index": 5, "name": "campaign_state", "comment": null}, "campaign_type": {"type": "text", "index": 6, "name": "campaign_type", "comment": null}, "send_size": {"type": "integer", "index": 7, "name": "send_size", "comment": null}, "start_at": {"type": "integer", "index": 8, "name": "start_at", "comment": null}, "ended_at": {"type": "integer", "index": 9, "name": "ended_at", "comment": null}, "created_at": {"type": "text", "index": 10, "name": "created_at", "comment": null}, "created_by_user_id": {"type": "text", "index": 11, "name": "created_by_user_id", "comment": null}, "template_id": {"type": "text", "index": 12, "name": "template_id", "comment": null}, "recurring_campaign_id": {"type": "text", "index": 13, "name": "recurring_campaign_id", "comment": null}, "journey_id": {"type": "text", "index": 14, "name": "journey_id", "comment": null}, "recurring_campaign_name": {"type": "text", "index": 15, "name": "recurring_campaign_name", "comment": null}, "recurring_campaign_state": {"type": "text", "index": 16, "name": "recurring_campaign_state", "comment": null}, "recurring_campaign_send_size": {"type": "integer", "index": 17, "name": "recurring_campaign_send_size", "comment": null}, "recurring_campaign_start_at": {"type": "integer", "index": 18, "name": "recurring_campaign_start_at", "comment": null}, "is_campaign_recurring": {"type": "boolean", "index": 19, "name": "is_campaign_recurring", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.int_iterable__recurring_campaigns"}, "model.iterable.int_iterable__user_event_metrics": {"metadata": {"type": "VIEW", "schema": "public_iterable_dev", "name": "int_iterable__user_event_metrics", "database": "postgres", "comment": "Table that generates user aggregations at the campaign level.", "owner": "postgres"}, "columns": {"source_relation": {"type": "text", "index": 1, "name": "source_relation", "comment": null}, "_fivetran_user_id": {"type": "text", "index": 2, "name": "_fivetran_user_id", "comment": null}, "unique_user_key": {"type": "text", "index": 3, "name": "unique_user_key", "comment": null}, "user_id": {"type": "text", "index": 4, "name": "user_id", "comment": null}, "user_email": {"type": "text", "index": 5, "name": "user_email", "comment": null}, "count_total_campaigns": {"type": "bigint", "index": 6, "name": "count_total_campaigns", "comment": null}, "first_event_at": {"type": "timestamp without time zone", "index": 7, "name": "first_event_at", "comment": null}, "last_event_at": {"type": "timestamp without time zone", "index": 8, "name": "last_event_at", "comment": null}, "total_emailclick": {"type": "numeric", "index": 9, "name": "total_emailclick", "comment": null}, "total_emailunsubscribe": {"type": "numeric", "index": 10, "name": "total_emailunsubscribe", "comment": null}, "total_emailcomplaint": {"type": "numeric", "index": 11, "name": "total_emailcomplaint", "comment": null}, "total_customevent": {"type": "numeric", "index": 12, "name": "total_customevent", "comment": null}, "total_emailsubscribe": {"type": "numeric", "index": 13, "name": "total_emailsubscribe", "comment": null}, "total_emailopen": {"type": "numeric", "index": 14, "name": "total_emailopen", "comment": null}, "total_pushsend": {"type": "numeric", "index": 15, "name": "total_pushsend", "comment": null}, "total_smsbounce": {"type": "numeric", "index": 16, "name": "total_smsbounce", "comment": null}, "total_pushbounce": {"type": "numeric", "index": 17, "name": "total_pushbounce", "comment": null}, "total_inappsendskip": {"type": "numeric", "index": 18, "name": "total_inappsendskip", "comment": null}, "total_smssend": {"type": "numeric", "index": 19, "name": "total_smssend", "comment": null}, "total_inappsend": {"type": "numeric", "index": 20, "name": "total_inappsend", "comment": null}, "total_pushopen": {"type": "numeric", "index": 21, "name": "total_pushopen", "comment": null}, "total_emailsend": {"type": "numeric", "index": 22, "name": "total_emailsend", "comment": null}, "total_pushsendskip": {"type": "numeric", "index": 23, "name": "total_pushsendskip", "comment": null}, "total_inappopen": {"type": "numeric", "index": 24, "name": "total_inappopen", "comment": null}, "total_emailsendskip": {"type": "numeric", "index": 25, "name": "total_emailsendskip", "comment": null}, "total_emailbounce": {"type": "numeric", "index": 26, "name": "total_emailbounce", "comment": null}, "total_inappclick": {"type": "numeric", "index": 27, "name": "total_inappclick", "comment": null}, "total_pushuninstall": {"type": "numeric", "index": 28, "name": "total_pushuninstall", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.int_iterable__user_event_metrics"}, "model.iterable.iterable__campaigns": {"metadata": {"type": "BASE TABLE", "schema": "public_iterable_dev", "name": "iterable__campaigns", "database": "postgres", "comment": "Table that provides aggregations for campaigns at the template and if available, the experiment grain.", "owner": "postgres"}, "columns": {"source_relation": {"type": "text", "index": 1, "name": "source_relation", "comment": "Identifies the record's source."}, "campaign_id": {"type": "text", "index": 2, "name": "campaign_id", "comment": "Unique identifier of the campaign record"}, "campaign_name": {"type": "text", "index": 3, "name": "campaign_name", "comment": "User defined name of the campaign."}, "updated_at": {"type": "text", "index": 4, "name": "updated_at", "comment": "Last update timestamp"}, "campaign_state": {"type": "text", "index": 5, "name": "campaign_state", "comment": "State of the campaign. Can be Draft, Ready, Scheduled, Running, Finished, Starting, Aborted or Recurring"}, "campaign_type": {"type": "text", "index": 6, "name": "campaign_type", "comment": "The campaign type. Can be Blast or Triggered"}, "send_size": {"type": "integer", "index": 7, "name": "send_size", "comment": "Size of the campaign. Number of individuals included in the campaign"}, "start_at": {"type": "integer", "index": 8, "name": "start_at", "comment": "Start timestamp"}, "ended_at": {"type": "integer", "index": 9, "name": "ended_at", "comment": "Ended timestamp"}, "created_at": {"type": "text", "index": 10, "name": "created_at", "comment": "Creation timestamp"}, "created_by_user_id": {"type": "text", "index": 11, "name": "created_by_user_id", "comment": "Reference to the user who created the campaign"}, "template_id": {"type": "text", "index": 12, "name": "template_id", "comment": "Reference to the campaign template"}, "recurring_campaign_id": {"type": "text", "index": 13, "name": "recurring_campaign_id", "comment": "Unique identifier of the recurring campaign (if applicable)"}, "journey_id": {"type": "text", "index": 14, "name": "journey_id", "comment": "Reference to the journey the campaign belongs to, if applicable"}, "recurring_campaign_name": {"type": "text", "index": 15, "name": "recurring_campaign_name", "comment": "Name of the recurring campaign (if applicable)"}, "recurring_campaign_state": {"type": "text", "index": 16, "name": "recurring_campaign_state", "comment": "State of the recurring campaign (if applicable)"}, "recurring_campaign_send_size": {"type": "integer", "index": 17, "name": "recurring_campaign_send_size", "comment": "Size of the recurring campaign. Number of individuals included in the recurring campaign (if applicable)"}, "recurring_campaign_start_at": {"type": "integer", "index": 18, "name": "recurring_campaign_start_at", "comment": "Timestamp of when the recurring campaign started (if applicable)"}, "is_campaign_recurring": {"type": "boolean", "index": 19, "name": "is_campaign_recurring", "comment": "Boolean indicating if the campaign is a recurring campaign"}, "experiment_id": {"type": "integer", "index": 20, "name": "experiment_id", "comment": "Reference to the experiment used if the event is an experiment"}, "count_unique_users": {"type": "bigint", "index": 21, "name": "count_unique_users", "comment": "Count of total unique users within the campaign/experiment"}, "total_emailclick": {"type": "numeric", "index": 22, "name": "total_emailclick", "comment": "Total email clicks within the campaign/experiment"}, "unique_total_emailclick": {"type": "bigint", "index": 23, "name": "unique_total_emailclick", "comment": "Unique email clicks within the campaign/experiment"}, "total_emailunsubscribe": {"type": "numeric", "index": 24, "name": "total_emailunsubscribe", "comment": "Total email unsubscribe events within the campaign/experiment"}, "unique_total_emailunsubscribe": {"type": "bigint", "index": 25, "name": "unique_total_emailunsubscribe", "comment": "Unique total email unsubscribe events within the campaign/experiment"}, "total_emailcomplaint": {"type": "numeric", "index": 26, "name": "total_emailcomplaint", "comment": "Total email complaints within the campaign/experiment"}, "unique_total_emailcomplaint": {"type": "bigint", "index": 27, "name": "unique_total_emailcomplaint", "comment": "Unique total email complaints within the campaign/experiment"}, "total_customevent": {"type": "numeric", "index": 28, "name": "total_customevent", "comment": "Total custom events within the campaign/experiment"}, "unique_total_customevent": {"type": "bigint", "index": 29, "name": "unique_total_customevent", "comment": "Unique total custom events within the campaign/experiment"}, "total_emailsubscribe": {"type": "numeric", "index": 30, "name": "total_emailsubscribe", "comment": "Total email subscribe events within the campaign/experiment"}, "unique_total_emailsubscribe": {"type": "bigint", "index": 31, "name": "unique_total_emailsubscribe", "comment": "Unique total email subscribe events within the campaign/experiment"}, "total_emailopen": {"type": "numeric", "index": 32, "name": "total_emailopen", "comment": "Total email open events within the campaign/experiment"}, "unique_total_emailopen": {"type": "bigint", "index": 33, "name": "unique_total_emailopen", "comment": "Unique total email open events within the campaign/experiment"}, "total_pushsend": {"type": "numeric", "index": 34, "name": "total_pushsend", "comment": "Total push send event within the campaign/experiment"}, "unique_total_pushsend": {"type": "bigint", "index": 35, "name": "unique_total_pushsend", "comment": "Unique total push send events within the campaign/experiment"}, "total_smsbounce": {"type": "numeric", "index": 36, "name": "total_smsbounce", "comment": "Total sms bounce events within the campaign/experiment"}, "unique_total_smsbounce": {"type": "bigint", "index": 37, "name": "unique_total_smsbounce", "comment": "Unique total sms bounce events within the campaign/experiment"}, "total_pushbounce": {"type": "numeric", "index": 38, "name": "total_pushbounce", "comment": "Total push bounce events within the campaign/experiment"}, "unique_total_pushbounce": {"type": "bigint", "index": 39, "name": "unique_total_pushbounce", "comment": "Unique total push bounce events within the campaign/experiment"}, "total_inappsendskip": {"type": "numeric", "index": 40, "name": "total_inappsendskip", "comment": "Total in app send skip events within the campaign/experiment"}, "unique_total_inappsendskip": {"type": "bigint", "index": 41, "name": "unique_total_inappsendskip", "comment": "Unique total in app send skip events within the campaign/experiment"}, "total_smssend": {"type": "numeric", "index": 42, "name": "total_smssend", "comment": "Total sms send events within the campaign/experiment"}, "unique_total_smssend": {"type": "bigint", "index": 43, "name": "unique_total_smssend", "comment": "Unique total sms send events within the campaign/experiment"}, "total_inappsend": {"type": "numeric", "index": 44, "name": "total_inappsend", "comment": "Total in app send events within the campaign/experiment"}, "unique_total_inappsend": {"type": "bigint", "index": 45, "name": "unique_total_inappsend", "comment": "Unique total in app send events within the campaign/experiment"}, "total_pushopen": {"type": "numeric", "index": 46, "name": "total_pushopen", "comment": "Total push open events within the campaign/experiment"}, "unique_total_pushopen": {"type": "bigint", "index": 47, "name": "unique_total_pushopen", "comment": "Unique total push open events within the campaign/experiment"}, "total_emailsend": {"type": "numeric", "index": 48, "name": "total_emailsend", "comment": "Total email send events within the campaign/experiment"}, "unique_total_emailsend": {"type": "bigint", "index": 49, "name": "unique_total_emailsend", "comment": "Unique total email send events within the campaign/experiment"}, "total_pushsendskip": {"type": "numeric", "index": 50, "name": "total_pushsendskip", "comment": "Total push send skip events within the campaign/experiment"}, "unique_total_pushsendskip": {"type": "bigint", "index": 51, "name": "unique_total_pushsendskip", "comment": "Unique total push send skip events within the campaign/experiment"}, "total_inappopen": {"type": "numeric", "index": 52, "name": "total_inappopen", "comment": "Total in app open events within the campaign/experiment"}, "unique_total_inappopen": {"type": "bigint", "index": 53, "name": "unique_total_inappopen", "comment": "Unique total in app open events within the campaign/experiment"}, "total_emailsendskip": {"type": "numeric", "index": 54, "name": "total_emailsendskip", "comment": "Total email send skip events within the campaign/experiment"}, "unique_total_emailsendskip": {"type": "bigint", "index": 55, "name": "unique_total_emailsendskip", "comment": "Unique total email send skip events within the campaign/experiment"}, "total_emailbounce": {"type": "numeric", "index": 56, "name": "total_emailbounce", "comment": "Total email bounce events within the campaign/experiment"}, "unique_total_emailbounce": {"type": "bigint", "index": 57, "name": "unique_total_emailbounce", "comment": "Unique total email bounce events within the campaign/experiment"}, "total_inappclick": {"type": "numeric", "index": 58, "name": "total_inappclick", "comment": "Total in app click events within the campaign/experiment"}, "unique_total_inappclick": {"type": "bigint", "index": 59, "name": "unique_total_inappclick", "comment": "Unique total in app click events within the campaign/experiment"}, "total_pushuninstall": {"type": "numeric", "index": 60, "name": "total_pushuninstall", "comment": "Total push uninstall events within the campaign/experiment"}, "unique_total_pushuninstall": {"type": "bigint", "index": 61, "name": "unique_total_pushuninstall", "comment": "Unique total push uninstall events within the campaign/experiment"}, "count_send_lists": {"type": "bigint", "index": 62, "name": "count_send_lists", "comment": "Count of send lists within the campaign/experiment"}, "count_suppress_lists": {"type": "bigint", "index": 63, "name": "count_suppress_lists", "comment": "Count of suppress lists within the campaign/experiment"}, "labels": {"type": "text", "index": 64, "name": "labels", "comment": "List of labels associated with the campaign/experiment"}, "journey_name": {"type": "text", "index": 65, "name": "journey_name", "comment": "User defined name of the journey the campaign belongs to, if applicable"}, "journey_type": {"type": "text", "index": 66, "name": "journey_type", "comment": "The type of the journey the campaign belongs to, if applicable"}, "template_name": {"type": "text", "index": 67, "name": "template_name", "comment": "Name of the template associated with the campaign/experiment"}, "template_creator_user_id": {"type": "text", "index": 68, "name": "template_creator_user_id", "comment": "The creator user id of the template associated with the campaign/experiment"}, "message_medium": {"type": "text", "index": 69, "name": "message_medium", "comment": "The medium which the message was provided"}, "message_type_name": {"type": "text", "index": 70, "name": "message_type_name", "comment": "The message type name associated with the campaign/experiment"}, "channel_name": {"type": "text", "index": 71, "name": "channel_name", "comment": "The channel name associated with the campaign/experiment"}, "channel_id": {"type": "text", "index": 72, "name": "channel_id", "comment": "The channel identifier associated with the campaign/experiment"}, "channel_type": {"type": "text", "index": 73, "name": "channel_type", "comment": "The channel type associated with the campaign/experiment"}, "unique_campaign_version_id": {"type": "text", "index": 74, "name": "unique_campaign_version_id", "comment": "Unique identifier combining campaign_id, template_id, source_relation, and if available, experiment_id."}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.iterable__campaigns"}, "model.iterable.iterable__events": {"metadata": {"type": "BASE TABLE", "schema": "public_iterable_dev", "name": "iterable__events", "database": "postgres", "comment": "Table that provides a comprehensive view of all events with enriched information such as the campaign, user effected, and template used.", "owner": "postgres"}, "columns": {"source_relation": {"type": "text", "index": 1, "name": "source_relation", "comment": "Identifies the record's source."}, "event_id": {"type": "text", "index": 2, "name": "event_id", "comment": "Unique id of the event generated by Fivetran"}, "unique_event_id": {"type": "text", "index": 3, "name": "unique_event_id", "comment": "A unique surrogate key of event_id, _fivetran_user_id, and source_relation."}, "_fivetran_user_id": {"type": "text", "index": 4, "name": "_fivetran_user_id", "comment": "A Fivetran-created unique identifier for the new Iterable schema in Aug 2023, for users, derived from hashing user_id and/or email, depending on project type."}, "unique_user_key": {"type": "text", "index": 5, "name": "unique_user_key", "comment": "The unique identifier of the user. With the new schema (Aug 2023), it is the _fivetran_user_id. This is a hash of user_id and/or email, depending on project type. If using the old schema, it is email."}, "campaign_id": {"type": "text", "index": 6, "name": "campaign_id", "comment": "Reference to the campaign from which the event originated"}, "content_id": {"type": "text", "index": 7, "name": "content_id", "comment": "Reference to the content the event is associated with"}, "created_at": {"type": "timestamp without time zone", "index": 8, "name": "created_at", "comment": "Creation timestamp"}, "created_on": {"type": "date", "index": 9, "name": "created_on", "comment": "Day when the event was created"}, "email": {"type": "text", "index": 10, "name": "email", "comment": "The user's email. User identifier, for email-based projects. Previously was the unique identifier for user records, for the old Iterable schema before the August 2023 updates."}, "additional_properties": {"type": "text", "index": 11, "name": "additional_properties", "comment": "json object containing addition event properties"}, "event_name": {"type": "text", "index": 12, "name": "event_name", "comment": "Name provided to the individual event"}, "message_bus_id": {"type": "text", "index": 13, "name": "message_bus_id", "comment": "Reference to the message bus associated with the event"}, "message_id": {"type": "text", "index": 14, "name": "message_id", "comment": "Reference to the message the event is associated with"}, "message_type_id": {"type": "text", "index": 15, "name": "message_type_id", "comment": "Reference to the type of message the event is associated with"}, "recipient_state": {"type": "integer", "index": 16, "name": "recipient_state", "comment": "The state of the recipient upon receiving the event"}, "status": {"type": "integer", "index": 17, "name": "status", "comment": "Status of the event"}, "transactional_data": {"type": "character varying(100)", "index": 18, "name": "transactional_data", "comment": "Transactional data associated with the event"}, "unsub_source": {"type": "integer", "index": 19, "name": "unsub_source", "comment": "Source of the unsubscribe event"}, "user_agent": {"type": "integer", "index": 20, "name": "user_agent", "comment": "User agent associated with the event"}, "user_agent_device": {"type": "integer", "index": 21, "name": "user_agent_device", "comment": "The device of the user agent"}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 22, "name": "_fivetran_synced", "comment": "Timestamp of when the event record was synced by Fivetran"}, "campaign_name": {"type": "text", "index": 23, "name": "campaign_name", "comment": "The name of the campaign"}, "campaign_type": {"type": "text", "index": 24, "name": "campaign_type", "comment": "The type of campaign"}, "is_campaign_recurring": {"type": "boolean", "index": 25, "name": "is_campaign_recurring", "comment": "Boolean indicating if the campaign is recurrent"}, "recurring_campaign_name": {"type": "text", "index": 26, "name": "recurring_campaign_name", "comment": "The name of the recurring campaign (if applicable)"}, "recurring_campaign_id": {"type": "text", "index": 27, "name": "recurring_campaign_id", "comment": "The campaign if of the recurring campaign (if applicable)"}, "user_id": {"type": "text", "index": 28, "name": "user_id", "comment": "User identifier, for userID-based projects."}, "user_full_name": {"type": "text", "index": 29, "name": "user_full_name", "comment": "Full name of the user"}, "message_type_name": {"type": "text", "index": 30, "name": "message_type_name", "comment": "Name of the message type"}, "message_medium": {"type": "text", "index": 31, "name": "message_medium", "comment": "Medium of the message"}, "channel_id": {"type": "text", "index": 32, "name": "channel_id", "comment": "Unique identifier of the channel"}, "channel_name": {"type": "text", "index": 33, "name": "channel_name", "comment": "The channel name"}, "channel_type": {"type": "text", "index": 34, "name": "channel_type", "comment": "The type of channel"}, "is_app_already_running": {"type": "integer", "index": 35, "name": "is_app_already_running", "comment": "Boolean indicating if the app is already running"}, "badge": {"type": "integer", "index": 36, "name": "badge", "comment": "Badge associated with the event"}, "catalog_collection_count": {"type": "integer", "index": 37, "name": "catalog_collection_count", "comment": "The count of products or items collected in a catalog associated with the event."}, "catalog_lookup_count": {"type": "integer", "index": 38, "name": "catalog_lookup_count", "comment": "The count of times a catalog was looked up or queried during the event."}, "canonical_url_id": {"type": "text", "index": 39, "name": "canonical_url_id", "comment": "Reference to the url associated with the event"}, "is_content_available": {"type": "integer", "index": 40, "name": "is_content_available", "comment": "Content available from the event"}, "device": {"type": "integer", "index": 41, "name": "device", "comment": "The device associated with the event"}, "email_id": {"type": "text", "index": 42, "name": "email_id", "comment": "Reference to the email associated with the event"}, "email_subject": {"type": "text", "index": 43, "name": "email_subject", "comment": "Subject of the email associated with the event"}, "experiment_id": {"type": "integer", "index": 44, "name": "experiment_id", "comment": "Reference to the experiment used if the event is an experiment"}, "from_phone_number_id": {"type": "integer", "index": 45, "name": "from_phone_number_id", "comment": "Reference to the phone number which the event is from"}, "from_smssender_id": {"type": "integer", "index": 46, "name": "from_smssender_id", "comment": "Reference to the sms sender which the event is from"}, "link_id": {"type": "text", "index": 47, "name": "link_id", "comment": "Reference to the link associated with the event"}, "link_url": {"type": "integer", "index": 48, "name": "link_url", "comment": "Url of the link associated with the event"}, "locale": {"type": "integer", "index": 49, "name": "locale", "comment": "Locale associated with the event"}, "payload": {"type": "character varying(100)", "index": 50, "name": "payload", "comment": "Payload resulted from the event"}, "platform_endpoint": {"type": "integer", "index": 51, "name": "platform_endpoint", "comment": "The specific platform endpoint of the event"}, "push_message": {"type": "integer", "index": 52, "name": "push_message", "comment": "Boolean indicating if the event is a push message"}, "region": {"type": "text", "index": 53, "name": "region", "comment": "Region of the event"}, "sms_message": {"type": "integer", "index": 54, "name": "sms_message", "comment": "Boolean indicating if the event is an sms message"}, "to_phone_number": {"type": "integer", "index": 55, "name": "to_phone_number", "comment": "To phone number associated with the event"}, "url": {"type": "integer", "index": 56, "name": "url", "comment": "Url associated with the event"}, "workflow_id": {"type": "text", "index": 57, "name": "workflow_id", "comment": "Reference to the workflow which the event originated"}, "workflow_name": {"type": "text", "index": 58, "name": "workflow_name", "comment": "Name of the workflow which the event originated"}, "city": {"type": "text", "index": 59, "name": "city", "comment": "The city associated with the event, which could be the location of the recipient."}, "clicked_url": {"type": "text", "index": 60, "name": "clicked_url", "comment": "The URL that was clicked by the recipient in response to the marketing message."}, "country": {"type": "text", "index": 61, "name": "country", "comment": "The country associated with the event, which could be the location of the recipient."}, "error_code": {"type": "integer", "index": 62, "name": "error_code", "comment": "The error code or message indicating any issues or errors encountered during the event."}, "expires_at": {"type": "text", "index": 63, "name": "expires_at", "comment": "The date and time when the event or message is set to expire or become invalid."}, "from_phone_number": {"type": "integer", "index": 64, "name": "from_phone_number", "comment": "The phone number from which the SMS message was sent."}, "in_app_body": {"type": "text", "index": 65, "name": "in_app_body", "comment": "The content or body of an in-app message that was sent as part of the event."}, "is_sms_estimation": {"type": "boolean", "index": 66, "name": "is_sms_estimation", "comment": "A boolean indicating whether the SMS message is an estimation or not."}, "labels": {"type": "text", "index": 67, "name": "labels", "comment": "Any labels or tags associated with the event, which can be used for categorization or organization."}, "message_status": {"type": "text", "index": 68, "name": "message_status", "comment": "The status of the marketing message, such as sent, delivered, opened, etc."}, "mms_send_count": {"type": "integer", "index": 69, "name": "mms_send_count", "comment": "The count of multimedia messages (MMS) sent as part of the event."}, "reason": {"type": "text", "index": 70, "name": "reason", "comment": "The reason or cause associated with a specific event or action."}, "sms_send_count": {"type": "integer", "index": 71, "name": "sms_send_count", "comment": "The count of SMS messages sent as part of the event."}, "template_id": {"type": "text", "index": 72, "name": "template_id", "comment": "Unique identifier of the template"}, "template_name": {"type": "text", "index": 73, "name": "template_name", "comment": "User defined name of the template"}, "template_creator_user_id": {"type": "text", "index": 74, "name": "template_creator_user_id", "comment": "Reference to the user who created the template"}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.iterable__events"}, "model.iterable.iterable__journeys": {"metadata": {"type": "BASE TABLE", "schema": "public_iterable_dev", "name": "iterable__journeys", "database": "postgres", "comment": "Table that provides aggregations for journeys, formerly known as workflows. Metrics are rolled up from the user/campaign grain via each campaign's journey reference. Journeys which generate no events, such as those that only split audiences or update user fields, are still included with null metrics. The grain of this table is one record per journey.\n", "owner": "postgres"}, "columns": {"source_relation": {"type": "text", "index": 1, "name": "source_relation", "comment": "Identifies the record's source."}, "journey_id": {"type": "text", "index": 2, "name": "journey_id", "comment": "Unique identifier of the journey"}, "journey_name": {"type": "text", "index": 3, "name": "journey_name", "comment": "User defined name of the journey"}, "journey_type": {"type": "text", "index": 4, "name": "journey_type", "comment": "The journey type"}, "journey_description": {"type": "text", "index": 5, "name": "journey_description", "comment": "Information about the journey"}, "creator_user_id": {"type": "text", "index": 6, "name": "creator_user_id", "comment": "Reference to the user who created the journey"}, "is_enabled": {"type": "boolean", "index": 7, "name": "is_enabled", "comment": "Boolean indicating if the journey is currently enabled"}, "is_archived": {"type": "boolean", "index": 8, "name": "is_archived", "comment": "Boolean indicating if the journey has been archived"}, "lifetime_limit": {"type": "bigint", "index": 9, "name": "lifetime_limit", "comment": "Maximum number of times a user may enter the journey over their lifetime"}, "simultaneous_limit": {"type": "bigint", "index": 10, "name": "simultaneous_limit", "comment": "Maximum number of times a user may be in the journey at the same time"}, "start_tile_id": {"type": "text", "index": 11, "name": "start_tile_id", "comment": "Reference to the tile which begins the journey"}, "trigger_event_names": {"type": "text", "index": 12, "name": "trigger_event_names", "comment": "The event names which trigger a user's entry into the journey"}, "created_at": {"type": "timestamp without time zone", "index": 13, "name": "created_at", "comment": "Creation timestamp"}, "updated_at": {"type": "timestamp without time zone", "index": 14, "name": "updated_at", "comment": "Last update timestamp"}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 15, "name": "_fivetran_synced", "comment": "The time when a record was last updated by Fivetran."}, "count_total_campaigns": {"type": "bigint", "index": 16, "name": "count_total_campaigns", "comment": "Count of distinct campaigns within the journey that generated events"}, "count_unique_users": {"type": "bigint", "index": 17, "name": "count_unique_users", "comment": "Count of total unique users within the journey"}, "first_event_at": {"type": "timestamp without time zone", "index": 18, "name": "first_event_at", "comment": "Timestamp of the first event generated by any campaign in the journey"}, "last_event_at": {"type": "timestamp without time zone", "index": 19, "name": "last_event_at", "comment": "Timestamp of the most recent event generated by any campaign in the journey"}, "total_emailclick": {"type": "numeric", "index": 20, "name": "total_emailclick", "comment": "Total email clicks within the journey"}, "unique_total_emailclick": {"type": "bigint", "index": 21, "name": "unique_total_emailclick", "comment": "Count of distinct users with email clicks within the journey"}, "total_emailunsubscribe": {"type": "numeric", "index": 22, "name": "total_emailunsubscribe", "comment": "Total email unsubscribe events within the journey"}, "unique_total_emailunsubscribe": {"type": "bigint", "index": 23, "name": "unique_total_emailunsubscribe", "comment": "Count of distinct users with email unsubscribe events within the journey"}, "total_emailcomplaint": {"type": "numeric", "index": 24, "name": "total_emailcomplaint", "comment": "Total email complaints within the journey"}, "unique_total_emailcomplaint": {"type": "bigint", "index": 25, "name": "unique_total_emailcomplaint", "comment": "Count of distinct users with email complaints within the journey"}, "total_customevent": {"type": "numeric", "index": 26, "name": "total_customevent", "comment": "Total custom events within the journey"}, "unique_total_customevent": {"type": "bigint", "index": 27, "name": "unique_total_customevent", "comment": "Count of distinct users with custom events within the journey"}, "total_emailsubscribe": {"type": "numeric", "index": 28, "name": "total_emailsubscribe", "comment": "Total email subscribe events within the journey"}, "unique_total_emailsubscribe": {"type": "bigint", "index": 29, "name": "unique_total_emailsubscribe", "comment": "Count of distinct users with email subscribe events within the journey"}, "total_emailopen": {"type": "numeric", "index": 30, "name": "total_emailopen", "comment": "Total email open events within the journey"}, "unique_total_emailopen": {"type": "bigint", "index": 31, "name": "unique_total_emailopen", "comment": "Count of distinct users with email open events within the journey"}, "total_pushsend": {"type": "numeric", "index": 32, "name": "total_pushsend", "comment": "Total push send events within the journey"}, "unique_total_pushsend": {"type": "bigint", "index": 33, "name": "unique_total_pushsend", "comment": "Count of distinct users with push send events within the journey"}, "total_smsbounce": {"type": "numeric", "index": 34, "name": "total_smsbounce", "comment": "Total sms bounce events within the journey"}, "unique_total_smsbounce": {"type": "bigint", "index": 35, "name": "unique_total_smsbounce", "comment": "Count of distinct users with sms bounce events within the journey"}, "total_pushbounce": {"type": "numeric", "index": 36, "name": "total_pushbounce", "comment": "Total push bounce events within the journey"}, "unique_total_pushbounce": {"type": "bigint", "index": 37, "name": "unique_total_pushbounce", "comment": "Count of distinct users with push bounce events within the journey"}, "total_inappsendskip": {"type": "numeric", "index": 38, "name": "total_inappsendskip", "comment": "Total in app send skip events within the journey"}, "unique_total_inappsendskip": {"type": "bigint", "index": 39, "name": "unique_total_inappsendskip", "comment": "Count of distinct users with in app send skip events within the journey"}, "total_smssend": {"type": "numeric", "index": 40, "name": "total_smssend", "comment": "Total sms send events within the journey"}, "unique_total_smssend": {"type": "bigint", "index": 41, "name": "unique_total_smssend", "comment": "Count of distinct users with sms send events within the journey"}, "total_inappsend": {"type": "numeric", "index": 42, "name": "total_inappsend", "comment": "Total in app send events within the journey"}, "unique_total_inappsend": {"type": "bigint", "index": 43, "name": "unique_total_inappsend", "comment": "Count of distinct users with in app send events within the journey"}, "total_pushopen": {"type": "numeric", "index": 44, "name": "total_pushopen", "comment": "Total push open events within the journey"}, "unique_total_pushopen": {"type": "bigint", "index": 45, "name": "unique_total_pushopen", "comment": "Count of distinct users with push open events within the journey"}, "total_emailsend": {"type": "numeric", "index": 46, "name": "total_emailsend", "comment": "Total email send events within the journey"}, "unique_total_emailsend": {"type": "bigint", "index": 47, "name": "unique_total_emailsend", "comment": "Count of distinct users with email send events within the journey"}, "total_pushsendskip": {"type": "numeric", "index": 48, "name": "total_pushsendskip", "comment": "Total push send skip events within the journey"}, "unique_total_pushsendskip": {"type": "bigint", "index": 49, "name": "unique_total_pushsendskip", "comment": "Count of distinct users with push send skip events within the journey"}, "total_inappopen": {"type": "numeric", "index": 50, "name": "total_inappopen", "comment": "Total in app open events within the journey"}, "unique_total_inappopen": {"type": "bigint", "index": 51, "name": "unique_total_inappopen", "comment": "Count of distinct users with in app open events within the journey"}, "total_emailsendskip": {"type": "numeric", "index": 52, "name": "total_emailsendskip", "comment": "Total email send skip events within the journey"}, "unique_total_emailsendskip": {"type": "bigint", "index": 53, "name": "unique_total_emailsendskip", "comment": "Count of distinct users with email send skip events within the journey"}, "total_emailbounce": {"type": "numeric", "index": 54, "name": "total_emailbounce", "comment": "Total email bounce events within the journey"}, "unique_total_emailbounce": {"type": "bigint", "index": 55, "name": "unique_total_emailbounce", "comment": "Count of distinct users with email bounce events within the journey"}, "total_inappclick": {"type": "numeric", "index": 56, "name": "total_inappclick", "comment": "Total in app click events within the journey"}, "unique_total_inappclick": {"type": "bigint", "index": 57, "name": "unique_total_inappclick", "comment": "Count of distinct users with in app click events within the journey"}, "total_pushuninstall": {"type": "numeric", "index": 58, "name": "total_pushuninstall", "comment": "Total push uninstall events within the journey"}, "unique_total_pushuninstall": {"type": "bigint", "index": 59, "name": "unique_total_pushuninstall", "comment": "Count of distinct users with push uninstall events within the journey"}, "unique_journey_id": {"type": "text", "index": 60, "name": "unique_journey_id", "comment": "Unique identifier combining journey_id and source_relation."}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.iterable__journeys"}, "model.iterable.iterable__list_user_history": {"metadata": {"type": "BASE TABLE", "schema": "public_iterable_dev", "name": "iterable__list_user_history", "database": "postgres", "comment": "Table that recreates the `list_user_history` source table. Additionally, this table provides an `is_current` field to identify the current lists associated with the user. The table coalesces list_id values from both the direct list_user relationships and the unnested email_list_ids from user history to ensure comprehensive list coverage. The grain of this table is at the user/list/updated_at level.\n", "owner": "postgres"}, "columns": {"source_relation": {"type": "text", "index": 1, "name": "source_relation", "comment": "Identifies the record's source."}, "unique_user_key": {"type": "text", "index": 2, "name": "unique_user_key", "comment": "The unique identifier of the user. With the new schema (Aug 2023), it is the _fivetran_user_id. This is a hash of user_id and/or email, depending on project type. If using the old schema, it is email."}, "_fivetran_user_id": {"type": "text", "index": 3, "name": "_fivetran_user_id", "comment": "A Fivetran-created unique identifier for the new Iterable schema in Aug 2023, for users, derived from hashing user_id and/or email, depending on project type."}, "user_id": {"type": "text", "index": 4, "name": "user_id", "comment": "User identifier, for userID-based projects."}, "user_email": {"type": "text", "index": 5, "name": "user_email", "comment": "Email of the user if it exists."}, "user_first_name": {"type": "integer", "index": 6, "name": "user_first_name", "comment": "First name of the user"}, "user_last_name": {"type": "integer", "index": 7, "name": "user_last_name", "comment": "Last name of the user"}, "user_signup_date": {"type": "text", "index": 8, "name": "user_signup_date", "comment": "Timestamp of when the user signed up"}, "user_signup_source": {"type": "text", "index": 9, "name": "user_signup_source", "comment": "Source where the user signed up"}, "user_updated_at": {"type": "timestamp without time zone", "index": 10, "name": "user_updated_at", "comment": "Last update timestamp"}, "list_id": {"type": "bigint", "index": 11, "name": "list_id", "comment": "The list associated with the user. Uses coalesced values prioritizing `list_id` from `LIST_USER` over the unnested `email_list_ids` from `USER_HISTORY` for comprehensive list coverage."}, "is_current": {"type": "boolean", "index": 12, "name": "is_current", "comment": "Boolean indicating if the current list is active"}, "list_name": {"type": "text", "index": 13, "name": "list_name", "comment": "Name of the list associated with the user"}, "list_type": {"type": "text", "index": 14, "name": "list_type", "comment": "Type of list associated with the user"}, "list_created_at": {"type": "text", "index": 15, "name": "list_created_at", "comment": "Date the list was created"}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.iterable__list_user_history"}, "model.iterable.iterable__user_campaign": {"metadata": {"type": "BASE TABLE", "schema": "public_iterable_dev", "name": "iterable__user_campaign", "database": "postgres", "comment": "Table that provides total and unique metrics for a user associated with particular campaigns and if available, experiments.", "owner": "postgres"}, "columns": {"source_relation": {"type": "text", "index": 1, "name": "source_relation", "comment": "Identifies the record's source."}, "_fivetran_user_id": {"type": "text", "index": 2, "name": "_fivetran_user_id", "comment": "A Fivetran-created unique identifier for the new Iterable schema in Aug 2023, for users, derived from hashing user_id and/or email, depending on project type."}, "unique_user_key": {"type": "text", "index": 3, "name": "unique_user_key", "comment": "The unique identifier of the user. With the new schema (Aug 2023), it is the _fivetran_user_id. This is a hash of user_id and/or email, depending on project type. If using the old schema, it is email."}, "user_id": {"type": "text", "index": 4, "name": "user_id", "comment": "User identifier, for userID-based projects."}, "campaign_id": {"type": "text", "index": 5, "name": "campaign_id", "comment": "The unique identifier of the campaign which the user metrics are associated"}, "experiment_id": {"type": "integer", "index": 6, "name": "experiment_id", "comment": "The unique experiment variation of the campaign"}, "user_email": {"type": "text", "index": 7, "name": "user_email", "comment": "Email of the user if it exists."}, "user_full_name": {"type": "text", "index": 8, "name": "user_full_name", "comment": "The users first and last name"}, "campaign_name": {"type": "text", "index": 9, "name": "campaign_name", "comment": "The name of the campaign which the user metrics are associated"}, "template_id": {"type": "text", "index": 10, "name": "template_id", "comment": "The unique identifier of the template used within the campaign"}, "template_name": {"type": "text", "index": 11, "name": "template_name", "comment": "The name of the template used for the campaign"}, "recurring_campaign_id": {"type": "text", "index": 12, "name": "recurring_campaign_id", "comment": "The unique identifier of the recurring campaign which the campaign is tied to"}, "recurring_campaign_name": {"type": "text", "index": 13, "name": "recurring_campaign_name", "comment": "The name of the recurring campaign which the campaign is tied to"}, "first_event_at": {"type": "timestamp without time zone", "index": 14, "name": "first_event_at", "comment": "Timestamp of the first campaign/experiment event associated with the user"}, "last_event_at": {"type": "timestamp without time zone", "index": 15, "name": "last_event_at", "comment": "Timestamp of the most recent campaign/experiment event associated with the user"}, "first_open_or_click_event_at": {"type": "timestamp without time zone", "index": 16, "name": "first_open_or_click_event_at", "comment": "The time of the first open or click time. This is the first time a user interacts with a campaign, recording the earliest occurring event out of 'emailOpen', 'emailClick', and 'pushOpen'."}, "total_emailclick": {"type": "bigint", "index": 17, "name": "total_emailclick", "comment": "Total email clicks events the user took within the campaign/experiment"}, "total_emailunsubscribe": {"type": "bigint", "index": 18, "name": "total_emailunsubscribe", "comment": "Total email unsubscription events the user performed within the campaign/experiment"}, "total_emailcomplaint": {"type": "bigint", "index": 19, "name": "total_emailcomplaint", "comment": "Total email complaint events the user performed within the campaign/experiment"}, "total_customevent": {"type": "bigint", "index": 20, "name": "total_customevent", "comment": "Total custom events associated with the user within the campaign/experiment"}, "total_emailsubscribe": {"type": "bigint", "index": 21, "name": "total_emailsubscribe", "comment": "Total email subscription events associate with the user within the campaign/experiment"}, "total_emailopen": {"type": "bigint", "index": 22, "name": "total_emailopen", "comment": "Total email open events the user performed within the campaign/experiment"}, "total_pushsend": {"type": "bigint", "index": 23, "name": "total_pushsend", "comment": "Total push send events the user performed within the campaign/experiment"}, "total_smsbounce": {"type": "bigint", "index": 24, "name": "total_smsbounce", "comment": "Total sms bounce events associated with the user within the campaign/experiment"}, "total_pushbounce": {"type": "bigint", "index": 25, "name": "total_pushbounce", "comment": "Total push bounce events associated with the user within the campaign/experiment"}, "total_inappsendskip": {"type": "bigint", "index": 26, "name": "total_inappsendskip", "comment": "Total in app send skip events the user performed within the campaign/experiment"}, "total_smssend": {"type": "bigint", "index": 27, "name": "total_smssend", "comment": "Total sms send events associated with the user within the campaign/experiment"}, "total_inappsend": {"type": "bigint", "index": 28, "name": "total_inappsend", "comment": "Total in app send events associated with the user within the campaign/experiment"}, "total_pushopen": {"type": "bigint", "index": 29, "name": "total_pushopen", "comment": "Total push open events the user performed within the campaign/experiment"}, "total_emailsend": {"type": "bigint", "index": 30, "name": "total_emailsend", "comment": "Total email send event associated with the user within the campaign/experiment"}, "total_pushsendskip": {"type": "bigint", "index": 31, "name": "total_pushsendskip", "comment": "Total push send skip events associated with the user within the campaign/experiment"}, "total_inappopen": {"type": "bigint", "index": 32, "name": "total_inappopen", "comment": "Total in app open events associated with the user within the campaign/experiment"}, "total_emailsendskip": {"type": "bigint", "index": 33, "name": "total_emailsendskip", "comment": "Total email send skip events associated with the user within the campaign/experiment"}, "total_emailbounce": {"type": "bigint", "index": 34, "name": "total_emailbounce", "comment": "Total email bounce events associated with the user within the campaign/experiment"}, "total_inappclick": {"type": "bigint", "index": 35, "name": "total_inappclick", "comment": "Total in app click events associated with the user within the campaign/experiment"}, "total_pushuninstall": {"type": "bigint", "index": 36, "name": "total_pushuninstall", "comment": "Total push uninstall events associated with the user within the campaign/experiment"}, "unique_user_campaign_id": {"type": "text", "index": 37, "name": "unique_user_campaign_id", "comment": "Unique ID combining source_relation, unique_user_key, campaign_id, and if available, experiment_id."}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.iterable__user_campaign"}, "model.iterable.iterable__user_unsubscriptions": {"metadata": {"type": "BASE TABLE", "schema": "public_iterable_dev", "name": "iterable__user_unsubscriptions", "database": "postgres", "comment": "Table that generates the total channel and message types a user has chosen to unsubscribe.", "owner": "postgres"}, "columns": {"source_relation": {"type": "text", "index": 1, "name": "source_relation", "comment": "Identifies the record's source."}, "_fivetran_user_id": {"type": "text", "index": 2, "name": "_fivetran_user_id", "comment": "A Fivetran-created unique identifier for the new Iterable schema in Aug 2023, for users, derived from hashing user_id and/or email, depending on project type."}, "unique_user_key": {"type": "text", "index": 3, "name": "unique_user_key", "comment": "The unique identifier of the user. With the new schema (Aug 2023), it is the _fivetran_user_id. This is a hash of user_id and/or email, depending on project type. If using the old schema, it is email."}, "channel_id": {"type": "text", "index": 4, "name": "channel_id", "comment": "Unique identifier of the channel which the user is unsubscribed"}, "message_type_id": {"type": "text", "index": 5, "name": "message_type_id", "comment": "Unique identifier of the message type which the user is unsubscribed"}, "updated_at": {"type": "timestamp without time zone", "index": 6, "name": "updated_at", "comment": "Timestamp of when the user unsubscribed from the channel or message type"}, "channel_name": {"type": "text", "index": 7, "name": "channel_name", "comment": "The name of the channel which the user is unsubscribed"}, "message_type_name": {"type": "text", "index": 8, "name": "message_type_name", "comment": "The name of the message type which the user is unsubscribed"}, "channel_type": {"type": "text", "index": 9, "name": "channel_type", "comment": "The channel type which the user is unsubscribed"}, "message_medium": {"type": "text", "index": 10, "name": "message_medium", "comment": "The medium type the message was provided which the user is unsubscribed"}, "is_unsubscribed_channel_wide": {"type": "boolean", "index": 11, "name": "is_unsubscribed_channel_wide", "comment": "Boolean indicating if the user unsubscribed at the channel level (i.e. unsubscribed to all message types) or if they unsubscribed from only an individual message type.\n"}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.iterable__user_unsubscriptions"}, "model.iterable.iterable__users": {"metadata": {"type": "BASE TABLE", "schema": "public_iterable_dev", "name": "iterable__users", "database": "postgres", "comment": "Table that provides unique user enriched information.", "owner": "postgres"}, "columns": {"source_relation": {"type": "text", "index": 1, "name": "source_relation", "comment": "Identifies the record's source."}, "user_id": {"type": "text", "index": 2, "name": "user_id", "comment": "User identifier, for userID-based projects."}, "_fivetran_user_id": {"type": "text", "index": 3, "name": "_fivetran_user_id", "comment": "A Fivetran-created unique identifier for the new Iterable schema in Aug 2023, for users, derived from hashing user_id and/or email, depending on project type."}, "unique_user_key": {"type": "text", "index": 4, "name": "unique_user_key", "comment": "The unique identifier of the user. With the new schema (Aug 2023), it is the _fivetran_user_id. This is a hash of user_id and/or email, depending on project type. If using the old schema, it is email."}, "email": {"type": "text", "index": 5, "name": "email", "comment": "The user's email. User identifier, for email-based projects. Previously was the unique identifier for user records, for the old Iterable schema before the August 2023 updates."}, "first_name": {"type": "integer", "index": 6, "name": "first_name", "comment": "First name of the user"}, "last_name": {"type": "integer", "index": 7, "name": "last_name", "comment": "Last name of the user"}, "signup_date": {"type": "text", "index": 8, "name": "signup_date", "comment": "Timestamp of when the user signed up"}, "signup_source": {"type": "text", "index": 9, "name": "signup_source", "comment": "Source where the user signed up"}, "updated_at": {"type": "timestamp without time zone", "index": 10, "name": "updated_at", "comment": "Last update timestamp"}, "phone_number": {"type": "integer", "index": 11, "name": "phone_number", "comment": "Phone number associated with the user"}, "email_list_ids": {"type": "text", "index": 12, "name": "email_list_ids", "comment": "Array of all email lists associated with the user, derived from the list_user table relationships"}, "count_lists": {"type": "bigint", "index": 13, "name": "count_lists", "comment": "Total count of lists associated with the user"}, "count_total_campaigns": {"type": "bigint", "index": 14, "name": "count_total_campaigns", "comment": "Count of all campaigns the user has been in"}, "first_event_at": {"type": "timestamp without time zone", "index": 15, "name": "first_event_at", "comment": "The first event the user ever encountered"}, "last_event_at": {"type": "timestamp without time zone", "index": 16, "name": "last_event_at", "comment": "The most recent event the user has encountered"}, "total_emailclick": {"type": "numeric", "index": 17, "name": "total_emailclick", "comment": "Total number of email clicks the user has performed"}, "total_emailunsubscribe": {"type": "numeric", "index": 18, "name": "total_emailunsubscribe", "comment": "Total unsubscription events the user has performed"}, "total_emailcomplaint": {"type": "numeric", "index": 19, "name": "total_emailcomplaint", "comment": "Total email complaints the user has performed"}, "total_customevent": {"type": "numeric", "index": 20, "name": "total_customevent", "comment": "Total custom events associated with the user"}, "total_emailsubscribe": {"type": "numeric", "index": 21, "name": "total_emailsubscribe", "comment": "Total subscription events the user has performed"}, "total_emailopen": {"type": "numeric", "index": 22, "name": "total_emailopen", "comment": "Total email opened events the user has performed"}, "total_pushsend": {"type": "numeric", "index": 23, "name": "total_pushsend", "comment": "The push send events the user has experienced"}, "total_smsbounce": {"type": "numeric", "index": 24, "name": "total_smsbounce", "comment": "Total sms bounces that are associated with the user"}, "total_pushbounce": {"type": "numeric", "index": 25, "name": "total_pushbounce", "comment": "Total number of push bounces associated with the user"}, "total_inappsendskip": {"type": "numeric", "index": 26, "name": "total_inappsendskip", "comment": "Total in app send skips associated with the user"}, "total_smssend": {"type": "numeric", "index": 27, "name": "total_smssend", "comment": "Total sms sends that the user has experienced"}, "total_inappsend": {"type": "numeric", "index": 28, "name": "total_inappsend", "comment": "Total in app sends the user has experienced"}, "total_pushopen": {"type": "numeric", "index": 29, "name": "total_pushopen", "comment": "Total push messages the user has opened"}, "total_emailsend": {"type": "numeric", "index": 30, "name": "total_emailsend", "comment": "Total emails that have been sent to the user"}, "total_pushsendskip": {"type": "numeric", "index": 31, "name": "total_pushsendskip", "comment": "Total push sends the user has skipped"}, "total_inappopen": {"type": "numeric", "index": 32, "name": "total_inappopen", "comment": "Total in app opens the user has performed"}, "total_emailsendskip": {"type": "numeric", "index": 33, "name": "total_emailsendskip", "comment": "Total email sends the user has skipped"}, "total_emailbounce": {"type": "numeric", "index": 34, "name": "total_emailbounce", "comment": "Total number of emails that have bounced from the user"}, "total_inappclick": {"type": "numeric", "index": 35, "name": "total_inappclick", "comment": "Total in app clicks associated with the user"}, "total_pushuninstall": {"type": "numeric", "index": 36, "name": "total_pushuninstall", "comment": "Total push uninstall events the user has performed"}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.iterable__users"}, "model.iterable.stg_iterable__campaign_history": {"metadata": {"type": "BASE TABLE", "schema": "public_iterable_dev", "name": "stg_iterable__campaign_history", "database": "postgres", "comment": "Table containing a history of campaigns.", "owner": "postgres"}, "columns": {"source_relation": {"type": "text", "index": 1, "name": "source_relation", "comment": "Identifies the record's source."}, "campaign_id": {"type": "text", "index": 2, "name": "campaign_id", "comment": "Unique identifier of the campaign record"}, "updated_at": {"type": "text", "index": 3, "name": "updated_at", "comment": "Last update timestamp"}, "campaign_name": {"type": "text", "index": 4, "name": "campaign_name", "comment": "User defined name of the campaign."}, "campaign_state": {"type": "text", "index": 5, "name": "campaign_state", "comment": "State of the campaign. Can be Draft, Ready, Scheduled, Running, Finished, Starting, Aborted or Recurring"}, "campaign_type": {"type": "text", "index": 6, "name": "campaign_type", "comment": "The campaign type. Can be Blast or Triggered"}, "send_size": {"type": "integer", "index": 7, "name": "send_size", "comment": "Size of the campaign. Number of individuals included in the campaign"}, "start_at": {"type": "integer", "index": 8, "name": "start_at", "comment": "Start timestamp"}, "ended_at": {"type": "integer", "index": 9, "name": "ended_at", "comment": "Ended timestamp"}, "created_at": {"type": "text", "index": 10, "name": "created_at", "comment": "Creation timestamp"}, "message_medium": {"type": "text", "index": 11, "name": "message_medium", "comment": "The medium that this message was sent via, for example Email or InApp"}, "recurring_campaign_id": {"type": "text", "index": 12, "name": "recurring_campaign_id", "comment": "Reference to the recurring campaign, if applicable"}, "created_by_user_id": {"type": "text", "index": 13, "name": "created_by_user_id", "comment": "Reference to the user who created the campaign"}, "updated_by_user_id": {"type": "text", "index": 14, "name": "updated_by_user_id", "comment": "ID of the user who updated this record"}, "template_id": {"type": "text", "index": 15, "name": "template_id", "comment": "Reference to the campaign template"}, "workflow_id": {"type": "integer", "index": 16, "name": "workflow_id", "comment": "Reference to the workflow which the event originated"}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 17, "name": "_fivetran_synced", "comment": "The time when a record was last updated by Fivetran."}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.stg_iterable__campaign_history"}, "model.iterable.stg_iterable__campaign_history_tmp": {"metadata": {"type": "VIEW", "schema": "public_iterable_dev", "name": "stg_iterable__campaign_history_tmp", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"id": {"type": "integer", "index": 1, "name": "id", "comment": null}, "updated_at": {"type": "text", "index": 2, "name": "updated_at", "comment": null}, "template_id": {"type": "integer", "index": 3, "name": "template_id", "comment": null}, "recurring_campaign_id": {"type": "integer", "index": 4, "name": "recurring_campaign_id", "comment": null}, "campaign_state": {"type": "text", "index": 5, "name": "campaign_state", "comment": null}, "created_at": {"type": "text", "index": 6, "name": "created_at", "comment": null}, "created_by_user_id": {"type": "text", "index": 7, "name": "created_by_user_id", "comment": null}, "ended_at": {"type": "integer", "index": 8, "name": "ended_at", "comment": null}, "name": {"type": "text", "index": 9, "name": "name", "comment": null}, "send_size": {"type": "integer", "index": 10, "name": "send_size", "comment": null}, "start_at": {"type": "integer", "index": 11, "name": "start_at", "comment": null}, "type": {"type": "text", "index": 12, "name": "type", "comment": null}, "workflow_id": {"type": "integer", "index": 13, "name": "workflow_id", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 14, "name": "_fivetran_synced", "comment": null}, "updated_by_user_id": {"type": "integer", "index": 15, "name": "updated_by_user_id", "comment": null}, "message_medium": {"type": "text", "index": 16, "name": "message_medium", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.stg_iterable__campaign_history_tmp"}, "model.iterable.stg_iterable__campaign_label_history": {"metadata": {"type": "BASE TABLE", "schema": "public_iterable_dev", "name": "stg_iterable__campaign_label_history", "database": "postgres", "comment": "Table containing a history of labels.", "owner": "postgres"}, "columns": {"source_relation": {"type": "text", "index": 1, "name": "source_relation", "comment": "Identifies the record's source."}, "campaign_id": {"type": "text", "index": 2, "name": "campaign_id", "comment": "Reference to the campaign associated with the label"}, "label": {"type": "text", "index": 3, "name": "label", "comment": "Name of the label"}, "updated_at": {"type": "text", "index": 4, "name": "updated_at", "comment": "Last update timestamp"}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 5, "name": "_fivetran_synced", "comment": "The time when a record was last updated by Fivetran."}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.stg_iterable__campaign_label_history"}, "model.iterable.stg_iterable__campaign_label_history_tmp": {"metadata": {"type": "VIEW", "schema": "public_iterable_dev", "name": "stg_iterable__campaign_label_history_tmp", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"campaign_id": {"type": "integer", "index": 1, "name": "campaign_id", "comment": null}, "label": {"type": "text", "index": 2, "name": "label", "comment": null}, "updated_at": {"type": "text", "index": 3, "name": "updated_at", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 4, "name": "_fivetran_synced", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.stg_iterable__campaign_label_history_tmp"}, "model.iterable.stg_iterable__campaign_list_history": {"metadata": {"type": "BASE TABLE", "schema": "public_iterable_dev", "name": "stg_iterable__campaign_list_history", "database": "postgres", "comment": "Table containing a history of lists.", "owner": "postgres"}, "columns": {"source_relation": {"type": "text", "index": 1, "name": "source_relation", "comment": "Identifies the record's source."}, "campaign_id": {"type": "text", "index": 2, "name": "campaign_id", "comment": "Reference to the campaign associated with the label"}, "list_id": {"type": "text", "index": 3, "name": "list_id", "comment": "Reference to the list used"}, "updated_at": {"type": "text", "index": 4, "name": "updated_at", "comment": "Last update timestamp"}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 5, "name": "_fivetran_synced", "comment": "The time when a record was last updated by Fivetran."}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.stg_iterable__campaign_list_history"}, "model.iterable.stg_iterable__campaign_list_history_tmp": {"metadata": {"type": "VIEW", "schema": "public_iterable_dev", "name": "stg_iterable__campaign_list_history_tmp", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"list_id": {"type": "integer", "index": 1, "name": "list_id", "comment": null}, "campaign_id": {"type": "integer", "index": 2, "name": "campaign_id", "comment": null}, "updated_at": {"type": "text", "index": 3, "name": "updated_at", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 4, "name": "_fivetran_synced", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.stg_iterable__campaign_list_history_tmp"}, "model.iterable.stg_iterable__campaign_suppression_list_history": {"metadata": {"type": "BASE TABLE", "schema": "public_iterable_dev", "name": "stg_iterable__campaign_suppression_list_history", "database": "postgres", "comment": "Table containing a history of suppression lists.", "owner": "postgres"}, "columns": {"source_relation": {"type": "text", "index": 1, "name": "source_relation", "comment": "Identifies the record's source."}, "campaign_id": {"type": "text", "index": 2, "name": "campaign_id", "comment": "Reference to the campaign associated with the label"}, "suppressed_list_id": {"type": "text", "index": 3, "name": "suppressed_list_id", "comment": "Reference to the list used"}, "updated_at": {"type": "text", "index": 4, "name": "updated_at", "comment": "Last update timestamp"}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 5, "name": "_fivetran_synced", "comment": "The time when a record was last updated by Fivetran."}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.stg_iterable__campaign_suppression_list_history"}, "model.iterable.stg_iterable__campaign_suppression_list_history_tmp": {"metadata": {"type": "VIEW", "schema": "public_iterable_dev", "name": "stg_iterable__campaign_suppression_list_history_tmp", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"suppressed_list_id": {"type": "integer", "index": 1, "name": "suppressed_list_id", "comment": null}, "campaign_id": {"type": "integer", "index": 2, "name": "campaign_id", "comment": null}, "updated_at": {"type": "text", "index": 3, "name": "updated_at", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 4, "name": "_fivetran_synced", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.stg_iterable__campaign_suppression_list_history_tmp"}, "model.iterable.stg_iterable__channel": {"metadata": {"type": "BASE TABLE", "schema": "public_iterable_dev", "name": "stg_iterable__channel", "database": "postgres", "comment": "Table containing unique channels.", "owner": "postgres"}, "columns": {"source_relation": {"type": "text", "index": 1, "name": "source_relation", "comment": "Identifies the record's source."}, "channel_id": {"type": "text", "index": 2, "name": "channel_id", "comment": "Unique identifier of the channel"}, "channel_name": {"type": "text", "index": 3, "name": "channel_name", "comment": "User defined name of the channel"}, "channel_type": {"type": "text", "index": 4, "name": "channel_type", "comment": "The channel type"}, "message_medium": {"type": "text", "index": 5, "name": "message_medium", "comment": "The message medium associated with the channel"}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 6, "name": "_fivetran_synced", "comment": "The time when a record was last updated by Fivetran."}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.stg_iterable__channel"}, "model.iterable.stg_iterable__channel_tmp": {"metadata": {"type": "VIEW", "schema": "public_iterable_dev", "name": "stg_iterable__channel_tmp", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"id": {"type": "bigint", "index": 1, "name": "id", "comment": null}, "name": {"type": "text", "index": 2, "name": "name", "comment": null}, "channel_type": {"type": "text", "index": 3, "name": "channel_type", "comment": null}, "message_medium": {"type": "text", "index": 4, "name": "message_medium", "comment": null}, "_fivetran_deleted": {"type": "boolean", "index": 5, "name": "_fivetran_deleted", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 6, "name": "_fivetran_synced", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.stg_iterable__channel_tmp"}, "model.iterable.stg_iterable__event": {"metadata": {"type": "VIEW", "schema": "public_iterable_dev", "name": "stg_iterable__event", "database": "postgres", "comment": "Table containing individual events within campaigns.", "owner": "postgres"}, "columns": {"source_relation": {"type": "text", "index": 1, "name": "source_relation", "comment": "Identifies the record's source."}, "event_id": {"type": "text", "index": 2, "name": "event_id", "comment": "A Fivetran-created unique identifier derived from hashing campaign_id, created_at, and event_name."}, "unique_event_id": {"type": "text", "index": 3, "name": "unique_event_id", "comment": "A surrogate key made up of event_id, _fivetran_user_id, and source_relation."}, "_fivetran_user_id": {"type": "text", "index": 4, "name": "_fivetran_user_id", "comment": "A Fivetran-created unique identifier for users, derived from hashing user_id and/or email, depending on project type. This exists for users of the new schema starting Aug 2023. In the old schema, the unique identifier is email."}, "unique_user_key": {"type": "text", "index": 5, "name": "unique_user_key", "comment": "The unique identifier of the user. With the new schema (Aug 2023), it is the _fivetran_user_id. This is a hash of user_id and/or email, depending on project type. If using the old schema, it is email."}, "campaign_id": {"type": "text", "index": 6, "name": "campaign_id", "comment": "Reference to the campaign from which the event originated"}, "content_id": {"type": "text", "index": 7, "name": "content_id", "comment": "Reference to the content the event is associated with"}, "created_at": {"type": "timestamp without time zone", "index": 8, "name": "created_at", "comment": "Creation timestamp"}, "created_on": {"type": "date", "index": 9, "name": "created_on", "comment": "Creation date"}, "email": {"type": "text", "index": 10, "name": "email", "comment": "Reference to the unique user the event was applied to"}, "additional_properties": {"type": "text", "index": 11, "name": "additional_properties", "comment": "json object containing addition event properties"}, "event_name": {"type": "text", "index": 12, "name": "event_name", "comment": "Name provided to the individual event"}, "message_bus_id": {"type": "text", "index": 13, "name": "message_bus_id", "comment": "Reference to the message bus associated with the event"}, "message_id": {"type": "text", "index": 14, "name": "message_id", "comment": "Reference to the message the event is associated with"}, "message_type_id": {"type": "text", "index": 15, "name": "message_type_id", "comment": "Reference to the type of message the event is associated with"}, "recipient_state": {"type": "integer", "index": 16, "name": "recipient_state", "comment": "The state of the recipient upon receiving the event"}, "status": {"type": "integer", "index": 17, "name": "status", "comment": "Status of the event"}, "transactional_data": {"type": "character varying(100)", "index": 18, "name": "transactional_data", "comment": "Transactional data associated with the event"}, "unsub_source": {"type": "integer", "index": 19, "name": "unsub_source", "comment": "Source of the unsubscribe event"}, "user_agent": {"type": "integer", "index": 20, "name": "user_agent", "comment": "User agent associated with the event"}, "user_agent_device": {"type": "integer", "index": 21, "name": "user_agent_device", "comment": "The device of the user agent"}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 22, "name": "_fivetran_synced", "comment": "The time when a record was last updated by Fivetran."}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.stg_iterable__event"}, "model.iterable.stg_iterable__event_extension": {"metadata": {"type": "VIEW", "schema": "public_iterable_dev", "name": "stg_iterable__event_extension", "database": "postgres", "comment": "Table containing addition properties from the event table.", "owner": "postgres"}, "columns": {"source_relation": {"type": "text", "index": 1, "name": "source_relation", "comment": "Identifies the record's source."}, "event_id": {"type": "text", "index": 2, "name": "event_id", "comment": "A Fivetran-created unique identifier derived from hashing campaign_id, created_at, and event_name."}, "unique_event_id": {"type": "text", "index": 3, "name": "unique_event_id", "comment": "A surrogate key made up of event_id, _fivetran_user_id, and source_relation."}, "is_app_already_running": {"type": "integer", "index": 4, "name": "is_app_already_running", "comment": "Boolean indicating if the app is currently running or not"}, "badge": {"type": "integer", "index": 5, "name": "badge", "comment": "Badge associated with the event"}, "catalog_collection_count": {"type": "integer", "index": 6, "name": "catalog_collection_count", "comment": "The count of products or items collected in a catalog associated with the event."}, "catalog_lookup_count": {"type": "integer", "index": 7, "name": "catalog_lookup_count", "comment": "The count of times a catalog was looked up or queried during the event."}, "canonical_url_id": {"type": "text", "index": 8, "name": "canonical_url_id", "comment": "Reference to the url associated with the event"}, "is_content_available": {"type": "integer", "index": 9, "name": "is_content_available", "comment": "Content available from the event"}, "content_id": {"type": "text", "index": 10, "name": "content_id", "comment": "Reference to the content associated with the event"}, "device": {"type": "integer", "index": 11, "name": "device", "comment": "The device associated with the event"}, "email_id": {"type": "text", "index": 12, "name": "email_id", "comment": "Reference to the email associated with the event"}, "email_subject": {"type": "text", "index": 13, "name": "email_subject", "comment": "Subject of the email associated with the event"}, "experiment_id": {"type": "integer", "index": 14, "name": "experiment_id", "comment": "Reference to the experiment used if the event is an experiment"}, "from_phone_number_id": {"type": "integer", "index": 15, "name": "from_phone_number_id", "comment": "Reference to the phone number which the event is from"}, "from_smssender_id": {"type": "integer", "index": 16, "name": "from_smssender_id", "comment": "Reference to the sms sender which the event is from"}, "link_id": {"type": "text", "index": 17, "name": "link_id", "comment": "Reference to the link associated with the event"}, "link_url": {"type": "integer", "index": 18, "name": "link_url", "comment": "Url of the link associated with the event"}, "locale": {"type": "integer", "index": 19, "name": "locale", "comment": "Locale associated with the event"}, "payload": {"type": "character varying(100)", "index": 20, "name": "payload", "comment": "Payload resulted from the event"}, "platform_endpoint": {"type": "integer", "index": 21, "name": "platform_endpoint", "comment": "The specific platform endpoint of the event"}, "push_message": {"type": "integer", "index": 22, "name": "push_message", "comment": "Boolean indicating if the event is a push message"}, "region": {"type": "text", "index": 23, "name": "region", "comment": "Region of the event"}, "sms_message": {"type": "integer", "index": 24, "name": "sms_message", "comment": "Boolean indicating if the event is an sms message"}, "to_phone_number": {"type": "integer", "index": 25, "name": "to_phone_number", "comment": "To phone number associated with the event"}, "url": {"type": "integer", "index": 26, "name": "url", "comment": "Url associated with the event"}, "workflow_id": {"type": "text", "index": 27, "name": "workflow_id", "comment": "Reference to the workflow which the event originated"}, "workflow_name": {"type": "text", "index": 28, "name": "workflow_name", "comment": "Name of the workflow which the event originated"}, "city": {"type": "text", "index": 29, "name": "city", "comment": "The city associated with the event, which could be the location of the recipient."}, "clicked_url": {"type": "text", "index": 30, "name": "clicked_url", "comment": "The URL that was clicked by the recipient in response to the marketing message."}, "country": {"type": "text", "index": 31, "name": "country", "comment": "The country associated with the event, which could be the location of the recipient."}, "error_code": {"type": "integer", "index": 32, "name": "error_code", "comment": "The error code or message indicating any issues or errors encountered during the event."}, "expires_at": {"type": "text", "index": 33, "name": "expires_at", "comment": "The date and time when the event or message is set to expire or become invalid."}, "from_phone_number": {"type": "integer", "index": 34, "name": "from_phone_number", "comment": "The phone number from which the SMS message was sent."}, "in_app_body": {"type": "text", "index": 35, "name": "in_app_body", "comment": "The content or body of an in-app message that was sent as part of the event."}, "is_sms_estimation": {"type": "boolean", "index": 36, "name": "is_sms_estimation", "comment": "A boolean indicating whether the SMS message is an estimation or not."}, "labels": {"type": "text", "index": 37, "name": "labels", "comment": "Any labels or tags associated with the event, which can be used for categorization or organization."}, "message_status": {"type": "text", "index": 38, "name": "message_status", "comment": "The status of the marketing message, such as sent, delivered, opened, etc."}, "mms_send_count": {"type": "integer", "index": 39, "name": "mms_send_count", "comment": "The count of multimedia messages (MMS) sent as part of the event."}, "reason": {"type": "text", "index": 40, "name": "reason", "comment": "The reason or cause associated with a specific event or action."}, "sms_send_count": {"type": "integer", "index": 41, "name": "sms_send_count", "comment": "The count of SMS messages sent as part of the event."}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 42, "name": "_fivetran_synced", "comment": "The time when a record was last updated by Fivetran."}, "_fivetran_user_id": {"type": "text", "index": 43, "name": "_fivetran_user_id", "comment": "A Fivetran-created unique identifier for users, derived from hashing user_id and/or email, depending on project type. This exists for users of the new schema starting Aug 2023. In the old schema, the unique identifier is email."}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.stg_iterable__event_extension"}, "model.iterable.stg_iterable__event_extension_tmp": {"metadata": {"type": "VIEW", "schema": "public_iterable_dev", "name": "stg_iterable__event_extension_tmp", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"_fivetran_id": {"type": "text", "index": 1, "name": "_fivetran_id", "comment": null}, "app_already_running": {"type": "integer", "index": 2, "name": "app_already_running", "comment": null}, "badge": {"type": "integer", "index": 3, "name": "badge", "comment": null}, "canonical_url_id": {"type": "integer", "index": 4, "name": "canonical_url_id", "comment": null}, "content_available": {"type": "integer", "index": 5, "name": "content_available", "comment": null}, "content_id": {"type": "integer", "index": 6, "name": "content_id", "comment": null}, "device": {"type": "integer", "index": 7, "name": "device", "comment": null}, "email_id": {"type": "text", "index": 8, "name": "email_id", "comment": null}, "email_subject": {"type": "text", "index": 9, "name": "email_subject", "comment": null}, "experiment_id": {"type": "integer", "index": 10, "name": "experiment_id", "comment": null}, "from_phone_number_id": {"type": "integer", "index": 11, "name": "from_phone_number_id", "comment": null}, "from_smssender_id": {"type": "integer", "index": 12, "name": "from_smssender_id", "comment": null}, "image_url": {"type": "integer", "index": 13, "name": "image_url", "comment": null}, "is_ghost_push": {"type": "integer", "index": 14, "name": "is_ghost_push", "comment": null}, "link_id": {"type": "integer", "index": 15, "name": "link_id", "comment": null}, "link_url": {"type": "integer", "index": 16, "name": "link_url", "comment": null}, "platform_endpoint": {"type": "integer", "index": 17, "name": "platform_endpoint", "comment": null}, "push_message": {"type": "integer", "index": 18, "name": "push_message", "comment": null}, "region": {"type": "text", "index": 19, "name": "region", "comment": null}, "sms_message": {"type": "integer", "index": 20, "name": "sms_message", "comment": null}, "sound": {"type": "integer", "index": 21, "name": "sound", "comment": null}, "to_phone_number": {"type": "integer", "index": 22, "name": "to_phone_number", "comment": null}, "url": {"type": "integer", "index": 23, "name": "url", "comment": null}, "workflow_id": {"type": "integer", "index": 24, "name": "workflow_id", "comment": null}, "workflow_name": {"type": "text", "index": 25, "name": "workflow_name", "comment": null}, "locale": {"type": "integer", "index": 26, "name": "locale", "comment": null}, "deeplink_android": {"type": "integer", "index": 27, "name": "deeplink_android", "comment": null}, "deeplink_ios": {"type": "integer", "index": 28, "name": "deeplink_ios", "comment": null}, "payload": {"type": "character varying(100)", "index": 29, "name": "payload", "comment": null}, "sms_provider_response_status": {"type": "integer", "index": 30, "name": "sms_provider_response_status", "comment": null}, "sms_provider_response_message": {"type": "integer", "index": 31, "name": "sms_provider_response_message", "comment": null}, "sms_provider_response_code": {"type": "integer", "index": 32, "name": "sms_provider_response_code", "comment": null}, "sms_provider_response_more_info": {"type": "integer", "index": 33, "name": "sms_provider_response_more_info", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 34, "name": "_fivetran_synced", "comment": null}, "catalog_collection_count": {"type": "integer", "index": 35, "name": "catalog_collection_count", "comment": null}, "catalog_lookup_count": {"type": "integer", "index": 36, "name": "catalog_lookup_count", "comment": null}, "city": {"type": "text", "index": 37, "name": "city", "comment": null}, "clicked_url": {"type": "text", "index": 38, "name": "clicked_url", "comment": null}, "country": {"type": "text", "index": 39, "name": "country", "comment": null}, "error_code": {"type": "integer", "index": 40, "name": "error_code", "comment": null}, "expires_at": {"type": "text", "index": 41, "name": "expires_at", "comment": null}, "from_phone_number": {"type": "integer", "index": 42, "name": "from_phone_number", "comment": null}, "in_app_body": {"type": "text", "index": 43, "name": "in_app_body", "comment": null}, "is_sms_estimation": {"type": "boolean", "index": 44, "name": "is_sms_estimation", "comment": null}, "labels": {"type": "text", "index": 45, "name": "labels", "comment": null}, "message_context": {"type": "text", "index": 46, "name": "message_context", "comment": null}, "message_status": {"type": "text", "index": 47, "name": "message_status", "comment": null}, "mms_send_count": {"type": "integer", "index": 48, "name": "mms_send_count", "comment": null}, "product_recommendation_count": {"type": "integer", "index": 49, "name": "product_recommendation_count", "comment": null}, "proxy_source": {"type": "text", "index": 50, "name": "proxy_source", "comment": null}, "reason": {"type": "text", "index": 51, "name": "reason", "comment": null}, "sms_send_count": {"type": "integer", "index": 52, "name": "sms_send_count", "comment": null}, "web_push_body": {"type": "text", "index": 53, "name": "web_push_body", "comment": null}, "web_push_click_action": {"type": "text", "index": 54, "name": "web_push_click_action", "comment": null}, "web_push_icon": {"type": "text", "index": 55, "name": "web_push_icon", "comment": null}, "web_push_message": {"type": "text", "index": 56, "name": "web_push_message", "comment": null}, "_fivetran_user_id": {"type": "integer", "index": 57, "name": "_fivetran_user_id", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.stg_iterable__event_extension_tmp"}, "model.iterable.stg_iterable__event_tmp": {"metadata": {"type": "VIEW", "schema": "public_iterable_dev", "name": "stg_iterable__event_tmp", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"_fivetran_id": {"type": "text", "index": 1, "name": "_fivetran_id", "comment": null}, "email": {"type": "text", "index": 2, "name": "email", "comment": null}, "campaign_id": {"type": "integer", "index": 3, "name": "campaign_id", "comment": null}, "message_id": {"type": "integer", "index": 4, "name": "message_id", "comment": null}, "content_id": {"type": "integer", "index": 5, "name": "content_id", "comment": null}, "created_at": {"type": "timestamp without time zone", "index": 6, "name": "created_at", "comment": null}, "event_name": {"type": "text", "index": 7, "name": "event_name", "comment": null}, "ip": {"type": "integer", "index": 8, "name": "ip", "comment": null}, "message_bus_id": {"type": "integer", "index": 9, "name": "message_bus_id", "comment": null}, "message_type_id": {"type": "integer", "index": 10, "name": "message_type_id", "comment": null}, "recipient_state": {"type": "integer", "index": 11, "name": "recipient_state", "comment": null}, "status": {"type": "integer", "index": 12, "name": "status", "comment": null}, "unsub_source": {"type": "integer", "index": 13, "name": "unsub_source", "comment": null}, "user_agent": {"type": "integer", "index": 14, "name": "user_agent", "comment": null}, "user_agent_device": {"type": "integer", "index": 15, "name": "user_agent_device", "comment": null}, "transactional_data": {"type": "character varying(100)", "index": 16, "name": "transactional_data", "comment": null}, "additional_properties": {"type": "text", "index": 17, "name": "additional_properties", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 18, "name": "_fivetran_synced", "comment": null}, "_fivetran_user_id": {"type": "integer", "index": 19, "name": "_fivetran_user_id", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.stg_iterable__event_tmp"}, "model.iterable.stg_iterable__journey": {"metadata": {"type": "BASE TABLE", "schema": "public_iterable_dev", "name": "stg_iterable__journey", "database": "postgres", "comment": "Table containing unique journeys, formerly known as workflows.", "owner": "postgres"}, "columns": {"source_relation": {"type": "text", "index": 1, "name": "source_relation", "comment": "Identifies the record's source."}, "journey_id": {"type": "text", "index": 2, "name": "journey_id", "comment": "Unique identifier of the journey"}, "journey_name": {"type": "text", "index": 3, "name": "journey_name", "comment": "User defined name of the journey"}, "journey_type": {"type": "text", "index": 4, "name": "journey_type", "comment": "Whether the journey is published or a draft"}, "journey_description": {"type": "text", "index": 5, "name": "journey_description", "comment": "Information about the journey"}, "creator_user_id": {"type": "text", "index": 6, "name": "creator_user_id", "comment": "Reference to the user who created the journey"}, "is_enabled": {"type": "boolean", "index": 7, "name": "is_enabled", "comment": "Boolean indicating if the journey is currently enabled"}, "is_archived": {"type": "boolean", "index": 8, "name": "is_archived", "comment": "Boolean indicating if the journey has been archived"}, "lifetime_limit": {"type": "bigint", "index": 9, "name": "lifetime_limit", "comment": "Maximum number of times a user may enter the journey over their lifetime"}, "simultaneous_limit": {"type": "bigint", "index": 10, "name": "simultaneous_limit", "comment": "Maximum number of times a user may be in the journey at the same time"}, "start_tile_id": {"type": "text", "index": 11, "name": "start_tile_id", "comment": "Reference to the tile which begins the journey"}, "trigger_event_names": {"type": "text", "index": 12, "name": "trigger_event_names", "comment": "The event names which trigger a user's entry into the journey"}, "created_at": {"type": "timestamp without time zone", "index": 13, "name": "created_at", "comment": "Creation timestamp"}, "updated_at": {"type": "timestamp without time zone", "index": 14, "name": "updated_at", "comment": "Last update timestamp"}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 15, "name": "_fivetran_synced", "comment": "The time when a record was last updated by Fivetran."}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.stg_iterable__journey"}, "model.iterable.stg_iterable__journey_tmp": {"metadata": {"type": "VIEW", "schema": "public_iterable_dev", "name": "stg_iterable__journey_tmp", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"id": {"type": "bigint", "index": 1, "name": "id", "comment": null}, "name": {"type": "text", "index": 2, "name": "name", "comment": null}, "journey_type": {"type": "text", "index": 3, "name": "journey_type", "comment": null}, "description": {"type": "text", "index": 4, "name": "description", "comment": null}, "creator_user_id": {"type": "text", "index": 5, "name": "creator_user_id", "comment": null}, "enabled": {"type": "boolean", "index": 6, "name": "enabled", "comment": null}, "is_archived": {"type": "boolean", "index": 7, "name": "is_archived", "comment": null}, "lifetime_limit": {"type": "bigint", "index": 8, "name": "lifetime_limit", "comment": null}, "simultaneous_limit": {"type": "bigint", "index": 9, "name": "simultaneous_limit", "comment": null}, "start_tile_id": {"type": "bigint", "index": 10, "name": "start_tile_id", "comment": null}, "trigger_event_names": {"type": "text", "index": 11, "name": "trigger_event_names", "comment": null}, "created_at": {"type": "timestamp without time zone", "index": 12, "name": "created_at", "comment": null}, "updated_at": {"type": "timestamp without time zone", "index": 13, "name": "updated_at", "comment": null}, "_fivetran_deleted": {"type": "boolean", "index": 14, "name": "_fivetran_deleted", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 15, "name": "_fivetran_synced", "comment": null}, "draft_name": {"type": "text", "index": 16, "name": "draft_name", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.stg_iterable__journey_tmp"}, "model.iterable.stg_iterable__list": {"metadata": {"type": "BASE TABLE", "schema": "public_iterable_dev", "name": "stg_iterable__list", "database": "postgres", "comment": "Table containing users and the lists the users are associated with.", "owner": "postgres"}, "columns": {"source_relation": {"type": "text", "index": 1, "name": "source_relation", "comment": "Identifies the record's source."}, "list_id": {"type": "integer", "index": 2, "name": "list_id", "comment": "Unique identifier of the list"}, "list_name": {"type": "text", "index": 3, "name": "list_name", "comment": "User defined name of the list"}, "list_type": {"type": "text", "index": 4, "name": "list_type", "comment": "The list type"}, "created_at": {"type": "text", "index": 5, "name": "created_at", "comment": "Creation timestamp"}, "list_description": {"type": "text", "index": 6, "name": "list_description", "comment": "Information about the list"}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 7, "name": "_fivetran_synced", "comment": "The time when a record was last updated by Fivetran."}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.stg_iterable__list"}, "model.iterable.stg_iterable__list_tmp": {"metadata": {"type": "VIEW", "schema": "public_iterable_dev", "name": "stg_iterable__list_tmp", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"id": {"type": "integer", "index": 1, "name": "id", "comment": null}, "name": {"type": "text", "index": 2, "name": "name", "comment": null}, "created_at": {"type": "text", "index": 3, "name": "created_at", "comment": null}, "list_type": {"type": "text", "index": 4, "name": "list_type", "comment": null}, "_fivetran_deleted": {"type": "boolean", "index": 5, "name": "_fivetran_deleted", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 6, "name": "_fivetran_synced", "comment": null}, "description": {"type": "text", "index": 7, "name": "description", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.stg_iterable__list_tmp"}, "model.iterable.stg_iterable__list_user": {"metadata": {"type": "BASE TABLE", "schema": "public_iterable_dev", "name": "stg_iterable__list_user", "database": "postgres", "comment": "Table containing the relationship between users and lists they belong to.", "owner": "postgres"}, "columns": {"source_relation": {"type": "text", "index": 1, "name": "source_relation", "comment": "Identifies the record's source."}, "_fivetran_user_id": {"type": "text", "index": 2, "name": "_fivetran_user_id", "comment": "Unique identifier of the list-user relationship record, serving as a foreign key to `stg_iterable__user_history._fivetran_id`."}, "list_user_index": {"type": "bigint", "index": 3, "name": "list_user_index", "comment": "Index of the record"}, "list_id": {"type": "bigint", "index": 4, "name": "list_id", "comment": "Reference to the list that the user belongs to"}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 5, "name": "_fivetran_synced", "comment": "The time when a record was last updated by Fivetran."}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.stg_iterable__list_user"}, "model.iterable.stg_iterable__list_user_tmp": {"metadata": {"type": "VIEW", "schema": "public_iterable_dev", "name": "stg_iterable__list_user_tmp", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"_fivetran_id": {"type": "text", "index": 1, "name": "_fivetran_id", "comment": null}, "index": {"type": "bigint", "index": 2, "name": "index", "comment": null}, "list_id": {"type": "bigint", "index": 3, "name": "list_id", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 4, "name": "_fivetran_synced", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.stg_iterable__list_user_tmp"}, "model.iterable.stg_iterable__message_type": {"metadata": {"type": "BASE TABLE", "schema": "public_iterable_dev", "name": "stg_iterable__message_type", "database": "postgres", "comment": "Table containing unique message types.", "owner": "postgres"}, "columns": {"source_relation": {"type": "text", "index": 1, "name": "source_relation", "comment": "Identifies the record's source."}, "message_type_id": {"type": "text", "index": 2, "name": "message_type_id", "comment": "Unique identifier of the message type"}, "message_type_name": {"type": "text", "index": 3, "name": "message_type_name", "comment": "User defined name of the message type"}, "channel_id": {"type": "text", "index": 4, "name": "channel_id", "comment": "Channel that this message type belongs to"}, "message_type_created_at": {"type": "timestamp without time zone", "index": 5, "name": "message_type_created_at", "comment": "Time when the message type was initially created"}, "frequency_cap": {"type": "integer", "index": 6, "name": "frequency_cap", "comment": "The maximum number of times a message of this type can be sent to a recipient within a specified time period to prevent over-messaging"}, "rate_limit_per_minute": {"type": "integer", "index": 7, "name": "rate_limit_per_minute", "comment": "The maximum number of messages of this type that can be sent to recipients in a minute, ensuring controlled message delivery"}, "subscription_policy": {"type": "text", "index": 8, "name": "subscription_policy", "comment": "Information about the policy or rules governing how users can subscribe to or unsubscribe from this specific message type, like OptOut"}, "message_type_updated_at": {"type": "timestamp without time zone", "index": 9, "name": "message_type_updated_at", "comment": "Time when the message type was last updated or modified"}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 10, "name": "_fivetran_synced", "comment": "The time when a record was last updated by Fivetran."}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.stg_iterable__message_type"}, "model.iterable.stg_iterable__message_type_tmp": {"metadata": {"type": "VIEW", "schema": "public_iterable_dev", "name": "stg_iterable__message_type_tmp", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"id": {"type": "bigint", "index": 1, "name": "id", "comment": null}, "name": {"type": "text", "index": 2, "name": "name", "comment": null}, "channel_id": {"type": "bigint", "index": 3, "name": "channel_id", "comment": null}, "_fivetran_deleted": {"type": "boolean", "index": 4, "name": "_fivetran_deleted", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 5, "name": "_fivetran_synced", "comment": null}, "created_at": {"type": "timestamp without time zone", "index": 6, "name": "created_at", "comment": null}, "frequency_cap": {"type": "integer", "index": 7, "name": "frequency_cap", "comment": null}, "rate_limit_per_minute": {"type": "integer", "index": 8, "name": "rate_limit_per_minute", "comment": null}, "subscription_policy": {"type": "text", "index": 9, "name": "subscription_policy", "comment": null}, "updated_at": {"type": "timestamp without time zone", "index": 10, "name": "updated_at", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.stg_iterable__message_type_tmp"}, "model.iterable.stg_iterable__template_history": {"metadata": {"type": "BASE TABLE", "schema": "public_iterable_dev", "name": "stg_iterable__template_history", "database": "postgres", "comment": "Table containing unique templates used across campaigns.", "owner": "postgres"}, "columns": {"source_relation": {"type": "text", "index": 1, "name": "source_relation", "comment": "Identifies the record's source."}, "template_id": {"type": "text", "index": 2, "name": "template_id", "comment": "Unique identifier of the template"}, "template_name": {"type": "text", "index": 3, "name": "template_name", "comment": "User defined name of the template"}, "template_type": {"type": "text", "index": 4, "name": "template_type", "comment": "The type of the template"}, "created_at": {"type": "text", "index": 5, "name": "created_at", "comment": "Creation timestamp"}, "client_template_id": {"type": "text", "index": 6, "name": "client_template_id", "comment": "Reference to the client template"}, "creator_user_id": {"type": "text", "index": 7, "name": "creator_user_id", "comment": "Reference to the user who created the template"}, "message_type_id": {"type": "text", "index": 8, "name": "message_type_id", "comment": "Reference to the message type associated with the template"}, "updated_at": {"type": "text", "index": 9, "name": "updated_at", "comment": "Last update timestamp"}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 10, "name": "_fivetran_synced", "comment": "The time when a record was last updated by Fivetran."}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.stg_iterable__template_history"}, "model.iterable.stg_iterable__template_history_tmp": {"metadata": {"type": "VIEW", "schema": "public_iterable_dev", "name": "stg_iterable__template_history_tmp", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"id": {"type": "integer", "index": 1, "name": "id", "comment": null}, "updated_at": {"type": "text", "index": 2, "name": "updated_at", "comment": null}, "message_type_id": {"type": "integer", "index": 3, "name": "message_type_id", "comment": null}, "client_template_id": {"type": "integer", "index": 4, "name": "client_template_id", "comment": null}, "created_at": {"type": "text", "index": 5, "name": "created_at", "comment": null}, "creator_user_id": {"type": "text", "index": 6, "name": "creator_user_id", "comment": null}, "name": {"type": "text", "index": 7, "name": "name", "comment": null}, "template_type": {"type": "text", "index": 8, "name": "template_type", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 9, "name": "_fivetran_synced", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.stg_iterable__template_history_tmp"}, "model.iterable.stg_iterable__user_history": {"metadata": {"type": "VIEW", "schema": "public_iterable_dev", "name": "stg_iterable__user_history", "database": "postgres", "comment": "Table containing individual user history information.", "owner": "postgres"}, "columns": {"source_relation": {"type": "text", "index": 1, "name": "source_relation", "comment": "Identifies the record's source."}, "_fivetran_user_id": {"type": "text", "index": 2, "name": "_fivetran_user_id", "comment": "A Fivetran-created unique identifier for users, derived from hashing user_id and/or email, depending on project type. This exists for users of the new schema starting Aug 2023. In the old schema, the unique identifier is email."}, "email": {"type": "text", "index": 3, "name": "email", "comment": "The user's email. User identifier, for email-based projects. Previously was the unique identifier for user records, for the old Iterable schema before the August 2023 updates."}, "updated_at": {"type": "timestamp without time zone", "index": 4, "name": "updated_at", "comment": "Last update timestamp"}, "user_id": {"type": "text", "index": 5, "name": "user_id", "comment": "User identifier, for userID-based projects."}, "first_name": {"type": "integer", "index": 6, "name": "first_name", "comment": "First name of the user"}, "last_name": {"type": "integer", "index": 7, "name": "last_name", "comment": "Last name of the user"}, "email_list_ids": {"type": "text", "index": 8, "name": "email_list_ids", "comment": "[DEPRECATED October 13, 2025. Use LIST_USER source instead.] Array of references to the lists associated with the user.\n"}, "phone_number": {"type": "integer", "index": 9, "name": "phone_number", "comment": "Phone number associated with the user"}, "signup_date": {"type": "text", "index": 10, "name": "signup_date", "comment": "Timestamp of when the user signed up"}, "signup_source": {"type": "text", "index": 11, "name": "signup_source", "comment": "Source where the user signed up"}, "iterable_user_id": {"type": "text", "index": 12, "name": "iterable_user_id", "comment": "Another user identifier, for userID-based projects"}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 13, "name": "_fivetran_synced", "comment": "The time when a record was last updated by Fivetran."}, "unique_user_key": {"type": "text", "index": 14, "name": "unique_user_key", "comment": "The unique identifier of the user. With the new schema (Aug 2023), it is the _fivetran_user_id. This is a hash of user_id and/or email, depending on project type. If using the old schema, it is email."}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.stg_iterable__user_history"}, "model.iterable.stg_iterable__user_history_tmp": {"metadata": {"type": "VIEW", "schema": "public_iterable_dev", "name": "stg_iterable__user_history_tmp", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"email": {"type": "text", "index": 1, "name": "email", "comment": null}, "updated_at": {"type": "timestamp without time zone", "index": 2, "name": "updated_at", "comment": null}, "first_name": {"type": "integer", "index": 3, "name": "first_name", "comment": null}, "last_name": {"type": "integer", "index": 4, "name": "last_name", "comment": null}, "phone_number": {"type": "integer", "index": 5, "name": "phone_number", "comment": null}, "user_id": {"type": "integer", "index": 6, "name": "user_id", "comment": null}, "signup_date": {"type": "text", "index": 7, "name": "signup_date", "comment": null}, "signup_source": {"type": "text", "index": 8, "name": "signup_source", "comment": null}, "phone_number_carrier": {"type": "integer", "index": 9, "name": "phone_number_carrier", "comment": null}, "phone_number_country_code_iso": {"type": "integer", "index": 10, "name": "phone_number_country_code_iso", "comment": null}, "phone_number_line_type": {"type": "integer", "index": 11, "name": "phone_number_line_type", "comment": null}, "phone_number_updated_at": {"type": "integer", "index": 12, "name": "phone_number_updated_at", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 13, "name": "_fivetran_synced", "comment": null}, "email_list_ids": {"type": "text", "index": 14, "name": "email_list_ids", "comment": null}, "iterable_user_id": {"type": "integer", "index": 15, "name": "iterable_user_id", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.stg_iterable__user_history_tmp"}, "model.iterable.stg_iterable__user_unsub_message_type": {"metadata": {"type": "BASE TABLE", "schema": "public_iterable_dev", "name": "stg_iterable__user_unsub_message_type", "database": "postgres", "comment": "Table containing the message types from which a user has unsubscribed. \"Unsubscribed\" is shortened to \"unsub\" for postgres compatibility.", "owner": "postgres"}, "columns": {"source_relation": {"type": "text", "index": 1, "name": "source_relation", "comment": "Identifies the record's source."}, "_fivetran_user_id": {"type": "text", "index": 2, "name": "_fivetran_user_id", "comment": "A Fivetran-created unique identifier for users, derived from hashing user_id and/or email, depending on project type. This exists for users of the new schema starting Aug 2023. In the old schema, the unique identifier is email."}, "unique_user_key": {"type": "text", "index": 3, "name": "unique_user_key", "comment": "The unique identifier of the user. With the new schema (Aug 2023), it is the _fivetran_user_id. This is a hash of user_id and/or email, depending on project type. If using the old schema, it is email."}, "message_type_id": {"type": "text", "index": 4, "name": "message_type_id", "comment": "Reference to the message type from which the user unsubscribed"}, "unsub_message_type_unique_key": {"type": "text", "index": 5, "name": "unsub_message_type_unique_key", "comment": "A surrogate key providing a unique key for each record. If using user_unsubscribed_message_type_history, it uses '_fivetran_id', 'email', 'message_type_id', 'updated_at', and 'source_relation'. If not using the history table, it uses '_fivetran_id', 'message_type_id', and 'source_relation'."}, "latest_batch_index": {"type": "integer", "index": 6, "name": "latest_batch_index", "comment": "Indexes each user record based on the most recent available."}, "updated_at": {"type": "timestamp without time zone", "index": 7, "name": "updated_at", "comment": "Last update timestamp"}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 8, "name": "_fivetran_synced", "comment": "The time when a record was last updated by Fivetran."}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.stg_iterable__user_unsub_message_type"}, "model.iterable.stg_iterable__user_unsub_message_type_tmp": {"metadata": {"type": "VIEW", "schema": "public_iterable_dev", "name": "stg_iterable__user_unsub_message_type_tmp", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"_fivetran_id": {"type": "text", "index": 1, "name": "_fivetran_id", "comment": null}, "message_type_id": {"type": "integer", "index": 2, "name": "message_type_id", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 3, "name": "_fivetran_synced", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.stg_iterable__user_unsub_message_type_tmp"}, "model.iterable.stg_iterable__user_unsubscribed_channel": {"metadata": {"type": "BASE TABLE", "schema": "public_iterable_dev", "name": "stg_iterable__user_unsubscribed_channel", "database": "postgres", "comment": "Table containing the history of channels from which a user has unsubscribed.", "owner": "postgres"}, "columns": {"source_relation": {"type": "text", "index": 1, "name": "source_relation", "comment": "Identifies the record's source."}, "_fivetran_user_id": {"type": "text", "index": 2, "name": "_fivetran_user_id", "comment": "A Fivetran-created unique identifier for users, derived from hashing user_id and/or email, depending on project type. This exists for users of the new schema starting Aug 2023. In the old schema, the unique identifier is email."}, "unique_user_key": {"type": "text", "index": 3, "name": "unique_user_key", "comment": "The unique identifier of the user. With the new schema (Aug 2023), it is the _fivetran_user_id. This is a hash of user_id and/or email, depending on project type. If using the old schema, it is email."}, "channel_id": {"type": "text", "index": 4, "name": "channel_id", "comment": "Reference to the channel from which the user unsubscribed"}, "unsub_channel_unique_key": {"type": "text", "index": 5, "name": "unsub_channel_unique_key", "comment": "A surrogate key providing a unique key for each record. If using user_unsubscribed_channel_history, it uses '_fivetran_id', 'channel_id', 'email', 'updated_at', and 'source_relation'. If not using the history table, it uses '_fivetran_id', 'channel_id', and 'source_relation'."}, "latest_batch_index": {"type": "integer", "index": 6, "name": "latest_batch_index", "comment": "Indexes each user record based on the most recent available."}, "updated_at": {"type": "timestamp without time zone", "index": 7, "name": "updated_at", "comment": "Last update timestamp"}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 8, "name": "_fivetran_synced", "comment": "The time when a record was last updated by Fivetran."}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.stg_iterable__user_unsubscribed_channel"}, "model.iterable.stg_iterable__user_unsubscribed_channel_tmp": {"metadata": {"type": "VIEW", "schema": "public_iterable_dev", "name": "stg_iterable__user_unsubscribed_channel_tmp", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"_fivetran_id": {"type": "text", "index": 1, "name": "_fivetran_id", "comment": null}, "channel_id": {"type": "integer", "index": 2, "name": "channel_id", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 3, "name": "_fivetran_synced", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.stg_iterable__user_unsubscribed_channel_tmp"}}, "sources": {"source.iterable.iterable.campaign_history": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "campaign_history_data", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"id": {"type": "integer", "index": 1, "name": "id", "comment": null}, "updated_at": {"type": "text", "index": 2, "name": "updated_at", "comment": null}, "template_id": {"type": "integer", "index": 3, "name": "template_id", "comment": null}, "recurring_campaign_id": {"type": "integer", "index": 4, "name": "recurring_campaign_id", "comment": null}, "campaign_state": {"type": "text", "index": 5, "name": "campaign_state", "comment": null}, "created_at": {"type": "text", "index": 6, "name": "created_at", "comment": null}, "created_by_user_id": {"type": "text", "index": 7, "name": "created_by_user_id", "comment": null}, "ended_at": {"type": "integer", "index": 8, "name": "ended_at", "comment": null}, "name": {"type": "text", "index": 9, "name": "name", "comment": null}, "send_size": {"type": "integer", "index": 10, "name": "send_size", "comment": null}, "start_at": {"type": "integer", "index": 11, "name": "start_at", "comment": null}, "type": {"type": "text", "index": 12, "name": "type", "comment": null}, "workflow_id": {"type": "integer", "index": 13, "name": "workflow_id", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 14, "name": "_fivetran_synced", "comment": null}, "updated_by_user_id": {"type": "integer", "index": 15, "name": "updated_by_user_id", "comment": null}, "message_medium": {"type": "text", "index": 16, "name": "message_medium", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.iterable.iterable.campaign_history"}, "source.iterable.iterable.campaign_label_history": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "campaign_label_history_data", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"campaign_id": {"type": "integer", "index": 1, "name": "campaign_id", "comment": null}, "label": {"type": "text", "index": 2, "name": "label", "comment": null}, "updated_at": {"type": "text", "index": 3, "name": "updated_at", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 4, "name": "_fivetran_synced", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.iterable.iterable.campaign_label_history"}, "source.iterable.iterable.campaign_list_history": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "campaign_list_history_data", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"list_id": {"type": "integer", "index": 1, "name": "list_id", "comment": null}, "campaign_id": {"type": "integer", "index": 2, "name": "campaign_id", "comment": null}, "updated_at": {"type": "text", "index": 3, "name": "updated_at", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 4, "name": "_fivetran_synced", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.iterable.iterable.campaign_list_history"}, "source.iterable.iterable.campaign_suppression_list_history": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "campaign_suppression_list_history_data", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"suppressed_list_id": {"type": "integer", "index": 1, "name": "suppressed_list_id", "comment": null}, "campaign_id": {"type": "integer", "index": 2, "name": "campaign_id", "comment": null}, "updated_at": {"type": "text", "index": 3, "name": "updated_at", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 4, "name": "_fivetran_synced", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.iterable.iterable.campaign_suppression_list_history"}, "source.iterable.iterable.channel": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "channel_data", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"id": {"type": "bigint", "index": 1, "name": "id", "comment": null}, "name": {"type": "text", "index": 2, "name": "name", "comment": null}, "channel_type": {"type": "text", "index": 3, "name": "channel_type", "comment": null}, "message_medium": {"type": "text", "index": 4, "name": "message_medium", "comment": null}, "_fivetran_deleted": {"type": "boolean", "index": 5, "name": "_fivetran_deleted", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 6, "name": "_fivetran_synced", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.iterable.iterable.channel"}, "source.iterable.iterable.event": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "event_data", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"_fivetran_id": {"type": "text", "index": 1, "name": "_fivetran_id", "comment": null}, "email": {"type": "text", "index": 2, "name": "email", "comment": null}, "campaign_id": {"type": "integer", "index": 3, "name": "campaign_id", "comment": null}, "message_id": {"type": "integer", "index": 4, "name": "message_id", "comment": null}, "content_id": {"type": "integer", "index": 5, "name": "content_id", "comment": null}, "created_at": {"type": "timestamp without time zone", "index": 6, "name": "created_at", "comment": null}, "event_name": {"type": "text", "index": 7, "name": "event_name", "comment": null}, "ip": {"type": "integer", "index": 8, "name": "ip", "comment": null}, "message_bus_id": {"type": "integer", "index": 9, "name": "message_bus_id", "comment": null}, "message_type_id": {"type": "integer", "index": 10, "name": "message_type_id", "comment": null}, "recipient_state": {"type": "integer", "index": 11, "name": "recipient_state", "comment": null}, "status": {"type": "integer", "index": 12, "name": "status", "comment": null}, "unsub_source": {"type": "integer", "index": 13, "name": "unsub_source", "comment": null}, "user_agent": {"type": "integer", "index": 14, "name": "user_agent", "comment": null}, "user_agent_device": {"type": "integer", "index": 15, "name": "user_agent_device", "comment": null}, "transactional_data": {"type": "character varying(100)", "index": 16, "name": "transactional_data", "comment": null}, "additional_properties": {"type": "text", "index": 17, "name": "additional_properties", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 18, "name": "_fivetran_synced", "comment": null}, "_fivetran_user_id": {"type": "integer", "index": 19, "name": "_fivetran_user_id", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.iterable.iterable.event"}, "source.iterable.iterable.event_extension": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "event_extension_data", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"_fivetran_id": {"type": "text", "index": 1, "name": "_fivetran_id", "comment": null}, "app_already_running": {"type": "integer", "index": 2, "name": "app_already_running", "comment": null}, "badge": {"type": "integer", "index": 3, "name": "badge", "comment": null}, "canonical_url_id": {"type": "integer", "index": 4, "name": "canonical_url_id", "comment": null}, "content_available": {"type": "integer", "index": 5, "name": "content_available", "comment": null}, "content_id": {"type": "integer", "index": 6, "name": "content_id", "comment": null}, "device": {"type": "integer", "index": 7, "name": "device", "comment": null}, "email_id": {"type": "text", "index": 8, "name": "email_id", "comment": null}, "email_subject": {"type": "text", "index": 9, "name": "email_subject", "comment": null}, "experiment_id": {"type": "integer", "index": 10, "name": "experiment_id", "comment": null}, "from_phone_number_id": {"type": "integer", "index": 11, "name": "from_phone_number_id", "comment": null}, "from_smssender_id": {"type": "integer", "index": 12, "name": "from_smssender_id", "comment": null}, "image_url": {"type": "integer", "index": 13, "name": "image_url", "comment": null}, "is_ghost_push": {"type": "integer", "index": 14, "name": "is_ghost_push", "comment": null}, "link_id": {"type": "integer", "index": 15, "name": "link_id", "comment": null}, "link_url": {"type": "integer", "index": 16, "name": "link_url", "comment": null}, "platform_endpoint": {"type": "integer", "index": 17, "name": "platform_endpoint", "comment": null}, "push_message": {"type": "integer", "index": 18, "name": "push_message", "comment": null}, "region": {"type": "text", "index": 19, "name": "region", "comment": null}, "sms_message": {"type": "integer", "index": 20, "name": "sms_message", "comment": null}, "sound": {"type": "integer", "index": 21, "name": "sound", "comment": null}, "to_phone_number": {"type": "integer", "index": 22, "name": "to_phone_number", "comment": null}, "url": {"type": "integer", "index": 23, "name": "url", "comment": null}, "workflow_id": {"type": "integer", "index": 24, "name": "workflow_id", "comment": null}, "workflow_name": {"type": "text", "index": 25, "name": "workflow_name", "comment": null}, "locale": {"type": "integer", "index": 26, "name": "locale", "comment": null}, "deeplink_android": {"type": "integer", "index": 27, "name": "deeplink_android", "comment": null}, "deeplink_ios": {"type": "integer", "index": 28, "name": "deeplink_ios", "comment": null}, "payload": {"type": "character varying(100)", "index": 29, "name": "payload", "comment": null}, "sms_provider_response_status": {"type": "integer", "index": 30, "name": "sms_provider_response_status", "comment": null}, "sms_provider_response_message": {"type": "integer", "index": 31, "name": "sms_provider_response_message", "comment": null}, "sms_provider_response_code": {"type": "integer", "index": 32, "name": "sms_provider_response_code", "comment": null}, "sms_provider_response_more_info": {"type": "integer", "index": 33, "name": "sms_provider_response_more_info", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 34, "name": "_fivetran_synced", "comment": null}, "catalog_collection_count": {"type": "integer", "index": 35, "name": "catalog_collection_count", "comment": null}, "catalog_lookup_count": {"type": "integer", "index": 36, "name": "catalog_lookup_count", "comment": null}, "city": {"type": "text", "index": 37, "name": "city", "comment": null}, "clicked_url": {"type": "text", "index": 38, "name": "clicked_url", "comment": null}, "country": {"type": "text", "index": 39, "name": "country", "comment": null}, "error_code": {"type": "integer", "index": 40, "name": "error_code", "comment": null}, "expires_at": {"type": "text", "index": 41, "name": "expires_at", "comment": null}, "from_phone_number": {"type": "integer", "index": 42, "name": "from_phone_number", "comment": null}, "in_app_body": {"type": "text", "index": 43, "name": "in_app_body", "comment": null}, "is_sms_estimation": {"type": "boolean", "index": 44, "name": "is_sms_estimation", "comment": null}, "labels": {"type": "text", "index": 45, "name": "labels", "comment": null}, "message_context": {"type": "text", "index": 46, "name": "message_context", "comment": null}, "message_status": {"type": "text", "index": 47, "name": "message_status", "comment": null}, "mms_send_count": {"type": "integer", "index": 48, "name": "mms_send_count", "comment": null}, "product_recommendation_count": {"type": "integer", "index": 49, "name": "product_recommendation_count", "comment": null}, "proxy_source": {"type": "text", "index": 50, "name": "proxy_source", "comment": null}, "reason": {"type": "text", "index": 51, "name": "reason", "comment": null}, "sms_send_count": {"type": "integer", "index": 52, "name": "sms_send_count", "comment": null}, "web_push_body": {"type": "text", "index": 53, "name": "web_push_body", "comment": null}, "web_push_click_action": {"type": "text", "index": 54, "name": "web_push_click_action", "comment": null}, "web_push_icon": {"type": "text", "index": 55, "name": "web_push_icon", "comment": null}, "web_push_message": {"type": "text", "index": 56, "name": "web_push_message", "comment": null}, "_fivetran_user_id": {"type": "integer", "index": 57, "name": "_fivetran_user_id", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.iterable.iterable.event_extension"}, "source.iterable.iterable.journey": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "journey_data", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"id": {"type": "bigint", "index": 1, "name": "id", "comment": null}, "name": {"type": "text", "index": 2, "name": "name", "comment": null}, "journey_type": {"type": "text", "index": 3, "name": "journey_type", "comment": null}, "description": {"type": "text", "index": 4, "name": "description", "comment": null}, "creator_user_id": {"type": "text", "index": 5, "name": "creator_user_id", "comment": null}, "enabled": {"type": "boolean", "index": 6, "name": "enabled", "comment": null}, "is_archived": {"type": "boolean", "index": 7, "name": "is_archived", "comment": null}, "lifetime_limit": {"type": "bigint", "index": 8, "name": "lifetime_limit", "comment": null}, "simultaneous_limit": {"type": "bigint", "index": 9, "name": "simultaneous_limit", "comment": null}, "start_tile_id": {"type": "bigint", "index": 10, "name": "start_tile_id", "comment": null}, "trigger_event_names": {"type": "text", "index": 11, "name": "trigger_event_names", "comment": null}, "created_at": {"type": "timestamp without time zone", "index": 12, "name": "created_at", "comment": null}, "updated_at": {"type": "timestamp without time zone", "index": 13, "name": "updated_at", "comment": null}, "_fivetran_deleted": {"type": "boolean", "index": 14, "name": "_fivetran_deleted", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 15, "name": "_fivetran_synced", "comment": null}, "draft_name": {"type": "text", "index": 16, "name": "draft_name", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.iterable.iterable.journey"}, "source.iterable.iterable.list": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "list_data", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"id": {"type": "integer", "index": 1, "name": "id", "comment": null}, "name": {"type": "text", "index": 2, "name": "name", "comment": null}, "created_at": {"type": "text", "index": 3, "name": "created_at", "comment": null}, "list_type": {"type": "text", "index": 4, "name": "list_type", "comment": null}, "_fivetran_deleted": {"type": "boolean", "index": 5, "name": "_fivetran_deleted", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 6, "name": "_fivetran_synced", "comment": null}, "description": {"type": "text", "index": 7, "name": "description", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.iterable.iterable.list"}, "source.iterable.iterable.list_user": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "list_user_data", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"_fivetran_id": {"type": "text", "index": 1, "name": "_fivetran_id", "comment": null}, "index": {"type": "bigint", "index": 2, "name": "index", "comment": null}, "list_id": {"type": "bigint", "index": 3, "name": "list_id", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 4, "name": "_fivetran_synced", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.iterable.iterable.list_user"}, "source.iterable.iterable.message_type": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "message_type_data", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"id": {"type": "bigint", "index": 1, "name": "id", "comment": null}, "name": {"type": "text", "index": 2, "name": "name", "comment": null}, "channel_id": {"type": "bigint", "index": 3, "name": "channel_id", "comment": null}, "_fivetran_deleted": {"type": "boolean", "index": 4, "name": "_fivetran_deleted", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 5, "name": "_fivetran_synced", "comment": null}, "created_at": {"type": "timestamp without time zone", "index": 6, "name": "created_at", "comment": null}, "frequency_cap": {"type": "integer", "index": 7, "name": "frequency_cap", "comment": null}, "rate_limit_per_minute": {"type": "integer", "index": 8, "name": "rate_limit_per_minute", "comment": null}, "subscription_policy": {"type": "text", "index": 9, "name": "subscription_policy", "comment": null}, "updated_at": {"type": "timestamp without time zone", "index": 10, "name": "updated_at", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.iterable.iterable.message_type"}, "source.iterable.iterable.template_history": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "template_history_data", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"id": {"type": "integer", "index": 1, "name": "id", "comment": null}, "updated_at": {"type": "text", "index": 2, "name": "updated_at", "comment": null}, "message_type_id": {"type": "integer", "index": 3, "name": "message_type_id", "comment": null}, "client_template_id": {"type": "integer", "index": 4, "name": "client_template_id", "comment": null}, "created_at": {"type": "text", "index": 5, "name": "created_at", "comment": null}, "creator_user_id": {"type": "text", "index": 6, "name": "creator_user_id", "comment": null}, "name": {"type": "text", "index": 7, "name": "name", "comment": null}, "template_type": {"type": "text", "index": 8, "name": "template_type", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 9, "name": "_fivetran_synced", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.iterable.iterable.template_history"}, "source.iterable.iterable.user_history": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "user_history_data", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"email": {"type": "text", "index": 1, "name": "email", "comment": null}, "updated_at": {"type": "timestamp without time zone", "index": 2, "name": "updated_at", "comment": null}, "first_name": {"type": "integer", "index": 3, "name": "first_name", "comment": null}, "last_name": {"type": "integer", "index": 4, "name": "last_name", "comment": null}, "phone_number": {"type": "integer", "index": 5, "name": "phone_number", "comment": null}, "user_id": {"type": "integer", "index": 6, "name": "user_id", "comment": null}, "signup_date": {"type": "text", "index": 7, "name": "signup_date", "comment": null}, "signup_source": {"type": "text", "index": 8, "name": "signup_source", "comment": null}, "phone_number_carrier": {"type": "integer", "index": 9, "name": "phone_number_carrier", "comment": null}, "phone_number_country_code_iso": {"type": "integer", "index": 10, "name": "phone_number_country_code_iso", "comment": null}, "phone_number_line_type": {"type": "integer", "index": 11, "name": "phone_number_line_type", "comment": null}, "phone_number_updated_at": {"type": "integer", "index": 12, "name": "phone_number_updated_at", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 13, "name": "_fivetran_synced", "comment": null}, "email_list_ids": {"type": "text", "index": 14, "name": "email_list_ids", "comment": null}, "iterable_user_id": {"type": "integer", "index": 15, "name": "iterable_user_id", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.iterable.iterable.user_history"}, "source.iterable.iterable.user_unsubscribed_channel": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "user_unsubscribed_channel_data", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"_fivetran_id": {"type": "text", "index": 1, "name": "_fivetran_id", "comment": null}, "channel_id": {"type": "integer", "index": 2, "name": "channel_id", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 3, "name": "_fivetran_synced", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.iterable.iterable.user_unsubscribed_channel"}, "source.iterable.iterable.user_unsubscribed_channel_history": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "user_unsubscribed_channel_history_data", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"email": {"type": "text", "index": 1, "name": "email", "comment": null}, "channel_id": {"type": "bigint", "index": 2, "name": "channel_id", "comment": null}, "updated_at": {"type": "text", "index": 3, "name": "updated_at", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 4, "name": "_fivetran_synced", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.iterable.iterable.user_unsubscribed_channel_history"}, "source.iterable.iterable.user_unsubscribed_message_type": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "user_unsubscribed_message_type_data", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"_fivetran_id": {"type": "text", "index": 1, "name": "_fivetran_id", "comment": null}, "message_type_id": {"type": "integer", "index": 2, "name": "message_type_id", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 3, "name": "_fivetran_synced", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.iterable.iterable.user_unsubscribed_message_type"}, "source.iterable.iterable.user_unsubscribed_message_type_history": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "user_unsubscribed_message_type_history_data", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"message_type_id": {"type": "integer", "index": 1, "name": "message_type_id", "comment": null}, "email": {"type": "text", "index": 2, "name": "email", "comment": null}, "updated_at": {"type": "text", "index": 3, "name": "updated_at", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 4, "name": "_fivetran_synced", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.iterable.iterable.user_unsubscribed_message_type_history"}}, "errors": null} \ No newline at end of file diff --git a/docs/manifest.json b/docs/manifest.json index 776d4a0..8d240c2 100644 --- a/docs/manifest.json +++ b/docs/manifest.json @@ -1 +1 @@ -{"metadata": {"dbt_schema_version": "https://schemas.getdbt.com/dbt/manifest/v12.json", "dbt_version": "1.12.4", "generated_at": "2026-09-14T21:06:20.431882Z", "invocation_id": "9ff5dbb1-4114-401f-b8d6-f22217b143f8", "invocation_started_at": "2026-09-14T21:06:08.871486+00:00", "env": {}, "project_name": "iterable_integration_tests", "project_id": "726648524a3768595307d45548dac26e", "user_id": null, "send_anonymous_usage_stats": false, "adapter_type": "postgres", "quoting": {"database": true, "schema": true, "identifier": true, "column": null}, "run_started_at": "2026-09-14T21:06:08.871810+00:00"}, "nodes": {"seed.iterable_integration_tests.campaign_metrics_data": {"database": "postgres", "schema": "public", "name": "campaign_metrics_data", "resource_type": "seed", "package_name": "iterable_integration_tests", "path": "campaign_metrics_data.csv", "original_file_path": "seeds/campaign_metrics_data.csv", "unique_id": "seed.iterable_integration_tests.campaign_metrics_data", "fqn": ["iterable_integration_tests", "campaign_metrics_data"], "alias": "campaign_metrics_data", "checksum": {"name": "sha256", "checksum": "45e8e7be3941e10f43112fac7bd78f0b6a63c070090062f65b2ffabe481b8c4e"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "seed", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": false, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "delimiter": ",", "quote_columns": false}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": false, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"docs": {"show": false}, "quote_columns": "{{ target.type == 'redshift' or var('fivetran_using_source_casing', false) }}"}, "created_at": 1789419971.401272, "relation_name": "\"postgres\".\"public\".\"campaign_metrics_data\"", "raw_code": "", "doc_blocks": [], "root_path": "/home/runner/work/dbt_iterable/dbt_iterable/integration_tests", "depends_on": {"macros": []}}, "seed.iterable_integration_tests.campaign_list_history_data": {"database": "postgres", "schema": "public", "name": "campaign_list_history_data", "resource_type": "seed", "package_name": "iterable_integration_tests", "path": "campaign_list_history_data.csv", "original_file_path": "seeds/campaign_list_history_data.csv", "unique_id": "seed.iterable_integration_tests.campaign_list_history_data", "fqn": ["iterable_integration_tests", "campaign_list_history_data"], "alias": "campaign_list_history_data", "checksum": {"name": "sha256", "checksum": "206581e614bf60f37345cbf1bd5e0cacac8a2f329a7dfc521b809c3e6d72e728"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "seed", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {"_fivetran_synced": "timestamp"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": false, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "delimiter": ",", "quote_columns": false}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": false, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"docs": {"show": false}, "quote_columns": "{{ target.type == 'redshift' or var('fivetran_using_source_casing', false) }}", "column_types": {"_fivetran_synced": "timestamp"}}, "created_at": 1789419971.40975, "relation_name": "\"postgres\".\"public\".\"campaign_list_history_data\"", "raw_code": "", "doc_blocks": [], "root_path": "/home/runner/work/dbt_iterable/dbt_iterable/integration_tests", "depends_on": {"macros": []}}, "seed.iterable_integration_tests.user_unsubscribed_message_type_history_data": {"database": "postgres", "schema": "public", "name": "user_unsubscribed_message_type_history_data", "resource_type": "seed", "package_name": "iterable_integration_tests", "path": "user_unsubscribed_message_type_history_data.csv", "original_file_path": "seeds/user_unsubscribed_message_type_history_data.csv", "unique_id": "seed.iterable_integration_tests.user_unsubscribed_message_type_history_data", "fqn": ["iterable_integration_tests", "user_unsubscribed_message_type_history_data"], "alias": "user_unsubscribed_message_type_history_data", "checksum": {"name": "sha256", "checksum": "1e6883673b9a6f44966d10891cece60a739773fadf44302ccf2aad5290222687"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "seed", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {"_fivetran_synced": "timestamp"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": false, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "delimiter": ",", "quote_columns": false}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": false, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"docs": {"show": false}, "quote_columns": "{{ target.type == 'redshift' or var('fivetran_using_source_casing', false) }}", "column_types": {"_fivetran_synced": "timestamp"}}, "created_at": 1789419971.4135346, "relation_name": "\"postgres\".\"public\".\"user_unsubscribed_message_type_history_data\"", "raw_code": "", "doc_blocks": [], "root_path": "/home/runner/work/dbt_iterable/dbt_iterable/integration_tests", "depends_on": {"macros": []}}, "seed.iterable_integration_tests.user_unsubscribed_channel_history_data": {"database": "postgres", "schema": "public", "name": "user_unsubscribed_channel_history_data", "resource_type": "seed", "package_name": "iterable_integration_tests", "path": "user_unsubscribed_channel_history_data.csv", "original_file_path": "seeds/user_unsubscribed_channel_history_data.csv", "unique_id": "seed.iterable_integration_tests.user_unsubscribed_channel_history_data", "fqn": ["iterable_integration_tests", "user_unsubscribed_channel_history_data"], "alias": "user_unsubscribed_channel_history_data", "checksum": {"name": "sha256", "checksum": "a1b532e561033f6ff137e5a1bde082263903493b763e9358a2a2ba151360e00e"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "seed", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {"channel_id": "bigint", "_fivetran_synced": "timestamp"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": false, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "delimiter": ",", "quote_columns": false}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": false, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"docs": {"show": false}, "quote_columns": "{{ target.type == 'redshift' or var('fivetran_using_source_casing', false) }}", "column_types": {"channel_id": "{%- if target.type == 'bigquery' -%} INT64 {%- else -%} bigint {%- endif -%}", "_fivetran_synced": "timestamp"}}, "created_at": 1789419971.417569, "relation_name": "\"postgres\".\"public\".\"user_unsubscribed_channel_history_data\"", "raw_code": "", "doc_blocks": [], "root_path": "/home/runner/work/dbt_iterable/dbt_iterable/integration_tests", "depends_on": {"macros": []}}, "seed.iterable_integration_tests.campaign_suppression_list_history_data": {"database": "postgres", "schema": "public", "name": "campaign_suppression_list_history_data", "resource_type": "seed", "package_name": "iterable_integration_tests", "path": "campaign_suppression_list_history_data.csv", "original_file_path": "seeds/campaign_suppression_list_history_data.csv", "unique_id": "seed.iterable_integration_tests.campaign_suppression_list_history_data", "fqn": ["iterable_integration_tests", "campaign_suppression_list_history_data"], "alias": "campaign_suppression_list_history_data", "checksum": {"name": "sha256", "checksum": "c9eaab0efe0e47ef695b57f71b41f23cf527c87610d7770be604e461fe7c9846"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "seed", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {"_fivetran_synced": "timestamp"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": false, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "delimiter": ",", "quote_columns": false}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": false, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"docs": {"show": false}, "quote_columns": "{{ target.type == 'redshift' or var('fivetran_using_source_casing', false) }}", "column_types": {"_fivetran_synced": "timestamp"}}, "created_at": 1789419971.421073, "relation_name": "\"postgres\".\"public\".\"campaign_suppression_list_history_data\"", "raw_code": "", "doc_blocks": [], "root_path": "/home/runner/work/dbt_iterable/dbt_iterable/integration_tests", "depends_on": {"macros": []}}, "seed.iterable_integration_tests.channel_data": {"database": "postgres", "schema": "public", "name": "channel_data", "resource_type": "seed", "package_name": "iterable_integration_tests", "path": "channel_data.csv", "original_file_path": "seeds/channel_data.csv", "unique_id": "seed.iterable_integration_tests.channel_data", "fqn": ["iterable_integration_tests", "channel_data"], "alias": "channel_data", "checksum": {"name": "sha256", "checksum": "a77e21fb127c0ff7fc652eb5ffc6b3559fde3d63c2c5291a68f10fefcc2fac37"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "seed", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {"id": "bigint", "_fivetran_synced": "timestamp"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": false, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "delimiter": ",", "quote_columns": false}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": false, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"docs": {"show": false}, "quote_columns": "{{ target.type == 'redshift' or var('fivetran_using_source_casing', false) }}", "column_types": {"id": "{%- if target.type == 'bigquery' -%} INT64 {%- else -%} bigint {%- endif -%}", "_fivetran_synced": "timestamp"}}, "created_at": 1789419971.4244945, "relation_name": "\"postgres\".\"public\".\"channel_data\"", "raw_code": "", "doc_blocks": [], "root_path": "/home/runner/work/dbt_iterable/dbt_iterable/integration_tests", "depends_on": {"macros": []}}, "seed.iterable_integration_tests.template_history_data": {"database": "postgres", "schema": "public", "name": "template_history_data", "resource_type": "seed", "package_name": "iterable_integration_tests", "path": "template_history_data.csv", "original_file_path": "seeds/template_history_data.csv", "unique_id": "seed.iterable_integration_tests.template_history_data", "fqn": ["iterable_integration_tests", "template_history_data"], "alias": "template_history_data", "checksum": {"name": "sha256", "checksum": "0f0c442398531afc5fb4c18f12f0d0f694eb3453cb09e0c6c48ba340b110f4a6"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "seed", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {"_fivetran_synced": "timestamp"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": false, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "delimiter": ",", "quote_columns": false}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": false, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"docs": {"show": false}, "quote_columns": "{{ target.type == 'redshift' or var('fivetran_using_source_casing', false) }}", "column_types": {"_fivetran_synced": "timestamp"}}, "created_at": 1789419971.427927, "relation_name": "\"postgres\".\"public\".\"template_history_data\"", "raw_code": "", "doc_blocks": [], "root_path": "/home/runner/work/dbt_iterable/dbt_iterable/integration_tests", "depends_on": {"macros": []}}, "seed.iterable_integration_tests.message_type_data": {"database": "postgres", "schema": "public", "name": "message_type_data", "resource_type": "seed", "package_name": "iterable_integration_tests", "path": "message_type_data.csv", "original_file_path": "seeds/message_type_data.csv", "unique_id": "seed.iterable_integration_tests.message_type_data", "fqn": ["iterable_integration_tests", "message_type_data"], "alias": "message_type_data", "checksum": {"name": "sha256", "checksum": "84228c8c4a13092ca90bdf9579856968f5265c49f456d01b8510834ae3520bce"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "seed", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {"id": "bigint", "channel_id": "bigint", "_fivetran_synced": "timestamp"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": false, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "delimiter": ",", "quote_columns": false}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": false, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"docs": {"show": false}, "quote_columns": "{{ target.type == 'redshift' or var('fivetran_using_source_casing', false) }}", "column_types": {"id": "{%- if target.type == 'bigquery' -%} INT64 {%- else -%} bigint {%- endif -%}", "channel_id": "{%- if target.type == 'bigquery' -%} INT64 {%- else -%} bigint {%- endif -%}", "_fivetran_synced": "timestamp"}}, "created_at": 1789419971.4314775, "relation_name": "\"postgres\".\"public\".\"message_type_data\"", "raw_code": "", "doc_blocks": [], "root_path": "/home/runner/work/dbt_iterable/dbt_iterable/integration_tests", "depends_on": {"macros": []}}, "seed.iterable_integration_tests.event_data": {"database": "postgres", "schema": "public", "name": "event_data", "resource_type": "seed", "package_name": "iterable_integration_tests", "path": "event_data.csv", "original_file_path": "seeds/event_data.csv", "unique_id": "seed.iterable_integration_tests.event_data", "fqn": ["iterable_integration_tests", "event_data"], "alias": "event_data", "checksum": {"name": "sha256", "checksum": "c886615b369d98135814bac7c4070be9d58b4aa6eb9a90a5caa5ddc4454ab0ed"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "seed", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {"transactional_data": "varchar(100)", "created_at": "timestamp", "_fivetran_synced": "timestamp"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": false, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "delimiter": ",", "quote_columns": false}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": false, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"docs": {"show": false}, "quote_columns": "{{ target.type == 'redshift' or var('fivetran_using_source_casing', false) }}", "column_types": {"transactional_data": "{{ 'varchar(100)' if target.type in ('redshift', 'postgres') else 'string'}}", "created_at": "timestamp", "_fivetran_synced": "timestamp"}}, "created_at": 1789419971.4349418, "relation_name": "\"postgres\".\"public\".\"event_data\"", "raw_code": "", "doc_blocks": [], "root_path": "/home/runner/work/dbt_iterable/dbt_iterable/integration_tests", "depends_on": {"macros": []}}, "seed.iterable_integration_tests.list_user_data": {"database": "postgres", "schema": "public", "name": "list_user_data", "resource_type": "seed", "package_name": "iterable_integration_tests", "path": "list_user_data.csv", "original_file_path": "seeds/list_user_data.csv", "unique_id": "seed.iterable_integration_tests.list_user_data", "fqn": ["iterable_integration_tests", "list_user_data"], "alias": "list_user_data", "checksum": {"name": "sha256", "checksum": "2dbd80b8fb4338602a543026ede3f5a0797c0a4cf13c4724a877bb60ac6a4793"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "seed", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {"list_id": "bigint", "index": "bigint", "_fivetran_synced": "timestamp"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": false, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "delimiter": ",", "quote_columns": false}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": false, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"docs": {"show": false}, "quote_columns": "{{ target.type == 'redshift' or var('fivetran_using_source_casing', false) }}", "column_types": {"list_id": "{%- if target.type == 'bigquery' -%} INT64 {%- else -%} bigint {%- endif -%}", "index": "{%- if target.type == 'bigquery' -%} INT64 {%- else -%} bigint {%- endif -%}", "_fivetran_synced": "timestamp"}}, "created_at": 1789419971.4384034, "relation_name": "\"postgres\".\"public\".\"list_user_data\"", "raw_code": "", "doc_blocks": [], "root_path": "/home/runner/work/dbt_iterable/dbt_iterable/integration_tests", "depends_on": {"macros": []}}, "seed.iterable_integration_tests.user_history_bq_json_data": {"database": "postgres", "schema": "public", "name": "user_history_bq_json_data", "resource_type": "seed", "package_name": "iterable_integration_tests", "path": "user_history_bq_json_data.csv", "original_file_path": "seeds/user_history_bq_json_data.csv", "unique_id": "seed.iterable_integration_tests.user_history_bq_json_data", "fqn": ["iterable_integration_tests", "user_history_bq_json_data"], "alias": "user_history_bq_json_data", "checksum": {"name": "sha256", "checksum": "d2689731ace45d1a5c13930bcc8b80f7b3a02993f8ee4c58bfcf754b734a5caa"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "seed", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": false, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "delimiter": ",", "quote_columns": false}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": false, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"docs": {"show": false}, "quote_columns": "{{ target.type == 'redshift' or var('fivetran_using_source_casing', false) }}"}, "created_at": 1789419971.441816, "relation_name": "\"postgres\".\"public\".\"user_history_bq_json_data\"", "raw_code": "", "doc_blocks": [], "root_path": "/home/runner/work/dbt_iterable/dbt_iterable/integration_tests", "depends_on": {"macros": []}}, "seed.iterable_integration_tests.user_unsubscribed_message_type_data": {"database": "postgres", "schema": "public", "name": "user_unsubscribed_message_type_data", "resource_type": "seed", "package_name": "iterable_integration_tests", "path": "user_unsubscribed_message_type_data.csv", "original_file_path": "seeds/user_unsubscribed_message_type_data.csv", "unique_id": "seed.iterable_integration_tests.user_unsubscribed_message_type_data", "fqn": ["iterable_integration_tests", "user_unsubscribed_message_type_data"], "alias": "user_unsubscribed_message_type_data", "checksum": {"name": "sha256", "checksum": "473f01110084e53b2115bd09606172cb87559359ccd66775f60209851bfdac12"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "seed", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {"_fivetran_synced": "timestamp"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": false, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "delimiter": ",", "quote_columns": false}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": false, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"docs": {"show": false}, "quote_columns": "{{ target.type == 'redshift' or var('fivetran_using_source_casing', false) }}", "column_types": {"_fivetran_synced": "timestamp"}}, "created_at": 1789419971.445178, "relation_name": "\"postgres\".\"public\".\"user_unsubscribed_message_type_data\"", "raw_code": "", "doc_blocks": [], "root_path": "/home/runner/work/dbt_iterable/dbt_iterable/integration_tests", "depends_on": {"macros": []}}, "seed.iterable_integration_tests.journey_data": {"database": "postgres", "schema": "public", "name": "journey_data", "resource_type": "seed", "package_name": "iterable_integration_tests", "path": "journey_data.csv", "original_file_path": "seeds/journey_data.csv", "unique_id": "seed.iterable_integration_tests.journey_data", "fqn": ["iterable_integration_tests", "journey_data"], "alias": "journey_data", "checksum": {"name": "sha256", "checksum": "763e5d9e7d86016bfdb9b0ad32da7c2d9685721719cb13b0b518415664bbb6d8"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "seed", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {"id": "bigint", "lifetime_limit": "bigint", "simultaneous_limit": "bigint", "start_tile_id": "bigint", "created_at": "timestamp", "updated_at": "timestamp", "_fivetran_synced": "timestamp"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": false, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "delimiter": ",", "quote_columns": false}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": false, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"docs": {"show": false}, "quote_columns": "{{ target.type == 'redshift' or var('fivetran_using_source_casing', false) }}", "column_types": {"id": "{%- if target.type == 'bigquery' -%} INT64 {%- else -%} bigint {%- endif -%}", "lifetime_limit": "{%- if target.type == 'bigquery' -%} INT64 {%- else -%} bigint {%- endif -%}", "simultaneous_limit": "{%- if target.type == 'bigquery' -%} INT64 {%- else -%} bigint {%- endif -%}", "start_tile_id": "{%- if target.type == 'bigquery' -%} INT64 {%- else -%} bigint {%- endif -%}", "created_at": "timestamp", "updated_at": "timestamp", "_fivetran_synced": "timestamp"}}, "created_at": 1789419971.4488525, "relation_name": "\"postgres\".\"public\".\"journey_data\"", "raw_code": "", "doc_blocks": [], "root_path": "/home/runner/work/dbt_iterable/dbt_iterable/integration_tests", "depends_on": {"macros": []}}, "seed.iterable_integration_tests.campaign_history_data": {"database": "postgres", "schema": "public", "name": "campaign_history_data", "resource_type": "seed", "package_name": "iterable_integration_tests", "path": "campaign_history_data.csv", "original_file_path": "seeds/campaign_history_data.csv", "unique_id": "seed.iterable_integration_tests.campaign_history_data", "fqn": ["iterable_integration_tests", "campaign_history_data"], "alias": "campaign_history_data", "checksum": {"name": "sha256", "checksum": "06adf392dab227dbabbda6782b710213ceea5a30d87990d0cbabe92ba0a955c4"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "seed", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {"_fivetran_synced": "timestamp"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": false, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "delimiter": ",", "quote_columns": false}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": false, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"docs": {"show": false}, "quote_columns": "{{ target.type == 'redshift' or var('fivetran_using_source_casing', false) }}", "column_types": {"_fivetran_synced": "timestamp"}}, "created_at": 1789419971.4523542, "relation_name": "\"postgres\".\"public\".\"campaign_history_data\"", "raw_code": "", "doc_blocks": [], "root_path": "/home/runner/work/dbt_iterable/dbt_iterable/integration_tests", "depends_on": {"macros": []}}, "seed.iterable_integration_tests.list_data": {"database": "postgres", "schema": "public", "name": "list_data", "resource_type": "seed", "package_name": "iterable_integration_tests", "path": "list_data.csv", "original_file_path": "seeds/list_data.csv", "unique_id": "seed.iterable_integration_tests.list_data", "fqn": ["iterable_integration_tests", "list_data"], "alias": "list_data", "checksum": {"name": "sha256", "checksum": "9d817c52008be5fbdb25cde6fa5855f8222f41a436ba7e2e5ed564e319cb64fd"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "seed", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {"_fivetran_synced": "timestamp"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": false, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "delimiter": ",", "quote_columns": false}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": false, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"docs": {"show": false}, "quote_columns": "{{ target.type == 'redshift' or var('fivetran_using_source_casing', false) }}", "column_types": {"_fivetran_synced": "timestamp"}}, "created_at": 1789419971.455781, "relation_name": "\"postgres\".\"public\".\"list_data\"", "raw_code": "", "doc_blocks": [], "root_path": "/home/runner/work/dbt_iterable/dbt_iterable/integration_tests", "depends_on": {"macros": []}}, "seed.iterable_integration_tests.event_extension_data": {"database": "postgres", "schema": "public", "name": "event_extension_data", "resource_type": "seed", "package_name": "iterable_integration_tests", "path": "event_extension_data.csv", "original_file_path": "seeds/event_extension_data.csv", "unique_id": "seed.iterable_integration_tests.event_extension_data", "fqn": ["iterable_integration_tests", "event_extension_data"], "alias": "event_extension_data", "checksum": {"name": "sha256", "checksum": "e0ed2a4a9661ad12bdd9d9a2221df3fd32f2da5fad39e9d0f6f01cbc819ffa9a"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "seed", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {"payload": "varchar(100)", "_fivetran_synced": "timestamp"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": false, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "delimiter": ",", "quote_columns": false}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": false, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"docs": {"show": false}, "quote_columns": "{{ target.type == 'redshift' or var('fivetran_using_source_casing', false) }}", "column_types": {"payload": "{{ 'varchar(100)' if target.type in ('redshift', 'postgres') else 'string'}}", "_fivetran_synced": "timestamp"}}, "created_at": 1789419971.4594202, "relation_name": "\"postgres\".\"public\".\"event_extension_data\"", "raw_code": "", "doc_blocks": [], "root_path": "/home/runner/work/dbt_iterable/dbt_iterable/integration_tests", "depends_on": {"macros": []}}, "seed.iterable_integration_tests.user_unsubscribed_channel_data": {"database": "postgres", "schema": "public", "name": "user_unsubscribed_channel_data", "resource_type": "seed", "package_name": "iterable_integration_tests", "path": "user_unsubscribed_channel_data.csv", "original_file_path": "seeds/user_unsubscribed_channel_data.csv", "unique_id": "seed.iterable_integration_tests.user_unsubscribed_channel_data", "fqn": ["iterable_integration_tests", "user_unsubscribed_channel_data"], "alias": "user_unsubscribed_channel_data", "checksum": {"name": "sha256", "checksum": "4c6abacf719352d79d0da89751296fc2665d65546ee2c1ad45d142918c750f28"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "seed", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {"_fivetran_synced": "timestamp"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": false, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "delimiter": ",", "quote_columns": false}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": false, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"docs": {"show": false}, "quote_columns": "{{ target.type == 'redshift' or var('fivetran_using_source_casing', false) }}", "column_types": {"_fivetran_synced": "timestamp"}}, "created_at": 1789419971.4630718, "relation_name": "\"postgres\".\"public\".\"user_unsubscribed_channel_data\"", "raw_code": "", "doc_blocks": [], "root_path": "/home/runner/work/dbt_iterable/dbt_iterable/integration_tests", "depends_on": {"macros": []}}, "seed.iterable_integration_tests.campaign_label_history_data": {"database": "postgres", "schema": "public", "name": "campaign_label_history_data", "resource_type": "seed", "package_name": "iterable_integration_tests", "path": "campaign_label_history_data.csv", "original_file_path": "seeds/campaign_label_history_data.csv", "unique_id": "seed.iterable_integration_tests.campaign_label_history_data", "fqn": ["iterable_integration_tests", "campaign_label_history_data"], "alias": "campaign_label_history_data", "checksum": {"name": "sha256", "checksum": "30ed21c883f801eb859d0280b90d45cb3dd020cdb708f4ef4aeca772372bf077"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "seed", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {"_fivetran_synced": "timestamp"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": false, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "delimiter": ",", "quote_columns": false}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": false, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"docs": {"show": false}, "quote_columns": "{{ target.type == 'redshift' or var('fivetran_using_source_casing', false) }}", "column_types": {"_fivetran_synced": "timestamp"}}, "created_at": 1789419971.466485, "relation_name": "\"postgres\".\"public\".\"campaign_label_history_data\"", "raw_code": "", "doc_blocks": [], "root_path": "/home/runner/work/dbt_iterable/dbt_iterable/integration_tests", "depends_on": {"macros": []}}, "seed.iterable_integration_tests.user_history_data": {"database": "postgres", "schema": "public", "name": "user_history_data", "resource_type": "seed", "package_name": "iterable_integration_tests", "path": "user_history_data.csv", "original_file_path": "seeds/user_history_data.csv", "unique_id": "seed.iterable_integration_tests.user_history_data", "fqn": ["iterable_integration_tests", "user_history_data"], "alias": "user_history_data", "checksum": {"name": "sha256", "checksum": "708bd35a21174cf05f0b4370079a339061c0b9292690ac4facd43b1d2bdff186"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "seed", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {"updated_at": "timestamp", "_fivetran_synced": "timestamp"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": false, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "delimiter": ",", "quote_columns": false}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": false, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"docs": {"show": false}, "quote_columns": "{{ target.type == 'redshift' or var('fivetran_using_source_casing', false) }}", "column_types": {"updated_at": "timestamp", "_fivetran_synced": "timestamp"}}, "created_at": 1789419971.4698994, "relation_name": "\"postgres\".\"public\".\"user_history_data\"", "raw_code": "", "doc_blocks": [], "root_path": "/home/runner/work/dbt_iterable/dbt_iterable/integration_tests", "depends_on": {"macros": []}}, "model.iterable.iterable__users": {"database": "postgres", "schema": "public_iterable_dev", "name": "iterable__users", "resource_type": "model", "package_name": "iterable", "path": "iterable__users.sql", "original_file_path": "models/iterable__users.sql", "unique_id": "model.iterable.iterable__users", "fqn": ["iterable", "iterable__users"], "alias": "iterable__users", "checksum": {"name": "sha256", "checksum": "da23dacdef77d357083015551b25b1e1013e549ccea451e28820df44f3ac4f5a"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "table", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "Table that provides unique user enriched information.", "columns": {"source_relation": {"name": "source_relation", "description": "Identifies the record's source.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": ["doc.iterable.source_relation"]}, "unique_user_key": {"name": "unique_user_key", "description": "The unique identifier of the user. With the new schema (Aug 2023), it is the _fivetran_user_id. This is a hash of user_id and/or email, depending on project type. If using the old schema, it is email.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "_fivetran_user_id": {"name": "_fivetran_user_id", "description": "A Fivetran-created unique identifier for the new Iterable schema in Aug 2023, for users, derived from hashing user_id and/or email, depending on project type.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "email": {"name": "email", "description": "The user's email. User identifier, for email-based projects. Previously was the unique identifier for user records, for the old Iterable schema before the August 2023 updates.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "first_name": {"name": "first_name", "description": "First name of the user", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "last_name": {"name": "last_name", "description": "Last name of the user", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "user_id": {"name": "user_id", "description": "User identifier, for userID-based projects.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "signup_date": {"name": "signup_date", "description": "Timestamp of when the user signed up", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "signup_source": {"name": "signup_source", "description": "Source where the user signed up", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "updated_at": {"name": "updated_at", "description": "Last update timestamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "phone_number": {"name": "phone_number", "description": "Phone number associated with the user", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "email_list_ids": {"name": "email_list_ids", "description": "Array of all email lists associated with the user, derived from the list_user table relationships", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "count_lists": {"name": "count_lists", "description": "Total count of lists associated with the user", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "count_total_campaigns": {"name": "count_total_campaigns", "description": "Count of all campaigns the user has been in", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "first_event_at": {"name": "first_event_at", "description": "The first event the user ever encountered", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "last_event_at": {"name": "last_event_at", "description": "The most recent event the user has encountered", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_emailclick": {"name": "total_emailclick", "description": "Total number of email clicks the user has performed", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_emailunsubscribe": {"name": "total_emailunsubscribe", "description": "Total unsubscription events the user has performed", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_emailcomplaint": {"name": "total_emailcomplaint", "description": "Total email complaints the user has performed", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_customevent": {"name": "total_customevent", "description": "Total custom events associated with the user", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_emailsubscribe": {"name": "total_emailsubscribe", "description": "Total subscription events the user has performed", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_emailopen": {"name": "total_emailopen", "description": "Total email opened events the user has performed", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_pushsend": {"name": "total_pushsend", "description": "The push send events the user has experienced", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_smsbounce": {"name": "total_smsbounce", "description": "Total sms bounces that are associated with the user", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_pushbounce": {"name": "total_pushbounce", "description": "Total number of push bounces associated with the user", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_inappsendskip": {"name": "total_inappsendskip", "description": "Total in app send skips associated with the user", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_smssend": {"name": "total_smssend", "description": "Total sms sends that the user has experienced", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_inappsend": {"name": "total_inappsend", "description": "Total in app sends the user has experienced", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_pushopen": {"name": "total_pushopen", "description": "Total push messages the user has opened", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_emailsend": {"name": "total_emailsend", "description": "Total emails that have been sent to the user", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_pushsendskip": {"name": "total_pushsendskip", "description": "Total push sends the user has skipped", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_inappopen": {"name": "total_inappopen", "description": "Total in app opens the user has performed", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_emailsendskip": {"name": "total_emailsendskip", "description": "Total email sends the user has skipped", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_emailbounce": {"name": "total_emailbounce", "description": "Total number of emails that have bounced from the user", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_inappclick": {"name": "total_inappclick", "description": "Total in app clicks associated with the user", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_pushuninstall": {"name": "total_pushuninstall", "description": "Total push uninstall events the user has performed", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "iterable://models/iterable.yml", "build_path": null, "unrendered_config": {"materialized": "table", "schema": "iterable_{{ var('directed_schema','dev') }}", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789419972.8753684, "relation_name": "\"postgres\".\"public_iterable_dev\".\"iterable__users\"", "raw_code": "{% set passthrough_column_count = var('iterable_user_history_pass_through_columns') | length %}\n\nwith user_event_metrics as (\n\n select *\n from {{ ref('int_iterable__user_event_metrics') }}\n\n), list_users as (\n\n select *\n from {{ ref('stg_iterable__list_user') }}\n order by list_id -- so the list ids will aggregate in the right order\n\n), list_user_aggregated as (\n\n select\n source_relation,\n _fivetran_user_id,\n count(*) as count_lists,\n {{ dbt.concat([\"'['\", fivetran_utils.string_agg(field_to_agg=\"cast(list_id as \" ~ dbt.type_string() ~ \")\", delimiter=\"','\"), \"']'\"]) }} as email_list_ids\n from list_users\n group by 1, 2 \n\n), user_history_unnest as (\n -- this has all the user fields we're looking to pass through\n\n select *\n from {{ ref('int_iterable__list_user_unnest') }}\n\n -- limit to current lists they are a member of. each list-user combo is a unique row, which we will roll up\n where is_current\n\n), user_with_list_metrics as (\n\n select\n source_relation,\n user_id,\n _fivetran_user_id,\n unique_user_key,\n email,\n first_name,\n last_name,\n signup_date,\n signup_source,\n updated_at,\n phone_number,\n email_list_ids\n\n --The below script allows for pass through columns.\n {{ fivetran_utils.persist_pass_through_columns(pass_through_variable='iterable_user_history_pass_through_columns') }}\n\n , count(distinct list_id) as count_lists\n\n from user_history_unnest\n -- roll up to the user\n {{ dbt_utils.group_by(n = 12 + passthrough_column_count) }}\n\n), user_join as (\n\n select\n user_with_list_metrics.source_relation,\n user_with_list_metrics.user_id,\n user_with_list_metrics._fivetran_user_id,\n user_with_list_metrics.unique_user_key,\n user_with_list_metrics.email,\n user_with_list_metrics.first_name,\n user_with_list_metrics.last_name,\n user_with_list_metrics.signup_date,\n user_with_list_metrics.signup_source,\n user_with_list_metrics.updated_at,\n user_with_list_metrics.phone_number,\n coalesce(list_user_aggregated.email_list_ids, user_with_list_metrics.email_list_ids, '[]') as email_list_ids,\n coalesce(list_user_aggregated.count_lists, user_with_list_metrics.count_lists, 0) as count_lists,\n {{ dbt_utils.star(from=ref('int_iterable__user_event_metrics'), except=['source_relation','unique_user_key','_fivetran_user_id','user_id','user_email']) }}\n {{ fivetran_utils.persist_pass_through_columns(pass_through_variable='iterable_user_history_pass_through_columns', identifier='user_with_list_metrics') }}\n\n from user_with_list_metrics\n left join user_event_metrics\n on user_with_list_metrics.unique_user_key = user_event_metrics.unique_user_key\n and user_with_list_metrics.source_relation = user_event_metrics.source_relation\n left join list_user_aggregated\n -- use _fivetran_user_id since in list_user it is a primary key\n on user_with_list_metrics._fivetran_user_id = list_user_aggregated._fivetran_user_id\n and user_with_list_metrics.source_relation = list_user_aggregated.source_relation\n)\n\nselect *\nfrom user_join", "doc_blocks": [], "language": "sql", "refs": [{"name": "int_iterable__user_event_metrics", "package": null, "version": null}, {"name": "stg_iterable__list_user", "package": null, "version": null}, {"name": "int_iterable__list_user_unnest", "package": null, "version": null}, {"name": "int_iterable__user_event_metrics", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.type_string", "macro.fivetran_utils.string_agg", "macro.dbt.concat", "macro.fivetran_utils.persist_pass_through_columns", "macro.dbt_utils.group_by", "macro.dbt_utils.star"], "nodes": ["model.iterable.int_iterable__user_event_metrics", "model.iterable.stg_iterable__list_user", "model.iterable.int_iterable__list_user_unnest"]}, "compiled_path": "target/compiled/iterable/models/iterable__users.sql", "compiled": true, "compiled_code": "\n\nwith user_event_metrics as (\n\n select *\n from \"postgres\".\"public_iterable_dev\".\"int_iterable__user_event_metrics\"\n\n), list_users as (\n\n select *\n from \"postgres\".\"public_iterable_dev\".\"stg_iterable__list_user\"\n order by list_id -- so the list ids will aggregate in the right order\n\n), list_user_aggregated as (\n\n select\n source_relation,\n _fivetran_user_id,\n count(*) as count_lists,\n '[' || \n string_agg(cast(list_id as TEXT), ',')\n\n || ']' as email_list_ids\n from list_users\n group by 1, 2 \n\n), user_history_unnest as (\n -- this has all the user fields we're looking to pass through\n\n select *\n from \"postgres\".\"public_iterable_dev\".\"int_iterable__list_user_unnest\"\n\n -- limit to current lists they are a member of. each list-user combo is a unique row, which we will roll up\n where is_current\n\n), user_with_list_metrics as (\n\n select\n source_relation,\n user_id,\n _fivetran_user_id,\n unique_user_key,\n email,\n first_name,\n last_name,\n signup_date,\n signup_source,\n updated_at,\n phone_number,\n email_list_ids\n\n --The below script allows for pass through columns.\n \n\n\n\n\n\n , count(distinct list_id) as count_lists\n\n from user_history_unnest\n -- roll up to the user\n group by 1,2,3,4,5,6,7,8,9,10,11,12\n\n), user_join as (\n\n select\n user_with_list_metrics.source_relation,\n user_with_list_metrics.user_id,\n user_with_list_metrics._fivetran_user_id,\n user_with_list_metrics.unique_user_key,\n user_with_list_metrics.email,\n user_with_list_metrics.first_name,\n user_with_list_metrics.last_name,\n user_with_list_metrics.signup_date,\n user_with_list_metrics.signup_source,\n user_with_list_metrics.updated_at,\n user_with_list_metrics.phone_number,\n coalesce(list_user_aggregated.email_list_ids, user_with_list_metrics.email_list_ids, '[]') as email_list_ids,\n coalesce(list_user_aggregated.count_lists, user_with_list_metrics.count_lists, 0) as count_lists,\n \"count_total_campaigns\",\n \"first_event_at\",\n \"last_event_at\",\n \"total_emailclick\",\n \"total_emailunsubscribe\",\n \"total_emailcomplaint\",\n \"total_customevent\",\n \"total_emailsubscribe\",\n \"total_emailopen\",\n \"total_pushsend\",\n \"total_smsbounce\",\n \"total_pushbounce\",\n \"total_inappsendskip\",\n \"total_smssend\",\n \"total_inappsend\",\n \"total_pushopen\",\n \"total_emailsend\",\n \"total_pushsendskip\",\n \"total_inappopen\",\n \"total_emailsendskip\",\n \"total_emailbounce\",\n \"total_inappclick\",\n \"total_pushuninstall\"\n \n\n\n\n\n\n from user_with_list_metrics\n left join user_event_metrics\n on user_with_list_metrics.unique_user_key = user_event_metrics.unique_user_key\n and user_with_list_metrics.source_relation = user_event_metrics.source_relation\n left join list_user_aggregated\n -- use _fivetran_user_id since in list_user it is a primary key\n on user_with_list_metrics._fivetran_user_id = list_user_aggregated._fivetran_user_id\n and user_with_list_metrics.source_relation = list_user_aggregated.source_relation\n)\n\nselect *\nfrom user_join", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.iterable__list_user_history": {"database": "postgres", "schema": "public_iterable_dev", "name": "iterable__list_user_history", "resource_type": "model", "package_name": "iterable", "path": "iterable__list_user_history.sql", "original_file_path": "models/iterable__list_user_history.sql", "unique_id": "model.iterable.iterable__list_user_history", "fqn": ["iterable", "iterable__list_user_history"], "alias": "iterable__list_user_history", "checksum": {"name": "sha256", "checksum": "9c0778ad02c86e2145ba4189534ea1eabf07b41bb3aa414934fa554ae4af4e1c"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "table", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "Table that recreates the `list_user_history` source table. Additionally, this table provides an `is_current` field to identify the current lists associated with the user. The table coalesces list_id values from both the direct list_user relationships and the unnested email_list_ids from user history to ensure comprehensive list coverage. The grain of this table is at the user/list/updated_at level.\n", "columns": {"source_relation": {"name": "source_relation", "description": "Identifies the record's source.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": ["doc.iterable.source_relation"]}, "unique_user_key": {"name": "unique_user_key", "description": "The unique identifier of the user. With the new schema (Aug 2023), it is the _fivetran_user_id. This is a hash of user_id and/or email, depending on project type. If using the old schema, it is email.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "_fivetran_user_id": {"name": "_fivetran_user_id", "description": "A Fivetran-created unique identifier for the new Iterable schema in Aug 2023, for users, derived from hashing user_id and/or email, depending on project type.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "user_email": {"name": "user_email", "description": "Email of the user if it exists.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "user_first_name": {"name": "user_first_name", "description": "First name of the user", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "user_last_name": {"name": "user_last_name", "description": "Last name of the user", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "user_id": {"name": "user_id", "description": "User identifier, for userID-based projects.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "user_signup_date": {"name": "user_signup_date", "description": "Timestamp of when the user signed up", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "user_signup_source": {"name": "user_signup_source", "description": "Source where the user signed up", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "user_updated_at": {"name": "user_updated_at", "description": "Last update timestamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "list_id": {"name": "list_id", "description": "The list associated with the user. Uses coalesced values prioritizing `list_id` from `LIST_USER` over the unnested `email_list_ids` from `USER_HISTORY` for comprehensive list coverage.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "is_current": {"name": "is_current", "description": "Boolean indicating if the current list is active", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "list_name": {"name": "list_name", "description": "Name of the list associated with the user", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "list_type": {"name": "list_type", "description": "Type of list associated with the user", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "list_created_at": {"name": "list_created_at", "description": "Date the list was created", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "iterable://models/iterable.yml", "build_path": null, "unrendered_config": {"materialized": "table", "schema": "iterable_{{ var('directed_schema','dev') }}", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789419972.8669116, "relation_name": "\"postgres\".\"public_iterable_dev\".\"iterable__list_user_history\"", "raw_code": "with user_history_unnest as (\n\n select *\n from {{ ref('int_iterable__list_user_unnest') }}\n\n), list_users as (\n\n select *\n from {{ ref('stg_iterable__list_user') }}\n\n), lists as (\n\n select *\n from {{ ref('stg_iterable__list') }}\n\n), final as (\n select distinct\n user_history_unnest.source_relation,\n user_history_unnest.unique_user_key,\n user_history_unnest._fivetran_user_id,\n user_history_unnest.user_id,\n user_history_unnest.email as user_email,\n user_history_unnest.first_name as user_first_name,\n user_history_unnest.last_name as user_last_name,\n user_history_unnest.signup_date as user_signup_date,\n user_history_unnest.signup_source as user_signup_source,\n user_history_unnest.updated_at as user_updated_at,\n coalesce(list_users.list_id, user_history_unnest.list_id) as list_id,\n user_history_unnest.is_current,\n lists.list_name,\n lists.list_type,\n lists.created_at as list_created_at\n\n --The below script allows for pass through columns.\n {{ fivetran_utils.persist_pass_through_columns(pass_through_variable='iterable_user_history_pass_through_columns', identifier='user_history_unnest') }}\n\n from user_history_unnest\n left join list_users\n on list_users.source_relation = user_history_unnest.source_relation\n and list_users._fivetran_user_id = user_history_unnest._fivetran_user_id\n left join lists\n on lists.source_relation = user_history_unnest.source_relation\n and lists.list_id = coalesce(list_users.list_id, user_history_unnest.list_id)\n)\n\nselect *\nfrom final", "doc_blocks": [], "language": "sql", "refs": [{"name": "int_iterable__list_user_unnest", "package": null, "version": null}, {"name": "stg_iterable__list_user", "package": null, "version": null}, {"name": "stg_iterable__list", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.fivetran_utils.persist_pass_through_columns"], "nodes": ["model.iterable.int_iterable__list_user_unnest", "model.iterable.stg_iterable__list_user", "model.iterable.stg_iterable__list"]}, "compiled_path": "target/compiled/iterable/models/iterable__list_user_history.sql", "compiled": true, "compiled_code": "with user_history_unnest as (\n\n select *\n from \"postgres\".\"public_iterable_dev\".\"int_iterable__list_user_unnest\"\n\n), list_users as (\n\n select *\n from \"postgres\".\"public_iterable_dev\".\"stg_iterable__list_user\"\n\n), lists as (\n\n select *\n from \"postgres\".\"public_iterable_dev\".\"stg_iterable__list\"\n\n), final as (\n select distinct\n user_history_unnest.source_relation,\n user_history_unnest.unique_user_key,\n user_history_unnest._fivetran_user_id,\n user_history_unnest.user_id,\n user_history_unnest.email as user_email,\n user_history_unnest.first_name as user_first_name,\n user_history_unnest.last_name as user_last_name,\n user_history_unnest.signup_date as user_signup_date,\n user_history_unnest.signup_source as user_signup_source,\n user_history_unnest.updated_at as user_updated_at,\n coalesce(list_users.list_id, user_history_unnest.list_id) as list_id,\n user_history_unnest.is_current,\n lists.list_name,\n lists.list_type,\n lists.created_at as list_created_at\n\n --The below script allows for pass through columns.\n \n\n\n\n\n\n from user_history_unnest\n left join list_users\n on list_users.source_relation = user_history_unnest.source_relation\n and list_users._fivetran_user_id = user_history_unnest._fivetran_user_id\n left join lists\n on lists.source_relation = user_history_unnest.source_relation\n and lists.list_id = coalesce(list_users.list_id, user_history_unnest.list_id)\n)\n\nselect *\nfrom final", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.iterable__events": {"database": "postgres", "schema": "public_iterable_dev", "name": "iterable__events", "resource_type": "model", "package_name": "iterable", "path": "iterable__events.sql", "original_file_path": "models/iterable__events.sql", "unique_id": "model.iterable.iterable__events", "fqn": ["iterable", "iterable__events"], "alias": "iterable__events", "checksum": {"name": "sha256", "checksum": "d516cb05680b528ba689ac2a2e34bfee8bbd7ede3c7d8ccfea16a28232d39c44"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "incremental", "incremental_strategy": "delete+insert", "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": ["unique_event_id"], "on_schema_change": "fail", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}, "partition_by": {"field": "created_on", "data_type": "date"}, "file_format": "delta"}, "tags": [], "description": "Table that provides a comprehensive view of all events with enriched information such as the campaign, user effected, and template used.", "columns": {"source_relation": {"name": "source_relation", "description": "Identifies the record's source.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": ["doc.iterable.source_relation"]}, "event_id": {"name": "event_id", "description": "Unique id of the event generated by Fivetran", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_event_id": {"name": "unique_event_id", "description": "A unique surrogate key of event_id, _fivetran_user_id, and source_relation.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_user_key": {"name": "unique_user_key", "description": "The unique identifier of the user. With the new schema (Aug 2023), it is the _fivetran_user_id. This is a hash of user_id and/or email, depending on project type. If using the old schema, it is email.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "_fivetran_user_id": {"name": "_fivetran_user_id", "description": "A Fivetran-created unique identifier for the new Iterable schema in Aug 2023, for users, derived from hashing user_id and/or email, depending on project type.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "campaign_id": {"name": "campaign_id", "description": "Reference to the campaign from which the event originated", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "content_id": {"name": "content_id", "description": "Reference to the content the event is associated with", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "created_at": {"name": "created_at", "description": "Creation timestamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "email": {"name": "email", "description": "The user's email. User identifier, for email-based projects. Previously was the unique identifier for user records, for the old Iterable schema before the August 2023 updates.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "additional_properties": {"name": "additional_properties", "description": "json object containing addition event properties", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "event_name": {"name": "event_name", "description": "Name provided to the individual event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "message_bus_id": {"name": "message_bus_id", "description": "Reference to the message bus associated with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "message_id": {"name": "message_id", "description": "Reference to the message the event is associated with", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "message_type_id": {"name": "message_type_id", "description": "Reference to the type of message the event is associated with", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "recipient_state": {"name": "recipient_state", "description": "The state of the recipient upon receiving the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "status": {"name": "status", "description": "Status of the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "transactional_data": {"name": "transactional_data", "description": "Transactional data associated with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unsub_source": {"name": "unsub_source", "description": "Source of the unsubscribe event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "user_agent": {"name": "user_agent", "description": "User agent associated with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "user_agent_device": {"name": "user_agent_device", "description": "The device of the user agent", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "Timestamp of when the event record was synced by Fivetran", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "campaign_name": {"name": "campaign_name", "description": "The name of the campaign", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "campaign_type": {"name": "campaign_type", "description": "The type of campaign", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "is_campaign_recurring": {"name": "is_campaign_recurring", "description": "Boolean indicating if the campaign is recurrent", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "recurring_campaign_name": {"name": "recurring_campaign_name", "description": "The name of the recurring campaign (if applicable)", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "recurring_campaign_id": {"name": "recurring_campaign_id", "description": "The campaign if of the recurring campaign (if applicable)", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "user_id": {"name": "user_id", "description": "User identifier, for userID-based projects.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "user_full_name": {"name": "user_full_name", "description": "Full name of the user", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "message_type_name": {"name": "message_type_name", "description": "Name of the message type", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "message_medium": {"name": "message_medium", "description": "Medium of the message", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "channel_id": {"name": "channel_id", "description": "Unique identifier of the channel", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "channel_name": {"name": "channel_name", "description": "The channel name", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "channel_type": {"name": "channel_type", "description": "The type of channel", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "is_app_already_running": {"name": "is_app_already_running", "description": "Boolean indicating if the app is already running", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "badge": {"name": "badge", "description": "Badge associated with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "canonical_url_id": {"name": "canonical_url_id", "description": "Reference to the url associated with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "is_content_available": {"name": "is_content_available", "description": "Content available from the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "device": {"name": "device", "description": "The device associated with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "email_id": {"name": "email_id", "description": "Reference to the email associated with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "email_subject": {"name": "email_subject", "description": "Subject of the email associated with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "experiment_id": {"name": "experiment_id", "description": "Reference to the experiment used if the event is an experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "from_phone_number_id": {"name": "from_phone_number_id", "description": "Reference to the phone number which the event is from", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "from_smssender_id": {"name": "from_smssender_id", "description": "Reference to the sms sender which the event is from", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "link_id": {"name": "link_id", "description": "Reference to the link associated with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "link_url": {"name": "link_url", "description": "Url of the link associated with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "locale": {"name": "locale", "description": "Locale associated with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "payload": {"name": "payload", "description": "Payload resulted from the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "platform_endpoint": {"name": "platform_endpoint", "description": "The specific platform endpoint of the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "push_message": {"name": "push_message", "description": "Boolean indicating if the event is a push message", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "region": {"name": "region", "description": "Region of the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "sms_message": {"name": "sms_message", "description": "Boolean indicating if the event is an sms message", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "to_phone_number": {"name": "to_phone_number", "description": "To phone number associated with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "url": {"name": "url", "description": "Url associated with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "workflow_id": {"name": "workflow_id", "description": "Reference to the workflow which the event originated", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "workflow_name": {"name": "workflow_name", "description": "Name of the workflow which the event originated", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "catalog_collection_count": {"name": "catalog_collection_count", "description": "The count of products or items collected in a catalog associated with the event.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "catalog_lookup_count": {"name": "catalog_lookup_count", "description": "The count of times a catalog was looked up or queried during the event.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "template_id": {"name": "template_id", "description": "Unique identifier of the template", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "template_name": {"name": "template_name", "description": "User defined name of the template", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "template_creator_user_id": {"name": "template_creator_user_id", "description": "Reference to the user who created the template", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "created_on": {"name": "created_on", "description": "Day when the event was created", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "city": {"name": "city", "description": "The city associated with the event, which could be the location of the recipient.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "clicked_url": {"name": "clicked_url", "description": "The URL that was clicked by the recipient in response to the marketing message.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "country": {"name": "country", "description": "The country associated with the event, which could be the location of the recipient.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "error_code": {"name": "error_code", "description": "The error code or message indicating any issues or errors encountered during the event.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "expires_at": {"name": "expires_at", "description": "The date and time when the event or message is set to expire or become invalid.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "from_phone_number": {"name": "from_phone_number", "description": "The phone number from which the SMS message was sent.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "in_app_body": {"name": "in_app_body", "description": "The content or body of an in-app message that was sent as part of the event.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "is_sms_estimation": {"name": "is_sms_estimation", "description": "A boolean indicating whether the SMS message is an estimation or not.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "labels": {"name": "labels", "description": "Any labels or tags associated with the event, which can be used for categorization or organization.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "message_status": {"name": "message_status", "description": "The status of the marketing message, such as sent, delivered, opened, etc.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "mms_send_count": {"name": "mms_send_count", "description": "The count of multimedia messages (MMS) sent as part of the event.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "reason": {"name": "reason", "description": "The reason or cause associated with a specific event or action.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "sms_send_count": {"name": "sms_send_count", "description": "The count of SMS messages sent as part of the event.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "iterable://models/iterable.yml", "build_path": null, "unrendered_config": {"materialized": "incremental", "schema": "iterable_{{ var('directed_schema','dev') }}", "unique_key": "['unique_event_id']", "incremental_strategy": "CondExpr(test=Compare(expr=Getattr(node=Name(name='target', ctx='load'), attr='type', ctx='load'), ops=[Operand(op='in', expr=Tuple(items=[Const(value='bigquery'), Const(value='spark'), Const(value='databricks')], ctx='load'))]), expr1=Const(value='insert_overwrite'), expr2=Const(value='delete+insert'))", "partition_by": "CondExpr(test=Compare(expr=Getattr(node=Name(name='target', ctx='load'), attr='type', ctx='load'), ops=[Operand(op='notin', expr=Tuple(items=[Const(value='spark'), Const(value='databricks'), Const(value='duckdb')], ctx='load'))]), expr1=Dict(items=[Pair(key=Const(value='field'), value=Const(value='created_on')), Pair(key=Const(value='data_type'), value=Const(value='date'))]), expr2=List(items=[Const(value='created_on')]))", "file_format": "delta", "on_schema_change": "fail", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789419972.8543146, "relation_name": "\"postgres\".\"public_iterable_dev\".\"iterable__events\"", "raw_code": "{{ config(\n materialized='incremental',\n unique_key=['unique_event_id'],\n incremental_strategy='insert_overwrite' if target.type in ('bigquery', 'spark', 'databricks') else 'delete+insert',\n partition_by={\"field\": \"created_on\", \"data_type\": \"date\"} if target.type not in ('spark', 'databricks', 'duckdb') else ['created_on'],\n file_format='delta',\n on_schema_change='fail'\n ) \n}}\n\n{% set using_event_extension = var('iterable__using_event_extension', True) %}\n\nwith events as (\n\n select *\n from {{ ref('stg_iterable__event') }}\n\n {% if is_incremental() %}\n where created_on >= {{ iterable.iterable_lookback(\n from_date=\"max(created_on)\",\n datepart='day', \n interval=var('iterable_lookback_window', 7)) }}\n {% endif %}\n\n), campaign as (\n\n select *\n from {{ ref('int_iterable__recurring_campaigns') }}\n\n\n{% if using_event_extension %}\n), event_extension as (\n\n select *\n from {{ ref('stg_iterable__event_extension') }}\n{% endif %}\n\n), users as (\n\n select *\n from {{ ref('int_iterable__latest_user') }}\n\n), message_type_channel as (\n\n select *\n from {{ ref('int_iterable__message_type_channel') }}\n\n), template as (\n\n select *\n from {{ ref('int_iterable__latest_template') }}\n\n), event_join as (\n\n select \n events.*,\n campaign.campaign_name,\n campaign.campaign_type,\n campaign.is_campaign_recurring,\n campaign.recurring_campaign_name,\n campaign.recurring_campaign_id,\n\n users.user_id,\n users.first_name || ' ' || users.last_name as user_full_name,\n\n message_type_channel.message_type_name,\n message_type_channel.message_medium,\n message_type_channel.channel_id,\n message_type_channel.channel_name,\n message_type_channel.channel_type\n\n {% if using_event_extension %}\n {% set exclude_fields = [\"source_relation\", \"unique_user_key\",\"_fivetran_user_id\",\"event_id\", \"content_id\", \"_fivetran_synced\", \"unique_event_id\"] %}\n , {{ dbt_utils.star(from=ref('stg_iterable__event_extension'), except=exclude_fields, relation_alias=\"event_extension\") }}\n {% endif %}\n\n ,\n campaign.template_id,\n template.template_name,\n template.creator_user_id as template_creator_user_id\n \n from events\n\n {% if using_event_extension %}\n left join event_extension\n on events.unique_event_id = event_extension.unique_event_id\n and events.source_relation = event_extension.source_relation\n {% endif %}\n\n left join campaign\n on events.campaign_id = campaign.campaign_id\n and events.source_relation = campaign.source_relation\n left join users\n on events.unique_user_key = users.unique_user_key -- unique_user_key = _fivetran_user_id if exists, otherwise email\n and events.source_relation = users.source_relation\n left join message_type_channel\n on events.message_type_id = message_type_channel.message_type_id\n and events.source_relation = message_type_channel.source_relation\n left join template\n on campaign.template_id = template.template_id\n and events.source_relation = template.source_relation\n)\n\nselect *\nfrom event_join", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__event", "package": null, "version": null}, {"name": "int_iterable__recurring_campaigns", "package": null, "version": null}, {"name": "stg_iterable__event_extension", "package": null, "version": null}, {"name": "int_iterable__latest_user", "package": null, "version": null}, {"name": "int_iterable__message_type_channel", "package": null, "version": null}, {"name": "int_iterable__latest_template", "package": null, "version": null}, {"name": "stg_iterable__event_extension", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.is_incremental", "macro.dbt_utils.star", "macro.iterable.iterable_lookback"], "nodes": ["model.iterable.stg_iterable__event", "model.iterable.int_iterable__recurring_campaigns", "model.iterable.stg_iterable__event_extension", "model.iterable.int_iterable__latest_user", "model.iterable.int_iterable__message_type_channel", "model.iterable.int_iterable__latest_template"]}, "compiled_path": "target/compiled/iterable/models/iterable__events.sql", "compiled": true, "compiled_code": "\n\n\n\nwith events as (\n\n select *\n from \"postgres\".\"public_iterable_dev\".\"stg_iterable__event\"\n\n \n where created_on >= \n\n\n\n \n\n \n\n cast('2020-07-12' as date) + ((interval '1 day') * (-7))\n\n\n\n\n \n\n), campaign as (\n\n select *\n from \"postgres\".\"public_iterable_dev\".\"int_iterable__recurring_campaigns\"\n\n\n\n), event_extension as (\n\n select *\n from \"postgres\".\"public_iterable_dev\".\"stg_iterable__event_extension\"\n\n\n), users as (\n\n select *\n from \"postgres\".\"public_iterable_dev\".\"int_iterable__latest_user\"\n\n), message_type_channel as (\n\n select *\n from \"postgres\".\"public_iterable_dev\".\"int_iterable__message_type_channel\"\n\n), template as (\n\n select *\n from \"postgres\".\"public_iterable_dev\".\"int_iterable__latest_template\"\n\n), event_join as (\n\n select \n events.*,\n campaign.campaign_name,\n campaign.campaign_type,\n campaign.is_campaign_recurring,\n campaign.recurring_campaign_name,\n campaign.recurring_campaign_id,\n\n users.user_id,\n users.first_name || ' ' || users.last_name as user_full_name,\n\n message_type_channel.message_type_name,\n message_type_channel.message_medium,\n message_type_channel.channel_id,\n message_type_channel.channel_name,\n message_type_channel.channel_type\n\n \n \n , event_extension.\"is_app_already_running\",\n event_extension.\"badge\",\n event_extension.\"catalog_collection_count\",\n event_extension.\"catalog_lookup_count\",\n event_extension.\"canonical_url_id\",\n event_extension.\"is_content_available\",\n event_extension.\"device\",\n event_extension.\"email_id\",\n event_extension.\"email_subject\",\n event_extension.\"experiment_id\",\n event_extension.\"from_phone_number_id\",\n event_extension.\"from_smssender_id\",\n event_extension.\"link_id\",\n event_extension.\"link_url\",\n event_extension.\"locale\",\n event_extension.\"payload\",\n event_extension.\"platform_endpoint\",\n event_extension.\"push_message\",\n event_extension.\"region\",\n event_extension.\"sms_message\",\n event_extension.\"to_phone_number\",\n event_extension.\"url\",\n event_extension.\"workflow_id\",\n event_extension.\"workflow_name\",\n event_extension.\"city\",\n event_extension.\"clicked_url\",\n event_extension.\"country\",\n event_extension.\"error_code\",\n event_extension.\"expires_at\",\n event_extension.\"from_phone_number\",\n event_extension.\"in_app_body\",\n event_extension.\"is_sms_estimation\",\n event_extension.\"labels\",\n event_extension.\"message_status\",\n event_extension.\"mms_send_count\",\n event_extension.\"reason\",\n event_extension.\"sms_send_count\"\n \n\n ,\n campaign.template_id,\n template.template_name,\n template.creator_user_id as template_creator_user_id\n \n from events\n\n \n left join event_extension\n on events.unique_event_id = event_extension.unique_event_id\n and events.source_relation = event_extension.source_relation\n \n\n left join campaign\n on events.campaign_id = campaign.campaign_id\n and events.source_relation = campaign.source_relation\n left join users\n on events.unique_user_key = users.unique_user_key -- unique_user_key = _fivetran_user_id if exists, otherwise email\n and events.source_relation = users.source_relation\n left join message_type_channel\n on events.message_type_id = message_type_channel.message_type_id\n and events.source_relation = message_type_channel.source_relation\n left join template\n on campaign.template_id = template.template_id\n and events.source_relation = template.source_relation\n)\n\nselect *\nfrom event_join", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.iterable__user_campaign": {"database": "postgres", "schema": "public_iterable_dev", "name": "iterable__user_campaign", "resource_type": "model", "package_name": "iterable", "path": "iterable__user_campaign.sql", "original_file_path": "models/iterable__user_campaign.sql", "unique_id": "model.iterable.iterable__user_campaign", "fqn": ["iterable", "iterable__user_campaign"], "alias": "iterable__user_campaign", "checksum": {"name": "sha256", "checksum": "343ed0b8ab547da53812f4a8426cfd7b93f81ce3886680c4182a2596f1ea8632"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "table", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "Table that provides total and unique metrics for a user associated with particular campaigns and if available, experiments.", "columns": {"source_relation": {"name": "source_relation", "description": "Identifies the record's source.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": ["doc.iterable.source_relation"]}, "unique_user_campaign_id": {"name": "unique_user_campaign_id", "description": "Unique ID combining source_relation, unique_user_key, campaign_id, and if available, experiment_id.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "_fivetran_user_id": {"name": "_fivetran_user_id", "description": "A Fivetran-created unique identifier for the new Iterable schema in Aug 2023, for users, derived from hashing user_id and/or email, depending on project type.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_user_key": {"name": "unique_user_key", "description": "The unique identifier of the user. With the new schema (Aug 2023), it is the _fivetran_user_id. This is a hash of user_id and/or email, depending on project type. If using the old schema, it is email.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "user_id": {"name": "user_id", "description": "User identifier, for userID-based projects.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "user_email": {"name": "user_email", "description": "Email of the user if it exists.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "user_full_name": {"name": "user_full_name", "description": "The users first and last name", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "campaign_id": {"name": "campaign_id", "description": "The unique identifier of the campaign which the user metrics are associated", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "campaign_name": {"name": "campaign_name", "description": "The name of the campaign which the user metrics are associated", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "template_id": {"name": "template_id", "description": "The unique identifier of the template used within the campaign", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "template_name": {"name": "template_name", "description": "The name of the template used for the campaign", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "experiment_id": {"name": "experiment_id", "description": "The unique experiment variation of the campaign", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "recurring_campaign_id": {"name": "recurring_campaign_id", "description": "The unique identifier of the recurring campaign which the campaign is tied to", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "recurring_campaign_name": {"name": "recurring_campaign_name", "description": "The name of the recurring campaign which the campaign is tied to", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "first_event_at": {"name": "first_event_at", "description": "Timestamp of the first campaign/experiment event associated with the user", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "last_event_at": {"name": "last_event_at", "description": "Timestamp of the most recent campaign/experiment event associated with the user", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_emailclick": {"name": "total_emailclick", "description": "Total email clicks events the user took within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_emailunsubscribe": {"name": "total_emailunsubscribe", "description": "Total email unsubscription events the user performed within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_emailcomplaint": {"name": "total_emailcomplaint", "description": "Total email complaint events the user performed within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_customevent": {"name": "total_customevent", "description": "Total custom events associated with the user within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_emailsubscribe": {"name": "total_emailsubscribe", "description": "Total email subscription events associate with the user within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_emailopen": {"name": "total_emailopen", "description": "Total email open events the user performed within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_pushsend": {"name": "total_pushsend", "description": "Total push send events the user performed within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_smsbounce": {"name": "total_smsbounce", "description": "Total sms bounce events associated with the user within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_pushbounce": {"name": "total_pushbounce", "description": "Total push bounce events associated with the user within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_inappsendskip": {"name": "total_inappsendskip", "description": "Total in app send skip events the user performed within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_smssend": {"name": "total_smssend", "description": "Total sms send events associated with the user within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_inappsend": {"name": "total_inappsend", "description": "Total in app send events associated with the user within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_pushopen": {"name": "total_pushopen", "description": "Total push open events the user performed within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_emailsend": {"name": "total_emailsend", "description": "Total email send event associated with the user within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_pushsendskip": {"name": "total_pushsendskip", "description": "Total push send skip events associated with the user within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_inappopen": {"name": "total_inappopen", "description": "Total in app open events associated with the user within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_emailsendskip": {"name": "total_emailsendskip", "description": "Total email send skip events associated with the user within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_emailbounce": {"name": "total_emailbounce", "description": "Total email bounce events associated with the user within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_inappclick": {"name": "total_inappclick", "description": "Total in app click events associated with the user within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_pushuninstall": {"name": "total_pushuninstall", "description": "Total push uninstall events associated with the user within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "first_open_or_click_event_at": {"name": "first_open_or_click_event_at", "description": "The time of the first open or click time. This is the first time a user interacts with a campaign, recording the earliest occurring event out of 'emailOpen', 'emailClick', and 'pushOpen'.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "iterable://models/iterable.yml", "build_path": null, "unrendered_config": {"materialized": "table", "schema": "iterable_{{ var('directed_schema','dev') }}", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789419972.869712, "relation_name": "\"postgres\".\"public_iterable_dev\".\"iterable__user_campaign\"", "raw_code": "{% set using_event_extension = var('iterable__using_event_extension', True) %}\n\nwith events as (\n\n select *\n from {{ ref('iterable__events') }}\n\n), pivot_out_events as (\n\n-- this will be at the user-campaign-experiment variation level\n-- if experiment_id is null, the user-campaign interactions happened outside of an experiment\n-- if campaign_id is null, the user interactions are organic\n select\n source_relation,\n _fivetran_user_id,\n unique_user_key,\n user_id,\n campaign_id,\n\n {{ \"experiment_id,\" if using_event_extension }}\n\n email as user_email,\n user_full_name,\n case when campaign_id is null then 'organic' else campaign_name end as campaign_name,\n template_id,\n template_name,\n\n recurring_campaign_id,\n recurring_campaign_name,\n\n min(created_at) as first_event_at,\n max(created_at) as last_event_at,\n min(case when event_name in ('emailOpen', 'emailClick', 'pushOpen') then created_at end) as first_open_or_click_event_at\n\n\n -- count up the number of instances of each metric\n -- `iterable__event_metrics` is set by default to all events brought in by fivetran+iterable\n -- https://fivetran.com/docs/applications/iterable#schemanotes\n {% for em in var('iterable__event_metrics') %}\n , sum(case when lower(event_name) = '{{ em | lower }}' then 1 else 0 end)\n as {{ 'total_' ~ em | replace(' ', '_') | replace('(', '') | replace(')', '') | lower }}\n {% endfor %}\n\n from events\n\n {{ dbt_utils.group_by(n=13 if using_event_extension else 12 ) }}\n\n), add_surrogate_key as (\n\n {% set surrogate_key_fields = ['source_relation', 'unique_user_key', 'campaign_id'] %}\n {% do surrogate_key_fields.append('experiment_id') if var('iterable__using_event_extension', True) %}\n\n select \n *,\n {{ dbt_utils.generate_surrogate_key(surrogate_key_fields) }} as unique_user_campaign_id\n\n from pivot_out_events\n)\n\nselect *\nfrom add_surrogate_key", "doc_blocks": [], "language": "sql", "refs": [{"name": "iterable__events", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt_utils.group_by", "macro.dbt_utils.generate_surrogate_key"], "nodes": ["model.iterable.iterable__events"]}, "compiled_path": "target/compiled/iterable/models/iterable__user_campaign.sql", "compiled": true, "compiled_code": "\n\nwith events as (\n\n select *\n from \"postgres\".\"public_iterable_dev\".\"iterable__events\"\n\n), pivot_out_events as (\n\n-- this will be at the user-campaign-experiment variation level\n-- if experiment_id is null, the user-campaign interactions happened outside of an experiment\n-- if campaign_id is null, the user interactions are organic\n select\n source_relation,\n _fivetran_user_id,\n unique_user_key,\n user_id,\n campaign_id,\n\n experiment_id,\n\n email as user_email,\n user_full_name,\n case when campaign_id is null then 'organic' else campaign_name end as campaign_name,\n template_id,\n template_name,\n\n recurring_campaign_id,\n recurring_campaign_name,\n\n min(created_at) as first_event_at,\n max(created_at) as last_event_at,\n min(case when event_name in ('emailOpen', 'emailClick', 'pushOpen') then created_at end) as first_open_or_click_event_at\n\n\n -- count up the number of instances of each metric\n -- `iterable__event_metrics` is set by default to all events brought in by fivetran+iterable\n -- https://fivetran.com/docs/applications/iterable#schemanotes\n \n , sum(case when lower(event_name) = 'emailclick' then 1 else 0 end)\n as total_emailclick\n \n , sum(case when lower(event_name) = 'emailunsubscribe' then 1 else 0 end)\n as total_emailunsubscribe\n \n , sum(case when lower(event_name) = 'emailcomplaint' then 1 else 0 end)\n as total_emailcomplaint\n \n , sum(case when lower(event_name) = 'customevent' then 1 else 0 end)\n as total_customevent\n \n , sum(case when lower(event_name) = 'emailsubscribe' then 1 else 0 end)\n as total_emailsubscribe\n \n , sum(case when lower(event_name) = 'emailopen' then 1 else 0 end)\n as total_emailopen\n \n , sum(case when lower(event_name) = 'pushsend' then 1 else 0 end)\n as total_pushsend\n \n , sum(case when lower(event_name) = 'smsbounce' then 1 else 0 end)\n as total_smsbounce\n \n , sum(case when lower(event_name) = 'pushbounce' then 1 else 0 end)\n as total_pushbounce\n \n , sum(case when lower(event_name) = 'inappsendskip' then 1 else 0 end)\n as total_inappsendskip\n \n , sum(case when lower(event_name) = 'smssend' then 1 else 0 end)\n as total_smssend\n \n , sum(case when lower(event_name) = 'inappsend' then 1 else 0 end)\n as total_inappsend\n \n , sum(case when lower(event_name) = 'pushopen' then 1 else 0 end)\n as total_pushopen\n \n , sum(case when lower(event_name) = 'emailsend' then 1 else 0 end)\n as total_emailsend\n \n , sum(case when lower(event_name) = 'pushsendskip' then 1 else 0 end)\n as total_pushsendskip\n \n , sum(case when lower(event_name) = 'inappopen' then 1 else 0 end)\n as total_inappopen\n \n , sum(case when lower(event_name) = 'emailsendskip' then 1 else 0 end)\n as total_emailsendskip\n \n , sum(case when lower(event_name) = 'emailbounce' then 1 else 0 end)\n as total_emailbounce\n \n , sum(case when lower(event_name) = 'inappclick' then 1 else 0 end)\n as total_inappclick\n \n , sum(case when lower(event_name) = 'pushuninstall' then 1 else 0 end)\n as total_pushuninstall\n \n\n from events\n\n group by 1,2,3,4,5,6,7,8,9,10,11,12,13\n\n), add_surrogate_key as (\n\n \n \n\n select \n *,\n md5(cast(coalesce(cast(source_relation as TEXT), '_dbt_utils_surrogate_key_null_') || '-' || coalesce(cast(unique_user_key as TEXT), '_dbt_utils_surrogate_key_null_') || '-' || coalesce(cast(campaign_id as TEXT), '_dbt_utils_surrogate_key_null_') || '-' || coalesce(cast(experiment_id as TEXT), '_dbt_utils_surrogate_key_null_') as TEXT)) as unique_user_campaign_id\n\n from pivot_out_events\n)\n\nselect *\nfrom add_surrogate_key", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.iterable__user_unsubscriptions": {"database": "postgres", "schema": "public_iterable_dev", "name": "iterable__user_unsubscriptions", "resource_type": "model", "package_name": "iterable", "path": "iterable__user_unsubscriptions.sql", "original_file_path": "models/iterable__user_unsubscriptions.sql", "unique_id": "model.iterable.iterable__user_unsubscriptions", "fqn": ["iterable", "iterable__user_unsubscriptions"], "alias": "iterable__user_unsubscriptions", "checksum": {"name": "sha256", "checksum": "9ffdcfb7996a2147cd7739fc5ac7a1bd2e0db91e0ffc76d1458f53046fc4598f"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "table", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "Table that generates the total channel and message types a user has chosen to unsubscribe.", "columns": {"source_relation": {"name": "source_relation", "description": "Identifies the record's source.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": ["doc.iterable.source_relation"]}, "_fivetran_user_id": {"name": "_fivetran_user_id", "description": "A Fivetran-created unique identifier for the new Iterable schema in Aug 2023, for users, derived from hashing user_id and/or email, depending on project type.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_user_key": {"name": "unique_user_key", "description": "The unique identifier of the user. With the new schema (Aug 2023), it is the _fivetran_user_id. This is a hash of user_id and/or email, depending on project type. If using the old schema, it is email.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "channel_id": {"name": "channel_id", "description": "Unique identifier of the channel which the user is unsubscribed", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "message_type_id": {"name": "message_type_id", "description": "Unique identifier of the message type which the user is unsubscribed", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "channel_name": {"name": "channel_name", "description": "The name of the channel which the user is unsubscribed", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "message_type_name": {"name": "message_type_name", "description": "The name of the message type which the user is unsubscribed", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "channel_type": {"name": "channel_type", "description": "The channel type which the user is unsubscribed", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "message_medium": {"name": "message_medium", "description": "The medium type the message was provided which the user is unsubscribed", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "updated_at": {"name": "updated_at", "description": "Timestamp of when the user unsubscribed from the channel or message type", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "is_unsubscribed_channel_wide": {"name": "is_unsubscribed_channel_wide", "description": "Boolean indicating if the user unsubscribed at the channel level (i.e. unsubscribed to all message types) or if they unsubscribed from only an individual message type.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "iterable://models/iterable.yml", "build_path": null, "unrendered_config": {"materialized": "table", "schema": "iterable_{{ var('directed_schema','dev') }}", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789419972.8711505, "relation_name": "\"postgres\".\"public_iterable_dev\".\"iterable__user_unsubscriptions\"", "raw_code": "{% set using_user_unsubscribed_message_type = var('iterable__using_user_unsubscribed_message_type', True) %}\n\nwith message_type_channel as (\n\n select *\n from {{ ref('int_iterable__message_type_channel') }}\n\n), user_unsubscribed_channel as (\n\n select\n *\n from {{ ref('stg_iterable__user_unsubscribed_channel') }}\n where latest_batch_index = 1\n\n{% if using_user_unsubscribed_message_type %}\n), user_unsubscribed_message_type as (\n\n select\n *\n from {{ ref('stg_iterable__user_unsub_message_type') }}\n where latest_batch_index = 1\n\n{% endif %}\n\n), combine as (\n\n select\n source_relation,\n _fivetran_user_id,\n unique_user_key,\n channel_id,\n cast(null as {{ dbt.type_string() }}) as message_type_id,\n updated_at\n from user_unsubscribed_channel\n\n{% if using_user_unsubscribed_message_type %}\n\n union all\n\n select\n source_relation,\n _fivetran_user_id,\n unique_user_key,\n cast(null as {{ dbt.type_string() }}) as channel_id,\n message_type_id,\n updated_at\n from user_unsubscribed_message_type\n{% endif %}\n\n), final as (\n\n select\n combine.source_relation,\n combine._fivetran_user_id,\n combine.unique_user_key,\n -- coalescing since message_type -> channel goes up a grain\n coalesce(combine.channel_id, message_type_channel.channel_id) as channel_id,\n coalesce(combine.message_type_id, message_type_channel.message_type_id) as message_type_id,\n combine.updated_at,\n message_type_channel.channel_name,\n message_type_channel.message_type_name,\n message_type_channel.channel_type,\n message_type_channel.message_medium,\n case when combine.channel_id is not null then true else false end as is_unsubscribed_channel_wide\n\n from combine\n\n -- unsubscribing from an entire channel unsubscribes a user from all message types in that channel\n join message_type_channel\n on combine.source_relation = message_type_channel.source_relation\n and (combine.channel_id = message_type_channel.channel_id\n or combine.message_type_id = message_type_channel.message_type_id)\n)\n\nselect *\nfrom final", "doc_blocks": [], "language": "sql", "refs": [{"name": "int_iterable__message_type_channel", "package": null, "version": null}, {"name": "stg_iterable__user_unsubscribed_channel", "package": null, "version": null}, {"name": "stg_iterable__user_unsub_message_type", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.type_string"], "nodes": ["model.iterable.int_iterable__message_type_channel", "model.iterable.stg_iterable__user_unsubscribed_channel", "model.iterable.stg_iterable__user_unsub_message_type"]}, "compiled_path": "target/compiled/iterable/models/iterable__user_unsubscriptions.sql", "compiled": true, "compiled_code": "\n\nwith message_type_channel as (\n\n select *\n from \"postgres\".\"public_iterable_dev\".\"int_iterable__message_type_channel\"\n\n), user_unsubscribed_channel as (\n\n select\n *\n from \"postgres\".\"public_iterable_dev\".\"stg_iterable__user_unsubscribed_channel\"\n where latest_batch_index = 1\n\n\n), user_unsubscribed_message_type as (\n\n select\n *\n from \"postgres\".\"public_iterable_dev\".\"stg_iterable__user_unsub_message_type\"\n where latest_batch_index = 1\n\n\n\n), combine as (\n\n select\n source_relation,\n _fivetran_user_id,\n unique_user_key,\n channel_id,\n cast(null as TEXT) as message_type_id,\n updated_at\n from user_unsubscribed_channel\n\n\n\n union all\n\n select\n source_relation,\n _fivetran_user_id,\n unique_user_key,\n cast(null as TEXT) as channel_id,\n message_type_id,\n updated_at\n from user_unsubscribed_message_type\n\n\n), final as (\n\n select\n combine.source_relation,\n combine._fivetran_user_id,\n combine.unique_user_key,\n -- coalescing since message_type -> channel goes up a grain\n coalesce(combine.channel_id, message_type_channel.channel_id) as channel_id,\n coalesce(combine.message_type_id, message_type_channel.message_type_id) as message_type_id,\n combine.updated_at,\n message_type_channel.channel_name,\n message_type_channel.message_type_name,\n message_type_channel.channel_type,\n message_type_channel.message_medium,\n case when combine.channel_id is not null then true else false end as is_unsubscribed_channel_wide\n\n from combine\n\n -- unsubscribing from an entire channel unsubscribes a user from all message types in that channel\n join message_type_channel\n on combine.source_relation = message_type_channel.source_relation\n and (combine.channel_id = message_type_channel.channel_id\n or combine.message_type_id = message_type_channel.message_type_id)\n)\n\nselect *\nfrom final", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.iterable__journeys": {"database": "postgres", "schema": "public_iterable_dev", "name": "iterable__journeys", "resource_type": "model", "package_name": "iterable", "path": "iterable__journeys.sql", "original_file_path": "models/iterable__journeys.sql", "unique_id": "model.iterable.iterable__journeys", "fqn": ["iterable", "iterable__journeys"], "alias": "iterable__journeys", "checksum": {"name": "sha256", "checksum": "cc93337c06625ef9675afae4540f52c2cb0cb78669a9a881f650742e8679380b"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "table", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "Table that provides aggregations for journeys, formerly known as workflows. Metrics are rolled up from the user/campaign grain via each campaign's journey reference. Journeys which generate no events, such as those that only split audiences or update user fields, are still included with null metrics. The grain of this table is one record per journey.\n", "columns": {"source_relation": {"name": "source_relation", "description": "Identifies the record's source.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": ["doc.iterable.source_relation"]}, "journey_id": {"name": "journey_id", "description": "Unique identifier of the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_journey_id": {"name": "unique_journey_id", "description": "Unique identifier combining journey_id and source_relation.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "journey_name": {"name": "journey_name", "description": "User defined name of the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "journey_type": {"name": "journey_type", "description": "The journey type", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "journey_description": {"name": "journey_description", "description": "Information about the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "creator_user_id": {"name": "creator_user_id", "description": "Reference to the user who created the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "is_enabled": {"name": "is_enabled", "description": "Boolean indicating if the journey is currently enabled", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "is_archived": {"name": "is_archived", "description": "Boolean indicating if the journey has been archived", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "lifetime_limit": {"name": "lifetime_limit", "description": "Maximum number of times a user may enter the journey over their lifetime", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "simultaneous_limit": {"name": "simultaneous_limit", "description": "Maximum number of times a user may be in the journey at the same time", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "start_tile_id": {"name": "start_tile_id", "description": "Reference to the tile which begins the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "trigger_event_names": {"name": "trigger_event_names", "description": "The event names which trigger a user's entry into the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "created_at": {"name": "created_at", "description": "Creation timestamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "updated_at": {"name": "updated_at", "description": "Last update timestamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "The time when a record was last updated by Fivetran.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": ["doc.iterable._fivetran_synced"]}, "count_total_campaigns": {"name": "count_total_campaigns", "description": "Count of distinct campaigns within the journey that generated events", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "count_unique_users": {"name": "count_unique_users", "description": "Count of total unique users within the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "first_event_at": {"name": "first_event_at", "description": "Timestamp of the first event generated by any campaign in the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "last_event_at": {"name": "last_event_at", "description": "Timestamp of the most recent event generated by any campaign in the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_emailclick": {"name": "total_emailclick", "description": "Total email clicks within the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_total_emailclick": {"name": "unique_total_emailclick", "description": "Count of distinct users with email clicks within the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_emailunsubscribe": {"name": "total_emailunsubscribe", "description": "Total email unsubscribe events within the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_total_emailunsubscribe": {"name": "unique_total_emailunsubscribe", "description": "Count of distinct users with email unsubscribe events within the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_emailcomplaint": {"name": "total_emailcomplaint", "description": "Total email complaints within the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_total_emailcomplaint": {"name": "unique_total_emailcomplaint", "description": "Count of distinct users with email complaints within the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_customevent": {"name": "total_customevent", "description": "Total custom events within the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_total_customevent": {"name": "unique_total_customevent", "description": "Count of distinct users with custom events within the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_emailsubscribe": {"name": "total_emailsubscribe", "description": "Total email subscribe events within the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_total_emailsubscribe": {"name": "unique_total_emailsubscribe", "description": "Count of distinct users with email subscribe events within the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_emailopen": {"name": "total_emailopen", "description": "Total email open events within the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_total_emailopen": {"name": "unique_total_emailopen", "description": "Count of distinct users with email open events within the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_pushsend": {"name": "total_pushsend", "description": "Total push send events within the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_total_pushsend": {"name": "unique_total_pushsend", "description": "Count of distinct users with push send events within the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_smsbounce": {"name": "total_smsbounce", "description": "Total sms bounce events within the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_total_smsbounce": {"name": "unique_total_smsbounce", "description": "Count of distinct users with sms bounce events within the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_pushbounce": {"name": "total_pushbounce", "description": "Total push bounce events within the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_total_pushbounce": {"name": "unique_total_pushbounce", "description": "Count of distinct users with push bounce events within the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_inappsendskip": {"name": "total_inappsendskip", "description": "Total in app send skip events within the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_total_inappsendskip": {"name": "unique_total_inappsendskip", "description": "Count of distinct users with in app send skip events within the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_smssend": {"name": "total_smssend", "description": "Total sms send events within the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_total_smssend": {"name": "unique_total_smssend", "description": "Count of distinct users with sms send events within the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_inappsend": {"name": "total_inappsend", "description": "Total in app send events within the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_total_inappsend": {"name": "unique_total_inappsend", "description": "Count of distinct users with in app send events within the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_pushopen": {"name": "total_pushopen", "description": "Total push open events within the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_total_pushopen": {"name": "unique_total_pushopen", "description": "Count of distinct users with push open events within the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_emailsend": {"name": "total_emailsend", "description": "Total email send events within the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_total_emailsend": {"name": "unique_total_emailsend", "description": "Count of distinct users with email send events within the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_pushsendskip": {"name": "total_pushsendskip", "description": "Total push send skip events within the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_total_pushsendskip": {"name": "unique_total_pushsendskip", "description": "Count of distinct users with push send skip events within the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_inappopen": {"name": "total_inappopen", "description": "Total in app open events within the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_total_inappopen": {"name": "unique_total_inappopen", "description": "Count of distinct users with in app open events within the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_emailsendskip": {"name": "total_emailsendskip", "description": "Total email send skip events within the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_total_emailsendskip": {"name": "unique_total_emailsendskip", "description": "Count of distinct users with email send skip events within the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_emailbounce": {"name": "total_emailbounce", "description": "Total email bounce events within the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_total_emailbounce": {"name": "unique_total_emailbounce", "description": "Count of distinct users with email bounce events within the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_inappclick": {"name": "total_inappclick", "description": "Total in app click events within the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_total_inappclick": {"name": "unique_total_inappclick", "description": "Count of distinct users with in app click events within the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_pushuninstall": {"name": "total_pushuninstall", "description": "Total push uninstall events within the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_total_pushuninstall": {"name": "unique_total_pushuninstall", "description": "Count of distinct users with push uninstall events within the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "iterable://models/iterable.yml", "build_path": null, "unrendered_config": {"materialized": "table", "schema": "iterable_{{ var('directed_schema','dev') }}", "enabled": "var('iterable__using_journey', True)", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789419972.8623235, "relation_name": "\"postgres\".\"public_iterable_dev\".\"iterable__journeys\"", "raw_code": "{{ config(enabled=var('iterable__using_journey', True)) }}\n\nwith journey as (\n\n select *\n from {{ ref('stg_iterable__journey') }}\n\n), journey_metrics as (\n\n select *\n from {{ ref('int_iterable__journey_event_metrics') }}\n\n), journey_join as (\n\n {% set exclude_fields = ['source_relation', 'journey_id'] %} -- these are in journey\n\n -- left join so journeys that generate no events, such as audience-splitting or\n -- field-update journeys, are still reported with null metrics\n select\n journey.*,\n {{ dbt_utils.star(from=ref('int_iterable__journey_event_metrics'), except=exclude_fields, relation_alias=\"journey_metrics\") }}\n\n from journey\n\n left join journey_metrics\n on journey.journey_id = journey_metrics.journey_id\n and journey.source_relation = journey_metrics.source_relation\n\n), add_surrogate_key as (\n\n {% set surrogate_key_fields = ['journey_id', 'source_relation'] %}\n\n select\n *,\n {{ dbt_utils.generate_surrogate_key(surrogate_key_fields) }} as unique_journey_id\n\n from journey_join\n)\n\nselect *\nfrom add_surrogate_key", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__journey", "package": null, "version": null}, {"name": "int_iterable__journey_event_metrics", "package": null, "version": null}, {"name": "int_iterable__journey_event_metrics", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt_utils.star", "macro.dbt_utils.generate_surrogate_key"], "nodes": ["model.iterable.stg_iterable__journey", "model.iterable.int_iterable__journey_event_metrics"]}, "compiled_path": "target/compiled/iterable/models/iterable__journeys.sql", "compiled": true, "compiled_code": "\n\nwith journey as (\n\n select *\n from \"postgres\".\"public_iterable_dev\".\"stg_iterable__journey\"\n\n), journey_metrics as (\n\n select *\n from \"postgres\".\"public_iterable_dev\".\"int_iterable__journey_event_metrics\"\n\n), journey_join as (\n\n -- these are in journey\n\n -- left join so journeys that generate no events, such as audience-splitting or\n -- field-update journeys, are still reported with null metrics\n select\n journey.*,\n journey_metrics.\"count_total_campaigns\",\n journey_metrics.\"count_unique_users\",\n journey_metrics.\"first_event_at\",\n journey_metrics.\"last_event_at\",\n journey_metrics.\"total_emailclick\",\n journey_metrics.\"unique_total_emailclick\",\n journey_metrics.\"total_emailunsubscribe\",\n journey_metrics.\"unique_total_emailunsubscribe\",\n journey_metrics.\"total_emailcomplaint\",\n journey_metrics.\"unique_total_emailcomplaint\",\n journey_metrics.\"total_customevent\",\n journey_metrics.\"unique_total_customevent\",\n journey_metrics.\"total_emailsubscribe\",\n journey_metrics.\"unique_total_emailsubscribe\",\n journey_metrics.\"total_emailopen\",\n journey_metrics.\"unique_total_emailopen\",\n journey_metrics.\"total_pushsend\",\n journey_metrics.\"unique_total_pushsend\",\n journey_metrics.\"total_smsbounce\",\n journey_metrics.\"unique_total_smsbounce\",\n journey_metrics.\"total_pushbounce\",\n journey_metrics.\"unique_total_pushbounce\",\n journey_metrics.\"total_inappsendskip\",\n journey_metrics.\"unique_total_inappsendskip\",\n journey_metrics.\"total_smssend\",\n journey_metrics.\"unique_total_smssend\",\n journey_metrics.\"total_inappsend\",\n journey_metrics.\"unique_total_inappsend\",\n journey_metrics.\"total_pushopen\",\n journey_metrics.\"unique_total_pushopen\",\n journey_metrics.\"total_emailsend\",\n journey_metrics.\"unique_total_emailsend\",\n journey_metrics.\"total_pushsendskip\",\n journey_metrics.\"unique_total_pushsendskip\",\n journey_metrics.\"total_inappopen\",\n journey_metrics.\"unique_total_inappopen\",\n journey_metrics.\"total_emailsendskip\",\n journey_metrics.\"unique_total_emailsendskip\",\n journey_metrics.\"total_emailbounce\",\n journey_metrics.\"unique_total_emailbounce\",\n journey_metrics.\"total_inappclick\",\n journey_metrics.\"unique_total_inappclick\",\n journey_metrics.\"total_pushuninstall\",\n journey_metrics.\"unique_total_pushuninstall\"\n\n from journey\n\n left join journey_metrics\n on journey.journey_id = journey_metrics.journey_id\n and journey.source_relation = journey_metrics.source_relation\n\n), add_surrogate_key as (\n\n \n\n select\n *,\n md5(cast(coalesce(cast(journey_id as TEXT), '_dbt_utils_surrogate_key_null_') || '-' || coalesce(cast(source_relation as TEXT), '_dbt_utils_surrogate_key_null_') as TEXT)) as unique_journey_id\n\n from journey_join\n)\n\nselect *\nfrom add_surrogate_key", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": ["unique_journey_id"], "time_spine": null}, "model.iterable.iterable__campaigns": {"database": "postgres", "schema": "public_iterable_dev", "name": "iterable__campaigns", "resource_type": "model", "package_name": "iterable", "path": "iterable__campaigns.sql", "original_file_path": "models/iterable__campaigns.sql", "unique_id": "model.iterable.iterable__campaigns", "fqn": ["iterable", "iterable__campaigns"], "alias": "iterable__campaigns", "checksum": {"name": "sha256", "checksum": "8a06f641cc3e4a6fcf53c1ff0571db0c9b0e7212a2a2ff5ea9111e035a96b0cc"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "table", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "Table that provides aggregations for campaigns at the template and if available, the experiment grain.", "columns": {"source_relation": {"name": "source_relation", "description": "Identifies the record's source.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": ["doc.iterable.source_relation"]}, "campaign_id": {"name": "campaign_id", "description": "Unique identifier of the campaign record", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_campaign_version_id": {"name": "unique_campaign_version_id", "description": "Unique identifier combining campaign_id, template_id, source_relation, and if available, experiment_id.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "campaign_name": {"name": "campaign_name", "description": "User defined name of the campaign.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "updated_at": {"name": "updated_at", "description": "Last update timestamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "campaign_state": {"name": "campaign_state", "description": "State of the campaign. Can be Draft, Ready, Scheduled, Running, Finished, Starting, Aborted or Recurring", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "campaign_type": {"name": "campaign_type", "description": "The campaign type. Can be Blast or Triggered", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "send_size": {"name": "send_size", "description": "Size of the campaign. Number of individuals included in the campaign", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "start_at": {"name": "start_at", "description": "Start timestamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "ended_at": {"name": "ended_at", "description": "Ended timestamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "created_at": {"name": "created_at", "description": "Creation timestamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "created_by_user_id": {"name": "created_by_user_id", "description": "Reference to the user who created the campaign", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "template_id": {"name": "template_id", "description": "Reference to the campaign template", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "recurring_campaign_id": {"name": "recurring_campaign_id", "description": "Unique identifier of the recurring campaign (if applicable)", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "recurring_campaign_name": {"name": "recurring_campaign_name", "description": "Name of the recurring campaign (if applicable)", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "recurring_campaign_state": {"name": "recurring_campaign_state", "description": "State of the recurring campaign (if applicable)", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "recurring_campaign_send_size": {"name": "recurring_campaign_send_size", "description": "Size of the recurring campaign. Number of individuals included in the recurring campaign (if applicable)", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "recurring_campaign_start_at": {"name": "recurring_campaign_start_at", "description": "Timestamp of when the recurring campaign started (if applicable)", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "is_campaign_recurring": {"name": "is_campaign_recurring", "description": "Boolean indicating if the campaign is a recurring campaign", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "experiment_id": {"name": "experiment_id", "description": "Reference to the experiment used if the event is an experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "count_unique_users": {"name": "count_unique_users", "description": "Count of total unique users within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_emailclick": {"name": "total_emailclick", "description": "Total email clicks within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_total_emailclick": {"name": "unique_total_emailclick", "description": "Unique email clicks within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_emailunsubscribe": {"name": "total_emailunsubscribe", "description": "Total email unsubscribe events within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_total_emailunsubscribe": {"name": "unique_total_emailunsubscribe", "description": "Unique total email unsubscribe events within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_emailcomplaint": {"name": "total_emailcomplaint", "description": "Total email complaints within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_total_emailcomplaint": {"name": "unique_total_emailcomplaint", "description": "Unique total email complaints within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_customevent": {"name": "total_customevent", "description": "Total custom events within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_total_customevent": {"name": "unique_total_customevent", "description": "Unique total custom events within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_emailsubscribe": {"name": "total_emailsubscribe", "description": "Total email subscribe events within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_total_emailsubscribe": {"name": "unique_total_emailsubscribe", "description": "Unique total email subscribe events within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_emailopen": {"name": "total_emailopen", "description": "Total email open events within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_total_emailopen": {"name": "unique_total_emailopen", "description": "Unique total email open events within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_pushsend": {"name": "total_pushsend", "description": "Total push send event within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_total_pushsend": {"name": "unique_total_pushsend", "description": "Unique total push send events within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_smsbounce": {"name": "total_smsbounce", "description": "Total sms bounce events within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_total_smsbounce": {"name": "unique_total_smsbounce", "description": "Unique total sms bounce events within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_pushbounce": {"name": "total_pushbounce", "description": "Total push bounce events within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_total_pushbounce": {"name": "unique_total_pushbounce", "description": "Unique total push bounce events within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_inappsendskip": {"name": "total_inappsendskip", "description": "Total in app send skip events within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_total_inappsendskip": {"name": "unique_total_inappsendskip", "description": "Unique total in app send skip events within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_smssend": {"name": "total_smssend", "description": "Total sms send events within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_total_smssend": {"name": "unique_total_smssend", "description": "Unique total sms send events within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_inappsend": {"name": "total_inappsend", "description": "Total in app send events within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_total_inappsend": {"name": "unique_total_inappsend", "description": "Unique total in app send events within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_pushopen": {"name": "total_pushopen", "description": "Total push open events within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_total_pushopen": {"name": "unique_total_pushopen", "description": "Unique total push open events within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_emailsend": {"name": "total_emailsend", "description": "Total email send events within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_total_emailsend": {"name": "unique_total_emailsend", "description": "Unique total email send events within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_pushsendskip": {"name": "total_pushsendskip", "description": "Total push send skip events within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_total_pushsendskip": {"name": "unique_total_pushsendskip", "description": "Unique total push send skip events within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_inappopen": {"name": "total_inappopen", "description": "Total in app open events within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_total_inappopen": {"name": "unique_total_inappopen", "description": "Unique total in app open events within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_emailsendskip": {"name": "total_emailsendskip", "description": "Total email send skip events within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_total_emailsendskip": {"name": "unique_total_emailsendskip", "description": "Unique total email send skip events within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_emailbounce": {"name": "total_emailbounce", "description": "Total email bounce events within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_total_emailbounce": {"name": "unique_total_emailbounce", "description": "Unique total email bounce events within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_inappclick": {"name": "total_inappclick", "description": "Total in app click events within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_total_inappclick": {"name": "unique_total_inappclick", "description": "Unique total in app click events within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_pushuninstall": {"name": "total_pushuninstall", "description": "Total push uninstall events within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_total_pushuninstall": {"name": "unique_total_pushuninstall", "description": "Unique total push uninstall events within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "count_send_lists": {"name": "count_send_lists", "description": "Count of send lists within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "count_suppress_lists": {"name": "count_suppress_lists", "description": "Count of suppress lists within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "labels": {"name": "labels", "description": "List of labels associated with the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "journey_id": {"name": "journey_id", "description": "Reference to the journey the campaign belongs to, if applicable", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "journey_name": {"name": "journey_name", "description": "User defined name of the journey the campaign belongs to, if applicable", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "journey_type": {"name": "journey_type", "description": "The type of the journey the campaign belongs to, if applicable", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "template_name": {"name": "template_name", "description": "Name of the template associated with the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "template_creator_user_id": {"name": "template_creator_user_id", "description": "The creator user id of the template associated with the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "message_medium": {"name": "message_medium", "description": "The medium which the message was provided", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "message_type_name": {"name": "message_type_name", "description": "The message type name associated with the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "channel_name": {"name": "channel_name", "description": "The channel name associated with the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "channel_id": {"name": "channel_id", "description": "The channel identifier associated with the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "channel_type": {"name": "channel_type", "description": "The channel type associated with the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "iterable://models/iterable.yml", "build_path": null, "unrendered_config": {"materialized": "table", "schema": "iterable_{{ var('directed_schema','dev') }}", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789419972.834093, "relation_name": "\"postgres\".\"public_iterable_dev\".\"iterable__campaigns\"", "raw_code": "with campaign_event_metrics as (\n\n select *\n from {{ ref('int_iterable__campaign_event_metrics') }}\n\n), campaign_list_metrics as (\n\n select\n source_relation,\n campaign_id,\n sum(case when list_activity = 'send' then 1 else 0 end) as count_send_lists,\n sum(case when list_activity = 'suppress' then 1 else 0 end) as count_suppress_lists\n\n from {{ ref('int_iterable__campaign_lists') }}\n {{ dbt_utils.group_by(n=2) }}\n\n), campaign as (\n\n select *\n from {{ ref('int_iterable__recurring_campaigns') }}\n \n{% if var('iterable__using_campaign_label_history', true) %}\n), campaign_labels as (\n\n select *\n from {{ ref('int_iterable__campaign_labels') }}\n\n{% endif %}\n\n), template as (\n -- rebringing this in (it is brought in iterable__events) in case any campaigns don't have events yet\n -- this will result in some DAG ugliness but maintains template info for non-sent campaigns\n select *\n from {{ ref('int_iterable__latest_template') }}\n\n{% if var('iterable__using_journey', true) %}\n), journey as (\n\n select *\n from {{ ref('stg_iterable__journey') }}\n\n{% endif %}\n\n), campaign_join as (\n\n {% set exclude_fields = ['source_relation', 'campaign_id', 'template_id'] %} -- these are in campaigns\n\n -- this query will be at the campaign and experiment(if available) variation grain\n select\n campaign.*,\n {{ dbt_utils.star(from=ref('int_iterable__campaign_event_metrics'), except=exclude_fields, relation_alias=\"campaign_event_metrics\") }}\n , \n campaign_list_metrics.count_send_lists,\n campaign_list_metrics.count_suppress_lists,\n {% if var('iterable__using_campaign_label_history', true) %}\n campaign_labels.labels,\n {% endif %}\n {% if var('iterable__using_journey', true) %}\n journey.journey_name,\n journey.journey_type,\n {% endif %}\n template.template_name,\n template.creator_user_id as template_creator_user_id,\n template.message_medium,\n template.message_type_name,\n template.channel_name,\n template.channel_id,\n template.channel_type\n\n from campaign\n left join campaign_event_metrics\n on campaign.campaign_id = campaign_event_metrics.campaign_id\n and campaign.template_id = campaign_event_metrics.template_id\n and campaign.source_relation = campaign_event_metrics.source_relation\n left join campaign_list_metrics\n on campaign.campaign_id = campaign_list_metrics.campaign_id\n and campaign.source_relation = campaign_list_metrics.source_relation\n\n {% if var('iterable__using_campaign_label_history', true) %}\n left join campaign_labels\n on campaign.campaign_id = campaign_labels.campaign_id\n and campaign.source_relation = campaign_labels.source_relation\n {% endif %}\n\n left join template\n on campaign.template_id = template.template_id\n and campaign.source_relation = template.source_relation\n\n {% if var('iterable__using_journey', true) %}\n left join journey\n on campaign.journey_id = journey.journey_id\n and campaign.source_relation = journey.source_relation\n {% endif %}\n\n), add_surrogate_key as (\n\n {% set surrogate_key_fields = ['campaign_id', 'template_id', 'source_relation'] %}\n {% do surrogate_key_fields.append('experiment_id') if var('iterable__using_event_extension', True) %}\n\n select \n *,\n {{ dbt_utils.generate_surrogate_key(surrogate_key_fields) }} as unique_campaign_version_id\n\n from campaign_join\n)\n\nselect *\nfrom add_surrogate_key", "doc_blocks": [], "language": "sql", "refs": [{"name": "int_iterable__campaign_event_metrics", "package": null, "version": null}, {"name": "int_iterable__campaign_lists", "package": null, "version": null}, {"name": "int_iterable__recurring_campaigns", "package": null, "version": null}, {"name": "int_iterable__campaign_labels", "package": null, "version": null}, {"name": "int_iterable__latest_template", "package": null, "version": null}, {"name": "stg_iterable__journey", "package": null, "version": null}, {"name": "int_iterable__campaign_event_metrics", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt_utils.group_by", "macro.dbt_utils.star", "macro.dbt_utils.generate_surrogate_key"], "nodes": ["model.iterable.int_iterable__campaign_event_metrics", "model.iterable.int_iterable__campaign_lists", "model.iterable.int_iterable__recurring_campaigns", "model.iterable.int_iterable__campaign_labels", "model.iterable.int_iterable__latest_template", "model.iterable.stg_iterable__journey"]}, "compiled_path": "target/compiled/iterable/models/iterable__campaigns.sql", "compiled": true, "compiled_code": "with campaign_event_metrics as (\n\n select *\n from \"postgres\".\"public_iterable_dev\".\"int_iterable__campaign_event_metrics\"\n\n), campaign_list_metrics as (\n\n select\n source_relation,\n campaign_id,\n sum(case when list_activity = 'send' then 1 else 0 end) as count_send_lists,\n sum(case when list_activity = 'suppress' then 1 else 0 end) as count_suppress_lists\n\n from \"postgres\".\"public_iterable_dev\".\"int_iterable__campaign_lists\"\n group by 1,2\n\n), campaign as (\n\n select *\n from \"postgres\".\"public_iterable_dev\".\"int_iterable__recurring_campaigns\"\n \n\n), campaign_labels as (\n\n select *\n from \"postgres\".\"public_iterable_dev\".\"int_iterable__campaign_labels\"\n\n\n\n), template as (\n -- rebringing this in (it is brought in iterable__events) in case any campaigns don't have events yet\n -- this will result in some DAG ugliness but maintains template info for non-sent campaigns\n select *\n from \"postgres\".\"public_iterable_dev\".\"int_iterable__latest_template\"\n\n\n), journey as (\n\n select *\n from \"postgres\".\"public_iterable_dev\".\"stg_iterable__journey\"\n\n\n\n), campaign_join as (\n\n -- these are in campaigns\n\n -- this query will be at the campaign and experiment(if available) variation grain\n select\n campaign.*,\n campaign_event_metrics.\"experiment_id\",\n campaign_event_metrics.\"count_unique_users\",\n campaign_event_metrics.\"total_emailclick\",\n campaign_event_metrics.\"unique_total_emailclick\",\n campaign_event_metrics.\"total_emailunsubscribe\",\n campaign_event_metrics.\"unique_total_emailunsubscribe\",\n campaign_event_metrics.\"total_emailcomplaint\",\n campaign_event_metrics.\"unique_total_emailcomplaint\",\n campaign_event_metrics.\"total_customevent\",\n campaign_event_metrics.\"unique_total_customevent\",\n campaign_event_metrics.\"total_emailsubscribe\",\n campaign_event_metrics.\"unique_total_emailsubscribe\",\n campaign_event_metrics.\"total_emailopen\",\n campaign_event_metrics.\"unique_total_emailopen\",\n campaign_event_metrics.\"total_pushsend\",\n campaign_event_metrics.\"unique_total_pushsend\",\n campaign_event_metrics.\"total_smsbounce\",\n campaign_event_metrics.\"unique_total_smsbounce\",\n campaign_event_metrics.\"total_pushbounce\",\n campaign_event_metrics.\"unique_total_pushbounce\",\n campaign_event_metrics.\"total_inappsendskip\",\n campaign_event_metrics.\"unique_total_inappsendskip\",\n campaign_event_metrics.\"total_smssend\",\n campaign_event_metrics.\"unique_total_smssend\",\n campaign_event_metrics.\"total_inappsend\",\n campaign_event_metrics.\"unique_total_inappsend\",\n campaign_event_metrics.\"total_pushopen\",\n campaign_event_metrics.\"unique_total_pushopen\",\n campaign_event_metrics.\"total_emailsend\",\n campaign_event_metrics.\"unique_total_emailsend\",\n campaign_event_metrics.\"total_pushsendskip\",\n campaign_event_metrics.\"unique_total_pushsendskip\",\n campaign_event_metrics.\"total_inappopen\",\n campaign_event_metrics.\"unique_total_inappopen\",\n campaign_event_metrics.\"total_emailsendskip\",\n campaign_event_metrics.\"unique_total_emailsendskip\",\n campaign_event_metrics.\"total_emailbounce\",\n campaign_event_metrics.\"unique_total_emailbounce\",\n campaign_event_metrics.\"total_inappclick\",\n campaign_event_metrics.\"unique_total_inappclick\",\n campaign_event_metrics.\"total_pushuninstall\",\n campaign_event_metrics.\"unique_total_pushuninstall\"\n , \n campaign_list_metrics.count_send_lists,\n campaign_list_metrics.count_suppress_lists,\n \n campaign_labels.labels,\n \n \n journey.journey_name,\n journey.journey_type,\n \n template.template_name,\n template.creator_user_id as template_creator_user_id,\n template.message_medium,\n template.message_type_name,\n template.channel_name,\n template.channel_id,\n template.channel_type\n\n from campaign\n left join campaign_event_metrics\n on campaign.campaign_id = campaign_event_metrics.campaign_id\n and campaign.template_id = campaign_event_metrics.template_id\n and campaign.source_relation = campaign_event_metrics.source_relation\n left join campaign_list_metrics\n on campaign.campaign_id = campaign_list_metrics.campaign_id\n and campaign.source_relation = campaign_list_metrics.source_relation\n\n \n left join campaign_labels\n on campaign.campaign_id = campaign_labels.campaign_id\n and campaign.source_relation = campaign_labels.source_relation\n \n\n left join template\n on campaign.template_id = template.template_id\n and campaign.source_relation = template.source_relation\n\n \n left join journey\n on campaign.journey_id = journey.journey_id\n and campaign.source_relation = journey.source_relation\n \n\n), add_surrogate_key as (\n\n \n \n\n select \n *,\n md5(cast(coalesce(cast(campaign_id as TEXT), '_dbt_utils_surrogate_key_null_') || '-' || coalesce(cast(template_id as TEXT), '_dbt_utils_surrogate_key_null_') || '-' || coalesce(cast(source_relation as TEXT), '_dbt_utils_surrogate_key_null_') || '-' || coalesce(cast(experiment_id as TEXT), '_dbt_utils_surrogate_key_null_') as TEXT)) as unique_campaign_version_id\n\n from campaign_join\n)\n\nselect *\nfrom add_surrogate_key", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.int_iterable__campaign_labels": {"database": "postgres", "schema": "public_iterable_dev", "name": "int_iterable__campaign_labels", "resource_type": "model", "package_name": "iterable", "path": "intermediate/int_iterable__campaign_labels.sql", "original_file_path": "models/intermediate/int_iterable__campaign_labels.sql", "unique_id": "model.iterable.int_iterable__campaign_labels", "fqn": ["iterable", "intermediate", "int_iterable__campaign_labels"], "alias": "int_iterable__campaign_labels", "checksum": {"name": "sha256", "checksum": "64ae8d410bd6673399326348a650a7facc7b6631aa34fbb01a1598cb96c7d012"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "Table that provides the distinct string aggregation of labels for each campaign.", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "iterable://models/intermediate/int_iterable.yml", "build_path": null, "unrendered_config": {"materialized": "view", "schema": "iterable_{{ var('directed_schema','dev') }}", "enabled": "var('iterable__using_campaign_label_history', True)", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789419972.9844291, "relation_name": "\"postgres\".\"public_iterable_dev\".\"int_iterable__campaign_labels\"", "raw_code": "{{ config(enabled=var('iterable__using_campaign_label_history', True)) }}\n\nwith campaign_label_history as (\n\n select *\n from {{ ref('stg_iterable__campaign_label_history') }}\n\n), order_campaign_labels as (\n\n select \n *,\n rank() over(partition by campaign_id{{ fivetran_utils.partition_by_source_relation(package_name='iterable') }} order by updated_at desc) as latest_label_batch_index\n\n from campaign_label_history\n\n), latest_labels as (\n\n select *\n from order_campaign_labels\n where latest_label_batch_index = 1\n\n), aggregate_labels as (\n\n select\n source_relation,\n campaign_id,\n {{ fivetran_utils.string_agg('distinct label', \"', '\") }} as labels\n\n from latest_labels\n {{ dbt_utils.group_by(n=2) }}\n)\n\nselect * from aggregate_labels", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__campaign_label_history", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.fivetran_utils.partition_by_source_relation", "macro.fivetran_utils.string_agg", "macro.dbt_utils.group_by"], "nodes": ["model.iterable.stg_iterable__campaign_label_history"]}, "compiled_path": "target/compiled/iterable/models/intermediate/int_iterable__campaign_labels.sql", "compiled": true, "compiled_code": "\n\nwith campaign_label_history as (\n\n select *\n from \"postgres\".\"public_iterable_dev\".\"stg_iterable__campaign_label_history\"\n\n), order_campaign_labels as (\n\n select \n *,\n rank() over(partition by campaign_id order by updated_at desc) as latest_label_batch_index\n\n from campaign_label_history\n\n), latest_labels as (\n\n select *\n from order_campaign_labels\n where latest_label_batch_index = 1\n\n), aggregate_labels as (\n\n select\n source_relation,\n campaign_id,\n \n string_agg(distinct label, ', ')\n\n as labels\n\n from latest_labels\n group by 1,2\n)\n\nselect * from aggregate_labels", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.int_iterable__journey_event_metrics": {"database": "postgres", "schema": "public_iterable_dev", "name": "int_iterable__journey_event_metrics", "resource_type": "model", "package_name": "iterable", "path": "intermediate/int_iterable__journey_event_metrics.sql", "original_file_path": "models/intermediate/int_iterable__journey_event_metrics.sql", "unique_id": "model.iterable.int_iterable__journey_event_metrics", "fqn": ["iterable", "intermediate", "int_iterable__journey_event_metrics"], "alias": "int_iterable__journey_event_metrics", "checksum": {"name": "sha256", "checksum": "bfde0156d4c1044ca7bc2993a11f34370dba3692b6d75b001ed4a9ba799b38b4"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "Table that generates relevant total and unique journey level aggregations, rolled up from the user/campaign grain via the campaign's journey reference.", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "iterable://models/intermediate/int_iterable.yml", "build_path": null, "unrendered_config": {"materialized": "view", "schema": "iterable_{{ var('directed_schema','dev') }}", "enabled": "var('iterable__using_journey', True)", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789419972.9853535, "relation_name": "\"postgres\".\"public_iterable_dev\".\"int_iterable__journey_event_metrics\"", "raw_code": "{{ config(enabled=var('iterable__using_journey', True)) }}\n\nwith user_campaign as (\n select *\n from {{ ref('iterable__user_campaign') }}\n\n), campaign as (\n\n select\n source_relation,\n campaign_id,\n journey_id\n\n from {{ ref('int_iterable__recurring_campaigns') }}\n where journey_id is not null\n\n), journey_event_metrics as (\n{%- set user_campaign_columns = adapter.get_columns_in_relation(ref('iterable__user_campaign')) %}\n{%- set non_agg_columns = ['source_relation', 'unique_user_key', 'user_id', '_fivetran_user_id',\n 'user_email', 'user_full_name', 'campaign_id', 'campaign_name', 'recurring_campaign_id',\n 'recurring_campaign_name', 'first_event_at', 'last_event_at', 'template_id', 'template_name',\n 'experiment_id', 'unique_user_campaign_id', 'first_open_or_click_event_at'\n ] %}\n\n select\n campaign.source_relation,\n campaign.journey_id,\n count(distinct user_campaign.campaign_id) as count_total_campaigns,\n count(distinct user_campaign.unique_user_key) as count_unique_users,\n min(user_campaign.first_event_at) as first_event_at,\n max(user_campaign.last_event_at) as last_event_at\n {% for col in user_campaign_columns if col.name|lower not in non_agg_columns %}\n , sum(user_campaign.{{ col.name }}) as {{ col.name }}\n -- counts distinct users; campaign_event_metrics counts distinct emails\n , count(distinct case when user_campaign.{{ col.name }} > 0 then user_campaign.unique_user_key else null end) as unique_{{ col.name }}\n {% endfor %}\n\n from user_campaign\n\n inner join campaign\n on user_campaign.campaign_id = campaign.campaign_id\n and user_campaign.source_relation = campaign.source_relation\n\n {{ dbt_utils.group_by(n=2) }}\n)\n\nselect *\nfrom journey_event_metrics", "doc_blocks": [], "language": "sql", "refs": [{"name": "iterable__user_campaign", "package": null, "version": null}, {"name": "int_iterable__recurring_campaigns", "package": null, "version": null}, {"name": "iterable__user_campaign", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt_utils.group_by"], "nodes": ["model.iterable.iterable__user_campaign", "model.iterable.int_iterable__recurring_campaigns"]}, "compiled_path": "target/compiled/iterable/models/intermediate/int_iterable__journey_event_metrics.sql", "compiled": true, "compiled_code": "\n\nwith user_campaign as (\n select *\n from \"postgres\".\"public_iterable_dev\".\"iterable__user_campaign\"\n\n), campaign as (\n\n select\n source_relation,\n campaign_id,\n journey_id\n\n from \"postgres\".\"public_iterable_dev\".\"int_iterable__recurring_campaigns\"\n where journey_id is not null\n\n), journey_event_metrics as (\n\n select\n campaign.source_relation,\n campaign.journey_id,\n count(distinct user_campaign.campaign_id) as count_total_campaigns,\n count(distinct user_campaign.unique_user_key) as count_unique_users,\n min(user_campaign.first_event_at) as first_event_at,\n max(user_campaign.last_event_at) as last_event_at\n \n , sum(user_campaign.total_emailclick) as total_emailclick\n -- counts distinct users; campaign_event_metrics counts distinct emails\n , count(distinct case when user_campaign.total_emailclick > 0 then user_campaign.unique_user_key else null end) as unique_total_emailclick\n \n , sum(user_campaign.total_emailunsubscribe) as total_emailunsubscribe\n -- counts distinct users; campaign_event_metrics counts distinct emails\n , count(distinct case when user_campaign.total_emailunsubscribe > 0 then user_campaign.unique_user_key else null end) as unique_total_emailunsubscribe\n \n , sum(user_campaign.total_emailcomplaint) as total_emailcomplaint\n -- counts distinct users; campaign_event_metrics counts distinct emails\n , count(distinct case when user_campaign.total_emailcomplaint > 0 then user_campaign.unique_user_key else null end) as unique_total_emailcomplaint\n \n , sum(user_campaign.total_customevent) as total_customevent\n -- counts distinct users; campaign_event_metrics counts distinct emails\n , count(distinct case when user_campaign.total_customevent > 0 then user_campaign.unique_user_key else null end) as unique_total_customevent\n \n , sum(user_campaign.total_emailsubscribe) as total_emailsubscribe\n -- counts distinct users; campaign_event_metrics counts distinct emails\n , count(distinct case when user_campaign.total_emailsubscribe > 0 then user_campaign.unique_user_key else null end) as unique_total_emailsubscribe\n \n , sum(user_campaign.total_emailopen) as total_emailopen\n -- counts distinct users; campaign_event_metrics counts distinct emails\n , count(distinct case when user_campaign.total_emailopen > 0 then user_campaign.unique_user_key else null end) as unique_total_emailopen\n \n , sum(user_campaign.total_pushsend) as total_pushsend\n -- counts distinct users; campaign_event_metrics counts distinct emails\n , count(distinct case when user_campaign.total_pushsend > 0 then user_campaign.unique_user_key else null end) as unique_total_pushsend\n \n , sum(user_campaign.total_smsbounce) as total_smsbounce\n -- counts distinct users; campaign_event_metrics counts distinct emails\n , count(distinct case when user_campaign.total_smsbounce > 0 then user_campaign.unique_user_key else null end) as unique_total_smsbounce\n \n , sum(user_campaign.total_pushbounce) as total_pushbounce\n -- counts distinct users; campaign_event_metrics counts distinct emails\n , count(distinct case when user_campaign.total_pushbounce > 0 then user_campaign.unique_user_key else null end) as unique_total_pushbounce\n \n , sum(user_campaign.total_inappsendskip) as total_inappsendskip\n -- counts distinct users; campaign_event_metrics counts distinct emails\n , count(distinct case when user_campaign.total_inappsendskip > 0 then user_campaign.unique_user_key else null end) as unique_total_inappsendskip\n \n , sum(user_campaign.total_smssend) as total_smssend\n -- counts distinct users; campaign_event_metrics counts distinct emails\n , count(distinct case when user_campaign.total_smssend > 0 then user_campaign.unique_user_key else null end) as unique_total_smssend\n \n , sum(user_campaign.total_inappsend) as total_inappsend\n -- counts distinct users; campaign_event_metrics counts distinct emails\n , count(distinct case when user_campaign.total_inappsend > 0 then user_campaign.unique_user_key else null end) as unique_total_inappsend\n \n , sum(user_campaign.total_pushopen) as total_pushopen\n -- counts distinct users; campaign_event_metrics counts distinct emails\n , count(distinct case when user_campaign.total_pushopen > 0 then user_campaign.unique_user_key else null end) as unique_total_pushopen\n \n , sum(user_campaign.total_emailsend) as total_emailsend\n -- counts distinct users; campaign_event_metrics counts distinct emails\n , count(distinct case when user_campaign.total_emailsend > 0 then user_campaign.unique_user_key else null end) as unique_total_emailsend\n \n , sum(user_campaign.total_pushsendskip) as total_pushsendskip\n -- counts distinct users; campaign_event_metrics counts distinct emails\n , count(distinct case when user_campaign.total_pushsendskip > 0 then user_campaign.unique_user_key else null end) as unique_total_pushsendskip\n \n , sum(user_campaign.total_inappopen) as total_inappopen\n -- counts distinct users; campaign_event_metrics counts distinct emails\n , count(distinct case when user_campaign.total_inappopen > 0 then user_campaign.unique_user_key else null end) as unique_total_inappopen\n \n , sum(user_campaign.total_emailsendskip) as total_emailsendskip\n -- counts distinct users; campaign_event_metrics counts distinct emails\n , count(distinct case when user_campaign.total_emailsendskip > 0 then user_campaign.unique_user_key else null end) as unique_total_emailsendskip\n \n , sum(user_campaign.total_emailbounce) as total_emailbounce\n -- counts distinct users; campaign_event_metrics counts distinct emails\n , count(distinct case when user_campaign.total_emailbounce > 0 then user_campaign.unique_user_key else null end) as unique_total_emailbounce\n \n , sum(user_campaign.total_inappclick) as total_inappclick\n -- counts distinct users; campaign_event_metrics counts distinct emails\n , count(distinct case when user_campaign.total_inappclick > 0 then user_campaign.unique_user_key else null end) as unique_total_inappclick\n \n , sum(user_campaign.total_pushuninstall) as total_pushuninstall\n -- counts distinct users; campaign_event_metrics counts distinct emails\n , count(distinct case when user_campaign.total_pushuninstall > 0 then user_campaign.unique_user_key else null end) as unique_total_pushuninstall\n \n\n from user_campaign\n\n inner join campaign\n on user_campaign.campaign_id = campaign.campaign_id\n and user_campaign.source_relation = campaign.source_relation\n\n group by 1,2\n)\n\nselect *\nfrom journey_event_metrics", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.int_iterable__list_user_unnest": {"database": "postgres", "schema": "public_iterable_dev", "name": "int_iterable__list_user_unnest", "resource_type": "model", "package_name": "iterable", "path": "intermediate/int_iterable__list_user_unnest.sql", "original_file_path": "models/intermediate/int_iterable__list_user_unnest.sql", "unique_id": "model.iterable.int_iterable__list_user_unnest", "fqn": ["iterable", "intermediate", "int_iterable__list_user_unnest"], "alias": "int_iterable__list_user_unnest", "checksum": {"name": "sha256", "checksum": "82ec833586106f02efef7fe24516f3323171e61f1083323e97c892f21ddfa263"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "incremental", "incremental_strategy": "delete+insert", "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": "unique_key", "on_schema_change": "fail", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}, "partition_by": {"field": "date_day", "data_type": "date"}, "file_format": "delta"}, "tags": [], "description": "Table that unnests the `email_list_id` field for each user to create a new record for each user and the unique list it was associated with at a unique update. Due to the unnesting functions varying greatly between warehouses, conditional logic is applied throughout the model to appropriately accommodate the model being ran within Redshift, Snowflake, BigQuery, and Postgres.\n", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "iterable://models/intermediate/int_iterable.yml", "build_path": null, "unrendered_config": {"materialized": "incremental", "schema": "iterable_{{ var('directed_schema','dev') }}", "unique_key": "unique_key", "incremental_strategy": "CondExpr(test=Compare(expr=Getattr(node=Name(name='target', ctx='load'), attr='type', ctx='load'), ops=[Operand(op='in', expr=Tuple(items=[Const(value='bigquery'), Const(value='spark'), Const(value='databricks')], ctx='load'))]), expr1=Const(value='insert_overwrite'), expr2=Const(value='delete+insert'))", "partition_by": "CondExpr(test=Compare(expr=Getattr(node=Name(name='target', ctx='load'), attr='type', ctx='load'), ops=[Operand(op='notin', expr=Tuple(items=[Const(value='spark'), Const(value='databricks'), Const(value='duckdb')], ctx='load'))]), expr1=Dict(items=[Pair(key=Const(value='field'), value=Const(value='date_day')), Pair(key=Const(value='data_type'), value=Const(value='date'))]), expr2=List(items=[Const(value='date_day')]))", "file_format": "delta", "on_schema_change": "fail", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789419972.9876084, "relation_name": "\"postgres\".\"public_iterable_dev\".\"int_iterable__list_user_unnest\"", "raw_code": "{{ config(\n materialized='incremental',\n unique_key='unique_key',\n incremental_strategy='insert_overwrite' if target.type in ('bigquery', 'spark', 'databricks') else 'delete+insert',\n partition_by={\"field\": \"date_day\", \"data_type\": \"date\"} if target.type not in ('spark', 'databricks', 'duckdb') else ['date_day'],\n file_format='delta',\n on_schema_change='fail'\n )\n}}\n\nwith user_history as (\n\n select *\n from {{ ref('int_iterable__list_user_history') }} as user_history\n\n {% if is_incremental() %}\n {# the only rows we potentially want to overwrite are active ones #}\n where user_history.updated_at >= coalesce((select min(updated_at) from {{ this }} where is_current), '2010-01-01')\n {% endif %}\n\n{% if target.type == 'redshift' %}\n{# using PartiQL syntax to work with redshift's SUPER types #}\n), redshift_parse_email_lists as (\n\n select\n source_relation,\n _fivetran_user_id,\n unique_user_key,\n email,\n first_name,\n last_name,\n user_id,\n signup_date,\n signup_source,\n phone_number,\n updated_at,\n is_current,\n email_list_ids,\n {# let's not remove empty array-rows #}\n json_parse(case when email_list_ids = '[]' then '[\"is_null\"]' else email_list_ids end) as super_email_list_ids\n\n --The below script allows for pass through columns.\n {{ fivetran_utils.persist_pass_through_columns(pass_through_variable='iterable_user_history_pass_through_columns', identifier='user_history') }}\n\n from user_history\n\n), unnest_email_array as (\n\n select\n source_relation,\n _fivetran_user_id,\n unique_user_key,\n email,\n first_name,\n last_name,\n user_id,\n signup_date,\n signup_source,\n phone_number,\n updated_at,\n is_current,\n {# go back to strings #}\n cast(email_list_ids as {{ dbt.type_string() }}) as email_list_ids,\n cast(email_list_id as {{ dbt.type_string() }}) as email_list_id\n\n --The below script allows for pass through columns.\n {{ fivetran_utils.persist_pass_through_columns(pass_through_variable='iterable_user_history_pass_through_columns', identifier='emails') }}\n\n from redshift_parse_email_lists as emails, emails.super_email_list_ids as email_list_id\n\n{% else %}\n), unnest_email_array as (\n\n select\n source_relation,\n _fivetran_user_id,\n unique_user_key,\n email,\n first_name,\n last_name,\n user_id,\n signup_date,\n signup_source,\n phone_number,\n updated_at,\n is_current,\n email_list_ids,\n case when email_list_ids != '[]' then\n {% if target.type == 'snowflake' %}\n email_list_id.value\n {% elif target.type in ('spark','databricks') %}\n email_list_id.col\n {% else %} email_list_id {% endif %}\n else null\n end as email_list_id\n\n --The below script allows for pass through columns.\n {{ fivetran_utils.persist_pass_through_columns(pass_through_variable='iterable_user_history_pass_through_columns', identifier='user_history') }}\n\n from user_history\n\n {% if target.type == 'snowflake' %}\n cross join\n table(flatten(input => parse_json(\n case when email_list_ids = '[]' then '[\"is_null\"]' {# to not remove empty array-rows #}\n else email_list_ids end))) as email_list_id\n {% elif target.type == 'bigquery' %}\n cross join\n unnest(JSON_EXTRACT_STRING_ARRAY(\n case when email_list_ids = '[]' then '[\"is_null\"]' {# to not remove empty array-rows #}\n else email_list_ids end)) as email_list_id\n {% elif target.type in ('spark','databricks') %}\n cross join\n lateral explode_outer(from_json(\n case when email_list_ids = '[]' then '[\"is_null\"]' {# to not remove empty array-rows #}\n else email_list_ids end, 'array')) as email_list_id\n {% elif target.type == 'duckdb' %}\n cross join\n unnest(from_json(cast((\n case when email_list_ids = '[]' then '[\"is_null\"]' {# to not remove empty array-rows #}\n else email_list_ids end) as varchar), '[\"VARCHAR\"]')) as t(email_list_id)\n {% else %} {# target is postgres #}\n cross join\n json_array_elements_text(cast((\n case when email_list_ids = '[]' then '[\"is_null\"]' {# to not remove empty array-rows #}\n else email_list_ids end) as json)) as email_list_id\n {%- endif %}\n\n{%- endif -%}\n), adjust_nulls as (\n\n select\n source_relation,\n _fivetran_user_id,\n unique_user_key,\n email,\n first_name,\n last_name,\n user_id,\n signup_date,\n signup_source,\n updated_at,\n phone_number,\n is_current,\n case when email_list_ids = '[\"is_null\"]' then '[]' else email_list_ids end as email_list_ids,\n cast(NULLIF(email_list_id, 'is_null') as {{ dbt.type_int() }}) as list_id\n\n --The below script allows for pass through columns.\n {{ fivetran_utils.persist_pass_through_columns(pass_through_variable='iterable_user_history_pass_through_columns', identifier='unnest_email_array') }}\n\n from unnest_email_array\n\n), final as (\n\n select\n source_relation,\n _fivetran_user_id,\n unique_user_key,\n user_id,\n email,\n first_name,\n last_name,\n signup_date,\n signup_source,\n updated_at,\n phone_number,\n is_current,\n email_list_ids,\n list_id,\n {{ dbt_utils.generate_surrogate_key([\"source_relation\", \"unique_user_key\", \"list_id\", \"updated_at\"]) }} as unique_key,\n cast( {{ dbt.date_trunc('day', 'updated_at') }} as date) as date_day\n\n --The below script allows for pass through columns.\n {{ fivetran_utils.persist_pass_through_columns(pass_through_variable='iterable_user_history_pass_through_columns', identifier='adjust_nulls') }}\n\n from adjust_nulls\n)\n\nselect *\nfrom final", "doc_blocks": [], "language": "sql", "refs": [{"name": "int_iterable__list_user_history", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.is_incremental", "macro.fivetran_utils.persist_pass_through_columns", "macro.dbt.type_int", "macro.dbt_utils.generate_surrogate_key", "macro.dbt.date_trunc"], "nodes": ["model.iterable.int_iterable__list_user_history"]}, "compiled_path": "target/compiled/iterable/models/intermediate/int_iterable__list_user_unnest.sql", "compiled": true, "compiled_code": "\n\nwith user_history as (\n\n select *\n from \"postgres\".\"public_iterable_dev\".\"int_iterable__list_user_history\" as user_history\n\n \n \n where user_history.updated_at >= coalesce((select min(updated_at) from \"postgres\".\"public_iterable_dev\".\"int_iterable__list_user_unnest\" where is_current), '2010-01-01')\n \n\n\n), unnest_email_array as (\n\n select\n source_relation,\n _fivetran_user_id,\n unique_user_key,\n email,\n first_name,\n last_name,\n user_id,\n signup_date,\n signup_source,\n phone_number,\n updated_at,\n is_current,\n email_list_ids,\n case when email_list_ids != '[]' then\n email_list_id \n else null\n end as email_list_id\n\n --The below script allows for pass through columns.\n \n\n\n\n\n\n from user_history\n\n \n cross join\n json_array_elements_text(cast((\n case when email_list_ids = '[]' then '[\"is_null\"]' \n else email_list_ids end) as json)) as email_list_id), adjust_nulls as (\n\n select\n source_relation,\n _fivetran_user_id,\n unique_user_key,\n email,\n first_name,\n last_name,\n user_id,\n signup_date,\n signup_source,\n updated_at,\n phone_number,\n is_current,\n case when email_list_ids = '[\"is_null\"]' then '[]' else email_list_ids end as email_list_ids,\n cast(NULLIF(email_list_id, 'is_null') as integer) as list_id\n\n --The below script allows for pass through columns.\n \n\n\n\n\n\n from unnest_email_array\n\n), final as (\n\n select\n source_relation,\n _fivetran_user_id,\n unique_user_key,\n user_id,\n email,\n first_name,\n last_name,\n signup_date,\n signup_source,\n updated_at,\n phone_number,\n is_current,\n email_list_ids,\n list_id,\n md5(cast(coalesce(cast(source_relation as TEXT), '_dbt_utils_surrogate_key_null_') || '-' || coalesce(cast(unique_user_key as TEXT), '_dbt_utils_surrogate_key_null_') || '-' || coalesce(cast(list_id as TEXT), '_dbt_utils_surrogate_key_null_') || '-' || coalesce(cast(updated_at as TEXT), '_dbt_utils_surrogate_key_null_') as TEXT)) as unique_key,\n cast( date_trunc('day', updated_at) as date) as date_day\n\n --The below script allows for pass through columns.\n \n\n\n\n\n\n from adjust_nulls\n)\n\nselect *\nfrom final", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.int_iterable__latest_template": {"database": "postgres", "schema": "public_iterable_dev", "name": "int_iterable__latest_template", "resource_type": "model", "package_name": "iterable", "path": "intermediate/int_iterable__latest_template.sql", "original_file_path": "models/intermediate/int_iterable__latest_template.sql", "unique_id": "model.iterable.int_iterable__latest_template", "fqn": ["iterable", "intermediate", "int_iterable__latest_template"], "alias": "int_iterable__latest_template", "checksum": {"name": "sha256", "checksum": "44d385d803b47bd9be4b5bfc6d78b88689e9c113d478ba8feb96f91717f45b3b"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "Table that provides the most recent version of the template as well as joining relevant message type information.", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "iterable://models/intermediate/int_iterable.yml", "build_path": null, "unrendered_config": {"materialized": "view", "schema": "iterable_{{ var('directed_schema','dev') }}", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789419972.9862804, "relation_name": "\"postgres\".\"public_iterable_dev\".\"int_iterable__latest_template\"", "raw_code": "with template_history as (\n select *\n from {{ ref('stg_iterable__template_history') }}\n\n), order_template as (\n select\n *,\n row_number() over(partition by template_id{{ fivetran_utils.partition_by_source_relation(package_name='iterable') }} order by updated_at desc) as latest_template_index\n from template_history\n\n), latest_template as (\n\n select *\n from order_template\n where latest_template_index = 1\n\n), message_type_channel as (\n\n select *\n from {{ ref('int_iterable__message_type_channel') }}\n\n), template_join as (\n\n select \n latest_template.*,\n message_type_channel.message_type_name,\n message_type_channel.channel_id,\n message_type_channel.channel_name,\n message_type_channel.channel_type,\n message_type_channel.message_medium\n\n from latest_template \n left join message_type_channel\n on latest_template.message_type_id = message_type_channel.message_type_id\n and latest_template.source_relation = message_type_channel.source_relation\n)\n\nselect *\nfrom template_join", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__template_history", "package": null, "version": null}, {"name": "int_iterable__message_type_channel", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.fivetran_utils.partition_by_source_relation"], "nodes": ["model.iterable.stg_iterable__template_history", "model.iterable.int_iterable__message_type_channel"]}, "compiled_path": "target/compiled/iterable/models/intermediate/int_iterable__latest_template.sql", "compiled": true, "compiled_code": "with template_history as (\n select *\n from \"postgres\".\"public_iterable_dev\".\"stg_iterable__template_history\"\n\n), order_template as (\n select\n *,\n row_number() over(partition by template_id order by updated_at desc) as latest_template_index\n from template_history\n\n), latest_template as (\n\n select *\n from order_template\n where latest_template_index = 1\n\n), message_type_channel as (\n\n select *\n from \"postgres\".\"public_iterable_dev\".\"int_iterable__message_type_channel\"\n\n), template_join as (\n\n select \n latest_template.*,\n message_type_channel.message_type_name,\n message_type_channel.channel_id,\n message_type_channel.channel_name,\n message_type_channel.channel_type,\n message_type_channel.message_medium\n\n from latest_template \n left join message_type_channel\n on latest_template.message_type_id = message_type_channel.message_type_id\n and latest_template.source_relation = message_type_channel.source_relation\n)\n\nselect *\nfrom template_join", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.int_iterable__campaign_event_metrics": {"database": "postgres", "schema": "public_iterable_dev", "name": "int_iterable__campaign_event_metrics", "resource_type": "model", "package_name": "iterable", "path": "intermediate/int_iterable__campaign_event_metrics.sql", "original_file_path": "models/intermediate/int_iterable__campaign_event_metrics.sql", "unique_id": "model.iterable.int_iterable__campaign_event_metrics", "fqn": ["iterable", "intermediate", "int_iterable__campaign_event_metrics"], "alias": "int_iterable__campaign_event_metrics", "checksum": {"name": "sha256", "checksum": "81038e93b6f7f8151fb0d719780a87ebc5bd95b613431564e7c470121a174e26"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "Table that generates relevant total and unique campaign/experiment level aggregations.", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "iterable://models/intermediate/int_iterable.yml", "build_path": null, "unrendered_config": {"materialized": "view", "schema": "iterable_{{ var('directed_schema','dev') }}", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789419972.9839199, "relation_name": "\"postgres\".\"public_iterable_dev\".\"int_iterable__campaign_event_metrics\"", "raw_code": "with user_campaign as (\n select *\n from {{ ref('iterable__user_campaign') }}\n\n), campaign_user_event_metrics as (\n{%- set using_event_extension = var('iterable__using_event_extension', True) %}\n{%- set user_campaign_columns = adapter.get_columns_in_relation(ref('iterable__user_campaign')) %}\n{%- set non_agg_columns = ['source_relation', 'unique_user_key', 'user_id', '_fivetran_user_id', \n 'user_email', 'user_full_name', 'campaign_id', 'campaign_name', 'recurring_campaign_id', \n 'recurring_campaign_name', 'first_event_at', 'last_event_at', 'template_id', 'template_name', \n 'experiment_id', 'unique_user_campaign_id', 'first_open_or_click_event_at'\n ] %}\n\n select\n source_relation,\n campaign_id,\n template_id\n {{ \", experiment_id\" if using_event_extension }}\n , count(distinct unique_user_key) as count_unique_users\n {% for col in user_campaign_columns if col.name|lower not in non_agg_columns %}\n , sum({{ col.name }}) as {{ col.name }}\n , count(distinct case when {{ col.name }} > 0 then user_email else null end) as unique_{{ col.name }}\n {% endfor %}\n \n from user_campaign\n \n {{ dbt_utils.group_by(n=4 if using_event_extension else 3) }}\n)\n\nselect *\nfrom campaign_user_event_metrics", "doc_blocks": [], "language": "sql", "refs": [{"name": "iterable__user_campaign", "package": null, "version": null}, {"name": "iterable__user_campaign", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt_utils.group_by"], "nodes": ["model.iterable.iterable__user_campaign"]}, "compiled_path": "target/compiled/iterable/models/intermediate/int_iterable__campaign_event_metrics.sql", "compiled": true, "compiled_code": "with user_campaign as (\n select *\n from \"postgres\".\"public_iterable_dev\".\"iterable__user_campaign\"\n\n), campaign_user_event_metrics as (\n\n select\n source_relation,\n campaign_id,\n template_id\n , experiment_id\n , count(distinct unique_user_key) as count_unique_users\n \n , sum(total_emailclick) as total_emailclick\n , count(distinct case when total_emailclick > 0 then user_email else null end) as unique_total_emailclick\n \n , sum(total_emailunsubscribe) as total_emailunsubscribe\n , count(distinct case when total_emailunsubscribe > 0 then user_email else null end) as unique_total_emailunsubscribe\n \n , sum(total_emailcomplaint) as total_emailcomplaint\n , count(distinct case when total_emailcomplaint > 0 then user_email else null end) as unique_total_emailcomplaint\n \n , sum(total_customevent) as total_customevent\n , count(distinct case when total_customevent > 0 then user_email else null end) as unique_total_customevent\n \n , sum(total_emailsubscribe) as total_emailsubscribe\n , count(distinct case when total_emailsubscribe > 0 then user_email else null end) as unique_total_emailsubscribe\n \n , sum(total_emailopen) as total_emailopen\n , count(distinct case when total_emailopen > 0 then user_email else null end) as unique_total_emailopen\n \n , sum(total_pushsend) as total_pushsend\n , count(distinct case when total_pushsend > 0 then user_email else null end) as unique_total_pushsend\n \n , sum(total_smsbounce) as total_smsbounce\n , count(distinct case when total_smsbounce > 0 then user_email else null end) as unique_total_smsbounce\n \n , sum(total_pushbounce) as total_pushbounce\n , count(distinct case when total_pushbounce > 0 then user_email else null end) as unique_total_pushbounce\n \n , sum(total_inappsendskip) as total_inappsendskip\n , count(distinct case when total_inappsendskip > 0 then user_email else null end) as unique_total_inappsendskip\n \n , sum(total_smssend) as total_smssend\n , count(distinct case when total_smssend > 0 then user_email else null end) as unique_total_smssend\n \n , sum(total_inappsend) as total_inappsend\n , count(distinct case when total_inappsend > 0 then user_email else null end) as unique_total_inappsend\n \n , sum(total_pushopen) as total_pushopen\n , count(distinct case when total_pushopen > 0 then user_email else null end) as unique_total_pushopen\n \n , sum(total_emailsend) as total_emailsend\n , count(distinct case when total_emailsend > 0 then user_email else null end) as unique_total_emailsend\n \n , sum(total_pushsendskip) as total_pushsendskip\n , count(distinct case when total_pushsendskip > 0 then user_email else null end) as unique_total_pushsendskip\n \n , sum(total_inappopen) as total_inappopen\n , count(distinct case when total_inappopen > 0 then user_email else null end) as unique_total_inappopen\n \n , sum(total_emailsendskip) as total_emailsendskip\n , count(distinct case when total_emailsendskip > 0 then user_email else null end) as unique_total_emailsendskip\n \n , sum(total_emailbounce) as total_emailbounce\n , count(distinct case when total_emailbounce > 0 then user_email else null end) as unique_total_emailbounce\n \n , sum(total_inappclick) as total_inappclick\n , count(distinct case when total_inappclick > 0 then user_email else null end) as unique_total_inappclick\n \n , sum(total_pushuninstall) as total_pushuninstall\n , count(distinct case when total_pushuninstall > 0 then user_email else null end) as unique_total_pushuninstall\n \n \n from user_campaign\n \n group by 1,2,3,4\n)\n\nselect *\nfrom campaign_user_event_metrics", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.int_iterable__campaign_lists": {"database": "postgres", "schema": "public_iterable_dev", "name": "int_iterable__campaign_lists", "resource_type": "model", "package_name": "iterable", "path": "intermediate/int_iterable__campaign_lists.sql", "original_file_path": "models/intermediate/int_iterable__campaign_lists.sql", "unique_id": "model.iterable.int_iterable__campaign_lists", "fqn": ["iterable", "intermediate", "int_iterable__campaign_lists"], "alias": "int_iterable__campaign_lists", "checksum": {"name": "sha256", "checksum": "33c167f12bf4fadb7316af985f2b60ee9989ade1a428d684037465d1a449685e"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "Table that identifies the suppressed and send lists associated with a campaign.", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "iterable://models/intermediate/int_iterable.yml", "build_path": null, "unrendered_config": {"materialized": "view", "schema": "iterable_{{ var('directed_schema','dev') }}", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789419972.984904, "relation_name": "\"postgres\".\"public_iterable_dev\".\"int_iterable__campaign_lists\"", "raw_code": "with \n\n{% if var('iterable__using_campaign_suppression_list_history', True) %}\n\ncampaign_suppression_list_history as (\n\n select *\n from {{ ref('stg_iterable__campaign_suppression_list_history') }}\n\n), \n\n{% endif %}\n\ncampaign_send_list_history as (\n\n select *\n from {{ ref('stg_iterable__campaign_list_history') }}\n\n), combine_list_histories as (\n\n{% if var('iterable__using_campaign_suppression_list_history', True) %}\n\n select\n source_relation,\n suppressed_list_id as list_id,\n campaign_id,\n updated_at,\n 'suppress' as list_activity\n from campaign_suppression_list_history\n\n union all\n\n{% endif %}\n\n select\n source_relation,\n list_id,\n campaign_id,\n updated_at,\n 'send' as list_activity\n from campaign_send_list_history\n\n), order_campaign_list_history as (\n\n select\n *,\n row_number() over(partition by list_id, campaign_id{{ fivetran_utils.partition_by_source_relation(package_name='iterable') }} order by updated_at desc) as latest_list_index\n from combine_list_histories\n\n), latest_campaign_list_history as (\n\n select\n source_relation,\n list_id,\n campaign_id,\n updated_at,\n list_activity\n\n from order_campaign_list_history\n where latest_list_index = 1\n)\n\nselect *\nfrom latest_campaign_list_history", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__campaign_suppression_list_history", "package": null, "version": null}, {"name": "stg_iterable__campaign_list_history", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.fivetran_utils.partition_by_source_relation"], "nodes": ["model.iterable.stg_iterable__campaign_suppression_list_history", "model.iterable.stg_iterable__campaign_list_history"]}, "compiled_path": "target/compiled/iterable/models/intermediate/int_iterable__campaign_lists.sql", "compiled": true, "compiled_code": "with \n\n\n\ncampaign_suppression_list_history as (\n\n select *\n from \"postgres\".\"public_iterable_dev\".\"stg_iterable__campaign_suppression_list_history\"\n\n), \n\n\n\ncampaign_send_list_history as (\n\n select *\n from \"postgres\".\"public_iterable_dev\".\"stg_iterable__campaign_list_history\"\n\n), combine_list_histories as (\n\n\n\n select\n source_relation,\n suppressed_list_id as list_id,\n campaign_id,\n updated_at,\n 'suppress' as list_activity\n from campaign_suppression_list_history\n\n union all\n\n\n\n select\n source_relation,\n list_id,\n campaign_id,\n updated_at,\n 'send' as list_activity\n from campaign_send_list_history\n\n), order_campaign_list_history as (\n\n select\n *,\n row_number() over(partition by list_id, campaign_id order by updated_at desc) as latest_list_index\n from combine_list_histories\n\n), latest_campaign_list_history as (\n\n select\n source_relation,\n list_id,\n campaign_id,\n updated_at,\n list_activity\n\n from order_campaign_list_history\n where latest_list_index = 1\n)\n\nselect *\nfrom latest_campaign_list_history", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.int_iterable__recurring_campaigns": {"database": "postgres", "schema": "public_iterable_dev", "name": "int_iterable__recurring_campaigns", "resource_type": "model", "package_name": "iterable", "path": "intermediate/int_iterable__recurring_campaigns.sql", "original_file_path": "models/intermediate/int_iterable__recurring_campaigns.sql", "unique_id": "model.iterable.int_iterable__recurring_campaigns", "fqn": ["iterable", "intermediate", "int_iterable__recurring_campaigns"], "alias": "int_iterable__recurring_campaigns", "checksum": {"name": "sha256", "checksum": "177c12b9779cfd975d0de322b8ccfc36bdecb1f509262c02ca1c8cb7035926d8"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "Table that identifies when a campaign is associated with a recurring campaign and provides additional enriched recurring campaign information.", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "iterable://models/intermediate/int_iterable.yml", "build_path": null, "unrendered_config": {"materialized": "view", "schema": "iterable_{{ var('directed_schema','dev') }}", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789419972.9884887, "relation_name": "\"postgres\".\"public_iterable_dev\".\"int_iterable__recurring_campaigns\"", "raw_code": "with latest_campaign as (\n\n select * \n from {{ ref('int_iterable__latest_campaign') }}\n\n), recurring_campaign_join as (\n select\n latest_campaign.source_relation,\n latest_campaign.campaign_id,\n latest_campaign.campaign_name,\n latest_campaign.updated_at,\n latest_campaign.campaign_state,\n latest_campaign.campaign_type,\n latest_campaign.send_size,\n latest_campaign.start_at,\n latest_campaign.ended_at,\n latest_campaign.created_at,\n latest_campaign.created_by_user_id,\n latest_campaign.template_id,\n latest_campaign.recurring_campaign_id,\n {% if var('iterable__using_journey', true) %}\n -- cast to string so this matches journey_id in stg_iterable__journey; workflow_id arrives\n -- numeric from campaign_history but as a string from event_extension\n cast(latest_campaign.workflow_id as {{ dbt.type_string() }}) as journey_id,\n {% endif %}\n\n recurring_campaign.campaign_name as recurring_campaign_name,\n recurring_campaign.campaign_state as recurring_campaign_state,\n recurring_campaign.send_size as recurring_campaign_send_size,\n recurring_campaign.start_at as recurring_campaign_start_at\n\n from latest_campaign\n\n left join latest_campaign as recurring_campaign\n on latest_campaign.recurring_campaign_id = recurring_campaign.campaign_id\n and latest_campaign.source_relation = recurring_campaign.source_relation\n\n), final as (\n\n select\n recurring_campaign_join.*,\n case when latest_campaign.recurring_campaign_id is not null then true \n else false end as is_campaign_recurring\n\n from recurring_campaign_join\n left join latest_campaign on recurring_campaign_join.campaign_id = latest_campaign.recurring_campaign_id\n and recurring_campaign_join.template_id = latest_campaign.template_id\n and recurring_campaign_join.source_relation = latest_campaign.source_relation\n)\n\nselect *\nfrom final", "doc_blocks": [], "language": "sql", "refs": [{"name": "int_iterable__latest_campaign", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.type_string"], "nodes": ["model.iterable.int_iterable__latest_campaign"]}, "compiled_path": "target/compiled/iterable/models/intermediate/int_iterable__recurring_campaigns.sql", "compiled": true, "compiled_code": "with latest_campaign as (\n\n select * \n from \"postgres\".\"public_iterable_dev\".\"int_iterable__latest_campaign\"\n\n), recurring_campaign_join as (\n select\n latest_campaign.source_relation,\n latest_campaign.campaign_id,\n latest_campaign.campaign_name,\n latest_campaign.updated_at,\n latest_campaign.campaign_state,\n latest_campaign.campaign_type,\n latest_campaign.send_size,\n latest_campaign.start_at,\n latest_campaign.ended_at,\n latest_campaign.created_at,\n latest_campaign.created_by_user_id,\n latest_campaign.template_id,\n latest_campaign.recurring_campaign_id,\n \n -- cast to string so this matches journey_id in stg_iterable__journey; workflow_id arrives\n -- numeric from campaign_history but as a string from event_extension\n cast(latest_campaign.workflow_id as TEXT) as journey_id,\n \n\n recurring_campaign.campaign_name as recurring_campaign_name,\n recurring_campaign.campaign_state as recurring_campaign_state,\n recurring_campaign.send_size as recurring_campaign_send_size,\n recurring_campaign.start_at as recurring_campaign_start_at\n\n from latest_campaign\n\n left join latest_campaign as recurring_campaign\n on latest_campaign.recurring_campaign_id = recurring_campaign.campaign_id\n and latest_campaign.source_relation = recurring_campaign.source_relation\n\n), final as (\n\n select\n recurring_campaign_join.*,\n case when latest_campaign.recurring_campaign_id is not null then true \n else false end as is_campaign_recurring\n\n from recurring_campaign_join\n left join latest_campaign on recurring_campaign_join.campaign_id = latest_campaign.recurring_campaign_id\n and recurring_campaign_join.template_id = latest_campaign.template_id\n and recurring_campaign_join.source_relation = latest_campaign.source_relation\n)\n\nselect *\nfrom final", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.int_iterable__list_user_history": {"database": "postgres", "schema": "public_iterable_dev", "name": "int_iterable__list_user_history", "resource_type": "model", "package_name": "iterable", "path": "intermediate/int_iterable__list_user_history.sql", "original_file_path": "models/intermediate/int_iterable__list_user_history.sql", "unique_id": "model.iterable.int_iterable__list_user_history", "fqn": ["iterable", "intermediate", "int_iterable__list_user_history"], "alias": "int_iterable__list_user_history", "checksum": {"name": "sha256", "checksum": "26b2bd189944dfea25bb63edf9e3da03a3e8169e3501b894716e8d1f8e1df5a0"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "table", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "Table that provides a history of all lists the user has been associated with.", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "iterable://models/intermediate/int_iterable.yml", "build_path": null, "unrendered_config": {"materialized": "table", "schema": "iterable_{{ var('directed_schema','dev') }}", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789419972.987178, "relation_name": "\"postgres\".\"public_iterable_dev\".\"int_iterable__list_user_history\"", "raw_code": "-- this model will serve to extract only email-list changes\nwith user_history as (\n\n select *\n from {{ ref('stg_iterable__user_history') }}\n\n), previous_email_list_ids as (\n\n select\n *,\n lag(email_list_ids) over(partition by unique_user_key{{ fivetran_utils.partition_by_source_relation(package_name='iterable') }} order by updated_at asc) as previous_ids -- partition by email instead of unique_user_key here since this model is only for email-list users\n\n from user_history\n\n), only_new_email_list_ids as (\n\n select\n source_relation,\n _fivetran_user_id,\n unique_user_key,\n user_id,\n email,\n first_name,\n last_name,\n email_list_ids,\n phone_number,\n signup_date,\n signup_source,\n updated_at\n\n --The below script allows for pass through columns.\n {{ fivetran_utils.persist_pass_through_columns(pass_through_variable='iterable_user_history_pass_through_columns', identifier='previous_email_list_ids') }}\n\n from previous_email_list_ids\n where email_list_ids != coalesce(previous_ids, 'this is new') -- list ids are always stored in their arrays in numerical order\n\n), most_recent_list_ids as (\n\n select\n *,\n row_number() over(partition by email{{ fivetran_utils.partition_by_source_relation(package_name='iterable') }} order by updated_at desc) as latest_user_index\n\n from only_new_email_list_ids\n\n), final as (\n\n select\n source_relation,\n _fivetran_user_id,\n unique_user_key,\n email,\n user_id,\n first_name,\n last_name,\n email_list_ids,\n phone_number,\n signup_date,\n signup_source,\n updated_at,\n latest_user_index = 1 as is_current\n\n --The below script allows for pass through columns.\n {{ fivetran_utils.persist_pass_through_columns(pass_through_variable='iterable_user_history_pass_through_columns', identifier='most_recent_list_ids') }}\n\n from most_recent_list_ids\n)\n\nselect * from final", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__user_history", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.fivetran_utils.partition_by_source_relation", "macro.fivetran_utils.persist_pass_through_columns"], "nodes": ["model.iterable.stg_iterable__user_history"]}, "compiled_path": "target/compiled/iterable/models/intermediate/int_iterable__list_user_history.sql", "compiled": true, "compiled_code": "-- this model will serve to extract only email-list changes\nwith user_history as (\n\n select *\n from \"postgres\".\"public_iterable_dev\".\"stg_iterable__user_history\"\n\n), previous_email_list_ids as (\n\n select\n *,\n lag(email_list_ids) over(partition by unique_user_key order by updated_at asc) as previous_ids -- partition by email instead of unique_user_key here since this model is only for email-list users\n\n from user_history\n\n), only_new_email_list_ids as (\n\n select\n source_relation,\n _fivetran_user_id,\n unique_user_key,\n user_id,\n email,\n first_name,\n last_name,\n email_list_ids,\n phone_number,\n signup_date,\n signup_source,\n updated_at\n\n --The below script allows for pass through columns.\n \n\n\n\n\n\n from previous_email_list_ids\n where email_list_ids != coalesce(previous_ids, 'this is new') -- list ids are always stored in their arrays in numerical order\n\n), most_recent_list_ids as (\n\n select\n *,\n row_number() over(partition by email order by updated_at desc) as latest_user_index\n\n from only_new_email_list_ids\n\n), final as (\n\n select\n source_relation,\n _fivetran_user_id,\n unique_user_key,\n email,\n user_id,\n first_name,\n last_name,\n email_list_ids,\n phone_number,\n signup_date,\n signup_source,\n updated_at,\n latest_user_index = 1 as is_current\n\n --The below script allows for pass through columns.\n \n\n\n\n\n\n from most_recent_list_ids\n)\n\nselect * from final", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.int_iterable__message_type_channel": {"database": "postgres", "schema": "public_iterable_dev", "name": "int_iterable__message_type_channel", "resource_type": "model", "package_name": "iterable", "path": "intermediate/int_iterable__message_type_channel.sql", "original_file_path": "models/intermediate/int_iterable__message_type_channel.sql", "unique_id": "model.iterable.int_iterable__message_type_channel", "fqn": ["iterable", "intermediate", "int_iterable__message_type_channel"], "alias": "int_iterable__message_type_channel", "checksum": {"name": "sha256", "checksum": "9f54e0a46c508fbe16514b8e598ee614b3462649f85582b5513905f6392d728d"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "Table that joins the message type and channel records together into one comprehensive model to be referenced downstream.", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "iterable://models/intermediate/int_iterable.yml", "build_path": null, "unrendered_config": {"materialized": "view", "schema": "iterable_{{ var('directed_schema','dev') }}", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789419972.9880633, "relation_name": "\"postgres\".\"public_iterable_dev\".\"int_iterable__message_type_channel\"", "raw_code": "with message_type as (\n\n select *\n from {{ ref('stg_iterable__message_type') }}\n\n), channel as (\n\n select *\n from {{ ref('stg_iterable__channel') }}\n\n), final as (\n\n select \n channel.*,\n message_type.message_type_name,\n message_type.message_type_id\n from channel\n left join message_type\n on channel.channel_id = message_type.channel_id\n and channel.source_relation = message_type.source_relation\n)\n\nselect *\nfrom final", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__message_type", "package": null, "version": null}, {"name": "stg_iterable__channel", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": [], "nodes": ["model.iterable.stg_iterable__message_type", "model.iterable.stg_iterable__channel"]}, "compiled_path": "target/compiled/iterable/models/intermediate/int_iterable__message_type_channel.sql", "compiled": true, "compiled_code": "with message_type as (\n\n select *\n from \"postgres\".\"public_iterable_dev\".\"stg_iterable__message_type\"\n\n), channel as (\n\n select *\n from \"postgres\".\"public_iterable_dev\".\"stg_iterable__channel\"\n\n), final as (\n\n select \n channel.*,\n message_type.message_type_name,\n message_type.message_type_id\n from channel\n left join message_type\n on channel.channel_id = message_type.channel_id\n and channel.source_relation = message_type.source_relation\n)\n\nselect *\nfrom final", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.int_iterable__user_event_metrics": {"database": "postgres", "schema": "public_iterable_dev", "name": "int_iterable__user_event_metrics", "resource_type": "model", "package_name": "iterable", "path": "intermediate/int_iterable__user_event_metrics.sql", "original_file_path": "models/intermediate/int_iterable__user_event_metrics.sql", "unique_id": "model.iterable.int_iterable__user_event_metrics", "fqn": ["iterable", "intermediate", "int_iterable__user_event_metrics"], "alias": "int_iterable__user_event_metrics", "checksum": {"name": "sha256", "checksum": "56af49e00fd9cad13663d8bf802187ff1d12561fb1fd9d3732d182703b34ca4d"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "Table that generates user aggregations at the campaign level.", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "iterable://models/intermediate/int_iterable.yml", "build_path": null, "unrendered_config": {"materialized": "view", "schema": "iterable_{{ var('directed_schema','dev') }}", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789419972.9889438, "relation_name": "\"postgres\".\"public_iterable_dev\".\"int_iterable__user_event_metrics\"", "raw_code": "with user_campaign as (\n\n select *\n from {{ ref('iterable__user_campaign') }}\n\n), user_event_metrics as (\n\n{%- set user_campaign_columns = adapter.get_columns_in_relation(ref('iterable__user_campaign')) %}\n{%- set non_agg_columns = ['source_relation', 'unique_user_key', 'user_id', '_fivetran_user_id', \n 'user_email', 'user_full_name', 'campaign_id', 'campaign_name', 'recurring_campaign_id', \n 'recurring_campaign_name', 'first_event_at', 'last_event_at', 'template_id', 'template_name', \n 'experiment_id', 'unique_user_campaign_id', 'first_open_or_click_event_at'\n ] %}\n\n select\n source_relation,\n _fivetran_user_id,\n unique_user_key,\n user_id,\n user_email,\n count(distinct campaign_id) as count_total_campaigns,\n min(first_event_at) as first_event_at,\n max(last_event_at) as last_event_at\n\n {% for col in user_campaign_columns if col.name|lower not in non_agg_columns %}\n , sum({{ col.name }}) as {{ col.name }}\n {% endfor %}\n\n from user_campaign\n {{ dbt_utils.group_by(n=5) }}\n\n)\n\nselect *\nfrom user_event_metrics", "doc_blocks": [], "language": "sql", "refs": [{"name": "iterable__user_campaign", "package": null, "version": null}, {"name": "iterable__user_campaign", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt_utils.group_by"], "nodes": ["model.iterable.iterable__user_campaign"]}, "compiled_path": "target/compiled/iterable/models/intermediate/int_iterable__user_event_metrics.sql", "compiled": true, "compiled_code": "with user_campaign as (\n\n select *\n from \"postgres\".\"public_iterable_dev\".\"iterable__user_campaign\"\n\n), user_event_metrics as (\n\n select\n source_relation,\n _fivetran_user_id,\n unique_user_key,\n user_id,\n user_email,\n count(distinct campaign_id) as count_total_campaigns,\n min(first_event_at) as first_event_at,\n max(last_event_at) as last_event_at\n\n \n , sum(total_emailclick) as total_emailclick\n \n , sum(total_emailunsubscribe) as total_emailunsubscribe\n \n , sum(total_emailcomplaint) as total_emailcomplaint\n \n , sum(total_customevent) as total_customevent\n \n , sum(total_emailsubscribe) as total_emailsubscribe\n \n , sum(total_emailopen) as total_emailopen\n \n , sum(total_pushsend) as total_pushsend\n \n , sum(total_smsbounce) as total_smsbounce\n \n , sum(total_pushbounce) as total_pushbounce\n \n , sum(total_inappsendskip) as total_inappsendskip\n \n , sum(total_smssend) as total_smssend\n \n , sum(total_inappsend) as total_inappsend\n \n , sum(total_pushopen) as total_pushopen\n \n , sum(total_emailsend) as total_emailsend\n \n , sum(total_pushsendskip) as total_pushsendskip\n \n , sum(total_inappopen) as total_inappopen\n \n , sum(total_emailsendskip) as total_emailsendskip\n \n , sum(total_emailbounce) as total_emailbounce\n \n , sum(total_inappclick) as total_inappclick\n \n , sum(total_pushuninstall) as total_pushuninstall\n \n\n from user_campaign\n group by 1,2,3,4,5\n\n)\n\nselect *\nfrom user_event_metrics", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.int_iterable__latest_user": {"database": "postgres", "schema": "public_iterable_dev", "name": "int_iterable__latest_user", "resource_type": "model", "package_name": "iterable", "path": "intermediate/int_iterable__latest_user.sql", "original_file_path": "models/intermediate/int_iterable__latest_user.sql", "unique_id": "model.iterable.int_iterable__latest_user", "fqn": ["iterable", "intermediate", "int_iterable__latest_user"], "alias": "int_iterable__latest_user", "checksum": {"name": "sha256", "checksum": "580070cfbe396b904d0dc15669eefe5b9f017005d0aa91aa2c3d96b4e4686e81"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "Table that filters out historical versions of the user, and returns only the most recent version.", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "iterable://models/intermediate/int_iterable.yml", "build_path": null, "unrendered_config": {"materialized": "view", "schema": "iterable_{{ var('directed_schema','dev') }}", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789419972.9867206, "relation_name": "\"postgres\".\"public_iterable_dev\".\"int_iterable__latest_user\"", "raw_code": "with user_history as (\n select *\n from {{ ref('stg_iterable__user_history') }}\n\n), latest_user as (\n select\n *,\n row_number() over(partition by unique_user_key{{ fivetran_utils.partition_by_source_relation(package_name='iterable') }} order by updated_at desc) as latest_user_index\n from user_history\n)\n\nselect *\nfrom latest_user\nwhere latest_user_index = 1", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__user_history", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.fivetran_utils.partition_by_source_relation"], "nodes": ["model.iterable.stg_iterable__user_history"]}, "compiled_path": "target/compiled/iterable/models/intermediate/int_iterable__latest_user.sql", "compiled": true, "compiled_code": "with user_history as (\n select *\n from \"postgres\".\"public_iterable_dev\".\"stg_iterable__user_history\"\n\n), latest_user as (\n select\n *,\n row_number() over(partition by unique_user_key order by updated_at desc) as latest_user_index\n from user_history\n)\n\nselect *\nfrom latest_user\nwhere latest_user_index = 1", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.int_iterable__latest_campaign": {"database": "postgres", "schema": "public_iterable_dev", "name": "int_iterable__latest_campaign", "resource_type": "model", "package_name": "iterable", "path": "intermediate/int_iterable__latest_campaign.sql", "original_file_path": "models/intermediate/int_iterable__latest_campaign.sql", "unique_id": "model.iterable.int_iterable__latest_campaign", "fqn": ["iterable", "intermediate", "int_iterable__latest_campaign"], "alias": "int_iterable__latest_campaign", "checksum": {"name": "sha256", "checksum": "8063c9ccdfe6dee1694944607534fbb31bafe2856073ac2f5ea58aa513714e4f"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "Table that filters out historical versions of the campaign, and returns the most recent campaign version.", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "iterable://models/intermediate/int_iterable.yml", "build_path": null, "unrendered_config": {"materialized": "view", "schema": "iterable_{{ var('directed_schema','dev') }}", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789419972.9858222, "relation_name": "\"postgres\".\"public_iterable_dev\".\"int_iterable__latest_campaign\"", "raw_code": "with campaign_history as (\n select *\n from {{ ref('stg_iterable__campaign_history') }}\n\n), latest_campaign as (\n select\n *,\n row_number() over(partition by campaign_id{{ fivetran_utils.partition_by_source_relation(package_name='iterable') }} order by updated_at desc) as latest_campaign_index\n from campaign_history\n)\n\nselect *\nfrom latest_campaign\nwhere latest_campaign_index = 1", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__campaign_history", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.fivetran_utils.partition_by_source_relation"], "nodes": ["model.iterable.stg_iterable__campaign_history"]}, "compiled_path": "target/compiled/iterable/models/intermediate/int_iterable__latest_campaign.sql", "compiled": true, "compiled_code": "with campaign_history as (\n select *\n from \"postgres\".\"public_iterable_dev\".\"stg_iterable__campaign_history\"\n\n), latest_campaign as (\n select\n *,\n row_number() over(partition by campaign_id order by updated_at desc) as latest_campaign_index\n from campaign_history\n)\n\nselect *\nfrom latest_campaign\nwhere latest_campaign_index = 1", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.stg_iterable__message_type": {"database": "postgres", "schema": "public_iterable_dev", "name": "stg_iterable__message_type", "resource_type": "model", "package_name": "iterable", "path": "staging/stg_iterable__message_type.sql", "original_file_path": "models/staging/stg_iterable__message_type.sql", "unique_id": "model.iterable.stg_iterable__message_type", "fqn": ["iterable", "staging", "stg_iterable__message_type"], "alias": "stg_iterable__message_type", "checksum": {"name": "sha256", "checksum": "046caf2bcc8a01dd2b8ef46a5dfb52e02b8bebe01e892de5d658910c97d5e6a4"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "table", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "Table containing unique message types.", "columns": {"source_relation": {"name": "source_relation", "description": "Identifies the record's source.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": ["doc.iterable.source_relation"]}, "message_type_id": {"name": "message_type_id", "description": "Unique identifier of the message type", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "message_type_name": {"name": "message_type_name", "description": "User defined name of the message type", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "channel_id": {"name": "channel_id", "description": "Channel that this message type belongs to", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "message_type_created_at": {"name": "message_type_created_at", "description": "Time when the message type was initially created", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "frequency_cap": {"name": "frequency_cap", "description": "The maximum number of times a message of this type can be sent to a recipient within a specified time period to prevent over-messaging", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "rate_limit_per_minute": {"name": "rate_limit_per_minute", "description": "The maximum number of messages of this type that can be sent to recipients in a minute, ensuring controlled message delivery", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "subscription_policy": {"name": "subscription_policy", "description": "Information about the policy or rules governing how users can subscribe to or unsubscribe from this specific message type, like OptOut", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "message_type_updated_at": {"name": "message_type_updated_at", "description": "Time when the message type was last updated or modified", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "The time when a record was last updated by Fivetran.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": ["doc.iterable._fivetran_synced"]}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "iterable://models/staging/stg_iterable.yml", "build_path": null, "unrendered_config": {"materialized": "table", "schema": "iterable_{{ var('directed_schema','dev') }}", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789419973.0037835, "relation_name": "\"postgres\".\"public_iterable_dev\".\"stg_iterable__message_type\"", "raw_code": "with base as (\n\n select * \n from {{ ref('stg_iterable__message_type_tmp') }}\n\n),\n\nfields as (\n\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_iterable/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_iterable/macros/).\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_iterable__message_type_tmp')),\n staging_columns=get_message_type_columns()\n )\n }}\n {{ fivetran_utils.apply_source_relation(package_name='iterable') }}\n\n from base\n),\n\nfinal as (\n\n select\n source_relation,\n cast(id as {{ dbt.type_string() }} ) as message_type_id,\n name as message_type_name,\n cast(channel_id as {{ dbt.type_string() }} ) as channel_id,\n created_at as message_type_created_at,\n frequency_cap,\n rate_limit_per_minute,\n subscription_policy,\n updated_at as message_type_updated_at,\n _fivetran_synced\n from fields\n where not coalesce(_fivetran_deleted, true)\n)\n\nselect * \nfrom final", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__message_type_tmp", "package": null, "version": null}, {"name": "stg_iterable__message_type_tmp", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.iterable.get_message_type_columns", "macro.fivetran_utils.fill_staging_columns", "macro.fivetran_utils.apply_source_relation", "macro.dbt.type_string"], "nodes": ["model.iterable.stg_iterable__message_type_tmp"]}, "compiled_path": "target/compiled/iterable/models/staging/stg_iterable__message_type.sql", "compiled": true, "compiled_code": "with base as (\n\n select * \n from \"postgres\".\"public_iterable_dev\".\"stg_iterable__message_type_tmp\"\n\n),\n\nfields as (\n\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_iterable/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_iterable/macros/).\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n \n _fivetran_deleted as _fivetran_deleted,\n _fivetran_synced as _fivetran_synced,\n channel_id as channel_id,\n id as id,\n name as name,\n created_at as created_at,\n frequency_cap as frequency_cap,\n rate_limit_per_minute as rate_limit_per_minute,\n subscription_policy as subscription_policy,\n updated_at as updated_at\n \n\n\n\n\n \n \n\n\n\n\n\n, cast('postgres.public' as TEXT) as source_relation\n\n\n from base\n),\n\nfinal as (\n\n select\n source_relation,\n cast(id as TEXT ) as message_type_id,\n name as message_type_name,\n cast(channel_id as TEXT ) as channel_id,\n created_at as message_type_created_at,\n frequency_cap,\n rate_limit_per_minute,\n subscription_policy,\n updated_at as message_type_updated_at,\n _fivetran_synced\n from fields\n where not coalesce(_fivetran_deleted, true)\n)\n\nselect * \nfrom final", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.stg_iterable__event": {"database": "postgres", "schema": "public_iterable_dev", "name": "stg_iterable__event", "resource_type": "model", "package_name": "iterable", "path": "staging/stg_iterable__event.sql", "original_file_path": "models/staging/stg_iterable__event.sql", "unique_id": "model.iterable.stg_iterable__event", "fqn": ["iterable", "staging", "stg_iterable__event"], "alias": "stg_iterable__event", "checksum": {"name": "sha256", "checksum": "22ba2d21012d8301984a6fcea5b9f40f9579f5565aaea7417f7458f6fd37937b"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "Table containing individual events within campaigns.", "columns": {"source_relation": {"name": "source_relation", "description": "Identifies the record's source.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": ["doc.iterable.source_relation"]}, "event_id": {"name": "event_id", "description": "A Fivetran-created unique identifier derived from hashing campaign_id, created_at, and event_name.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_event_id": {"name": "unique_event_id", "description": "A surrogate key made up of event_id, _fivetran_user_id, and source_relation.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "campaign_id": {"name": "campaign_id", "description": "Reference to the campaign from which the event originated", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "content_id": {"name": "content_id", "description": "Reference to the content the event is associated with", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "created_at": {"name": "created_at", "description": "Creation timestamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "created_on": {"name": "created_on", "description": "Creation date", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "email": {"name": "email", "description": "Reference to the unique user the event was applied to", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "additional_properties": {"name": "additional_properties", "description": "json object containing addition event properties", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "event_name": {"name": "event_name", "description": "Name provided to the individual event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "message_bus_id": {"name": "message_bus_id", "description": "Reference to the message bus associated with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "message_id": {"name": "message_id", "description": "Reference to the message the event is associated with", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "message_type_id": {"name": "message_type_id", "description": "Reference to the type of message the event is associated with", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "recipient_state": {"name": "recipient_state", "description": "The state of the recipient upon receiving the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "status": {"name": "status", "description": "Status of the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "transactional_data": {"name": "transactional_data", "description": "Transactional data associated with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unsub_source": {"name": "unsub_source", "description": "Source of the unsubscribe event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "user_agent": {"name": "user_agent", "description": "User agent associated with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "user_agent_device": {"name": "user_agent_device", "description": "The device of the user agent", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "_fivetran_user_id": {"name": "_fivetran_user_id", "description": "A Fivetran-created unique identifier for users, derived from hashing user_id and/or email, depending on project type. This exists for users of the new schema starting Aug 2023. In the old schema, the unique identifier is email.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_user_key": {"name": "unique_user_key", "description": "The unique identifier of the user. With the new schema (Aug 2023), it is the _fivetran_user_id. This is a hash of user_id and/or email, depending on project type. If using the old schema, it is email.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "The time when a record was last updated by Fivetran.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": ["doc.iterable._fivetran_synced"]}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "iterable://models/staging/stg_iterable.yml", "build_path": null, "unrendered_config": {"materialized": "view", "schema": "iterable_{{ var('directed_schema','dev') }}", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789419972.996312, "relation_name": "\"postgres\".\"public_iterable_dev\".\"stg_iterable__event\"", "raw_code": "{{ config( materialized = 'view' ) }}\n\nwith base as (\n\n select * \n from {{ ref('stg_iterable__event_tmp') }}\n\n),\n\nfields as (\n\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_iterable/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_iterable/macros/).\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_iterable__event_tmp')),\n staging_columns=get_event_columns()\n )\n }}\n {{ fivetran_utils.apply_source_relation(package_name='iterable') }}\n \n from base\n),\n\nfinal as (\n\n select\n source_relation,\n cast(_fivetran_id as {{ dbt.type_string() }} ) as event_id,\n {{ dbt_utils.generate_surrogate_key(['_fivetran_id','_fivetran_user_id','source_relation']) }} as unique_event_id,\n cast(_fivetran_user_id as {{ dbt.type_string() }} ) as _fivetran_user_id,\n coalesce(cast(_fivetran_user_id as {{ dbt.type_string() }} ) , email) as unique_user_key,\n cast(campaign_id as {{ dbt.type_string() }} ) as campaign_id,\n cast(content_id as {{ dbt.type_string() }} ) as content_id,\n created_at,\n cast( {{ dbt.date_trunc('day', 'created_at') }} as date) as created_on,\n lower(email) as email,\n additional_properties,\n event_name,\n cast(message_bus_id as {{ dbt.type_string() }} ) as message_bus_id,\n cast(message_id as {{ dbt.type_string() }} ) as message_id,\n cast(message_type_id as {{ dbt.type_string() }} ) as message_type_id,\n recipient_state,\n status,\n transactional_data,\n unsub_source,\n user_agent,\n user_agent_device,\n _fivetran_synced\n\n from fields\n)\n\nselect *\nfrom final", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__event_tmp", "package": null, "version": null}, {"name": "stg_iterable__event_tmp", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.iterable.get_event_columns", "macro.fivetran_utils.fill_staging_columns", "macro.fivetran_utils.apply_source_relation", "macro.dbt.type_string", "macro.dbt_utils.generate_surrogate_key", "macro.dbt.date_trunc"], "nodes": ["model.iterable.stg_iterable__event_tmp"]}, "compiled_path": "target/compiled/iterable/models/staging/stg_iterable__event.sql", "compiled": true, "compiled_code": "\n\nwith base as (\n\n select * \n from \"postgres\".\"public_iterable_dev\".\"stg_iterable__event_tmp\"\n\n),\n\nfields as (\n\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_iterable/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_iterable/macros/).\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n \n _fivetran_id as _fivetran_id,\n _fivetran_user_id as _fivetran_user_id,\n _fivetran_synced as _fivetran_synced,\n campaign_id as campaign_id,\n content_id as content_id,\n created_at as created_at,\n email as email,\n event_name as event_name,\n message_bus_id as message_bus_id,\n message_id as message_id,\n message_type_id as message_type_id,\n recipient_state as recipient_state,\n status as status,\n unsub_source as unsub_source,\n user_agent as user_agent,\n user_agent_device as user_agent_device,\n transactional_data as transactional_data,\n additional_properties as additional_properties\n \n\n\n\n\n \n \n\n\n\n\n\n, cast('postgres.public' as TEXT) as source_relation\n\n \n from base\n),\n\nfinal as (\n\n select\n source_relation,\n cast(_fivetran_id as TEXT ) as event_id,\n md5(cast(coalesce(cast(_fivetran_id as TEXT), '_dbt_utils_surrogate_key_null_') || '-' || coalesce(cast(_fivetran_user_id as TEXT), '_dbt_utils_surrogate_key_null_') || '-' || coalesce(cast(source_relation as TEXT), '_dbt_utils_surrogate_key_null_') as TEXT)) as unique_event_id,\n cast(_fivetran_user_id as TEXT ) as _fivetran_user_id,\n coalesce(cast(_fivetran_user_id as TEXT ) , email) as unique_user_key,\n cast(campaign_id as TEXT ) as campaign_id,\n cast(content_id as TEXT ) as content_id,\n created_at,\n cast( date_trunc('day', created_at) as date) as created_on,\n lower(email) as email,\n additional_properties,\n event_name,\n cast(message_bus_id as TEXT ) as message_bus_id,\n cast(message_id as TEXT ) as message_id,\n cast(message_type_id as TEXT ) as message_type_id,\n recipient_state,\n status,\n transactional_data,\n unsub_source,\n user_agent,\n user_agent_device,\n _fivetran_synced\n\n from fields\n)\n\nselect *\nfrom final", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.stg_iterable__user_unsubscribed_channel": {"database": "postgres", "schema": "public_iterable_dev", "name": "stg_iterable__user_unsubscribed_channel", "resource_type": "model", "package_name": "iterable", "path": "staging/stg_iterable__user_unsubscribed_channel.sql", "original_file_path": "models/staging/stg_iterable__user_unsubscribed_channel.sql", "unique_id": "model.iterable.stg_iterable__user_unsubscribed_channel", "fqn": ["iterable", "staging", "stg_iterable__user_unsubscribed_channel"], "alias": "stg_iterable__user_unsubscribed_channel", "checksum": {"name": "sha256", "checksum": "5c639597d14f4bb7072df74e39c2b8aaa7bf1e29c6204243035014d14a0bc6f2"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "table", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "Table containing the history of channels from which a user has unsubscribed.", "columns": {"source_relation": {"name": "source_relation", "description": "Identifies the record's source.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": ["doc.iterable.source_relation"]}, "channel_id": {"name": "channel_id", "description": "Reference to the channel from which the user unsubscribed", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unsub_channel_unique_key": {"name": "unsub_channel_unique_key", "description": "A surrogate key providing a unique key for each record. If using user_unsubscribed_channel_history, it uses '_fivetran_id', 'channel_id', 'email', 'updated_at', and 'source_relation'. If not using the history table, it uses '_fivetran_id', 'channel_id', and 'source_relation'.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "_fivetran_user_id": {"name": "_fivetran_user_id", "description": "A Fivetran-created unique identifier for users, derived from hashing user_id and/or email, depending on project type. This exists for users of the new schema starting Aug 2023. In the old schema, the unique identifier is email.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_user_key": {"name": "unique_user_key", "description": "The unique identifier of the user. With the new schema (Aug 2023), it is the _fivetran_user_id. This is a hash of user_id and/or email, depending on project type. If using the old schema, it is email.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "latest_batch_index": {"name": "latest_batch_index", "description": "Indexes each user record based on the most recent available.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "updated_at": {"name": "updated_at", "description": "Last update timestamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "The time when a record was last updated by Fivetran.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": ["doc.iterable._fivetran_synced"]}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "iterable://models/staging/stg_iterable.yml", "build_path": null, "unrendered_config": {"materialized": "table", "schema": "iterable_{{ var('directed_schema','dev') }}", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789419973.0096774, "relation_name": "\"postgres\".\"public_iterable_dev\".\"stg_iterable__user_unsubscribed_channel\"", "raw_code": "with base as (\n select *\n from {{ ref('stg_iterable__user_unsubscribed_channel_tmp') }}\n\n),\n\nfields as (\n\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_iterable/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_iterable/macros/).\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_iterable__user_unsubscribed_channel_tmp')),\n staging_columns=get_user_unsubscribed_channel_columns()\n )\n }}\n {{ fivetran_utils.apply_source_relation(package_name='iterable') }}\n\n from base\n),\n\nfinal as (\n\n select\n source_relation,\n cast(_fivetran_id as {{ dbt.type_string() }} ) as _fivetran_user_id,\n coalesce(cast(_fivetran_id as {{ dbt.type_string() }} ), email) as unique_user_key,\n cast(channel_id as {{ dbt.type_string() }} ) as channel_id,\n {{ dbt_utils.generate_surrogate_key(['_fivetran_id', 'channel_id', 'email', 'updated_at', 'source_relation']) }} as unsub_channel_unique_key,\n\n {% if does_table_exist('user_unsubscribed_channel') == false %}\n rank() over(partition by email, channel_id{{ fivetran_utils.partition_by_source_relation(package_name='iterable') }} order by updated_at desc) as latest_batch_index,\n {% else %}\n 1 as latest_batch_index,\n {% endif %}\n\n updated_at,\n _fivetran_synced\n\n from fields\n)\n\n\nselect *\nfrom final", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__user_unsubscribed_channel_tmp", "package": null, "version": null}, {"name": "stg_iterable__user_unsubscribed_channel_tmp", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.iterable.get_user_unsubscribed_channel_columns", "macro.fivetran_utils.fill_staging_columns", "macro.fivetran_utils.apply_source_relation", "macro.dbt.type_string", "macro.dbt_utils.generate_surrogate_key", "macro.iterable.does_table_exist"], "nodes": ["model.iterable.stg_iterable__user_unsubscribed_channel_tmp"]}, "compiled_path": "target/compiled/iterable/models/staging/stg_iterable__user_unsubscribed_channel.sql", "compiled": true, "compiled_code": "with base as (\n select *\n from \"postgres\".\"public_iterable_dev\".\"stg_iterable__user_unsubscribed_channel_tmp\"\n\n),\n\nfields as (\n\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_iterable/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_iterable/macros/).\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n \n _fivetran_synced as _fivetran_synced,\n _fivetran_id as _fivetran_id,\n channel_id as channel_id,\n cast(null as TEXT) as email,\n cast(null as timestamp) as updated_at\n \n\n\n\n\n \n \n\n\n\n\n\n, cast('postgres.public' as TEXT) as source_relation\n\n\n from base\n),\n\nfinal as (\n\n select\n source_relation,\n cast(_fivetran_id as TEXT ) as _fivetran_user_id,\n coalesce(cast(_fivetran_id as TEXT ), email) as unique_user_key,\n cast(channel_id as TEXT ) as channel_id,\n md5(cast(coalesce(cast(_fivetran_id as TEXT), '_dbt_utils_surrogate_key_null_') || '-' || coalesce(cast(channel_id as TEXT), '_dbt_utils_surrogate_key_null_') || '-' || coalesce(cast(email as TEXT), '_dbt_utils_surrogate_key_null_') || '-' || coalesce(cast(updated_at as TEXT), '_dbt_utils_surrogate_key_null_') || '-' || coalesce(cast(source_relation as TEXT), '_dbt_utils_surrogate_key_null_') as TEXT)) as unsub_channel_unique_key,\n\n \n 1 as latest_batch_index,\n \n\n updated_at,\n _fivetran_synced\n\n from fields\n)\n\n\nselect *\nfrom final", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.stg_iterable__campaign_history": {"database": "postgres", "schema": "public_iterable_dev", "name": "stg_iterable__campaign_history", "resource_type": "model", "package_name": "iterable", "path": "staging/stg_iterable__campaign_history.sql", "original_file_path": "models/staging/stg_iterable__campaign_history.sql", "unique_id": "model.iterable.stg_iterable__campaign_history", "fqn": ["iterable", "staging", "stg_iterable__campaign_history"], "alias": "stg_iterable__campaign_history", "checksum": {"name": "sha256", "checksum": "7e7aecc134f0b697da58c7cd663aadf6de586a55c84369c2a7274811b2bb368b"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "table", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "Table containing a history of campaigns.", "columns": {"source_relation": {"name": "source_relation", "description": "Identifies the record's source.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": ["doc.iterable.source_relation"]}, "campaign_id": {"name": "campaign_id", "description": "Unique identifier of the campaign record", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "updated_at": {"name": "updated_at", "description": "Last update timestamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "campaign_name": {"name": "campaign_name", "description": "User defined name of the campaign.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "campaign_state": {"name": "campaign_state", "description": "State of the campaign. Can be Draft, Ready, Scheduled, Running, Finished, Starting, Aborted or Recurring", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "campaign_type": {"name": "campaign_type", "description": "The campaign type. Can be Blast or Triggered", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "send_size": {"name": "send_size", "description": "Size of the campaign. Number of individuals included in the campaign", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "start_at": {"name": "start_at", "description": "Start timestamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "ended_at": {"name": "ended_at", "description": "Ended timestamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "created_at": {"name": "created_at", "description": "Creation timestamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "recurring_campaign_id": {"name": "recurring_campaign_id", "description": "Reference to the recurring campaign, if applicable", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "created_by_user_id": {"name": "created_by_user_id", "description": "Reference to the user who created the campaign", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "template_id": {"name": "template_id", "description": "Reference to the campaign template", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "updated_by_user_id": {"name": "updated_by_user_id", "description": "ID of the user who updated this record", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "message_medium": {"name": "message_medium", "description": "The medium that this message was sent via, for example Email or InApp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "workflow_id": {"name": "workflow_id", "description": "Reference to the workflow which the event originated", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "The time when a record was last updated by Fivetran.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": ["doc.iterable._fivetran_synced"]}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "iterable://models/staging/stg_iterable.yml", "build_path": null, "unrendered_config": {"materialized": "table", "schema": "iterable_{{ var('directed_schema','dev') }}", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789419972.9909596, "relation_name": "\"postgres\".\"public_iterable_dev\".\"stg_iterable__campaign_history\"", "raw_code": "with base as (\n\n select * \n from {{ ref('stg_iterable__campaign_history_tmp') }}\n\n),\n\nfields as (\n\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_iterable/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_iterable/macros/).\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_iterable__campaign_history_tmp')),\n staging_columns=get_campaign_history_columns()\n )\n }}\n {{ fivetran_utils.apply_source_relation(package_name='iterable') }}\n \n from base\n),\n\nfinal as (\n\n select\n source_relation,\n cast(id as {{ dbt.type_string() }}) as campaign_id,\n updated_at,\n name as campaign_name,\n campaign_state,\n type as campaign_type,\n send_size,\n start_at,\n ended_at,\n created_at,\n message_medium,\n cast(recurring_campaign_id as {{ dbt.type_string() }}) as recurring_campaign_id,\n cast(created_by_user_id as {{ dbt.type_string() }} ) as created_by_user_id,\n cast(updated_by_user_id as {{ dbt.type_string() }} ) as updated_by_user_id,\n cast(template_id as {{ dbt.type_string() }}) as template_id,\n workflow_id,\n _fivetran_synced\n\n from fields\n)\n\nselect * \nfrom final", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__campaign_history_tmp", "package": null, "version": null}, {"name": "stg_iterable__campaign_history_tmp", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.iterable.get_campaign_history_columns", "macro.fivetran_utils.fill_staging_columns", "macro.fivetran_utils.apply_source_relation", "macro.dbt.type_string"], "nodes": ["model.iterable.stg_iterable__campaign_history_tmp"]}, "compiled_path": "target/compiled/iterable/models/staging/stg_iterable__campaign_history.sql", "compiled": true, "compiled_code": "with base as (\n\n select * \n from \"postgres\".\"public_iterable_dev\".\"stg_iterable__campaign_history_tmp\"\n\n),\n\nfields as (\n\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_iterable/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_iterable/macros/).\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n \n _fivetran_synced as _fivetran_synced,\n campaign_state as campaign_state,\n created_at as created_at,\n created_by_user_id as created_by_user_id,\n updated_by_user_id as updated_by_user_id,\n ended_at as ended_at,\n id as id,\n name as name,\n recurring_campaign_id as recurring_campaign_id,\n send_size as send_size,\n start_at as start_at,\n template_id as template_id,\n type as type,\n updated_at as updated_at,\n workflow_id as workflow_id,\n message_medium as message_medium\n \n\n\n\n\n \n \n\n\n\n\n\n, cast('postgres.public' as TEXT) as source_relation\n\n \n from base\n),\n\nfinal as (\n\n select\n source_relation,\n cast(id as TEXT) as campaign_id,\n updated_at,\n name as campaign_name,\n campaign_state,\n type as campaign_type,\n send_size,\n start_at,\n ended_at,\n created_at,\n message_medium,\n cast(recurring_campaign_id as TEXT) as recurring_campaign_id,\n cast(created_by_user_id as TEXT ) as created_by_user_id,\n cast(updated_by_user_id as TEXT ) as updated_by_user_id,\n cast(template_id as TEXT) as template_id,\n workflow_id,\n _fivetran_synced\n\n from fields\n)\n\nselect * \nfrom final", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.stg_iterable__campaign_label_history": {"database": "postgres", "schema": "public_iterable_dev", "name": "stg_iterable__campaign_label_history", "resource_type": "model", "package_name": "iterable", "path": "staging/stg_iterable__campaign_label_history.sql", "original_file_path": "models/staging/stg_iterable__campaign_label_history.sql", "unique_id": "model.iterable.stg_iterable__campaign_label_history", "fqn": ["iterable", "staging", "stg_iterable__campaign_label_history"], "alias": "stg_iterable__campaign_label_history", "checksum": {"name": "sha256", "checksum": "2001c425039c576063482caa3d4a72f39c5cd8aff32ffee63f083977f1f0c35f"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "table", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "Table containing a history of labels.", "columns": {"source_relation": {"name": "source_relation", "description": "Identifies the record's source.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": ["doc.iterable.source_relation"]}, "campaign_id": {"name": "campaign_id", "description": "Reference to the campaign associated with the label", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "label": {"name": "label", "description": "Name of the label", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "updated_at": {"name": "updated_at", "description": "Last update timestamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "The time when a record was last updated by Fivetran.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": ["doc.iterable._fivetran_synced"]}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "iterable://models/staging/stg_iterable.yml", "build_path": null, "unrendered_config": {"materialized": "table", "schema": "iterable_{{ var('directed_schema','dev') }}", "enabled": "var('iterable__using_campaign_label_history', True)", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789419972.992077, "relation_name": "\"postgres\".\"public_iterable_dev\".\"stg_iterable__campaign_label_history\"", "raw_code": "{{ config(enabled=var('iterable__using_campaign_label_history', True)) }}\n\nwith base as (\n\n select * \n from {{ ref('stg_iterable__campaign_label_history_tmp') }}\n\n),\n\nfields as (\n\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_iterable/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_iterable/macros/).\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_iterable__campaign_label_history_tmp')),\n staging_columns=get_campaign_label_history_columns()\n )\n }}\n {{ fivetran_utils.apply_source_relation(package_name='iterable') }}\n \n from base\n),\n\nfinal as (\n\n select\n source_relation,\n cast(campaign_id as {{ dbt.type_string() }}) as campaign_id,\n label,\n updated_at,\n _fivetran_synced\n from fields\n)\n\nselect * \nfrom final", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__campaign_label_history_tmp", "package": null, "version": null}, {"name": "stg_iterable__campaign_label_history_tmp", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.iterable.get_campaign_label_history_columns", "macro.fivetran_utils.fill_staging_columns", "macro.fivetran_utils.apply_source_relation", "macro.dbt.type_string"], "nodes": ["model.iterable.stg_iterable__campaign_label_history_tmp"]}, "compiled_path": "target/compiled/iterable/models/staging/stg_iterable__campaign_label_history.sql", "compiled": true, "compiled_code": "\n\nwith base as (\n\n select * \n from \"postgres\".\"public_iterable_dev\".\"stg_iterable__campaign_label_history_tmp\"\n\n),\n\nfields as (\n\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_iterable/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_iterable/macros/).\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n \n _fivetran_synced as _fivetran_synced,\n campaign_id as campaign_id,\n label as label,\n updated_at as updated_at\n \n\n\n\n\n \n \n\n\n\n\n\n, cast('postgres.public' as TEXT) as source_relation\n\n \n from base\n),\n\nfinal as (\n\n select\n source_relation,\n cast(campaign_id as TEXT) as campaign_id,\n label,\n updated_at,\n _fivetran_synced\n from fields\n)\n\nselect * \nfrom final", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.stg_iterable__template_history": {"database": "postgres", "schema": "public_iterable_dev", "name": "stg_iterable__template_history", "resource_type": "model", "package_name": "iterable", "path": "staging/stg_iterable__template_history.sql", "original_file_path": "models/staging/stg_iterable__template_history.sql", "unique_id": "model.iterable.stg_iterable__template_history", "fqn": ["iterable", "staging", "stg_iterable__template_history"], "alias": "stg_iterable__template_history", "checksum": {"name": "sha256", "checksum": "f0eaf9d44d7959a04ba079cbf711646772487aeafc89414b097dd5f230b44910"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "table", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "Table containing unique templates used across campaigns.", "columns": {"source_relation": {"name": "source_relation", "description": "Identifies the record's source.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": ["doc.iterable.source_relation"]}, "template_id": {"name": "template_id", "description": "Unique identifier of the template", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "template_name": {"name": "template_name", "description": "User defined name of the template", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "template_type": {"name": "template_type", "description": "The type of the template", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "created_at": {"name": "created_at", "description": "Creation timestamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "client_template_id": {"name": "client_template_id", "description": "Reference to the client template", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "creator_user_id": {"name": "creator_user_id", "description": "Reference to the user who created the template", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "message_type_id": {"name": "message_type_id", "description": "Reference to the message type associated with the template", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "updated_at": {"name": "updated_at", "description": "Last update timestamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "The time when a record was last updated by Fivetran.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": ["doc.iterable._fivetran_synced"]}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "iterable://models/staging/stg_iterable.yml", "build_path": null, "unrendered_config": {"materialized": "table", "schema": "iterable_{{ var('directed_schema','dev') }}", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789419973.0053911, "relation_name": "\"postgres\".\"public_iterable_dev\".\"stg_iterable__template_history\"", "raw_code": "with base as (\n\n select * \n from {{ ref('stg_iterable__template_history_tmp') }}\n\n),\n\nfields as (\n\n select\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_iterable__template_history_tmp')),\n staging_columns=get_template_history_columns()\n )\n }}\n {{ fivetran_utils.apply_source_relation(package_name='iterable') }}\n\n from base\n),\n\nfinal as (\n\n select\n source_relation,\n cast(id as {{ dbt.type_string() }} ) as template_id,\n name as template_name,\n template_type,\n created_at,\n cast(client_template_id as {{ dbt.type_string() }} ) as client_template_id,\n cast(creator_user_id as {{ dbt.type_string() }} ) as creator_user_id,\n cast(message_type_id as {{ dbt.type_string() }} ) as message_type_id,\n updated_at,\n _fivetran_synced\n from fields\n)\n\nselect * \nfrom final", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__template_history_tmp", "package": null, "version": null}, {"name": "stg_iterable__template_history_tmp", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.iterable.get_template_history_columns", "macro.fivetran_utils.fill_staging_columns", "macro.fivetran_utils.apply_source_relation", "macro.dbt.type_string"], "nodes": ["model.iterable.stg_iterable__template_history_tmp"]}, "compiled_path": "target/compiled/iterable/models/staging/stg_iterable__template_history.sql", "compiled": true, "compiled_code": "with base as (\n\n select * \n from \"postgres\".\"public_iterable_dev\".\"stg_iterable__template_history_tmp\"\n\n),\n\nfields as (\n\n select\n \n _fivetran_synced as _fivetran_synced,\n client_template_id as client_template_id,\n created_at as created_at,\n creator_user_id as creator_user_id,\n id as id,\n message_type_id as message_type_id,\n name as name,\n template_type as template_type,\n updated_at as updated_at\n \n\n\n\n\n \n \n\n\n\n\n\n, cast('postgres.public' as TEXT) as source_relation\n\n\n from base\n),\n\nfinal as (\n\n select\n source_relation,\n cast(id as TEXT ) as template_id,\n name as template_name,\n template_type,\n created_at,\n cast(client_template_id as TEXT ) as client_template_id,\n cast(creator_user_id as TEXT ) as creator_user_id,\n cast(message_type_id as TEXT ) as message_type_id,\n updated_at,\n _fivetran_synced\n from fields\n)\n\nselect * \nfrom final", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.stg_iterable__journey": {"database": "postgres", "schema": "public_iterable_dev", "name": "stg_iterable__journey", "resource_type": "model", "package_name": "iterable", "path": "staging/stg_iterable__journey.sql", "original_file_path": "models/staging/stg_iterable__journey.sql", "unique_id": "model.iterable.stg_iterable__journey", "fqn": ["iterable", "staging", "stg_iterable__journey"], "alias": "stg_iterable__journey", "checksum": {"name": "sha256", "checksum": "d53993c3137351b54f560a3e0194593ea0d2787d328e2bc6cfe13977b35a3906"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "table", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "Table containing unique journeys, formerly known as workflows.", "columns": {"source_relation": {"name": "source_relation", "description": "Identifies the record's source.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": ["doc.iterable.source_relation"]}, "journey_id": {"name": "journey_id", "description": "Unique identifier of the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "journey_name": {"name": "journey_name", "description": "User defined name of the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "journey_type": {"name": "journey_type", "description": "The journey type", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "journey_description": {"name": "journey_description", "description": "Information about the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "creator_user_id": {"name": "creator_user_id", "description": "Reference to the user who created the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "is_enabled": {"name": "is_enabled", "description": "Boolean indicating if the journey is currently enabled", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "is_archived": {"name": "is_archived", "description": "Boolean indicating if the journey has been archived", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "lifetime_limit": {"name": "lifetime_limit", "description": "Maximum number of times a user may enter the journey over their lifetime", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "simultaneous_limit": {"name": "simultaneous_limit", "description": "Maximum number of times a user may be in the journey at the same time", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "start_tile_id": {"name": "start_tile_id", "description": "Reference to the tile which begins the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "trigger_event_names": {"name": "trigger_event_names", "description": "The event names which trigger a user's entry into the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "created_at": {"name": "created_at", "description": "Creation timestamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "updated_at": {"name": "updated_at", "description": "Last update timestamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "The time when a record was last updated by Fivetran.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": ["doc.iterable._fivetran_synced"]}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "iterable://models/staging/stg_iterable.yml", "build_path": null, "unrendered_config": {"materialized": "table", "schema": "iterable_{{ var('directed_schema','dev') }}", "enabled": "var('iterable__using_journey', True)", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789419973.0000467, "relation_name": "\"postgres\".\"public_iterable_dev\".\"stg_iterable__journey\"", "raw_code": "{{ config(enabled=var('iterable__using_journey', True)) }}\n\n{% set source_columns_in_relation = adapter.get_columns_in_relation(ref('stg_iterable__journey_tmp')) %}\n\nwith base as (\n\n select *\n from {{ ref('stg_iterable__journey_tmp') }}\n\n),\n\nfields as (\n\n select\n\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=source_columns_in_relation,\n staging_columns=get_journey_columns()\n )\n }}\n {{ fivetran_utils.apply_source_relation(package_name='iterable') }}\n\n from base\n),\n\nfinal as (\n\n select\n source_relation,\n cast(id as {{ dbt.type_string() }} ) as journey_id,\n name as journey_name,\n journey_type,\n description as journey_description,\n cast(creator_user_id as {{ dbt.type_string() }} ) as creator_user_id,\n enabled as is_enabled,\n is_archived,\n lifetime_limit,\n simultaneous_limit,\n cast(start_tile_id as {{ dbt.type_string() }} ) as start_tile_id,\n {{ iterable.json_to_string(\"trigger_event_names\", source_columns_in_relation) }} as trigger_event_names,\n created_at,\n updated_at,\n _fivetran_synced\n\n --The below script allows for pass through columns.\n {{ fivetran_utils.fill_pass_through_columns('iterable_journey_pass_through_columns') }}\n\n from fields\n where not coalesce(_fivetran_deleted, false)\n)\n\nselect *\nfrom final", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__journey_tmp", "package": null, "version": null}, {"name": "stg_iterable__journey_tmp", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.iterable.get_journey_columns", "macro.fivetran_utils.fill_staging_columns", "macro.fivetran_utils.apply_source_relation", "macro.dbt.type_string", "macro.iterable.json_to_string", "macro.fivetran_utils.fill_pass_through_columns"], "nodes": ["model.iterable.stg_iterable__journey_tmp"]}, "compiled_path": "target/compiled/iterable/models/staging/stg_iterable__journey.sql", "compiled": true, "compiled_code": "\n\n\n\nwith base as (\n\n select *\n from \"postgres\".\"public_iterable_dev\".\"stg_iterable__journey_tmp\"\n\n),\n\nfields as (\n\n select\n\n \n _fivetran_deleted as _fivetran_deleted,\n _fivetran_synced as _fivetran_synced,\n created_at as created_at,\n creator_user_id as creator_user_id,\n description as description,\n enabled as enabled,\n id as id,\n is_archived as is_archived,\n journey_type as journey_type,\n lifetime_limit as lifetime_limit,\n name as name,\n simultaneous_limit as simultaneous_limit,\n start_tile_id as start_tile_id,\n trigger_event_names as trigger_event_names,\n updated_at as updated_at\n \n\n\n\n\n \n \n\n\n\n\n\n, cast('postgres.public' as TEXT) as source_relation\n\n\n from base\n),\n\nfinal as (\n\n select\n source_relation,\n cast(id as TEXT ) as journey_id,\n name as journey_name,\n journey_type,\n description as journey_description,\n cast(creator_user_id as TEXT ) as creator_user_id,\n enabled as is_enabled,\n is_archived,\n lifetime_limit,\n simultaneous_limit,\n cast(start_tile_id as TEXT ) as start_tile_id,\n cast(trigger_event_names as TEXT) as trigger_event_names,\n created_at,\n updated_at,\n _fivetran_synced\n\n --The below script allows for pass through columns.\n \n\n\n\n\n\n from fields\n where not coalesce(_fivetran_deleted, false)\n)\n\nselect *\nfrom final", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.stg_iterable__user_history": {"database": "postgres", "schema": "public_iterable_dev", "name": "stg_iterable__user_history", "resource_type": "model", "package_name": "iterable", "path": "staging/stg_iterable__user_history.sql", "original_file_path": "models/staging/stg_iterable__user_history.sql", "unique_id": "model.iterable.stg_iterable__user_history", "fqn": ["iterable", "staging", "stg_iterable__user_history"], "alias": "stg_iterable__user_history", "checksum": {"name": "sha256", "checksum": "632b1ddaf71b0cb861ae314c40c6a68a25371b8646d2fa2334c4eb7149227251"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "Table containing individual user history information.", "columns": {"source_relation": {"name": "source_relation", "description": "Identifies the record's source.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": ["doc.iterable.source_relation"]}, "unique_user_key": {"name": "unique_user_key", "description": "The unique identifier of the user. With the new schema (Aug 2023), it is the _fivetran_user_id. This is a hash of user_id and/or email, depending on project type. If using the old schema, it is email.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "email": {"name": "email", "description": "The user's email. User identifier, for email-based projects. Previously was the unique identifier for user records, for the old Iterable schema before the August 2023 updates.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "user_id": {"name": "user_id", "description": "User identifier, for userID-based projects.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "first_name": {"name": "first_name", "description": "First name of the user", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "last_name": {"name": "last_name", "description": "Last name of the user", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "email_list_ids": {"name": "email_list_ids", "description": "[DEPRECATED October 13, 2025. Use LIST_USER source instead.] Array of references to the lists associated with the user.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "signup_date": {"name": "signup_date", "description": "Timestamp of when the user signed up", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "signup_source": {"name": "signup_source", "description": "Source where the user signed up", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "updated_at": {"name": "updated_at", "description": "Last update timestamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "phone_number": {"name": "phone_number", "description": "Phone number associated with the user", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "iterable_user_id": {"name": "iterable_user_id", "description": "Another user identifier, for userID-based projects", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "_fivetran_user_id": {"name": "_fivetran_user_id", "description": "A Fivetran-created unique identifier for users, derived from hashing user_id and/or email, depending on project type. This exists for users of the new schema starting Aug 2023. In the old schema, the unique identifier is email.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "The time when a record was last updated by Fivetran.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": ["doc.iterable._fivetran_synced"]}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "iterable://models/staging/stg_iterable.yml", "build_path": null, "unrendered_config": {"materialized": "view", "schema": "iterable_{{ var('directed_schema','dev') }}", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789419973.0080664, "relation_name": "\"postgres\".\"public_iterable_dev\".\"stg_iterable__user_history\"", "raw_code": "{{ config(materialized='view') }}\n{% set source_columns_in_relation = adapter.get_columns_in_relation(ref('stg_iterable__user_history_tmp')) %}\n\n\nwith base as (\n\n select * \n from {{ ref('stg_iterable__user_history_tmp') }}\n\n),\n\nfields as (\n\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_iterable/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_iterable/macros/).\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=source_columns_in_relation,\n staging_columns=get_user_history_columns()\n )\n }}\n {{ fivetran_utils.apply_source_relation(package_name='iterable') }}\n\n from base\n),\n\nfinal as (\n\n select\n source_relation,\n cast(_fivetran_id as {{ dbt.type_string() }} ) as _fivetran_user_id,\n lower(email) as email,\n updated_at,\n cast(user_id as {{ dbt.type_string() }} ) as user_id,\n first_name,\n last_name,\n {{ iterable.json_to_string(\"email_list_ids\", source_columns_in_relation) }} as email_list_ids,\n phone_number,\n signup_date,\n signup_source,\n cast(iterable_user_id as {{ dbt.type_string() }} ) as iterable_user_id,\n _fivetran_synced,\n coalesce(cast(_fivetran_id as {{ dbt.type_string() }} ) , email) as unique_user_key\n\n {{ fivetran_utils.fill_pass_through_columns('iterable_user_history_pass_through_columns') }}\n\n from fields\n)\n\nselect *\nfrom final", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__user_history_tmp", "package": null, "version": null}, {"name": "stg_iterable__user_history_tmp", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.iterable.get_user_history_columns", "macro.fivetran_utils.fill_staging_columns", "macro.fivetran_utils.apply_source_relation", "macro.dbt.type_string", "macro.iterable.json_to_string", "macro.fivetran_utils.fill_pass_through_columns"], "nodes": ["model.iterable.stg_iterable__user_history_tmp"]}, "compiled_path": "target/compiled/iterable/models/staging/stg_iterable__user_history.sql", "compiled": true, "compiled_code": "\n\n\n\nwith base as (\n\n select * \n from \"postgres\".\"public_iterable_dev\".\"stg_iterable__user_history_tmp\"\n\n),\n\nfields as (\n\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_iterable/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_iterable/macros/).\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n \n cast(null as TEXT) as _fivetran_id,\n _fivetran_synced as _fivetran_synced,\n email as email,\n email_list_ids as email_list_ids,\n first_name as first_name,\n last_name as last_name,\n phone_number as phone_number,\n signup_date as signup_date,\n signup_source as signup_source,\n updated_at as updated_at,\n user_id as user_id,\n iterable_user_id as iterable_user_id\n \n\n\n\n\n \n \n\n\n\n\n\n, cast('postgres.public' as TEXT) as source_relation\n\n\n from base\n),\n\nfinal as (\n\n select\n source_relation,\n cast(_fivetran_id as TEXT ) as _fivetran_user_id,\n lower(email) as email,\n updated_at,\n cast(user_id as TEXT ) as user_id,\n first_name,\n last_name,\n cast(email_list_ids as TEXT) as email_list_ids,\n phone_number,\n signup_date,\n signup_source,\n cast(iterable_user_id as TEXT ) as iterable_user_id,\n _fivetran_synced,\n coalesce(cast(_fivetran_id as TEXT ) , email) as unique_user_key\n\n \n\n\n\n\n\n from fields\n)\n\nselect *\nfrom final", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.stg_iterable__user_unsub_message_type": {"database": "postgres", "schema": "public_iterable_dev", "name": "stg_iterable__user_unsub_message_type", "resource_type": "model", "package_name": "iterable", "path": "staging/stg_iterable__user_unsub_message_type.sql", "original_file_path": "models/staging/stg_iterable__user_unsub_message_type.sql", "unique_id": "model.iterable.stg_iterable__user_unsub_message_type", "fqn": ["iterable", "staging", "stg_iterable__user_unsub_message_type"], "alias": "stg_iterable__user_unsub_message_type", "checksum": {"name": "sha256", "checksum": "82bd48604365ec4a7a3309f2ce007e169add2c902675e5d1da155edc32a6bb71"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "table", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "Table containing the message types from which a user has unsubscribed. \"Unsubscribed\" is shortened to \"unsub\" for postgres compatibility.", "columns": {"source_relation": {"name": "source_relation", "description": "Identifies the record's source.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": ["doc.iterable.source_relation"]}, "message_type_id": {"name": "message_type_id", "description": "Reference to the message type from which the user unsubscribed", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unsub_message_type_unique_key": {"name": "unsub_message_type_unique_key", "description": "A surrogate key providing a unique key for each record. If using user_unsubscribed_message_type_history, it uses '_fivetran_id', 'email', 'message_type_id', 'updated_at', and 'source_relation'. If not using the history table, it uses '_fivetran_id', 'message_type_id', and 'source_relation'.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "_fivetran_user_id": {"name": "_fivetran_user_id", "description": "A Fivetran-created unique identifier for users, derived from hashing user_id and/or email, depending on project type. This exists for users of the new schema starting Aug 2023. In the old schema, the unique identifier is email.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_user_key": {"name": "unique_user_key", "description": "The unique identifier of the user. With the new schema (Aug 2023), it is the _fivetran_user_id. This is a hash of user_id and/or email, depending on project type. If using the old schema, it is email.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "latest_batch_index": {"name": "latest_batch_index", "description": "Indexes each user record based on the most recent available.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "updated_at": {"name": "updated_at", "description": "Last update timestamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "The time when a record was last updated by Fivetran.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": ["doc.iterable._fivetran_synced"]}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "iterable://models/staging/stg_iterable.yml", "build_path": null, "unrendered_config": {"materialized": "table", "schema": "iterable_{{ var('directed_schema','dev') }}", "enabled": "var('iterable__using_user_unsubscribed_message_type', True)", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789419973.010908, "relation_name": "\"postgres\".\"public_iterable_dev\".\"stg_iterable__user_unsub_message_type\"", "raw_code": "{{ config(enabled=var('iterable__using_user_unsubscribed_message_type', True)) }}\n\nwith base as (\n\n select * \n from {{ ref('stg_iterable__user_unsub_message_type_tmp') }}\n\n),\n\nfields as (\n\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_iterable/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_iterable/macros/).\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_iterable__user_unsub_message_type_tmp')),\n staging_columns=get_user_unsubscribed_message_type_columns()\n )\n }}\n {{ fivetran_utils.apply_source_relation(package_name='iterable') }}\n\n from base\n),\n\nfinal as (\n\n select\n source_relation,\n cast(_fivetran_id as {{ dbt.type_string() }} ) as _fivetran_user_id,\n coalesce(cast(_fivetran_id as {{ dbt.type_string() }} ), email) as unique_user_key,\n cast(message_type_id as {{ dbt.type_string() }} ) as message_type_id,\n {{ dbt_utils.generate_surrogate_key(['_fivetran_id', 'email', 'message_type_id','updated_at','source_relation']) }} as unsub_message_type_unique_key,\n\n {% if does_table_exist('user_unsubscribed_message_type') == false %}\n rank() over(partition by email, message_type_id{{ fivetran_utils.partition_by_source_relation(package_name='iterable') }} order by updated_at desc) as latest_batch_index,\n {% else %}\n 1 as latest_batch_index,\n {% endif %}\n\n updated_at,\n _fivetran_synced\n\n from fields\n)\n\nselect *\nfrom final", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__user_unsub_message_type_tmp", "package": null, "version": null}, {"name": "stg_iterable__user_unsub_message_type_tmp", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.iterable.get_user_unsubscribed_message_type_columns", "macro.fivetran_utils.fill_staging_columns", "macro.fivetran_utils.apply_source_relation", "macro.dbt.type_string", "macro.dbt_utils.generate_surrogate_key", "macro.iterable.does_table_exist"], "nodes": ["model.iterable.stg_iterable__user_unsub_message_type_tmp"]}, "compiled_path": "target/compiled/iterable/models/staging/stg_iterable__user_unsub_message_type.sql", "compiled": true, "compiled_code": "\n\nwith base as (\n\n select * \n from \"postgres\".\"public_iterable_dev\".\"stg_iterable__user_unsub_message_type_tmp\"\n\n),\n\nfields as (\n\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_iterable/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_iterable/macros/).\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n \n _fivetran_synced as _fivetran_synced,\n _fivetran_id as _fivetran_id,\n message_type_id as message_type_id,\n cast(null as TEXT) as email,\n cast(null as timestamp) as updated_at\n \n\n\n\n\n \n \n\n\n\n\n\n, cast('postgres.public' as TEXT) as source_relation\n\n\n from base\n),\n\nfinal as (\n\n select\n source_relation,\n cast(_fivetran_id as TEXT ) as _fivetran_user_id,\n coalesce(cast(_fivetran_id as TEXT ), email) as unique_user_key,\n cast(message_type_id as TEXT ) as message_type_id,\n md5(cast(coalesce(cast(_fivetran_id as TEXT), '_dbt_utils_surrogate_key_null_') || '-' || coalesce(cast(email as TEXT), '_dbt_utils_surrogate_key_null_') || '-' || coalesce(cast(message_type_id as TEXT), '_dbt_utils_surrogate_key_null_') || '-' || coalesce(cast(updated_at as TEXT), '_dbt_utils_surrogate_key_null_') || '-' || coalesce(cast(source_relation as TEXT), '_dbt_utils_surrogate_key_null_') as TEXT)) as unsub_message_type_unique_key,\n\n \n 1 as latest_batch_index,\n \n\n updated_at,\n _fivetran_synced\n\n from fields\n)\n\nselect *\nfrom final", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.stg_iterable__list": {"database": "postgres", "schema": "public_iterable_dev", "name": "stg_iterable__list", "resource_type": "model", "package_name": "iterable", "path": "staging/stg_iterable__list.sql", "original_file_path": "models/staging/stg_iterable__list.sql", "unique_id": "model.iterable.stg_iterable__list", "fqn": ["iterable", "staging", "stg_iterable__list"], "alias": "stg_iterable__list", "checksum": {"name": "sha256", "checksum": "b2a6869e5186282b7f5c8173ecba41c0324c1dc31df78db2418f51f2578eaa21"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "table", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "Table containing users and the lists the users are associated with.", "columns": {"source_relation": {"name": "source_relation", "description": "Identifies the record's source.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": ["doc.iterable.source_relation"]}, "list_id": {"name": "list_id", "description": "Unique identifier of the list", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "list_name": {"name": "list_name", "description": "User defined name of the list", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "list_type": {"name": "list_type", "description": "The list type", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "created_at": {"name": "created_at", "description": "Creation timestamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "list_description": {"name": "list_description", "description": "Information about the list", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "The time when a record was last updated by Fivetran.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": ["doc.iterable._fivetran_synced"]}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "iterable://models/staging/stg_iterable.yml", "build_path": null, "unrendered_config": {"materialized": "table", "schema": "iterable_{{ var('directed_schema','dev') }}", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789419973.0012348, "relation_name": "\"postgres\".\"public_iterable_dev\".\"stg_iterable__list\"", "raw_code": "with base as (\n\n select * \n from {{ ref('stg_iterable__list_tmp') }}\n\n),\n\nfields as (\n\n select\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_iterable__list_tmp')),\n staging_columns=get_list_columns()\n )\n }}\n {{ fivetran_utils.apply_source_relation(package_name='iterable') }}\n \n from base\n),\n\nfinal as (\n\n select\n source_relation,\n id as list_id,\n name as list_name,\n list_type,\n created_at,\n description as list_description,\n _fivetran_synced\n from fields\n where not coalesce(_fivetran_deleted, true)\n)\n\nselect * \nfrom final", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__list_tmp", "package": null, "version": null}, {"name": "stg_iterable__list_tmp", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.iterable.get_list_columns", "macro.fivetran_utils.fill_staging_columns", "macro.fivetran_utils.apply_source_relation"], "nodes": ["model.iterable.stg_iterable__list_tmp"]}, "compiled_path": "target/compiled/iterable/models/staging/stg_iterable__list.sql", "compiled": true, "compiled_code": "with base as (\n\n select * \n from \"postgres\".\"public_iterable_dev\".\"stg_iterable__list_tmp\"\n\n),\n\nfields as (\n\n select\n \n _fivetran_deleted as _fivetran_deleted,\n _fivetran_synced as _fivetran_synced,\n created_at as created_at,\n id as id,\n list_type as list_type,\n description as description,\n name as name\n \n\n\n\n\n \n \n\n\n\n\n\n, cast('postgres.public' as TEXT) as source_relation\n\n \n from base\n),\n\nfinal as (\n\n select\n source_relation,\n id as list_id,\n name as list_name,\n list_type,\n created_at,\n description as list_description,\n _fivetran_synced\n from fields\n where not coalesce(_fivetran_deleted, true)\n)\n\nselect * \nfrom final", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.stg_iterable__list_user": {"database": "postgres", "schema": "public_iterable_dev", "name": "stg_iterable__list_user", "resource_type": "model", "package_name": "iterable", "path": "staging/stg_iterable__list_user.sql", "original_file_path": "models/staging/stg_iterable__list_user.sql", "unique_id": "model.iterable.stg_iterable__list_user", "fqn": ["iterable", "staging", "stg_iterable__list_user"], "alias": "stg_iterable__list_user", "checksum": {"name": "sha256", "checksum": "f3fe66e05562725c91948ac2023c649573560043aa82c03fe93f6232f6600954"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "table", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "Table containing the relationship between users and lists they belong to.", "columns": {"source_relation": {"name": "source_relation", "description": "Identifies the record's source.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": ["doc.iterable.source_relation"]}, "_fivetran_user_id": {"name": "_fivetran_user_id", "description": "Unique identifier of the list-user relationship record, serving as a foreign key to `stg_iterable__user_history._fivetran_id`.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "list_user_index": {"name": "list_user_index", "description": "Index of the record", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "list_id": {"name": "list_id", "description": "Reference to the list that the user belongs to", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "The time when a record was last updated by Fivetran.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": ["doc.iterable._fivetran_synced"]}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "iterable://models/staging/stg_iterable.yml", "build_path": null, "unrendered_config": {"materialized": "table", "schema": "iterable_{{ var('directed_schema','dev') }}", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789419973.0065777, "relation_name": "\"postgres\".\"public_iterable_dev\".\"stg_iterable__list_user\"", "raw_code": "{% set source_columns_in_relation = adapter.get_columns_in_relation(ref('stg_iterable__list_user_tmp')) %}\n\nwith base as (\n\n select *\n from {{ ref('stg_iterable__list_user_tmp') }}\n\n),\n\nfields as (\n\n select\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=source_columns_in_relation,\n staging_columns=get_list_user_columns()\n )\n }}\n {{ fivetran_utils.apply_source_relation(package_name='iterable') }}\n\n from base\n),\n\nfinal as (\n\n select\n source_relation,\n cast(_fivetran_id as {{ dbt.type_string() }} ) as _fivetran_user_id,\n index as list_user_index,\n list_id,\n _fivetran_synced\n\n from fields\n)\n\nselect *\nfrom final", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__list_user_tmp", "package": null, "version": null}, {"name": "stg_iterable__list_user_tmp", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.iterable.get_list_user_columns", "macro.fivetran_utils.fill_staging_columns", "macro.fivetran_utils.apply_source_relation", "macro.dbt.type_string"], "nodes": ["model.iterable.stg_iterable__list_user_tmp"]}, "compiled_path": "target/compiled/iterable/models/staging/stg_iterable__list_user.sql", "compiled": true, "compiled_code": "\n\nwith base as (\n\n select *\n from \"postgres\".\"public_iterable_dev\".\"stg_iterable__list_user_tmp\"\n\n),\n\nfields as (\n\n select\n \n _fivetran_id as _fivetran_id,\n _fivetran_synced as _fivetran_synced,\n index as index,\n list_id as list_id\n \n\n\n\n\n \n \n\n\n\n\n\n, cast('postgres.public' as TEXT) as source_relation\n\n\n from base\n),\n\nfinal as (\n\n select\n source_relation,\n cast(_fivetran_id as TEXT ) as _fivetran_user_id,\n index as list_user_index,\n list_id,\n _fivetran_synced\n\n from fields\n)\n\nselect *\nfrom final", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.stg_iterable__campaign_suppression_list_history": {"database": "postgres", "schema": "public_iterable_dev", "name": "stg_iterable__campaign_suppression_list_history", "resource_type": "model", "package_name": "iterable", "path": "staging/stg_iterable__campaign_suppression_list_history.sql", "original_file_path": "models/staging/stg_iterable__campaign_suppression_list_history.sql", "unique_id": "model.iterable.stg_iterable__campaign_suppression_list_history", "fqn": ["iterable", "staging", "stg_iterable__campaign_suppression_list_history"], "alias": "stg_iterable__campaign_suppression_list_history", "checksum": {"name": "sha256", "checksum": "695d57ff7cf14d55ef6881ee9184e873c2cdc7fd61bfd9fbb0cb3330fe055ae0"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "table", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "Table containing a history of suppression lists.", "columns": {"source_relation": {"name": "source_relation", "description": "Identifies the record's source.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": ["doc.iterable.source_relation"]}, "campaign_id": {"name": "campaign_id", "description": "Reference to the campaign associated with the label", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "suppressed_list_id": {"name": "suppressed_list_id", "description": "Reference to the list used", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "updated_at": {"name": "updated_at", "description": "Last update timestamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "The time when a record was last updated by Fivetran.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": ["doc.iterable._fivetran_synced"]}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "iterable://models/staging/stg_iterable.yml", "build_path": null, "unrendered_config": {"materialized": "table", "schema": "iterable_{{ var('directed_schema','dev') }}", "enabled": "var('iterable__using_campaign_suppression_list_history', True)", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789419972.9940054, "relation_name": "\"postgres\".\"public_iterable_dev\".\"stg_iterable__campaign_suppression_list_history\"", "raw_code": "{{ config(enabled=var('iterable__using_campaign_suppression_list_history', True)) }}\n\nwith base as (\n\n select * \n from {{ ref('stg_iterable__campaign_suppression_list_history_tmp') }}\n\n),\n\nfields as (\n\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_iterable/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_iterable/macros/).\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_iterable__campaign_suppression_list_history_tmp')),\n staging_columns=get_campaign_suppression_list_history_columns()\n )\n }}\n {{ fivetran_utils.apply_source_relation(package_name='iterable') }}\n\n from base\n),\n\nfinal as (\n\n select\n source_relation,\n cast(campaign_id as {{ dbt.type_string() }}) as campaign_id,\n cast(suppressed_list_id as {{ dbt.type_string() }}) as suppressed_list_id,\n updated_at,\n _fivetran_synced\n from fields\n)\n\nselect * \nfrom final", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__campaign_suppression_list_history_tmp", "package": null, "version": null}, {"name": "stg_iterable__campaign_suppression_list_history_tmp", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.iterable.get_campaign_suppression_list_history_columns", "macro.fivetran_utils.fill_staging_columns", "macro.fivetran_utils.apply_source_relation", "macro.dbt.type_string"], "nodes": ["model.iterable.stg_iterable__campaign_suppression_list_history_tmp"]}, "compiled_path": "target/compiled/iterable/models/staging/stg_iterable__campaign_suppression_list_history.sql", "compiled": true, "compiled_code": "\n\nwith base as (\n\n select * \n from \"postgres\".\"public_iterable_dev\".\"stg_iterable__campaign_suppression_list_history_tmp\"\n\n),\n\nfields as (\n\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_iterable/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_iterable/macros/).\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n \n _fivetran_synced as _fivetran_synced,\n campaign_id as campaign_id,\n suppressed_list_id as suppressed_list_id,\n updated_at as updated_at\n \n\n\n\n\n \n \n\n\n\n\n\n, cast('postgres.public' as TEXT) as source_relation\n\n\n from base\n),\n\nfinal as (\n\n select\n source_relation,\n cast(campaign_id as TEXT) as campaign_id,\n cast(suppressed_list_id as TEXT) as suppressed_list_id,\n updated_at,\n _fivetran_synced\n from fields\n)\n\nselect * \nfrom final", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.stg_iterable__event_extension": {"database": "postgres", "schema": "public_iterable_dev", "name": "stg_iterable__event_extension", "resource_type": "model", "package_name": "iterable", "path": "staging/stg_iterable__event_extension.sql", "original_file_path": "models/staging/stg_iterable__event_extension.sql", "unique_id": "model.iterable.stg_iterable__event_extension", "fqn": ["iterable", "staging", "stg_iterable__event_extension"], "alias": "stg_iterable__event_extension", "checksum": {"name": "sha256", "checksum": "006d3abf1fe12ef7312b3f02d07a13a483883e57acfe0fceedb3e6a9f71372ff"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "Table containing addition properties from the event table.", "columns": {"source_relation": {"name": "source_relation", "description": "Identifies the record's source.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": ["doc.iterable.source_relation"]}, "event_id": {"name": "event_id", "description": "A Fivetran-created unique identifier derived from hashing campaign_id, created_at, and event_name.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_event_id": {"name": "unique_event_id", "description": "A surrogate key made up of event_id, _fivetran_user_id, and source_relation.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "is_app_already_running": {"name": "is_app_already_running", "description": "Boolean indicating if the app is currently running or not", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "badge": {"name": "badge", "description": "Badge associated with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "canonical_url_id": {"name": "canonical_url_id", "description": "Reference to the url associated with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "is_content_available": {"name": "is_content_available", "description": "Content available from the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "content_id": {"name": "content_id", "description": "Reference to the content associated with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "device": {"name": "device", "description": "The device associated with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "email_id": {"name": "email_id", "description": "Reference to the email associated with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "email_subject": {"name": "email_subject", "description": "Subject of the email associated with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "experiment_id": {"name": "experiment_id", "description": "Reference to the experiment used if the event is an experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "from_phone_number_id": {"name": "from_phone_number_id", "description": "Reference to the phone number which the event is from", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "from_smssender_id": {"name": "from_smssender_id", "description": "Reference to the sms sender which the event is from", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "link_id": {"name": "link_id", "description": "Reference to the link associated with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "link_url": {"name": "link_url", "description": "Url of the link associated with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "locale": {"name": "locale", "description": "Locale associated with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "payload": {"name": "payload", "description": "Payload resulted from the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "platform_endpoint": {"name": "platform_endpoint", "description": "The specific platform endpoint of the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "push_message": {"name": "push_message", "description": "Boolean indicating if the event is a push message", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "region": {"name": "region", "description": "Region of the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "sms_message": {"name": "sms_message", "description": "Boolean indicating if the event is an sms message", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "to_phone_number": {"name": "to_phone_number", "description": "To phone number associated with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "url": {"name": "url", "description": "Url associated with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "workflow_id": {"name": "workflow_id", "description": "Reference to the workflow which the event originated", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "workflow_name": {"name": "workflow_name", "description": "Name of the workflow which the event originated", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "catalog_collection_count": {"name": "catalog_collection_count", "description": "The count of products or items collected in a catalog associated with the event.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "catalog_lookup_count": {"name": "catalog_lookup_count", "description": "The count of times a catalog was looked up or queried during the event.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "city": {"name": "city", "description": "The city associated with the event, which could be the location of the recipient.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "clicked_url": {"name": "clicked_url", "description": "The URL that was clicked by the recipient in response to the marketing message.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "country": {"name": "country", "description": "The country associated with the event, which could be the location of the recipient.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "error_code": {"name": "error_code", "description": "The error code or message indicating any issues or errors encountered during the event.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "expires_at": {"name": "expires_at", "description": "The date and time when the event or message is set to expire or become invalid.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "from_phone_number": {"name": "from_phone_number", "description": "The phone number from which the SMS message was sent.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "in_app_body": {"name": "in_app_body", "description": "The content or body of an in-app message that was sent as part of the event.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "is_sms_estimation": {"name": "is_sms_estimation", "description": "A boolean indicating whether the SMS message is an estimation or not.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "labels": {"name": "labels", "description": "Any labels or tags associated with the event, which can be used for categorization or organization.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "message_status": {"name": "message_status", "description": "The status of the marketing message, such as sent, delivered, opened, etc.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "mms_send_count": {"name": "mms_send_count", "description": "The count of multimedia messages (MMS) sent as part of the event.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "reason": {"name": "reason", "description": "The reason or cause associated with a specific event or action.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "sms_send_count": {"name": "sms_send_count", "description": "The count of SMS messages sent as part of the event.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "_fivetran_user_id": {"name": "_fivetran_user_id", "description": "A Fivetran-created unique identifier for users, derived from hashing user_id and/or email, depending on project type. This exists for users of the new schema starting Aug 2023. In the old schema, the unique identifier is email.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "The time when a record was last updated by Fivetran.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": ["doc.iterable._fivetran_synced"]}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "iterable://models/staging/stg_iterable.yml", "build_path": null, "unrendered_config": {"materialized": "view", "schema": "iterable_{{ var('directed_schema','dev') }}", "enabled": "var('iterable__using_event_extension', True)", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789419972.9988177, "relation_name": "\"postgres\".\"public_iterable_dev\".\"stg_iterable__event_extension\"", "raw_code": "{{ config(\n enabled=var('iterable__using_event_extension', True),\n materialized='view'\n) }}\n\nwith base as (\n\n select * \n from {{ ref('stg_iterable__event_extension_tmp') }}\n\n),\n\nfields as (\n\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_iterable/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_iterable/macros/).\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_iterable__event_extension_tmp')),\n staging_columns=get_event_extension_columns()\n )\n }}\n {{ fivetran_utils.apply_source_relation(package_name='iterable') }}\n\n from base\n),\n\nfinal as (\n select\n source_relation,\n cast(_fivetran_id as {{ dbt.type_string() }} ) as event_id,\n {{ dbt_utils.generate_surrogate_key(['_fivetran_id','_fivetran_user_id','source_relation']) }} as unique_event_id,\n app_already_running as is_app_already_running,\n badge,\n catalog_collection_count,\n catalog_lookup_count,\n cast(canonical_url_id as {{ dbt.type_string() }} ) as canonical_url_id,\n content_available as is_content_available,\n cast(content_id as {{ dbt.type_string() }} ) as content_id,\n device,\n cast(email_id as {{ dbt.type_string() }}) as email_id,\n email_subject,\n experiment_id,\n from_phone_number_id,\n from_smssender_id,\n cast(link_id as {{ dbt.type_string() }} ) as link_id,\n link_url,\n locale,\n payload,\n platform_endpoint,\n push_message,\n region,\n sms_message,\n to_phone_number,\n url,\n cast(workflow_id as {{ dbt.type_string() }} ) as workflow_id,\n workflow_name,\n city,\n clicked_url,\n country,\n error_code,\n expires_at,\n from_phone_number,\n in_app_body,\n is_sms_estimation,\n labels,\n message_status,\n mms_send_count,\n reason,\n sms_send_count,\n _fivetran_synced,\n cast(_fivetran_user_id as {{ dbt.type_string() }} ) as _fivetran_user_id\n\n --The below script allows for pass through columns.\n {{ fivetran_utils.fill_pass_through_columns('iterable_event_extension_pass_through_columns') }}\n\n from fields\n)\n\nselect *\nfrom final", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__event_extension_tmp", "package": null, "version": null}, {"name": "stg_iterable__event_extension_tmp", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.iterable.get_event_extension_columns", "macro.fivetran_utils.fill_staging_columns", "macro.fivetran_utils.apply_source_relation", "macro.dbt.type_string", "macro.dbt_utils.generate_surrogate_key", "macro.fivetran_utils.fill_pass_through_columns"], "nodes": ["model.iterable.stg_iterable__event_extension_tmp"]}, "compiled_path": "target/compiled/iterable/models/staging/stg_iterable__event_extension.sql", "compiled": true, "compiled_code": "\n\nwith base as (\n\n select * \n from \"postgres\".\"public_iterable_dev\".\"stg_iterable__event_extension_tmp\"\n\n),\n\nfields as (\n\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_iterable/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_iterable/macros/).\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n \n _fivetran_id as _fivetran_id,\n _fivetran_synced as _fivetran_synced,\n app_already_running as app_already_running,\n badge as badge,\n catalog_collection_count as catalog_collection_count,\n catalog_lookup_count as catalog_lookup_count,\n canonical_url_id as canonical_url_id,\n content_available as content_available,\n content_id as content_id,\n device as device,\n email_id as email_id,\n email_subject as email_subject,\n experiment_id as experiment_id,\n from_phone_number_id as from_phone_number_id,\n from_smssender_id as from_smssender_id,\n link_id as link_id,\n link_url as link_url,\n locale as locale,\n payload as payload,\n platform_endpoint as platform_endpoint,\n push_message as push_message,\n region as region,\n sms_message as sms_message,\n to_phone_number as to_phone_number,\n url as url,\n workflow_id as workflow_id,\n workflow_name as workflow_name,\n city as city,\n clicked_url as clicked_url,\n country as country,\n error_code as error_code,\n expires_at as expires_at,\n from_phone_number as from_phone_number,\n in_app_body as in_app_body,\n is_sms_estimation as is_sms_estimation,\n labels as labels,\n message_status as message_status,\n mms_send_count as mms_send_count,\n reason as reason,\n sms_send_count as sms_send_count,\n _fivetran_user_id as _fivetran_user_id\n \n\n\n\n\n \n \n\n\n\n\n\n, cast('postgres.public' as TEXT) as source_relation\n\n\n from base\n),\n\nfinal as (\n select\n source_relation,\n cast(_fivetran_id as TEXT ) as event_id,\n md5(cast(coalesce(cast(_fivetran_id as TEXT), '_dbt_utils_surrogate_key_null_') || '-' || coalesce(cast(_fivetran_user_id as TEXT), '_dbt_utils_surrogate_key_null_') || '-' || coalesce(cast(source_relation as TEXT), '_dbt_utils_surrogate_key_null_') as TEXT)) as unique_event_id,\n app_already_running as is_app_already_running,\n badge,\n catalog_collection_count,\n catalog_lookup_count,\n cast(canonical_url_id as TEXT ) as canonical_url_id,\n content_available as is_content_available,\n cast(content_id as TEXT ) as content_id,\n device,\n cast(email_id as TEXT) as email_id,\n email_subject,\n experiment_id,\n from_phone_number_id,\n from_smssender_id,\n cast(link_id as TEXT ) as link_id,\n link_url,\n locale,\n payload,\n platform_endpoint,\n push_message,\n region,\n sms_message,\n to_phone_number,\n url,\n cast(workflow_id as TEXT ) as workflow_id,\n workflow_name,\n city,\n clicked_url,\n country,\n error_code,\n expires_at,\n from_phone_number,\n in_app_body,\n is_sms_estimation,\n labels,\n message_status,\n mms_send_count,\n reason,\n sms_send_count,\n _fivetran_synced,\n cast(_fivetran_user_id as TEXT ) as _fivetran_user_id\n\n --The below script allows for pass through columns.\n \n\n\n\n\n\n from fields\n)\n\nselect *\nfrom final", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.stg_iterable__campaign_list_history": {"database": "postgres", "schema": "public_iterable_dev", "name": "stg_iterable__campaign_list_history", "resource_type": "model", "package_name": "iterable", "path": "staging/stg_iterable__campaign_list_history.sql", "original_file_path": "models/staging/stg_iterable__campaign_list_history.sql", "unique_id": "model.iterable.stg_iterable__campaign_list_history", "fqn": ["iterable", "staging", "stg_iterable__campaign_list_history"], "alias": "stg_iterable__campaign_list_history", "checksum": {"name": "sha256", "checksum": "c7db9c46a66fec00d9fbd6492c0ea17397ec80a12d85fa2d63b9f04f09c45013"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "table", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "Table containing a history of lists.", "columns": {"source_relation": {"name": "source_relation", "description": "Identifies the record's source.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": ["doc.iterable.source_relation"]}, "campaign_id": {"name": "campaign_id", "description": "Reference to the campaign associated with the label", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "list_id": {"name": "list_id", "description": "Reference to the list used", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "updated_at": {"name": "updated_at", "description": "Last update timestamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "The time when a record was last updated by Fivetran.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": ["doc.iterable._fivetran_synced"]}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "iterable://models/staging/stg_iterable.yml", "build_path": null, "unrendered_config": {"materialized": "table", "schema": "iterable_{{ var('directed_schema','dev') }}", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789419972.99285, "relation_name": "\"postgres\".\"public_iterable_dev\".\"stg_iterable__campaign_list_history\"", "raw_code": "with base as (\n\n select * \n from {{ ref('stg_iterable__campaign_list_history_tmp') }}\n\n),\n\nfields as (\n\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_iterable/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_iterable/macros/).\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_iterable__campaign_list_history_tmp')),\n staging_columns=get_campaign_list_history_columns()\n )\n }}\n {{ fivetran_utils.apply_source_relation(package_name='iterable') }}\n \n from base\n),\n\nfinal as (\n\n select\n source_relation,\n cast(campaign_id as {{ dbt.type_string() }}) as campaign_id,\n cast(list_id as {{ dbt.type_string() }}) as list_id,\n updated_at,\n _fivetran_synced\n from fields\n)\n\nselect * \nfrom final", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__campaign_list_history_tmp", "package": null, "version": null}, {"name": "stg_iterable__campaign_list_history_tmp", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.iterable.get_campaign_list_history_columns", "macro.fivetran_utils.fill_staging_columns", "macro.fivetran_utils.apply_source_relation", "macro.dbt.type_string"], "nodes": ["model.iterable.stg_iterable__campaign_list_history_tmp"]}, "compiled_path": "target/compiled/iterable/models/staging/stg_iterable__campaign_list_history.sql", "compiled": true, "compiled_code": "with base as (\n\n select * \n from \"postgres\".\"public_iterable_dev\".\"stg_iterable__campaign_list_history_tmp\"\n\n),\n\nfields as (\n\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_iterable/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_iterable/macros/).\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n \n _fivetran_synced as _fivetran_synced,\n campaign_id as campaign_id,\n list_id as list_id,\n updated_at as updated_at\n \n\n\n\n\n \n \n\n\n\n\n\n, cast('postgres.public' as TEXT) as source_relation\n\n \n from base\n),\n\nfinal as (\n\n select\n source_relation,\n cast(campaign_id as TEXT) as campaign_id,\n cast(list_id as TEXT) as list_id,\n updated_at,\n _fivetran_synced\n from fields\n)\n\nselect * \nfrom final", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.stg_iterable__channel": {"database": "postgres", "schema": "public_iterable_dev", "name": "stg_iterable__channel", "resource_type": "model", "package_name": "iterable", "path": "staging/stg_iterable__channel.sql", "original_file_path": "models/staging/stg_iterable__channel.sql", "unique_id": "model.iterable.stg_iterable__channel", "fqn": ["iterable", "staging", "stg_iterable__channel"], "alias": "stg_iterable__channel", "checksum": {"name": "sha256", "checksum": "1ade77557691cabd1c65676182adaf401d8dde9ee42a6918d1ea7a124159cbf2"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "table", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "Table containing unique channels.", "columns": {"source_relation": {"name": "source_relation", "description": "Identifies the record's source.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": ["doc.iterable.source_relation"]}, "channel_id": {"name": "channel_id", "description": "Unique identifier of the channel", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "channel_name": {"name": "channel_name", "description": "User defined name of the channel", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "channel_type": {"name": "channel_type", "description": "The channel type", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "message_medium": {"name": "message_medium", "description": "The message medium associated with the channel", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "The time when a record was last updated by Fivetran.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": ["doc.iterable._fivetran_synced"]}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "iterable://models/staging/stg_iterable.yml", "build_path": null, "unrendered_config": {"materialized": "table", "schema": "iterable_{{ var('directed_schema','dev') }}", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789419972.9948025, "relation_name": "\"postgres\".\"public_iterable_dev\".\"stg_iterable__channel\"", "raw_code": "with base as (\n\n select *\n from {{ ref('stg_iterable__channel_tmp') }}\n\n),\n\nfields as (\n\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns\n that are expected/needed (staging_columns from dbt_iterable/models/tmp/) and compares it with columns\n in the source (source_columns from dbt_iterable/macros/).\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_iterable__channel_tmp')),\n staging_columns=get_channel_columns()\n )\n }}\n {{ fivetran_utils.apply_source_relation(package_name='iterable') }}\n\n from base\n\n),\n\nfinal as (\n\n select\n source_relation,\n cast(id as {{ dbt.type_string() }} ) as channel_id,\n name as channel_name,\n channel_type,\n message_medium,\n _fivetran_synced\n\n from fields\n where not coalesce(_fivetran_deleted, false)\n)\n\nselect * \nfrom final", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__channel_tmp", "package": null, "version": null}, {"name": "stg_iterable__channel_tmp", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.iterable.get_channel_columns", "macro.fivetran_utils.fill_staging_columns", "macro.fivetran_utils.apply_source_relation", "macro.dbt.type_string"], "nodes": ["model.iterable.stg_iterable__channel_tmp"]}, "compiled_path": "target/compiled/iterable/models/staging/stg_iterable__channel.sql", "compiled": true, "compiled_code": "with base as (\n\n select *\n from \"postgres\".\"public_iterable_dev\".\"stg_iterable__channel_tmp\"\n\n),\n\nfields as (\n\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns\n that are expected/needed (staging_columns from dbt_iterable/models/tmp/) and compares it with columns\n in the source (source_columns from dbt_iterable/macros/).\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n \n _fivetran_deleted as _fivetran_deleted,\n _fivetran_synced as _fivetran_synced,\n channel_type as channel_type,\n id as id,\n message_medium as message_medium,\n name as name\n \n\n\n\n\n \n \n\n\n\n\n\n, cast('postgres.public' as TEXT) as source_relation\n\n\n from base\n\n),\n\nfinal as (\n\n select\n source_relation,\n cast(id as TEXT ) as channel_id,\n name as channel_name,\n channel_type,\n message_medium,\n _fivetran_synced\n\n from fields\n where not coalesce(_fivetran_deleted, false)\n)\n\nselect * \nfrom final", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.stg_iterable__message_type_tmp": {"database": "postgres", "schema": "public_iterable_dev", "name": "stg_iterable__message_type_tmp", "resource_type": "model", "package_name": "iterable", "path": "staging/tmp/stg_iterable__message_type_tmp.sql", "original_file_path": "models/staging/tmp/stg_iterable__message_type_tmp.sql", "unique_id": "model.iterable.stg_iterable__message_type_tmp", "fqn": ["iterable", "staging", "tmp", "stg_iterable__message_type_tmp"], "alias": "stg_iterable__message_type_tmp", "checksum": {"name": "sha256", "checksum": "fda7a978e7b71b46f37e4878898c6655526f0531d36f74968c7bbb56ec4200e5"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"materialized": "view", "schema": "iterable_{{ var('directed_schema','dev') }}", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789419972.3429694, "relation_name": "\"postgres\".\"public_iterable_dev\".\"stg_iterable__message_type_tmp\"", "raw_code": "{{\n fivetran_utils.union_connections(\n connection_dictionary='iterable_sources',\n single_source_name='iterable',\n single_table_name='message_type'\n )\n}}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["iterable", "message_type"], ["iterable", "message_type"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.fivetran_utils.union_connections"], "nodes": ["source.iterable.iterable.message_type"]}, "compiled_path": "target/compiled/iterable/models/staging/tmp/stg_iterable__message_type_tmp.sql", "compiled": true, "compiled_code": "\n\n\n-- ** Values passed to adapter.get_relation:\n -- full-identifier_var: iterable_message_type_identifier\n -- database: postgres \n -- schema: public\n -- identifier: message_type_data\n\n\n select\n \"id\",\n \"name\",\n \"channel_id\",\n \"_fivetran_deleted\",\n \"_fivetran_synced\",\n \"created_at\",\n \"frequency_cap\",\n \"rate_limit_per_minute\",\n \"subscription_policy\",\n \"updated_at\"\n from \"postgres\".\"public\".\"message_type_data\" as source_table\n\n ", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.stg_iterable__event_extension_tmp": {"database": "postgres", "schema": "public_iterable_dev", "name": "stg_iterable__event_extension_tmp", "resource_type": "model", "package_name": "iterable", "path": "staging/tmp/stg_iterable__event_extension_tmp.sql", "original_file_path": "models/staging/tmp/stg_iterable__event_extension_tmp.sql", "unique_id": "model.iterable.stg_iterable__event_extension_tmp", "fqn": ["iterable", "staging", "tmp", "stg_iterable__event_extension_tmp"], "alias": "stg_iterable__event_extension_tmp", "checksum": {"name": "sha256", "checksum": "09d92da24c5304acbb0f0ebc81fe49e70458d1319cb1c2090f5f9ce0b87ecb29"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"materialized": "view", "schema": "iterable_{{ var('directed_schema','dev') }}", "enabled": "var('iterable__using_event_extension', True)", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789419972.367434, "relation_name": "\"postgres\".\"public_iterable_dev\".\"stg_iterable__event_extension_tmp\"", "raw_code": "{{ config(enabled=var('iterable__using_event_extension', True)) }}\n\n{{\n fivetran_utils.union_connections(\n connection_dictionary='iterable_sources',\n single_source_name='iterable',\n single_table_name='event_extension'\n )\n}}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["iterable", "event_extension"], ["iterable", "event_extension"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.fivetran_utils.union_connections"], "nodes": ["source.iterable.iterable.event_extension"]}, "compiled_path": "target/compiled/iterable/models/staging/tmp/stg_iterable__event_extension_tmp.sql", "compiled": true, "compiled_code": "\n\n\n\n\n-- ** Values passed to adapter.get_relation:\n -- full-identifier_var: iterable_event_extension_identifier\n -- database: postgres \n -- schema: public\n -- identifier: event_extension_data\n\n\n select\n \"_fivetran_id\",\n \"app_already_running\",\n \"badge\",\n \"canonical_url_id\",\n \"content_available\",\n \"content_id\",\n \"device\",\n \"email_id\",\n \"email_subject\",\n \"experiment_id\",\n \"from_phone_number_id\",\n \"from_smssender_id\",\n \"image_url\",\n \"is_ghost_push\",\n \"link_id\",\n \"link_url\",\n \"platform_endpoint\",\n \"push_message\",\n \"region\",\n \"sms_message\",\n \"sound\",\n \"to_phone_number\",\n \"url\",\n \"workflow_id\",\n \"workflow_name\",\n \"locale\",\n \"deeplink_android\",\n \"deeplink_ios\",\n \"payload\",\n \"sms_provider_response_status\",\n \"sms_provider_response_message\",\n \"sms_provider_response_code\",\n \"sms_provider_response_more_info\",\n \"_fivetran_synced\",\n \"catalog_collection_count\",\n \"catalog_lookup_count\",\n \"city\",\n \"clicked_url\",\n \"country\",\n \"error_code\",\n \"expires_at\",\n \"from_phone_number\",\n \"in_app_body\",\n \"is_sms_estimation\",\n \"labels\",\n \"message_context\",\n \"message_status\",\n \"mms_send_count\",\n \"product_recommendation_count\",\n \"proxy_source\",\n \"reason\",\n \"sms_send_count\",\n \"web_push_body\",\n \"web_push_click_action\",\n \"web_push_icon\",\n \"web_push_message\",\n \"_fivetran_user_id\"\n from \"postgres\".\"public\".\"event_extension_data\" as source_table\n\n ", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.stg_iterable__user_unsub_message_type_tmp": {"database": "postgres", "schema": "public_iterable_dev", "name": "stg_iterable__user_unsub_message_type_tmp", "resource_type": "model", "package_name": "iterable", "path": "staging/tmp/stg_iterable__user_unsub_message_type_tmp.sql", "original_file_path": "models/staging/tmp/stg_iterable__user_unsub_message_type_tmp.sql", "unique_id": "model.iterable.stg_iterable__user_unsub_message_type_tmp", "fqn": ["iterable", "staging", "tmp", "stg_iterable__user_unsub_message_type_tmp"], "alias": "stg_iterable__user_unsub_message_type_tmp", "checksum": {"name": "sha256", "checksum": "ddb46e159ed22f011676fbe7e00ba9271a493bc5185d286261ae30fa0b183636"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"materialized": "view", "schema": "iterable_{{ var('directed_schema','dev') }}", "enabled": "var('iterable__using_user_unsubscribed_message_type', True)", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789419972.3760748, "relation_name": "\"postgres\".\"public_iterable_dev\".\"stg_iterable__user_unsub_message_type_tmp\"", "raw_code": "{{ config(enabled=var('iterable__using_user_unsubscribed_message_type', True)) }}\n\n{{\n fivetran_utils.union_connections(\n connection_dictionary='iterable_sources',\n single_source_name='iterable',\n single_table_name='user_unsubscribed_message_type' if does_table_exist('user_unsubscribed_message_type') else 'user_unsubscribed_message_type_history'\n )\n}}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["iterable", "user_unsubscribed_message_type_history"], ["iterable", "user_unsubscribed_message_type_history"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.iterable.does_table_exist", "macro.fivetran_utils.union_connections"], "nodes": ["source.iterable.iterable.user_unsubscribed_message_type_history"]}, "compiled_path": "target/compiled/iterable/models/staging/tmp/stg_iterable__user_unsub_message_type_tmp.sql", "compiled": true, "compiled_code": "\n\n\n\n\n-- ** Values passed to adapter.get_relation:\n -- full-identifier_var: iterable_user_unsubscribed_message_type_identifier\n -- database: postgres \n -- schema: public\n -- identifier: user_unsubscribed_message_type_data\n\n\n select\n \"_fivetran_id\",\n \"message_type_id\",\n \"_fivetran_synced\"\n from \"postgres\".\"public\".\"user_unsubscribed_message_type_data\" as source_table\n\n ", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.stg_iterable__campaign_list_history_tmp": {"database": "postgres", "schema": "public_iterable_dev", "name": "stg_iterable__campaign_list_history_tmp", "resource_type": "model", "package_name": "iterable", "path": "staging/tmp/stg_iterable__campaign_list_history_tmp.sql", "original_file_path": "models/staging/tmp/stg_iterable__campaign_list_history_tmp.sql", "unique_id": "model.iterable.stg_iterable__campaign_list_history_tmp", "fqn": ["iterable", "staging", "tmp", "stg_iterable__campaign_list_history_tmp"], "alias": "stg_iterable__campaign_list_history_tmp", "checksum": {"name": "sha256", "checksum": "c26b6a07e1d280b2d5dea6ddbff02200d527e798d8af0a8105be30c0e7d013f7"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"materialized": "view", "schema": "iterable_{{ var('directed_schema','dev') }}", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789419972.3849025, "relation_name": "\"postgres\".\"public_iterable_dev\".\"stg_iterable__campaign_list_history_tmp\"", "raw_code": "{{\n fivetran_utils.union_connections(\n connection_dictionary='iterable_sources',\n single_source_name='iterable',\n single_table_name='campaign_list_history'\n )\n}}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["iterable", "campaign_list_history"], ["iterable", "campaign_list_history"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.fivetran_utils.union_connections"], "nodes": ["source.iterable.iterable.campaign_list_history"]}, "compiled_path": "target/compiled/iterable/models/staging/tmp/stg_iterable__campaign_list_history_tmp.sql", "compiled": true, "compiled_code": "\n\n\n-- ** Values passed to adapter.get_relation:\n -- full-identifier_var: iterable_campaign_list_history_identifier\n -- database: postgres \n -- schema: public\n -- identifier: campaign_list_history_data\n\n\n select\n \"list_id\",\n \"campaign_id\",\n \"updated_at\",\n \"_fivetran_synced\"\n from \"postgres\".\"public\".\"campaign_list_history_data\" as source_table\n\n ", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.stg_iterable__list_user_tmp": {"database": "postgres", "schema": "public_iterable_dev", "name": "stg_iterable__list_user_tmp", "resource_type": "model", "package_name": "iterable", "path": "staging/tmp/stg_iterable__list_user_tmp.sql", "original_file_path": "models/staging/tmp/stg_iterable__list_user_tmp.sql", "unique_id": "model.iterable.stg_iterable__list_user_tmp", "fqn": ["iterable", "staging", "tmp", "stg_iterable__list_user_tmp"], "alias": "stg_iterable__list_user_tmp", "checksum": {"name": "sha256", "checksum": "5c8b455013c26cfd4094b38e210edeb911a22dc0f05544e65fb48c350c2725fe"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"materialized": "view", "schema": "iterable_{{ var('directed_schema','dev') }}", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789419972.392174, "relation_name": "\"postgres\".\"public_iterable_dev\".\"stg_iterable__list_user_tmp\"", "raw_code": "{{\n fivetran_utils.union_connections(\n connection_dictionary='iterable_sources',\n single_source_name='iterable',\n single_table_name='list_user'\n )\n}}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["iterable", "list_user"], ["iterable", "list_user"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.fivetran_utils.union_connections"], "nodes": ["source.iterable.iterable.list_user"]}, "compiled_path": "target/compiled/iterable/models/staging/tmp/stg_iterable__list_user_tmp.sql", "compiled": true, "compiled_code": "\n\n\n-- ** Values passed to adapter.get_relation:\n -- full-identifier_var: iterable_list_user_identifier\n -- database: postgres \n -- schema: public\n -- identifier: list_user_data\n\n\n select\n \"_fivetran_id\",\n \"index\",\n \"list_id\",\n \"_fivetran_synced\"\n from \"postgres\".\"public\".\"list_user_data\" as source_table\n\n ", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.stg_iterable__user_history_tmp": {"database": "postgres", "schema": "public_iterable_dev", "name": "stg_iterable__user_history_tmp", "resource_type": "model", "package_name": "iterable", "path": "staging/tmp/stg_iterable__user_history_tmp.sql", "original_file_path": "models/staging/tmp/stg_iterable__user_history_tmp.sql", "unique_id": "model.iterable.stg_iterable__user_history_tmp", "fqn": ["iterable", "staging", "tmp", "stg_iterable__user_history_tmp"], "alias": "stg_iterable__user_history_tmp", "checksum": {"name": "sha256", "checksum": "cc04d0fbef9ff5cd4f72ae66c9cffd316c5e134ecd81dc216dcf682b34eb587b"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"materialized": "view", "schema": "iterable_{{ var('directed_schema','dev') }}", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789419972.4000025, "relation_name": "\"postgres\".\"public_iterable_dev\".\"stg_iterable__user_history_tmp\"", "raw_code": "{{\n fivetran_utils.union_connections(\n connection_dictionary='iterable_sources',\n single_source_name='iterable',\n single_table_name='user_history'\n )\n}}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["iterable", "user_history"], ["iterable", "user_history"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.fivetran_utils.union_connections"], "nodes": ["source.iterable.iterable.user_history"]}, "compiled_path": "target/compiled/iterable/models/staging/tmp/stg_iterable__user_history_tmp.sql", "compiled": true, "compiled_code": "\n\n\n-- ** Values passed to adapter.get_relation:\n -- full-identifier_var: iterable_user_history_identifier\n -- database: postgres \n -- schema: public\n -- identifier: user_history_data\n\n\n select\n \"email\",\n \"updated_at\",\n \"first_name\",\n \"last_name\",\n \"phone_number\",\n \"user_id\",\n \"signup_date\",\n \"signup_source\",\n \"phone_number_carrier\",\n \"phone_number_country_code_iso\",\n \"phone_number_line_type\",\n \"phone_number_updated_at\",\n \"_fivetran_synced\",\n \"email_list_ids\",\n \"iterable_user_id\"\n from \"postgres\".\"public\".\"user_history_data\" as source_table\n\n ", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.stg_iterable__campaign_history_tmp": {"database": "postgres", "schema": "public_iterable_dev", "name": "stg_iterable__campaign_history_tmp", "resource_type": "model", "package_name": "iterable", "path": "staging/tmp/stg_iterable__campaign_history_tmp.sql", "original_file_path": "models/staging/tmp/stg_iterable__campaign_history_tmp.sql", "unique_id": "model.iterable.stg_iterable__campaign_history_tmp", "fqn": ["iterable", "staging", "tmp", "stg_iterable__campaign_history_tmp"], "alias": "stg_iterable__campaign_history_tmp", "checksum": {"name": "sha256", "checksum": "a37ade72efad4e5d8b38cc0548f4a4c79d38a4a337ce71f236581bda47f94696"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"materialized": "view", "schema": "iterable_{{ var('directed_schema','dev') }}", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789419972.4069493, "relation_name": "\"postgres\".\"public_iterable_dev\".\"stg_iterable__campaign_history_tmp\"", "raw_code": "{{\n fivetran_utils.union_connections(\n connection_dictionary='iterable_sources',\n single_source_name='iterable',\n single_table_name='campaign_history'\n )\n}}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["iterable", "campaign_history"], ["iterable", "campaign_history"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.fivetran_utils.union_connections"], "nodes": ["source.iterable.iterable.campaign_history"]}, "compiled_path": "target/compiled/iterable/models/staging/tmp/stg_iterable__campaign_history_tmp.sql", "compiled": true, "compiled_code": "\n\n\n-- ** Values passed to adapter.get_relation:\n -- full-identifier_var: iterable_campaign_history_identifier\n -- database: postgres \n -- schema: public\n -- identifier: campaign_history_data\n\n\n select\n \"id\",\n \"updated_at\",\n \"template_id\",\n \"recurring_campaign_id\",\n \"campaign_state\",\n \"created_at\",\n \"created_by_user_id\",\n \"ended_at\",\n \"name\",\n \"send_size\",\n \"start_at\",\n \"type\",\n \"workflow_id\",\n \"_fivetran_synced\",\n \"updated_by_user_id\",\n \"message_medium\"\n from \"postgres\".\"public\".\"campaign_history_data\" as source_table\n\n ", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.stg_iterable__template_history_tmp": {"database": "postgres", "schema": "public_iterable_dev", "name": "stg_iterable__template_history_tmp", "resource_type": "model", "package_name": "iterable", "path": "staging/tmp/stg_iterable__template_history_tmp.sql", "original_file_path": "models/staging/tmp/stg_iterable__template_history_tmp.sql", "unique_id": "model.iterable.stg_iterable__template_history_tmp", "fqn": ["iterable", "staging", "tmp", "stg_iterable__template_history_tmp"], "alias": "stg_iterable__template_history_tmp", "checksum": {"name": "sha256", "checksum": "b37299e696c1cd6388ad85a4042f9b8a5364b969e7c4fdb42f03e4c4803e9a7f"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"materialized": "view", "schema": "iterable_{{ var('directed_schema','dev') }}", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789419972.4137557, "relation_name": "\"postgres\".\"public_iterable_dev\".\"stg_iterable__template_history_tmp\"", "raw_code": "{{\n fivetran_utils.union_connections(\n connection_dictionary='iterable_sources',\n single_source_name='iterable',\n single_table_name='template_history'\n )\n}}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["iterable", "template_history"], ["iterable", "template_history"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.fivetran_utils.union_connections"], "nodes": ["source.iterable.iterable.template_history"]}, "compiled_path": "target/compiled/iterable/models/staging/tmp/stg_iterable__template_history_tmp.sql", "compiled": true, "compiled_code": "\n\n\n-- ** Values passed to adapter.get_relation:\n -- full-identifier_var: iterable_template_history_identifier\n -- database: postgres \n -- schema: public\n -- identifier: template_history_data\n\n\n select\n \"id\",\n \"updated_at\",\n \"message_type_id\",\n \"client_template_id\",\n \"created_at\",\n \"creator_user_id\",\n \"name\",\n \"template_type\",\n \"_fivetran_synced\"\n from \"postgres\".\"public\".\"template_history_data\" as source_table\n\n ", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.stg_iterable__event_tmp": {"database": "postgres", "schema": "public_iterable_dev", "name": "stg_iterable__event_tmp", "resource_type": "model", "package_name": "iterable", "path": "staging/tmp/stg_iterable__event_tmp.sql", "original_file_path": "models/staging/tmp/stg_iterable__event_tmp.sql", "unique_id": "model.iterable.stg_iterable__event_tmp", "fqn": ["iterable", "staging", "tmp", "stg_iterable__event_tmp"], "alias": "stg_iterable__event_tmp", "checksum": {"name": "sha256", "checksum": "31555eb22bfca797c1f1a4f1503da21f7620762d199e7e32b2d268c03e139f65"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"materialized": "view", "schema": "iterable_{{ var('directed_schema','dev') }}", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789419972.420351, "relation_name": "\"postgres\".\"public_iterable_dev\".\"stg_iterable__event_tmp\"", "raw_code": "{{\n fivetran_utils.union_connections(\n connection_dictionary='iterable_sources',\n single_source_name='iterable',\n single_table_name='event'\n )\n}}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["iterable", "event"], ["iterable", "event"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.fivetran_utils.union_connections"], "nodes": ["source.iterable.iterable.event"]}, "compiled_path": "target/compiled/iterable/models/staging/tmp/stg_iterable__event_tmp.sql", "compiled": true, "compiled_code": "\n\n\n-- ** Values passed to adapter.get_relation:\n -- full-identifier_var: iterable_event_identifier\n -- database: postgres \n -- schema: public\n -- identifier: event_data\n\n\n select\n \"_fivetran_id\",\n \"email\",\n \"campaign_id\",\n \"message_id\",\n \"content_id\",\n \"created_at\",\n \"event_name\",\n \"ip\",\n \"message_bus_id\",\n \"message_type_id\",\n \"recipient_state\",\n \"status\",\n \"unsub_source\",\n \"user_agent\",\n \"user_agent_device\",\n \"transactional_data\",\n \"additional_properties\",\n \"_fivetran_synced\",\n \"_fivetran_user_id\"\n from \"postgres\".\"public\".\"event_data\" as source_table\n\n ", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.stg_iterable__journey_tmp": {"database": "postgres", "schema": "public_iterable_dev", "name": "stg_iterable__journey_tmp", "resource_type": "model", "package_name": "iterable", "path": "staging/tmp/stg_iterable__journey_tmp.sql", "original_file_path": "models/staging/tmp/stg_iterable__journey_tmp.sql", "unique_id": "model.iterable.stg_iterable__journey_tmp", "fqn": ["iterable", "staging", "tmp", "stg_iterable__journey_tmp"], "alias": "stg_iterable__journey_tmp", "checksum": {"name": "sha256", "checksum": "9e10fed335359755ce1488a7df46c9bfd4a08b029e757c4e81c8c2f8cce28961"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"materialized": "view", "schema": "iterable_{{ var('directed_schema','dev') }}", "enabled": "var('iterable__using_journey', True)", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789419972.4271295, "relation_name": "\"postgres\".\"public_iterable_dev\".\"stg_iterable__journey_tmp\"", "raw_code": "{{ config(enabled=var('iterable__using_journey', True)) }}\n\n{{\n fivetran_utils.union_connections(\n connection_dictionary='iterable_sources',\n single_source_name='iterable',\n single_table_name='journey'\n )\n}}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["iterable", "journey"], ["iterable", "journey"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.fivetran_utils.union_connections"], "nodes": ["source.iterable.iterable.journey"]}, "compiled_path": "target/compiled/iterable/models/staging/tmp/stg_iterable__journey_tmp.sql", "compiled": true, "compiled_code": "\n\n\n\n\n-- ** Values passed to adapter.get_relation:\n -- full-identifier_var: iterable_journey_identifier\n -- database: postgres \n -- schema: public\n -- identifier: journey_data\n\n\n select\n \"id\",\n \"name\",\n \"journey_type\",\n \"description\",\n \"creator_user_id\",\n \"enabled\",\n \"is_archived\",\n \"lifetime_limit\",\n \"simultaneous_limit\",\n \"start_tile_id\",\n \"trigger_event_names\",\n \"created_at\",\n \"updated_at\",\n \"_fivetran_deleted\",\n \"_fivetran_synced\",\n \"draft_name\"\n from \"postgres\".\"public\".\"journey_data\" as source_table\n\n ", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.stg_iterable__campaign_suppression_list_history_tmp": {"database": "postgres", "schema": "public_iterable_dev", "name": "stg_iterable__campaign_suppression_list_history_tmp", "resource_type": "model", "package_name": "iterable", "path": "staging/tmp/stg_iterable__campaign_suppression_list_history_tmp.sql", "original_file_path": "models/staging/tmp/stg_iterable__campaign_suppression_list_history_tmp.sql", "unique_id": "model.iterable.stg_iterable__campaign_suppression_list_history_tmp", "fqn": ["iterable", "staging", "tmp", "stg_iterable__campaign_suppression_list_history_tmp"], "alias": "stg_iterable__campaign_suppression_list_history_tmp", "checksum": {"name": "sha256", "checksum": "3c5a325cac70574f2defa9fa09b436c03a3fe8a3dede5729ca95451b410d636c"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"materialized": "view", "schema": "iterable_{{ var('directed_schema','dev') }}", "enabled": "var('iterable__using_campaign_suppression_list_history', True)", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789419972.434969, "relation_name": "\"postgres\".\"public_iterable_dev\".\"stg_iterable__campaign_suppression_list_history_tmp\"", "raw_code": "{{ config(enabled=var('iterable__using_campaign_suppression_list_history', True)) }}\n\n{{\n fivetran_utils.union_connections(\n connection_dictionary='iterable_sources',\n single_source_name='iterable',\n single_table_name='campaign_suppression_list_history'\n )\n}}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["iterable", "campaign_suppression_list_history"], ["iterable", "campaign_suppression_list_history"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.fivetran_utils.union_connections"], "nodes": ["source.iterable.iterable.campaign_suppression_list_history"]}, "compiled_path": "target/compiled/iterable/models/staging/tmp/stg_iterable__campaign_suppression_list_history_tmp.sql", "compiled": true, "compiled_code": "\n\n\n\n\n-- ** Values passed to adapter.get_relation:\n -- full-identifier_var: iterable_campaign_suppression_list_history_identifier\n -- database: postgres \n -- schema: public\n -- identifier: campaign_suppression_list_history_data\n\n\n select\n \"suppressed_list_id\",\n \"campaign_id\",\n \"updated_at\",\n \"_fivetran_synced\"\n from \"postgres\".\"public\".\"campaign_suppression_list_history_data\" as source_table\n\n ", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.stg_iterable__campaign_label_history_tmp": {"database": "postgres", "schema": "public_iterable_dev", "name": "stg_iterable__campaign_label_history_tmp", "resource_type": "model", "package_name": "iterable", "path": "staging/tmp/stg_iterable__campaign_label_history_tmp.sql", "original_file_path": "models/staging/tmp/stg_iterable__campaign_label_history_tmp.sql", "unique_id": "model.iterable.stg_iterable__campaign_label_history_tmp", "fqn": ["iterable", "staging", "tmp", "stg_iterable__campaign_label_history_tmp"], "alias": "stg_iterable__campaign_label_history_tmp", "checksum": {"name": "sha256", "checksum": "08e70c9938c895459cabba65b1992d360775e26ea2b8275e408bcf21e814bd58"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"materialized": "view", "schema": "iterable_{{ var('directed_schema','dev') }}", "enabled": "var('iterable__using_campaign_label_history', True)", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789419972.4428432, "relation_name": "\"postgres\".\"public_iterable_dev\".\"stg_iterable__campaign_label_history_tmp\"", "raw_code": "{{ config(enabled=var('iterable__using_campaign_label_history', True)) }}\n\n{{\n fivetran_utils.union_connections(\n connection_dictionary='iterable_sources',\n single_source_name='iterable',\n single_table_name='campaign_label_history'\n )\n}}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["iterable", "campaign_label_history"], ["iterable", "campaign_label_history"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.fivetran_utils.union_connections"], "nodes": ["source.iterable.iterable.campaign_label_history"]}, "compiled_path": "target/compiled/iterable/models/staging/tmp/stg_iterable__campaign_label_history_tmp.sql", "compiled": true, "compiled_code": "\n\n\n\n\n-- ** Values passed to adapter.get_relation:\n -- full-identifier_var: iterable_campaign_label_history_identifier\n -- database: postgres \n -- schema: public\n -- identifier: campaign_label_history_data\n\n\n select\n \"campaign_id\",\n \"label\",\n \"updated_at\",\n \"_fivetran_synced\"\n from \"postgres\".\"public\".\"campaign_label_history_data\" as source_table\n\n ", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.stg_iterable__list_tmp": {"database": "postgres", "schema": "public_iterable_dev", "name": "stg_iterable__list_tmp", "resource_type": "model", "package_name": "iterable", "path": "staging/tmp/stg_iterable__list_tmp.sql", "original_file_path": "models/staging/tmp/stg_iterable__list_tmp.sql", "unique_id": "model.iterable.stg_iterable__list_tmp", "fqn": ["iterable", "staging", "tmp", "stg_iterable__list_tmp"], "alias": "stg_iterable__list_tmp", "checksum": {"name": "sha256", "checksum": "95fbbf63205ef9000c19e76270c8ab96e23c4f9d8072f3892a08f20648a42b5a"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"materialized": "view", "schema": "iterable_{{ var('directed_schema','dev') }}", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789419972.4504495, "relation_name": "\"postgres\".\"public_iterable_dev\".\"stg_iterable__list_tmp\"", "raw_code": "{{\n fivetran_utils.union_connections(\n connection_dictionary='iterable_sources',\n single_source_name='iterable',\n single_table_name='list'\n )\n}}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["iterable", "list"], ["iterable", "list"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.fivetran_utils.union_connections"], "nodes": ["source.iterable.iterable.list"]}, "compiled_path": "target/compiled/iterable/models/staging/tmp/stg_iterable__list_tmp.sql", "compiled": true, "compiled_code": "\n\n\n-- ** Values passed to adapter.get_relation:\n -- full-identifier_var: iterable_list_identifier\n -- database: postgres \n -- schema: public\n -- identifier: list_data\n\n\n select\n \"id\",\n \"name\",\n \"created_at\",\n \"list_type\",\n \"_fivetran_deleted\",\n \"_fivetran_synced\",\n \"description\"\n from \"postgres\".\"public\".\"list_data\" as source_table\n\n ", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.stg_iterable__channel_tmp": {"database": "postgres", "schema": "public_iterable_dev", "name": "stg_iterable__channel_tmp", "resource_type": "model", "package_name": "iterable", "path": "staging/tmp/stg_iterable__channel_tmp.sql", "original_file_path": "models/staging/tmp/stg_iterable__channel_tmp.sql", "unique_id": "model.iterable.stg_iterable__channel_tmp", "fqn": ["iterable", "staging", "tmp", "stg_iterable__channel_tmp"], "alias": "stg_iterable__channel_tmp", "checksum": {"name": "sha256", "checksum": "0516bc3567b725378b33829b8c3e7dc1b6680922f2d1e7824a913b82ca617905"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"materialized": "view", "schema": "iterable_{{ var('directed_schema','dev') }}", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789419972.457246, "relation_name": "\"postgres\".\"public_iterable_dev\".\"stg_iterable__channel_tmp\"", "raw_code": "{{\n fivetran_utils.union_connections(\n connection_dictionary='iterable_sources',\n single_source_name='iterable',\n single_table_name='channel'\n )\n}}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["iterable", "channel"], ["iterable", "channel"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.fivetran_utils.union_connections"], "nodes": ["source.iterable.iterable.channel"]}, "compiled_path": "target/compiled/iterable/models/staging/tmp/stg_iterable__channel_tmp.sql", "compiled": true, "compiled_code": "\n\n\n-- ** Values passed to adapter.get_relation:\n -- full-identifier_var: iterable_channel_identifier\n -- database: postgres \n -- schema: public\n -- identifier: channel_data\n\n\n select\n \"id\",\n \"name\",\n \"channel_type\",\n \"message_medium\",\n \"_fivetran_deleted\",\n \"_fivetran_synced\"\n from \"postgres\".\"public\".\"channel_data\" as source_table\n\n ", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.stg_iterable__user_unsubscribed_channel_tmp": {"database": "postgres", "schema": "public_iterable_dev", "name": "stg_iterable__user_unsubscribed_channel_tmp", "resource_type": "model", "package_name": "iterable", "path": "staging/tmp/stg_iterable__user_unsubscribed_channel_tmp.sql", "original_file_path": "models/staging/tmp/stg_iterable__user_unsubscribed_channel_tmp.sql", "unique_id": "model.iterable.stg_iterable__user_unsubscribed_channel_tmp", "fqn": ["iterable", "staging", "tmp", "stg_iterable__user_unsubscribed_channel_tmp"], "alias": "stg_iterable__user_unsubscribed_channel_tmp", "checksum": {"name": "sha256", "checksum": "a8d43331a84f0d1dae8511478d01cded7dfb389fef925f7173f50eb6b6b9c142"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"materialized": "view", "schema": "iterable_{{ var('directed_schema','dev') }}", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789419972.4644868, "relation_name": "\"postgres\".\"public_iterable_dev\".\"stg_iterable__user_unsubscribed_channel_tmp\"", "raw_code": "{{\n fivetran_utils.union_connections(\n connection_dictionary='iterable_sources',\n single_source_name='iterable',\n single_table_name='user_unsubscribed_channel' if does_table_exist('user_unsubscribed_channel') else 'user_unsubscribed_channel_history'\n )\n}}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["iterable", "user_unsubscribed_channel_history"], ["iterable", "user_unsubscribed_channel_history"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.iterable.does_table_exist", "macro.fivetran_utils.union_connections"], "nodes": ["source.iterable.iterable.user_unsubscribed_channel_history"]}, "compiled_path": "target/compiled/iterable/models/staging/tmp/stg_iterable__user_unsubscribed_channel_tmp.sql", "compiled": true, "compiled_code": "\n\n\n-- ** Values passed to adapter.get_relation:\n -- full-identifier_var: iterable_user_unsubscribed_channel_identifier\n -- database: postgres \n -- schema: public\n -- identifier: user_unsubscribed_channel_data\n\n\n select\n \"_fivetran_id\",\n \"channel_id\",\n \"_fivetran_synced\"\n from \"postgres\".\"public\".\"user_unsubscribed_channel_data\" as source_table\n\n ", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "test.iterable.not_null_iterable__campaigns_campaign_id.03c9448919": {"database": "postgres", "schema": "public_dbt_test__audit", "name": "not_null_iterable__campaigns_campaign_id", "resource_type": "test", "package_name": "iterable", "path": "not_null_iterable__campaigns_campaign_id.sql", "original_file_path": "models/iterable.yml", "unique_id": "test.iterable.not_null_iterable__campaigns_campaign_id.03c9448919", "fqn": ["iterable", "not_null_iterable__campaigns_campaign_id"], "alias": "not_null_iterable__campaigns_campaign_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "sql_header": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {}, "created_at": 1789419972.965412, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "iterable__campaigns", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.iterable.iterable__campaigns"]}, "compiled_path": "target/compiled/iterable/models/iterable.yml/not_null_iterable__campaigns_campaign_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect campaign_id\nfrom \"postgres\".\"public_iterable_dev\".\"iterable__campaigns\"\nwhere campaign_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "campaign_id", "file_key_name": "models.iterable__campaigns", "attached_node": "model.iterable.iterable__campaigns", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "campaign_id", "model": "{{ get_where_subquery(ref('iterable__campaigns')) }}"}, "namespace": null}}, "test.iterable.not_null_iterable__events_event_id.ed1d28a650": {"database": "postgres", "schema": "public_dbt_test__audit", "name": "not_null_iterable__events_event_id", "resource_type": "test", "package_name": "iterable", "path": "not_null_iterable__events_event_id.sql", "original_file_path": "models/iterable.yml", "unique_id": "test.iterable.not_null_iterable__events_event_id.ed1d28a650", "fqn": ["iterable", "not_null_iterable__events_event_id"], "alias": "not_null_iterable__events_event_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "sql_header": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {}, "created_at": 1789419972.9686646, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "iterable__events", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.iterable.iterable__events"]}, "compiled_path": "target/compiled/iterable/models/iterable.yml/not_null_iterable__events_event_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect event_id\nfrom \"postgres\".\"public_iterable_dev\".\"iterable__events\"\nwhere event_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "event_id", "file_key_name": "models.iterable__events", "attached_node": "model.iterable.iterable__events", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "event_id", "model": "{{ get_where_subquery(ref('iterable__events')) }}"}, "namespace": null}}, "test.iterable.not_null_iterable__journeys_journey_id.b5c6b8783a": {"database": "postgres", "schema": "public_dbt_test__audit", "name": "not_null_iterable__journeys_journey_id", "resource_type": "test", "package_name": "iterable", "path": "not_null_iterable__journeys_journey_id.sql", "original_file_path": "models/iterable.yml", "unique_id": "test.iterable.not_null_iterable__journeys_journey_id.b5c6b8783a", "fqn": ["iterable", "not_null_iterable__journeys_journey_id"], "alias": "not_null_iterable__journeys_journey_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "sql_header": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {}, "created_at": 1789419972.9713824, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "iterable__journeys", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.iterable.iterable__journeys"]}, "compiled_path": "target/compiled/iterable/models/iterable.yml/not_null_iterable__journeys_journey_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect journey_id\nfrom \"postgres\".\"public_iterable_dev\".\"iterable__journeys\"\nwhere journey_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "journey_id", "file_key_name": "models.iterable__journeys", "attached_node": "model.iterable.iterable__journeys", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "journey_id", "model": "{{ get_where_subquery(ref('iterable__journeys')) }}"}, "namespace": null}}, "test.iterable.unique_iterable__journeys_unique_journey_id.ba86841246": {"database": "postgres", "schema": "public_dbt_test__audit", "name": "unique_iterable__journeys_unique_journey_id", "resource_type": "test", "package_name": "iterable", "path": "unique_iterable__journeys_unique_journey_id.sql", "original_file_path": "models/iterable.yml", "unique_id": "test.iterable.unique_iterable__journeys_unique_journey_id.ba86841246", "fqn": ["iterable", "unique_iterable__journeys_unique_journey_id"], "alias": "unique_iterable__journeys_unique_journey_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "sql_header": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {}, "created_at": 1789419972.9740286, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "iterable__journeys", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.iterable.iterable__journeys"]}, "compiled_path": "target/compiled/iterable/models/iterable.yml/unique_iterable__journeys_unique_journey_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n unique_journey_id as unique_field,\n count(*) as n_records\n\nfrom \"postgres\".\"public_iterable_dev\".\"iterable__journeys\"\nwhere unique_journey_id is not null\ngroup by unique_journey_id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "unique_journey_id", "file_key_name": "models.iterable__journeys", "attached_node": "model.iterable.iterable__journeys", "test_metadata": {"name": "unique", "kwargs": {"column_name": "unique_journey_id", "model": "{{ get_where_subquery(ref('iterable__journeys')) }}"}, "namespace": null}}, "test.iterable.not_null_iterable__user_unsubscriptions_unique_user_key.f8db72932b": {"database": "postgres", "schema": "public_dbt_test__audit", "name": "not_null_iterable__user_unsubscriptions_unique_user_key", "resource_type": "test", "package_name": "iterable", "path": "not_null_iterable__user_unsubscriptions_unique_user_key.sql", "original_file_path": "models/iterable.yml", "unique_id": "test.iterable.not_null_iterable__user_unsubscriptions_unique_user_key.f8db72932b", "fqn": ["iterable", "not_null_iterable__user_unsubscriptions_unique_user_key"], "alias": "not_null_iterable__user_unsubscriptions_unique_user_key", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "sql_header": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {}, "created_at": 1789419972.9767356, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "iterable__user_unsubscriptions", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.iterable.iterable__user_unsubscriptions"]}, "compiled_path": "target/compiled/iterable/models/iterable.yml/not_null_iterable__user_unsubscriptions_unique_user_key.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect unique_user_key\nfrom \"postgres\".\"public_iterable_dev\".\"iterable__user_unsubscriptions\"\nwhere unique_user_key is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "unique_user_key", "file_key_name": "models.iterable__user_unsubscriptions", "attached_node": "model.iterable.iterable__user_unsubscriptions", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "unique_user_key", "model": "{{ get_where_subquery(ref('iterable__user_unsubscriptions')) }}"}, "namespace": null}}, "test.iterable.not_null_iterable__users_unique_user_key.4ca37a26c8": {"database": "postgres", "schema": "public_dbt_test__audit", "name": "not_null_iterable__users_unique_user_key", "resource_type": "test", "package_name": "iterable", "path": "not_null_iterable__users_unique_user_key.sql", "original_file_path": "models/iterable.yml", "unique_id": "test.iterable.not_null_iterable__users_unique_user_key.4ca37a26c8", "fqn": ["iterable", "not_null_iterable__users_unique_user_key"], "alias": "not_null_iterable__users_unique_user_key", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "sql_header": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {}, "created_at": 1789419972.981004, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "iterable__users", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.iterable.iterable__users"]}, "compiled_path": "target/compiled/iterable/models/iterable.yml/not_null_iterable__users_unique_user_key.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect unique_user_key\nfrom \"postgres\".\"public_iterable_dev\".\"iterable__users\"\nwhere unique_user_key is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "unique_user_key", "file_key_name": "models.iterable__users", "attached_node": "model.iterable.iterable__users", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "unique_user_key", "model": "{{ get_where_subquery(ref('iterable__users')) }}"}, "namespace": null}}, "test.iterable.not_null_stg_iterable__campaign_history_campaign_id.b7c36e4525": {"database": "postgres", "schema": "public_dbt_test__audit", "name": "not_null_stg_iterable__campaign_history_campaign_id", "resource_type": "test", "package_name": "iterable", "path": "not_null_stg_iterable__campaign_history_campaign_id.sql", "original_file_path": "models/staging/stg_iterable.yml", "unique_id": "test.iterable.not_null_stg_iterable__campaign_history_campaign_id.b7c36e4525", "fqn": ["iterable", "staging", "not_null_stg_iterable__campaign_history_campaign_id"], "alias": "not_null_stg_iterable__campaign_history_campaign_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "sql_header": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {}, "created_at": 1789419973.0121, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__campaign_history", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.iterable.stg_iterable__campaign_history"]}, "compiled_path": "target/compiled/iterable/models/staging/stg_iterable.yml/not_null_stg_iterable__campaign_history_campaign_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect campaign_id\nfrom \"postgres\".\"public_iterable_dev\".\"stg_iterable__campaign_history\"\nwhere campaign_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "campaign_id", "file_key_name": "models.stg_iterable__campaign_history", "attached_node": "model.iterable.stg_iterable__campaign_history", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "campaign_id", "model": "{{ get_where_subquery(ref('stg_iterable__campaign_history')) }}"}, "namespace": null}}, "test.iterable.not_null_stg_iterable__campaign_label_history_campaign_id.1918cef89a": {"database": "postgres", "schema": "public_dbt_test__audit", "name": "not_null_stg_iterable__campaign_label_history_campaign_id", "resource_type": "test", "package_name": "iterable", "path": "not_null_stg_iterable__campaign_label_history_campaign_id.sql", "original_file_path": "models/staging/stg_iterable.yml", "unique_id": "test.iterable.not_null_stg_iterable__campaign_label_history_campaign_id.1918cef89a", "fqn": ["iterable", "staging", "not_null_stg_iterable__campaign_label_history_campaign_id"], "alias": "not_null_stg_iterable__campaign_label_history_campaign_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "sql_header": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {}, "created_at": 1789419973.015028, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__campaign_label_history", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.iterable.stg_iterable__campaign_label_history"]}, "compiled_path": "target/compiled/iterable/models/staging/stg_iterable.yml/not_null_stg_iterable__campaign_label_history_campaign_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect campaign_id\nfrom \"postgres\".\"public_iterable_dev\".\"stg_iterable__campaign_label_history\"\nwhere campaign_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "campaign_id", "file_key_name": "models.stg_iterable__campaign_label_history", "attached_node": "model.iterable.stg_iterable__campaign_label_history", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "campaign_id", "model": "{{ get_where_subquery(ref('stg_iterable__campaign_label_history')) }}"}, "namespace": null}}, "test.iterable.not_null_stg_iterable__campaign_list_history_campaign_id.208f9bf9ed": {"database": "postgres", "schema": "public_dbt_test__audit", "name": "not_null_stg_iterable__campaign_list_history_campaign_id", "resource_type": "test", "package_name": "iterable", "path": "not_null_stg_iterable__campaign_list_history_campaign_id.sql", "original_file_path": "models/staging/stg_iterable.yml", "unique_id": "test.iterable.not_null_stg_iterable__campaign_list_history_campaign_id.208f9bf9ed", "fqn": ["iterable", "staging", "not_null_stg_iterable__campaign_list_history_campaign_id"], "alias": "not_null_stg_iterable__campaign_list_history_campaign_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "sql_header": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {}, "created_at": 1789419973.0178063, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__campaign_list_history", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.iterable.stg_iterable__campaign_list_history"]}, "compiled_path": "target/compiled/iterable/models/staging/stg_iterable.yml/not_null_stg_iterable__campaign_list_history_campaign_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect campaign_id\nfrom \"postgres\".\"public_iterable_dev\".\"stg_iterable__campaign_list_history\"\nwhere campaign_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "campaign_id", "file_key_name": "models.stg_iterable__campaign_list_history", "attached_node": "model.iterable.stg_iterable__campaign_list_history", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "campaign_id", "model": "{{ get_where_subquery(ref('stg_iterable__campaign_list_history')) }}"}, "namespace": null}}, "test.iterable.not_null_stg_iterable__campaign_suppression_list_history_campaign_id.3921289710": {"database": "postgres", "schema": "public_dbt_test__audit", "name": "not_null_stg_iterable__campaign_suppression_list_history_campaign_id", "resource_type": "test", "package_name": "iterable", "path": "not_null_stg_iterable__campaig_3ce753a10225cac67c8a1434b5541997.sql", "original_file_path": "models/staging/stg_iterable.yml", "unique_id": "test.iterable.not_null_stg_iterable__campaign_suppression_list_history_campaign_id.3921289710", "fqn": ["iterable", "staging", "not_null_stg_iterable__campaign_suppression_list_history_campaign_id"], "alias": "not_null_stg_iterable__campaig_3ce753a10225cac67c8a1434b5541997", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "not_null_stg_iterable__campaig_3ce753a10225cac67c8a1434b5541997", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "sql_header": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"alias": "not_null_stg_iterable__campaig_3ce753a10225cac67c8a1434b5541997"}, "created_at": 1789419973.0204892, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"not_null_stg_iterable__campaig_3ce753a10225cac67c8a1434b5541997\") }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__campaign_suppression_list_history", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.iterable.stg_iterable__campaign_suppression_list_history"]}, "compiled_path": "target/compiled/iterable/models/staging/stg_iterable.yml/not_null_stg_iterable__campaig_3ce753a10225cac67c8a1434b5541997.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect campaign_id\nfrom \"postgres\".\"public_iterable_dev\".\"stg_iterable__campaign_suppression_list_history\"\nwhere campaign_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "campaign_id", "file_key_name": "models.stg_iterable__campaign_suppression_list_history", "attached_node": "model.iterable.stg_iterable__campaign_suppression_list_history", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "campaign_id", "model": "{{ get_where_subquery(ref('stg_iterable__campaign_suppression_list_history')) }}"}, "namespace": null}}, "test.iterable.not_null_stg_iterable__channel_channel_id.182ceb9636": {"database": "postgres", "schema": "public_dbt_test__audit", "name": "not_null_stg_iterable__channel_channel_id", "resource_type": "test", "package_name": "iterable", "path": "not_null_stg_iterable__channel_channel_id.sql", "original_file_path": "models/staging/stg_iterable.yml", "unique_id": "test.iterable.not_null_stg_iterable__channel_channel_id.182ceb9636", "fqn": ["iterable", "staging", "not_null_stg_iterable__channel_channel_id"], "alias": "not_null_stg_iterable__channel_channel_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "sql_header": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {}, "created_at": 1789419973.0230997, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__channel", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.iterable.stg_iterable__channel"]}, "compiled_path": "target/compiled/iterable/models/staging/stg_iterable.yml/not_null_stg_iterable__channel_channel_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect channel_id\nfrom \"postgres\".\"public_iterable_dev\".\"stg_iterable__channel\"\nwhere channel_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "channel_id", "file_key_name": "models.stg_iterable__channel", "attached_node": "model.iterable.stg_iterable__channel", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "channel_id", "model": "{{ get_where_subquery(ref('stg_iterable__channel')) }}"}, "namespace": null}}, "test.iterable.not_null_stg_iterable__event_event_id.370cd4bc9d": {"database": "postgres", "schema": "public_dbt_test__audit", "name": "not_null_stg_iterable__event_event_id", "resource_type": "test", "package_name": "iterable", "path": "not_null_stg_iterable__event_event_id.sql", "original_file_path": "models/staging/stg_iterable.yml", "unique_id": "test.iterable.not_null_stg_iterable__event_event_id.370cd4bc9d", "fqn": ["iterable", "staging", "not_null_stg_iterable__event_event_id"], "alias": "not_null_stg_iterable__event_event_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "sql_header": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {}, "created_at": 1789419973.025781, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__event", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.iterable.stg_iterable__event"]}, "compiled_path": "target/compiled/iterable/models/staging/stg_iterable.yml/not_null_stg_iterable__event_event_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect event_id\nfrom \"postgres\".\"public_iterable_dev\".\"stg_iterable__event\"\nwhere event_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "event_id", "file_key_name": "models.stg_iterable__event", "attached_node": "model.iterable.stg_iterable__event", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "event_id", "model": "{{ get_where_subquery(ref('stg_iterable__event')) }}"}, "namespace": null}}, "test.iterable.not_null_stg_iterable__event_unique_event_id.e2b46d3bb6": {"database": "postgres", "schema": "public_dbt_test__audit", "name": "not_null_stg_iterable__event_unique_event_id", "resource_type": "test", "package_name": "iterable", "path": "not_null_stg_iterable__event_unique_event_id.sql", "original_file_path": "models/staging/stg_iterable.yml", "unique_id": "test.iterable.not_null_stg_iterable__event_unique_event_id.e2b46d3bb6", "fqn": ["iterable", "staging", "not_null_stg_iterable__event_unique_event_id"], "alias": "not_null_stg_iterable__event_unique_event_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "sql_header": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {}, "created_at": 1789419973.0284214, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__event", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.iterable.stg_iterable__event"]}, "compiled_path": "target/compiled/iterable/models/staging/stg_iterable.yml/not_null_stg_iterable__event_unique_event_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect unique_event_id\nfrom \"postgres\".\"public_iterable_dev\".\"stg_iterable__event\"\nwhere unique_event_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "unique_event_id", "file_key_name": "models.stg_iterable__event", "attached_node": "model.iterable.stg_iterable__event", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "unique_event_id", "model": "{{ get_where_subquery(ref('stg_iterable__event')) }}"}, "namespace": null}}, "test.iterable.not_null_stg_iterable__event_extension_event_id.144dedcd30": {"database": "postgres", "schema": "public_dbt_test__audit", "name": "not_null_stg_iterable__event_extension_event_id", "resource_type": "test", "package_name": "iterable", "path": "not_null_stg_iterable__event_extension_event_id.sql", "original_file_path": "models/staging/stg_iterable.yml", "unique_id": "test.iterable.not_null_stg_iterable__event_extension_event_id.144dedcd30", "fqn": ["iterable", "staging", "not_null_stg_iterable__event_extension_event_id"], "alias": "not_null_stg_iterable__event_extension_event_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "sql_header": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {}, "created_at": 1789419973.0311732, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__event_extension", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.iterable.stg_iterable__event_extension"]}, "compiled_path": "target/compiled/iterable/models/staging/stg_iterable.yml/not_null_stg_iterable__event_extension_event_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect event_id\nfrom \"postgres\".\"public_iterable_dev\".\"stg_iterable__event_extension\"\nwhere event_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "event_id", "file_key_name": "models.stg_iterable__event_extension", "attached_node": "model.iterable.stg_iterable__event_extension", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "event_id", "model": "{{ get_where_subquery(ref('stg_iterable__event_extension')) }}"}, "namespace": null}}, "test.iterable.not_null_stg_iterable__journey_journey_id.cc38bd633c": {"database": "postgres", "schema": "public_dbt_test__audit", "name": "not_null_stg_iterable__journey_journey_id", "resource_type": "test", "package_name": "iterable", "path": "not_null_stg_iterable__journey_journey_id.sql", "original_file_path": "models/staging/stg_iterable.yml", "unique_id": "test.iterable.not_null_stg_iterable__journey_journey_id.cc38bd633c", "fqn": ["iterable", "staging", "not_null_stg_iterable__journey_journey_id"], "alias": "not_null_stg_iterable__journey_journey_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "sql_header": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {}, "created_at": 1789419973.033802, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__journey", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.iterable.stg_iterable__journey"]}, "compiled_path": "target/compiled/iterable/models/staging/stg_iterable.yml/not_null_stg_iterable__journey_journey_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect journey_id\nfrom \"postgres\".\"public_iterable_dev\".\"stg_iterable__journey\"\nwhere journey_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "journey_id", "file_key_name": "models.stg_iterable__journey", "attached_node": "model.iterable.stg_iterable__journey", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "journey_id", "model": "{{ get_where_subquery(ref('stg_iterable__journey')) }}"}, "namespace": null}}, "test.iterable.not_null_stg_iterable__list_list_id.47029d839a": {"database": "postgres", "schema": "public_dbt_test__audit", "name": "not_null_stg_iterable__list_list_id", "resource_type": "test", "package_name": "iterable", "path": "not_null_stg_iterable__list_list_id.sql", "original_file_path": "models/staging/stg_iterable.yml", "unique_id": "test.iterable.not_null_stg_iterable__list_list_id.47029d839a", "fqn": ["iterable", "staging", "not_null_stg_iterable__list_list_id"], "alias": "not_null_stg_iterable__list_list_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "sql_header": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {}, "created_at": 1789419973.0363896, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__list", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.iterable.stg_iterable__list"]}, "compiled_path": "target/compiled/iterable/models/staging/stg_iterable.yml/not_null_stg_iterable__list_list_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect list_id\nfrom \"postgres\".\"public_iterable_dev\".\"stg_iterable__list\"\nwhere list_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "list_id", "file_key_name": "models.stg_iterable__list", "attached_node": "model.iterable.stg_iterable__list", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "list_id", "model": "{{ get_where_subquery(ref('stg_iterable__list')) }}"}, "namespace": null}}, "test.iterable.not_null_stg_iterable__message_type_message_type_id.75eaa6fa62": {"database": "postgres", "schema": "public_dbt_test__audit", "name": "not_null_stg_iterable__message_type_message_type_id", "resource_type": "test", "package_name": "iterable", "path": "not_null_stg_iterable__message_type_message_type_id.sql", "original_file_path": "models/staging/stg_iterable.yml", "unique_id": "test.iterable.not_null_stg_iterable__message_type_message_type_id.75eaa6fa62", "fqn": ["iterable", "staging", "not_null_stg_iterable__message_type_message_type_id"], "alias": "not_null_stg_iterable__message_type_message_type_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "sql_header": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {}, "created_at": 1789419973.039041, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__message_type", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.iterable.stg_iterable__message_type"]}, "compiled_path": "target/compiled/iterable/models/staging/stg_iterable.yml/not_null_stg_iterable__message_type_message_type_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect message_type_id\nfrom \"postgres\".\"public_iterable_dev\".\"stg_iterable__message_type\"\nwhere message_type_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "message_type_id", "file_key_name": "models.stg_iterable__message_type", "attached_node": "model.iterable.stg_iterable__message_type", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "message_type_id", "model": "{{ get_where_subquery(ref('stg_iterable__message_type')) }}"}, "namespace": null}}, "test.iterable.not_null_stg_iterable__template_history_template_id.14b24a1dfe": {"database": "postgres", "schema": "public_dbt_test__audit", "name": "not_null_stg_iterable__template_history_template_id", "resource_type": "test", "package_name": "iterable", "path": "not_null_stg_iterable__template_history_template_id.sql", "original_file_path": "models/staging/stg_iterable.yml", "unique_id": "test.iterable.not_null_stg_iterable__template_history_template_id.14b24a1dfe", "fqn": ["iterable", "staging", "not_null_stg_iterable__template_history_template_id"], "alias": "not_null_stg_iterable__template_history_template_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "sql_header": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {}, "created_at": 1789419973.0418298, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__template_history", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.iterable.stg_iterable__template_history"]}, "compiled_path": "target/compiled/iterable/models/staging/stg_iterable.yml/not_null_stg_iterable__template_history_template_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect template_id\nfrom \"postgres\".\"public_iterable_dev\".\"stg_iterable__template_history\"\nwhere template_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "template_id", "file_key_name": "models.stg_iterable__template_history", "attached_node": "model.iterable.stg_iterable__template_history", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "template_id", "model": "{{ get_where_subquery(ref('stg_iterable__template_history')) }}"}, "namespace": null}}, "test.iterable.not_null_stg_iterable__list_user__fivetran_user_id.cca4b34c07": {"database": "postgres", "schema": "public_dbt_test__audit", "name": "not_null_stg_iterable__list_user__fivetran_user_id", "resource_type": "test", "package_name": "iterable", "path": "not_null_stg_iterable__list_user__fivetran_user_id.sql", "original_file_path": "models/staging/stg_iterable.yml", "unique_id": "test.iterable.not_null_stg_iterable__list_user__fivetran_user_id.cca4b34c07", "fqn": ["iterable", "staging", "not_null_stg_iterable__list_user__fivetran_user_id"], "alias": "not_null_stg_iterable__list_user__fivetran_user_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "sql_header": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {}, "created_at": 1789419973.0444615, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__list_user", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.iterable.stg_iterable__list_user"]}, "compiled_path": "target/compiled/iterable/models/staging/stg_iterable.yml/not_null_stg_iterable__list_user__fivetran_user_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect _fivetran_user_id\nfrom \"postgres\".\"public_iterable_dev\".\"stg_iterable__list_user\"\nwhere _fivetran_user_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "_fivetran_user_id", "file_key_name": "models.stg_iterable__list_user", "attached_node": "model.iterable.stg_iterable__list_user", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "_fivetran_user_id", "model": "{{ get_where_subquery(ref('stg_iterable__list_user')) }}"}, "namespace": null}}, "test.iterable.not_null_stg_iterable__user_history_unique_user_key.2845af2127": {"database": "postgres", "schema": "public_dbt_test__audit", "name": "not_null_stg_iterable__user_history_unique_user_key", "resource_type": "test", "package_name": "iterable", "path": "not_null_stg_iterable__user_history_unique_user_key.sql", "original_file_path": "models/staging/stg_iterable.yml", "unique_id": "test.iterable.not_null_stg_iterable__user_history_unique_user_key.2845af2127", "fqn": ["iterable", "staging", "not_null_stg_iterable__user_history_unique_user_key"], "alias": "not_null_stg_iterable__user_history_unique_user_key", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "sql_header": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {}, "created_at": 1789419973.047116, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__user_history", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.iterable.stg_iterable__user_history"]}, "compiled_path": "target/compiled/iterable/models/staging/stg_iterable.yml/not_null_stg_iterable__user_history_unique_user_key.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect unique_user_key\nfrom \"postgres\".\"public_iterable_dev\".\"stg_iterable__user_history\"\nwhere unique_user_key is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "unique_user_key", "file_key_name": "models.stg_iterable__user_history", "attached_node": "model.iterable.stg_iterable__user_history", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "unique_user_key", "model": "{{ get_where_subquery(ref('stg_iterable__user_history')) }}"}, "namespace": null}}, "test.iterable.not_null_stg_iterable__user_unsubscribed_channel_channel_id.da0ed9e9be": {"database": "postgres", "schema": "public_dbt_test__audit", "name": "not_null_stg_iterable__user_unsubscribed_channel_channel_id", "resource_type": "test", "package_name": "iterable", "path": "not_null_stg_iterable__user_unsubscribed_channel_channel_id.sql", "original_file_path": "models/staging/stg_iterable.yml", "unique_id": "test.iterable.not_null_stg_iterable__user_unsubscribed_channel_channel_id.da0ed9e9be", "fqn": ["iterable", "staging", "not_null_stg_iterable__user_unsubscribed_channel_channel_id"], "alias": "not_null_stg_iterable__user_unsubscribed_channel_channel_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "sql_header": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {}, "created_at": 1789419973.0497231, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__user_unsubscribed_channel", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.iterable.stg_iterable__user_unsubscribed_channel"]}, "compiled_path": "target/compiled/iterable/models/staging/stg_iterable.yml/not_null_stg_iterable__user_unsubscribed_channel_channel_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect channel_id\nfrom \"postgres\".\"public_iterable_dev\".\"stg_iterable__user_unsubscribed_channel\"\nwhere channel_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "channel_id", "file_key_name": "models.stg_iterable__user_unsubscribed_channel", "attached_node": "model.iterable.stg_iterable__user_unsubscribed_channel", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "channel_id", "model": "{{ get_where_subquery(ref('stg_iterable__user_unsubscribed_channel')) }}"}, "namespace": null}}, "test.iterable.not_null_stg_iterable__user_unsub_message_type_message_type_id.268a89ea6f": {"database": "postgres", "schema": "public_dbt_test__audit", "name": "not_null_stg_iterable__user_unsub_message_type_message_type_id", "resource_type": "test", "package_name": "iterable", "path": "not_null_stg_iterable__user_unsub_message_type_message_type_id.sql", "original_file_path": "models/staging/stg_iterable.yml", "unique_id": "test.iterable.not_null_stg_iterable__user_unsub_message_type_message_type_id.268a89ea6f", "fqn": ["iterable", "staging", "not_null_stg_iterable__user_unsub_message_type_message_type_id"], "alias": "not_null_stg_iterable__user_unsub_message_type_message_type_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "sql_header": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {}, "created_at": 1789419973.0523486, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__user_unsub_message_type", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.iterable.stg_iterable__user_unsub_message_type"]}, "compiled_path": "target/compiled/iterable/models/staging/stg_iterable.yml/not_null_stg_iterable__user_unsub_message_type_message_type_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect message_type_id\nfrom \"postgres\".\"public_iterable_dev\".\"stg_iterable__user_unsub_message_type\"\nwhere message_type_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "message_type_id", "file_key_name": "models.stg_iterable__user_unsub_message_type", "attached_node": "model.iterable.stg_iterable__user_unsub_message_type", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "message_type_id", "model": "{{ get_where_subquery(ref('stg_iterable__user_unsub_message_type')) }}"}, "namespace": null}}}, "sources": {"source.iterable.iterable.campaign_history": {"database": "postgres", "schema": "public", "name": "campaign_history", "resource_type": "source", "package_name": "iterable", "path": "models/staging/src_iterable.yml", "original_file_path": "models/staging/src_iterable.yml", "unique_id": "source.iterable.iterable.campaign_history", "fqn": ["iterable", "staging", "iterable", "campaign_history"], "source_name": "iterable", "source_description": "", "loader": "fivetran", "identifier": "campaign_history_data", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Table containing a history of campaigns.", "columns": {"id": {"name": "id", "description": "Unique identifier of the campaign record", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "updated_at": {"name": "updated_at", "description": "Last update's timestamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "name": {"name": "name", "description": "User defined name of the campaign.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "campaign_state": {"name": "campaign_state", "description": "State of the campaign. Can be Draft, Ready, Scheduled, Running, Finished, Starting, Aborted or Recurring", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "type": {"name": "type", "description": "The campaign type. Can be Blast or Triggered", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "send_size": {"name": "send_size", "description": "Size of the campaign. Number of individuals included in the campaign", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "start_at": {"name": "start_at", "description": "Start timestamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "ended_at": {"name": "ended_at", "description": "Ended timestamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "created_at": {"name": "created_at", "description": "Creation timestamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "recurring_campaign_id": {"name": "recurring_campaign_id", "description": "Reference to the recurring campaign, if applicable", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "created_by_user_id": {"name": "created_by_user_id", "description": "Reference to the user who created the campaign", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "template_id": {"name": "template_id", "description": "Reference to the campaign template", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "updated_by_user_id": {"name": "updated_by_user_id", "description": "ID of the user who updated this record", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "message_medium": {"name": "message_medium", "description": "The medium that this message was sent via, for example Email or InApp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": "_fivetran_synced", "loaded_at_query": null, "meta": {}, "tags": [], "static_analysis": null}, "patch_path": null, "unrendered_config": {"loaded_at_field": "_fivetran_synced", "enabled": true, "loaded_at_query": null, "meta": {}, "tags": []}, "relation_name": "\"postgres\".\"public\".\"campaign_history_data\"", "created_at": 1789419973.2336032, "unrendered_database": "{% if target.type != 'spark' %}{{ var('iterable_database', target.database)}}{% endif %}", "unrendered_schema": "{{var ('iterable_schema', 'iterable')}}", "doc_blocks": []}, "source.iterable.iterable.campaign_label_history": {"database": "postgres", "schema": "public", "name": "campaign_label_history", "resource_type": "source", "package_name": "iterable", "path": "models/staging/src_iterable.yml", "original_file_path": "models/staging/src_iterable.yml", "unique_id": "source.iterable.iterable.campaign_label_history", "fqn": ["iterable", "staging", "iterable", "campaign_label_history"], "source_name": "iterable", "source_description": "", "loader": "fivetran", "identifier": "campaign_label_history_data", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Table containing a history of labels.", "columns": {"campaign_id": {"name": "campaign_id", "description": "Reference to the campaign associated with the label", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "label": {"name": "label", "description": "Name of the label", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "updated_at": {"name": "updated_at", "description": "Last update timestamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": "_fivetran_synced", "loaded_at_query": null, "meta": {}, "tags": [], "static_analysis": null}, "patch_path": null, "unrendered_config": {"loaded_at_field": "_fivetran_synced", "enabled": true, "loaded_at_query": null, "meta": {}, "tags": []}, "relation_name": "\"postgres\".\"public\".\"campaign_label_history_data\"", "created_at": 1789419973.2358623, "unrendered_database": "{% if target.type != 'spark' %}{{ var('iterable_database', target.database)}}{% endif %}", "unrendered_schema": "{{var ('iterable_schema', 'iterable')}}", "doc_blocks": []}, "source.iterable.iterable.campaign_list_history": {"database": "postgres", "schema": "public", "name": "campaign_list_history", "resource_type": "source", "package_name": "iterable", "path": "models/staging/src_iterable.yml", "original_file_path": "models/staging/src_iterable.yml", "unique_id": "source.iterable.iterable.campaign_list_history", "fqn": ["iterable", "staging", "iterable", "campaign_list_history"], "source_name": "iterable", "source_description": "", "loader": "fivetran", "identifier": "campaign_list_history_data", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Table containing a history of lists.", "columns": {"campaign_id": {"name": "campaign_id", "description": "Reference to the campaign associated with the label", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "list_id": {"name": "list_id", "description": "Reference to the list used", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "updated_at": {"name": "updated_at", "description": "Last update timestamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": "_fivetran_synced", "loaded_at_query": null, "meta": {}, "tags": [], "static_analysis": null}, "patch_path": null, "unrendered_config": {"loaded_at_field": "_fivetran_synced", "enabled": true, "loaded_at_query": null, "meta": {}, "tags": []}, "relation_name": "\"postgres\".\"public\".\"campaign_list_history_data\"", "created_at": 1789419973.236487, "unrendered_database": "{% if target.type != 'spark' %}{{ var('iterable_database', target.database)}}{% endif %}", "unrendered_schema": "{{var ('iterable_schema', 'iterable')}}", "doc_blocks": []}, "source.iterable.iterable.campaign_suppression_list_history": {"database": "postgres", "schema": "public", "name": "campaign_suppression_list_history", "resource_type": "source", "package_name": "iterable", "path": "models/staging/src_iterable.yml", "original_file_path": "models/staging/src_iterable.yml", "unique_id": "source.iterable.iterable.campaign_suppression_list_history", "fqn": ["iterable", "staging", "iterable", "campaign_suppression_list_history"], "source_name": "iterable", "source_description": "", "loader": "fivetran", "identifier": "campaign_suppression_list_history_data", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Table containing a history of suppression lists.\n", "columns": {"campaign_id": {"name": "campaign_id", "description": "Reference to the campaign associated with the label", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "suppressed_list_id": {"name": "suppressed_list_id", "description": "Reference to the list used", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "updated_at": {"name": "updated_at", "description": "Last update timestamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": "_fivetran_synced", "loaded_at_query": null, "meta": {}, "tags": [], "static_analysis": null}, "patch_path": null, "unrendered_config": {"loaded_at_field": "_fivetran_synced", "enabled": true, "loaded_at_query": null, "meta": {}, "tags": []}, "relation_name": "\"postgres\".\"public\".\"campaign_suppression_list_history_data\"", "created_at": 1789419973.237084, "unrendered_database": "{% if target.type != 'spark' %}{{ var('iterable_database', target.database)}}{% endif %}", "unrendered_schema": "{{var ('iterable_schema', 'iterable')}}", "doc_blocks": []}, "source.iterable.iterable.channel": {"database": "postgres", "schema": "public", "name": "channel", "resource_type": "source", "package_name": "iterable", "path": "models/staging/src_iterable.yml", "original_file_path": "models/staging/src_iterable.yml", "unique_id": "source.iterable.iterable.channel", "fqn": ["iterable", "staging", "iterable", "channel"], "source_name": "iterable", "source_description": "", "loader": "fivetran", "identifier": "channel_data", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Table containing unique channels.", "columns": {"id": {"name": "id", "description": "Unique identifier of the channel", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "name": {"name": "name", "description": "User defined name of the channel", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "channel_type": {"name": "channel_type", "description": "The channel type", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "message_medium": {"name": "message_medium", "description": "The message medium associated with the channel", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": "_fivetran_synced", "loaded_at_query": null, "meta": {}, "tags": [], "static_analysis": null}, "patch_path": null, "unrendered_config": {"loaded_at_field": "_fivetran_synced", "enabled": true, "loaded_at_query": null, "meta": {}, "tags": []}, "relation_name": "\"postgres\".\"public\".\"channel_data\"", "created_at": 1789419973.2379124, "unrendered_database": "{% if target.type != 'spark' %}{{ var('iterable_database', target.database)}}{% endif %}", "unrendered_schema": "{{var ('iterable_schema', 'iterable')}}", "doc_blocks": []}, "source.iterable.iterable.event": {"database": "postgres", "schema": "public", "name": "event", "resource_type": "source", "package_name": "iterable", "path": "models/staging/src_iterable.yml", "original_file_path": "models/staging/src_iterable.yml", "unique_id": "source.iterable.iterable.event", "fqn": ["iterable", "staging", "iterable", "event"], "source_name": "iterable", "source_description": "", "loader": "fivetran", "identifier": "event_data", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Table containing individual events within campaigns.", "columns": {"_fivetran_id": {"name": "_fivetran_id", "description": "A Fivetran-created unique identifier derived from hashing campaign_id, created_at, and event_name.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "campaign_id": {"name": "campaign_id", "description": "Reference to the campaign from which the event originated", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "content_id": {"name": "content_id", "description": "Reference to the content the event is associated with.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "created_at": {"name": "created_at", "description": "Creation timestamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "email": {"name": "email", "description": "The user's email. User identifier, for email-based projects. Previously was the unique identifier for user records, for Iterable customers before August 2023. Exists if using the history version of the table.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "additional_properties": {"name": "additional_properties", "description": "json object containing addition event properties", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "event_name": {"name": "event_name", "description": "Name provided to the individual event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "message_bus_id": {"name": "message_bus_id", "description": "Reference to the message bus associated with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "message_id": {"name": "message_id", "description": "Reference to the message the event is associated with", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "message_type_id": {"name": "message_type_id", "description": "Reference to the type of message the event is associated with", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "recipient_state": {"name": "recipient_state", "description": "The state of the recipient upon receiving the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "status": {"name": "status", "description": "Status of the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "transactional_data": {"name": "transactional_data", "description": "Transactional data associated with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unsub_source": {"name": "unsub_source", "description": "Source of the unsubscribe event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "user_agent": {"name": "user_agent", "description": "User agent associated with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "user_agent_device": {"name": "user_agent_device", "description": "The device of the user agent", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "_fivetran_user_id": {"name": "_fivetran_user_id", "description": "A Fivetran-created unique identifier for users, derived from hashing user_id and/or email, depending on project type.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": "_fivetran_synced", "loaded_at_query": null, "meta": {}, "tags": [], "static_analysis": null}, "patch_path": null, "unrendered_config": {"loaded_at_field": "_fivetran_synced", "enabled": true, "loaded_at_query": null, "meta": {}, "tags": []}, "relation_name": "\"postgres\".\"public\".\"event_data\"", "created_at": 1789419973.2385807, "unrendered_database": "{% if target.type != 'spark' %}{{ var('iterable_database', target.database)}}{% endif %}", "unrendered_schema": "{{var ('iterable_schema', 'iterable')}}", "doc_blocks": []}, "source.iterable.iterable.event_extension": {"database": "postgres", "schema": "public", "name": "event_extension", "resource_type": "source", "package_name": "iterable", "path": "models/staging/src_iterable.yml", "original_file_path": "models/staging/src_iterable.yml", "unique_id": "source.iterable.iterable.event_extension", "fqn": ["iterable", "staging", "iterable", "event_extension"], "source_name": "iterable", "source_description": "", "loader": "fivetran", "identifier": "event_extension_data", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Table containing additional properties from the event table.", "columns": {"_fivetran_id": {"name": "_fivetran_id", "description": "A Fivetran-created unique identifier derived from hashing campaign_id, created_at, and event_name.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "app_already_running": {"name": "app_already_running", "description": "Boolean indicating if the app is currently running or not", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "badge": {"name": "badge", "description": "Badge associated with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "canonical_url_id": {"name": "canonical_url_id", "description": "Reference to the url associated with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "content_available": {"name": "content_available", "description": "Content available from the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "content_id": {"name": "content_id", "description": "Reference to the content associated with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "deeplink_android": {"name": "deeplink_android", "description": "Deeplink associated with the event from an android device", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "deeplink_ios": {"name": "deeplink_ios", "description": "Deeplink associated with the event from an ios device", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "device": {"name": "device", "description": "The device associated with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "email_id": {"name": "email_id", "description": "Reference to the email associated with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "email_subject": {"name": "email_subject", "description": "Subject of the email associated with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "experiment_id": {"name": "experiment_id", "description": "Reference to the experiment used if the event is an experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "from_phone_number_id": {"name": "from_phone_number_id", "description": "Reference to the phone number which the event is from", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "from_smssender_id": {"name": "from_smssender_id", "description": "Reference to the sms sender which the event is from", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "image_url": {"name": "image_url", "description": "Image url of the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "is_ghost_push": {"name": "is_ghost_push", "description": "Boolean indicating if the event is a result of a ghost push", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "link_id": {"name": "link_id", "description": "Reference to the link associated with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "link_url": {"name": "link_url", "description": "Url of the link associated with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "locale": {"name": "locale", "description": "Locale associated with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "payload": {"name": "payload", "description": "Payload resulted from the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "platform_endpoint": {"name": "platform_endpoint", "description": "The specific platform endpoint of the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "push_message": {"name": "push_message", "description": "Boolean indicating if the event is a push message", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "region": {"name": "region", "description": "Region of the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "sms_message": {"name": "sms_message", "description": "Boolean indicating if the event is an sms message", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "sms_provider_response_code": {"name": "sms_provider_response_code", "description": "sms provider response code from the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "sms_provider_response_message": {"name": "sms_provider_response_message", "description": "sms provider response message from the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "sms_provider_response_more_info": {"name": "sms_provider_response_more_info", "description": "sms provider response addition info from the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "sms_provider_response_status": {"name": "sms_provider_response_status", "description": "Status of the sms provider response from the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "sound": {"name": "sound", "description": "Boolean indicating if a sound was used with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "to_phone_number": {"name": "to_phone_number", "description": "To phone number associated with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "url": {"name": "url", "description": "Url associated with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "workflow_id": {"name": "workflow_id", "description": "Reference to the workflow which the event originated", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "workflow_name": {"name": "workflow_name", "description": "Name of the workflow which the event originated", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "catalog_collection_count": {"name": "catalog_collection_count", "description": "The count of products or items collected in a catalog associated with the event.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "catalog_lookup_count": {"name": "catalog_lookup_count", "description": "The count of times a catalog was looked up or queried during the event.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "city": {"name": "city", "description": "The city associated with the event, which could be the location of the recipient.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "clicked_url": {"name": "clicked_url", "description": "The URL that was clicked by the recipient in response to the marketing message.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "country": {"name": "country", "description": "The country associated with the event, which could be the location of the recipient.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "error_code": {"name": "error_code", "description": "The error code or message indicating any issues or errors encountered during the event.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "expires_at": {"name": "expires_at", "description": "The date and time when the event or message is set to expire or become invalid.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "from_phone_number": {"name": "from_phone_number", "description": "The phone number from which the SMS message was sent.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "in_app_body": {"name": "in_app_body", "description": "The content or body of an in-app message that was sent as part of the event.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "is_sms_estimation": {"name": "is_sms_estimation", "description": "A boolean indicating whether the SMS message is an estimation or not.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "labels": {"name": "labels", "description": "Any labels or tags associated with the event, which can be used for categorization or organization.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "message_context": {"name": "message_context", "description": "Additional contextual information related to the marketing message or event.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "message_status": {"name": "message_status", "description": "The status of the marketing message, such as sent, delivered, opened, etc.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "mms_send_count": {"name": "mms_send_count", "description": "The count of multimedia messages (MMS) sent as part of the event.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "product_recommendation_count": {"name": "product_recommendation_count", "description": "The count of product recommendations included in the message.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "proxy_source": {"name": "proxy_source", "description": "Information about the source or proxy used for sending the message.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "reason": {"name": "reason", "description": "The reason or cause associated with a specific event or action.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "sms_send_count": {"name": "sms_send_count", "description": "The count of SMS messages sent as part of the event.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "web_push_body": {"name": "web_push_body", "description": "The content or body of a web push notification sent as part of the event.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "web_push_click_action": {"name": "web_push_click_action", "description": "The action triggered when a recipient clicks a web push notification.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "web_push_icon": {"name": "web_push_icon", "description": "The icon or image associated with the web push notification.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "web_push_message": {"name": "web_push_message", "description": "The message or notification sent to web users as part of the event.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": "_fivetran_synced", "loaded_at_query": null, "meta": {}, "tags": [], "static_analysis": null}, "patch_path": null, "unrendered_config": {"loaded_at_field": "_fivetran_synced", "enabled": true, "loaded_at_query": null, "meta": {}, "tags": []}, "relation_name": "\"postgres\".\"public\".\"event_extension_data\"", "created_at": 1789419973.2395086, "unrendered_database": "{% if target.type != 'spark' %}{{ var('iterable_database', target.database)}}{% endif %}", "unrendered_schema": "{{var ('iterable_schema', 'iterable')}}", "doc_blocks": []}, "source.iterable.iterable.journey": {"database": "postgres", "schema": "public", "name": "journey", "resource_type": "source", "package_name": "iterable", "path": "models/staging/src_iterable.yml", "original_file_path": "models/staging/src_iterable.yml", "unique_id": "source.iterable.iterable.journey", "fqn": ["iterable", "staging", "iterable", "journey"], "source_name": "iterable", "source_description": "", "loader": "fivetran", "identifier": "journey_data", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Table containing unique journeys, formerly known as workflows.", "columns": {"id": {"name": "id", "description": "Unique identifier of the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "name": {"name": "name", "description": "User defined name of the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "journey_type": {"name": "journey_type", "description": "The journey type", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "description": {"name": "description", "description": "Information about the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "creator_user_id": {"name": "creator_user_id", "description": "Reference to the user who created the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "enabled": {"name": "enabled", "description": "Boolean indicating if the journey is currently enabled", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "is_archived": {"name": "is_archived", "description": "Boolean indicating if the journey has been archived", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "lifetime_limit": {"name": "lifetime_limit", "description": "Maximum number of times a user may enter the journey over their lifetime", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "simultaneous_limit": {"name": "simultaneous_limit", "description": "Maximum number of times a user may be in the journey at the same time", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "start_tile_id": {"name": "start_tile_id", "description": "Reference to the tile which begins the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "trigger_event_names": {"name": "trigger_event_names", "description": "The event names which trigger a user's entry into the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "created_at": {"name": "created_at", "description": "Creation timestamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "updated_at": {"name": "updated_at", "description": "Last update timestamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": "_fivetran_synced", "loaded_at_query": null, "meta": {}, "tags": [], "static_analysis": null}, "patch_path": null, "unrendered_config": {"loaded_at_field": "_fivetran_synced", "enabled": true, "loaded_at_query": null, "meta": {}, "tags": []}, "relation_name": "\"postgres\".\"public\".\"journey_data\"", "created_at": 1789419973.2401497, "unrendered_database": "{% if target.type != 'spark' %}{{ var('iterable_database', target.database)}}{% endif %}", "unrendered_schema": "{{var ('iterable_schema', 'iterable')}}", "doc_blocks": []}, "source.iterable.iterable.list": {"database": "postgres", "schema": "public", "name": "list", "resource_type": "source", "package_name": "iterable", "path": "models/staging/src_iterable.yml", "original_file_path": "models/staging/src_iterable.yml", "unique_id": "source.iterable.iterable.list", "fqn": ["iterable", "staging", "iterable", "list"], "source_name": "iterable", "source_description": "", "loader": "fivetran", "identifier": "list_data", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Table containing users and the lists the users are associated with.", "columns": {"id": {"name": "id", "description": "Unique identifier of the list", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "name": {"name": "name", "description": "User defined name of the list", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "list_type": {"name": "list_type", "description": "The list type", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "created_at": {"name": "created_at", "description": "Creation timestamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "description": {"name": "description", "description": "Information about the list", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": "_fivetran_synced", "loaded_at_query": null, "meta": {}, "tags": [], "static_analysis": null}, "patch_path": null, "unrendered_config": {"loaded_at_field": "_fivetran_synced", "enabled": true, "loaded_at_query": null, "meta": {}, "tags": []}, "relation_name": "\"postgres\".\"public\".\"list_data\"", "created_at": 1789419973.240721, "unrendered_database": "{% if target.type != 'spark' %}{{ var('iterable_database', target.database)}}{% endif %}", "unrendered_schema": "{{var ('iterable_schema', 'iterable')}}", "doc_blocks": []}, "source.iterable.iterable.message_type": {"database": "postgres", "schema": "public", "name": "message_type", "resource_type": "source", "package_name": "iterable", "path": "models/staging/src_iterable.yml", "original_file_path": "models/staging/src_iterable.yml", "unique_id": "source.iterable.iterable.message_type", "fqn": ["iterable", "staging", "iterable", "message_type"], "source_name": "iterable", "source_description": "", "loader": "fivetran", "identifier": "message_type_data", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Table containing unique message types.", "columns": {"id": {"name": "id", "description": "Unique identifier of the message type", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "name": {"name": "name", "description": "User defined name of the message type", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "channel_id": {"name": "channel_id", "description": "Channel that this message type belongs to", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "created_at": {"name": "created_at", "description": "Time when the message type was initially created", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "frequency_cap": {"name": "frequency_cap", "description": "The maximum number of times a message of this type can be sent to a recipient within a specified time period to prevent over-messaging", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "rate_limit_per_minute": {"name": "rate_limit_per_minute", "description": "The maximum number of messages of this type that can be sent to recipients in a minute, ensuring controlled message delivery", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "subscription_policy": {"name": "subscription_policy", "description": "Information about the policy or rules governing how users can subscribe to or unsubscribe from this specific message type, like OptOut", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "updated_at": {"name": "updated_at", "description": "Time when the message type was last updated or modified", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": "_fivetran_synced", "loaded_at_query": null, "meta": {}, "tags": [], "static_analysis": null}, "patch_path": null, "unrendered_config": {"loaded_at_field": "_fivetran_synced", "enabled": true, "loaded_at_query": null, "meta": {}, "tags": []}, "relation_name": "\"postgres\".\"public\".\"message_type_data\"", "created_at": 1789419973.241323, "unrendered_database": "{% if target.type != 'spark' %}{{ var('iterable_database', target.database)}}{% endif %}", "unrendered_schema": "{{var ('iterable_schema', 'iterable')}}", "doc_blocks": []}, "source.iterable.iterable.template_history": {"database": "postgres", "schema": "public", "name": "template_history", "resource_type": "source", "package_name": "iterable", "path": "models/staging/src_iterable.yml", "original_file_path": "models/staging/src_iterable.yml", "unique_id": "source.iterable.iterable.template_history", "fqn": ["iterable", "staging", "iterable", "template_history"], "source_name": "iterable", "source_description": "", "loader": "fivetran", "identifier": "template_history_data", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Table containing unique templates used across campaigns.", "columns": {"id": {"name": "id", "description": "Unique identifier of the template", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "name": {"name": "name", "description": "User defined name of the template", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "template_type": {"name": "template_type", "description": "The type of the template", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "created_at": {"name": "created_at", "description": "Creation timestamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "client_template_id": {"name": "client_template_id", "description": "Reference to the client template", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "creator_user_id": {"name": "creator_user_id", "description": "Reference to the user who created the template", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "message_type_id": {"name": "message_type_id", "description": "Reference to the message type associated with the template", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "updated_at": {"name": "updated_at", "description": "Last update timestamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": "_fivetran_synced", "loaded_at_query": null, "meta": {}, "tags": [], "static_analysis": null}, "patch_path": null, "unrendered_config": {"loaded_at_field": "_fivetran_synced", "enabled": true, "loaded_at_query": null, "meta": {}, "tags": []}, "relation_name": "\"postgres\".\"public\".\"template_history_data\"", "created_at": 1789419973.2419236, "unrendered_database": "{% if target.type != 'spark' %}{{ var('iterable_database', target.database)}}{% endif %}", "unrendered_schema": "{{var ('iterable_schema', 'iterable')}}", "doc_blocks": []}, "source.iterable.iterable.user_history": {"database": "postgres", "schema": "public", "name": "user_history", "resource_type": "source", "package_name": "iterable", "path": "models/staging/src_iterable.yml", "original_file_path": "models/staging/src_iterable.yml", "unique_id": "source.iterable.iterable.user_history", "fqn": ["iterable", "staging", "iterable", "user_history"], "source_name": "iterable", "source_description": "", "loader": "fivetran", "identifier": "user_history_data", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Table containing individual user history information.", "columns": {"email": {"name": "email", "description": "The user's email. Previously was the unique identifier for the user records, for Iterable customers before August 2023. This has since been replaced by iterable_user_id.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "user_id": {"name": "user_id", "description": "User defined identifier of the user. This is not a unique field", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "iterable_user_id": {"name": "iterable_user_id", "description": "The unique identifier of the user", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "first_name": {"name": "first_name", "description": "First name of the user", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "last_name": {"name": "last_name", "description": "Last name of the user", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "email_list_ids": {"name": "email_list_ids", "description": "[DEPRECATED October 13, 2025 Use LIST_USER source instead.] Array of references to the lists associated with the user\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "signup_date": {"name": "signup_date", "description": "Timestamp of when the user signed up", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "signup_source": {"name": "signup_source", "description": "Source where the user signed up", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "updated_at": {"name": "updated_at", "description": "Last update timestamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": "_fivetran_synced", "loaded_at_query": null, "meta": {}, "tags": [], "static_analysis": null}, "patch_path": null, "unrendered_config": {"loaded_at_field": "_fivetran_synced", "enabled": true, "loaded_at_query": null, "meta": {}, "tags": []}, "relation_name": "\"postgres\".\"public\".\"user_history_data\"", "created_at": 1789419973.242516, "unrendered_database": "{% if target.type != 'spark' %}{{ var('iterable_database', target.database)}}{% endif %}", "unrendered_schema": "{{var ('iterable_schema', 'iterable')}}", "doc_blocks": []}, "source.iterable.iterable.user_unsubscribed_channel": {"database": "postgres", "schema": "public", "name": "user_unsubscribed_channel", "resource_type": "source", "package_name": "iterable", "path": "models/staging/src_iterable.yml", "original_file_path": "models/staging/src_iterable.yml", "unique_id": "source.iterable.iterable.user_unsubscribed_channel", "fqn": ["iterable", "staging", "iterable", "user_unsubscribed_channel"], "source_name": "iterable", "source_description": "", "loader": "fivetran", "identifier": "user_unsubscribed_channel_data", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Table containing the channels from which a user has unsubscribed.", "columns": {"_fivetran_id": {"name": "_fivetran_id", "description": "A Fivetran-created unique identifier for users, derived from hashing user_id and/or email, depending on project type.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "channel_id": {"name": "channel_id", "description": "Reference to the channel from which the user unsubscribed", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": "_fivetran_synced", "loaded_at_query": null, "meta": {}, "tags": [], "static_analysis": null}, "patch_path": null, "unrendered_config": {"loaded_at_field": "_fivetran_synced", "enabled": true, "loaded_at_query": null, "meta": {}, "tags": []}, "relation_name": "\"postgres\".\"public\".\"user_unsubscribed_channel_data\"", "created_at": 1789419973.2430851, "unrendered_database": "{% if target.type != 'spark' %}{{ var('iterable_database', target.database)}}{% endif %}", "unrendered_schema": "{{var ('iterable_schema', 'iterable')}}", "doc_blocks": []}, "source.iterable.iterable.user_unsubscribed_message_type": {"database": "postgres", "schema": "public", "name": "user_unsubscribed_message_type", "resource_type": "source", "package_name": "iterable", "path": "models/staging/src_iterable.yml", "original_file_path": "models/staging/src_iterable.yml", "unique_id": "source.iterable.iterable.user_unsubscribed_message_type", "fqn": ["iterable", "staging", "iterable", "user_unsubscribed_message_type"], "source_name": "iterable", "source_description": "", "loader": "fivetran", "identifier": "user_unsubscribed_message_type_data", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Table containing the message types from which a user has unsubscribed.", "columns": {"_fivetran_id": {"name": "_fivetran_id", "description": "A Fivetran-created unique identifier for users, derived from hashing user_id and/or email, depending on project type.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "message_type_id": {"name": "message_type_id", "description": "Reference to the message type from which the user unsubscribed", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": "_fivetran_synced", "loaded_at_query": null, "meta": {}, "tags": [], "static_analysis": null}, "patch_path": null, "unrendered_config": {"loaded_at_field": "_fivetran_synced", "enabled": true, "loaded_at_query": null, "meta": {}, "tags": []}, "relation_name": "\"postgres\".\"public\".\"user_unsubscribed_message_type_data\"", "created_at": 1789419973.243675, "unrendered_database": "{% if target.type != 'spark' %}{{ var('iterable_database', target.database)}}{% endif %}", "unrendered_schema": "{{var ('iterable_schema', 'iterable')}}", "doc_blocks": []}, "source.iterable.iterable.user_unsubscribed_channel_history": {"database": "postgres", "schema": "public", "name": "user_unsubscribed_channel_history", "resource_type": "source", "package_name": "iterable", "path": "models/staging/src_iterable.yml", "original_file_path": "models/staging/src_iterable.yml", "unique_id": "source.iterable.iterable.user_unsubscribed_channel_history", "fqn": ["iterable", "staging", "iterable", "user_unsubscribed_channel_history"], "source_name": "iterable", "source_description": "", "loader": "fivetran", "identifier": "user_unsubscribed_channel_history_data", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Table containing the history of channels from which a user has unsubscribed.", "columns": {"channel_id": {"name": "channel_id", "description": "Reference to the channel from which the user unsubscribed", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "email": {"name": "email", "description": "Unique identifier of the user", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "updated_at": {"name": "updated_at", "description": "Last update timestamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": "_fivetran_synced", "loaded_at_query": null, "meta": {}, "tags": [], "static_analysis": null}, "patch_path": null, "unrendered_config": {"loaded_at_field": "_fivetran_synced", "enabled": true, "loaded_at_query": null, "meta": {}, "tags": []}, "relation_name": "\"postgres\".\"public\".\"user_unsubscribed_channel_history_data\"", "created_at": 1789419973.24428, "unrendered_database": "{% if target.type != 'spark' %}{{ var('iterable_database', target.database)}}{% endif %}", "unrendered_schema": "{{var ('iterable_schema', 'iterable')}}", "doc_blocks": []}, "source.iterable.iterable.user_unsubscribed_message_type_history": {"database": "postgres", "schema": "public", "name": "user_unsubscribed_message_type_history", "resource_type": "source", "package_name": "iterable", "path": "models/staging/src_iterable.yml", "original_file_path": "models/staging/src_iterable.yml", "unique_id": "source.iterable.iterable.user_unsubscribed_message_type_history", "fqn": ["iterable", "staging", "iterable", "user_unsubscribed_message_type_history"], "source_name": "iterable", "source_description": "", "loader": "fivetran", "identifier": "user_unsubscribed_message_type_history_data", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Table containing the history of message types from which a user has unsubscribed.", "columns": {"message_type_id": {"name": "message_type_id", "description": "Reference to the message type from which the user unsubscribed", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "email": {"name": "email", "description": "Unique identifier of the user", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "updated_at": {"name": "updated_at", "description": "Last update timestamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": "_fivetran_synced", "loaded_at_query": null, "meta": {}, "tags": [], "static_analysis": null}, "patch_path": null, "unrendered_config": {"loaded_at_field": "_fivetran_synced", "enabled": true, "loaded_at_query": null, "meta": {}, "tags": []}, "relation_name": "\"postgres\".\"public\".\"user_unsubscribed_message_type_history_data\"", "created_at": 1789419973.2448606, "unrendered_database": "{% if target.type != 'spark' %}{{ var('iterable_database', target.database)}}{% endif %}", "unrendered_schema": "{{var ('iterable_schema', 'iterable')}}", "doc_blocks": []}, "source.iterable.iterable.list_user": {"database": "postgres", "schema": "public", "name": "list_user", "resource_type": "source", "package_name": "iterable", "path": "models/staging/src_iterable.yml", "original_file_path": "models/staging/src_iterable.yml", "unique_id": "source.iterable.iterable.list_user", "fqn": ["iterable", "staging", "iterable", "list_user"], "source_name": "iterable", "source_description": "", "loader": "fivetran", "identifier": "list_user_data", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Table containing the relationship between users and lists they belong to.", "columns": {"_fivetran_id": {"name": "_fivetran_id", "description": "Unique identifier of the list-user relationship record, serving as a foreign key to `user_history._fivetran_id`.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "index": {"name": "index", "description": "Index of the record", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "list_id": {"name": "list_id", "description": "Reference to the list that the user belongs to", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "Timestamp when the record was last synced by Fivetran", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": "_fivetran_synced", "loaded_at_query": null, "meta": {}, "tags": [], "static_analysis": null}, "patch_path": null, "unrendered_config": {"loaded_at_field": "_fivetran_synced", "enabled": true, "loaded_at_query": null, "meta": {}, "tags": []}, "relation_name": "\"postgres\".\"public\".\"list_user_data\"", "created_at": 1789419973.2454312, "unrendered_database": "{% if target.type != 'spark' %}{{ var('iterable_database', target.database)}}{% endif %}", "unrendered_schema": "{{var ('iterable_schema', 'iterable')}}", "doc_blocks": []}}, "macros": {"macro.dbt_postgres.postgres__current_timestamp": {"name": "postgres__current_timestamp", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/timestamps.sql", "original_file_path": "macros/timestamps.sql", "unique_id": "macro.dbt_postgres.postgres__current_timestamp", "macro_sql": "{% macro postgres__current_timestamp() -%}\n now()\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789419969.6603098, "supported_languages": null}, "macro.dbt_postgres.postgres__snapshot_string_as_time": {"name": "postgres__snapshot_string_as_time", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/timestamps.sql", "original_file_path": "macros/timestamps.sql", "unique_id": "macro.dbt_postgres.postgres__snapshot_string_as_time", "macro_sql": "{% macro postgres__snapshot_string_as_time(timestamp) -%}\n {%- set result = \"'\" ~ timestamp ~ \"'::timestamp without time zone\" -%}\n {{ return(result) }}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "timestamp", "type": null, "description": ""}], "created_at": 1789419969.6607194, "supported_languages": null}, "macro.dbt_postgres.postgres__snapshot_get_time": {"name": "postgres__snapshot_get_time", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/timestamps.sql", "original_file_path": "macros/timestamps.sql", "unique_id": "macro.dbt_postgres.postgres__snapshot_get_time", "macro_sql": "{% macro postgres__snapshot_get_time() -%}\n {{ current_timestamp() }}::timestamp without time zone\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.current_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789419969.660946, "supported_languages": null}, "macro.dbt_postgres.postgres__current_timestamp_backcompat": {"name": "postgres__current_timestamp_backcompat", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/timestamps.sql", "original_file_path": "macros/timestamps.sql", "unique_id": "macro.dbt_postgres.postgres__current_timestamp_backcompat", "macro_sql": "{% macro postgres__current_timestamp_backcompat() %}\n current_timestamp::{{ type_timestamp() }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.type_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789419969.6611397, "supported_languages": null}, "macro.dbt_postgres.postgres__current_timestamp_in_utc_backcompat": {"name": "postgres__current_timestamp_in_utc_backcompat", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/timestamps.sql", "original_file_path": "macros/timestamps.sql", "unique_id": "macro.dbt_postgres.postgres__current_timestamp_in_utc_backcompat", "macro_sql": "{% macro postgres__current_timestamp_in_utc_backcompat() %}\n (current_timestamp at time zone 'utc')::{{ type_timestamp() }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.type_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789419969.661326, "supported_languages": null}, "macro.dbt_postgres.postgres__get_catalog_relations": {"name": "postgres__get_catalog_relations", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/catalog.sql", "original_file_path": "macros/catalog.sql", "unique_id": "macro.dbt_postgres.postgres__get_catalog_relations", "macro_sql": "{% macro postgres__get_catalog_relations(information_schema, relations) -%}\n {%- call statement('catalog', fetch_result=True) -%}\n\n {#\n If the user has multiple databases set and the first one is wrong, this will fail.\n But we won't fail in the case where there are multiple quoting-difference-only dbs, which is better.\n #}\n {% set database = information_schema.database %}\n {{ adapter.verify_database(database) }}\n\n select\n '{{ database }}' as table_database,\n sch.nspname as table_schema,\n tbl.relname as table_name,\n case tbl.relkind\n when 'v' then 'VIEW'\n when 'm' then 'MATERIALIZED VIEW'\n else 'BASE TABLE'\n end as table_type,\n tbl_desc.description as table_comment,\n col.attname as column_name,\n col.attnum as column_index,\n pg_catalog.format_type(col.atttypid, col.atttypmod) as column_type,\n col_desc.description as column_comment,\n pg_get_userbyid(tbl.relowner) as table_owner\n\n from pg_catalog.pg_namespace sch\n join pg_catalog.pg_class tbl on tbl.relnamespace = sch.oid\n join pg_catalog.pg_attribute col on col.attrelid = tbl.oid\n left outer join pg_catalog.pg_description tbl_desc on (tbl_desc.objoid = tbl.oid and tbl_desc.objsubid = 0)\n left outer join pg_catalog.pg_description col_desc on (col_desc.objoid = tbl.oid and col_desc.objsubid = col.attnum)\n where (\n {%- for relation in relations -%}\n {%- if relation.identifier -%}\n (upper(sch.nspname) = upper('{{ relation.schema }}') and\n upper(tbl.relname) = upper('{{ relation.identifier }}'))\n {%- else-%}\n upper(sch.nspname) = upper('{{ relation.schema }}')\n {%- endif -%}\n {%- if not loop.last %} or {% endif -%}\n {%- endfor -%}\n )\n and not pg_is_other_temp_schema(sch.oid) -- not a temporary schema belonging to another session\n and tbl.relpersistence in ('p', 'u') -- [p]ermanent table or [u]nlogged table. Exclude [t]emporary tables\n and tbl.relkind in ('r', 'v', 'f', 'p', 'm') -- o[r]dinary table, [v]iew, [f]oreign table, [p]artitioned table, [m]aterialized view. Other values are [i]ndex, [S]equence, [c]omposite type, [t]OAST table\n and col.attnum > 0 -- negative numbers are used for system columns such as oid\n and not col.attisdropped -- column as not been dropped\n\n order by\n sch.nspname,\n tbl.relname,\n col.attnum\n\n {%- endcall -%}\n\n {{ return(load_result('catalog').table) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "information_schema", "type": null, "description": ""}, {"name": "relations", "type": null, "description": ""}], "created_at": 1789419969.6632376, "supported_languages": null}, "macro.dbt_postgres.postgres__get_catalog": {"name": "postgres__get_catalog", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/catalog.sql", "original_file_path": "macros/catalog.sql", "unique_id": "macro.dbt_postgres.postgres__get_catalog", "macro_sql": "{% macro postgres__get_catalog(information_schema, schemas) -%}\n {%- set relations = [] -%}\n {%- for schema in schemas -%}\n {%- set dummy = relations.append({'schema': schema}) -%}\n {%- endfor -%}\n {{ return(postgres__get_catalog_relations(information_schema, relations)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__get_catalog_relations"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "information_schema", "type": null, "description": ""}, {"name": "schemas", "type": null, "description": ""}], "created_at": 1789419969.663897, "supported_languages": null}, "macro.dbt_postgres.postgres__get_relations": {"name": "postgres__get_relations", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/relations.sql", "original_file_path": "macros/relations.sql", "unique_id": "macro.dbt_postgres.postgres__get_relations", "macro_sql": "{% macro postgres__get_relations() -%}\n\n {#\n -- in pg_depend, objid is the dependent, refobjid is the referenced object\n -- > a pg_depend entry indicates that the referenced object cannot be\n -- > dropped without also dropping the dependent object.\n #}\n\n {%- call statement('relations', fetch_result=True) -%}\n select distinct\n dependent_namespace.nspname as dependent_schema,\n dependent_class.relname as dependent_name,\n referenced_namespace.nspname as referenced_schema,\n referenced_class.relname as referenced_name\n\n -- Query for views: views are entries in pg_class with an entry in pg_rewrite, but we avoid\n -- a seq scan on pg_rewrite by leveraging the fact there is an \"internal\" row in pg_depend for\n -- the view...\n from pg_class as dependent_class\n join pg_namespace as dependent_namespace on dependent_namespace.oid = dependent_class.relnamespace\n join pg_depend as dependent_depend on dependent_depend.refobjid = dependent_class.oid\n and dependent_depend.classid = 'pg_rewrite'::regclass\n and dependent_depend.refclassid = 'pg_class'::regclass\n and dependent_depend.deptype = 'i'\n\n -- ... and via pg_depend (that has a row per column, hence the need for \"distinct\" above, and\n -- making sure to exclude the internal row to avoid a view appearing to depend on itself)...\n join pg_depend as joining_depend on joining_depend.objid = dependent_depend.objid\n and joining_depend.classid = 'pg_rewrite'::regclass\n and joining_depend.refclassid = 'pg_class'::regclass\n and joining_depend.refobjid != dependent_depend.refobjid\n\n -- ... we can find the tables they query from in pg_class, but excluding system tables. Note we\n -- don't need need to exclude _dependent_ system tables, because they only query from other\n -- system tables, and so are automatically excluded by excluding _referenced_ system tables\n join pg_class as referenced_class on referenced_class.oid = joining_depend.refobjid\n join pg_namespace as referenced_namespace on referenced_namespace.oid = referenced_class.relnamespace\n and referenced_namespace.nspname != 'information_schema'\n and referenced_namespace.nspname not like 'pg\\_%'\n\n order by\n dependent_schema, dependent_name, referenced_schema, referenced_name;\n\n {%- endcall -%}\n\n {{ return(load_result('relations').table) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789419969.6648376, "supported_languages": null}, "macro.dbt_postgres.postgres_get_relations": {"name": "postgres_get_relations", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/relations.sql", "original_file_path": "macros/relations.sql", "unique_id": "macro.dbt_postgres.postgres_get_relations", "macro_sql": "{% macro postgres_get_relations() %}\n {{ return(postgres__get_relations()) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__get_relations"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789419969.6650686, "supported_languages": null}, "macro.dbt_postgres.postgres__create_table_as": {"name": "postgres__create_table_as", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "unique_id": "macro.dbt_postgres.postgres__create_table_as", "macro_sql": "{% macro postgres__create_table_as(temporary, relation, sql) -%}\n {%- set unlogged = config.get('unlogged', default=false) -%}\n {%- set sql_header = config.get('sql_header', none) -%}\n\n {{ sql_header if sql_header is not none }}\n\n create {% if temporary -%}\n temporary\n {%- elif unlogged -%}\n unlogged\n {%- endif %} table {{ relation }}\n {% set contract_config = config.get('contract') %}\n {% if contract_config.enforced %}\n {{ get_assert_columns_equivalent(sql) }}\n {% endif -%}\n {% if contract_config.enforced and (not temporary) -%}\n {{ get_table_columns_and_constraints() }} ;\n insert into {{ relation }} (\n {{ adapter.dispatch('get_column_names', 'dbt')() }}\n )\n {%- set sql = get_select_subquery(sql) %}\n {% else %}\n as\n {% endif %}\n (\n {{ sql }}\n );\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.get_assert_columns_equivalent", "macro.dbt.get_table_columns_and_constraints", "macro.dbt.default__get_column_names", "macro.dbt.get_select_subquery"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "temporary", "type": null, "description": ""}, {"name": "relation", "type": null, "description": ""}, {"name": "sql", "type": null, "description": ""}], "created_at": 1789419969.6691167, "supported_languages": null}, "macro.dbt_postgres.postgres__get_create_index_sql": {"name": "postgres__get_create_index_sql", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "unique_id": "macro.dbt_postgres.postgres__get_create_index_sql", "macro_sql": "{% macro postgres__get_create_index_sql(relation, index_dict) -%}\n {%- set index_config = adapter.parse_index(index_dict) -%}\n {%- set comma_separated_columns = \", \".join(index_config.columns) -%}\n {%- set index_name = index_config.render(relation) -%}\n\n create {% if index_config.unique -%}\n unique\n {%- endif %} index if not exists\n \"{{ index_name }}\"\n on {{ relation }} {% if index_config.type -%}\n using {{ index_config.type }}\n {%- endif %}\n ({{ comma_separated_columns }})\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "index_dict", "type": null, "description": ""}], "created_at": 1789419969.6699846, "supported_languages": null}, "macro.dbt_postgres.postgres__create_schema": {"name": "postgres__create_schema", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "unique_id": "macro.dbt_postgres.postgres__create_schema", "macro_sql": "{% macro postgres__create_schema(relation) -%}\n {% if relation.database -%}\n {{ adapter.verify_database(relation.database) }}\n {%- endif -%}\n {%- call statement('create_schema') -%}\n create schema if not exists {{ relation.without_identifier().include(database=False) }}\n {%- endcall -%}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789419969.6705961, "supported_languages": null}, "macro.dbt_postgres.postgres__drop_schema": {"name": "postgres__drop_schema", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "unique_id": "macro.dbt_postgres.postgres__drop_schema", "macro_sql": "{% macro postgres__drop_schema(relation) -%}\n {% if relation.database -%}\n {{ adapter.verify_database(relation.database) }}\n {%- endif -%}\n {%- call statement('drop_schema') -%}\n drop schema if exists {{ relation.without_identifier().include(database=False) }} cascade\n {%- endcall -%}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789419969.6712496, "supported_languages": null}, "macro.dbt_postgres.postgres__get_columns_in_relation": {"name": "postgres__get_columns_in_relation", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "unique_id": "macro.dbt_postgres.postgres__get_columns_in_relation", "macro_sql": "{% macro postgres__get_columns_in_relation(relation) -%}\n {% call statement('get_columns_in_relation', fetch_result=True) %}\n select\n column_name,\n data_type,\n character_maximum_length,\n numeric_precision,\n numeric_scale\n\n from {{ relation.information_schema('columns') }}\n where table_name = '{{ relation.identifier }}'\n {% if relation.schema %}\n and table_schema = '{{ relation.schema }}'\n {% endif %}\n order by ordinal_position\n\n {% endcall %}\n {% set table = load_result('get_columns_in_relation').table %}\n {{ return(sql_convert_columns_in_relation(table)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement", "macro.dbt.sql_convert_columns_in_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789419969.6720796, "supported_languages": null}, "macro.dbt_postgres.postgres__list_relations_without_caching": {"name": "postgres__list_relations_without_caching", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "unique_id": "macro.dbt_postgres.postgres__list_relations_without_caching", "macro_sql": "{% macro postgres__list_relations_without_caching(schema_relation) %}\n {% call statement('list_relations_without_caching', fetch_result=True) -%}\n select\n '{{ schema_relation.database }}' as database,\n tablename as name,\n schemaname as schema,\n 'table' as type\n from pg_tables\n where schemaname ilike '{{ schema_relation.schema }}'\n union all\n select\n '{{ schema_relation.database }}' as database,\n viewname as name,\n schemaname as schema,\n 'view' as type\n from pg_views\n where schemaname ilike '{{ schema_relation.schema }}'\n union all\n select\n '{{ schema_relation.database }}' as database,\n matviewname as name,\n schemaname as schema,\n 'materialized_view' as type\n from pg_matviews\n where schemaname ilike '{{ schema_relation.schema }}'\n union all\n select distinct\n '{{ schema_relation.database }}' as database,\n proname as name,\n ns.nspname as schema,\n 'function' as type\n from pg_proc\n join pg_namespace as ns on pronamespace = ns.oid\n where ns.nspname ilike '{{ schema_relation.schema }}'\n {% endcall %}\n {{ return(load_result('list_relations_without_caching').table) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "schema_relation", "type": null, "description": ""}], "created_at": 1789419969.6729307, "supported_languages": null}, "macro.dbt_postgres.postgres__information_schema_name": {"name": "postgres__information_schema_name", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "unique_id": "macro.dbt_postgres.postgres__information_schema_name", "macro_sql": "{% macro postgres__information_schema_name(database) -%}\n {% if database_name -%}\n {{ adapter.verify_database(database_name) }}\n {%- endif -%}\n information_schema\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "database", "type": null, "description": ""}], "created_at": 1789419969.6732242, "supported_languages": null}, "macro.dbt_postgres.postgres__list_schemas": {"name": "postgres__list_schemas", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "unique_id": "macro.dbt_postgres.postgres__list_schemas", "macro_sql": "{% macro postgres__list_schemas(database) %}\n {% if database -%}\n {{ adapter.verify_database(database) }}\n {%- endif -%}\n {% call statement('list_schemas', fetch_result=True, auto_begin=False) %}\n select distinct nspname from pg_namespace\n {% endcall %}\n {{ return(load_result('list_schemas').table) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "database", "type": null, "description": ""}], "created_at": 1789419969.6738021, "supported_languages": null}, "macro.dbt_postgres.postgres__check_schema_exists": {"name": "postgres__check_schema_exists", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "unique_id": "macro.dbt_postgres.postgres__check_schema_exists", "macro_sql": "{% macro postgres__check_schema_exists(information_schema, schema) -%}\n {% if information_schema.database -%}\n {{ adapter.verify_database(information_schema.database) }}\n {%- endif -%}\n {% call statement('check_schema_exists', fetch_result=True, auto_begin=False) %}\n select count(*) from pg_namespace where nspname = '{{ schema }}'\n {% endcall %}\n {{ return(load_result('check_schema_exists').table) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "information_schema", "type": null, "description": ""}, {"name": "schema", "type": null, "description": ""}], "created_at": 1789419969.6744528, "supported_languages": null}, "macro.dbt_postgres.postgres__make_relation_with_suffix": {"name": "postgres__make_relation_with_suffix", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "unique_id": "macro.dbt_postgres.postgres__make_relation_with_suffix", "macro_sql": "{% macro postgres__make_relation_with_suffix(base_relation, suffix, dstring) %}\n {% if dstring %}\n {% set dt = modules.datetime.datetime.now() %}\n {% set dtstring = dt.strftime(\"%H%M%S%f\") %}\n {% set suffix = suffix ~ dtstring %}\n {% endif %}\n {% set suffix_length = suffix|length %}\n {% set relation_max_name_length = base_relation.relation_max_name_length() %}\n {% if suffix_length > relation_max_name_length %}\n {% do exceptions.raise_compiler_error('Relation suffix is too long (' ~ suffix_length ~ ' characters). Maximum length is ' ~ relation_max_name_length ~ ' characters.') %}\n {% endif %}\n {% set identifier = base_relation.identifier[:relation_max_name_length - suffix_length] ~ suffix %}\n\n {{ return(base_relation.incorporate(path={\"identifier\": identifier })) }}\n\n {% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "base_relation", "type": null, "description": ""}, {"name": "suffix", "type": null, "description": ""}, {"name": "dstring", "type": null, "description": ""}], "created_at": 1789419969.6759813, "supported_languages": null}, "macro.dbt_postgres.postgres__make_intermediate_relation": {"name": "postgres__make_intermediate_relation", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "unique_id": "macro.dbt_postgres.postgres__make_intermediate_relation", "macro_sql": "{% macro postgres__make_intermediate_relation(base_relation, suffix) %}\n {{ return(postgres__make_relation_with_suffix(base_relation, suffix, dstring=False)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__make_relation_with_suffix"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "base_relation", "type": null, "description": ""}, {"name": "suffix", "type": null, "description": ""}], "created_at": 1789419969.6763268, "supported_languages": null}, "macro.dbt_postgres.postgres__make_temp_relation": {"name": "postgres__make_temp_relation", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "unique_id": "macro.dbt_postgres.postgres__make_temp_relation", "macro_sql": "{% macro postgres__make_temp_relation(base_relation, suffix) %}\n {% set temp_relation = postgres__make_relation_with_suffix(base_relation, suffix, dstring=True) %}\n {{ return(temp_relation.incorporate(path={\"schema\": none,\n \"database\": none})) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__make_relation_with_suffix"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "base_relation", "type": null, "description": ""}, {"name": "suffix", "type": null, "description": ""}], "created_at": 1789419969.676878, "supported_languages": null}, "macro.dbt_postgres.postgres__make_backup_relation": {"name": "postgres__make_backup_relation", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "unique_id": "macro.dbt_postgres.postgres__make_backup_relation", "macro_sql": "{% macro postgres__make_backup_relation(base_relation, backup_relation_type, suffix) %}\n {% set backup_relation = postgres__make_relation_with_suffix(base_relation, suffix, dstring=False) %}\n {{ return(backup_relation.incorporate(type=backup_relation_type)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__make_relation_with_suffix"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "base_relation", "type": null, "description": ""}, {"name": "backup_relation_type", "type": null, "description": ""}, {"name": "suffix", "type": null, "description": ""}], "created_at": 1789419969.6773393, "supported_languages": null}, "macro.dbt_postgres.postgres_escape_comment": {"name": "postgres_escape_comment", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "unique_id": "macro.dbt_postgres.postgres_escape_comment", "macro_sql": "{% macro postgres_escape_comment(comment) -%}\n {% if comment is not string %}\n {% do exceptions.raise_compiler_error('cannot escape a non-string: ' ~ comment) %}\n {% endif %}\n {%- set magic = '$dbt_comment_literal_block$' -%}\n {%- if magic in comment -%}\n {%- do exceptions.raise_compiler_error('The string ' ~ magic ~ ' is not allowed in comments.') -%}\n {%- endif -%}\n {{ magic }}{{ comment }}{{ magic }}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "comment", "type": null, "description": ""}], "created_at": 1789419969.6780698, "supported_languages": null}, "macro.dbt_postgres.postgres__alter_relation_comment": {"name": "postgres__alter_relation_comment", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "unique_id": "macro.dbt_postgres.postgres__alter_relation_comment", "macro_sql": "{% macro postgres__alter_relation_comment(relation, comment) %}\n {% set escaped_comment = postgres_escape_comment(comment) %}\n {% if relation.type == 'materialized_view' -%}\n {% set relation_type = \"materialized view\" %}\n {%- else -%}\n {%- set relation_type = relation.type -%}\n {%- endif -%}\n comment on {{ relation_type }} {{ relation }} is {{ escaped_comment }};\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres_escape_comment"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "comment", "type": null, "description": ""}], "created_at": 1789419969.678695, "supported_languages": null}, "macro.dbt_postgres.postgres__alter_column_comment": {"name": "postgres__alter_column_comment", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "unique_id": "macro.dbt_postgres.postgres__alter_column_comment", "macro_sql": "{% macro postgres__alter_column_comment(relation, column_dict) %}\n {% set existing_columns = adapter.get_columns_in_relation(relation) | map(attribute=\"name\") | list %}\n {% for column_name in column_dict if (column_name in existing_columns) %}\n {% set comment = column_dict[column_name]['description'] %}\n {% set escaped_comment = postgres_escape_comment(comment) %}\n comment on column {{ relation }}.{{ adapter.quote(column_name) if column_dict[column_name]['quote'] else column_name }} is {{ escaped_comment }};\n {% endfor %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres_escape_comment"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "column_dict", "type": null, "description": ""}], "created_at": 1789419969.6796932, "supported_languages": null}, "macro.dbt_postgres.postgres__get_show_grant_sql": {"name": "postgres__get_show_grant_sql", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "unique_id": "macro.dbt_postgres.postgres__get_show_grant_sql", "macro_sql": "\n\n{%- macro postgres__get_show_grant_sql(relation) -%}\n select grantee, privilege_type\n from {{ relation.information_schema('role_table_grants') }}\n where grantor = current_role\n and grantee != current_role\n and table_schema = '{{ relation.schema }}'\n and table_name = '{{ relation.identifier }}'\n{%- endmacro -%}\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789419969.6800566, "supported_languages": null}, "macro.dbt_postgres.postgres__copy_grants": {"name": "postgres__copy_grants", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "unique_id": "macro.dbt_postgres.postgres__copy_grants", "macro_sql": "{% macro postgres__copy_grants() %}\n {{ return(False) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789419969.680255, "supported_languages": null}, "macro.dbt_postgres.postgres__get_show_indexes_sql": {"name": "postgres__get_show_indexes_sql", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "unique_id": "macro.dbt_postgres.postgres__get_show_indexes_sql", "macro_sql": "{% macro postgres__get_show_indexes_sql(relation) %}\n select\n i.relname as name,\n m.amname as method,\n ix.indisunique as \"unique\",\n array_to_string(array_agg(a.attname), ',') as column_names\n from pg_index ix\n join pg_class i\n on i.oid = ix.indexrelid\n join pg_am m\n on m.oid=i.relam\n join pg_class t\n on t.oid = ix.indrelid\n join pg_namespace n\n on n.oid = t.relnamespace\n join pg_attribute a\n on a.attrelid = t.oid\n and a.attnum = ANY(ix.indkey)\n where t.relname = '{{ relation.identifier }}'\n and n.nspname = '{{ relation.schema }}'\n and t.relkind in ('r', 'm')\n group by 1, 2, 3\n order by 1, 2, 3\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789419969.6805992, "supported_languages": null}, "macro.dbt_postgres.postgres__get_drop_index_sql": {"name": "postgres__get_drop_index_sql", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "unique_id": "macro.dbt_postgres.postgres__get_drop_index_sql", "macro_sql": "\n\n\n{%- macro postgres__get_drop_index_sql(relation, index_name) -%}\n drop index if exists \"{{ relation.schema }}\".\"{{ index_name }}\"\n{%- endmacro -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "index_name", "type": null, "description": ""}], "created_at": 1789419969.6808674, "supported_languages": null}, "macro.dbt_postgres.postgres__get_create_materialized_view_as_sql": {"name": "postgres__get_create_materialized_view_as_sql", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/relations/materialized_view/create.sql", "original_file_path": "macros/relations/materialized_view/create.sql", "unique_id": "macro.dbt_postgres.postgres__get_create_materialized_view_as_sql", "macro_sql": "{% macro postgres__get_create_materialized_view_as_sql(relation, sql) %}\n create materialized view if not exists {{ relation }} as {{ sql }};\n\n {% for _index_dict in config.get('indexes', []) -%}\n {{- get_create_index_sql(relation, _index_dict) -}}{{ ';' if not loop.last else \"\" }}\n {%- endfor -%}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_create_index_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "sql", "type": null, "description": ""}], "created_at": 1789419969.6816542, "supported_languages": null}, "macro.dbt_postgres.postgres__get_alter_materialized_view_as_sql": {"name": "postgres__get_alter_materialized_view_as_sql", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/relations/materialized_view/alter.sql", "original_file_path": "macros/relations/materialized_view/alter.sql", "unique_id": "macro.dbt_postgres.postgres__get_alter_materialized_view_as_sql", "macro_sql": "{% macro postgres__get_alter_materialized_view_as_sql(\n relation,\n configuration_changes,\n sql,\n existing_relation,\n backup_relation,\n intermediate_relation\n) %}\n\n -- apply a full refresh immediately if needed\n {% if configuration_changes.requires_full_refresh %}\n\n {{ get_replace_sql(existing_relation, relation, sql) }}\n\n -- otherwise apply individual changes as needed\n {% else %}\n\n {{ postgres__update_indexes_on_materialized_view(relation, configuration_changes.indexes) }}\n\n {%- endif -%}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_replace_sql", "macro.dbt_postgres.postgres__update_indexes_on_materialized_view"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "configuration_changes", "type": null, "description": ""}, {"name": "sql", "type": null, "description": ""}, {"name": "existing_relation", "type": null, "description": ""}, {"name": "backup_relation", "type": null, "description": ""}, {"name": "intermediate_relation", "type": null, "description": ""}], "created_at": 1789419969.6827197, "supported_languages": null}, "macro.dbt_postgres.postgres__update_indexes_on_materialized_view": {"name": "postgres__update_indexes_on_materialized_view", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/relations/materialized_view/alter.sql", "original_file_path": "macros/relations/materialized_view/alter.sql", "unique_id": "macro.dbt_postgres.postgres__update_indexes_on_materialized_view", "macro_sql": "\n\n\n{%- macro postgres__update_indexes_on_materialized_view(relation, index_changes) -%}\n {{- log(\"Applying UPDATE INDEXES to: \" ~ relation) -}}\n\n {%- for _index_change in index_changes -%}\n {%- set _index = _index_change.context -%}\n\n {%- if _index_change.action == \"drop\" -%}\n\n {{ postgres__get_drop_index_sql(relation, _index.name) }}\n\n {%- elif _index_change.action == \"create\" -%}\n\n {{ postgres__get_create_index_sql(relation, _index.as_node_config) }}\n\n {%- endif -%}\n\t{{ ';' if not loop.last else \"\" }}\n\n {%- endfor -%}\n\n{%- endmacro -%}\n\n\n", "depends_on": {"macros": ["macro.dbt_postgres.postgres__get_drop_index_sql", "macro.dbt_postgres.postgres__get_create_index_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "index_changes", "type": null, "description": ""}], "created_at": 1789419969.6836293, "supported_languages": null}, "macro.dbt_postgres.postgres__get_materialized_view_configuration_changes": {"name": "postgres__get_materialized_view_configuration_changes", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/relations/materialized_view/alter.sql", "original_file_path": "macros/relations/materialized_view/alter.sql", "unique_id": "macro.dbt_postgres.postgres__get_materialized_view_configuration_changes", "macro_sql": "{% macro postgres__get_materialized_view_configuration_changes(existing_relation, new_config) %}\n {% set _existing_materialized_view = postgres__describe_materialized_view(existing_relation) %}\n {% set _configuration_changes = existing_relation.get_materialized_view_config_change_collection(_existing_materialized_view, new_config.model) %}\n {% do return(_configuration_changes) %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__describe_materialized_view"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "existing_relation", "type": null, "description": ""}, {"name": "new_config", "type": null, "description": ""}], "created_at": 1789419969.6841438, "supported_languages": null}, "macro.dbt_postgres.postgres__get_rename_materialized_view_sql": {"name": "postgres__get_rename_materialized_view_sql", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/relations/materialized_view/rename.sql", "original_file_path": "macros/relations/materialized_view/rename.sql", "unique_id": "macro.dbt_postgres.postgres__get_rename_materialized_view_sql", "macro_sql": "{% macro postgres__get_rename_materialized_view_sql(relation, new_name) %}\n alter materialized view {{ relation }} rename to {{ new_name }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "new_name", "type": null, "description": ""}], "created_at": 1789419969.6844664, "supported_languages": null}, "macro.dbt_postgres.postgres__refresh_materialized_view": {"name": "postgres__refresh_materialized_view", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/relations/materialized_view/refresh.sql", "original_file_path": "macros/relations/materialized_view/refresh.sql", "unique_id": "macro.dbt_postgres.postgres__refresh_materialized_view", "macro_sql": "{% macro postgres__refresh_materialized_view(relation) %}\n refresh materialized view {{ relation }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789419969.684712, "supported_languages": null}, "macro.dbt_postgres.postgres__drop_materialized_view": {"name": "postgres__drop_materialized_view", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/relations/materialized_view/drop.sql", "original_file_path": "macros/relations/materialized_view/drop.sql", "unique_id": "macro.dbt_postgres.postgres__drop_materialized_view", "macro_sql": "{% macro postgres__drop_materialized_view(relation) -%}\n drop materialized view if exists {{ relation }} cascade\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789419969.6849651, "supported_languages": null}, "macro.dbt_postgres.postgres__describe_materialized_view": {"name": "postgres__describe_materialized_view", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/relations/materialized_view/describe.sql", "original_file_path": "macros/relations/materialized_view/describe.sql", "unique_id": "macro.dbt_postgres.postgres__describe_materialized_view", "macro_sql": "{% macro postgres__describe_materialized_view(relation) %}\n -- for now just get the indexes, we don't need the name or the query yet\n {% set _indexes = run_query(get_show_indexes_sql(relation)) %}\n {% do return({'indexes': _indexes}) %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.run_query", "macro.dbt.get_show_indexes_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789419969.6856048, "supported_languages": null}, "macro.dbt_postgres.postgres__get_rename_view_sql": {"name": "postgres__get_rename_view_sql", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/relations/view/rename.sql", "original_file_path": "macros/relations/view/rename.sql", "unique_id": "macro.dbt_postgres.postgres__get_rename_view_sql", "macro_sql": "{% macro postgres__get_rename_view_sql(relation, new_name) %}\n alter view {{ relation }} rename to {{ new_name }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "new_name", "type": null, "description": ""}], "created_at": 1789419969.6859329, "supported_languages": null}, "macro.dbt_postgres.postgres__drop_view": {"name": "postgres__drop_view", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/relations/view/drop.sql", "original_file_path": "macros/relations/view/drop.sql", "unique_id": "macro.dbt_postgres.postgres__drop_view", "macro_sql": "{% macro postgres__drop_view(relation) -%}\n drop view if exists {{ relation }} cascade\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789419969.686179, "supported_languages": null}, "macro.dbt_postgres.postgres__get_replace_view_sql": {"name": "postgres__get_replace_view_sql", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/relations/view/replace.sql", "original_file_path": "macros/relations/view/replace.sql", "unique_id": "macro.dbt_postgres.postgres__get_replace_view_sql", "macro_sql": "{% macro postgres__get_replace_view_sql(relation, sql) -%}\n\n {%- set sql_header = config.get('sql_header', none) -%}\n {{ sql_header if sql_header is not none }}\n\n create or replace view {{ relation }}\n {% set contract_config = config.get('contract') %}\n {% if contract_config.enforced %}\n {{ get_assert_columns_equivalent(sql) }}\n {%- endif %}\n as (\n {{ sql }}\n );\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.get_assert_columns_equivalent"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "sql", "type": null, "description": ""}], "created_at": 1789419969.687095, "supported_languages": null}, "macro.dbt_postgres.postgres__get_rename_table_sql": {"name": "postgres__get_rename_table_sql", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/relations/table/rename.sql", "original_file_path": "macros/relations/table/rename.sql", "unique_id": "macro.dbt_postgres.postgres__get_rename_table_sql", "macro_sql": "{% macro postgres__get_rename_table_sql(relation, new_name) %}\n alter table {{ relation }} rename to {{ new_name }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "new_name", "type": null, "description": ""}], "created_at": 1789419969.6874127, "supported_languages": null}, "macro.dbt_postgres.postgres__drop_table": {"name": "postgres__drop_table", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/relations/table/drop.sql", "original_file_path": "macros/relations/table/drop.sql", "unique_id": "macro.dbt_postgres.postgres__drop_table", "macro_sql": "{% macro postgres__drop_table(relation) -%}\n drop table if exists {{ relation }} cascade\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789419969.6876535, "supported_languages": null}, "macro.dbt_postgres.postgres__get_replace_table_sql": {"name": "postgres__get_replace_table_sql", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/relations/table/replace.sql", "original_file_path": "macros/relations/table/replace.sql", "unique_id": "macro.dbt_postgres.postgres__get_replace_table_sql", "macro_sql": "{% macro postgres__get_replace_table_sql(relation, sql) -%}\n\n {%- set sql_header = config.get('sql_header', none) -%}\n {{ sql_header if sql_header is not none }}\n\n create or replace table {{ relation }}\n {% set contract_config = config.get('contract') %}\n {% if contract_config.enforced %}\n {{ get_assert_columns_equivalent(sql) }}\n {{ get_table_columns_and_constraints() }}\n {%- set sql = get_select_subquery(sql) %}\n {% endif %}\n as (\n {{ sql }}\n );\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.get_assert_columns_equivalent", "macro.dbt.get_table_columns_and_constraints", "macro.dbt.get_select_subquery"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "sql", "type": null, "description": ""}], "created_at": 1789419969.6887176, "supported_languages": null}, "macro.dbt_postgres.postgres__get_incremental_default_sql": {"name": "postgres__get_incremental_default_sql", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/materializations/incremental_strategies.sql", "original_file_path": "macros/materializations/incremental_strategies.sql", "unique_id": "macro.dbt_postgres.postgres__get_incremental_default_sql", "macro_sql": "{% macro postgres__get_incremental_default_sql(arg_dict) %}\n\n {% if arg_dict[\"unique_key\"] %}\n {% do return(get_incremental_delete_insert_sql(arg_dict)) %}\n {% else %}\n {% do return(get_incremental_append_sql(arg_dict)) %}\n {% endif %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_incremental_delete_insert_sql", "macro.dbt.get_incremental_append_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "arg_dict", "type": null, "description": ""}], "created_at": 1789419969.689497, "supported_languages": null}, "macro.dbt_postgres.postgres__get_incremental_microbatch_sql": {"name": "postgres__get_incremental_microbatch_sql", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/materializations/incremental_strategies.sql", "original_file_path": "macros/materializations/incremental_strategies.sql", "unique_id": "macro.dbt_postgres.postgres__get_incremental_microbatch_sql", "macro_sql": "{% macro postgres__get_incremental_microbatch_sql(arg_dict) %}\n\n {% if arg_dict[\"unique_key\"] %}\n {% do return(adapter.dispatch('get_incremental_merge_sql', 'dbt')(arg_dict)) %}\n {% else %}\n {{ exceptions.raise_compiler_error(\"dbt-postgres 'microbatch' requires a `unique_key` config\") }}\n {% endif %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_incremental_merge_sql", "macro.dbt.default__get_incremental_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "arg_dict", "type": null, "description": ""}], "created_at": 1789419969.6900623, "supported_languages": null}, "macro.dbt_postgres.postgres__snapshot_merge_sql": {"name": "postgres__snapshot_merge_sql", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/materializations/snapshot_merge.sql", "original_file_path": "macros/materializations/snapshot_merge.sql", "unique_id": "macro.dbt_postgres.postgres__snapshot_merge_sql", "macro_sql": "{% macro postgres__snapshot_merge_sql(target, source, insert_cols) -%}\n {%- set insert_cols_csv = insert_cols | join(', ') -%}\n\n {%- set columns = config.get(\"snapshot_table_column_names\") or get_snapshot_table_column_names() -%}\n\n update {{ target }}\n set {{ columns.dbt_valid_to }} = DBT_INTERNAL_SOURCE.{{ columns.dbt_valid_to }}\n from {{ source }} as DBT_INTERNAL_SOURCE\n where DBT_INTERNAL_SOURCE.{{ columns.dbt_scd_id }}::text = {{ target }}.{{ columns.dbt_scd_id }}::text\n and DBT_INTERNAL_SOURCE.dbt_change_type::text in ('update'::text, 'delete'::text)\n {% if config.get(\"dbt_valid_to_current\") %}\n and ({{ target }}.{{ columns.dbt_valid_to }} = {{ config.get('dbt_valid_to_current') }} or {{ target }}.{{ columns.dbt_valid_to }} is null);\n {% else %}\n and {{ target }}.{{ columns.dbt_valid_to }} is null;\n {% endif %}\n\n\n insert into {{ target }} ({{ insert_cols_csv }})\n select {% for column in insert_cols -%}\n DBT_INTERNAL_SOURCE.{{ column }} {%- if not loop.last %}, {%- endif %}\n {%- endfor %}\n from {{ source }} as DBT_INTERNAL_SOURCE\n where DBT_INTERNAL_SOURCE.dbt_change_type::text = 'insert'::text;\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_snapshot_table_column_names"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "target", "type": null, "description": ""}, {"name": "source", "type": null, "description": ""}, {"name": "insert_cols", "type": null, "description": ""}], "created_at": 1789419969.6919851, "supported_languages": null}, "macro.dbt_postgres.postgres__formatted_scalar_function_args_sql": {"name": "postgres__formatted_scalar_function_args_sql", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/materializations/functions/scalar.sql", "original_file_path": "macros/materializations/functions/scalar.sql", "unique_id": "macro.dbt_postgres.postgres__formatted_scalar_function_args_sql", "macro_sql": "{% macro postgres__formatted_scalar_function_args_sql() %}\n {% set args = [] %}\n {% for arg in model.arguments -%}\n {% set default_value = arg.get('default_value', none) %}\n {% if default_value != none %}\n {%- do args.append(arg.name ~ ' ' ~ arg.data_type ~ ' DEFAULT ' ~ default_value) -%}\n {% else %}\n {%- do args.append(arg.name ~ ' ' ~ arg.data_type) -%}\n {% endif %}\n {%- endfor %}\n {{ args | join(', ') }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789419969.693192, "supported_languages": null}, "macro.dbt_postgres.postgres__last_day": {"name": "postgres__last_day", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/utils/last_day.sql", "original_file_path": "macros/utils/last_day.sql", "unique_id": "macro.dbt_postgres.postgres__last_day", "macro_sql": "{% macro postgres__last_day(date, datepart) -%}\n\n {%- if datepart == 'quarter' -%}\n -- postgres dateadd does not support quarter interval.\n cast(\n {{dbt.dateadd('day', '-1',\n dbt.dateadd('month', '3', dbt.date_trunc(datepart, date))\n )}}\n as date)\n {%- else -%}\n {{dbt.default_last_day(date, datepart)}}\n {%- endif -%}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.dateadd", "macro.dbt.date_trunc", "macro.dbt.default_last_day"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "date", "type": null, "description": ""}, {"name": "datepart", "type": null, "description": ""}], "created_at": 1789419969.6940668, "supported_languages": null}, "macro.dbt_postgres.postgres__listagg": {"name": "postgres__listagg", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/utils/listagg.sql", "original_file_path": "macros/utils/listagg.sql", "unique_id": "macro.dbt_postgres.postgres__listagg", "macro_sql": "{% macro postgres__listagg(measure, delimiter_text, order_by_clause, limit_num) -%}\n\n {% if limit_num -%}\n array_to_string(\n (array_agg(\n {{ measure }}\n {% if order_by_clause -%}\n {{ order_by_clause }}\n {%- endif %}\n ))[1:{{ limit_num }}],\n {{ delimiter_text }}\n )\n {%- else %}\n string_agg(\n {{ measure }},\n {{ delimiter_text }}\n {% if order_by_clause -%}\n {{ order_by_clause }}\n {%- endif %}\n )\n {%- endif %}\n\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "measure", "type": null, "description": ""}, {"name": "delimiter_text", "type": null, "description": ""}, {"name": "order_by_clause", "type": null, "description": ""}, {"name": "limit_num", "type": null, "description": ""}], "created_at": 1789419969.6949735, "supported_languages": null}, "macro.dbt_postgres.postgres__any_value": {"name": "postgres__any_value", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/utils/any_value.sql", "original_file_path": "macros/utils/any_value.sql", "unique_id": "macro.dbt_postgres.postgres__any_value", "macro_sql": "{% macro postgres__any_value(expression) -%}\n\n min({{ expression }})\n\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "expression", "type": null, "description": ""}], "created_at": 1789419969.6952403, "supported_languages": null}, "macro.dbt_postgres.postgres__datediff": {"name": "postgres__datediff", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/utils/datediff.sql", "original_file_path": "macros/utils/datediff.sql", "unique_id": "macro.dbt_postgres.postgres__datediff", "macro_sql": "{% macro postgres__datediff(first_date, second_date, datepart) -%}\n\n {% if datepart == 'year' %}\n (date_part('year', ({{second_date}})::date) - date_part('year', ({{first_date}})::date))\n {% elif datepart == 'quarter' %}\n ({{ datediff(first_date, second_date, 'year') }} * 4 + date_part('quarter', ({{second_date}})::date) - date_part('quarter', ({{first_date}})::date))\n {% elif datepart == 'month' %}\n ({{ datediff(first_date, second_date, 'year') }} * 12 + date_part('month', ({{second_date}})::date) - date_part('month', ({{first_date}})::date))\n {% elif datepart == 'day' %}\n (({{second_date}})::date - ({{first_date}})::date)\n {% elif datepart == 'week' %}\n ({{ datediff(first_date, second_date, 'day') }} / 7 + case\n when date_part('dow', ({{first_date}})::timestamp) <= date_part('dow', ({{second_date}})::timestamp) then\n case when {{first_date}} <= {{second_date}} then 0 else -1 end\n else\n case when {{first_date}} <= {{second_date}} then 1 else 0 end\n end)\n {% elif datepart == 'hour' %}\n ({{ datediff(first_date, second_date, 'day') }} * 24 + date_part('hour', ({{second_date}})::timestamp) - date_part('hour', ({{first_date}})::timestamp))\n {% elif datepart == 'minute' %}\n ({{ datediff(first_date, second_date, 'hour') }} * 60 + date_part('minute', ({{second_date}})::timestamp) - date_part('minute', ({{first_date}})::timestamp))\n {% elif datepart == 'second' %}\n ({{ datediff(first_date, second_date, 'minute') }} * 60 + floor(date_part('second', ({{second_date}})::timestamp)) - floor(date_part('second', ({{first_date}})::timestamp)))\n {% elif datepart == 'millisecond' %}\n ({{ datediff(first_date, second_date, 'minute') }} * 60000 + floor(date_part('millisecond', ({{second_date}})::timestamp)) - floor(date_part('millisecond', ({{first_date}})::timestamp)))\n {% elif datepart == 'microsecond' %}\n ({{ datediff(first_date, second_date, 'minute') }} * 60000000 + floor(date_part('microsecond', ({{second_date}})::timestamp)) - floor(date_part('microsecond', ({{first_date}})::timestamp)))\n {% else %}\n {{ exceptions.raise_compiler_error(\"Unsupported datepart for macro datediff in postgres: {!r}\".format(datepart)) }}\n {% endif %}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.datediff"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "first_date", "type": null, "description": ""}, {"name": "second_date", "type": null, "description": ""}, {"name": "datepart", "type": null, "description": ""}], "created_at": 1789419969.6988246, "supported_languages": null}, "macro.dbt_postgres.postgres__equals": {"name": "postgres__equals", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/utils/equals.sql", "original_file_path": "macros/utils/equals.sql", "unique_id": "macro.dbt_postgres.postgres__equals", "macro_sql": "{% macro postgres__equals(expr1, expr2) -%}\n{%- if adapter.behavior.enable_truthy_nulls_equals_macro.no_warn %}\n ({{ expr1 }} IS NOT DISTINCT FROM {{ expr2 }})\n{%- else -%}\n ({{ expr1 }} = {{ expr2 }})\n{%- endif %}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "expr1", "type": null, "description": ""}, {"name": "expr2", "type": null, "description": ""}], "created_at": 1789419969.6994255, "supported_languages": null}, "macro.dbt_postgres.postgres__dateadd": {"name": "postgres__dateadd", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/utils/dateadd.sql", "original_file_path": "macros/utils/dateadd.sql", "unique_id": "macro.dbt_postgres.postgres__dateadd", "macro_sql": "{% macro postgres__dateadd(datepart, interval, from_date_or_timestamp) %}\n\n {{ from_date_or_timestamp }} + ((interval '1 {{ datepart }}') * ({{ interval }}))\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "datepart", "type": null, "description": ""}, {"name": "interval", "type": null, "description": ""}, {"name": "from_date_or_timestamp", "type": null, "description": ""}], "created_at": 1789419969.6998165, "supported_languages": null}, "macro.dbt_postgres.postgres__split_part": {"name": "postgres__split_part", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/utils/split_part.sql", "original_file_path": "macros/utils/split_part.sql", "unique_id": "macro.dbt_postgres.postgres__split_part", "macro_sql": "{% macro postgres__split_part(string_text, delimiter_text, part_number) %}\n\n {% if part_number >= 0 %}\n {{ dbt.default__split_part(string_text, delimiter_text, part_number) }}\n {% else %}\n {{ dbt._split_part_negative(string_text, delimiter_text, part_number) }}\n {% endif %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__split_part", "macro.dbt._split_part_negative"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "string_text", "type": null, "description": ""}, {"name": "delimiter_text", "type": null, "description": ""}, {"name": "part_number", "type": null, "description": ""}], "created_at": 1789419969.7004929, "supported_languages": null}, "macro.dbt.get_fixture_sql": {"name": "get_fixture_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/unit_test_sql/get_fixture_sql.sql", "original_file_path": "macros/unit_test_sql/get_fixture_sql.sql", "unique_id": "macro.dbt.get_fixture_sql", "macro_sql": "{% macro get_fixture_sql(rows, column_name_to_data_types) %}\n-- Fixture for {{ model.name }}\n{% set default_row = {} %}\n\n{%- if not column_name_to_data_types -%}\n{#-- Use defer_relation IFF it is available in the manifest and 'this' is missing from the database --#}\n{%- set this_or_defer_relation = defer_relation if (defer_relation and not load_relation(this)) else this -%}\n{%- set columns_in_relation = adapter.get_columns_in_relation(this_or_defer_relation) -%}\n\n{%- set column_name_to_data_types = {} -%}\n{%- set column_name_to_quoted = {} -%}\n{%- for column in columns_in_relation -%}\n\n{#-- This needs to be a case-insensitive comparison --#}\n{%- do column_name_to_data_types.update({column.name|lower: column.data_type}) -%}\n{%- do column_name_to_quoted.update({column.name|lower: column.quoted}) -%}\n{%- endfor -%}\n{%- endif -%}\n\n{%- if not column_name_to_data_types -%}\n {{ exceptions.raise_compiler_error(\"Not able to get columns for unit test '\" ~ model.name ~ \"' from relation \" ~ this ~ \" because the relation doesn't exist\") }}\n{%- endif -%}\n\n{%- for column_name, column_type in column_name_to_data_types.items() -%}\n {%- do default_row.update({column_name: (safe_cast(\"null\", column_type) | trim )}) -%}\n{%- endfor -%}\n\n{{ validate_fixture_rows(rows, row_number) }}\n\n{%- for row in rows -%}\n{%- set formatted_row = format_row(row, column_name_to_data_types) -%}\n{%- set default_row_copy = default_row.copy() -%}\n{%- do default_row_copy.update(formatted_row) -%}\nselect\n{%- for column_name, column_value in default_row_copy.items() %} {{ column_value }} as {{ column_name_to_quoted[column_name] }}{% if not loop.last -%}, {%- endif %}\n{%- endfor %}\n{%- if not loop.last %}\nunion all\n{% endif %}\n{%- endfor -%}\n\n{%- if (rows | length) == 0 -%}\n select\n {%- for column_name, column_value in default_row.items() %} {{ column_value }} as {{ column_name_to_quoted[column_name] }}{% if not loop.last -%},{%- endif %}\n {%- endfor %}\n limit 0\n{%- endif -%}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.load_relation", "macro.dbt.safe_cast", "macro.dbt.validate_fixture_rows", "macro.dbt.format_row"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "rows", "type": null, "description": ""}, {"name": "column_name_to_data_types", "type": null, "description": ""}], "created_at": 1789419969.7050138, "supported_languages": null}, "macro.dbt.get_expected_sql": {"name": "get_expected_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/unit_test_sql/get_fixture_sql.sql", "original_file_path": "macros/unit_test_sql/get_fixture_sql.sql", "unique_id": "macro.dbt.get_expected_sql", "macro_sql": "{% macro get_expected_sql(rows, column_name_to_data_types, column_name_to_quoted) %}\n\n{%- if (rows | length) == 0 -%}\n select * from dbt_internal_unit_test_actual\n limit 0\n{%- else -%}\n{%- for row in rows -%}\n{%- set formatted_row = format_row(row, column_name_to_data_types) -%}\nselect\n{%- for column_name, column_value in formatted_row.items() %} {{ column_value }} as {{ column_name_to_quoted[column_name] }}{% if not loop.last -%}, {%- endif %}\n{%- endfor %}\n{%- if not loop.last %}\nunion all\n{% endif %}\n{%- endfor -%}\n{%- endif -%}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.format_row"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "rows", "type": null, "description": ""}, {"name": "column_name_to_data_types", "type": null, "description": ""}, {"name": "column_name_to_quoted", "type": null, "description": ""}], "created_at": 1789419969.7063153, "supported_languages": null}, "macro.dbt.format_row": {"name": "format_row", "resource_type": "macro", "package_name": "dbt", "path": "macros/unit_test_sql/get_fixture_sql.sql", "original_file_path": "macros/unit_test_sql/get_fixture_sql.sql", "unique_id": "macro.dbt.format_row", "macro_sql": "\n\n{%- macro format_row(row, column_name_to_data_types) -%}\n {#-- generate case-insensitive formatted row --#}\n {% set formatted_row = {} %}\n {%- for column_name, column_value in row.items() -%}\n {% set column_name = column_name|lower %}\n\n {%- if column_name not in column_name_to_data_types %}\n {#-- if user-provided row contains column name that relation does not contain, raise an error --#}\n {% set fixture_name = \"expected output\" if model.resource_type == 'unit_test' else (\"'\" ~ model.name ~ \"'\") %}\n {{ exceptions.raise_compiler_error(\n \"Invalid column name: '\" ~ column_name ~ \"' in unit test fixture for \" ~ fixture_name ~ \".\"\n \"\\nAccepted columns for \" ~ fixture_name ~ \" are: \" ~ (column_name_to_data_types.keys()|list)\n ) }}\n {%- endif -%}\n\n {%- set column_type = column_name_to_data_types[column_name] %}\n\n {#-- For string fixture values, strip varchar length to prevent silent truncation (GH-11974) --#}\n {%- if column_value is string and 'varying' in column_type -%}\n {%- set column_type = column_type.split('(')[0] -%}\n {%- endif -%}\n\n {#-- sanitize column_value: wrap yaml strings in quotes, apply cast --#}\n {%- set column_value_clean = column_value -%}\n {%- if column_value is string -%}\n {%- set column_value_clean = dbt.string_literal(dbt.escape_single_quotes(column_value)) -%}\n {%- elif column_value is none -%}\n {%- set column_value_clean = 'null' -%}\n {%- endif -%}\n\n {%- set row_update = {column_name: safe_cast(column_value_clean, column_type) } -%}\n {%- do formatted_row.update(row_update) -%}\n {%- endfor -%}\n {{ return(formatted_row) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt.string_literal", "macro.dbt.escape_single_quotes", "macro.dbt.safe_cast"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "row", "type": null, "description": ""}, {"name": "column_name_to_data_types", "type": null, "description": ""}], "created_at": 1789419969.708449, "supported_languages": null}, "macro.dbt.validate_fixture_rows": {"name": "validate_fixture_rows", "resource_type": "macro", "package_name": "dbt", "path": "macros/unit_test_sql/get_fixture_sql.sql", "original_file_path": "macros/unit_test_sql/get_fixture_sql.sql", "unique_id": "macro.dbt.validate_fixture_rows", "macro_sql": "{%- macro validate_fixture_rows(rows, row_number) -%}\n {{ return(adapter.dispatch('validate_fixture_rows', 'dbt')(rows, row_number)) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt.default__validate_fixture_rows"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "rows", "type": null, "description": ""}, {"name": "row_number", "type": null, "description": ""}], "created_at": 1789419969.7088354, "supported_languages": null}, "macro.dbt.default__validate_fixture_rows": {"name": "default__validate_fixture_rows", "resource_type": "macro", "package_name": "dbt", "path": "macros/unit_test_sql/get_fixture_sql.sql", "original_file_path": "macros/unit_test_sql/get_fixture_sql.sql", "unique_id": "macro.dbt.default__validate_fixture_rows", "macro_sql": "{%- macro default__validate_fixture_rows(rows, row_number) -%}\n {# This is an abstract method for adapter overrides as needed #}\n{%- endmacro -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "rows", "type": null, "description": ""}, {"name": "row_number", "type": null, "description": ""}], "created_at": 1789419969.709003, "supported_languages": null}, "macro.dbt.get_create_sql": {"name": "get_create_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/create.sql", "original_file_path": "macros/relations/create.sql", "unique_id": "macro.dbt.get_create_sql", "macro_sql": "{%- macro get_create_sql(relation, sql) -%}\n {{- log('Applying CREATE to: ' ~ relation) -}}\n {{- adapter.dispatch('get_create_sql', 'dbt')(relation, sql) -}}\n{%- endmacro -%}\n\n\n", "depends_on": {"macros": ["macro.dbt.default__get_create_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "sql", "type": null, "description": ""}], "created_at": 1789419969.7096822, "supported_languages": null}, "macro.dbt.default__get_create_sql": {"name": "default__get_create_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/create.sql", "original_file_path": "macros/relations/create.sql", "unique_id": "macro.dbt.default__get_create_sql", "macro_sql": "{%- macro default__get_create_sql(relation, sql) -%}\n\n {%- if relation.is_view -%}\n {{ get_create_view_as_sql(relation, sql) }}\n\n {%- elif relation.is_table -%}\n {{ get_create_table_as_sql(False, relation, sql) }}\n\n {%- elif relation.is_materialized_view -%}\n {{ get_create_materialized_view_as_sql(relation, sql) }}\n\n {%- else -%}\n {{- exceptions.raise_compiler_error(\"`get_create_sql` has not been implemented for: \" ~ relation.type ) -}}\n\n {%- endif -%}\n\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt.get_create_view_as_sql", "macro.dbt.get_create_table_as_sql", "macro.dbt.get_create_materialized_view_as_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "sql", "type": null, "description": ""}], "created_at": 1789419969.7104392, "supported_languages": null}, "macro.dbt.drop_schema_named": {"name": "drop_schema_named", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/schema.sql", "original_file_path": "macros/relations/schema.sql", "unique_id": "macro.dbt.drop_schema_named", "macro_sql": "{% macro drop_schema_named(schema_name) %}\n {{ return(adapter.dispatch('drop_schema_named', 'dbt') (schema_name)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__drop_schema_named"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "schema_name", "type": null, "description": ""}], "created_at": 1789419969.7109118, "supported_languages": null}, "macro.dbt.default__drop_schema_named": {"name": "default__drop_schema_named", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/schema.sql", "original_file_path": "macros/relations/schema.sql", "unique_id": "macro.dbt.default__drop_schema_named", "macro_sql": "{% macro default__drop_schema_named(schema_name) %}\n {% set schema_relation = api.Relation.create(schema=schema_name) %}\n {{ adapter.drop_schema(schema_relation) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "schema_name", "type": null, "description": ""}], "created_at": 1789419969.7112796, "supported_languages": null}, "macro.dbt.get_create_intermediate_sql": {"name": "get_create_intermediate_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/create_intermediate.sql", "original_file_path": "macros/relations/create_intermediate.sql", "unique_id": "macro.dbt.get_create_intermediate_sql", "macro_sql": "{%- macro get_create_intermediate_sql(relation, sql) -%}\n {{- log('Applying CREATE INTERMEDIATE to: ' ~ relation) -}}\n {{- adapter.dispatch('get_create_intermediate_sql', 'dbt')(relation, sql) -}}\n{%- endmacro -%}\n\n\n", "depends_on": {"macros": ["macro.dbt.default__get_create_intermediate_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "sql", "type": null, "description": ""}], "created_at": 1789419969.7118554, "supported_languages": null}, "macro.dbt.default__get_create_intermediate_sql": {"name": "default__get_create_intermediate_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/create_intermediate.sql", "original_file_path": "macros/relations/create_intermediate.sql", "unique_id": "macro.dbt.default__get_create_intermediate_sql", "macro_sql": "{%- macro default__get_create_intermediate_sql(relation, sql) -%}\n\n -- get the standard intermediate name\n {% set intermediate_relation = make_intermediate_relation(relation) %}\n\n -- drop any pre-existing intermediate\n {{ get_drop_sql(intermediate_relation) }};\n\n {{ get_create_sql(intermediate_relation, sql) }}\n\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt.make_intermediate_relation", "macro.dbt.get_drop_sql", "macro.dbt.get_create_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "sql", "type": null, "description": ""}], "created_at": 1789419969.712286, "supported_languages": null}, "macro.dbt.get_drop_backup_sql": {"name": "get_drop_backup_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/drop_backup.sql", "original_file_path": "macros/relations/drop_backup.sql", "unique_id": "macro.dbt.get_drop_backup_sql", "macro_sql": "{%- macro get_drop_backup_sql(relation) -%}\n {{- log('Applying DROP BACKUP to: ' ~ relation) -}}\n {{- adapter.dispatch('get_drop_backup_sql', 'dbt')(relation) -}}\n{%- endmacro -%}\n\n\n", "depends_on": {"macros": ["macro.dbt.default__get_drop_backup_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789419969.7128158, "supported_languages": null}, "macro.dbt.default__get_drop_backup_sql": {"name": "default__get_drop_backup_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/drop_backup.sql", "original_file_path": "macros/relations/drop_backup.sql", "unique_id": "macro.dbt.default__get_drop_backup_sql", "macro_sql": "{%- macro default__get_drop_backup_sql(relation) -%}\n\n -- get the standard backup name\n {% set backup_relation = make_backup_relation(relation, relation.type) %}\n\n {{ get_drop_sql(backup_relation) }}\n\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt.make_backup_relation", "macro.dbt.get_drop_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789419969.7131705, "supported_languages": null}, "macro.dbt.get_rename_sql": {"name": "get_rename_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/rename.sql", "original_file_path": "macros/relations/rename.sql", "unique_id": "macro.dbt.get_rename_sql", "macro_sql": "{%- macro get_rename_sql(relation, new_name) -%}\n {{- log('Applying RENAME to: ' ~ relation) -}}\n {{- adapter.dispatch('get_rename_sql', 'dbt')(relation, new_name) -}}\n{%- endmacro -%}\n\n\n", "depends_on": {"macros": ["macro.dbt.default__get_rename_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "new_name", "type": null, "description": ""}], "created_at": 1789419969.713961, "supported_languages": null}, "macro.dbt.default__get_rename_sql": {"name": "default__get_rename_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/rename.sql", "original_file_path": "macros/relations/rename.sql", "unique_id": "macro.dbt.default__get_rename_sql", "macro_sql": "{%- macro default__get_rename_sql(relation, new_name) -%}\n\n {%- if relation.is_view -%}\n {{ get_rename_view_sql(relation, new_name) }}\n\n {%- elif relation.is_table -%}\n {{ get_rename_table_sql(relation, new_name) }}\n\n {%- elif relation.is_materialized_view -%}\n {{ get_rename_materialized_view_sql(relation, new_name) }}\n\n {%- else -%}\n {{- exceptions.raise_compiler_error(\"`get_rename_sql` has not been implemented for: \" ~ relation.type ) -}}\n\n {%- endif -%}\n\n{%- endmacro -%}\n\n\n", "depends_on": {"macros": ["macro.dbt.get_rename_view_sql", "macro.dbt.get_rename_table_sql", "macro.dbt.get_rename_materialized_view_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "new_name", "type": null, "description": ""}], "created_at": 1789419969.7146962, "supported_languages": null}, "macro.dbt.rename_relation": {"name": "rename_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/rename.sql", "original_file_path": "macros/relations/rename.sql", "unique_id": "macro.dbt.rename_relation", "macro_sql": "{% macro rename_relation(from_relation, to_relation) -%}\n {{ return(adapter.dispatch('rename_relation', 'dbt')(from_relation, to_relation)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__rename_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "from_relation", "type": null, "description": ""}, {"name": "to_relation", "type": null, "description": ""}], "created_at": 1789419969.7150657, "supported_languages": null}, "macro.dbt.default__rename_relation": {"name": "default__rename_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/rename.sql", "original_file_path": "macros/relations/rename.sql", "unique_id": "macro.dbt.default__rename_relation", "macro_sql": "{% macro default__rename_relation(from_relation, to_relation) -%}\n {% set target_name = adapter.quote_as_configured(to_relation.identifier, 'identifier') %}\n {% call statement('rename_relation') -%}\n alter table {{ from_relation.render() }} rename to {{ target_name }}\n {%- endcall %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "from_relation", "type": null, "description": ""}, {"name": "to_relation", "type": null, "description": ""}], "created_at": 1789419969.7155674, "supported_languages": null}, "macro.dbt.get_drop_sql": {"name": "get_drop_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/drop.sql", "original_file_path": "macros/relations/drop.sql", "unique_id": "macro.dbt.get_drop_sql", "macro_sql": "{%- macro get_drop_sql(relation) -%}\n {{- log('Applying DROP to: ' ~ relation) -}}\n {{- adapter.dispatch('get_drop_sql', 'dbt')(relation) -}}\n{%- endmacro -%}\n\n\n", "depends_on": {"macros": ["macro.dbt.default__get_drop_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789419969.7163553, "supported_languages": null}, "macro.dbt.default__get_drop_sql": {"name": "default__get_drop_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/drop.sql", "original_file_path": "macros/relations/drop.sql", "unique_id": "macro.dbt.default__get_drop_sql", "macro_sql": "{%- macro default__get_drop_sql(relation) -%}\n\n {%- if relation.is_view -%}\n {{ drop_view(relation) }}\n\n {%- elif relation.is_table -%}\n {{ drop_table(relation) }}\n\n {%- elif relation.is_materialized_view -%}\n {{ drop_materialized_view(relation) }}\n\n {%- else -%}\n drop {{ relation.type }} if exists {{ relation.render() }} cascade\n\n {%- endif -%}\n\n{%- endmacro -%}\n\n\n", "depends_on": {"macros": ["macro.dbt.drop_view", "macro.dbt.drop_table", "macro.dbt.drop_materialized_view"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789419969.717155, "supported_languages": null}, "macro.dbt.drop_relation": {"name": "drop_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/drop.sql", "original_file_path": "macros/relations/drop.sql", "unique_id": "macro.dbt.drop_relation", "macro_sql": "{% macro drop_relation(relation) -%}\n {{ return(adapter.dispatch('drop_relation', 'dbt')(relation)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__drop_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789419969.71747, "supported_languages": null}, "macro.dbt.default__drop_relation": {"name": "default__drop_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/drop.sql", "original_file_path": "macros/relations/drop.sql", "unique_id": "macro.dbt.default__drop_relation", "macro_sql": "{% macro default__drop_relation(relation) -%}\n {% call statement('drop_relation', auto_begin=False) -%}\n {{ get_drop_sql(relation) }}\n {%- endcall %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement", "macro.dbt.get_drop_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789419969.7178218, "supported_languages": null}, "macro.dbt.drop_relation_if_exists": {"name": "drop_relation_if_exists", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/drop.sql", "original_file_path": "macros/relations/drop.sql", "unique_id": "macro.dbt.drop_relation_if_exists", "macro_sql": "{% macro drop_relation_if_exists(relation) %}\n {% if relation is not none %}\n {{ adapter.drop_relation(relation) }}\n {% endif %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789419969.718146, "supported_languages": null}, "macro.dbt.get_rename_intermediate_sql": {"name": "get_rename_intermediate_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/rename_intermediate.sql", "original_file_path": "macros/relations/rename_intermediate.sql", "unique_id": "macro.dbt.get_rename_intermediate_sql", "macro_sql": "{%- macro get_rename_intermediate_sql(relation) -%}\n {{- log('Applying RENAME INTERMEDIATE to: ' ~ relation) -}}\n {{- adapter.dispatch('get_rename_intermediate_sql', 'dbt')(relation) -}}\n{%- endmacro -%}\n\n\n", "depends_on": {"macros": ["macro.dbt.default__get_rename_intermediate_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789419969.718669, "supported_languages": null}, "macro.dbt.default__get_rename_intermediate_sql": {"name": "default__get_rename_intermediate_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/rename_intermediate.sql", "original_file_path": "macros/relations/rename_intermediate.sql", "unique_id": "macro.dbt.default__get_rename_intermediate_sql", "macro_sql": "{%- macro default__get_rename_intermediate_sql(relation) -%}\n\n -- get the standard intermediate name\n {% set intermediate_relation = make_intermediate_relation(relation) %}\n\n {{ get_rename_sql(intermediate_relation, relation.identifier) }}\n\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt.make_intermediate_relation", "macro.dbt.get_rename_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789419969.7190359, "supported_languages": null}, "macro.dbt.get_replace_sql": {"name": "get_replace_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/replace.sql", "original_file_path": "macros/relations/replace.sql", "unique_id": "macro.dbt.get_replace_sql", "macro_sql": "{% macro get_replace_sql(existing_relation, target_relation, sql) %}\n {{- log('Applying REPLACE to: ' ~ existing_relation) -}}\n {{- adapter.dispatch('get_replace_sql', 'dbt')(existing_relation, target_relation, sql) -}}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_replace_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "existing_relation", "type": null, "description": ""}, {"name": "target_relation", "type": null, "description": ""}, {"name": "sql", "type": null, "description": ""}], "created_at": 1789419969.719966, "supported_languages": null}, "macro.dbt.default__get_replace_sql": {"name": "default__get_replace_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/replace.sql", "original_file_path": "macros/relations/replace.sql", "unique_id": "macro.dbt.default__get_replace_sql", "macro_sql": "{% macro default__get_replace_sql(existing_relation, target_relation, sql) %}\n\n {# /* use a create or replace statement if possible */ #}\n\n {% set is_replaceable = existing_relation.type == target_relation.type and existing_relation.can_be_replaced %}\n\n {% if is_replaceable and existing_relation.is_view %}\n {{ get_replace_view_sql(target_relation, sql) }}\n\n {% elif is_replaceable and existing_relation.is_table %}\n {{ get_replace_table_sql(target_relation, sql) }}\n\n {% elif is_replaceable and existing_relation.is_materialized_view %}\n {{ get_replace_materialized_view_sql(target_relation, sql) }}\n\n {# /* a create or replace statement is not possible, so try to stage and/or backup to be safe */ #}\n\n {# /* create target_relation as an intermediate relation, then swap it out with the existing one using a backup */ #}\n {%- elif target_relation.can_be_renamed and existing_relation.can_be_renamed -%}\n {{ get_create_intermediate_sql(target_relation, sql) }};\n {{ get_create_backup_sql(existing_relation) }};\n {{ get_rename_intermediate_sql(target_relation) }};\n {{ get_drop_backup_sql(existing_relation) }}\n\n {# /* create target_relation as an intermediate relation, then swap it out with the existing one without using a backup */ #}\n {%- elif target_relation.can_be_renamed -%}\n {{ get_create_intermediate_sql(target_relation, sql) }};\n {{ get_drop_sql(existing_relation) }};\n {{ get_rename_intermediate_sql(target_relation) }}\n\n {# /* create target_relation in place by first backing up the existing relation */ #}\n {%- elif existing_relation.can_be_renamed -%}\n {{ get_create_backup_sql(existing_relation) }};\n {{ get_create_sql(target_relation, sql) }};\n {{ get_drop_backup_sql(existing_relation) }}\n\n {# /* no renaming is allowed, so just drop and create */ #}\n {%- else -%}\n {{ get_drop_sql(existing_relation) }};\n {{ get_create_sql(target_relation, sql) }}\n\n {%- endif -%}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_replace_view_sql", "macro.dbt.get_replace_table_sql", "macro.dbt.get_replace_materialized_view_sql", "macro.dbt.get_create_intermediate_sql", "macro.dbt.get_create_backup_sql", "macro.dbt.get_rename_intermediate_sql", "macro.dbt.get_drop_backup_sql", "macro.dbt.get_drop_sql", "macro.dbt.get_create_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "existing_relation", "type": null, "description": ""}, {"name": "target_relation", "type": null, "description": ""}, {"name": "sql", "type": null, "description": ""}], "created_at": 1789419969.721968, "supported_languages": null}, "macro.dbt.get_create_backup_sql": {"name": "get_create_backup_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/create_backup.sql", "original_file_path": "macros/relations/create_backup.sql", "unique_id": "macro.dbt.get_create_backup_sql", "macro_sql": "{%- macro get_create_backup_sql(relation) -%}\n {{- log('Applying CREATE BACKUP to: ' ~ relation) -}}\n {{- adapter.dispatch('get_create_backup_sql', 'dbt')(relation) -}}\n{%- endmacro -%}\n\n\n", "depends_on": {"macros": ["macro.dbt.default__get_create_backup_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789419969.7225244, "supported_languages": null}, "macro.dbt.default__get_create_backup_sql": {"name": "default__get_create_backup_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/create_backup.sql", "original_file_path": "macros/relations/create_backup.sql", "unique_id": "macro.dbt.default__get_create_backup_sql", "macro_sql": "{%- macro default__get_create_backup_sql(relation) -%}\n\n -- get the standard backup name\n {% set backup_relation = make_backup_relation(relation, relation.type) %}\n\n -- drop any pre-existing backup\n {{ get_drop_sql(backup_relation) }};\n\n {{ get_rename_sql(relation, backup_relation.identifier) }}\n\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt.make_backup_relation", "macro.dbt.get_drop_sql", "macro.dbt.get_rename_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789419969.7229872, "supported_languages": null}, "macro.dbt.get_create_materialized_view_as_sql": {"name": "get_create_materialized_view_as_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/materialized_view/create.sql", "original_file_path": "macros/relations/materialized_view/create.sql", "unique_id": "macro.dbt.get_create_materialized_view_as_sql", "macro_sql": "{% macro get_create_materialized_view_as_sql(relation, sql) -%}\n {{- adapter.dispatch('get_create_materialized_view_as_sql', 'dbt')(relation, sql) -}}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__get_create_materialized_view_as_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "sql", "type": null, "description": ""}], "created_at": 1789419969.723438, "supported_languages": null}, "macro.dbt.default__get_create_materialized_view_as_sql": {"name": "default__get_create_materialized_view_as_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/materialized_view/create.sql", "original_file_path": "macros/relations/materialized_view/create.sql", "unique_id": "macro.dbt.default__get_create_materialized_view_as_sql", "macro_sql": "{% macro default__get_create_materialized_view_as_sql(relation, sql) -%}\n {{ exceptions.raise_compiler_error(\n \"`get_create_materialized_view_as_sql` has not been implemented for this adapter.\"\n ) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "sql", "type": null, "description": ""}], "created_at": 1789419969.7236788, "supported_languages": null}, "macro.dbt.get_alter_materialized_view_as_sql": {"name": "get_alter_materialized_view_as_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/materialized_view/alter.sql", "original_file_path": "macros/relations/materialized_view/alter.sql", "unique_id": "macro.dbt.get_alter_materialized_view_as_sql", "macro_sql": "{% macro get_alter_materialized_view_as_sql(\n relation,\n configuration_changes,\n sql,\n existing_relation,\n backup_relation,\n intermediate_relation\n) %}\n {{- log('Applying ALTER to: ' ~ relation) -}}\n {{- adapter.dispatch('get_alter_materialized_view_as_sql', 'dbt')(\n relation,\n configuration_changes,\n sql,\n existing_relation,\n backup_relation,\n intermediate_relation\n ) -}}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__get_alter_materialized_view_as_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "configuration_changes", "type": null, "description": ""}, {"name": "sql", "type": null, "description": ""}, {"name": "existing_relation", "type": null, "description": ""}, {"name": "backup_relation", "type": null, "description": ""}, {"name": "intermediate_relation", "type": null, "description": ""}], "created_at": 1789419969.724588, "supported_languages": null}, "macro.dbt.default__get_alter_materialized_view_as_sql": {"name": "default__get_alter_materialized_view_as_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/materialized_view/alter.sql", "original_file_path": "macros/relations/materialized_view/alter.sql", "unique_id": "macro.dbt.default__get_alter_materialized_view_as_sql", "macro_sql": "{% macro default__get_alter_materialized_view_as_sql(\n relation,\n configuration_changes,\n sql,\n existing_relation,\n backup_relation,\n intermediate_relation\n) %}\n {{ exceptions.raise_compiler_error(\"Materialized views have not been implemented for this adapter.\") }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "configuration_changes", "type": null, "description": ""}, {"name": "sql", "type": null, "description": ""}, {"name": "existing_relation", "type": null, "description": ""}, {"name": "backup_relation", "type": null, "description": ""}, {"name": "intermediate_relation", "type": null, "description": ""}], "created_at": 1789419969.7249272, "supported_languages": null}, "macro.dbt.get_materialized_view_configuration_changes": {"name": "get_materialized_view_configuration_changes", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/materialized_view/alter.sql", "original_file_path": "macros/relations/materialized_view/alter.sql", "unique_id": "macro.dbt.get_materialized_view_configuration_changes", "macro_sql": "{% macro get_materialized_view_configuration_changes(existing_relation, new_config) %}\n /* {#\n It's recommended that configuration changes be formatted as follows:\n {\"\": [{\"action\": \"\", \"context\": ...}]}\n\n For example:\n {\n \"indexes\": [\n {\"action\": \"drop\", \"context\": \"index_abc\"},\n {\"action\": \"create\", \"context\": {\"columns\": [\"column_1\", \"column_2\"], \"type\": \"hash\", \"unique\": True}},\n ],\n }\n\n Either way, `get_materialized_view_configuration_changes` needs to align with `get_alter_materialized_view_as_sql`.\n #} */\n {{- log('Determining configuration changes on: ' ~ existing_relation) -}}\n {%- do return(adapter.dispatch('get_materialized_view_configuration_changes', 'dbt')(existing_relation, new_config)) -%}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__get_materialized_view_configuration_changes"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "existing_relation", "type": null, "description": ""}, {"name": "new_config", "type": null, "description": ""}], "created_at": 1789419969.7254078, "supported_languages": null}, "macro.dbt.default__get_materialized_view_configuration_changes": {"name": "default__get_materialized_view_configuration_changes", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/materialized_view/alter.sql", "original_file_path": "macros/relations/materialized_view/alter.sql", "unique_id": "macro.dbt.default__get_materialized_view_configuration_changes", "macro_sql": "{% macro default__get_materialized_view_configuration_changes(existing_relation, new_config) %}\n {{ exceptions.raise_compiler_error(\"Materialized views have not been implemented for this adapter.\") }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "existing_relation", "type": null, "description": ""}, {"name": "new_config", "type": null, "description": ""}], "created_at": 1789419969.7256496, "supported_languages": null}, "macro.dbt.get_rename_materialized_view_sql": {"name": "get_rename_materialized_view_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/materialized_view/rename.sql", "original_file_path": "macros/relations/materialized_view/rename.sql", "unique_id": "macro.dbt.get_rename_materialized_view_sql", "macro_sql": "{% macro get_rename_materialized_view_sql(relation, new_name) %}\n {{- adapter.dispatch('get_rename_materialized_view_sql', 'dbt')(relation, new_name) -}}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__get_rename_materialized_view_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "new_name", "type": null, "description": ""}], "created_at": 1789419969.726123, "supported_languages": null}, "macro.dbt.default__get_rename_materialized_view_sql": {"name": "default__get_rename_materialized_view_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/materialized_view/rename.sql", "original_file_path": "macros/relations/materialized_view/rename.sql", "unique_id": "macro.dbt.default__get_rename_materialized_view_sql", "macro_sql": "{% macro default__get_rename_materialized_view_sql(relation, new_name) %}\n {{ exceptions.raise_compiler_error(\n \"`get_rename_materialized_view_sql` has not been implemented for this adapter.\"\n ) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "new_name", "type": null, "description": ""}], "created_at": 1789419969.726489, "supported_languages": null}, "macro.dbt.refresh_materialized_view": {"name": "refresh_materialized_view", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/materialized_view/refresh.sql", "original_file_path": "macros/relations/materialized_view/refresh.sql", "unique_id": "macro.dbt.refresh_materialized_view", "macro_sql": "{% macro refresh_materialized_view(relation) %}\n {{- log('Applying REFRESH to: ' ~ relation) -}}\n {{- adapter.dispatch('refresh_materialized_view', 'dbt')(relation) -}}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__refresh_materialized_view"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789419969.7270083, "supported_languages": null}, "macro.dbt.default__refresh_materialized_view": {"name": "default__refresh_materialized_view", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/materialized_view/refresh.sql", "original_file_path": "macros/relations/materialized_view/refresh.sql", "unique_id": "macro.dbt.default__refresh_materialized_view", "macro_sql": "{% macro default__refresh_materialized_view(relation) %}\n {{ exceptions.raise_compiler_error(\"`refresh_materialized_view` has not been implemented for this adapter.\") }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789419969.727234, "supported_languages": null}, "macro.dbt.drop_materialized_view": {"name": "drop_materialized_view", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/materialized_view/drop.sql", "original_file_path": "macros/relations/materialized_view/drop.sql", "unique_id": "macro.dbt.drop_materialized_view", "macro_sql": "{% macro drop_materialized_view(relation) -%}\n {{- adapter.dispatch('drop_materialized_view', 'dbt')(relation) -}}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__drop_materialized_view"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789419969.7276456, "supported_languages": null}, "macro.dbt.default__drop_materialized_view": {"name": "default__drop_materialized_view", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/materialized_view/drop.sql", "original_file_path": "macros/relations/materialized_view/drop.sql", "unique_id": "macro.dbt.default__drop_materialized_view", "macro_sql": "{% macro default__drop_materialized_view(relation) -%}\n drop materialized view if exists {{ relation.render() }} cascade\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789419969.727871, "supported_languages": null}, "macro.dbt.get_replace_materialized_view_sql": {"name": "get_replace_materialized_view_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/materialized_view/replace.sql", "original_file_path": "macros/relations/materialized_view/replace.sql", "unique_id": "macro.dbt.get_replace_materialized_view_sql", "macro_sql": "{% macro get_replace_materialized_view_sql(relation, sql) %}\n {{- adapter.dispatch('get_replace_materialized_view_sql', 'dbt')(relation, sql) -}}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_replace_materialized_view_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "sql", "type": null, "description": ""}], "created_at": 1789419969.7283099, "supported_languages": null}, "macro.dbt.default__get_replace_materialized_view_sql": {"name": "default__get_replace_materialized_view_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/materialized_view/replace.sql", "original_file_path": "macros/relations/materialized_view/replace.sql", "unique_id": "macro.dbt.default__get_replace_materialized_view_sql", "macro_sql": "{% macro default__get_replace_materialized_view_sql(relation, sql) %}\n {{ exceptions.raise_compiler_error(\n \"`get_replace_materialized_view_sql` has not been implemented for this adapter.\"\n ) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "sql", "type": null, "description": ""}], "created_at": 1789419969.7285535, "supported_languages": null}, "macro.dbt.get_create_view_as_sql": {"name": "get_create_view_as_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/view/create.sql", "original_file_path": "macros/relations/view/create.sql", "unique_id": "macro.dbt.get_create_view_as_sql", "macro_sql": "{% macro get_create_view_as_sql(relation, sql) -%}\n {{ adapter.dispatch('get_create_view_as_sql', 'dbt')(relation, sql) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_create_view_as_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "sql", "type": null, "description": ""}], "created_at": 1789419969.7291777, "supported_languages": null}, "macro.dbt.default__get_create_view_as_sql": {"name": "default__get_create_view_as_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/view/create.sql", "original_file_path": "macros/relations/view/create.sql", "unique_id": "macro.dbt.default__get_create_view_as_sql", "macro_sql": "{% macro default__get_create_view_as_sql(relation, sql) -%}\n {{ return(create_view_as(relation, sql)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.create_view_as"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "sql", "type": null, "description": ""}], "created_at": 1789419969.7294936, "supported_languages": null}, "macro.dbt.create_view_as": {"name": "create_view_as", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/view/create.sql", "original_file_path": "macros/relations/view/create.sql", "unique_id": "macro.dbt.create_view_as", "macro_sql": "{% macro create_view_as(relation, sql) -%}\n {{ adapter.dispatch('create_view_as', 'dbt')(relation, sql) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__create_view_as"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "sql", "type": null, "description": ""}], "created_at": 1789419969.7298527, "supported_languages": null}, "macro.dbt.default__create_view_as": {"name": "default__create_view_as", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/view/create.sql", "original_file_path": "macros/relations/view/create.sql", "unique_id": "macro.dbt.default__create_view_as", "macro_sql": "{% macro default__create_view_as(relation, sql) -%}\n {%- set sql_header = config.get('sql_header', none) -%}\n\n {{ sql_header if sql_header is not none }}\n create view {{ relation.render() }}\n {% set contract_config = config.get('contract') %}\n {% if contract_config.enforced %}\n {{ get_assert_columns_equivalent(sql) }}\n {%- endif %}\n as (\n {{ sql }}\n );\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.get_assert_columns_equivalent"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "sql", "type": null, "description": ""}], "created_at": 1789419969.7306013, "supported_languages": null}, "macro.dbt.get_rename_view_sql": {"name": "get_rename_view_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/view/rename.sql", "original_file_path": "macros/relations/view/rename.sql", "unique_id": "macro.dbt.get_rename_view_sql", "macro_sql": "{% macro get_rename_view_sql(relation, new_name) %}\n {{- adapter.dispatch('get_rename_view_sql', 'dbt')(relation, new_name) -}}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__get_rename_view_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "new_name", "type": null, "description": ""}], "created_at": 1789419969.731083, "supported_languages": null}, "macro.dbt.default__get_rename_view_sql": {"name": "default__get_rename_view_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/view/rename.sql", "original_file_path": "macros/relations/view/rename.sql", "unique_id": "macro.dbt.default__get_rename_view_sql", "macro_sql": "{% macro default__get_rename_view_sql(relation, new_name) %}\n {{ exceptions.raise_compiler_error(\n \"`get_rename_view_sql` has not been implemented for this adapter.\"\n ) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "new_name", "type": null, "description": ""}], "created_at": 1789419969.7313294, "supported_languages": null}, "macro.dbt.drop_view": {"name": "drop_view", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/view/drop.sql", "original_file_path": "macros/relations/view/drop.sql", "unique_id": "macro.dbt.drop_view", "macro_sql": "{% macro drop_view(relation) -%}\n {{- adapter.dispatch('drop_view', 'dbt')(relation) -}}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__drop_view"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789419969.7317321, "supported_languages": null}, "macro.dbt.default__drop_view": {"name": "default__drop_view", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/view/drop.sql", "original_file_path": "macros/relations/view/drop.sql", "unique_id": "macro.dbt.default__drop_view", "macro_sql": "{% macro default__drop_view(relation) -%}\n drop view if exists {{ relation.render() }} cascade\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789419969.7319567, "supported_languages": null}, "macro.dbt.get_replace_view_sql": {"name": "get_replace_view_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/view/replace.sql", "original_file_path": "macros/relations/view/replace.sql", "unique_id": "macro.dbt.get_replace_view_sql", "macro_sql": "{% macro get_replace_view_sql(relation, sql) %}\n {{- adapter.dispatch('get_replace_view_sql', 'dbt')(relation, sql) -}}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__get_replace_view_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "sql", "type": null, "description": ""}], "created_at": 1789419969.732838, "supported_languages": null}, "macro.dbt.default__get_replace_view_sql": {"name": "default__get_replace_view_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/view/replace.sql", "original_file_path": "macros/relations/view/replace.sql", "unique_id": "macro.dbt.default__get_replace_view_sql", "macro_sql": "{% macro default__get_replace_view_sql(relation, sql) %}\n {{ exceptions.raise_compiler_error(\n \"`get_replace_view_sql` has not been implemented for this adapter.\"\n ) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "sql", "type": null, "description": ""}], "created_at": 1789419969.7332017, "supported_languages": null}, "macro.dbt.create_or_replace_view": {"name": "create_or_replace_view", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/view/replace.sql", "original_file_path": "macros/relations/view/replace.sql", "unique_id": "macro.dbt.create_or_replace_view", "macro_sql": "{% macro create_or_replace_view() %}\n {%- set identifier = model['alias'] -%}\n\n {%- set old_relation = adapter.get_relation(database=database, schema=schema, identifier=identifier) -%}\n {%- set exists_as_view = (old_relation is not none and old_relation.is_view) -%}\n\n {%- set target_relation = api.Relation.create(\n identifier=identifier, schema=schema, database=database,\n type='view') -%}\n {% set grant_config = config.get('grants') %}\n\n {{ run_hooks(pre_hooks) }}\n\n -- If there's a table with the same name and we weren't told to full refresh,\n -- that's an error. If we were told to full refresh, drop it. This behavior differs\n -- for Snowflake and BigQuery, so multiple dispatch is used.\n {%- if old_relation is not none and old_relation.is_table -%}\n {{ handle_existing_table(should_full_refresh(), old_relation) }}\n {%- endif -%}\n\n -- build model\n {% call statement('main') -%}\n {{ get_create_view_as_sql(target_relation, sql) }}\n {%- endcall %}\n\n {% set should_revoke = should_revoke(exists_as_view, full_refresh_mode=True) %}\n {% do apply_grants(target_relation, grant_config, should_revoke=should_revoke) %}\n\n {{ run_hooks(post_hooks) }}\n\n {{ return({'relations': [target_relation]}) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.run_hooks", "macro.dbt.handle_existing_table", "macro.dbt.should_full_refresh", "macro.dbt.statement", "macro.dbt.get_create_view_as_sql", "macro.dbt.should_revoke", "macro.dbt.apply_grants"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789419969.7350934, "supported_languages": null}, "macro.dbt.handle_existing_table": {"name": "handle_existing_table", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/view/replace.sql", "original_file_path": "macros/relations/view/replace.sql", "unique_id": "macro.dbt.handle_existing_table", "macro_sql": "{% macro handle_existing_table(full_refresh, old_relation) %}\n {{ adapter.dispatch('handle_existing_table', 'dbt')(full_refresh, old_relation) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__handle_existing_table"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "full_refresh", "type": null, "description": ""}, {"name": "old_relation", "type": null, "description": ""}], "created_at": 1789419969.735429, "supported_languages": null}, "macro.dbt.default__handle_existing_table": {"name": "default__handle_existing_table", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/view/replace.sql", "original_file_path": "macros/relations/view/replace.sql", "unique_id": "macro.dbt.default__handle_existing_table", "macro_sql": "{% macro default__handle_existing_table(full_refresh, old_relation) %}\n {{ log(\"Dropping relation \" ~ old_relation.render() ~ \" because it is of type \" ~ old_relation.type) }}\n {{ adapter.drop_relation(old_relation) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "full_refresh", "type": null, "description": ""}, {"name": "old_relation", "type": null, "description": ""}], "created_at": 1789419969.7358475, "supported_languages": null}, "macro.dbt.get_table_columns_and_constraints": {"name": "get_table_columns_and_constraints", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/column/columns_spec_ddl.sql", "original_file_path": "macros/relations/column/columns_spec_ddl.sql", "unique_id": "macro.dbt.get_table_columns_and_constraints", "macro_sql": "{%- macro get_table_columns_and_constraints() -%}\n {{ adapter.dispatch('get_table_columns_and_constraints', 'dbt')() }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt.default__get_table_columns_and_constraints"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789419969.7372105, "supported_languages": null}, "macro.dbt.default__get_table_columns_and_constraints": {"name": "default__get_table_columns_and_constraints", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/column/columns_spec_ddl.sql", "original_file_path": "macros/relations/column/columns_spec_ddl.sql", "unique_id": "macro.dbt.default__get_table_columns_and_constraints", "macro_sql": "{% macro default__get_table_columns_and_constraints() -%}\n {{ return(table_columns_and_constraints()) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.table_columns_and_constraints"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789419969.7374206, "supported_languages": null}, "macro.dbt.table_columns_and_constraints": {"name": "table_columns_and_constraints", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/column/columns_spec_ddl.sql", "original_file_path": "macros/relations/column/columns_spec_ddl.sql", "unique_id": "macro.dbt.table_columns_and_constraints", "macro_sql": "{% macro table_columns_and_constraints() %}\n {# loop through user_provided_columns to create DDL with data types and constraints #}\n {%- set raw_column_constraints = adapter.render_raw_columns_constraints(raw_columns=model['columns']) -%}\n {%- set raw_model_constraints = adapter.render_raw_model_constraints(raw_constraints=model['constraints']) -%}\n (\n {% for c in raw_column_constraints -%}\n {{ c }}{{ \",\" if not loop.last or raw_model_constraints }}\n {% endfor %}\n {% for c in raw_model_constraints -%}\n {{ c }}{{ \",\" if not loop.last }}\n {% endfor -%}\n )\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789419969.7383256, "supported_languages": null}, "macro.dbt.get_assert_columns_equivalent": {"name": "get_assert_columns_equivalent", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/column/columns_spec_ddl.sql", "original_file_path": "macros/relations/column/columns_spec_ddl.sql", "unique_id": "macro.dbt.get_assert_columns_equivalent", "macro_sql": "\n\n{%- macro get_assert_columns_equivalent(sql) -%}\n {{ adapter.dispatch('get_assert_columns_equivalent', 'dbt')(sql) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt.default__get_assert_columns_equivalent"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "sql", "type": null, "description": ""}], "created_at": 1789419969.7386127, "supported_languages": null}, "macro.dbt.default__get_assert_columns_equivalent": {"name": "default__get_assert_columns_equivalent", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/column/columns_spec_ddl.sql", "original_file_path": "macros/relations/column/columns_spec_ddl.sql", "unique_id": "macro.dbt.default__get_assert_columns_equivalent", "macro_sql": "{% macro default__get_assert_columns_equivalent(sql) -%}\n {{ return(assert_columns_equivalent(sql)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.assert_columns_equivalent"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "sql", "type": null, "description": ""}], "created_at": 1789419969.7388546, "supported_languages": null}, "macro.dbt.assert_columns_equivalent": {"name": "assert_columns_equivalent", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/column/columns_spec_ddl.sql", "original_file_path": "macros/relations/column/columns_spec_ddl.sql", "unique_id": "macro.dbt.assert_columns_equivalent", "macro_sql": "{% macro assert_columns_equivalent(sql) %}\n\n {#-- First ensure the user has defined 'columns' in yaml specification --#}\n {%- set user_defined_columns = model['columns'] -%}\n {%- if not user_defined_columns -%}\n {{ exceptions.raise_contract_error([], []) }}\n {%- endif -%}\n\n {#-- Obtain the column schema provided by sql file. #}\n {%- set sql_file_provided_columns = get_column_schema_from_query(sql, config.get('sql_header', none)) -%}\n {#--Obtain the column schema provided by the schema file by generating an 'empty schema' query from the model's columns. #}\n {%- set schema_file_provided_columns = get_column_schema_from_query(get_empty_schema_sql(user_defined_columns)) -%}\n\n {#-- create dictionaries with name and formatted data type and strings for exception #}\n {%- set sql_columns = format_columns(sql_file_provided_columns) -%}\n {%- set yaml_columns = format_columns(schema_file_provided_columns) -%}\n\n {%- if sql_columns|length != yaml_columns|length -%}\n {%- do exceptions.raise_contract_error(yaml_columns, sql_columns) -%}\n {%- endif -%}\n\n {%- for sql_col in sql_columns -%}\n {%- set yaml_col = [] -%}\n {%- for this_col in yaml_columns -%}\n {%- if this_col['name'] == sql_col['name'] -%}\n {%- do yaml_col.append(this_col) -%}\n {%- break -%}\n {%- endif -%}\n {%- endfor -%}\n {%- if not yaml_col -%}\n {#-- Column with name not found in yaml #}\n {%- do exceptions.raise_contract_error(yaml_columns, sql_columns) -%}\n {%- endif -%}\n {%- if sql_col['formatted'] != yaml_col[0]['formatted'] -%}\n {#-- Column data types don't match #}\n {%- do exceptions.raise_contract_error(yaml_columns, sql_columns) -%}\n {%- endif -%}\n {%- endfor -%}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_column_schema_from_query", "macro.dbt.get_empty_schema_sql", "macro.dbt.format_columns"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "sql", "type": null, "description": ""}], "created_at": 1789419969.7409651, "supported_languages": null}, "macro.dbt.format_columns": {"name": "format_columns", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/column/columns_spec_ddl.sql", "original_file_path": "macros/relations/column/columns_spec_ddl.sql", "unique_id": "macro.dbt.format_columns", "macro_sql": "{% macro format_columns(columns) %}\n {% set formatted_columns = [] %}\n {% for column in columns %}\n {%- set formatted_column = adapter.dispatch('format_column', 'dbt')(column) -%}\n {%- do formatted_columns.append(formatted_column) -%}\n {% endfor %}\n {{ return(formatted_columns) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__format_column"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "columns", "type": null, "description": ""}], "created_at": 1789419969.741598, "supported_languages": null}, "macro.dbt.default__format_column": {"name": "default__format_column", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/column/columns_spec_ddl.sql", "original_file_path": "macros/relations/column/columns_spec_ddl.sql", "unique_id": "macro.dbt.default__format_column", "macro_sql": "{% macro default__format_column(column) -%}\n {% set data_type = column.dtype %}\n {% set formatted = column.column.lower() ~ \" \" ~ data_type %}\n {{ return({'name': column.name, 'data_type': data_type, 'formatted': formatted}) }}\n{%- endmacro -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "column", "type": null, "description": ""}], "created_at": 1789419969.7421756, "supported_languages": null}, "macro.dbt.get_create_table_as_sql": {"name": "get_create_table_as_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/table/create.sql", "original_file_path": "macros/relations/table/create.sql", "unique_id": "macro.dbt.get_create_table_as_sql", "macro_sql": "{% macro get_create_table_as_sql(temporary, relation, sql) -%}\n {{ adapter.dispatch('get_create_table_as_sql', 'dbt')(temporary, relation, sql) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_create_table_as_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "temporary", "type": null, "description": ""}, {"name": "relation", "type": null, "description": ""}, {"name": "sql", "type": null, "description": ""}], "created_at": 1789419969.7433088, "supported_languages": null}, "macro.dbt.default__get_create_table_as_sql": {"name": "default__get_create_table_as_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/table/create.sql", "original_file_path": "macros/relations/table/create.sql", "unique_id": "macro.dbt.default__get_create_table_as_sql", "macro_sql": "{% macro default__get_create_table_as_sql(temporary, relation, sql) -%}\n {{ return(create_table_as(temporary, relation, sql)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.create_table_as"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "temporary", "type": null, "description": ""}, {"name": "relation", "type": null, "description": ""}, {"name": "sql", "type": null, "description": ""}], "created_at": 1789419969.7436247, "supported_languages": null}, "macro.dbt.create_table_as": {"name": "create_table_as", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/table/create.sql", "original_file_path": "macros/relations/table/create.sql", "unique_id": "macro.dbt.create_table_as", "macro_sql": "{% macro create_table_as(temporary, relation, compiled_code, language='sql') -%}\n {# backward compatibility for create_table_as that does not support language #}\n {% if language == \"sql\" %}\n {{ adapter.dispatch('create_table_as', 'dbt')(temporary, relation, compiled_code)}}\n {% else %}\n {{ adapter.dispatch('create_table_as', 'dbt')(temporary, relation, compiled_code, language) }}\n {% endif %}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__create_table_as"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "temporary", "type": null, "description": ""}, {"name": "relation", "type": null, "description": ""}, {"name": "compiled_code", "type": null, "description": ""}, {"name": "language", "type": null, "description": ""}], "created_at": 1789419969.7444918, "supported_languages": null}, "macro.dbt.default__create_table_as": {"name": "default__create_table_as", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/table/create.sql", "original_file_path": "macros/relations/table/create.sql", "unique_id": "macro.dbt.default__create_table_as", "macro_sql": "{% macro default__create_table_as(temporary, relation, sql) -%}\n {%- set sql_header = config.get('sql_header', none) -%}\n\n {{ sql_header if sql_header is not none }}\n\n create {% if temporary: -%}temporary{%- endif %} table\n {{ relation.include(database=(not temporary), schema=(not temporary)) }}\n {% set contract_config = config.get('contract') %}\n {% if contract_config.enforced and (not temporary) %}\n {{ get_assert_columns_equivalent(sql) }}\n {{ get_table_columns_and_constraints() }}\n {%- set sql = get_select_subquery(sql) %}\n {% endif %}\n as (\n {{ sql }}\n );\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.get_assert_columns_equivalent", "macro.dbt.get_table_columns_and_constraints", "macro.dbt.get_select_subquery"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "temporary", "type": null, "description": ""}, {"name": "relation", "type": null, "description": ""}, {"name": "sql", "type": null, "description": ""}], "created_at": 1789419969.74567, "supported_languages": null}, "macro.dbt.default__get_column_names": {"name": "default__get_column_names", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/table/create.sql", "original_file_path": "macros/relations/table/create.sql", "unique_id": "macro.dbt.default__get_column_names", "macro_sql": "{% macro default__get_column_names() %}\n {#- loop through user_provided_columns to get column names -#}\n {%- set user_provided_columns = model['columns'] -%}\n {%- for i in user_provided_columns %}\n {%- set col = user_provided_columns[i] -%}\n {%- set col_name = adapter.quote(col['name']) if col.get('quote') else col['name'] -%}\n {{ col_name }}{{ \", \" if not loop.last }}\n {%- endfor -%}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789419969.7464666, "supported_languages": null}, "macro.dbt.get_select_subquery": {"name": "get_select_subquery", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/table/create.sql", "original_file_path": "macros/relations/table/create.sql", "unique_id": "macro.dbt.get_select_subquery", "macro_sql": "{% macro get_select_subquery(sql) %}\n {{ return(adapter.dispatch('get_select_subquery', 'dbt')(sql)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_select_subquery"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "sql", "type": null, "description": ""}], "created_at": 1789419969.746796, "supported_languages": null}, "macro.dbt.default__get_select_subquery": {"name": "default__get_select_subquery", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/table/create.sql", "original_file_path": "macros/relations/table/create.sql", "unique_id": "macro.dbt.default__get_select_subquery", "macro_sql": "{% macro default__get_select_subquery(sql) %}\n select {{ adapter.dispatch('get_column_names', 'dbt')() }}\n from (\n {{ sql }}\n ) as model_subq\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_column_names"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "sql", "type": null, "description": ""}], "created_at": 1789419969.7470894, "supported_languages": null}, "macro.dbt.get_rename_table_sql": {"name": "get_rename_table_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/table/rename.sql", "original_file_path": "macros/relations/table/rename.sql", "unique_id": "macro.dbt.get_rename_table_sql", "macro_sql": "{% macro get_rename_table_sql(relation, new_name) %}\n {{- adapter.dispatch('get_rename_table_sql', 'dbt')(relation, new_name) -}}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__get_rename_table_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "new_name", "type": null, "description": ""}], "created_at": 1789419969.7475626, "supported_languages": null}, "macro.dbt.default__get_rename_table_sql": {"name": "default__get_rename_table_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/table/rename.sql", "original_file_path": "macros/relations/table/rename.sql", "unique_id": "macro.dbt.default__get_rename_table_sql", "macro_sql": "{% macro default__get_rename_table_sql(relation, new_name) %}\n {{ exceptions.raise_compiler_error(\n \"`get_rename_table_sql` has not been implemented for this adapter.\"\n ) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "new_name", "type": null, "description": ""}], "created_at": 1789419969.747816, "supported_languages": null}, "macro.dbt.drop_table": {"name": "drop_table", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/table/drop.sql", "original_file_path": "macros/relations/table/drop.sql", "unique_id": "macro.dbt.drop_table", "macro_sql": "{% macro drop_table(relation) -%}\n {{- adapter.dispatch('drop_table', 'dbt')(relation) -}}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__drop_table"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789419969.748231, "supported_languages": null}, "macro.dbt.default__drop_table": {"name": "default__drop_table", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/table/drop.sql", "original_file_path": "macros/relations/table/drop.sql", "unique_id": "macro.dbt.default__drop_table", "macro_sql": "{% macro default__drop_table(relation) -%}\n drop table if exists {{ relation.render() }} cascade\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789419969.7484407, "supported_languages": null}, "macro.dbt.get_replace_table_sql": {"name": "get_replace_table_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/table/replace.sql", "original_file_path": "macros/relations/table/replace.sql", "unique_id": "macro.dbt.get_replace_table_sql", "macro_sql": "{% macro get_replace_table_sql(relation, sql) %}\n {{- adapter.dispatch('get_replace_table_sql', 'dbt')(relation, sql) -}}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__get_replace_table_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "sql", "type": null, "description": ""}], "created_at": 1789419969.7489023, "supported_languages": null}, "macro.dbt.default__get_replace_table_sql": {"name": "default__get_replace_table_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/table/replace.sql", "original_file_path": "macros/relations/table/replace.sql", "unique_id": "macro.dbt.default__get_replace_table_sql", "macro_sql": "{% macro default__get_replace_table_sql(relation, sql) %}\n {{ exceptions.raise_compiler_error(\n \"`get_replace_table_sql` has not been implemented for this adapter.\"\n ) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "sql", "type": null, "description": ""}], "created_at": 1789419969.7491539, "supported_languages": null}, "macro.dbt.default__test_relationships": {"name": "default__test_relationships", "resource_type": "macro", "package_name": "dbt", "path": "macros/generic_test_sql/relationships.sql", "original_file_path": "macros/generic_test_sql/relationships.sql", "unique_id": "macro.dbt.default__test_relationships", "macro_sql": "{% macro default__test_relationships(model, column_name, to, field) %}\n\nwith child as (\n select {{ column_name }} as from_field\n from {{ model }}\n where {{ column_name }} is not null\n),\n\nparent as (\n select {{ field }} as to_field\n from {{ to }}\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "column_name", "type": null, "description": ""}, {"name": "to", "type": null, "description": ""}, {"name": "field", "type": null, "description": ""}], "created_at": 1789419969.7496397, "supported_languages": null}, "macro.dbt.default__test_accepted_values": {"name": "default__test_accepted_values", "resource_type": "macro", "package_name": "dbt", "path": "macros/generic_test_sql/accepted_values.sql", "original_file_path": "macros/generic_test_sql/accepted_values.sql", "unique_id": "macro.dbt.default__test_accepted_values", "macro_sql": "{% macro default__test_accepted_values(model, column_name, values, quote=True) %}\n\nwith all_values as (\n\n select\n {{ column_name }} as value_field,\n count(*) as n_records\n\n from {{ model }}\n group by {{ column_name }}\n\n)\n\nselect *\nfrom all_values\nwhere value_field not in (\n {% for value in values -%}\n {% if quote -%}\n '{{ value }}'\n {%- else -%}\n {{ value }}\n {%- endif -%}\n {%- if not loop.last -%},{%- endif %}\n {%- endfor %}\n)\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "column_name", "type": null, "description": ""}, {"name": "values", "type": null, "description": ""}, {"name": "quote", "type": null, "description": ""}], "created_at": 1789419969.7505133, "supported_languages": null}, "macro.dbt.default__test_not_null": {"name": "default__test_not_null", "resource_type": "macro", "package_name": "dbt", "path": "macros/generic_test_sql/not_null.sql", "original_file_path": "macros/generic_test_sql/not_null.sql", "unique_id": "macro.dbt.default__test_not_null", "macro_sql": "{% macro default__test_not_null(model, column_name) %}\n\n{% set column_list = '*' if should_store_failures() else column_name %}\n\nselect {{ column_list }}\nfrom {{ model }}\nwhere {{ column_name }} is null\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.should_store_failures"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "column_name", "type": null, "description": ""}], "created_at": 1789419969.7510307, "supported_languages": null}, "macro.dbt.default__test_unique": {"name": "default__test_unique", "resource_type": "macro", "package_name": "dbt", "path": "macros/generic_test_sql/unique.sql", "original_file_path": "macros/generic_test_sql/unique.sql", "unique_id": "macro.dbt.default__test_unique", "macro_sql": "{% macro default__test_unique(model, column_name) %}\n\nselect\n {{ column_name }} as unique_field,\n count(*) as n_records\n\nfrom {{ model }}\nwhere {{ column_name }} is not null\ngroup by {{ column_name }}\nhaving count(*) > 1\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "column_name", "type": null, "description": ""}], "created_at": 1789419969.7514231, "supported_languages": null}, "macro.dbt.set_sql_header": {"name": "set_sql_header", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/configs.sql", "original_file_path": "macros/materializations/configs.sql", "unique_id": "macro.dbt.set_sql_header", "macro_sql": "{% macro set_sql_header(config) -%}\n {{ config.set('sql_header', caller()) }}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "config", "type": null, "description": ""}], "created_at": 1789419969.7519364, "supported_languages": null}, "macro.dbt.should_full_refresh": {"name": "should_full_refresh", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/configs.sql", "original_file_path": "macros/materializations/configs.sql", "unique_id": "macro.dbt.should_full_refresh", "macro_sql": "{% macro should_full_refresh() %}\n {% set config_full_refresh = config.get('full_refresh') %}\n {% if config_full_refresh is none %}\n {% set config_full_refresh = flags.FULL_REFRESH %}\n {% endif %}\n {% do return(config_full_refresh) %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789419969.7525644, "supported_languages": null}, "macro.dbt.should_store_failures": {"name": "should_store_failures", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/configs.sql", "original_file_path": "macros/materializations/configs.sql", "unique_id": "macro.dbt.should_store_failures", "macro_sql": "{% macro should_store_failures() %}\n {% set config_store_failures = config.get('store_failures') %}\n {% if config_store_failures is none %}\n {% set config_store_failures = flags.STORE_FAILURES %}\n {% endif %}\n {% do return(config_store_failures) %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789419969.7530746, "supported_languages": null}, "macro.dbt.run_hooks": {"name": "run_hooks", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/hooks.sql", "original_file_path": "macros/materializations/hooks.sql", "unique_id": "macro.dbt.run_hooks", "macro_sql": "{% macro run_hooks(hooks, inside_transaction=True) %}\n {% for hook in hooks | selectattr('transaction', 'equalto', inside_transaction) %}\n {% if not inside_transaction and loop.first %}\n {% call statement(auto_begin=inside_transaction) %}\n commit;\n {% endcall %}\n {% endif %}\n {% set rendered = render(hook.get('sql')) | trim %}\n {% if (rendered | length) > 0 %}\n {% call statement(auto_begin=inside_transaction) %}\n {{ rendered }}\n {% endcall %}\n {% endif %}\n {% endfor %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "hooks", "type": null, "description": ""}, {"name": "inside_transaction", "type": null, "description": ""}], "created_at": 1789419969.7545285, "supported_languages": null}, "macro.dbt.make_hook_config": {"name": "make_hook_config", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/hooks.sql", "original_file_path": "macros/materializations/hooks.sql", "unique_id": "macro.dbt.make_hook_config", "macro_sql": "{% macro make_hook_config(sql, inside_transaction) %}\n {{ tojson({\"sql\": sql, \"transaction\": inside_transaction}) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "sql", "type": null, "description": ""}, {"name": "inside_transaction", "type": null, "description": ""}], "created_at": 1789419969.7548862, "supported_languages": null}, "macro.dbt.before_begin": {"name": "before_begin", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/hooks.sql", "original_file_path": "macros/materializations/hooks.sql", "unique_id": "macro.dbt.before_begin", "macro_sql": "{% macro before_begin(sql) %}\n {{ make_hook_config(sql, inside_transaction=False) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.make_hook_config"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "sql", "type": null, "description": ""}], "created_at": 1789419969.7551308, "supported_languages": null}, "macro.dbt.in_transaction": {"name": "in_transaction", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/hooks.sql", "original_file_path": "macros/materializations/hooks.sql", "unique_id": "macro.dbt.in_transaction", "macro_sql": "{% macro in_transaction(sql) %}\n {{ make_hook_config(sql, inside_transaction=True) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.make_hook_config"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "sql", "type": null, "description": ""}], "created_at": 1789419969.755368, "supported_languages": null}, "macro.dbt.after_commit": {"name": "after_commit", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/hooks.sql", "original_file_path": "macros/materializations/hooks.sql", "unique_id": "macro.dbt.after_commit", "macro_sql": "{% macro after_commit(sql) %}\n {{ make_hook_config(sql, inside_transaction=False) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.make_hook_config"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "sql", "type": null, "description": ""}], "created_at": 1789419969.7556021, "supported_languages": null}, "macro.dbt.materialization_seed_default": {"name": "materialization_seed_default", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/seeds/seed.sql", "original_file_path": "macros/materializations/seeds/seed.sql", "unique_id": "macro.dbt.materialization_seed_default", "macro_sql": "{% materialization seed, default %}\n\n {%- set identifier = model['alias'] -%}\n {%- set full_refresh_mode = (should_full_refresh()) -%}\n\n {%- set old_relation = adapter.get_relation(database=database, schema=schema, identifier=identifier) -%}\n\n {%- set exists_as_table = (old_relation is not none and old_relation.is_table) -%}\n {%- set exists_as_view = (old_relation is not none and old_relation.is_view) -%}\n\n {%- set grant_config = config.get('grants') -%}\n {%- set agate_table = load_agate_table() -%}\n -- grab current tables grants config for comparison later on\n\n {%- do store_result('agate_table', response='OK', agate_table=agate_table) -%}\n\n {{ run_hooks(pre_hooks, inside_transaction=False) }}\n\n -- `BEGIN` happens here:\n {{ run_hooks(pre_hooks, inside_transaction=True) }}\n\n -- build model\n {% set create_table_sql = \"\" %}\n {% if exists_as_view %}\n {{ exceptions.raise_compiler_error(\"Cannot seed to '{}', it is a view\".format(old_relation.render())) }}\n {% elif exists_as_table %}\n {% set create_table_sql = reset_csv_table(model, full_refresh_mode, old_relation, agate_table) %}\n {% else %}\n {% set create_table_sql = create_csv_table(model, agate_table) %}\n {% endif %}\n\n {% set code = 'CREATE' if full_refresh_mode else 'INSERT' %}\n {% set rows_affected = (agate_table.rows | length) %}\n {% set sql = \"\" %}\n {% if rows_affected > 0 %}\n {% set sql = load_csv_rows(model, agate_table) %}\n {% endif %}\n\n {% call noop_statement('main', code ~ ' ' ~ rows_affected, code, rows_affected) %}\n {{ get_csv_sql(create_table_sql, sql) }};\n {% endcall %}\n\n {% set target_relation = this.incorporate(type='table') %}\n\n {% set should_revoke = should_revoke(old_relation, full_refresh_mode) %}\n {% do apply_grants(target_relation, grant_config, should_revoke=should_revoke) %}\n\n {% do persist_docs(target_relation, model) %}\n\n {% if full_refresh_mode or not exists_as_table %}\n {% do create_indexes(target_relation) %}\n {% endif %}\n\n {{ run_hooks(post_hooks, inside_transaction=True) }}\n\n -- `COMMIT` happens here\n {{ adapter.commit() }}\n\n {{ run_hooks(post_hooks, inside_transaction=False) }}\n\n {{ return({'relations': [target_relation]}) }}\n\n{% endmaterialization %}", "depends_on": {"macros": ["macro.dbt.should_full_refresh", "macro.dbt.run_hooks", "macro.dbt.reset_csv_table", "macro.dbt.create_csv_table", "macro.dbt.load_csv_rows", "macro.dbt.noop_statement", "macro.dbt.get_csv_sql", "macro.dbt.should_revoke", "macro.dbt.apply_grants", "macro.dbt.persist_docs", "macro.dbt.create_indexes"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "supported_languages", "type": null, "description": ""}], "created_at": 1789419969.7602792, "supported_languages": ["sql"]}, "macro.dbt.create_csv_table": {"name": "create_csv_table", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "unique_id": "macro.dbt.create_csv_table", "macro_sql": "{% macro create_csv_table(model, agate_table) -%}\n {{ adapter.dispatch('create_csv_table', 'dbt')(model, agate_table) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__create_csv_table"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "agate_table", "type": null, "description": ""}], "created_at": 1789419969.7620363, "supported_languages": null}, "macro.dbt.default__create_csv_table": {"name": "default__create_csv_table", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "unique_id": "macro.dbt.default__create_csv_table", "macro_sql": "{% macro default__create_csv_table(model, agate_table) %}\n {%- set column_override = model['config'].get('column_types', {}) -%}\n {%- set quote_seed_column = model['config'].get('quote_columns', None) -%}\n\n {% set sql %}\n create table {{ this.render() }} (\n {%- for col_name in agate_table.column_names -%}\n {%- set inferred_type = adapter.convert_type(agate_table, loop.index0) -%}\n {%- set type = column_override.get(col_name, inferred_type) -%}\n {%- set column_name = (col_name | string) -%}\n {{ adapter.quote_seed_column(column_name, quote_seed_column) }} {{ type }} {%- if not loop.last -%}, {%- endif -%}\n {%- endfor -%}\n )\n {% endset %}\n\n {% call statement('_') -%}\n {{ sql }}\n {%- endcall %}\n\n {{ return(sql) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "agate_table", "type": null, "description": ""}], "created_at": 1789419969.7635393, "supported_languages": null}, "macro.dbt.reset_csv_table": {"name": "reset_csv_table", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "unique_id": "macro.dbt.reset_csv_table", "macro_sql": "{% macro reset_csv_table(model, full_refresh, old_relation, agate_table) -%}\n {{ adapter.dispatch('reset_csv_table', 'dbt')(model, full_refresh, old_relation, agate_table) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__reset_csv_table"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "full_refresh", "type": null, "description": ""}, {"name": "old_relation", "type": null, "description": ""}, {"name": "agate_table", "type": null, "description": ""}], "created_at": 1789419969.7639542, "supported_languages": null}, "macro.dbt.default__reset_csv_table": {"name": "default__reset_csv_table", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "unique_id": "macro.dbt.default__reset_csv_table", "macro_sql": "{% macro default__reset_csv_table(model, full_refresh, old_relation, agate_table) %}\n {% set sql = \"\" %}\n {% if full_refresh %}\n {{ adapter.drop_relation(old_relation) }}\n {% set sql = create_csv_table(model, agate_table) %}\n {% else %}\n {{ adapter.truncate_relation(old_relation) }}\n {% set sql = \"truncate table \" ~ old_relation.render() %}\n {% endif %}\n\n {{ return(sql) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.create_csv_table"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "full_refresh", "type": null, "description": ""}, {"name": "old_relation", "type": null, "description": ""}, {"name": "agate_table", "type": null, "description": ""}], "created_at": 1789419969.764779, "supported_languages": null}, "macro.dbt.get_csv_sql": {"name": "get_csv_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "unique_id": "macro.dbt.get_csv_sql", "macro_sql": "{% macro get_csv_sql(create_or_truncate_sql, insert_sql) %}\n {{ adapter.dispatch('get_csv_sql', 'dbt')(create_or_truncate_sql, insert_sql) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_csv_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "create_or_truncate_sql", "type": null, "description": ""}, {"name": "insert_sql", "type": null, "description": ""}], "created_at": 1789419969.7651043, "supported_languages": null}, "macro.dbt.default__get_csv_sql": {"name": "default__get_csv_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "unique_id": "macro.dbt.default__get_csv_sql", "macro_sql": "{% macro default__get_csv_sql(create_or_truncate_sql, insert_sql) %}\n {{ create_or_truncate_sql }};\n -- dbt seed --\n {{ insert_sql }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "create_or_truncate_sql", "type": null, "description": ""}, {"name": "insert_sql", "type": null, "description": ""}], "created_at": 1789419969.765333, "supported_languages": null}, "macro.dbt.get_binding_char": {"name": "get_binding_char", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "unique_id": "macro.dbt.get_binding_char", "macro_sql": "{% macro get_binding_char() -%}\n {{ adapter.dispatch('get_binding_char', 'dbt')() }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_binding_char"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789419969.7655702, "supported_languages": null}, "macro.dbt.default__get_binding_char": {"name": "default__get_binding_char", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "unique_id": "macro.dbt.default__get_binding_char", "macro_sql": "{% macro default__get_binding_char() %}\n {{ return('%s') }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789419969.765779, "supported_languages": null}, "macro.dbt.get_batch_size": {"name": "get_batch_size", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "unique_id": "macro.dbt.get_batch_size", "macro_sql": "{% macro get_batch_size() -%}\n {{ return(adapter.dispatch('get_batch_size', 'dbt')()) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_batch_size"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789419969.7660427, "supported_languages": null}, "macro.dbt.default__get_batch_size": {"name": "default__get_batch_size", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "unique_id": "macro.dbt.default__get_batch_size", "macro_sql": "{% macro default__get_batch_size() %}\n {{ return(10000) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789419969.7662413, "supported_languages": null}, "macro.dbt.get_seed_column_quoted_csv": {"name": "get_seed_column_quoted_csv", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "unique_id": "macro.dbt.get_seed_column_quoted_csv", "macro_sql": "{% macro get_seed_column_quoted_csv(model, column_names) %}\n {%- set quote_seed_column = model['config'].get('quote_columns', None) -%}\n {% set quoted = [] %}\n {% for col in column_names -%}\n {%- do quoted.append(adapter.quote_seed_column(col, quote_seed_column)) -%}\n {%- endfor %}\n\n {%- set dest_cols_csv = quoted | join(', ') -%}\n {{ return(dest_cols_csv) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "column_names", "type": null, "description": ""}], "created_at": 1789419969.7670484, "supported_languages": null}, "macro.dbt.load_csv_rows": {"name": "load_csv_rows", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "unique_id": "macro.dbt.load_csv_rows", "macro_sql": "{% macro load_csv_rows(model, agate_table) -%}\n {{ adapter.dispatch('load_csv_rows', 'dbt')(model, agate_table) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__load_csv_rows"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "agate_table", "type": null, "description": ""}], "created_at": 1789419969.767361, "supported_languages": null}, "macro.dbt.default__load_csv_rows": {"name": "default__load_csv_rows", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "unique_id": "macro.dbt.default__load_csv_rows", "macro_sql": "{% macro default__load_csv_rows(model, agate_table) %}\n\n {% set batch_size = get_batch_size() %}\n\n {% set cols_sql = get_seed_column_quoted_csv(model, agate_table.column_names) %}\n {% set bindings = [] %}\n\n {% set statements = [] %}\n\n {% for chunk in agate_table.rows | batch(batch_size) %}\n {% set bindings = [] %}\n\n {% for row in chunk %}\n {% do bindings.extend(row) %}\n {% endfor %}\n\n {% set sql %}\n insert into {{ this.render() }} ({{ cols_sql }}) values\n {% for row in chunk -%}\n ({%- for column in agate_table.column_names -%}\n {{ get_binding_char() }}\n {%- if not loop.last%},{%- endif %}\n {%- endfor -%})\n {%- if not loop.last%},{%- endif %}\n {%- endfor %}\n {% endset %}\n\n {% do adapter.add_query(sql, bindings=bindings, abridge_sql_log=True) %}\n\n {% if loop.index0 == 0 %}\n {% do statements.append(sql) %}\n {% endif %}\n {% endfor %}\n\n {# Return SQL so we can render it out into the compiled files #}\n {{ return(statements[0]) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_batch_size", "macro.dbt.get_seed_column_quoted_csv", "macro.dbt.get_binding_char"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "agate_table", "type": null, "description": ""}], "created_at": 1789419969.7694707, "supported_languages": null}, "macro.dbt.materialization_unit_default": {"name": "materialization_unit_default", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/tests/unit.sql", "original_file_path": "macros/materializations/tests/unit.sql", "unique_id": "macro.dbt.materialization_unit_default", "macro_sql": "{%- materialization unit, default -%}\n\n {% set relations = [] %}\n {% set sql_header = config.get('sql_header') if flags.REQUIRE_SQL_HEADER_IN_TEST_CONFIGS else none %}\n\n {% set expected_rows = config.get('expected_rows') %}\n {% set expected_sql = config.get('expected_sql') %}\n {% set tested_expected_column_names = expected_rows[0].keys() if (expected_rows | length ) > 0 else get_columns_in_query(sql) %}\n\n {%- set target_relation = this.incorporate(type='table') -%}\n {%- set temp_relation = make_temp_relation(target_relation)-%}\n {% do run_query(get_create_table_as_sql(True, temp_relation, get_empty_subquery_sql(sql))) %}\n {%- set columns_in_relation = adapter.get_columns_in_relation(temp_relation) -%}\n {%- set column_name_to_data_types = {} -%}\n {%- set column_name_to_quoted = {} -%}\n {%- for column in columns_in_relation -%}\n {%- do column_name_to_data_types.update({column.name|lower: column.data_type}) -%}\n {%- do column_name_to_quoted.update({column.name|lower: column.quoted}) -%}\n {%- endfor -%}\n\n {%- set expected_column_names_quoted = [] -%}\n {%- for column_name in tested_expected_column_names -%}\n {%- do expected_column_names_quoted.append(column_name_to_quoted[column_name|lower]) -%}\n {%- endfor -%}\n\n {% if not expected_sql %}\n {% set expected_sql = get_expected_sql(expected_rows, column_name_to_data_types, column_name_to_quoted) %}\n {% endif %}\n {% set unit_test_sql = get_unit_test_sql(sql, expected_sql, expected_column_names_quoted) %}\n\n {% call statement('main', fetch_result=True) -%}\n\n {% if sql_header %}{{ sql_header }}{% endif %}\n {{ unit_test_sql }}\n\n {%- endcall %}\n\n {% do adapter.drop_relation(temp_relation) %}\n\n {{ return({'relations': relations}) }}\n\n{%- endmaterialization -%}", "depends_on": {"macros": ["macro.dbt.get_columns_in_query", "macro.dbt.make_temp_relation", "macro.dbt.run_query", "macro.dbt.get_create_table_as_sql", "macro.dbt.get_empty_subquery_sql", "macro.dbt.get_expected_sql", "macro.dbt.get_unit_test_sql", "macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "supported_languages", "type": null, "description": ""}], "created_at": 1789419969.7730067, "supported_languages": ["sql"]}, "macro.dbt.materialization_test_default": {"name": "materialization_test_default", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/tests/test.sql", "original_file_path": "macros/materializations/tests/test.sql", "unique_id": "macro.dbt.materialization_test_default", "macro_sql": "{%- materialization test, default -%}\n\n {% set relations = [] %}\n {% set limit = config.get('limit') %}\n {% set sql_header = config.get('sql_header') if flags.REQUIRE_SQL_HEADER_IN_TEST_CONFIGS else none %}\n\n {% set sql_with_limit %}\n {{ get_limit_subquery_sql(sql, limit) }}\n {% endset %}\n\n {% if should_store_failures() %}\n\n {% set identifier = model['alias'] %}\n {% set old_relation = adapter.get_relation(database=database, schema=schema, identifier=identifier) %}\n\n {% set store_failures_as = config.get('store_failures_as') %}\n -- if `--store-failures` is invoked via command line and `store_failures_as` is not set,\n -- config.get('store_failures_as', 'table') returns None, not 'table'\n {% if store_failures_as == none %}{% set store_failures_as = 'table' %}{% endif %}\n {% if store_failures_as not in ['table', 'view'] %}\n {{ exceptions.raise_compiler_error(\n \"'\" ~ store_failures_as ~ \"' is not a valid value for `store_failures_as`. \"\n \"Accepted values are: ['ephemeral', 'table', 'view']\"\n ) }}\n {% endif %}\n\n {% set target_relation = api.Relation.create(\n identifier=identifier, schema=schema, database=database, type=store_failures_as) -%} %}\n\n {% if old_relation %}\n {% do adapter.drop_relation(old_relation) %}\n {% endif %}\n\n {% call statement(auto_begin=True) %}\n {% if sql_header %}{{ sql_header }}{% endif %}\n {{ get_create_sql(target_relation, sql_with_limit) }}\n {% endcall %}\n\n {% do relations.append(target_relation) %}\n\n {# Since the test failures have already been saved to the database, reuse that result rather than querying again #}\n {% set main_sql %}\n select *\n from {{ target_relation }}\n {% endset %}\n\n {{ adapter.commit() }}\n\n {% else %}\n\n {% set main_sql = sql_with_limit %}\n\n {% endif %}\n\n {% set fail_calc = config.get('fail_calc') %}\n {% set warn_if = config.get('warn_if') %}\n {% set error_if = config.get('error_if') %}\n\n {% call statement('main', fetch_result=True) -%}\n\n {% if sql_header %}{{ sql_header }}{% endif %}\n {# The limit has already been included above, and we do not want to duplicate it again. We also want to be safe for macro overrides treating `limit` as a required parameter. #}\n {{ get_test_sql(main_sql, fail_calc, warn_if, error_if, limit=none)}}\n\n {%- endcall %}\n\n {{ return({'relations': relations}) }}\n\n{%- endmaterialization -%}", "depends_on": {"macros": ["macro.dbt.get_limit_subquery_sql", "macro.dbt.should_store_failures", "macro.dbt.statement", "macro.dbt.get_create_sql", "macro.dbt.get_test_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "supported_languages", "type": null, "description": ""}], "created_at": 1789419969.7772431, "supported_languages": ["sql"]}, "macro.dbt.get_test_sql": {"name": "get_test_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/tests/helpers.sql", "original_file_path": "macros/materializations/tests/helpers.sql", "unique_id": "macro.dbt.get_test_sql", "macro_sql": "{% macro get_test_sql(main_sql, fail_calc, warn_if, error_if, limit) -%}\n {{ adapter.dispatch('get_test_sql', 'dbt')(main_sql, fail_calc, warn_if, error_if, limit) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_test_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "main_sql", "type": null, "description": ""}, {"name": "fail_calc", "type": null, "description": ""}, {"name": "warn_if", "type": null, "description": ""}, {"name": "error_if", "type": null, "description": ""}, {"name": "limit", "type": null, "description": ""}], "created_at": 1789419969.778241, "supported_languages": null}, "macro.dbt.default__get_test_sql": {"name": "default__get_test_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/tests/helpers.sql", "original_file_path": "macros/materializations/tests/helpers.sql", "unique_id": "macro.dbt.default__get_test_sql", "macro_sql": "{% macro default__get_test_sql(main_sql, fail_calc, warn_if, error_if, limit) -%}\n select\n {{ fail_calc }} as failures,\n {{ fail_calc }} {{ warn_if }} as should_warn,\n {{ fail_calc }} {{ error_if }} as should_error\n from (\n {{ main_sql }}\n {{ \"limit \" ~ limit if limit != none }}\n ) dbt_internal_test\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "main_sql", "type": null, "description": ""}, {"name": "fail_calc", "type": null, "description": ""}, {"name": "warn_if", "type": null, "description": ""}, {"name": "error_if", "type": null, "description": ""}, {"name": "limit", "type": null, "description": ""}], "created_at": 1789419969.7787776, "supported_languages": null}, "macro.dbt.get_unit_test_sql": {"name": "get_unit_test_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/tests/helpers.sql", "original_file_path": "macros/materializations/tests/helpers.sql", "unique_id": "macro.dbt.get_unit_test_sql", "macro_sql": "{% macro get_unit_test_sql(main_sql, expected_fixture_sql, expected_column_names) -%}\n {{ adapter.dispatch('get_unit_test_sql', 'dbt')(main_sql, expected_fixture_sql, expected_column_names) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_unit_test_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "main_sql", "type": null, "description": ""}, {"name": "expected_fixture_sql", "type": null, "description": ""}, {"name": "expected_column_names", "type": null, "description": ""}], "created_at": 1789419969.7791338, "supported_languages": null}, "macro.dbt.default__get_unit_test_sql": {"name": "default__get_unit_test_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/tests/helpers.sql", "original_file_path": "macros/materializations/tests/helpers.sql", "unique_id": "macro.dbt.default__get_unit_test_sql", "macro_sql": "{% macro default__get_unit_test_sql(main_sql, expected_fixture_sql, expected_column_names) -%}\n-- Build actual result given inputs\nwith dbt_internal_unit_test_actual as (\n select\n {% for expected_column_name in expected_column_names %}{{expected_column_name}}{% if not loop.last -%},{% endif %}{%- endfor -%}, {{ dbt.string_literal(\"actual\") }} as {{ adapter.quote(\"actual_or_expected\") }}\n from (\n {{ main_sql }}\n ) _dbt_internal_unit_test_actual\n),\n-- Build expected result\ndbt_internal_unit_test_expected as (\n select\n {% for expected_column_name in expected_column_names %}{{expected_column_name}}{% if not loop.last -%}, {% endif %}{%- endfor -%}, {{ dbt.string_literal(\"expected\") }} as {{ adapter.quote(\"actual_or_expected\") }}\n from (\n {{ expected_fixture_sql }}\n ) _dbt_internal_unit_test_expected\n)\n-- Union actual and expected results\nselect * from dbt_internal_unit_test_actual\nunion all\nselect * from dbt_internal_unit_test_expected\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.string_literal"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "main_sql", "type": null, "description": ""}, {"name": "expected_fixture_sql", "type": null, "description": ""}, {"name": "expected_column_names", "type": null, "description": ""}], "created_at": 1789419969.7801359, "supported_languages": null}, "macro.dbt.get_where_subquery": {"name": "get_where_subquery", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/tests/where_subquery.sql", "original_file_path": "macros/materializations/tests/where_subquery.sql", "unique_id": "macro.dbt.get_where_subquery", "macro_sql": "{% macro get_where_subquery(relation) -%}\n {% do return(adapter.dispatch('get_where_subquery', 'dbt')(relation)) %}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_where_subquery"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789419969.7806976, "supported_languages": null}, "macro.dbt.default__get_where_subquery": {"name": "default__get_where_subquery", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/tests/where_subquery.sql", "original_file_path": "macros/materializations/tests/where_subquery.sql", "unique_id": "macro.dbt.default__get_where_subquery", "macro_sql": "{% macro default__get_where_subquery(relation) -%}\n {% set where = config.get('where', '') %}\n {% if where %}\n {%- set filtered -%}\n (select * from {{ relation }} where {{ where }}) dbt_subquery\n {%- endset -%}\n {% do return(filtered) %}\n {%- else -%}\n {% do return(relation) %}\n {%- endif -%}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789419969.7813437, "supported_languages": null}, "macro.dbt.materialization_snapshot_default": {"name": "materialization_snapshot_default", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/snapshot.sql", "original_file_path": "macros/materializations/snapshots/snapshot.sql", "unique_id": "macro.dbt.materialization_snapshot_default", "macro_sql": "{% materialization snapshot, default %}\n\n {%- set target_table = model.get('alias', model.get('name')) -%}\n\n {%- set strategy_name = config.get('strategy') -%}\n {%- set unique_key = config.get('unique_key') %}\n -- grab current tables grants config for comparision later on\n {%- set grant_config = config.get('grants') -%}\n\n {% set target_relation_exists, target_relation = get_or_create_relation(\n database=model.database,\n schema=model.schema,\n identifier=target_table,\n type='table') -%}\n\n {%- if not target_relation.is_table -%}\n {% do exceptions.relation_wrong_type(target_relation, 'table') %}\n {%- endif -%}\n\n\n {{ run_hooks(pre_hooks, inside_transaction=False) }}\n\n {{ run_hooks(pre_hooks, inside_transaction=True) }}\n\n {% set strategy_macro = strategy_dispatch(strategy_name) %}\n {# The model['config'] parameter below is no longer used, but passing anyway for compatibility #}\n {# It was a dictionary of config, instead of the config object from the context #}\n {% set strategy = strategy_macro(model, \"snapshotted_data\", \"source_data\", model['config'], target_relation_exists) %}\n\n {% if not target_relation_exists %}\n\n {% set build_sql = build_snapshot_table(strategy, model['compiled_code']) %}\n {% set build_or_select_sql = build_sql %}\n {% set final_sql = create_table_as(False, target_relation, build_sql) %}\n\n {% else %}\n\n {% set columns = config.get(\"snapshot_table_column_names\") or get_snapshot_table_column_names() %}\n\n {{ adapter.assert_valid_snapshot_target_given_strategy(target_relation, columns, strategy) }}\n\n {% set build_or_select_sql = snapshot_staging_table(strategy, sql, target_relation) %}\n {% set staging_table = build_snapshot_staging_table(strategy, sql, target_relation) %}\n\n -- this may no-op if the database does not require column expansion\n {% do adapter.expand_target_column_types(from_relation=staging_table,\n to_relation=target_relation) %}\n\n {% set remove_columns = ['dbt_change_type', 'DBT_CHANGE_TYPE', 'dbt_unique_key', 'DBT_UNIQUE_KEY'] %}\n {% if unique_key | is_list %}\n {% for key in strategy.unique_key %}\n {{ remove_columns.append('dbt_unique_key_' + loop.index|string) }}\n {{ remove_columns.append('DBT_UNIQUE_KEY_' + loop.index|string) }}\n {% endfor %}\n {% endif %}\n\n {% set missing_columns = adapter.get_missing_columns(staging_table, target_relation)\n | rejectattr('name', 'in', remove_columns)\n | list %}\n\n {% do create_columns(target_relation, missing_columns) %}\n\n {% set source_columns = adapter.get_columns_in_relation(staging_table)\n | rejectattr('name', 'in', remove_columns)\n | list %}\n\n {% set quoted_source_columns = [] %}\n {% for column in source_columns %}\n {% do quoted_source_columns.append(adapter.quote(column.name)) %}\n {% endfor %}\n\n {% set final_sql = snapshot_merge_sql(\n target = target_relation,\n source = staging_table,\n insert_cols = quoted_source_columns\n )\n %}\n\n {% endif %}\n\n\n {{ check_time_data_types(build_or_select_sql) }}\n\n {% call statement('main') %}\n {{ final_sql }}\n {% endcall %}\n\n {% set should_revoke = should_revoke(target_relation_exists, full_refresh_mode=False) %}\n {% do apply_grants(target_relation, grant_config, should_revoke=should_revoke) %}\n\n {% do persist_docs(target_relation, model) %}\n\n {% if not target_relation_exists %}\n {% do create_indexes(target_relation) %}\n {% endif %}\n\n {{ run_hooks(post_hooks, inside_transaction=True) }}\n\n {{ adapter.commit() }}\n\n {% if staging_table is defined %}\n {% do post_snapshot(staging_table) %}\n {% endif %}\n\n {{ run_hooks(post_hooks, inside_transaction=False) }}\n\n {{ return({'relations': [target_relation]}) }}\n\n{% endmaterialization %}", "depends_on": {"macros": ["macro.dbt.get_or_create_relation", "macro.dbt.run_hooks", "macro.dbt.strategy_dispatch", "macro.dbt.build_snapshot_table", "macro.dbt.create_table_as", "macro.dbt.get_snapshot_table_column_names", "macro.dbt.snapshot_staging_table", "macro.dbt.build_snapshot_staging_table", "macro.dbt.create_columns", "macro.dbt.snapshot_merge_sql", "macro.dbt.check_time_data_types", "macro.dbt.statement", "macro.dbt.should_revoke", "macro.dbt.apply_grants", "macro.dbt.persist_docs", "macro.dbt.create_indexes", "macro.dbt.post_snapshot"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "supported_languages", "type": null, "description": ""}], "created_at": 1789419969.7881088, "supported_languages": ["sql"]}, "macro.dbt.strategy_dispatch": {"name": "strategy_dispatch", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/strategies.sql", "original_file_path": "macros/materializations/snapshots/strategies.sql", "unique_id": "macro.dbt.strategy_dispatch", "macro_sql": "{% macro strategy_dispatch(name) -%}\n{% set original_name = name %}\n {% if '.' in name %}\n {% set package_name, name = name.split(\".\", 1) %}\n {% else %}\n {% set package_name = none %}\n {% endif %}\n\n {% if package_name is none %}\n {% set package_context = context %}\n {% elif package_name in context %}\n {% set package_context = context[package_name] %}\n {% else %}\n {% set error_msg %}\n Could not find package '{{package_name}}', called with '{{original_name}}'\n {% endset %}\n {{ exceptions.raise_compiler_error(error_msg | trim) }}\n {% endif %}\n\n {%- set search_name = 'snapshot_' ~ name ~ '_strategy' -%}\n\n {% if search_name not in package_context %}\n {% set error_msg %}\n The specified strategy macro '{{name}}' was not found in package '{{ package_name }}'\n {% endset %}\n {{ exceptions.raise_compiler_error(error_msg | trim) }}\n {% endif %}\n {{ return(package_context[search_name]) }}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "name", "type": null, "description": ""}], "created_at": 1789419969.7917945, "supported_languages": null}, "macro.dbt.snapshot_hash_arguments": {"name": "snapshot_hash_arguments", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/strategies.sql", "original_file_path": "macros/materializations/snapshots/strategies.sql", "unique_id": "macro.dbt.snapshot_hash_arguments", "macro_sql": "{% macro snapshot_hash_arguments(args) -%}\n {{ adapter.dispatch('snapshot_hash_arguments', 'dbt')(args) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__snapshot_hash_arguments"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "args", "type": null, "description": ""}], "created_at": 1789419969.7921126, "supported_languages": null}, "macro.dbt.default__snapshot_hash_arguments": {"name": "default__snapshot_hash_arguments", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/strategies.sql", "original_file_path": "macros/materializations/snapshots/strategies.sql", "unique_id": "macro.dbt.default__snapshot_hash_arguments", "macro_sql": "{% macro default__snapshot_hash_arguments(args) -%}\n md5({%- for arg in args -%}\n coalesce(cast({{ arg }} as varchar ), '')\n {% if not loop.last %} || '|' || {% endif %}\n {%- endfor -%})\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "args", "type": null, "description": ""}], "created_at": 1789419969.7924986, "supported_languages": null}, "macro.dbt.snapshot_timestamp_strategy": {"name": "snapshot_timestamp_strategy", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/strategies.sql", "original_file_path": "macros/materializations/snapshots/strategies.sql", "unique_id": "macro.dbt.snapshot_timestamp_strategy", "macro_sql": "{% macro snapshot_timestamp_strategy(node, snapshotted_rel, current_rel, model_config, target_exists) %}\n {# The model_config parameter is no longer used, but is passed in anyway for compatibility. #}\n {% set primary_key = config.get('unique_key') %}\n {% set updated_at = config.get('updated_at') %}\n {% set hard_deletes = adapter.get_hard_deletes_behavior(config) %}\n {% set invalidate_hard_deletes = hard_deletes == 'invalidate' %}\n {% set columns = config.get(\"snapshot_table_column_names\") or get_snapshot_table_column_names() %}\n\n {#/*\n The snapshot relation might not have an {{ updated_at }} value if the\n snapshot strategy is changed from `check` to `timestamp`. We\n should use a dbt-created column for the comparison in the snapshot\n table instead of assuming that the user-supplied {{ updated_at }}\n will be present in the historical data.\n\n See https://github.com/dbt-labs/dbt-core/issues/2350\n */ #}\n {% set row_changed_expr -%}\n ({{ snapshotted_rel }}.{{ columns.dbt_valid_from }} < {{ current_rel }}.{{ updated_at }})\n {%- endset %}\n\n {% set scd_args = api.Relation.scd_args(primary_key, updated_at) %}\n {% set scd_id_expr = snapshot_hash_arguments(scd_args) %}\n\n {% do return({\n \"unique_key\": primary_key,\n \"updated_at\": updated_at,\n \"row_changed\": row_changed_expr,\n \"scd_id\": scd_id_expr,\n \"invalidate_hard_deletes\": invalidate_hard_deletes,\n \"hard_deletes\": hard_deletes\n }) %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_snapshot_table_column_names", "macro.dbt.snapshot_hash_arguments"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "node", "type": null, "description": ""}, {"name": "snapshotted_rel", "type": null, "description": ""}, {"name": "current_rel", "type": null, "description": ""}, {"name": "model_config", "type": null, "description": ""}, {"name": "target_exists", "type": null, "description": ""}], "created_at": 1789419969.7941194, "supported_languages": null}, "macro.dbt.snapshot_string_as_time": {"name": "snapshot_string_as_time", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/strategies.sql", "original_file_path": "macros/materializations/snapshots/strategies.sql", "unique_id": "macro.dbt.snapshot_string_as_time", "macro_sql": "{% macro snapshot_string_as_time(timestamp) -%}\n {{ adapter.dispatch('snapshot_string_as_time', 'dbt')(timestamp) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__snapshot_string_as_time"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "timestamp", "type": null, "description": ""}], "created_at": 1789419969.7944117, "supported_languages": null}, "macro.dbt.default__snapshot_string_as_time": {"name": "default__snapshot_string_as_time", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/strategies.sql", "original_file_path": "macros/materializations/snapshots/strategies.sql", "unique_id": "macro.dbt.default__snapshot_string_as_time", "macro_sql": "{% macro default__snapshot_string_as_time(timestamp) %}\n {% do exceptions.raise_not_implemented(\n 'snapshot_string_as_time macro not implemented for adapter '+adapter.type()\n ) %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "timestamp", "type": null, "description": ""}], "created_at": 1789419969.794699, "supported_languages": null}, "macro.dbt.snapshot_check_all_get_existing_columns": {"name": "snapshot_check_all_get_existing_columns", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/strategies.sql", "original_file_path": "macros/materializations/snapshots/strategies.sql", "unique_id": "macro.dbt.snapshot_check_all_get_existing_columns", "macro_sql": "{% macro snapshot_check_all_get_existing_columns(node, target_exists, check_cols_config) -%}\n {%- if not target_exists -%}\n {#-- no table yet -> return whatever the query does --#}\n {{ return((false, query_columns)) }}\n {%- endif -%}\n\n {#-- handle any schema changes --#}\n {%- set target_relation = adapter.get_relation(database=node.database, schema=node.schema, identifier=node.alias) -%}\n\n {% if check_cols_config == 'all' %}\n {%- set query_columns = get_columns_in_query(node['compiled_code']) -%}\n\n {% elif check_cols_config is iterable and (check_cols_config | length) > 0 %}\n {#-- query for proper casing/quoting, to support comparison below --#}\n {%- set select_check_cols_from_target -%}\n {#-- N.B. The whitespace below is necessary to avoid edge case issue with comments --#}\n {#-- See: https://github.com/dbt-labs/dbt-core/issues/6781 --#}\n select {{ check_cols_config | join(', ') }} from (\n {{ node['compiled_code'] }}\n ) subq\n {%- endset -%}\n {% set query_columns = get_columns_in_query(select_check_cols_from_target) %}\n\n {% else %}\n {% do exceptions.raise_compiler_error(\"Invalid value for 'check_cols': \" ~ check_cols_config) %}\n {% endif %}\n\n {%- set existing_cols = adapter.get_columns_in_relation(target_relation) | map(attribute = 'name') | list -%}\n {%- set ns = namespace() -%} {#-- handle for-loop scoping with a namespace --#}\n {%- set ns.column_added = false -%}\n\n {%- set intersection = [] -%}\n {%- for col in query_columns -%}\n {%- if col in existing_cols -%}\n {%- do intersection.append(adapter.quote(col)) -%}\n {%- else -%}\n {% set ns.column_added = true %}\n {%- endif -%}\n {%- endfor -%}\n {{ return((ns.column_added, intersection)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.get_columns_in_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "node", "type": null, "description": ""}, {"name": "target_exists", "type": null, "description": ""}, {"name": "check_cols_config", "type": null, "description": ""}], "created_at": 1789419969.7970452, "supported_languages": null}, "macro.dbt.snapshot_check_strategy": {"name": "snapshot_check_strategy", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/strategies.sql", "original_file_path": "macros/materializations/snapshots/strategies.sql", "unique_id": "macro.dbt.snapshot_check_strategy", "macro_sql": "{% macro snapshot_check_strategy(node, snapshotted_rel, current_rel, model_config, target_exists) %}\n {# The model_config parameter is no longer used, but is passed in anyway for compatibility. #}\n {% set check_cols_config = config.get('check_cols') %}\n {% set primary_key = config.get('unique_key') %}\n {% set hard_deletes = adapter.get_hard_deletes_behavior(config) %}\n {% set invalidate_hard_deletes = hard_deletes == 'invalidate' %}\n {% set updated_at = config.get('updated_at') or snapshot_get_time() %}\n\n {% set column_added = false %}\n\n {% set column_added, check_cols = snapshot_check_all_get_existing_columns(node, target_exists, check_cols_config) %}\n\n {%- set row_changed_expr -%}\n (\n {%- if column_added -%}\n {{ get_true_sql() }}\n {%- else -%}\n {%- for col in check_cols -%}\n {{ snapshotted_rel }}.{{ col }} != {{ current_rel }}.{{ col }}\n or\n (\n (({{ snapshotted_rel }}.{{ col }} is null) and not ({{ current_rel }}.{{ col }} is null))\n or\n ((not {{ snapshotted_rel }}.{{ col }} is null) and ({{ current_rel }}.{{ col }} is null))\n )\n {%- if not loop.last %} or {% endif -%}\n {%- endfor -%}\n {%- endif -%}\n )\n {%- endset %}\n\n {% set scd_args = api.Relation.scd_args(primary_key, updated_at) %}\n {% set scd_id_expr = snapshot_hash_arguments(scd_args) %}\n\n {% do return({\n \"unique_key\": primary_key,\n \"updated_at\": updated_at,\n \"row_changed\": row_changed_expr,\n \"scd_id\": scd_id_expr,\n \"invalidate_hard_deletes\": invalidate_hard_deletes,\n \"hard_deletes\": hard_deletes\n }) %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.snapshot_get_time", "macro.dbt.snapshot_check_all_get_existing_columns", "macro.dbt.get_true_sql", "macro.dbt.snapshot_hash_arguments"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "node", "type": null, "description": ""}, {"name": "snapshotted_rel", "type": null, "description": ""}, {"name": "current_rel", "type": null, "description": ""}, {"name": "model_config", "type": null, "description": ""}, {"name": "target_exists", "type": null, "description": ""}], "created_at": 1789419969.7995465, "supported_languages": null}, "macro.dbt.snapshot_merge_sql": {"name": "snapshot_merge_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/snapshot_merge.sql", "original_file_path": "macros/materializations/snapshots/snapshot_merge.sql", "unique_id": "macro.dbt.snapshot_merge_sql", "macro_sql": "{% macro snapshot_merge_sql(target, source, insert_cols) -%}\n {{ adapter.dispatch('snapshot_merge_sql', 'dbt')(target, source, insert_cols) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__snapshot_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "target", "type": null, "description": ""}, {"name": "source", "type": null, "description": ""}, {"name": "insert_cols", "type": null, "description": ""}], "created_at": 1789419969.8003557, "supported_languages": null}, "macro.dbt.default__snapshot_merge_sql": {"name": "default__snapshot_merge_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/snapshot_merge.sql", "original_file_path": "macros/materializations/snapshots/snapshot_merge.sql", "unique_id": "macro.dbt.default__snapshot_merge_sql", "macro_sql": "{% macro default__snapshot_merge_sql(target, source, insert_cols) -%}\n {%- set insert_cols_csv = insert_cols | join(', ') -%}\n\n {%- set columns = config.get(\"snapshot_table_column_names\") or get_snapshot_table_column_names() -%}\n\n merge into {{ target.render() }} as DBT_INTERNAL_DEST\n using {{ source }} as DBT_INTERNAL_SOURCE\n on DBT_INTERNAL_SOURCE.{{ columns.dbt_scd_id }} = DBT_INTERNAL_DEST.{{ columns.dbt_scd_id }}\n\n when matched\n {% if config.get(\"dbt_valid_to_current\") %}\n\t{% set source_unique_key = (\"DBT_INTERNAL_DEST.\" ~ columns.dbt_valid_to) | trim %}\n\t{% set target_unique_key = config.get('dbt_valid_to_current') | trim %}\n\tand ({{ equals(source_unique_key, target_unique_key) }} or {{ source_unique_key }} is null)\n\n {% else %}\n and DBT_INTERNAL_DEST.{{ columns.dbt_valid_to }} is null\n {% endif %}\n and DBT_INTERNAL_SOURCE.dbt_change_type in ('update', 'delete')\n then update\n set {{ columns.dbt_valid_to }} = DBT_INTERNAL_SOURCE.{{ columns.dbt_valid_to }}\n\n when not matched\n and DBT_INTERNAL_SOURCE.dbt_change_type = 'insert'\n then insert ({{ insert_cols_csv }})\n values ({{ insert_cols_csv }})\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_snapshot_table_column_names", "macro.dbt.equals"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "target", "type": null, "description": ""}, {"name": "source", "type": null, "description": ""}, {"name": "insert_cols", "type": null, "description": ""}], "created_at": 1789419969.8017497, "supported_languages": null}, "macro.dbt.create_columns": {"name": "create_columns", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "unique_id": "macro.dbt.create_columns", "macro_sql": "{% macro create_columns(relation, columns) %}\n {{ adapter.dispatch('create_columns', 'dbt')(relation, columns) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__create_columns"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "columns", "type": null, "description": ""}], "created_at": 1789419969.8055305, "supported_languages": null}, "macro.dbt.default__create_columns": {"name": "default__create_columns", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "unique_id": "macro.dbt.default__create_columns", "macro_sql": "{% macro default__create_columns(relation, columns) %}\n {% for column in columns %}\n {% call statement() %}\n alter table {{ relation.render() }} add column {{ adapter.quote(column.name) }} {{ column.expanded_data_type }};\n {% endcall %}\n {% endfor %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "columns", "type": null, "description": ""}], "created_at": 1789419969.8061185, "supported_languages": null}, "macro.dbt.post_snapshot": {"name": "post_snapshot", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "unique_id": "macro.dbt.post_snapshot", "macro_sql": "{% macro post_snapshot(staging_relation) %}\n {{ adapter.dispatch('post_snapshot', 'dbt')(staging_relation) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__post_snapshot"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "staging_relation", "type": null, "description": ""}], "created_at": 1789419969.8064182, "supported_languages": null}, "macro.dbt.default__post_snapshot": {"name": "default__post_snapshot", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "unique_id": "macro.dbt.default__post_snapshot", "macro_sql": "{% macro default__post_snapshot(staging_relation) %}\n {# no-op #}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "staging_relation", "type": null, "description": ""}], "created_at": 1789419969.806579, "supported_languages": null}, "macro.dbt.get_true_sql": {"name": "get_true_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "unique_id": "macro.dbt.get_true_sql", "macro_sql": "{% macro get_true_sql() %}\n {{ adapter.dispatch('get_true_sql', 'dbt')() }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_true_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789419969.8068397, "supported_languages": null}, "macro.dbt.default__get_true_sql": {"name": "default__get_true_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "unique_id": "macro.dbt.default__get_true_sql", "macro_sql": "{% macro default__get_true_sql() %}\n {{ return('TRUE') }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789419969.8070347, "supported_languages": null}, "macro.dbt.snapshot_staging_table": {"name": "snapshot_staging_table", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "unique_id": "macro.dbt.snapshot_staging_table", "macro_sql": "{% macro snapshot_staging_table(strategy, source_sql, target_relation) -%}\n {{ adapter.dispatch('snapshot_staging_table', 'dbt')(strategy, source_sql, target_relation) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__snapshot_staging_table"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "strategy", "type": null, "description": ""}, {"name": "source_sql", "type": null, "description": ""}, {"name": "target_relation", "type": null, "description": ""}], "created_at": 1789419969.807372, "supported_languages": null}, "macro.dbt.get_snapshot_table_column_names": {"name": "get_snapshot_table_column_names", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "unique_id": "macro.dbt.get_snapshot_table_column_names", "macro_sql": "{% macro get_snapshot_table_column_names() %}\n {{ return({'dbt_valid_to': 'dbt_valid_to', 'dbt_valid_from': 'dbt_valid_from', 'dbt_scd_id': 'dbt_scd_id', 'dbt_updated_at': 'dbt_updated_at', 'dbt_is_deleted': 'dbt_is_deleted'}) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789419969.807814, "supported_languages": null}, "macro.dbt.default__snapshot_staging_table": {"name": "default__snapshot_staging_table", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "unique_id": "macro.dbt.default__snapshot_staging_table", "macro_sql": "{% macro default__snapshot_staging_table(strategy, source_sql, target_relation) -%}\n {% set columns = config.get('snapshot_table_column_names') or get_snapshot_table_column_names() %}\n {% if strategy.hard_deletes == 'new_record' %}\n {% set new_scd_id = snapshot_hash_arguments([columns.dbt_scd_id, snapshot_get_time()]) %}\n {% endif %}\n with snapshot_query as (\n\n {{ source_sql }}\n\n ),\n\n snapshotted_data as (\n\n select *, {{ unique_key_fields(strategy.unique_key) }}\n from {{ target_relation }}\n where\n {% if config.get('dbt_valid_to_current') %}\n\t\t{% set source_unique_key = columns.dbt_valid_to | trim %}\n\t\t{% set target_unique_key = config.get('dbt_valid_to_current') | trim %}\n\n\t\t{# The exact equals semantics between NULL values depends on the current behavior flag set. Also, update records if the source field is null #}\n ( {{ equals(source_unique_key, target_unique_key) }} or {{ source_unique_key }} is null )\n {% else %}\n {{ columns.dbt_valid_to }} is null\n {% endif %}\n\n ),\n\n insertions_source_data as (\n\n select *, {{ unique_key_fields(strategy.unique_key) }},\n {{ strategy.updated_at }} as {{ columns.dbt_updated_at }},\n {{ strategy.updated_at }} as {{ columns.dbt_valid_from }},\n {{ get_dbt_valid_to_current(strategy, columns) }},\n {{ strategy.scd_id }} as {{ columns.dbt_scd_id }}\n\n from snapshot_query\n ),\n\n updates_source_data as (\n\n select *, {{ unique_key_fields(strategy.unique_key) }},\n {{ strategy.updated_at }} as {{ columns.dbt_updated_at }},\n {{ strategy.updated_at }} as {{ columns.dbt_valid_from }},\n {{ strategy.updated_at }} as {{ columns.dbt_valid_to }}\n\n from snapshot_query\n ),\n\n {%- if strategy.hard_deletes == 'invalidate' or strategy.hard_deletes == 'new_record' %}\n\n deletes_source_data as (\n\n select *, {{ unique_key_fields(strategy.unique_key) }}\n from snapshot_query\n ),\n {% endif %}\n\n insertions as (\n\n select\n 'insert' as dbt_change_type,\n source_data.*\n {%- if strategy.hard_deletes == 'new_record' -%}\n ,'False' as {{ columns.dbt_is_deleted }}\n {%- endif %}\n\n from insertions_source_data as source_data\n left outer join snapshotted_data\n on {{ unique_key_join_on(strategy.unique_key, \"snapshotted_data\", \"source_data\") }}\n where {{ unique_key_is_null(strategy.unique_key, \"snapshotted_data\") }}\n or ({{ unique_key_is_not_null(strategy.unique_key, \"snapshotted_data\") }} and (\n {{ strategy.row_changed }} {%- if strategy.hard_deletes == 'new_record' -%} or snapshotted_data.{{ columns.dbt_is_deleted }} = 'True' {% endif %}\n )\n\n )\n\n ),\n\n updates as (\n\n select\n 'update' as dbt_change_type,\n source_data.*,\n snapshotted_data.{{ columns.dbt_scd_id }}\n {%- if strategy.hard_deletes == 'new_record' -%}\n , snapshotted_data.{{ columns.dbt_is_deleted }}\n {%- endif %}\n\n from updates_source_data as source_data\n join snapshotted_data\n on {{ unique_key_join_on(strategy.unique_key, \"snapshotted_data\", \"source_data\") }}\n where (\n {{ strategy.row_changed }} {%- if strategy.hard_deletes == 'new_record' -%} or snapshotted_data.{{ columns.dbt_is_deleted }} = 'True' {% endif %}\n )\n )\n\n {%- if strategy.hard_deletes == 'invalidate' or strategy.hard_deletes == 'new_record' %}\n ,\n deletes as (\n\n select\n 'delete' as dbt_change_type,\n source_data.*,\n {{ snapshot_get_time() }} as {{ columns.dbt_valid_from }},\n {{ snapshot_get_time() }} as {{ columns.dbt_updated_at }},\n {{ snapshot_get_time() }} as {{ columns.dbt_valid_to }},\n snapshotted_data.{{ columns.dbt_scd_id }}\n {%- if strategy.hard_deletes == 'new_record' -%}\n , snapshotted_data.{{ columns.dbt_is_deleted }}\n {%- endif %}\n from snapshotted_data\n left join deletes_source_data as source_data\n on {{ unique_key_join_on(strategy.unique_key, \"snapshotted_data\", \"source_data\") }}\n where {{ unique_key_is_null(strategy.unique_key, \"source_data\") }}\n\n {%- if strategy.hard_deletes == 'new_record' %}\n and not (\n --avoid updating the record's valid_to if the latest entry is marked as deleted\n snapshotted_data.{{ columns.dbt_is_deleted }} = 'True'\n and\n {% if config.get('dbt_valid_to_current') -%}\n snapshotted_data.{{ columns.dbt_valid_to }} = {{ config.get('dbt_valid_to_current') }}\n {%- else -%}\n snapshotted_data.{{ columns.dbt_valid_to }} is null\n {%- endif %}\n )\n {%- endif %}\n )\n {%- endif %}\n\n {%- if strategy.hard_deletes == 'new_record' %}\n {% set snapshotted_cols = get_list_of_column_names(get_columns_in_relation(target_relation)) %}\n {% set source_col_names = get_columns_in_query(source_sql) %}\n ,\n deletion_records as (\n\n select\n 'insert' as dbt_change_type,\n {%- for col_name in source_col_names -%}\n {%- if col_name in snapshotted_cols -%}\n snapshotted_data.{{ adapter.quote(col_name) }},\n {%- else -%}\n source_data.{{ adapter.quote(col_name) }},\n {%- endif -%}\n {% endfor -%}\n {%- if strategy.unique_key | is_list -%}\n {%- for key in strategy.unique_key -%}\n snapshotted_data.{{ key }} as dbt_unique_key_{{ loop.index }},\n {% endfor -%}\n {%- else -%}\n snapshotted_data.dbt_unique_key as dbt_unique_key,\n {% endif -%}\n {{ snapshot_get_time() }} as {{ columns.dbt_valid_from }},\n {{ snapshot_get_time() }} as {{ columns.dbt_updated_at }},\n snapshotted_data.{{ columns.dbt_valid_to }} as {{ columns.dbt_valid_to }},\n {{ new_scd_id }} as {{ columns.dbt_scd_id }},\n 'True' as {{ columns.dbt_is_deleted }}\n from snapshotted_data\n left join deletes_source_data as source_data\n on {{ unique_key_join_on(strategy.unique_key, \"snapshotted_data\", \"source_data\") }}\n where {{ unique_key_is_null(strategy.unique_key, \"source_data\") }}\n and not (\n --avoid inserting a new record if the latest one is marked as deleted\n snapshotted_data.{{ columns.dbt_is_deleted }} = 'True'\n and\n {% if config.get('dbt_valid_to_current') -%}\n snapshotted_data.{{ columns.dbt_valid_to }} = {{ config.get('dbt_valid_to_current') }}\n {%- else -%}\n snapshotted_data.{{ columns.dbt_valid_to }} is null\n {%- endif %}\n )\n\n )\n {%- endif %}\n\n select * from insertions\n union all\n select * from updates\n {%- if strategy.hard_deletes == 'invalidate' or strategy.hard_deletes == 'new_record' %}\n union all\n select * from deletes\n {%- endif %}\n {%- if strategy.hard_deletes == 'new_record' %}\n union all\n select * from deletion_records\n {%- endif %}\n\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.get_snapshot_table_column_names", "macro.dbt.snapshot_hash_arguments", "macro.dbt.snapshot_get_time", "macro.dbt.unique_key_fields", "macro.dbt.equals", "macro.dbt.get_dbt_valid_to_current", "macro.dbt.unique_key_join_on", "macro.dbt.unique_key_is_null", "macro.dbt.unique_key_is_not_null", "macro.dbt.get_list_of_column_names", "macro.dbt.get_columns_in_relation", "macro.dbt.get_columns_in_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "strategy", "type": null, "description": ""}, {"name": "source_sql", "type": null, "description": ""}, {"name": "target_relation", "type": null, "description": ""}], "created_at": 1789419969.8150897, "supported_languages": null}, "macro.dbt.build_snapshot_table": {"name": "build_snapshot_table", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "unique_id": "macro.dbt.build_snapshot_table", "macro_sql": "{% macro build_snapshot_table(strategy, sql) -%}\n {{ adapter.dispatch('build_snapshot_table', 'dbt')(strategy, sql) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__build_snapshot_table"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "strategy", "type": null, "description": ""}, {"name": "sql", "type": null, "description": ""}], "created_at": 1789419969.8154979, "supported_languages": null}, "macro.dbt.default__build_snapshot_table": {"name": "default__build_snapshot_table", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "unique_id": "macro.dbt.default__build_snapshot_table", "macro_sql": "{% macro default__build_snapshot_table(strategy, sql) %}\n {% set columns = config.get('snapshot_table_column_names') or get_snapshot_table_column_names() %}\n\n select *,\n {{ strategy.scd_id }} as {{ columns.dbt_scd_id }},\n {{ strategy.updated_at }} as {{ columns.dbt_updated_at }},\n {{ strategy.updated_at }} as {{ columns.dbt_valid_from }},\n {{ get_dbt_valid_to_current(strategy, columns) }}\n {%- if strategy.hard_deletes == 'new_record' -%}\n , 'False' as {{ columns.dbt_is_deleted }}\n {% endif -%}\n from (\n {{ sql }}\n ) sbq\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_snapshot_table_column_names", "macro.dbt.get_dbt_valid_to_current"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "strategy", "type": null, "description": ""}, {"name": "sql", "type": null, "description": ""}], "created_at": 1789419969.8163733, "supported_languages": null}, "macro.dbt.build_snapshot_staging_table": {"name": "build_snapshot_staging_table", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "unique_id": "macro.dbt.build_snapshot_staging_table", "macro_sql": "{% macro build_snapshot_staging_table(strategy, sql, target_relation) %}\n {% set temp_relation = make_temp_relation(target_relation) %}\n\n {% set select = snapshot_staging_table(strategy, sql, target_relation) %}\n\n {% call statement('build_snapshot_staging_relation') %}\n {{ create_table_as(True, temp_relation, select) }}\n {% endcall %}\n\n {% do return(temp_relation) %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.make_temp_relation", "macro.dbt.snapshot_staging_table", "macro.dbt.statement", "macro.dbt.create_table_as"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "strategy", "type": null, "description": ""}, {"name": "sql", "type": null, "description": ""}, {"name": "target_relation", "type": null, "description": ""}], "created_at": 1789419969.8171027, "supported_languages": null}, "macro.dbt.get_updated_at_column_data_type": {"name": "get_updated_at_column_data_type", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "unique_id": "macro.dbt.get_updated_at_column_data_type", "macro_sql": "{% macro get_updated_at_column_data_type(snapshot_sql) %}\n {% set snapshot_sql_column_schema = get_column_schema_from_query(snapshot_sql) %}\n {% set dbt_updated_at_data_type = null %}\n {% set ns = namespace() -%} {#-- handle for-loop scoping with a namespace --#}\n {% set ns.dbt_updated_at_data_type = null -%}\n {% for column in snapshot_sql_column_schema %}\n {% if ((column.column == 'dbt_updated_at') or (column.column == 'DBT_UPDATED_AT')) %}\n {% set ns.dbt_updated_at_data_type = column.dtype %}\n {% endif %}\n {% endfor %}\n {{ return(ns.dbt_updated_at_data_type or none) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_column_schema_from_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "snapshot_sql", "type": null, "description": ""}], "created_at": 1789419969.8180866, "supported_languages": null}, "macro.dbt.check_time_data_types": {"name": "check_time_data_types", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "unique_id": "macro.dbt.check_time_data_types", "macro_sql": "{% macro check_time_data_types(sql) %}\n {% set dbt_updated_at_data_type = get_updated_at_column_data_type(sql) %}\n {% set snapshot_get_time_data_type = get_snapshot_get_time_data_type() %}\n {% if snapshot_get_time_data_type is not none and dbt_updated_at_data_type is not none and snapshot_get_time_data_type != dbt_updated_at_data_type %}\n {% if exceptions.warn_snapshot_timestamp_data_types %}\n {{ exceptions.warn_snapshot_timestamp_data_types(snapshot_get_time_data_type, dbt_updated_at_data_type) }}\n {% endif %}\n {% endif %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_updated_at_column_data_type", "macro.dbt.get_snapshot_get_time_data_type"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "sql", "type": null, "description": ""}], "created_at": 1789419969.8188083, "supported_languages": null}, "macro.dbt.get_dbt_valid_to_current": {"name": "get_dbt_valid_to_current", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "unique_id": "macro.dbt.get_dbt_valid_to_current", "macro_sql": "{% macro get_dbt_valid_to_current(strategy, columns) %}\n {% set dbt_valid_to_current = config.get('dbt_valid_to_current') or \"null\" %}\n coalesce(nullif({{ strategy.updated_at }}, {{ strategy.updated_at }}), {{dbt_valid_to_current}})\n as {{ columns.dbt_valid_to }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "strategy", "type": null, "description": ""}, {"name": "columns", "type": null, "description": ""}], "created_at": 1789419969.8192756, "supported_languages": null}, "macro.dbt.unique_key_fields": {"name": "unique_key_fields", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "unique_id": "macro.dbt.unique_key_fields", "macro_sql": "{% macro unique_key_fields(unique_key) %}\n {% if unique_key | is_list %}\n {% for key in unique_key %}\n {{ key }} as dbt_unique_key_{{ loop.index }}\n {%- if not loop.last %} , {%- endif %}\n {% endfor %}\n {% else %}\n {{ unique_key }} as dbt_unique_key\n {% endif %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "unique_key", "type": null, "description": ""}], "created_at": 1789419969.81985, "supported_languages": null}, "macro.dbt.unique_key_join_on": {"name": "unique_key_join_on", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "unique_id": "macro.dbt.unique_key_join_on", "macro_sql": "{% macro unique_key_join_on(unique_key, identifier, from_identifier) %}\n {% if unique_key | is_list %}\n {% for key in unique_key %}\n\t {% set source_unique_key = (identifier ~ \".dbt_unique_key_\" ~ loop.index) | trim %}\n\t {% set target_unique_key = (from_identifier ~ \".dbt_unique_key_\" ~ loop.index) | trim %}\n\t {{ equals(source_unique_key, target_unique_key) }}\n {%- if not loop.last %} and {%- endif %}\n {% endfor %}\n {% else %}\n {{ identifier }}.dbt_unique_key = {{ from_identifier }}.dbt_unique_key\n {% endif %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.equals"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "unique_key", "type": null, "description": ""}, {"name": "identifier", "type": null, "description": ""}, {"name": "from_identifier", "type": null, "description": ""}], "created_at": 1789419969.8208044, "supported_languages": null}, "macro.dbt.unique_key_is_null": {"name": "unique_key_is_null", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "unique_id": "macro.dbt.unique_key_is_null", "macro_sql": "{% macro unique_key_is_null(unique_key, identifier) %}\n {% if unique_key | is_list %}\n {{ identifier }}.dbt_unique_key_1 is null\n {% else %}\n {{ identifier }}.dbt_unique_key is null\n {% endif %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "unique_key", "type": null, "description": ""}, {"name": "identifier", "type": null, "description": ""}], "created_at": 1789419969.821157, "supported_languages": null}, "macro.dbt.unique_key_is_not_null": {"name": "unique_key_is_not_null", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "unique_id": "macro.dbt.unique_key_is_not_null", "macro_sql": "{% macro unique_key_is_not_null(unique_key, identifier) %}\n {% if unique_key | is_list %}\n {{ identifier }}.dbt_unique_key_1 is not null\n {% else %}\n {{ identifier }}.dbt_unique_key is not null\n {% endif %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "unique_key", "type": null, "description": ""}, {"name": "identifier", "type": null, "description": ""}], "created_at": 1789419969.8214967, "supported_languages": null}, "macro.dbt.get_aggregate_function_create_replace_signature": {"name": "get_aggregate_function_create_replace_signature", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/functions/aggregate.sql", "original_file_path": "macros/materializations/functions/aggregate.sql", "unique_id": "macro.dbt.get_aggregate_function_create_replace_signature", "macro_sql": "{% macro get_aggregate_function_create_replace_signature(target_relation) %}\n {{ return(adapter.dispatch('get_aggregate_function_create_replace_signature', 'dbt')(target_relation)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_aggregate_function_create_replace_signature"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "target_relation", "type": null, "description": ""}], "created_at": 1789419969.8227062, "supported_languages": null}, "macro.dbt.default__get_aggregate_function_create_replace_signature": {"name": "default__get_aggregate_function_create_replace_signature", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/functions/aggregate.sql", "original_file_path": "macros/materializations/functions/aggregate.sql", "unique_id": "macro.dbt.default__get_aggregate_function_create_replace_signature", "macro_sql": "{% macro default__get_aggregate_function_create_replace_signature(target_relation) %}\n CREATE OR REPLACE AGGREGATE FUNCTION {{ target_relation.render() }} ({{ get_formatted_aggregate_function_args()}})\n RETURNS {{ model.returns.data_type }}\n {{ get_function_language_specifier() }}\n {{ get_aggregate_function_volatility_specifier() }}\n {% if model.get('language') == 'python' %}\n {{ get_function_python_options() }}\n {% endif %}\n AS\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_formatted_aggregate_function_args", "macro.dbt.get_function_language_specifier", "macro.dbt.get_aggregate_function_volatility_specifier", "macro.dbt.get_function_python_options"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "target_relation", "type": null, "description": ""}], "created_at": 1789419969.8233306, "supported_languages": null}, "macro.dbt.get_formatted_aggregate_function_args": {"name": "get_formatted_aggregate_function_args", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/functions/aggregate.sql", "original_file_path": "macros/materializations/functions/aggregate.sql", "unique_id": "macro.dbt.get_formatted_aggregate_function_args", "macro_sql": "{% macro get_formatted_aggregate_function_args() %}\n {{ return(adapter.dispatch('get_formatted_aggregate_function_args', 'dbt')()) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_formatted_aggregate_function_args"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789419969.8236132, "supported_languages": null}, "macro.dbt.default__get_formatted_aggregate_function_args": {"name": "default__get_formatted_aggregate_function_args", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/functions/aggregate.sql", "original_file_path": "macros/materializations/functions/aggregate.sql", "unique_id": "macro.dbt.default__get_formatted_aggregate_function_args", "macro_sql": "{% macro default__get_formatted_aggregate_function_args() %}\n {# conveniently we can reuse the sql scalar function args #}\n {{ formatted_scalar_function_args_sql() }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.formatted_scalar_function_args_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789419969.8238158, "supported_languages": null}, "macro.dbt.get_function_language_specifier": {"name": "get_function_language_specifier", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/functions/aggregate.sql", "original_file_path": "macros/materializations/functions/aggregate.sql", "unique_id": "macro.dbt.get_function_language_specifier", "macro_sql": "{% macro get_function_language_specifier() %}\n {{ return(adapter.dispatch('get_function_language_specifier', 'dbt')()) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_function_language_specifier"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789419969.8240852, "supported_languages": null}, "macro.dbt.default__get_function_language_specifier": {"name": "default__get_function_language_specifier", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/functions/aggregate.sql", "original_file_path": "macros/materializations/functions/aggregate.sql", "unique_id": "macro.dbt.default__get_function_language_specifier", "macro_sql": "{% macro default__get_function_language_specifier() %}\n {% set language = model.get('language') %}\n {% if language == 'sql' %}\n {# generally you dont need to specify the language for sql functions #}\n {% elif language == 'python' %}\n LANGUAGE PYTHON\n {% elif language == 'javascript' %}\n LANGUAGE js\n {% else %}\n {{ 'LANGUAGE ' ~ language.upper() }}\n {% endif %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789419969.825275, "supported_languages": null}, "macro.dbt.get_aggregate_function_volatility_specifier": {"name": "get_aggregate_function_volatility_specifier", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/functions/aggregate.sql", "original_file_path": "macros/materializations/functions/aggregate.sql", "unique_id": "macro.dbt.get_aggregate_function_volatility_specifier", "macro_sql": "{% macro get_aggregate_function_volatility_specifier() %}\n {{ return(adapter.dispatch('get_aggregate_function_volatility_specifier', 'dbt')()) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_aggregate_function_volatility_specifier"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789419969.8255734, "supported_languages": null}, "macro.dbt.default__get_aggregate_function_volatility_specifier": {"name": "default__get_aggregate_function_volatility_specifier", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/functions/aggregate.sql", "original_file_path": "macros/materializations/functions/aggregate.sql", "unique_id": "macro.dbt.default__get_aggregate_function_volatility_specifier", "macro_sql": "{% macro default__get_aggregate_function_volatility_specifier() %}\n {{ scalar_function_volatility_sql() }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.scalar_function_volatility_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789419969.8257716, "supported_languages": null}, "macro.dbt.get_function_python_options": {"name": "get_function_python_options", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/functions/aggregate.sql", "original_file_path": "macros/materializations/functions/aggregate.sql", "unique_id": "macro.dbt.get_function_python_options", "macro_sql": "{% macro get_function_python_options() %}\n {{ return(adapter.dispatch('get_function_python_options', 'dbt')()) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_function_python_options"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789419969.8260462, "supported_languages": null}, "macro.dbt.default__get_function_python_options": {"name": "default__get_function_python_options", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/functions/aggregate.sql", "original_file_path": "macros/materializations/functions/aggregate.sql", "unique_id": "macro.dbt.default__get_function_python_options", "macro_sql": "{% macro default__get_function_python_options() %}\n RUNTIME_VERSION = '{{ model.config.get('runtime_version') }}'\n HANDLER = '{{ model.config.get('entry_point') }}'\n {% set packages = model.config.get('packages', []) %}\n {% if packages %}\n PACKAGES = ('{{ packages | join(\"','\") }}')\n {% endif %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789419969.8266501, "supported_languages": null}, "macro.dbt.scalar_function_sql": {"name": "scalar_function_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/functions/scalar.sql", "original_file_path": "macros/materializations/functions/scalar.sql", "unique_id": "macro.dbt.scalar_function_sql", "macro_sql": "{% macro scalar_function_sql(target_relation) %}\n {{ return(adapter.dispatch('scalar_function_sql', 'dbt')(target_relation)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__scalar_function_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "target_relation", "type": null, "description": ""}], "created_at": 1789419969.8281016, "supported_languages": null}, "macro.dbt.default__scalar_function_sql": {"name": "default__scalar_function_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/functions/scalar.sql", "original_file_path": "macros/materializations/functions/scalar.sql", "unique_id": "macro.dbt.default__scalar_function_sql", "macro_sql": "{% macro default__scalar_function_sql(target_relation) %}\n {{ scalar_function_create_replace_signature_sql(target_relation) }}\n {{ scalar_function_body_sql() }};\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.scalar_function_create_replace_signature_sql", "macro.dbt.scalar_function_body_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "target_relation", "type": null, "description": ""}], "created_at": 1789419969.8283668, "supported_languages": null}, "macro.dbt.scalar_function_create_replace_signature_sql": {"name": "scalar_function_create_replace_signature_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/functions/scalar.sql", "original_file_path": "macros/materializations/functions/scalar.sql", "unique_id": "macro.dbt.scalar_function_create_replace_signature_sql", "macro_sql": "{% macro scalar_function_create_replace_signature_sql(target_relation) %}\n {{ return(adapter.dispatch('scalar_function_create_replace_signature_sql', 'dbt')(target_relation)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__scalar_function_create_replace_signature_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "target_relation", "type": null, "description": ""}], "created_at": 1789419969.828672, "supported_languages": null}, "macro.dbt.default__scalar_function_create_replace_signature_sql": {"name": "default__scalar_function_create_replace_signature_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/functions/scalar.sql", "original_file_path": "macros/materializations/functions/scalar.sql", "unique_id": "macro.dbt.default__scalar_function_create_replace_signature_sql", "macro_sql": "{% macro default__scalar_function_create_replace_signature_sql(target_relation) %}\n CREATE OR REPLACE FUNCTION {{ target_relation.render() }} ({{ formatted_scalar_function_args_sql()}})\n RETURNS {{ model.returns.data_type }}\n {{ scalar_function_volatility_sql() }}\n AS\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.formatted_scalar_function_args_sql", "macro.dbt.scalar_function_volatility_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "target_relation", "type": null, "description": ""}], "created_at": 1789419969.8290424, "supported_languages": null}, "macro.dbt.formatted_scalar_function_args_sql": {"name": "formatted_scalar_function_args_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/functions/scalar.sql", "original_file_path": "macros/materializations/functions/scalar.sql", "unique_id": "macro.dbt.formatted_scalar_function_args_sql", "macro_sql": "{% macro formatted_scalar_function_args_sql() %}\n {{ return(adapter.dispatch('formatted_scalar_function_args_sql', 'dbt')()) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__formatted_scalar_function_args_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789419969.82932, "supported_languages": null}, "macro.dbt.formatted_scalar_function_args_javascript": {"name": "formatted_scalar_function_args_javascript", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/functions/scalar.sql", "original_file_path": "macros/materializations/functions/scalar.sql", "unique_id": "macro.dbt.formatted_scalar_function_args_javascript", "macro_sql": "{% macro formatted_scalar_function_args_javascript() %}\n {{ return(adapter.dispatch('formatted_scalar_function_args_javascript', 'dbt')()) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__formatted_scalar_function_args_javascript"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789419969.8295906, "supported_languages": null}, "macro.dbt.default__formatted_scalar_function_args_sql": {"name": "default__formatted_scalar_function_args_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/functions/scalar.sql", "original_file_path": "macros/materializations/functions/scalar.sql", "unique_id": "macro.dbt.default__formatted_scalar_function_args_sql", "macro_sql": "{% macro default__formatted_scalar_function_args_sql() %}\n {% set args = [] %}\n {% for arg in model.arguments -%}\n {%- do args.append(arg.name ~ ' ' ~ arg.data_type) -%}\n {%- endfor %}\n {{ args | join(', ') }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789419969.8301442, "supported_languages": null}, "macro.dbt.default__formatted_scalar_function_args_javascript": {"name": "default__formatted_scalar_function_args_javascript", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/functions/scalar.sql", "original_file_path": "macros/materializations/functions/scalar.sql", "unique_id": "macro.dbt.default__formatted_scalar_function_args_javascript", "macro_sql": "{% macro default__formatted_scalar_function_args_javascript() %}\n {% set msg = \"formatted_scalar_function_args_javascript not implemented for adapter \" ~ adapter.type() %}\n {% do exceptions.raise_compiler_error(msg) %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789419969.8304963, "supported_languages": null}, "macro.dbt.scalar_function_body_sql": {"name": "scalar_function_body_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/functions/scalar.sql", "original_file_path": "macros/materializations/functions/scalar.sql", "unique_id": "macro.dbt.scalar_function_body_sql", "macro_sql": "{% macro scalar_function_body_sql() %}\n {{ return(adapter.dispatch('scalar_function_body_sql', 'dbt')()) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__scalar_function_body_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789419969.830789, "supported_languages": null}, "macro.dbt.default__scalar_function_body_sql": {"name": "default__scalar_function_body_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/functions/scalar.sql", "original_file_path": "macros/materializations/functions/scalar.sql", "unique_id": "macro.dbt.default__scalar_function_body_sql", "macro_sql": "{% macro default__scalar_function_body_sql() %}\n $$\n {{ model.compiled_code }}\n $$ LANGUAGE SQL\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789419969.830968, "supported_languages": null}, "macro.dbt.scalar_function_volatility_sql": {"name": "scalar_function_volatility_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/functions/scalar.sql", "original_file_path": "macros/materializations/functions/scalar.sql", "unique_id": "macro.dbt.scalar_function_volatility_sql", "macro_sql": "{% macro scalar_function_volatility_sql() %}\n {{ return(adapter.dispatch('scalar_function_volatility_sql', 'dbt')()) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__scalar_function_volatility_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789419969.8312378, "supported_languages": null}, "macro.dbt.scalar_function_volatility_javascript": {"name": "scalar_function_volatility_javascript", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/functions/scalar.sql", "original_file_path": "macros/materializations/functions/scalar.sql", "unique_id": "macro.dbt.scalar_function_volatility_javascript", "macro_sql": "{% macro scalar_function_volatility_javascript() %}\n {{ return(adapter.dispatch('scalar_function_volatility_javascript', 'dbt')()) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__scalar_function_volatility_javascript"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789419969.8315058, "supported_languages": null}, "macro.dbt.default__scalar_function_volatility_javascript": {"name": "default__scalar_function_volatility_javascript", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/functions/scalar.sql", "original_file_path": "macros/materializations/functions/scalar.sql", "unique_id": "macro.dbt.default__scalar_function_volatility_javascript", "macro_sql": "{% macro default__scalar_function_volatility_javascript() %}\n {% set volatility = model.config.get('volatility') %}\n {% if volatility != none %}\n {% set msg = \"Volatility is not supported by \" ~ adapter.type() ~ \" in javascript UDF and will be ignored\" %}\n {% do exceptions.warn(msg) %}\n {% endif %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789419969.912686, "supported_languages": null}, "macro.dbt.default__scalar_function_volatility_sql": {"name": "default__scalar_function_volatility_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/functions/scalar.sql", "original_file_path": "macros/materializations/functions/scalar.sql", "unique_id": "macro.dbt.default__scalar_function_volatility_sql", "macro_sql": "{% macro default__scalar_function_volatility_sql() %}\n {% set volatility = model.config.get('volatility') %}\n {% if volatility == 'deterministic' %}\n IMMUTABLE\n {% elif volatility == 'stable' %}\n STABLE\n {% elif volatility == 'non-deterministic' %}\n VOLATILE\n {% elif volatility != none %}\n {# This shouldn't happen unless a new volatility is invented #}\n {% do unsupported_volatility_warning(volatility) %}\n {% endif %}\n {# If no volatility is set, don't add anything and let the data warehouse default it #}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.unsupported_volatility_warning"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789419969.9135878, "supported_languages": null}, "macro.dbt.unsupported_volatility_warning": {"name": "unsupported_volatility_warning", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/functions/scalar.sql", "original_file_path": "macros/materializations/functions/scalar.sql", "unique_id": "macro.dbt.unsupported_volatility_warning", "macro_sql": "{% macro unsupported_volatility_warning(volatility) %}\n {{ return(adapter.dispatch('unsupported_volatility_warning', 'dbt')(volatility)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__unsupported_volatility_warning"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "volatility", "type": null, "description": ""}], "created_at": 1789419969.9139822, "supported_languages": null}, "macro.dbt.default__unsupported_volatility_warning": {"name": "default__unsupported_volatility_warning", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/functions/scalar.sql", "original_file_path": "macros/materializations/functions/scalar.sql", "unique_id": "macro.dbt.default__unsupported_volatility_warning", "macro_sql": "{% macro default__unsupported_volatility_warning(volatility) %}\n {% set msg = \"Found `\" ~ volatility ~ \"` volatility specified on function `\" ~ model.name ~ \"`. This volatility is not supported by \" ~ adapter.type() ~ \", and will be ignored\" %}\n {% do exceptions.warn(msg) %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "volatility", "type": null, "description": ""}], "created_at": 1789419969.9144661, "supported_languages": null}, "macro.dbt.materialization_function_default": {"name": "materialization_function_default", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/functions/function.sql", "original_file_path": "macros/materializations/functions/function.sql", "unique_id": "macro.dbt.materialization_function_default", "macro_sql": "{% materialization function, default, supported_languages=['sql', 'python', 'javascript'] %}\n {% set existing_relation = load_cached_relation(this) %}\n {% set target_relation = this.incorporate(type=this.Function) %}\n\n {{ run_hooks(pre_hooks) }}\n\n {% set function_config = this.get_function_config(model) %}\n {% set macro_name = this.get_function_macro_name(function_config) %}\n\n {# Doing this aliasing of adapter.dispatch is a hacky way to disable the static analysis of actually calling adapter.dispatch #}\n {# This is necessary because the static analysis breaks being able to dynamically pass a macro_name #}\n {% set _dispatch = adapter.dispatch %}\n\n {% set build_sql = _dispatch(macro_name, 'dbt')(target_relation) %}\n {{ function_execute_build_sql(build_sql, existing_relation, target_relation) }}\n {{ run_hooks(post_hooks) }}\n\n {{ return({'relations': [target_relation]}) }}\n\n{% endmaterialization %}", "depends_on": {"macros": ["macro.dbt.load_cached_relation", "macro.dbt.run_hooks", "macro.dbt.function_execute_build_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "supported_languages", "type": null, "description": ""}], "created_at": 1789419969.916229, "supported_languages": ["sql", "python", "javascript"]}, "macro.dbt.function_execute_build_sql": {"name": "function_execute_build_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/functions/helpers.sql", "original_file_path": "macros/materializations/functions/helpers.sql", "unique_id": "macro.dbt.function_execute_build_sql", "macro_sql": "{% macro function_execute_build_sql(build_sql, existing_relation, target_relation) %}\n {{ return(adapter.dispatch('function_execute_build_sql', 'dbt')(build_sql, existing_relation, target_relation)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__function_execute_build_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "build_sql", "type": null, "description": ""}, {"name": "existing_relation", "type": null, "description": ""}, {"name": "target_relation", "type": null, "description": ""}], "created_at": 1789419969.916977, "supported_languages": null}, "macro.dbt.default__function_execute_build_sql": {"name": "default__function_execute_build_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/functions/helpers.sql", "original_file_path": "macros/materializations/functions/helpers.sql", "unique_id": "macro.dbt.default__function_execute_build_sql", "macro_sql": "{% macro default__function_execute_build_sql(build_sql, existing_relation, target_relation) %}\n\n {% set grant_config = config.get('grants') %}\n\n {% call statement(name=\"main\") %}\n {{ build_sql }}\n {% endcall %}\n\n {% set should_revoke = should_revoke(existing_relation, full_refresh_mode=True) %}\n {% do apply_grants(target_relation, grant_config, should_revoke=should_revoke) %}\n\n {% do persist_docs(target_relation, model) %}\n\n {{ adapter.commit() }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement", "macro.dbt.should_revoke", "macro.dbt.apply_grants", "macro.dbt.persist_docs"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "build_sql", "type": null, "description": ""}, {"name": "existing_relation", "type": null, "description": ""}, {"name": "target_relation", "type": null, "description": ""}], "created_at": 1789419969.917903, "supported_languages": null}, "macro.dbt.materialization_table_default": {"name": "materialization_table_default", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/table.sql", "original_file_path": "macros/materializations/models/table.sql", "unique_id": "macro.dbt.materialization_table_default", "macro_sql": "{% materialization table, default %}\n\n {%- set existing_relation = load_cached_relation(this) -%}\n {%- set target_relation = this.incorporate(type='table') %}\n {%- set intermediate_relation = make_intermediate_relation(target_relation) -%}\n -- the intermediate_relation should not already exist in the database; get_relation\n -- will return None in that case. Otherwise, we get a relation that we can drop\n -- later, before we try to use this name for the current operation\n {%- set preexisting_intermediate_relation = load_cached_relation(intermediate_relation) -%}\n /*\n See ../view/view.sql for more information about this relation.\n */\n {%- set backup_relation_type = 'table' if existing_relation is none else existing_relation.type -%}\n {%- set backup_relation = make_backup_relation(target_relation, backup_relation_type) -%}\n -- as above, the backup_relation should not already exist\n {%- set preexisting_backup_relation = load_cached_relation(backup_relation) -%}\n -- grab current tables grants config for comparision later on\n {% set grant_config = config.get('grants') %}\n\n -- drop the temp relations if they exist already in the database\n {{ drop_relation_if_exists(preexisting_intermediate_relation) }}\n {{ drop_relation_if_exists(preexisting_backup_relation) }}\n\n {{ run_hooks(pre_hooks, inside_transaction=False) }}\n\n -- `BEGIN` happens here:\n {{ run_hooks(pre_hooks, inside_transaction=True) }}\n\n -- build model\n {% call statement('main') -%}\n {{ get_create_table_as_sql(False, intermediate_relation, sql) }}\n {%- endcall %}\n\n {% do create_indexes(intermediate_relation) %}\n\n -- cleanup\n {% if existing_relation is not none %}\n /* Do the equivalent of rename_if_exists. 'existing_relation' could have been dropped\n since the variable was first set. */\n {% set existing_relation = load_cached_relation(existing_relation) %}\n {% if existing_relation is not none %}\n {{ adapter.rename_relation(existing_relation, backup_relation) }}\n {% endif %}\n {% endif %}\n\n {{ adapter.rename_relation(intermediate_relation, target_relation) }}\n\n {{ run_hooks(post_hooks, inside_transaction=True) }}\n\n {% set should_revoke = should_revoke(existing_relation, full_refresh_mode=True) %}\n {% do apply_grants(target_relation, grant_config, should_revoke=should_revoke) %}\n\n {% do persist_docs(target_relation, model) %}\n\n -- `COMMIT` happens here\n {{ adapter.commit() }}\n\n -- finally, drop the existing/backup relation after the commit\n {{ drop_relation_if_exists(backup_relation) }}\n\n {{ run_hooks(post_hooks, inside_transaction=False) }}\n\n {{ return({'relations': [target_relation]}) }}\n{% endmaterialization %}", "depends_on": {"macros": ["macro.dbt.load_cached_relation", "macro.dbt.make_intermediate_relation", "macro.dbt.make_backup_relation", "macro.dbt.drop_relation_if_exists", "macro.dbt.run_hooks", "macro.dbt.statement", "macro.dbt.get_create_table_as_sql", "macro.dbt.create_indexes", "macro.dbt.should_revoke", "macro.dbt.apply_grants", "macro.dbt.persist_docs"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "supported_languages", "type": null, "description": ""}], "created_at": 1789419969.9217157, "supported_languages": ["sql"]}, "macro.dbt.materialization_materialized_view_default": {"name": "materialization_materialized_view_default", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/materialized_view.sql", "original_file_path": "macros/materializations/models/materialized_view.sql", "unique_id": "macro.dbt.materialization_materialized_view_default", "macro_sql": "{% materialization materialized_view, default %}\n {% set existing_relation = load_cached_relation(this) %}\n {% set target_relation = this.incorporate(type=this.MaterializedView) %}\n {% set intermediate_relation = make_intermediate_relation(target_relation) %}\n {% set backup_relation_type = target_relation.MaterializedView if existing_relation is none else existing_relation.type %}\n {% set backup_relation = make_backup_relation(target_relation, backup_relation_type) %}\n\n {{ materialized_view_setup(backup_relation, intermediate_relation, pre_hooks) }}\n\n {% set build_sql = materialized_view_get_build_sql(existing_relation, target_relation, backup_relation, intermediate_relation) %}\n\n {% if build_sql == '' %}\n {{ materialized_view_execute_no_op(target_relation) }}\n {% else %}\n {{ materialized_view_execute_build_sql(build_sql, existing_relation, target_relation, post_hooks) }}\n {% endif %}\n\n {{ materialized_view_teardown(backup_relation, intermediate_relation, post_hooks) }}\n\n {{ return({'relations': [target_relation]}) }}\n\n{% endmaterialization %}", "depends_on": {"macros": ["macro.dbt.load_cached_relation", "macro.dbt.make_intermediate_relation", "macro.dbt.make_backup_relation", "macro.dbt.materialized_view_setup", "macro.dbt.materialized_view_get_build_sql", "macro.dbt.materialized_view_execute_no_op", "macro.dbt.materialized_view_execute_build_sql", "macro.dbt.materialized_view_teardown"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "supported_languages", "type": null, "description": ""}], "created_at": 1789419969.9244769, "supported_languages": ["sql"]}, "macro.dbt.materialized_view_setup": {"name": "materialized_view_setup", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/materialized_view.sql", "original_file_path": "macros/materializations/models/materialized_view.sql", "unique_id": "macro.dbt.materialized_view_setup", "macro_sql": "{% macro materialized_view_setup(backup_relation, intermediate_relation, pre_hooks) %}\n\n -- backup_relation and intermediate_relation should not already exist in the database\n -- it's possible these exist because of a previous run that exited unexpectedly\n {% set preexisting_backup_relation = load_cached_relation(backup_relation) %}\n {% set preexisting_intermediate_relation = load_cached_relation(intermediate_relation) %}\n\n -- drop the temp relations if they exist already in the database\n {{ drop_relation_if_exists(preexisting_backup_relation) }}\n {{ drop_relation_if_exists(preexisting_intermediate_relation) }}\n\n {{ run_hooks(pre_hooks, inside_transaction=False) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.load_cached_relation", "macro.dbt.drop_relation_if_exists", "macro.dbt.run_hooks"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "backup_relation", "type": null, "description": ""}, {"name": "intermediate_relation", "type": null, "description": ""}, {"name": "pre_hooks", "type": null, "description": ""}], "created_at": 1789419969.925181, "supported_languages": null}, "macro.dbt.materialized_view_teardown": {"name": "materialized_view_teardown", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/materialized_view.sql", "original_file_path": "macros/materializations/models/materialized_view.sql", "unique_id": "macro.dbt.materialized_view_teardown", "macro_sql": "{% macro materialized_view_teardown(backup_relation, intermediate_relation, post_hooks) %}\n\n -- drop the temp relations if they exist to leave the database clean for the next run\n {{ drop_relation_if_exists(backup_relation) }}\n {{ drop_relation_if_exists(intermediate_relation) }}\n\n {{ run_hooks(post_hooks, inside_transaction=False) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.drop_relation_if_exists", "macro.dbt.run_hooks"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "backup_relation", "type": null, "description": ""}, {"name": "intermediate_relation", "type": null, "description": ""}, {"name": "post_hooks", "type": null, "description": ""}], "created_at": 1789419969.9256136, "supported_languages": null}, "macro.dbt.materialized_view_get_build_sql": {"name": "materialized_view_get_build_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/materialized_view.sql", "original_file_path": "macros/materializations/models/materialized_view.sql", "unique_id": "macro.dbt.materialized_view_get_build_sql", "macro_sql": "{% macro materialized_view_get_build_sql(existing_relation, target_relation, backup_relation, intermediate_relation) %}\n\n {% set full_refresh_mode = should_full_refresh() %}\n\n -- determine the scenario we're in: create, full_refresh, alter, refresh data\n {% if existing_relation is none %}\n {% set build_sql = get_create_materialized_view_as_sql(target_relation, sql) %}\n {% elif full_refresh_mode or not existing_relation.is_materialized_view %}\n {% set build_sql = get_replace_sql(existing_relation, target_relation, sql) %}\n {% else %}\n\n -- get config options\n {% set on_configuration_change = config.get('on_configuration_change') %}\n {% set configuration_changes = get_materialized_view_configuration_changes(existing_relation, config) %}\n\n {% if configuration_changes is none %}\n {% set build_sql = refresh_materialized_view(target_relation) %}\n\n {% elif on_configuration_change == 'apply' %}\n {% set build_sql = get_alter_materialized_view_as_sql(target_relation, configuration_changes, sql, existing_relation, backup_relation, intermediate_relation) %}\n {% elif on_configuration_change == 'continue' %}\n {% set build_sql = '' %}\n {{ exceptions.warn(\"Configuration changes were identified and `on_configuration_change` was set to `continue` for `\" ~ target_relation.render() ~ \"`\") }}\n {% elif on_configuration_change == 'fail' %}\n {{ exceptions.raise_fail_fast_error(\"Configuration changes were identified and `on_configuration_change` was set to `fail` for `\" ~ target_relation.render() ~ \"`\") }}\n\n {% else %}\n -- this only happens if the user provides a value other than `apply`, 'skip', 'fail'\n {{ exceptions.raise_compiler_error(\"Unexpected configuration scenario\") }}\n\n {% endif %}\n\n {% endif %}\n\n {% do return(build_sql) %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.should_full_refresh", "macro.dbt.get_create_materialized_view_as_sql", "macro.dbt.get_replace_sql", "macro.dbt.get_materialized_view_configuration_changes", "macro.dbt.refresh_materialized_view", "macro.dbt.get_alter_materialized_view_as_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "existing_relation", "type": null, "description": ""}, {"name": "target_relation", "type": null, "description": ""}, {"name": "backup_relation", "type": null, "description": ""}, {"name": "intermediate_relation", "type": null, "description": ""}], "created_at": 1789419969.9277997, "supported_languages": null}, "macro.dbt.materialized_view_execute_no_op": {"name": "materialized_view_execute_no_op", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/materialized_view.sql", "original_file_path": "macros/materializations/models/materialized_view.sql", "unique_id": "macro.dbt.materialized_view_execute_no_op", "macro_sql": "{% macro materialized_view_execute_no_op(target_relation) %}\n {% do store_raw_result(\n name=\"main\",\n message=\"skip \" ~ target_relation,\n code=\"skip\",\n rows_affected=\"-1\"\n ) %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "target_relation", "type": null, "description": ""}], "created_at": 1789419969.9282238, "supported_languages": null}, "macro.dbt.materialized_view_execute_build_sql": {"name": "materialized_view_execute_build_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/materialized_view.sql", "original_file_path": "macros/materializations/models/materialized_view.sql", "unique_id": "macro.dbt.materialized_view_execute_build_sql", "macro_sql": "{% macro materialized_view_execute_build_sql(build_sql, existing_relation, target_relation, post_hooks) %}\n\n -- `BEGIN` happens here:\n {{ run_hooks(pre_hooks, inside_transaction=True) }}\n\n {% set grant_config = config.get('grants') %}\n\n {% call statement(name=\"main\") %}\n {{ build_sql }}\n {% endcall %}\n\n {% set should_revoke = should_revoke(existing_relation, full_refresh_mode=True) %}\n {% do apply_grants(target_relation, grant_config, should_revoke=should_revoke) %}\n\n {% do persist_docs(target_relation, model) %}\n\n {{ run_hooks(post_hooks, inside_transaction=True) }}\n\n {{ adapter.commit() }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.run_hooks", "macro.dbt.statement", "macro.dbt.should_revoke", "macro.dbt.apply_grants", "macro.dbt.persist_docs"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "build_sql", "type": null, "description": ""}, {"name": "existing_relation", "type": null, "description": ""}, {"name": "target_relation", "type": null, "description": ""}, {"name": "post_hooks", "type": null, "description": ""}], "created_at": 1789419969.929306, "supported_languages": null}, "macro.dbt.materialization_view_default": {"name": "materialization_view_default", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/view.sql", "original_file_path": "macros/materializations/models/view.sql", "unique_id": "macro.dbt.materialization_view_default", "macro_sql": "{%- materialization view, default -%}\n\n {%- set existing_relation = load_cached_relation(this) -%}\n {%- set target_relation = this.incorporate(type='view') -%}\n {%- set intermediate_relation = make_intermediate_relation(target_relation) -%}\n\n -- the intermediate_relation should not already exist in the database; get_relation\n -- will return None in that case. Otherwise, we get a relation that we can drop\n -- later, before we try to use this name for the current operation\n {%- set preexisting_intermediate_relation = load_cached_relation(intermediate_relation) -%}\n /*\n This relation (probably) doesn't exist yet. If it does exist, it's a leftover from\n a previous run, and we're going to try to drop it immediately. At the end of this\n materialization, we're going to rename the \"existing_relation\" to this identifier,\n and then we're going to drop it. In order to make sure we run the correct one of:\n - drop view ...\n - drop table ...\n\n We need to set the type of this relation to be the type of the existing_relation, if it exists,\n or else \"view\" as a sane default if it does not. Note that if the existing_relation does not\n exist, then there is nothing to move out of the way and subsequentally drop. In that case,\n this relation will be effectively unused.\n */\n {%- set backup_relation_type = 'view' if existing_relation is none else existing_relation.type -%}\n {%- set backup_relation = make_backup_relation(target_relation, backup_relation_type) -%}\n -- as above, the backup_relation should not already exist\n {%- set preexisting_backup_relation = load_cached_relation(backup_relation) -%}\n -- grab current tables grants config for comparision later on\n {% set grant_config = config.get('grants') %}\n\n {{ run_hooks(pre_hooks, inside_transaction=False) }}\n\n -- drop the temp relations if they exist already in the database\n {{ drop_relation_if_exists(preexisting_intermediate_relation) }}\n {{ drop_relation_if_exists(preexisting_backup_relation) }}\n\n -- `BEGIN` happens here:\n {{ run_hooks(pre_hooks, inside_transaction=True) }}\n\n -- build model\n {% call statement('main') -%}\n {{ get_create_view_as_sql(intermediate_relation, sql) }}\n {%- endcall %}\n\n -- cleanup\n -- move the existing view out of the way\n {% if existing_relation is not none %}\n /* Do the equivalent of rename_if_exists. 'existing_relation' could have been dropped\n since the variable was first set. */\n {% set existing_relation = load_cached_relation(existing_relation) %}\n {% if existing_relation is not none %}\n {{ adapter.rename_relation(existing_relation, backup_relation) }}\n {% endif %}\n {% endif %}\n {{ adapter.rename_relation(intermediate_relation, target_relation) }}\n\n {% set should_revoke = should_revoke(existing_relation, full_refresh_mode=True) %}\n {% do apply_grants(target_relation, grant_config, should_revoke=should_revoke) %}\n\n {% do persist_docs(target_relation, model) %}\n\n {{ run_hooks(post_hooks, inside_transaction=True) }}\n\n {{ adapter.commit() }}\n\n {{ drop_relation_if_exists(backup_relation) }}\n\n {{ run_hooks(post_hooks, inside_transaction=False) }}\n\n {{ return({'relations': [target_relation]}) }}\n\n{%- endmaterialization -%}", "depends_on": {"macros": ["macro.dbt.load_cached_relation", "macro.dbt.make_intermediate_relation", "macro.dbt.make_backup_relation", "macro.dbt.run_hooks", "macro.dbt.drop_relation_if_exists", "macro.dbt.statement", "macro.dbt.get_create_view_as_sql", "macro.dbt.should_revoke", "macro.dbt.apply_grants", "macro.dbt.persist_docs"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "supported_languages", "type": null, "description": ""}], "created_at": 1789419969.9330938, "supported_languages": ["sql"]}, "macro.dbt.materialization_clone_default": {"name": "materialization_clone_default", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/clone/clone.sql", "original_file_path": "macros/materializations/models/clone/clone.sql", "unique_id": "macro.dbt.materialization_clone_default", "macro_sql": "{%- materialization clone, default -%}\n\n {%- set relations = {'relations': []} -%}\n\n {%- if not defer_relation -%}\n -- nothing to do\n {{ log(\"No relation found in state manifest for \" ~ model.unique_id, info=True) }}\n {{ return(relations) }}\n {%- endif -%}\n\n {%- set existing_relation = load_cached_relation(this) -%}\n\n {%- if existing_relation and not flags.FULL_REFRESH -%}\n -- noop!\n {{ log(\"Relation \" ~ existing_relation ~ \" already exists\", info=True) }}\n {{ return(relations) }}\n {%- endif -%}\n\n {%- set other_existing_relation = load_cached_relation(defer_relation) -%}\n\n -- If this is a database that can do zero-copy cloning of tables, and the other relation is a table, then this will be a table\n -- Otherwise, this will be a view\n\n {% set can_clone_table = can_clone_table() %}\n {%- set grant_config = config.get('grants') -%}\n\n {%- if other_existing_relation and other_existing_relation.type == 'table' and can_clone_table -%}\n\n {%- set target_relation = this.incorporate(type='table') -%}\n {% if existing_relation is not none and not existing_relation.is_table %}\n {{ log(\"Dropping relation \" ~ existing_relation.render() ~ \" because it is of type \" ~ existing_relation.type) }}\n {{ drop_relation_if_exists(existing_relation) }}\n {% endif %}\n\n -- as a general rule, data platforms that can clone tables can also do atomic 'create or replace'\n {% if target_relation.database == defer_relation.database and\n target_relation.schema == defer_relation.schema and\n target_relation.identifier == defer_relation.identifier %}\n {{ log(\"Target relation and defer relation are the same, skipping clone for relation: \" ~ target_relation.render()) }}\n {% else %}\n {% call statement('main') %}\n {{ create_or_replace_clone(target_relation, defer_relation) }}\n {% endcall %}\n {% endif %}\n {% set should_revoke = should_revoke(existing_relation, full_refresh_mode=True) %}\n {% do apply_grants(target_relation, grant_config, should_revoke=should_revoke) %}\n {% do persist_docs(target_relation, model) %}\n\n {{ return({'relations': [target_relation]}) }}\n\n {%- else -%}\n\n {%- set target_relation = this.incorporate(type='view') -%}\n\n -- reuse the view materialization\n -- TODO: support actual dispatch for materialization macros\n -- Tracking ticket: https://github.com/dbt-labs/dbt-core/issues/7799\n {% set search_name = \"materialization_view_\" ~ adapter.type() %}\n {% if not search_name in context %}\n {% set search_name = \"materialization_view_default\" %}\n {% endif %}\n {% set materialization_macro = context[search_name] %}\n {% set relations = materialization_macro() %}\n {{ return(relations) }}\n\n {%- endif -%}\n\n{%- endmaterialization -%}", "depends_on": {"macros": ["macro.dbt.load_cached_relation", "macro.dbt.can_clone_table", "macro.dbt.drop_relation_if_exists", "macro.dbt.statement", "macro.dbt.create_or_replace_clone", "macro.dbt.should_revoke", "macro.dbt.apply_grants", "macro.dbt.persist_docs"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "supported_languages", "type": null, "description": ""}], "created_at": 1789419969.9377556, "supported_languages": ["sql"]}, "macro.dbt.can_clone_table": {"name": "can_clone_table", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/clone/can_clone_table.sql", "original_file_path": "macros/materializations/models/clone/can_clone_table.sql", "unique_id": "macro.dbt.can_clone_table", "macro_sql": "{% macro can_clone_table() %}\n {{ return(adapter.dispatch('can_clone_table', 'dbt')()) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__can_clone_table"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789419969.9382653, "supported_languages": null}, "macro.dbt.default__can_clone_table": {"name": "default__can_clone_table", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/clone/can_clone_table.sql", "original_file_path": "macros/materializations/models/clone/can_clone_table.sql", "unique_id": "macro.dbt.default__can_clone_table", "macro_sql": "{% macro default__can_clone_table() %}\n {{ return(False) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789419969.938477, "supported_languages": null}, "macro.dbt.create_or_replace_clone": {"name": "create_or_replace_clone", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/clone/create_or_replace_clone.sql", "original_file_path": "macros/materializations/models/clone/create_or_replace_clone.sql", "unique_id": "macro.dbt.create_or_replace_clone", "macro_sql": "{% macro create_or_replace_clone(this_relation, defer_relation) %}\n {{ return(adapter.dispatch('create_or_replace_clone', 'dbt')(this_relation, defer_relation)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__create_or_replace_clone"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "this_relation", "type": null, "description": ""}, {"name": "defer_relation", "type": null, "description": ""}], "created_at": 1789419969.9390147, "supported_languages": null}, "macro.dbt.default__create_or_replace_clone": {"name": "default__create_or_replace_clone", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/clone/create_or_replace_clone.sql", "original_file_path": "macros/materializations/models/clone/create_or_replace_clone.sql", "unique_id": "macro.dbt.default__create_or_replace_clone", "macro_sql": "{% macro default__create_or_replace_clone(this_relation, defer_relation) %}\n create or replace table {{ this_relation.render() }} clone {{ defer_relation.render() }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "this_relation", "type": null, "description": ""}, {"name": "defer_relation", "type": null, "description": ""}], "created_at": 1789419969.9393194, "supported_languages": null}, "macro.dbt.materialization_incremental_default": {"name": "materialization_incremental_default", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/incremental.sql", "original_file_path": "macros/materializations/models/incremental/incremental.sql", "unique_id": "macro.dbt.materialization_incremental_default", "macro_sql": "{% materialization incremental, default -%}\n\n -- relations\n {%- set existing_relation = load_cached_relation(this) -%}\n {%- set target_relation = this.incorporate(type='table') -%}\n {%- set temp_relation = make_temp_relation(target_relation)-%}\n {%- set intermediate_relation = make_intermediate_relation(target_relation)-%}\n {%- set backup_relation_type = 'table' if existing_relation is none else existing_relation.type -%}\n {%- set backup_relation = make_backup_relation(target_relation, backup_relation_type) -%}\n\n -- configs\n {%- set unique_key = config.get('unique_key') -%}\n {%- set full_refresh_mode = (should_full_refresh() or existing_relation.is_view) -%}\n {%- set on_schema_change = incremental_validate_on_schema_change(config.get('on_schema_change'), default='ignore') -%}\n\n -- the temp_ and backup_ relations should not already exist in the database; get_relation\n -- will return None in that case. Otherwise, we get a relation that we can drop\n -- later, before we try to use this name for the current operation. This has to happen before\n -- BEGIN, in a separate transaction\n {%- set preexisting_intermediate_relation = load_cached_relation(intermediate_relation)-%}\n {%- set preexisting_backup_relation = load_cached_relation(backup_relation) -%}\n -- grab current tables grants config for comparision later on\n {% set grant_config = config.get('grants') %}\n {{ drop_relation_if_exists(preexisting_intermediate_relation) }}\n {{ drop_relation_if_exists(preexisting_backup_relation) }}\n\n {{ run_hooks(pre_hooks, inside_transaction=False) }}\n\n -- `BEGIN` happens here:\n {{ run_hooks(pre_hooks, inside_transaction=True) }}\n\n {% set to_drop = [] %}\n\n {% set incremental_strategy = config.get('incremental_strategy') or 'default' %}\n {% set strategy_sql_macro_func = adapter.get_incremental_strategy_macro(context, incremental_strategy) %}\n\n {% if existing_relation is none %}\n {% set build_sql = get_create_table_as_sql(False, target_relation, sql) %}\n {% set relation_for_indexes = target_relation %}\n {% elif full_refresh_mode %}\n {% set build_sql = get_create_table_as_sql(False, intermediate_relation, sql) %}\n {% set relation_for_indexes = intermediate_relation %}\n {% set need_swap = true %}\n {% else %}\n {% do run_query(get_create_table_as_sql(True, temp_relation, sql)) %}\n {% set relation_for_indexes = temp_relation %}\n {% set contract_config = config.get('contract') %}\n {% if not contract_config or not contract_config.enforced %}\n {% do adapter.expand_target_column_types(\n from_relation=temp_relation,\n to_relation=target_relation) %}\n {% endif %}\n {#-- Process schema changes. Returns dict of changes if successful. Use source columns for upserting/merging --#}\n {% set dest_columns = process_schema_changes(on_schema_change, temp_relation, existing_relation) %}\n {% if not dest_columns %}\n {% set dest_columns = adapter.get_columns_in_relation(existing_relation) %}\n {% endif %}\n\n {#-- Get the incremental_strategy, the macro to use for the strategy, and build the sql --#}\n {% set incremental_predicates = config.get('predicates', none) or config.get('incremental_predicates', none) %}\n {% set strategy_arg_dict = ({'target_relation': target_relation, 'temp_relation': temp_relation, 'unique_key': unique_key, 'dest_columns': dest_columns, 'incremental_predicates': incremental_predicates }) %}\n {% set build_sql = strategy_sql_macro_func(strategy_arg_dict) %}\n\n {% endif %}\n\n {% call statement(\"main\") %}\n {{ build_sql }}\n {% endcall %}\n\n {% if existing_relation is none or existing_relation.is_view or should_full_refresh() %}\n {% do create_indexes(relation_for_indexes) %}\n {% endif %}\n\n {% if need_swap %}\n {% do adapter.rename_relation(target_relation, backup_relation) %}\n {% do adapter.rename_relation(intermediate_relation, target_relation) %}\n {% do to_drop.append(backup_relation) %}\n {% endif %}\n\n {% set should_revoke = should_revoke(existing_relation, full_refresh_mode) %}\n {% do apply_grants(target_relation, grant_config, should_revoke=should_revoke) %}\n\n {% do persist_docs(target_relation, model) %}\n\n {{ run_hooks(post_hooks, inside_transaction=True) }}\n\n -- `COMMIT` happens here\n {% do adapter.commit() %}\n\n {% for rel in to_drop %}\n {% do adapter.drop_relation(rel) %}\n {% endfor %}\n\n {{ run_hooks(post_hooks, inside_transaction=False) }}\n\n {{ return({'relations': [target_relation]}) }}\n\n{%- endmaterialization %}", "depends_on": {"macros": ["macro.dbt.load_cached_relation", "macro.dbt.make_temp_relation", "macro.dbt.make_intermediate_relation", "macro.dbt.make_backup_relation", "macro.dbt.should_full_refresh", "macro.dbt.incremental_validate_on_schema_change", "macro.dbt.drop_relation_if_exists", "macro.dbt.run_hooks", "macro.dbt.get_create_table_as_sql", "macro.dbt.run_query", "macro.dbt.process_schema_changes", "macro.dbt.statement", "macro.dbt.create_indexes", "macro.dbt.should_revoke", "macro.dbt.apply_grants", "macro.dbt.persist_docs"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "supported_languages", "type": null, "description": ""}], "created_at": 1789419969.9466803, "supported_languages": ["sql"]}, "macro.dbt.get_quoted_csv": {"name": "get_quoted_csv", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/column_helpers.sql", "original_file_path": "macros/materializations/models/incremental/column_helpers.sql", "unique_id": "macro.dbt.get_quoted_csv", "macro_sql": "{% macro get_quoted_csv(column_names) %}\n\n {% set quoted = [] %}\n {% for col in column_names -%}\n {%- do quoted.append(adapter.quote(col)) -%}\n {%- endfor %}\n\n {%- set dest_cols_csv = quoted | join(', ') -%}\n {{ return(dest_cols_csv) }}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "column_names", "type": null, "description": ""}], "created_at": 1789419969.9482968, "supported_languages": null}, "macro.dbt.diff_columns": {"name": "diff_columns", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/column_helpers.sql", "original_file_path": "macros/materializations/models/incremental/column_helpers.sql", "unique_id": "macro.dbt.diff_columns", "macro_sql": "{% macro diff_columns(source_columns, target_columns) %}\n\n {% set result = [] %}\n {% set source_names = source_columns | map(attribute = 'column') | list %}\n {% set target_names = target_columns | map(attribute = 'column') | list %}\n\n {# --check whether the name attribute exists in the target - this does not perform a data type check #}\n {% for sc in source_columns %}\n {% if sc.name not in target_names %}\n {{ result.append(sc) }}\n {% endif %}\n {% endfor %}\n\n {{ return(result) }}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "source_columns", "type": null, "description": ""}, {"name": "target_columns", "type": null, "description": ""}], "created_at": 1789419969.949273, "supported_languages": null}, "macro.dbt.diff_column_data_types": {"name": "diff_column_data_types", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/column_helpers.sql", "original_file_path": "macros/materializations/models/incremental/column_helpers.sql", "unique_id": "macro.dbt.diff_column_data_types", "macro_sql": "{% macro diff_column_data_types(source_columns, target_columns) %}\n {{ return(adapter.dispatch('diff_column_data_types', 'dbt')(source_columns, target_columns)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__diff_column_data_types"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "source_columns", "type": null, "description": ""}, {"name": "target_columns", "type": null, "description": ""}], "created_at": 1789419969.9496572, "supported_languages": null}, "macro.dbt.default__diff_column_data_types": {"name": "default__diff_column_data_types", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/column_helpers.sql", "original_file_path": "macros/materializations/models/incremental/column_helpers.sql", "unique_id": "macro.dbt.default__diff_column_data_types", "macro_sql": "{% macro default__diff_column_data_types(source_columns, target_columns) %}\n {% set result = [] %}\n {% for sc in source_columns %}\n {% set tc = target_columns | selectattr(\"name\", \"equalto\", sc.name) | list | first %}\n {% if tc %}\n {% if sc.expanded_data_type != tc.expanded_data_type and not sc.can_expand_to(other_column=tc) %}\n {{ result.append( { 'column_name': tc.name, 'new_type': sc.expanded_data_type } ) }}\n {% endif %}\n {% endif %}\n {% endfor %}\n\n {{ return(result) }}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "source_columns", "type": null, "description": ""}, {"name": "target_columns", "type": null, "description": ""}], "created_at": 1789419969.9507935, "supported_languages": null}, "macro.dbt.get_merge_update_columns": {"name": "get_merge_update_columns", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/column_helpers.sql", "original_file_path": "macros/materializations/models/incremental/column_helpers.sql", "unique_id": "macro.dbt.get_merge_update_columns", "macro_sql": "{% macro get_merge_update_columns(merge_update_columns, merge_exclude_columns, dest_columns) %}\n {{ return(adapter.dispatch('get_merge_update_columns', 'dbt')(merge_update_columns, merge_exclude_columns, dest_columns)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_merge_update_columns"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "merge_update_columns", "type": null, "description": ""}, {"name": "merge_exclude_columns", "type": null, "description": ""}, {"name": "dest_columns", "type": null, "description": ""}], "created_at": 1789419969.9512172, "supported_languages": null}, "macro.dbt.default__get_merge_update_columns": {"name": "default__get_merge_update_columns", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/column_helpers.sql", "original_file_path": "macros/materializations/models/incremental/column_helpers.sql", "unique_id": "macro.dbt.default__get_merge_update_columns", "macro_sql": "{% macro default__get_merge_update_columns(merge_update_columns, merge_exclude_columns, dest_columns) %}\n {%- set default_cols = dest_columns | map(attribute=\"quoted\") | list -%}\n\n {%- if merge_update_columns and merge_exclude_columns -%}\n {{ exceptions.raise_compiler_error(\n 'Model cannot specify merge_update_columns and merge_exclude_columns. Please update model to use only one config'\n )}}\n {%- elif merge_update_columns -%}\n {%- set update_columns = merge_update_columns -%}\n {%- elif merge_exclude_columns -%}\n {%- set update_columns = [] -%}\n {%- for column in dest_columns -%}\n {% if column.column | lower not in merge_exclude_columns | map(\"lower\") | list %}\n {%- do update_columns.append(column.quoted) -%}\n {% endif %}\n {%- endfor -%}\n {%- else -%}\n {%- set update_columns = default_cols -%}\n {%- endif -%}\n\n {{ return(update_columns) }}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "merge_update_columns", "type": null, "description": ""}, {"name": "merge_exclude_columns", "type": null, "description": ""}, {"name": "dest_columns", "type": null, "description": ""}], "created_at": 1789419969.9524493, "supported_languages": null}, "macro.dbt.get_incremental_append_sql": {"name": "get_incremental_append_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "unique_id": "macro.dbt.get_incremental_append_sql", "macro_sql": "{% macro get_incremental_append_sql(arg_dict) %}\n\n {{ return(adapter.dispatch('get_incremental_append_sql', 'dbt')(arg_dict)) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_incremental_append_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "arg_dict", "type": null, "description": ""}], "created_at": 1789419969.953631, "supported_languages": null}, "macro.dbt.default__get_incremental_append_sql": {"name": "default__get_incremental_append_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "unique_id": "macro.dbt.default__get_incremental_append_sql", "macro_sql": "{% macro default__get_incremental_append_sql(arg_dict) %}\n\n {% do return(get_insert_into_sql(arg_dict[\"target_relation\"], arg_dict[\"temp_relation\"], arg_dict[\"dest_columns\"])) %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_insert_into_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "arg_dict", "type": null, "description": ""}], "created_at": 1789419969.954063, "supported_languages": null}, "macro.dbt.get_incremental_delete_insert_sql": {"name": "get_incremental_delete_insert_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "unique_id": "macro.dbt.get_incremental_delete_insert_sql", "macro_sql": "{% macro get_incremental_delete_insert_sql(arg_dict) %}\n\n {{ return(adapter.dispatch('get_incremental_delete_insert_sql', 'dbt')(arg_dict)) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_incremental_delete_insert_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "arg_dict", "type": null, "description": ""}], "created_at": 1789419969.9543812, "supported_languages": null}, "macro.dbt.default__get_incremental_delete_insert_sql": {"name": "default__get_incremental_delete_insert_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "unique_id": "macro.dbt.default__get_incremental_delete_insert_sql", "macro_sql": "{% macro default__get_incremental_delete_insert_sql(arg_dict) %}\n\n {% do return(get_delete_insert_merge_sql(arg_dict[\"target_relation\"], arg_dict[\"temp_relation\"], arg_dict[\"unique_key\"], arg_dict[\"dest_columns\"], arg_dict[\"incremental_predicates\"])) %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_delete_insert_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "arg_dict", "type": null, "description": ""}], "created_at": 1789419969.954882, "supported_languages": null}, "macro.dbt.get_incremental_merge_sql": {"name": "get_incremental_merge_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "unique_id": "macro.dbt.get_incremental_merge_sql", "macro_sql": "{% macro get_incremental_merge_sql(arg_dict) %}\n\n {{ return(adapter.dispatch('get_incremental_merge_sql', 'dbt')(arg_dict)) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_incremental_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "arg_dict", "type": null, "description": ""}], "created_at": 1789419969.9551916, "supported_languages": null}, "macro.dbt.default__get_incremental_merge_sql": {"name": "default__get_incremental_merge_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "unique_id": "macro.dbt.default__get_incremental_merge_sql", "macro_sql": "{% macro default__get_incremental_merge_sql(arg_dict) %}\n\n {% do return(get_merge_sql(arg_dict[\"target_relation\"], arg_dict[\"temp_relation\"], arg_dict[\"unique_key\"], arg_dict[\"dest_columns\"], arg_dict[\"incremental_predicates\"])) %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "arg_dict", "type": null, "description": ""}], "created_at": 1789419969.9556708, "supported_languages": null}, "macro.dbt.get_incremental_insert_overwrite_sql": {"name": "get_incremental_insert_overwrite_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "unique_id": "macro.dbt.get_incremental_insert_overwrite_sql", "macro_sql": "{% macro get_incremental_insert_overwrite_sql(arg_dict) %}\n\n {{ return(adapter.dispatch('get_incremental_insert_overwrite_sql', 'dbt')(arg_dict)) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_incremental_insert_overwrite_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "arg_dict", "type": null, "description": ""}], "created_at": 1789419969.956, "supported_languages": null}, "macro.dbt.default__get_incremental_insert_overwrite_sql": {"name": "default__get_incremental_insert_overwrite_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "unique_id": "macro.dbt.default__get_incremental_insert_overwrite_sql", "macro_sql": "{% macro default__get_incremental_insert_overwrite_sql(arg_dict) %}\n\n {% do return(get_insert_overwrite_merge_sql(arg_dict[\"target_relation\"], arg_dict[\"temp_relation\"], arg_dict[\"dest_columns\"], arg_dict[\"incremental_predicates\"])) %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_insert_overwrite_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "arg_dict", "type": null, "description": ""}], "created_at": 1789419969.9565802, "supported_languages": null}, "macro.dbt.get_incremental_default_sql": {"name": "get_incremental_default_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "unique_id": "macro.dbt.get_incremental_default_sql", "macro_sql": "{% macro get_incremental_default_sql(arg_dict) %}\n\n {{ return(adapter.dispatch('get_incremental_default_sql', 'dbt')(arg_dict)) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__get_incremental_default_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "arg_dict", "type": null, "description": ""}], "created_at": 1789419969.9569142, "supported_languages": null}, "macro.dbt.default__get_incremental_default_sql": {"name": "default__get_incremental_default_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "unique_id": "macro.dbt.default__get_incremental_default_sql", "macro_sql": "{% macro default__get_incremental_default_sql(arg_dict) %}\n\n {% do return(get_incremental_append_sql(arg_dict)) %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_incremental_append_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "arg_dict", "type": null, "description": ""}], "created_at": 1789419969.957171, "supported_languages": null}, "macro.dbt.get_incremental_microbatch_sql": {"name": "get_incremental_microbatch_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "unique_id": "macro.dbt.get_incremental_microbatch_sql", "macro_sql": "{% macro get_incremental_microbatch_sql(arg_dict) %}\n\n {{ return(adapter.dispatch('get_incremental_microbatch_sql', 'dbt')(arg_dict)) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__get_incremental_microbatch_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "arg_dict", "type": null, "description": ""}], "created_at": 1789419969.9574838, "supported_languages": null}, "macro.dbt.default__get_incremental_microbatch_sql": {"name": "default__get_incremental_microbatch_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "unique_id": "macro.dbt.default__get_incremental_microbatch_sql", "macro_sql": "{% macro default__get_incremental_microbatch_sql(arg_dict) %}\n\n {{ exceptions.raise_not_implemented('microbatch materialization strategy not implemented for adapter ' + adapter.type()) }}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "arg_dict", "type": null, "description": ""}], "created_at": 1789419969.9577765, "supported_languages": null}, "macro.dbt.get_insert_into_sql": {"name": "get_insert_into_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "unique_id": "macro.dbt.get_insert_into_sql", "macro_sql": "{% macro get_insert_into_sql(target_relation, temp_relation, dest_columns) %}\n\n {%- set dest_cols_csv = get_quoted_csv(dest_columns | map(attribute=\"name\")) -%}\n\n insert into {{ target_relation }} ({{ dest_cols_csv }})\n (\n select {{ dest_cols_csv }}\n from {{ temp_relation }}\n )\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_quoted_csv"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "target_relation", "type": null, "description": ""}, {"name": "temp_relation", "type": null, "description": ""}, {"name": "dest_columns", "type": null, "description": ""}], "created_at": 1789419969.958262, "supported_languages": null}, "macro.dbt.incremental_validate_on_schema_change": {"name": "incremental_validate_on_schema_change", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/on_schema_change.sql", "original_file_path": "macros/materializations/models/incremental/on_schema_change.sql", "unique_id": "macro.dbt.incremental_validate_on_schema_change", "macro_sql": "{% macro incremental_validate_on_schema_change(on_schema_change, default='ignore') %}\n\n {% if on_schema_change not in ['sync_all_columns', 'append_new_columns', 'fail', 'ignore'] %}\n\n {% set log_message = 'Invalid value for on_schema_change (%s) specified. Setting default value of %s.' % (on_schema_change, default) %}\n {% do log(log_message) %}\n\n {{ return(default) }}\n\n {% else %}\n\n {{ return(on_schema_change) }}\n\n {% endif %}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "on_schema_change", "type": null, "description": ""}, {"name": "default", "type": null, "description": ""}], "created_at": 1789419969.960536, "supported_languages": null}, "macro.dbt.check_for_schema_changes": {"name": "check_for_schema_changes", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/on_schema_change.sql", "original_file_path": "macros/materializations/models/incremental/on_schema_change.sql", "unique_id": "macro.dbt.check_for_schema_changes", "macro_sql": "{% macro check_for_schema_changes(source_relation, target_relation) %}\n {{ return(adapter.dispatch('check_for_schema_changes', 'dbt')(source_relation, target_relation)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__check_for_schema_changes"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "source_relation", "type": null, "description": ""}, {"name": "target_relation", "type": null, "description": ""}], "created_at": 1789419969.9609404, "supported_languages": null}, "macro.dbt.default__check_for_schema_changes": {"name": "default__check_for_schema_changes", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/on_schema_change.sql", "original_file_path": "macros/materializations/models/incremental/on_schema_change.sql", "unique_id": "macro.dbt.default__check_for_schema_changes", "macro_sql": "{% macro default__check_for_schema_changes(source_relation, target_relation) %}\n\n {% set schema_changed = False %}\n\n {%- set source_columns = adapter.get_columns_in_relation(source_relation) -%}\n {%- set target_columns = adapter.get_columns_in_relation(target_relation) -%}\n {%- set source_not_in_target = diff_columns(source_columns, target_columns) -%}\n {%- set target_not_in_source = diff_columns(target_columns, source_columns) -%}\n\n {% set new_target_types = diff_column_data_types(source_columns, target_columns) %}\n\n {% if source_not_in_target != [] %}\n {% set schema_changed = True %}\n {% elif target_not_in_source != [] or new_target_types != [] %}\n {% set schema_changed = True %}\n {% elif new_target_types != [] %}\n {% set schema_changed = True %}\n {% endif %}\n\n {% set changes_dict = {\n 'schema_changed': schema_changed,\n 'source_not_in_target': source_not_in_target,\n 'target_not_in_source': target_not_in_source,\n 'source_columns': source_columns,\n 'target_columns': target_columns,\n 'new_target_types': new_target_types\n } %}\n\n {% set msg %}\n In {{ target_relation }}:\n Schema changed: {{ schema_changed }}\n Source columns not in target: {{ source_not_in_target }}\n Target columns not in source: {{ target_not_in_source }}\n New column types: {{ new_target_types }}\n {% endset %}\n\n {% do log(msg) %}\n\n {{ return(changes_dict) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.diff_columns", "macro.dbt.diff_column_data_types"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "source_relation", "type": null, "description": ""}, {"name": "target_relation", "type": null, "description": ""}], "created_at": 1789419969.9630034, "supported_languages": null}, "macro.dbt.sync_column_schemas": {"name": "sync_column_schemas", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/on_schema_change.sql", "original_file_path": "macros/materializations/models/incremental/on_schema_change.sql", "unique_id": "macro.dbt.sync_column_schemas", "macro_sql": "{% macro sync_column_schemas(on_schema_change, target_relation, schema_changes_dict) %}\n {{ return(adapter.dispatch('sync_column_schemas', 'dbt')(on_schema_change, target_relation, schema_changes_dict)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__sync_column_schemas"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "on_schema_change", "type": null, "description": ""}, {"name": "target_relation", "type": null, "description": ""}, {"name": "schema_changes_dict", "type": null, "description": ""}], "created_at": 1789419969.9634666, "supported_languages": null}, "macro.dbt.default__sync_column_schemas": {"name": "default__sync_column_schemas", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/on_schema_change.sql", "original_file_path": "macros/materializations/models/incremental/on_schema_change.sql", "unique_id": "macro.dbt.default__sync_column_schemas", "macro_sql": "{% macro default__sync_column_schemas(on_schema_change, target_relation, schema_changes_dict) %}\n\n {%- set add_to_target_arr = schema_changes_dict['source_not_in_target'] -%}\n {%- set remove_from_target_arr = schema_changes_dict['target_not_in_source'] -%}\n {%- set new_target_types = schema_changes_dict['new_target_types'] -%}\n\n {%- if on_schema_change == 'append_new_columns'-%}\n {%- if add_to_target_arr | length > 0 -%}\n {%- do alter_relation_add_remove_columns(target_relation, add_to_target_arr, none) -%}\n {%- endif -%}\n\n {% elif on_schema_change == 'sync_all_columns' %}\n\n {% if add_to_target_arr | length > 0 or remove_from_target_arr | length > 0 %}\n {%- do alter_relation_add_remove_columns(target_relation, add_to_target_arr, remove_from_target_arr) -%}\n {% endif %}\n\n {% if new_target_types != [] %}\n {% for ntt in new_target_types %}\n {% set column_name = ntt['column_name'] %}\n {% set new_type = ntt['new_type'] %}\n {% do alter_column_type(target_relation, column_name, new_type) %}\n {% endfor %}\n {% endif %}\n\n {% endif %}\n\n {% set schema_change_message %}\n In {{ target_relation }}:\n Schema change approach: {{ on_schema_change }}\n Columns added: {{ add_to_target_arr }}\n Columns removed: {{ remove_from_target_arr }}\n Data types changed: {{ new_target_types }}\n {% endset %}\n\n {% do log(schema_change_message) %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.alter_relation_add_remove_columns", "macro.dbt.alter_column_type"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "on_schema_change", "type": null, "description": ""}, {"name": "target_relation", "type": null, "description": ""}, {"name": "schema_changes_dict", "type": null, "description": ""}], "created_at": 1789419969.9654822, "supported_languages": null}, "macro.dbt.process_schema_changes": {"name": "process_schema_changes", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/on_schema_change.sql", "original_file_path": "macros/materializations/models/incremental/on_schema_change.sql", "unique_id": "macro.dbt.process_schema_changes", "macro_sql": "{% macro process_schema_changes(on_schema_change, source_relation, target_relation) %}\n {{ return(adapter.dispatch('process_schema_changes', 'dbt')(on_schema_change, source_relation, target_relation)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__process_schema_changes"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "on_schema_change", "type": null, "description": ""}, {"name": "source_relation", "type": null, "description": ""}, {"name": "target_relation", "type": null, "description": ""}], "created_at": 1789419969.9660704, "supported_languages": null}, "macro.dbt.default__process_schema_changes": {"name": "default__process_schema_changes", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/on_schema_change.sql", "original_file_path": "macros/materializations/models/incremental/on_schema_change.sql", "unique_id": "macro.dbt.default__process_schema_changes", "macro_sql": "{% macro default__process_schema_changes(on_schema_change, source_relation, target_relation) %}\n\n {% if on_schema_change == 'ignore' %}\n\n {{ return({}) }}\n\n {% else %}\n\n {% set schema_changes_dict = check_for_schema_changes(source_relation, target_relation) %}\n\n {% if schema_changes_dict['schema_changed'] %}\n\n {% if on_schema_change == 'fail' %}\n\n {% set fail_msg %}\n The source and target schemas on this incremental model are out of sync!\n They can be reconciled in several ways:\n - set the `on_schema_change` config to either append_new_columns or sync_all_columns, depending on your situation.\n - Re-run the incremental model with `full_refresh: True` to update the target schema.\n - update the schema manually and re-run the process.\n\n Additional troubleshooting context:\n Source columns not in target: {{ schema_changes_dict['source_not_in_target'] }}\n Target columns not in source: {{ schema_changes_dict['target_not_in_source'] }}\n New column types: {{ schema_changes_dict['new_target_types'] }}\n {% endset %}\n\n {% do exceptions.raise_compiler_error(fail_msg) %}\n\n {# -- unless we ignore, run the sync operation per the config #}\n {% else %}\n\n {% do sync_column_schemas(on_schema_change, target_relation, schema_changes_dict) %}\n\n {% endif %}\n\n {% endif %}\n\n {{ return(schema_changes_dict['source_columns']) }}\n\n {% endif %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.check_for_schema_changes", "macro.dbt.sync_column_schemas"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "on_schema_change", "type": null, "description": ""}, {"name": "source_relation", "type": null, "description": ""}, {"name": "target_relation", "type": null, "description": ""}], "created_at": 1789419969.967516, "supported_languages": null}, "macro.dbt.get_merge_sql": {"name": "get_merge_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/merge.sql", "original_file_path": "macros/materializations/models/incremental/merge.sql", "unique_id": "macro.dbt.get_merge_sql", "macro_sql": "{% macro get_merge_sql(target, source, unique_key, dest_columns, incremental_predicates=none) -%}\n -- back compat for old kwarg name\n {% set incremental_predicates = kwargs.get('predicates', incremental_predicates) %}\n {{ adapter.dispatch('get_merge_sql', 'dbt')(target, source, unique_key, dest_columns, incremental_predicates) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "target", "type": null, "description": ""}, {"name": "source", "type": null, "description": ""}, {"name": "unique_key", "type": null, "description": ""}, {"name": "dest_columns", "type": null, "description": ""}, {"name": "incremental_predicates", "type": null, "description": ""}], "created_at": 1789419969.9695494, "supported_languages": null}, "macro.dbt.get_merge_unique_key_match": {"name": "get_merge_unique_key_match", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/merge.sql", "original_file_path": "macros/materializations/models/incremental/merge.sql", "unique_id": "macro.dbt.get_merge_unique_key_match", "macro_sql": "{% macro get_merge_unique_key_match(source_unique_key, target_unique_key) %}\n {{ return(adapter.dispatch('get_merge_unique_key_match', 'dbt')(source_unique_key, target_unique_key)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_merge_unique_key_match"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "source_unique_key", "type": null, "description": ""}, {"name": "target_unique_key", "type": null, "description": ""}], "created_at": 1789419969.9699316, "supported_languages": null}, "macro.dbt.default__get_merge_unique_key_match": {"name": "default__get_merge_unique_key_match", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/merge.sql", "original_file_path": "macros/materializations/models/incremental/merge.sql", "unique_id": "macro.dbt.default__get_merge_unique_key_match", "macro_sql": "{% macro default__get_merge_unique_key_match(source_unique_key, target_unique_key) -%}\n {{ return(equals(source_unique_key, target_unique_key) | trim) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.equals"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "source_unique_key", "type": null, "description": ""}, {"name": "target_unique_key", "type": null, "description": ""}], "created_at": 1789419969.9702244, "supported_languages": null}, "macro.dbt.default__get_merge_sql": {"name": "default__get_merge_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/merge.sql", "original_file_path": "macros/materializations/models/incremental/merge.sql", "unique_id": "macro.dbt.default__get_merge_sql", "macro_sql": "{% macro default__get_merge_sql(target, source, unique_key, dest_columns, incremental_predicates=none) -%}\n {%- set predicates = [] if incremental_predicates is none else [] + incremental_predicates -%}\n {%- set dest_cols_csv = get_quoted_csv(dest_columns | map(attribute=\"name\")) -%}\n {%- set merge_update_columns = config.get('merge_update_columns') -%}\n {%- set merge_exclude_columns = config.get('merge_exclude_columns') -%}\n {%- set update_columns = get_merge_update_columns(merge_update_columns, merge_exclude_columns, dest_columns) -%}\n {%- set sql_header = config.get('sql_header', none) -%}\n\n {% if unique_key %}\n {% if unique_key is sequence and unique_key is not mapping and unique_key is not string %}\n {% for key in unique_key %}\n {% set this_key_match %}\n DBT_INTERNAL_SOURCE.{{ key }} = DBT_INTERNAL_DEST.{{ key }}\n {% endset %}\n {% do predicates.append(this_key_match) %}\n {% endfor %}\n {% else %}\n {% set source_unique_key = (\"DBT_INTERNAL_SOURCE.\" ~ unique_key) | trim %}\n {% set target_unique_key = (\"DBT_INTERNAL_DEST.\" ~ unique_key) | trim %}\n {% set unique_key_match = get_merge_unique_key_match(source_unique_key, target_unique_key) %}\n {% do predicates.append(unique_key_match) %}\n {% endif %}\n {% else %}\n {% do predicates.append('FALSE') %}\n {% endif %}\n\n {{ sql_header if sql_header is not none }}\n\n merge into {{ target }} as DBT_INTERNAL_DEST\n using {{ source }} as DBT_INTERNAL_SOURCE\n on {{\"(\" ~ predicates | join(\") and (\") ~ \")\"}}\n\n {% if unique_key %}\n when matched then update set\n {% for column_name in update_columns -%}\n {{ column_name }} = DBT_INTERNAL_SOURCE.{{ column_name }}\n {%- if not loop.last %}, {%- endif %}\n {%- endfor %}\n {% endif %}\n\n when not matched then insert\n ({{ dest_cols_csv }})\n values\n ({{ dest_cols_csv }})\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_quoted_csv", "macro.dbt.get_merge_update_columns", "macro.dbt.get_merge_unique_key_match"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "target", "type": null, "description": ""}, {"name": "source", "type": null, "description": ""}, {"name": "unique_key", "type": null, "description": ""}, {"name": "dest_columns", "type": null, "description": ""}, {"name": "incremental_predicates", "type": null, "description": ""}], "created_at": 1789419969.97315, "supported_languages": null}, "macro.dbt.get_delete_insert_merge_sql": {"name": "get_delete_insert_merge_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/merge.sql", "original_file_path": "macros/materializations/models/incremental/merge.sql", "unique_id": "macro.dbt.get_delete_insert_merge_sql", "macro_sql": "{% macro get_delete_insert_merge_sql(target, source, unique_key, dest_columns, incremental_predicates) -%}\n {{ adapter.dispatch('get_delete_insert_merge_sql', 'dbt')(target, source, unique_key, dest_columns, incremental_predicates) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_delete_insert_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "target", "type": null, "description": ""}, {"name": "source", "type": null, "description": ""}, {"name": "unique_key", "type": null, "description": ""}, {"name": "dest_columns", "type": null, "description": ""}, {"name": "incremental_predicates", "type": null, "description": ""}], "created_at": 1789419969.973619, "supported_languages": null}, "macro.dbt.default__get_delete_insert_merge_sql": {"name": "default__get_delete_insert_merge_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/merge.sql", "original_file_path": "macros/materializations/models/incremental/merge.sql", "unique_id": "macro.dbt.default__get_delete_insert_merge_sql", "macro_sql": "{% macro default__get_delete_insert_merge_sql(target, source, unique_key, dest_columns, incremental_predicates) -%}\n\n {%- set dest_cols_csv = get_quoted_csv(dest_columns | map(attribute=\"name\")) -%}\n\n {% if unique_key %}\n {% if unique_key is string %}\n {% set unique_key = [unique_key] %}\n {% endif %}\n\n {%- set unique_key_str = unique_key|join(', ') -%}\n\n delete from {{ target }} as DBT_INTERNAL_DEST\n where ({{ unique_key_str }}) in (\n select distinct {{ unique_key_str }}\n from {{ source }} as DBT_INTERNAL_SOURCE\n )\n {%- if incremental_predicates %}\n {% for predicate in incremental_predicates %}\n and {{ predicate }}\n {% endfor %}\n {%- endif -%};\n\n {% endif %}\n\n insert into {{ target }} ({{ dest_cols_csv }})\n (\n select {{ dest_cols_csv }}\n from {{ source }}\n )\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.get_quoted_csv"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "target", "type": null, "description": ""}, {"name": "source", "type": null, "description": ""}, {"name": "unique_key", "type": null, "description": ""}, {"name": "dest_columns", "type": null, "description": ""}, {"name": "incremental_predicates", "type": null, "description": ""}], "created_at": 1789419969.9748542, "supported_languages": null}, "macro.dbt.get_insert_overwrite_merge_sql": {"name": "get_insert_overwrite_merge_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/merge.sql", "original_file_path": "macros/materializations/models/incremental/merge.sql", "unique_id": "macro.dbt.get_insert_overwrite_merge_sql", "macro_sql": "{% macro get_insert_overwrite_merge_sql(target, source, dest_columns, predicates, include_sql_header=false) -%}\n {{ adapter.dispatch('get_insert_overwrite_merge_sql', 'dbt')(target, source, dest_columns, predicates, include_sql_header) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_insert_overwrite_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "target", "type": null, "description": ""}, {"name": "source", "type": null, "description": ""}, {"name": "dest_columns", "type": null, "description": ""}, {"name": "predicates", "type": null, "description": ""}, {"name": "include_sql_header", "type": null, "description": ""}], "created_at": 1789419969.9753141, "supported_languages": null}, "macro.dbt.default__get_insert_overwrite_merge_sql": {"name": "default__get_insert_overwrite_merge_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/merge.sql", "original_file_path": "macros/materializations/models/incremental/merge.sql", "unique_id": "macro.dbt.default__get_insert_overwrite_merge_sql", "macro_sql": "{% macro default__get_insert_overwrite_merge_sql(target, source, dest_columns, predicates, include_sql_header) -%}\n {#-- The only time include_sql_header is True: --#}\n {#-- BigQuery + insert_overwrite strategy + \"static\" partitions config --#}\n {#-- We should consider including the sql header at the materialization level instead --#}\n\n {%- set predicates = [] if predicates is none else [] + predicates -%}\n {%- set dest_cols_csv = get_quoted_csv(dest_columns | map(attribute=\"name\")) -%}\n {%- set sql_header = config.get('sql_header', none) -%}\n\n {{ sql_header if sql_header is not none and include_sql_header }}\n\n merge into {{ target }} as DBT_INTERNAL_DEST\n using {{ source }} as DBT_INTERNAL_SOURCE\n on FALSE\n\n when not matched by source\n {% if predicates %} and {{ predicates | join(' and ') }} {% endif %}\n then delete\n\n when not matched then insert\n ({{ dest_cols_csv }})\n values\n ({{ dest_cols_csv }})\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_quoted_csv"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "target", "type": null, "description": ""}, {"name": "source", "type": null, "description": ""}, {"name": "dest_columns", "type": null, "description": ""}, {"name": "predicates", "type": null, "description": ""}, {"name": "include_sql_header", "type": null, "description": ""}], "created_at": 1789419969.9764168, "supported_languages": null}, "macro.dbt.is_incremental": {"name": "is_incremental", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/is_incremental.sql", "original_file_path": "macros/materializations/models/incremental/is_incremental.sql", "unique_id": "macro.dbt.is_incremental", "macro_sql": "{% macro is_incremental() %}\n {#-- do not run introspective queries in parsing #}\n {% if not execute %}\n {{ return(False) }}\n {% else %}\n {% set relation = adapter.get_relation(this.database, this.schema, this.table) %}\n {{ return(relation is not none\n and relation.type == 'table'\n and model.config.materialized == 'incremental'\n and not should_full_refresh()) }}\n {% endif %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.should_full_refresh"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789419969.9774632, "supported_languages": null}, "macro.dbt.date": {"name": "date", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/date.sql", "original_file_path": "macros/utils/date.sql", "unique_id": "macro.dbt.date", "macro_sql": "{% macro date(year, month, day) %}\n {{ return(adapter.dispatch('date', 'dbt') (year, month, day)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__date"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "year", "type": null, "description": ""}, {"name": "month", "type": null, "description": ""}, {"name": "day", "type": null, "description": ""}], "created_at": 1789419969.9780452, "supported_languages": null}, "macro.dbt.default__date": {"name": "default__date", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/date.sql", "original_file_path": "macros/utils/date.sql", "unique_id": "macro.dbt.default__date", "macro_sql": "{% macro default__date(year, month, day) -%}\n {%- set dt = modules.datetime.date(year, month, day) -%}\n {%- set iso_8601_formatted_date = dt.strftime('%Y-%m-%d') -%}\n to_date('{{ iso_8601_formatted_date }}', 'YYYY-MM-DD')\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "year", "type": null, "description": ""}, {"name": "month", "type": null, "description": ""}, {"name": "day", "type": null, "description": ""}], "created_at": 1789419969.9785342, "supported_languages": null}, "macro.dbt.safe_cast": {"name": "safe_cast", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/safe_cast.sql", "original_file_path": "macros/utils/safe_cast.sql", "unique_id": "macro.dbt.safe_cast", "macro_sql": "{% macro safe_cast(field, type) %}\n {{ return(adapter.dispatch('safe_cast', 'dbt') (field, type)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__safe_cast"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field", "type": null, "description": ""}, {"name": "type", "type": null, "description": ""}], "created_at": 1789419969.979055, "supported_languages": null}, "macro.dbt.default__safe_cast": {"name": "default__safe_cast", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/safe_cast.sql", "original_file_path": "macros/utils/safe_cast.sql", "unique_id": "macro.dbt.default__safe_cast", "macro_sql": "{% macro default__safe_cast(field, type) %}\n {# most databases don't support this function yet\n so we just need to use cast #}\n cast({{field}} as {{type}})\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field", "type": null, "description": ""}, {"name": "type", "type": null, "description": ""}], "created_at": 1789419969.979303, "supported_languages": null}, "macro.dbt.array_concat": {"name": "array_concat", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/array_concat.sql", "original_file_path": "macros/utils/array_concat.sql", "unique_id": "macro.dbt.array_concat", "macro_sql": "{% macro array_concat(array_1, array_2) -%}\n {{ return(adapter.dispatch('array_concat', 'dbt')(array_1, array_2)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__array_concat"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "array_1", "type": null, "description": ""}, {"name": "array_2", "type": null, "description": ""}], "created_at": 1789419969.979942, "supported_languages": null}, "macro.dbt.default__array_concat": {"name": "default__array_concat", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/array_concat.sql", "original_file_path": "macros/utils/array_concat.sql", "unique_id": "macro.dbt.default__array_concat", "macro_sql": "{% macro default__array_concat(array_1, array_2) -%}\n array_cat({{ array_1 }}, {{ array_2 }})\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "array_1", "type": null, "description": ""}, {"name": "array_2", "type": null, "description": ""}], "created_at": 1789419969.9801867, "supported_languages": null}, "macro.dbt.escape_single_quotes": {"name": "escape_single_quotes", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/escape_single_quotes.sql", "original_file_path": "macros/utils/escape_single_quotes.sql", "unique_id": "macro.dbt.escape_single_quotes", "macro_sql": "{% macro escape_single_quotes(expression) %}\n {{ return(adapter.dispatch('escape_single_quotes', 'dbt') (expression)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__escape_single_quotes"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "expression", "type": null, "description": ""}], "created_at": 1789419969.9806497, "supported_languages": null}, "macro.dbt.default__escape_single_quotes": {"name": "default__escape_single_quotes", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/escape_single_quotes.sql", "original_file_path": "macros/utils/escape_single_quotes.sql", "unique_id": "macro.dbt.default__escape_single_quotes", "macro_sql": "{% macro default__escape_single_quotes(expression) -%}\n{{ expression | replace(\"'\",\"''\") }}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "expression", "type": null, "description": ""}], "created_at": 1789419969.9809098, "supported_languages": null}, "macro.dbt.type_string": {"name": "type_string", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "unique_id": "macro.dbt.type_string", "macro_sql": "\n\n{%- macro type_string() -%}\n {{ return(adapter.dispatch('type_string', 'dbt')()) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt.default__type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789419969.9821744, "supported_languages": null}, "macro.dbt.default__type_string": {"name": "default__type_string", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "unique_id": "macro.dbt.default__type_string", "macro_sql": "{% macro default__type_string() %}\n {{ return(api.Column.translate_type(\"string\")) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789419969.9824505, "supported_languages": null}, "macro.dbt.type_timestamp": {"name": "type_timestamp", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "unique_id": "macro.dbt.type_timestamp", "macro_sql": "\n\n{%- macro type_timestamp() -%}\n {{ return(adapter.dispatch('type_timestamp', 'dbt')()) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt.default__type_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789419969.9827302, "supported_languages": null}, "macro.dbt.default__type_timestamp": {"name": "default__type_timestamp", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "unique_id": "macro.dbt.default__type_timestamp", "macro_sql": "{% macro default__type_timestamp() %}\n {{ return(api.Column.translate_type(\"timestamp\")) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789419969.9830105, "supported_languages": null}, "macro.dbt.type_float": {"name": "type_float", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "unique_id": "macro.dbt.type_float", "macro_sql": "\n\n{%- macro type_float() -%}\n {{ return(adapter.dispatch('type_float', 'dbt')()) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt.default__type_float"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789419969.9832873, "supported_languages": null}, "macro.dbt.default__type_float": {"name": "default__type_float", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "unique_id": "macro.dbt.default__type_float", "macro_sql": "{% macro default__type_float() %}\n {{ return(api.Column.translate_type(\"float\")) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789419969.9835439, "supported_languages": null}, "macro.dbt.type_numeric": {"name": "type_numeric", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "unique_id": "macro.dbt.type_numeric", "macro_sql": "\n\n{%- macro type_numeric() -%}\n {{ return(adapter.dispatch('type_numeric', 'dbt')()) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt.default__type_numeric"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789419969.9838324, "supported_languages": null}, "macro.dbt.default__type_numeric": {"name": "default__type_numeric", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "unique_id": "macro.dbt.default__type_numeric", "macro_sql": "{% macro default__type_numeric() %}\n {{ return(api.Column.numeric_type(\"numeric\", 28, 6)) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789419969.9841347, "supported_languages": null}, "macro.dbt.type_bigint": {"name": "type_bigint", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "unique_id": "macro.dbt.type_bigint", "macro_sql": "\n\n{%- macro type_bigint() -%}\n {{ return(adapter.dispatch('type_bigint', 'dbt')()) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt.default__type_bigint"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789419969.984404, "supported_languages": null}, "macro.dbt.default__type_bigint": {"name": "default__type_bigint", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "unique_id": "macro.dbt.default__type_bigint", "macro_sql": "{% macro default__type_bigint() %}\n {{ return(api.Column.translate_type(\"bigint\")) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789419969.984655, "supported_languages": null}, "macro.dbt.type_int": {"name": "type_int", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "unique_id": "macro.dbt.type_int", "macro_sql": "\n\n{%- macro type_int() -%}\n {{ return(adapter.dispatch('type_int', 'dbt')()) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt.default__type_int"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789419969.9849381, "supported_languages": null}, "macro.dbt.default__type_int": {"name": "default__type_int", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "unique_id": "macro.dbt.default__type_int", "macro_sql": "{%- macro default__type_int() -%}\n {{ return(api.Column.translate_type(\"integer\")) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789419969.9851813, "supported_languages": null}, "macro.dbt.type_boolean": {"name": "type_boolean", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "unique_id": "macro.dbt.type_boolean", "macro_sql": "\n\n{%- macro type_boolean() -%}\n {{ return(adapter.dispatch('type_boolean', 'dbt')()) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt.default__type_boolean"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789419969.985575, "supported_languages": null}, "macro.dbt.default__type_boolean": {"name": "default__type_boolean", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "unique_id": "macro.dbt.default__type_boolean", "macro_sql": "{%- macro default__type_boolean() -%}\n {{ return(api.Column.translate_type(\"boolean\")) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789419969.9858387, "supported_languages": null}, "macro.dbt.array_append": {"name": "array_append", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/array_append.sql", "original_file_path": "macros/utils/array_append.sql", "unique_id": "macro.dbt.array_append", "macro_sql": "{% macro array_append(array, new_element) -%}\n {{ return(adapter.dispatch('array_append', 'dbt')(array, new_element)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__array_append"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "array", "type": null, "description": ""}, {"name": "new_element", "type": null, "description": ""}], "created_at": 1789419969.986344, "supported_languages": null}, "macro.dbt.default__array_append": {"name": "default__array_append", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/array_append.sql", "original_file_path": "macros/utils/array_append.sql", "unique_id": "macro.dbt.default__array_append", "macro_sql": "{% macro default__array_append(array, new_element) -%}\n array_append({{ array }}, {{ new_element }})\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "array", "type": null, "description": ""}, {"name": "new_element", "type": null, "description": ""}], "created_at": 1789419969.9865801, "supported_languages": null}, "macro.dbt.get_powers_of_two": {"name": "get_powers_of_two", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/generate_series.sql", "original_file_path": "macros/utils/generate_series.sql", "unique_id": "macro.dbt.get_powers_of_two", "macro_sql": "{% macro get_powers_of_two(upper_bound) %}\n {{ return(adapter.dispatch('get_powers_of_two', 'dbt')(upper_bound)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_powers_of_two"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "upper_bound", "type": null, "description": ""}], "created_at": 1789419969.9873536, "supported_languages": null}, "macro.dbt.default__get_powers_of_two": {"name": "default__get_powers_of_two", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/generate_series.sql", "original_file_path": "macros/utils/generate_series.sql", "unique_id": "macro.dbt.default__get_powers_of_two", "macro_sql": "{% macro default__get_powers_of_two(upper_bound) %}\n\n {% if upper_bound <= 0 %}\n {{ exceptions.raise_compiler_error(\"upper bound must be positive\") }}\n {% endif %}\n\n {% for _ in range(1, 100) %}\n {% if upper_bound <= 2 ** loop.index %}{{ return(loop.index) }}{% endif %}\n {% endfor %}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "upper_bound", "type": null, "description": ""}], "created_at": 1789419969.9880776, "supported_languages": null}, "macro.dbt.generate_series": {"name": "generate_series", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/generate_series.sql", "original_file_path": "macros/utils/generate_series.sql", "unique_id": "macro.dbt.generate_series", "macro_sql": "{% macro generate_series(upper_bound) %}\n {{ return(adapter.dispatch('generate_series', 'dbt')(upper_bound)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__generate_series"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "upper_bound", "type": null, "description": ""}], "created_at": 1789419969.9884021, "supported_languages": null}, "macro.dbt.default__generate_series": {"name": "default__generate_series", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/generate_series.sql", "original_file_path": "macros/utils/generate_series.sql", "unique_id": "macro.dbt.default__generate_series", "macro_sql": "{% macro default__generate_series(upper_bound) %}\n\n {% set n = dbt.get_powers_of_two(upper_bound) %}\n\n with p as (\n select 0 as generated_number union all select 1\n ), unioned as (\n\n select\n\n {% for i in range(n) %}\n p{{i}}.generated_number * power(2, {{i}})\n {% if not loop.last %} + {% endif %}\n {% endfor %}\n + 1\n as generated_number\n\n from\n\n {% for i in range(n) %}\n p as p{{i}}\n {% if not loop.last %} cross join {% endif %}\n {% endfor %}\n\n )\n\n select *\n from unioned\n where generated_number <= {{upper_bound}}\n order by generated_number\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_powers_of_two"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "upper_bound", "type": null, "description": ""}], "created_at": 1789419969.9892685, "supported_languages": null}, "macro.dbt.right": {"name": "right", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/right.sql", "original_file_path": "macros/utils/right.sql", "unique_id": "macro.dbt.right", "macro_sql": "{% macro right(string_text, length_expression) -%}\n {{ return(adapter.dispatch('right', 'dbt') (string_text, length_expression)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__right"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "string_text", "type": null, "description": ""}, {"name": "length_expression", "type": null, "description": ""}], "created_at": 1789419969.9897828, "supported_languages": null}, "macro.dbt.default__right": {"name": "default__right", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/right.sql", "original_file_path": "macros/utils/right.sql", "unique_id": "macro.dbt.default__right", "macro_sql": "{% macro default__right(string_text, length_expression) %}\n\n right(\n {{ string_text }},\n {{ length_expression }}\n )\n\n{%- endmacro -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "string_text", "type": null, "description": ""}, {"name": "length_expression", "type": null, "description": ""}], "created_at": 1789419969.990026, "supported_languages": null}, "macro.dbt.hash": {"name": "hash", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/hash.sql", "original_file_path": "macros/utils/hash.sql", "unique_id": "macro.dbt.hash", "macro_sql": "{% macro hash(field) -%}\n {{ return(adapter.dispatch('hash', 'dbt') (field)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__hash"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field", "type": null, "description": ""}], "created_at": 1789419969.9904604, "supported_languages": null}, "macro.dbt.default__hash": {"name": "default__hash", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/hash.sql", "original_file_path": "macros/utils/hash.sql", "unique_id": "macro.dbt.default__hash", "macro_sql": "{% macro default__hash(field) -%}\n md5(cast({{ field }} as {{ api.Column.translate_type('string') }}))\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field", "type": null, "description": ""}], "created_at": 1789419969.9907305, "supported_languages": null}, "macro.dbt.intersect": {"name": "intersect", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/intersect.sql", "original_file_path": "macros/utils/intersect.sql", "unique_id": "macro.dbt.intersect", "macro_sql": "{% macro intersect() %}\n {{ return(adapter.dispatch('intersect', 'dbt')()) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__intersect"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789419969.9911244, "supported_languages": null}, "macro.dbt.default__intersect": {"name": "default__intersect", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/intersect.sql", "original_file_path": "macros/utils/intersect.sql", "unique_id": "macro.dbt.default__intersect", "macro_sql": "{% macro default__intersect() %}\n\n intersect\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789419969.9912574, "supported_languages": null}, "macro.dbt.last_day": {"name": "last_day", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/last_day.sql", "original_file_path": "macros/utils/last_day.sql", "unique_id": "macro.dbt.last_day", "macro_sql": "{% macro last_day(date, datepart) %}\n {{ return(adapter.dispatch('last_day', 'dbt') (date, datepart)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__last_day"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "date", "type": null, "description": ""}, {"name": "datepart", "type": null, "description": ""}], "created_at": 1789419969.9917865, "supported_languages": null}, "macro.dbt.default_last_day": {"name": "default_last_day", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/last_day.sql", "original_file_path": "macros/utils/last_day.sql", "unique_id": "macro.dbt.default_last_day", "macro_sql": "\n\n{%- macro default_last_day(date, datepart) -%}\n cast(\n {{dbt.dateadd('day', '-1',\n dbt.dateadd(datepart, '1', dbt.date_trunc(datepart, date))\n )}}\n as date)\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt.dateadd", "macro.dbt.date_trunc"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "date", "type": null, "description": ""}, {"name": "datepart", "type": null, "description": ""}], "created_at": 1789419969.992245, "supported_languages": null}, "macro.dbt.default__last_day": {"name": "default__last_day", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/last_day.sql", "original_file_path": "macros/utils/last_day.sql", "unique_id": "macro.dbt.default__last_day", "macro_sql": "{% macro default__last_day(date, datepart) -%}\n {{dbt.default_last_day(date, datepart)}}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default_last_day"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "date", "type": null, "description": ""}, {"name": "datepart", "type": null, "description": ""}], "created_at": 1789419969.9926338, "supported_languages": null}, "macro.dbt.listagg": {"name": "listagg", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/listagg.sql", "original_file_path": "macros/utils/listagg.sql", "unique_id": "macro.dbt.listagg", "macro_sql": "{% macro listagg(measure, delimiter_text=\"','\", order_by_clause=none, limit_num=none) -%}\n {{ return(adapter.dispatch('listagg', 'dbt') (measure, delimiter_text, order_by_clause, limit_num)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__listagg"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "measure", "type": null, "description": ""}, {"name": "delimiter_text", "type": null, "description": ""}, {"name": "order_by_clause", "type": null, "description": ""}, {"name": "limit_num", "type": null, "description": ""}], "created_at": 1789419969.993429, "supported_languages": null}, "macro.dbt.default__listagg": {"name": "default__listagg", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/listagg.sql", "original_file_path": "macros/utils/listagg.sql", "unique_id": "macro.dbt.default__listagg", "macro_sql": "{% macro default__listagg(measure, delimiter_text, order_by_clause, limit_num) -%}\n\n {% if limit_num -%}\n array_to_string(\n array_slice(\n array_agg(\n {{ measure }}\n ){% if order_by_clause -%}\n within group ({{ order_by_clause }})\n {%- endif %}\n ,0\n ,{{ limit_num }}\n ),\n {{ delimiter_text }}\n )\n {%- else %}\n listagg(\n {{ measure }},\n {{ delimiter_text }}\n )\n {% if order_by_clause -%}\n within group ({{ order_by_clause }})\n {%- endif %}\n {%- endif %}\n\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "measure", "type": null, "description": ""}, {"name": "delimiter_text", "type": null, "description": ""}, {"name": "order_by_clause", "type": null, "description": ""}, {"name": "limit_num", "type": null, "description": ""}], "created_at": 1789419969.9941344, "supported_languages": null}, "macro.dbt.cast_bool_to_text": {"name": "cast_bool_to_text", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/cast_bool_to_text.sql", "original_file_path": "macros/utils/cast_bool_to_text.sql", "unique_id": "macro.dbt.cast_bool_to_text", "macro_sql": "{% macro cast_bool_to_text(field) %}\n {{ adapter.dispatch('cast_bool_to_text', 'dbt') (field) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__cast_bool_to_text"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field", "type": null, "description": ""}], "created_at": 1789419969.9945636, "supported_languages": null}, "macro.dbt.default__cast_bool_to_text": {"name": "default__cast_bool_to_text", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/cast_bool_to_text.sql", "original_file_path": "macros/utils/cast_bool_to_text.sql", "unique_id": "macro.dbt.default__cast_bool_to_text", "macro_sql": "{% macro default__cast_bool_to_text(field) %}\n cast({{ field }} as {{ api.Column.translate_type('string') }})\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field", "type": null, "description": ""}], "created_at": 1789419969.9948516, "supported_languages": null}, "macro.dbt.date_trunc": {"name": "date_trunc", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/date_trunc.sql", "original_file_path": "macros/utils/date_trunc.sql", "unique_id": "macro.dbt.date_trunc", "macro_sql": "{% macro date_trunc(datepart, date) -%}\n {{ return(adapter.dispatch('date_trunc', 'dbt') (datepart, date)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__date_trunc"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "datepart", "type": null, "description": ""}, {"name": "date", "type": null, "description": ""}], "created_at": 1789419969.995333, "supported_languages": null}, "macro.dbt.default__date_trunc": {"name": "default__date_trunc", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/date_trunc.sql", "original_file_path": "macros/utils/date_trunc.sql", "unique_id": "macro.dbt.default__date_trunc", "macro_sql": "{% macro default__date_trunc(datepart, date) -%}\n date_trunc('{{datepart}}', {{date}})\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "datepart", "type": null, "description": ""}, {"name": "date", "type": null, "description": ""}], "created_at": 1789419969.9955602, "supported_languages": null}, "macro.dbt.position": {"name": "position", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/position.sql", "original_file_path": "macros/utils/position.sql", "unique_id": "macro.dbt.position", "macro_sql": "{% macro position(substring_text, string_text) -%}\n {{ return(adapter.dispatch('position', 'dbt') (substring_text, string_text)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__position"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "substring_text", "type": null, "description": ""}, {"name": "string_text", "type": null, "description": ""}], "created_at": 1789419969.9960523, "supported_languages": null}, "macro.dbt.default__position": {"name": "default__position", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/position.sql", "original_file_path": "macros/utils/position.sql", "unique_id": "macro.dbt.default__position", "macro_sql": "{% macro default__position(substring_text, string_text) %}\n\n position(\n {{ substring_text }} in {{ string_text }}\n )\n\n{%- endmacro -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "substring_text", "type": null, "description": ""}, {"name": "string_text", "type": null, "description": ""}], "created_at": 1789419969.9962938, "supported_languages": null}, "macro.dbt.any_value": {"name": "any_value", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/any_value.sql", "original_file_path": "macros/utils/any_value.sql", "unique_id": "macro.dbt.any_value", "macro_sql": "{% macro any_value(expression) -%}\n {{ return(adapter.dispatch('any_value', 'dbt') (expression)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__any_value"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "expression", "type": null, "description": ""}], "created_at": 1789419969.9967084, "supported_languages": null}, "macro.dbt.default__any_value": {"name": "default__any_value", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/any_value.sql", "original_file_path": "macros/utils/any_value.sql", "unique_id": "macro.dbt.default__any_value", "macro_sql": "{% macro default__any_value(expression) -%}\n\n any_value({{ expression }})\n\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "expression", "type": null, "description": ""}], "created_at": 1789419969.9969172, "supported_languages": null}, "macro.dbt.length": {"name": "length", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/length.sql", "original_file_path": "macros/utils/length.sql", "unique_id": "macro.dbt.length", "macro_sql": "{% macro length(expression) -%}\n {{ return(adapter.dispatch('length', 'dbt') (expression)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__length"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "expression", "type": null, "description": ""}], "created_at": 1789419969.9973385, "supported_languages": null}, "macro.dbt.default__length": {"name": "default__length", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/length.sql", "original_file_path": "macros/utils/length.sql", "unique_id": "macro.dbt.default__length", "macro_sql": "{% macro default__length(expression) %}\n\n length(\n {{ expression }}\n )\n\n{%- endmacro -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "expression", "type": null, "description": ""}], "created_at": 1789419969.997521, "supported_languages": null}, "macro.dbt.cast": {"name": "cast", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/cast.sql", "original_file_path": "macros/utils/cast.sql", "unique_id": "macro.dbt.cast", "macro_sql": "{% macro cast(field, type) %}\n {{ return(adapter.dispatch('cast', 'dbt') (field, type)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__cast"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field", "type": null, "description": ""}, {"name": "type", "type": null, "description": ""}], "created_at": 1789419969.9980087, "supported_languages": null}, "macro.dbt.default__cast": {"name": "default__cast", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/cast.sql", "original_file_path": "macros/utils/cast.sql", "unique_id": "macro.dbt.default__cast", "macro_sql": "{% macro default__cast(field, type) %}\n cast({{field}} as {{type}})\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field", "type": null, "description": ""}, {"name": "type", "type": null, "description": ""}], "created_at": 1789419969.9982414, "supported_languages": null}, "macro.dbt.get_intervals_between": {"name": "get_intervals_between", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/date_spine.sql", "original_file_path": "macros/utils/date_spine.sql", "unique_id": "macro.dbt.get_intervals_between", "macro_sql": "{% macro get_intervals_between(start_date, end_date, datepart) -%}\n {{ return(adapter.dispatch('get_intervals_between', 'dbt')(start_date, end_date, datepart)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_intervals_between"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "start_date", "type": null, "description": ""}, {"name": "end_date", "type": null, "description": ""}, {"name": "datepart", "type": null, "description": ""}], "created_at": 1789419969.9992216, "supported_languages": null}, "macro.dbt.default__get_intervals_between": {"name": "default__get_intervals_between", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/date_spine.sql", "original_file_path": "macros/utils/date_spine.sql", "unique_id": "macro.dbt.default__get_intervals_between", "macro_sql": "{% macro default__get_intervals_between(start_date, end_date, datepart) -%}\n {%- call statement('get_intervals_between', fetch_result=True) %}\n\n select {{ dbt.datediff(start_date, end_date, datepart) }}\n\n {%- endcall -%}\n\n {%- set value_list = load_result('get_intervals_between') -%}\n\n {%- if value_list and value_list['data'] -%}\n {%- set values = value_list['data'] | map(attribute=0) | list %}\n {{ return(values[0]) }}\n {%- else -%}\n {{ return(1) }}\n {%- endif -%}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.statement", "macro.dbt.datediff"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "start_date", "type": null, "description": ""}, {"name": "end_date", "type": null, "description": ""}, {"name": "datepart", "type": null, "description": ""}], "created_at": 1789419970.0002573, "supported_languages": null}, "macro.dbt.date_spine": {"name": "date_spine", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/date_spine.sql", "original_file_path": "macros/utils/date_spine.sql", "unique_id": "macro.dbt.date_spine", "macro_sql": "{% macro date_spine(datepart, start_date, end_date) %}\n {{ return(adapter.dispatch('date_spine', 'dbt')(datepart, start_date, end_date)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__date_spine"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "datepart", "type": null, "description": ""}, {"name": "start_date", "type": null, "description": ""}, {"name": "end_date", "type": null, "description": ""}], "created_at": 1789419970.000665, "supported_languages": null}, "macro.dbt.default__date_spine": {"name": "default__date_spine", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/date_spine.sql", "original_file_path": "macros/utils/date_spine.sql", "unique_id": "macro.dbt.default__date_spine", "macro_sql": "{% macro default__date_spine(datepart, start_date, end_date) %}\n\n\n {# call as follows:\n\n date_spine(\n \"day\",\n \"to_date('01/01/2016', 'mm/dd/yyyy')\",\n \"dbt.dateadd(week, 1, current_date)\"\n ) #}\n\n\n with rawdata as (\n\n {{dbt.generate_series(\n dbt.get_intervals_between(start_date, end_date, datepart)\n )}}\n\n ),\n\n all_periods as (\n\n select (\n {{\n dbt.dateadd(\n datepart,\n \"row_number() over (order by 1) - 1\",\n start_date\n )\n }}\n ) as date_{{datepart}}\n from rawdata\n\n ),\n\n filtered as (\n\n select *\n from all_periods\n where date_{{datepart}} <= {{ end_date }}\n\n )\n\n select * from filtered\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.generate_series", "macro.dbt.get_intervals_between", "macro.dbt.dateadd"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "datepart", "type": null, "description": ""}, {"name": "start_date", "type": null, "description": ""}, {"name": "end_date", "type": null, "description": ""}], "created_at": 1789419970.0012987, "supported_languages": null}, "macro.dbt.datediff": {"name": "datediff", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/datediff.sql", "original_file_path": "macros/utils/datediff.sql", "unique_id": "macro.dbt.datediff", "macro_sql": "{% macro datediff(first_date, second_date, datepart) %}\n {{ return(adapter.dispatch('datediff', 'dbt')(first_date, second_date, datepart)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__datediff"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "first_date", "type": null, "description": ""}, {"name": "second_date", "type": null, "description": ""}, {"name": "datepart", "type": null, "description": ""}], "created_at": 1789419970.0018606, "supported_languages": null}, "macro.dbt.default__datediff": {"name": "default__datediff", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/datediff.sql", "original_file_path": "macros/utils/datediff.sql", "unique_id": "macro.dbt.default__datediff", "macro_sql": "{% macro default__datediff(first_date, second_date, datepart) -%}\n\n datediff(\n {{ datepart }},\n {{ first_date }},\n {{ second_date }}\n )\n\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "first_date", "type": null, "description": ""}, {"name": "second_date", "type": null, "description": ""}, {"name": "datepart", "type": null, "description": ""}], "created_at": 1789419970.0021486, "supported_languages": null}, "macro.dbt.equals": {"name": "equals", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/equals.sql", "original_file_path": "macros/utils/equals.sql", "unique_id": "macro.dbt.equals", "macro_sql": "{% macro equals(expr1, expr2) %}\n {{ return(adapter.dispatch('equals', 'dbt') (expr1, expr2)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__equals"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "expr1", "type": null, "description": ""}, {"name": "expr2", "type": null, "description": ""}], "created_at": 1789419970.0026934, "supported_languages": null}, "macro.dbt.default__equals": {"name": "default__equals", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/equals.sql", "original_file_path": "macros/utils/equals.sql", "unique_id": "macro.dbt.default__equals", "macro_sql": "{% macro default__equals(expr1, expr2) -%}\n{%- if adapter.behavior.enable_truthy_nulls_equals_macro.no_warn %}\n case when (({{ expr1 }} = {{ expr2 }}) or ({{ expr1 }} is null and {{ expr2 }} is null))\n then 0\n else 1\n end = 0\n{%- else -%}\n ({{ expr1 }} = {{ expr2 }})\n{%- endif %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "expr1", "type": null, "description": ""}, {"name": "expr2", "type": null, "description": ""}], "created_at": 1789419970.0032241, "supported_languages": null}, "macro.dbt.dateadd": {"name": "dateadd", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/dateadd.sql", "original_file_path": "macros/utils/dateadd.sql", "unique_id": "macro.dbt.dateadd", "macro_sql": "{% macro dateadd(datepart, interval, from_date_or_timestamp) %}\n {{ return(adapter.dispatch('dateadd', 'dbt')(datepart, interval, from_date_or_timestamp)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__dateadd"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "datepart", "type": null, "description": ""}, {"name": "interval", "type": null, "description": ""}, {"name": "from_date_or_timestamp", "type": null, "description": ""}], "created_at": 1789419970.0037777, "supported_languages": null}, "macro.dbt.default__dateadd": {"name": "default__dateadd", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/dateadd.sql", "original_file_path": "macros/utils/dateadd.sql", "unique_id": "macro.dbt.default__dateadd", "macro_sql": "{% macro default__dateadd(datepart, interval, from_date_or_timestamp) %}\n\n dateadd(\n {{ datepart }},\n {{ interval }},\n {{ from_date_or_timestamp }}\n )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "datepart", "type": null, "description": ""}, {"name": "interval", "type": null, "description": ""}, {"name": "from_date_or_timestamp", "type": null, "description": ""}], "created_at": 1789419970.0040722, "supported_languages": null}, "macro.dbt.concat": {"name": "concat", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/concat.sql", "original_file_path": "macros/utils/concat.sql", "unique_id": "macro.dbt.concat", "macro_sql": "{% macro concat(fields) -%}\n {{ return(adapter.dispatch('concat', 'dbt')(fields)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__concat"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "fields", "type": null, "description": ""}], "created_at": 1789419970.0044928, "supported_languages": null}, "macro.dbt.default__concat": {"name": "default__concat", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/concat.sql", "original_file_path": "macros/utils/concat.sql", "unique_id": "macro.dbt.default__concat", "macro_sql": "{% macro default__concat(fields) -%}\n {{ fields|join(' || ') }}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "fields", "type": null, "description": ""}], "created_at": 1789419970.004716, "supported_languages": null}, "macro.dbt.array_construct": {"name": "array_construct", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/array_construct.sql", "original_file_path": "macros/utils/array_construct.sql", "unique_id": "macro.dbt.array_construct", "macro_sql": "{% macro array_construct(inputs=[], data_type=api.Column.translate_type('integer')) -%}\n {{ return(adapter.dispatch('array_construct', 'dbt')(inputs, data_type)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__array_construct"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "inputs", "type": null, "description": ""}, {"name": "data_type", "type": null, "description": ""}], "created_at": 1789419970.005378, "supported_languages": null}, "macro.dbt.default__array_construct": {"name": "default__array_construct", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/array_construct.sql", "original_file_path": "macros/utils/array_construct.sql", "unique_id": "macro.dbt.default__array_construct", "macro_sql": "{% macro default__array_construct(inputs, data_type) -%}\n {% if inputs|length > 0 %}\n array[ {{ inputs|join(' , ') }} ]\n {% else %}\n array[]::{{data_type}}[]\n {% endif %}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "inputs", "type": null, "description": ""}, {"name": "data_type", "type": null, "description": ""}], "created_at": 1789419970.0058234, "supported_languages": null}, "macro.dbt.split_part": {"name": "split_part", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/split_part.sql", "original_file_path": "macros/utils/split_part.sql", "unique_id": "macro.dbt.split_part", "macro_sql": "{% macro split_part(string_text, delimiter_text, part_number) %}\n {{ return(adapter.dispatch('split_part', 'dbt') (string_text, delimiter_text, part_number)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__split_part"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "string_text", "type": null, "description": ""}, {"name": "delimiter_text", "type": null, "description": ""}, {"name": "part_number", "type": null, "description": ""}], "created_at": 1789419970.0064726, "supported_languages": null}, "macro.dbt.default__split_part": {"name": "default__split_part", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/split_part.sql", "original_file_path": "macros/utils/split_part.sql", "unique_id": "macro.dbt.default__split_part", "macro_sql": "{% macro default__split_part(string_text, delimiter_text, part_number) %}\n\n split_part(\n {{ string_text }},\n {{ delimiter_text }},\n {{ part_number }}\n )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "string_text", "type": null, "description": ""}, {"name": "delimiter_text", "type": null, "description": ""}, {"name": "part_number", "type": null, "description": ""}], "created_at": 1789419970.0069113, "supported_languages": null}, "macro.dbt._split_part_negative": {"name": "_split_part_negative", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/split_part.sql", "original_file_path": "macros/utils/split_part.sql", "unique_id": "macro.dbt._split_part_negative", "macro_sql": "{% macro _split_part_negative(string_text, delimiter_text, part_number) %}\n\n split_part(\n {{ string_text }},\n {{ delimiter_text }},\n length({{ string_text }})\n - length(\n replace({{ string_text }}, {{ delimiter_text }}, '')\n ) + 2 + {{ part_number }}\n )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "string_text", "type": null, "description": ""}, {"name": "delimiter_text", "type": null, "description": ""}, {"name": "part_number", "type": null, "description": ""}], "created_at": 1789419970.0073, "supported_languages": null}, "macro.dbt.bool_or": {"name": "bool_or", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/bool_or.sql", "original_file_path": "macros/utils/bool_or.sql", "unique_id": "macro.dbt.bool_or", "macro_sql": "{% macro bool_or(expression) -%}\n {{ return(adapter.dispatch('bool_or', 'dbt') (expression)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__bool_or"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "expression", "type": null, "description": ""}], "created_at": 1789419970.007722, "supported_languages": null}, "macro.dbt.default__bool_or": {"name": "default__bool_or", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/bool_or.sql", "original_file_path": "macros/utils/bool_or.sql", "unique_id": "macro.dbt.default__bool_or", "macro_sql": "{% macro default__bool_or(expression) -%}\n\n bool_or({{ expression }})\n\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "expression", "type": null, "description": ""}], "created_at": 1789419970.0079277, "supported_languages": null}, "macro.dbt.replace": {"name": "replace", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/replace.sql", "original_file_path": "macros/utils/replace.sql", "unique_id": "macro.dbt.replace", "macro_sql": "{% macro replace(field, old_chars, new_chars) -%}\n {{ return(adapter.dispatch('replace', 'dbt') (field, old_chars, new_chars)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__replace"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field", "type": null, "description": ""}, {"name": "old_chars", "type": null, "description": ""}, {"name": "new_chars", "type": null, "description": ""}], "created_at": 1789419970.0084572, "supported_languages": null}, "macro.dbt.default__replace": {"name": "default__replace", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/replace.sql", "original_file_path": "macros/utils/replace.sql", "unique_id": "macro.dbt.default__replace", "macro_sql": "{% macro default__replace(field, old_chars, new_chars) %}\n\n replace(\n {{ field }},\n {{ old_chars }},\n {{ new_chars }}\n )\n\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field", "type": null, "description": ""}, {"name": "old_chars", "type": null, "description": ""}, {"name": "new_chars", "type": null, "description": ""}], "created_at": 1789419970.0087657, "supported_languages": null}, "macro.dbt.string_literal": {"name": "string_literal", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/literal.sql", "original_file_path": "macros/utils/literal.sql", "unique_id": "macro.dbt.string_literal", "macro_sql": "{%- macro string_literal(value) -%}\n {{ return(adapter.dispatch('string_literal', 'dbt') (value)) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt.default__string_literal"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "value", "type": null, "description": ""}], "created_at": 1789419970.009197, "supported_languages": null}, "macro.dbt.default__string_literal": {"name": "default__string_literal", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/literal.sql", "original_file_path": "macros/utils/literal.sql", "unique_id": "macro.dbt.default__string_literal", "macro_sql": "{% macro default__string_literal(value) -%}\n '{{ value }}'\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "value", "type": null, "description": ""}], "created_at": 1789419970.0093763, "supported_languages": null}, "macro.dbt.except": {"name": "except", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/except.sql", "original_file_path": "macros/utils/except.sql", "unique_id": "macro.dbt.except", "macro_sql": "{% macro except() %}\n {{ return(adapter.dispatch('except', 'dbt')()) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__except"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789419970.0097656, "supported_languages": null}, "macro.dbt.default__except": {"name": "default__except", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/except.sql", "original_file_path": "macros/utils/except.sql", "unique_id": "macro.dbt.default__except", "macro_sql": "{% macro default__except() %}\n\n except\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789419970.0099034, "supported_languages": null}, "macro.dbt.statement": {"name": "statement", "resource_type": "macro", "package_name": "dbt", "path": "macros/etc/statement.sql", "original_file_path": "macros/etc/statement.sql", "unique_id": "macro.dbt.statement", "macro_sql": "\n{%- macro statement(name=None, fetch_result=False, auto_begin=True, language='sql') -%}\n {%- if execute: -%}\n {%- set compiled_code = caller() -%}\n\n {%- if name == 'main' -%}\n {{ log('Writing runtime {} for node \"{}\"'.format(language, model['unique_id'])) }}\n {{ write(compiled_code) }}\n {%- endif -%}\n {%- if language == 'sql'-%}\n {%- set res, table = adapter.execute(compiled_code, auto_begin=auto_begin, fetch=fetch_result) -%}\n {%- elif language == 'python' -%}\n {%- set res = submit_python_job(model, compiled_code) -%}\n {#-- TODO: What should table be for python models? --#}\n {%- set table = None -%}\n {%- else -%}\n {% do exceptions.raise_compiler_error(\"statement macro didn't get supported language\") %}\n {%- endif -%}\n\n {%- if name is not none -%}\n {{ store_result(name, response=res, agate_table=table) }}\n {%- endif -%}\n\n {%- endif -%}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "name", "type": null, "description": ""}, {"name": "fetch_result", "type": null, "description": ""}, {"name": "auto_begin", "type": null, "description": ""}, {"name": "language", "type": null, "description": ""}], "created_at": 1789419970.0121055, "supported_languages": null}, "macro.dbt.noop_statement": {"name": "noop_statement", "resource_type": "macro", "package_name": "dbt", "path": "macros/etc/statement.sql", "original_file_path": "macros/etc/statement.sql", "unique_id": "macro.dbt.noop_statement", "macro_sql": "{% macro noop_statement(name=None, message=None, code=None, rows_affected=None, res=None) -%}\n {%- set sql = caller() -%}\n\n {%- if name == 'main' -%}\n {{ log('Writing runtime SQL for node \"{}\"'.format(model['unique_id'])) }}\n {{ write(sql) }}\n {%- endif -%}\n\n {%- if name is not none -%}\n {{ store_raw_result(name, message=message, code=code, rows_affected=rows_affected, agate_table=res) }}\n {%- endif -%}\n\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "name", "type": null, "description": ""}, {"name": "message", "type": null, "description": ""}, {"name": "code", "type": null, "description": ""}, {"name": "rows_affected", "type": null, "description": ""}, {"name": "res", "type": null, "description": ""}], "created_at": 1789419970.0132244, "supported_languages": null}, "macro.dbt.run_query": {"name": "run_query", "resource_type": "macro", "package_name": "dbt", "path": "macros/etc/statement.sql", "original_file_path": "macros/etc/statement.sql", "unique_id": "macro.dbt.run_query", "macro_sql": "{% macro run_query(sql) %}\n {% call statement(\"run_query_statement\", fetch_result=true, auto_begin=false) %}\n {{ sql }}\n {% endcall %}\n\n {% do return(load_result(\"run_query_statement\").table) %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "sql", "type": null, "description": ""}], "created_at": 1789419970.0137255, "supported_languages": null}, "macro.dbt.convert_datetime": {"name": "convert_datetime", "resource_type": "macro", "package_name": "dbt", "path": "macros/etc/datetime.sql", "original_file_path": "macros/etc/datetime.sql", "unique_id": "macro.dbt.convert_datetime", "macro_sql": "{% macro convert_datetime(date_str, date_fmt) %}\n\n {% set error_msg -%}\n The provided partition date '{{ date_str }}' does not match the expected format '{{ date_fmt }}'\n {%- endset %}\n\n {% set res = try_or_compiler_error(error_msg, modules.datetime.datetime.strptime, date_str.strip(), date_fmt) %}\n {{ return(res) }}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "date_str", "type": null, "description": ""}, {"name": "date_fmt", "type": null, "description": ""}], "created_at": 1789419970.0150523, "supported_languages": null}, "macro.dbt.dates_in_range": {"name": "dates_in_range", "resource_type": "macro", "package_name": "dbt", "path": "macros/etc/datetime.sql", "original_file_path": "macros/etc/datetime.sql", "unique_id": "macro.dbt.dates_in_range", "macro_sql": "{% macro dates_in_range(start_date_str, end_date_str=none, in_fmt=\"%Y%m%d\", out_fmt=\"%Y%m%d\") %}\n {% set end_date_str = start_date_str if end_date_str is none else end_date_str %}\n\n {% set start_date = convert_datetime(start_date_str, in_fmt) %}\n {% set end_date = convert_datetime(end_date_str, in_fmt) %}\n\n {% set day_count = (end_date - start_date).days %}\n {% if day_count < 0 %}\n {% set msg -%}\n Partition start date is after the end date ({{ start_date }}, {{ end_date }})\n {%- endset %}\n\n {{ exceptions.raise_compiler_error(msg, model) }}\n {% endif %}\n\n {% set date_list = [] %}\n {% for i in range(0, day_count + 1) %}\n {% set the_date = (modules.datetime.timedelta(days=i) + start_date) %}\n {% if not out_fmt %}\n {% set _ = date_list.append(the_date) %}\n {% else %}\n {% set _ = date_list.append(the_date.strftime(out_fmt)) %}\n {% endif %}\n {% endfor %}\n\n {{ return(date_list) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.convert_datetime"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "start_date_str", "type": null, "description": ""}, {"name": "end_date_str", "type": null, "description": ""}, {"name": "in_fmt", "type": null, "description": ""}, {"name": "out_fmt", "type": null, "description": ""}], "created_at": 1789419970.017063, "supported_languages": null}, "macro.dbt.partition_range": {"name": "partition_range", "resource_type": "macro", "package_name": "dbt", "path": "macros/etc/datetime.sql", "original_file_path": "macros/etc/datetime.sql", "unique_id": "macro.dbt.partition_range", "macro_sql": "{% macro partition_range(raw_partition_date, date_fmt='%Y%m%d') %}\n {% set partition_range = (raw_partition_date | string).split(\",\") %}\n\n {% if (partition_range | length) == 1 %}\n {% set start_date = partition_range[0] %}\n {% set end_date = none %}\n {% elif (partition_range | length) == 2 %}\n {% set start_date = partition_range[0] %}\n {% set end_date = partition_range[1] %}\n {% else %}\n {{ exceptions.raise_compiler_error(\"Invalid partition time. Expected format: {Start Date}[,{End Date}]. Got: \" ~ raw_partition_date) }}\n {% endif %}\n\n {{ return(dates_in_range(start_date, end_date, in_fmt=date_fmt)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.dates_in_range"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "raw_partition_date", "type": null, "description": ""}, {"name": "date_fmt", "type": null, "description": ""}], "created_at": 1789419970.018334, "supported_languages": null}, "macro.dbt.py_current_timestring": {"name": "py_current_timestring", "resource_type": "macro", "package_name": "dbt", "path": "macros/etc/datetime.sql", "original_file_path": "macros/etc/datetime.sql", "unique_id": "macro.dbt.py_current_timestring", "macro_sql": "{% macro py_current_timestring() %}\n {% set dt = modules.datetime.datetime.now() %}\n {% do return(dt.strftime(\"%Y%m%d%H%M%S%f\")) %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789419970.0187304, "supported_languages": null}, "macro.dbt.resolve_model_name": {"name": "resolve_model_name", "resource_type": "macro", "package_name": "dbt", "path": "macros/python_model/python.sql", "original_file_path": "macros/python_model/python.sql", "unique_id": "macro.dbt.resolve_model_name", "macro_sql": "{% macro resolve_model_name(input_model_name) %}\n {{ return(adapter.dispatch('resolve_model_name', 'dbt')(input_model_name)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__resolve_model_name"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "input_model_name", "type": null, "description": ""}], "created_at": 1789419970.020206, "supported_languages": null}, "macro.dbt.default__resolve_model_name": {"name": "default__resolve_model_name", "resource_type": "macro", "package_name": "dbt", "path": "macros/python_model/python.sql", "original_file_path": "macros/python_model/python.sql", "unique_id": "macro.dbt.default__resolve_model_name", "macro_sql": "\n\n{%- macro default__resolve_model_name(input_model_name) -%}\n {{ input_model_name | string | replace('\"', '\\\"') }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "input_model_name", "type": null, "description": ""}], "created_at": 1789419970.020481, "supported_languages": null}, "macro.dbt.build_ref_function": {"name": "build_ref_function", "resource_type": "macro", "package_name": "dbt", "path": "macros/python_model/python.sql", "original_file_path": "macros/python_model/python.sql", "unique_id": "macro.dbt.build_ref_function", "macro_sql": "{% macro build_ref_function(model) %}\n\n {%- set ref_dict = {} -%}\n {%- for _ref in model.refs -%}\n {% set _ref_args = [_ref.get('package'), _ref['name']] if _ref.get('package') else [_ref['name'],] %}\n {%- set resolved = ref(*_ref_args, v=_ref.get('version')) -%}\n\n {#\n We want to get the string of the returned relation by calling .render() in order to skip sample/empty\n mode rendering logic. However, people override the default ref macro, and often return a string instead\n of a relation (like the ref macro does by default). Thus, to make sure we dont blow things up, we have\n to ensure the resolved relation has a .render() method.\n #}\n {%- if resolved.render is defined and resolved.render is callable -%}\n {%- set resolved = resolved.render() -%}\n {%- endif -%}\n\n {%- if _ref.get('version') -%}\n {% do _ref_args.extend([\"v\" ~ _ref['version']]) %}\n {%- endif -%}\n {%- do ref_dict.update({_ref_args | join('.'): resolve_model_name(resolved)}) -%}\n {%- endfor -%}\n\ndef ref(*args, **kwargs):\n refs = {{ ref_dict | tojson }}\n key = '.'.join(args)\n version = kwargs.get(\"v\") or kwargs.get(\"version\")\n if version:\n key += f\".v{version}\"\n dbt_load_df_function = kwargs.get(\"dbt_load_df_function\")\n return dbt_load_df_function(refs[key])\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.resolve_model_name"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}], "created_at": 1789419970.022125, "supported_languages": null}, "macro.dbt.build_source_function": {"name": "build_source_function", "resource_type": "macro", "package_name": "dbt", "path": "macros/python_model/python.sql", "original_file_path": "macros/python_model/python.sql", "unique_id": "macro.dbt.build_source_function", "macro_sql": "{% macro build_source_function(model) %}\n\n {%- set source_dict = {} -%}\n {%- for _source in model.sources -%}\n {%- set resolved = source(*_source) -%}\n {%- do source_dict.update({_source | join('.'): resolve_model_name(resolved)}) -%}\n {%- endfor -%}\n\ndef source(*args, dbt_load_df_function):\n sources = {{ source_dict | tojson }}\n key = '.'.join(args)\n return dbt_load_df_function(sources[key])\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.resolve_model_name"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}], "created_at": 1789419970.0228443, "supported_languages": null}, "macro.dbt.build_config_dict": {"name": "build_config_dict", "resource_type": "macro", "package_name": "dbt", "path": "macros/python_model/python.sql", "original_file_path": "macros/python_model/python.sql", "unique_id": "macro.dbt.build_config_dict", "macro_sql": "{% macro build_config_dict(model) %}\n {%- set config_dict = {} -%}\n {% set config_dbt_used = zip(model.config.config_keys_used, model.config.config_keys_defaults) | list %}\n {%- for key, default in config_dbt_used -%}\n {# weird type testing with enum, would be much easier to write this logic in Python! #}\n {%- if key == \"language\" -%}\n {%- set value = \"python\" -%}\n {%- endif -%}\n {%- set value = model.config.get(key, default) -%}\n {%- do config_dict.update({key: value}) -%}\n {%- endfor -%}\n {# Handle dbt.config.meta_get() calls - use separate dict to avoid overwriting native configs #}\n {%- set meta_dict = {} -%}\n {%- if model.config.meta_keys_used -%}\n {% set meta_dbt_used = zip(model.config.meta_keys_used, model.config.meta_keys_defaults) | list %}\n {%- for key, default in meta_dbt_used -%}\n {%- if model.config.meta and key in model.config.meta -%}\n {%- set value = model.config.meta[key] -%}\n {%- else -%}\n {%- set value = default -%}\n {%- endif -%}\n {%- do meta_dict.update({key: value}) -%}\n {%- endfor -%}\n {%- endif -%}\nconfig_dict = {{ config_dict }}\nmeta_dict = {{ meta_dict }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}], "created_at": 1789419970.0248766, "supported_languages": null}, "macro.dbt.py_script_postfix": {"name": "py_script_postfix", "resource_type": "macro", "package_name": "dbt", "path": "macros/python_model/python.sql", "original_file_path": "macros/python_model/python.sql", "unique_id": "macro.dbt.py_script_postfix", "macro_sql": "{% macro py_script_postfix(model) %}\n# This part is user provided model code\n# you will need to copy the next section to run the code\n# COMMAND ----------\n# this part is dbt logic for get ref work, do not modify\n\n{{ build_ref_function(model ) }}\n{{ build_source_function(model ) }}\n{{ build_config_dict(model) }}\n\nclass config:\n def __init__(self, *args, **kwargs):\n pass\n\n @staticmethod\n def get(key, default=None):\n return config_dict.get(key, default)\n\n @staticmethod\n def meta_get(key, default=None):\n return meta_dict.get(key, default)\n\nclass this:\n \"\"\"dbt.this() or dbt.this.identifier\"\"\"\n database = \"{{ this.database }}\"\n schema = \"{{ this.schema }}\"\n identifier = \"{{ this.identifier }}\"\n {% set this_relation_name = resolve_model_name(this) %}\n def __repr__(self):\n return '{{ this_relation_name }}'\n\n\nclass dbtObj:\n def __init__(self, load_df_function) -> None:\n self.source = lambda *args: source(*args, dbt_load_df_function=load_df_function)\n self.ref = lambda *args, **kwargs: ref(*args, **kwargs, dbt_load_df_function=load_df_function)\n self.config = config\n self.this = this()\n self.is_incremental = {{ is_incremental() }}\n\n# COMMAND ----------\n{{py_script_comment()}}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.build_ref_function", "macro.dbt.build_source_function", "macro.dbt.build_config_dict", "macro.dbt.resolve_model_name", "macro.dbt.is_incremental", "macro.dbt.py_script_comment"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}], "created_at": 1789419970.0264177, "supported_languages": null}, "macro.dbt.py_script_comment": {"name": "py_script_comment", "resource_type": "macro", "package_name": "dbt", "path": "macros/python_model/python.sql", "original_file_path": "macros/python_model/python.sql", "unique_id": "macro.dbt.py_script_comment", "macro_sql": "{%macro py_script_comment()%}\n{%endmacro%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789419970.0265741, "supported_languages": null}, "macro.dbt.generate_schema_name": {"name": "generate_schema_name", "resource_type": "macro", "package_name": "dbt", "path": "macros/get_custom_name/get_custom_schema.sql", "original_file_path": "macros/get_custom_name/get_custom_schema.sql", "unique_id": "macro.dbt.generate_schema_name", "macro_sql": "{% macro generate_schema_name(custom_schema_name=none, node=none) -%}\n {{ return(adapter.dispatch('generate_schema_name', 'dbt')(custom_schema_name, node)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__generate_schema_name"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "custom_schema_name", "type": null, "description": ""}, {"name": "node", "type": null, "description": ""}], "created_at": 1789419970.0273879, "supported_languages": null}, "macro.dbt.default__generate_schema_name": {"name": "default__generate_schema_name", "resource_type": "macro", "package_name": "dbt", "path": "macros/get_custom_name/get_custom_schema.sql", "original_file_path": "macros/get_custom_name/get_custom_schema.sql", "unique_id": "macro.dbt.default__generate_schema_name", "macro_sql": "{% macro default__generate_schema_name(custom_schema_name, node) -%}\n\n {%- set default_schema = target.schema -%}\n {%- if custom_schema_name is none -%}\n\n {{ default_schema }}\n\n {%- else -%}\n\n {{ default_schema }}_{{ custom_schema_name | trim }}\n\n {%- endif -%}\n\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "custom_schema_name", "type": null, "description": ""}, {"name": "node", "type": null, "description": ""}], "created_at": 1789419970.027869, "supported_languages": null}, "macro.dbt.generate_schema_name_for_env": {"name": "generate_schema_name_for_env", "resource_type": "macro", "package_name": "dbt", "path": "macros/get_custom_name/get_custom_schema.sql", "original_file_path": "macros/get_custom_name/get_custom_schema.sql", "unique_id": "macro.dbt.generate_schema_name_for_env", "macro_sql": "{% macro generate_schema_name_for_env(custom_schema_name, node) -%}\n\n {%- set default_schema = target.schema -%}\n {%- if target.name == 'prod' and custom_schema_name is not none -%}\n\n {{ custom_schema_name | trim }}\n\n {%- else -%}\n\n {{ default_schema }}\n\n {%- endif -%}\n\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "custom_schema_name", "type": null, "description": ""}, {"name": "node", "type": null, "description": ""}], "created_at": 1789419970.0283597, "supported_languages": null}, "macro.dbt.generate_latest_version_pointer_alias": {"name": "generate_latest_version_pointer_alias", "resource_type": "macro", "package_name": "dbt", "path": "macros/get_custom_name/get_latest_version_pointer_alias.sql", "original_file_path": "macros/get_custom_name/get_latest_version_pointer_alias.sql", "unique_id": "macro.dbt.generate_latest_version_pointer_alias", "macro_sql": "{% macro generate_latest_version_pointer_alias(custom_alias_name=none, node=none) -%}\n {% do return(adapter.dispatch('generate_latest_version_pointer_alias', 'dbt')(custom_alias_name, node)) %}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__generate_latest_version_pointer_alias"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "custom_alias_name", "type": null, "description": ""}, {"name": "node", "type": null, "description": ""}], "created_at": 1789419970.0290043, "supported_languages": null}, "macro.dbt.default__generate_latest_version_pointer_alias": {"name": "default__generate_latest_version_pointer_alias", "resource_type": "macro", "package_name": "dbt", "path": "macros/get_custom_name/get_latest_version_pointer_alias.sql", "original_file_path": "macros/get_custom_name/get_latest_version_pointer_alias.sql", "unique_id": "macro.dbt.default__generate_latest_version_pointer_alias", "macro_sql": "{% macro default__generate_latest_version_pointer_alias(custom_alias_name=none, node=none) -%}\n {%- if custom_alias_name -%}\n {{ custom_alias_name | trim }}\n {%- else -%}\n {{ node.name }}\n {%- endif -%}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "custom_alias_name", "type": null, "description": ""}, {"name": "node", "type": null, "description": ""}], "created_at": 1789419970.0293775, "supported_languages": null}, "macro.dbt.generate_database_name": {"name": "generate_database_name", "resource_type": "macro", "package_name": "dbt", "path": "macros/get_custom_name/get_custom_database.sql", "original_file_path": "macros/get_custom_name/get_custom_database.sql", "unique_id": "macro.dbt.generate_database_name", "macro_sql": "{% macro generate_database_name(custom_database_name=none, node=none) -%}\n {% do return(adapter.dispatch('generate_database_name', 'dbt')(custom_database_name, node)) %}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__generate_database_name"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "custom_database_name", "type": null, "description": ""}, {"name": "node", "type": null, "description": ""}], "created_at": 1789419970.030082, "supported_languages": null}, "macro.dbt.default__generate_database_name": {"name": "default__generate_database_name", "resource_type": "macro", "package_name": "dbt", "path": "macros/get_custom_name/get_custom_database.sql", "original_file_path": "macros/get_custom_name/get_custom_database.sql", "unique_id": "macro.dbt.default__generate_database_name", "macro_sql": "{% macro default__generate_database_name(custom_database_name=none, node=none) -%}\n {%- set default_database = target.database -%}\n {%- if node is not none and node|attr('database') -%}\n {%- set catalog_relation = adapter.build_catalog_relation(node) -%}\n {%- if catalog_relation and catalog_relation|attr('catalog_database') -%}\n {{ return(catalog_relation.catalog_database) }}\n {%- endif -%}\n {%- endif -%}\n {%- if custom_database_name is none -%}\n\n {{ default_database }}\n\n {%- else -%}\n\n {{ custom_database_name }}\n\n {%- endif -%}\n\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "custom_database_name", "type": null, "description": ""}, {"name": "node", "type": null, "description": ""}], "created_at": 1789419970.0309992, "supported_languages": null}, "macro.dbt.generate_alias_name": {"name": "generate_alias_name", "resource_type": "macro", "package_name": "dbt", "path": "macros/get_custom_name/get_custom_alias.sql", "original_file_path": "macros/get_custom_name/get_custom_alias.sql", "unique_id": "macro.dbt.generate_alias_name", "macro_sql": "{% macro generate_alias_name(custom_alias_name=none, node=none) -%}\n {% do return(adapter.dispatch('generate_alias_name', 'dbt')(custom_alias_name, node)) %}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__generate_alias_name"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "custom_alias_name", "type": null, "description": ""}, {"name": "node", "type": null, "description": ""}], "created_at": 1789419970.0316403, "supported_languages": null}, "macro.dbt.default__generate_alias_name": {"name": "default__generate_alias_name", "resource_type": "macro", "package_name": "dbt", "path": "macros/get_custom_name/get_custom_alias.sql", "original_file_path": "macros/get_custom_name/get_custom_alias.sql", "unique_id": "macro.dbt.default__generate_alias_name", "macro_sql": "{% macro default__generate_alias_name(custom_alias_name=none, node=none) -%}\n\n {%- if custom_alias_name -%}\n\n {{ custom_alias_name | trim }}\n\n {%- elif node.version -%}\n\n {{ return(node.name ~ \"_v\" ~ (node.version | replace(\".\", \"_\"))) }}\n\n {%- else -%}\n\n {{ node.name }}\n\n {%- endif -%}\n\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "custom_alias_name", "type": null, "description": ""}, {"name": "node", "type": null, "description": ""}], "created_at": 1789419970.0322967, "supported_languages": null}, "macro.dbt.get_show_sql": {"name": "get_show_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/show.sql", "original_file_path": "macros/adapters/show.sql", "unique_id": "macro.dbt.get_show_sql", "macro_sql": "{% macro get_show_sql(compiled_code, sql_header, limit) -%}\n {%- if sql_header is not none -%}\n {{ sql_header }}\n {%- endif %}\n {{ get_limit_subquery_sql(compiled_code, limit) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_limit_subquery_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "compiled_code", "type": null, "description": ""}, {"name": "sql_header", "type": null, "description": ""}, {"name": "limit", "type": null, "description": ""}], "created_at": 1789419970.0329645, "supported_languages": null}, "macro.dbt.get_limit_subquery_sql": {"name": "get_limit_subquery_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/show.sql", "original_file_path": "macros/adapters/show.sql", "unique_id": "macro.dbt.get_limit_subquery_sql", "macro_sql": "\n{%- macro get_limit_subquery_sql(sql, limit) -%}\n {{ adapter.dispatch('get_limit_sql', 'dbt')(sql, limit) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt.default__get_limit_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "sql", "type": null, "description": ""}, {"name": "limit", "type": null, "description": ""}], "created_at": 1789419970.0332882, "supported_languages": null}, "macro.dbt.default__get_limit_sql": {"name": "default__get_limit_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/show.sql", "original_file_path": "macros/adapters/show.sql", "unique_id": "macro.dbt.default__get_limit_sql", "macro_sql": "{% macro default__get_limit_sql(sql, limit) %}\n {{ sql }}\n {% if limit is not none %}\n limit {{ limit }}\n {%- endif -%}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "sql", "type": null, "description": ""}, {"name": "limit", "type": null, "description": ""}], "created_at": 1789419970.0336146, "supported_languages": null}, "macro.dbt.current_timestamp": {"name": "current_timestamp", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/timestamps.sql", "original_file_path": "macros/adapters/timestamps.sql", "unique_id": "macro.dbt.current_timestamp", "macro_sql": "{%- macro current_timestamp() -%}\n {{ adapter.dispatch('current_timestamp', 'dbt')() }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt_postgres.postgres__current_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789419970.0344322, "supported_languages": null}, "macro.dbt.default__current_timestamp": {"name": "default__current_timestamp", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/timestamps.sql", "original_file_path": "macros/adapters/timestamps.sql", "unique_id": "macro.dbt.default__current_timestamp", "macro_sql": "{% macro default__current_timestamp() -%}\n {{ exceptions.raise_not_implemented(\n 'current_timestamp macro not implemented for adapter ' + adapter.type()) }}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789419970.034704, "supported_languages": null}, "macro.dbt.snapshot_get_time": {"name": "snapshot_get_time", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/timestamps.sql", "original_file_path": "macros/adapters/timestamps.sql", "unique_id": "macro.dbt.snapshot_get_time", "macro_sql": "\n\n{%- macro snapshot_get_time() -%}\n {{ adapter.dispatch('snapshot_get_time', 'dbt')() }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt_postgres.postgres__snapshot_get_time"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789419970.0351, "supported_languages": null}, "macro.dbt.default__snapshot_get_time": {"name": "default__snapshot_get_time", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/timestamps.sql", "original_file_path": "macros/adapters/timestamps.sql", "unique_id": "macro.dbt.default__snapshot_get_time", "macro_sql": "{% macro default__snapshot_get_time() %}\n {{ current_timestamp() }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.current_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789419970.0352936, "supported_languages": null}, "macro.dbt.get_snapshot_get_time_data_type": {"name": "get_snapshot_get_time_data_type", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/timestamps.sql", "original_file_path": "macros/adapters/timestamps.sql", "unique_id": "macro.dbt.get_snapshot_get_time_data_type", "macro_sql": "{% macro get_snapshot_get_time_data_type() %}\n {% set snapshot_time = adapter.dispatch('snapshot_get_time', 'dbt')() %}\n {% set time_data_type_sql = 'select ' ~ snapshot_time ~ ' as dbt_snapshot_time' %}\n {% set snapshot_time_column_schema = get_column_schema_from_query(time_data_type_sql) %}\n {% set time_data_type = snapshot_time_column_schema[0].dtype %}\n {{ return(time_data_type or none) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.snapshot_get_time", "macro.dbt_postgres.postgres__snapshot_get_time", "macro.dbt.get_column_schema_from_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789419970.0360167, "supported_languages": null}, "macro.dbt.current_timestamp_backcompat": {"name": "current_timestamp_backcompat", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/timestamps.sql", "original_file_path": "macros/adapters/timestamps.sql", "unique_id": "macro.dbt.current_timestamp_backcompat", "macro_sql": "{% macro current_timestamp_backcompat() %}\n {{ return(adapter.dispatch('current_timestamp_backcompat', 'dbt')()) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__current_timestamp_backcompat"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789419970.0363114, "supported_languages": null}, "macro.dbt.default__current_timestamp_backcompat": {"name": "default__current_timestamp_backcompat", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/timestamps.sql", "original_file_path": "macros/adapters/timestamps.sql", "unique_id": "macro.dbt.default__current_timestamp_backcompat", "macro_sql": "{% macro default__current_timestamp_backcompat() %}\n current_timestamp::timestamp\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789419970.0364454, "supported_languages": null}, "macro.dbt.current_timestamp_in_utc_backcompat": {"name": "current_timestamp_in_utc_backcompat", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/timestamps.sql", "original_file_path": "macros/adapters/timestamps.sql", "unique_id": "macro.dbt.current_timestamp_in_utc_backcompat", "macro_sql": "{% macro current_timestamp_in_utc_backcompat() %}\n {{ return(adapter.dispatch('current_timestamp_in_utc_backcompat', 'dbt')()) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__current_timestamp_in_utc_backcompat"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789419970.0367174, "supported_languages": null}, "macro.dbt.default__current_timestamp_in_utc_backcompat": {"name": "default__current_timestamp_in_utc_backcompat", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/timestamps.sql", "original_file_path": "macros/adapters/timestamps.sql", "unique_id": "macro.dbt.default__current_timestamp_in_utc_backcompat", "macro_sql": "{% macro default__current_timestamp_in_utc_backcompat() %}\n {{ return(adapter.dispatch('current_timestamp_backcompat', 'dbt')()) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.current_timestamp_backcompat", "macro.dbt_postgres.postgres__current_timestamp_backcompat"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789419970.037009, "supported_languages": null}, "macro.dbt.create_schema": {"name": "create_schema", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/schema.sql", "original_file_path": "macros/adapters/schema.sql", "unique_id": "macro.dbt.create_schema", "macro_sql": "{% macro create_schema(relation) -%}\n {{ adapter.dispatch('create_schema', 'dbt')(relation) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__create_schema"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789419970.0375476, "supported_languages": null}, "macro.dbt.default__create_schema": {"name": "default__create_schema", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/schema.sql", "original_file_path": "macros/adapters/schema.sql", "unique_id": "macro.dbt.default__create_schema", "macro_sql": "{% macro default__create_schema(relation) -%}\n {%- call statement('create_schema') -%}\n create schema if not exists {{ relation.without_identifier() }}\n {% endcall %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789419970.0378861, "supported_languages": null}, "macro.dbt.drop_schema": {"name": "drop_schema", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/schema.sql", "original_file_path": "macros/adapters/schema.sql", "unique_id": "macro.dbt.drop_schema", "macro_sql": "{% macro drop_schema(relation) -%}\n {{ adapter.dispatch('drop_schema', 'dbt')(relation) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__drop_schema"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789419970.0381587, "supported_languages": null}, "macro.dbt.default__drop_schema": {"name": "default__drop_schema", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/schema.sql", "original_file_path": "macros/adapters/schema.sql", "unique_id": "macro.dbt.default__drop_schema", "macro_sql": "{% macro default__drop_schema(relation) -%}\n {%- call statement('drop_schema') -%}\n drop schema if exists {{ relation.without_identifier() }} cascade\n {% endcall %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789419970.0384579, "supported_languages": null}, "macro.dbt.copy_grants": {"name": "copy_grants", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "unique_id": "macro.dbt.copy_grants", "macro_sql": "{% macro copy_grants() %}\n {{ return(adapter.dispatch('copy_grants', 'dbt')()) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__copy_grants"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789419970.040408, "supported_languages": null}, "macro.dbt.default__copy_grants": {"name": "default__copy_grants", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "unique_id": "macro.dbt.default__copy_grants", "macro_sql": "{% macro default__copy_grants() %}\n {{ return(True) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789419970.0406137, "supported_languages": null}, "macro.dbt.support_multiple_grantees_per_dcl_statement": {"name": "support_multiple_grantees_per_dcl_statement", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "unique_id": "macro.dbt.support_multiple_grantees_per_dcl_statement", "macro_sql": "{% macro support_multiple_grantees_per_dcl_statement() %}\n {{ return(adapter.dispatch('support_multiple_grantees_per_dcl_statement', 'dbt')()) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__support_multiple_grantees_per_dcl_statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789419970.0409005, "supported_languages": null}, "macro.dbt.default__support_multiple_grantees_per_dcl_statement": {"name": "default__support_multiple_grantees_per_dcl_statement", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "unique_id": "macro.dbt.default__support_multiple_grantees_per_dcl_statement", "macro_sql": "\n\n{%- macro default__support_multiple_grantees_per_dcl_statement() -%}\n {{ return(True) }}\n{%- endmacro -%}\n\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789419970.0410933, "supported_languages": null}, "macro.dbt.should_revoke": {"name": "should_revoke", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "unique_id": "macro.dbt.should_revoke", "macro_sql": "{% macro should_revoke(existing_relation, full_refresh_mode=True) %}\n\n {% if not existing_relation %}\n {#-- The table doesn't already exist, so no grants to copy over --#}\n {{ return(False) }}\n {% elif full_refresh_mode %}\n {#-- The object is being REPLACED -- whether grants are copied over depends on the value of user config --#}\n {{ return(copy_grants()) }}\n {% else %}\n {#-- The table is being merged/upserted/inserted -- grants will be carried over --#}\n {{ return(True) }}\n {% endif %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.copy_grants"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "existing_relation", "type": null, "description": ""}, {"name": "full_refresh_mode", "type": null, "description": ""}], "created_at": 1789419970.0418012, "supported_languages": null}, "macro.dbt.get_show_grant_sql": {"name": "get_show_grant_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "unique_id": "macro.dbt.get_show_grant_sql", "macro_sql": "{% macro get_show_grant_sql(relation) %}\n {{ return(adapter.dispatch(\"get_show_grant_sql\", \"dbt\")(relation)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__get_show_grant_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789419970.0421302, "supported_languages": null}, "macro.dbt.default__get_show_grant_sql": {"name": "default__get_show_grant_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "unique_id": "macro.dbt.default__get_show_grant_sql", "macro_sql": "{% macro default__get_show_grant_sql(relation) %}\n show grants on {{ relation.render() }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789419970.0423384, "supported_languages": null}, "macro.dbt.get_grant_sql": {"name": "get_grant_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "unique_id": "macro.dbt.get_grant_sql", "macro_sql": "{% macro get_grant_sql(relation, privilege, grantees) %}\n {{ return(adapter.dispatch('get_grant_sql', 'dbt')(relation, privilege, grantees)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_grant_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "privilege", "type": null, "description": ""}, {"name": "grantees", "type": null, "description": ""}], "created_at": 1789419970.0427134, "supported_languages": null}, "macro.dbt.default__get_grant_sql": {"name": "default__get_grant_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "unique_id": "macro.dbt.default__get_grant_sql", "macro_sql": "\n\n{%- macro default__get_grant_sql(relation, privilege, grantees) -%}\n grant {{ privilege }} on {{ relation.render() }} to {{ grantees | join(', ') }}\n{%- endmacro -%}\n\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "privilege", "type": null, "description": ""}, {"name": "grantees", "type": null, "description": ""}], "created_at": 1789419970.0430818, "supported_languages": null}, "macro.dbt.get_revoke_sql": {"name": "get_revoke_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "unique_id": "macro.dbt.get_revoke_sql", "macro_sql": "{% macro get_revoke_sql(relation, privilege, grantees) %}\n {{ return(adapter.dispatch('get_revoke_sql', 'dbt')(relation, privilege, grantees)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_revoke_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "privilege", "type": null, "description": ""}, {"name": "grantees", "type": null, "description": ""}], "created_at": 1789419970.043477, "supported_languages": null}, "macro.dbt.default__get_revoke_sql": {"name": "default__get_revoke_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "unique_id": "macro.dbt.default__get_revoke_sql", "macro_sql": "\n\n{%- macro default__get_revoke_sql(relation, privilege, grantees) -%}\n {%- set quoted_grantees = [] -%}\n {%- for grantee in grantees -%}\n {%- do quoted_grantees.append(adapter.quote(grantee)) -%}\n {%- endfor -%}\n revoke {{ privilege }} on {{ relation.render() }} from {{ quoted_grantees | join(', ') }}\n{%- endmacro -%}\n\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "privilege", "type": null, "description": ""}, {"name": "grantees", "type": null, "description": ""}], "created_at": 1789419970.0441334, "supported_languages": null}, "macro.dbt.get_dcl_statement_list": {"name": "get_dcl_statement_list", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "unique_id": "macro.dbt.get_dcl_statement_list", "macro_sql": "{% macro get_dcl_statement_list(relation, grant_config, get_dcl_macro) %}\n {{ return(adapter.dispatch('get_dcl_statement_list', 'dbt')(relation, grant_config, get_dcl_macro)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_dcl_statement_list"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "grant_config", "type": null, "description": ""}, {"name": "get_dcl_macro", "type": null, "description": ""}], "created_at": 1789419970.0445328, "supported_languages": null}, "macro.dbt.default__get_dcl_statement_list": {"name": "default__get_dcl_statement_list", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "unique_id": "macro.dbt.default__get_dcl_statement_list", "macro_sql": "\n\n{%- macro default__get_dcl_statement_list(relation, grant_config, get_dcl_macro) -%}\n {#\n -- Unpack grant_config into specific privileges and the set of users who need them granted/revoked.\n -- Depending on whether this database supports multiple grantees per statement, pass in the list of\n -- all grantees per privilege, or (if not) template one statement per privilege-grantee pair.\n -- `get_dcl_macro` will be either `get_grant_sql` or `get_revoke_sql`\n #}\n {%- set dcl_statements = [] -%}\n {%- for privilege, grantees in grant_config.items() %}\n {%- if support_multiple_grantees_per_dcl_statement() and grantees -%}\n {%- set dcl = get_dcl_macro(relation, privilege, grantees) -%}\n {%- do dcl_statements.append(dcl) -%}\n {%- else -%}\n {%- for grantee in grantees -%}\n {% set dcl = get_dcl_macro(relation, privilege, [grantee]) %}\n {%- do dcl_statements.append(dcl) -%}\n {% endfor -%}\n {%- endif -%}\n {%- endfor -%}\n {{ return(dcl_statements) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.support_multiple_grantees_per_dcl_statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "grant_config", "type": null, "description": ""}, {"name": "get_dcl_macro", "type": null, "description": ""}], "created_at": 1789419970.0456746, "supported_languages": null}, "macro.dbt.call_dcl_statements": {"name": "call_dcl_statements", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "unique_id": "macro.dbt.call_dcl_statements", "macro_sql": "{% macro call_dcl_statements(dcl_statement_list) %}\n {{ return(adapter.dispatch(\"call_dcl_statements\", \"dbt\")(dcl_statement_list)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__call_dcl_statements"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "dcl_statement_list", "type": null, "description": ""}], "created_at": 1789419970.0460289, "supported_languages": null}, "macro.dbt.default__call_dcl_statements": {"name": "default__call_dcl_statements", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "unique_id": "macro.dbt.default__call_dcl_statements", "macro_sql": "{% macro default__call_dcl_statements(dcl_statement_list) %}\n {#\n -- By default, supply all grant + revoke statements in a single semicolon-separated block,\n -- so that they're all processed together.\n\n -- Some databases do not support this. Those adapters will need to override this macro\n -- to run each statement individually.\n #}\n {% call statement('grants') %}\n {% for dcl_statement in dcl_statement_list %}\n {{ dcl_statement }};\n {% endfor %}\n {% endcall %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "dcl_statement_list", "type": null, "description": ""}], "created_at": 1789419970.0464423, "supported_languages": null}, "macro.dbt.apply_grants": {"name": "apply_grants", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "unique_id": "macro.dbt.apply_grants", "macro_sql": "{% macro apply_grants(relation, grant_config, should_revoke) %}\n {{ return(adapter.dispatch(\"apply_grants\", \"dbt\")(relation, grant_config, should_revoke)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__apply_grants"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "grant_config", "type": null, "description": ""}, {"name": "should_revoke", "type": null, "description": ""}], "created_at": 1789419970.046846, "supported_languages": null}, "macro.dbt.default__apply_grants": {"name": "default__apply_grants", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "unique_id": "macro.dbt.default__apply_grants", "macro_sql": "{% macro default__apply_grants(relation, grant_config, should_revoke=True) %}\n {#-- If grant_config is {} or None, this is a no-op --#}\n {% if grant_config %}\n {% if should_revoke %}\n {#-- We think previous grants may have carried over --#}\n {#-- Show current grants and calculate diffs --#}\n {% set current_grants_table = run_query(get_show_grant_sql(relation)) %}\n {% set current_grants_dict = adapter.standardize_grants_dict(current_grants_table) %}\n {% set needs_granting = diff_of_two_dicts(grant_config, current_grants_dict) %}\n {% set needs_revoking = diff_of_two_dicts(current_grants_dict, grant_config) %}\n {% if not (needs_granting or needs_revoking) %}\n {{ log('On ' ~ relation.render() ~': All grants are in place, no revocation or granting needed.')}}\n {% endif %}\n {% else %}\n {#-- We don't think there's any chance of previous grants having carried over. --#}\n {#-- Jump straight to granting what the user has configured. --#}\n {% set needs_revoking = {} %}\n {% set needs_granting = grant_config %}\n {% endif %}\n {% if needs_granting or needs_revoking %}\n {% set revoke_statement_list = get_dcl_statement_list(relation, needs_revoking, get_revoke_sql) %}\n {% set grant_statement_list = get_dcl_statement_list(relation, needs_granting, get_grant_sql) %}\n {% set dcl_statement_list = revoke_statement_list + grant_statement_list %}\n {% if dcl_statement_list %}\n {{ call_dcl_statements(dcl_statement_list) }}\n {% endif %}\n {% endif %}\n {% endif %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.run_query", "macro.dbt.get_show_grant_sql", "macro.dbt.get_dcl_statement_list", "macro.dbt.call_dcl_statements"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "grant_config", "type": null, "description": ""}, {"name": "should_revoke", "type": null, "description": ""}], "created_at": 1789419970.0488684, "supported_languages": null}, "macro.dbt.is_core_v2": {"name": "is_core_v2", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/runtime.sql", "original_file_path": "macros/adapters/runtime.sql", "unique_id": "macro.dbt.is_core_v2", "macro_sql": "{% macro is_core_v2() -%}\n {%- set major_version = (dbt_version.split('.') | first) | int -%}\n {{ return(major_version == 2) }}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789419970.0494182, "supported_languages": null}, "macro.dbt.alter_column_comment": {"name": "alter_column_comment", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/persist_docs.sql", "original_file_path": "macros/adapters/persist_docs.sql", "unique_id": "macro.dbt.alter_column_comment", "macro_sql": "{% macro alter_column_comment(relation, column_dict) -%}\n {{ return(adapter.dispatch('alter_column_comment', 'dbt')(relation, column_dict)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__alter_column_comment"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "column_dict", "type": null, "description": ""}], "created_at": 1789419970.0505648, "supported_languages": null}, "macro.dbt.default__alter_column_comment": {"name": "default__alter_column_comment", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/persist_docs.sql", "original_file_path": "macros/adapters/persist_docs.sql", "unique_id": "macro.dbt.default__alter_column_comment", "macro_sql": "{% macro default__alter_column_comment(relation, column_dict) -%}\n {{ exceptions.raise_not_implemented(\n 'alter_column_comment macro not implemented for adapter '+adapter.type()) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "column_dict", "type": null, "description": ""}], "created_at": 1789419970.0508785, "supported_languages": null}, "macro.dbt.alter_relation_comment": {"name": "alter_relation_comment", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/persist_docs.sql", "original_file_path": "macros/adapters/persist_docs.sql", "unique_id": "macro.dbt.alter_relation_comment", "macro_sql": "{% macro alter_relation_comment(relation, relation_comment) -%}\n {{ return(adapter.dispatch('alter_relation_comment', 'dbt')(relation, relation_comment)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__alter_relation_comment"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "relation_comment", "type": null, "description": ""}], "created_at": 1789419970.0512254, "supported_languages": null}, "macro.dbt.default__alter_relation_comment": {"name": "default__alter_relation_comment", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/persist_docs.sql", "original_file_path": "macros/adapters/persist_docs.sql", "unique_id": "macro.dbt.default__alter_relation_comment", "macro_sql": "{% macro default__alter_relation_comment(relation, relation_comment) -%}\n {{ exceptions.raise_not_implemented(\n 'alter_relation_comment macro not implemented for adapter '+adapter.type()) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "relation_comment", "type": null, "description": ""}], "created_at": 1789419970.0515165, "supported_languages": null}, "macro.dbt.persist_docs": {"name": "persist_docs", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/persist_docs.sql", "original_file_path": "macros/adapters/persist_docs.sql", "unique_id": "macro.dbt.persist_docs", "macro_sql": "{% macro persist_docs(relation, model, for_relation=true, for_columns=true) -%}\n {{ return(adapter.dispatch('persist_docs', 'dbt')(relation, model, for_relation, for_columns)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__persist_docs"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "model", "type": null, "description": ""}, {"name": "for_relation", "type": null, "description": ""}, {"name": "for_columns", "type": null, "description": ""}], "created_at": 1789419970.0519845, "supported_languages": null}, "macro.dbt.validate_doc_columns": {"name": "validate_doc_columns", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/persist_docs.sql", "original_file_path": "macros/adapters/persist_docs.sql", "unique_id": "macro.dbt.validate_doc_columns", "macro_sql": "{% macro validate_doc_columns(relation, column_dict, existing_column_names) %}\n {% set existing_lower = existing_column_names | map(\"lower\") | list %}\n {% set missing = [] %}\n {% set filtered = {} %}\n {% for col_name in column_dict %}\n {% set is_quoted = column_dict[col_name]['quote'] %}\n {% if is_quoted %}\n {% set present = col_name in existing_column_names %}\n {% else %}\n {% set present = col_name | lower in existing_lower %}\n {% endif %}\n {% if present %}\n {% do filtered.update({col_name: column_dict[col_name]}) %}\n {% else %}\n {% do missing.append(col_name) %}\n {% endif %}\n {% endfor %}\n {% if missing | length > 0 %}\n {{ exceptions.warn(\"In relation \" ~ relation.render() ~ \": The following columns are specified in the schema but are not present in the database: \" ~ missing | join(\", \")) }}\n {% endif %}\n {{ return(filtered) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "column_dict", "type": null, "description": ""}, {"name": "existing_column_names", "type": null, "description": ""}], "created_at": 1789419970.0537276, "supported_languages": null}, "macro.dbt.default__persist_docs": {"name": "default__persist_docs", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/persist_docs.sql", "original_file_path": "macros/adapters/persist_docs.sql", "unique_id": "macro.dbt.default__persist_docs", "macro_sql": "{% macro default__persist_docs(relation, model, for_relation, for_columns) -%}\n {% if for_relation and config.persist_relation_docs() and model.description %}\n {% do run_query(alter_relation_comment(relation, model.description)) %}\n {% endif %}\n\n {% if for_columns and config.persist_column_docs() and model.columns %}\n {% set existing_columns = adapter.get_columns_in_relation(relation) | map(attribute=\"name\") | list %}\n {% set filtered_columns = validate_doc_columns(relation, model.columns, existing_columns) %}\n {% set alter_comment_sql = alter_column_comment(relation, filtered_columns) %}\n {% if alter_comment_sql and alter_comment_sql | trim | length > 0 %}\n {% do run_query(alter_comment_sql) %}\n {% endif %}\n {% endif %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.run_query", "macro.dbt.alter_relation_comment", "macro.dbt.validate_doc_columns", "macro.dbt.alter_column_comment"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "model", "type": null, "description": ""}, {"name": "for_relation", "type": null, "description": ""}, {"name": "for_columns", "type": null, "description": ""}], "created_at": 1789419970.0552213, "supported_languages": null}, "macro.dbt.get_columns_in_relation": {"name": "get_columns_in_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "unique_id": "macro.dbt.get_columns_in_relation", "macro_sql": "{% macro get_columns_in_relation(relation) -%}\n {{ return(adapter.dispatch('get_columns_in_relation', 'dbt')(relation)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__get_columns_in_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789419970.0573475, "supported_languages": null}, "macro.dbt.default__get_columns_in_relation": {"name": "default__get_columns_in_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "unique_id": "macro.dbt.default__get_columns_in_relation", "macro_sql": "{% macro default__get_columns_in_relation(relation) -%}\n {{ exceptions.raise_not_implemented(\n 'get_columns_in_relation macro not implemented for adapter '+adapter.type()) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789419970.057635, "supported_languages": null}, "macro.dbt.sql_convert_columns_in_relation": {"name": "sql_convert_columns_in_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "unique_id": "macro.dbt.sql_convert_columns_in_relation", "macro_sql": "{% macro sql_convert_columns_in_relation(table) -%}\n {% set columns = [] %}\n {% for row in table %}\n {% do columns.append(api.Column(*row)) %}\n {% endfor %}\n {{ return(columns) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "table", "type": null, "description": ""}], "created_at": 1789419970.0581777, "supported_languages": null}, "macro.dbt.get_list_of_column_names": {"name": "get_list_of_column_names", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "unique_id": "macro.dbt.get_list_of_column_names", "macro_sql": "\n\n{%- macro get_list_of_column_names(columns) -%}\n {% set col_names = [] %}\n {% for col in columns %}\n {% do col_names.append(col.name) %}\n {% endfor %}\n {{ return(col_names) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "columns", "type": null, "description": ""}], "created_at": 1789419970.0586672, "supported_languages": null}, "macro.dbt.get_empty_subquery_sql": {"name": "get_empty_subquery_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "unique_id": "macro.dbt.get_empty_subquery_sql", "macro_sql": "{% macro get_empty_subquery_sql(select_sql, select_sql_header=none) -%}\n {{ return(adapter.dispatch('get_empty_subquery_sql', 'dbt')(select_sql, select_sql_header)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_empty_subquery_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "select_sql", "type": null, "description": ""}, {"name": "select_sql_header", "type": null, "description": ""}], "created_at": 1789419970.0590475, "supported_languages": null}, "macro.dbt.default__get_empty_subquery_sql": {"name": "default__get_empty_subquery_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "unique_id": "macro.dbt.default__get_empty_subquery_sql", "macro_sql": "{% macro default__get_empty_subquery_sql(select_sql, select_sql_header=none) %}\n {%- if select_sql_header is not none -%}\n {{ select_sql_header }}\n {%- endif -%}\n select * from (\n {{ select_sql }}\n ) as __dbt_sbq\n where false\n limit 0\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "select_sql", "type": null, "description": ""}, {"name": "select_sql_header", "type": null, "description": ""}], "created_at": 1789419970.059394, "supported_languages": null}, "macro.dbt.get_empty_schema_sql": {"name": "get_empty_schema_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "unique_id": "macro.dbt.get_empty_schema_sql", "macro_sql": "{% macro get_empty_schema_sql(columns) -%}\n {{ return(adapter.dispatch('get_empty_schema_sql', 'dbt')(columns)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_empty_schema_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "columns", "type": null, "description": ""}], "created_at": 1789419970.0596964, "supported_languages": null}, "macro.dbt.default__get_empty_schema_sql": {"name": "default__get_empty_schema_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "unique_id": "macro.dbt.default__get_empty_schema_sql", "macro_sql": "{% macro default__get_empty_schema_sql(columns) %}\n {%- set col_err = [] -%}\n {%- set col_naked_numeric = [] -%}\n select\n {% for i in columns %}\n {%- set col = columns[i] -%}\n {%- if col['data_type'] is not defined -%}\n {%- do col_err.append(col['name']) -%}\n {#-- If this column's type is just 'numeric' then it is missing precision/scale, raise a warning --#}\n {%- elif col['data_type'].strip().lower() in ('numeric', 'decimal', 'number') -%}\n {%- do col_naked_numeric.append(col['name']) -%}\n {%- endif -%}\n {% set col_name = adapter.quote(col['name']) if col.get('quote') else col['name'] %}\n {{ cast('null', col['data_type']) }} as {{ col_name }}{{ \", \" if not loop.last }}\n {%- endfor -%}\n {%- if (col_err | length) > 0 -%}\n {{ exceptions.column_type_missing(column_names=col_err) }}\n {%- elif (col_naked_numeric | length) > 0 -%}\n {{ exceptions.warn(\"Detected columns with numeric type and unspecified precision/scale, this can lead to unintended rounding: \" ~ col_naked_numeric ~ \"`\") }}\n {%- endif -%}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.cast"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "columns", "type": null, "description": ""}], "created_at": 1789419970.0616338, "supported_languages": null}, "macro.dbt.get_column_schema_from_query": {"name": "get_column_schema_from_query", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "unique_id": "macro.dbt.get_column_schema_from_query", "macro_sql": "{% macro get_column_schema_from_query(select_sql, select_sql_header=none) -%}\n {% set columns = [] %}\n {# -- Using an 'empty subquery' here to get the same schema as the given select_sql statement, without necessitating a data scan.#}\n {% set sql = get_empty_subquery_sql(select_sql, select_sql_header) %}\n {% set column_schema = adapter.get_column_schema_from_query(sql) %}\n {{ return(column_schema) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_empty_subquery_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "select_sql", "type": null, "description": ""}, {"name": "select_sql_header", "type": null, "description": ""}], "created_at": 1789419970.0622218, "supported_languages": null}, "macro.dbt.get_columns_in_query": {"name": "get_columns_in_query", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "unique_id": "macro.dbt.get_columns_in_query", "macro_sql": "{% macro get_columns_in_query(select_sql) -%}\n {{ return(adapter.dispatch('get_columns_in_query', 'dbt')(select_sql)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_columns_in_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "select_sql", "type": null, "description": ""}], "created_at": 1789419970.0625303, "supported_languages": null}, "macro.dbt.default__get_columns_in_query": {"name": "default__get_columns_in_query", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "unique_id": "macro.dbt.default__get_columns_in_query", "macro_sql": "{% macro default__get_columns_in_query(select_sql) %}\n {% call statement('get_columns_in_query', fetch_result=True, auto_begin=False) -%}\n {{ get_empty_subquery_sql(select_sql) }}\n {% endcall %}\n {{ return(load_result('get_columns_in_query').table.columns | map(attribute='name') | list) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement", "macro.dbt.get_empty_subquery_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "select_sql", "type": null, "description": ""}], "created_at": 1789419970.0631173, "supported_languages": null}, "macro.dbt.alter_column_type": {"name": "alter_column_type", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "unique_id": "macro.dbt.alter_column_type", "macro_sql": "{% macro alter_column_type(relation, column_name, new_column_type) -%}\n {{ return(adapter.dispatch('alter_column_type', 'dbt')(relation, column_name, new_column_type)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__alter_column_type"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "column_name", "type": null, "description": ""}, {"name": "new_column_type", "type": null, "description": ""}], "created_at": 1789419970.0635023, "supported_languages": null}, "macro.dbt.default__alter_column_type": {"name": "default__alter_column_type", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "unique_id": "macro.dbt.default__alter_column_type", "macro_sql": "{% macro default__alter_column_type(relation, column_name, new_column_type) -%}\n {#\n 1. Create a new column (w/ temp name and correct type)\n 2. Copy data over to it\n 3. Drop the existing column (cascade!)\n 4. Rename the new column to existing column\n #}\n {%- set tmp_column = column_name + \"__dbt_alter\" -%}\n\n {% call statement('alter_column_type') %}\n alter table {{ relation.render() }} add column {{ adapter.quote(tmp_column) }} {{ new_column_type }};\n update {{ relation.render() }} set {{ adapter.quote(tmp_column) }} = {{ adapter.quote(column_name) }};\n alter table {{ relation.render() }} drop column {{ adapter.quote(column_name) }} cascade;\n alter table {{ relation.render() }} rename column {{ adapter.quote(tmp_column) }} to {{ adapter.quote(column_name) }}\n {% endcall %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "column_name", "type": null, "description": ""}, {"name": "new_column_type", "type": null, "description": ""}], "created_at": 1789419970.06472, "supported_languages": null}, "macro.dbt.alter_relation_add_remove_columns": {"name": "alter_relation_add_remove_columns", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "unique_id": "macro.dbt.alter_relation_add_remove_columns", "macro_sql": "{% macro alter_relation_add_remove_columns(relation, add_columns = none, remove_columns = none) -%}\n {{ return(adapter.dispatch('alter_relation_add_remove_columns', 'dbt')(relation, add_columns, remove_columns)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__alter_relation_add_remove_columns"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "add_columns", "type": null, "description": ""}, {"name": "remove_columns", "type": null, "description": ""}], "created_at": 1789419970.0651748, "supported_languages": null}, "macro.dbt.default__alter_relation_add_remove_columns": {"name": "default__alter_relation_add_remove_columns", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "unique_id": "macro.dbt.default__alter_relation_add_remove_columns", "macro_sql": "{% macro default__alter_relation_add_remove_columns(relation, add_columns, remove_columns) %}\n\n {% if add_columns is none %}\n {% set add_columns = [] %}\n {% endif %}\n {% if remove_columns is none %}\n {% set remove_columns = [] %}\n {% endif %}\n\n {% set sql -%}\n\n alter {{ relation.type }} {{ relation.render() }}\n\n {% for column in add_columns %}\n add column {{ column.quoted }} {{ column.expanded_data_type }}{{ ',' if not loop.last }}\n {% endfor %}{{ ',' if add_columns and remove_columns }}\n\n {% for column in remove_columns %}\n drop column {{ column.quoted }}{{ ',' if not loop.last }}\n {% endfor %}\n\n {%- endset -%}\n\n {% do run_query(sql) %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "add_columns", "type": null, "description": ""}, {"name": "remove_columns", "type": null, "description": ""}], "created_at": 1789419970.0664952, "supported_languages": null}, "macro.dbt.get_create_index_sql": {"name": "get_create_index_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/indexes.sql", "original_file_path": "macros/adapters/indexes.sql", "unique_id": "macro.dbt.get_create_index_sql", "macro_sql": "{% macro get_create_index_sql(relation, index_dict) -%}\n {{ return(adapter.dispatch('get_create_index_sql', 'dbt')(relation, index_dict)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__get_create_index_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "index_dict", "type": null, "description": ""}], "created_at": 1789419970.0673947, "supported_languages": null}, "macro.dbt.default__get_create_index_sql": {"name": "default__get_create_index_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/indexes.sql", "original_file_path": "macros/adapters/indexes.sql", "unique_id": "macro.dbt.default__get_create_index_sql", "macro_sql": "{% macro default__get_create_index_sql(relation, index_dict) -%}\n {% do return(None) %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "index_dict", "type": null, "description": ""}], "created_at": 1789419970.0676408, "supported_languages": null}, "macro.dbt.create_indexes": {"name": "create_indexes", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/indexes.sql", "original_file_path": "macros/adapters/indexes.sql", "unique_id": "macro.dbt.create_indexes", "macro_sql": "{% macro create_indexes(relation) -%}\n {{ adapter.dispatch('create_indexes', 'dbt')(relation) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__create_indexes"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789419970.0679262, "supported_languages": null}, "macro.dbt.default__create_indexes": {"name": "default__create_indexes", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/indexes.sql", "original_file_path": "macros/adapters/indexes.sql", "unique_id": "macro.dbt.default__create_indexes", "macro_sql": "{% macro default__create_indexes(relation) -%}\n {%- set _indexes = config.get('indexes', default=[]) -%}\n\n {% for _index_dict in _indexes %}\n {% set create_index_sql = get_create_index_sql(relation, _index_dict) %}\n {% if create_index_sql %}\n {% do run_query(create_index_sql) %}\n {% endif %}\n {% endfor %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_create_index_sql", "macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789419970.0685906, "supported_languages": null}, "macro.dbt.get_drop_index_sql": {"name": "get_drop_index_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/indexes.sql", "original_file_path": "macros/adapters/indexes.sql", "unique_id": "macro.dbt.get_drop_index_sql", "macro_sql": "{% macro get_drop_index_sql(relation, index_name) -%}\n {{ adapter.dispatch('get_drop_index_sql', 'dbt')(relation, index_name) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__get_drop_index_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "index_name", "type": null, "description": ""}], "created_at": 1789419970.068955, "supported_languages": null}, "macro.dbt.default__get_drop_index_sql": {"name": "default__get_drop_index_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/indexes.sql", "original_file_path": "macros/adapters/indexes.sql", "unique_id": "macro.dbt.default__get_drop_index_sql", "macro_sql": "{% macro default__get_drop_index_sql(relation, index_name) -%}\n {{ exceptions.raise_compiler_error(\"`get_drop_index_sql has not been implemented for this adapter.\") }}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "index_name", "type": null, "description": ""}], "created_at": 1789419970.0691931, "supported_languages": null}, "macro.dbt.get_show_indexes_sql": {"name": "get_show_indexes_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/indexes.sql", "original_file_path": "macros/adapters/indexes.sql", "unique_id": "macro.dbt.get_show_indexes_sql", "macro_sql": "{% macro get_show_indexes_sql(relation) -%}\n {{ adapter.dispatch('get_show_indexes_sql', 'dbt')(relation) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__get_show_indexes_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789419970.0694559, "supported_languages": null}, "macro.dbt.default__get_show_indexes_sql": {"name": "default__get_show_indexes_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/indexes.sql", "original_file_path": "macros/adapters/indexes.sql", "unique_id": "macro.dbt.default__get_show_indexes_sql", "macro_sql": "{% macro default__get_show_indexes_sql(relation) -%}\n {{ exceptions.raise_compiler_error(\"`get_show_indexes_sql has not been implemented for this adapter.\") }}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789419970.0696683, "supported_languages": null}, "macro.dbt.get_catalog_relations": {"name": "get_catalog_relations", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "unique_id": "macro.dbt.get_catalog_relations", "macro_sql": "{% macro get_catalog_relations(information_schema, relations) -%}\n {{ return(adapter.dispatch('get_catalog_relations', 'dbt')(information_schema, relations)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__get_catalog_relations"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "information_schema", "type": null, "description": ""}, {"name": "relations", "type": null, "description": ""}], "created_at": 1789419970.0712187, "supported_languages": null}, "macro.dbt.default__get_catalog_relations": {"name": "default__get_catalog_relations", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "unique_id": "macro.dbt.default__get_catalog_relations", "macro_sql": "{% macro default__get_catalog_relations(information_schema, relations) -%}\n {% set typename = adapter.type() %}\n {% set msg -%}\n get_catalog_relations not implemented for {{ typename }}\n {%- endset %}\n\n {{ exceptions.raise_compiler_error(msg) }}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "information_schema", "type": null, "description": ""}, {"name": "relations", "type": null, "description": ""}], "created_at": 1789419970.0716634, "supported_languages": null}, "macro.dbt.get_catalog": {"name": "get_catalog", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "unique_id": "macro.dbt.get_catalog", "macro_sql": "{% macro get_catalog(information_schema, schemas) -%}\n {{ return(adapter.dispatch('get_catalog', 'dbt')(information_schema, schemas)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__get_catalog"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "information_schema", "type": null, "description": ""}, {"name": "schemas", "type": null, "description": ""}], "created_at": 1789419970.0720227, "supported_languages": null}, "macro.dbt.default__get_catalog": {"name": "default__get_catalog", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "unique_id": "macro.dbt.default__get_catalog", "macro_sql": "{% macro default__get_catalog(information_schema, schemas) -%}\n\n {% set typename = adapter.type() %}\n {% set msg -%}\n get_catalog not implemented for {{ typename }}\n {%- endset %}\n\n {{ exceptions.raise_compiler_error(msg) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "information_schema", "type": null, "description": ""}, {"name": "schemas", "type": null, "description": ""}], "created_at": 1789419970.072448, "supported_languages": null}, "macro.dbt.information_schema_name": {"name": "information_schema_name", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "unique_id": "macro.dbt.information_schema_name", "macro_sql": "{% macro information_schema_name(database) %}\n {{ return(adapter.dispatch('information_schema_name', 'dbt')(database)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__information_schema_name"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "database", "type": null, "description": ""}], "created_at": 1789419970.072767, "supported_languages": null}, "macro.dbt.default__information_schema_name": {"name": "default__information_schema_name", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "unique_id": "macro.dbt.default__information_schema_name", "macro_sql": "{% macro default__information_schema_name(database) -%}\n {%- if database -%}\n {{ database }}.INFORMATION_SCHEMA\n {%- else -%}\n INFORMATION_SCHEMA\n {%- endif -%}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "database", "type": null, "description": ""}], "created_at": 1789419970.0731676, "supported_languages": null}, "macro.dbt.list_schemas": {"name": "list_schemas", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "unique_id": "macro.dbt.list_schemas", "macro_sql": "{% macro list_schemas(database) -%}\n {{ return(adapter.dispatch('list_schemas', 'dbt')(database)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__list_schemas"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "database", "type": null, "description": ""}], "created_at": 1789419970.0734704, "supported_languages": null}, "macro.dbt.default__list_schemas": {"name": "default__list_schemas", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "unique_id": "macro.dbt.default__list_schemas", "macro_sql": "{% macro default__list_schemas(database) -%}\n {% set sql %}\n select distinct schema_name\n from {{ information_schema_name(database) }}.SCHEMATA\n where catalog_name ilike '{{ database }}'\n {% endset %}\n {{ return(run_query(sql)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.information_schema_name", "macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "database", "type": null, "description": ""}], "created_at": 1789419970.073884, "supported_languages": null}, "macro.dbt.check_schema_exists": {"name": "check_schema_exists", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "unique_id": "macro.dbt.check_schema_exists", "macro_sql": "{% macro check_schema_exists(information_schema, schema) -%}\n {{ return(adapter.dispatch('check_schema_exists', 'dbt')(information_schema, schema)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__check_schema_exists"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "information_schema", "type": null, "description": ""}, {"name": "schema", "type": null, "description": ""}], "created_at": 1789419970.0742223, "supported_languages": null}, "macro.dbt.default__check_schema_exists": {"name": "default__check_schema_exists", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "unique_id": "macro.dbt.default__check_schema_exists", "macro_sql": "{% macro default__check_schema_exists(information_schema, schema) -%}\n {% set sql -%}\n select count(*)\n from {{ information_schema.replace(information_schema_view='SCHEMATA') }}\n where catalog_name='{{ information_schema.database }}'\n and schema_name='{{ schema }}'\n {%- endset %}\n {{ return(run_query(sql)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.replace", "macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "information_schema", "type": null, "description": ""}, {"name": "schema", "type": null, "description": ""}], "created_at": 1789419970.0747192, "supported_languages": null}, "macro.dbt.list_relations_without_caching": {"name": "list_relations_without_caching", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "unique_id": "macro.dbt.list_relations_without_caching", "macro_sql": "{% macro list_relations_without_caching(schema_relation) %}\n {{ return(adapter.dispatch('list_relations_without_caching', 'dbt')(schema_relation)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__list_relations_without_caching"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "schema_relation", "type": null, "description": ""}], "created_at": 1789419970.0750427, "supported_languages": null}, "macro.dbt.default__list_relations_without_caching": {"name": "default__list_relations_without_caching", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "unique_id": "macro.dbt.default__list_relations_without_caching", "macro_sql": "{% macro default__list_relations_without_caching(schema_relation) %}\n {{ exceptions.raise_not_implemented(\n 'list_relations_without_caching macro not implemented for adapter '+adapter.type()) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "schema_relation", "type": null, "description": ""}], "created_at": 1789419970.0753095, "supported_languages": null}, "macro.dbt.list_function_relations_without_caching": {"name": "list_function_relations_without_caching", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "unique_id": "macro.dbt.list_function_relations_without_caching", "macro_sql": "{% macro list_function_relations_without_caching(schema_relation) %}\n {{ return(adapter.dispatch('list_function_relations_without_caching', 'dbt')(schema_relation)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__list_function_relations_without_caching"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "schema_relation", "type": null, "description": ""}], "created_at": 1789419970.07561, "supported_languages": null}, "macro.dbt.default__list_function_relations_without_caching": {"name": "default__list_function_relations_without_caching", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "unique_id": "macro.dbt.default__list_function_relations_without_caching", "macro_sql": "{% macro default__list_function_relations_without_caching(schema_relation) %}\n {{ exceptions.raise_not_implemented(\n 'list_function_relations_without_caching macro not implemented for adapter '+adapter.type()) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "schema_relation", "type": null, "description": ""}], "created_at": 1789419970.0758948, "supported_languages": null}, "macro.dbt.get_catalog_for_single_relation": {"name": "get_catalog_for_single_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "unique_id": "macro.dbt.get_catalog_for_single_relation", "macro_sql": "{% macro get_catalog_for_single_relation(relation) %}\n {{ return(adapter.dispatch('get_catalog_for_single_relation', 'dbt')(relation)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_catalog_for_single_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789419970.0761974, "supported_languages": null}, "macro.dbt.default__get_catalog_for_single_relation": {"name": "default__get_catalog_for_single_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "unique_id": "macro.dbt.default__get_catalog_for_single_relation", "macro_sql": "{% macro default__get_catalog_for_single_relation(relation) %}\n {{ exceptions.raise_not_implemented(\n 'get_catalog_for_single_relation macro not implemented for adapter '+adapter.type()) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789419970.0764635, "supported_languages": null}, "macro.dbt.get_relations": {"name": "get_relations", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "unique_id": "macro.dbt.get_relations", "macro_sql": "{% macro get_relations() %}\n {{ return(adapter.dispatch('get_relations', 'dbt')()) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__get_relations"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789419970.076754, "supported_languages": null}, "macro.dbt.default__get_relations": {"name": "default__get_relations", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "unique_id": "macro.dbt.default__get_relations", "macro_sql": "{% macro default__get_relations() %}\n {{ exceptions.raise_not_implemented(\n 'get_relations macro not implemented for adapter '+adapter.type()) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789419970.07701, "supported_languages": null}, "macro.dbt.get_relation_last_modified": {"name": "get_relation_last_modified", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "unique_id": "macro.dbt.get_relation_last_modified", "macro_sql": "{% macro get_relation_last_modified(information_schema, relations) %}\n {{ return(adapter.dispatch('get_relation_last_modified', 'dbt')(information_schema, relations)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_relation_last_modified"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "information_schema", "type": null, "description": ""}, {"name": "relations", "type": null, "description": ""}], "created_at": 1789419970.0773468, "supported_languages": null}, "macro.dbt.default__get_relation_last_modified": {"name": "default__get_relation_last_modified", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "unique_id": "macro.dbt.default__get_relation_last_modified", "macro_sql": "{% macro default__get_relation_last_modified(information_schema, relations) %}\n {{ exceptions.raise_not_implemented(\n 'get_relation_last_modified macro not implemented for adapter ' + adapter.type()) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "information_schema", "type": null, "description": ""}, {"name": "relations", "type": null, "description": ""}], "created_at": 1789419970.0776322, "supported_languages": null}, "macro.dbt.validate_sql": {"name": "validate_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/validate_sql.sql", "original_file_path": "macros/adapters/validate_sql.sql", "unique_id": "macro.dbt.validate_sql", "macro_sql": "{% macro validate_sql(sql) -%}\n {{ return(adapter.dispatch('validate_sql', 'dbt')(sql)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__validate_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "sql", "type": null, "description": ""}], "created_at": 1789419970.0781584, "supported_languages": null}, "macro.dbt.default__validate_sql": {"name": "default__validate_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/validate_sql.sql", "original_file_path": "macros/adapters/validate_sql.sql", "unique_id": "macro.dbt.default__validate_sql", "macro_sql": "{% macro default__validate_sql(sql) -%}\n {% call statement('validate_sql') -%}\n explain {{ sql }}\n {% endcall %}\n {{ return(load_result('validate_sql')) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "sql", "type": null, "description": ""}], "created_at": 1789419970.0786576, "supported_languages": null}, "macro.dbt.collect_freshness": {"name": "collect_freshness", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/freshness.sql", "original_file_path": "macros/adapters/freshness.sql", "unique_id": "macro.dbt.collect_freshness", "macro_sql": "{% macro collect_freshness(source, loaded_at_field, filter) %}\n {{ return(adapter.dispatch('collect_freshness', 'dbt')(source, loaded_at_field, filter))}}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__collect_freshness"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "source", "type": null, "description": ""}, {"name": "loaded_at_field", "type": null, "description": ""}, {"name": "filter", "type": null, "description": ""}], "created_at": 1789419970.0794632, "supported_languages": null}, "macro.dbt.default__collect_freshness": {"name": "default__collect_freshness", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/freshness.sql", "original_file_path": "macros/adapters/freshness.sql", "unique_id": "macro.dbt.default__collect_freshness", "macro_sql": "{% macro default__collect_freshness(source, loaded_at_field, filter) %}\n {% call statement('collect_freshness', fetch_result=True, auto_begin=False) -%}\n select\n max({{ loaded_at_field }}) as max_loaded_at,\n {{ current_timestamp() }} as snapshotted_at\n from {{ source }}\n {% if filter %}\n where {{ filter }}\n {% endif %}\n {% endcall %}\n {{ return(load_result('collect_freshness')) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement", "macro.dbt.current_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "source", "type": null, "description": ""}, {"name": "loaded_at_field", "type": null, "description": ""}, {"name": "filter", "type": null, "description": ""}], "created_at": 1789419970.0801651, "supported_languages": null}, "macro.dbt.collect_freshness_custom_sql": {"name": "collect_freshness_custom_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/freshness.sql", "original_file_path": "macros/adapters/freshness.sql", "unique_id": "macro.dbt.collect_freshness_custom_sql", "macro_sql": "{% macro collect_freshness_custom_sql(source, loaded_at_query) %}\n {{ return(adapter.dispatch('collect_freshness_custom_sql', 'dbt')(source, loaded_at_query))}}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__collect_freshness_custom_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "source", "type": null, "description": ""}, {"name": "loaded_at_query", "type": null, "description": ""}], "created_at": 1789419970.080524, "supported_languages": null}, "macro.dbt.default__collect_freshness_custom_sql": {"name": "default__collect_freshness_custom_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/freshness.sql", "original_file_path": "macros/adapters/freshness.sql", "unique_id": "macro.dbt.default__collect_freshness_custom_sql", "macro_sql": "{% macro default__collect_freshness_custom_sql(source, loaded_at_query) %}\n {% call statement('collect_freshness_custom_sql', fetch_result=True, auto_begin=False) -%}\n with source_query as (\n {{ loaded_at_query }}\n )\n select\n (select * from source_query) as max_loaded_at,\n {{ current_timestamp() }} as snapshotted_at\n {% endcall %}\n {{ return(load_result('collect_freshness_custom_sql')) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement", "macro.dbt.current_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "source", "type": null, "description": ""}, {"name": "loaded_at_query", "type": null, "description": ""}], "created_at": 1789419970.0810604, "supported_languages": null}, "macro.dbt.make_intermediate_relation": {"name": "make_intermediate_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "unique_id": "macro.dbt.make_intermediate_relation", "macro_sql": "{% macro make_intermediate_relation(base_relation, suffix='__dbt_tmp') %}\n {{ return(adapter.dispatch('make_intermediate_relation', 'dbt')(base_relation, suffix)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__make_intermediate_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "base_relation", "type": null, "description": ""}, {"name": "suffix", "type": null, "description": ""}], "created_at": 1789419970.082259, "supported_languages": null}, "macro.dbt.default__make_intermediate_relation": {"name": "default__make_intermediate_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "unique_id": "macro.dbt.default__make_intermediate_relation", "macro_sql": "{% macro default__make_intermediate_relation(base_relation, suffix) %}\n {{ return(default__make_temp_relation(base_relation, suffix)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__make_temp_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "base_relation", "type": null, "description": ""}, {"name": "suffix", "type": null, "description": ""}], "created_at": 1789419970.0825424, "supported_languages": null}, "macro.dbt.make_temp_relation": {"name": "make_temp_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "unique_id": "macro.dbt.make_temp_relation", "macro_sql": "{% macro make_temp_relation(base_relation, suffix='__dbt_tmp') %}\n {#-- This ensures microbatch batches get unique temp relations to avoid clobbering --#}\n {% if suffix == '__dbt_tmp' and model.batch %}\n {% set suffix = suffix ~ '_' ~ model.batch.id %}\n {% endif %}\n\n {{ return(adapter.dispatch('make_temp_relation', 'dbt')(base_relation, suffix)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__make_temp_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "base_relation", "type": null, "description": ""}, {"name": "suffix", "type": null, "description": ""}], "created_at": 1789419970.083203, "supported_languages": null}, "macro.dbt.default__make_temp_relation": {"name": "default__make_temp_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "unique_id": "macro.dbt.default__make_temp_relation", "macro_sql": "{% macro default__make_temp_relation(base_relation, suffix) %}\n {%- set temp_identifier = base_relation.identifier ~ suffix -%}\n {%- set temp_relation = base_relation.incorporate(\n path={\"identifier\": temp_identifier}) -%}\n\n {{ return(temp_relation) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "base_relation", "type": null, "description": ""}, {"name": "suffix", "type": null, "description": ""}], "created_at": 1789419970.0836916, "supported_languages": null}, "macro.dbt.make_backup_relation": {"name": "make_backup_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "unique_id": "macro.dbt.make_backup_relation", "macro_sql": "{% macro make_backup_relation(base_relation, backup_relation_type, suffix='__dbt_backup') %}\n {{ return(adapter.dispatch('make_backup_relation', 'dbt')(base_relation, backup_relation_type, suffix)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__make_backup_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "base_relation", "type": null, "description": ""}, {"name": "backup_relation_type", "type": null, "description": ""}, {"name": "suffix", "type": null, "description": ""}], "created_at": 1789419970.0841098, "supported_languages": null}, "macro.dbt.default__make_backup_relation": {"name": "default__make_backup_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "unique_id": "macro.dbt.default__make_backup_relation", "macro_sql": "{% macro default__make_backup_relation(base_relation, backup_relation_type, suffix) %}\n {%- set backup_identifier = base_relation.identifier ~ suffix -%}\n {%- set backup_relation = base_relation.incorporate(\n path={\"identifier\": backup_identifier},\n type=backup_relation_type\n ) -%}\n {{ return(backup_relation) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "base_relation", "type": null, "description": ""}, {"name": "backup_relation_type", "type": null, "description": ""}, {"name": "suffix", "type": null, "description": ""}], "created_at": 1789419970.0846465, "supported_languages": null}, "macro.dbt.truncate_relation": {"name": "truncate_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "unique_id": "macro.dbt.truncate_relation", "macro_sql": "{% macro truncate_relation(relation) -%}\n {{ return(adapter.dispatch('truncate_relation', 'dbt')(relation)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__truncate_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789419970.0849671, "supported_languages": null}, "macro.dbt.default__truncate_relation": {"name": "default__truncate_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "unique_id": "macro.dbt.default__truncate_relation", "macro_sql": "{% macro default__truncate_relation(relation) -%}\n {% call statement('truncate_relation') -%}\n truncate table {{ relation.render() }}\n {%- endcall %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789419970.085268, "supported_languages": null}, "macro.dbt.get_or_create_relation": {"name": "get_or_create_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "unique_id": "macro.dbt.get_or_create_relation", "macro_sql": "{% macro get_or_create_relation(database, schema, identifier, type) -%}\n {{ return(adapter.dispatch('get_or_create_relation', 'dbt')(database, schema, identifier, type)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_or_create_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "database", "type": null, "description": ""}, {"name": "schema", "type": null, "description": ""}, {"name": "identifier", "type": null, "description": ""}, {"name": "type", "type": null, "description": ""}], "created_at": 1789419970.0856714, "supported_languages": null}, "macro.dbt.default__get_or_create_relation": {"name": "default__get_or_create_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "unique_id": "macro.dbt.default__get_or_create_relation", "macro_sql": "{% macro default__get_or_create_relation(database, schema, identifier, type) %}\n {%- set target_relation = adapter.get_relation(database=database, schema=schema, identifier=identifier) %}\n\n {% if target_relation %}\n {% do return([true, target_relation]) %}\n {% endif %}\n\n {%- set new_relation = api.Relation.create(\n database=database,\n schema=schema,\n identifier=identifier,\n type=type\n ) -%}\n {% do return([false, new_relation]) %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "database", "type": null, "description": ""}, {"name": "schema", "type": null, "description": ""}, {"name": "identifier", "type": null, "description": ""}, {"name": "type", "type": null, "description": ""}], "created_at": 1789419970.0867057, "supported_languages": null}, "macro.dbt.load_cached_relation": {"name": "load_cached_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "unique_id": "macro.dbt.load_cached_relation", "macro_sql": "{% macro load_cached_relation(relation) %}\n {% do return(adapter.get_relation(\n database=relation.database,\n schema=relation.schema,\n identifier=relation.identifier\n )) -%}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789419970.08711, "supported_languages": null}, "macro.dbt.load_relation": {"name": "load_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "unique_id": "macro.dbt.load_relation", "macro_sql": "{% macro load_relation(relation) %}\n {{ return(load_cached_relation(relation)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.load_cached_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789419970.0873506, "supported_languages": null}, "macro.dbt.test_unique": {"name": "test_unique", "resource_type": "macro", "package_name": "dbt", "path": "tests/generic/builtin.sql", "original_file_path": "tests/generic/builtin.sql", "unique_id": "macro.dbt.test_unique", "macro_sql": "{% test unique(model, column_name) %}\n {% set macro = adapter.dispatch('test_unique', 'dbt') %}\n {{ macro(model, column_name) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt.default__test_unique"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789419970.08813, "supported_languages": null}, "macro.dbt.test_not_null": {"name": "test_not_null", "resource_type": "macro", "package_name": "dbt", "path": "tests/generic/builtin.sql", "original_file_path": "tests/generic/builtin.sql", "unique_id": "macro.dbt.test_not_null", "macro_sql": "{% test not_null(model, column_name) %}\n {% set macro = adapter.dispatch('test_not_null', 'dbt') %}\n {{ macro(model, column_name) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt.default__test_not_null"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789419970.0885499, "supported_languages": null}, "macro.dbt.test_accepted_values": {"name": "test_accepted_values", "resource_type": "macro", "package_name": "dbt", "path": "tests/generic/builtin.sql", "original_file_path": "tests/generic/builtin.sql", "unique_id": "macro.dbt.test_accepted_values", "macro_sql": "{% test accepted_values(model, column_name, values, quote=True) %}\n {% set macro = adapter.dispatch('test_accepted_values', 'dbt') %}\n {{ macro(model, column_name, values, quote) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt.default__test_accepted_values"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789419970.0890837, "supported_languages": null}, "macro.dbt.test_relationships": {"name": "test_relationships", "resource_type": "macro", "package_name": "dbt", "path": "tests/generic/builtin.sql", "original_file_path": "tests/generic/builtin.sql", "unique_id": "macro.dbt.test_relationships", "macro_sql": "{% test relationships(model, column_name, to, field) %}\n {% set macro = adapter.dispatch('test_relationships', 'dbt') %}\n {{ macro(model, column_name, to, field) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt.default__test_relationships"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789419970.089578, "supported_languages": null}, "macro.dbt_utils.slugify": {"name": "slugify", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/jinja_helpers/slugify.sql", "original_file_path": "macros/jinja_helpers/slugify.sql", "unique_id": "macro.dbt_utils.slugify", "macro_sql": "{% macro slugify(string) %}\n\n{% if not string %}\n{{ return('') }}\n{% endif %}\n\n{#- Lower case the string -#}\n{% set string = string | lower %}\n{#- Replace spaces and dashes with underscores -#}\n{% set string = modules.re.sub('[ -]+', '_', string) %}\n{#- Only take letters, numbers, and underscores -#}\n{% set string = modules.re.sub('[^a-z0-9_]+', '', string) %}\n{#- Prepends \"_\" if string begins with a number -#}\n{% set string = modules.re.sub('^[0-9]', '_' + string[0], string) %}\n\n{{ return(string) }}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "string", "type": null, "description": ""}], "created_at": 1789419970.0909166, "supported_languages": null}, "macro.dbt_utils.log_info": {"name": "log_info", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/jinja_helpers/log_info.sql", "original_file_path": "macros/jinja_helpers/log_info.sql", "unique_id": "macro.dbt_utils.log_info", "macro_sql": "{% macro log_info(message) %}\n {{ return(adapter.dispatch('log_info', 'dbt_utils')(message)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__log_info"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "message", "type": null, "description": ""}], "created_at": 1789419970.0913713, "supported_languages": null}, "macro.dbt_utils.default__log_info": {"name": "default__log_info", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/jinja_helpers/log_info.sql", "original_file_path": "macros/jinja_helpers/log_info.sql", "unique_id": "macro.dbt_utils.default__log_info", "macro_sql": "{% macro default__log_info(message) %}\n {{ log(dbt_utils.pretty_log_format(message), info=True) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.pretty_log_format"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "message", "type": null, "description": ""}], "created_at": 1789419970.091657, "supported_languages": null}, "macro.dbt_utils.pretty_log_format": {"name": "pretty_log_format", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/jinja_helpers/pretty_log_format.sql", "original_file_path": "macros/jinja_helpers/pretty_log_format.sql", "unique_id": "macro.dbt_utils.pretty_log_format", "macro_sql": "{% macro pretty_log_format(message) %}\n {{ return(adapter.dispatch('pretty_log_format', 'dbt_utils')(message)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__pretty_log_format"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "message", "type": null, "description": ""}], "created_at": 1789419970.0921354, "supported_languages": null}, "macro.dbt_utils.default__pretty_log_format": {"name": "default__pretty_log_format", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/jinja_helpers/pretty_log_format.sql", "original_file_path": "macros/jinja_helpers/pretty_log_format.sql", "unique_id": "macro.dbt_utils.default__pretty_log_format", "macro_sql": "{% macro default__pretty_log_format(message) %}\n {{ return( dbt_utils.pretty_time() ~ ' + ' ~ message) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.pretty_time"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "message", "type": null, "description": ""}], "created_at": 1789419970.092416, "supported_languages": null}, "macro.dbt_utils._is_ephemeral": {"name": "_is_ephemeral", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/jinja_helpers/_is_ephemeral.sql", "original_file_path": "macros/jinja_helpers/_is_ephemeral.sql", "unique_id": "macro.dbt_utils._is_ephemeral", "macro_sql": "{% macro _is_ephemeral(obj, macro) %}\n {%- if obj.is_cte -%}\n {% set ephemeral_prefix = api.Relation.add_ephemeral_prefix('') %}\n {% if obj.name.startswith(ephemeral_prefix) %}\n {% set model_name = obj.name[(ephemeral_prefix|length):] %}\n {% else %}\n {% set model_name = obj.name %}\n {%- endif -%}\n {% set error_message %}\nThe `{{ macro }}` macro cannot be used with ephemeral models, as it relies on the information schema.\n\n`{{ model_name }}` is an ephemeral model. Consider making it a view or table instead.\n {% endset %}\n {%- do exceptions.raise_compiler_error(error_message) -%}\n {%- endif -%}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "obj", "type": null, "description": ""}, {"name": "macro", "type": null, "description": ""}], "created_at": 1789419970.0936399, "supported_languages": null}, "macro.dbt_utils._is_relation": {"name": "_is_relation", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/jinja_helpers/_is_relation.sql", "original_file_path": "macros/jinja_helpers/_is_relation.sql", "unique_id": "macro.dbt_utils._is_relation", "macro_sql": "{% macro _is_relation(obj, macro) %}\n {%- if not (obj is mapping and obj.get('metadata', {}).get('type', '').endswith('Relation')) -%}\n {%- do exceptions.raise_compiler_error(\"Macro \" ~ macro ~ \" expected a Relation but received the value: \" ~ obj) -%}\n {%- endif -%}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "obj", "type": null, "description": ""}, {"name": "macro", "type": null, "description": ""}], "created_at": 1789419970.094421, "supported_languages": null}, "macro.dbt_utils.pretty_time": {"name": "pretty_time", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/jinja_helpers/pretty_time.sql", "original_file_path": "macros/jinja_helpers/pretty_time.sql", "unique_id": "macro.dbt_utils.pretty_time", "macro_sql": "{% macro pretty_time(format='%H:%M:%S') %}\n {{ return(adapter.dispatch('pretty_time', 'dbt_utils')(format)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__pretty_time"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "format", "type": null, "description": ""}], "created_at": 1789419970.0949068, "supported_languages": null}, "macro.dbt_utils.default__pretty_time": {"name": "default__pretty_time", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/jinja_helpers/pretty_time.sql", "original_file_path": "macros/jinja_helpers/pretty_time.sql", "unique_id": "macro.dbt_utils.default__pretty_time", "macro_sql": "{% macro default__pretty_time(format='%H:%M:%S') %}\n {{ return(modules.datetime.datetime.now().strftime(format)) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "format", "type": null, "description": ""}], "created_at": 1789419970.095233, "supported_languages": null}, "macro.dbt_utils.test_not_constant": {"name": "test_not_constant", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/not_constant.sql", "original_file_path": "macros/generic_tests/not_constant.sql", "unique_id": "macro.dbt_utils.test_not_constant", "macro_sql": "{% test not_constant(model, column_name, group_by_columns = []) %}\n {{ return(adapter.dispatch('test_not_constant', 'dbt_utils')(model, column_name, group_by_columns)) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_not_constant"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "column_name", "type": null, "description": ""}, {"name": "group_by_columns", "type": null, "description": ""}], "created_at": 1789419970.0959167, "supported_languages": null}, "macro.dbt_utils.default__test_not_constant": {"name": "default__test_not_constant", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/not_constant.sql", "original_file_path": "macros/generic_tests/not_constant.sql", "unique_id": "macro.dbt_utils.default__test_not_constant", "macro_sql": "{% macro default__test_not_constant(model, column_name, group_by_columns) %}\n\n{% if group_by_columns|length() > 0 %}\n {% set select_gb_cols = group_by_columns|join(' ,') + ', ' %}\n {% set groupby_gb_cols = 'group by ' + group_by_columns|join(',') %}\n{% endif %}\n\n\nselect\n {# In TSQL, subquery aggregate columns need aliases #}\n {# thus: a filler col name, 'filler_column' #}\n {{select_gb_cols}}\n count(distinct {{ column_name }}) as filler_column\n\nfrom {{ model }}\n\n {{groupby_gb_cols}}\n\nhaving count(distinct {{ column_name }}) = 1\n\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "column_name", "type": null, "description": ""}, {"name": "group_by_columns", "type": null, "description": ""}], "created_at": 1789419970.096837, "supported_languages": null}, "macro.dbt_utils.test_equality": {"name": "test_equality", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/equality.sql", "original_file_path": "macros/generic_tests/equality.sql", "unique_id": "macro.dbt_utils.test_equality", "macro_sql": "{% test equality(model, compare_model, compare_columns=None, exclude_columns=None, precision = None) %}\n {{ return(adapter.dispatch('test_equality', 'dbt_utils')(model, compare_model, compare_columns, exclude_columns, precision)) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_equality"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "compare_model", "type": null, "description": ""}, {"name": "compare_columns", "type": null, "description": ""}, {"name": "exclude_columns", "type": null, "description": ""}, {"name": "precision", "type": null, "description": ""}], "created_at": 1789419970.098978, "supported_languages": null}, "macro.dbt_utils.default__test_equality": {"name": "default__test_equality", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/equality.sql", "original_file_path": "macros/generic_tests/equality.sql", "unique_id": "macro.dbt_utils.default__test_equality", "macro_sql": "{% macro default__test_equality(model, compare_model, compare_columns=None, exclude_columns=None, precision = None) %}\n\n{%- if compare_columns and exclude_columns -%}\n {{ exceptions.raise_compiler_error(\"Both a compare and an ignore list were provided to the `equality` macro. Only one is allowed\") }}\n{%- endif -%}\n\n{% set set_diff %}\n count(*) + coalesce(abs(\n sum(case when which_diff = 'a_minus_b' then 1 else 0 end) -\n sum(case when which_diff = 'b_minus_a' then 1 else 0 end)\n ), 0)\n{% endset %}\n\n{#-- Needs to be set at parse time, before we return '' below --#}\n{{ config(fail_calc = set_diff) }}\n\n{#-- Prevent querying of db in parsing mode. This works because this macro does not create any new refs. #}\n{%- if not execute -%}\n {{ return('') }}\n{% endif %}\n\n\n\n-- setup\n{%- do dbt_utils._is_relation(model, 'test_equality') -%}\n\n{# Ensure there are no extra columns in the compare_model vs model #}\n{%- if not compare_columns -%}\n {%- do dbt_utils._is_ephemeral(model, 'test_equality') -%}\n {%- do dbt_utils._is_ephemeral(compare_model, 'test_equality') -%}\n\n {%- set model_columns = adapter.get_columns_in_relation(model) -%}\n {%- set compare_model_columns = adapter.get_columns_in_relation(compare_model) -%}\n\n\n {%- if exclude_columns -%}\n {#-- Lower case ignore columns for easier comparison --#}\n {%- set exclude_columns = exclude_columns | map(\"lower\") | list %}\n\n {# Filter out the excluded columns #}\n {%- set include_columns = [] %}\n {%- set include_model_columns = [] %}\n {%- for column in model_columns -%}\n {%- if column.name | lower not in exclude_columns -%}\n {% do include_columns.append(column) %}\n {%- endif %}\n {%- endfor %}\n {%- for column in compare_model_columns -%}\n {%- if column.name | lower not in exclude_columns -%}\n {% do include_model_columns.append(column) %}\n {%- endif %}\n {%- endfor %}\n\n {%- set compare_columns_set = set(include_columns | map(attribute='quoted') | map(\"lower\")) %}\n {%- set compare_model_columns_set = set(include_model_columns | map(attribute='quoted') | map(\"lower\")) %}\n {%- else -%}\n {%- set compare_columns_set = set(model_columns | map(attribute='quoted') | map(\"lower\")) %}\n {%- set compare_model_columns_set = set(compare_model_columns | map(attribute='quoted') | map(\"lower\")) %}\n {%- endif -%}\n\n {% if compare_columns_set != compare_model_columns_set %}\n {{ exceptions.raise_compiler_error(compare_model ~\" has less columns than \" ~ model ~ \", please ensure they have the same columns or use the `compare_columns` or `exclude_columns` arguments to subset them.\") }}\n {% endif %}\n\n\n{% endif %}\n\n{%- if not precision -%}\n {%- if not compare_columns -%}\n {# \n You cannot get the columns in an ephemeral model (due to not existing in the information schema),\n so if the user does not provide an explicit list of columns we must error in the case it is ephemeral\n #}\n {%- do dbt_utils._is_ephemeral(model, 'test_equality') -%}\n {%- set compare_columns = adapter.get_columns_in_relation(model)-%}\n\n {%- if exclude_columns -%}\n {#-- Lower case ignore columns for easier comparison --#}\n {%- set exclude_columns = exclude_columns | map(\"lower\") | list %}\n\n {# Filter out the excluded columns #}\n {%- set include_columns = [] %}\n {%- for column in compare_columns -%}\n {%- if column.name | lower not in exclude_columns -%}\n {% do include_columns.append(column) %}\n {%- endif %}\n {%- endfor %}\n\n {%- set compare_columns = include_columns | map(attribute='quoted') %}\n {%- else -%} {# Compare columns provided #}\n {%- set compare_columns = compare_columns | map(attribute='quoted') %}\n {%- endif -%}\n {%- endif -%}\n\n {% set compare_cols_csv = compare_columns | join(', ') %}\n\n{% else %} {# Precision required #}\n {#-\n If rounding is required, we need to get the types, so it cannot be ephemeral even if they provide column names\n -#}\n {%- do dbt_utils._is_ephemeral(model, 'test_equality') -%}\n {%- set columns = adapter.get_columns_in_relation(model) -%}\n\n {% set columns_list = [] %}\n {%- for col in columns -%}\n {%- if (\n (col.name|lower in compare_columns|map('lower') or not compare_columns) and\n (col.name|lower not in exclude_columns|map('lower') or not exclude_columns)\n ) -%}\n {# Databricks double type is not picked up by any number type checks in dbt #}\n {%- if col.is_float() or col.is_numeric() or col.data_type == 'double' -%}\n {# Cast is required due to postgres not having round for a double precision number #}\n {%- do columns_list.append('round(cast(' ~ col.quoted ~ ' as ' ~ dbt.type_numeric() ~ '),' ~ precision ~ ') as ' ~ col.quoted) -%}\n {%- else -%} {# Non-numeric type #}\n {%- do columns_list.append(col.quoted) -%}\n {%- endif -%}\n {% endif %}\n {%- endfor -%}\n\n {% set compare_cols_csv = columns_list | join(', ') %}\n\n{% endif %}\n\nwith a as (\n\n select * from {{ model }}\n\n),\n\nb as (\n\n select * from {{ compare_model }}\n\n),\n\na_minus_b as (\n\n select {{compare_cols_csv}} from a\n {{ dbt.except() }}\n select {{compare_cols_csv}} from b\n\n),\n\nb_minus_a as (\n\n select {{compare_cols_csv}} from b\n {{ dbt.except() }}\n select {{compare_cols_csv}} from a\n\n),\n\nunioned as (\n\n select 'a_minus_b' as which_diff, a_minus_b.* from a_minus_b\n union all\n select 'b_minus_a' as which_diff, b_minus_a.* from b_minus_a\n\n)\n\nselect * from unioned\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils._is_relation", "macro.dbt_utils._is_ephemeral", "macro.dbt.type_numeric", "macro.dbt.except"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "compare_model", "type": null, "description": ""}, {"name": "compare_columns", "type": null, "description": ""}, {"name": "exclude_columns", "type": null, "description": ""}, {"name": "precision", "type": null, "description": ""}], "created_at": 1789419970.105605, "supported_languages": null}, "macro.dbt_utils.test_not_empty_string": {"name": "test_not_empty_string", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/not_empty_string.sql", "original_file_path": "macros/generic_tests/not_empty_string.sql", "unique_id": "macro.dbt_utils.test_not_empty_string", "macro_sql": "{% test not_empty_string(model, column_name, trim_whitespace=true) %}\n\n {{ return(adapter.dispatch('test_not_empty_string', 'dbt_utils')(model, column_name, trim_whitespace)) }}\n\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_not_empty_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "column_name", "type": null, "description": ""}, {"name": "trim_whitespace", "type": null, "description": ""}], "created_at": 1789419970.1063948, "supported_languages": null}, "macro.dbt_utils.default__test_not_empty_string": {"name": "default__test_not_empty_string", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/not_empty_string.sql", "original_file_path": "macros/generic_tests/not_empty_string.sql", "unique_id": "macro.dbt_utils.default__test_not_empty_string", "macro_sql": "{% macro default__test_not_empty_string(model, column_name, trim_whitespace=true) %}\n\n with\n \n all_values as (\n\n select \n\n\n {% if trim_whitespace == true -%}\n\n trim({{ column_name }}) as {{ column_name }}\n\n {%- else -%}\n\n {{ column_name }}\n\n {%- endif %}\n \n from {{ model }}\n\n ),\n\n errors as (\n\n select * from all_values\n where {{ column_name }} = ''\n\n )\n\n select * from errors\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "column_name", "type": null, "description": ""}, {"name": "trim_whitespace", "type": null, "description": ""}], "created_at": 1789419970.1069813, "supported_languages": null}, "macro.dbt_utils.test_recency": {"name": "test_recency", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/recency.sql", "original_file_path": "macros/generic_tests/recency.sql", "unique_id": "macro.dbt_utils.test_recency", "macro_sql": "{% test recency(model, field, datepart, interval, ignore_time_component=False, group_by_columns = []) %}\n {{ return(adapter.dispatch('test_recency', 'dbt_utils')(model, field, datepart, interval, ignore_time_component, group_by_columns)) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_recency"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "field", "type": null, "description": ""}, {"name": "datepart", "type": null, "description": ""}, {"name": "interval", "type": null, "description": ""}, {"name": "ignore_time_component", "type": null, "description": ""}, {"name": "group_by_columns", "type": null, "description": ""}], "created_at": 1789419970.1079965, "supported_languages": null}, "macro.dbt_utils.default__test_recency": {"name": "default__test_recency", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/recency.sql", "original_file_path": "macros/generic_tests/recency.sql", "unique_id": "macro.dbt_utils.default__test_recency", "macro_sql": "{% macro default__test_recency(model, field, datepart, interval, ignore_time_component, group_by_columns) %}\n\n{% set empty_invocation = flags.EMPTY is defined and flags.EMPTY %}\n\n{% set threshold = 'cast(' ~ dbt.dateadd(datepart, interval * -1, dbt.current_timestamp()) ~ ' as ' ~ ('date' if ignore_time_component else dbt.type_timestamp()) ~ ')' %}\n\n{% if group_by_columns|length() > 0 %}\n {% set select_gb_cols = group_by_columns|join(' ,') + ', ' %}\n {% set groupby_gb_cols = 'group by ' + group_by_columns|join(',') %}\n{% endif %}\n\n\nwith recency as (\n\n select \n\n {{ select_gb_cols }}\n {% if ignore_time_component %}\n cast(max({{ field }}) as date) as most_recent\n {%- else %}\n max({{ field }}) as most_recent\n {%- endif %}\n\n from {{ model }}\n\n {{ groupby_gb_cols }}\n\n)\n\nselect\n\n {{ select_gb_cols }}\n most_recent,\n {{ threshold }} as threshold\n\nfrom recency\nwhere most_recent < {{ threshold }}\n{%- if not empty_invocation %}\n or most_recent is null\n{%- endif %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.dateadd", "macro.dbt.current_timestamp", "macro.dbt.type_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "field", "type": null, "description": ""}, {"name": "datepart", "type": null, "description": ""}, {"name": "interval", "type": null, "description": ""}, {"name": "ignore_time_component", "type": null, "description": ""}, {"name": "group_by_columns", "type": null, "description": ""}], "created_at": 1789419970.1096337, "supported_languages": null}, "macro.dbt_utils.test_at_least_one": {"name": "test_at_least_one", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/at_least_one.sql", "original_file_path": "macros/generic_tests/at_least_one.sql", "unique_id": "macro.dbt_utils.test_at_least_one", "macro_sql": "{% test at_least_one(model, column_name, group_by_columns = []) %}\n {{ return(adapter.dispatch('test_at_least_one', 'dbt_utils')(model, column_name, group_by_columns)) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_at_least_one"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "column_name", "type": null, "description": ""}, {"name": "group_by_columns", "type": null, "description": ""}], "created_at": 1789419970.1105194, "supported_languages": null}, "macro.dbt_utils.default__test_at_least_one": {"name": "default__test_at_least_one", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/at_least_one.sql", "original_file_path": "macros/generic_tests/at_least_one.sql", "unique_id": "macro.dbt_utils.default__test_at_least_one", "macro_sql": "{% macro default__test_at_least_one(model, column_name, group_by_columns) %}\n\n{% set pruned_cols = [column_name] %}\n\n{% if group_by_columns|length() > 0 %}\n\n {% set select_gb_cols = group_by_columns|join(' ,') + ', ' %}\n {% set groupby_gb_cols = 'group by ' + group_by_columns|join(',') %}\n {% set pruned_cols = group_by_columns %}\n\n {% if column_name not in pruned_cols %}\n {% do pruned_cols.append(column_name) %}\n {% endif %}\n\n{% endif %}\n\n{% set select_pruned_cols = pruned_cols|join(' ,') %}\n\nselect *\nfrom (\n with pruned_rows as (\n select\n {{ select_pruned_cols }}\n from {{ model }}\n {% if group_by_columns|length() == 0 %}\n where {{ column_name }} is not null\n limit 1\n {% endif %}\n )\n select\n {# In TSQL, subquery aggregate columns need aliases #}\n {# thus: a filler col name, 'filler_column' #}\n {{select_gb_cols}}\n count({{ column_name }}) as filler_column\n\n from pruned_rows\n\n {{groupby_gb_cols}}\n\n having count({{ column_name }}) = 0\n\n) validation_errors\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "column_name", "type": null, "description": ""}, {"name": "group_by_columns", "type": null, "description": ""}], "created_at": 1789419970.112022, "supported_languages": null}, "macro.dbt_utils.test_unique_combination_of_columns": {"name": "test_unique_combination_of_columns", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/unique_combination_of_columns.sql", "original_file_path": "macros/generic_tests/unique_combination_of_columns.sql", "unique_id": "macro.dbt_utils.test_unique_combination_of_columns", "macro_sql": "{% test unique_combination_of_columns(model, combination_of_columns, quote_columns=false) %}\n {{ return(adapter.dispatch('test_unique_combination_of_columns', 'dbt_utils')(model, combination_of_columns, quote_columns)) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_unique_combination_of_columns"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "combination_of_columns", "type": null, "description": ""}, {"name": "quote_columns", "type": null, "description": ""}], "created_at": 1789419970.1127985, "supported_languages": null}, "macro.dbt_utils.default__test_unique_combination_of_columns": {"name": "default__test_unique_combination_of_columns", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/unique_combination_of_columns.sql", "original_file_path": "macros/generic_tests/unique_combination_of_columns.sql", "unique_id": "macro.dbt_utils.default__test_unique_combination_of_columns", "macro_sql": "{% macro default__test_unique_combination_of_columns(model, combination_of_columns, quote_columns=false) %}\n\n{% if not quote_columns %}\n {%- set column_list=combination_of_columns %}\n{% elif quote_columns %}\n {%- set column_list=[] %}\n {% for column in combination_of_columns -%}\n {% do column_list.append( adapter.quote(column) ) %}\n {%- endfor %}\n{% else %}\n {{ exceptions.raise_compiler_error(\n \"`quote_columns` argument for unique_combination_of_columns test must be one of [True, False] Got: '\" ~ quote ~\"'.'\"\n ) }}\n{% endif %}\n\n{%- set columns_csv=column_list | join(', ') %}\n\n\nwith validation_errors as (\n\n select\n {{ columns_csv }}\n from {{ model }}\n group by {{ columns_csv }}\n having count(*) > 1\n\n)\n\nselect *\nfrom validation_errors\n\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "combination_of_columns", "type": null, "description": ""}, {"name": "quote_columns", "type": null, "description": ""}], "created_at": 1789419970.1138506, "supported_languages": null}, "macro.dbt_utils.test_fewer_rows_than": {"name": "test_fewer_rows_than", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/fewer_rows_than.sql", "original_file_path": "macros/generic_tests/fewer_rows_than.sql", "unique_id": "macro.dbt_utils.test_fewer_rows_than", "macro_sql": "{% test fewer_rows_than(model, compare_model, group_by_columns = []) %}\n {{ return(adapter.dispatch('test_fewer_rows_than', 'dbt_utils')(model, compare_model, group_by_columns)) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_fewer_rows_than"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "compare_model", "type": null, "description": ""}, {"name": "group_by_columns", "type": null, "description": ""}], "created_at": 1789419970.1148787, "supported_languages": null}, "macro.dbt_utils.default__test_fewer_rows_than": {"name": "default__test_fewer_rows_than", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/fewer_rows_than.sql", "original_file_path": "macros/generic_tests/fewer_rows_than.sql", "unique_id": "macro.dbt_utils.default__test_fewer_rows_than", "macro_sql": "{% macro default__test_fewer_rows_than(model, compare_model, group_by_columns) %}\n\n{{ config(fail_calc = 'sum(coalesce(row_count_delta, 0))') }}\n\n{% if group_by_columns|length() > 0 %}\n {% set select_gb_cols = group_by_columns|join(' ,') + ', ' %}\n {% set join_gb_cols %}\n {% for c in group_by_columns %}\n and a.{{c}} = b.{{c}}\n {% endfor %}\n {% endset %}\n {% set groupby_gb_cols = 'group by ' + group_by_columns|join(',') %}\n{% endif %}\n\n{#-- We must add a fake join key in case additional grouping variables are not provided --#}\n{#-- Redshift does not allow for dynamically created join conditions (e.g. full join on 1 = 1 --#}\n{#-- The same logic is used in equal_rowcount. In case of changes, maintain consistent logic --#}\n{% set group_by_columns = ['id_dbtutils_test_fewer_rows_than'] + group_by_columns %}\n{% set groupby_gb_cols = 'group by ' + group_by_columns|join(',') %}\n\n\nwith a as (\n\n select \n {{select_gb_cols}}\n 1 as id_dbtutils_test_fewer_rows_than,\n count(*) as count_our_model \n from {{ model }}\n {{ groupby_gb_cols }}\n\n),\nb as (\n\n select \n {{select_gb_cols}}\n 1 as id_dbtutils_test_fewer_rows_than,\n count(*) as count_comparison_model \n from {{ compare_model }}\n {{ groupby_gb_cols }}\n\n),\ncounts as (\n\n select\n\n {% for c in group_by_columns -%}\n a.{{c}} as {{c}}_a,\n b.{{c}} as {{c}}_b,\n {% endfor %}\n\n count_our_model,\n count_comparison_model\n from a\n full join b on \n a.id_dbtutils_test_fewer_rows_than = b.id_dbtutils_test_fewer_rows_than\n {{ join_gb_cols }}\n\n),\nfinal as (\n\n select *,\n case\n -- fail the test if we have more rows than the reference model and return the row count delta\n when count_our_model > count_comparison_model then (count_our_model - count_comparison_model)\n -- fail the test if they are the same number\n when count_our_model = count_comparison_model then 1\n -- pass the test if the delta is positive (i.e. return the number 0)\n else 0\n end as row_count_delta\n from counts\n\n)\n\nselect * from final\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "compare_model", "type": null, "description": ""}, {"name": "group_by_columns", "type": null, "description": ""}], "created_at": 1789419970.1167653, "supported_languages": null}, "macro.dbt_utils.test_not_null_proportion": {"name": "test_not_null_proportion", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/not_null_proportion.sql", "original_file_path": "macros/generic_tests/not_null_proportion.sql", "unique_id": "macro.dbt_utils.test_not_null_proportion", "macro_sql": "{% macro test_not_null_proportion(model, group_by_columns = []) %}\n {{ return(adapter.dispatch('test_not_null_proportion', 'dbt_utils')(model, group_by_columns, **kwargs)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_not_null_proportion"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "group_by_columns", "type": null, "description": ""}], "created_at": 1789419970.1175728, "supported_languages": null}, "macro.dbt_utils.default__test_not_null_proportion": {"name": "default__test_not_null_proportion", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/not_null_proportion.sql", "original_file_path": "macros/generic_tests/not_null_proportion.sql", "unique_id": "macro.dbt_utils.default__test_not_null_proportion", "macro_sql": "{% macro default__test_not_null_proportion(model, group_by_columns) %}\n\n{% set column_name = kwargs.get('column_name', kwargs.get('arg')) %}\n{% set at_least = kwargs.get('at_least', kwargs.get('arg')) %}\n{% set at_most = kwargs.get('at_most', kwargs.get('arg', 1)) %}\n\n{% if group_by_columns|length() > 0 %}\n {% set select_gb_cols = group_by_columns|join(' ,') + ', ' %}\n {% set groupby_gb_cols = 'group by ' + group_by_columns|join(',') %}\n{% endif %}\n\nwith validation as (\n select\n {{select_gb_cols}}\n sum(case when {{ column_name }} is null then 0 else 1 end) / cast(count(*) as {{ dbt.type_numeric() }}) as not_null_proportion\n from {{ model }}\n {{groupby_gb_cols}}\n),\nvalidation_errors as (\n select\n {{select_gb_cols}}\n not_null_proportion\n from validation\n where not_null_proportion < {{ at_least }} or not_null_proportion > {{ at_most }}\n)\nselect\n *\nfrom validation_errors\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.type_numeric"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "group_by_columns", "type": null, "description": ""}], "created_at": 1789419970.1189756, "supported_languages": null}, "macro.dbt_utils.test_equal_rowcount": {"name": "test_equal_rowcount", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/equal_rowcount.sql", "original_file_path": "macros/generic_tests/equal_rowcount.sql", "unique_id": "macro.dbt_utils.test_equal_rowcount", "macro_sql": "{% test equal_rowcount(model, compare_model, group_by_columns = []) %}\n {{ return(adapter.dispatch('test_equal_rowcount', 'dbt_utils')(model, compare_model, group_by_columns)) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_equal_rowcount"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "compare_model", "type": null, "description": ""}, {"name": "group_by_columns", "type": null, "description": ""}], "created_at": 1789419970.1200182, "supported_languages": null}, "macro.dbt_utils.default__test_equal_rowcount": {"name": "default__test_equal_rowcount", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/equal_rowcount.sql", "original_file_path": "macros/generic_tests/equal_rowcount.sql", "unique_id": "macro.dbt_utils.default__test_equal_rowcount", "macro_sql": "{% macro default__test_equal_rowcount(model, compare_model, group_by_columns) %}\n\n{#-- Needs to be set at parse time, before we return '' below --#}\n{{ config(fail_calc = 'sum(coalesce(diff_count, 0))') }}\n\n{#-- Prevent querying of db in parsing mode. This works because this macro does not create any new refs. #}\n{%- if not execute -%}\n {{ return('') }}\n{% endif %}\n\n{% if group_by_columns|length() > 0 %}\n {% set select_gb_cols = group_by_columns|join(', ') + ', ' %}\n {% set join_gb_cols %}\n {% for c in group_by_columns %}\n and a.{{c}} = b.{{c}}\n {% endfor %}\n {% endset %}\n {% set groupby_gb_cols = 'group by ' + group_by_columns|join(',') %}\n{% endif %}\n\n{#-- We must add a fake join key in case additional grouping variables are not provided --#}\n{#-- Redshift does not allow for dynamically created join conditions (e.g. full join on 1 = 1 --#}\n{#-- The same logic is used in fewer_rows_than. In case of changes, maintain consistent logic --#}\n{% set group_by_columns = ['id_dbtutils_test_equal_rowcount'] + group_by_columns %}\n{% set groupby_gb_cols = 'group by ' + group_by_columns|join(',') %}\n\nwith a as (\n\n select \n {{select_gb_cols}}\n 1 as id_dbtutils_test_equal_rowcount,\n count(*) as count_a \n from {{ model }}\n {{groupby_gb_cols}}\n\n\n),\nb as (\n\n select \n {{select_gb_cols}}\n 1 as id_dbtutils_test_equal_rowcount,\n count(*) as count_b \n from {{ compare_model }}\n {{groupby_gb_cols}}\n\n),\nfinal as (\n\n select\n \n {% for c in group_by_columns -%}\n a.{{c}} as {{c}}_a,\n b.{{c}} as {{c}}_b,\n {% endfor %}\n\n count_a,\n count_b,\n abs(count_a - count_b) as diff_count\n\n from a\n full join b\n on\n a.id_dbtutils_test_equal_rowcount = b.id_dbtutils_test_equal_rowcount\n {{join_gb_cols}}\n\n\n)\n\nselect * from final\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "compare_model", "type": null, "description": ""}, {"name": "group_by_columns", "type": null, "description": ""}], "created_at": 1789419970.1218333, "supported_languages": null}, "macro.dbt_utils.test_sequential_values": {"name": "test_sequential_values", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/sequential_values.sql", "original_file_path": "macros/generic_tests/sequential_values.sql", "unique_id": "macro.dbt_utils.test_sequential_values", "macro_sql": "{% test sequential_values(model, column_name, interval=1, datepart=None, group_by_columns = []) %}\n\n {{ return(adapter.dispatch('test_sequential_values', 'dbt_utils')(model, column_name, interval, datepart, group_by_columns)) }}\n\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_sequential_values"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "column_name", "type": null, "description": ""}, {"name": "interval", "type": null, "description": ""}, {"name": "datepart", "type": null, "description": ""}, {"name": "group_by_columns", "type": null, "description": ""}], "created_at": 1789419970.1228077, "supported_languages": null}, "macro.dbt_utils.default__test_sequential_values": {"name": "default__test_sequential_values", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/sequential_values.sql", "original_file_path": "macros/generic_tests/sequential_values.sql", "unique_id": "macro.dbt_utils.default__test_sequential_values", "macro_sql": "{% macro default__test_sequential_values(model, column_name, interval=1, datepart=None, group_by_columns = []) %}\n\n{% set previous_column_name = \"previous_\" ~ dbt_utils.slugify(column_name) %}\n\n{% if group_by_columns|length() > 0 %}\n {% set select_gb_cols = group_by_columns|join(',') + ', ' %}\n {% set partition_gb_cols = 'partition by ' + group_by_columns|join(',') %}\n{% endif %}\n\nwith windowed as (\n\n select\n {{ select_gb_cols }}\n {{ column_name }},\n lag({{ column_name }}) over (\n {{partition_gb_cols}}\n order by {{ column_name }}\n ) as {{ previous_column_name }}\n from {{ model }}\n),\n\nvalidation_errors as (\n select\n *\n from windowed\n {% if datepart %}\n where not(cast({{ column_name }} as {{ dbt.type_timestamp() }})= cast({{ dbt.dateadd(datepart, interval, previous_column_name) }} as {{ dbt.type_timestamp() }}))\n {% else %}\n where not({{ column_name }} = {{ previous_column_name }} + {{ interval }})\n {% endif %}\n)\n\nselect *\nfrom validation_errors\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.slugify", "macro.dbt.type_timestamp", "macro.dbt.dateadd"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "column_name", "type": null, "description": ""}, {"name": "interval", "type": null, "description": ""}, {"name": "datepart", "type": null, "description": ""}, {"name": "group_by_columns", "type": null, "description": ""}], "created_at": 1789419970.1243303, "supported_languages": null}, "macro.dbt_utils.test_mutually_exclusive_ranges": {"name": "test_mutually_exclusive_ranges", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/mutually_exclusive_ranges.sql", "original_file_path": "macros/generic_tests/mutually_exclusive_ranges.sql", "unique_id": "macro.dbt_utils.test_mutually_exclusive_ranges", "macro_sql": "{% test mutually_exclusive_ranges(model, lower_bound_column, upper_bound_column, partition_by=None, gaps='allowed', zero_length_range_allowed=False) %}\n {{ return(adapter.dispatch('test_mutually_exclusive_ranges', 'dbt_utils')(model, lower_bound_column, upper_bound_column, partition_by, gaps, zero_length_range_allowed)) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_mutually_exclusive_ranges"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "lower_bound_column", "type": null, "description": ""}, {"name": "upper_bound_column", "type": null, "description": ""}, {"name": "partition_by", "type": null, "description": ""}, {"name": "gaps", "type": null, "description": ""}, {"name": "zero_length_range_allowed", "type": null, "description": ""}], "created_at": 1789419970.1257756, "supported_languages": null}, "macro.dbt_utils.default__test_mutually_exclusive_ranges": {"name": "default__test_mutually_exclusive_ranges", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/mutually_exclusive_ranges.sql", "original_file_path": "macros/generic_tests/mutually_exclusive_ranges.sql", "unique_id": "macro.dbt_utils.default__test_mutually_exclusive_ranges", "macro_sql": "{% macro default__test_mutually_exclusive_ranges(model, lower_bound_column, upper_bound_column, partition_by=None, gaps='allowed', zero_length_range_allowed=False) %}\n{% if gaps == 'not_allowed' %}\n {% set allow_gaps_operator='=' %}\n {% set allow_gaps_operator_in_words='equal_to' %}\n{% elif gaps == 'allowed' %}\n {% set allow_gaps_operator='<=' %}\n {% set allow_gaps_operator_in_words='less_than_or_equal_to' %}\n{% elif gaps == 'required' %}\n {% set allow_gaps_operator='<' %}\n {% set allow_gaps_operator_in_words='less_than' %}\n{% else %}\n {{ exceptions.raise_compiler_error(\n \"`gaps` argument for mutually_exclusive_ranges test must be one of ['not_allowed', 'allowed', 'required'] Got: '\" ~ gaps ~\"'.'\"\n ) }}\n{% endif %}\n{% if not zero_length_range_allowed %}\n {% set allow_zero_length_operator='<' %}\n {% set allow_zero_length_operator_in_words='less_than' %}\n{% elif zero_length_range_allowed %}\n {% set allow_zero_length_operator='<=' %}\n {% set allow_zero_length_operator_in_words='less_than_or_equal_to' %}\n{% else %}\n {{ exceptions.raise_compiler_error(\n \"`zero_length_range_allowed` argument for mutually_exclusive_ranges test must be one of [true, false] Got: '\" ~ zero_length_range_allowed ~\"'.'\"\n ) }}\n{% endif %}\n\n{% set partition_clause=\"partition by \" ~ partition_by if partition_by else '' %}\n\nwith window_functions as (\n\n select\n {% if partition_by %}\n {{ partition_by }} as partition_by_col,\n {% endif %}\n {{ lower_bound_column }} as lower_bound,\n {{ upper_bound_column }} as upper_bound,\n\n lead({{ lower_bound_column }}) over (\n {{ partition_clause }}\n order by {{ lower_bound_column }}, {{ upper_bound_column }}\n ) as next_lower_bound,\n\n row_number() over (\n {{ partition_clause }}\n order by {{ lower_bound_column }} desc, {{ upper_bound_column }} desc\n ) = 1 as is_last_record\n\n from {{ model }}\n\n),\n\ncalc as (\n -- We want to return records where one of our assumptions fails, so we'll use\n -- the `not` function with `and` statements so we can write our assumptions more cleanly\n select\n *,\n\n -- For each record: lower_bound should be < upper_bound.\n -- Coalesce it to return an error on the null case (implicit assumption\n -- these columns are not_null)\n coalesce(\n lower_bound {{ allow_zero_length_operator }} upper_bound,\n false\n ) as lower_bound_{{ allow_zero_length_operator_in_words }}_upper_bound,\n\n -- For each record: upper_bound {{ allow_gaps_operator }} the next lower_bound.\n -- Coalesce it to handle null cases for the last record.\n coalesce(\n upper_bound {{ allow_gaps_operator }} next_lower_bound,\n is_last_record,\n false\n ) as upper_bound_{{ allow_gaps_operator_in_words }}_next_lower_bound\n\n from window_functions\n\n),\n\nvalidation_errors as (\n\n select\n *\n from calc\n\n where not(\n -- THE FOLLOWING SHOULD BE TRUE --\n lower_bound_{{ allow_zero_length_operator_in_words }}_upper_bound\n and upper_bound_{{ allow_gaps_operator_in_words }}_next_lower_bound\n )\n)\n\nselect * from validation_errors\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "lower_bound_column", "type": null, "description": ""}, {"name": "upper_bound_column", "type": null, "description": ""}, {"name": "partition_by", "type": null, "description": ""}, {"name": "gaps", "type": null, "description": ""}, {"name": "zero_length_range_allowed", "type": null, "description": ""}], "created_at": 1789419970.1290267, "supported_languages": null}, "macro.dbt_utils.test_cardinality_equality": {"name": "test_cardinality_equality", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/cardinality_equality.sql", "original_file_path": "macros/generic_tests/cardinality_equality.sql", "unique_id": "macro.dbt_utils.test_cardinality_equality", "macro_sql": "{% test cardinality_equality(model, column_name, to, field) %}\n {{ return(adapter.dispatch('test_cardinality_equality', 'dbt_utils')(model, column_name, to, field)) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_cardinality_equality"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "column_name", "type": null, "description": ""}, {"name": "to", "type": null, "description": ""}, {"name": "field", "type": null, "description": ""}], "created_at": 1789419970.1297812, "supported_languages": null}, "macro.dbt_utils.default__test_cardinality_equality": {"name": "default__test_cardinality_equality", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/cardinality_equality.sql", "original_file_path": "macros/generic_tests/cardinality_equality.sql", "unique_id": "macro.dbt_utils.default__test_cardinality_equality", "macro_sql": "{% macro default__test_cardinality_equality(model, column_name, to, field) %}\n\n{# T-SQL does not let you use numbers as aliases for columns #}\n{# Thus, no \"GROUP BY 1\" #}\n\nwith table_a as (\nselect\n {{ column_name }},\n count(*) as num_rows\nfrom {{ model }}\ngroup by {{ column_name }}\n),\n\ntable_b as (\nselect\n {{ field }},\n count(*) as num_rows\nfrom {{ to }}\ngroup by {{ field }}\n),\n\nexcept_a as (\n select *\n from table_a\n {{ dbt.except() }}\n select *\n from table_b\n),\n\nexcept_b as (\n select *\n from table_b\n {{ dbt.except() }}\n select *\n from table_a\n),\n\nunioned as (\n select *\n from except_a\n union all\n select *\n from except_b\n)\n\nselect *\nfrom unioned\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.except"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "column_name", "type": null, "description": ""}, {"name": "to", "type": null, "description": ""}, {"name": "field", "type": null, "description": ""}], "created_at": 1789419970.130413, "supported_languages": null}, "macro.dbt_utils.test_relationships_where": {"name": "test_relationships_where", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/relationships_where.sql", "original_file_path": "macros/generic_tests/relationships_where.sql", "unique_id": "macro.dbt_utils.test_relationships_where", "macro_sql": "{% test relationships_where(model, column_name, to, field, from_condition=\"1=1\", to_condition=\"1=1\") %}\n {{ return(adapter.dispatch('test_relationships_where', 'dbt_utils')(model, column_name, to, field, from_condition, to_condition)) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_relationships_where"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "column_name", "type": null, "description": ""}, {"name": "to", "type": null, "description": ""}, {"name": "field", "type": null, "description": ""}, {"name": "from_condition", "type": null, "description": ""}, {"name": "to_condition", "type": null, "description": ""}], "created_at": 1789419970.1312592, "supported_languages": null}, "macro.dbt_utils.default__test_relationships_where": {"name": "default__test_relationships_where", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/relationships_where.sql", "original_file_path": "macros/generic_tests/relationships_where.sql", "unique_id": "macro.dbt_utils.default__test_relationships_where", "macro_sql": "{% macro default__test_relationships_where(model, column_name, to, field, from_condition=\"1=1\", to_condition=\"1=1\") %}\n\n{# T-SQL has no boolean data type so we use 1=1 which returns TRUE #}\n{# ref https://stackoverflow.com/a/7170753/3842610 #}\n\nwith left_table as (\n\n select\n {{column_name}} as id\n\n from {{model}}\n\n where {{column_name}} is not null\n and {{from_condition}}\n\n),\n\nright_table as (\n\n select\n {{field}} as id\n\n from {{to}}\n\n where {{field}} is not null\n and {{to_condition}}\n\n),\n\nexceptions as (\n\n select\n left_table.id,\n right_table.id as right_id\n\n from left_table\n\n left join right_table\n on left_table.id = right_table.id\n\n where right_table.id is null\n\n)\n\nselect * from exceptions\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "column_name", "type": null, "description": ""}, {"name": "to", "type": null, "description": ""}, {"name": "field", "type": null, "description": ""}, {"name": "from_condition", "type": null, "description": ""}, {"name": "to_condition", "type": null, "description": ""}], "created_at": 1789419970.1318703, "supported_languages": null}, "macro.dbt_utils.test_expression_is_true": {"name": "test_expression_is_true", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/expression_is_true.sql", "original_file_path": "macros/generic_tests/expression_is_true.sql", "unique_id": "macro.dbt_utils.test_expression_is_true", "macro_sql": "{% test expression_is_true(model, expression, column_name=None) %}\n {{ return(adapter.dispatch('test_expression_is_true', 'dbt_utils')(model, expression, column_name)) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_expression_is_true"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "expression", "type": null, "description": ""}, {"name": "column_name", "type": null, "description": ""}], "created_at": 1789419970.1325073, "supported_languages": null}, "macro.dbt_utils.default__test_expression_is_true": {"name": "default__test_expression_is_true", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/expression_is_true.sql", "original_file_path": "macros/generic_tests/expression_is_true.sql", "unique_id": "macro.dbt_utils.default__test_expression_is_true", "macro_sql": "{% macro default__test_expression_is_true(model, expression, column_name) %}\n\n{% set column_list = '*' if should_store_failures() else \"1\" %}\n\nselect\n {{ column_list }}\nfrom {{ model }}\n{% if column_name is none %}\nwhere not({{ expression }})\n{%- else %}\nwhere not({{ column_name }} {{ expression }})\n{%- endif %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.should_store_failures"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "expression", "type": null, "description": ""}, {"name": "column_name", "type": null, "description": ""}], "created_at": 1789419970.1331348, "supported_languages": null}, "macro.dbt_utils.test_not_accepted_values": {"name": "test_not_accepted_values", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/not_accepted_values.sql", "original_file_path": "macros/generic_tests/not_accepted_values.sql", "unique_id": "macro.dbt_utils.test_not_accepted_values", "macro_sql": "{% test not_accepted_values(model, column_name, values, quote=True) %}\n {{ return(adapter.dispatch('test_not_accepted_values', 'dbt_utils')(model, column_name, values, quote)) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_not_accepted_values"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "column_name", "type": null, "description": ""}, {"name": "values", "type": null, "description": ""}, {"name": "quote", "type": null, "description": ""}], "created_at": 1789419970.1338518, "supported_languages": null}, "macro.dbt_utils.default__test_not_accepted_values": {"name": "default__test_not_accepted_values", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/not_accepted_values.sql", "original_file_path": "macros/generic_tests/not_accepted_values.sql", "unique_id": "macro.dbt_utils.default__test_not_accepted_values", "macro_sql": "{% macro default__test_not_accepted_values(model, column_name, values, quote=True) %}\nwith all_values as (\n\n select distinct\n {{ column_name }} as value_field\n\n from {{ model }}\n\n),\n\nvalidation_errors as (\n\n select\n value_field\n\n from all_values\n where value_field in (\n {% for value in values -%}\n {% if quote -%}\n '{{ value }}'\n {%- else -%}\n {{ value }}\n {%- endif -%}\n {%- if not loop.last -%},{%- endif %}\n {%- endfor %}\n )\n\n)\n\nselect *\nfrom validation_errors\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "column_name", "type": null, "description": ""}, {"name": "values", "type": null, "description": ""}, {"name": "quote", "type": null, "description": ""}], "created_at": 1789419970.134517, "supported_languages": null}, "macro.dbt_utils.test_accepted_range": {"name": "test_accepted_range", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/accepted_range.sql", "original_file_path": "macros/generic_tests/accepted_range.sql", "unique_id": "macro.dbt_utils.test_accepted_range", "macro_sql": "{% test accepted_range(model, column_name, min_value=none, max_value=none, inclusive=true) %}\n {{ return(adapter.dispatch('test_accepted_range', 'dbt_utils')(model, column_name, min_value, max_value, inclusive)) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_accepted_range"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "column_name", "type": null, "description": ""}, {"name": "min_value", "type": null, "description": ""}, {"name": "max_value", "type": null, "description": ""}, {"name": "inclusive", "type": null, "description": ""}], "created_at": 1789419970.1353366, "supported_languages": null}, "macro.dbt_utils.default__test_accepted_range": {"name": "default__test_accepted_range", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/accepted_range.sql", "original_file_path": "macros/generic_tests/accepted_range.sql", "unique_id": "macro.dbt_utils.default__test_accepted_range", "macro_sql": "{% macro default__test_accepted_range(model, column_name, min_value=none, max_value=none, inclusive=true) %}\n\nwith meet_condition as(\n select *\n from {{ model }}\n),\n\nvalidation_errors as (\n select *\n from meet_condition\n where\n -- never true, defaults to an empty result set. Exists to ensure any combo of the `or` clauses below succeeds\n 1 = 2\n\n {%- if min_value is not none %}\n -- records with a value >= min_value are permitted. The `not` flips this to find records that don't meet the rule.\n or not {{ column_name }} > {{- \"=\" if inclusive }} {{ min_value }}\n {%- endif %}\n\n {%- if max_value is not none %}\n -- records with a value <= max_value are permitted. The `not` flips this to find records that don't meet the rule.\n or not {{ column_name }} < {{- \"=\" if inclusive }} {{ max_value }}\n {%- endif %}\n)\n\nselect *\nfrom validation_errors\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "column_name", "type": null, "description": ""}, {"name": "min_value", "type": null, "description": ""}, {"name": "max_value", "type": null, "description": ""}, {"name": "inclusive", "type": null, "description": ""}], "created_at": 1789419970.1361694, "supported_languages": null}, "macro.dbt_utils.get_url_parameter": {"name": "get_url_parameter", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/web/get_url_parameter.sql", "original_file_path": "macros/web/get_url_parameter.sql", "unique_id": "macro.dbt_utils.get_url_parameter", "macro_sql": "{% macro get_url_parameter(field, url_parameter) -%}\n {{ return(adapter.dispatch('get_url_parameter', 'dbt_utils')(field, url_parameter)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__get_url_parameter"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field", "type": null, "description": ""}, {"name": "url_parameter", "type": null, "description": ""}], "created_at": 1789419970.1367085, "supported_languages": null}, "macro.dbt_utils.default__get_url_parameter": {"name": "default__get_url_parameter", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/web/get_url_parameter.sql", "original_file_path": "macros/web/get_url_parameter.sql", "unique_id": "macro.dbt_utils.default__get_url_parameter", "macro_sql": "{% macro default__get_url_parameter(field, url_parameter) -%}\n\n{%- set formatted_url_parameter = \"'\" + url_parameter + \"='\" -%}\n\n{%- set split = dbt.split_part(dbt.split_part(field, formatted_url_parameter, 2), \"'&'\", 1) -%}\n\nnullif({{ split }},'')\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.split_part"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field", "type": null, "description": ""}, {"name": "url_parameter", "type": null, "description": ""}], "created_at": 1789419970.1373038, "supported_languages": null}, "macro.dbt_utils.get_url_host": {"name": "get_url_host", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/web/get_url_host.sql", "original_file_path": "macros/web/get_url_host.sql", "unique_id": "macro.dbt_utils.get_url_host", "macro_sql": "{% macro get_url_host(field) -%}\n {{ return(adapter.dispatch('get_url_host', 'dbt_utils')(field)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__get_url_host"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field", "type": null, "description": ""}], "created_at": 1789419970.13785, "supported_languages": null}, "macro.dbt_utils.default__get_url_host": {"name": "default__get_url_host", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/web/get_url_host.sql", "original_file_path": "macros/web/get_url_host.sql", "unique_id": "macro.dbt_utils.default__get_url_host", "macro_sql": "{% macro default__get_url_host(field) -%}\n\n{%- set parsed =\n dbt.split_part(\n dbt.split_part(\n dbt.replace(\n dbt.replace(\n dbt.replace(field, \"'android-app://'\", \"''\"\n ), \"'http://'\", \"''\"\n ), \"'https://'\", \"''\"\n ), \"'/'\", 1\n ), \"'?'\", 1\n )\n\n-%}\n\n\n {{ dbt.safe_cast(\n parsed,\n dbt.type_string()\n )}}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.split_part", "macro.dbt.replace", "macro.dbt.safe_cast", "macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field", "type": null, "description": ""}], "created_at": 1789419970.1388009, "supported_languages": null}, "macro.dbt_utils.get_url_path": {"name": "get_url_path", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/web/get_url_path.sql", "original_file_path": "macros/web/get_url_path.sql", "unique_id": "macro.dbt_utils.get_url_path", "macro_sql": "{% macro get_url_path(field) -%}\n {{ return(adapter.dispatch('get_url_path', 'dbt_utils')(field)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__get_url_path"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field", "type": null, "description": ""}], "created_at": 1789419970.139395, "supported_languages": null}, "macro.dbt_utils.default__get_url_path": {"name": "default__get_url_path", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/web/get_url_path.sql", "original_file_path": "macros/web/get_url_path.sql", "unique_id": "macro.dbt_utils.default__get_url_path", "macro_sql": "{% macro default__get_url_path(field) -%}\n\n {%- set stripped_url =\n dbt.replace(\n dbt.replace(field, \"'http://'\", \"''\"), \"'https://'\", \"''\")\n -%}\n\n {%- set first_slash_pos -%}\n coalesce(\n nullif({{ dbt.position(\"'/'\", stripped_url) }}, 0),\n {{ dbt.position(\"'?'\", stripped_url) }} - 1\n )\n {%- endset -%}\n\n {%- set parsed_path =\n dbt.split_part(\n dbt.right(\n stripped_url,\n dbt.length(stripped_url) ~ \"-\" ~ first_slash_pos\n ),\n \"'?'\", 1\n )\n -%}\n\n {{ dbt.safe_cast(\n parsed_path,\n dbt.type_string()\n )}}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.replace", "macro.dbt.position", "macro.dbt.split_part", "macro.dbt.right", "macro.dbt.length", "macro.dbt.safe_cast", "macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field", "type": null, "description": ""}], "created_at": 1789419970.1406825, "supported_languages": null}, "macro.dbt_utils.get_column_values": {"name": "get_column_values", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_column_values.sql", "original_file_path": "macros/sql/get_column_values.sql", "unique_id": "macro.dbt_utils.get_column_values", "macro_sql": "{% macro get_column_values(table, column, order_by='count(*) desc', max_records=none, default=none, where=none) -%}\n {{ return(adapter.dispatch('get_column_values', 'dbt_utils')(table, column, order_by, max_records, default, where)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__get_column_values"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "table", "type": null, "description": ""}, {"name": "column", "type": null, "description": ""}, {"name": "order_by", "type": null, "description": ""}, {"name": "max_records", "type": null, "description": ""}, {"name": "default", "type": null, "description": ""}, {"name": "where", "type": null, "description": ""}], "created_at": 1789419970.142035, "supported_languages": null}, "macro.dbt_utils.default__get_column_values": {"name": "default__get_column_values", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_column_values.sql", "original_file_path": "macros/sql/get_column_values.sql", "unique_id": "macro.dbt_utils.default__get_column_values", "macro_sql": "{% macro default__get_column_values(table, column, order_by='count(*) desc', max_records=none, default=none, where=none) -%}\n {#-- Prevent querying of db in parsing mode. This works because this macro does not create any new refs. #}\n {%- if not execute -%}\n {% set default = [] if not default %}\n {{ return(default) }}\n {% endif %}\n\n {%- do dbt_utils._is_ephemeral(table, 'get_column_values') -%}\n\n {# Not all relations are tables. Renaming for internal clarity without breaking functionality for anyone using named arguments #}\n {# TODO: Change the method signature in a future 0.x.0 release #}\n {%- set target_relation = table -%}\n\n {# adapter.load_relation is a convenience wrapper to avoid building a Relation when we already have one #}\n {% set relation_exists = (load_relation(target_relation)) is not none %}\n\n {%- call statement('get_column_values', fetch_result=true) %}\n\n {%- if not relation_exists and default is none -%}\n\n {{ exceptions.raise_compiler_error(\"In get_column_values(): relation \" ~ target_relation ~ \" does not exist and no default value was provided.\") }}\n\n {%- elif not relation_exists and default is not none -%}\n\n {{ log(\"Relation \" ~ target_relation ~ \" does not exist. Returning the default value: \" ~ default) }}\n\n {{ return(default) }}\n\n {%- else -%}\n\n\n select\n {{ column }} as value\n\n from {{ target_relation }}\n\n {% if where is not none %}\n where {{ where }}\n {% endif %}\n\n group by {{ column }}\n order by {{ order_by }}\n\n {% if max_records is not none %}\n limit {{ max_records }}\n {% endif %}\n\n {% endif %}\n\n {%- endcall -%}\n\n {%- set value_list = load_result('get_column_values') -%}\n\n {%- if value_list and value_list['data'] -%}\n {%- set values = value_list['data'] | map(attribute=0) | list %}\n {{ return(values) }}\n {%- else -%}\n {{ return(default) }}\n {%- endif -%}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_utils._is_ephemeral", "macro.dbt.load_relation", "macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "table", "type": null, "description": ""}, {"name": "column", "type": null, "description": ""}, {"name": "order_by", "type": null, "description": ""}, {"name": "max_records", "type": null, "description": ""}, {"name": "default", "type": null, "description": ""}, {"name": "where", "type": null, "description": ""}], "created_at": 1789419970.144614, "supported_languages": null}, "macro.dbt_utils.star": {"name": "star", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/star.sql", "original_file_path": "macros/sql/star.sql", "unique_id": "macro.dbt_utils.star", "macro_sql": "{% macro star(from, relation_alias=False, except=[], prefix='', suffix='', quote_identifiers=True, unquote_aliases=False, rename={}) -%}\r\n {{ return(adapter.dispatch('star', 'dbt_utils')(from, relation_alias, except, prefix, suffix, quote_identifiers, unquote_aliases, rename)) }}\r\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__star"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "from", "type": null, "description": ""}, {"name": "relation_alias", "type": null, "description": ""}, {"name": "except", "type": null, "description": ""}, {"name": "prefix", "type": null, "description": ""}, {"name": "suffix", "type": null, "description": ""}, {"name": "quote_identifiers", "type": null, "description": ""}, {"name": "unquote_aliases", "type": null, "description": ""}, {"name": "rename", "type": null, "description": ""}], "created_at": 1789419970.1463027, "supported_languages": null}, "macro.dbt_utils.default__star": {"name": "default__star", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/star.sql", "original_file_path": "macros/sql/star.sql", "unique_id": "macro.dbt_utils.default__star", "macro_sql": "{% macro default__star(from, relation_alias=False, except=[], prefix='', suffix='', quote_identifiers=True, unquote_aliases=False, rename={}) -%}\r\n {%- do dbt_utils._is_relation(from, 'star') -%}\r\n {%- do dbt_utils._is_ephemeral(from, 'star') -%}\r\n\r\n {#-- Prevent querying of db in parsing mode. This works because this macro does not create any new refs. #}\r\n {%- if not execute -%}\r\n {% do return('*') %}\r\n {%- endif -%}\r\n\r\n {% set cols = dbt_utils.get_filtered_columns_in_relation(from, except) %}\r\n\r\n {%- set rename_lower = {} -%}\r\n {%- for key, val in rename.items() -%}\r\n {%- do rename_lower.update({key.lower(): val}) -%}\r\n {%- endfor -%}\r\n\r\n {%- if cols|length <= 0 -%}\r\n {% if flags.WHICH == 'compile' %}\r\n {% set response %}\r\n*\r\n/* No columns were returned. Maybe the relation doesn't exist yet\r\nor all columns were excluded. This star is only output during\r\ndbt compile, and exists to keep SQLFluff happy. */\r\n {% endset %}\r\n {% do return(response) %}\r\n {% else %}\r\n {% do return(\"/* no columns returned from star() macro */\") %}\r\n {% endif %}\r\n {%- else -%}\r\n {%- for col in cols %}\r\n {%- if relation_alias %}{{ relation_alias }}.{% else %}{%- endif -%}\r\n {%- if quote_identifiers -%}\r\n {{ adapter.quote(col)|trim }}\r\n {%- if col.lower() in rename_lower %} as {{ rename_lower[col.lower()] }}\r\n {%- elif unquote_aliases %} as {{ (prefix ~ col ~ suffix)|trim }}\r\n {%- elif prefix!='' or suffix!='' %} as {{ adapter.quote(prefix ~ col ~ suffix)|trim }}\r\n {%- endif -%}\r\n {%- else -%}\r\n {{ col|trim }}\r\n {%- if col.lower() in rename_lower %} as {{ rename_lower[col.lower()] }}\r\n {%- elif prefix!='' or suffix!='' %} as {{ (prefix ~ col ~ suffix)|trim }}\r\n {%- endif -%}\r\n {%- endif -%}\r\n {%- if not loop.last %},{{ '\\n ' }}{%- endif -%}\r\n {%- endfor -%}\r\n {% endif %}\r\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_utils._is_relation", "macro.dbt_utils._is_ephemeral", "macro.dbt_utils.get_filtered_columns_in_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "from", "type": null, "description": ""}, {"name": "relation_alias", "type": null, "description": ""}, {"name": "except", "type": null, "description": ""}, {"name": "prefix", "type": null, "description": ""}, {"name": "suffix", "type": null, "description": ""}, {"name": "quote_identifiers", "type": null, "description": ""}, {"name": "unquote_aliases", "type": null, "description": ""}, {"name": "rename", "type": null, "description": ""}], "created_at": 1789419970.1497917, "supported_languages": null}, "macro.dbt_utils.get_table_types_sql": {"name": "get_table_types_sql", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_table_types_sql.sql", "original_file_path": "macros/sql/get_table_types_sql.sql", "unique_id": "macro.dbt_utils.get_table_types_sql", "macro_sql": "{%- macro get_table_types_sql() -%}\n {{ return(adapter.dispatch('get_table_types_sql', 'dbt_utils')()) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt_utils.postgres__get_table_types_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789419970.1504443, "supported_languages": null}, "macro.dbt_utils.default__get_table_types_sql": {"name": "default__get_table_types_sql", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_table_types_sql.sql", "original_file_path": "macros/sql/get_table_types_sql.sql", "unique_id": "macro.dbt_utils.default__get_table_types_sql", "macro_sql": "{% macro default__get_table_types_sql() %}\n case table_type\n when 'BASE TABLE' then 'table'\n when 'EXTERNAL TABLE' then 'external'\n when 'MATERIALIZED VIEW' then 'materializedview'\n else lower(table_type)\n end as {{ adapter.quote('table_type') }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789419970.1507018, "supported_languages": null}, "macro.dbt_utils.postgres__get_table_types_sql": {"name": "postgres__get_table_types_sql", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_table_types_sql.sql", "original_file_path": "macros/sql/get_table_types_sql.sql", "unique_id": "macro.dbt_utils.postgres__get_table_types_sql", "macro_sql": "{% macro postgres__get_table_types_sql() %}\n case table_type\n when 'BASE TABLE' then 'table'\n when 'FOREIGN' then 'external'\n when 'MATERIALIZED VIEW' then 'materializedview'\n else lower(table_type)\n end as {{ adapter.quote('table_type') }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789419970.1509905, "supported_languages": null}, "macro.dbt_utils.databricks__get_table_types_sql": {"name": "databricks__get_table_types_sql", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_table_types_sql.sql", "original_file_path": "macros/sql/get_table_types_sql.sql", "unique_id": "macro.dbt_utils.databricks__get_table_types_sql", "macro_sql": "{% macro databricks__get_table_types_sql() %}\n case table_type\n when 'MANAGED' then 'table'\n when 'BASE TABLE' then 'table'\n when 'MATERIALIZED VIEW' then 'materializedview'\n else lower(table_type)\n end as {{ adapter.quote('table_type') }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789419970.151238, "supported_languages": null}, "macro.dbt_utils.get_tables_by_pattern_sql": {"name": "get_tables_by_pattern_sql", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_tables_by_pattern_sql.sql", "original_file_path": "macros/sql/get_tables_by_pattern_sql.sql", "unique_id": "macro.dbt_utils.get_tables_by_pattern_sql", "macro_sql": "{% macro get_tables_by_pattern_sql(schema_pattern, table_pattern, exclude='', database=target.database) %}\n {{ return(adapter.dispatch('get_tables_by_pattern_sql', 'dbt_utils')\n (schema_pattern, table_pattern, exclude, database)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__get_tables_by_pattern_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "schema_pattern", "type": null, "description": ""}, {"name": "table_pattern", "type": null, "description": ""}, {"name": "exclude", "type": null, "description": ""}, {"name": "database", "type": null, "description": ""}], "created_at": 1789419970.1526752, "supported_languages": null}, "macro.dbt_utils.default__get_tables_by_pattern_sql": {"name": "default__get_tables_by_pattern_sql", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_tables_by_pattern_sql.sql", "original_file_path": "macros/sql/get_tables_by_pattern_sql.sql", "unique_id": "macro.dbt_utils.default__get_tables_by_pattern_sql", "macro_sql": "{% macro default__get_tables_by_pattern_sql(schema_pattern, table_pattern, exclude='', database=target.database) %}\n\n select distinct\n table_schema as {{ adapter.quote('table_schema') }},\n table_name as {{ adapter.quote('table_name') }},\n {{ dbt_utils.get_table_types_sql() }}\n from {{ database }}.information_schema.tables\n where table_schema ilike '{{ schema_pattern }}'\n and table_name ilike '{{ table_pattern }}'\n and table_name not ilike '{{ exclude }}'\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.get_table_types_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "schema_pattern", "type": null, "description": ""}, {"name": "table_pattern", "type": null, "description": ""}, {"name": "exclude", "type": null, "description": ""}, {"name": "database", "type": null, "description": ""}], "created_at": 1789419970.1533122, "supported_languages": null}, "macro.dbt_utils.redshift__get_tables_by_pattern_sql": {"name": "redshift__get_tables_by_pattern_sql", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_tables_by_pattern_sql.sql", "original_file_path": "macros/sql/get_tables_by_pattern_sql.sql", "unique_id": "macro.dbt_utils.redshift__get_tables_by_pattern_sql", "macro_sql": "{% macro redshift__get_tables_by_pattern_sql(schema_pattern, table_pattern, exclude='', database=target.database) %}\n\n {% set sql %}\n select distinct\n table_schema as {{ adapter.quote('table_schema') }},\n table_name as {{ adapter.quote('table_name') }},\n {{ dbt_utils.get_table_types_sql() }}\n from \"{{ database }}\".\"information_schema\".\"tables\"\n where table_schema ilike '{{ schema_pattern }}'\n and table_name ilike '{{ table_pattern }}'\n and table_name not ilike '{{ exclude }}'\n union all\n select distinct\n schemaname as {{ adapter.quote('table_schema') }},\n tablename as {{ adapter.quote('table_name') }},\n 'external' as {{ adapter.quote('table_type') }}\n from svv_external_tables\n where redshift_database_name = '{{ database }}'\n and schemaname ilike '{{ schema_pattern }}'\n and table_name ilike '{{ table_pattern }}'\n and table_name not ilike '{{ exclude }}'\n {% endset %}\n\n {{ return(sql) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.get_table_types_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "schema_pattern", "type": null, "description": ""}, {"name": "table_pattern", "type": null, "description": ""}, {"name": "exclude", "type": null, "description": ""}, {"name": "database", "type": null, "description": ""}], "created_at": 1789419970.154469, "supported_languages": null}, "macro.dbt_utils.bigquery__get_tables_by_pattern_sql": {"name": "bigquery__get_tables_by_pattern_sql", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_tables_by_pattern_sql.sql", "original_file_path": "macros/sql/get_tables_by_pattern_sql.sql", "unique_id": "macro.dbt_utils.bigquery__get_tables_by_pattern_sql", "macro_sql": "{% macro bigquery__get_tables_by_pattern_sql(schema_pattern, table_pattern, exclude='', database=target.database) %}\n\n {% if '%' in schema_pattern %}\n {% set schemata=dbt_utils._bigquery__get_matching_schemata(schema_pattern, database) %}\n {% else %}\n {% set schemata=[schema_pattern] %}\n {% endif %}\n\n {% set sql %}\n {% for schema in schemata %}\n select distinct\n table_schema,\n table_name,\n {{ dbt_utils.get_table_types_sql() }}\n\n from {{ adapter.quote(database) }}.{{ schema }}.INFORMATION_SCHEMA.TABLES\n where lower(table_name) like lower ('{{ table_pattern }}')\n and lower(table_name) not like lower ('{{ exclude }}')\n\n {% if not loop.last %} union all {% endif %}\n\n {% endfor %}\n {% endset %}\n\n {{ return(sql) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils._bigquery__get_matching_schemata", "macro.dbt_utils.get_table_types_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "schema_pattern", "type": null, "description": ""}, {"name": "table_pattern", "type": null, "description": ""}, {"name": "exclude", "type": null, "description": ""}, {"name": "database", "type": null, "description": ""}], "created_at": 1789419970.1557012, "supported_languages": null}, "macro.dbt_utils._bigquery__get_matching_schemata": {"name": "_bigquery__get_matching_schemata", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_tables_by_pattern_sql.sql", "original_file_path": "macros/sql/get_tables_by_pattern_sql.sql", "unique_id": "macro.dbt_utils._bigquery__get_matching_schemata", "macro_sql": "{% macro _bigquery__get_matching_schemata(schema_pattern, database) %}\n {% if execute %}\n\n {% set sql %}\n select schema_name from {{ adapter.quote(database) }}.INFORMATION_SCHEMA.SCHEMATA\n where lower(schema_name) like lower('{{ schema_pattern }}')\n {% endset %}\n\n {% set results=run_query(sql) %}\n\n {% set schemata=results.columns['schema_name'].values() %}\n\n {{ return(schemata) }}\n\n {% else %}\n\n {{ return([]) }}\n\n {% endif %}\n\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "schema_pattern", "type": null, "description": ""}, {"name": "database", "type": null, "description": ""}], "created_at": 1789419970.1565714, "supported_languages": null}, "macro.dbt_utils.get_tables_by_prefix_sql": {"name": "get_tables_by_prefix_sql", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_tables_by_prefix_sql.sql", "original_file_path": "macros/sql/get_tables_by_prefix_sql.sql", "unique_id": "macro.dbt_utils.get_tables_by_prefix_sql", "macro_sql": "{% macro get_tables_by_prefix_sql(schema, prefix, exclude='', database=target.database) %}\n {{ return(adapter.dispatch('get_tables_by_prefix_sql', 'dbt_utils')(schema, prefix, exclude, database)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__get_tables_by_prefix_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "schema", "type": null, "description": ""}, {"name": "prefix", "type": null, "description": ""}, {"name": "exclude", "type": null, "description": ""}, {"name": "database", "type": null, "description": ""}], "created_at": 1789419970.157258, "supported_languages": null}, "macro.dbt_utils.default__get_tables_by_prefix_sql": {"name": "default__get_tables_by_prefix_sql", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_tables_by_prefix_sql.sql", "original_file_path": "macros/sql/get_tables_by_prefix_sql.sql", "unique_id": "macro.dbt_utils.default__get_tables_by_prefix_sql", "macro_sql": "{% macro default__get_tables_by_prefix_sql(schema, prefix, exclude='', database=target.database) %}\n\n {{ dbt_utils.get_tables_by_pattern_sql(\n schema_pattern = schema,\n table_pattern = prefix ~ '%',\n exclude = exclude,\n database = database\n ) }}\n \n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.get_tables_by_pattern_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "schema", "type": null, "description": ""}, {"name": "prefix", "type": null, "description": ""}, {"name": "exclude", "type": null, "description": ""}, {"name": "database", "type": null, "description": ""}], "created_at": 1789419970.157757, "supported_languages": null}, "macro.dbt_utils.degrees_to_radians": {"name": "degrees_to_radians", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/haversine_distance.sql", "original_file_path": "macros/sql/haversine_distance.sql", "unique_id": "macro.dbt_utils.degrees_to_radians", "macro_sql": "{% macro degrees_to_radians(degrees) -%}\n acos(-1) * {{degrees}} / 180\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "degrees", "type": null, "description": ""}], "created_at": 1789419970.1585302, "supported_languages": null}, "macro.dbt_utils.haversine_distance": {"name": "haversine_distance", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/haversine_distance.sql", "original_file_path": "macros/sql/haversine_distance.sql", "unique_id": "macro.dbt_utils.haversine_distance", "macro_sql": "{% macro haversine_distance(lat1, lon1, lat2, lon2, unit='mi') -%}\n {{ return(adapter.dispatch('haversine_distance', 'dbt_utils')(lat1,lon1,lat2,lon2,unit)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__haversine_distance"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "lat1", "type": null, "description": ""}, {"name": "lon1", "type": null, "description": ""}, {"name": "lat2", "type": null, "description": ""}, {"name": "lon2", "type": null, "description": ""}, {"name": "unit", "type": null, "description": ""}], "created_at": 1789419970.1590133, "supported_languages": null}, "macro.dbt_utils.default__haversine_distance": {"name": "default__haversine_distance", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/haversine_distance.sql", "original_file_path": "macros/sql/haversine_distance.sql", "unique_id": "macro.dbt_utils.default__haversine_distance", "macro_sql": "{% macro default__haversine_distance(lat1, lon1, lat2, lon2, unit='mi') -%}\n{%- if unit == 'mi' %}\n {% set conversion_rate = 1 %}\n{% elif unit == 'km' %}\n {% set conversion_rate = 1.60934 %}\n{% else %}\n {{ exceptions.raise_compiler_error(\"unit input must be one of 'mi' or 'km'. Got \" ~ unit) }}\n{% endif %}\n\n 2 * 3961 * asin(sqrt(power((sin(radians(({{ lat2 }} - {{ lat1 }}) / 2))), 2) +\n cos(radians({{lat1}})) * cos(radians({{lat2}})) *\n power((sin(radians(({{ lon2 }} - {{ lon1 }}) / 2))), 2))) * {{ conversion_rate }}\n\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "lat1", "type": null, "description": ""}, {"name": "lon1", "type": null, "description": ""}, {"name": "lat2", "type": null, "description": ""}, {"name": "lon2", "type": null, "description": ""}, {"name": "unit", "type": null, "description": ""}], "created_at": 1789419970.1601026, "supported_languages": null}, "macro.dbt_utils.bigquery__haversine_distance": {"name": "bigquery__haversine_distance", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/haversine_distance.sql", "original_file_path": "macros/sql/haversine_distance.sql", "unique_id": "macro.dbt_utils.bigquery__haversine_distance", "macro_sql": "{% macro bigquery__haversine_distance(lat1, lon1, lat2, lon2, unit='mi') -%}\n{% set radians_lat1 = dbt_utils.degrees_to_radians(lat1) %}\n{% set radians_lat2 = dbt_utils.degrees_to_radians(lat2) %}\n{% set radians_lon1 = dbt_utils.degrees_to_radians(lon1) %}\n{% set radians_lon2 = dbt_utils.degrees_to_radians(lon2) %}\n{%- if unit == 'mi' %}\n {% set conversion_rate = 1 %}\n{% elif unit == 'km' %}\n {% set conversion_rate = 1.60934 %}\n{% else %}\n {{ exceptions.raise_compiler_error(\"unit input must be one of 'mi' or 'km'. Got \" ~ unit) }}\n{% endif %}\n 2 * 3961 * asin(sqrt(power(sin(({{ radians_lat2 }} - {{ radians_lat1 }}) / 2), 2) +\n cos({{ radians_lat1 }}) * cos({{ radians_lat2 }}) *\n power(sin(({{ radians_lon2 }} - {{ radians_lon1 }}) / 2), 2))) * {{ conversion_rate }}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.degrees_to_radians"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "lat1", "type": null, "description": ""}, {"name": "lon1", "type": null, "description": ""}, {"name": "lat2", "type": null, "description": ""}, {"name": "lon2", "type": null, "description": ""}, {"name": "unit", "type": null, "description": ""}], "created_at": 1789419970.1616569, "supported_languages": null}, "macro.dbt_utils.get_powers_of_two": {"name": "get_powers_of_two", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/generate_series.sql", "original_file_path": "macros/sql/generate_series.sql", "unique_id": "macro.dbt_utils.get_powers_of_two", "macro_sql": "{% macro get_powers_of_two(upper_bound) %}\n {{ return(adapter.dispatch('get_powers_of_two', 'dbt_utils')(upper_bound)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__get_powers_of_two"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "upper_bound", "type": null, "description": ""}], "created_at": 1789419970.1633306, "supported_languages": null}, "macro.dbt_utils.default__get_powers_of_two": {"name": "default__get_powers_of_two", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/generate_series.sql", "original_file_path": "macros/sql/generate_series.sql", "unique_id": "macro.dbt_utils.default__get_powers_of_two", "macro_sql": "{% macro default__get_powers_of_two(upper_bound) %}\n\n {% if upper_bound <= 0 %}\n {{ exceptions.raise_compiler_error(\"upper bound must be positive\") }}\n {% endif %}\n\n {% for _ in range(1, 100) %}\n {% if upper_bound <= 2 ** loop.index %}{{ return(loop.index) }}{% endif %}\n {% endfor %}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "upper_bound", "type": null, "description": ""}], "created_at": 1789419970.16448, "supported_languages": null}, "macro.dbt_utils.generate_series": {"name": "generate_series", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/generate_series.sql", "original_file_path": "macros/sql/generate_series.sql", "unique_id": "macro.dbt_utils.generate_series", "macro_sql": "{% macro generate_series(upper_bound) %}\n {{ return(adapter.dispatch('generate_series', 'dbt_utils')(upper_bound)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__generate_series"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "upper_bound", "type": null, "description": ""}], "created_at": 1789419970.1648226, "supported_languages": null}, "macro.dbt_utils.default__generate_series": {"name": "default__generate_series", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/generate_series.sql", "original_file_path": "macros/sql/generate_series.sql", "unique_id": "macro.dbt_utils.default__generate_series", "macro_sql": "{% macro default__generate_series(upper_bound) %}\n\n {% set n = dbt_utils.get_powers_of_two(upper_bound) %}\n\n with p as (\n select 0 as generated_number union all select 1\n ), unioned as (\n\n select\n\n {% for i in range(n) %}\n p{{i}}.generated_number * power(2, {{i}})\n {% if not loop.last %} + {% endif %}\n {% endfor %}\n + 1\n as generated_number\n\n from\n\n {% for i in range(n) %}\n p as p{{i}}\n {% if not loop.last %} cross join {% endif %}\n {% endfor %}\n\n )\n\n select *\n from unioned\n where generated_number <= {{upper_bound}}\n order by generated_number\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.get_powers_of_two"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "upper_bound", "type": null, "description": ""}], "created_at": 1789419970.165868, "supported_languages": null}, "macro.dbt_utils.safe_subtract": {"name": "safe_subtract", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/safe_subtract.sql", "original_file_path": "macros/sql/safe_subtract.sql", "unique_id": "macro.dbt_utils.safe_subtract", "macro_sql": "{%- macro safe_subtract(field_list) -%}\n {{ return(adapter.dispatch('safe_subtract', 'dbt_utils')(field_list)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__safe_subtract"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field_list", "type": null, "description": ""}], "created_at": 1789419970.1664667, "supported_languages": null}, "macro.dbt_utils.default__safe_subtract": {"name": "default__safe_subtract", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/safe_subtract.sql", "original_file_path": "macros/sql/safe_subtract.sql", "unique_id": "macro.dbt_utils.default__safe_subtract", "macro_sql": "\n\n{%- macro default__safe_subtract(field_list) -%}\n\n{%- if field_list is not iterable or field_list is string or field_list is mapping -%}\n\n{%- set error_message = '\nWarning: the `safe_subtract` macro takes a single list argument instead of \\\nstring arguments. The {}.{} model triggered this warning. \\\n'.format(model.package_name, model.name) -%}\n\n{%- do exceptions.raise_compiler_error(error_message) -%}\n\n{%- endif -%}\n\n{% set fields = [] %}\n\n{%- for field in field_list -%}\n\n {% do fields.append(\"coalesce(\" ~ field ~ \", 0)\") %}\n\n{%- endfor -%}\n\n{{ fields|join(' -\\n ') }}\n\n{%- endmacro -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field_list", "type": null, "description": ""}], "created_at": 1789419970.1673956, "supported_languages": null}, "macro.dbt_utils.deduplicate": {"name": "deduplicate", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/deduplicate.sql", "original_file_path": "macros/sql/deduplicate.sql", "unique_id": "macro.dbt_utils.deduplicate", "macro_sql": "{%- macro deduplicate(relation, partition_by, order_by) -%}\n {{ return(adapter.dispatch('deduplicate', 'dbt_utils')(relation, partition_by, order_by)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.postgres__deduplicate"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "partition_by", "type": null, "description": ""}, {"name": "order_by", "type": null, "description": ""}], "created_at": 1789419970.1684108, "supported_languages": null}, "macro.dbt_utils.default__deduplicate": {"name": "default__deduplicate", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/deduplicate.sql", "original_file_path": "macros/sql/deduplicate.sql", "unique_id": "macro.dbt_utils.default__deduplicate", "macro_sql": "\n\n{%- macro default__deduplicate(relation, partition_by, order_by) -%}\n\n with row_numbered as (\n select\n _inner.*,\n row_number() over (\n partition by {{ partition_by }}\n order by {{ order_by }}\n ) as rn\n from {{ relation }} as _inner\n )\n\n select\n distinct data.*\n from {{ relation }} as data\n {#\n -- Not all DBs will support natural joins but the ones that do include:\n -- Oracle, MySQL, SQLite, Redshift, Teradata, Materialize, Databricks\n -- Apache Spark, SingleStore, Vertica\n -- Those that do not appear to support natural joins include:\n -- SQLServer, Trino, Presto, Rockset, Athena\n #}\n natural join row_numbered\n where row_numbered.rn = 1\n\n{%- endmacro -%}\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "partition_by", "type": null, "description": ""}, {"name": "order_by", "type": null, "description": ""}], "created_at": 1789419970.1688013, "supported_languages": null}, "macro.dbt_utils.redshift__deduplicate": {"name": "redshift__deduplicate", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/deduplicate.sql", "original_file_path": "macros/sql/deduplicate.sql", "unique_id": "macro.dbt_utils.redshift__deduplicate", "macro_sql": "{% macro redshift__deduplicate(relation, partition_by, order_by) -%}\n\n select *\n from {{ relation }} as tt\n qualify\n row_number() over (\n partition by {{ partition_by }}\n order by {{ order_by }}\n ) = 1\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "partition_by", "type": null, "description": ""}, {"name": "order_by", "type": null, "description": ""}], "created_at": 1789419970.1690912, "supported_languages": null}, "macro.dbt_utils.postgres__deduplicate": {"name": "postgres__deduplicate", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/deduplicate.sql", "original_file_path": "macros/sql/deduplicate.sql", "unique_id": "macro.dbt_utils.postgres__deduplicate", "macro_sql": "\n{%- macro postgres__deduplicate(relation, partition_by, order_by) -%}\n\n select\n distinct on ({{ partition_by }}) *\n from {{ relation }}\n order by {{ partition_by }}{{ ',' ~ order_by }}\n\n{%- endmacro -%}\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "partition_by", "type": null, "description": ""}, {"name": "order_by", "type": null, "description": ""}], "created_at": 1789419970.1694088, "supported_languages": null}, "macro.dbt_utils.snowflake__deduplicate": {"name": "snowflake__deduplicate", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/deduplicate.sql", "original_file_path": "macros/sql/deduplicate.sql", "unique_id": "macro.dbt_utils.snowflake__deduplicate", "macro_sql": "\n{%- macro snowflake__deduplicate(relation, partition_by, order_by) -%}\n\n select *\n from {{ relation }}\n qualify\n row_number() over (\n partition by {{ partition_by }}\n order by {{ order_by }}\n ) = 1\n\n{%- endmacro -%}\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "partition_by", "type": null, "description": ""}, {"name": "order_by", "type": null, "description": ""}], "created_at": 1789419970.1696918, "supported_languages": null}, "macro.dbt_utils.databricks__deduplicate": {"name": "databricks__deduplicate", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/deduplicate.sql", "original_file_path": "macros/sql/deduplicate.sql", "unique_id": "macro.dbt_utils.databricks__deduplicate", "macro_sql": "\n{%- macro databricks__deduplicate(relation, partition_by, order_by) -%}\n\n select *\n from {{ relation }}\n qualify\n row_number() over (\n partition by {{ partition_by }}\n order by {{ order_by }}\n ) = 1\n\n{%- endmacro -%}\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "partition_by", "type": null, "description": ""}, {"name": "order_by", "type": null, "description": ""}], "created_at": 1789419970.169992, "supported_languages": null}, "macro.dbt_utils.bigquery__deduplicate": {"name": "bigquery__deduplicate", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/deduplicate.sql", "original_file_path": "macros/sql/deduplicate.sql", "unique_id": "macro.dbt_utils.bigquery__deduplicate", "macro_sql": "\n{%- macro bigquery__deduplicate(relation, partition_by, order_by) -%}\n\n select unique.*\n from (\n select\n array_agg (\n original\n order by {{ order_by }}\n limit 1\n )[offset(0)] unique\n from {{ relation }} original\n group by {{ partition_by }}\n )\n\n{%- endmacro -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "partition_by", "type": null, "description": ""}, {"name": "order_by", "type": null, "description": ""}], "created_at": 1789419970.1702886, "supported_languages": null}, "macro.dbt_utils.generate_surrogate_key": {"name": "generate_surrogate_key", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/generate_surrogate_key.sql", "original_file_path": "macros/sql/generate_surrogate_key.sql", "unique_id": "macro.dbt_utils.generate_surrogate_key", "macro_sql": "{%- macro generate_surrogate_key(field_list) -%}\n {{ return(adapter.dispatch('generate_surrogate_key', 'dbt_utils')(field_list)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__generate_surrogate_key"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field_list", "type": null, "description": ""}], "created_at": 1789419970.1709435, "supported_languages": null}, "macro.dbt_utils.default__generate_surrogate_key": {"name": "default__generate_surrogate_key", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/generate_surrogate_key.sql", "original_file_path": "macros/sql/generate_surrogate_key.sql", "unique_id": "macro.dbt_utils.default__generate_surrogate_key", "macro_sql": "\n\n{%- macro default__generate_surrogate_key(field_list) -%}\n\n{%- if var('surrogate_key_treat_nulls_as_empty_strings', False) -%}\n {%- set default_null_value = \"\" -%}\n{%- else -%}\n {%- set default_null_value = '_dbt_utils_surrogate_key_null_' -%}\n{%- endif -%}\n\n{%- set fields = [] -%}\n\n{%- for field in field_list -%}\n\n {%- do fields.append(\n \"coalesce(cast(\" ~ field ~ \" as \" ~ dbt.type_string() ~ \"), '\" ~ default_null_value ~\"')\"\n ) -%}\n\n {%- if not loop.last %}\n {%- do fields.append(\"'-'\") -%}\n {%- endif -%}\n\n{%- endfor -%}\n\n{{ dbt.hash(dbt.concat(fields)) }}\n\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt.type_string", "macro.dbt.hash", "macro.dbt.concat"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field_list", "type": null, "description": ""}], "created_at": 1789419970.17226, "supported_languages": null}, "macro.dbt_utils.pivot": {"name": "pivot", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/pivot.sql", "original_file_path": "macros/sql/pivot.sql", "unique_id": "macro.dbt_utils.pivot", "macro_sql": "{% macro pivot(column,\n values,\n alias=True,\n agg='sum',\n cmp='=',\n prefix='',\n suffix='',\n then_value=1,\n else_value=0,\n quote_identifiers=True,\n distinct=False) %}\n {{ return(adapter.dispatch('pivot', 'dbt_utils')(column, values, alias, agg, cmp, prefix, suffix, then_value, else_value, quote_identifiers, distinct)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__pivot"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "column", "type": null, "description": ""}, {"name": "values", "type": null, "description": ""}, {"name": "alias", "type": null, "description": ""}, {"name": "agg", "type": null, "description": ""}, {"name": "cmp", "type": null, "description": ""}, {"name": "prefix", "type": null, "description": ""}, {"name": "suffix", "type": null, "description": ""}, {"name": "then_value", "type": null, "description": ""}, {"name": "else_value", "type": null, "description": ""}, {"name": "quote_identifiers", "type": null, "description": ""}, {"name": "distinct", "type": null, "description": ""}], "created_at": 1789419970.1736946, "supported_languages": null}, "macro.dbt_utils.default__pivot": {"name": "default__pivot", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/pivot.sql", "original_file_path": "macros/sql/pivot.sql", "unique_id": "macro.dbt_utils.default__pivot", "macro_sql": "{% macro default__pivot(column,\n values,\n alias=True,\n agg='sum',\n cmp='=',\n prefix='',\n suffix='',\n then_value=1,\n else_value=0,\n quote_identifiers=True,\n distinct=False) %}\n {% for value in values %}\n {{ agg }}(\n {% if distinct %} distinct {% endif %}\n case\n when {{ column }} {{ cmp }} '{{ dbt.escape_single_quotes(value) }}'\n then {{ then_value }}\n else {{ else_value }}\n end\n )\n {% if alias %}\n {% if quote_identifiers %}\n as {{ adapter.quote(prefix ~ value ~ suffix) }}\n {% else %}\n as {{ dbt_utils.slugify(prefix ~ value ~ suffix) }}\n {% endif %}\n {% endif %}\n {% if not loop.last %},{% endif %}\n {% endfor %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.escape_single_quotes", "macro.dbt_utils.slugify"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "column", "type": null, "description": ""}, {"name": "values", "type": null, "description": ""}, {"name": "alias", "type": null, "description": ""}, {"name": "agg", "type": null, "description": ""}, {"name": "cmp", "type": null, "description": ""}, {"name": "prefix", "type": null, "description": ""}, {"name": "suffix", "type": null, "description": ""}, {"name": "then_value", "type": null, "description": ""}, {"name": "else_value", "type": null, "description": ""}, {"name": "quote_identifiers", "type": null, "description": ""}, {"name": "distinct", "type": null, "description": ""}], "created_at": 1789419970.1751275, "supported_languages": null}, "macro.dbt_utils.nullcheck_table": {"name": "nullcheck_table", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/nullcheck_table.sql", "original_file_path": "macros/sql/nullcheck_table.sql", "unique_id": "macro.dbt_utils.nullcheck_table", "macro_sql": "{% macro nullcheck_table(relation) %}\n {{ return(adapter.dispatch('nullcheck_table', 'dbt_utils')(relation)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__nullcheck_table"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789419970.1756542, "supported_languages": null}, "macro.dbt_utils.default__nullcheck_table": {"name": "default__nullcheck_table", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/nullcheck_table.sql", "original_file_path": "macros/sql/nullcheck_table.sql", "unique_id": "macro.dbt_utils.default__nullcheck_table", "macro_sql": "{% macro default__nullcheck_table(relation) %}\n\n {%- do dbt_utils._is_relation(relation, 'nullcheck_table') -%}\n {%- do dbt_utils._is_ephemeral(relation, 'nullcheck_table') -%}\n {% set cols = adapter.get_columns_in_relation(relation) %}\n\n select {{ dbt_utils.nullcheck(cols) }}\n from {{relation}}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils._is_relation", "macro.dbt_utils._is_ephemeral", "macro.dbt_utils.nullcheck"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789419970.1762486, "supported_languages": null}, "macro.dbt_utils.get_relations_by_pattern": {"name": "get_relations_by_pattern", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_relations_by_pattern.sql", "original_file_path": "macros/sql/get_relations_by_pattern.sql", "unique_id": "macro.dbt_utils.get_relations_by_pattern", "macro_sql": "{% macro get_relations_by_pattern(schema_pattern, table_pattern, exclude='', database=target.database) %}\n {{ return(adapter.dispatch('get_relations_by_pattern', 'dbt_utils')(schema_pattern, table_pattern, exclude, database)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__get_relations_by_pattern"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "schema_pattern", "type": null, "description": ""}, {"name": "table_pattern", "type": null, "description": ""}, {"name": "exclude", "type": null, "description": ""}, {"name": "database", "type": null, "description": ""}], "created_at": 1789419970.177084, "supported_languages": null}, "macro.dbt_utils.default__get_relations_by_pattern": {"name": "default__get_relations_by_pattern", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_relations_by_pattern.sql", "original_file_path": "macros/sql/get_relations_by_pattern.sql", "unique_id": "macro.dbt_utils.default__get_relations_by_pattern", "macro_sql": "{% macro default__get_relations_by_pattern(schema_pattern, table_pattern, exclude='', database=target.database) %}\n\n {%- call statement('get_tables', fetch_result=True) %}\n\n {{ dbt_utils.get_tables_by_pattern_sql(schema_pattern, table_pattern, exclude, database) }}\n\n {%- endcall -%}\n\n {%- set table_list = load_result('get_tables') -%}\n\n {%- if table_list and table_list['table'] -%}\n {%- set tbl_relations = [] -%}\n {%- for row in table_list['table'] -%}\n {%- set tbl_relation = api.Relation.create(\n database=database,\n schema=row.table_schema,\n identifier=row.table_name,\n type=row.table_type\n ) -%}\n {%- do tbl_relations.append(tbl_relation) -%}\n {%- endfor -%}\n\n {{ return(tbl_relations) }}\n {%- else -%}\n {{ return([]) }}\n {%- endif -%}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement", "macro.dbt_utils.get_tables_by_pattern_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "schema_pattern", "type": null, "description": ""}, {"name": "table_pattern", "type": null, "description": ""}, {"name": "exclude", "type": null, "description": ""}, {"name": "database", "type": null, "description": ""}], "created_at": 1789419970.1785138, "supported_languages": null}, "macro.dbt_utils.get_query_results_as_dict": {"name": "get_query_results_as_dict", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_query_results_as_dict.sql", "original_file_path": "macros/sql/get_query_results_as_dict.sql", "unique_id": "macro.dbt_utils.get_query_results_as_dict", "macro_sql": "{% macro get_query_results_as_dict(query) %}\n {{ return(adapter.dispatch('get_query_results_as_dict', 'dbt_utils')(query)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__get_query_results_as_dict"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "query", "type": null, "description": ""}], "created_at": 1789419970.1791317, "supported_languages": null}, "macro.dbt_utils.default__get_query_results_as_dict": {"name": "default__get_query_results_as_dict", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_query_results_as_dict.sql", "original_file_path": "macros/sql/get_query_results_as_dict.sql", "unique_id": "macro.dbt_utils.default__get_query_results_as_dict", "macro_sql": "{% macro default__get_query_results_as_dict(query) %}\n\n{# This macro returns a dictionary of the form {column_name: (tuple_of_results)} #}\n\n {%- call statement('get_query_results', fetch_result=True,auto_begin=false) -%}\n\n {{ query }}\n\n {%- endcall -%}\n\n {% set sql_results={} %}\n\n {%- if execute -%}\n {% set sql_results_table = load_result('get_query_results').table.columns %}\n {% for column_name, column in sql_results_table.items() %}\n {% do sql_results.update({column_name: column.values()}) %}\n {% endfor %}\n {%- endif -%}\n\n {{ return(sql_results) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "query", "type": null, "description": ""}], "created_at": 1789419970.1801202, "supported_languages": null}, "macro.dbt_utils.union_relations": {"name": "union_relations", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/union.sql", "original_file_path": "macros/sql/union.sql", "unique_id": "macro.dbt_utils.union_relations", "macro_sql": "{%- macro union_relations(relations, column_override=none, include=[], exclude=[], source_column_name='_dbt_source_relation', where=none) -%}\n {{ return(adapter.dispatch('union_relations', 'dbt_utils')(relations, column_override, include, exclude, source_column_name, where)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__union_relations"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relations", "type": null, "description": ""}, {"name": "column_override", "type": null, "description": ""}, {"name": "include", "type": null, "description": ""}, {"name": "exclude", "type": null, "description": ""}, {"name": "source_column_name", "type": null, "description": ""}, {"name": "where", "type": null, "description": ""}], "created_at": 1789419970.1820025, "supported_languages": null}, "macro.dbt_utils.default__union_relations": {"name": "default__union_relations", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/union.sql", "original_file_path": "macros/sql/union.sql", "unique_id": "macro.dbt_utils.default__union_relations", "macro_sql": "\n\n{%- macro default__union_relations(relations, column_override=none, include=[], exclude=[], source_column_name='_dbt_source_relation', where=none) -%}\n\n {%- if exclude and include -%}\n {{ exceptions.raise_compiler_error(\"Both an exclude and include list were provided to the `union` macro. Only one is allowed\") }}\n {%- endif -%}\n\n {#-- Prevent querying of db in parsing mode. This works because this macro does not create any new refs. -#}\n {%- if not execute %}\n {{ return('') }}\n {% endif -%}\n\n {%- set column_override = column_override if column_override is not none else {} -%}\n\n {%- set relation_columns = {} -%}\n {%- set column_superset = {} -%}\n {%- set all_excludes = [] -%}\n {%- set all_includes = [] -%}\n\n {%- if exclude -%}\n {%- for exc in exclude -%}\n {%- do all_excludes.append(exc | lower) -%}\n {%- endfor -%}\n {%- endif -%}\n\n {%- if include -%}\n {%- for inc in include -%}\n {%- do all_includes.append(inc | lower) -%}\n {%- endfor -%}\n {%- endif -%}\n\n {%- for relation in relations -%}\n\n {%- do relation_columns.update({relation: []}) -%}\n\n {%- do dbt_utils._is_relation(relation, 'union_relations') -%}\n {%- do dbt_utils._is_ephemeral(relation, 'union_relations') -%}\n {%- set cols = adapter.get_columns_in_relation(relation) -%}\n {%- for col in cols -%}\n\n {#- If an exclude list was provided and the column is in the list, do nothing -#}\n {%- if exclude and col.column | lower in all_excludes -%}\n\n {#- If an include list was provided and the column is not in the list, do nothing -#}\n {%- elif include and col.column | lower not in all_includes -%}\n\n {#- Otherwise add the column to the column superset -#}\n {%- else -%}\n\n {#- update the list of columns in this relation -#}\n {%- do relation_columns[relation].append(col.column) -%}\n\n {%- if col.column in column_superset -%}\n\n {%- set stored = column_superset[col.column] -%}\n {%- if col.is_string() and stored.is_string() and col.string_size() > stored.string_size() -%}\n\n {%- do column_superset.update({col.column: col}) -%}\n\n {%- endif %}\n\n {%- else -%}\n\n {%- do column_superset.update({col.column: col}) -%}\n\n {%- endif -%}\n\n {%- endif -%}\n\n {%- endfor -%}\n {%- endfor -%}\n\n {%- set ordered_column_names = column_superset.keys() -%}\n {%- set dbt_command = flags.WHICH -%}\n\n\n {% if dbt_command in ['run', 'build'] %}\n {% if (include | length > 0 or exclude | length > 0) and not column_superset.keys() %}\n {%- set relations_string -%}\n {%- for relation in relations -%}\n {{ relation.name }}\n {%- if not loop.last %}, {% endif -%}\n {%- endfor -%}\n {%- endset -%}\n\n {%- set error_message -%}\n There were no columns found to union for relations {{ relations_string }}\n {%- endset -%}\n\n {{ exceptions.raise_compiler_error(error_message) }}\n {%- endif -%}\n {%- endif -%}\n\n {%- for relation in relations %}\n\n (\n select\n\n {%- if source_column_name is not none %}\n cast({{ dbt.string_literal(relation.render()) }} as {{ dbt.type_string() }}) as {{ source_column_name }},\n {%- endif %}\n\n /* No columns from any of the relations.\n This star is only output during dbt compile, and exists to keep SQLFluff happy. */\n {% if dbt_command == 'compile' and ordered_column_names|length == 0 %}\n *\n {% endif %}\n\n {% for col_name in ordered_column_names -%}\n\n {%- set col = column_superset[col_name] %}\n {%- set col_type = column_override.get(col.column, col.data_type) %}\n {%- set col_name = adapter.quote(col_name) if col_name in relation_columns[relation] else 'null' %}\n cast({{ col_name }} as {{ col_type }}) as {{ col.quoted }} {% if not loop.last %},{% endif -%}\n\n {%- endfor %}\n\n from {{ relation }}\n\n {% if where -%}\n where {{ where }}\n {%- endif %}\n )\n\n {% if not loop.last -%}\n union all\n {% endif -%}\n\n {%- endfor -%}\n\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt_utils._is_relation", "macro.dbt_utils._is_ephemeral", "macro.dbt.string_literal", "macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relations", "type": null, "description": ""}, {"name": "column_override", "type": null, "description": ""}, {"name": "include", "type": null, "description": ""}, {"name": "exclude", "type": null, "description": ""}, {"name": "source_column_name", "type": null, "description": ""}, {"name": "where", "type": null, "description": ""}], "created_at": 1789419970.1880152, "supported_languages": null}, "macro.dbt_utils.unpivot": {"name": "unpivot", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/unpivot.sql", "original_file_path": "macros/sql/unpivot.sql", "unique_id": "macro.dbt_utils.unpivot", "macro_sql": "{% macro unpivot(relation=none, cast_to='varchar', exclude=none, remove=none, field_name='field_name', value_name='value', quote_identifiers=False) -%}\n {{ return(adapter.dispatch('unpivot', 'dbt_utils')(relation, cast_to, exclude, remove, field_name, value_name, quote_identifiers)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__unpivot"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "cast_to", "type": null, "description": ""}, {"name": "exclude", "type": null, "description": ""}, {"name": "remove", "type": null, "description": ""}, {"name": "field_name", "type": null, "description": ""}, {"name": "value_name", "type": null, "description": ""}, {"name": "quote_identifiers", "type": null, "description": ""}], "created_at": 1789419970.189446, "supported_languages": null}, "macro.dbt_utils.default__unpivot": {"name": "default__unpivot", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/unpivot.sql", "original_file_path": "macros/sql/unpivot.sql", "unique_id": "macro.dbt_utils.default__unpivot", "macro_sql": "{% macro default__unpivot(relation=none, cast_to='varchar', exclude=none, remove=none, field_name='field_name', value_name='value', quote_identifiers=False) -%}\n\n {% if not relation %}\n {{ exceptions.raise_compiler_error(\"Error: argument `relation` is required for `unpivot` macro.\") }}\n {% endif %}\n\n {%- set exclude = exclude if exclude is not none else [] %}\n {%- set remove = remove if remove is not none else [] %}\n\n {%- set include_cols = [] %}\n\n {%- set table_columns = {} %}\n\n {%- do table_columns.update({relation: []}) %}\n\n {%- do dbt_utils._is_relation(relation, 'unpivot') -%}\n {%- do dbt_utils._is_ephemeral(relation, 'unpivot') -%}\n {%- set cols = adapter.get_columns_in_relation(relation) %}\n\n {%- for col in cols -%}\n {%- if col.column.lower() not in remove|map('lower') and col.column.lower() not in exclude|map('lower') -%}\n {% do include_cols.append(col) %}\n {%- endif %}\n {%- endfor %}\n\n\n {%- for col in include_cols -%}\n {%- set current_col_name = adapter.quote(col.column) if quote_identifiers else col.column -%}\n select\n {%- for exclude_col in exclude %}\n {{ adapter.quote(exclude_col) if quote_identifiers else exclude_col }},\n {%- endfor %}\n\n cast('{{ col.column }}' as {{ dbt.type_string() }}) as {{ adapter.quote(field_name) if quote_identifiers else field_name }},\n cast( {% if col.data_type == 'boolean' %}\n {{ dbt.cast_bool_to_text(current_col_name) }}\n {% else %}\n {{ current_col_name }}\n {% endif %}\n as {{ cast_to }}) as {{ adapter.quote(value_name) if quote_identifiers else value_name }}\n\n from {{ relation }}\n\n {% if not loop.last -%}\n union all\n {% endif -%}\n {%- endfor -%}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_utils._is_relation", "macro.dbt_utils._is_ephemeral", "macro.dbt.type_string", "macro.dbt.cast_bool_to_text"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "cast_to", "type": null, "description": ""}, {"name": "exclude", "type": null, "description": ""}, {"name": "remove", "type": null, "description": ""}, {"name": "field_name", "type": null, "description": ""}, {"name": "value_name", "type": null, "description": ""}, {"name": "quote_identifiers", "type": null, "description": ""}], "created_at": 1789419970.1925266, "supported_languages": null}, "macro.dbt_utils.nullcheck": {"name": "nullcheck", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/nullcheck.sql", "original_file_path": "macros/sql/nullcheck.sql", "unique_id": "macro.dbt_utils.nullcheck", "macro_sql": "{% macro nullcheck(cols) %}\n {{ return(adapter.dispatch('nullcheck', 'dbt_utils')(cols)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__nullcheck"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "cols", "type": null, "description": ""}], "created_at": 1789419970.1931334, "supported_languages": null}, "macro.dbt_utils.default__nullcheck": {"name": "default__nullcheck", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/nullcheck.sql", "original_file_path": "macros/sql/nullcheck.sql", "unique_id": "macro.dbt_utils.default__nullcheck", "macro_sql": "{% macro default__nullcheck(cols) %}\n{%- for col in cols %}\n\n {% if col.is_string() -%}\n\n nullif({{col.name}},'') as {{col.name}}\n\n {%- else -%}\n\n {{col.name}}\n\n {%- endif -%}\n\n{%- if not loop.last -%} , {%- endif -%}\n\n{%- endfor -%}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "cols", "type": null, "description": ""}], "created_at": 1789419970.1936965, "supported_languages": null}, "macro.dbt_utils.get_intervals_between": {"name": "get_intervals_between", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/date_spine.sql", "original_file_path": "macros/sql/date_spine.sql", "unique_id": "macro.dbt_utils.get_intervals_between", "macro_sql": "{% macro get_intervals_between(start_date, end_date, datepart) -%}\n {{ return(adapter.dispatch('get_intervals_between', 'dbt_utils')(start_date, end_date, datepart)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__get_intervals_between"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "start_date", "type": null, "description": ""}, {"name": "end_date", "type": null, "description": ""}, {"name": "datepart", "type": null, "description": ""}], "created_at": 1789419970.1945612, "supported_languages": null}, "macro.dbt_utils.default__get_intervals_between": {"name": "default__get_intervals_between", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/date_spine.sql", "original_file_path": "macros/sql/date_spine.sql", "unique_id": "macro.dbt_utils.default__get_intervals_between", "macro_sql": "{% macro default__get_intervals_between(start_date, end_date, datepart) -%}\n {%- call statement('get_intervals_between', fetch_result=True) %}\n\n select {{ dbt.datediff(start_date, end_date, datepart) }}\n\n {%- endcall -%}\n\n {%- set value_list = load_result('get_intervals_between') -%}\n\n {%- if value_list and value_list['data'] -%}\n {%- set values = value_list['data'] | map(attribute=0) | list %}\n {{ return(values[0]) }}\n {%- else -%}\n {{ return(1) }}\n {%- endif -%}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.statement", "macro.dbt.datediff"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "start_date", "type": null, "description": ""}, {"name": "end_date", "type": null, "description": ""}, {"name": "datepart", "type": null, "description": ""}], "created_at": 1789419970.1956027, "supported_languages": null}, "macro.dbt_utils.date_spine": {"name": "date_spine", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/date_spine.sql", "original_file_path": "macros/sql/date_spine.sql", "unique_id": "macro.dbt_utils.date_spine", "macro_sql": "{% macro date_spine(datepart, start_date, end_date) %}\n {{ return(adapter.dispatch('date_spine', 'dbt_utils')(datepart, start_date, end_date)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__date_spine"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "datepart", "type": null, "description": ""}, {"name": "start_date", "type": null, "description": ""}, {"name": "end_date", "type": null, "description": ""}], "created_at": 1789419970.1960735, "supported_languages": null}, "macro.dbt_utils.default__date_spine": {"name": "default__date_spine", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/date_spine.sql", "original_file_path": "macros/sql/date_spine.sql", "unique_id": "macro.dbt_utils.default__date_spine", "macro_sql": "{% macro default__date_spine(datepart, start_date, end_date) %}\n\n\n{# call as follows:\n\ndate_spine(\n \"day\",\n \"to_date('01/01/2016', 'mm/dd/yyyy')\",\n \"dbt.dateadd(week, 1, current_date)\"\n) #}\n\n\nwith rawdata as (\n\n {{dbt_utils.generate_series(\n dbt_utils.get_intervals_between(start_date, end_date, datepart)\n )}}\n\n),\n\nall_periods as (\n\n select (\n {{\n dbt.dateadd(\n datepart,\n \"row_number() over (order by generated_number) - 1\",\n start_date\n )\n }}\n ) as date_{{datepart}}\n from rawdata\n\n),\n\nfiltered as (\n\n select *\n from all_periods\n where date_{{datepart}} <= {{ end_date }}\n\n)\n\nselect * from filtered\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.generate_series", "macro.dbt_utils.get_intervals_between", "macro.dbt.dateadd"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "datepart", "type": null, "description": ""}, {"name": "start_date", "type": null, "description": ""}, {"name": "end_date", "type": null, "description": ""}], "created_at": 1789419970.1966858, "supported_languages": null}, "macro.dbt_utils.get_filtered_columns_in_relation": {"name": "get_filtered_columns_in_relation", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_filtered_columns_in_relation.sql", "original_file_path": "macros/sql/get_filtered_columns_in_relation.sql", "unique_id": "macro.dbt_utils.get_filtered_columns_in_relation", "macro_sql": "{% macro get_filtered_columns_in_relation(from, except=[]) -%}\n {{ return(adapter.dispatch('get_filtered_columns_in_relation', 'dbt_utils')(from, except)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__get_filtered_columns_in_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "from", "type": null, "description": ""}, {"name": "except", "type": null, "description": ""}], "created_at": 1789419970.1975007, "supported_languages": null}, "macro.dbt_utils.default__get_filtered_columns_in_relation": {"name": "default__get_filtered_columns_in_relation", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_filtered_columns_in_relation.sql", "original_file_path": "macros/sql/get_filtered_columns_in_relation.sql", "unique_id": "macro.dbt_utils.default__get_filtered_columns_in_relation", "macro_sql": "{% macro default__get_filtered_columns_in_relation(from, except=[]) -%}\n {%- do dbt_utils._is_relation(from, 'get_filtered_columns_in_relation') -%}\n {%- do dbt_utils._is_ephemeral(from, 'get_filtered_columns_in_relation') -%}\n\n {# -- Prevent querying of db in parsing mode. This works because this macro does not create any new refs. #}\n {%- if not execute -%}\n {{ return([]) }}\n {% endif %}\n\n {%- set include_cols = [] %}\n {%- set cols = adapter.get_columns_in_relation(from) -%}\n {%- set except = except | map(\"lower\") | list %}\n {%- for col in cols -%}\n {%- if col.column|lower not in except -%}\n {% do include_cols.append(col.column) %}\n {%- endif %}\n {%- endfor %}\n\n {{ return(include_cols) }}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_utils._is_relation", "macro.dbt_utils._is_ephemeral"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "from", "type": null, "description": ""}, {"name": "except", "type": null, "description": ""}], "created_at": 1789419970.1987174, "supported_languages": null}, "macro.dbt_utils.surrogate_key": {"name": "surrogate_key", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/surrogate_key.sql", "original_file_path": "macros/sql/surrogate_key.sql", "unique_id": "macro.dbt_utils.surrogate_key", "macro_sql": "{%- macro surrogate_key(field_list) -%}\n {% set frustrating_jinja_feature = varargs %}\n {{ return(adapter.dispatch('surrogate_key', 'dbt_utils')(field_list, *varargs)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__surrogate_key"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field_list", "type": null, "description": ""}], "created_at": 1789419970.1993313, "supported_languages": null}, "macro.dbt_utils.default__surrogate_key": {"name": "default__surrogate_key", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/surrogate_key.sql", "original_file_path": "macros/sql/surrogate_key.sql", "unique_id": "macro.dbt_utils.default__surrogate_key", "macro_sql": "\n\n{%- macro default__surrogate_key(field_list) -%}\n\n{%- set error_message = '\nWarning: `dbt_utils.surrogate_key` has been replaced by \\\n`dbt_utils.generate_surrogate_key`. The new macro treats null values \\\ndifferently to empty strings. To restore the behaviour of the original \\\nmacro, add a global variable in dbt_project.yml called \\\n`surrogate_key_treat_nulls_as_empty_strings` to your \\\ndbt_project.yml file with a value of True. \\\nThe {}.{} model triggered this warning. \\\n'.format(model.package_name, model.name) -%}\n\n{%- do exceptions.raise_compiler_error(error_message) -%}\n\n{%- endmacro -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field_list", "type": null, "description": ""}], "created_at": 1789419970.1997309, "supported_languages": null}, "macro.dbt_utils.get_single_value": {"name": "get_single_value", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_single_value.sql", "original_file_path": "macros/sql/get_single_value.sql", "unique_id": "macro.dbt_utils.get_single_value", "macro_sql": "{% macro get_single_value(query, default=none) %}\n {{ return(adapter.dispatch('get_single_value', 'dbt_utils')(query, default)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__get_single_value"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "query", "type": null, "description": ""}, {"name": "default", "type": null, "description": ""}], "created_at": 1789419970.2004452, "supported_languages": null}, "macro.dbt_utils.default__get_single_value": {"name": "default__get_single_value", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_single_value.sql", "original_file_path": "macros/sql/get_single_value.sql", "unique_id": "macro.dbt_utils.default__get_single_value", "macro_sql": "{% macro default__get_single_value(query, default) %}\n\n{# This macro returns the (0, 0) record in a query, i.e. the first row of the first column #}\n\n {%- call statement('get_query_result', fetch_result=True, auto_begin=false) -%}\n\n {{ query }}\n\n {%- endcall -%}\n\n {%- if execute -%}\n\n {% set r = load_result('get_query_result').table.columns[0].values() %}\n {% if r | length == 0 %}\n {% do print('Query `' ~ query ~ '` returned no rows. Using the default value: ' ~ default) %}\n {% set sql_result = default %}\n {% else %}\n {% set sql_result = r[0] %}\n {% endif %}\n \n {%- else -%}\n \n {% set sql_result = default %}\n \n {%- endif -%}\n\n {% do return(sql_result) %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "query", "type": null, "description": ""}, {"name": "default", "type": null, "description": ""}], "created_at": 1789419970.201815, "supported_languages": null}, "macro.dbt_utils.width_bucket": {"name": "width_bucket", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/width_bucket.sql", "original_file_path": "macros/sql/width_bucket.sql", "unique_id": "macro.dbt_utils.width_bucket", "macro_sql": "{% macro width_bucket(expr, min_value, max_value, num_buckets) %}\n {{ return(adapter.dispatch('width_bucket', 'dbt_utils') (expr, min_value, max_value, num_buckets)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__width_bucket"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "expr", "type": null, "description": ""}, {"name": "min_value", "type": null, "description": ""}, {"name": "max_value", "type": null, "description": ""}, {"name": "num_buckets", "type": null, "description": ""}], "created_at": 1789419970.2025871, "supported_languages": null}, "macro.dbt_utils.default__width_bucket": {"name": "default__width_bucket", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/width_bucket.sql", "original_file_path": "macros/sql/width_bucket.sql", "unique_id": "macro.dbt_utils.default__width_bucket", "macro_sql": "{% macro default__width_bucket(expr, min_value, max_value, num_buckets) -%}\n\n {% set bin_size -%}\n (( {{ max_value }} - {{ min_value }} ) / {{ num_buckets }} )\n {%- endset %}\n (\n -- to break ties when the amount is eaxtly at the bucket egde\n case\n when\n mod(\n {{ dbt.safe_cast(expr, dbt.type_numeric() ) }},\n {{ dbt.safe_cast(bin_size, dbt.type_numeric() ) }}\n ) = 0\n then 1\n else 0\n end\n ) +\n -- Anything over max_value goes the N+1 bucket\n least(\n ceil(\n ({{ expr }} - {{ min_value }})/{{ bin_size }}\n ),\n {{ num_buckets }} + 1\n )\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.safe_cast", "macro.dbt.type_numeric"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "expr", "type": null, "description": ""}, {"name": "min_value", "type": null, "description": ""}, {"name": "max_value", "type": null, "description": ""}, {"name": "num_buckets", "type": null, "description": ""}], "created_at": 1789419970.2033854, "supported_languages": null}, "macro.dbt_utils.snowflake__width_bucket": {"name": "snowflake__width_bucket", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/width_bucket.sql", "original_file_path": "macros/sql/width_bucket.sql", "unique_id": "macro.dbt_utils.snowflake__width_bucket", "macro_sql": "{% macro snowflake__width_bucket(expr, min_value, max_value, num_buckets) %}\n width_bucket({{ expr }}, {{ min_value }}, {{ max_value }}, {{ num_buckets }} )\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "expr", "type": null, "description": ""}, {"name": "min_value", "type": null, "description": ""}, {"name": "max_value", "type": null, "description": ""}, {"name": "num_buckets", "type": null, "description": ""}], "created_at": 1789419970.2037158, "supported_languages": null}, "macro.dbt_utils.get_relations_by_prefix": {"name": "get_relations_by_prefix", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_relations_by_prefix.sql", "original_file_path": "macros/sql/get_relations_by_prefix.sql", "unique_id": "macro.dbt_utils.get_relations_by_prefix", "macro_sql": "{% macro get_relations_by_prefix(schema, prefix, exclude='', database=target.database) %}\n {{ return(adapter.dispatch('get_relations_by_prefix', 'dbt_utils')(schema, prefix, exclude, database)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__get_relations_by_prefix"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "schema", "type": null, "description": ""}, {"name": "prefix", "type": null, "description": ""}, {"name": "exclude", "type": null, "description": ""}, {"name": "database", "type": null, "description": ""}], "created_at": 1789419970.2045453, "supported_languages": null}, "macro.dbt_utils.default__get_relations_by_prefix": {"name": "default__get_relations_by_prefix", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_relations_by_prefix.sql", "original_file_path": "macros/sql/get_relations_by_prefix.sql", "unique_id": "macro.dbt_utils.default__get_relations_by_prefix", "macro_sql": "{% macro default__get_relations_by_prefix(schema, prefix, exclude='', database=target.database) %}\n\n {%- call statement('get_tables', fetch_result=True) %}\n\n {{ dbt_utils.get_tables_by_prefix_sql(schema, prefix, exclude, database) }}\n\n {%- endcall -%}\n\n {%- set table_list = load_result('get_tables') -%}\n\n {%- if table_list and table_list['table'] -%}\n {%- set tbl_relations = [] -%}\n {%- for row in table_list['table'] -%}\n {%- set tbl_relation = api.Relation.create(\n database=database,\n schema=row.table_schema,\n identifier=row.table_name,\n type=row.table_type\n ) -%}\n {%- do tbl_relations.append(tbl_relation) -%}\n {%- endfor -%}\n\n {{ return(tbl_relations) }}\n {%- else -%}\n {{ return([]) }}\n {%- endif -%}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement", "macro.dbt_utils.get_tables_by_prefix_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "schema", "type": null, "description": ""}, {"name": "prefix", "type": null, "description": ""}, {"name": "exclude", "type": null, "description": ""}, {"name": "database", "type": null, "description": ""}], "created_at": 1789419970.20598, "supported_languages": null}, "macro.dbt_utils.safe_divide": {"name": "safe_divide", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/safe_divide.sql", "original_file_path": "macros/sql/safe_divide.sql", "unique_id": "macro.dbt_utils.safe_divide", "macro_sql": "{% macro safe_divide(numerator, denominator) -%}\n {{ return(adapter.dispatch('safe_divide', 'dbt_utils')(numerator, denominator)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__safe_divide"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "numerator", "type": null, "description": ""}, {"name": "denominator", "type": null, "description": ""}], "created_at": 1789419970.2064703, "supported_languages": null}, "macro.dbt_utils.default__safe_divide": {"name": "default__safe_divide", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/safe_divide.sql", "original_file_path": "macros/sql/safe_divide.sql", "unique_id": "macro.dbt_utils.default__safe_divide", "macro_sql": "{% macro default__safe_divide(numerator, denominator) %}\n ( {{ numerator }} ) / nullif( ( {{ denominator }} ), 0)\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "numerator", "type": null, "description": ""}, {"name": "denominator", "type": null, "description": ""}], "created_at": 1789419970.2067022, "supported_languages": null}, "macro.dbt_utils.safe_add": {"name": "safe_add", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/safe_add.sql", "original_file_path": "macros/sql/safe_add.sql", "unique_id": "macro.dbt_utils.safe_add", "macro_sql": "{%- macro safe_add(field_list) -%}\n {{ return(adapter.dispatch('safe_add', 'dbt_utils')(field_list)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__safe_add"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field_list", "type": null, "description": ""}], "created_at": 1789419970.2072692, "supported_languages": null}, "macro.dbt_utils.default__safe_add": {"name": "default__safe_add", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/safe_add.sql", "original_file_path": "macros/sql/safe_add.sql", "unique_id": "macro.dbt_utils.default__safe_add", "macro_sql": "\n\n{%- macro default__safe_add(field_list) -%}\n\n{%- if field_list is not iterable or field_list is string or field_list is mapping -%}\n\n{%- set error_message = '\nWarning: the `safe_add` macro now takes a single list argument instead of \\\nstring arguments. The {}.{} model triggered this warning. \\\n'.format(model.package_name, model.name) -%}\n\n{%- do exceptions.warn(error_message) -%}\n\n{%- endif -%}\n\n{% set fields = [] %}\n\n{%- for field in field_list -%}\n\n {% do fields.append(\"coalesce(\" ~ field ~ \", 0)\") %}\n\n{%- endfor -%}\n\n{{ fields|join(' +\\n ') }}\n\n{%- endmacro -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field_list", "type": null, "description": ""}], "created_at": 1789419970.2081864, "supported_languages": null}, "macro.dbt_utils.group_by": {"name": "group_by", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/groupby.sql", "original_file_path": "macros/sql/groupby.sql", "unique_id": "macro.dbt_utils.group_by", "macro_sql": "{%- macro group_by(n) -%}\n {{ return(adapter.dispatch('group_by', 'dbt_utils')(n)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__group_by"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "n", "type": null, "description": ""}], "created_at": 1789419970.2086656, "supported_languages": null}, "macro.dbt_utils.default__group_by": {"name": "default__group_by", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/groupby.sql", "original_file_path": "macros/sql/groupby.sql", "unique_id": "macro.dbt_utils.default__group_by", "macro_sql": "\n\n{%- macro default__group_by(n) -%}\n\n group by {% for i in range(1, n + 1) -%}\n {{ i }}{{ ',' if not loop.last }} \n {%- endfor -%}\n\n{%- endmacro -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "n", "type": null, "description": ""}], "created_at": 1789419970.209102, "supported_languages": null}, "macro.iterable.iterable_lookback": {"name": "iterable_lookback", "resource_type": "macro", "package_name": "iterable", "path": "macros/iterable_lookback.sql", "original_file_path": "macros/iterable_lookback.sql", "unique_id": "macro.iterable.iterable_lookback", "macro_sql": "{% macro iterable_lookback(from_date, datepart, interval, safety_date='2020-01-01') %}\n\n{{ adapter.dispatch('iterable_lookback', 'iterable') (from_date, datepart, interval, safety_date='2020-01-01') }}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.iterable.default__iterable_lookback"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "from_date", "type": null, "description": ""}, {"name": "datepart", "type": null, "description": ""}, {"name": "interval", "type": null, "description": ""}, {"name": "safety_date", "type": null, "description": ""}], "created_at": 1789419970.2098029, "supported_languages": null}, "macro.iterable.default__iterable_lookback": {"name": "default__iterable_lookback", "resource_type": "macro", "package_name": "iterable", "path": "macros/iterable_lookback.sql", "original_file_path": "macros/iterable_lookback.sql", "unique_id": "macro.iterable.default__iterable_lookback", "macro_sql": "{% macro default__iterable_lookback(from_date, datepart, interval, safety_date='2020-01-01') %}\n\n {% set sql_statement %}\n select coalesce({{ from_date }}, {{ \"'\" ~ safety_date ~ \"'\" }})\n from {{ this }}\n {%- endset -%}\n\n {%- set result = dbt_utils.get_single_value(sql_statement) %}\n\n {{ dbt.dateadd(datepart=datepart, interval=-interval, from_date_or_timestamp=\"cast('\" ~ result ~ \"' as date)\") }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.get_single_value", "macro.dbt.dateadd"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "from_date", "type": null, "description": ""}, {"name": "datepart", "type": null, "description": ""}, {"name": "interval", "type": null, "description": ""}, {"name": "safety_date", "type": null, "description": ""}], "created_at": 1789419970.2106757, "supported_languages": null}, "macro.iterable.get_campaign_list_history_columns": {"name": "get_campaign_list_history_columns", "resource_type": "macro", "package_name": "iterable", "path": "macros/staging/get_campaign_list_history_columns.sql", "original_file_path": "macros/staging/get_campaign_list_history_columns.sql", "unique_id": "macro.iterable.get_campaign_list_history_columns", "macro_sql": "{% macro get_campaign_list_history_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"campaign_id\", \"datatype\": dbt.type_int()},\n {\"name\": \"list_id\", \"datatype\": dbt.type_int()},\n {\"name\": \"updated_at\", \"datatype\": dbt.type_timestamp()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.type_timestamp", "macro.dbt.type_int"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789419970.211694, "supported_languages": null}, "macro.iterable.get_list_columns": {"name": "get_list_columns", "resource_type": "macro", "package_name": "iterable", "path": "macros/staging/get_list_columns.sql", "original_file_path": "macros/staging/get_list_columns.sql", "unique_id": "macro.iterable.get_list_columns", "macro_sql": "{% macro get_list_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_deleted\", \"datatype\": \"boolean\"},\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"created_at\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"id\", \"datatype\": dbt.type_int()},\n {\"name\": \"list_type\", \"datatype\": dbt.type_string()},\n {\"name\": \"description\", \"datatype\": dbt.type_string()},\n {\"name\": \"name\", \"datatype\": dbt.type_string()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.type_timestamp", "macro.dbt.type_int", "macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789419970.2131503, "supported_languages": null}, "macro.iterable.get_campaign_history_columns": {"name": "get_campaign_history_columns", "resource_type": "macro", "package_name": "iterable", "path": "macros/staging/get_campaign_history_columns.sql", "original_file_path": "macros/staging/get_campaign_history_columns.sql", "unique_id": "macro.iterable.get_campaign_history_columns", "macro_sql": "{% macro get_campaign_history_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"campaign_state\", \"datatype\": dbt.type_string()},\n {\"name\": \"created_at\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"created_by_user_id\", \"datatype\": dbt.type_string()},\n {\"name\": \"updated_by_user_id\", \"datatype\": dbt.type_string()},\n {\"name\": \"ended_at\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"id\", \"datatype\": dbt.type_int()},\n {\"name\": \"name\", \"datatype\": dbt.type_string()},\n {\"name\": \"recurring_campaign_id\", \"datatype\": dbt.type_int()},\n {\"name\": \"send_size\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"start_at\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"template_id\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"type\", \"datatype\": dbt.type_string()},\n {\"name\": \"updated_at\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"workflow_id\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"message_medium\", \"datatype\": dbt.type_string()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.type_timestamp", "macro.dbt.type_string", "macro.dbt.type_int", "macro.dbt.type_numeric"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789419970.21598, "supported_languages": null}, "macro.iterable.get_event_columns": {"name": "get_event_columns", "resource_type": "macro", "package_name": "iterable", "path": "macros/staging/get_event_columns.sql", "original_file_path": "macros/staging/get_event_columns.sql", "unique_id": "macro.iterable.get_event_columns", "macro_sql": "{% macro get_event_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_id\", \"datatype\": dbt.type_string()},\n {\"name\": \"_fivetran_user_id\", \"datatype\": dbt.type_string()},\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"campaign_id\", \"datatype\": dbt.type_int()},\n {\"name\": \"content_id\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"created_at\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"email\", \"datatype\": dbt.type_string()},\n {\"name\": \"event_name\", \"datatype\": dbt.type_string()},\n {\"name\": \"message_bus_id\", \"datatype\": dbt.type_string()},\n {\"name\": \"message_id\", \"datatype\": dbt.type_string()},\n {\"name\": \"message_type_id\", \"datatype\": dbt.type_int()},\n {\"name\": \"recipient_state\", \"datatype\": dbt.type_string()},\n {\"name\": \"status\", \"datatype\": dbt.type_string()},\n {\"name\": \"unsub_source\", \"datatype\": dbt.type_string()},\n {\"name\": \"user_agent\", \"datatype\": dbt.type_string()},\n {\"name\": \"user_agent_device\", \"datatype\": dbt.type_string()},\n {\"name\": \"transactional_data\", \"datatype\": dbt.type_string()},\n {\"name\": \"additional_properties\", \"datatype\": dbt.type_string()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.type_string", "macro.dbt.type_timestamp", "macro.dbt.type_int", "macro.dbt.type_numeric"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789419970.2191105, "supported_languages": null}, "macro.iterable.get_event_extension_columns": {"name": "get_event_extension_columns", "resource_type": "macro", "package_name": "iterable", "path": "macros/staging/get_event_extension_columns.sql", "original_file_path": "macros/staging/get_event_extension_columns.sql", "unique_id": "macro.iterable.get_event_extension_columns", "macro_sql": "{% macro get_event_extension_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_id\", \"datatype\": dbt.type_string()},\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"app_already_running\", \"datatype\": \"boolean\"},\n {\"name\": \"badge\", \"datatype\": dbt.type_string()},\n {\"name\": \"catalog_collection_count\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"catalog_lookup_count\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"canonical_url_id\", \"datatype\": dbt.type_string()},\n {\"name\": \"content_available\", \"datatype\": \"boolean\"},\n {\"name\": \"content_id\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"device\", \"datatype\": dbt.type_string()},\n {\"name\": \"email_id\", \"datatype\": dbt.type_string()},\n {\"name\": \"email_subject\", \"datatype\": dbt.type_string()},\n {\"name\": \"experiment_id\", \"datatype\": dbt.type_string()},\n {\"name\": \"from_phone_number_id\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"from_smssender_id\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"link_id\", \"datatype\": dbt.type_string()},\n {\"name\": \"link_url\", \"datatype\": dbt.type_string()},\n {\"name\": \"locale\", \"datatype\": dbt.type_string()},\n {\"name\": \"payload\", \"datatype\": dbt.type_string()},\n {\"name\": \"platform_endpoint\", \"datatype\": dbt.type_string()},\n {\"name\": \"push_message\", \"datatype\": dbt.type_string()},\n {\"name\": \"region\", \"datatype\": dbt.type_string()},\n {\"name\": \"sms_message\", \"datatype\": dbt.type_string()},\n {\"name\": \"to_phone_number\", \"datatype\": dbt.type_string()},\n {\"name\": \"url\", \"datatype\": dbt.type_string()},\n {\"name\": \"workflow_id\", \"datatype\": dbt.type_string()},\n {\"name\": \"workflow_name\", \"datatype\": dbt.type_string()},\n {\"name\": \"city\", \"datatype\": dbt.type_string()},\n {\"name\": \"clicked_url\", \"datatype\": dbt.type_string()},\n {\"name\": \"country\", \"datatype\": dbt.type_string()},\n {\"name\": \"error_code\", \"datatype\": dbt.type_string()},\n {\"name\": \"expires_at\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"from_phone_number\", \"datatype\": dbt.type_string()},\n {\"name\": \"in_app_body\", \"datatype\": dbt.type_string()},\n {\"name\": \"is_sms_estimation\", \"datatype\": \"boolean\"},\n {\"name\": \"labels\", \"datatype\": dbt.type_string()},\n {\"name\": \"message_status\", \"datatype\": dbt.type_string()},\n {\"name\": \"mms_send_count\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"reason\", \"datatype\": dbt.type_string()},\n {\"name\": \"sms_send_count\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"_fivetran_user_id\", \"datatype\": dbt.type_string()}\n] %}\n\n{{ fivetran_utils.add_pass_through_columns(columns, var('iterable_event_extension_pass_through_columns')) }}\n\n{{ return(columns) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.type_string", "macro.dbt.type_timestamp", "macro.dbt.type_numeric", "macro.fivetran_utils.add_pass_through_columns"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789419970.2259147, "supported_languages": null}, "macro.iterable.get_campaign_label_history_columns": {"name": "get_campaign_label_history_columns", "resource_type": "macro", "package_name": "iterable", "path": "macros/staging/get_campaign_label_history_columns.sql", "original_file_path": "macros/staging/get_campaign_label_history_columns.sql", "unique_id": "macro.iterable.get_campaign_label_history_columns", "macro_sql": "{% macro get_campaign_label_history_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"campaign_id\", \"datatype\": dbt.type_int()},\n {\"name\": \"label\", \"datatype\": dbt.type_string()},\n {\"name\": \"updated_at\", \"datatype\": dbt.type_timestamp()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.type_timestamp", "macro.dbt.type_int", "macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789419970.226999, "supported_languages": null}, "macro.iterable.get_template_history_columns": {"name": "get_template_history_columns", "resource_type": "macro", "package_name": "iterable", "path": "macros/staging/get_template_history_columns.sql", "original_file_path": "macros/staging/get_template_history_columns.sql", "unique_id": "macro.iterable.get_template_history_columns", "macro_sql": "{% macro get_template_history_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"client_template_id\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"created_at\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"creator_user_id\", \"datatype\": dbt.type_string()},\n {\"name\": \"id\", \"datatype\": dbt.type_int()},\n {\"name\": \"message_type_id\", \"datatype\": dbt.type_int()},\n {\"name\": \"name\", \"datatype\": dbt.type_string()},\n {\"name\": \"template_type\", \"datatype\": dbt.type_string()},\n {\"name\": \"updated_at\", \"datatype\": dbt.type_timestamp()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.type_timestamp", "macro.dbt.type_numeric", "macro.dbt.type_string", "macro.dbt.type_int"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789419970.228786, "supported_languages": null}, "macro.iterable.get_journey_columns": {"name": "get_journey_columns", "resource_type": "macro", "package_name": "iterable", "path": "macros/staging/get_journey_columns.sql", "original_file_path": "macros/staging/get_journey_columns.sql", "unique_id": "macro.iterable.get_journey_columns", "macro_sql": "{% macro get_journey_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_deleted\", \"datatype\": \"boolean\"},\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"created_at\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"creator_user_id\", \"datatype\": dbt.type_string()},\n {\"name\": \"description\", \"datatype\": dbt.type_string()},\n {\"name\": \"enabled\", \"datatype\": \"boolean\"},\n {\"name\": \"id\", \"datatype\": dbt.type_int()},\n {\"name\": \"is_archived\", \"datatype\": \"boolean\"},\n {\"name\": \"journey_type\", \"datatype\": dbt.type_string()},\n {\"name\": \"lifetime_limit\", \"datatype\": dbt.type_int()},\n {\"name\": \"name\", \"datatype\": dbt.type_string()},\n {\"name\": \"simultaneous_limit\", \"datatype\": dbt.type_int()},\n {\"name\": \"start_tile_id\", \"datatype\": dbt.type_int()},\n {\"name\": \"trigger_event_names\", \"datatype\": dbt.type_string()},\n {\"name\": \"updated_at\", \"datatype\": dbt.type_timestamp()}\n] %}\n\n{{ fivetran_utils.add_pass_through_columns(columns, var('iterable_journey_pass_through_columns')) }}\n\n{{ return(columns) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.type_timestamp", "macro.dbt.type_string", "macro.dbt.type_int", "macro.fivetran_utils.add_pass_through_columns"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789419970.231595, "supported_languages": null}, "macro.iterable.get_list_user_columns": {"name": "get_list_user_columns", "resource_type": "macro", "package_name": "iterable", "path": "macros/staging/get_list_user_columns.sql", "original_file_path": "macros/staging/get_list_user_columns.sql", "unique_id": "macro.iterable.get_list_user_columns", "macro_sql": "{% macro get_list_user_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_id\", \"datatype\": dbt.type_string()},\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"index\", \"datatype\": dbt.type_int()},\n {\"name\": \"list_id\", \"datatype\": dbt.type_int()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.type_string", "macro.dbt.type_timestamp", "macro.dbt.type_int"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789419970.2326193, "supported_languages": null}, "macro.iterable.json_to_string": {"name": "json_to_string", "resource_type": "macro", "package_name": "iterable", "path": "macros/staging/json_to_string.sql", "original_file_path": "macros/staging/json_to_string.sql", "unique_id": "macro.iterable.json_to_string", "macro_sql": "{%- macro json_to_string(column, column_list) -%}\n {{ return(adapter.dispatch('json_to_string', 'iterable')(column, column_list)) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.iterable.default__json_to_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "column", "type": null, "description": ""}, {"name": "column_list", "type": null, "description": ""}], "created_at": 1789419970.2333, "supported_languages": null}, "macro.iterable.default__json_to_string": {"name": "default__json_to_string", "resource_type": "macro", "package_name": "iterable", "path": "macros/staging/json_to_string.sql", "original_file_path": "macros/staging/json_to_string.sql", "unique_id": "macro.iterable.default__json_to_string", "macro_sql": "{%- macro default__json_to_string(column, column_list) -%}\n cast({{ column }} as {{ dbt.type_string() }})\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "column", "type": null, "description": ""}, {"name": "column_list", "type": null, "description": ""}], "created_at": 1789419970.2335684, "supported_languages": null}, "macro.iterable.bigquery__json_to_string": {"name": "bigquery__json_to_string", "resource_type": "macro", "package_name": "iterable", "path": "macros/staging/json_to_string.sql", "original_file_path": "macros/staging/json_to_string.sql", "unique_id": "macro.iterable.bigquery__json_to_string", "macro_sql": "{%- macro bigquery__json_to_string(column, column_list) -%}\n {%- set columns = column_list -%}\n {%- set ns = namespace(column_type='string') -%}\n\n {%- for col in columns -%}\n {%- if col.name|lower == column|lower -%}\n {%- set ns.column_type = col.dtype|lower -%}\n {%- endif -%}\n {%- endfor -%}\n\n {%- if ns.column_type == 'json' -%}\n to_json_string({{ column }})\n {%- else -%}\n cast({{ column }} as {{ dbt.type_string() }})\n {%- endif -%}\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "column", "type": null, "description": ""}, {"name": "column_list", "type": null, "description": ""}], "created_at": 1789419970.2344882, "supported_languages": null}, "macro.iterable.get_user_unsubscribed_message_type_columns": {"name": "get_user_unsubscribed_message_type_columns", "resource_type": "macro", "package_name": "iterable", "path": "macros/staging/get_user_unsubscribed_message_type_columns.sql", "original_file_path": "macros/staging/get_user_unsubscribed_message_type_columns.sql", "unique_id": "macro.iterable.get_user_unsubscribed_message_type_columns", "macro_sql": "{% macro get_user_unsubscribed_message_type_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"_fivetran_id\", \"datatype\": dbt.type_string()},\n {\"name\": \"message_type_id\", \"datatype\": dbt.type_string()},\n {\"name\": \"email\", \"datatype\": dbt.type_string()},\n {\"name\": \"updated_at\", \"datatype\": dbt.type_timestamp()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.type_timestamp", "macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789419970.2356412, "supported_languages": null}, "macro.iterable.does_table_exist": {"name": "does_table_exist", "resource_type": "macro", "package_name": "iterable", "path": "macros/staging/does_table_exist.sql", "original_file_path": "macros/staging/does_table_exist.sql", "unique_id": "macro.iterable.does_table_exist", "macro_sql": "{%- macro does_table_exist(table_name) -%}\n {%- if execute -%} -- returns true when dbt is in execute mode\n {%- set ns = namespace(has_table=false) -%} -- declare boolean namespace and default value \n {%- for node in graph.sources.values() -%} -- grab sources from the dictionary of nodes \n -- call the database for the matching table\n {%- if node.name | lower == table_name | lower -%} \n {%- set source_relation = adapter.get_relation(\n database=node.database,\n schema=node.schema,\n identifier=node.identifier ) -%}\n {% endif %}\n {%- if source_relation == None -%} \n {{ return(False) }} -- return false if relation identified by the database.schema.identifier does not exist for the given table name\n {% endif %}\n {%- endfor -%}\n {{ return(True) }}\n {%- endif -%} \n{%- endmacro -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "table_name", "type": null, "description": ""}], "created_at": 1789419970.2369773, "supported_languages": null}, "macro.iterable.get_user_history_columns": {"name": "get_user_history_columns", "resource_type": "macro", "package_name": "iterable", "path": "macros/staging/get_user_history_columns.sql", "original_file_path": "macros/staging/get_user_history_columns.sql", "unique_id": "macro.iterable.get_user_history_columns", "macro_sql": "{% macro get_user_history_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_id\", \"datatype\": dbt.type_string()},\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"email\", \"datatype\": dbt.type_string()},\n {\"name\": \"email_list_ids\", \"datatype\": dbt.type_string()},\n {\"name\": \"first_name\", \"datatype\": dbt.type_string()},\n {\"name\": \"last_name\", \"datatype\": dbt.type_string()},\n {\"name\": \"phone_number\", \"datatype\": dbt.type_string()},\n {\"name\": \"signup_date\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"signup_source\", \"datatype\": dbt.type_string()},\n {\"name\": \"updated_at\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"user_id\", \"datatype\": dbt.type_string()},\n {\"name\": \"iterable_user_id\", \"datatype\": dbt.type_string()}\n\n] %}\n\n{{ fivetran_utils.add_pass_through_columns(columns, var('iterable_user_history_pass_through_columns')) }}\n\n{{ return(columns) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.type_string", "macro.dbt.type_timestamp", "macro.fivetran_utils.add_pass_through_columns"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789419970.2393436, "supported_languages": null}, "macro.iterable.get_campaign_suppression_list_history_columns": {"name": "get_campaign_suppression_list_history_columns", "resource_type": "macro", "package_name": "iterable", "path": "macros/staging/get_campaign_suppression_list_history_columns.sql", "original_file_path": "macros/staging/get_campaign_suppression_list_history_columns.sql", "unique_id": "macro.iterable.get_campaign_suppression_list_history_columns", "macro_sql": "{% macro get_campaign_suppression_list_history_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"campaign_id\", \"datatype\": dbt.type_int()},\n {\"name\": \"suppressed_list_id\", \"datatype\": dbt.type_int()},\n {\"name\": \"updated_at\", \"datatype\": dbt.type_timestamp()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.type_timestamp", "macro.dbt.type_int"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789419970.2403543, "supported_languages": null}, "macro.iterable.get_user_unsubscribed_channel_columns": {"name": "get_user_unsubscribed_channel_columns", "resource_type": "macro", "package_name": "iterable", "path": "macros/staging/get_user_unsubscribed_channel_columns.sql", "original_file_path": "macros/staging/get_user_unsubscribed_channel_columns.sql", "unique_id": "macro.iterable.get_user_unsubscribed_channel_columns", "macro_sql": "{% macro get_user_unsubscribed_channel_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"_fivetran_id\", \"datatype\": dbt.type_string()},\n {\"name\": \"channel_id\", \"datatype\": dbt.type_int()},\n {\"name\": \"email\", \"datatype\": dbt.type_string()},\n {\"name\": \"updated_at\", \"datatype\": dbt.type_timestamp()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.type_timestamp", "macro.dbt.type_string", "macro.dbt.type_int"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789419970.2414885, "supported_languages": null}, "macro.iterable.get_message_type_columns": {"name": "get_message_type_columns", "resource_type": "macro", "package_name": "iterable", "path": "macros/staging/get_message_type_columns.sql", "original_file_path": "macros/staging/get_message_type_columns.sql", "unique_id": "macro.iterable.get_message_type_columns", "macro_sql": "{% macro get_message_type_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_deleted\", \"datatype\": \"boolean\"},\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"channel_id\", \"datatype\": dbt.type_int()},\n {\"name\": \"id\", \"datatype\": dbt.type_int()},\n {\"name\": \"name\", \"datatype\": dbt.type_string()},\n {\"name\": \"created_at\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"frequency_cap\", \"datatype\": dbt.type_string()},\n {\"name\": \"rate_limit_per_minute\", \"datatype\": dbt.type_string()},\n {\"name\": \"subscription_policy\", \"datatype\": dbt.type_string()},\n {\"name\": \"updated_at\", \"datatype\": dbt.type_timestamp()},\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.type_timestamp", "macro.dbt.type_int", "macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789419970.2435055, "supported_languages": null}, "macro.iterable.get_channel_columns": {"name": "get_channel_columns", "resource_type": "macro", "package_name": "iterable", "path": "macros/staging/get_channel_columns.sql", "original_file_path": "macros/staging/get_channel_columns.sql", "unique_id": "macro.iterable.get_channel_columns", "macro_sql": "{% macro get_channel_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_deleted\", \"datatype\": \"boolean\"},\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"channel_type\", \"datatype\": dbt.type_string()},\n {\"name\": \"id\", \"datatype\": dbt.type_int()},\n {\"name\": \"message_medium\", \"datatype\": dbt.type_string()},\n {\"name\": \"name\", \"datatype\": dbt.type_string()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.type_timestamp", "macro.dbt.type_string", "macro.dbt.type_int"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789419970.2448218, "supported_languages": null}, "macro.fivetran_utils.enabled_vars_one_true": {"name": "enabled_vars_one_true", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/enabled_vars_one_true.sql", "original_file_path": "macros/enabled_vars_one_true.sql", "unique_id": "macro.fivetran_utils.enabled_vars_one_true", "macro_sql": "{% macro enabled_vars_one_true(vars) %}\n\n{% for v in vars %}\n \n {% if var(v, False) == True %}\n {{ return(True) }}\n {% endif %}\n\n{% endfor %}\n\n{{ return(False) }}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "vars", "type": null, "description": ""}], "created_at": 1789419970.2455053, "supported_languages": null}, "macro.fivetran_utils.json_parse": {"name": "json_parse", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/json_parse.sql", "original_file_path": "macros/json_parse.sql", "unique_id": "macro.fivetran_utils.json_parse", "macro_sql": "{% macro json_parse(string, string_path) -%}\n\n{{ adapter.dispatch('json_parse', 'fivetran_utils') (string, string_path) }}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.postgres__json_parse"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "string", "type": null, "description": ""}, {"name": "string_path", "type": null, "description": ""}], "created_at": 1789419970.2466562, "supported_languages": null}, "macro.fivetran_utils.default__json_parse": {"name": "default__json_parse", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/json_parse.sql", "original_file_path": "macros/json_parse.sql", "unique_id": "macro.fivetran_utils.default__json_parse", "macro_sql": "{% macro default__json_parse(string, string_path) %}\n\n json_extract_path_text({{string}}, {%- for s in string_path -%}'{{ s }}'{%- if not loop.last -%},{%- endif -%}{%- endfor -%} )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "string", "type": null, "description": ""}, {"name": "string_path", "type": null, "description": ""}], "created_at": 1789419970.2471104, "supported_languages": null}, "macro.fivetran_utils.redshift__json_parse": {"name": "redshift__json_parse", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/json_parse.sql", "original_file_path": "macros/json_parse.sql", "unique_id": "macro.fivetran_utils.redshift__json_parse", "macro_sql": "{% macro redshift__json_parse(string, string_path) %}\n\n json_extract_path_text({{string}}, {%- for s in string_path -%}'{{ s }}'{%- if not loop.last -%},{%- endif -%}{%- endfor -%} )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "string", "type": null, "description": ""}, {"name": "string_path", "type": null, "description": ""}], "created_at": 1789419970.2475336, "supported_languages": null}, "macro.fivetran_utils.bigquery__json_parse": {"name": "bigquery__json_parse", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/json_parse.sql", "original_file_path": "macros/json_parse.sql", "unique_id": "macro.fivetran_utils.bigquery__json_parse", "macro_sql": "{% macro bigquery__json_parse(string, string_path) %}\n\n \n json_extract_scalar({{string}}, '$.{%- for s in string_path -%}{{ s }}{%- if not loop.last -%}.{%- endif -%}{%- endfor -%} ')\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "string", "type": null, "description": ""}, {"name": "string_path", "type": null, "description": ""}], "created_at": 1789419970.247945, "supported_languages": null}, "macro.fivetran_utils.postgres__json_parse": {"name": "postgres__json_parse", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/json_parse.sql", "original_file_path": "macros/json_parse.sql", "unique_id": "macro.fivetran_utils.postgres__json_parse", "macro_sql": "{% macro postgres__json_parse(string, string_path) %}\n\n {{string}}::json #>> '{ {%- for s in string_path -%}{{ s }}{%- if not loop.last -%},{%- endif -%}{%- endfor -%} }'\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "string", "type": null, "description": ""}, {"name": "string_path", "type": null, "description": ""}], "created_at": 1789419970.2483394, "supported_languages": null}, "macro.fivetran_utils.snowflake__json_parse": {"name": "snowflake__json_parse", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/json_parse.sql", "original_file_path": "macros/json_parse.sql", "unique_id": "macro.fivetran_utils.snowflake__json_parse", "macro_sql": "{% macro snowflake__json_parse(string, string_path) %}\n\n parse_json( {{string}} ) {%- for s in string_path -%}{% if s is number %}[{{ s }}]{% else %}['{{ s }}']{% endif %}{%- endfor -%}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "string", "type": null, "description": ""}, {"name": "string_path", "type": null, "description": ""}], "created_at": 1789419970.2487967, "supported_languages": null}, "macro.fivetran_utils.spark__json_parse": {"name": "spark__json_parse", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/json_parse.sql", "original_file_path": "macros/json_parse.sql", "unique_id": "macro.fivetran_utils.spark__json_parse", "macro_sql": "{% macro spark__json_parse(string, string_path) %}\n\n {{string}} : {%- for s in string_path -%}{% if s is number %}[{{ s }}]{% else %}['{{ s }}']{% endif %}{%- endfor -%}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "string", "type": null, "description": ""}, {"name": "string_path", "type": null, "description": ""}], "created_at": 1789419970.2492352, "supported_languages": null}, "macro.fivetran_utils.sqlserver__json_parse": {"name": "sqlserver__json_parse", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/json_parse.sql", "original_file_path": "macros/json_parse.sql", "unique_id": "macro.fivetran_utils.sqlserver__json_parse", "macro_sql": "{% macro sqlserver__json_parse(string, string_path) %}\n\n json_value({{string}}, '$.{%- for s in string_path -%}{{ s }}{%- if not loop.last -%}.{%- endif -%}{%- endfor -%} ')\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "string", "type": null, "description": ""}, {"name": "string_path", "type": null, "description": ""}], "created_at": 1789419970.2496235, "supported_languages": null}, "macro.fivetran_utils.duckdb__json_parse": {"name": "duckdb__json_parse", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/json_parse.sql", "original_file_path": "macros/json_parse.sql", "unique_id": "macro.fivetran_utils.duckdb__json_parse", "macro_sql": "{% macro duckdb__json_parse(string, string_path) %}\n\n json_extract_string({{string}}, '${%- for s in string_path -%}{% if s is number %}[{{ s }}]{% else %}.{{ s }}{% endif %}{%- endfor -%}')\n \n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "string", "type": null, "description": ""}, {"name": "string_path", "type": null, "description": ""}], "created_at": 1789419970.2500758, "supported_languages": null}, "macro.fivetran_utils.union_relations_custom": {"name": "union_relations_custom", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/union_relations_custom.sql", "original_file_path": "macros/union_relations_custom.sql", "unique_id": "macro.fivetran_utils.union_relations_custom", "macro_sql": "{%- macro union_relations_custom(relations, aliases=none, column_override=none, include=[], exclude=[], source_column_name='_dbt_source_relation', where=none) -%}\n {{ return(adapter.dispatch('union_relations_custom', 'fivetran_utils')(relations, aliases, column_override, include, exclude, source_column_name, where)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.default__union_relations_custom"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relations", "type": null, "description": ""}, {"name": "aliases", "type": null, "description": ""}, {"name": "column_override", "type": null, "description": ""}, {"name": "include", "type": null, "description": ""}, {"name": "exclude", "type": null, "description": ""}, {"name": "source_column_name", "type": null, "description": ""}, {"name": "where", "type": null, "description": ""}], "created_at": 1789419970.2520802, "supported_languages": null}, "macro.fivetran_utils.default__union_relations_custom": {"name": "default__union_relations_custom", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/union_relations_custom.sql", "original_file_path": "macros/union_relations_custom.sql", "unique_id": "macro.fivetran_utils.default__union_relations_custom", "macro_sql": "\n\n{%- macro default__union_relations_custom(relations, aliases=none, column_override=none, include=[], exclude=[], source_column_name='_dbt_source_relation', where=none) -%}\n\n {%- if exclude and include -%}\n {{ exceptions.raise_compiler_error(\"Both an exclude and include list were provided to the `union` macro. Only one is allowed\") }}\n {%- endif -%}\n\n {#-- Prevent querying of db in parsing mode. This works because this macro does not create any new refs. -#}\n {%- if not execute %}\n {{ return('') }}\n {% endif -%}\n\n {%- set column_override = column_override if column_override is not none else {} -%}\n\n {%- set relation_columns = {} -%}\n {%- set column_superset = {} -%}\n {%- set all_excludes = [] -%}\n {%- set all_includes = [] -%}\n\n {%- if exclude -%}\n {%- for exc in exclude -%}\n {%- do all_excludes.append(exc | lower) -%}\n {%- endfor -%}\n {%- endif -%}\n\n {%- if include -%}\n {%- for inc in include -%}\n {%- do all_includes.append(inc | lower) -%}\n {%- endfor -%}\n {%- endif -%}\n\n {%- for relation in relations -%}\n\n {%- do relation_columns.update({relation: []}) -%}\n\n {%- do dbt_utils._is_relation(relation, 'union_relations_custom') -%}\n {%- do dbt_utils._is_ephemeral(relation, 'union_relations_custom') -%}\n {%- set cols = adapter.get_columns_in_relation(relation) -%}\n {%- for col in cols -%}\n\n {#- If an exclude list was provided and the column is in the list, do nothing -#}\n {%- if exclude and col.column | lower in all_excludes -%}\n\n {#- If an include list was provided and the column is not in the list, do nothing -#}\n {%- elif include and col.column | lower not in all_includes -%}\n\n {#- Otherwise add the column to the column superset -#}\n {%- else -%}\n\n {#- update the list of columns in this relation -#}\n {%- do relation_columns[relation].append(col.column) -%}\n\n {%- if col.column in column_superset -%}\n\n {%- set stored = column_superset[col.column] -%}\n {%- if col.is_string() and stored.is_string() and col.string_size() > stored.string_size() -%}\n\n {%- do column_superset.update({col.column: col}) -%}\n\n {%- endif %}\n\n {%- else -%}\n\n {%- do column_superset.update({col.column: col}) -%}\n\n {%- endif -%}\n\n {%- endif -%}\n\n {%- endfor -%}\n {%- endfor -%}\n\n {%- set ordered_column_names = column_superset.keys() -%}\n {%- set dbt_command = flags.WHICH -%}\n\n\n {% if dbt_command in ['run', 'build'] %}\n {% if (include | length > 0 or exclude | length > 0) and not column_superset.keys() %}\n {%- set relations_string -%}\n {%- for relation in relations -%}\n {{ relation.name }}\n {%- if not loop.last %}, {% endif -%}\n {%- endfor -%}\n {%- endset -%}\n\n {%- set error_message -%}\n There were no columns found to union for relations {{ relations_string }}\n {%- endset -%}\n\n {{ exceptions.raise_compiler_error(error_message) }}\n {%- endif -%}\n {%- endif -%}\n\n {%- for relation in relations %}\n\n (\n select\n\n {%- if source_column_name is not none %}\n {# dbt_utils union_relations includes the table in the source_relation. For Fivetran dbt package purposes the table should not be included in the source relation. #}\n cast({{ dbt.string_literal(relation.database ~ '.' ~ relation.schema) }} as {{ dbt.type_string() }}) as {{ source_column_name }},\n {%- endif %}\n\n {% for col_name in ordered_column_names -%}\n\n {%- set col = column_superset[col_name] %}\n {%- set col_type = column_override.get(col.column, col.data_type) %}\n {%- set col_name = adapter.quote(col_name) if col_name in relation_columns[relation] else 'null' %}\n cast({{ col_name }} as {{ col_type }}) as {{ col.quoted }} {% if not loop.last %},{% endif -%}\n\n {%- endfor %}\n \n {# This alias is a change from dbt_utils union_relations code. Avoids errors if the table is named a reserved keyword #}\n from {{ aliases[loop.index0] if aliases else relation }} as unioned_relation_{{ loop.index }}\n\n {% if where -%}\n where {{ where }}\n {%- endif %}\n )\n\n {% if not loop.last -%}\n union all\n {% endif -%}\n\n {%- endfor -%}\n\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt_utils._is_relation", "macro.dbt_utils._is_ephemeral", "macro.dbt.string_literal", "macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relations", "type": null, "description": ""}, {"name": "aliases", "type": null, "description": ""}, {"name": "column_override", "type": null, "description": ""}, {"name": "include", "type": null, "description": ""}, {"name": "exclude", "type": null, "description": ""}, {"name": "source_column_name", "type": null, "description": ""}, {"name": "where", "type": null, "description": ""}], "created_at": 1789419970.2581773, "supported_languages": null}, "macro.fivetran_utils.seed_data_helper": {"name": "seed_data_helper", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/seed_data_helper.sql", "original_file_path": "macros/seed_data_helper.sql", "unique_id": "macro.fivetran_utils.seed_data_helper", "macro_sql": "{% macro seed_data_helper(seed_name, warehouses) %}\n\n{% if target.type in warehouses %}\n {% for w in warehouses %}\n {% if target.type == w %}\n {{ return(ref(seed_name ~ \"_\" ~ w ~ \"\")) }}\n {% endif %}\n {% endfor %}\n{% else %}\n{{ return(ref(seed_name)) }}\n{% endif %}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "seed_name", "type": null, "description": ""}, {"name": "warehouses", "type": null, "description": ""}], "created_at": 1789419970.2592802, "supported_languages": null}, "macro.fivetran_utils.drop_schemas_automation": {"name": "drop_schemas_automation", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/drop_schemas_automation.sql", "original_file_path": "macros/drop_schemas_automation.sql", "unique_id": "macro.fivetran_utils.drop_schemas_automation", "macro_sql": "{% macro drop_schemas_automation(drop_target_schema=true) %}\n {{ return(adapter.dispatch('drop_schemas_automation', 'fivetran_utils')(drop_target_schema)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.default__drop_schemas_automation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "drop_target_schema", "type": null, "description": ""}], "created_at": 1789419970.2601256, "supported_languages": null}, "macro.fivetran_utils.default__drop_schemas_automation": {"name": "default__drop_schemas_automation", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/drop_schemas_automation.sql", "original_file_path": "macros/drop_schemas_automation.sql", "unique_id": "macro.fivetran_utils.default__drop_schemas_automation", "macro_sql": "{% macro default__drop_schemas_automation(drop_target_schema=true) %}\n\n{% set fetch_list_sql %}\n {% if target.type not in ('databricks', 'spark') %}\n select schema_name\n from \n {{ wrap_in_quotes(target.database) }}.INFORMATION_SCHEMA.SCHEMATA\n where lower(schema_name) like '{{ target.schema | lower }}{%- if not drop_target_schema -%}_{%- endif -%}%'\n {% else %}\n SHOW SCHEMAS LIKE '{{ target.schema }}{%- if not drop_target_schema -%}_{%- endif -%}*'\n {% endif %}\n{% endset %}\n\n{% set results = run_query(fetch_list_sql) %}\n\n{% if execute %}\n {% set results_list = results.columns[0].values() %}\n{% else %}\n {% set results_list = [] %}\n{% endif %}\n\n{% for schema_to_drop in results_list %}\n {% do adapter.drop_schema(api.Relation.create(database=target.database, schema=schema_to_drop)) %}\n {{ print('Schema ' ~ schema_to_drop ~ ' successfully dropped from the ' ~ target.database ~ ' database.\\n')}}\n{% endfor %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.wrap_in_quotes", "macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "drop_target_schema", "type": null, "description": ""}], "created_at": 1789419970.2618947, "supported_languages": null}, "macro.fivetran_utils.duckdb__drop_schemas_automation": {"name": "duckdb__drop_schemas_automation", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/drop_schemas_automation.sql", "original_file_path": "macros/drop_schemas_automation.sql", "unique_id": "macro.fivetran_utils.duckdb__drop_schemas_automation", "macro_sql": "{% macro duckdb__drop_schemas_automation(drop_target_schema=true) %}\n\n {{ print('Not dropping any schemas in DuckDB.\\n') }}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "drop_target_schema", "type": null, "description": ""}], "created_at": 1789419970.2621756, "supported_languages": null}, "macro.fivetran_utils.ceiling": {"name": "ceiling", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/ceiling.sql", "original_file_path": "macros/ceiling.sql", "unique_id": "macro.fivetran_utils.ceiling", "macro_sql": "{% macro ceiling(num) -%}\n\n{{ adapter.dispatch('ceiling', 'fivetran_utils') (num) }}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.default__ceiling"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "num", "type": null, "description": ""}], "created_at": 1789419970.2626162, "supported_languages": null}, "macro.fivetran_utils.default__ceiling": {"name": "default__ceiling", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/ceiling.sql", "original_file_path": "macros/ceiling.sql", "unique_id": "macro.fivetran_utils.default__ceiling", "macro_sql": "{% macro default__ceiling(num) %}\n ceiling({{ num }})\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "num", "type": null, "description": ""}], "created_at": 1789419970.2628174, "supported_languages": null}, "macro.fivetran_utils.snowflake__ceiling": {"name": "snowflake__ceiling", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/ceiling.sql", "original_file_path": "macros/ceiling.sql", "unique_id": "macro.fivetran_utils.snowflake__ceiling", "macro_sql": "{% macro snowflake__ceiling(num) %}\n ceil({{ num }})\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "num", "type": null, "description": ""}], "created_at": 1789419970.2629945, "supported_languages": null}, "macro.fivetran_utils.fill_pass_through_columns": {"name": "fill_pass_through_columns", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/fill_pass_through_columns.sql", "original_file_path": "macros/fill_pass_through_columns.sql", "unique_id": "macro.fivetran_utils.fill_pass_through_columns", "macro_sql": "{% macro fill_pass_through_columns(pass_through_variable) %}\n\n{% if var(pass_through_variable) %}\n {% for field in var(pass_through_variable) %}\n {% if field is mapping %}\n {% if field.transform_sql %}\n , {{ field.transform_sql }} as {{ field.alias if field.alias else field.name }}\n {% else %}\n , {{ field.alias if field.alias else field.name }}\n {% endif %}\n {% else %}\n , {{ field }}\n {% endif %}\n {% endfor %}\n{% endif %}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "pass_through_variable", "type": null, "description": ""}], "created_at": 1789419970.2641497, "supported_languages": null}, "macro.fivetran_utils.persist_pass_through_columns": {"name": "persist_pass_through_columns", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/persist_pass_through_columns.sql", "original_file_path": "macros/persist_pass_through_columns.sql", "unique_id": "macro.fivetran_utils.persist_pass_through_columns", "macro_sql": "{% macro persist_pass_through_columns(pass_through_variable, identifier=none, transform='') %}\n\n{% if var(pass_through_variable, none) %}\n {% for field in var(pass_through_variable) %}\n , {{ transform ~ '(' ~ (identifier ~ '.' if identifier else '') ~ (field.alias if field.alias else field.name) ~ ')' }} as {{ field.alias if field.alias else field.name }}\n {% endfor %}\n{% endif %}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "pass_through_variable", "type": null, "description": ""}, {"name": "identifier", "type": null, "description": ""}, {"name": "transform", "type": null, "description": ""}], "created_at": 1789419970.265262, "supported_languages": null}, "macro.fivetran_utils.try_cast": {"name": "try_cast", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/try_cast.sql", "original_file_path": "macros/try_cast.sql", "unique_id": "macro.fivetran_utils.try_cast", "macro_sql": "{% macro try_cast(field, type) %}\n {{ adapter.dispatch('try_cast', 'fivetran_utils') (field, type) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.postgres__try_cast"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field", "type": null, "description": ""}, {"name": "type", "type": null, "description": ""}], "created_at": 1789419970.2661786, "supported_languages": null}, "macro.fivetran_utils.default__try_cast": {"name": "default__try_cast", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/try_cast.sql", "original_file_path": "macros/try_cast.sql", "unique_id": "macro.fivetran_utils.default__try_cast", "macro_sql": "{% macro default__try_cast(field, type) %}\n {# most databases don't support this function yet\n so we just need to use cast #}\n cast({{field}} as {{type}})\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field", "type": null, "description": ""}, {"name": "type", "type": null, "description": ""}], "created_at": 1789419970.2664347, "supported_languages": null}, "macro.fivetran_utils.redshift__try_cast": {"name": "redshift__try_cast", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/try_cast.sql", "original_file_path": "macros/try_cast.sql", "unique_id": "macro.fivetran_utils.redshift__try_cast", "macro_sql": "{% macro redshift__try_cast(field, type) %}\n{%- if type == 'numeric' -%}\n\n case\n when trim({{field}}) ~ '^(0|[1-9][0-9]*)$' then trim({{field}})\n else null\n end::{{type}}\n\n{% else %}\n {{ exceptions.raise_compiler_error(\n \"non-numeric datatypes are not currently supported\") }}\n\n{% endif %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field", "type": null, "description": ""}, {"name": "type", "type": null, "description": ""}], "created_at": 1789419970.2669196, "supported_languages": null}, "macro.fivetran_utils.postgres__try_cast": {"name": "postgres__try_cast", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/try_cast.sql", "original_file_path": "macros/try_cast.sql", "unique_id": "macro.fivetran_utils.postgres__try_cast", "macro_sql": "{% macro postgres__try_cast(field, type) %}\n{%- if type == 'numeric' -%}\n\n case\n when replace(cast({{field}} as varchar),cast(' ' as varchar),cast('' as varchar)) ~ '^(0|[1-9][0-9]*)$' \n then replace(cast({{field}} as varchar),cast(' ' as varchar),cast('' as varchar))\n else null\n end::{{type}}\n\n{% else %}\n {{ exceptions.raise_compiler_error(\n \"non-numeric datatypes are not currently supported\") }}\n\n{% endif %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field", "type": null, "description": ""}, {"name": "type", "type": null, "description": ""}], "created_at": 1789419970.2674005, "supported_languages": null}, "macro.fivetran_utils.snowflake__try_cast": {"name": "snowflake__try_cast", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/try_cast.sql", "original_file_path": "macros/try_cast.sql", "unique_id": "macro.fivetran_utils.snowflake__try_cast", "macro_sql": "{% macro snowflake__try_cast(field, type) %}\n try_cast(cast({{field}} as varchar) as {{type}})\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field", "type": null, "description": ""}, {"name": "type", "type": null, "description": ""}], "created_at": 1789419970.2676237, "supported_languages": null}, "macro.fivetran_utils.bigquery__try_cast": {"name": "bigquery__try_cast", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/try_cast.sql", "original_file_path": "macros/try_cast.sql", "unique_id": "macro.fivetran_utils.bigquery__try_cast", "macro_sql": "{% macro bigquery__try_cast(field, type) %}\n safe_cast({{field}} as {{type}})\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field", "type": null, "description": ""}, {"name": "type", "type": null, "description": ""}], "created_at": 1789419970.2679844, "supported_languages": null}, "macro.fivetran_utils.spark__try_cast": {"name": "spark__try_cast", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/try_cast.sql", "original_file_path": "macros/try_cast.sql", "unique_id": "macro.fivetran_utils.spark__try_cast", "macro_sql": "{% macro spark__try_cast(field, type) %}\n try_cast({{field}} as {{type}})\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field", "type": null, "description": ""}, {"name": "type", "type": null, "description": ""}], "created_at": 1789419970.2682095, "supported_languages": null}, "macro.fivetran_utils.sqlserver__try_cast": {"name": "sqlserver__try_cast", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/try_cast.sql", "original_file_path": "macros/try_cast.sql", "unique_id": "macro.fivetran_utils.sqlserver__try_cast", "macro_sql": "{% macro sqlserver__try_cast(field, type) %}\n try_cast({{field}} as {{type}})\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field", "type": null, "description": ""}, {"name": "type", "type": null, "description": ""}], "created_at": 1789419970.2684226, "supported_languages": null}, "macro.fivetran_utils.fivetran_date_spine": {"name": "fivetran_date_spine", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/fivetran_date_spine.sql", "original_file_path": "macros/fivetran_date_spine.sql", "unique_id": "macro.fivetran_utils.fivetran_date_spine", "macro_sql": "{% macro fivetran_date_spine(datepart, start_date, end_date) -%}\n\n{{ return(adapter.dispatch('fivetran_date_spine', 'fivetran_utils') (datepart, start_date, end_date)) }}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.default__fivetran_date_spine"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "datepart", "type": null, "description": ""}, {"name": "start_date", "type": null, "description": ""}, {"name": "end_date", "type": null, "description": ""}], "created_at": 1789419970.2693393, "supported_languages": null}, "macro.fivetran_utils.default__fivetran_date_spine": {"name": "default__fivetran_date_spine", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/fivetran_date_spine.sql", "original_file_path": "macros/fivetran_date_spine.sql", "unique_id": "macro.fivetran_utils.default__fivetran_date_spine", "macro_sql": "{% macro default__fivetran_date_spine(datepart, start_date, end_date) %}\n\n {{ dbt_utils.date_spine(datepart, start_date, end_date) }}\n \n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.date_spine"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "datepart", "type": null, "description": ""}, {"name": "start_date", "type": null, "description": ""}, {"name": "end_date", "type": null, "description": ""}], "created_at": 1789419970.2696517, "supported_languages": null}, "macro.fivetran_utils.sqlserver__fivetran_date_spine": {"name": "sqlserver__fivetran_date_spine", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/fivetran_date_spine.sql", "original_file_path": "macros/fivetran_date_spine.sql", "unique_id": "macro.fivetran_utils.sqlserver__fivetran_date_spine", "macro_sql": "{% macro sqlserver__fivetran_date_spine(datepart, start_date, end_date) -%}\n\n {% set date_spine_query %}\n with\n\n l0 as (\n\n select c\n from (select 1 union all select 1) as d(c)\n\n ),\n l1 as (\n\n select\n 1 as c\n from l0 as a\n cross join l0 as b\n\n ),\n\n l2 as (\n\n select 1 as c\n from l1 as a\n cross join l1 as b\n ),\n\n l3 as (\n\n select 1 as c\n from l2 as a\n cross join l2 as b\n ),\n\n l4 as (\n\n select 1 as c\n from l3 as a\n cross join l3 as b\n ),\n\n l5 as (\n\n select 1 as c\n from l4 as a\n cross join l4 as b\n ),\n\n nums as (\n\n select row_number() over (order by (select null)) as rownum\n from l5\n ),\n\n rawdata as (\n\n select top ({{dbt.datediff(start_date, end_date, datepart)}}) rownum -1 as n\n from nums\n order by rownum\n ),\n\n all_periods as (\n\n select (\n {{\n dbt.dateadd(\n datepart,\n 'n',\n start_date\n )\n }}\n ) as date_{{datepart}}\n from rawdata\n ),\n\n filtered as (\n\n select *\n from all_periods\n where date_{{datepart}} <= {{ end_date }}\n\n )\n\n select * from filtered\n order by 1\n\n {% endset %}\n\n {% set results = run_query(date_spine_query) %}\n\n {% if execute %}\n\n {% set results_list = results.columns[0].values() %}\n \n {% else %}\n\n {% set results_list = [] %}\n\n {% endif %}\n\n {%- for date_field in results_list %}\n select cast('{{ date_field }}' as date) as date_{{datepart}} {{ 'union all ' if not loop.last else '' }}\n {% endfor -%}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.datediff", "macro.dbt.dateadd", "macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "datepart", "type": null, "description": ""}, {"name": "start_date", "type": null, "description": ""}, {"name": "end_date", "type": null, "description": ""}], "created_at": 1789419970.2710762, "supported_languages": null}, "macro.fivetran_utils.partition_by_source_relation": {"name": "partition_by_source_relation", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/partition_by_source_relation.sql", "original_file_path": "macros/partition_by_source_relation.sql", "unique_id": "macro.fivetran_utils.partition_by_source_relation", "macro_sql": "{% macro partition_by_source_relation(package_name, has_other_partitions='yes', alias=None, package_prefix_union_variable=true) %}\n {{ return(adapter.dispatch('partition_by_source_relation', 'fivetran_utils')(package_name, has_other_partitions, alias, package_prefix_union_variable)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.default__partition_by_source_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "package_name", "type": null, "description": ""}, {"name": "has_other_partitions", "type": null, "description": ""}, {"name": "alias", "type": null, "description": ""}, {"name": "package_prefix_union_variable", "type": null, "description": ""}], "created_at": 1789419970.2720149, "supported_languages": null}, "macro.fivetran_utils.default__partition_by_source_relation": {"name": "default__partition_by_source_relation", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/partition_by_source_relation.sql", "original_file_path": "macros/partition_by_source_relation.sql", "unique_id": "macro.fivetran_utils.default__partition_by_source_relation", "macro_sql": "{% macro default__partition_by_source_relation(package_name, has_other_partitions='yes', alias=None, package_prefix_union_variable=true) -%}\n\n{%- if package_prefix_union_variable %}\n {%- set union_schemas_var = package_name ~ '_union_schemas' -%}\n {%- set union_databases_var = package_name ~ '_union_databases' -%}\n{%- else %}\n {%- set union_schemas_var = 'union_schemas' -%}\n {%- set union_databases_var = 'union_databases' -%}\n{%- endif -%}\n\n{%- set is_unioning = var(union_schemas_var, [])|length > 1 or var(union_databases_var, [])|length > 1 or var(package_name ~ '_sources', [])|length > 1 -%}\n{%- set prefix = '' if alias is none else alias ~ '.' -%}\n\n{%- if has_other_partitions == 'no' -%}\n {{- 'partition by ' ~ prefix ~ 'source_relation' if is_unioning else '' -}}\n{%- else -%}\n {{- ', ' ~ prefix ~ 'source_relation' if is_unioning else '' -}}\n{%- endif -%}\n\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "package_name", "type": null, "description": ""}, {"name": "has_other_partitions", "type": null, "description": ""}, {"name": "alias", "type": null, "description": ""}, {"name": "package_prefix_union_variable", "type": null, "description": ""}], "created_at": 1789419970.2735422, "supported_languages": null}, "macro.fivetran_utils.fill_staging_columns": {"name": "fill_staging_columns", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/fill_staging_columns.sql", "original_file_path": "macros/fill_staging_columns.sql", "unique_id": "macro.fivetran_utils.fill_staging_columns", "macro_sql": "{% macro fill_staging_columns(source_columns, staging_columns) %}\n\n{%- set source_column_names = source_columns|map(attribute='name')|map('lower')|list -%}\n{%- set using_source_casing = var('fivetran_using_source_casing', false) -%}\n\n{%- for column in staging_columns %}\n {%- if column.name|lower in source_column_names %}\n {%- if using_source_casing %}\n {%- set column_alias = column.alias if 'alias' in column else column.name %}\n {{ adapter.quote(column.name) }} as {{ adapter.quote(column_alias|upper if target.type == 'snowflake' else column_alias) }}\n {%- else %}\n {{ fivetran_utils.quote_column(column) }} as\n {%- if 'alias' in column %} {{ column.alias }}{% else %} {{ fivetran_utils.quote_column(column) }}{% endif %}\n {%- endif %}\n {%- else %}\n cast(null as {{ column.datatype }}) as\n {%- if 'alias' in column %} {{ column.alias }}{% else %} {{ fivetran_utils.quote_column(column) }}{% endif %}\n {%- endif %}{{ ',' if not loop.last }}\n{%- endfor %}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.quote_column"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "source_columns", "type": null, "description": ""}, {"name": "staging_columns", "type": null, "description": ""}], "created_at": 1789419970.2760534, "supported_languages": null}, "macro.fivetran_utils.quote_column": {"name": "quote_column", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/fill_staging_columns.sql", "original_file_path": "macros/fill_staging_columns.sql", "unique_id": "macro.fivetran_utils.quote_column", "macro_sql": "{% macro quote_column(column) %}\n {%- if 'quote' in column %}\n {%- if column.quote %}\n {%- if target.type in ('bigquery', 'spark', 'databricks') %}\n `{{ column.name }}`\n {%- elif target.type == 'snowflake' %}\n \"{{ column.name | upper }}\"\n {%- else %}\n \"{{ column.name }}\"\n {%- endif %}\n {%- else %}{{ column.name }}\n {%- endif %}\n {%- else %}{{ column.name }}\n {%- endif %}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "column", "type": null, "description": ""}], "created_at": 1789419970.2775865, "supported_languages": null}, "macro.fivetran_utils.union_connections": {"name": "union_connections", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/union_connections.sql", "original_file_path": "macros/union_connections.sql", "unique_id": "macro.fivetran_utils.union_connections", "macro_sql": "{% macro union_connections(connection_dictionary, single_source_name, single_table_name, default_identifier=single_table_name) %}\n\n{{ adapter.dispatch('union_connections', 'fivetran_utils') (connection_dictionary, single_source_name, single_table_name, default_identifier) }}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.default__union_connections"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "connection_dictionary", "type": null, "description": ""}, {"name": "single_source_name", "type": null, "description": ""}, {"name": "single_table_name", "type": null, "description": ""}, {"name": "default_identifier", "type": null, "description": ""}], "created_at": 1789419970.2790241, "supported_languages": null}, "macro.fivetran_utils.default__union_connections": {"name": "default__union_connections", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/union_connections.sql", "original_file_path": "macros/union_connections.sql", "unique_id": "macro.fivetran_utils.default__union_connections", "macro_sql": "{% macro default__union_connections(connection_dictionary, single_source_name, single_table_name, default_identifier=single_table_name) %}\n\n{%- set exception_warning = \"\\n\\nPlease be aware: The \" ~ single_source_name|upper ~ \".\" ~ single_table_name|upper ~ \" table was not found in your schema(s). The Fivetran Data Model will create a completely empty staging model as to not break downstream transformations. To turn off these warnings, set the `fivetran__remove_empty_table_warnings` variable to TRUE (see https://github.com/fivetran/dbt_fivetran_utils/tree/releases/v0.4.latest#union_connections-source for details).\\n\"%}\n{%- set using_empty_table_warnings = (execute and not var('fivetran__remove_empty_table_warnings', false)) %}\n{%- set connections = var(connection_dictionary, []) %}\n{%- set using_unioning = connections | length > 0 %}\n{%- set identifier_var = single_source_name + \"_\" + single_table_name + \"_identifier\" %}\n\n{%- if using_unioning %}\n{# For unioning #}\n {%- set relations = [] -%}\n {%- for connection in connections -%}\n\n {% if var('has_defined_sources', false) %}\n {%- set database = source(connection.name, single_table_name).database %}\n {%- set schema = source(connection.name, single_table_name).schema %}\n {%- set identifier = source(connection.name, single_table_name).identifier %}\n {%- else %}\n {%- set database = connection.database if connection.database else target.database %}\n {%- set schema = connection.schema if connection.schema else single_source_name %}\n {%- set identifier = var(identifier_var, default_identifier) %}\n {%- endif %}\n \n {%- set relation=adapter.get_relation(\n database=database,\n schema=schema,\n identifier=identifier\n )\n -%}\n\n {%- if relation is not none -%}\n {%- do relations.append(relation) -%}\n {%- endif -%}\n\n -- ** Values passed to adapter.get_relation:\n {{ '-- database: ' ~ database }}\n {{ '-- schema: ' ~ schema }}\n {{ '-- identifier: ' ~ identifier ~ '\\n' }}\n\n {%- endfor -%}\n\n {%- if relations | length > 0 -%}\n {{ fivetran_utils.union_relations_custom(relations, source_column_name='_dbt_source_relation') }}\n\n {%- else -%}\n {{ exceptions.warn(exception_warning) if using_empty_table_warnings }}\n\n select\n cast(null as {{ dbt.type_string() }}) as _dbt_source_relation\n limit {{ '0' if target.type != 'redshift' else '1' }}\n {%- endif -%}\n\n{% else %}\n{# Not unioning #}\n\n {%- set database = source(single_source_name, single_table_name).database %}\n {%- set schema = source(single_source_name, single_table_name).schema %}\n {%- set identifier = var(identifier_var, default_identifier) %}\n\n {%- set relation=adapter.get_relation(\n database=database,\n schema=schema,\n identifier=identifier\n )\n -%}\n\n -- ** Values passed to adapter.get_relation:\n {{ '-- full-identifier_var: ' ~ identifier_var }}\n {{ '-- database: ' ~ database }} \n {{ '-- schema: ' ~ schema }}\n {{ '-- identifier: ' ~ identifier ~ '\\n' }}\n\n {% if relation is not none -%}\n select\n {{ dbt_utils.star(from=source(single_source_name, single_table_name)) }}\n from {{ source(single_source_name, single_table_name) }} as source_table\n\n {% else %}\n {{ exceptions.warn(exception_warning) if using_empty_table_warnings }}\n\n select\n cast(null as {{ dbt.type_string() }}) as _dbt_source_relation\n limit {{ '0' if target.type != 'redshift' else '1' }}\n {%- endif -%}\n{% endif -%}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.union_relations_custom", "macro.dbt.type_string", "macro.dbt_utils.star"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "connection_dictionary", "type": null, "description": ""}, {"name": "single_source_name", "type": null, "description": ""}, {"name": "single_table_name", "type": null, "description": ""}, {"name": "default_identifier", "type": null, "description": ""}], "created_at": 1789419970.2836392, "supported_languages": null}, "macro.fivetran_utils.source_relation": {"name": "source_relation", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/source_relation.sql", "original_file_path": "macros/source_relation.sql", "unique_id": "macro.fivetran_utils.source_relation", "macro_sql": "{% macro source_relation(union_schema_variable='union_schemas', union_database_variable='union_databases') -%}\n\n{{ adapter.dispatch('source_relation', 'fivetran_utils') (union_schema_variable, union_database_variable) }}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.default__source_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "union_schema_variable", "type": null, "description": ""}, {"name": "union_database_variable", "type": null, "description": ""}], "created_at": 1789419970.284378, "supported_languages": null}, "macro.fivetran_utils.default__source_relation": {"name": "default__source_relation", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/source_relation.sql", "original_file_path": "macros/source_relation.sql", "unique_id": "macro.fivetran_utils.default__source_relation", "macro_sql": "{% macro default__source_relation(union_schema_variable, union_database_variable) %}\n\n{% if var(union_schema_variable, none) %}\n, case\n {% for schema in var(union_schema_variable) %}\n when lower(replace(replace(_dbt_source_relation,'\"',''),'`','')) like '%.{{ schema|lower }}.%' then '{{ schema|lower }}'\n {% endfor %}\n end as source_relation\n{% elif var(union_database_variable, none) %}\n, case\n {% for database in var(union_database_variable) %}\n when lower(replace(replace(_dbt_source_relation,'\"',''),'`','')) like '%{{ database|lower }}.%' then '{{ database|lower }}'\n {% endfor %}\n end as source_relation\n{% else %}\n, cast('' as {{ dbt.type_string() }}) as source_relation\n{% endif %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "union_schema_variable", "type": null, "description": ""}, {"name": "union_database_variable", "type": null, "description": ""}], "created_at": 1789419970.2853503, "supported_languages": null}, "macro.fivetran_utils.apply_source_relation": {"name": "apply_source_relation", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/apply_source_relation.sql", "original_file_path": "macros/apply_source_relation.sql", "unique_id": "macro.fivetran_utils.apply_source_relation", "macro_sql": "{% macro apply_source_relation(package_name, use_package_prefix=true) -%}\n\n{{ adapter.dispatch('apply_source_relation', 'fivetran_utils') (package_name, use_package_prefix) }}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.default__apply_source_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "package_name", "type": null, "description": ""}, {"name": "use_package_prefix", "type": null, "description": ""}], "created_at": 1789419970.2861254, "supported_languages": null}, "macro.fivetran_utils.default__apply_source_relation": {"name": "default__apply_source_relation", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/apply_source_relation.sql", "original_file_path": "macros/apply_source_relation.sql", "unique_id": "macro.fivetran_utils.default__apply_source_relation", "macro_sql": "{% macro default__apply_source_relation(package_name, use_package_prefix=true) -%}\n\n{% set sources_var = package_name ~ '_sources' %}\n{% set database_var = package_name ~ '_database' %}\n{% set schema_var = package_name ~ '_schema' %}\n\n{% if use_package_prefix %}\n {% set union_schemas_var = package_name ~ '_union_schemas' %}\n {% set union_databases_var = package_name ~ '_union_databases' %}\n{% else %}\n {% set union_schemas_var = 'union_schemas' %}\n {% set union_databases_var = 'union_databases' %}\n{% endif %}\n\n{% if var(sources_var, []) | length > 0 %}\n, _dbt_source_relation as source_relation\n{% elif var(union_schemas_var, []) | length > 0 or var(union_databases_var, []) | length > 0 %}\n{{ fivetran_utils.source_relation(union_schema_variable=union_schemas_var, union_database_variable=union_databases_var) }}\n{% else %}\n{% set database = var(database_var, target.database) %}\n{% set schema = var(schema_var, package_name) %}\n, cast('{{ database ~ \".\" ~ schema }}' as {{ dbt.type_string() }}) as source_relation\n{% endif %}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.source_relation", "macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "package_name", "type": null, "description": ""}, {"name": "use_package_prefix", "type": null, "description": ""}], "created_at": 1789419970.28795, "supported_languages": null}, "macro.fivetran_utils.calculated_fields": {"name": "calculated_fields", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/calculated_fields.sql", "original_file_path": "macros/calculated_fields.sql", "unique_id": "macro.fivetran_utils.calculated_fields", "macro_sql": "{% macro calculated_fields(variable) -%}\n\n{% if var(variable, none) %}\n {% for field in var(variable) %}\n , {{ field.transform_sql }} as {{ field.name }} \n {% endfor %}\n{% endif %}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "variable", "type": null, "description": ""}], "created_at": 1789419970.2886033, "supported_languages": null}, "macro.fivetran_utils.union_data": {"name": "union_data", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/union_data.sql", "original_file_path": "macros/union_data.sql", "unique_id": "macro.fivetran_utils.union_data", "macro_sql": "{%- macro union_data(table_identifier, database_variable, schema_variable, default_database, default_schema, default_variable, union_schema_variable='union_schemas', union_database_variable='union_databases') -%}\n\n{{ adapter.dispatch('union_data', 'fivetran_utils') (\n table_identifier, \n database_variable, \n schema_variable, \n default_database, \n default_schema, \n default_variable,\n union_schema_variable,\n union_database_variable\n ) }}\n\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.fivetran_utils.default__union_data"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "table_identifier", "type": null, "description": ""}, {"name": "database_variable", "type": null, "description": ""}, {"name": "schema_variable", "type": null, "description": ""}, {"name": "default_database", "type": null, "description": ""}, {"name": "default_schema", "type": null, "description": ""}, {"name": "default_variable", "type": null, "description": ""}, {"name": "union_schema_variable", "type": null, "description": ""}, {"name": "union_database_variable", "type": null, "description": ""}], "created_at": 1789419970.290683, "supported_languages": null}, "macro.fivetran_utils.default__union_data": {"name": "default__union_data", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/union_data.sql", "original_file_path": "macros/union_data.sql", "unique_id": "macro.fivetran_utils.default__union_data", "macro_sql": "{%- macro default__union_data(\n table_identifier, \n database_variable, \n schema_variable, \n default_database, \n default_schema, \n default_variable,\n union_schema_variable,\n union_database_variable\n ) -%}\n\n{%- if var(union_schema_variable, none) -%}\n\n {%- set relations = [] -%}\n \n {%- if var(union_schema_variable) is string -%}\n {%- set trimmed = var(union_schema_variable)|trim('[')|trim(']') -%}\n {%- set schemas = trimmed.split(',')|map('trim',\" \")|map('trim','\"')|map('trim',\"'\") -%}\n {%- else -%}\n {%- set schemas = var(union_schema_variable) -%}\n {%- endif -%}\n\n {%- for schema in var(union_schema_variable) -%}\n {%- set relation=adapter.get_relation(\n database=source(schema, table_identifier).database if var('has_defined_sources', false) else var(database_variable, default_database),\n schema=source(schema, table_identifier).schema if var('has_defined_sources', false) else schema,\n identifier=source(schema, table_identifier).identifier if var('has_defined_sources', false) else table_identifier\n ) -%}\n \n {%- set relation_exists=relation is not none -%}\n\n {%- if relation_exists -%}\n {%- do relations.append(relation) -%}\n {%- endif -%}\n\n {%- endfor -%}\n \n {%- if relations != [] -%}\n {{ dbt_utils.union_relations(relations) }}\n {%- else -%}\n {% if execute and not var('fivetran__remove_empty_table_warnings', false) -%}\n {{ exceptions.warn(\"\\n\\nPlease be aware: The \" ~ table_identifier|upper ~ \" table was not found in your \" ~ default_schema|upper ~ \" schema(s). The Fivetran dbt package will create a completely empty \" ~ table_identifier|upper ~ \" staging model as to not break downstream transformations. To turn off these warnings, set the `fivetran__remove_empty_table_warnings` variable to TRUE (see https://github.com/fivetran/dbt_fivetran_utils/tree/releases/v0.4.latest#union_data-source for details).\\n\") }}\n {% endif -%}\n select \n cast(null as {{ dbt.type_string() }}) as _dbt_source_relation\n limit 0\n {%- endif -%}\n\n{%- elif var(union_database_variable, none) -%}\n\n {%- set relations = [] -%}\n\n {%- for database in var(union_database_variable) -%}\n {%- set relation=adapter.get_relation(\n database=source(schema, table_identifier).database if var('has_defined_sources', false) else database,\n schema=source(schema, table_identifier).schema if var('has_defined_sources', false) else var(schema_variable, default_schema),\n identifier=source(schema, table_identifier).identifier if var('has_defined_sources', false) else table_identifier\n ) -%}\n\n {%- set relation_exists=relation is not none -%}\n\n {%- if relation_exists -%}\n {%- do relations.append(relation) -%}\n {%- endif -%}\n\n {%- endfor -%}\n\n {%- if relations != [] -%}\n {{ dbt_utils.union_relations(relations) }}\n {%- else -%}\n {% if execute and not var('fivetran__remove_empty_table_warnings', false) -%}\n {{ exceptions.warn(\"\\n\\nPlease be aware: The \" ~ table_identifier|upper ~ \" table was not found in your \" ~ default_schema|upper ~ \" schema(s). The Fivetran dbt package will create a completely empty \" ~ table_identifier|upper ~ \" staging model as to not break downstream transformations. To turn off these warnings, set the `fivetran__remove_empty_table_warnings` variable to TRUE (see https://github.com/fivetran/dbt_fivetran_utils/tree/releases/v0.4.latest#union_data-source for details).\\n\") }}\n {% endif -%}\n select \n cast(null as {{ dbt.type_string() }}) as _dbt_source_relation\n limit 0\n {%- endif -%}\n\n{%- else -%}\n {% set exception_schemas = {\"linkedin_company_pages\": \"linkedin_pages\", \"instagram_business_pages\": \"instagram_business\"} %}\n {% set relation = namespace(value=\"\") %}\n {% if default_schema in exception_schemas.keys() %}\n {% for corrected_schema_name in exception_schemas.items() %} \n {% if default_schema in corrected_schema_name %}\n {# In order for this macro to effectively work within upstream integration tests (mainly used by the Fivetran dbt package maintainers), this identifier variable selection is required to use the macro with different identifier names. #}\n {% set identifier_var = corrected_schema_name[1] + \"_\" + table_identifier + \"_identifier\" %}\n {%- set relation.value=adapter.get_relation(\n database=source(corrected_schema_name[1], table_identifier).database,\n schema=source(corrected_schema_name[1], table_identifier).schema,\n identifier=var(identifier_var, table_identifier)\n ) -%}\n {% endif %}\n {% endfor %}\n {% else %}\n {# In order for this macro to effectively work within upstream integration tests (mainly used by the Fivetran dbt package maintainers), this identifier variable selection is required to use the macro with different identifier names. #}\n {% set identifier_var = default_schema + \"_\" + table_identifier + \"_identifier\" %}\n {# Unfortunately the Twitter Organic identifiers were misspelled. As such, we will need to account for this in the model. This will be adjusted in the Twitter Organic package, but to ensure backwards compatibility, this needs to be included. #}\n {% if var(identifier_var, none) is none %} \n {% set identifier_var = default_schema + \"_\" + table_identifier + \"_identifer\" %}\n {% endif %}\n {%- set relation.value=adapter.get_relation(\n database=source(default_schema, table_identifier).database,\n schema=source(default_schema, table_identifier).schema,\n identifier=var(identifier_var, table_identifier)\n ) -%}\n {% endif %}\n{%- set table_exists=relation.value is not none -%}\n\n{%- if table_exists -%}\n select * \n from {{ relation.value }}\n{%- else -%}\n {% if execute and not var('fivetran__remove_empty_table_warnings', false) -%}\n {{ exceptions.warn(\"\\n\\nPlease be aware: The \" ~ table_identifier|upper ~ \" table was not found in your \" ~ default_schema|upper ~ \" schema(s). The Fivetran dbt package will create a completely empty \" ~ table_identifier|upper ~ \" staging model as to not break downstream transformations. To turn off these warnings, set the `fivetran__remove_empty_table_warnings` variable to TRUE (see https://github.com/fivetran/dbt_fivetran_utils/tree/releases/v0.4.latest#union_data-source for details).\\n\") }}\n {% endif -%}\n select \n cast(null as {{ dbt.type_string() }}) as _dbt_source_relation\n limit 0\n{%- endif -%}\n{%- endif -%}\n\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt_utils.union_relations", "macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "table_identifier", "type": null, "description": ""}, {"name": "database_variable", "type": null, "description": ""}, {"name": "schema_variable", "type": null, "description": ""}, {"name": "default_database", "type": null, "description": ""}, {"name": "default_schema", "type": null, "description": ""}, {"name": "default_variable", "type": null, "description": ""}, {"name": "union_schema_variable", "type": null, "description": ""}, {"name": "union_database_variable", "type": null, "description": ""}], "created_at": 1789419970.2984629, "supported_languages": null}, "macro.fivetran_utils.pivot_json_extract": {"name": "pivot_json_extract", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/pivot_json_extract.sql", "original_file_path": "macros/pivot_json_extract.sql", "unique_id": "macro.fivetran_utils.pivot_json_extract", "macro_sql": "{% macro pivot_json_extract(string, list_of_properties) %}\n\n{%- for property in list_of_properties -%}\n{%- if property is mapping -%}\nreplace( {{ fivetran_utils.json_extract(string, property.name) }}, '\"', '') as {{ property.alias if property.alias else property.name | replace(' ', '_') | replace('.', '_') | lower }}\n\n{%- else -%}\nreplace( {{ fivetran_utils.json_extract(string, property) }}, '\"', '') as {{ property | replace(' ', '_') | lower }}\n\n{%- endif -%}\n{%- if not loop.last -%},{%- endif %}\n{% endfor -%}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.json_extract"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "string", "type": null, "description": ""}, {"name": "list_of_properties", "type": null, "description": ""}], "created_at": 1789419970.2999218, "supported_languages": null}, "macro.fivetran_utils.add_dbt_source_relation": {"name": "add_dbt_source_relation", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/add_dbt_source_relation.sql", "original_file_path": "macros/add_dbt_source_relation.sql", "unique_id": "macro.fivetran_utils.add_dbt_source_relation", "macro_sql": "{% macro add_dbt_source_relation() %}\n\n{% if var('union_schemas', none) or var('union_databases', none) %}\n, _dbt_source_relation\n{% endif %}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789419970.3004234, "supported_languages": null}, "macro.fivetran_utils.array_agg": {"name": "array_agg", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/array_agg.sql", "original_file_path": "macros/array_agg.sql", "unique_id": "macro.fivetran_utils.array_agg", "macro_sql": "{% macro array_agg(field_to_agg) -%}\n\n{{ adapter.dispatch('array_agg', 'fivetran_utils') (field_to_agg) }}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.default__array_agg"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field_to_agg", "type": null, "description": ""}], "created_at": 1789419970.3009062, "supported_languages": null}, "macro.fivetran_utils.default__array_agg": {"name": "default__array_agg", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/array_agg.sql", "original_file_path": "macros/array_agg.sql", "unique_id": "macro.fivetran_utils.default__array_agg", "macro_sql": "{% macro default__array_agg(field_to_agg) %}\n array_agg({{ field_to_agg }})\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field_to_agg", "type": null, "description": ""}], "created_at": 1789419970.3011067, "supported_languages": null}, "macro.fivetran_utils.redshift__array_agg": {"name": "redshift__array_agg", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/array_agg.sql", "original_file_path": "macros/array_agg.sql", "unique_id": "macro.fivetran_utils.redshift__array_agg", "macro_sql": "{% macro redshift__array_agg(field_to_agg) %}\n listagg({{ field_to_agg }}, ',')\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field_to_agg", "type": null, "description": ""}], "created_at": 1789419970.3012834, "supported_languages": null}, "macro.fivetran_utils.collect_freshness": {"name": "collect_freshness", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/collect_freshness.sql", "original_file_path": "macros/collect_freshness.sql", "unique_id": "macro.fivetran_utils.collect_freshness", "macro_sql": "{% macro collect_freshness(source, loaded_at_field, filter) %}\n {{ return(adapter.dispatch('collect_freshness')(source, loaded_at_field, filter))}}\n{% endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.default__collect_freshness"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "source", "type": null, "description": ""}, {"name": "loaded_at_field", "type": null, "description": ""}, {"name": "filter", "type": null, "description": ""}], "created_at": 1789419970.3021262, "supported_languages": null}, "macro.fivetran_utils.default__collect_freshness": {"name": "default__collect_freshness", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/collect_freshness.sql", "original_file_path": "macros/collect_freshness.sql", "unique_id": "macro.fivetran_utils.default__collect_freshness", "macro_sql": "{% macro default__collect_freshness(source, loaded_at_field, filter) %}\n {% call statement('collect_freshness', fetch_result=True, auto_begin=False) -%}\n\n {%- set enabled_array = [] -%}\n {% for node in graph.sources.values() %}\n {% if node.identifier == source.identifier %}\n {% if (node.meta['is_enabled'] | default(true)) %}\n {%- do enabled_array.append(1) -%}\n {% endif %}\n {% endif %}\n {% endfor %}\n {% set is_enabled = (enabled_array != []) %}\n\n select\n {% if is_enabled %}\n max({{ loaded_at_field }})\n {% else %} \n {{ current_timestamp() }} {% endif %} as max_loaded_at,\n {{ current_timestamp() }} as snapshotted_at\n\n {% if is_enabled %}\n from {{ source }}\n {% if filter %}\n where {{ filter }}\n {% endif %}\n {% endif %}\n\n {% endcall %}\n\n {% if dbt_version.split('.') | map('int') | list >= [1, 5, 0] %}\n {{ return(load_result('collect_freshness')) }}\n {% else %}\n {{ return(load_result('collect_freshness').table) }}\n {% endif %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement", "macro.dbt.current_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "source", "type": null, "description": ""}, {"name": "loaded_at_field", "type": null, "description": ""}, {"name": "filter", "type": null, "description": ""}], "created_at": 1789419970.3042202, "supported_languages": null}, "macro.fivetran_utils.first_value": {"name": "first_value", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/first_value.sql", "original_file_path": "macros/first_value.sql", "unique_id": "macro.fivetran_utils.first_value", "macro_sql": "{% macro first_value(first_value_field, partition_field, order_by_field, order=\"asc\") -%}\n\n{{ adapter.dispatch('first_value', 'fivetran_utils') (first_value_field, partition_field, order_by_field, order) }}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.default__first_value"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "first_value_field", "type": null, "description": ""}, {"name": "partition_field", "type": null, "description": ""}, {"name": "order_by_field", "type": null, "description": ""}, {"name": "order", "type": null, "description": ""}], "created_at": 1789419970.3049972, "supported_languages": null}, "macro.fivetran_utils.default__first_value": {"name": "default__first_value", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/first_value.sql", "original_file_path": "macros/first_value.sql", "unique_id": "macro.fivetran_utils.default__first_value", "macro_sql": "{% macro default__first_value(first_value_field, partition_field, order_by_field, order=\"asc\") %}\n\n first_value( {{ first_value_field }} ignore nulls ) over (partition by {{ partition_field }} order by {{ order_by_field }} {{ order }} )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "first_value_field", "type": null, "description": ""}, {"name": "partition_field", "type": null, "description": ""}, {"name": "order_by_field", "type": null, "description": ""}, {"name": "order", "type": null, "description": ""}], "created_at": 1789419970.3053699, "supported_languages": null}, "macro.fivetran_utils.redshift__first_value": {"name": "redshift__first_value", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/first_value.sql", "original_file_path": "macros/first_value.sql", "unique_id": "macro.fivetran_utils.redshift__first_value", "macro_sql": "{% macro redshift__first_value(first_value_field, partition_field, order_by_field, order=\"asc\") %}\n\n first_value( {{ first_value_field }} ignore nulls ) over (partition by {{ partition_field }} order by {{ order_by_field }} {{ order }} , {{ partition_field }} rows unbounded preceding )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "first_value_field", "type": null, "description": ""}, {"name": "partition_field", "type": null, "description": ""}, {"name": "order_by_field", "type": null, "description": ""}, {"name": "order", "type": null, "description": ""}], "created_at": 1789419970.3057737, "supported_languages": null}, "macro.fivetran_utils.union_relations": {"name": "union_relations", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/union_relations.sql", "original_file_path": "macros/union_relations.sql", "unique_id": "macro.fivetran_utils.union_relations", "macro_sql": "{%- macro union_relations(relations, aliases=none, column_override=none, include=[], exclude=[], source_column_name=none) -%}\n\n {%- if exclude and include -%}\n {{ exceptions.raise_compiler_error(\"Both an exclude and include list were provided to the `union` macro. Only one is allowed\") }}\n {%- endif -%}\n\n {#-- Prevent querying of db in parsing mode. This works because this macro does not create any new refs. -#}\n {%- if not execute %}\n {{ return('') }}\n {% endif -%}\n\n {%- set column_override = column_override if column_override is not none else {} -%}\n {%- set source_column_name = source_column_name if source_column_name is not none else '_dbt_source_relation' -%}\n\n {%- set relation_columns = {} -%}\n {%- set column_superset = {} -%}\n\n {%- for relation in relations -%}\n\n {%- do relation_columns.update({relation: []}) -%}\n\n {%- do dbt_utils._is_relation(relation, 'union_relations') -%}\n {%- set cols = adapter.get_columns_in_relation(relation) -%}\n {%- for col in cols -%}\n\n {#- If an exclude list was provided and the column is in the list, do nothing -#}\n {%- if exclude and col.column in exclude -%}\n\n {#- If an include list was provided and the column is not in the list, do nothing -#}\n {%- elif include and col.column not in include -%}\n\n {#- Otherwise add the column to the column superset -#}\n {%- else -%}\n\n {#- update the list of columns in this relation -#}\n {%- do relation_columns[relation].append(col.column) -%}\n\n {%- if col.column in column_superset -%}\n\n {%- set stored = column_superset[col.column] -%}\n {%- if col.is_string() and stored.is_string() and col.string_size() > stored.string_size() -%}\n\n {%- do column_superset.update({col.column: col}) -%}\n\n {%- endif %}\n\n {%- else -%}\n\n {%- do column_superset.update({col.column: col}) -%}\n\n {%- endif -%}\n\n {%- endif -%}\n\n {%- endfor -%}\n {%- endfor -%}\n\n {%- set ordered_column_names = column_superset.keys() -%}\n\n {%- for relation in relations %}\n\n (\n select\n\n cast({{ dbt.string_literal(relation) }} as {{ dbt.type_string() }}) as {{ source_column_name }},\n {% for col_name in ordered_column_names -%}\n\n {%- set col = column_superset[col_name] %}\n {%- set col_type = column_override.get(col.column, col.data_type) %}\n {%- set col_name = adapter.quote(col_name) if col_name in relation_columns[relation] else 'null' %}\n cast({{ col_name }} as {{ col_type }}) as {{ col.quoted }} {% if not loop.last %},{% endif -%}\n\n {%- endfor %}\n\n from {{ aliases[loop.index0] if aliases else relation }}\n )\n\n {% if not loop.last -%}\n union all\n {% endif -%}\n\n {%- endfor -%}\n\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt_utils._is_relation", "macro.dbt.string_literal", "macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relations", "type": null, "description": ""}, {"name": "aliases", "type": null, "description": ""}, {"name": "column_override", "type": null, "description": ""}, {"name": "include", "type": null, "description": ""}, {"name": "exclude", "type": null, "description": ""}, {"name": "source_column_name", "type": null, "description": ""}], "created_at": 1789419970.3109229, "supported_languages": null}, "macro.fivetran_utils.union_tables": {"name": "union_tables", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/union_relations.sql", "original_file_path": "macros/union_relations.sql", "unique_id": "macro.fivetran_utils.union_tables", "macro_sql": "{%- macro union_tables(tables, column_override=none, include=[], exclude=[], source_column_name='_dbt_source_table') -%}\n\n {%- do exceptions.warn(\"Warning: the `union_tables` macro is no longer supported and will be deprecated in a future release of dbt-utils. Use the `union_relations` macro instead\") -%}\n\n {{ return(dbt_utils.union_relations(tables, column_override, include, exclude, source_column_name)) }}\n\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt_utils.union_relations"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "tables", "type": null, "description": ""}, {"name": "column_override", "type": null, "description": ""}, {"name": "include", "type": null, "description": ""}, {"name": "exclude", "type": null, "description": ""}, {"name": "source_column_name", "type": null, "description": ""}], "created_at": 1789419970.3116043, "supported_languages": null}, "macro.fivetran_utils.timestamp_diff": {"name": "timestamp_diff", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/timestamp_diff.sql", "original_file_path": "macros/timestamp_diff.sql", "unique_id": "macro.fivetran_utils.timestamp_diff", "macro_sql": "{% macro timestamp_diff(first_date, second_date, datepart) %}\n {{ adapter.dispatch('timestamp_diff', 'fivetran_utils')(first_date, second_date, datepart) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.postgres__timestamp_diff"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "first_date", "type": null, "description": ""}, {"name": "second_date", "type": null, "description": ""}, {"name": "datepart", "type": null, "description": ""}], "created_at": 1789419970.313058, "supported_languages": null}, "macro.fivetran_utils.default__timestamp_diff": {"name": "default__timestamp_diff", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/timestamp_diff.sql", "original_file_path": "macros/timestamp_diff.sql", "unique_id": "macro.fivetran_utils.default__timestamp_diff", "macro_sql": "{% macro default__timestamp_diff(first_date, second_date, datepart) %}\n\n datediff(\n {{ datepart }},\n {{ first_date }},\n {{ second_date }}\n )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "first_date", "type": null, "description": ""}, {"name": "second_date", "type": null, "description": ""}, {"name": "datepart", "type": null, "description": ""}], "created_at": 1789419970.3133752, "supported_languages": null}, "macro.fivetran_utils.redshift__timestamp_diff": {"name": "redshift__timestamp_diff", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/timestamp_diff.sql", "original_file_path": "macros/timestamp_diff.sql", "unique_id": "macro.fivetran_utils.redshift__timestamp_diff", "macro_sql": "{% macro redshift__timestamp_diff(first_date, second_date, datepart) %}\n\n datediff(\n {{ datepart }},\n {{ first_date }},\n {{ second_date }}\n )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "first_date", "type": null, "description": ""}, {"name": "second_date", "type": null, "description": ""}, {"name": "datepart", "type": null, "description": ""}], "created_at": 1789419970.3136637, "supported_languages": null}, "macro.fivetran_utils.bigquery__timestamp_diff": {"name": "bigquery__timestamp_diff", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/timestamp_diff.sql", "original_file_path": "macros/timestamp_diff.sql", "unique_id": "macro.fivetran_utils.bigquery__timestamp_diff", "macro_sql": "{% macro bigquery__timestamp_diff(first_date, second_date, datepart) %}\n\n timestamp_diff(\n {{second_date}},\n {{first_date}},\n {{datepart}}\n )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "first_date", "type": null, "description": ""}, {"name": "second_date", "type": null, "description": ""}, {"name": "datepart", "type": null, "description": ""}], "created_at": 1789419970.3139544, "supported_languages": null}, "macro.fivetran_utils.postgres__timestamp_diff": {"name": "postgres__timestamp_diff", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/timestamp_diff.sql", "original_file_path": "macros/timestamp_diff.sql", "unique_id": "macro.fivetran_utils.postgres__timestamp_diff", "macro_sql": "{% macro postgres__timestamp_diff(first_date, second_date, datepart) %}\n\n {% if datepart == 'year' %}\n (date_part('year', ({{second_date}})::date) - date_part('year', ({{first_date}})::date))\n {% elif datepart == 'quarter' %}\n ({{ dbt.datediff(first_date, second_date, 'year') }} * 4 + date_part('quarter', ({{second_date}})::date) - date_part('quarter', ({{first_date}})::date))\n {% elif datepart == 'month' %}\n ({{ dbt.datediff(first_date, second_date, 'year') }} * 12 + date_part('month', ({{second_date}})::date) - date_part('month', ({{first_date}})::date))\n {% elif datepart == 'day' %}\n (({{second_date}})::date - ({{first_date}})::date)\n {% elif datepart == 'week' %}\n ({{ dbt.datediff(first_date, second_date, 'day') }} / 7 + case\n when date_part('dow', ({{first_date}})::timestamp) <= date_part('dow', ({{second_date}})::timestamp) then\n case when {{first_date}} <= {{second_date}} then 0 else -1 end\n else\n case when {{first_date}} <= {{second_date}} then 1 else 0 end\n end)\n {% elif datepart == 'hour' %}\n ({{ dbt.datediff(first_date, second_date, 'day') }} * 24 + date_part('hour', ({{second_date}})::timestamp) - date_part('hour', ({{first_date}})::timestamp))\n {% elif datepart == 'minute' %}\n ({{ dbt.datediff(first_date, second_date, 'hour') }} * 60 + date_part('minute', ({{second_date}})::timestamp) - date_part('minute', ({{first_date}})::timestamp))\n {% elif datepart == 'second' %}\n ({{ dbt.datediff(first_date, second_date, 'minute') }} * 60 + floor(date_part('second', ({{second_date}})::timestamp)) - floor(date_part('second', ({{first_date}})::timestamp)))\n {% elif datepart == 'millisecond' %}\n ({{ dbt.datediff(first_date, second_date, 'minute') }} * 60000 + floor(date_part('millisecond', ({{second_date}})::timestamp)) - floor(date_part('millisecond', ({{first_date}})::timestamp)))\n {% elif datepart == 'microsecond' %}\n ({{ dbt.datediff(first_date, second_date, 'minute') }} * 60000000 + floor(date_part('microsecond', ({{second_date}})::timestamp)) - floor(date_part('microsecond', ({{first_date}})::timestamp)))\n {% else %}\n {{ exceptions.raise_compiler_error(\"Unsupported datepart for macro datediff in postgres: {!r}\".format(datepart)) }}\n {% endif %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.datediff"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "first_date", "type": null, "description": ""}, {"name": "second_date", "type": null, "description": ""}, {"name": "datepart", "type": null, "description": ""}], "created_at": 1789419970.3168256, "supported_languages": null}, "macro.fivetran_utils.duckdb__timestamp_diff": {"name": "duckdb__timestamp_diff", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/timestamp_diff.sql", "original_file_path": "macros/timestamp_diff.sql", "unique_id": "macro.fivetran_utils.duckdb__timestamp_diff", "macro_sql": "{% macro duckdb__timestamp_diff(first_date, second_date, datepart) %}\n\n datediff('{{ datepart }}', {{ first_date }}, {{ second_date }})\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "first_date", "type": null, "description": ""}, {"name": "second_date", "type": null, "description": ""}, {"name": "datepart", "type": null, "description": ""}], "created_at": 1789419970.3171628, "supported_languages": null}, "macro.fivetran_utils.add_pass_through_columns": {"name": "add_pass_through_columns", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/add_pass_through_columns.sql", "original_file_path": "macros/add_pass_through_columns.sql", "unique_id": "macro.fivetran_utils.add_pass_through_columns", "macro_sql": "{% macro add_pass_through_columns(base_columns, pass_through_var) %}\n\n {% if pass_through_var %}\n\n {% for column in pass_through_var %}\n\n {% if column is mapping %}\n\n {% if column.alias %}\n\n {% do base_columns.append({ \"name\": column.name, \"alias\": column.alias, \"datatype\": column.datatype if column.datatype else dbt.type_string()}) %}\n\n {% else %}\n\n {% do base_columns.append({ \"name\": column.name, \"datatype\": column.datatype if column.datatype else dbt.type_string()}) %}\n \n {% endif %}\n\n {% else %}\n\n {% do base_columns.append({ \"name\": column, \"datatype\": dbt.type_string()}) %}\n\n {% endif %}\n\n {% endfor %}\n\n {% endif %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "base_columns", "type": null, "description": ""}, {"name": "pass_through_var", "type": null, "description": ""}], "created_at": 1789419970.3189714, "supported_languages": null}, "macro.fivetran_utils.timestamp_add": {"name": "timestamp_add", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/timestamp_add.sql", "original_file_path": "macros/timestamp_add.sql", "unique_id": "macro.fivetran_utils.timestamp_add", "macro_sql": "{% macro timestamp_add(datepart, interval, from_timestamp) -%}\n\n{{ adapter.dispatch('timestamp_add', 'fivetran_utils') (datepart, interval, from_timestamp) }}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.postgres__timestamp_add"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "datepart", "type": null, "description": ""}, {"name": "interval", "type": null, "description": ""}, {"name": "from_timestamp", "type": null, "description": ""}], "created_at": 1789419970.3197963, "supported_languages": null}, "macro.fivetran_utils.default__timestamp_add": {"name": "default__timestamp_add", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/timestamp_add.sql", "original_file_path": "macros/timestamp_add.sql", "unique_id": "macro.fivetran_utils.default__timestamp_add", "macro_sql": "{% macro default__timestamp_add(datepart, interval, from_timestamp) %}\n\n timestampadd(\n {{ datepart }},\n {{ interval }},\n {{ from_timestamp }}\n )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "datepart", "type": null, "description": ""}, {"name": "interval", "type": null, "description": ""}, {"name": "from_timestamp", "type": null, "description": ""}], "created_at": 1789419970.320093, "supported_languages": null}, "macro.fivetran_utils.bigquery__timestamp_add": {"name": "bigquery__timestamp_add", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/timestamp_add.sql", "original_file_path": "macros/timestamp_add.sql", "unique_id": "macro.fivetran_utils.bigquery__timestamp_add", "macro_sql": "{% macro bigquery__timestamp_add(datepart, interval, from_timestamp) %}\n\n timestamp_add({{ from_timestamp }}, interval {{ interval }} {{ datepart }})\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "datepart", "type": null, "description": ""}, {"name": "interval", "type": null, "description": ""}, {"name": "from_timestamp", "type": null, "description": ""}], "created_at": 1789419970.3203657, "supported_languages": null}, "macro.fivetran_utils.redshift__timestamp_add": {"name": "redshift__timestamp_add", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/timestamp_add.sql", "original_file_path": "macros/timestamp_add.sql", "unique_id": "macro.fivetran_utils.redshift__timestamp_add", "macro_sql": "{% macro redshift__timestamp_add(datepart, interval, from_timestamp) %}\n\n dateadd(\n {{ datepart }},\n {{ interval }},\n {{ from_timestamp }}\n )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "datepart", "type": null, "description": ""}, {"name": "interval", "type": null, "description": ""}, {"name": "from_timestamp", "type": null, "description": ""}], "created_at": 1789419970.3206377, "supported_languages": null}, "macro.fivetran_utils.postgres__timestamp_add": {"name": "postgres__timestamp_add", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/timestamp_add.sql", "original_file_path": "macros/timestamp_add.sql", "unique_id": "macro.fivetran_utils.postgres__timestamp_add", "macro_sql": "{% macro postgres__timestamp_add(datepart, interval, from_timestamp) %}\n\n {{ from_timestamp }} + ((interval '1 {{ datepart }}') * ({{ interval }}))\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "datepart", "type": null, "description": ""}, {"name": "interval", "type": null, "description": ""}, {"name": "from_timestamp", "type": null, "description": ""}], "created_at": 1789419970.3209527, "supported_languages": null}, "macro.fivetran_utils.spark__timestamp_add": {"name": "spark__timestamp_add", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/timestamp_add.sql", "original_file_path": "macros/timestamp_add.sql", "unique_id": "macro.fivetran_utils.spark__timestamp_add", "macro_sql": "{% macro spark__timestamp_add(datepart, interval, from_timestamp) %}\n\n {{ dbt.dateadd(datepart, interval, from_timestamp) }}\n \n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.dateadd"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "datepart", "type": null, "description": ""}, {"name": "interval", "type": null, "description": ""}, {"name": "from_timestamp", "type": null, "description": ""}], "created_at": 1789419970.3212624, "supported_languages": null}, "macro.fivetran_utils.duckdb__timestamp_add": {"name": "duckdb__timestamp_add", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/timestamp_add.sql", "original_file_path": "macros/timestamp_add.sql", "unique_id": "macro.fivetran_utils.duckdb__timestamp_add", "macro_sql": "{% macro duckdb__timestamp_add(datepart, interval, from_timestamp) %}\n\n {{ from_timestamp }} + ((interval '1 {{ datepart }}') * ({{ interval }}))\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "datepart", "type": null, "description": ""}, {"name": "interval", "type": null, "description": ""}, {"name": "from_timestamp", "type": null, "description": ""}], "created_at": 1789419970.3216758, "supported_languages": null}, "macro.fivetran_utils.enabled_vars": {"name": "enabled_vars", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/enabled_vars.sql", "original_file_path": "macros/enabled_vars.sql", "unique_id": "macro.fivetran_utils.enabled_vars", "macro_sql": "{% macro enabled_vars(vars) %}\n\n{% for v in vars %}\n \n {% if var(v, True) == False %}\n {{ return(False) }}\n {% endif %}\n\n{% endfor %}\n\n{{ return(True) }}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "vars", "type": null, "description": ""}], "created_at": 1789419970.3223777, "supported_languages": null}, "macro.fivetran_utils.wrap_in_quotes": {"name": "wrap_in_quotes", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/wrap_in_quotes.sql", "original_file_path": "macros/wrap_in_quotes.sql", "unique_id": "macro.fivetran_utils.wrap_in_quotes", "macro_sql": "{%- macro wrap_in_quotes(object_to_quote) -%}\n\n{{ return(adapter.dispatch('wrap_in_quotes', 'fivetran_utils')(object_to_quote)) }}\n\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.fivetran_utils.postgres__wrap_in_quotes"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "object_to_quote", "type": null, "description": ""}], "created_at": 1789419970.3230097, "supported_languages": null}, "macro.fivetran_utils.default__wrap_in_quotes": {"name": "default__wrap_in_quotes", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/wrap_in_quotes.sql", "original_file_path": "macros/wrap_in_quotes.sql", "unique_id": "macro.fivetran_utils.default__wrap_in_quotes", "macro_sql": "{%- macro default__wrap_in_quotes(object_to_quote) -%}\n{# bigquery, spark, databricks #}\n `{{ object_to_quote }}`\n{%- endmacro -%}\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "object_to_quote", "type": null, "description": ""}], "created_at": 1789419970.323213, "supported_languages": null}, "macro.fivetran_utils.snowflake__wrap_in_quotes": {"name": "snowflake__wrap_in_quotes", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/wrap_in_quotes.sql", "original_file_path": "macros/wrap_in_quotes.sql", "unique_id": "macro.fivetran_utils.snowflake__wrap_in_quotes", "macro_sql": "{%- macro snowflake__wrap_in_quotes(object_to_quote) -%}\n \"{{ object_to_quote | upper }}\"\n{%- endmacro -%}\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "object_to_quote", "type": null, "description": ""}], "created_at": 1789419970.323412, "supported_languages": null}, "macro.fivetran_utils.redshift__wrap_in_quotes": {"name": "redshift__wrap_in_quotes", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/wrap_in_quotes.sql", "original_file_path": "macros/wrap_in_quotes.sql", "unique_id": "macro.fivetran_utils.redshift__wrap_in_quotes", "macro_sql": "{%- macro redshift__wrap_in_quotes(object_to_quote) -%}\n \"{{ object_to_quote }}\"\n{%- endmacro -%}\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "object_to_quote", "type": null, "description": ""}], "created_at": 1789419970.3235865, "supported_languages": null}, "macro.fivetran_utils.postgres__wrap_in_quotes": {"name": "postgres__wrap_in_quotes", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/wrap_in_quotes.sql", "original_file_path": "macros/wrap_in_quotes.sql", "unique_id": "macro.fivetran_utils.postgres__wrap_in_quotes", "macro_sql": "{%- macro postgres__wrap_in_quotes(object_to_quote) -%}\n \"{{ object_to_quote }}\"\n{%- endmacro -%}\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "object_to_quote", "type": null, "description": ""}], "created_at": 1789419970.323777, "supported_languages": null}, "macro.fivetran_utils.duckdb__wrap_in_quotes": {"name": "duckdb__wrap_in_quotes", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/wrap_in_quotes.sql", "original_file_path": "macros/wrap_in_quotes.sql", "unique_id": "macro.fivetran_utils.duckdb__wrap_in_quotes", "macro_sql": "{%- macro duckdb__wrap_in_quotes(object_to_quote) -%}\n \"{{ object_to_quote }}\"\n{%- endmacro -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "object_to_quote", "type": null, "description": ""}], "created_at": 1789419970.323951, "supported_languages": null}, "macro.fivetran_utils.json_extract": {"name": "json_extract", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/json_extract.sql", "original_file_path": "macros/json_extract.sql", "unique_id": "macro.fivetran_utils.json_extract", "macro_sql": "{% macro json_extract(string, string_path) -%}\n\n{{ adapter.dispatch('json_extract', 'fivetran_utils') (string, string_path) }}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.postgres__json_extract"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "string", "type": null, "description": ""}, {"name": "string_path", "type": null, "description": ""}], "created_at": 1789419970.3246508, "supported_languages": null}, "macro.fivetran_utils.default__json_extract": {"name": "default__json_extract", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/json_extract.sql", "original_file_path": "macros/json_extract.sql", "unique_id": "macro.fivetran_utils.default__json_extract", "macro_sql": "{% macro default__json_extract(string, string_path) %}\n\n json_extract_path_text({{string}}, {{ \"'\" ~ string_path ~ \"'\" }} )\n \n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "string", "type": null, "description": ""}, {"name": "string_path", "type": null, "description": ""}], "created_at": 1789419970.324972, "supported_languages": null}, "macro.fivetran_utils.snowflake__json_extract": {"name": "snowflake__json_extract", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/json_extract.sql", "original_file_path": "macros/json_extract.sql", "unique_id": "macro.fivetran_utils.snowflake__json_extract", "macro_sql": "{% macro snowflake__json_extract(string, string_path) %}\n\n json_extract_path_text(try_parse_json( {{string}} ), {{ \"'\" ~ string_path ~ \"'\" }} )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "string", "type": null, "description": ""}, {"name": "string_path", "type": null, "description": ""}], "created_at": 1789419970.3252537, "supported_languages": null}, "macro.fivetran_utils.redshift__json_extract": {"name": "redshift__json_extract", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/json_extract.sql", "original_file_path": "macros/json_extract.sql", "unique_id": "macro.fivetran_utils.redshift__json_extract", "macro_sql": "{% macro redshift__json_extract(string, string_path) %}\n\n case when is_valid_json( {{string}} ) then json_extract_path_text({{string}}, {{ \"'\" ~ string_path ~ \"'\" }} ) else null end\n \n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "string", "type": null, "description": ""}, {"name": "string_path", "type": null, "description": ""}], "created_at": 1789419970.3255424, "supported_languages": null}, "macro.fivetran_utils.bigquery__json_extract": {"name": "bigquery__json_extract", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/json_extract.sql", "original_file_path": "macros/json_extract.sql", "unique_id": "macro.fivetran_utils.bigquery__json_extract", "macro_sql": "{% macro bigquery__json_extract(string, string_path) %}\n\n json_extract_scalar({{string}}, {{ \"'$.\" ~ string_path ~ \"'\" }} )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "string", "type": null, "description": ""}, {"name": "string_path", "type": null, "description": ""}], "created_at": 1789419970.3258178, "supported_languages": null}, "macro.fivetran_utils.postgres__json_extract": {"name": "postgres__json_extract", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/json_extract.sql", "original_file_path": "macros/json_extract.sql", "unique_id": "macro.fivetran_utils.postgres__json_extract", "macro_sql": "{% macro postgres__json_extract(string, string_path) %}\n\n {{string}}::json->>{{\"'\" ~ string_path ~ \"'\" }}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "string", "type": null, "description": ""}, {"name": "string_path", "type": null, "description": ""}], "created_at": 1789419970.3260827, "supported_languages": null}, "macro.fivetran_utils.extract_url_parameter": {"name": "extract_url_parameter", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/extract_url_parameter.sql", "original_file_path": "macros/extract_url_parameter.sql", "unique_id": "macro.fivetran_utils.extract_url_parameter", "macro_sql": "{% macro extract_url_parameter(field, url_parameter) -%}\n\n{{ adapter.dispatch('extract_url_parameter', 'fivetran_utils') (field, url_parameter) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.default__extract_url_parameter"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field", "type": null, "description": ""}, {"name": "url_parameter", "type": null, "description": ""}], "created_at": 1789419970.3266187, "supported_languages": null}, "macro.fivetran_utils.default__extract_url_parameter": {"name": "default__extract_url_parameter", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/extract_url_parameter.sql", "original_file_path": "macros/extract_url_parameter.sql", "unique_id": "macro.fivetran_utils.default__extract_url_parameter", "macro_sql": "{% macro default__extract_url_parameter(field, url_parameter) -%}\n\n{{ dbt_utils.get_url_parameter(field, url_parameter) }}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.get_url_parameter"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field", "type": null, "description": ""}, {"name": "url_parameter", "type": null, "description": ""}], "created_at": 1789419970.3270378, "supported_languages": null}, "macro.fivetran_utils.spark__extract_url_parameter": {"name": "spark__extract_url_parameter", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/extract_url_parameter.sql", "original_file_path": "macros/extract_url_parameter.sql", "unique_id": "macro.fivetran_utils.spark__extract_url_parameter", "macro_sql": "{% macro spark__extract_url_parameter(field, url_parameter) -%}\n\n{%- set formatted_url_parameter = \"'\" + url_parameter + \"=([^&]+)'\" -%}\nnullif(regexp_extract({{ field }}, {{ formatted_url_parameter }}, 1), '')\n\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field", "type": null, "description": ""}, {"name": "url_parameter", "type": null, "description": ""}], "created_at": 1789419970.3273969, "supported_languages": null}, "macro.fivetran_utils.string_agg": {"name": "string_agg", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/string_agg.sql", "original_file_path": "macros/string_agg.sql", "unique_id": "macro.fivetran_utils.string_agg", "macro_sql": "{% macro string_agg(field_to_agg, delimiter) -%}\n\n{{ adapter.dispatch('string_agg', 'fivetran_utils') (field_to_agg, delimiter) }}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.default__string_agg"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field_to_agg", "type": null, "description": ""}, {"name": "delimiter", "type": null, "description": ""}], "created_at": 1789419970.3279977, "supported_languages": null}, "macro.fivetran_utils.default__string_agg": {"name": "default__string_agg", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/string_agg.sql", "original_file_path": "macros/string_agg.sql", "unique_id": "macro.fivetran_utils.default__string_agg", "macro_sql": "{% macro default__string_agg(field_to_agg, delimiter) %}\n string_agg({{ field_to_agg }}, {{ delimiter }})\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field_to_agg", "type": null, "description": ""}, {"name": "delimiter", "type": null, "description": ""}], "created_at": 1789419970.3282316, "supported_languages": null}, "macro.fivetran_utils.snowflake__string_agg": {"name": "snowflake__string_agg", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/string_agg.sql", "original_file_path": "macros/string_agg.sql", "unique_id": "macro.fivetran_utils.snowflake__string_agg", "macro_sql": "{% macro snowflake__string_agg(field_to_agg, delimiter) %}\n listagg({{ field_to_agg }}, {{ delimiter }})\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field_to_agg", "type": null, "description": ""}, {"name": "delimiter", "type": null, "description": ""}], "created_at": 1789419970.3284545, "supported_languages": null}, "macro.fivetran_utils.redshift__string_agg": {"name": "redshift__string_agg", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/string_agg.sql", "original_file_path": "macros/string_agg.sql", "unique_id": "macro.fivetran_utils.redshift__string_agg", "macro_sql": "{% macro redshift__string_agg(field_to_agg, delimiter) %}\n listagg({{ field_to_agg }}, {{ delimiter }})\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field_to_agg", "type": null, "description": ""}, {"name": "delimiter", "type": null, "description": ""}], "created_at": 1789419970.32868, "supported_languages": null}, "macro.fivetran_utils.spark__string_agg": {"name": "spark__string_agg", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/string_agg.sql", "original_file_path": "macros/string_agg.sql", "unique_id": "macro.fivetran_utils.spark__string_agg", "macro_sql": "{% macro spark__string_agg(field_to_agg, delimiter) %}\n -- collect set will remove duplicates\n replace(replace(replace(cast( collect_set({{ field_to_agg }}) as string), '[', ''), ']', ''), ', ', {{ delimiter }} )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field_to_agg", "type": null, "description": ""}, {"name": "delimiter", "type": null, "description": ""}], "created_at": 1789419970.3289607, "supported_languages": null}, "macro.fivetran_utils.max_bool": {"name": "max_bool", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/max_bool.sql", "original_file_path": "macros/max_bool.sql", "unique_id": "macro.fivetran_utils.max_bool", "macro_sql": "{% macro max_bool(boolean_field) -%}\n\n{{ adapter.dispatch('max_bool', 'fivetran_utils') (boolean_field) }}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.default__max_bool"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "boolean_field", "type": null, "description": ""}], "created_at": 1789419970.3294427, "supported_languages": null}, "macro.fivetran_utils.default__max_bool": {"name": "default__max_bool", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/max_bool.sql", "original_file_path": "macros/max_bool.sql", "unique_id": "macro.fivetran_utils.default__max_bool", "macro_sql": "{% macro default__max_bool(boolean_field) %}\n\n bool_or( {{ boolean_field }} )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "boolean_field", "type": null, "description": ""}], "created_at": 1789419970.3296287, "supported_languages": null}, "macro.fivetran_utils.snowflake__max_bool": {"name": "snowflake__max_bool", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/max_bool.sql", "original_file_path": "macros/max_bool.sql", "unique_id": "macro.fivetran_utils.snowflake__max_bool", "macro_sql": "{% macro snowflake__max_bool(boolean_field) %}\n\n max( {{ boolean_field }} )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "boolean_field", "type": null, "description": ""}], "created_at": 1789419970.329817, "supported_languages": null}, "macro.fivetran_utils.bigquery__max_bool": {"name": "bigquery__max_bool", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/max_bool.sql", "original_file_path": "macros/max_bool.sql", "unique_id": "macro.fivetran_utils.bigquery__max_bool", "macro_sql": "{% macro bigquery__max_bool(boolean_field) %}\n\n max( {{ boolean_field }} )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "boolean_field", "type": null, "description": ""}], "created_at": 1789419970.329993, "supported_languages": null}, "macro.fivetran_utils.empty_variable_warning": {"name": "empty_variable_warning", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/empty_variable_warning.sql", "original_file_path": "macros/empty_variable_warning.sql", "unique_id": "macro.fivetran_utils.empty_variable_warning", "macro_sql": "{% macro empty_variable_warning(variable, downstream_model) %}\n\n{% if not var(variable) %}\n{{ log(\n \"\"\"\n Warning: You have passed an empty list to the \"\"\" ~ variable ~ \"\"\".\n As a result, you won't see the history of any columns in the \"\"\" ~ downstream_model ~ \"\"\" model.\n \"\"\",\n info=True\n) }}\n{% endif %}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "variable", "type": null, "description": ""}, {"name": "downstream_model", "type": null, "description": ""}], "created_at": 1789419970.3306928, "supported_languages": null}, "macro.fivetran_utils.dummy_coalesce_value": {"name": "dummy_coalesce_value", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/dummy_coalesce_value.sql", "original_file_path": "macros/dummy_coalesce_value.sql", "unique_id": "macro.fivetran_utils.dummy_coalesce_value", "macro_sql": "{% macro dummy_coalesce_value(column) %}\n\n{% set coalesce_value = {\n 'STRING': \"'DUMMY_STRING'\",\n 'BOOLEAN': 'null',\n 'INT': 999999999,\n 'FLOAT': 999999999.99,\n 'TIMESTAMP': 'cast(\"2099-12-31\" as timestamp)',\n 'DATE': 'cast(\"2099-12-31\" as date)',\n} %}\n\n{% if column.is_float() %}\n{{ return(coalesce_value['FLOAT']) }}\n\n{% elif column.is_numeric() %}\n{{ return(coalesce_value['INT']) }}\n\n{% elif column.is_string() %}\n{{ return(coalesce_value['STRING']) }}\n\n{% elif column.data_type|lower == 'boolean' %}\n{{ return(coalesce_value['BOOLEAN']) }}\n\n{% elif 'timestamp' in column.data_type|lower %}\n{{ return(coalesce_value['TIMESTAMP']) }}\n\n{% elif 'date' in column.data_type|lower %}\n{{ return(coalesce_value['DATE']) }}\n\n{% elif 'int' in column.data_type|lower %}\n{{ return(coalesce_value['INT']) }}\n\n{% endif %}\n\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "column", "type": null, "description": ""}], "created_at": 1789419970.3331523, "supported_languages": null}, "macro.fivetran_utils.percentile": {"name": "percentile", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/percentile.sql", "original_file_path": "macros/percentile.sql", "unique_id": "macro.fivetran_utils.percentile", "macro_sql": "{% macro percentile(percentile_field, partition_field, percent) -%}\n\n{{ adapter.dispatch('percentile', 'fivetran_utils') (percentile_field, partition_field, percent) }}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.postgres__percentile"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "percentile_field", "type": null, "description": ""}, {"name": "partition_field", "type": null, "description": ""}, {"name": "percent", "type": null, "description": ""}], "created_at": 1789419970.3339937, "supported_languages": null}, "macro.fivetran_utils.default__percentile": {"name": "default__percentile", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/percentile.sql", "original_file_path": "macros/percentile.sql", "unique_id": "macro.fivetran_utils.default__percentile", "macro_sql": "{% macro default__percentile(percentile_field, partition_field, percent) %}\n\n percentile_cont( \n {{ percent }} )\n within group ( order by {{ percentile_field }} )\n over ( partition by {{ partition_field }} )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "percentile_field", "type": null, "description": ""}, {"name": "partition_field", "type": null, "description": ""}, {"name": "percent", "type": null, "description": ""}], "created_at": 1789419970.3342988, "supported_languages": null}, "macro.fivetran_utils.redshift__percentile": {"name": "redshift__percentile", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/percentile.sql", "original_file_path": "macros/percentile.sql", "unique_id": "macro.fivetran_utils.redshift__percentile", "macro_sql": "{% macro redshift__percentile(percentile_field, partition_field, percent) %}\n\n percentile_cont( \n {{ percent }} )\n within group ( order by {{ percentile_field }} )\n over ( partition by {{ partition_field }} )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "percentile_field", "type": null, "description": ""}, {"name": "partition_field", "type": null, "description": ""}, {"name": "percent", "type": null, "description": ""}], "created_at": 1789419970.3345826, "supported_languages": null}, "macro.fivetran_utils.bigquery__percentile": {"name": "bigquery__percentile", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/percentile.sql", "original_file_path": "macros/percentile.sql", "unique_id": "macro.fivetran_utils.bigquery__percentile", "macro_sql": "{% macro bigquery__percentile(percentile_field, partition_field, percent) %}\n\n percentile_cont( \n {{ percentile_field }}, \n {{ percent }}) \n over (partition by {{ partition_field }} \n )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "percentile_field", "type": null, "description": ""}, {"name": "partition_field", "type": null, "description": ""}, {"name": "percent", "type": null, "description": ""}], "created_at": 1789419970.3348994, "supported_languages": null}, "macro.fivetran_utils.postgres__percentile": {"name": "postgres__percentile", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/percentile.sql", "original_file_path": "macros/percentile.sql", "unique_id": "macro.fivetran_utils.postgres__percentile", "macro_sql": "{% macro postgres__percentile(percentile_field, partition_field, percent) %}\n\n percentile_cont( \n {{ percent }} )\n within group ( order by {{ percentile_field }} )\n /* have to group by partition field */\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "percentile_field", "type": null, "description": ""}, {"name": "partition_field", "type": null, "description": ""}, {"name": "percent", "type": null, "description": ""}], "created_at": 1789419970.33516, "supported_languages": null}, "macro.fivetran_utils.spark__percentile": {"name": "spark__percentile", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/percentile.sql", "original_file_path": "macros/percentile.sql", "unique_id": "macro.fivetran_utils.spark__percentile", "macro_sql": "{% macro spark__percentile(percentile_field, partition_field, percent) %}\n\n percentile( \n {{ percentile_field }}, \n {{ percent }}) \n over (partition by {{ partition_field }} \n )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "percentile_field", "type": null, "description": ""}, {"name": "partition_field", "type": null, "description": ""}, {"name": "percent", "type": null, "description": ""}], "created_at": 1789419970.3354373, "supported_languages": null}, "macro.fivetran_utils.duckdb__percentile": {"name": "duckdb__percentile", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/percentile.sql", "original_file_path": "macros/percentile.sql", "unique_id": "macro.fivetran_utils.duckdb__percentile", "macro_sql": "{% macro duckdb__percentile(percentile_field, partition_field, percent) %}\n\n quantile_cont(\n {{ percentile_field }},\n {{ percent }})\n over (partition by {{ partition_field }}\n )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "percentile_field", "type": null, "description": ""}, {"name": "partition_field", "type": null, "description": ""}, {"name": "percent", "type": null, "description": ""}], "created_at": 1789419970.3357112, "supported_languages": null}, "macro.fivetran_utils.remove_prefix_from_columns": {"name": "remove_prefix_from_columns", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/remove_prefix_from_columns.sql", "original_file_path": "macros/remove_prefix_from_columns.sql", "unique_id": "macro.fivetran_utils.remove_prefix_from_columns", "macro_sql": "{% macro remove_prefix_from_columns(columns, prefix='', exclude=[]) %}\n\n {%- for col in columns if col.name not in exclude -%}\n {%- if col.name[:prefix|length]|lower == prefix -%}\n {{ col.name }} as {{ col.name[prefix|length:] }}\n {%- else -%}\n {{ col.name }}\n {%- endif -%}\n {%- if not loop.last -%},{%- endif %}\n {% endfor -%}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "columns", "type": null, "description": ""}, {"name": "prefix", "type": null, "description": ""}, {"name": "exclude", "type": null, "description": ""}], "created_at": 1789419970.3368154, "supported_languages": null}, "macro.fivetran_utils.snowflake_seed_data": {"name": "snowflake_seed_data", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/snowflake_seed_data.sql", "original_file_path": "macros/snowflake_seed_data.sql", "unique_id": "macro.fivetran_utils.snowflake_seed_data", "macro_sql": "{% macro snowflake_seed_data(seed_name) %}\n\n{% if target.type == 'snowflake' %}\n{{ return(ref(seed_name ~ '_snowflake')) }}\n{% else %}\n{{ return(ref(seed_name)) }}\n{% endif %}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "seed_name", "type": null, "description": ""}], "created_at": 1789419970.3374858, "supported_languages": null}}, "docs": {"doc.dbt.__overview__": {"name": "__overview__", "resource_type": "doc", "package_name": "dbt", "path": "overview.md", "original_file_path": "docs/overview.md", "unique_id": "doc.dbt.__overview__", "block_contents": "### Welcome!\n\nWelcome to the auto-generated documentation for your dbt project!\n\n### Navigation\n\nYou can use the `Project` and `Database` navigation tabs on the left side of the window to explore the models\nin your project.\n\n#### Project Tab\nThe `Project` tab mirrors the directory structure of your dbt project. In this tab, you can see all of the\nmodels defined in your dbt project, as well as models imported from dbt packages.\n\n#### Database Tab\nThe `Database` tab also exposes your models, but in a format that looks more like a database explorer. This view\nshows relations (tables and views) grouped into database schemas. Note that ephemeral models are _not_ shown\nin this interface, as they do not exist in the database.\n\n### Graph Exploration\nYou can click the blue icon on the bottom-right corner of the page to view the lineage graph of your models.\n\nOn model pages, you'll see the immediate parents and children of the model you're exploring. By clicking the `Expand`\nbutton at the top-right of this lineage pane, you'll be able to see all of the models that are used to build,\nor are built from, the model you're exploring.\n\nOnce expanded, you'll be able to use the `--select` and `--exclude` model selection syntax to filter the\nmodels in the graph. For more information on model selection, check out the [dbt docs](https://docs.getdbt.com/docs/model-selection-syntax).\n\nNote that you can also right-click on models to interactively filter and explore the graph.\n\n---\n\n### More information\n\n- [What is dbt](https://docs.getdbt.com/docs/introduction)?\n- Read the [dbt viewpoint](https://docs.getdbt.com/docs/viewpoint)\n- [Installation](https://docs.getdbt.com/docs/installation)\n- Join the [dbt Community](https://www.getdbt.com/community/) for questions and discussion"}, "doc.iterable.source_relation": {"name": "source_relation", "resource_type": "doc", "package_name": "iterable", "path": "docs.md", "original_file_path": "models/docs.md", "unique_id": "doc.iterable.source_relation", "block_contents": "Identifies the record's source."}, "doc.iterable._fivetran_synced": {"name": "_fivetran_synced", "resource_type": "doc", "package_name": "iterable", "path": "docs.md", "original_file_path": "models/docs.md", "unique_id": "doc.iterable._fivetran_synced", "block_contents": "The time when a record was last updated by Fivetran."}}, "exposures": {}, "metrics": {}, "groups": {}, "selectors": {}, "disabled": {"test.iterable_integration_tests.consistency_campaigns": [{"database": "postgres", "schema": "public_dbt_test__audit", "name": "consistency_campaigns", "resource_type": "test", "package_name": "iterable_integration_tests", "path": "consistency/consistency_campaigns.sql", "original_file_path": "tests/consistency/consistency_campaigns.sql", "unique_id": "test.iterable_integration_tests.consistency_campaigns", "fqn": ["iterable_integration_tests", "consistency", "consistency_campaigns"], "alias": "consistency_campaigns", "checksum": {"name": "sha256", "checksum": "30e008529ef9f5fa6d8697bbcff2562fc9b176d571cc310458e67e8c82a46185"}, "config": {"enabled": false, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": ["fivetran_validations"], "meta": {}, "group": null, "static_analysis": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "sql_header": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": ["fivetran_validations"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"tags": "fivetran_validations", "enabled": "var('fivetran_validation_tests_enabled', False)"}, "created_at": 1789419971.1009398, "relation_name": null, "raw_code": "{{ config(\n tags=\"fivetran_validations\",\n enabled=var('fivetran_validation_tests_enabled', false)\n) }}\n\n{% set exclude_cols = ['labels'] + var('consistency_test_exclude_metrics', []) %}\n{% set fields = dbt_utils.star(from=ref('iterable__campaigns'), except=exclude_cols) %}\n\n-- this test ensures the iterable__campaigns end model matches the prior version\nwith prod as (\n select {{ fields }}\n from {{ target.schema }}_iterable_prod.iterable__campaigns\n where date(updated_at) < date({{ dbt.current_timestamp() }})\n),\n\ndev as (\n select {{ fields }}\n from {{ target.schema }}_iterable_dev.iterable__campaigns\n where date(updated_at) < date({{ dbt.current_timestamp() }})\n),\n\nprod_not_in_dev as (\n -- rows from prod not found in dev\n select * from prod\n except distinct\n select * from dev\n),\n\ndev_not_in_prod as (\n -- rows from dev not found in prod\n select * from dev\n except distinct\n select * from prod\n),\n\nfinal as (\n select\n *,\n 'from prod' as source\n from prod_not_in_dev\n\n union all -- union since we only care if rows are produced\n\n select\n *,\n 'from dev' as source\n from dev_not_in_prod\n)\n\nselect *\nfrom final", "doc_blocks": [], "language": "sql", "refs": [{"name": "iterable__campaigns", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt_utils.star", "macro.dbt.current_timestamp"], "nodes": []}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}}], "test.iterable_integration_tests.consistency_user_unsubscriptions": [{"database": "postgres", "schema": "public_dbt_test__audit", "name": "consistency_user_unsubscriptions", "resource_type": "test", "package_name": "iterable_integration_tests", "path": "consistency/consistency_user_unsubscriptions.sql", "original_file_path": "tests/consistency/consistency_user_unsubscriptions.sql", "unique_id": "test.iterable_integration_tests.consistency_user_unsubscriptions", "fqn": ["iterable_integration_tests", "consistency", "consistency_user_unsubscriptions"], "alias": "consistency_user_unsubscriptions", "checksum": {"name": "sha256", "checksum": "32d0be8a7f721a49100a7f4b1046a8ecb1d75b86f4ad1a484d53a1d03343bc40"}, "config": {"enabled": false, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": ["fivetran_validations"], "meta": {}, "group": null, "static_analysis": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "sql_header": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": ["fivetran_validations"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"tags": "fivetran_validations", "enabled": "var('fivetran_validation_tests_enabled', False)"}, "created_at": 1789419971.1605198, "relation_name": null, "raw_code": "{{ config(\n tags=\"fivetran_validations\",\n enabled=var('fivetran_validation_tests_enabled', false)\n) }}\n\n{% set exclude_cols = var('consistency_test_exclude_metrics', []) %}\n{% set fields = dbt_utils.star(from=ref('iterable__user_unsubscriptions'), except=exclude_cols) %}\n\n-- this test ensures the iterable__user_unsubscriptions end model matches the prior version\nwith prod as (\n select {{ fields }}\n from {{ target.schema }}_iterable_prod.iterable__user_unsubscriptions\n),\n\ndev as (\n select {{ fields }}\n from {{ target.schema }}_iterable_dev.iterable__user_unsubscriptions\n),\n\nprod_not_in_dev as (\n -- rows from prod not found in dev\n select * from prod\n except distinct\n select * from dev\n),\n\ndev_not_in_prod as (\n -- rows from dev not found in prod\n select * from dev\n except distinct\n select * from prod\n),\n\nfinal as (\n select\n *,\n 'from prod' as source\n from prod_not_in_dev\n\n union all -- union since we only care if rows are produced\n\n select\n *,\n 'from dev' as source\n from dev_not_in_prod\n)\n\nselect *\nfrom final", "doc_blocks": [], "language": "sql", "refs": [{"name": "iterable__user_unsubscriptions", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt_utils.star"], "nodes": []}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}}], "test.iterable_integration_tests.consistency_list_user_history": [{"database": "postgres", "schema": "public_dbt_test__audit", "name": "consistency_list_user_history", "resource_type": "test", "package_name": "iterable_integration_tests", "path": "consistency/consistency_list_user_history.sql", "original_file_path": "tests/consistency/consistency_list_user_history.sql", "unique_id": "test.iterable_integration_tests.consistency_list_user_history", "fqn": ["iterable_integration_tests", "consistency", "consistency_list_user_history"], "alias": "consistency_list_user_history", "checksum": {"name": "sha256", "checksum": "e0081cf1366801020e3c9fbdc71e989f2bdd7b713ee328c2f4a5e9b97355601e"}, "config": {"enabled": false, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": ["fivetran_validations"], "meta": {}, "group": null, "static_analysis": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "sql_header": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": ["fivetran_validations"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"tags": "fivetran_validations", "enabled": "var('fivetran_validation_tests_enabled', False)"}, "created_at": 1789419971.1684618, "relation_name": null, "raw_code": "{{ config(\n tags=\"fivetran_validations\",\n enabled=var('fivetran_validation_tests_enabled', false)\n) }}\n\n{% set exclude_cols = var('consistency_test_exclude_metrics', []) %}\n{% set fields = dbt_utils.star(from=ref('iterable__list_user_history'), except=exclude_cols) %}\n\n-- this test ensures the iterable__list_user_history end model matches the prior version\nwith prod as (\n select {{ fields }}\n from {{ target.schema }}_iterable_prod.iterable__list_user_history\n),\n\ndev as (\n select {{ fields }}\n from {{ target.schema }}_iterable_dev.iterable__list_user_history\n),\n\nprod_not_in_dev as (\n -- rows from prod not found in dev\n select * from prod\n except distinct\n select * from dev\n),\n\ndev_not_in_prod as (\n -- rows from dev not found in prod\n select * from dev\n except distinct\n select * from prod\n),\n\nfinal as (\n select\n *,\n 'from prod' as source\n from prod_not_in_dev\n\n union all -- union since we only care if rows are produced\n\n select\n *,\n 'from dev' as source\n from dev_not_in_prod\n)\n\nselect *\nfrom final", "doc_blocks": [], "language": "sql", "refs": [{"name": "iterable__list_user_history", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt_utils.star"], "nodes": []}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}}], "test.iterable_integration_tests.consistency_users": [{"database": "postgres", "schema": "public_dbt_test__audit", "name": "consistency_users", "resource_type": "test", "package_name": "iterable_integration_tests", "path": "consistency/consistency_users.sql", "original_file_path": "tests/consistency/consistency_users.sql", "unique_id": "test.iterable_integration_tests.consistency_users", "fqn": ["iterable_integration_tests", "consistency", "consistency_users"], "alias": "consistency_users", "checksum": {"name": "sha256", "checksum": "d367ccd8f7d79248da78ce29fc8f08876913df08b89866895cce315f46ef81e3"}, "config": {"enabled": false, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": ["fivetran_validations"], "meta": {}, "group": null, "static_analysis": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "sql_header": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": ["fivetran_validations"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"tags": "fivetran_validations", "enabled": "var('fivetran_validation_tests_enabled', False)"}, "created_at": 1789419971.176836, "relation_name": null, "raw_code": "{{ config(\n tags=\"fivetran_validations\",\n enabled=var('fivetran_validation_tests_enabled', false)\n) }}\n\n{% set exclude_cols = var('consistency_test_exclude_metrics', []) %}\n{% set fields = dbt_utils.star(from=ref('iterable__users'), except=exclude_cols) %}\n\n-- this test ensures the iterable__users end model matches the prior version\nwith prod as (\n select {{ fields }}\n from {{ target.schema }}_iterable_prod.iterable__users\n where date(updated_at) < date({{ dbt.current_timestamp() }})\n),\n\ndev as (\n select {{ fields }}\n from {{ target.schema }}_iterable_dev.iterable__users\n where date(updated_at) < date({{ dbt.current_timestamp() }})\n),\n\nprod_not_in_dev as (\n -- rows from prod not found in dev\n select * from prod\n except distinct\n select * from dev\n),\n\ndev_not_in_prod as (\n -- rows from dev not found in prod\n select * from dev\n except distinct\n select * from prod\n),\n\nfinal as (\n select\n *,\n 'from prod' as source\n from prod_not_in_dev\n\n union all -- union since we only care if rows are produced\n\n select\n *,\n 'from dev' as source\n from dev_not_in_prod\n)\n\nselect *\nfrom final", "doc_blocks": [], "language": "sql", "refs": [{"name": "iterable__users", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt_utils.star", "macro.dbt.current_timestamp"], "nodes": []}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}}], "test.iterable_integration_tests.consistency_user_unsubscribes_pre_aug_2023": [{"database": "postgres", "schema": "public_dbt_test__audit", "name": "consistency_user_unsubscribes_pre_aug_2023", "resource_type": "test", "package_name": "iterable_integration_tests", "path": "consistency/consistency_user_unsubscribes_pre_aug_2023.sql", "original_file_path": "tests/consistency/consistency_user_unsubscribes_pre_aug_2023.sql", "unique_id": "test.iterable_integration_tests.consistency_user_unsubscribes_pre_aug_2023", "fqn": ["iterable_integration_tests", "consistency", "consistency_user_unsubscribes_pre_aug_2023"], "alias": "consistency_user_unsubscribes_pre_aug_2023", "checksum": {"name": "sha256", "checksum": "0d85b35d94066e59119f57fbe930a19353dfbb79b4e812b54de9c19520a58402"}, "config": {"enabled": false, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": ["fivetran_validations"], "meta": {}, "group": null, "static_analysis": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "sql_header": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": ["fivetran_validations"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"tags": "fivetran_validations", "enabled": "var('fivetran_validation_tests_enabled', False)"}, "created_at": 1789419971.186075, "relation_name": null, "raw_code": "-- These validation tests were designed to work with the pre-August 2023 version of the Iterable connector.\n-- You will thus need to comment out `iterable_user_unsubscribed_channel_identifier` and `iterable_user_unsubscribed_message_type_identifier` in the `integration_tests/dbt_project.yml` to run and validate these tests. \n\n{{ config(\n tags=\"fivetran_validations\",\n enabled=var('fivetran_validation_tests_enabled', false)\n) }}\n\n\nwith prod as (\n\n select \n unique_user_key, \n coalesce(count(distinct unique_user_key), 0) as unique_user_records_prod, \n coalesce(count(distinct channel_id), 0) as channels_prod, \n coalesce(count(distinct message_type_id), 0) as message_types_prod\n from {{ target.schema }}_iterable_prod.iterable__user_unsubscriptions\n where channel_id is not null\n and message_type_id is not null\n group by 1\n),\n\ndev as (\n\n select \n unique_user_key, \n coalesce(count(distinct unique_user_key), 0) as unique_user_records_dev, \n coalesce(count(distinct channel_id), 0) as channels_dev, \n coalesce(count(distinct message_type_id), 0) as message_types_dev\n from {{ target.schema }}_iterable_dev.iterable__user_unsubscriptions\n where channel_id is not null\n and message_type_id is not null\n group by 1\n),\n\nfinal as (\n\n select \n prod.unique_user_key,\n unique_user_records_prod,\n unique_user_records_dev,\n channels_prod,\n channels_dev,\n message_types_prod,\n message_types_dev\n from prod\n full outer join dev\n on prod.unique_user_key = dev.unique_user_key\n) \n\nselect *\nfrom final\nwhere unique_user_records_prod != unique_user_records_dev\n and channels_prod != channels_dev \n and message_types_prod != message_types_dev", "doc_blocks": [], "language": "sql", "refs": [], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": [], "nodes": []}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}}], "test.iterable_integration_tests.consistency_user_campaign": [{"database": "postgres", "schema": "public_dbt_test__audit", "name": "consistency_user_campaign", "resource_type": "test", "package_name": "iterable_integration_tests", "path": "consistency/consistency_user_campaign.sql", "original_file_path": "tests/consistency/consistency_user_campaign.sql", "unique_id": "test.iterable_integration_tests.consistency_user_campaign", "fqn": ["iterable_integration_tests", "consistency", "consistency_user_campaign"], "alias": "consistency_user_campaign", "checksum": {"name": "sha256", "checksum": "8663f2c250688a8303d2ef38dc723e2fc62d996396b4b07e13c05feeb48cd97c"}, "config": {"enabled": false, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": ["fivetran_validations"], "meta": {}, "group": null, "static_analysis": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "sql_header": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": ["fivetran_validations"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"tags": "fivetran_validations", "enabled": "var('fivetran_validation_tests_enabled', False)"}, "created_at": 1789419971.1919909, "relation_name": null, "raw_code": "{{ config(\n tags=\"fivetran_validations\",\n enabled=var('fivetran_validation_tests_enabled', false)\n) }}\n\n{% set exclude_cols = var('consistency_test_exclude_metrics', []) %}\n{% set fields = dbt_utils.star(from=ref('iterable__user_campaign'), except=exclude_cols) %}\n\n-- this test ensures the iterable__user_campaign end model matches the prior version\nwith prod as (\n select {{ fields }}\n from {{ target.schema }}_iterable_prod.iterable__user_campaign\n where date(first_event_at) < date({{ dbt.current_timestamp() }})\n),\n\ndev as (\n select {{ fields }}\n from {{ target.schema }}_iterable_dev.iterable__user_campaign\n where date(first_event_at) < date({{ dbt.current_timestamp() }})\n),\n\nprod_not_in_dev as (\n -- rows from prod not found in dev\n select * from prod\n except distinct\n select * from dev\n),\n\ndev_not_in_prod as (\n -- rows from dev not found in prod\n select * from dev\n except distinct\n select * from prod\n),\n\nfinal as (\n select\n *,\n 'from prod' as source\n from prod_not_in_dev\n\n union all -- union since we only care if rows are produced\n\n select\n *,\n 'from dev' as source\n from dev_not_in_prod\n)\n\nselect *\nfrom final", "doc_blocks": [], "language": "sql", "refs": [{"name": "iterable__user_campaign", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt_utils.star", "macro.dbt.current_timestamp"], "nodes": []}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}}], "test.iterable_integration_tests.consistency_events": [{"database": "postgres", "schema": "public_dbt_test__audit", "name": "consistency_events", "resource_type": "test", "package_name": "iterable_integration_tests", "path": "consistency/consistency_events.sql", "original_file_path": "tests/consistency/consistency_events.sql", "unique_id": "test.iterable_integration_tests.consistency_events", "fqn": ["iterable_integration_tests", "consistency", "consistency_events"], "alias": "consistency_events", "checksum": {"name": "sha256", "checksum": "6e82de77a605ca7613eb3563f2158ad172785552d38cbf3617136a816c073b36"}, "config": {"enabled": false, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": ["fivetran_validations"], "meta": {}, "group": null, "static_analysis": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "sql_header": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": ["fivetran_validations"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"tags": "fivetran_validations", "enabled": "var('fivetran_validation_tests_enabled', False)"}, "created_at": 1789419971.20116, "relation_name": null, "raw_code": "{{ config(\n tags=\"fivetran_validations\",\n enabled=var('fivetran_validation_tests_enabled', false)\n) }}\n\n-- exclude JSON fields\n{% set exclude_cols = ['additional_properties', 'transactional_data'] + var('consistency_test_exclude_metrics', []) %}\n{% set fields = dbt_utils.star(from=ref('iterable__events'), except=exclude_cols) %}\n\n-- this test ensures the iterable__events end model matches the prior version\nwith prod as (\n select {{ fields }}\n from {{ target.schema }}_iterable_prod.iterable__events\n where date(created_at) < date({{ dbt.current_timestamp() }})\n),\n\ndev as (\n select {{ fields }}\n from {{ target.schema }}_iterable_dev.iterable__events\n where date(created_at) < date({{ dbt.current_timestamp() }})\n),\n\nprod_not_in_dev as (\n -- rows from prod not found in dev\n select * from prod\n except distinct\n select * from dev\n),\n\ndev_not_in_prod as (\n -- rows from dev not found in prod\n select * from dev\n except distinct\n select * from prod\n),\n\nfinal as (\n select\n *,\n 'from prod' as source\n from prod_not_in_dev\n\n union all -- union since we only care if rows are produced\n\n select\n *,\n 'from dev' as source\n from dev_not_in_prod\n)\n\nselect *\nfrom final", "doc_blocks": [], "language": "sql", "refs": [{"name": "iterable__events", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt_utils.star", "macro.dbt.current_timestamp"], "nodes": []}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}}], "test.iterable_integration_tests.consistency_journeys": [{"database": "postgres", "schema": "public_dbt_test__audit", "name": "consistency_journeys", "resource_type": "test", "package_name": "iterable_integration_tests", "path": "consistency/consistency_journeys.sql", "original_file_path": "tests/consistency/consistency_journeys.sql", "unique_id": "test.iterable_integration_tests.consistency_journeys", "fqn": ["iterable_integration_tests", "consistency", "consistency_journeys"], "alias": "consistency_journeys", "checksum": {"name": "sha256", "checksum": "93a73b2e7e1d608a1116fddcec932e15ce18a57fb099872a13b4f97ca006d18f"}, "config": {"enabled": false, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": ["fivetran_validations"], "meta": {}, "group": null, "static_analysis": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "sql_header": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": ["fivetran_validations"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"tags": "fivetran_validations", "enabled": "var('fivetran_validation_tests_enabled', False)"}, "created_at": 1789419971.212363, "relation_name": null, "raw_code": "{{ config(\n tags=\"fivetran_validations\",\n enabled=var('fivetran_validation_tests_enabled', false)\n) }}\n\n{% set exclude_cols = ['trigger_event_names'] + var('consistency_test_exclude_metrics', []) %}\n{% set fields = dbt_utils.star(from=ref('iterable__journeys'), except=exclude_cols) %}\n\n-- this test ensures the iterable__journeys end model matches the prior version\nwith prod as (\n select {{ fields }}\n from {{ target.schema }}_iterable_prod.iterable__journeys\n where date(updated_at) < date({{ dbt.current_timestamp() }})\n),\n\ndev as (\n select {{ fields }}\n from {{ target.schema }}_iterable_dev.iterable__journeys\n where date(updated_at) < date({{ dbt.current_timestamp() }})\n),\n\nprod_not_in_dev as (\n -- rows from prod not found in dev\n select * from prod\n except distinct\n select * from dev\n),\n\ndev_not_in_prod as (\n -- rows from dev not found in prod\n select * from dev\n except distinct\n select * from prod\n),\n\nfinal as (\n select\n *,\n 'from prod' as source\n from prod_not_in_dev\n\n union all -- union since we only care if rows are produced\n\n select\n *,\n 'from dev' as source\n from dev_not_in_prod\n)\n\nselect *\nfrom final", "doc_blocks": [], "language": "sql", "refs": [{"name": "iterable__journeys", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt_utils.star", "macro.dbt.current_timestamp"], "nodes": []}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}}], "test.iterable_integration_tests.user_unsubscribe_count_match_pre_aug_2023": [{"database": "postgres", "schema": "public_dbt_test__audit", "name": "user_unsubscribe_count_match_pre_aug_2023", "resource_type": "test", "package_name": "iterable_integration_tests", "path": "integrity/user_unsubscribe_count_match_pre_aug_2023.sql", "original_file_path": "tests/integrity/user_unsubscribe_count_match_pre_aug_2023.sql", "unique_id": "test.iterable_integration_tests.user_unsubscribe_count_match_pre_aug_2023", "fqn": ["iterable_integration_tests", "integrity", "user_unsubscribe_count_match_pre_aug_2023"], "alias": "user_unsubscribe_count_match_pre_aug_2023", "checksum": {"name": "sha256", "checksum": "6b37518965460a9c0b7161808527fa4b6f240a6ead0827a3950705267ebd236f"}, "config": {"enabled": false, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": ["fivetran_validations"], "meta": {}, "group": null, "static_analysis": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "sql_header": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": ["fivetran_validations"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"tags": "fivetran_validations", "enabled": "var('fivetran_validation_tests_enabled', False)"}, "created_at": 1789419971.221897, "relation_name": null, "raw_code": "-- These validation tests were designed to work with the pre-August 2023 version of the Iterable connector.\n-- You will thus need to comment out `iterable_user_unsubscribed_channel_identifier` and `iterable_user_unsubscribed_message_type_identifier` in the `integration_tests/dbt_project.yml` to run and validate these tests. \n\n{{ config(\n tags=\"fivetran_validations\",\n enabled=var('fivetran_validation_tests_enabled', false)\n) }}\n\nwith unsub_channels as (\n\n select \n unique_user_key, \n channel_id\n from {{ ref('stg_iterable__user_unsubscribed_channel') }}\n group by 1, 2\n),\n\nunsub_messages as (\n\n select \n unique_user_key, \n message_type_id\n from {{ ref('stg_iterable__user_unsub_message_type') }}\n group by 1, 2\n),\n\nchannel_message_combos as (\n\n select channel_id, message_type_id \n from {{ ref('stg_iterable__message_type') }}\n group by 1, 2\n),\n\nmessage_channel_unsubs as (\n\n select \n unsub_channels.unique_user_key as unique_user_key_source,\n channel_message_combos.channel_id as channel_source,\n channel_message_combos.message_type_id as message_type_source\n from unsub_channels \n inner join channel_message_combos\n on unsub_channels.channel_id = channel_message_combos.channel_id\n\n union all\n\n select \n unsub_messages.unique_user_key as unique_user_key_source,\n channel_message_combos.channel_id as channel_source,\n channel_message_combos.message_type_id as message_type_source\n from unsub_messages\n inner join channel_message_combos\n on unsub_messages.message_type_id = channel_message_combos.message_type_id\n\n),\n\nsource_counts as (\n\n select unique_user_key_source, channel_source, message_type_source, count(*) as source_count\n from message_channel_unsubs \n group by 1, 2, 3\n),\n\nend_model_counts as (\n\n select unique_user_key as unique_user_key_end, channel_id as channel_end, message_type_id as message_type_end, count(*) as end_count\n from {{ ref('iterable__user_unsubscriptions') }}\n group by 1, 2, 3 \n)\n\nselect * \nfrom source_counts\ninner join end_model_counts \n on source_counts.unique_user_key_source = end_model_counts.unique_user_key_end\nwhere source_counts.channel_source = end_model_counts.channel_end\n and source_counts.message_type_source = end_model_counts.message_type_end\n and source_counts.source_count != end_model_counts.end_count", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__user_unsubscribed_channel", "package": null, "version": null}, {"name": "stg_iterable__user_unsub_message_type", "package": null, "version": null}, {"name": "stg_iterable__message_type", "package": null, "version": null}, {"name": "iterable__user_unsubscriptions", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": [], "nodes": []}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}}], "model.iterable.int_iterable__custom_events": [{"database": "postgres", "schema": "public_iterable_dev", "name": "int_iterable__custom_events", "resource_type": "model", "package_name": "iterable", "path": "intermediate/int_iterable__custom_events.sql", "original_file_path": "models/intermediate/int_iterable__custom_events.sql", "unique_id": "model.iterable.int_iterable__custom_events", "fqn": ["iterable", "intermediate", "int_iterable__custom_events"], "alias": "int_iterable__custom_events", "checksum": {"name": "sha256", "checksum": "0f0f1330b62dd5a320f37f7e30dae86a90c57e07c135369a259cfcba61875a16"}, "config": {"enabled": false, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "incremental", "incremental_strategy": "merge", "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": "event_id", "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}, "file_format": "delta"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"materialized": "incremental", "schema": "iterable_{{ var('directed_schema','dev') }}", "unique_key": "event_id", "incremental_strategy": "merge", "file_format": "delta", "enabled": "False", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789419971.9475832, "relation_name": "\"postgres\".\"public_iterable_dev\".\"int_iterable__custom_events\"", "raw_code": "{{\n config(\n materialized='incremental',\n unique_key='event_id',\n incremental_strategy = 'merge',\n file_format = 'delta',\n enabled=false\n )\n}}\n\n-- leave this alone for now....setting enabled to false\nwith events as (\n\n select *\n from {{ ref('stg_iterable__event') }}\n\n where lower(event_name) = 'customevent'\n {% if is_incremental() %}\n and updated_at > ( select max(updated_at) from {{ this }} )\n {% endif %}\n\n), custom_events as (\n\n select \n events.*\n {# {{ dbt.split_part(string_text='additional_properties', delimiter_text=' : \"{', part_number=1) }} #}\n\n {% if target.type == 'snowflake' %}\n ,\n additional_properties.key as custom_event_name,\n additional_properties.value as custom_event_metadata\n {% endif %}\n from events\n\n \n {% if target.type == 'snowflake' %}\n cross join \n table(flatten(additional_properties)) as additional_properties\n where additional_properties.key != '_id'\n {% endif %}\n)\n\nselect *\nfrom custom_events", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__event", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.is_incremental"], "nodes": []}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}]}, "parent_map": {"seed.iterable_integration_tests.campaign_metrics_data": [], "seed.iterable_integration_tests.campaign_list_history_data": [], "seed.iterable_integration_tests.user_unsubscribed_message_type_history_data": [], "seed.iterable_integration_tests.user_unsubscribed_channel_history_data": [], "seed.iterable_integration_tests.campaign_suppression_list_history_data": [], "seed.iterable_integration_tests.channel_data": [], "seed.iterable_integration_tests.template_history_data": [], "seed.iterable_integration_tests.message_type_data": [], "seed.iterable_integration_tests.event_data": [], "seed.iterable_integration_tests.list_user_data": [], "seed.iterable_integration_tests.user_history_bq_json_data": [], "seed.iterable_integration_tests.user_unsubscribed_message_type_data": [], "seed.iterable_integration_tests.journey_data": [], "seed.iterable_integration_tests.campaign_history_data": [], "seed.iterable_integration_tests.list_data": [], "seed.iterable_integration_tests.event_extension_data": [], "seed.iterable_integration_tests.user_unsubscribed_channel_data": [], "seed.iterable_integration_tests.campaign_label_history_data": [], "seed.iterable_integration_tests.user_history_data": [], "model.iterable.iterable__users": ["model.iterable.int_iterable__list_user_unnest", "model.iterable.int_iterable__user_event_metrics", "model.iterable.stg_iterable__list_user"], "model.iterable.iterable__list_user_history": ["model.iterable.int_iterable__list_user_unnest", "model.iterable.stg_iterable__list", "model.iterable.stg_iterable__list_user"], "model.iterable.iterable__events": ["model.iterable.int_iterable__latest_template", "model.iterable.int_iterable__latest_user", "model.iterable.int_iterable__message_type_channel", "model.iterable.int_iterable__recurring_campaigns", "model.iterable.stg_iterable__event", "model.iterable.stg_iterable__event_extension"], "model.iterable.iterable__user_campaign": ["model.iterable.iterable__events"], "model.iterable.iterable__user_unsubscriptions": ["model.iterable.int_iterable__message_type_channel", "model.iterable.stg_iterable__user_unsub_message_type", "model.iterable.stg_iterable__user_unsubscribed_channel"], "model.iterable.iterable__journeys": ["model.iterable.int_iterable__journey_event_metrics", "model.iterable.stg_iterable__journey"], "model.iterable.iterable__campaigns": ["model.iterable.int_iterable__campaign_event_metrics", "model.iterable.int_iterable__campaign_labels", "model.iterable.int_iterable__campaign_lists", "model.iterable.int_iterable__latest_template", "model.iterable.int_iterable__recurring_campaigns", "model.iterable.stg_iterable__journey"], "model.iterable.int_iterable__campaign_labels": ["model.iterable.stg_iterable__campaign_label_history"], "model.iterable.int_iterable__journey_event_metrics": ["model.iterable.int_iterable__recurring_campaigns", "model.iterable.iterable__user_campaign"], "model.iterable.int_iterable__list_user_unnest": ["model.iterable.int_iterable__list_user_history"], "model.iterable.int_iterable__latest_template": ["model.iterable.int_iterable__message_type_channel", "model.iterable.stg_iterable__template_history"], "model.iterable.int_iterable__campaign_event_metrics": ["model.iterable.iterable__user_campaign"], "model.iterable.int_iterable__campaign_lists": ["model.iterable.stg_iterable__campaign_list_history", "model.iterable.stg_iterable__campaign_suppression_list_history"], "model.iterable.int_iterable__recurring_campaigns": ["model.iterable.int_iterable__latest_campaign"], "model.iterable.int_iterable__list_user_history": ["model.iterable.stg_iterable__user_history"], "model.iterable.int_iterable__message_type_channel": ["model.iterable.stg_iterable__channel", "model.iterable.stg_iterable__message_type"], "model.iterable.int_iterable__user_event_metrics": ["model.iterable.iterable__user_campaign"], "model.iterable.int_iterable__latest_user": ["model.iterable.stg_iterable__user_history"], "model.iterable.int_iterable__latest_campaign": ["model.iterable.stg_iterable__campaign_history"], "model.iterable.stg_iterable__message_type": ["model.iterable.stg_iterable__message_type_tmp"], "model.iterable.stg_iterable__event": ["model.iterable.stg_iterable__event_tmp"], "model.iterable.stg_iterable__user_unsubscribed_channel": ["model.iterable.stg_iterable__user_unsubscribed_channel_tmp"], "model.iterable.stg_iterable__campaign_history": ["model.iterable.stg_iterable__campaign_history_tmp"], "model.iterable.stg_iterable__campaign_label_history": ["model.iterable.stg_iterable__campaign_label_history_tmp"], "model.iterable.stg_iterable__template_history": ["model.iterable.stg_iterable__template_history_tmp"], "model.iterable.stg_iterable__journey": ["model.iterable.stg_iterable__journey_tmp"], "model.iterable.stg_iterable__user_history": ["model.iterable.stg_iterable__user_history_tmp"], "model.iterable.stg_iterable__user_unsub_message_type": ["model.iterable.stg_iterable__user_unsub_message_type_tmp"], "model.iterable.stg_iterable__list": ["model.iterable.stg_iterable__list_tmp"], "model.iterable.stg_iterable__list_user": ["model.iterable.stg_iterable__list_user_tmp"], "model.iterable.stg_iterable__campaign_suppression_list_history": ["model.iterable.stg_iterable__campaign_suppression_list_history_tmp"], "model.iterable.stg_iterable__event_extension": ["model.iterable.stg_iterable__event_extension_tmp"], "model.iterable.stg_iterable__campaign_list_history": ["model.iterable.stg_iterable__campaign_list_history_tmp"], "model.iterable.stg_iterable__channel": ["model.iterable.stg_iterable__channel_tmp"], "model.iterable.stg_iterable__message_type_tmp": ["source.iterable.iterable.message_type"], "model.iterable.stg_iterable__event_extension_tmp": ["source.iterable.iterable.event_extension"], "model.iterable.stg_iterable__user_unsub_message_type_tmp": ["source.iterable.iterable.user_unsubscribed_message_type_history"], "model.iterable.stg_iterable__campaign_list_history_tmp": ["source.iterable.iterable.campaign_list_history"], "model.iterable.stg_iterable__list_user_tmp": ["source.iterable.iterable.list_user"], "model.iterable.stg_iterable__user_history_tmp": ["source.iterable.iterable.user_history"], "model.iterable.stg_iterable__campaign_history_tmp": ["source.iterable.iterable.campaign_history"], "model.iterable.stg_iterable__template_history_tmp": ["source.iterable.iterable.template_history"], "model.iterable.stg_iterable__event_tmp": ["source.iterable.iterable.event"], "model.iterable.stg_iterable__journey_tmp": ["source.iterable.iterable.journey"], "model.iterable.stg_iterable__campaign_suppression_list_history_tmp": ["source.iterable.iterable.campaign_suppression_list_history"], "model.iterable.stg_iterable__campaign_label_history_tmp": ["source.iterable.iterable.campaign_label_history"], "model.iterable.stg_iterable__list_tmp": ["source.iterable.iterable.list"], "model.iterable.stg_iterable__channel_tmp": ["source.iterable.iterable.channel"], "model.iterable.stg_iterable__user_unsubscribed_channel_tmp": ["source.iterable.iterable.user_unsubscribed_channel_history"], "test.iterable.not_null_iterable__campaigns_campaign_id.03c9448919": ["model.iterable.iterable__campaigns"], "test.iterable.not_null_iterable__events_event_id.ed1d28a650": ["model.iterable.iterable__events"], "test.iterable.not_null_iterable__journeys_journey_id.b5c6b8783a": ["model.iterable.iterable__journeys"], "test.iterable.unique_iterable__journeys_unique_journey_id.ba86841246": ["model.iterable.iterable__journeys"], "test.iterable.not_null_iterable__user_unsubscriptions_unique_user_key.f8db72932b": ["model.iterable.iterable__user_unsubscriptions"], "test.iterable.not_null_iterable__users_unique_user_key.4ca37a26c8": ["model.iterable.iterable__users"], "test.iterable.not_null_stg_iterable__campaign_history_campaign_id.b7c36e4525": ["model.iterable.stg_iterable__campaign_history"], "test.iterable.not_null_stg_iterable__campaign_label_history_campaign_id.1918cef89a": ["model.iterable.stg_iterable__campaign_label_history"], "test.iterable.not_null_stg_iterable__campaign_list_history_campaign_id.208f9bf9ed": ["model.iterable.stg_iterable__campaign_list_history"], "test.iterable.not_null_stg_iterable__campaign_suppression_list_history_campaign_id.3921289710": ["model.iterable.stg_iterable__campaign_suppression_list_history"], "test.iterable.not_null_stg_iterable__channel_channel_id.182ceb9636": ["model.iterable.stg_iterable__channel"], "test.iterable.not_null_stg_iterable__event_event_id.370cd4bc9d": ["model.iterable.stg_iterable__event"], "test.iterable.not_null_stg_iterable__event_unique_event_id.e2b46d3bb6": ["model.iterable.stg_iterable__event"], "test.iterable.not_null_stg_iterable__event_extension_event_id.144dedcd30": ["model.iterable.stg_iterable__event_extension"], "test.iterable.not_null_stg_iterable__journey_journey_id.cc38bd633c": ["model.iterable.stg_iterable__journey"], "test.iterable.not_null_stg_iterable__list_list_id.47029d839a": ["model.iterable.stg_iterable__list"], "test.iterable.not_null_stg_iterable__message_type_message_type_id.75eaa6fa62": ["model.iterable.stg_iterable__message_type"], "test.iterable.not_null_stg_iterable__template_history_template_id.14b24a1dfe": ["model.iterable.stg_iterable__template_history"], "test.iterable.not_null_stg_iterable__list_user__fivetran_user_id.cca4b34c07": ["model.iterable.stg_iterable__list_user"], "test.iterable.not_null_stg_iterable__user_history_unique_user_key.2845af2127": ["model.iterable.stg_iterable__user_history"], "test.iterable.not_null_stg_iterable__user_unsubscribed_channel_channel_id.da0ed9e9be": ["model.iterable.stg_iterable__user_unsubscribed_channel"], "test.iterable.not_null_stg_iterable__user_unsub_message_type_message_type_id.268a89ea6f": ["model.iterable.stg_iterable__user_unsub_message_type"], "source.iterable.iterable.campaign_history": [], "source.iterable.iterable.campaign_label_history": [], "source.iterable.iterable.campaign_list_history": [], "source.iterable.iterable.campaign_suppression_list_history": [], "source.iterable.iterable.channel": [], "source.iterable.iterable.event": [], "source.iterable.iterable.event_extension": [], "source.iterable.iterable.journey": [], "source.iterable.iterable.list": [], "source.iterable.iterable.message_type": [], "source.iterable.iterable.template_history": [], "source.iterable.iterable.user_history": [], "source.iterable.iterable.user_unsubscribed_channel": [], "source.iterable.iterable.user_unsubscribed_message_type": [], "source.iterable.iterable.user_unsubscribed_channel_history": [], "source.iterable.iterable.user_unsubscribed_message_type_history": [], "source.iterable.iterable.list_user": []}, "child_map": {"seed.iterable_integration_tests.campaign_metrics_data": [], "seed.iterable_integration_tests.campaign_list_history_data": [], "seed.iterable_integration_tests.user_unsubscribed_message_type_history_data": [], "seed.iterable_integration_tests.user_unsubscribed_channel_history_data": [], "seed.iterable_integration_tests.campaign_suppression_list_history_data": [], "seed.iterable_integration_tests.channel_data": [], "seed.iterable_integration_tests.template_history_data": [], "seed.iterable_integration_tests.message_type_data": [], "seed.iterable_integration_tests.event_data": [], "seed.iterable_integration_tests.list_user_data": [], "seed.iterable_integration_tests.user_history_bq_json_data": [], "seed.iterable_integration_tests.user_unsubscribed_message_type_data": [], "seed.iterable_integration_tests.journey_data": [], "seed.iterable_integration_tests.campaign_history_data": [], "seed.iterable_integration_tests.list_data": [], "seed.iterable_integration_tests.event_extension_data": [], "seed.iterable_integration_tests.user_unsubscribed_channel_data": [], "seed.iterable_integration_tests.campaign_label_history_data": [], "seed.iterable_integration_tests.user_history_data": [], "model.iterable.iterable__users": ["test.iterable.not_null_iterable__users_unique_user_key.4ca37a26c8"], "model.iterable.iterable__list_user_history": [], "model.iterable.iterable__events": ["model.iterable.iterable__user_campaign", "test.iterable.not_null_iterable__events_event_id.ed1d28a650"], "model.iterable.iterable__user_campaign": ["model.iterable.int_iterable__campaign_event_metrics", "model.iterable.int_iterable__journey_event_metrics", "model.iterable.int_iterable__user_event_metrics"], "model.iterable.iterable__user_unsubscriptions": ["test.iterable.not_null_iterable__user_unsubscriptions_unique_user_key.f8db72932b"], "model.iterable.iterable__journeys": ["test.iterable.not_null_iterable__journeys_journey_id.b5c6b8783a", "test.iterable.unique_iterable__journeys_unique_journey_id.ba86841246"], "model.iterable.iterable__campaigns": ["test.iterable.not_null_iterable__campaigns_campaign_id.03c9448919"], "model.iterable.int_iterable__campaign_labels": ["model.iterable.iterable__campaigns"], "model.iterable.int_iterable__journey_event_metrics": ["model.iterable.iterable__journeys"], "model.iterable.int_iterable__list_user_unnest": ["model.iterable.iterable__list_user_history", "model.iterable.iterable__users"], "model.iterable.int_iterable__latest_template": ["model.iterable.iterable__campaigns", "model.iterable.iterable__events"], "model.iterable.int_iterable__campaign_event_metrics": ["model.iterable.iterable__campaigns"], "model.iterable.int_iterable__campaign_lists": ["model.iterable.iterable__campaigns"], "model.iterable.int_iterable__recurring_campaigns": ["model.iterable.int_iterable__journey_event_metrics", "model.iterable.iterable__campaigns", "model.iterable.iterable__events"], "model.iterable.int_iterable__list_user_history": ["model.iterable.int_iterable__list_user_unnest"], "model.iterable.int_iterable__message_type_channel": ["model.iterable.int_iterable__latest_template", "model.iterable.iterable__events", "model.iterable.iterable__user_unsubscriptions"], "model.iterable.int_iterable__user_event_metrics": ["model.iterable.iterable__users"], "model.iterable.int_iterable__latest_user": ["model.iterable.iterable__events"], "model.iterable.int_iterable__latest_campaign": ["model.iterable.int_iterable__recurring_campaigns"], "model.iterable.stg_iterable__message_type": ["model.iterable.int_iterable__message_type_channel", "test.iterable.not_null_stg_iterable__message_type_message_type_id.75eaa6fa62"], "model.iterable.stg_iterable__event": ["model.iterable.iterable__events", "test.iterable.not_null_stg_iterable__event_event_id.370cd4bc9d", "test.iterable.not_null_stg_iterable__event_unique_event_id.e2b46d3bb6"], "model.iterable.stg_iterable__user_unsubscribed_channel": ["model.iterable.iterable__user_unsubscriptions", "test.iterable.not_null_stg_iterable__user_unsubscribed_channel_channel_id.da0ed9e9be"], "model.iterable.stg_iterable__campaign_history": ["model.iterable.int_iterable__latest_campaign", "test.iterable.not_null_stg_iterable__campaign_history_campaign_id.b7c36e4525"], "model.iterable.stg_iterable__campaign_label_history": ["model.iterable.int_iterable__campaign_labels", "test.iterable.not_null_stg_iterable__campaign_label_history_campaign_id.1918cef89a"], "model.iterable.stg_iterable__template_history": ["model.iterable.int_iterable__latest_template", "test.iterable.not_null_stg_iterable__template_history_template_id.14b24a1dfe"], "model.iterable.stg_iterable__journey": ["model.iterable.iterable__campaigns", "model.iterable.iterable__journeys", "test.iterable.not_null_stg_iterable__journey_journey_id.cc38bd633c"], "model.iterable.stg_iterable__user_history": ["model.iterable.int_iterable__latest_user", "model.iterable.int_iterable__list_user_history", "test.iterable.not_null_stg_iterable__user_history_unique_user_key.2845af2127"], "model.iterable.stg_iterable__user_unsub_message_type": ["model.iterable.iterable__user_unsubscriptions", "test.iterable.not_null_stg_iterable__user_unsub_message_type_message_type_id.268a89ea6f"], "model.iterable.stg_iterable__list": ["model.iterable.iterable__list_user_history", "test.iterable.not_null_stg_iterable__list_list_id.47029d839a"], "model.iterable.stg_iterable__list_user": ["model.iterable.iterable__list_user_history", "model.iterable.iterable__users", "test.iterable.not_null_stg_iterable__list_user__fivetran_user_id.cca4b34c07"], "model.iterable.stg_iterable__campaign_suppression_list_history": ["model.iterable.int_iterable__campaign_lists", "test.iterable.not_null_stg_iterable__campaign_suppression_list_history_campaign_id.3921289710"], "model.iterable.stg_iterable__event_extension": ["model.iterable.iterable__events", "test.iterable.not_null_stg_iterable__event_extension_event_id.144dedcd30"], "model.iterable.stg_iterable__campaign_list_history": ["model.iterable.int_iterable__campaign_lists", "test.iterable.not_null_stg_iterable__campaign_list_history_campaign_id.208f9bf9ed"], "model.iterable.stg_iterable__channel": ["model.iterable.int_iterable__message_type_channel", "test.iterable.not_null_stg_iterable__channel_channel_id.182ceb9636"], "model.iterable.stg_iterable__message_type_tmp": ["model.iterable.stg_iterable__message_type"], "model.iterable.stg_iterable__event_extension_tmp": ["model.iterable.stg_iterable__event_extension"], "model.iterable.stg_iterable__user_unsub_message_type_tmp": ["model.iterable.stg_iterable__user_unsub_message_type"], "model.iterable.stg_iterable__campaign_list_history_tmp": ["model.iterable.stg_iterable__campaign_list_history"], "model.iterable.stg_iterable__list_user_tmp": ["model.iterable.stg_iterable__list_user"], "model.iterable.stg_iterable__user_history_tmp": ["model.iterable.stg_iterable__user_history"], "model.iterable.stg_iterable__campaign_history_tmp": ["model.iterable.stg_iterable__campaign_history"], "model.iterable.stg_iterable__template_history_tmp": ["model.iterable.stg_iterable__template_history"], "model.iterable.stg_iterable__event_tmp": ["model.iterable.stg_iterable__event"], "model.iterable.stg_iterable__journey_tmp": ["model.iterable.stg_iterable__journey"], "model.iterable.stg_iterable__campaign_suppression_list_history_tmp": ["model.iterable.stg_iterable__campaign_suppression_list_history"], "model.iterable.stg_iterable__campaign_label_history_tmp": ["model.iterable.stg_iterable__campaign_label_history"], "model.iterable.stg_iterable__list_tmp": ["model.iterable.stg_iterable__list"], "model.iterable.stg_iterable__channel_tmp": ["model.iterable.stg_iterable__channel"], "model.iterable.stg_iterable__user_unsubscribed_channel_tmp": ["model.iterable.stg_iterable__user_unsubscribed_channel"], "test.iterable.not_null_iterable__campaigns_campaign_id.03c9448919": [], "test.iterable.not_null_iterable__events_event_id.ed1d28a650": [], "test.iterable.not_null_iterable__journeys_journey_id.b5c6b8783a": [], "test.iterable.unique_iterable__journeys_unique_journey_id.ba86841246": [], "test.iterable.not_null_iterable__user_unsubscriptions_unique_user_key.f8db72932b": [], "test.iterable.not_null_iterable__users_unique_user_key.4ca37a26c8": [], "test.iterable.not_null_stg_iterable__campaign_history_campaign_id.b7c36e4525": [], "test.iterable.not_null_stg_iterable__campaign_label_history_campaign_id.1918cef89a": [], "test.iterable.not_null_stg_iterable__campaign_list_history_campaign_id.208f9bf9ed": [], "test.iterable.not_null_stg_iterable__campaign_suppression_list_history_campaign_id.3921289710": [], "test.iterable.not_null_stg_iterable__channel_channel_id.182ceb9636": [], "test.iterable.not_null_stg_iterable__event_event_id.370cd4bc9d": [], "test.iterable.not_null_stg_iterable__event_unique_event_id.e2b46d3bb6": [], "test.iterable.not_null_stg_iterable__event_extension_event_id.144dedcd30": [], "test.iterable.not_null_stg_iterable__journey_journey_id.cc38bd633c": [], "test.iterable.not_null_stg_iterable__list_list_id.47029d839a": [], "test.iterable.not_null_stg_iterable__message_type_message_type_id.75eaa6fa62": [], "test.iterable.not_null_stg_iterable__template_history_template_id.14b24a1dfe": [], "test.iterable.not_null_stg_iterable__list_user__fivetran_user_id.cca4b34c07": [], "test.iterable.not_null_stg_iterable__user_history_unique_user_key.2845af2127": [], "test.iterable.not_null_stg_iterable__user_unsubscribed_channel_channel_id.da0ed9e9be": [], "test.iterable.not_null_stg_iterable__user_unsub_message_type_message_type_id.268a89ea6f": [], "source.iterable.iterable.campaign_history": ["model.iterable.stg_iterable__campaign_history_tmp"], "source.iterable.iterable.campaign_label_history": ["model.iterable.stg_iterable__campaign_label_history_tmp"], "source.iterable.iterable.campaign_list_history": ["model.iterable.stg_iterable__campaign_list_history_tmp"], "source.iterable.iterable.campaign_suppression_list_history": ["model.iterable.stg_iterable__campaign_suppression_list_history_tmp"], "source.iterable.iterable.channel": ["model.iterable.stg_iterable__channel_tmp"], "source.iterable.iterable.event": ["model.iterable.stg_iterable__event_tmp"], "source.iterable.iterable.event_extension": ["model.iterable.stg_iterable__event_extension_tmp"], "source.iterable.iterable.journey": ["model.iterable.stg_iterable__journey_tmp"], "source.iterable.iterable.list": ["model.iterable.stg_iterable__list_tmp"], "source.iterable.iterable.message_type": ["model.iterable.stg_iterable__message_type_tmp"], "source.iterable.iterable.template_history": ["model.iterable.stg_iterable__template_history_tmp"], "source.iterable.iterable.user_history": ["model.iterable.stg_iterable__user_history_tmp"], "source.iterable.iterable.user_unsubscribed_channel": [], "source.iterable.iterable.user_unsubscribed_message_type": [], "source.iterable.iterable.user_unsubscribed_channel_history": ["model.iterable.stg_iterable__user_unsubscribed_channel_tmp"], "source.iterable.iterable.user_unsubscribed_message_type_history": ["model.iterable.stg_iterable__user_unsub_message_type_tmp"], "source.iterable.iterable.list_user": ["model.iterable.stg_iterable__list_user_tmp"]}, "group_map": {}, "saved_queries": {}, "semantic_models": {}, "unit_tests": {}, "functions": {}} \ No newline at end of file +{"metadata": {"dbt_schema_version": "https://schemas.getdbt.com/dbt/manifest/v12.json", "dbt_version": "1.12.4", "generated_at": "2026-09-14T21:49:37.638875Z", "invocation_id": "6a6c3f91-5f13-44f5-8829-b38d77182ae4", "invocation_started_at": "2026-09-14T21:49:25.424086+00:00", "env": {}, "project_name": "iterable_integration_tests", "project_id": "726648524a3768595307d45548dac26e", "user_id": null, "send_anonymous_usage_stats": false, "adapter_type": "postgres", "quoting": {"database": true, "schema": true, "identifier": true, "column": null}, "run_started_at": "2026-09-14T21:49:25.424377+00:00"}, "nodes": {"seed.iterable_integration_tests.campaign_metrics_data": {"database": "postgres", "schema": "public", "name": "campaign_metrics_data", "resource_type": "seed", "package_name": "iterable_integration_tests", "path": "campaign_metrics_data.csv", "original_file_path": "seeds/campaign_metrics_data.csv", "unique_id": "seed.iterable_integration_tests.campaign_metrics_data", "fqn": ["iterable_integration_tests", "campaign_metrics_data"], "alias": "campaign_metrics_data", "checksum": {"name": "sha256", "checksum": "45e8e7be3941e10f43112fac7bd78f0b6a63c070090062f65b2ffabe481b8c4e"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "seed", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": false, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "delimiter": ",", "quote_columns": false}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": false, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"docs": {"show": false}, "quote_columns": "{{ target.type == 'redshift' or var('fivetran_using_source_casing', false) }}"}, "created_at": 1789422568.226198, "relation_name": "\"postgres\".\"public\".\"campaign_metrics_data\"", "raw_code": "", "doc_blocks": [], "root_path": "/home/runner/work/dbt_iterable/dbt_iterable/integration_tests", "depends_on": {"macros": []}}, "seed.iterable_integration_tests.campaign_list_history_data": {"database": "postgres", "schema": "public", "name": "campaign_list_history_data", "resource_type": "seed", "package_name": "iterable_integration_tests", "path": "campaign_list_history_data.csv", "original_file_path": "seeds/campaign_list_history_data.csv", "unique_id": "seed.iterable_integration_tests.campaign_list_history_data", "fqn": ["iterable_integration_tests", "campaign_list_history_data"], "alias": "campaign_list_history_data", "checksum": {"name": "sha256", "checksum": "206581e614bf60f37345cbf1bd5e0cacac8a2f329a7dfc521b809c3e6d72e728"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "seed", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {"_fivetran_synced": "timestamp"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": false, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "delimiter": ",", "quote_columns": false}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": false, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"docs": {"show": false}, "quote_columns": "{{ target.type == 'redshift' or var('fivetran_using_source_casing', false) }}", "column_types": {"_fivetran_synced": "timestamp"}}, "created_at": 1789422568.234622, "relation_name": "\"postgres\".\"public\".\"campaign_list_history_data\"", "raw_code": "", "doc_blocks": [], "root_path": "/home/runner/work/dbt_iterable/dbt_iterable/integration_tests", "depends_on": {"macros": []}}, "seed.iterable_integration_tests.user_unsubscribed_message_type_history_data": {"database": "postgres", "schema": "public", "name": "user_unsubscribed_message_type_history_data", "resource_type": "seed", "package_name": "iterable_integration_tests", "path": "user_unsubscribed_message_type_history_data.csv", "original_file_path": "seeds/user_unsubscribed_message_type_history_data.csv", "unique_id": "seed.iterable_integration_tests.user_unsubscribed_message_type_history_data", "fqn": ["iterable_integration_tests", "user_unsubscribed_message_type_history_data"], "alias": "user_unsubscribed_message_type_history_data", "checksum": {"name": "sha256", "checksum": "1e6883673b9a6f44966d10891cece60a739773fadf44302ccf2aad5290222687"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "seed", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {"_fivetran_synced": "timestamp"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": false, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "delimiter": ",", "quote_columns": false}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": false, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"docs": {"show": false}, "quote_columns": "{{ target.type == 'redshift' or var('fivetran_using_source_casing', false) }}", "column_types": {"_fivetran_synced": "timestamp"}}, "created_at": 1789422568.2383938, "relation_name": "\"postgres\".\"public\".\"user_unsubscribed_message_type_history_data\"", "raw_code": "", "doc_blocks": [], "root_path": "/home/runner/work/dbt_iterable/dbt_iterable/integration_tests", "depends_on": {"macros": []}}, "seed.iterable_integration_tests.user_unsubscribed_channel_history_data": {"database": "postgres", "schema": "public", "name": "user_unsubscribed_channel_history_data", "resource_type": "seed", "package_name": "iterable_integration_tests", "path": "user_unsubscribed_channel_history_data.csv", "original_file_path": "seeds/user_unsubscribed_channel_history_data.csv", "unique_id": "seed.iterable_integration_tests.user_unsubscribed_channel_history_data", "fqn": ["iterable_integration_tests", "user_unsubscribed_channel_history_data"], "alias": "user_unsubscribed_channel_history_data", "checksum": {"name": "sha256", "checksum": "a1b532e561033f6ff137e5a1bde082263903493b763e9358a2a2ba151360e00e"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "seed", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {"channel_id": "bigint", "_fivetran_synced": "timestamp"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": false, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "delimiter": ",", "quote_columns": false}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": false, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"docs": {"show": false}, "quote_columns": "{{ target.type == 'redshift' or var('fivetran_using_source_casing', false) }}", "column_types": {"channel_id": "{%- if target.type == 'bigquery' -%} INT64 {%- else -%} bigint {%- endif -%}", "_fivetran_synced": "timestamp"}}, "created_at": 1789422568.2424986, "relation_name": "\"postgres\".\"public\".\"user_unsubscribed_channel_history_data\"", "raw_code": "", "doc_blocks": [], "root_path": "/home/runner/work/dbt_iterable/dbt_iterable/integration_tests", "depends_on": {"macros": []}}, "seed.iterable_integration_tests.campaign_suppression_list_history_data": {"database": "postgres", "schema": "public", "name": "campaign_suppression_list_history_data", "resource_type": "seed", "package_name": "iterable_integration_tests", "path": "campaign_suppression_list_history_data.csv", "original_file_path": "seeds/campaign_suppression_list_history_data.csv", "unique_id": "seed.iterable_integration_tests.campaign_suppression_list_history_data", "fqn": ["iterable_integration_tests", "campaign_suppression_list_history_data"], "alias": "campaign_suppression_list_history_data", "checksum": {"name": "sha256", "checksum": "c9eaab0efe0e47ef695b57f71b41f23cf527c87610d7770be604e461fe7c9846"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "seed", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {"_fivetran_synced": "timestamp"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": false, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "delimiter": ",", "quote_columns": false}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": false, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"docs": {"show": false}, "quote_columns": "{{ target.type == 'redshift' or var('fivetran_using_source_casing', false) }}", "column_types": {"_fivetran_synced": "timestamp"}}, "created_at": 1789422568.246256, "relation_name": "\"postgres\".\"public\".\"campaign_suppression_list_history_data\"", "raw_code": "", "doc_blocks": [], "root_path": "/home/runner/work/dbt_iterable/dbt_iterable/integration_tests", "depends_on": {"macros": []}}, "seed.iterable_integration_tests.channel_data": {"database": "postgres", "schema": "public", "name": "channel_data", "resource_type": "seed", "package_name": "iterable_integration_tests", "path": "channel_data.csv", "original_file_path": "seeds/channel_data.csv", "unique_id": "seed.iterable_integration_tests.channel_data", "fqn": ["iterable_integration_tests", "channel_data"], "alias": "channel_data", "checksum": {"name": "sha256", "checksum": "a77e21fb127c0ff7fc652eb5ffc6b3559fde3d63c2c5291a68f10fefcc2fac37"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "seed", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {"id": "bigint", "_fivetran_synced": "timestamp"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": false, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "delimiter": ",", "quote_columns": false}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": false, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"docs": {"show": false}, "quote_columns": "{{ target.type == 'redshift' or var('fivetran_using_source_casing', false) }}", "column_types": {"id": "{%- if target.type == 'bigquery' -%} INT64 {%- else -%} bigint {%- endif -%}", "_fivetran_synced": "timestamp"}}, "created_at": 1789422568.2499728, "relation_name": "\"postgres\".\"public\".\"channel_data\"", "raw_code": "", "doc_blocks": [], "root_path": "/home/runner/work/dbt_iterable/dbt_iterable/integration_tests", "depends_on": {"macros": []}}, "seed.iterable_integration_tests.template_history_data": {"database": "postgres", "schema": "public", "name": "template_history_data", "resource_type": "seed", "package_name": "iterable_integration_tests", "path": "template_history_data.csv", "original_file_path": "seeds/template_history_data.csv", "unique_id": "seed.iterable_integration_tests.template_history_data", "fqn": ["iterable_integration_tests", "template_history_data"], "alias": "template_history_data", "checksum": {"name": "sha256", "checksum": "0f0c442398531afc5fb4c18f12f0d0f694eb3453cb09e0c6c48ba340b110f4a6"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "seed", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {"_fivetran_synced": "timestamp"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": false, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "delimiter": ",", "quote_columns": false}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": false, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"docs": {"show": false}, "quote_columns": "{{ target.type == 'redshift' or var('fivetran_using_source_casing', false) }}", "column_types": {"_fivetran_synced": "timestamp"}}, "created_at": 1789422568.2537677, "relation_name": "\"postgres\".\"public\".\"template_history_data\"", "raw_code": "", "doc_blocks": [], "root_path": "/home/runner/work/dbt_iterable/dbt_iterable/integration_tests", "depends_on": {"macros": []}}, "seed.iterable_integration_tests.message_type_data": {"database": "postgres", "schema": "public", "name": "message_type_data", "resource_type": "seed", "package_name": "iterable_integration_tests", "path": "message_type_data.csv", "original_file_path": "seeds/message_type_data.csv", "unique_id": "seed.iterable_integration_tests.message_type_data", "fqn": ["iterable_integration_tests", "message_type_data"], "alias": "message_type_data", "checksum": {"name": "sha256", "checksum": "84228c8c4a13092ca90bdf9579856968f5265c49f456d01b8510834ae3520bce"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "seed", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {"id": "bigint", "channel_id": "bigint", "_fivetran_synced": "timestamp"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": false, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "delimiter": ",", "quote_columns": false}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": false, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"docs": {"show": false}, "quote_columns": "{{ target.type == 'redshift' or var('fivetran_using_source_casing', false) }}", "column_types": {"id": "{%- if target.type == 'bigquery' -%} INT64 {%- else -%} bigint {%- endif -%}", "channel_id": "{%- if target.type == 'bigquery' -%} INT64 {%- else -%} bigint {%- endif -%}", "_fivetran_synced": "timestamp"}}, "created_at": 1789422568.2578084, "relation_name": "\"postgres\".\"public\".\"message_type_data\"", "raw_code": "", "doc_blocks": [], "root_path": "/home/runner/work/dbt_iterable/dbt_iterable/integration_tests", "depends_on": {"macros": []}}, "seed.iterable_integration_tests.event_data": {"database": "postgres", "schema": "public", "name": "event_data", "resource_type": "seed", "package_name": "iterable_integration_tests", "path": "event_data.csv", "original_file_path": "seeds/event_data.csv", "unique_id": "seed.iterable_integration_tests.event_data", "fqn": ["iterable_integration_tests", "event_data"], "alias": "event_data", "checksum": {"name": "sha256", "checksum": "c886615b369d98135814bac7c4070be9d58b4aa6eb9a90a5caa5ddc4454ab0ed"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "seed", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {"transactional_data": "varchar(100)", "created_at": "timestamp", "_fivetran_synced": "timestamp"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": false, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "delimiter": ",", "quote_columns": false}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": false, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"docs": {"show": false}, "quote_columns": "{{ target.type == 'redshift' or var('fivetran_using_source_casing', false) }}", "column_types": {"transactional_data": "{{ 'varchar(100)' if target.type in ('redshift', 'postgres') else 'string'}}", "created_at": "timestamp", "_fivetran_synced": "timestamp"}}, "created_at": 1789422568.2615685, "relation_name": "\"postgres\".\"public\".\"event_data\"", "raw_code": "", "doc_blocks": [], "root_path": "/home/runner/work/dbt_iterable/dbt_iterable/integration_tests", "depends_on": {"macros": []}}, "seed.iterable_integration_tests.list_user_data": {"database": "postgres", "schema": "public", "name": "list_user_data", "resource_type": "seed", "package_name": "iterable_integration_tests", "path": "list_user_data.csv", "original_file_path": "seeds/list_user_data.csv", "unique_id": "seed.iterable_integration_tests.list_user_data", "fqn": ["iterable_integration_tests", "list_user_data"], "alias": "list_user_data", "checksum": {"name": "sha256", "checksum": "2dbd80b8fb4338602a543026ede3f5a0797c0a4cf13c4724a877bb60ac6a4793"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "seed", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {"list_id": "bigint", "index": "bigint", "_fivetran_synced": "timestamp"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": false, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "delimiter": ",", "quote_columns": false}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": false, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"docs": {"show": false}, "quote_columns": "{{ target.type == 'redshift' or var('fivetran_using_source_casing', false) }}", "column_types": {"list_id": "{%- if target.type == 'bigquery' -%} INT64 {%- else -%} bigint {%- endif -%}", "index": "{%- if target.type == 'bigquery' -%} INT64 {%- else -%} bigint {%- endif -%}", "_fivetran_synced": "timestamp"}}, "created_at": 1789422568.2652779, "relation_name": "\"postgres\".\"public\".\"list_user_data\"", "raw_code": "", "doc_blocks": [], "root_path": "/home/runner/work/dbt_iterable/dbt_iterable/integration_tests", "depends_on": {"macros": []}}, "seed.iterable_integration_tests.user_history_bq_json_data": {"database": "postgres", "schema": "public", "name": "user_history_bq_json_data", "resource_type": "seed", "package_name": "iterable_integration_tests", "path": "user_history_bq_json_data.csv", "original_file_path": "seeds/user_history_bq_json_data.csv", "unique_id": "seed.iterable_integration_tests.user_history_bq_json_data", "fqn": ["iterable_integration_tests", "user_history_bq_json_data"], "alias": "user_history_bq_json_data", "checksum": {"name": "sha256", "checksum": "d2689731ace45d1a5c13930bcc8b80f7b3a02993f8ee4c58bfcf754b734a5caa"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "seed", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": false, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "delimiter": ",", "quote_columns": false}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": false, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"docs": {"show": false}, "quote_columns": "{{ target.type == 'redshift' or var('fivetran_using_source_casing', false) }}"}, "created_at": 1789422568.2688863, "relation_name": "\"postgres\".\"public\".\"user_history_bq_json_data\"", "raw_code": "", "doc_blocks": [], "root_path": "/home/runner/work/dbt_iterable/dbt_iterable/integration_tests", "depends_on": {"macros": []}}, "seed.iterable_integration_tests.user_unsubscribed_message_type_data": {"database": "postgres", "schema": "public", "name": "user_unsubscribed_message_type_data", "resource_type": "seed", "package_name": "iterable_integration_tests", "path": "user_unsubscribed_message_type_data.csv", "original_file_path": "seeds/user_unsubscribed_message_type_data.csv", "unique_id": "seed.iterable_integration_tests.user_unsubscribed_message_type_data", "fqn": ["iterable_integration_tests", "user_unsubscribed_message_type_data"], "alias": "user_unsubscribed_message_type_data", "checksum": {"name": "sha256", "checksum": "473f01110084e53b2115bd09606172cb87559359ccd66775f60209851bfdac12"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "seed", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {"_fivetran_synced": "timestamp"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": false, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "delimiter": ",", "quote_columns": false}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": false, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"docs": {"show": false}, "quote_columns": "{{ target.type == 'redshift' or var('fivetran_using_source_casing', false) }}", "column_types": {"_fivetran_synced": "timestamp"}}, "created_at": 1789422568.2724652, "relation_name": "\"postgres\".\"public\".\"user_unsubscribed_message_type_data\"", "raw_code": "", "doc_blocks": [], "root_path": "/home/runner/work/dbt_iterable/dbt_iterable/integration_tests", "depends_on": {"macros": []}}, "seed.iterable_integration_tests.journey_data": {"database": "postgres", "schema": "public", "name": "journey_data", "resource_type": "seed", "package_name": "iterable_integration_tests", "path": "journey_data.csv", "original_file_path": "seeds/journey_data.csv", "unique_id": "seed.iterable_integration_tests.journey_data", "fqn": ["iterable_integration_tests", "journey_data"], "alias": "journey_data", "checksum": {"name": "sha256", "checksum": "763e5d9e7d86016bfdb9b0ad32da7c2d9685721719cb13b0b518415664bbb6d8"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "seed", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {"id": "bigint", "lifetime_limit": "bigint", "simultaneous_limit": "bigint", "start_tile_id": "bigint", "created_at": "timestamp", "updated_at": "timestamp", "_fivetran_synced": "timestamp"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": false, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "delimiter": ",", "quote_columns": false}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": false, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"docs": {"show": false}, "quote_columns": "{{ target.type == 'redshift' or var('fivetran_using_source_casing', false) }}", "column_types": {"id": "{%- if target.type == 'bigquery' -%} INT64 {%- else -%} bigint {%- endif -%}", "lifetime_limit": "{%- if target.type == 'bigquery' -%} INT64 {%- else -%} bigint {%- endif -%}", "simultaneous_limit": "{%- if target.type == 'bigquery' -%} INT64 {%- else -%} bigint {%- endif -%}", "start_tile_id": "{%- if target.type == 'bigquery' -%} INT64 {%- else -%} bigint {%- endif -%}", "created_at": "timestamp", "updated_at": "timestamp", "_fivetran_synced": "timestamp"}}, "created_at": 1789422568.276272, "relation_name": "\"postgres\".\"public\".\"journey_data\"", "raw_code": "", "doc_blocks": [], "root_path": "/home/runner/work/dbt_iterable/dbt_iterable/integration_tests", "depends_on": {"macros": []}}, "seed.iterable_integration_tests.campaign_history_data": {"database": "postgres", "schema": "public", "name": "campaign_history_data", "resource_type": "seed", "package_name": "iterable_integration_tests", "path": "campaign_history_data.csv", "original_file_path": "seeds/campaign_history_data.csv", "unique_id": "seed.iterable_integration_tests.campaign_history_data", "fqn": ["iterable_integration_tests", "campaign_history_data"], "alias": "campaign_history_data", "checksum": {"name": "sha256", "checksum": "06adf392dab227dbabbda6782b710213ceea5a30d87990d0cbabe92ba0a955c4"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "seed", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {"_fivetran_synced": "timestamp"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": false, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "delimiter": ",", "quote_columns": false}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": false, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"docs": {"show": false}, "quote_columns": "{{ target.type == 'redshift' or var('fivetran_using_source_casing', false) }}", "column_types": {"_fivetran_synced": "timestamp"}}, "created_at": 1789422568.2800417, "relation_name": "\"postgres\".\"public\".\"campaign_history_data\"", "raw_code": "", "doc_blocks": [], "root_path": "/home/runner/work/dbt_iterable/dbt_iterable/integration_tests", "depends_on": {"macros": []}}, "seed.iterable_integration_tests.list_data": {"database": "postgres", "schema": "public", "name": "list_data", "resource_type": "seed", "package_name": "iterable_integration_tests", "path": "list_data.csv", "original_file_path": "seeds/list_data.csv", "unique_id": "seed.iterable_integration_tests.list_data", "fqn": ["iterable_integration_tests", "list_data"], "alias": "list_data", "checksum": {"name": "sha256", "checksum": "9d817c52008be5fbdb25cde6fa5855f8222f41a436ba7e2e5ed564e319cb64fd"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "seed", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {"_fivetran_synced": "timestamp"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": false, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "delimiter": ",", "quote_columns": false}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": false, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"docs": {"show": false}, "quote_columns": "{{ target.type == 'redshift' or var('fivetran_using_source_casing', false) }}", "column_types": {"_fivetran_synced": "timestamp"}}, "created_at": 1789422568.2837248, "relation_name": "\"postgres\".\"public\".\"list_data\"", "raw_code": "", "doc_blocks": [], "root_path": "/home/runner/work/dbt_iterable/dbt_iterable/integration_tests", "depends_on": {"macros": []}}, "seed.iterable_integration_tests.event_extension_data": {"database": "postgres", "schema": "public", "name": "event_extension_data", "resource_type": "seed", "package_name": "iterable_integration_tests", "path": "event_extension_data.csv", "original_file_path": "seeds/event_extension_data.csv", "unique_id": "seed.iterable_integration_tests.event_extension_data", "fqn": ["iterable_integration_tests", "event_extension_data"], "alias": "event_extension_data", "checksum": {"name": "sha256", "checksum": "e0ed2a4a9661ad12bdd9d9a2221df3fd32f2da5fad39e9d0f6f01cbc819ffa9a"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "seed", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {"payload": "varchar(100)", "_fivetran_synced": "timestamp"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": false, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "delimiter": ",", "quote_columns": false}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": false, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"docs": {"show": false}, "quote_columns": "{{ target.type == 'redshift' or var('fivetran_using_source_casing', false) }}", "column_types": {"payload": "{{ 'varchar(100)' if target.type in ('redshift', 'postgres') else 'string'}}", "_fivetran_synced": "timestamp"}}, "created_at": 1789422568.287395, "relation_name": "\"postgres\".\"public\".\"event_extension_data\"", "raw_code": "", "doc_blocks": [], "root_path": "/home/runner/work/dbt_iterable/dbt_iterable/integration_tests", "depends_on": {"macros": []}}, "seed.iterable_integration_tests.user_unsubscribed_channel_data": {"database": "postgres", "schema": "public", "name": "user_unsubscribed_channel_data", "resource_type": "seed", "package_name": "iterable_integration_tests", "path": "user_unsubscribed_channel_data.csv", "original_file_path": "seeds/user_unsubscribed_channel_data.csv", "unique_id": "seed.iterable_integration_tests.user_unsubscribed_channel_data", "fqn": ["iterable_integration_tests", "user_unsubscribed_channel_data"], "alias": "user_unsubscribed_channel_data", "checksum": {"name": "sha256", "checksum": "4c6abacf719352d79d0da89751296fc2665d65546ee2c1ad45d142918c750f28"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "seed", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {"_fivetran_synced": "timestamp"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": false, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "delimiter": ",", "quote_columns": false}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": false, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"docs": {"show": false}, "quote_columns": "{{ target.type == 'redshift' or var('fivetran_using_source_casing', false) }}", "column_types": {"_fivetran_synced": "timestamp"}}, "created_at": 1789422568.291177, "relation_name": "\"postgres\".\"public\".\"user_unsubscribed_channel_data\"", "raw_code": "", "doc_blocks": [], "root_path": "/home/runner/work/dbt_iterable/dbt_iterable/integration_tests", "depends_on": {"macros": []}}, "seed.iterable_integration_tests.campaign_label_history_data": {"database": "postgres", "schema": "public", "name": "campaign_label_history_data", "resource_type": "seed", "package_name": "iterable_integration_tests", "path": "campaign_label_history_data.csv", "original_file_path": "seeds/campaign_label_history_data.csv", "unique_id": "seed.iterable_integration_tests.campaign_label_history_data", "fqn": ["iterable_integration_tests", "campaign_label_history_data"], "alias": "campaign_label_history_data", "checksum": {"name": "sha256", "checksum": "30ed21c883f801eb859d0280b90d45cb3dd020cdb708f4ef4aeca772372bf077"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "seed", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {"_fivetran_synced": "timestamp"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": false, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "delimiter": ",", "quote_columns": false}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": false, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"docs": {"show": false}, "quote_columns": "{{ target.type == 'redshift' or var('fivetran_using_source_casing', false) }}", "column_types": {"_fivetran_synced": "timestamp"}}, "created_at": 1789422568.2948465, "relation_name": "\"postgres\".\"public\".\"campaign_label_history_data\"", "raw_code": "", "doc_blocks": [], "root_path": "/home/runner/work/dbt_iterable/dbt_iterable/integration_tests", "depends_on": {"macros": []}}, "seed.iterable_integration_tests.user_history_data": {"database": "postgres", "schema": "public", "name": "user_history_data", "resource_type": "seed", "package_name": "iterable_integration_tests", "path": "user_history_data.csv", "original_file_path": "seeds/user_history_data.csv", "unique_id": "seed.iterable_integration_tests.user_history_data", "fqn": ["iterable_integration_tests", "user_history_data"], "alias": "user_history_data", "checksum": {"name": "sha256", "checksum": "708bd35a21174cf05f0b4370079a339061c0b9292690ac4facd43b1d2bdff186"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "seed", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {"updated_at": "timestamp", "_fivetran_synced": "timestamp"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": false, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "delimiter": ",", "quote_columns": false}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": false, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"docs": {"show": false}, "quote_columns": "{{ target.type == 'redshift' or var('fivetran_using_source_casing', false) }}", "column_types": {"updated_at": "timestamp", "_fivetran_synced": "timestamp"}}, "created_at": 1789422568.2986176, "relation_name": "\"postgres\".\"public\".\"user_history_data\"", "raw_code": "", "doc_blocks": [], "root_path": "/home/runner/work/dbt_iterable/dbt_iterable/integration_tests", "depends_on": {"macros": []}}, "model.iterable.iterable__users": {"database": "postgres", "schema": "public_iterable_dev", "name": "iterable__users", "resource_type": "model", "package_name": "iterable", "path": "iterable__users.sql", "original_file_path": "models/iterable__users.sql", "unique_id": "model.iterable.iterable__users", "fqn": ["iterable", "iterable__users"], "alias": "iterable__users", "checksum": {"name": "sha256", "checksum": "da23dacdef77d357083015551b25b1e1013e549ccea451e28820df44f3ac4f5a"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "table", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "Table that provides unique user enriched information.", "columns": {"source_relation": {"name": "source_relation", "description": "Identifies the record's source.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": ["doc.iterable.source_relation"]}, "unique_user_key": {"name": "unique_user_key", "description": "The unique identifier of the user. With the new schema (Aug 2023), it is the _fivetran_user_id. This is a hash of user_id and/or email, depending on project type. If using the old schema, it is email.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "_fivetran_user_id": {"name": "_fivetran_user_id", "description": "A Fivetran-created unique identifier for the new Iterable schema in Aug 2023, for users, derived from hashing user_id and/or email, depending on project type.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "email": {"name": "email", "description": "The user's email. User identifier, for email-based projects. Previously was the unique identifier for user records, for the old Iterable schema before the August 2023 updates.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "first_name": {"name": "first_name", "description": "First name of the user", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "last_name": {"name": "last_name", "description": "Last name of the user", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "user_id": {"name": "user_id", "description": "User identifier, for userID-based projects.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "signup_date": {"name": "signup_date", "description": "Timestamp of when the user signed up", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "signup_source": {"name": "signup_source", "description": "Source where the user signed up", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "updated_at": {"name": "updated_at", "description": "Last update timestamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "phone_number": {"name": "phone_number", "description": "Phone number associated with the user", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "email_list_ids": {"name": "email_list_ids", "description": "Array of all email lists associated with the user, derived from the list_user table relationships", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "count_lists": {"name": "count_lists", "description": "Total count of lists associated with the user", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "count_total_campaigns": {"name": "count_total_campaigns", "description": "Count of all campaigns the user has been in", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "first_event_at": {"name": "first_event_at", "description": "The first event the user ever encountered", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "last_event_at": {"name": "last_event_at", "description": "The most recent event the user has encountered", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_emailclick": {"name": "total_emailclick", "description": "Total number of email clicks the user has performed", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_emailunsubscribe": {"name": "total_emailunsubscribe", "description": "Total unsubscription events the user has performed", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_emailcomplaint": {"name": "total_emailcomplaint", "description": "Total email complaints the user has performed", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_customevent": {"name": "total_customevent", "description": "Total custom events associated with the user", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_emailsubscribe": {"name": "total_emailsubscribe", "description": "Total subscription events the user has performed", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_emailopen": {"name": "total_emailopen", "description": "Total email opened events the user has performed", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_pushsend": {"name": "total_pushsend", "description": "The push send events the user has experienced", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_smsbounce": {"name": "total_smsbounce", "description": "Total sms bounces that are associated with the user", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_pushbounce": {"name": "total_pushbounce", "description": "Total number of push bounces associated with the user", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_inappsendskip": {"name": "total_inappsendskip", "description": "Total in app send skips associated with the user", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_smssend": {"name": "total_smssend", "description": "Total sms sends that the user has experienced", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_inappsend": {"name": "total_inappsend", "description": "Total in app sends the user has experienced", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_pushopen": {"name": "total_pushopen", "description": "Total push messages the user has opened", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_emailsend": {"name": "total_emailsend", "description": "Total emails that have been sent to the user", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_pushsendskip": {"name": "total_pushsendskip", "description": "Total push sends the user has skipped", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_inappopen": {"name": "total_inappopen", "description": "Total in app opens the user has performed", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_emailsendskip": {"name": "total_emailsendskip", "description": "Total email sends the user has skipped", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_emailbounce": {"name": "total_emailbounce", "description": "Total number of emails that have bounced from the user", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_inappclick": {"name": "total_inappclick", "description": "Total in app clicks associated with the user", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_pushuninstall": {"name": "total_pushuninstall", "description": "Total push uninstall events the user has performed", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "iterable://models/iterable.yml", "build_path": null, "unrendered_config": {"materialized": "table", "schema": "iterable_{{ var('directed_schema','dev') }}", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789422569.7642653, "relation_name": "\"postgres\".\"public_iterable_dev\".\"iterable__users\"", "raw_code": "{% set passthrough_column_count = var('iterable_user_history_pass_through_columns') | length %}\n\nwith user_event_metrics as (\n\n select *\n from {{ ref('int_iterable__user_event_metrics') }}\n\n), list_users as (\n\n select *\n from {{ ref('stg_iterable__list_user') }}\n order by list_id -- so the list ids will aggregate in the right order\n\n), list_user_aggregated as (\n\n select\n source_relation,\n _fivetran_user_id,\n count(*) as count_lists,\n {{ dbt.concat([\"'['\", fivetran_utils.string_agg(field_to_agg=\"cast(list_id as \" ~ dbt.type_string() ~ \")\", delimiter=\"','\"), \"']'\"]) }} as email_list_ids\n from list_users\n group by 1, 2 \n\n), user_history_unnest as (\n -- this has all the user fields we're looking to pass through\n\n select *\n from {{ ref('int_iterable__list_user_unnest') }}\n\n -- limit to current lists they are a member of. each list-user combo is a unique row, which we will roll up\n where is_current\n\n), user_with_list_metrics as (\n\n select\n source_relation,\n user_id,\n _fivetran_user_id,\n unique_user_key,\n email,\n first_name,\n last_name,\n signup_date,\n signup_source,\n updated_at,\n phone_number,\n email_list_ids\n\n --The below script allows for pass through columns.\n {{ fivetran_utils.persist_pass_through_columns(pass_through_variable='iterable_user_history_pass_through_columns') }}\n\n , count(distinct list_id) as count_lists\n\n from user_history_unnest\n -- roll up to the user\n {{ dbt_utils.group_by(n = 12 + passthrough_column_count) }}\n\n), user_join as (\n\n select\n user_with_list_metrics.source_relation,\n user_with_list_metrics.user_id,\n user_with_list_metrics._fivetran_user_id,\n user_with_list_metrics.unique_user_key,\n user_with_list_metrics.email,\n user_with_list_metrics.first_name,\n user_with_list_metrics.last_name,\n user_with_list_metrics.signup_date,\n user_with_list_metrics.signup_source,\n user_with_list_metrics.updated_at,\n user_with_list_metrics.phone_number,\n coalesce(list_user_aggregated.email_list_ids, user_with_list_metrics.email_list_ids, '[]') as email_list_ids,\n coalesce(list_user_aggregated.count_lists, user_with_list_metrics.count_lists, 0) as count_lists,\n {{ dbt_utils.star(from=ref('int_iterable__user_event_metrics'), except=['source_relation','unique_user_key','_fivetran_user_id','user_id','user_email']) }}\n {{ fivetran_utils.persist_pass_through_columns(pass_through_variable='iterable_user_history_pass_through_columns', identifier='user_with_list_metrics') }}\n\n from user_with_list_metrics\n left join user_event_metrics\n on user_with_list_metrics.unique_user_key = user_event_metrics.unique_user_key\n and user_with_list_metrics.source_relation = user_event_metrics.source_relation\n left join list_user_aggregated\n -- use _fivetran_user_id since in list_user it is a primary key\n on user_with_list_metrics._fivetran_user_id = list_user_aggregated._fivetran_user_id\n and user_with_list_metrics.source_relation = list_user_aggregated.source_relation\n)\n\nselect *\nfrom user_join", "doc_blocks": [], "language": "sql", "refs": [{"name": "int_iterable__user_event_metrics", "package": null, "version": null}, {"name": "stg_iterable__list_user", "package": null, "version": null}, {"name": "int_iterable__list_user_unnest", "package": null, "version": null}, {"name": "int_iterable__user_event_metrics", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.type_string", "macro.fivetran_utils.string_agg", "macro.dbt.concat", "macro.fivetran_utils.persist_pass_through_columns", "macro.dbt_utils.group_by", "macro.dbt_utils.star"], "nodes": ["model.iterable.int_iterable__user_event_metrics", "model.iterable.stg_iterable__list_user", "model.iterable.int_iterable__list_user_unnest"]}, "compiled_path": "target/compiled/iterable/models/iterable__users.sql", "compiled": true, "compiled_code": "\n\nwith user_event_metrics as (\n\n select *\n from \"postgres\".\"public_iterable_dev\".\"int_iterable__user_event_metrics\"\n\n), list_users as (\n\n select *\n from \"postgres\".\"public_iterable_dev\".\"stg_iterable__list_user\"\n order by list_id -- so the list ids will aggregate in the right order\n\n), list_user_aggregated as (\n\n select\n source_relation,\n _fivetran_user_id,\n count(*) as count_lists,\n '[' || \n string_agg(cast(list_id as TEXT), ',')\n\n || ']' as email_list_ids\n from list_users\n group by 1, 2 \n\n), user_history_unnest as (\n -- this has all the user fields we're looking to pass through\n\n select *\n from \"postgres\".\"public_iterable_dev\".\"int_iterable__list_user_unnest\"\n\n -- limit to current lists they are a member of. each list-user combo is a unique row, which we will roll up\n where is_current\n\n), user_with_list_metrics as (\n\n select\n source_relation,\n user_id,\n _fivetran_user_id,\n unique_user_key,\n email,\n first_name,\n last_name,\n signup_date,\n signup_source,\n updated_at,\n phone_number,\n email_list_ids\n\n --The below script allows for pass through columns.\n \n\n\n\n\n\n , count(distinct list_id) as count_lists\n\n from user_history_unnest\n -- roll up to the user\n group by 1,2,3,4,5,6,7,8,9,10,11,12\n\n), user_join as (\n\n select\n user_with_list_metrics.source_relation,\n user_with_list_metrics.user_id,\n user_with_list_metrics._fivetran_user_id,\n user_with_list_metrics.unique_user_key,\n user_with_list_metrics.email,\n user_with_list_metrics.first_name,\n user_with_list_metrics.last_name,\n user_with_list_metrics.signup_date,\n user_with_list_metrics.signup_source,\n user_with_list_metrics.updated_at,\n user_with_list_metrics.phone_number,\n coalesce(list_user_aggregated.email_list_ids, user_with_list_metrics.email_list_ids, '[]') as email_list_ids,\n coalesce(list_user_aggregated.count_lists, user_with_list_metrics.count_lists, 0) as count_lists,\n \"count_total_campaigns\",\n \"first_event_at\",\n \"last_event_at\",\n \"total_emailclick\",\n \"total_emailunsubscribe\",\n \"total_emailcomplaint\",\n \"total_customevent\",\n \"total_emailsubscribe\",\n \"total_emailopen\",\n \"total_pushsend\",\n \"total_smsbounce\",\n \"total_pushbounce\",\n \"total_inappsendskip\",\n \"total_smssend\",\n \"total_inappsend\",\n \"total_pushopen\",\n \"total_emailsend\",\n \"total_pushsendskip\",\n \"total_inappopen\",\n \"total_emailsendskip\",\n \"total_emailbounce\",\n \"total_inappclick\",\n \"total_pushuninstall\"\n \n\n\n\n\n\n from user_with_list_metrics\n left join user_event_metrics\n on user_with_list_metrics.unique_user_key = user_event_metrics.unique_user_key\n and user_with_list_metrics.source_relation = user_event_metrics.source_relation\n left join list_user_aggregated\n -- use _fivetran_user_id since in list_user it is a primary key\n on user_with_list_metrics._fivetran_user_id = list_user_aggregated._fivetran_user_id\n and user_with_list_metrics.source_relation = list_user_aggregated.source_relation\n)\n\nselect *\nfrom user_join", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.iterable__list_user_history": {"database": "postgres", "schema": "public_iterable_dev", "name": "iterable__list_user_history", "resource_type": "model", "package_name": "iterable", "path": "iterable__list_user_history.sql", "original_file_path": "models/iterable__list_user_history.sql", "unique_id": "model.iterable.iterable__list_user_history", "fqn": ["iterable", "iterable__list_user_history"], "alias": "iterable__list_user_history", "checksum": {"name": "sha256", "checksum": "9c0778ad02c86e2145ba4189534ea1eabf07b41bb3aa414934fa554ae4af4e1c"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "table", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "Table that recreates the `list_user_history` source table. Additionally, this table provides an `is_current` field to identify the current lists associated with the user. The table coalesces list_id values from both the direct list_user relationships and the unnested email_list_ids from user history to ensure comprehensive list coverage. The grain of this table is at the user/list/updated_at level.\n", "columns": {"source_relation": {"name": "source_relation", "description": "Identifies the record's source.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": ["doc.iterable.source_relation"]}, "unique_user_key": {"name": "unique_user_key", "description": "The unique identifier of the user. With the new schema (Aug 2023), it is the _fivetran_user_id. This is a hash of user_id and/or email, depending on project type. If using the old schema, it is email.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "_fivetran_user_id": {"name": "_fivetran_user_id", "description": "A Fivetran-created unique identifier for the new Iterable schema in Aug 2023, for users, derived from hashing user_id and/or email, depending on project type.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "user_email": {"name": "user_email", "description": "Email of the user if it exists.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "user_first_name": {"name": "user_first_name", "description": "First name of the user", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "user_last_name": {"name": "user_last_name", "description": "Last name of the user", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "user_id": {"name": "user_id", "description": "User identifier, for userID-based projects.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "user_signup_date": {"name": "user_signup_date", "description": "Timestamp of when the user signed up", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "user_signup_source": {"name": "user_signup_source", "description": "Source where the user signed up", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "user_updated_at": {"name": "user_updated_at", "description": "Last update timestamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "list_id": {"name": "list_id", "description": "The list associated with the user. Uses coalesced values prioritizing `list_id` from `LIST_USER` over the unnested `email_list_ids` from `USER_HISTORY` for comprehensive list coverage.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "is_current": {"name": "is_current", "description": "Boolean indicating if the current list is active", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "list_name": {"name": "list_name", "description": "Name of the list associated with the user", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "list_type": {"name": "list_type", "description": "Type of list associated with the user", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "list_created_at": {"name": "list_created_at", "description": "Date the list was created", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "iterable://models/iterable.yml", "build_path": null, "unrendered_config": {"materialized": "table", "schema": "iterable_{{ var('directed_schema','dev') }}", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789422569.7549171, "relation_name": "\"postgres\".\"public_iterable_dev\".\"iterable__list_user_history\"", "raw_code": "with user_history_unnest as (\n\n select *\n from {{ ref('int_iterable__list_user_unnest') }}\n\n), list_users as (\n\n select *\n from {{ ref('stg_iterable__list_user') }}\n\n), lists as (\n\n select *\n from {{ ref('stg_iterable__list') }}\n\n), final as (\n select distinct\n user_history_unnest.source_relation,\n user_history_unnest.unique_user_key,\n user_history_unnest._fivetran_user_id,\n user_history_unnest.user_id,\n user_history_unnest.email as user_email,\n user_history_unnest.first_name as user_first_name,\n user_history_unnest.last_name as user_last_name,\n user_history_unnest.signup_date as user_signup_date,\n user_history_unnest.signup_source as user_signup_source,\n user_history_unnest.updated_at as user_updated_at,\n coalesce(list_users.list_id, user_history_unnest.list_id) as list_id,\n user_history_unnest.is_current,\n lists.list_name,\n lists.list_type,\n lists.created_at as list_created_at\n\n --The below script allows for pass through columns.\n {{ fivetran_utils.persist_pass_through_columns(pass_through_variable='iterable_user_history_pass_through_columns', identifier='user_history_unnest') }}\n\n from user_history_unnest\n left join list_users\n on list_users.source_relation = user_history_unnest.source_relation\n and list_users._fivetran_user_id = user_history_unnest._fivetran_user_id\n left join lists\n on lists.source_relation = user_history_unnest.source_relation\n and lists.list_id = coalesce(list_users.list_id, user_history_unnest.list_id)\n)\n\nselect *\nfrom final", "doc_blocks": [], "language": "sql", "refs": [{"name": "int_iterable__list_user_unnest", "package": null, "version": null}, {"name": "stg_iterable__list_user", "package": null, "version": null}, {"name": "stg_iterable__list", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.fivetran_utils.persist_pass_through_columns"], "nodes": ["model.iterable.int_iterable__list_user_unnest", "model.iterable.stg_iterable__list_user", "model.iterable.stg_iterable__list"]}, "compiled_path": "target/compiled/iterable/models/iterable__list_user_history.sql", "compiled": true, "compiled_code": "with user_history_unnest as (\n\n select *\n from \"postgres\".\"public_iterable_dev\".\"int_iterable__list_user_unnest\"\n\n), list_users as (\n\n select *\n from \"postgres\".\"public_iterable_dev\".\"stg_iterable__list_user\"\n\n), lists as (\n\n select *\n from \"postgres\".\"public_iterable_dev\".\"stg_iterable__list\"\n\n), final as (\n select distinct\n user_history_unnest.source_relation,\n user_history_unnest.unique_user_key,\n user_history_unnest._fivetran_user_id,\n user_history_unnest.user_id,\n user_history_unnest.email as user_email,\n user_history_unnest.first_name as user_first_name,\n user_history_unnest.last_name as user_last_name,\n user_history_unnest.signup_date as user_signup_date,\n user_history_unnest.signup_source as user_signup_source,\n user_history_unnest.updated_at as user_updated_at,\n coalesce(list_users.list_id, user_history_unnest.list_id) as list_id,\n user_history_unnest.is_current,\n lists.list_name,\n lists.list_type,\n lists.created_at as list_created_at\n\n --The below script allows for pass through columns.\n \n\n\n\n\n\n from user_history_unnest\n left join list_users\n on list_users.source_relation = user_history_unnest.source_relation\n and list_users._fivetran_user_id = user_history_unnest._fivetran_user_id\n left join lists\n on lists.source_relation = user_history_unnest.source_relation\n and lists.list_id = coalesce(list_users.list_id, user_history_unnest.list_id)\n)\n\nselect *\nfrom final", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.iterable__events": {"database": "postgres", "schema": "public_iterable_dev", "name": "iterable__events", "resource_type": "model", "package_name": "iterable", "path": "iterable__events.sql", "original_file_path": "models/iterable__events.sql", "unique_id": "model.iterable.iterable__events", "fqn": ["iterable", "iterable__events"], "alias": "iterable__events", "checksum": {"name": "sha256", "checksum": "d516cb05680b528ba689ac2a2e34bfee8bbd7ede3c7d8ccfea16a28232d39c44"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "incremental", "incremental_strategy": "delete+insert", "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": ["unique_event_id"], "on_schema_change": "fail", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}, "partition_by": {"field": "created_on", "data_type": "date"}, "file_format": "delta"}, "tags": [], "description": "Table that provides a comprehensive view of all events with enriched information such as the campaign, user effected, and template used.", "columns": {"source_relation": {"name": "source_relation", "description": "Identifies the record's source.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": ["doc.iterable.source_relation"]}, "event_id": {"name": "event_id", "description": "Unique id of the event generated by Fivetran", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_event_id": {"name": "unique_event_id", "description": "A unique surrogate key of event_id, _fivetran_user_id, and source_relation.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_user_key": {"name": "unique_user_key", "description": "The unique identifier of the user. With the new schema (Aug 2023), it is the _fivetran_user_id. This is a hash of user_id and/or email, depending on project type. If using the old schema, it is email.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "_fivetran_user_id": {"name": "_fivetran_user_id", "description": "A Fivetran-created unique identifier for the new Iterable schema in Aug 2023, for users, derived from hashing user_id and/or email, depending on project type.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "campaign_id": {"name": "campaign_id", "description": "Reference to the campaign from which the event originated", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "content_id": {"name": "content_id", "description": "Reference to the content the event is associated with", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "created_at": {"name": "created_at", "description": "Creation timestamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "email": {"name": "email", "description": "The user's email. User identifier, for email-based projects. Previously was the unique identifier for user records, for the old Iterable schema before the August 2023 updates.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "additional_properties": {"name": "additional_properties", "description": "json object containing addition event properties", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "event_name": {"name": "event_name", "description": "Name provided to the individual event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "message_bus_id": {"name": "message_bus_id", "description": "Reference to the message bus associated with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "message_id": {"name": "message_id", "description": "Reference to the message the event is associated with", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "message_type_id": {"name": "message_type_id", "description": "Reference to the type of message the event is associated with", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "recipient_state": {"name": "recipient_state", "description": "The state of the recipient upon receiving the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "status": {"name": "status", "description": "Status of the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "transactional_data": {"name": "transactional_data", "description": "Transactional data associated with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unsub_source": {"name": "unsub_source", "description": "Source of the unsubscribe event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "user_agent": {"name": "user_agent", "description": "User agent associated with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "user_agent_device": {"name": "user_agent_device", "description": "The device of the user agent", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "Timestamp of when the event record was synced by Fivetran", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "campaign_name": {"name": "campaign_name", "description": "The name of the campaign", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "campaign_type": {"name": "campaign_type", "description": "The type of campaign", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "is_campaign_recurring": {"name": "is_campaign_recurring", "description": "Boolean indicating if the campaign is recurrent", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "recurring_campaign_name": {"name": "recurring_campaign_name", "description": "The name of the recurring campaign (if applicable)", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "recurring_campaign_id": {"name": "recurring_campaign_id", "description": "The campaign if of the recurring campaign (if applicable)", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "user_id": {"name": "user_id", "description": "User identifier, for userID-based projects.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "user_full_name": {"name": "user_full_name", "description": "Full name of the user", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "message_type_name": {"name": "message_type_name", "description": "Name of the message type", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "message_medium": {"name": "message_medium", "description": "Medium of the message", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "channel_id": {"name": "channel_id", "description": "Unique identifier of the channel", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "channel_name": {"name": "channel_name", "description": "The channel name", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "channel_type": {"name": "channel_type", "description": "The type of channel", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "is_app_already_running": {"name": "is_app_already_running", "description": "Boolean indicating if the app is already running", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "badge": {"name": "badge", "description": "Badge associated with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "canonical_url_id": {"name": "canonical_url_id", "description": "Reference to the url associated with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "is_content_available": {"name": "is_content_available", "description": "Content available from the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "device": {"name": "device", "description": "The device associated with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "email_id": {"name": "email_id", "description": "Reference to the email associated with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "email_subject": {"name": "email_subject", "description": "Subject of the email associated with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "experiment_id": {"name": "experiment_id", "description": "Reference to the experiment used if the event is an experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "from_phone_number_id": {"name": "from_phone_number_id", "description": "Reference to the phone number which the event is from", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "from_smssender_id": {"name": "from_smssender_id", "description": "Reference to the sms sender which the event is from", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "link_id": {"name": "link_id", "description": "Reference to the link associated with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "link_url": {"name": "link_url", "description": "Url of the link associated with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "locale": {"name": "locale", "description": "Locale associated with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "payload": {"name": "payload", "description": "Payload resulted from the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "platform_endpoint": {"name": "platform_endpoint", "description": "The specific platform endpoint of the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "push_message": {"name": "push_message", "description": "Boolean indicating if the event is a push message", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "region": {"name": "region", "description": "Region of the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "sms_message": {"name": "sms_message", "description": "Boolean indicating if the event is an sms message", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "to_phone_number": {"name": "to_phone_number", "description": "To phone number associated with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "url": {"name": "url", "description": "Url associated with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "workflow_id": {"name": "workflow_id", "description": "Reference to the workflow which the event originated", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "workflow_name": {"name": "workflow_name", "description": "Name of the workflow which the event originated", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "catalog_collection_count": {"name": "catalog_collection_count", "description": "The count of products or items collected in a catalog associated with the event.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "catalog_lookup_count": {"name": "catalog_lookup_count", "description": "The count of times a catalog was looked up or queried during the event.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "template_id": {"name": "template_id", "description": "Unique identifier of the template", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "template_name": {"name": "template_name", "description": "User defined name of the template", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "template_creator_user_id": {"name": "template_creator_user_id", "description": "Reference to the user who created the template", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "created_on": {"name": "created_on", "description": "Day when the event was created", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "city": {"name": "city", "description": "The city associated with the event, which could be the location of the recipient.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "clicked_url": {"name": "clicked_url", "description": "The URL that was clicked by the recipient in response to the marketing message.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "country": {"name": "country", "description": "The country associated with the event, which could be the location of the recipient.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "error_code": {"name": "error_code", "description": "The error code or message indicating any issues or errors encountered during the event.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "expires_at": {"name": "expires_at", "description": "The date and time when the event or message is set to expire or become invalid.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "from_phone_number": {"name": "from_phone_number", "description": "The phone number from which the SMS message was sent.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "in_app_body": {"name": "in_app_body", "description": "The content or body of an in-app message that was sent as part of the event.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "is_sms_estimation": {"name": "is_sms_estimation", "description": "A boolean indicating whether the SMS message is an estimation or not.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "labels": {"name": "labels", "description": "Any labels or tags associated with the event, which can be used for categorization or organization.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "message_status": {"name": "message_status", "description": "The status of the marketing message, such as sent, delivered, opened, etc.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "mms_send_count": {"name": "mms_send_count", "description": "The count of multimedia messages (MMS) sent as part of the event.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "reason": {"name": "reason", "description": "The reason or cause associated with a specific event or action.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "sms_send_count": {"name": "sms_send_count", "description": "The count of SMS messages sent as part of the event.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "iterable://models/iterable.yml", "build_path": null, "unrendered_config": {"materialized": "incremental", "schema": "iterable_{{ var('directed_schema','dev') }}", "unique_key": "['unique_event_id']", "incremental_strategy": "CondExpr(test=Compare(expr=Getattr(node=Name(name='target', ctx='load'), attr='type', ctx='load'), ops=[Operand(op='in', expr=Tuple(items=[Const(value='bigquery'), Const(value='spark'), Const(value='databricks')], ctx='load'))]), expr1=Const(value='insert_overwrite'), expr2=Const(value='delete+insert'))", "partition_by": "CondExpr(test=Compare(expr=Getattr(node=Name(name='target', ctx='load'), attr='type', ctx='load'), ops=[Operand(op='notin', expr=Tuple(items=[Const(value='spark'), Const(value='databricks'), Const(value='duckdb')], ctx='load'))]), expr1=Dict(items=[Pair(key=Const(value='field'), value=Const(value='created_on')), Pair(key=Const(value='data_type'), value=Const(value='date'))]), expr2=List(items=[Const(value='created_on')]))", "file_format": "delta", "on_schema_change": "fail", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789422569.7414072, "relation_name": "\"postgres\".\"public_iterable_dev\".\"iterable__events\"", "raw_code": "{{ config(\n materialized='incremental',\n unique_key=['unique_event_id'],\n incremental_strategy='insert_overwrite' if target.type in ('bigquery', 'spark', 'databricks') else 'delete+insert',\n partition_by={\"field\": \"created_on\", \"data_type\": \"date\"} if target.type not in ('spark', 'databricks', 'duckdb') else ['created_on'],\n file_format='delta',\n on_schema_change='fail'\n ) \n}}\n\n{% set using_event_extension = var('iterable__using_event_extension', True) %}\n\nwith events as (\n\n select *\n from {{ ref('stg_iterable__event') }}\n\n {% if is_incremental() %}\n where created_on >= {{ iterable.iterable_lookback(\n from_date=\"max(created_on)\",\n datepart='day', \n interval=var('iterable_lookback_window', 7)) }}\n {% endif %}\n\n), campaign as (\n\n select *\n from {{ ref('int_iterable__recurring_campaigns') }}\n\n\n{% if using_event_extension %}\n), event_extension as (\n\n select *\n from {{ ref('stg_iterable__event_extension') }}\n{% endif %}\n\n), users as (\n\n select *\n from {{ ref('int_iterable__latest_user') }}\n\n), message_type_channel as (\n\n select *\n from {{ ref('int_iterable__message_type_channel') }}\n\n), template as (\n\n select *\n from {{ ref('int_iterable__latest_template') }}\n\n), event_join as (\n\n select \n events.*,\n campaign.campaign_name,\n campaign.campaign_type,\n campaign.is_campaign_recurring,\n campaign.recurring_campaign_name,\n campaign.recurring_campaign_id,\n\n users.user_id,\n users.first_name || ' ' || users.last_name as user_full_name,\n\n message_type_channel.message_type_name,\n message_type_channel.message_medium,\n message_type_channel.channel_id,\n message_type_channel.channel_name,\n message_type_channel.channel_type\n\n {% if using_event_extension %}\n {% set exclude_fields = [\"source_relation\", \"unique_user_key\",\"_fivetran_user_id\",\"event_id\", \"content_id\", \"_fivetran_synced\", \"unique_event_id\"] %}\n , {{ dbt_utils.star(from=ref('stg_iterable__event_extension'), except=exclude_fields, relation_alias=\"event_extension\") }}\n {% endif %}\n\n ,\n campaign.template_id,\n template.template_name,\n template.creator_user_id as template_creator_user_id\n \n from events\n\n {% if using_event_extension %}\n left join event_extension\n on events.unique_event_id = event_extension.unique_event_id\n and events.source_relation = event_extension.source_relation\n {% endif %}\n\n left join campaign\n on events.campaign_id = campaign.campaign_id\n and events.source_relation = campaign.source_relation\n left join users\n on events.unique_user_key = users.unique_user_key -- unique_user_key = _fivetran_user_id if exists, otherwise email\n and events.source_relation = users.source_relation\n left join message_type_channel\n on events.message_type_id = message_type_channel.message_type_id\n and events.source_relation = message_type_channel.source_relation\n left join template\n on campaign.template_id = template.template_id\n and events.source_relation = template.source_relation\n)\n\nselect *\nfrom event_join", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__event", "package": null, "version": null}, {"name": "int_iterable__recurring_campaigns", "package": null, "version": null}, {"name": "stg_iterable__event_extension", "package": null, "version": null}, {"name": "int_iterable__latest_user", "package": null, "version": null}, {"name": "int_iterable__message_type_channel", "package": null, "version": null}, {"name": "int_iterable__latest_template", "package": null, "version": null}, {"name": "stg_iterable__event_extension", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.is_incremental", "macro.dbt_utils.star", "macro.iterable.iterable_lookback"], "nodes": ["model.iterable.stg_iterable__event", "model.iterable.int_iterable__recurring_campaigns", "model.iterable.stg_iterable__event_extension", "model.iterable.int_iterable__latest_user", "model.iterable.int_iterable__message_type_channel", "model.iterable.int_iterable__latest_template"]}, "compiled_path": "target/compiled/iterable/models/iterable__events.sql", "compiled": true, "compiled_code": "\n\n\n\nwith events as (\n\n select *\n from \"postgres\".\"public_iterable_dev\".\"stg_iterable__event\"\n\n \n where created_on >= \n\n\n\n \n\n \n\n cast('2020-07-12' as date) + ((interval '1 day') * (-7))\n\n\n\n\n \n\n), campaign as (\n\n select *\n from \"postgres\".\"public_iterable_dev\".\"int_iterable__recurring_campaigns\"\n\n\n\n), event_extension as (\n\n select *\n from \"postgres\".\"public_iterable_dev\".\"stg_iterable__event_extension\"\n\n\n), users as (\n\n select *\n from \"postgres\".\"public_iterable_dev\".\"int_iterable__latest_user\"\n\n), message_type_channel as (\n\n select *\n from \"postgres\".\"public_iterable_dev\".\"int_iterable__message_type_channel\"\n\n), template as (\n\n select *\n from \"postgres\".\"public_iterable_dev\".\"int_iterable__latest_template\"\n\n), event_join as (\n\n select \n events.*,\n campaign.campaign_name,\n campaign.campaign_type,\n campaign.is_campaign_recurring,\n campaign.recurring_campaign_name,\n campaign.recurring_campaign_id,\n\n users.user_id,\n users.first_name || ' ' || users.last_name as user_full_name,\n\n message_type_channel.message_type_name,\n message_type_channel.message_medium,\n message_type_channel.channel_id,\n message_type_channel.channel_name,\n message_type_channel.channel_type\n\n \n \n , event_extension.\"is_app_already_running\",\n event_extension.\"badge\",\n event_extension.\"catalog_collection_count\",\n event_extension.\"catalog_lookup_count\",\n event_extension.\"canonical_url_id\",\n event_extension.\"is_content_available\",\n event_extension.\"device\",\n event_extension.\"email_id\",\n event_extension.\"email_subject\",\n event_extension.\"experiment_id\",\n event_extension.\"from_phone_number_id\",\n event_extension.\"from_smssender_id\",\n event_extension.\"link_id\",\n event_extension.\"link_url\",\n event_extension.\"locale\",\n event_extension.\"payload\",\n event_extension.\"platform_endpoint\",\n event_extension.\"push_message\",\n event_extension.\"region\",\n event_extension.\"sms_message\",\n event_extension.\"to_phone_number\",\n event_extension.\"url\",\n event_extension.\"workflow_id\",\n event_extension.\"workflow_name\",\n event_extension.\"city\",\n event_extension.\"clicked_url\",\n event_extension.\"country\",\n event_extension.\"error_code\",\n event_extension.\"expires_at\",\n event_extension.\"from_phone_number\",\n event_extension.\"in_app_body\",\n event_extension.\"is_sms_estimation\",\n event_extension.\"labels\",\n event_extension.\"message_status\",\n event_extension.\"mms_send_count\",\n event_extension.\"reason\",\n event_extension.\"sms_send_count\"\n \n\n ,\n campaign.template_id,\n template.template_name,\n template.creator_user_id as template_creator_user_id\n \n from events\n\n \n left join event_extension\n on events.unique_event_id = event_extension.unique_event_id\n and events.source_relation = event_extension.source_relation\n \n\n left join campaign\n on events.campaign_id = campaign.campaign_id\n and events.source_relation = campaign.source_relation\n left join users\n on events.unique_user_key = users.unique_user_key -- unique_user_key = _fivetran_user_id if exists, otherwise email\n and events.source_relation = users.source_relation\n left join message_type_channel\n on events.message_type_id = message_type_channel.message_type_id\n and events.source_relation = message_type_channel.source_relation\n left join template\n on campaign.template_id = template.template_id\n and events.source_relation = template.source_relation\n)\n\nselect *\nfrom event_join", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.iterable__user_campaign": {"database": "postgres", "schema": "public_iterable_dev", "name": "iterable__user_campaign", "resource_type": "model", "package_name": "iterable", "path": "iterable__user_campaign.sql", "original_file_path": "models/iterable__user_campaign.sql", "unique_id": "model.iterable.iterable__user_campaign", "fqn": ["iterable", "iterable__user_campaign"], "alias": "iterable__user_campaign", "checksum": {"name": "sha256", "checksum": "343ed0b8ab547da53812f4a8426cfd7b93f81ce3886680c4182a2596f1ea8632"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "table", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "Table that provides total and unique metrics for a user associated with particular campaigns and if available, experiments.", "columns": {"source_relation": {"name": "source_relation", "description": "Identifies the record's source.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": ["doc.iterable.source_relation"]}, "unique_user_campaign_id": {"name": "unique_user_campaign_id", "description": "Unique ID combining source_relation, unique_user_key, campaign_id, and if available, experiment_id.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "_fivetran_user_id": {"name": "_fivetran_user_id", "description": "A Fivetran-created unique identifier for the new Iterable schema in Aug 2023, for users, derived from hashing user_id and/or email, depending on project type.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_user_key": {"name": "unique_user_key", "description": "The unique identifier of the user. With the new schema (Aug 2023), it is the _fivetran_user_id. This is a hash of user_id and/or email, depending on project type. If using the old schema, it is email.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "user_id": {"name": "user_id", "description": "User identifier, for userID-based projects.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "user_email": {"name": "user_email", "description": "Email of the user if it exists.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "user_full_name": {"name": "user_full_name", "description": "The users first and last name", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "campaign_id": {"name": "campaign_id", "description": "The unique identifier of the campaign which the user metrics are associated", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "campaign_name": {"name": "campaign_name", "description": "The name of the campaign which the user metrics are associated", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "template_id": {"name": "template_id", "description": "The unique identifier of the template used within the campaign", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "template_name": {"name": "template_name", "description": "The name of the template used for the campaign", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "experiment_id": {"name": "experiment_id", "description": "The unique experiment variation of the campaign", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "recurring_campaign_id": {"name": "recurring_campaign_id", "description": "The unique identifier of the recurring campaign which the campaign is tied to", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "recurring_campaign_name": {"name": "recurring_campaign_name", "description": "The name of the recurring campaign which the campaign is tied to", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "first_event_at": {"name": "first_event_at", "description": "Timestamp of the first campaign/experiment event associated with the user", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "last_event_at": {"name": "last_event_at", "description": "Timestamp of the most recent campaign/experiment event associated with the user", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_emailclick": {"name": "total_emailclick", "description": "Total email clicks events the user took within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_emailunsubscribe": {"name": "total_emailunsubscribe", "description": "Total email unsubscription events the user performed within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_emailcomplaint": {"name": "total_emailcomplaint", "description": "Total email complaint events the user performed within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_customevent": {"name": "total_customevent", "description": "Total custom events associated with the user within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_emailsubscribe": {"name": "total_emailsubscribe", "description": "Total email subscription events associate with the user within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_emailopen": {"name": "total_emailopen", "description": "Total email open events the user performed within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_pushsend": {"name": "total_pushsend", "description": "Total push send events the user performed within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_smsbounce": {"name": "total_smsbounce", "description": "Total sms bounce events associated with the user within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_pushbounce": {"name": "total_pushbounce", "description": "Total push bounce events associated with the user within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_inappsendskip": {"name": "total_inappsendskip", "description": "Total in app send skip events the user performed within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_smssend": {"name": "total_smssend", "description": "Total sms send events associated with the user within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_inappsend": {"name": "total_inappsend", "description": "Total in app send events associated with the user within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_pushopen": {"name": "total_pushopen", "description": "Total push open events the user performed within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_emailsend": {"name": "total_emailsend", "description": "Total email send event associated with the user within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_pushsendskip": {"name": "total_pushsendskip", "description": "Total push send skip events associated with the user within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_inappopen": {"name": "total_inappopen", "description": "Total in app open events associated with the user within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_emailsendskip": {"name": "total_emailsendskip", "description": "Total email send skip events associated with the user within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_emailbounce": {"name": "total_emailbounce", "description": "Total email bounce events associated with the user within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_inappclick": {"name": "total_inappclick", "description": "Total in app click events associated with the user within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_pushuninstall": {"name": "total_pushuninstall", "description": "Total push uninstall events associated with the user within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "first_open_or_click_event_at": {"name": "first_open_or_click_event_at", "description": "The time of the first open or click time. This is the first time a user interacts with a campaign, recording the earliest occurring event out of 'emailOpen', 'emailClick', and 'pushOpen'.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "iterable://models/iterable.yml", "build_path": null, "unrendered_config": {"materialized": "table", "schema": "iterable_{{ var('directed_schema','dev') }}", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789422569.7579815, "relation_name": "\"postgres\".\"public_iterable_dev\".\"iterable__user_campaign\"", "raw_code": "{% set using_event_extension = var('iterable__using_event_extension', True) %}\n\nwith events as (\n\n select *\n from {{ ref('iterable__events') }}\n\n), pivot_out_events as (\n\n-- this will be at the user-campaign-experiment variation level\n-- if experiment_id is null, the user-campaign interactions happened outside of an experiment\n-- if campaign_id is null, the user interactions are organic\n select\n source_relation,\n _fivetran_user_id,\n unique_user_key,\n user_id,\n campaign_id,\n\n {{ \"experiment_id,\" if using_event_extension }}\n\n email as user_email,\n user_full_name,\n case when campaign_id is null then 'organic' else campaign_name end as campaign_name,\n template_id,\n template_name,\n\n recurring_campaign_id,\n recurring_campaign_name,\n\n min(created_at) as first_event_at,\n max(created_at) as last_event_at,\n min(case when event_name in ('emailOpen', 'emailClick', 'pushOpen') then created_at end) as first_open_or_click_event_at\n\n\n -- count up the number of instances of each metric\n -- `iterable__event_metrics` is set by default to all events brought in by fivetran+iterable\n -- https://fivetran.com/docs/applications/iterable#schemanotes\n {% for em in var('iterable__event_metrics') %}\n , sum(case when lower(event_name) = '{{ em | lower }}' then 1 else 0 end)\n as {{ 'total_' ~ em | replace(' ', '_') | replace('(', '') | replace(')', '') | lower }}\n {% endfor %}\n\n from events\n\n {{ dbt_utils.group_by(n=13 if using_event_extension else 12 ) }}\n\n), add_surrogate_key as (\n\n {% set surrogate_key_fields = ['source_relation', 'unique_user_key', 'campaign_id'] %}\n {% do surrogate_key_fields.append('experiment_id') if var('iterable__using_event_extension', True) %}\n\n select \n *,\n {{ dbt_utils.generate_surrogate_key(surrogate_key_fields) }} as unique_user_campaign_id\n\n from pivot_out_events\n)\n\nselect *\nfrom add_surrogate_key", "doc_blocks": [], "language": "sql", "refs": [{"name": "iterable__events", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt_utils.group_by", "macro.dbt_utils.generate_surrogate_key"], "nodes": ["model.iterable.iterable__events"]}, "compiled_path": "target/compiled/iterable/models/iterable__user_campaign.sql", "compiled": true, "compiled_code": "\n\nwith events as (\n\n select *\n from \"postgres\".\"public_iterable_dev\".\"iterable__events\"\n\n), pivot_out_events as (\n\n-- this will be at the user-campaign-experiment variation level\n-- if experiment_id is null, the user-campaign interactions happened outside of an experiment\n-- if campaign_id is null, the user interactions are organic\n select\n source_relation,\n _fivetran_user_id,\n unique_user_key,\n user_id,\n campaign_id,\n\n experiment_id,\n\n email as user_email,\n user_full_name,\n case when campaign_id is null then 'organic' else campaign_name end as campaign_name,\n template_id,\n template_name,\n\n recurring_campaign_id,\n recurring_campaign_name,\n\n min(created_at) as first_event_at,\n max(created_at) as last_event_at,\n min(case when event_name in ('emailOpen', 'emailClick', 'pushOpen') then created_at end) as first_open_or_click_event_at\n\n\n -- count up the number of instances of each metric\n -- `iterable__event_metrics` is set by default to all events brought in by fivetran+iterable\n -- https://fivetran.com/docs/applications/iterable#schemanotes\n \n , sum(case when lower(event_name) = 'emailclick' then 1 else 0 end)\n as total_emailclick\n \n , sum(case when lower(event_name) = 'emailunsubscribe' then 1 else 0 end)\n as total_emailunsubscribe\n \n , sum(case when lower(event_name) = 'emailcomplaint' then 1 else 0 end)\n as total_emailcomplaint\n \n , sum(case when lower(event_name) = 'customevent' then 1 else 0 end)\n as total_customevent\n \n , sum(case when lower(event_name) = 'emailsubscribe' then 1 else 0 end)\n as total_emailsubscribe\n \n , sum(case when lower(event_name) = 'emailopen' then 1 else 0 end)\n as total_emailopen\n \n , sum(case when lower(event_name) = 'pushsend' then 1 else 0 end)\n as total_pushsend\n \n , sum(case when lower(event_name) = 'smsbounce' then 1 else 0 end)\n as total_smsbounce\n \n , sum(case when lower(event_name) = 'pushbounce' then 1 else 0 end)\n as total_pushbounce\n \n , sum(case when lower(event_name) = 'inappsendskip' then 1 else 0 end)\n as total_inappsendskip\n \n , sum(case when lower(event_name) = 'smssend' then 1 else 0 end)\n as total_smssend\n \n , sum(case when lower(event_name) = 'inappsend' then 1 else 0 end)\n as total_inappsend\n \n , sum(case when lower(event_name) = 'pushopen' then 1 else 0 end)\n as total_pushopen\n \n , sum(case when lower(event_name) = 'emailsend' then 1 else 0 end)\n as total_emailsend\n \n , sum(case when lower(event_name) = 'pushsendskip' then 1 else 0 end)\n as total_pushsendskip\n \n , sum(case when lower(event_name) = 'inappopen' then 1 else 0 end)\n as total_inappopen\n \n , sum(case when lower(event_name) = 'emailsendskip' then 1 else 0 end)\n as total_emailsendskip\n \n , sum(case when lower(event_name) = 'emailbounce' then 1 else 0 end)\n as total_emailbounce\n \n , sum(case when lower(event_name) = 'inappclick' then 1 else 0 end)\n as total_inappclick\n \n , sum(case when lower(event_name) = 'pushuninstall' then 1 else 0 end)\n as total_pushuninstall\n \n\n from events\n\n group by 1,2,3,4,5,6,7,8,9,10,11,12,13\n\n), add_surrogate_key as (\n\n \n \n\n select \n *,\n md5(cast(coalesce(cast(source_relation as TEXT), '_dbt_utils_surrogate_key_null_') || '-' || coalesce(cast(unique_user_key as TEXT), '_dbt_utils_surrogate_key_null_') || '-' || coalesce(cast(campaign_id as TEXT), '_dbt_utils_surrogate_key_null_') || '-' || coalesce(cast(experiment_id as TEXT), '_dbt_utils_surrogate_key_null_') as TEXT)) as unique_user_campaign_id\n\n from pivot_out_events\n)\n\nselect *\nfrom add_surrogate_key", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.iterable__user_unsubscriptions": {"database": "postgres", "schema": "public_iterable_dev", "name": "iterable__user_unsubscriptions", "resource_type": "model", "package_name": "iterable", "path": "iterable__user_unsubscriptions.sql", "original_file_path": "models/iterable__user_unsubscriptions.sql", "unique_id": "model.iterable.iterable__user_unsubscriptions", "fqn": ["iterable", "iterable__user_unsubscriptions"], "alias": "iterable__user_unsubscriptions", "checksum": {"name": "sha256", "checksum": "9ffdcfb7996a2147cd7739fc5ac7a1bd2e0db91e0ffc76d1458f53046fc4598f"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "table", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "Table that generates the total channel and message types a user has chosen to unsubscribe.", "columns": {"source_relation": {"name": "source_relation", "description": "Identifies the record's source.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": ["doc.iterable.source_relation"]}, "_fivetran_user_id": {"name": "_fivetran_user_id", "description": "A Fivetran-created unique identifier for the new Iterable schema in Aug 2023, for users, derived from hashing user_id and/or email, depending on project type.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_user_key": {"name": "unique_user_key", "description": "The unique identifier of the user. With the new schema (Aug 2023), it is the _fivetran_user_id. This is a hash of user_id and/or email, depending on project type. If using the old schema, it is email.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "channel_id": {"name": "channel_id", "description": "Unique identifier of the channel which the user is unsubscribed", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "message_type_id": {"name": "message_type_id", "description": "Unique identifier of the message type which the user is unsubscribed", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "channel_name": {"name": "channel_name", "description": "The name of the channel which the user is unsubscribed", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "message_type_name": {"name": "message_type_name", "description": "The name of the message type which the user is unsubscribed", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "channel_type": {"name": "channel_type", "description": "The channel type which the user is unsubscribed", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "message_medium": {"name": "message_medium", "description": "The medium type the message was provided which the user is unsubscribed", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "updated_at": {"name": "updated_at", "description": "Timestamp of when the user unsubscribed from the channel or message type", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "is_unsubscribed_channel_wide": {"name": "is_unsubscribed_channel_wide", "description": "Boolean indicating if the user unsubscribed at the channel level (i.e. unsubscribed to all message types) or if they unsubscribed from only an individual message type.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "iterable://models/iterable.yml", "build_path": null, "unrendered_config": {"materialized": "table", "schema": "iterable_{{ var('directed_schema','dev') }}", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789422569.7595944, "relation_name": "\"postgres\".\"public_iterable_dev\".\"iterable__user_unsubscriptions\"", "raw_code": "{% set using_user_unsubscribed_message_type = var('iterable__using_user_unsubscribed_message_type', True) %}\n\nwith message_type_channel as (\n\n select *\n from {{ ref('int_iterable__message_type_channel') }}\n\n), user_unsubscribed_channel as (\n\n select\n *\n from {{ ref('stg_iterable__user_unsubscribed_channel') }}\n where latest_batch_index = 1\n\n{% if using_user_unsubscribed_message_type %}\n), user_unsubscribed_message_type as (\n\n select\n *\n from {{ ref('stg_iterable__user_unsub_message_type') }}\n where latest_batch_index = 1\n\n{% endif %}\n\n), combine as (\n\n select\n source_relation,\n _fivetran_user_id,\n unique_user_key,\n channel_id,\n cast(null as {{ dbt.type_string() }}) as message_type_id,\n updated_at\n from user_unsubscribed_channel\n\n{% if using_user_unsubscribed_message_type %}\n\n union all\n\n select\n source_relation,\n _fivetran_user_id,\n unique_user_key,\n cast(null as {{ dbt.type_string() }}) as channel_id,\n message_type_id,\n updated_at\n from user_unsubscribed_message_type\n{% endif %}\n\n), final as (\n\n select\n combine.source_relation,\n combine._fivetran_user_id,\n combine.unique_user_key,\n -- coalescing since message_type -> channel goes up a grain\n coalesce(combine.channel_id, message_type_channel.channel_id) as channel_id,\n coalesce(combine.message_type_id, message_type_channel.message_type_id) as message_type_id,\n combine.updated_at,\n message_type_channel.channel_name,\n message_type_channel.message_type_name,\n message_type_channel.channel_type,\n message_type_channel.message_medium,\n case when combine.channel_id is not null then true else false end as is_unsubscribed_channel_wide\n\n from combine\n\n -- unsubscribing from an entire channel unsubscribes a user from all message types in that channel\n join message_type_channel\n on combine.source_relation = message_type_channel.source_relation\n and (combine.channel_id = message_type_channel.channel_id\n or combine.message_type_id = message_type_channel.message_type_id)\n)\n\nselect *\nfrom final", "doc_blocks": [], "language": "sql", "refs": [{"name": "int_iterable__message_type_channel", "package": null, "version": null}, {"name": "stg_iterable__user_unsubscribed_channel", "package": null, "version": null}, {"name": "stg_iterable__user_unsub_message_type", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.type_string"], "nodes": ["model.iterable.int_iterable__message_type_channel", "model.iterable.stg_iterable__user_unsubscribed_channel", "model.iterable.stg_iterable__user_unsub_message_type"]}, "compiled_path": "target/compiled/iterable/models/iterable__user_unsubscriptions.sql", "compiled": true, "compiled_code": "\n\nwith message_type_channel as (\n\n select *\n from \"postgres\".\"public_iterable_dev\".\"int_iterable__message_type_channel\"\n\n), user_unsubscribed_channel as (\n\n select\n *\n from \"postgres\".\"public_iterable_dev\".\"stg_iterable__user_unsubscribed_channel\"\n where latest_batch_index = 1\n\n\n), user_unsubscribed_message_type as (\n\n select\n *\n from \"postgres\".\"public_iterable_dev\".\"stg_iterable__user_unsub_message_type\"\n where latest_batch_index = 1\n\n\n\n), combine as (\n\n select\n source_relation,\n _fivetran_user_id,\n unique_user_key,\n channel_id,\n cast(null as TEXT) as message_type_id,\n updated_at\n from user_unsubscribed_channel\n\n\n\n union all\n\n select\n source_relation,\n _fivetran_user_id,\n unique_user_key,\n cast(null as TEXT) as channel_id,\n message_type_id,\n updated_at\n from user_unsubscribed_message_type\n\n\n), final as (\n\n select\n combine.source_relation,\n combine._fivetran_user_id,\n combine.unique_user_key,\n -- coalescing since message_type -> channel goes up a grain\n coalesce(combine.channel_id, message_type_channel.channel_id) as channel_id,\n coalesce(combine.message_type_id, message_type_channel.message_type_id) as message_type_id,\n combine.updated_at,\n message_type_channel.channel_name,\n message_type_channel.message_type_name,\n message_type_channel.channel_type,\n message_type_channel.message_medium,\n case when combine.channel_id is not null then true else false end as is_unsubscribed_channel_wide\n\n from combine\n\n -- unsubscribing from an entire channel unsubscribes a user from all message types in that channel\n join message_type_channel\n on combine.source_relation = message_type_channel.source_relation\n and (combine.channel_id = message_type_channel.channel_id\n or combine.message_type_id = message_type_channel.message_type_id)\n)\n\nselect *\nfrom final", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.iterable__journeys": {"database": "postgres", "schema": "public_iterable_dev", "name": "iterable__journeys", "resource_type": "model", "package_name": "iterable", "path": "iterable__journeys.sql", "original_file_path": "models/iterable__journeys.sql", "unique_id": "model.iterable.iterable__journeys", "fqn": ["iterable", "iterable__journeys"], "alias": "iterable__journeys", "checksum": {"name": "sha256", "checksum": "cc93337c06625ef9675afae4540f52c2cb0cb78669a9a881f650742e8679380b"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "table", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "Table that provides aggregations for journeys, formerly known as workflows. Metrics are rolled up from the user/campaign grain via each campaign's journey reference. Journeys which generate no events, such as those that only split audiences or update user fields, are still included with null metrics. The grain of this table is one record per journey.\n", "columns": {"source_relation": {"name": "source_relation", "description": "Identifies the record's source.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": ["doc.iterable.source_relation"]}, "journey_id": {"name": "journey_id", "description": "Unique identifier of the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_journey_id": {"name": "unique_journey_id", "description": "Unique identifier combining journey_id and source_relation.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "journey_name": {"name": "journey_name", "description": "User defined name of the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "journey_type": {"name": "journey_type", "description": "The journey type", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "journey_description": {"name": "journey_description", "description": "Information about the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "creator_user_id": {"name": "creator_user_id", "description": "Reference to the user who created the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "is_enabled": {"name": "is_enabled", "description": "Boolean indicating if the journey is currently enabled", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "is_archived": {"name": "is_archived", "description": "Boolean indicating if the journey has been archived", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "lifetime_limit": {"name": "lifetime_limit", "description": "Maximum number of times a user may enter the journey over their lifetime", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "simultaneous_limit": {"name": "simultaneous_limit", "description": "Maximum number of times a user may be in the journey at the same time", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "start_tile_id": {"name": "start_tile_id", "description": "Reference to the tile which begins the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "trigger_event_names": {"name": "trigger_event_names", "description": "The event names which trigger a user's entry into the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "created_at": {"name": "created_at", "description": "Creation timestamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "updated_at": {"name": "updated_at", "description": "Last update timestamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "The time when a record was last updated by Fivetran.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": ["doc.iterable._fivetran_synced"]}, "count_total_campaigns": {"name": "count_total_campaigns", "description": "Count of distinct campaigns within the journey that generated events", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "count_unique_users": {"name": "count_unique_users", "description": "Count of total unique users within the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "first_event_at": {"name": "first_event_at", "description": "Timestamp of the first event generated by any campaign in the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "last_event_at": {"name": "last_event_at", "description": "Timestamp of the most recent event generated by any campaign in the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_emailclick": {"name": "total_emailclick", "description": "Total email clicks within the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_total_emailclick": {"name": "unique_total_emailclick", "description": "Count of distinct users with email clicks within the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_emailunsubscribe": {"name": "total_emailunsubscribe", "description": "Total email unsubscribe events within the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_total_emailunsubscribe": {"name": "unique_total_emailunsubscribe", "description": "Count of distinct users with email unsubscribe events within the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_emailcomplaint": {"name": "total_emailcomplaint", "description": "Total email complaints within the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_total_emailcomplaint": {"name": "unique_total_emailcomplaint", "description": "Count of distinct users with email complaints within the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_customevent": {"name": "total_customevent", "description": "Total custom events within the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_total_customevent": {"name": "unique_total_customevent", "description": "Count of distinct users with custom events within the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_emailsubscribe": {"name": "total_emailsubscribe", "description": "Total email subscribe events within the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_total_emailsubscribe": {"name": "unique_total_emailsubscribe", "description": "Count of distinct users with email subscribe events within the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_emailopen": {"name": "total_emailopen", "description": "Total email open events within the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_total_emailopen": {"name": "unique_total_emailopen", "description": "Count of distinct users with email open events within the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_pushsend": {"name": "total_pushsend", "description": "Total push send events within the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_total_pushsend": {"name": "unique_total_pushsend", "description": "Count of distinct users with push send events within the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_smsbounce": {"name": "total_smsbounce", "description": "Total sms bounce events within the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_total_smsbounce": {"name": "unique_total_smsbounce", "description": "Count of distinct users with sms bounce events within the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_pushbounce": {"name": "total_pushbounce", "description": "Total push bounce events within the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_total_pushbounce": {"name": "unique_total_pushbounce", "description": "Count of distinct users with push bounce events within the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_inappsendskip": {"name": "total_inappsendskip", "description": "Total in app send skip events within the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_total_inappsendskip": {"name": "unique_total_inappsendskip", "description": "Count of distinct users with in app send skip events within the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_smssend": {"name": "total_smssend", "description": "Total sms send events within the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_total_smssend": {"name": "unique_total_smssend", "description": "Count of distinct users with sms send events within the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_inappsend": {"name": "total_inappsend", "description": "Total in app send events within the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_total_inappsend": {"name": "unique_total_inappsend", "description": "Count of distinct users with in app send events within the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_pushopen": {"name": "total_pushopen", "description": "Total push open events within the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_total_pushopen": {"name": "unique_total_pushopen", "description": "Count of distinct users with push open events within the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_emailsend": {"name": "total_emailsend", "description": "Total email send events within the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_total_emailsend": {"name": "unique_total_emailsend", "description": "Count of distinct users with email send events within the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_pushsendskip": {"name": "total_pushsendskip", "description": "Total push send skip events within the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_total_pushsendskip": {"name": "unique_total_pushsendskip", "description": "Count of distinct users with push send skip events within the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_inappopen": {"name": "total_inappopen", "description": "Total in app open events within the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_total_inappopen": {"name": "unique_total_inappopen", "description": "Count of distinct users with in app open events within the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_emailsendskip": {"name": "total_emailsendskip", "description": "Total email send skip events within the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_total_emailsendskip": {"name": "unique_total_emailsendskip", "description": "Count of distinct users with email send skip events within the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_emailbounce": {"name": "total_emailbounce", "description": "Total email bounce events within the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_total_emailbounce": {"name": "unique_total_emailbounce", "description": "Count of distinct users with email bounce events within the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_inappclick": {"name": "total_inappclick", "description": "Total in app click events within the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_total_inappclick": {"name": "unique_total_inappclick", "description": "Count of distinct users with in app click events within the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_pushuninstall": {"name": "total_pushuninstall", "description": "Total push uninstall events within the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_total_pushuninstall": {"name": "unique_total_pushuninstall", "description": "Count of distinct users with push uninstall events within the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "iterable://models/iterable.yml", "build_path": null, "unrendered_config": {"materialized": "table", "schema": "iterable_{{ var('directed_schema','dev') }}", "enabled": "var('iterable__using_journey', True)", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789422569.7497828, "relation_name": "\"postgres\".\"public_iterable_dev\".\"iterable__journeys\"", "raw_code": "{{ config(enabled=var('iterable__using_journey', True)) }}\n\nwith journey as (\n\n select *\n from {{ ref('stg_iterable__journey') }}\n\n), journey_metrics as (\n\n select *\n from {{ ref('int_iterable__journey_event_metrics') }}\n\n), journey_join as (\n\n {% set exclude_fields = ['source_relation', 'journey_id'] %} -- these are in journey\n\n -- left join so journeys that generate no events, such as audience-splitting or\n -- field-update journeys, are still reported with null metrics\n select\n journey.*,\n {{ dbt_utils.star(from=ref('int_iterable__journey_event_metrics'), except=exclude_fields, relation_alias=\"journey_metrics\") }}\n\n from journey\n\n left join journey_metrics\n on journey.journey_id = journey_metrics.journey_id\n and journey.source_relation = journey_metrics.source_relation\n\n), add_surrogate_key as (\n\n {% set surrogate_key_fields = ['journey_id', 'source_relation'] %}\n\n select\n *,\n {{ dbt_utils.generate_surrogate_key(surrogate_key_fields) }} as unique_journey_id\n\n from journey_join\n)\n\nselect *\nfrom add_surrogate_key", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__journey", "package": null, "version": null}, {"name": "int_iterable__journey_event_metrics", "package": null, "version": null}, {"name": "int_iterable__journey_event_metrics", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt_utils.star", "macro.dbt_utils.generate_surrogate_key"], "nodes": ["model.iterable.stg_iterable__journey", "model.iterable.int_iterable__journey_event_metrics"]}, "compiled_path": "target/compiled/iterable/models/iterable__journeys.sql", "compiled": true, "compiled_code": "\n\nwith journey as (\n\n select *\n from \"postgres\".\"public_iterable_dev\".\"stg_iterable__journey\"\n\n), journey_metrics as (\n\n select *\n from \"postgres\".\"public_iterable_dev\".\"int_iterable__journey_event_metrics\"\n\n), journey_join as (\n\n -- these are in journey\n\n -- left join so journeys that generate no events, such as audience-splitting or\n -- field-update journeys, are still reported with null metrics\n select\n journey.*,\n journey_metrics.\"count_total_campaigns\",\n journey_metrics.\"count_unique_users\",\n journey_metrics.\"first_event_at\",\n journey_metrics.\"last_event_at\",\n journey_metrics.\"total_emailclick\",\n journey_metrics.\"unique_total_emailclick\",\n journey_metrics.\"total_emailunsubscribe\",\n journey_metrics.\"unique_total_emailunsubscribe\",\n journey_metrics.\"total_emailcomplaint\",\n journey_metrics.\"unique_total_emailcomplaint\",\n journey_metrics.\"total_customevent\",\n journey_metrics.\"unique_total_customevent\",\n journey_metrics.\"total_emailsubscribe\",\n journey_metrics.\"unique_total_emailsubscribe\",\n journey_metrics.\"total_emailopen\",\n journey_metrics.\"unique_total_emailopen\",\n journey_metrics.\"total_pushsend\",\n journey_metrics.\"unique_total_pushsend\",\n journey_metrics.\"total_smsbounce\",\n journey_metrics.\"unique_total_smsbounce\",\n journey_metrics.\"total_pushbounce\",\n journey_metrics.\"unique_total_pushbounce\",\n journey_metrics.\"total_inappsendskip\",\n journey_metrics.\"unique_total_inappsendskip\",\n journey_metrics.\"total_smssend\",\n journey_metrics.\"unique_total_smssend\",\n journey_metrics.\"total_inappsend\",\n journey_metrics.\"unique_total_inappsend\",\n journey_metrics.\"total_pushopen\",\n journey_metrics.\"unique_total_pushopen\",\n journey_metrics.\"total_emailsend\",\n journey_metrics.\"unique_total_emailsend\",\n journey_metrics.\"total_pushsendskip\",\n journey_metrics.\"unique_total_pushsendskip\",\n journey_metrics.\"total_inappopen\",\n journey_metrics.\"unique_total_inappopen\",\n journey_metrics.\"total_emailsendskip\",\n journey_metrics.\"unique_total_emailsendskip\",\n journey_metrics.\"total_emailbounce\",\n journey_metrics.\"unique_total_emailbounce\",\n journey_metrics.\"total_inappclick\",\n journey_metrics.\"unique_total_inappclick\",\n journey_metrics.\"total_pushuninstall\",\n journey_metrics.\"unique_total_pushuninstall\"\n\n from journey\n\n left join journey_metrics\n on journey.journey_id = journey_metrics.journey_id\n and journey.source_relation = journey_metrics.source_relation\n\n), add_surrogate_key as (\n\n \n\n select\n *,\n md5(cast(coalesce(cast(journey_id as TEXT), '_dbt_utils_surrogate_key_null_') || '-' || coalesce(cast(source_relation as TEXT), '_dbt_utils_surrogate_key_null_') as TEXT)) as unique_journey_id\n\n from journey_join\n)\n\nselect *\nfrom add_surrogate_key", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": ["unique_journey_id"], "time_spine": null}, "model.iterable.iterable__campaigns": {"database": "postgres", "schema": "public_iterable_dev", "name": "iterable__campaigns", "resource_type": "model", "package_name": "iterable", "path": "iterable__campaigns.sql", "original_file_path": "models/iterable__campaigns.sql", "unique_id": "model.iterable.iterable__campaigns", "fqn": ["iterable", "iterable__campaigns"], "alias": "iterable__campaigns", "checksum": {"name": "sha256", "checksum": "8a06f641cc3e4a6fcf53c1ff0571db0c9b0e7212a2a2ff5ea9111e035a96b0cc"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "table", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "Table that provides aggregations for campaigns at the template and if available, the experiment grain.", "columns": {"source_relation": {"name": "source_relation", "description": "Identifies the record's source.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": ["doc.iterable.source_relation"]}, "campaign_id": {"name": "campaign_id", "description": "Unique identifier of the campaign record", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_campaign_version_id": {"name": "unique_campaign_version_id", "description": "Unique identifier combining campaign_id, template_id, source_relation, and if available, experiment_id.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "campaign_name": {"name": "campaign_name", "description": "User defined name of the campaign.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "updated_at": {"name": "updated_at", "description": "Last update timestamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "campaign_state": {"name": "campaign_state", "description": "State of the campaign. Can be Draft, Ready, Scheduled, Running, Finished, Starting, Aborted or Recurring", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "campaign_type": {"name": "campaign_type", "description": "The campaign type. Can be Blast or Triggered", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "send_size": {"name": "send_size", "description": "Size of the campaign. Number of individuals included in the campaign", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "start_at": {"name": "start_at", "description": "Start timestamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "ended_at": {"name": "ended_at", "description": "Ended timestamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "created_at": {"name": "created_at", "description": "Creation timestamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "created_by_user_id": {"name": "created_by_user_id", "description": "Reference to the user who created the campaign", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "template_id": {"name": "template_id", "description": "Reference to the campaign template", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "recurring_campaign_id": {"name": "recurring_campaign_id", "description": "Unique identifier of the recurring campaign (if applicable)", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "recurring_campaign_name": {"name": "recurring_campaign_name", "description": "Name of the recurring campaign (if applicable)", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "recurring_campaign_state": {"name": "recurring_campaign_state", "description": "State of the recurring campaign (if applicable)", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "recurring_campaign_send_size": {"name": "recurring_campaign_send_size", "description": "Size of the recurring campaign. Number of individuals included in the recurring campaign (if applicable)", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "recurring_campaign_start_at": {"name": "recurring_campaign_start_at", "description": "Timestamp of when the recurring campaign started (if applicable)", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "is_campaign_recurring": {"name": "is_campaign_recurring", "description": "Boolean indicating if the campaign is a recurring campaign", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "experiment_id": {"name": "experiment_id", "description": "Reference to the experiment used if the event is an experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "count_unique_users": {"name": "count_unique_users", "description": "Count of total unique users within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_emailclick": {"name": "total_emailclick", "description": "Total email clicks within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_total_emailclick": {"name": "unique_total_emailclick", "description": "Unique email clicks within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_emailunsubscribe": {"name": "total_emailunsubscribe", "description": "Total email unsubscribe events within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_total_emailunsubscribe": {"name": "unique_total_emailunsubscribe", "description": "Unique total email unsubscribe events within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_emailcomplaint": {"name": "total_emailcomplaint", "description": "Total email complaints within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_total_emailcomplaint": {"name": "unique_total_emailcomplaint", "description": "Unique total email complaints within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_customevent": {"name": "total_customevent", "description": "Total custom events within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_total_customevent": {"name": "unique_total_customevent", "description": "Unique total custom events within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_emailsubscribe": {"name": "total_emailsubscribe", "description": "Total email subscribe events within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_total_emailsubscribe": {"name": "unique_total_emailsubscribe", "description": "Unique total email subscribe events within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_emailopen": {"name": "total_emailopen", "description": "Total email open events within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_total_emailopen": {"name": "unique_total_emailopen", "description": "Unique total email open events within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_pushsend": {"name": "total_pushsend", "description": "Total push send event within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_total_pushsend": {"name": "unique_total_pushsend", "description": "Unique total push send events within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_smsbounce": {"name": "total_smsbounce", "description": "Total sms bounce events within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_total_smsbounce": {"name": "unique_total_smsbounce", "description": "Unique total sms bounce events within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_pushbounce": {"name": "total_pushbounce", "description": "Total push bounce events within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_total_pushbounce": {"name": "unique_total_pushbounce", "description": "Unique total push bounce events within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_inappsendskip": {"name": "total_inappsendskip", "description": "Total in app send skip events within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_total_inappsendskip": {"name": "unique_total_inappsendskip", "description": "Unique total in app send skip events within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_smssend": {"name": "total_smssend", "description": "Total sms send events within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_total_smssend": {"name": "unique_total_smssend", "description": "Unique total sms send events within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_inappsend": {"name": "total_inappsend", "description": "Total in app send events within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_total_inappsend": {"name": "unique_total_inappsend", "description": "Unique total in app send events within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_pushopen": {"name": "total_pushopen", "description": "Total push open events within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_total_pushopen": {"name": "unique_total_pushopen", "description": "Unique total push open events within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_emailsend": {"name": "total_emailsend", "description": "Total email send events within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_total_emailsend": {"name": "unique_total_emailsend", "description": "Unique total email send events within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_pushsendskip": {"name": "total_pushsendskip", "description": "Total push send skip events within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_total_pushsendskip": {"name": "unique_total_pushsendskip", "description": "Unique total push send skip events within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_inappopen": {"name": "total_inappopen", "description": "Total in app open events within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_total_inappopen": {"name": "unique_total_inappopen", "description": "Unique total in app open events within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_emailsendskip": {"name": "total_emailsendskip", "description": "Total email send skip events within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_total_emailsendskip": {"name": "unique_total_emailsendskip", "description": "Unique total email send skip events within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_emailbounce": {"name": "total_emailbounce", "description": "Total email bounce events within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_total_emailbounce": {"name": "unique_total_emailbounce", "description": "Unique total email bounce events within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_inappclick": {"name": "total_inappclick", "description": "Total in app click events within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_total_inappclick": {"name": "unique_total_inappclick", "description": "Unique total in app click events within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_pushuninstall": {"name": "total_pushuninstall", "description": "Total push uninstall events within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_total_pushuninstall": {"name": "unique_total_pushuninstall", "description": "Unique total push uninstall events within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "count_send_lists": {"name": "count_send_lists", "description": "Count of send lists within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "count_suppress_lists": {"name": "count_suppress_lists", "description": "Count of suppress lists within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "labels": {"name": "labels", "description": "List of labels associated with the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "journey_id": {"name": "journey_id", "description": "Reference to the journey the campaign belongs to, if applicable", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "journey_name": {"name": "journey_name", "description": "User defined name of the journey the campaign belongs to, if applicable", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "journey_type": {"name": "journey_type", "description": "The type of the journey the campaign belongs to, if applicable", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "template_name": {"name": "template_name", "description": "Name of the template associated with the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "template_creator_user_id": {"name": "template_creator_user_id", "description": "The creator user id of the template associated with the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "message_medium": {"name": "message_medium", "description": "The medium which the message was provided", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "message_type_name": {"name": "message_type_name", "description": "The message type name associated with the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "channel_name": {"name": "channel_name", "description": "The channel name associated with the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "channel_id": {"name": "channel_id", "description": "The channel identifier associated with the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "channel_type": {"name": "channel_type", "description": "The channel type associated with the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "iterable://models/iterable.yml", "build_path": null, "unrendered_config": {"materialized": "table", "schema": "iterable_{{ var('directed_schema','dev') }}", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789422569.7191765, "relation_name": "\"postgres\".\"public_iterable_dev\".\"iterable__campaigns\"", "raw_code": "with campaign_event_metrics as (\n\n select *\n from {{ ref('int_iterable__campaign_event_metrics') }}\n\n), campaign_list_metrics as (\n\n select\n source_relation,\n campaign_id,\n sum(case when list_activity = 'send' then 1 else 0 end) as count_send_lists,\n sum(case when list_activity = 'suppress' then 1 else 0 end) as count_suppress_lists\n\n from {{ ref('int_iterable__campaign_lists') }}\n {{ dbt_utils.group_by(n=2) }}\n\n), campaign as (\n\n select *\n from {{ ref('int_iterable__recurring_campaigns') }}\n \n{% if var('iterable__using_campaign_label_history', true) %}\n), campaign_labels as (\n\n select *\n from {{ ref('int_iterable__campaign_labels') }}\n\n{% endif %}\n\n), template as (\n -- rebringing this in (it is brought in iterable__events) in case any campaigns don't have events yet\n -- this will result in some DAG ugliness but maintains template info for non-sent campaigns\n select *\n from {{ ref('int_iterable__latest_template') }}\n\n{% if var('iterable__using_journey', true) %}\n), journey as (\n\n select *\n from {{ ref('stg_iterable__journey') }}\n\n{% endif %}\n\n), campaign_join as (\n\n {% set exclude_fields = ['source_relation', 'campaign_id', 'template_id'] %} -- these are in campaigns\n\n -- this query will be at the campaign and experiment(if available) variation grain\n select\n campaign.*,\n {{ dbt_utils.star(from=ref('int_iterable__campaign_event_metrics'), except=exclude_fields, relation_alias=\"campaign_event_metrics\") }}\n , \n campaign_list_metrics.count_send_lists,\n campaign_list_metrics.count_suppress_lists,\n {% if var('iterable__using_campaign_label_history', true) %}\n campaign_labels.labels,\n {% endif %}\n {% if var('iterable__using_journey', true) %}\n journey.journey_name,\n journey.journey_type,\n {% endif %}\n template.template_name,\n template.creator_user_id as template_creator_user_id,\n template.message_medium,\n template.message_type_name,\n template.channel_name,\n template.channel_id,\n template.channel_type\n\n from campaign\n left join campaign_event_metrics\n on campaign.campaign_id = campaign_event_metrics.campaign_id\n and campaign.template_id = campaign_event_metrics.template_id\n and campaign.source_relation = campaign_event_metrics.source_relation\n left join campaign_list_metrics\n on campaign.campaign_id = campaign_list_metrics.campaign_id\n and campaign.source_relation = campaign_list_metrics.source_relation\n\n {% if var('iterable__using_campaign_label_history', true) %}\n left join campaign_labels\n on campaign.campaign_id = campaign_labels.campaign_id\n and campaign.source_relation = campaign_labels.source_relation\n {% endif %}\n\n left join template\n on campaign.template_id = template.template_id\n and campaign.source_relation = template.source_relation\n\n {% if var('iterable__using_journey', true) %}\n left join journey\n on campaign.journey_id = journey.journey_id\n and campaign.source_relation = journey.source_relation\n {% endif %}\n\n), add_surrogate_key as (\n\n {% set surrogate_key_fields = ['campaign_id', 'template_id', 'source_relation'] %}\n {% do surrogate_key_fields.append('experiment_id') if var('iterable__using_event_extension', True) %}\n\n select \n *,\n {{ dbt_utils.generate_surrogate_key(surrogate_key_fields) }} as unique_campaign_version_id\n\n from campaign_join\n)\n\nselect *\nfrom add_surrogate_key", "doc_blocks": [], "language": "sql", "refs": [{"name": "int_iterable__campaign_event_metrics", "package": null, "version": null}, {"name": "int_iterable__campaign_lists", "package": null, "version": null}, {"name": "int_iterable__recurring_campaigns", "package": null, "version": null}, {"name": "int_iterable__campaign_labels", "package": null, "version": null}, {"name": "int_iterable__latest_template", "package": null, "version": null}, {"name": "stg_iterable__journey", "package": null, "version": null}, {"name": "int_iterable__campaign_event_metrics", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt_utils.group_by", "macro.dbt_utils.star", "macro.dbt_utils.generate_surrogate_key"], "nodes": ["model.iterable.int_iterable__campaign_event_metrics", "model.iterable.int_iterable__campaign_lists", "model.iterable.int_iterable__recurring_campaigns", "model.iterable.int_iterable__campaign_labels", "model.iterable.int_iterable__latest_template", "model.iterable.stg_iterable__journey"]}, "compiled_path": "target/compiled/iterable/models/iterable__campaigns.sql", "compiled": true, "compiled_code": "with campaign_event_metrics as (\n\n select *\n from \"postgres\".\"public_iterable_dev\".\"int_iterable__campaign_event_metrics\"\n\n), campaign_list_metrics as (\n\n select\n source_relation,\n campaign_id,\n sum(case when list_activity = 'send' then 1 else 0 end) as count_send_lists,\n sum(case when list_activity = 'suppress' then 1 else 0 end) as count_suppress_lists\n\n from \"postgres\".\"public_iterable_dev\".\"int_iterable__campaign_lists\"\n group by 1,2\n\n), campaign as (\n\n select *\n from \"postgres\".\"public_iterable_dev\".\"int_iterable__recurring_campaigns\"\n \n\n), campaign_labels as (\n\n select *\n from \"postgres\".\"public_iterable_dev\".\"int_iterable__campaign_labels\"\n\n\n\n), template as (\n -- rebringing this in (it is brought in iterable__events) in case any campaigns don't have events yet\n -- this will result in some DAG ugliness but maintains template info for non-sent campaigns\n select *\n from \"postgres\".\"public_iterable_dev\".\"int_iterable__latest_template\"\n\n\n), journey as (\n\n select *\n from \"postgres\".\"public_iterable_dev\".\"stg_iterable__journey\"\n\n\n\n), campaign_join as (\n\n -- these are in campaigns\n\n -- this query will be at the campaign and experiment(if available) variation grain\n select\n campaign.*,\n campaign_event_metrics.\"experiment_id\",\n campaign_event_metrics.\"count_unique_users\",\n campaign_event_metrics.\"total_emailclick\",\n campaign_event_metrics.\"unique_total_emailclick\",\n campaign_event_metrics.\"total_emailunsubscribe\",\n campaign_event_metrics.\"unique_total_emailunsubscribe\",\n campaign_event_metrics.\"total_emailcomplaint\",\n campaign_event_metrics.\"unique_total_emailcomplaint\",\n campaign_event_metrics.\"total_customevent\",\n campaign_event_metrics.\"unique_total_customevent\",\n campaign_event_metrics.\"total_emailsubscribe\",\n campaign_event_metrics.\"unique_total_emailsubscribe\",\n campaign_event_metrics.\"total_emailopen\",\n campaign_event_metrics.\"unique_total_emailopen\",\n campaign_event_metrics.\"total_pushsend\",\n campaign_event_metrics.\"unique_total_pushsend\",\n campaign_event_metrics.\"total_smsbounce\",\n campaign_event_metrics.\"unique_total_smsbounce\",\n campaign_event_metrics.\"total_pushbounce\",\n campaign_event_metrics.\"unique_total_pushbounce\",\n campaign_event_metrics.\"total_inappsendskip\",\n campaign_event_metrics.\"unique_total_inappsendskip\",\n campaign_event_metrics.\"total_smssend\",\n campaign_event_metrics.\"unique_total_smssend\",\n campaign_event_metrics.\"total_inappsend\",\n campaign_event_metrics.\"unique_total_inappsend\",\n campaign_event_metrics.\"total_pushopen\",\n campaign_event_metrics.\"unique_total_pushopen\",\n campaign_event_metrics.\"total_emailsend\",\n campaign_event_metrics.\"unique_total_emailsend\",\n campaign_event_metrics.\"total_pushsendskip\",\n campaign_event_metrics.\"unique_total_pushsendskip\",\n campaign_event_metrics.\"total_inappopen\",\n campaign_event_metrics.\"unique_total_inappopen\",\n campaign_event_metrics.\"total_emailsendskip\",\n campaign_event_metrics.\"unique_total_emailsendskip\",\n campaign_event_metrics.\"total_emailbounce\",\n campaign_event_metrics.\"unique_total_emailbounce\",\n campaign_event_metrics.\"total_inappclick\",\n campaign_event_metrics.\"unique_total_inappclick\",\n campaign_event_metrics.\"total_pushuninstall\",\n campaign_event_metrics.\"unique_total_pushuninstall\"\n , \n campaign_list_metrics.count_send_lists,\n campaign_list_metrics.count_suppress_lists,\n \n campaign_labels.labels,\n \n \n journey.journey_name,\n journey.journey_type,\n \n template.template_name,\n template.creator_user_id as template_creator_user_id,\n template.message_medium,\n template.message_type_name,\n template.channel_name,\n template.channel_id,\n template.channel_type\n\n from campaign\n left join campaign_event_metrics\n on campaign.campaign_id = campaign_event_metrics.campaign_id\n and campaign.template_id = campaign_event_metrics.template_id\n and campaign.source_relation = campaign_event_metrics.source_relation\n left join campaign_list_metrics\n on campaign.campaign_id = campaign_list_metrics.campaign_id\n and campaign.source_relation = campaign_list_metrics.source_relation\n\n \n left join campaign_labels\n on campaign.campaign_id = campaign_labels.campaign_id\n and campaign.source_relation = campaign_labels.source_relation\n \n\n left join template\n on campaign.template_id = template.template_id\n and campaign.source_relation = template.source_relation\n\n \n left join journey\n on campaign.journey_id = journey.journey_id\n and campaign.source_relation = journey.source_relation\n \n\n), add_surrogate_key as (\n\n \n \n\n select \n *,\n md5(cast(coalesce(cast(campaign_id as TEXT), '_dbt_utils_surrogate_key_null_') || '-' || coalesce(cast(template_id as TEXT), '_dbt_utils_surrogate_key_null_') || '-' || coalesce(cast(source_relation as TEXT), '_dbt_utils_surrogate_key_null_') || '-' || coalesce(cast(experiment_id as TEXT), '_dbt_utils_surrogate_key_null_') as TEXT)) as unique_campaign_version_id\n\n from campaign_join\n)\n\nselect *\nfrom add_surrogate_key", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.int_iterable__campaign_labels": {"database": "postgres", "schema": "public_iterable_dev", "name": "int_iterable__campaign_labels", "resource_type": "model", "package_name": "iterable", "path": "intermediate/int_iterable__campaign_labels.sql", "original_file_path": "models/intermediate/int_iterable__campaign_labels.sql", "unique_id": "model.iterable.int_iterable__campaign_labels", "fqn": ["iterable", "intermediate", "int_iterable__campaign_labels"], "alias": "int_iterable__campaign_labels", "checksum": {"name": "sha256", "checksum": "64ae8d410bd6673399326348a650a7facc7b6631aa34fbb01a1598cb96c7d012"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "Table that provides the distinct string aggregation of labels for each campaign.", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "iterable://models/intermediate/int_iterable.yml", "build_path": null, "unrendered_config": {"materialized": "view", "schema": "iterable_{{ var('directed_schema','dev') }}", "enabled": "var('iterable__using_campaign_label_history', True)", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789422569.8883388, "relation_name": "\"postgres\".\"public_iterable_dev\".\"int_iterable__campaign_labels\"", "raw_code": "{{ config(enabled=var('iterable__using_campaign_label_history', True)) }}\n\nwith campaign_label_history as (\n\n select *\n from {{ ref('stg_iterable__campaign_label_history') }}\n\n), order_campaign_labels as (\n\n select \n *,\n rank() over(partition by campaign_id{{ fivetran_utils.partition_by_source_relation(package_name='iterable') }} order by updated_at desc) as latest_label_batch_index\n\n from campaign_label_history\n\n), latest_labels as (\n\n select *\n from order_campaign_labels\n where latest_label_batch_index = 1\n\n), aggregate_labels as (\n\n select\n source_relation,\n campaign_id,\n {{ fivetran_utils.string_agg('distinct label', \"', '\") }} as labels\n\n from latest_labels\n {{ dbt_utils.group_by(n=2) }}\n)\n\nselect * from aggregate_labels", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__campaign_label_history", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.fivetran_utils.partition_by_source_relation", "macro.fivetran_utils.string_agg", "macro.dbt_utils.group_by"], "nodes": ["model.iterable.stg_iterable__campaign_label_history"]}, "compiled_path": "target/compiled/iterable/models/intermediate/int_iterable__campaign_labels.sql", "compiled": true, "compiled_code": "\n\nwith campaign_label_history as (\n\n select *\n from \"postgres\".\"public_iterable_dev\".\"stg_iterable__campaign_label_history\"\n\n), order_campaign_labels as (\n\n select \n *,\n rank() over(partition by campaign_id order by updated_at desc) as latest_label_batch_index\n\n from campaign_label_history\n\n), latest_labels as (\n\n select *\n from order_campaign_labels\n where latest_label_batch_index = 1\n\n), aggregate_labels as (\n\n select\n source_relation,\n campaign_id,\n \n string_agg(distinct label, ', ')\n\n as labels\n\n from latest_labels\n group by 1,2\n)\n\nselect * from aggregate_labels", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.int_iterable__journey_event_metrics": {"database": "postgres", "schema": "public_iterable_dev", "name": "int_iterable__journey_event_metrics", "resource_type": "model", "package_name": "iterable", "path": "intermediate/int_iterable__journey_event_metrics.sql", "original_file_path": "models/intermediate/int_iterable__journey_event_metrics.sql", "unique_id": "model.iterable.int_iterable__journey_event_metrics", "fqn": ["iterable", "intermediate", "int_iterable__journey_event_metrics"], "alias": "int_iterable__journey_event_metrics", "checksum": {"name": "sha256", "checksum": "bfde0156d4c1044ca7bc2993a11f34370dba3692b6d75b001ed4a9ba799b38b4"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "Table that generates relevant total and unique journey level aggregations, rolled up from the user/campaign grain via the campaign's journey reference.", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "iterable://models/intermediate/int_iterable.yml", "build_path": null, "unrendered_config": {"materialized": "view", "schema": "iterable_{{ var('directed_schema','dev') }}", "enabled": "var('iterable__using_journey', True)", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789422569.8893602, "relation_name": "\"postgres\".\"public_iterable_dev\".\"int_iterable__journey_event_metrics\"", "raw_code": "{{ config(enabled=var('iterable__using_journey', True)) }}\n\nwith user_campaign as (\n select *\n from {{ ref('iterable__user_campaign') }}\n\n), campaign as (\n\n select\n source_relation,\n campaign_id,\n journey_id\n\n from {{ ref('int_iterable__recurring_campaigns') }}\n where journey_id is not null\n\n), journey_event_metrics as (\n{%- set user_campaign_columns = adapter.get_columns_in_relation(ref('iterable__user_campaign')) %}\n{%- set non_agg_columns = ['source_relation', 'unique_user_key', 'user_id', '_fivetran_user_id',\n 'user_email', 'user_full_name', 'campaign_id', 'campaign_name', 'recurring_campaign_id',\n 'recurring_campaign_name', 'first_event_at', 'last_event_at', 'template_id', 'template_name',\n 'experiment_id', 'unique_user_campaign_id', 'first_open_or_click_event_at'\n ] %}\n\n select\n campaign.source_relation,\n campaign.journey_id,\n count(distinct user_campaign.campaign_id) as count_total_campaigns,\n count(distinct user_campaign.unique_user_key) as count_unique_users,\n min(user_campaign.first_event_at) as first_event_at,\n max(user_campaign.last_event_at) as last_event_at\n {% for col in user_campaign_columns if col.name|lower not in non_agg_columns %}\n , sum(user_campaign.{{ col.name }}) as {{ col.name }}\n -- counts distinct users; campaign_event_metrics counts distinct emails\n , count(distinct case when user_campaign.{{ col.name }} > 0 then user_campaign.unique_user_key else null end) as unique_{{ col.name }}\n {% endfor %}\n\n from user_campaign\n\n inner join campaign\n on user_campaign.campaign_id = campaign.campaign_id\n and user_campaign.source_relation = campaign.source_relation\n\n {{ dbt_utils.group_by(n=2) }}\n)\n\nselect *\nfrom journey_event_metrics", "doc_blocks": [], "language": "sql", "refs": [{"name": "iterable__user_campaign", "package": null, "version": null}, {"name": "int_iterable__recurring_campaigns", "package": null, "version": null}, {"name": "iterable__user_campaign", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt_utils.group_by"], "nodes": ["model.iterable.iterable__user_campaign", "model.iterable.int_iterable__recurring_campaigns"]}, "compiled_path": "target/compiled/iterable/models/intermediate/int_iterable__journey_event_metrics.sql", "compiled": true, "compiled_code": "\n\nwith user_campaign as (\n select *\n from \"postgres\".\"public_iterable_dev\".\"iterable__user_campaign\"\n\n), campaign as (\n\n select\n source_relation,\n campaign_id,\n journey_id\n\n from \"postgres\".\"public_iterable_dev\".\"int_iterable__recurring_campaigns\"\n where journey_id is not null\n\n), journey_event_metrics as (\n\n select\n campaign.source_relation,\n campaign.journey_id,\n count(distinct user_campaign.campaign_id) as count_total_campaigns,\n count(distinct user_campaign.unique_user_key) as count_unique_users,\n min(user_campaign.first_event_at) as first_event_at,\n max(user_campaign.last_event_at) as last_event_at\n \n , sum(user_campaign.total_emailclick) as total_emailclick\n -- counts distinct users; campaign_event_metrics counts distinct emails\n , count(distinct case when user_campaign.total_emailclick > 0 then user_campaign.unique_user_key else null end) as unique_total_emailclick\n \n , sum(user_campaign.total_emailunsubscribe) as total_emailunsubscribe\n -- counts distinct users; campaign_event_metrics counts distinct emails\n , count(distinct case when user_campaign.total_emailunsubscribe > 0 then user_campaign.unique_user_key else null end) as unique_total_emailunsubscribe\n \n , sum(user_campaign.total_emailcomplaint) as total_emailcomplaint\n -- counts distinct users; campaign_event_metrics counts distinct emails\n , count(distinct case when user_campaign.total_emailcomplaint > 0 then user_campaign.unique_user_key else null end) as unique_total_emailcomplaint\n \n , sum(user_campaign.total_customevent) as total_customevent\n -- counts distinct users; campaign_event_metrics counts distinct emails\n , count(distinct case when user_campaign.total_customevent > 0 then user_campaign.unique_user_key else null end) as unique_total_customevent\n \n , sum(user_campaign.total_emailsubscribe) as total_emailsubscribe\n -- counts distinct users; campaign_event_metrics counts distinct emails\n , count(distinct case when user_campaign.total_emailsubscribe > 0 then user_campaign.unique_user_key else null end) as unique_total_emailsubscribe\n \n , sum(user_campaign.total_emailopen) as total_emailopen\n -- counts distinct users; campaign_event_metrics counts distinct emails\n , count(distinct case when user_campaign.total_emailopen > 0 then user_campaign.unique_user_key else null end) as unique_total_emailopen\n \n , sum(user_campaign.total_pushsend) as total_pushsend\n -- counts distinct users; campaign_event_metrics counts distinct emails\n , count(distinct case when user_campaign.total_pushsend > 0 then user_campaign.unique_user_key else null end) as unique_total_pushsend\n \n , sum(user_campaign.total_smsbounce) as total_smsbounce\n -- counts distinct users; campaign_event_metrics counts distinct emails\n , count(distinct case when user_campaign.total_smsbounce > 0 then user_campaign.unique_user_key else null end) as unique_total_smsbounce\n \n , sum(user_campaign.total_pushbounce) as total_pushbounce\n -- counts distinct users; campaign_event_metrics counts distinct emails\n , count(distinct case when user_campaign.total_pushbounce > 0 then user_campaign.unique_user_key else null end) as unique_total_pushbounce\n \n , sum(user_campaign.total_inappsendskip) as total_inappsendskip\n -- counts distinct users; campaign_event_metrics counts distinct emails\n , count(distinct case when user_campaign.total_inappsendskip > 0 then user_campaign.unique_user_key else null end) as unique_total_inappsendskip\n \n , sum(user_campaign.total_smssend) as total_smssend\n -- counts distinct users; campaign_event_metrics counts distinct emails\n , count(distinct case when user_campaign.total_smssend > 0 then user_campaign.unique_user_key else null end) as unique_total_smssend\n \n , sum(user_campaign.total_inappsend) as total_inappsend\n -- counts distinct users; campaign_event_metrics counts distinct emails\n , count(distinct case when user_campaign.total_inappsend > 0 then user_campaign.unique_user_key else null end) as unique_total_inappsend\n \n , sum(user_campaign.total_pushopen) as total_pushopen\n -- counts distinct users; campaign_event_metrics counts distinct emails\n , count(distinct case when user_campaign.total_pushopen > 0 then user_campaign.unique_user_key else null end) as unique_total_pushopen\n \n , sum(user_campaign.total_emailsend) as total_emailsend\n -- counts distinct users; campaign_event_metrics counts distinct emails\n , count(distinct case when user_campaign.total_emailsend > 0 then user_campaign.unique_user_key else null end) as unique_total_emailsend\n \n , sum(user_campaign.total_pushsendskip) as total_pushsendskip\n -- counts distinct users; campaign_event_metrics counts distinct emails\n , count(distinct case when user_campaign.total_pushsendskip > 0 then user_campaign.unique_user_key else null end) as unique_total_pushsendskip\n \n , sum(user_campaign.total_inappopen) as total_inappopen\n -- counts distinct users; campaign_event_metrics counts distinct emails\n , count(distinct case when user_campaign.total_inappopen > 0 then user_campaign.unique_user_key else null end) as unique_total_inappopen\n \n , sum(user_campaign.total_emailsendskip) as total_emailsendskip\n -- counts distinct users; campaign_event_metrics counts distinct emails\n , count(distinct case when user_campaign.total_emailsendskip > 0 then user_campaign.unique_user_key else null end) as unique_total_emailsendskip\n \n , sum(user_campaign.total_emailbounce) as total_emailbounce\n -- counts distinct users; campaign_event_metrics counts distinct emails\n , count(distinct case when user_campaign.total_emailbounce > 0 then user_campaign.unique_user_key else null end) as unique_total_emailbounce\n \n , sum(user_campaign.total_inappclick) as total_inappclick\n -- counts distinct users; campaign_event_metrics counts distinct emails\n , count(distinct case when user_campaign.total_inappclick > 0 then user_campaign.unique_user_key else null end) as unique_total_inappclick\n \n , sum(user_campaign.total_pushuninstall) as total_pushuninstall\n -- counts distinct users; campaign_event_metrics counts distinct emails\n , count(distinct case when user_campaign.total_pushuninstall > 0 then user_campaign.unique_user_key else null end) as unique_total_pushuninstall\n \n\n from user_campaign\n\n inner join campaign\n on user_campaign.campaign_id = campaign.campaign_id\n and user_campaign.source_relation = campaign.source_relation\n\n group by 1,2\n)\n\nselect *\nfrom journey_event_metrics", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.int_iterable__list_user_unnest": {"database": "postgres", "schema": "public_iterable_dev", "name": "int_iterable__list_user_unnest", "resource_type": "model", "package_name": "iterable", "path": "intermediate/int_iterable__list_user_unnest.sql", "original_file_path": "models/intermediate/int_iterable__list_user_unnest.sql", "unique_id": "model.iterable.int_iterable__list_user_unnest", "fqn": ["iterable", "intermediate", "int_iterable__list_user_unnest"], "alias": "int_iterable__list_user_unnest", "checksum": {"name": "sha256", "checksum": "82ec833586106f02efef7fe24516f3323171e61f1083323e97c892f21ddfa263"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "incremental", "incremental_strategy": "delete+insert", "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": "unique_key", "on_schema_change": "fail", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}, "partition_by": {"field": "date_day", "data_type": "date"}, "file_format": "delta"}, "tags": [], "description": "Table that unnests the `email_list_id` field for each user to create a new record for each user and the unique list it was associated with at a unique update. Due to the unnesting functions varying greatly between warehouses, conditional logic is applied throughout the model to appropriately accommodate the model being ran within Redshift, Snowflake, BigQuery, and Postgres.\n", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "iterable://models/intermediate/int_iterable.yml", "build_path": null, "unrendered_config": {"materialized": "incremental", "schema": "iterable_{{ var('directed_schema','dev') }}", "unique_key": "unique_key", "incremental_strategy": "CondExpr(test=Compare(expr=Getattr(node=Name(name='target', ctx='load'), attr='type', ctx='load'), ops=[Operand(op='in', expr=Tuple(items=[Const(value='bigquery'), Const(value='spark'), Const(value='databricks')], ctx='load'))]), expr1=Const(value='insert_overwrite'), expr2=Const(value='delete+insert'))", "partition_by": "CondExpr(test=Compare(expr=Getattr(node=Name(name='target', ctx='load'), attr='type', ctx='load'), ops=[Operand(op='notin', expr=Tuple(items=[Const(value='spark'), Const(value='databricks'), Const(value='duckdb')], ctx='load'))]), expr1=Dict(items=[Pair(key=Const(value='field'), value=Const(value='date_day')), Pair(key=Const(value='data_type'), value=Const(value='date'))]), expr2=List(items=[Const(value='date_day')]))", "file_format": "delta", "on_schema_change": "fail", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789422569.891922, "relation_name": "\"postgres\".\"public_iterable_dev\".\"int_iterable__list_user_unnest\"", "raw_code": "{{ config(\n materialized='incremental',\n unique_key='unique_key',\n incremental_strategy='insert_overwrite' if target.type in ('bigquery', 'spark', 'databricks') else 'delete+insert',\n partition_by={\"field\": \"date_day\", \"data_type\": \"date\"} if target.type not in ('spark', 'databricks', 'duckdb') else ['date_day'],\n file_format='delta',\n on_schema_change='fail'\n )\n}}\n\nwith user_history as (\n\n select *\n from {{ ref('int_iterable__list_user_history') }} as user_history\n\n {% if is_incremental() %}\n {# the only rows we potentially want to overwrite are active ones #}\n where user_history.updated_at >= coalesce((select min(updated_at) from {{ this }} where is_current), '2010-01-01')\n {% endif %}\n\n{% if target.type == 'redshift' %}\n{# using PartiQL syntax to work with redshift's SUPER types #}\n), redshift_parse_email_lists as (\n\n select\n source_relation,\n _fivetran_user_id,\n unique_user_key,\n email,\n first_name,\n last_name,\n user_id,\n signup_date,\n signup_source,\n phone_number,\n updated_at,\n is_current,\n email_list_ids,\n {# let's not remove empty array-rows #}\n json_parse(case when email_list_ids = '[]' then '[\"is_null\"]' else email_list_ids end) as super_email_list_ids\n\n --The below script allows for pass through columns.\n {{ fivetran_utils.persist_pass_through_columns(pass_through_variable='iterable_user_history_pass_through_columns', identifier='user_history') }}\n\n from user_history\n\n), unnest_email_array as (\n\n select\n source_relation,\n _fivetran_user_id,\n unique_user_key,\n email,\n first_name,\n last_name,\n user_id,\n signup_date,\n signup_source,\n phone_number,\n updated_at,\n is_current,\n {# go back to strings #}\n cast(email_list_ids as {{ dbt.type_string() }}) as email_list_ids,\n cast(email_list_id as {{ dbt.type_string() }}) as email_list_id\n\n --The below script allows for pass through columns.\n {{ fivetran_utils.persist_pass_through_columns(pass_through_variable='iterable_user_history_pass_through_columns', identifier='emails') }}\n\n from redshift_parse_email_lists as emails, emails.super_email_list_ids as email_list_id\n\n{% else %}\n), unnest_email_array as (\n\n select\n source_relation,\n _fivetran_user_id,\n unique_user_key,\n email,\n first_name,\n last_name,\n user_id,\n signup_date,\n signup_source,\n phone_number,\n updated_at,\n is_current,\n email_list_ids,\n case when email_list_ids != '[]' then\n {% if target.type == 'snowflake' %}\n email_list_id.value\n {% elif target.type in ('spark','databricks') %}\n email_list_id.col\n {% else %} email_list_id {% endif %}\n else null\n end as email_list_id\n\n --The below script allows for pass through columns.\n {{ fivetran_utils.persist_pass_through_columns(pass_through_variable='iterable_user_history_pass_through_columns', identifier='user_history') }}\n\n from user_history\n\n {% if target.type == 'snowflake' %}\n cross join\n table(flatten(input => parse_json(\n case when email_list_ids = '[]' then '[\"is_null\"]' {# to not remove empty array-rows #}\n else email_list_ids end))) as email_list_id\n {% elif target.type == 'bigquery' %}\n cross join\n unnest(JSON_EXTRACT_STRING_ARRAY(\n case when email_list_ids = '[]' then '[\"is_null\"]' {# to not remove empty array-rows #}\n else email_list_ids end)) as email_list_id\n {% elif target.type in ('spark','databricks') %}\n cross join\n lateral explode_outer(from_json(\n case when email_list_ids = '[]' then '[\"is_null\"]' {# to not remove empty array-rows #}\n else email_list_ids end, 'array')) as email_list_id\n {% elif target.type == 'duckdb' %}\n cross join\n unnest(from_json(cast((\n case when email_list_ids = '[]' then '[\"is_null\"]' {# to not remove empty array-rows #}\n else email_list_ids end) as varchar), '[\"VARCHAR\"]')) as t(email_list_id)\n {% else %} {# target is postgres #}\n cross join\n json_array_elements_text(cast((\n case when email_list_ids = '[]' then '[\"is_null\"]' {# to not remove empty array-rows #}\n else email_list_ids end) as json)) as email_list_id\n {%- endif %}\n\n{%- endif -%}\n), adjust_nulls as (\n\n select\n source_relation,\n _fivetran_user_id,\n unique_user_key,\n email,\n first_name,\n last_name,\n user_id,\n signup_date,\n signup_source,\n updated_at,\n phone_number,\n is_current,\n case when email_list_ids = '[\"is_null\"]' then '[]' else email_list_ids end as email_list_ids,\n cast(NULLIF(email_list_id, 'is_null') as {{ dbt.type_int() }}) as list_id\n\n --The below script allows for pass through columns.\n {{ fivetran_utils.persist_pass_through_columns(pass_through_variable='iterable_user_history_pass_through_columns', identifier='unnest_email_array') }}\n\n from unnest_email_array\n\n), final as (\n\n select\n source_relation,\n _fivetran_user_id,\n unique_user_key,\n user_id,\n email,\n first_name,\n last_name,\n signup_date,\n signup_source,\n updated_at,\n phone_number,\n is_current,\n email_list_ids,\n list_id,\n {{ dbt_utils.generate_surrogate_key([\"source_relation\", \"unique_user_key\", \"list_id\", \"updated_at\"]) }} as unique_key,\n cast( {{ dbt.date_trunc('day', 'updated_at') }} as date) as date_day\n\n --The below script allows for pass through columns.\n {{ fivetran_utils.persist_pass_through_columns(pass_through_variable='iterable_user_history_pass_through_columns', identifier='adjust_nulls') }}\n\n from adjust_nulls\n)\n\nselect *\nfrom final", "doc_blocks": [], "language": "sql", "refs": [{"name": "int_iterable__list_user_history", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.is_incremental", "macro.fivetran_utils.persist_pass_through_columns", "macro.dbt.type_int", "macro.dbt_utils.generate_surrogate_key", "macro.dbt.date_trunc"], "nodes": ["model.iterable.int_iterable__list_user_history"]}, "compiled_path": "target/compiled/iterable/models/intermediate/int_iterable__list_user_unnest.sql", "compiled": true, "compiled_code": "\n\nwith user_history as (\n\n select *\n from \"postgres\".\"public_iterable_dev\".\"int_iterable__list_user_history\" as user_history\n\n \n \n where user_history.updated_at >= coalesce((select min(updated_at) from \"postgres\".\"public_iterable_dev\".\"int_iterable__list_user_unnest\" where is_current), '2010-01-01')\n \n\n\n), unnest_email_array as (\n\n select\n source_relation,\n _fivetran_user_id,\n unique_user_key,\n email,\n first_name,\n last_name,\n user_id,\n signup_date,\n signup_source,\n phone_number,\n updated_at,\n is_current,\n email_list_ids,\n case when email_list_ids != '[]' then\n email_list_id \n else null\n end as email_list_id\n\n --The below script allows for pass through columns.\n \n\n\n\n\n\n from user_history\n\n \n cross join\n json_array_elements_text(cast((\n case when email_list_ids = '[]' then '[\"is_null\"]' \n else email_list_ids end) as json)) as email_list_id), adjust_nulls as (\n\n select\n source_relation,\n _fivetran_user_id,\n unique_user_key,\n email,\n first_name,\n last_name,\n user_id,\n signup_date,\n signup_source,\n updated_at,\n phone_number,\n is_current,\n case when email_list_ids = '[\"is_null\"]' then '[]' else email_list_ids end as email_list_ids,\n cast(NULLIF(email_list_id, 'is_null') as integer) as list_id\n\n --The below script allows for pass through columns.\n \n\n\n\n\n\n from unnest_email_array\n\n), final as (\n\n select\n source_relation,\n _fivetran_user_id,\n unique_user_key,\n user_id,\n email,\n first_name,\n last_name,\n signup_date,\n signup_source,\n updated_at,\n phone_number,\n is_current,\n email_list_ids,\n list_id,\n md5(cast(coalesce(cast(source_relation as TEXT), '_dbt_utils_surrogate_key_null_') || '-' || coalesce(cast(unique_user_key as TEXT), '_dbt_utils_surrogate_key_null_') || '-' || coalesce(cast(list_id as TEXT), '_dbt_utils_surrogate_key_null_') || '-' || coalesce(cast(updated_at as TEXT), '_dbt_utils_surrogate_key_null_') as TEXT)) as unique_key,\n cast( date_trunc('day', updated_at) as date) as date_day\n\n --The below script allows for pass through columns.\n \n\n\n\n\n\n from adjust_nulls\n)\n\nselect *\nfrom final", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.int_iterable__latest_template": {"database": "postgres", "schema": "public_iterable_dev", "name": "int_iterable__latest_template", "resource_type": "model", "package_name": "iterable", "path": "intermediate/int_iterable__latest_template.sql", "original_file_path": "models/intermediate/int_iterable__latest_template.sql", "unique_id": "model.iterable.int_iterable__latest_template", "fqn": ["iterable", "intermediate", "int_iterable__latest_template"], "alias": "int_iterable__latest_template", "checksum": {"name": "sha256", "checksum": "44d385d803b47bd9be4b5bfc6d78b88689e9c113d478ba8feb96f91717f45b3b"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "Table that provides the most recent version of the template as well as joining relevant message type information.", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "iterable://models/intermediate/int_iterable.yml", "build_path": null, "unrendered_config": {"materialized": "view", "schema": "iterable_{{ var('directed_schema','dev') }}", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789422569.8904047, "relation_name": "\"postgres\".\"public_iterable_dev\".\"int_iterable__latest_template\"", "raw_code": "with template_history as (\n select *\n from {{ ref('stg_iterable__template_history') }}\n\n), order_template as (\n select\n *,\n row_number() over(partition by template_id{{ fivetran_utils.partition_by_source_relation(package_name='iterable') }} order by updated_at desc) as latest_template_index\n from template_history\n\n), latest_template as (\n\n select *\n from order_template\n where latest_template_index = 1\n\n), message_type_channel as (\n\n select *\n from {{ ref('int_iterable__message_type_channel') }}\n\n), template_join as (\n\n select \n latest_template.*,\n message_type_channel.message_type_name,\n message_type_channel.channel_id,\n message_type_channel.channel_name,\n message_type_channel.channel_type,\n message_type_channel.message_medium\n\n from latest_template \n left join message_type_channel\n on latest_template.message_type_id = message_type_channel.message_type_id\n and latest_template.source_relation = message_type_channel.source_relation\n)\n\nselect *\nfrom template_join", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__template_history", "package": null, "version": null}, {"name": "int_iterable__message_type_channel", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.fivetran_utils.partition_by_source_relation"], "nodes": ["model.iterable.stg_iterable__template_history", "model.iterable.int_iterable__message_type_channel"]}, "compiled_path": "target/compiled/iterable/models/intermediate/int_iterable__latest_template.sql", "compiled": true, "compiled_code": "with template_history as (\n select *\n from \"postgres\".\"public_iterable_dev\".\"stg_iterable__template_history\"\n\n), order_template as (\n select\n *,\n row_number() over(partition by template_id order by updated_at desc) as latest_template_index\n from template_history\n\n), latest_template as (\n\n select *\n from order_template\n where latest_template_index = 1\n\n), message_type_channel as (\n\n select *\n from \"postgres\".\"public_iterable_dev\".\"int_iterable__message_type_channel\"\n\n), template_join as (\n\n select \n latest_template.*,\n message_type_channel.message_type_name,\n message_type_channel.channel_id,\n message_type_channel.channel_name,\n message_type_channel.channel_type,\n message_type_channel.message_medium\n\n from latest_template \n left join message_type_channel\n on latest_template.message_type_id = message_type_channel.message_type_id\n and latest_template.source_relation = message_type_channel.source_relation\n)\n\nselect *\nfrom template_join", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.int_iterable__campaign_event_metrics": {"database": "postgres", "schema": "public_iterable_dev", "name": "int_iterable__campaign_event_metrics", "resource_type": "model", "package_name": "iterable", "path": "intermediate/int_iterable__campaign_event_metrics.sql", "original_file_path": "models/intermediate/int_iterable__campaign_event_metrics.sql", "unique_id": "model.iterable.int_iterable__campaign_event_metrics", "fqn": ["iterable", "intermediate", "int_iterable__campaign_event_metrics"], "alias": "int_iterable__campaign_event_metrics", "checksum": {"name": "sha256", "checksum": "81038e93b6f7f8151fb0d719780a87ebc5bd95b613431564e7c470121a174e26"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "Table that generates relevant total and unique campaign/experiment level aggregations.", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "iterable://models/intermediate/int_iterable.yml", "build_path": null, "unrendered_config": {"materialized": "view", "schema": "iterable_{{ var('directed_schema','dev') }}", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789422569.8877943, "relation_name": "\"postgres\".\"public_iterable_dev\".\"int_iterable__campaign_event_metrics\"", "raw_code": "with user_campaign as (\n select *\n from {{ ref('iterable__user_campaign') }}\n\n), campaign_user_event_metrics as (\n{%- set using_event_extension = var('iterable__using_event_extension', True) %}\n{%- set user_campaign_columns = adapter.get_columns_in_relation(ref('iterable__user_campaign')) %}\n{%- set non_agg_columns = ['source_relation', 'unique_user_key', 'user_id', '_fivetran_user_id', \n 'user_email', 'user_full_name', 'campaign_id', 'campaign_name', 'recurring_campaign_id', \n 'recurring_campaign_name', 'first_event_at', 'last_event_at', 'template_id', 'template_name', \n 'experiment_id', 'unique_user_campaign_id', 'first_open_or_click_event_at'\n ] %}\n\n select\n source_relation,\n campaign_id,\n template_id\n {{ \", experiment_id\" if using_event_extension }}\n , count(distinct unique_user_key) as count_unique_users\n {% for col in user_campaign_columns if col.name|lower not in non_agg_columns %}\n , sum({{ col.name }}) as {{ col.name }}\n , count(distinct case when {{ col.name }} > 0 then user_email else null end) as unique_{{ col.name }}\n {% endfor %}\n \n from user_campaign\n \n {{ dbt_utils.group_by(n=4 if using_event_extension else 3) }}\n)\n\nselect *\nfrom campaign_user_event_metrics", "doc_blocks": [], "language": "sql", "refs": [{"name": "iterable__user_campaign", "package": null, "version": null}, {"name": "iterable__user_campaign", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt_utils.group_by"], "nodes": ["model.iterable.iterable__user_campaign"]}, "compiled_path": "target/compiled/iterable/models/intermediate/int_iterable__campaign_event_metrics.sql", "compiled": true, "compiled_code": "with user_campaign as (\n select *\n from \"postgres\".\"public_iterable_dev\".\"iterable__user_campaign\"\n\n), campaign_user_event_metrics as (\n\n select\n source_relation,\n campaign_id,\n template_id\n , experiment_id\n , count(distinct unique_user_key) as count_unique_users\n \n , sum(total_emailclick) as total_emailclick\n , count(distinct case when total_emailclick > 0 then user_email else null end) as unique_total_emailclick\n \n , sum(total_emailunsubscribe) as total_emailunsubscribe\n , count(distinct case when total_emailunsubscribe > 0 then user_email else null end) as unique_total_emailunsubscribe\n \n , sum(total_emailcomplaint) as total_emailcomplaint\n , count(distinct case when total_emailcomplaint > 0 then user_email else null end) as unique_total_emailcomplaint\n \n , sum(total_customevent) as total_customevent\n , count(distinct case when total_customevent > 0 then user_email else null end) as unique_total_customevent\n \n , sum(total_emailsubscribe) as total_emailsubscribe\n , count(distinct case when total_emailsubscribe > 0 then user_email else null end) as unique_total_emailsubscribe\n \n , sum(total_emailopen) as total_emailopen\n , count(distinct case when total_emailopen > 0 then user_email else null end) as unique_total_emailopen\n \n , sum(total_pushsend) as total_pushsend\n , count(distinct case when total_pushsend > 0 then user_email else null end) as unique_total_pushsend\n \n , sum(total_smsbounce) as total_smsbounce\n , count(distinct case when total_smsbounce > 0 then user_email else null end) as unique_total_smsbounce\n \n , sum(total_pushbounce) as total_pushbounce\n , count(distinct case when total_pushbounce > 0 then user_email else null end) as unique_total_pushbounce\n \n , sum(total_inappsendskip) as total_inappsendskip\n , count(distinct case when total_inappsendskip > 0 then user_email else null end) as unique_total_inappsendskip\n \n , sum(total_smssend) as total_smssend\n , count(distinct case when total_smssend > 0 then user_email else null end) as unique_total_smssend\n \n , sum(total_inappsend) as total_inappsend\n , count(distinct case when total_inappsend > 0 then user_email else null end) as unique_total_inappsend\n \n , sum(total_pushopen) as total_pushopen\n , count(distinct case when total_pushopen > 0 then user_email else null end) as unique_total_pushopen\n \n , sum(total_emailsend) as total_emailsend\n , count(distinct case when total_emailsend > 0 then user_email else null end) as unique_total_emailsend\n \n , sum(total_pushsendskip) as total_pushsendskip\n , count(distinct case when total_pushsendskip > 0 then user_email else null end) as unique_total_pushsendskip\n \n , sum(total_inappopen) as total_inappopen\n , count(distinct case when total_inappopen > 0 then user_email else null end) as unique_total_inappopen\n \n , sum(total_emailsendskip) as total_emailsendskip\n , count(distinct case when total_emailsendskip > 0 then user_email else null end) as unique_total_emailsendskip\n \n , sum(total_emailbounce) as total_emailbounce\n , count(distinct case when total_emailbounce > 0 then user_email else null end) as unique_total_emailbounce\n \n , sum(total_inappclick) as total_inappclick\n , count(distinct case when total_inappclick > 0 then user_email else null end) as unique_total_inappclick\n \n , sum(total_pushuninstall) as total_pushuninstall\n , count(distinct case when total_pushuninstall > 0 then user_email else null end) as unique_total_pushuninstall\n \n \n from user_campaign\n \n group by 1,2,3,4\n)\n\nselect *\nfrom campaign_user_event_metrics", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.int_iterable__campaign_lists": {"database": "postgres", "schema": "public_iterable_dev", "name": "int_iterable__campaign_lists", "resource_type": "model", "package_name": "iterable", "path": "intermediate/int_iterable__campaign_lists.sql", "original_file_path": "models/intermediate/int_iterable__campaign_lists.sql", "unique_id": "model.iterable.int_iterable__campaign_lists", "fqn": ["iterable", "intermediate", "int_iterable__campaign_lists"], "alias": "int_iterable__campaign_lists", "checksum": {"name": "sha256", "checksum": "33c167f12bf4fadb7316af985f2b60ee9989ade1a428d684037465d1a449685e"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "Table that identifies the suppressed and send lists associated with a campaign.", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "iterable://models/intermediate/int_iterable.yml", "build_path": null, "unrendered_config": {"materialized": "view", "schema": "iterable_{{ var('directed_schema','dev') }}", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789422569.8888705, "relation_name": "\"postgres\".\"public_iterable_dev\".\"int_iterable__campaign_lists\"", "raw_code": "with \n\n{% if var('iterable__using_campaign_suppression_list_history', True) %}\n\ncampaign_suppression_list_history as (\n\n select *\n from {{ ref('stg_iterable__campaign_suppression_list_history') }}\n\n), \n\n{% endif %}\n\ncampaign_send_list_history as (\n\n select *\n from {{ ref('stg_iterable__campaign_list_history') }}\n\n), combine_list_histories as (\n\n{% if var('iterable__using_campaign_suppression_list_history', True) %}\n\n select\n source_relation,\n suppressed_list_id as list_id,\n campaign_id,\n updated_at,\n 'suppress' as list_activity\n from campaign_suppression_list_history\n\n union all\n\n{% endif %}\n\n select\n source_relation,\n list_id,\n campaign_id,\n updated_at,\n 'send' as list_activity\n from campaign_send_list_history\n\n), order_campaign_list_history as (\n\n select\n *,\n row_number() over(partition by list_id, campaign_id{{ fivetran_utils.partition_by_source_relation(package_name='iterable') }} order by updated_at desc) as latest_list_index\n from combine_list_histories\n\n), latest_campaign_list_history as (\n\n select\n source_relation,\n list_id,\n campaign_id,\n updated_at,\n list_activity\n\n from order_campaign_list_history\n where latest_list_index = 1\n)\n\nselect *\nfrom latest_campaign_list_history", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__campaign_suppression_list_history", "package": null, "version": null}, {"name": "stg_iterable__campaign_list_history", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.fivetran_utils.partition_by_source_relation"], "nodes": ["model.iterable.stg_iterable__campaign_suppression_list_history", "model.iterable.stg_iterable__campaign_list_history"]}, "compiled_path": "target/compiled/iterable/models/intermediate/int_iterable__campaign_lists.sql", "compiled": true, "compiled_code": "with \n\n\n\ncampaign_suppression_list_history as (\n\n select *\n from \"postgres\".\"public_iterable_dev\".\"stg_iterable__campaign_suppression_list_history\"\n\n), \n\n\n\ncampaign_send_list_history as (\n\n select *\n from \"postgres\".\"public_iterable_dev\".\"stg_iterable__campaign_list_history\"\n\n), combine_list_histories as (\n\n\n\n select\n source_relation,\n suppressed_list_id as list_id,\n campaign_id,\n updated_at,\n 'suppress' as list_activity\n from campaign_suppression_list_history\n\n union all\n\n\n\n select\n source_relation,\n list_id,\n campaign_id,\n updated_at,\n 'send' as list_activity\n from campaign_send_list_history\n\n), order_campaign_list_history as (\n\n select\n *,\n row_number() over(partition by list_id, campaign_id order by updated_at desc) as latest_list_index\n from combine_list_histories\n\n), latest_campaign_list_history as (\n\n select\n source_relation,\n list_id,\n campaign_id,\n updated_at,\n list_activity\n\n from order_campaign_list_history\n where latest_list_index = 1\n)\n\nselect *\nfrom latest_campaign_list_history", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.int_iterable__recurring_campaigns": {"database": "postgres", "schema": "public_iterable_dev", "name": "int_iterable__recurring_campaigns", "resource_type": "model", "package_name": "iterable", "path": "intermediate/int_iterable__recurring_campaigns.sql", "original_file_path": "models/intermediate/int_iterable__recurring_campaigns.sql", "unique_id": "model.iterable.int_iterable__recurring_campaigns", "fqn": ["iterable", "intermediate", "int_iterable__recurring_campaigns"], "alias": "int_iterable__recurring_campaigns", "checksum": {"name": "sha256", "checksum": "177c12b9779cfd975d0de322b8ccfc36bdecb1f509262c02ca1c8cb7035926d8"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "Table that identifies when a campaign is associated with a recurring campaign and provides additional enriched recurring campaign information.", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "iterable://models/intermediate/int_iterable.yml", "build_path": null, "unrendered_config": {"materialized": "view", "schema": "iterable_{{ var('directed_schema','dev') }}", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789422569.8929427, "relation_name": "\"postgres\".\"public_iterable_dev\".\"int_iterable__recurring_campaigns\"", "raw_code": "with latest_campaign as (\n\n select * \n from {{ ref('int_iterable__latest_campaign') }}\n\n), recurring_campaign_join as (\n select\n latest_campaign.source_relation,\n latest_campaign.campaign_id,\n latest_campaign.campaign_name,\n latest_campaign.updated_at,\n latest_campaign.campaign_state,\n latest_campaign.campaign_type,\n latest_campaign.send_size,\n latest_campaign.start_at,\n latest_campaign.ended_at,\n latest_campaign.created_at,\n latest_campaign.created_by_user_id,\n latest_campaign.template_id,\n latest_campaign.recurring_campaign_id,\n {% if var('iterable__using_journey', true) %}\n -- cast to string so this matches journey_id in stg_iterable__journey; workflow_id arrives\n -- numeric from campaign_history but as a string from event_extension\n cast(latest_campaign.workflow_id as {{ dbt.type_string() }}) as journey_id,\n {% endif %}\n\n recurring_campaign.campaign_name as recurring_campaign_name,\n recurring_campaign.campaign_state as recurring_campaign_state,\n recurring_campaign.send_size as recurring_campaign_send_size,\n recurring_campaign.start_at as recurring_campaign_start_at\n\n from latest_campaign\n\n left join latest_campaign as recurring_campaign\n on latest_campaign.recurring_campaign_id = recurring_campaign.campaign_id\n and latest_campaign.source_relation = recurring_campaign.source_relation\n\n), final as (\n\n select\n recurring_campaign_join.*,\n case when latest_campaign.recurring_campaign_id is not null then true \n else false end as is_campaign_recurring\n\n from recurring_campaign_join\n left join latest_campaign on recurring_campaign_join.campaign_id = latest_campaign.recurring_campaign_id\n and recurring_campaign_join.template_id = latest_campaign.template_id\n and recurring_campaign_join.source_relation = latest_campaign.source_relation\n)\n\nselect *\nfrom final", "doc_blocks": [], "language": "sql", "refs": [{"name": "int_iterable__latest_campaign", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.type_string"], "nodes": ["model.iterable.int_iterable__latest_campaign"]}, "compiled_path": "target/compiled/iterable/models/intermediate/int_iterable__recurring_campaigns.sql", "compiled": true, "compiled_code": "with latest_campaign as (\n\n select * \n from \"postgres\".\"public_iterable_dev\".\"int_iterable__latest_campaign\"\n\n), recurring_campaign_join as (\n select\n latest_campaign.source_relation,\n latest_campaign.campaign_id,\n latest_campaign.campaign_name,\n latest_campaign.updated_at,\n latest_campaign.campaign_state,\n latest_campaign.campaign_type,\n latest_campaign.send_size,\n latest_campaign.start_at,\n latest_campaign.ended_at,\n latest_campaign.created_at,\n latest_campaign.created_by_user_id,\n latest_campaign.template_id,\n latest_campaign.recurring_campaign_id,\n \n -- cast to string so this matches journey_id in stg_iterable__journey; workflow_id arrives\n -- numeric from campaign_history but as a string from event_extension\n cast(latest_campaign.workflow_id as TEXT) as journey_id,\n \n\n recurring_campaign.campaign_name as recurring_campaign_name,\n recurring_campaign.campaign_state as recurring_campaign_state,\n recurring_campaign.send_size as recurring_campaign_send_size,\n recurring_campaign.start_at as recurring_campaign_start_at\n\n from latest_campaign\n\n left join latest_campaign as recurring_campaign\n on latest_campaign.recurring_campaign_id = recurring_campaign.campaign_id\n and latest_campaign.source_relation = recurring_campaign.source_relation\n\n), final as (\n\n select\n recurring_campaign_join.*,\n case when latest_campaign.recurring_campaign_id is not null then true \n else false end as is_campaign_recurring\n\n from recurring_campaign_join\n left join latest_campaign on recurring_campaign_join.campaign_id = latest_campaign.recurring_campaign_id\n and recurring_campaign_join.template_id = latest_campaign.template_id\n and recurring_campaign_join.source_relation = latest_campaign.source_relation\n)\n\nselect *\nfrom final", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.int_iterable__list_user_history": {"database": "postgres", "schema": "public_iterable_dev", "name": "int_iterable__list_user_history", "resource_type": "model", "package_name": "iterable", "path": "intermediate/int_iterable__list_user_history.sql", "original_file_path": "models/intermediate/int_iterable__list_user_history.sql", "unique_id": "model.iterable.int_iterable__list_user_history", "fqn": ["iterable", "intermediate", "int_iterable__list_user_history"], "alias": "int_iterable__list_user_history", "checksum": {"name": "sha256", "checksum": "26b2bd189944dfea25bb63edf9e3da03a3e8169e3501b894716e8d1f8e1df5a0"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "table", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "Table that provides a history of all lists the user has been associated with.", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "iterable://models/intermediate/int_iterable.yml", "build_path": null, "unrendered_config": {"materialized": "table", "schema": "iterable_{{ var('directed_schema','dev') }}", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789422569.8914084, "relation_name": "\"postgres\".\"public_iterable_dev\".\"int_iterable__list_user_history\"", "raw_code": "-- this model will serve to extract only email-list changes\nwith user_history as (\n\n select *\n from {{ ref('stg_iterable__user_history') }}\n\n), previous_email_list_ids as (\n\n select\n *,\n lag(email_list_ids) over(partition by unique_user_key{{ fivetran_utils.partition_by_source_relation(package_name='iterable') }} order by updated_at asc) as previous_ids -- partition by email instead of unique_user_key here since this model is only for email-list users\n\n from user_history\n\n), only_new_email_list_ids as (\n\n select\n source_relation,\n _fivetran_user_id,\n unique_user_key,\n user_id,\n email,\n first_name,\n last_name,\n email_list_ids,\n phone_number,\n signup_date,\n signup_source,\n updated_at\n\n --The below script allows for pass through columns.\n {{ fivetran_utils.persist_pass_through_columns(pass_through_variable='iterable_user_history_pass_through_columns', identifier='previous_email_list_ids') }}\n\n from previous_email_list_ids\n where email_list_ids != coalesce(previous_ids, 'this is new') -- list ids are always stored in their arrays in numerical order\n\n), most_recent_list_ids as (\n\n select\n *,\n row_number() over(partition by email{{ fivetran_utils.partition_by_source_relation(package_name='iterable') }} order by updated_at desc) as latest_user_index\n\n from only_new_email_list_ids\n\n), final as (\n\n select\n source_relation,\n _fivetran_user_id,\n unique_user_key,\n email,\n user_id,\n first_name,\n last_name,\n email_list_ids,\n phone_number,\n signup_date,\n signup_source,\n updated_at,\n latest_user_index = 1 as is_current\n\n --The below script allows for pass through columns.\n {{ fivetran_utils.persist_pass_through_columns(pass_through_variable='iterable_user_history_pass_through_columns', identifier='most_recent_list_ids') }}\n\n from most_recent_list_ids\n)\n\nselect * from final", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__user_history", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.fivetran_utils.partition_by_source_relation", "macro.fivetran_utils.persist_pass_through_columns"], "nodes": ["model.iterable.stg_iterable__user_history"]}, "compiled_path": "target/compiled/iterable/models/intermediate/int_iterable__list_user_history.sql", "compiled": true, "compiled_code": "-- this model will serve to extract only email-list changes\nwith user_history as (\n\n select *\n from \"postgres\".\"public_iterable_dev\".\"stg_iterable__user_history\"\n\n), previous_email_list_ids as (\n\n select\n *,\n lag(email_list_ids) over(partition by unique_user_key order by updated_at asc) as previous_ids -- partition by email instead of unique_user_key here since this model is only for email-list users\n\n from user_history\n\n), only_new_email_list_ids as (\n\n select\n source_relation,\n _fivetran_user_id,\n unique_user_key,\n user_id,\n email,\n first_name,\n last_name,\n email_list_ids,\n phone_number,\n signup_date,\n signup_source,\n updated_at\n\n --The below script allows for pass through columns.\n \n\n\n\n\n\n from previous_email_list_ids\n where email_list_ids != coalesce(previous_ids, 'this is new') -- list ids are always stored in their arrays in numerical order\n\n), most_recent_list_ids as (\n\n select\n *,\n row_number() over(partition by email order by updated_at desc) as latest_user_index\n\n from only_new_email_list_ids\n\n), final as (\n\n select\n source_relation,\n _fivetran_user_id,\n unique_user_key,\n email,\n user_id,\n first_name,\n last_name,\n email_list_ids,\n phone_number,\n signup_date,\n signup_source,\n updated_at,\n latest_user_index = 1 as is_current\n\n --The below script allows for pass through columns.\n \n\n\n\n\n\n from most_recent_list_ids\n)\n\nselect * from final", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.int_iterable__message_type_channel": {"database": "postgres", "schema": "public_iterable_dev", "name": "int_iterable__message_type_channel", "resource_type": "model", "package_name": "iterable", "path": "intermediate/int_iterable__message_type_channel.sql", "original_file_path": "models/intermediate/int_iterable__message_type_channel.sql", "unique_id": "model.iterable.int_iterable__message_type_channel", "fqn": ["iterable", "intermediate", "int_iterable__message_type_channel"], "alias": "int_iterable__message_type_channel", "checksum": {"name": "sha256", "checksum": "9f54e0a46c508fbe16514b8e598ee614b3462649f85582b5513905f6392d728d"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "Table that joins the message type and channel records together into one comprehensive model to be referenced downstream.", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "iterable://models/intermediate/int_iterable.yml", "build_path": null, "unrendered_config": {"materialized": "view", "schema": "iterable_{{ var('directed_schema','dev') }}", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789422569.8924162, "relation_name": "\"postgres\".\"public_iterable_dev\".\"int_iterable__message_type_channel\"", "raw_code": "with message_type as (\n\n select *\n from {{ ref('stg_iterable__message_type') }}\n\n), channel as (\n\n select *\n from {{ ref('stg_iterable__channel') }}\n\n), final as (\n\n select \n channel.*,\n message_type.message_type_name,\n message_type.message_type_id\n from channel\n left join message_type\n on channel.channel_id = message_type.channel_id\n and channel.source_relation = message_type.source_relation\n)\n\nselect *\nfrom final", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__message_type", "package": null, "version": null}, {"name": "stg_iterable__channel", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": [], "nodes": ["model.iterable.stg_iterable__message_type", "model.iterable.stg_iterable__channel"]}, "compiled_path": "target/compiled/iterable/models/intermediate/int_iterable__message_type_channel.sql", "compiled": true, "compiled_code": "with message_type as (\n\n select *\n from \"postgres\".\"public_iterable_dev\".\"stg_iterable__message_type\"\n\n), channel as (\n\n select *\n from \"postgres\".\"public_iterable_dev\".\"stg_iterable__channel\"\n\n), final as (\n\n select \n channel.*,\n message_type.message_type_name,\n message_type.message_type_id\n from channel\n left join message_type\n on channel.channel_id = message_type.channel_id\n and channel.source_relation = message_type.source_relation\n)\n\nselect *\nfrom final", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.int_iterable__user_event_metrics": {"database": "postgres", "schema": "public_iterable_dev", "name": "int_iterable__user_event_metrics", "resource_type": "model", "package_name": "iterable", "path": "intermediate/int_iterable__user_event_metrics.sql", "original_file_path": "models/intermediate/int_iterable__user_event_metrics.sql", "unique_id": "model.iterable.int_iterable__user_event_metrics", "fqn": ["iterable", "intermediate", "int_iterable__user_event_metrics"], "alias": "int_iterable__user_event_metrics", "checksum": {"name": "sha256", "checksum": "56af49e00fd9cad13663d8bf802187ff1d12561fb1fd9d3732d182703b34ca4d"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "Table that generates user aggregations at the campaign level.", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "iterable://models/intermediate/int_iterable.yml", "build_path": null, "unrendered_config": {"materialized": "view", "schema": "iterable_{{ var('directed_schema','dev') }}", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789422569.893438, "relation_name": "\"postgres\".\"public_iterable_dev\".\"int_iterable__user_event_metrics\"", "raw_code": "with user_campaign as (\n\n select *\n from {{ ref('iterable__user_campaign') }}\n\n), user_event_metrics as (\n\n{%- set user_campaign_columns = adapter.get_columns_in_relation(ref('iterable__user_campaign')) %}\n{%- set non_agg_columns = ['source_relation', 'unique_user_key', 'user_id', '_fivetran_user_id', \n 'user_email', 'user_full_name', 'campaign_id', 'campaign_name', 'recurring_campaign_id', \n 'recurring_campaign_name', 'first_event_at', 'last_event_at', 'template_id', 'template_name', \n 'experiment_id', 'unique_user_campaign_id', 'first_open_or_click_event_at'\n ] %}\n\n select\n source_relation,\n _fivetran_user_id,\n unique_user_key,\n user_id,\n user_email,\n count(distinct campaign_id) as count_total_campaigns,\n min(first_event_at) as first_event_at,\n max(last_event_at) as last_event_at\n\n {% for col in user_campaign_columns if col.name|lower not in non_agg_columns %}\n , sum({{ col.name }}) as {{ col.name }}\n {% endfor %}\n\n from user_campaign\n {{ dbt_utils.group_by(n=5) }}\n\n)\n\nselect *\nfrom user_event_metrics", "doc_blocks": [], "language": "sql", "refs": [{"name": "iterable__user_campaign", "package": null, "version": null}, {"name": "iterable__user_campaign", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt_utils.group_by"], "nodes": ["model.iterable.iterable__user_campaign"]}, "compiled_path": "target/compiled/iterable/models/intermediate/int_iterable__user_event_metrics.sql", "compiled": true, "compiled_code": "with user_campaign as (\n\n select *\n from \"postgres\".\"public_iterable_dev\".\"iterable__user_campaign\"\n\n), user_event_metrics as (\n\n select\n source_relation,\n _fivetran_user_id,\n unique_user_key,\n user_id,\n user_email,\n count(distinct campaign_id) as count_total_campaigns,\n min(first_event_at) as first_event_at,\n max(last_event_at) as last_event_at\n\n \n , sum(total_emailclick) as total_emailclick\n \n , sum(total_emailunsubscribe) as total_emailunsubscribe\n \n , sum(total_emailcomplaint) as total_emailcomplaint\n \n , sum(total_customevent) as total_customevent\n \n , sum(total_emailsubscribe) as total_emailsubscribe\n \n , sum(total_emailopen) as total_emailopen\n \n , sum(total_pushsend) as total_pushsend\n \n , sum(total_smsbounce) as total_smsbounce\n \n , sum(total_pushbounce) as total_pushbounce\n \n , sum(total_inappsendskip) as total_inappsendskip\n \n , sum(total_smssend) as total_smssend\n \n , sum(total_inappsend) as total_inappsend\n \n , sum(total_pushopen) as total_pushopen\n \n , sum(total_emailsend) as total_emailsend\n \n , sum(total_pushsendskip) as total_pushsendskip\n \n , sum(total_inappopen) as total_inappopen\n \n , sum(total_emailsendskip) as total_emailsendskip\n \n , sum(total_emailbounce) as total_emailbounce\n \n , sum(total_inappclick) as total_inappclick\n \n , sum(total_pushuninstall) as total_pushuninstall\n \n\n from user_campaign\n group by 1,2,3,4,5\n\n)\n\nselect *\nfrom user_event_metrics", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.int_iterable__latest_user": {"database": "postgres", "schema": "public_iterable_dev", "name": "int_iterable__latest_user", "resource_type": "model", "package_name": "iterable", "path": "intermediate/int_iterable__latest_user.sql", "original_file_path": "models/intermediate/int_iterable__latest_user.sql", "unique_id": "model.iterable.int_iterable__latest_user", "fqn": ["iterable", "intermediate", "int_iterable__latest_user"], "alias": "int_iterable__latest_user", "checksum": {"name": "sha256", "checksum": "580070cfbe396b904d0dc15669eefe5b9f017005d0aa91aa2c3d96b4e4686e81"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "Table that filters out historical versions of the user, and returns only the most recent version.", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "iterable://models/intermediate/int_iterable.yml", "build_path": null, "unrendered_config": {"materialized": "view", "schema": "iterable_{{ var('directed_schema','dev') }}", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789422569.890928, "relation_name": "\"postgres\".\"public_iterable_dev\".\"int_iterable__latest_user\"", "raw_code": "with user_history as (\n select *\n from {{ ref('stg_iterable__user_history') }}\n\n), latest_user as (\n select\n *,\n row_number() over(partition by unique_user_key{{ fivetran_utils.partition_by_source_relation(package_name='iterable') }} order by updated_at desc) as latest_user_index\n from user_history\n)\n\nselect *\nfrom latest_user\nwhere latest_user_index = 1", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__user_history", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.fivetran_utils.partition_by_source_relation"], "nodes": ["model.iterable.stg_iterable__user_history"]}, "compiled_path": "target/compiled/iterable/models/intermediate/int_iterable__latest_user.sql", "compiled": true, "compiled_code": "with user_history as (\n select *\n from \"postgres\".\"public_iterable_dev\".\"stg_iterable__user_history\"\n\n), latest_user as (\n select\n *,\n row_number() over(partition by unique_user_key order by updated_at desc) as latest_user_index\n from user_history\n)\n\nselect *\nfrom latest_user\nwhere latest_user_index = 1", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.int_iterable__latest_campaign": {"database": "postgres", "schema": "public_iterable_dev", "name": "int_iterable__latest_campaign", "resource_type": "model", "package_name": "iterable", "path": "intermediate/int_iterable__latest_campaign.sql", "original_file_path": "models/intermediate/int_iterable__latest_campaign.sql", "unique_id": "model.iterable.int_iterable__latest_campaign", "fqn": ["iterable", "intermediate", "int_iterable__latest_campaign"], "alias": "int_iterable__latest_campaign", "checksum": {"name": "sha256", "checksum": "8063c9ccdfe6dee1694944607534fbb31bafe2856073ac2f5ea58aa513714e4f"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "Table that filters out historical versions of the campaign, and returns the most recent campaign version.", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "iterable://models/intermediate/int_iterable.yml", "build_path": null, "unrendered_config": {"materialized": "view", "schema": "iterable_{{ var('directed_schema','dev') }}", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789422569.8899145, "relation_name": "\"postgres\".\"public_iterable_dev\".\"int_iterable__latest_campaign\"", "raw_code": "with campaign_history as (\n select *\n from {{ ref('stg_iterable__campaign_history') }}\n\n), latest_campaign as (\n select\n *,\n row_number() over(partition by campaign_id{{ fivetran_utils.partition_by_source_relation(package_name='iterable') }} order by updated_at desc) as latest_campaign_index\n from campaign_history\n)\n\nselect *\nfrom latest_campaign\nwhere latest_campaign_index = 1", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__campaign_history", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.fivetran_utils.partition_by_source_relation"], "nodes": ["model.iterable.stg_iterable__campaign_history"]}, "compiled_path": "target/compiled/iterable/models/intermediate/int_iterable__latest_campaign.sql", "compiled": true, "compiled_code": "with campaign_history as (\n select *\n from \"postgres\".\"public_iterable_dev\".\"stg_iterable__campaign_history\"\n\n), latest_campaign as (\n select\n *,\n row_number() over(partition by campaign_id order by updated_at desc) as latest_campaign_index\n from campaign_history\n)\n\nselect *\nfrom latest_campaign\nwhere latest_campaign_index = 1", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.stg_iterable__message_type": {"database": "postgres", "schema": "public_iterable_dev", "name": "stg_iterable__message_type", "resource_type": "model", "package_name": "iterable", "path": "staging/stg_iterable__message_type.sql", "original_file_path": "models/staging/stg_iterable__message_type.sql", "unique_id": "model.iterable.stg_iterable__message_type", "fqn": ["iterable", "staging", "stg_iterable__message_type"], "alias": "stg_iterable__message_type", "checksum": {"name": "sha256", "checksum": "046caf2bcc8a01dd2b8ef46a5dfb52e02b8bebe01e892de5d658910c97d5e6a4"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "table", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "Table containing unique message types.", "columns": {"source_relation": {"name": "source_relation", "description": "Identifies the record's source.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": ["doc.iterable.source_relation"]}, "message_type_id": {"name": "message_type_id", "description": "Unique identifier of the message type", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "message_type_name": {"name": "message_type_name", "description": "User defined name of the message type", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "channel_id": {"name": "channel_id", "description": "Channel that this message type belongs to", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "message_type_created_at": {"name": "message_type_created_at", "description": "Time when the message type was initially created", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "frequency_cap": {"name": "frequency_cap", "description": "The maximum number of times a message of this type can be sent to a recipient within a specified time period to prevent over-messaging", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "rate_limit_per_minute": {"name": "rate_limit_per_minute", "description": "The maximum number of messages of this type that can be sent to recipients in a minute, ensuring controlled message delivery", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "subscription_policy": {"name": "subscription_policy", "description": "Information about the policy or rules governing how users can subscribe to or unsubscribe from this specific message type, like OptOut", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "message_type_updated_at": {"name": "message_type_updated_at", "description": "Time when the message type was last updated or modified", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "The time when a record was last updated by Fivetran.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": ["doc.iterable._fivetran_synced"]}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "iterable://models/staging/stg_iterable.yml", "build_path": null, "unrendered_config": {"materialized": "table", "schema": "iterable_{{ var('directed_schema','dev') }}", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789422569.9099052, "relation_name": "\"postgres\".\"public_iterable_dev\".\"stg_iterable__message_type\"", "raw_code": "with base as (\n\n select * \n from {{ ref('stg_iterable__message_type_tmp') }}\n\n),\n\nfields as (\n\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_iterable/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_iterable/macros/).\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_iterable__message_type_tmp')),\n staging_columns=get_message_type_columns()\n )\n }}\n {{ fivetran_utils.apply_source_relation(package_name='iterable') }}\n\n from base\n),\n\nfinal as (\n\n select\n source_relation,\n cast(id as {{ dbt.type_string() }} ) as message_type_id,\n name as message_type_name,\n cast(channel_id as {{ dbt.type_string() }} ) as channel_id,\n created_at as message_type_created_at,\n frequency_cap,\n rate_limit_per_minute,\n subscription_policy,\n updated_at as message_type_updated_at,\n _fivetran_synced\n from fields\n where not coalesce(_fivetran_deleted, true)\n)\n\nselect * \nfrom final", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__message_type_tmp", "package": null, "version": null}, {"name": "stg_iterable__message_type_tmp", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.iterable.get_message_type_columns", "macro.fivetran_utils.fill_staging_columns", "macro.fivetran_utils.apply_source_relation", "macro.dbt.type_string"], "nodes": ["model.iterable.stg_iterable__message_type_tmp"]}, "compiled_path": "target/compiled/iterable/models/staging/stg_iterable__message_type.sql", "compiled": true, "compiled_code": "with base as (\n\n select * \n from \"postgres\".\"public_iterable_dev\".\"stg_iterable__message_type_tmp\"\n\n),\n\nfields as (\n\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_iterable/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_iterable/macros/).\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n \n _fivetran_deleted as _fivetran_deleted,\n _fivetran_synced as _fivetran_synced,\n channel_id as channel_id,\n id as id,\n name as name,\n created_at as created_at,\n frequency_cap as frequency_cap,\n rate_limit_per_minute as rate_limit_per_minute,\n subscription_policy as subscription_policy,\n updated_at as updated_at\n \n\n\n\n\n \n \n\n\n\n\n\n, cast('postgres.public' as TEXT) as source_relation\n\n\n from base\n),\n\nfinal as (\n\n select\n source_relation,\n cast(id as TEXT ) as message_type_id,\n name as message_type_name,\n cast(channel_id as TEXT ) as channel_id,\n created_at as message_type_created_at,\n frequency_cap,\n rate_limit_per_minute,\n subscription_policy,\n updated_at as message_type_updated_at,\n _fivetran_synced\n from fields\n where not coalesce(_fivetran_deleted, true)\n)\n\nselect * \nfrom final", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.stg_iterable__event": {"database": "postgres", "schema": "public_iterable_dev", "name": "stg_iterable__event", "resource_type": "model", "package_name": "iterable", "path": "staging/stg_iterable__event.sql", "original_file_path": "models/staging/stg_iterable__event.sql", "unique_id": "model.iterable.stg_iterable__event", "fqn": ["iterable", "staging", "stg_iterable__event"], "alias": "stg_iterable__event", "checksum": {"name": "sha256", "checksum": "22ba2d21012d8301984a6fcea5b9f40f9579f5565aaea7417f7458f6fd37937b"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "Table containing individual events within campaigns.", "columns": {"source_relation": {"name": "source_relation", "description": "Identifies the record's source.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": ["doc.iterable.source_relation"]}, "event_id": {"name": "event_id", "description": "A Fivetran-created unique identifier derived from hashing campaign_id, created_at, and event_name.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_event_id": {"name": "unique_event_id", "description": "A surrogate key made up of event_id, _fivetran_user_id, and source_relation.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "campaign_id": {"name": "campaign_id", "description": "Reference to the campaign from which the event originated", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "content_id": {"name": "content_id", "description": "Reference to the content the event is associated with", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "created_at": {"name": "created_at", "description": "Creation timestamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "created_on": {"name": "created_on", "description": "Creation date", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "email": {"name": "email", "description": "Reference to the unique user the event was applied to", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "additional_properties": {"name": "additional_properties", "description": "json object containing addition event properties", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "event_name": {"name": "event_name", "description": "Name provided to the individual event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "message_bus_id": {"name": "message_bus_id", "description": "Reference to the message bus associated with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "message_id": {"name": "message_id", "description": "Reference to the message the event is associated with", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "message_type_id": {"name": "message_type_id", "description": "Reference to the type of message the event is associated with", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "recipient_state": {"name": "recipient_state", "description": "The state of the recipient upon receiving the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "status": {"name": "status", "description": "Status of the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "transactional_data": {"name": "transactional_data", "description": "Transactional data associated with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unsub_source": {"name": "unsub_source", "description": "Source of the unsubscribe event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "user_agent": {"name": "user_agent", "description": "User agent associated with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "user_agent_device": {"name": "user_agent_device", "description": "The device of the user agent", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "_fivetran_user_id": {"name": "_fivetran_user_id", "description": "A Fivetran-created unique identifier for users, derived from hashing user_id and/or email, depending on project type. This exists for users of the new schema starting Aug 2023. In the old schema, the unique identifier is email.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_user_key": {"name": "unique_user_key", "description": "The unique identifier of the user. With the new schema (Aug 2023), it is the _fivetran_user_id. This is a hash of user_id and/or email, depending on project type. If using the old schema, it is email.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "The time when a record was last updated by Fivetran.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": ["doc.iterable._fivetran_synced"]}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "iterable://models/staging/stg_iterable.yml", "build_path": null, "unrendered_config": {"materialized": "view", "schema": "iterable_{{ var('directed_schema','dev') }}", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789422569.901717, "relation_name": "\"postgres\".\"public_iterable_dev\".\"stg_iterable__event\"", "raw_code": "{{ config( materialized = 'view' ) }}\n\nwith base as (\n\n select * \n from {{ ref('stg_iterable__event_tmp') }}\n\n),\n\nfields as (\n\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_iterable/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_iterable/macros/).\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_iterable__event_tmp')),\n staging_columns=get_event_columns()\n )\n }}\n {{ fivetran_utils.apply_source_relation(package_name='iterable') }}\n \n from base\n),\n\nfinal as (\n\n select\n source_relation,\n cast(_fivetran_id as {{ dbt.type_string() }} ) as event_id,\n {{ dbt_utils.generate_surrogate_key(['_fivetran_id','_fivetran_user_id','source_relation']) }} as unique_event_id,\n cast(_fivetran_user_id as {{ dbt.type_string() }} ) as _fivetran_user_id,\n coalesce(cast(_fivetran_user_id as {{ dbt.type_string() }} ) , email) as unique_user_key,\n cast(campaign_id as {{ dbt.type_string() }} ) as campaign_id,\n cast(content_id as {{ dbt.type_string() }} ) as content_id,\n created_at,\n cast( {{ dbt.date_trunc('day', 'created_at') }} as date) as created_on,\n lower(email) as email,\n additional_properties,\n event_name,\n cast(message_bus_id as {{ dbt.type_string() }} ) as message_bus_id,\n cast(message_id as {{ dbt.type_string() }} ) as message_id,\n cast(message_type_id as {{ dbt.type_string() }} ) as message_type_id,\n recipient_state,\n status,\n transactional_data,\n unsub_source,\n user_agent,\n user_agent_device,\n _fivetran_synced\n\n from fields\n)\n\nselect *\nfrom final", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__event_tmp", "package": null, "version": null}, {"name": "stg_iterable__event_tmp", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.iterable.get_event_columns", "macro.fivetran_utils.fill_staging_columns", "macro.fivetran_utils.apply_source_relation", "macro.dbt.type_string", "macro.dbt_utils.generate_surrogate_key", "macro.dbt.date_trunc"], "nodes": ["model.iterable.stg_iterable__event_tmp"]}, "compiled_path": "target/compiled/iterable/models/staging/stg_iterable__event.sql", "compiled": true, "compiled_code": "\n\nwith base as (\n\n select * \n from \"postgres\".\"public_iterable_dev\".\"stg_iterable__event_tmp\"\n\n),\n\nfields as (\n\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_iterable/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_iterable/macros/).\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n \n _fivetran_id as _fivetran_id,\n _fivetran_user_id as _fivetran_user_id,\n _fivetran_synced as _fivetran_synced,\n campaign_id as campaign_id,\n content_id as content_id,\n created_at as created_at,\n email as email,\n event_name as event_name,\n message_bus_id as message_bus_id,\n message_id as message_id,\n message_type_id as message_type_id,\n recipient_state as recipient_state,\n status as status,\n unsub_source as unsub_source,\n user_agent as user_agent,\n user_agent_device as user_agent_device,\n transactional_data as transactional_data,\n additional_properties as additional_properties\n \n\n\n\n\n \n \n\n\n\n\n\n, cast('postgres.public' as TEXT) as source_relation\n\n \n from base\n),\n\nfinal as (\n\n select\n source_relation,\n cast(_fivetran_id as TEXT ) as event_id,\n md5(cast(coalesce(cast(_fivetran_id as TEXT), '_dbt_utils_surrogate_key_null_') || '-' || coalesce(cast(_fivetran_user_id as TEXT), '_dbt_utils_surrogate_key_null_') || '-' || coalesce(cast(source_relation as TEXT), '_dbt_utils_surrogate_key_null_') as TEXT)) as unique_event_id,\n cast(_fivetran_user_id as TEXT ) as _fivetran_user_id,\n coalesce(cast(_fivetran_user_id as TEXT ) , email) as unique_user_key,\n cast(campaign_id as TEXT ) as campaign_id,\n cast(content_id as TEXT ) as content_id,\n created_at,\n cast( date_trunc('day', created_at) as date) as created_on,\n lower(email) as email,\n additional_properties,\n event_name,\n cast(message_bus_id as TEXT ) as message_bus_id,\n cast(message_id as TEXT ) as message_id,\n cast(message_type_id as TEXT ) as message_type_id,\n recipient_state,\n status,\n transactional_data,\n unsub_source,\n user_agent,\n user_agent_device,\n _fivetran_synced\n\n from fields\n)\n\nselect *\nfrom final", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.stg_iterable__user_unsubscribed_channel": {"database": "postgres", "schema": "public_iterable_dev", "name": "stg_iterable__user_unsubscribed_channel", "resource_type": "model", "package_name": "iterable", "path": "staging/stg_iterable__user_unsubscribed_channel.sql", "original_file_path": "models/staging/stg_iterable__user_unsubscribed_channel.sql", "unique_id": "model.iterable.stg_iterable__user_unsubscribed_channel", "fqn": ["iterable", "staging", "stg_iterable__user_unsubscribed_channel"], "alias": "stg_iterable__user_unsubscribed_channel", "checksum": {"name": "sha256", "checksum": "5c639597d14f4bb7072df74e39c2b8aaa7bf1e29c6204243035014d14a0bc6f2"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "table", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "Table containing the history of channels from which a user has unsubscribed.", "columns": {"source_relation": {"name": "source_relation", "description": "Identifies the record's source.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": ["doc.iterable.source_relation"]}, "channel_id": {"name": "channel_id", "description": "Reference to the channel from which the user unsubscribed", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unsub_channel_unique_key": {"name": "unsub_channel_unique_key", "description": "A surrogate key providing a unique key for each record. If using user_unsubscribed_channel_history, it uses '_fivetran_id', 'channel_id', 'email', 'updated_at', and 'source_relation'. If not using the history table, it uses '_fivetran_id', 'channel_id', and 'source_relation'.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "_fivetran_user_id": {"name": "_fivetran_user_id", "description": "A Fivetran-created unique identifier for users, derived from hashing user_id and/or email, depending on project type. This exists for users of the new schema starting Aug 2023. In the old schema, the unique identifier is email.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_user_key": {"name": "unique_user_key", "description": "The unique identifier of the user. With the new schema (Aug 2023), it is the _fivetran_user_id. This is a hash of user_id and/or email, depending on project type. If using the old schema, it is email.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "latest_batch_index": {"name": "latest_batch_index", "description": "Indexes each user record based on the most recent available.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "updated_at": {"name": "updated_at", "description": "Last update timestamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "The time when a record was last updated by Fivetran.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": ["doc.iterable._fivetran_synced"]}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "iterable://models/staging/stg_iterable.yml", "build_path": null, "unrendered_config": {"materialized": "table", "schema": "iterable_{{ var('directed_schema','dev') }}", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789422569.9163258, "relation_name": "\"postgres\".\"public_iterable_dev\".\"stg_iterable__user_unsubscribed_channel\"", "raw_code": "with base as (\n select *\n from {{ ref('stg_iterable__user_unsubscribed_channel_tmp') }}\n\n),\n\nfields as (\n\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_iterable/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_iterable/macros/).\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_iterable__user_unsubscribed_channel_tmp')),\n staging_columns=get_user_unsubscribed_channel_columns()\n )\n }}\n {{ fivetran_utils.apply_source_relation(package_name='iterable') }}\n\n from base\n),\n\nfinal as (\n\n select\n source_relation,\n cast(_fivetran_id as {{ dbt.type_string() }} ) as _fivetran_user_id,\n coalesce(cast(_fivetran_id as {{ dbt.type_string() }} ), email) as unique_user_key,\n cast(channel_id as {{ dbt.type_string() }} ) as channel_id,\n {{ dbt_utils.generate_surrogate_key(['_fivetran_id', 'channel_id', 'email', 'updated_at', 'source_relation']) }} as unsub_channel_unique_key,\n\n {% if does_table_exist('user_unsubscribed_channel') == false %}\n rank() over(partition by email, channel_id{{ fivetran_utils.partition_by_source_relation(package_name='iterable') }} order by updated_at desc) as latest_batch_index,\n {% else %}\n 1 as latest_batch_index,\n {% endif %}\n\n updated_at,\n _fivetran_synced\n\n from fields\n)\n\n\nselect *\nfrom final", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__user_unsubscribed_channel_tmp", "package": null, "version": null}, {"name": "stg_iterable__user_unsubscribed_channel_tmp", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.iterable.get_user_unsubscribed_channel_columns", "macro.fivetran_utils.fill_staging_columns", "macro.fivetran_utils.apply_source_relation", "macro.dbt.type_string", "macro.dbt_utils.generate_surrogate_key", "macro.iterable.does_table_exist"], "nodes": ["model.iterable.stg_iterable__user_unsubscribed_channel_tmp"]}, "compiled_path": "target/compiled/iterable/models/staging/stg_iterable__user_unsubscribed_channel.sql", "compiled": true, "compiled_code": "with base as (\n select *\n from \"postgres\".\"public_iterable_dev\".\"stg_iterable__user_unsubscribed_channel_tmp\"\n\n),\n\nfields as (\n\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_iterable/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_iterable/macros/).\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n \n _fivetran_synced as _fivetran_synced,\n _fivetran_id as _fivetran_id,\n channel_id as channel_id,\n cast(null as TEXT) as email,\n cast(null as timestamp) as updated_at\n \n\n\n\n\n \n \n\n\n\n\n\n, cast('postgres.public' as TEXT) as source_relation\n\n\n from base\n),\n\nfinal as (\n\n select\n source_relation,\n cast(_fivetran_id as TEXT ) as _fivetran_user_id,\n coalesce(cast(_fivetran_id as TEXT ), email) as unique_user_key,\n cast(channel_id as TEXT ) as channel_id,\n md5(cast(coalesce(cast(_fivetran_id as TEXT), '_dbt_utils_surrogate_key_null_') || '-' || coalesce(cast(channel_id as TEXT), '_dbt_utils_surrogate_key_null_') || '-' || coalesce(cast(email as TEXT), '_dbt_utils_surrogate_key_null_') || '-' || coalesce(cast(updated_at as TEXT), '_dbt_utils_surrogate_key_null_') || '-' || coalesce(cast(source_relation as TEXT), '_dbt_utils_surrogate_key_null_') as TEXT)) as unsub_channel_unique_key,\n\n \n 1 as latest_batch_index,\n \n\n updated_at,\n _fivetran_synced\n\n from fields\n)\n\n\nselect *\nfrom final", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.stg_iterable__campaign_history": {"database": "postgres", "schema": "public_iterable_dev", "name": "stg_iterable__campaign_history", "resource_type": "model", "package_name": "iterable", "path": "staging/stg_iterable__campaign_history.sql", "original_file_path": "models/staging/stg_iterable__campaign_history.sql", "unique_id": "model.iterable.stg_iterable__campaign_history", "fqn": ["iterable", "staging", "stg_iterable__campaign_history"], "alias": "stg_iterable__campaign_history", "checksum": {"name": "sha256", "checksum": "7e7aecc134f0b697da58c7cd663aadf6de586a55c84369c2a7274811b2bb368b"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "table", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "Table containing a history of campaigns.", "columns": {"source_relation": {"name": "source_relation", "description": "Identifies the record's source.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": ["doc.iterable.source_relation"]}, "campaign_id": {"name": "campaign_id", "description": "Unique identifier of the campaign record", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "updated_at": {"name": "updated_at", "description": "Last update timestamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "campaign_name": {"name": "campaign_name", "description": "User defined name of the campaign.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "campaign_state": {"name": "campaign_state", "description": "State of the campaign. Can be Draft, Ready, Scheduled, Running, Finished, Starting, Aborted or Recurring", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "campaign_type": {"name": "campaign_type", "description": "The campaign type. Can be Blast or Triggered", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "send_size": {"name": "send_size", "description": "Size of the campaign. Number of individuals included in the campaign", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "start_at": {"name": "start_at", "description": "Start timestamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "ended_at": {"name": "ended_at", "description": "Ended timestamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "created_at": {"name": "created_at", "description": "Creation timestamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "recurring_campaign_id": {"name": "recurring_campaign_id", "description": "Reference to the recurring campaign, if applicable", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "created_by_user_id": {"name": "created_by_user_id", "description": "Reference to the user who created the campaign", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "template_id": {"name": "template_id", "description": "Reference to the campaign template", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "updated_by_user_id": {"name": "updated_by_user_id", "description": "ID of the user who updated this record", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "message_medium": {"name": "message_medium", "description": "The medium that this message was sent via, for example Email or InApp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "workflow_id": {"name": "workflow_id", "description": "Reference to the workflow which the event originated", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "The time when a record was last updated by Fivetran.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": ["doc.iterable._fivetran_synced"]}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "iterable://models/staging/stg_iterable.yml", "build_path": null, "unrendered_config": {"materialized": "table", "schema": "iterable_{{ var('directed_schema','dev') }}", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789422569.895721, "relation_name": "\"postgres\".\"public_iterable_dev\".\"stg_iterable__campaign_history\"", "raw_code": "with base as (\n\n select * \n from {{ ref('stg_iterable__campaign_history_tmp') }}\n\n),\n\nfields as (\n\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_iterable/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_iterable/macros/).\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_iterable__campaign_history_tmp')),\n staging_columns=get_campaign_history_columns()\n )\n }}\n {{ fivetran_utils.apply_source_relation(package_name='iterable') }}\n \n from base\n),\n\nfinal as (\n\n select\n source_relation,\n cast(id as {{ dbt.type_string() }}) as campaign_id,\n updated_at,\n name as campaign_name,\n campaign_state,\n type as campaign_type,\n send_size,\n start_at,\n ended_at,\n created_at,\n message_medium,\n cast(recurring_campaign_id as {{ dbt.type_string() }}) as recurring_campaign_id,\n cast(created_by_user_id as {{ dbt.type_string() }} ) as created_by_user_id,\n cast(updated_by_user_id as {{ dbt.type_string() }} ) as updated_by_user_id,\n cast(template_id as {{ dbt.type_string() }}) as template_id,\n workflow_id,\n _fivetran_synced\n\n from fields\n)\n\nselect * \nfrom final", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__campaign_history_tmp", "package": null, "version": null}, {"name": "stg_iterable__campaign_history_tmp", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.iterable.get_campaign_history_columns", "macro.fivetran_utils.fill_staging_columns", "macro.fivetran_utils.apply_source_relation", "macro.dbt.type_string"], "nodes": ["model.iterable.stg_iterable__campaign_history_tmp"]}, "compiled_path": "target/compiled/iterable/models/staging/stg_iterable__campaign_history.sql", "compiled": true, "compiled_code": "with base as (\n\n select * \n from \"postgres\".\"public_iterable_dev\".\"stg_iterable__campaign_history_tmp\"\n\n),\n\nfields as (\n\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_iterable/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_iterable/macros/).\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n \n _fivetran_synced as _fivetran_synced,\n campaign_state as campaign_state,\n created_at as created_at,\n created_by_user_id as created_by_user_id,\n updated_by_user_id as updated_by_user_id,\n ended_at as ended_at,\n id as id,\n name as name,\n recurring_campaign_id as recurring_campaign_id,\n send_size as send_size,\n start_at as start_at,\n template_id as template_id,\n type as type,\n updated_at as updated_at,\n workflow_id as workflow_id,\n message_medium as message_medium\n \n\n\n\n\n \n \n\n\n\n\n\n, cast('postgres.public' as TEXT) as source_relation\n\n \n from base\n),\n\nfinal as (\n\n select\n source_relation,\n cast(id as TEXT) as campaign_id,\n updated_at,\n name as campaign_name,\n campaign_state,\n type as campaign_type,\n send_size,\n start_at,\n ended_at,\n created_at,\n message_medium,\n cast(recurring_campaign_id as TEXT) as recurring_campaign_id,\n cast(created_by_user_id as TEXT ) as created_by_user_id,\n cast(updated_by_user_id as TEXT ) as updated_by_user_id,\n cast(template_id as TEXT) as template_id,\n workflow_id,\n _fivetran_synced\n\n from fields\n)\n\nselect * \nfrom final", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.stg_iterable__campaign_label_history": {"database": "postgres", "schema": "public_iterable_dev", "name": "stg_iterable__campaign_label_history", "resource_type": "model", "package_name": "iterable", "path": "staging/stg_iterable__campaign_label_history.sql", "original_file_path": "models/staging/stg_iterable__campaign_label_history.sql", "unique_id": "model.iterable.stg_iterable__campaign_label_history", "fqn": ["iterable", "staging", "stg_iterable__campaign_label_history"], "alias": "stg_iterable__campaign_label_history", "checksum": {"name": "sha256", "checksum": "2001c425039c576063482caa3d4a72f39c5cd8aff32ffee63f083977f1f0c35f"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "table", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "Table containing a history of labels.", "columns": {"source_relation": {"name": "source_relation", "description": "Identifies the record's source.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": ["doc.iterable.source_relation"]}, "campaign_id": {"name": "campaign_id", "description": "Reference to the campaign associated with the label", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "label": {"name": "label", "description": "Name of the label", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "updated_at": {"name": "updated_at", "description": "Last update timestamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "The time when a record was last updated by Fivetran.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": ["doc.iterable._fivetran_synced"]}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "iterable://models/staging/stg_iterable.yml", "build_path": null, "unrendered_config": {"materialized": "table", "schema": "iterable_{{ var('directed_schema','dev') }}", "enabled": "var('iterable__using_campaign_label_history', True)", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789422569.8969762, "relation_name": "\"postgres\".\"public_iterable_dev\".\"stg_iterable__campaign_label_history\"", "raw_code": "{{ config(enabled=var('iterable__using_campaign_label_history', True)) }}\n\nwith base as (\n\n select * \n from {{ ref('stg_iterable__campaign_label_history_tmp') }}\n\n),\n\nfields as (\n\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_iterable/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_iterable/macros/).\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_iterable__campaign_label_history_tmp')),\n staging_columns=get_campaign_label_history_columns()\n )\n }}\n {{ fivetran_utils.apply_source_relation(package_name='iterable') }}\n \n from base\n),\n\nfinal as (\n\n select\n source_relation,\n cast(campaign_id as {{ dbt.type_string() }}) as campaign_id,\n label,\n updated_at,\n _fivetran_synced\n from fields\n)\n\nselect * \nfrom final", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__campaign_label_history_tmp", "package": null, "version": null}, {"name": "stg_iterable__campaign_label_history_tmp", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.iterable.get_campaign_label_history_columns", "macro.fivetran_utils.fill_staging_columns", "macro.fivetran_utils.apply_source_relation", "macro.dbt.type_string"], "nodes": ["model.iterable.stg_iterable__campaign_label_history_tmp"]}, "compiled_path": "target/compiled/iterable/models/staging/stg_iterable__campaign_label_history.sql", "compiled": true, "compiled_code": "\n\nwith base as (\n\n select * \n from \"postgres\".\"public_iterable_dev\".\"stg_iterable__campaign_label_history_tmp\"\n\n),\n\nfields as (\n\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_iterable/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_iterable/macros/).\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n \n _fivetran_synced as _fivetran_synced,\n campaign_id as campaign_id,\n label as label,\n updated_at as updated_at\n \n\n\n\n\n \n \n\n\n\n\n\n, cast('postgres.public' as TEXT) as source_relation\n\n \n from base\n),\n\nfinal as (\n\n select\n source_relation,\n cast(campaign_id as TEXT) as campaign_id,\n label,\n updated_at,\n _fivetran_synced\n from fields\n)\n\nselect * \nfrom final", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.stg_iterable__template_history": {"database": "postgres", "schema": "public_iterable_dev", "name": "stg_iterable__template_history", "resource_type": "model", "package_name": "iterable", "path": "staging/stg_iterable__template_history.sql", "original_file_path": "models/staging/stg_iterable__template_history.sql", "unique_id": "model.iterable.stg_iterable__template_history", "fqn": ["iterable", "staging", "stg_iterable__template_history"], "alias": "stg_iterable__template_history", "checksum": {"name": "sha256", "checksum": "f0eaf9d44d7959a04ba079cbf711646772487aeafc89414b097dd5f230b44910"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "table", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "Table containing unique templates used across campaigns.", "columns": {"source_relation": {"name": "source_relation", "description": "Identifies the record's source.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": ["doc.iterable.source_relation"]}, "template_id": {"name": "template_id", "description": "Unique identifier of the template", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "template_name": {"name": "template_name", "description": "User defined name of the template", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "template_type": {"name": "template_type", "description": "The type of the template", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "created_at": {"name": "created_at", "description": "Creation timestamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "client_template_id": {"name": "client_template_id", "description": "Reference to the client template", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "creator_user_id": {"name": "creator_user_id", "description": "Reference to the user who created the template", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "message_type_id": {"name": "message_type_id", "description": "Reference to the message type associated with the template", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "updated_at": {"name": "updated_at", "description": "Last update timestamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "The time when a record was last updated by Fivetran.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": ["doc.iterable._fivetran_synced"]}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "iterable://models/staging/stg_iterable.yml", "build_path": null, "unrendered_config": {"materialized": "table", "schema": "iterable_{{ var('directed_schema','dev') }}", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789422569.911695, "relation_name": "\"postgres\".\"public_iterable_dev\".\"stg_iterable__template_history\"", "raw_code": "with base as (\n\n select * \n from {{ ref('stg_iterable__template_history_tmp') }}\n\n),\n\nfields as (\n\n select\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_iterable__template_history_tmp')),\n staging_columns=get_template_history_columns()\n )\n }}\n {{ fivetran_utils.apply_source_relation(package_name='iterable') }}\n\n from base\n),\n\nfinal as (\n\n select\n source_relation,\n cast(id as {{ dbt.type_string() }} ) as template_id,\n name as template_name,\n template_type,\n created_at,\n cast(client_template_id as {{ dbt.type_string() }} ) as client_template_id,\n cast(creator_user_id as {{ dbt.type_string() }} ) as creator_user_id,\n cast(message_type_id as {{ dbt.type_string() }} ) as message_type_id,\n updated_at,\n _fivetran_synced\n from fields\n)\n\nselect * \nfrom final", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__template_history_tmp", "package": null, "version": null}, {"name": "stg_iterable__template_history_tmp", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.iterable.get_template_history_columns", "macro.fivetran_utils.fill_staging_columns", "macro.fivetran_utils.apply_source_relation", "macro.dbt.type_string"], "nodes": ["model.iterable.stg_iterable__template_history_tmp"]}, "compiled_path": "target/compiled/iterable/models/staging/stg_iterable__template_history.sql", "compiled": true, "compiled_code": "with base as (\n\n select * \n from \"postgres\".\"public_iterable_dev\".\"stg_iterable__template_history_tmp\"\n\n),\n\nfields as (\n\n select\n \n _fivetran_synced as _fivetran_synced,\n client_template_id as client_template_id,\n created_at as created_at,\n creator_user_id as creator_user_id,\n id as id,\n message_type_id as message_type_id,\n name as name,\n template_type as template_type,\n updated_at as updated_at\n \n\n\n\n\n \n \n\n\n\n\n\n, cast('postgres.public' as TEXT) as source_relation\n\n\n from base\n),\n\nfinal as (\n\n select\n source_relation,\n cast(id as TEXT ) as template_id,\n name as template_name,\n template_type,\n created_at,\n cast(client_template_id as TEXT ) as client_template_id,\n cast(creator_user_id as TEXT ) as creator_user_id,\n cast(message_type_id as TEXT ) as message_type_id,\n updated_at,\n _fivetran_synced\n from fields\n)\n\nselect * \nfrom final", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.stg_iterable__journey": {"database": "postgres", "schema": "public_iterable_dev", "name": "stg_iterable__journey", "resource_type": "model", "package_name": "iterable", "path": "staging/stg_iterable__journey.sql", "original_file_path": "models/staging/stg_iterable__journey.sql", "unique_id": "model.iterable.stg_iterable__journey", "fqn": ["iterable", "staging", "stg_iterable__journey"], "alias": "stg_iterable__journey", "checksum": {"name": "sha256", "checksum": "d53993c3137351b54f560a3e0194593ea0d2787d328e2bc6cfe13977b35a3906"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "table", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "Table containing unique journeys, formerly known as workflows.", "columns": {"source_relation": {"name": "source_relation", "description": "Identifies the record's source.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": ["doc.iterable.source_relation"]}, "journey_id": {"name": "journey_id", "description": "Unique identifier of the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "journey_name": {"name": "journey_name", "description": "User defined name of the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "journey_type": {"name": "journey_type", "description": "Whether the journey is published or a draft", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "journey_description": {"name": "journey_description", "description": "Information about the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "creator_user_id": {"name": "creator_user_id", "description": "Reference to the user who created the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "is_enabled": {"name": "is_enabled", "description": "Boolean indicating if the journey is currently enabled", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "is_archived": {"name": "is_archived", "description": "Boolean indicating if the journey has been archived", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "lifetime_limit": {"name": "lifetime_limit", "description": "Maximum number of times a user may enter the journey over their lifetime", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "simultaneous_limit": {"name": "simultaneous_limit", "description": "Maximum number of times a user may be in the journey at the same time", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "start_tile_id": {"name": "start_tile_id", "description": "Reference to the tile which begins the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "trigger_event_names": {"name": "trigger_event_names", "description": "The event names which trigger a user's entry into the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "created_at": {"name": "created_at", "description": "Creation timestamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "updated_at": {"name": "updated_at", "description": "Last update timestamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "The time when a record was last updated by Fivetran.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": ["doc.iterable._fivetran_synced"]}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "iterable://models/staging/stg_iterable.yml", "build_path": null, "unrendered_config": {"materialized": "table", "schema": "iterable_{{ var('directed_schema','dev') }}", "enabled": "var('iterable__using_journey', True)", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789422569.905762, "relation_name": "\"postgres\".\"public_iterable_dev\".\"stg_iterable__journey\"", "raw_code": "{{ config(enabled=var('iterable__using_journey', True)) }}\n\n{% set source_columns_in_relation = adapter.get_columns_in_relation(ref('stg_iterable__journey_tmp')) %}\n\nwith base as (\n\n select *\n from {{ ref('stg_iterable__journey_tmp') }}\n\n),\n\nfields as (\n\n select\n\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=source_columns_in_relation,\n staging_columns=get_journey_columns()\n )\n }}\n {{ fivetran_utils.apply_source_relation(package_name='iterable') }}\n\n from base\n),\n\nfinal as (\n\n select\n source_relation,\n cast(id as {{ dbt.type_string() }} ) as journey_id,\n name as journey_name,\n journey_type,\n description as journey_description,\n cast(creator_user_id as {{ dbt.type_string() }} ) as creator_user_id,\n enabled as is_enabled,\n is_archived,\n lifetime_limit,\n simultaneous_limit,\n cast(start_tile_id as {{ dbt.type_string() }} ) as start_tile_id,\n {{ iterable.json_to_string(\"trigger_event_names\", source_columns_in_relation) }} as trigger_event_names,\n created_at,\n updated_at,\n _fivetran_synced\n\n --The below script allows for pass through columns.\n {{ fivetran_utils.fill_pass_through_columns('iterable_journey_pass_through_columns') }}\n\n from fields\n where not coalesce(_fivetran_deleted, false)\n)\n\nselect *\nfrom final", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__journey_tmp", "package": null, "version": null}, {"name": "stg_iterable__journey_tmp", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.iterable.get_journey_columns", "macro.fivetran_utils.fill_staging_columns", "macro.fivetran_utils.apply_source_relation", "macro.dbt.type_string", "macro.iterable.json_to_string", "macro.fivetran_utils.fill_pass_through_columns"], "nodes": ["model.iterable.stg_iterable__journey_tmp"]}, "compiled_path": "target/compiled/iterable/models/staging/stg_iterable__journey.sql", "compiled": true, "compiled_code": "\n\n\n\nwith base as (\n\n select *\n from \"postgres\".\"public_iterable_dev\".\"stg_iterable__journey_tmp\"\n\n),\n\nfields as (\n\n select\n\n \n _fivetran_deleted as _fivetran_deleted,\n _fivetran_synced as _fivetran_synced,\n created_at as created_at,\n creator_user_id as creator_user_id,\n description as description,\n enabled as enabled,\n id as id,\n is_archived as is_archived,\n journey_type as journey_type,\n lifetime_limit as lifetime_limit,\n name as name,\n simultaneous_limit as simultaneous_limit,\n start_tile_id as start_tile_id,\n trigger_event_names as trigger_event_names,\n updated_at as updated_at\n \n\n\n\n\n \n \n\n\n\n\n\n, cast('postgres.public' as TEXT) as source_relation\n\n\n from base\n),\n\nfinal as (\n\n select\n source_relation,\n cast(id as TEXT ) as journey_id,\n name as journey_name,\n journey_type,\n description as journey_description,\n cast(creator_user_id as TEXT ) as creator_user_id,\n enabled as is_enabled,\n is_archived,\n lifetime_limit,\n simultaneous_limit,\n cast(start_tile_id as TEXT ) as start_tile_id,\n cast(trigger_event_names as TEXT) as trigger_event_names,\n created_at,\n updated_at,\n _fivetran_synced\n\n --The below script allows for pass through columns.\n \n\n\n\n\n\n from fields\n where not coalesce(_fivetran_deleted, false)\n)\n\nselect *\nfrom final", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.stg_iterable__user_history": {"database": "postgres", "schema": "public_iterable_dev", "name": "stg_iterable__user_history", "resource_type": "model", "package_name": "iterable", "path": "staging/stg_iterable__user_history.sql", "original_file_path": "models/staging/stg_iterable__user_history.sql", "unique_id": "model.iterable.stg_iterable__user_history", "fqn": ["iterable", "staging", "stg_iterable__user_history"], "alias": "stg_iterable__user_history", "checksum": {"name": "sha256", "checksum": "632b1ddaf71b0cb861ae314c40c6a68a25371b8646d2fa2334c4eb7149227251"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "Table containing individual user history information.", "columns": {"source_relation": {"name": "source_relation", "description": "Identifies the record's source.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": ["doc.iterable.source_relation"]}, "unique_user_key": {"name": "unique_user_key", "description": "The unique identifier of the user. With the new schema (Aug 2023), it is the _fivetran_user_id. This is a hash of user_id and/or email, depending on project type. If using the old schema, it is email.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "email": {"name": "email", "description": "The user's email. User identifier, for email-based projects. Previously was the unique identifier for user records, for the old Iterable schema before the August 2023 updates.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "user_id": {"name": "user_id", "description": "User identifier, for userID-based projects.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "first_name": {"name": "first_name", "description": "First name of the user", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "last_name": {"name": "last_name", "description": "Last name of the user", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "email_list_ids": {"name": "email_list_ids", "description": "[DEPRECATED October 13, 2025. Use LIST_USER source instead.] Array of references to the lists associated with the user.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "signup_date": {"name": "signup_date", "description": "Timestamp of when the user signed up", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "signup_source": {"name": "signup_source", "description": "Source where the user signed up", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "updated_at": {"name": "updated_at", "description": "Last update timestamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "phone_number": {"name": "phone_number", "description": "Phone number associated with the user", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "iterable_user_id": {"name": "iterable_user_id", "description": "Another user identifier, for userID-based projects", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "_fivetran_user_id": {"name": "_fivetran_user_id", "description": "A Fivetran-created unique identifier for users, derived from hashing user_id and/or email, depending on project type. This exists for users of the new schema starting Aug 2023. In the old schema, the unique identifier is email.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "The time when a record was last updated by Fivetran.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": ["doc.iterable._fivetran_synced"]}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "iterable://models/staging/stg_iterable.yml", "build_path": null, "unrendered_config": {"materialized": "view", "schema": "iterable_{{ var('directed_schema','dev') }}", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789422569.9145842, "relation_name": "\"postgres\".\"public_iterable_dev\".\"stg_iterable__user_history\"", "raw_code": "{{ config(materialized='view') }}\n{% set source_columns_in_relation = adapter.get_columns_in_relation(ref('stg_iterable__user_history_tmp')) %}\n\n\nwith base as (\n\n select * \n from {{ ref('stg_iterable__user_history_tmp') }}\n\n),\n\nfields as (\n\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_iterable/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_iterable/macros/).\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=source_columns_in_relation,\n staging_columns=get_user_history_columns()\n )\n }}\n {{ fivetran_utils.apply_source_relation(package_name='iterable') }}\n\n from base\n),\n\nfinal as (\n\n select\n source_relation,\n cast(_fivetran_id as {{ dbt.type_string() }} ) as _fivetran_user_id,\n lower(email) as email,\n updated_at,\n cast(user_id as {{ dbt.type_string() }} ) as user_id,\n first_name,\n last_name,\n {{ iterable.json_to_string(\"email_list_ids\", source_columns_in_relation) }} as email_list_ids,\n phone_number,\n signup_date,\n signup_source,\n cast(iterable_user_id as {{ dbt.type_string() }} ) as iterable_user_id,\n _fivetran_synced,\n coalesce(cast(_fivetran_id as {{ dbt.type_string() }} ) , email) as unique_user_key\n\n {{ fivetran_utils.fill_pass_through_columns('iterable_user_history_pass_through_columns') }}\n\n from fields\n)\n\nselect *\nfrom final", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__user_history_tmp", "package": null, "version": null}, {"name": "stg_iterable__user_history_tmp", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.iterable.get_user_history_columns", "macro.fivetran_utils.fill_staging_columns", "macro.fivetran_utils.apply_source_relation", "macro.dbt.type_string", "macro.iterable.json_to_string", "macro.fivetran_utils.fill_pass_through_columns"], "nodes": ["model.iterable.stg_iterable__user_history_tmp"]}, "compiled_path": "target/compiled/iterable/models/staging/stg_iterable__user_history.sql", "compiled": true, "compiled_code": "\n\n\n\nwith base as (\n\n select * \n from \"postgres\".\"public_iterable_dev\".\"stg_iterable__user_history_tmp\"\n\n),\n\nfields as (\n\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_iterable/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_iterable/macros/).\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n \n cast(null as TEXT) as _fivetran_id,\n _fivetran_synced as _fivetran_synced,\n email as email,\n email_list_ids as email_list_ids,\n first_name as first_name,\n last_name as last_name,\n phone_number as phone_number,\n signup_date as signup_date,\n signup_source as signup_source,\n updated_at as updated_at,\n user_id as user_id,\n iterable_user_id as iterable_user_id\n \n\n\n\n\n \n \n\n\n\n\n\n, cast('postgres.public' as TEXT) as source_relation\n\n\n from base\n),\n\nfinal as (\n\n select\n source_relation,\n cast(_fivetran_id as TEXT ) as _fivetran_user_id,\n lower(email) as email,\n updated_at,\n cast(user_id as TEXT ) as user_id,\n first_name,\n last_name,\n cast(email_list_ids as TEXT) as email_list_ids,\n phone_number,\n signup_date,\n signup_source,\n cast(iterable_user_id as TEXT ) as iterable_user_id,\n _fivetran_synced,\n coalesce(cast(_fivetran_id as TEXT ) , email) as unique_user_key\n\n \n\n\n\n\n\n from fields\n)\n\nselect *\nfrom final", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.stg_iterable__user_unsub_message_type": {"database": "postgres", "schema": "public_iterable_dev", "name": "stg_iterable__user_unsub_message_type", "resource_type": "model", "package_name": "iterable", "path": "staging/stg_iterable__user_unsub_message_type.sql", "original_file_path": "models/staging/stg_iterable__user_unsub_message_type.sql", "unique_id": "model.iterable.stg_iterable__user_unsub_message_type", "fqn": ["iterable", "staging", "stg_iterable__user_unsub_message_type"], "alias": "stg_iterable__user_unsub_message_type", "checksum": {"name": "sha256", "checksum": "82bd48604365ec4a7a3309f2ce007e169add2c902675e5d1da155edc32a6bb71"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "table", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "Table containing the message types from which a user has unsubscribed. \"Unsubscribed\" is shortened to \"unsub\" for postgres compatibility.", "columns": {"source_relation": {"name": "source_relation", "description": "Identifies the record's source.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": ["doc.iterable.source_relation"]}, "message_type_id": {"name": "message_type_id", "description": "Reference to the message type from which the user unsubscribed", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unsub_message_type_unique_key": {"name": "unsub_message_type_unique_key", "description": "A surrogate key providing a unique key for each record. If using user_unsubscribed_message_type_history, it uses '_fivetran_id', 'email', 'message_type_id', 'updated_at', and 'source_relation'. If not using the history table, it uses '_fivetran_id', 'message_type_id', and 'source_relation'.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "_fivetran_user_id": {"name": "_fivetran_user_id", "description": "A Fivetran-created unique identifier for users, derived from hashing user_id and/or email, depending on project type. This exists for users of the new schema starting Aug 2023. In the old schema, the unique identifier is email.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_user_key": {"name": "unique_user_key", "description": "The unique identifier of the user. With the new schema (Aug 2023), it is the _fivetran_user_id. This is a hash of user_id and/or email, depending on project type. If using the old schema, it is email.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "latest_batch_index": {"name": "latest_batch_index", "description": "Indexes each user record based on the most recent available.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "updated_at": {"name": "updated_at", "description": "Last update timestamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "The time when a record was last updated by Fivetran.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": ["doc.iterable._fivetran_synced"]}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "iterable://models/staging/stg_iterable.yml", "build_path": null, "unrendered_config": {"materialized": "table", "schema": "iterable_{{ var('directed_schema','dev') }}", "enabled": "var('iterable__using_user_unsubscribed_message_type', True)", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789422569.9176872, "relation_name": "\"postgres\".\"public_iterable_dev\".\"stg_iterable__user_unsub_message_type\"", "raw_code": "{{ config(enabled=var('iterable__using_user_unsubscribed_message_type', True)) }}\n\nwith base as (\n\n select * \n from {{ ref('stg_iterable__user_unsub_message_type_tmp') }}\n\n),\n\nfields as (\n\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_iterable/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_iterable/macros/).\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_iterable__user_unsub_message_type_tmp')),\n staging_columns=get_user_unsubscribed_message_type_columns()\n )\n }}\n {{ fivetran_utils.apply_source_relation(package_name='iterable') }}\n\n from base\n),\n\nfinal as (\n\n select\n source_relation,\n cast(_fivetran_id as {{ dbt.type_string() }} ) as _fivetran_user_id,\n coalesce(cast(_fivetran_id as {{ dbt.type_string() }} ), email) as unique_user_key,\n cast(message_type_id as {{ dbt.type_string() }} ) as message_type_id,\n {{ dbt_utils.generate_surrogate_key(['_fivetran_id', 'email', 'message_type_id','updated_at','source_relation']) }} as unsub_message_type_unique_key,\n\n {% if does_table_exist('user_unsubscribed_message_type') == false %}\n rank() over(partition by email, message_type_id{{ fivetran_utils.partition_by_source_relation(package_name='iterable') }} order by updated_at desc) as latest_batch_index,\n {% else %}\n 1 as latest_batch_index,\n {% endif %}\n\n updated_at,\n _fivetran_synced\n\n from fields\n)\n\nselect *\nfrom final", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__user_unsub_message_type_tmp", "package": null, "version": null}, {"name": "stg_iterable__user_unsub_message_type_tmp", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.iterable.get_user_unsubscribed_message_type_columns", "macro.fivetran_utils.fill_staging_columns", "macro.fivetran_utils.apply_source_relation", "macro.dbt.type_string", "macro.dbt_utils.generate_surrogate_key", "macro.iterable.does_table_exist"], "nodes": ["model.iterable.stg_iterable__user_unsub_message_type_tmp"]}, "compiled_path": "target/compiled/iterable/models/staging/stg_iterable__user_unsub_message_type.sql", "compiled": true, "compiled_code": "\n\nwith base as (\n\n select * \n from \"postgres\".\"public_iterable_dev\".\"stg_iterable__user_unsub_message_type_tmp\"\n\n),\n\nfields as (\n\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_iterable/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_iterable/macros/).\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n \n _fivetran_synced as _fivetran_synced,\n _fivetran_id as _fivetran_id,\n message_type_id as message_type_id,\n cast(null as TEXT) as email,\n cast(null as timestamp) as updated_at\n \n\n\n\n\n \n \n\n\n\n\n\n, cast('postgres.public' as TEXT) as source_relation\n\n\n from base\n),\n\nfinal as (\n\n select\n source_relation,\n cast(_fivetran_id as TEXT ) as _fivetran_user_id,\n coalesce(cast(_fivetran_id as TEXT ), email) as unique_user_key,\n cast(message_type_id as TEXT ) as message_type_id,\n md5(cast(coalesce(cast(_fivetran_id as TEXT), '_dbt_utils_surrogate_key_null_') || '-' || coalesce(cast(email as TEXT), '_dbt_utils_surrogate_key_null_') || '-' || coalesce(cast(message_type_id as TEXT), '_dbt_utils_surrogate_key_null_') || '-' || coalesce(cast(updated_at as TEXT), '_dbt_utils_surrogate_key_null_') || '-' || coalesce(cast(source_relation as TEXT), '_dbt_utils_surrogate_key_null_') as TEXT)) as unsub_message_type_unique_key,\n\n \n 1 as latest_batch_index,\n \n\n updated_at,\n _fivetran_synced\n\n from fields\n)\n\nselect *\nfrom final", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.stg_iterable__list": {"database": "postgres", "schema": "public_iterable_dev", "name": "stg_iterable__list", "resource_type": "model", "package_name": "iterable", "path": "staging/stg_iterable__list.sql", "original_file_path": "models/staging/stg_iterable__list.sql", "unique_id": "model.iterable.stg_iterable__list", "fqn": ["iterable", "staging", "stg_iterable__list"], "alias": "stg_iterable__list", "checksum": {"name": "sha256", "checksum": "b2a6869e5186282b7f5c8173ecba41c0324c1dc31df78db2418f51f2578eaa21"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "table", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "Table containing users and the lists the users are associated with.", "columns": {"source_relation": {"name": "source_relation", "description": "Identifies the record's source.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": ["doc.iterable.source_relation"]}, "list_id": {"name": "list_id", "description": "Unique identifier of the list", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "list_name": {"name": "list_name", "description": "User defined name of the list", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "list_type": {"name": "list_type", "description": "The list type", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "created_at": {"name": "created_at", "description": "Creation timestamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "list_description": {"name": "list_description", "description": "Information about the list", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "The time when a record was last updated by Fivetran.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": ["doc.iterable._fivetran_synced"]}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "iterable://models/staging/stg_iterable.yml", "build_path": null, "unrendered_config": {"materialized": "table", "schema": "iterable_{{ var('directed_schema','dev') }}", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789422569.9070663, "relation_name": "\"postgres\".\"public_iterable_dev\".\"stg_iterable__list\"", "raw_code": "with base as (\n\n select * \n from {{ ref('stg_iterable__list_tmp') }}\n\n),\n\nfields as (\n\n select\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_iterable__list_tmp')),\n staging_columns=get_list_columns()\n )\n }}\n {{ fivetran_utils.apply_source_relation(package_name='iterable') }}\n \n from base\n),\n\nfinal as (\n\n select\n source_relation,\n id as list_id,\n name as list_name,\n list_type,\n created_at,\n description as list_description,\n _fivetran_synced\n from fields\n where not coalesce(_fivetran_deleted, true)\n)\n\nselect * \nfrom final", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__list_tmp", "package": null, "version": null}, {"name": "stg_iterable__list_tmp", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.iterable.get_list_columns", "macro.fivetran_utils.fill_staging_columns", "macro.fivetran_utils.apply_source_relation"], "nodes": ["model.iterable.stg_iterable__list_tmp"]}, "compiled_path": "target/compiled/iterable/models/staging/stg_iterable__list.sql", "compiled": true, "compiled_code": "with base as (\n\n select * \n from \"postgres\".\"public_iterable_dev\".\"stg_iterable__list_tmp\"\n\n),\n\nfields as (\n\n select\n \n _fivetran_deleted as _fivetran_deleted,\n _fivetran_synced as _fivetran_synced,\n created_at as created_at,\n id as id,\n list_type as list_type,\n description as description,\n name as name\n \n\n\n\n\n \n \n\n\n\n\n\n, cast('postgres.public' as TEXT) as source_relation\n\n \n from base\n),\n\nfinal as (\n\n select\n source_relation,\n id as list_id,\n name as list_name,\n list_type,\n created_at,\n description as list_description,\n _fivetran_synced\n from fields\n where not coalesce(_fivetran_deleted, true)\n)\n\nselect * \nfrom final", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.stg_iterable__list_user": {"database": "postgres", "schema": "public_iterable_dev", "name": "stg_iterable__list_user", "resource_type": "model", "package_name": "iterable", "path": "staging/stg_iterable__list_user.sql", "original_file_path": "models/staging/stg_iterable__list_user.sql", "unique_id": "model.iterable.stg_iterable__list_user", "fqn": ["iterable", "staging", "stg_iterable__list_user"], "alias": "stg_iterable__list_user", "checksum": {"name": "sha256", "checksum": "f3fe66e05562725c91948ac2023c649573560043aa82c03fe93f6232f6600954"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "table", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "Table containing the relationship between users and lists they belong to.", "columns": {"source_relation": {"name": "source_relation", "description": "Identifies the record's source.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": ["doc.iterable.source_relation"]}, "_fivetran_user_id": {"name": "_fivetran_user_id", "description": "Unique identifier of the list-user relationship record, serving as a foreign key to `stg_iterable__user_history._fivetran_id`.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "list_user_index": {"name": "list_user_index", "description": "Index of the record", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "list_id": {"name": "list_id", "description": "Reference to the list that the user belongs to", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "The time when a record was last updated by Fivetran.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": ["doc.iterable._fivetran_synced"]}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "iterable://models/staging/stg_iterable.yml", "build_path": null, "unrendered_config": {"materialized": "table", "schema": "iterable_{{ var('directed_schema','dev') }}", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789422569.9129884, "relation_name": "\"postgres\".\"public_iterable_dev\".\"stg_iterable__list_user\"", "raw_code": "{% set source_columns_in_relation = adapter.get_columns_in_relation(ref('stg_iterable__list_user_tmp')) %}\n\nwith base as (\n\n select *\n from {{ ref('stg_iterable__list_user_tmp') }}\n\n),\n\nfields as (\n\n select\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=source_columns_in_relation,\n staging_columns=get_list_user_columns()\n )\n }}\n {{ fivetran_utils.apply_source_relation(package_name='iterable') }}\n\n from base\n),\n\nfinal as (\n\n select\n source_relation,\n cast(_fivetran_id as {{ dbt.type_string() }} ) as _fivetran_user_id,\n index as list_user_index,\n list_id,\n _fivetran_synced\n\n from fields\n)\n\nselect *\nfrom final", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__list_user_tmp", "package": null, "version": null}, {"name": "stg_iterable__list_user_tmp", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.iterable.get_list_user_columns", "macro.fivetran_utils.fill_staging_columns", "macro.fivetran_utils.apply_source_relation", "macro.dbt.type_string"], "nodes": ["model.iterable.stg_iterable__list_user_tmp"]}, "compiled_path": "target/compiled/iterable/models/staging/stg_iterable__list_user.sql", "compiled": true, "compiled_code": "\n\nwith base as (\n\n select *\n from \"postgres\".\"public_iterable_dev\".\"stg_iterable__list_user_tmp\"\n\n),\n\nfields as (\n\n select\n \n _fivetran_id as _fivetran_id,\n _fivetran_synced as _fivetran_synced,\n index as index,\n list_id as list_id\n \n\n\n\n\n \n \n\n\n\n\n\n, cast('postgres.public' as TEXT) as source_relation\n\n\n from base\n),\n\nfinal as (\n\n select\n source_relation,\n cast(_fivetran_id as TEXT ) as _fivetran_user_id,\n index as list_user_index,\n list_id,\n _fivetran_synced\n\n from fields\n)\n\nselect *\nfrom final", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.stg_iterable__campaign_suppression_list_history": {"database": "postgres", "schema": "public_iterable_dev", "name": "stg_iterable__campaign_suppression_list_history", "resource_type": "model", "package_name": "iterable", "path": "staging/stg_iterable__campaign_suppression_list_history.sql", "original_file_path": "models/staging/stg_iterable__campaign_suppression_list_history.sql", "unique_id": "model.iterable.stg_iterable__campaign_suppression_list_history", "fqn": ["iterable", "staging", "stg_iterable__campaign_suppression_list_history"], "alias": "stg_iterable__campaign_suppression_list_history", "checksum": {"name": "sha256", "checksum": "695d57ff7cf14d55ef6881ee9184e873c2cdc7fd61bfd9fbb0cb3330fe055ae0"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "table", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "Table containing a history of suppression lists.", "columns": {"source_relation": {"name": "source_relation", "description": "Identifies the record's source.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": ["doc.iterable.source_relation"]}, "campaign_id": {"name": "campaign_id", "description": "Reference to the campaign associated with the label", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "suppressed_list_id": {"name": "suppressed_list_id", "description": "Reference to the list used", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "updated_at": {"name": "updated_at", "description": "Last update timestamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "The time when a record was last updated by Fivetran.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": ["doc.iterable._fivetran_synced"]}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "iterable://models/staging/stg_iterable.yml", "build_path": null, "unrendered_config": {"materialized": "table", "schema": "iterable_{{ var('directed_schema','dev') }}", "enabled": "var('iterable__using_campaign_suppression_list_history', True)", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789422569.8991418, "relation_name": "\"postgres\".\"public_iterable_dev\".\"stg_iterable__campaign_suppression_list_history\"", "raw_code": "{{ config(enabled=var('iterable__using_campaign_suppression_list_history', True)) }}\n\nwith base as (\n\n select * \n from {{ ref('stg_iterable__campaign_suppression_list_history_tmp') }}\n\n),\n\nfields as (\n\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_iterable/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_iterable/macros/).\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_iterable__campaign_suppression_list_history_tmp')),\n staging_columns=get_campaign_suppression_list_history_columns()\n )\n }}\n {{ fivetran_utils.apply_source_relation(package_name='iterable') }}\n\n from base\n),\n\nfinal as (\n\n select\n source_relation,\n cast(campaign_id as {{ dbt.type_string() }}) as campaign_id,\n cast(suppressed_list_id as {{ dbt.type_string() }}) as suppressed_list_id,\n updated_at,\n _fivetran_synced\n from fields\n)\n\nselect * \nfrom final", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__campaign_suppression_list_history_tmp", "package": null, "version": null}, {"name": "stg_iterable__campaign_suppression_list_history_tmp", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.iterable.get_campaign_suppression_list_history_columns", "macro.fivetran_utils.fill_staging_columns", "macro.fivetran_utils.apply_source_relation", "macro.dbt.type_string"], "nodes": ["model.iterable.stg_iterable__campaign_suppression_list_history_tmp"]}, "compiled_path": "target/compiled/iterable/models/staging/stg_iterable__campaign_suppression_list_history.sql", "compiled": true, "compiled_code": "\n\nwith base as (\n\n select * \n from \"postgres\".\"public_iterable_dev\".\"stg_iterable__campaign_suppression_list_history_tmp\"\n\n),\n\nfields as (\n\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_iterable/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_iterable/macros/).\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n \n _fivetran_synced as _fivetran_synced,\n campaign_id as campaign_id,\n suppressed_list_id as suppressed_list_id,\n updated_at as updated_at\n \n\n\n\n\n \n \n\n\n\n\n\n, cast('postgres.public' as TEXT) as source_relation\n\n\n from base\n),\n\nfinal as (\n\n select\n source_relation,\n cast(campaign_id as TEXT) as campaign_id,\n cast(suppressed_list_id as TEXT) as suppressed_list_id,\n updated_at,\n _fivetran_synced\n from fields\n)\n\nselect * \nfrom final", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.stg_iterable__event_extension": {"database": "postgres", "schema": "public_iterable_dev", "name": "stg_iterable__event_extension", "resource_type": "model", "package_name": "iterable", "path": "staging/stg_iterable__event_extension.sql", "original_file_path": "models/staging/stg_iterable__event_extension.sql", "unique_id": "model.iterable.stg_iterable__event_extension", "fqn": ["iterable", "staging", "stg_iterable__event_extension"], "alias": "stg_iterable__event_extension", "checksum": {"name": "sha256", "checksum": "006d3abf1fe12ef7312b3f02d07a13a483883e57acfe0fceedb3e6a9f71372ff"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "Table containing addition properties from the event table.", "columns": {"source_relation": {"name": "source_relation", "description": "Identifies the record's source.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": ["doc.iterable.source_relation"]}, "event_id": {"name": "event_id", "description": "A Fivetran-created unique identifier derived from hashing campaign_id, created_at, and event_name.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_event_id": {"name": "unique_event_id", "description": "A surrogate key made up of event_id, _fivetran_user_id, and source_relation.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "is_app_already_running": {"name": "is_app_already_running", "description": "Boolean indicating if the app is currently running or not", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "badge": {"name": "badge", "description": "Badge associated with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "canonical_url_id": {"name": "canonical_url_id", "description": "Reference to the url associated with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "is_content_available": {"name": "is_content_available", "description": "Content available from the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "content_id": {"name": "content_id", "description": "Reference to the content associated with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "device": {"name": "device", "description": "The device associated with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "email_id": {"name": "email_id", "description": "Reference to the email associated with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "email_subject": {"name": "email_subject", "description": "Subject of the email associated with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "experiment_id": {"name": "experiment_id", "description": "Reference to the experiment used if the event is an experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "from_phone_number_id": {"name": "from_phone_number_id", "description": "Reference to the phone number which the event is from", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "from_smssender_id": {"name": "from_smssender_id", "description": "Reference to the sms sender which the event is from", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "link_id": {"name": "link_id", "description": "Reference to the link associated with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "link_url": {"name": "link_url", "description": "Url of the link associated with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "locale": {"name": "locale", "description": "Locale associated with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "payload": {"name": "payload", "description": "Payload resulted from the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "platform_endpoint": {"name": "platform_endpoint", "description": "The specific platform endpoint of the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "push_message": {"name": "push_message", "description": "Boolean indicating if the event is a push message", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "region": {"name": "region", "description": "Region of the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "sms_message": {"name": "sms_message", "description": "Boolean indicating if the event is an sms message", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "to_phone_number": {"name": "to_phone_number", "description": "To phone number associated with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "url": {"name": "url", "description": "Url associated with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "workflow_id": {"name": "workflow_id", "description": "Reference to the workflow which the event originated", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "workflow_name": {"name": "workflow_name", "description": "Name of the workflow which the event originated", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "catalog_collection_count": {"name": "catalog_collection_count", "description": "The count of products or items collected in a catalog associated with the event.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "catalog_lookup_count": {"name": "catalog_lookup_count", "description": "The count of times a catalog was looked up or queried during the event.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "city": {"name": "city", "description": "The city associated with the event, which could be the location of the recipient.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "clicked_url": {"name": "clicked_url", "description": "The URL that was clicked by the recipient in response to the marketing message.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "country": {"name": "country", "description": "The country associated with the event, which could be the location of the recipient.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "error_code": {"name": "error_code", "description": "The error code or message indicating any issues or errors encountered during the event.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "expires_at": {"name": "expires_at", "description": "The date and time when the event or message is set to expire or become invalid.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "from_phone_number": {"name": "from_phone_number", "description": "The phone number from which the SMS message was sent.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "in_app_body": {"name": "in_app_body", "description": "The content or body of an in-app message that was sent as part of the event.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "is_sms_estimation": {"name": "is_sms_estimation", "description": "A boolean indicating whether the SMS message is an estimation or not.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "labels": {"name": "labels", "description": "Any labels or tags associated with the event, which can be used for categorization or organization.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "message_status": {"name": "message_status", "description": "The status of the marketing message, such as sent, delivered, opened, etc.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "mms_send_count": {"name": "mms_send_count", "description": "The count of multimedia messages (MMS) sent as part of the event.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "reason": {"name": "reason", "description": "The reason or cause associated with a specific event or action.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "sms_send_count": {"name": "sms_send_count", "description": "The count of SMS messages sent as part of the event.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "_fivetran_user_id": {"name": "_fivetran_user_id", "description": "A Fivetran-created unique identifier for users, derived from hashing user_id and/or email, depending on project type. This exists for users of the new schema starting Aug 2023. In the old schema, the unique identifier is email.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "The time when a record was last updated by Fivetran.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": ["doc.iterable._fivetran_synced"]}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "iterable://models/staging/stg_iterable.yml", "build_path": null, "unrendered_config": {"materialized": "view", "schema": "iterable_{{ var('directed_schema','dev') }}", "enabled": "var('iterable__using_event_extension', True)", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789422569.9044106, "relation_name": "\"postgres\".\"public_iterable_dev\".\"stg_iterable__event_extension\"", "raw_code": "{{ config(\n enabled=var('iterable__using_event_extension', True),\n materialized='view'\n) }}\n\nwith base as (\n\n select * \n from {{ ref('stg_iterable__event_extension_tmp') }}\n\n),\n\nfields as (\n\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_iterable/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_iterable/macros/).\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_iterable__event_extension_tmp')),\n staging_columns=get_event_extension_columns()\n )\n }}\n {{ fivetran_utils.apply_source_relation(package_name='iterable') }}\n\n from base\n),\n\nfinal as (\n select\n source_relation,\n cast(_fivetran_id as {{ dbt.type_string() }} ) as event_id,\n {{ dbt_utils.generate_surrogate_key(['_fivetran_id','_fivetran_user_id','source_relation']) }} as unique_event_id,\n app_already_running as is_app_already_running,\n badge,\n catalog_collection_count,\n catalog_lookup_count,\n cast(canonical_url_id as {{ dbt.type_string() }} ) as canonical_url_id,\n content_available as is_content_available,\n cast(content_id as {{ dbt.type_string() }} ) as content_id,\n device,\n cast(email_id as {{ dbt.type_string() }}) as email_id,\n email_subject,\n experiment_id,\n from_phone_number_id,\n from_smssender_id,\n cast(link_id as {{ dbt.type_string() }} ) as link_id,\n link_url,\n locale,\n payload,\n platform_endpoint,\n push_message,\n region,\n sms_message,\n to_phone_number,\n url,\n cast(workflow_id as {{ dbt.type_string() }} ) as workflow_id,\n workflow_name,\n city,\n clicked_url,\n country,\n error_code,\n expires_at,\n from_phone_number,\n in_app_body,\n is_sms_estimation,\n labels,\n message_status,\n mms_send_count,\n reason,\n sms_send_count,\n _fivetran_synced,\n cast(_fivetran_user_id as {{ dbt.type_string() }} ) as _fivetran_user_id\n\n --The below script allows for pass through columns.\n {{ fivetran_utils.fill_pass_through_columns('iterable_event_extension_pass_through_columns') }}\n\n from fields\n)\n\nselect *\nfrom final", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__event_extension_tmp", "package": null, "version": null}, {"name": "stg_iterable__event_extension_tmp", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.iterable.get_event_extension_columns", "macro.fivetran_utils.fill_staging_columns", "macro.fivetran_utils.apply_source_relation", "macro.dbt.type_string", "macro.dbt_utils.generate_surrogate_key", "macro.fivetran_utils.fill_pass_through_columns"], "nodes": ["model.iterable.stg_iterable__event_extension_tmp"]}, "compiled_path": "target/compiled/iterable/models/staging/stg_iterable__event_extension.sql", "compiled": true, "compiled_code": "\n\nwith base as (\n\n select * \n from \"postgres\".\"public_iterable_dev\".\"stg_iterable__event_extension_tmp\"\n\n),\n\nfields as (\n\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_iterable/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_iterable/macros/).\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n \n _fivetran_id as _fivetran_id,\n _fivetran_synced as _fivetran_synced,\n app_already_running as app_already_running,\n badge as badge,\n catalog_collection_count as catalog_collection_count,\n catalog_lookup_count as catalog_lookup_count,\n canonical_url_id as canonical_url_id,\n content_available as content_available,\n content_id as content_id,\n device as device,\n email_id as email_id,\n email_subject as email_subject,\n experiment_id as experiment_id,\n from_phone_number_id as from_phone_number_id,\n from_smssender_id as from_smssender_id,\n link_id as link_id,\n link_url as link_url,\n locale as locale,\n payload as payload,\n platform_endpoint as platform_endpoint,\n push_message as push_message,\n region as region,\n sms_message as sms_message,\n to_phone_number as to_phone_number,\n url as url,\n workflow_id as workflow_id,\n workflow_name as workflow_name,\n city as city,\n clicked_url as clicked_url,\n country as country,\n error_code as error_code,\n expires_at as expires_at,\n from_phone_number as from_phone_number,\n in_app_body as in_app_body,\n is_sms_estimation as is_sms_estimation,\n labels as labels,\n message_status as message_status,\n mms_send_count as mms_send_count,\n reason as reason,\n sms_send_count as sms_send_count,\n _fivetran_user_id as _fivetran_user_id\n \n\n\n\n\n \n \n\n\n\n\n\n, cast('postgres.public' as TEXT) as source_relation\n\n\n from base\n),\n\nfinal as (\n select\n source_relation,\n cast(_fivetran_id as TEXT ) as event_id,\n md5(cast(coalesce(cast(_fivetran_id as TEXT), '_dbt_utils_surrogate_key_null_') || '-' || coalesce(cast(_fivetran_user_id as TEXT), '_dbt_utils_surrogate_key_null_') || '-' || coalesce(cast(source_relation as TEXT), '_dbt_utils_surrogate_key_null_') as TEXT)) as unique_event_id,\n app_already_running as is_app_already_running,\n badge,\n catalog_collection_count,\n catalog_lookup_count,\n cast(canonical_url_id as TEXT ) as canonical_url_id,\n content_available as is_content_available,\n cast(content_id as TEXT ) as content_id,\n device,\n cast(email_id as TEXT) as email_id,\n email_subject,\n experiment_id,\n from_phone_number_id,\n from_smssender_id,\n cast(link_id as TEXT ) as link_id,\n link_url,\n locale,\n payload,\n platform_endpoint,\n push_message,\n region,\n sms_message,\n to_phone_number,\n url,\n cast(workflow_id as TEXT ) as workflow_id,\n workflow_name,\n city,\n clicked_url,\n country,\n error_code,\n expires_at,\n from_phone_number,\n in_app_body,\n is_sms_estimation,\n labels,\n message_status,\n mms_send_count,\n reason,\n sms_send_count,\n _fivetran_synced,\n cast(_fivetran_user_id as TEXT ) as _fivetran_user_id\n\n --The below script allows for pass through columns.\n \n\n\n\n\n\n from fields\n)\n\nselect *\nfrom final", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.stg_iterable__campaign_list_history": {"database": "postgres", "schema": "public_iterable_dev", "name": "stg_iterable__campaign_list_history", "resource_type": "model", "package_name": "iterable", "path": "staging/stg_iterable__campaign_list_history.sql", "original_file_path": "models/staging/stg_iterable__campaign_list_history.sql", "unique_id": "model.iterable.stg_iterable__campaign_list_history", "fqn": ["iterable", "staging", "stg_iterable__campaign_list_history"], "alias": "stg_iterable__campaign_list_history", "checksum": {"name": "sha256", "checksum": "c7db9c46a66fec00d9fbd6492c0ea17397ec80a12d85fa2d63b9f04f09c45013"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "table", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "Table containing a history of lists.", "columns": {"source_relation": {"name": "source_relation", "description": "Identifies the record's source.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": ["doc.iterable.source_relation"]}, "campaign_id": {"name": "campaign_id", "description": "Reference to the campaign associated with the label", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "list_id": {"name": "list_id", "description": "Reference to the list used", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "updated_at": {"name": "updated_at", "description": "Last update timestamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "The time when a record was last updated by Fivetran.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": ["doc.iterable._fivetran_synced"]}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "iterable://models/staging/stg_iterable.yml", "build_path": null, "unrendered_config": {"materialized": "table", "schema": "iterable_{{ var('directed_schema','dev') }}", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789422569.8978462, "relation_name": "\"postgres\".\"public_iterable_dev\".\"stg_iterable__campaign_list_history\"", "raw_code": "with base as (\n\n select * \n from {{ ref('stg_iterable__campaign_list_history_tmp') }}\n\n),\n\nfields as (\n\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_iterable/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_iterable/macros/).\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_iterable__campaign_list_history_tmp')),\n staging_columns=get_campaign_list_history_columns()\n )\n }}\n {{ fivetran_utils.apply_source_relation(package_name='iterable') }}\n \n from base\n),\n\nfinal as (\n\n select\n source_relation,\n cast(campaign_id as {{ dbt.type_string() }}) as campaign_id,\n cast(list_id as {{ dbt.type_string() }}) as list_id,\n updated_at,\n _fivetran_synced\n from fields\n)\n\nselect * \nfrom final", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__campaign_list_history_tmp", "package": null, "version": null}, {"name": "stg_iterable__campaign_list_history_tmp", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.iterable.get_campaign_list_history_columns", "macro.fivetran_utils.fill_staging_columns", "macro.fivetran_utils.apply_source_relation", "macro.dbt.type_string"], "nodes": ["model.iterable.stg_iterable__campaign_list_history_tmp"]}, "compiled_path": "target/compiled/iterable/models/staging/stg_iterable__campaign_list_history.sql", "compiled": true, "compiled_code": "with base as (\n\n select * \n from \"postgres\".\"public_iterable_dev\".\"stg_iterable__campaign_list_history_tmp\"\n\n),\n\nfields as (\n\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_iterable/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_iterable/macros/).\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n \n _fivetran_synced as _fivetran_synced,\n campaign_id as campaign_id,\n list_id as list_id,\n updated_at as updated_at\n \n\n\n\n\n \n \n\n\n\n\n\n, cast('postgres.public' as TEXT) as source_relation\n\n \n from base\n),\n\nfinal as (\n\n select\n source_relation,\n cast(campaign_id as TEXT) as campaign_id,\n cast(list_id as TEXT) as list_id,\n updated_at,\n _fivetran_synced\n from fields\n)\n\nselect * \nfrom final", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.stg_iterable__channel": {"database": "postgres", "schema": "public_iterable_dev", "name": "stg_iterable__channel", "resource_type": "model", "package_name": "iterable", "path": "staging/stg_iterable__channel.sql", "original_file_path": "models/staging/stg_iterable__channel.sql", "unique_id": "model.iterable.stg_iterable__channel", "fqn": ["iterable", "staging", "stg_iterable__channel"], "alias": "stg_iterable__channel", "checksum": {"name": "sha256", "checksum": "1ade77557691cabd1c65676182adaf401d8dde9ee42a6918d1ea7a124159cbf2"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "table", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "Table containing unique channels.", "columns": {"source_relation": {"name": "source_relation", "description": "Identifies the record's source.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": ["doc.iterable.source_relation"]}, "channel_id": {"name": "channel_id", "description": "Unique identifier of the channel", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "channel_name": {"name": "channel_name", "description": "User defined name of the channel", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "channel_type": {"name": "channel_type", "description": "The channel type", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "message_medium": {"name": "message_medium", "description": "The message medium associated with the channel", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "The time when a record was last updated by Fivetran.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": ["doc.iterable._fivetran_synced"]}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "iterable://models/staging/stg_iterable.yml", "build_path": null, "unrendered_config": {"materialized": "table", "schema": "iterable_{{ var('directed_schema','dev') }}", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789422569.9000351, "relation_name": "\"postgres\".\"public_iterable_dev\".\"stg_iterable__channel\"", "raw_code": "with base as (\n\n select *\n from {{ ref('stg_iterable__channel_tmp') }}\n\n),\n\nfields as (\n\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns\n that are expected/needed (staging_columns from dbt_iterable/models/tmp/) and compares it with columns\n in the source (source_columns from dbt_iterable/macros/).\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_iterable__channel_tmp')),\n staging_columns=get_channel_columns()\n )\n }}\n {{ fivetran_utils.apply_source_relation(package_name='iterable') }}\n\n from base\n\n),\n\nfinal as (\n\n select\n source_relation,\n cast(id as {{ dbt.type_string() }} ) as channel_id,\n name as channel_name,\n channel_type,\n message_medium,\n _fivetran_synced\n\n from fields\n where not coalesce(_fivetran_deleted, false)\n)\n\nselect * \nfrom final", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__channel_tmp", "package": null, "version": null}, {"name": "stg_iterable__channel_tmp", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.iterable.get_channel_columns", "macro.fivetran_utils.fill_staging_columns", "macro.fivetran_utils.apply_source_relation", "macro.dbt.type_string"], "nodes": ["model.iterable.stg_iterable__channel_tmp"]}, "compiled_path": "target/compiled/iterable/models/staging/stg_iterable__channel.sql", "compiled": true, "compiled_code": "with base as (\n\n select *\n from \"postgres\".\"public_iterable_dev\".\"stg_iterable__channel_tmp\"\n\n),\n\nfields as (\n\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns\n that are expected/needed (staging_columns from dbt_iterable/models/tmp/) and compares it with columns\n in the source (source_columns from dbt_iterable/macros/).\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n \n _fivetran_deleted as _fivetran_deleted,\n _fivetran_synced as _fivetran_synced,\n channel_type as channel_type,\n id as id,\n message_medium as message_medium,\n name as name\n \n\n\n\n\n \n \n\n\n\n\n\n, cast('postgres.public' as TEXT) as source_relation\n\n\n from base\n\n),\n\nfinal as (\n\n select\n source_relation,\n cast(id as TEXT ) as channel_id,\n name as channel_name,\n channel_type,\n message_medium,\n _fivetran_synced\n\n from fields\n where not coalesce(_fivetran_deleted, false)\n)\n\nselect * \nfrom final", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.stg_iterable__message_type_tmp": {"database": "postgres", "schema": "public_iterable_dev", "name": "stg_iterable__message_type_tmp", "resource_type": "model", "package_name": "iterable", "path": "staging/tmp/stg_iterable__message_type_tmp.sql", "original_file_path": "models/staging/tmp/stg_iterable__message_type_tmp.sql", "unique_id": "model.iterable.stg_iterable__message_type_tmp", "fqn": ["iterable", "staging", "tmp", "stg_iterable__message_type_tmp"], "alias": "stg_iterable__message_type_tmp", "checksum": {"name": "sha256", "checksum": "fda7a978e7b71b46f37e4878898c6655526f0531d36f74968c7bbb56ec4200e5"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"materialized": "view", "schema": "iterable_{{ var('directed_schema','dev') }}", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789422569.2064412, "relation_name": "\"postgres\".\"public_iterable_dev\".\"stg_iterable__message_type_tmp\"", "raw_code": "{{\n fivetran_utils.union_connections(\n connection_dictionary='iterable_sources',\n single_source_name='iterable',\n single_table_name='message_type'\n )\n}}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["iterable", "message_type"], ["iterable", "message_type"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.fivetran_utils.union_connections"], "nodes": ["source.iterable.iterable.message_type"]}, "compiled_path": "target/compiled/iterable/models/staging/tmp/stg_iterable__message_type_tmp.sql", "compiled": true, "compiled_code": "\n\n\n-- ** Values passed to adapter.get_relation:\n -- full-identifier_var: iterable_message_type_identifier\n -- database: postgres \n -- schema: public\n -- identifier: message_type_data\n\n\n select\n \"id\",\n \"name\",\n \"channel_id\",\n \"_fivetran_deleted\",\n \"_fivetran_synced\",\n \"created_at\",\n \"frequency_cap\",\n \"rate_limit_per_minute\",\n \"subscription_policy\",\n \"updated_at\"\n from \"postgres\".\"public\".\"message_type_data\" as source_table\n\n ", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.stg_iterable__event_extension_tmp": {"database": "postgres", "schema": "public_iterable_dev", "name": "stg_iterable__event_extension_tmp", "resource_type": "model", "package_name": "iterable", "path": "staging/tmp/stg_iterable__event_extension_tmp.sql", "original_file_path": "models/staging/tmp/stg_iterable__event_extension_tmp.sql", "unique_id": "model.iterable.stg_iterable__event_extension_tmp", "fqn": ["iterable", "staging", "tmp", "stg_iterable__event_extension_tmp"], "alias": "stg_iterable__event_extension_tmp", "checksum": {"name": "sha256", "checksum": "09d92da24c5304acbb0f0ebc81fe49e70458d1319cb1c2090f5f9ce0b87ecb29"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"materialized": "view", "schema": "iterable_{{ var('directed_schema','dev') }}", "enabled": "var('iterable__using_event_extension', True)", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789422569.2327213, "relation_name": "\"postgres\".\"public_iterable_dev\".\"stg_iterable__event_extension_tmp\"", "raw_code": "{{ config(enabled=var('iterable__using_event_extension', True)) }}\n\n{{\n fivetran_utils.union_connections(\n connection_dictionary='iterable_sources',\n single_source_name='iterable',\n single_table_name='event_extension'\n )\n}}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["iterable", "event_extension"], ["iterable", "event_extension"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.fivetran_utils.union_connections"], "nodes": ["source.iterable.iterable.event_extension"]}, "compiled_path": "target/compiled/iterable/models/staging/tmp/stg_iterable__event_extension_tmp.sql", "compiled": true, "compiled_code": "\n\n\n\n\n-- ** Values passed to adapter.get_relation:\n -- full-identifier_var: iterable_event_extension_identifier\n -- database: postgres \n -- schema: public\n -- identifier: event_extension_data\n\n\n select\n \"_fivetran_id\",\n \"app_already_running\",\n \"badge\",\n \"canonical_url_id\",\n \"content_available\",\n \"content_id\",\n \"device\",\n \"email_id\",\n \"email_subject\",\n \"experiment_id\",\n \"from_phone_number_id\",\n \"from_smssender_id\",\n \"image_url\",\n \"is_ghost_push\",\n \"link_id\",\n \"link_url\",\n \"platform_endpoint\",\n \"push_message\",\n \"region\",\n \"sms_message\",\n \"sound\",\n \"to_phone_number\",\n \"url\",\n \"workflow_id\",\n \"workflow_name\",\n \"locale\",\n \"deeplink_android\",\n \"deeplink_ios\",\n \"payload\",\n \"sms_provider_response_status\",\n \"sms_provider_response_message\",\n \"sms_provider_response_code\",\n \"sms_provider_response_more_info\",\n \"_fivetran_synced\",\n \"catalog_collection_count\",\n \"catalog_lookup_count\",\n \"city\",\n \"clicked_url\",\n \"country\",\n \"error_code\",\n \"expires_at\",\n \"from_phone_number\",\n \"in_app_body\",\n \"is_sms_estimation\",\n \"labels\",\n \"message_context\",\n \"message_status\",\n \"mms_send_count\",\n \"product_recommendation_count\",\n \"proxy_source\",\n \"reason\",\n \"sms_send_count\",\n \"web_push_body\",\n \"web_push_click_action\",\n \"web_push_icon\",\n \"web_push_message\",\n \"_fivetran_user_id\"\n from \"postgres\".\"public\".\"event_extension_data\" as source_table\n\n ", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.stg_iterable__user_unsub_message_type_tmp": {"database": "postgres", "schema": "public_iterable_dev", "name": "stg_iterable__user_unsub_message_type_tmp", "resource_type": "model", "package_name": "iterable", "path": "staging/tmp/stg_iterable__user_unsub_message_type_tmp.sql", "original_file_path": "models/staging/tmp/stg_iterable__user_unsub_message_type_tmp.sql", "unique_id": "model.iterable.stg_iterable__user_unsub_message_type_tmp", "fqn": ["iterable", "staging", "tmp", "stg_iterable__user_unsub_message_type_tmp"], "alias": "stg_iterable__user_unsub_message_type_tmp", "checksum": {"name": "sha256", "checksum": "ddb46e159ed22f011676fbe7e00ba9271a493bc5185d286261ae30fa0b183636"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"materialized": "view", "schema": "iterable_{{ var('directed_schema','dev') }}", "enabled": "var('iterable__using_user_unsubscribed_message_type', True)", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789422569.2424047, "relation_name": "\"postgres\".\"public_iterable_dev\".\"stg_iterable__user_unsub_message_type_tmp\"", "raw_code": "{{ config(enabled=var('iterable__using_user_unsubscribed_message_type', True)) }}\n\n{{\n fivetran_utils.union_connections(\n connection_dictionary='iterable_sources',\n single_source_name='iterable',\n single_table_name='user_unsubscribed_message_type' if does_table_exist('user_unsubscribed_message_type') else 'user_unsubscribed_message_type_history'\n )\n}}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["iterable", "user_unsubscribed_message_type_history"], ["iterable", "user_unsubscribed_message_type_history"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.iterable.does_table_exist", "macro.fivetran_utils.union_connections"], "nodes": ["source.iterable.iterable.user_unsubscribed_message_type_history"]}, "compiled_path": "target/compiled/iterable/models/staging/tmp/stg_iterable__user_unsub_message_type_tmp.sql", "compiled": true, "compiled_code": "\n\n\n\n\n-- ** Values passed to adapter.get_relation:\n -- full-identifier_var: iterable_user_unsubscribed_message_type_identifier\n -- database: postgres \n -- schema: public\n -- identifier: user_unsubscribed_message_type_data\n\n\n select\n \"_fivetran_id\",\n \"message_type_id\",\n \"_fivetran_synced\"\n from \"postgres\".\"public\".\"user_unsubscribed_message_type_data\" as source_table\n\n ", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.stg_iterable__campaign_list_history_tmp": {"database": "postgres", "schema": "public_iterable_dev", "name": "stg_iterable__campaign_list_history_tmp", "resource_type": "model", "package_name": "iterable", "path": "staging/tmp/stg_iterable__campaign_list_history_tmp.sql", "original_file_path": "models/staging/tmp/stg_iterable__campaign_list_history_tmp.sql", "unique_id": "model.iterable.stg_iterable__campaign_list_history_tmp", "fqn": ["iterable", "staging", "tmp", "stg_iterable__campaign_list_history_tmp"], "alias": "stg_iterable__campaign_list_history_tmp", "checksum": {"name": "sha256", "checksum": "c26b6a07e1d280b2d5dea6ddbff02200d527e798d8af0a8105be30c0e7d013f7"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"materialized": "view", "schema": "iterable_{{ var('directed_schema','dev') }}", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789422569.2527096, "relation_name": "\"postgres\".\"public_iterable_dev\".\"stg_iterable__campaign_list_history_tmp\"", "raw_code": "{{\n fivetran_utils.union_connections(\n connection_dictionary='iterable_sources',\n single_source_name='iterable',\n single_table_name='campaign_list_history'\n )\n}}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["iterable", "campaign_list_history"], ["iterable", "campaign_list_history"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.fivetran_utils.union_connections"], "nodes": ["source.iterable.iterable.campaign_list_history"]}, "compiled_path": "target/compiled/iterable/models/staging/tmp/stg_iterable__campaign_list_history_tmp.sql", "compiled": true, "compiled_code": "\n\n\n-- ** Values passed to adapter.get_relation:\n -- full-identifier_var: iterable_campaign_list_history_identifier\n -- database: postgres \n -- schema: public\n -- identifier: campaign_list_history_data\n\n\n select\n \"list_id\",\n \"campaign_id\",\n \"updated_at\",\n \"_fivetran_synced\"\n from \"postgres\".\"public\".\"campaign_list_history_data\" as source_table\n\n ", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.stg_iterable__list_user_tmp": {"database": "postgres", "schema": "public_iterable_dev", "name": "stg_iterable__list_user_tmp", "resource_type": "model", "package_name": "iterable", "path": "staging/tmp/stg_iterable__list_user_tmp.sql", "original_file_path": "models/staging/tmp/stg_iterable__list_user_tmp.sql", "unique_id": "model.iterable.stg_iterable__list_user_tmp", "fqn": ["iterable", "staging", "tmp", "stg_iterable__list_user_tmp"], "alias": "stg_iterable__list_user_tmp", "checksum": {"name": "sha256", "checksum": "5c8b455013c26cfd4094b38e210edeb911a22dc0f05544e65fb48c350c2725fe"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"materialized": "view", "schema": "iterable_{{ var('directed_schema','dev') }}", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789422569.2605634, "relation_name": "\"postgres\".\"public_iterable_dev\".\"stg_iterable__list_user_tmp\"", "raw_code": "{{\n fivetran_utils.union_connections(\n connection_dictionary='iterable_sources',\n single_source_name='iterable',\n single_table_name='list_user'\n )\n}}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["iterable", "list_user"], ["iterable", "list_user"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.fivetran_utils.union_connections"], "nodes": ["source.iterable.iterable.list_user"]}, "compiled_path": "target/compiled/iterable/models/staging/tmp/stg_iterable__list_user_tmp.sql", "compiled": true, "compiled_code": "\n\n\n-- ** Values passed to adapter.get_relation:\n -- full-identifier_var: iterable_list_user_identifier\n -- database: postgres \n -- schema: public\n -- identifier: list_user_data\n\n\n select\n \"_fivetran_id\",\n \"index\",\n \"list_id\",\n \"_fivetran_synced\"\n from \"postgres\".\"public\".\"list_user_data\" as source_table\n\n ", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.stg_iterable__user_history_tmp": {"database": "postgres", "schema": "public_iterable_dev", "name": "stg_iterable__user_history_tmp", "resource_type": "model", "package_name": "iterable", "path": "staging/tmp/stg_iterable__user_history_tmp.sql", "original_file_path": "models/staging/tmp/stg_iterable__user_history_tmp.sql", "unique_id": "model.iterable.stg_iterable__user_history_tmp", "fqn": ["iterable", "staging", "tmp", "stg_iterable__user_history_tmp"], "alias": "stg_iterable__user_history_tmp", "checksum": {"name": "sha256", "checksum": "cc04d0fbef9ff5cd4f72ae66c9cffd316c5e134ecd81dc216dcf682b34eb587b"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"materialized": "view", "schema": "iterable_{{ var('directed_schema','dev') }}", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789422569.2691276, "relation_name": "\"postgres\".\"public_iterable_dev\".\"stg_iterable__user_history_tmp\"", "raw_code": "{{\n fivetran_utils.union_connections(\n connection_dictionary='iterable_sources',\n single_source_name='iterable',\n single_table_name='user_history'\n )\n}}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["iterable", "user_history"], ["iterable", "user_history"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.fivetran_utils.union_connections"], "nodes": ["source.iterable.iterable.user_history"]}, "compiled_path": "target/compiled/iterable/models/staging/tmp/stg_iterable__user_history_tmp.sql", "compiled": true, "compiled_code": "\n\n\n-- ** Values passed to adapter.get_relation:\n -- full-identifier_var: iterable_user_history_identifier\n -- database: postgres \n -- schema: public\n -- identifier: user_history_data\n\n\n select\n \"email\",\n \"updated_at\",\n \"first_name\",\n \"last_name\",\n \"phone_number\",\n \"user_id\",\n \"signup_date\",\n \"signup_source\",\n \"phone_number_carrier\",\n \"phone_number_country_code_iso\",\n \"phone_number_line_type\",\n \"phone_number_updated_at\",\n \"_fivetran_synced\",\n \"email_list_ids\",\n \"iterable_user_id\"\n from \"postgres\".\"public\".\"user_history_data\" as source_table\n\n ", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.stg_iterable__campaign_history_tmp": {"database": "postgres", "schema": "public_iterable_dev", "name": "stg_iterable__campaign_history_tmp", "resource_type": "model", "package_name": "iterable", "path": "staging/tmp/stg_iterable__campaign_history_tmp.sql", "original_file_path": "models/staging/tmp/stg_iterable__campaign_history_tmp.sql", "unique_id": "model.iterable.stg_iterable__campaign_history_tmp", "fqn": ["iterable", "staging", "tmp", "stg_iterable__campaign_history_tmp"], "alias": "stg_iterable__campaign_history_tmp", "checksum": {"name": "sha256", "checksum": "a37ade72efad4e5d8b38cc0548f4a4c79d38a4a337ce71f236581bda47f94696"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"materialized": "view", "schema": "iterable_{{ var('directed_schema','dev') }}", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789422569.2772555, "relation_name": "\"postgres\".\"public_iterable_dev\".\"stg_iterable__campaign_history_tmp\"", "raw_code": "{{\n fivetran_utils.union_connections(\n connection_dictionary='iterable_sources',\n single_source_name='iterable',\n single_table_name='campaign_history'\n )\n}}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["iterable", "campaign_history"], ["iterable", "campaign_history"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.fivetran_utils.union_connections"], "nodes": ["source.iterable.iterable.campaign_history"]}, "compiled_path": "target/compiled/iterable/models/staging/tmp/stg_iterable__campaign_history_tmp.sql", "compiled": true, "compiled_code": "\n\n\n-- ** Values passed to adapter.get_relation:\n -- full-identifier_var: iterable_campaign_history_identifier\n -- database: postgres \n -- schema: public\n -- identifier: campaign_history_data\n\n\n select\n \"id\",\n \"updated_at\",\n \"template_id\",\n \"recurring_campaign_id\",\n \"campaign_state\",\n \"created_at\",\n \"created_by_user_id\",\n \"ended_at\",\n \"name\",\n \"send_size\",\n \"start_at\",\n \"type\",\n \"workflow_id\",\n \"_fivetran_synced\",\n \"updated_by_user_id\",\n \"message_medium\"\n from \"postgres\".\"public\".\"campaign_history_data\" as source_table\n\n ", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.stg_iterable__template_history_tmp": {"database": "postgres", "schema": "public_iterable_dev", "name": "stg_iterable__template_history_tmp", "resource_type": "model", "package_name": "iterable", "path": "staging/tmp/stg_iterable__template_history_tmp.sql", "original_file_path": "models/staging/tmp/stg_iterable__template_history_tmp.sql", "unique_id": "model.iterable.stg_iterable__template_history_tmp", "fqn": ["iterable", "staging", "tmp", "stg_iterable__template_history_tmp"], "alias": "stg_iterable__template_history_tmp", "checksum": {"name": "sha256", "checksum": "b37299e696c1cd6388ad85a4042f9b8a5364b969e7c4fdb42f03e4c4803e9a7f"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"materialized": "view", "schema": "iterable_{{ var('directed_schema','dev') }}", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789422569.2852395, "relation_name": "\"postgres\".\"public_iterable_dev\".\"stg_iterable__template_history_tmp\"", "raw_code": "{{\n fivetran_utils.union_connections(\n connection_dictionary='iterable_sources',\n single_source_name='iterable',\n single_table_name='template_history'\n )\n}}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["iterable", "template_history"], ["iterable", "template_history"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.fivetran_utils.union_connections"], "nodes": ["source.iterable.iterable.template_history"]}, "compiled_path": "target/compiled/iterable/models/staging/tmp/stg_iterable__template_history_tmp.sql", "compiled": true, "compiled_code": "\n\n\n-- ** Values passed to adapter.get_relation:\n -- full-identifier_var: iterable_template_history_identifier\n -- database: postgres \n -- schema: public\n -- identifier: template_history_data\n\n\n select\n \"id\",\n \"updated_at\",\n \"message_type_id\",\n \"client_template_id\",\n \"created_at\",\n \"creator_user_id\",\n \"name\",\n \"template_type\",\n \"_fivetran_synced\"\n from \"postgres\".\"public\".\"template_history_data\" as source_table\n\n ", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.stg_iterable__event_tmp": {"database": "postgres", "schema": "public_iterable_dev", "name": "stg_iterable__event_tmp", "resource_type": "model", "package_name": "iterable", "path": "staging/tmp/stg_iterable__event_tmp.sql", "original_file_path": "models/staging/tmp/stg_iterable__event_tmp.sql", "unique_id": "model.iterable.stg_iterable__event_tmp", "fqn": ["iterable", "staging", "tmp", "stg_iterable__event_tmp"], "alias": "stg_iterable__event_tmp", "checksum": {"name": "sha256", "checksum": "31555eb22bfca797c1f1a4f1503da21f7620762d199e7e32b2d268c03e139f65"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"materialized": "view", "schema": "iterable_{{ var('directed_schema','dev') }}", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789422569.2934778, "relation_name": "\"postgres\".\"public_iterable_dev\".\"stg_iterable__event_tmp\"", "raw_code": "{{\n fivetran_utils.union_connections(\n connection_dictionary='iterable_sources',\n single_source_name='iterable',\n single_table_name='event'\n )\n}}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["iterable", "event"], ["iterable", "event"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.fivetran_utils.union_connections"], "nodes": ["source.iterable.iterable.event"]}, "compiled_path": "target/compiled/iterable/models/staging/tmp/stg_iterable__event_tmp.sql", "compiled": true, "compiled_code": "\n\n\n-- ** Values passed to adapter.get_relation:\n -- full-identifier_var: iterable_event_identifier\n -- database: postgres \n -- schema: public\n -- identifier: event_data\n\n\n select\n \"_fivetran_id\",\n \"email\",\n \"campaign_id\",\n \"message_id\",\n \"content_id\",\n \"created_at\",\n \"event_name\",\n \"ip\",\n \"message_bus_id\",\n \"message_type_id\",\n \"recipient_state\",\n \"status\",\n \"unsub_source\",\n \"user_agent\",\n \"user_agent_device\",\n \"transactional_data\",\n \"additional_properties\",\n \"_fivetran_synced\",\n \"_fivetran_user_id\"\n from \"postgres\".\"public\".\"event_data\" as source_table\n\n ", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.stg_iterable__journey_tmp": {"database": "postgres", "schema": "public_iterable_dev", "name": "stg_iterable__journey_tmp", "resource_type": "model", "package_name": "iterable", "path": "staging/tmp/stg_iterable__journey_tmp.sql", "original_file_path": "models/staging/tmp/stg_iterable__journey_tmp.sql", "unique_id": "model.iterable.stg_iterable__journey_tmp", "fqn": ["iterable", "staging", "tmp", "stg_iterable__journey_tmp"], "alias": "stg_iterable__journey_tmp", "checksum": {"name": "sha256", "checksum": "9e10fed335359755ce1488a7df46c9bfd4a08b029e757c4e81c8c2f8cce28961"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"materialized": "view", "schema": "iterable_{{ var('directed_schema','dev') }}", "enabled": "var('iterable__using_journey', True)", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789422569.302108, "relation_name": "\"postgres\".\"public_iterable_dev\".\"stg_iterable__journey_tmp\"", "raw_code": "{{ config(enabled=var('iterable__using_journey', True)) }}\n\n{{\n fivetran_utils.union_connections(\n connection_dictionary='iterable_sources',\n single_source_name='iterable',\n single_table_name='journey'\n )\n}}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["iterable", "journey"], ["iterable", "journey"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.fivetran_utils.union_connections"], "nodes": ["source.iterable.iterable.journey"]}, "compiled_path": "target/compiled/iterable/models/staging/tmp/stg_iterable__journey_tmp.sql", "compiled": true, "compiled_code": "\n\n\n\n\n-- ** Values passed to adapter.get_relation:\n -- full-identifier_var: iterable_journey_identifier\n -- database: postgres \n -- schema: public\n -- identifier: journey_data\n\n\n select\n \"id\",\n \"name\",\n \"journey_type\",\n \"description\",\n \"creator_user_id\",\n \"enabled\",\n \"is_archived\",\n \"lifetime_limit\",\n \"simultaneous_limit\",\n \"start_tile_id\",\n \"trigger_event_names\",\n \"created_at\",\n \"updated_at\",\n \"_fivetran_deleted\",\n \"_fivetran_synced\",\n \"draft_name\"\n from \"postgres\".\"public\".\"journey_data\" as source_table\n\n ", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.stg_iterable__campaign_suppression_list_history_tmp": {"database": "postgres", "schema": "public_iterable_dev", "name": "stg_iterable__campaign_suppression_list_history_tmp", "resource_type": "model", "package_name": "iterable", "path": "staging/tmp/stg_iterable__campaign_suppression_list_history_tmp.sql", "original_file_path": "models/staging/tmp/stg_iterable__campaign_suppression_list_history_tmp.sql", "unique_id": "model.iterable.stg_iterable__campaign_suppression_list_history_tmp", "fqn": ["iterable", "staging", "tmp", "stg_iterable__campaign_suppression_list_history_tmp"], "alias": "stg_iterable__campaign_suppression_list_history_tmp", "checksum": {"name": "sha256", "checksum": "3c5a325cac70574f2defa9fa09b436c03a3fe8a3dede5729ca95451b410d636c"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"materialized": "view", "schema": "iterable_{{ var('directed_schema','dev') }}", "enabled": "var('iterable__using_campaign_suppression_list_history', True)", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789422569.31171, "relation_name": "\"postgres\".\"public_iterable_dev\".\"stg_iterable__campaign_suppression_list_history_tmp\"", "raw_code": "{{ config(enabled=var('iterable__using_campaign_suppression_list_history', True)) }}\n\n{{\n fivetran_utils.union_connections(\n connection_dictionary='iterable_sources',\n single_source_name='iterable',\n single_table_name='campaign_suppression_list_history'\n )\n}}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["iterable", "campaign_suppression_list_history"], ["iterable", "campaign_suppression_list_history"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.fivetran_utils.union_connections"], "nodes": ["source.iterable.iterable.campaign_suppression_list_history"]}, "compiled_path": "target/compiled/iterable/models/staging/tmp/stg_iterable__campaign_suppression_list_history_tmp.sql", "compiled": true, "compiled_code": "\n\n\n\n\n-- ** Values passed to adapter.get_relation:\n -- full-identifier_var: iterable_campaign_suppression_list_history_identifier\n -- database: postgres \n -- schema: public\n -- identifier: campaign_suppression_list_history_data\n\n\n select\n \"suppressed_list_id\",\n \"campaign_id\",\n \"updated_at\",\n \"_fivetran_synced\"\n from \"postgres\".\"public\".\"campaign_suppression_list_history_data\" as source_table\n\n ", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.stg_iterable__campaign_label_history_tmp": {"database": "postgres", "schema": "public_iterable_dev", "name": "stg_iterable__campaign_label_history_tmp", "resource_type": "model", "package_name": "iterable", "path": "staging/tmp/stg_iterable__campaign_label_history_tmp.sql", "original_file_path": "models/staging/tmp/stg_iterable__campaign_label_history_tmp.sql", "unique_id": "model.iterable.stg_iterable__campaign_label_history_tmp", "fqn": ["iterable", "staging", "tmp", "stg_iterable__campaign_label_history_tmp"], "alias": "stg_iterable__campaign_label_history_tmp", "checksum": {"name": "sha256", "checksum": "08e70c9938c895459cabba65b1992d360775e26ea2b8275e408bcf21e814bd58"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"materialized": "view", "schema": "iterable_{{ var('directed_schema','dev') }}", "enabled": "var('iterable__using_campaign_label_history', True)", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789422569.3218236, "relation_name": "\"postgres\".\"public_iterable_dev\".\"stg_iterable__campaign_label_history_tmp\"", "raw_code": "{{ config(enabled=var('iterable__using_campaign_label_history', True)) }}\n\n{{\n fivetran_utils.union_connections(\n connection_dictionary='iterable_sources',\n single_source_name='iterable',\n single_table_name='campaign_label_history'\n )\n}}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["iterable", "campaign_label_history"], ["iterable", "campaign_label_history"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.fivetran_utils.union_connections"], "nodes": ["source.iterable.iterable.campaign_label_history"]}, "compiled_path": "target/compiled/iterable/models/staging/tmp/stg_iterable__campaign_label_history_tmp.sql", "compiled": true, "compiled_code": "\n\n\n\n\n-- ** Values passed to adapter.get_relation:\n -- full-identifier_var: iterable_campaign_label_history_identifier\n -- database: postgres \n -- schema: public\n -- identifier: campaign_label_history_data\n\n\n select\n \"campaign_id\",\n \"label\",\n \"updated_at\",\n \"_fivetran_synced\"\n from \"postgres\".\"public\".\"campaign_label_history_data\" as source_table\n\n ", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.stg_iterable__list_tmp": {"database": "postgres", "schema": "public_iterable_dev", "name": "stg_iterable__list_tmp", "resource_type": "model", "package_name": "iterable", "path": "staging/tmp/stg_iterable__list_tmp.sql", "original_file_path": "models/staging/tmp/stg_iterable__list_tmp.sql", "unique_id": "model.iterable.stg_iterable__list_tmp", "fqn": ["iterable", "staging", "tmp", "stg_iterable__list_tmp"], "alias": "stg_iterable__list_tmp", "checksum": {"name": "sha256", "checksum": "95fbbf63205ef9000c19e76270c8ab96e23c4f9d8072f3892a08f20648a42b5a"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"materialized": "view", "schema": "iterable_{{ var('directed_schema','dev') }}", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789422569.331224, "relation_name": "\"postgres\".\"public_iterable_dev\".\"stg_iterable__list_tmp\"", "raw_code": "{{\n fivetran_utils.union_connections(\n connection_dictionary='iterable_sources',\n single_source_name='iterable',\n single_table_name='list'\n )\n}}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["iterable", "list"], ["iterable", "list"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.fivetran_utils.union_connections"], "nodes": ["source.iterable.iterable.list"]}, "compiled_path": "target/compiled/iterable/models/staging/tmp/stg_iterable__list_tmp.sql", "compiled": true, "compiled_code": "\n\n\n-- ** Values passed to adapter.get_relation:\n -- full-identifier_var: iterable_list_identifier\n -- database: postgres \n -- schema: public\n -- identifier: list_data\n\n\n select\n \"id\",\n \"name\",\n \"created_at\",\n \"list_type\",\n \"_fivetran_deleted\",\n \"_fivetran_synced\",\n \"description\"\n from \"postgres\".\"public\".\"list_data\" as source_table\n\n ", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.stg_iterable__channel_tmp": {"database": "postgres", "schema": "public_iterable_dev", "name": "stg_iterable__channel_tmp", "resource_type": "model", "package_name": "iterable", "path": "staging/tmp/stg_iterable__channel_tmp.sql", "original_file_path": "models/staging/tmp/stg_iterable__channel_tmp.sql", "unique_id": "model.iterable.stg_iterable__channel_tmp", "fqn": ["iterable", "staging", "tmp", "stg_iterable__channel_tmp"], "alias": "stg_iterable__channel_tmp", "checksum": {"name": "sha256", "checksum": "0516bc3567b725378b33829b8c3e7dc1b6680922f2d1e7824a913b82ca617905"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"materialized": "view", "schema": "iterable_{{ var('directed_schema','dev') }}", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789422569.3394008, "relation_name": "\"postgres\".\"public_iterable_dev\".\"stg_iterable__channel_tmp\"", "raw_code": "{{\n fivetran_utils.union_connections(\n connection_dictionary='iterable_sources',\n single_source_name='iterable',\n single_table_name='channel'\n )\n}}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["iterable", "channel"], ["iterable", "channel"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.fivetran_utils.union_connections"], "nodes": ["source.iterable.iterable.channel"]}, "compiled_path": "target/compiled/iterable/models/staging/tmp/stg_iterable__channel_tmp.sql", "compiled": true, "compiled_code": "\n\n\n-- ** Values passed to adapter.get_relation:\n -- full-identifier_var: iterable_channel_identifier\n -- database: postgres \n -- schema: public\n -- identifier: channel_data\n\n\n select\n \"id\",\n \"name\",\n \"channel_type\",\n \"message_medium\",\n \"_fivetran_deleted\",\n \"_fivetran_synced\"\n from \"postgres\".\"public\".\"channel_data\" as source_table\n\n ", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.stg_iterable__user_unsubscribed_channel_tmp": {"database": "postgres", "schema": "public_iterable_dev", "name": "stg_iterable__user_unsubscribed_channel_tmp", "resource_type": "model", "package_name": "iterable", "path": "staging/tmp/stg_iterable__user_unsubscribed_channel_tmp.sql", "original_file_path": "models/staging/tmp/stg_iterable__user_unsubscribed_channel_tmp.sql", "unique_id": "model.iterable.stg_iterable__user_unsubscribed_channel_tmp", "fqn": ["iterable", "staging", "tmp", "stg_iterable__user_unsubscribed_channel_tmp"], "alias": "stg_iterable__user_unsubscribed_channel_tmp", "checksum": {"name": "sha256", "checksum": "a8d43331a84f0d1dae8511478d01cded7dfb389fef925f7173f50eb6b6b9c142"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"materialized": "view", "schema": "iterable_{{ var('directed_schema','dev') }}", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789422569.3479986, "relation_name": "\"postgres\".\"public_iterable_dev\".\"stg_iterable__user_unsubscribed_channel_tmp\"", "raw_code": "{{\n fivetran_utils.union_connections(\n connection_dictionary='iterable_sources',\n single_source_name='iterable',\n single_table_name='user_unsubscribed_channel' if does_table_exist('user_unsubscribed_channel') else 'user_unsubscribed_channel_history'\n )\n}}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["iterable", "user_unsubscribed_channel_history"], ["iterable", "user_unsubscribed_channel_history"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.iterable.does_table_exist", "macro.fivetran_utils.union_connections"], "nodes": ["source.iterable.iterable.user_unsubscribed_channel_history"]}, "compiled_path": "target/compiled/iterable/models/staging/tmp/stg_iterable__user_unsubscribed_channel_tmp.sql", "compiled": true, "compiled_code": "\n\n\n-- ** Values passed to adapter.get_relation:\n -- full-identifier_var: iterable_user_unsubscribed_channel_identifier\n -- database: postgres \n -- schema: public\n -- identifier: user_unsubscribed_channel_data\n\n\n select\n \"_fivetran_id\",\n \"channel_id\",\n \"_fivetran_synced\"\n from \"postgres\".\"public\".\"user_unsubscribed_channel_data\" as source_table\n\n ", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "test.iterable.not_null_iterable__campaigns_campaign_id.03c9448919": {"database": "postgres", "schema": "public_dbt_test__audit", "name": "not_null_iterable__campaigns_campaign_id", "resource_type": "test", "package_name": "iterable", "path": "not_null_iterable__campaigns_campaign_id.sql", "original_file_path": "models/iterable.yml", "unique_id": "test.iterable.not_null_iterable__campaigns_campaign_id.03c9448919", "fqn": ["iterable", "not_null_iterable__campaigns_campaign_id"], "alias": "not_null_iterable__campaigns_campaign_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "sql_header": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {}, "created_at": 1789422569.8661883, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "iterable__campaigns", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.iterable.iterable__campaigns"]}, "compiled_path": "target/compiled/iterable/models/iterable.yml/not_null_iterable__campaigns_campaign_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect campaign_id\nfrom \"postgres\".\"public_iterable_dev\".\"iterable__campaigns\"\nwhere campaign_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "campaign_id", "file_key_name": "models.iterable__campaigns", "attached_node": "model.iterable.iterable__campaigns", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "campaign_id", "model": "{{ get_where_subquery(ref('iterable__campaigns')) }}"}, "namespace": null}}, "test.iterable.not_null_iterable__events_event_id.ed1d28a650": {"database": "postgres", "schema": "public_dbt_test__audit", "name": "not_null_iterable__events_event_id", "resource_type": "test", "package_name": "iterable", "path": "not_null_iterable__events_event_id.sql", "original_file_path": "models/iterable.yml", "unique_id": "test.iterable.not_null_iterable__events_event_id.ed1d28a650", "fqn": ["iterable", "not_null_iterable__events_event_id"], "alias": "not_null_iterable__events_event_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "sql_header": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {}, "created_at": 1789422569.8697667, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "iterable__events", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.iterable.iterable__events"]}, "compiled_path": "target/compiled/iterable/models/iterable.yml/not_null_iterable__events_event_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect event_id\nfrom \"postgres\".\"public_iterable_dev\".\"iterable__events\"\nwhere event_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "event_id", "file_key_name": "models.iterable__events", "attached_node": "model.iterable.iterable__events", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "event_id", "model": "{{ get_where_subquery(ref('iterable__events')) }}"}, "namespace": null}}, "test.iterable.not_null_iterable__journeys_journey_id.b5c6b8783a": {"database": "postgres", "schema": "public_dbt_test__audit", "name": "not_null_iterable__journeys_journey_id", "resource_type": "test", "package_name": "iterable", "path": "not_null_iterable__journeys_journey_id.sql", "original_file_path": "models/iterable.yml", "unique_id": "test.iterable.not_null_iterable__journeys_journey_id.b5c6b8783a", "fqn": ["iterable", "not_null_iterable__journeys_journey_id"], "alias": "not_null_iterable__journeys_journey_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "sql_header": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {}, "created_at": 1789422569.8729744, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "iterable__journeys", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.iterable.iterable__journeys"]}, "compiled_path": "target/compiled/iterable/models/iterable.yml/not_null_iterable__journeys_journey_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect journey_id\nfrom \"postgres\".\"public_iterable_dev\".\"iterable__journeys\"\nwhere journey_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "journey_id", "file_key_name": "models.iterable__journeys", "attached_node": "model.iterable.iterable__journeys", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "journey_id", "model": "{{ get_where_subquery(ref('iterable__journeys')) }}"}, "namespace": null}}, "test.iterable.unique_iterable__journeys_unique_journey_id.ba86841246": {"database": "postgres", "schema": "public_dbt_test__audit", "name": "unique_iterable__journeys_unique_journey_id", "resource_type": "test", "package_name": "iterable", "path": "unique_iterable__journeys_unique_journey_id.sql", "original_file_path": "models/iterable.yml", "unique_id": "test.iterable.unique_iterable__journeys_unique_journey_id.ba86841246", "fqn": ["iterable", "unique_iterable__journeys_unique_journey_id"], "alias": "unique_iterable__journeys_unique_journey_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "sql_header": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {}, "created_at": 1789422569.8760312, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "iterable__journeys", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.iterable.iterable__journeys"]}, "compiled_path": "target/compiled/iterable/models/iterable.yml/unique_iterable__journeys_unique_journey_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n unique_journey_id as unique_field,\n count(*) as n_records\n\nfrom \"postgres\".\"public_iterable_dev\".\"iterable__journeys\"\nwhere unique_journey_id is not null\ngroup by unique_journey_id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "unique_journey_id", "file_key_name": "models.iterable__journeys", "attached_node": "model.iterable.iterable__journeys", "test_metadata": {"name": "unique", "kwargs": {"column_name": "unique_journey_id", "model": "{{ get_where_subquery(ref('iterable__journeys')) }}"}, "namespace": null}}, "test.iterable.not_null_iterable__user_unsubscriptions_unique_user_key.f8db72932b": {"database": "postgres", "schema": "public_dbt_test__audit", "name": "not_null_iterable__user_unsubscriptions_unique_user_key", "resource_type": "test", "package_name": "iterable", "path": "not_null_iterable__user_unsubscriptions_unique_user_key.sql", "original_file_path": "models/iterable.yml", "unique_id": "test.iterable.not_null_iterable__user_unsubscriptions_unique_user_key.f8db72932b", "fqn": ["iterable", "not_null_iterable__user_unsubscriptions_unique_user_key"], "alias": "not_null_iterable__user_unsubscriptions_unique_user_key", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "sql_header": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {}, "created_at": 1789422569.8791687, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "iterable__user_unsubscriptions", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.iterable.iterable__user_unsubscriptions"]}, "compiled_path": "target/compiled/iterable/models/iterable.yml/not_null_iterable__user_unsubscriptions_unique_user_key.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect unique_user_key\nfrom \"postgres\".\"public_iterable_dev\".\"iterable__user_unsubscriptions\"\nwhere unique_user_key is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "unique_user_key", "file_key_name": "models.iterable__user_unsubscriptions", "attached_node": "model.iterable.iterable__user_unsubscriptions", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "unique_user_key", "model": "{{ get_where_subquery(ref('iterable__user_unsubscriptions')) }}"}, "namespace": null}}, "test.iterable.not_null_iterable__users_unique_user_key.4ca37a26c8": {"database": "postgres", "schema": "public_dbt_test__audit", "name": "not_null_iterable__users_unique_user_key", "resource_type": "test", "package_name": "iterable", "path": "not_null_iterable__users_unique_user_key.sql", "original_file_path": "models/iterable.yml", "unique_id": "test.iterable.not_null_iterable__users_unique_user_key.4ca37a26c8", "fqn": ["iterable", "not_null_iterable__users_unique_user_key"], "alias": "not_null_iterable__users_unique_user_key", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "sql_header": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {}, "created_at": 1789422569.8846214, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "iterable__users", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.iterable.iterable__users"]}, "compiled_path": "target/compiled/iterable/models/iterable.yml/not_null_iterable__users_unique_user_key.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect unique_user_key\nfrom \"postgres\".\"public_iterable_dev\".\"iterable__users\"\nwhere unique_user_key is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "unique_user_key", "file_key_name": "models.iterable__users", "attached_node": "model.iterable.iterable__users", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "unique_user_key", "model": "{{ get_where_subquery(ref('iterable__users')) }}"}, "namespace": null}}, "test.iterable.not_null_stg_iterable__campaign_history_campaign_id.b7c36e4525": {"database": "postgres", "schema": "public_dbt_test__audit", "name": "not_null_stg_iterable__campaign_history_campaign_id", "resource_type": "test", "package_name": "iterable", "path": "not_null_stg_iterable__campaign_history_campaign_id.sql", "original_file_path": "models/staging/stg_iterable.yml", "unique_id": "test.iterable.not_null_stg_iterable__campaign_history_campaign_id.b7c36e4525", "fqn": ["iterable", "staging", "not_null_stg_iterable__campaign_history_campaign_id"], "alias": "not_null_stg_iterable__campaign_history_campaign_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "sql_header": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {}, "created_at": 1789422569.9190476, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__campaign_history", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.iterable.stg_iterable__campaign_history"]}, "compiled_path": "target/compiled/iterable/models/staging/stg_iterable.yml/not_null_stg_iterable__campaign_history_campaign_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect campaign_id\nfrom \"postgres\".\"public_iterable_dev\".\"stg_iterable__campaign_history\"\nwhere campaign_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "campaign_id", "file_key_name": "models.stg_iterable__campaign_history", "attached_node": "model.iterable.stg_iterable__campaign_history", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "campaign_id", "model": "{{ get_where_subquery(ref('stg_iterable__campaign_history')) }}"}, "namespace": null}}, "test.iterable.not_null_stg_iterable__campaign_label_history_campaign_id.1918cef89a": {"database": "postgres", "schema": "public_dbt_test__audit", "name": "not_null_stg_iterable__campaign_label_history_campaign_id", "resource_type": "test", "package_name": "iterable", "path": "not_null_stg_iterable__campaign_label_history_campaign_id.sql", "original_file_path": "models/staging/stg_iterable.yml", "unique_id": "test.iterable.not_null_stg_iterable__campaign_label_history_campaign_id.1918cef89a", "fqn": ["iterable", "staging", "not_null_stg_iterable__campaign_label_history_campaign_id"], "alias": "not_null_stg_iterable__campaign_label_history_campaign_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "sql_header": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {}, "created_at": 1789422569.9224381, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__campaign_label_history", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.iterable.stg_iterable__campaign_label_history"]}, "compiled_path": "target/compiled/iterable/models/staging/stg_iterable.yml/not_null_stg_iterable__campaign_label_history_campaign_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect campaign_id\nfrom \"postgres\".\"public_iterable_dev\".\"stg_iterable__campaign_label_history\"\nwhere campaign_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "campaign_id", "file_key_name": "models.stg_iterable__campaign_label_history", "attached_node": "model.iterable.stg_iterable__campaign_label_history", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "campaign_id", "model": "{{ get_where_subquery(ref('stg_iterable__campaign_label_history')) }}"}, "namespace": null}}, "test.iterable.not_null_stg_iterable__campaign_list_history_campaign_id.208f9bf9ed": {"database": "postgres", "schema": "public_dbt_test__audit", "name": "not_null_stg_iterable__campaign_list_history_campaign_id", "resource_type": "test", "package_name": "iterable", "path": "not_null_stg_iterable__campaign_list_history_campaign_id.sql", "original_file_path": "models/staging/stg_iterable.yml", "unique_id": "test.iterable.not_null_stg_iterable__campaign_list_history_campaign_id.208f9bf9ed", "fqn": ["iterable", "staging", "not_null_stg_iterable__campaign_list_history_campaign_id"], "alias": "not_null_stg_iterable__campaign_list_history_campaign_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "sql_header": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {}, "created_at": 1789422569.9257402, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__campaign_list_history", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.iterable.stg_iterable__campaign_list_history"]}, "compiled_path": "target/compiled/iterable/models/staging/stg_iterable.yml/not_null_stg_iterable__campaign_list_history_campaign_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect campaign_id\nfrom \"postgres\".\"public_iterable_dev\".\"stg_iterable__campaign_list_history\"\nwhere campaign_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "campaign_id", "file_key_name": "models.stg_iterable__campaign_list_history", "attached_node": "model.iterable.stg_iterable__campaign_list_history", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "campaign_id", "model": "{{ get_where_subquery(ref('stg_iterable__campaign_list_history')) }}"}, "namespace": null}}, "test.iterable.not_null_stg_iterable__campaign_suppression_list_history_campaign_id.3921289710": {"database": "postgres", "schema": "public_dbt_test__audit", "name": "not_null_stg_iterable__campaign_suppression_list_history_campaign_id", "resource_type": "test", "package_name": "iterable", "path": "not_null_stg_iterable__campaig_3ce753a10225cac67c8a1434b5541997.sql", "original_file_path": "models/staging/stg_iterable.yml", "unique_id": "test.iterable.not_null_stg_iterable__campaign_suppression_list_history_campaign_id.3921289710", "fqn": ["iterable", "staging", "not_null_stg_iterable__campaign_suppression_list_history_campaign_id"], "alias": "not_null_stg_iterable__campaig_3ce753a10225cac67c8a1434b5541997", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "not_null_stg_iterable__campaig_3ce753a10225cac67c8a1434b5541997", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "sql_header": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"alias": "not_null_stg_iterable__campaig_3ce753a10225cac67c8a1434b5541997"}, "created_at": 1789422569.928887, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"not_null_stg_iterable__campaig_3ce753a10225cac67c8a1434b5541997\") }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__campaign_suppression_list_history", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.iterable.stg_iterable__campaign_suppression_list_history"]}, "compiled_path": "target/compiled/iterable/models/staging/stg_iterable.yml/not_null_stg_iterable__campaig_3ce753a10225cac67c8a1434b5541997.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect campaign_id\nfrom \"postgres\".\"public_iterable_dev\".\"stg_iterable__campaign_suppression_list_history\"\nwhere campaign_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "campaign_id", "file_key_name": "models.stg_iterable__campaign_suppression_list_history", "attached_node": "model.iterable.stg_iterable__campaign_suppression_list_history", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "campaign_id", "model": "{{ get_where_subquery(ref('stg_iterable__campaign_suppression_list_history')) }}"}, "namespace": null}}, "test.iterable.not_null_stg_iterable__channel_channel_id.182ceb9636": {"database": "postgres", "schema": "public_dbt_test__audit", "name": "not_null_stg_iterable__channel_channel_id", "resource_type": "test", "package_name": "iterable", "path": "not_null_stg_iterable__channel_channel_id.sql", "original_file_path": "models/staging/stg_iterable.yml", "unique_id": "test.iterable.not_null_stg_iterable__channel_channel_id.182ceb9636", "fqn": ["iterable", "staging", "not_null_stg_iterable__channel_channel_id"], "alias": "not_null_stg_iterable__channel_channel_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "sql_header": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {}, "created_at": 1789422569.9319706, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__channel", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.iterable.stg_iterable__channel"]}, "compiled_path": "target/compiled/iterable/models/staging/stg_iterable.yml/not_null_stg_iterable__channel_channel_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect channel_id\nfrom \"postgres\".\"public_iterable_dev\".\"stg_iterable__channel\"\nwhere channel_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "channel_id", "file_key_name": "models.stg_iterable__channel", "attached_node": "model.iterable.stg_iterable__channel", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "channel_id", "model": "{{ get_where_subquery(ref('stg_iterable__channel')) }}"}, "namespace": null}}, "test.iterable.not_null_stg_iterable__event_event_id.370cd4bc9d": {"database": "postgres", "schema": "public_dbt_test__audit", "name": "not_null_stg_iterable__event_event_id", "resource_type": "test", "package_name": "iterable", "path": "not_null_stg_iterable__event_event_id.sql", "original_file_path": "models/staging/stg_iterable.yml", "unique_id": "test.iterable.not_null_stg_iterable__event_event_id.370cd4bc9d", "fqn": ["iterable", "staging", "not_null_stg_iterable__event_event_id"], "alias": "not_null_stg_iterable__event_event_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "sql_header": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {}, "created_at": 1789422569.9350955, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__event", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.iterable.stg_iterable__event"]}, "compiled_path": "target/compiled/iterable/models/staging/stg_iterable.yml/not_null_stg_iterable__event_event_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect event_id\nfrom \"postgres\".\"public_iterable_dev\".\"stg_iterable__event\"\nwhere event_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "event_id", "file_key_name": "models.stg_iterable__event", "attached_node": "model.iterable.stg_iterable__event", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "event_id", "model": "{{ get_where_subquery(ref('stg_iterable__event')) }}"}, "namespace": null}}, "test.iterable.not_null_stg_iterable__event_unique_event_id.e2b46d3bb6": {"database": "postgres", "schema": "public_dbt_test__audit", "name": "not_null_stg_iterable__event_unique_event_id", "resource_type": "test", "package_name": "iterable", "path": "not_null_stg_iterable__event_unique_event_id.sql", "original_file_path": "models/staging/stg_iterable.yml", "unique_id": "test.iterable.not_null_stg_iterable__event_unique_event_id.e2b46d3bb6", "fqn": ["iterable", "staging", "not_null_stg_iterable__event_unique_event_id"], "alias": "not_null_stg_iterable__event_unique_event_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "sql_header": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {}, "created_at": 1789422569.9382055, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__event", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.iterable.stg_iterable__event"]}, "compiled_path": "target/compiled/iterable/models/staging/stg_iterable.yml/not_null_stg_iterable__event_unique_event_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect unique_event_id\nfrom \"postgres\".\"public_iterable_dev\".\"stg_iterable__event\"\nwhere unique_event_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "unique_event_id", "file_key_name": "models.stg_iterable__event", "attached_node": "model.iterable.stg_iterable__event", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "unique_event_id", "model": "{{ get_where_subquery(ref('stg_iterable__event')) }}"}, "namespace": null}}, "test.iterable.not_null_stg_iterable__event_extension_event_id.144dedcd30": {"database": "postgres", "schema": "public_dbt_test__audit", "name": "not_null_stg_iterable__event_extension_event_id", "resource_type": "test", "package_name": "iterable", "path": "not_null_stg_iterable__event_extension_event_id.sql", "original_file_path": "models/staging/stg_iterable.yml", "unique_id": "test.iterable.not_null_stg_iterable__event_extension_event_id.144dedcd30", "fqn": ["iterable", "staging", "not_null_stg_iterable__event_extension_event_id"], "alias": "not_null_stg_iterable__event_extension_event_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "sql_header": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {}, "created_at": 1789422569.941636, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__event_extension", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.iterable.stg_iterable__event_extension"]}, "compiled_path": "target/compiled/iterable/models/staging/stg_iterable.yml/not_null_stg_iterable__event_extension_event_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect event_id\nfrom \"postgres\".\"public_iterable_dev\".\"stg_iterable__event_extension\"\nwhere event_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "event_id", "file_key_name": "models.stg_iterable__event_extension", "attached_node": "model.iterable.stg_iterable__event_extension", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "event_id", "model": "{{ get_where_subquery(ref('stg_iterable__event_extension')) }}"}, "namespace": null}}, "test.iterable.not_null_stg_iterable__journey_journey_id.cc38bd633c": {"database": "postgres", "schema": "public_dbt_test__audit", "name": "not_null_stg_iterable__journey_journey_id", "resource_type": "test", "package_name": "iterable", "path": "not_null_stg_iterable__journey_journey_id.sql", "original_file_path": "models/staging/stg_iterable.yml", "unique_id": "test.iterable.not_null_stg_iterable__journey_journey_id.cc38bd633c", "fqn": ["iterable", "staging", "not_null_stg_iterable__journey_journey_id"], "alias": "not_null_stg_iterable__journey_journey_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "sql_header": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {}, "created_at": 1789422569.9448404, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__journey", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.iterable.stg_iterable__journey"]}, "compiled_path": "target/compiled/iterable/models/staging/stg_iterable.yml/not_null_stg_iterable__journey_journey_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect journey_id\nfrom \"postgres\".\"public_iterable_dev\".\"stg_iterable__journey\"\nwhere journey_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "journey_id", "file_key_name": "models.stg_iterable__journey", "attached_node": "model.iterable.stg_iterable__journey", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "journey_id", "model": "{{ get_where_subquery(ref('stg_iterable__journey')) }}"}, "namespace": null}}, "test.iterable.not_null_stg_iterable__list_list_id.47029d839a": {"database": "postgres", "schema": "public_dbt_test__audit", "name": "not_null_stg_iterable__list_list_id", "resource_type": "test", "package_name": "iterable", "path": "not_null_stg_iterable__list_list_id.sql", "original_file_path": "models/staging/stg_iterable.yml", "unique_id": "test.iterable.not_null_stg_iterable__list_list_id.47029d839a", "fqn": ["iterable", "staging", "not_null_stg_iterable__list_list_id"], "alias": "not_null_stg_iterable__list_list_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "sql_header": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {}, "created_at": 1789422569.947927, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__list", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.iterable.stg_iterable__list"]}, "compiled_path": "target/compiled/iterable/models/staging/stg_iterable.yml/not_null_stg_iterable__list_list_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect list_id\nfrom \"postgres\".\"public_iterable_dev\".\"stg_iterable__list\"\nwhere list_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "list_id", "file_key_name": "models.stg_iterable__list", "attached_node": "model.iterable.stg_iterable__list", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "list_id", "model": "{{ get_where_subquery(ref('stg_iterable__list')) }}"}, "namespace": null}}, "test.iterable.not_null_stg_iterable__message_type_message_type_id.75eaa6fa62": {"database": "postgres", "schema": "public_dbt_test__audit", "name": "not_null_stg_iterable__message_type_message_type_id", "resource_type": "test", "package_name": "iterable", "path": "not_null_stg_iterable__message_type_message_type_id.sql", "original_file_path": "models/staging/stg_iterable.yml", "unique_id": "test.iterable.not_null_stg_iterable__message_type_message_type_id.75eaa6fa62", "fqn": ["iterable", "staging", "not_null_stg_iterable__message_type_message_type_id"], "alias": "not_null_stg_iterable__message_type_message_type_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "sql_header": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {}, "created_at": 1789422569.9509652, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__message_type", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.iterable.stg_iterable__message_type"]}, "compiled_path": "target/compiled/iterable/models/staging/stg_iterable.yml/not_null_stg_iterable__message_type_message_type_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect message_type_id\nfrom \"postgres\".\"public_iterable_dev\".\"stg_iterable__message_type\"\nwhere message_type_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "message_type_id", "file_key_name": "models.stg_iterable__message_type", "attached_node": "model.iterable.stg_iterable__message_type", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "message_type_id", "model": "{{ get_where_subquery(ref('stg_iterable__message_type')) }}"}, "namespace": null}}, "test.iterable.not_null_stg_iterable__template_history_template_id.14b24a1dfe": {"database": "postgres", "schema": "public_dbt_test__audit", "name": "not_null_stg_iterable__template_history_template_id", "resource_type": "test", "package_name": "iterable", "path": "not_null_stg_iterable__template_history_template_id.sql", "original_file_path": "models/staging/stg_iterable.yml", "unique_id": "test.iterable.not_null_stg_iterable__template_history_template_id.14b24a1dfe", "fqn": ["iterable", "staging", "not_null_stg_iterable__template_history_template_id"], "alias": "not_null_stg_iterable__template_history_template_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "sql_header": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {}, "created_at": 1789422569.954257, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__template_history", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.iterable.stg_iterable__template_history"]}, "compiled_path": "target/compiled/iterable/models/staging/stg_iterable.yml/not_null_stg_iterable__template_history_template_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect template_id\nfrom \"postgres\".\"public_iterable_dev\".\"stg_iterable__template_history\"\nwhere template_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "template_id", "file_key_name": "models.stg_iterable__template_history", "attached_node": "model.iterable.stg_iterable__template_history", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "template_id", "model": "{{ get_where_subquery(ref('stg_iterable__template_history')) }}"}, "namespace": null}}, "test.iterable.not_null_stg_iterable__list_user__fivetran_user_id.cca4b34c07": {"database": "postgres", "schema": "public_dbt_test__audit", "name": "not_null_stg_iterable__list_user__fivetran_user_id", "resource_type": "test", "package_name": "iterable", "path": "not_null_stg_iterable__list_user__fivetran_user_id.sql", "original_file_path": "models/staging/stg_iterable.yml", "unique_id": "test.iterable.not_null_stg_iterable__list_user__fivetran_user_id.cca4b34c07", "fqn": ["iterable", "staging", "not_null_stg_iterable__list_user__fivetran_user_id"], "alias": "not_null_stg_iterable__list_user__fivetran_user_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "sql_header": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {}, "created_at": 1789422569.9573488, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__list_user", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.iterable.stg_iterable__list_user"]}, "compiled_path": "target/compiled/iterable/models/staging/stg_iterable.yml/not_null_stg_iterable__list_user__fivetran_user_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect _fivetran_user_id\nfrom \"postgres\".\"public_iterable_dev\".\"stg_iterable__list_user\"\nwhere _fivetran_user_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "_fivetran_user_id", "file_key_name": "models.stg_iterable__list_user", "attached_node": "model.iterable.stg_iterable__list_user", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "_fivetran_user_id", "model": "{{ get_where_subquery(ref('stg_iterable__list_user')) }}"}, "namespace": null}}, "test.iterable.not_null_stg_iterable__user_history_unique_user_key.2845af2127": {"database": "postgres", "schema": "public_dbt_test__audit", "name": "not_null_stg_iterable__user_history_unique_user_key", "resource_type": "test", "package_name": "iterable", "path": "not_null_stg_iterable__user_history_unique_user_key.sql", "original_file_path": "models/staging/stg_iterable.yml", "unique_id": "test.iterable.not_null_stg_iterable__user_history_unique_user_key.2845af2127", "fqn": ["iterable", "staging", "not_null_stg_iterable__user_history_unique_user_key"], "alias": "not_null_stg_iterable__user_history_unique_user_key", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "sql_header": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {}, "created_at": 1789422569.9604406, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__user_history", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.iterable.stg_iterable__user_history"]}, "compiled_path": "target/compiled/iterable/models/staging/stg_iterable.yml/not_null_stg_iterable__user_history_unique_user_key.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect unique_user_key\nfrom \"postgres\".\"public_iterable_dev\".\"stg_iterable__user_history\"\nwhere unique_user_key is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "unique_user_key", "file_key_name": "models.stg_iterable__user_history", "attached_node": "model.iterable.stg_iterable__user_history", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "unique_user_key", "model": "{{ get_where_subquery(ref('stg_iterable__user_history')) }}"}, "namespace": null}}, "test.iterable.not_null_stg_iterable__user_unsubscribed_channel_channel_id.da0ed9e9be": {"database": "postgres", "schema": "public_dbt_test__audit", "name": "not_null_stg_iterable__user_unsubscribed_channel_channel_id", "resource_type": "test", "package_name": "iterable", "path": "not_null_stg_iterable__user_unsubscribed_channel_channel_id.sql", "original_file_path": "models/staging/stg_iterable.yml", "unique_id": "test.iterable.not_null_stg_iterable__user_unsubscribed_channel_channel_id.da0ed9e9be", "fqn": ["iterable", "staging", "not_null_stg_iterable__user_unsubscribed_channel_channel_id"], "alias": "not_null_stg_iterable__user_unsubscribed_channel_channel_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "sql_header": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {}, "created_at": 1789422569.9635522, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__user_unsubscribed_channel", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.iterable.stg_iterable__user_unsubscribed_channel"]}, "compiled_path": "target/compiled/iterable/models/staging/stg_iterable.yml/not_null_stg_iterable__user_unsubscribed_channel_channel_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect channel_id\nfrom \"postgres\".\"public_iterable_dev\".\"stg_iterable__user_unsubscribed_channel\"\nwhere channel_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "channel_id", "file_key_name": "models.stg_iterable__user_unsubscribed_channel", "attached_node": "model.iterable.stg_iterable__user_unsubscribed_channel", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "channel_id", "model": "{{ get_where_subquery(ref('stg_iterable__user_unsubscribed_channel')) }}"}, "namespace": null}}, "test.iterable.not_null_stg_iterable__user_unsub_message_type_message_type_id.268a89ea6f": {"database": "postgres", "schema": "public_dbt_test__audit", "name": "not_null_stg_iterable__user_unsub_message_type_message_type_id", "resource_type": "test", "package_name": "iterable", "path": "not_null_stg_iterable__user_unsub_message_type_message_type_id.sql", "original_file_path": "models/staging/stg_iterable.yml", "unique_id": "test.iterable.not_null_stg_iterable__user_unsub_message_type_message_type_id.268a89ea6f", "fqn": ["iterable", "staging", "not_null_stg_iterable__user_unsub_message_type_message_type_id"], "alias": "not_null_stg_iterable__user_unsub_message_type_message_type_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "sql_header": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {}, "created_at": 1789422569.9665875, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__user_unsub_message_type", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.iterable.stg_iterable__user_unsub_message_type"]}, "compiled_path": "target/compiled/iterable/models/staging/stg_iterable.yml/not_null_stg_iterable__user_unsub_message_type_message_type_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect message_type_id\nfrom \"postgres\".\"public_iterable_dev\".\"stg_iterable__user_unsub_message_type\"\nwhere message_type_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "message_type_id", "file_key_name": "models.stg_iterable__user_unsub_message_type", "attached_node": "model.iterable.stg_iterable__user_unsub_message_type", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "message_type_id", "model": "{{ get_where_subquery(ref('stg_iterable__user_unsub_message_type')) }}"}, "namespace": null}}}, "sources": {"source.iterable.iterable.campaign_history": {"database": "postgres", "schema": "public", "name": "campaign_history", "resource_type": "source", "package_name": "iterable", "path": "models/staging/src_iterable.yml", "original_file_path": "models/staging/src_iterable.yml", "unique_id": "source.iterable.iterable.campaign_history", "fqn": ["iterable", "staging", "iterable", "campaign_history"], "source_name": "iterable", "source_description": "", "loader": "fivetran", "identifier": "campaign_history_data", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Table containing a history of campaigns.", "columns": {"id": {"name": "id", "description": "Unique identifier of the campaign record", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "updated_at": {"name": "updated_at", "description": "Last update's timestamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "name": {"name": "name", "description": "User defined name of the campaign.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "campaign_state": {"name": "campaign_state", "description": "State of the campaign. Can be Draft, Ready, Scheduled, Running, Finished, Starting, Aborted or Recurring", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "type": {"name": "type", "description": "The campaign type. Can be Blast or Triggered", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "send_size": {"name": "send_size", "description": "Size of the campaign. Number of individuals included in the campaign", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "start_at": {"name": "start_at", "description": "Start timestamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "ended_at": {"name": "ended_at", "description": "Ended timestamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "created_at": {"name": "created_at", "description": "Creation timestamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "recurring_campaign_id": {"name": "recurring_campaign_id", "description": "Reference to the recurring campaign, if applicable", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "created_by_user_id": {"name": "created_by_user_id", "description": "Reference to the user who created the campaign", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "template_id": {"name": "template_id", "description": "Reference to the campaign template", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "updated_by_user_id": {"name": "updated_by_user_id", "description": "ID of the user who updated this record", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "message_medium": {"name": "message_medium", "description": "The medium that this message was sent via, for example Email or InApp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": "_fivetran_synced", "loaded_at_query": null, "meta": {}, "tags": [], "static_analysis": null}, "patch_path": null, "unrendered_config": {"loaded_at_field": "_fivetran_synced", "enabled": true, "loaded_at_query": null, "meta": {}, "tags": []}, "relation_name": "\"postgres\".\"public\".\"campaign_history_data\"", "created_at": 1789422570.1692965, "unrendered_database": "{% if target.type != 'spark' %}{{ var('iterable_database', target.database)}}{% endif %}", "unrendered_schema": "{{var ('iterable_schema', 'iterable')}}", "doc_blocks": []}, "source.iterable.iterable.campaign_label_history": {"database": "postgres", "schema": "public", "name": "campaign_label_history", "resource_type": "source", "package_name": "iterable", "path": "models/staging/src_iterable.yml", "original_file_path": "models/staging/src_iterable.yml", "unique_id": "source.iterable.iterable.campaign_label_history", "fqn": ["iterable", "staging", "iterable", "campaign_label_history"], "source_name": "iterable", "source_description": "", "loader": "fivetran", "identifier": "campaign_label_history_data", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Table containing a history of labels.", "columns": {"campaign_id": {"name": "campaign_id", "description": "Reference to the campaign associated with the label", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "label": {"name": "label", "description": "Name of the label", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "updated_at": {"name": "updated_at", "description": "Last update timestamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": "_fivetran_synced", "loaded_at_query": null, "meta": {}, "tags": [], "static_analysis": null}, "patch_path": null, "unrendered_config": {"loaded_at_field": "_fivetran_synced", "enabled": true, "loaded_at_query": null, "meta": {}, "tags": []}, "relation_name": "\"postgres\".\"public\".\"campaign_label_history_data\"", "created_at": 1789422570.1717672, "unrendered_database": "{% if target.type != 'spark' %}{{ var('iterable_database', target.database)}}{% endif %}", "unrendered_schema": "{{var ('iterable_schema', 'iterable')}}", "doc_blocks": []}, "source.iterable.iterable.campaign_list_history": {"database": "postgres", "schema": "public", "name": "campaign_list_history", "resource_type": "source", "package_name": "iterable", "path": "models/staging/src_iterable.yml", "original_file_path": "models/staging/src_iterable.yml", "unique_id": "source.iterable.iterable.campaign_list_history", "fqn": ["iterable", "staging", "iterable", "campaign_list_history"], "source_name": "iterable", "source_description": "", "loader": "fivetran", "identifier": "campaign_list_history_data", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Table containing a history of lists.", "columns": {"campaign_id": {"name": "campaign_id", "description": "Reference to the campaign associated with the label", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "list_id": {"name": "list_id", "description": "Reference to the list used", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "updated_at": {"name": "updated_at", "description": "Last update timestamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": "_fivetran_synced", "loaded_at_query": null, "meta": {}, "tags": [], "static_analysis": null}, "patch_path": null, "unrendered_config": {"loaded_at_field": "_fivetran_synced", "enabled": true, "loaded_at_query": null, "meta": {}, "tags": []}, "relation_name": "\"postgres\".\"public\".\"campaign_list_history_data\"", "created_at": 1789422570.1724825, "unrendered_database": "{% if target.type != 'spark' %}{{ var('iterable_database', target.database)}}{% endif %}", "unrendered_schema": "{{var ('iterable_schema', 'iterable')}}", "doc_blocks": []}, "source.iterable.iterable.campaign_suppression_list_history": {"database": "postgres", "schema": "public", "name": "campaign_suppression_list_history", "resource_type": "source", "package_name": "iterable", "path": "models/staging/src_iterable.yml", "original_file_path": "models/staging/src_iterable.yml", "unique_id": "source.iterable.iterable.campaign_suppression_list_history", "fqn": ["iterable", "staging", "iterable", "campaign_suppression_list_history"], "source_name": "iterable", "source_description": "", "loader": "fivetran", "identifier": "campaign_suppression_list_history_data", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Table containing a history of suppression lists.\n", "columns": {"campaign_id": {"name": "campaign_id", "description": "Reference to the campaign associated with the label", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "suppressed_list_id": {"name": "suppressed_list_id", "description": "Reference to the list used", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "updated_at": {"name": "updated_at", "description": "Last update timestamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": "_fivetran_synced", "loaded_at_query": null, "meta": {}, "tags": [], "static_analysis": null}, "patch_path": null, "unrendered_config": {"loaded_at_field": "_fivetran_synced", "enabled": true, "loaded_at_query": null, "meta": {}, "tags": []}, "relation_name": "\"postgres\".\"public\".\"campaign_suppression_list_history_data\"", "created_at": 1789422570.17318, "unrendered_database": "{% if target.type != 'spark' %}{{ var('iterable_database', target.database)}}{% endif %}", "unrendered_schema": "{{var ('iterable_schema', 'iterable')}}", "doc_blocks": []}, "source.iterable.iterable.channel": {"database": "postgres", "schema": "public", "name": "channel", "resource_type": "source", "package_name": "iterable", "path": "models/staging/src_iterable.yml", "original_file_path": "models/staging/src_iterable.yml", "unique_id": "source.iterable.iterable.channel", "fqn": ["iterable", "staging", "iterable", "channel"], "source_name": "iterable", "source_description": "", "loader": "fivetran", "identifier": "channel_data", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Table containing unique channels.", "columns": {"id": {"name": "id", "description": "Unique identifier of the channel", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "name": {"name": "name", "description": "User defined name of the channel", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "channel_type": {"name": "channel_type", "description": "The channel type", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "message_medium": {"name": "message_medium", "description": "The message medium associated with the channel", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": "_fivetran_synced", "loaded_at_query": null, "meta": {}, "tags": [], "static_analysis": null}, "patch_path": null, "unrendered_config": {"loaded_at_field": "_fivetran_synced", "enabled": true, "loaded_at_query": null, "meta": {}, "tags": []}, "relation_name": "\"postgres\".\"public\".\"channel_data\"", "created_at": 1789422570.1741278, "unrendered_database": "{% if target.type != 'spark' %}{{ var('iterable_database', target.database)}}{% endif %}", "unrendered_schema": "{{var ('iterable_schema', 'iterable')}}", "doc_blocks": []}, "source.iterable.iterable.event": {"database": "postgres", "schema": "public", "name": "event", "resource_type": "source", "package_name": "iterable", "path": "models/staging/src_iterable.yml", "original_file_path": "models/staging/src_iterable.yml", "unique_id": "source.iterable.iterable.event", "fqn": ["iterable", "staging", "iterable", "event"], "source_name": "iterable", "source_description": "", "loader": "fivetran", "identifier": "event_data", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Table containing individual events within campaigns.", "columns": {"_fivetran_id": {"name": "_fivetran_id", "description": "A Fivetran-created unique identifier derived from hashing campaign_id, created_at, and event_name.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "campaign_id": {"name": "campaign_id", "description": "Reference to the campaign from which the event originated", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "content_id": {"name": "content_id", "description": "Reference to the content the event is associated with.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "created_at": {"name": "created_at", "description": "Creation timestamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "email": {"name": "email", "description": "The user's email. User identifier, for email-based projects. Previously was the unique identifier for user records, for Iterable customers before August 2023. Exists if using the history version of the table.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "additional_properties": {"name": "additional_properties", "description": "json object containing addition event properties", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "event_name": {"name": "event_name", "description": "Name provided to the individual event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "message_bus_id": {"name": "message_bus_id", "description": "Reference to the message bus associated with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "message_id": {"name": "message_id", "description": "Reference to the message the event is associated with", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "message_type_id": {"name": "message_type_id", "description": "Reference to the type of message the event is associated with", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "recipient_state": {"name": "recipient_state", "description": "The state of the recipient upon receiving the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "status": {"name": "status", "description": "Status of the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "transactional_data": {"name": "transactional_data", "description": "Transactional data associated with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unsub_source": {"name": "unsub_source", "description": "Source of the unsubscribe event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "user_agent": {"name": "user_agent", "description": "User agent associated with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "user_agent_device": {"name": "user_agent_device", "description": "The device of the user agent", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "_fivetran_user_id": {"name": "_fivetran_user_id", "description": "A Fivetran-created unique identifier for users, derived from hashing user_id and/or email, depending on project type.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": "_fivetran_synced", "loaded_at_query": null, "meta": {}, "tags": [], "static_analysis": null}, "patch_path": null, "unrendered_config": {"loaded_at_field": "_fivetran_synced", "enabled": true, "loaded_at_query": null, "meta": {}, "tags": []}, "relation_name": "\"postgres\".\"public\".\"event_data\"", "created_at": 1789422570.174916, "unrendered_database": "{% if target.type != 'spark' %}{{ var('iterable_database', target.database)}}{% endif %}", "unrendered_schema": "{{var ('iterable_schema', 'iterable')}}", "doc_blocks": []}, "source.iterable.iterable.event_extension": {"database": "postgres", "schema": "public", "name": "event_extension", "resource_type": "source", "package_name": "iterable", "path": "models/staging/src_iterable.yml", "original_file_path": "models/staging/src_iterable.yml", "unique_id": "source.iterable.iterable.event_extension", "fqn": ["iterable", "staging", "iterable", "event_extension"], "source_name": "iterable", "source_description": "", "loader": "fivetran", "identifier": "event_extension_data", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Table containing additional properties from the event table.", "columns": {"_fivetran_id": {"name": "_fivetran_id", "description": "A Fivetran-created unique identifier derived from hashing campaign_id, created_at, and event_name.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "app_already_running": {"name": "app_already_running", "description": "Boolean indicating if the app is currently running or not", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "badge": {"name": "badge", "description": "Badge associated with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "canonical_url_id": {"name": "canonical_url_id", "description": "Reference to the url associated with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "content_available": {"name": "content_available", "description": "Content available from the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "content_id": {"name": "content_id", "description": "Reference to the content associated with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "deeplink_android": {"name": "deeplink_android", "description": "Deeplink associated with the event from an android device", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "deeplink_ios": {"name": "deeplink_ios", "description": "Deeplink associated with the event from an ios device", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "device": {"name": "device", "description": "The device associated with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "email_id": {"name": "email_id", "description": "Reference to the email associated with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "email_subject": {"name": "email_subject", "description": "Subject of the email associated with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "experiment_id": {"name": "experiment_id", "description": "Reference to the experiment used if the event is an experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "from_phone_number_id": {"name": "from_phone_number_id", "description": "Reference to the phone number which the event is from", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "from_smssender_id": {"name": "from_smssender_id", "description": "Reference to the sms sender which the event is from", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "image_url": {"name": "image_url", "description": "Image url of the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "is_ghost_push": {"name": "is_ghost_push", "description": "Boolean indicating if the event is a result of a ghost push", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "link_id": {"name": "link_id", "description": "Reference to the link associated with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "link_url": {"name": "link_url", "description": "Url of the link associated with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "locale": {"name": "locale", "description": "Locale associated with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "payload": {"name": "payload", "description": "Payload resulted from the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "platform_endpoint": {"name": "platform_endpoint", "description": "The specific platform endpoint of the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "push_message": {"name": "push_message", "description": "Boolean indicating if the event is a push message", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "region": {"name": "region", "description": "Region of the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "sms_message": {"name": "sms_message", "description": "Boolean indicating if the event is an sms message", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "sms_provider_response_code": {"name": "sms_provider_response_code", "description": "sms provider response code from the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "sms_provider_response_message": {"name": "sms_provider_response_message", "description": "sms provider response message from the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "sms_provider_response_more_info": {"name": "sms_provider_response_more_info", "description": "sms provider response addition info from the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "sms_provider_response_status": {"name": "sms_provider_response_status", "description": "Status of the sms provider response from the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "sound": {"name": "sound", "description": "Boolean indicating if a sound was used with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "to_phone_number": {"name": "to_phone_number", "description": "To phone number associated with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "url": {"name": "url", "description": "Url associated with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "workflow_id": {"name": "workflow_id", "description": "Reference to the workflow which the event originated", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "workflow_name": {"name": "workflow_name", "description": "Name of the workflow which the event originated", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "catalog_collection_count": {"name": "catalog_collection_count", "description": "The count of products or items collected in a catalog associated with the event.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "catalog_lookup_count": {"name": "catalog_lookup_count", "description": "The count of times a catalog was looked up or queried during the event.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "city": {"name": "city", "description": "The city associated with the event, which could be the location of the recipient.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "clicked_url": {"name": "clicked_url", "description": "The URL that was clicked by the recipient in response to the marketing message.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "country": {"name": "country", "description": "The country associated with the event, which could be the location of the recipient.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "error_code": {"name": "error_code", "description": "The error code or message indicating any issues or errors encountered during the event.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "expires_at": {"name": "expires_at", "description": "The date and time when the event or message is set to expire or become invalid.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "from_phone_number": {"name": "from_phone_number", "description": "The phone number from which the SMS message was sent.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "in_app_body": {"name": "in_app_body", "description": "The content or body of an in-app message that was sent as part of the event.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "is_sms_estimation": {"name": "is_sms_estimation", "description": "A boolean indicating whether the SMS message is an estimation or not.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "labels": {"name": "labels", "description": "Any labels or tags associated with the event, which can be used for categorization or organization.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "message_context": {"name": "message_context", "description": "Additional contextual information related to the marketing message or event.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "message_status": {"name": "message_status", "description": "The status of the marketing message, such as sent, delivered, opened, etc.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "mms_send_count": {"name": "mms_send_count", "description": "The count of multimedia messages (MMS) sent as part of the event.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "product_recommendation_count": {"name": "product_recommendation_count", "description": "The count of product recommendations included in the message.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "proxy_source": {"name": "proxy_source", "description": "Information about the source or proxy used for sending the message.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "reason": {"name": "reason", "description": "The reason or cause associated with a specific event or action.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "sms_send_count": {"name": "sms_send_count", "description": "The count of SMS messages sent as part of the event.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "web_push_body": {"name": "web_push_body", "description": "The content or body of a web push notification sent as part of the event.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "web_push_click_action": {"name": "web_push_click_action", "description": "The action triggered when a recipient clicks a web push notification.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "web_push_icon": {"name": "web_push_icon", "description": "The icon or image associated with the web push notification.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "web_push_message": {"name": "web_push_message", "description": "The message or notification sent to web users as part of the event.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": "_fivetran_synced", "loaded_at_query": null, "meta": {}, "tags": [], "static_analysis": null}, "patch_path": null, "unrendered_config": {"loaded_at_field": "_fivetran_synced", "enabled": true, "loaded_at_query": null, "meta": {}, "tags": []}, "relation_name": "\"postgres\".\"public\".\"event_extension_data\"", "created_at": 1789422570.175931, "unrendered_database": "{% if target.type != 'spark' %}{{ var('iterable_database', target.database)}}{% endif %}", "unrendered_schema": "{{var ('iterable_schema', 'iterable')}}", "doc_blocks": []}, "source.iterable.iterable.journey": {"database": "postgres", "schema": "public", "name": "journey", "resource_type": "source", "package_name": "iterable", "path": "models/staging/src_iterable.yml", "original_file_path": "models/staging/src_iterable.yml", "unique_id": "source.iterable.iterable.journey", "fqn": ["iterable", "staging", "iterable", "journey"], "source_name": "iterable", "source_description": "", "loader": "fivetran", "identifier": "journey_data", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Table containing unique journeys, formerly known as workflows.", "columns": {"id": {"name": "id", "description": "Unique identifier of the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "name": {"name": "name", "description": "User defined name of the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "journey_type": {"name": "journey_type", "description": "Whether the journey is published or a draft.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "description": {"name": "description", "description": "Information about the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "creator_user_id": {"name": "creator_user_id", "description": "Reference to the user who created the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "enabled": {"name": "enabled", "description": "Boolean indicating if the journey is currently enabled", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "is_archived": {"name": "is_archived", "description": "Boolean indicating if the journey has been archived", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "lifetime_limit": {"name": "lifetime_limit", "description": "Maximum number of times a user may enter the journey over their lifetime", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "simultaneous_limit": {"name": "simultaneous_limit", "description": "Maximum number of times a user may be in the journey at the same time", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "start_tile_id": {"name": "start_tile_id", "description": "Reference to the tile which begins the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "trigger_event_names": {"name": "trigger_event_names", "description": "The event names which trigger a user's entry into the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "created_at": {"name": "created_at", "description": "Creation timestamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "updated_at": {"name": "updated_at", "description": "Last update timestamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": "_fivetran_synced", "loaded_at_query": null, "meta": {}, "tags": [], "static_analysis": null}, "patch_path": null, "unrendered_config": {"loaded_at_field": "_fivetran_synced", "enabled": true, "loaded_at_query": null, "meta": {}, "tags": []}, "relation_name": "\"postgres\".\"public\".\"journey_data\"", "created_at": 1789422570.176689, "unrendered_database": "{% if target.type != 'spark' %}{{ var('iterable_database', target.database)}}{% endif %}", "unrendered_schema": "{{var ('iterable_schema', 'iterable')}}", "doc_blocks": []}, "source.iterable.iterable.list": {"database": "postgres", "schema": "public", "name": "list", "resource_type": "source", "package_name": "iterable", "path": "models/staging/src_iterable.yml", "original_file_path": "models/staging/src_iterable.yml", "unique_id": "source.iterable.iterable.list", "fqn": ["iterable", "staging", "iterable", "list"], "source_name": "iterable", "source_description": "", "loader": "fivetran", "identifier": "list_data", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Table containing users and the lists the users are associated with.", "columns": {"id": {"name": "id", "description": "Unique identifier of the list", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "name": {"name": "name", "description": "User defined name of the list", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "list_type": {"name": "list_type", "description": "The list type", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "created_at": {"name": "created_at", "description": "Creation timestamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "description": {"name": "description", "description": "Information about the list", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": "_fivetran_synced", "loaded_at_query": null, "meta": {}, "tags": [], "static_analysis": null}, "patch_path": null, "unrendered_config": {"loaded_at_field": "_fivetran_synced", "enabled": true, "loaded_at_query": null, "meta": {}, "tags": []}, "relation_name": "\"postgres\".\"public\".\"list_data\"", "created_at": 1789422570.1773958, "unrendered_database": "{% if target.type != 'spark' %}{{ var('iterable_database', target.database)}}{% endif %}", "unrendered_schema": "{{var ('iterable_schema', 'iterable')}}", "doc_blocks": []}, "source.iterable.iterable.message_type": {"database": "postgres", "schema": "public", "name": "message_type", "resource_type": "source", "package_name": "iterable", "path": "models/staging/src_iterable.yml", "original_file_path": "models/staging/src_iterable.yml", "unique_id": "source.iterable.iterable.message_type", "fqn": ["iterable", "staging", "iterable", "message_type"], "source_name": "iterable", "source_description": "", "loader": "fivetran", "identifier": "message_type_data", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Table containing unique message types.", "columns": {"id": {"name": "id", "description": "Unique identifier of the message type", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "name": {"name": "name", "description": "User defined name of the message type", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "channel_id": {"name": "channel_id", "description": "Channel that this message type belongs to", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "created_at": {"name": "created_at", "description": "Time when the message type was initially created", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "frequency_cap": {"name": "frequency_cap", "description": "The maximum number of times a message of this type can be sent to a recipient within a specified time period to prevent over-messaging", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "rate_limit_per_minute": {"name": "rate_limit_per_minute", "description": "The maximum number of messages of this type that can be sent to recipients in a minute, ensuring controlled message delivery", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "subscription_policy": {"name": "subscription_policy", "description": "Information about the policy or rules governing how users can subscribe to or unsubscribe from this specific message type, like OptOut", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "updated_at": {"name": "updated_at", "description": "Time when the message type was last updated or modified", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": "_fivetran_synced", "loaded_at_query": null, "meta": {}, "tags": [], "static_analysis": null}, "patch_path": null, "unrendered_config": {"loaded_at_field": "_fivetran_synced", "enabled": true, "loaded_at_query": null, "meta": {}, "tags": []}, "relation_name": "\"postgres\".\"public\".\"message_type_data\"", "created_at": 1789422570.1781225, "unrendered_database": "{% if target.type != 'spark' %}{{ var('iterable_database', target.database)}}{% endif %}", "unrendered_schema": "{{var ('iterable_schema', 'iterable')}}", "doc_blocks": []}, "source.iterable.iterable.template_history": {"database": "postgres", "schema": "public", "name": "template_history", "resource_type": "source", "package_name": "iterable", "path": "models/staging/src_iterable.yml", "original_file_path": "models/staging/src_iterable.yml", "unique_id": "source.iterable.iterable.template_history", "fqn": ["iterable", "staging", "iterable", "template_history"], "source_name": "iterable", "source_description": "", "loader": "fivetran", "identifier": "template_history_data", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Table containing unique templates used across campaigns.", "columns": {"id": {"name": "id", "description": "Unique identifier of the template", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "name": {"name": "name", "description": "User defined name of the template", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "template_type": {"name": "template_type", "description": "The type of the template", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "created_at": {"name": "created_at", "description": "Creation timestamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "client_template_id": {"name": "client_template_id", "description": "Reference to the client template", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "creator_user_id": {"name": "creator_user_id", "description": "Reference to the user who created the template", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "message_type_id": {"name": "message_type_id", "description": "Reference to the message type associated with the template", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "updated_at": {"name": "updated_at", "description": "Last update timestamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": "_fivetran_synced", "loaded_at_query": null, "meta": {}, "tags": [], "static_analysis": null}, "patch_path": null, "unrendered_config": {"loaded_at_field": "_fivetran_synced", "enabled": true, "loaded_at_query": null, "meta": {}, "tags": []}, "relation_name": "\"postgres\".\"public\".\"template_history_data\"", "created_at": 1789422570.1788342, "unrendered_database": "{% if target.type != 'spark' %}{{ var('iterable_database', target.database)}}{% endif %}", "unrendered_schema": "{{var ('iterable_schema', 'iterable')}}", "doc_blocks": []}, "source.iterable.iterable.user_history": {"database": "postgres", "schema": "public", "name": "user_history", "resource_type": "source", "package_name": "iterable", "path": "models/staging/src_iterable.yml", "original_file_path": "models/staging/src_iterable.yml", "unique_id": "source.iterable.iterable.user_history", "fqn": ["iterable", "staging", "iterable", "user_history"], "source_name": "iterable", "source_description": "", "loader": "fivetran", "identifier": "user_history_data", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Table containing individual user history information.", "columns": {"email": {"name": "email", "description": "The user's email. Previously was the unique identifier for the user records, for Iterable customers before August 2023. This has since been replaced by iterable_user_id.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "user_id": {"name": "user_id", "description": "User defined identifier of the user. This is not a unique field", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "iterable_user_id": {"name": "iterable_user_id", "description": "The unique identifier of the user", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "first_name": {"name": "first_name", "description": "First name of the user", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "last_name": {"name": "last_name", "description": "Last name of the user", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "email_list_ids": {"name": "email_list_ids", "description": "[DEPRECATED October 13, 2025 Use LIST_USER source instead.] Array of references to the lists associated with the user\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "signup_date": {"name": "signup_date", "description": "Timestamp of when the user signed up", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "signup_source": {"name": "signup_source", "description": "Source where the user signed up", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "updated_at": {"name": "updated_at", "description": "Last update timestamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": "_fivetran_synced", "loaded_at_query": null, "meta": {}, "tags": [], "static_analysis": null}, "patch_path": null, "unrendered_config": {"loaded_at_field": "_fivetran_synced", "enabled": true, "loaded_at_query": null, "meta": {}, "tags": []}, "relation_name": "\"postgres\".\"public\".\"user_history_data\"", "created_at": 1789422570.1795614, "unrendered_database": "{% if target.type != 'spark' %}{{ var('iterable_database', target.database)}}{% endif %}", "unrendered_schema": "{{var ('iterable_schema', 'iterable')}}", "doc_blocks": []}, "source.iterable.iterable.user_unsubscribed_channel": {"database": "postgres", "schema": "public", "name": "user_unsubscribed_channel", "resource_type": "source", "package_name": "iterable", "path": "models/staging/src_iterable.yml", "original_file_path": "models/staging/src_iterable.yml", "unique_id": "source.iterable.iterable.user_unsubscribed_channel", "fqn": ["iterable", "staging", "iterable", "user_unsubscribed_channel"], "source_name": "iterable", "source_description": "", "loader": "fivetran", "identifier": "user_unsubscribed_channel_data", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Table containing the channels from which a user has unsubscribed.", "columns": {"_fivetran_id": {"name": "_fivetran_id", "description": "A Fivetran-created unique identifier for users, derived from hashing user_id and/or email, depending on project type.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "channel_id": {"name": "channel_id", "description": "Reference to the channel from which the user unsubscribed", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": "_fivetran_synced", "loaded_at_query": null, "meta": {}, "tags": [], "static_analysis": null}, "patch_path": null, "unrendered_config": {"loaded_at_field": "_fivetran_synced", "enabled": true, "loaded_at_query": null, "meta": {}, "tags": []}, "relation_name": "\"postgres\".\"public\".\"user_unsubscribed_channel_data\"", "created_at": 1789422570.1802247, "unrendered_database": "{% if target.type != 'spark' %}{{ var('iterable_database', target.database)}}{% endif %}", "unrendered_schema": "{{var ('iterable_schema', 'iterable')}}", "doc_blocks": []}, "source.iterable.iterable.user_unsubscribed_message_type": {"database": "postgres", "schema": "public", "name": "user_unsubscribed_message_type", "resource_type": "source", "package_name": "iterable", "path": "models/staging/src_iterable.yml", "original_file_path": "models/staging/src_iterable.yml", "unique_id": "source.iterable.iterable.user_unsubscribed_message_type", "fqn": ["iterable", "staging", "iterable", "user_unsubscribed_message_type"], "source_name": "iterable", "source_description": "", "loader": "fivetran", "identifier": "user_unsubscribed_message_type_data", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Table containing the message types from which a user has unsubscribed.", "columns": {"_fivetran_id": {"name": "_fivetran_id", "description": "A Fivetran-created unique identifier for users, derived from hashing user_id and/or email, depending on project type.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "message_type_id": {"name": "message_type_id", "description": "Reference to the message type from which the user unsubscribed", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": "_fivetran_synced", "loaded_at_query": null, "meta": {}, "tags": [], "static_analysis": null}, "patch_path": null, "unrendered_config": {"loaded_at_field": "_fivetran_synced", "enabled": true, "loaded_at_query": null, "meta": {}, "tags": []}, "relation_name": "\"postgres\".\"public\".\"user_unsubscribed_message_type_data\"", "created_at": 1789422570.1809583, "unrendered_database": "{% if target.type != 'spark' %}{{ var('iterable_database', target.database)}}{% endif %}", "unrendered_schema": "{{var ('iterable_schema', 'iterable')}}", "doc_blocks": []}, "source.iterable.iterable.user_unsubscribed_channel_history": {"database": "postgres", "schema": "public", "name": "user_unsubscribed_channel_history", "resource_type": "source", "package_name": "iterable", "path": "models/staging/src_iterable.yml", "original_file_path": "models/staging/src_iterable.yml", "unique_id": "source.iterable.iterable.user_unsubscribed_channel_history", "fqn": ["iterable", "staging", "iterable", "user_unsubscribed_channel_history"], "source_name": "iterable", "source_description": "", "loader": "fivetran", "identifier": "user_unsubscribed_channel_history_data", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Table containing the history of channels from which a user has unsubscribed.", "columns": {"channel_id": {"name": "channel_id", "description": "Reference to the channel from which the user unsubscribed", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "email": {"name": "email", "description": "Unique identifier of the user", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "updated_at": {"name": "updated_at", "description": "Last update timestamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": "_fivetran_synced", "loaded_at_query": null, "meta": {}, "tags": [], "static_analysis": null}, "patch_path": null, "unrendered_config": {"loaded_at_field": "_fivetran_synced", "enabled": true, "loaded_at_query": null, "meta": {}, "tags": []}, "relation_name": "\"postgres\".\"public\".\"user_unsubscribed_channel_history_data\"", "created_at": 1789422570.1816406, "unrendered_database": "{% if target.type != 'spark' %}{{ var('iterable_database', target.database)}}{% endif %}", "unrendered_schema": "{{var ('iterable_schema', 'iterable')}}", "doc_blocks": []}, "source.iterable.iterable.user_unsubscribed_message_type_history": {"database": "postgres", "schema": "public", "name": "user_unsubscribed_message_type_history", "resource_type": "source", "package_name": "iterable", "path": "models/staging/src_iterable.yml", "original_file_path": "models/staging/src_iterable.yml", "unique_id": "source.iterable.iterable.user_unsubscribed_message_type_history", "fqn": ["iterable", "staging", "iterable", "user_unsubscribed_message_type_history"], "source_name": "iterable", "source_description": "", "loader": "fivetran", "identifier": "user_unsubscribed_message_type_history_data", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Table containing the history of message types from which a user has unsubscribed.", "columns": {"message_type_id": {"name": "message_type_id", "description": "Reference to the message type from which the user unsubscribed", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "email": {"name": "email", "description": "Unique identifier of the user", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "updated_at": {"name": "updated_at", "description": "Last update timestamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": "_fivetran_synced", "loaded_at_query": null, "meta": {}, "tags": [], "static_analysis": null}, "patch_path": null, "unrendered_config": {"loaded_at_field": "_fivetran_synced", "enabled": true, "loaded_at_query": null, "meta": {}, "tags": []}, "relation_name": "\"postgres\".\"public\".\"user_unsubscribed_message_type_history_data\"", "created_at": 1789422570.1823082, "unrendered_database": "{% if target.type != 'spark' %}{{ var('iterable_database', target.database)}}{% endif %}", "unrendered_schema": "{{var ('iterable_schema', 'iterable')}}", "doc_blocks": []}, "source.iterable.iterable.list_user": {"database": "postgres", "schema": "public", "name": "list_user", "resource_type": "source", "package_name": "iterable", "path": "models/staging/src_iterable.yml", "original_file_path": "models/staging/src_iterable.yml", "unique_id": "source.iterable.iterable.list_user", "fqn": ["iterable", "staging", "iterable", "list_user"], "source_name": "iterable", "source_description": "", "loader": "fivetran", "identifier": "list_user_data", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Table containing the relationship between users and lists they belong to.", "columns": {"_fivetran_id": {"name": "_fivetran_id", "description": "Unique identifier of the list-user relationship record, serving as a foreign key to `user_history._fivetran_id`.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "index": {"name": "index", "description": "Index of the record", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "list_id": {"name": "list_id", "description": "Reference to the list that the user belongs to", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "Timestamp when the record was last synced by Fivetran", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": "_fivetran_synced", "loaded_at_query": null, "meta": {}, "tags": [], "static_analysis": null}, "patch_path": null, "unrendered_config": {"loaded_at_field": "_fivetran_synced", "enabled": true, "loaded_at_query": null, "meta": {}, "tags": []}, "relation_name": "\"postgres\".\"public\".\"list_user_data\"", "created_at": 1789422570.1830015, "unrendered_database": "{% if target.type != 'spark' %}{{ var('iterable_database', target.database)}}{% endif %}", "unrendered_schema": "{{var ('iterable_schema', 'iterable')}}", "doc_blocks": []}}, "macros": {"macro.dbt_postgres.postgres__current_timestamp": {"name": "postgres__current_timestamp", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/timestamps.sql", "original_file_path": "macros/timestamps.sql", "unique_id": "macro.dbt_postgres.postgres__current_timestamp", "macro_sql": "{% macro postgres__current_timestamp() -%}\n now()\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789422566.268828, "supported_languages": null}, "macro.dbt_postgres.postgres__snapshot_string_as_time": {"name": "postgres__snapshot_string_as_time", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/timestamps.sql", "original_file_path": "macros/timestamps.sql", "unique_id": "macro.dbt_postgres.postgres__snapshot_string_as_time", "macro_sql": "{% macro postgres__snapshot_string_as_time(timestamp) -%}\n {%- set result = \"'\" ~ timestamp ~ \"'::timestamp without time zone\" -%}\n {{ return(result) }}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "timestamp", "type": null, "description": ""}], "created_at": 1789422566.2693083, "supported_languages": null}, "macro.dbt_postgres.postgres__snapshot_get_time": {"name": "postgres__snapshot_get_time", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/timestamps.sql", "original_file_path": "macros/timestamps.sql", "unique_id": "macro.dbt_postgres.postgres__snapshot_get_time", "macro_sql": "{% macro postgres__snapshot_get_time() -%}\n {{ current_timestamp() }}::timestamp without time zone\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.current_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789422566.2695978, "supported_languages": null}, "macro.dbt_postgres.postgres__current_timestamp_backcompat": {"name": "postgres__current_timestamp_backcompat", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/timestamps.sql", "original_file_path": "macros/timestamps.sql", "unique_id": "macro.dbt_postgres.postgres__current_timestamp_backcompat", "macro_sql": "{% macro postgres__current_timestamp_backcompat() %}\n current_timestamp::{{ type_timestamp() }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.type_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789422566.2698395, "supported_languages": null}, "macro.dbt_postgres.postgres__current_timestamp_in_utc_backcompat": {"name": "postgres__current_timestamp_in_utc_backcompat", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/timestamps.sql", "original_file_path": "macros/timestamps.sql", "unique_id": "macro.dbt_postgres.postgres__current_timestamp_in_utc_backcompat", "macro_sql": "{% macro postgres__current_timestamp_in_utc_backcompat() %}\n (current_timestamp at time zone 'utc')::{{ type_timestamp() }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.type_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789422566.2700758, "supported_languages": null}, "macro.dbt_postgres.postgres__get_catalog_relations": {"name": "postgres__get_catalog_relations", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/catalog.sql", "original_file_path": "macros/catalog.sql", "unique_id": "macro.dbt_postgres.postgres__get_catalog_relations", "macro_sql": "{% macro postgres__get_catalog_relations(information_schema, relations) -%}\n {%- call statement('catalog', fetch_result=True) -%}\n\n {#\n If the user has multiple databases set and the first one is wrong, this will fail.\n But we won't fail in the case where there are multiple quoting-difference-only dbs, which is better.\n #}\n {% set database = information_schema.database %}\n {{ adapter.verify_database(database) }}\n\n select\n '{{ database }}' as table_database,\n sch.nspname as table_schema,\n tbl.relname as table_name,\n case tbl.relkind\n when 'v' then 'VIEW'\n when 'm' then 'MATERIALIZED VIEW'\n else 'BASE TABLE'\n end as table_type,\n tbl_desc.description as table_comment,\n col.attname as column_name,\n col.attnum as column_index,\n pg_catalog.format_type(col.atttypid, col.atttypmod) as column_type,\n col_desc.description as column_comment,\n pg_get_userbyid(tbl.relowner) as table_owner\n\n from pg_catalog.pg_namespace sch\n join pg_catalog.pg_class tbl on tbl.relnamespace = sch.oid\n join pg_catalog.pg_attribute col on col.attrelid = tbl.oid\n left outer join pg_catalog.pg_description tbl_desc on (tbl_desc.objoid = tbl.oid and tbl_desc.objsubid = 0)\n left outer join pg_catalog.pg_description col_desc on (col_desc.objoid = tbl.oid and col_desc.objsubid = col.attnum)\n where (\n {%- for relation in relations -%}\n {%- if relation.identifier -%}\n (upper(sch.nspname) = upper('{{ relation.schema }}') and\n upper(tbl.relname) = upper('{{ relation.identifier }}'))\n {%- else-%}\n upper(sch.nspname) = upper('{{ relation.schema }}')\n {%- endif -%}\n {%- if not loop.last %} or {% endif -%}\n {%- endfor -%}\n )\n and not pg_is_other_temp_schema(sch.oid) -- not a temporary schema belonging to another session\n and tbl.relpersistence in ('p', 'u') -- [p]ermanent table or [u]nlogged table. Exclude [t]emporary tables\n and tbl.relkind in ('r', 'v', 'f', 'p', 'm') -- o[r]dinary table, [v]iew, [f]oreign table, [p]artitioned table, [m]aterialized view. Other values are [i]ndex, [S]equence, [c]omposite type, [t]OAST table\n and col.attnum > 0 -- negative numbers are used for system columns such as oid\n and not col.attisdropped -- column as not been dropped\n\n order by\n sch.nspname,\n tbl.relname,\n col.attnum\n\n {%- endcall -%}\n\n {{ return(load_result('catalog').table) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "information_schema", "type": null, "description": ""}, {"name": "relations", "type": null, "description": ""}], "created_at": 1789422566.2722476, "supported_languages": null}, "macro.dbt_postgres.postgres__get_catalog": {"name": "postgres__get_catalog", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/catalog.sql", "original_file_path": "macros/catalog.sql", "unique_id": "macro.dbt_postgres.postgres__get_catalog", "macro_sql": "{% macro postgres__get_catalog(information_schema, schemas) -%}\n {%- set relations = [] -%}\n {%- for schema in schemas -%}\n {%- set dummy = relations.append({'schema': schema}) -%}\n {%- endfor -%}\n {{ return(postgres__get_catalog_relations(information_schema, relations)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__get_catalog_relations"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "information_schema", "type": null, "description": ""}, {"name": "schemas", "type": null, "description": ""}], "created_at": 1789422566.2730575, "supported_languages": null}, "macro.dbt_postgres.postgres__get_relations": {"name": "postgres__get_relations", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/relations.sql", "original_file_path": "macros/relations.sql", "unique_id": "macro.dbt_postgres.postgres__get_relations", "macro_sql": "{% macro postgres__get_relations() -%}\n\n {#\n -- in pg_depend, objid is the dependent, refobjid is the referenced object\n -- > a pg_depend entry indicates that the referenced object cannot be\n -- > dropped without also dropping the dependent object.\n #}\n\n {%- call statement('relations', fetch_result=True) -%}\n select distinct\n dependent_namespace.nspname as dependent_schema,\n dependent_class.relname as dependent_name,\n referenced_namespace.nspname as referenced_schema,\n referenced_class.relname as referenced_name\n\n -- Query for views: views are entries in pg_class with an entry in pg_rewrite, but we avoid\n -- a seq scan on pg_rewrite by leveraging the fact there is an \"internal\" row in pg_depend for\n -- the view...\n from pg_class as dependent_class\n join pg_namespace as dependent_namespace on dependent_namespace.oid = dependent_class.relnamespace\n join pg_depend as dependent_depend on dependent_depend.refobjid = dependent_class.oid\n and dependent_depend.classid = 'pg_rewrite'::regclass\n and dependent_depend.refclassid = 'pg_class'::regclass\n and dependent_depend.deptype = 'i'\n\n -- ... and via pg_depend (that has a row per column, hence the need for \"distinct\" above, and\n -- making sure to exclude the internal row to avoid a view appearing to depend on itself)...\n join pg_depend as joining_depend on joining_depend.objid = dependent_depend.objid\n and joining_depend.classid = 'pg_rewrite'::regclass\n and joining_depend.refclassid = 'pg_class'::regclass\n and joining_depend.refobjid != dependent_depend.refobjid\n\n -- ... we can find the tables they query from in pg_class, but excluding system tables. Note we\n -- don't need need to exclude _dependent_ system tables, because they only query from other\n -- system tables, and so are automatically excluded by excluding _referenced_ system tables\n join pg_class as referenced_class on referenced_class.oid = joining_depend.refobjid\n join pg_namespace as referenced_namespace on referenced_namespace.oid = referenced_class.relnamespace\n and referenced_namespace.nspname != 'information_schema'\n and referenced_namespace.nspname not like 'pg\\_%'\n\n order by\n dependent_schema, dependent_name, referenced_schema, referenced_name;\n\n {%- endcall -%}\n\n {{ return(load_result('relations').table) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789422566.274116, "supported_languages": null}, "macro.dbt_postgres.postgres_get_relations": {"name": "postgres_get_relations", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/relations.sql", "original_file_path": "macros/relations.sql", "unique_id": "macro.dbt_postgres.postgres_get_relations", "macro_sql": "{% macro postgres_get_relations() %}\n {{ return(postgres__get_relations()) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__get_relations"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789422566.274446, "supported_languages": null}, "macro.dbt_postgres.postgres__create_table_as": {"name": "postgres__create_table_as", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "unique_id": "macro.dbt_postgres.postgres__create_table_as", "macro_sql": "{% macro postgres__create_table_as(temporary, relation, sql) -%}\n {%- set unlogged = config.get('unlogged', default=false) -%}\n {%- set sql_header = config.get('sql_header', none) -%}\n\n {{ sql_header if sql_header is not none }}\n\n create {% if temporary -%}\n temporary\n {%- elif unlogged -%}\n unlogged\n {%- endif %} table {{ relation }}\n {% set contract_config = config.get('contract') %}\n {% if contract_config.enforced %}\n {{ get_assert_columns_equivalent(sql) }}\n {% endif -%}\n {% if contract_config.enforced and (not temporary) -%}\n {{ get_table_columns_and_constraints() }} ;\n insert into {{ relation }} (\n {{ adapter.dispatch('get_column_names', 'dbt')() }}\n )\n {%- set sql = get_select_subquery(sql) %}\n {% else %}\n as\n {% endif %}\n (\n {{ sql }}\n );\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.get_assert_columns_equivalent", "macro.dbt.get_table_columns_and_constraints", "macro.dbt.default__get_column_names", "macro.dbt.get_select_subquery"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "temporary", "type": null, "description": ""}, {"name": "relation", "type": null, "description": ""}, {"name": "sql", "type": null, "description": ""}], "created_at": 1789422566.2792485, "supported_languages": null}, "macro.dbt_postgres.postgres__get_create_index_sql": {"name": "postgres__get_create_index_sql", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "unique_id": "macro.dbt_postgres.postgres__get_create_index_sql", "macro_sql": "{% macro postgres__get_create_index_sql(relation, index_dict) -%}\n {%- set index_config = adapter.parse_index(index_dict) -%}\n {%- set comma_separated_columns = \", \".join(index_config.columns) -%}\n {%- set index_name = index_config.render(relation) -%}\n\n create {% if index_config.unique -%}\n unique\n {%- endif %} index if not exists\n \"{{ index_name }}\"\n on {{ relation }} {% if index_config.type -%}\n using {{ index_config.type }}\n {%- endif %}\n ({{ comma_separated_columns }})\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "index_dict", "type": null, "description": ""}], "created_at": 1789422566.2803223, "supported_languages": null}, "macro.dbt_postgres.postgres__create_schema": {"name": "postgres__create_schema", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "unique_id": "macro.dbt_postgres.postgres__create_schema", "macro_sql": "{% macro postgres__create_schema(relation) -%}\n {% if relation.database -%}\n {{ adapter.verify_database(relation.database) }}\n {%- endif -%}\n {%- call statement('create_schema') -%}\n create schema if not exists {{ relation.without_identifier().include(database=False) }}\n {%- endcall -%}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789422566.2809951, "supported_languages": null}, "macro.dbt_postgres.postgres__drop_schema": {"name": "postgres__drop_schema", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "unique_id": "macro.dbt_postgres.postgres__drop_schema", "macro_sql": "{% macro postgres__drop_schema(relation) -%}\n {% if relation.database -%}\n {{ adapter.verify_database(relation.database) }}\n {%- endif -%}\n {%- call statement('drop_schema') -%}\n drop schema if exists {{ relation.without_identifier().include(database=False) }} cascade\n {%- endcall -%}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789422566.2816875, "supported_languages": null}, "macro.dbt_postgres.postgres__get_columns_in_relation": {"name": "postgres__get_columns_in_relation", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "unique_id": "macro.dbt_postgres.postgres__get_columns_in_relation", "macro_sql": "{% macro postgres__get_columns_in_relation(relation) -%}\n {% call statement('get_columns_in_relation', fetch_result=True) %}\n select\n column_name,\n data_type,\n character_maximum_length,\n numeric_precision,\n numeric_scale\n\n from {{ relation.information_schema('columns') }}\n where table_name = '{{ relation.identifier }}'\n {% if relation.schema %}\n and table_schema = '{{ relation.schema }}'\n {% endif %}\n order by ordinal_position\n\n {% endcall %}\n {% set table = load_result('get_columns_in_relation').table %}\n {{ return(sql_convert_columns_in_relation(table)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement", "macro.dbt.sql_convert_columns_in_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789422566.282788, "supported_languages": null}, "macro.dbt_postgres.postgres__list_relations_without_caching": {"name": "postgres__list_relations_without_caching", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "unique_id": "macro.dbt_postgres.postgres__list_relations_without_caching", "macro_sql": "{% macro postgres__list_relations_without_caching(schema_relation) %}\n {% call statement('list_relations_without_caching', fetch_result=True) -%}\n select\n '{{ schema_relation.database }}' as database,\n tablename as name,\n schemaname as schema,\n 'table' as type\n from pg_tables\n where schemaname ilike '{{ schema_relation.schema }}'\n union all\n select\n '{{ schema_relation.database }}' as database,\n viewname as name,\n schemaname as schema,\n 'view' as type\n from pg_views\n where schemaname ilike '{{ schema_relation.schema }}'\n union all\n select\n '{{ schema_relation.database }}' as database,\n matviewname as name,\n schemaname as schema,\n 'materialized_view' as type\n from pg_matviews\n where schemaname ilike '{{ schema_relation.schema }}'\n union all\n select distinct\n '{{ schema_relation.database }}' as database,\n proname as name,\n ns.nspname as schema,\n 'function' as type\n from pg_proc\n join pg_namespace as ns on pronamespace = ns.oid\n where ns.nspname ilike '{{ schema_relation.schema }}'\n {% endcall %}\n {{ return(load_result('list_relations_without_caching').table) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "schema_relation", "type": null, "description": ""}], "created_at": 1789422566.2839053, "supported_languages": null}, "macro.dbt_postgres.postgres__information_schema_name": {"name": "postgres__information_schema_name", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "unique_id": "macro.dbt_postgres.postgres__information_schema_name", "macro_sql": "{% macro postgres__information_schema_name(database) -%}\n {% if database_name -%}\n {{ adapter.verify_database(database_name) }}\n {%- endif -%}\n information_schema\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "database", "type": null, "description": ""}], "created_at": 1789422566.2842984, "supported_languages": null}, "macro.dbt_postgres.postgres__list_schemas": {"name": "postgres__list_schemas", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "unique_id": "macro.dbt_postgres.postgres__list_schemas", "macro_sql": "{% macro postgres__list_schemas(database) %}\n {% if database -%}\n {{ adapter.verify_database(database) }}\n {%- endif -%}\n {% call statement('list_schemas', fetch_result=True, auto_begin=False) %}\n select distinct nspname from pg_namespace\n {% endcall %}\n {{ return(load_result('list_schemas').table) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "database", "type": null, "description": ""}], "created_at": 1789422566.2851322, "supported_languages": null}, "macro.dbt_postgres.postgres__check_schema_exists": {"name": "postgres__check_schema_exists", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "unique_id": "macro.dbt_postgres.postgres__check_schema_exists", "macro_sql": "{% macro postgres__check_schema_exists(information_schema, schema) -%}\n {% if information_schema.database -%}\n {{ adapter.verify_database(information_schema.database) }}\n {%- endif -%}\n {% call statement('check_schema_exists', fetch_result=True, auto_begin=False) %}\n select count(*) from pg_namespace where nspname = '{{ schema }}'\n {% endcall %}\n {{ return(load_result('check_schema_exists').table) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "information_schema", "type": null, "description": ""}, {"name": "schema", "type": null, "description": ""}], "created_at": 1789422566.2859566, "supported_languages": null}, "macro.dbt_postgres.postgres__make_relation_with_suffix": {"name": "postgres__make_relation_with_suffix", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "unique_id": "macro.dbt_postgres.postgres__make_relation_with_suffix", "macro_sql": "{% macro postgres__make_relation_with_suffix(base_relation, suffix, dstring) %}\n {% if dstring %}\n {% set dt = modules.datetime.datetime.now() %}\n {% set dtstring = dt.strftime(\"%H%M%S%f\") %}\n {% set suffix = suffix ~ dtstring %}\n {% endif %}\n {% set suffix_length = suffix|length %}\n {% set relation_max_name_length = base_relation.relation_max_name_length() %}\n {% if suffix_length > relation_max_name_length %}\n {% do exceptions.raise_compiler_error('Relation suffix is too long (' ~ suffix_length ~ ' characters). Maximum length is ' ~ relation_max_name_length ~ ' characters.') %}\n {% endif %}\n {% set identifier = base_relation.identifier[:relation_max_name_length - suffix_length] ~ suffix %}\n\n {{ return(base_relation.incorporate(path={\"identifier\": identifier })) }}\n\n {% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "base_relation", "type": null, "description": ""}, {"name": "suffix", "type": null, "description": ""}, {"name": "dstring", "type": null, "description": ""}], "created_at": 1789422566.287879, "supported_languages": null}, "macro.dbt_postgres.postgres__make_intermediate_relation": {"name": "postgres__make_intermediate_relation", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "unique_id": "macro.dbt_postgres.postgres__make_intermediate_relation", "macro_sql": "{% macro postgres__make_intermediate_relation(base_relation, suffix) %}\n {{ return(postgres__make_relation_with_suffix(base_relation, suffix, dstring=False)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__make_relation_with_suffix"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "base_relation", "type": null, "description": ""}, {"name": "suffix", "type": null, "description": ""}], "created_at": 1789422566.2882876, "supported_languages": null}, "macro.dbt_postgres.postgres__make_temp_relation": {"name": "postgres__make_temp_relation", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "unique_id": "macro.dbt_postgres.postgres__make_temp_relation", "macro_sql": "{% macro postgres__make_temp_relation(base_relation, suffix) %}\n {% set temp_relation = postgres__make_relation_with_suffix(base_relation, suffix, dstring=True) %}\n {{ return(temp_relation.incorporate(path={\"schema\": none,\n \"database\": none})) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__make_relation_with_suffix"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "base_relation", "type": null, "description": ""}, {"name": "suffix", "type": null, "description": ""}], "created_at": 1789422566.2889562, "supported_languages": null}, "macro.dbt_postgres.postgres__make_backup_relation": {"name": "postgres__make_backup_relation", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "unique_id": "macro.dbt_postgres.postgres__make_backup_relation", "macro_sql": "{% macro postgres__make_backup_relation(base_relation, backup_relation_type, suffix) %}\n {% set backup_relation = postgres__make_relation_with_suffix(base_relation, suffix, dstring=False) %}\n {{ return(backup_relation.incorporate(type=backup_relation_type)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__make_relation_with_suffix"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "base_relation", "type": null, "description": ""}, {"name": "backup_relation_type", "type": null, "description": ""}, {"name": "suffix", "type": null, "description": ""}], "created_at": 1789422566.2894948, "supported_languages": null}, "macro.dbt_postgres.postgres_escape_comment": {"name": "postgres_escape_comment", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "unique_id": "macro.dbt_postgres.postgres_escape_comment", "macro_sql": "{% macro postgres_escape_comment(comment) -%}\n {% if comment is not string %}\n {% do exceptions.raise_compiler_error('cannot escape a non-string: ' ~ comment) %}\n {% endif %}\n {%- set magic = '$dbt_comment_literal_block$' -%}\n {%- if magic in comment -%}\n {%- do exceptions.raise_compiler_error('The string ' ~ magic ~ ' is not allowed in comments.') -%}\n {%- endif -%}\n {{ magic }}{{ comment }}{{ magic }}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "comment", "type": null, "description": ""}], "created_at": 1789422566.2904072, "supported_languages": null}, "macro.dbt_postgres.postgres__alter_relation_comment": {"name": "postgres__alter_relation_comment", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "unique_id": "macro.dbt_postgres.postgres__alter_relation_comment", "macro_sql": "{% macro postgres__alter_relation_comment(relation, comment) %}\n {% set escaped_comment = postgres_escape_comment(comment) %}\n {% if relation.type == 'materialized_view' -%}\n {% set relation_type = \"materialized view\" %}\n {%- else -%}\n {%- set relation_type = relation.type -%}\n {%- endif -%}\n comment on {{ relation_type }} {{ relation }} is {{ escaped_comment }};\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres_escape_comment"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "comment", "type": null, "description": ""}], "created_at": 1789422566.291243, "supported_languages": null}, "macro.dbt_postgres.postgres__alter_column_comment": {"name": "postgres__alter_column_comment", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "unique_id": "macro.dbt_postgres.postgres__alter_column_comment", "macro_sql": "{% macro postgres__alter_column_comment(relation, column_dict) %}\n {% set existing_columns = adapter.get_columns_in_relation(relation) | map(attribute=\"name\") | list %}\n {% for column_name in column_dict if (column_name in existing_columns) %}\n {% set comment = column_dict[column_name]['description'] %}\n {% set escaped_comment = postgres_escape_comment(comment) %}\n comment on column {{ relation }}.{{ adapter.quote(column_name) if column_dict[column_name]['quote'] else column_name }} is {{ escaped_comment }};\n {% endfor %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres_escape_comment"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "column_dict", "type": null, "description": ""}], "created_at": 1789422566.292459, "supported_languages": null}, "macro.dbt_postgres.postgres__get_show_grant_sql": {"name": "postgres__get_show_grant_sql", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "unique_id": "macro.dbt_postgres.postgres__get_show_grant_sql", "macro_sql": "\n\n{%- macro postgres__get_show_grant_sql(relation) -%}\n select grantee, privilege_type\n from {{ relation.information_schema('role_table_grants') }}\n where grantor = current_role\n and grantee != current_role\n and table_schema = '{{ relation.schema }}'\n and table_name = '{{ relation.identifier }}'\n{%- endmacro -%}\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789422566.2929168, "supported_languages": null}, "macro.dbt_postgres.postgres__copy_grants": {"name": "postgres__copy_grants", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "unique_id": "macro.dbt_postgres.postgres__copy_grants", "macro_sql": "{% macro postgres__copy_grants() %}\n {{ return(False) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789422566.2931628, "supported_languages": null}, "macro.dbt_postgres.postgres__get_show_indexes_sql": {"name": "postgres__get_show_indexes_sql", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "unique_id": "macro.dbt_postgres.postgres__get_show_indexes_sql", "macro_sql": "{% macro postgres__get_show_indexes_sql(relation) %}\n select\n i.relname as name,\n m.amname as method,\n ix.indisunique as \"unique\",\n array_to_string(array_agg(a.attname), ',') as column_names\n from pg_index ix\n join pg_class i\n on i.oid = ix.indexrelid\n join pg_am m\n on m.oid=i.relam\n join pg_class t\n on t.oid = ix.indrelid\n join pg_namespace n\n on n.oid = t.relnamespace\n join pg_attribute a\n on a.attrelid = t.oid\n and a.attnum = ANY(ix.indkey)\n where t.relname = '{{ relation.identifier }}'\n and n.nspname = '{{ relation.schema }}'\n and t.relkind in ('r', 'm')\n group by 1, 2, 3\n order by 1, 2, 3\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789422566.293506, "supported_languages": null}, "macro.dbt_postgres.postgres__get_drop_index_sql": {"name": "postgres__get_drop_index_sql", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "unique_id": "macro.dbt_postgres.postgres__get_drop_index_sql", "macro_sql": "\n\n\n{%- macro postgres__get_drop_index_sql(relation, index_name) -%}\n drop index if exists \"{{ relation.schema }}\".\"{{ index_name }}\"\n{%- endmacro -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "index_name", "type": null, "description": ""}], "created_at": 1789422566.2938256, "supported_languages": null}, "macro.dbt_postgres.postgres__get_create_materialized_view_as_sql": {"name": "postgres__get_create_materialized_view_as_sql", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/relations/materialized_view/create.sql", "original_file_path": "macros/relations/materialized_view/create.sql", "unique_id": "macro.dbt_postgres.postgres__get_create_materialized_view_as_sql", "macro_sql": "{% macro postgres__get_create_materialized_view_as_sql(relation, sql) %}\n create materialized view if not exists {{ relation }} as {{ sql }};\n\n {% for _index_dict in config.get('indexes', []) -%}\n {{- get_create_index_sql(relation, _index_dict) -}}{{ ';' if not loop.last else \"\" }}\n {%- endfor -%}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_create_index_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "sql", "type": null, "description": ""}], "created_at": 1789422566.294824, "supported_languages": null}, "macro.dbt_postgres.postgres__get_alter_materialized_view_as_sql": {"name": "postgres__get_alter_materialized_view_as_sql", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/relations/materialized_view/alter.sql", "original_file_path": "macros/relations/materialized_view/alter.sql", "unique_id": "macro.dbt_postgres.postgres__get_alter_materialized_view_as_sql", "macro_sql": "{% macro postgres__get_alter_materialized_view_as_sql(\n relation,\n configuration_changes,\n sql,\n existing_relation,\n backup_relation,\n intermediate_relation\n) %}\n\n -- apply a full refresh immediately if needed\n {% if configuration_changes.requires_full_refresh %}\n\n {{ get_replace_sql(existing_relation, relation, sql) }}\n\n -- otherwise apply individual changes as needed\n {% else %}\n\n {{ postgres__update_indexes_on_materialized_view(relation, configuration_changes.indexes) }}\n\n {%- endif -%}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_replace_sql", "macro.dbt_postgres.postgres__update_indexes_on_materialized_view"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "configuration_changes", "type": null, "description": ""}, {"name": "sql", "type": null, "description": ""}, {"name": "existing_relation", "type": null, "description": ""}, {"name": "backup_relation", "type": null, "description": ""}, {"name": "intermediate_relation", "type": null, "description": ""}], "created_at": 1789422566.2959797, "supported_languages": null}, "macro.dbt_postgres.postgres__update_indexes_on_materialized_view": {"name": "postgres__update_indexes_on_materialized_view", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/relations/materialized_view/alter.sql", "original_file_path": "macros/relations/materialized_view/alter.sql", "unique_id": "macro.dbt_postgres.postgres__update_indexes_on_materialized_view", "macro_sql": "\n\n\n{%- macro postgres__update_indexes_on_materialized_view(relation, index_changes) -%}\n {{- log(\"Applying UPDATE INDEXES to: \" ~ relation) -}}\n\n {%- for _index_change in index_changes -%}\n {%- set _index = _index_change.context -%}\n\n {%- if _index_change.action == \"drop\" -%}\n\n {{ postgres__get_drop_index_sql(relation, _index.name) }}\n\n {%- elif _index_change.action == \"create\" -%}\n\n {{ postgres__get_create_index_sql(relation, _index.as_node_config) }}\n\n {%- endif -%}\n\t{{ ';' if not loop.last else \"\" }}\n\n {%- endfor -%}\n\n{%- endmacro -%}\n\n\n", "depends_on": {"macros": ["macro.dbt_postgres.postgres__get_drop_index_sql", "macro.dbt_postgres.postgres__get_create_index_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "index_changes", "type": null, "description": ""}], "created_at": 1789422566.2971077, "supported_languages": null}, "macro.dbt_postgres.postgres__get_materialized_view_configuration_changes": {"name": "postgres__get_materialized_view_configuration_changes", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/relations/materialized_view/alter.sql", "original_file_path": "macros/relations/materialized_view/alter.sql", "unique_id": "macro.dbt_postgres.postgres__get_materialized_view_configuration_changes", "macro_sql": "{% macro postgres__get_materialized_view_configuration_changes(existing_relation, new_config) %}\n {% set _existing_materialized_view = postgres__describe_materialized_view(existing_relation) %}\n {% set _configuration_changes = existing_relation.get_materialized_view_config_change_collection(_existing_materialized_view, new_config.model) %}\n {% do return(_configuration_changes) %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__describe_materialized_view"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "existing_relation", "type": null, "description": ""}, {"name": "new_config", "type": null, "description": ""}], "created_at": 1789422566.2977424, "supported_languages": null}, "macro.dbt_postgres.postgres__get_rename_materialized_view_sql": {"name": "postgres__get_rename_materialized_view_sql", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/relations/materialized_view/rename.sql", "original_file_path": "macros/relations/materialized_view/rename.sql", "unique_id": "macro.dbt_postgres.postgres__get_rename_materialized_view_sql", "macro_sql": "{% macro postgres__get_rename_materialized_view_sql(relation, new_name) %}\n alter materialized view {{ relation }} rename to {{ new_name }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "new_name", "type": null, "description": ""}], "created_at": 1789422566.298205, "supported_languages": null}, "macro.dbt_postgres.postgres__refresh_materialized_view": {"name": "postgres__refresh_materialized_view", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/relations/materialized_view/refresh.sql", "original_file_path": "macros/relations/materialized_view/refresh.sql", "unique_id": "macro.dbt_postgres.postgres__refresh_materialized_view", "macro_sql": "{% macro postgres__refresh_materialized_view(relation) %}\n refresh materialized view {{ relation }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789422566.2985184, "supported_languages": null}, "macro.dbt_postgres.postgres__drop_materialized_view": {"name": "postgres__drop_materialized_view", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/relations/materialized_view/drop.sql", "original_file_path": "macros/relations/materialized_view/drop.sql", "unique_id": "macro.dbt_postgres.postgres__drop_materialized_view", "macro_sql": "{% macro postgres__drop_materialized_view(relation) -%}\n drop materialized view if exists {{ relation }} cascade\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789422566.2988834, "supported_languages": null}, "macro.dbt_postgres.postgres__describe_materialized_view": {"name": "postgres__describe_materialized_view", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/relations/materialized_view/describe.sql", "original_file_path": "macros/relations/materialized_view/describe.sql", "unique_id": "macro.dbt_postgres.postgres__describe_materialized_view", "macro_sql": "{% macro postgres__describe_materialized_view(relation) %}\n -- for now just get the indexes, we don't need the name or the query yet\n {% set _indexes = run_query(get_show_indexes_sql(relation)) %}\n {% do return({'indexes': _indexes}) %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.run_query", "macro.dbt.get_show_indexes_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789422566.2996848, "supported_languages": null}, "macro.dbt_postgres.postgres__get_rename_view_sql": {"name": "postgres__get_rename_view_sql", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/relations/view/rename.sql", "original_file_path": "macros/relations/view/rename.sql", "unique_id": "macro.dbt_postgres.postgres__get_rename_view_sql", "macro_sql": "{% macro postgres__get_rename_view_sql(relation, new_name) %}\n alter view {{ relation }} rename to {{ new_name }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "new_name", "type": null, "description": ""}], "created_at": 1789422566.3001013, "supported_languages": null}, "macro.dbt_postgres.postgres__drop_view": {"name": "postgres__drop_view", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/relations/view/drop.sql", "original_file_path": "macros/relations/view/drop.sql", "unique_id": "macro.dbt_postgres.postgres__drop_view", "macro_sql": "{% macro postgres__drop_view(relation) -%}\n drop view if exists {{ relation }} cascade\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789422566.3003917, "supported_languages": null}, "macro.dbt_postgres.postgres__get_replace_view_sql": {"name": "postgres__get_replace_view_sql", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/relations/view/replace.sql", "original_file_path": "macros/relations/view/replace.sql", "unique_id": "macro.dbt_postgres.postgres__get_replace_view_sql", "macro_sql": "{% macro postgres__get_replace_view_sql(relation, sql) -%}\n\n {%- set sql_header = config.get('sql_header', none) -%}\n {{ sql_header if sql_header is not none }}\n\n create or replace view {{ relation }}\n {% set contract_config = config.get('contract') %}\n {% if contract_config.enforced %}\n {{ get_assert_columns_equivalent(sql) }}\n {%- endif %}\n as (\n {{ sql }}\n );\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.get_assert_columns_equivalent"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "sql", "type": null, "description": ""}], "created_at": 1789422566.3014584, "supported_languages": null}, "macro.dbt_postgres.postgres__get_rename_table_sql": {"name": "postgres__get_rename_table_sql", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/relations/table/rename.sql", "original_file_path": "macros/relations/table/rename.sql", "unique_id": "macro.dbt_postgres.postgres__get_rename_table_sql", "macro_sql": "{% macro postgres__get_rename_table_sql(relation, new_name) %}\n alter table {{ relation }} rename to {{ new_name }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "new_name", "type": null, "description": ""}], "created_at": 1789422566.3018432, "supported_languages": null}, "macro.dbt_postgres.postgres__drop_table": {"name": "postgres__drop_table", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/relations/table/drop.sql", "original_file_path": "macros/relations/table/drop.sql", "unique_id": "macro.dbt_postgres.postgres__drop_table", "macro_sql": "{% macro postgres__drop_table(relation) -%}\n drop table if exists {{ relation }} cascade\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789422566.302127, "supported_languages": null}, "macro.dbt_postgres.postgres__get_replace_table_sql": {"name": "postgres__get_replace_table_sql", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/relations/table/replace.sql", "original_file_path": "macros/relations/table/replace.sql", "unique_id": "macro.dbt_postgres.postgres__get_replace_table_sql", "macro_sql": "{% macro postgres__get_replace_table_sql(relation, sql) -%}\n\n {%- set sql_header = config.get('sql_header', none) -%}\n {{ sql_header if sql_header is not none }}\n\n create or replace table {{ relation }}\n {% set contract_config = config.get('contract') %}\n {% if contract_config.enforced %}\n {{ get_assert_columns_equivalent(sql) }}\n {{ get_table_columns_and_constraints() }}\n {%- set sql = get_select_subquery(sql) %}\n {% endif %}\n as (\n {{ sql }}\n );\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.get_assert_columns_equivalent", "macro.dbt.get_table_columns_and_constraints", "macro.dbt.get_select_subquery"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "sql", "type": null, "description": ""}], "created_at": 1789422566.303377, "supported_languages": null}, "macro.dbt_postgres.postgres__get_incremental_default_sql": {"name": "postgres__get_incremental_default_sql", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/materializations/incremental_strategies.sql", "original_file_path": "macros/materializations/incremental_strategies.sql", "unique_id": "macro.dbt_postgres.postgres__get_incremental_default_sql", "macro_sql": "{% macro postgres__get_incremental_default_sql(arg_dict) %}\n\n {% if arg_dict[\"unique_key\"] %}\n {% do return(get_incremental_delete_insert_sql(arg_dict)) %}\n {% else %}\n {% do return(get_incremental_append_sql(arg_dict)) %}\n {% endif %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_incremental_delete_insert_sql", "macro.dbt.get_incremental_append_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "arg_dict", "type": null, "description": ""}], "created_at": 1789422566.3042722, "supported_languages": null}, "macro.dbt_postgres.postgres__get_incremental_microbatch_sql": {"name": "postgres__get_incremental_microbatch_sql", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/materializations/incremental_strategies.sql", "original_file_path": "macros/materializations/incremental_strategies.sql", "unique_id": "macro.dbt_postgres.postgres__get_incremental_microbatch_sql", "macro_sql": "{% macro postgres__get_incremental_microbatch_sql(arg_dict) %}\n\n {% if arg_dict[\"unique_key\"] %}\n {% do return(adapter.dispatch('get_incremental_merge_sql', 'dbt')(arg_dict)) %}\n {% else %}\n {{ exceptions.raise_compiler_error(\"dbt-postgres 'microbatch' requires a `unique_key` config\") }}\n {% endif %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_incremental_merge_sql", "macro.dbt.default__get_incremental_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "arg_dict", "type": null, "description": ""}], "created_at": 1789422566.3049467, "supported_languages": null}, "macro.dbt_postgres.postgres__snapshot_merge_sql": {"name": "postgres__snapshot_merge_sql", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/materializations/snapshot_merge.sql", "original_file_path": "macros/materializations/snapshot_merge.sql", "unique_id": "macro.dbt_postgres.postgres__snapshot_merge_sql", "macro_sql": "{% macro postgres__snapshot_merge_sql(target, source, insert_cols) -%}\n {%- set insert_cols_csv = insert_cols | join(', ') -%}\n\n {%- set columns = config.get(\"snapshot_table_column_names\") or get_snapshot_table_column_names() -%}\n\n update {{ target }}\n set {{ columns.dbt_valid_to }} = DBT_INTERNAL_SOURCE.{{ columns.dbt_valid_to }}\n from {{ source }} as DBT_INTERNAL_SOURCE\n where DBT_INTERNAL_SOURCE.{{ columns.dbt_scd_id }}::text = {{ target }}.{{ columns.dbt_scd_id }}::text\n and DBT_INTERNAL_SOURCE.dbt_change_type::text in ('update'::text, 'delete'::text)\n {% if config.get(\"dbt_valid_to_current\") %}\n and ({{ target }}.{{ columns.dbt_valid_to }} = {{ config.get('dbt_valid_to_current') }} or {{ target }}.{{ columns.dbt_valid_to }} is null);\n {% else %}\n and {{ target }}.{{ columns.dbt_valid_to }} is null;\n {% endif %}\n\n\n insert into {{ target }} ({{ insert_cols_csv }})\n select {% for column in insert_cols -%}\n DBT_INTERNAL_SOURCE.{{ column }} {%- if not loop.last %}, {%- endif %}\n {%- endfor %}\n from {{ source }} as DBT_INTERNAL_SOURCE\n where DBT_INTERNAL_SOURCE.dbt_change_type::text = 'insert'::text;\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_snapshot_table_column_names"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "target", "type": null, "description": ""}, {"name": "source", "type": null, "description": ""}, {"name": "insert_cols", "type": null, "description": ""}], "created_at": 1789422566.3071961, "supported_languages": null}, "macro.dbt_postgres.postgres__formatted_scalar_function_args_sql": {"name": "postgres__formatted_scalar_function_args_sql", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/materializations/functions/scalar.sql", "original_file_path": "macros/materializations/functions/scalar.sql", "unique_id": "macro.dbt_postgres.postgres__formatted_scalar_function_args_sql", "macro_sql": "{% macro postgres__formatted_scalar_function_args_sql() %}\n {% set args = [] %}\n {% for arg in model.arguments -%}\n {% set default_value = arg.get('default_value', none) %}\n {% if default_value != none %}\n {%- do args.append(arg.name ~ ' ' ~ arg.data_type ~ ' DEFAULT ' ~ default_value) -%}\n {% else %}\n {%- do args.append(arg.name ~ ' ' ~ arg.data_type) -%}\n {% endif %}\n {%- endfor %}\n {{ args | join(', ') }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789422566.308627, "supported_languages": null}, "macro.dbt_postgres.postgres__last_day": {"name": "postgres__last_day", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/utils/last_day.sql", "original_file_path": "macros/utils/last_day.sql", "unique_id": "macro.dbt_postgres.postgres__last_day", "macro_sql": "{% macro postgres__last_day(date, datepart) -%}\n\n {%- if datepart == 'quarter' -%}\n -- postgres dateadd does not support quarter interval.\n cast(\n {{dbt.dateadd('day', '-1',\n dbt.dateadd('month', '3', dbt.date_trunc(datepart, date))\n )}}\n as date)\n {%- else -%}\n {{dbt.default_last_day(date, datepart)}}\n {%- endif -%}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.dateadd", "macro.dbt.date_trunc", "macro.dbt.default_last_day"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "date", "type": null, "description": ""}, {"name": "datepart", "type": null, "description": ""}], "created_at": 1789422566.3096073, "supported_languages": null}, "macro.dbt_postgres.postgres__listagg": {"name": "postgres__listagg", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/utils/listagg.sql", "original_file_path": "macros/utils/listagg.sql", "unique_id": "macro.dbt_postgres.postgres__listagg", "macro_sql": "{% macro postgres__listagg(measure, delimiter_text, order_by_clause, limit_num) -%}\n\n {% if limit_num -%}\n array_to_string(\n (array_agg(\n {{ measure }}\n {% if order_by_clause -%}\n {{ order_by_clause }}\n {%- endif %}\n ))[1:{{ limit_num }}],\n {{ delimiter_text }}\n )\n {%- else %}\n string_agg(\n {{ measure }},\n {{ delimiter_text }}\n {% if order_by_clause -%}\n {{ order_by_clause }}\n {%- endif %}\n )\n {%- endif %}\n\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "measure", "type": null, "description": ""}, {"name": "delimiter_text", "type": null, "description": ""}, {"name": "order_by_clause", "type": null, "description": ""}, {"name": "limit_num", "type": null, "description": ""}], "created_at": 1789422566.310663, "supported_languages": null}, "macro.dbt_postgres.postgres__any_value": {"name": "postgres__any_value", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/utils/any_value.sql", "original_file_path": "macros/utils/any_value.sql", "unique_id": "macro.dbt_postgres.postgres__any_value", "macro_sql": "{% macro postgres__any_value(expression) -%}\n\n min({{ expression }})\n\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "expression", "type": null, "description": ""}], "created_at": 1789422566.3109703, "supported_languages": null}, "macro.dbt_postgres.postgres__datediff": {"name": "postgres__datediff", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/utils/datediff.sql", "original_file_path": "macros/utils/datediff.sql", "unique_id": "macro.dbt_postgres.postgres__datediff", "macro_sql": "{% macro postgres__datediff(first_date, second_date, datepart) -%}\n\n {% if datepart == 'year' %}\n (date_part('year', ({{second_date}})::date) - date_part('year', ({{first_date}})::date))\n {% elif datepart == 'quarter' %}\n ({{ datediff(first_date, second_date, 'year') }} * 4 + date_part('quarter', ({{second_date}})::date) - date_part('quarter', ({{first_date}})::date))\n {% elif datepart == 'month' %}\n ({{ datediff(first_date, second_date, 'year') }} * 12 + date_part('month', ({{second_date}})::date) - date_part('month', ({{first_date}})::date))\n {% elif datepart == 'day' %}\n (({{second_date}})::date - ({{first_date}})::date)\n {% elif datepart == 'week' %}\n ({{ datediff(first_date, second_date, 'day') }} / 7 + case\n when date_part('dow', ({{first_date}})::timestamp) <= date_part('dow', ({{second_date}})::timestamp) then\n case when {{first_date}} <= {{second_date}} then 0 else -1 end\n else\n case when {{first_date}} <= {{second_date}} then 1 else 0 end\n end)\n {% elif datepart == 'hour' %}\n ({{ datediff(first_date, second_date, 'day') }} * 24 + date_part('hour', ({{second_date}})::timestamp) - date_part('hour', ({{first_date}})::timestamp))\n {% elif datepart == 'minute' %}\n ({{ datediff(first_date, second_date, 'hour') }} * 60 + date_part('minute', ({{second_date}})::timestamp) - date_part('minute', ({{first_date}})::timestamp))\n {% elif datepart == 'second' %}\n ({{ datediff(first_date, second_date, 'minute') }} * 60 + floor(date_part('second', ({{second_date}})::timestamp)) - floor(date_part('second', ({{first_date}})::timestamp)))\n {% elif datepart == 'millisecond' %}\n ({{ datediff(first_date, second_date, 'minute') }} * 60000 + floor(date_part('millisecond', ({{second_date}})::timestamp)) - floor(date_part('millisecond', ({{first_date}})::timestamp)))\n {% elif datepart == 'microsecond' %}\n ({{ datediff(first_date, second_date, 'minute') }} * 60000000 + floor(date_part('microsecond', ({{second_date}})::timestamp)) - floor(date_part('microsecond', ({{first_date}})::timestamp)))\n {% else %}\n {{ exceptions.raise_compiler_error(\"Unsupported datepart for macro datediff in postgres: {!r}\".format(datepart)) }}\n {% endif %}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.datediff"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "first_date", "type": null, "description": ""}, {"name": "second_date", "type": null, "description": ""}, {"name": "datepart", "type": null, "description": ""}], "created_at": 1789422566.3151038, "supported_languages": null}, "macro.dbt_postgres.postgres__equals": {"name": "postgres__equals", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/utils/equals.sql", "original_file_path": "macros/utils/equals.sql", "unique_id": "macro.dbt_postgres.postgres__equals", "macro_sql": "{% macro postgres__equals(expr1, expr2) -%}\n{%- if adapter.behavior.enable_truthy_nulls_equals_macro.no_warn %}\n ({{ expr1 }} IS NOT DISTINCT FROM {{ expr2 }})\n{%- else -%}\n ({{ expr1 }} = {{ expr2 }})\n{%- endif %}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "expr1", "type": null, "description": ""}, {"name": "expr2", "type": null, "description": ""}], "created_at": 1789422566.315845, "supported_languages": null}, "macro.dbt_postgres.postgres__dateadd": {"name": "postgres__dateadd", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/utils/dateadd.sql", "original_file_path": "macros/utils/dateadd.sql", "unique_id": "macro.dbt_postgres.postgres__dateadd", "macro_sql": "{% macro postgres__dateadd(datepart, interval, from_date_or_timestamp) %}\n\n {{ from_date_or_timestamp }} + ((interval '1 {{ datepart }}') * ({{ interval }}))\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "datepart", "type": null, "description": ""}, {"name": "interval", "type": null, "description": ""}, {"name": "from_date_or_timestamp", "type": null, "description": ""}], "created_at": 1789422566.3163226, "supported_languages": null}, "macro.dbt_postgres.postgres__split_part": {"name": "postgres__split_part", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/utils/split_part.sql", "original_file_path": "macros/utils/split_part.sql", "unique_id": "macro.dbt_postgres.postgres__split_part", "macro_sql": "{% macro postgres__split_part(string_text, delimiter_text, part_number) %}\n\n {% if part_number >= 0 %}\n {{ dbt.default__split_part(string_text, delimiter_text, part_number) }}\n {% else %}\n {{ dbt._split_part_negative(string_text, delimiter_text, part_number) }}\n {% endif %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__split_part", "macro.dbt._split_part_negative"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "string_text", "type": null, "description": ""}, {"name": "delimiter_text", "type": null, "description": ""}, {"name": "part_number", "type": null, "description": ""}], "created_at": 1789422566.3171492, "supported_languages": null}, "macro.dbt.get_fixture_sql": {"name": "get_fixture_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/unit_test_sql/get_fixture_sql.sql", "original_file_path": "macros/unit_test_sql/get_fixture_sql.sql", "unique_id": "macro.dbt.get_fixture_sql", "macro_sql": "{% macro get_fixture_sql(rows, column_name_to_data_types) %}\n-- Fixture for {{ model.name }}\n{% set default_row = {} %}\n\n{%- if not column_name_to_data_types -%}\n{#-- Use defer_relation IFF it is available in the manifest and 'this' is missing from the database --#}\n{%- set this_or_defer_relation = defer_relation if (defer_relation and not load_relation(this)) else this -%}\n{%- set columns_in_relation = adapter.get_columns_in_relation(this_or_defer_relation) -%}\n\n{%- set column_name_to_data_types = {} -%}\n{%- set column_name_to_quoted = {} -%}\n{%- for column in columns_in_relation -%}\n\n{#-- This needs to be a case-insensitive comparison --#}\n{%- do column_name_to_data_types.update({column.name|lower: column.data_type}) -%}\n{%- do column_name_to_quoted.update({column.name|lower: column.quoted}) -%}\n{%- endfor -%}\n{%- endif -%}\n\n{%- if not column_name_to_data_types -%}\n {{ exceptions.raise_compiler_error(\"Not able to get columns for unit test '\" ~ model.name ~ \"' from relation \" ~ this ~ \" because the relation doesn't exist\") }}\n{%- endif -%}\n\n{%- for column_name, column_type in column_name_to_data_types.items() -%}\n {%- do default_row.update({column_name: (safe_cast(\"null\", column_type) | trim )}) -%}\n{%- endfor -%}\n\n{{ validate_fixture_rows(rows, row_number) }}\n\n{%- for row in rows -%}\n{%- set formatted_row = format_row(row, column_name_to_data_types) -%}\n{%- set default_row_copy = default_row.copy() -%}\n{%- do default_row_copy.update(formatted_row) -%}\nselect\n{%- for column_name, column_value in default_row_copy.items() %} {{ column_value }} as {{ column_name_to_quoted[column_name] }}{% if not loop.last -%}, {%- endif %}\n{%- endfor %}\n{%- if not loop.last %}\nunion all\n{% endif %}\n{%- endfor -%}\n\n{%- if (rows | length) == 0 -%}\n select\n {%- for column_name, column_value in default_row.items() %} {{ column_value }} as {{ column_name_to_quoted[column_name] }}{% if not loop.last -%},{%- endif %}\n {%- endfor %}\n limit 0\n{%- endif -%}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.load_relation", "macro.dbt.safe_cast", "macro.dbt.validate_fixture_rows", "macro.dbt.format_row"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "rows", "type": null, "description": ""}, {"name": "column_name_to_data_types", "type": null, "description": ""}], "created_at": 1789422566.3225598, "supported_languages": null}, "macro.dbt.get_expected_sql": {"name": "get_expected_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/unit_test_sql/get_fixture_sql.sql", "original_file_path": "macros/unit_test_sql/get_fixture_sql.sql", "unique_id": "macro.dbt.get_expected_sql", "macro_sql": "{% macro get_expected_sql(rows, column_name_to_data_types, column_name_to_quoted) %}\n\n{%- if (rows | length) == 0 -%}\n select * from dbt_internal_unit_test_actual\n limit 0\n{%- else -%}\n{%- for row in rows -%}\n{%- set formatted_row = format_row(row, column_name_to_data_types) -%}\nselect\n{%- for column_name, column_value in formatted_row.items() %} {{ column_value }} as {{ column_name_to_quoted[column_name] }}{% if not loop.last -%}, {%- endif %}\n{%- endfor %}\n{%- if not loop.last %}\nunion all\n{% endif %}\n{%- endfor -%}\n{%- endif -%}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.format_row"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "rows", "type": null, "description": ""}, {"name": "column_name_to_data_types", "type": null, "description": ""}, {"name": "column_name_to_quoted", "type": null, "description": ""}], "created_at": 1789422566.3242898, "supported_languages": null}, "macro.dbt.format_row": {"name": "format_row", "resource_type": "macro", "package_name": "dbt", "path": "macros/unit_test_sql/get_fixture_sql.sql", "original_file_path": "macros/unit_test_sql/get_fixture_sql.sql", "unique_id": "macro.dbt.format_row", "macro_sql": "\n\n{%- macro format_row(row, column_name_to_data_types) -%}\n {#-- generate case-insensitive formatted row --#}\n {% set formatted_row = {} %}\n {%- for column_name, column_value in row.items() -%}\n {% set column_name = column_name|lower %}\n\n {%- if column_name not in column_name_to_data_types %}\n {#-- if user-provided row contains column name that relation does not contain, raise an error --#}\n {% set fixture_name = \"expected output\" if model.resource_type == 'unit_test' else (\"'\" ~ model.name ~ \"'\") %}\n {{ exceptions.raise_compiler_error(\n \"Invalid column name: '\" ~ column_name ~ \"' in unit test fixture for \" ~ fixture_name ~ \".\"\n \"\\nAccepted columns for \" ~ fixture_name ~ \" are: \" ~ (column_name_to_data_types.keys()|list)\n ) }}\n {%- endif -%}\n\n {%- set column_type = column_name_to_data_types[column_name] %}\n\n {#-- For string fixture values, strip varchar length to prevent silent truncation (GH-11974) --#}\n {%- if column_value is string and 'varying' in column_type -%}\n {%- set column_type = column_type.split('(')[0] -%}\n {%- endif -%}\n\n {#-- sanitize column_value: wrap yaml strings in quotes, apply cast --#}\n {%- set column_value_clean = column_value -%}\n {%- if column_value is string -%}\n {%- set column_value_clean = dbt.string_literal(dbt.escape_single_quotes(column_value)) -%}\n {%- elif column_value is none -%}\n {%- set column_value_clean = 'null' -%}\n {%- endif -%}\n\n {%- set row_update = {column_name: safe_cast(column_value_clean, column_type) } -%}\n {%- do formatted_row.update(row_update) -%}\n {%- endfor -%}\n {{ return(formatted_row) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt.string_literal", "macro.dbt.escape_single_quotes", "macro.dbt.safe_cast"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "row", "type": null, "description": ""}, {"name": "column_name_to_data_types", "type": null, "description": ""}], "created_at": 1789422566.3269722, "supported_languages": null}, "macro.dbt.validate_fixture_rows": {"name": "validate_fixture_rows", "resource_type": "macro", "package_name": "dbt", "path": "macros/unit_test_sql/get_fixture_sql.sql", "original_file_path": "macros/unit_test_sql/get_fixture_sql.sql", "unique_id": "macro.dbt.validate_fixture_rows", "macro_sql": "{%- macro validate_fixture_rows(rows, row_number) -%}\n {{ return(adapter.dispatch('validate_fixture_rows', 'dbt')(rows, row_number)) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt.default__validate_fixture_rows"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "rows", "type": null, "description": ""}, {"name": "row_number", "type": null, "description": ""}], "created_at": 1789422566.3274496, "supported_languages": null}, "macro.dbt.default__validate_fixture_rows": {"name": "default__validate_fixture_rows", "resource_type": "macro", "package_name": "dbt", "path": "macros/unit_test_sql/get_fixture_sql.sql", "original_file_path": "macros/unit_test_sql/get_fixture_sql.sql", "unique_id": "macro.dbt.default__validate_fixture_rows", "macro_sql": "{%- macro default__validate_fixture_rows(rows, row_number) -%}\n {# This is an abstract method for adapter overrides as needed #}\n{%- endmacro -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "rows", "type": null, "description": ""}, {"name": "row_number", "type": null, "description": ""}], "created_at": 1789422566.3276994, "supported_languages": null}, "macro.dbt.get_create_sql": {"name": "get_create_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/create.sql", "original_file_path": "macros/relations/create.sql", "unique_id": "macro.dbt.get_create_sql", "macro_sql": "{%- macro get_create_sql(relation, sql) -%}\n {{- log('Applying CREATE to: ' ~ relation) -}}\n {{- adapter.dispatch('get_create_sql', 'dbt')(relation, sql) -}}\n{%- endmacro -%}\n\n\n", "depends_on": {"macros": ["macro.dbt.default__get_create_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "sql", "type": null, "description": ""}], "created_at": 1789422566.3284988, "supported_languages": null}, "macro.dbt.default__get_create_sql": {"name": "default__get_create_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/create.sql", "original_file_path": "macros/relations/create.sql", "unique_id": "macro.dbt.default__get_create_sql", "macro_sql": "{%- macro default__get_create_sql(relation, sql) -%}\n\n {%- if relation.is_view -%}\n {{ get_create_view_as_sql(relation, sql) }}\n\n {%- elif relation.is_table -%}\n {{ get_create_table_as_sql(False, relation, sql) }}\n\n {%- elif relation.is_materialized_view -%}\n {{ get_create_materialized_view_as_sql(relation, sql) }}\n\n {%- else -%}\n {{- exceptions.raise_compiler_error(\"`get_create_sql` has not been implemented for: \" ~ relation.type ) -}}\n\n {%- endif -%}\n\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt.get_create_view_as_sql", "macro.dbt.get_create_table_as_sql", "macro.dbt.get_create_materialized_view_as_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "sql", "type": null, "description": ""}], "created_at": 1789422566.3294413, "supported_languages": null}, "macro.dbt.drop_schema_named": {"name": "drop_schema_named", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/schema.sql", "original_file_path": "macros/relations/schema.sql", "unique_id": "macro.dbt.drop_schema_named", "macro_sql": "{% macro drop_schema_named(schema_name) %}\n {{ return(adapter.dispatch('drop_schema_named', 'dbt') (schema_name)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__drop_schema_named"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "schema_name", "type": null, "description": ""}], "created_at": 1789422566.3300567, "supported_languages": null}, "macro.dbt.default__drop_schema_named": {"name": "default__drop_schema_named", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/schema.sql", "original_file_path": "macros/relations/schema.sql", "unique_id": "macro.dbt.default__drop_schema_named", "macro_sql": "{% macro default__drop_schema_named(schema_name) %}\n {% set schema_relation = api.Relation.create(schema=schema_name) %}\n {{ adapter.drop_schema(schema_relation) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "schema_name", "type": null, "description": ""}], "created_at": 1789422566.3304894, "supported_languages": null}, "macro.dbt.get_create_intermediate_sql": {"name": "get_create_intermediate_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/create_intermediate.sql", "original_file_path": "macros/relations/create_intermediate.sql", "unique_id": "macro.dbt.get_create_intermediate_sql", "macro_sql": "{%- macro get_create_intermediate_sql(relation, sql) -%}\n {{- log('Applying CREATE INTERMEDIATE to: ' ~ relation) -}}\n {{- adapter.dispatch('get_create_intermediate_sql', 'dbt')(relation, sql) -}}\n{%- endmacro -%}\n\n\n", "depends_on": {"macros": ["macro.dbt.default__get_create_intermediate_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "sql", "type": null, "description": ""}], "created_at": 1789422566.3311872, "supported_languages": null}, "macro.dbt.default__get_create_intermediate_sql": {"name": "default__get_create_intermediate_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/create_intermediate.sql", "original_file_path": "macros/relations/create_intermediate.sql", "unique_id": "macro.dbt.default__get_create_intermediate_sql", "macro_sql": "{%- macro default__get_create_intermediate_sql(relation, sql) -%}\n\n -- get the standard intermediate name\n {% set intermediate_relation = make_intermediate_relation(relation) %}\n\n -- drop any pre-existing intermediate\n {{ get_drop_sql(intermediate_relation) }};\n\n {{ get_create_sql(intermediate_relation, sql) }}\n\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt.make_intermediate_relation", "macro.dbt.get_drop_sql", "macro.dbt.get_create_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "sql", "type": null, "description": ""}], "created_at": 1789422566.331728, "supported_languages": null}, "macro.dbt.get_drop_backup_sql": {"name": "get_drop_backup_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/drop_backup.sql", "original_file_path": "macros/relations/drop_backup.sql", "unique_id": "macro.dbt.get_drop_backup_sql", "macro_sql": "{%- macro get_drop_backup_sql(relation) -%}\n {{- log('Applying DROP BACKUP to: ' ~ relation) -}}\n {{- adapter.dispatch('get_drop_backup_sql', 'dbt')(relation) -}}\n{%- endmacro -%}\n\n\n", "depends_on": {"macros": ["macro.dbt.default__get_drop_backup_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789422566.33233, "supported_languages": null}, "macro.dbt.default__get_drop_backup_sql": {"name": "default__get_drop_backup_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/drop_backup.sql", "original_file_path": "macros/relations/drop_backup.sql", "unique_id": "macro.dbt.default__get_drop_backup_sql", "macro_sql": "{%- macro default__get_drop_backup_sql(relation) -%}\n\n -- get the standard backup name\n {% set backup_relation = make_backup_relation(relation, relation.type) %}\n\n {{ get_drop_sql(backup_relation) }}\n\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt.make_backup_relation", "macro.dbt.get_drop_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789422566.3327804, "supported_languages": null}, "macro.dbt.get_rename_sql": {"name": "get_rename_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/rename.sql", "original_file_path": "macros/relations/rename.sql", "unique_id": "macro.dbt.get_rename_sql", "macro_sql": "{%- macro get_rename_sql(relation, new_name) -%}\n {{- log('Applying RENAME to: ' ~ relation) -}}\n {{- adapter.dispatch('get_rename_sql', 'dbt')(relation, new_name) -}}\n{%- endmacro -%}\n\n\n", "depends_on": {"macros": ["macro.dbt.default__get_rename_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "new_name", "type": null, "description": ""}], "created_at": 1789422566.333704, "supported_languages": null}, "macro.dbt.default__get_rename_sql": {"name": "default__get_rename_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/rename.sql", "original_file_path": "macros/relations/rename.sql", "unique_id": "macro.dbt.default__get_rename_sql", "macro_sql": "{%- macro default__get_rename_sql(relation, new_name) -%}\n\n {%- if relation.is_view -%}\n {{ get_rename_view_sql(relation, new_name) }}\n\n {%- elif relation.is_table -%}\n {{ get_rename_table_sql(relation, new_name) }}\n\n {%- elif relation.is_materialized_view -%}\n {{ get_rename_materialized_view_sql(relation, new_name) }}\n\n {%- else -%}\n {{- exceptions.raise_compiler_error(\"`get_rename_sql` has not been implemented for: \" ~ relation.type ) -}}\n\n {%- endif -%}\n\n{%- endmacro -%}\n\n\n", "depends_on": {"macros": ["macro.dbt.get_rename_view_sql", "macro.dbt.get_rename_table_sql", "macro.dbt.get_rename_materialized_view_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "new_name", "type": null, "description": ""}], "created_at": 1789422566.3346136, "supported_languages": null}, "macro.dbt.rename_relation": {"name": "rename_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/rename.sql", "original_file_path": "macros/relations/rename.sql", "unique_id": "macro.dbt.rename_relation", "macro_sql": "{% macro rename_relation(from_relation, to_relation) -%}\n {{ return(adapter.dispatch('rename_relation', 'dbt')(from_relation, to_relation)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__rename_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "from_relation", "type": null, "description": ""}, {"name": "to_relation", "type": null, "description": ""}], "created_at": 1789422566.335042, "supported_languages": null}, "macro.dbt.default__rename_relation": {"name": "default__rename_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/rename.sql", "original_file_path": "macros/relations/rename.sql", "unique_id": "macro.dbt.default__rename_relation", "macro_sql": "{% macro default__rename_relation(from_relation, to_relation) -%}\n {% set target_name = adapter.quote_as_configured(to_relation.identifier, 'identifier') %}\n {% call statement('rename_relation') -%}\n alter table {{ from_relation.render() }} rename to {{ target_name }}\n {%- endcall %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "from_relation", "type": null, "description": ""}, {"name": "to_relation", "type": null, "description": ""}], "created_at": 1789422566.33569, "supported_languages": null}, "macro.dbt.get_drop_sql": {"name": "get_drop_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/drop.sql", "original_file_path": "macros/relations/drop.sql", "unique_id": "macro.dbt.get_drop_sql", "macro_sql": "{%- macro get_drop_sql(relation) -%}\n {{- log('Applying DROP to: ' ~ relation) -}}\n {{- adapter.dispatch('get_drop_sql', 'dbt')(relation) -}}\n{%- endmacro -%}\n\n\n", "depends_on": {"macros": ["macro.dbt.default__get_drop_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789422566.336595, "supported_languages": null}, "macro.dbt.default__get_drop_sql": {"name": "default__get_drop_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/drop.sql", "original_file_path": "macros/relations/drop.sql", "unique_id": "macro.dbt.default__get_drop_sql", "macro_sql": "{%- macro default__get_drop_sql(relation) -%}\n\n {%- if relation.is_view -%}\n {{ drop_view(relation) }}\n\n {%- elif relation.is_table -%}\n {{ drop_table(relation) }}\n\n {%- elif relation.is_materialized_view -%}\n {{ drop_materialized_view(relation) }}\n\n {%- else -%}\n drop {{ relation.type }} if exists {{ relation.render() }} cascade\n\n {%- endif -%}\n\n{%- endmacro -%}\n\n\n", "depends_on": {"macros": ["macro.dbt.drop_view", "macro.dbt.drop_table", "macro.dbt.drop_materialized_view"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789422566.3375607, "supported_languages": null}, "macro.dbt.drop_relation": {"name": "drop_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/drop.sql", "original_file_path": "macros/relations/drop.sql", "unique_id": "macro.dbt.drop_relation", "macro_sql": "{% macro drop_relation(relation) -%}\n {{ return(adapter.dispatch('drop_relation', 'dbt')(relation)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__drop_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789422566.337949, "supported_languages": null}, "macro.dbt.default__drop_relation": {"name": "default__drop_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/drop.sql", "original_file_path": "macros/relations/drop.sql", "unique_id": "macro.dbt.default__drop_relation", "macro_sql": "{% macro default__drop_relation(relation) -%}\n {% call statement('drop_relation', auto_begin=False) -%}\n {{ get_drop_sql(relation) }}\n {%- endcall %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement", "macro.dbt.get_drop_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789422566.3383658, "supported_languages": null}, "macro.dbt.drop_relation_if_exists": {"name": "drop_relation_if_exists", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/drop.sql", "original_file_path": "macros/relations/drop.sql", "unique_id": "macro.dbt.drop_relation_if_exists", "macro_sql": "{% macro drop_relation_if_exists(relation) %}\n {% if relation is not none %}\n {{ adapter.drop_relation(relation) }}\n {% endif %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789422566.3387935, "supported_languages": null}, "macro.dbt.get_rename_intermediate_sql": {"name": "get_rename_intermediate_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/rename_intermediate.sql", "original_file_path": "macros/relations/rename_intermediate.sql", "unique_id": "macro.dbt.get_rename_intermediate_sql", "macro_sql": "{%- macro get_rename_intermediate_sql(relation) -%}\n {{- log('Applying RENAME INTERMEDIATE to: ' ~ relation) -}}\n {{- adapter.dispatch('get_rename_intermediate_sql', 'dbt')(relation) -}}\n{%- endmacro -%}\n\n\n", "depends_on": {"macros": ["macro.dbt.default__get_rename_intermediate_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789422566.3394024, "supported_languages": null}, "macro.dbt.default__get_rename_intermediate_sql": {"name": "default__get_rename_intermediate_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/rename_intermediate.sql", "original_file_path": "macros/relations/rename_intermediate.sql", "unique_id": "macro.dbt.default__get_rename_intermediate_sql", "macro_sql": "{%- macro default__get_rename_intermediate_sql(relation) -%}\n\n -- get the standard intermediate name\n {% set intermediate_relation = make_intermediate_relation(relation) %}\n\n {{ get_rename_sql(intermediate_relation, relation.identifier) }}\n\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt.make_intermediate_relation", "macro.dbt.get_rename_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789422566.3398528, "supported_languages": null}, "macro.dbt.get_replace_sql": {"name": "get_replace_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/replace.sql", "original_file_path": "macros/relations/replace.sql", "unique_id": "macro.dbt.get_replace_sql", "macro_sql": "{% macro get_replace_sql(existing_relation, target_relation, sql) %}\n {{- log('Applying REPLACE to: ' ~ existing_relation) -}}\n {{- adapter.dispatch('get_replace_sql', 'dbt')(existing_relation, target_relation, sql) -}}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_replace_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "existing_relation", "type": null, "description": ""}, {"name": "target_relation", "type": null, "description": ""}, {"name": "sql", "type": null, "description": ""}], "created_at": 1789422566.3409288, "supported_languages": null}, "macro.dbt.default__get_replace_sql": {"name": "default__get_replace_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/replace.sql", "original_file_path": "macros/relations/replace.sql", "unique_id": "macro.dbt.default__get_replace_sql", "macro_sql": "{% macro default__get_replace_sql(existing_relation, target_relation, sql) %}\n\n {# /* use a create or replace statement if possible */ #}\n\n {% set is_replaceable = existing_relation.type == target_relation.type and existing_relation.can_be_replaced %}\n\n {% if is_replaceable and existing_relation.is_view %}\n {{ get_replace_view_sql(target_relation, sql) }}\n\n {% elif is_replaceable and existing_relation.is_table %}\n {{ get_replace_table_sql(target_relation, sql) }}\n\n {% elif is_replaceable and existing_relation.is_materialized_view %}\n {{ get_replace_materialized_view_sql(target_relation, sql) }}\n\n {# /* a create or replace statement is not possible, so try to stage and/or backup to be safe */ #}\n\n {# /* create target_relation as an intermediate relation, then swap it out with the existing one using a backup */ #}\n {%- elif target_relation.can_be_renamed and existing_relation.can_be_renamed -%}\n {{ get_create_intermediate_sql(target_relation, sql) }};\n {{ get_create_backup_sql(existing_relation) }};\n {{ get_rename_intermediate_sql(target_relation) }};\n {{ get_drop_backup_sql(existing_relation) }}\n\n {# /* create target_relation as an intermediate relation, then swap it out with the existing one without using a backup */ #}\n {%- elif target_relation.can_be_renamed -%}\n {{ get_create_intermediate_sql(target_relation, sql) }};\n {{ get_drop_sql(existing_relation) }};\n {{ get_rename_intermediate_sql(target_relation) }}\n\n {# /* create target_relation in place by first backing up the existing relation */ #}\n {%- elif existing_relation.can_be_renamed -%}\n {{ get_create_backup_sql(existing_relation) }};\n {{ get_create_sql(target_relation, sql) }};\n {{ get_drop_backup_sql(existing_relation) }}\n\n {# /* no renaming is allowed, so just drop and create */ #}\n {%- else -%}\n {{ get_drop_sql(existing_relation) }};\n {{ get_create_sql(target_relation, sql) }}\n\n {%- endif -%}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_replace_view_sql", "macro.dbt.get_replace_table_sql", "macro.dbt.get_replace_materialized_view_sql", "macro.dbt.get_create_intermediate_sql", "macro.dbt.get_create_backup_sql", "macro.dbt.get_rename_intermediate_sql", "macro.dbt.get_drop_backup_sql", "macro.dbt.get_drop_sql", "macro.dbt.get_create_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "existing_relation", "type": null, "description": ""}, {"name": "target_relation", "type": null, "description": ""}, {"name": "sql", "type": null, "description": ""}], "created_at": 1789422566.3433557, "supported_languages": null}, "macro.dbt.get_create_backup_sql": {"name": "get_create_backup_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/create_backup.sql", "original_file_path": "macros/relations/create_backup.sql", "unique_id": "macro.dbt.get_create_backup_sql", "macro_sql": "{%- macro get_create_backup_sql(relation) -%}\n {{- log('Applying CREATE BACKUP to: ' ~ relation) -}}\n {{- adapter.dispatch('get_create_backup_sql', 'dbt')(relation) -}}\n{%- endmacro -%}\n\n\n", "depends_on": {"macros": ["macro.dbt.default__get_create_backup_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789422566.3440492, "supported_languages": null}, "macro.dbt.default__get_create_backup_sql": {"name": "default__get_create_backup_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/create_backup.sql", "original_file_path": "macros/relations/create_backup.sql", "unique_id": "macro.dbt.default__get_create_backup_sql", "macro_sql": "{%- macro default__get_create_backup_sql(relation) -%}\n\n -- get the standard backup name\n {% set backup_relation = make_backup_relation(relation, relation.type) %}\n\n -- drop any pre-existing backup\n {{ get_drop_sql(backup_relation) }};\n\n {{ get_rename_sql(relation, backup_relation.identifier) }}\n\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt.make_backup_relation", "macro.dbt.get_drop_sql", "macro.dbt.get_rename_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789422566.3446255, "supported_languages": null}, "macro.dbt.get_create_materialized_view_as_sql": {"name": "get_create_materialized_view_as_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/materialized_view/create.sql", "original_file_path": "macros/relations/materialized_view/create.sql", "unique_id": "macro.dbt.get_create_materialized_view_as_sql", "macro_sql": "{% macro get_create_materialized_view_as_sql(relation, sql) -%}\n {{- adapter.dispatch('get_create_materialized_view_as_sql', 'dbt')(relation, sql) -}}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__get_create_materialized_view_as_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "sql", "type": null, "description": ""}], "created_at": 1789422566.345163, "supported_languages": null}, "macro.dbt.default__get_create_materialized_view_as_sql": {"name": "default__get_create_materialized_view_as_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/materialized_view/create.sql", "original_file_path": "macros/relations/materialized_view/create.sql", "unique_id": "macro.dbt.default__get_create_materialized_view_as_sql", "macro_sql": "{% macro default__get_create_materialized_view_as_sql(relation, sql) -%}\n {{ exceptions.raise_compiler_error(\n \"`get_create_materialized_view_as_sql` has not been implemented for this adapter.\"\n ) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "sql", "type": null, "description": ""}], "created_at": 1789422566.3454645, "supported_languages": null}, "macro.dbt.get_alter_materialized_view_as_sql": {"name": "get_alter_materialized_view_as_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/materialized_view/alter.sql", "original_file_path": "macros/relations/materialized_view/alter.sql", "unique_id": "macro.dbt.get_alter_materialized_view_as_sql", "macro_sql": "{% macro get_alter_materialized_view_as_sql(\n relation,\n configuration_changes,\n sql,\n existing_relation,\n backup_relation,\n intermediate_relation\n) %}\n {{- log('Applying ALTER to: ' ~ relation) -}}\n {{- adapter.dispatch('get_alter_materialized_view_as_sql', 'dbt')(\n relation,\n configuration_changes,\n sql,\n existing_relation,\n backup_relation,\n intermediate_relation\n ) -}}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__get_alter_materialized_view_as_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "configuration_changes", "type": null, "description": ""}, {"name": "sql", "type": null, "description": ""}, {"name": "existing_relation", "type": null, "description": ""}, {"name": "backup_relation", "type": null, "description": ""}, {"name": "intermediate_relation", "type": null, "description": ""}], "created_at": 1789422566.3465042, "supported_languages": null}, "macro.dbt.default__get_alter_materialized_view_as_sql": {"name": "default__get_alter_materialized_view_as_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/materialized_view/alter.sql", "original_file_path": "macros/relations/materialized_view/alter.sql", "unique_id": "macro.dbt.default__get_alter_materialized_view_as_sql", "macro_sql": "{% macro default__get_alter_materialized_view_as_sql(\n relation,\n configuration_changes,\n sql,\n existing_relation,\n backup_relation,\n intermediate_relation\n) %}\n {{ exceptions.raise_compiler_error(\"Materialized views have not been implemented for this adapter.\") }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "configuration_changes", "type": null, "description": ""}, {"name": "sql", "type": null, "description": ""}, {"name": "existing_relation", "type": null, "description": ""}, {"name": "backup_relation", "type": null, "description": ""}, {"name": "intermediate_relation", "type": null, "description": ""}], "created_at": 1789422566.346919, "supported_languages": null}, "macro.dbt.get_materialized_view_configuration_changes": {"name": "get_materialized_view_configuration_changes", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/materialized_view/alter.sql", "original_file_path": "macros/relations/materialized_view/alter.sql", "unique_id": "macro.dbt.get_materialized_view_configuration_changes", "macro_sql": "{% macro get_materialized_view_configuration_changes(existing_relation, new_config) %}\n /* {#\n It's recommended that configuration changes be formatted as follows:\n {\"\": [{\"action\": \"\", \"context\": ...}]}\n\n For example:\n {\n \"indexes\": [\n {\"action\": \"drop\", \"context\": \"index_abc\"},\n {\"action\": \"create\", \"context\": {\"columns\": [\"column_1\", \"column_2\"], \"type\": \"hash\", \"unique\": True}},\n ],\n }\n\n Either way, `get_materialized_view_configuration_changes` needs to align with `get_alter_materialized_view_as_sql`.\n #} */\n {{- log('Determining configuration changes on: ' ~ existing_relation) -}}\n {%- do return(adapter.dispatch('get_materialized_view_configuration_changes', 'dbt')(existing_relation, new_config)) -%}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__get_materialized_view_configuration_changes"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "existing_relation", "type": null, "description": ""}, {"name": "new_config", "type": null, "description": ""}], "created_at": 1789422566.3474896, "supported_languages": null}, "macro.dbt.default__get_materialized_view_configuration_changes": {"name": "default__get_materialized_view_configuration_changes", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/materialized_view/alter.sql", "original_file_path": "macros/relations/materialized_view/alter.sql", "unique_id": "macro.dbt.default__get_materialized_view_configuration_changes", "macro_sql": "{% macro default__get_materialized_view_configuration_changes(existing_relation, new_config) %}\n {{ exceptions.raise_compiler_error(\"Materialized views have not been implemented for this adapter.\") }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "existing_relation", "type": null, "description": ""}, {"name": "new_config", "type": null, "description": ""}], "created_at": 1789422566.3478215, "supported_languages": null}, "macro.dbt.get_rename_materialized_view_sql": {"name": "get_rename_materialized_view_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/materialized_view/rename.sql", "original_file_path": "macros/relations/materialized_view/rename.sql", "unique_id": "macro.dbt.get_rename_materialized_view_sql", "macro_sql": "{% macro get_rename_materialized_view_sql(relation, new_name) %}\n {{- adapter.dispatch('get_rename_materialized_view_sql', 'dbt')(relation, new_name) -}}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__get_rename_materialized_view_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "new_name", "type": null, "description": ""}], "created_at": 1789422566.3483796, "supported_languages": null}, "macro.dbt.default__get_rename_materialized_view_sql": {"name": "default__get_rename_materialized_view_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/materialized_view/rename.sql", "original_file_path": "macros/relations/materialized_view/rename.sql", "unique_id": "macro.dbt.default__get_rename_materialized_view_sql", "macro_sql": "{% macro default__get_rename_materialized_view_sql(relation, new_name) %}\n {{ exceptions.raise_compiler_error(\n \"`get_rename_materialized_view_sql` has not been implemented for this adapter.\"\n ) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "new_name", "type": null, "description": ""}], "created_at": 1789422566.3489113, "supported_languages": null}, "macro.dbt.refresh_materialized_view": {"name": "refresh_materialized_view", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/materialized_view/refresh.sql", "original_file_path": "macros/relations/materialized_view/refresh.sql", "unique_id": "macro.dbt.refresh_materialized_view", "macro_sql": "{% macro refresh_materialized_view(relation) %}\n {{- log('Applying REFRESH to: ' ~ relation) -}}\n {{- adapter.dispatch('refresh_materialized_view', 'dbt')(relation) -}}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__refresh_materialized_view"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789422566.3495524, "supported_languages": null}, "macro.dbt.default__refresh_materialized_view": {"name": "default__refresh_materialized_view", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/materialized_view/refresh.sql", "original_file_path": "macros/relations/materialized_view/refresh.sql", "unique_id": "macro.dbt.default__refresh_materialized_view", "macro_sql": "{% macro default__refresh_materialized_view(relation) %}\n {{ exceptions.raise_compiler_error(\"`refresh_materialized_view` has not been implemented for this adapter.\") }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789422566.349849, "supported_languages": null}, "macro.dbt.drop_materialized_view": {"name": "drop_materialized_view", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/materialized_view/drop.sql", "original_file_path": "macros/relations/materialized_view/drop.sql", "unique_id": "macro.dbt.drop_materialized_view", "macro_sql": "{% macro drop_materialized_view(relation) -%}\n {{- adapter.dispatch('drop_materialized_view', 'dbt')(relation) -}}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__drop_materialized_view"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789422566.3503485, "supported_languages": null}, "macro.dbt.default__drop_materialized_view": {"name": "default__drop_materialized_view", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/materialized_view/drop.sql", "original_file_path": "macros/relations/materialized_view/drop.sql", "unique_id": "macro.dbt.default__drop_materialized_view", "macro_sql": "{% macro default__drop_materialized_view(relation) -%}\n drop materialized view if exists {{ relation.render() }} cascade\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789422566.3506382, "supported_languages": null}, "macro.dbt.get_replace_materialized_view_sql": {"name": "get_replace_materialized_view_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/materialized_view/replace.sql", "original_file_path": "macros/relations/materialized_view/replace.sql", "unique_id": "macro.dbt.get_replace_materialized_view_sql", "macro_sql": "{% macro get_replace_materialized_view_sql(relation, sql) %}\n {{- adapter.dispatch('get_replace_materialized_view_sql', 'dbt')(relation, sql) -}}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_replace_materialized_view_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "sql", "type": null, "description": ""}], "created_at": 1789422566.3511674, "supported_languages": null}, "macro.dbt.default__get_replace_materialized_view_sql": {"name": "default__get_replace_materialized_view_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/materialized_view/replace.sql", "original_file_path": "macros/relations/materialized_view/replace.sql", "unique_id": "macro.dbt.default__get_replace_materialized_view_sql", "macro_sql": "{% macro default__get_replace_materialized_view_sql(relation, sql) %}\n {{ exceptions.raise_compiler_error(\n \"`get_replace_materialized_view_sql` has not been implemented for this adapter.\"\n ) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "sql", "type": null, "description": ""}], "created_at": 1789422566.351471, "supported_languages": null}, "macro.dbt.get_create_view_as_sql": {"name": "get_create_view_as_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/view/create.sql", "original_file_path": "macros/relations/view/create.sql", "unique_id": "macro.dbt.get_create_view_as_sql", "macro_sql": "{% macro get_create_view_as_sql(relation, sql) -%}\n {{ adapter.dispatch('get_create_view_as_sql', 'dbt')(relation, sql) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_create_view_as_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "sql", "type": null, "description": ""}], "created_at": 1789422566.3521984, "supported_languages": null}, "macro.dbt.default__get_create_view_as_sql": {"name": "default__get_create_view_as_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/view/create.sql", "original_file_path": "macros/relations/view/create.sql", "unique_id": "macro.dbt.default__get_create_view_as_sql", "macro_sql": "{% macro default__get_create_view_as_sql(relation, sql) -%}\n {{ return(create_view_as(relation, sql)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.create_view_as"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "sql", "type": null, "description": ""}], "created_at": 1789422566.3525555, "supported_languages": null}, "macro.dbt.create_view_as": {"name": "create_view_as", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/view/create.sql", "original_file_path": "macros/relations/view/create.sql", "unique_id": "macro.dbt.create_view_as", "macro_sql": "{% macro create_view_as(relation, sql) -%}\n {{ adapter.dispatch('create_view_as', 'dbt')(relation, sql) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__create_view_as"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "sql", "type": null, "description": ""}], "created_at": 1789422566.3529282, "supported_languages": null}, "macro.dbt.default__create_view_as": {"name": "default__create_view_as", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/view/create.sql", "original_file_path": "macros/relations/view/create.sql", "unique_id": "macro.dbt.default__create_view_as", "macro_sql": "{% macro default__create_view_as(relation, sql) -%}\n {%- set sql_header = config.get('sql_header', none) -%}\n\n {{ sql_header if sql_header is not none }}\n create view {{ relation.render() }}\n {% set contract_config = config.get('contract') %}\n {% if contract_config.enforced %}\n {{ get_assert_columns_equivalent(sql) }}\n {%- endif %}\n as (\n {{ sql }}\n );\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.get_assert_columns_equivalent"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "sql", "type": null, "description": ""}], "created_at": 1789422566.3538282, "supported_languages": null}, "macro.dbt.get_rename_view_sql": {"name": "get_rename_view_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/view/rename.sql", "original_file_path": "macros/relations/view/rename.sql", "unique_id": "macro.dbt.get_rename_view_sql", "macro_sql": "{% macro get_rename_view_sql(relation, new_name) %}\n {{- adapter.dispatch('get_rename_view_sql', 'dbt')(relation, new_name) -}}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__get_rename_view_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "new_name", "type": null, "description": ""}], "created_at": 1789422566.3543596, "supported_languages": null}, "macro.dbt.default__get_rename_view_sql": {"name": "default__get_rename_view_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/view/rename.sql", "original_file_path": "macros/relations/view/rename.sql", "unique_id": "macro.dbt.default__get_rename_view_sql", "macro_sql": "{% macro default__get_rename_view_sql(relation, new_name) %}\n {{ exceptions.raise_compiler_error(\n \"`get_rename_view_sql` has not been implemented for this adapter.\"\n ) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "new_name", "type": null, "description": ""}], "created_at": 1789422566.3546846, "supported_languages": null}, "macro.dbt.drop_view": {"name": "drop_view", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/view/drop.sql", "original_file_path": "macros/relations/view/drop.sql", "unique_id": "macro.dbt.drop_view", "macro_sql": "{% macro drop_view(relation) -%}\n {{- adapter.dispatch('drop_view', 'dbt')(relation) -}}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__drop_view"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789422566.355162, "supported_languages": null}, "macro.dbt.default__drop_view": {"name": "default__drop_view", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/view/drop.sql", "original_file_path": "macros/relations/view/drop.sql", "unique_id": "macro.dbt.default__drop_view", "macro_sql": "{% macro default__drop_view(relation) -%}\n drop view if exists {{ relation.render() }} cascade\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789422566.3554144, "supported_languages": null}, "macro.dbt.get_replace_view_sql": {"name": "get_replace_view_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/view/replace.sql", "original_file_path": "macros/relations/view/replace.sql", "unique_id": "macro.dbt.get_replace_view_sql", "macro_sql": "{% macro get_replace_view_sql(relation, sql) %}\n {{- adapter.dispatch('get_replace_view_sql', 'dbt')(relation, sql) -}}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__get_replace_view_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "sql", "type": null, "description": ""}], "created_at": 1789422566.3563964, "supported_languages": null}, "macro.dbt.default__get_replace_view_sql": {"name": "default__get_replace_view_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/view/replace.sql", "original_file_path": "macros/relations/view/replace.sql", "unique_id": "macro.dbt.default__get_replace_view_sql", "macro_sql": "{% macro default__get_replace_view_sql(relation, sql) %}\n {{ exceptions.raise_compiler_error(\n \"`get_replace_view_sql` has not been implemented for this adapter.\"\n ) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "sql", "type": null, "description": ""}], "created_at": 1789422566.3568575, "supported_languages": null}, "macro.dbt.create_or_replace_view": {"name": "create_or_replace_view", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/view/replace.sql", "original_file_path": "macros/relations/view/replace.sql", "unique_id": "macro.dbt.create_or_replace_view", "macro_sql": "{% macro create_or_replace_view() %}\n {%- set identifier = model['alias'] -%}\n\n {%- set old_relation = adapter.get_relation(database=database, schema=schema, identifier=identifier) -%}\n {%- set exists_as_view = (old_relation is not none and old_relation.is_view) -%}\n\n {%- set target_relation = api.Relation.create(\n identifier=identifier, schema=schema, database=database,\n type='view') -%}\n {% set grant_config = config.get('grants') %}\n\n {{ run_hooks(pre_hooks) }}\n\n -- If there's a table with the same name and we weren't told to full refresh,\n -- that's an error. If we were told to full refresh, drop it. This behavior differs\n -- for Snowflake and BigQuery, so multiple dispatch is used.\n {%- if old_relation is not none and old_relation.is_table -%}\n {{ handle_existing_table(should_full_refresh(), old_relation) }}\n {%- endif -%}\n\n -- build model\n {% call statement('main') -%}\n {{ get_create_view_as_sql(target_relation, sql) }}\n {%- endcall %}\n\n {% set should_revoke = should_revoke(exists_as_view, full_refresh_mode=True) %}\n {% do apply_grants(target_relation, grant_config, should_revoke=should_revoke) %}\n\n {{ run_hooks(post_hooks) }}\n\n {{ return({'relations': [target_relation]}) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.run_hooks", "macro.dbt.handle_existing_table", "macro.dbt.should_full_refresh", "macro.dbt.statement", "macro.dbt.get_create_view_as_sql", "macro.dbt.should_revoke", "macro.dbt.apply_grants"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789422566.3591506, "supported_languages": null}, "macro.dbt.handle_existing_table": {"name": "handle_existing_table", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/view/replace.sql", "original_file_path": "macros/relations/view/replace.sql", "unique_id": "macro.dbt.handle_existing_table", "macro_sql": "{% macro handle_existing_table(full_refresh, old_relation) %}\n {{ adapter.dispatch('handle_existing_table', 'dbt')(full_refresh, old_relation) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__handle_existing_table"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "full_refresh", "type": null, "description": ""}, {"name": "old_relation", "type": null, "description": ""}], "created_at": 1789422566.3595805, "supported_languages": null}, "macro.dbt.default__handle_existing_table": {"name": "default__handle_existing_table", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/view/replace.sql", "original_file_path": "macros/relations/view/replace.sql", "unique_id": "macro.dbt.default__handle_existing_table", "macro_sql": "{% macro default__handle_existing_table(full_refresh, old_relation) %}\n {{ log(\"Dropping relation \" ~ old_relation.render() ~ \" because it is of type \" ~ old_relation.type) }}\n {{ adapter.drop_relation(old_relation) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "full_refresh", "type": null, "description": ""}, {"name": "old_relation", "type": null, "description": ""}], "created_at": 1789422566.3600807, "supported_languages": null}, "macro.dbt.get_table_columns_and_constraints": {"name": "get_table_columns_and_constraints", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/column/columns_spec_ddl.sql", "original_file_path": "macros/relations/column/columns_spec_ddl.sql", "unique_id": "macro.dbt.get_table_columns_and_constraints", "macro_sql": "{%- macro get_table_columns_and_constraints() -%}\n {{ adapter.dispatch('get_table_columns_and_constraints', 'dbt')() }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt.default__get_table_columns_and_constraints"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789422566.3617125, "supported_languages": null}, "macro.dbt.default__get_table_columns_and_constraints": {"name": "default__get_table_columns_and_constraints", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/column/columns_spec_ddl.sql", "original_file_path": "macros/relations/column/columns_spec_ddl.sql", "unique_id": "macro.dbt.default__get_table_columns_and_constraints", "macro_sql": "{% macro default__get_table_columns_and_constraints() -%}\n {{ return(table_columns_and_constraints()) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.table_columns_and_constraints"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789422566.3619745, "supported_languages": null}, "macro.dbt.table_columns_and_constraints": {"name": "table_columns_and_constraints", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/column/columns_spec_ddl.sql", "original_file_path": "macros/relations/column/columns_spec_ddl.sql", "unique_id": "macro.dbt.table_columns_and_constraints", "macro_sql": "{% macro table_columns_and_constraints() %}\n {# loop through user_provided_columns to create DDL with data types and constraints #}\n {%- set raw_column_constraints = adapter.render_raw_columns_constraints(raw_columns=model['columns']) -%}\n {%- set raw_model_constraints = adapter.render_raw_model_constraints(raw_constraints=model['constraints']) -%}\n (\n {% for c in raw_column_constraints -%}\n {{ c }}{{ \",\" if not loop.last or raw_model_constraints }}\n {% endfor %}\n {% for c in raw_model_constraints -%}\n {{ c }}{{ \",\" if not loop.last }}\n {% endfor -%}\n )\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789422566.3630724, "supported_languages": null}, "macro.dbt.get_assert_columns_equivalent": {"name": "get_assert_columns_equivalent", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/column/columns_spec_ddl.sql", "original_file_path": "macros/relations/column/columns_spec_ddl.sql", "unique_id": "macro.dbt.get_assert_columns_equivalent", "macro_sql": "\n\n{%- macro get_assert_columns_equivalent(sql) -%}\n {{ adapter.dispatch('get_assert_columns_equivalent', 'dbt')(sql) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt.default__get_assert_columns_equivalent"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "sql", "type": null, "description": ""}], "created_at": 1789422566.36341, "supported_languages": null}, "macro.dbt.default__get_assert_columns_equivalent": {"name": "default__get_assert_columns_equivalent", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/column/columns_spec_ddl.sql", "original_file_path": "macros/relations/column/columns_spec_ddl.sql", "unique_id": "macro.dbt.default__get_assert_columns_equivalent", "macro_sql": "{% macro default__get_assert_columns_equivalent(sql) -%}\n {{ return(assert_columns_equivalent(sql)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.assert_columns_equivalent"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "sql", "type": null, "description": ""}], "created_at": 1789422566.3637156, "supported_languages": null}, "macro.dbt.assert_columns_equivalent": {"name": "assert_columns_equivalent", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/column/columns_spec_ddl.sql", "original_file_path": "macros/relations/column/columns_spec_ddl.sql", "unique_id": "macro.dbt.assert_columns_equivalent", "macro_sql": "{% macro assert_columns_equivalent(sql) %}\n\n {#-- First ensure the user has defined 'columns' in yaml specification --#}\n {%- set user_defined_columns = model['columns'] -%}\n {%- if not user_defined_columns -%}\n {{ exceptions.raise_contract_error([], []) }}\n {%- endif -%}\n\n {#-- Obtain the column schema provided by sql file. #}\n {%- set sql_file_provided_columns = get_column_schema_from_query(sql, config.get('sql_header', none)) -%}\n {#--Obtain the column schema provided by the schema file by generating an 'empty schema' query from the model's columns. #}\n {%- set schema_file_provided_columns = get_column_schema_from_query(get_empty_schema_sql(user_defined_columns)) -%}\n\n {#-- create dictionaries with name and formatted data type and strings for exception #}\n {%- set sql_columns = format_columns(sql_file_provided_columns) -%}\n {%- set yaml_columns = format_columns(schema_file_provided_columns) -%}\n\n {%- if sql_columns|length != yaml_columns|length -%}\n {%- do exceptions.raise_contract_error(yaml_columns, sql_columns) -%}\n {%- endif -%}\n\n {%- for sql_col in sql_columns -%}\n {%- set yaml_col = [] -%}\n {%- for this_col in yaml_columns -%}\n {%- if this_col['name'] == sql_col['name'] -%}\n {%- do yaml_col.append(this_col) -%}\n {%- break -%}\n {%- endif -%}\n {%- endfor -%}\n {%- if not yaml_col -%}\n {#-- Column with name not found in yaml #}\n {%- do exceptions.raise_contract_error(yaml_columns, sql_columns) -%}\n {%- endif -%}\n {%- if sql_col['formatted'] != yaml_col[0]['formatted'] -%}\n {#-- Column data types don't match #}\n {%- do exceptions.raise_contract_error(yaml_columns, sql_columns) -%}\n {%- endif -%}\n {%- endfor -%}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_column_schema_from_query", "macro.dbt.get_empty_schema_sql", "macro.dbt.format_columns"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "sql", "type": null, "description": ""}], "created_at": 1789422566.3663154, "supported_languages": null}, "macro.dbt.format_columns": {"name": "format_columns", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/column/columns_spec_ddl.sql", "original_file_path": "macros/relations/column/columns_spec_ddl.sql", "unique_id": "macro.dbt.format_columns", "macro_sql": "{% macro format_columns(columns) %}\n {% set formatted_columns = [] %}\n {% for column in columns %}\n {%- set formatted_column = adapter.dispatch('format_column', 'dbt')(column) -%}\n {%- do formatted_columns.append(formatted_column) -%}\n {% endfor %}\n {{ return(formatted_columns) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__format_column"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "columns", "type": null, "description": ""}], "created_at": 1789422566.367107, "supported_languages": null}, "macro.dbt.default__format_column": {"name": "default__format_column", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/column/columns_spec_ddl.sql", "original_file_path": "macros/relations/column/columns_spec_ddl.sql", "unique_id": "macro.dbt.default__format_column", "macro_sql": "{% macro default__format_column(column) -%}\n {% set data_type = column.dtype %}\n {% set formatted = column.column.lower() ~ \" \" ~ data_type %}\n {{ return({'name': column.name, 'data_type': data_type, 'formatted': formatted}) }}\n{%- endmacro -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "column", "type": null, "description": ""}], "created_at": 1789422566.3678143, "supported_languages": null}, "macro.dbt.get_create_table_as_sql": {"name": "get_create_table_as_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/table/create.sql", "original_file_path": "macros/relations/table/create.sql", "unique_id": "macro.dbt.get_create_table_as_sql", "macro_sql": "{% macro get_create_table_as_sql(temporary, relation, sql) -%}\n {{ adapter.dispatch('get_create_table_as_sql', 'dbt')(temporary, relation, sql) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_create_table_as_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "temporary", "type": null, "description": ""}, {"name": "relation", "type": null, "description": ""}, {"name": "sql", "type": null, "description": ""}], "created_at": 1789422566.3690455, "supported_languages": null}, "macro.dbt.default__get_create_table_as_sql": {"name": "default__get_create_table_as_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/table/create.sql", "original_file_path": "macros/relations/table/create.sql", "unique_id": "macro.dbt.default__get_create_table_as_sql", "macro_sql": "{% macro default__get_create_table_as_sql(temporary, relation, sql) -%}\n {{ return(create_table_as(temporary, relation, sql)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.create_table_as"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "temporary", "type": null, "description": ""}, {"name": "relation", "type": null, "description": ""}, {"name": "sql", "type": null, "description": ""}], "created_at": 1789422566.369427, "supported_languages": null}, "macro.dbt.create_table_as": {"name": "create_table_as", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/table/create.sql", "original_file_path": "macros/relations/table/create.sql", "unique_id": "macro.dbt.create_table_as", "macro_sql": "{% macro create_table_as(temporary, relation, compiled_code, language='sql') -%}\n {# backward compatibility for create_table_as that does not support language #}\n {% if language == \"sql\" %}\n {{ adapter.dispatch('create_table_as', 'dbt')(temporary, relation, compiled_code)}}\n {% else %}\n {{ adapter.dispatch('create_table_as', 'dbt')(temporary, relation, compiled_code, language) }}\n {% endif %}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__create_table_as"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "temporary", "type": null, "description": ""}, {"name": "relation", "type": null, "description": ""}, {"name": "compiled_code", "type": null, "description": ""}, {"name": "language", "type": null, "description": ""}], "created_at": 1789422566.3704698, "supported_languages": null}, "macro.dbt.default__create_table_as": {"name": "default__create_table_as", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/table/create.sql", "original_file_path": "macros/relations/table/create.sql", "unique_id": "macro.dbt.default__create_table_as", "macro_sql": "{% macro default__create_table_as(temporary, relation, sql) -%}\n {%- set sql_header = config.get('sql_header', none) -%}\n\n {{ sql_header if sql_header is not none }}\n\n create {% if temporary: -%}temporary{%- endif %} table\n {{ relation.include(database=(not temporary), schema=(not temporary)) }}\n {% set contract_config = config.get('contract') %}\n {% if contract_config.enforced and (not temporary) %}\n {{ get_assert_columns_equivalent(sql) }}\n {{ get_table_columns_and_constraints() }}\n {%- set sql = get_select_subquery(sql) %}\n {% endif %}\n as (\n {{ sql }}\n );\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.get_assert_columns_equivalent", "macro.dbt.get_table_columns_and_constraints", "macro.dbt.get_select_subquery"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "temporary", "type": null, "description": ""}, {"name": "relation", "type": null, "description": ""}, {"name": "sql", "type": null, "description": ""}], "created_at": 1789422566.3718944, "supported_languages": null}, "macro.dbt.default__get_column_names": {"name": "default__get_column_names", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/table/create.sql", "original_file_path": "macros/relations/table/create.sql", "unique_id": "macro.dbt.default__get_column_names", "macro_sql": "{% macro default__get_column_names() %}\n {#- loop through user_provided_columns to get column names -#}\n {%- set user_provided_columns = model['columns'] -%}\n {%- for i in user_provided_columns %}\n {%- set col = user_provided_columns[i] -%}\n {%- set col_name = adapter.quote(col['name']) if col.get('quote') else col['name'] -%}\n {{ col_name }}{{ \", \" if not loop.last }}\n {%- endfor -%}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789422566.3728456, "supported_languages": null}, "macro.dbt.get_select_subquery": {"name": "get_select_subquery", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/table/create.sql", "original_file_path": "macros/relations/table/create.sql", "unique_id": "macro.dbt.get_select_subquery", "macro_sql": "{% macro get_select_subquery(sql) %}\n {{ return(adapter.dispatch('get_select_subquery', 'dbt')(sql)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_select_subquery"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "sql", "type": null, "description": ""}], "created_at": 1789422566.3732207, "supported_languages": null}, "macro.dbt.default__get_select_subquery": {"name": "default__get_select_subquery", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/table/create.sql", "original_file_path": "macros/relations/table/create.sql", "unique_id": "macro.dbt.default__get_select_subquery", "macro_sql": "{% macro default__get_select_subquery(sql) %}\n select {{ adapter.dispatch('get_column_names', 'dbt')() }}\n from (\n {{ sql }}\n ) as model_subq\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_column_names"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "sql", "type": null, "description": ""}], "created_at": 1789422566.3736048, "supported_languages": null}, "macro.dbt.get_rename_table_sql": {"name": "get_rename_table_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/table/rename.sql", "original_file_path": "macros/relations/table/rename.sql", "unique_id": "macro.dbt.get_rename_table_sql", "macro_sql": "{% macro get_rename_table_sql(relation, new_name) %}\n {{- adapter.dispatch('get_rename_table_sql', 'dbt')(relation, new_name) -}}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__get_rename_table_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "new_name", "type": null, "description": ""}], "created_at": 1789422566.3741367, "supported_languages": null}, "macro.dbt.default__get_rename_table_sql": {"name": "default__get_rename_table_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/table/rename.sql", "original_file_path": "macros/relations/table/rename.sql", "unique_id": "macro.dbt.default__get_rename_table_sql", "macro_sql": "{% macro default__get_rename_table_sql(relation, new_name) %}\n {{ exceptions.raise_compiler_error(\n \"`get_rename_table_sql` has not been implemented for this adapter.\"\n ) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "new_name", "type": null, "description": ""}], "created_at": 1789422566.3744912, "supported_languages": null}, "macro.dbt.drop_table": {"name": "drop_table", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/table/drop.sql", "original_file_path": "macros/relations/table/drop.sql", "unique_id": "macro.dbt.drop_table", "macro_sql": "{% macro drop_table(relation) -%}\n {{- adapter.dispatch('drop_table', 'dbt')(relation) -}}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__drop_table"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789422566.3750062, "supported_languages": null}, "macro.dbt.default__drop_table": {"name": "default__drop_table", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/table/drop.sql", "original_file_path": "macros/relations/table/drop.sql", "unique_id": "macro.dbt.default__drop_table", "macro_sql": "{% macro default__drop_table(relation) -%}\n drop table if exists {{ relation.render() }} cascade\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789422566.375262, "supported_languages": null}, "macro.dbt.get_replace_table_sql": {"name": "get_replace_table_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/table/replace.sql", "original_file_path": "macros/relations/table/replace.sql", "unique_id": "macro.dbt.get_replace_table_sql", "macro_sql": "{% macro get_replace_table_sql(relation, sql) %}\n {{- adapter.dispatch('get_replace_table_sql', 'dbt')(relation, sql) -}}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__get_replace_table_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "sql", "type": null, "description": ""}], "created_at": 1789422566.375803, "supported_languages": null}, "macro.dbt.default__get_replace_table_sql": {"name": "default__get_replace_table_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/table/replace.sql", "original_file_path": "macros/relations/table/replace.sql", "unique_id": "macro.dbt.default__get_replace_table_sql", "macro_sql": "{% macro default__get_replace_table_sql(relation, sql) %}\n {{ exceptions.raise_compiler_error(\n \"`get_replace_table_sql` has not been implemented for this adapter.\"\n ) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "sql", "type": null, "description": ""}], "created_at": 1789422566.3761163, "supported_languages": null}, "macro.dbt.default__test_relationships": {"name": "default__test_relationships", "resource_type": "macro", "package_name": "dbt", "path": "macros/generic_test_sql/relationships.sql", "original_file_path": "macros/generic_test_sql/relationships.sql", "unique_id": "macro.dbt.default__test_relationships", "macro_sql": "{% macro default__test_relationships(model, column_name, to, field) %}\n\nwith child as (\n select {{ column_name }} as from_field\n from {{ model }}\n where {{ column_name }} is not null\n),\n\nparent as (\n select {{ field }} as to_field\n from {{ to }}\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "column_name", "type": null, "description": ""}, {"name": "to", "type": null, "description": ""}, {"name": "field", "type": null, "description": ""}], "created_at": 1789422566.3767345, "supported_languages": null}, "macro.dbt.default__test_accepted_values": {"name": "default__test_accepted_values", "resource_type": "macro", "package_name": "dbt", "path": "macros/generic_test_sql/accepted_values.sql", "original_file_path": "macros/generic_test_sql/accepted_values.sql", "unique_id": "macro.dbt.default__test_accepted_values", "macro_sql": "{% macro default__test_accepted_values(model, column_name, values, quote=True) %}\n\nwith all_values as (\n\n select\n {{ column_name }} as value_field,\n count(*) as n_records\n\n from {{ model }}\n group by {{ column_name }}\n\n)\n\nselect *\nfrom all_values\nwhere value_field not in (\n {% for value in values -%}\n {% if quote -%}\n '{{ value }}'\n {%- else -%}\n {{ value }}\n {%- endif -%}\n {%- if not loop.last -%},{%- endif %}\n {%- endfor %}\n)\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "column_name", "type": null, "description": ""}, {"name": "values", "type": null, "description": ""}, {"name": "quote", "type": null, "description": ""}], "created_at": 1789422566.3777702, "supported_languages": null}, "macro.dbt.default__test_not_null": {"name": "default__test_not_null", "resource_type": "macro", "package_name": "dbt", "path": "macros/generic_test_sql/not_null.sql", "original_file_path": "macros/generic_test_sql/not_null.sql", "unique_id": "macro.dbt.default__test_not_null", "macro_sql": "{% macro default__test_not_null(model, column_name) %}\n\n{% set column_list = '*' if should_store_failures() else column_name %}\n\nselect {{ column_list }}\nfrom {{ model }}\nwhere {{ column_name }} is null\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.should_store_failures"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "column_name", "type": null, "description": ""}], "created_at": 1789422566.378364, "supported_languages": null}, "macro.dbt.default__test_unique": {"name": "default__test_unique", "resource_type": "macro", "package_name": "dbt", "path": "macros/generic_test_sql/unique.sql", "original_file_path": "macros/generic_test_sql/unique.sql", "unique_id": "macro.dbt.default__test_unique", "macro_sql": "{% macro default__test_unique(model, column_name) %}\n\nselect\n {{ column_name }} as unique_field,\n count(*) as n_records\n\nfrom {{ model }}\nwhere {{ column_name }} is not null\ngroup by {{ column_name }}\nhaving count(*) > 1\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "column_name", "type": null, "description": ""}], "created_at": 1789422566.378854, "supported_languages": null}, "macro.dbt.set_sql_header": {"name": "set_sql_header", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/configs.sql", "original_file_path": "macros/materializations/configs.sql", "unique_id": "macro.dbt.set_sql_header", "macro_sql": "{% macro set_sql_header(config) -%}\n {{ config.set('sql_header', caller()) }}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "config", "type": null, "description": ""}], "created_at": 1789422566.3794324, "supported_languages": null}, "macro.dbt.should_full_refresh": {"name": "should_full_refresh", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/configs.sql", "original_file_path": "macros/materializations/configs.sql", "unique_id": "macro.dbt.should_full_refresh", "macro_sql": "{% macro should_full_refresh() %}\n {% set config_full_refresh = config.get('full_refresh') %}\n {% if config_full_refresh is none %}\n {% set config_full_refresh = flags.FULL_REFRESH %}\n {% endif %}\n {% do return(config_full_refresh) %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789422566.3802483, "supported_languages": null}, "macro.dbt.should_store_failures": {"name": "should_store_failures", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/configs.sql", "original_file_path": "macros/materializations/configs.sql", "unique_id": "macro.dbt.should_store_failures", "macro_sql": "{% macro should_store_failures() %}\n {% set config_store_failures = config.get('store_failures') %}\n {% if config_store_failures is none %}\n {% set config_store_failures = flags.STORE_FAILURES %}\n {% endif %}\n {% do return(config_store_failures) %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789422566.3808987, "supported_languages": null}, "macro.dbt.run_hooks": {"name": "run_hooks", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/hooks.sql", "original_file_path": "macros/materializations/hooks.sql", "unique_id": "macro.dbt.run_hooks", "macro_sql": "{% macro run_hooks(hooks, inside_transaction=True) %}\n {% for hook in hooks | selectattr('transaction', 'equalto', inside_transaction) %}\n {% if not inside_transaction and loop.first %}\n {% call statement(auto_begin=inside_transaction) %}\n commit;\n {% endcall %}\n {% endif %}\n {% set rendered = render(hook.get('sql')) | trim %}\n {% if (rendered | length) > 0 %}\n {% call statement(auto_begin=inside_transaction) %}\n {{ rendered }}\n {% endcall %}\n {% endif %}\n {% endfor %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "hooks", "type": null, "description": ""}, {"name": "inside_transaction", "type": null, "description": ""}], "created_at": 1789422566.3826485, "supported_languages": null}, "macro.dbt.make_hook_config": {"name": "make_hook_config", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/hooks.sql", "original_file_path": "macros/materializations/hooks.sql", "unique_id": "macro.dbt.make_hook_config", "macro_sql": "{% macro make_hook_config(sql, inside_transaction) %}\n {{ tojson({\"sql\": sql, \"transaction\": inside_transaction}) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "sql", "type": null, "description": ""}, {"name": "inside_transaction", "type": null, "description": ""}], "created_at": 1789422566.383067, "supported_languages": null}, "macro.dbt.before_begin": {"name": "before_begin", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/hooks.sql", "original_file_path": "macros/materializations/hooks.sql", "unique_id": "macro.dbt.before_begin", "macro_sql": "{% macro before_begin(sql) %}\n {{ make_hook_config(sql, inside_transaction=False) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.make_hook_config"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "sql", "type": null, "description": ""}], "created_at": 1789422566.3833725, "supported_languages": null}, "macro.dbt.in_transaction": {"name": "in_transaction", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/hooks.sql", "original_file_path": "macros/materializations/hooks.sql", "unique_id": "macro.dbt.in_transaction", "macro_sql": "{% macro in_transaction(sql) %}\n {{ make_hook_config(sql, inside_transaction=True) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.make_hook_config"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "sql", "type": null, "description": ""}], "created_at": 1789422566.383698, "supported_languages": null}, "macro.dbt.after_commit": {"name": "after_commit", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/hooks.sql", "original_file_path": "macros/materializations/hooks.sql", "unique_id": "macro.dbt.after_commit", "macro_sql": "{% macro after_commit(sql) %}\n {{ make_hook_config(sql, inside_transaction=False) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.make_hook_config"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "sql", "type": null, "description": ""}], "created_at": 1789422566.3839965, "supported_languages": null}, "macro.dbt.materialization_seed_default": {"name": "materialization_seed_default", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/seeds/seed.sql", "original_file_path": "macros/materializations/seeds/seed.sql", "unique_id": "macro.dbt.materialization_seed_default", "macro_sql": "{% materialization seed, default %}\n\n {%- set identifier = model['alias'] -%}\n {%- set full_refresh_mode = (should_full_refresh()) -%}\n\n {%- set old_relation = adapter.get_relation(database=database, schema=schema, identifier=identifier) -%}\n\n {%- set exists_as_table = (old_relation is not none and old_relation.is_table) -%}\n {%- set exists_as_view = (old_relation is not none and old_relation.is_view) -%}\n\n {%- set grant_config = config.get('grants') -%}\n {%- set agate_table = load_agate_table() -%}\n -- grab current tables grants config for comparison later on\n\n {%- do store_result('agate_table', response='OK', agate_table=agate_table) -%}\n\n {{ run_hooks(pre_hooks, inside_transaction=False) }}\n\n -- `BEGIN` happens here:\n {{ run_hooks(pre_hooks, inside_transaction=True) }}\n\n -- build model\n {% set create_table_sql = \"\" %}\n {% if exists_as_view %}\n {{ exceptions.raise_compiler_error(\"Cannot seed to '{}', it is a view\".format(old_relation.render())) }}\n {% elif exists_as_table %}\n {% set create_table_sql = reset_csv_table(model, full_refresh_mode, old_relation, agate_table) %}\n {% else %}\n {% set create_table_sql = create_csv_table(model, agate_table) %}\n {% endif %}\n\n {% set code = 'CREATE' if full_refresh_mode else 'INSERT' %}\n {% set rows_affected = (agate_table.rows | length) %}\n {% set sql = \"\" %}\n {% if rows_affected > 0 %}\n {% set sql = load_csv_rows(model, agate_table) %}\n {% endif %}\n\n {% call noop_statement('main', code ~ ' ' ~ rows_affected, code, rows_affected) %}\n {{ get_csv_sql(create_table_sql, sql) }};\n {% endcall %}\n\n {% set target_relation = this.incorporate(type='table') %}\n\n {% set should_revoke = should_revoke(old_relation, full_refresh_mode) %}\n {% do apply_grants(target_relation, grant_config, should_revoke=should_revoke) %}\n\n {% do persist_docs(target_relation, model) %}\n\n {% if full_refresh_mode or not exists_as_table %}\n {% do create_indexes(target_relation) %}\n {% endif %}\n\n {{ run_hooks(post_hooks, inside_transaction=True) }}\n\n -- `COMMIT` happens here\n {{ adapter.commit() }}\n\n {{ run_hooks(post_hooks, inside_transaction=False) }}\n\n {{ return({'relations': [target_relation]}) }}\n\n{% endmaterialization %}", "depends_on": {"macros": ["macro.dbt.should_full_refresh", "macro.dbt.run_hooks", "macro.dbt.reset_csv_table", "macro.dbt.create_csv_table", "macro.dbt.load_csv_rows", "macro.dbt.noop_statement", "macro.dbt.get_csv_sql", "macro.dbt.should_revoke", "macro.dbt.apply_grants", "macro.dbt.persist_docs", "macro.dbt.create_indexes"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "supported_languages", "type": null, "description": ""}], "created_at": 1789422566.389706, "supported_languages": ["sql"]}, "macro.dbt.create_csv_table": {"name": "create_csv_table", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "unique_id": "macro.dbt.create_csv_table", "macro_sql": "{% macro create_csv_table(model, agate_table) -%}\n {{ adapter.dispatch('create_csv_table', 'dbt')(model, agate_table) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__create_csv_table"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "agate_table", "type": null, "description": ""}], "created_at": 1789422566.3917823, "supported_languages": null}, "macro.dbt.default__create_csv_table": {"name": "default__create_csv_table", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "unique_id": "macro.dbt.default__create_csv_table", "macro_sql": "{% macro default__create_csv_table(model, agate_table) %}\n {%- set column_override = model['config'].get('column_types', {}) -%}\n {%- set quote_seed_column = model['config'].get('quote_columns', None) -%}\n\n {% set sql %}\n create table {{ this.render() }} (\n {%- for col_name in agate_table.column_names -%}\n {%- set inferred_type = adapter.convert_type(agate_table, loop.index0) -%}\n {%- set type = column_override.get(col_name, inferred_type) -%}\n {%- set column_name = (col_name | string) -%}\n {{ adapter.quote_seed_column(column_name, quote_seed_column) }} {{ type }} {%- if not loop.last -%}, {%- endif -%}\n {%- endfor -%}\n )\n {% endset %}\n\n {% call statement('_') -%}\n {{ sql }}\n {%- endcall %}\n\n {{ return(sql) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "agate_table", "type": null, "description": ""}], "created_at": 1789422566.3936818, "supported_languages": null}, "macro.dbt.reset_csv_table": {"name": "reset_csv_table", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "unique_id": "macro.dbt.reset_csv_table", "macro_sql": "{% macro reset_csv_table(model, full_refresh, old_relation, agate_table) -%}\n {{ adapter.dispatch('reset_csv_table', 'dbt')(model, full_refresh, old_relation, agate_table) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__reset_csv_table"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "full_refresh", "type": null, "description": ""}, {"name": "old_relation", "type": null, "description": ""}, {"name": "agate_table", "type": null, "description": ""}], "created_at": 1789422566.394192, "supported_languages": null}, "macro.dbt.default__reset_csv_table": {"name": "default__reset_csv_table", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "unique_id": "macro.dbt.default__reset_csv_table", "macro_sql": "{% macro default__reset_csv_table(model, full_refresh, old_relation, agate_table) %}\n {% set sql = \"\" %}\n {% if full_refresh %}\n {{ adapter.drop_relation(old_relation) }}\n {% set sql = create_csv_table(model, agate_table) %}\n {% else %}\n {{ adapter.truncate_relation(old_relation) }}\n {% set sql = \"truncate table \" ~ old_relation.render() %}\n {% endif %}\n\n {{ return(sql) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.create_csv_table"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "full_refresh", "type": null, "description": ""}, {"name": "old_relation", "type": null, "description": ""}, {"name": "agate_table", "type": null, "description": ""}], "created_at": 1789422566.395229, "supported_languages": null}, "macro.dbt.get_csv_sql": {"name": "get_csv_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "unique_id": "macro.dbt.get_csv_sql", "macro_sql": "{% macro get_csv_sql(create_or_truncate_sql, insert_sql) %}\n {{ adapter.dispatch('get_csv_sql', 'dbt')(create_or_truncate_sql, insert_sql) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_csv_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "create_or_truncate_sql", "type": null, "description": ""}, {"name": "insert_sql", "type": null, "description": ""}], "created_at": 1789422566.3956826, "supported_languages": null}, "macro.dbt.default__get_csv_sql": {"name": "default__get_csv_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "unique_id": "macro.dbt.default__get_csv_sql", "macro_sql": "{% macro default__get_csv_sql(create_or_truncate_sql, insert_sql) %}\n {{ create_or_truncate_sql }};\n -- dbt seed --\n {{ insert_sql }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "create_or_truncate_sql", "type": null, "description": ""}, {"name": "insert_sql", "type": null, "description": ""}], "created_at": 1789422566.3959718, "supported_languages": null}, "macro.dbt.get_binding_char": {"name": "get_binding_char", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "unique_id": "macro.dbt.get_binding_char", "macro_sql": "{% macro get_binding_char() -%}\n {{ adapter.dispatch('get_binding_char', 'dbt')() }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_binding_char"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789422566.396269, "supported_languages": null}, "macro.dbt.default__get_binding_char": {"name": "default__get_binding_char", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "unique_id": "macro.dbt.default__get_binding_char", "macro_sql": "{% macro default__get_binding_char() %}\n {{ return('%s') }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789422566.3965125, "supported_languages": null}, "macro.dbt.get_batch_size": {"name": "get_batch_size", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "unique_id": "macro.dbt.get_batch_size", "macro_sql": "{% macro get_batch_size() -%}\n {{ return(adapter.dispatch('get_batch_size', 'dbt')()) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_batch_size"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789422566.3968668, "supported_languages": null}, "macro.dbt.default__get_batch_size": {"name": "default__get_batch_size", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "unique_id": "macro.dbt.default__get_batch_size", "macro_sql": "{% macro default__get_batch_size() %}\n {{ return(10000) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789422566.3971162, "supported_languages": null}, "macro.dbt.get_seed_column_quoted_csv": {"name": "get_seed_column_quoted_csv", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "unique_id": "macro.dbt.get_seed_column_quoted_csv", "macro_sql": "{% macro get_seed_column_quoted_csv(model, column_names) %}\n {%- set quote_seed_column = model['config'].get('quote_columns', None) -%}\n {% set quoted = [] %}\n {% for col in column_names -%}\n {%- do quoted.append(adapter.quote_seed_column(col, quote_seed_column)) -%}\n {%- endfor %}\n\n {%- set dest_cols_csv = quoted | join(', ') -%}\n {{ return(dest_cols_csv) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "column_names", "type": null, "description": ""}], "created_at": 1789422566.3981068, "supported_languages": null}, "macro.dbt.load_csv_rows": {"name": "load_csv_rows", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "unique_id": "macro.dbt.load_csv_rows", "macro_sql": "{% macro load_csv_rows(model, agate_table) -%}\n {{ adapter.dispatch('load_csv_rows', 'dbt')(model, agate_table) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__load_csv_rows"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "agate_table", "type": null, "description": ""}], "created_at": 1789422566.39849, "supported_languages": null}, "macro.dbt.default__load_csv_rows": {"name": "default__load_csv_rows", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "unique_id": "macro.dbt.default__load_csv_rows", "macro_sql": "{% macro default__load_csv_rows(model, agate_table) %}\n\n {% set batch_size = get_batch_size() %}\n\n {% set cols_sql = get_seed_column_quoted_csv(model, agate_table.column_names) %}\n {% set bindings = [] %}\n\n {% set statements = [] %}\n\n {% for chunk in agate_table.rows | batch(batch_size) %}\n {% set bindings = [] %}\n\n {% for row in chunk %}\n {% do bindings.extend(row) %}\n {% endfor %}\n\n {% set sql %}\n insert into {{ this.render() }} ({{ cols_sql }}) values\n {% for row in chunk -%}\n ({%- for column in agate_table.column_names -%}\n {{ get_binding_char() }}\n {%- if not loop.last%},{%- endif %}\n {%- endfor -%})\n {%- if not loop.last%},{%- endif %}\n {%- endfor %}\n {% endset %}\n\n {% do adapter.add_query(sql, bindings=bindings, abridge_sql_log=True) %}\n\n {% if loop.index0 == 0 %}\n {% do statements.append(sql) %}\n {% endif %}\n {% endfor %}\n\n {# Return SQL so we can render it out into the compiled files #}\n {{ return(statements[0]) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_batch_size", "macro.dbt.get_seed_column_quoted_csv", "macro.dbt.get_binding_char"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "agate_table", "type": null, "description": ""}], "created_at": 1789422566.4010775, "supported_languages": null}, "macro.dbt.materialization_unit_default": {"name": "materialization_unit_default", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/tests/unit.sql", "original_file_path": "macros/materializations/tests/unit.sql", "unique_id": "macro.dbt.materialization_unit_default", "macro_sql": "{%- materialization unit, default -%}\n\n {% set relations = [] %}\n {% set sql_header = config.get('sql_header') if flags.REQUIRE_SQL_HEADER_IN_TEST_CONFIGS else none %}\n\n {% set expected_rows = config.get('expected_rows') %}\n {% set expected_sql = config.get('expected_sql') %}\n {% set tested_expected_column_names = expected_rows[0].keys() if (expected_rows | length ) > 0 else get_columns_in_query(sql) %}\n\n {%- set target_relation = this.incorporate(type='table') -%}\n {%- set temp_relation = make_temp_relation(target_relation)-%}\n {% do run_query(get_create_table_as_sql(True, temp_relation, get_empty_subquery_sql(sql))) %}\n {%- set columns_in_relation = adapter.get_columns_in_relation(temp_relation) -%}\n {%- set column_name_to_data_types = {} -%}\n {%- set column_name_to_quoted = {} -%}\n {%- for column in columns_in_relation -%}\n {%- do column_name_to_data_types.update({column.name|lower: column.data_type}) -%}\n {%- do column_name_to_quoted.update({column.name|lower: column.quoted}) -%}\n {%- endfor -%}\n\n {%- set expected_column_names_quoted = [] -%}\n {%- for column_name in tested_expected_column_names -%}\n {%- do expected_column_names_quoted.append(column_name_to_quoted[column_name|lower]) -%}\n {%- endfor -%}\n\n {% if not expected_sql %}\n {% set expected_sql = get_expected_sql(expected_rows, column_name_to_data_types, column_name_to_quoted) %}\n {% endif %}\n {% set unit_test_sql = get_unit_test_sql(sql, expected_sql, expected_column_names_quoted) %}\n\n {% call statement('main', fetch_result=True) -%}\n\n {% if sql_header %}{{ sql_header }}{% endif %}\n {{ unit_test_sql }}\n\n {%- endcall %}\n\n {% do adapter.drop_relation(temp_relation) %}\n\n {{ return({'relations': relations}) }}\n\n{%- endmaterialization -%}", "depends_on": {"macros": ["macro.dbt.get_columns_in_query", "macro.dbt.make_temp_relation", "macro.dbt.run_query", "macro.dbt.get_create_table_as_sql", "macro.dbt.get_empty_subquery_sql", "macro.dbt.get_expected_sql", "macro.dbt.get_unit_test_sql", "macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "supported_languages", "type": null, "description": ""}], "created_at": 1789422566.4052465, "supported_languages": ["sql"]}, "macro.dbt.materialization_test_default": {"name": "materialization_test_default", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/tests/test.sql", "original_file_path": "macros/materializations/tests/test.sql", "unique_id": "macro.dbt.materialization_test_default", "macro_sql": "{%- materialization test, default -%}\n\n {% set relations = [] %}\n {% set limit = config.get('limit') %}\n {% set sql_header = config.get('sql_header') if flags.REQUIRE_SQL_HEADER_IN_TEST_CONFIGS else none %}\n\n {% set sql_with_limit %}\n {{ get_limit_subquery_sql(sql, limit) }}\n {% endset %}\n\n {% if should_store_failures() %}\n\n {% set identifier = model['alias'] %}\n {% set old_relation = adapter.get_relation(database=database, schema=schema, identifier=identifier) %}\n\n {% set store_failures_as = config.get('store_failures_as') %}\n -- if `--store-failures` is invoked via command line and `store_failures_as` is not set,\n -- config.get('store_failures_as', 'table') returns None, not 'table'\n {% if store_failures_as == none %}{% set store_failures_as = 'table' %}{% endif %}\n {% if store_failures_as not in ['table', 'view'] %}\n {{ exceptions.raise_compiler_error(\n \"'\" ~ store_failures_as ~ \"' is not a valid value for `store_failures_as`. \"\n \"Accepted values are: ['ephemeral', 'table', 'view']\"\n ) }}\n {% endif %}\n\n {% set target_relation = api.Relation.create(\n identifier=identifier, schema=schema, database=database, type=store_failures_as) -%} %}\n\n {% if old_relation %}\n {% do adapter.drop_relation(old_relation) %}\n {% endif %}\n\n {% call statement(auto_begin=True) %}\n {% if sql_header %}{{ sql_header }}{% endif %}\n {{ get_create_sql(target_relation, sql_with_limit) }}\n {% endcall %}\n\n {% do relations.append(target_relation) %}\n\n {# Since the test failures have already been saved to the database, reuse that result rather than querying again #}\n {% set main_sql %}\n select *\n from {{ target_relation }}\n {% endset %}\n\n {{ adapter.commit() }}\n\n {% else %}\n\n {% set main_sql = sql_with_limit %}\n\n {% endif %}\n\n {% set fail_calc = config.get('fail_calc') %}\n {% set warn_if = config.get('warn_if') %}\n {% set error_if = config.get('error_if') %}\n\n {% call statement('main', fetch_result=True) -%}\n\n {% if sql_header %}{{ sql_header }}{% endif %}\n {# The limit has already been included above, and we do not want to duplicate it again. We also want to be safe for macro overrides treating `limit` as a required parameter. #}\n {{ get_test_sql(main_sql, fail_calc, warn_if, error_if, limit=none)}}\n\n {%- endcall %}\n\n {{ return({'relations': relations}) }}\n\n{%- endmaterialization -%}", "depends_on": {"macros": ["macro.dbt.get_limit_subquery_sql", "macro.dbt.should_store_failures", "macro.dbt.statement", "macro.dbt.get_create_sql", "macro.dbt.get_test_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "supported_languages", "type": null, "description": ""}], "created_at": 1789422566.4104576, "supported_languages": ["sql"]}, "macro.dbt.get_test_sql": {"name": "get_test_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/tests/helpers.sql", "original_file_path": "macros/materializations/tests/helpers.sql", "unique_id": "macro.dbt.get_test_sql", "macro_sql": "{% macro get_test_sql(main_sql, fail_calc, warn_if, error_if, limit) -%}\n {{ adapter.dispatch('get_test_sql', 'dbt')(main_sql, fail_calc, warn_if, error_if, limit) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_test_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "main_sql", "type": null, "description": ""}, {"name": "fail_calc", "type": null, "description": ""}, {"name": "warn_if", "type": null, "description": ""}, {"name": "error_if", "type": null, "description": ""}, {"name": "limit", "type": null, "description": ""}], "created_at": 1789422566.4117005, "supported_languages": null}, "macro.dbt.default__get_test_sql": {"name": "default__get_test_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/tests/helpers.sql", "original_file_path": "macros/materializations/tests/helpers.sql", "unique_id": "macro.dbt.default__get_test_sql", "macro_sql": "{% macro default__get_test_sql(main_sql, fail_calc, warn_if, error_if, limit) -%}\n select\n {{ fail_calc }} as failures,\n {{ fail_calc }} {{ warn_if }} as should_warn,\n {{ fail_calc }} {{ error_if }} as should_error\n from (\n {{ main_sql }}\n {{ \"limit \" ~ limit if limit != none }}\n ) dbt_internal_test\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "main_sql", "type": null, "description": ""}, {"name": "fail_calc", "type": null, "description": ""}, {"name": "warn_if", "type": null, "description": ""}, {"name": "error_if", "type": null, "description": ""}, {"name": "limit", "type": null, "description": ""}], "created_at": 1789422566.4123914, "supported_languages": null}, "macro.dbt.get_unit_test_sql": {"name": "get_unit_test_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/tests/helpers.sql", "original_file_path": "macros/materializations/tests/helpers.sql", "unique_id": "macro.dbt.get_unit_test_sql", "macro_sql": "{% macro get_unit_test_sql(main_sql, expected_fixture_sql, expected_column_names) -%}\n {{ adapter.dispatch('get_unit_test_sql', 'dbt')(main_sql, expected_fixture_sql, expected_column_names) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_unit_test_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "main_sql", "type": null, "description": ""}, {"name": "expected_fixture_sql", "type": null, "description": ""}, {"name": "expected_column_names", "type": null, "description": ""}], "created_at": 1789422566.4128892, "supported_languages": null}, "macro.dbt.default__get_unit_test_sql": {"name": "default__get_unit_test_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/tests/helpers.sql", "original_file_path": "macros/materializations/tests/helpers.sql", "unique_id": "macro.dbt.default__get_unit_test_sql", "macro_sql": "{% macro default__get_unit_test_sql(main_sql, expected_fixture_sql, expected_column_names) -%}\n-- Build actual result given inputs\nwith dbt_internal_unit_test_actual as (\n select\n {% for expected_column_name in expected_column_names %}{{expected_column_name}}{% if not loop.last -%},{% endif %}{%- endfor -%}, {{ dbt.string_literal(\"actual\") }} as {{ adapter.quote(\"actual_or_expected\") }}\n from (\n {{ main_sql }}\n ) _dbt_internal_unit_test_actual\n),\n-- Build expected result\ndbt_internal_unit_test_expected as (\n select\n {% for expected_column_name in expected_column_names %}{{expected_column_name}}{% if not loop.last -%}, {% endif %}{%- endfor -%}, {{ dbt.string_literal(\"expected\") }} as {{ adapter.quote(\"actual_or_expected\") }}\n from (\n {{ expected_fixture_sql }}\n ) _dbt_internal_unit_test_expected\n)\n-- Union actual and expected results\nselect * from dbt_internal_unit_test_actual\nunion all\nselect * from dbt_internal_unit_test_expected\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.string_literal"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "main_sql", "type": null, "description": ""}, {"name": "expected_fixture_sql", "type": null, "description": ""}, {"name": "expected_column_names", "type": null, "description": ""}], "created_at": 1789422566.4142032, "supported_languages": null}, "macro.dbt.get_where_subquery": {"name": "get_where_subquery", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/tests/where_subquery.sql", "original_file_path": "macros/materializations/tests/where_subquery.sql", "unique_id": "macro.dbt.get_where_subquery", "macro_sql": "{% macro get_where_subquery(relation) -%}\n {% do return(adapter.dispatch('get_where_subquery', 'dbt')(relation)) %}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_where_subquery"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789422566.4149399, "supported_languages": null}, "macro.dbt.default__get_where_subquery": {"name": "default__get_where_subquery", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/tests/where_subquery.sql", "original_file_path": "macros/materializations/tests/where_subquery.sql", "unique_id": "macro.dbt.default__get_where_subquery", "macro_sql": "{% macro default__get_where_subquery(relation) -%}\n {% set where = config.get('where', '') %}\n {% if where %}\n {%- set filtered -%}\n (select * from {{ relation }} where {{ where }}) dbt_subquery\n {%- endset -%}\n {% do return(filtered) %}\n {%- else -%}\n {% do return(relation) %}\n {%- endif -%}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789422566.4157655, "supported_languages": null}, "macro.dbt.materialization_snapshot_default": {"name": "materialization_snapshot_default", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/snapshot.sql", "original_file_path": "macros/materializations/snapshots/snapshot.sql", "unique_id": "macro.dbt.materialization_snapshot_default", "macro_sql": "{% materialization snapshot, default %}\n\n {%- set target_table = model.get('alias', model.get('name')) -%}\n\n {%- set strategy_name = config.get('strategy') -%}\n {%- set unique_key = config.get('unique_key') %}\n -- grab current tables grants config for comparision later on\n {%- set grant_config = config.get('grants') -%}\n\n {% set target_relation_exists, target_relation = get_or_create_relation(\n database=model.database,\n schema=model.schema,\n identifier=target_table,\n type='table') -%}\n\n {%- if not target_relation.is_table -%}\n {% do exceptions.relation_wrong_type(target_relation, 'table') %}\n {%- endif -%}\n\n\n {{ run_hooks(pre_hooks, inside_transaction=False) }}\n\n {{ run_hooks(pre_hooks, inside_transaction=True) }}\n\n {% set strategy_macro = strategy_dispatch(strategy_name) %}\n {# The model['config'] parameter below is no longer used, but passing anyway for compatibility #}\n {# It was a dictionary of config, instead of the config object from the context #}\n {% set strategy = strategy_macro(model, \"snapshotted_data\", \"source_data\", model['config'], target_relation_exists) %}\n\n {% if not target_relation_exists %}\n\n {% set build_sql = build_snapshot_table(strategy, model['compiled_code']) %}\n {% set build_or_select_sql = build_sql %}\n {% set final_sql = create_table_as(False, target_relation, build_sql) %}\n\n {% else %}\n\n {% set columns = config.get(\"snapshot_table_column_names\") or get_snapshot_table_column_names() %}\n\n {{ adapter.assert_valid_snapshot_target_given_strategy(target_relation, columns, strategy) }}\n\n {% set build_or_select_sql = snapshot_staging_table(strategy, sql, target_relation) %}\n {% set staging_table = build_snapshot_staging_table(strategy, sql, target_relation) %}\n\n -- this may no-op if the database does not require column expansion\n {% do adapter.expand_target_column_types(from_relation=staging_table,\n to_relation=target_relation) %}\n\n {% set remove_columns = ['dbt_change_type', 'DBT_CHANGE_TYPE', 'dbt_unique_key', 'DBT_UNIQUE_KEY'] %}\n {% if unique_key | is_list %}\n {% for key in strategy.unique_key %}\n {{ remove_columns.append('dbt_unique_key_' + loop.index|string) }}\n {{ remove_columns.append('DBT_UNIQUE_KEY_' + loop.index|string) }}\n {% endfor %}\n {% endif %}\n\n {% set missing_columns = adapter.get_missing_columns(staging_table, target_relation)\n | rejectattr('name', 'in', remove_columns)\n | list %}\n\n {% do create_columns(target_relation, missing_columns) %}\n\n {% set source_columns = adapter.get_columns_in_relation(staging_table)\n | rejectattr('name', 'in', remove_columns)\n | list %}\n\n {% set quoted_source_columns = [] %}\n {% for column in source_columns %}\n {% do quoted_source_columns.append(adapter.quote(column.name)) %}\n {% endfor %}\n\n {% set final_sql = snapshot_merge_sql(\n target = target_relation,\n source = staging_table,\n insert_cols = quoted_source_columns\n )\n %}\n\n {% endif %}\n\n\n {{ check_time_data_types(build_or_select_sql) }}\n\n {% call statement('main') %}\n {{ final_sql }}\n {% endcall %}\n\n {% set should_revoke = should_revoke(target_relation_exists, full_refresh_mode=False) %}\n {% do apply_grants(target_relation, grant_config, should_revoke=should_revoke) %}\n\n {% do persist_docs(target_relation, model) %}\n\n {% if not target_relation_exists %}\n {% do create_indexes(target_relation) %}\n {% endif %}\n\n {{ run_hooks(post_hooks, inside_transaction=True) }}\n\n {{ adapter.commit() }}\n\n {% if staging_table is defined %}\n {% do post_snapshot(staging_table) %}\n {% endif %}\n\n {{ run_hooks(post_hooks, inside_transaction=False) }}\n\n {{ return({'relations': [target_relation]}) }}\n\n{% endmaterialization %}", "depends_on": {"macros": ["macro.dbt.get_or_create_relation", "macro.dbt.run_hooks", "macro.dbt.strategy_dispatch", "macro.dbt.build_snapshot_table", "macro.dbt.create_table_as", "macro.dbt.get_snapshot_table_column_names", "macro.dbt.snapshot_staging_table", "macro.dbt.build_snapshot_staging_table", "macro.dbt.create_columns", "macro.dbt.snapshot_merge_sql", "macro.dbt.check_time_data_types", "macro.dbt.statement", "macro.dbt.should_revoke", "macro.dbt.apply_grants", "macro.dbt.persist_docs", "macro.dbt.create_indexes", "macro.dbt.post_snapshot"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "supported_languages", "type": null, "description": ""}], "created_at": 1789422566.4240882, "supported_languages": ["sql"]}, "macro.dbt.strategy_dispatch": {"name": "strategy_dispatch", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/strategies.sql", "original_file_path": "macros/materializations/snapshots/strategies.sql", "unique_id": "macro.dbt.strategy_dispatch", "macro_sql": "{% macro strategy_dispatch(name) -%}\n{% set original_name = name %}\n {% if '.' in name %}\n {% set package_name, name = name.split(\".\", 1) %}\n {% else %}\n {% set package_name = none %}\n {% endif %}\n\n {% if package_name is none %}\n {% set package_context = context %}\n {% elif package_name in context %}\n {% set package_context = context[package_name] %}\n {% else %}\n {% set error_msg %}\n Could not find package '{{package_name}}', called with '{{original_name}}'\n {% endset %}\n {{ exceptions.raise_compiler_error(error_msg | trim) }}\n {% endif %}\n\n {%- set search_name = 'snapshot_' ~ name ~ '_strategy' -%}\n\n {% if search_name not in package_context %}\n {% set error_msg %}\n The specified strategy macro '{{name}}' was not found in package '{{ package_name }}'\n {% endset %}\n {{ exceptions.raise_compiler_error(error_msg | trim) }}\n {% endif %}\n {{ return(package_context[search_name]) }}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "name", "type": null, "description": ""}], "created_at": 1789422566.42838, "supported_languages": null}, "macro.dbt.snapshot_hash_arguments": {"name": "snapshot_hash_arguments", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/strategies.sql", "original_file_path": "macros/materializations/snapshots/strategies.sql", "unique_id": "macro.dbt.snapshot_hash_arguments", "macro_sql": "{% macro snapshot_hash_arguments(args) -%}\n {{ adapter.dispatch('snapshot_hash_arguments', 'dbt')(args) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__snapshot_hash_arguments"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "args", "type": null, "description": ""}], "created_at": 1789422566.4288304, "supported_languages": null}, "macro.dbt.default__snapshot_hash_arguments": {"name": "default__snapshot_hash_arguments", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/strategies.sql", "original_file_path": "macros/materializations/snapshots/strategies.sql", "unique_id": "macro.dbt.default__snapshot_hash_arguments", "macro_sql": "{% macro default__snapshot_hash_arguments(args) -%}\n md5({%- for arg in args -%}\n coalesce(cast({{ arg }} as varchar ), '')\n {% if not loop.last %} || '|' || {% endif %}\n {%- endfor -%})\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "args", "type": null, "description": ""}], "created_at": 1789422566.429323, "supported_languages": null}, "macro.dbt.snapshot_timestamp_strategy": {"name": "snapshot_timestamp_strategy", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/strategies.sql", "original_file_path": "macros/materializations/snapshots/strategies.sql", "unique_id": "macro.dbt.snapshot_timestamp_strategy", "macro_sql": "{% macro snapshot_timestamp_strategy(node, snapshotted_rel, current_rel, model_config, target_exists) %}\n {# The model_config parameter is no longer used, but is passed in anyway for compatibility. #}\n {% set primary_key = config.get('unique_key') %}\n {% set updated_at = config.get('updated_at') %}\n {% set hard_deletes = adapter.get_hard_deletes_behavior(config) %}\n {% set invalidate_hard_deletes = hard_deletes == 'invalidate' %}\n {% set columns = config.get(\"snapshot_table_column_names\") or get_snapshot_table_column_names() %}\n\n {#/*\n The snapshot relation might not have an {{ updated_at }} value if the\n snapshot strategy is changed from `check` to `timestamp`. We\n should use a dbt-created column for the comparison in the snapshot\n table instead of assuming that the user-supplied {{ updated_at }}\n will be present in the historical data.\n\n See https://github.com/dbt-labs/dbt-core/issues/2350\n */ #}\n {% set row_changed_expr -%}\n ({{ snapshotted_rel }}.{{ columns.dbt_valid_from }} < {{ current_rel }}.{{ updated_at }})\n {%- endset %}\n\n {% set scd_args = api.Relation.scd_args(primary_key, updated_at) %}\n {% set scd_id_expr = snapshot_hash_arguments(scd_args) %}\n\n {% do return({\n \"unique_key\": primary_key,\n \"updated_at\": updated_at,\n \"row_changed\": row_changed_expr,\n \"scd_id\": scd_id_expr,\n \"invalidate_hard_deletes\": invalidate_hard_deletes,\n \"hard_deletes\": hard_deletes\n }) %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_snapshot_table_column_names", "macro.dbt.snapshot_hash_arguments"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "node", "type": null, "description": ""}, {"name": "snapshotted_rel", "type": null, "description": ""}, {"name": "current_rel", "type": null, "description": ""}, {"name": "model_config", "type": null, "description": ""}, {"name": "target_exists", "type": null, "description": ""}], "created_at": 1789422566.4313323, "supported_languages": null}, "macro.dbt.snapshot_string_as_time": {"name": "snapshot_string_as_time", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/strategies.sql", "original_file_path": "macros/materializations/snapshots/strategies.sql", "unique_id": "macro.dbt.snapshot_string_as_time", "macro_sql": "{% macro snapshot_string_as_time(timestamp) -%}\n {{ adapter.dispatch('snapshot_string_as_time', 'dbt')(timestamp) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__snapshot_string_as_time"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "timestamp", "type": null, "description": ""}], "created_at": 1789422566.4317546, "supported_languages": null}, "macro.dbt.default__snapshot_string_as_time": {"name": "default__snapshot_string_as_time", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/strategies.sql", "original_file_path": "macros/materializations/snapshots/strategies.sql", "unique_id": "macro.dbt.default__snapshot_string_as_time", "macro_sql": "{% macro default__snapshot_string_as_time(timestamp) %}\n {% do exceptions.raise_not_implemented(\n 'snapshot_string_as_time macro not implemented for adapter '+adapter.type()\n ) %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "timestamp", "type": null, "description": ""}], "created_at": 1789422566.4321177, "supported_languages": null}, "macro.dbt.snapshot_check_all_get_existing_columns": {"name": "snapshot_check_all_get_existing_columns", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/strategies.sql", "original_file_path": "macros/materializations/snapshots/strategies.sql", "unique_id": "macro.dbt.snapshot_check_all_get_existing_columns", "macro_sql": "{% macro snapshot_check_all_get_existing_columns(node, target_exists, check_cols_config) -%}\n {%- if not target_exists -%}\n {#-- no table yet -> return whatever the query does --#}\n {{ return((false, query_columns)) }}\n {%- endif -%}\n\n {#-- handle any schema changes --#}\n {%- set target_relation = adapter.get_relation(database=node.database, schema=node.schema, identifier=node.alias) -%}\n\n {% if check_cols_config == 'all' %}\n {%- set query_columns = get_columns_in_query(node['compiled_code']) -%}\n\n {% elif check_cols_config is iterable and (check_cols_config | length) > 0 %}\n {#-- query for proper casing/quoting, to support comparison below --#}\n {%- set select_check_cols_from_target -%}\n {#-- N.B. The whitespace below is necessary to avoid edge case issue with comments --#}\n {#-- See: https://github.com/dbt-labs/dbt-core/issues/6781 --#}\n select {{ check_cols_config | join(', ') }} from (\n {{ node['compiled_code'] }}\n ) subq\n {%- endset -%}\n {% set query_columns = get_columns_in_query(select_check_cols_from_target) %}\n\n {% else %}\n {% do exceptions.raise_compiler_error(\"Invalid value for 'check_cols': \" ~ check_cols_config) %}\n {% endif %}\n\n {%- set existing_cols = adapter.get_columns_in_relation(target_relation) | map(attribute = 'name') | list -%}\n {%- set ns = namespace() -%} {#-- handle for-loop scoping with a namespace --#}\n {%- set ns.column_added = false -%}\n\n {%- set intersection = [] -%}\n {%- for col in query_columns -%}\n {%- if col in existing_cols -%}\n {%- do intersection.append(adapter.quote(col)) -%}\n {%- else -%}\n {% set ns.column_added = true %}\n {%- endif -%}\n {%- endfor -%}\n {{ return((ns.column_added, intersection)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.get_columns_in_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "node", "type": null, "description": ""}, {"name": "target_exists", "type": null, "description": ""}, {"name": "check_cols_config", "type": null, "description": ""}], "created_at": 1789422566.4349904, "supported_languages": null}, "macro.dbt.snapshot_check_strategy": {"name": "snapshot_check_strategy", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/strategies.sql", "original_file_path": "macros/materializations/snapshots/strategies.sql", "unique_id": "macro.dbt.snapshot_check_strategy", "macro_sql": "{% macro snapshot_check_strategy(node, snapshotted_rel, current_rel, model_config, target_exists) %}\n {# The model_config parameter is no longer used, but is passed in anyway for compatibility. #}\n {% set check_cols_config = config.get('check_cols') %}\n {% set primary_key = config.get('unique_key') %}\n {% set hard_deletes = adapter.get_hard_deletes_behavior(config) %}\n {% set invalidate_hard_deletes = hard_deletes == 'invalidate' %}\n {% set updated_at = config.get('updated_at') or snapshot_get_time() %}\n\n {% set column_added = false %}\n\n {% set column_added, check_cols = snapshot_check_all_get_existing_columns(node, target_exists, check_cols_config) %}\n\n {%- set row_changed_expr -%}\n (\n {%- if column_added -%}\n {{ get_true_sql() }}\n {%- else -%}\n {%- for col in check_cols -%}\n {{ snapshotted_rel }}.{{ col }} != {{ current_rel }}.{{ col }}\n or\n (\n (({{ snapshotted_rel }}.{{ col }} is null) and not ({{ current_rel }}.{{ col }} is null))\n or\n ((not {{ snapshotted_rel }}.{{ col }} is null) and ({{ current_rel }}.{{ col }} is null))\n )\n {%- if not loop.last %} or {% endif -%}\n {%- endfor -%}\n {%- endif -%}\n )\n {%- endset %}\n\n {% set scd_args = api.Relation.scd_args(primary_key, updated_at) %}\n {% set scd_id_expr = snapshot_hash_arguments(scd_args) %}\n\n {% do return({\n \"unique_key\": primary_key,\n \"updated_at\": updated_at,\n \"row_changed\": row_changed_expr,\n \"scd_id\": scd_id_expr,\n \"invalidate_hard_deletes\": invalidate_hard_deletes,\n \"hard_deletes\": hard_deletes\n }) %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.snapshot_get_time", "macro.dbt.snapshot_check_all_get_existing_columns", "macro.dbt.get_true_sql", "macro.dbt.snapshot_hash_arguments"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "node", "type": null, "description": ""}, {"name": "snapshotted_rel", "type": null, "description": ""}, {"name": "current_rel", "type": null, "description": ""}, {"name": "model_config", "type": null, "description": ""}, {"name": "target_exists", "type": null, "description": ""}], "created_at": 1789422566.438158, "supported_languages": null}, "macro.dbt.snapshot_merge_sql": {"name": "snapshot_merge_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/snapshot_merge.sql", "original_file_path": "macros/materializations/snapshots/snapshot_merge.sql", "unique_id": "macro.dbt.snapshot_merge_sql", "macro_sql": "{% macro snapshot_merge_sql(target, source, insert_cols) -%}\n {{ adapter.dispatch('snapshot_merge_sql', 'dbt')(target, source, insert_cols) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__snapshot_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "target", "type": null, "description": ""}, {"name": "source", "type": null, "description": ""}, {"name": "insert_cols", "type": null, "description": ""}], "created_at": 1789422566.439094, "supported_languages": null}, "macro.dbt.default__snapshot_merge_sql": {"name": "default__snapshot_merge_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/snapshot_merge.sql", "original_file_path": "macros/materializations/snapshots/snapshot_merge.sql", "unique_id": "macro.dbt.default__snapshot_merge_sql", "macro_sql": "{% macro default__snapshot_merge_sql(target, source, insert_cols) -%}\n {%- set insert_cols_csv = insert_cols | join(', ') -%}\n\n {%- set columns = config.get(\"snapshot_table_column_names\") or get_snapshot_table_column_names() -%}\n\n merge into {{ target.render() }} as DBT_INTERNAL_DEST\n using {{ source }} as DBT_INTERNAL_SOURCE\n on DBT_INTERNAL_SOURCE.{{ columns.dbt_scd_id }} = DBT_INTERNAL_DEST.{{ columns.dbt_scd_id }}\n\n when matched\n {% if config.get(\"dbt_valid_to_current\") %}\n\t{% set source_unique_key = (\"DBT_INTERNAL_DEST.\" ~ columns.dbt_valid_to) | trim %}\n\t{% set target_unique_key = config.get('dbt_valid_to_current') | trim %}\n\tand ({{ equals(source_unique_key, target_unique_key) }} or {{ source_unique_key }} is null)\n\n {% else %}\n and DBT_INTERNAL_DEST.{{ columns.dbt_valid_to }} is null\n {% endif %}\n and DBT_INTERNAL_SOURCE.dbt_change_type in ('update', 'delete')\n then update\n set {{ columns.dbt_valid_to }} = DBT_INTERNAL_SOURCE.{{ columns.dbt_valid_to }}\n\n when not matched\n and DBT_INTERNAL_SOURCE.dbt_change_type = 'insert'\n then insert ({{ insert_cols_csv }})\n values ({{ insert_cols_csv }})\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_snapshot_table_column_names", "macro.dbt.equals"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "target", "type": null, "description": ""}, {"name": "source", "type": null, "description": ""}, {"name": "insert_cols", "type": null, "description": ""}], "created_at": 1789422566.440812, "supported_languages": null}, "macro.dbt.create_columns": {"name": "create_columns", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "unique_id": "macro.dbt.create_columns", "macro_sql": "{% macro create_columns(relation, columns) %}\n {{ adapter.dispatch('create_columns', 'dbt')(relation, columns) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__create_columns"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "columns", "type": null, "description": ""}], "created_at": 1789422566.445017, "supported_languages": null}, "macro.dbt.default__create_columns": {"name": "default__create_columns", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "unique_id": "macro.dbt.default__create_columns", "macro_sql": "{% macro default__create_columns(relation, columns) %}\n {% for column in columns %}\n {% call statement() %}\n alter table {{ relation.render() }} add column {{ adapter.quote(column.name) }} {{ column.expanded_data_type }};\n {% endcall %}\n {% endfor %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "columns", "type": null, "description": ""}], "created_at": 1789422566.445764, "supported_languages": null}, "macro.dbt.post_snapshot": {"name": "post_snapshot", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "unique_id": "macro.dbt.post_snapshot", "macro_sql": "{% macro post_snapshot(staging_relation) %}\n {{ adapter.dispatch('post_snapshot', 'dbt')(staging_relation) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__post_snapshot"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "staging_relation", "type": null, "description": ""}], "created_at": 1789422566.4461465, "supported_languages": null}, "macro.dbt.default__post_snapshot": {"name": "default__post_snapshot", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "unique_id": "macro.dbt.default__post_snapshot", "macro_sql": "{% macro default__post_snapshot(staging_relation) %}\n {# no-op #}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "staging_relation", "type": null, "description": ""}], "created_at": 1789422566.4463596, "supported_languages": null}, "macro.dbt.get_true_sql": {"name": "get_true_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "unique_id": "macro.dbt.get_true_sql", "macro_sql": "{% macro get_true_sql() %}\n {{ adapter.dispatch('get_true_sql', 'dbt')() }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_true_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789422566.4467065, "supported_languages": null}, "macro.dbt.default__get_true_sql": {"name": "default__get_true_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "unique_id": "macro.dbt.default__get_true_sql", "macro_sql": "{% macro default__get_true_sql() %}\n {{ return('TRUE') }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789422566.446969, "supported_languages": null}, "macro.dbt.snapshot_staging_table": {"name": "snapshot_staging_table", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "unique_id": "macro.dbt.snapshot_staging_table", "macro_sql": "{% macro snapshot_staging_table(strategy, source_sql, target_relation) -%}\n {{ adapter.dispatch('snapshot_staging_table', 'dbt')(strategy, source_sql, target_relation) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__snapshot_staging_table"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "strategy", "type": null, "description": ""}, {"name": "source_sql", "type": null, "description": ""}, {"name": "target_relation", "type": null, "description": ""}], "created_at": 1789422566.4473934, "supported_languages": null}, "macro.dbt.get_snapshot_table_column_names": {"name": "get_snapshot_table_column_names", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "unique_id": "macro.dbt.get_snapshot_table_column_names", "macro_sql": "{% macro get_snapshot_table_column_names() %}\n {{ return({'dbt_valid_to': 'dbt_valid_to', 'dbt_valid_from': 'dbt_valid_from', 'dbt_scd_id': 'dbt_scd_id', 'dbt_updated_at': 'dbt_updated_at', 'dbt_is_deleted': 'dbt_is_deleted'}) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789422566.4479334, "supported_languages": null}, "macro.dbt.default__snapshot_staging_table": {"name": "default__snapshot_staging_table", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "unique_id": "macro.dbt.default__snapshot_staging_table", "macro_sql": "{% macro default__snapshot_staging_table(strategy, source_sql, target_relation) -%}\n {% set columns = config.get('snapshot_table_column_names') or get_snapshot_table_column_names() %}\n {% if strategy.hard_deletes == 'new_record' %}\n {% set new_scd_id = snapshot_hash_arguments([columns.dbt_scd_id, snapshot_get_time()]) %}\n {% endif %}\n with snapshot_query as (\n\n {{ source_sql }}\n\n ),\n\n snapshotted_data as (\n\n select *, {{ unique_key_fields(strategy.unique_key) }}\n from {{ target_relation }}\n where\n {% if config.get('dbt_valid_to_current') %}\n\t\t{% set source_unique_key = columns.dbt_valid_to | trim %}\n\t\t{% set target_unique_key = config.get('dbt_valid_to_current') | trim %}\n\n\t\t{# The exact equals semantics between NULL values depends on the current behavior flag set. Also, update records if the source field is null #}\n ( {{ equals(source_unique_key, target_unique_key) }} or {{ source_unique_key }} is null )\n {% else %}\n {{ columns.dbt_valid_to }} is null\n {% endif %}\n\n ),\n\n insertions_source_data as (\n\n select *, {{ unique_key_fields(strategy.unique_key) }},\n {{ strategy.updated_at }} as {{ columns.dbt_updated_at }},\n {{ strategy.updated_at }} as {{ columns.dbt_valid_from }},\n {{ get_dbt_valid_to_current(strategy, columns) }},\n {{ strategy.scd_id }} as {{ columns.dbt_scd_id }}\n\n from snapshot_query\n ),\n\n updates_source_data as (\n\n select *, {{ unique_key_fields(strategy.unique_key) }},\n {{ strategy.updated_at }} as {{ columns.dbt_updated_at }},\n {{ strategy.updated_at }} as {{ columns.dbt_valid_from }},\n {{ strategy.updated_at }} as {{ columns.dbt_valid_to }}\n\n from snapshot_query\n ),\n\n {%- if strategy.hard_deletes == 'invalidate' or strategy.hard_deletes == 'new_record' %}\n\n deletes_source_data as (\n\n select *, {{ unique_key_fields(strategy.unique_key) }}\n from snapshot_query\n ),\n {% endif %}\n\n insertions as (\n\n select\n 'insert' as dbt_change_type,\n source_data.*\n {%- if strategy.hard_deletes == 'new_record' -%}\n ,'False' as {{ columns.dbt_is_deleted }}\n {%- endif %}\n\n from insertions_source_data as source_data\n left outer join snapshotted_data\n on {{ unique_key_join_on(strategy.unique_key, \"snapshotted_data\", \"source_data\") }}\n where {{ unique_key_is_null(strategy.unique_key, \"snapshotted_data\") }}\n or ({{ unique_key_is_not_null(strategy.unique_key, \"snapshotted_data\") }} and (\n {{ strategy.row_changed }} {%- if strategy.hard_deletes == 'new_record' -%} or snapshotted_data.{{ columns.dbt_is_deleted }} = 'True' {% endif %}\n )\n\n )\n\n ),\n\n updates as (\n\n select\n 'update' as dbt_change_type,\n source_data.*,\n snapshotted_data.{{ columns.dbt_scd_id }}\n {%- if strategy.hard_deletes == 'new_record' -%}\n , snapshotted_data.{{ columns.dbt_is_deleted }}\n {%- endif %}\n\n from updates_source_data as source_data\n join snapshotted_data\n on {{ unique_key_join_on(strategy.unique_key, \"snapshotted_data\", \"source_data\") }}\n where (\n {{ strategy.row_changed }} {%- if strategy.hard_deletes == 'new_record' -%} or snapshotted_data.{{ columns.dbt_is_deleted }} = 'True' {% endif %}\n )\n )\n\n {%- if strategy.hard_deletes == 'invalidate' or strategy.hard_deletes == 'new_record' %}\n ,\n deletes as (\n\n select\n 'delete' as dbt_change_type,\n source_data.*,\n {{ snapshot_get_time() }} as {{ columns.dbt_valid_from }},\n {{ snapshot_get_time() }} as {{ columns.dbt_updated_at }},\n {{ snapshot_get_time() }} as {{ columns.dbt_valid_to }},\n snapshotted_data.{{ columns.dbt_scd_id }}\n {%- if strategy.hard_deletes == 'new_record' -%}\n , snapshotted_data.{{ columns.dbt_is_deleted }}\n {%- endif %}\n from snapshotted_data\n left join deletes_source_data as source_data\n on {{ unique_key_join_on(strategy.unique_key, \"snapshotted_data\", \"source_data\") }}\n where {{ unique_key_is_null(strategy.unique_key, \"source_data\") }}\n\n {%- if strategy.hard_deletes == 'new_record' %}\n and not (\n --avoid updating the record's valid_to if the latest entry is marked as deleted\n snapshotted_data.{{ columns.dbt_is_deleted }} = 'True'\n and\n {% if config.get('dbt_valid_to_current') -%}\n snapshotted_data.{{ columns.dbt_valid_to }} = {{ config.get('dbt_valid_to_current') }}\n {%- else -%}\n snapshotted_data.{{ columns.dbt_valid_to }} is null\n {%- endif %}\n )\n {%- endif %}\n )\n {%- endif %}\n\n {%- if strategy.hard_deletes == 'new_record' %}\n {% set snapshotted_cols = get_list_of_column_names(get_columns_in_relation(target_relation)) %}\n {% set source_col_names = get_columns_in_query(source_sql) %}\n ,\n deletion_records as (\n\n select\n 'insert' as dbt_change_type,\n {%- for col_name in source_col_names -%}\n {%- if col_name in snapshotted_cols -%}\n snapshotted_data.{{ adapter.quote(col_name) }},\n {%- else -%}\n source_data.{{ adapter.quote(col_name) }},\n {%- endif -%}\n {% endfor -%}\n {%- if strategy.unique_key | is_list -%}\n {%- for key in strategy.unique_key -%}\n snapshotted_data.{{ key }} as dbt_unique_key_{{ loop.index }},\n {% endfor -%}\n {%- else -%}\n snapshotted_data.dbt_unique_key as dbt_unique_key,\n {% endif -%}\n {{ snapshot_get_time() }} as {{ columns.dbt_valid_from }},\n {{ snapshot_get_time() }} as {{ columns.dbt_updated_at }},\n snapshotted_data.{{ columns.dbt_valid_to }} as {{ columns.dbt_valid_to }},\n {{ new_scd_id }} as {{ columns.dbt_scd_id }},\n 'True' as {{ columns.dbt_is_deleted }}\n from snapshotted_data\n left join deletes_source_data as source_data\n on {{ unique_key_join_on(strategy.unique_key, \"snapshotted_data\", \"source_data\") }}\n where {{ unique_key_is_null(strategy.unique_key, \"source_data\") }}\n and not (\n --avoid inserting a new record if the latest one is marked as deleted\n snapshotted_data.{{ columns.dbt_is_deleted }} = 'True'\n and\n {% if config.get('dbt_valid_to_current') -%}\n snapshotted_data.{{ columns.dbt_valid_to }} = {{ config.get('dbt_valid_to_current') }}\n {%- else -%}\n snapshotted_data.{{ columns.dbt_valid_to }} is null\n {%- endif %}\n )\n\n )\n {%- endif %}\n\n select * from insertions\n union all\n select * from updates\n {%- if strategy.hard_deletes == 'invalidate' or strategy.hard_deletes == 'new_record' %}\n union all\n select * from deletes\n {%- endif %}\n {%- if strategy.hard_deletes == 'new_record' %}\n union all\n select * from deletion_records\n {%- endif %}\n\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.get_snapshot_table_column_names", "macro.dbt.snapshot_hash_arguments", "macro.dbt.snapshot_get_time", "macro.dbt.unique_key_fields", "macro.dbt.equals", "macro.dbt.get_dbt_valid_to_current", "macro.dbt.unique_key_join_on", "macro.dbt.unique_key_is_null", "macro.dbt.unique_key_is_not_null", "macro.dbt.get_list_of_column_names", "macro.dbt.get_columns_in_relation", "macro.dbt.get_columns_in_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "strategy", "type": null, "description": ""}, {"name": "source_sql", "type": null, "description": ""}, {"name": "target_relation", "type": null, "description": ""}], "created_at": 1789422566.4569213, "supported_languages": null}, "macro.dbt.build_snapshot_table": {"name": "build_snapshot_table", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "unique_id": "macro.dbt.build_snapshot_table", "macro_sql": "{% macro build_snapshot_table(strategy, sql) -%}\n {{ adapter.dispatch('build_snapshot_table', 'dbt')(strategy, sql) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__build_snapshot_table"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "strategy", "type": null, "description": ""}, {"name": "sql", "type": null, "description": ""}], "created_at": 1789422566.457362, "supported_languages": null}, "macro.dbt.default__build_snapshot_table": {"name": "default__build_snapshot_table", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "unique_id": "macro.dbt.default__build_snapshot_table", "macro_sql": "{% macro default__build_snapshot_table(strategy, sql) %}\n {% set columns = config.get('snapshot_table_column_names') or get_snapshot_table_column_names() %}\n\n select *,\n {{ strategy.scd_id }} as {{ columns.dbt_scd_id }},\n {{ strategy.updated_at }} as {{ columns.dbt_updated_at }},\n {{ strategy.updated_at }} as {{ columns.dbt_valid_from }},\n {{ get_dbt_valid_to_current(strategy, columns) }}\n {%- if strategy.hard_deletes == 'new_record' -%}\n , 'False' as {{ columns.dbt_is_deleted }}\n {% endif -%}\n from (\n {{ sql }}\n ) sbq\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_snapshot_table_column_names", "macro.dbt.get_dbt_valid_to_current"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "strategy", "type": null, "description": ""}, {"name": "sql", "type": null, "description": ""}], "created_at": 1789422566.4584165, "supported_languages": null}, "macro.dbt.build_snapshot_staging_table": {"name": "build_snapshot_staging_table", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "unique_id": "macro.dbt.build_snapshot_staging_table", "macro_sql": "{% macro build_snapshot_staging_table(strategy, sql, target_relation) %}\n {% set temp_relation = make_temp_relation(target_relation) %}\n\n {% set select = snapshot_staging_table(strategy, sql, target_relation) %}\n\n {% call statement('build_snapshot_staging_relation') %}\n {{ create_table_as(True, temp_relation, select) }}\n {% endcall %}\n\n {% do return(temp_relation) %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.make_temp_relation", "macro.dbt.snapshot_staging_table", "macro.dbt.statement", "macro.dbt.create_table_as"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "strategy", "type": null, "description": ""}, {"name": "sql", "type": null, "description": ""}, {"name": "target_relation", "type": null, "description": ""}], "created_at": 1789422566.459296, "supported_languages": null}, "macro.dbt.get_updated_at_column_data_type": {"name": "get_updated_at_column_data_type", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "unique_id": "macro.dbt.get_updated_at_column_data_type", "macro_sql": "{% macro get_updated_at_column_data_type(snapshot_sql) %}\n {% set snapshot_sql_column_schema = get_column_schema_from_query(snapshot_sql) %}\n {% set dbt_updated_at_data_type = null %}\n {% set ns = namespace() -%} {#-- handle for-loop scoping with a namespace --#}\n {% set ns.dbt_updated_at_data_type = null -%}\n {% for column in snapshot_sql_column_schema %}\n {% if ((column.column == 'dbt_updated_at') or (column.column == 'DBT_UPDATED_AT')) %}\n {% set ns.dbt_updated_at_data_type = column.dtype %}\n {% endif %}\n {% endfor %}\n {{ return(ns.dbt_updated_at_data_type or none) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_column_schema_from_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "snapshot_sql", "type": null, "description": ""}], "created_at": 1789422566.4605103, "supported_languages": null}, "macro.dbt.check_time_data_types": {"name": "check_time_data_types", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "unique_id": "macro.dbt.check_time_data_types", "macro_sql": "{% macro check_time_data_types(sql) %}\n {% set dbt_updated_at_data_type = get_updated_at_column_data_type(sql) %}\n {% set snapshot_get_time_data_type = get_snapshot_get_time_data_type() %}\n {% if snapshot_get_time_data_type is not none and dbt_updated_at_data_type is not none and snapshot_get_time_data_type != dbt_updated_at_data_type %}\n {% if exceptions.warn_snapshot_timestamp_data_types %}\n {{ exceptions.warn_snapshot_timestamp_data_types(snapshot_get_time_data_type, dbt_updated_at_data_type) }}\n {% endif %}\n {% endif %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_updated_at_column_data_type", "macro.dbt.get_snapshot_get_time_data_type"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "sql", "type": null, "description": ""}], "created_at": 1789422566.4613829, "supported_languages": null}, "macro.dbt.get_dbt_valid_to_current": {"name": "get_dbt_valid_to_current", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "unique_id": "macro.dbt.get_dbt_valid_to_current", "macro_sql": "{% macro get_dbt_valid_to_current(strategy, columns) %}\n {% set dbt_valid_to_current = config.get('dbt_valid_to_current') or \"null\" %}\n coalesce(nullif({{ strategy.updated_at }}, {{ strategy.updated_at }}), {{dbt_valid_to_current}})\n as {{ columns.dbt_valid_to }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "strategy", "type": null, "description": ""}, {"name": "columns", "type": null, "description": ""}], "created_at": 1789422566.4619863, "supported_languages": null}, "macro.dbt.unique_key_fields": {"name": "unique_key_fields", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "unique_id": "macro.dbt.unique_key_fields", "macro_sql": "{% macro unique_key_fields(unique_key) %}\n {% if unique_key | is_list %}\n {% for key in unique_key %}\n {{ key }} as dbt_unique_key_{{ loop.index }}\n {%- if not loop.last %} , {%- endif %}\n {% endfor %}\n {% else %}\n {{ unique_key }} as dbt_unique_key\n {% endif %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "unique_key", "type": null, "description": ""}], "created_at": 1789422566.4627075, "supported_languages": null}, "macro.dbt.unique_key_join_on": {"name": "unique_key_join_on", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "unique_id": "macro.dbt.unique_key_join_on", "macro_sql": "{% macro unique_key_join_on(unique_key, identifier, from_identifier) %}\n {% if unique_key | is_list %}\n {% for key in unique_key %}\n\t {% set source_unique_key = (identifier ~ \".dbt_unique_key_\" ~ loop.index) | trim %}\n\t {% set target_unique_key = (from_identifier ~ \".dbt_unique_key_\" ~ loop.index) | trim %}\n\t {{ equals(source_unique_key, target_unique_key) }}\n {%- if not loop.last %} and {%- endif %}\n {% endfor %}\n {% else %}\n {{ identifier }}.dbt_unique_key = {{ from_identifier }}.dbt_unique_key\n {% endif %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.equals"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "unique_key", "type": null, "description": ""}, {"name": "identifier", "type": null, "description": ""}, {"name": "from_identifier", "type": null, "description": ""}], "created_at": 1789422566.4638612, "supported_languages": null}, "macro.dbt.unique_key_is_null": {"name": "unique_key_is_null", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "unique_id": "macro.dbt.unique_key_is_null", "macro_sql": "{% macro unique_key_is_null(unique_key, identifier) %}\n {% if unique_key | is_list %}\n {{ identifier }}.dbt_unique_key_1 is null\n {% else %}\n {{ identifier }}.dbt_unique_key is null\n {% endif %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "unique_key", "type": null, "description": ""}, {"name": "identifier", "type": null, "description": ""}], "created_at": 1789422566.4642923, "supported_languages": null}, "macro.dbt.unique_key_is_not_null": {"name": "unique_key_is_not_null", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "unique_id": "macro.dbt.unique_key_is_not_null", "macro_sql": "{% macro unique_key_is_not_null(unique_key, identifier) %}\n {% if unique_key | is_list %}\n {{ identifier }}.dbt_unique_key_1 is not null\n {% else %}\n {{ identifier }}.dbt_unique_key is not null\n {% endif %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "unique_key", "type": null, "description": ""}, {"name": "identifier", "type": null, "description": ""}], "created_at": 1789422566.4648025, "supported_languages": null}, "macro.dbt.get_aggregate_function_create_replace_signature": {"name": "get_aggregate_function_create_replace_signature", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/functions/aggregate.sql", "original_file_path": "macros/materializations/functions/aggregate.sql", "unique_id": "macro.dbt.get_aggregate_function_create_replace_signature", "macro_sql": "{% macro get_aggregate_function_create_replace_signature(target_relation) %}\n {{ return(adapter.dispatch('get_aggregate_function_create_replace_signature', 'dbt')(target_relation)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_aggregate_function_create_replace_signature"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "target_relation", "type": null, "description": ""}], "created_at": 1789422566.4662585, "supported_languages": null}, "macro.dbt.default__get_aggregate_function_create_replace_signature": {"name": "default__get_aggregate_function_create_replace_signature", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/functions/aggregate.sql", "original_file_path": "macros/materializations/functions/aggregate.sql", "unique_id": "macro.dbt.default__get_aggregate_function_create_replace_signature", "macro_sql": "{% macro default__get_aggregate_function_create_replace_signature(target_relation) %}\n CREATE OR REPLACE AGGREGATE FUNCTION {{ target_relation.render() }} ({{ get_formatted_aggregate_function_args()}})\n RETURNS {{ model.returns.data_type }}\n {{ get_function_language_specifier() }}\n {{ get_aggregate_function_volatility_specifier() }}\n {% if model.get('language') == 'python' %}\n {{ get_function_python_options() }}\n {% endif %}\n AS\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_formatted_aggregate_function_args", "macro.dbt.get_function_language_specifier", "macro.dbt.get_aggregate_function_volatility_specifier", "macro.dbt.get_function_python_options"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "target_relation", "type": null, "description": ""}], "created_at": 1789422566.4670286, "supported_languages": null}, "macro.dbt.get_formatted_aggregate_function_args": {"name": "get_formatted_aggregate_function_args", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/functions/aggregate.sql", "original_file_path": "macros/materializations/functions/aggregate.sql", "unique_id": "macro.dbt.get_formatted_aggregate_function_args", "macro_sql": "{% macro get_formatted_aggregate_function_args() %}\n {{ return(adapter.dispatch('get_formatted_aggregate_function_args', 'dbt')()) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_formatted_aggregate_function_args"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789422566.4673774, "supported_languages": null}, "macro.dbt.default__get_formatted_aggregate_function_args": {"name": "default__get_formatted_aggregate_function_args", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/functions/aggregate.sql", "original_file_path": "macros/materializations/functions/aggregate.sql", "unique_id": "macro.dbt.default__get_formatted_aggregate_function_args", "macro_sql": "{% macro default__get_formatted_aggregate_function_args() %}\n {# conveniently we can reuse the sql scalar function args #}\n {{ formatted_scalar_function_args_sql() }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.formatted_scalar_function_args_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789422566.46764, "supported_languages": null}, "macro.dbt.get_function_language_specifier": {"name": "get_function_language_specifier", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/functions/aggregate.sql", "original_file_path": "macros/materializations/functions/aggregate.sql", "unique_id": "macro.dbt.get_function_language_specifier", "macro_sql": "{% macro get_function_language_specifier() %}\n {{ return(adapter.dispatch('get_function_language_specifier', 'dbt')()) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_function_language_specifier"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789422566.4679794, "supported_languages": null}, "macro.dbt.default__get_function_language_specifier": {"name": "default__get_function_language_specifier", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/functions/aggregate.sql", "original_file_path": "macros/materializations/functions/aggregate.sql", "unique_id": "macro.dbt.default__get_function_language_specifier", "macro_sql": "{% macro default__get_function_language_specifier() %}\n {% set language = model.get('language') %}\n {% if language == 'sql' %}\n {# generally you dont need to specify the language for sql functions #}\n {% elif language == 'python' %}\n LANGUAGE PYTHON\n {% elif language == 'javascript' %}\n LANGUAGE js\n {% else %}\n {{ 'LANGUAGE ' ~ language.upper() }}\n {% endif %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789422566.4693208, "supported_languages": null}, "macro.dbt.get_aggregate_function_volatility_specifier": {"name": "get_aggregate_function_volatility_specifier", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/functions/aggregate.sql", "original_file_path": "macros/materializations/functions/aggregate.sql", "unique_id": "macro.dbt.get_aggregate_function_volatility_specifier", "macro_sql": "{% macro get_aggregate_function_volatility_specifier() %}\n {{ return(adapter.dispatch('get_aggregate_function_volatility_specifier', 'dbt')()) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_aggregate_function_volatility_specifier"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789422566.4697015, "supported_languages": null}, "macro.dbt.default__get_aggregate_function_volatility_specifier": {"name": "default__get_aggregate_function_volatility_specifier", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/functions/aggregate.sql", "original_file_path": "macros/materializations/functions/aggregate.sql", "unique_id": "macro.dbt.default__get_aggregate_function_volatility_specifier", "macro_sql": "{% macro default__get_aggregate_function_volatility_specifier() %}\n {{ scalar_function_volatility_sql() }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.scalar_function_volatility_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789422566.469934, "supported_languages": null}, "macro.dbt.get_function_python_options": {"name": "get_function_python_options", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/functions/aggregate.sql", "original_file_path": "macros/materializations/functions/aggregate.sql", "unique_id": "macro.dbt.get_function_python_options", "macro_sql": "{% macro get_function_python_options() %}\n {{ return(adapter.dispatch('get_function_python_options', 'dbt')()) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_function_python_options"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789422566.4702735, "supported_languages": null}, "macro.dbt.default__get_function_python_options": {"name": "default__get_function_python_options", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/functions/aggregate.sql", "original_file_path": "macros/materializations/functions/aggregate.sql", "unique_id": "macro.dbt.default__get_function_python_options", "macro_sql": "{% macro default__get_function_python_options() %}\n RUNTIME_VERSION = '{{ model.config.get('runtime_version') }}'\n HANDLER = '{{ model.config.get('entry_point') }}'\n {% set packages = model.config.get('packages', []) %}\n {% if packages %}\n PACKAGES = ('{{ packages | join(\"','\") }}')\n {% endif %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789422566.4710586, "supported_languages": null}, "macro.dbt.scalar_function_sql": {"name": "scalar_function_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/functions/scalar.sql", "original_file_path": "macros/materializations/functions/scalar.sql", "unique_id": "macro.dbt.scalar_function_sql", "macro_sql": "{% macro scalar_function_sql(target_relation) %}\n {{ return(adapter.dispatch('scalar_function_sql', 'dbt')(target_relation)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__scalar_function_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "target_relation", "type": null, "description": ""}], "created_at": 1789422566.4727728, "supported_languages": null}, "macro.dbt.default__scalar_function_sql": {"name": "default__scalar_function_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/functions/scalar.sql", "original_file_path": "macros/materializations/functions/scalar.sql", "unique_id": "macro.dbt.default__scalar_function_sql", "macro_sql": "{% macro default__scalar_function_sql(target_relation) %}\n {{ scalar_function_create_replace_signature_sql(target_relation) }}\n {{ scalar_function_body_sql() }};\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.scalar_function_create_replace_signature_sql", "macro.dbt.scalar_function_body_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "target_relation", "type": null, "description": ""}], "created_at": 1789422566.4731412, "supported_languages": null}, "macro.dbt.scalar_function_create_replace_signature_sql": {"name": "scalar_function_create_replace_signature_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/functions/scalar.sql", "original_file_path": "macros/materializations/functions/scalar.sql", "unique_id": "macro.dbt.scalar_function_create_replace_signature_sql", "macro_sql": "{% macro scalar_function_create_replace_signature_sql(target_relation) %}\n {{ return(adapter.dispatch('scalar_function_create_replace_signature_sql', 'dbt')(target_relation)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__scalar_function_create_replace_signature_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "target_relation", "type": null, "description": ""}], "created_at": 1789422566.4735677, "supported_languages": null}, "macro.dbt.default__scalar_function_create_replace_signature_sql": {"name": "default__scalar_function_create_replace_signature_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/functions/scalar.sql", "original_file_path": "macros/materializations/functions/scalar.sql", "unique_id": "macro.dbt.default__scalar_function_create_replace_signature_sql", "macro_sql": "{% macro default__scalar_function_create_replace_signature_sql(target_relation) %}\n CREATE OR REPLACE FUNCTION {{ target_relation.render() }} ({{ formatted_scalar_function_args_sql()}})\n RETURNS {{ model.returns.data_type }}\n {{ scalar_function_volatility_sql() }}\n AS\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.formatted_scalar_function_args_sql", "macro.dbt.scalar_function_volatility_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "target_relation", "type": null, "description": ""}], "created_at": 1789422566.4740436, "supported_languages": null}, "macro.dbt.formatted_scalar_function_args_sql": {"name": "formatted_scalar_function_args_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/functions/scalar.sql", "original_file_path": "macros/materializations/functions/scalar.sql", "unique_id": "macro.dbt.formatted_scalar_function_args_sql", "macro_sql": "{% macro formatted_scalar_function_args_sql() %}\n {{ return(adapter.dispatch('formatted_scalar_function_args_sql', 'dbt')()) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__formatted_scalar_function_args_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789422566.4744072, "supported_languages": null}, "macro.dbt.formatted_scalar_function_args_javascript": {"name": "formatted_scalar_function_args_javascript", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/functions/scalar.sql", "original_file_path": "macros/materializations/functions/scalar.sql", "unique_id": "macro.dbt.formatted_scalar_function_args_javascript", "macro_sql": "{% macro formatted_scalar_function_args_javascript() %}\n {{ return(adapter.dispatch('formatted_scalar_function_args_javascript', 'dbt')()) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__formatted_scalar_function_args_javascript"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789422566.4747882, "supported_languages": null}, "macro.dbt.default__formatted_scalar_function_args_sql": {"name": "default__formatted_scalar_function_args_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/functions/scalar.sql", "original_file_path": "macros/materializations/functions/scalar.sql", "unique_id": "macro.dbt.default__formatted_scalar_function_args_sql", "macro_sql": "{% macro default__formatted_scalar_function_args_sql() %}\n {% set args = [] %}\n {% for arg in model.arguments -%}\n {%- do args.append(arg.name ~ ' ' ~ arg.data_type) -%}\n {%- endfor %}\n {{ args | join(', ') }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789422566.4755492, "supported_languages": null}, "macro.dbt.default__formatted_scalar_function_args_javascript": {"name": "default__formatted_scalar_function_args_javascript", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/functions/scalar.sql", "original_file_path": "macros/materializations/functions/scalar.sql", "unique_id": "macro.dbt.default__formatted_scalar_function_args_javascript", "macro_sql": "{% macro default__formatted_scalar_function_args_javascript() %}\n {% set msg = \"formatted_scalar_function_args_javascript not implemented for adapter \" ~ adapter.type() %}\n {% do exceptions.raise_compiler_error(msg) %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789422566.4760053, "supported_languages": null}, "macro.dbt.scalar_function_body_sql": {"name": "scalar_function_body_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/functions/scalar.sql", "original_file_path": "macros/materializations/functions/scalar.sql", "unique_id": "macro.dbt.scalar_function_body_sql", "macro_sql": "{% macro scalar_function_body_sql() %}\n {{ return(adapter.dispatch('scalar_function_body_sql', 'dbt')()) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__scalar_function_body_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789422566.4763544, "supported_languages": null}, "macro.dbt.default__scalar_function_body_sql": {"name": "default__scalar_function_body_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/functions/scalar.sql", "original_file_path": "macros/materializations/functions/scalar.sql", "unique_id": "macro.dbt.default__scalar_function_body_sql", "macro_sql": "{% macro default__scalar_function_body_sql() %}\n $$\n {{ model.compiled_code }}\n $$ LANGUAGE SQL\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789422566.476606, "supported_languages": null}, "macro.dbt.scalar_function_volatility_sql": {"name": "scalar_function_volatility_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/functions/scalar.sql", "original_file_path": "macros/materializations/functions/scalar.sql", "unique_id": "macro.dbt.scalar_function_volatility_sql", "macro_sql": "{% macro scalar_function_volatility_sql() %}\n {{ return(adapter.dispatch('scalar_function_volatility_sql', 'dbt')()) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__scalar_function_volatility_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789422566.476951, "supported_languages": null}, "macro.dbt.scalar_function_volatility_javascript": {"name": "scalar_function_volatility_javascript", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/functions/scalar.sql", "original_file_path": "macros/materializations/functions/scalar.sql", "unique_id": "macro.dbt.scalar_function_volatility_javascript", "macro_sql": "{% macro scalar_function_volatility_javascript() %}\n {{ return(adapter.dispatch('scalar_function_volatility_javascript', 'dbt')()) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__scalar_function_volatility_javascript"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789422566.4772909, "supported_languages": null}, "macro.dbt.default__scalar_function_volatility_javascript": {"name": "default__scalar_function_volatility_javascript", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/functions/scalar.sql", "original_file_path": "macros/materializations/functions/scalar.sql", "unique_id": "macro.dbt.default__scalar_function_volatility_javascript", "macro_sql": "{% macro default__scalar_function_volatility_javascript() %}\n {% set volatility = model.config.get('volatility') %}\n {% if volatility != none %}\n {% set msg = \"Volatility is not supported by \" ~ adapter.type() ~ \" in javascript UDF and will be ignored\" %}\n {% do exceptions.warn(msg) %}\n {% endif %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789422566.5575764, "supported_languages": null}, "macro.dbt.default__scalar_function_volatility_sql": {"name": "default__scalar_function_volatility_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/functions/scalar.sql", "original_file_path": "macros/materializations/functions/scalar.sql", "unique_id": "macro.dbt.default__scalar_function_volatility_sql", "macro_sql": "{% macro default__scalar_function_volatility_sql() %}\n {% set volatility = model.config.get('volatility') %}\n {% if volatility == 'deterministic' %}\n IMMUTABLE\n {% elif volatility == 'stable' %}\n STABLE\n {% elif volatility == 'non-deterministic' %}\n VOLATILE\n {% elif volatility != none %}\n {# This shouldn't happen unless a new volatility is invented #}\n {% do unsupported_volatility_warning(volatility) %}\n {% endif %}\n {# If no volatility is set, don't add anything and let the data warehouse default it #}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.unsupported_volatility_warning"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789422566.55868, "supported_languages": null}, "macro.dbt.unsupported_volatility_warning": {"name": "unsupported_volatility_warning", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/functions/scalar.sql", "original_file_path": "macros/materializations/functions/scalar.sql", "unique_id": "macro.dbt.unsupported_volatility_warning", "macro_sql": "{% macro unsupported_volatility_warning(volatility) %}\n {{ return(adapter.dispatch('unsupported_volatility_warning', 'dbt')(volatility)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__unsupported_volatility_warning"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "volatility", "type": null, "description": ""}], "created_at": 1789422566.5591884, "supported_languages": null}, "macro.dbt.default__unsupported_volatility_warning": {"name": "default__unsupported_volatility_warning", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/functions/scalar.sql", "original_file_path": "macros/materializations/functions/scalar.sql", "unique_id": "macro.dbt.default__unsupported_volatility_warning", "macro_sql": "{% macro default__unsupported_volatility_warning(volatility) %}\n {% set msg = \"Found `\" ~ volatility ~ \"` volatility specified on function `\" ~ model.name ~ \"`. This volatility is not supported by \" ~ adapter.type() ~ \", and will be ignored\" %}\n {% do exceptions.warn(msg) %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "volatility", "type": null, "description": ""}], "created_at": 1789422566.5598834, "supported_languages": null}, "macro.dbt.materialization_function_default": {"name": "materialization_function_default", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/functions/function.sql", "original_file_path": "macros/materializations/functions/function.sql", "unique_id": "macro.dbt.materialization_function_default", "macro_sql": "{% materialization function, default, supported_languages=['sql', 'python', 'javascript'] %}\n {% set existing_relation = load_cached_relation(this) %}\n {% set target_relation = this.incorporate(type=this.Function) %}\n\n {{ run_hooks(pre_hooks) }}\n\n {% set function_config = this.get_function_config(model) %}\n {% set macro_name = this.get_function_macro_name(function_config) %}\n\n {# Doing this aliasing of adapter.dispatch is a hacky way to disable the static analysis of actually calling adapter.dispatch #}\n {# This is necessary because the static analysis breaks being able to dynamically pass a macro_name #}\n {% set _dispatch = adapter.dispatch %}\n\n {% set build_sql = _dispatch(macro_name, 'dbt')(target_relation) %}\n {{ function_execute_build_sql(build_sql, existing_relation, target_relation) }}\n {{ run_hooks(post_hooks) }}\n\n {{ return({'relations': [target_relation]}) }}\n\n{% endmaterialization %}", "depends_on": {"macros": ["macro.dbt.load_cached_relation", "macro.dbt.run_hooks", "macro.dbt.function_execute_build_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "supported_languages", "type": null, "description": ""}], "created_at": 1789422566.5620732, "supported_languages": ["sql", "python", "javascript"]}, "macro.dbt.function_execute_build_sql": {"name": "function_execute_build_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/functions/helpers.sql", "original_file_path": "macros/materializations/functions/helpers.sql", "unique_id": "macro.dbt.function_execute_build_sql", "macro_sql": "{% macro function_execute_build_sql(build_sql, existing_relation, target_relation) %}\n {{ return(adapter.dispatch('function_execute_build_sql', 'dbt')(build_sql, existing_relation, target_relation)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__function_execute_build_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "build_sql", "type": null, "description": ""}, {"name": "existing_relation", "type": null, "description": ""}, {"name": "target_relation", "type": null, "description": ""}], "created_at": 1789422566.562941, "supported_languages": null}, "macro.dbt.default__function_execute_build_sql": {"name": "default__function_execute_build_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/functions/helpers.sql", "original_file_path": "macros/materializations/functions/helpers.sql", "unique_id": "macro.dbt.default__function_execute_build_sql", "macro_sql": "{% macro default__function_execute_build_sql(build_sql, existing_relation, target_relation) %}\n\n {% set grant_config = config.get('grants') %}\n\n {% call statement(name=\"main\") %}\n {{ build_sql }}\n {% endcall %}\n\n {% set should_revoke = should_revoke(existing_relation, full_refresh_mode=True) %}\n {% do apply_grants(target_relation, grant_config, should_revoke=should_revoke) %}\n\n {% do persist_docs(target_relation, model) %}\n\n {{ adapter.commit() }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement", "macro.dbt.should_revoke", "macro.dbt.apply_grants", "macro.dbt.persist_docs"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "build_sql", "type": null, "description": ""}, {"name": "existing_relation", "type": null, "description": ""}, {"name": "target_relation", "type": null, "description": ""}], "created_at": 1789422566.5640967, "supported_languages": null}, "macro.dbt.materialization_table_default": {"name": "materialization_table_default", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/table.sql", "original_file_path": "macros/materializations/models/table.sql", "unique_id": "macro.dbt.materialization_table_default", "macro_sql": "{% materialization table, default %}\n\n {%- set existing_relation = load_cached_relation(this) -%}\n {%- set target_relation = this.incorporate(type='table') %}\n {%- set intermediate_relation = make_intermediate_relation(target_relation) -%}\n -- the intermediate_relation should not already exist in the database; get_relation\n -- will return None in that case. Otherwise, we get a relation that we can drop\n -- later, before we try to use this name for the current operation\n {%- set preexisting_intermediate_relation = load_cached_relation(intermediate_relation) -%}\n /*\n See ../view/view.sql for more information about this relation.\n */\n {%- set backup_relation_type = 'table' if existing_relation is none else existing_relation.type -%}\n {%- set backup_relation = make_backup_relation(target_relation, backup_relation_type) -%}\n -- as above, the backup_relation should not already exist\n {%- set preexisting_backup_relation = load_cached_relation(backup_relation) -%}\n -- grab current tables grants config for comparision later on\n {% set grant_config = config.get('grants') %}\n\n -- drop the temp relations if they exist already in the database\n {{ drop_relation_if_exists(preexisting_intermediate_relation) }}\n {{ drop_relation_if_exists(preexisting_backup_relation) }}\n\n {{ run_hooks(pre_hooks, inside_transaction=False) }}\n\n -- `BEGIN` happens here:\n {{ run_hooks(pre_hooks, inside_transaction=True) }}\n\n -- build model\n {% call statement('main') -%}\n {{ get_create_table_as_sql(False, intermediate_relation, sql) }}\n {%- endcall %}\n\n {% do create_indexes(intermediate_relation) %}\n\n -- cleanup\n {% if existing_relation is not none %}\n /* Do the equivalent of rename_if_exists. 'existing_relation' could have been dropped\n since the variable was first set. */\n {% set existing_relation = load_cached_relation(existing_relation) %}\n {% if existing_relation is not none %}\n {{ adapter.rename_relation(existing_relation, backup_relation) }}\n {% endif %}\n {% endif %}\n\n {{ adapter.rename_relation(intermediate_relation, target_relation) }}\n\n {{ run_hooks(post_hooks, inside_transaction=True) }}\n\n {% set should_revoke = should_revoke(existing_relation, full_refresh_mode=True) %}\n {% do apply_grants(target_relation, grant_config, should_revoke=should_revoke) %}\n\n {% do persist_docs(target_relation, model) %}\n\n -- `COMMIT` happens here\n {{ adapter.commit() }}\n\n -- finally, drop the existing/backup relation after the commit\n {{ drop_relation_if_exists(backup_relation) }}\n\n {{ run_hooks(post_hooks, inside_transaction=False) }}\n\n {{ return({'relations': [target_relation]}) }}\n{% endmaterialization %}", "depends_on": {"macros": ["macro.dbt.load_cached_relation", "macro.dbt.make_intermediate_relation", "macro.dbt.make_backup_relation", "macro.dbt.drop_relation_if_exists", "macro.dbt.run_hooks", "macro.dbt.statement", "macro.dbt.get_create_table_as_sql", "macro.dbt.create_indexes", "macro.dbt.should_revoke", "macro.dbt.apply_grants", "macro.dbt.persist_docs"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "supported_languages", "type": null, "description": ""}], "created_at": 1789422566.5689363, "supported_languages": ["sql"]}, "macro.dbt.materialization_materialized_view_default": {"name": "materialization_materialized_view_default", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/materialized_view.sql", "original_file_path": "macros/materializations/models/materialized_view.sql", "unique_id": "macro.dbt.materialization_materialized_view_default", "macro_sql": "{% materialization materialized_view, default %}\n {% set existing_relation = load_cached_relation(this) %}\n {% set target_relation = this.incorporate(type=this.MaterializedView) %}\n {% set intermediate_relation = make_intermediate_relation(target_relation) %}\n {% set backup_relation_type = target_relation.MaterializedView if existing_relation is none else existing_relation.type %}\n {% set backup_relation = make_backup_relation(target_relation, backup_relation_type) %}\n\n {{ materialized_view_setup(backup_relation, intermediate_relation, pre_hooks) }}\n\n {% set build_sql = materialized_view_get_build_sql(existing_relation, target_relation, backup_relation, intermediate_relation) %}\n\n {% if build_sql == '' %}\n {{ materialized_view_execute_no_op(target_relation) }}\n {% else %}\n {{ materialized_view_execute_build_sql(build_sql, existing_relation, target_relation, post_hooks) }}\n {% endif %}\n\n {{ materialized_view_teardown(backup_relation, intermediate_relation, post_hooks) }}\n\n {{ return({'relations': [target_relation]}) }}\n\n{% endmaterialization %}", "depends_on": {"macros": ["macro.dbt.load_cached_relation", "macro.dbt.make_intermediate_relation", "macro.dbt.make_backup_relation", "macro.dbt.materialized_view_setup", "macro.dbt.materialized_view_get_build_sql", "macro.dbt.materialized_view_execute_no_op", "macro.dbt.materialized_view_execute_build_sql", "macro.dbt.materialized_view_teardown"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "supported_languages", "type": null, "description": ""}], "created_at": 1789422566.572397, "supported_languages": ["sql"]}, "macro.dbt.materialized_view_setup": {"name": "materialized_view_setup", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/materialized_view.sql", "original_file_path": "macros/materializations/models/materialized_view.sql", "unique_id": "macro.dbt.materialized_view_setup", "macro_sql": "{% macro materialized_view_setup(backup_relation, intermediate_relation, pre_hooks) %}\n\n -- backup_relation and intermediate_relation should not already exist in the database\n -- it's possible these exist because of a previous run that exited unexpectedly\n {% set preexisting_backup_relation = load_cached_relation(backup_relation) %}\n {% set preexisting_intermediate_relation = load_cached_relation(intermediate_relation) %}\n\n -- drop the temp relations if they exist already in the database\n {{ drop_relation_if_exists(preexisting_backup_relation) }}\n {{ drop_relation_if_exists(preexisting_intermediate_relation) }}\n\n {{ run_hooks(pre_hooks, inside_transaction=False) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.load_cached_relation", "macro.dbt.drop_relation_if_exists", "macro.dbt.run_hooks"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "backup_relation", "type": null, "description": ""}, {"name": "intermediate_relation", "type": null, "description": ""}, {"name": "pre_hooks", "type": null, "description": ""}], "created_at": 1789422566.5733616, "supported_languages": null}, "macro.dbt.materialized_view_teardown": {"name": "materialized_view_teardown", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/materialized_view.sql", "original_file_path": "macros/materializations/models/materialized_view.sql", "unique_id": "macro.dbt.materialized_view_teardown", "macro_sql": "{% macro materialized_view_teardown(backup_relation, intermediate_relation, post_hooks) %}\n\n -- drop the temp relations if they exist to leave the database clean for the next run\n {{ drop_relation_if_exists(backup_relation) }}\n {{ drop_relation_if_exists(intermediate_relation) }}\n\n {{ run_hooks(post_hooks, inside_transaction=False) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.drop_relation_if_exists", "macro.dbt.run_hooks"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "backup_relation", "type": null, "description": ""}, {"name": "intermediate_relation", "type": null, "description": ""}, {"name": "post_hooks", "type": null, "description": ""}], "created_at": 1789422566.573995, "supported_languages": null}, "macro.dbt.materialized_view_get_build_sql": {"name": "materialized_view_get_build_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/materialized_view.sql", "original_file_path": "macros/materializations/models/materialized_view.sql", "unique_id": "macro.dbt.materialized_view_get_build_sql", "macro_sql": "{% macro materialized_view_get_build_sql(existing_relation, target_relation, backup_relation, intermediate_relation) %}\n\n {% set full_refresh_mode = should_full_refresh() %}\n\n -- determine the scenario we're in: create, full_refresh, alter, refresh data\n {% if existing_relation is none %}\n {% set build_sql = get_create_materialized_view_as_sql(target_relation, sql) %}\n {% elif full_refresh_mode or not existing_relation.is_materialized_view %}\n {% set build_sql = get_replace_sql(existing_relation, target_relation, sql) %}\n {% else %}\n\n -- get config options\n {% set on_configuration_change = config.get('on_configuration_change') %}\n {% set configuration_changes = get_materialized_view_configuration_changes(existing_relation, config) %}\n\n {% if configuration_changes is none %}\n {% set build_sql = refresh_materialized_view(target_relation) %}\n\n {% elif on_configuration_change == 'apply' %}\n {% set build_sql = get_alter_materialized_view_as_sql(target_relation, configuration_changes, sql, existing_relation, backup_relation, intermediate_relation) %}\n {% elif on_configuration_change == 'continue' %}\n {% set build_sql = '' %}\n {{ exceptions.warn(\"Configuration changes were identified and `on_configuration_change` was set to `continue` for `\" ~ target_relation.render() ~ \"`\") }}\n {% elif on_configuration_change == 'fail' %}\n {{ exceptions.raise_fail_fast_error(\"Configuration changes were identified and `on_configuration_change` was set to `fail` for `\" ~ target_relation.render() ~ \"`\") }}\n\n {% else %}\n -- this only happens if the user provides a value other than `apply`, 'skip', 'fail'\n {{ exceptions.raise_compiler_error(\"Unexpected configuration scenario\") }}\n\n {% endif %}\n\n {% endif %}\n\n {% do return(build_sql) %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.should_full_refresh", "macro.dbt.get_create_materialized_view_as_sql", "macro.dbt.get_replace_sql", "macro.dbt.get_materialized_view_configuration_changes", "macro.dbt.refresh_materialized_view", "macro.dbt.get_alter_materialized_view_as_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "existing_relation", "type": null, "description": ""}, {"name": "target_relation", "type": null, "description": ""}, {"name": "backup_relation", "type": null, "description": ""}, {"name": "intermediate_relation", "type": null, "description": ""}], "created_at": 1789422566.5767748, "supported_languages": null}, "macro.dbt.materialized_view_execute_no_op": {"name": "materialized_view_execute_no_op", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/materialized_view.sql", "original_file_path": "macros/materializations/models/materialized_view.sql", "unique_id": "macro.dbt.materialized_view_execute_no_op", "macro_sql": "{% macro materialized_view_execute_no_op(target_relation) %}\n {% do store_raw_result(\n name=\"main\",\n message=\"skip \" ~ target_relation,\n code=\"skip\",\n rows_affected=\"-1\"\n ) %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "target_relation", "type": null, "description": ""}], "created_at": 1789422566.5773506, "supported_languages": null}, "macro.dbt.materialized_view_execute_build_sql": {"name": "materialized_view_execute_build_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/materialized_view.sql", "original_file_path": "macros/materializations/models/materialized_view.sql", "unique_id": "macro.dbt.materialized_view_execute_build_sql", "macro_sql": "{% macro materialized_view_execute_build_sql(build_sql, existing_relation, target_relation, post_hooks) %}\n\n -- `BEGIN` happens here:\n {{ run_hooks(pre_hooks, inside_transaction=True) }}\n\n {% set grant_config = config.get('grants') %}\n\n {% call statement(name=\"main\") %}\n {{ build_sql }}\n {% endcall %}\n\n {% set should_revoke = should_revoke(existing_relation, full_refresh_mode=True) %}\n {% do apply_grants(target_relation, grant_config, should_revoke=should_revoke) %}\n\n {% do persist_docs(target_relation, model) %}\n\n {{ run_hooks(post_hooks, inside_transaction=True) }}\n\n {{ adapter.commit() }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.run_hooks", "macro.dbt.statement", "macro.dbt.should_revoke", "macro.dbt.apply_grants", "macro.dbt.persist_docs"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "build_sql", "type": null, "description": ""}, {"name": "existing_relation", "type": null, "description": ""}, {"name": "target_relation", "type": null, "description": ""}, {"name": "post_hooks", "type": null, "description": ""}], "created_at": 1789422566.5787964, "supported_languages": null}, "macro.dbt.materialization_view_default": {"name": "materialization_view_default", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/view.sql", "original_file_path": "macros/materializations/models/view.sql", "unique_id": "macro.dbt.materialization_view_default", "macro_sql": "{%- materialization view, default -%}\n\n {%- set existing_relation = load_cached_relation(this) -%}\n {%- set target_relation = this.incorporate(type='view') -%}\n {%- set intermediate_relation = make_intermediate_relation(target_relation) -%}\n\n -- the intermediate_relation should not already exist in the database; get_relation\n -- will return None in that case. Otherwise, we get a relation that we can drop\n -- later, before we try to use this name for the current operation\n {%- set preexisting_intermediate_relation = load_cached_relation(intermediate_relation) -%}\n /*\n This relation (probably) doesn't exist yet. If it does exist, it's a leftover from\n a previous run, and we're going to try to drop it immediately. At the end of this\n materialization, we're going to rename the \"existing_relation\" to this identifier,\n and then we're going to drop it. In order to make sure we run the correct one of:\n - drop view ...\n - drop table ...\n\n We need to set the type of this relation to be the type of the existing_relation, if it exists,\n or else \"view\" as a sane default if it does not. Note that if the existing_relation does not\n exist, then there is nothing to move out of the way and subsequentally drop. In that case,\n this relation will be effectively unused.\n */\n {%- set backup_relation_type = 'view' if existing_relation is none else existing_relation.type -%}\n {%- set backup_relation = make_backup_relation(target_relation, backup_relation_type) -%}\n -- as above, the backup_relation should not already exist\n {%- set preexisting_backup_relation = load_cached_relation(backup_relation) -%}\n -- grab current tables grants config for comparision later on\n {% set grant_config = config.get('grants') %}\n\n {{ run_hooks(pre_hooks, inside_transaction=False) }}\n\n -- drop the temp relations if they exist already in the database\n {{ drop_relation_if_exists(preexisting_intermediate_relation) }}\n {{ drop_relation_if_exists(preexisting_backup_relation) }}\n\n -- `BEGIN` happens here:\n {{ run_hooks(pre_hooks, inside_transaction=True) }}\n\n -- build model\n {% call statement('main') -%}\n {{ get_create_view_as_sql(intermediate_relation, sql) }}\n {%- endcall %}\n\n -- cleanup\n -- move the existing view out of the way\n {% if existing_relation is not none %}\n /* Do the equivalent of rename_if_exists. 'existing_relation' could have been dropped\n since the variable was first set. */\n {% set existing_relation = load_cached_relation(existing_relation) %}\n {% if existing_relation is not none %}\n {{ adapter.rename_relation(existing_relation, backup_relation) }}\n {% endif %}\n {% endif %}\n {{ adapter.rename_relation(intermediate_relation, target_relation) }}\n\n {% set should_revoke = should_revoke(existing_relation, full_refresh_mode=True) %}\n {% do apply_grants(target_relation, grant_config, should_revoke=should_revoke) %}\n\n {% do persist_docs(target_relation, model) %}\n\n {{ run_hooks(post_hooks, inside_transaction=True) }}\n\n {{ adapter.commit() }}\n\n {{ drop_relation_if_exists(backup_relation) }}\n\n {{ run_hooks(post_hooks, inside_transaction=False) }}\n\n {{ return({'relations': [target_relation]}) }}\n\n{%- endmaterialization -%}", "depends_on": {"macros": ["macro.dbt.load_cached_relation", "macro.dbt.make_intermediate_relation", "macro.dbt.make_backup_relation", "macro.dbt.run_hooks", "macro.dbt.drop_relation_if_exists", "macro.dbt.statement", "macro.dbt.get_create_view_as_sql", "macro.dbt.should_revoke", "macro.dbt.apply_grants", "macro.dbt.persist_docs"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "supported_languages", "type": null, "description": ""}], "created_at": 1789422566.5831225, "supported_languages": ["sql"]}, "macro.dbt.materialization_clone_default": {"name": "materialization_clone_default", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/clone/clone.sql", "original_file_path": "macros/materializations/models/clone/clone.sql", "unique_id": "macro.dbt.materialization_clone_default", "macro_sql": "{%- materialization clone, default -%}\n\n {%- set relations = {'relations': []} -%}\n\n {%- if not defer_relation -%}\n -- nothing to do\n {{ log(\"No relation found in state manifest for \" ~ model.unique_id, info=True) }}\n {{ return(relations) }}\n {%- endif -%}\n\n {%- set existing_relation = load_cached_relation(this) -%}\n\n {%- if existing_relation and not flags.FULL_REFRESH -%}\n -- noop!\n {{ log(\"Relation \" ~ existing_relation ~ \" already exists\", info=True) }}\n {{ return(relations) }}\n {%- endif -%}\n\n {%- set other_existing_relation = load_cached_relation(defer_relation) -%}\n\n -- If this is a database that can do zero-copy cloning of tables, and the other relation is a table, then this will be a table\n -- Otherwise, this will be a view\n\n {% set can_clone_table = can_clone_table() %}\n {%- set grant_config = config.get('grants') -%}\n\n {%- if other_existing_relation and other_existing_relation.type == 'table' and can_clone_table -%}\n\n {%- set target_relation = this.incorporate(type='table') -%}\n {% if existing_relation is not none and not existing_relation.is_table %}\n {{ log(\"Dropping relation \" ~ existing_relation.render() ~ \" because it is of type \" ~ existing_relation.type) }}\n {{ drop_relation_if_exists(existing_relation) }}\n {% endif %}\n\n -- as a general rule, data platforms that can clone tables can also do atomic 'create or replace'\n {% if target_relation.database == defer_relation.database and\n target_relation.schema == defer_relation.schema and\n target_relation.identifier == defer_relation.identifier %}\n {{ log(\"Target relation and defer relation are the same, skipping clone for relation: \" ~ target_relation.render()) }}\n {% else %}\n {% call statement('main') %}\n {{ create_or_replace_clone(target_relation, defer_relation) }}\n {% endcall %}\n {% endif %}\n {% set should_revoke = should_revoke(existing_relation, full_refresh_mode=True) %}\n {% do apply_grants(target_relation, grant_config, should_revoke=should_revoke) %}\n {% do persist_docs(target_relation, model) %}\n\n {{ return({'relations': [target_relation]}) }}\n\n {%- else -%}\n\n {%- set target_relation = this.incorporate(type='view') -%}\n\n -- reuse the view materialization\n -- TODO: support actual dispatch for materialization macros\n -- Tracking ticket: https://github.com/dbt-labs/dbt-core/issues/7799\n {% set search_name = \"materialization_view_\" ~ adapter.type() %}\n {% if not search_name in context %}\n {% set search_name = \"materialization_view_default\" %}\n {% endif %}\n {% set materialization_macro = context[search_name] %}\n {% set relations = materialization_macro() %}\n {{ return(relations) }}\n\n {%- endif -%}\n\n{%- endmaterialization -%}", "depends_on": {"macros": ["macro.dbt.load_cached_relation", "macro.dbt.can_clone_table", "macro.dbt.drop_relation_if_exists", "macro.dbt.statement", "macro.dbt.create_or_replace_clone", "macro.dbt.should_revoke", "macro.dbt.apply_grants", "macro.dbt.persist_docs"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "supported_languages", "type": null, "description": ""}], "created_at": 1789422566.5887384, "supported_languages": ["sql"]}, "macro.dbt.can_clone_table": {"name": "can_clone_table", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/clone/can_clone_table.sql", "original_file_path": "macros/materializations/models/clone/can_clone_table.sql", "unique_id": "macro.dbt.can_clone_table", "macro_sql": "{% macro can_clone_table() %}\n {{ return(adapter.dispatch('can_clone_table', 'dbt')()) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__can_clone_table"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789422566.5893815, "supported_languages": null}, "macro.dbt.default__can_clone_table": {"name": "default__can_clone_table", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/clone/can_clone_table.sql", "original_file_path": "macros/materializations/models/clone/can_clone_table.sql", "unique_id": "macro.dbt.default__can_clone_table", "macro_sql": "{% macro default__can_clone_table() %}\n {{ return(False) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789422566.5896866, "supported_languages": null}, "macro.dbt.create_or_replace_clone": {"name": "create_or_replace_clone", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/clone/create_or_replace_clone.sql", "original_file_path": "macros/materializations/models/clone/create_or_replace_clone.sql", "unique_id": "macro.dbt.create_or_replace_clone", "macro_sql": "{% macro create_or_replace_clone(this_relation, defer_relation) %}\n {{ return(adapter.dispatch('create_or_replace_clone', 'dbt')(this_relation, defer_relation)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__create_or_replace_clone"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "this_relation", "type": null, "description": ""}, {"name": "defer_relation", "type": null, "description": ""}], "created_at": 1789422566.5903094, "supported_languages": null}, "macro.dbt.default__create_or_replace_clone": {"name": "default__create_or_replace_clone", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/clone/create_or_replace_clone.sql", "original_file_path": "macros/materializations/models/clone/create_or_replace_clone.sql", "unique_id": "macro.dbt.default__create_or_replace_clone", "macro_sql": "{% macro default__create_or_replace_clone(this_relation, defer_relation) %}\n create or replace table {{ this_relation.render() }} clone {{ defer_relation.render() }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "this_relation", "type": null, "description": ""}, {"name": "defer_relation", "type": null, "description": ""}], "created_at": 1789422566.5907218, "supported_languages": null}, "macro.dbt.materialization_incremental_default": {"name": "materialization_incremental_default", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/incremental.sql", "original_file_path": "macros/materializations/models/incremental/incremental.sql", "unique_id": "macro.dbt.materialization_incremental_default", "macro_sql": "{% materialization incremental, default -%}\n\n -- relations\n {%- set existing_relation = load_cached_relation(this) -%}\n {%- set target_relation = this.incorporate(type='table') -%}\n {%- set temp_relation = make_temp_relation(target_relation)-%}\n {%- set intermediate_relation = make_intermediate_relation(target_relation)-%}\n {%- set backup_relation_type = 'table' if existing_relation is none else existing_relation.type -%}\n {%- set backup_relation = make_backup_relation(target_relation, backup_relation_type) -%}\n\n -- configs\n {%- set unique_key = config.get('unique_key') -%}\n {%- set full_refresh_mode = (should_full_refresh() or existing_relation.is_view) -%}\n {%- set on_schema_change = incremental_validate_on_schema_change(config.get('on_schema_change'), default='ignore') -%}\n\n -- the temp_ and backup_ relations should not already exist in the database; get_relation\n -- will return None in that case. Otherwise, we get a relation that we can drop\n -- later, before we try to use this name for the current operation. This has to happen before\n -- BEGIN, in a separate transaction\n {%- set preexisting_intermediate_relation = load_cached_relation(intermediate_relation)-%}\n {%- set preexisting_backup_relation = load_cached_relation(backup_relation) -%}\n -- grab current tables grants config for comparision later on\n {% set grant_config = config.get('grants') %}\n {{ drop_relation_if_exists(preexisting_intermediate_relation) }}\n {{ drop_relation_if_exists(preexisting_backup_relation) }}\n\n {{ run_hooks(pre_hooks, inside_transaction=False) }}\n\n -- `BEGIN` happens here:\n {{ run_hooks(pre_hooks, inside_transaction=True) }}\n\n {% set to_drop = [] %}\n\n {% set incremental_strategy = config.get('incremental_strategy') or 'default' %}\n {% set strategy_sql_macro_func = adapter.get_incremental_strategy_macro(context, incremental_strategy) %}\n\n {% if existing_relation is none %}\n {% set build_sql = get_create_table_as_sql(False, target_relation, sql) %}\n {% set relation_for_indexes = target_relation %}\n {% elif full_refresh_mode %}\n {% set build_sql = get_create_table_as_sql(False, intermediate_relation, sql) %}\n {% set relation_for_indexes = intermediate_relation %}\n {% set need_swap = true %}\n {% else %}\n {% do run_query(get_create_table_as_sql(True, temp_relation, sql)) %}\n {% set relation_for_indexes = temp_relation %}\n {% set contract_config = config.get('contract') %}\n {% if not contract_config or not contract_config.enforced %}\n {% do adapter.expand_target_column_types(\n from_relation=temp_relation,\n to_relation=target_relation) %}\n {% endif %}\n {#-- Process schema changes. Returns dict of changes if successful. Use source columns for upserting/merging --#}\n {% set dest_columns = process_schema_changes(on_schema_change, temp_relation, existing_relation) %}\n {% if not dest_columns %}\n {% set dest_columns = adapter.get_columns_in_relation(existing_relation) %}\n {% endif %}\n\n {#-- Get the incremental_strategy, the macro to use for the strategy, and build the sql --#}\n {% set incremental_predicates = config.get('predicates', none) or config.get('incremental_predicates', none) %}\n {% set strategy_arg_dict = ({'target_relation': target_relation, 'temp_relation': temp_relation, 'unique_key': unique_key, 'dest_columns': dest_columns, 'incremental_predicates': incremental_predicates }) %}\n {% set build_sql = strategy_sql_macro_func(strategy_arg_dict) %}\n\n {% endif %}\n\n {% call statement(\"main\") %}\n {{ build_sql }}\n {% endcall %}\n\n {% if existing_relation is none or existing_relation.is_view or should_full_refresh() %}\n {% do create_indexes(relation_for_indexes) %}\n {% endif %}\n\n {% if need_swap %}\n {% do adapter.rename_relation(target_relation, backup_relation) %}\n {% do adapter.rename_relation(intermediate_relation, target_relation) %}\n {% do to_drop.append(backup_relation) %}\n {% endif %}\n\n {% set should_revoke = should_revoke(existing_relation, full_refresh_mode) %}\n {% do apply_grants(target_relation, grant_config, should_revoke=should_revoke) %}\n\n {% do persist_docs(target_relation, model) %}\n\n {{ run_hooks(post_hooks, inside_transaction=True) }}\n\n -- `COMMIT` happens here\n {% do adapter.commit() %}\n\n {% for rel in to_drop %}\n {% do adapter.drop_relation(rel) %}\n {% endfor %}\n\n {{ run_hooks(post_hooks, inside_transaction=False) }}\n\n {{ return({'relations': [target_relation]}) }}\n\n{%- endmaterialization %}", "depends_on": {"macros": ["macro.dbt.load_cached_relation", "macro.dbt.make_temp_relation", "macro.dbt.make_intermediate_relation", "macro.dbt.make_backup_relation", "macro.dbt.should_full_refresh", "macro.dbt.incremental_validate_on_schema_change", "macro.dbt.drop_relation_if_exists", "macro.dbt.run_hooks", "macro.dbt.get_create_table_as_sql", "macro.dbt.run_query", "macro.dbt.process_schema_changes", "macro.dbt.statement", "macro.dbt.create_indexes", "macro.dbt.should_revoke", "macro.dbt.apply_grants", "macro.dbt.persist_docs"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "supported_languages", "type": null, "description": ""}], "created_at": 1789422566.599978, "supported_languages": ["sql"]}, "macro.dbt.get_quoted_csv": {"name": "get_quoted_csv", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/column_helpers.sql", "original_file_path": "macros/materializations/models/incremental/column_helpers.sql", "unique_id": "macro.dbt.get_quoted_csv", "macro_sql": "{% macro get_quoted_csv(column_names) %}\n\n {% set quoted = [] %}\n {% for col in column_names -%}\n {%- do quoted.append(adapter.quote(col)) -%}\n {%- endfor %}\n\n {%- set dest_cols_csv = quoted | join(', ') -%}\n {{ return(dest_cols_csv) }}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "column_names", "type": null, "description": ""}], "created_at": 1789422566.60195, "supported_languages": null}, "macro.dbt.diff_columns": {"name": "diff_columns", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/column_helpers.sql", "original_file_path": "macros/materializations/models/incremental/column_helpers.sql", "unique_id": "macro.dbt.diff_columns", "macro_sql": "{% macro diff_columns(source_columns, target_columns) %}\n\n {% set result = [] %}\n {% set source_names = source_columns | map(attribute = 'column') | list %}\n {% set target_names = target_columns | map(attribute = 'column') | list %}\n\n {# --check whether the name attribute exists in the target - this does not perform a data type check #}\n {% for sc in source_columns %}\n {% if sc.name not in target_names %}\n {{ result.append(sc) }}\n {% endif %}\n {% endfor %}\n\n {{ return(result) }}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "source_columns", "type": null, "description": ""}, {"name": "target_columns", "type": null, "description": ""}], "created_at": 1789422566.6031625, "supported_languages": null}, "macro.dbt.diff_column_data_types": {"name": "diff_column_data_types", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/column_helpers.sql", "original_file_path": "macros/materializations/models/incremental/column_helpers.sql", "unique_id": "macro.dbt.diff_column_data_types", "macro_sql": "{% macro diff_column_data_types(source_columns, target_columns) %}\n {{ return(adapter.dispatch('diff_column_data_types', 'dbt')(source_columns, target_columns)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__diff_column_data_types"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "source_columns", "type": null, "description": ""}, {"name": "target_columns", "type": null, "description": ""}], "created_at": 1789422566.6036859, "supported_languages": null}, "macro.dbt.default__diff_column_data_types": {"name": "default__diff_column_data_types", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/column_helpers.sql", "original_file_path": "macros/materializations/models/incremental/column_helpers.sql", "unique_id": "macro.dbt.default__diff_column_data_types", "macro_sql": "{% macro default__diff_column_data_types(source_columns, target_columns) %}\n {% set result = [] %}\n {% for sc in source_columns %}\n {% set tc = target_columns | selectattr(\"name\", \"equalto\", sc.name) | list | first %}\n {% if tc %}\n {% if sc.expanded_data_type != tc.expanded_data_type and not sc.can_expand_to(other_column=tc) %}\n {{ result.append( { 'column_name': tc.name, 'new_type': sc.expanded_data_type } ) }}\n {% endif %}\n {% endif %}\n {% endfor %}\n\n {{ return(result) }}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "source_columns", "type": null, "description": ""}, {"name": "target_columns", "type": null, "description": ""}], "created_at": 1789422566.605084, "supported_languages": null}, "macro.dbt.get_merge_update_columns": {"name": "get_merge_update_columns", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/column_helpers.sql", "original_file_path": "macros/materializations/models/incremental/column_helpers.sql", "unique_id": "macro.dbt.get_merge_update_columns", "macro_sql": "{% macro get_merge_update_columns(merge_update_columns, merge_exclude_columns, dest_columns) %}\n {{ return(adapter.dispatch('get_merge_update_columns', 'dbt')(merge_update_columns, merge_exclude_columns, dest_columns)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_merge_update_columns"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "merge_update_columns", "type": null, "description": ""}, {"name": "merge_exclude_columns", "type": null, "description": ""}, {"name": "dest_columns", "type": null, "description": ""}], "created_at": 1789422566.6056132, "supported_languages": null}, "macro.dbt.default__get_merge_update_columns": {"name": "default__get_merge_update_columns", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/column_helpers.sql", "original_file_path": "macros/materializations/models/incremental/column_helpers.sql", "unique_id": "macro.dbt.default__get_merge_update_columns", "macro_sql": "{% macro default__get_merge_update_columns(merge_update_columns, merge_exclude_columns, dest_columns) %}\n {%- set default_cols = dest_columns | map(attribute=\"quoted\") | list -%}\n\n {%- if merge_update_columns and merge_exclude_columns -%}\n {{ exceptions.raise_compiler_error(\n 'Model cannot specify merge_update_columns and merge_exclude_columns. Please update model to use only one config'\n )}}\n {%- elif merge_update_columns -%}\n {%- set update_columns = merge_update_columns -%}\n {%- elif merge_exclude_columns -%}\n {%- set update_columns = [] -%}\n {%- for column in dest_columns -%}\n {% if column.column | lower not in merge_exclude_columns | map(\"lower\") | list %}\n {%- do update_columns.append(column.quoted) -%}\n {% endif %}\n {%- endfor -%}\n {%- else -%}\n {%- set update_columns = default_cols -%}\n {%- endif -%}\n\n {{ return(update_columns) }}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "merge_update_columns", "type": null, "description": ""}, {"name": "merge_exclude_columns", "type": null, "description": ""}, {"name": "dest_columns", "type": null, "description": ""}], "created_at": 1789422566.6071324, "supported_languages": null}, "macro.dbt.get_incremental_append_sql": {"name": "get_incremental_append_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "unique_id": "macro.dbt.get_incremental_append_sql", "macro_sql": "{% macro get_incremental_append_sql(arg_dict) %}\n\n {{ return(adapter.dispatch('get_incremental_append_sql', 'dbt')(arg_dict)) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_incremental_append_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "arg_dict", "type": null, "description": ""}], "created_at": 1789422566.6084747, "supported_languages": null}, "macro.dbt.default__get_incremental_append_sql": {"name": "default__get_incremental_append_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "unique_id": "macro.dbt.default__get_incremental_append_sql", "macro_sql": "{% macro default__get_incremental_append_sql(arg_dict) %}\n\n {% do return(get_insert_into_sql(arg_dict[\"target_relation\"], arg_dict[\"temp_relation\"], arg_dict[\"dest_columns\"])) %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_insert_into_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "arg_dict", "type": null, "description": ""}], "created_at": 1789422566.608993, "supported_languages": null}, "macro.dbt.get_incremental_delete_insert_sql": {"name": "get_incremental_delete_insert_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "unique_id": "macro.dbt.get_incremental_delete_insert_sql", "macro_sql": "{% macro get_incremental_delete_insert_sql(arg_dict) %}\n\n {{ return(adapter.dispatch('get_incremental_delete_insert_sql', 'dbt')(arg_dict)) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_incremental_delete_insert_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "arg_dict", "type": null, "description": ""}], "created_at": 1789422566.6093924, "supported_languages": null}, "macro.dbt.default__get_incremental_delete_insert_sql": {"name": "default__get_incremental_delete_insert_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "unique_id": "macro.dbt.default__get_incremental_delete_insert_sql", "macro_sql": "{% macro default__get_incremental_delete_insert_sql(arg_dict) %}\n\n {% do return(get_delete_insert_merge_sql(arg_dict[\"target_relation\"], arg_dict[\"temp_relation\"], arg_dict[\"unique_key\"], arg_dict[\"dest_columns\"], arg_dict[\"incremental_predicates\"])) %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_delete_insert_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "arg_dict", "type": null, "description": ""}], "created_at": 1789422566.6100266, "supported_languages": null}, "macro.dbt.get_incremental_merge_sql": {"name": "get_incremental_merge_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "unique_id": "macro.dbt.get_incremental_merge_sql", "macro_sql": "{% macro get_incremental_merge_sql(arg_dict) %}\n\n {{ return(adapter.dispatch('get_incremental_merge_sql', 'dbt')(arg_dict)) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_incremental_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "arg_dict", "type": null, "description": ""}], "created_at": 1789422566.6104097, "supported_languages": null}, "macro.dbt.default__get_incremental_merge_sql": {"name": "default__get_incremental_merge_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "unique_id": "macro.dbt.default__get_incremental_merge_sql", "macro_sql": "{% macro default__get_incremental_merge_sql(arg_dict) %}\n\n {% do return(get_merge_sql(arg_dict[\"target_relation\"], arg_dict[\"temp_relation\"], arg_dict[\"unique_key\"], arg_dict[\"dest_columns\"], arg_dict[\"incremental_predicates\"])) %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "arg_dict", "type": null, "description": ""}], "created_at": 1789422566.6110232, "supported_languages": null}, "macro.dbt.get_incremental_insert_overwrite_sql": {"name": "get_incremental_insert_overwrite_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "unique_id": "macro.dbt.get_incremental_insert_overwrite_sql", "macro_sql": "{% macro get_incremental_insert_overwrite_sql(arg_dict) %}\n\n {{ return(adapter.dispatch('get_incremental_insert_overwrite_sql', 'dbt')(arg_dict)) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_incremental_insert_overwrite_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "arg_dict", "type": null, "description": ""}], "created_at": 1789422566.6114058, "supported_languages": null}, "macro.dbt.default__get_incremental_insert_overwrite_sql": {"name": "default__get_incremental_insert_overwrite_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "unique_id": "macro.dbt.default__get_incremental_insert_overwrite_sql", "macro_sql": "{% macro default__get_incremental_insert_overwrite_sql(arg_dict) %}\n\n {% do return(get_insert_overwrite_merge_sql(arg_dict[\"target_relation\"], arg_dict[\"temp_relation\"], arg_dict[\"dest_columns\"], arg_dict[\"incremental_predicates\"])) %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_insert_overwrite_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "arg_dict", "type": null, "description": ""}], "created_at": 1789422566.6121151, "supported_languages": null}, "macro.dbt.get_incremental_default_sql": {"name": "get_incremental_default_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "unique_id": "macro.dbt.get_incremental_default_sql", "macro_sql": "{% macro get_incremental_default_sql(arg_dict) %}\n\n {{ return(adapter.dispatch('get_incremental_default_sql', 'dbt')(arg_dict)) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__get_incremental_default_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "arg_dict", "type": null, "description": ""}], "created_at": 1789422566.612499, "supported_languages": null}, "macro.dbt.default__get_incremental_default_sql": {"name": "default__get_incremental_default_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "unique_id": "macro.dbt.default__get_incremental_default_sql", "macro_sql": "{% macro default__get_incremental_default_sql(arg_dict) %}\n\n {% do return(get_incremental_append_sql(arg_dict)) %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_incremental_append_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "arg_dict", "type": null, "description": ""}], "created_at": 1789422566.6128404, "supported_languages": null}, "macro.dbt.get_incremental_microbatch_sql": {"name": "get_incremental_microbatch_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "unique_id": "macro.dbt.get_incremental_microbatch_sql", "macro_sql": "{% macro get_incremental_microbatch_sql(arg_dict) %}\n\n {{ return(adapter.dispatch('get_incremental_microbatch_sql', 'dbt')(arg_dict)) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__get_incremental_microbatch_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "arg_dict", "type": null, "description": ""}], "created_at": 1789422566.6132188, "supported_languages": null}, "macro.dbt.default__get_incremental_microbatch_sql": {"name": "default__get_incremental_microbatch_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "unique_id": "macro.dbt.default__get_incremental_microbatch_sql", "macro_sql": "{% macro default__get_incremental_microbatch_sql(arg_dict) %}\n\n {{ exceptions.raise_not_implemented('microbatch materialization strategy not implemented for adapter ' + adapter.type()) }}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "arg_dict", "type": null, "description": ""}], "created_at": 1789422566.6135805, "supported_languages": null}, "macro.dbt.get_insert_into_sql": {"name": "get_insert_into_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "unique_id": "macro.dbt.get_insert_into_sql", "macro_sql": "{% macro get_insert_into_sql(target_relation, temp_relation, dest_columns) %}\n\n {%- set dest_cols_csv = get_quoted_csv(dest_columns | map(attribute=\"name\")) -%}\n\n insert into {{ target_relation }} ({{ dest_cols_csv }})\n (\n select {{ dest_cols_csv }}\n from {{ temp_relation }}\n )\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_quoted_csv"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "target_relation", "type": null, "description": ""}, {"name": "temp_relation", "type": null, "description": ""}, {"name": "dest_columns", "type": null, "description": ""}], "created_at": 1789422566.6141553, "supported_languages": null}, "macro.dbt.incremental_validate_on_schema_change": {"name": "incremental_validate_on_schema_change", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/on_schema_change.sql", "original_file_path": "macros/materializations/models/incremental/on_schema_change.sql", "unique_id": "macro.dbt.incremental_validate_on_schema_change", "macro_sql": "{% macro incremental_validate_on_schema_change(on_schema_change, default='ignore') %}\n\n {% if on_schema_change not in ['sync_all_columns', 'append_new_columns', 'fail', 'ignore'] %}\n\n {% set log_message = 'Invalid value for on_schema_change (%s) specified. Setting default value of %s.' % (on_schema_change, default) %}\n {% do log(log_message) %}\n\n {{ return(default) }}\n\n {% else %}\n\n {{ return(on_schema_change) }}\n\n {% endif %}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "on_schema_change", "type": null, "description": ""}, {"name": "default", "type": null, "description": ""}], "created_at": 1789422566.616734, "supported_languages": null}, "macro.dbt.check_for_schema_changes": {"name": "check_for_schema_changes", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/on_schema_change.sql", "original_file_path": "macros/materializations/models/incremental/on_schema_change.sql", "unique_id": "macro.dbt.check_for_schema_changes", "macro_sql": "{% macro check_for_schema_changes(source_relation, target_relation) %}\n {{ return(adapter.dispatch('check_for_schema_changes', 'dbt')(source_relation, target_relation)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__check_for_schema_changes"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "source_relation", "type": null, "description": ""}, {"name": "target_relation", "type": null, "description": ""}], "created_at": 1789422566.617195, "supported_languages": null}, "macro.dbt.default__check_for_schema_changes": {"name": "default__check_for_schema_changes", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/on_schema_change.sql", "original_file_path": "macros/materializations/models/incremental/on_schema_change.sql", "unique_id": "macro.dbt.default__check_for_schema_changes", "macro_sql": "{% macro default__check_for_schema_changes(source_relation, target_relation) %}\n\n {% set schema_changed = False %}\n\n {%- set source_columns = adapter.get_columns_in_relation(source_relation) -%}\n {%- set target_columns = adapter.get_columns_in_relation(target_relation) -%}\n {%- set source_not_in_target = diff_columns(source_columns, target_columns) -%}\n {%- set target_not_in_source = diff_columns(target_columns, source_columns) -%}\n\n {% set new_target_types = diff_column_data_types(source_columns, target_columns) %}\n\n {% if source_not_in_target != [] %}\n {% set schema_changed = True %}\n {% elif target_not_in_source != [] or new_target_types != [] %}\n {% set schema_changed = True %}\n {% elif new_target_types != [] %}\n {% set schema_changed = True %}\n {% endif %}\n\n {% set changes_dict = {\n 'schema_changed': schema_changed,\n 'source_not_in_target': source_not_in_target,\n 'target_not_in_source': target_not_in_source,\n 'source_columns': source_columns,\n 'target_columns': target_columns,\n 'new_target_types': new_target_types\n } %}\n\n {% set msg %}\n In {{ target_relation }}:\n Schema changed: {{ schema_changed }}\n Source columns not in target: {{ source_not_in_target }}\n Target columns not in source: {{ target_not_in_source }}\n New column types: {{ new_target_types }}\n {% endset %}\n\n {% do log(msg) %}\n\n {{ return(changes_dict) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.diff_columns", "macro.dbt.diff_column_data_types"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "source_relation", "type": null, "description": ""}, {"name": "target_relation", "type": null, "description": ""}], "created_at": 1789422566.619802, "supported_languages": null}, "macro.dbt.sync_column_schemas": {"name": "sync_column_schemas", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/on_schema_change.sql", "original_file_path": "macros/materializations/models/incremental/on_schema_change.sql", "unique_id": "macro.dbt.sync_column_schemas", "macro_sql": "{% macro sync_column_schemas(on_schema_change, target_relation, schema_changes_dict) %}\n {{ return(adapter.dispatch('sync_column_schemas', 'dbt')(on_schema_change, target_relation, schema_changes_dict)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__sync_column_schemas"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "on_schema_change", "type": null, "description": ""}, {"name": "target_relation", "type": null, "description": ""}, {"name": "schema_changes_dict", "type": null, "description": ""}], "created_at": 1789422566.6203303, "supported_languages": null}, "macro.dbt.default__sync_column_schemas": {"name": "default__sync_column_schemas", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/on_schema_change.sql", "original_file_path": "macros/materializations/models/incremental/on_schema_change.sql", "unique_id": "macro.dbt.default__sync_column_schemas", "macro_sql": "{% macro default__sync_column_schemas(on_schema_change, target_relation, schema_changes_dict) %}\n\n {%- set add_to_target_arr = schema_changes_dict['source_not_in_target'] -%}\n {%- set remove_from_target_arr = schema_changes_dict['target_not_in_source'] -%}\n {%- set new_target_types = schema_changes_dict['new_target_types'] -%}\n\n {%- if on_schema_change == 'append_new_columns'-%}\n {%- if add_to_target_arr | length > 0 -%}\n {%- do alter_relation_add_remove_columns(target_relation, add_to_target_arr, none) -%}\n {%- endif -%}\n\n {% elif on_schema_change == 'sync_all_columns' %}\n\n {% if add_to_target_arr | length > 0 or remove_from_target_arr | length > 0 %}\n {%- do alter_relation_add_remove_columns(target_relation, add_to_target_arr, remove_from_target_arr) -%}\n {% endif %}\n\n {% if new_target_types != [] %}\n {% for ntt in new_target_types %}\n {% set column_name = ntt['column_name'] %}\n {% set new_type = ntt['new_type'] %}\n {% do alter_column_type(target_relation, column_name, new_type) %}\n {% endfor %}\n {% endif %}\n\n {% endif %}\n\n {% set schema_change_message %}\n In {{ target_relation }}:\n Schema change approach: {{ on_schema_change }}\n Columns added: {{ add_to_target_arr }}\n Columns removed: {{ remove_from_target_arr }}\n Data types changed: {{ new_target_types }}\n {% endset %}\n\n {% do log(schema_change_message) %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.alter_relation_add_remove_columns", "macro.dbt.alter_column_type"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "on_schema_change", "type": null, "description": ""}, {"name": "target_relation", "type": null, "description": ""}, {"name": "schema_changes_dict", "type": null, "description": ""}], "created_at": 1789422566.6228302, "supported_languages": null}, "macro.dbt.process_schema_changes": {"name": "process_schema_changes", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/on_schema_change.sql", "original_file_path": "macros/materializations/models/incremental/on_schema_change.sql", "unique_id": "macro.dbt.process_schema_changes", "macro_sql": "{% macro process_schema_changes(on_schema_change, source_relation, target_relation) %}\n {{ return(adapter.dispatch('process_schema_changes', 'dbt')(on_schema_change, source_relation, target_relation)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__process_schema_changes"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "on_schema_change", "type": null, "description": ""}, {"name": "source_relation", "type": null, "description": ""}, {"name": "target_relation", "type": null, "description": ""}], "created_at": 1789422566.6235557, "supported_languages": null}, "macro.dbt.default__process_schema_changes": {"name": "default__process_schema_changes", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/on_schema_change.sql", "original_file_path": "macros/materializations/models/incremental/on_schema_change.sql", "unique_id": "macro.dbt.default__process_schema_changes", "macro_sql": "{% macro default__process_schema_changes(on_schema_change, source_relation, target_relation) %}\n\n {% if on_schema_change == 'ignore' %}\n\n {{ return({}) }}\n\n {% else %}\n\n {% set schema_changes_dict = check_for_schema_changes(source_relation, target_relation) %}\n\n {% if schema_changes_dict['schema_changed'] %}\n\n {% if on_schema_change == 'fail' %}\n\n {% set fail_msg %}\n The source and target schemas on this incremental model are out of sync!\n They can be reconciled in several ways:\n - set the `on_schema_change` config to either append_new_columns or sync_all_columns, depending on your situation.\n - Re-run the incremental model with `full_refresh: True` to update the target schema.\n - update the schema manually and re-run the process.\n\n Additional troubleshooting context:\n Source columns not in target: {{ schema_changes_dict['source_not_in_target'] }}\n Target columns not in source: {{ schema_changes_dict['target_not_in_source'] }}\n New column types: {{ schema_changes_dict['new_target_types'] }}\n {% endset %}\n\n {% do exceptions.raise_compiler_error(fail_msg) %}\n\n {# -- unless we ignore, run the sync operation per the config #}\n {% else %}\n\n {% do sync_column_schemas(on_schema_change, target_relation, schema_changes_dict) %}\n\n {% endif %}\n\n {% endif %}\n\n {{ return(schema_changes_dict['source_columns']) }}\n\n {% endif %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.check_for_schema_changes", "macro.dbt.sync_column_schemas"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "on_schema_change", "type": null, "description": ""}, {"name": "source_relation", "type": null, "description": ""}, {"name": "target_relation", "type": null, "description": ""}], "created_at": 1789422566.6253078, "supported_languages": null}, "macro.dbt.get_merge_sql": {"name": "get_merge_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/merge.sql", "original_file_path": "macros/materializations/models/incremental/merge.sql", "unique_id": "macro.dbt.get_merge_sql", "macro_sql": "{% macro get_merge_sql(target, source, unique_key, dest_columns, incremental_predicates=none) -%}\n -- back compat for old kwarg name\n {% set incremental_predicates = kwargs.get('predicates', incremental_predicates) %}\n {{ adapter.dispatch('get_merge_sql', 'dbt')(target, source, unique_key, dest_columns, incremental_predicates) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "target", "type": null, "description": ""}, {"name": "source", "type": null, "description": ""}, {"name": "unique_key", "type": null, "description": ""}, {"name": "dest_columns", "type": null, "description": ""}, {"name": "incremental_predicates", "type": null, "description": ""}], "created_at": 1789422566.6276743, "supported_languages": null}, "macro.dbt.get_merge_unique_key_match": {"name": "get_merge_unique_key_match", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/merge.sql", "original_file_path": "macros/materializations/models/incremental/merge.sql", "unique_id": "macro.dbt.get_merge_unique_key_match", "macro_sql": "{% macro get_merge_unique_key_match(source_unique_key, target_unique_key) %}\n {{ return(adapter.dispatch('get_merge_unique_key_match', 'dbt')(source_unique_key, target_unique_key)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_merge_unique_key_match"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "source_unique_key", "type": null, "description": ""}, {"name": "target_unique_key", "type": null, "description": ""}], "created_at": 1789422566.6281452, "supported_languages": null}, "macro.dbt.default__get_merge_unique_key_match": {"name": "default__get_merge_unique_key_match", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/merge.sql", "original_file_path": "macros/materializations/models/incremental/merge.sql", "unique_id": "macro.dbt.default__get_merge_unique_key_match", "macro_sql": "{% macro default__get_merge_unique_key_match(source_unique_key, target_unique_key) -%}\n {{ return(equals(source_unique_key, target_unique_key) | trim) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.equals"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "source_unique_key", "type": null, "description": ""}, {"name": "target_unique_key", "type": null, "description": ""}], "created_at": 1789422566.6285443, "supported_languages": null}, "macro.dbt.default__get_merge_sql": {"name": "default__get_merge_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/merge.sql", "original_file_path": "macros/materializations/models/incremental/merge.sql", "unique_id": "macro.dbt.default__get_merge_sql", "macro_sql": "{% macro default__get_merge_sql(target, source, unique_key, dest_columns, incremental_predicates=none) -%}\n {%- set predicates = [] if incremental_predicates is none else [] + incremental_predicates -%}\n {%- set dest_cols_csv = get_quoted_csv(dest_columns | map(attribute=\"name\")) -%}\n {%- set merge_update_columns = config.get('merge_update_columns') -%}\n {%- set merge_exclude_columns = config.get('merge_exclude_columns') -%}\n {%- set update_columns = get_merge_update_columns(merge_update_columns, merge_exclude_columns, dest_columns) -%}\n {%- set sql_header = config.get('sql_header', none) -%}\n\n {% if unique_key %}\n {% if unique_key is sequence and unique_key is not mapping and unique_key is not string %}\n {% for key in unique_key %}\n {% set this_key_match %}\n DBT_INTERNAL_SOURCE.{{ key }} = DBT_INTERNAL_DEST.{{ key }}\n {% endset %}\n {% do predicates.append(this_key_match) %}\n {% endfor %}\n {% else %}\n {% set source_unique_key = (\"DBT_INTERNAL_SOURCE.\" ~ unique_key) | trim %}\n {% set target_unique_key = (\"DBT_INTERNAL_DEST.\" ~ unique_key) | trim %}\n {% set unique_key_match = get_merge_unique_key_match(source_unique_key, target_unique_key) %}\n {% do predicates.append(unique_key_match) %}\n {% endif %}\n {% else %}\n {% do predicates.append('FALSE') %}\n {% endif %}\n\n {{ sql_header if sql_header is not none }}\n\n merge into {{ target }} as DBT_INTERNAL_DEST\n using {{ source }} as DBT_INTERNAL_SOURCE\n on {{\"(\" ~ predicates | join(\") and (\") ~ \")\"}}\n\n {% if unique_key %}\n when matched then update set\n {% for column_name in update_columns -%}\n {{ column_name }} = DBT_INTERNAL_SOURCE.{{ column_name }}\n {%- if not loop.last %}, {%- endif %}\n {%- endfor %}\n {% endif %}\n\n when not matched then insert\n ({{ dest_cols_csv }})\n values\n ({{ dest_cols_csv }})\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_quoted_csv", "macro.dbt.get_merge_update_columns", "macro.dbt.get_merge_unique_key_match"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "target", "type": null, "description": ""}, {"name": "source", "type": null, "description": ""}, {"name": "unique_key", "type": null, "description": ""}, {"name": "dest_columns", "type": null, "description": ""}, {"name": "incremental_predicates", "type": null, "description": ""}], "created_at": 1789422566.6321812, "supported_languages": null}, "macro.dbt.get_delete_insert_merge_sql": {"name": "get_delete_insert_merge_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/merge.sql", "original_file_path": "macros/materializations/models/incremental/merge.sql", "unique_id": "macro.dbt.get_delete_insert_merge_sql", "macro_sql": "{% macro get_delete_insert_merge_sql(target, source, unique_key, dest_columns, incremental_predicates) -%}\n {{ adapter.dispatch('get_delete_insert_merge_sql', 'dbt')(target, source, unique_key, dest_columns, incremental_predicates) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_delete_insert_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "target", "type": null, "description": ""}, {"name": "source", "type": null, "description": ""}, {"name": "unique_key", "type": null, "description": ""}, {"name": "dest_columns", "type": null, "description": ""}, {"name": "incremental_predicates", "type": null, "description": ""}], "created_at": 1789422566.6327806, "supported_languages": null}, "macro.dbt.default__get_delete_insert_merge_sql": {"name": "default__get_delete_insert_merge_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/merge.sql", "original_file_path": "macros/materializations/models/incremental/merge.sql", "unique_id": "macro.dbt.default__get_delete_insert_merge_sql", "macro_sql": "{% macro default__get_delete_insert_merge_sql(target, source, unique_key, dest_columns, incremental_predicates) -%}\n\n {%- set dest_cols_csv = get_quoted_csv(dest_columns | map(attribute=\"name\")) -%}\n\n {% if unique_key %}\n {% if unique_key is string %}\n {% set unique_key = [unique_key] %}\n {% endif %}\n\n {%- set unique_key_str = unique_key|join(', ') -%}\n\n delete from {{ target }} as DBT_INTERNAL_DEST\n where ({{ unique_key_str }}) in (\n select distinct {{ unique_key_str }}\n from {{ source }} as DBT_INTERNAL_SOURCE\n )\n {%- if incremental_predicates %}\n {% for predicate in incremental_predicates %}\n and {{ predicate }}\n {% endfor %}\n {%- endif -%};\n\n {% endif %}\n\n insert into {{ target }} ({{ dest_cols_csv }})\n (\n select {{ dest_cols_csv }}\n from {{ source }}\n )\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.get_quoted_csv"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "target", "type": null, "description": ""}, {"name": "source", "type": null, "description": ""}, {"name": "unique_key", "type": null, "description": ""}, {"name": "dest_columns", "type": null, "description": ""}, {"name": "incremental_predicates", "type": null, "description": ""}], "created_at": 1789422566.634303, "supported_languages": null}, "macro.dbt.get_insert_overwrite_merge_sql": {"name": "get_insert_overwrite_merge_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/merge.sql", "original_file_path": "macros/materializations/models/incremental/merge.sql", "unique_id": "macro.dbt.get_insert_overwrite_merge_sql", "macro_sql": "{% macro get_insert_overwrite_merge_sql(target, source, dest_columns, predicates, include_sql_header=false) -%}\n {{ adapter.dispatch('get_insert_overwrite_merge_sql', 'dbt')(target, source, dest_columns, predicates, include_sql_header) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_insert_overwrite_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "target", "type": null, "description": ""}, {"name": "source", "type": null, "description": ""}, {"name": "dest_columns", "type": null, "description": ""}, {"name": "predicates", "type": null, "description": ""}, {"name": "include_sql_header", "type": null, "description": ""}], "created_at": 1789422566.6349115, "supported_languages": null}, "macro.dbt.default__get_insert_overwrite_merge_sql": {"name": "default__get_insert_overwrite_merge_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/merge.sql", "original_file_path": "macros/materializations/models/incremental/merge.sql", "unique_id": "macro.dbt.default__get_insert_overwrite_merge_sql", "macro_sql": "{% macro default__get_insert_overwrite_merge_sql(target, source, dest_columns, predicates, include_sql_header) -%}\n {#-- The only time include_sql_header is True: --#}\n {#-- BigQuery + insert_overwrite strategy + \"static\" partitions config --#}\n {#-- We should consider including the sql header at the materialization level instead --#}\n\n {%- set predicates = [] if predicates is none else [] + predicates -%}\n {%- set dest_cols_csv = get_quoted_csv(dest_columns | map(attribute=\"name\")) -%}\n {%- set sql_header = config.get('sql_header', none) -%}\n\n {{ sql_header if sql_header is not none and include_sql_header }}\n\n merge into {{ target }} as DBT_INTERNAL_DEST\n using {{ source }} as DBT_INTERNAL_SOURCE\n on FALSE\n\n when not matched by source\n {% if predicates %} and {{ predicates | join(' and ') }} {% endif %}\n then delete\n\n when not matched then insert\n ({{ dest_cols_csv }})\n values\n ({{ dest_cols_csv }})\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_quoted_csv"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "target", "type": null, "description": ""}, {"name": "source", "type": null, "description": ""}, {"name": "dest_columns", "type": null, "description": ""}, {"name": "predicates", "type": null, "description": ""}, {"name": "include_sql_header", "type": null, "description": ""}], "created_at": 1789422566.6362722, "supported_languages": null}, "macro.dbt.is_incremental": {"name": "is_incremental", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/is_incremental.sql", "original_file_path": "macros/materializations/models/incremental/is_incremental.sql", "unique_id": "macro.dbt.is_incremental", "macro_sql": "{% macro is_incremental() %}\n {#-- do not run introspective queries in parsing #}\n {% if not execute %}\n {{ return(False) }}\n {% else %}\n {% set relation = adapter.get_relation(this.database, this.schema, this.table) %}\n {{ return(relation is not none\n and relation.type == 'table'\n and model.config.materialized == 'incremental'\n and not should_full_refresh()) }}\n {% endif %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.should_full_refresh"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789422566.6375062, "supported_languages": null}, "macro.dbt.date": {"name": "date", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/date.sql", "original_file_path": "macros/utils/date.sql", "unique_id": "macro.dbt.date", "macro_sql": "{% macro date(year, month, day) %}\n {{ return(adapter.dispatch('date', 'dbt') (year, month, day)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__date"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "year", "type": null, "description": ""}, {"name": "month", "type": null, "description": ""}, {"name": "day", "type": null, "description": ""}], "created_at": 1789422566.638219, "supported_languages": null}, "macro.dbt.default__date": {"name": "default__date", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/date.sql", "original_file_path": "macros/utils/date.sql", "unique_id": "macro.dbt.default__date", "macro_sql": "{% macro default__date(year, month, day) -%}\n {%- set dt = modules.datetime.date(year, month, day) -%}\n {%- set iso_8601_formatted_date = dt.strftime('%Y-%m-%d') -%}\n to_date('{{ iso_8601_formatted_date }}', 'YYYY-MM-DD')\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "year", "type": null, "description": ""}, {"name": "month", "type": null, "description": ""}, {"name": "day", "type": null, "description": ""}], "created_at": 1789422566.6388443, "supported_languages": null}, "macro.dbt.safe_cast": {"name": "safe_cast", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/safe_cast.sql", "original_file_path": "macros/utils/safe_cast.sql", "unique_id": "macro.dbt.safe_cast", "macro_sql": "{% macro safe_cast(field, type) %}\n {{ return(adapter.dispatch('safe_cast', 'dbt') (field, type)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__safe_cast"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field", "type": null, "description": ""}, {"name": "type", "type": null, "description": ""}], "created_at": 1789422566.639453, "supported_languages": null}, "macro.dbt.default__safe_cast": {"name": "default__safe_cast", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/safe_cast.sql", "original_file_path": "macros/utils/safe_cast.sql", "unique_id": "macro.dbt.default__safe_cast", "macro_sql": "{% macro default__safe_cast(field, type) %}\n {# most databases don't support this function yet\n so we just need to use cast #}\n cast({{field}} as {{type}})\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field", "type": null, "description": ""}, {"name": "type", "type": null, "description": ""}], "created_at": 1789422566.6397977, "supported_languages": null}, "macro.dbt.array_concat": {"name": "array_concat", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/array_concat.sql", "original_file_path": "macros/utils/array_concat.sql", "unique_id": "macro.dbt.array_concat", "macro_sql": "{% macro array_concat(array_1, array_2) -%}\n {{ return(adapter.dispatch('array_concat', 'dbt')(array_1, array_2)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__array_concat"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "array_1", "type": null, "description": ""}, {"name": "array_2", "type": null, "description": ""}], "created_at": 1789422566.6405811, "supported_languages": null}, "macro.dbt.default__array_concat": {"name": "default__array_concat", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/array_concat.sql", "original_file_path": "macros/utils/array_concat.sql", "unique_id": "macro.dbt.default__array_concat", "macro_sql": "{% macro default__array_concat(array_1, array_2) -%}\n array_cat({{ array_1 }}, {{ array_2 }})\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "array_1", "type": null, "description": ""}, {"name": "array_2", "type": null, "description": ""}], "created_at": 1789422566.6408834, "supported_languages": null}, "macro.dbt.escape_single_quotes": {"name": "escape_single_quotes", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/escape_single_quotes.sql", "original_file_path": "macros/utils/escape_single_quotes.sql", "unique_id": "macro.dbt.escape_single_quotes", "macro_sql": "{% macro escape_single_quotes(expression) %}\n {{ return(adapter.dispatch('escape_single_quotes', 'dbt') (expression)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__escape_single_quotes"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "expression", "type": null, "description": ""}], "created_at": 1789422566.6414423, "supported_languages": null}, "macro.dbt.default__escape_single_quotes": {"name": "default__escape_single_quotes", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/escape_single_quotes.sql", "original_file_path": "macros/utils/escape_single_quotes.sql", "unique_id": "macro.dbt.default__escape_single_quotes", "macro_sql": "{% macro default__escape_single_quotes(expression) -%}\n{{ expression | replace(\"'\",\"''\") }}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "expression", "type": null, "description": ""}], "created_at": 1789422566.641783, "supported_languages": null}, "macro.dbt.type_string": {"name": "type_string", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "unique_id": "macro.dbt.type_string", "macro_sql": "\n\n{%- macro type_string() -%}\n {{ return(adapter.dispatch('type_string', 'dbt')()) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt.default__type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789422566.6431413, "supported_languages": null}, "macro.dbt.default__type_string": {"name": "default__type_string", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "unique_id": "macro.dbt.default__type_string", "macro_sql": "{% macro default__type_string() %}\n {{ return(api.Column.translate_type(\"string\")) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789422566.6434603, "supported_languages": null}, "macro.dbt.type_timestamp": {"name": "type_timestamp", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "unique_id": "macro.dbt.type_timestamp", "macro_sql": "\n\n{%- macro type_timestamp() -%}\n {{ return(adapter.dispatch('type_timestamp', 'dbt')()) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt.default__type_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789422566.6438212, "supported_languages": null}, "macro.dbt.default__type_timestamp": {"name": "default__type_timestamp", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "unique_id": "macro.dbt.default__type_timestamp", "macro_sql": "{% macro default__type_timestamp() %}\n {{ return(api.Column.translate_type(\"timestamp\")) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789422566.6441386, "supported_languages": null}, "macro.dbt.type_float": {"name": "type_float", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "unique_id": "macro.dbt.type_float", "macro_sql": "\n\n{%- macro type_float() -%}\n {{ return(adapter.dispatch('type_float', 'dbt')()) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt.default__type_float"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789422566.6444724, "supported_languages": null}, "macro.dbt.default__type_float": {"name": "default__type_float", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "unique_id": "macro.dbt.default__type_float", "macro_sql": "{% macro default__type_float() %}\n {{ return(api.Column.translate_type(\"float\")) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789422566.6448133, "supported_languages": null}, "macro.dbt.type_numeric": {"name": "type_numeric", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "unique_id": "macro.dbt.type_numeric", "macro_sql": "\n\n{%- macro type_numeric() -%}\n {{ return(adapter.dispatch('type_numeric', 'dbt')()) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt.default__type_numeric"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789422566.645146, "supported_languages": null}, "macro.dbt.default__type_numeric": {"name": "default__type_numeric", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "unique_id": "macro.dbt.default__type_numeric", "macro_sql": "{% macro default__type_numeric() %}\n {{ return(api.Column.numeric_type(\"numeric\", 28, 6)) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789422566.6455076, "supported_languages": null}, "macro.dbt.type_bigint": {"name": "type_bigint", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "unique_id": "macro.dbt.type_bigint", "macro_sql": "\n\n{%- macro type_bigint() -%}\n {{ return(adapter.dispatch('type_bigint', 'dbt')()) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt.default__type_bigint"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789422566.6459658, "supported_languages": null}, "macro.dbt.default__type_bigint": {"name": "default__type_bigint", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "unique_id": "macro.dbt.default__type_bigint", "macro_sql": "{% macro default__type_bigint() %}\n {{ return(api.Column.translate_type(\"bigint\")) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789422566.6463103, "supported_languages": null}, "macro.dbt.type_int": {"name": "type_int", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "unique_id": "macro.dbt.type_int", "macro_sql": "\n\n{%- macro type_int() -%}\n {{ return(adapter.dispatch('type_int', 'dbt')()) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt.default__type_int"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789422566.646671, "supported_languages": null}, "macro.dbt.default__type_int": {"name": "default__type_int", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "unique_id": "macro.dbt.default__type_int", "macro_sql": "{%- macro default__type_int() -%}\n {{ return(api.Column.translate_type(\"integer\")) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789422566.64698, "supported_languages": null}, "macro.dbt.type_boolean": {"name": "type_boolean", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "unique_id": "macro.dbt.type_boolean", "macro_sql": "\n\n{%- macro type_boolean() -%}\n {{ return(adapter.dispatch('type_boolean', 'dbt')()) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt.default__type_boolean"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789422566.6474552, "supported_languages": null}, "macro.dbt.default__type_boolean": {"name": "default__type_boolean", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "unique_id": "macro.dbt.default__type_boolean", "macro_sql": "{%- macro default__type_boolean() -%}\n {{ return(api.Column.translate_type(\"boolean\")) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789422566.6477861, "supported_languages": null}, "macro.dbt.array_append": {"name": "array_append", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/array_append.sql", "original_file_path": "macros/utils/array_append.sql", "unique_id": "macro.dbt.array_append", "macro_sql": "{% macro array_append(array, new_element) -%}\n {{ return(adapter.dispatch('array_append', 'dbt')(array, new_element)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__array_append"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "array", "type": null, "description": ""}, {"name": "new_element", "type": null, "description": ""}], "created_at": 1789422566.6483893, "supported_languages": null}, "macro.dbt.default__array_append": {"name": "default__array_append", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/array_append.sql", "original_file_path": "macros/utils/array_append.sql", "unique_id": "macro.dbt.default__array_append", "macro_sql": "{% macro default__array_append(array, new_element) -%}\n array_append({{ array }}, {{ new_element }})\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "array", "type": null, "description": ""}, {"name": "new_element", "type": null, "description": ""}], "created_at": 1789422566.6487083, "supported_languages": null}, "macro.dbt.get_powers_of_two": {"name": "get_powers_of_two", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/generate_series.sql", "original_file_path": "macros/utils/generate_series.sql", "unique_id": "macro.dbt.get_powers_of_two", "macro_sql": "{% macro get_powers_of_two(upper_bound) %}\n {{ return(adapter.dispatch('get_powers_of_two', 'dbt')(upper_bound)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_powers_of_two"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "upper_bound", "type": null, "description": ""}], "created_at": 1789422566.649593, "supported_languages": null}, "macro.dbt.default__get_powers_of_two": {"name": "default__get_powers_of_two", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/generate_series.sql", "original_file_path": "macros/utils/generate_series.sql", "unique_id": "macro.dbt.default__get_powers_of_two", "macro_sql": "{% macro default__get_powers_of_two(upper_bound) %}\n\n {% if upper_bound <= 0 %}\n {{ exceptions.raise_compiler_error(\"upper bound must be positive\") }}\n {% endif %}\n\n {% for _ in range(1, 100) %}\n {% if upper_bound <= 2 ** loop.index %}{{ return(loop.index) }}{% endif %}\n {% endfor %}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "upper_bound", "type": null, "description": ""}], "created_at": 1789422566.6504695, "supported_languages": null}, "macro.dbt.generate_series": {"name": "generate_series", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/generate_series.sql", "original_file_path": "macros/utils/generate_series.sql", "unique_id": "macro.dbt.generate_series", "macro_sql": "{% macro generate_series(upper_bound) %}\n {{ return(adapter.dispatch('generate_series', 'dbt')(upper_bound)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__generate_series"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "upper_bound", "type": null, "description": ""}], "created_at": 1789422566.65088, "supported_languages": null}, "macro.dbt.default__generate_series": {"name": "default__generate_series", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/generate_series.sql", "original_file_path": "macros/utils/generate_series.sql", "unique_id": "macro.dbt.default__generate_series", "macro_sql": "{% macro default__generate_series(upper_bound) %}\n\n {% set n = dbt.get_powers_of_two(upper_bound) %}\n\n with p as (\n select 0 as generated_number union all select 1\n ), unioned as (\n\n select\n\n {% for i in range(n) %}\n p{{i}}.generated_number * power(2, {{i}})\n {% if not loop.last %} + {% endif %}\n {% endfor %}\n + 1\n as generated_number\n\n from\n\n {% for i in range(n) %}\n p as p{{i}}\n {% if not loop.last %} cross join {% endif %}\n {% endfor %}\n\n )\n\n select *\n from unioned\n where generated_number <= {{upper_bound}}\n order by generated_number\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_powers_of_two"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "upper_bound", "type": null, "description": ""}], "created_at": 1789422566.6519334, "supported_languages": null}, "macro.dbt.right": {"name": "right", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/right.sql", "original_file_path": "macros/utils/right.sql", "unique_id": "macro.dbt.right", "macro_sql": "{% macro right(string_text, length_expression) -%}\n {{ return(adapter.dispatch('right', 'dbt') (string_text, length_expression)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__right"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "string_text", "type": null, "description": ""}, {"name": "length_expression", "type": null, "description": ""}], "created_at": 1789422566.6525445, "supported_languages": null}, "macro.dbt.default__right": {"name": "default__right", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/right.sql", "original_file_path": "macros/utils/right.sql", "unique_id": "macro.dbt.default__right", "macro_sql": "{% macro default__right(string_text, length_expression) %}\n\n right(\n {{ string_text }},\n {{ length_expression }}\n )\n\n{%- endmacro -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "string_text", "type": null, "description": ""}, {"name": "length_expression", "type": null, "description": ""}], "created_at": 1789422566.6528485, "supported_languages": null}, "macro.dbt.hash": {"name": "hash", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/hash.sql", "original_file_path": "macros/utils/hash.sql", "unique_id": "macro.dbt.hash", "macro_sql": "{% macro hash(field) -%}\n {{ return(adapter.dispatch('hash', 'dbt') (field)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__hash"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field", "type": null, "description": ""}], "created_at": 1789422566.653364, "supported_languages": null}, "macro.dbt.default__hash": {"name": "default__hash", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/hash.sql", "original_file_path": "macros/utils/hash.sql", "unique_id": "macro.dbt.default__hash", "macro_sql": "{% macro default__hash(field) -%}\n md5(cast({{ field }} as {{ api.Column.translate_type('string') }}))\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field", "type": null, "description": ""}], "created_at": 1789422566.6537268, "supported_languages": null}, "macro.dbt.intersect": {"name": "intersect", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/intersect.sql", "original_file_path": "macros/utils/intersect.sql", "unique_id": "macro.dbt.intersect", "macro_sql": "{% macro intersect() %}\n {{ return(adapter.dispatch('intersect', 'dbt')()) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__intersect"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789422566.6541848, "supported_languages": null}, "macro.dbt.default__intersect": {"name": "default__intersect", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/intersect.sql", "original_file_path": "macros/utils/intersect.sql", "unique_id": "macro.dbt.default__intersect", "macro_sql": "{% macro default__intersect() %}\n\n intersect\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789422566.6543596, "supported_languages": null}, "macro.dbt.last_day": {"name": "last_day", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/last_day.sql", "original_file_path": "macros/utils/last_day.sql", "unique_id": "macro.dbt.last_day", "macro_sql": "{% macro last_day(date, datepart) %}\n {{ return(adapter.dispatch('last_day', 'dbt') (date, datepart)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__last_day"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "date", "type": null, "description": ""}, {"name": "datepart", "type": null, "description": ""}], "created_at": 1789422566.6549988, "supported_languages": null}, "macro.dbt.default_last_day": {"name": "default_last_day", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/last_day.sql", "original_file_path": "macros/utils/last_day.sql", "unique_id": "macro.dbt.default_last_day", "macro_sql": "\n\n{%- macro default_last_day(date, datepart) -%}\n cast(\n {{dbt.dateadd('day', '-1',\n dbt.dateadd(datepart, '1', dbt.date_trunc(datepart, date))\n )}}\n as date)\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt.dateadd", "macro.dbt.date_trunc"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "date", "type": null, "description": ""}, {"name": "datepart", "type": null, "description": ""}], "created_at": 1789422566.6555607, "supported_languages": null}, "macro.dbt.default__last_day": {"name": "default__last_day", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/last_day.sql", "original_file_path": "macros/utils/last_day.sql", "unique_id": "macro.dbt.default__last_day", "macro_sql": "{% macro default__last_day(date, datepart) -%}\n {{dbt.default_last_day(date, datepart)}}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default_last_day"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "date", "type": null, "description": ""}, {"name": "datepart", "type": null, "description": ""}], "created_at": 1789422566.6560266, "supported_languages": null}, "macro.dbt.listagg": {"name": "listagg", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/listagg.sql", "original_file_path": "macros/utils/listagg.sql", "unique_id": "macro.dbt.listagg", "macro_sql": "{% macro listagg(measure, delimiter_text=\"','\", order_by_clause=none, limit_num=none) -%}\n {{ return(adapter.dispatch('listagg', 'dbt') (measure, delimiter_text, order_by_clause, limit_num)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__listagg"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "measure", "type": null, "description": ""}, {"name": "delimiter_text", "type": null, "description": ""}, {"name": "order_by_clause", "type": null, "description": ""}, {"name": "limit_num", "type": null, "description": ""}], "created_at": 1789422566.656923, "supported_languages": null}, "macro.dbt.default__listagg": {"name": "default__listagg", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/listagg.sql", "original_file_path": "macros/utils/listagg.sql", "unique_id": "macro.dbt.default__listagg", "macro_sql": "{% macro default__listagg(measure, delimiter_text, order_by_clause, limit_num) -%}\n\n {% if limit_num -%}\n array_to_string(\n array_slice(\n array_agg(\n {{ measure }}\n ){% if order_by_clause -%}\n within group ({{ order_by_clause }})\n {%- endif %}\n ,0\n ,{{ limit_num }}\n ),\n {{ delimiter_text }}\n )\n {%- else %}\n listagg(\n {{ measure }},\n {{ delimiter_text }}\n )\n {% if order_by_clause -%}\n within group ({{ order_by_clause }})\n {%- endif %}\n {%- endif %}\n\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "measure", "type": null, "description": ""}, {"name": "delimiter_text", "type": null, "description": ""}, {"name": "order_by_clause", "type": null, "description": ""}, {"name": "limit_num", "type": null, "description": ""}], "created_at": 1789422566.6577795, "supported_languages": null}, "macro.dbt.cast_bool_to_text": {"name": "cast_bool_to_text", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/cast_bool_to_text.sql", "original_file_path": "macros/utils/cast_bool_to_text.sql", "unique_id": "macro.dbt.cast_bool_to_text", "macro_sql": "{% macro cast_bool_to_text(field) %}\n {{ adapter.dispatch('cast_bool_to_text', 'dbt') (field) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__cast_bool_to_text"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field", "type": null, "description": ""}], "created_at": 1789422566.658277, "supported_languages": null}, "macro.dbt.default__cast_bool_to_text": {"name": "default__cast_bool_to_text", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/cast_bool_to_text.sql", "original_file_path": "macros/utils/cast_bool_to_text.sql", "unique_id": "macro.dbt.default__cast_bool_to_text", "macro_sql": "{% macro default__cast_bool_to_text(field) %}\n cast({{ field }} as {{ api.Column.translate_type('string') }})\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field", "type": null, "description": ""}], "created_at": 1789422566.6586301, "supported_languages": null}, "macro.dbt.date_trunc": {"name": "date_trunc", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/date_trunc.sql", "original_file_path": "macros/utils/date_trunc.sql", "unique_id": "macro.dbt.date_trunc", "macro_sql": "{% macro date_trunc(datepart, date) -%}\n {{ return(adapter.dispatch('date_trunc', 'dbt') (datepart, date)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__date_trunc"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "datepart", "type": null, "description": ""}, {"name": "date", "type": null, "description": ""}], "created_at": 1789422566.6591804, "supported_languages": null}, "macro.dbt.default__date_trunc": {"name": "default__date_trunc", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/date_trunc.sql", "original_file_path": "macros/utils/date_trunc.sql", "unique_id": "macro.dbt.default__date_trunc", "macro_sql": "{% macro default__date_trunc(datepart, date) -%}\n date_trunc('{{datepart}}', {{date}})\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "datepart", "type": null, "description": ""}, {"name": "date", "type": null, "description": ""}], "created_at": 1789422566.6594713, "supported_languages": null}, "macro.dbt.position": {"name": "position", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/position.sql", "original_file_path": "macros/utils/position.sql", "unique_id": "macro.dbt.position", "macro_sql": "{% macro position(substring_text, string_text) -%}\n {{ return(adapter.dispatch('position', 'dbt') (substring_text, string_text)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__position"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "substring_text", "type": null, "description": ""}, {"name": "string_text", "type": null, "description": ""}], "created_at": 1789422566.6600716, "supported_languages": null}, "macro.dbt.default__position": {"name": "default__position", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/position.sql", "original_file_path": "macros/utils/position.sql", "unique_id": "macro.dbt.default__position", "macro_sql": "{% macro default__position(substring_text, string_text) %}\n\n position(\n {{ substring_text }} in {{ string_text }}\n )\n\n{%- endmacro -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "substring_text", "type": null, "description": ""}, {"name": "string_text", "type": null, "description": ""}], "created_at": 1789422566.6603727, "supported_languages": null}, "macro.dbt.any_value": {"name": "any_value", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/any_value.sql", "original_file_path": "macros/utils/any_value.sql", "unique_id": "macro.dbt.any_value", "macro_sql": "{% macro any_value(expression) -%}\n {{ return(adapter.dispatch('any_value', 'dbt') (expression)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__any_value"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "expression", "type": null, "description": ""}], "created_at": 1789422566.660899, "supported_languages": null}, "macro.dbt.default__any_value": {"name": "default__any_value", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/any_value.sql", "original_file_path": "macros/utils/any_value.sql", "unique_id": "macro.dbt.default__any_value", "macro_sql": "{% macro default__any_value(expression) -%}\n\n any_value({{ expression }})\n\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "expression", "type": null, "description": ""}], "created_at": 1789422566.66113, "supported_languages": null}, "macro.dbt.length": {"name": "length", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/length.sql", "original_file_path": "macros/utils/length.sql", "unique_id": "macro.dbt.length", "macro_sql": "{% macro length(expression) -%}\n {{ return(adapter.dispatch('length', 'dbt') (expression)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__length"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "expression", "type": null, "description": ""}], "created_at": 1789422566.6616504, "supported_languages": null}, "macro.dbt.default__length": {"name": "default__length", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/length.sql", "original_file_path": "macros/utils/length.sql", "unique_id": "macro.dbt.default__length", "macro_sql": "{% macro default__length(expression) %}\n\n length(\n {{ expression }}\n )\n\n{%- endmacro -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "expression", "type": null, "description": ""}], "created_at": 1789422566.6618798, "supported_languages": null}, "macro.dbt.cast": {"name": "cast", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/cast.sql", "original_file_path": "macros/utils/cast.sql", "unique_id": "macro.dbt.cast", "macro_sql": "{% macro cast(field, type) %}\n {{ return(adapter.dispatch('cast', 'dbt') (field, type)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__cast"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field", "type": null, "description": ""}, {"name": "type", "type": null, "description": ""}], "created_at": 1789422566.66242, "supported_languages": null}, "macro.dbt.default__cast": {"name": "default__cast", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/cast.sql", "original_file_path": "macros/utils/cast.sql", "unique_id": "macro.dbt.default__cast", "macro_sql": "{% macro default__cast(field, type) %}\n cast({{field}} as {{type}})\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field", "type": null, "description": ""}, {"name": "type", "type": null, "description": ""}], "created_at": 1789422566.662723, "supported_languages": null}, "macro.dbt.get_intervals_between": {"name": "get_intervals_between", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/date_spine.sql", "original_file_path": "macros/utils/date_spine.sql", "unique_id": "macro.dbt.get_intervals_between", "macro_sql": "{% macro get_intervals_between(start_date, end_date, datepart) -%}\n {{ return(adapter.dispatch('get_intervals_between', 'dbt')(start_date, end_date, datepart)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_intervals_between"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "start_date", "type": null, "description": ""}, {"name": "end_date", "type": null, "description": ""}, {"name": "datepart", "type": null, "description": ""}], "created_at": 1789422566.6638603, "supported_languages": null}, "macro.dbt.default__get_intervals_between": {"name": "default__get_intervals_between", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/date_spine.sql", "original_file_path": "macros/utils/date_spine.sql", "unique_id": "macro.dbt.default__get_intervals_between", "macro_sql": "{% macro default__get_intervals_between(start_date, end_date, datepart) -%}\n {%- call statement('get_intervals_between', fetch_result=True) %}\n\n select {{ dbt.datediff(start_date, end_date, datepart) }}\n\n {%- endcall -%}\n\n {%- set value_list = load_result('get_intervals_between') -%}\n\n {%- if value_list and value_list['data'] -%}\n {%- set values = value_list['data'] | map(attribute=0) | list %}\n {{ return(values[0]) }}\n {%- else -%}\n {{ return(1) }}\n {%- endif -%}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.statement", "macro.dbt.datediff"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "start_date", "type": null, "description": ""}, {"name": "end_date", "type": null, "description": ""}, {"name": "datepart", "type": null, "description": ""}], "created_at": 1789422566.6651115, "supported_languages": null}, "macro.dbt.date_spine": {"name": "date_spine", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/date_spine.sql", "original_file_path": "macros/utils/date_spine.sql", "unique_id": "macro.dbt.date_spine", "macro_sql": "{% macro date_spine(datepart, start_date, end_date) %}\n {{ return(adapter.dispatch('date_spine', 'dbt')(datepart, start_date, end_date)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__date_spine"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "datepart", "type": null, "description": ""}, {"name": "start_date", "type": null, "description": ""}, {"name": "end_date", "type": null, "description": ""}], "created_at": 1789422566.6656117, "supported_languages": null}, "macro.dbt.default__date_spine": {"name": "default__date_spine", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/date_spine.sql", "original_file_path": "macros/utils/date_spine.sql", "unique_id": "macro.dbt.default__date_spine", "macro_sql": "{% macro default__date_spine(datepart, start_date, end_date) %}\n\n\n {# call as follows:\n\n date_spine(\n \"day\",\n \"to_date('01/01/2016', 'mm/dd/yyyy')\",\n \"dbt.dateadd(week, 1, current_date)\"\n ) #}\n\n\n with rawdata as (\n\n {{dbt.generate_series(\n dbt.get_intervals_between(start_date, end_date, datepart)\n )}}\n\n ),\n\n all_periods as (\n\n select (\n {{\n dbt.dateadd(\n datepart,\n \"row_number() over (order by 1) - 1\",\n start_date\n )\n }}\n ) as date_{{datepart}}\n from rawdata\n\n ),\n\n filtered as (\n\n select *\n from all_periods\n where date_{{datepart}} <= {{ end_date }}\n\n )\n\n select * from filtered\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.generate_series", "macro.dbt.get_intervals_between", "macro.dbt.dateadd"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "datepart", "type": null, "description": ""}, {"name": "start_date", "type": null, "description": ""}, {"name": "end_date", "type": null, "description": ""}], "created_at": 1789422566.6663523, "supported_languages": null}, "macro.dbt.datediff": {"name": "datediff", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/datediff.sql", "original_file_path": "macros/utils/datediff.sql", "unique_id": "macro.dbt.datediff", "macro_sql": "{% macro datediff(first_date, second_date, datepart) %}\n {{ return(adapter.dispatch('datediff', 'dbt')(first_date, second_date, datepart)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__datediff"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "first_date", "type": null, "description": ""}, {"name": "second_date", "type": null, "description": ""}, {"name": "datepart", "type": null, "description": ""}], "created_at": 1789422566.6670258, "supported_languages": null}, "macro.dbt.default__datediff": {"name": "default__datediff", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/datediff.sql", "original_file_path": "macros/utils/datediff.sql", "unique_id": "macro.dbt.default__datediff", "macro_sql": "{% macro default__datediff(first_date, second_date, datepart) -%}\n\n datediff(\n {{ datepart }},\n {{ first_date }},\n {{ second_date }}\n )\n\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "first_date", "type": null, "description": ""}, {"name": "second_date", "type": null, "description": ""}, {"name": "datepart", "type": null, "description": ""}], "created_at": 1789422566.667372, "supported_languages": null}, "macro.dbt.equals": {"name": "equals", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/equals.sql", "original_file_path": "macros/utils/equals.sql", "unique_id": "macro.dbt.equals", "macro_sql": "{% macro equals(expr1, expr2) %}\n {{ return(adapter.dispatch('equals', 'dbt') (expr1, expr2)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__equals"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "expr1", "type": null, "description": ""}, {"name": "expr2", "type": null, "description": ""}], "created_at": 1789422566.6680577, "supported_languages": null}, "macro.dbt.default__equals": {"name": "default__equals", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/equals.sql", "original_file_path": "macros/utils/equals.sql", "unique_id": "macro.dbt.default__equals", "macro_sql": "{% macro default__equals(expr1, expr2) -%}\n{%- if adapter.behavior.enable_truthy_nulls_equals_macro.no_warn %}\n case when (({{ expr1 }} = {{ expr2 }}) or ({{ expr1 }} is null and {{ expr2 }} is null))\n then 0\n else 1\n end = 0\n{%- else -%}\n ({{ expr1 }} = {{ expr2 }})\n{%- endif %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "expr1", "type": null, "description": ""}, {"name": "expr2", "type": null, "description": ""}], "created_at": 1789422566.6686938, "supported_languages": null}, "macro.dbt.dateadd": {"name": "dateadd", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/dateadd.sql", "original_file_path": "macros/utils/dateadd.sql", "unique_id": "macro.dbt.dateadd", "macro_sql": "{% macro dateadd(datepart, interval, from_date_or_timestamp) %}\n {{ return(adapter.dispatch('dateadd', 'dbt')(datepart, interval, from_date_or_timestamp)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__dateadd"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "datepart", "type": null, "description": ""}, {"name": "interval", "type": null, "description": ""}, {"name": "from_date_or_timestamp", "type": null, "description": ""}], "created_at": 1789422566.6693184, "supported_languages": null}, "macro.dbt.default__dateadd": {"name": "default__dateadd", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/dateadd.sql", "original_file_path": "macros/utils/dateadd.sql", "unique_id": "macro.dbt.default__dateadd", "macro_sql": "{% macro default__dateadd(datepart, interval, from_date_or_timestamp) %}\n\n dateadd(\n {{ datepart }},\n {{ interval }},\n {{ from_date_or_timestamp }}\n )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "datepart", "type": null, "description": ""}, {"name": "interval", "type": null, "description": ""}, {"name": "from_date_or_timestamp", "type": null, "description": ""}], "created_at": 1789422566.6696968, "supported_languages": null}, "macro.dbt.concat": {"name": "concat", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/concat.sql", "original_file_path": "macros/utils/concat.sql", "unique_id": "macro.dbt.concat", "macro_sql": "{% macro concat(fields) -%}\n {{ return(adapter.dispatch('concat', 'dbt')(fields)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__concat"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "fields", "type": null, "description": ""}], "created_at": 1789422566.6701877, "supported_languages": null}, "macro.dbt.default__concat": {"name": "default__concat", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/concat.sql", "original_file_path": "macros/utils/concat.sql", "unique_id": "macro.dbt.default__concat", "macro_sql": "{% macro default__concat(fields) -%}\n {{ fields|join(' || ') }}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "fields", "type": null, "description": ""}], "created_at": 1789422566.6704667, "supported_languages": null}, "macro.dbt.array_construct": {"name": "array_construct", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/array_construct.sql", "original_file_path": "macros/utils/array_construct.sql", "unique_id": "macro.dbt.array_construct", "macro_sql": "{% macro array_construct(inputs=[], data_type=api.Column.translate_type('integer')) -%}\n {{ return(adapter.dispatch('array_construct', 'dbt')(inputs, data_type)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__array_construct"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "inputs", "type": null, "description": ""}, {"name": "data_type", "type": null, "description": ""}], "created_at": 1789422566.6712174, "supported_languages": null}, "macro.dbt.default__array_construct": {"name": "default__array_construct", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/array_construct.sql", "original_file_path": "macros/utils/array_construct.sql", "unique_id": "macro.dbt.default__array_construct", "macro_sql": "{% macro default__array_construct(inputs, data_type) -%}\n {% if inputs|length > 0 %}\n array[ {{ inputs|join(' , ') }} ]\n {% else %}\n array[]::{{data_type}}[]\n {% endif %}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "inputs", "type": null, "description": ""}, {"name": "data_type", "type": null, "description": ""}], "created_at": 1789422566.6717455, "supported_languages": null}, "macro.dbt.split_part": {"name": "split_part", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/split_part.sql", "original_file_path": "macros/utils/split_part.sql", "unique_id": "macro.dbt.split_part", "macro_sql": "{% macro split_part(string_text, delimiter_text, part_number) %}\n {{ return(adapter.dispatch('split_part', 'dbt') (string_text, delimiter_text, part_number)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__split_part"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "string_text", "type": null, "description": ""}, {"name": "delimiter_text", "type": null, "description": ""}, {"name": "part_number", "type": null, "description": ""}], "created_at": 1789422566.6724453, "supported_languages": null}, "macro.dbt.default__split_part": {"name": "default__split_part", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/split_part.sql", "original_file_path": "macros/utils/split_part.sql", "unique_id": "macro.dbt.default__split_part", "macro_sql": "{% macro default__split_part(string_text, delimiter_text, part_number) %}\n\n split_part(\n {{ string_text }},\n {{ delimiter_text }},\n {{ part_number }}\n )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "string_text", "type": null, "description": ""}, {"name": "delimiter_text", "type": null, "description": ""}, {"name": "part_number", "type": null, "description": ""}], "created_at": 1789422566.6729462, "supported_languages": null}, "macro.dbt._split_part_negative": {"name": "_split_part_negative", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/split_part.sql", "original_file_path": "macros/utils/split_part.sql", "unique_id": "macro.dbt._split_part_negative", "macro_sql": "{% macro _split_part_negative(string_text, delimiter_text, part_number) %}\n\n split_part(\n {{ string_text }},\n {{ delimiter_text }},\n length({{ string_text }})\n - length(\n replace({{ string_text }}, {{ delimiter_text }}, '')\n ) + 2 + {{ part_number }}\n )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "string_text", "type": null, "description": ""}, {"name": "delimiter_text", "type": null, "description": ""}, {"name": "part_number", "type": null, "description": ""}], "created_at": 1789422566.673408, "supported_languages": null}, "macro.dbt.bool_or": {"name": "bool_or", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/bool_or.sql", "original_file_path": "macros/utils/bool_or.sql", "unique_id": "macro.dbt.bool_or", "macro_sql": "{% macro bool_or(expression) -%}\n {{ return(adapter.dispatch('bool_or', 'dbt') (expression)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__bool_or"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "expression", "type": null, "description": ""}], "created_at": 1789422566.6739252, "supported_languages": null}, "macro.dbt.default__bool_or": {"name": "default__bool_or", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/bool_or.sql", "original_file_path": "macros/utils/bool_or.sql", "unique_id": "macro.dbt.default__bool_or", "macro_sql": "{% macro default__bool_or(expression) -%}\n\n bool_or({{ expression }})\n\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "expression", "type": null, "description": ""}], "created_at": 1789422566.6741476, "supported_languages": null}, "macro.dbt.replace": {"name": "replace", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/replace.sql", "original_file_path": "macros/utils/replace.sql", "unique_id": "macro.dbt.replace", "macro_sql": "{% macro replace(field, old_chars, new_chars) -%}\n {{ return(adapter.dispatch('replace', 'dbt') (field, old_chars, new_chars)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__replace"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field", "type": null, "description": ""}, {"name": "old_chars", "type": null, "description": ""}, {"name": "new_chars", "type": null, "description": ""}], "created_at": 1789422566.6747844, "supported_languages": null}, "macro.dbt.default__replace": {"name": "default__replace", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/replace.sql", "original_file_path": "macros/utils/replace.sql", "unique_id": "macro.dbt.default__replace", "macro_sql": "{% macro default__replace(field, old_chars, new_chars) %}\n\n replace(\n {{ field }},\n {{ old_chars }},\n {{ new_chars }}\n )\n\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field", "type": null, "description": ""}, {"name": "old_chars", "type": null, "description": ""}, {"name": "new_chars", "type": null, "description": ""}], "created_at": 1789422566.675129, "supported_languages": null}, "macro.dbt.string_literal": {"name": "string_literal", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/literal.sql", "original_file_path": "macros/utils/literal.sql", "unique_id": "macro.dbt.string_literal", "macro_sql": "{%- macro string_literal(value) -%}\n {{ return(adapter.dispatch('string_literal', 'dbt') (value)) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt.default__string_literal"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "value", "type": null, "description": ""}], "created_at": 1789422566.6756468, "supported_languages": null}, "macro.dbt.default__string_literal": {"name": "default__string_literal", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/literal.sql", "original_file_path": "macros/utils/literal.sql", "unique_id": "macro.dbt.default__string_literal", "macro_sql": "{% macro default__string_literal(value) -%}\n '{{ value }}'\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "value", "type": null, "description": ""}], "created_at": 1789422566.6758692, "supported_languages": null}, "macro.dbt.except": {"name": "except", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/except.sql", "original_file_path": "macros/utils/except.sql", "unique_id": "macro.dbt.except", "macro_sql": "{% macro except() %}\n {{ return(adapter.dispatch('except', 'dbt')()) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__except"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789422566.6763148, "supported_languages": null}, "macro.dbt.default__except": {"name": "default__except", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/except.sql", "original_file_path": "macros/utils/except.sql", "unique_id": "macro.dbt.default__except", "macro_sql": "{% macro default__except() %}\n\n except\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789422566.6764803, "supported_languages": null}, "macro.dbt.statement": {"name": "statement", "resource_type": "macro", "package_name": "dbt", "path": "macros/etc/statement.sql", "original_file_path": "macros/etc/statement.sql", "unique_id": "macro.dbt.statement", "macro_sql": "\n{%- macro statement(name=None, fetch_result=False, auto_begin=True, language='sql') -%}\n {%- if execute: -%}\n {%- set compiled_code = caller() -%}\n\n {%- if name == 'main' -%}\n {{ log('Writing runtime {} for node \"{}\"'.format(language, model['unique_id'])) }}\n {{ write(compiled_code) }}\n {%- endif -%}\n {%- if language == 'sql'-%}\n {%- set res, table = adapter.execute(compiled_code, auto_begin=auto_begin, fetch=fetch_result) -%}\n {%- elif language == 'python' -%}\n {%- set res = submit_python_job(model, compiled_code) -%}\n {#-- TODO: What should table be for python models? --#}\n {%- set table = None -%}\n {%- else -%}\n {% do exceptions.raise_compiler_error(\"statement macro didn't get supported language\") %}\n {%- endif -%}\n\n {%- if name is not none -%}\n {{ store_result(name, response=res, agate_table=table) }}\n {%- endif -%}\n\n {%- endif -%}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "name", "type": null, "description": ""}, {"name": "fetch_result", "type": null, "description": ""}, {"name": "auto_begin", "type": null, "description": ""}, {"name": "language", "type": null, "description": ""}], "created_at": 1789422566.679077, "supported_languages": null}, "macro.dbt.noop_statement": {"name": "noop_statement", "resource_type": "macro", "package_name": "dbt", "path": "macros/etc/statement.sql", "original_file_path": "macros/etc/statement.sql", "unique_id": "macro.dbt.noop_statement", "macro_sql": "{% macro noop_statement(name=None, message=None, code=None, rows_affected=None, res=None) -%}\n {%- set sql = caller() -%}\n\n {%- if name == 'main' -%}\n {{ log('Writing runtime SQL for node \"{}\"'.format(model['unique_id'])) }}\n {{ write(sql) }}\n {%- endif -%}\n\n {%- if name is not none -%}\n {{ store_raw_result(name, message=message, code=code, rows_affected=rows_affected, agate_table=res) }}\n {%- endif -%}\n\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "name", "type": null, "description": ""}, {"name": "message", "type": null, "description": ""}, {"name": "code", "type": null, "description": ""}, {"name": "rows_affected", "type": null, "description": ""}, {"name": "res", "type": null, "description": ""}], "created_at": 1789422566.6803765, "supported_languages": null}, "macro.dbt.run_query": {"name": "run_query", "resource_type": "macro", "package_name": "dbt", "path": "macros/etc/statement.sql", "original_file_path": "macros/etc/statement.sql", "unique_id": "macro.dbt.run_query", "macro_sql": "{% macro run_query(sql) %}\n {% call statement(\"run_query_statement\", fetch_result=true, auto_begin=false) %}\n {{ sql }}\n {% endcall %}\n\n {% do return(load_result(\"run_query_statement\").table) %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "sql", "type": null, "description": ""}], "created_at": 1789422566.6809905, "supported_languages": null}, "macro.dbt.convert_datetime": {"name": "convert_datetime", "resource_type": "macro", "package_name": "dbt", "path": "macros/etc/datetime.sql", "original_file_path": "macros/etc/datetime.sql", "unique_id": "macro.dbt.convert_datetime", "macro_sql": "{% macro convert_datetime(date_str, date_fmt) %}\n\n {% set error_msg -%}\n The provided partition date '{{ date_str }}' does not match the expected format '{{ date_fmt }}'\n {%- endset %}\n\n {% set res = try_or_compiler_error(error_msg, modules.datetime.datetime.strptime, date_str.strip(), date_fmt) %}\n {{ return(res) }}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "date_str", "type": null, "description": ""}, {"name": "date_fmt", "type": null, "description": ""}], "created_at": 1789422566.6824377, "supported_languages": null}, "macro.dbt.dates_in_range": {"name": "dates_in_range", "resource_type": "macro", "package_name": "dbt", "path": "macros/etc/datetime.sql", "original_file_path": "macros/etc/datetime.sql", "unique_id": "macro.dbt.dates_in_range", "macro_sql": "{% macro dates_in_range(start_date_str, end_date_str=none, in_fmt=\"%Y%m%d\", out_fmt=\"%Y%m%d\") %}\n {% set end_date_str = start_date_str if end_date_str is none else end_date_str %}\n\n {% set start_date = convert_datetime(start_date_str, in_fmt) %}\n {% set end_date = convert_datetime(end_date_str, in_fmt) %}\n\n {% set day_count = (end_date - start_date).days %}\n {% if day_count < 0 %}\n {% set msg -%}\n Partition start date is after the end date ({{ start_date }}, {{ end_date }})\n {%- endset %}\n\n {{ exceptions.raise_compiler_error(msg, model) }}\n {% endif %}\n\n {% set date_list = [] %}\n {% for i in range(0, day_count + 1) %}\n {% set the_date = (modules.datetime.timedelta(days=i) + start_date) %}\n {% if not out_fmt %}\n {% set _ = date_list.append(the_date) %}\n {% else %}\n {% set _ = date_list.append(the_date.strftime(out_fmt)) %}\n {% endif %}\n {% endfor %}\n\n {{ return(date_list) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.convert_datetime"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "start_date_str", "type": null, "description": ""}, {"name": "end_date_str", "type": null, "description": ""}, {"name": "in_fmt", "type": null, "description": ""}, {"name": "out_fmt", "type": null, "description": ""}], "created_at": 1789422566.6847908, "supported_languages": null}, "macro.dbt.partition_range": {"name": "partition_range", "resource_type": "macro", "package_name": "dbt", "path": "macros/etc/datetime.sql", "original_file_path": "macros/etc/datetime.sql", "unique_id": "macro.dbt.partition_range", "macro_sql": "{% macro partition_range(raw_partition_date, date_fmt='%Y%m%d') %}\n {% set partition_range = (raw_partition_date | string).split(\",\") %}\n\n {% if (partition_range | length) == 1 %}\n {% set start_date = partition_range[0] %}\n {% set end_date = none %}\n {% elif (partition_range | length) == 2 %}\n {% set start_date = partition_range[0] %}\n {% set end_date = partition_range[1] %}\n {% else %}\n {{ exceptions.raise_compiler_error(\"Invalid partition time. Expected format: {Start Date}[,{End Date}]. Got: \" ~ raw_partition_date) }}\n {% endif %}\n\n {{ return(dates_in_range(start_date, end_date, in_fmt=date_fmt)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.dates_in_range"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "raw_partition_date", "type": null, "description": ""}, {"name": "date_fmt", "type": null, "description": ""}], "created_at": 1789422566.686285, "supported_languages": null}, "macro.dbt.py_current_timestring": {"name": "py_current_timestring", "resource_type": "macro", "package_name": "dbt", "path": "macros/etc/datetime.sql", "original_file_path": "macros/etc/datetime.sql", "unique_id": "macro.dbt.py_current_timestring", "macro_sql": "{% macro py_current_timestring() %}\n {% set dt = modules.datetime.datetime.now() %}\n {% do return(dt.strftime(\"%Y%m%d%H%M%S%f\")) %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789422566.6867692, "supported_languages": null}, "macro.dbt.resolve_model_name": {"name": "resolve_model_name", "resource_type": "macro", "package_name": "dbt", "path": "macros/python_model/python.sql", "original_file_path": "macros/python_model/python.sql", "unique_id": "macro.dbt.resolve_model_name", "macro_sql": "{% macro resolve_model_name(input_model_name) %}\n {{ return(adapter.dispatch('resolve_model_name', 'dbt')(input_model_name)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__resolve_model_name"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "input_model_name", "type": null, "description": ""}], "created_at": 1789422566.6883264, "supported_languages": null}, "macro.dbt.default__resolve_model_name": {"name": "default__resolve_model_name", "resource_type": "macro", "package_name": "dbt", "path": "macros/python_model/python.sql", "original_file_path": "macros/python_model/python.sql", "unique_id": "macro.dbt.default__resolve_model_name", "macro_sql": "\n\n{%- macro default__resolve_model_name(input_model_name) -%}\n {{ input_model_name | string | replace('\"', '\\\"') }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "input_model_name", "type": null, "description": ""}], "created_at": 1789422566.688668, "supported_languages": null}, "macro.dbt.build_ref_function": {"name": "build_ref_function", "resource_type": "macro", "package_name": "dbt", "path": "macros/python_model/python.sql", "original_file_path": "macros/python_model/python.sql", "unique_id": "macro.dbt.build_ref_function", "macro_sql": "{% macro build_ref_function(model) %}\n\n {%- set ref_dict = {} -%}\n {%- for _ref in model.refs -%}\n {% set _ref_args = [_ref.get('package'), _ref['name']] if _ref.get('package') else [_ref['name'],] %}\n {%- set resolved = ref(*_ref_args, v=_ref.get('version')) -%}\n\n {#\n We want to get the string of the returned relation by calling .render() in order to skip sample/empty\n mode rendering logic. However, people override the default ref macro, and often return a string instead\n of a relation (like the ref macro does by default). Thus, to make sure we dont blow things up, we have\n to ensure the resolved relation has a .render() method.\n #}\n {%- if resolved.render is defined and resolved.render is callable -%}\n {%- set resolved = resolved.render() -%}\n {%- endif -%}\n\n {%- if _ref.get('version') -%}\n {% do _ref_args.extend([\"v\" ~ _ref['version']]) %}\n {%- endif -%}\n {%- do ref_dict.update({_ref_args | join('.'): resolve_model_name(resolved)}) -%}\n {%- endfor -%}\n\ndef ref(*args, **kwargs):\n refs = {{ ref_dict | tojson }}\n key = '.'.join(args)\n version = kwargs.get(\"v\") or kwargs.get(\"version\")\n if version:\n key += f\".v{version}\"\n dbt_load_df_function = kwargs.get(\"dbt_load_df_function\")\n return dbt_load_df_function(refs[key])\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.resolve_model_name"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}], "created_at": 1789422566.6906376, "supported_languages": null}, "macro.dbt.build_source_function": {"name": "build_source_function", "resource_type": "macro", "package_name": "dbt", "path": "macros/python_model/python.sql", "original_file_path": "macros/python_model/python.sql", "unique_id": "macro.dbt.build_source_function", "macro_sql": "{% macro build_source_function(model) %}\n\n {%- set source_dict = {} -%}\n {%- for _source in model.sources -%}\n {%- set resolved = source(*_source) -%}\n {%- do source_dict.update({_source | join('.'): resolve_model_name(resolved)}) -%}\n {%- endfor -%}\n\ndef source(*args, dbt_load_df_function):\n sources = {{ source_dict | tojson }}\n key = '.'.join(args)\n return dbt_load_df_function(sources[key])\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.resolve_model_name"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}], "created_at": 1789422566.6914983, "supported_languages": null}, "macro.dbt.build_config_dict": {"name": "build_config_dict", "resource_type": "macro", "package_name": "dbt", "path": "macros/python_model/python.sql", "original_file_path": "macros/python_model/python.sql", "unique_id": "macro.dbt.build_config_dict", "macro_sql": "{% macro build_config_dict(model) %}\n {%- set config_dict = {} -%}\n {% set config_dbt_used = zip(model.config.config_keys_used, model.config.config_keys_defaults) | list %}\n {%- for key, default in config_dbt_used -%}\n {# weird type testing with enum, would be much easier to write this logic in Python! #}\n {%- if key == \"language\" -%}\n {%- set value = \"python\" -%}\n {%- endif -%}\n {%- set value = model.config.get(key, default) -%}\n {%- do config_dict.update({key: value}) -%}\n {%- endfor -%}\n {# Handle dbt.config.meta_get() calls - use separate dict to avoid overwriting native configs #}\n {%- set meta_dict = {} -%}\n {%- if model.config.meta_keys_used -%}\n {% set meta_dbt_used = zip(model.config.meta_keys_used, model.config.meta_keys_defaults) | list %}\n {%- for key, default in meta_dbt_used -%}\n {%- if model.config.meta and key in model.config.meta -%}\n {%- set value = model.config.meta[key] -%}\n {%- else -%}\n {%- set value = default -%}\n {%- endif -%}\n {%- do meta_dict.update({key: value}) -%}\n {%- endfor -%}\n {%- endif -%}\nconfig_dict = {{ config_dict }}\nmeta_dict = {{ meta_dict }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}], "created_at": 1789422566.6938574, "supported_languages": null}, "macro.dbt.py_script_postfix": {"name": "py_script_postfix", "resource_type": "macro", "package_name": "dbt", "path": "macros/python_model/python.sql", "original_file_path": "macros/python_model/python.sql", "unique_id": "macro.dbt.py_script_postfix", "macro_sql": "{% macro py_script_postfix(model) %}\n# This part is user provided model code\n# you will need to copy the next section to run the code\n# COMMAND ----------\n# this part is dbt logic for get ref work, do not modify\n\n{{ build_ref_function(model ) }}\n{{ build_source_function(model ) }}\n{{ build_config_dict(model) }}\n\nclass config:\n def __init__(self, *args, **kwargs):\n pass\n\n @staticmethod\n def get(key, default=None):\n return config_dict.get(key, default)\n\n @staticmethod\n def meta_get(key, default=None):\n return meta_dict.get(key, default)\n\nclass this:\n \"\"\"dbt.this() or dbt.this.identifier\"\"\"\n database = \"{{ this.database }}\"\n schema = \"{{ this.schema }}\"\n identifier = \"{{ this.identifier }}\"\n {% set this_relation_name = resolve_model_name(this) %}\n def __repr__(self):\n return '{{ this_relation_name }}'\n\n\nclass dbtObj:\n def __init__(self, load_df_function) -> None:\n self.source = lambda *args: source(*args, dbt_load_df_function=load_df_function)\n self.ref = lambda *args, **kwargs: ref(*args, **kwargs, dbt_load_df_function=load_df_function)\n self.config = config\n self.this = this()\n self.is_incremental = {{ is_incremental() }}\n\n# COMMAND ----------\n{{py_script_comment()}}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.build_ref_function", "macro.dbt.build_source_function", "macro.dbt.build_config_dict", "macro.dbt.resolve_model_name", "macro.dbt.is_incremental", "macro.dbt.py_script_comment"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}], "created_at": 1789422566.695848, "supported_languages": null}, "macro.dbt.py_script_comment": {"name": "py_script_comment", "resource_type": "macro", "package_name": "dbt", "path": "macros/python_model/python.sql", "original_file_path": "macros/python_model/python.sql", "unique_id": "macro.dbt.py_script_comment", "macro_sql": "{%macro py_script_comment()%}\n{%endmacro%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789422566.6960485, "supported_languages": null}, "macro.dbt.generate_schema_name": {"name": "generate_schema_name", "resource_type": "macro", "package_name": "dbt", "path": "macros/get_custom_name/get_custom_schema.sql", "original_file_path": "macros/get_custom_name/get_custom_schema.sql", "unique_id": "macro.dbt.generate_schema_name", "macro_sql": "{% macro generate_schema_name(custom_schema_name=none, node=none) -%}\n {{ return(adapter.dispatch('generate_schema_name', 'dbt')(custom_schema_name, node)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__generate_schema_name"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "custom_schema_name", "type": null, "description": ""}, {"name": "node", "type": null, "description": ""}], "created_at": 1789422566.6969738, "supported_languages": null}, "macro.dbt.default__generate_schema_name": {"name": "default__generate_schema_name", "resource_type": "macro", "package_name": "dbt", "path": "macros/get_custom_name/get_custom_schema.sql", "original_file_path": "macros/get_custom_name/get_custom_schema.sql", "unique_id": "macro.dbt.default__generate_schema_name", "macro_sql": "{% macro default__generate_schema_name(custom_schema_name, node) -%}\n\n {%- set default_schema = target.schema -%}\n {%- if custom_schema_name is none -%}\n\n {{ default_schema }}\n\n {%- else -%}\n\n {{ default_schema }}_{{ custom_schema_name | trim }}\n\n {%- endif -%}\n\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "custom_schema_name", "type": null, "description": ""}, {"name": "node", "type": null, "description": ""}], "created_at": 1789422566.6975646, "supported_languages": null}, "macro.dbt.generate_schema_name_for_env": {"name": "generate_schema_name_for_env", "resource_type": "macro", "package_name": "dbt", "path": "macros/get_custom_name/get_custom_schema.sql", "original_file_path": "macros/get_custom_name/get_custom_schema.sql", "unique_id": "macro.dbt.generate_schema_name_for_env", "macro_sql": "{% macro generate_schema_name_for_env(custom_schema_name, node) -%}\n\n {%- set default_schema = target.schema -%}\n {%- if target.name == 'prod' and custom_schema_name is not none -%}\n\n {{ custom_schema_name | trim }}\n\n {%- else -%}\n\n {{ default_schema }}\n\n {%- endif -%}\n\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "custom_schema_name", "type": null, "description": ""}, {"name": "node", "type": null, "description": ""}], "created_at": 1789422566.6981773, "supported_languages": null}, "macro.dbt.generate_latest_version_pointer_alias": {"name": "generate_latest_version_pointer_alias", "resource_type": "macro", "package_name": "dbt", "path": "macros/get_custom_name/get_latest_version_pointer_alias.sql", "original_file_path": "macros/get_custom_name/get_latest_version_pointer_alias.sql", "unique_id": "macro.dbt.generate_latest_version_pointer_alias", "macro_sql": "{% macro generate_latest_version_pointer_alias(custom_alias_name=none, node=none) -%}\n {% do return(adapter.dispatch('generate_latest_version_pointer_alias', 'dbt')(custom_alias_name, node)) %}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__generate_latest_version_pointer_alias"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "custom_alias_name", "type": null, "description": ""}, {"name": "node", "type": null, "description": ""}], "created_at": 1789422566.6989422, "supported_languages": null}, "macro.dbt.default__generate_latest_version_pointer_alias": {"name": "default__generate_latest_version_pointer_alias", "resource_type": "macro", "package_name": "dbt", "path": "macros/get_custom_name/get_latest_version_pointer_alias.sql", "original_file_path": "macros/get_custom_name/get_latest_version_pointer_alias.sql", "unique_id": "macro.dbt.default__generate_latest_version_pointer_alias", "macro_sql": "{% macro default__generate_latest_version_pointer_alias(custom_alias_name=none, node=none) -%}\n {%- if custom_alias_name -%}\n {{ custom_alias_name | trim }}\n {%- else -%}\n {{ node.name }}\n {%- endif -%}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "custom_alias_name", "type": null, "description": ""}, {"name": "node", "type": null, "description": ""}], "created_at": 1789422566.699402, "supported_languages": null}, "macro.dbt.generate_database_name": {"name": "generate_database_name", "resource_type": "macro", "package_name": "dbt", "path": "macros/get_custom_name/get_custom_database.sql", "original_file_path": "macros/get_custom_name/get_custom_database.sql", "unique_id": "macro.dbt.generate_database_name", "macro_sql": "{% macro generate_database_name(custom_database_name=none, node=none) -%}\n {% do return(adapter.dispatch('generate_database_name', 'dbt')(custom_database_name, node)) %}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__generate_database_name"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "custom_database_name", "type": null, "description": ""}, {"name": "node", "type": null, "description": ""}], "created_at": 1789422566.7002354, "supported_languages": null}, "macro.dbt.default__generate_database_name": {"name": "default__generate_database_name", "resource_type": "macro", "package_name": "dbt", "path": "macros/get_custom_name/get_custom_database.sql", "original_file_path": "macros/get_custom_name/get_custom_database.sql", "unique_id": "macro.dbt.default__generate_database_name", "macro_sql": "{% macro default__generate_database_name(custom_database_name=none, node=none) -%}\n {%- set default_database = target.database -%}\n {%- if node is not none and node|attr('database') -%}\n {%- set catalog_relation = adapter.build_catalog_relation(node) -%}\n {%- if catalog_relation and catalog_relation|attr('catalog_database') -%}\n {{ return(catalog_relation.catalog_database) }}\n {%- endif -%}\n {%- endif -%}\n {%- if custom_database_name is none -%}\n\n {{ default_database }}\n\n {%- else -%}\n\n {{ custom_database_name }}\n\n {%- endif -%}\n\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "custom_database_name", "type": null, "description": ""}, {"name": "node", "type": null, "description": ""}], "created_at": 1789422566.7013574, "supported_languages": null}, "macro.dbt.generate_alias_name": {"name": "generate_alias_name", "resource_type": "macro", "package_name": "dbt", "path": "macros/get_custom_name/get_custom_alias.sql", "original_file_path": "macros/get_custom_name/get_custom_alias.sql", "unique_id": "macro.dbt.generate_alias_name", "macro_sql": "{% macro generate_alias_name(custom_alias_name=none, node=none) -%}\n {% do return(adapter.dispatch('generate_alias_name', 'dbt')(custom_alias_name, node)) %}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__generate_alias_name"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "custom_alias_name", "type": null, "description": ""}, {"name": "node", "type": null, "description": ""}], "created_at": 1789422566.7021346, "supported_languages": null}, "macro.dbt.default__generate_alias_name": {"name": "default__generate_alias_name", "resource_type": "macro", "package_name": "dbt", "path": "macros/get_custom_name/get_custom_alias.sql", "original_file_path": "macros/get_custom_name/get_custom_alias.sql", "unique_id": "macro.dbt.default__generate_alias_name", "macro_sql": "{% macro default__generate_alias_name(custom_alias_name=none, node=none) -%}\n\n {%- if custom_alias_name -%}\n\n {{ custom_alias_name | trim }}\n\n {%- elif node.version -%}\n\n {{ return(node.name ~ \"_v\" ~ (node.version | replace(\".\", \"_\"))) }}\n\n {%- else -%}\n\n {{ node.name }}\n\n {%- endif -%}\n\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "custom_alias_name", "type": null, "description": ""}, {"name": "node", "type": null, "description": ""}], "created_at": 1789422566.7029536, "supported_languages": null}, "macro.dbt.get_show_sql": {"name": "get_show_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/show.sql", "original_file_path": "macros/adapters/show.sql", "unique_id": "macro.dbt.get_show_sql", "macro_sql": "{% macro get_show_sql(compiled_code, sql_header, limit) -%}\n {%- if sql_header is not none -%}\n {{ sql_header }}\n {%- endif %}\n {{ get_limit_subquery_sql(compiled_code, limit) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_limit_subquery_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "compiled_code", "type": null, "description": ""}, {"name": "sql_header", "type": null, "description": ""}, {"name": "limit", "type": null, "description": ""}], "created_at": 1789422566.703741, "supported_languages": null}, "macro.dbt.get_limit_subquery_sql": {"name": "get_limit_subquery_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/show.sql", "original_file_path": "macros/adapters/show.sql", "unique_id": "macro.dbt.get_limit_subquery_sql", "macro_sql": "\n{%- macro get_limit_subquery_sql(sql, limit) -%}\n {{ adapter.dispatch('get_limit_sql', 'dbt')(sql, limit) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt.default__get_limit_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "sql", "type": null, "description": ""}, {"name": "limit", "type": null, "description": ""}], "created_at": 1789422566.7041314, "supported_languages": null}, "macro.dbt.default__get_limit_sql": {"name": "default__get_limit_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/show.sql", "original_file_path": "macros/adapters/show.sql", "unique_id": "macro.dbt.default__get_limit_sql", "macro_sql": "{% macro default__get_limit_sql(sql, limit) %}\n {{ sql }}\n {% if limit is not none %}\n limit {{ limit }}\n {%- endif -%}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "sql", "type": null, "description": ""}, {"name": "limit", "type": null, "description": ""}], "created_at": 1789422566.7045596, "supported_languages": null}, "macro.dbt.current_timestamp": {"name": "current_timestamp", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/timestamps.sql", "original_file_path": "macros/adapters/timestamps.sql", "unique_id": "macro.dbt.current_timestamp", "macro_sql": "{%- macro current_timestamp() -%}\n {{ adapter.dispatch('current_timestamp', 'dbt')() }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt_postgres.postgres__current_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789422566.7054558, "supported_languages": null}, "macro.dbt.default__current_timestamp": {"name": "default__current_timestamp", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/timestamps.sql", "original_file_path": "macros/adapters/timestamps.sql", "unique_id": "macro.dbt.default__current_timestamp", "macro_sql": "{% macro default__current_timestamp() -%}\n {{ exceptions.raise_not_implemented(\n 'current_timestamp macro not implemented for adapter ' + adapter.type()) }}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789422566.7058275, "supported_languages": null}, "macro.dbt.snapshot_get_time": {"name": "snapshot_get_time", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/timestamps.sql", "original_file_path": "macros/adapters/timestamps.sql", "unique_id": "macro.dbt.snapshot_get_time", "macro_sql": "\n\n{%- macro snapshot_get_time() -%}\n {{ adapter.dispatch('snapshot_get_time', 'dbt')() }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt_postgres.postgres__snapshot_get_time"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789422566.7062938, "supported_languages": null}, "macro.dbt.default__snapshot_get_time": {"name": "default__snapshot_get_time", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/timestamps.sql", "original_file_path": "macros/adapters/timestamps.sql", "unique_id": "macro.dbt.default__snapshot_get_time", "macro_sql": "{% macro default__snapshot_get_time() %}\n {{ current_timestamp() }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.current_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789422566.7065542, "supported_languages": null}, "macro.dbt.get_snapshot_get_time_data_type": {"name": "get_snapshot_get_time_data_type", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/timestamps.sql", "original_file_path": "macros/adapters/timestamps.sql", "unique_id": "macro.dbt.get_snapshot_get_time_data_type", "macro_sql": "{% macro get_snapshot_get_time_data_type() %}\n {% set snapshot_time = adapter.dispatch('snapshot_get_time', 'dbt')() %}\n {% set time_data_type_sql = 'select ' ~ snapshot_time ~ ' as dbt_snapshot_time' %}\n {% set snapshot_time_column_schema = get_column_schema_from_query(time_data_type_sql) %}\n {% set time_data_type = snapshot_time_column_schema[0].dtype %}\n {{ return(time_data_type or none) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.snapshot_get_time", "macro.dbt_postgres.postgres__snapshot_get_time", "macro.dbt.get_column_schema_from_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789422566.7074099, "supported_languages": null}, "macro.dbt.current_timestamp_backcompat": {"name": "current_timestamp_backcompat", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/timestamps.sql", "original_file_path": "macros/adapters/timestamps.sql", "unique_id": "macro.dbt.current_timestamp_backcompat", "macro_sql": "{% macro current_timestamp_backcompat() %}\n {{ return(adapter.dispatch('current_timestamp_backcompat', 'dbt')()) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__current_timestamp_backcompat"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789422566.7077844, "supported_languages": null}, "macro.dbt.default__current_timestamp_backcompat": {"name": "default__current_timestamp_backcompat", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/timestamps.sql", "original_file_path": "macros/adapters/timestamps.sql", "unique_id": "macro.dbt.default__current_timestamp_backcompat", "macro_sql": "{% macro default__current_timestamp_backcompat() %}\n current_timestamp::timestamp\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789422566.7079546, "supported_languages": null}, "macro.dbt.current_timestamp_in_utc_backcompat": {"name": "current_timestamp_in_utc_backcompat", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/timestamps.sql", "original_file_path": "macros/adapters/timestamps.sql", "unique_id": "macro.dbt.current_timestamp_in_utc_backcompat", "macro_sql": "{% macro current_timestamp_in_utc_backcompat() %}\n {{ return(adapter.dispatch('current_timestamp_in_utc_backcompat', 'dbt')()) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__current_timestamp_in_utc_backcompat"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789422566.7082903, "supported_languages": null}, "macro.dbt.default__current_timestamp_in_utc_backcompat": {"name": "default__current_timestamp_in_utc_backcompat", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/timestamps.sql", "original_file_path": "macros/adapters/timestamps.sql", "unique_id": "macro.dbt.default__current_timestamp_in_utc_backcompat", "macro_sql": "{% macro default__current_timestamp_in_utc_backcompat() %}\n {{ return(adapter.dispatch('current_timestamp_backcompat', 'dbt')()) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.current_timestamp_backcompat", "macro.dbt_postgres.postgres__current_timestamp_backcompat"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789422566.7086544, "supported_languages": null}, "macro.dbt.create_schema": {"name": "create_schema", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/schema.sql", "original_file_path": "macros/adapters/schema.sql", "unique_id": "macro.dbt.create_schema", "macro_sql": "{% macro create_schema(relation) -%}\n {{ adapter.dispatch('create_schema', 'dbt')(relation) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__create_schema"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789422566.7092948, "supported_languages": null}, "macro.dbt.default__create_schema": {"name": "default__create_schema", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/schema.sql", "original_file_path": "macros/adapters/schema.sql", "unique_id": "macro.dbt.default__create_schema", "macro_sql": "{% macro default__create_schema(relation) -%}\n {%- call statement('create_schema') -%}\n create schema if not exists {{ relation.without_identifier() }}\n {% endcall %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789422566.709717, "supported_languages": null}, "macro.dbt.drop_schema": {"name": "drop_schema", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/schema.sql", "original_file_path": "macros/adapters/schema.sql", "unique_id": "macro.dbt.drop_schema", "macro_sql": "{% macro drop_schema(relation) -%}\n {{ adapter.dispatch('drop_schema', 'dbt')(relation) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__drop_schema"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789422566.7100646, "supported_languages": null}, "macro.dbt.default__drop_schema": {"name": "default__drop_schema", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/schema.sql", "original_file_path": "macros/adapters/schema.sql", "unique_id": "macro.dbt.default__drop_schema", "macro_sql": "{% macro default__drop_schema(relation) -%}\n {%- call statement('drop_schema') -%}\n drop schema if exists {{ relation.without_identifier() }} cascade\n {% endcall %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789422566.71046, "supported_languages": null}, "macro.dbt.copy_grants": {"name": "copy_grants", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "unique_id": "macro.dbt.copy_grants", "macro_sql": "{% macro copy_grants() %}\n {{ return(adapter.dispatch('copy_grants', 'dbt')()) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__copy_grants"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789422566.7126234, "supported_languages": null}, "macro.dbt.default__copy_grants": {"name": "default__copy_grants", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "unique_id": "macro.dbt.default__copy_grants", "macro_sql": "{% macro default__copy_grants() %}\n {{ return(True) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789422566.712877, "supported_languages": null}, "macro.dbt.support_multiple_grantees_per_dcl_statement": {"name": "support_multiple_grantees_per_dcl_statement", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "unique_id": "macro.dbt.support_multiple_grantees_per_dcl_statement", "macro_sql": "{% macro support_multiple_grantees_per_dcl_statement() %}\n {{ return(adapter.dispatch('support_multiple_grantees_per_dcl_statement', 'dbt')()) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__support_multiple_grantees_per_dcl_statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789422566.713214, "supported_languages": null}, "macro.dbt.default__support_multiple_grantees_per_dcl_statement": {"name": "default__support_multiple_grantees_per_dcl_statement", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "unique_id": "macro.dbt.default__support_multiple_grantees_per_dcl_statement", "macro_sql": "\n\n{%- macro default__support_multiple_grantees_per_dcl_statement() -%}\n {{ return(True) }}\n{%- endmacro -%}\n\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789422566.713453, "supported_languages": null}, "macro.dbt.should_revoke": {"name": "should_revoke", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "unique_id": "macro.dbt.should_revoke", "macro_sql": "{% macro should_revoke(existing_relation, full_refresh_mode=True) %}\n\n {% if not existing_relation %}\n {#-- The table doesn't already exist, so no grants to copy over --#}\n {{ return(False) }}\n {% elif full_refresh_mode %}\n {#-- The object is being REPLACED -- whether grants are copied over depends on the value of user config --#}\n {{ return(copy_grants()) }}\n {% else %}\n {#-- The table is being merged/upserted/inserted -- grants will be carried over --#}\n {{ return(True) }}\n {% endif %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.copy_grants"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "existing_relation", "type": null, "description": ""}, {"name": "full_refresh_mode", "type": null, "description": ""}], "created_at": 1789422566.7142947, "supported_languages": null}, "macro.dbt.get_show_grant_sql": {"name": "get_show_grant_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "unique_id": "macro.dbt.get_show_grant_sql", "macro_sql": "{% macro get_show_grant_sql(relation) %}\n {{ return(adapter.dispatch(\"get_show_grant_sql\", \"dbt\")(relation)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__get_show_grant_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789422566.714706, "supported_languages": null}, "macro.dbt.default__get_show_grant_sql": {"name": "default__get_show_grant_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "unique_id": "macro.dbt.default__get_show_grant_sql", "macro_sql": "{% macro default__get_show_grant_sql(relation) %}\n show grants on {{ relation.render() }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789422566.714973, "supported_languages": null}, "macro.dbt.get_grant_sql": {"name": "get_grant_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "unique_id": "macro.dbt.get_grant_sql", "macro_sql": "{% macro get_grant_sql(relation, privilege, grantees) %}\n {{ return(adapter.dispatch('get_grant_sql', 'dbt')(relation, privilege, grantees)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_grant_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "privilege", "type": null, "description": ""}, {"name": "grantees", "type": null, "description": ""}], "created_at": 1789422566.7154317, "supported_languages": null}, "macro.dbt.default__get_grant_sql": {"name": "default__get_grant_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "unique_id": "macro.dbt.default__get_grant_sql", "macro_sql": "\n\n{%- macro default__get_grant_sql(relation, privilege, grantees) -%}\n grant {{ privilege }} on {{ relation.render() }} to {{ grantees | join(', ') }}\n{%- endmacro -%}\n\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "privilege", "type": null, "description": ""}, {"name": "grantees", "type": null, "description": ""}], "created_at": 1789422566.7158856, "supported_languages": null}, "macro.dbt.get_revoke_sql": {"name": "get_revoke_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "unique_id": "macro.dbt.get_revoke_sql", "macro_sql": "{% macro get_revoke_sql(relation, privilege, grantees) %}\n {{ return(adapter.dispatch('get_revoke_sql', 'dbt')(relation, privilege, grantees)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_revoke_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "privilege", "type": null, "description": ""}, {"name": "grantees", "type": null, "description": ""}], "created_at": 1789422566.7163506, "supported_languages": null}, "macro.dbt.default__get_revoke_sql": {"name": "default__get_revoke_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "unique_id": "macro.dbt.default__get_revoke_sql", "macro_sql": "\n\n{%- macro default__get_revoke_sql(relation, privilege, grantees) -%}\n {%- set quoted_grantees = [] -%}\n {%- for grantee in grantees -%}\n {%- do quoted_grantees.append(adapter.quote(grantee)) -%}\n {%- endfor -%}\n revoke {{ privilege }} on {{ relation.render() }} from {{ quoted_grantees | join(', ') }}\n{%- endmacro -%}\n\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "privilege", "type": null, "description": ""}, {"name": "grantees", "type": null, "description": ""}], "created_at": 1789422566.7171462, "supported_languages": null}, "macro.dbt.get_dcl_statement_list": {"name": "get_dcl_statement_list", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "unique_id": "macro.dbt.get_dcl_statement_list", "macro_sql": "{% macro get_dcl_statement_list(relation, grant_config, get_dcl_macro) %}\n {{ return(adapter.dispatch('get_dcl_statement_list', 'dbt')(relation, grant_config, get_dcl_macro)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_dcl_statement_list"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "grant_config", "type": null, "description": ""}, {"name": "get_dcl_macro", "type": null, "description": ""}], "created_at": 1789422566.717639, "supported_languages": null}, "macro.dbt.default__get_dcl_statement_list": {"name": "default__get_dcl_statement_list", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "unique_id": "macro.dbt.default__get_dcl_statement_list", "macro_sql": "\n\n{%- macro default__get_dcl_statement_list(relation, grant_config, get_dcl_macro) -%}\n {#\n -- Unpack grant_config into specific privileges and the set of users who need them granted/revoked.\n -- Depending on whether this database supports multiple grantees per statement, pass in the list of\n -- all grantees per privilege, or (if not) template one statement per privilege-grantee pair.\n -- `get_dcl_macro` will be either `get_grant_sql` or `get_revoke_sql`\n #}\n {%- set dcl_statements = [] -%}\n {%- for privilege, grantees in grant_config.items() %}\n {%- if support_multiple_grantees_per_dcl_statement() and grantees -%}\n {%- set dcl = get_dcl_macro(relation, privilege, grantees) -%}\n {%- do dcl_statements.append(dcl) -%}\n {%- else -%}\n {%- for grantee in grantees -%}\n {% set dcl = get_dcl_macro(relation, privilege, [grantee]) %}\n {%- do dcl_statements.append(dcl) -%}\n {% endfor -%}\n {%- endif -%}\n {%- endfor -%}\n {{ return(dcl_statements) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.support_multiple_grantees_per_dcl_statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "grant_config", "type": null, "description": ""}, {"name": "get_dcl_macro", "type": null, "description": ""}], "created_at": 1789422566.719024, "supported_languages": null}, "macro.dbt.call_dcl_statements": {"name": "call_dcl_statements", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "unique_id": "macro.dbt.call_dcl_statements", "macro_sql": "{% macro call_dcl_statements(dcl_statement_list) %}\n {{ return(adapter.dispatch(\"call_dcl_statements\", \"dbt\")(dcl_statement_list)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__call_dcl_statements"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "dcl_statement_list", "type": null, "description": ""}], "created_at": 1789422566.7194161, "supported_languages": null}, "macro.dbt.default__call_dcl_statements": {"name": "default__call_dcl_statements", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "unique_id": "macro.dbt.default__call_dcl_statements", "macro_sql": "{% macro default__call_dcl_statements(dcl_statement_list) %}\n {#\n -- By default, supply all grant + revoke statements in a single semicolon-separated block,\n -- so that they're all processed together.\n\n -- Some databases do not support this. Those adapters will need to override this macro\n -- to run each statement individually.\n #}\n {% call statement('grants') %}\n {% for dcl_statement in dcl_statement_list %}\n {{ dcl_statement }};\n {% endfor %}\n {% endcall %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "dcl_statement_list", "type": null, "description": ""}], "created_at": 1789422566.7199445, "supported_languages": null}, "macro.dbt.apply_grants": {"name": "apply_grants", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "unique_id": "macro.dbt.apply_grants", "macro_sql": "{% macro apply_grants(relation, grant_config, should_revoke) %}\n {{ return(adapter.dispatch(\"apply_grants\", \"dbt\")(relation, grant_config, should_revoke)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__apply_grants"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "grant_config", "type": null, "description": ""}, {"name": "should_revoke", "type": null, "description": ""}], "created_at": 1789422566.7204025, "supported_languages": null}, "macro.dbt.default__apply_grants": {"name": "default__apply_grants", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "unique_id": "macro.dbt.default__apply_grants", "macro_sql": "{% macro default__apply_grants(relation, grant_config, should_revoke=True) %}\n {#-- If grant_config is {} or None, this is a no-op --#}\n {% if grant_config %}\n {% if should_revoke %}\n {#-- We think previous grants may have carried over --#}\n {#-- Show current grants and calculate diffs --#}\n {% set current_grants_table = run_query(get_show_grant_sql(relation)) %}\n {% set current_grants_dict = adapter.standardize_grants_dict(current_grants_table) %}\n {% set needs_granting = diff_of_two_dicts(grant_config, current_grants_dict) %}\n {% set needs_revoking = diff_of_two_dicts(current_grants_dict, grant_config) %}\n {% if not (needs_granting or needs_revoking) %}\n {{ log('On ' ~ relation.render() ~': All grants are in place, no revocation or granting needed.')}}\n {% endif %}\n {% else %}\n {#-- We don't think there's any chance of previous grants having carried over. --#}\n {#-- Jump straight to granting what the user has configured. --#}\n {% set needs_revoking = {} %}\n {% set needs_granting = grant_config %}\n {% endif %}\n {% if needs_granting or needs_revoking %}\n {% set revoke_statement_list = get_dcl_statement_list(relation, needs_revoking, get_revoke_sql) %}\n {% set grant_statement_list = get_dcl_statement_list(relation, needs_granting, get_grant_sql) %}\n {% set dcl_statement_list = revoke_statement_list + grant_statement_list %}\n {% if dcl_statement_list %}\n {{ call_dcl_statements(dcl_statement_list) }}\n {% endif %}\n {% endif %}\n {% endif %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.run_query", "macro.dbt.get_show_grant_sql", "macro.dbt.get_dcl_statement_list", "macro.dbt.call_dcl_statements"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "grant_config", "type": null, "description": ""}, {"name": "should_revoke", "type": null, "description": ""}], "created_at": 1789422566.7228863, "supported_languages": null}, "macro.dbt.is_core_v2": {"name": "is_core_v2", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/runtime.sql", "original_file_path": "macros/adapters/runtime.sql", "unique_id": "macro.dbt.is_core_v2", "macro_sql": "{% macro is_core_v2() -%}\n {%- set major_version = (dbt_version.split('.') | first) | int -%}\n {{ return(major_version == 2) }}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789422566.7235444, "supported_languages": null}, "macro.dbt.alter_column_comment": {"name": "alter_column_comment", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/persist_docs.sql", "original_file_path": "macros/adapters/persist_docs.sql", "unique_id": "macro.dbt.alter_column_comment", "macro_sql": "{% macro alter_column_comment(relation, column_dict) -%}\n {{ return(adapter.dispatch('alter_column_comment', 'dbt')(relation, column_dict)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__alter_column_comment"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "column_dict", "type": null, "description": ""}], "created_at": 1789422566.7248378, "supported_languages": null}, "macro.dbt.default__alter_column_comment": {"name": "default__alter_column_comment", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/persist_docs.sql", "original_file_path": "macros/adapters/persist_docs.sql", "unique_id": "macro.dbt.default__alter_column_comment", "macro_sql": "{% macro default__alter_column_comment(relation, column_dict) -%}\n {{ exceptions.raise_not_implemented(\n 'alter_column_comment macro not implemented for adapter '+adapter.type()) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "column_dict", "type": null, "description": ""}], "created_at": 1789422566.7252047, "supported_languages": null}, "macro.dbt.alter_relation_comment": {"name": "alter_relation_comment", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/persist_docs.sql", "original_file_path": "macros/adapters/persist_docs.sql", "unique_id": "macro.dbt.alter_relation_comment", "macro_sql": "{% macro alter_relation_comment(relation, relation_comment) -%}\n {{ return(adapter.dispatch('alter_relation_comment', 'dbt')(relation, relation_comment)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__alter_relation_comment"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "relation_comment", "type": null, "description": ""}], "created_at": 1789422566.725646, "supported_languages": null}, "macro.dbt.default__alter_relation_comment": {"name": "default__alter_relation_comment", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/persist_docs.sql", "original_file_path": "macros/adapters/persist_docs.sql", "unique_id": "macro.dbt.default__alter_relation_comment", "macro_sql": "{% macro default__alter_relation_comment(relation, relation_comment) -%}\n {{ exceptions.raise_not_implemented(\n 'alter_relation_comment macro not implemented for adapter '+adapter.type()) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "relation_comment", "type": null, "description": ""}], "created_at": 1789422566.7259986, "supported_languages": null}, "macro.dbt.persist_docs": {"name": "persist_docs", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/persist_docs.sql", "original_file_path": "macros/adapters/persist_docs.sql", "unique_id": "macro.dbt.persist_docs", "macro_sql": "{% macro persist_docs(relation, model, for_relation=true, for_columns=true) -%}\n {{ return(adapter.dispatch('persist_docs', 'dbt')(relation, model, for_relation, for_columns)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__persist_docs"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "model", "type": null, "description": ""}, {"name": "for_relation", "type": null, "description": ""}, {"name": "for_columns", "type": null, "description": ""}], "created_at": 1789422566.7265499, "supported_languages": null}, "macro.dbt.validate_doc_columns": {"name": "validate_doc_columns", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/persist_docs.sql", "original_file_path": "macros/adapters/persist_docs.sql", "unique_id": "macro.dbt.validate_doc_columns", "macro_sql": "{% macro validate_doc_columns(relation, column_dict, existing_column_names) %}\n {% set existing_lower = existing_column_names | map(\"lower\") | list %}\n {% set missing = [] %}\n {% set filtered = {} %}\n {% for col_name in column_dict %}\n {% set is_quoted = column_dict[col_name]['quote'] %}\n {% if is_quoted %}\n {% set present = col_name in existing_column_names %}\n {% else %}\n {% set present = col_name | lower in existing_lower %}\n {% endif %}\n {% if present %}\n {% do filtered.update({col_name: column_dict[col_name]}) %}\n {% else %}\n {% do missing.append(col_name) %}\n {% endif %}\n {% endfor %}\n {% if missing | length > 0 %}\n {{ exceptions.warn(\"In relation \" ~ relation.render() ~ \": The following columns are specified in the schema but are not present in the database: \" ~ missing | join(\", \")) }}\n {% endif %}\n {{ return(filtered) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "column_dict", "type": null, "description": ""}, {"name": "existing_column_names", "type": null, "description": ""}], "created_at": 1789422566.7286646, "supported_languages": null}, "macro.dbt.default__persist_docs": {"name": "default__persist_docs", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/persist_docs.sql", "original_file_path": "macros/adapters/persist_docs.sql", "unique_id": "macro.dbt.default__persist_docs", "macro_sql": "{% macro default__persist_docs(relation, model, for_relation, for_columns) -%}\n {% if for_relation and config.persist_relation_docs() and model.description %}\n {% do run_query(alter_relation_comment(relation, model.description)) %}\n {% endif %}\n\n {% if for_columns and config.persist_column_docs() and model.columns %}\n {% set existing_columns = adapter.get_columns_in_relation(relation) | map(attribute=\"name\") | list %}\n {% set filtered_columns = validate_doc_columns(relation, model.columns, existing_columns) %}\n {% set alter_comment_sql = alter_column_comment(relation, filtered_columns) %}\n {% if alter_comment_sql and alter_comment_sql | trim | length > 0 %}\n {% do run_query(alter_comment_sql) %}\n {% endif %}\n {% endif %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.run_query", "macro.dbt.alter_relation_comment", "macro.dbt.validate_doc_columns", "macro.dbt.alter_column_comment"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "model", "type": null, "description": ""}, {"name": "for_relation", "type": null, "description": ""}, {"name": "for_columns", "type": null, "description": ""}], "created_at": 1789422566.7304385, "supported_languages": null}, "macro.dbt.get_columns_in_relation": {"name": "get_columns_in_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "unique_id": "macro.dbt.get_columns_in_relation", "macro_sql": "{% macro get_columns_in_relation(relation) -%}\n {{ return(adapter.dispatch('get_columns_in_relation', 'dbt')(relation)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__get_columns_in_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789422566.732719, "supported_languages": null}, "macro.dbt.default__get_columns_in_relation": {"name": "default__get_columns_in_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "unique_id": "macro.dbt.default__get_columns_in_relation", "macro_sql": "{% macro default__get_columns_in_relation(relation) -%}\n {{ exceptions.raise_not_implemented(\n 'get_columns_in_relation macro not implemented for adapter '+adapter.type()) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789422566.7330706, "supported_languages": null}, "macro.dbt.sql_convert_columns_in_relation": {"name": "sql_convert_columns_in_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "unique_id": "macro.dbt.sql_convert_columns_in_relation", "macro_sql": "{% macro sql_convert_columns_in_relation(table) -%}\n {% set columns = [] %}\n {% for row in table %}\n {% do columns.append(api.Column(*row)) %}\n {% endfor %}\n {{ return(columns) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "table", "type": null, "description": ""}], "created_at": 1789422566.7337415, "supported_languages": null}, "macro.dbt.get_list_of_column_names": {"name": "get_list_of_column_names", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "unique_id": "macro.dbt.get_list_of_column_names", "macro_sql": "\n\n{%- macro get_list_of_column_names(columns) -%}\n {% set col_names = [] %}\n {% for col in columns %}\n {% do col_names.append(col.name) %}\n {% endfor %}\n {{ return(col_names) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "columns", "type": null, "description": ""}], "created_at": 1789422566.73433, "supported_languages": null}, "macro.dbt.get_empty_subquery_sql": {"name": "get_empty_subquery_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "unique_id": "macro.dbt.get_empty_subquery_sql", "macro_sql": "{% macro get_empty_subquery_sql(select_sql, select_sql_header=none) -%}\n {{ return(adapter.dispatch('get_empty_subquery_sql', 'dbt')(select_sql, select_sql_header)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_empty_subquery_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "select_sql", "type": null, "description": ""}, {"name": "select_sql_header", "type": null, "description": ""}], "created_at": 1789422566.7347944, "supported_languages": null}, "macro.dbt.default__get_empty_subquery_sql": {"name": "default__get_empty_subquery_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "unique_id": "macro.dbt.default__get_empty_subquery_sql", "macro_sql": "{% macro default__get_empty_subquery_sql(select_sql, select_sql_header=none) %}\n {%- if select_sql_header is not none -%}\n {{ select_sql_header }}\n {%- endif -%}\n select * from (\n {{ select_sql }}\n ) as __dbt_sbq\n where false\n limit 0\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "select_sql", "type": null, "description": ""}, {"name": "select_sql_header", "type": null, "description": ""}], "created_at": 1789422566.735231, "supported_languages": null}, "macro.dbt.get_empty_schema_sql": {"name": "get_empty_schema_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "unique_id": "macro.dbt.get_empty_schema_sql", "macro_sql": "{% macro get_empty_schema_sql(columns) -%}\n {{ return(adapter.dispatch('get_empty_schema_sql', 'dbt')(columns)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_empty_schema_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "columns", "type": null, "description": ""}], "created_at": 1789422566.735625, "supported_languages": null}, "macro.dbt.default__get_empty_schema_sql": {"name": "default__get_empty_schema_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "unique_id": "macro.dbt.default__get_empty_schema_sql", "macro_sql": "{% macro default__get_empty_schema_sql(columns) %}\n {%- set col_err = [] -%}\n {%- set col_naked_numeric = [] -%}\n select\n {% for i in columns %}\n {%- set col = columns[i] -%}\n {%- if col['data_type'] is not defined -%}\n {%- do col_err.append(col['name']) -%}\n {#-- If this column's type is just 'numeric' then it is missing precision/scale, raise a warning --#}\n {%- elif col['data_type'].strip().lower() in ('numeric', 'decimal', 'number') -%}\n {%- do col_naked_numeric.append(col['name']) -%}\n {%- endif -%}\n {% set col_name = adapter.quote(col['name']) if col.get('quote') else col['name'] %}\n {{ cast('null', col['data_type']) }} as {{ col_name }}{{ \", \" if not loop.last }}\n {%- endfor -%}\n {%- if (col_err | length) > 0 -%}\n {{ exceptions.column_type_missing(column_names=col_err) }}\n {%- elif (col_naked_numeric | length) > 0 -%}\n {{ exceptions.warn(\"Detected columns with numeric type and unspecified precision/scale, this can lead to unintended rounding: \" ~ col_naked_numeric ~ \"`\") }}\n {%- endif -%}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.cast"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "columns", "type": null, "description": ""}], "created_at": 1789422566.737975, "supported_languages": null}, "macro.dbt.get_column_schema_from_query": {"name": "get_column_schema_from_query", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "unique_id": "macro.dbt.get_column_schema_from_query", "macro_sql": "{% macro get_column_schema_from_query(select_sql, select_sql_header=none) -%}\n {% set columns = [] %}\n {# -- Using an 'empty subquery' here to get the same schema as the given select_sql statement, without necessitating a data scan.#}\n {% set sql = get_empty_subquery_sql(select_sql, select_sql_header) %}\n {% set column_schema = adapter.get_column_schema_from_query(sql) %}\n {{ return(column_schema) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_empty_subquery_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "select_sql", "type": null, "description": ""}, {"name": "select_sql_header", "type": null, "description": ""}], "created_at": 1789422566.7386892, "supported_languages": null}, "macro.dbt.get_columns_in_query": {"name": "get_columns_in_query", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "unique_id": "macro.dbt.get_columns_in_query", "macro_sql": "{% macro get_columns_in_query(select_sql) -%}\n {{ return(adapter.dispatch('get_columns_in_query', 'dbt')(select_sql)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_columns_in_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "select_sql", "type": null, "description": ""}], "created_at": 1789422566.7390711, "supported_languages": null}, "macro.dbt.default__get_columns_in_query": {"name": "default__get_columns_in_query", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "unique_id": "macro.dbt.default__get_columns_in_query", "macro_sql": "{% macro default__get_columns_in_query(select_sql) %}\n {% call statement('get_columns_in_query', fetch_result=True, auto_begin=False) -%}\n {{ get_empty_subquery_sql(select_sql) }}\n {% endcall %}\n {{ return(load_result('get_columns_in_query').table.columns | map(attribute='name') | list) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement", "macro.dbt.get_empty_subquery_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "select_sql", "type": null, "description": ""}], "created_at": 1789422566.7398105, "supported_languages": null}, "macro.dbt.alter_column_type": {"name": "alter_column_type", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "unique_id": "macro.dbt.alter_column_type", "macro_sql": "{% macro alter_column_type(relation, column_name, new_column_type) -%}\n {{ return(adapter.dispatch('alter_column_type', 'dbt')(relation, column_name, new_column_type)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__alter_column_type"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "column_name", "type": null, "description": ""}, {"name": "new_column_type", "type": null, "description": ""}], "created_at": 1789422566.7402956, "supported_languages": null}, "macro.dbt.default__alter_column_type": {"name": "default__alter_column_type", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "unique_id": "macro.dbt.default__alter_column_type", "macro_sql": "{% macro default__alter_column_type(relation, column_name, new_column_type) -%}\n {#\n 1. Create a new column (w/ temp name and correct type)\n 2. Copy data over to it\n 3. Drop the existing column (cascade!)\n 4. Rename the new column to existing column\n #}\n {%- set tmp_column = column_name + \"__dbt_alter\" -%}\n\n {% call statement('alter_column_type') %}\n alter table {{ relation.render() }} add column {{ adapter.quote(tmp_column) }} {{ new_column_type }};\n update {{ relation.render() }} set {{ adapter.quote(tmp_column) }} = {{ adapter.quote(column_name) }};\n alter table {{ relation.render() }} drop column {{ adapter.quote(column_name) }} cascade;\n alter table {{ relation.render() }} rename column {{ adapter.quote(tmp_column) }} to {{ adapter.quote(column_name) }}\n {% endcall %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "column_name", "type": null, "description": ""}, {"name": "new_column_type", "type": null, "description": ""}], "created_at": 1789422566.74181, "supported_languages": null}, "macro.dbt.alter_relation_add_remove_columns": {"name": "alter_relation_add_remove_columns", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "unique_id": "macro.dbt.alter_relation_add_remove_columns", "macro_sql": "{% macro alter_relation_add_remove_columns(relation, add_columns = none, remove_columns = none) -%}\n {{ return(adapter.dispatch('alter_relation_add_remove_columns', 'dbt')(relation, add_columns, remove_columns)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__alter_relation_add_remove_columns"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "add_columns", "type": null, "description": ""}, {"name": "remove_columns", "type": null, "description": ""}], "created_at": 1789422566.7423255, "supported_languages": null}, "macro.dbt.default__alter_relation_add_remove_columns": {"name": "default__alter_relation_add_remove_columns", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "unique_id": "macro.dbt.default__alter_relation_add_remove_columns", "macro_sql": "{% macro default__alter_relation_add_remove_columns(relation, add_columns, remove_columns) %}\n\n {% if add_columns is none %}\n {% set add_columns = [] %}\n {% endif %}\n {% if remove_columns is none %}\n {% set remove_columns = [] %}\n {% endif %}\n\n {% set sql -%}\n\n alter {{ relation.type }} {{ relation.render() }}\n\n {% for column in add_columns %}\n add column {{ column.quoted }} {{ column.expanded_data_type }}{{ ',' if not loop.last }}\n {% endfor %}{{ ',' if add_columns and remove_columns }}\n\n {% for column in remove_columns %}\n drop column {{ column.quoted }}{{ ',' if not loop.last }}\n {% endfor %}\n\n {%- endset -%}\n\n {% do run_query(sql) %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "add_columns", "type": null, "description": ""}, {"name": "remove_columns", "type": null, "description": ""}], "created_at": 1789422566.7439692, "supported_languages": null}, "macro.dbt.get_create_index_sql": {"name": "get_create_index_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/indexes.sql", "original_file_path": "macros/adapters/indexes.sql", "unique_id": "macro.dbt.get_create_index_sql", "macro_sql": "{% macro get_create_index_sql(relation, index_dict) -%}\n {{ return(adapter.dispatch('get_create_index_sql', 'dbt')(relation, index_dict)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__get_create_index_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "index_dict", "type": null, "description": ""}], "created_at": 1789422566.7449834, "supported_languages": null}, "macro.dbt.default__get_create_index_sql": {"name": "default__get_create_index_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/indexes.sql", "original_file_path": "macros/adapters/indexes.sql", "unique_id": "macro.dbt.default__get_create_index_sql", "macro_sql": "{% macro default__get_create_index_sql(relation, index_dict) -%}\n {% do return(None) %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "index_dict", "type": null, "description": ""}], "created_at": 1789422566.7452774, "supported_languages": null}, "macro.dbt.create_indexes": {"name": "create_indexes", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/indexes.sql", "original_file_path": "macros/adapters/indexes.sql", "unique_id": "macro.dbt.create_indexes", "macro_sql": "{% macro create_indexes(relation) -%}\n {{ adapter.dispatch('create_indexes', 'dbt')(relation) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__create_indexes"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789422566.7456298, "supported_languages": null}, "macro.dbt.default__create_indexes": {"name": "default__create_indexes", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/indexes.sql", "original_file_path": "macros/adapters/indexes.sql", "unique_id": "macro.dbt.default__create_indexes", "macro_sql": "{% macro default__create_indexes(relation) -%}\n {%- set _indexes = config.get('indexes', default=[]) -%}\n\n {% for _index_dict in _indexes %}\n {% set create_index_sql = get_create_index_sql(relation, _index_dict) %}\n {% if create_index_sql %}\n {% do run_query(create_index_sql) %}\n {% endif %}\n {% endfor %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_create_index_sql", "macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789422566.7464464, "supported_languages": null}, "macro.dbt.get_drop_index_sql": {"name": "get_drop_index_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/indexes.sql", "original_file_path": "macros/adapters/indexes.sql", "unique_id": "macro.dbt.get_drop_index_sql", "macro_sql": "{% macro get_drop_index_sql(relation, index_name) -%}\n {{ adapter.dispatch('get_drop_index_sql', 'dbt')(relation, index_name) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__get_drop_index_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "index_name", "type": null, "description": ""}], "created_at": 1789422566.7468884, "supported_languages": null}, "macro.dbt.default__get_drop_index_sql": {"name": "default__get_drop_index_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/indexes.sql", "original_file_path": "macros/adapters/indexes.sql", "unique_id": "macro.dbt.default__get_drop_index_sql", "macro_sql": "{% macro default__get_drop_index_sql(relation, index_name) -%}\n {{ exceptions.raise_compiler_error(\"`get_drop_index_sql has not been implemented for this adapter.\") }}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "index_name", "type": null, "description": ""}], "created_at": 1789422566.7472048, "supported_languages": null}, "macro.dbt.get_show_indexes_sql": {"name": "get_show_indexes_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/indexes.sql", "original_file_path": "macros/adapters/indexes.sql", "unique_id": "macro.dbt.get_show_indexes_sql", "macro_sql": "{% macro get_show_indexes_sql(relation) -%}\n {{ adapter.dispatch('get_show_indexes_sql', 'dbt')(relation) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__get_show_indexes_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789422566.747565, "supported_languages": null}, "macro.dbt.default__get_show_indexes_sql": {"name": "default__get_show_indexes_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/indexes.sql", "original_file_path": "macros/adapters/indexes.sql", "unique_id": "macro.dbt.default__get_show_indexes_sql", "macro_sql": "{% macro default__get_show_indexes_sql(relation) -%}\n {{ exceptions.raise_compiler_error(\"`get_show_indexes_sql has not been implemented for this adapter.\") }}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789422566.7478402, "supported_languages": null}, "macro.dbt.get_catalog_relations": {"name": "get_catalog_relations", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "unique_id": "macro.dbt.get_catalog_relations", "macro_sql": "{% macro get_catalog_relations(information_schema, relations) -%}\n {{ return(adapter.dispatch('get_catalog_relations', 'dbt')(information_schema, relations)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__get_catalog_relations"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "information_schema", "type": null, "description": ""}, {"name": "relations", "type": null, "description": ""}], "created_at": 1789422566.749547, "supported_languages": null}, "macro.dbt.default__get_catalog_relations": {"name": "default__get_catalog_relations", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "unique_id": "macro.dbt.default__get_catalog_relations", "macro_sql": "{% macro default__get_catalog_relations(information_schema, relations) -%}\n {% set typename = adapter.type() %}\n {% set msg -%}\n get_catalog_relations not implemented for {{ typename }}\n {%- endset %}\n\n {{ exceptions.raise_compiler_error(msg) }}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "information_schema", "type": null, "description": ""}, {"name": "relations", "type": null, "description": ""}], "created_at": 1789422566.7500935, "supported_languages": null}, "macro.dbt.get_catalog": {"name": "get_catalog", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "unique_id": "macro.dbt.get_catalog", "macro_sql": "{% macro get_catalog(information_schema, schemas) -%}\n {{ return(adapter.dispatch('get_catalog', 'dbt')(information_schema, schemas)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__get_catalog"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "information_schema", "type": null, "description": ""}, {"name": "schemas", "type": null, "description": ""}], "created_at": 1789422566.7505064, "supported_languages": null}, "macro.dbt.default__get_catalog": {"name": "default__get_catalog", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "unique_id": "macro.dbt.default__get_catalog", "macro_sql": "{% macro default__get_catalog(information_schema, schemas) -%}\n\n {% set typename = adapter.type() %}\n {% set msg -%}\n get_catalog not implemented for {{ typename }}\n {%- endset %}\n\n {{ exceptions.raise_compiler_error(msg) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "information_schema", "type": null, "description": ""}, {"name": "schemas", "type": null, "description": ""}], "created_at": 1789422566.7510574, "supported_languages": null}, "macro.dbt.information_schema_name": {"name": "information_schema_name", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "unique_id": "macro.dbt.information_schema_name", "macro_sql": "{% macro information_schema_name(database) %}\n {{ return(adapter.dispatch('information_schema_name', 'dbt')(database)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__information_schema_name"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "database", "type": null, "description": ""}], "created_at": 1789422566.7514288, "supported_languages": null}, "macro.dbt.default__information_schema_name": {"name": "default__information_schema_name", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "unique_id": "macro.dbt.default__information_schema_name", "macro_sql": "{% macro default__information_schema_name(database) -%}\n {%- if database -%}\n {{ database }}.INFORMATION_SCHEMA\n {%- else -%}\n INFORMATION_SCHEMA\n {%- endif -%}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "database", "type": null, "description": ""}], "created_at": 1789422566.751916, "supported_languages": null}, "macro.dbt.list_schemas": {"name": "list_schemas", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "unique_id": "macro.dbt.list_schemas", "macro_sql": "{% macro list_schemas(database) -%}\n {{ return(adapter.dispatch('list_schemas', 'dbt')(database)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__list_schemas"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "database", "type": null, "description": ""}], "created_at": 1789422566.7522855, "supported_languages": null}, "macro.dbt.default__list_schemas": {"name": "default__list_schemas", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "unique_id": "macro.dbt.default__list_schemas", "macro_sql": "{% macro default__list_schemas(database) -%}\n {% set sql %}\n select distinct schema_name\n from {{ information_schema_name(database) }}.SCHEMATA\n where catalog_name ilike '{{ database }}'\n {% endset %}\n {{ return(run_query(sql)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.information_schema_name", "macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "database", "type": null, "description": ""}], "created_at": 1789422566.7528024, "supported_languages": null}, "macro.dbt.check_schema_exists": {"name": "check_schema_exists", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "unique_id": "macro.dbt.check_schema_exists", "macro_sql": "{% macro check_schema_exists(information_schema, schema) -%}\n {{ return(adapter.dispatch('check_schema_exists', 'dbt')(information_schema, schema)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__check_schema_exists"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "information_schema", "type": null, "description": ""}, {"name": "schema", "type": null, "description": ""}], "created_at": 1789422566.7532167, "supported_languages": null}, "macro.dbt.default__check_schema_exists": {"name": "default__check_schema_exists", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "unique_id": "macro.dbt.default__check_schema_exists", "macro_sql": "{% macro default__check_schema_exists(information_schema, schema) -%}\n {% set sql -%}\n select count(*)\n from {{ information_schema.replace(information_schema_view='SCHEMATA') }}\n where catalog_name='{{ information_schema.database }}'\n and schema_name='{{ schema }}'\n {%- endset %}\n {{ return(run_query(sql)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.replace", "macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "information_schema", "type": null, "description": ""}, {"name": "schema", "type": null, "description": ""}], "created_at": 1789422566.7538514, "supported_languages": null}, "macro.dbt.list_relations_without_caching": {"name": "list_relations_without_caching", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "unique_id": "macro.dbt.list_relations_without_caching", "macro_sql": "{% macro list_relations_without_caching(schema_relation) %}\n {{ return(adapter.dispatch('list_relations_without_caching', 'dbt')(schema_relation)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__list_relations_without_caching"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "schema_relation", "type": null, "description": ""}], "created_at": 1789422566.7542272, "supported_languages": null}, "macro.dbt.default__list_relations_without_caching": {"name": "default__list_relations_without_caching", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "unique_id": "macro.dbt.default__list_relations_without_caching", "macro_sql": "{% macro default__list_relations_without_caching(schema_relation) %}\n {{ exceptions.raise_not_implemented(\n 'list_relations_without_caching macro not implemented for adapter '+adapter.type()) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "schema_relation", "type": null, "description": ""}], "created_at": 1789422566.7545776, "supported_languages": null}, "macro.dbt.list_function_relations_without_caching": {"name": "list_function_relations_without_caching", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "unique_id": "macro.dbt.list_function_relations_without_caching", "macro_sql": "{% macro list_function_relations_without_caching(schema_relation) %}\n {{ return(adapter.dispatch('list_function_relations_without_caching', 'dbt')(schema_relation)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__list_function_relations_without_caching"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "schema_relation", "type": null, "description": ""}], "created_at": 1789422566.7549646, "supported_languages": null}, "macro.dbt.default__list_function_relations_without_caching": {"name": "default__list_function_relations_without_caching", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "unique_id": "macro.dbt.default__list_function_relations_without_caching", "macro_sql": "{% macro default__list_function_relations_without_caching(schema_relation) %}\n {{ exceptions.raise_not_implemented(\n 'list_function_relations_without_caching macro not implemented for adapter '+adapter.type()) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "schema_relation", "type": null, "description": ""}], "created_at": 1789422566.7552981, "supported_languages": null}, "macro.dbt.get_catalog_for_single_relation": {"name": "get_catalog_for_single_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "unique_id": "macro.dbt.get_catalog_for_single_relation", "macro_sql": "{% macro get_catalog_for_single_relation(relation) %}\n {{ return(adapter.dispatch('get_catalog_for_single_relation', 'dbt')(relation)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_catalog_for_single_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789422566.7556884, "supported_languages": null}, "macro.dbt.default__get_catalog_for_single_relation": {"name": "default__get_catalog_for_single_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "unique_id": "macro.dbt.default__get_catalog_for_single_relation", "macro_sql": "{% macro default__get_catalog_for_single_relation(relation) %}\n {{ exceptions.raise_not_implemented(\n 'get_catalog_for_single_relation macro not implemented for adapter '+adapter.type()) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789422566.756015, "supported_languages": null}, "macro.dbt.get_relations": {"name": "get_relations", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "unique_id": "macro.dbt.get_relations", "macro_sql": "{% macro get_relations() %}\n {{ return(adapter.dispatch('get_relations', 'dbt')()) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__get_relations"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789422566.7563472, "supported_languages": null}, "macro.dbt.default__get_relations": {"name": "default__get_relations", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "unique_id": "macro.dbt.default__get_relations", "macro_sql": "{% macro default__get_relations() %}\n {{ exceptions.raise_not_implemented(\n 'get_relations macro not implemented for adapter '+adapter.type()) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789422566.7566772, "supported_languages": null}, "macro.dbt.get_relation_last_modified": {"name": "get_relation_last_modified", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "unique_id": "macro.dbt.get_relation_last_modified", "macro_sql": "{% macro get_relation_last_modified(information_schema, relations) %}\n {{ return(adapter.dispatch('get_relation_last_modified', 'dbt')(information_schema, relations)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_relation_last_modified"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "information_schema", "type": null, "description": ""}, {"name": "relations", "type": null, "description": ""}], "created_at": 1789422566.7570934, "supported_languages": null}, "macro.dbt.default__get_relation_last_modified": {"name": "default__get_relation_last_modified", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "unique_id": "macro.dbt.default__get_relation_last_modified", "macro_sql": "{% macro default__get_relation_last_modified(information_schema, relations) %}\n {{ exceptions.raise_not_implemented(\n 'get_relation_last_modified macro not implemented for adapter ' + adapter.type()) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "information_schema", "type": null, "description": ""}, {"name": "relations", "type": null, "description": ""}], "created_at": 1789422566.7574434, "supported_languages": null}, "macro.dbt.validate_sql": {"name": "validate_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/validate_sql.sql", "original_file_path": "macros/adapters/validate_sql.sql", "unique_id": "macro.dbt.validate_sql", "macro_sql": "{% macro validate_sql(sql) -%}\n {{ return(adapter.dispatch('validate_sql', 'dbt')(sql)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__validate_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "sql", "type": null, "description": ""}], "created_at": 1789422566.7580557, "supported_languages": null}, "macro.dbt.default__validate_sql": {"name": "default__validate_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/validate_sql.sql", "original_file_path": "macros/adapters/validate_sql.sql", "unique_id": "macro.dbt.default__validate_sql", "macro_sql": "{% macro default__validate_sql(sql) -%}\n {% call statement('validate_sql') -%}\n explain {{ sql }}\n {% endcall %}\n {{ return(load_result('validate_sql')) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "sql", "type": null, "description": ""}], "created_at": 1789422566.7586913, "supported_languages": null}, "macro.dbt.collect_freshness": {"name": "collect_freshness", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/freshness.sql", "original_file_path": "macros/adapters/freshness.sql", "unique_id": "macro.dbt.collect_freshness", "macro_sql": "{% macro collect_freshness(source, loaded_at_field, filter) %}\n {{ return(adapter.dispatch('collect_freshness', 'dbt')(source, loaded_at_field, filter))}}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__collect_freshness"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "source", "type": null, "description": ""}, {"name": "loaded_at_field", "type": null, "description": ""}, {"name": "filter", "type": null, "description": ""}], "created_at": 1789422566.7596006, "supported_languages": null}, "macro.dbt.default__collect_freshness": {"name": "default__collect_freshness", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/freshness.sql", "original_file_path": "macros/adapters/freshness.sql", "unique_id": "macro.dbt.default__collect_freshness", "macro_sql": "{% macro default__collect_freshness(source, loaded_at_field, filter) %}\n {% call statement('collect_freshness', fetch_result=True, auto_begin=False) -%}\n select\n max({{ loaded_at_field }}) as max_loaded_at,\n {{ current_timestamp() }} as snapshotted_at\n from {{ source }}\n {% if filter %}\n where {{ filter }}\n {% endif %}\n {% endcall %}\n {{ return(load_result('collect_freshness')) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement", "macro.dbt.current_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "source", "type": null, "description": ""}, {"name": "loaded_at_field", "type": null, "description": ""}, {"name": "filter", "type": null, "description": ""}], "created_at": 1789422566.760444, "supported_languages": null}, "macro.dbt.collect_freshness_custom_sql": {"name": "collect_freshness_custom_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/freshness.sql", "original_file_path": "macros/adapters/freshness.sql", "unique_id": "macro.dbt.collect_freshness_custom_sql", "macro_sql": "{% macro collect_freshness_custom_sql(source, loaded_at_query) %}\n {{ return(adapter.dispatch('collect_freshness_custom_sql', 'dbt')(source, loaded_at_query))}}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__collect_freshness_custom_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "source", "type": null, "description": ""}, {"name": "loaded_at_query", "type": null, "description": ""}], "created_at": 1789422566.7608943, "supported_languages": null}, "macro.dbt.default__collect_freshness_custom_sql": {"name": "default__collect_freshness_custom_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/freshness.sql", "original_file_path": "macros/adapters/freshness.sql", "unique_id": "macro.dbt.default__collect_freshness_custom_sql", "macro_sql": "{% macro default__collect_freshness_custom_sql(source, loaded_at_query) %}\n {% call statement('collect_freshness_custom_sql', fetch_result=True, auto_begin=False) -%}\n with source_query as (\n {{ loaded_at_query }}\n )\n select\n (select * from source_query) as max_loaded_at,\n {{ current_timestamp() }} as snapshotted_at\n {% endcall %}\n {{ return(load_result('collect_freshness_custom_sql')) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement", "macro.dbt.current_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "source", "type": null, "description": ""}, {"name": "loaded_at_query", "type": null, "description": ""}], "created_at": 1789422566.7615488, "supported_languages": null}, "macro.dbt.make_intermediate_relation": {"name": "make_intermediate_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "unique_id": "macro.dbt.make_intermediate_relation", "macro_sql": "{% macro make_intermediate_relation(base_relation, suffix='__dbt_tmp') %}\n {{ return(adapter.dispatch('make_intermediate_relation', 'dbt')(base_relation, suffix)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__make_intermediate_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "base_relation", "type": null, "description": ""}, {"name": "suffix", "type": null, "description": ""}], "created_at": 1789422566.7629483, "supported_languages": null}, "macro.dbt.default__make_intermediate_relation": {"name": "default__make_intermediate_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "unique_id": "macro.dbt.default__make_intermediate_relation", "macro_sql": "{% macro default__make_intermediate_relation(base_relation, suffix) %}\n {{ return(default__make_temp_relation(base_relation, suffix)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__make_temp_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "base_relation", "type": null, "description": ""}, {"name": "suffix", "type": null, "description": ""}], "created_at": 1789422566.7633042, "supported_languages": null}, "macro.dbt.make_temp_relation": {"name": "make_temp_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "unique_id": "macro.dbt.make_temp_relation", "macro_sql": "{% macro make_temp_relation(base_relation, suffix='__dbt_tmp') %}\n {#-- This ensures microbatch batches get unique temp relations to avoid clobbering --#}\n {% if suffix == '__dbt_tmp' and model.batch %}\n {% set suffix = suffix ~ '_' ~ model.batch.id %}\n {% endif %}\n\n {{ return(adapter.dispatch('make_temp_relation', 'dbt')(base_relation, suffix)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__make_temp_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "base_relation", "type": null, "description": ""}, {"name": "suffix", "type": null, "description": ""}], "created_at": 1789422566.7641368, "supported_languages": null}, "macro.dbt.default__make_temp_relation": {"name": "default__make_temp_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "unique_id": "macro.dbt.default__make_temp_relation", "macro_sql": "{% macro default__make_temp_relation(base_relation, suffix) %}\n {%- set temp_identifier = base_relation.identifier ~ suffix -%}\n {%- set temp_relation = base_relation.incorporate(\n path={\"identifier\": temp_identifier}) -%}\n\n {{ return(temp_relation) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "base_relation", "type": null, "description": ""}, {"name": "suffix", "type": null, "description": ""}], "created_at": 1789422566.7647634, "supported_languages": null}, "macro.dbt.make_backup_relation": {"name": "make_backup_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "unique_id": "macro.dbt.make_backup_relation", "macro_sql": "{% macro make_backup_relation(base_relation, backup_relation_type, suffix='__dbt_backup') %}\n {{ return(adapter.dispatch('make_backup_relation', 'dbt')(base_relation, backup_relation_type, suffix)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__make_backup_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "base_relation", "type": null, "description": ""}, {"name": "backup_relation_type", "type": null, "description": ""}, {"name": "suffix", "type": null, "description": ""}], "created_at": 1789422566.7652571, "supported_languages": null}, "macro.dbt.default__make_backup_relation": {"name": "default__make_backup_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "unique_id": "macro.dbt.default__make_backup_relation", "macro_sql": "{% macro default__make_backup_relation(base_relation, backup_relation_type, suffix) %}\n {%- set backup_identifier = base_relation.identifier ~ suffix -%}\n {%- set backup_relation = base_relation.incorporate(\n path={\"identifier\": backup_identifier},\n type=backup_relation_type\n ) -%}\n {{ return(backup_relation) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "base_relation", "type": null, "description": ""}, {"name": "backup_relation_type", "type": null, "description": ""}, {"name": "suffix", "type": null, "description": ""}], "created_at": 1789422566.7659912, "supported_languages": null}, "macro.dbt.truncate_relation": {"name": "truncate_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "unique_id": "macro.dbt.truncate_relation", "macro_sql": "{% macro truncate_relation(relation) -%}\n {{ return(adapter.dispatch('truncate_relation', 'dbt')(relation)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__truncate_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789422566.7664187, "supported_languages": null}, "macro.dbt.default__truncate_relation": {"name": "default__truncate_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "unique_id": "macro.dbt.default__truncate_relation", "macro_sql": "{% macro default__truncate_relation(relation) -%}\n {% call statement('truncate_relation') -%}\n truncate table {{ relation.render() }}\n {%- endcall %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789422566.7668948, "supported_languages": null}, "macro.dbt.get_or_create_relation": {"name": "get_or_create_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "unique_id": "macro.dbt.get_or_create_relation", "macro_sql": "{% macro get_or_create_relation(database, schema, identifier, type) -%}\n {{ return(adapter.dispatch('get_or_create_relation', 'dbt')(database, schema, identifier, type)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_or_create_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "database", "type": null, "description": ""}, {"name": "schema", "type": null, "description": ""}, {"name": "identifier", "type": null, "description": ""}, {"name": "type", "type": null, "description": ""}], "created_at": 1789422566.7674046, "supported_languages": null}, "macro.dbt.default__get_or_create_relation": {"name": "default__get_or_create_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "unique_id": "macro.dbt.default__get_or_create_relation", "macro_sql": "{% macro default__get_or_create_relation(database, schema, identifier, type) %}\n {%- set target_relation = adapter.get_relation(database=database, schema=schema, identifier=identifier) %}\n\n {% if target_relation %}\n {% do return([true, target_relation]) %}\n {% endif %}\n\n {%- set new_relation = api.Relation.create(\n database=database,\n schema=schema,\n identifier=identifier,\n type=type\n ) -%}\n {% do return([false, new_relation]) %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "database", "type": null, "description": ""}, {"name": "schema", "type": null, "description": ""}, {"name": "identifier", "type": null, "description": ""}, {"name": "type", "type": null, "description": ""}], "created_at": 1789422566.768728, "supported_languages": null}, "macro.dbt.load_cached_relation": {"name": "load_cached_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "unique_id": "macro.dbt.load_cached_relation", "macro_sql": "{% macro load_cached_relation(relation) %}\n {% do return(adapter.get_relation(\n database=relation.database,\n schema=relation.schema,\n identifier=relation.identifier\n )) -%}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789422566.7691922, "supported_languages": null}, "macro.dbt.load_relation": {"name": "load_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "unique_id": "macro.dbt.load_relation", "macro_sql": "{% macro load_relation(relation) %}\n {{ return(load_cached_relation(relation)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.load_cached_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789422566.7694907, "supported_languages": null}, "macro.dbt.test_unique": {"name": "test_unique", "resource_type": "macro", "package_name": "dbt", "path": "tests/generic/builtin.sql", "original_file_path": "tests/generic/builtin.sql", "unique_id": "macro.dbt.test_unique", "macro_sql": "{% test unique(model, column_name) %}\n {% set macro = adapter.dispatch('test_unique', 'dbt') %}\n {{ macro(model, column_name) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt.default__test_unique"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789422566.7703934, "supported_languages": null}, "macro.dbt.test_not_null": {"name": "test_not_null", "resource_type": "macro", "package_name": "dbt", "path": "tests/generic/builtin.sql", "original_file_path": "tests/generic/builtin.sql", "unique_id": "macro.dbt.test_not_null", "macro_sql": "{% test not_null(model, column_name) %}\n {% set macro = adapter.dispatch('test_not_null', 'dbt') %}\n {{ macro(model, column_name) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt.default__test_not_null"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789422566.770916, "supported_languages": null}, "macro.dbt.test_accepted_values": {"name": "test_accepted_values", "resource_type": "macro", "package_name": "dbt", "path": "tests/generic/builtin.sql", "original_file_path": "tests/generic/builtin.sql", "unique_id": "macro.dbt.test_accepted_values", "macro_sql": "{% test accepted_values(model, column_name, values, quote=True) %}\n {% set macro = adapter.dispatch('test_accepted_values', 'dbt') %}\n {{ macro(model, column_name, values, quote) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt.default__test_accepted_values"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789422566.7715425, "supported_languages": null}, "macro.dbt.test_relationships": {"name": "test_relationships", "resource_type": "macro", "package_name": "dbt", "path": "tests/generic/builtin.sql", "original_file_path": "tests/generic/builtin.sql", "unique_id": "macro.dbt.test_relationships", "macro_sql": "{% test relationships(model, column_name, to, field) %}\n {% set macro = adapter.dispatch('test_relationships', 'dbt') %}\n {{ macro(model, column_name, to, field) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt.default__test_relationships"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789422566.772132, "supported_languages": null}, "macro.dbt_utils.slugify": {"name": "slugify", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/jinja_helpers/slugify.sql", "original_file_path": "macros/jinja_helpers/slugify.sql", "unique_id": "macro.dbt_utils.slugify", "macro_sql": "{% macro slugify(string) %}\n\n{% if not string %}\n{{ return('') }}\n{% endif %}\n\n{#- Lower case the string -#}\n{% set string = string | lower %}\n{#- Replace spaces and dashes with underscores -#}\n{% set string = modules.re.sub('[ -]+', '_', string) %}\n{#- Only take letters, numbers, and underscores -#}\n{% set string = modules.re.sub('[^a-z0-9_]+', '', string) %}\n{#- Prepends \"_\" if string begins with a number -#}\n{% set string = modules.re.sub('^[0-9]', '_' + string[0], string) %}\n\n{{ return(string) }}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "string", "type": null, "description": ""}], "created_at": 1789422566.7736318, "supported_languages": null}, "macro.dbt_utils.log_info": {"name": "log_info", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/jinja_helpers/log_info.sql", "original_file_path": "macros/jinja_helpers/log_info.sql", "unique_id": "macro.dbt_utils.log_info", "macro_sql": "{% macro log_info(message) %}\n {{ return(adapter.dispatch('log_info', 'dbt_utils')(message)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__log_info"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "message", "type": null, "description": ""}], "created_at": 1789422566.7741477, "supported_languages": null}, "macro.dbt_utils.default__log_info": {"name": "default__log_info", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/jinja_helpers/log_info.sql", "original_file_path": "macros/jinja_helpers/log_info.sql", "unique_id": "macro.dbt_utils.default__log_info", "macro_sql": "{% macro default__log_info(message) %}\n {{ log(dbt_utils.pretty_log_format(message), info=True) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.pretty_log_format"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "message", "type": null, "description": ""}], "created_at": 1789422566.7744966, "supported_languages": null}, "macro.dbt_utils.pretty_log_format": {"name": "pretty_log_format", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/jinja_helpers/pretty_log_format.sql", "original_file_path": "macros/jinja_helpers/pretty_log_format.sql", "unique_id": "macro.dbt_utils.pretty_log_format", "macro_sql": "{% macro pretty_log_format(message) %}\n {{ return(adapter.dispatch('pretty_log_format', 'dbt_utils')(message)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__pretty_log_format"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "message", "type": null, "description": ""}], "created_at": 1789422566.7750258, "supported_languages": null}, "macro.dbt_utils.default__pretty_log_format": {"name": "default__pretty_log_format", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/jinja_helpers/pretty_log_format.sql", "original_file_path": "macros/jinja_helpers/pretty_log_format.sql", "unique_id": "macro.dbt_utils.default__pretty_log_format", "macro_sql": "{% macro default__pretty_log_format(message) %}\n {{ return( dbt_utils.pretty_time() ~ ' + ' ~ message) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.pretty_time"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "message", "type": null, "description": ""}], "created_at": 1789422566.7753654, "supported_languages": null}, "macro.dbt_utils._is_ephemeral": {"name": "_is_ephemeral", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/jinja_helpers/_is_ephemeral.sql", "original_file_path": "macros/jinja_helpers/_is_ephemeral.sql", "unique_id": "macro.dbt_utils._is_ephemeral", "macro_sql": "{% macro _is_ephemeral(obj, macro) %}\n {%- if obj.is_cte -%}\n {% set ephemeral_prefix = api.Relation.add_ephemeral_prefix('') %}\n {% if obj.name.startswith(ephemeral_prefix) %}\n {% set model_name = obj.name[(ephemeral_prefix|length):] %}\n {% else %}\n {% set model_name = obj.name %}\n {%- endif -%}\n {% set error_message %}\nThe `{{ macro }}` macro cannot be used with ephemeral models, as it relies on the information schema.\n\n`{{ model_name }}` is an ephemeral model. Consider making it a view or table instead.\n {% endset %}\n {%- do exceptions.raise_compiler_error(error_message) -%}\n {%- endif -%}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "obj", "type": null, "description": ""}, {"name": "macro", "type": null, "description": ""}], "created_at": 1789422566.776858, "supported_languages": null}, "macro.dbt_utils._is_relation": {"name": "_is_relation", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/jinja_helpers/_is_relation.sql", "original_file_path": "macros/jinja_helpers/_is_relation.sql", "unique_id": "macro.dbt_utils._is_relation", "macro_sql": "{% macro _is_relation(obj, macro) %}\n {%- if not (obj is mapping and obj.get('metadata', {}).get('type', '').endswith('Relation')) -%}\n {%- do exceptions.raise_compiler_error(\"Macro \" ~ macro ~ \" expected a Relation but received the value: \" ~ obj) -%}\n {%- endif -%}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "obj", "type": null, "description": ""}, {"name": "macro", "type": null, "description": ""}], "created_at": 1789422566.7777565, "supported_languages": null}, "macro.dbt_utils.pretty_time": {"name": "pretty_time", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/jinja_helpers/pretty_time.sql", "original_file_path": "macros/jinja_helpers/pretty_time.sql", "unique_id": "macro.dbt_utils.pretty_time", "macro_sql": "{% macro pretty_time(format='%H:%M:%S') %}\n {{ return(adapter.dispatch('pretty_time', 'dbt_utils')(format)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__pretty_time"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "format", "type": null, "description": ""}], "created_at": 1789422566.778298, "supported_languages": null}, "macro.dbt_utils.default__pretty_time": {"name": "default__pretty_time", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/jinja_helpers/pretty_time.sql", "original_file_path": "macros/jinja_helpers/pretty_time.sql", "unique_id": "macro.dbt_utils.default__pretty_time", "macro_sql": "{% macro default__pretty_time(format='%H:%M:%S') %}\n {{ return(modules.datetime.datetime.now().strftime(format)) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "format", "type": null, "description": ""}], "created_at": 1789422566.778714, "supported_languages": null}, "macro.dbt_utils.test_not_constant": {"name": "test_not_constant", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/not_constant.sql", "original_file_path": "macros/generic_tests/not_constant.sql", "unique_id": "macro.dbt_utils.test_not_constant", "macro_sql": "{% test not_constant(model, column_name, group_by_columns = []) %}\n {{ return(adapter.dispatch('test_not_constant', 'dbt_utils')(model, column_name, group_by_columns)) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_not_constant"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "column_name", "type": null, "description": ""}, {"name": "group_by_columns", "type": null, "description": ""}], "created_at": 1789422566.7794783, "supported_languages": null}, "macro.dbt_utils.default__test_not_constant": {"name": "default__test_not_constant", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/not_constant.sql", "original_file_path": "macros/generic_tests/not_constant.sql", "unique_id": "macro.dbt_utils.default__test_not_constant", "macro_sql": "{% macro default__test_not_constant(model, column_name, group_by_columns) %}\n\n{% if group_by_columns|length() > 0 %}\n {% set select_gb_cols = group_by_columns|join(' ,') + ', ' %}\n {% set groupby_gb_cols = 'group by ' + group_by_columns|join(',') %}\n{% endif %}\n\n\nselect\n {# In TSQL, subquery aggregate columns need aliases #}\n {# thus: a filler col name, 'filler_column' #}\n {{select_gb_cols}}\n count(distinct {{ column_name }}) as filler_column\n\nfrom {{ model }}\n\n {{groupby_gb_cols}}\n\nhaving count(distinct {{ column_name }}) = 1\n\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "column_name", "type": null, "description": ""}, {"name": "group_by_columns", "type": null, "description": ""}], "created_at": 1789422566.7805753, "supported_languages": null}, "macro.dbt_utils.test_equality": {"name": "test_equality", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/equality.sql", "original_file_path": "macros/generic_tests/equality.sql", "unique_id": "macro.dbt_utils.test_equality", "macro_sql": "{% test equality(model, compare_model, compare_columns=None, exclude_columns=None, precision = None) %}\n {{ return(adapter.dispatch('test_equality', 'dbt_utils')(model, compare_model, compare_columns, exclude_columns, precision)) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_equality"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "compare_model", "type": null, "description": ""}, {"name": "compare_columns", "type": null, "description": ""}, {"name": "exclude_columns", "type": null, "description": ""}, {"name": "precision", "type": null, "description": ""}], "created_at": 1789422566.7828298, "supported_languages": null}, "macro.dbt_utils.default__test_equality": {"name": "default__test_equality", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/equality.sql", "original_file_path": "macros/generic_tests/equality.sql", "unique_id": "macro.dbt_utils.default__test_equality", "macro_sql": "{% macro default__test_equality(model, compare_model, compare_columns=None, exclude_columns=None, precision = None) %}\n\n{%- if compare_columns and exclude_columns -%}\n {{ exceptions.raise_compiler_error(\"Both a compare and an ignore list were provided to the `equality` macro. Only one is allowed\") }}\n{%- endif -%}\n\n{% set set_diff %}\n count(*) + coalesce(abs(\n sum(case when which_diff = 'a_minus_b' then 1 else 0 end) -\n sum(case when which_diff = 'b_minus_a' then 1 else 0 end)\n ), 0)\n{% endset %}\n\n{#-- Needs to be set at parse time, before we return '' below --#}\n{{ config(fail_calc = set_diff) }}\n\n{#-- Prevent querying of db in parsing mode. This works because this macro does not create any new refs. #}\n{%- if not execute -%}\n {{ return('') }}\n{% endif %}\n\n\n\n-- setup\n{%- do dbt_utils._is_relation(model, 'test_equality') -%}\n\n{# Ensure there are no extra columns in the compare_model vs model #}\n{%- if not compare_columns -%}\n {%- do dbt_utils._is_ephemeral(model, 'test_equality') -%}\n {%- do dbt_utils._is_ephemeral(compare_model, 'test_equality') -%}\n\n {%- set model_columns = adapter.get_columns_in_relation(model) -%}\n {%- set compare_model_columns = adapter.get_columns_in_relation(compare_model) -%}\n\n\n {%- if exclude_columns -%}\n {#-- Lower case ignore columns for easier comparison --#}\n {%- set exclude_columns = exclude_columns | map(\"lower\") | list %}\n\n {# Filter out the excluded columns #}\n {%- set include_columns = [] %}\n {%- set include_model_columns = [] %}\n {%- for column in model_columns -%}\n {%- if column.name | lower not in exclude_columns -%}\n {% do include_columns.append(column) %}\n {%- endif %}\n {%- endfor %}\n {%- for column in compare_model_columns -%}\n {%- if column.name | lower not in exclude_columns -%}\n {% do include_model_columns.append(column) %}\n {%- endif %}\n {%- endfor %}\n\n {%- set compare_columns_set = set(include_columns | map(attribute='quoted') | map(\"lower\")) %}\n {%- set compare_model_columns_set = set(include_model_columns | map(attribute='quoted') | map(\"lower\")) %}\n {%- else -%}\n {%- set compare_columns_set = set(model_columns | map(attribute='quoted') | map(\"lower\")) %}\n {%- set compare_model_columns_set = set(compare_model_columns | map(attribute='quoted') | map(\"lower\")) %}\n {%- endif -%}\n\n {% if compare_columns_set != compare_model_columns_set %}\n {{ exceptions.raise_compiler_error(compare_model ~\" has less columns than \" ~ model ~ \", please ensure they have the same columns or use the `compare_columns` or `exclude_columns` arguments to subset them.\") }}\n {% endif %}\n\n\n{% endif %}\n\n{%- if not precision -%}\n {%- if not compare_columns -%}\n {# \n You cannot get the columns in an ephemeral model (due to not existing in the information schema),\n so if the user does not provide an explicit list of columns we must error in the case it is ephemeral\n #}\n {%- do dbt_utils._is_ephemeral(model, 'test_equality') -%}\n {%- set compare_columns = adapter.get_columns_in_relation(model)-%}\n\n {%- if exclude_columns -%}\n {#-- Lower case ignore columns for easier comparison --#}\n {%- set exclude_columns = exclude_columns | map(\"lower\") | list %}\n\n {# Filter out the excluded columns #}\n {%- set include_columns = [] %}\n {%- for column in compare_columns -%}\n {%- if column.name | lower not in exclude_columns -%}\n {% do include_columns.append(column) %}\n {%- endif %}\n {%- endfor %}\n\n {%- set compare_columns = include_columns | map(attribute='quoted') %}\n {%- else -%} {# Compare columns provided #}\n {%- set compare_columns = compare_columns | map(attribute='quoted') %}\n {%- endif -%}\n {%- endif -%}\n\n {% set compare_cols_csv = compare_columns | join(', ') %}\n\n{% else %} {# Precision required #}\n {#-\n If rounding is required, we need to get the types, so it cannot be ephemeral even if they provide column names\n -#}\n {%- do dbt_utils._is_ephemeral(model, 'test_equality') -%}\n {%- set columns = adapter.get_columns_in_relation(model) -%}\n\n {% set columns_list = [] %}\n {%- for col in columns -%}\n {%- if (\n (col.name|lower in compare_columns|map('lower') or not compare_columns) and\n (col.name|lower not in exclude_columns|map('lower') or not exclude_columns)\n ) -%}\n {# Databricks double type is not picked up by any number type checks in dbt #}\n {%- if col.is_float() or col.is_numeric() or col.data_type == 'double' -%}\n {# Cast is required due to postgres not having round for a double precision number #}\n {%- do columns_list.append('round(cast(' ~ col.quoted ~ ' as ' ~ dbt.type_numeric() ~ '),' ~ precision ~ ') as ' ~ col.quoted) -%}\n {%- else -%} {# Non-numeric type #}\n {%- do columns_list.append(col.quoted) -%}\n {%- endif -%}\n {% endif %}\n {%- endfor -%}\n\n {% set compare_cols_csv = columns_list | join(', ') %}\n\n{% endif %}\n\nwith a as (\n\n select * from {{ model }}\n\n),\n\nb as (\n\n select * from {{ compare_model }}\n\n),\n\na_minus_b as (\n\n select {{compare_cols_csv}} from a\n {{ dbt.except() }}\n select {{compare_cols_csv}} from b\n\n),\n\nb_minus_a as (\n\n select {{compare_cols_csv}} from b\n {{ dbt.except() }}\n select {{compare_cols_csv}} from a\n\n),\n\nunioned as (\n\n select 'a_minus_b' as which_diff, a_minus_b.* from a_minus_b\n union all\n select 'b_minus_a' as which_diff, b_minus_a.* from b_minus_a\n\n)\n\nselect * from unioned\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils._is_relation", "macro.dbt_utils._is_ephemeral", "macro.dbt.type_numeric", "macro.dbt.except"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "compare_model", "type": null, "description": ""}, {"name": "compare_columns", "type": null, "description": ""}, {"name": "exclude_columns", "type": null, "description": ""}, {"name": "precision", "type": null, "description": ""}], "created_at": 1789422566.7908626, "supported_languages": null}, "macro.dbt_utils.test_not_empty_string": {"name": "test_not_empty_string", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/not_empty_string.sql", "original_file_path": "macros/generic_tests/not_empty_string.sql", "unique_id": "macro.dbt_utils.test_not_empty_string", "macro_sql": "{% test not_empty_string(model, column_name, trim_whitespace=true) %}\n\n {{ return(adapter.dispatch('test_not_empty_string', 'dbt_utils')(model, column_name, trim_whitespace)) }}\n\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_not_empty_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "column_name", "type": null, "description": ""}, {"name": "trim_whitespace", "type": null, "description": ""}], "created_at": 1789422566.79184, "supported_languages": null}, "macro.dbt_utils.default__test_not_empty_string": {"name": "default__test_not_empty_string", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/not_empty_string.sql", "original_file_path": "macros/generic_tests/not_empty_string.sql", "unique_id": "macro.dbt_utils.default__test_not_empty_string", "macro_sql": "{% macro default__test_not_empty_string(model, column_name, trim_whitespace=true) %}\n\n with\n \n all_values as (\n\n select \n\n\n {% if trim_whitespace == true -%}\n\n trim({{ column_name }}) as {{ column_name }}\n\n {%- else -%}\n\n {{ column_name }}\n\n {%- endif %}\n \n from {{ model }}\n\n ),\n\n errors as (\n\n select * from all_values\n where {{ column_name }} = ''\n\n )\n\n select * from errors\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "column_name", "type": null, "description": ""}, {"name": "trim_whitespace", "type": null, "description": ""}], "created_at": 1789422566.7925186, "supported_languages": null}, "macro.dbt_utils.test_recency": {"name": "test_recency", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/recency.sql", "original_file_path": "macros/generic_tests/recency.sql", "unique_id": "macro.dbt_utils.test_recency", "macro_sql": "{% test recency(model, field, datepart, interval, ignore_time_component=False, group_by_columns = []) %}\n {{ return(adapter.dispatch('test_recency', 'dbt_utils')(model, field, datepart, interval, ignore_time_component, group_by_columns)) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_recency"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "field", "type": null, "description": ""}, {"name": "datepart", "type": null, "description": ""}, {"name": "interval", "type": null, "description": ""}, {"name": "ignore_time_component", "type": null, "description": ""}, {"name": "group_by_columns", "type": null, "description": ""}], "created_at": 1789422566.793994, "supported_languages": null}, "macro.dbt_utils.default__test_recency": {"name": "default__test_recency", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/recency.sql", "original_file_path": "macros/generic_tests/recency.sql", "unique_id": "macro.dbt_utils.default__test_recency", "macro_sql": "{% macro default__test_recency(model, field, datepart, interval, ignore_time_component, group_by_columns) %}\n\n{% set empty_invocation = flags.EMPTY is defined and flags.EMPTY %}\n\n{% set threshold = 'cast(' ~ dbt.dateadd(datepart, interval * -1, dbt.current_timestamp()) ~ ' as ' ~ ('date' if ignore_time_component else dbt.type_timestamp()) ~ ')' %}\n\n{% if group_by_columns|length() > 0 %}\n {% set select_gb_cols = group_by_columns|join(' ,') + ', ' %}\n {% set groupby_gb_cols = 'group by ' + group_by_columns|join(',') %}\n{% endif %}\n\n\nwith recency as (\n\n select \n\n {{ select_gb_cols }}\n {% if ignore_time_component %}\n cast(max({{ field }}) as date) as most_recent\n {%- else %}\n max({{ field }}) as most_recent\n {%- endif %}\n\n from {{ model }}\n\n {{ groupby_gb_cols }}\n\n)\n\nselect\n\n {{ select_gb_cols }}\n most_recent,\n {{ threshold }} as threshold\n\nfrom recency\nwhere most_recent < {{ threshold }}\n{%- if not empty_invocation %}\n or most_recent is null\n{%- endif %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.dateadd", "macro.dbt.current_timestamp", "macro.dbt.type_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "field", "type": null, "description": ""}, {"name": "datepart", "type": null, "description": ""}, {"name": "interval", "type": null, "description": ""}, {"name": "ignore_time_component", "type": null, "description": ""}, {"name": "group_by_columns", "type": null, "description": ""}], "created_at": 1789422566.7959976, "supported_languages": null}, "macro.dbt_utils.test_at_least_one": {"name": "test_at_least_one", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/at_least_one.sql", "original_file_path": "macros/generic_tests/at_least_one.sql", "unique_id": "macro.dbt_utils.test_at_least_one", "macro_sql": "{% test at_least_one(model, column_name, group_by_columns = []) %}\n {{ return(adapter.dispatch('test_at_least_one', 'dbt_utils')(model, column_name, group_by_columns)) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_at_least_one"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "column_name", "type": null, "description": ""}, {"name": "group_by_columns", "type": null, "description": ""}], "created_at": 1789422566.7969756, "supported_languages": null}, "macro.dbt_utils.default__test_at_least_one": {"name": "default__test_at_least_one", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/at_least_one.sql", "original_file_path": "macros/generic_tests/at_least_one.sql", "unique_id": "macro.dbt_utils.default__test_at_least_one", "macro_sql": "{% macro default__test_at_least_one(model, column_name, group_by_columns) %}\n\n{% set pruned_cols = [column_name] %}\n\n{% if group_by_columns|length() > 0 %}\n\n {% set select_gb_cols = group_by_columns|join(' ,') + ', ' %}\n {% set groupby_gb_cols = 'group by ' + group_by_columns|join(',') %}\n {% set pruned_cols = group_by_columns %}\n\n {% if column_name not in pruned_cols %}\n {% do pruned_cols.append(column_name) %}\n {% endif %}\n\n{% endif %}\n\n{% set select_pruned_cols = pruned_cols|join(' ,') %}\n\nselect *\nfrom (\n with pruned_rows as (\n select\n {{ select_pruned_cols }}\n from {{ model }}\n {% if group_by_columns|length() == 0 %}\n where {{ column_name }} is not null\n limit 1\n {% endif %}\n )\n select\n {# In TSQL, subquery aggregate columns need aliases #}\n {# thus: a filler col name, 'filler_column' #}\n {{select_gb_cols}}\n count({{ column_name }}) as filler_column\n\n from pruned_rows\n\n {{groupby_gb_cols}}\n\n having count({{ column_name }}) = 0\n\n) validation_errors\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "column_name", "type": null, "description": ""}, {"name": "group_by_columns", "type": null, "description": ""}], "created_at": 1789422566.7988071, "supported_languages": null}, "macro.dbt_utils.test_unique_combination_of_columns": {"name": "test_unique_combination_of_columns", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/unique_combination_of_columns.sql", "original_file_path": "macros/generic_tests/unique_combination_of_columns.sql", "unique_id": "macro.dbt_utils.test_unique_combination_of_columns", "macro_sql": "{% test unique_combination_of_columns(model, combination_of_columns, quote_columns=false) %}\n {{ return(adapter.dispatch('test_unique_combination_of_columns', 'dbt_utils')(model, combination_of_columns, quote_columns)) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_unique_combination_of_columns"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "combination_of_columns", "type": null, "description": ""}, {"name": "quote_columns", "type": null, "description": ""}], "created_at": 1789422566.7996724, "supported_languages": null}, "macro.dbt_utils.default__test_unique_combination_of_columns": {"name": "default__test_unique_combination_of_columns", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/unique_combination_of_columns.sql", "original_file_path": "macros/generic_tests/unique_combination_of_columns.sql", "unique_id": "macro.dbt_utils.default__test_unique_combination_of_columns", "macro_sql": "{% macro default__test_unique_combination_of_columns(model, combination_of_columns, quote_columns=false) %}\n\n{% if not quote_columns %}\n {%- set column_list=combination_of_columns %}\n{% elif quote_columns %}\n {%- set column_list=[] %}\n {% for column in combination_of_columns -%}\n {% do column_list.append( adapter.quote(column) ) %}\n {%- endfor %}\n{% else %}\n {{ exceptions.raise_compiler_error(\n \"`quote_columns` argument for unique_combination_of_columns test must be one of [True, False] Got: '\" ~ quote ~\"'.'\"\n ) }}\n{% endif %}\n\n{%- set columns_csv=column_list | join(', ') %}\n\n\nwith validation_errors as (\n\n select\n {{ columns_csv }}\n from {{ model }}\n group by {{ columns_csv }}\n having count(*) > 1\n\n)\n\nselect *\nfrom validation_errors\n\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "combination_of_columns", "type": null, "description": ""}, {"name": "quote_columns", "type": null, "description": ""}], "created_at": 1789422566.800962, "supported_languages": null}, "macro.dbt_utils.test_fewer_rows_than": {"name": "test_fewer_rows_than", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/fewer_rows_than.sql", "original_file_path": "macros/generic_tests/fewer_rows_than.sql", "unique_id": "macro.dbt_utils.test_fewer_rows_than", "macro_sql": "{% test fewer_rows_than(model, compare_model, group_by_columns = []) %}\n {{ return(adapter.dispatch('test_fewer_rows_than', 'dbt_utils')(model, compare_model, group_by_columns)) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_fewer_rows_than"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "compare_model", "type": null, "description": ""}, {"name": "group_by_columns", "type": null, "description": ""}], "created_at": 1789422566.8021145, "supported_languages": null}, "macro.dbt_utils.default__test_fewer_rows_than": {"name": "default__test_fewer_rows_than", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/fewer_rows_than.sql", "original_file_path": "macros/generic_tests/fewer_rows_than.sql", "unique_id": "macro.dbt_utils.default__test_fewer_rows_than", "macro_sql": "{% macro default__test_fewer_rows_than(model, compare_model, group_by_columns) %}\n\n{{ config(fail_calc = 'sum(coalesce(row_count_delta, 0))') }}\n\n{% if group_by_columns|length() > 0 %}\n {% set select_gb_cols = group_by_columns|join(' ,') + ', ' %}\n {% set join_gb_cols %}\n {% for c in group_by_columns %}\n and a.{{c}} = b.{{c}}\n {% endfor %}\n {% endset %}\n {% set groupby_gb_cols = 'group by ' + group_by_columns|join(',') %}\n{% endif %}\n\n{#-- We must add a fake join key in case additional grouping variables are not provided --#}\n{#-- Redshift does not allow for dynamically created join conditions (e.g. full join on 1 = 1 --#}\n{#-- The same logic is used in equal_rowcount. In case of changes, maintain consistent logic --#}\n{% set group_by_columns = ['id_dbtutils_test_fewer_rows_than'] + group_by_columns %}\n{% set groupby_gb_cols = 'group by ' + group_by_columns|join(',') %}\n\n\nwith a as (\n\n select \n {{select_gb_cols}}\n 1 as id_dbtutils_test_fewer_rows_than,\n count(*) as count_our_model \n from {{ model }}\n {{ groupby_gb_cols }}\n\n),\nb as (\n\n select \n {{select_gb_cols}}\n 1 as id_dbtutils_test_fewer_rows_than,\n count(*) as count_comparison_model \n from {{ compare_model }}\n {{ groupby_gb_cols }}\n\n),\ncounts as (\n\n select\n\n {% for c in group_by_columns -%}\n a.{{c}} as {{c}}_a,\n b.{{c}} as {{c}}_b,\n {% endfor %}\n\n count_our_model,\n count_comparison_model\n from a\n full join b on \n a.id_dbtutils_test_fewer_rows_than = b.id_dbtutils_test_fewer_rows_than\n {{ join_gb_cols }}\n\n),\nfinal as (\n\n select *,\n case\n -- fail the test if we have more rows than the reference model and return the row count delta\n when count_our_model > count_comparison_model then (count_our_model - count_comparison_model)\n -- fail the test if they are the same number\n when count_our_model = count_comparison_model then 1\n -- pass the test if the delta is positive (i.e. return the number 0)\n else 0\n end as row_count_delta\n from counts\n\n)\n\nselect * from final\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "compare_model", "type": null, "description": ""}, {"name": "group_by_columns", "type": null, "description": ""}], "created_at": 1789422566.8042731, "supported_languages": null}, "macro.dbt_utils.test_not_null_proportion": {"name": "test_not_null_proportion", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/not_null_proportion.sql", "original_file_path": "macros/generic_tests/not_null_proportion.sql", "unique_id": "macro.dbt_utils.test_not_null_proportion", "macro_sql": "{% macro test_not_null_proportion(model, group_by_columns = []) %}\n {{ return(adapter.dispatch('test_not_null_proportion', 'dbt_utils')(model, group_by_columns, **kwargs)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_not_null_proportion"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "group_by_columns", "type": null, "description": ""}], "created_at": 1789422566.8051627, "supported_languages": null}, "macro.dbt_utils.default__test_not_null_proportion": {"name": "default__test_not_null_proportion", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/not_null_proportion.sql", "original_file_path": "macros/generic_tests/not_null_proportion.sql", "unique_id": "macro.dbt_utils.default__test_not_null_proportion", "macro_sql": "{% macro default__test_not_null_proportion(model, group_by_columns) %}\n\n{% set column_name = kwargs.get('column_name', kwargs.get('arg')) %}\n{% set at_least = kwargs.get('at_least', kwargs.get('arg')) %}\n{% set at_most = kwargs.get('at_most', kwargs.get('arg', 1)) %}\n\n{% if group_by_columns|length() > 0 %}\n {% set select_gb_cols = group_by_columns|join(' ,') + ', ' %}\n {% set groupby_gb_cols = 'group by ' + group_by_columns|join(',') %}\n{% endif %}\n\nwith validation as (\n select\n {{select_gb_cols}}\n sum(case when {{ column_name }} is null then 0 else 1 end) / cast(count(*) as {{ dbt.type_numeric() }}) as not_null_proportion\n from {{ model }}\n {{groupby_gb_cols}}\n),\nvalidation_errors as (\n select\n {{select_gb_cols}}\n not_null_proportion\n from validation\n where not_null_proportion < {{ at_least }} or not_null_proportion > {{ at_most }}\n)\nselect\n *\nfrom validation_errors\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.type_numeric"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "group_by_columns", "type": null, "description": ""}], "created_at": 1789422566.8068588, "supported_languages": null}, "macro.dbt_utils.test_equal_rowcount": {"name": "test_equal_rowcount", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/equal_rowcount.sql", "original_file_path": "macros/generic_tests/equal_rowcount.sql", "unique_id": "macro.dbt_utils.test_equal_rowcount", "macro_sql": "{% test equal_rowcount(model, compare_model, group_by_columns = []) %}\n {{ return(adapter.dispatch('test_equal_rowcount', 'dbt_utils')(model, compare_model, group_by_columns)) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_equal_rowcount"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "compare_model", "type": null, "description": ""}, {"name": "group_by_columns", "type": null, "description": ""}], "created_at": 1789422566.807982, "supported_languages": null}, "macro.dbt_utils.default__test_equal_rowcount": {"name": "default__test_equal_rowcount", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/equal_rowcount.sql", "original_file_path": "macros/generic_tests/equal_rowcount.sql", "unique_id": "macro.dbt_utils.default__test_equal_rowcount", "macro_sql": "{% macro default__test_equal_rowcount(model, compare_model, group_by_columns) %}\n\n{#-- Needs to be set at parse time, before we return '' below --#}\n{{ config(fail_calc = 'sum(coalesce(diff_count, 0))') }}\n\n{#-- Prevent querying of db in parsing mode. This works because this macro does not create any new refs. #}\n{%- if not execute -%}\n {{ return('') }}\n{% endif %}\n\n{% if group_by_columns|length() > 0 %}\n {% set select_gb_cols = group_by_columns|join(', ') + ', ' %}\n {% set join_gb_cols %}\n {% for c in group_by_columns %}\n and a.{{c}} = b.{{c}}\n {% endfor %}\n {% endset %}\n {% set groupby_gb_cols = 'group by ' + group_by_columns|join(',') %}\n{% endif %}\n\n{#-- We must add a fake join key in case additional grouping variables are not provided --#}\n{#-- Redshift does not allow for dynamically created join conditions (e.g. full join on 1 = 1 --#}\n{#-- The same logic is used in fewer_rows_than. In case of changes, maintain consistent logic --#}\n{% set group_by_columns = ['id_dbtutils_test_equal_rowcount'] + group_by_columns %}\n{% set groupby_gb_cols = 'group by ' + group_by_columns|join(',') %}\n\nwith a as (\n\n select \n {{select_gb_cols}}\n 1 as id_dbtutils_test_equal_rowcount,\n count(*) as count_a \n from {{ model }}\n {{groupby_gb_cols}}\n\n\n),\nb as (\n\n select \n {{select_gb_cols}}\n 1 as id_dbtutils_test_equal_rowcount,\n count(*) as count_b \n from {{ compare_model }}\n {{groupby_gb_cols}}\n\n),\nfinal as (\n\n select\n \n {% for c in group_by_columns -%}\n a.{{c}} as {{c}}_a,\n b.{{c}} as {{c}}_b,\n {% endfor %}\n\n count_a,\n count_b,\n abs(count_a - count_b) as diff_count\n\n from a\n full join b\n on\n a.id_dbtutils_test_equal_rowcount = b.id_dbtutils_test_equal_rowcount\n {{join_gb_cols}}\n\n\n)\n\nselect * from final\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "compare_model", "type": null, "description": ""}, {"name": "group_by_columns", "type": null, "description": ""}], "created_at": 1789422566.8101482, "supported_languages": null}, "macro.dbt_utils.test_sequential_values": {"name": "test_sequential_values", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/sequential_values.sql", "original_file_path": "macros/generic_tests/sequential_values.sql", "unique_id": "macro.dbt_utils.test_sequential_values", "macro_sql": "{% test sequential_values(model, column_name, interval=1, datepart=None, group_by_columns = []) %}\n\n {{ return(adapter.dispatch('test_sequential_values', 'dbt_utils')(model, column_name, interval, datepart, group_by_columns)) }}\n\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_sequential_values"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "column_name", "type": null, "description": ""}, {"name": "interval", "type": null, "description": ""}, {"name": "datepart", "type": null, "description": ""}, {"name": "group_by_columns", "type": null, "description": ""}], "created_at": 1789422566.811216, "supported_languages": null}, "macro.dbt_utils.default__test_sequential_values": {"name": "default__test_sequential_values", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/sequential_values.sql", "original_file_path": "macros/generic_tests/sequential_values.sql", "unique_id": "macro.dbt_utils.default__test_sequential_values", "macro_sql": "{% macro default__test_sequential_values(model, column_name, interval=1, datepart=None, group_by_columns = []) %}\n\n{% set previous_column_name = \"previous_\" ~ dbt_utils.slugify(column_name) %}\n\n{% if group_by_columns|length() > 0 %}\n {% set select_gb_cols = group_by_columns|join(',') + ', ' %}\n {% set partition_gb_cols = 'partition by ' + group_by_columns|join(',') %}\n{% endif %}\n\nwith windowed as (\n\n select\n {{ select_gb_cols }}\n {{ column_name }},\n lag({{ column_name }}) over (\n {{partition_gb_cols}}\n order by {{ column_name }}\n ) as {{ previous_column_name }}\n from {{ model }}\n),\n\nvalidation_errors as (\n select\n *\n from windowed\n {% if datepart %}\n where not(cast({{ column_name }} as {{ dbt.type_timestamp() }})= cast({{ dbt.dateadd(datepart, interval, previous_column_name) }} as {{ dbt.type_timestamp() }}))\n {% else %}\n where not({{ column_name }} = {{ previous_column_name }} + {{ interval }})\n {% endif %}\n)\n\nselect *\nfrom validation_errors\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.slugify", "macro.dbt.type_timestamp", "macro.dbt.dateadd"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "column_name", "type": null, "description": ""}, {"name": "interval", "type": null, "description": ""}, {"name": "datepart", "type": null, "description": ""}, {"name": "group_by_columns", "type": null, "description": ""}], "created_at": 1789422566.8130665, "supported_languages": null}, "macro.dbt_utils.test_mutually_exclusive_ranges": {"name": "test_mutually_exclusive_ranges", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/mutually_exclusive_ranges.sql", "original_file_path": "macros/generic_tests/mutually_exclusive_ranges.sql", "unique_id": "macro.dbt_utils.test_mutually_exclusive_ranges", "macro_sql": "{% test mutually_exclusive_ranges(model, lower_bound_column, upper_bound_column, partition_by=None, gaps='allowed', zero_length_range_allowed=False) %}\n {{ return(adapter.dispatch('test_mutually_exclusive_ranges', 'dbt_utils')(model, lower_bound_column, upper_bound_column, partition_by, gaps, zero_length_range_allowed)) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_mutually_exclusive_ranges"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "lower_bound_column", "type": null, "description": ""}, {"name": "upper_bound_column", "type": null, "description": ""}, {"name": "partition_by", "type": null, "description": ""}, {"name": "gaps", "type": null, "description": ""}, {"name": "zero_length_range_allowed", "type": null, "description": ""}], "created_at": 1789422566.8146474, "supported_languages": null}, "macro.dbt_utils.default__test_mutually_exclusive_ranges": {"name": "default__test_mutually_exclusive_ranges", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/mutually_exclusive_ranges.sql", "original_file_path": "macros/generic_tests/mutually_exclusive_ranges.sql", "unique_id": "macro.dbt_utils.default__test_mutually_exclusive_ranges", "macro_sql": "{% macro default__test_mutually_exclusive_ranges(model, lower_bound_column, upper_bound_column, partition_by=None, gaps='allowed', zero_length_range_allowed=False) %}\n{% if gaps == 'not_allowed' %}\n {% set allow_gaps_operator='=' %}\n {% set allow_gaps_operator_in_words='equal_to' %}\n{% elif gaps == 'allowed' %}\n {% set allow_gaps_operator='<=' %}\n {% set allow_gaps_operator_in_words='less_than_or_equal_to' %}\n{% elif gaps == 'required' %}\n {% set allow_gaps_operator='<' %}\n {% set allow_gaps_operator_in_words='less_than' %}\n{% else %}\n {{ exceptions.raise_compiler_error(\n \"`gaps` argument for mutually_exclusive_ranges test must be one of ['not_allowed', 'allowed', 'required'] Got: '\" ~ gaps ~\"'.'\"\n ) }}\n{% endif %}\n{% if not zero_length_range_allowed %}\n {% set allow_zero_length_operator='<' %}\n {% set allow_zero_length_operator_in_words='less_than' %}\n{% elif zero_length_range_allowed %}\n {% set allow_zero_length_operator='<=' %}\n {% set allow_zero_length_operator_in_words='less_than_or_equal_to' %}\n{% else %}\n {{ exceptions.raise_compiler_error(\n \"`zero_length_range_allowed` argument for mutually_exclusive_ranges test must be one of [true, false] Got: '\" ~ zero_length_range_allowed ~\"'.'\"\n ) }}\n{% endif %}\n\n{% set partition_clause=\"partition by \" ~ partition_by if partition_by else '' %}\n\nwith window_functions as (\n\n select\n {% if partition_by %}\n {{ partition_by }} as partition_by_col,\n {% endif %}\n {{ lower_bound_column }} as lower_bound,\n {{ upper_bound_column }} as upper_bound,\n\n lead({{ lower_bound_column }}) over (\n {{ partition_clause }}\n order by {{ lower_bound_column }}, {{ upper_bound_column }}\n ) as next_lower_bound,\n\n row_number() over (\n {{ partition_clause }}\n order by {{ lower_bound_column }} desc, {{ upper_bound_column }} desc\n ) = 1 as is_last_record\n\n from {{ model }}\n\n),\n\ncalc as (\n -- We want to return records where one of our assumptions fails, so we'll use\n -- the `not` function with `and` statements so we can write our assumptions more cleanly\n select\n *,\n\n -- For each record: lower_bound should be < upper_bound.\n -- Coalesce it to return an error on the null case (implicit assumption\n -- these columns are not_null)\n coalesce(\n lower_bound {{ allow_zero_length_operator }} upper_bound,\n false\n ) as lower_bound_{{ allow_zero_length_operator_in_words }}_upper_bound,\n\n -- For each record: upper_bound {{ allow_gaps_operator }} the next lower_bound.\n -- Coalesce it to handle null cases for the last record.\n coalesce(\n upper_bound {{ allow_gaps_operator }} next_lower_bound,\n is_last_record,\n false\n ) as upper_bound_{{ allow_gaps_operator_in_words }}_next_lower_bound\n\n from window_functions\n\n),\n\nvalidation_errors as (\n\n select\n *\n from calc\n\n where not(\n -- THE FOLLOWING SHOULD BE TRUE --\n lower_bound_{{ allow_zero_length_operator_in_words }}_upper_bound\n and upper_bound_{{ allow_gaps_operator_in_words }}_next_lower_bound\n )\n)\n\nselect * from validation_errors\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "lower_bound_column", "type": null, "description": ""}, {"name": "upper_bound_column", "type": null, "description": ""}, {"name": "partition_by", "type": null, "description": ""}, {"name": "gaps", "type": null, "description": ""}, {"name": "zero_length_range_allowed", "type": null, "description": ""}], "created_at": 1789422566.818652, "supported_languages": null}, "macro.dbt_utils.test_cardinality_equality": {"name": "test_cardinality_equality", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/cardinality_equality.sql", "original_file_path": "macros/generic_tests/cardinality_equality.sql", "unique_id": "macro.dbt_utils.test_cardinality_equality", "macro_sql": "{% test cardinality_equality(model, column_name, to, field) %}\n {{ return(adapter.dispatch('test_cardinality_equality', 'dbt_utils')(model, column_name, to, field)) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_cardinality_equality"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "column_name", "type": null, "description": ""}, {"name": "to", "type": null, "description": ""}, {"name": "field", "type": null, "description": ""}], "created_at": 1789422566.81954, "supported_languages": null}, "macro.dbt_utils.default__test_cardinality_equality": {"name": "default__test_cardinality_equality", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/cardinality_equality.sql", "original_file_path": "macros/generic_tests/cardinality_equality.sql", "unique_id": "macro.dbt_utils.default__test_cardinality_equality", "macro_sql": "{% macro default__test_cardinality_equality(model, column_name, to, field) %}\n\n{# T-SQL does not let you use numbers as aliases for columns #}\n{# Thus, no \"GROUP BY 1\" #}\n\nwith table_a as (\nselect\n {{ column_name }},\n count(*) as num_rows\nfrom {{ model }}\ngroup by {{ column_name }}\n),\n\ntable_b as (\nselect\n {{ field }},\n count(*) as num_rows\nfrom {{ to }}\ngroup by {{ field }}\n),\n\nexcept_a as (\n select *\n from table_a\n {{ dbt.except() }}\n select *\n from table_b\n),\n\nexcept_b as (\n select *\n from table_b\n {{ dbt.except() }}\n select *\n from table_a\n),\n\nunioned as (\n select *\n from except_a\n union all\n select *\n from except_b\n)\n\nselect *\nfrom unioned\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.except"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "column_name", "type": null, "description": ""}, {"name": "to", "type": null, "description": ""}, {"name": "field", "type": null, "description": ""}], "created_at": 1789422566.82028, "supported_languages": null}, "macro.dbt_utils.test_relationships_where": {"name": "test_relationships_where", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/relationships_where.sql", "original_file_path": "macros/generic_tests/relationships_where.sql", "unique_id": "macro.dbt_utils.test_relationships_where", "macro_sql": "{% test relationships_where(model, column_name, to, field, from_condition=\"1=1\", to_condition=\"1=1\") %}\n {{ return(adapter.dispatch('test_relationships_where', 'dbt_utils')(model, column_name, to, field, from_condition, to_condition)) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_relationships_where"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "column_name", "type": null, "description": ""}, {"name": "to", "type": null, "description": ""}, {"name": "field", "type": null, "description": ""}, {"name": "from_condition", "type": null, "description": ""}, {"name": "to_condition", "type": null, "description": ""}], "created_at": 1789422566.8212712, "supported_languages": null}, "macro.dbt_utils.default__test_relationships_where": {"name": "default__test_relationships_where", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/relationships_where.sql", "original_file_path": "macros/generic_tests/relationships_where.sql", "unique_id": "macro.dbt_utils.default__test_relationships_where", "macro_sql": "{% macro default__test_relationships_where(model, column_name, to, field, from_condition=\"1=1\", to_condition=\"1=1\") %}\n\n{# T-SQL has no boolean data type so we use 1=1 which returns TRUE #}\n{# ref https://stackoverflow.com/a/7170753/3842610 #}\n\nwith left_table as (\n\n select\n {{column_name}} as id\n\n from {{model}}\n\n where {{column_name}} is not null\n and {{from_condition}}\n\n),\n\nright_table as (\n\n select\n {{field}} as id\n\n from {{to}}\n\n where {{field}} is not null\n and {{to_condition}}\n\n),\n\nexceptions as (\n\n select\n left_table.id,\n right_table.id as right_id\n\n from left_table\n\n left join right_table\n on left_table.id = right_table.id\n\n where right_table.id is null\n\n)\n\nselect * from exceptions\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "column_name", "type": null, "description": ""}, {"name": "to", "type": null, "description": ""}, {"name": "field", "type": null, "description": ""}, {"name": "from_condition", "type": null, "description": ""}, {"name": "to_condition", "type": null, "description": ""}], "created_at": 1789422566.8220117, "supported_languages": null}, "macro.dbt_utils.test_expression_is_true": {"name": "test_expression_is_true", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/expression_is_true.sql", "original_file_path": "macros/generic_tests/expression_is_true.sql", "unique_id": "macro.dbt_utils.test_expression_is_true", "macro_sql": "{% test expression_is_true(model, expression, column_name=None) %}\n {{ return(adapter.dispatch('test_expression_is_true', 'dbt_utils')(model, expression, column_name)) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_expression_is_true"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "expression", "type": null, "description": ""}, {"name": "column_name", "type": null, "description": ""}], "created_at": 1789422566.822794, "supported_languages": null}, "macro.dbt_utils.default__test_expression_is_true": {"name": "default__test_expression_is_true", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/expression_is_true.sql", "original_file_path": "macros/generic_tests/expression_is_true.sql", "unique_id": "macro.dbt_utils.default__test_expression_is_true", "macro_sql": "{% macro default__test_expression_is_true(model, expression, column_name) %}\n\n{% set column_list = '*' if should_store_failures() else \"1\" %}\n\nselect\n {{ column_list }}\nfrom {{ model }}\n{% if column_name is none %}\nwhere not({{ expression }})\n{%- else %}\nwhere not({{ column_name }} {{ expression }})\n{%- endif %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.should_store_failures"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "expression", "type": null, "description": ""}, {"name": "column_name", "type": null, "description": ""}], "created_at": 1789422566.823576, "supported_languages": null}, "macro.dbt_utils.test_not_accepted_values": {"name": "test_not_accepted_values", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/not_accepted_values.sql", "original_file_path": "macros/generic_tests/not_accepted_values.sql", "unique_id": "macro.dbt_utils.test_not_accepted_values", "macro_sql": "{% test not_accepted_values(model, column_name, values, quote=True) %}\n {{ return(adapter.dispatch('test_not_accepted_values', 'dbt_utils')(model, column_name, values, quote)) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_not_accepted_values"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "column_name", "type": null, "description": ""}, {"name": "values", "type": null, "description": ""}, {"name": "quote", "type": null, "description": ""}], "created_at": 1789422566.8244045, "supported_languages": null}, "macro.dbt_utils.default__test_not_accepted_values": {"name": "default__test_not_accepted_values", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/not_accepted_values.sql", "original_file_path": "macros/generic_tests/not_accepted_values.sql", "unique_id": "macro.dbt_utils.default__test_not_accepted_values", "macro_sql": "{% macro default__test_not_accepted_values(model, column_name, values, quote=True) %}\nwith all_values as (\n\n select distinct\n {{ column_name }} as value_field\n\n from {{ model }}\n\n),\n\nvalidation_errors as (\n\n select\n value_field\n\n from all_values\n where value_field in (\n {% for value in values -%}\n {% if quote -%}\n '{{ value }}'\n {%- else -%}\n {{ value }}\n {%- endif -%}\n {%- if not loop.last -%},{%- endif %}\n {%- endfor %}\n )\n\n)\n\nselect *\nfrom validation_errors\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "column_name", "type": null, "description": ""}, {"name": "values", "type": null, "description": ""}, {"name": "quote", "type": null, "description": ""}], "created_at": 1789422566.8252313, "supported_languages": null}, "macro.dbt_utils.test_accepted_range": {"name": "test_accepted_range", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/accepted_range.sql", "original_file_path": "macros/generic_tests/accepted_range.sql", "unique_id": "macro.dbt_utils.test_accepted_range", "macro_sql": "{% test accepted_range(model, column_name, min_value=none, max_value=none, inclusive=true) %}\n {{ return(adapter.dispatch('test_accepted_range', 'dbt_utils')(model, column_name, min_value, max_value, inclusive)) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_accepted_range"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "column_name", "type": null, "description": ""}, {"name": "min_value", "type": null, "description": ""}, {"name": "max_value", "type": null, "description": ""}, {"name": "inclusive", "type": null, "description": ""}], "created_at": 1789422566.8261817, "supported_languages": null}, "macro.dbt_utils.default__test_accepted_range": {"name": "default__test_accepted_range", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/accepted_range.sql", "original_file_path": "macros/generic_tests/accepted_range.sql", "unique_id": "macro.dbt_utils.default__test_accepted_range", "macro_sql": "{% macro default__test_accepted_range(model, column_name, min_value=none, max_value=none, inclusive=true) %}\n\nwith meet_condition as(\n select *\n from {{ model }}\n),\n\nvalidation_errors as (\n select *\n from meet_condition\n where\n -- never true, defaults to an empty result set. Exists to ensure any combo of the `or` clauses below succeeds\n 1 = 2\n\n {%- if min_value is not none %}\n -- records with a value >= min_value are permitted. The `not` flips this to find records that don't meet the rule.\n or not {{ column_name }} > {{- \"=\" if inclusive }} {{ min_value }}\n {%- endif %}\n\n {%- if max_value is not none %}\n -- records with a value <= max_value are permitted. The `not` flips this to find records that don't meet the rule.\n or not {{ column_name }} < {{- \"=\" if inclusive }} {{ max_value }}\n {%- endif %}\n)\n\nselect *\nfrom validation_errors\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "column_name", "type": null, "description": ""}, {"name": "min_value", "type": null, "description": ""}, {"name": "max_value", "type": null, "description": ""}, {"name": "inclusive", "type": null, "description": ""}], "created_at": 1789422566.8271964, "supported_languages": null}, "macro.dbt_utils.get_url_parameter": {"name": "get_url_parameter", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/web/get_url_parameter.sql", "original_file_path": "macros/web/get_url_parameter.sql", "unique_id": "macro.dbt_utils.get_url_parameter", "macro_sql": "{% macro get_url_parameter(field, url_parameter) -%}\n {{ return(adapter.dispatch('get_url_parameter', 'dbt_utils')(field, url_parameter)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__get_url_parameter"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field", "type": null, "description": ""}, {"name": "url_parameter", "type": null, "description": ""}], "created_at": 1789422566.8278525, "supported_languages": null}, "macro.dbt_utils.default__get_url_parameter": {"name": "default__get_url_parameter", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/web/get_url_parameter.sql", "original_file_path": "macros/web/get_url_parameter.sql", "unique_id": "macro.dbt_utils.default__get_url_parameter", "macro_sql": "{% macro default__get_url_parameter(field, url_parameter) -%}\n\n{%- set formatted_url_parameter = \"'\" + url_parameter + \"='\" -%}\n\n{%- set split = dbt.split_part(dbt.split_part(field, formatted_url_parameter, 2), \"'&'\", 1) -%}\n\nnullif({{ split }},'')\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.split_part"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field", "type": null, "description": ""}, {"name": "url_parameter", "type": null, "description": ""}], "created_at": 1789422566.8285804, "supported_languages": null}, "macro.dbt_utils.get_url_host": {"name": "get_url_host", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/web/get_url_host.sql", "original_file_path": "macros/web/get_url_host.sql", "unique_id": "macro.dbt_utils.get_url_host", "macro_sql": "{% macro get_url_host(field) -%}\n {{ return(adapter.dispatch('get_url_host', 'dbt_utils')(field)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__get_url_host"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field", "type": null, "description": ""}], "created_at": 1789422566.829212, "supported_languages": null}, "macro.dbt_utils.default__get_url_host": {"name": "default__get_url_host", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/web/get_url_host.sql", "original_file_path": "macros/web/get_url_host.sql", "unique_id": "macro.dbt_utils.default__get_url_host", "macro_sql": "{% macro default__get_url_host(field) -%}\n\n{%- set parsed =\n dbt.split_part(\n dbt.split_part(\n dbt.replace(\n dbt.replace(\n dbt.replace(field, \"'android-app://'\", \"''\"\n ), \"'http://'\", \"''\"\n ), \"'https://'\", \"''\"\n ), \"'/'\", 1\n ), \"'?'\", 1\n )\n\n-%}\n\n\n {{ dbt.safe_cast(\n parsed,\n dbt.type_string()\n )}}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.split_part", "macro.dbt.replace", "macro.dbt.safe_cast", "macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field", "type": null, "description": ""}], "created_at": 1789422566.8303456, "supported_languages": null}, "macro.dbt_utils.get_url_path": {"name": "get_url_path", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/web/get_url_path.sql", "original_file_path": "macros/web/get_url_path.sql", "unique_id": "macro.dbt_utils.get_url_path", "macro_sql": "{% macro get_url_path(field) -%}\n {{ return(adapter.dispatch('get_url_path', 'dbt_utils')(field)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__get_url_path"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field", "type": null, "description": ""}], "created_at": 1789422566.831044, "supported_languages": null}, "macro.dbt_utils.default__get_url_path": {"name": "default__get_url_path", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/web/get_url_path.sql", "original_file_path": "macros/web/get_url_path.sql", "unique_id": "macro.dbt_utils.default__get_url_path", "macro_sql": "{% macro default__get_url_path(field) -%}\n\n {%- set stripped_url =\n dbt.replace(\n dbt.replace(field, \"'http://'\", \"''\"), \"'https://'\", \"''\")\n -%}\n\n {%- set first_slash_pos -%}\n coalesce(\n nullif({{ dbt.position(\"'/'\", stripped_url) }}, 0),\n {{ dbt.position(\"'?'\", stripped_url) }} - 1\n )\n {%- endset -%}\n\n {%- set parsed_path =\n dbt.split_part(\n dbt.right(\n stripped_url,\n dbt.length(stripped_url) ~ \"-\" ~ first_slash_pos\n ),\n \"'?'\", 1\n )\n -%}\n\n {{ dbt.safe_cast(\n parsed_path,\n dbt.type_string()\n )}}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.replace", "macro.dbt.position", "macro.dbt.split_part", "macro.dbt.right", "macro.dbt.length", "macro.dbt.safe_cast", "macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field", "type": null, "description": ""}], "created_at": 1789422566.8323634, "supported_languages": null}, "macro.dbt_utils.get_column_values": {"name": "get_column_values", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_column_values.sql", "original_file_path": "macros/sql/get_column_values.sql", "unique_id": "macro.dbt_utils.get_column_values", "macro_sql": "{% macro get_column_values(table, column, order_by='count(*) desc', max_records=none, default=none, where=none) -%}\n {{ return(adapter.dispatch('get_column_values', 'dbt_utils')(table, column, order_by, max_records, default, where)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__get_column_values"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "table", "type": null, "description": ""}, {"name": "column", "type": null, "description": ""}, {"name": "order_by", "type": null, "description": ""}, {"name": "max_records", "type": null, "description": ""}, {"name": "default", "type": null, "description": ""}, {"name": "where", "type": null, "description": ""}], "created_at": 1789422566.8337777, "supported_languages": null}, "macro.dbt_utils.default__get_column_values": {"name": "default__get_column_values", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_column_values.sql", "original_file_path": "macros/sql/get_column_values.sql", "unique_id": "macro.dbt_utils.default__get_column_values", "macro_sql": "{% macro default__get_column_values(table, column, order_by='count(*) desc', max_records=none, default=none, where=none) -%}\n {#-- Prevent querying of db in parsing mode. This works because this macro does not create any new refs. #}\n {%- if not execute -%}\n {% set default = [] if not default %}\n {{ return(default) }}\n {% endif %}\n\n {%- do dbt_utils._is_ephemeral(table, 'get_column_values') -%}\n\n {# Not all relations are tables. Renaming for internal clarity without breaking functionality for anyone using named arguments #}\n {# TODO: Change the method signature in a future 0.x.0 release #}\n {%- set target_relation = table -%}\n\n {# adapter.load_relation is a convenience wrapper to avoid building a Relation when we already have one #}\n {% set relation_exists = (load_relation(target_relation)) is not none %}\n\n {%- call statement('get_column_values', fetch_result=true) %}\n\n {%- if not relation_exists and default is none -%}\n\n {{ exceptions.raise_compiler_error(\"In get_column_values(): relation \" ~ target_relation ~ \" does not exist and no default value was provided.\") }}\n\n {%- elif not relation_exists and default is not none -%}\n\n {{ log(\"Relation \" ~ target_relation ~ \" does not exist. Returning the default value: \" ~ default) }}\n\n {{ return(default) }}\n\n {%- else -%}\n\n\n select\n {{ column }} as value\n\n from {{ target_relation }}\n\n {% if where is not none %}\n where {{ where }}\n {% endif %}\n\n group by {{ column }}\n order by {{ order_by }}\n\n {% if max_records is not none %}\n limit {{ max_records }}\n {% endif %}\n\n {% endif %}\n\n {%- endcall -%}\n\n {%- set value_list = load_result('get_column_values') -%}\n\n {%- if value_list and value_list['data'] -%}\n {%- set values = value_list['data'] | map(attribute=0) | list %}\n {{ return(values) }}\n {%- else -%}\n {{ return(default) }}\n {%- endif -%}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_utils._is_ephemeral", "macro.dbt.load_relation", "macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "table", "type": null, "description": ""}, {"name": "column", "type": null, "description": ""}, {"name": "order_by", "type": null, "description": ""}, {"name": "max_records", "type": null, "description": ""}, {"name": "default", "type": null, "description": ""}, {"name": "where", "type": null, "description": ""}], "created_at": 1789422566.8368983, "supported_languages": null}, "macro.dbt_utils.star": {"name": "star", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/star.sql", "original_file_path": "macros/sql/star.sql", "unique_id": "macro.dbt_utils.star", "macro_sql": "{% macro star(from, relation_alias=False, except=[], prefix='', suffix='', quote_identifiers=True, unquote_aliases=False, rename={}) -%}\r\n {{ return(adapter.dispatch('star', 'dbt_utils')(from, relation_alias, except, prefix, suffix, quote_identifiers, unquote_aliases, rename)) }}\r\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__star"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "from", "type": null, "description": ""}, {"name": "relation_alias", "type": null, "description": ""}, {"name": "except", "type": null, "description": ""}, {"name": "prefix", "type": null, "description": ""}, {"name": "suffix", "type": null, "description": ""}, {"name": "quote_identifiers", "type": null, "description": ""}, {"name": "unquote_aliases", "type": null, "description": ""}, {"name": "rename", "type": null, "description": ""}], "created_at": 1789422566.8386836, "supported_languages": null}, "macro.dbt_utils.default__star": {"name": "default__star", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/star.sql", "original_file_path": "macros/sql/star.sql", "unique_id": "macro.dbt_utils.default__star", "macro_sql": "{% macro default__star(from, relation_alias=False, except=[], prefix='', suffix='', quote_identifiers=True, unquote_aliases=False, rename={}) -%}\r\n {%- do dbt_utils._is_relation(from, 'star') -%}\r\n {%- do dbt_utils._is_ephemeral(from, 'star') -%}\r\n\r\n {#-- Prevent querying of db in parsing mode. This works because this macro does not create any new refs. #}\r\n {%- if not execute -%}\r\n {% do return('*') %}\r\n {%- endif -%}\r\n\r\n {% set cols = dbt_utils.get_filtered_columns_in_relation(from, except) %}\r\n\r\n {%- set rename_lower = {} -%}\r\n {%- for key, val in rename.items() -%}\r\n {%- do rename_lower.update({key.lower(): val}) -%}\r\n {%- endfor -%}\r\n\r\n {%- if cols|length <= 0 -%}\r\n {% if flags.WHICH == 'compile' %}\r\n {% set response %}\r\n*\r\n/* No columns were returned. Maybe the relation doesn't exist yet\r\nor all columns were excluded. This star is only output during\r\ndbt compile, and exists to keep SQLFluff happy. */\r\n {% endset %}\r\n {% do return(response) %}\r\n {% else %}\r\n {% do return(\"/* no columns returned from star() macro */\") %}\r\n {% endif %}\r\n {%- else -%}\r\n {%- for col in cols %}\r\n {%- if relation_alias %}{{ relation_alias }}.{% else %}{%- endif -%}\r\n {%- if quote_identifiers -%}\r\n {{ adapter.quote(col)|trim }}\r\n {%- if col.lower() in rename_lower %} as {{ rename_lower[col.lower()] }}\r\n {%- elif unquote_aliases %} as {{ (prefix ~ col ~ suffix)|trim }}\r\n {%- elif prefix!='' or suffix!='' %} as {{ adapter.quote(prefix ~ col ~ suffix)|trim }}\r\n {%- endif -%}\r\n {%- else -%}\r\n {{ col|trim }}\r\n {%- if col.lower() in rename_lower %} as {{ rename_lower[col.lower()] }}\r\n {%- elif prefix!='' or suffix!='' %} as {{ (prefix ~ col ~ suffix)|trim }}\r\n {%- endif -%}\r\n {%- endif -%}\r\n {%- if not loop.last %},{{ '\\n ' }}{%- endif -%}\r\n {%- endfor -%}\r\n {% endif %}\r\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_utils._is_relation", "macro.dbt_utils._is_ephemeral", "macro.dbt_utils.get_filtered_columns_in_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "from", "type": null, "description": ""}, {"name": "relation_alias", "type": null, "description": ""}, {"name": "except", "type": null, "description": ""}, {"name": "prefix", "type": null, "description": ""}, {"name": "suffix", "type": null, "description": ""}, {"name": "quote_identifiers", "type": null, "description": ""}, {"name": "unquote_aliases", "type": null, "description": ""}, {"name": "rename", "type": null, "description": ""}], "created_at": 1789422566.8429065, "supported_languages": null}, "macro.dbt_utils.get_table_types_sql": {"name": "get_table_types_sql", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_table_types_sql.sql", "original_file_path": "macros/sql/get_table_types_sql.sql", "unique_id": "macro.dbt_utils.get_table_types_sql", "macro_sql": "{%- macro get_table_types_sql() -%}\n {{ return(adapter.dispatch('get_table_types_sql', 'dbt_utils')()) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt_utils.postgres__get_table_types_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789422566.8436716, "supported_languages": null}, "macro.dbt_utils.default__get_table_types_sql": {"name": "default__get_table_types_sql", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_table_types_sql.sql", "original_file_path": "macros/sql/get_table_types_sql.sql", "unique_id": "macro.dbt_utils.default__get_table_types_sql", "macro_sql": "{% macro default__get_table_types_sql() %}\n case table_type\n when 'BASE TABLE' then 'table'\n when 'EXTERNAL TABLE' then 'external'\n when 'MATERIALIZED VIEW' then 'materializedview'\n else lower(table_type)\n end as {{ adapter.quote('table_type') }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789422566.8439841, "supported_languages": null}, "macro.dbt_utils.postgres__get_table_types_sql": {"name": "postgres__get_table_types_sql", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_table_types_sql.sql", "original_file_path": "macros/sql/get_table_types_sql.sql", "unique_id": "macro.dbt_utils.postgres__get_table_types_sql", "macro_sql": "{% macro postgres__get_table_types_sql() %}\n case table_type\n when 'BASE TABLE' then 'table'\n when 'FOREIGN' then 'external'\n when 'MATERIALIZED VIEW' then 'materializedview'\n else lower(table_type)\n end as {{ adapter.quote('table_type') }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789422566.8442814, "supported_languages": null}, "macro.dbt_utils.databricks__get_table_types_sql": {"name": "databricks__get_table_types_sql", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_table_types_sql.sql", "original_file_path": "macros/sql/get_table_types_sql.sql", "unique_id": "macro.dbt_utils.databricks__get_table_types_sql", "macro_sql": "{% macro databricks__get_table_types_sql() %}\n case table_type\n when 'MANAGED' then 'table'\n when 'BASE TABLE' then 'table'\n when 'MATERIALIZED VIEW' then 'materializedview'\n else lower(table_type)\n end as {{ adapter.quote('table_type') }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789422566.8445983, "supported_languages": null}, "macro.dbt_utils.get_tables_by_pattern_sql": {"name": "get_tables_by_pattern_sql", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_tables_by_pattern_sql.sql", "original_file_path": "macros/sql/get_tables_by_pattern_sql.sql", "unique_id": "macro.dbt_utils.get_tables_by_pattern_sql", "macro_sql": "{% macro get_tables_by_pattern_sql(schema_pattern, table_pattern, exclude='', database=target.database) %}\n {{ return(adapter.dispatch('get_tables_by_pattern_sql', 'dbt_utils')\n (schema_pattern, table_pattern, exclude, database)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__get_tables_by_pattern_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "schema_pattern", "type": null, "description": ""}, {"name": "table_pattern", "type": null, "description": ""}, {"name": "exclude", "type": null, "description": ""}, {"name": "database", "type": null, "description": ""}], "created_at": 1789422566.8461683, "supported_languages": null}, "macro.dbt_utils.default__get_tables_by_pattern_sql": {"name": "default__get_tables_by_pattern_sql", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_tables_by_pattern_sql.sql", "original_file_path": "macros/sql/get_tables_by_pattern_sql.sql", "unique_id": "macro.dbt_utils.default__get_tables_by_pattern_sql", "macro_sql": "{% macro default__get_tables_by_pattern_sql(schema_pattern, table_pattern, exclude='', database=target.database) %}\n\n select distinct\n table_schema as {{ adapter.quote('table_schema') }},\n table_name as {{ adapter.quote('table_name') }},\n {{ dbt_utils.get_table_types_sql() }}\n from {{ database }}.information_schema.tables\n where table_schema ilike '{{ schema_pattern }}'\n and table_name ilike '{{ table_pattern }}'\n and table_name not ilike '{{ exclude }}'\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.get_table_types_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "schema_pattern", "type": null, "description": ""}, {"name": "table_pattern", "type": null, "description": ""}, {"name": "exclude", "type": null, "description": ""}, {"name": "database", "type": null, "description": ""}], "created_at": 1789422566.8470151, "supported_languages": null}, "macro.dbt_utils.redshift__get_tables_by_pattern_sql": {"name": "redshift__get_tables_by_pattern_sql", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_tables_by_pattern_sql.sql", "original_file_path": "macros/sql/get_tables_by_pattern_sql.sql", "unique_id": "macro.dbt_utils.redshift__get_tables_by_pattern_sql", "macro_sql": "{% macro redshift__get_tables_by_pattern_sql(schema_pattern, table_pattern, exclude='', database=target.database) %}\n\n {% set sql %}\n select distinct\n table_schema as {{ adapter.quote('table_schema') }},\n table_name as {{ adapter.quote('table_name') }},\n {{ dbt_utils.get_table_types_sql() }}\n from \"{{ database }}\".\"information_schema\".\"tables\"\n where table_schema ilike '{{ schema_pattern }}'\n and table_name ilike '{{ table_pattern }}'\n and table_name not ilike '{{ exclude }}'\n union all\n select distinct\n schemaname as {{ adapter.quote('table_schema') }},\n tablename as {{ adapter.quote('table_name') }},\n 'external' as {{ adapter.quote('table_type') }}\n from svv_external_tables\n where redshift_database_name = '{{ database }}'\n and schemaname ilike '{{ schema_pattern }}'\n and table_name ilike '{{ table_pattern }}'\n and table_name not ilike '{{ exclude }}'\n {% endset %}\n\n {{ return(sql) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.get_table_types_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "schema_pattern", "type": null, "description": ""}, {"name": "table_pattern", "type": null, "description": ""}, {"name": "exclude", "type": null, "description": ""}, {"name": "database", "type": null, "description": ""}], "created_at": 1789422566.8484142, "supported_languages": null}, "macro.dbt_utils.bigquery__get_tables_by_pattern_sql": {"name": "bigquery__get_tables_by_pattern_sql", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_tables_by_pattern_sql.sql", "original_file_path": "macros/sql/get_tables_by_pattern_sql.sql", "unique_id": "macro.dbt_utils.bigquery__get_tables_by_pattern_sql", "macro_sql": "{% macro bigquery__get_tables_by_pattern_sql(schema_pattern, table_pattern, exclude='', database=target.database) %}\n\n {% if '%' in schema_pattern %}\n {% set schemata=dbt_utils._bigquery__get_matching_schemata(schema_pattern, database) %}\n {% else %}\n {% set schemata=[schema_pattern] %}\n {% endif %}\n\n {% set sql %}\n {% for schema in schemata %}\n select distinct\n table_schema,\n table_name,\n {{ dbt_utils.get_table_types_sql() }}\n\n from {{ adapter.quote(database) }}.{{ schema }}.INFORMATION_SCHEMA.TABLES\n where lower(table_name) like lower ('{{ table_pattern }}')\n and lower(table_name) not like lower ('{{ exclude }}')\n\n {% if not loop.last %} union all {% endif %}\n\n {% endfor %}\n {% endset %}\n\n {{ return(sql) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils._bigquery__get_matching_schemata", "macro.dbt_utils.get_table_types_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "schema_pattern", "type": null, "description": ""}, {"name": "table_pattern", "type": null, "description": ""}, {"name": "exclude", "type": null, "description": ""}, {"name": "database", "type": null, "description": ""}], "created_at": 1789422566.849924, "supported_languages": null}, "macro.dbt_utils._bigquery__get_matching_schemata": {"name": "_bigquery__get_matching_schemata", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_tables_by_pattern_sql.sql", "original_file_path": "macros/sql/get_tables_by_pattern_sql.sql", "unique_id": "macro.dbt_utils._bigquery__get_matching_schemata", "macro_sql": "{% macro _bigquery__get_matching_schemata(schema_pattern, database) %}\n {% if execute %}\n\n {% set sql %}\n select schema_name from {{ adapter.quote(database) }}.INFORMATION_SCHEMA.SCHEMATA\n where lower(schema_name) like lower('{{ schema_pattern }}')\n {% endset %}\n\n {% set results=run_query(sql) %}\n\n {% set schemata=results.columns['schema_name'].values() %}\n\n {{ return(schemata) }}\n\n {% else %}\n\n {{ return([]) }}\n\n {% endif %}\n\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "schema_pattern", "type": null, "description": ""}, {"name": "database", "type": null, "description": ""}], "created_at": 1789422566.8509758, "supported_languages": null}, "macro.dbt_utils.get_tables_by_prefix_sql": {"name": "get_tables_by_prefix_sql", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_tables_by_prefix_sql.sql", "original_file_path": "macros/sql/get_tables_by_prefix_sql.sql", "unique_id": "macro.dbt_utils.get_tables_by_prefix_sql", "macro_sql": "{% macro get_tables_by_prefix_sql(schema, prefix, exclude='', database=target.database) %}\n {{ return(adapter.dispatch('get_tables_by_prefix_sql', 'dbt_utils')(schema, prefix, exclude, database)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__get_tables_by_prefix_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "schema", "type": null, "description": ""}, {"name": "prefix", "type": null, "description": ""}, {"name": "exclude", "type": null, "description": ""}, {"name": "database", "type": null, "description": ""}], "created_at": 1789422566.8518112, "supported_languages": null}, "macro.dbt_utils.default__get_tables_by_prefix_sql": {"name": "default__get_tables_by_prefix_sql", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_tables_by_prefix_sql.sql", "original_file_path": "macros/sql/get_tables_by_prefix_sql.sql", "unique_id": "macro.dbt_utils.default__get_tables_by_prefix_sql", "macro_sql": "{% macro default__get_tables_by_prefix_sql(schema, prefix, exclude='', database=target.database) %}\n\n {{ dbt_utils.get_tables_by_pattern_sql(\n schema_pattern = schema,\n table_pattern = prefix ~ '%',\n exclude = exclude,\n database = database\n ) }}\n \n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.get_tables_by_pattern_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "schema", "type": null, "description": ""}, {"name": "prefix", "type": null, "description": ""}, {"name": "exclude", "type": null, "description": ""}, {"name": "database", "type": null, "description": ""}], "created_at": 1789422566.852389, "supported_languages": null}, "macro.dbt_utils.degrees_to_radians": {"name": "degrees_to_radians", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/haversine_distance.sql", "original_file_path": "macros/sql/haversine_distance.sql", "unique_id": "macro.dbt_utils.degrees_to_radians", "macro_sql": "{% macro degrees_to_radians(degrees) -%}\n acos(-1) * {{degrees}} / 180\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "degrees", "type": null, "description": ""}], "created_at": 1789422566.8532808, "supported_languages": null}, "macro.dbt_utils.haversine_distance": {"name": "haversine_distance", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/haversine_distance.sql", "original_file_path": "macros/sql/haversine_distance.sql", "unique_id": "macro.dbt_utils.haversine_distance", "macro_sql": "{% macro haversine_distance(lat1, lon1, lat2, lon2, unit='mi') -%}\n {{ return(adapter.dispatch('haversine_distance', 'dbt_utils')(lat1,lon1,lat2,lon2,unit)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__haversine_distance"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "lat1", "type": null, "description": ""}, {"name": "lon1", "type": null, "description": ""}, {"name": "lat2", "type": null, "description": ""}, {"name": "lon2", "type": null, "description": ""}, {"name": "unit", "type": null, "description": ""}], "created_at": 1789422566.8538573, "supported_languages": null}, "macro.dbt_utils.default__haversine_distance": {"name": "default__haversine_distance", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/haversine_distance.sql", "original_file_path": "macros/sql/haversine_distance.sql", "unique_id": "macro.dbt_utils.default__haversine_distance", "macro_sql": "{% macro default__haversine_distance(lat1, lon1, lat2, lon2, unit='mi') -%}\n{%- if unit == 'mi' %}\n {% set conversion_rate = 1 %}\n{% elif unit == 'km' %}\n {% set conversion_rate = 1.60934 %}\n{% else %}\n {{ exceptions.raise_compiler_error(\"unit input must be one of 'mi' or 'km'. Got \" ~ unit) }}\n{% endif %}\n\n 2 * 3961 * asin(sqrt(power((sin(radians(({{ lat2 }} - {{ lat1 }}) / 2))), 2) +\n cos(radians({{lat1}})) * cos(radians({{lat2}})) *\n power((sin(radians(({{ lon2 }} - {{ lon1 }}) / 2))), 2))) * {{ conversion_rate }}\n\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "lat1", "type": null, "description": ""}, {"name": "lon1", "type": null, "description": ""}, {"name": "lat2", "type": null, "description": ""}, {"name": "lon2", "type": null, "description": ""}, {"name": "unit", "type": null, "description": ""}], "created_at": 1789422566.855184, "supported_languages": null}, "macro.dbt_utils.bigquery__haversine_distance": {"name": "bigquery__haversine_distance", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/haversine_distance.sql", "original_file_path": "macros/sql/haversine_distance.sql", "unique_id": "macro.dbt_utils.bigquery__haversine_distance", "macro_sql": "{% macro bigquery__haversine_distance(lat1, lon1, lat2, lon2, unit='mi') -%}\n{% set radians_lat1 = dbt_utils.degrees_to_radians(lat1) %}\n{% set radians_lat2 = dbt_utils.degrees_to_radians(lat2) %}\n{% set radians_lon1 = dbt_utils.degrees_to_radians(lon1) %}\n{% set radians_lon2 = dbt_utils.degrees_to_radians(lon2) %}\n{%- if unit == 'mi' %}\n {% set conversion_rate = 1 %}\n{% elif unit == 'km' %}\n {% set conversion_rate = 1.60934 %}\n{% else %}\n {{ exceptions.raise_compiler_error(\"unit input must be one of 'mi' or 'km'. Got \" ~ unit) }}\n{% endif %}\n 2 * 3961 * asin(sqrt(power(sin(({{ radians_lat2 }} - {{ radians_lat1 }}) / 2), 2) +\n cos({{ radians_lat1 }}) * cos({{ radians_lat2 }}) *\n power(sin(({{ radians_lon2 }} - {{ radians_lon1 }}) / 2), 2))) * {{ conversion_rate }}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.degrees_to_radians"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "lat1", "type": null, "description": ""}, {"name": "lon1", "type": null, "description": ""}, {"name": "lat2", "type": null, "description": ""}, {"name": "lon2", "type": null, "description": ""}, {"name": "unit", "type": null, "description": ""}], "created_at": 1789422566.8568597, "supported_languages": null}, "macro.dbt_utils.get_powers_of_two": {"name": "get_powers_of_two", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/generate_series.sql", "original_file_path": "macros/sql/generate_series.sql", "unique_id": "macro.dbt_utils.get_powers_of_two", "macro_sql": "{% macro get_powers_of_two(upper_bound) %}\n {{ return(adapter.dispatch('get_powers_of_two', 'dbt_utils')(upper_bound)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__get_powers_of_two"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "upper_bound", "type": null, "description": ""}], "created_at": 1789422566.857796, "supported_languages": null}, "macro.dbt_utils.default__get_powers_of_two": {"name": "default__get_powers_of_two", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/generate_series.sql", "original_file_path": "macros/sql/generate_series.sql", "unique_id": "macro.dbt_utils.default__get_powers_of_two", "macro_sql": "{% macro default__get_powers_of_two(upper_bound) %}\n\n {% if upper_bound <= 0 %}\n {{ exceptions.raise_compiler_error(\"upper bound must be positive\") }}\n {% endif %}\n\n {% for _ in range(1, 100) %}\n {% if upper_bound <= 2 ** loop.index %}{{ return(loop.index) }}{% endif %}\n {% endfor %}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "upper_bound", "type": null, "description": ""}], "created_at": 1789422566.8586578, "supported_languages": null}, "macro.dbt_utils.generate_series": {"name": "generate_series", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/generate_series.sql", "original_file_path": "macros/sql/generate_series.sql", "unique_id": "macro.dbt_utils.generate_series", "macro_sql": "{% macro generate_series(upper_bound) %}\n {{ return(adapter.dispatch('generate_series', 'dbt_utils')(upper_bound)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__generate_series"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "upper_bound", "type": null, "description": ""}], "created_at": 1789422566.859045, "supported_languages": null}, "macro.dbt_utils.default__generate_series": {"name": "default__generate_series", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/generate_series.sql", "original_file_path": "macros/sql/generate_series.sql", "unique_id": "macro.dbt_utils.default__generate_series", "macro_sql": "{% macro default__generate_series(upper_bound) %}\n\n {% set n = dbt_utils.get_powers_of_two(upper_bound) %}\n\n with p as (\n select 0 as generated_number union all select 1\n ), unioned as (\n\n select\n\n {% for i in range(n) %}\n p{{i}}.generated_number * power(2, {{i}})\n {% if not loop.last %} + {% endif %}\n {% endfor %}\n + 1\n as generated_number\n\n from\n\n {% for i in range(n) %}\n p as p{{i}}\n {% if not loop.last %} cross join {% endif %}\n {% endfor %}\n\n )\n\n select *\n from unioned\n where generated_number <= {{upper_bound}}\n order by generated_number\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.get_powers_of_two"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "upper_bound", "type": null, "description": ""}], "created_at": 1789422566.860126, "supported_languages": null}, "macro.dbt_utils.safe_subtract": {"name": "safe_subtract", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/safe_subtract.sql", "original_file_path": "macros/sql/safe_subtract.sql", "unique_id": "macro.dbt_utils.safe_subtract", "macro_sql": "{%- macro safe_subtract(field_list) -%}\n {{ return(adapter.dispatch('safe_subtract', 'dbt_utils')(field_list)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__safe_subtract"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field_list", "type": null, "description": ""}], "created_at": 1789422566.8608294, "supported_languages": null}, "macro.dbt_utils.default__safe_subtract": {"name": "default__safe_subtract", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/safe_subtract.sql", "original_file_path": "macros/sql/safe_subtract.sql", "unique_id": "macro.dbt_utils.default__safe_subtract", "macro_sql": "\n\n{%- macro default__safe_subtract(field_list) -%}\n\n{%- if field_list is not iterable or field_list is string or field_list is mapping -%}\n\n{%- set error_message = '\nWarning: the `safe_subtract` macro takes a single list argument instead of \\\nstring arguments. The {}.{} model triggered this warning. \\\n'.format(model.package_name, model.name) -%}\n\n{%- do exceptions.raise_compiler_error(error_message) -%}\n\n{%- endif -%}\n\n{% set fields = [] %}\n\n{%- for field in field_list -%}\n\n {% do fields.append(\"coalesce(\" ~ field ~ \", 0)\") %}\n\n{%- endfor -%}\n\n{{ fields|join(' -\\n ') }}\n\n{%- endmacro -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field_list", "type": null, "description": ""}], "created_at": 1789422566.8619585, "supported_languages": null}, "macro.dbt_utils.deduplicate": {"name": "deduplicate", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/deduplicate.sql", "original_file_path": "macros/sql/deduplicate.sql", "unique_id": "macro.dbt_utils.deduplicate", "macro_sql": "{%- macro deduplicate(relation, partition_by, order_by) -%}\n {{ return(adapter.dispatch('deduplicate', 'dbt_utils')(relation, partition_by, order_by)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.postgres__deduplicate"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "partition_by", "type": null, "description": ""}, {"name": "order_by", "type": null, "description": ""}], "created_at": 1789422566.8630905, "supported_languages": null}, "macro.dbt_utils.default__deduplicate": {"name": "default__deduplicate", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/deduplicate.sql", "original_file_path": "macros/sql/deduplicate.sql", "unique_id": "macro.dbt_utils.default__deduplicate", "macro_sql": "\n\n{%- macro default__deduplicate(relation, partition_by, order_by) -%}\n\n with row_numbered as (\n select\n _inner.*,\n row_number() over (\n partition by {{ partition_by }}\n order by {{ order_by }}\n ) as rn\n from {{ relation }} as _inner\n )\n\n select\n distinct data.*\n from {{ relation }} as data\n {#\n -- Not all DBs will support natural joins but the ones that do include:\n -- Oracle, MySQL, SQLite, Redshift, Teradata, Materialize, Databricks\n -- Apache Spark, SingleStore, Vertica\n -- Those that do not appear to support natural joins include:\n -- SQLServer, Trino, Presto, Rockset, Athena\n #}\n natural join row_numbered\n where row_numbered.rn = 1\n\n{%- endmacro -%}\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "partition_by", "type": null, "description": ""}, {"name": "order_by", "type": null, "description": ""}], "created_at": 1789422566.863553, "supported_languages": null}, "macro.dbt_utils.redshift__deduplicate": {"name": "redshift__deduplicate", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/deduplicate.sql", "original_file_path": "macros/sql/deduplicate.sql", "unique_id": "macro.dbt_utils.redshift__deduplicate", "macro_sql": "{% macro redshift__deduplicate(relation, partition_by, order_by) -%}\n\n select *\n from {{ relation }} as tt\n qualify\n row_number() over (\n partition by {{ partition_by }}\n order by {{ order_by }}\n ) = 1\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "partition_by", "type": null, "description": ""}, {"name": "order_by", "type": null, "description": ""}], "created_at": 1789422566.8639166, "supported_languages": null}, "macro.dbt_utils.postgres__deduplicate": {"name": "postgres__deduplicate", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/deduplicate.sql", "original_file_path": "macros/sql/deduplicate.sql", "unique_id": "macro.dbt_utils.postgres__deduplicate", "macro_sql": "\n{%- macro postgres__deduplicate(relation, partition_by, order_by) -%}\n\n select\n distinct on ({{ partition_by }}) *\n from {{ relation }}\n order by {{ partition_by }}{{ ',' ~ order_by }}\n\n{%- endmacro -%}\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "partition_by", "type": null, "description": ""}, {"name": "order_by", "type": null, "description": ""}], "created_at": 1789422566.8643167, "supported_languages": null}, "macro.dbt_utils.snowflake__deduplicate": {"name": "snowflake__deduplicate", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/deduplicate.sql", "original_file_path": "macros/sql/deduplicate.sql", "unique_id": "macro.dbt_utils.snowflake__deduplicate", "macro_sql": "\n{%- macro snowflake__deduplicate(relation, partition_by, order_by) -%}\n\n select *\n from {{ relation }}\n qualify\n row_number() over (\n partition by {{ partition_by }}\n order by {{ order_by }}\n ) = 1\n\n{%- endmacro -%}\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "partition_by", "type": null, "description": ""}, {"name": "order_by", "type": null, "description": ""}], "created_at": 1789422566.864695, "supported_languages": null}, "macro.dbt_utils.databricks__deduplicate": {"name": "databricks__deduplicate", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/deduplicate.sql", "original_file_path": "macros/sql/deduplicate.sql", "unique_id": "macro.dbt_utils.databricks__deduplicate", "macro_sql": "\n{%- macro databricks__deduplicate(relation, partition_by, order_by) -%}\n\n select *\n from {{ relation }}\n qualify\n row_number() over (\n partition by {{ partition_by }}\n order by {{ order_by }}\n ) = 1\n\n{%- endmacro -%}\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "partition_by", "type": null, "description": ""}, {"name": "order_by", "type": null, "description": ""}], "created_at": 1789422566.8650415, "supported_languages": null}, "macro.dbt_utils.bigquery__deduplicate": {"name": "bigquery__deduplicate", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/deduplicate.sql", "original_file_path": "macros/sql/deduplicate.sql", "unique_id": "macro.dbt_utils.bigquery__deduplicate", "macro_sql": "\n{%- macro bigquery__deduplicate(relation, partition_by, order_by) -%}\n\n select unique.*\n from (\n select\n array_agg (\n original\n order by {{ order_by }}\n limit 1\n )[offset(0)] unique\n from {{ relation }} original\n group by {{ partition_by }}\n )\n\n{%- endmacro -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "partition_by", "type": null, "description": ""}, {"name": "order_by", "type": null, "description": ""}], "created_at": 1789422566.8653922, "supported_languages": null}, "macro.dbt_utils.generate_surrogate_key": {"name": "generate_surrogate_key", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/generate_surrogate_key.sql", "original_file_path": "macros/sql/generate_surrogate_key.sql", "unique_id": "macro.dbt_utils.generate_surrogate_key", "macro_sql": "{%- macro generate_surrogate_key(field_list) -%}\n {{ return(adapter.dispatch('generate_surrogate_key', 'dbt_utils')(field_list)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__generate_surrogate_key"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field_list", "type": null, "description": ""}], "created_at": 1789422566.8661597, "supported_languages": null}, "macro.dbt_utils.default__generate_surrogate_key": {"name": "default__generate_surrogate_key", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/generate_surrogate_key.sql", "original_file_path": "macros/sql/generate_surrogate_key.sql", "unique_id": "macro.dbt_utils.default__generate_surrogate_key", "macro_sql": "\n\n{%- macro default__generate_surrogate_key(field_list) -%}\n\n{%- if var('surrogate_key_treat_nulls_as_empty_strings', False) -%}\n {%- set default_null_value = \"\" -%}\n{%- else -%}\n {%- set default_null_value = '_dbt_utils_surrogate_key_null_' -%}\n{%- endif -%}\n\n{%- set fields = [] -%}\n\n{%- for field in field_list -%}\n\n {%- do fields.append(\n \"coalesce(cast(\" ~ field ~ \" as \" ~ dbt.type_string() ~ \"), '\" ~ default_null_value ~\"')\"\n ) -%}\n\n {%- if not loop.last %}\n {%- do fields.append(\"'-'\") -%}\n {%- endif -%}\n\n{%- endfor -%}\n\n{{ dbt.hash(dbt.concat(fields)) }}\n\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt.type_string", "macro.dbt.hash", "macro.dbt.concat"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field_list", "type": null, "description": ""}], "created_at": 1789422566.867667, "supported_languages": null}, "macro.dbt_utils.pivot": {"name": "pivot", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/pivot.sql", "original_file_path": "macros/sql/pivot.sql", "unique_id": "macro.dbt_utils.pivot", "macro_sql": "{% macro pivot(column,\n values,\n alias=True,\n agg='sum',\n cmp='=',\n prefix='',\n suffix='',\n then_value=1,\n else_value=0,\n quote_identifiers=True,\n distinct=False) %}\n {{ return(adapter.dispatch('pivot', 'dbt_utils')(column, values, alias, agg, cmp, prefix, suffix, then_value, else_value, quote_identifiers, distinct)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__pivot"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "column", "type": null, "description": ""}, {"name": "values", "type": null, "description": ""}, {"name": "alias", "type": null, "description": ""}, {"name": "agg", "type": null, "description": ""}, {"name": "cmp", "type": null, "description": ""}, {"name": "prefix", "type": null, "description": ""}, {"name": "suffix", "type": null, "description": ""}, {"name": "then_value", "type": null, "description": ""}, {"name": "else_value", "type": null, "description": ""}, {"name": "quote_identifiers", "type": null, "description": ""}, {"name": "distinct", "type": null, "description": ""}], "created_at": 1789422566.8692465, "supported_languages": null}, "macro.dbt_utils.default__pivot": {"name": "default__pivot", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/pivot.sql", "original_file_path": "macros/sql/pivot.sql", "unique_id": "macro.dbt_utils.default__pivot", "macro_sql": "{% macro default__pivot(column,\n values,\n alias=True,\n agg='sum',\n cmp='=',\n prefix='',\n suffix='',\n then_value=1,\n else_value=0,\n quote_identifiers=True,\n distinct=False) %}\n {% for value in values %}\n {{ agg }}(\n {% if distinct %} distinct {% endif %}\n case\n when {{ column }} {{ cmp }} '{{ dbt.escape_single_quotes(value) }}'\n then {{ then_value }}\n else {{ else_value }}\n end\n )\n {% if alias %}\n {% if quote_identifiers %}\n as {{ adapter.quote(prefix ~ value ~ suffix) }}\n {% else %}\n as {{ dbt_utils.slugify(prefix ~ value ~ suffix) }}\n {% endif %}\n {% endif %}\n {% if not loop.last %},{% endif %}\n {% endfor %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.escape_single_quotes", "macro.dbt_utils.slugify"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "column", "type": null, "description": ""}, {"name": "values", "type": null, "description": ""}, {"name": "alias", "type": null, "description": ""}, {"name": "agg", "type": null, "description": ""}, {"name": "cmp", "type": null, "description": ""}, {"name": "prefix", "type": null, "description": ""}, {"name": "suffix", "type": null, "description": ""}, {"name": "then_value", "type": null, "description": ""}, {"name": "else_value", "type": null, "description": ""}, {"name": "quote_identifiers", "type": null, "description": ""}, {"name": "distinct", "type": null, "description": ""}], "created_at": 1789422566.870989, "supported_languages": null}, "macro.dbt_utils.nullcheck_table": {"name": "nullcheck_table", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/nullcheck_table.sql", "original_file_path": "macros/sql/nullcheck_table.sql", "unique_id": "macro.dbt_utils.nullcheck_table", "macro_sql": "{% macro nullcheck_table(relation) %}\n {{ return(adapter.dispatch('nullcheck_table', 'dbt_utils')(relation)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__nullcheck_table"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789422566.8716378, "supported_languages": null}, "macro.dbt_utils.default__nullcheck_table": {"name": "default__nullcheck_table", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/nullcheck_table.sql", "original_file_path": "macros/sql/nullcheck_table.sql", "unique_id": "macro.dbt_utils.default__nullcheck_table", "macro_sql": "{% macro default__nullcheck_table(relation) %}\n\n {%- do dbt_utils._is_relation(relation, 'nullcheck_table') -%}\n {%- do dbt_utils._is_ephemeral(relation, 'nullcheck_table') -%}\n {% set cols = adapter.get_columns_in_relation(relation) %}\n\n select {{ dbt_utils.nullcheck(cols) }}\n from {{relation}}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils._is_relation", "macro.dbt_utils._is_ephemeral", "macro.dbt_utils.nullcheck"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789422566.8723376, "supported_languages": null}, "macro.dbt_utils.get_relations_by_pattern": {"name": "get_relations_by_pattern", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_relations_by_pattern.sql", "original_file_path": "macros/sql/get_relations_by_pattern.sql", "unique_id": "macro.dbt_utils.get_relations_by_pattern", "macro_sql": "{% macro get_relations_by_pattern(schema_pattern, table_pattern, exclude='', database=target.database) %}\n {{ return(adapter.dispatch('get_relations_by_pattern', 'dbt_utils')(schema_pattern, table_pattern, exclude, database)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__get_relations_by_pattern"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "schema_pattern", "type": null, "description": ""}, {"name": "table_pattern", "type": null, "description": ""}, {"name": "exclude", "type": null, "description": ""}, {"name": "database", "type": null, "description": ""}], "created_at": 1789422566.8732865, "supported_languages": null}, "macro.dbt_utils.default__get_relations_by_pattern": {"name": "default__get_relations_by_pattern", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_relations_by_pattern.sql", "original_file_path": "macros/sql/get_relations_by_pattern.sql", "unique_id": "macro.dbt_utils.default__get_relations_by_pattern", "macro_sql": "{% macro default__get_relations_by_pattern(schema_pattern, table_pattern, exclude='', database=target.database) %}\n\n {%- call statement('get_tables', fetch_result=True) %}\n\n {{ dbt_utils.get_tables_by_pattern_sql(schema_pattern, table_pattern, exclude, database) }}\n\n {%- endcall -%}\n\n {%- set table_list = load_result('get_tables') -%}\n\n {%- if table_list and table_list['table'] -%}\n {%- set tbl_relations = [] -%}\n {%- for row in table_list['table'] -%}\n {%- set tbl_relation = api.Relation.create(\n database=database,\n schema=row.table_schema,\n identifier=row.table_name,\n type=row.table_type\n ) -%}\n {%- do tbl_relations.append(tbl_relation) -%}\n {%- endfor -%}\n\n {{ return(tbl_relations) }}\n {%- else -%}\n {{ return([]) }}\n {%- endif -%}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement", "macro.dbt_utils.get_tables_by_pattern_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "schema_pattern", "type": null, "description": ""}, {"name": "table_pattern", "type": null, "description": ""}, {"name": "exclude", "type": null, "description": ""}, {"name": "database", "type": null, "description": ""}], "created_at": 1789422566.8750427, "supported_languages": null}, "macro.dbt_utils.get_query_results_as_dict": {"name": "get_query_results_as_dict", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_query_results_as_dict.sql", "original_file_path": "macros/sql/get_query_results_as_dict.sql", "unique_id": "macro.dbt_utils.get_query_results_as_dict", "macro_sql": "{% macro get_query_results_as_dict(query) %}\n {{ return(adapter.dispatch('get_query_results_as_dict', 'dbt_utils')(query)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__get_query_results_as_dict"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "query", "type": null, "description": ""}], "created_at": 1789422566.8757565, "supported_languages": null}, "macro.dbt_utils.default__get_query_results_as_dict": {"name": "default__get_query_results_as_dict", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_query_results_as_dict.sql", "original_file_path": "macros/sql/get_query_results_as_dict.sql", "unique_id": "macro.dbt_utils.default__get_query_results_as_dict", "macro_sql": "{% macro default__get_query_results_as_dict(query) %}\n\n{# This macro returns a dictionary of the form {column_name: (tuple_of_results)} #}\n\n {%- call statement('get_query_results', fetch_result=True,auto_begin=false) -%}\n\n {{ query }}\n\n {%- endcall -%}\n\n {% set sql_results={} %}\n\n {%- if execute -%}\n {% set sql_results_table = load_result('get_query_results').table.columns %}\n {% for column_name, column in sql_results_table.items() %}\n {% do sql_results.update({column_name: column.values()}) %}\n {% endfor %}\n {%- endif -%}\n\n {{ return(sql_results) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "query", "type": null, "description": ""}], "created_at": 1789422566.8769526, "supported_languages": null}, "macro.dbt_utils.union_relations": {"name": "union_relations", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/union.sql", "original_file_path": "macros/sql/union.sql", "unique_id": "macro.dbt_utils.union_relations", "macro_sql": "{%- macro union_relations(relations, column_override=none, include=[], exclude=[], source_column_name='_dbt_source_relation', where=none) -%}\n {{ return(adapter.dispatch('union_relations', 'dbt_utils')(relations, column_override, include, exclude, source_column_name, where)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__union_relations"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relations", "type": null, "description": ""}, {"name": "column_override", "type": null, "description": ""}, {"name": "include", "type": null, "description": ""}, {"name": "exclude", "type": null, "description": ""}, {"name": "source_column_name", "type": null, "description": ""}, {"name": "where", "type": null, "description": ""}], "created_at": 1789422566.8790145, "supported_languages": null}, "macro.dbt_utils.default__union_relations": {"name": "default__union_relations", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/union.sql", "original_file_path": "macros/sql/union.sql", "unique_id": "macro.dbt_utils.default__union_relations", "macro_sql": "\n\n{%- macro default__union_relations(relations, column_override=none, include=[], exclude=[], source_column_name='_dbt_source_relation', where=none) -%}\n\n {%- if exclude and include -%}\n {{ exceptions.raise_compiler_error(\"Both an exclude and include list were provided to the `union` macro. Only one is allowed\") }}\n {%- endif -%}\n\n {#-- Prevent querying of db in parsing mode. This works because this macro does not create any new refs. -#}\n {%- if not execute %}\n {{ return('') }}\n {% endif -%}\n\n {%- set column_override = column_override if column_override is not none else {} -%}\n\n {%- set relation_columns = {} -%}\n {%- set column_superset = {} -%}\n {%- set all_excludes = [] -%}\n {%- set all_includes = [] -%}\n\n {%- if exclude -%}\n {%- for exc in exclude -%}\n {%- do all_excludes.append(exc | lower) -%}\n {%- endfor -%}\n {%- endif -%}\n\n {%- if include -%}\n {%- for inc in include -%}\n {%- do all_includes.append(inc | lower) -%}\n {%- endfor -%}\n {%- endif -%}\n\n {%- for relation in relations -%}\n\n {%- do relation_columns.update({relation: []}) -%}\n\n {%- do dbt_utils._is_relation(relation, 'union_relations') -%}\n {%- do dbt_utils._is_ephemeral(relation, 'union_relations') -%}\n {%- set cols = adapter.get_columns_in_relation(relation) -%}\n {%- for col in cols -%}\n\n {#- If an exclude list was provided and the column is in the list, do nothing -#}\n {%- if exclude and col.column | lower in all_excludes -%}\n\n {#- If an include list was provided and the column is not in the list, do nothing -#}\n {%- elif include and col.column | lower not in all_includes -%}\n\n {#- Otherwise add the column to the column superset -#}\n {%- else -%}\n\n {#- update the list of columns in this relation -#}\n {%- do relation_columns[relation].append(col.column) -%}\n\n {%- if col.column in column_superset -%}\n\n {%- set stored = column_superset[col.column] -%}\n {%- if col.is_string() and stored.is_string() and col.string_size() > stored.string_size() -%}\n\n {%- do column_superset.update({col.column: col}) -%}\n\n {%- endif %}\n\n {%- else -%}\n\n {%- do column_superset.update({col.column: col}) -%}\n\n {%- endif -%}\n\n {%- endif -%}\n\n {%- endfor -%}\n {%- endfor -%}\n\n {%- set ordered_column_names = column_superset.keys() -%}\n {%- set dbt_command = flags.WHICH -%}\n\n\n {% if dbt_command in ['run', 'build'] %}\n {% if (include | length > 0 or exclude | length > 0) and not column_superset.keys() %}\n {%- set relations_string -%}\n {%- for relation in relations -%}\n {{ relation.name }}\n {%- if not loop.last %}, {% endif -%}\n {%- endfor -%}\n {%- endset -%}\n\n {%- set error_message -%}\n There were no columns found to union for relations {{ relations_string }}\n {%- endset -%}\n\n {{ exceptions.raise_compiler_error(error_message) }}\n {%- endif -%}\n {%- endif -%}\n\n {%- for relation in relations %}\n\n (\n select\n\n {%- if source_column_name is not none %}\n cast({{ dbt.string_literal(relation.render()) }} as {{ dbt.type_string() }}) as {{ source_column_name }},\n {%- endif %}\n\n /* No columns from any of the relations.\n This star is only output during dbt compile, and exists to keep SQLFluff happy. */\n {% if dbt_command == 'compile' and ordered_column_names|length == 0 %}\n *\n {% endif %}\n\n {% for col_name in ordered_column_names -%}\n\n {%- set col = column_superset[col_name] %}\n {%- set col_type = column_override.get(col.column, col.data_type) %}\n {%- set col_name = adapter.quote(col_name) if col_name in relation_columns[relation] else 'null' %}\n cast({{ col_name }} as {{ col_type }}) as {{ col.quoted }} {% if not loop.last %},{% endif -%}\n\n {%- endfor %}\n\n from {{ relation }}\n\n {% if where -%}\n where {{ where }}\n {%- endif %}\n )\n\n {% if not loop.last -%}\n union all\n {% endif -%}\n\n {%- endfor -%}\n\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt_utils._is_relation", "macro.dbt_utils._is_ephemeral", "macro.dbt.string_literal", "macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relations", "type": null, "description": ""}, {"name": "column_override", "type": null, "description": ""}, {"name": "include", "type": null, "description": ""}, {"name": "exclude", "type": null, "description": ""}, {"name": "source_column_name", "type": null, "description": ""}, {"name": "where", "type": null, "description": ""}], "created_at": 1789422566.8863785, "supported_languages": null}, "macro.dbt_utils.unpivot": {"name": "unpivot", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/unpivot.sql", "original_file_path": "macros/sql/unpivot.sql", "unique_id": "macro.dbt_utils.unpivot", "macro_sql": "{% macro unpivot(relation=none, cast_to='varchar', exclude=none, remove=none, field_name='field_name', value_name='value', quote_identifiers=False) -%}\n {{ return(adapter.dispatch('unpivot', 'dbt_utils')(relation, cast_to, exclude, remove, field_name, value_name, quote_identifiers)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__unpivot"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "cast_to", "type": null, "description": ""}, {"name": "exclude", "type": null, "description": ""}, {"name": "remove", "type": null, "description": ""}, {"name": "field_name", "type": null, "description": ""}, {"name": "value_name", "type": null, "description": ""}, {"name": "quote_identifiers", "type": null, "description": ""}], "created_at": 1789422566.8880556, "supported_languages": null}, "macro.dbt_utils.default__unpivot": {"name": "default__unpivot", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/unpivot.sql", "original_file_path": "macros/sql/unpivot.sql", "unique_id": "macro.dbt_utils.default__unpivot", "macro_sql": "{% macro default__unpivot(relation=none, cast_to='varchar', exclude=none, remove=none, field_name='field_name', value_name='value', quote_identifiers=False) -%}\n\n {% if not relation %}\n {{ exceptions.raise_compiler_error(\"Error: argument `relation` is required for `unpivot` macro.\") }}\n {% endif %}\n\n {%- set exclude = exclude if exclude is not none else [] %}\n {%- set remove = remove if remove is not none else [] %}\n\n {%- set include_cols = [] %}\n\n {%- set table_columns = {} %}\n\n {%- do table_columns.update({relation: []}) %}\n\n {%- do dbt_utils._is_relation(relation, 'unpivot') -%}\n {%- do dbt_utils._is_ephemeral(relation, 'unpivot') -%}\n {%- set cols = adapter.get_columns_in_relation(relation) %}\n\n {%- for col in cols -%}\n {%- if col.column.lower() not in remove|map('lower') and col.column.lower() not in exclude|map('lower') -%}\n {% do include_cols.append(col) %}\n {%- endif %}\n {%- endfor %}\n\n\n {%- for col in include_cols -%}\n {%- set current_col_name = adapter.quote(col.column) if quote_identifiers else col.column -%}\n select\n {%- for exclude_col in exclude %}\n {{ adapter.quote(exclude_col) if quote_identifiers else exclude_col }},\n {%- endfor %}\n\n cast('{{ col.column }}' as {{ dbt.type_string() }}) as {{ adapter.quote(field_name) if quote_identifiers else field_name }},\n cast( {% if col.data_type == 'boolean' %}\n {{ dbt.cast_bool_to_text(current_col_name) }}\n {% else %}\n {{ current_col_name }}\n {% endif %}\n as {{ cast_to }}) as {{ adapter.quote(value_name) if quote_identifiers else value_name }}\n\n from {{ relation }}\n\n {% if not loop.last -%}\n union all\n {% endif -%}\n {%- endfor -%}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_utils._is_relation", "macro.dbt_utils._is_ephemeral", "macro.dbt.type_string", "macro.dbt.cast_bool_to_text"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "cast_to", "type": null, "description": ""}, {"name": "exclude", "type": null, "description": ""}, {"name": "remove", "type": null, "description": ""}, {"name": "field_name", "type": null, "description": ""}, {"name": "value_name", "type": null, "description": ""}, {"name": "quote_identifiers", "type": null, "description": ""}], "created_at": 1789422566.891995, "supported_languages": null}, "macro.dbt_utils.nullcheck": {"name": "nullcheck", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/nullcheck.sql", "original_file_path": "macros/sql/nullcheck.sql", "unique_id": "macro.dbt_utils.nullcheck", "macro_sql": "{% macro nullcheck(cols) %}\n {{ return(adapter.dispatch('nullcheck', 'dbt_utils')(cols)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__nullcheck"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "cols", "type": null, "description": ""}], "created_at": 1789422566.8927524, "supported_languages": null}, "macro.dbt_utils.default__nullcheck": {"name": "default__nullcheck", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/nullcheck.sql", "original_file_path": "macros/sql/nullcheck.sql", "unique_id": "macro.dbt_utils.default__nullcheck", "macro_sql": "{% macro default__nullcheck(cols) %}\n{%- for col in cols %}\n\n {% if col.is_string() -%}\n\n nullif({{col.name}},'') as {{col.name}}\n\n {%- else -%}\n\n {{col.name}}\n\n {%- endif -%}\n\n{%- if not loop.last -%} , {%- endif -%}\n\n{%- endfor -%}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "cols", "type": null, "description": ""}], "created_at": 1789422566.8934684, "supported_languages": null}, "macro.dbt_utils.get_intervals_between": {"name": "get_intervals_between", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/date_spine.sql", "original_file_path": "macros/sql/date_spine.sql", "unique_id": "macro.dbt_utils.get_intervals_between", "macro_sql": "{% macro get_intervals_between(start_date, end_date, datepart) -%}\n {{ return(adapter.dispatch('get_intervals_between', 'dbt_utils')(start_date, end_date, datepart)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__get_intervals_between"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "start_date", "type": null, "description": ""}, {"name": "end_date", "type": null, "description": ""}, {"name": "datepart", "type": null, "description": ""}], "created_at": 1789422566.8944535, "supported_languages": null}, "macro.dbt_utils.default__get_intervals_between": {"name": "default__get_intervals_between", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/date_spine.sql", "original_file_path": "macros/sql/date_spine.sql", "unique_id": "macro.dbt_utils.default__get_intervals_between", "macro_sql": "{% macro default__get_intervals_between(start_date, end_date, datepart) -%}\n {%- call statement('get_intervals_between', fetch_result=True) %}\n\n select {{ dbt.datediff(start_date, end_date, datepart) }}\n\n {%- endcall -%}\n\n {%- set value_list = load_result('get_intervals_between') -%}\n\n {%- if value_list and value_list['data'] -%}\n {%- set values = value_list['data'] | map(attribute=0) | list %}\n {{ return(values[0]) }}\n {%- else -%}\n {{ return(1) }}\n {%- endif -%}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.statement", "macro.dbt.datediff"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "start_date", "type": null, "description": ""}, {"name": "end_date", "type": null, "description": ""}, {"name": "datepart", "type": null, "description": ""}], "created_at": 1789422566.8957024, "supported_languages": null}, "macro.dbt_utils.date_spine": {"name": "date_spine", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/date_spine.sql", "original_file_path": "macros/sql/date_spine.sql", "unique_id": "macro.dbt_utils.date_spine", "macro_sql": "{% macro date_spine(datepart, start_date, end_date) %}\n {{ return(adapter.dispatch('date_spine', 'dbt_utils')(datepart, start_date, end_date)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__date_spine"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "datepart", "type": null, "description": ""}, {"name": "start_date", "type": null, "description": ""}, {"name": "end_date", "type": null, "description": ""}], "created_at": 1789422566.8961778, "supported_languages": null}, "macro.dbt_utils.default__date_spine": {"name": "default__date_spine", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/date_spine.sql", "original_file_path": "macros/sql/date_spine.sql", "unique_id": "macro.dbt_utils.default__date_spine", "macro_sql": "{% macro default__date_spine(datepart, start_date, end_date) %}\n\n\n{# call as follows:\n\ndate_spine(\n \"day\",\n \"to_date('01/01/2016', 'mm/dd/yyyy')\",\n \"dbt.dateadd(week, 1, current_date)\"\n) #}\n\n\nwith rawdata as (\n\n {{dbt_utils.generate_series(\n dbt_utils.get_intervals_between(start_date, end_date, datepart)\n )}}\n\n),\n\nall_periods as (\n\n select (\n {{\n dbt.dateadd(\n datepart,\n \"row_number() over (order by generated_number) - 1\",\n start_date\n )\n }}\n ) as date_{{datepart}}\n from rawdata\n\n),\n\nfiltered as (\n\n select *\n from all_periods\n where date_{{datepart}} <= {{ end_date }}\n\n)\n\nselect * from filtered\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.generate_series", "macro.dbt_utils.get_intervals_between", "macro.dbt.dateadd"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "datepart", "type": null, "description": ""}, {"name": "start_date", "type": null, "description": ""}, {"name": "end_date", "type": null, "description": ""}], "created_at": 1789422566.8969185, "supported_languages": null}, "macro.dbt_utils.get_filtered_columns_in_relation": {"name": "get_filtered_columns_in_relation", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_filtered_columns_in_relation.sql", "original_file_path": "macros/sql/get_filtered_columns_in_relation.sql", "unique_id": "macro.dbt_utils.get_filtered_columns_in_relation", "macro_sql": "{% macro get_filtered_columns_in_relation(from, except=[]) -%}\n {{ return(adapter.dispatch('get_filtered_columns_in_relation', 'dbt_utils')(from, except)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__get_filtered_columns_in_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "from", "type": null, "description": ""}, {"name": "except", "type": null, "description": ""}], "created_at": 1789422566.8977926, "supported_languages": null}, "macro.dbt_utils.default__get_filtered_columns_in_relation": {"name": "default__get_filtered_columns_in_relation", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_filtered_columns_in_relation.sql", "original_file_path": "macros/sql/get_filtered_columns_in_relation.sql", "unique_id": "macro.dbt_utils.default__get_filtered_columns_in_relation", "macro_sql": "{% macro default__get_filtered_columns_in_relation(from, except=[]) -%}\n {%- do dbt_utils._is_relation(from, 'get_filtered_columns_in_relation') -%}\n {%- do dbt_utils._is_ephemeral(from, 'get_filtered_columns_in_relation') -%}\n\n {# -- Prevent querying of db in parsing mode. This works because this macro does not create any new refs. #}\n {%- if not execute -%}\n {{ return([]) }}\n {% endif %}\n\n {%- set include_cols = [] %}\n {%- set cols = adapter.get_columns_in_relation(from) -%}\n {%- set except = except | map(\"lower\") | list %}\n {%- for col in cols -%}\n {%- if col.column|lower not in except -%}\n {% do include_cols.append(col.column) %}\n {%- endif %}\n {%- endfor %}\n\n {{ return(include_cols) }}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_utils._is_relation", "macro.dbt_utils._is_ephemeral"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "from", "type": null, "description": ""}, {"name": "except", "type": null, "description": ""}], "created_at": 1789422566.899312, "supported_languages": null}, "macro.dbt_utils.surrogate_key": {"name": "surrogate_key", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/surrogate_key.sql", "original_file_path": "macros/sql/surrogate_key.sql", "unique_id": "macro.dbt_utils.surrogate_key", "macro_sql": "{%- macro surrogate_key(field_list) -%}\n {% set frustrating_jinja_feature = varargs %}\n {{ return(adapter.dispatch('surrogate_key', 'dbt_utils')(field_list, *varargs)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__surrogate_key"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field_list", "type": null, "description": ""}], "created_at": 1789422566.9000335, "supported_languages": null}, "macro.dbt_utils.default__surrogate_key": {"name": "default__surrogate_key", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/surrogate_key.sql", "original_file_path": "macros/sql/surrogate_key.sql", "unique_id": "macro.dbt_utils.default__surrogate_key", "macro_sql": "\n\n{%- macro default__surrogate_key(field_list) -%}\n\n{%- set error_message = '\nWarning: `dbt_utils.surrogate_key` has been replaced by \\\n`dbt_utils.generate_surrogate_key`. The new macro treats null values \\\ndifferently to empty strings. To restore the behaviour of the original \\\nmacro, add a global variable in dbt_project.yml called \\\n`surrogate_key_treat_nulls_as_empty_strings` to your \\\ndbt_project.yml file with a value of True. \\\nThe {}.{} model triggered this warning. \\\n'.format(model.package_name, model.name) -%}\n\n{%- do exceptions.raise_compiler_error(error_message) -%}\n\n{%- endmacro -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field_list", "type": null, "description": ""}], "created_at": 1789422566.9005384, "supported_languages": null}, "macro.dbt_utils.get_single_value": {"name": "get_single_value", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_single_value.sql", "original_file_path": "macros/sql/get_single_value.sql", "unique_id": "macro.dbt_utils.get_single_value", "macro_sql": "{% macro get_single_value(query, default=none) %}\n {{ return(adapter.dispatch('get_single_value', 'dbt_utils')(query, default)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__get_single_value"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "query", "type": null, "description": ""}, {"name": "default", "type": null, "description": ""}], "created_at": 1789422566.901344, "supported_languages": null}, "macro.dbt_utils.default__get_single_value": {"name": "default__get_single_value", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_single_value.sql", "original_file_path": "macros/sql/get_single_value.sql", "unique_id": "macro.dbt_utils.default__get_single_value", "macro_sql": "{% macro default__get_single_value(query, default) %}\n\n{# This macro returns the (0, 0) record in a query, i.e. the first row of the first column #}\n\n {%- call statement('get_query_result', fetch_result=True, auto_begin=false) -%}\n\n {{ query }}\n\n {%- endcall -%}\n\n {%- if execute -%}\n\n {% set r = load_result('get_query_result').table.columns[0].values() %}\n {% if r | length == 0 %}\n {% do print('Query `' ~ query ~ '` returned no rows. Using the default value: ' ~ default) %}\n {% set sql_result = default %}\n {% else %}\n {% set sql_result = r[0] %}\n {% endif %}\n \n {%- else -%}\n \n {% set sql_result = default %}\n \n {%- endif -%}\n\n {% do return(sql_result) %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "query", "type": null, "description": ""}, {"name": "default", "type": null, "description": ""}], "created_at": 1789422566.9030287, "supported_languages": null}, "macro.dbt_utils.width_bucket": {"name": "width_bucket", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/width_bucket.sql", "original_file_path": "macros/sql/width_bucket.sql", "unique_id": "macro.dbt_utils.width_bucket", "macro_sql": "{% macro width_bucket(expr, min_value, max_value, num_buckets) %}\n {{ return(adapter.dispatch('width_bucket', 'dbt_utils') (expr, min_value, max_value, num_buckets)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__width_bucket"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "expr", "type": null, "description": ""}, {"name": "min_value", "type": null, "description": ""}, {"name": "max_value", "type": null, "description": ""}, {"name": "num_buckets", "type": null, "description": ""}], "created_at": 1789422566.9039302, "supported_languages": null}, "macro.dbt_utils.default__width_bucket": {"name": "default__width_bucket", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/width_bucket.sql", "original_file_path": "macros/sql/width_bucket.sql", "unique_id": "macro.dbt_utils.default__width_bucket", "macro_sql": "{% macro default__width_bucket(expr, min_value, max_value, num_buckets) -%}\n\n {% set bin_size -%}\n (( {{ max_value }} - {{ min_value }} ) / {{ num_buckets }} )\n {%- endset %}\n (\n -- to break ties when the amount is eaxtly at the bucket egde\n case\n when\n mod(\n {{ dbt.safe_cast(expr, dbt.type_numeric() ) }},\n {{ dbt.safe_cast(bin_size, dbt.type_numeric() ) }}\n ) = 0\n then 1\n else 0\n end\n ) +\n -- Anything over max_value goes the N+1 bucket\n least(\n ceil(\n ({{ expr }} - {{ min_value }})/{{ bin_size }}\n ),\n {{ num_buckets }} + 1\n )\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.safe_cast", "macro.dbt.type_numeric"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "expr", "type": null, "description": ""}, {"name": "min_value", "type": null, "description": ""}, {"name": "max_value", "type": null, "description": ""}, {"name": "num_buckets", "type": null, "description": ""}], "created_at": 1789422566.9048831, "supported_languages": null}, "macro.dbt_utils.snowflake__width_bucket": {"name": "snowflake__width_bucket", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/width_bucket.sql", "original_file_path": "macros/sql/width_bucket.sql", "unique_id": "macro.dbt_utils.snowflake__width_bucket", "macro_sql": "{% macro snowflake__width_bucket(expr, min_value, max_value, num_buckets) %}\n width_bucket({{ expr }}, {{ min_value }}, {{ max_value }}, {{ num_buckets }} )\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "expr", "type": null, "description": ""}, {"name": "min_value", "type": null, "description": ""}, {"name": "max_value", "type": null, "description": ""}, {"name": "num_buckets", "type": null, "description": ""}], "created_at": 1789422566.9052858, "supported_languages": null}, "macro.dbt_utils.get_relations_by_prefix": {"name": "get_relations_by_prefix", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_relations_by_prefix.sql", "original_file_path": "macros/sql/get_relations_by_prefix.sql", "unique_id": "macro.dbt_utils.get_relations_by_prefix", "macro_sql": "{% macro get_relations_by_prefix(schema, prefix, exclude='', database=target.database) %}\n {{ return(adapter.dispatch('get_relations_by_prefix', 'dbt_utils')(schema, prefix, exclude, database)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__get_relations_by_prefix"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "schema", "type": null, "description": ""}, {"name": "prefix", "type": null, "description": ""}, {"name": "exclude", "type": null, "description": ""}, {"name": "database", "type": null, "description": ""}], "created_at": 1789422566.9062462, "supported_languages": null}, "macro.dbt_utils.default__get_relations_by_prefix": {"name": "default__get_relations_by_prefix", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_relations_by_prefix.sql", "original_file_path": "macros/sql/get_relations_by_prefix.sql", "unique_id": "macro.dbt_utils.default__get_relations_by_prefix", "macro_sql": "{% macro default__get_relations_by_prefix(schema, prefix, exclude='', database=target.database) %}\n\n {%- call statement('get_tables', fetch_result=True) %}\n\n {{ dbt_utils.get_tables_by_prefix_sql(schema, prefix, exclude, database) }}\n\n {%- endcall -%}\n\n {%- set table_list = load_result('get_tables') -%}\n\n {%- if table_list and table_list['table'] -%}\n {%- set tbl_relations = [] -%}\n {%- for row in table_list['table'] -%}\n {%- set tbl_relation = api.Relation.create(\n database=database,\n schema=row.table_schema,\n identifier=row.table_name,\n type=row.table_type\n ) -%}\n {%- do tbl_relations.append(tbl_relation) -%}\n {%- endfor -%}\n\n {{ return(tbl_relations) }}\n {%- else -%}\n {{ return([]) }}\n {%- endif -%}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement", "macro.dbt_utils.get_tables_by_prefix_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "schema", "type": null, "description": ""}, {"name": "prefix", "type": null, "description": ""}, {"name": "exclude", "type": null, "description": ""}, {"name": "database", "type": null, "description": ""}], "created_at": 1789422566.9079988, "supported_languages": null}, "macro.dbt_utils.safe_divide": {"name": "safe_divide", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/safe_divide.sql", "original_file_path": "macros/sql/safe_divide.sql", "unique_id": "macro.dbt_utils.safe_divide", "macro_sql": "{% macro safe_divide(numerator, denominator) -%}\n {{ return(adapter.dispatch('safe_divide', 'dbt_utils')(numerator, denominator)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__safe_divide"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "numerator", "type": null, "description": ""}, {"name": "denominator", "type": null, "description": ""}], "created_at": 1789422566.9086, "supported_languages": null}, "macro.dbt_utils.default__safe_divide": {"name": "default__safe_divide", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/safe_divide.sql", "original_file_path": "macros/sql/safe_divide.sql", "unique_id": "macro.dbt_utils.default__safe_divide", "macro_sql": "{% macro default__safe_divide(numerator, denominator) %}\n ( {{ numerator }} ) / nullif( ( {{ denominator }} ), 0)\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "numerator", "type": null, "description": ""}, {"name": "denominator", "type": null, "description": ""}], "created_at": 1789422566.9088984, "supported_languages": null}, "macro.dbt_utils.safe_add": {"name": "safe_add", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/safe_add.sql", "original_file_path": "macros/sql/safe_add.sql", "unique_id": "macro.dbt_utils.safe_add", "macro_sql": "{%- macro safe_add(field_list) -%}\n {{ return(adapter.dispatch('safe_add', 'dbt_utils')(field_list)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__safe_add"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field_list", "type": null, "description": ""}], "created_at": 1789422566.9095612, "supported_languages": null}, "macro.dbt_utils.default__safe_add": {"name": "default__safe_add", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/safe_add.sql", "original_file_path": "macros/sql/safe_add.sql", "unique_id": "macro.dbt_utils.default__safe_add", "macro_sql": "\n\n{%- macro default__safe_add(field_list) -%}\n\n{%- if field_list is not iterable or field_list is string or field_list is mapping -%}\n\n{%- set error_message = '\nWarning: the `safe_add` macro now takes a single list argument instead of \\\nstring arguments. The {}.{} model triggered this warning. \\\n'.format(model.package_name, model.name) -%}\n\n{%- do exceptions.warn(error_message) -%}\n\n{%- endif -%}\n\n{% set fields = [] %}\n\n{%- for field in field_list -%}\n\n {% do fields.append(\"coalesce(\" ~ field ~ \", 0)\") %}\n\n{%- endfor -%}\n\n{{ fields|join(' +\\n ') }}\n\n{%- endmacro -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field_list", "type": null, "description": ""}], "created_at": 1789422566.9106946, "supported_languages": null}, "macro.dbt_utils.group_by": {"name": "group_by", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/groupby.sql", "original_file_path": "macros/sql/groupby.sql", "unique_id": "macro.dbt_utils.group_by", "macro_sql": "{%- macro group_by(n) -%}\n {{ return(adapter.dispatch('group_by', 'dbt_utils')(n)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__group_by"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "n", "type": null, "description": ""}], "created_at": 1789422566.9112496, "supported_languages": null}, "macro.dbt_utils.default__group_by": {"name": "default__group_by", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/groupby.sql", "original_file_path": "macros/sql/groupby.sql", "unique_id": "macro.dbt_utils.default__group_by", "macro_sql": "\n\n{%- macro default__group_by(n) -%}\n\n group by {% for i in range(1, n + 1) -%}\n {{ i }}{{ ',' if not loop.last }} \n {%- endfor -%}\n\n{%- endmacro -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "n", "type": null, "description": ""}], "created_at": 1789422566.9117882, "supported_languages": null}, "macro.iterable.iterable_lookback": {"name": "iterable_lookback", "resource_type": "macro", "package_name": "iterable", "path": "macros/iterable_lookback.sql", "original_file_path": "macros/iterable_lookback.sql", "unique_id": "macro.iterable.iterable_lookback", "macro_sql": "{% macro iterable_lookback(from_date, datepart, interval, safety_date='2020-01-01') %}\n\n{{ adapter.dispatch('iterable_lookback', 'iterable') (from_date, datepart, interval, safety_date='2020-01-01') }}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.iterable.default__iterable_lookback"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "from_date", "type": null, "description": ""}, {"name": "datepart", "type": null, "description": ""}, {"name": "interval", "type": null, "description": ""}, {"name": "safety_date", "type": null, "description": ""}], "created_at": 1789422566.9125977, "supported_languages": null}, "macro.iterable.default__iterable_lookback": {"name": "default__iterable_lookback", "resource_type": "macro", "package_name": "iterable", "path": "macros/iterable_lookback.sql", "original_file_path": "macros/iterable_lookback.sql", "unique_id": "macro.iterable.default__iterable_lookback", "macro_sql": "{% macro default__iterable_lookback(from_date, datepart, interval, safety_date='2020-01-01') %}\n\n {% set sql_statement %}\n select coalesce({{ from_date }}, {{ \"'\" ~ safety_date ~ \"'\" }})\n from {{ this }}\n {%- endset -%}\n\n {%- set result = dbt_utils.get_single_value(sql_statement) %}\n\n {{ dbt.dateadd(datepart=datepart, interval=-interval, from_date_or_timestamp=\"cast('\" ~ result ~ \"' as date)\") }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.get_single_value", "macro.dbt.dateadd"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "from_date", "type": null, "description": ""}, {"name": "datepart", "type": null, "description": ""}, {"name": "interval", "type": null, "description": ""}, {"name": "safety_date", "type": null, "description": ""}], "created_at": 1789422566.913653, "supported_languages": null}, "macro.iterable.get_campaign_list_history_columns": {"name": "get_campaign_list_history_columns", "resource_type": "macro", "package_name": "iterable", "path": "macros/staging/get_campaign_list_history_columns.sql", "original_file_path": "macros/staging/get_campaign_list_history_columns.sql", "unique_id": "macro.iterable.get_campaign_list_history_columns", "macro_sql": "{% macro get_campaign_list_history_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"campaign_id\", \"datatype\": dbt.type_int()},\n {\"name\": \"list_id\", \"datatype\": dbt.type_int()},\n {\"name\": \"updated_at\", \"datatype\": dbt.type_timestamp()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.type_timestamp", "macro.dbt.type_int"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789422566.9148285, "supported_languages": null}, "macro.iterable.get_list_columns": {"name": "get_list_columns", "resource_type": "macro", "package_name": "iterable", "path": "macros/staging/get_list_columns.sql", "original_file_path": "macros/staging/get_list_columns.sql", "unique_id": "macro.iterable.get_list_columns", "macro_sql": "{% macro get_list_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_deleted\", \"datatype\": \"boolean\"},\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"created_at\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"id\", \"datatype\": dbt.type_int()},\n {\"name\": \"list_type\", \"datatype\": dbt.type_string()},\n {\"name\": \"description\", \"datatype\": dbt.type_string()},\n {\"name\": \"name\", \"datatype\": dbt.type_string()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.type_timestamp", "macro.dbt.type_int", "macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789422566.9165046, "supported_languages": null}, "macro.iterable.get_campaign_history_columns": {"name": "get_campaign_history_columns", "resource_type": "macro", "package_name": "iterable", "path": "macros/staging/get_campaign_history_columns.sql", "original_file_path": "macros/staging/get_campaign_history_columns.sql", "unique_id": "macro.iterable.get_campaign_history_columns", "macro_sql": "{% macro get_campaign_history_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"campaign_state\", \"datatype\": dbt.type_string()},\n {\"name\": \"created_at\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"created_by_user_id\", \"datatype\": dbt.type_string()},\n {\"name\": \"updated_by_user_id\", \"datatype\": dbt.type_string()},\n {\"name\": \"ended_at\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"id\", \"datatype\": dbt.type_int()},\n {\"name\": \"name\", \"datatype\": dbt.type_string()},\n {\"name\": \"recurring_campaign_id\", \"datatype\": dbt.type_int()},\n {\"name\": \"send_size\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"start_at\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"template_id\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"type\", \"datatype\": dbt.type_string()},\n {\"name\": \"updated_at\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"workflow_id\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"message_medium\", \"datatype\": dbt.type_string()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.type_timestamp", "macro.dbt.type_string", "macro.dbt.type_int", "macro.dbt.type_numeric"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789422566.9197512, "supported_languages": null}, "macro.iterable.get_event_columns": {"name": "get_event_columns", "resource_type": "macro", "package_name": "iterable", "path": "macros/staging/get_event_columns.sql", "original_file_path": "macros/staging/get_event_columns.sql", "unique_id": "macro.iterable.get_event_columns", "macro_sql": "{% macro get_event_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_id\", \"datatype\": dbt.type_string()},\n {\"name\": \"_fivetran_user_id\", \"datatype\": dbt.type_string()},\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"campaign_id\", \"datatype\": dbt.type_int()},\n {\"name\": \"content_id\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"created_at\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"email\", \"datatype\": dbt.type_string()},\n {\"name\": \"event_name\", \"datatype\": dbt.type_string()},\n {\"name\": \"message_bus_id\", \"datatype\": dbt.type_string()},\n {\"name\": \"message_id\", \"datatype\": dbt.type_string()},\n {\"name\": \"message_type_id\", \"datatype\": dbt.type_int()},\n {\"name\": \"recipient_state\", \"datatype\": dbt.type_string()},\n {\"name\": \"status\", \"datatype\": dbt.type_string()},\n {\"name\": \"unsub_source\", \"datatype\": dbt.type_string()},\n {\"name\": \"user_agent\", \"datatype\": dbt.type_string()},\n {\"name\": \"user_agent_device\", \"datatype\": dbt.type_string()},\n {\"name\": \"transactional_data\", \"datatype\": dbt.type_string()},\n {\"name\": \"additional_properties\", \"datatype\": dbt.type_string()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.type_string", "macro.dbt.type_timestamp", "macro.dbt.type_int", "macro.dbt.type_numeric"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789422566.923343, "supported_languages": null}, "macro.iterable.get_event_extension_columns": {"name": "get_event_extension_columns", "resource_type": "macro", "package_name": "iterable", "path": "macros/staging/get_event_extension_columns.sql", "original_file_path": "macros/staging/get_event_extension_columns.sql", "unique_id": "macro.iterable.get_event_extension_columns", "macro_sql": "{% macro get_event_extension_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_id\", \"datatype\": dbt.type_string()},\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"app_already_running\", \"datatype\": \"boolean\"},\n {\"name\": \"badge\", \"datatype\": dbt.type_string()},\n {\"name\": \"catalog_collection_count\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"catalog_lookup_count\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"canonical_url_id\", \"datatype\": dbt.type_string()},\n {\"name\": \"content_available\", \"datatype\": \"boolean\"},\n {\"name\": \"content_id\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"device\", \"datatype\": dbt.type_string()},\n {\"name\": \"email_id\", \"datatype\": dbt.type_string()},\n {\"name\": \"email_subject\", \"datatype\": dbt.type_string()},\n {\"name\": \"experiment_id\", \"datatype\": dbt.type_string()},\n {\"name\": \"from_phone_number_id\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"from_smssender_id\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"link_id\", \"datatype\": dbt.type_string()},\n {\"name\": \"link_url\", \"datatype\": dbt.type_string()},\n {\"name\": \"locale\", \"datatype\": dbt.type_string()},\n {\"name\": \"payload\", \"datatype\": dbt.type_string()},\n {\"name\": \"platform_endpoint\", \"datatype\": dbt.type_string()},\n {\"name\": \"push_message\", \"datatype\": dbt.type_string()},\n {\"name\": \"region\", \"datatype\": dbt.type_string()},\n {\"name\": \"sms_message\", \"datatype\": dbt.type_string()},\n {\"name\": \"to_phone_number\", \"datatype\": dbt.type_string()},\n {\"name\": \"url\", \"datatype\": dbt.type_string()},\n {\"name\": \"workflow_id\", \"datatype\": dbt.type_string()},\n {\"name\": \"workflow_name\", \"datatype\": dbt.type_string()},\n {\"name\": \"city\", \"datatype\": dbt.type_string()},\n {\"name\": \"clicked_url\", \"datatype\": dbt.type_string()},\n {\"name\": \"country\", \"datatype\": dbt.type_string()},\n {\"name\": \"error_code\", \"datatype\": dbt.type_string()},\n {\"name\": \"expires_at\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"from_phone_number\", \"datatype\": dbt.type_string()},\n {\"name\": \"in_app_body\", \"datatype\": dbt.type_string()},\n {\"name\": \"is_sms_estimation\", \"datatype\": \"boolean\"},\n {\"name\": \"labels\", \"datatype\": dbt.type_string()},\n {\"name\": \"message_status\", \"datatype\": dbt.type_string()},\n {\"name\": \"mms_send_count\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"reason\", \"datatype\": dbt.type_string()},\n {\"name\": \"sms_send_count\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"_fivetran_user_id\", \"datatype\": dbt.type_string()}\n] %}\n\n{{ fivetran_utils.add_pass_through_columns(columns, var('iterable_event_extension_pass_through_columns')) }}\n\n{{ return(columns) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.type_string", "macro.dbt.type_timestamp", "macro.dbt.type_numeric", "macro.fivetran_utils.add_pass_through_columns"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789422566.9312851, "supported_languages": null}, "macro.iterable.get_campaign_label_history_columns": {"name": "get_campaign_label_history_columns", "resource_type": "macro", "package_name": "iterable", "path": "macros/staging/get_campaign_label_history_columns.sql", "original_file_path": "macros/staging/get_campaign_label_history_columns.sql", "unique_id": "macro.iterable.get_campaign_label_history_columns", "macro_sql": "{% macro get_campaign_label_history_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"campaign_id\", \"datatype\": dbt.type_int()},\n {\"name\": \"label\", \"datatype\": dbt.type_string()},\n {\"name\": \"updated_at\", \"datatype\": dbt.type_timestamp()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.type_timestamp", "macro.dbt.type_int", "macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789422566.9326022, "supported_languages": null}, "macro.iterable.get_template_history_columns": {"name": "get_template_history_columns", "resource_type": "macro", "package_name": "iterable", "path": "macros/staging/get_template_history_columns.sql", "original_file_path": "macros/staging/get_template_history_columns.sql", "unique_id": "macro.iterable.get_template_history_columns", "macro_sql": "{% macro get_template_history_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"client_template_id\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"created_at\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"creator_user_id\", \"datatype\": dbt.type_string()},\n {\"name\": \"id\", \"datatype\": dbt.type_int()},\n {\"name\": \"message_type_id\", \"datatype\": dbt.type_int()},\n {\"name\": \"name\", \"datatype\": dbt.type_string()},\n {\"name\": \"template_type\", \"datatype\": dbt.type_string()},\n {\"name\": \"updated_at\", \"datatype\": dbt.type_timestamp()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.type_timestamp", "macro.dbt.type_numeric", "macro.dbt.type_string", "macro.dbt.type_int"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789422566.9346886, "supported_languages": null}, "macro.iterable.get_journey_columns": {"name": "get_journey_columns", "resource_type": "macro", "package_name": "iterable", "path": "macros/staging/get_journey_columns.sql", "original_file_path": "macros/staging/get_journey_columns.sql", "unique_id": "macro.iterable.get_journey_columns", "macro_sql": "{% macro get_journey_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_deleted\", \"datatype\": \"boolean\"},\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"created_at\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"creator_user_id\", \"datatype\": dbt.type_string()},\n {\"name\": \"description\", \"datatype\": dbt.type_string()},\n {\"name\": \"enabled\", \"datatype\": \"boolean\"},\n {\"name\": \"id\", \"datatype\": dbt.type_int()},\n {\"name\": \"is_archived\", \"datatype\": \"boolean\"},\n {\"name\": \"journey_type\", \"datatype\": dbt.type_string()},\n {\"name\": \"lifetime_limit\", \"datatype\": dbt.type_int()},\n {\"name\": \"name\", \"datatype\": dbt.type_string()},\n {\"name\": \"simultaneous_limit\", \"datatype\": dbt.type_int()},\n {\"name\": \"start_tile_id\", \"datatype\": dbt.type_int()},\n {\"name\": \"trigger_event_names\", \"datatype\": dbt.type_string()},\n {\"name\": \"updated_at\", \"datatype\": dbt.type_timestamp()}\n] %}\n\n{{ fivetran_utils.add_pass_through_columns(columns, var('iterable_journey_pass_through_columns')) }}\n\n{{ return(columns) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.type_timestamp", "macro.dbt.type_string", "macro.dbt.type_int", "macro.fivetran_utils.add_pass_through_columns"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789422566.9379141, "supported_languages": null}, "macro.iterable.get_list_user_columns": {"name": "get_list_user_columns", "resource_type": "macro", "package_name": "iterable", "path": "macros/staging/get_list_user_columns.sql", "original_file_path": "macros/staging/get_list_user_columns.sql", "unique_id": "macro.iterable.get_list_user_columns", "macro_sql": "{% macro get_list_user_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_id\", \"datatype\": dbt.type_string()},\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"index\", \"datatype\": dbt.type_int()},\n {\"name\": \"list_id\", \"datatype\": dbt.type_int()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.type_string", "macro.dbt.type_timestamp", "macro.dbt.type_int"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789422566.9391432, "supported_languages": null}, "macro.iterable.json_to_string": {"name": "json_to_string", "resource_type": "macro", "package_name": "iterable", "path": "macros/staging/json_to_string.sql", "original_file_path": "macros/staging/json_to_string.sql", "unique_id": "macro.iterable.json_to_string", "macro_sql": "{%- macro json_to_string(column, column_list) -%}\n {{ return(adapter.dispatch('json_to_string', 'iterable')(column, column_list)) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.iterable.default__json_to_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "column", "type": null, "description": ""}, {"name": "column_list", "type": null, "description": ""}], "created_at": 1789422566.9399734, "supported_languages": null}, "macro.iterable.default__json_to_string": {"name": "default__json_to_string", "resource_type": "macro", "package_name": "iterable", "path": "macros/staging/json_to_string.sql", "original_file_path": "macros/staging/json_to_string.sql", "unique_id": "macro.iterable.default__json_to_string", "macro_sql": "{%- macro default__json_to_string(column, column_list) -%}\n cast({{ column }} as {{ dbt.type_string() }})\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "column", "type": null, "description": ""}, {"name": "column_list", "type": null, "description": ""}], "created_at": 1789422566.9403088, "supported_languages": null}, "macro.iterable.bigquery__json_to_string": {"name": "bigquery__json_to_string", "resource_type": "macro", "package_name": "iterable", "path": "macros/staging/json_to_string.sql", "original_file_path": "macros/staging/json_to_string.sql", "unique_id": "macro.iterable.bigquery__json_to_string", "macro_sql": "{%- macro bigquery__json_to_string(column, column_list) -%}\n {%- set columns = column_list -%}\n {%- set ns = namespace(column_type='string') -%}\n\n {%- for col in columns -%}\n {%- if col.name|lower == column|lower -%}\n {%- set ns.column_type = col.dtype|lower -%}\n {%- endif -%}\n {%- endfor -%}\n\n {%- if ns.column_type == 'json' -%}\n to_json_string({{ column }})\n {%- else -%}\n cast({{ column }} as {{ dbt.type_string() }})\n {%- endif -%}\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "column", "type": null, "description": ""}, {"name": "column_list", "type": null, "description": ""}], "created_at": 1789422566.941584, "supported_languages": null}, "macro.iterable.get_user_unsubscribed_message_type_columns": {"name": "get_user_unsubscribed_message_type_columns", "resource_type": "macro", "package_name": "iterable", "path": "macros/staging/get_user_unsubscribed_message_type_columns.sql", "original_file_path": "macros/staging/get_user_unsubscribed_message_type_columns.sql", "unique_id": "macro.iterable.get_user_unsubscribed_message_type_columns", "macro_sql": "{% macro get_user_unsubscribed_message_type_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"_fivetran_id\", \"datatype\": dbt.type_string()},\n {\"name\": \"message_type_id\", \"datatype\": dbt.type_string()},\n {\"name\": \"email\", \"datatype\": dbt.type_string()},\n {\"name\": \"updated_at\", \"datatype\": dbt.type_timestamp()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.type_timestamp", "macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789422566.9429448, "supported_languages": null}, "macro.iterable.does_table_exist": {"name": "does_table_exist", "resource_type": "macro", "package_name": "iterable", "path": "macros/staging/does_table_exist.sql", "original_file_path": "macros/staging/does_table_exist.sql", "unique_id": "macro.iterable.does_table_exist", "macro_sql": "{%- macro does_table_exist(table_name) -%}\n {%- if execute -%} -- returns true when dbt is in execute mode\n {%- set ns = namespace(has_table=false) -%} -- declare boolean namespace and default value \n {%- for node in graph.sources.values() -%} -- grab sources from the dictionary of nodes \n -- call the database for the matching table\n {%- if node.name | lower == table_name | lower -%} \n {%- set source_relation = adapter.get_relation(\n database=node.database,\n schema=node.schema,\n identifier=node.identifier ) -%}\n {% endif %}\n {%- if source_relation == None -%} \n {{ return(False) }} -- return false if relation identified by the database.schema.identifier does not exist for the given table name\n {% endif %}\n {%- endfor -%}\n {{ return(True) }}\n {%- endif -%} \n{%- endmacro -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "table_name", "type": null, "description": ""}], "created_at": 1789422566.9444804, "supported_languages": null}, "macro.iterable.get_user_history_columns": {"name": "get_user_history_columns", "resource_type": "macro", "package_name": "iterable", "path": "macros/staging/get_user_history_columns.sql", "original_file_path": "macros/staging/get_user_history_columns.sql", "unique_id": "macro.iterable.get_user_history_columns", "macro_sql": "{% macro get_user_history_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_id\", \"datatype\": dbt.type_string()},\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"email\", \"datatype\": dbt.type_string()},\n {\"name\": \"email_list_ids\", \"datatype\": dbt.type_string()},\n {\"name\": \"first_name\", \"datatype\": dbt.type_string()},\n {\"name\": \"last_name\", \"datatype\": dbt.type_string()},\n {\"name\": \"phone_number\", \"datatype\": dbt.type_string()},\n {\"name\": \"signup_date\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"signup_source\", \"datatype\": dbt.type_string()},\n {\"name\": \"updated_at\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"user_id\", \"datatype\": dbt.type_string()},\n {\"name\": \"iterable_user_id\", \"datatype\": dbt.type_string()}\n\n] %}\n\n{{ fivetran_utils.add_pass_through_columns(columns, var('iterable_user_history_pass_through_columns')) }}\n\n{{ return(columns) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.type_string", "macro.dbt.type_timestamp", "macro.fivetran_utils.add_pass_through_columns"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789422566.9473164, "supported_languages": null}, "macro.iterable.get_campaign_suppression_list_history_columns": {"name": "get_campaign_suppression_list_history_columns", "resource_type": "macro", "package_name": "iterable", "path": "macros/staging/get_campaign_suppression_list_history_columns.sql", "original_file_path": "macros/staging/get_campaign_suppression_list_history_columns.sql", "unique_id": "macro.iterable.get_campaign_suppression_list_history_columns", "macro_sql": "{% macro get_campaign_suppression_list_history_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"campaign_id\", \"datatype\": dbt.type_int()},\n {\"name\": \"suppressed_list_id\", \"datatype\": dbt.type_int()},\n {\"name\": \"updated_at\", \"datatype\": dbt.type_timestamp()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.type_timestamp", "macro.dbt.type_int"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789422566.9485075, "supported_languages": null}, "macro.iterable.get_user_unsubscribed_channel_columns": {"name": "get_user_unsubscribed_channel_columns", "resource_type": "macro", "package_name": "iterable", "path": "macros/staging/get_user_unsubscribed_channel_columns.sql", "original_file_path": "macros/staging/get_user_unsubscribed_channel_columns.sql", "unique_id": "macro.iterable.get_user_unsubscribed_channel_columns", "macro_sql": "{% macro get_user_unsubscribed_channel_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"_fivetran_id\", \"datatype\": dbt.type_string()},\n {\"name\": \"channel_id\", \"datatype\": dbt.type_int()},\n {\"name\": \"email\", \"datatype\": dbt.type_string()},\n {\"name\": \"updated_at\", \"datatype\": dbt.type_timestamp()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.type_timestamp", "macro.dbt.type_string", "macro.dbt.type_int"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789422566.9498982, "supported_languages": null}, "macro.iterable.get_message_type_columns": {"name": "get_message_type_columns", "resource_type": "macro", "package_name": "iterable", "path": "macros/staging/get_message_type_columns.sql", "original_file_path": "macros/staging/get_message_type_columns.sql", "unique_id": "macro.iterable.get_message_type_columns", "macro_sql": "{% macro get_message_type_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_deleted\", \"datatype\": \"boolean\"},\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"channel_id\", \"datatype\": dbt.type_int()},\n {\"name\": \"id\", \"datatype\": dbt.type_int()},\n {\"name\": \"name\", \"datatype\": dbt.type_string()},\n {\"name\": \"created_at\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"frequency_cap\", \"datatype\": dbt.type_string()},\n {\"name\": \"rate_limit_per_minute\", \"datatype\": dbt.type_string()},\n {\"name\": \"subscription_policy\", \"datatype\": dbt.type_string()},\n {\"name\": \"updated_at\", \"datatype\": dbt.type_timestamp()},\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.type_timestamp", "macro.dbt.type_int", "macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789422566.952249, "supported_languages": null}, "macro.iterable.get_channel_columns": {"name": "get_channel_columns", "resource_type": "macro", "package_name": "iterable", "path": "macros/staging/get_channel_columns.sql", "original_file_path": "macros/staging/get_channel_columns.sql", "unique_id": "macro.iterable.get_channel_columns", "macro_sql": "{% macro get_channel_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_deleted\", \"datatype\": \"boolean\"},\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"channel_type\", \"datatype\": dbt.type_string()},\n {\"name\": \"id\", \"datatype\": dbt.type_int()},\n {\"name\": \"message_medium\", \"datatype\": dbt.type_string()},\n {\"name\": \"name\", \"datatype\": dbt.type_string()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.type_timestamp", "macro.dbt.type_string", "macro.dbt.type_int"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789422566.9537706, "supported_languages": null}, "macro.fivetran_utils.enabled_vars_one_true": {"name": "enabled_vars_one_true", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/enabled_vars_one_true.sql", "original_file_path": "macros/enabled_vars_one_true.sql", "unique_id": "macro.fivetran_utils.enabled_vars_one_true", "macro_sql": "{% macro enabled_vars_one_true(vars) %}\n\n{% for v in vars %}\n \n {% if var(v, False) == True %}\n {{ return(True) }}\n {% endif %}\n\n{% endfor %}\n\n{{ return(False) }}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "vars", "type": null, "description": ""}], "created_at": 1789422566.9545958, "supported_languages": null}, "macro.fivetran_utils.json_parse": {"name": "json_parse", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/json_parse.sql", "original_file_path": "macros/json_parse.sql", "unique_id": "macro.fivetran_utils.json_parse", "macro_sql": "{% macro json_parse(string, string_path) -%}\n\n{{ adapter.dispatch('json_parse', 'fivetran_utils') (string, string_path) }}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.postgres__json_parse"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "string", "type": null, "description": ""}, {"name": "string_path", "type": null, "description": ""}], "created_at": 1789422566.9558837, "supported_languages": null}, "macro.fivetran_utils.default__json_parse": {"name": "default__json_parse", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/json_parse.sql", "original_file_path": "macros/json_parse.sql", "unique_id": "macro.fivetran_utils.default__json_parse", "macro_sql": "{% macro default__json_parse(string, string_path) %}\n\n json_extract_path_text({{string}}, {%- for s in string_path -%}'{{ s }}'{%- if not loop.last -%},{%- endif -%}{%- endfor -%} )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "string", "type": null, "description": ""}, {"name": "string_path", "type": null, "description": ""}], "created_at": 1789422566.9563992, "supported_languages": null}, "macro.fivetran_utils.redshift__json_parse": {"name": "redshift__json_parse", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/json_parse.sql", "original_file_path": "macros/json_parse.sql", "unique_id": "macro.fivetran_utils.redshift__json_parse", "macro_sql": "{% macro redshift__json_parse(string, string_path) %}\n\n json_extract_path_text({{string}}, {%- for s in string_path -%}'{{ s }}'{%- if not loop.last -%},{%- endif -%}{%- endfor -%} )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "string", "type": null, "description": ""}, {"name": "string_path", "type": null, "description": ""}], "created_at": 1789422566.9569306, "supported_languages": null}, "macro.fivetran_utils.bigquery__json_parse": {"name": "bigquery__json_parse", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/json_parse.sql", "original_file_path": "macros/json_parse.sql", "unique_id": "macro.fivetran_utils.bigquery__json_parse", "macro_sql": "{% macro bigquery__json_parse(string, string_path) %}\n\n \n json_extract_scalar({{string}}, '$.{%- for s in string_path -%}{{ s }}{%- if not loop.last -%}.{%- endif -%}{%- endfor -%} ')\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "string", "type": null, "description": ""}, {"name": "string_path", "type": null, "description": ""}], "created_at": 1789422566.9574234, "supported_languages": null}, "macro.fivetran_utils.postgres__json_parse": {"name": "postgres__json_parse", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/json_parse.sql", "original_file_path": "macros/json_parse.sql", "unique_id": "macro.fivetran_utils.postgres__json_parse", "macro_sql": "{% macro postgres__json_parse(string, string_path) %}\n\n {{string}}::json #>> '{ {%- for s in string_path -%}{{ s }}{%- if not loop.last -%},{%- endif -%}{%- endfor -%} }'\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "string", "type": null, "description": ""}, {"name": "string_path", "type": null, "description": ""}], "created_at": 1789422566.957953, "supported_languages": null}, "macro.fivetran_utils.snowflake__json_parse": {"name": "snowflake__json_parse", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/json_parse.sql", "original_file_path": "macros/json_parse.sql", "unique_id": "macro.fivetran_utils.snowflake__json_parse", "macro_sql": "{% macro snowflake__json_parse(string, string_path) %}\n\n parse_json( {{string}} ) {%- for s in string_path -%}{% if s is number %}[{{ s }}]{% else %}['{{ s }}']{% endif %}{%- endfor -%}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "string", "type": null, "description": ""}, {"name": "string_path", "type": null, "description": ""}], "created_at": 1789422566.9584985, "supported_languages": null}, "macro.fivetran_utils.spark__json_parse": {"name": "spark__json_parse", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/json_parse.sql", "original_file_path": "macros/json_parse.sql", "unique_id": "macro.fivetran_utils.spark__json_parse", "macro_sql": "{% macro spark__json_parse(string, string_path) %}\n\n {{string}} : {%- for s in string_path -%}{% if s is number %}[{{ s }}]{% else %}['{{ s }}']{% endif %}{%- endfor -%}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "string", "type": null, "description": ""}, {"name": "string_path", "type": null, "description": ""}], "created_at": 1789422566.9590635, "supported_languages": null}, "macro.fivetran_utils.sqlserver__json_parse": {"name": "sqlserver__json_parse", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/json_parse.sql", "original_file_path": "macros/json_parse.sql", "unique_id": "macro.fivetran_utils.sqlserver__json_parse", "macro_sql": "{% macro sqlserver__json_parse(string, string_path) %}\n\n json_value({{string}}, '$.{%- for s in string_path -%}{{ s }}{%- if not loop.last -%}.{%- endif -%}{%- endfor -%} ')\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "string", "type": null, "description": ""}, {"name": "string_path", "type": null, "description": ""}], "created_at": 1789422566.959562, "supported_languages": null}, "macro.fivetran_utils.duckdb__json_parse": {"name": "duckdb__json_parse", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/json_parse.sql", "original_file_path": "macros/json_parse.sql", "unique_id": "macro.fivetran_utils.duckdb__json_parse", "macro_sql": "{% macro duckdb__json_parse(string, string_path) %}\n\n json_extract_string({{string}}, '${%- for s in string_path -%}{% if s is number %}[{{ s }}]{% else %}.{{ s }}{% endif %}{%- endfor -%}')\n \n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "string", "type": null, "description": ""}, {"name": "string_path", "type": null, "description": ""}], "created_at": 1789422566.9601202, "supported_languages": null}, "macro.fivetran_utils.union_relations_custom": {"name": "union_relations_custom", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/union_relations_custom.sql", "original_file_path": "macros/union_relations_custom.sql", "unique_id": "macro.fivetran_utils.union_relations_custom", "macro_sql": "{%- macro union_relations_custom(relations, aliases=none, column_override=none, include=[], exclude=[], source_column_name='_dbt_source_relation', where=none) -%}\n {{ return(adapter.dispatch('union_relations_custom', 'fivetran_utils')(relations, aliases, column_override, include, exclude, source_column_name, where)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.default__union_relations_custom"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relations", "type": null, "description": ""}, {"name": "aliases", "type": null, "description": ""}, {"name": "column_override", "type": null, "description": ""}, {"name": "include", "type": null, "description": ""}, {"name": "exclude", "type": null, "description": ""}, {"name": "source_column_name", "type": null, "description": ""}, {"name": "where", "type": null, "description": ""}], "created_at": 1789422566.962282, "supported_languages": null}, "macro.fivetran_utils.default__union_relations_custom": {"name": "default__union_relations_custom", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/union_relations_custom.sql", "original_file_path": "macros/union_relations_custom.sql", "unique_id": "macro.fivetran_utils.default__union_relations_custom", "macro_sql": "\n\n{%- macro default__union_relations_custom(relations, aliases=none, column_override=none, include=[], exclude=[], source_column_name='_dbt_source_relation', where=none) -%}\n\n {%- if exclude and include -%}\n {{ exceptions.raise_compiler_error(\"Both an exclude and include list were provided to the `union` macro. Only one is allowed\") }}\n {%- endif -%}\n\n {#-- Prevent querying of db in parsing mode. This works because this macro does not create any new refs. -#}\n {%- if not execute %}\n {{ return('') }}\n {% endif -%}\n\n {%- set column_override = column_override if column_override is not none else {} -%}\n\n {%- set relation_columns = {} -%}\n {%- set column_superset = {} -%}\n {%- set all_excludes = [] -%}\n {%- set all_includes = [] -%}\n\n {%- if exclude -%}\n {%- for exc in exclude -%}\n {%- do all_excludes.append(exc | lower) -%}\n {%- endfor -%}\n {%- endif -%}\n\n {%- if include -%}\n {%- for inc in include -%}\n {%- do all_includes.append(inc | lower) -%}\n {%- endfor -%}\n {%- endif -%}\n\n {%- for relation in relations -%}\n\n {%- do relation_columns.update({relation: []}) -%}\n\n {%- do dbt_utils._is_relation(relation, 'union_relations_custom') -%}\n {%- do dbt_utils._is_ephemeral(relation, 'union_relations_custom') -%}\n {%- set cols = adapter.get_columns_in_relation(relation) -%}\n {%- for col in cols -%}\n\n {#- If an exclude list was provided and the column is in the list, do nothing -#}\n {%- if exclude and col.column | lower in all_excludes -%}\n\n {#- If an include list was provided and the column is not in the list, do nothing -#}\n {%- elif include and col.column | lower not in all_includes -%}\n\n {#- Otherwise add the column to the column superset -#}\n {%- else -%}\n\n {#- update the list of columns in this relation -#}\n {%- do relation_columns[relation].append(col.column) -%}\n\n {%- if col.column in column_superset -%}\n\n {%- set stored = column_superset[col.column] -%}\n {%- if col.is_string() and stored.is_string() and col.string_size() > stored.string_size() -%}\n\n {%- do column_superset.update({col.column: col}) -%}\n\n {%- endif %}\n\n {%- else -%}\n\n {%- do column_superset.update({col.column: col}) -%}\n\n {%- endif -%}\n\n {%- endif -%}\n\n {%- endfor -%}\n {%- endfor -%}\n\n {%- set ordered_column_names = column_superset.keys() -%}\n {%- set dbt_command = flags.WHICH -%}\n\n\n {% if dbt_command in ['run', 'build'] %}\n {% if (include | length > 0 or exclude | length > 0) and not column_superset.keys() %}\n {%- set relations_string -%}\n {%- for relation in relations -%}\n {{ relation.name }}\n {%- if not loop.last %}, {% endif -%}\n {%- endfor -%}\n {%- endset -%}\n\n {%- set error_message -%}\n There were no columns found to union for relations {{ relations_string }}\n {%- endset -%}\n\n {{ exceptions.raise_compiler_error(error_message) }}\n {%- endif -%}\n {%- endif -%}\n\n {%- for relation in relations %}\n\n (\n select\n\n {%- if source_column_name is not none %}\n {# dbt_utils union_relations includes the table in the source_relation. For Fivetran dbt package purposes the table should not be included in the source relation. #}\n cast({{ dbt.string_literal(relation.database ~ '.' ~ relation.schema) }} as {{ dbt.type_string() }}) as {{ source_column_name }},\n {%- endif %}\n\n {% for col_name in ordered_column_names -%}\n\n {%- set col = column_superset[col_name] %}\n {%- set col_type = column_override.get(col.column, col.data_type) %}\n {%- set col_name = adapter.quote(col_name) if col_name in relation_columns[relation] else 'null' %}\n cast({{ col_name }} as {{ col_type }}) as {{ col.quoted }} {% if not loop.last %},{% endif -%}\n\n {%- endfor %}\n \n {# This alias is a change from dbt_utils union_relations code. Avoids errors if the table is named a reserved keyword #}\n from {{ aliases[loop.index0] if aliases else relation }} as unioned_relation_{{ loop.index }}\n\n {% if where -%}\n where {{ where }}\n {%- endif %}\n )\n\n {% if not loop.last -%}\n union all\n {% endif -%}\n\n {%- endfor -%}\n\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt_utils._is_relation", "macro.dbt_utils._is_ephemeral", "macro.dbt.string_literal", "macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relations", "type": null, "description": ""}, {"name": "aliases", "type": null, "description": ""}, {"name": "column_override", "type": null, "description": ""}, {"name": "include", "type": null, "description": ""}, {"name": "exclude", "type": null, "description": ""}, {"name": "source_column_name", "type": null, "description": ""}, {"name": "where", "type": null, "description": ""}], "created_at": 1789422566.96965, "supported_languages": null}, "macro.fivetran_utils.seed_data_helper": {"name": "seed_data_helper", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/seed_data_helper.sql", "original_file_path": "macros/seed_data_helper.sql", "unique_id": "macro.fivetran_utils.seed_data_helper", "macro_sql": "{% macro seed_data_helper(seed_name, warehouses) %}\n\n{% if target.type in warehouses %}\n {% for w in warehouses %}\n {% if target.type == w %}\n {{ return(ref(seed_name ~ \"_\" ~ w ~ \"\")) }}\n {% endif %}\n {% endfor %}\n{% else %}\n{{ return(ref(seed_name)) }}\n{% endif %}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "seed_name", "type": null, "description": ""}, {"name": "warehouses", "type": null, "description": ""}], "created_at": 1789422566.970872, "supported_languages": null}, "macro.fivetran_utils.drop_schemas_automation": {"name": "drop_schemas_automation", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/drop_schemas_automation.sql", "original_file_path": "macros/drop_schemas_automation.sql", "unique_id": "macro.fivetran_utils.drop_schemas_automation", "macro_sql": "{% macro drop_schemas_automation(drop_target_schema=true) %}\n {{ return(adapter.dispatch('drop_schemas_automation', 'fivetran_utils')(drop_target_schema)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.default__drop_schemas_automation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "drop_target_schema", "type": null, "description": ""}], "created_at": 1789422566.9718199, "supported_languages": null}, "macro.fivetran_utils.default__drop_schemas_automation": {"name": "default__drop_schemas_automation", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/drop_schemas_automation.sql", "original_file_path": "macros/drop_schemas_automation.sql", "unique_id": "macro.fivetran_utils.default__drop_schemas_automation", "macro_sql": "{% macro default__drop_schemas_automation(drop_target_schema=true) %}\n\n{% set fetch_list_sql %}\n {% if target.type not in ('databricks', 'spark') %}\n select schema_name\n from \n {{ wrap_in_quotes(target.database) }}.INFORMATION_SCHEMA.SCHEMATA\n where lower(schema_name) like '{{ target.schema | lower }}{%- if not drop_target_schema -%}_{%- endif -%}%'\n {% else %}\n SHOW SCHEMAS LIKE '{{ target.schema }}{%- if not drop_target_schema -%}_{%- endif -%}*'\n {% endif %}\n{% endset %}\n\n{% set results = run_query(fetch_list_sql) %}\n\n{% if execute %}\n {% set results_list = results.columns[0].values() %}\n{% else %}\n {% set results_list = [] %}\n{% endif %}\n\n{% for schema_to_drop in results_list %}\n {% do adapter.drop_schema(api.Relation.create(database=target.database, schema=schema_to_drop)) %}\n {{ print('Schema ' ~ schema_to_drop ~ ' successfully dropped from the ' ~ target.database ~ ' database.\\n')}}\n{% endfor %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.wrap_in_quotes", "macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "drop_target_schema", "type": null, "description": ""}], "created_at": 1789422566.973866, "supported_languages": null}, "macro.fivetran_utils.duckdb__drop_schemas_automation": {"name": "duckdb__drop_schemas_automation", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/drop_schemas_automation.sql", "original_file_path": "macros/drop_schemas_automation.sql", "unique_id": "macro.fivetran_utils.duckdb__drop_schemas_automation", "macro_sql": "{% macro duckdb__drop_schemas_automation(drop_target_schema=true) %}\n\n {{ print('Not dropping any schemas in DuckDB.\\n') }}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "drop_target_schema", "type": null, "description": ""}], "created_at": 1789422566.9741857, "supported_languages": null}, "macro.fivetran_utils.ceiling": {"name": "ceiling", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/ceiling.sql", "original_file_path": "macros/ceiling.sql", "unique_id": "macro.fivetran_utils.ceiling", "macro_sql": "{% macro ceiling(num) -%}\n\n{{ adapter.dispatch('ceiling', 'fivetran_utils') (num) }}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.default__ceiling"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "num", "type": null, "description": ""}], "created_at": 1789422566.974717, "supported_languages": null}, "macro.fivetran_utils.default__ceiling": {"name": "default__ceiling", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/ceiling.sql", "original_file_path": "macros/ceiling.sql", "unique_id": "macro.fivetran_utils.default__ceiling", "macro_sql": "{% macro default__ceiling(num) %}\n ceiling({{ num }})\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "num", "type": null, "description": ""}], "created_at": 1789422566.9749465, "supported_languages": null}, "macro.fivetran_utils.snowflake__ceiling": {"name": "snowflake__ceiling", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/ceiling.sql", "original_file_path": "macros/ceiling.sql", "unique_id": "macro.fivetran_utils.snowflake__ceiling", "macro_sql": "{% macro snowflake__ceiling(num) %}\n ceil({{ num }})\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "num", "type": null, "description": ""}], "created_at": 1789422566.9751635, "supported_languages": null}, "macro.fivetran_utils.fill_pass_through_columns": {"name": "fill_pass_through_columns", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/fill_pass_through_columns.sql", "original_file_path": "macros/fill_pass_through_columns.sql", "unique_id": "macro.fivetran_utils.fill_pass_through_columns", "macro_sql": "{% macro fill_pass_through_columns(pass_through_variable) %}\n\n{% if var(pass_through_variable) %}\n {% for field in var(pass_through_variable) %}\n {% if field is mapping %}\n {% if field.transform_sql %}\n , {{ field.transform_sql }} as {{ field.alias if field.alias else field.name }}\n {% else %}\n , {{ field.alias if field.alias else field.name }}\n {% endif %}\n {% else %}\n , {{ field }}\n {% endif %}\n {% endfor %}\n{% endif %}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "pass_through_variable", "type": null, "description": ""}], "created_at": 1789422566.976541, "supported_languages": null}, "macro.fivetran_utils.persist_pass_through_columns": {"name": "persist_pass_through_columns", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/persist_pass_through_columns.sql", "original_file_path": "macros/persist_pass_through_columns.sql", "unique_id": "macro.fivetran_utils.persist_pass_through_columns", "macro_sql": "{% macro persist_pass_through_columns(pass_through_variable, identifier=none, transform='') %}\n\n{% if var(pass_through_variable, none) %}\n {% for field in var(pass_through_variable) %}\n , {{ transform ~ '(' ~ (identifier ~ '.' if identifier else '') ~ (field.alias if field.alias else field.name) ~ ')' }} as {{ field.alias if field.alias else field.name }}\n {% endfor %}\n{% endif %}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "pass_through_variable", "type": null, "description": ""}, {"name": "identifier", "type": null, "description": ""}, {"name": "transform", "type": null, "description": ""}], "created_at": 1789422566.9778264, "supported_languages": null}, "macro.fivetran_utils.try_cast": {"name": "try_cast", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/try_cast.sql", "original_file_path": "macros/try_cast.sql", "unique_id": "macro.fivetran_utils.try_cast", "macro_sql": "{% macro try_cast(field, type) %}\n {{ adapter.dispatch('try_cast', 'fivetran_utils') (field, type) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.postgres__try_cast"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field", "type": null, "description": ""}, {"name": "type", "type": null, "description": ""}], "created_at": 1789422566.978827, "supported_languages": null}, "macro.fivetran_utils.default__try_cast": {"name": "default__try_cast", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/try_cast.sql", "original_file_path": "macros/try_cast.sql", "unique_id": "macro.fivetran_utils.default__try_cast", "macro_sql": "{% macro default__try_cast(field, type) %}\n {# most databases don't support this function yet\n so we just need to use cast #}\n cast({{field}} as {{type}})\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field", "type": null, "description": ""}, {"name": "type", "type": null, "description": ""}], "created_at": 1789422566.9791296, "supported_languages": null}, "macro.fivetran_utils.redshift__try_cast": {"name": "redshift__try_cast", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/try_cast.sql", "original_file_path": "macros/try_cast.sql", "unique_id": "macro.fivetran_utils.redshift__try_cast", "macro_sql": "{% macro redshift__try_cast(field, type) %}\n{%- if type == 'numeric' -%}\n\n case\n when trim({{field}}) ~ '^(0|[1-9][0-9]*)$' then trim({{field}})\n else null\n end::{{type}}\n\n{% else %}\n {{ exceptions.raise_compiler_error(\n \"non-numeric datatypes are not currently supported\") }}\n\n{% endif %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field", "type": null, "description": ""}, {"name": "type", "type": null, "description": ""}], "created_at": 1789422566.979775, "supported_languages": null}, "macro.fivetran_utils.postgres__try_cast": {"name": "postgres__try_cast", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/try_cast.sql", "original_file_path": "macros/try_cast.sql", "unique_id": "macro.fivetran_utils.postgres__try_cast", "macro_sql": "{% macro postgres__try_cast(field, type) %}\n{%- if type == 'numeric' -%}\n\n case\n when replace(cast({{field}} as varchar),cast(' ' as varchar),cast('' as varchar)) ~ '^(0|[1-9][0-9]*)$' \n then replace(cast({{field}} as varchar),cast(' ' as varchar),cast('' as varchar))\n else null\n end::{{type}}\n\n{% else %}\n {{ exceptions.raise_compiler_error(\n \"non-numeric datatypes are not currently supported\") }}\n\n{% endif %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field", "type": null, "description": ""}, {"name": "type", "type": null, "description": ""}], "created_at": 1789422566.9803689, "supported_languages": null}, "macro.fivetran_utils.snowflake__try_cast": {"name": "snowflake__try_cast", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/try_cast.sql", "original_file_path": "macros/try_cast.sql", "unique_id": "macro.fivetran_utils.snowflake__try_cast", "macro_sql": "{% macro snowflake__try_cast(field, type) %}\n try_cast(cast({{field}} as varchar) as {{type}})\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field", "type": null, "description": ""}, {"name": "type", "type": null, "description": ""}], "created_at": 1789422566.9806774, "supported_languages": null}, "macro.fivetran_utils.bigquery__try_cast": {"name": "bigquery__try_cast", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/try_cast.sql", "original_file_path": "macros/try_cast.sql", "unique_id": "macro.fivetran_utils.bigquery__try_cast", "macro_sql": "{% macro bigquery__try_cast(field, type) %}\n safe_cast({{field}} as {{type}})\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field", "type": null, "description": ""}, {"name": "type", "type": null, "description": ""}], "created_at": 1789422566.9811075, "supported_languages": null}, "macro.fivetran_utils.spark__try_cast": {"name": "spark__try_cast", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/try_cast.sql", "original_file_path": "macros/try_cast.sql", "unique_id": "macro.fivetran_utils.spark__try_cast", "macro_sql": "{% macro spark__try_cast(field, type) %}\n try_cast({{field}} as {{type}})\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field", "type": null, "description": ""}, {"name": "type", "type": null, "description": ""}], "created_at": 1789422566.9813786, "supported_languages": null}, "macro.fivetran_utils.sqlserver__try_cast": {"name": "sqlserver__try_cast", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/try_cast.sql", "original_file_path": "macros/try_cast.sql", "unique_id": "macro.fivetran_utils.sqlserver__try_cast", "macro_sql": "{% macro sqlserver__try_cast(field, type) %}\n try_cast({{field}} as {{type}})\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field", "type": null, "description": ""}, {"name": "type", "type": null, "description": ""}], "created_at": 1789422566.9816737, "supported_languages": null}, "macro.fivetran_utils.fivetran_date_spine": {"name": "fivetran_date_spine", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/fivetran_date_spine.sql", "original_file_path": "macros/fivetran_date_spine.sql", "unique_id": "macro.fivetran_utils.fivetran_date_spine", "macro_sql": "{% macro fivetran_date_spine(datepart, start_date, end_date) -%}\n\n{{ return(adapter.dispatch('fivetran_date_spine', 'fivetran_utils') (datepart, start_date, end_date)) }}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.default__fivetran_date_spine"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "datepart", "type": null, "description": ""}, {"name": "start_date", "type": null, "description": ""}, {"name": "end_date", "type": null, "description": ""}], "created_at": 1789422566.9827187, "supported_languages": null}, "macro.fivetran_utils.default__fivetran_date_spine": {"name": "default__fivetran_date_spine", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/fivetran_date_spine.sql", "original_file_path": "macros/fivetran_date_spine.sql", "unique_id": "macro.fivetran_utils.default__fivetran_date_spine", "macro_sql": "{% macro default__fivetran_date_spine(datepart, start_date, end_date) %}\n\n {{ dbt_utils.date_spine(datepart, start_date, end_date) }}\n \n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.date_spine"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "datepart", "type": null, "description": ""}, {"name": "start_date", "type": null, "description": ""}, {"name": "end_date", "type": null, "description": ""}], "created_at": 1789422566.9830935, "supported_languages": null}, "macro.fivetran_utils.sqlserver__fivetran_date_spine": {"name": "sqlserver__fivetran_date_spine", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/fivetran_date_spine.sql", "original_file_path": "macros/fivetran_date_spine.sql", "unique_id": "macro.fivetran_utils.sqlserver__fivetran_date_spine", "macro_sql": "{% macro sqlserver__fivetran_date_spine(datepart, start_date, end_date) -%}\n\n {% set date_spine_query %}\n with\n\n l0 as (\n\n select c\n from (select 1 union all select 1) as d(c)\n\n ),\n l1 as (\n\n select\n 1 as c\n from l0 as a\n cross join l0 as b\n\n ),\n\n l2 as (\n\n select 1 as c\n from l1 as a\n cross join l1 as b\n ),\n\n l3 as (\n\n select 1 as c\n from l2 as a\n cross join l2 as b\n ),\n\n l4 as (\n\n select 1 as c\n from l3 as a\n cross join l3 as b\n ),\n\n l5 as (\n\n select 1 as c\n from l4 as a\n cross join l4 as b\n ),\n\n nums as (\n\n select row_number() over (order by (select null)) as rownum\n from l5\n ),\n\n rawdata as (\n\n select top ({{dbt.datediff(start_date, end_date, datepart)}}) rownum -1 as n\n from nums\n order by rownum\n ),\n\n all_periods as (\n\n select (\n {{\n dbt.dateadd(\n datepart,\n 'n',\n start_date\n )\n }}\n ) as date_{{datepart}}\n from rawdata\n ),\n\n filtered as (\n\n select *\n from all_periods\n where date_{{datepart}} <= {{ end_date }}\n\n )\n\n select * from filtered\n order by 1\n\n {% endset %}\n\n {% set results = run_query(date_spine_query) %}\n\n {% if execute %}\n\n {% set results_list = results.columns[0].values() %}\n \n {% else %}\n\n {% set results_list = [] %}\n\n {% endif %}\n\n {%- for date_field in results_list %}\n select cast('{{ date_field }}' as date) as date_{{datepart}} {{ 'union all ' if not loop.last else '' }}\n {% endfor -%}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.datediff", "macro.dbt.dateadd", "macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "datepart", "type": null, "description": ""}, {"name": "start_date", "type": null, "description": ""}, {"name": "end_date", "type": null, "description": ""}], "created_at": 1789422566.9847863, "supported_languages": null}, "macro.fivetran_utils.partition_by_source_relation": {"name": "partition_by_source_relation", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/partition_by_source_relation.sql", "original_file_path": "macros/partition_by_source_relation.sql", "unique_id": "macro.fivetran_utils.partition_by_source_relation", "macro_sql": "{% macro partition_by_source_relation(package_name, has_other_partitions='yes', alias=None, package_prefix_union_variable=true) %}\n {{ return(adapter.dispatch('partition_by_source_relation', 'fivetran_utils')(package_name, has_other_partitions, alias, package_prefix_union_variable)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.default__partition_by_source_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "package_name", "type": null, "description": ""}, {"name": "has_other_partitions", "type": null, "description": ""}, {"name": "alias", "type": null, "description": ""}, {"name": "package_prefix_union_variable", "type": null, "description": ""}], "created_at": 1789422566.9858522, "supported_languages": null}, "macro.fivetran_utils.default__partition_by_source_relation": {"name": "default__partition_by_source_relation", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/partition_by_source_relation.sql", "original_file_path": "macros/partition_by_source_relation.sql", "unique_id": "macro.fivetran_utils.default__partition_by_source_relation", "macro_sql": "{% macro default__partition_by_source_relation(package_name, has_other_partitions='yes', alias=None, package_prefix_union_variable=true) -%}\n\n{%- if package_prefix_union_variable %}\n {%- set union_schemas_var = package_name ~ '_union_schemas' -%}\n {%- set union_databases_var = package_name ~ '_union_databases' -%}\n{%- else %}\n {%- set union_schemas_var = 'union_schemas' -%}\n {%- set union_databases_var = 'union_databases' -%}\n{%- endif -%}\n\n{%- set is_unioning = var(union_schemas_var, [])|length > 1 or var(union_databases_var, [])|length > 1 or var(package_name ~ '_sources', [])|length > 1 -%}\n{%- set prefix = '' if alias is none else alias ~ '.' -%}\n\n{%- if has_other_partitions == 'no' -%}\n {{- 'partition by ' ~ prefix ~ 'source_relation' if is_unioning else '' -}}\n{%- else -%}\n {{- ', ' ~ prefix ~ 'source_relation' if is_unioning else '' -}}\n{%- endif -%}\n\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "package_name", "type": null, "description": ""}, {"name": "has_other_partitions", "type": null, "description": ""}, {"name": "alias", "type": null, "description": ""}, {"name": "package_prefix_union_variable", "type": null, "description": ""}], "created_at": 1789422566.987704, "supported_languages": null}, "macro.fivetran_utils.fill_staging_columns": {"name": "fill_staging_columns", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/fill_staging_columns.sql", "original_file_path": "macros/fill_staging_columns.sql", "unique_id": "macro.fivetran_utils.fill_staging_columns", "macro_sql": "{% macro fill_staging_columns(source_columns, staging_columns) %}\n\n{%- set source_column_names = source_columns|map(attribute='name')|map('lower')|list -%}\n{%- set using_source_casing = var('fivetran_using_source_casing', false) -%}\n\n{%- for column in staging_columns %}\n {%- if column.name|lower in source_column_names %}\n {%- if using_source_casing %}\n {%- set column_alias = column.alias if 'alias' in column else column.name %}\n {{ adapter.quote(column.name) }} as {{ adapter.quote(column_alias|upper if target.type == 'snowflake' else column_alias) }}\n {%- else %}\n {{ fivetran_utils.quote_column(column) }} as\n {%- if 'alias' in column %} {{ column.alias }}{% else %} {{ fivetran_utils.quote_column(column) }}{% endif %}\n {%- endif %}\n {%- else %}\n cast(null as {{ column.datatype }}) as\n {%- if 'alias' in column %} {{ column.alias }}{% else %} {{ fivetran_utils.quote_column(column) }}{% endif %}\n {%- endif %}{{ ',' if not loop.last }}\n{%- endfor %}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.quote_column"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "source_columns", "type": null, "description": ""}, {"name": "staging_columns", "type": null, "description": ""}], "created_at": 1789422566.990676, "supported_languages": null}, "macro.fivetran_utils.quote_column": {"name": "quote_column", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/fill_staging_columns.sql", "original_file_path": "macros/fill_staging_columns.sql", "unique_id": "macro.fivetran_utils.quote_column", "macro_sql": "{% macro quote_column(column) %}\n {%- if 'quote' in column %}\n {%- if column.quote %}\n {%- if target.type in ('bigquery', 'spark', 'databricks') %}\n `{{ column.name }}`\n {%- elif target.type == 'snowflake' %}\n \"{{ column.name | upper }}\"\n {%- else %}\n \"{{ column.name }}\"\n {%- endif %}\n {%- else %}{{ column.name }}\n {%- endif %}\n {%- else %}{{ column.name }}\n {%- endif %}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "column", "type": null, "description": ""}], "created_at": 1789422566.9924278, "supported_languages": null}, "macro.fivetran_utils.union_connections": {"name": "union_connections", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/union_connections.sql", "original_file_path": "macros/union_connections.sql", "unique_id": "macro.fivetran_utils.union_connections", "macro_sql": "{% macro union_connections(connection_dictionary, single_source_name, single_table_name, default_identifier=single_table_name) %}\n\n{{ adapter.dispatch('union_connections', 'fivetran_utils') (connection_dictionary, single_source_name, single_table_name, default_identifier) }}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.default__union_connections"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "connection_dictionary", "type": null, "description": ""}, {"name": "single_source_name", "type": null, "description": ""}, {"name": "single_table_name", "type": null, "description": ""}, {"name": "default_identifier", "type": null, "description": ""}], "created_at": 1789422566.9939523, "supported_languages": null}, "macro.fivetran_utils.default__union_connections": {"name": "default__union_connections", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/union_connections.sql", "original_file_path": "macros/union_connections.sql", "unique_id": "macro.fivetran_utils.default__union_connections", "macro_sql": "{% macro default__union_connections(connection_dictionary, single_source_name, single_table_name, default_identifier=single_table_name) %}\n\n{%- set exception_warning = \"\\n\\nPlease be aware: The \" ~ single_source_name|upper ~ \".\" ~ single_table_name|upper ~ \" table was not found in your schema(s). The Fivetran Data Model will create a completely empty staging model as to not break downstream transformations. To turn off these warnings, set the `fivetran__remove_empty_table_warnings` variable to TRUE (see https://github.com/fivetran/dbt_fivetran_utils/tree/releases/v0.4.latest#union_connections-source for details).\\n\"%}\n{%- set using_empty_table_warnings = (execute and not var('fivetran__remove_empty_table_warnings', false)) %}\n{%- set connections = var(connection_dictionary, []) %}\n{%- set using_unioning = connections | length > 0 %}\n{%- set identifier_var = single_source_name + \"_\" + single_table_name + \"_identifier\" %}\n\n{%- if using_unioning %}\n{# For unioning #}\n {%- set relations = [] -%}\n {%- for connection in connections -%}\n\n {% if var('has_defined_sources', false) %}\n {%- set database = source(connection.name, single_table_name).database %}\n {%- set schema = source(connection.name, single_table_name).schema %}\n {%- set identifier = source(connection.name, single_table_name).identifier %}\n {%- else %}\n {%- set database = connection.database if connection.database else target.database %}\n {%- set schema = connection.schema if connection.schema else single_source_name %}\n {%- set identifier = var(identifier_var, default_identifier) %}\n {%- endif %}\n \n {%- set relation=adapter.get_relation(\n database=database,\n schema=schema,\n identifier=identifier\n )\n -%}\n\n {%- if relation is not none -%}\n {%- do relations.append(relation) -%}\n {%- endif -%}\n\n -- ** Values passed to adapter.get_relation:\n {{ '-- database: ' ~ database }}\n {{ '-- schema: ' ~ schema }}\n {{ '-- identifier: ' ~ identifier ~ '\\n' }}\n\n {%- endfor -%}\n\n {%- if relations | length > 0 -%}\n {{ fivetran_utils.union_relations_custom(relations, source_column_name='_dbt_source_relation') }}\n\n {%- else -%}\n {{ exceptions.warn(exception_warning) if using_empty_table_warnings }}\n\n select\n cast(null as {{ dbt.type_string() }}) as _dbt_source_relation\n limit {{ '0' if target.type != 'redshift' else '1' }}\n {%- endif -%}\n\n{% else %}\n{# Not unioning #}\n\n {%- set database = source(single_source_name, single_table_name).database %}\n {%- set schema = source(single_source_name, single_table_name).schema %}\n {%- set identifier = var(identifier_var, default_identifier) %}\n\n {%- set relation=adapter.get_relation(\n database=database,\n schema=schema,\n identifier=identifier\n )\n -%}\n\n -- ** Values passed to adapter.get_relation:\n {{ '-- full-identifier_var: ' ~ identifier_var }}\n {{ '-- database: ' ~ database }} \n {{ '-- schema: ' ~ schema }}\n {{ '-- identifier: ' ~ identifier ~ '\\n' }}\n\n {% if relation is not none -%}\n select\n {{ dbt_utils.star(from=source(single_source_name, single_table_name)) }}\n from {{ source(single_source_name, single_table_name) }} as source_table\n\n {% else %}\n {{ exceptions.warn(exception_warning) if using_empty_table_warnings }}\n\n select\n cast(null as {{ dbt.type_string() }}) as _dbt_source_relation\n limit {{ '0' if target.type != 'redshift' else '1' }}\n {%- endif -%}\n{% endif -%}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.union_relations_custom", "macro.dbt.type_string", "macro.dbt_utils.star"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "connection_dictionary", "type": null, "description": ""}, {"name": "single_source_name", "type": null, "description": ""}, {"name": "single_table_name", "type": null, "description": ""}, {"name": "default_identifier", "type": null, "description": ""}], "created_at": 1789422566.9994524, "supported_languages": null}, "macro.fivetran_utils.source_relation": {"name": "source_relation", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/source_relation.sql", "original_file_path": "macros/source_relation.sql", "unique_id": "macro.fivetran_utils.source_relation", "macro_sql": "{% macro source_relation(union_schema_variable='union_schemas', union_database_variable='union_databases') -%}\n\n{{ adapter.dispatch('source_relation', 'fivetran_utils') (union_schema_variable, union_database_variable) }}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.default__source_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "union_schema_variable", "type": null, "description": ""}, {"name": "union_database_variable", "type": null, "description": ""}], "created_at": 1789422567.0002692, "supported_languages": null}, "macro.fivetran_utils.default__source_relation": {"name": "default__source_relation", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/source_relation.sql", "original_file_path": "macros/source_relation.sql", "unique_id": "macro.fivetran_utils.default__source_relation", "macro_sql": "{% macro default__source_relation(union_schema_variable, union_database_variable) %}\n\n{% if var(union_schema_variable, none) %}\n, case\n {% for schema in var(union_schema_variable) %}\n when lower(replace(replace(_dbt_source_relation,'\"',''),'`','')) like '%.{{ schema|lower }}.%' then '{{ schema|lower }}'\n {% endfor %}\n end as source_relation\n{% elif var(union_database_variable, none) %}\n, case\n {% for database in var(union_database_variable) %}\n when lower(replace(replace(_dbt_source_relation,'\"',''),'`','')) like '%{{ database|lower }}.%' then '{{ database|lower }}'\n {% endfor %}\n end as source_relation\n{% else %}\n, cast('' as {{ dbt.type_string() }}) as source_relation\n{% endif %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "union_schema_variable", "type": null, "description": ""}, {"name": "union_database_variable", "type": null, "description": ""}], "created_at": 1789422567.0014277, "supported_languages": null}, "macro.fivetran_utils.apply_source_relation": {"name": "apply_source_relation", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/apply_source_relation.sql", "original_file_path": "macros/apply_source_relation.sql", "unique_id": "macro.fivetran_utils.apply_source_relation", "macro_sql": "{% macro apply_source_relation(package_name, use_package_prefix=true) -%}\n\n{{ adapter.dispatch('apply_source_relation', 'fivetran_utils') (package_name, use_package_prefix) }}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.default__apply_source_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "package_name", "type": null, "description": ""}, {"name": "use_package_prefix", "type": null, "description": ""}], "created_at": 1789422567.0022898, "supported_languages": null}, "macro.fivetran_utils.default__apply_source_relation": {"name": "default__apply_source_relation", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/apply_source_relation.sql", "original_file_path": "macros/apply_source_relation.sql", "unique_id": "macro.fivetran_utils.default__apply_source_relation", "macro_sql": "{% macro default__apply_source_relation(package_name, use_package_prefix=true) -%}\n\n{% set sources_var = package_name ~ '_sources' %}\n{% set database_var = package_name ~ '_database' %}\n{% set schema_var = package_name ~ '_schema' %}\n\n{% if use_package_prefix %}\n {% set union_schemas_var = package_name ~ '_union_schemas' %}\n {% set union_databases_var = package_name ~ '_union_databases' %}\n{% else %}\n {% set union_schemas_var = 'union_schemas' %}\n {% set union_databases_var = 'union_databases' %}\n{% endif %}\n\n{% if var(sources_var, []) | length > 0 %}\n, _dbt_source_relation as source_relation\n{% elif var(union_schemas_var, []) | length > 0 or var(union_databases_var, []) | length > 0 %}\n{{ fivetran_utils.source_relation(union_schema_variable=union_schemas_var, union_database_variable=union_databases_var) }}\n{% else %}\n{% set database = var(database_var, target.database) %}\n{% set schema = var(schema_var, package_name) %}\n, cast('{{ database ~ \".\" ~ schema }}' as {{ dbt.type_string() }}) as source_relation\n{% endif %}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.source_relation", "macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "package_name", "type": null, "description": ""}, {"name": "use_package_prefix", "type": null, "description": ""}], "created_at": 1789422567.0045087, "supported_languages": null}, "macro.fivetran_utils.calculated_fields": {"name": "calculated_fields", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/calculated_fields.sql", "original_file_path": "macros/calculated_fields.sql", "unique_id": "macro.fivetran_utils.calculated_fields", "macro_sql": "{% macro calculated_fields(variable) -%}\n\n{% if var(variable, none) %}\n {% for field in var(variable) %}\n , {{ field.transform_sql }} as {{ field.name }} \n {% endfor %}\n{% endif %}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "variable", "type": null, "description": ""}], "created_at": 1789422567.0052843, "supported_languages": null}, "macro.fivetran_utils.union_data": {"name": "union_data", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/union_data.sql", "original_file_path": "macros/union_data.sql", "unique_id": "macro.fivetran_utils.union_data", "macro_sql": "{%- macro union_data(table_identifier, database_variable, schema_variable, default_database, default_schema, default_variable, union_schema_variable='union_schemas', union_database_variable='union_databases') -%}\n\n{{ adapter.dispatch('union_data', 'fivetran_utils') (\n table_identifier, \n database_variable, \n schema_variable, \n default_database, \n default_schema, \n default_variable,\n union_schema_variable,\n union_database_variable\n ) }}\n\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.fivetran_utils.default__union_data"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "table_identifier", "type": null, "description": ""}, {"name": "database_variable", "type": null, "description": ""}, {"name": "schema_variable", "type": null, "description": ""}, {"name": "default_database", "type": null, "description": ""}, {"name": "default_schema", "type": null, "description": ""}, {"name": "default_variable", "type": null, "description": ""}, {"name": "union_schema_variable", "type": null, "description": ""}, {"name": "union_database_variable", "type": null, "description": ""}], "created_at": 1789422567.007518, "supported_languages": null}, "macro.fivetran_utils.default__union_data": {"name": "default__union_data", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/union_data.sql", "original_file_path": "macros/union_data.sql", "unique_id": "macro.fivetran_utils.default__union_data", "macro_sql": "{%- macro default__union_data(\n table_identifier, \n database_variable, \n schema_variable, \n default_database, \n default_schema, \n default_variable,\n union_schema_variable,\n union_database_variable\n ) -%}\n\n{%- if var(union_schema_variable, none) -%}\n\n {%- set relations = [] -%}\n \n {%- if var(union_schema_variable) is string -%}\n {%- set trimmed = var(union_schema_variable)|trim('[')|trim(']') -%}\n {%- set schemas = trimmed.split(',')|map('trim',\" \")|map('trim','\"')|map('trim',\"'\") -%}\n {%- else -%}\n {%- set schemas = var(union_schema_variable) -%}\n {%- endif -%}\n\n {%- for schema in var(union_schema_variable) -%}\n {%- set relation=adapter.get_relation(\n database=source(schema, table_identifier).database if var('has_defined_sources', false) else var(database_variable, default_database),\n schema=source(schema, table_identifier).schema if var('has_defined_sources', false) else schema,\n identifier=source(schema, table_identifier).identifier if var('has_defined_sources', false) else table_identifier\n ) -%}\n \n {%- set relation_exists=relation is not none -%}\n\n {%- if relation_exists -%}\n {%- do relations.append(relation) -%}\n {%- endif -%}\n\n {%- endfor -%}\n \n {%- if relations != [] -%}\n {{ dbt_utils.union_relations(relations) }}\n {%- else -%}\n {% if execute and not var('fivetran__remove_empty_table_warnings', false) -%}\n {{ exceptions.warn(\"\\n\\nPlease be aware: The \" ~ table_identifier|upper ~ \" table was not found in your \" ~ default_schema|upper ~ \" schema(s). The Fivetran dbt package will create a completely empty \" ~ table_identifier|upper ~ \" staging model as to not break downstream transformations. To turn off these warnings, set the `fivetran__remove_empty_table_warnings` variable to TRUE (see https://github.com/fivetran/dbt_fivetran_utils/tree/releases/v0.4.latest#union_data-source for details).\\n\") }}\n {% endif -%}\n select \n cast(null as {{ dbt.type_string() }}) as _dbt_source_relation\n limit 0\n {%- endif -%}\n\n{%- elif var(union_database_variable, none) -%}\n\n {%- set relations = [] -%}\n\n {%- for database in var(union_database_variable) -%}\n {%- set relation=adapter.get_relation(\n database=source(schema, table_identifier).database if var('has_defined_sources', false) else database,\n schema=source(schema, table_identifier).schema if var('has_defined_sources', false) else var(schema_variable, default_schema),\n identifier=source(schema, table_identifier).identifier if var('has_defined_sources', false) else table_identifier\n ) -%}\n\n {%- set relation_exists=relation is not none -%}\n\n {%- if relation_exists -%}\n {%- do relations.append(relation) -%}\n {%- endif -%}\n\n {%- endfor -%}\n\n {%- if relations != [] -%}\n {{ dbt_utils.union_relations(relations) }}\n {%- else -%}\n {% if execute and not var('fivetran__remove_empty_table_warnings', false) -%}\n {{ exceptions.warn(\"\\n\\nPlease be aware: The \" ~ table_identifier|upper ~ \" table was not found in your \" ~ default_schema|upper ~ \" schema(s). The Fivetran dbt package will create a completely empty \" ~ table_identifier|upper ~ \" staging model as to not break downstream transformations. To turn off these warnings, set the `fivetran__remove_empty_table_warnings` variable to TRUE (see https://github.com/fivetran/dbt_fivetran_utils/tree/releases/v0.4.latest#union_data-source for details).\\n\") }}\n {% endif -%}\n select \n cast(null as {{ dbt.type_string() }}) as _dbt_source_relation\n limit 0\n {%- endif -%}\n\n{%- else -%}\n {% set exception_schemas = {\"linkedin_company_pages\": \"linkedin_pages\", \"instagram_business_pages\": \"instagram_business\"} %}\n {% set relation = namespace(value=\"\") %}\n {% if default_schema in exception_schemas.keys() %}\n {% for corrected_schema_name in exception_schemas.items() %} \n {% if default_schema in corrected_schema_name %}\n {# In order for this macro to effectively work within upstream integration tests (mainly used by the Fivetran dbt package maintainers), this identifier variable selection is required to use the macro with different identifier names. #}\n {% set identifier_var = corrected_schema_name[1] + \"_\" + table_identifier + \"_identifier\" %}\n {%- set relation.value=adapter.get_relation(\n database=source(corrected_schema_name[1], table_identifier).database,\n schema=source(corrected_schema_name[1], table_identifier).schema,\n identifier=var(identifier_var, table_identifier)\n ) -%}\n {% endif %}\n {% endfor %}\n {% else %}\n {# In order for this macro to effectively work within upstream integration tests (mainly used by the Fivetran dbt package maintainers), this identifier variable selection is required to use the macro with different identifier names. #}\n {% set identifier_var = default_schema + \"_\" + table_identifier + \"_identifier\" %}\n {# Unfortunately the Twitter Organic identifiers were misspelled. As such, we will need to account for this in the model. This will be adjusted in the Twitter Organic package, but to ensure backwards compatibility, this needs to be included. #}\n {% if var(identifier_var, none) is none %} \n {% set identifier_var = default_schema + \"_\" + table_identifier + \"_identifer\" %}\n {% endif %}\n {%- set relation.value=adapter.get_relation(\n database=source(default_schema, table_identifier).database,\n schema=source(default_schema, table_identifier).schema,\n identifier=var(identifier_var, table_identifier)\n ) -%}\n {% endif %}\n{%- set table_exists=relation.value is not none -%}\n\n{%- if table_exists -%}\n select * \n from {{ relation.value }}\n{%- else -%}\n {% if execute and not var('fivetran__remove_empty_table_warnings', false) -%}\n {{ exceptions.warn(\"\\n\\nPlease be aware: The \" ~ table_identifier|upper ~ \" table was not found in your \" ~ default_schema|upper ~ \" schema(s). The Fivetran dbt package will create a completely empty \" ~ table_identifier|upper ~ \" staging model as to not break downstream transformations. To turn off these warnings, set the `fivetran__remove_empty_table_warnings` variable to TRUE (see https://github.com/fivetran/dbt_fivetran_utils/tree/releases/v0.4.latest#union_data-source for details).\\n\") }}\n {% endif -%}\n select \n cast(null as {{ dbt.type_string() }}) as _dbt_source_relation\n limit 0\n{%- endif -%}\n{%- endif -%}\n\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt_utils.union_relations", "macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "table_identifier", "type": null, "description": ""}, {"name": "database_variable", "type": null, "description": ""}, {"name": "schema_variable", "type": null, "description": ""}, {"name": "default_database", "type": null, "description": ""}, {"name": "default_schema", "type": null, "description": ""}, {"name": "default_variable", "type": null, "description": ""}, {"name": "union_schema_variable", "type": null, "description": ""}, {"name": "union_database_variable", "type": null, "description": ""}], "created_at": 1789422567.018966, "supported_languages": null}, "macro.fivetran_utils.pivot_json_extract": {"name": "pivot_json_extract", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/pivot_json_extract.sql", "original_file_path": "macros/pivot_json_extract.sql", "unique_id": "macro.fivetran_utils.pivot_json_extract", "macro_sql": "{% macro pivot_json_extract(string, list_of_properties) %}\n\n{%- for property in list_of_properties -%}\n{%- if property is mapping -%}\nreplace( {{ fivetran_utils.json_extract(string, property.name) }}, '\"', '') as {{ property.alias if property.alias else property.name | replace(' ', '_') | replace('.', '_') | lower }}\n\n{%- else -%}\nreplace( {{ fivetran_utils.json_extract(string, property) }}, '\"', '') as {{ property | replace(' ', '_') | lower }}\n\n{%- endif -%}\n{%- if not loop.last -%},{%- endif %}\n{% endfor -%}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.json_extract"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "string", "type": null, "description": ""}, {"name": "list_of_properties", "type": null, "description": ""}], "created_at": 1789422567.020628, "supported_languages": null}, "macro.fivetran_utils.add_dbt_source_relation": {"name": "add_dbt_source_relation", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/add_dbt_source_relation.sql", "original_file_path": "macros/add_dbt_source_relation.sql", "unique_id": "macro.fivetran_utils.add_dbt_source_relation", "macro_sql": "{% macro add_dbt_source_relation() %}\n\n{% if var('union_schemas', none) or var('union_databases', none) %}\n, _dbt_source_relation\n{% endif %}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789422567.0211966, "supported_languages": null}, "macro.fivetran_utils.array_agg": {"name": "array_agg", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/array_agg.sql", "original_file_path": "macros/array_agg.sql", "unique_id": "macro.fivetran_utils.array_agg", "macro_sql": "{% macro array_agg(field_to_agg) -%}\n\n{{ adapter.dispatch('array_agg', 'fivetran_utils') (field_to_agg) }}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.default__array_agg"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field_to_agg", "type": null, "description": ""}], "created_at": 1789422567.0217557, "supported_languages": null}, "macro.fivetran_utils.default__array_agg": {"name": "default__array_agg", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/array_agg.sql", "original_file_path": "macros/array_agg.sql", "unique_id": "macro.fivetran_utils.default__array_agg", "macro_sql": "{% macro default__array_agg(field_to_agg) %}\n array_agg({{ field_to_agg }})\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field_to_agg", "type": null, "description": ""}], "created_at": 1789422567.0219913, "supported_languages": null}, "macro.fivetran_utils.redshift__array_agg": {"name": "redshift__array_agg", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/array_agg.sql", "original_file_path": "macros/array_agg.sql", "unique_id": "macro.fivetran_utils.redshift__array_agg", "macro_sql": "{% macro redshift__array_agg(field_to_agg) %}\n listagg({{ field_to_agg }}, ',')\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field_to_agg", "type": null, "description": ""}], "created_at": 1789422567.0222123, "supported_languages": null}, "macro.fivetran_utils.collect_freshness": {"name": "collect_freshness", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/collect_freshness.sql", "original_file_path": "macros/collect_freshness.sql", "unique_id": "macro.fivetran_utils.collect_freshness", "macro_sql": "{% macro collect_freshness(source, loaded_at_field, filter) %}\n {{ return(adapter.dispatch('collect_freshness')(source, loaded_at_field, filter))}}\n{% endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.default__collect_freshness"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "source", "type": null, "description": ""}, {"name": "loaded_at_field", "type": null, "description": ""}, {"name": "filter", "type": null, "description": ""}], "created_at": 1789422567.0231752, "supported_languages": null}, "macro.fivetran_utils.default__collect_freshness": {"name": "default__collect_freshness", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/collect_freshness.sql", "original_file_path": "macros/collect_freshness.sql", "unique_id": "macro.fivetran_utils.default__collect_freshness", "macro_sql": "{% macro default__collect_freshness(source, loaded_at_field, filter) %}\n {% call statement('collect_freshness', fetch_result=True, auto_begin=False) -%}\n\n {%- set enabled_array = [] -%}\n {% for node in graph.sources.values() %}\n {% if node.identifier == source.identifier %}\n {% if (node.meta['is_enabled'] | default(true)) %}\n {%- do enabled_array.append(1) -%}\n {% endif %}\n {% endif %}\n {% endfor %}\n {% set is_enabled = (enabled_array != []) %}\n\n select\n {% if is_enabled %}\n max({{ loaded_at_field }})\n {% else %} \n {{ current_timestamp() }} {% endif %} as max_loaded_at,\n {{ current_timestamp() }} as snapshotted_at\n\n {% if is_enabled %}\n from {{ source }}\n {% if filter %}\n where {{ filter }}\n {% endif %}\n {% endif %}\n\n {% endcall %}\n\n {% if dbt_version.split('.') | map('int') | list >= [1, 5, 0] %}\n {{ return(load_result('collect_freshness')) }}\n {% else %}\n {{ return(load_result('collect_freshness').table) }}\n {% endif %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement", "macro.dbt.current_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "source", "type": null, "description": ""}, {"name": "loaded_at_field", "type": null, "description": ""}, {"name": "filter", "type": null, "description": ""}], "created_at": 1789422567.0257485, "supported_languages": null}, "macro.fivetran_utils.first_value": {"name": "first_value", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/first_value.sql", "original_file_path": "macros/first_value.sql", "unique_id": "macro.fivetran_utils.first_value", "macro_sql": "{% macro first_value(first_value_field, partition_field, order_by_field, order=\"asc\") -%}\n\n{{ adapter.dispatch('first_value', 'fivetran_utils') (first_value_field, partition_field, order_by_field, order) }}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.default__first_value"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "first_value_field", "type": null, "description": ""}, {"name": "partition_field", "type": null, "description": ""}, {"name": "order_by_field", "type": null, "description": ""}, {"name": "order", "type": null, "description": ""}], "created_at": 1789422567.026595, "supported_languages": null}, "macro.fivetran_utils.default__first_value": {"name": "default__first_value", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/first_value.sql", "original_file_path": "macros/first_value.sql", "unique_id": "macro.fivetran_utils.default__first_value", "macro_sql": "{% macro default__first_value(first_value_field, partition_field, order_by_field, order=\"asc\") %}\n\n first_value( {{ first_value_field }} ignore nulls ) over (partition by {{ partition_field }} order by {{ order_by_field }} {{ order }} )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "first_value_field", "type": null, "description": ""}, {"name": "partition_field", "type": null, "description": ""}, {"name": "order_by_field", "type": null, "description": ""}, {"name": "order", "type": null, "description": ""}], "created_at": 1789422567.027117, "supported_languages": null}, "macro.fivetran_utils.redshift__first_value": {"name": "redshift__first_value", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/first_value.sql", "original_file_path": "macros/first_value.sql", "unique_id": "macro.fivetran_utils.redshift__first_value", "macro_sql": "{% macro redshift__first_value(first_value_field, partition_field, order_by_field, order=\"asc\") %}\n\n first_value( {{ first_value_field }} ignore nulls ) over (partition by {{ partition_field }} order by {{ order_by_field }} {{ order }} , {{ partition_field }} rows unbounded preceding )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "first_value_field", "type": null, "description": ""}, {"name": "partition_field", "type": null, "description": ""}, {"name": "order_by_field", "type": null, "description": ""}, {"name": "order", "type": null, "description": ""}], "created_at": 1789422567.0279338, "supported_languages": null}, "macro.fivetran_utils.union_relations": {"name": "union_relations", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/union_relations.sql", "original_file_path": "macros/union_relations.sql", "unique_id": "macro.fivetran_utils.union_relations", "macro_sql": "{%- macro union_relations(relations, aliases=none, column_override=none, include=[], exclude=[], source_column_name=none) -%}\n\n {%- if exclude and include -%}\n {{ exceptions.raise_compiler_error(\"Both an exclude and include list were provided to the `union` macro. Only one is allowed\") }}\n {%- endif -%}\n\n {#-- Prevent querying of db in parsing mode. This works because this macro does not create any new refs. -#}\n {%- if not execute %}\n {{ return('') }}\n {% endif -%}\n\n {%- set column_override = column_override if column_override is not none else {} -%}\n {%- set source_column_name = source_column_name if source_column_name is not none else '_dbt_source_relation' -%}\n\n {%- set relation_columns = {} -%}\n {%- set column_superset = {} -%}\n\n {%- for relation in relations -%}\n\n {%- do relation_columns.update({relation: []}) -%}\n\n {%- do dbt_utils._is_relation(relation, 'union_relations') -%}\n {%- set cols = adapter.get_columns_in_relation(relation) -%}\n {%- for col in cols -%}\n\n {#- If an exclude list was provided and the column is in the list, do nothing -#}\n {%- if exclude and col.column in exclude -%}\n\n {#- If an include list was provided and the column is not in the list, do nothing -#}\n {%- elif include and col.column not in include -%}\n\n {#- Otherwise add the column to the column superset -#}\n {%- else -%}\n\n {#- update the list of columns in this relation -#}\n {%- do relation_columns[relation].append(col.column) -%}\n\n {%- if col.column in column_superset -%}\n\n {%- set stored = column_superset[col.column] -%}\n {%- if col.is_string() and stored.is_string() and col.string_size() > stored.string_size() -%}\n\n {%- do column_superset.update({col.column: col}) -%}\n\n {%- endif %}\n\n {%- else -%}\n\n {%- do column_superset.update({col.column: col}) -%}\n\n {%- endif -%}\n\n {%- endif -%}\n\n {%- endfor -%}\n {%- endfor -%}\n\n {%- set ordered_column_names = column_superset.keys() -%}\n\n {%- for relation in relations %}\n\n (\n select\n\n cast({{ dbt.string_literal(relation) }} as {{ dbt.type_string() }}) as {{ source_column_name }},\n {% for col_name in ordered_column_names -%}\n\n {%- set col = column_superset[col_name] %}\n {%- set col_type = column_override.get(col.column, col.data_type) %}\n {%- set col_name = adapter.quote(col_name) if col_name in relation_columns[relation] else 'null' %}\n cast({{ col_name }} as {{ col_type }}) as {{ col.quoted }} {% if not loop.last %},{% endif -%}\n\n {%- endfor %}\n\n from {{ aliases[loop.index0] if aliases else relation }}\n )\n\n {% if not loop.last -%}\n union all\n {% endif -%}\n\n {%- endfor -%}\n\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt_utils._is_relation", "macro.dbt.string_literal", "macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relations", "type": null, "description": ""}, {"name": "aliases", "type": null, "description": ""}, {"name": "column_override", "type": null, "description": ""}, {"name": "include", "type": null, "description": ""}, {"name": "exclude", "type": null, "description": ""}, {"name": "source_column_name", "type": null, "description": ""}], "created_at": 1789422567.0373888, "supported_languages": null}, "macro.fivetran_utils.union_tables": {"name": "union_tables", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/union_relations.sql", "original_file_path": "macros/union_relations.sql", "unique_id": "macro.fivetran_utils.union_tables", "macro_sql": "{%- macro union_tables(tables, column_override=none, include=[], exclude=[], source_column_name='_dbt_source_table') -%}\n\n {%- do exceptions.warn(\"Warning: the `union_tables` macro is no longer supported and will be deprecated in a future release of dbt-utils. Use the `union_relations` macro instead\") -%}\n\n {{ return(dbt_utils.union_relations(tables, column_override, include, exclude, source_column_name)) }}\n\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt_utils.union_relations"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "tables", "type": null, "description": ""}, {"name": "column_override", "type": null, "description": ""}, {"name": "include", "type": null, "description": ""}, {"name": "exclude", "type": null, "description": ""}, {"name": "source_column_name", "type": null, "description": ""}], "created_at": 1789422567.0381799, "supported_languages": null}, "macro.fivetran_utils.timestamp_diff": {"name": "timestamp_diff", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/timestamp_diff.sql", "original_file_path": "macros/timestamp_diff.sql", "unique_id": "macro.fivetran_utils.timestamp_diff", "macro_sql": "{% macro timestamp_diff(first_date, second_date, datepart) %}\n {{ adapter.dispatch('timestamp_diff', 'fivetran_utils')(first_date, second_date, datepart) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.postgres__timestamp_diff"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "first_date", "type": null, "description": ""}, {"name": "second_date", "type": null, "description": ""}, {"name": "datepart", "type": null, "description": ""}], "created_at": 1789422567.0397525, "supported_languages": null}, "macro.fivetran_utils.default__timestamp_diff": {"name": "default__timestamp_diff", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/timestamp_diff.sql", "original_file_path": "macros/timestamp_diff.sql", "unique_id": "macro.fivetran_utils.default__timestamp_diff", "macro_sql": "{% macro default__timestamp_diff(first_date, second_date, datepart) %}\n\n datediff(\n {{ datepart }},\n {{ first_date }},\n {{ second_date }}\n )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "first_date", "type": null, "description": ""}, {"name": "second_date", "type": null, "description": ""}, {"name": "datepart", "type": null, "description": ""}], "created_at": 1789422567.0401154, "supported_languages": null}, "macro.fivetran_utils.redshift__timestamp_diff": {"name": "redshift__timestamp_diff", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/timestamp_diff.sql", "original_file_path": "macros/timestamp_diff.sql", "unique_id": "macro.fivetran_utils.redshift__timestamp_diff", "macro_sql": "{% macro redshift__timestamp_diff(first_date, second_date, datepart) %}\n\n datediff(\n {{ datepart }},\n {{ first_date }},\n {{ second_date }}\n )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "first_date", "type": null, "description": ""}, {"name": "second_date", "type": null, "description": ""}, {"name": "datepart", "type": null, "description": ""}], "created_at": 1789422567.0404613, "supported_languages": null}, "macro.fivetran_utils.bigquery__timestamp_diff": {"name": "bigquery__timestamp_diff", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/timestamp_diff.sql", "original_file_path": "macros/timestamp_diff.sql", "unique_id": "macro.fivetran_utils.bigquery__timestamp_diff", "macro_sql": "{% macro bigquery__timestamp_diff(first_date, second_date, datepart) %}\n\n timestamp_diff(\n {{second_date}},\n {{first_date}},\n {{datepart}}\n )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "first_date", "type": null, "description": ""}, {"name": "second_date", "type": null, "description": ""}, {"name": "datepart", "type": null, "description": ""}], "created_at": 1789422567.0408182, "supported_languages": null}, "macro.fivetran_utils.postgres__timestamp_diff": {"name": "postgres__timestamp_diff", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/timestamp_diff.sql", "original_file_path": "macros/timestamp_diff.sql", "unique_id": "macro.fivetran_utils.postgres__timestamp_diff", "macro_sql": "{% macro postgres__timestamp_diff(first_date, second_date, datepart) %}\n\n {% if datepart == 'year' %}\n (date_part('year', ({{second_date}})::date) - date_part('year', ({{first_date}})::date))\n {% elif datepart == 'quarter' %}\n ({{ dbt.datediff(first_date, second_date, 'year') }} * 4 + date_part('quarter', ({{second_date}})::date) - date_part('quarter', ({{first_date}})::date))\n {% elif datepart == 'month' %}\n ({{ dbt.datediff(first_date, second_date, 'year') }} * 12 + date_part('month', ({{second_date}})::date) - date_part('month', ({{first_date}})::date))\n {% elif datepart == 'day' %}\n (({{second_date}})::date - ({{first_date}})::date)\n {% elif datepart == 'week' %}\n ({{ dbt.datediff(first_date, second_date, 'day') }} / 7 + case\n when date_part('dow', ({{first_date}})::timestamp) <= date_part('dow', ({{second_date}})::timestamp) then\n case when {{first_date}} <= {{second_date}} then 0 else -1 end\n else\n case when {{first_date}} <= {{second_date}} then 1 else 0 end\n end)\n {% elif datepart == 'hour' %}\n ({{ dbt.datediff(first_date, second_date, 'day') }} * 24 + date_part('hour', ({{second_date}})::timestamp) - date_part('hour', ({{first_date}})::timestamp))\n {% elif datepart == 'minute' %}\n ({{ dbt.datediff(first_date, second_date, 'hour') }} * 60 + date_part('minute', ({{second_date}})::timestamp) - date_part('minute', ({{first_date}})::timestamp))\n {% elif datepart == 'second' %}\n ({{ dbt.datediff(first_date, second_date, 'minute') }} * 60 + floor(date_part('second', ({{second_date}})::timestamp)) - floor(date_part('second', ({{first_date}})::timestamp)))\n {% elif datepart == 'millisecond' %}\n ({{ dbt.datediff(first_date, second_date, 'minute') }} * 60000 + floor(date_part('millisecond', ({{second_date}})::timestamp)) - floor(date_part('millisecond', ({{first_date}})::timestamp)))\n {% elif datepart == 'microsecond' %}\n ({{ dbt.datediff(first_date, second_date, 'minute') }} * 60000000 + floor(date_part('microsecond', ({{second_date}})::timestamp)) - floor(date_part('microsecond', ({{first_date}})::timestamp)))\n {% else %}\n {{ exceptions.raise_compiler_error(\"Unsupported datepart for macro datediff in postgres: {!r}\".format(datepart)) }}\n {% endif %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.datediff"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "first_date", "type": null, "description": ""}, {"name": "second_date", "type": null, "description": ""}, {"name": "datepart", "type": null, "description": ""}], "created_at": 1789422567.0441275, "supported_languages": null}, "macro.fivetran_utils.duckdb__timestamp_diff": {"name": "duckdb__timestamp_diff", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/timestamp_diff.sql", "original_file_path": "macros/timestamp_diff.sql", "unique_id": "macro.fivetran_utils.duckdb__timestamp_diff", "macro_sql": "{% macro duckdb__timestamp_diff(first_date, second_date, datepart) %}\n\n datediff('{{ datepart }}', {{ first_date }}, {{ second_date }})\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "first_date", "type": null, "description": ""}, {"name": "second_date", "type": null, "description": ""}, {"name": "datepart", "type": null, "description": ""}], "created_at": 1789422567.0444863, "supported_languages": null}, "macro.fivetran_utils.add_pass_through_columns": {"name": "add_pass_through_columns", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/add_pass_through_columns.sql", "original_file_path": "macros/add_pass_through_columns.sql", "unique_id": "macro.fivetran_utils.add_pass_through_columns", "macro_sql": "{% macro add_pass_through_columns(base_columns, pass_through_var) %}\n\n {% if pass_through_var %}\n\n {% for column in pass_through_var %}\n\n {% if column is mapping %}\n\n {% if column.alias %}\n\n {% do base_columns.append({ \"name\": column.name, \"alias\": column.alias, \"datatype\": column.datatype if column.datatype else dbt.type_string()}) %}\n\n {% else %}\n\n {% do base_columns.append({ \"name\": column.name, \"datatype\": column.datatype if column.datatype else dbt.type_string()}) %}\n \n {% endif %}\n\n {% else %}\n\n {% do base_columns.append({ \"name\": column, \"datatype\": dbt.type_string()}) %}\n\n {% endif %}\n\n {% endfor %}\n\n {% endif %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "base_columns", "type": null, "description": ""}, {"name": "pass_through_var", "type": null, "description": ""}], "created_at": 1789422567.0464602, "supported_languages": null}, "macro.fivetran_utils.timestamp_add": {"name": "timestamp_add", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/timestamp_add.sql", "original_file_path": "macros/timestamp_add.sql", "unique_id": "macro.fivetran_utils.timestamp_add", "macro_sql": "{% macro timestamp_add(datepart, interval, from_timestamp) -%}\n\n{{ adapter.dispatch('timestamp_add', 'fivetran_utils') (datepart, interval, from_timestamp) }}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.postgres__timestamp_add"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "datepart", "type": null, "description": ""}, {"name": "interval", "type": null, "description": ""}, {"name": "from_timestamp", "type": null, "description": ""}], "created_at": 1789422567.047338, "supported_languages": null}, "macro.fivetran_utils.default__timestamp_add": {"name": "default__timestamp_add", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/timestamp_add.sql", "original_file_path": "macros/timestamp_add.sql", "unique_id": "macro.fivetran_utils.default__timestamp_add", "macro_sql": "{% macro default__timestamp_add(datepart, interval, from_timestamp) %}\n\n timestampadd(\n {{ datepart }},\n {{ interval }},\n {{ from_timestamp }}\n )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "datepart", "type": null, "description": ""}, {"name": "interval", "type": null, "description": ""}, {"name": "from_timestamp", "type": null, "description": ""}], "created_at": 1789422567.0477054, "supported_languages": null}, "macro.fivetran_utils.bigquery__timestamp_add": {"name": "bigquery__timestamp_add", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/timestamp_add.sql", "original_file_path": "macros/timestamp_add.sql", "unique_id": "macro.fivetran_utils.bigquery__timestamp_add", "macro_sql": "{% macro bigquery__timestamp_add(datepart, interval, from_timestamp) %}\n\n timestamp_add({{ from_timestamp }}, interval {{ interval }} {{ datepart }})\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "datepart", "type": null, "description": ""}, {"name": "interval", "type": null, "description": ""}, {"name": "from_timestamp", "type": null, "description": ""}], "created_at": 1789422567.0480375, "supported_languages": null}, "macro.fivetran_utils.redshift__timestamp_add": {"name": "redshift__timestamp_add", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/timestamp_add.sql", "original_file_path": "macros/timestamp_add.sql", "unique_id": "macro.fivetran_utils.redshift__timestamp_add", "macro_sql": "{% macro redshift__timestamp_add(datepart, interval, from_timestamp) %}\n\n dateadd(\n {{ datepart }},\n {{ interval }},\n {{ from_timestamp }}\n )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "datepart", "type": null, "description": ""}, {"name": "interval", "type": null, "description": ""}, {"name": "from_timestamp", "type": null, "description": ""}], "created_at": 1789422567.0484006, "supported_languages": null}, "macro.fivetran_utils.postgres__timestamp_add": {"name": "postgres__timestamp_add", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/timestamp_add.sql", "original_file_path": "macros/timestamp_add.sql", "unique_id": "macro.fivetran_utils.postgres__timestamp_add", "macro_sql": "{% macro postgres__timestamp_add(datepart, interval, from_timestamp) %}\n\n {{ from_timestamp }} + ((interval '1 {{ datepart }}') * ({{ interval }}))\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "datepart", "type": null, "description": ""}, {"name": "interval", "type": null, "description": ""}, {"name": "from_timestamp", "type": null, "description": ""}], "created_at": 1789422567.048769, "supported_languages": null}, "macro.fivetran_utils.spark__timestamp_add": {"name": "spark__timestamp_add", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/timestamp_add.sql", "original_file_path": "macros/timestamp_add.sql", "unique_id": "macro.fivetran_utils.spark__timestamp_add", "macro_sql": "{% macro spark__timestamp_add(datepart, interval, from_timestamp) %}\n\n {{ dbt.dateadd(datepart, interval, from_timestamp) }}\n \n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.dateadd"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "datepart", "type": null, "description": ""}, {"name": "interval", "type": null, "description": ""}, {"name": "from_timestamp", "type": null, "description": ""}], "created_at": 1789422567.0491323, "supported_languages": null}, "macro.fivetran_utils.duckdb__timestamp_add": {"name": "duckdb__timestamp_add", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/timestamp_add.sql", "original_file_path": "macros/timestamp_add.sql", "unique_id": "macro.fivetran_utils.duckdb__timestamp_add", "macro_sql": "{% macro duckdb__timestamp_add(datepart, interval, from_timestamp) %}\n\n {{ from_timestamp }} + ((interval '1 {{ datepart }}') * ({{ interval }}))\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "datepart", "type": null, "description": ""}, {"name": "interval", "type": null, "description": ""}, {"name": "from_timestamp", "type": null, "description": ""}], "created_at": 1789422567.0496027, "supported_languages": null}, "macro.fivetran_utils.enabled_vars": {"name": "enabled_vars", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/enabled_vars.sql", "original_file_path": "macros/enabled_vars.sql", "unique_id": "macro.fivetran_utils.enabled_vars", "macro_sql": "{% macro enabled_vars(vars) %}\n\n{% for v in vars %}\n \n {% if var(v, True) == False %}\n {{ return(False) }}\n {% endif %}\n\n{% endfor %}\n\n{{ return(True) }}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "vars", "type": null, "description": ""}], "created_at": 1789422567.0503929, "supported_languages": null}, "macro.fivetran_utils.wrap_in_quotes": {"name": "wrap_in_quotes", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/wrap_in_quotes.sql", "original_file_path": "macros/wrap_in_quotes.sql", "unique_id": "macro.fivetran_utils.wrap_in_quotes", "macro_sql": "{%- macro wrap_in_quotes(object_to_quote) -%}\n\n{{ return(adapter.dispatch('wrap_in_quotes', 'fivetran_utils')(object_to_quote)) }}\n\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.fivetran_utils.postgres__wrap_in_quotes"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "object_to_quote", "type": null, "description": ""}], "created_at": 1789422567.0510821, "supported_languages": null}, "macro.fivetran_utils.default__wrap_in_quotes": {"name": "default__wrap_in_quotes", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/wrap_in_quotes.sql", "original_file_path": "macros/wrap_in_quotes.sql", "unique_id": "macro.fivetran_utils.default__wrap_in_quotes", "macro_sql": "{%- macro default__wrap_in_quotes(object_to_quote) -%}\n{# bigquery, spark, databricks #}\n `{{ object_to_quote }}`\n{%- endmacro -%}\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "object_to_quote", "type": null, "description": ""}], "created_at": 1789422567.0513198, "supported_languages": null}, "macro.fivetran_utils.snowflake__wrap_in_quotes": {"name": "snowflake__wrap_in_quotes", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/wrap_in_quotes.sql", "original_file_path": "macros/wrap_in_quotes.sql", "unique_id": "macro.fivetran_utils.snowflake__wrap_in_quotes", "macro_sql": "{%- macro snowflake__wrap_in_quotes(object_to_quote) -%}\n \"{{ object_to_quote | upper }}\"\n{%- endmacro -%}\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "object_to_quote", "type": null, "description": ""}], "created_at": 1789422567.0515866, "supported_languages": null}, "macro.fivetran_utils.redshift__wrap_in_quotes": {"name": "redshift__wrap_in_quotes", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/wrap_in_quotes.sql", "original_file_path": "macros/wrap_in_quotes.sql", "unique_id": "macro.fivetran_utils.redshift__wrap_in_quotes", "macro_sql": "{%- macro redshift__wrap_in_quotes(object_to_quote) -%}\n \"{{ object_to_quote }}\"\n{%- endmacro -%}\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "object_to_quote", "type": null, "description": ""}], "created_at": 1789422567.0518093, "supported_languages": null}, "macro.fivetran_utils.postgres__wrap_in_quotes": {"name": "postgres__wrap_in_quotes", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/wrap_in_quotes.sql", "original_file_path": "macros/wrap_in_quotes.sql", "unique_id": "macro.fivetran_utils.postgres__wrap_in_quotes", "macro_sql": "{%- macro postgres__wrap_in_quotes(object_to_quote) -%}\n \"{{ object_to_quote }}\"\n{%- endmacro -%}\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "object_to_quote", "type": null, "description": ""}], "created_at": 1789422567.0520272, "supported_languages": null}, "macro.fivetran_utils.duckdb__wrap_in_quotes": {"name": "duckdb__wrap_in_quotes", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/wrap_in_quotes.sql", "original_file_path": "macros/wrap_in_quotes.sql", "unique_id": "macro.fivetran_utils.duckdb__wrap_in_quotes", "macro_sql": "{%- macro duckdb__wrap_in_quotes(object_to_quote) -%}\n \"{{ object_to_quote }}\"\n{%- endmacro -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "object_to_quote", "type": null, "description": ""}], "created_at": 1789422567.052247, "supported_languages": null}, "macro.fivetran_utils.json_extract": {"name": "json_extract", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/json_extract.sql", "original_file_path": "macros/json_extract.sql", "unique_id": "macro.fivetran_utils.json_extract", "macro_sql": "{% macro json_extract(string, string_path) -%}\n\n{{ adapter.dispatch('json_extract', 'fivetran_utils') (string, string_path) }}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.postgres__json_extract"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "string", "type": null, "description": ""}, {"name": "string_path", "type": null, "description": ""}], "created_at": 1789422567.0530546, "supported_languages": null}, "macro.fivetran_utils.default__json_extract": {"name": "default__json_extract", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/json_extract.sql", "original_file_path": "macros/json_extract.sql", "unique_id": "macro.fivetran_utils.default__json_extract", "macro_sql": "{% macro default__json_extract(string, string_path) %}\n\n json_extract_path_text({{string}}, {{ \"'\" ~ string_path ~ \"'\" }} )\n \n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "string", "type": null, "description": ""}, {"name": "string_path", "type": null, "description": ""}], "created_at": 1789422567.0533824, "supported_languages": null}, "macro.fivetran_utils.snowflake__json_extract": {"name": "snowflake__json_extract", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/json_extract.sql", "original_file_path": "macros/json_extract.sql", "unique_id": "macro.fivetran_utils.snowflake__json_extract", "macro_sql": "{% macro snowflake__json_extract(string, string_path) %}\n\n json_extract_path_text(try_parse_json( {{string}} ), {{ \"'\" ~ string_path ~ \"'\" }} )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "string", "type": null, "description": ""}, {"name": "string_path", "type": null, "description": ""}], "created_at": 1789422567.0537546, "supported_languages": null}, "macro.fivetran_utils.redshift__json_extract": {"name": "redshift__json_extract", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/json_extract.sql", "original_file_path": "macros/json_extract.sql", "unique_id": "macro.fivetran_utils.redshift__json_extract", "macro_sql": "{% macro redshift__json_extract(string, string_path) %}\n\n case when is_valid_json( {{string}} ) then json_extract_path_text({{string}}, {{ \"'\" ~ string_path ~ \"'\" }} ) else null end\n \n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "string", "type": null, "description": ""}, {"name": "string_path", "type": null, "description": ""}], "created_at": 1789422567.0541115, "supported_languages": null}, "macro.fivetran_utils.bigquery__json_extract": {"name": "bigquery__json_extract", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/json_extract.sql", "original_file_path": "macros/json_extract.sql", "unique_id": "macro.fivetran_utils.bigquery__json_extract", "macro_sql": "{% macro bigquery__json_extract(string, string_path) %}\n\n json_extract_scalar({{string}}, {{ \"'$.\" ~ string_path ~ \"'\" }} )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "string", "type": null, "description": ""}, {"name": "string_path", "type": null, "description": ""}], "created_at": 1789422567.0544286, "supported_languages": null}, "macro.fivetran_utils.postgres__json_extract": {"name": "postgres__json_extract", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/json_extract.sql", "original_file_path": "macros/json_extract.sql", "unique_id": "macro.fivetran_utils.postgres__json_extract", "macro_sql": "{% macro postgres__json_extract(string, string_path) %}\n\n {{string}}::json->>{{\"'\" ~ string_path ~ \"'\" }}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "string", "type": null, "description": ""}, {"name": "string_path", "type": null, "description": ""}], "created_at": 1789422567.0547667, "supported_languages": null}, "macro.fivetran_utils.extract_url_parameter": {"name": "extract_url_parameter", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/extract_url_parameter.sql", "original_file_path": "macros/extract_url_parameter.sql", "unique_id": "macro.fivetran_utils.extract_url_parameter", "macro_sql": "{% macro extract_url_parameter(field, url_parameter) -%}\n\n{{ adapter.dispatch('extract_url_parameter', 'fivetran_utils') (field, url_parameter) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.default__extract_url_parameter"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field", "type": null, "description": ""}, {"name": "url_parameter", "type": null, "description": ""}], "created_at": 1789422567.055362, "supported_languages": null}, "macro.fivetran_utils.default__extract_url_parameter": {"name": "default__extract_url_parameter", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/extract_url_parameter.sql", "original_file_path": "macros/extract_url_parameter.sql", "unique_id": "macro.fivetran_utils.default__extract_url_parameter", "macro_sql": "{% macro default__extract_url_parameter(field, url_parameter) -%}\n\n{{ dbt_utils.get_url_parameter(field, url_parameter) }}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.get_url_parameter"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field", "type": null, "description": ""}, {"name": "url_parameter", "type": null, "description": ""}], "created_at": 1789422567.0558097, "supported_languages": null}, "macro.fivetran_utils.spark__extract_url_parameter": {"name": "spark__extract_url_parameter", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/extract_url_parameter.sql", "original_file_path": "macros/extract_url_parameter.sql", "unique_id": "macro.fivetran_utils.spark__extract_url_parameter", "macro_sql": "{% macro spark__extract_url_parameter(field, url_parameter) -%}\n\n{%- set formatted_url_parameter = \"'\" + url_parameter + \"=([^&]+)'\" -%}\nnullif(regexp_extract({{ field }}, {{ formatted_url_parameter }}, 1), '')\n\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field", "type": null, "description": ""}, {"name": "url_parameter", "type": null, "description": ""}], "created_at": 1789422567.0562558, "supported_languages": null}, "macro.fivetran_utils.string_agg": {"name": "string_agg", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/string_agg.sql", "original_file_path": "macros/string_agg.sql", "unique_id": "macro.fivetran_utils.string_agg", "macro_sql": "{% macro string_agg(field_to_agg, delimiter) -%}\n\n{{ adapter.dispatch('string_agg', 'fivetran_utils') (field_to_agg, delimiter) }}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.default__string_agg"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field_to_agg", "type": null, "description": ""}, {"name": "delimiter", "type": null, "description": ""}], "created_at": 1789422567.0569427, "supported_languages": null}, "macro.fivetran_utils.default__string_agg": {"name": "default__string_agg", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/string_agg.sql", "original_file_path": "macros/string_agg.sql", "unique_id": "macro.fivetran_utils.default__string_agg", "macro_sql": "{% macro default__string_agg(field_to_agg, delimiter) %}\n string_agg({{ field_to_agg }}, {{ delimiter }})\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field_to_agg", "type": null, "description": ""}, {"name": "delimiter", "type": null, "description": ""}], "created_at": 1789422567.057225, "supported_languages": null}, "macro.fivetran_utils.snowflake__string_agg": {"name": "snowflake__string_agg", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/string_agg.sql", "original_file_path": "macros/string_agg.sql", "unique_id": "macro.fivetran_utils.snowflake__string_agg", "macro_sql": "{% macro snowflake__string_agg(field_to_agg, delimiter) %}\n listagg({{ field_to_agg }}, {{ delimiter }})\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field_to_agg", "type": null, "description": ""}, {"name": "delimiter", "type": null, "description": ""}], "created_at": 1789422567.0575018, "supported_languages": null}, "macro.fivetran_utils.redshift__string_agg": {"name": "redshift__string_agg", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/string_agg.sql", "original_file_path": "macros/string_agg.sql", "unique_id": "macro.fivetran_utils.redshift__string_agg", "macro_sql": "{% macro redshift__string_agg(field_to_agg, delimiter) %}\n listagg({{ field_to_agg }}, {{ delimiter }})\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field_to_agg", "type": null, "description": ""}, {"name": "delimiter", "type": null, "description": ""}], "created_at": 1789422567.057803, "supported_languages": null}, "macro.fivetran_utils.spark__string_agg": {"name": "spark__string_agg", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/string_agg.sql", "original_file_path": "macros/string_agg.sql", "unique_id": "macro.fivetran_utils.spark__string_agg", "macro_sql": "{% macro spark__string_agg(field_to_agg, delimiter) %}\n -- collect set will remove duplicates\n replace(replace(replace(cast( collect_set({{ field_to_agg }}) as string), '[', ''), ']', ''), ', ', {{ delimiter }} )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field_to_agg", "type": null, "description": ""}, {"name": "delimiter", "type": null, "description": ""}], "created_at": 1789422567.0580823, "supported_languages": null}, "macro.fivetran_utils.max_bool": {"name": "max_bool", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/max_bool.sql", "original_file_path": "macros/max_bool.sql", "unique_id": "macro.fivetran_utils.max_bool", "macro_sql": "{% macro max_bool(boolean_field) -%}\n\n{{ adapter.dispatch('max_bool', 'fivetran_utils') (boolean_field) }}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.default__max_bool"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "boolean_field", "type": null, "description": ""}], "created_at": 1789422567.0586424, "supported_languages": null}, "macro.fivetran_utils.default__max_bool": {"name": "default__max_bool", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/max_bool.sql", "original_file_path": "macros/max_bool.sql", "unique_id": "macro.fivetran_utils.default__max_bool", "macro_sql": "{% macro default__max_bool(boolean_field) %}\n\n bool_or( {{ boolean_field }} )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "boolean_field", "type": null, "description": ""}], "created_at": 1789422567.0588825, "supported_languages": null}, "macro.fivetran_utils.snowflake__max_bool": {"name": "snowflake__max_bool", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/max_bool.sql", "original_file_path": "macros/max_bool.sql", "unique_id": "macro.fivetran_utils.snowflake__max_bool", "macro_sql": "{% macro snowflake__max_bool(boolean_field) %}\n\n max( {{ boolean_field }} )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "boolean_field", "type": null, "description": ""}], "created_at": 1789422567.0590987, "supported_languages": null}, "macro.fivetran_utils.bigquery__max_bool": {"name": "bigquery__max_bool", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/max_bool.sql", "original_file_path": "macros/max_bool.sql", "unique_id": "macro.fivetran_utils.bigquery__max_bool", "macro_sql": "{% macro bigquery__max_bool(boolean_field) %}\n\n max( {{ boolean_field }} )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "boolean_field", "type": null, "description": ""}], "created_at": 1789422567.0593126, "supported_languages": null}, "macro.fivetran_utils.empty_variable_warning": {"name": "empty_variable_warning", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/empty_variable_warning.sql", "original_file_path": "macros/empty_variable_warning.sql", "unique_id": "macro.fivetran_utils.empty_variable_warning", "macro_sql": "{% macro empty_variable_warning(variable, downstream_model) %}\n\n{% if not var(variable) %}\n{{ log(\n \"\"\"\n Warning: You have passed an empty list to the \"\"\" ~ variable ~ \"\"\".\n As a result, you won't see the history of any columns in the \"\"\" ~ downstream_model ~ \"\"\" model.\n \"\"\",\n info=True\n) }}\n{% endif %}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "variable", "type": null, "description": ""}, {"name": "downstream_model", "type": null, "description": ""}], "created_at": 1789422567.060093, "supported_languages": null}, "macro.fivetran_utils.dummy_coalesce_value": {"name": "dummy_coalesce_value", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/dummy_coalesce_value.sql", "original_file_path": "macros/dummy_coalesce_value.sql", "unique_id": "macro.fivetran_utils.dummy_coalesce_value", "macro_sql": "{% macro dummy_coalesce_value(column) %}\n\n{% set coalesce_value = {\n 'STRING': \"'DUMMY_STRING'\",\n 'BOOLEAN': 'null',\n 'INT': 999999999,\n 'FLOAT': 999999999.99,\n 'TIMESTAMP': 'cast(\"2099-12-31\" as timestamp)',\n 'DATE': 'cast(\"2099-12-31\" as date)',\n} %}\n\n{% if column.is_float() %}\n{{ return(coalesce_value['FLOAT']) }}\n\n{% elif column.is_numeric() %}\n{{ return(coalesce_value['INT']) }}\n\n{% elif column.is_string() %}\n{{ return(coalesce_value['STRING']) }}\n\n{% elif column.data_type|lower == 'boolean' %}\n{{ return(coalesce_value['BOOLEAN']) }}\n\n{% elif 'timestamp' in column.data_type|lower %}\n{{ return(coalesce_value['TIMESTAMP']) }}\n\n{% elif 'date' in column.data_type|lower %}\n{{ return(coalesce_value['DATE']) }}\n\n{% elif 'int' in column.data_type|lower %}\n{{ return(coalesce_value['INT']) }}\n\n{% endif %}\n\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "column", "type": null, "description": ""}], "created_at": 1789422567.0628223, "supported_languages": null}, "macro.fivetran_utils.percentile": {"name": "percentile", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/percentile.sql", "original_file_path": "macros/percentile.sql", "unique_id": "macro.fivetran_utils.percentile", "macro_sql": "{% macro percentile(percentile_field, partition_field, percent) -%}\n\n{{ adapter.dispatch('percentile', 'fivetran_utils') (percentile_field, partition_field, percent) }}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.postgres__percentile"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "percentile_field", "type": null, "description": ""}, {"name": "partition_field", "type": null, "description": ""}, {"name": "percent", "type": null, "description": ""}], "created_at": 1789422567.06375, "supported_languages": null}, "macro.fivetran_utils.default__percentile": {"name": "default__percentile", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/percentile.sql", "original_file_path": "macros/percentile.sql", "unique_id": "macro.fivetran_utils.default__percentile", "macro_sql": "{% macro default__percentile(percentile_field, partition_field, percent) %}\n\n percentile_cont( \n {{ percent }} )\n within group ( order by {{ percentile_field }} )\n over ( partition by {{ partition_field }} )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "percentile_field", "type": null, "description": ""}, {"name": "partition_field", "type": null, "description": ""}, {"name": "percent", "type": null, "description": ""}], "created_at": 1789422567.0640993, "supported_languages": null}, "macro.fivetran_utils.redshift__percentile": {"name": "redshift__percentile", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/percentile.sql", "original_file_path": "macros/percentile.sql", "unique_id": "macro.fivetran_utils.redshift__percentile", "macro_sql": "{% macro redshift__percentile(percentile_field, partition_field, percent) %}\n\n percentile_cont( \n {{ percent }} )\n within group ( order by {{ percentile_field }} )\n over ( partition by {{ partition_field }} )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "percentile_field", "type": null, "description": ""}, {"name": "partition_field", "type": null, "description": ""}, {"name": "percent", "type": null, "description": ""}], "created_at": 1789422567.0644395, "supported_languages": null}, "macro.fivetran_utils.bigquery__percentile": {"name": "bigquery__percentile", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/percentile.sql", "original_file_path": "macros/percentile.sql", "unique_id": "macro.fivetran_utils.bigquery__percentile", "macro_sql": "{% macro bigquery__percentile(percentile_field, partition_field, percent) %}\n\n percentile_cont( \n {{ percentile_field }}, \n {{ percent }}) \n over (partition by {{ partition_field }} \n )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "percentile_field", "type": null, "description": ""}, {"name": "partition_field", "type": null, "description": ""}, {"name": "percent", "type": null, "description": ""}], "created_at": 1789422567.0648038, "supported_languages": null}, "macro.fivetran_utils.postgres__percentile": {"name": "postgres__percentile", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/percentile.sql", "original_file_path": "macros/percentile.sql", "unique_id": "macro.fivetran_utils.postgres__percentile", "macro_sql": "{% macro postgres__percentile(percentile_field, partition_field, percent) %}\n\n percentile_cont( \n {{ percent }} )\n within group ( order by {{ percentile_field }} )\n /* have to group by partition field */\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "percentile_field", "type": null, "description": ""}, {"name": "partition_field", "type": null, "description": ""}, {"name": "percent", "type": null, "description": ""}], "created_at": 1789422567.0651069, "supported_languages": null}, "macro.fivetran_utils.spark__percentile": {"name": "spark__percentile", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/percentile.sql", "original_file_path": "macros/percentile.sql", "unique_id": "macro.fivetran_utils.spark__percentile", "macro_sql": "{% macro spark__percentile(percentile_field, partition_field, percent) %}\n\n percentile( \n {{ percentile_field }}, \n {{ percent }}) \n over (partition by {{ partition_field }} \n )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "percentile_field", "type": null, "description": ""}, {"name": "partition_field", "type": null, "description": ""}, {"name": "percent", "type": null, "description": ""}], "created_at": 1789422567.0654411, "supported_languages": null}, "macro.fivetran_utils.duckdb__percentile": {"name": "duckdb__percentile", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/percentile.sql", "original_file_path": "macros/percentile.sql", "unique_id": "macro.fivetran_utils.duckdb__percentile", "macro_sql": "{% macro duckdb__percentile(percentile_field, partition_field, percent) %}\n\n quantile_cont(\n {{ percentile_field }},\n {{ percent }})\n over (partition by {{ partition_field }}\n )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "percentile_field", "type": null, "description": ""}, {"name": "partition_field", "type": null, "description": ""}, {"name": "percent", "type": null, "description": ""}], "created_at": 1789422567.0657961, "supported_languages": null}, "macro.fivetran_utils.remove_prefix_from_columns": {"name": "remove_prefix_from_columns", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/remove_prefix_from_columns.sql", "original_file_path": "macros/remove_prefix_from_columns.sql", "unique_id": "macro.fivetran_utils.remove_prefix_from_columns", "macro_sql": "{% macro remove_prefix_from_columns(columns, prefix='', exclude=[]) %}\n\n {%- for col in columns if col.name not in exclude -%}\n {%- if col.name[:prefix|length]|lower == prefix -%}\n {{ col.name }} as {{ col.name[prefix|length:] }}\n {%- else -%}\n {{ col.name }}\n {%- endif -%}\n {%- if not loop.last -%},{%- endif %}\n {% endfor -%}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "columns", "type": null, "description": ""}, {"name": "prefix", "type": null, "description": ""}, {"name": "exclude", "type": null, "description": ""}], "created_at": 1789422567.0670316, "supported_languages": null}, "macro.fivetran_utils.snowflake_seed_data": {"name": "snowflake_seed_data", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/snowflake_seed_data.sql", "original_file_path": "macros/snowflake_seed_data.sql", "unique_id": "macro.fivetran_utils.snowflake_seed_data", "macro_sql": "{% macro snowflake_seed_data(seed_name) %}\n\n{% if target.type == 'snowflake' %}\n{{ return(ref(seed_name ~ '_snowflake')) }}\n{% else %}\n{{ return(ref(seed_name)) }}\n{% endif %}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "seed_name", "type": null, "description": ""}], "created_at": 1789422567.0678208, "supported_languages": null}}, "docs": {"doc.dbt.__overview__": {"name": "__overview__", "resource_type": "doc", "package_name": "dbt", "path": "overview.md", "original_file_path": "docs/overview.md", "unique_id": "doc.dbt.__overview__", "block_contents": "### Welcome!\n\nWelcome to the auto-generated documentation for your dbt project!\n\n### Navigation\n\nYou can use the `Project` and `Database` navigation tabs on the left side of the window to explore the models\nin your project.\n\n#### Project Tab\nThe `Project` tab mirrors the directory structure of your dbt project. In this tab, you can see all of the\nmodels defined in your dbt project, as well as models imported from dbt packages.\n\n#### Database Tab\nThe `Database` tab also exposes your models, but in a format that looks more like a database explorer. This view\nshows relations (tables and views) grouped into database schemas. Note that ephemeral models are _not_ shown\nin this interface, as they do not exist in the database.\n\n### Graph Exploration\nYou can click the blue icon on the bottom-right corner of the page to view the lineage graph of your models.\n\nOn model pages, you'll see the immediate parents and children of the model you're exploring. By clicking the `Expand`\nbutton at the top-right of this lineage pane, you'll be able to see all of the models that are used to build,\nor are built from, the model you're exploring.\n\nOnce expanded, you'll be able to use the `--select` and `--exclude` model selection syntax to filter the\nmodels in the graph. For more information on model selection, check out the [dbt docs](https://docs.getdbt.com/docs/model-selection-syntax).\n\nNote that you can also right-click on models to interactively filter and explore the graph.\n\n---\n\n### More information\n\n- [What is dbt](https://docs.getdbt.com/docs/introduction)?\n- Read the [dbt viewpoint](https://docs.getdbt.com/docs/viewpoint)\n- [Installation](https://docs.getdbt.com/docs/installation)\n- Join the [dbt Community](https://www.getdbt.com/community/) for questions and discussion"}, "doc.iterable.source_relation": {"name": "source_relation", "resource_type": "doc", "package_name": "iterable", "path": "docs.md", "original_file_path": "models/docs.md", "unique_id": "doc.iterable.source_relation", "block_contents": "Identifies the record's source."}, "doc.iterable._fivetran_synced": {"name": "_fivetran_synced", "resource_type": "doc", "package_name": "iterable", "path": "docs.md", "original_file_path": "models/docs.md", "unique_id": "doc.iterable._fivetran_synced", "block_contents": "The time when a record was last updated by Fivetran."}}, "exposures": {}, "metrics": {}, "groups": {}, "selectors": {}, "disabled": {"test.iterable_integration_tests.consistency_campaigns": [{"database": "postgres", "schema": "public_dbt_test__audit", "name": "consistency_campaigns", "resource_type": "test", "package_name": "iterable_integration_tests", "path": "consistency/consistency_campaigns.sql", "original_file_path": "tests/consistency/consistency_campaigns.sql", "unique_id": "test.iterable_integration_tests.consistency_campaigns", "fqn": ["iterable_integration_tests", "consistency", "consistency_campaigns"], "alias": "consistency_campaigns", "checksum": {"name": "sha256", "checksum": "30e008529ef9f5fa6d8697bbcff2562fc9b176d571cc310458e67e8c82a46185"}, "config": {"enabled": false, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": ["fivetran_validations"], "meta": {}, "group": null, "static_analysis": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "sql_header": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": ["fivetran_validations"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"tags": "fivetran_validations", "enabled": "var('fivetran_validation_tests_enabled', False)"}, "created_at": 1789422567.9130704, "relation_name": null, "raw_code": "{{ config(\n tags=\"fivetran_validations\",\n enabled=var('fivetran_validation_tests_enabled', false)\n) }}\n\n{% set exclude_cols = ['labels'] + var('consistency_test_exclude_metrics', []) %}\n{% set fields = dbt_utils.star(from=ref('iterable__campaigns'), except=exclude_cols) %}\n\n-- this test ensures the iterable__campaigns end model matches the prior version\nwith prod as (\n select {{ fields }}\n from {{ target.schema }}_iterable_prod.iterable__campaigns\n where date(updated_at) < date({{ dbt.current_timestamp() }})\n),\n\ndev as (\n select {{ fields }}\n from {{ target.schema }}_iterable_dev.iterable__campaigns\n where date(updated_at) < date({{ dbt.current_timestamp() }})\n),\n\nprod_not_in_dev as (\n -- rows from prod not found in dev\n select * from prod\n except distinct\n select * from dev\n),\n\ndev_not_in_prod as (\n -- rows from dev not found in prod\n select * from dev\n except distinct\n select * from prod\n),\n\nfinal as (\n select\n *,\n 'from prod' as source\n from prod_not_in_dev\n\n union all -- union since we only care if rows are produced\n\n select\n *,\n 'from dev' as source\n from dev_not_in_prod\n)\n\nselect *\nfrom final", "doc_blocks": [], "language": "sql", "refs": [{"name": "iterable__campaigns", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt_utils.star", "macro.dbt.current_timestamp"], "nodes": []}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}}], "test.iterable_integration_tests.consistency_user_unsubscriptions": [{"database": "postgres", "schema": "public_dbt_test__audit", "name": "consistency_user_unsubscriptions", "resource_type": "test", "package_name": "iterable_integration_tests", "path": "consistency/consistency_user_unsubscriptions.sql", "original_file_path": "tests/consistency/consistency_user_unsubscriptions.sql", "unique_id": "test.iterable_integration_tests.consistency_user_unsubscriptions", "fqn": ["iterable_integration_tests", "consistency", "consistency_user_unsubscriptions"], "alias": "consistency_user_unsubscriptions", "checksum": {"name": "sha256", "checksum": "32d0be8a7f721a49100a7f4b1046a8ecb1d75b86f4ad1a484d53a1d03343bc40"}, "config": {"enabled": false, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": ["fivetran_validations"], "meta": {}, "group": null, "static_analysis": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "sql_header": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": ["fivetran_validations"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"tags": "fivetran_validations", "enabled": "var('fivetran_validation_tests_enabled', False)"}, "created_at": 1789422567.9743235, "relation_name": null, "raw_code": "{{ config(\n tags=\"fivetran_validations\",\n enabled=var('fivetran_validation_tests_enabled', false)\n) }}\n\n{% set exclude_cols = var('consistency_test_exclude_metrics', []) %}\n{% set fields = dbt_utils.star(from=ref('iterable__user_unsubscriptions'), except=exclude_cols) %}\n\n-- this test ensures the iterable__user_unsubscriptions end model matches the prior version\nwith prod as (\n select {{ fields }}\n from {{ target.schema }}_iterable_prod.iterable__user_unsubscriptions\n),\n\ndev as (\n select {{ fields }}\n from {{ target.schema }}_iterable_dev.iterable__user_unsubscriptions\n),\n\nprod_not_in_dev as (\n -- rows from prod not found in dev\n select * from prod\n except distinct\n select * from dev\n),\n\ndev_not_in_prod as (\n -- rows from dev not found in prod\n select * from dev\n except distinct\n select * from prod\n),\n\nfinal as (\n select\n *,\n 'from prod' as source\n from prod_not_in_dev\n\n union all -- union since we only care if rows are produced\n\n select\n *,\n 'from dev' as source\n from dev_not_in_prod\n)\n\nselect *\nfrom final", "doc_blocks": [], "language": "sql", "refs": [{"name": "iterable__user_unsubscriptions", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt_utils.star"], "nodes": []}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}}], "test.iterable_integration_tests.consistency_list_user_history": [{"database": "postgres", "schema": "public_dbt_test__audit", "name": "consistency_list_user_history", "resource_type": "test", "package_name": "iterable_integration_tests", "path": "consistency/consistency_list_user_history.sql", "original_file_path": "tests/consistency/consistency_list_user_history.sql", "unique_id": "test.iterable_integration_tests.consistency_list_user_history", "fqn": ["iterable_integration_tests", "consistency", "consistency_list_user_history"], "alias": "consistency_list_user_history", "checksum": {"name": "sha256", "checksum": "e0081cf1366801020e3c9fbdc71e989f2bdd7b713ee328c2f4a5e9b97355601e"}, "config": {"enabled": false, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": ["fivetran_validations"], "meta": {}, "group": null, "static_analysis": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "sql_header": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": ["fivetran_validations"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"tags": "fivetran_validations", "enabled": "var('fivetran_validation_tests_enabled', False)"}, "created_at": 1789422567.982923, "relation_name": null, "raw_code": "{{ config(\n tags=\"fivetran_validations\",\n enabled=var('fivetran_validation_tests_enabled', false)\n) }}\n\n{% set exclude_cols = var('consistency_test_exclude_metrics', []) %}\n{% set fields = dbt_utils.star(from=ref('iterable__list_user_history'), except=exclude_cols) %}\n\n-- this test ensures the iterable__list_user_history end model matches the prior version\nwith prod as (\n select {{ fields }}\n from {{ target.schema }}_iterable_prod.iterable__list_user_history\n),\n\ndev as (\n select {{ fields }}\n from {{ target.schema }}_iterable_dev.iterable__list_user_history\n),\n\nprod_not_in_dev as (\n -- rows from prod not found in dev\n select * from prod\n except distinct\n select * from dev\n),\n\ndev_not_in_prod as (\n -- rows from dev not found in prod\n select * from dev\n except distinct\n select * from prod\n),\n\nfinal as (\n select\n *,\n 'from prod' as source\n from prod_not_in_dev\n\n union all -- union since we only care if rows are produced\n\n select\n *,\n 'from dev' as source\n from dev_not_in_prod\n)\n\nselect *\nfrom final", "doc_blocks": [], "language": "sql", "refs": [{"name": "iterable__list_user_history", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt_utils.star"], "nodes": []}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}}], "test.iterable_integration_tests.consistency_users": [{"database": "postgres", "schema": "public_dbt_test__audit", "name": "consistency_users", "resource_type": "test", "package_name": "iterable_integration_tests", "path": "consistency/consistency_users.sql", "original_file_path": "tests/consistency/consistency_users.sql", "unique_id": "test.iterable_integration_tests.consistency_users", "fqn": ["iterable_integration_tests", "consistency", "consistency_users"], "alias": "consistency_users", "checksum": {"name": "sha256", "checksum": "d367ccd8f7d79248da78ce29fc8f08876913df08b89866895cce315f46ef81e3"}, "config": {"enabled": false, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": ["fivetran_validations"], "meta": {}, "group": null, "static_analysis": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "sql_header": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": ["fivetran_validations"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"tags": "fivetran_validations", "enabled": "var('fivetran_validation_tests_enabled', False)"}, "created_at": 1789422567.991117, "relation_name": null, "raw_code": "{{ config(\n tags=\"fivetran_validations\",\n enabled=var('fivetran_validation_tests_enabled', false)\n) }}\n\n{% set exclude_cols = var('consistency_test_exclude_metrics', []) %}\n{% set fields = dbt_utils.star(from=ref('iterable__users'), except=exclude_cols) %}\n\n-- this test ensures the iterable__users end model matches the prior version\nwith prod as (\n select {{ fields }}\n from {{ target.schema }}_iterable_prod.iterable__users\n where date(updated_at) < date({{ dbt.current_timestamp() }})\n),\n\ndev as (\n select {{ fields }}\n from {{ target.schema }}_iterable_dev.iterable__users\n where date(updated_at) < date({{ dbt.current_timestamp() }})\n),\n\nprod_not_in_dev as (\n -- rows from prod not found in dev\n select * from prod\n except distinct\n select * from dev\n),\n\ndev_not_in_prod as (\n -- rows from dev not found in prod\n select * from dev\n except distinct\n select * from prod\n),\n\nfinal as (\n select\n *,\n 'from prod' as source\n from prod_not_in_dev\n\n union all -- union since we only care if rows are produced\n\n select\n *,\n 'from dev' as source\n from dev_not_in_prod\n)\n\nselect *\nfrom final", "doc_blocks": [], "language": "sql", "refs": [{"name": "iterable__users", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt_utils.star", "macro.dbt.current_timestamp"], "nodes": []}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}}], "test.iterable_integration_tests.consistency_user_unsubscribes_pre_aug_2023": [{"database": "postgres", "schema": "public_dbt_test__audit", "name": "consistency_user_unsubscribes_pre_aug_2023", "resource_type": "test", "package_name": "iterable_integration_tests", "path": "consistency/consistency_user_unsubscribes_pre_aug_2023.sql", "original_file_path": "tests/consistency/consistency_user_unsubscribes_pre_aug_2023.sql", "unique_id": "test.iterable_integration_tests.consistency_user_unsubscribes_pre_aug_2023", "fqn": ["iterable_integration_tests", "consistency", "consistency_user_unsubscribes_pre_aug_2023"], "alias": "consistency_user_unsubscribes_pre_aug_2023", "checksum": {"name": "sha256", "checksum": "0d85b35d94066e59119f57fbe930a19353dfbb79b4e812b54de9c19520a58402"}, "config": {"enabled": false, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": ["fivetran_validations"], "meta": {}, "group": null, "static_analysis": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "sql_header": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": ["fivetran_validations"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"tags": "fivetran_validations", "enabled": "var('fivetran_validation_tests_enabled', False)"}, "created_at": 1789422568.0003777, "relation_name": null, "raw_code": "-- These validation tests were designed to work with the pre-August 2023 version of the Iterable connector.\n-- You will thus need to comment out `iterable_user_unsubscribed_channel_identifier` and `iterable_user_unsubscribed_message_type_identifier` in the `integration_tests/dbt_project.yml` to run and validate these tests. \n\n{{ config(\n tags=\"fivetran_validations\",\n enabled=var('fivetran_validation_tests_enabled', false)\n) }}\n\n\nwith prod as (\n\n select \n unique_user_key, \n coalesce(count(distinct unique_user_key), 0) as unique_user_records_prod, \n coalesce(count(distinct channel_id), 0) as channels_prod, \n coalesce(count(distinct message_type_id), 0) as message_types_prod\n from {{ target.schema }}_iterable_prod.iterable__user_unsubscriptions\n where channel_id is not null\n and message_type_id is not null\n group by 1\n),\n\ndev as (\n\n select \n unique_user_key, \n coalesce(count(distinct unique_user_key), 0) as unique_user_records_dev, \n coalesce(count(distinct channel_id), 0) as channels_dev, \n coalesce(count(distinct message_type_id), 0) as message_types_dev\n from {{ target.schema }}_iterable_dev.iterable__user_unsubscriptions\n where channel_id is not null\n and message_type_id is not null\n group by 1\n),\n\nfinal as (\n\n select \n prod.unique_user_key,\n unique_user_records_prod,\n unique_user_records_dev,\n channels_prod,\n channels_dev,\n message_types_prod,\n message_types_dev\n from prod\n full outer join dev\n on prod.unique_user_key = dev.unique_user_key\n) \n\nselect *\nfrom final\nwhere unique_user_records_prod != unique_user_records_dev\n and channels_prod != channels_dev \n and message_types_prod != message_types_dev", "doc_blocks": [], "language": "sql", "refs": [], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": [], "nodes": []}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}}], "test.iterable_integration_tests.consistency_user_campaign": [{"database": "postgres", "schema": "public_dbt_test__audit", "name": "consistency_user_campaign", "resource_type": "test", "package_name": "iterable_integration_tests", "path": "consistency/consistency_user_campaign.sql", "original_file_path": "tests/consistency/consistency_user_campaign.sql", "unique_id": "test.iterable_integration_tests.consistency_user_campaign", "fqn": ["iterable_integration_tests", "consistency", "consistency_user_campaign"], "alias": "consistency_user_campaign", "checksum": {"name": "sha256", "checksum": "8663f2c250688a8303d2ef38dc723e2fc62d996396b4b07e13c05feeb48cd97c"}, "config": {"enabled": false, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": ["fivetran_validations"], "meta": {}, "group": null, "static_analysis": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "sql_header": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": ["fivetran_validations"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"tags": "fivetran_validations", "enabled": "var('fivetran_validation_tests_enabled', False)"}, "created_at": 1789422568.006229, "relation_name": null, "raw_code": "{{ config(\n tags=\"fivetran_validations\",\n enabled=var('fivetran_validation_tests_enabled', false)\n) }}\n\n{% set exclude_cols = var('consistency_test_exclude_metrics', []) %}\n{% set fields = dbt_utils.star(from=ref('iterable__user_campaign'), except=exclude_cols) %}\n\n-- this test ensures the iterable__user_campaign end model matches the prior version\nwith prod as (\n select {{ fields }}\n from {{ target.schema }}_iterable_prod.iterable__user_campaign\n where date(first_event_at) < date({{ dbt.current_timestamp() }})\n),\n\ndev as (\n select {{ fields }}\n from {{ target.schema }}_iterable_dev.iterable__user_campaign\n where date(first_event_at) < date({{ dbt.current_timestamp() }})\n),\n\nprod_not_in_dev as (\n -- rows from prod not found in dev\n select * from prod\n except distinct\n select * from dev\n),\n\ndev_not_in_prod as (\n -- rows from dev not found in prod\n select * from dev\n except distinct\n select * from prod\n),\n\nfinal as (\n select\n *,\n 'from prod' as source\n from prod_not_in_dev\n\n union all -- union since we only care if rows are produced\n\n select\n *,\n 'from dev' as source\n from dev_not_in_prod\n)\n\nselect *\nfrom final", "doc_blocks": [], "language": "sql", "refs": [{"name": "iterable__user_campaign", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt_utils.star", "macro.dbt.current_timestamp"], "nodes": []}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}}], "test.iterable_integration_tests.consistency_events": [{"database": "postgres", "schema": "public_dbt_test__audit", "name": "consistency_events", "resource_type": "test", "package_name": "iterable_integration_tests", "path": "consistency/consistency_events.sql", "original_file_path": "tests/consistency/consistency_events.sql", "unique_id": "test.iterable_integration_tests.consistency_events", "fqn": ["iterable_integration_tests", "consistency", "consistency_events"], "alias": "consistency_events", "checksum": {"name": "sha256", "checksum": "6e82de77a605ca7613eb3563f2158ad172785552d38cbf3617136a816c073b36"}, "config": {"enabled": false, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": ["fivetran_validations"], "meta": {}, "group": null, "static_analysis": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "sql_header": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": ["fivetran_validations"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"tags": "fivetran_validations", "enabled": "var('fivetran_validation_tests_enabled', False)"}, "created_at": 1789422568.0157788, "relation_name": null, "raw_code": "{{ config(\n tags=\"fivetran_validations\",\n enabled=var('fivetran_validation_tests_enabled', false)\n) }}\n\n-- exclude JSON fields\n{% set exclude_cols = ['additional_properties', 'transactional_data'] + var('consistency_test_exclude_metrics', []) %}\n{% set fields = dbt_utils.star(from=ref('iterable__events'), except=exclude_cols) %}\n\n-- this test ensures the iterable__events end model matches the prior version\nwith prod as (\n select {{ fields }}\n from {{ target.schema }}_iterable_prod.iterable__events\n where date(created_at) < date({{ dbt.current_timestamp() }})\n),\n\ndev as (\n select {{ fields }}\n from {{ target.schema }}_iterable_dev.iterable__events\n where date(created_at) < date({{ dbt.current_timestamp() }})\n),\n\nprod_not_in_dev as (\n -- rows from prod not found in dev\n select * from prod\n except distinct\n select * from dev\n),\n\ndev_not_in_prod as (\n -- rows from dev not found in prod\n select * from dev\n except distinct\n select * from prod\n),\n\nfinal as (\n select\n *,\n 'from prod' as source\n from prod_not_in_dev\n\n union all -- union since we only care if rows are produced\n\n select\n *,\n 'from dev' as source\n from dev_not_in_prod\n)\n\nselect *\nfrom final", "doc_blocks": [], "language": "sql", "refs": [{"name": "iterable__events", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt_utils.star", "macro.dbt.current_timestamp"], "nodes": []}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}}], "test.iterable_integration_tests.consistency_journeys": [{"database": "postgres", "schema": "public_dbt_test__audit", "name": "consistency_journeys", "resource_type": "test", "package_name": "iterable_integration_tests", "path": "consistency/consistency_journeys.sql", "original_file_path": "tests/consistency/consistency_journeys.sql", "unique_id": "test.iterable_integration_tests.consistency_journeys", "fqn": ["iterable_integration_tests", "consistency", "consistency_journeys"], "alias": "consistency_journeys", "checksum": {"name": "sha256", "checksum": "93a73b2e7e1d608a1116fddcec932e15ce18a57fb099872a13b4f97ca006d18f"}, "config": {"enabled": false, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": ["fivetran_validations"], "meta": {}, "group": null, "static_analysis": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "sql_header": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": ["fivetran_validations"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"tags": "fivetran_validations", "enabled": "var('fivetran_validation_tests_enabled', False)"}, "created_at": 1789422568.0267456, "relation_name": null, "raw_code": "{{ config(\n tags=\"fivetran_validations\",\n enabled=var('fivetran_validation_tests_enabled', false)\n) }}\n\n{% set exclude_cols = ['trigger_event_names'] + var('consistency_test_exclude_metrics', []) %}\n{% set fields = dbt_utils.star(from=ref('iterable__journeys'), except=exclude_cols) %}\n\n-- this test ensures the iterable__journeys end model matches the prior version\nwith prod as (\n select {{ fields }}\n from {{ target.schema }}_iterable_prod.iterable__journeys\n where date(updated_at) < date({{ dbt.current_timestamp() }})\n),\n\ndev as (\n select {{ fields }}\n from {{ target.schema }}_iterable_dev.iterable__journeys\n where date(updated_at) < date({{ dbt.current_timestamp() }})\n),\n\nprod_not_in_dev as (\n -- rows from prod not found in dev\n select * from prod\n except distinct\n select * from dev\n),\n\ndev_not_in_prod as (\n -- rows from dev not found in prod\n select * from dev\n except distinct\n select * from prod\n),\n\nfinal as (\n select\n *,\n 'from prod' as source\n from prod_not_in_dev\n\n union all -- union since we only care if rows are produced\n\n select\n *,\n 'from dev' as source\n from dev_not_in_prod\n)\n\nselect *\nfrom final", "doc_blocks": [], "language": "sql", "refs": [{"name": "iterable__journeys", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt_utils.star", "macro.dbt.current_timestamp"], "nodes": []}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}}], "test.iterable_integration_tests.user_unsubscribe_count_match_pre_aug_2023": [{"database": "postgres", "schema": "public_dbt_test__audit", "name": "user_unsubscribe_count_match_pre_aug_2023", "resource_type": "test", "package_name": "iterable_integration_tests", "path": "integrity/user_unsubscribe_count_match_pre_aug_2023.sql", "original_file_path": "tests/integrity/user_unsubscribe_count_match_pre_aug_2023.sql", "unique_id": "test.iterable_integration_tests.user_unsubscribe_count_match_pre_aug_2023", "fqn": ["iterable_integration_tests", "integrity", "user_unsubscribe_count_match_pre_aug_2023"], "alias": "user_unsubscribe_count_match_pre_aug_2023", "checksum": {"name": "sha256", "checksum": "6b37518965460a9c0b7161808527fa4b6f240a6ead0827a3950705267ebd236f"}, "config": {"enabled": false, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": ["fivetran_validations"], "meta": {}, "group": null, "static_analysis": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "sql_header": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": ["fivetran_validations"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"tags": "fivetran_validations", "enabled": "var('fivetran_validation_tests_enabled', False)"}, "created_at": 1789422568.0365741, "relation_name": null, "raw_code": "-- These validation tests were designed to work with the pre-August 2023 version of the Iterable connector.\n-- You will thus need to comment out `iterable_user_unsubscribed_channel_identifier` and `iterable_user_unsubscribed_message_type_identifier` in the `integration_tests/dbt_project.yml` to run and validate these tests. \n\n{{ config(\n tags=\"fivetran_validations\",\n enabled=var('fivetran_validation_tests_enabled', false)\n) }}\n\nwith unsub_channels as (\n\n select \n unique_user_key, \n channel_id\n from {{ ref('stg_iterable__user_unsubscribed_channel') }}\n group by 1, 2\n),\n\nunsub_messages as (\n\n select \n unique_user_key, \n message_type_id\n from {{ ref('stg_iterable__user_unsub_message_type') }}\n group by 1, 2\n),\n\nchannel_message_combos as (\n\n select channel_id, message_type_id \n from {{ ref('stg_iterable__message_type') }}\n group by 1, 2\n),\n\nmessage_channel_unsubs as (\n\n select \n unsub_channels.unique_user_key as unique_user_key_source,\n channel_message_combos.channel_id as channel_source,\n channel_message_combos.message_type_id as message_type_source\n from unsub_channels \n inner join channel_message_combos\n on unsub_channels.channel_id = channel_message_combos.channel_id\n\n union all\n\n select \n unsub_messages.unique_user_key as unique_user_key_source,\n channel_message_combos.channel_id as channel_source,\n channel_message_combos.message_type_id as message_type_source\n from unsub_messages\n inner join channel_message_combos\n on unsub_messages.message_type_id = channel_message_combos.message_type_id\n\n),\n\nsource_counts as (\n\n select unique_user_key_source, channel_source, message_type_source, count(*) as source_count\n from message_channel_unsubs \n group by 1, 2, 3\n),\n\nend_model_counts as (\n\n select unique_user_key as unique_user_key_end, channel_id as channel_end, message_type_id as message_type_end, count(*) as end_count\n from {{ ref('iterable__user_unsubscriptions') }}\n group by 1, 2, 3 \n)\n\nselect * \nfrom source_counts\ninner join end_model_counts \n on source_counts.unique_user_key_source = end_model_counts.unique_user_key_end\nwhere source_counts.channel_source = end_model_counts.channel_end\n and source_counts.message_type_source = end_model_counts.message_type_end\n and source_counts.source_count != end_model_counts.end_count", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__user_unsubscribed_channel", "package": null, "version": null}, {"name": "stg_iterable__user_unsub_message_type", "package": null, "version": null}, {"name": "stg_iterable__message_type", "package": null, "version": null}, {"name": "iterable__user_unsubscriptions", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": [], "nodes": []}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}}], "model.iterable.int_iterable__custom_events": [{"database": "postgres", "schema": "public_iterable_dev", "name": "int_iterable__custom_events", "resource_type": "model", "package_name": "iterable", "path": "intermediate/int_iterable__custom_events.sql", "original_file_path": "models/intermediate/int_iterable__custom_events.sql", "unique_id": "model.iterable.int_iterable__custom_events", "fqn": ["iterable", "intermediate", "int_iterable__custom_events"], "alias": "int_iterable__custom_events", "checksum": {"name": "sha256", "checksum": "0f0f1330b62dd5a320f37f7e30dae86a90c57e07c135369a259cfcba61875a16"}, "config": {"enabled": false, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "incremental", "incremental_strategy": "merge", "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": "event_id", "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}, "file_format": "delta"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"materialized": "incremental", "schema": "iterable_{{ var('directed_schema','dev') }}", "unique_key": "event_id", "incremental_strategy": "merge", "file_format": "delta", "enabled": "False", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789422568.7904952, "relation_name": "\"postgres\".\"public_iterable_dev\".\"int_iterable__custom_events\"", "raw_code": "{{\n config(\n materialized='incremental',\n unique_key='event_id',\n incremental_strategy = 'merge',\n file_format = 'delta',\n enabled=false\n )\n}}\n\n-- leave this alone for now....setting enabled to false\nwith events as (\n\n select *\n from {{ ref('stg_iterable__event') }}\n\n where lower(event_name) = 'customevent'\n {% if is_incremental() %}\n and updated_at > ( select max(updated_at) from {{ this }} )\n {% endif %}\n\n), custom_events as (\n\n select \n events.*\n {# {{ dbt.split_part(string_text='additional_properties', delimiter_text=' : \"{', part_number=1) }} #}\n\n {% if target.type == 'snowflake' %}\n ,\n additional_properties.key as custom_event_name,\n additional_properties.value as custom_event_metadata\n {% endif %}\n from events\n\n \n {% if target.type == 'snowflake' %}\n cross join \n table(flatten(additional_properties)) as additional_properties\n where additional_properties.key != '_id'\n {% endif %}\n)\n\nselect *\nfrom custom_events", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__event", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.is_incremental"], "nodes": []}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}]}, "parent_map": {"seed.iterable_integration_tests.campaign_metrics_data": [], "seed.iterable_integration_tests.campaign_list_history_data": [], "seed.iterable_integration_tests.user_unsubscribed_message_type_history_data": [], "seed.iterable_integration_tests.user_unsubscribed_channel_history_data": [], "seed.iterable_integration_tests.campaign_suppression_list_history_data": [], "seed.iterable_integration_tests.channel_data": [], "seed.iterable_integration_tests.template_history_data": [], "seed.iterable_integration_tests.message_type_data": [], "seed.iterable_integration_tests.event_data": [], "seed.iterable_integration_tests.list_user_data": [], "seed.iterable_integration_tests.user_history_bq_json_data": [], "seed.iterable_integration_tests.user_unsubscribed_message_type_data": [], "seed.iterable_integration_tests.journey_data": [], "seed.iterable_integration_tests.campaign_history_data": [], "seed.iterable_integration_tests.list_data": [], "seed.iterable_integration_tests.event_extension_data": [], "seed.iterable_integration_tests.user_unsubscribed_channel_data": [], "seed.iterable_integration_tests.campaign_label_history_data": [], "seed.iterable_integration_tests.user_history_data": [], "model.iterable.iterable__users": ["model.iterable.int_iterable__list_user_unnest", "model.iterable.int_iterable__user_event_metrics", "model.iterable.stg_iterable__list_user"], "model.iterable.iterable__list_user_history": ["model.iterable.int_iterable__list_user_unnest", "model.iterable.stg_iterable__list", "model.iterable.stg_iterable__list_user"], "model.iterable.iterable__events": ["model.iterable.int_iterable__latest_template", "model.iterable.int_iterable__latest_user", "model.iterable.int_iterable__message_type_channel", "model.iterable.int_iterable__recurring_campaigns", "model.iterable.stg_iterable__event", "model.iterable.stg_iterable__event_extension"], "model.iterable.iterable__user_campaign": ["model.iterable.iterable__events"], "model.iterable.iterable__user_unsubscriptions": ["model.iterable.int_iterable__message_type_channel", "model.iterable.stg_iterable__user_unsub_message_type", "model.iterable.stg_iterable__user_unsubscribed_channel"], "model.iterable.iterable__journeys": ["model.iterable.int_iterable__journey_event_metrics", "model.iterable.stg_iterable__journey"], "model.iterable.iterable__campaigns": ["model.iterable.int_iterable__campaign_event_metrics", "model.iterable.int_iterable__campaign_labels", "model.iterable.int_iterable__campaign_lists", "model.iterable.int_iterable__latest_template", "model.iterable.int_iterable__recurring_campaigns", "model.iterable.stg_iterable__journey"], "model.iterable.int_iterable__campaign_labels": ["model.iterable.stg_iterable__campaign_label_history"], "model.iterable.int_iterable__journey_event_metrics": ["model.iterable.int_iterable__recurring_campaigns", "model.iterable.iterable__user_campaign"], "model.iterable.int_iterable__list_user_unnest": ["model.iterable.int_iterable__list_user_history"], "model.iterable.int_iterable__latest_template": ["model.iterable.int_iterable__message_type_channel", "model.iterable.stg_iterable__template_history"], "model.iterable.int_iterable__campaign_event_metrics": ["model.iterable.iterable__user_campaign"], "model.iterable.int_iterable__campaign_lists": ["model.iterable.stg_iterable__campaign_list_history", "model.iterable.stg_iterable__campaign_suppression_list_history"], "model.iterable.int_iterable__recurring_campaigns": ["model.iterable.int_iterable__latest_campaign"], "model.iterable.int_iterable__list_user_history": ["model.iterable.stg_iterable__user_history"], "model.iterable.int_iterable__message_type_channel": ["model.iterable.stg_iterable__channel", "model.iterable.stg_iterable__message_type"], "model.iterable.int_iterable__user_event_metrics": ["model.iterable.iterable__user_campaign"], "model.iterable.int_iterable__latest_user": ["model.iterable.stg_iterable__user_history"], "model.iterable.int_iterable__latest_campaign": ["model.iterable.stg_iterable__campaign_history"], "model.iterable.stg_iterable__message_type": ["model.iterable.stg_iterable__message_type_tmp"], "model.iterable.stg_iterable__event": ["model.iterable.stg_iterable__event_tmp"], "model.iterable.stg_iterable__user_unsubscribed_channel": ["model.iterable.stg_iterable__user_unsubscribed_channel_tmp"], "model.iterable.stg_iterable__campaign_history": ["model.iterable.stg_iterable__campaign_history_tmp"], "model.iterable.stg_iterable__campaign_label_history": ["model.iterable.stg_iterable__campaign_label_history_tmp"], "model.iterable.stg_iterable__template_history": ["model.iterable.stg_iterable__template_history_tmp"], "model.iterable.stg_iterable__journey": ["model.iterable.stg_iterable__journey_tmp"], "model.iterable.stg_iterable__user_history": ["model.iterable.stg_iterable__user_history_tmp"], "model.iterable.stg_iterable__user_unsub_message_type": ["model.iterable.stg_iterable__user_unsub_message_type_tmp"], "model.iterable.stg_iterable__list": ["model.iterable.stg_iterable__list_tmp"], "model.iterable.stg_iterable__list_user": ["model.iterable.stg_iterable__list_user_tmp"], "model.iterable.stg_iterable__campaign_suppression_list_history": ["model.iterable.stg_iterable__campaign_suppression_list_history_tmp"], "model.iterable.stg_iterable__event_extension": ["model.iterable.stg_iterable__event_extension_tmp"], "model.iterable.stg_iterable__campaign_list_history": ["model.iterable.stg_iterable__campaign_list_history_tmp"], "model.iterable.stg_iterable__channel": ["model.iterable.stg_iterable__channel_tmp"], "model.iterable.stg_iterable__message_type_tmp": ["source.iterable.iterable.message_type"], "model.iterable.stg_iterable__event_extension_tmp": ["source.iterable.iterable.event_extension"], "model.iterable.stg_iterable__user_unsub_message_type_tmp": ["source.iterable.iterable.user_unsubscribed_message_type_history"], "model.iterable.stg_iterable__campaign_list_history_tmp": ["source.iterable.iterable.campaign_list_history"], "model.iterable.stg_iterable__list_user_tmp": ["source.iterable.iterable.list_user"], "model.iterable.stg_iterable__user_history_tmp": ["source.iterable.iterable.user_history"], "model.iterable.stg_iterable__campaign_history_tmp": ["source.iterable.iterable.campaign_history"], "model.iterable.stg_iterable__template_history_tmp": ["source.iterable.iterable.template_history"], "model.iterable.stg_iterable__event_tmp": ["source.iterable.iterable.event"], "model.iterable.stg_iterable__journey_tmp": ["source.iterable.iterable.journey"], "model.iterable.stg_iterable__campaign_suppression_list_history_tmp": ["source.iterable.iterable.campaign_suppression_list_history"], "model.iterable.stg_iterable__campaign_label_history_tmp": ["source.iterable.iterable.campaign_label_history"], "model.iterable.stg_iterable__list_tmp": ["source.iterable.iterable.list"], "model.iterable.stg_iterable__channel_tmp": ["source.iterable.iterable.channel"], "model.iterable.stg_iterable__user_unsubscribed_channel_tmp": ["source.iterable.iterable.user_unsubscribed_channel_history"], "test.iterable.not_null_iterable__campaigns_campaign_id.03c9448919": ["model.iterable.iterable__campaigns"], "test.iterable.not_null_iterable__events_event_id.ed1d28a650": ["model.iterable.iterable__events"], "test.iterable.not_null_iterable__journeys_journey_id.b5c6b8783a": ["model.iterable.iterable__journeys"], "test.iterable.unique_iterable__journeys_unique_journey_id.ba86841246": ["model.iterable.iterable__journeys"], "test.iterable.not_null_iterable__user_unsubscriptions_unique_user_key.f8db72932b": ["model.iterable.iterable__user_unsubscriptions"], "test.iterable.not_null_iterable__users_unique_user_key.4ca37a26c8": ["model.iterable.iterable__users"], "test.iterable.not_null_stg_iterable__campaign_history_campaign_id.b7c36e4525": ["model.iterable.stg_iterable__campaign_history"], "test.iterable.not_null_stg_iterable__campaign_label_history_campaign_id.1918cef89a": ["model.iterable.stg_iterable__campaign_label_history"], "test.iterable.not_null_stg_iterable__campaign_list_history_campaign_id.208f9bf9ed": ["model.iterable.stg_iterable__campaign_list_history"], "test.iterable.not_null_stg_iterable__campaign_suppression_list_history_campaign_id.3921289710": ["model.iterable.stg_iterable__campaign_suppression_list_history"], "test.iterable.not_null_stg_iterable__channel_channel_id.182ceb9636": ["model.iterable.stg_iterable__channel"], "test.iterable.not_null_stg_iterable__event_event_id.370cd4bc9d": ["model.iterable.stg_iterable__event"], "test.iterable.not_null_stg_iterable__event_unique_event_id.e2b46d3bb6": ["model.iterable.stg_iterable__event"], "test.iterable.not_null_stg_iterable__event_extension_event_id.144dedcd30": ["model.iterable.stg_iterable__event_extension"], "test.iterable.not_null_stg_iterable__journey_journey_id.cc38bd633c": ["model.iterable.stg_iterable__journey"], "test.iterable.not_null_stg_iterable__list_list_id.47029d839a": ["model.iterable.stg_iterable__list"], "test.iterable.not_null_stg_iterable__message_type_message_type_id.75eaa6fa62": ["model.iterable.stg_iterable__message_type"], "test.iterable.not_null_stg_iterable__template_history_template_id.14b24a1dfe": ["model.iterable.stg_iterable__template_history"], "test.iterable.not_null_stg_iterable__list_user__fivetran_user_id.cca4b34c07": ["model.iterable.stg_iterable__list_user"], "test.iterable.not_null_stg_iterable__user_history_unique_user_key.2845af2127": ["model.iterable.stg_iterable__user_history"], "test.iterable.not_null_stg_iterable__user_unsubscribed_channel_channel_id.da0ed9e9be": ["model.iterable.stg_iterable__user_unsubscribed_channel"], "test.iterable.not_null_stg_iterable__user_unsub_message_type_message_type_id.268a89ea6f": ["model.iterable.stg_iterable__user_unsub_message_type"], "source.iterable.iterable.campaign_history": [], "source.iterable.iterable.campaign_label_history": [], "source.iterable.iterable.campaign_list_history": [], "source.iterable.iterable.campaign_suppression_list_history": [], "source.iterable.iterable.channel": [], "source.iterable.iterable.event": [], "source.iterable.iterable.event_extension": [], "source.iterable.iterable.journey": [], "source.iterable.iterable.list": [], "source.iterable.iterable.message_type": [], "source.iterable.iterable.template_history": [], "source.iterable.iterable.user_history": [], "source.iterable.iterable.user_unsubscribed_channel": [], "source.iterable.iterable.user_unsubscribed_message_type": [], "source.iterable.iterable.user_unsubscribed_channel_history": [], "source.iterable.iterable.user_unsubscribed_message_type_history": [], "source.iterable.iterable.list_user": []}, "child_map": {"seed.iterable_integration_tests.campaign_metrics_data": [], "seed.iterable_integration_tests.campaign_list_history_data": [], "seed.iterable_integration_tests.user_unsubscribed_message_type_history_data": [], "seed.iterable_integration_tests.user_unsubscribed_channel_history_data": [], "seed.iterable_integration_tests.campaign_suppression_list_history_data": [], "seed.iterable_integration_tests.channel_data": [], "seed.iterable_integration_tests.template_history_data": [], "seed.iterable_integration_tests.message_type_data": [], "seed.iterable_integration_tests.event_data": [], "seed.iterable_integration_tests.list_user_data": [], "seed.iterable_integration_tests.user_history_bq_json_data": [], "seed.iterable_integration_tests.user_unsubscribed_message_type_data": [], "seed.iterable_integration_tests.journey_data": [], "seed.iterable_integration_tests.campaign_history_data": [], "seed.iterable_integration_tests.list_data": [], "seed.iterable_integration_tests.event_extension_data": [], "seed.iterable_integration_tests.user_unsubscribed_channel_data": [], "seed.iterable_integration_tests.campaign_label_history_data": [], "seed.iterable_integration_tests.user_history_data": [], "model.iterable.iterable__users": ["test.iterable.not_null_iterable__users_unique_user_key.4ca37a26c8"], "model.iterable.iterable__list_user_history": [], "model.iterable.iterable__events": ["model.iterable.iterable__user_campaign", "test.iterable.not_null_iterable__events_event_id.ed1d28a650"], "model.iterable.iterable__user_campaign": ["model.iterable.int_iterable__campaign_event_metrics", "model.iterable.int_iterable__journey_event_metrics", "model.iterable.int_iterable__user_event_metrics"], "model.iterable.iterable__user_unsubscriptions": ["test.iterable.not_null_iterable__user_unsubscriptions_unique_user_key.f8db72932b"], "model.iterable.iterable__journeys": ["test.iterable.not_null_iterable__journeys_journey_id.b5c6b8783a", "test.iterable.unique_iterable__journeys_unique_journey_id.ba86841246"], "model.iterable.iterable__campaigns": ["test.iterable.not_null_iterable__campaigns_campaign_id.03c9448919"], "model.iterable.int_iterable__campaign_labels": ["model.iterable.iterable__campaigns"], "model.iterable.int_iterable__journey_event_metrics": ["model.iterable.iterable__journeys"], "model.iterable.int_iterable__list_user_unnest": ["model.iterable.iterable__list_user_history", "model.iterable.iterable__users"], "model.iterable.int_iterable__latest_template": ["model.iterable.iterable__campaigns", "model.iterable.iterable__events"], "model.iterable.int_iterable__campaign_event_metrics": ["model.iterable.iterable__campaigns"], "model.iterable.int_iterable__campaign_lists": ["model.iterable.iterable__campaigns"], "model.iterable.int_iterable__recurring_campaigns": ["model.iterable.int_iterable__journey_event_metrics", "model.iterable.iterable__campaigns", "model.iterable.iterable__events"], "model.iterable.int_iterable__list_user_history": ["model.iterable.int_iterable__list_user_unnest"], "model.iterable.int_iterable__message_type_channel": ["model.iterable.int_iterable__latest_template", "model.iterable.iterable__events", "model.iterable.iterable__user_unsubscriptions"], "model.iterable.int_iterable__user_event_metrics": ["model.iterable.iterable__users"], "model.iterable.int_iterable__latest_user": ["model.iterable.iterable__events"], "model.iterable.int_iterable__latest_campaign": ["model.iterable.int_iterable__recurring_campaigns"], "model.iterable.stg_iterable__message_type": ["model.iterable.int_iterable__message_type_channel", "test.iterable.not_null_stg_iterable__message_type_message_type_id.75eaa6fa62"], "model.iterable.stg_iterable__event": ["model.iterable.iterable__events", "test.iterable.not_null_stg_iterable__event_event_id.370cd4bc9d", "test.iterable.not_null_stg_iterable__event_unique_event_id.e2b46d3bb6"], "model.iterable.stg_iterable__user_unsubscribed_channel": ["model.iterable.iterable__user_unsubscriptions", "test.iterable.not_null_stg_iterable__user_unsubscribed_channel_channel_id.da0ed9e9be"], "model.iterable.stg_iterable__campaign_history": ["model.iterable.int_iterable__latest_campaign", "test.iterable.not_null_stg_iterable__campaign_history_campaign_id.b7c36e4525"], "model.iterable.stg_iterable__campaign_label_history": ["model.iterable.int_iterable__campaign_labels", "test.iterable.not_null_stg_iterable__campaign_label_history_campaign_id.1918cef89a"], "model.iterable.stg_iterable__template_history": ["model.iterable.int_iterable__latest_template", "test.iterable.not_null_stg_iterable__template_history_template_id.14b24a1dfe"], "model.iterable.stg_iterable__journey": ["model.iterable.iterable__campaigns", "model.iterable.iterable__journeys", "test.iterable.not_null_stg_iterable__journey_journey_id.cc38bd633c"], "model.iterable.stg_iterable__user_history": ["model.iterable.int_iterable__latest_user", "model.iterable.int_iterable__list_user_history", "test.iterable.not_null_stg_iterable__user_history_unique_user_key.2845af2127"], "model.iterable.stg_iterable__user_unsub_message_type": ["model.iterable.iterable__user_unsubscriptions", "test.iterable.not_null_stg_iterable__user_unsub_message_type_message_type_id.268a89ea6f"], "model.iterable.stg_iterable__list": ["model.iterable.iterable__list_user_history", "test.iterable.not_null_stg_iterable__list_list_id.47029d839a"], "model.iterable.stg_iterable__list_user": ["model.iterable.iterable__list_user_history", "model.iterable.iterable__users", "test.iterable.not_null_stg_iterable__list_user__fivetran_user_id.cca4b34c07"], "model.iterable.stg_iterable__campaign_suppression_list_history": ["model.iterable.int_iterable__campaign_lists", "test.iterable.not_null_stg_iterable__campaign_suppression_list_history_campaign_id.3921289710"], "model.iterable.stg_iterable__event_extension": ["model.iterable.iterable__events", "test.iterable.not_null_stg_iterable__event_extension_event_id.144dedcd30"], "model.iterable.stg_iterable__campaign_list_history": ["model.iterable.int_iterable__campaign_lists", "test.iterable.not_null_stg_iterable__campaign_list_history_campaign_id.208f9bf9ed"], "model.iterable.stg_iterable__channel": ["model.iterable.int_iterable__message_type_channel", "test.iterable.not_null_stg_iterable__channel_channel_id.182ceb9636"], "model.iterable.stg_iterable__message_type_tmp": ["model.iterable.stg_iterable__message_type"], "model.iterable.stg_iterable__event_extension_tmp": ["model.iterable.stg_iterable__event_extension"], "model.iterable.stg_iterable__user_unsub_message_type_tmp": ["model.iterable.stg_iterable__user_unsub_message_type"], "model.iterable.stg_iterable__campaign_list_history_tmp": ["model.iterable.stg_iterable__campaign_list_history"], "model.iterable.stg_iterable__list_user_tmp": ["model.iterable.stg_iterable__list_user"], "model.iterable.stg_iterable__user_history_tmp": ["model.iterable.stg_iterable__user_history"], "model.iterable.stg_iterable__campaign_history_tmp": ["model.iterable.stg_iterable__campaign_history"], "model.iterable.stg_iterable__template_history_tmp": ["model.iterable.stg_iterable__template_history"], "model.iterable.stg_iterable__event_tmp": ["model.iterable.stg_iterable__event"], "model.iterable.stg_iterable__journey_tmp": ["model.iterable.stg_iterable__journey"], "model.iterable.stg_iterable__campaign_suppression_list_history_tmp": ["model.iterable.stg_iterable__campaign_suppression_list_history"], "model.iterable.stg_iterable__campaign_label_history_tmp": ["model.iterable.stg_iterable__campaign_label_history"], "model.iterable.stg_iterable__list_tmp": ["model.iterable.stg_iterable__list"], "model.iterable.stg_iterable__channel_tmp": ["model.iterable.stg_iterable__channel"], "model.iterable.stg_iterable__user_unsubscribed_channel_tmp": ["model.iterable.stg_iterable__user_unsubscribed_channel"], "test.iterable.not_null_iterable__campaigns_campaign_id.03c9448919": [], "test.iterable.not_null_iterable__events_event_id.ed1d28a650": [], "test.iterable.not_null_iterable__journeys_journey_id.b5c6b8783a": [], "test.iterable.unique_iterable__journeys_unique_journey_id.ba86841246": [], "test.iterable.not_null_iterable__user_unsubscriptions_unique_user_key.f8db72932b": [], "test.iterable.not_null_iterable__users_unique_user_key.4ca37a26c8": [], "test.iterable.not_null_stg_iterable__campaign_history_campaign_id.b7c36e4525": [], "test.iterable.not_null_stg_iterable__campaign_label_history_campaign_id.1918cef89a": [], "test.iterable.not_null_stg_iterable__campaign_list_history_campaign_id.208f9bf9ed": [], "test.iterable.not_null_stg_iterable__campaign_suppression_list_history_campaign_id.3921289710": [], "test.iterable.not_null_stg_iterable__channel_channel_id.182ceb9636": [], "test.iterable.not_null_stg_iterable__event_event_id.370cd4bc9d": [], "test.iterable.not_null_stg_iterable__event_unique_event_id.e2b46d3bb6": [], "test.iterable.not_null_stg_iterable__event_extension_event_id.144dedcd30": [], "test.iterable.not_null_stg_iterable__journey_journey_id.cc38bd633c": [], "test.iterable.not_null_stg_iterable__list_list_id.47029d839a": [], "test.iterable.not_null_stg_iterable__message_type_message_type_id.75eaa6fa62": [], "test.iterable.not_null_stg_iterable__template_history_template_id.14b24a1dfe": [], "test.iterable.not_null_stg_iterable__list_user__fivetran_user_id.cca4b34c07": [], "test.iterable.not_null_stg_iterable__user_history_unique_user_key.2845af2127": [], "test.iterable.not_null_stg_iterable__user_unsubscribed_channel_channel_id.da0ed9e9be": [], "test.iterable.not_null_stg_iterable__user_unsub_message_type_message_type_id.268a89ea6f": [], "source.iterable.iterable.campaign_history": ["model.iterable.stg_iterable__campaign_history_tmp"], "source.iterable.iterable.campaign_label_history": ["model.iterable.stg_iterable__campaign_label_history_tmp"], "source.iterable.iterable.campaign_list_history": ["model.iterable.stg_iterable__campaign_list_history_tmp"], "source.iterable.iterable.campaign_suppression_list_history": ["model.iterable.stg_iterable__campaign_suppression_list_history_tmp"], "source.iterable.iterable.channel": ["model.iterable.stg_iterable__channel_tmp"], "source.iterable.iterable.event": ["model.iterable.stg_iterable__event_tmp"], "source.iterable.iterable.event_extension": ["model.iterable.stg_iterable__event_extension_tmp"], "source.iterable.iterable.journey": ["model.iterable.stg_iterable__journey_tmp"], "source.iterable.iterable.list": ["model.iterable.stg_iterable__list_tmp"], "source.iterable.iterable.message_type": ["model.iterable.stg_iterable__message_type_tmp"], "source.iterable.iterable.template_history": ["model.iterable.stg_iterable__template_history_tmp"], "source.iterable.iterable.user_history": ["model.iterable.stg_iterable__user_history_tmp"], "source.iterable.iterable.user_unsubscribed_channel": [], "source.iterable.iterable.user_unsubscribed_message_type": [], "source.iterable.iterable.user_unsubscribed_channel_history": ["model.iterable.stg_iterable__user_unsubscribed_channel_tmp"], "source.iterable.iterable.user_unsubscribed_message_type_history": ["model.iterable.stg_iterable__user_unsub_message_type_tmp"], "source.iterable.iterable.list_user": ["model.iterable.stg_iterable__list_user_tmp"]}, "group_map": {}, "saved_queries": {}, "semantic_models": {}, "unit_tests": {}, "functions": {}} \ No newline at end of file From 6d773e93dfeeed13dba39a5e670ccb1a7fe06161 Mon Sep 17 00:00:00 2001 From: Savage Fivetran Date: Tue, 15 Sep 2026 13:15:18 -0700 Subject: [PATCH 10/11] Apply batched suggestions from code review Co-authored-by: Avinash Kunnath <108772760+fivetran-avinash@users.noreply.github.com> --- CHANGELOG.md | 3 +-- README.md | 2 +- integration_tests/seeds/journey_data.csv | 2 +- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8f0e7d9..921c58c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,8 +11,7 @@ | `iterable__campaigns` | New fields | | `journey_id`, `journey_name`, `journey_type` | | | `int_iterable__journey_event_metrics` | New model | | | Aggregates campaign engagement metrics to the journey grain. | | `int_iterable__recurring_campaigns` | New field | | `journey_id` | | -| `stg_iterable__journey` | New model | | | Staging model for the new `journey` source table. | -| `stg_iterable__journey_tmp` | New model | | | Temporary staging model for the new `journey` source table. | +| `stg_iterable__journey`
`stg_iterable__journey_tmp` | New models | | | Staging models for the new `journey` source table. | # dbt_iterable v1.5.1 diff --git a/README.md b/README.md index 27ca650..be05d15 100644 --- a/README.md +++ b/README.md @@ -36,7 +36,7 @@ By default, this package materializes the following final tables: | [iterable__events](https://fivetran.github.io/dbt_iterable/#!/model/model.iterable.iterable__events) | Tracks all user events with campaign attribution, user details, and channel information to analyze user behavior, conversion paths, and campaign effectiveness at the event level. See [tracked events details](https://fivetran.com/docs/applications/iterable#schemanotes).

**Example Analytics Questions:**
  • What customer actions drive the most revenue and conversions?
  • Are our marketing campaigns more effective than organic customer discovery?
  • What customer journey paths lead to purchase or upgrade?
| | [iterable__user_campaign](https://fivetran.github.io/dbt_iterable/#!/model/model.iterable.iterable__user_campaign) | Aggregates user-level engagement with specific campaigns and experiment variations including event counts by type to measure individual user responses to campaign messaging.

**Example Analytics Questions:**
  • Which customers are most responsive to our campaigns, and what messages resonate with them?
  • Which email variations are winning with our audience?
  • How frequently do customers engage with each campaign?
| | [iterable__campaigns](https://fivetran.github.io/dbt_iterable/#!/model/model.iterable.iterable__campaigns) | Tracks campaign performance with user interaction metrics, event counts, experiment variations, and template details to measure campaign effectiveness and optimize email strategy.

**Example Analytics Questions:**
  • Which campaigns are driving the most engagement and sales?
  • How do different email designs and messaging strategies perform?
  • What's the reach and impact of our marketing initiatives?
| -| [iterable__journeys](https://fivetran.github.io/dbt_iterable/#!/model/model.iterable.iterable__journeys) | Tracks journey performance with engagement metrics, unique user counts, and derived engagement rates rolled up from the campaigns belonging to each journey, so you can measure which automated sequences actually work. Journeys that send no messages, such as audience splits, are still included.

**Example Analytics Questions:**
  • Which automated journeys are driving the most engagement?
  • How does our welcome series compare to our cart abandonment sequence?
  • Which journeys are enabled but no longer reaching anyone?
| +| [iterable__journeys](https://fivetran.github.io/dbt_iterable/#!/model/model.iterable.iterable__journeys) | Tracks journey performance with engagement metrics, unique user counts, and can derive engagement rates rolled up from the campaigns belonging to each journey, so you can measure which automated sequences actually work. Journeys that send no messages, such as audience splits, are still included.

**Example Analytics Questions:**
  • Which automated journeys are driving the most engagement?
  • How does our welcome series compare to our cart abandonment sequence?
  • Which journeys are enabled but no longer reaching anyone?
| | [iterable__users](https://fivetran.github.io/dbt_iterable/#!/model/model.iterable.iterable__users) | Provides a comprehensive view of each user with campaign engagement history, list memberships, unsubscription status, and interaction metrics to understand user preferences and lifetime engagement.

**Example Analytics Questions:**
  • Who are our most engaged customers and what do they have in common?
  • Why are customers unsubscribing, and what did we lose when they left?
  • Which acquisition channels bring us the most engaged customers?
| | [iterable__list_user_history](https://fivetran.github.io/dbt_iterable/#!/model/model.iterable.iterable__list_user_history) | Chronicles user-list membership history to track when users join or leave lists, manage audience segmentation, and analyze list growth without excessive Monthly Active Rows (MAR) usage.

**Example Analytics Questions:**
  • Are we growing or losing our subscriber base in key segments?
  • Which customers are moving between audience segments, and why?
  • How long do customers stay engaged before opting out?
| | [iterable__user_unsubscriptions](https://fivetran.github.io/dbt_iterable/#!/model/model.iterable.iterable__user_unsubscriptions) | Tracks all user unsubscriptions by message type and channel to manage communication preferences, protect sender reputation, and identify unsubscribe patterns.

**Example Analytics Questions:**
  • Which types of messages are causing customers to opt out?
  • Are we losing customers completely, or just from certain communication types?
  • What patterns indicate a customer is likely to unsubscribe?
| diff --git a/integration_tests/seeds/journey_data.csv b/integration_tests/seeds/journey_data.csv index 3c7b2c1..dde997e 100644 --- a/integration_tests/seeds/journey_data.csv +++ b/integration_tests/seeds/journey_data.csv @@ -1,5 +1,5 @@ id,name,journey_type,description,creator_user_id,enabled,is_archived,lifetime_limit,simultaneous_limit,start_tile_id,trigger_event_names,created_at,updated_at,_fivetran_deleted,_fivetran_synced,draft_name -157274,Welcome Series,Triggered,Onboarding sequence sent to new subscribers over their first week,jimmy.neutron@goddard.com,true,false,1,1,44001,"[""signUp""]",2021-06-01 09:14:22.000,2021-06-11 13:30:58.412,FALSE,2021-06-11 13:32:03.771,Welcome Series draft +157274,Welcome Series,Published,Onboarding sequence sent to new subscribers over their first week,jimmy.neutron@goddard.com,true,false,1,1,44001,"[""signUp""]",2021-06-01 09:14:22.000,2021-06-11 13:30:58.412,FALSE,2021-06-11 13:32:03.771,Welcome Series draft 28801,Automation,Triggered,Behavioral automation triggered by in-app activity,jimmy.neutron@goddard.com,true,false,5,2,44002,"[""customEvent"",""emailOpen""]",2021-05-18 11:02:47.000,2021-06-09 17:45:10.220,FALSE,2021-06-11 13:32:03.771,Automation draft 83250,Workflow - Survey,Blast,Post-purchase survey invitation,carl.wheezer@goddard.com,true,false,,1,44003,"[""purchase""]",2021-04-27 15:39:05.000,2021-06-02 08:21:36.905,FALSE,2021-06-11 13:32:03.771, 900001,Audience Split - Dormant Users,Triggered,Splits dormant users into re-engagement branches and updates their profile fields. Sends no messages.,carl.wheezer@goddard.com,false,true,,,44004,[],2021-03-15 10:00:00.000,2021-05-20 12:11:44.310,FALSE,2021-06-11 13:32:03.771, From 52e2ed5a2529ec040e88e13b47e6abfe6c91bd8b Mon Sep 17 00:00:00 2001 From: fivetran-data-model-bot Date: Tue, 15 Sep 2026 20:17:36 +0000 Subject: [PATCH 11/11] Generate dbt docs via GitHub Actions --- docs/catalog.json | 2 +- docs/manifest.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/catalog.json b/docs/catalog.json index aaa0f2d..b63dad6 100644 --- a/docs/catalog.json +++ b/docs/catalog.json @@ -1 +1 @@ -{"metadata": {"dbt_schema_version": "https://schemas.getdbt.com/dbt/catalog/v1.json", "dbt_version": "1.12.4", "generated_at": "2026-09-14T21:49:40.370410Z", "invocation_id": "6a6c3f91-5f13-44f5-8829-b38d77182ae4", "invocation_started_at": "2026-09-14T21:49:36.845076Z", "env": {}}, "nodes": {"seed.iterable_integration_tests.campaign_history_data": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "campaign_history_data", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"id": {"type": "integer", "index": 1, "name": "id", "comment": null}, "updated_at": {"type": "text", "index": 2, "name": "updated_at", "comment": null}, "template_id": {"type": "integer", "index": 3, "name": "template_id", "comment": null}, "recurring_campaign_id": {"type": "integer", "index": 4, "name": "recurring_campaign_id", "comment": null}, "campaign_state": {"type": "text", "index": 5, "name": "campaign_state", "comment": null}, "created_at": {"type": "text", "index": 6, "name": "created_at", "comment": null}, "created_by_user_id": {"type": "text", "index": 7, "name": "created_by_user_id", "comment": null}, "ended_at": {"type": "integer", "index": 8, "name": "ended_at", "comment": null}, "name": {"type": "text", "index": 9, "name": "name", "comment": null}, "send_size": {"type": "integer", "index": 10, "name": "send_size", "comment": null}, "start_at": {"type": "integer", "index": 11, "name": "start_at", "comment": null}, "type": {"type": "text", "index": 12, "name": "type", "comment": null}, "workflow_id": {"type": "integer", "index": 13, "name": "workflow_id", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 14, "name": "_fivetran_synced", "comment": null}, "updated_by_user_id": {"type": "integer", "index": 15, "name": "updated_by_user_id", "comment": null}, "message_medium": {"type": "text", "index": 16, "name": "message_medium", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.iterable_integration_tests.campaign_history_data"}, "seed.iterable_integration_tests.campaign_label_history_data": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "campaign_label_history_data", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"campaign_id": {"type": "integer", "index": 1, "name": "campaign_id", "comment": null}, "label": {"type": "text", "index": 2, "name": "label", "comment": null}, "updated_at": {"type": "text", "index": 3, "name": "updated_at", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 4, "name": "_fivetran_synced", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.iterable_integration_tests.campaign_label_history_data"}, "seed.iterable_integration_tests.campaign_list_history_data": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "campaign_list_history_data", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"list_id": {"type": "integer", "index": 1, "name": "list_id", "comment": null}, "campaign_id": {"type": "integer", "index": 2, "name": "campaign_id", "comment": null}, "updated_at": {"type": "text", "index": 3, "name": "updated_at", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 4, "name": "_fivetran_synced", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.iterable_integration_tests.campaign_list_history_data"}, "seed.iterable_integration_tests.campaign_metrics_data": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "campaign_metrics_data", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"date": {"type": "date", "index": 1, "name": "date", "comment": null}, "id": {"type": "integer", "index": 2, "name": "id", "comment": null}, "_fivetran_deleted": {"type": "boolean", "index": 3, "name": "_fivetran_deleted", "comment": null}, "average_order_value": {"type": "integer", "index": 4, "name": "average_order_value", "comment": null}, "purchases": {"type": "integer", "index": 5, "name": "purchases", "comment": null}, "revenue": {"type": "integer", "index": 6, "name": "revenue", "comment": null}, "revenue_m": {"type": "integer", "index": 7, "name": "revenue_m", "comment": null}, "total_app_uninstalls": {"type": "integer", "index": 8, "name": "total_app_uninstalls", "comment": null}, "total_complaints": {"type": "integer", "index": 9, "name": "total_complaints", "comment": null}, "total_email_bounced": {"type": "integer", "index": 10, "name": "total_email_bounced", "comment": null}, "total_email_clicked": {"type": "integer", "index": 11, "name": "total_email_clicked", "comment": null}, "total_email_delivered": {"type": "integer", "index": 12, "name": "total_email_delivered", "comment": null}, "total_email_opens": {"type": "integer", "index": 13, "name": "total_email_opens", "comment": null}, "total_email_sends": {"type": "integer", "index": 14, "name": "total_email_sends", "comment": null}, "total_hosted_unsubscribe_clicks": {"type": "integer", "index": 15, "name": "total_hosted_unsubscribe_clicks", "comment": null}, "total_purchases": {"type": "integer", "index": 16, "name": "total_purchases", "comment": null}, "total_pushes_bounced": {"type": "integer", "index": 17, "name": "total_pushes_bounced", "comment": null}, "total_pushes_delivered": {"type": "integer", "index": 18, "name": "total_pushes_delivered", "comment": null}, "total_pushes_opened": {"type": "integer", "index": 19, "name": "total_pushes_opened", "comment": null}, "total_pushes_sent": {"type": "integer", "index": 20, "name": "total_pushes_sent", "comment": null}, "total_unsubscribes": {"type": "integer", "index": 21, "name": "total_unsubscribes", "comment": null}, "unique_email_bounced": {"type": "integer", "index": 22, "name": "unique_email_bounced", "comment": null}, "unique_email_clicks": {"type": "integer", "index": 23, "name": "unique_email_clicks", "comment": null}, "unique_email_opens_or_clicks": {"type": "integer", "index": 24, "name": "unique_email_opens_or_clicks", "comment": null}, "unique_hosted_unsubscribe_clicks": {"type": "integer", "index": 25, "name": "unique_hosted_unsubscribe_clicks", "comment": null}, "unique_purchases": {"type": "integer", "index": 26, "name": "unique_purchases", "comment": null}, "unique_pushes_bounced": {"type": "integer", "index": 27, "name": "unique_pushes_bounced", "comment": null}, "unique_pushes_opened": {"type": "integer", "index": 28, "name": "unique_pushes_opened", "comment": null}, "unique_pushes_sent": {"type": "integer", "index": 29, "name": "unique_pushes_sent", "comment": null}, "unique_unsubscribes": {"type": "integer", "index": 30, "name": "unique_unsubscribes", "comment": null}, "total_push_send_skips": {"type": "integer", "index": 31, "name": "total_push_send_skips", "comment": null}, "total_in_app_opens": {"type": "integer", "index": 32, "name": "total_in_app_opens", "comment": null}, "unique_in_apps_delivered": {"type": "integer", "index": 33, "name": "unique_in_apps_delivered", "comment": null}, "unique_in_app_sends": {"type": "integer", "index": 34, "name": "unique_in_app_sends", "comment": null}, "total_in_app_closes": {"type": "integer", "index": 35, "name": "total_in_app_closes", "comment": null}, "total_inbox_impressions": {"type": "integer", "index": 36, "name": "total_inbox_impressions", "comment": null}, "unique_pushes_delivered": {"type": "integer", "index": 37, "name": "unique_pushes_delivered", "comment": null}, "unique_in_app_clicks": {"type": "integer", "index": 38, "name": "unique_in_app_clicks", "comment": null}, "unique_emails_delivered": {"type": "integer", "index": 39, "name": "unique_emails_delivered", "comment": null}, "total_in_app_clicks": {"type": "integer", "index": 40, "name": "total_in_app_clicks", "comment": null}, "total_in_app_deletes": {"type": "integer", "index": 41, "name": "total_in_app_deletes", "comment": null}, "total_in_app_sent": {"type": "integer", "index": 42, "name": "total_in_app_sent", "comment": null}, "total_in_apps_delivered": {"type": "integer", "index": 43, "name": "total_in_apps_delivered", "comment": null}, "unique_in_app_opens": {"type": "integer", "index": 44, "name": "unique_in_app_opens", "comment": null}, "total_email_holdout": {"type": "integer", "index": 45, "name": "total_email_holdout", "comment": null}, "total_email_send_skips": {"type": "integer", "index": 46, "name": "total_email_send_skips", "comment": null}, "unique_email_sends": {"type": "integer", "index": 47, "name": "unique_email_sends", "comment": null}, "unique_emails_opens": {"type": "integer", "index": 48, "name": "unique_emails_opens", "comment": null}, "total_in_app_holdout": {"type": "integer", "index": 49, "name": "total_in_app_holdout", "comment": null}, "total_in_app_send_skips": {"type": "integer", "index": 50, "name": "total_in_app_send_skips", "comment": null}, "total_push_holdout": {"type": "integer", "index": 51, "name": "total_push_holdout", "comment": null}, "_fivetran_synced": {"type": "text", "index": 52, "name": "_fivetran_synced", "comment": null}, "total_sms_holdout": {"type": "integer", "index": 53, "name": "total_sms_holdout", "comment": null}, "unique_sms_sent": {"type": "integer", "index": 54, "name": "unique_sms_sent", "comment": null}, "total_sms_delivered": {"type": "integer", "index": 55, "name": "total_sms_delivered", "comment": null}, "total_sms_sent": {"type": "integer", "index": 56, "name": "total_sms_sent", "comment": null}, "total_inbound_sms": {"type": "integer", "index": 57, "name": "total_inbound_sms", "comment": null}, "total_sms_bounced": {"type": "integer", "index": 58, "name": "total_sms_bounced", "comment": null}, "total_sms_send_skips": {"type": "integer", "index": 59, "name": "total_sms_send_skips", "comment": null}, "unique_inbound_sms": {"type": "integer", "index": 60, "name": "unique_inbound_sms", "comment": null}, "unique_sms_delivered": {"type": "integer", "index": 61, "name": "unique_sms_delivered", "comment": null}, "unique_sms_bounced": {"type": "integer", "index": 62, "name": "unique_sms_bounced", "comment": null}, "revenue_m_sms_": {"type": "integer", "index": 63, "name": "revenue_m_sms_", "comment": null}, "purchases_m_sms_": {"type": "integer", "index": 64, "name": "purchases_m_sms_", "comment": null}, "purchases_m_email_": {"type": "integer", "index": 65, "name": "purchases_m_email_", "comment": null}, "revenue_m_push_": {"type": "integer", "index": 66, "name": "revenue_m_push_", "comment": null}, "revenue_m_email_": {"type": "integer", "index": 67, "name": "revenue_m_email_", "comment": null}, "purchases_m_push_": {"type": "integer", "index": 68, "name": "purchases_m_push_", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.iterable_integration_tests.campaign_metrics_data"}, "seed.iterable_integration_tests.campaign_suppression_list_history_data": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "campaign_suppression_list_history_data", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"suppressed_list_id": {"type": "integer", "index": 1, "name": "suppressed_list_id", "comment": null}, "campaign_id": {"type": "integer", "index": 2, "name": "campaign_id", "comment": null}, "updated_at": {"type": "text", "index": 3, "name": "updated_at", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 4, "name": "_fivetran_synced", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.iterable_integration_tests.campaign_suppression_list_history_data"}, "seed.iterable_integration_tests.channel_data": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "channel_data", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"id": {"type": "bigint", "index": 1, "name": "id", "comment": null}, "name": {"type": "text", "index": 2, "name": "name", "comment": null}, "channel_type": {"type": "text", "index": 3, "name": "channel_type", "comment": null}, "message_medium": {"type": "text", "index": 4, "name": "message_medium", "comment": null}, "_fivetran_deleted": {"type": "boolean", "index": 5, "name": "_fivetran_deleted", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 6, "name": "_fivetran_synced", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.iterable_integration_tests.channel_data"}, "seed.iterable_integration_tests.event_data": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "event_data", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"_fivetran_id": {"type": "text", "index": 1, "name": "_fivetran_id", "comment": null}, "email": {"type": "text", "index": 2, "name": "email", "comment": null}, "campaign_id": {"type": "integer", "index": 3, "name": "campaign_id", "comment": null}, "message_id": {"type": "integer", "index": 4, "name": "message_id", "comment": null}, "content_id": {"type": "integer", "index": 5, "name": "content_id", "comment": null}, "created_at": {"type": "timestamp without time zone", "index": 6, "name": "created_at", "comment": null}, "event_name": {"type": "text", "index": 7, "name": "event_name", "comment": null}, "ip": {"type": "integer", "index": 8, "name": "ip", "comment": null}, "message_bus_id": {"type": "integer", "index": 9, "name": "message_bus_id", "comment": null}, "message_type_id": {"type": "integer", "index": 10, "name": "message_type_id", "comment": null}, "recipient_state": {"type": "integer", "index": 11, "name": "recipient_state", "comment": null}, "status": {"type": "integer", "index": 12, "name": "status", "comment": null}, "unsub_source": {"type": "integer", "index": 13, "name": "unsub_source", "comment": null}, "user_agent": {"type": "integer", "index": 14, "name": "user_agent", "comment": null}, "user_agent_device": {"type": "integer", "index": 15, "name": "user_agent_device", "comment": null}, "transactional_data": {"type": "character varying(100)", "index": 16, "name": "transactional_data", "comment": null}, "additional_properties": {"type": "text", "index": 17, "name": "additional_properties", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 18, "name": "_fivetran_synced", "comment": null}, "_fivetran_user_id": {"type": "integer", "index": 19, "name": "_fivetran_user_id", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.iterable_integration_tests.event_data"}, "seed.iterable_integration_tests.event_extension_data": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "event_extension_data", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"_fivetran_id": {"type": "text", "index": 1, "name": "_fivetran_id", "comment": null}, "app_already_running": {"type": "integer", "index": 2, "name": "app_already_running", "comment": null}, "badge": {"type": "integer", "index": 3, "name": "badge", "comment": null}, "canonical_url_id": {"type": "integer", "index": 4, "name": "canonical_url_id", "comment": null}, "content_available": {"type": "integer", "index": 5, "name": "content_available", "comment": null}, "content_id": {"type": "integer", "index": 6, "name": "content_id", "comment": null}, "device": {"type": "integer", "index": 7, "name": "device", "comment": null}, "email_id": {"type": "text", "index": 8, "name": "email_id", "comment": null}, "email_subject": {"type": "text", "index": 9, "name": "email_subject", "comment": null}, "experiment_id": {"type": "integer", "index": 10, "name": "experiment_id", "comment": null}, "from_phone_number_id": {"type": "integer", "index": 11, "name": "from_phone_number_id", "comment": null}, "from_smssender_id": {"type": "integer", "index": 12, "name": "from_smssender_id", "comment": null}, "image_url": {"type": "integer", "index": 13, "name": "image_url", "comment": null}, "is_ghost_push": {"type": "integer", "index": 14, "name": "is_ghost_push", "comment": null}, "link_id": {"type": "integer", "index": 15, "name": "link_id", "comment": null}, "link_url": {"type": "integer", "index": 16, "name": "link_url", "comment": null}, "platform_endpoint": {"type": "integer", "index": 17, "name": "platform_endpoint", "comment": null}, "push_message": {"type": "integer", "index": 18, "name": "push_message", "comment": null}, "region": {"type": "text", "index": 19, "name": "region", "comment": null}, "sms_message": {"type": "integer", "index": 20, "name": "sms_message", "comment": null}, "sound": {"type": "integer", "index": 21, "name": "sound", "comment": null}, "to_phone_number": {"type": "integer", "index": 22, "name": "to_phone_number", "comment": null}, "url": {"type": "integer", "index": 23, "name": "url", "comment": null}, "workflow_id": {"type": "integer", "index": 24, "name": "workflow_id", "comment": null}, "workflow_name": {"type": "text", "index": 25, "name": "workflow_name", "comment": null}, "locale": {"type": "integer", "index": 26, "name": "locale", "comment": null}, "deeplink_android": {"type": "integer", "index": 27, "name": "deeplink_android", "comment": null}, "deeplink_ios": {"type": "integer", "index": 28, "name": "deeplink_ios", "comment": null}, "payload": {"type": "character varying(100)", "index": 29, "name": "payload", "comment": null}, "sms_provider_response_status": {"type": "integer", "index": 30, "name": "sms_provider_response_status", "comment": null}, "sms_provider_response_message": {"type": "integer", "index": 31, "name": "sms_provider_response_message", "comment": null}, "sms_provider_response_code": {"type": "integer", "index": 32, "name": "sms_provider_response_code", "comment": null}, "sms_provider_response_more_info": {"type": "integer", "index": 33, "name": "sms_provider_response_more_info", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 34, "name": "_fivetran_synced", "comment": null}, "catalog_collection_count": {"type": "integer", "index": 35, "name": "catalog_collection_count", "comment": null}, "catalog_lookup_count": {"type": "integer", "index": 36, "name": "catalog_lookup_count", "comment": null}, "city": {"type": "text", "index": 37, "name": "city", "comment": null}, "clicked_url": {"type": "text", "index": 38, "name": "clicked_url", "comment": null}, "country": {"type": "text", "index": 39, "name": "country", "comment": null}, "error_code": {"type": "integer", "index": 40, "name": "error_code", "comment": null}, "expires_at": {"type": "text", "index": 41, "name": "expires_at", "comment": null}, "from_phone_number": {"type": "integer", "index": 42, "name": "from_phone_number", "comment": null}, "in_app_body": {"type": "text", "index": 43, "name": "in_app_body", "comment": null}, "is_sms_estimation": {"type": "boolean", "index": 44, "name": "is_sms_estimation", "comment": null}, "labels": {"type": "text", "index": 45, "name": "labels", "comment": null}, "message_context": {"type": "text", "index": 46, "name": "message_context", "comment": null}, "message_status": {"type": "text", "index": 47, "name": "message_status", "comment": null}, "mms_send_count": {"type": "integer", "index": 48, "name": "mms_send_count", "comment": null}, "product_recommendation_count": {"type": "integer", "index": 49, "name": "product_recommendation_count", "comment": null}, "proxy_source": {"type": "text", "index": 50, "name": "proxy_source", "comment": null}, "reason": {"type": "text", "index": 51, "name": "reason", "comment": null}, "sms_send_count": {"type": "integer", "index": 52, "name": "sms_send_count", "comment": null}, "web_push_body": {"type": "text", "index": 53, "name": "web_push_body", "comment": null}, "web_push_click_action": {"type": "text", "index": 54, "name": "web_push_click_action", "comment": null}, "web_push_icon": {"type": "text", "index": 55, "name": "web_push_icon", "comment": null}, "web_push_message": {"type": "text", "index": 56, "name": "web_push_message", "comment": null}, "_fivetran_user_id": {"type": "integer", "index": 57, "name": "_fivetran_user_id", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.iterable_integration_tests.event_extension_data"}, "seed.iterable_integration_tests.journey_data": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "journey_data", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"id": {"type": "bigint", "index": 1, "name": "id", "comment": null}, "name": {"type": "text", "index": 2, "name": "name", "comment": null}, "journey_type": {"type": "text", "index": 3, "name": "journey_type", "comment": null}, "description": {"type": "text", "index": 4, "name": "description", "comment": null}, "creator_user_id": {"type": "text", "index": 5, "name": "creator_user_id", "comment": null}, "enabled": {"type": "boolean", "index": 6, "name": "enabled", "comment": null}, "is_archived": {"type": "boolean", "index": 7, "name": "is_archived", "comment": null}, "lifetime_limit": {"type": "bigint", "index": 8, "name": "lifetime_limit", "comment": null}, "simultaneous_limit": {"type": "bigint", "index": 9, "name": "simultaneous_limit", "comment": null}, "start_tile_id": {"type": "bigint", "index": 10, "name": "start_tile_id", "comment": null}, "trigger_event_names": {"type": "text", "index": 11, "name": "trigger_event_names", "comment": null}, "created_at": {"type": "timestamp without time zone", "index": 12, "name": "created_at", "comment": null}, "updated_at": {"type": "timestamp without time zone", "index": 13, "name": "updated_at", "comment": null}, "_fivetran_deleted": {"type": "boolean", "index": 14, "name": "_fivetran_deleted", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 15, "name": "_fivetran_synced", "comment": null}, "draft_name": {"type": "text", "index": 16, "name": "draft_name", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.iterable_integration_tests.journey_data"}, "seed.iterable_integration_tests.list_data": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "list_data", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"id": {"type": "integer", "index": 1, "name": "id", "comment": null}, "name": {"type": "text", "index": 2, "name": "name", "comment": null}, "created_at": {"type": "text", "index": 3, "name": "created_at", "comment": null}, "list_type": {"type": "text", "index": 4, "name": "list_type", "comment": null}, "_fivetran_deleted": {"type": "boolean", "index": 5, "name": "_fivetran_deleted", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 6, "name": "_fivetran_synced", "comment": null}, "description": {"type": "text", "index": 7, "name": "description", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.iterable_integration_tests.list_data"}, "seed.iterable_integration_tests.list_user_data": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "list_user_data", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"_fivetran_id": {"type": "text", "index": 1, "name": "_fivetran_id", "comment": null}, "index": {"type": "bigint", "index": 2, "name": "index", "comment": null}, "list_id": {"type": "bigint", "index": 3, "name": "list_id", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 4, "name": "_fivetran_synced", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.iterable_integration_tests.list_user_data"}, "seed.iterable_integration_tests.message_type_data": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "message_type_data", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"id": {"type": "bigint", "index": 1, "name": "id", "comment": null}, "name": {"type": "text", "index": 2, "name": "name", "comment": null}, "channel_id": {"type": "bigint", "index": 3, "name": "channel_id", "comment": null}, "_fivetran_deleted": {"type": "boolean", "index": 4, "name": "_fivetran_deleted", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 5, "name": "_fivetran_synced", "comment": null}, "created_at": {"type": "timestamp without time zone", "index": 6, "name": "created_at", "comment": null}, "frequency_cap": {"type": "integer", "index": 7, "name": "frequency_cap", "comment": null}, "rate_limit_per_minute": {"type": "integer", "index": 8, "name": "rate_limit_per_minute", "comment": null}, "subscription_policy": {"type": "text", "index": 9, "name": "subscription_policy", "comment": null}, "updated_at": {"type": "timestamp without time zone", "index": 10, "name": "updated_at", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.iterable_integration_tests.message_type_data"}, "seed.iterable_integration_tests.template_history_data": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "template_history_data", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"id": {"type": "integer", "index": 1, "name": "id", "comment": null}, "updated_at": {"type": "text", "index": 2, "name": "updated_at", "comment": null}, "message_type_id": {"type": "integer", "index": 3, "name": "message_type_id", "comment": null}, "client_template_id": {"type": "integer", "index": 4, "name": "client_template_id", "comment": null}, "created_at": {"type": "text", "index": 5, "name": "created_at", "comment": null}, "creator_user_id": {"type": "text", "index": 6, "name": "creator_user_id", "comment": null}, "name": {"type": "text", "index": 7, "name": "name", "comment": null}, "template_type": {"type": "text", "index": 8, "name": "template_type", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 9, "name": "_fivetran_synced", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.iterable_integration_tests.template_history_data"}, "seed.iterable_integration_tests.user_history_bq_json_data": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "user_history_bq_json_data", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"email": {"type": "text", "index": 1, "name": "email", "comment": null}, "updated_at": {"type": "text", "index": 2, "name": "updated_at", "comment": null}, "first_name": {"type": "integer", "index": 3, "name": "first_name", "comment": null}, "last_name": {"type": "integer", "index": 4, "name": "last_name", "comment": null}, "phone_number": {"type": "integer", "index": 5, "name": "phone_number", "comment": null}, "user_id": {"type": "integer", "index": 6, "name": "user_id", "comment": null}, "signup_date": {"type": "text", "index": 7, "name": "signup_date", "comment": null}, "signup_source": {"type": "text", "index": 8, "name": "signup_source", "comment": null}, "phone_number_carrier": {"type": "integer", "index": 9, "name": "phone_number_carrier", "comment": null}, "phone_number_country_code_iso": {"type": "integer", "index": 10, "name": "phone_number_country_code_iso", "comment": null}, "phone_number_line_type": {"type": "integer", "index": 11, "name": "phone_number_line_type", "comment": null}, "phone_number_updated_at": {"type": "integer", "index": 12, "name": "phone_number_updated_at", "comment": null}, "_fivetran_synced": {"type": "text", "index": 13, "name": "_fivetran_synced", "comment": null}, "email_list_ids": {"type": "text", "index": 14, "name": "email_list_ids", "comment": null}, "iterable_user_id": {"type": "integer", "index": 15, "name": "iterable_user_id", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.iterable_integration_tests.user_history_bq_json_data"}, "seed.iterable_integration_tests.user_history_data": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "user_history_data", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"email": {"type": "text", "index": 1, "name": "email", "comment": null}, "updated_at": {"type": "timestamp without time zone", "index": 2, "name": "updated_at", "comment": null}, "first_name": {"type": "integer", "index": 3, "name": "first_name", "comment": null}, "last_name": {"type": "integer", "index": 4, "name": "last_name", "comment": null}, "phone_number": {"type": "integer", "index": 5, "name": "phone_number", "comment": null}, "user_id": {"type": "integer", "index": 6, "name": "user_id", "comment": null}, "signup_date": {"type": "text", "index": 7, "name": "signup_date", "comment": null}, "signup_source": {"type": "text", "index": 8, "name": "signup_source", "comment": null}, "phone_number_carrier": {"type": "integer", "index": 9, "name": "phone_number_carrier", "comment": null}, "phone_number_country_code_iso": {"type": "integer", "index": 10, "name": "phone_number_country_code_iso", "comment": null}, "phone_number_line_type": {"type": "integer", "index": 11, "name": "phone_number_line_type", "comment": null}, "phone_number_updated_at": {"type": "integer", "index": 12, "name": "phone_number_updated_at", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 13, "name": "_fivetran_synced", "comment": null}, "email_list_ids": {"type": "text", "index": 14, "name": "email_list_ids", "comment": null}, "iterable_user_id": {"type": "integer", "index": 15, "name": "iterable_user_id", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.iterable_integration_tests.user_history_data"}, "seed.iterable_integration_tests.user_unsubscribed_channel_data": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "user_unsubscribed_channel_data", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"_fivetran_id": {"type": "text", "index": 1, "name": "_fivetran_id", "comment": null}, "channel_id": {"type": "integer", "index": 2, "name": "channel_id", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 3, "name": "_fivetran_synced", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.iterable_integration_tests.user_unsubscribed_channel_data"}, "seed.iterable_integration_tests.user_unsubscribed_channel_history_data": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "user_unsubscribed_channel_history_data", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"email": {"type": "text", "index": 1, "name": "email", "comment": null}, "channel_id": {"type": "bigint", "index": 2, "name": "channel_id", "comment": null}, "updated_at": {"type": "text", "index": 3, "name": "updated_at", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 4, "name": "_fivetran_synced", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.iterable_integration_tests.user_unsubscribed_channel_history_data"}, "seed.iterable_integration_tests.user_unsubscribed_message_type_data": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "user_unsubscribed_message_type_data", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"_fivetran_id": {"type": "text", "index": 1, "name": "_fivetran_id", "comment": null}, "message_type_id": {"type": "integer", "index": 2, "name": "message_type_id", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 3, "name": "_fivetran_synced", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.iterable_integration_tests.user_unsubscribed_message_type_data"}, "seed.iterable_integration_tests.user_unsubscribed_message_type_history_data": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "user_unsubscribed_message_type_history_data", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"message_type_id": {"type": "integer", "index": 1, "name": "message_type_id", "comment": null}, "email": {"type": "text", "index": 2, "name": "email", "comment": null}, "updated_at": {"type": "text", "index": 3, "name": "updated_at", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 4, "name": "_fivetran_synced", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.iterable_integration_tests.user_unsubscribed_message_type_history_data"}, "model.iterable.int_iterable__campaign_event_metrics": {"metadata": {"type": "VIEW", "schema": "public_iterable_dev", "name": "int_iterable__campaign_event_metrics", "database": "postgres", "comment": "Table that generates relevant total and unique campaign/experiment level aggregations.", "owner": "postgres"}, "columns": {"source_relation": {"type": "text", "index": 1, "name": "source_relation", "comment": null}, "campaign_id": {"type": "text", "index": 2, "name": "campaign_id", "comment": null}, "template_id": {"type": "text", "index": 3, "name": "template_id", "comment": null}, "experiment_id": {"type": "integer", "index": 4, "name": "experiment_id", "comment": null}, "count_unique_users": {"type": "bigint", "index": 5, "name": "count_unique_users", "comment": null}, "total_emailclick": {"type": "numeric", "index": 6, "name": "total_emailclick", "comment": null}, "unique_total_emailclick": {"type": "bigint", "index": 7, "name": "unique_total_emailclick", "comment": null}, "total_emailunsubscribe": {"type": "numeric", "index": 8, "name": "total_emailunsubscribe", "comment": null}, "unique_total_emailunsubscribe": {"type": "bigint", "index": 9, "name": "unique_total_emailunsubscribe", "comment": null}, "total_emailcomplaint": {"type": "numeric", "index": 10, "name": "total_emailcomplaint", "comment": null}, "unique_total_emailcomplaint": {"type": "bigint", "index": 11, "name": "unique_total_emailcomplaint", "comment": null}, "total_customevent": {"type": "numeric", "index": 12, "name": "total_customevent", "comment": null}, "unique_total_customevent": {"type": "bigint", "index": 13, "name": "unique_total_customevent", "comment": null}, "total_emailsubscribe": {"type": "numeric", "index": 14, "name": "total_emailsubscribe", "comment": null}, "unique_total_emailsubscribe": {"type": "bigint", "index": 15, "name": "unique_total_emailsubscribe", "comment": null}, "total_emailopen": {"type": "numeric", "index": 16, "name": "total_emailopen", "comment": null}, "unique_total_emailopen": {"type": "bigint", "index": 17, "name": "unique_total_emailopen", "comment": null}, "total_pushsend": {"type": "numeric", "index": 18, "name": "total_pushsend", "comment": null}, "unique_total_pushsend": {"type": "bigint", "index": 19, "name": "unique_total_pushsend", "comment": null}, "total_smsbounce": {"type": "numeric", "index": 20, "name": "total_smsbounce", "comment": null}, "unique_total_smsbounce": {"type": "bigint", "index": 21, "name": "unique_total_smsbounce", "comment": null}, "total_pushbounce": {"type": "numeric", "index": 22, "name": "total_pushbounce", "comment": null}, "unique_total_pushbounce": {"type": "bigint", "index": 23, "name": "unique_total_pushbounce", "comment": null}, "total_inappsendskip": {"type": "numeric", "index": 24, "name": "total_inappsendskip", "comment": null}, "unique_total_inappsendskip": {"type": "bigint", "index": 25, "name": "unique_total_inappsendskip", "comment": null}, "total_smssend": {"type": "numeric", "index": 26, "name": "total_smssend", "comment": null}, "unique_total_smssend": {"type": "bigint", "index": 27, "name": "unique_total_smssend", "comment": null}, "total_inappsend": {"type": "numeric", "index": 28, "name": "total_inappsend", "comment": null}, "unique_total_inappsend": {"type": "bigint", "index": 29, "name": "unique_total_inappsend", "comment": null}, "total_pushopen": {"type": "numeric", "index": 30, "name": "total_pushopen", "comment": null}, "unique_total_pushopen": {"type": "bigint", "index": 31, "name": "unique_total_pushopen", "comment": null}, "total_emailsend": {"type": "numeric", "index": 32, "name": "total_emailsend", "comment": null}, "unique_total_emailsend": {"type": "bigint", "index": 33, "name": "unique_total_emailsend", "comment": null}, "total_pushsendskip": {"type": "numeric", "index": 34, "name": "total_pushsendskip", "comment": null}, "unique_total_pushsendskip": {"type": "bigint", "index": 35, "name": "unique_total_pushsendskip", "comment": null}, "total_inappopen": {"type": "numeric", "index": 36, "name": "total_inappopen", "comment": null}, "unique_total_inappopen": {"type": "bigint", "index": 37, "name": "unique_total_inappopen", "comment": null}, "total_emailsendskip": {"type": "numeric", "index": 38, "name": "total_emailsendskip", "comment": null}, "unique_total_emailsendskip": {"type": "bigint", "index": 39, "name": "unique_total_emailsendskip", "comment": null}, "total_emailbounce": {"type": "numeric", "index": 40, "name": "total_emailbounce", "comment": null}, "unique_total_emailbounce": {"type": "bigint", "index": 41, "name": "unique_total_emailbounce", "comment": null}, "total_inappclick": {"type": "numeric", "index": 42, "name": "total_inappclick", "comment": null}, "unique_total_inappclick": {"type": "bigint", "index": 43, "name": "unique_total_inappclick", "comment": null}, "total_pushuninstall": {"type": "numeric", "index": 44, "name": "total_pushuninstall", "comment": null}, "unique_total_pushuninstall": {"type": "bigint", "index": 45, "name": "unique_total_pushuninstall", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.int_iterable__campaign_event_metrics"}, "model.iterable.int_iterable__campaign_labels": {"metadata": {"type": "VIEW", "schema": "public_iterable_dev", "name": "int_iterable__campaign_labels", "database": "postgres", "comment": "Table that provides the distinct string aggregation of labels for each campaign.", "owner": "postgres"}, "columns": {"source_relation": {"type": "text", "index": 1, "name": "source_relation", "comment": null}, "campaign_id": {"type": "text", "index": 2, "name": "campaign_id", "comment": null}, "labels": {"type": "text", "index": 3, "name": "labels", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.int_iterable__campaign_labels"}, "model.iterable.int_iterable__campaign_lists": {"metadata": {"type": "VIEW", "schema": "public_iterable_dev", "name": "int_iterable__campaign_lists", "database": "postgres", "comment": "Table that identifies the suppressed and send lists associated with a campaign.", "owner": "postgres"}, "columns": {"source_relation": {"type": "text", "index": 1, "name": "source_relation", "comment": null}, "list_id": {"type": "text", "index": 2, "name": "list_id", "comment": null}, "campaign_id": {"type": "text", "index": 3, "name": "campaign_id", "comment": null}, "updated_at": {"type": "text", "index": 4, "name": "updated_at", "comment": null}, "list_activity": {"type": "text", "index": 5, "name": "list_activity", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.int_iterable__campaign_lists"}, "model.iterable.int_iterable__journey_event_metrics": {"metadata": {"type": "VIEW", "schema": "public_iterable_dev", "name": "int_iterable__journey_event_metrics", "database": "postgres", "comment": "Table that generates relevant total and unique journey level aggregations, rolled up from the user/campaign grain via the campaign's journey reference.", "owner": "postgres"}, "columns": {"source_relation": {"type": "text", "index": 1, "name": "source_relation", "comment": null}, "journey_id": {"type": "text", "index": 2, "name": "journey_id", "comment": null}, "count_total_campaigns": {"type": "bigint", "index": 3, "name": "count_total_campaigns", "comment": null}, "count_unique_users": {"type": "bigint", "index": 4, "name": "count_unique_users", "comment": null}, "first_event_at": {"type": "timestamp without time zone", "index": 5, "name": "first_event_at", "comment": null}, "last_event_at": {"type": "timestamp without time zone", "index": 6, "name": "last_event_at", "comment": null}, "total_emailclick": {"type": "numeric", "index": 7, "name": "total_emailclick", "comment": null}, "unique_total_emailclick": {"type": "bigint", "index": 8, "name": "unique_total_emailclick", "comment": null}, "total_emailunsubscribe": {"type": "numeric", "index": 9, "name": "total_emailunsubscribe", "comment": null}, "unique_total_emailunsubscribe": {"type": "bigint", "index": 10, "name": "unique_total_emailunsubscribe", "comment": null}, "total_emailcomplaint": {"type": "numeric", "index": 11, "name": "total_emailcomplaint", "comment": null}, "unique_total_emailcomplaint": {"type": "bigint", "index": 12, "name": "unique_total_emailcomplaint", "comment": null}, "total_customevent": {"type": "numeric", "index": 13, "name": "total_customevent", "comment": null}, "unique_total_customevent": {"type": "bigint", "index": 14, "name": "unique_total_customevent", "comment": null}, "total_emailsubscribe": {"type": "numeric", "index": 15, "name": "total_emailsubscribe", "comment": null}, "unique_total_emailsubscribe": {"type": "bigint", "index": 16, "name": "unique_total_emailsubscribe", "comment": null}, "total_emailopen": {"type": "numeric", "index": 17, "name": "total_emailopen", "comment": null}, "unique_total_emailopen": {"type": "bigint", "index": 18, "name": "unique_total_emailopen", "comment": null}, "total_pushsend": {"type": "numeric", "index": 19, "name": "total_pushsend", "comment": null}, "unique_total_pushsend": {"type": "bigint", "index": 20, "name": "unique_total_pushsend", "comment": null}, "total_smsbounce": {"type": "numeric", "index": 21, "name": "total_smsbounce", "comment": null}, "unique_total_smsbounce": {"type": "bigint", "index": 22, "name": "unique_total_smsbounce", "comment": null}, "total_pushbounce": {"type": "numeric", "index": 23, "name": "total_pushbounce", "comment": null}, "unique_total_pushbounce": {"type": "bigint", "index": 24, "name": "unique_total_pushbounce", "comment": null}, "total_inappsendskip": {"type": "numeric", "index": 25, "name": "total_inappsendskip", "comment": null}, "unique_total_inappsendskip": {"type": "bigint", "index": 26, "name": "unique_total_inappsendskip", "comment": null}, "total_smssend": {"type": "numeric", "index": 27, "name": "total_smssend", "comment": null}, "unique_total_smssend": {"type": "bigint", "index": 28, "name": "unique_total_smssend", "comment": null}, "total_inappsend": {"type": "numeric", "index": 29, "name": "total_inappsend", "comment": null}, "unique_total_inappsend": {"type": "bigint", "index": 30, "name": "unique_total_inappsend", "comment": null}, "total_pushopen": {"type": "numeric", "index": 31, "name": "total_pushopen", "comment": null}, "unique_total_pushopen": {"type": "bigint", "index": 32, "name": "unique_total_pushopen", "comment": null}, "total_emailsend": {"type": "numeric", "index": 33, "name": "total_emailsend", "comment": null}, "unique_total_emailsend": {"type": "bigint", "index": 34, "name": "unique_total_emailsend", "comment": null}, "total_pushsendskip": {"type": "numeric", "index": 35, "name": "total_pushsendskip", "comment": null}, "unique_total_pushsendskip": {"type": "bigint", "index": 36, "name": "unique_total_pushsendskip", "comment": null}, "total_inappopen": {"type": "numeric", "index": 37, "name": "total_inappopen", "comment": null}, "unique_total_inappopen": {"type": "bigint", "index": 38, "name": "unique_total_inappopen", "comment": null}, "total_emailsendskip": {"type": "numeric", "index": 39, "name": "total_emailsendskip", "comment": null}, "unique_total_emailsendskip": {"type": "bigint", "index": 40, "name": "unique_total_emailsendskip", "comment": null}, "total_emailbounce": {"type": "numeric", "index": 41, "name": "total_emailbounce", "comment": null}, "unique_total_emailbounce": {"type": "bigint", "index": 42, "name": "unique_total_emailbounce", "comment": null}, "total_inappclick": {"type": "numeric", "index": 43, "name": "total_inappclick", "comment": null}, "unique_total_inappclick": {"type": "bigint", "index": 44, "name": "unique_total_inappclick", "comment": null}, "total_pushuninstall": {"type": "numeric", "index": 45, "name": "total_pushuninstall", "comment": null}, "unique_total_pushuninstall": {"type": "bigint", "index": 46, "name": "unique_total_pushuninstall", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.int_iterable__journey_event_metrics"}, "model.iterable.int_iterable__latest_campaign": {"metadata": {"type": "VIEW", "schema": "public_iterable_dev", "name": "int_iterable__latest_campaign", "database": "postgres", "comment": "Table that filters out historical versions of the campaign, and returns the most recent campaign version.", "owner": "postgres"}, "columns": {"source_relation": {"type": "text", "index": 1, "name": "source_relation", "comment": null}, "campaign_id": {"type": "text", "index": 2, "name": "campaign_id", "comment": null}, "updated_at": {"type": "text", "index": 3, "name": "updated_at", "comment": null}, "campaign_name": {"type": "text", "index": 4, "name": "campaign_name", "comment": null}, "campaign_state": {"type": "text", "index": 5, "name": "campaign_state", "comment": null}, "campaign_type": {"type": "text", "index": 6, "name": "campaign_type", "comment": null}, "send_size": {"type": "integer", "index": 7, "name": "send_size", "comment": null}, "start_at": {"type": "integer", "index": 8, "name": "start_at", "comment": null}, "ended_at": {"type": "integer", "index": 9, "name": "ended_at", "comment": null}, "created_at": {"type": "text", "index": 10, "name": "created_at", "comment": null}, "message_medium": {"type": "text", "index": 11, "name": "message_medium", "comment": null}, "recurring_campaign_id": {"type": "text", "index": 12, "name": "recurring_campaign_id", "comment": null}, "created_by_user_id": {"type": "text", "index": 13, "name": "created_by_user_id", "comment": null}, "updated_by_user_id": {"type": "text", "index": 14, "name": "updated_by_user_id", "comment": null}, "template_id": {"type": "text", "index": 15, "name": "template_id", "comment": null}, "workflow_id": {"type": "integer", "index": 16, "name": "workflow_id", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 17, "name": "_fivetran_synced", "comment": null}, "latest_campaign_index": {"type": "bigint", "index": 18, "name": "latest_campaign_index", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.int_iterable__latest_campaign"}, "model.iterable.int_iterable__latest_template": {"metadata": {"type": "VIEW", "schema": "public_iterable_dev", "name": "int_iterable__latest_template", "database": "postgres", "comment": "Table that provides the most recent version of the template as well as joining relevant message type information.", "owner": "postgres"}, "columns": {"source_relation": {"type": "text", "index": 1, "name": "source_relation", "comment": null}, "template_id": {"type": "text", "index": 2, "name": "template_id", "comment": null}, "template_name": {"type": "text", "index": 3, "name": "template_name", "comment": null}, "template_type": {"type": "text", "index": 4, "name": "template_type", "comment": null}, "created_at": {"type": "text", "index": 5, "name": "created_at", "comment": null}, "client_template_id": {"type": "text", "index": 6, "name": "client_template_id", "comment": null}, "creator_user_id": {"type": "text", "index": 7, "name": "creator_user_id", "comment": null}, "message_type_id": {"type": "text", "index": 8, "name": "message_type_id", "comment": null}, "updated_at": {"type": "text", "index": 9, "name": "updated_at", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 10, "name": "_fivetran_synced", "comment": null}, "latest_template_index": {"type": "bigint", "index": 11, "name": "latest_template_index", "comment": null}, "message_type_name": {"type": "text", "index": 12, "name": "message_type_name", "comment": null}, "channel_id": {"type": "text", "index": 13, "name": "channel_id", "comment": null}, "channel_name": {"type": "text", "index": 14, "name": "channel_name", "comment": null}, "channel_type": {"type": "text", "index": 15, "name": "channel_type", "comment": null}, "message_medium": {"type": "text", "index": 16, "name": "message_medium", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.int_iterable__latest_template"}, "model.iterable.int_iterable__latest_user": {"metadata": {"type": "VIEW", "schema": "public_iterable_dev", "name": "int_iterable__latest_user", "database": "postgres", "comment": "Table that filters out historical versions of the user, and returns only the most recent version.", "owner": "postgres"}, "columns": {"source_relation": {"type": "text", "index": 1, "name": "source_relation", "comment": null}, "_fivetran_user_id": {"type": "text", "index": 2, "name": "_fivetran_user_id", "comment": null}, "email": {"type": "text", "index": 3, "name": "email", "comment": null}, "updated_at": {"type": "timestamp without time zone", "index": 4, "name": "updated_at", "comment": null}, "user_id": {"type": "text", "index": 5, "name": "user_id", "comment": null}, "first_name": {"type": "integer", "index": 6, "name": "first_name", "comment": null}, "last_name": {"type": "integer", "index": 7, "name": "last_name", "comment": null}, "email_list_ids": {"type": "text", "index": 8, "name": "email_list_ids", "comment": null}, "phone_number": {"type": "integer", "index": 9, "name": "phone_number", "comment": null}, "signup_date": {"type": "text", "index": 10, "name": "signup_date", "comment": null}, "signup_source": {"type": "text", "index": 11, "name": "signup_source", "comment": null}, "iterable_user_id": {"type": "text", "index": 12, "name": "iterable_user_id", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 13, "name": "_fivetran_synced", "comment": null}, "unique_user_key": {"type": "text", "index": 14, "name": "unique_user_key", "comment": null}, "latest_user_index": {"type": "bigint", "index": 15, "name": "latest_user_index", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.int_iterable__latest_user"}, "model.iterable.int_iterable__list_user_history": {"metadata": {"type": "BASE TABLE", "schema": "public_iterable_dev", "name": "int_iterable__list_user_history", "database": "postgres", "comment": "Table that provides a history of all lists the user has been associated with.", "owner": "postgres"}, "columns": {"source_relation": {"type": "text", "index": 1, "name": "source_relation", "comment": null}, "_fivetran_user_id": {"type": "text", "index": 2, "name": "_fivetran_user_id", "comment": null}, "unique_user_key": {"type": "text", "index": 3, "name": "unique_user_key", "comment": null}, "email": {"type": "text", "index": 4, "name": "email", "comment": null}, "user_id": {"type": "text", "index": 5, "name": "user_id", "comment": null}, "first_name": {"type": "integer", "index": 6, "name": "first_name", "comment": null}, "last_name": {"type": "integer", "index": 7, "name": "last_name", "comment": null}, "email_list_ids": {"type": "text", "index": 8, "name": "email_list_ids", "comment": null}, "phone_number": {"type": "integer", "index": 9, "name": "phone_number", "comment": null}, "signup_date": {"type": "text", "index": 10, "name": "signup_date", "comment": null}, "signup_source": {"type": "text", "index": 11, "name": "signup_source", "comment": null}, "updated_at": {"type": "timestamp without time zone", "index": 12, "name": "updated_at", "comment": null}, "is_current": {"type": "boolean", "index": 13, "name": "is_current", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.int_iterable__list_user_history"}, "model.iterable.int_iterable__list_user_unnest": {"metadata": {"type": "BASE TABLE", "schema": "public_iterable_dev", "name": "int_iterable__list_user_unnest", "database": "postgres", "comment": "Table that unnests the `email_list_id` field for each user to create a new record for each user and the unique list it was associated with at a unique update. Due to the unnesting functions varying greatly between warehouses, conditional logic is applied throughout the model to appropriately accommodate the model being ran within Redshift, Snowflake, BigQuery, and Postgres.\n", "owner": "postgres"}, "columns": {"source_relation": {"type": "text", "index": 1, "name": "source_relation", "comment": null}, "_fivetran_user_id": {"type": "text", "index": 2, "name": "_fivetran_user_id", "comment": null}, "unique_user_key": {"type": "text", "index": 3, "name": "unique_user_key", "comment": null}, "user_id": {"type": "text", "index": 4, "name": "user_id", "comment": null}, "email": {"type": "text", "index": 5, "name": "email", "comment": null}, "first_name": {"type": "integer", "index": 6, "name": "first_name", "comment": null}, "last_name": {"type": "integer", "index": 7, "name": "last_name", "comment": null}, "signup_date": {"type": "text", "index": 8, "name": "signup_date", "comment": null}, "signup_source": {"type": "text", "index": 9, "name": "signup_source", "comment": null}, "updated_at": {"type": "timestamp without time zone", "index": 10, "name": "updated_at", "comment": null}, "phone_number": {"type": "integer", "index": 11, "name": "phone_number", "comment": null}, "is_current": {"type": "boolean", "index": 12, "name": "is_current", "comment": null}, "email_list_ids": {"type": "text", "index": 13, "name": "email_list_ids", "comment": null}, "list_id": {"type": "integer", "index": 14, "name": "list_id", "comment": null}, "unique_key": {"type": "text", "index": 15, "name": "unique_key", "comment": null}, "date_day": {"type": "date", "index": 16, "name": "date_day", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.int_iterable__list_user_unnest"}, "model.iterable.int_iterable__message_type_channel": {"metadata": {"type": "VIEW", "schema": "public_iterable_dev", "name": "int_iterable__message_type_channel", "database": "postgres", "comment": "Table that joins the message type and channel records together into one comprehensive model to be referenced downstream.", "owner": "postgres"}, "columns": {"source_relation": {"type": "text", "index": 1, "name": "source_relation", "comment": null}, "channel_id": {"type": "text", "index": 2, "name": "channel_id", "comment": null}, "channel_name": {"type": "text", "index": 3, "name": "channel_name", "comment": null}, "channel_type": {"type": "text", "index": 4, "name": "channel_type", "comment": null}, "message_medium": {"type": "text", "index": 5, "name": "message_medium", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 6, "name": "_fivetran_synced", "comment": null}, "message_type_name": {"type": "text", "index": 7, "name": "message_type_name", "comment": null}, "message_type_id": {"type": "text", "index": 8, "name": "message_type_id", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.int_iterable__message_type_channel"}, "model.iterable.int_iterable__recurring_campaigns": {"metadata": {"type": "VIEW", "schema": "public_iterable_dev", "name": "int_iterable__recurring_campaigns", "database": "postgres", "comment": "Table that identifies when a campaign is associated with a recurring campaign and provides additional enriched recurring campaign information.", "owner": "postgres"}, "columns": {"source_relation": {"type": "text", "index": 1, "name": "source_relation", "comment": null}, "campaign_id": {"type": "text", "index": 2, "name": "campaign_id", "comment": null}, "campaign_name": {"type": "text", "index": 3, "name": "campaign_name", "comment": null}, "updated_at": {"type": "text", "index": 4, "name": "updated_at", "comment": null}, "campaign_state": {"type": "text", "index": 5, "name": "campaign_state", "comment": null}, "campaign_type": {"type": "text", "index": 6, "name": "campaign_type", "comment": null}, "send_size": {"type": "integer", "index": 7, "name": "send_size", "comment": null}, "start_at": {"type": "integer", "index": 8, "name": "start_at", "comment": null}, "ended_at": {"type": "integer", "index": 9, "name": "ended_at", "comment": null}, "created_at": {"type": "text", "index": 10, "name": "created_at", "comment": null}, "created_by_user_id": {"type": "text", "index": 11, "name": "created_by_user_id", "comment": null}, "template_id": {"type": "text", "index": 12, "name": "template_id", "comment": null}, "recurring_campaign_id": {"type": "text", "index": 13, "name": "recurring_campaign_id", "comment": null}, "journey_id": {"type": "text", "index": 14, "name": "journey_id", "comment": null}, "recurring_campaign_name": {"type": "text", "index": 15, "name": "recurring_campaign_name", "comment": null}, "recurring_campaign_state": {"type": "text", "index": 16, "name": "recurring_campaign_state", "comment": null}, "recurring_campaign_send_size": {"type": "integer", "index": 17, "name": "recurring_campaign_send_size", "comment": null}, "recurring_campaign_start_at": {"type": "integer", "index": 18, "name": "recurring_campaign_start_at", "comment": null}, "is_campaign_recurring": {"type": "boolean", "index": 19, "name": "is_campaign_recurring", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.int_iterable__recurring_campaigns"}, "model.iterable.int_iterable__user_event_metrics": {"metadata": {"type": "VIEW", "schema": "public_iterable_dev", "name": "int_iterable__user_event_metrics", "database": "postgres", "comment": "Table that generates user aggregations at the campaign level.", "owner": "postgres"}, "columns": {"source_relation": {"type": "text", "index": 1, "name": "source_relation", "comment": null}, "_fivetran_user_id": {"type": "text", "index": 2, "name": "_fivetran_user_id", "comment": null}, "unique_user_key": {"type": "text", "index": 3, "name": "unique_user_key", "comment": null}, "user_id": {"type": "text", "index": 4, "name": "user_id", "comment": null}, "user_email": {"type": "text", "index": 5, "name": "user_email", "comment": null}, "count_total_campaigns": {"type": "bigint", "index": 6, "name": "count_total_campaigns", "comment": null}, "first_event_at": {"type": "timestamp without time zone", "index": 7, "name": "first_event_at", "comment": null}, "last_event_at": {"type": "timestamp without time zone", "index": 8, "name": "last_event_at", "comment": null}, "total_emailclick": {"type": "numeric", "index": 9, "name": "total_emailclick", "comment": null}, "total_emailunsubscribe": {"type": "numeric", "index": 10, "name": "total_emailunsubscribe", "comment": null}, "total_emailcomplaint": {"type": "numeric", "index": 11, "name": "total_emailcomplaint", "comment": null}, "total_customevent": {"type": "numeric", "index": 12, "name": "total_customevent", "comment": null}, "total_emailsubscribe": {"type": "numeric", "index": 13, "name": "total_emailsubscribe", "comment": null}, "total_emailopen": {"type": "numeric", "index": 14, "name": "total_emailopen", "comment": null}, "total_pushsend": {"type": "numeric", "index": 15, "name": "total_pushsend", "comment": null}, "total_smsbounce": {"type": "numeric", "index": 16, "name": "total_smsbounce", "comment": null}, "total_pushbounce": {"type": "numeric", "index": 17, "name": "total_pushbounce", "comment": null}, "total_inappsendskip": {"type": "numeric", "index": 18, "name": "total_inappsendskip", "comment": null}, "total_smssend": {"type": "numeric", "index": 19, "name": "total_smssend", "comment": null}, "total_inappsend": {"type": "numeric", "index": 20, "name": "total_inappsend", "comment": null}, "total_pushopen": {"type": "numeric", "index": 21, "name": "total_pushopen", "comment": null}, "total_emailsend": {"type": "numeric", "index": 22, "name": "total_emailsend", "comment": null}, "total_pushsendskip": {"type": "numeric", "index": 23, "name": "total_pushsendskip", "comment": null}, "total_inappopen": {"type": "numeric", "index": 24, "name": "total_inappopen", "comment": null}, "total_emailsendskip": {"type": "numeric", "index": 25, "name": "total_emailsendskip", "comment": null}, "total_emailbounce": {"type": "numeric", "index": 26, "name": "total_emailbounce", "comment": null}, "total_inappclick": {"type": "numeric", "index": 27, "name": "total_inappclick", "comment": null}, "total_pushuninstall": {"type": "numeric", "index": 28, "name": "total_pushuninstall", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.int_iterable__user_event_metrics"}, "model.iterable.iterable__campaigns": {"metadata": {"type": "BASE TABLE", "schema": "public_iterable_dev", "name": "iterable__campaigns", "database": "postgres", "comment": "Table that provides aggregations for campaigns at the template and if available, the experiment grain.", "owner": "postgres"}, "columns": {"source_relation": {"type": "text", "index": 1, "name": "source_relation", "comment": "Identifies the record's source."}, "campaign_id": {"type": "text", "index": 2, "name": "campaign_id", "comment": "Unique identifier of the campaign record"}, "campaign_name": {"type": "text", "index": 3, "name": "campaign_name", "comment": "User defined name of the campaign."}, "updated_at": {"type": "text", "index": 4, "name": "updated_at", "comment": "Last update timestamp"}, "campaign_state": {"type": "text", "index": 5, "name": "campaign_state", "comment": "State of the campaign. Can be Draft, Ready, Scheduled, Running, Finished, Starting, Aborted or Recurring"}, "campaign_type": {"type": "text", "index": 6, "name": "campaign_type", "comment": "The campaign type. Can be Blast or Triggered"}, "send_size": {"type": "integer", "index": 7, "name": "send_size", "comment": "Size of the campaign. Number of individuals included in the campaign"}, "start_at": {"type": "integer", "index": 8, "name": "start_at", "comment": "Start timestamp"}, "ended_at": {"type": "integer", "index": 9, "name": "ended_at", "comment": "Ended timestamp"}, "created_at": {"type": "text", "index": 10, "name": "created_at", "comment": "Creation timestamp"}, "created_by_user_id": {"type": "text", "index": 11, "name": "created_by_user_id", "comment": "Reference to the user who created the campaign"}, "template_id": {"type": "text", "index": 12, "name": "template_id", "comment": "Reference to the campaign template"}, "recurring_campaign_id": {"type": "text", "index": 13, "name": "recurring_campaign_id", "comment": "Unique identifier of the recurring campaign (if applicable)"}, "journey_id": {"type": "text", "index": 14, "name": "journey_id", "comment": "Reference to the journey the campaign belongs to, if applicable"}, "recurring_campaign_name": {"type": "text", "index": 15, "name": "recurring_campaign_name", "comment": "Name of the recurring campaign (if applicable)"}, "recurring_campaign_state": {"type": "text", "index": 16, "name": "recurring_campaign_state", "comment": "State of the recurring campaign (if applicable)"}, "recurring_campaign_send_size": {"type": "integer", "index": 17, "name": "recurring_campaign_send_size", "comment": "Size of the recurring campaign. Number of individuals included in the recurring campaign (if applicable)"}, "recurring_campaign_start_at": {"type": "integer", "index": 18, "name": "recurring_campaign_start_at", "comment": "Timestamp of when the recurring campaign started (if applicable)"}, "is_campaign_recurring": {"type": "boolean", "index": 19, "name": "is_campaign_recurring", "comment": "Boolean indicating if the campaign is a recurring campaign"}, "experiment_id": {"type": "integer", "index": 20, "name": "experiment_id", "comment": "Reference to the experiment used if the event is an experiment"}, "count_unique_users": {"type": "bigint", "index": 21, "name": "count_unique_users", "comment": "Count of total unique users within the campaign/experiment"}, "total_emailclick": {"type": "numeric", "index": 22, "name": "total_emailclick", "comment": "Total email clicks within the campaign/experiment"}, "unique_total_emailclick": {"type": "bigint", "index": 23, "name": "unique_total_emailclick", "comment": "Unique email clicks within the campaign/experiment"}, "total_emailunsubscribe": {"type": "numeric", "index": 24, "name": "total_emailunsubscribe", "comment": "Total email unsubscribe events within the campaign/experiment"}, "unique_total_emailunsubscribe": {"type": "bigint", "index": 25, "name": "unique_total_emailunsubscribe", "comment": "Unique total email unsubscribe events within the campaign/experiment"}, "total_emailcomplaint": {"type": "numeric", "index": 26, "name": "total_emailcomplaint", "comment": "Total email complaints within the campaign/experiment"}, "unique_total_emailcomplaint": {"type": "bigint", "index": 27, "name": "unique_total_emailcomplaint", "comment": "Unique total email complaints within the campaign/experiment"}, "total_customevent": {"type": "numeric", "index": 28, "name": "total_customevent", "comment": "Total custom events within the campaign/experiment"}, "unique_total_customevent": {"type": "bigint", "index": 29, "name": "unique_total_customevent", "comment": "Unique total custom events within the campaign/experiment"}, "total_emailsubscribe": {"type": "numeric", "index": 30, "name": "total_emailsubscribe", "comment": "Total email subscribe events within the campaign/experiment"}, "unique_total_emailsubscribe": {"type": "bigint", "index": 31, "name": "unique_total_emailsubscribe", "comment": "Unique total email subscribe events within the campaign/experiment"}, "total_emailopen": {"type": "numeric", "index": 32, "name": "total_emailopen", "comment": "Total email open events within the campaign/experiment"}, "unique_total_emailopen": {"type": "bigint", "index": 33, "name": "unique_total_emailopen", "comment": "Unique total email open events within the campaign/experiment"}, "total_pushsend": {"type": "numeric", "index": 34, "name": "total_pushsend", "comment": "Total push send event within the campaign/experiment"}, "unique_total_pushsend": {"type": "bigint", "index": 35, "name": "unique_total_pushsend", "comment": "Unique total push send events within the campaign/experiment"}, "total_smsbounce": {"type": "numeric", "index": 36, "name": "total_smsbounce", "comment": "Total sms bounce events within the campaign/experiment"}, "unique_total_smsbounce": {"type": "bigint", "index": 37, "name": "unique_total_smsbounce", "comment": "Unique total sms bounce events within the campaign/experiment"}, "total_pushbounce": {"type": "numeric", "index": 38, "name": "total_pushbounce", "comment": "Total push bounce events within the campaign/experiment"}, "unique_total_pushbounce": {"type": "bigint", "index": 39, "name": "unique_total_pushbounce", "comment": "Unique total push bounce events within the campaign/experiment"}, "total_inappsendskip": {"type": "numeric", "index": 40, "name": "total_inappsendskip", "comment": "Total in app send skip events within the campaign/experiment"}, "unique_total_inappsendskip": {"type": "bigint", "index": 41, "name": "unique_total_inappsendskip", "comment": "Unique total in app send skip events within the campaign/experiment"}, "total_smssend": {"type": "numeric", "index": 42, "name": "total_smssend", "comment": "Total sms send events within the campaign/experiment"}, "unique_total_smssend": {"type": "bigint", "index": 43, "name": "unique_total_smssend", "comment": "Unique total sms send events within the campaign/experiment"}, "total_inappsend": {"type": "numeric", "index": 44, "name": "total_inappsend", "comment": "Total in app send events within the campaign/experiment"}, "unique_total_inappsend": {"type": "bigint", "index": 45, "name": "unique_total_inappsend", "comment": "Unique total in app send events within the campaign/experiment"}, "total_pushopen": {"type": "numeric", "index": 46, "name": "total_pushopen", "comment": "Total push open events within the campaign/experiment"}, "unique_total_pushopen": {"type": "bigint", "index": 47, "name": "unique_total_pushopen", "comment": "Unique total push open events within the campaign/experiment"}, "total_emailsend": {"type": "numeric", "index": 48, "name": "total_emailsend", "comment": "Total email send events within the campaign/experiment"}, "unique_total_emailsend": {"type": "bigint", "index": 49, "name": "unique_total_emailsend", "comment": "Unique total email send events within the campaign/experiment"}, "total_pushsendskip": {"type": "numeric", "index": 50, "name": "total_pushsendskip", "comment": "Total push send skip events within the campaign/experiment"}, "unique_total_pushsendskip": {"type": "bigint", "index": 51, "name": "unique_total_pushsendskip", "comment": "Unique total push send skip events within the campaign/experiment"}, "total_inappopen": {"type": "numeric", "index": 52, "name": "total_inappopen", "comment": "Total in app open events within the campaign/experiment"}, "unique_total_inappopen": {"type": "bigint", "index": 53, "name": "unique_total_inappopen", "comment": "Unique total in app open events within the campaign/experiment"}, "total_emailsendskip": {"type": "numeric", "index": 54, "name": "total_emailsendskip", "comment": "Total email send skip events within the campaign/experiment"}, "unique_total_emailsendskip": {"type": "bigint", "index": 55, "name": "unique_total_emailsendskip", "comment": "Unique total email send skip events within the campaign/experiment"}, "total_emailbounce": {"type": "numeric", "index": 56, "name": "total_emailbounce", "comment": "Total email bounce events within the campaign/experiment"}, "unique_total_emailbounce": {"type": "bigint", "index": 57, "name": "unique_total_emailbounce", "comment": "Unique total email bounce events within the campaign/experiment"}, "total_inappclick": {"type": "numeric", "index": 58, "name": "total_inappclick", "comment": "Total in app click events within the campaign/experiment"}, "unique_total_inappclick": {"type": "bigint", "index": 59, "name": "unique_total_inappclick", "comment": "Unique total in app click events within the campaign/experiment"}, "total_pushuninstall": {"type": "numeric", "index": 60, "name": "total_pushuninstall", "comment": "Total push uninstall events within the campaign/experiment"}, "unique_total_pushuninstall": {"type": "bigint", "index": 61, "name": "unique_total_pushuninstall", "comment": "Unique total push uninstall events within the campaign/experiment"}, "count_send_lists": {"type": "bigint", "index": 62, "name": "count_send_lists", "comment": "Count of send lists within the campaign/experiment"}, "count_suppress_lists": {"type": "bigint", "index": 63, "name": "count_suppress_lists", "comment": "Count of suppress lists within the campaign/experiment"}, "labels": {"type": "text", "index": 64, "name": "labels", "comment": "List of labels associated with the campaign/experiment"}, "journey_name": {"type": "text", "index": 65, "name": "journey_name", "comment": "User defined name of the journey the campaign belongs to, if applicable"}, "journey_type": {"type": "text", "index": 66, "name": "journey_type", "comment": "The type of the journey the campaign belongs to, if applicable"}, "template_name": {"type": "text", "index": 67, "name": "template_name", "comment": "Name of the template associated with the campaign/experiment"}, "template_creator_user_id": {"type": "text", "index": 68, "name": "template_creator_user_id", "comment": "The creator user id of the template associated with the campaign/experiment"}, "message_medium": {"type": "text", "index": 69, "name": "message_medium", "comment": "The medium which the message was provided"}, "message_type_name": {"type": "text", "index": 70, "name": "message_type_name", "comment": "The message type name associated with the campaign/experiment"}, "channel_name": {"type": "text", "index": 71, "name": "channel_name", "comment": "The channel name associated with the campaign/experiment"}, "channel_id": {"type": "text", "index": 72, "name": "channel_id", "comment": "The channel identifier associated with the campaign/experiment"}, "channel_type": {"type": "text", "index": 73, "name": "channel_type", "comment": "The channel type associated with the campaign/experiment"}, "unique_campaign_version_id": {"type": "text", "index": 74, "name": "unique_campaign_version_id", "comment": "Unique identifier combining campaign_id, template_id, source_relation, and if available, experiment_id."}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.iterable__campaigns"}, "model.iterable.iterable__events": {"metadata": {"type": "BASE TABLE", "schema": "public_iterable_dev", "name": "iterable__events", "database": "postgres", "comment": "Table that provides a comprehensive view of all events with enriched information such as the campaign, user effected, and template used.", "owner": "postgres"}, "columns": {"source_relation": {"type": "text", "index": 1, "name": "source_relation", "comment": "Identifies the record's source."}, "event_id": {"type": "text", "index": 2, "name": "event_id", "comment": "Unique id of the event generated by Fivetran"}, "unique_event_id": {"type": "text", "index": 3, "name": "unique_event_id", "comment": "A unique surrogate key of event_id, _fivetran_user_id, and source_relation."}, "_fivetran_user_id": {"type": "text", "index": 4, "name": "_fivetran_user_id", "comment": "A Fivetran-created unique identifier for the new Iterable schema in Aug 2023, for users, derived from hashing user_id and/or email, depending on project type."}, "unique_user_key": {"type": "text", "index": 5, "name": "unique_user_key", "comment": "The unique identifier of the user. With the new schema (Aug 2023), it is the _fivetran_user_id. This is a hash of user_id and/or email, depending on project type. If using the old schema, it is email."}, "campaign_id": {"type": "text", "index": 6, "name": "campaign_id", "comment": "Reference to the campaign from which the event originated"}, "content_id": {"type": "text", "index": 7, "name": "content_id", "comment": "Reference to the content the event is associated with"}, "created_at": {"type": "timestamp without time zone", "index": 8, "name": "created_at", "comment": "Creation timestamp"}, "created_on": {"type": "date", "index": 9, "name": "created_on", "comment": "Day when the event was created"}, "email": {"type": "text", "index": 10, "name": "email", "comment": "The user's email. User identifier, for email-based projects. Previously was the unique identifier for user records, for the old Iterable schema before the August 2023 updates."}, "additional_properties": {"type": "text", "index": 11, "name": "additional_properties", "comment": "json object containing addition event properties"}, "event_name": {"type": "text", "index": 12, "name": "event_name", "comment": "Name provided to the individual event"}, "message_bus_id": {"type": "text", "index": 13, "name": "message_bus_id", "comment": "Reference to the message bus associated with the event"}, "message_id": {"type": "text", "index": 14, "name": "message_id", "comment": "Reference to the message the event is associated with"}, "message_type_id": {"type": "text", "index": 15, "name": "message_type_id", "comment": "Reference to the type of message the event is associated with"}, "recipient_state": {"type": "integer", "index": 16, "name": "recipient_state", "comment": "The state of the recipient upon receiving the event"}, "status": {"type": "integer", "index": 17, "name": "status", "comment": "Status of the event"}, "transactional_data": {"type": "character varying(100)", "index": 18, "name": "transactional_data", "comment": "Transactional data associated with the event"}, "unsub_source": {"type": "integer", "index": 19, "name": "unsub_source", "comment": "Source of the unsubscribe event"}, "user_agent": {"type": "integer", "index": 20, "name": "user_agent", "comment": "User agent associated with the event"}, "user_agent_device": {"type": "integer", "index": 21, "name": "user_agent_device", "comment": "The device of the user agent"}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 22, "name": "_fivetran_synced", "comment": "Timestamp of when the event record was synced by Fivetran"}, "campaign_name": {"type": "text", "index": 23, "name": "campaign_name", "comment": "The name of the campaign"}, "campaign_type": {"type": "text", "index": 24, "name": "campaign_type", "comment": "The type of campaign"}, "is_campaign_recurring": {"type": "boolean", "index": 25, "name": "is_campaign_recurring", "comment": "Boolean indicating if the campaign is recurrent"}, "recurring_campaign_name": {"type": "text", "index": 26, "name": "recurring_campaign_name", "comment": "The name of the recurring campaign (if applicable)"}, "recurring_campaign_id": {"type": "text", "index": 27, "name": "recurring_campaign_id", "comment": "The campaign if of the recurring campaign (if applicable)"}, "user_id": {"type": "text", "index": 28, "name": "user_id", "comment": "User identifier, for userID-based projects."}, "user_full_name": {"type": "text", "index": 29, "name": "user_full_name", "comment": "Full name of the user"}, "message_type_name": {"type": "text", "index": 30, "name": "message_type_name", "comment": "Name of the message type"}, "message_medium": {"type": "text", "index": 31, "name": "message_medium", "comment": "Medium of the message"}, "channel_id": {"type": "text", "index": 32, "name": "channel_id", "comment": "Unique identifier of the channel"}, "channel_name": {"type": "text", "index": 33, "name": "channel_name", "comment": "The channel name"}, "channel_type": {"type": "text", "index": 34, "name": "channel_type", "comment": "The type of channel"}, "is_app_already_running": {"type": "integer", "index": 35, "name": "is_app_already_running", "comment": "Boolean indicating if the app is already running"}, "badge": {"type": "integer", "index": 36, "name": "badge", "comment": "Badge associated with the event"}, "catalog_collection_count": {"type": "integer", "index": 37, "name": "catalog_collection_count", "comment": "The count of products or items collected in a catalog associated with the event."}, "catalog_lookup_count": {"type": "integer", "index": 38, "name": "catalog_lookup_count", "comment": "The count of times a catalog was looked up or queried during the event."}, "canonical_url_id": {"type": "text", "index": 39, "name": "canonical_url_id", "comment": "Reference to the url associated with the event"}, "is_content_available": {"type": "integer", "index": 40, "name": "is_content_available", "comment": "Content available from the event"}, "device": {"type": "integer", "index": 41, "name": "device", "comment": "The device associated with the event"}, "email_id": {"type": "text", "index": 42, "name": "email_id", "comment": "Reference to the email associated with the event"}, "email_subject": {"type": "text", "index": 43, "name": "email_subject", "comment": "Subject of the email associated with the event"}, "experiment_id": {"type": "integer", "index": 44, "name": "experiment_id", "comment": "Reference to the experiment used if the event is an experiment"}, "from_phone_number_id": {"type": "integer", "index": 45, "name": "from_phone_number_id", "comment": "Reference to the phone number which the event is from"}, "from_smssender_id": {"type": "integer", "index": 46, "name": "from_smssender_id", "comment": "Reference to the sms sender which the event is from"}, "link_id": {"type": "text", "index": 47, "name": "link_id", "comment": "Reference to the link associated with the event"}, "link_url": {"type": "integer", "index": 48, "name": "link_url", "comment": "Url of the link associated with the event"}, "locale": {"type": "integer", "index": 49, "name": "locale", "comment": "Locale associated with the event"}, "payload": {"type": "character varying(100)", "index": 50, "name": "payload", "comment": "Payload resulted from the event"}, "platform_endpoint": {"type": "integer", "index": 51, "name": "platform_endpoint", "comment": "The specific platform endpoint of the event"}, "push_message": {"type": "integer", "index": 52, "name": "push_message", "comment": "Boolean indicating if the event is a push message"}, "region": {"type": "text", "index": 53, "name": "region", "comment": "Region of the event"}, "sms_message": {"type": "integer", "index": 54, "name": "sms_message", "comment": "Boolean indicating if the event is an sms message"}, "to_phone_number": {"type": "integer", "index": 55, "name": "to_phone_number", "comment": "To phone number associated with the event"}, "url": {"type": "integer", "index": 56, "name": "url", "comment": "Url associated with the event"}, "workflow_id": {"type": "text", "index": 57, "name": "workflow_id", "comment": "Reference to the workflow which the event originated"}, "workflow_name": {"type": "text", "index": 58, "name": "workflow_name", "comment": "Name of the workflow which the event originated"}, "city": {"type": "text", "index": 59, "name": "city", "comment": "The city associated with the event, which could be the location of the recipient."}, "clicked_url": {"type": "text", "index": 60, "name": "clicked_url", "comment": "The URL that was clicked by the recipient in response to the marketing message."}, "country": {"type": "text", "index": 61, "name": "country", "comment": "The country associated with the event, which could be the location of the recipient."}, "error_code": {"type": "integer", "index": 62, "name": "error_code", "comment": "The error code or message indicating any issues or errors encountered during the event."}, "expires_at": {"type": "text", "index": 63, "name": "expires_at", "comment": "The date and time when the event or message is set to expire or become invalid."}, "from_phone_number": {"type": "integer", "index": 64, "name": "from_phone_number", "comment": "The phone number from which the SMS message was sent."}, "in_app_body": {"type": "text", "index": 65, "name": "in_app_body", "comment": "The content or body of an in-app message that was sent as part of the event."}, "is_sms_estimation": {"type": "boolean", "index": 66, "name": "is_sms_estimation", "comment": "A boolean indicating whether the SMS message is an estimation or not."}, "labels": {"type": "text", "index": 67, "name": "labels", "comment": "Any labels or tags associated with the event, which can be used for categorization or organization."}, "message_status": {"type": "text", "index": 68, "name": "message_status", "comment": "The status of the marketing message, such as sent, delivered, opened, etc."}, "mms_send_count": {"type": "integer", "index": 69, "name": "mms_send_count", "comment": "The count of multimedia messages (MMS) sent as part of the event."}, "reason": {"type": "text", "index": 70, "name": "reason", "comment": "The reason or cause associated with a specific event or action."}, "sms_send_count": {"type": "integer", "index": 71, "name": "sms_send_count", "comment": "The count of SMS messages sent as part of the event."}, "template_id": {"type": "text", "index": 72, "name": "template_id", "comment": "Unique identifier of the template"}, "template_name": {"type": "text", "index": 73, "name": "template_name", "comment": "User defined name of the template"}, "template_creator_user_id": {"type": "text", "index": 74, "name": "template_creator_user_id", "comment": "Reference to the user who created the template"}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.iterable__events"}, "model.iterable.iterable__journeys": {"metadata": {"type": "BASE TABLE", "schema": "public_iterable_dev", "name": "iterable__journeys", "database": "postgres", "comment": "Table that provides aggregations for journeys, formerly known as workflows. Metrics are rolled up from the user/campaign grain via each campaign's journey reference. Journeys which generate no events, such as those that only split audiences or update user fields, are still included with null metrics. The grain of this table is one record per journey.\n", "owner": "postgres"}, "columns": {"source_relation": {"type": "text", "index": 1, "name": "source_relation", "comment": "Identifies the record's source."}, "journey_id": {"type": "text", "index": 2, "name": "journey_id", "comment": "Unique identifier of the journey"}, "journey_name": {"type": "text", "index": 3, "name": "journey_name", "comment": "User defined name of the journey"}, "journey_type": {"type": "text", "index": 4, "name": "journey_type", "comment": "The journey type"}, "journey_description": {"type": "text", "index": 5, "name": "journey_description", "comment": "Information about the journey"}, "creator_user_id": {"type": "text", "index": 6, "name": "creator_user_id", "comment": "Reference to the user who created the journey"}, "is_enabled": {"type": "boolean", "index": 7, "name": "is_enabled", "comment": "Boolean indicating if the journey is currently enabled"}, "is_archived": {"type": "boolean", "index": 8, "name": "is_archived", "comment": "Boolean indicating if the journey has been archived"}, "lifetime_limit": {"type": "bigint", "index": 9, "name": "lifetime_limit", "comment": "Maximum number of times a user may enter the journey over their lifetime"}, "simultaneous_limit": {"type": "bigint", "index": 10, "name": "simultaneous_limit", "comment": "Maximum number of times a user may be in the journey at the same time"}, "start_tile_id": {"type": "text", "index": 11, "name": "start_tile_id", "comment": "Reference to the tile which begins the journey"}, "trigger_event_names": {"type": "text", "index": 12, "name": "trigger_event_names", "comment": "The event names which trigger a user's entry into the journey"}, "created_at": {"type": "timestamp without time zone", "index": 13, "name": "created_at", "comment": "Creation timestamp"}, "updated_at": {"type": "timestamp without time zone", "index": 14, "name": "updated_at", "comment": "Last update timestamp"}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 15, "name": "_fivetran_synced", "comment": "The time when a record was last updated by Fivetran."}, "count_total_campaigns": {"type": "bigint", "index": 16, "name": "count_total_campaigns", "comment": "Count of distinct campaigns within the journey that generated events"}, "count_unique_users": {"type": "bigint", "index": 17, "name": "count_unique_users", "comment": "Count of total unique users within the journey"}, "first_event_at": {"type": "timestamp without time zone", "index": 18, "name": "first_event_at", "comment": "Timestamp of the first event generated by any campaign in the journey"}, "last_event_at": {"type": "timestamp without time zone", "index": 19, "name": "last_event_at", "comment": "Timestamp of the most recent event generated by any campaign in the journey"}, "total_emailclick": {"type": "numeric", "index": 20, "name": "total_emailclick", "comment": "Total email clicks within the journey"}, "unique_total_emailclick": {"type": "bigint", "index": 21, "name": "unique_total_emailclick", "comment": "Count of distinct users with email clicks within the journey"}, "total_emailunsubscribe": {"type": "numeric", "index": 22, "name": "total_emailunsubscribe", "comment": "Total email unsubscribe events within the journey"}, "unique_total_emailunsubscribe": {"type": "bigint", "index": 23, "name": "unique_total_emailunsubscribe", "comment": "Count of distinct users with email unsubscribe events within the journey"}, "total_emailcomplaint": {"type": "numeric", "index": 24, "name": "total_emailcomplaint", "comment": "Total email complaints within the journey"}, "unique_total_emailcomplaint": {"type": "bigint", "index": 25, "name": "unique_total_emailcomplaint", "comment": "Count of distinct users with email complaints within the journey"}, "total_customevent": {"type": "numeric", "index": 26, "name": "total_customevent", "comment": "Total custom events within the journey"}, "unique_total_customevent": {"type": "bigint", "index": 27, "name": "unique_total_customevent", "comment": "Count of distinct users with custom events within the journey"}, "total_emailsubscribe": {"type": "numeric", "index": 28, "name": "total_emailsubscribe", "comment": "Total email subscribe events within the journey"}, "unique_total_emailsubscribe": {"type": "bigint", "index": 29, "name": "unique_total_emailsubscribe", "comment": "Count of distinct users with email subscribe events within the journey"}, "total_emailopen": {"type": "numeric", "index": 30, "name": "total_emailopen", "comment": "Total email open events within the journey"}, "unique_total_emailopen": {"type": "bigint", "index": 31, "name": "unique_total_emailopen", "comment": "Count of distinct users with email open events within the journey"}, "total_pushsend": {"type": "numeric", "index": 32, "name": "total_pushsend", "comment": "Total push send events within the journey"}, "unique_total_pushsend": {"type": "bigint", "index": 33, "name": "unique_total_pushsend", "comment": "Count of distinct users with push send events within the journey"}, "total_smsbounce": {"type": "numeric", "index": 34, "name": "total_smsbounce", "comment": "Total sms bounce events within the journey"}, "unique_total_smsbounce": {"type": "bigint", "index": 35, "name": "unique_total_smsbounce", "comment": "Count of distinct users with sms bounce events within the journey"}, "total_pushbounce": {"type": "numeric", "index": 36, "name": "total_pushbounce", "comment": "Total push bounce events within the journey"}, "unique_total_pushbounce": {"type": "bigint", "index": 37, "name": "unique_total_pushbounce", "comment": "Count of distinct users with push bounce events within the journey"}, "total_inappsendskip": {"type": "numeric", "index": 38, "name": "total_inappsendskip", "comment": "Total in app send skip events within the journey"}, "unique_total_inappsendskip": {"type": "bigint", "index": 39, "name": "unique_total_inappsendskip", "comment": "Count of distinct users with in app send skip events within the journey"}, "total_smssend": {"type": "numeric", "index": 40, "name": "total_smssend", "comment": "Total sms send events within the journey"}, "unique_total_smssend": {"type": "bigint", "index": 41, "name": "unique_total_smssend", "comment": "Count of distinct users with sms send events within the journey"}, "total_inappsend": {"type": "numeric", "index": 42, "name": "total_inappsend", "comment": "Total in app send events within the journey"}, "unique_total_inappsend": {"type": "bigint", "index": 43, "name": "unique_total_inappsend", "comment": "Count of distinct users with in app send events within the journey"}, "total_pushopen": {"type": "numeric", "index": 44, "name": "total_pushopen", "comment": "Total push open events within the journey"}, "unique_total_pushopen": {"type": "bigint", "index": 45, "name": "unique_total_pushopen", "comment": "Count of distinct users with push open events within the journey"}, "total_emailsend": {"type": "numeric", "index": 46, "name": "total_emailsend", "comment": "Total email send events within the journey"}, "unique_total_emailsend": {"type": "bigint", "index": 47, "name": "unique_total_emailsend", "comment": "Count of distinct users with email send events within the journey"}, "total_pushsendskip": {"type": "numeric", "index": 48, "name": "total_pushsendskip", "comment": "Total push send skip events within the journey"}, "unique_total_pushsendskip": {"type": "bigint", "index": 49, "name": "unique_total_pushsendskip", "comment": "Count of distinct users with push send skip events within the journey"}, "total_inappopen": {"type": "numeric", "index": 50, "name": "total_inappopen", "comment": "Total in app open events within the journey"}, "unique_total_inappopen": {"type": "bigint", "index": 51, "name": "unique_total_inappopen", "comment": "Count of distinct users with in app open events within the journey"}, "total_emailsendskip": {"type": "numeric", "index": 52, "name": "total_emailsendskip", "comment": "Total email send skip events within the journey"}, "unique_total_emailsendskip": {"type": "bigint", "index": 53, "name": "unique_total_emailsendskip", "comment": "Count of distinct users with email send skip events within the journey"}, "total_emailbounce": {"type": "numeric", "index": 54, "name": "total_emailbounce", "comment": "Total email bounce events within the journey"}, "unique_total_emailbounce": {"type": "bigint", "index": 55, "name": "unique_total_emailbounce", "comment": "Count of distinct users with email bounce events within the journey"}, "total_inappclick": {"type": "numeric", "index": 56, "name": "total_inappclick", "comment": "Total in app click events within the journey"}, "unique_total_inappclick": {"type": "bigint", "index": 57, "name": "unique_total_inappclick", "comment": "Count of distinct users with in app click events within the journey"}, "total_pushuninstall": {"type": "numeric", "index": 58, "name": "total_pushuninstall", "comment": "Total push uninstall events within the journey"}, "unique_total_pushuninstall": {"type": "bigint", "index": 59, "name": "unique_total_pushuninstall", "comment": "Count of distinct users with push uninstall events within the journey"}, "unique_journey_id": {"type": "text", "index": 60, "name": "unique_journey_id", "comment": "Unique identifier combining journey_id and source_relation."}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.iterable__journeys"}, "model.iterable.iterable__list_user_history": {"metadata": {"type": "BASE TABLE", "schema": "public_iterable_dev", "name": "iterable__list_user_history", "database": "postgres", "comment": "Table that recreates the `list_user_history` source table. Additionally, this table provides an `is_current` field to identify the current lists associated with the user. The table coalesces list_id values from both the direct list_user relationships and the unnested email_list_ids from user history to ensure comprehensive list coverage. The grain of this table is at the user/list/updated_at level.\n", "owner": "postgres"}, "columns": {"source_relation": {"type": "text", "index": 1, "name": "source_relation", "comment": "Identifies the record's source."}, "unique_user_key": {"type": "text", "index": 2, "name": "unique_user_key", "comment": "The unique identifier of the user. With the new schema (Aug 2023), it is the _fivetran_user_id. This is a hash of user_id and/or email, depending on project type. If using the old schema, it is email."}, "_fivetran_user_id": {"type": "text", "index": 3, "name": "_fivetran_user_id", "comment": "A Fivetran-created unique identifier for the new Iterable schema in Aug 2023, for users, derived from hashing user_id and/or email, depending on project type."}, "user_id": {"type": "text", "index": 4, "name": "user_id", "comment": "User identifier, for userID-based projects."}, "user_email": {"type": "text", "index": 5, "name": "user_email", "comment": "Email of the user if it exists."}, "user_first_name": {"type": "integer", "index": 6, "name": "user_first_name", "comment": "First name of the user"}, "user_last_name": {"type": "integer", "index": 7, "name": "user_last_name", "comment": "Last name of the user"}, "user_signup_date": {"type": "text", "index": 8, "name": "user_signup_date", "comment": "Timestamp of when the user signed up"}, "user_signup_source": {"type": "text", "index": 9, "name": "user_signup_source", "comment": "Source where the user signed up"}, "user_updated_at": {"type": "timestamp without time zone", "index": 10, "name": "user_updated_at", "comment": "Last update timestamp"}, "list_id": {"type": "bigint", "index": 11, "name": "list_id", "comment": "The list associated with the user. Uses coalesced values prioritizing `list_id` from `LIST_USER` over the unnested `email_list_ids` from `USER_HISTORY` for comprehensive list coverage."}, "is_current": {"type": "boolean", "index": 12, "name": "is_current", "comment": "Boolean indicating if the current list is active"}, "list_name": {"type": "text", "index": 13, "name": "list_name", "comment": "Name of the list associated with the user"}, "list_type": {"type": "text", "index": 14, "name": "list_type", "comment": "Type of list associated with the user"}, "list_created_at": {"type": "text", "index": 15, "name": "list_created_at", "comment": "Date the list was created"}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.iterable__list_user_history"}, "model.iterable.iterable__user_campaign": {"metadata": {"type": "BASE TABLE", "schema": "public_iterable_dev", "name": "iterable__user_campaign", "database": "postgres", "comment": "Table that provides total and unique metrics for a user associated with particular campaigns and if available, experiments.", "owner": "postgres"}, "columns": {"source_relation": {"type": "text", "index": 1, "name": "source_relation", "comment": "Identifies the record's source."}, "_fivetran_user_id": {"type": "text", "index": 2, "name": "_fivetran_user_id", "comment": "A Fivetran-created unique identifier for the new Iterable schema in Aug 2023, for users, derived from hashing user_id and/or email, depending on project type."}, "unique_user_key": {"type": "text", "index": 3, "name": "unique_user_key", "comment": "The unique identifier of the user. With the new schema (Aug 2023), it is the _fivetran_user_id. This is a hash of user_id and/or email, depending on project type. If using the old schema, it is email."}, "user_id": {"type": "text", "index": 4, "name": "user_id", "comment": "User identifier, for userID-based projects."}, "campaign_id": {"type": "text", "index": 5, "name": "campaign_id", "comment": "The unique identifier of the campaign which the user metrics are associated"}, "experiment_id": {"type": "integer", "index": 6, "name": "experiment_id", "comment": "The unique experiment variation of the campaign"}, "user_email": {"type": "text", "index": 7, "name": "user_email", "comment": "Email of the user if it exists."}, "user_full_name": {"type": "text", "index": 8, "name": "user_full_name", "comment": "The users first and last name"}, "campaign_name": {"type": "text", "index": 9, "name": "campaign_name", "comment": "The name of the campaign which the user metrics are associated"}, "template_id": {"type": "text", "index": 10, "name": "template_id", "comment": "The unique identifier of the template used within the campaign"}, "template_name": {"type": "text", "index": 11, "name": "template_name", "comment": "The name of the template used for the campaign"}, "recurring_campaign_id": {"type": "text", "index": 12, "name": "recurring_campaign_id", "comment": "The unique identifier of the recurring campaign which the campaign is tied to"}, "recurring_campaign_name": {"type": "text", "index": 13, "name": "recurring_campaign_name", "comment": "The name of the recurring campaign which the campaign is tied to"}, "first_event_at": {"type": "timestamp without time zone", "index": 14, "name": "first_event_at", "comment": "Timestamp of the first campaign/experiment event associated with the user"}, "last_event_at": {"type": "timestamp without time zone", "index": 15, "name": "last_event_at", "comment": "Timestamp of the most recent campaign/experiment event associated with the user"}, "first_open_or_click_event_at": {"type": "timestamp without time zone", "index": 16, "name": "first_open_or_click_event_at", "comment": "The time of the first open or click time. This is the first time a user interacts with a campaign, recording the earliest occurring event out of 'emailOpen', 'emailClick', and 'pushOpen'."}, "total_emailclick": {"type": "bigint", "index": 17, "name": "total_emailclick", "comment": "Total email clicks events the user took within the campaign/experiment"}, "total_emailunsubscribe": {"type": "bigint", "index": 18, "name": "total_emailunsubscribe", "comment": "Total email unsubscription events the user performed within the campaign/experiment"}, "total_emailcomplaint": {"type": "bigint", "index": 19, "name": "total_emailcomplaint", "comment": "Total email complaint events the user performed within the campaign/experiment"}, "total_customevent": {"type": "bigint", "index": 20, "name": "total_customevent", "comment": "Total custom events associated with the user within the campaign/experiment"}, "total_emailsubscribe": {"type": "bigint", "index": 21, "name": "total_emailsubscribe", "comment": "Total email subscription events associate with the user within the campaign/experiment"}, "total_emailopen": {"type": "bigint", "index": 22, "name": "total_emailopen", "comment": "Total email open events the user performed within the campaign/experiment"}, "total_pushsend": {"type": "bigint", "index": 23, "name": "total_pushsend", "comment": "Total push send events the user performed within the campaign/experiment"}, "total_smsbounce": {"type": "bigint", "index": 24, "name": "total_smsbounce", "comment": "Total sms bounce events associated with the user within the campaign/experiment"}, "total_pushbounce": {"type": "bigint", "index": 25, "name": "total_pushbounce", "comment": "Total push bounce events associated with the user within the campaign/experiment"}, "total_inappsendskip": {"type": "bigint", "index": 26, "name": "total_inappsendskip", "comment": "Total in app send skip events the user performed within the campaign/experiment"}, "total_smssend": {"type": "bigint", "index": 27, "name": "total_smssend", "comment": "Total sms send events associated with the user within the campaign/experiment"}, "total_inappsend": {"type": "bigint", "index": 28, "name": "total_inappsend", "comment": "Total in app send events associated with the user within the campaign/experiment"}, "total_pushopen": {"type": "bigint", "index": 29, "name": "total_pushopen", "comment": "Total push open events the user performed within the campaign/experiment"}, "total_emailsend": {"type": "bigint", "index": 30, "name": "total_emailsend", "comment": "Total email send event associated with the user within the campaign/experiment"}, "total_pushsendskip": {"type": "bigint", "index": 31, "name": "total_pushsendskip", "comment": "Total push send skip events associated with the user within the campaign/experiment"}, "total_inappopen": {"type": "bigint", "index": 32, "name": "total_inappopen", "comment": "Total in app open events associated with the user within the campaign/experiment"}, "total_emailsendskip": {"type": "bigint", "index": 33, "name": "total_emailsendskip", "comment": "Total email send skip events associated with the user within the campaign/experiment"}, "total_emailbounce": {"type": "bigint", "index": 34, "name": "total_emailbounce", "comment": "Total email bounce events associated with the user within the campaign/experiment"}, "total_inappclick": {"type": "bigint", "index": 35, "name": "total_inappclick", "comment": "Total in app click events associated with the user within the campaign/experiment"}, "total_pushuninstall": {"type": "bigint", "index": 36, "name": "total_pushuninstall", "comment": "Total push uninstall events associated with the user within the campaign/experiment"}, "unique_user_campaign_id": {"type": "text", "index": 37, "name": "unique_user_campaign_id", "comment": "Unique ID combining source_relation, unique_user_key, campaign_id, and if available, experiment_id."}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.iterable__user_campaign"}, "model.iterable.iterable__user_unsubscriptions": {"metadata": {"type": "BASE TABLE", "schema": "public_iterable_dev", "name": "iterable__user_unsubscriptions", "database": "postgres", "comment": "Table that generates the total channel and message types a user has chosen to unsubscribe.", "owner": "postgres"}, "columns": {"source_relation": {"type": "text", "index": 1, "name": "source_relation", "comment": "Identifies the record's source."}, "_fivetran_user_id": {"type": "text", "index": 2, "name": "_fivetran_user_id", "comment": "A Fivetran-created unique identifier for the new Iterable schema in Aug 2023, for users, derived from hashing user_id and/or email, depending on project type."}, "unique_user_key": {"type": "text", "index": 3, "name": "unique_user_key", "comment": "The unique identifier of the user. With the new schema (Aug 2023), it is the _fivetran_user_id. This is a hash of user_id and/or email, depending on project type. If using the old schema, it is email."}, "channel_id": {"type": "text", "index": 4, "name": "channel_id", "comment": "Unique identifier of the channel which the user is unsubscribed"}, "message_type_id": {"type": "text", "index": 5, "name": "message_type_id", "comment": "Unique identifier of the message type which the user is unsubscribed"}, "updated_at": {"type": "timestamp without time zone", "index": 6, "name": "updated_at", "comment": "Timestamp of when the user unsubscribed from the channel or message type"}, "channel_name": {"type": "text", "index": 7, "name": "channel_name", "comment": "The name of the channel which the user is unsubscribed"}, "message_type_name": {"type": "text", "index": 8, "name": "message_type_name", "comment": "The name of the message type which the user is unsubscribed"}, "channel_type": {"type": "text", "index": 9, "name": "channel_type", "comment": "The channel type which the user is unsubscribed"}, "message_medium": {"type": "text", "index": 10, "name": "message_medium", "comment": "The medium type the message was provided which the user is unsubscribed"}, "is_unsubscribed_channel_wide": {"type": "boolean", "index": 11, "name": "is_unsubscribed_channel_wide", "comment": "Boolean indicating if the user unsubscribed at the channel level (i.e. unsubscribed to all message types) or if they unsubscribed from only an individual message type.\n"}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.iterable__user_unsubscriptions"}, "model.iterable.iterable__users": {"metadata": {"type": "BASE TABLE", "schema": "public_iterable_dev", "name": "iterable__users", "database": "postgres", "comment": "Table that provides unique user enriched information.", "owner": "postgres"}, "columns": {"source_relation": {"type": "text", "index": 1, "name": "source_relation", "comment": "Identifies the record's source."}, "user_id": {"type": "text", "index": 2, "name": "user_id", "comment": "User identifier, for userID-based projects."}, "_fivetran_user_id": {"type": "text", "index": 3, "name": "_fivetran_user_id", "comment": "A Fivetran-created unique identifier for the new Iterable schema in Aug 2023, for users, derived from hashing user_id and/or email, depending on project type."}, "unique_user_key": {"type": "text", "index": 4, "name": "unique_user_key", "comment": "The unique identifier of the user. With the new schema (Aug 2023), it is the _fivetran_user_id. This is a hash of user_id and/or email, depending on project type. If using the old schema, it is email."}, "email": {"type": "text", "index": 5, "name": "email", "comment": "The user's email. User identifier, for email-based projects. Previously was the unique identifier for user records, for the old Iterable schema before the August 2023 updates."}, "first_name": {"type": "integer", "index": 6, "name": "first_name", "comment": "First name of the user"}, "last_name": {"type": "integer", "index": 7, "name": "last_name", "comment": "Last name of the user"}, "signup_date": {"type": "text", "index": 8, "name": "signup_date", "comment": "Timestamp of when the user signed up"}, "signup_source": {"type": "text", "index": 9, "name": "signup_source", "comment": "Source where the user signed up"}, "updated_at": {"type": "timestamp without time zone", "index": 10, "name": "updated_at", "comment": "Last update timestamp"}, "phone_number": {"type": "integer", "index": 11, "name": "phone_number", "comment": "Phone number associated with the user"}, "email_list_ids": {"type": "text", "index": 12, "name": "email_list_ids", "comment": "Array of all email lists associated with the user, derived from the list_user table relationships"}, "count_lists": {"type": "bigint", "index": 13, "name": "count_lists", "comment": "Total count of lists associated with the user"}, "count_total_campaigns": {"type": "bigint", "index": 14, "name": "count_total_campaigns", "comment": "Count of all campaigns the user has been in"}, "first_event_at": {"type": "timestamp without time zone", "index": 15, "name": "first_event_at", "comment": "The first event the user ever encountered"}, "last_event_at": {"type": "timestamp without time zone", "index": 16, "name": "last_event_at", "comment": "The most recent event the user has encountered"}, "total_emailclick": {"type": "numeric", "index": 17, "name": "total_emailclick", "comment": "Total number of email clicks the user has performed"}, "total_emailunsubscribe": {"type": "numeric", "index": 18, "name": "total_emailunsubscribe", "comment": "Total unsubscription events the user has performed"}, "total_emailcomplaint": {"type": "numeric", "index": 19, "name": "total_emailcomplaint", "comment": "Total email complaints the user has performed"}, "total_customevent": {"type": "numeric", "index": 20, "name": "total_customevent", "comment": "Total custom events associated with the user"}, "total_emailsubscribe": {"type": "numeric", "index": 21, "name": "total_emailsubscribe", "comment": "Total subscription events the user has performed"}, "total_emailopen": {"type": "numeric", "index": 22, "name": "total_emailopen", "comment": "Total email opened events the user has performed"}, "total_pushsend": {"type": "numeric", "index": 23, "name": "total_pushsend", "comment": "The push send events the user has experienced"}, "total_smsbounce": {"type": "numeric", "index": 24, "name": "total_smsbounce", "comment": "Total sms bounces that are associated with the user"}, "total_pushbounce": {"type": "numeric", "index": 25, "name": "total_pushbounce", "comment": "Total number of push bounces associated with the user"}, "total_inappsendskip": {"type": "numeric", "index": 26, "name": "total_inappsendskip", "comment": "Total in app send skips associated with the user"}, "total_smssend": {"type": "numeric", "index": 27, "name": "total_smssend", "comment": "Total sms sends that the user has experienced"}, "total_inappsend": {"type": "numeric", "index": 28, "name": "total_inappsend", "comment": "Total in app sends the user has experienced"}, "total_pushopen": {"type": "numeric", "index": 29, "name": "total_pushopen", "comment": "Total push messages the user has opened"}, "total_emailsend": {"type": "numeric", "index": 30, "name": "total_emailsend", "comment": "Total emails that have been sent to the user"}, "total_pushsendskip": {"type": "numeric", "index": 31, "name": "total_pushsendskip", "comment": "Total push sends the user has skipped"}, "total_inappopen": {"type": "numeric", "index": 32, "name": "total_inappopen", "comment": "Total in app opens the user has performed"}, "total_emailsendskip": {"type": "numeric", "index": 33, "name": "total_emailsendskip", "comment": "Total email sends the user has skipped"}, "total_emailbounce": {"type": "numeric", "index": 34, "name": "total_emailbounce", "comment": "Total number of emails that have bounced from the user"}, "total_inappclick": {"type": "numeric", "index": 35, "name": "total_inappclick", "comment": "Total in app clicks associated with the user"}, "total_pushuninstall": {"type": "numeric", "index": 36, "name": "total_pushuninstall", "comment": "Total push uninstall events the user has performed"}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.iterable__users"}, "model.iterable.stg_iterable__campaign_history": {"metadata": {"type": "BASE TABLE", "schema": "public_iterable_dev", "name": "stg_iterable__campaign_history", "database": "postgres", "comment": "Table containing a history of campaigns.", "owner": "postgres"}, "columns": {"source_relation": {"type": "text", "index": 1, "name": "source_relation", "comment": "Identifies the record's source."}, "campaign_id": {"type": "text", "index": 2, "name": "campaign_id", "comment": "Unique identifier of the campaign record"}, "updated_at": {"type": "text", "index": 3, "name": "updated_at", "comment": "Last update timestamp"}, "campaign_name": {"type": "text", "index": 4, "name": "campaign_name", "comment": "User defined name of the campaign."}, "campaign_state": {"type": "text", "index": 5, "name": "campaign_state", "comment": "State of the campaign. Can be Draft, Ready, Scheduled, Running, Finished, Starting, Aborted or Recurring"}, "campaign_type": {"type": "text", "index": 6, "name": "campaign_type", "comment": "The campaign type. Can be Blast or Triggered"}, "send_size": {"type": "integer", "index": 7, "name": "send_size", "comment": "Size of the campaign. Number of individuals included in the campaign"}, "start_at": {"type": "integer", "index": 8, "name": "start_at", "comment": "Start timestamp"}, "ended_at": {"type": "integer", "index": 9, "name": "ended_at", "comment": "Ended timestamp"}, "created_at": {"type": "text", "index": 10, "name": "created_at", "comment": "Creation timestamp"}, "message_medium": {"type": "text", "index": 11, "name": "message_medium", "comment": "The medium that this message was sent via, for example Email or InApp"}, "recurring_campaign_id": {"type": "text", "index": 12, "name": "recurring_campaign_id", "comment": "Reference to the recurring campaign, if applicable"}, "created_by_user_id": {"type": "text", "index": 13, "name": "created_by_user_id", "comment": "Reference to the user who created the campaign"}, "updated_by_user_id": {"type": "text", "index": 14, "name": "updated_by_user_id", "comment": "ID of the user who updated this record"}, "template_id": {"type": "text", "index": 15, "name": "template_id", "comment": "Reference to the campaign template"}, "workflow_id": {"type": "integer", "index": 16, "name": "workflow_id", "comment": "Reference to the workflow which the event originated"}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 17, "name": "_fivetran_synced", "comment": "The time when a record was last updated by Fivetran."}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.stg_iterable__campaign_history"}, "model.iterable.stg_iterable__campaign_history_tmp": {"metadata": {"type": "VIEW", "schema": "public_iterable_dev", "name": "stg_iterable__campaign_history_tmp", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"id": {"type": "integer", "index": 1, "name": "id", "comment": null}, "updated_at": {"type": "text", "index": 2, "name": "updated_at", "comment": null}, "template_id": {"type": "integer", "index": 3, "name": "template_id", "comment": null}, "recurring_campaign_id": {"type": "integer", "index": 4, "name": "recurring_campaign_id", "comment": null}, "campaign_state": {"type": "text", "index": 5, "name": "campaign_state", "comment": null}, "created_at": {"type": "text", "index": 6, "name": "created_at", "comment": null}, "created_by_user_id": {"type": "text", "index": 7, "name": "created_by_user_id", "comment": null}, "ended_at": {"type": "integer", "index": 8, "name": "ended_at", "comment": null}, "name": {"type": "text", "index": 9, "name": "name", "comment": null}, "send_size": {"type": "integer", "index": 10, "name": "send_size", "comment": null}, "start_at": {"type": "integer", "index": 11, "name": "start_at", "comment": null}, "type": {"type": "text", "index": 12, "name": "type", "comment": null}, "workflow_id": {"type": "integer", "index": 13, "name": "workflow_id", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 14, "name": "_fivetran_synced", "comment": null}, "updated_by_user_id": {"type": "integer", "index": 15, "name": "updated_by_user_id", "comment": null}, "message_medium": {"type": "text", "index": 16, "name": "message_medium", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.stg_iterable__campaign_history_tmp"}, "model.iterable.stg_iterable__campaign_label_history": {"metadata": {"type": "BASE TABLE", "schema": "public_iterable_dev", "name": "stg_iterable__campaign_label_history", "database": "postgres", "comment": "Table containing a history of labels.", "owner": "postgres"}, "columns": {"source_relation": {"type": "text", "index": 1, "name": "source_relation", "comment": "Identifies the record's source."}, "campaign_id": {"type": "text", "index": 2, "name": "campaign_id", "comment": "Reference to the campaign associated with the label"}, "label": {"type": "text", "index": 3, "name": "label", "comment": "Name of the label"}, "updated_at": {"type": "text", "index": 4, "name": "updated_at", "comment": "Last update timestamp"}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 5, "name": "_fivetran_synced", "comment": "The time when a record was last updated by Fivetran."}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.stg_iterable__campaign_label_history"}, "model.iterable.stg_iterable__campaign_label_history_tmp": {"metadata": {"type": "VIEW", "schema": "public_iterable_dev", "name": "stg_iterable__campaign_label_history_tmp", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"campaign_id": {"type": "integer", "index": 1, "name": "campaign_id", "comment": null}, "label": {"type": "text", "index": 2, "name": "label", "comment": null}, "updated_at": {"type": "text", "index": 3, "name": "updated_at", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 4, "name": "_fivetran_synced", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.stg_iterable__campaign_label_history_tmp"}, "model.iterable.stg_iterable__campaign_list_history": {"metadata": {"type": "BASE TABLE", "schema": "public_iterable_dev", "name": "stg_iterable__campaign_list_history", "database": "postgres", "comment": "Table containing a history of lists.", "owner": "postgres"}, "columns": {"source_relation": {"type": "text", "index": 1, "name": "source_relation", "comment": "Identifies the record's source."}, "campaign_id": {"type": "text", "index": 2, "name": "campaign_id", "comment": "Reference to the campaign associated with the label"}, "list_id": {"type": "text", "index": 3, "name": "list_id", "comment": "Reference to the list used"}, "updated_at": {"type": "text", "index": 4, "name": "updated_at", "comment": "Last update timestamp"}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 5, "name": "_fivetran_synced", "comment": "The time when a record was last updated by Fivetran."}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.stg_iterable__campaign_list_history"}, "model.iterable.stg_iterable__campaign_list_history_tmp": {"metadata": {"type": "VIEW", "schema": "public_iterable_dev", "name": "stg_iterable__campaign_list_history_tmp", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"list_id": {"type": "integer", "index": 1, "name": "list_id", "comment": null}, "campaign_id": {"type": "integer", "index": 2, "name": "campaign_id", "comment": null}, "updated_at": {"type": "text", "index": 3, "name": "updated_at", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 4, "name": "_fivetran_synced", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.stg_iterable__campaign_list_history_tmp"}, "model.iterable.stg_iterable__campaign_suppression_list_history": {"metadata": {"type": "BASE TABLE", "schema": "public_iterable_dev", "name": "stg_iterable__campaign_suppression_list_history", "database": "postgres", "comment": "Table containing a history of suppression lists.", "owner": "postgres"}, "columns": {"source_relation": {"type": "text", "index": 1, "name": "source_relation", "comment": "Identifies the record's source."}, "campaign_id": {"type": "text", "index": 2, "name": "campaign_id", "comment": "Reference to the campaign associated with the label"}, "suppressed_list_id": {"type": "text", "index": 3, "name": "suppressed_list_id", "comment": "Reference to the list used"}, "updated_at": {"type": "text", "index": 4, "name": "updated_at", "comment": "Last update timestamp"}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 5, "name": "_fivetran_synced", "comment": "The time when a record was last updated by Fivetran."}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.stg_iterable__campaign_suppression_list_history"}, "model.iterable.stg_iterable__campaign_suppression_list_history_tmp": {"metadata": {"type": "VIEW", "schema": "public_iterable_dev", "name": "stg_iterable__campaign_suppression_list_history_tmp", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"suppressed_list_id": {"type": "integer", "index": 1, "name": "suppressed_list_id", "comment": null}, "campaign_id": {"type": "integer", "index": 2, "name": "campaign_id", "comment": null}, "updated_at": {"type": "text", "index": 3, "name": "updated_at", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 4, "name": "_fivetran_synced", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.stg_iterable__campaign_suppression_list_history_tmp"}, "model.iterable.stg_iterable__channel": {"metadata": {"type": "BASE TABLE", "schema": "public_iterable_dev", "name": "stg_iterable__channel", "database": "postgres", "comment": "Table containing unique channels.", "owner": "postgres"}, "columns": {"source_relation": {"type": "text", "index": 1, "name": "source_relation", "comment": "Identifies the record's source."}, "channel_id": {"type": "text", "index": 2, "name": "channel_id", "comment": "Unique identifier of the channel"}, "channel_name": {"type": "text", "index": 3, "name": "channel_name", "comment": "User defined name of the channel"}, "channel_type": {"type": "text", "index": 4, "name": "channel_type", "comment": "The channel type"}, "message_medium": {"type": "text", "index": 5, "name": "message_medium", "comment": "The message medium associated with the channel"}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 6, "name": "_fivetran_synced", "comment": "The time when a record was last updated by Fivetran."}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.stg_iterable__channel"}, "model.iterable.stg_iterable__channel_tmp": {"metadata": {"type": "VIEW", "schema": "public_iterable_dev", "name": "stg_iterable__channel_tmp", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"id": {"type": "bigint", "index": 1, "name": "id", "comment": null}, "name": {"type": "text", "index": 2, "name": "name", "comment": null}, "channel_type": {"type": "text", "index": 3, "name": "channel_type", "comment": null}, "message_medium": {"type": "text", "index": 4, "name": "message_medium", "comment": null}, "_fivetran_deleted": {"type": "boolean", "index": 5, "name": "_fivetran_deleted", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 6, "name": "_fivetran_synced", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.stg_iterable__channel_tmp"}, "model.iterable.stg_iterable__event": {"metadata": {"type": "VIEW", "schema": "public_iterable_dev", "name": "stg_iterable__event", "database": "postgres", "comment": "Table containing individual events within campaigns.", "owner": "postgres"}, "columns": {"source_relation": {"type": "text", "index": 1, "name": "source_relation", "comment": "Identifies the record's source."}, "event_id": {"type": "text", "index": 2, "name": "event_id", "comment": "A Fivetran-created unique identifier derived from hashing campaign_id, created_at, and event_name."}, "unique_event_id": {"type": "text", "index": 3, "name": "unique_event_id", "comment": "A surrogate key made up of event_id, _fivetran_user_id, and source_relation."}, "_fivetran_user_id": {"type": "text", "index": 4, "name": "_fivetran_user_id", "comment": "A Fivetran-created unique identifier for users, derived from hashing user_id and/or email, depending on project type. This exists for users of the new schema starting Aug 2023. In the old schema, the unique identifier is email."}, "unique_user_key": {"type": "text", "index": 5, "name": "unique_user_key", "comment": "The unique identifier of the user. With the new schema (Aug 2023), it is the _fivetran_user_id. This is a hash of user_id and/or email, depending on project type. If using the old schema, it is email."}, "campaign_id": {"type": "text", "index": 6, "name": "campaign_id", "comment": "Reference to the campaign from which the event originated"}, "content_id": {"type": "text", "index": 7, "name": "content_id", "comment": "Reference to the content the event is associated with"}, "created_at": {"type": "timestamp without time zone", "index": 8, "name": "created_at", "comment": "Creation timestamp"}, "created_on": {"type": "date", "index": 9, "name": "created_on", "comment": "Creation date"}, "email": {"type": "text", "index": 10, "name": "email", "comment": "Reference to the unique user the event was applied to"}, "additional_properties": {"type": "text", "index": 11, "name": "additional_properties", "comment": "json object containing addition event properties"}, "event_name": {"type": "text", "index": 12, "name": "event_name", "comment": "Name provided to the individual event"}, "message_bus_id": {"type": "text", "index": 13, "name": "message_bus_id", "comment": "Reference to the message bus associated with the event"}, "message_id": {"type": "text", "index": 14, "name": "message_id", "comment": "Reference to the message the event is associated with"}, "message_type_id": {"type": "text", "index": 15, "name": "message_type_id", "comment": "Reference to the type of message the event is associated with"}, "recipient_state": {"type": "integer", "index": 16, "name": "recipient_state", "comment": "The state of the recipient upon receiving the event"}, "status": {"type": "integer", "index": 17, "name": "status", "comment": "Status of the event"}, "transactional_data": {"type": "character varying(100)", "index": 18, "name": "transactional_data", "comment": "Transactional data associated with the event"}, "unsub_source": {"type": "integer", "index": 19, "name": "unsub_source", "comment": "Source of the unsubscribe event"}, "user_agent": {"type": "integer", "index": 20, "name": "user_agent", "comment": "User agent associated with the event"}, "user_agent_device": {"type": "integer", "index": 21, "name": "user_agent_device", "comment": "The device of the user agent"}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 22, "name": "_fivetran_synced", "comment": "The time when a record was last updated by Fivetran."}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.stg_iterable__event"}, "model.iterable.stg_iterable__event_extension": {"metadata": {"type": "VIEW", "schema": "public_iterable_dev", "name": "stg_iterable__event_extension", "database": "postgres", "comment": "Table containing addition properties from the event table.", "owner": "postgres"}, "columns": {"source_relation": {"type": "text", "index": 1, "name": "source_relation", "comment": "Identifies the record's source."}, "event_id": {"type": "text", "index": 2, "name": "event_id", "comment": "A Fivetran-created unique identifier derived from hashing campaign_id, created_at, and event_name."}, "unique_event_id": {"type": "text", "index": 3, "name": "unique_event_id", "comment": "A surrogate key made up of event_id, _fivetran_user_id, and source_relation."}, "is_app_already_running": {"type": "integer", "index": 4, "name": "is_app_already_running", "comment": "Boolean indicating if the app is currently running or not"}, "badge": {"type": "integer", "index": 5, "name": "badge", "comment": "Badge associated with the event"}, "catalog_collection_count": {"type": "integer", "index": 6, "name": "catalog_collection_count", "comment": "The count of products or items collected in a catalog associated with the event."}, "catalog_lookup_count": {"type": "integer", "index": 7, "name": "catalog_lookup_count", "comment": "The count of times a catalog was looked up or queried during the event."}, "canonical_url_id": {"type": "text", "index": 8, "name": "canonical_url_id", "comment": "Reference to the url associated with the event"}, "is_content_available": {"type": "integer", "index": 9, "name": "is_content_available", "comment": "Content available from the event"}, "content_id": {"type": "text", "index": 10, "name": "content_id", "comment": "Reference to the content associated with the event"}, "device": {"type": "integer", "index": 11, "name": "device", "comment": "The device associated with the event"}, "email_id": {"type": "text", "index": 12, "name": "email_id", "comment": "Reference to the email associated with the event"}, "email_subject": {"type": "text", "index": 13, "name": "email_subject", "comment": "Subject of the email associated with the event"}, "experiment_id": {"type": "integer", "index": 14, "name": "experiment_id", "comment": "Reference to the experiment used if the event is an experiment"}, "from_phone_number_id": {"type": "integer", "index": 15, "name": "from_phone_number_id", "comment": "Reference to the phone number which the event is from"}, "from_smssender_id": {"type": "integer", "index": 16, "name": "from_smssender_id", "comment": "Reference to the sms sender which the event is from"}, "link_id": {"type": "text", "index": 17, "name": "link_id", "comment": "Reference to the link associated with the event"}, "link_url": {"type": "integer", "index": 18, "name": "link_url", "comment": "Url of the link associated with the event"}, "locale": {"type": "integer", "index": 19, "name": "locale", "comment": "Locale associated with the event"}, "payload": {"type": "character varying(100)", "index": 20, "name": "payload", "comment": "Payload resulted from the event"}, "platform_endpoint": {"type": "integer", "index": 21, "name": "platform_endpoint", "comment": "The specific platform endpoint of the event"}, "push_message": {"type": "integer", "index": 22, "name": "push_message", "comment": "Boolean indicating if the event is a push message"}, "region": {"type": "text", "index": 23, "name": "region", "comment": "Region of the event"}, "sms_message": {"type": "integer", "index": 24, "name": "sms_message", "comment": "Boolean indicating if the event is an sms message"}, "to_phone_number": {"type": "integer", "index": 25, "name": "to_phone_number", "comment": "To phone number associated with the event"}, "url": {"type": "integer", "index": 26, "name": "url", "comment": "Url associated with the event"}, "workflow_id": {"type": "text", "index": 27, "name": "workflow_id", "comment": "Reference to the workflow which the event originated"}, "workflow_name": {"type": "text", "index": 28, "name": "workflow_name", "comment": "Name of the workflow which the event originated"}, "city": {"type": "text", "index": 29, "name": "city", "comment": "The city associated with the event, which could be the location of the recipient."}, "clicked_url": {"type": "text", "index": 30, "name": "clicked_url", "comment": "The URL that was clicked by the recipient in response to the marketing message."}, "country": {"type": "text", "index": 31, "name": "country", "comment": "The country associated with the event, which could be the location of the recipient."}, "error_code": {"type": "integer", "index": 32, "name": "error_code", "comment": "The error code or message indicating any issues or errors encountered during the event."}, "expires_at": {"type": "text", "index": 33, "name": "expires_at", "comment": "The date and time when the event or message is set to expire or become invalid."}, "from_phone_number": {"type": "integer", "index": 34, "name": "from_phone_number", "comment": "The phone number from which the SMS message was sent."}, "in_app_body": {"type": "text", "index": 35, "name": "in_app_body", "comment": "The content or body of an in-app message that was sent as part of the event."}, "is_sms_estimation": {"type": "boolean", "index": 36, "name": "is_sms_estimation", "comment": "A boolean indicating whether the SMS message is an estimation or not."}, "labels": {"type": "text", "index": 37, "name": "labels", "comment": "Any labels or tags associated with the event, which can be used for categorization or organization."}, "message_status": {"type": "text", "index": 38, "name": "message_status", "comment": "The status of the marketing message, such as sent, delivered, opened, etc."}, "mms_send_count": {"type": "integer", "index": 39, "name": "mms_send_count", "comment": "The count of multimedia messages (MMS) sent as part of the event."}, "reason": {"type": "text", "index": 40, "name": "reason", "comment": "The reason or cause associated with a specific event or action."}, "sms_send_count": {"type": "integer", "index": 41, "name": "sms_send_count", "comment": "The count of SMS messages sent as part of the event."}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 42, "name": "_fivetran_synced", "comment": "The time when a record was last updated by Fivetran."}, "_fivetran_user_id": {"type": "text", "index": 43, "name": "_fivetran_user_id", "comment": "A Fivetran-created unique identifier for users, derived from hashing user_id and/or email, depending on project type. This exists for users of the new schema starting Aug 2023. In the old schema, the unique identifier is email."}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.stg_iterable__event_extension"}, "model.iterable.stg_iterable__event_extension_tmp": {"metadata": {"type": "VIEW", "schema": "public_iterable_dev", "name": "stg_iterable__event_extension_tmp", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"_fivetran_id": {"type": "text", "index": 1, "name": "_fivetran_id", "comment": null}, "app_already_running": {"type": "integer", "index": 2, "name": "app_already_running", "comment": null}, "badge": {"type": "integer", "index": 3, "name": "badge", "comment": null}, "canonical_url_id": {"type": "integer", "index": 4, "name": "canonical_url_id", "comment": null}, "content_available": {"type": "integer", "index": 5, "name": "content_available", "comment": null}, "content_id": {"type": "integer", "index": 6, "name": "content_id", "comment": null}, "device": {"type": "integer", "index": 7, "name": "device", "comment": null}, "email_id": {"type": "text", "index": 8, "name": "email_id", "comment": null}, "email_subject": {"type": "text", "index": 9, "name": "email_subject", "comment": null}, "experiment_id": {"type": "integer", "index": 10, "name": "experiment_id", "comment": null}, "from_phone_number_id": {"type": "integer", "index": 11, "name": "from_phone_number_id", "comment": null}, "from_smssender_id": {"type": "integer", "index": 12, "name": "from_smssender_id", "comment": null}, "image_url": {"type": "integer", "index": 13, "name": "image_url", "comment": null}, "is_ghost_push": {"type": "integer", "index": 14, "name": "is_ghost_push", "comment": null}, "link_id": {"type": "integer", "index": 15, "name": "link_id", "comment": null}, "link_url": {"type": "integer", "index": 16, "name": "link_url", "comment": null}, "platform_endpoint": {"type": "integer", "index": 17, "name": "platform_endpoint", "comment": null}, "push_message": {"type": "integer", "index": 18, "name": "push_message", "comment": null}, "region": {"type": "text", "index": 19, "name": "region", "comment": null}, "sms_message": {"type": "integer", "index": 20, "name": "sms_message", "comment": null}, "sound": {"type": "integer", "index": 21, "name": "sound", "comment": null}, "to_phone_number": {"type": "integer", "index": 22, "name": "to_phone_number", "comment": null}, "url": {"type": "integer", "index": 23, "name": "url", "comment": null}, "workflow_id": {"type": "integer", "index": 24, "name": "workflow_id", "comment": null}, "workflow_name": {"type": "text", "index": 25, "name": "workflow_name", "comment": null}, "locale": {"type": "integer", "index": 26, "name": "locale", "comment": null}, "deeplink_android": {"type": "integer", "index": 27, "name": "deeplink_android", "comment": null}, "deeplink_ios": {"type": "integer", "index": 28, "name": "deeplink_ios", "comment": null}, "payload": {"type": "character varying(100)", "index": 29, "name": "payload", "comment": null}, "sms_provider_response_status": {"type": "integer", "index": 30, "name": "sms_provider_response_status", "comment": null}, "sms_provider_response_message": {"type": "integer", "index": 31, "name": "sms_provider_response_message", "comment": null}, "sms_provider_response_code": {"type": "integer", "index": 32, "name": "sms_provider_response_code", "comment": null}, "sms_provider_response_more_info": {"type": "integer", "index": 33, "name": "sms_provider_response_more_info", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 34, "name": "_fivetran_synced", "comment": null}, "catalog_collection_count": {"type": "integer", "index": 35, "name": "catalog_collection_count", "comment": null}, "catalog_lookup_count": {"type": "integer", "index": 36, "name": "catalog_lookup_count", "comment": null}, "city": {"type": "text", "index": 37, "name": "city", "comment": null}, "clicked_url": {"type": "text", "index": 38, "name": "clicked_url", "comment": null}, "country": {"type": "text", "index": 39, "name": "country", "comment": null}, "error_code": {"type": "integer", "index": 40, "name": "error_code", "comment": null}, "expires_at": {"type": "text", "index": 41, "name": "expires_at", "comment": null}, "from_phone_number": {"type": "integer", "index": 42, "name": "from_phone_number", "comment": null}, "in_app_body": {"type": "text", "index": 43, "name": "in_app_body", "comment": null}, "is_sms_estimation": {"type": "boolean", "index": 44, "name": "is_sms_estimation", "comment": null}, "labels": {"type": "text", "index": 45, "name": "labels", "comment": null}, "message_context": {"type": "text", "index": 46, "name": "message_context", "comment": null}, "message_status": {"type": "text", "index": 47, "name": "message_status", "comment": null}, "mms_send_count": {"type": "integer", "index": 48, "name": "mms_send_count", "comment": null}, "product_recommendation_count": {"type": "integer", "index": 49, "name": "product_recommendation_count", "comment": null}, "proxy_source": {"type": "text", "index": 50, "name": "proxy_source", "comment": null}, "reason": {"type": "text", "index": 51, "name": "reason", "comment": null}, "sms_send_count": {"type": "integer", "index": 52, "name": "sms_send_count", "comment": null}, "web_push_body": {"type": "text", "index": 53, "name": "web_push_body", "comment": null}, "web_push_click_action": {"type": "text", "index": 54, "name": "web_push_click_action", "comment": null}, "web_push_icon": {"type": "text", "index": 55, "name": "web_push_icon", "comment": null}, "web_push_message": {"type": "text", "index": 56, "name": "web_push_message", "comment": null}, "_fivetran_user_id": {"type": "integer", "index": 57, "name": "_fivetran_user_id", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.stg_iterable__event_extension_tmp"}, "model.iterable.stg_iterable__event_tmp": {"metadata": {"type": "VIEW", "schema": "public_iterable_dev", "name": "stg_iterable__event_tmp", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"_fivetran_id": {"type": "text", "index": 1, "name": "_fivetran_id", "comment": null}, "email": {"type": "text", "index": 2, "name": "email", "comment": null}, "campaign_id": {"type": "integer", "index": 3, "name": "campaign_id", "comment": null}, "message_id": {"type": "integer", "index": 4, "name": "message_id", "comment": null}, "content_id": {"type": "integer", "index": 5, "name": "content_id", "comment": null}, "created_at": {"type": "timestamp without time zone", "index": 6, "name": "created_at", "comment": null}, "event_name": {"type": "text", "index": 7, "name": "event_name", "comment": null}, "ip": {"type": "integer", "index": 8, "name": "ip", "comment": null}, "message_bus_id": {"type": "integer", "index": 9, "name": "message_bus_id", "comment": null}, "message_type_id": {"type": "integer", "index": 10, "name": "message_type_id", "comment": null}, "recipient_state": {"type": "integer", "index": 11, "name": "recipient_state", "comment": null}, "status": {"type": "integer", "index": 12, "name": "status", "comment": null}, "unsub_source": {"type": "integer", "index": 13, "name": "unsub_source", "comment": null}, "user_agent": {"type": "integer", "index": 14, "name": "user_agent", "comment": null}, "user_agent_device": {"type": "integer", "index": 15, "name": "user_agent_device", "comment": null}, "transactional_data": {"type": "character varying(100)", "index": 16, "name": "transactional_data", "comment": null}, "additional_properties": {"type": "text", "index": 17, "name": "additional_properties", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 18, "name": "_fivetran_synced", "comment": null}, "_fivetran_user_id": {"type": "integer", "index": 19, "name": "_fivetran_user_id", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.stg_iterable__event_tmp"}, "model.iterable.stg_iterable__journey": {"metadata": {"type": "BASE TABLE", "schema": "public_iterable_dev", "name": "stg_iterable__journey", "database": "postgres", "comment": "Table containing unique journeys, formerly known as workflows.", "owner": "postgres"}, "columns": {"source_relation": {"type": "text", "index": 1, "name": "source_relation", "comment": "Identifies the record's source."}, "journey_id": {"type": "text", "index": 2, "name": "journey_id", "comment": "Unique identifier of the journey"}, "journey_name": {"type": "text", "index": 3, "name": "journey_name", "comment": "User defined name of the journey"}, "journey_type": {"type": "text", "index": 4, "name": "journey_type", "comment": "Whether the journey is published or a draft"}, "journey_description": {"type": "text", "index": 5, "name": "journey_description", "comment": "Information about the journey"}, "creator_user_id": {"type": "text", "index": 6, "name": "creator_user_id", "comment": "Reference to the user who created the journey"}, "is_enabled": {"type": "boolean", "index": 7, "name": "is_enabled", "comment": "Boolean indicating if the journey is currently enabled"}, "is_archived": {"type": "boolean", "index": 8, "name": "is_archived", "comment": "Boolean indicating if the journey has been archived"}, "lifetime_limit": {"type": "bigint", "index": 9, "name": "lifetime_limit", "comment": "Maximum number of times a user may enter the journey over their lifetime"}, "simultaneous_limit": {"type": "bigint", "index": 10, "name": "simultaneous_limit", "comment": "Maximum number of times a user may be in the journey at the same time"}, "start_tile_id": {"type": "text", "index": 11, "name": "start_tile_id", "comment": "Reference to the tile which begins the journey"}, "trigger_event_names": {"type": "text", "index": 12, "name": "trigger_event_names", "comment": "The event names which trigger a user's entry into the journey"}, "created_at": {"type": "timestamp without time zone", "index": 13, "name": "created_at", "comment": "Creation timestamp"}, "updated_at": {"type": "timestamp without time zone", "index": 14, "name": "updated_at", "comment": "Last update timestamp"}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 15, "name": "_fivetran_synced", "comment": "The time when a record was last updated by Fivetran."}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.stg_iterable__journey"}, "model.iterable.stg_iterable__journey_tmp": {"metadata": {"type": "VIEW", "schema": "public_iterable_dev", "name": "stg_iterable__journey_tmp", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"id": {"type": "bigint", "index": 1, "name": "id", "comment": null}, "name": {"type": "text", "index": 2, "name": "name", "comment": null}, "journey_type": {"type": "text", "index": 3, "name": "journey_type", "comment": null}, "description": {"type": "text", "index": 4, "name": "description", "comment": null}, "creator_user_id": {"type": "text", "index": 5, "name": "creator_user_id", "comment": null}, "enabled": {"type": "boolean", "index": 6, "name": "enabled", "comment": null}, "is_archived": {"type": "boolean", "index": 7, "name": "is_archived", "comment": null}, "lifetime_limit": {"type": "bigint", "index": 8, "name": "lifetime_limit", "comment": null}, "simultaneous_limit": {"type": "bigint", "index": 9, "name": "simultaneous_limit", "comment": null}, "start_tile_id": {"type": "bigint", "index": 10, "name": "start_tile_id", "comment": null}, "trigger_event_names": {"type": "text", "index": 11, "name": "trigger_event_names", "comment": null}, "created_at": {"type": "timestamp without time zone", "index": 12, "name": "created_at", "comment": null}, "updated_at": {"type": "timestamp without time zone", "index": 13, "name": "updated_at", "comment": null}, "_fivetran_deleted": {"type": "boolean", "index": 14, "name": "_fivetran_deleted", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 15, "name": "_fivetran_synced", "comment": null}, "draft_name": {"type": "text", "index": 16, "name": "draft_name", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.stg_iterable__journey_tmp"}, "model.iterable.stg_iterable__list": {"metadata": {"type": "BASE TABLE", "schema": "public_iterable_dev", "name": "stg_iterable__list", "database": "postgres", "comment": "Table containing users and the lists the users are associated with.", "owner": "postgres"}, "columns": {"source_relation": {"type": "text", "index": 1, "name": "source_relation", "comment": "Identifies the record's source."}, "list_id": {"type": "integer", "index": 2, "name": "list_id", "comment": "Unique identifier of the list"}, "list_name": {"type": "text", "index": 3, "name": "list_name", "comment": "User defined name of the list"}, "list_type": {"type": "text", "index": 4, "name": "list_type", "comment": "The list type"}, "created_at": {"type": "text", "index": 5, "name": "created_at", "comment": "Creation timestamp"}, "list_description": {"type": "text", "index": 6, "name": "list_description", "comment": "Information about the list"}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 7, "name": "_fivetran_synced", "comment": "The time when a record was last updated by Fivetran."}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.stg_iterable__list"}, "model.iterable.stg_iterable__list_tmp": {"metadata": {"type": "VIEW", "schema": "public_iterable_dev", "name": "stg_iterable__list_tmp", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"id": {"type": "integer", "index": 1, "name": "id", "comment": null}, "name": {"type": "text", "index": 2, "name": "name", "comment": null}, "created_at": {"type": "text", "index": 3, "name": "created_at", "comment": null}, "list_type": {"type": "text", "index": 4, "name": "list_type", "comment": null}, "_fivetran_deleted": {"type": "boolean", "index": 5, "name": "_fivetran_deleted", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 6, "name": "_fivetran_synced", "comment": null}, "description": {"type": "text", "index": 7, "name": "description", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.stg_iterable__list_tmp"}, "model.iterable.stg_iterable__list_user": {"metadata": {"type": "BASE TABLE", "schema": "public_iterable_dev", "name": "stg_iterable__list_user", "database": "postgres", "comment": "Table containing the relationship between users and lists they belong to.", "owner": "postgres"}, "columns": {"source_relation": {"type": "text", "index": 1, "name": "source_relation", "comment": "Identifies the record's source."}, "_fivetran_user_id": {"type": "text", "index": 2, "name": "_fivetran_user_id", "comment": "Unique identifier of the list-user relationship record, serving as a foreign key to `stg_iterable__user_history._fivetran_id`."}, "list_user_index": {"type": "bigint", "index": 3, "name": "list_user_index", "comment": "Index of the record"}, "list_id": {"type": "bigint", "index": 4, "name": "list_id", "comment": "Reference to the list that the user belongs to"}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 5, "name": "_fivetran_synced", "comment": "The time when a record was last updated by Fivetran."}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.stg_iterable__list_user"}, "model.iterable.stg_iterable__list_user_tmp": {"metadata": {"type": "VIEW", "schema": "public_iterable_dev", "name": "stg_iterable__list_user_tmp", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"_fivetran_id": {"type": "text", "index": 1, "name": "_fivetran_id", "comment": null}, "index": {"type": "bigint", "index": 2, "name": "index", "comment": null}, "list_id": {"type": "bigint", "index": 3, "name": "list_id", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 4, "name": "_fivetran_synced", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.stg_iterable__list_user_tmp"}, "model.iterable.stg_iterable__message_type": {"metadata": {"type": "BASE TABLE", "schema": "public_iterable_dev", "name": "stg_iterable__message_type", "database": "postgres", "comment": "Table containing unique message types.", "owner": "postgres"}, "columns": {"source_relation": {"type": "text", "index": 1, "name": "source_relation", "comment": "Identifies the record's source."}, "message_type_id": {"type": "text", "index": 2, "name": "message_type_id", "comment": "Unique identifier of the message type"}, "message_type_name": {"type": "text", "index": 3, "name": "message_type_name", "comment": "User defined name of the message type"}, "channel_id": {"type": "text", "index": 4, "name": "channel_id", "comment": "Channel that this message type belongs to"}, "message_type_created_at": {"type": "timestamp without time zone", "index": 5, "name": "message_type_created_at", "comment": "Time when the message type was initially created"}, "frequency_cap": {"type": "integer", "index": 6, "name": "frequency_cap", "comment": "The maximum number of times a message of this type can be sent to a recipient within a specified time period to prevent over-messaging"}, "rate_limit_per_minute": {"type": "integer", "index": 7, "name": "rate_limit_per_minute", "comment": "The maximum number of messages of this type that can be sent to recipients in a minute, ensuring controlled message delivery"}, "subscription_policy": {"type": "text", "index": 8, "name": "subscription_policy", "comment": "Information about the policy or rules governing how users can subscribe to or unsubscribe from this specific message type, like OptOut"}, "message_type_updated_at": {"type": "timestamp without time zone", "index": 9, "name": "message_type_updated_at", "comment": "Time when the message type was last updated or modified"}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 10, "name": "_fivetran_synced", "comment": "The time when a record was last updated by Fivetran."}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.stg_iterable__message_type"}, "model.iterable.stg_iterable__message_type_tmp": {"metadata": {"type": "VIEW", "schema": "public_iterable_dev", "name": "stg_iterable__message_type_tmp", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"id": {"type": "bigint", "index": 1, "name": "id", "comment": null}, "name": {"type": "text", "index": 2, "name": "name", "comment": null}, "channel_id": {"type": "bigint", "index": 3, "name": "channel_id", "comment": null}, "_fivetran_deleted": {"type": "boolean", "index": 4, "name": "_fivetran_deleted", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 5, "name": "_fivetran_synced", "comment": null}, "created_at": {"type": "timestamp without time zone", "index": 6, "name": "created_at", "comment": null}, "frequency_cap": {"type": "integer", "index": 7, "name": "frequency_cap", "comment": null}, "rate_limit_per_minute": {"type": "integer", "index": 8, "name": "rate_limit_per_minute", "comment": null}, "subscription_policy": {"type": "text", "index": 9, "name": "subscription_policy", "comment": null}, "updated_at": {"type": "timestamp without time zone", "index": 10, "name": "updated_at", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.stg_iterable__message_type_tmp"}, "model.iterable.stg_iterable__template_history": {"metadata": {"type": "BASE TABLE", "schema": "public_iterable_dev", "name": "stg_iterable__template_history", "database": "postgres", "comment": "Table containing unique templates used across campaigns.", "owner": "postgres"}, "columns": {"source_relation": {"type": "text", "index": 1, "name": "source_relation", "comment": "Identifies the record's source."}, "template_id": {"type": "text", "index": 2, "name": "template_id", "comment": "Unique identifier of the template"}, "template_name": {"type": "text", "index": 3, "name": "template_name", "comment": "User defined name of the template"}, "template_type": {"type": "text", "index": 4, "name": "template_type", "comment": "The type of the template"}, "created_at": {"type": "text", "index": 5, "name": "created_at", "comment": "Creation timestamp"}, "client_template_id": {"type": "text", "index": 6, "name": "client_template_id", "comment": "Reference to the client template"}, "creator_user_id": {"type": "text", "index": 7, "name": "creator_user_id", "comment": "Reference to the user who created the template"}, "message_type_id": {"type": "text", "index": 8, "name": "message_type_id", "comment": "Reference to the message type associated with the template"}, "updated_at": {"type": "text", "index": 9, "name": "updated_at", "comment": "Last update timestamp"}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 10, "name": "_fivetran_synced", "comment": "The time when a record was last updated by Fivetran."}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.stg_iterable__template_history"}, "model.iterable.stg_iterable__template_history_tmp": {"metadata": {"type": "VIEW", "schema": "public_iterable_dev", "name": "stg_iterable__template_history_tmp", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"id": {"type": "integer", "index": 1, "name": "id", "comment": null}, "updated_at": {"type": "text", "index": 2, "name": "updated_at", "comment": null}, "message_type_id": {"type": "integer", "index": 3, "name": "message_type_id", "comment": null}, "client_template_id": {"type": "integer", "index": 4, "name": "client_template_id", "comment": null}, "created_at": {"type": "text", "index": 5, "name": "created_at", "comment": null}, "creator_user_id": {"type": "text", "index": 6, "name": "creator_user_id", "comment": null}, "name": {"type": "text", "index": 7, "name": "name", "comment": null}, "template_type": {"type": "text", "index": 8, "name": "template_type", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 9, "name": "_fivetran_synced", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.stg_iterable__template_history_tmp"}, "model.iterable.stg_iterable__user_history": {"metadata": {"type": "VIEW", "schema": "public_iterable_dev", "name": "stg_iterable__user_history", "database": "postgres", "comment": "Table containing individual user history information.", "owner": "postgres"}, "columns": {"source_relation": {"type": "text", "index": 1, "name": "source_relation", "comment": "Identifies the record's source."}, "_fivetran_user_id": {"type": "text", "index": 2, "name": "_fivetran_user_id", "comment": "A Fivetran-created unique identifier for users, derived from hashing user_id and/or email, depending on project type. This exists for users of the new schema starting Aug 2023. In the old schema, the unique identifier is email."}, "email": {"type": "text", "index": 3, "name": "email", "comment": "The user's email. User identifier, for email-based projects. Previously was the unique identifier for user records, for the old Iterable schema before the August 2023 updates."}, "updated_at": {"type": "timestamp without time zone", "index": 4, "name": "updated_at", "comment": "Last update timestamp"}, "user_id": {"type": "text", "index": 5, "name": "user_id", "comment": "User identifier, for userID-based projects."}, "first_name": {"type": "integer", "index": 6, "name": "first_name", "comment": "First name of the user"}, "last_name": {"type": "integer", "index": 7, "name": "last_name", "comment": "Last name of the user"}, "email_list_ids": {"type": "text", "index": 8, "name": "email_list_ids", "comment": "[DEPRECATED October 13, 2025. Use LIST_USER source instead.] Array of references to the lists associated with the user.\n"}, "phone_number": {"type": "integer", "index": 9, "name": "phone_number", "comment": "Phone number associated with the user"}, "signup_date": {"type": "text", "index": 10, "name": "signup_date", "comment": "Timestamp of when the user signed up"}, "signup_source": {"type": "text", "index": 11, "name": "signup_source", "comment": "Source where the user signed up"}, "iterable_user_id": {"type": "text", "index": 12, "name": "iterable_user_id", "comment": "Another user identifier, for userID-based projects"}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 13, "name": "_fivetran_synced", "comment": "The time when a record was last updated by Fivetran."}, "unique_user_key": {"type": "text", "index": 14, "name": "unique_user_key", "comment": "The unique identifier of the user. With the new schema (Aug 2023), it is the _fivetran_user_id. This is a hash of user_id and/or email, depending on project type. If using the old schema, it is email."}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.stg_iterable__user_history"}, "model.iterable.stg_iterable__user_history_tmp": {"metadata": {"type": "VIEW", "schema": "public_iterable_dev", "name": "stg_iterable__user_history_tmp", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"email": {"type": "text", "index": 1, "name": "email", "comment": null}, "updated_at": {"type": "timestamp without time zone", "index": 2, "name": "updated_at", "comment": null}, "first_name": {"type": "integer", "index": 3, "name": "first_name", "comment": null}, "last_name": {"type": "integer", "index": 4, "name": "last_name", "comment": null}, "phone_number": {"type": "integer", "index": 5, "name": "phone_number", "comment": null}, "user_id": {"type": "integer", "index": 6, "name": "user_id", "comment": null}, "signup_date": {"type": "text", "index": 7, "name": "signup_date", "comment": null}, "signup_source": {"type": "text", "index": 8, "name": "signup_source", "comment": null}, "phone_number_carrier": {"type": "integer", "index": 9, "name": "phone_number_carrier", "comment": null}, "phone_number_country_code_iso": {"type": "integer", "index": 10, "name": "phone_number_country_code_iso", "comment": null}, "phone_number_line_type": {"type": "integer", "index": 11, "name": "phone_number_line_type", "comment": null}, "phone_number_updated_at": {"type": "integer", "index": 12, "name": "phone_number_updated_at", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 13, "name": "_fivetran_synced", "comment": null}, "email_list_ids": {"type": "text", "index": 14, "name": "email_list_ids", "comment": null}, "iterable_user_id": {"type": "integer", "index": 15, "name": "iterable_user_id", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.stg_iterable__user_history_tmp"}, "model.iterable.stg_iterable__user_unsub_message_type": {"metadata": {"type": "BASE TABLE", "schema": "public_iterable_dev", "name": "stg_iterable__user_unsub_message_type", "database": "postgres", "comment": "Table containing the message types from which a user has unsubscribed. \"Unsubscribed\" is shortened to \"unsub\" for postgres compatibility.", "owner": "postgres"}, "columns": {"source_relation": {"type": "text", "index": 1, "name": "source_relation", "comment": "Identifies the record's source."}, "_fivetran_user_id": {"type": "text", "index": 2, "name": "_fivetran_user_id", "comment": "A Fivetran-created unique identifier for users, derived from hashing user_id and/or email, depending on project type. This exists for users of the new schema starting Aug 2023. In the old schema, the unique identifier is email."}, "unique_user_key": {"type": "text", "index": 3, "name": "unique_user_key", "comment": "The unique identifier of the user. With the new schema (Aug 2023), it is the _fivetran_user_id. This is a hash of user_id and/or email, depending on project type. If using the old schema, it is email."}, "message_type_id": {"type": "text", "index": 4, "name": "message_type_id", "comment": "Reference to the message type from which the user unsubscribed"}, "unsub_message_type_unique_key": {"type": "text", "index": 5, "name": "unsub_message_type_unique_key", "comment": "A surrogate key providing a unique key for each record. If using user_unsubscribed_message_type_history, it uses '_fivetran_id', 'email', 'message_type_id', 'updated_at', and 'source_relation'. If not using the history table, it uses '_fivetran_id', 'message_type_id', and 'source_relation'."}, "latest_batch_index": {"type": "integer", "index": 6, "name": "latest_batch_index", "comment": "Indexes each user record based on the most recent available."}, "updated_at": {"type": "timestamp without time zone", "index": 7, "name": "updated_at", "comment": "Last update timestamp"}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 8, "name": "_fivetran_synced", "comment": "The time when a record was last updated by Fivetran."}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.stg_iterable__user_unsub_message_type"}, "model.iterable.stg_iterable__user_unsub_message_type_tmp": {"metadata": {"type": "VIEW", "schema": "public_iterable_dev", "name": "stg_iterable__user_unsub_message_type_tmp", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"_fivetran_id": {"type": "text", "index": 1, "name": "_fivetran_id", "comment": null}, "message_type_id": {"type": "integer", "index": 2, "name": "message_type_id", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 3, "name": "_fivetran_synced", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.stg_iterable__user_unsub_message_type_tmp"}, "model.iterable.stg_iterable__user_unsubscribed_channel": {"metadata": {"type": "BASE TABLE", "schema": "public_iterable_dev", "name": "stg_iterable__user_unsubscribed_channel", "database": "postgres", "comment": "Table containing the history of channels from which a user has unsubscribed.", "owner": "postgres"}, "columns": {"source_relation": {"type": "text", "index": 1, "name": "source_relation", "comment": "Identifies the record's source."}, "_fivetran_user_id": {"type": "text", "index": 2, "name": "_fivetran_user_id", "comment": "A Fivetran-created unique identifier for users, derived from hashing user_id and/or email, depending on project type. This exists for users of the new schema starting Aug 2023. In the old schema, the unique identifier is email."}, "unique_user_key": {"type": "text", "index": 3, "name": "unique_user_key", "comment": "The unique identifier of the user. With the new schema (Aug 2023), it is the _fivetran_user_id. This is a hash of user_id and/or email, depending on project type. If using the old schema, it is email."}, "channel_id": {"type": "text", "index": 4, "name": "channel_id", "comment": "Reference to the channel from which the user unsubscribed"}, "unsub_channel_unique_key": {"type": "text", "index": 5, "name": "unsub_channel_unique_key", "comment": "A surrogate key providing a unique key for each record. If using user_unsubscribed_channel_history, it uses '_fivetran_id', 'channel_id', 'email', 'updated_at', and 'source_relation'. If not using the history table, it uses '_fivetran_id', 'channel_id', and 'source_relation'."}, "latest_batch_index": {"type": "integer", "index": 6, "name": "latest_batch_index", "comment": "Indexes each user record based on the most recent available."}, "updated_at": {"type": "timestamp without time zone", "index": 7, "name": "updated_at", "comment": "Last update timestamp"}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 8, "name": "_fivetran_synced", "comment": "The time when a record was last updated by Fivetran."}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.stg_iterable__user_unsubscribed_channel"}, "model.iterable.stg_iterable__user_unsubscribed_channel_tmp": {"metadata": {"type": "VIEW", "schema": "public_iterable_dev", "name": "stg_iterable__user_unsubscribed_channel_tmp", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"_fivetran_id": {"type": "text", "index": 1, "name": "_fivetran_id", "comment": null}, "channel_id": {"type": "integer", "index": 2, "name": "channel_id", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 3, "name": "_fivetran_synced", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.stg_iterable__user_unsubscribed_channel_tmp"}}, "sources": {"source.iterable.iterable.campaign_history": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "campaign_history_data", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"id": {"type": "integer", "index": 1, "name": "id", "comment": null}, "updated_at": {"type": "text", "index": 2, "name": "updated_at", "comment": null}, "template_id": {"type": "integer", "index": 3, "name": "template_id", "comment": null}, "recurring_campaign_id": {"type": "integer", "index": 4, "name": "recurring_campaign_id", "comment": null}, "campaign_state": {"type": "text", "index": 5, "name": "campaign_state", "comment": null}, "created_at": {"type": "text", "index": 6, "name": "created_at", "comment": null}, "created_by_user_id": {"type": "text", "index": 7, "name": "created_by_user_id", "comment": null}, "ended_at": {"type": "integer", "index": 8, "name": "ended_at", "comment": null}, "name": {"type": "text", "index": 9, "name": "name", "comment": null}, "send_size": {"type": "integer", "index": 10, "name": "send_size", "comment": null}, "start_at": {"type": "integer", "index": 11, "name": "start_at", "comment": null}, "type": {"type": "text", "index": 12, "name": "type", "comment": null}, "workflow_id": {"type": "integer", "index": 13, "name": "workflow_id", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 14, "name": "_fivetran_synced", "comment": null}, "updated_by_user_id": {"type": "integer", "index": 15, "name": "updated_by_user_id", "comment": null}, "message_medium": {"type": "text", "index": 16, "name": "message_medium", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.iterable.iterable.campaign_history"}, "source.iterable.iterable.campaign_label_history": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "campaign_label_history_data", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"campaign_id": {"type": "integer", "index": 1, "name": "campaign_id", "comment": null}, "label": {"type": "text", "index": 2, "name": "label", "comment": null}, "updated_at": {"type": "text", "index": 3, "name": "updated_at", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 4, "name": "_fivetran_synced", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.iterable.iterable.campaign_label_history"}, "source.iterable.iterable.campaign_list_history": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "campaign_list_history_data", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"list_id": {"type": "integer", "index": 1, "name": "list_id", "comment": null}, "campaign_id": {"type": "integer", "index": 2, "name": "campaign_id", "comment": null}, "updated_at": {"type": "text", "index": 3, "name": "updated_at", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 4, "name": "_fivetran_synced", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.iterable.iterable.campaign_list_history"}, "source.iterable.iterable.campaign_suppression_list_history": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "campaign_suppression_list_history_data", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"suppressed_list_id": {"type": "integer", "index": 1, "name": "suppressed_list_id", "comment": null}, "campaign_id": {"type": "integer", "index": 2, "name": "campaign_id", "comment": null}, "updated_at": {"type": "text", "index": 3, "name": "updated_at", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 4, "name": "_fivetran_synced", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.iterable.iterable.campaign_suppression_list_history"}, "source.iterable.iterable.channel": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "channel_data", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"id": {"type": "bigint", "index": 1, "name": "id", "comment": null}, "name": {"type": "text", "index": 2, "name": "name", "comment": null}, "channel_type": {"type": "text", "index": 3, "name": "channel_type", "comment": null}, "message_medium": {"type": "text", "index": 4, "name": "message_medium", "comment": null}, "_fivetran_deleted": {"type": "boolean", "index": 5, "name": "_fivetran_deleted", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 6, "name": "_fivetran_synced", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.iterable.iterable.channel"}, "source.iterable.iterable.event": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "event_data", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"_fivetran_id": {"type": "text", "index": 1, "name": "_fivetran_id", "comment": null}, "email": {"type": "text", "index": 2, "name": "email", "comment": null}, "campaign_id": {"type": "integer", "index": 3, "name": "campaign_id", "comment": null}, "message_id": {"type": "integer", "index": 4, "name": "message_id", "comment": null}, "content_id": {"type": "integer", "index": 5, "name": "content_id", "comment": null}, "created_at": {"type": "timestamp without time zone", "index": 6, "name": "created_at", "comment": null}, "event_name": {"type": "text", "index": 7, "name": "event_name", "comment": null}, "ip": {"type": "integer", "index": 8, "name": "ip", "comment": null}, "message_bus_id": {"type": "integer", "index": 9, "name": "message_bus_id", "comment": null}, "message_type_id": {"type": "integer", "index": 10, "name": "message_type_id", "comment": null}, "recipient_state": {"type": "integer", "index": 11, "name": "recipient_state", "comment": null}, "status": {"type": "integer", "index": 12, "name": "status", "comment": null}, "unsub_source": {"type": "integer", "index": 13, "name": "unsub_source", "comment": null}, "user_agent": {"type": "integer", "index": 14, "name": "user_agent", "comment": null}, "user_agent_device": {"type": "integer", "index": 15, "name": "user_agent_device", "comment": null}, "transactional_data": {"type": "character varying(100)", "index": 16, "name": "transactional_data", "comment": null}, "additional_properties": {"type": "text", "index": 17, "name": "additional_properties", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 18, "name": "_fivetran_synced", "comment": null}, "_fivetran_user_id": {"type": "integer", "index": 19, "name": "_fivetran_user_id", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.iterable.iterable.event"}, "source.iterable.iterable.event_extension": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "event_extension_data", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"_fivetran_id": {"type": "text", "index": 1, "name": "_fivetran_id", "comment": null}, "app_already_running": {"type": "integer", "index": 2, "name": "app_already_running", "comment": null}, "badge": {"type": "integer", "index": 3, "name": "badge", "comment": null}, "canonical_url_id": {"type": "integer", "index": 4, "name": "canonical_url_id", "comment": null}, "content_available": {"type": "integer", "index": 5, "name": "content_available", "comment": null}, "content_id": {"type": "integer", "index": 6, "name": "content_id", "comment": null}, "device": {"type": "integer", "index": 7, "name": "device", "comment": null}, "email_id": {"type": "text", "index": 8, "name": "email_id", "comment": null}, "email_subject": {"type": "text", "index": 9, "name": "email_subject", "comment": null}, "experiment_id": {"type": "integer", "index": 10, "name": "experiment_id", "comment": null}, "from_phone_number_id": {"type": "integer", "index": 11, "name": "from_phone_number_id", "comment": null}, "from_smssender_id": {"type": "integer", "index": 12, "name": "from_smssender_id", "comment": null}, "image_url": {"type": "integer", "index": 13, "name": "image_url", "comment": null}, "is_ghost_push": {"type": "integer", "index": 14, "name": "is_ghost_push", "comment": null}, "link_id": {"type": "integer", "index": 15, "name": "link_id", "comment": null}, "link_url": {"type": "integer", "index": 16, "name": "link_url", "comment": null}, "platform_endpoint": {"type": "integer", "index": 17, "name": "platform_endpoint", "comment": null}, "push_message": {"type": "integer", "index": 18, "name": "push_message", "comment": null}, "region": {"type": "text", "index": 19, "name": "region", "comment": null}, "sms_message": {"type": "integer", "index": 20, "name": "sms_message", "comment": null}, "sound": {"type": "integer", "index": 21, "name": "sound", "comment": null}, "to_phone_number": {"type": "integer", "index": 22, "name": "to_phone_number", "comment": null}, "url": {"type": "integer", "index": 23, "name": "url", "comment": null}, "workflow_id": {"type": "integer", "index": 24, "name": "workflow_id", "comment": null}, "workflow_name": {"type": "text", "index": 25, "name": "workflow_name", "comment": null}, "locale": {"type": "integer", "index": 26, "name": "locale", "comment": null}, "deeplink_android": {"type": "integer", "index": 27, "name": "deeplink_android", "comment": null}, "deeplink_ios": {"type": "integer", "index": 28, "name": "deeplink_ios", "comment": null}, "payload": {"type": "character varying(100)", "index": 29, "name": "payload", "comment": null}, "sms_provider_response_status": {"type": "integer", "index": 30, "name": "sms_provider_response_status", "comment": null}, "sms_provider_response_message": {"type": "integer", "index": 31, "name": "sms_provider_response_message", "comment": null}, "sms_provider_response_code": {"type": "integer", "index": 32, "name": "sms_provider_response_code", "comment": null}, "sms_provider_response_more_info": {"type": "integer", "index": 33, "name": "sms_provider_response_more_info", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 34, "name": "_fivetran_synced", "comment": null}, "catalog_collection_count": {"type": "integer", "index": 35, "name": "catalog_collection_count", "comment": null}, "catalog_lookup_count": {"type": "integer", "index": 36, "name": "catalog_lookup_count", "comment": null}, "city": {"type": "text", "index": 37, "name": "city", "comment": null}, "clicked_url": {"type": "text", "index": 38, "name": "clicked_url", "comment": null}, "country": {"type": "text", "index": 39, "name": "country", "comment": null}, "error_code": {"type": "integer", "index": 40, "name": "error_code", "comment": null}, "expires_at": {"type": "text", "index": 41, "name": "expires_at", "comment": null}, "from_phone_number": {"type": "integer", "index": 42, "name": "from_phone_number", "comment": null}, "in_app_body": {"type": "text", "index": 43, "name": "in_app_body", "comment": null}, "is_sms_estimation": {"type": "boolean", "index": 44, "name": "is_sms_estimation", "comment": null}, "labels": {"type": "text", "index": 45, "name": "labels", "comment": null}, "message_context": {"type": "text", "index": 46, "name": "message_context", "comment": null}, "message_status": {"type": "text", "index": 47, "name": "message_status", "comment": null}, "mms_send_count": {"type": "integer", "index": 48, "name": "mms_send_count", "comment": null}, "product_recommendation_count": {"type": "integer", "index": 49, "name": "product_recommendation_count", "comment": null}, "proxy_source": {"type": "text", "index": 50, "name": "proxy_source", "comment": null}, "reason": {"type": "text", "index": 51, "name": "reason", "comment": null}, "sms_send_count": {"type": "integer", "index": 52, "name": "sms_send_count", "comment": null}, "web_push_body": {"type": "text", "index": 53, "name": "web_push_body", "comment": null}, "web_push_click_action": {"type": "text", "index": 54, "name": "web_push_click_action", "comment": null}, "web_push_icon": {"type": "text", "index": 55, "name": "web_push_icon", "comment": null}, "web_push_message": {"type": "text", "index": 56, "name": "web_push_message", "comment": null}, "_fivetran_user_id": {"type": "integer", "index": 57, "name": "_fivetran_user_id", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.iterable.iterable.event_extension"}, "source.iterable.iterable.journey": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "journey_data", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"id": {"type": "bigint", "index": 1, "name": "id", "comment": null}, "name": {"type": "text", "index": 2, "name": "name", "comment": null}, "journey_type": {"type": "text", "index": 3, "name": "journey_type", "comment": null}, "description": {"type": "text", "index": 4, "name": "description", "comment": null}, "creator_user_id": {"type": "text", "index": 5, "name": "creator_user_id", "comment": null}, "enabled": {"type": "boolean", "index": 6, "name": "enabled", "comment": null}, "is_archived": {"type": "boolean", "index": 7, "name": "is_archived", "comment": null}, "lifetime_limit": {"type": "bigint", "index": 8, "name": "lifetime_limit", "comment": null}, "simultaneous_limit": {"type": "bigint", "index": 9, "name": "simultaneous_limit", "comment": null}, "start_tile_id": {"type": "bigint", "index": 10, "name": "start_tile_id", "comment": null}, "trigger_event_names": {"type": "text", "index": 11, "name": "trigger_event_names", "comment": null}, "created_at": {"type": "timestamp without time zone", "index": 12, "name": "created_at", "comment": null}, "updated_at": {"type": "timestamp without time zone", "index": 13, "name": "updated_at", "comment": null}, "_fivetran_deleted": {"type": "boolean", "index": 14, "name": "_fivetran_deleted", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 15, "name": "_fivetran_synced", "comment": null}, "draft_name": {"type": "text", "index": 16, "name": "draft_name", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.iterable.iterable.journey"}, "source.iterable.iterable.list": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "list_data", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"id": {"type": "integer", "index": 1, "name": "id", "comment": null}, "name": {"type": "text", "index": 2, "name": "name", "comment": null}, "created_at": {"type": "text", "index": 3, "name": "created_at", "comment": null}, "list_type": {"type": "text", "index": 4, "name": "list_type", "comment": null}, "_fivetran_deleted": {"type": "boolean", "index": 5, "name": "_fivetran_deleted", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 6, "name": "_fivetran_synced", "comment": null}, "description": {"type": "text", "index": 7, "name": "description", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.iterable.iterable.list"}, "source.iterable.iterable.list_user": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "list_user_data", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"_fivetran_id": {"type": "text", "index": 1, "name": "_fivetran_id", "comment": null}, "index": {"type": "bigint", "index": 2, "name": "index", "comment": null}, "list_id": {"type": "bigint", "index": 3, "name": "list_id", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 4, "name": "_fivetran_synced", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.iterable.iterable.list_user"}, "source.iterable.iterable.message_type": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "message_type_data", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"id": {"type": "bigint", "index": 1, "name": "id", "comment": null}, "name": {"type": "text", "index": 2, "name": "name", "comment": null}, "channel_id": {"type": "bigint", "index": 3, "name": "channel_id", "comment": null}, "_fivetran_deleted": {"type": "boolean", "index": 4, "name": "_fivetran_deleted", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 5, "name": "_fivetran_synced", "comment": null}, "created_at": {"type": "timestamp without time zone", "index": 6, "name": "created_at", "comment": null}, "frequency_cap": {"type": "integer", "index": 7, "name": "frequency_cap", "comment": null}, "rate_limit_per_minute": {"type": "integer", "index": 8, "name": "rate_limit_per_minute", "comment": null}, "subscription_policy": {"type": "text", "index": 9, "name": "subscription_policy", "comment": null}, "updated_at": {"type": "timestamp without time zone", "index": 10, "name": "updated_at", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.iterable.iterable.message_type"}, "source.iterable.iterable.template_history": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "template_history_data", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"id": {"type": "integer", "index": 1, "name": "id", "comment": null}, "updated_at": {"type": "text", "index": 2, "name": "updated_at", "comment": null}, "message_type_id": {"type": "integer", "index": 3, "name": "message_type_id", "comment": null}, "client_template_id": {"type": "integer", "index": 4, "name": "client_template_id", "comment": null}, "created_at": {"type": "text", "index": 5, "name": "created_at", "comment": null}, "creator_user_id": {"type": "text", "index": 6, "name": "creator_user_id", "comment": null}, "name": {"type": "text", "index": 7, "name": "name", "comment": null}, "template_type": {"type": "text", "index": 8, "name": "template_type", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 9, "name": "_fivetran_synced", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.iterable.iterable.template_history"}, "source.iterable.iterable.user_history": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "user_history_data", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"email": {"type": "text", "index": 1, "name": "email", "comment": null}, "updated_at": {"type": "timestamp without time zone", "index": 2, "name": "updated_at", "comment": null}, "first_name": {"type": "integer", "index": 3, "name": "first_name", "comment": null}, "last_name": {"type": "integer", "index": 4, "name": "last_name", "comment": null}, "phone_number": {"type": "integer", "index": 5, "name": "phone_number", "comment": null}, "user_id": {"type": "integer", "index": 6, "name": "user_id", "comment": null}, "signup_date": {"type": "text", "index": 7, "name": "signup_date", "comment": null}, "signup_source": {"type": "text", "index": 8, "name": "signup_source", "comment": null}, "phone_number_carrier": {"type": "integer", "index": 9, "name": "phone_number_carrier", "comment": null}, "phone_number_country_code_iso": {"type": "integer", "index": 10, "name": "phone_number_country_code_iso", "comment": null}, "phone_number_line_type": {"type": "integer", "index": 11, "name": "phone_number_line_type", "comment": null}, "phone_number_updated_at": {"type": "integer", "index": 12, "name": "phone_number_updated_at", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 13, "name": "_fivetran_synced", "comment": null}, "email_list_ids": {"type": "text", "index": 14, "name": "email_list_ids", "comment": null}, "iterable_user_id": {"type": "integer", "index": 15, "name": "iterable_user_id", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.iterable.iterable.user_history"}, "source.iterable.iterable.user_unsubscribed_channel": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "user_unsubscribed_channel_data", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"_fivetran_id": {"type": "text", "index": 1, "name": "_fivetran_id", "comment": null}, "channel_id": {"type": "integer", "index": 2, "name": "channel_id", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 3, "name": "_fivetran_synced", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.iterable.iterable.user_unsubscribed_channel"}, "source.iterable.iterable.user_unsubscribed_channel_history": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "user_unsubscribed_channel_history_data", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"email": {"type": "text", "index": 1, "name": "email", "comment": null}, "channel_id": {"type": "bigint", "index": 2, "name": "channel_id", "comment": null}, "updated_at": {"type": "text", "index": 3, "name": "updated_at", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 4, "name": "_fivetran_synced", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.iterable.iterable.user_unsubscribed_channel_history"}, "source.iterable.iterable.user_unsubscribed_message_type": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "user_unsubscribed_message_type_data", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"_fivetran_id": {"type": "text", "index": 1, "name": "_fivetran_id", "comment": null}, "message_type_id": {"type": "integer", "index": 2, "name": "message_type_id", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 3, "name": "_fivetran_synced", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.iterable.iterable.user_unsubscribed_message_type"}, "source.iterable.iterable.user_unsubscribed_message_type_history": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "user_unsubscribed_message_type_history_data", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"message_type_id": {"type": "integer", "index": 1, "name": "message_type_id", "comment": null}, "email": {"type": "text", "index": 2, "name": "email", "comment": null}, "updated_at": {"type": "text", "index": 3, "name": "updated_at", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 4, "name": "_fivetran_synced", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.iterable.iterable.user_unsubscribed_message_type_history"}}, "errors": null} \ No newline at end of file +{"metadata": {"dbt_schema_version": "https://schemas.getdbt.com/dbt/catalog/v1.json", "dbt_version": "1.12.5", "generated_at": "2026-09-15T20:17:36.312172Z", "invocation_id": "f92eb9ec-397c-44a2-972d-f82fe2f43994", "invocation_started_at": "2026-09-15T20:17:32.997753Z", "env": {}}, "nodes": {"seed.iterable_integration_tests.campaign_history_data": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "campaign_history_data", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"id": {"type": "integer", "index": 1, "name": "id", "comment": null}, "updated_at": {"type": "text", "index": 2, "name": "updated_at", "comment": null}, "template_id": {"type": "integer", "index": 3, "name": "template_id", "comment": null}, "recurring_campaign_id": {"type": "integer", "index": 4, "name": "recurring_campaign_id", "comment": null}, "campaign_state": {"type": "text", "index": 5, "name": "campaign_state", "comment": null}, "created_at": {"type": "text", "index": 6, "name": "created_at", "comment": null}, "created_by_user_id": {"type": "text", "index": 7, "name": "created_by_user_id", "comment": null}, "ended_at": {"type": "integer", "index": 8, "name": "ended_at", "comment": null}, "name": {"type": "text", "index": 9, "name": "name", "comment": null}, "send_size": {"type": "integer", "index": 10, "name": "send_size", "comment": null}, "start_at": {"type": "integer", "index": 11, "name": "start_at", "comment": null}, "type": {"type": "text", "index": 12, "name": "type", "comment": null}, "workflow_id": {"type": "integer", "index": 13, "name": "workflow_id", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 14, "name": "_fivetran_synced", "comment": null}, "updated_by_user_id": {"type": "integer", "index": 15, "name": "updated_by_user_id", "comment": null}, "message_medium": {"type": "text", "index": 16, "name": "message_medium", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.iterable_integration_tests.campaign_history_data"}, "seed.iterable_integration_tests.campaign_label_history_data": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "campaign_label_history_data", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"campaign_id": {"type": "integer", "index": 1, "name": "campaign_id", "comment": null}, "label": {"type": "text", "index": 2, "name": "label", "comment": null}, "updated_at": {"type": "text", "index": 3, "name": "updated_at", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 4, "name": "_fivetran_synced", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.iterable_integration_tests.campaign_label_history_data"}, "seed.iterable_integration_tests.campaign_list_history_data": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "campaign_list_history_data", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"list_id": {"type": "integer", "index": 1, "name": "list_id", "comment": null}, "campaign_id": {"type": "integer", "index": 2, "name": "campaign_id", "comment": null}, "updated_at": {"type": "text", "index": 3, "name": "updated_at", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 4, "name": "_fivetran_synced", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.iterable_integration_tests.campaign_list_history_data"}, "seed.iterable_integration_tests.campaign_metrics_data": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "campaign_metrics_data", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"date": {"type": "date", "index": 1, "name": "date", "comment": null}, "id": {"type": "integer", "index": 2, "name": "id", "comment": null}, "_fivetran_deleted": {"type": "boolean", "index": 3, "name": "_fivetran_deleted", "comment": null}, "average_order_value": {"type": "integer", "index": 4, "name": "average_order_value", "comment": null}, "purchases": {"type": "integer", "index": 5, "name": "purchases", "comment": null}, "revenue": {"type": "integer", "index": 6, "name": "revenue", "comment": null}, "revenue_m": {"type": "integer", "index": 7, "name": "revenue_m", "comment": null}, "total_app_uninstalls": {"type": "integer", "index": 8, "name": "total_app_uninstalls", "comment": null}, "total_complaints": {"type": "integer", "index": 9, "name": "total_complaints", "comment": null}, "total_email_bounced": {"type": "integer", "index": 10, "name": "total_email_bounced", "comment": null}, "total_email_clicked": {"type": "integer", "index": 11, "name": "total_email_clicked", "comment": null}, "total_email_delivered": {"type": "integer", "index": 12, "name": "total_email_delivered", "comment": null}, "total_email_opens": {"type": "integer", "index": 13, "name": "total_email_opens", "comment": null}, "total_email_sends": {"type": "integer", "index": 14, "name": "total_email_sends", "comment": null}, "total_hosted_unsubscribe_clicks": {"type": "integer", "index": 15, "name": "total_hosted_unsubscribe_clicks", "comment": null}, "total_purchases": {"type": "integer", "index": 16, "name": "total_purchases", "comment": null}, "total_pushes_bounced": {"type": "integer", "index": 17, "name": "total_pushes_bounced", "comment": null}, "total_pushes_delivered": {"type": "integer", "index": 18, "name": "total_pushes_delivered", "comment": null}, "total_pushes_opened": {"type": "integer", "index": 19, "name": "total_pushes_opened", "comment": null}, "total_pushes_sent": {"type": "integer", "index": 20, "name": "total_pushes_sent", "comment": null}, "total_unsubscribes": {"type": "integer", "index": 21, "name": "total_unsubscribes", "comment": null}, "unique_email_bounced": {"type": "integer", "index": 22, "name": "unique_email_bounced", "comment": null}, "unique_email_clicks": {"type": "integer", "index": 23, "name": "unique_email_clicks", "comment": null}, "unique_email_opens_or_clicks": {"type": "integer", "index": 24, "name": "unique_email_opens_or_clicks", "comment": null}, "unique_hosted_unsubscribe_clicks": {"type": "integer", "index": 25, "name": "unique_hosted_unsubscribe_clicks", "comment": null}, "unique_purchases": {"type": "integer", "index": 26, "name": "unique_purchases", "comment": null}, "unique_pushes_bounced": {"type": "integer", "index": 27, "name": "unique_pushes_bounced", "comment": null}, "unique_pushes_opened": {"type": "integer", "index": 28, "name": "unique_pushes_opened", "comment": null}, "unique_pushes_sent": {"type": "integer", "index": 29, "name": "unique_pushes_sent", "comment": null}, "unique_unsubscribes": {"type": "integer", "index": 30, "name": "unique_unsubscribes", "comment": null}, "total_push_send_skips": {"type": "integer", "index": 31, "name": "total_push_send_skips", "comment": null}, "total_in_app_opens": {"type": "integer", "index": 32, "name": "total_in_app_opens", "comment": null}, "unique_in_apps_delivered": {"type": "integer", "index": 33, "name": "unique_in_apps_delivered", "comment": null}, "unique_in_app_sends": {"type": "integer", "index": 34, "name": "unique_in_app_sends", "comment": null}, "total_in_app_closes": {"type": "integer", "index": 35, "name": "total_in_app_closes", "comment": null}, "total_inbox_impressions": {"type": "integer", "index": 36, "name": "total_inbox_impressions", "comment": null}, "unique_pushes_delivered": {"type": "integer", "index": 37, "name": "unique_pushes_delivered", "comment": null}, "unique_in_app_clicks": {"type": "integer", "index": 38, "name": "unique_in_app_clicks", "comment": null}, "unique_emails_delivered": {"type": "integer", "index": 39, "name": "unique_emails_delivered", "comment": null}, "total_in_app_clicks": {"type": "integer", "index": 40, "name": "total_in_app_clicks", "comment": null}, "total_in_app_deletes": {"type": "integer", "index": 41, "name": "total_in_app_deletes", "comment": null}, "total_in_app_sent": {"type": "integer", "index": 42, "name": "total_in_app_sent", "comment": null}, "total_in_apps_delivered": {"type": "integer", "index": 43, "name": "total_in_apps_delivered", "comment": null}, "unique_in_app_opens": {"type": "integer", "index": 44, "name": "unique_in_app_opens", "comment": null}, "total_email_holdout": {"type": "integer", "index": 45, "name": "total_email_holdout", "comment": null}, "total_email_send_skips": {"type": "integer", "index": 46, "name": "total_email_send_skips", "comment": null}, "unique_email_sends": {"type": "integer", "index": 47, "name": "unique_email_sends", "comment": null}, "unique_emails_opens": {"type": "integer", "index": 48, "name": "unique_emails_opens", "comment": null}, "total_in_app_holdout": {"type": "integer", "index": 49, "name": "total_in_app_holdout", "comment": null}, "total_in_app_send_skips": {"type": "integer", "index": 50, "name": "total_in_app_send_skips", "comment": null}, "total_push_holdout": {"type": "integer", "index": 51, "name": "total_push_holdout", "comment": null}, "_fivetran_synced": {"type": "text", "index": 52, "name": "_fivetran_synced", "comment": null}, "total_sms_holdout": {"type": "integer", "index": 53, "name": "total_sms_holdout", "comment": null}, "unique_sms_sent": {"type": "integer", "index": 54, "name": "unique_sms_sent", "comment": null}, "total_sms_delivered": {"type": "integer", "index": 55, "name": "total_sms_delivered", "comment": null}, "total_sms_sent": {"type": "integer", "index": 56, "name": "total_sms_sent", "comment": null}, "total_inbound_sms": {"type": "integer", "index": 57, "name": "total_inbound_sms", "comment": null}, "total_sms_bounced": {"type": "integer", "index": 58, "name": "total_sms_bounced", "comment": null}, "total_sms_send_skips": {"type": "integer", "index": 59, "name": "total_sms_send_skips", "comment": null}, "unique_inbound_sms": {"type": "integer", "index": 60, "name": "unique_inbound_sms", "comment": null}, "unique_sms_delivered": {"type": "integer", "index": 61, "name": "unique_sms_delivered", "comment": null}, "unique_sms_bounced": {"type": "integer", "index": 62, "name": "unique_sms_bounced", "comment": null}, "revenue_m_sms_": {"type": "integer", "index": 63, "name": "revenue_m_sms_", "comment": null}, "purchases_m_sms_": {"type": "integer", "index": 64, "name": "purchases_m_sms_", "comment": null}, "purchases_m_email_": {"type": "integer", "index": 65, "name": "purchases_m_email_", "comment": null}, "revenue_m_push_": {"type": "integer", "index": 66, "name": "revenue_m_push_", "comment": null}, "revenue_m_email_": {"type": "integer", "index": 67, "name": "revenue_m_email_", "comment": null}, "purchases_m_push_": {"type": "integer", "index": 68, "name": "purchases_m_push_", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.iterable_integration_tests.campaign_metrics_data"}, "seed.iterable_integration_tests.campaign_suppression_list_history_data": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "campaign_suppression_list_history_data", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"suppressed_list_id": {"type": "integer", "index": 1, "name": "suppressed_list_id", "comment": null}, "campaign_id": {"type": "integer", "index": 2, "name": "campaign_id", "comment": null}, "updated_at": {"type": "text", "index": 3, "name": "updated_at", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 4, "name": "_fivetran_synced", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.iterable_integration_tests.campaign_suppression_list_history_data"}, "seed.iterable_integration_tests.channel_data": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "channel_data", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"id": {"type": "bigint", "index": 1, "name": "id", "comment": null}, "name": {"type": "text", "index": 2, "name": "name", "comment": null}, "channel_type": {"type": "text", "index": 3, "name": "channel_type", "comment": null}, "message_medium": {"type": "text", "index": 4, "name": "message_medium", "comment": null}, "_fivetran_deleted": {"type": "boolean", "index": 5, "name": "_fivetran_deleted", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 6, "name": "_fivetran_synced", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.iterable_integration_tests.channel_data"}, "seed.iterable_integration_tests.event_data": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "event_data", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"_fivetran_id": {"type": "text", "index": 1, "name": "_fivetran_id", "comment": null}, "email": {"type": "text", "index": 2, "name": "email", "comment": null}, "campaign_id": {"type": "integer", "index": 3, "name": "campaign_id", "comment": null}, "message_id": {"type": "integer", "index": 4, "name": "message_id", "comment": null}, "content_id": {"type": "integer", "index": 5, "name": "content_id", "comment": null}, "created_at": {"type": "timestamp without time zone", "index": 6, "name": "created_at", "comment": null}, "event_name": {"type": "text", "index": 7, "name": "event_name", "comment": null}, "ip": {"type": "integer", "index": 8, "name": "ip", "comment": null}, "message_bus_id": {"type": "integer", "index": 9, "name": "message_bus_id", "comment": null}, "message_type_id": {"type": "integer", "index": 10, "name": "message_type_id", "comment": null}, "recipient_state": {"type": "integer", "index": 11, "name": "recipient_state", "comment": null}, "status": {"type": "integer", "index": 12, "name": "status", "comment": null}, "unsub_source": {"type": "integer", "index": 13, "name": "unsub_source", "comment": null}, "user_agent": {"type": "integer", "index": 14, "name": "user_agent", "comment": null}, "user_agent_device": {"type": "integer", "index": 15, "name": "user_agent_device", "comment": null}, "transactional_data": {"type": "character varying(100)", "index": 16, "name": "transactional_data", "comment": null}, "additional_properties": {"type": "text", "index": 17, "name": "additional_properties", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 18, "name": "_fivetran_synced", "comment": null}, "_fivetran_user_id": {"type": "integer", "index": 19, "name": "_fivetran_user_id", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.iterable_integration_tests.event_data"}, "seed.iterable_integration_tests.event_extension_data": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "event_extension_data", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"_fivetran_id": {"type": "text", "index": 1, "name": "_fivetran_id", "comment": null}, "app_already_running": {"type": "integer", "index": 2, "name": "app_already_running", "comment": null}, "badge": {"type": "integer", "index": 3, "name": "badge", "comment": null}, "canonical_url_id": {"type": "integer", "index": 4, "name": "canonical_url_id", "comment": null}, "content_available": {"type": "integer", "index": 5, "name": "content_available", "comment": null}, "content_id": {"type": "integer", "index": 6, "name": "content_id", "comment": null}, "device": {"type": "integer", "index": 7, "name": "device", "comment": null}, "email_id": {"type": "text", "index": 8, "name": "email_id", "comment": null}, "email_subject": {"type": "text", "index": 9, "name": "email_subject", "comment": null}, "experiment_id": {"type": "integer", "index": 10, "name": "experiment_id", "comment": null}, "from_phone_number_id": {"type": "integer", "index": 11, "name": "from_phone_number_id", "comment": null}, "from_smssender_id": {"type": "integer", "index": 12, "name": "from_smssender_id", "comment": null}, "image_url": {"type": "integer", "index": 13, "name": "image_url", "comment": null}, "is_ghost_push": {"type": "integer", "index": 14, "name": "is_ghost_push", "comment": null}, "link_id": {"type": "integer", "index": 15, "name": "link_id", "comment": null}, "link_url": {"type": "integer", "index": 16, "name": "link_url", "comment": null}, "platform_endpoint": {"type": "integer", "index": 17, "name": "platform_endpoint", "comment": null}, "push_message": {"type": "integer", "index": 18, "name": "push_message", "comment": null}, "region": {"type": "text", "index": 19, "name": "region", "comment": null}, "sms_message": {"type": "integer", "index": 20, "name": "sms_message", "comment": null}, "sound": {"type": "integer", "index": 21, "name": "sound", "comment": null}, "to_phone_number": {"type": "integer", "index": 22, "name": "to_phone_number", "comment": null}, "url": {"type": "integer", "index": 23, "name": "url", "comment": null}, "workflow_id": {"type": "integer", "index": 24, "name": "workflow_id", "comment": null}, "workflow_name": {"type": "text", "index": 25, "name": "workflow_name", "comment": null}, "locale": {"type": "integer", "index": 26, "name": "locale", "comment": null}, "deeplink_android": {"type": "integer", "index": 27, "name": "deeplink_android", "comment": null}, "deeplink_ios": {"type": "integer", "index": 28, "name": "deeplink_ios", "comment": null}, "payload": {"type": "character varying(100)", "index": 29, "name": "payload", "comment": null}, "sms_provider_response_status": {"type": "integer", "index": 30, "name": "sms_provider_response_status", "comment": null}, "sms_provider_response_message": {"type": "integer", "index": 31, "name": "sms_provider_response_message", "comment": null}, "sms_provider_response_code": {"type": "integer", "index": 32, "name": "sms_provider_response_code", "comment": null}, "sms_provider_response_more_info": {"type": "integer", "index": 33, "name": "sms_provider_response_more_info", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 34, "name": "_fivetran_synced", "comment": null}, "catalog_collection_count": {"type": "integer", "index": 35, "name": "catalog_collection_count", "comment": null}, "catalog_lookup_count": {"type": "integer", "index": 36, "name": "catalog_lookup_count", "comment": null}, "city": {"type": "text", "index": 37, "name": "city", "comment": null}, "clicked_url": {"type": "text", "index": 38, "name": "clicked_url", "comment": null}, "country": {"type": "text", "index": 39, "name": "country", "comment": null}, "error_code": {"type": "integer", "index": 40, "name": "error_code", "comment": null}, "expires_at": {"type": "text", "index": 41, "name": "expires_at", "comment": null}, "from_phone_number": {"type": "integer", "index": 42, "name": "from_phone_number", "comment": null}, "in_app_body": {"type": "text", "index": 43, "name": "in_app_body", "comment": null}, "is_sms_estimation": {"type": "boolean", "index": 44, "name": "is_sms_estimation", "comment": null}, "labels": {"type": "text", "index": 45, "name": "labels", "comment": null}, "message_context": {"type": "text", "index": 46, "name": "message_context", "comment": null}, "message_status": {"type": "text", "index": 47, "name": "message_status", "comment": null}, "mms_send_count": {"type": "integer", "index": 48, "name": "mms_send_count", "comment": null}, "product_recommendation_count": {"type": "integer", "index": 49, "name": "product_recommendation_count", "comment": null}, "proxy_source": {"type": "text", "index": 50, "name": "proxy_source", "comment": null}, "reason": {"type": "text", "index": 51, "name": "reason", "comment": null}, "sms_send_count": {"type": "integer", "index": 52, "name": "sms_send_count", "comment": null}, "web_push_body": {"type": "text", "index": 53, "name": "web_push_body", "comment": null}, "web_push_click_action": {"type": "text", "index": 54, "name": "web_push_click_action", "comment": null}, "web_push_icon": {"type": "text", "index": 55, "name": "web_push_icon", "comment": null}, "web_push_message": {"type": "text", "index": 56, "name": "web_push_message", "comment": null}, "_fivetran_user_id": {"type": "integer", "index": 57, "name": "_fivetran_user_id", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.iterable_integration_tests.event_extension_data"}, "seed.iterable_integration_tests.journey_data": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "journey_data", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"id": {"type": "bigint", "index": 1, "name": "id", "comment": null}, "name": {"type": "text", "index": 2, "name": "name", "comment": null}, "journey_type": {"type": "text", "index": 3, "name": "journey_type", "comment": null}, "description": {"type": "text", "index": 4, "name": "description", "comment": null}, "creator_user_id": {"type": "text", "index": 5, "name": "creator_user_id", "comment": null}, "enabled": {"type": "boolean", "index": 6, "name": "enabled", "comment": null}, "is_archived": {"type": "boolean", "index": 7, "name": "is_archived", "comment": null}, "lifetime_limit": {"type": "bigint", "index": 8, "name": "lifetime_limit", "comment": null}, "simultaneous_limit": {"type": "bigint", "index": 9, "name": "simultaneous_limit", "comment": null}, "start_tile_id": {"type": "bigint", "index": 10, "name": "start_tile_id", "comment": null}, "trigger_event_names": {"type": "text", "index": 11, "name": "trigger_event_names", "comment": null}, "created_at": {"type": "timestamp without time zone", "index": 12, "name": "created_at", "comment": null}, "updated_at": {"type": "timestamp without time zone", "index": 13, "name": "updated_at", "comment": null}, "_fivetran_deleted": {"type": "boolean", "index": 14, "name": "_fivetran_deleted", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 15, "name": "_fivetran_synced", "comment": null}, "draft_name": {"type": "text", "index": 16, "name": "draft_name", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.iterable_integration_tests.journey_data"}, "seed.iterable_integration_tests.list_data": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "list_data", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"id": {"type": "integer", "index": 1, "name": "id", "comment": null}, "name": {"type": "text", "index": 2, "name": "name", "comment": null}, "created_at": {"type": "text", "index": 3, "name": "created_at", "comment": null}, "list_type": {"type": "text", "index": 4, "name": "list_type", "comment": null}, "_fivetran_deleted": {"type": "boolean", "index": 5, "name": "_fivetran_deleted", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 6, "name": "_fivetran_synced", "comment": null}, "description": {"type": "text", "index": 7, "name": "description", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.iterable_integration_tests.list_data"}, "seed.iterable_integration_tests.list_user_data": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "list_user_data", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"_fivetran_id": {"type": "text", "index": 1, "name": "_fivetran_id", "comment": null}, "index": {"type": "bigint", "index": 2, "name": "index", "comment": null}, "list_id": {"type": "bigint", "index": 3, "name": "list_id", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 4, "name": "_fivetran_synced", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.iterable_integration_tests.list_user_data"}, "seed.iterable_integration_tests.message_type_data": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "message_type_data", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"id": {"type": "bigint", "index": 1, "name": "id", "comment": null}, "name": {"type": "text", "index": 2, "name": "name", "comment": null}, "channel_id": {"type": "bigint", "index": 3, "name": "channel_id", "comment": null}, "_fivetran_deleted": {"type": "boolean", "index": 4, "name": "_fivetran_deleted", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 5, "name": "_fivetran_synced", "comment": null}, "created_at": {"type": "timestamp without time zone", "index": 6, "name": "created_at", "comment": null}, "frequency_cap": {"type": "integer", "index": 7, "name": "frequency_cap", "comment": null}, "rate_limit_per_minute": {"type": "integer", "index": 8, "name": "rate_limit_per_minute", "comment": null}, "subscription_policy": {"type": "text", "index": 9, "name": "subscription_policy", "comment": null}, "updated_at": {"type": "timestamp without time zone", "index": 10, "name": "updated_at", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.iterable_integration_tests.message_type_data"}, "seed.iterable_integration_tests.template_history_data": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "template_history_data", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"id": {"type": "integer", "index": 1, "name": "id", "comment": null}, "updated_at": {"type": "text", "index": 2, "name": "updated_at", "comment": null}, "message_type_id": {"type": "integer", "index": 3, "name": "message_type_id", "comment": null}, "client_template_id": {"type": "integer", "index": 4, "name": "client_template_id", "comment": null}, "created_at": {"type": "text", "index": 5, "name": "created_at", "comment": null}, "creator_user_id": {"type": "text", "index": 6, "name": "creator_user_id", "comment": null}, "name": {"type": "text", "index": 7, "name": "name", "comment": null}, "template_type": {"type": "text", "index": 8, "name": "template_type", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 9, "name": "_fivetran_synced", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.iterable_integration_tests.template_history_data"}, "seed.iterable_integration_tests.user_history_bq_json_data": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "user_history_bq_json_data", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"email": {"type": "text", "index": 1, "name": "email", "comment": null}, "updated_at": {"type": "text", "index": 2, "name": "updated_at", "comment": null}, "first_name": {"type": "integer", "index": 3, "name": "first_name", "comment": null}, "last_name": {"type": "integer", "index": 4, "name": "last_name", "comment": null}, "phone_number": {"type": "integer", "index": 5, "name": "phone_number", "comment": null}, "user_id": {"type": "integer", "index": 6, "name": "user_id", "comment": null}, "signup_date": {"type": "text", "index": 7, "name": "signup_date", "comment": null}, "signup_source": {"type": "text", "index": 8, "name": "signup_source", "comment": null}, "phone_number_carrier": {"type": "integer", "index": 9, "name": "phone_number_carrier", "comment": null}, "phone_number_country_code_iso": {"type": "integer", "index": 10, "name": "phone_number_country_code_iso", "comment": null}, "phone_number_line_type": {"type": "integer", "index": 11, "name": "phone_number_line_type", "comment": null}, "phone_number_updated_at": {"type": "integer", "index": 12, "name": "phone_number_updated_at", "comment": null}, "_fivetran_synced": {"type": "text", "index": 13, "name": "_fivetran_synced", "comment": null}, "email_list_ids": {"type": "text", "index": 14, "name": "email_list_ids", "comment": null}, "iterable_user_id": {"type": "integer", "index": 15, "name": "iterable_user_id", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.iterable_integration_tests.user_history_bq_json_data"}, "seed.iterable_integration_tests.user_history_data": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "user_history_data", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"email": {"type": "text", "index": 1, "name": "email", "comment": null}, "updated_at": {"type": "timestamp without time zone", "index": 2, "name": "updated_at", "comment": null}, "first_name": {"type": "integer", "index": 3, "name": "first_name", "comment": null}, "last_name": {"type": "integer", "index": 4, "name": "last_name", "comment": null}, "phone_number": {"type": "integer", "index": 5, "name": "phone_number", "comment": null}, "user_id": {"type": "integer", "index": 6, "name": "user_id", "comment": null}, "signup_date": {"type": "text", "index": 7, "name": "signup_date", "comment": null}, "signup_source": {"type": "text", "index": 8, "name": "signup_source", "comment": null}, "phone_number_carrier": {"type": "integer", "index": 9, "name": "phone_number_carrier", "comment": null}, "phone_number_country_code_iso": {"type": "integer", "index": 10, "name": "phone_number_country_code_iso", "comment": null}, "phone_number_line_type": {"type": "integer", "index": 11, "name": "phone_number_line_type", "comment": null}, "phone_number_updated_at": {"type": "integer", "index": 12, "name": "phone_number_updated_at", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 13, "name": "_fivetran_synced", "comment": null}, "email_list_ids": {"type": "text", "index": 14, "name": "email_list_ids", "comment": null}, "iterable_user_id": {"type": "integer", "index": 15, "name": "iterable_user_id", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.iterable_integration_tests.user_history_data"}, "seed.iterable_integration_tests.user_unsubscribed_channel_data": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "user_unsubscribed_channel_data", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"_fivetran_id": {"type": "text", "index": 1, "name": "_fivetran_id", "comment": null}, "channel_id": {"type": "integer", "index": 2, "name": "channel_id", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 3, "name": "_fivetran_synced", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.iterable_integration_tests.user_unsubscribed_channel_data"}, "seed.iterable_integration_tests.user_unsubscribed_channel_history_data": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "user_unsubscribed_channel_history_data", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"email": {"type": "text", "index": 1, "name": "email", "comment": null}, "channel_id": {"type": "bigint", "index": 2, "name": "channel_id", "comment": null}, "updated_at": {"type": "text", "index": 3, "name": "updated_at", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 4, "name": "_fivetran_synced", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.iterable_integration_tests.user_unsubscribed_channel_history_data"}, "seed.iterable_integration_tests.user_unsubscribed_message_type_data": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "user_unsubscribed_message_type_data", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"_fivetran_id": {"type": "text", "index": 1, "name": "_fivetran_id", "comment": null}, "message_type_id": {"type": "integer", "index": 2, "name": "message_type_id", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 3, "name": "_fivetran_synced", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.iterable_integration_tests.user_unsubscribed_message_type_data"}, "seed.iterable_integration_tests.user_unsubscribed_message_type_history_data": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "user_unsubscribed_message_type_history_data", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"message_type_id": {"type": "integer", "index": 1, "name": "message_type_id", "comment": null}, "email": {"type": "text", "index": 2, "name": "email", "comment": null}, "updated_at": {"type": "text", "index": 3, "name": "updated_at", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 4, "name": "_fivetran_synced", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.iterable_integration_tests.user_unsubscribed_message_type_history_data"}, "model.iterable.int_iterable__campaign_event_metrics": {"metadata": {"type": "VIEW", "schema": "public_iterable_dev", "name": "int_iterable__campaign_event_metrics", "database": "postgres", "comment": "Table that generates relevant total and unique campaign/experiment level aggregations.", "owner": "postgres"}, "columns": {"source_relation": {"type": "text", "index": 1, "name": "source_relation", "comment": null}, "campaign_id": {"type": "text", "index": 2, "name": "campaign_id", "comment": null}, "template_id": {"type": "text", "index": 3, "name": "template_id", "comment": null}, "experiment_id": {"type": "integer", "index": 4, "name": "experiment_id", "comment": null}, "count_unique_users": {"type": "bigint", "index": 5, "name": "count_unique_users", "comment": null}, "total_emailclick": {"type": "numeric", "index": 6, "name": "total_emailclick", "comment": null}, "unique_total_emailclick": {"type": "bigint", "index": 7, "name": "unique_total_emailclick", "comment": null}, "total_emailunsubscribe": {"type": "numeric", "index": 8, "name": "total_emailunsubscribe", "comment": null}, "unique_total_emailunsubscribe": {"type": "bigint", "index": 9, "name": "unique_total_emailunsubscribe", "comment": null}, "total_emailcomplaint": {"type": "numeric", "index": 10, "name": "total_emailcomplaint", "comment": null}, "unique_total_emailcomplaint": {"type": "bigint", "index": 11, "name": "unique_total_emailcomplaint", "comment": null}, "total_customevent": {"type": "numeric", "index": 12, "name": "total_customevent", "comment": null}, "unique_total_customevent": {"type": "bigint", "index": 13, "name": "unique_total_customevent", "comment": null}, "total_emailsubscribe": {"type": "numeric", "index": 14, "name": "total_emailsubscribe", "comment": null}, "unique_total_emailsubscribe": {"type": "bigint", "index": 15, "name": "unique_total_emailsubscribe", "comment": null}, "total_emailopen": {"type": "numeric", "index": 16, "name": "total_emailopen", "comment": null}, "unique_total_emailopen": {"type": "bigint", "index": 17, "name": "unique_total_emailopen", "comment": null}, "total_pushsend": {"type": "numeric", "index": 18, "name": "total_pushsend", "comment": null}, "unique_total_pushsend": {"type": "bigint", "index": 19, "name": "unique_total_pushsend", "comment": null}, "total_smsbounce": {"type": "numeric", "index": 20, "name": "total_smsbounce", "comment": null}, "unique_total_smsbounce": {"type": "bigint", "index": 21, "name": "unique_total_smsbounce", "comment": null}, "total_pushbounce": {"type": "numeric", "index": 22, "name": "total_pushbounce", "comment": null}, "unique_total_pushbounce": {"type": "bigint", "index": 23, "name": "unique_total_pushbounce", "comment": null}, "total_inappsendskip": {"type": "numeric", "index": 24, "name": "total_inappsendskip", "comment": null}, "unique_total_inappsendskip": {"type": "bigint", "index": 25, "name": "unique_total_inappsendskip", "comment": null}, "total_smssend": {"type": "numeric", "index": 26, "name": "total_smssend", "comment": null}, "unique_total_smssend": {"type": "bigint", "index": 27, "name": "unique_total_smssend", "comment": null}, "total_inappsend": {"type": "numeric", "index": 28, "name": "total_inappsend", "comment": null}, "unique_total_inappsend": {"type": "bigint", "index": 29, "name": "unique_total_inappsend", "comment": null}, "total_pushopen": {"type": "numeric", "index": 30, "name": "total_pushopen", "comment": null}, "unique_total_pushopen": {"type": "bigint", "index": 31, "name": "unique_total_pushopen", "comment": null}, "total_emailsend": {"type": "numeric", "index": 32, "name": "total_emailsend", "comment": null}, "unique_total_emailsend": {"type": "bigint", "index": 33, "name": "unique_total_emailsend", "comment": null}, "total_pushsendskip": {"type": "numeric", "index": 34, "name": "total_pushsendskip", "comment": null}, "unique_total_pushsendskip": {"type": "bigint", "index": 35, "name": "unique_total_pushsendskip", "comment": null}, "total_inappopen": {"type": "numeric", "index": 36, "name": "total_inappopen", "comment": null}, "unique_total_inappopen": {"type": "bigint", "index": 37, "name": "unique_total_inappopen", "comment": null}, "total_emailsendskip": {"type": "numeric", "index": 38, "name": "total_emailsendskip", "comment": null}, "unique_total_emailsendskip": {"type": "bigint", "index": 39, "name": "unique_total_emailsendskip", "comment": null}, "total_emailbounce": {"type": "numeric", "index": 40, "name": "total_emailbounce", "comment": null}, "unique_total_emailbounce": {"type": "bigint", "index": 41, "name": "unique_total_emailbounce", "comment": null}, "total_inappclick": {"type": "numeric", "index": 42, "name": "total_inappclick", "comment": null}, "unique_total_inappclick": {"type": "bigint", "index": 43, "name": "unique_total_inappclick", "comment": null}, "total_pushuninstall": {"type": "numeric", "index": 44, "name": "total_pushuninstall", "comment": null}, "unique_total_pushuninstall": {"type": "bigint", "index": 45, "name": "unique_total_pushuninstall", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.int_iterable__campaign_event_metrics"}, "model.iterable.int_iterable__campaign_labels": {"metadata": {"type": "VIEW", "schema": "public_iterable_dev", "name": "int_iterable__campaign_labels", "database": "postgres", "comment": "Table that provides the distinct string aggregation of labels for each campaign.", "owner": "postgres"}, "columns": {"source_relation": {"type": "text", "index": 1, "name": "source_relation", "comment": null}, "campaign_id": {"type": "text", "index": 2, "name": "campaign_id", "comment": null}, "labels": {"type": "text", "index": 3, "name": "labels", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.int_iterable__campaign_labels"}, "model.iterable.int_iterable__campaign_lists": {"metadata": {"type": "VIEW", "schema": "public_iterable_dev", "name": "int_iterable__campaign_lists", "database": "postgres", "comment": "Table that identifies the suppressed and send lists associated with a campaign.", "owner": "postgres"}, "columns": {"source_relation": {"type": "text", "index": 1, "name": "source_relation", "comment": null}, "list_id": {"type": "text", "index": 2, "name": "list_id", "comment": null}, "campaign_id": {"type": "text", "index": 3, "name": "campaign_id", "comment": null}, "updated_at": {"type": "text", "index": 4, "name": "updated_at", "comment": null}, "list_activity": {"type": "text", "index": 5, "name": "list_activity", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.int_iterable__campaign_lists"}, "model.iterable.int_iterable__journey_event_metrics": {"metadata": {"type": "VIEW", "schema": "public_iterable_dev", "name": "int_iterable__journey_event_metrics", "database": "postgres", "comment": "Table that generates relevant total and unique journey level aggregations, rolled up from the user/campaign grain via the campaign's journey reference.", "owner": "postgres"}, "columns": {"source_relation": {"type": "text", "index": 1, "name": "source_relation", "comment": null}, "journey_id": {"type": "text", "index": 2, "name": "journey_id", "comment": null}, "count_total_campaigns": {"type": "bigint", "index": 3, "name": "count_total_campaigns", "comment": null}, "count_unique_users": {"type": "bigint", "index": 4, "name": "count_unique_users", "comment": null}, "first_event_at": {"type": "timestamp without time zone", "index": 5, "name": "first_event_at", "comment": null}, "last_event_at": {"type": "timestamp without time zone", "index": 6, "name": "last_event_at", "comment": null}, "total_emailclick": {"type": "numeric", "index": 7, "name": "total_emailclick", "comment": null}, "unique_total_emailclick": {"type": "bigint", "index": 8, "name": "unique_total_emailclick", "comment": null}, "total_emailunsubscribe": {"type": "numeric", "index": 9, "name": "total_emailunsubscribe", "comment": null}, "unique_total_emailunsubscribe": {"type": "bigint", "index": 10, "name": "unique_total_emailunsubscribe", "comment": null}, "total_emailcomplaint": {"type": "numeric", "index": 11, "name": "total_emailcomplaint", "comment": null}, "unique_total_emailcomplaint": {"type": "bigint", "index": 12, "name": "unique_total_emailcomplaint", "comment": null}, "total_customevent": {"type": "numeric", "index": 13, "name": "total_customevent", "comment": null}, "unique_total_customevent": {"type": "bigint", "index": 14, "name": "unique_total_customevent", "comment": null}, "total_emailsubscribe": {"type": "numeric", "index": 15, "name": "total_emailsubscribe", "comment": null}, "unique_total_emailsubscribe": {"type": "bigint", "index": 16, "name": "unique_total_emailsubscribe", "comment": null}, "total_emailopen": {"type": "numeric", "index": 17, "name": "total_emailopen", "comment": null}, "unique_total_emailopen": {"type": "bigint", "index": 18, "name": "unique_total_emailopen", "comment": null}, "total_pushsend": {"type": "numeric", "index": 19, "name": "total_pushsend", "comment": null}, "unique_total_pushsend": {"type": "bigint", "index": 20, "name": "unique_total_pushsend", "comment": null}, "total_smsbounce": {"type": "numeric", "index": 21, "name": "total_smsbounce", "comment": null}, "unique_total_smsbounce": {"type": "bigint", "index": 22, "name": "unique_total_smsbounce", "comment": null}, "total_pushbounce": {"type": "numeric", "index": 23, "name": "total_pushbounce", "comment": null}, "unique_total_pushbounce": {"type": "bigint", "index": 24, "name": "unique_total_pushbounce", "comment": null}, "total_inappsendskip": {"type": "numeric", "index": 25, "name": "total_inappsendskip", "comment": null}, "unique_total_inappsendskip": {"type": "bigint", "index": 26, "name": "unique_total_inappsendskip", "comment": null}, "total_smssend": {"type": "numeric", "index": 27, "name": "total_smssend", "comment": null}, "unique_total_smssend": {"type": "bigint", "index": 28, "name": "unique_total_smssend", "comment": null}, "total_inappsend": {"type": "numeric", "index": 29, "name": "total_inappsend", "comment": null}, "unique_total_inappsend": {"type": "bigint", "index": 30, "name": "unique_total_inappsend", "comment": null}, "total_pushopen": {"type": "numeric", "index": 31, "name": "total_pushopen", "comment": null}, "unique_total_pushopen": {"type": "bigint", "index": 32, "name": "unique_total_pushopen", "comment": null}, "total_emailsend": {"type": "numeric", "index": 33, "name": "total_emailsend", "comment": null}, "unique_total_emailsend": {"type": "bigint", "index": 34, "name": "unique_total_emailsend", "comment": null}, "total_pushsendskip": {"type": "numeric", "index": 35, "name": "total_pushsendskip", "comment": null}, "unique_total_pushsendskip": {"type": "bigint", "index": 36, "name": "unique_total_pushsendskip", "comment": null}, "total_inappopen": {"type": "numeric", "index": 37, "name": "total_inappopen", "comment": null}, "unique_total_inappopen": {"type": "bigint", "index": 38, "name": "unique_total_inappopen", "comment": null}, "total_emailsendskip": {"type": "numeric", "index": 39, "name": "total_emailsendskip", "comment": null}, "unique_total_emailsendskip": {"type": "bigint", "index": 40, "name": "unique_total_emailsendskip", "comment": null}, "total_emailbounce": {"type": "numeric", "index": 41, "name": "total_emailbounce", "comment": null}, "unique_total_emailbounce": {"type": "bigint", "index": 42, "name": "unique_total_emailbounce", "comment": null}, "total_inappclick": {"type": "numeric", "index": 43, "name": "total_inappclick", "comment": null}, "unique_total_inappclick": {"type": "bigint", "index": 44, "name": "unique_total_inappclick", "comment": null}, "total_pushuninstall": {"type": "numeric", "index": 45, "name": "total_pushuninstall", "comment": null}, "unique_total_pushuninstall": {"type": "bigint", "index": 46, "name": "unique_total_pushuninstall", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.int_iterable__journey_event_metrics"}, "model.iterable.int_iterable__latest_campaign": {"metadata": {"type": "VIEW", "schema": "public_iterable_dev", "name": "int_iterable__latest_campaign", "database": "postgres", "comment": "Table that filters out historical versions of the campaign, and returns the most recent campaign version.", "owner": "postgres"}, "columns": {"source_relation": {"type": "text", "index": 1, "name": "source_relation", "comment": null}, "campaign_id": {"type": "text", "index": 2, "name": "campaign_id", "comment": null}, "updated_at": {"type": "text", "index": 3, "name": "updated_at", "comment": null}, "campaign_name": {"type": "text", "index": 4, "name": "campaign_name", "comment": null}, "campaign_state": {"type": "text", "index": 5, "name": "campaign_state", "comment": null}, "campaign_type": {"type": "text", "index": 6, "name": "campaign_type", "comment": null}, "send_size": {"type": "integer", "index": 7, "name": "send_size", "comment": null}, "start_at": {"type": "integer", "index": 8, "name": "start_at", "comment": null}, "ended_at": {"type": "integer", "index": 9, "name": "ended_at", "comment": null}, "created_at": {"type": "text", "index": 10, "name": "created_at", "comment": null}, "message_medium": {"type": "text", "index": 11, "name": "message_medium", "comment": null}, "recurring_campaign_id": {"type": "text", "index": 12, "name": "recurring_campaign_id", "comment": null}, "created_by_user_id": {"type": "text", "index": 13, "name": "created_by_user_id", "comment": null}, "updated_by_user_id": {"type": "text", "index": 14, "name": "updated_by_user_id", "comment": null}, "template_id": {"type": "text", "index": 15, "name": "template_id", "comment": null}, "workflow_id": {"type": "integer", "index": 16, "name": "workflow_id", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 17, "name": "_fivetran_synced", "comment": null}, "latest_campaign_index": {"type": "bigint", "index": 18, "name": "latest_campaign_index", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.int_iterable__latest_campaign"}, "model.iterable.int_iterable__latest_template": {"metadata": {"type": "VIEW", "schema": "public_iterable_dev", "name": "int_iterable__latest_template", "database": "postgres", "comment": "Table that provides the most recent version of the template as well as joining relevant message type information.", "owner": "postgres"}, "columns": {"source_relation": {"type": "text", "index": 1, "name": "source_relation", "comment": null}, "template_id": {"type": "text", "index": 2, "name": "template_id", "comment": null}, "template_name": {"type": "text", "index": 3, "name": "template_name", "comment": null}, "template_type": {"type": "text", "index": 4, "name": "template_type", "comment": null}, "created_at": {"type": "text", "index": 5, "name": "created_at", "comment": null}, "client_template_id": {"type": "text", "index": 6, "name": "client_template_id", "comment": null}, "creator_user_id": {"type": "text", "index": 7, "name": "creator_user_id", "comment": null}, "message_type_id": {"type": "text", "index": 8, "name": "message_type_id", "comment": null}, "updated_at": {"type": "text", "index": 9, "name": "updated_at", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 10, "name": "_fivetran_synced", "comment": null}, "latest_template_index": {"type": "bigint", "index": 11, "name": "latest_template_index", "comment": null}, "message_type_name": {"type": "text", "index": 12, "name": "message_type_name", "comment": null}, "channel_id": {"type": "text", "index": 13, "name": "channel_id", "comment": null}, "channel_name": {"type": "text", "index": 14, "name": "channel_name", "comment": null}, "channel_type": {"type": "text", "index": 15, "name": "channel_type", "comment": null}, "message_medium": {"type": "text", "index": 16, "name": "message_medium", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.int_iterable__latest_template"}, "model.iterable.int_iterable__latest_user": {"metadata": {"type": "VIEW", "schema": "public_iterable_dev", "name": "int_iterable__latest_user", "database": "postgres", "comment": "Table that filters out historical versions of the user, and returns only the most recent version.", "owner": "postgres"}, "columns": {"source_relation": {"type": "text", "index": 1, "name": "source_relation", "comment": null}, "_fivetran_user_id": {"type": "text", "index": 2, "name": "_fivetran_user_id", "comment": null}, "email": {"type": "text", "index": 3, "name": "email", "comment": null}, "updated_at": {"type": "timestamp without time zone", "index": 4, "name": "updated_at", "comment": null}, "user_id": {"type": "text", "index": 5, "name": "user_id", "comment": null}, "first_name": {"type": "integer", "index": 6, "name": "first_name", "comment": null}, "last_name": {"type": "integer", "index": 7, "name": "last_name", "comment": null}, "email_list_ids": {"type": "text", "index": 8, "name": "email_list_ids", "comment": null}, "phone_number": {"type": "integer", "index": 9, "name": "phone_number", "comment": null}, "signup_date": {"type": "text", "index": 10, "name": "signup_date", "comment": null}, "signup_source": {"type": "text", "index": 11, "name": "signup_source", "comment": null}, "iterable_user_id": {"type": "text", "index": 12, "name": "iterable_user_id", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 13, "name": "_fivetran_synced", "comment": null}, "unique_user_key": {"type": "text", "index": 14, "name": "unique_user_key", "comment": null}, "latest_user_index": {"type": "bigint", "index": 15, "name": "latest_user_index", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.int_iterable__latest_user"}, "model.iterable.int_iterable__list_user_history": {"metadata": {"type": "BASE TABLE", "schema": "public_iterable_dev", "name": "int_iterable__list_user_history", "database": "postgres", "comment": "Table that provides a history of all lists the user has been associated with.", "owner": "postgres"}, "columns": {"source_relation": {"type": "text", "index": 1, "name": "source_relation", "comment": null}, "_fivetran_user_id": {"type": "text", "index": 2, "name": "_fivetran_user_id", "comment": null}, "unique_user_key": {"type": "text", "index": 3, "name": "unique_user_key", "comment": null}, "email": {"type": "text", "index": 4, "name": "email", "comment": null}, "user_id": {"type": "text", "index": 5, "name": "user_id", "comment": null}, "first_name": {"type": "integer", "index": 6, "name": "first_name", "comment": null}, "last_name": {"type": "integer", "index": 7, "name": "last_name", "comment": null}, "email_list_ids": {"type": "text", "index": 8, "name": "email_list_ids", "comment": null}, "phone_number": {"type": "integer", "index": 9, "name": "phone_number", "comment": null}, "signup_date": {"type": "text", "index": 10, "name": "signup_date", "comment": null}, "signup_source": {"type": "text", "index": 11, "name": "signup_source", "comment": null}, "updated_at": {"type": "timestamp without time zone", "index": 12, "name": "updated_at", "comment": null}, "is_current": {"type": "boolean", "index": 13, "name": "is_current", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.int_iterable__list_user_history"}, "model.iterable.int_iterable__list_user_unnest": {"metadata": {"type": "BASE TABLE", "schema": "public_iterable_dev", "name": "int_iterable__list_user_unnest", "database": "postgres", "comment": "Table that unnests the `email_list_id` field for each user to create a new record for each user and the unique list it was associated with at a unique update. Due to the unnesting functions varying greatly between warehouses, conditional logic is applied throughout the model to appropriately accommodate the model being ran within Redshift, Snowflake, BigQuery, and Postgres.\n", "owner": "postgres"}, "columns": {"source_relation": {"type": "text", "index": 1, "name": "source_relation", "comment": null}, "_fivetran_user_id": {"type": "text", "index": 2, "name": "_fivetran_user_id", "comment": null}, "unique_user_key": {"type": "text", "index": 3, "name": "unique_user_key", "comment": null}, "user_id": {"type": "text", "index": 4, "name": "user_id", "comment": null}, "email": {"type": "text", "index": 5, "name": "email", "comment": null}, "first_name": {"type": "integer", "index": 6, "name": "first_name", "comment": null}, "last_name": {"type": "integer", "index": 7, "name": "last_name", "comment": null}, "signup_date": {"type": "text", "index": 8, "name": "signup_date", "comment": null}, "signup_source": {"type": "text", "index": 9, "name": "signup_source", "comment": null}, "updated_at": {"type": "timestamp without time zone", "index": 10, "name": "updated_at", "comment": null}, "phone_number": {"type": "integer", "index": 11, "name": "phone_number", "comment": null}, "is_current": {"type": "boolean", "index": 12, "name": "is_current", "comment": null}, "email_list_ids": {"type": "text", "index": 13, "name": "email_list_ids", "comment": null}, "list_id": {"type": "integer", "index": 14, "name": "list_id", "comment": null}, "unique_key": {"type": "text", "index": 15, "name": "unique_key", "comment": null}, "date_day": {"type": "date", "index": 16, "name": "date_day", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.int_iterable__list_user_unnest"}, "model.iterable.int_iterable__message_type_channel": {"metadata": {"type": "VIEW", "schema": "public_iterable_dev", "name": "int_iterable__message_type_channel", "database": "postgres", "comment": "Table that joins the message type and channel records together into one comprehensive model to be referenced downstream.", "owner": "postgres"}, "columns": {"source_relation": {"type": "text", "index": 1, "name": "source_relation", "comment": null}, "channel_id": {"type": "text", "index": 2, "name": "channel_id", "comment": null}, "channel_name": {"type": "text", "index": 3, "name": "channel_name", "comment": null}, "channel_type": {"type": "text", "index": 4, "name": "channel_type", "comment": null}, "message_medium": {"type": "text", "index": 5, "name": "message_medium", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 6, "name": "_fivetran_synced", "comment": null}, "message_type_name": {"type": "text", "index": 7, "name": "message_type_name", "comment": null}, "message_type_id": {"type": "text", "index": 8, "name": "message_type_id", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.int_iterable__message_type_channel"}, "model.iterable.int_iterable__recurring_campaigns": {"metadata": {"type": "VIEW", "schema": "public_iterable_dev", "name": "int_iterable__recurring_campaigns", "database": "postgres", "comment": "Table that identifies when a campaign is associated with a recurring campaign and provides additional enriched recurring campaign information.", "owner": "postgres"}, "columns": {"source_relation": {"type": "text", "index": 1, "name": "source_relation", "comment": null}, "campaign_id": {"type": "text", "index": 2, "name": "campaign_id", "comment": null}, "campaign_name": {"type": "text", "index": 3, "name": "campaign_name", "comment": null}, "updated_at": {"type": "text", "index": 4, "name": "updated_at", "comment": null}, "campaign_state": {"type": "text", "index": 5, "name": "campaign_state", "comment": null}, "campaign_type": {"type": "text", "index": 6, "name": "campaign_type", "comment": null}, "send_size": {"type": "integer", "index": 7, "name": "send_size", "comment": null}, "start_at": {"type": "integer", "index": 8, "name": "start_at", "comment": null}, "ended_at": {"type": "integer", "index": 9, "name": "ended_at", "comment": null}, "created_at": {"type": "text", "index": 10, "name": "created_at", "comment": null}, "created_by_user_id": {"type": "text", "index": 11, "name": "created_by_user_id", "comment": null}, "template_id": {"type": "text", "index": 12, "name": "template_id", "comment": null}, "recurring_campaign_id": {"type": "text", "index": 13, "name": "recurring_campaign_id", "comment": null}, "journey_id": {"type": "text", "index": 14, "name": "journey_id", "comment": null}, "recurring_campaign_name": {"type": "text", "index": 15, "name": "recurring_campaign_name", "comment": null}, "recurring_campaign_state": {"type": "text", "index": 16, "name": "recurring_campaign_state", "comment": null}, "recurring_campaign_send_size": {"type": "integer", "index": 17, "name": "recurring_campaign_send_size", "comment": null}, "recurring_campaign_start_at": {"type": "integer", "index": 18, "name": "recurring_campaign_start_at", "comment": null}, "is_campaign_recurring": {"type": "boolean", "index": 19, "name": "is_campaign_recurring", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.int_iterable__recurring_campaigns"}, "model.iterable.int_iterable__user_event_metrics": {"metadata": {"type": "VIEW", "schema": "public_iterable_dev", "name": "int_iterable__user_event_metrics", "database": "postgres", "comment": "Table that generates user aggregations at the campaign level.", "owner": "postgres"}, "columns": {"source_relation": {"type": "text", "index": 1, "name": "source_relation", "comment": null}, "_fivetran_user_id": {"type": "text", "index": 2, "name": "_fivetran_user_id", "comment": null}, "unique_user_key": {"type": "text", "index": 3, "name": "unique_user_key", "comment": null}, "user_id": {"type": "text", "index": 4, "name": "user_id", "comment": null}, "user_email": {"type": "text", "index": 5, "name": "user_email", "comment": null}, "count_total_campaigns": {"type": "bigint", "index": 6, "name": "count_total_campaigns", "comment": null}, "first_event_at": {"type": "timestamp without time zone", "index": 7, "name": "first_event_at", "comment": null}, "last_event_at": {"type": "timestamp without time zone", "index": 8, "name": "last_event_at", "comment": null}, "total_emailclick": {"type": "numeric", "index": 9, "name": "total_emailclick", "comment": null}, "total_emailunsubscribe": {"type": "numeric", "index": 10, "name": "total_emailunsubscribe", "comment": null}, "total_emailcomplaint": {"type": "numeric", "index": 11, "name": "total_emailcomplaint", "comment": null}, "total_customevent": {"type": "numeric", "index": 12, "name": "total_customevent", "comment": null}, "total_emailsubscribe": {"type": "numeric", "index": 13, "name": "total_emailsubscribe", "comment": null}, "total_emailopen": {"type": "numeric", "index": 14, "name": "total_emailopen", "comment": null}, "total_pushsend": {"type": "numeric", "index": 15, "name": "total_pushsend", "comment": null}, "total_smsbounce": {"type": "numeric", "index": 16, "name": "total_smsbounce", "comment": null}, "total_pushbounce": {"type": "numeric", "index": 17, "name": "total_pushbounce", "comment": null}, "total_inappsendskip": {"type": "numeric", "index": 18, "name": "total_inappsendskip", "comment": null}, "total_smssend": {"type": "numeric", "index": 19, "name": "total_smssend", "comment": null}, "total_inappsend": {"type": "numeric", "index": 20, "name": "total_inappsend", "comment": null}, "total_pushopen": {"type": "numeric", "index": 21, "name": "total_pushopen", "comment": null}, "total_emailsend": {"type": "numeric", "index": 22, "name": "total_emailsend", "comment": null}, "total_pushsendskip": {"type": "numeric", "index": 23, "name": "total_pushsendskip", "comment": null}, "total_inappopen": {"type": "numeric", "index": 24, "name": "total_inappopen", "comment": null}, "total_emailsendskip": {"type": "numeric", "index": 25, "name": "total_emailsendskip", "comment": null}, "total_emailbounce": {"type": "numeric", "index": 26, "name": "total_emailbounce", "comment": null}, "total_inappclick": {"type": "numeric", "index": 27, "name": "total_inappclick", "comment": null}, "total_pushuninstall": {"type": "numeric", "index": 28, "name": "total_pushuninstall", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.int_iterable__user_event_metrics"}, "model.iterable.iterable__campaigns": {"metadata": {"type": "BASE TABLE", "schema": "public_iterable_dev", "name": "iterable__campaigns", "database": "postgres", "comment": "Table that provides aggregations for campaigns at the template and if available, the experiment grain.", "owner": "postgres"}, "columns": {"source_relation": {"type": "text", "index": 1, "name": "source_relation", "comment": "Identifies the record's source."}, "campaign_id": {"type": "text", "index": 2, "name": "campaign_id", "comment": "Unique identifier of the campaign record"}, "campaign_name": {"type": "text", "index": 3, "name": "campaign_name", "comment": "User defined name of the campaign."}, "updated_at": {"type": "text", "index": 4, "name": "updated_at", "comment": "Last update timestamp"}, "campaign_state": {"type": "text", "index": 5, "name": "campaign_state", "comment": "State of the campaign. Can be Draft, Ready, Scheduled, Running, Finished, Starting, Aborted or Recurring"}, "campaign_type": {"type": "text", "index": 6, "name": "campaign_type", "comment": "The campaign type. Can be Blast or Triggered"}, "send_size": {"type": "integer", "index": 7, "name": "send_size", "comment": "Size of the campaign. Number of individuals included in the campaign"}, "start_at": {"type": "integer", "index": 8, "name": "start_at", "comment": "Start timestamp"}, "ended_at": {"type": "integer", "index": 9, "name": "ended_at", "comment": "Ended timestamp"}, "created_at": {"type": "text", "index": 10, "name": "created_at", "comment": "Creation timestamp"}, "created_by_user_id": {"type": "text", "index": 11, "name": "created_by_user_id", "comment": "Reference to the user who created the campaign"}, "template_id": {"type": "text", "index": 12, "name": "template_id", "comment": "Reference to the campaign template"}, "recurring_campaign_id": {"type": "text", "index": 13, "name": "recurring_campaign_id", "comment": "Unique identifier of the recurring campaign (if applicable)"}, "journey_id": {"type": "text", "index": 14, "name": "journey_id", "comment": "Reference to the journey the campaign belongs to, if applicable"}, "recurring_campaign_name": {"type": "text", "index": 15, "name": "recurring_campaign_name", "comment": "Name of the recurring campaign (if applicable)"}, "recurring_campaign_state": {"type": "text", "index": 16, "name": "recurring_campaign_state", "comment": "State of the recurring campaign (if applicable)"}, "recurring_campaign_send_size": {"type": "integer", "index": 17, "name": "recurring_campaign_send_size", "comment": "Size of the recurring campaign. Number of individuals included in the recurring campaign (if applicable)"}, "recurring_campaign_start_at": {"type": "integer", "index": 18, "name": "recurring_campaign_start_at", "comment": "Timestamp of when the recurring campaign started (if applicable)"}, "is_campaign_recurring": {"type": "boolean", "index": 19, "name": "is_campaign_recurring", "comment": "Boolean indicating if the campaign is a recurring campaign"}, "experiment_id": {"type": "integer", "index": 20, "name": "experiment_id", "comment": "Reference to the experiment used if the event is an experiment"}, "count_unique_users": {"type": "bigint", "index": 21, "name": "count_unique_users", "comment": "Count of total unique users within the campaign/experiment"}, "total_emailclick": {"type": "numeric", "index": 22, "name": "total_emailclick", "comment": "Total email clicks within the campaign/experiment"}, "unique_total_emailclick": {"type": "bigint", "index": 23, "name": "unique_total_emailclick", "comment": "Unique email clicks within the campaign/experiment"}, "total_emailunsubscribe": {"type": "numeric", "index": 24, "name": "total_emailunsubscribe", "comment": "Total email unsubscribe events within the campaign/experiment"}, "unique_total_emailunsubscribe": {"type": "bigint", "index": 25, "name": "unique_total_emailunsubscribe", "comment": "Unique total email unsubscribe events within the campaign/experiment"}, "total_emailcomplaint": {"type": "numeric", "index": 26, "name": "total_emailcomplaint", "comment": "Total email complaints within the campaign/experiment"}, "unique_total_emailcomplaint": {"type": "bigint", "index": 27, "name": "unique_total_emailcomplaint", "comment": "Unique total email complaints within the campaign/experiment"}, "total_customevent": {"type": "numeric", "index": 28, "name": "total_customevent", "comment": "Total custom events within the campaign/experiment"}, "unique_total_customevent": {"type": "bigint", "index": 29, "name": "unique_total_customevent", "comment": "Unique total custom events within the campaign/experiment"}, "total_emailsubscribe": {"type": "numeric", "index": 30, "name": "total_emailsubscribe", "comment": "Total email subscribe events within the campaign/experiment"}, "unique_total_emailsubscribe": {"type": "bigint", "index": 31, "name": "unique_total_emailsubscribe", "comment": "Unique total email subscribe events within the campaign/experiment"}, "total_emailopen": {"type": "numeric", "index": 32, "name": "total_emailopen", "comment": "Total email open events within the campaign/experiment"}, "unique_total_emailopen": {"type": "bigint", "index": 33, "name": "unique_total_emailopen", "comment": "Unique total email open events within the campaign/experiment"}, "total_pushsend": {"type": "numeric", "index": 34, "name": "total_pushsend", "comment": "Total push send event within the campaign/experiment"}, "unique_total_pushsend": {"type": "bigint", "index": 35, "name": "unique_total_pushsend", "comment": "Unique total push send events within the campaign/experiment"}, "total_smsbounce": {"type": "numeric", "index": 36, "name": "total_smsbounce", "comment": "Total sms bounce events within the campaign/experiment"}, "unique_total_smsbounce": {"type": "bigint", "index": 37, "name": "unique_total_smsbounce", "comment": "Unique total sms bounce events within the campaign/experiment"}, "total_pushbounce": {"type": "numeric", "index": 38, "name": "total_pushbounce", "comment": "Total push bounce events within the campaign/experiment"}, "unique_total_pushbounce": {"type": "bigint", "index": 39, "name": "unique_total_pushbounce", "comment": "Unique total push bounce events within the campaign/experiment"}, "total_inappsendskip": {"type": "numeric", "index": 40, "name": "total_inappsendskip", "comment": "Total in app send skip events within the campaign/experiment"}, "unique_total_inappsendskip": {"type": "bigint", "index": 41, "name": "unique_total_inappsendskip", "comment": "Unique total in app send skip events within the campaign/experiment"}, "total_smssend": {"type": "numeric", "index": 42, "name": "total_smssend", "comment": "Total sms send events within the campaign/experiment"}, "unique_total_smssend": {"type": "bigint", "index": 43, "name": "unique_total_smssend", "comment": "Unique total sms send events within the campaign/experiment"}, "total_inappsend": {"type": "numeric", "index": 44, "name": "total_inappsend", "comment": "Total in app send events within the campaign/experiment"}, "unique_total_inappsend": {"type": "bigint", "index": 45, "name": "unique_total_inappsend", "comment": "Unique total in app send events within the campaign/experiment"}, "total_pushopen": {"type": "numeric", "index": 46, "name": "total_pushopen", "comment": "Total push open events within the campaign/experiment"}, "unique_total_pushopen": {"type": "bigint", "index": 47, "name": "unique_total_pushopen", "comment": "Unique total push open events within the campaign/experiment"}, "total_emailsend": {"type": "numeric", "index": 48, "name": "total_emailsend", "comment": "Total email send events within the campaign/experiment"}, "unique_total_emailsend": {"type": "bigint", "index": 49, "name": "unique_total_emailsend", "comment": "Unique total email send events within the campaign/experiment"}, "total_pushsendskip": {"type": "numeric", "index": 50, "name": "total_pushsendskip", "comment": "Total push send skip events within the campaign/experiment"}, "unique_total_pushsendskip": {"type": "bigint", "index": 51, "name": "unique_total_pushsendskip", "comment": "Unique total push send skip events within the campaign/experiment"}, "total_inappopen": {"type": "numeric", "index": 52, "name": "total_inappopen", "comment": "Total in app open events within the campaign/experiment"}, "unique_total_inappopen": {"type": "bigint", "index": 53, "name": "unique_total_inappopen", "comment": "Unique total in app open events within the campaign/experiment"}, "total_emailsendskip": {"type": "numeric", "index": 54, "name": "total_emailsendskip", "comment": "Total email send skip events within the campaign/experiment"}, "unique_total_emailsendskip": {"type": "bigint", "index": 55, "name": "unique_total_emailsendskip", "comment": "Unique total email send skip events within the campaign/experiment"}, "total_emailbounce": {"type": "numeric", "index": 56, "name": "total_emailbounce", "comment": "Total email bounce events within the campaign/experiment"}, "unique_total_emailbounce": {"type": "bigint", "index": 57, "name": "unique_total_emailbounce", "comment": "Unique total email bounce events within the campaign/experiment"}, "total_inappclick": {"type": "numeric", "index": 58, "name": "total_inappclick", "comment": "Total in app click events within the campaign/experiment"}, "unique_total_inappclick": {"type": "bigint", "index": 59, "name": "unique_total_inappclick", "comment": "Unique total in app click events within the campaign/experiment"}, "total_pushuninstall": {"type": "numeric", "index": 60, "name": "total_pushuninstall", "comment": "Total push uninstall events within the campaign/experiment"}, "unique_total_pushuninstall": {"type": "bigint", "index": 61, "name": "unique_total_pushuninstall", "comment": "Unique total push uninstall events within the campaign/experiment"}, "count_send_lists": {"type": "bigint", "index": 62, "name": "count_send_lists", "comment": "Count of send lists within the campaign/experiment"}, "count_suppress_lists": {"type": "bigint", "index": 63, "name": "count_suppress_lists", "comment": "Count of suppress lists within the campaign/experiment"}, "labels": {"type": "text", "index": 64, "name": "labels", "comment": "List of labels associated with the campaign/experiment"}, "journey_name": {"type": "text", "index": 65, "name": "journey_name", "comment": "User defined name of the journey the campaign belongs to, if applicable"}, "journey_type": {"type": "text", "index": 66, "name": "journey_type", "comment": "The type of the journey the campaign belongs to, if applicable"}, "template_name": {"type": "text", "index": 67, "name": "template_name", "comment": "Name of the template associated with the campaign/experiment"}, "template_creator_user_id": {"type": "text", "index": 68, "name": "template_creator_user_id", "comment": "The creator user id of the template associated with the campaign/experiment"}, "message_medium": {"type": "text", "index": 69, "name": "message_medium", "comment": "The medium which the message was provided"}, "message_type_name": {"type": "text", "index": 70, "name": "message_type_name", "comment": "The message type name associated with the campaign/experiment"}, "channel_name": {"type": "text", "index": 71, "name": "channel_name", "comment": "The channel name associated with the campaign/experiment"}, "channel_id": {"type": "text", "index": 72, "name": "channel_id", "comment": "The channel identifier associated with the campaign/experiment"}, "channel_type": {"type": "text", "index": 73, "name": "channel_type", "comment": "The channel type associated with the campaign/experiment"}, "unique_campaign_version_id": {"type": "text", "index": 74, "name": "unique_campaign_version_id", "comment": "Unique identifier combining campaign_id, template_id, source_relation, and if available, experiment_id."}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.iterable__campaigns"}, "model.iterable.iterable__events": {"metadata": {"type": "BASE TABLE", "schema": "public_iterable_dev", "name": "iterable__events", "database": "postgres", "comment": "Table that provides a comprehensive view of all events with enriched information such as the campaign, user effected, and template used.", "owner": "postgres"}, "columns": {"source_relation": {"type": "text", "index": 1, "name": "source_relation", "comment": "Identifies the record's source."}, "event_id": {"type": "text", "index": 2, "name": "event_id", "comment": "Unique id of the event generated by Fivetran"}, "unique_event_id": {"type": "text", "index": 3, "name": "unique_event_id", "comment": "A unique surrogate key of event_id, _fivetran_user_id, and source_relation."}, "_fivetran_user_id": {"type": "text", "index": 4, "name": "_fivetran_user_id", "comment": "A Fivetran-created unique identifier for the new Iterable schema in Aug 2023, for users, derived from hashing user_id and/or email, depending on project type."}, "unique_user_key": {"type": "text", "index": 5, "name": "unique_user_key", "comment": "The unique identifier of the user. With the new schema (Aug 2023), it is the _fivetran_user_id. This is a hash of user_id and/or email, depending on project type. If using the old schema, it is email."}, "campaign_id": {"type": "text", "index": 6, "name": "campaign_id", "comment": "Reference to the campaign from which the event originated"}, "content_id": {"type": "text", "index": 7, "name": "content_id", "comment": "Reference to the content the event is associated with"}, "created_at": {"type": "timestamp without time zone", "index": 8, "name": "created_at", "comment": "Creation timestamp"}, "created_on": {"type": "date", "index": 9, "name": "created_on", "comment": "Day when the event was created"}, "email": {"type": "text", "index": 10, "name": "email", "comment": "The user's email. User identifier, for email-based projects. Previously was the unique identifier for user records, for the old Iterable schema before the August 2023 updates."}, "additional_properties": {"type": "text", "index": 11, "name": "additional_properties", "comment": "json object containing addition event properties"}, "event_name": {"type": "text", "index": 12, "name": "event_name", "comment": "Name provided to the individual event"}, "message_bus_id": {"type": "text", "index": 13, "name": "message_bus_id", "comment": "Reference to the message bus associated with the event"}, "message_id": {"type": "text", "index": 14, "name": "message_id", "comment": "Reference to the message the event is associated with"}, "message_type_id": {"type": "text", "index": 15, "name": "message_type_id", "comment": "Reference to the type of message the event is associated with"}, "recipient_state": {"type": "integer", "index": 16, "name": "recipient_state", "comment": "The state of the recipient upon receiving the event"}, "status": {"type": "integer", "index": 17, "name": "status", "comment": "Status of the event"}, "transactional_data": {"type": "character varying(100)", "index": 18, "name": "transactional_data", "comment": "Transactional data associated with the event"}, "unsub_source": {"type": "integer", "index": 19, "name": "unsub_source", "comment": "Source of the unsubscribe event"}, "user_agent": {"type": "integer", "index": 20, "name": "user_agent", "comment": "User agent associated with the event"}, "user_agent_device": {"type": "integer", "index": 21, "name": "user_agent_device", "comment": "The device of the user agent"}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 22, "name": "_fivetran_synced", "comment": "Timestamp of when the event record was synced by Fivetran"}, "campaign_name": {"type": "text", "index": 23, "name": "campaign_name", "comment": "The name of the campaign"}, "campaign_type": {"type": "text", "index": 24, "name": "campaign_type", "comment": "The type of campaign"}, "is_campaign_recurring": {"type": "boolean", "index": 25, "name": "is_campaign_recurring", "comment": "Boolean indicating if the campaign is recurrent"}, "recurring_campaign_name": {"type": "text", "index": 26, "name": "recurring_campaign_name", "comment": "The name of the recurring campaign (if applicable)"}, "recurring_campaign_id": {"type": "text", "index": 27, "name": "recurring_campaign_id", "comment": "The campaign if of the recurring campaign (if applicable)"}, "user_id": {"type": "text", "index": 28, "name": "user_id", "comment": "User identifier, for userID-based projects."}, "user_full_name": {"type": "text", "index": 29, "name": "user_full_name", "comment": "Full name of the user"}, "message_type_name": {"type": "text", "index": 30, "name": "message_type_name", "comment": "Name of the message type"}, "message_medium": {"type": "text", "index": 31, "name": "message_medium", "comment": "Medium of the message"}, "channel_id": {"type": "text", "index": 32, "name": "channel_id", "comment": "Unique identifier of the channel"}, "channel_name": {"type": "text", "index": 33, "name": "channel_name", "comment": "The channel name"}, "channel_type": {"type": "text", "index": 34, "name": "channel_type", "comment": "The type of channel"}, "is_app_already_running": {"type": "integer", "index": 35, "name": "is_app_already_running", "comment": "Boolean indicating if the app is already running"}, "badge": {"type": "integer", "index": 36, "name": "badge", "comment": "Badge associated with the event"}, "catalog_collection_count": {"type": "integer", "index": 37, "name": "catalog_collection_count", "comment": "The count of products or items collected in a catalog associated with the event."}, "catalog_lookup_count": {"type": "integer", "index": 38, "name": "catalog_lookup_count", "comment": "The count of times a catalog was looked up or queried during the event."}, "canonical_url_id": {"type": "text", "index": 39, "name": "canonical_url_id", "comment": "Reference to the url associated with the event"}, "is_content_available": {"type": "integer", "index": 40, "name": "is_content_available", "comment": "Content available from the event"}, "device": {"type": "integer", "index": 41, "name": "device", "comment": "The device associated with the event"}, "email_id": {"type": "text", "index": 42, "name": "email_id", "comment": "Reference to the email associated with the event"}, "email_subject": {"type": "text", "index": 43, "name": "email_subject", "comment": "Subject of the email associated with the event"}, "experiment_id": {"type": "integer", "index": 44, "name": "experiment_id", "comment": "Reference to the experiment used if the event is an experiment"}, "from_phone_number_id": {"type": "integer", "index": 45, "name": "from_phone_number_id", "comment": "Reference to the phone number which the event is from"}, "from_smssender_id": {"type": "integer", "index": 46, "name": "from_smssender_id", "comment": "Reference to the sms sender which the event is from"}, "link_id": {"type": "text", "index": 47, "name": "link_id", "comment": "Reference to the link associated with the event"}, "link_url": {"type": "integer", "index": 48, "name": "link_url", "comment": "Url of the link associated with the event"}, "locale": {"type": "integer", "index": 49, "name": "locale", "comment": "Locale associated with the event"}, "payload": {"type": "character varying(100)", "index": 50, "name": "payload", "comment": "Payload resulted from the event"}, "platform_endpoint": {"type": "integer", "index": 51, "name": "platform_endpoint", "comment": "The specific platform endpoint of the event"}, "push_message": {"type": "integer", "index": 52, "name": "push_message", "comment": "Boolean indicating if the event is a push message"}, "region": {"type": "text", "index": 53, "name": "region", "comment": "Region of the event"}, "sms_message": {"type": "integer", "index": 54, "name": "sms_message", "comment": "Boolean indicating if the event is an sms message"}, "to_phone_number": {"type": "integer", "index": 55, "name": "to_phone_number", "comment": "To phone number associated with the event"}, "url": {"type": "integer", "index": 56, "name": "url", "comment": "Url associated with the event"}, "workflow_id": {"type": "text", "index": 57, "name": "workflow_id", "comment": "Reference to the workflow which the event originated"}, "workflow_name": {"type": "text", "index": 58, "name": "workflow_name", "comment": "Name of the workflow which the event originated"}, "city": {"type": "text", "index": 59, "name": "city", "comment": "The city associated with the event, which could be the location of the recipient."}, "clicked_url": {"type": "text", "index": 60, "name": "clicked_url", "comment": "The URL that was clicked by the recipient in response to the marketing message."}, "country": {"type": "text", "index": 61, "name": "country", "comment": "The country associated with the event, which could be the location of the recipient."}, "error_code": {"type": "integer", "index": 62, "name": "error_code", "comment": "The error code or message indicating any issues or errors encountered during the event."}, "expires_at": {"type": "text", "index": 63, "name": "expires_at", "comment": "The date and time when the event or message is set to expire or become invalid."}, "from_phone_number": {"type": "integer", "index": 64, "name": "from_phone_number", "comment": "The phone number from which the SMS message was sent."}, "in_app_body": {"type": "text", "index": 65, "name": "in_app_body", "comment": "The content or body of an in-app message that was sent as part of the event."}, "is_sms_estimation": {"type": "boolean", "index": 66, "name": "is_sms_estimation", "comment": "A boolean indicating whether the SMS message is an estimation or not."}, "labels": {"type": "text", "index": 67, "name": "labels", "comment": "Any labels or tags associated with the event, which can be used for categorization or organization."}, "message_status": {"type": "text", "index": 68, "name": "message_status", "comment": "The status of the marketing message, such as sent, delivered, opened, etc."}, "mms_send_count": {"type": "integer", "index": 69, "name": "mms_send_count", "comment": "The count of multimedia messages (MMS) sent as part of the event."}, "reason": {"type": "text", "index": 70, "name": "reason", "comment": "The reason or cause associated with a specific event or action."}, "sms_send_count": {"type": "integer", "index": 71, "name": "sms_send_count", "comment": "The count of SMS messages sent as part of the event."}, "template_id": {"type": "text", "index": 72, "name": "template_id", "comment": "Unique identifier of the template"}, "template_name": {"type": "text", "index": 73, "name": "template_name", "comment": "User defined name of the template"}, "template_creator_user_id": {"type": "text", "index": 74, "name": "template_creator_user_id", "comment": "Reference to the user who created the template"}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.iterable__events"}, "model.iterable.iterable__journeys": {"metadata": {"type": "BASE TABLE", "schema": "public_iterable_dev", "name": "iterable__journeys", "database": "postgres", "comment": "Table that provides aggregations for journeys, formerly known as workflows. Metrics are rolled up from the user/campaign grain via each campaign's journey reference. Journeys which generate no events, such as those that only split audiences or update user fields, are still included with null metrics. The grain of this table is one record per journey.\n", "owner": "postgres"}, "columns": {"source_relation": {"type": "text", "index": 1, "name": "source_relation", "comment": "Identifies the record's source."}, "journey_id": {"type": "text", "index": 2, "name": "journey_id", "comment": "Unique identifier of the journey"}, "journey_name": {"type": "text", "index": 3, "name": "journey_name", "comment": "User defined name of the journey"}, "journey_type": {"type": "text", "index": 4, "name": "journey_type", "comment": "The journey type"}, "journey_description": {"type": "text", "index": 5, "name": "journey_description", "comment": "Information about the journey"}, "creator_user_id": {"type": "text", "index": 6, "name": "creator_user_id", "comment": "Reference to the user who created the journey"}, "is_enabled": {"type": "boolean", "index": 7, "name": "is_enabled", "comment": "Boolean indicating if the journey is currently enabled"}, "is_archived": {"type": "boolean", "index": 8, "name": "is_archived", "comment": "Boolean indicating if the journey has been archived"}, "lifetime_limit": {"type": "bigint", "index": 9, "name": "lifetime_limit", "comment": "Maximum number of times a user may enter the journey over their lifetime"}, "simultaneous_limit": {"type": "bigint", "index": 10, "name": "simultaneous_limit", "comment": "Maximum number of times a user may be in the journey at the same time"}, "start_tile_id": {"type": "text", "index": 11, "name": "start_tile_id", "comment": "Reference to the tile which begins the journey"}, "trigger_event_names": {"type": "text", "index": 12, "name": "trigger_event_names", "comment": "The event names which trigger a user's entry into the journey"}, "created_at": {"type": "timestamp without time zone", "index": 13, "name": "created_at", "comment": "Creation timestamp"}, "updated_at": {"type": "timestamp without time zone", "index": 14, "name": "updated_at", "comment": "Last update timestamp"}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 15, "name": "_fivetran_synced", "comment": "The time when a record was last updated by Fivetran."}, "count_total_campaigns": {"type": "bigint", "index": 16, "name": "count_total_campaigns", "comment": "Count of distinct campaigns within the journey that generated events"}, "count_unique_users": {"type": "bigint", "index": 17, "name": "count_unique_users", "comment": "Count of total unique users within the journey"}, "first_event_at": {"type": "timestamp without time zone", "index": 18, "name": "first_event_at", "comment": "Timestamp of the first event generated by any campaign in the journey"}, "last_event_at": {"type": "timestamp without time zone", "index": 19, "name": "last_event_at", "comment": "Timestamp of the most recent event generated by any campaign in the journey"}, "total_emailclick": {"type": "numeric", "index": 20, "name": "total_emailclick", "comment": "Total email clicks within the journey"}, "unique_total_emailclick": {"type": "bigint", "index": 21, "name": "unique_total_emailclick", "comment": "Count of distinct users with email clicks within the journey"}, "total_emailunsubscribe": {"type": "numeric", "index": 22, "name": "total_emailunsubscribe", "comment": "Total email unsubscribe events within the journey"}, "unique_total_emailunsubscribe": {"type": "bigint", "index": 23, "name": "unique_total_emailunsubscribe", "comment": "Count of distinct users with email unsubscribe events within the journey"}, "total_emailcomplaint": {"type": "numeric", "index": 24, "name": "total_emailcomplaint", "comment": "Total email complaints within the journey"}, "unique_total_emailcomplaint": {"type": "bigint", "index": 25, "name": "unique_total_emailcomplaint", "comment": "Count of distinct users with email complaints within the journey"}, "total_customevent": {"type": "numeric", "index": 26, "name": "total_customevent", "comment": "Total custom events within the journey"}, "unique_total_customevent": {"type": "bigint", "index": 27, "name": "unique_total_customevent", "comment": "Count of distinct users with custom events within the journey"}, "total_emailsubscribe": {"type": "numeric", "index": 28, "name": "total_emailsubscribe", "comment": "Total email subscribe events within the journey"}, "unique_total_emailsubscribe": {"type": "bigint", "index": 29, "name": "unique_total_emailsubscribe", "comment": "Count of distinct users with email subscribe events within the journey"}, "total_emailopen": {"type": "numeric", "index": 30, "name": "total_emailopen", "comment": "Total email open events within the journey"}, "unique_total_emailopen": {"type": "bigint", "index": 31, "name": "unique_total_emailopen", "comment": "Count of distinct users with email open events within the journey"}, "total_pushsend": {"type": "numeric", "index": 32, "name": "total_pushsend", "comment": "Total push send events within the journey"}, "unique_total_pushsend": {"type": "bigint", "index": 33, "name": "unique_total_pushsend", "comment": "Count of distinct users with push send events within the journey"}, "total_smsbounce": {"type": "numeric", "index": 34, "name": "total_smsbounce", "comment": "Total sms bounce events within the journey"}, "unique_total_smsbounce": {"type": "bigint", "index": 35, "name": "unique_total_smsbounce", "comment": "Count of distinct users with sms bounce events within the journey"}, "total_pushbounce": {"type": "numeric", "index": 36, "name": "total_pushbounce", "comment": "Total push bounce events within the journey"}, "unique_total_pushbounce": {"type": "bigint", "index": 37, "name": "unique_total_pushbounce", "comment": "Count of distinct users with push bounce events within the journey"}, "total_inappsendskip": {"type": "numeric", "index": 38, "name": "total_inappsendskip", "comment": "Total in app send skip events within the journey"}, "unique_total_inappsendskip": {"type": "bigint", "index": 39, "name": "unique_total_inappsendskip", "comment": "Count of distinct users with in app send skip events within the journey"}, "total_smssend": {"type": "numeric", "index": 40, "name": "total_smssend", "comment": "Total sms send events within the journey"}, "unique_total_smssend": {"type": "bigint", "index": 41, "name": "unique_total_smssend", "comment": "Count of distinct users with sms send events within the journey"}, "total_inappsend": {"type": "numeric", "index": 42, "name": "total_inappsend", "comment": "Total in app send events within the journey"}, "unique_total_inappsend": {"type": "bigint", "index": 43, "name": "unique_total_inappsend", "comment": "Count of distinct users with in app send events within the journey"}, "total_pushopen": {"type": "numeric", "index": 44, "name": "total_pushopen", "comment": "Total push open events within the journey"}, "unique_total_pushopen": {"type": "bigint", "index": 45, "name": "unique_total_pushopen", "comment": "Count of distinct users with push open events within the journey"}, "total_emailsend": {"type": "numeric", "index": 46, "name": "total_emailsend", "comment": "Total email send events within the journey"}, "unique_total_emailsend": {"type": "bigint", "index": 47, "name": "unique_total_emailsend", "comment": "Count of distinct users with email send events within the journey"}, "total_pushsendskip": {"type": "numeric", "index": 48, "name": "total_pushsendskip", "comment": "Total push send skip events within the journey"}, "unique_total_pushsendskip": {"type": "bigint", "index": 49, "name": "unique_total_pushsendskip", "comment": "Count of distinct users with push send skip events within the journey"}, "total_inappopen": {"type": "numeric", "index": 50, "name": "total_inappopen", "comment": "Total in app open events within the journey"}, "unique_total_inappopen": {"type": "bigint", "index": 51, "name": "unique_total_inappopen", "comment": "Count of distinct users with in app open events within the journey"}, "total_emailsendskip": {"type": "numeric", "index": 52, "name": "total_emailsendskip", "comment": "Total email send skip events within the journey"}, "unique_total_emailsendskip": {"type": "bigint", "index": 53, "name": "unique_total_emailsendskip", "comment": "Count of distinct users with email send skip events within the journey"}, "total_emailbounce": {"type": "numeric", "index": 54, "name": "total_emailbounce", "comment": "Total email bounce events within the journey"}, "unique_total_emailbounce": {"type": "bigint", "index": 55, "name": "unique_total_emailbounce", "comment": "Count of distinct users with email bounce events within the journey"}, "total_inappclick": {"type": "numeric", "index": 56, "name": "total_inappclick", "comment": "Total in app click events within the journey"}, "unique_total_inappclick": {"type": "bigint", "index": 57, "name": "unique_total_inappclick", "comment": "Count of distinct users with in app click events within the journey"}, "total_pushuninstall": {"type": "numeric", "index": 58, "name": "total_pushuninstall", "comment": "Total push uninstall events within the journey"}, "unique_total_pushuninstall": {"type": "bigint", "index": 59, "name": "unique_total_pushuninstall", "comment": "Count of distinct users with push uninstall events within the journey"}, "unique_journey_id": {"type": "text", "index": 60, "name": "unique_journey_id", "comment": "Unique identifier combining journey_id and source_relation."}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.iterable__journeys"}, "model.iterable.iterable__list_user_history": {"metadata": {"type": "BASE TABLE", "schema": "public_iterable_dev", "name": "iterable__list_user_history", "database": "postgres", "comment": "Table that recreates the `list_user_history` source table. Additionally, this table provides an `is_current` field to identify the current lists associated with the user. The table coalesces list_id values from both the direct list_user relationships and the unnested email_list_ids from user history to ensure comprehensive list coverage. The grain of this table is at the user/list/updated_at level.\n", "owner": "postgres"}, "columns": {"source_relation": {"type": "text", "index": 1, "name": "source_relation", "comment": "Identifies the record's source."}, "unique_user_key": {"type": "text", "index": 2, "name": "unique_user_key", "comment": "The unique identifier of the user. With the new schema (Aug 2023), it is the _fivetran_user_id. This is a hash of user_id and/or email, depending on project type. If using the old schema, it is email."}, "_fivetran_user_id": {"type": "text", "index": 3, "name": "_fivetran_user_id", "comment": "A Fivetran-created unique identifier for the new Iterable schema in Aug 2023, for users, derived from hashing user_id and/or email, depending on project type."}, "user_id": {"type": "text", "index": 4, "name": "user_id", "comment": "User identifier, for userID-based projects."}, "user_email": {"type": "text", "index": 5, "name": "user_email", "comment": "Email of the user if it exists."}, "user_first_name": {"type": "integer", "index": 6, "name": "user_first_name", "comment": "First name of the user"}, "user_last_name": {"type": "integer", "index": 7, "name": "user_last_name", "comment": "Last name of the user"}, "user_signup_date": {"type": "text", "index": 8, "name": "user_signup_date", "comment": "Timestamp of when the user signed up"}, "user_signup_source": {"type": "text", "index": 9, "name": "user_signup_source", "comment": "Source where the user signed up"}, "user_updated_at": {"type": "timestamp without time zone", "index": 10, "name": "user_updated_at", "comment": "Last update timestamp"}, "list_id": {"type": "bigint", "index": 11, "name": "list_id", "comment": "The list associated with the user. Uses coalesced values prioritizing `list_id` from `LIST_USER` over the unnested `email_list_ids` from `USER_HISTORY` for comprehensive list coverage."}, "is_current": {"type": "boolean", "index": 12, "name": "is_current", "comment": "Boolean indicating if the current list is active"}, "list_name": {"type": "text", "index": 13, "name": "list_name", "comment": "Name of the list associated with the user"}, "list_type": {"type": "text", "index": 14, "name": "list_type", "comment": "Type of list associated with the user"}, "list_created_at": {"type": "text", "index": 15, "name": "list_created_at", "comment": "Date the list was created"}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.iterable__list_user_history"}, "model.iterable.iterable__user_campaign": {"metadata": {"type": "BASE TABLE", "schema": "public_iterable_dev", "name": "iterable__user_campaign", "database": "postgres", "comment": "Table that provides total and unique metrics for a user associated with particular campaigns and if available, experiments.", "owner": "postgres"}, "columns": {"source_relation": {"type": "text", "index": 1, "name": "source_relation", "comment": "Identifies the record's source."}, "_fivetran_user_id": {"type": "text", "index": 2, "name": "_fivetran_user_id", "comment": "A Fivetran-created unique identifier for the new Iterable schema in Aug 2023, for users, derived from hashing user_id and/or email, depending on project type."}, "unique_user_key": {"type": "text", "index": 3, "name": "unique_user_key", "comment": "The unique identifier of the user. With the new schema (Aug 2023), it is the _fivetran_user_id. This is a hash of user_id and/or email, depending on project type. If using the old schema, it is email."}, "user_id": {"type": "text", "index": 4, "name": "user_id", "comment": "User identifier, for userID-based projects."}, "campaign_id": {"type": "text", "index": 5, "name": "campaign_id", "comment": "The unique identifier of the campaign which the user metrics are associated"}, "experiment_id": {"type": "integer", "index": 6, "name": "experiment_id", "comment": "The unique experiment variation of the campaign"}, "user_email": {"type": "text", "index": 7, "name": "user_email", "comment": "Email of the user if it exists."}, "user_full_name": {"type": "text", "index": 8, "name": "user_full_name", "comment": "The users first and last name"}, "campaign_name": {"type": "text", "index": 9, "name": "campaign_name", "comment": "The name of the campaign which the user metrics are associated"}, "template_id": {"type": "text", "index": 10, "name": "template_id", "comment": "The unique identifier of the template used within the campaign"}, "template_name": {"type": "text", "index": 11, "name": "template_name", "comment": "The name of the template used for the campaign"}, "recurring_campaign_id": {"type": "text", "index": 12, "name": "recurring_campaign_id", "comment": "The unique identifier of the recurring campaign which the campaign is tied to"}, "recurring_campaign_name": {"type": "text", "index": 13, "name": "recurring_campaign_name", "comment": "The name of the recurring campaign which the campaign is tied to"}, "first_event_at": {"type": "timestamp without time zone", "index": 14, "name": "first_event_at", "comment": "Timestamp of the first campaign/experiment event associated with the user"}, "last_event_at": {"type": "timestamp without time zone", "index": 15, "name": "last_event_at", "comment": "Timestamp of the most recent campaign/experiment event associated with the user"}, "first_open_or_click_event_at": {"type": "timestamp without time zone", "index": 16, "name": "first_open_or_click_event_at", "comment": "The time of the first open or click time. This is the first time a user interacts with a campaign, recording the earliest occurring event out of 'emailOpen', 'emailClick', and 'pushOpen'."}, "total_emailclick": {"type": "bigint", "index": 17, "name": "total_emailclick", "comment": "Total email clicks events the user took within the campaign/experiment"}, "total_emailunsubscribe": {"type": "bigint", "index": 18, "name": "total_emailunsubscribe", "comment": "Total email unsubscription events the user performed within the campaign/experiment"}, "total_emailcomplaint": {"type": "bigint", "index": 19, "name": "total_emailcomplaint", "comment": "Total email complaint events the user performed within the campaign/experiment"}, "total_customevent": {"type": "bigint", "index": 20, "name": "total_customevent", "comment": "Total custom events associated with the user within the campaign/experiment"}, "total_emailsubscribe": {"type": "bigint", "index": 21, "name": "total_emailsubscribe", "comment": "Total email subscription events associate with the user within the campaign/experiment"}, "total_emailopen": {"type": "bigint", "index": 22, "name": "total_emailopen", "comment": "Total email open events the user performed within the campaign/experiment"}, "total_pushsend": {"type": "bigint", "index": 23, "name": "total_pushsend", "comment": "Total push send events the user performed within the campaign/experiment"}, "total_smsbounce": {"type": "bigint", "index": 24, "name": "total_smsbounce", "comment": "Total sms bounce events associated with the user within the campaign/experiment"}, "total_pushbounce": {"type": "bigint", "index": 25, "name": "total_pushbounce", "comment": "Total push bounce events associated with the user within the campaign/experiment"}, "total_inappsendskip": {"type": "bigint", "index": 26, "name": "total_inappsendskip", "comment": "Total in app send skip events the user performed within the campaign/experiment"}, "total_smssend": {"type": "bigint", "index": 27, "name": "total_smssend", "comment": "Total sms send events associated with the user within the campaign/experiment"}, "total_inappsend": {"type": "bigint", "index": 28, "name": "total_inappsend", "comment": "Total in app send events associated with the user within the campaign/experiment"}, "total_pushopen": {"type": "bigint", "index": 29, "name": "total_pushopen", "comment": "Total push open events the user performed within the campaign/experiment"}, "total_emailsend": {"type": "bigint", "index": 30, "name": "total_emailsend", "comment": "Total email send event associated with the user within the campaign/experiment"}, "total_pushsendskip": {"type": "bigint", "index": 31, "name": "total_pushsendskip", "comment": "Total push send skip events associated with the user within the campaign/experiment"}, "total_inappopen": {"type": "bigint", "index": 32, "name": "total_inappopen", "comment": "Total in app open events associated with the user within the campaign/experiment"}, "total_emailsendskip": {"type": "bigint", "index": 33, "name": "total_emailsendskip", "comment": "Total email send skip events associated with the user within the campaign/experiment"}, "total_emailbounce": {"type": "bigint", "index": 34, "name": "total_emailbounce", "comment": "Total email bounce events associated with the user within the campaign/experiment"}, "total_inappclick": {"type": "bigint", "index": 35, "name": "total_inappclick", "comment": "Total in app click events associated with the user within the campaign/experiment"}, "total_pushuninstall": {"type": "bigint", "index": 36, "name": "total_pushuninstall", "comment": "Total push uninstall events associated with the user within the campaign/experiment"}, "unique_user_campaign_id": {"type": "text", "index": 37, "name": "unique_user_campaign_id", "comment": "Unique ID combining source_relation, unique_user_key, campaign_id, and if available, experiment_id."}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.iterable__user_campaign"}, "model.iterable.iterable__user_unsubscriptions": {"metadata": {"type": "BASE TABLE", "schema": "public_iterable_dev", "name": "iterable__user_unsubscriptions", "database": "postgres", "comment": "Table that generates the total channel and message types a user has chosen to unsubscribe.", "owner": "postgres"}, "columns": {"source_relation": {"type": "text", "index": 1, "name": "source_relation", "comment": "Identifies the record's source."}, "_fivetran_user_id": {"type": "text", "index": 2, "name": "_fivetran_user_id", "comment": "A Fivetran-created unique identifier for the new Iterable schema in Aug 2023, for users, derived from hashing user_id and/or email, depending on project type."}, "unique_user_key": {"type": "text", "index": 3, "name": "unique_user_key", "comment": "The unique identifier of the user. With the new schema (Aug 2023), it is the _fivetran_user_id. This is a hash of user_id and/or email, depending on project type. If using the old schema, it is email."}, "channel_id": {"type": "text", "index": 4, "name": "channel_id", "comment": "Unique identifier of the channel which the user is unsubscribed"}, "message_type_id": {"type": "text", "index": 5, "name": "message_type_id", "comment": "Unique identifier of the message type which the user is unsubscribed"}, "updated_at": {"type": "timestamp without time zone", "index": 6, "name": "updated_at", "comment": "Timestamp of when the user unsubscribed from the channel or message type"}, "channel_name": {"type": "text", "index": 7, "name": "channel_name", "comment": "The name of the channel which the user is unsubscribed"}, "message_type_name": {"type": "text", "index": 8, "name": "message_type_name", "comment": "The name of the message type which the user is unsubscribed"}, "channel_type": {"type": "text", "index": 9, "name": "channel_type", "comment": "The channel type which the user is unsubscribed"}, "message_medium": {"type": "text", "index": 10, "name": "message_medium", "comment": "The medium type the message was provided which the user is unsubscribed"}, "is_unsubscribed_channel_wide": {"type": "boolean", "index": 11, "name": "is_unsubscribed_channel_wide", "comment": "Boolean indicating if the user unsubscribed at the channel level (i.e. unsubscribed to all message types) or if they unsubscribed from only an individual message type.\n"}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.iterable__user_unsubscriptions"}, "model.iterable.iterable__users": {"metadata": {"type": "BASE TABLE", "schema": "public_iterable_dev", "name": "iterable__users", "database": "postgres", "comment": "Table that provides unique user enriched information.", "owner": "postgres"}, "columns": {"source_relation": {"type": "text", "index": 1, "name": "source_relation", "comment": "Identifies the record's source."}, "user_id": {"type": "text", "index": 2, "name": "user_id", "comment": "User identifier, for userID-based projects."}, "_fivetran_user_id": {"type": "text", "index": 3, "name": "_fivetran_user_id", "comment": "A Fivetran-created unique identifier for the new Iterable schema in Aug 2023, for users, derived from hashing user_id and/or email, depending on project type."}, "unique_user_key": {"type": "text", "index": 4, "name": "unique_user_key", "comment": "The unique identifier of the user. With the new schema (Aug 2023), it is the _fivetran_user_id. This is a hash of user_id and/or email, depending on project type. If using the old schema, it is email."}, "email": {"type": "text", "index": 5, "name": "email", "comment": "The user's email. User identifier, for email-based projects. Previously was the unique identifier for user records, for the old Iterable schema before the August 2023 updates."}, "first_name": {"type": "integer", "index": 6, "name": "first_name", "comment": "First name of the user"}, "last_name": {"type": "integer", "index": 7, "name": "last_name", "comment": "Last name of the user"}, "signup_date": {"type": "text", "index": 8, "name": "signup_date", "comment": "Timestamp of when the user signed up"}, "signup_source": {"type": "text", "index": 9, "name": "signup_source", "comment": "Source where the user signed up"}, "updated_at": {"type": "timestamp without time zone", "index": 10, "name": "updated_at", "comment": "Last update timestamp"}, "phone_number": {"type": "integer", "index": 11, "name": "phone_number", "comment": "Phone number associated with the user"}, "email_list_ids": {"type": "text", "index": 12, "name": "email_list_ids", "comment": "Array of all email lists associated with the user, derived from the list_user table relationships"}, "count_lists": {"type": "bigint", "index": 13, "name": "count_lists", "comment": "Total count of lists associated with the user"}, "count_total_campaigns": {"type": "bigint", "index": 14, "name": "count_total_campaigns", "comment": "Count of all campaigns the user has been in"}, "first_event_at": {"type": "timestamp without time zone", "index": 15, "name": "first_event_at", "comment": "The first event the user ever encountered"}, "last_event_at": {"type": "timestamp without time zone", "index": 16, "name": "last_event_at", "comment": "The most recent event the user has encountered"}, "total_emailclick": {"type": "numeric", "index": 17, "name": "total_emailclick", "comment": "Total number of email clicks the user has performed"}, "total_emailunsubscribe": {"type": "numeric", "index": 18, "name": "total_emailunsubscribe", "comment": "Total unsubscription events the user has performed"}, "total_emailcomplaint": {"type": "numeric", "index": 19, "name": "total_emailcomplaint", "comment": "Total email complaints the user has performed"}, "total_customevent": {"type": "numeric", "index": 20, "name": "total_customevent", "comment": "Total custom events associated with the user"}, "total_emailsubscribe": {"type": "numeric", "index": 21, "name": "total_emailsubscribe", "comment": "Total subscription events the user has performed"}, "total_emailopen": {"type": "numeric", "index": 22, "name": "total_emailopen", "comment": "Total email opened events the user has performed"}, "total_pushsend": {"type": "numeric", "index": 23, "name": "total_pushsend", "comment": "The push send events the user has experienced"}, "total_smsbounce": {"type": "numeric", "index": 24, "name": "total_smsbounce", "comment": "Total sms bounces that are associated with the user"}, "total_pushbounce": {"type": "numeric", "index": 25, "name": "total_pushbounce", "comment": "Total number of push bounces associated with the user"}, "total_inappsendskip": {"type": "numeric", "index": 26, "name": "total_inappsendskip", "comment": "Total in app send skips associated with the user"}, "total_smssend": {"type": "numeric", "index": 27, "name": "total_smssend", "comment": "Total sms sends that the user has experienced"}, "total_inappsend": {"type": "numeric", "index": 28, "name": "total_inappsend", "comment": "Total in app sends the user has experienced"}, "total_pushopen": {"type": "numeric", "index": 29, "name": "total_pushopen", "comment": "Total push messages the user has opened"}, "total_emailsend": {"type": "numeric", "index": 30, "name": "total_emailsend", "comment": "Total emails that have been sent to the user"}, "total_pushsendskip": {"type": "numeric", "index": 31, "name": "total_pushsendskip", "comment": "Total push sends the user has skipped"}, "total_inappopen": {"type": "numeric", "index": 32, "name": "total_inappopen", "comment": "Total in app opens the user has performed"}, "total_emailsendskip": {"type": "numeric", "index": 33, "name": "total_emailsendskip", "comment": "Total email sends the user has skipped"}, "total_emailbounce": {"type": "numeric", "index": 34, "name": "total_emailbounce", "comment": "Total number of emails that have bounced from the user"}, "total_inappclick": {"type": "numeric", "index": 35, "name": "total_inappclick", "comment": "Total in app clicks associated with the user"}, "total_pushuninstall": {"type": "numeric", "index": 36, "name": "total_pushuninstall", "comment": "Total push uninstall events the user has performed"}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.iterable__users"}, "model.iterable.stg_iterable__campaign_history": {"metadata": {"type": "BASE TABLE", "schema": "public_iterable_dev", "name": "stg_iterable__campaign_history", "database": "postgres", "comment": "Table containing a history of campaigns.", "owner": "postgres"}, "columns": {"source_relation": {"type": "text", "index": 1, "name": "source_relation", "comment": "Identifies the record's source."}, "campaign_id": {"type": "text", "index": 2, "name": "campaign_id", "comment": "Unique identifier of the campaign record"}, "updated_at": {"type": "text", "index": 3, "name": "updated_at", "comment": "Last update timestamp"}, "campaign_name": {"type": "text", "index": 4, "name": "campaign_name", "comment": "User defined name of the campaign."}, "campaign_state": {"type": "text", "index": 5, "name": "campaign_state", "comment": "State of the campaign. Can be Draft, Ready, Scheduled, Running, Finished, Starting, Aborted or Recurring"}, "campaign_type": {"type": "text", "index": 6, "name": "campaign_type", "comment": "The campaign type. Can be Blast or Triggered"}, "send_size": {"type": "integer", "index": 7, "name": "send_size", "comment": "Size of the campaign. Number of individuals included in the campaign"}, "start_at": {"type": "integer", "index": 8, "name": "start_at", "comment": "Start timestamp"}, "ended_at": {"type": "integer", "index": 9, "name": "ended_at", "comment": "Ended timestamp"}, "created_at": {"type": "text", "index": 10, "name": "created_at", "comment": "Creation timestamp"}, "message_medium": {"type": "text", "index": 11, "name": "message_medium", "comment": "The medium that this message was sent via, for example Email or InApp"}, "recurring_campaign_id": {"type": "text", "index": 12, "name": "recurring_campaign_id", "comment": "Reference to the recurring campaign, if applicable"}, "created_by_user_id": {"type": "text", "index": 13, "name": "created_by_user_id", "comment": "Reference to the user who created the campaign"}, "updated_by_user_id": {"type": "text", "index": 14, "name": "updated_by_user_id", "comment": "ID of the user who updated this record"}, "template_id": {"type": "text", "index": 15, "name": "template_id", "comment": "Reference to the campaign template"}, "workflow_id": {"type": "integer", "index": 16, "name": "workflow_id", "comment": "Reference to the workflow which the event originated"}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 17, "name": "_fivetran_synced", "comment": "The time when a record was last updated by Fivetran."}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.stg_iterable__campaign_history"}, "model.iterable.stg_iterable__campaign_history_tmp": {"metadata": {"type": "VIEW", "schema": "public_iterable_dev", "name": "stg_iterable__campaign_history_tmp", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"id": {"type": "integer", "index": 1, "name": "id", "comment": null}, "updated_at": {"type": "text", "index": 2, "name": "updated_at", "comment": null}, "template_id": {"type": "integer", "index": 3, "name": "template_id", "comment": null}, "recurring_campaign_id": {"type": "integer", "index": 4, "name": "recurring_campaign_id", "comment": null}, "campaign_state": {"type": "text", "index": 5, "name": "campaign_state", "comment": null}, "created_at": {"type": "text", "index": 6, "name": "created_at", "comment": null}, "created_by_user_id": {"type": "text", "index": 7, "name": "created_by_user_id", "comment": null}, "ended_at": {"type": "integer", "index": 8, "name": "ended_at", "comment": null}, "name": {"type": "text", "index": 9, "name": "name", "comment": null}, "send_size": {"type": "integer", "index": 10, "name": "send_size", "comment": null}, "start_at": {"type": "integer", "index": 11, "name": "start_at", "comment": null}, "type": {"type": "text", "index": 12, "name": "type", "comment": null}, "workflow_id": {"type": "integer", "index": 13, "name": "workflow_id", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 14, "name": "_fivetran_synced", "comment": null}, "updated_by_user_id": {"type": "integer", "index": 15, "name": "updated_by_user_id", "comment": null}, "message_medium": {"type": "text", "index": 16, "name": "message_medium", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.stg_iterable__campaign_history_tmp"}, "model.iterable.stg_iterable__campaign_label_history": {"metadata": {"type": "BASE TABLE", "schema": "public_iterable_dev", "name": "stg_iterable__campaign_label_history", "database": "postgres", "comment": "Table containing a history of labels.", "owner": "postgres"}, "columns": {"source_relation": {"type": "text", "index": 1, "name": "source_relation", "comment": "Identifies the record's source."}, "campaign_id": {"type": "text", "index": 2, "name": "campaign_id", "comment": "Reference to the campaign associated with the label"}, "label": {"type": "text", "index": 3, "name": "label", "comment": "Name of the label"}, "updated_at": {"type": "text", "index": 4, "name": "updated_at", "comment": "Last update timestamp"}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 5, "name": "_fivetran_synced", "comment": "The time when a record was last updated by Fivetran."}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.stg_iterable__campaign_label_history"}, "model.iterable.stg_iterable__campaign_label_history_tmp": {"metadata": {"type": "VIEW", "schema": "public_iterable_dev", "name": "stg_iterable__campaign_label_history_tmp", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"campaign_id": {"type": "integer", "index": 1, "name": "campaign_id", "comment": null}, "label": {"type": "text", "index": 2, "name": "label", "comment": null}, "updated_at": {"type": "text", "index": 3, "name": "updated_at", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 4, "name": "_fivetran_synced", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.stg_iterable__campaign_label_history_tmp"}, "model.iterable.stg_iterable__campaign_list_history": {"metadata": {"type": "BASE TABLE", "schema": "public_iterable_dev", "name": "stg_iterable__campaign_list_history", "database": "postgres", "comment": "Table containing a history of lists.", "owner": "postgres"}, "columns": {"source_relation": {"type": "text", "index": 1, "name": "source_relation", "comment": "Identifies the record's source."}, "campaign_id": {"type": "text", "index": 2, "name": "campaign_id", "comment": "Reference to the campaign associated with the label"}, "list_id": {"type": "text", "index": 3, "name": "list_id", "comment": "Reference to the list used"}, "updated_at": {"type": "text", "index": 4, "name": "updated_at", "comment": "Last update timestamp"}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 5, "name": "_fivetran_synced", "comment": "The time when a record was last updated by Fivetran."}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.stg_iterable__campaign_list_history"}, "model.iterable.stg_iterable__campaign_list_history_tmp": {"metadata": {"type": "VIEW", "schema": "public_iterable_dev", "name": "stg_iterable__campaign_list_history_tmp", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"list_id": {"type": "integer", "index": 1, "name": "list_id", "comment": null}, "campaign_id": {"type": "integer", "index": 2, "name": "campaign_id", "comment": null}, "updated_at": {"type": "text", "index": 3, "name": "updated_at", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 4, "name": "_fivetran_synced", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.stg_iterable__campaign_list_history_tmp"}, "model.iterable.stg_iterable__campaign_suppression_list_history": {"metadata": {"type": "BASE TABLE", "schema": "public_iterable_dev", "name": "stg_iterable__campaign_suppression_list_history", "database": "postgres", "comment": "Table containing a history of suppression lists.", "owner": "postgres"}, "columns": {"source_relation": {"type": "text", "index": 1, "name": "source_relation", "comment": "Identifies the record's source."}, "campaign_id": {"type": "text", "index": 2, "name": "campaign_id", "comment": "Reference to the campaign associated with the label"}, "suppressed_list_id": {"type": "text", "index": 3, "name": "suppressed_list_id", "comment": "Reference to the list used"}, "updated_at": {"type": "text", "index": 4, "name": "updated_at", "comment": "Last update timestamp"}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 5, "name": "_fivetran_synced", "comment": "The time when a record was last updated by Fivetran."}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.stg_iterable__campaign_suppression_list_history"}, "model.iterable.stg_iterable__campaign_suppression_list_history_tmp": {"metadata": {"type": "VIEW", "schema": "public_iterable_dev", "name": "stg_iterable__campaign_suppression_list_history_tmp", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"suppressed_list_id": {"type": "integer", "index": 1, "name": "suppressed_list_id", "comment": null}, "campaign_id": {"type": "integer", "index": 2, "name": "campaign_id", "comment": null}, "updated_at": {"type": "text", "index": 3, "name": "updated_at", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 4, "name": "_fivetran_synced", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.stg_iterable__campaign_suppression_list_history_tmp"}, "model.iterable.stg_iterable__channel": {"metadata": {"type": "BASE TABLE", "schema": "public_iterable_dev", "name": "stg_iterable__channel", "database": "postgres", "comment": "Table containing unique channels.", "owner": "postgres"}, "columns": {"source_relation": {"type": "text", "index": 1, "name": "source_relation", "comment": "Identifies the record's source."}, "channel_id": {"type": "text", "index": 2, "name": "channel_id", "comment": "Unique identifier of the channel"}, "channel_name": {"type": "text", "index": 3, "name": "channel_name", "comment": "User defined name of the channel"}, "channel_type": {"type": "text", "index": 4, "name": "channel_type", "comment": "The channel type"}, "message_medium": {"type": "text", "index": 5, "name": "message_medium", "comment": "The message medium associated with the channel"}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 6, "name": "_fivetran_synced", "comment": "The time when a record was last updated by Fivetran."}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.stg_iterable__channel"}, "model.iterable.stg_iterable__channel_tmp": {"metadata": {"type": "VIEW", "schema": "public_iterable_dev", "name": "stg_iterable__channel_tmp", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"id": {"type": "bigint", "index": 1, "name": "id", "comment": null}, "name": {"type": "text", "index": 2, "name": "name", "comment": null}, "channel_type": {"type": "text", "index": 3, "name": "channel_type", "comment": null}, "message_medium": {"type": "text", "index": 4, "name": "message_medium", "comment": null}, "_fivetran_deleted": {"type": "boolean", "index": 5, "name": "_fivetran_deleted", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 6, "name": "_fivetran_synced", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.stg_iterable__channel_tmp"}, "model.iterable.stg_iterable__event": {"metadata": {"type": "VIEW", "schema": "public_iterable_dev", "name": "stg_iterable__event", "database": "postgres", "comment": "Table containing individual events within campaigns.", "owner": "postgres"}, "columns": {"source_relation": {"type": "text", "index": 1, "name": "source_relation", "comment": "Identifies the record's source."}, "event_id": {"type": "text", "index": 2, "name": "event_id", "comment": "A Fivetran-created unique identifier derived from hashing campaign_id, created_at, and event_name."}, "unique_event_id": {"type": "text", "index": 3, "name": "unique_event_id", "comment": "A surrogate key made up of event_id, _fivetran_user_id, and source_relation."}, "_fivetran_user_id": {"type": "text", "index": 4, "name": "_fivetran_user_id", "comment": "A Fivetran-created unique identifier for users, derived from hashing user_id and/or email, depending on project type. This exists for users of the new schema starting Aug 2023. In the old schema, the unique identifier is email."}, "unique_user_key": {"type": "text", "index": 5, "name": "unique_user_key", "comment": "The unique identifier of the user. With the new schema (Aug 2023), it is the _fivetran_user_id. This is a hash of user_id and/or email, depending on project type. If using the old schema, it is email."}, "campaign_id": {"type": "text", "index": 6, "name": "campaign_id", "comment": "Reference to the campaign from which the event originated"}, "content_id": {"type": "text", "index": 7, "name": "content_id", "comment": "Reference to the content the event is associated with"}, "created_at": {"type": "timestamp without time zone", "index": 8, "name": "created_at", "comment": "Creation timestamp"}, "created_on": {"type": "date", "index": 9, "name": "created_on", "comment": "Creation date"}, "email": {"type": "text", "index": 10, "name": "email", "comment": "Reference to the unique user the event was applied to"}, "additional_properties": {"type": "text", "index": 11, "name": "additional_properties", "comment": "json object containing addition event properties"}, "event_name": {"type": "text", "index": 12, "name": "event_name", "comment": "Name provided to the individual event"}, "message_bus_id": {"type": "text", "index": 13, "name": "message_bus_id", "comment": "Reference to the message bus associated with the event"}, "message_id": {"type": "text", "index": 14, "name": "message_id", "comment": "Reference to the message the event is associated with"}, "message_type_id": {"type": "text", "index": 15, "name": "message_type_id", "comment": "Reference to the type of message the event is associated with"}, "recipient_state": {"type": "integer", "index": 16, "name": "recipient_state", "comment": "The state of the recipient upon receiving the event"}, "status": {"type": "integer", "index": 17, "name": "status", "comment": "Status of the event"}, "transactional_data": {"type": "character varying(100)", "index": 18, "name": "transactional_data", "comment": "Transactional data associated with the event"}, "unsub_source": {"type": "integer", "index": 19, "name": "unsub_source", "comment": "Source of the unsubscribe event"}, "user_agent": {"type": "integer", "index": 20, "name": "user_agent", "comment": "User agent associated with the event"}, "user_agent_device": {"type": "integer", "index": 21, "name": "user_agent_device", "comment": "The device of the user agent"}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 22, "name": "_fivetran_synced", "comment": "The time when a record was last updated by Fivetran."}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.stg_iterable__event"}, "model.iterable.stg_iterable__event_extension": {"metadata": {"type": "VIEW", "schema": "public_iterable_dev", "name": "stg_iterable__event_extension", "database": "postgres", "comment": "Table containing addition properties from the event table.", "owner": "postgres"}, "columns": {"source_relation": {"type": "text", "index": 1, "name": "source_relation", "comment": "Identifies the record's source."}, "event_id": {"type": "text", "index": 2, "name": "event_id", "comment": "A Fivetran-created unique identifier derived from hashing campaign_id, created_at, and event_name."}, "unique_event_id": {"type": "text", "index": 3, "name": "unique_event_id", "comment": "A surrogate key made up of event_id, _fivetran_user_id, and source_relation."}, "is_app_already_running": {"type": "integer", "index": 4, "name": "is_app_already_running", "comment": "Boolean indicating if the app is currently running or not"}, "badge": {"type": "integer", "index": 5, "name": "badge", "comment": "Badge associated with the event"}, "catalog_collection_count": {"type": "integer", "index": 6, "name": "catalog_collection_count", "comment": "The count of products or items collected in a catalog associated with the event."}, "catalog_lookup_count": {"type": "integer", "index": 7, "name": "catalog_lookup_count", "comment": "The count of times a catalog was looked up or queried during the event."}, "canonical_url_id": {"type": "text", "index": 8, "name": "canonical_url_id", "comment": "Reference to the url associated with the event"}, "is_content_available": {"type": "integer", "index": 9, "name": "is_content_available", "comment": "Content available from the event"}, "content_id": {"type": "text", "index": 10, "name": "content_id", "comment": "Reference to the content associated with the event"}, "device": {"type": "integer", "index": 11, "name": "device", "comment": "The device associated with the event"}, "email_id": {"type": "text", "index": 12, "name": "email_id", "comment": "Reference to the email associated with the event"}, "email_subject": {"type": "text", "index": 13, "name": "email_subject", "comment": "Subject of the email associated with the event"}, "experiment_id": {"type": "integer", "index": 14, "name": "experiment_id", "comment": "Reference to the experiment used if the event is an experiment"}, "from_phone_number_id": {"type": "integer", "index": 15, "name": "from_phone_number_id", "comment": "Reference to the phone number which the event is from"}, "from_smssender_id": {"type": "integer", "index": 16, "name": "from_smssender_id", "comment": "Reference to the sms sender which the event is from"}, "link_id": {"type": "text", "index": 17, "name": "link_id", "comment": "Reference to the link associated with the event"}, "link_url": {"type": "integer", "index": 18, "name": "link_url", "comment": "Url of the link associated with the event"}, "locale": {"type": "integer", "index": 19, "name": "locale", "comment": "Locale associated with the event"}, "payload": {"type": "character varying(100)", "index": 20, "name": "payload", "comment": "Payload resulted from the event"}, "platform_endpoint": {"type": "integer", "index": 21, "name": "platform_endpoint", "comment": "The specific platform endpoint of the event"}, "push_message": {"type": "integer", "index": 22, "name": "push_message", "comment": "Boolean indicating if the event is a push message"}, "region": {"type": "text", "index": 23, "name": "region", "comment": "Region of the event"}, "sms_message": {"type": "integer", "index": 24, "name": "sms_message", "comment": "Boolean indicating if the event is an sms message"}, "to_phone_number": {"type": "integer", "index": 25, "name": "to_phone_number", "comment": "To phone number associated with the event"}, "url": {"type": "integer", "index": 26, "name": "url", "comment": "Url associated with the event"}, "workflow_id": {"type": "text", "index": 27, "name": "workflow_id", "comment": "Reference to the workflow which the event originated"}, "workflow_name": {"type": "text", "index": 28, "name": "workflow_name", "comment": "Name of the workflow which the event originated"}, "city": {"type": "text", "index": 29, "name": "city", "comment": "The city associated with the event, which could be the location of the recipient."}, "clicked_url": {"type": "text", "index": 30, "name": "clicked_url", "comment": "The URL that was clicked by the recipient in response to the marketing message."}, "country": {"type": "text", "index": 31, "name": "country", "comment": "The country associated with the event, which could be the location of the recipient."}, "error_code": {"type": "integer", "index": 32, "name": "error_code", "comment": "The error code or message indicating any issues or errors encountered during the event."}, "expires_at": {"type": "text", "index": 33, "name": "expires_at", "comment": "The date and time when the event or message is set to expire or become invalid."}, "from_phone_number": {"type": "integer", "index": 34, "name": "from_phone_number", "comment": "The phone number from which the SMS message was sent."}, "in_app_body": {"type": "text", "index": 35, "name": "in_app_body", "comment": "The content or body of an in-app message that was sent as part of the event."}, "is_sms_estimation": {"type": "boolean", "index": 36, "name": "is_sms_estimation", "comment": "A boolean indicating whether the SMS message is an estimation or not."}, "labels": {"type": "text", "index": 37, "name": "labels", "comment": "Any labels or tags associated with the event, which can be used for categorization or organization."}, "message_status": {"type": "text", "index": 38, "name": "message_status", "comment": "The status of the marketing message, such as sent, delivered, opened, etc."}, "mms_send_count": {"type": "integer", "index": 39, "name": "mms_send_count", "comment": "The count of multimedia messages (MMS) sent as part of the event."}, "reason": {"type": "text", "index": 40, "name": "reason", "comment": "The reason or cause associated with a specific event or action."}, "sms_send_count": {"type": "integer", "index": 41, "name": "sms_send_count", "comment": "The count of SMS messages sent as part of the event."}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 42, "name": "_fivetran_synced", "comment": "The time when a record was last updated by Fivetran."}, "_fivetran_user_id": {"type": "text", "index": 43, "name": "_fivetran_user_id", "comment": "A Fivetran-created unique identifier for users, derived from hashing user_id and/or email, depending on project type. This exists for users of the new schema starting Aug 2023. In the old schema, the unique identifier is email."}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.stg_iterable__event_extension"}, "model.iterable.stg_iterable__event_extension_tmp": {"metadata": {"type": "VIEW", "schema": "public_iterable_dev", "name": "stg_iterable__event_extension_tmp", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"_fivetran_id": {"type": "text", "index": 1, "name": "_fivetran_id", "comment": null}, "app_already_running": {"type": "integer", "index": 2, "name": "app_already_running", "comment": null}, "badge": {"type": "integer", "index": 3, "name": "badge", "comment": null}, "canonical_url_id": {"type": "integer", "index": 4, "name": "canonical_url_id", "comment": null}, "content_available": {"type": "integer", "index": 5, "name": "content_available", "comment": null}, "content_id": {"type": "integer", "index": 6, "name": "content_id", "comment": null}, "device": {"type": "integer", "index": 7, "name": "device", "comment": null}, "email_id": {"type": "text", "index": 8, "name": "email_id", "comment": null}, "email_subject": {"type": "text", "index": 9, "name": "email_subject", "comment": null}, "experiment_id": {"type": "integer", "index": 10, "name": "experiment_id", "comment": null}, "from_phone_number_id": {"type": "integer", "index": 11, "name": "from_phone_number_id", "comment": null}, "from_smssender_id": {"type": "integer", "index": 12, "name": "from_smssender_id", "comment": null}, "image_url": {"type": "integer", "index": 13, "name": "image_url", "comment": null}, "is_ghost_push": {"type": "integer", "index": 14, "name": "is_ghost_push", "comment": null}, "link_id": {"type": "integer", "index": 15, "name": "link_id", "comment": null}, "link_url": {"type": "integer", "index": 16, "name": "link_url", "comment": null}, "platform_endpoint": {"type": "integer", "index": 17, "name": "platform_endpoint", "comment": null}, "push_message": {"type": "integer", "index": 18, "name": "push_message", "comment": null}, "region": {"type": "text", "index": 19, "name": "region", "comment": null}, "sms_message": {"type": "integer", "index": 20, "name": "sms_message", "comment": null}, "sound": {"type": "integer", "index": 21, "name": "sound", "comment": null}, "to_phone_number": {"type": "integer", "index": 22, "name": "to_phone_number", "comment": null}, "url": {"type": "integer", "index": 23, "name": "url", "comment": null}, "workflow_id": {"type": "integer", "index": 24, "name": "workflow_id", "comment": null}, "workflow_name": {"type": "text", "index": 25, "name": "workflow_name", "comment": null}, "locale": {"type": "integer", "index": 26, "name": "locale", "comment": null}, "deeplink_android": {"type": "integer", "index": 27, "name": "deeplink_android", "comment": null}, "deeplink_ios": {"type": "integer", "index": 28, "name": "deeplink_ios", "comment": null}, "payload": {"type": "character varying(100)", "index": 29, "name": "payload", "comment": null}, "sms_provider_response_status": {"type": "integer", "index": 30, "name": "sms_provider_response_status", "comment": null}, "sms_provider_response_message": {"type": "integer", "index": 31, "name": "sms_provider_response_message", "comment": null}, "sms_provider_response_code": {"type": "integer", "index": 32, "name": "sms_provider_response_code", "comment": null}, "sms_provider_response_more_info": {"type": "integer", "index": 33, "name": "sms_provider_response_more_info", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 34, "name": "_fivetran_synced", "comment": null}, "catalog_collection_count": {"type": "integer", "index": 35, "name": "catalog_collection_count", "comment": null}, "catalog_lookup_count": {"type": "integer", "index": 36, "name": "catalog_lookup_count", "comment": null}, "city": {"type": "text", "index": 37, "name": "city", "comment": null}, "clicked_url": {"type": "text", "index": 38, "name": "clicked_url", "comment": null}, "country": {"type": "text", "index": 39, "name": "country", "comment": null}, "error_code": {"type": "integer", "index": 40, "name": "error_code", "comment": null}, "expires_at": {"type": "text", "index": 41, "name": "expires_at", "comment": null}, "from_phone_number": {"type": "integer", "index": 42, "name": "from_phone_number", "comment": null}, "in_app_body": {"type": "text", "index": 43, "name": "in_app_body", "comment": null}, "is_sms_estimation": {"type": "boolean", "index": 44, "name": "is_sms_estimation", "comment": null}, "labels": {"type": "text", "index": 45, "name": "labels", "comment": null}, "message_context": {"type": "text", "index": 46, "name": "message_context", "comment": null}, "message_status": {"type": "text", "index": 47, "name": "message_status", "comment": null}, "mms_send_count": {"type": "integer", "index": 48, "name": "mms_send_count", "comment": null}, "product_recommendation_count": {"type": "integer", "index": 49, "name": "product_recommendation_count", "comment": null}, "proxy_source": {"type": "text", "index": 50, "name": "proxy_source", "comment": null}, "reason": {"type": "text", "index": 51, "name": "reason", "comment": null}, "sms_send_count": {"type": "integer", "index": 52, "name": "sms_send_count", "comment": null}, "web_push_body": {"type": "text", "index": 53, "name": "web_push_body", "comment": null}, "web_push_click_action": {"type": "text", "index": 54, "name": "web_push_click_action", "comment": null}, "web_push_icon": {"type": "text", "index": 55, "name": "web_push_icon", "comment": null}, "web_push_message": {"type": "text", "index": 56, "name": "web_push_message", "comment": null}, "_fivetran_user_id": {"type": "integer", "index": 57, "name": "_fivetran_user_id", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.stg_iterable__event_extension_tmp"}, "model.iterable.stg_iterable__event_tmp": {"metadata": {"type": "VIEW", "schema": "public_iterable_dev", "name": "stg_iterable__event_tmp", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"_fivetran_id": {"type": "text", "index": 1, "name": "_fivetran_id", "comment": null}, "email": {"type": "text", "index": 2, "name": "email", "comment": null}, "campaign_id": {"type": "integer", "index": 3, "name": "campaign_id", "comment": null}, "message_id": {"type": "integer", "index": 4, "name": "message_id", "comment": null}, "content_id": {"type": "integer", "index": 5, "name": "content_id", "comment": null}, "created_at": {"type": "timestamp without time zone", "index": 6, "name": "created_at", "comment": null}, "event_name": {"type": "text", "index": 7, "name": "event_name", "comment": null}, "ip": {"type": "integer", "index": 8, "name": "ip", "comment": null}, "message_bus_id": {"type": "integer", "index": 9, "name": "message_bus_id", "comment": null}, "message_type_id": {"type": "integer", "index": 10, "name": "message_type_id", "comment": null}, "recipient_state": {"type": "integer", "index": 11, "name": "recipient_state", "comment": null}, "status": {"type": "integer", "index": 12, "name": "status", "comment": null}, "unsub_source": {"type": "integer", "index": 13, "name": "unsub_source", "comment": null}, "user_agent": {"type": "integer", "index": 14, "name": "user_agent", "comment": null}, "user_agent_device": {"type": "integer", "index": 15, "name": "user_agent_device", "comment": null}, "transactional_data": {"type": "character varying(100)", "index": 16, "name": "transactional_data", "comment": null}, "additional_properties": {"type": "text", "index": 17, "name": "additional_properties", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 18, "name": "_fivetran_synced", "comment": null}, "_fivetran_user_id": {"type": "integer", "index": 19, "name": "_fivetran_user_id", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.stg_iterable__event_tmp"}, "model.iterable.stg_iterable__journey": {"metadata": {"type": "BASE TABLE", "schema": "public_iterable_dev", "name": "stg_iterable__journey", "database": "postgres", "comment": "Table containing unique journeys, formerly known as workflows.", "owner": "postgres"}, "columns": {"source_relation": {"type": "text", "index": 1, "name": "source_relation", "comment": "Identifies the record's source."}, "journey_id": {"type": "text", "index": 2, "name": "journey_id", "comment": "Unique identifier of the journey"}, "journey_name": {"type": "text", "index": 3, "name": "journey_name", "comment": "User defined name of the journey"}, "journey_type": {"type": "text", "index": 4, "name": "journey_type", "comment": "Whether the journey is published or a draft"}, "journey_description": {"type": "text", "index": 5, "name": "journey_description", "comment": "Information about the journey"}, "creator_user_id": {"type": "text", "index": 6, "name": "creator_user_id", "comment": "Reference to the user who created the journey"}, "is_enabled": {"type": "boolean", "index": 7, "name": "is_enabled", "comment": "Boolean indicating if the journey is currently enabled"}, "is_archived": {"type": "boolean", "index": 8, "name": "is_archived", "comment": "Boolean indicating if the journey has been archived"}, "lifetime_limit": {"type": "bigint", "index": 9, "name": "lifetime_limit", "comment": "Maximum number of times a user may enter the journey over their lifetime"}, "simultaneous_limit": {"type": "bigint", "index": 10, "name": "simultaneous_limit", "comment": "Maximum number of times a user may be in the journey at the same time"}, "start_tile_id": {"type": "text", "index": 11, "name": "start_tile_id", "comment": "Reference to the tile which begins the journey"}, "trigger_event_names": {"type": "text", "index": 12, "name": "trigger_event_names", "comment": "The event names which trigger a user's entry into the journey"}, "created_at": {"type": "timestamp without time zone", "index": 13, "name": "created_at", "comment": "Creation timestamp"}, "updated_at": {"type": "timestamp without time zone", "index": 14, "name": "updated_at", "comment": "Last update timestamp"}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 15, "name": "_fivetran_synced", "comment": "The time when a record was last updated by Fivetran."}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.stg_iterable__journey"}, "model.iterable.stg_iterable__journey_tmp": {"metadata": {"type": "VIEW", "schema": "public_iterable_dev", "name": "stg_iterable__journey_tmp", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"id": {"type": "bigint", "index": 1, "name": "id", "comment": null}, "name": {"type": "text", "index": 2, "name": "name", "comment": null}, "journey_type": {"type": "text", "index": 3, "name": "journey_type", "comment": null}, "description": {"type": "text", "index": 4, "name": "description", "comment": null}, "creator_user_id": {"type": "text", "index": 5, "name": "creator_user_id", "comment": null}, "enabled": {"type": "boolean", "index": 6, "name": "enabled", "comment": null}, "is_archived": {"type": "boolean", "index": 7, "name": "is_archived", "comment": null}, "lifetime_limit": {"type": "bigint", "index": 8, "name": "lifetime_limit", "comment": null}, "simultaneous_limit": {"type": "bigint", "index": 9, "name": "simultaneous_limit", "comment": null}, "start_tile_id": {"type": "bigint", "index": 10, "name": "start_tile_id", "comment": null}, "trigger_event_names": {"type": "text", "index": 11, "name": "trigger_event_names", "comment": null}, "created_at": {"type": "timestamp without time zone", "index": 12, "name": "created_at", "comment": null}, "updated_at": {"type": "timestamp without time zone", "index": 13, "name": "updated_at", "comment": null}, "_fivetran_deleted": {"type": "boolean", "index": 14, "name": "_fivetran_deleted", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 15, "name": "_fivetran_synced", "comment": null}, "draft_name": {"type": "text", "index": 16, "name": "draft_name", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.stg_iterable__journey_tmp"}, "model.iterable.stg_iterable__list": {"metadata": {"type": "BASE TABLE", "schema": "public_iterable_dev", "name": "stg_iterable__list", "database": "postgres", "comment": "Table containing users and the lists the users are associated with.", "owner": "postgres"}, "columns": {"source_relation": {"type": "text", "index": 1, "name": "source_relation", "comment": "Identifies the record's source."}, "list_id": {"type": "integer", "index": 2, "name": "list_id", "comment": "Unique identifier of the list"}, "list_name": {"type": "text", "index": 3, "name": "list_name", "comment": "User defined name of the list"}, "list_type": {"type": "text", "index": 4, "name": "list_type", "comment": "The list type"}, "created_at": {"type": "text", "index": 5, "name": "created_at", "comment": "Creation timestamp"}, "list_description": {"type": "text", "index": 6, "name": "list_description", "comment": "Information about the list"}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 7, "name": "_fivetran_synced", "comment": "The time when a record was last updated by Fivetran."}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.stg_iterable__list"}, "model.iterable.stg_iterable__list_tmp": {"metadata": {"type": "VIEW", "schema": "public_iterable_dev", "name": "stg_iterable__list_tmp", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"id": {"type": "integer", "index": 1, "name": "id", "comment": null}, "name": {"type": "text", "index": 2, "name": "name", "comment": null}, "created_at": {"type": "text", "index": 3, "name": "created_at", "comment": null}, "list_type": {"type": "text", "index": 4, "name": "list_type", "comment": null}, "_fivetran_deleted": {"type": "boolean", "index": 5, "name": "_fivetran_deleted", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 6, "name": "_fivetran_synced", "comment": null}, "description": {"type": "text", "index": 7, "name": "description", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.stg_iterable__list_tmp"}, "model.iterable.stg_iterable__list_user": {"metadata": {"type": "BASE TABLE", "schema": "public_iterable_dev", "name": "stg_iterable__list_user", "database": "postgres", "comment": "Table containing the relationship between users and lists they belong to.", "owner": "postgres"}, "columns": {"source_relation": {"type": "text", "index": 1, "name": "source_relation", "comment": "Identifies the record's source."}, "_fivetran_user_id": {"type": "text", "index": 2, "name": "_fivetran_user_id", "comment": "Unique identifier of the list-user relationship record, serving as a foreign key to `stg_iterable__user_history._fivetran_id`."}, "list_user_index": {"type": "bigint", "index": 3, "name": "list_user_index", "comment": "Index of the record"}, "list_id": {"type": "bigint", "index": 4, "name": "list_id", "comment": "Reference to the list that the user belongs to"}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 5, "name": "_fivetran_synced", "comment": "The time when a record was last updated by Fivetran."}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.stg_iterable__list_user"}, "model.iterable.stg_iterable__list_user_tmp": {"metadata": {"type": "VIEW", "schema": "public_iterable_dev", "name": "stg_iterable__list_user_tmp", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"_fivetran_id": {"type": "text", "index": 1, "name": "_fivetran_id", "comment": null}, "index": {"type": "bigint", "index": 2, "name": "index", "comment": null}, "list_id": {"type": "bigint", "index": 3, "name": "list_id", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 4, "name": "_fivetran_synced", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.stg_iterable__list_user_tmp"}, "model.iterable.stg_iterable__message_type": {"metadata": {"type": "BASE TABLE", "schema": "public_iterable_dev", "name": "stg_iterable__message_type", "database": "postgres", "comment": "Table containing unique message types.", "owner": "postgres"}, "columns": {"source_relation": {"type": "text", "index": 1, "name": "source_relation", "comment": "Identifies the record's source."}, "message_type_id": {"type": "text", "index": 2, "name": "message_type_id", "comment": "Unique identifier of the message type"}, "message_type_name": {"type": "text", "index": 3, "name": "message_type_name", "comment": "User defined name of the message type"}, "channel_id": {"type": "text", "index": 4, "name": "channel_id", "comment": "Channel that this message type belongs to"}, "message_type_created_at": {"type": "timestamp without time zone", "index": 5, "name": "message_type_created_at", "comment": "Time when the message type was initially created"}, "frequency_cap": {"type": "integer", "index": 6, "name": "frequency_cap", "comment": "The maximum number of times a message of this type can be sent to a recipient within a specified time period to prevent over-messaging"}, "rate_limit_per_minute": {"type": "integer", "index": 7, "name": "rate_limit_per_minute", "comment": "The maximum number of messages of this type that can be sent to recipients in a minute, ensuring controlled message delivery"}, "subscription_policy": {"type": "text", "index": 8, "name": "subscription_policy", "comment": "Information about the policy or rules governing how users can subscribe to or unsubscribe from this specific message type, like OptOut"}, "message_type_updated_at": {"type": "timestamp without time zone", "index": 9, "name": "message_type_updated_at", "comment": "Time when the message type was last updated or modified"}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 10, "name": "_fivetran_synced", "comment": "The time when a record was last updated by Fivetran."}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.stg_iterable__message_type"}, "model.iterable.stg_iterable__message_type_tmp": {"metadata": {"type": "VIEW", "schema": "public_iterable_dev", "name": "stg_iterable__message_type_tmp", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"id": {"type": "bigint", "index": 1, "name": "id", "comment": null}, "name": {"type": "text", "index": 2, "name": "name", "comment": null}, "channel_id": {"type": "bigint", "index": 3, "name": "channel_id", "comment": null}, "_fivetran_deleted": {"type": "boolean", "index": 4, "name": "_fivetran_deleted", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 5, "name": "_fivetran_synced", "comment": null}, "created_at": {"type": "timestamp without time zone", "index": 6, "name": "created_at", "comment": null}, "frequency_cap": {"type": "integer", "index": 7, "name": "frequency_cap", "comment": null}, "rate_limit_per_minute": {"type": "integer", "index": 8, "name": "rate_limit_per_minute", "comment": null}, "subscription_policy": {"type": "text", "index": 9, "name": "subscription_policy", "comment": null}, "updated_at": {"type": "timestamp without time zone", "index": 10, "name": "updated_at", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.stg_iterable__message_type_tmp"}, "model.iterable.stg_iterable__template_history": {"metadata": {"type": "BASE TABLE", "schema": "public_iterable_dev", "name": "stg_iterable__template_history", "database": "postgres", "comment": "Table containing unique templates used across campaigns.", "owner": "postgres"}, "columns": {"source_relation": {"type": "text", "index": 1, "name": "source_relation", "comment": "Identifies the record's source."}, "template_id": {"type": "text", "index": 2, "name": "template_id", "comment": "Unique identifier of the template"}, "template_name": {"type": "text", "index": 3, "name": "template_name", "comment": "User defined name of the template"}, "template_type": {"type": "text", "index": 4, "name": "template_type", "comment": "The type of the template"}, "created_at": {"type": "text", "index": 5, "name": "created_at", "comment": "Creation timestamp"}, "client_template_id": {"type": "text", "index": 6, "name": "client_template_id", "comment": "Reference to the client template"}, "creator_user_id": {"type": "text", "index": 7, "name": "creator_user_id", "comment": "Reference to the user who created the template"}, "message_type_id": {"type": "text", "index": 8, "name": "message_type_id", "comment": "Reference to the message type associated with the template"}, "updated_at": {"type": "text", "index": 9, "name": "updated_at", "comment": "Last update timestamp"}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 10, "name": "_fivetran_synced", "comment": "The time when a record was last updated by Fivetran."}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.stg_iterable__template_history"}, "model.iterable.stg_iterable__template_history_tmp": {"metadata": {"type": "VIEW", "schema": "public_iterable_dev", "name": "stg_iterable__template_history_tmp", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"id": {"type": "integer", "index": 1, "name": "id", "comment": null}, "updated_at": {"type": "text", "index": 2, "name": "updated_at", "comment": null}, "message_type_id": {"type": "integer", "index": 3, "name": "message_type_id", "comment": null}, "client_template_id": {"type": "integer", "index": 4, "name": "client_template_id", "comment": null}, "created_at": {"type": "text", "index": 5, "name": "created_at", "comment": null}, "creator_user_id": {"type": "text", "index": 6, "name": "creator_user_id", "comment": null}, "name": {"type": "text", "index": 7, "name": "name", "comment": null}, "template_type": {"type": "text", "index": 8, "name": "template_type", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 9, "name": "_fivetran_synced", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.stg_iterable__template_history_tmp"}, "model.iterable.stg_iterable__user_history": {"metadata": {"type": "VIEW", "schema": "public_iterable_dev", "name": "stg_iterable__user_history", "database": "postgres", "comment": "Table containing individual user history information.", "owner": "postgres"}, "columns": {"source_relation": {"type": "text", "index": 1, "name": "source_relation", "comment": "Identifies the record's source."}, "_fivetran_user_id": {"type": "text", "index": 2, "name": "_fivetran_user_id", "comment": "A Fivetran-created unique identifier for users, derived from hashing user_id and/or email, depending on project type. This exists for users of the new schema starting Aug 2023. In the old schema, the unique identifier is email."}, "email": {"type": "text", "index": 3, "name": "email", "comment": "The user's email. User identifier, for email-based projects. Previously was the unique identifier for user records, for the old Iterable schema before the August 2023 updates."}, "updated_at": {"type": "timestamp without time zone", "index": 4, "name": "updated_at", "comment": "Last update timestamp"}, "user_id": {"type": "text", "index": 5, "name": "user_id", "comment": "User identifier, for userID-based projects."}, "first_name": {"type": "integer", "index": 6, "name": "first_name", "comment": "First name of the user"}, "last_name": {"type": "integer", "index": 7, "name": "last_name", "comment": "Last name of the user"}, "email_list_ids": {"type": "text", "index": 8, "name": "email_list_ids", "comment": "[DEPRECATED October 13, 2025. Use LIST_USER source instead.] Array of references to the lists associated with the user.\n"}, "phone_number": {"type": "integer", "index": 9, "name": "phone_number", "comment": "Phone number associated with the user"}, "signup_date": {"type": "text", "index": 10, "name": "signup_date", "comment": "Timestamp of when the user signed up"}, "signup_source": {"type": "text", "index": 11, "name": "signup_source", "comment": "Source where the user signed up"}, "iterable_user_id": {"type": "text", "index": 12, "name": "iterable_user_id", "comment": "Another user identifier, for userID-based projects"}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 13, "name": "_fivetran_synced", "comment": "The time when a record was last updated by Fivetran."}, "unique_user_key": {"type": "text", "index": 14, "name": "unique_user_key", "comment": "The unique identifier of the user. With the new schema (Aug 2023), it is the _fivetran_user_id. This is a hash of user_id and/or email, depending on project type. If using the old schema, it is email."}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.stg_iterable__user_history"}, "model.iterable.stg_iterable__user_history_tmp": {"metadata": {"type": "VIEW", "schema": "public_iterable_dev", "name": "stg_iterable__user_history_tmp", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"email": {"type": "text", "index": 1, "name": "email", "comment": null}, "updated_at": {"type": "timestamp without time zone", "index": 2, "name": "updated_at", "comment": null}, "first_name": {"type": "integer", "index": 3, "name": "first_name", "comment": null}, "last_name": {"type": "integer", "index": 4, "name": "last_name", "comment": null}, "phone_number": {"type": "integer", "index": 5, "name": "phone_number", "comment": null}, "user_id": {"type": "integer", "index": 6, "name": "user_id", "comment": null}, "signup_date": {"type": "text", "index": 7, "name": "signup_date", "comment": null}, "signup_source": {"type": "text", "index": 8, "name": "signup_source", "comment": null}, "phone_number_carrier": {"type": "integer", "index": 9, "name": "phone_number_carrier", "comment": null}, "phone_number_country_code_iso": {"type": "integer", "index": 10, "name": "phone_number_country_code_iso", "comment": null}, "phone_number_line_type": {"type": "integer", "index": 11, "name": "phone_number_line_type", "comment": null}, "phone_number_updated_at": {"type": "integer", "index": 12, "name": "phone_number_updated_at", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 13, "name": "_fivetran_synced", "comment": null}, "email_list_ids": {"type": "text", "index": 14, "name": "email_list_ids", "comment": null}, "iterable_user_id": {"type": "integer", "index": 15, "name": "iterable_user_id", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.stg_iterable__user_history_tmp"}, "model.iterable.stg_iterable__user_unsub_message_type": {"metadata": {"type": "BASE TABLE", "schema": "public_iterable_dev", "name": "stg_iterable__user_unsub_message_type", "database": "postgres", "comment": "Table containing the message types from which a user has unsubscribed. \"Unsubscribed\" is shortened to \"unsub\" for postgres compatibility.", "owner": "postgres"}, "columns": {"source_relation": {"type": "text", "index": 1, "name": "source_relation", "comment": "Identifies the record's source."}, "_fivetran_user_id": {"type": "text", "index": 2, "name": "_fivetran_user_id", "comment": "A Fivetran-created unique identifier for users, derived from hashing user_id and/or email, depending on project type. This exists for users of the new schema starting Aug 2023. In the old schema, the unique identifier is email."}, "unique_user_key": {"type": "text", "index": 3, "name": "unique_user_key", "comment": "The unique identifier of the user. With the new schema (Aug 2023), it is the _fivetran_user_id. This is a hash of user_id and/or email, depending on project type. If using the old schema, it is email."}, "message_type_id": {"type": "text", "index": 4, "name": "message_type_id", "comment": "Reference to the message type from which the user unsubscribed"}, "unsub_message_type_unique_key": {"type": "text", "index": 5, "name": "unsub_message_type_unique_key", "comment": "A surrogate key providing a unique key for each record. If using user_unsubscribed_message_type_history, it uses '_fivetran_id', 'email', 'message_type_id', 'updated_at', and 'source_relation'. If not using the history table, it uses '_fivetran_id', 'message_type_id', and 'source_relation'."}, "latest_batch_index": {"type": "integer", "index": 6, "name": "latest_batch_index", "comment": "Indexes each user record based on the most recent available."}, "updated_at": {"type": "timestamp without time zone", "index": 7, "name": "updated_at", "comment": "Last update timestamp"}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 8, "name": "_fivetran_synced", "comment": "The time when a record was last updated by Fivetran."}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.stg_iterable__user_unsub_message_type"}, "model.iterable.stg_iterable__user_unsub_message_type_tmp": {"metadata": {"type": "VIEW", "schema": "public_iterable_dev", "name": "stg_iterable__user_unsub_message_type_tmp", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"_fivetran_id": {"type": "text", "index": 1, "name": "_fivetran_id", "comment": null}, "message_type_id": {"type": "integer", "index": 2, "name": "message_type_id", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 3, "name": "_fivetran_synced", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.stg_iterable__user_unsub_message_type_tmp"}, "model.iterable.stg_iterable__user_unsubscribed_channel": {"metadata": {"type": "BASE TABLE", "schema": "public_iterable_dev", "name": "stg_iterable__user_unsubscribed_channel", "database": "postgres", "comment": "Table containing the history of channels from which a user has unsubscribed.", "owner": "postgres"}, "columns": {"source_relation": {"type": "text", "index": 1, "name": "source_relation", "comment": "Identifies the record's source."}, "_fivetran_user_id": {"type": "text", "index": 2, "name": "_fivetran_user_id", "comment": "A Fivetran-created unique identifier for users, derived from hashing user_id and/or email, depending on project type. This exists for users of the new schema starting Aug 2023. In the old schema, the unique identifier is email."}, "unique_user_key": {"type": "text", "index": 3, "name": "unique_user_key", "comment": "The unique identifier of the user. With the new schema (Aug 2023), it is the _fivetran_user_id. This is a hash of user_id and/or email, depending on project type. If using the old schema, it is email."}, "channel_id": {"type": "text", "index": 4, "name": "channel_id", "comment": "Reference to the channel from which the user unsubscribed"}, "unsub_channel_unique_key": {"type": "text", "index": 5, "name": "unsub_channel_unique_key", "comment": "A surrogate key providing a unique key for each record. If using user_unsubscribed_channel_history, it uses '_fivetran_id', 'channel_id', 'email', 'updated_at', and 'source_relation'. If not using the history table, it uses '_fivetran_id', 'channel_id', and 'source_relation'."}, "latest_batch_index": {"type": "integer", "index": 6, "name": "latest_batch_index", "comment": "Indexes each user record based on the most recent available."}, "updated_at": {"type": "timestamp without time zone", "index": 7, "name": "updated_at", "comment": "Last update timestamp"}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 8, "name": "_fivetran_synced", "comment": "The time when a record was last updated by Fivetran."}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.stg_iterable__user_unsubscribed_channel"}, "model.iterable.stg_iterable__user_unsubscribed_channel_tmp": {"metadata": {"type": "VIEW", "schema": "public_iterable_dev", "name": "stg_iterable__user_unsubscribed_channel_tmp", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"_fivetran_id": {"type": "text", "index": 1, "name": "_fivetran_id", "comment": null}, "channel_id": {"type": "integer", "index": 2, "name": "channel_id", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 3, "name": "_fivetran_synced", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.iterable.stg_iterable__user_unsubscribed_channel_tmp"}}, "sources": {"source.iterable.iterable.campaign_history": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "campaign_history_data", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"id": {"type": "integer", "index": 1, "name": "id", "comment": null}, "updated_at": {"type": "text", "index": 2, "name": "updated_at", "comment": null}, "template_id": {"type": "integer", "index": 3, "name": "template_id", "comment": null}, "recurring_campaign_id": {"type": "integer", "index": 4, "name": "recurring_campaign_id", "comment": null}, "campaign_state": {"type": "text", "index": 5, "name": "campaign_state", "comment": null}, "created_at": {"type": "text", "index": 6, "name": "created_at", "comment": null}, "created_by_user_id": {"type": "text", "index": 7, "name": "created_by_user_id", "comment": null}, "ended_at": {"type": "integer", "index": 8, "name": "ended_at", "comment": null}, "name": {"type": "text", "index": 9, "name": "name", "comment": null}, "send_size": {"type": "integer", "index": 10, "name": "send_size", "comment": null}, "start_at": {"type": "integer", "index": 11, "name": "start_at", "comment": null}, "type": {"type": "text", "index": 12, "name": "type", "comment": null}, "workflow_id": {"type": "integer", "index": 13, "name": "workflow_id", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 14, "name": "_fivetran_synced", "comment": null}, "updated_by_user_id": {"type": "integer", "index": 15, "name": "updated_by_user_id", "comment": null}, "message_medium": {"type": "text", "index": 16, "name": "message_medium", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.iterable.iterable.campaign_history"}, "source.iterable.iterable.campaign_label_history": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "campaign_label_history_data", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"campaign_id": {"type": "integer", "index": 1, "name": "campaign_id", "comment": null}, "label": {"type": "text", "index": 2, "name": "label", "comment": null}, "updated_at": {"type": "text", "index": 3, "name": "updated_at", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 4, "name": "_fivetran_synced", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.iterable.iterable.campaign_label_history"}, "source.iterable.iterable.campaign_list_history": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "campaign_list_history_data", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"list_id": {"type": "integer", "index": 1, "name": "list_id", "comment": null}, "campaign_id": {"type": "integer", "index": 2, "name": "campaign_id", "comment": null}, "updated_at": {"type": "text", "index": 3, "name": "updated_at", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 4, "name": "_fivetran_synced", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.iterable.iterable.campaign_list_history"}, "source.iterable.iterable.campaign_suppression_list_history": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "campaign_suppression_list_history_data", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"suppressed_list_id": {"type": "integer", "index": 1, "name": "suppressed_list_id", "comment": null}, "campaign_id": {"type": "integer", "index": 2, "name": "campaign_id", "comment": null}, "updated_at": {"type": "text", "index": 3, "name": "updated_at", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 4, "name": "_fivetran_synced", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.iterable.iterable.campaign_suppression_list_history"}, "source.iterable.iterable.channel": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "channel_data", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"id": {"type": "bigint", "index": 1, "name": "id", "comment": null}, "name": {"type": "text", "index": 2, "name": "name", "comment": null}, "channel_type": {"type": "text", "index": 3, "name": "channel_type", "comment": null}, "message_medium": {"type": "text", "index": 4, "name": "message_medium", "comment": null}, "_fivetran_deleted": {"type": "boolean", "index": 5, "name": "_fivetran_deleted", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 6, "name": "_fivetran_synced", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.iterable.iterable.channel"}, "source.iterable.iterable.event": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "event_data", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"_fivetran_id": {"type": "text", "index": 1, "name": "_fivetran_id", "comment": null}, "email": {"type": "text", "index": 2, "name": "email", "comment": null}, "campaign_id": {"type": "integer", "index": 3, "name": "campaign_id", "comment": null}, "message_id": {"type": "integer", "index": 4, "name": "message_id", "comment": null}, "content_id": {"type": "integer", "index": 5, "name": "content_id", "comment": null}, "created_at": {"type": "timestamp without time zone", "index": 6, "name": "created_at", "comment": null}, "event_name": {"type": "text", "index": 7, "name": "event_name", "comment": null}, "ip": {"type": "integer", "index": 8, "name": "ip", "comment": null}, "message_bus_id": {"type": "integer", "index": 9, "name": "message_bus_id", "comment": null}, "message_type_id": {"type": "integer", "index": 10, "name": "message_type_id", "comment": null}, "recipient_state": {"type": "integer", "index": 11, "name": "recipient_state", "comment": null}, "status": {"type": "integer", "index": 12, "name": "status", "comment": null}, "unsub_source": {"type": "integer", "index": 13, "name": "unsub_source", "comment": null}, "user_agent": {"type": "integer", "index": 14, "name": "user_agent", "comment": null}, "user_agent_device": {"type": "integer", "index": 15, "name": "user_agent_device", "comment": null}, "transactional_data": {"type": "character varying(100)", "index": 16, "name": "transactional_data", "comment": null}, "additional_properties": {"type": "text", "index": 17, "name": "additional_properties", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 18, "name": "_fivetran_synced", "comment": null}, "_fivetran_user_id": {"type": "integer", "index": 19, "name": "_fivetran_user_id", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.iterable.iterable.event"}, "source.iterable.iterable.event_extension": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "event_extension_data", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"_fivetran_id": {"type": "text", "index": 1, "name": "_fivetran_id", "comment": null}, "app_already_running": {"type": "integer", "index": 2, "name": "app_already_running", "comment": null}, "badge": {"type": "integer", "index": 3, "name": "badge", "comment": null}, "canonical_url_id": {"type": "integer", "index": 4, "name": "canonical_url_id", "comment": null}, "content_available": {"type": "integer", "index": 5, "name": "content_available", "comment": null}, "content_id": {"type": "integer", "index": 6, "name": "content_id", "comment": null}, "device": {"type": "integer", "index": 7, "name": "device", "comment": null}, "email_id": {"type": "text", "index": 8, "name": "email_id", "comment": null}, "email_subject": {"type": "text", "index": 9, "name": "email_subject", "comment": null}, "experiment_id": {"type": "integer", "index": 10, "name": "experiment_id", "comment": null}, "from_phone_number_id": {"type": "integer", "index": 11, "name": "from_phone_number_id", "comment": null}, "from_smssender_id": {"type": "integer", "index": 12, "name": "from_smssender_id", "comment": null}, "image_url": {"type": "integer", "index": 13, "name": "image_url", "comment": null}, "is_ghost_push": {"type": "integer", "index": 14, "name": "is_ghost_push", "comment": null}, "link_id": {"type": "integer", "index": 15, "name": "link_id", "comment": null}, "link_url": {"type": "integer", "index": 16, "name": "link_url", "comment": null}, "platform_endpoint": {"type": "integer", "index": 17, "name": "platform_endpoint", "comment": null}, "push_message": {"type": "integer", "index": 18, "name": "push_message", "comment": null}, "region": {"type": "text", "index": 19, "name": "region", "comment": null}, "sms_message": {"type": "integer", "index": 20, "name": "sms_message", "comment": null}, "sound": {"type": "integer", "index": 21, "name": "sound", "comment": null}, "to_phone_number": {"type": "integer", "index": 22, "name": "to_phone_number", "comment": null}, "url": {"type": "integer", "index": 23, "name": "url", "comment": null}, "workflow_id": {"type": "integer", "index": 24, "name": "workflow_id", "comment": null}, "workflow_name": {"type": "text", "index": 25, "name": "workflow_name", "comment": null}, "locale": {"type": "integer", "index": 26, "name": "locale", "comment": null}, "deeplink_android": {"type": "integer", "index": 27, "name": "deeplink_android", "comment": null}, "deeplink_ios": {"type": "integer", "index": 28, "name": "deeplink_ios", "comment": null}, "payload": {"type": "character varying(100)", "index": 29, "name": "payload", "comment": null}, "sms_provider_response_status": {"type": "integer", "index": 30, "name": "sms_provider_response_status", "comment": null}, "sms_provider_response_message": {"type": "integer", "index": 31, "name": "sms_provider_response_message", "comment": null}, "sms_provider_response_code": {"type": "integer", "index": 32, "name": "sms_provider_response_code", "comment": null}, "sms_provider_response_more_info": {"type": "integer", "index": 33, "name": "sms_provider_response_more_info", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 34, "name": "_fivetran_synced", "comment": null}, "catalog_collection_count": {"type": "integer", "index": 35, "name": "catalog_collection_count", "comment": null}, "catalog_lookup_count": {"type": "integer", "index": 36, "name": "catalog_lookup_count", "comment": null}, "city": {"type": "text", "index": 37, "name": "city", "comment": null}, "clicked_url": {"type": "text", "index": 38, "name": "clicked_url", "comment": null}, "country": {"type": "text", "index": 39, "name": "country", "comment": null}, "error_code": {"type": "integer", "index": 40, "name": "error_code", "comment": null}, "expires_at": {"type": "text", "index": 41, "name": "expires_at", "comment": null}, "from_phone_number": {"type": "integer", "index": 42, "name": "from_phone_number", "comment": null}, "in_app_body": {"type": "text", "index": 43, "name": "in_app_body", "comment": null}, "is_sms_estimation": {"type": "boolean", "index": 44, "name": "is_sms_estimation", "comment": null}, "labels": {"type": "text", "index": 45, "name": "labels", "comment": null}, "message_context": {"type": "text", "index": 46, "name": "message_context", "comment": null}, "message_status": {"type": "text", "index": 47, "name": "message_status", "comment": null}, "mms_send_count": {"type": "integer", "index": 48, "name": "mms_send_count", "comment": null}, "product_recommendation_count": {"type": "integer", "index": 49, "name": "product_recommendation_count", "comment": null}, "proxy_source": {"type": "text", "index": 50, "name": "proxy_source", "comment": null}, "reason": {"type": "text", "index": 51, "name": "reason", "comment": null}, "sms_send_count": {"type": "integer", "index": 52, "name": "sms_send_count", "comment": null}, "web_push_body": {"type": "text", "index": 53, "name": "web_push_body", "comment": null}, "web_push_click_action": {"type": "text", "index": 54, "name": "web_push_click_action", "comment": null}, "web_push_icon": {"type": "text", "index": 55, "name": "web_push_icon", "comment": null}, "web_push_message": {"type": "text", "index": 56, "name": "web_push_message", "comment": null}, "_fivetran_user_id": {"type": "integer", "index": 57, "name": "_fivetran_user_id", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.iterable.iterable.event_extension"}, "source.iterable.iterable.journey": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "journey_data", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"id": {"type": "bigint", "index": 1, "name": "id", "comment": null}, "name": {"type": "text", "index": 2, "name": "name", "comment": null}, "journey_type": {"type": "text", "index": 3, "name": "journey_type", "comment": null}, "description": {"type": "text", "index": 4, "name": "description", "comment": null}, "creator_user_id": {"type": "text", "index": 5, "name": "creator_user_id", "comment": null}, "enabled": {"type": "boolean", "index": 6, "name": "enabled", "comment": null}, "is_archived": {"type": "boolean", "index": 7, "name": "is_archived", "comment": null}, "lifetime_limit": {"type": "bigint", "index": 8, "name": "lifetime_limit", "comment": null}, "simultaneous_limit": {"type": "bigint", "index": 9, "name": "simultaneous_limit", "comment": null}, "start_tile_id": {"type": "bigint", "index": 10, "name": "start_tile_id", "comment": null}, "trigger_event_names": {"type": "text", "index": 11, "name": "trigger_event_names", "comment": null}, "created_at": {"type": "timestamp without time zone", "index": 12, "name": "created_at", "comment": null}, "updated_at": {"type": "timestamp without time zone", "index": 13, "name": "updated_at", "comment": null}, "_fivetran_deleted": {"type": "boolean", "index": 14, "name": "_fivetran_deleted", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 15, "name": "_fivetran_synced", "comment": null}, "draft_name": {"type": "text", "index": 16, "name": "draft_name", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.iterable.iterable.journey"}, "source.iterable.iterable.list": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "list_data", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"id": {"type": "integer", "index": 1, "name": "id", "comment": null}, "name": {"type": "text", "index": 2, "name": "name", "comment": null}, "created_at": {"type": "text", "index": 3, "name": "created_at", "comment": null}, "list_type": {"type": "text", "index": 4, "name": "list_type", "comment": null}, "_fivetran_deleted": {"type": "boolean", "index": 5, "name": "_fivetran_deleted", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 6, "name": "_fivetran_synced", "comment": null}, "description": {"type": "text", "index": 7, "name": "description", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.iterable.iterable.list"}, "source.iterable.iterable.list_user": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "list_user_data", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"_fivetran_id": {"type": "text", "index": 1, "name": "_fivetran_id", "comment": null}, "index": {"type": "bigint", "index": 2, "name": "index", "comment": null}, "list_id": {"type": "bigint", "index": 3, "name": "list_id", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 4, "name": "_fivetran_synced", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.iterable.iterable.list_user"}, "source.iterable.iterable.message_type": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "message_type_data", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"id": {"type": "bigint", "index": 1, "name": "id", "comment": null}, "name": {"type": "text", "index": 2, "name": "name", "comment": null}, "channel_id": {"type": "bigint", "index": 3, "name": "channel_id", "comment": null}, "_fivetran_deleted": {"type": "boolean", "index": 4, "name": "_fivetran_deleted", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 5, "name": "_fivetran_synced", "comment": null}, "created_at": {"type": "timestamp without time zone", "index": 6, "name": "created_at", "comment": null}, "frequency_cap": {"type": "integer", "index": 7, "name": "frequency_cap", "comment": null}, "rate_limit_per_minute": {"type": "integer", "index": 8, "name": "rate_limit_per_minute", "comment": null}, "subscription_policy": {"type": "text", "index": 9, "name": "subscription_policy", "comment": null}, "updated_at": {"type": "timestamp without time zone", "index": 10, "name": "updated_at", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.iterable.iterable.message_type"}, "source.iterable.iterable.template_history": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "template_history_data", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"id": {"type": "integer", "index": 1, "name": "id", "comment": null}, "updated_at": {"type": "text", "index": 2, "name": "updated_at", "comment": null}, "message_type_id": {"type": "integer", "index": 3, "name": "message_type_id", "comment": null}, "client_template_id": {"type": "integer", "index": 4, "name": "client_template_id", "comment": null}, "created_at": {"type": "text", "index": 5, "name": "created_at", "comment": null}, "creator_user_id": {"type": "text", "index": 6, "name": "creator_user_id", "comment": null}, "name": {"type": "text", "index": 7, "name": "name", "comment": null}, "template_type": {"type": "text", "index": 8, "name": "template_type", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 9, "name": "_fivetran_synced", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.iterable.iterable.template_history"}, "source.iterable.iterable.user_history": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "user_history_data", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"email": {"type": "text", "index": 1, "name": "email", "comment": null}, "updated_at": {"type": "timestamp without time zone", "index": 2, "name": "updated_at", "comment": null}, "first_name": {"type": "integer", "index": 3, "name": "first_name", "comment": null}, "last_name": {"type": "integer", "index": 4, "name": "last_name", "comment": null}, "phone_number": {"type": "integer", "index": 5, "name": "phone_number", "comment": null}, "user_id": {"type": "integer", "index": 6, "name": "user_id", "comment": null}, "signup_date": {"type": "text", "index": 7, "name": "signup_date", "comment": null}, "signup_source": {"type": "text", "index": 8, "name": "signup_source", "comment": null}, "phone_number_carrier": {"type": "integer", "index": 9, "name": "phone_number_carrier", "comment": null}, "phone_number_country_code_iso": {"type": "integer", "index": 10, "name": "phone_number_country_code_iso", "comment": null}, "phone_number_line_type": {"type": "integer", "index": 11, "name": "phone_number_line_type", "comment": null}, "phone_number_updated_at": {"type": "integer", "index": 12, "name": "phone_number_updated_at", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 13, "name": "_fivetran_synced", "comment": null}, "email_list_ids": {"type": "text", "index": 14, "name": "email_list_ids", "comment": null}, "iterable_user_id": {"type": "integer", "index": 15, "name": "iterable_user_id", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.iterable.iterable.user_history"}, "source.iterable.iterable.user_unsubscribed_channel": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "user_unsubscribed_channel_data", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"_fivetran_id": {"type": "text", "index": 1, "name": "_fivetran_id", "comment": null}, "channel_id": {"type": "integer", "index": 2, "name": "channel_id", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 3, "name": "_fivetran_synced", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.iterable.iterable.user_unsubscribed_channel"}, "source.iterable.iterable.user_unsubscribed_channel_history": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "user_unsubscribed_channel_history_data", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"email": {"type": "text", "index": 1, "name": "email", "comment": null}, "channel_id": {"type": "bigint", "index": 2, "name": "channel_id", "comment": null}, "updated_at": {"type": "text", "index": 3, "name": "updated_at", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 4, "name": "_fivetran_synced", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.iterable.iterable.user_unsubscribed_channel_history"}, "source.iterable.iterable.user_unsubscribed_message_type": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "user_unsubscribed_message_type_data", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"_fivetran_id": {"type": "text", "index": 1, "name": "_fivetran_id", "comment": null}, "message_type_id": {"type": "integer", "index": 2, "name": "message_type_id", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 3, "name": "_fivetran_synced", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.iterable.iterable.user_unsubscribed_message_type"}, "source.iterable.iterable.user_unsubscribed_message_type_history": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "user_unsubscribed_message_type_history_data", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"message_type_id": {"type": "integer", "index": 1, "name": "message_type_id", "comment": null}, "email": {"type": "text", "index": 2, "name": "email", "comment": null}, "updated_at": {"type": "text", "index": 3, "name": "updated_at", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 4, "name": "_fivetran_synced", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.iterable.iterable.user_unsubscribed_message_type_history"}}, "errors": null} \ No newline at end of file diff --git a/docs/manifest.json b/docs/manifest.json index 8d240c2..e1e62c1 100644 --- a/docs/manifest.json +++ b/docs/manifest.json @@ -1 +1 @@ -{"metadata": {"dbt_schema_version": "https://schemas.getdbt.com/dbt/manifest/v12.json", "dbt_version": "1.12.4", "generated_at": "2026-09-14T21:49:37.638875Z", "invocation_id": "6a6c3f91-5f13-44f5-8829-b38d77182ae4", "invocation_started_at": "2026-09-14T21:49:25.424086+00:00", "env": {}, "project_name": "iterable_integration_tests", "project_id": "726648524a3768595307d45548dac26e", "user_id": null, "send_anonymous_usage_stats": false, "adapter_type": "postgres", "quoting": {"database": true, "schema": true, "identifier": true, "column": null}, "run_started_at": "2026-09-14T21:49:25.424377+00:00"}, "nodes": {"seed.iterable_integration_tests.campaign_metrics_data": {"database": "postgres", "schema": "public", "name": "campaign_metrics_data", "resource_type": "seed", "package_name": "iterable_integration_tests", "path": "campaign_metrics_data.csv", "original_file_path": "seeds/campaign_metrics_data.csv", "unique_id": "seed.iterable_integration_tests.campaign_metrics_data", "fqn": ["iterable_integration_tests", "campaign_metrics_data"], "alias": "campaign_metrics_data", "checksum": {"name": "sha256", "checksum": "45e8e7be3941e10f43112fac7bd78f0b6a63c070090062f65b2ffabe481b8c4e"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "seed", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": false, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "delimiter": ",", "quote_columns": false}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": false, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"docs": {"show": false}, "quote_columns": "{{ target.type == 'redshift' or var('fivetran_using_source_casing', false) }}"}, "created_at": 1789422568.226198, "relation_name": "\"postgres\".\"public\".\"campaign_metrics_data\"", "raw_code": "", "doc_blocks": [], "root_path": "/home/runner/work/dbt_iterable/dbt_iterable/integration_tests", "depends_on": {"macros": []}}, "seed.iterable_integration_tests.campaign_list_history_data": {"database": "postgres", "schema": "public", "name": "campaign_list_history_data", "resource_type": "seed", "package_name": "iterable_integration_tests", "path": "campaign_list_history_data.csv", "original_file_path": "seeds/campaign_list_history_data.csv", "unique_id": "seed.iterable_integration_tests.campaign_list_history_data", "fqn": ["iterable_integration_tests", "campaign_list_history_data"], "alias": "campaign_list_history_data", "checksum": {"name": "sha256", "checksum": "206581e614bf60f37345cbf1bd5e0cacac8a2f329a7dfc521b809c3e6d72e728"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "seed", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {"_fivetran_synced": "timestamp"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": false, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "delimiter": ",", "quote_columns": false}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": false, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"docs": {"show": false}, "quote_columns": "{{ target.type == 'redshift' or var('fivetran_using_source_casing', false) }}", "column_types": {"_fivetran_synced": "timestamp"}}, "created_at": 1789422568.234622, "relation_name": "\"postgres\".\"public\".\"campaign_list_history_data\"", "raw_code": "", "doc_blocks": [], "root_path": "/home/runner/work/dbt_iterable/dbt_iterable/integration_tests", "depends_on": {"macros": []}}, "seed.iterable_integration_tests.user_unsubscribed_message_type_history_data": {"database": "postgres", "schema": "public", "name": "user_unsubscribed_message_type_history_data", "resource_type": "seed", "package_name": "iterable_integration_tests", "path": "user_unsubscribed_message_type_history_data.csv", "original_file_path": "seeds/user_unsubscribed_message_type_history_data.csv", "unique_id": "seed.iterable_integration_tests.user_unsubscribed_message_type_history_data", "fqn": ["iterable_integration_tests", "user_unsubscribed_message_type_history_data"], "alias": "user_unsubscribed_message_type_history_data", "checksum": {"name": "sha256", "checksum": "1e6883673b9a6f44966d10891cece60a739773fadf44302ccf2aad5290222687"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "seed", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {"_fivetran_synced": "timestamp"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": false, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "delimiter": ",", "quote_columns": false}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": false, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"docs": {"show": false}, "quote_columns": "{{ target.type == 'redshift' or var('fivetran_using_source_casing', false) }}", "column_types": {"_fivetran_synced": "timestamp"}}, "created_at": 1789422568.2383938, "relation_name": "\"postgres\".\"public\".\"user_unsubscribed_message_type_history_data\"", "raw_code": "", "doc_blocks": [], "root_path": "/home/runner/work/dbt_iterable/dbt_iterable/integration_tests", "depends_on": {"macros": []}}, "seed.iterable_integration_tests.user_unsubscribed_channel_history_data": {"database": "postgres", "schema": "public", "name": "user_unsubscribed_channel_history_data", "resource_type": "seed", "package_name": "iterable_integration_tests", "path": "user_unsubscribed_channel_history_data.csv", "original_file_path": "seeds/user_unsubscribed_channel_history_data.csv", "unique_id": "seed.iterable_integration_tests.user_unsubscribed_channel_history_data", "fqn": ["iterable_integration_tests", "user_unsubscribed_channel_history_data"], "alias": "user_unsubscribed_channel_history_data", "checksum": {"name": "sha256", "checksum": "a1b532e561033f6ff137e5a1bde082263903493b763e9358a2a2ba151360e00e"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "seed", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {"channel_id": "bigint", "_fivetran_synced": "timestamp"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": false, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "delimiter": ",", "quote_columns": false}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": false, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"docs": {"show": false}, "quote_columns": "{{ target.type == 'redshift' or var('fivetran_using_source_casing', false) }}", "column_types": {"channel_id": "{%- if target.type == 'bigquery' -%} INT64 {%- else -%} bigint {%- endif -%}", "_fivetran_synced": "timestamp"}}, "created_at": 1789422568.2424986, "relation_name": "\"postgres\".\"public\".\"user_unsubscribed_channel_history_data\"", "raw_code": "", "doc_blocks": [], "root_path": "/home/runner/work/dbt_iterable/dbt_iterable/integration_tests", "depends_on": {"macros": []}}, "seed.iterable_integration_tests.campaign_suppression_list_history_data": {"database": "postgres", "schema": "public", "name": "campaign_suppression_list_history_data", "resource_type": "seed", "package_name": "iterable_integration_tests", "path": "campaign_suppression_list_history_data.csv", "original_file_path": "seeds/campaign_suppression_list_history_data.csv", "unique_id": "seed.iterable_integration_tests.campaign_suppression_list_history_data", "fqn": ["iterable_integration_tests", "campaign_suppression_list_history_data"], "alias": "campaign_suppression_list_history_data", "checksum": {"name": "sha256", "checksum": "c9eaab0efe0e47ef695b57f71b41f23cf527c87610d7770be604e461fe7c9846"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "seed", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {"_fivetran_synced": "timestamp"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": false, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "delimiter": ",", "quote_columns": false}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": false, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"docs": {"show": false}, "quote_columns": "{{ target.type == 'redshift' or var('fivetran_using_source_casing', false) }}", "column_types": {"_fivetran_synced": "timestamp"}}, "created_at": 1789422568.246256, "relation_name": "\"postgres\".\"public\".\"campaign_suppression_list_history_data\"", "raw_code": "", "doc_blocks": [], "root_path": "/home/runner/work/dbt_iterable/dbt_iterable/integration_tests", "depends_on": {"macros": []}}, "seed.iterable_integration_tests.channel_data": {"database": "postgres", "schema": "public", "name": "channel_data", "resource_type": "seed", "package_name": "iterable_integration_tests", "path": "channel_data.csv", "original_file_path": "seeds/channel_data.csv", "unique_id": "seed.iterable_integration_tests.channel_data", "fqn": ["iterable_integration_tests", "channel_data"], "alias": "channel_data", "checksum": {"name": "sha256", "checksum": "a77e21fb127c0ff7fc652eb5ffc6b3559fde3d63c2c5291a68f10fefcc2fac37"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "seed", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {"id": "bigint", "_fivetran_synced": "timestamp"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": false, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "delimiter": ",", "quote_columns": false}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": false, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"docs": {"show": false}, "quote_columns": "{{ target.type == 'redshift' or var('fivetran_using_source_casing', false) }}", "column_types": {"id": "{%- if target.type == 'bigquery' -%} INT64 {%- else -%} bigint {%- endif -%}", "_fivetran_synced": "timestamp"}}, "created_at": 1789422568.2499728, "relation_name": "\"postgres\".\"public\".\"channel_data\"", "raw_code": "", "doc_blocks": [], "root_path": "/home/runner/work/dbt_iterable/dbt_iterable/integration_tests", "depends_on": {"macros": []}}, "seed.iterable_integration_tests.template_history_data": {"database": "postgres", "schema": "public", "name": "template_history_data", "resource_type": "seed", "package_name": "iterable_integration_tests", "path": "template_history_data.csv", "original_file_path": "seeds/template_history_data.csv", "unique_id": "seed.iterable_integration_tests.template_history_data", "fqn": ["iterable_integration_tests", "template_history_data"], "alias": "template_history_data", "checksum": {"name": "sha256", "checksum": "0f0c442398531afc5fb4c18f12f0d0f694eb3453cb09e0c6c48ba340b110f4a6"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "seed", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {"_fivetran_synced": "timestamp"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": false, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "delimiter": ",", "quote_columns": false}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": false, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"docs": {"show": false}, "quote_columns": "{{ target.type == 'redshift' or var('fivetran_using_source_casing', false) }}", "column_types": {"_fivetran_synced": "timestamp"}}, "created_at": 1789422568.2537677, "relation_name": "\"postgres\".\"public\".\"template_history_data\"", "raw_code": "", "doc_blocks": [], "root_path": "/home/runner/work/dbt_iterable/dbt_iterable/integration_tests", "depends_on": {"macros": []}}, "seed.iterable_integration_tests.message_type_data": {"database": "postgres", "schema": "public", "name": "message_type_data", "resource_type": "seed", "package_name": "iterable_integration_tests", "path": "message_type_data.csv", "original_file_path": "seeds/message_type_data.csv", "unique_id": "seed.iterable_integration_tests.message_type_data", "fqn": ["iterable_integration_tests", "message_type_data"], "alias": "message_type_data", "checksum": {"name": "sha256", "checksum": "84228c8c4a13092ca90bdf9579856968f5265c49f456d01b8510834ae3520bce"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "seed", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {"id": "bigint", "channel_id": "bigint", "_fivetran_synced": "timestamp"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": false, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "delimiter": ",", "quote_columns": false}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": false, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"docs": {"show": false}, "quote_columns": "{{ target.type == 'redshift' or var('fivetran_using_source_casing', false) }}", "column_types": {"id": "{%- if target.type == 'bigquery' -%} INT64 {%- else -%} bigint {%- endif -%}", "channel_id": "{%- if target.type == 'bigquery' -%} INT64 {%- else -%} bigint {%- endif -%}", "_fivetran_synced": "timestamp"}}, "created_at": 1789422568.2578084, "relation_name": "\"postgres\".\"public\".\"message_type_data\"", "raw_code": "", "doc_blocks": [], "root_path": "/home/runner/work/dbt_iterable/dbt_iterable/integration_tests", "depends_on": {"macros": []}}, "seed.iterable_integration_tests.event_data": {"database": "postgres", "schema": "public", "name": "event_data", "resource_type": "seed", "package_name": "iterable_integration_tests", "path": "event_data.csv", "original_file_path": "seeds/event_data.csv", "unique_id": "seed.iterable_integration_tests.event_data", "fqn": ["iterable_integration_tests", "event_data"], "alias": "event_data", "checksum": {"name": "sha256", "checksum": "c886615b369d98135814bac7c4070be9d58b4aa6eb9a90a5caa5ddc4454ab0ed"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "seed", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {"transactional_data": "varchar(100)", "created_at": "timestamp", "_fivetran_synced": "timestamp"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": false, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "delimiter": ",", "quote_columns": false}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": false, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"docs": {"show": false}, "quote_columns": "{{ target.type == 'redshift' or var('fivetran_using_source_casing', false) }}", "column_types": {"transactional_data": "{{ 'varchar(100)' if target.type in ('redshift', 'postgres') else 'string'}}", "created_at": "timestamp", "_fivetran_synced": "timestamp"}}, "created_at": 1789422568.2615685, "relation_name": "\"postgres\".\"public\".\"event_data\"", "raw_code": "", "doc_blocks": [], "root_path": "/home/runner/work/dbt_iterable/dbt_iterable/integration_tests", "depends_on": {"macros": []}}, "seed.iterable_integration_tests.list_user_data": {"database": "postgres", "schema": "public", "name": "list_user_data", "resource_type": "seed", "package_name": "iterable_integration_tests", "path": "list_user_data.csv", "original_file_path": "seeds/list_user_data.csv", "unique_id": "seed.iterable_integration_tests.list_user_data", "fqn": ["iterable_integration_tests", "list_user_data"], "alias": "list_user_data", "checksum": {"name": "sha256", "checksum": "2dbd80b8fb4338602a543026ede3f5a0797c0a4cf13c4724a877bb60ac6a4793"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "seed", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {"list_id": "bigint", "index": "bigint", "_fivetran_synced": "timestamp"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": false, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "delimiter": ",", "quote_columns": false}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": false, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"docs": {"show": false}, "quote_columns": "{{ target.type == 'redshift' or var('fivetran_using_source_casing', false) }}", "column_types": {"list_id": "{%- if target.type == 'bigquery' -%} INT64 {%- else -%} bigint {%- endif -%}", "index": "{%- if target.type == 'bigquery' -%} INT64 {%- else -%} bigint {%- endif -%}", "_fivetran_synced": "timestamp"}}, "created_at": 1789422568.2652779, "relation_name": "\"postgres\".\"public\".\"list_user_data\"", "raw_code": "", "doc_blocks": [], "root_path": "/home/runner/work/dbt_iterable/dbt_iterable/integration_tests", "depends_on": {"macros": []}}, "seed.iterable_integration_tests.user_history_bq_json_data": {"database": "postgres", "schema": "public", "name": "user_history_bq_json_data", "resource_type": "seed", "package_name": "iterable_integration_tests", "path": "user_history_bq_json_data.csv", "original_file_path": "seeds/user_history_bq_json_data.csv", "unique_id": "seed.iterable_integration_tests.user_history_bq_json_data", "fqn": ["iterable_integration_tests", "user_history_bq_json_data"], "alias": "user_history_bq_json_data", "checksum": {"name": "sha256", "checksum": "d2689731ace45d1a5c13930bcc8b80f7b3a02993f8ee4c58bfcf754b734a5caa"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "seed", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": false, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "delimiter": ",", "quote_columns": false}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": false, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"docs": {"show": false}, "quote_columns": "{{ target.type == 'redshift' or var('fivetran_using_source_casing', false) }}"}, "created_at": 1789422568.2688863, "relation_name": "\"postgres\".\"public\".\"user_history_bq_json_data\"", "raw_code": "", "doc_blocks": [], "root_path": "/home/runner/work/dbt_iterable/dbt_iterable/integration_tests", "depends_on": {"macros": []}}, "seed.iterable_integration_tests.user_unsubscribed_message_type_data": {"database": "postgres", "schema": "public", "name": "user_unsubscribed_message_type_data", "resource_type": "seed", "package_name": "iterable_integration_tests", "path": "user_unsubscribed_message_type_data.csv", "original_file_path": "seeds/user_unsubscribed_message_type_data.csv", "unique_id": "seed.iterable_integration_tests.user_unsubscribed_message_type_data", "fqn": ["iterable_integration_tests", "user_unsubscribed_message_type_data"], "alias": "user_unsubscribed_message_type_data", "checksum": {"name": "sha256", "checksum": "473f01110084e53b2115bd09606172cb87559359ccd66775f60209851bfdac12"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "seed", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {"_fivetran_synced": "timestamp"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": false, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "delimiter": ",", "quote_columns": false}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": false, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"docs": {"show": false}, "quote_columns": "{{ target.type == 'redshift' or var('fivetran_using_source_casing', false) }}", "column_types": {"_fivetran_synced": "timestamp"}}, "created_at": 1789422568.2724652, "relation_name": "\"postgres\".\"public\".\"user_unsubscribed_message_type_data\"", "raw_code": "", "doc_blocks": [], "root_path": "/home/runner/work/dbt_iterable/dbt_iterable/integration_tests", "depends_on": {"macros": []}}, "seed.iterable_integration_tests.journey_data": {"database": "postgres", "schema": "public", "name": "journey_data", "resource_type": "seed", "package_name": "iterable_integration_tests", "path": "journey_data.csv", "original_file_path": "seeds/journey_data.csv", "unique_id": "seed.iterable_integration_tests.journey_data", "fqn": ["iterable_integration_tests", "journey_data"], "alias": "journey_data", "checksum": {"name": "sha256", "checksum": "763e5d9e7d86016bfdb9b0ad32da7c2d9685721719cb13b0b518415664bbb6d8"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "seed", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {"id": "bigint", "lifetime_limit": "bigint", "simultaneous_limit": "bigint", "start_tile_id": "bigint", "created_at": "timestamp", "updated_at": "timestamp", "_fivetran_synced": "timestamp"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": false, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "delimiter": ",", "quote_columns": false}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": false, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"docs": {"show": false}, "quote_columns": "{{ target.type == 'redshift' or var('fivetran_using_source_casing', false) }}", "column_types": {"id": "{%- if target.type == 'bigquery' -%} INT64 {%- else -%} bigint {%- endif -%}", "lifetime_limit": "{%- if target.type == 'bigquery' -%} INT64 {%- else -%} bigint {%- endif -%}", "simultaneous_limit": "{%- if target.type == 'bigquery' -%} INT64 {%- else -%} bigint {%- endif -%}", "start_tile_id": "{%- if target.type == 'bigquery' -%} INT64 {%- else -%} bigint {%- endif -%}", "created_at": "timestamp", "updated_at": "timestamp", "_fivetran_synced": "timestamp"}}, "created_at": 1789422568.276272, "relation_name": "\"postgres\".\"public\".\"journey_data\"", "raw_code": "", "doc_blocks": [], "root_path": "/home/runner/work/dbt_iterable/dbt_iterable/integration_tests", "depends_on": {"macros": []}}, "seed.iterable_integration_tests.campaign_history_data": {"database": "postgres", "schema": "public", "name": "campaign_history_data", "resource_type": "seed", "package_name": "iterable_integration_tests", "path": "campaign_history_data.csv", "original_file_path": "seeds/campaign_history_data.csv", "unique_id": "seed.iterable_integration_tests.campaign_history_data", "fqn": ["iterable_integration_tests", "campaign_history_data"], "alias": "campaign_history_data", "checksum": {"name": "sha256", "checksum": "06adf392dab227dbabbda6782b710213ceea5a30d87990d0cbabe92ba0a955c4"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "seed", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {"_fivetran_synced": "timestamp"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": false, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "delimiter": ",", "quote_columns": false}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": false, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"docs": {"show": false}, "quote_columns": "{{ target.type == 'redshift' or var('fivetran_using_source_casing', false) }}", "column_types": {"_fivetran_synced": "timestamp"}}, "created_at": 1789422568.2800417, "relation_name": "\"postgres\".\"public\".\"campaign_history_data\"", "raw_code": "", "doc_blocks": [], "root_path": "/home/runner/work/dbt_iterable/dbt_iterable/integration_tests", "depends_on": {"macros": []}}, "seed.iterable_integration_tests.list_data": {"database": "postgres", "schema": "public", "name": "list_data", "resource_type": "seed", "package_name": "iterable_integration_tests", "path": "list_data.csv", "original_file_path": "seeds/list_data.csv", "unique_id": "seed.iterable_integration_tests.list_data", "fqn": ["iterable_integration_tests", "list_data"], "alias": "list_data", "checksum": {"name": "sha256", "checksum": "9d817c52008be5fbdb25cde6fa5855f8222f41a436ba7e2e5ed564e319cb64fd"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "seed", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {"_fivetran_synced": "timestamp"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": false, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "delimiter": ",", "quote_columns": false}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": false, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"docs": {"show": false}, "quote_columns": "{{ target.type == 'redshift' or var('fivetran_using_source_casing', false) }}", "column_types": {"_fivetran_synced": "timestamp"}}, "created_at": 1789422568.2837248, "relation_name": "\"postgres\".\"public\".\"list_data\"", "raw_code": "", "doc_blocks": [], "root_path": "/home/runner/work/dbt_iterable/dbt_iterable/integration_tests", "depends_on": {"macros": []}}, "seed.iterable_integration_tests.event_extension_data": {"database": "postgres", "schema": "public", "name": "event_extension_data", "resource_type": "seed", "package_name": "iterable_integration_tests", "path": "event_extension_data.csv", "original_file_path": "seeds/event_extension_data.csv", "unique_id": "seed.iterable_integration_tests.event_extension_data", "fqn": ["iterable_integration_tests", "event_extension_data"], "alias": "event_extension_data", "checksum": {"name": "sha256", "checksum": "e0ed2a4a9661ad12bdd9d9a2221df3fd32f2da5fad39e9d0f6f01cbc819ffa9a"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "seed", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {"payload": "varchar(100)", "_fivetran_synced": "timestamp"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": false, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "delimiter": ",", "quote_columns": false}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": false, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"docs": {"show": false}, "quote_columns": "{{ target.type == 'redshift' or var('fivetran_using_source_casing', false) }}", "column_types": {"payload": "{{ 'varchar(100)' if target.type in ('redshift', 'postgres') else 'string'}}", "_fivetran_synced": "timestamp"}}, "created_at": 1789422568.287395, "relation_name": "\"postgres\".\"public\".\"event_extension_data\"", "raw_code": "", "doc_blocks": [], "root_path": "/home/runner/work/dbt_iterable/dbt_iterable/integration_tests", "depends_on": {"macros": []}}, "seed.iterable_integration_tests.user_unsubscribed_channel_data": {"database": "postgres", "schema": "public", "name": "user_unsubscribed_channel_data", "resource_type": "seed", "package_name": "iterable_integration_tests", "path": "user_unsubscribed_channel_data.csv", "original_file_path": "seeds/user_unsubscribed_channel_data.csv", "unique_id": "seed.iterable_integration_tests.user_unsubscribed_channel_data", "fqn": ["iterable_integration_tests", "user_unsubscribed_channel_data"], "alias": "user_unsubscribed_channel_data", "checksum": {"name": "sha256", "checksum": "4c6abacf719352d79d0da89751296fc2665d65546ee2c1ad45d142918c750f28"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "seed", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {"_fivetran_synced": "timestamp"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": false, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "delimiter": ",", "quote_columns": false}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": false, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"docs": {"show": false}, "quote_columns": "{{ target.type == 'redshift' or var('fivetran_using_source_casing', false) }}", "column_types": {"_fivetran_synced": "timestamp"}}, "created_at": 1789422568.291177, "relation_name": "\"postgres\".\"public\".\"user_unsubscribed_channel_data\"", "raw_code": "", "doc_blocks": [], "root_path": "/home/runner/work/dbt_iterable/dbt_iterable/integration_tests", "depends_on": {"macros": []}}, "seed.iterable_integration_tests.campaign_label_history_data": {"database": "postgres", "schema": "public", "name": "campaign_label_history_data", "resource_type": "seed", "package_name": "iterable_integration_tests", "path": "campaign_label_history_data.csv", "original_file_path": "seeds/campaign_label_history_data.csv", "unique_id": "seed.iterable_integration_tests.campaign_label_history_data", "fqn": ["iterable_integration_tests", "campaign_label_history_data"], "alias": "campaign_label_history_data", "checksum": {"name": "sha256", "checksum": "30ed21c883f801eb859d0280b90d45cb3dd020cdb708f4ef4aeca772372bf077"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "seed", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {"_fivetran_synced": "timestamp"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": false, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "delimiter": ",", "quote_columns": false}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": false, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"docs": {"show": false}, "quote_columns": "{{ target.type == 'redshift' or var('fivetran_using_source_casing', false) }}", "column_types": {"_fivetran_synced": "timestamp"}}, "created_at": 1789422568.2948465, "relation_name": "\"postgres\".\"public\".\"campaign_label_history_data\"", "raw_code": "", "doc_blocks": [], "root_path": "/home/runner/work/dbt_iterable/dbt_iterable/integration_tests", "depends_on": {"macros": []}}, "seed.iterable_integration_tests.user_history_data": {"database": "postgres", "schema": "public", "name": "user_history_data", "resource_type": "seed", "package_name": "iterable_integration_tests", "path": "user_history_data.csv", "original_file_path": "seeds/user_history_data.csv", "unique_id": "seed.iterable_integration_tests.user_history_data", "fqn": ["iterable_integration_tests", "user_history_data"], "alias": "user_history_data", "checksum": {"name": "sha256", "checksum": "708bd35a21174cf05f0b4370079a339061c0b9292690ac4facd43b1d2bdff186"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "seed", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {"updated_at": "timestamp", "_fivetran_synced": "timestamp"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": false, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "delimiter": ",", "quote_columns": false}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": false, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"docs": {"show": false}, "quote_columns": "{{ target.type == 'redshift' or var('fivetran_using_source_casing', false) }}", "column_types": {"updated_at": "timestamp", "_fivetran_synced": "timestamp"}}, "created_at": 1789422568.2986176, "relation_name": "\"postgres\".\"public\".\"user_history_data\"", "raw_code": "", "doc_blocks": [], "root_path": "/home/runner/work/dbt_iterable/dbt_iterable/integration_tests", "depends_on": {"macros": []}}, "model.iterable.iterable__users": {"database": "postgres", "schema": "public_iterable_dev", "name": "iterable__users", "resource_type": "model", "package_name": "iterable", "path": "iterable__users.sql", "original_file_path": "models/iterable__users.sql", "unique_id": "model.iterable.iterable__users", "fqn": ["iterable", "iterable__users"], "alias": "iterable__users", "checksum": {"name": "sha256", "checksum": "da23dacdef77d357083015551b25b1e1013e549ccea451e28820df44f3ac4f5a"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "table", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "Table that provides unique user enriched information.", "columns": {"source_relation": {"name": "source_relation", "description": "Identifies the record's source.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": ["doc.iterable.source_relation"]}, "unique_user_key": {"name": "unique_user_key", "description": "The unique identifier of the user. With the new schema (Aug 2023), it is the _fivetran_user_id. This is a hash of user_id and/or email, depending on project type. If using the old schema, it is email.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "_fivetran_user_id": {"name": "_fivetran_user_id", "description": "A Fivetran-created unique identifier for the new Iterable schema in Aug 2023, for users, derived from hashing user_id and/or email, depending on project type.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "email": {"name": "email", "description": "The user's email. User identifier, for email-based projects. Previously was the unique identifier for user records, for the old Iterable schema before the August 2023 updates.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "first_name": {"name": "first_name", "description": "First name of the user", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "last_name": {"name": "last_name", "description": "Last name of the user", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "user_id": {"name": "user_id", "description": "User identifier, for userID-based projects.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "signup_date": {"name": "signup_date", "description": "Timestamp of when the user signed up", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "signup_source": {"name": "signup_source", "description": "Source where the user signed up", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "updated_at": {"name": "updated_at", "description": "Last update timestamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "phone_number": {"name": "phone_number", "description": "Phone number associated with the user", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "email_list_ids": {"name": "email_list_ids", "description": "Array of all email lists associated with the user, derived from the list_user table relationships", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "count_lists": {"name": "count_lists", "description": "Total count of lists associated with the user", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "count_total_campaigns": {"name": "count_total_campaigns", "description": "Count of all campaigns the user has been in", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "first_event_at": {"name": "first_event_at", "description": "The first event the user ever encountered", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "last_event_at": {"name": "last_event_at", "description": "The most recent event the user has encountered", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_emailclick": {"name": "total_emailclick", "description": "Total number of email clicks the user has performed", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_emailunsubscribe": {"name": "total_emailunsubscribe", "description": "Total unsubscription events the user has performed", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_emailcomplaint": {"name": "total_emailcomplaint", "description": "Total email complaints the user has performed", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_customevent": {"name": "total_customevent", "description": "Total custom events associated with the user", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_emailsubscribe": {"name": "total_emailsubscribe", "description": "Total subscription events the user has performed", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_emailopen": {"name": "total_emailopen", "description": "Total email opened events the user has performed", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_pushsend": {"name": "total_pushsend", "description": "The push send events the user has experienced", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_smsbounce": {"name": "total_smsbounce", "description": "Total sms bounces that are associated with the user", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_pushbounce": {"name": "total_pushbounce", "description": "Total number of push bounces associated with the user", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_inappsendskip": {"name": "total_inappsendskip", "description": "Total in app send skips associated with the user", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_smssend": {"name": "total_smssend", "description": "Total sms sends that the user has experienced", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_inappsend": {"name": "total_inappsend", "description": "Total in app sends the user has experienced", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_pushopen": {"name": "total_pushopen", "description": "Total push messages the user has opened", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_emailsend": {"name": "total_emailsend", "description": "Total emails that have been sent to the user", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_pushsendskip": {"name": "total_pushsendskip", "description": "Total push sends the user has skipped", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_inappopen": {"name": "total_inappopen", "description": "Total in app opens the user has performed", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_emailsendskip": {"name": "total_emailsendskip", "description": "Total email sends the user has skipped", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_emailbounce": {"name": "total_emailbounce", "description": "Total number of emails that have bounced from the user", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_inappclick": {"name": "total_inappclick", "description": "Total in app clicks associated with the user", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_pushuninstall": {"name": "total_pushuninstall", "description": "Total push uninstall events the user has performed", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "iterable://models/iterable.yml", "build_path": null, "unrendered_config": {"materialized": "table", "schema": "iterable_{{ var('directed_schema','dev') }}", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789422569.7642653, "relation_name": "\"postgres\".\"public_iterable_dev\".\"iterable__users\"", "raw_code": "{% set passthrough_column_count = var('iterable_user_history_pass_through_columns') | length %}\n\nwith user_event_metrics as (\n\n select *\n from {{ ref('int_iterable__user_event_metrics') }}\n\n), list_users as (\n\n select *\n from {{ ref('stg_iterable__list_user') }}\n order by list_id -- so the list ids will aggregate in the right order\n\n), list_user_aggregated as (\n\n select\n source_relation,\n _fivetran_user_id,\n count(*) as count_lists,\n {{ dbt.concat([\"'['\", fivetran_utils.string_agg(field_to_agg=\"cast(list_id as \" ~ dbt.type_string() ~ \")\", delimiter=\"','\"), \"']'\"]) }} as email_list_ids\n from list_users\n group by 1, 2 \n\n), user_history_unnest as (\n -- this has all the user fields we're looking to pass through\n\n select *\n from {{ ref('int_iterable__list_user_unnest') }}\n\n -- limit to current lists they are a member of. each list-user combo is a unique row, which we will roll up\n where is_current\n\n), user_with_list_metrics as (\n\n select\n source_relation,\n user_id,\n _fivetran_user_id,\n unique_user_key,\n email,\n first_name,\n last_name,\n signup_date,\n signup_source,\n updated_at,\n phone_number,\n email_list_ids\n\n --The below script allows for pass through columns.\n {{ fivetran_utils.persist_pass_through_columns(pass_through_variable='iterable_user_history_pass_through_columns') }}\n\n , count(distinct list_id) as count_lists\n\n from user_history_unnest\n -- roll up to the user\n {{ dbt_utils.group_by(n = 12 + passthrough_column_count) }}\n\n), user_join as (\n\n select\n user_with_list_metrics.source_relation,\n user_with_list_metrics.user_id,\n user_with_list_metrics._fivetran_user_id,\n user_with_list_metrics.unique_user_key,\n user_with_list_metrics.email,\n user_with_list_metrics.first_name,\n user_with_list_metrics.last_name,\n user_with_list_metrics.signup_date,\n user_with_list_metrics.signup_source,\n user_with_list_metrics.updated_at,\n user_with_list_metrics.phone_number,\n coalesce(list_user_aggregated.email_list_ids, user_with_list_metrics.email_list_ids, '[]') as email_list_ids,\n coalesce(list_user_aggregated.count_lists, user_with_list_metrics.count_lists, 0) as count_lists,\n {{ dbt_utils.star(from=ref('int_iterable__user_event_metrics'), except=['source_relation','unique_user_key','_fivetran_user_id','user_id','user_email']) }}\n {{ fivetran_utils.persist_pass_through_columns(pass_through_variable='iterable_user_history_pass_through_columns', identifier='user_with_list_metrics') }}\n\n from user_with_list_metrics\n left join user_event_metrics\n on user_with_list_metrics.unique_user_key = user_event_metrics.unique_user_key\n and user_with_list_metrics.source_relation = user_event_metrics.source_relation\n left join list_user_aggregated\n -- use _fivetran_user_id since in list_user it is a primary key\n on user_with_list_metrics._fivetran_user_id = list_user_aggregated._fivetran_user_id\n and user_with_list_metrics.source_relation = list_user_aggregated.source_relation\n)\n\nselect *\nfrom user_join", "doc_blocks": [], "language": "sql", "refs": [{"name": "int_iterable__user_event_metrics", "package": null, "version": null}, {"name": "stg_iterable__list_user", "package": null, "version": null}, {"name": "int_iterable__list_user_unnest", "package": null, "version": null}, {"name": "int_iterable__user_event_metrics", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.type_string", "macro.fivetran_utils.string_agg", "macro.dbt.concat", "macro.fivetran_utils.persist_pass_through_columns", "macro.dbt_utils.group_by", "macro.dbt_utils.star"], "nodes": ["model.iterable.int_iterable__user_event_metrics", "model.iterable.stg_iterable__list_user", "model.iterable.int_iterable__list_user_unnest"]}, "compiled_path": "target/compiled/iterable/models/iterable__users.sql", "compiled": true, "compiled_code": "\n\nwith user_event_metrics as (\n\n select *\n from \"postgres\".\"public_iterable_dev\".\"int_iterable__user_event_metrics\"\n\n), list_users as (\n\n select *\n from \"postgres\".\"public_iterable_dev\".\"stg_iterable__list_user\"\n order by list_id -- so the list ids will aggregate in the right order\n\n), list_user_aggregated as (\n\n select\n source_relation,\n _fivetran_user_id,\n count(*) as count_lists,\n '[' || \n string_agg(cast(list_id as TEXT), ',')\n\n || ']' as email_list_ids\n from list_users\n group by 1, 2 \n\n), user_history_unnest as (\n -- this has all the user fields we're looking to pass through\n\n select *\n from \"postgres\".\"public_iterable_dev\".\"int_iterable__list_user_unnest\"\n\n -- limit to current lists they are a member of. each list-user combo is a unique row, which we will roll up\n where is_current\n\n), user_with_list_metrics as (\n\n select\n source_relation,\n user_id,\n _fivetran_user_id,\n unique_user_key,\n email,\n first_name,\n last_name,\n signup_date,\n signup_source,\n updated_at,\n phone_number,\n email_list_ids\n\n --The below script allows for pass through columns.\n \n\n\n\n\n\n , count(distinct list_id) as count_lists\n\n from user_history_unnest\n -- roll up to the user\n group by 1,2,3,4,5,6,7,8,9,10,11,12\n\n), user_join as (\n\n select\n user_with_list_metrics.source_relation,\n user_with_list_metrics.user_id,\n user_with_list_metrics._fivetran_user_id,\n user_with_list_metrics.unique_user_key,\n user_with_list_metrics.email,\n user_with_list_metrics.first_name,\n user_with_list_metrics.last_name,\n user_with_list_metrics.signup_date,\n user_with_list_metrics.signup_source,\n user_with_list_metrics.updated_at,\n user_with_list_metrics.phone_number,\n coalesce(list_user_aggregated.email_list_ids, user_with_list_metrics.email_list_ids, '[]') as email_list_ids,\n coalesce(list_user_aggregated.count_lists, user_with_list_metrics.count_lists, 0) as count_lists,\n \"count_total_campaigns\",\n \"first_event_at\",\n \"last_event_at\",\n \"total_emailclick\",\n \"total_emailunsubscribe\",\n \"total_emailcomplaint\",\n \"total_customevent\",\n \"total_emailsubscribe\",\n \"total_emailopen\",\n \"total_pushsend\",\n \"total_smsbounce\",\n \"total_pushbounce\",\n \"total_inappsendskip\",\n \"total_smssend\",\n \"total_inappsend\",\n \"total_pushopen\",\n \"total_emailsend\",\n \"total_pushsendskip\",\n \"total_inappopen\",\n \"total_emailsendskip\",\n \"total_emailbounce\",\n \"total_inappclick\",\n \"total_pushuninstall\"\n \n\n\n\n\n\n from user_with_list_metrics\n left join user_event_metrics\n on user_with_list_metrics.unique_user_key = user_event_metrics.unique_user_key\n and user_with_list_metrics.source_relation = user_event_metrics.source_relation\n left join list_user_aggregated\n -- use _fivetran_user_id since in list_user it is a primary key\n on user_with_list_metrics._fivetran_user_id = list_user_aggregated._fivetran_user_id\n and user_with_list_metrics.source_relation = list_user_aggregated.source_relation\n)\n\nselect *\nfrom user_join", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.iterable__list_user_history": {"database": "postgres", "schema": "public_iterable_dev", "name": "iterable__list_user_history", "resource_type": "model", "package_name": "iterable", "path": "iterable__list_user_history.sql", "original_file_path": "models/iterable__list_user_history.sql", "unique_id": "model.iterable.iterable__list_user_history", "fqn": ["iterable", "iterable__list_user_history"], "alias": "iterable__list_user_history", "checksum": {"name": "sha256", "checksum": "9c0778ad02c86e2145ba4189534ea1eabf07b41bb3aa414934fa554ae4af4e1c"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "table", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "Table that recreates the `list_user_history` source table. Additionally, this table provides an `is_current` field to identify the current lists associated with the user. The table coalesces list_id values from both the direct list_user relationships and the unnested email_list_ids from user history to ensure comprehensive list coverage. The grain of this table is at the user/list/updated_at level.\n", "columns": {"source_relation": {"name": "source_relation", "description": "Identifies the record's source.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": ["doc.iterable.source_relation"]}, "unique_user_key": {"name": "unique_user_key", "description": "The unique identifier of the user. With the new schema (Aug 2023), it is the _fivetran_user_id. This is a hash of user_id and/or email, depending on project type. If using the old schema, it is email.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "_fivetran_user_id": {"name": "_fivetran_user_id", "description": "A Fivetran-created unique identifier for the new Iterable schema in Aug 2023, for users, derived from hashing user_id and/or email, depending on project type.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "user_email": {"name": "user_email", "description": "Email of the user if it exists.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "user_first_name": {"name": "user_first_name", "description": "First name of the user", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "user_last_name": {"name": "user_last_name", "description": "Last name of the user", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "user_id": {"name": "user_id", "description": "User identifier, for userID-based projects.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "user_signup_date": {"name": "user_signup_date", "description": "Timestamp of when the user signed up", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "user_signup_source": {"name": "user_signup_source", "description": "Source where the user signed up", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "user_updated_at": {"name": "user_updated_at", "description": "Last update timestamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "list_id": {"name": "list_id", "description": "The list associated with the user. Uses coalesced values prioritizing `list_id` from `LIST_USER` over the unnested `email_list_ids` from `USER_HISTORY` for comprehensive list coverage.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "is_current": {"name": "is_current", "description": "Boolean indicating if the current list is active", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "list_name": {"name": "list_name", "description": "Name of the list associated with the user", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "list_type": {"name": "list_type", "description": "Type of list associated with the user", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "list_created_at": {"name": "list_created_at", "description": "Date the list was created", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "iterable://models/iterable.yml", "build_path": null, "unrendered_config": {"materialized": "table", "schema": "iterable_{{ var('directed_schema','dev') }}", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789422569.7549171, "relation_name": "\"postgres\".\"public_iterable_dev\".\"iterable__list_user_history\"", "raw_code": "with user_history_unnest as (\n\n select *\n from {{ ref('int_iterable__list_user_unnest') }}\n\n), list_users as (\n\n select *\n from {{ ref('stg_iterable__list_user') }}\n\n), lists as (\n\n select *\n from {{ ref('stg_iterable__list') }}\n\n), final as (\n select distinct\n user_history_unnest.source_relation,\n user_history_unnest.unique_user_key,\n user_history_unnest._fivetran_user_id,\n user_history_unnest.user_id,\n user_history_unnest.email as user_email,\n user_history_unnest.first_name as user_first_name,\n user_history_unnest.last_name as user_last_name,\n user_history_unnest.signup_date as user_signup_date,\n user_history_unnest.signup_source as user_signup_source,\n user_history_unnest.updated_at as user_updated_at,\n coalesce(list_users.list_id, user_history_unnest.list_id) as list_id,\n user_history_unnest.is_current,\n lists.list_name,\n lists.list_type,\n lists.created_at as list_created_at\n\n --The below script allows for pass through columns.\n {{ fivetran_utils.persist_pass_through_columns(pass_through_variable='iterable_user_history_pass_through_columns', identifier='user_history_unnest') }}\n\n from user_history_unnest\n left join list_users\n on list_users.source_relation = user_history_unnest.source_relation\n and list_users._fivetran_user_id = user_history_unnest._fivetran_user_id\n left join lists\n on lists.source_relation = user_history_unnest.source_relation\n and lists.list_id = coalesce(list_users.list_id, user_history_unnest.list_id)\n)\n\nselect *\nfrom final", "doc_blocks": [], "language": "sql", "refs": [{"name": "int_iterable__list_user_unnest", "package": null, "version": null}, {"name": "stg_iterable__list_user", "package": null, "version": null}, {"name": "stg_iterable__list", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.fivetran_utils.persist_pass_through_columns"], "nodes": ["model.iterable.int_iterable__list_user_unnest", "model.iterable.stg_iterable__list_user", "model.iterable.stg_iterable__list"]}, "compiled_path": "target/compiled/iterable/models/iterable__list_user_history.sql", "compiled": true, "compiled_code": "with user_history_unnest as (\n\n select *\n from \"postgres\".\"public_iterable_dev\".\"int_iterable__list_user_unnest\"\n\n), list_users as (\n\n select *\n from \"postgres\".\"public_iterable_dev\".\"stg_iterable__list_user\"\n\n), lists as (\n\n select *\n from \"postgres\".\"public_iterable_dev\".\"stg_iterable__list\"\n\n), final as (\n select distinct\n user_history_unnest.source_relation,\n user_history_unnest.unique_user_key,\n user_history_unnest._fivetran_user_id,\n user_history_unnest.user_id,\n user_history_unnest.email as user_email,\n user_history_unnest.first_name as user_first_name,\n user_history_unnest.last_name as user_last_name,\n user_history_unnest.signup_date as user_signup_date,\n user_history_unnest.signup_source as user_signup_source,\n user_history_unnest.updated_at as user_updated_at,\n coalesce(list_users.list_id, user_history_unnest.list_id) as list_id,\n user_history_unnest.is_current,\n lists.list_name,\n lists.list_type,\n lists.created_at as list_created_at\n\n --The below script allows for pass through columns.\n \n\n\n\n\n\n from user_history_unnest\n left join list_users\n on list_users.source_relation = user_history_unnest.source_relation\n and list_users._fivetran_user_id = user_history_unnest._fivetran_user_id\n left join lists\n on lists.source_relation = user_history_unnest.source_relation\n and lists.list_id = coalesce(list_users.list_id, user_history_unnest.list_id)\n)\n\nselect *\nfrom final", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.iterable__events": {"database": "postgres", "schema": "public_iterable_dev", "name": "iterable__events", "resource_type": "model", "package_name": "iterable", "path": "iterable__events.sql", "original_file_path": "models/iterable__events.sql", "unique_id": "model.iterable.iterable__events", "fqn": ["iterable", "iterable__events"], "alias": "iterable__events", "checksum": {"name": "sha256", "checksum": "d516cb05680b528ba689ac2a2e34bfee8bbd7ede3c7d8ccfea16a28232d39c44"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "incremental", "incremental_strategy": "delete+insert", "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": ["unique_event_id"], "on_schema_change": "fail", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}, "partition_by": {"field": "created_on", "data_type": "date"}, "file_format": "delta"}, "tags": [], "description": "Table that provides a comprehensive view of all events with enriched information such as the campaign, user effected, and template used.", "columns": {"source_relation": {"name": "source_relation", "description": "Identifies the record's source.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": ["doc.iterable.source_relation"]}, "event_id": {"name": "event_id", "description": "Unique id of the event generated by Fivetran", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_event_id": {"name": "unique_event_id", "description": "A unique surrogate key of event_id, _fivetran_user_id, and source_relation.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_user_key": {"name": "unique_user_key", "description": "The unique identifier of the user. With the new schema (Aug 2023), it is the _fivetran_user_id. This is a hash of user_id and/or email, depending on project type. If using the old schema, it is email.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "_fivetran_user_id": {"name": "_fivetran_user_id", "description": "A Fivetran-created unique identifier for the new Iterable schema in Aug 2023, for users, derived from hashing user_id and/or email, depending on project type.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "campaign_id": {"name": "campaign_id", "description": "Reference to the campaign from which the event originated", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "content_id": {"name": "content_id", "description": "Reference to the content the event is associated with", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "created_at": {"name": "created_at", "description": "Creation timestamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "email": {"name": "email", "description": "The user's email. User identifier, for email-based projects. Previously was the unique identifier for user records, for the old Iterable schema before the August 2023 updates.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "additional_properties": {"name": "additional_properties", "description": "json object containing addition event properties", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "event_name": {"name": "event_name", "description": "Name provided to the individual event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "message_bus_id": {"name": "message_bus_id", "description": "Reference to the message bus associated with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "message_id": {"name": "message_id", "description": "Reference to the message the event is associated with", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "message_type_id": {"name": "message_type_id", "description": "Reference to the type of message the event is associated with", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "recipient_state": {"name": "recipient_state", "description": "The state of the recipient upon receiving the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "status": {"name": "status", "description": "Status of the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "transactional_data": {"name": "transactional_data", "description": "Transactional data associated with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unsub_source": {"name": "unsub_source", "description": "Source of the unsubscribe event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "user_agent": {"name": "user_agent", "description": "User agent associated with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "user_agent_device": {"name": "user_agent_device", "description": "The device of the user agent", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "Timestamp of when the event record was synced by Fivetran", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "campaign_name": {"name": "campaign_name", "description": "The name of the campaign", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "campaign_type": {"name": "campaign_type", "description": "The type of campaign", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "is_campaign_recurring": {"name": "is_campaign_recurring", "description": "Boolean indicating if the campaign is recurrent", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "recurring_campaign_name": {"name": "recurring_campaign_name", "description": "The name of the recurring campaign (if applicable)", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "recurring_campaign_id": {"name": "recurring_campaign_id", "description": "The campaign if of the recurring campaign (if applicable)", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "user_id": {"name": "user_id", "description": "User identifier, for userID-based projects.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "user_full_name": {"name": "user_full_name", "description": "Full name of the user", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "message_type_name": {"name": "message_type_name", "description": "Name of the message type", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "message_medium": {"name": "message_medium", "description": "Medium of the message", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "channel_id": {"name": "channel_id", "description": "Unique identifier of the channel", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "channel_name": {"name": "channel_name", "description": "The channel name", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "channel_type": {"name": "channel_type", "description": "The type of channel", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "is_app_already_running": {"name": "is_app_already_running", "description": "Boolean indicating if the app is already running", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "badge": {"name": "badge", "description": "Badge associated with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "canonical_url_id": {"name": "canonical_url_id", "description": "Reference to the url associated with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "is_content_available": {"name": "is_content_available", "description": "Content available from the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "device": {"name": "device", "description": "The device associated with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "email_id": {"name": "email_id", "description": "Reference to the email associated with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "email_subject": {"name": "email_subject", "description": "Subject of the email associated with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "experiment_id": {"name": "experiment_id", "description": "Reference to the experiment used if the event is an experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "from_phone_number_id": {"name": "from_phone_number_id", "description": "Reference to the phone number which the event is from", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "from_smssender_id": {"name": "from_smssender_id", "description": "Reference to the sms sender which the event is from", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "link_id": {"name": "link_id", "description": "Reference to the link associated with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "link_url": {"name": "link_url", "description": "Url of the link associated with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "locale": {"name": "locale", "description": "Locale associated with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "payload": {"name": "payload", "description": "Payload resulted from the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "platform_endpoint": {"name": "platform_endpoint", "description": "The specific platform endpoint of the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "push_message": {"name": "push_message", "description": "Boolean indicating if the event is a push message", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "region": {"name": "region", "description": "Region of the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "sms_message": {"name": "sms_message", "description": "Boolean indicating if the event is an sms message", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "to_phone_number": {"name": "to_phone_number", "description": "To phone number associated with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "url": {"name": "url", "description": "Url associated with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "workflow_id": {"name": "workflow_id", "description": "Reference to the workflow which the event originated", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "workflow_name": {"name": "workflow_name", "description": "Name of the workflow which the event originated", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "catalog_collection_count": {"name": "catalog_collection_count", "description": "The count of products or items collected in a catalog associated with the event.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "catalog_lookup_count": {"name": "catalog_lookup_count", "description": "The count of times a catalog was looked up or queried during the event.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "template_id": {"name": "template_id", "description": "Unique identifier of the template", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "template_name": {"name": "template_name", "description": "User defined name of the template", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "template_creator_user_id": {"name": "template_creator_user_id", "description": "Reference to the user who created the template", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "created_on": {"name": "created_on", "description": "Day when the event was created", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "city": {"name": "city", "description": "The city associated with the event, which could be the location of the recipient.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "clicked_url": {"name": "clicked_url", "description": "The URL that was clicked by the recipient in response to the marketing message.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "country": {"name": "country", "description": "The country associated with the event, which could be the location of the recipient.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "error_code": {"name": "error_code", "description": "The error code or message indicating any issues or errors encountered during the event.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "expires_at": {"name": "expires_at", "description": "The date and time when the event or message is set to expire or become invalid.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "from_phone_number": {"name": "from_phone_number", "description": "The phone number from which the SMS message was sent.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "in_app_body": {"name": "in_app_body", "description": "The content or body of an in-app message that was sent as part of the event.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "is_sms_estimation": {"name": "is_sms_estimation", "description": "A boolean indicating whether the SMS message is an estimation or not.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "labels": {"name": "labels", "description": "Any labels or tags associated with the event, which can be used for categorization or organization.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "message_status": {"name": "message_status", "description": "The status of the marketing message, such as sent, delivered, opened, etc.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "mms_send_count": {"name": "mms_send_count", "description": "The count of multimedia messages (MMS) sent as part of the event.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "reason": {"name": "reason", "description": "The reason or cause associated with a specific event or action.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "sms_send_count": {"name": "sms_send_count", "description": "The count of SMS messages sent as part of the event.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "iterable://models/iterable.yml", "build_path": null, "unrendered_config": {"materialized": "incremental", "schema": "iterable_{{ var('directed_schema','dev') }}", "unique_key": "['unique_event_id']", "incremental_strategy": "CondExpr(test=Compare(expr=Getattr(node=Name(name='target', ctx='load'), attr='type', ctx='load'), ops=[Operand(op='in', expr=Tuple(items=[Const(value='bigquery'), Const(value='spark'), Const(value='databricks')], ctx='load'))]), expr1=Const(value='insert_overwrite'), expr2=Const(value='delete+insert'))", "partition_by": "CondExpr(test=Compare(expr=Getattr(node=Name(name='target', ctx='load'), attr='type', ctx='load'), ops=[Operand(op='notin', expr=Tuple(items=[Const(value='spark'), Const(value='databricks'), Const(value='duckdb')], ctx='load'))]), expr1=Dict(items=[Pair(key=Const(value='field'), value=Const(value='created_on')), Pair(key=Const(value='data_type'), value=Const(value='date'))]), expr2=List(items=[Const(value='created_on')]))", "file_format": "delta", "on_schema_change": "fail", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789422569.7414072, "relation_name": "\"postgres\".\"public_iterable_dev\".\"iterable__events\"", "raw_code": "{{ config(\n materialized='incremental',\n unique_key=['unique_event_id'],\n incremental_strategy='insert_overwrite' if target.type in ('bigquery', 'spark', 'databricks') else 'delete+insert',\n partition_by={\"field\": \"created_on\", \"data_type\": \"date\"} if target.type not in ('spark', 'databricks', 'duckdb') else ['created_on'],\n file_format='delta',\n on_schema_change='fail'\n ) \n}}\n\n{% set using_event_extension = var('iterable__using_event_extension', True) %}\n\nwith events as (\n\n select *\n from {{ ref('stg_iterable__event') }}\n\n {% if is_incremental() %}\n where created_on >= {{ iterable.iterable_lookback(\n from_date=\"max(created_on)\",\n datepart='day', \n interval=var('iterable_lookback_window', 7)) }}\n {% endif %}\n\n), campaign as (\n\n select *\n from {{ ref('int_iterable__recurring_campaigns') }}\n\n\n{% if using_event_extension %}\n), event_extension as (\n\n select *\n from {{ ref('stg_iterable__event_extension') }}\n{% endif %}\n\n), users as (\n\n select *\n from {{ ref('int_iterable__latest_user') }}\n\n), message_type_channel as (\n\n select *\n from {{ ref('int_iterable__message_type_channel') }}\n\n), template as (\n\n select *\n from {{ ref('int_iterable__latest_template') }}\n\n), event_join as (\n\n select \n events.*,\n campaign.campaign_name,\n campaign.campaign_type,\n campaign.is_campaign_recurring,\n campaign.recurring_campaign_name,\n campaign.recurring_campaign_id,\n\n users.user_id,\n users.first_name || ' ' || users.last_name as user_full_name,\n\n message_type_channel.message_type_name,\n message_type_channel.message_medium,\n message_type_channel.channel_id,\n message_type_channel.channel_name,\n message_type_channel.channel_type\n\n {% if using_event_extension %}\n {% set exclude_fields = [\"source_relation\", \"unique_user_key\",\"_fivetran_user_id\",\"event_id\", \"content_id\", \"_fivetran_synced\", \"unique_event_id\"] %}\n , {{ dbt_utils.star(from=ref('stg_iterable__event_extension'), except=exclude_fields, relation_alias=\"event_extension\") }}\n {% endif %}\n\n ,\n campaign.template_id,\n template.template_name,\n template.creator_user_id as template_creator_user_id\n \n from events\n\n {% if using_event_extension %}\n left join event_extension\n on events.unique_event_id = event_extension.unique_event_id\n and events.source_relation = event_extension.source_relation\n {% endif %}\n\n left join campaign\n on events.campaign_id = campaign.campaign_id\n and events.source_relation = campaign.source_relation\n left join users\n on events.unique_user_key = users.unique_user_key -- unique_user_key = _fivetran_user_id if exists, otherwise email\n and events.source_relation = users.source_relation\n left join message_type_channel\n on events.message_type_id = message_type_channel.message_type_id\n and events.source_relation = message_type_channel.source_relation\n left join template\n on campaign.template_id = template.template_id\n and events.source_relation = template.source_relation\n)\n\nselect *\nfrom event_join", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__event", "package": null, "version": null}, {"name": "int_iterable__recurring_campaigns", "package": null, "version": null}, {"name": "stg_iterable__event_extension", "package": null, "version": null}, {"name": "int_iterable__latest_user", "package": null, "version": null}, {"name": "int_iterable__message_type_channel", "package": null, "version": null}, {"name": "int_iterable__latest_template", "package": null, "version": null}, {"name": "stg_iterable__event_extension", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.is_incremental", "macro.dbt_utils.star", "macro.iterable.iterable_lookback"], "nodes": ["model.iterable.stg_iterable__event", "model.iterable.int_iterable__recurring_campaigns", "model.iterable.stg_iterable__event_extension", "model.iterable.int_iterable__latest_user", "model.iterable.int_iterable__message_type_channel", "model.iterable.int_iterable__latest_template"]}, "compiled_path": "target/compiled/iterable/models/iterable__events.sql", "compiled": true, "compiled_code": "\n\n\n\nwith events as (\n\n select *\n from \"postgres\".\"public_iterable_dev\".\"stg_iterable__event\"\n\n \n where created_on >= \n\n\n\n \n\n \n\n cast('2020-07-12' as date) + ((interval '1 day') * (-7))\n\n\n\n\n \n\n), campaign as (\n\n select *\n from \"postgres\".\"public_iterable_dev\".\"int_iterable__recurring_campaigns\"\n\n\n\n), event_extension as (\n\n select *\n from \"postgres\".\"public_iterable_dev\".\"stg_iterable__event_extension\"\n\n\n), users as (\n\n select *\n from \"postgres\".\"public_iterable_dev\".\"int_iterable__latest_user\"\n\n), message_type_channel as (\n\n select *\n from \"postgres\".\"public_iterable_dev\".\"int_iterable__message_type_channel\"\n\n), template as (\n\n select *\n from \"postgres\".\"public_iterable_dev\".\"int_iterable__latest_template\"\n\n), event_join as (\n\n select \n events.*,\n campaign.campaign_name,\n campaign.campaign_type,\n campaign.is_campaign_recurring,\n campaign.recurring_campaign_name,\n campaign.recurring_campaign_id,\n\n users.user_id,\n users.first_name || ' ' || users.last_name as user_full_name,\n\n message_type_channel.message_type_name,\n message_type_channel.message_medium,\n message_type_channel.channel_id,\n message_type_channel.channel_name,\n message_type_channel.channel_type\n\n \n \n , event_extension.\"is_app_already_running\",\n event_extension.\"badge\",\n event_extension.\"catalog_collection_count\",\n event_extension.\"catalog_lookup_count\",\n event_extension.\"canonical_url_id\",\n event_extension.\"is_content_available\",\n event_extension.\"device\",\n event_extension.\"email_id\",\n event_extension.\"email_subject\",\n event_extension.\"experiment_id\",\n event_extension.\"from_phone_number_id\",\n event_extension.\"from_smssender_id\",\n event_extension.\"link_id\",\n event_extension.\"link_url\",\n event_extension.\"locale\",\n event_extension.\"payload\",\n event_extension.\"platform_endpoint\",\n event_extension.\"push_message\",\n event_extension.\"region\",\n event_extension.\"sms_message\",\n event_extension.\"to_phone_number\",\n event_extension.\"url\",\n event_extension.\"workflow_id\",\n event_extension.\"workflow_name\",\n event_extension.\"city\",\n event_extension.\"clicked_url\",\n event_extension.\"country\",\n event_extension.\"error_code\",\n event_extension.\"expires_at\",\n event_extension.\"from_phone_number\",\n event_extension.\"in_app_body\",\n event_extension.\"is_sms_estimation\",\n event_extension.\"labels\",\n event_extension.\"message_status\",\n event_extension.\"mms_send_count\",\n event_extension.\"reason\",\n event_extension.\"sms_send_count\"\n \n\n ,\n campaign.template_id,\n template.template_name,\n template.creator_user_id as template_creator_user_id\n \n from events\n\n \n left join event_extension\n on events.unique_event_id = event_extension.unique_event_id\n and events.source_relation = event_extension.source_relation\n \n\n left join campaign\n on events.campaign_id = campaign.campaign_id\n and events.source_relation = campaign.source_relation\n left join users\n on events.unique_user_key = users.unique_user_key -- unique_user_key = _fivetran_user_id if exists, otherwise email\n and events.source_relation = users.source_relation\n left join message_type_channel\n on events.message_type_id = message_type_channel.message_type_id\n and events.source_relation = message_type_channel.source_relation\n left join template\n on campaign.template_id = template.template_id\n and events.source_relation = template.source_relation\n)\n\nselect *\nfrom event_join", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.iterable__user_campaign": {"database": "postgres", "schema": "public_iterable_dev", "name": "iterable__user_campaign", "resource_type": "model", "package_name": "iterable", "path": "iterable__user_campaign.sql", "original_file_path": "models/iterable__user_campaign.sql", "unique_id": "model.iterable.iterable__user_campaign", "fqn": ["iterable", "iterable__user_campaign"], "alias": "iterable__user_campaign", "checksum": {"name": "sha256", "checksum": "343ed0b8ab547da53812f4a8426cfd7b93f81ce3886680c4182a2596f1ea8632"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "table", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "Table that provides total and unique metrics for a user associated with particular campaigns and if available, experiments.", "columns": {"source_relation": {"name": "source_relation", "description": "Identifies the record's source.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": ["doc.iterable.source_relation"]}, "unique_user_campaign_id": {"name": "unique_user_campaign_id", "description": "Unique ID combining source_relation, unique_user_key, campaign_id, and if available, experiment_id.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "_fivetran_user_id": {"name": "_fivetran_user_id", "description": "A Fivetran-created unique identifier for the new Iterable schema in Aug 2023, for users, derived from hashing user_id and/or email, depending on project type.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_user_key": {"name": "unique_user_key", "description": "The unique identifier of the user. With the new schema (Aug 2023), it is the _fivetran_user_id. This is a hash of user_id and/or email, depending on project type. If using the old schema, it is email.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "user_id": {"name": "user_id", "description": "User identifier, for userID-based projects.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "user_email": {"name": "user_email", "description": "Email of the user if it exists.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "user_full_name": {"name": "user_full_name", "description": "The users first and last name", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "campaign_id": {"name": "campaign_id", "description": "The unique identifier of the campaign which the user metrics are associated", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "campaign_name": {"name": "campaign_name", "description": "The name of the campaign which the user metrics are associated", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "template_id": {"name": "template_id", "description": "The unique identifier of the template used within the campaign", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "template_name": {"name": "template_name", "description": "The name of the template used for the campaign", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "experiment_id": {"name": "experiment_id", "description": "The unique experiment variation of the campaign", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "recurring_campaign_id": {"name": "recurring_campaign_id", "description": "The unique identifier of the recurring campaign which the campaign is tied to", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "recurring_campaign_name": {"name": "recurring_campaign_name", "description": "The name of the recurring campaign which the campaign is tied to", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "first_event_at": {"name": "first_event_at", "description": "Timestamp of the first campaign/experiment event associated with the user", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "last_event_at": {"name": "last_event_at", "description": "Timestamp of the most recent campaign/experiment event associated with the user", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_emailclick": {"name": "total_emailclick", "description": "Total email clicks events the user took within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_emailunsubscribe": {"name": "total_emailunsubscribe", "description": "Total email unsubscription events the user performed within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_emailcomplaint": {"name": "total_emailcomplaint", "description": "Total email complaint events the user performed within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_customevent": {"name": "total_customevent", "description": "Total custom events associated with the user within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_emailsubscribe": {"name": "total_emailsubscribe", "description": "Total email subscription events associate with the user within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_emailopen": {"name": "total_emailopen", "description": "Total email open events the user performed within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_pushsend": {"name": "total_pushsend", "description": "Total push send events the user performed within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_smsbounce": {"name": "total_smsbounce", "description": "Total sms bounce events associated with the user within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_pushbounce": {"name": "total_pushbounce", "description": "Total push bounce events associated with the user within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_inappsendskip": {"name": "total_inappsendskip", "description": "Total in app send skip events the user performed within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_smssend": {"name": "total_smssend", "description": "Total sms send events associated with the user within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_inappsend": {"name": "total_inappsend", "description": "Total in app send events associated with the user within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_pushopen": {"name": "total_pushopen", "description": "Total push open events the user performed within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_emailsend": {"name": "total_emailsend", "description": "Total email send event associated with the user within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_pushsendskip": {"name": "total_pushsendskip", "description": "Total push send skip events associated with the user within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_inappopen": {"name": "total_inappopen", "description": "Total in app open events associated with the user within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_emailsendskip": {"name": "total_emailsendskip", "description": "Total email send skip events associated with the user within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_emailbounce": {"name": "total_emailbounce", "description": "Total email bounce events associated with the user within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_inappclick": {"name": "total_inappclick", "description": "Total in app click events associated with the user within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_pushuninstall": {"name": "total_pushuninstall", "description": "Total push uninstall events associated with the user within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "first_open_or_click_event_at": {"name": "first_open_or_click_event_at", "description": "The time of the first open or click time. This is the first time a user interacts with a campaign, recording the earliest occurring event out of 'emailOpen', 'emailClick', and 'pushOpen'.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "iterable://models/iterable.yml", "build_path": null, "unrendered_config": {"materialized": "table", "schema": "iterable_{{ var('directed_schema','dev') }}", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789422569.7579815, "relation_name": "\"postgres\".\"public_iterable_dev\".\"iterable__user_campaign\"", "raw_code": "{% set using_event_extension = var('iterable__using_event_extension', True) %}\n\nwith events as (\n\n select *\n from {{ ref('iterable__events') }}\n\n), pivot_out_events as (\n\n-- this will be at the user-campaign-experiment variation level\n-- if experiment_id is null, the user-campaign interactions happened outside of an experiment\n-- if campaign_id is null, the user interactions are organic\n select\n source_relation,\n _fivetran_user_id,\n unique_user_key,\n user_id,\n campaign_id,\n\n {{ \"experiment_id,\" if using_event_extension }}\n\n email as user_email,\n user_full_name,\n case when campaign_id is null then 'organic' else campaign_name end as campaign_name,\n template_id,\n template_name,\n\n recurring_campaign_id,\n recurring_campaign_name,\n\n min(created_at) as first_event_at,\n max(created_at) as last_event_at,\n min(case when event_name in ('emailOpen', 'emailClick', 'pushOpen') then created_at end) as first_open_or_click_event_at\n\n\n -- count up the number of instances of each metric\n -- `iterable__event_metrics` is set by default to all events brought in by fivetran+iterable\n -- https://fivetran.com/docs/applications/iterable#schemanotes\n {% for em in var('iterable__event_metrics') %}\n , sum(case when lower(event_name) = '{{ em | lower }}' then 1 else 0 end)\n as {{ 'total_' ~ em | replace(' ', '_') | replace('(', '') | replace(')', '') | lower }}\n {% endfor %}\n\n from events\n\n {{ dbt_utils.group_by(n=13 if using_event_extension else 12 ) }}\n\n), add_surrogate_key as (\n\n {% set surrogate_key_fields = ['source_relation', 'unique_user_key', 'campaign_id'] %}\n {% do surrogate_key_fields.append('experiment_id') if var('iterable__using_event_extension', True) %}\n\n select \n *,\n {{ dbt_utils.generate_surrogate_key(surrogate_key_fields) }} as unique_user_campaign_id\n\n from pivot_out_events\n)\n\nselect *\nfrom add_surrogate_key", "doc_blocks": [], "language": "sql", "refs": [{"name": "iterable__events", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt_utils.group_by", "macro.dbt_utils.generate_surrogate_key"], "nodes": ["model.iterable.iterable__events"]}, "compiled_path": "target/compiled/iterable/models/iterable__user_campaign.sql", "compiled": true, "compiled_code": "\n\nwith events as (\n\n select *\n from \"postgres\".\"public_iterable_dev\".\"iterable__events\"\n\n), pivot_out_events as (\n\n-- this will be at the user-campaign-experiment variation level\n-- if experiment_id is null, the user-campaign interactions happened outside of an experiment\n-- if campaign_id is null, the user interactions are organic\n select\n source_relation,\n _fivetran_user_id,\n unique_user_key,\n user_id,\n campaign_id,\n\n experiment_id,\n\n email as user_email,\n user_full_name,\n case when campaign_id is null then 'organic' else campaign_name end as campaign_name,\n template_id,\n template_name,\n\n recurring_campaign_id,\n recurring_campaign_name,\n\n min(created_at) as first_event_at,\n max(created_at) as last_event_at,\n min(case when event_name in ('emailOpen', 'emailClick', 'pushOpen') then created_at end) as first_open_or_click_event_at\n\n\n -- count up the number of instances of each metric\n -- `iterable__event_metrics` is set by default to all events brought in by fivetran+iterable\n -- https://fivetran.com/docs/applications/iterable#schemanotes\n \n , sum(case when lower(event_name) = 'emailclick' then 1 else 0 end)\n as total_emailclick\n \n , sum(case when lower(event_name) = 'emailunsubscribe' then 1 else 0 end)\n as total_emailunsubscribe\n \n , sum(case when lower(event_name) = 'emailcomplaint' then 1 else 0 end)\n as total_emailcomplaint\n \n , sum(case when lower(event_name) = 'customevent' then 1 else 0 end)\n as total_customevent\n \n , sum(case when lower(event_name) = 'emailsubscribe' then 1 else 0 end)\n as total_emailsubscribe\n \n , sum(case when lower(event_name) = 'emailopen' then 1 else 0 end)\n as total_emailopen\n \n , sum(case when lower(event_name) = 'pushsend' then 1 else 0 end)\n as total_pushsend\n \n , sum(case when lower(event_name) = 'smsbounce' then 1 else 0 end)\n as total_smsbounce\n \n , sum(case when lower(event_name) = 'pushbounce' then 1 else 0 end)\n as total_pushbounce\n \n , sum(case when lower(event_name) = 'inappsendskip' then 1 else 0 end)\n as total_inappsendskip\n \n , sum(case when lower(event_name) = 'smssend' then 1 else 0 end)\n as total_smssend\n \n , sum(case when lower(event_name) = 'inappsend' then 1 else 0 end)\n as total_inappsend\n \n , sum(case when lower(event_name) = 'pushopen' then 1 else 0 end)\n as total_pushopen\n \n , sum(case when lower(event_name) = 'emailsend' then 1 else 0 end)\n as total_emailsend\n \n , sum(case when lower(event_name) = 'pushsendskip' then 1 else 0 end)\n as total_pushsendskip\n \n , sum(case when lower(event_name) = 'inappopen' then 1 else 0 end)\n as total_inappopen\n \n , sum(case when lower(event_name) = 'emailsendskip' then 1 else 0 end)\n as total_emailsendskip\n \n , sum(case when lower(event_name) = 'emailbounce' then 1 else 0 end)\n as total_emailbounce\n \n , sum(case when lower(event_name) = 'inappclick' then 1 else 0 end)\n as total_inappclick\n \n , sum(case when lower(event_name) = 'pushuninstall' then 1 else 0 end)\n as total_pushuninstall\n \n\n from events\n\n group by 1,2,3,4,5,6,7,8,9,10,11,12,13\n\n), add_surrogate_key as (\n\n \n \n\n select \n *,\n md5(cast(coalesce(cast(source_relation as TEXT), '_dbt_utils_surrogate_key_null_') || '-' || coalesce(cast(unique_user_key as TEXT), '_dbt_utils_surrogate_key_null_') || '-' || coalesce(cast(campaign_id as TEXT), '_dbt_utils_surrogate_key_null_') || '-' || coalesce(cast(experiment_id as TEXT), '_dbt_utils_surrogate_key_null_') as TEXT)) as unique_user_campaign_id\n\n from pivot_out_events\n)\n\nselect *\nfrom add_surrogate_key", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.iterable__user_unsubscriptions": {"database": "postgres", "schema": "public_iterable_dev", "name": "iterable__user_unsubscriptions", "resource_type": "model", "package_name": "iterable", "path": "iterable__user_unsubscriptions.sql", "original_file_path": "models/iterable__user_unsubscriptions.sql", "unique_id": "model.iterable.iterable__user_unsubscriptions", "fqn": ["iterable", "iterable__user_unsubscriptions"], "alias": "iterable__user_unsubscriptions", "checksum": {"name": "sha256", "checksum": "9ffdcfb7996a2147cd7739fc5ac7a1bd2e0db91e0ffc76d1458f53046fc4598f"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "table", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "Table that generates the total channel and message types a user has chosen to unsubscribe.", "columns": {"source_relation": {"name": "source_relation", "description": "Identifies the record's source.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": ["doc.iterable.source_relation"]}, "_fivetran_user_id": {"name": "_fivetran_user_id", "description": "A Fivetran-created unique identifier for the new Iterable schema in Aug 2023, for users, derived from hashing user_id and/or email, depending on project type.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_user_key": {"name": "unique_user_key", "description": "The unique identifier of the user. With the new schema (Aug 2023), it is the _fivetran_user_id. This is a hash of user_id and/or email, depending on project type. If using the old schema, it is email.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "channel_id": {"name": "channel_id", "description": "Unique identifier of the channel which the user is unsubscribed", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "message_type_id": {"name": "message_type_id", "description": "Unique identifier of the message type which the user is unsubscribed", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "channel_name": {"name": "channel_name", "description": "The name of the channel which the user is unsubscribed", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "message_type_name": {"name": "message_type_name", "description": "The name of the message type which the user is unsubscribed", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "channel_type": {"name": "channel_type", "description": "The channel type which the user is unsubscribed", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "message_medium": {"name": "message_medium", "description": "The medium type the message was provided which the user is unsubscribed", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "updated_at": {"name": "updated_at", "description": "Timestamp of when the user unsubscribed from the channel or message type", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "is_unsubscribed_channel_wide": {"name": "is_unsubscribed_channel_wide", "description": "Boolean indicating if the user unsubscribed at the channel level (i.e. unsubscribed to all message types) or if they unsubscribed from only an individual message type.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "iterable://models/iterable.yml", "build_path": null, "unrendered_config": {"materialized": "table", "schema": "iterable_{{ var('directed_schema','dev') }}", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789422569.7595944, "relation_name": "\"postgres\".\"public_iterable_dev\".\"iterable__user_unsubscriptions\"", "raw_code": "{% set using_user_unsubscribed_message_type = var('iterable__using_user_unsubscribed_message_type', True) %}\n\nwith message_type_channel as (\n\n select *\n from {{ ref('int_iterable__message_type_channel') }}\n\n), user_unsubscribed_channel as (\n\n select\n *\n from {{ ref('stg_iterable__user_unsubscribed_channel') }}\n where latest_batch_index = 1\n\n{% if using_user_unsubscribed_message_type %}\n), user_unsubscribed_message_type as (\n\n select\n *\n from {{ ref('stg_iterable__user_unsub_message_type') }}\n where latest_batch_index = 1\n\n{% endif %}\n\n), combine as (\n\n select\n source_relation,\n _fivetran_user_id,\n unique_user_key,\n channel_id,\n cast(null as {{ dbt.type_string() }}) as message_type_id,\n updated_at\n from user_unsubscribed_channel\n\n{% if using_user_unsubscribed_message_type %}\n\n union all\n\n select\n source_relation,\n _fivetran_user_id,\n unique_user_key,\n cast(null as {{ dbt.type_string() }}) as channel_id,\n message_type_id,\n updated_at\n from user_unsubscribed_message_type\n{% endif %}\n\n), final as (\n\n select\n combine.source_relation,\n combine._fivetran_user_id,\n combine.unique_user_key,\n -- coalescing since message_type -> channel goes up a grain\n coalesce(combine.channel_id, message_type_channel.channel_id) as channel_id,\n coalesce(combine.message_type_id, message_type_channel.message_type_id) as message_type_id,\n combine.updated_at,\n message_type_channel.channel_name,\n message_type_channel.message_type_name,\n message_type_channel.channel_type,\n message_type_channel.message_medium,\n case when combine.channel_id is not null then true else false end as is_unsubscribed_channel_wide\n\n from combine\n\n -- unsubscribing from an entire channel unsubscribes a user from all message types in that channel\n join message_type_channel\n on combine.source_relation = message_type_channel.source_relation\n and (combine.channel_id = message_type_channel.channel_id\n or combine.message_type_id = message_type_channel.message_type_id)\n)\n\nselect *\nfrom final", "doc_blocks": [], "language": "sql", "refs": [{"name": "int_iterable__message_type_channel", "package": null, "version": null}, {"name": "stg_iterable__user_unsubscribed_channel", "package": null, "version": null}, {"name": "stg_iterable__user_unsub_message_type", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.type_string"], "nodes": ["model.iterable.int_iterable__message_type_channel", "model.iterable.stg_iterable__user_unsubscribed_channel", "model.iterable.stg_iterable__user_unsub_message_type"]}, "compiled_path": "target/compiled/iterable/models/iterable__user_unsubscriptions.sql", "compiled": true, "compiled_code": "\n\nwith message_type_channel as (\n\n select *\n from \"postgres\".\"public_iterable_dev\".\"int_iterable__message_type_channel\"\n\n), user_unsubscribed_channel as (\n\n select\n *\n from \"postgres\".\"public_iterable_dev\".\"stg_iterable__user_unsubscribed_channel\"\n where latest_batch_index = 1\n\n\n), user_unsubscribed_message_type as (\n\n select\n *\n from \"postgres\".\"public_iterable_dev\".\"stg_iterable__user_unsub_message_type\"\n where latest_batch_index = 1\n\n\n\n), combine as (\n\n select\n source_relation,\n _fivetran_user_id,\n unique_user_key,\n channel_id,\n cast(null as TEXT) as message_type_id,\n updated_at\n from user_unsubscribed_channel\n\n\n\n union all\n\n select\n source_relation,\n _fivetran_user_id,\n unique_user_key,\n cast(null as TEXT) as channel_id,\n message_type_id,\n updated_at\n from user_unsubscribed_message_type\n\n\n), final as (\n\n select\n combine.source_relation,\n combine._fivetran_user_id,\n combine.unique_user_key,\n -- coalescing since message_type -> channel goes up a grain\n coalesce(combine.channel_id, message_type_channel.channel_id) as channel_id,\n coalesce(combine.message_type_id, message_type_channel.message_type_id) as message_type_id,\n combine.updated_at,\n message_type_channel.channel_name,\n message_type_channel.message_type_name,\n message_type_channel.channel_type,\n message_type_channel.message_medium,\n case when combine.channel_id is not null then true else false end as is_unsubscribed_channel_wide\n\n from combine\n\n -- unsubscribing from an entire channel unsubscribes a user from all message types in that channel\n join message_type_channel\n on combine.source_relation = message_type_channel.source_relation\n and (combine.channel_id = message_type_channel.channel_id\n or combine.message_type_id = message_type_channel.message_type_id)\n)\n\nselect *\nfrom final", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.iterable__journeys": {"database": "postgres", "schema": "public_iterable_dev", "name": "iterable__journeys", "resource_type": "model", "package_name": "iterable", "path": "iterable__journeys.sql", "original_file_path": "models/iterable__journeys.sql", "unique_id": "model.iterable.iterable__journeys", "fqn": ["iterable", "iterable__journeys"], "alias": "iterable__journeys", "checksum": {"name": "sha256", "checksum": "cc93337c06625ef9675afae4540f52c2cb0cb78669a9a881f650742e8679380b"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "table", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "Table that provides aggregations for journeys, formerly known as workflows. Metrics are rolled up from the user/campaign grain via each campaign's journey reference. Journeys which generate no events, such as those that only split audiences or update user fields, are still included with null metrics. The grain of this table is one record per journey.\n", "columns": {"source_relation": {"name": "source_relation", "description": "Identifies the record's source.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": ["doc.iterable.source_relation"]}, "journey_id": {"name": "journey_id", "description": "Unique identifier of the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_journey_id": {"name": "unique_journey_id", "description": "Unique identifier combining journey_id and source_relation.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "journey_name": {"name": "journey_name", "description": "User defined name of the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "journey_type": {"name": "journey_type", "description": "The journey type", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "journey_description": {"name": "journey_description", "description": "Information about the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "creator_user_id": {"name": "creator_user_id", "description": "Reference to the user who created the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "is_enabled": {"name": "is_enabled", "description": "Boolean indicating if the journey is currently enabled", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "is_archived": {"name": "is_archived", "description": "Boolean indicating if the journey has been archived", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "lifetime_limit": {"name": "lifetime_limit", "description": "Maximum number of times a user may enter the journey over their lifetime", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "simultaneous_limit": {"name": "simultaneous_limit", "description": "Maximum number of times a user may be in the journey at the same time", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "start_tile_id": {"name": "start_tile_id", "description": "Reference to the tile which begins the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "trigger_event_names": {"name": "trigger_event_names", "description": "The event names which trigger a user's entry into the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "created_at": {"name": "created_at", "description": "Creation timestamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "updated_at": {"name": "updated_at", "description": "Last update timestamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "The time when a record was last updated by Fivetran.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": ["doc.iterable._fivetran_synced"]}, "count_total_campaigns": {"name": "count_total_campaigns", "description": "Count of distinct campaigns within the journey that generated events", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "count_unique_users": {"name": "count_unique_users", "description": "Count of total unique users within the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "first_event_at": {"name": "first_event_at", "description": "Timestamp of the first event generated by any campaign in the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "last_event_at": {"name": "last_event_at", "description": "Timestamp of the most recent event generated by any campaign in the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_emailclick": {"name": "total_emailclick", "description": "Total email clicks within the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_total_emailclick": {"name": "unique_total_emailclick", "description": "Count of distinct users with email clicks within the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_emailunsubscribe": {"name": "total_emailunsubscribe", "description": "Total email unsubscribe events within the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_total_emailunsubscribe": {"name": "unique_total_emailunsubscribe", "description": "Count of distinct users with email unsubscribe events within the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_emailcomplaint": {"name": "total_emailcomplaint", "description": "Total email complaints within the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_total_emailcomplaint": {"name": "unique_total_emailcomplaint", "description": "Count of distinct users with email complaints within the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_customevent": {"name": "total_customevent", "description": "Total custom events within the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_total_customevent": {"name": "unique_total_customevent", "description": "Count of distinct users with custom events within the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_emailsubscribe": {"name": "total_emailsubscribe", "description": "Total email subscribe events within the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_total_emailsubscribe": {"name": "unique_total_emailsubscribe", "description": "Count of distinct users with email subscribe events within the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_emailopen": {"name": "total_emailopen", "description": "Total email open events within the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_total_emailopen": {"name": "unique_total_emailopen", "description": "Count of distinct users with email open events within the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_pushsend": {"name": "total_pushsend", "description": "Total push send events within the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_total_pushsend": {"name": "unique_total_pushsend", "description": "Count of distinct users with push send events within the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_smsbounce": {"name": "total_smsbounce", "description": "Total sms bounce events within the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_total_smsbounce": {"name": "unique_total_smsbounce", "description": "Count of distinct users with sms bounce events within the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_pushbounce": {"name": "total_pushbounce", "description": "Total push bounce events within the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_total_pushbounce": {"name": "unique_total_pushbounce", "description": "Count of distinct users with push bounce events within the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_inappsendskip": {"name": "total_inappsendskip", "description": "Total in app send skip events within the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_total_inappsendskip": {"name": "unique_total_inappsendskip", "description": "Count of distinct users with in app send skip events within the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_smssend": {"name": "total_smssend", "description": "Total sms send events within the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_total_smssend": {"name": "unique_total_smssend", "description": "Count of distinct users with sms send events within the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_inappsend": {"name": "total_inappsend", "description": "Total in app send events within the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_total_inappsend": {"name": "unique_total_inappsend", "description": "Count of distinct users with in app send events within the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_pushopen": {"name": "total_pushopen", "description": "Total push open events within the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_total_pushopen": {"name": "unique_total_pushopen", "description": "Count of distinct users with push open events within the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_emailsend": {"name": "total_emailsend", "description": "Total email send events within the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_total_emailsend": {"name": "unique_total_emailsend", "description": "Count of distinct users with email send events within the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_pushsendskip": {"name": "total_pushsendskip", "description": "Total push send skip events within the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_total_pushsendskip": {"name": "unique_total_pushsendskip", "description": "Count of distinct users with push send skip events within the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_inappopen": {"name": "total_inappopen", "description": "Total in app open events within the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_total_inappopen": {"name": "unique_total_inappopen", "description": "Count of distinct users with in app open events within the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_emailsendskip": {"name": "total_emailsendskip", "description": "Total email send skip events within the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_total_emailsendskip": {"name": "unique_total_emailsendskip", "description": "Count of distinct users with email send skip events within the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_emailbounce": {"name": "total_emailbounce", "description": "Total email bounce events within the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_total_emailbounce": {"name": "unique_total_emailbounce", "description": "Count of distinct users with email bounce events within the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_inappclick": {"name": "total_inappclick", "description": "Total in app click events within the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_total_inappclick": {"name": "unique_total_inappclick", "description": "Count of distinct users with in app click events within the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_pushuninstall": {"name": "total_pushuninstall", "description": "Total push uninstall events within the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_total_pushuninstall": {"name": "unique_total_pushuninstall", "description": "Count of distinct users with push uninstall events within the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "iterable://models/iterable.yml", "build_path": null, "unrendered_config": {"materialized": "table", "schema": "iterable_{{ var('directed_schema','dev') }}", "enabled": "var('iterable__using_journey', True)", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789422569.7497828, "relation_name": "\"postgres\".\"public_iterable_dev\".\"iterable__journeys\"", "raw_code": "{{ config(enabled=var('iterable__using_journey', True)) }}\n\nwith journey as (\n\n select *\n from {{ ref('stg_iterable__journey') }}\n\n), journey_metrics as (\n\n select *\n from {{ ref('int_iterable__journey_event_metrics') }}\n\n), journey_join as (\n\n {% set exclude_fields = ['source_relation', 'journey_id'] %} -- these are in journey\n\n -- left join so journeys that generate no events, such as audience-splitting or\n -- field-update journeys, are still reported with null metrics\n select\n journey.*,\n {{ dbt_utils.star(from=ref('int_iterable__journey_event_metrics'), except=exclude_fields, relation_alias=\"journey_metrics\") }}\n\n from journey\n\n left join journey_metrics\n on journey.journey_id = journey_metrics.journey_id\n and journey.source_relation = journey_metrics.source_relation\n\n), add_surrogate_key as (\n\n {% set surrogate_key_fields = ['journey_id', 'source_relation'] %}\n\n select\n *,\n {{ dbt_utils.generate_surrogate_key(surrogate_key_fields) }} as unique_journey_id\n\n from journey_join\n)\n\nselect *\nfrom add_surrogate_key", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__journey", "package": null, "version": null}, {"name": "int_iterable__journey_event_metrics", "package": null, "version": null}, {"name": "int_iterable__journey_event_metrics", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt_utils.star", "macro.dbt_utils.generate_surrogate_key"], "nodes": ["model.iterable.stg_iterable__journey", "model.iterable.int_iterable__journey_event_metrics"]}, "compiled_path": "target/compiled/iterable/models/iterable__journeys.sql", "compiled": true, "compiled_code": "\n\nwith journey as (\n\n select *\n from \"postgres\".\"public_iterable_dev\".\"stg_iterable__journey\"\n\n), journey_metrics as (\n\n select *\n from \"postgres\".\"public_iterable_dev\".\"int_iterable__journey_event_metrics\"\n\n), journey_join as (\n\n -- these are in journey\n\n -- left join so journeys that generate no events, such as audience-splitting or\n -- field-update journeys, are still reported with null metrics\n select\n journey.*,\n journey_metrics.\"count_total_campaigns\",\n journey_metrics.\"count_unique_users\",\n journey_metrics.\"first_event_at\",\n journey_metrics.\"last_event_at\",\n journey_metrics.\"total_emailclick\",\n journey_metrics.\"unique_total_emailclick\",\n journey_metrics.\"total_emailunsubscribe\",\n journey_metrics.\"unique_total_emailunsubscribe\",\n journey_metrics.\"total_emailcomplaint\",\n journey_metrics.\"unique_total_emailcomplaint\",\n journey_metrics.\"total_customevent\",\n journey_metrics.\"unique_total_customevent\",\n journey_metrics.\"total_emailsubscribe\",\n journey_metrics.\"unique_total_emailsubscribe\",\n journey_metrics.\"total_emailopen\",\n journey_metrics.\"unique_total_emailopen\",\n journey_metrics.\"total_pushsend\",\n journey_metrics.\"unique_total_pushsend\",\n journey_metrics.\"total_smsbounce\",\n journey_metrics.\"unique_total_smsbounce\",\n journey_metrics.\"total_pushbounce\",\n journey_metrics.\"unique_total_pushbounce\",\n journey_metrics.\"total_inappsendskip\",\n journey_metrics.\"unique_total_inappsendskip\",\n journey_metrics.\"total_smssend\",\n journey_metrics.\"unique_total_smssend\",\n journey_metrics.\"total_inappsend\",\n journey_metrics.\"unique_total_inappsend\",\n journey_metrics.\"total_pushopen\",\n journey_metrics.\"unique_total_pushopen\",\n journey_metrics.\"total_emailsend\",\n journey_metrics.\"unique_total_emailsend\",\n journey_metrics.\"total_pushsendskip\",\n journey_metrics.\"unique_total_pushsendskip\",\n journey_metrics.\"total_inappopen\",\n journey_metrics.\"unique_total_inappopen\",\n journey_metrics.\"total_emailsendskip\",\n journey_metrics.\"unique_total_emailsendskip\",\n journey_metrics.\"total_emailbounce\",\n journey_metrics.\"unique_total_emailbounce\",\n journey_metrics.\"total_inappclick\",\n journey_metrics.\"unique_total_inappclick\",\n journey_metrics.\"total_pushuninstall\",\n journey_metrics.\"unique_total_pushuninstall\"\n\n from journey\n\n left join journey_metrics\n on journey.journey_id = journey_metrics.journey_id\n and journey.source_relation = journey_metrics.source_relation\n\n), add_surrogate_key as (\n\n \n\n select\n *,\n md5(cast(coalesce(cast(journey_id as TEXT), '_dbt_utils_surrogate_key_null_') || '-' || coalesce(cast(source_relation as TEXT), '_dbt_utils_surrogate_key_null_') as TEXT)) as unique_journey_id\n\n from journey_join\n)\n\nselect *\nfrom add_surrogate_key", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": ["unique_journey_id"], "time_spine": null}, "model.iterable.iterable__campaigns": {"database": "postgres", "schema": "public_iterable_dev", "name": "iterable__campaigns", "resource_type": "model", "package_name": "iterable", "path": "iterable__campaigns.sql", "original_file_path": "models/iterable__campaigns.sql", "unique_id": "model.iterable.iterable__campaigns", "fqn": ["iterable", "iterable__campaigns"], "alias": "iterable__campaigns", "checksum": {"name": "sha256", "checksum": "8a06f641cc3e4a6fcf53c1ff0571db0c9b0e7212a2a2ff5ea9111e035a96b0cc"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "table", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "Table that provides aggregations for campaigns at the template and if available, the experiment grain.", "columns": {"source_relation": {"name": "source_relation", "description": "Identifies the record's source.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": ["doc.iterable.source_relation"]}, "campaign_id": {"name": "campaign_id", "description": "Unique identifier of the campaign record", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_campaign_version_id": {"name": "unique_campaign_version_id", "description": "Unique identifier combining campaign_id, template_id, source_relation, and if available, experiment_id.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "campaign_name": {"name": "campaign_name", "description": "User defined name of the campaign.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "updated_at": {"name": "updated_at", "description": "Last update timestamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "campaign_state": {"name": "campaign_state", "description": "State of the campaign. Can be Draft, Ready, Scheduled, Running, Finished, Starting, Aborted or Recurring", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "campaign_type": {"name": "campaign_type", "description": "The campaign type. Can be Blast or Triggered", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "send_size": {"name": "send_size", "description": "Size of the campaign. Number of individuals included in the campaign", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "start_at": {"name": "start_at", "description": "Start timestamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "ended_at": {"name": "ended_at", "description": "Ended timestamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "created_at": {"name": "created_at", "description": "Creation timestamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "created_by_user_id": {"name": "created_by_user_id", "description": "Reference to the user who created the campaign", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "template_id": {"name": "template_id", "description": "Reference to the campaign template", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "recurring_campaign_id": {"name": "recurring_campaign_id", "description": "Unique identifier of the recurring campaign (if applicable)", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "recurring_campaign_name": {"name": "recurring_campaign_name", "description": "Name of the recurring campaign (if applicable)", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "recurring_campaign_state": {"name": "recurring_campaign_state", "description": "State of the recurring campaign (if applicable)", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "recurring_campaign_send_size": {"name": "recurring_campaign_send_size", "description": "Size of the recurring campaign. Number of individuals included in the recurring campaign (if applicable)", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "recurring_campaign_start_at": {"name": "recurring_campaign_start_at", "description": "Timestamp of when the recurring campaign started (if applicable)", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "is_campaign_recurring": {"name": "is_campaign_recurring", "description": "Boolean indicating if the campaign is a recurring campaign", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "experiment_id": {"name": "experiment_id", "description": "Reference to the experiment used if the event is an experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "count_unique_users": {"name": "count_unique_users", "description": "Count of total unique users within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_emailclick": {"name": "total_emailclick", "description": "Total email clicks within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_total_emailclick": {"name": "unique_total_emailclick", "description": "Unique email clicks within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_emailunsubscribe": {"name": "total_emailunsubscribe", "description": "Total email unsubscribe events within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_total_emailunsubscribe": {"name": "unique_total_emailunsubscribe", "description": "Unique total email unsubscribe events within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_emailcomplaint": {"name": "total_emailcomplaint", "description": "Total email complaints within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_total_emailcomplaint": {"name": "unique_total_emailcomplaint", "description": "Unique total email complaints within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_customevent": {"name": "total_customevent", "description": "Total custom events within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_total_customevent": {"name": "unique_total_customevent", "description": "Unique total custom events within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_emailsubscribe": {"name": "total_emailsubscribe", "description": "Total email subscribe events within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_total_emailsubscribe": {"name": "unique_total_emailsubscribe", "description": "Unique total email subscribe events within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_emailopen": {"name": "total_emailopen", "description": "Total email open events within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_total_emailopen": {"name": "unique_total_emailopen", "description": "Unique total email open events within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_pushsend": {"name": "total_pushsend", "description": "Total push send event within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_total_pushsend": {"name": "unique_total_pushsend", "description": "Unique total push send events within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_smsbounce": {"name": "total_smsbounce", "description": "Total sms bounce events within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_total_smsbounce": {"name": "unique_total_smsbounce", "description": "Unique total sms bounce events within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_pushbounce": {"name": "total_pushbounce", "description": "Total push bounce events within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_total_pushbounce": {"name": "unique_total_pushbounce", "description": "Unique total push bounce events within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_inappsendskip": {"name": "total_inappsendskip", "description": "Total in app send skip events within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_total_inappsendskip": {"name": "unique_total_inappsendskip", "description": "Unique total in app send skip events within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_smssend": {"name": "total_smssend", "description": "Total sms send events within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_total_smssend": {"name": "unique_total_smssend", "description": "Unique total sms send events within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_inappsend": {"name": "total_inappsend", "description": "Total in app send events within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_total_inappsend": {"name": "unique_total_inappsend", "description": "Unique total in app send events within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_pushopen": {"name": "total_pushopen", "description": "Total push open events within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_total_pushopen": {"name": "unique_total_pushopen", "description": "Unique total push open events within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_emailsend": {"name": "total_emailsend", "description": "Total email send events within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_total_emailsend": {"name": "unique_total_emailsend", "description": "Unique total email send events within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_pushsendskip": {"name": "total_pushsendskip", "description": "Total push send skip events within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_total_pushsendskip": {"name": "unique_total_pushsendskip", "description": "Unique total push send skip events within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_inappopen": {"name": "total_inappopen", "description": "Total in app open events within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_total_inappopen": {"name": "unique_total_inappopen", "description": "Unique total in app open events within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_emailsendskip": {"name": "total_emailsendskip", "description": "Total email send skip events within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_total_emailsendskip": {"name": "unique_total_emailsendskip", "description": "Unique total email send skip events within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_emailbounce": {"name": "total_emailbounce", "description": "Total email bounce events within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_total_emailbounce": {"name": "unique_total_emailbounce", "description": "Unique total email bounce events within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_inappclick": {"name": "total_inappclick", "description": "Total in app click events within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_total_inappclick": {"name": "unique_total_inappclick", "description": "Unique total in app click events within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_pushuninstall": {"name": "total_pushuninstall", "description": "Total push uninstall events within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_total_pushuninstall": {"name": "unique_total_pushuninstall", "description": "Unique total push uninstall events within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "count_send_lists": {"name": "count_send_lists", "description": "Count of send lists within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "count_suppress_lists": {"name": "count_suppress_lists", "description": "Count of suppress lists within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "labels": {"name": "labels", "description": "List of labels associated with the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "journey_id": {"name": "journey_id", "description": "Reference to the journey the campaign belongs to, if applicable", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "journey_name": {"name": "journey_name", "description": "User defined name of the journey the campaign belongs to, if applicable", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "journey_type": {"name": "journey_type", "description": "The type of the journey the campaign belongs to, if applicable", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "template_name": {"name": "template_name", "description": "Name of the template associated with the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "template_creator_user_id": {"name": "template_creator_user_id", "description": "The creator user id of the template associated with the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "message_medium": {"name": "message_medium", "description": "The medium which the message was provided", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "message_type_name": {"name": "message_type_name", "description": "The message type name associated with the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "channel_name": {"name": "channel_name", "description": "The channel name associated with the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "channel_id": {"name": "channel_id", "description": "The channel identifier associated with the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "channel_type": {"name": "channel_type", "description": "The channel type associated with the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "iterable://models/iterable.yml", "build_path": null, "unrendered_config": {"materialized": "table", "schema": "iterable_{{ var('directed_schema','dev') }}", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789422569.7191765, "relation_name": "\"postgres\".\"public_iterable_dev\".\"iterable__campaigns\"", "raw_code": "with campaign_event_metrics as (\n\n select *\n from {{ ref('int_iterable__campaign_event_metrics') }}\n\n), campaign_list_metrics as (\n\n select\n source_relation,\n campaign_id,\n sum(case when list_activity = 'send' then 1 else 0 end) as count_send_lists,\n sum(case when list_activity = 'suppress' then 1 else 0 end) as count_suppress_lists\n\n from {{ ref('int_iterable__campaign_lists') }}\n {{ dbt_utils.group_by(n=2) }}\n\n), campaign as (\n\n select *\n from {{ ref('int_iterable__recurring_campaigns') }}\n \n{% if var('iterable__using_campaign_label_history', true) %}\n), campaign_labels as (\n\n select *\n from {{ ref('int_iterable__campaign_labels') }}\n\n{% endif %}\n\n), template as (\n -- rebringing this in (it is brought in iterable__events) in case any campaigns don't have events yet\n -- this will result in some DAG ugliness but maintains template info for non-sent campaigns\n select *\n from {{ ref('int_iterable__latest_template') }}\n\n{% if var('iterable__using_journey', true) %}\n), journey as (\n\n select *\n from {{ ref('stg_iterable__journey') }}\n\n{% endif %}\n\n), campaign_join as (\n\n {% set exclude_fields = ['source_relation', 'campaign_id', 'template_id'] %} -- these are in campaigns\n\n -- this query will be at the campaign and experiment(if available) variation grain\n select\n campaign.*,\n {{ dbt_utils.star(from=ref('int_iterable__campaign_event_metrics'), except=exclude_fields, relation_alias=\"campaign_event_metrics\") }}\n , \n campaign_list_metrics.count_send_lists,\n campaign_list_metrics.count_suppress_lists,\n {% if var('iterable__using_campaign_label_history', true) %}\n campaign_labels.labels,\n {% endif %}\n {% if var('iterable__using_journey', true) %}\n journey.journey_name,\n journey.journey_type,\n {% endif %}\n template.template_name,\n template.creator_user_id as template_creator_user_id,\n template.message_medium,\n template.message_type_name,\n template.channel_name,\n template.channel_id,\n template.channel_type\n\n from campaign\n left join campaign_event_metrics\n on campaign.campaign_id = campaign_event_metrics.campaign_id\n and campaign.template_id = campaign_event_metrics.template_id\n and campaign.source_relation = campaign_event_metrics.source_relation\n left join campaign_list_metrics\n on campaign.campaign_id = campaign_list_metrics.campaign_id\n and campaign.source_relation = campaign_list_metrics.source_relation\n\n {% if var('iterable__using_campaign_label_history', true) %}\n left join campaign_labels\n on campaign.campaign_id = campaign_labels.campaign_id\n and campaign.source_relation = campaign_labels.source_relation\n {% endif %}\n\n left join template\n on campaign.template_id = template.template_id\n and campaign.source_relation = template.source_relation\n\n {% if var('iterable__using_journey', true) %}\n left join journey\n on campaign.journey_id = journey.journey_id\n and campaign.source_relation = journey.source_relation\n {% endif %}\n\n), add_surrogate_key as (\n\n {% set surrogate_key_fields = ['campaign_id', 'template_id', 'source_relation'] %}\n {% do surrogate_key_fields.append('experiment_id') if var('iterable__using_event_extension', True) %}\n\n select \n *,\n {{ dbt_utils.generate_surrogate_key(surrogate_key_fields) }} as unique_campaign_version_id\n\n from campaign_join\n)\n\nselect *\nfrom add_surrogate_key", "doc_blocks": [], "language": "sql", "refs": [{"name": "int_iterable__campaign_event_metrics", "package": null, "version": null}, {"name": "int_iterable__campaign_lists", "package": null, "version": null}, {"name": "int_iterable__recurring_campaigns", "package": null, "version": null}, {"name": "int_iterable__campaign_labels", "package": null, "version": null}, {"name": "int_iterable__latest_template", "package": null, "version": null}, {"name": "stg_iterable__journey", "package": null, "version": null}, {"name": "int_iterable__campaign_event_metrics", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt_utils.group_by", "macro.dbt_utils.star", "macro.dbt_utils.generate_surrogate_key"], "nodes": ["model.iterable.int_iterable__campaign_event_metrics", "model.iterable.int_iterable__campaign_lists", "model.iterable.int_iterable__recurring_campaigns", "model.iterable.int_iterable__campaign_labels", "model.iterable.int_iterable__latest_template", "model.iterable.stg_iterable__journey"]}, "compiled_path": "target/compiled/iterable/models/iterable__campaigns.sql", "compiled": true, "compiled_code": "with campaign_event_metrics as (\n\n select *\n from \"postgres\".\"public_iterable_dev\".\"int_iterable__campaign_event_metrics\"\n\n), campaign_list_metrics as (\n\n select\n source_relation,\n campaign_id,\n sum(case when list_activity = 'send' then 1 else 0 end) as count_send_lists,\n sum(case when list_activity = 'suppress' then 1 else 0 end) as count_suppress_lists\n\n from \"postgres\".\"public_iterable_dev\".\"int_iterable__campaign_lists\"\n group by 1,2\n\n), campaign as (\n\n select *\n from \"postgres\".\"public_iterable_dev\".\"int_iterable__recurring_campaigns\"\n \n\n), campaign_labels as (\n\n select *\n from \"postgres\".\"public_iterable_dev\".\"int_iterable__campaign_labels\"\n\n\n\n), template as (\n -- rebringing this in (it is brought in iterable__events) in case any campaigns don't have events yet\n -- this will result in some DAG ugliness but maintains template info for non-sent campaigns\n select *\n from \"postgres\".\"public_iterable_dev\".\"int_iterable__latest_template\"\n\n\n), journey as (\n\n select *\n from \"postgres\".\"public_iterable_dev\".\"stg_iterable__journey\"\n\n\n\n), campaign_join as (\n\n -- these are in campaigns\n\n -- this query will be at the campaign and experiment(if available) variation grain\n select\n campaign.*,\n campaign_event_metrics.\"experiment_id\",\n campaign_event_metrics.\"count_unique_users\",\n campaign_event_metrics.\"total_emailclick\",\n campaign_event_metrics.\"unique_total_emailclick\",\n campaign_event_metrics.\"total_emailunsubscribe\",\n campaign_event_metrics.\"unique_total_emailunsubscribe\",\n campaign_event_metrics.\"total_emailcomplaint\",\n campaign_event_metrics.\"unique_total_emailcomplaint\",\n campaign_event_metrics.\"total_customevent\",\n campaign_event_metrics.\"unique_total_customevent\",\n campaign_event_metrics.\"total_emailsubscribe\",\n campaign_event_metrics.\"unique_total_emailsubscribe\",\n campaign_event_metrics.\"total_emailopen\",\n campaign_event_metrics.\"unique_total_emailopen\",\n campaign_event_metrics.\"total_pushsend\",\n campaign_event_metrics.\"unique_total_pushsend\",\n campaign_event_metrics.\"total_smsbounce\",\n campaign_event_metrics.\"unique_total_smsbounce\",\n campaign_event_metrics.\"total_pushbounce\",\n campaign_event_metrics.\"unique_total_pushbounce\",\n campaign_event_metrics.\"total_inappsendskip\",\n campaign_event_metrics.\"unique_total_inappsendskip\",\n campaign_event_metrics.\"total_smssend\",\n campaign_event_metrics.\"unique_total_smssend\",\n campaign_event_metrics.\"total_inappsend\",\n campaign_event_metrics.\"unique_total_inappsend\",\n campaign_event_metrics.\"total_pushopen\",\n campaign_event_metrics.\"unique_total_pushopen\",\n campaign_event_metrics.\"total_emailsend\",\n campaign_event_metrics.\"unique_total_emailsend\",\n campaign_event_metrics.\"total_pushsendskip\",\n campaign_event_metrics.\"unique_total_pushsendskip\",\n campaign_event_metrics.\"total_inappopen\",\n campaign_event_metrics.\"unique_total_inappopen\",\n campaign_event_metrics.\"total_emailsendskip\",\n campaign_event_metrics.\"unique_total_emailsendskip\",\n campaign_event_metrics.\"total_emailbounce\",\n campaign_event_metrics.\"unique_total_emailbounce\",\n campaign_event_metrics.\"total_inappclick\",\n campaign_event_metrics.\"unique_total_inappclick\",\n campaign_event_metrics.\"total_pushuninstall\",\n campaign_event_metrics.\"unique_total_pushuninstall\"\n , \n campaign_list_metrics.count_send_lists,\n campaign_list_metrics.count_suppress_lists,\n \n campaign_labels.labels,\n \n \n journey.journey_name,\n journey.journey_type,\n \n template.template_name,\n template.creator_user_id as template_creator_user_id,\n template.message_medium,\n template.message_type_name,\n template.channel_name,\n template.channel_id,\n template.channel_type\n\n from campaign\n left join campaign_event_metrics\n on campaign.campaign_id = campaign_event_metrics.campaign_id\n and campaign.template_id = campaign_event_metrics.template_id\n and campaign.source_relation = campaign_event_metrics.source_relation\n left join campaign_list_metrics\n on campaign.campaign_id = campaign_list_metrics.campaign_id\n and campaign.source_relation = campaign_list_metrics.source_relation\n\n \n left join campaign_labels\n on campaign.campaign_id = campaign_labels.campaign_id\n and campaign.source_relation = campaign_labels.source_relation\n \n\n left join template\n on campaign.template_id = template.template_id\n and campaign.source_relation = template.source_relation\n\n \n left join journey\n on campaign.journey_id = journey.journey_id\n and campaign.source_relation = journey.source_relation\n \n\n), add_surrogate_key as (\n\n \n \n\n select \n *,\n md5(cast(coalesce(cast(campaign_id as TEXT), '_dbt_utils_surrogate_key_null_') || '-' || coalesce(cast(template_id as TEXT), '_dbt_utils_surrogate_key_null_') || '-' || coalesce(cast(source_relation as TEXT), '_dbt_utils_surrogate_key_null_') || '-' || coalesce(cast(experiment_id as TEXT), '_dbt_utils_surrogate_key_null_') as TEXT)) as unique_campaign_version_id\n\n from campaign_join\n)\n\nselect *\nfrom add_surrogate_key", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.int_iterable__campaign_labels": {"database": "postgres", "schema": "public_iterable_dev", "name": "int_iterable__campaign_labels", "resource_type": "model", "package_name": "iterable", "path": "intermediate/int_iterable__campaign_labels.sql", "original_file_path": "models/intermediate/int_iterable__campaign_labels.sql", "unique_id": "model.iterable.int_iterable__campaign_labels", "fqn": ["iterable", "intermediate", "int_iterable__campaign_labels"], "alias": "int_iterable__campaign_labels", "checksum": {"name": "sha256", "checksum": "64ae8d410bd6673399326348a650a7facc7b6631aa34fbb01a1598cb96c7d012"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "Table that provides the distinct string aggregation of labels for each campaign.", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "iterable://models/intermediate/int_iterable.yml", "build_path": null, "unrendered_config": {"materialized": "view", "schema": "iterable_{{ var('directed_schema','dev') }}", "enabled": "var('iterable__using_campaign_label_history', True)", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789422569.8883388, "relation_name": "\"postgres\".\"public_iterable_dev\".\"int_iterable__campaign_labels\"", "raw_code": "{{ config(enabled=var('iterable__using_campaign_label_history', True)) }}\n\nwith campaign_label_history as (\n\n select *\n from {{ ref('stg_iterable__campaign_label_history') }}\n\n), order_campaign_labels as (\n\n select \n *,\n rank() over(partition by campaign_id{{ fivetran_utils.partition_by_source_relation(package_name='iterable') }} order by updated_at desc) as latest_label_batch_index\n\n from campaign_label_history\n\n), latest_labels as (\n\n select *\n from order_campaign_labels\n where latest_label_batch_index = 1\n\n), aggregate_labels as (\n\n select\n source_relation,\n campaign_id,\n {{ fivetran_utils.string_agg('distinct label', \"', '\") }} as labels\n\n from latest_labels\n {{ dbt_utils.group_by(n=2) }}\n)\n\nselect * from aggregate_labels", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__campaign_label_history", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.fivetran_utils.partition_by_source_relation", "macro.fivetran_utils.string_agg", "macro.dbt_utils.group_by"], "nodes": ["model.iterable.stg_iterable__campaign_label_history"]}, "compiled_path": "target/compiled/iterable/models/intermediate/int_iterable__campaign_labels.sql", "compiled": true, "compiled_code": "\n\nwith campaign_label_history as (\n\n select *\n from \"postgres\".\"public_iterable_dev\".\"stg_iterable__campaign_label_history\"\n\n), order_campaign_labels as (\n\n select \n *,\n rank() over(partition by campaign_id order by updated_at desc) as latest_label_batch_index\n\n from campaign_label_history\n\n), latest_labels as (\n\n select *\n from order_campaign_labels\n where latest_label_batch_index = 1\n\n), aggregate_labels as (\n\n select\n source_relation,\n campaign_id,\n \n string_agg(distinct label, ', ')\n\n as labels\n\n from latest_labels\n group by 1,2\n)\n\nselect * from aggregate_labels", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.int_iterable__journey_event_metrics": {"database": "postgres", "schema": "public_iterable_dev", "name": "int_iterable__journey_event_metrics", "resource_type": "model", "package_name": "iterable", "path": "intermediate/int_iterable__journey_event_metrics.sql", "original_file_path": "models/intermediate/int_iterable__journey_event_metrics.sql", "unique_id": "model.iterable.int_iterable__journey_event_metrics", "fqn": ["iterable", "intermediate", "int_iterable__journey_event_metrics"], "alias": "int_iterable__journey_event_metrics", "checksum": {"name": "sha256", "checksum": "bfde0156d4c1044ca7bc2993a11f34370dba3692b6d75b001ed4a9ba799b38b4"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "Table that generates relevant total and unique journey level aggregations, rolled up from the user/campaign grain via the campaign's journey reference.", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "iterable://models/intermediate/int_iterable.yml", "build_path": null, "unrendered_config": {"materialized": "view", "schema": "iterable_{{ var('directed_schema','dev') }}", "enabled": "var('iterable__using_journey', True)", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789422569.8893602, "relation_name": "\"postgres\".\"public_iterable_dev\".\"int_iterable__journey_event_metrics\"", "raw_code": "{{ config(enabled=var('iterable__using_journey', True)) }}\n\nwith user_campaign as (\n select *\n from {{ ref('iterable__user_campaign') }}\n\n), campaign as (\n\n select\n source_relation,\n campaign_id,\n journey_id\n\n from {{ ref('int_iterable__recurring_campaigns') }}\n where journey_id is not null\n\n), journey_event_metrics as (\n{%- set user_campaign_columns = adapter.get_columns_in_relation(ref('iterable__user_campaign')) %}\n{%- set non_agg_columns = ['source_relation', 'unique_user_key', 'user_id', '_fivetran_user_id',\n 'user_email', 'user_full_name', 'campaign_id', 'campaign_name', 'recurring_campaign_id',\n 'recurring_campaign_name', 'first_event_at', 'last_event_at', 'template_id', 'template_name',\n 'experiment_id', 'unique_user_campaign_id', 'first_open_or_click_event_at'\n ] %}\n\n select\n campaign.source_relation,\n campaign.journey_id,\n count(distinct user_campaign.campaign_id) as count_total_campaigns,\n count(distinct user_campaign.unique_user_key) as count_unique_users,\n min(user_campaign.first_event_at) as first_event_at,\n max(user_campaign.last_event_at) as last_event_at\n {% for col in user_campaign_columns if col.name|lower not in non_agg_columns %}\n , sum(user_campaign.{{ col.name }}) as {{ col.name }}\n -- counts distinct users; campaign_event_metrics counts distinct emails\n , count(distinct case when user_campaign.{{ col.name }} > 0 then user_campaign.unique_user_key else null end) as unique_{{ col.name }}\n {% endfor %}\n\n from user_campaign\n\n inner join campaign\n on user_campaign.campaign_id = campaign.campaign_id\n and user_campaign.source_relation = campaign.source_relation\n\n {{ dbt_utils.group_by(n=2) }}\n)\n\nselect *\nfrom journey_event_metrics", "doc_blocks": [], "language": "sql", "refs": [{"name": "iterable__user_campaign", "package": null, "version": null}, {"name": "int_iterable__recurring_campaigns", "package": null, "version": null}, {"name": "iterable__user_campaign", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt_utils.group_by"], "nodes": ["model.iterable.iterable__user_campaign", "model.iterable.int_iterable__recurring_campaigns"]}, "compiled_path": "target/compiled/iterable/models/intermediate/int_iterable__journey_event_metrics.sql", "compiled": true, "compiled_code": "\n\nwith user_campaign as (\n select *\n from \"postgres\".\"public_iterable_dev\".\"iterable__user_campaign\"\n\n), campaign as (\n\n select\n source_relation,\n campaign_id,\n journey_id\n\n from \"postgres\".\"public_iterable_dev\".\"int_iterable__recurring_campaigns\"\n where journey_id is not null\n\n), journey_event_metrics as (\n\n select\n campaign.source_relation,\n campaign.journey_id,\n count(distinct user_campaign.campaign_id) as count_total_campaigns,\n count(distinct user_campaign.unique_user_key) as count_unique_users,\n min(user_campaign.first_event_at) as first_event_at,\n max(user_campaign.last_event_at) as last_event_at\n \n , sum(user_campaign.total_emailclick) as total_emailclick\n -- counts distinct users; campaign_event_metrics counts distinct emails\n , count(distinct case when user_campaign.total_emailclick > 0 then user_campaign.unique_user_key else null end) as unique_total_emailclick\n \n , sum(user_campaign.total_emailunsubscribe) as total_emailunsubscribe\n -- counts distinct users; campaign_event_metrics counts distinct emails\n , count(distinct case when user_campaign.total_emailunsubscribe > 0 then user_campaign.unique_user_key else null end) as unique_total_emailunsubscribe\n \n , sum(user_campaign.total_emailcomplaint) as total_emailcomplaint\n -- counts distinct users; campaign_event_metrics counts distinct emails\n , count(distinct case when user_campaign.total_emailcomplaint > 0 then user_campaign.unique_user_key else null end) as unique_total_emailcomplaint\n \n , sum(user_campaign.total_customevent) as total_customevent\n -- counts distinct users; campaign_event_metrics counts distinct emails\n , count(distinct case when user_campaign.total_customevent > 0 then user_campaign.unique_user_key else null end) as unique_total_customevent\n \n , sum(user_campaign.total_emailsubscribe) as total_emailsubscribe\n -- counts distinct users; campaign_event_metrics counts distinct emails\n , count(distinct case when user_campaign.total_emailsubscribe > 0 then user_campaign.unique_user_key else null end) as unique_total_emailsubscribe\n \n , sum(user_campaign.total_emailopen) as total_emailopen\n -- counts distinct users; campaign_event_metrics counts distinct emails\n , count(distinct case when user_campaign.total_emailopen > 0 then user_campaign.unique_user_key else null end) as unique_total_emailopen\n \n , sum(user_campaign.total_pushsend) as total_pushsend\n -- counts distinct users; campaign_event_metrics counts distinct emails\n , count(distinct case when user_campaign.total_pushsend > 0 then user_campaign.unique_user_key else null end) as unique_total_pushsend\n \n , sum(user_campaign.total_smsbounce) as total_smsbounce\n -- counts distinct users; campaign_event_metrics counts distinct emails\n , count(distinct case when user_campaign.total_smsbounce > 0 then user_campaign.unique_user_key else null end) as unique_total_smsbounce\n \n , sum(user_campaign.total_pushbounce) as total_pushbounce\n -- counts distinct users; campaign_event_metrics counts distinct emails\n , count(distinct case when user_campaign.total_pushbounce > 0 then user_campaign.unique_user_key else null end) as unique_total_pushbounce\n \n , sum(user_campaign.total_inappsendskip) as total_inappsendskip\n -- counts distinct users; campaign_event_metrics counts distinct emails\n , count(distinct case when user_campaign.total_inappsendskip > 0 then user_campaign.unique_user_key else null end) as unique_total_inappsendskip\n \n , sum(user_campaign.total_smssend) as total_smssend\n -- counts distinct users; campaign_event_metrics counts distinct emails\n , count(distinct case when user_campaign.total_smssend > 0 then user_campaign.unique_user_key else null end) as unique_total_smssend\n \n , sum(user_campaign.total_inappsend) as total_inappsend\n -- counts distinct users; campaign_event_metrics counts distinct emails\n , count(distinct case when user_campaign.total_inappsend > 0 then user_campaign.unique_user_key else null end) as unique_total_inappsend\n \n , sum(user_campaign.total_pushopen) as total_pushopen\n -- counts distinct users; campaign_event_metrics counts distinct emails\n , count(distinct case when user_campaign.total_pushopen > 0 then user_campaign.unique_user_key else null end) as unique_total_pushopen\n \n , sum(user_campaign.total_emailsend) as total_emailsend\n -- counts distinct users; campaign_event_metrics counts distinct emails\n , count(distinct case when user_campaign.total_emailsend > 0 then user_campaign.unique_user_key else null end) as unique_total_emailsend\n \n , sum(user_campaign.total_pushsendskip) as total_pushsendskip\n -- counts distinct users; campaign_event_metrics counts distinct emails\n , count(distinct case when user_campaign.total_pushsendskip > 0 then user_campaign.unique_user_key else null end) as unique_total_pushsendskip\n \n , sum(user_campaign.total_inappopen) as total_inappopen\n -- counts distinct users; campaign_event_metrics counts distinct emails\n , count(distinct case when user_campaign.total_inappopen > 0 then user_campaign.unique_user_key else null end) as unique_total_inappopen\n \n , sum(user_campaign.total_emailsendskip) as total_emailsendskip\n -- counts distinct users; campaign_event_metrics counts distinct emails\n , count(distinct case when user_campaign.total_emailsendskip > 0 then user_campaign.unique_user_key else null end) as unique_total_emailsendskip\n \n , sum(user_campaign.total_emailbounce) as total_emailbounce\n -- counts distinct users; campaign_event_metrics counts distinct emails\n , count(distinct case when user_campaign.total_emailbounce > 0 then user_campaign.unique_user_key else null end) as unique_total_emailbounce\n \n , sum(user_campaign.total_inappclick) as total_inappclick\n -- counts distinct users; campaign_event_metrics counts distinct emails\n , count(distinct case when user_campaign.total_inappclick > 0 then user_campaign.unique_user_key else null end) as unique_total_inappclick\n \n , sum(user_campaign.total_pushuninstall) as total_pushuninstall\n -- counts distinct users; campaign_event_metrics counts distinct emails\n , count(distinct case when user_campaign.total_pushuninstall > 0 then user_campaign.unique_user_key else null end) as unique_total_pushuninstall\n \n\n from user_campaign\n\n inner join campaign\n on user_campaign.campaign_id = campaign.campaign_id\n and user_campaign.source_relation = campaign.source_relation\n\n group by 1,2\n)\n\nselect *\nfrom journey_event_metrics", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.int_iterable__list_user_unnest": {"database": "postgres", "schema": "public_iterable_dev", "name": "int_iterable__list_user_unnest", "resource_type": "model", "package_name": "iterable", "path": "intermediate/int_iterable__list_user_unnest.sql", "original_file_path": "models/intermediate/int_iterable__list_user_unnest.sql", "unique_id": "model.iterable.int_iterable__list_user_unnest", "fqn": ["iterable", "intermediate", "int_iterable__list_user_unnest"], "alias": "int_iterable__list_user_unnest", "checksum": {"name": "sha256", "checksum": "82ec833586106f02efef7fe24516f3323171e61f1083323e97c892f21ddfa263"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "incremental", "incremental_strategy": "delete+insert", "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": "unique_key", "on_schema_change": "fail", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}, "partition_by": {"field": "date_day", "data_type": "date"}, "file_format": "delta"}, "tags": [], "description": "Table that unnests the `email_list_id` field for each user to create a new record for each user and the unique list it was associated with at a unique update. Due to the unnesting functions varying greatly between warehouses, conditional logic is applied throughout the model to appropriately accommodate the model being ran within Redshift, Snowflake, BigQuery, and Postgres.\n", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "iterable://models/intermediate/int_iterable.yml", "build_path": null, "unrendered_config": {"materialized": "incremental", "schema": "iterable_{{ var('directed_schema','dev') }}", "unique_key": "unique_key", "incremental_strategy": "CondExpr(test=Compare(expr=Getattr(node=Name(name='target', ctx='load'), attr='type', ctx='load'), ops=[Operand(op='in', expr=Tuple(items=[Const(value='bigquery'), Const(value='spark'), Const(value='databricks')], ctx='load'))]), expr1=Const(value='insert_overwrite'), expr2=Const(value='delete+insert'))", "partition_by": "CondExpr(test=Compare(expr=Getattr(node=Name(name='target', ctx='load'), attr='type', ctx='load'), ops=[Operand(op='notin', expr=Tuple(items=[Const(value='spark'), Const(value='databricks'), Const(value='duckdb')], ctx='load'))]), expr1=Dict(items=[Pair(key=Const(value='field'), value=Const(value='date_day')), Pair(key=Const(value='data_type'), value=Const(value='date'))]), expr2=List(items=[Const(value='date_day')]))", "file_format": "delta", "on_schema_change": "fail", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789422569.891922, "relation_name": "\"postgres\".\"public_iterable_dev\".\"int_iterable__list_user_unnest\"", "raw_code": "{{ config(\n materialized='incremental',\n unique_key='unique_key',\n incremental_strategy='insert_overwrite' if target.type in ('bigquery', 'spark', 'databricks') else 'delete+insert',\n partition_by={\"field\": \"date_day\", \"data_type\": \"date\"} if target.type not in ('spark', 'databricks', 'duckdb') else ['date_day'],\n file_format='delta',\n on_schema_change='fail'\n )\n}}\n\nwith user_history as (\n\n select *\n from {{ ref('int_iterable__list_user_history') }} as user_history\n\n {% if is_incremental() %}\n {# the only rows we potentially want to overwrite are active ones #}\n where user_history.updated_at >= coalesce((select min(updated_at) from {{ this }} where is_current), '2010-01-01')\n {% endif %}\n\n{% if target.type == 'redshift' %}\n{# using PartiQL syntax to work with redshift's SUPER types #}\n), redshift_parse_email_lists as (\n\n select\n source_relation,\n _fivetran_user_id,\n unique_user_key,\n email,\n first_name,\n last_name,\n user_id,\n signup_date,\n signup_source,\n phone_number,\n updated_at,\n is_current,\n email_list_ids,\n {# let's not remove empty array-rows #}\n json_parse(case when email_list_ids = '[]' then '[\"is_null\"]' else email_list_ids end) as super_email_list_ids\n\n --The below script allows for pass through columns.\n {{ fivetran_utils.persist_pass_through_columns(pass_through_variable='iterable_user_history_pass_through_columns', identifier='user_history') }}\n\n from user_history\n\n), unnest_email_array as (\n\n select\n source_relation,\n _fivetran_user_id,\n unique_user_key,\n email,\n first_name,\n last_name,\n user_id,\n signup_date,\n signup_source,\n phone_number,\n updated_at,\n is_current,\n {# go back to strings #}\n cast(email_list_ids as {{ dbt.type_string() }}) as email_list_ids,\n cast(email_list_id as {{ dbt.type_string() }}) as email_list_id\n\n --The below script allows for pass through columns.\n {{ fivetran_utils.persist_pass_through_columns(pass_through_variable='iterable_user_history_pass_through_columns', identifier='emails') }}\n\n from redshift_parse_email_lists as emails, emails.super_email_list_ids as email_list_id\n\n{% else %}\n), unnest_email_array as (\n\n select\n source_relation,\n _fivetran_user_id,\n unique_user_key,\n email,\n first_name,\n last_name,\n user_id,\n signup_date,\n signup_source,\n phone_number,\n updated_at,\n is_current,\n email_list_ids,\n case when email_list_ids != '[]' then\n {% if target.type == 'snowflake' %}\n email_list_id.value\n {% elif target.type in ('spark','databricks') %}\n email_list_id.col\n {% else %} email_list_id {% endif %}\n else null\n end as email_list_id\n\n --The below script allows for pass through columns.\n {{ fivetran_utils.persist_pass_through_columns(pass_through_variable='iterable_user_history_pass_through_columns', identifier='user_history') }}\n\n from user_history\n\n {% if target.type == 'snowflake' %}\n cross join\n table(flatten(input => parse_json(\n case when email_list_ids = '[]' then '[\"is_null\"]' {# to not remove empty array-rows #}\n else email_list_ids end))) as email_list_id\n {% elif target.type == 'bigquery' %}\n cross join\n unnest(JSON_EXTRACT_STRING_ARRAY(\n case when email_list_ids = '[]' then '[\"is_null\"]' {# to not remove empty array-rows #}\n else email_list_ids end)) as email_list_id\n {% elif target.type in ('spark','databricks') %}\n cross join\n lateral explode_outer(from_json(\n case when email_list_ids = '[]' then '[\"is_null\"]' {# to not remove empty array-rows #}\n else email_list_ids end, 'array')) as email_list_id\n {% elif target.type == 'duckdb' %}\n cross join\n unnest(from_json(cast((\n case when email_list_ids = '[]' then '[\"is_null\"]' {# to not remove empty array-rows #}\n else email_list_ids end) as varchar), '[\"VARCHAR\"]')) as t(email_list_id)\n {% else %} {# target is postgres #}\n cross join\n json_array_elements_text(cast((\n case when email_list_ids = '[]' then '[\"is_null\"]' {# to not remove empty array-rows #}\n else email_list_ids end) as json)) as email_list_id\n {%- endif %}\n\n{%- endif -%}\n), adjust_nulls as (\n\n select\n source_relation,\n _fivetran_user_id,\n unique_user_key,\n email,\n first_name,\n last_name,\n user_id,\n signup_date,\n signup_source,\n updated_at,\n phone_number,\n is_current,\n case when email_list_ids = '[\"is_null\"]' then '[]' else email_list_ids end as email_list_ids,\n cast(NULLIF(email_list_id, 'is_null') as {{ dbt.type_int() }}) as list_id\n\n --The below script allows for pass through columns.\n {{ fivetran_utils.persist_pass_through_columns(pass_through_variable='iterable_user_history_pass_through_columns', identifier='unnest_email_array') }}\n\n from unnest_email_array\n\n), final as (\n\n select\n source_relation,\n _fivetran_user_id,\n unique_user_key,\n user_id,\n email,\n first_name,\n last_name,\n signup_date,\n signup_source,\n updated_at,\n phone_number,\n is_current,\n email_list_ids,\n list_id,\n {{ dbt_utils.generate_surrogate_key([\"source_relation\", \"unique_user_key\", \"list_id\", \"updated_at\"]) }} as unique_key,\n cast( {{ dbt.date_trunc('day', 'updated_at') }} as date) as date_day\n\n --The below script allows for pass through columns.\n {{ fivetran_utils.persist_pass_through_columns(pass_through_variable='iterable_user_history_pass_through_columns', identifier='adjust_nulls') }}\n\n from adjust_nulls\n)\n\nselect *\nfrom final", "doc_blocks": [], "language": "sql", "refs": [{"name": "int_iterable__list_user_history", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.is_incremental", "macro.fivetran_utils.persist_pass_through_columns", "macro.dbt.type_int", "macro.dbt_utils.generate_surrogate_key", "macro.dbt.date_trunc"], "nodes": ["model.iterable.int_iterable__list_user_history"]}, "compiled_path": "target/compiled/iterable/models/intermediate/int_iterable__list_user_unnest.sql", "compiled": true, "compiled_code": "\n\nwith user_history as (\n\n select *\n from \"postgres\".\"public_iterable_dev\".\"int_iterable__list_user_history\" as user_history\n\n \n \n where user_history.updated_at >= coalesce((select min(updated_at) from \"postgres\".\"public_iterable_dev\".\"int_iterable__list_user_unnest\" where is_current), '2010-01-01')\n \n\n\n), unnest_email_array as (\n\n select\n source_relation,\n _fivetran_user_id,\n unique_user_key,\n email,\n first_name,\n last_name,\n user_id,\n signup_date,\n signup_source,\n phone_number,\n updated_at,\n is_current,\n email_list_ids,\n case when email_list_ids != '[]' then\n email_list_id \n else null\n end as email_list_id\n\n --The below script allows for pass through columns.\n \n\n\n\n\n\n from user_history\n\n \n cross join\n json_array_elements_text(cast((\n case when email_list_ids = '[]' then '[\"is_null\"]' \n else email_list_ids end) as json)) as email_list_id), adjust_nulls as (\n\n select\n source_relation,\n _fivetran_user_id,\n unique_user_key,\n email,\n first_name,\n last_name,\n user_id,\n signup_date,\n signup_source,\n updated_at,\n phone_number,\n is_current,\n case when email_list_ids = '[\"is_null\"]' then '[]' else email_list_ids end as email_list_ids,\n cast(NULLIF(email_list_id, 'is_null') as integer) as list_id\n\n --The below script allows for pass through columns.\n \n\n\n\n\n\n from unnest_email_array\n\n), final as (\n\n select\n source_relation,\n _fivetran_user_id,\n unique_user_key,\n user_id,\n email,\n first_name,\n last_name,\n signup_date,\n signup_source,\n updated_at,\n phone_number,\n is_current,\n email_list_ids,\n list_id,\n md5(cast(coalesce(cast(source_relation as TEXT), '_dbt_utils_surrogate_key_null_') || '-' || coalesce(cast(unique_user_key as TEXT), '_dbt_utils_surrogate_key_null_') || '-' || coalesce(cast(list_id as TEXT), '_dbt_utils_surrogate_key_null_') || '-' || coalesce(cast(updated_at as TEXT), '_dbt_utils_surrogate_key_null_') as TEXT)) as unique_key,\n cast( date_trunc('day', updated_at) as date) as date_day\n\n --The below script allows for pass through columns.\n \n\n\n\n\n\n from adjust_nulls\n)\n\nselect *\nfrom final", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.int_iterable__latest_template": {"database": "postgres", "schema": "public_iterable_dev", "name": "int_iterable__latest_template", "resource_type": "model", "package_name": "iterable", "path": "intermediate/int_iterable__latest_template.sql", "original_file_path": "models/intermediate/int_iterable__latest_template.sql", "unique_id": "model.iterable.int_iterable__latest_template", "fqn": ["iterable", "intermediate", "int_iterable__latest_template"], "alias": "int_iterable__latest_template", "checksum": {"name": "sha256", "checksum": "44d385d803b47bd9be4b5bfc6d78b88689e9c113d478ba8feb96f91717f45b3b"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "Table that provides the most recent version of the template as well as joining relevant message type information.", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "iterable://models/intermediate/int_iterable.yml", "build_path": null, "unrendered_config": {"materialized": "view", "schema": "iterable_{{ var('directed_schema','dev') }}", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789422569.8904047, "relation_name": "\"postgres\".\"public_iterable_dev\".\"int_iterable__latest_template\"", "raw_code": "with template_history as (\n select *\n from {{ ref('stg_iterable__template_history') }}\n\n), order_template as (\n select\n *,\n row_number() over(partition by template_id{{ fivetran_utils.partition_by_source_relation(package_name='iterable') }} order by updated_at desc) as latest_template_index\n from template_history\n\n), latest_template as (\n\n select *\n from order_template\n where latest_template_index = 1\n\n), message_type_channel as (\n\n select *\n from {{ ref('int_iterable__message_type_channel') }}\n\n), template_join as (\n\n select \n latest_template.*,\n message_type_channel.message_type_name,\n message_type_channel.channel_id,\n message_type_channel.channel_name,\n message_type_channel.channel_type,\n message_type_channel.message_medium\n\n from latest_template \n left join message_type_channel\n on latest_template.message_type_id = message_type_channel.message_type_id\n and latest_template.source_relation = message_type_channel.source_relation\n)\n\nselect *\nfrom template_join", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__template_history", "package": null, "version": null}, {"name": "int_iterable__message_type_channel", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.fivetran_utils.partition_by_source_relation"], "nodes": ["model.iterable.stg_iterable__template_history", "model.iterable.int_iterable__message_type_channel"]}, "compiled_path": "target/compiled/iterable/models/intermediate/int_iterable__latest_template.sql", "compiled": true, "compiled_code": "with template_history as (\n select *\n from \"postgres\".\"public_iterable_dev\".\"stg_iterable__template_history\"\n\n), order_template as (\n select\n *,\n row_number() over(partition by template_id order by updated_at desc) as latest_template_index\n from template_history\n\n), latest_template as (\n\n select *\n from order_template\n where latest_template_index = 1\n\n), message_type_channel as (\n\n select *\n from \"postgres\".\"public_iterable_dev\".\"int_iterable__message_type_channel\"\n\n), template_join as (\n\n select \n latest_template.*,\n message_type_channel.message_type_name,\n message_type_channel.channel_id,\n message_type_channel.channel_name,\n message_type_channel.channel_type,\n message_type_channel.message_medium\n\n from latest_template \n left join message_type_channel\n on latest_template.message_type_id = message_type_channel.message_type_id\n and latest_template.source_relation = message_type_channel.source_relation\n)\n\nselect *\nfrom template_join", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.int_iterable__campaign_event_metrics": {"database": "postgres", "schema": "public_iterable_dev", "name": "int_iterable__campaign_event_metrics", "resource_type": "model", "package_name": "iterable", "path": "intermediate/int_iterable__campaign_event_metrics.sql", "original_file_path": "models/intermediate/int_iterable__campaign_event_metrics.sql", "unique_id": "model.iterable.int_iterable__campaign_event_metrics", "fqn": ["iterable", "intermediate", "int_iterable__campaign_event_metrics"], "alias": "int_iterable__campaign_event_metrics", "checksum": {"name": "sha256", "checksum": "81038e93b6f7f8151fb0d719780a87ebc5bd95b613431564e7c470121a174e26"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "Table that generates relevant total and unique campaign/experiment level aggregations.", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "iterable://models/intermediate/int_iterable.yml", "build_path": null, "unrendered_config": {"materialized": "view", "schema": "iterable_{{ var('directed_schema','dev') }}", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789422569.8877943, "relation_name": "\"postgres\".\"public_iterable_dev\".\"int_iterable__campaign_event_metrics\"", "raw_code": "with user_campaign as (\n select *\n from {{ ref('iterable__user_campaign') }}\n\n), campaign_user_event_metrics as (\n{%- set using_event_extension = var('iterable__using_event_extension', True) %}\n{%- set user_campaign_columns = adapter.get_columns_in_relation(ref('iterable__user_campaign')) %}\n{%- set non_agg_columns = ['source_relation', 'unique_user_key', 'user_id', '_fivetran_user_id', \n 'user_email', 'user_full_name', 'campaign_id', 'campaign_name', 'recurring_campaign_id', \n 'recurring_campaign_name', 'first_event_at', 'last_event_at', 'template_id', 'template_name', \n 'experiment_id', 'unique_user_campaign_id', 'first_open_or_click_event_at'\n ] %}\n\n select\n source_relation,\n campaign_id,\n template_id\n {{ \", experiment_id\" if using_event_extension }}\n , count(distinct unique_user_key) as count_unique_users\n {% for col in user_campaign_columns if col.name|lower not in non_agg_columns %}\n , sum({{ col.name }}) as {{ col.name }}\n , count(distinct case when {{ col.name }} > 0 then user_email else null end) as unique_{{ col.name }}\n {% endfor %}\n \n from user_campaign\n \n {{ dbt_utils.group_by(n=4 if using_event_extension else 3) }}\n)\n\nselect *\nfrom campaign_user_event_metrics", "doc_blocks": [], "language": "sql", "refs": [{"name": "iterable__user_campaign", "package": null, "version": null}, {"name": "iterable__user_campaign", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt_utils.group_by"], "nodes": ["model.iterable.iterable__user_campaign"]}, "compiled_path": "target/compiled/iterable/models/intermediate/int_iterable__campaign_event_metrics.sql", "compiled": true, "compiled_code": "with user_campaign as (\n select *\n from \"postgres\".\"public_iterable_dev\".\"iterable__user_campaign\"\n\n), campaign_user_event_metrics as (\n\n select\n source_relation,\n campaign_id,\n template_id\n , experiment_id\n , count(distinct unique_user_key) as count_unique_users\n \n , sum(total_emailclick) as total_emailclick\n , count(distinct case when total_emailclick > 0 then user_email else null end) as unique_total_emailclick\n \n , sum(total_emailunsubscribe) as total_emailunsubscribe\n , count(distinct case when total_emailunsubscribe > 0 then user_email else null end) as unique_total_emailunsubscribe\n \n , sum(total_emailcomplaint) as total_emailcomplaint\n , count(distinct case when total_emailcomplaint > 0 then user_email else null end) as unique_total_emailcomplaint\n \n , sum(total_customevent) as total_customevent\n , count(distinct case when total_customevent > 0 then user_email else null end) as unique_total_customevent\n \n , sum(total_emailsubscribe) as total_emailsubscribe\n , count(distinct case when total_emailsubscribe > 0 then user_email else null end) as unique_total_emailsubscribe\n \n , sum(total_emailopen) as total_emailopen\n , count(distinct case when total_emailopen > 0 then user_email else null end) as unique_total_emailopen\n \n , sum(total_pushsend) as total_pushsend\n , count(distinct case when total_pushsend > 0 then user_email else null end) as unique_total_pushsend\n \n , sum(total_smsbounce) as total_smsbounce\n , count(distinct case when total_smsbounce > 0 then user_email else null end) as unique_total_smsbounce\n \n , sum(total_pushbounce) as total_pushbounce\n , count(distinct case when total_pushbounce > 0 then user_email else null end) as unique_total_pushbounce\n \n , sum(total_inappsendskip) as total_inappsendskip\n , count(distinct case when total_inappsendskip > 0 then user_email else null end) as unique_total_inappsendskip\n \n , sum(total_smssend) as total_smssend\n , count(distinct case when total_smssend > 0 then user_email else null end) as unique_total_smssend\n \n , sum(total_inappsend) as total_inappsend\n , count(distinct case when total_inappsend > 0 then user_email else null end) as unique_total_inappsend\n \n , sum(total_pushopen) as total_pushopen\n , count(distinct case when total_pushopen > 0 then user_email else null end) as unique_total_pushopen\n \n , sum(total_emailsend) as total_emailsend\n , count(distinct case when total_emailsend > 0 then user_email else null end) as unique_total_emailsend\n \n , sum(total_pushsendskip) as total_pushsendskip\n , count(distinct case when total_pushsendskip > 0 then user_email else null end) as unique_total_pushsendskip\n \n , sum(total_inappopen) as total_inappopen\n , count(distinct case when total_inappopen > 0 then user_email else null end) as unique_total_inappopen\n \n , sum(total_emailsendskip) as total_emailsendskip\n , count(distinct case when total_emailsendskip > 0 then user_email else null end) as unique_total_emailsendskip\n \n , sum(total_emailbounce) as total_emailbounce\n , count(distinct case when total_emailbounce > 0 then user_email else null end) as unique_total_emailbounce\n \n , sum(total_inappclick) as total_inappclick\n , count(distinct case when total_inappclick > 0 then user_email else null end) as unique_total_inappclick\n \n , sum(total_pushuninstall) as total_pushuninstall\n , count(distinct case when total_pushuninstall > 0 then user_email else null end) as unique_total_pushuninstall\n \n \n from user_campaign\n \n group by 1,2,3,4\n)\n\nselect *\nfrom campaign_user_event_metrics", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.int_iterable__campaign_lists": {"database": "postgres", "schema": "public_iterable_dev", "name": "int_iterable__campaign_lists", "resource_type": "model", "package_name": "iterable", "path": "intermediate/int_iterable__campaign_lists.sql", "original_file_path": "models/intermediate/int_iterable__campaign_lists.sql", "unique_id": "model.iterable.int_iterable__campaign_lists", "fqn": ["iterable", "intermediate", "int_iterable__campaign_lists"], "alias": "int_iterable__campaign_lists", "checksum": {"name": "sha256", "checksum": "33c167f12bf4fadb7316af985f2b60ee9989ade1a428d684037465d1a449685e"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "Table that identifies the suppressed and send lists associated with a campaign.", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "iterable://models/intermediate/int_iterable.yml", "build_path": null, "unrendered_config": {"materialized": "view", "schema": "iterable_{{ var('directed_schema','dev') }}", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789422569.8888705, "relation_name": "\"postgres\".\"public_iterable_dev\".\"int_iterable__campaign_lists\"", "raw_code": "with \n\n{% if var('iterable__using_campaign_suppression_list_history', True) %}\n\ncampaign_suppression_list_history as (\n\n select *\n from {{ ref('stg_iterable__campaign_suppression_list_history') }}\n\n), \n\n{% endif %}\n\ncampaign_send_list_history as (\n\n select *\n from {{ ref('stg_iterable__campaign_list_history') }}\n\n), combine_list_histories as (\n\n{% if var('iterable__using_campaign_suppression_list_history', True) %}\n\n select\n source_relation,\n suppressed_list_id as list_id,\n campaign_id,\n updated_at,\n 'suppress' as list_activity\n from campaign_suppression_list_history\n\n union all\n\n{% endif %}\n\n select\n source_relation,\n list_id,\n campaign_id,\n updated_at,\n 'send' as list_activity\n from campaign_send_list_history\n\n), order_campaign_list_history as (\n\n select\n *,\n row_number() over(partition by list_id, campaign_id{{ fivetran_utils.partition_by_source_relation(package_name='iterable') }} order by updated_at desc) as latest_list_index\n from combine_list_histories\n\n), latest_campaign_list_history as (\n\n select\n source_relation,\n list_id,\n campaign_id,\n updated_at,\n list_activity\n\n from order_campaign_list_history\n where latest_list_index = 1\n)\n\nselect *\nfrom latest_campaign_list_history", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__campaign_suppression_list_history", "package": null, "version": null}, {"name": "stg_iterable__campaign_list_history", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.fivetran_utils.partition_by_source_relation"], "nodes": ["model.iterable.stg_iterable__campaign_suppression_list_history", "model.iterable.stg_iterable__campaign_list_history"]}, "compiled_path": "target/compiled/iterable/models/intermediate/int_iterable__campaign_lists.sql", "compiled": true, "compiled_code": "with \n\n\n\ncampaign_suppression_list_history as (\n\n select *\n from \"postgres\".\"public_iterable_dev\".\"stg_iterable__campaign_suppression_list_history\"\n\n), \n\n\n\ncampaign_send_list_history as (\n\n select *\n from \"postgres\".\"public_iterable_dev\".\"stg_iterable__campaign_list_history\"\n\n), combine_list_histories as (\n\n\n\n select\n source_relation,\n suppressed_list_id as list_id,\n campaign_id,\n updated_at,\n 'suppress' as list_activity\n from campaign_suppression_list_history\n\n union all\n\n\n\n select\n source_relation,\n list_id,\n campaign_id,\n updated_at,\n 'send' as list_activity\n from campaign_send_list_history\n\n), order_campaign_list_history as (\n\n select\n *,\n row_number() over(partition by list_id, campaign_id order by updated_at desc) as latest_list_index\n from combine_list_histories\n\n), latest_campaign_list_history as (\n\n select\n source_relation,\n list_id,\n campaign_id,\n updated_at,\n list_activity\n\n from order_campaign_list_history\n where latest_list_index = 1\n)\n\nselect *\nfrom latest_campaign_list_history", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.int_iterable__recurring_campaigns": {"database": "postgres", "schema": "public_iterable_dev", "name": "int_iterable__recurring_campaigns", "resource_type": "model", "package_name": "iterable", "path": "intermediate/int_iterable__recurring_campaigns.sql", "original_file_path": "models/intermediate/int_iterable__recurring_campaigns.sql", "unique_id": "model.iterable.int_iterable__recurring_campaigns", "fqn": ["iterable", "intermediate", "int_iterable__recurring_campaigns"], "alias": "int_iterable__recurring_campaigns", "checksum": {"name": "sha256", "checksum": "177c12b9779cfd975d0de322b8ccfc36bdecb1f509262c02ca1c8cb7035926d8"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "Table that identifies when a campaign is associated with a recurring campaign and provides additional enriched recurring campaign information.", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "iterable://models/intermediate/int_iterable.yml", "build_path": null, "unrendered_config": {"materialized": "view", "schema": "iterable_{{ var('directed_schema','dev') }}", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789422569.8929427, "relation_name": "\"postgres\".\"public_iterable_dev\".\"int_iterable__recurring_campaigns\"", "raw_code": "with latest_campaign as (\n\n select * \n from {{ ref('int_iterable__latest_campaign') }}\n\n), recurring_campaign_join as (\n select\n latest_campaign.source_relation,\n latest_campaign.campaign_id,\n latest_campaign.campaign_name,\n latest_campaign.updated_at,\n latest_campaign.campaign_state,\n latest_campaign.campaign_type,\n latest_campaign.send_size,\n latest_campaign.start_at,\n latest_campaign.ended_at,\n latest_campaign.created_at,\n latest_campaign.created_by_user_id,\n latest_campaign.template_id,\n latest_campaign.recurring_campaign_id,\n {% if var('iterable__using_journey', true) %}\n -- cast to string so this matches journey_id in stg_iterable__journey; workflow_id arrives\n -- numeric from campaign_history but as a string from event_extension\n cast(latest_campaign.workflow_id as {{ dbt.type_string() }}) as journey_id,\n {% endif %}\n\n recurring_campaign.campaign_name as recurring_campaign_name,\n recurring_campaign.campaign_state as recurring_campaign_state,\n recurring_campaign.send_size as recurring_campaign_send_size,\n recurring_campaign.start_at as recurring_campaign_start_at\n\n from latest_campaign\n\n left join latest_campaign as recurring_campaign\n on latest_campaign.recurring_campaign_id = recurring_campaign.campaign_id\n and latest_campaign.source_relation = recurring_campaign.source_relation\n\n), final as (\n\n select\n recurring_campaign_join.*,\n case when latest_campaign.recurring_campaign_id is not null then true \n else false end as is_campaign_recurring\n\n from recurring_campaign_join\n left join latest_campaign on recurring_campaign_join.campaign_id = latest_campaign.recurring_campaign_id\n and recurring_campaign_join.template_id = latest_campaign.template_id\n and recurring_campaign_join.source_relation = latest_campaign.source_relation\n)\n\nselect *\nfrom final", "doc_blocks": [], "language": "sql", "refs": [{"name": "int_iterable__latest_campaign", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.type_string"], "nodes": ["model.iterable.int_iterable__latest_campaign"]}, "compiled_path": "target/compiled/iterable/models/intermediate/int_iterable__recurring_campaigns.sql", "compiled": true, "compiled_code": "with latest_campaign as (\n\n select * \n from \"postgres\".\"public_iterable_dev\".\"int_iterable__latest_campaign\"\n\n), recurring_campaign_join as (\n select\n latest_campaign.source_relation,\n latest_campaign.campaign_id,\n latest_campaign.campaign_name,\n latest_campaign.updated_at,\n latest_campaign.campaign_state,\n latest_campaign.campaign_type,\n latest_campaign.send_size,\n latest_campaign.start_at,\n latest_campaign.ended_at,\n latest_campaign.created_at,\n latest_campaign.created_by_user_id,\n latest_campaign.template_id,\n latest_campaign.recurring_campaign_id,\n \n -- cast to string so this matches journey_id in stg_iterable__journey; workflow_id arrives\n -- numeric from campaign_history but as a string from event_extension\n cast(latest_campaign.workflow_id as TEXT) as journey_id,\n \n\n recurring_campaign.campaign_name as recurring_campaign_name,\n recurring_campaign.campaign_state as recurring_campaign_state,\n recurring_campaign.send_size as recurring_campaign_send_size,\n recurring_campaign.start_at as recurring_campaign_start_at\n\n from latest_campaign\n\n left join latest_campaign as recurring_campaign\n on latest_campaign.recurring_campaign_id = recurring_campaign.campaign_id\n and latest_campaign.source_relation = recurring_campaign.source_relation\n\n), final as (\n\n select\n recurring_campaign_join.*,\n case when latest_campaign.recurring_campaign_id is not null then true \n else false end as is_campaign_recurring\n\n from recurring_campaign_join\n left join latest_campaign on recurring_campaign_join.campaign_id = latest_campaign.recurring_campaign_id\n and recurring_campaign_join.template_id = latest_campaign.template_id\n and recurring_campaign_join.source_relation = latest_campaign.source_relation\n)\n\nselect *\nfrom final", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.int_iterable__list_user_history": {"database": "postgres", "schema": "public_iterable_dev", "name": "int_iterable__list_user_history", "resource_type": "model", "package_name": "iterable", "path": "intermediate/int_iterable__list_user_history.sql", "original_file_path": "models/intermediate/int_iterable__list_user_history.sql", "unique_id": "model.iterable.int_iterable__list_user_history", "fqn": ["iterable", "intermediate", "int_iterable__list_user_history"], "alias": "int_iterable__list_user_history", "checksum": {"name": "sha256", "checksum": "26b2bd189944dfea25bb63edf9e3da03a3e8169e3501b894716e8d1f8e1df5a0"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "table", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "Table that provides a history of all lists the user has been associated with.", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "iterable://models/intermediate/int_iterable.yml", "build_path": null, "unrendered_config": {"materialized": "table", "schema": "iterable_{{ var('directed_schema','dev') }}", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789422569.8914084, "relation_name": "\"postgres\".\"public_iterable_dev\".\"int_iterable__list_user_history\"", "raw_code": "-- this model will serve to extract only email-list changes\nwith user_history as (\n\n select *\n from {{ ref('stg_iterable__user_history') }}\n\n), previous_email_list_ids as (\n\n select\n *,\n lag(email_list_ids) over(partition by unique_user_key{{ fivetran_utils.partition_by_source_relation(package_name='iterable') }} order by updated_at asc) as previous_ids -- partition by email instead of unique_user_key here since this model is only for email-list users\n\n from user_history\n\n), only_new_email_list_ids as (\n\n select\n source_relation,\n _fivetran_user_id,\n unique_user_key,\n user_id,\n email,\n first_name,\n last_name,\n email_list_ids,\n phone_number,\n signup_date,\n signup_source,\n updated_at\n\n --The below script allows for pass through columns.\n {{ fivetran_utils.persist_pass_through_columns(pass_through_variable='iterable_user_history_pass_through_columns', identifier='previous_email_list_ids') }}\n\n from previous_email_list_ids\n where email_list_ids != coalesce(previous_ids, 'this is new') -- list ids are always stored in their arrays in numerical order\n\n), most_recent_list_ids as (\n\n select\n *,\n row_number() over(partition by email{{ fivetran_utils.partition_by_source_relation(package_name='iterable') }} order by updated_at desc) as latest_user_index\n\n from only_new_email_list_ids\n\n), final as (\n\n select\n source_relation,\n _fivetran_user_id,\n unique_user_key,\n email,\n user_id,\n first_name,\n last_name,\n email_list_ids,\n phone_number,\n signup_date,\n signup_source,\n updated_at,\n latest_user_index = 1 as is_current\n\n --The below script allows for pass through columns.\n {{ fivetran_utils.persist_pass_through_columns(pass_through_variable='iterable_user_history_pass_through_columns', identifier='most_recent_list_ids') }}\n\n from most_recent_list_ids\n)\n\nselect * from final", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__user_history", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.fivetran_utils.partition_by_source_relation", "macro.fivetran_utils.persist_pass_through_columns"], "nodes": ["model.iterable.stg_iterable__user_history"]}, "compiled_path": "target/compiled/iterable/models/intermediate/int_iterable__list_user_history.sql", "compiled": true, "compiled_code": "-- this model will serve to extract only email-list changes\nwith user_history as (\n\n select *\n from \"postgres\".\"public_iterable_dev\".\"stg_iterable__user_history\"\n\n), previous_email_list_ids as (\n\n select\n *,\n lag(email_list_ids) over(partition by unique_user_key order by updated_at asc) as previous_ids -- partition by email instead of unique_user_key here since this model is only for email-list users\n\n from user_history\n\n), only_new_email_list_ids as (\n\n select\n source_relation,\n _fivetran_user_id,\n unique_user_key,\n user_id,\n email,\n first_name,\n last_name,\n email_list_ids,\n phone_number,\n signup_date,\n signup_source,\n updated_at\n\n --The below script allows for pass through columns.\n \n\n\n\n\n\n from previous_email_list_ids\n where email_list_ids != coalesce(previous_ids, 'this is new') -- list ids are always stored in their arrays in numerical order\n\n), most_recent_list_ids as (\n\n select\n *,\n row_number() over(partition by email order by updated_at desc) as latest_user_index\n\n from only_new_email_list_ids\n\n), final as (\n\n select\n source_relation,\n _fivetran_user_id,\n unique_user_key,\n email,\n user_id,\n first_name,\n last_name,\n email_list_ids,\n phone_number,\n signup_date,\n signup_source,\n updated_at,\n latest_user_index = 1 as is_current\n\n --The below script allows for pass through columns.\n \n\n\n\n\n\n from most_recent_list_ids\n)\n\nselect * from final", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.int_iterable__message_type_channel": {"database": "postgres", "schema": "public_iterable_dev", "name": "int_iterable__message_type_channel", "resource_type": "model", "package_name": "iterable", "path": "intermediate/int_iterable__message_type_channel.sql", "original_file_path": "models/intermediate/int_iterable__message_type_channel.sql", "unique_id": "model.iterable.int_iterable__message_type_channel", "fqn": ["iterable", "intermediate", "int_iterable__message_type_channel"], "alias": "int_iterable__message_type_channel", "checksum": {"name": "sha256", "checksum": "9f54e0a46c508fbe16514b8e598ee614b3462649f85582b5513905f6392d728d"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "Table that joins the message type and channel records together into one comprehensive model to be referenced downstream.", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "iterable://models/intermediate/int_iterable.yml", "build_path": null, "unrendered_config": {"materialized": "view", "schema": "iterable_{{ var('directed_schema','dev') }}", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789422569.8924162, "relation_name": "\"postgres\".\"public_iterable_dev\".\"int_iterable__message_type_channel\"", "raw_code": "with message_type as (\n\n select *\n from {{ ref('stg_iterable__message_type') }}\n\n), channel as (\n\n select *\n from {{ ref('stg_iterable__channel') }}\n\n), final as (\n\n select \n channel.*,\n message_type.message_type_name,\n message_type.message_type_id\n from channel\n left join message_type\n on channel.channel_id = message_type.channel_id\n and channel.source_relation = message_type.source_relation\n)\n\nselect *\nfrom final", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__message_type", "package": null, "version": null}, {"name": "stg_iterable__channel", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": [], "nodes": ["model.iterable.stg_iterable__message_type", "model.iterable.stg_iterable__channel"]}, "compiled_path": "target/compiled/iterable/models/intermediate/int_iterable__message_type_channel.sql", "compiled": true, "compiled_code": "with message_type as (\n\n select *\n from \"postgres\".\"public_iterable_dev\".\"stg_iterable__message_type\"\n\n), channel as (\n\n select *\n from \"postgres\".\"public_iterable_dev\".\"stg_iterable__channel\"\n\n), final as (\n\n select \n channel.*,\n message_type.message_type_name,\n message_type.message_type_id\n from channel\n left join message_type\n on channel.channel_id = message_type.channel_id\n and channel.source_relation = message_type.source_relation\n)\n\nselect *\nfrom final", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.int_iterable__user_event_metrics": {"database": "postgres", "schema": "public_iterable_dev", "name": "int_iterable__user_event_metrics", "resource_type": "model", "package_name": "iterable", "path": "intermediate/int_iterable__user_event_metrics.sql", "original_file_path": "models/intermediate/int_iterable__user_event_metrics.sql", "unique_id": "model.iterable.int_iterable__user_event_metrics", "fqn": ["iterable", "intermediate", "int_iterable__user_event_metrics"], "alias": "int_iterable__user_event_metrics", "checksum": {"name": "sha256", "checksum": "56af49e00fd9cad13663d8bf802187ff1d12561fb1fd9d3732d182703b34ca4d"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "Table that generates user aggregations at the campaign level.", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "iterable://models/intermediate/int_iterable.yml", "build_path": null, "unrendered_config": {"materialized": "view", "schema": "iterable_{{ var('directed_schema','dev') }}", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789422569.893438, "relation_name": "\"postgres\".\"public_iterable_dev\".\"int_iterable__user_event_metrics\"", "raw_code": "with user_campaign as (\n\n select *\n from {{ ref('iterable__user_campaign') }}\n\n), user_event_metrics as (\n\n{%- set user_campaign_columns = adapter.get_columns_in_relation(ref('iterable__user_campaign')) %}\n{%- set non_agg_columns = ['source_relation', 'unique_user_key', 'user_id', '_fivetran_user_id', \n 'user_email', 'user_full_name', 'campaign_id', 'campaign_name', 'recurring_campaign_id', \n 'recurring_campaign_name', 'first_event_at', 'last_event_at', 'template_id', 'template_name', \n 'experiment_id', 'unique_user_campaign_id', 'first_open_or_click_event_at'\n ] %}\n\n select\n source_relation,\n _fivetran_user_id,\n unique_user_key,\n user_id,\n user_email,\n count(distinct campaign_id) as count_total_campaigns,\n min(first_event_at) as first_event_at,\n max(last_event_at) as last_event_at\n\n {% for col in user_campaign_columns if col.name|lower not in non_agg_columns %}\n , sum({{ col.name }}) as {{ col.name }}\n {% endfor %}\n\n from user_campaign\n {{ dbt_utils.group_by(n=5) }}\n\n)\n\nselect *\nfrom user_event_metrics", "doc_blocks": [], "language": "sql", "refs": [{"name": "iterable__user_campaign", "package": null, "version": null}, {"name": "iterable__user_campaign", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt_utils.group_by"], "nodes": ["model.iterable.iterable__user_campaign"]}, "compiled_path": "target/compiled/iterable/models/intermediate/int_iterable__user_event_metrics.sql", "compiled": true, "compiled_code": "with user_campaign as (\n\n select *\n from \"postgres\".\"public_iterable_dev\".\"iterable__user_campaign\"\n\n), user_event_metrics as (\n\n select\n source_relation,\n _fivetran_user_id,\n unique_user_key,\n user_id,\n user_email,\n count(distinct campaign_id) as count_total_campaigns,\n min(first_event_at) as first_event_at,\n max(last_event_at) as last_event_at\n\n \n , sum(total_emailclick) as total_emailclick\n \n , sum(total_emailunsubscribe) as total_emailunsubscribe\n \n , sum(total_emailcomplaint) as total_emailcomplaint\n \n , sum(total_customevent) as total_customevent\n \n , sum(total_emailsubscribe) as total_emailsubscribe\n \n , sum(total_emailopen) as total_emailopen\n \n , sum(total_pushsend) as total_pushsend\n \n , sum(total_smsbounce) as total_smsbounce\n \n , sum(total_pushbounce) as total_pushbounce\n \n , sum(total_inappsendskip) as total_inappsendskip\n \n , sum(total_smssend) as total_smssend\n \n , sum(total_inappsend) as total_inappsend\n \n , sum(total_pushopen) as total_pushopen\n \n , sum(total_emailsend) as total_emailsend\n \n , sum(total_pushsendskip) as total_pushsendskip\n \n , sum(total_inappopen) as total_inappopen\n \n , sum(total_emailsendskip) as total_emailsendskip\n \n , sum(total_emailbounce) as total_emailbounce\n \n , sum(total_inappclick) as total_inappclick\n \n , sum(total_pushuninstall) as total_pushuninstall\n \n\n from user_campaign\n group by 1,2,3,4,5\n\n)\n\nselect *\nfrom user_event_metrics", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.int_iterable__latest_user": {"database": "postgres", "schema": "public_iterable_dev", "name": "int_iterable__latest_user", "resource_type": "model", "package_name": "iterable", "path": "intermediate/int_iterable__latest_user.sql", "original_file_path": "models/intermediate/int_iterable__latest_user.sql", "unique_id": "model.iterable.int_iterable__latest_user", "fqn": ["iterable", "intermediate", "int_iterable__latest_user"], "alias": "int_iterable__latest_user", "checksum": {"name": "sha256", "checksum": "580070cfbe396b904d0dc15669eefe5b9f017005d0aa91aa2c3d96b4e4686e81"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "Table that filters out historical versions of the user, and returns only the most recent version.", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "iterable://models/intermediate/int_iterable.yml", "build_path": null, "unrendered_config": {"materialized": "view", "schema": "iterable_{{ var('directed_schema','dev') }}", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789422569.890928, "relation_name": "\"postgres\".\"public_iterable_dev\".\"int_iterable__latest_user\"", "raw_code": "with user_history as (\n select *\n from {{ ref('stg_iterable__user_history') }}\n\n), latest_user as (\n select\n *,\n row_number() over(partition by unique_user_key{{ fivetran_utils.partition_by_source_relation(package_name='iterable') }} order by updated_at desc) as latest_user_index\n from user_history\n)\n\nselect *\nfrom latest_user\nwhere latest_user_index = 1", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__user_history", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.fivetran_utils.partition_by_source_relation"], "nodes": ["model.iterable.stg_iterable__user_history"]}, "compiled_path": "target/compiled/iterable/models/intermediate/int_iterable__latest_user.sql", "compiled": true, "compiled_code": "with user_history as (\n select *\n from \"postgres\".\"public_iterable_dev\".\"stg_iterable__user_history\"\n\n), latest_user as (\n select\n *,\n row_number() over(partition by unique_user_key order by updated_at desc) as latest_user_index\n from user_history\n)\n\nselect *\nfrom latest_user\nwhere latest_user_index = 1", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.int_iterable__latest_campaign": {"database": "postgres", "schema": "public_iterable_dev", "name": "int_iterable__latest_campaign", "resource_type": "model", "package_name": "iterable", "path": "intermediate/int_iterable__latest_campaign.sql", "original_file_path": "models/intermediate/int_iterable__latest_campaign.sql", "unique_id": "model.iterable.int_iterable__latest_campaign", "fqn": ["iterable", "intermediate", "int_iterable__latest_campaign"], "alias": "int_iterable__latest_campaign", "checksum": {"name": "sha256", "checksum": "8063c9ccdfe6dee1694944607534fbb31bafe2856073ac2f5ea58aa513714e4f"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "Table that filters out historical versions of the campaign, and returns the most recent campaign version.", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "iterable://models/intermediate/int_iterable.yml", "build_path": null, "unrendered_config": {"materialized": "view", "schema": "iterable_{{ var('directed_schema','dev') }}", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789422569.8899145, "relation_name": "\"postgres\".\"public_iterable_dev\".\"int_iterable__latest_campaign\"", "raw_code": "with campaign_history as (\n select *\n from {{ ref('stg_iterable__campaign_history') }}\n\n), latest_campaign as (\n select\n *,\n row_number() over(partition by campaign_id{{ fivetran_utils.partition_by_source_relation(package_name='iterable') }} order by updated_at desc) as latest_campaign_index\n from campaign_history\n)\n\nselect *\nfrom latest_campaign\nwhere latest_campaign_index = 1", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__campaign_history", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.fivetran_utils.partition_by_source_relation"], "nodes": ["model.iterable.stg_iterable__campaign_history"]}, "compiled_path": "target/compiled/iterable/models/intermediate/int_iterable__latest_campaign.sql", "compiled": true, "compiled_code": "with campaign_history as (\n select *\n from \"postgres\".\"public_iterable_dev\".\"stg_iterable__campaign_history\"\n\n), latest_campaign as (\n select\n *,\n row_number() over(partition by campaign_id order by updated_at desc) as latest_campaign_index\n from campaign_history\n)\n\nselect *\nfrom latest_campaign\nwhere latest_campaign_index = 1", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.stg_iterable__message_type": {"database": "postgres", "schema": "public_iterable_dev", "name": "stg_iterable__message_type", "resource_type": "model", "package_name": "iterable", "path": "staging/stg_iterable__message_type.sql", "original_file_path": "models/staging/stg_iterable__message_type.sql", "unique_id": "model.iterable.stg_iterable__message_type", "fqn": ["iterable", "staging", "stg_iterable__message_type"], "alias": "stg_iterable__message_type", "checksum": {"name": "sha256", "checksum": "046caf2bcc8a01dd2b8ef46a5dfb52e02b8bebe01e892de5d658910c97d5e6a4"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "table", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "Table containing unique message types.", "columns": {"source_relation": {"name": "source_relation", "description": "Identifies the record's source.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": ["doc.iterable.source_relation"]}, "message_type_id": {"name": "message_type_id", "description": "Unique identifier of the message type", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "message_type_name": {"name": "message_type_name", "description": "User defined name of the message type", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "channel_id": {"name": "channel_id", "description": "Channel that this message type belongs to", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "message_type_created_at": {"name": "message_type_created_at", "description": "Time when the message type was initially created", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "frequency_cap": {"name": "frequency_cap", "description": "The maximum number of times a message of this type can be sent to a recipient within a specified time period to prevent over-messaging", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "rate_limit_per_minute": {"name": "rate_limit_per_minute", "description": "The maximum number of messages of this type that can be sent to recipients in a minute, ensuring controlled message delivery", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "subscription_policy": {"name": "subscription_policy", "description": "Information about the policy or rules governing how users can subscribe to or unsubscribe from this specific message type, like OptOut", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "message_type_updated_at": {"name": "message_type_updated_at", "description": "Time when the message type was last updated or modified", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "The time when a record was last updated by Fivetran.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": ["doc.iterable._fivetran_synced"]}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "iterable://models/staging/stg_iterable.yml", "build_path": null, "unrendered_config": {"materialized": "table", "schema": "iterable_{{ var('directed_schema','dev') }}", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789422569.9099052, "relation_name": "\"postgres\".\"public_iterable_dev\".\"stg_iterable__message_type\"", "raw_code": "with base as (\n\n select * \n from {{ ref('stg_iterable__message_type_tmp') }}\n\n),\n\nfields as (\n\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_iterable/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_iterable/macros/).\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_iterable__message_type_tmp')),\n staging_columns=get_message_type_columns()\n )\n }}\n {{ fivetran_utils.apply_source_relation(package_name='iterable') }}\n\n from base\n),\n\nfinal as (\n\n select\n source_relation,\n cast(id as {{ dbt.type_string() }} ) as message_type_id,\n name as message_type_name,\n cast(channel_id as {{ dbt.type_string() }} ) as channel_id,\n created_at as message_type_created_at,\n frequency_cap,\n rate_limit_per_minute,\n subscription_policy,\n updated_at as message_type_updated_at,\n _fivetran_synced\n from fields\n where not coalesce(_fivetran_deleted, true)\n)\n\nselect * \nfrom final", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__message_type_tmp", "package": null, "version": null}, {"name": "stg_iterable__message_type_tmp", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.iterable.get_message_type_columns", "macro.fivetran_utils.fill_staging_columns", "macro.fivetran_utils.apply_source_relation", "macro.dbt.type_string"], "nodes": ["model.iterable.stg_iterable__message_type_tmp"]}, "compiled_path": "target/compiled/iterable/models/staging/stg_iterable__message_type.sql", "compiled": true, "compiled_code": "with base as (\n\n select * \n from \"postgres\".\"public_iterable_dev\".\"stg_iterable__message_type_tmp\"\n\n),\n\nfields as (\n\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_iterable/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_iterable/macros/).\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n \n _fivetran_deleted as _fivetran_deleted,\n _fivetran_synced as _fivetran_synced,\n channel_id as channel_id,\n id as id,\n name as name,\n created_at as created_at,\n frequency_cap as frequency_cap,\n rate_limit_per_minute as rate_limit_per_minute,\n subscription_policy as subscription_policy,\n updated_at as updated_at\n \n\n\n\n\n \n \n\n\n\n\n\n, cast('postgres.public' as TEXT) as source_relation\n\n\n from base\n),\n\nfinal as (\n\n select\n source_relation,\n cast(id as TEXT ) as message_type_id,\n name as message_type_name,\n cast(channel_id as TEXT ) as channel_id,\n created_at as message_type_created_at,\n frequency_cap,\n rate_limit_per_minute,\n subscription_policy,\n updated_at as message_type_updated_at,\n _fivetran_synced\n from fields\n where not coalesce(_fivetran_deleted, true)\n)\n\nselect * \nfrom final", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.stg_iterable__event": {"database": "postgres", "schema": "public_iterable_dev", "name": "stg_iterable__event", "resource_type": "model", "package_name": "iterable", "path": "staging/stg_iterable__event.sql", "original_file_path": "models/staging/stg_iterable__event.sql", "unique_id": "model.iterable.stg_iterable__event", "fqn": ["iterable", "staging", "stg_iterable__event"], "alias": "stg_iterable__event", "checksum": {"name": "sha256", "checksum": "22ba2d21012d8301984a6fcea5b9f40f9579f5565aaea7417f7458f6fd37937b"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "Table containing individual events within campaigns.", "columns": {"source_relation": {"name": "source_relation", "description": "Identifies the record's source.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": ["doc.iterable.source_relation"]}, "event_id": {"name": "event_id", "description": "A Fivetran-created unique identifier derived from hashing campaign_id, created_at, and event_name.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_event_id": {"name": "unique_event_id", "description": "A surrogate key made up of event_id, _fivetran_user_id, and source_relation.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "campaign_id": {"name": "campaign_id", "description": "Reference to the campaign from which the event originated", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "content_id": {"name": "content_id", "description": "Reference to the content the event is associated with", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "created_at": {"name": "created_at", "description": "Creation timestamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "created_on": {"name": "created_on", "description": "Creation date", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "email": {"name": "email", "description": "Reference to the unique user the event was applied to", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "additional_properties": {"name": "additional_properties", "description": "json object containing addition event properties", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "event_name": {"name": "event_name", "description": "Name provided to the individual event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "message_bus_id": {"name": "message_bus_id", "description": "Reference to the message bus associated with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "message_id": {"name": "message_id", "description": "Reference to the message the event is associated with", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "message_type_id": {"name": "message_type_id", "description": "Reference to the type of message the event is associated with", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "recipient_state": {"name": "recipient_state", "description": "The state of the recipient upon receiving the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "status": {"name": "status", "description": "Status of the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "transactional_data": {"name": "transactional_data", "description": "Transactional data associated with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unsub_source": {"name": "unsub_source", "description": "Source of the unsubscribe event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "user_agent": {"name": "user_agent", "description": "User agent associated with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "user_agent_device": {"name": "user_agent_device", "description": "The device of the user agent", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "_fivetran_user_id": {"name": "_fivetran_user_id", "description": "A Fivetran-created unique identifier for users, derived from hashing user_id and/or email, depending on project type. This exists for users of the new schema starting Aug 2023. In the old schema, the unique identifier is email.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_user_key": {"name": "unique_user_key", "description": "The unique identifier of the user. With the new schema (Aug 2023), it is the _fivetran_user_id. This is a hash of user_id and/or email, depending on project type. If using the old schema, it is email.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "The time when a record was last updated by Fivetran.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": ["doc.iterable._fivetran_synced"]}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "iterable://models/staging/stg_iterable.yml", "build_path": null, "unrendered_config": {"materialized": "view", "schema": "iterable_{{ var('directed_schema','dev') }}", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789422569.901717, "relation_name": "\"postgres\".\"public_iterable_dev\".\"stg_iterable__event\"", "raw_code": "{{ config( materialized = 'view' ) }}\n\nwith base as (\n\n select * \n from {{ ref('stg_iterable__event_tmp') }}\n\n),\n\nfields as (\n\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_iterable/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_iterable/macros/).\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_iterable__event_tmp')),\n staging_columns=get_event_columns()\n )\n }}\n {{ fivetran_utils.apply_source_relation(package_name='iterable') }}\n \n from base\n),\n\nfinal as (\n\n select\n source_relation,\n cast(_fivetran_id as {{ dbt.type_string() }} ) as event_id,\n {{ dbt_utils.generate_surrogate_key(['_fivetran_id','_fivetran_user_id','source_relation']) }} as unique_event_id,\n cast(_fivetran_user_id as {{ dbt.type_string() }} ) as _fivetran_user_id,\n coalesce(cast(_fivetran_user_id as {{ dbt.type_string() }} ) , email) as unique_user_key,\n cast(campaign_id as {{ dbt.type_string() }} ) as campaign_id,\n cast(content_id as {{ dbt.type_string() }} ) as content_id,\n created_at,\n cast( {{ dbt.date_trunc('day', 'created_at') }} as date) as created_on,\n lower(email) as email,\n additional_properties,\n event_name,\n cast(message_bus_id as {{ dbt.type_string() }} ) as message_bus_id,\n cast(message_id as {{ dbt.type_string() }} ) as message_id,\n cast(message_type_id as {{ dbt.type_string() }} ) as message_type_id,\n recipient_state,\n status,\n transactional_data,\n unsub_source,\n user_agent,\n user_agent_device,\n _fivetran_synced\n\n from fields\n)\n\nselect *\nfrom final", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__event_tmp", "package": null, "version": null}, {"name": "stg_iterable__event_tmp", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.iterable.get_event_columns", "macro.fivetran_utils.fill_staging_columns", "macro.fivetran_utils.apply_source_relation", "macro.dbt.type_string", "macro.dbt_utils.generate_surrogate_key", "macro.dbt.date_trunc"], "nodes": ["model.iterable.stg_iterable__event_tmp"]}, "compiled_path": "target/compiled/iterable/models/staging/stg_iterable__event.sql", "compiled": true, "compiled_code": "\n\nwith base as (\n\n select * \n from \"postgres\".\"public_iterable_dev\".\"stg_iterable__event_tmp\"\n\n),\n\nfields as (\n\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_iterable/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_iterable/macros/).\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n \n _fivetran_id as _fivetran_id,\n _fivetran_user_id as _fivetran_user_id,\n _fivetran_synced as _fivetran_synced,\n campaign_id as campaign_id,\n content_id as content_id,\n created_at as created_at,\n email as email,\n event_name as event_name,\n message_bus_id as message_bus_id,\n message_id as message_id,\n message_type_id as message_type_id,\n recipient_state as recipient_state,\n status as status,\n unsub_source as unsub_source,\n user_agent as user_agent,\n user_agent_device as user_agent_device,\n transactional_data as transactional_data,\n additional_properties as additional_properties\n \n\n\n\n\n \n \n\n\n\n\n\n, cast('postgres.public' as TEXT) as source_relation\n\n \n from base\n),\n\nfinal as (\n\n select\n source_relation,\n cast(_fivetran_id as TEXT ) as event_id,\n md5(cast(coalesce(cast(_fivetran_id as TEXT), '_dbt_utils_surrogate_key_null_') || '-' || coalesce(cast(_fivetran_user_id as TEXT), '_dbt_utils_surrogate_key_null_') || '-' || coalesce(cast(source_relation as TEXT), '_dbt_utils_surrogate_key_null_') as TEXT)) as unique_event_id,\n cast(_fivetran_user_id as TEXT ) as _fivetran_user_id,\n coalesce(cast(_fivetran_user_id as TEXT ) , email) as unique_user_key,\n cast(campaign_id as TEXT ) as campaign_id,\n cast(content_id as TEXT ) as content_id,\n created_at,\n cast( date_trunc('day', created_at) as date) as created_on,\n lower(email) as email,\n additional_properties,\n event_name,\n cast(message_bus_id as TEXT ) as message_bus_id,\n cast(message_id as TEXT ) as message_id,\n cast(message_type_id as TEXT ) as message_type_id,\n recipient_state,\n status,\n transactional_data,\n unsub_source,\n user_agent,\n user_agent_device,\n _fivetran_synced\n\n from fields\n)\n\nselect *\nfrom final", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.stg_iterable__user_unsubscribed_channel": {"database": "postgres", "schema": "public_iterable_dev", "name": "stg_iterable__user_unsubscribed_channel", "resource_type": "model", "package_name": "iterable", "path": "staging/stg_iterable__user_unsubscribed_channel.sql", "original_file_path": "models/staging/stg_iterable__user_unsubscribed_channel.sql", "unique_id": "model.iterable.stg_iterable__user_unsubscribed_channel", "fqn": ["iterable", "staging", "stg_iterable__user_unsubscribed_channel"], "alias": "stg_iterable__user_unsubscribed_channel", "checksum": {"name": "sha256", "checksum": "5c639597d14f4bb7072df74e39c2b8aaa7bf1e29c6204243035014d14a0bc6f2"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "table", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "Table containing the history of channels from which a user has unsubscribed.", "columns": {"source_relation": {"name": "source_relation", "description": "Identifies the record's source.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": ["doc.iterable.source_relation"]}, "channel_id": {"name": "channel_id", "description": "Reference to the channel from which the user unsubscribed", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unsub_channel_unique_key": {"name": "unsub_channel_unique_key", "description": "A surrogate key providing a unique key for each record. If using user_unsubscribed_channel_history, it uses '_fivetran_id', 'channel_id', 'email', 'updated_at', and 'source_relation'. If not using the history table, it uses '_fivetran_id', 'channel_id', and 'source_relation'.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "_fivetran_user_id": {"name": "_fivetran_user_id", "description": "A Fivetran-created unique identifier for users, derived from hashing user_id and/or email, depending on project type. This exists for users of the new schema starting Aug 2023. In the old schema, the unique identifier is email.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_user_key": {"name": "unique_user_key", "description": "The unique identifier of the user. With the new schema (Aug 2023), it is the _fivetran_user_id. This is a hash of user_id and/or email, depending on project type. If using the old schema, it is email.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "latest_batch_index": {"name": "latest_batch_index", "description": "Indexes each user record based on the most recent available.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "updated_at": {"name": "updated_at", "description": "Last update timestamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "The time when a record was last updated by Fivetran.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": ["doc.iterable._fivetran_synced"]}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "iterable://models/staging/stg_iterable.yml", "build_path": null, "unrendered_config": {"materialized": "table", "schema": "iterable_{{ var('directed_schema','dev') }}", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789422569.9163258, "relation_name": "\"postgres\".\"public_iterable_dev\".\"stg_iterable__user_unsubscribed_channel\"", "raw_code": "with base as (\n select *\n from {{ ref('stg_iterable__user_unsubscribed_channel_tmp') }}\n\n),\n\nfields as (\n\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_iterable/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_iterable/macros/).\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_iterable__user_unsubscribed_channel_tmp')),\n staging_columns=get_user_unsubscribed_channel_columns()\n )\n }}\n {{ fivetran_utils.apply_source_relation(package_name='iterable') }}\n\n from base\n),\n\nfinal as (\n\n select\n source_relation,\n cast(_fivetran_id as {{ dbt.type_string() }} ) as _fivetran_user_id,\n coalesce(cast(_fivetran_id as {{ dbt.type_string() }} ), email) as unique_user_key,\n cast(channel_id as {{ dbt.type_string() }} ) as channel_id,\n {{ dbt_utils.generate_surrogate_key(['_fivetran_id', 'channel_id', 'email', 'updated_at', 'source_relation']) }} as unsub_channel_unique_key,\n\n {% if does_table_exist('user_unsubscribed_channel') == false %}\n rank() over(partition by email, channel_id{{ fivetran_utils.partition_by_source_relation(package_name='iterable') }} order by updated_at desc) as latest_batch_index,\n {% else %}\n 1 as latest_batch_index,\n {% endif %}\n\n updated_at,\n _fivetran_synced\n\n from fields\n)\n\n\nselect *\nfrom final", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__user_unsubscribed_channel_tmp", "package": null, "version": null}, {"name": "stg_iterable__user_unsubscribed_channel_tmp", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.iterable.get_user_unsubscribed_channel_columns", "macro.fivetran_utils.fill_staging_columns", "macro.fivetran_utils.apply_source_relation", "macro.dbt.type_string", "macro.dbt_utils.generate_surrogate_key", "macro.iterable.does_table_exist"], "nodes": ["model.iterable.stg_iterable__user_unsubscribed_channel_tmp"]}, "compiled_path": "target/compiled/iterable/models/staging/stg_iterable__user_unsubscribed_channel.sql", "compiled": true, "compiled_code": "with base as (\n select *\n from \"postgres\".\"public_iterable_dev\".\"stg_iterable__user_unsubscribed_channel_tmp\"\n\n),\n\nfields as (\n\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_iterable/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_iterable/macros/).\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n \n _fivetran_synced as _fivetran_synced,\n _fivetran_id as _fivetran_id,\n channel_id as channel_id,\n cast(null as TEXT) as email,\n cast(null as timestamp) as updated_at\n \n\n\n\n\n \n \n\n\n\n\n\n, cast('postgres.public' as TEXT) as source_relation\n\n\n from base\n),\n\nfinal as (\n\n select\n source_relation,\n cast(_fivetran_id as TEXT ) as _fivetran_user_id,\n coalesce(cast(_fivetran_id as TEXT ), email) as unique_user_key,\n cast(channel_id as TEXT ) as channel_id,\n md5(cast(coalesce(cast(_fivetran_id as TEXT), '_dbt_utils_surrogate_key_null_') || '-' || coalesce(cast(channel_id as TEXT), '_dbt_utils_surrogate_key_null_') || '-' || coalesce(cast(email as TEXT), '_dbt_utils_surrogate_key_null_') || '-' || coalesce(cast(updated_at as TEXT), '_dbt_utils_surrogate_key_null_') || '-' || coalesce(cast(source_relation as TEXT), '_dbt_utils_surrogate_key_null_') as TEXT)) as unsub_channel_unique_key,\n\n \n 1 as latest_batch_index,\n \n\n updated_at,\n _fivetran_synced\n\n from fields\n)\n\n\nselect *\nfrom final", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.stg_iterable__campaign_history": {"database": "postgres", "schema": "public_iterable_dev", "name": "stg_iterable__campaign_history", "resource_type": "model", "package_name": "iterable", "path": "staging/stg_iterable__campaign_history.sql", "original_file_path": "models/staging/stg_iterable__campaign_history.sql", "unique_id": "model.iterable.stg_iterable__campaign_history", "fqn": ["iterable", "staging", "stg_iterable__campaign_history"], "alias": "stg_iterable__campaign_history", "checksum": {"name": "sha256", "checksum": "7e7aecc134f0b697da58c7cd663aadf6de586a55c84369c2a7274811b2bb368b"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "table", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "Table containing a history of campaigns.", "columns": {"source_relation": {"name": "source_relation", "description": "Identifies the record's source.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": ["doc.iterable.source_relation"]}, "campaign_id": {"name": "campaign_id", "description": "Unique identifier of the campaign record", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "updated_at": {"name": "updated_at", "description": "Last update timestamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "campaign_name": {"name": "campaign_name", "description": "User defined name of the campaign.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "campaign_state": {"name": "campaign_state", "description": "State of the campaign. Can be Draft, Ready, Scheduled, Running, Finished, Starting, Aborted or Recurring", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "campaign_type": {"name": "campaign_type", "description": "The campaign type. Can be Blast or Triggered", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "send_size": {"name": "send_size", "description": "Size of the campaign. Number of individuals included in the campaign", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "start_at": {"name": "start_at", "description": "Start timestamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "ended_at": {"name": "ended_at", "description": "Ended timestamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "created_at": {"name": "created_at", "description": "Creation timestamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "recurring_campaign_id": {"name": "recurring_campaign_id", "description": "Reference to the recurring campaign, if applicable", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "created_by_user_id": {"name": "created_by_user_id", "description": "Reference to the user who created the campaign", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "template_id": {"name": "template_id", "description": "Reference to the campaign template", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "updated_by_user_id": {"name": "updated_by_user_id", "description": "ID of the user who updated this record", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "message_medium": {"name": "message_medium", "description": "The medium that this message was sent via, for example Email or InApp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "workflow_id": {"name": "workflow_id", "description": "Reference to the workflow which the event originated", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "The time when a record was last updated by Fivetran.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": ["doc.iterable._fivetran_synced"]}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "iterable://models/staging/stg_iterable.yml", "build_path": null, "unrendered_config": {"materialized": "table", "schema": "iterable_{{ var('directed_schema','dev') }}", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789422569.895721, "relation_name": "\"postgres\".\"public_iterable_dev\".\"stg_iterable__campaign_history\"", "raw_code": "with base as (\n\n select * \n from {{ ref('stg_iterable__campaign_history_tmp') }}\n\n),\n\nfields as (\n\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_iterable/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_iterable/macros/).\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_iterable__campaign_history_tmp')),\n staging_columns=get_campaign_history_columns()\n )\n }}\n {{ fivetran_utils.apply_source_relation(package_name='iterable') }}\n \n from base\n),\n\nfinal as (\n\n select\n source_relation,\n cast(id as {{ dbt.type_string() }}) as campaign_id,\n updated_at,\n name as campaign_name,\n campaign_state,\n type as campaign_type,\n send_size,\n start_at,\n ended_at,\n created_at,\n message_medium,\n cast(recurring_campaign_id as {{ dbt.type_string() }}) as recurring_campaign_id,\n cast(created_by_user_id as {{ dbt.type_string() }} ) as created_by_user_id,\n cast(updated_by_user_id as {{ dbt.type_string() }} ) as updated_by_user_id,\n cast(template_id as {{ dbt.type_string() }}) as template_id,\n workflow_id,\n _fivetran_synced\n\n from fields\n)\n\nselect * \nfrom final", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__campaign_history_tmp", "package": null, "version": null}, {"name": "stg_iterable__campaign_history_tmp", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.iterable.get_campaign_history_columns", "macro.fivetran_utils.fill_staging_columns", "macro.fivetran_utils.apply_source_relation", "macro.dbt.type_string"], "nodes": ["model.iterable.stg_iterable__campaign_history_tmp"]}, "compiled_path": "target/compiled/iterable/models/staging/stg_iterable__campaign_history.sql", "compiled": true, "compiled_code": "with base as (\n\n select * \n from \"postgres\".\"public_iterable_dev\".\"stg_iterable__campaign_history_tmp\"\n\n),\n\nfields as (\n\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_iterable/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_iterable/macros/).\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n \n _fivetran_synced as _fivetran_synced,\n campaign_state as campaign_state,\n created_at as created_at,\n created_by_user_id as created_by_user_id,\n updated_by_user_id as updated_by_user_id,\n ended_at as ended_at,\n id as id,\n name as name,\n recurring_campaign_id as recurring_campaign_id,\n send_size as send_size,\n start_at as start_at,\n template_id as template_id,\n type as type,\n updated_at as updated_at,\n workflow_id as workflow_id,\n message_medium as message_medium\n \n\n\n\n\n \n \n\n\n\n\n\n, cast('postgres.public' as TEXT) as source_relation\n\n \n from base\n),\n\nfinal as (\n\n select\n source_relation,\n cast(id as TEXT) as campaign_id,\n updated_at,\n name as campaign_name,\n campaign_state,\n type as campaign_type,\n send_size,\n start_at,\n ended_at,\n created_at,\n message_medium,\n cast(recurring_campaign_id as TEXT) as recurring_campaign_id,\n cast(created_by_user_id as TEXT ) as created_by_user_id,\n cast(updated_by_user_id as TEXT ) as updated_by_user_id,\n cast(template_id as TEXT) as template_id,\n workflow_id,\n _fivetran_synced\n\n from fields\n)\n\nselect * \nfrom final", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.stg_iterable__campaign_label_history": {"database": "postgres", "schema": "public_iterable_dev", "name": "stg_iterable__campaign_label_history", "resource_type": "model", "package_name": "iterable", "path": "staging/stg_iterable__campaign_label_history.sql", "original_file_path": "models/staging/stg_iterable__campaign_label_history.sql", "unique_id": "model.iterable.stg_iterable__campaign_label_history", "fqn": ["iterable", "staging", "stg_iterable__campaign_label_history"], "alias": "stg_iterable__campaign_label_history", "checksum": {"name": "sha256", "checksum": "2001c425039c576063482caa3d4a72f39c5cd8aff32ffee63f083977f1f0c35f"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "table", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "Table containing a history of labels.", "columns": {"source_relation": {"name": "source_relation", "description": "Identifies the record's source.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": ["doc.iterable.source_relation"]}, "campaign_id": {"name": "campaign_id", "description": "Reference to the campaign associated with the label", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "label": {"name": "label", "description": "Name of the label", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "updated_at": {"name": "updated_at", "description": "Last update timestamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "The time when a record was last updated by Fivetran.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": ["doc.iterable._fivetran_synced"]}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "iterable://models/staging/stg_iterable.yml", "build_path": null, "unrendered_config": {"materialized": "table", "schema": "iterable_{{ var('directed_schema','dev') }}", "enabled": "var('iterable__using_campaign_label_history', True)", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789422569.8969762, "relation_name": "\"postgres\".\"public_iterable_dev\".\"stg_iterable__campaign_label_history\"", "raw_code": "{{ config(enabled=var('iterable__using_campaign_label_history', True)) }}\n\nwith base as (\n\n select * \n from {{ ref('stg_iterable__campaign_label_history_tmp') }}\n\n),\n\nfields as (\n\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_iterable/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_iterable/macros/).\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_iterable__campaign_label_history_tmp')),\n staging_columns=get_campaign_label_history_columns()\n )\n }}\n {{ fivetran_utils.apply_source_relation(package_name='iterable') }}\n \n from base\n),\n\nfinal as (\n\n select\n source_relation,\n cast(campaign_id as {{ dbt.type_string() }}) as campaign_id,\n label,\n updated_at,\n _fivetran_synced\n from fields\n)\n\nselect * \nfrom final", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__campaign_label_history_tmp", "package": null, "version": null}, {"name": "stg_iterable__campaign_label_history_tmp", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.iterable.get_campaign_label_history_columns", "macro.fivetran_utils.fill_staging_columns", "macro.fivetran_utils.apply_source_relation", "macro.dbt.type_string"], "nodes": ["model.iterable.stg_iterable__campaign_label_history_tmp"]}, "compiled_path": "target/compiled/iterable/models/staging/stg_iterable__campaign_label_history.sql", "compiled": true, "compiled_code": "\n\nwith base as (\n\n select * \n from \"postgres\".\"public_iterable_dev\".\"stg_iterable__campaign_label_history_tmp\"\n\n),\n\nfields as (\n\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_iterable/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_iterable/macros/).\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n \n _fivetran_synced as _fivetran_synced,\n campaign_id as campaign_id,\n label as label,\n updated_at as updated_at\n \n\n\n\n\n \n \n\n\n\n\n\n, cast('postgres.public' as TEXT) as source_relation\n\n \n from base\n),\n\nfinal as (\n\n select\n source_relation,\n cast(campaign_id as TEXT) as campaign_id,\n label,\n updated_at,\n _fivetran_synced\n from fields\n)\n\nselect * \nfrom final", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.stg_iterable__template_history": {"database": "postgres", "schema": "public_iterable_dev", "name": "stg_iterable__template_history", "resource_type": "model", "package_name": "iterable", "path": "staging/stg_iterable__template_history.sql", "original_file_path": "models/staging/stg_iterable__template_history.sql", "unique_id": "model.iterable.stg_iterable__template_history", "fqn": ["iterable", "staging", "stg_iterable__template_history"], "alias": "stg_iterable__template_history", "checksum": {"name": "sha256", "checksum": "f0eaf9d44d7959a04ba079cbf711646772487aeafc89414b097dd5f230b44910"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "table", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "Table containing unique templates used across campaigns.", "columns": {"source_relation": {"name": "source_relation", "description": "Identifies the record's source.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": ["doc.iterable.source_relation"]}, "template_id": {"name": "template_id", "description": "Unique identifier of the template", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "template_name": {"name": "template_name", "description": "User defined name of the template", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "template_type": {"name": "template_type", "description": "The type of the template", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "created_at": {"name": "created_at", "description": "Creation timestamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "client_template_id": {"name": "client_template_id", "description": "Reference to the client template", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "creator_user_id": {"name": "creator_user_id", "description": "Reference to the user who created the template", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "message_type_id": {"name": "message_type_id", "description": "Reference to the message type associated with the template", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "updated_at": {"name": "updated_at", "description": "Last update timestamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "The time when a record was last updated by Fivetran.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": ["doc.iterable._fivetran_synced"]}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "iterable://models/staging/stg_iterable.yml", "build_path": null, "unrendered_config": {"materialized": "table", "schema": "iterable_{{ var('directed_schema','dev') }}", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789422569.911695, "relation_name": "\"postgres\".\"public_iterable_dev\".\"stg_iterable__template_history\"", "raw_code": "with base as (\n\n select * \n from {{ ref('stg_iterable__template_history_tmp') }}\n\n),\n\nfields as (\n\n select\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_iterable__template_history_tmp')),\n staging_columns=get_template_history_columns()\n )\n }}\n {{ fivetran_utils.apply_source_relation(package_name='iterable') }}\n\n from base\n),\n\nfinal as (\n\n select\n source_relation,\n cast(id as {{ dbt.type_string() }} ) as template_id,\n name as template_name,\n template_type,\n created_at,\n cast(client_template_id as {{ dbt.type_string() }} ) as client_template_id,\n cast(creator_user_id as {{ dbt.type_string() }} ) as creator_user_id,\n cast(message_type_id as {{ dbt.type_string() }} ) as message_type_id,\n updated_at,\n _fivetran_synced\n from fields\n)\n\nselect * \nfrom final", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__template_history_tmp", "package": null, "version": null}, {"name": "stg_iterable__template_history_tmp", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.iterable.get_template_history_columns", "macro.fivetran_utils.fill_staging_columns", "macro.fivetran_utils.apply_source_relation", "macro.dbt.type_string"], "nodes": ["model.iterable.stg_iterable__template_history_tmp"]}, "compiled_path": "target/compiled/iterable/models/staging/stg_iterable__template_history.sql", "compiled": true, "compiled_code": "with base as (\n\n select * \n from \"postgres\".\"public_iterable_dev\".\"stg_iterable__template_history_tmp\"\n\n),\n\nfields as (\n\n select\n \n _fivetran_synced as _fivetran_synced,\n client_template_id as client_template_id,\n created_at as created_at,\n creator_user_id as creator_user_id,\n id as id,\n message_type_id as message_type_id,\n name as name,\n template_type as template_type,\n updated_at as updated_at\n \n\n\n\n\n \n \n\n\n\n\n\n, cast('postgres.public' as TEXT) as source_relation\n\n\n from base\n),\n\nfinal as (\n\n select\n source_relation,\n cast(id as TEXT ) as template_id,\n name as template_name,\n template_type,\n created_at,\n cast(client_template_id as TEXT ) as client_template_id,\n cast(creator_user_id as TEXT ) as creator_user_id,\n cast(message_type_id as TEXT ) as message_type_id,\n updated_at,\n _fivetran_synced\n from fields\n)\n\nselect * \nfrom final", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.stg_iterable__journey": {"database": "postgres", "schema": "public_iterable_dev", "name": "stg_iterable__journey", "resource_type": "model", "package_name": "iterable", "path": "staging/stg_iterable__journey.sql", "original_file_path": "models/staging/stg_iterable__journey.sql", "unique_id": "model.iterable.stg_iterable__journey", "fqn": ["iterable", "staging", "stg_iterable__journey"], "alias": "stg_iterable__journey", "checksum": {"name": "sha256", "checksum": "d53993c3137351b54f560a3e0194593ea0d2787d328e2bc6cfe13977b35a3906"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "table", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "Table containing unique journeys, formerly known as workflows.", "columns": {"source_relation": {"name": "source_relation", "description": "Identifies the record's source.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": ["doc.iterable.source_relation"]}, "journey_id": {"name": "journey_id", "description": "Unique identifier of the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "journey_name": {"name": "journey_name", "description": "User defined name of the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "journey_type": {"name": "journey_type", "description": "Whether the journey is published or a draft", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "journey_description": {"name": "journey_description", "description": "Information about the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "creator_user_id": {"name": "creator_user_id", "description": "Reference to the user who created the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "is_enabled": {"name": "is_enabled", "description": "Boolean indicating if the journey is currently enabled", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "is_archived": {"name": "is_archived", "description": "Boolean indicating if the journey has been archived", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "lifetime_limit": {"name": "lifetime_limit", "description": "Maximum number of times a user may enter the journey over their lifetime", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "simultaneous_limit": {"name": "simultaneous_limit", "description": "Maximum number of times a user may be in the journey at the same time", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "start_tile_id": {"name": "start_tile_id", "description": "Reference to the tile which begins the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "trigger_event_names": {"name": "trigger_event_names", "description": "The event names which trigger a user's entry into the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "created_at": {"name": "created_at", "description": "Creation timestamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "updated_at": {"name": "updated_at", "description": "Last update timestamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "The time when a record was last updated by Fivetran.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": ["doc.iterable._fivetran_synced"]}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "iterable://models/staging/stg_iterable.yml", "build_path": null, "unrendered_config": {"materialized": "table", "schema": "iterable_{{ var('directed_schema','dev') }}", "enabled": "var('iterable__using_journey', True)", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789422569.905762, "relation_name": "\"postgres\".\"public_iterable_dev\".\"stg_iterable__journey\"", "raw_code": "{{ config(enabled=var('iterable__using_journey', True)) }}\n\n{% set source_columns_in_relation = adapter.get_columns_in_relation(ref('stg_iterable__journey_tmp')) %}\n\nwith base as (\n\n select *\n from {{ ref('stg_iterable__journey_tmp') }}\n\n),\n\nfields as (\n\n select\n\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=source_columns_in_relation,\n staging_columns=get_journey_columns()\n )\n }}\n {{ fivetran_utils.apply_source_relation(package_name='iterable') }}\n\n from base\n),\n\nfinal as (\n\n select\n source_relation,\n cast(id as {{ dbt.type_string() }} ) as journey_id,\n name as journey_name,\n journey_type,\n description as journey_description,\n cast(creator_user_id as {{ dbt.type_string() }} ) as creator_user_id,\n enabled as is_enabled,\n is_archived,\n lifetime_limit,\n simultaneous_limit,\n cast(start_tile_id as {{ dbt.type_string() }} ) as start_tile_id,\n {{ iterable.json_to_string(\"trigger_event_names\", source_columns_in_relation) }} as trigger_event_names,\n created_at,\n updated_at,\n _fivetran_synced\n\n --The below script allows for pass through columns.\n {{ fivetran_utils.fill_pass_through_columns('iterable_journey_pass_through_columns') }}\n\n from fields\n where not coalesce(_fivetran_deleted, false)\n)\n\nselect *\nfrom final", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__journey_tmp", "package": null, "version": null}, {"name": "stg_iterable__journey_tmp", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.iterable.get_journey_columns", "macro.fivetran_utils.fill_staging_columns", "macro.fivetran_utils.apply_source_relation", "macro.dbt.type_string", "macro.iterable.json_to_string", "macro.fivetran_utils.fill_pass_through_columns"], "nodes": ["model.iterable.stg_iterable__journey_tmp"]}, "compiled_path": "target/compiled/iterable/models/staging/stg_iterable__journey.sql", "compiled": true, "compiled_code": "\n\n\n\nwith base as (\n\n select *\n from \"postgres\".\"public_iterable_dev\".\"stg_iterable__journey_tmp\"\n\n),\n\nfields as (\n\n select\n\n \n _fivetran_deleted as _fivetran_deleted,\n _fivetran_synced as _fivetran_synced,\n created_at as created_at,\n creator_user_id as creator_user_id,\n description as description,\n enabled as enabled,\n id as id,\n is_archived as is_archived,\n journey_type as journey_type,\n lifetime_limit as lifetime_limit,\n name as name,\n simultaneous_limit as simultaneous_limit,\n start_tile_id as start_tile_id,\n trigger_event_names as trigger_event_names,\n updated_at as updated_at\n \n\n\n\n\n \n \n\n\n\n\n\n, cast('postgres.public' as TEXT) as source_relation\n\n\n from base\n),\n\nfinal as (\n\n select\n source_relation,\n cast(id as TEXT ) as journey_id,\n name as journey_name,\n journey_type,\n description as journey_description,\n cast(creator_user_id as TEXT ) as creator_user_id,\n enabled as is_enabled,\n is_archived,\n lifetime_limit,\n simultaneous_limit,\n cast(start_tile_id as TEXT ) as start_tile_id,\n cast(trigger_event_names as TEXT) as trigger_event_names,\n created_at,\n updated_at,\n _fivetran_synced\n\n --The below script allows for pass through columns.\n \n\n\n\n\n\n from fields\n where not coalesce(_fivetran_deleted, false)\n)\n\nselect *\nfrom final", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.stg_iterable__user_history": {"database": "postgres", "schema": "public_iterable_dev", "name": "stg_iterable__user_history", "resource_type": "model", "package_name": "iterable", "path": "staging/stg_iterable__user_history.sql", "original_file_path": "models/staging/stg_iterable__user_history.sql", "unique_id": "model.iterable.stg_iterable__user_history", "fqn": ["iterable", "staging", "stg_iterable__user_history"], "alias": "stg_iterable__user_history", "checksum": {"name": "sha256", "checksum": "632b1ddaf71b0cb861ae314c40c6a68a25371b8646d2fa2334c4eb7149227251"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "Table containing individual user history information.", "columns": {"source_relation": {"name": "source_relation", "description": "Identifies the record's source.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": ["doc.iterable.source_relation"]}, "unique_user_key": {"name": "unique_user_key", "description": "The unique identifier of the user. With the new schema (Aug 2023), it is the _fivetran_user_id. This is a hash of user_id and/or email, depending on project type. If using the old schema, it is email.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "email": {"name": "email", "description": "The user's email. User identifier, for email-based projects. Previously was the unique identifier for user records, for the old Iterable schema before the August 2023 updates.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "user_id": {"name": "user_id", "description": "User identifier, for userID-based projects.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "first_name": {"name": "first_name", "description": "First name of the user", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "last_name": {"name": "last_name", "description": "Last name of the user", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "email_list_ids": {"name": "email_list_ids", "description": "[DEPRECATED October 13, 2025. Use LIST_USER source instead.] Array of references to the lists associated with the user.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "signup_date": {"name": "signup_date", "description": "Timestamp of when the user signed up", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "signup_source": {"name": "signup_source", "description": "Source where the user signed up", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "updated_at": {"name": "updated_at", "description": "Last update timestamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "phone_number": {"name": "phone_number", "description": "Phone number associated with the user", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "iterable_user_id": {"name": "iterable_user_id", "description": "Another user identifier, for userID-based projects", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "_fivetran_user_id": {"name": "_fivetran_user_id", "description": "A Fivetran-created unique identifier for users, derived from hashing user_id and/or email, depending on project type. This exists for users of the new schema starting Aug 2023. In the old schema, the unique identifier is email.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "The time when a record was last updated by Fivetran.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": ["doc.iterable._fivetran_synced"]}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "iterable://models/staging/stg_iterable.yml", "build_path": null, "unrendered_config": {"materialized": "view", "schema": "iterable_{{ var('directed_schema','dev') }}", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789422569.9145842, "relation_name": "\"postgres\".\"public_iterable_dev\".\"stg_iterable__user_history\"", "raw_code": "{{ config(materialized='view') }}\n{% set source_columns_in_relation = adapter.get_columns_in_relation(ref('stg_iterable__user_history_tmp')) %}\n\n\nwith base as (\n\n select * \n from {{ ref('stg_iterable__user_history_tmp') }}\n\n),\n\nfields as (\n\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_iterable/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_iterable/macros/).\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=source_columns_in_relation,\n staging_columns=get_user_history_columns()\n )\n }}\n {{ fivetran_utils.apply_source_relation(package_name='iterable') }}\n\n from base\n),\n\nfinal as (\n\n select\n source_relation,\n cast(_fivetran_id as {{ dbt.type_string() }} ) as _fivetran_user_id,\n lower(email) as email,\n updated_at,\n cast(user_id as {{ dbt.type_string() }} ) as user_id,\n first_name,\n last_name,\n {{ iterable.json_to_string(\"email_list_ids\", source_columns_in_relation) }} as email_list_ids,\n phone_number,\n signup_date,\n signup_source,\n cast(iterable_user_id as {{ dbt.type_string() }} ) as iterable_user_id,\n _fivetran_synced,\n coalesce(cast(_fivetran_id as {{ dbt.type_string() }} ) , email) as unique_user_key\n\n {{ fivetran_utils.fill_pass_through_columns('iterable_user_history_pass_through_columns') }}\n\n from fields\n)\n\nselect *\nfrom final", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__user_history_tmp", "package": null, "version": null}, {"name": "stg_iterable__user_history_tmp", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.iterable.get_user_history_columns", "macro.fivetran_utils.fill_staging_columns", "macro.fivetran_utils.apply_source_relation", "macro.dbt.type_string", "macro.iterable.json_to_string", "macro.fivetran_utils.fill_pass_through_columns"], "nodes": ["model.iterable.stg_iterable__user_history_tmp"]}, "compiled_path": "target/compiled/iterable/models/staging/stg_iterable__user_history.sql", "compiled": true, "compiled_code": "\n\n\n\nwith base as (\n\n select * \n from \"postgres\".\"public_iterable_dev\".\"stg_iterable__user_history_tmp\"\n\n),\n\nfields as (\n\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_iterable/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_iterable/macros/).\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n \n cast(null as TEXT) as _fivetran_id,\n _fivetran_synced as _fivetran_synced,\n email as email,\n email_list_ids as email_list_ids,\n first_name as first_name,\n last_name as last_name,\n phone_number as phone_number,\n signup_date as signup_date,\n signup_source as signup_source,\n updated_at as updated_at,\n user_id as user_id,\n iterable_user_id as iterable_user_id\n \n\n\n\n\n \n \n\n\n\n\n\n, cast('postgres.public' as TEXT) as source_relation\n\n\n from base\n),\n\nfinal as (\n\n select\n source_relation,\n cast(_fivetran_id as TEXT ) as _fivetran_user_id,\n lower(email) as email,\n updated_at,\n cast(user_id as TEXT ) as user_id,\n first_name,\n last_name,\n cast(email_list_ids as TEXT) as email_list_ids,\n phone_number,\n signup_date,\n signup_source,\n cast(iterable_user_id as TEXT ) as iterable_user_id,\n _fivetran_synced,\n coalesce(cast(_fivetran_id as TEXT ) , email) as unique_user_key\n\n \n\n\n\n\n\n from fields\n)\n\nselect *\nfrom final", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.stg_iterable__user_unsub_message_type": {"database": "postgres", "schema": "public_iterable_dev", "name": "stg_iterable__user_unsub_message_type", "resource_type": "model", "package_name": "iterable", "path": "staging/stg_iterable__user_unsub_message_type.sql", "original_file_path": "models/staging/stg_iterable__user_unsub_message_type.sql", "unique_id": "model.iterable.stg_iterable__user_unsub_message_type", "fqn": ["iterable", "staging", "stg_iterable__user_unsub_message_type"], "alias": "stg_iterable__user_unsub_message_type", "checksum": {"name": "sha256", "checksum": "82bd48604365ec4a7a3309f2ce007e169add2c902675e5d1da155edc32a6bb71"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "table", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "Table containing the message types from which a user has unsubscribed. \"Unsubscribed\" is shortened to \"unsub\" for postgres compatibility.", "columns": {"source_relation": {"name": "source_relation", "description": "Identifies the record's source.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": ["doc.iterable.source_relation"]}, "message_type_id": {"name": "message_type_id", "description": "Reference to the message type from which the user unsubscribed", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unsub_message_type_unique_key": {"name": "unsub_message_type_unique_key", "description": "A surrogate key providing a unique key for each record. If using user_unsubscribed_message_type_history, it uses '_fivetran_id', 'email', 'message_type_id', 'updated_at', and 'source_relation'. If not using the history table, it uses '_fivetran_id', 'message_type_id', and 'source_relation'.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "_fivetran_user_id": {"name": "_fivetran_user_id", "description": "A Fivetran-created unique identifier for users, derived from hashing user_id and/or email, depending on project type. This exists for users of the new schema starting Aug 2023. In the old schema, the unique identifier is email.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_user_key": {"name": "unique_user_key", "description": "The unique identifier of the user. With the new schema (Aug 2023), it is the _fivetran_user_id. This is a hash of user_id and/or email, depending on project type. If using the old schema, it is email.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "latest_batch_index": {"name": "latest_batch_index", "description": "Indexes each user record based on the most recent available.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "updated_at": {"name": "updated_at", "description": "Last update timestamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "The time when a record was last updated by Fivetran.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": ["doc.iterable._fivetran_synced"]}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "iterable://models/staging/stg_iterable.yml", "build_path": null, "unrendered_config": {"materialized": "table", "schema": "iterable_{{ var('directed_schema','dev') }}", "enabled": "var('iterable__using_user_unsubscribed_message_type', True)", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789422569.9176872, "relation_name": "\"postgres\".\"public_iterable_dev\".\"stg_iterable__user_unsub_message_type\"", "raw_code": "{{ config(enabled=var('iterable__using_user_unsubscribed_message_type', True)) }}\n\nwith base as (\n\n select * \n from {{ ref('stg_iterable__user_unsub_message_type_tmp') }}\n\n),\n\nfields as (\n\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_iterable/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_iterable/macros/).\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_iterable__user_unsub_message_type_tmp')),\n staging_columns=get_user_unsubscribed_message_type_columns()\n )\n }}\n {{ fivetran_utils.apply_source_relation(package_name='iterable') }}\n\n from base\n),\n\nfinal as (\n\n select\n source_relation,\n cast(_fivetran_id as {{ dbt.type_string() }} ) as _fivetran_user_id,\n coalesce(cast(_fivetran_id as {{ dbt.type_string() }} ), email) as unique_user_key,\n cast(message_type_id as {{ dbt.type_string() }} ) as message_type_id,\n {{ dbt_utils.generate_surrogate_key(['_fivetran_id', 'email', 'message_type_id','updated_at','source_relation']) }} as unsub_message_type_unique_key,\n\n {% if does_table_exist('user_unsubscribed_message_type') == false %}\n rank() over(partition by email, message_type_id{{ fivetran_utils.partition_by_source_relation(package_name='iterable') }} order by updated_at desc) as latest_batch_index,\n {% else %}\n 1 as latest_batch_index,\n {% endif %}\n\n updated_at,\n _fivetran_synced\n\n from fields\n)\n\nselect *\nfrom final", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__user_unsub_message_type_tmp", "package": null, "version": null}, {"name": "stg_iterable__user_unsub_message_type_tmp", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.iterable.get_user_unsubscribed_message_type_columns", "macro.fivetran_utils.fill_staging_columns", "macro.fivetran_utils.apply_source_relation", "macro.dbt.type_string", "macro.dbt_utils.generate_surrogate_key", "macro.iterable.does_table_exist"], "nodes": ["model.iterable.stg_iterable__user_unsub_message_type_tmp"]}, "compiled_path": "target/compiled/iterable/models/staging/stg_iterable__user_unsub_message_type.sql", "compiled": true, "compiled_code": "\n\nwith base as (\n\n select * \n from \"postgres\".\"public_iterable_dev\".\"stg_iterable__user_unsub_message_type_tmp\"\n\n),\n\nfields as (\n\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_iterable/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_iterable/macros/).\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n \n _fivetran_synced as _fivetran_synced,\n _fivetran_id as _fivetran_id,\n message_type_id as message_type_id,\n cast(null as TEXT) as email,\n cast(null as timestamp) as updated_at\n \n\n\n\n\n \n \n\n\n\n\n\n, cast('postgres.public' as TEXT) as source_relation\n\n\n from base\n),\n\nfinal as (\n\n select\n source_relation,\n cast(_fivetran_id as TEXT ) as _fivetran_user_id,\n coalesce(cast(_fivetran_id as TEXT ), email) as unique_user_key,\n cast(message_type_id as TEXT ) as message_type_id,\n md5(cast(coalesce(cast(_fivetran_id as TEXT), '_dbt_utils_surrogate_key_null_') || '-' || coalesce(cast(email as TEXT), '_dbt_utils_surrogate_key_null_') || '-' || coalesce(cast(message_type_id as TEXT), '_dbt_utils_surrogate_key_null_') || '-' || coalesce(cast(updated_at as TEXT), '_dbt_utils_surrogate_key_null_') || '-' || coalesce(cast(source_relation as TEXT), '_dbt_utils_surrogate_key_null_') as TEXT)) as unsub_message_type_unique_key,\n\n \n 1 as latest_batch_index,\n \n\n updated_at,\n _fivetran_synced\n\n from fields\n)\n\nselect *\nfrom final", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.stg_iterable__list": {"database": "postgres", "schema": "public_iterable_dev", "name": "stg_iterable__list", "resource_type": "model", "package_name": "iterable", "path": "staging/stg_iterable__list.sql", "original_file_path": "models/staging/stg_iterable__list.sql", "unique_id": "model.iterable.stg_iterable__list", "fqn": ["iterable", "staging", "stg_iterable__list"], "alias": "stg_iterable__list", "checksum": {"name": "sha256", "checksum": "b2a6869e5186282b7f5c8173ecba41c0324c1dc31df78db2418f51f2578eaa21"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "table", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "Table containing users and the lists the users are associated with.", "columns": {"source_relation": {"name": "source_relation", "description": "Identifies the record's source.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": ["doc.iterable.source_relation"]}, "list_id": {"name": "list_id", "description": "Unique identifier of the list", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "list_name": {"name": "list_name", "description": "User defined name of the list", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "list_type": {"name": "list_type", "description": "The list type", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "created_at": {"name": "created_at", "description": "Creation timestamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "list_description": {"name": "list_description", "description": "Information about the list", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "The time when a record was last updated by Fivetran.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": ["doc.iterable._fivetran_synced"]}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "iterable://models/staging/stg_iterable.yml", "build_path": null, "unrendered_config": {"materialized": "table", "schema": "iterable_{{ var('directed_schema','dev') }}", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789422569.9070663, "relation_name": "\"postgres\".\"public_iterable_dev\".\"stg_iterable__list\"", "raw_code": "with base as (\n\n select * \n from {{ ref('stg_iterable__list_tmp') }}\n\n),\n\nfields as (\n\n select\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_iterable__list_tmp')),\n staging_columns=get_list_columns()\n )\n }}\n {{ fivetran_utils.apply_source_relation(package_name='iterable') }}\n \n from base\n),\n\nfinal as (\n\n select\n source_relation,\n id as list_id,\n name as list_name,\n list_type,\n created_at,\n description as list_description,\n _fivetran_synced\n from fields\n where not coalesce(_fivetran_deleted, true)\n)\n\nselect * \nfrom final", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__list_tmp", "package": null, "version": null}, {"name": "stg_iterable__list_tmp", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.iterable.get_list_columns", "macro.fivetran_utils.fill_staging_columns", "macro.fivetran_utils.apply_source_relation"], "nodes": ["model.iterable.stg_iterable__list_tmp"]}, "compiled_path": "target/compiled/iterable/models/staging/stg_iterable__list.sql", "compiled": true, "compiled_code": "with base as (\n\n select * \n from \"postgres\".\"public_iterable_dev\".\"stg_iterable__list_tmp\"\n\n),\n\nfields as (\n\n select\n \n _fivetran_deleted as _fivetran_deleted,\n _fivetran_synced as _fivetran_synced,\n created_at as created_at,\n id as id,\n list_type as list_type,\n description as description,\n name as name\n \n\n\n\n\n \n \n\n\n\n\n\n, cast('postgres.public' as TEXT) as source_relation\n\n \n from base\n),\n\nfinal as (\n\n select\n source_relation,\n id as list_id,\n name as list_name,\n list_type,\n created_at,\n description as list_description,\n _fivetran_synced\n from fields\n where not coalesce(_fivetran_deleted, true)\n)\n\nselect * \nfrom final", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.stg_iterable__list_user": {"database": "postgres", "schema": "public_iterable_dev", "name": "stg_iterable__list_user", "resource_type": "model", "package_name": "iterable", "path": "staging/stg_iterable__list_user.sql", "original_file_path": "models/staging/stg_iterable__list_user.sql", "unique_id": "model.iterable.stg_iterable__list_user", "fqn": ["iterable", "staging", "stg_iterable__list_user"], "alias": "stg_iterable__list_user", "checksum": {"name": "sha256", "checksum": "f3fe66e05562725c91948ac2023c649573560043aa82c03fe93f6232f6600954"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "table", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "Table containing the relationship between users and lists they belong to.", "columns": {"source_relation": {"name": "source_relation", "description": "Identifies the record's source.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": ["doc.iterable.source_relation"]}, "_fivetran_user_id": {"name": "_fivetran_user_id", "description": "Unique identifier of the list-user relationship record, serving as a foreign key to `stg_iterable__user_history._fivetran_id`.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "list_user_index": {"name": "list_user_index", "description": "Index of the record", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "list_id": {"name": "list_id", "description": "Reference to the list that the user belongs to", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "The time when a record was last updated by Fivetran.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": ["doc.iterable._fivetran_synced"]}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "iterable://models/staging/stg_iterable.yml", "build_path": null, "unrendered_config": {"materialized": "table", "schema": "iterable_{{ var('directed_schema','dev') }}", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789422569.9129884, "relation_name": "\"postgres\".\"public_iterable_dev\".\"stg_iterable__list_user\"", "raw_code": "{% set source_columns_in_relation = adapter.get_columns_in_relation(ref('stg_iterable__list_user_tmp')) %}\n\nwith base as (\n\n select *\n from {{ ref('stg_iterable__list_user_tmp') }}\n\n),\n\nfields as (\n\n select\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=source_columns_in_relation,\n staging_columns=get_list_user_columns()\n )\n }}\n {{ fivetran_utils.apply_source_relation(package_name='iterable') }}\n\n from base\n),\n\nfinal as (\n\n select\n source_relation,\n cast(_fivetran_id as {{ dbt.type_string() }} ) as _fivetran_user_id,\n index as list_user_index,\n list_id,\n _fivetran_synced\n\n from fields\n)\n\nselect *\nfrom final", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__list_user_tmp", "package": null, "version": null}, {"name": "stg_iterable__list_user_tmp", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.iterable.get_list_user_columns", "macro.fivetran_utils.fill_staging_columns", "macro.fivetran_utils.apply_source_relation", "macro.dbt.type_string"], "nodes": ["model.iterable.stg_iterable__list_user_tmp"]}, "compiled_path": "target/compiled/iterable/models/staging/stg_iterable__list_user.sql", "compiled": true, "compiled_code": "\n\nwith base as (\n\n select *\n from \"postgres\".\"public_iterable_dev\".\"stg_iterable__list_user_tmp\"\n\n),\n\nfields as (\n\n select\n \n _fivetran_id as _fivetran_id,\n _fivetran_synced as _fivetran_synced,\n index as index,\n list_id as list_id\n \n\n\n\n\n \n \n\n\n\n\n\n, cast('postgres.public' as TEXT) as source_relation\n\n\n from base\n),\n\nfinal as (\n\n select\n source_relation,\n cast(_fivetran_id as TEXT ) as _fivetran_user_id,\n index as list_user_index,\n list_id,\n _fivetran_synced\n\n from fields\n)\n\nselect *\nfrom final", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.stg_iterable__campaign_suppression_list_history": {"database": "postgres", "schema": "public_iterable_dev", "name": "stg_iterable__campaign_suppression_list_history", "resource_type": "model", "package_name": "iterable", "path": "staging/stg_iterable__campaign_suppression_list_history.sql", "original_file_path": "models/staging/stg_iterable__campaign_suppression_list_history.sql", "unique_id": "model.iterable.stg_iterable__campaign_suppression_list_history", "fqn": ["iterable", "staging", "stg_iterable__campaign_suppression_list_history"], "alias": "stg_iterable__campaign_suppression_list_history", "checksum": {"name": "sha256", "checksum": "695d57ff7cf14d55ef6881ee9184e873c2cdc7fd61bfd9fbb0cb3330fe055ae0"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "table", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "Table containing a history of suppression lists.", "columns": {"source_relation": {"name": "source_relation", "description": "Identifies the record's source.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": ["doc.iterable.source_relation"]}, "campaign_id": {"name": "campaign_id", "description": "Reference to the campaign associated with the label", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "suppressed_list_id": {"name": "suppressed_list_id", "description": "Reference to the list used", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "updated_at": {"name": "updated_at", "description": "Last update timestamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "The time when a record was last updated by Fivetran.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": ["doc.iterable._fivetran_synced"]}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "iterable://models/staging/stg_iterable.yml", "build_path": null, "unrendered_config": {"materialized": "table", "schema": "iterable_{{ var('directed_schema','dev') }}", "enabled": "var('iterable__using_campaign_suppression_list_history', True)", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789422569.8991418, "relation_name": "\"postgres\".\"public_iterable_dev\".\"stg_iterable__campaign_suppression_list_history\"", "raw_code": "{{ config(enabled=var('iterable__using_campaign_suppression_list_history', True)) }}\n\nwith base as (\n\n select * \n from {{ ref('stg_iterable__campaign_suppression_list_history_tmp') }}\n\n),\n\nfields as (\n\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_iterable/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_iterable/macros/).\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_iterable__campaign_suppression_list_history_tmp')),\n staging_columns=get_campaign_suppression_list_history_columns()\n )\n }}\n {{ fivetran_utils.apply_source_relation(package_name='iterable') }}\n\n from base\n),\n\nfinal as (\n\n select\n source_relation,\n cast(campaign_id as {{ dbt.type_string() }}) as campaign_id,\n cast(suppressed_list_id as {{ dbt.type_string() }}) as suppressed_list_id,\n updated_at,\n _fivetran_synced\n from fields\n)\n\nselect * \nfrom final", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__campaign_suppression_list_history_tmp", "package": null, "version": null}, {"name": "stg_iterable__campaign_suppression_list_history_tmp", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.iterable.get_campaign_suppression_list_history_columns", "macro.fivetran_utils.fill_staging_columns", "macro.fivetran_utils.apply_source_relation", "macro.dbt.type_string"], "nodes": ["model.iterable.stg_iterable__campaign_suppression_list_history_tmp"]}, "compiled_path": "target/compiled/iterable/models/staging/stg_iterable__campaign_suppression_list_history.sql", "compiled": true, "compiled_code": "\n\nwith base as (\n\n select * \n from \"postgres\".\"public_iterable_dev\".\"stg_iterable__campaign_suppression_list_history_tmp\"\n\n),\n\nfields as (\n\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_iterable/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_iterable/macros/).\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n \n _fivetran_synced as _fivetran_synced,\n campaign_id as campaign_id,\n suppressed_list_id as suppressed_list_id,\n updated_at as updated_at\n \n\n\n\n\n \n \n\n\n\n\n\n, cast('postgres.public' as TEXT) as source_relation\n\n\n from base\n),\n\nfinal as (\n\n select\n source_relation,\n cast(campaign_id as TEXT) as campaign_id,\n cast(suppressed_list_id as TEXT) as suppressed_list_id,\n updated_at,\n _fivetran_synced\n from fields\n)\n\nselect * \nfrom final", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.stg_iterable__event_extension": {"database": "postgres", "schema": "public_iterable_dev", "name": "stg_iterable__event_extension", "resource_type": "model", "package_name": "iterable", "path": "staging/stg_iterable__event_extension.sql", "original_file_path": "models/staging/stg_iterable__event_extension.sql", "unique_id": "model.iterable.stg_iterable__event_extension", "fqn": ["iterable", "staging", "stg_iterable__event_extension"], "alias": "stg_iterable__event_extension", "checksum": {"name": "sha256", "checksum": "006d3abf1fe12ef7312b3f02d07a13a483883e57acfe0fceedb3e6a9f71372ff"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "Table containing addition properties from the event table.", "columns": {"source_relation": {"name": "source_relation", "description": "Identifies the record's source.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": ["doc.iterable.source_relation"]}, "event_id": {"name": "event_id", "description": "A Fivetran-created unique identifier derived from hashing campaign_id, created_at, and event_name.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_event_id": {"name": "unique_event_id", "description": "A surrogate key made up of event_id, _fivetran_user_id, and source_relation.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "is_app_already_running": {"name": "is_app_already_running", "description": "Boolean indicating if the app is currently running or not", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "badge": {"name": "badge", "description": "Badge associated with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "canonical_url_id": {"name": "canonical_url_id", "description": "Reference to the url associated with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "is_content_available": {"name": "is_content_available", "description": "Content available from the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "content_id": {"name": "content_id", "description": "Reference to the content associated with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "device": {"name": "device", "description": "The device associated with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "email_id": {"name": "email_id", "description": "Reference to the email associated with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "email_subject": {"name": "email_subject", "description": "Subject of the email associated with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "experiment_id": {"name": "experiment_id", "description": "Reference to the experiment used if the event is an experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "from_phone_number_id": {"name": "from_phone_number_id", "description": "Reference to the phone number which the event is from", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "from_smssender_id": {"name": "from_smssender_id", "description": "Reference to the sms sender which the event is from", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "link_id": {"name": "link_id", "description": "Reference to the link associated with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "link_url": {"name": "link_url", "description": "Url of the link associated with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "locale": {"name": "locale", "description": "Locale associated with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "payload": {"name": "payload", "description": "Payload resulted from the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "platform_endpoint": {"name": "platform_endpoint", "description": "The specific platform endpoint of the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "push_message": {"name": "push_message", "description": "Boolean indicating if the event is a push message", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "region": {"name": "region", "description": "Region of the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "sms_message": {"name": "sms_message", "description": "Boolean indicating if the event is an sms message", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "to_phone_number": {"name": "to_phone_number", "description": "To phone number associated with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "url": {"name": "url", "description": "Url associated with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "workflow_id": {"name": "workflow_id", "description": "Reference to the workflow which the event originated", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "workflow_name": {"name": "workflow_name", "description": "Name of the workflow which the event originated", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "catalog_collection_count": {"name": "catalog_collection_count", "description": "The count of products or items collected in a catalog associated with the event.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "catalog_lookup_count": {"name": "catalog_lookup_count", "description": "The count of times a catalog was looked up or queried during the event.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "city": {"name": "city", "description": "The city associated with the event, which could be the location of the recipient.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "clicked_url": {"name": "clicked_url", "description": "The URL that was clicked by the recipient in response to the marketing message.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "country": {"name": "country", "description": "The country associated with the event, which could be the location of the recipient.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "error_code": {"name": "error_code", "description": "The error code or message indicating any issues or errors encountered during the event.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "expires_at": {"name": "expires_at", "description": "The date and time when the event or message is set to expire or become invalid.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "from_phone_number": {"name": "from_phone_number", "description": "The phone number from which the SMS message was sent.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "in_app_body": {"name": "in_app_body", "description": "The content or body of an in-app message that was sent as part of the event.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "is_sms_estimation": {"name": "is_sms_estimation", "description": "A boolean indicating whether the SMS message is an estimation or not.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "labels": {"name": "labels", "description": "Any labels or tags associated with the event, which can be used for categorization or organization.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "message_status": {"name": "message_status", "description": "The status of the marketing message, such as sent, delivered, opened, etc.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "mms_send_count": {"name": "mms_send_count", "description": "The count of multimedia messages (MMS) sent as part of the event.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "reason": {"name": "reason", "description": "The reason or cause associated with a specific event or action.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "sms_send_count": {"name": "sms_send_count", "description": "The count of SMS messages sent as part of the event.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "_fivetran_user_id": {"name": "_fivetran_user_id", "description": "A Fivetran-created unique identifier for users, derived from hashing user_id and/or email, depending on project type. This exists for users of the new schema starting Aug 2023. In the old schema, the unique identifier is email.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "The time when a record was last updated by Fivetran.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": ["doc.iterable._fivetran_synced"]}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "iterable://models/staging/stg_iterable.yml", "build_path": null, "unrendered_config": {"materialized": "view", "schema": "iterable_{{ var('directed_schema','dev') }}", "enabled": "var('iterable__using_event_extension', True)", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789422569.9044106, "relation_name": "\"postgres\".\"public_iterable_dev\".\"stg_iterable__event_extension\"", "raw_code": "{{ config(\n enabled=var('iterable__using_event_extension', True),\n materialized='view'\n) }}\n\nwith base as (\n\n select * \n from {{ ref('stg_iterable__event_extension_tmp') }}\n\n),\n\nfields as (\n\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_iterable/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_iterable/macros/).\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_iterable__event_extension_tmp')),\n staging_columns=get_event_extension_columns()\n )\n }}\n {{ fivetran_utils.apply_source_relation(package_name='iterable') }}\n\n from base\n),\n\nfinal as (\n select\n source_relation,\n cast(_fivetran_id as {{ dbt.type_string() }} ) as event_id,\n {{ dbt_utils.generate_surrogate_key(['_fivetran_id','_fivetran_user_id','source_relation']) }} as unique_event_id,\n app_already_running as is_app_already_running,\n badge,\n catalog_collection_count,\n catalog_lookup_count,\n cast(canonical_url_id as {{ dbt.type_string() }} ) as canonical_url_id,\n content_available as is_content_available,\n cast(content_id as {{ dbt.type_string() }} ) as content_id,\n device,\n cast(email_id as {{ dbt.type_string() }}) as email_id,\n email_subject,\n experiment_id,\n from_phone_number_id,\n from_smssender_id,\n cast(link_id as {{ dbt.type_string() }} ) as link_id,\n link_url,\n locale,\n payload,\n platform_endpoint,\n push_message,\n region,\n sms_message,\n to_phone_number,\n url,\n cast(workflow_id as {{ dbt.type_string() }} ) as workflow_id,\n workflow_name,\n city,\n clicked_url,\n country,\n error_code,\n expires_at,\n from_phone_number,\n in_app_body,\n is_sms_estimation,\n labels,\n message_status,\n mms_send_count,\n reason,\n sms_send_count,\n _fivetran_synced,\n cast(_fivetran_user_id as {{ dbt.type_string() }} ) as _fivetran_user_id\n\n --The below script allows for pass through columns.\n {{ fivetran_utils.fill_pass_through_columns('iterable_event_extension_pass_through_columns') }}\n\n from fields\n)\n\nselect *\nfrom final", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__event_extension_tmp", "package": null, "version": null}, {"name": "stg_iterable__event_extension_tmp", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.iterable.get_event_extension_columns", "macro.fivetran_utils.fill_staging_columns", "macro.fivetran_utils.apply_source_relation", "macro.dbt.type_string", "macro.dbt_utils.generate_surrogate_key", "macro.fivetran_utils.fill_pass_through_columns"], "nodes": ["model.iterable.stg_iterable__event_extension_tmp"]}, "compiled_path": "target/compiled/iterable/models/staging/stg_iterable__event_extension.sql", "compiled": true, "compiled_code": "\n\nwith base as (\n\n select * \n from \"postgres\".\"public_iterable_dev\".\"stg_iterable__event_extension_tmp\"\n\n),\n\nfields as (\n\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_iterable/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_iterable/macros/).\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n \n _fivetran_id as _fivetran_id,\n _fivetran_synced as _fivetran_synced,\n app_already_running as app_already_running,\n badge as badge,\n catalog_collection_count as catalog_collection_count,\n catalog_lookup_count as catalog_lookup_count,\n canonical_url_id as canonical_url_id,\n content_available as content_available,\n content_id as content_id,\n device as device,\n email_id as email_id,\n email_subject as email_subject,\n experiment_id as experiment_id,\n from_phone_number_id as from_phone_number_id,\n from_smssender_id as from_smssender_id,\n link_id as link_id,\n link_url as link_url,\n locale as locale,\n payload as payload,\n platform_endpoint as platform_endpoint,\n push_message as push_message,\n region as region,\n sms_message as sms_message,\n to_phone_number as to_phone_number,\n url as url,\n workflow_id as workflow_id,\n workflow_name as workflow_name,\n city as city,\n clicked_url as clicked_url,\n country as country,\n error_code as error_code,\n expires_at as expires_at,\n from_phone_number as from_phone_number,\n in_app_body as in_app_body,\n is_sms_estimation as is_sms_estimation,\n labels as labels,\n message_status as message_status,\n mms_send_count as mms_send_count,\n reason as reason,\n sms_send_count as sms_send_count,\n _fivetran_user_id as _fivetran_user_id\n \n\n\n\n\n \n \n\n\n\n\n\n, cast('postgres.public' as TEXT) as source_relation\n\n\n from base\n),\n\nfinal as (\n select\n source_relation,\n cast(_fivetran_id as TEXT ) as event_id,\n md5(cast(coalesce(cast(_fivetran_id as TEXT), '_dbt_utils_surrogate_key_null_') || '-' || coalesce(cast(_fivetran_user_id as TEXT), '_dbt_utils_surrogate_key_null_') || '-' || coalesce(cast(source_relation as TEXT), '_dbt_utils_surrogate_key_null_') as TEXT)) as unique_event_id,\n app_already_running as is_app_already_running,\n badge,\n catalog_collection_count,\n catalog_lookup_count,\n cast(canonical_url_id as TEXT ) as canonical_url_id,\n content_available as is_content_available,\n cast(content_id as TEXT ) as content_id,\n device,\n cast(email_id as TEXT) as email_id,\n email_subject,\n experiment_id,\n from_phone_number_id,\n from_smssender_id,\n cast(link_id as TEXT ) as link_id,\n link_url,\n locale,\n payload,\n platform_endpoint,\n push_message,\n region,\n sms_message,\n to_phone_number,\n url,\n cast(workflow_id as TEXT ) as workflow_id,\n workflow_name,\n city,\n clicked_url,\n country,\n error_code,\n expires_at,\n from_phone_number,\n in_app_body,\n is_sms_estimation,\n labels,\n message_status,\n mms_send_count,\n reason,\n sms_send_count,\n _fivetran_synced,\n cast(_fivetran_user_id as TEXT ) as _fivetran_user_id\n\n --The below script allows for pass through columns.\n \n\n\n\n\n\n from fields\n)\n\nselect *\nfrom final", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.stg_iterable__campaign_list_history": {"database": "postgres", "schema": "public_iterable_dev", "name": "stg_iterable__campaign_list_history", "resource_type": "model", "package_name": "iterable", "path": "staging/stg_iterable__campaign_list_history.sql", "original_file_path": "models/staging/stg_iterable__campaign_list_history.sql", "unique_id": "model.iterable.stg_iterable__campaign_list_history", "fqn": ["iterable", "staging", "stg_iterable__campaign_list_history"], "alias": "stg_iterable__campaign_list_history", "checksum": {"name": "sha256", "checksum": "c7db9c46a66fec00d9fbd6492c0ea17397ec80a12d85fa2d63b9f04f09c45013"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "table", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "Table containing a history of lists.", "columns": {"source_relation": {"name": "source_relation", "description": "Identifies the record's source.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": ["doc.iterable.source_relation"]}, "campaign_id": {"name": "campaign_id", "description": "Reference to the campaign associated with the label", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "list_id": {"name": "list_id", "description": "Reference to the list used", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "updated_at": {"name": "updated_at", "description": "Last update timestamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "The time when a record was last updated by Fivetran.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": ["doc.iterable._fivetran_synced"]}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "iterable://models/staging/stg_iterable.yml", "build_path": null, "unrendered_config": {"materialized": "table", "schema": "iterable_{{ var('directed_schema','dev') }}", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789422569.8978462, "relation_name": "\"postgres\".\"public_iterable_dev\".\"stg_iterable__campaign_list_history\"", "raw_code": "with base as (\n\n select * \n from {{ ref('stg_iterable__campaign_list_history_tmp') }}\n\n),\n\nfields as (\n\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_iterable/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_iterable/macros/).\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_iterable__campaign_list_history_tmp')),\n staging_columns=get_campaign_list_history_columns()\n )\n }}\n {{ fivetran_utils.apply_source_relation(package_name='iterable') }}\n \n from base\n),\n\nfinal as (\n\n select\n source_relation,\n cast(campaign_id as {{ dbt.type_string() }}) as campaign_id,\n cast(list_id as {{ dbt.type_string() }}) as list_id,\n updated_at,\n _fivetran_synced\n from fields\n)\n\nselect * \nfrom final", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__campaign_list_history_tmp", "package": null, "version": null}, {"name": "stg_iterable__campaign_list_history_tmp", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.iterable.get_campaign_list_history_columns", "macro.fivetran_utils.fill_staging_columns", "macro.fivetran_utils.apply_source_relation", "macro.dbt.type_string"], "nodes": ["model.iterable.stg_iterable__campaign_list_history_tmp"]}, "compiled_path": "target/compiled/iterable/models/staging/stg_iterable__campaign_list_history.sql", "compiled": true, "compiled_code": "with base as (\n\n select * \n from \"postgres\".\"public_iterable_dev\".\"stg_iterable__campaign_list_history_tmp\"\n\n),\n\nfields as (\n\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_iterable/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_iterable/macros/).\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n \n _fivetran_synced as _fivetran_synced,\n campaign_id as campaign_id,\n list_id as list_id,\n updated_at as updated_at\n \n\n\n\n\n \n \n\n\n\n\n\n, cast('postgres.public' as TEXT) as source_relation\n\n \n from base\n),\n\nfinal as (\n\n select\n source_relation,\n cast(campaign_id as TEXT) as campaign_id,\n cast(list_id as TEXT) as list_id,\n updated_at,\n _fivetran_synced\n from fields\n)\n\nselect * \nfrom final", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.stg_iterable__channel": {"database": "postgres", "schema": "public_iterable_dev", "name": "stg_iterable__channel", "resource_type": "model", "package_name": "iterable", "path": "staging/stg_iterable__channel.sql", "original_file_path": "models/staging/stg_iterable__channel.sql", "unique_id": "model.iterable.stg_iterable__channel", "fqn": ["iterable", "staging", "stg_iterable__channel"], "alias": "stg_iterable__channel", "checksum": {"name": "sha256", "checksum": "1ade77557691cabd1c65676182adaf401d8dde9ee42a6918d1ea7a124159cbf2"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "table", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "Table containing unique channels.", "columns": {"source_relation": {"name": "source_relation", "description": "Identifies the record's source.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": ["doc.iterable.source_relation"]}, "channel_id": {"name": "channel_id", "description": "Unique identifier of the channel", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "channel_name": {"name": "channel_name", "description": "User defined name of the channel", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "channel_type": {"name": "channel_type", "description": "The channel type", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "message_medium": {"name": "message_medium", "description": "The message medium associated with the channel", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "The time when a record was last updated by Fivetran.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": ["doc.iterable._fivetran_synced"]}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "iterable://models/staging/stg_iterable.yml", "build_path": null, "unrendered_config": {"materialized": "table", "schema": "iterable_{{ var('directed_schema','dev') }}", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789422569.9000351, "relation_name": "\"postgres\".\"public_iterable_dev\".\"stg_iterable__channel\"", "raw_code": "with base as (\n\n select *\n from {{ ref('stg_iterable__channel_tmp') }}\n\n),\n\nfields as (\n\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns\n that are expected/needed (staging_columns from dbt_iterable/models/tmp/) and compares it with columns\n in the source (source_columns from dbt_iterable/macros/).\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_iterable__channel_tmp')),\n staging_columns=get_channel_columns()\n )\n }}\n {{ fivetran_utils.apply_source_relation(package_name='iterable') }}\n\n from base\n\n),\n\nfinal as (\n\n select\n source_relation,\n cast(id as {{ dbt.type_string() }} ) as channel_id,\n name as channel_name,\n channel_type,\n message_medium,\n _fivetran_synced\n\n from fields\n where not coalesce(_fivetran_deleted, false)\n)\n\nselect * \nfrom final", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__channel_tmp", "package": null, "version": null}, {"name": "stg_iterable__channel_tmp", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.iterable.get_channel_columns", "macro.fivetran_utils.fill_staging_columns", "macro.fivetran_utils.apply_source_relation", "macro.dbt.type_string"], "nodes": ["model.iterable.stg_iterable__channel_tmp"]}, "compiled_path": "target/compiled/iterable/models/staging/stg_iterable__channel.sql", "compiled": true, "compiled_code": "with base as (\n\n select *\n from \"postgres\".\"public_iterable_dev\".\"stg_iterable__channel_tmp\"\n\n),\n\nfields as (\n\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns\n that are expected/needed (staging_columns from dbt_iterable/models/tmp/) and compares it with columns\n in the source (source_columns from dbt_iterable/macros/).\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n \n _fivetran_deleted as _fivetran_deleted,\n _fivetran_synced as _fivetran_synced,\n channel_type as channel_type,\n id as id,\n message_medium as message_medium,\n name as name\n \n\n\n\n\n \n \n\n\n\n\n\n, cast('postgres.public' as TEXT) as source_relation\n\n\n from base\n\n),\n\nfinal as (\n\n select\n source_relation,\n cast(id as TEXT ) as channel_id,\n name as channel_name,\n channel_type,\n message_medium,\n _fivetran_synced\n\n from fields\n where not coalesce(_fivetran_deleted, false)\n)\n\nselect * \nfrom final", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.stg_iterable__message_type_tmp": {"database": "postgres", "schema": "public_iterable_dev", "name": "stg_iterable__message_type_tmp", "resource_type": "model", "package_name": "iterable", "path": "staging/tmp/stg_iterable__message_type_tmp.sql", "original_file_path": "models/staging/tmp/stg_iterable__message_type_tmp.sql", "unique_id": "model.iterable.stg_iterable__message_type_tmp", "fqn": ["iterable", "staging", "tmp", "stg_iterable__message_type_tmp"], "alias": "stg_iterable__message_type_tmp", "checksum": {"name": "sha256", "checksum": "fda7a978e7b71b46f37e4878898c6655526f0531d36f74968c7bbb56ec4200e5"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"materialized": "view", "schema": "iterable_{{ var('directed_schema','dev') }}", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789422569.2064412, "relation_name": "\"postgres\".\"public_iterable_dev\".\"stg_iterable__message_type_tmp\"", "raw_code": "{{\n fivetran_utils.union_connections(\n connection_dictionary='iterable_sources',\n single_source_name='iterable',\n single_table_name='message_type'\n )\n}}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["iterable", "message_type"], ["iterable", "message_type"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.fivetran_utils.union_connections"], "nodes": ["source.iterable.iterable.message_type"]}, "compiled_path": "target/compiled/iterable/models/staging/tmp/stg_iterable__message_type_tmp.sql", "compiled": true, "compiled_code": "\n\n\n-- ** Values passed to adapter.get_relation:\n -- full-identifier_var: iterable_message_type_identifier\n -- database: postgres \n -- schema: public\n -- identifier: message_type_data\n\n\n select\n \"id\",\n \"name\",\n \"channel_id\",\n \"_fivetran_deleted\",\n \"_fivetran_synced\",\n \"created_at\",\n \"frequency_cap\",\n \"rate_limit_per_minute\",\n \"subscription_policy\",\n \"updated_at\"\n from \"postgres\".\"public\".\"message_type_data\" as source_table\n\n ", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.stg_iterable__event_extension_tmp": {"database": "postgres", "schema": "public_iterable_dev", "name": "stg_iterable__event_extension_tmp", "resource_type": "model", "package_name": "iterable", "path": "staging/tmp/stg_iterable__event_extension_tmp.sql", "original_file_path": "models/staging/tmp/stg_iterable__event_extension_tmp.sql", "unique_id": "model.iterable.stg_iterable__event_extension_tmp", "fqn": ["iterable", "staging", "tmp", "stg_iterable__event_extension_tmp"], "alias": "stg_iterable__event_extension_tmp", "checksum": {"name": "sha256", "checksum": "09d92da24c5304acbb0f0ebc81fe49e70458d1319cb1c2090f5f9ce0b87ecb29"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"materialized": "view", "schema": "iterable_{{ var('directed_schema','dev') }}", "enabled": "var('iterable__using_event_extension', True)", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789422569.2327213, "relation_name": "\"postgres\".\"public_iterable_dev\".\"stg_iterable__event_extension_tmp\"", "raw_code": "{{ config(enabled=var('iterable__using_event_extension', True)) }}\n\n{{\n fivetran_utils.union_connections(\n connection_dictionary='iterable_sources',\n single_source_name='iterable',\n single_table_name='event_extension'\n )\n}}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["iterable", "event_extension"], ["iterable", "event_extension"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.fivetran_utils.union_connections"], "nodes": ["source.iterable.iterable.event_extension"]}, "compiled_path": "target/compiled/iterable/models/staging/tmp/stg_iterable__event_extension_tmp.sql", "compiled": true, "compiled_code": "\n\n\n\n\n-- ** Values passed to adapter.get_relation:\n -- full-identifier_var: iterable_event_extension_identifier\n -- database: postgres \n -- schema: public\n -- identifier: event_extension_data\n\n\n select\n \"_fivetran_id\",\n \"app_already_running\",\n \"badge\",\n \"canonical_url_id\",\n \"content_available\",\n \"content_id\",\n \"device\",\n \"email_id\",\n \"email_subject\",\n \"experiment_id\",\n \"from_phone_number_id\",\n \"from_smssender_id\",\n \"image_url\",\n \"is_ghost_push\",\n \"link_id\",\n \"link_url\",\n \"platform_endpoint\",\n \"push_message\",\n \"region\",\n \"sms_message\",\n \"sound\",\n \"to_phone_number\",\n \"url\",\n \"workflow_id\",\n \"workflow_name\",\n \"locale\",\n \"deeplink_android\",\n \"deeplink_ios\",\n \"payload\",\n \"sms_provider_response_status\",\n \"sms_provider_response_message\",\n \"sms_provider_response_code\",\n \"sms_provider_response_more_info\",\n \"_fivetran_synced\",\n \"catalog_collection_count\",\n \"catalog_lookup_count\",\n \"city\",\n \"clicked_url\",\n \"country\",\n \"error_code\",\n \"expires_at\",\n \"from_phone_number\",\n \"in_app_body\",\n \"is_sms_estimation\",\n \"labels\",\n \"message_context\",\n \"message_status\",\n \"mms_send_count\",\n \"product_recommendation_count\",\n \"proxy_source\",\n \"reason\",\n \"sms_send_count\",\n \"web_push_body\",\n \"web_push_click_action\",\n \"web_push_icon\",\n \"web_push_message\",\n \"_fivetran_user_id\"\n from \"postgres\".\"public\".\"event_extension_data\" as source_table\n\n ", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.stg_iterable__user_unsub_message_type_tmp": {"database": "postgres", "schema": "public_iterable_dev", "name": "stg_iterable__user_unsub_message_type_tmp", "resource_type": "model", "package_name": "iterable", "path": "staging/tmp/stg_iterable__user_unsub_message_type_tmp.sql", "original_file_path": "models/staging/tmp/stg_iterable__user_unsub_message_type_tmp.sql", "unique_id": "model.iterable.stg_iterable__user_unsub_message_type_tmp", "fqn": ["iterable", "staging", "tmp", "stg_iterable__user_unsub_message_type_tmp"], "alias": "stg_iterable__user_unsub_message_type_tmp", "checksum": {"name": "sha256", "checksum": "ddb46e159ed22f011676fbe7e00ba9271a493bc5185d286261ae30fa0b183636"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"materialized": "view", "schema": "iterable_{{ var('directed_schema','dev') }}", "enabled": "var('iterable__using_user_unsubscribed_message_type', True)", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789422569.2424047, "relation_name": "\"postgres\".\"public_iterable_dev\".\"stg_iterable__user_unsub_message_type_tmp\"", "raw_code": "{{ config(enabled=var('iterable__using_user_unsubscribed_message_type', True)) }}\n\n{{\n fivetran_utils.union_connections(\n connection_dictionary='iterable_sources',\n single_source_name='iterable',\n single_table_name='user_unsubscribed_message_type' if does_table_exist('user_unsubscribed_message_type') else 'user_unsubscribed_message_type_history'\n )\n}}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["iterable", "user_unsubscribed_message_type_history"], ["iterable", "user_unsubscribed_message_type_history"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.iterable.does_table_exist", "macro.fivetran_utils.union_connections"], "nodes": ["source.iterable.iterable.user_unsubscribed_message_type_history"]}, "compiled_path": "target/compiled/iterable/models/staging/tmp/stg_iterable__user_unsub_message_type_tmp.sql", "compiled": true, "compiled_code": "\n\n\n\n\n-- ** Values passed to adapter.get_relation:\n -- full-identifier_var: iterable_user_unsubscribed_message_type_identifier\n -- database: postgres \n -- schema: public\n -- identifier: user_unsubscribed_message_type_data\n\n\n select\n \"_fivetran_id\",\n \"message_type_id\",\n \"_fivetran_synced\"\n from \"postgres\".\"public\".\"user_unsubscribed_message_type_data\" as source_table\n\n ", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.stg_iterable__campaign_list_history_tmp": {"database": "postgres", "schema": "public_iterable_dev", "name": "stg_iterable__campaign_list_history_tmp", "resource_type": "model", "package_name": "iterable", "path": "staging/tmp/stg_iterable__campaign_list_history_tmp.sql", "original_file_path": "models/staging/tmp/stg_iterable__campaign_list_history_tmp.sql", "unique_id": "model.iterable.stg_iterable__campaign_list_history_tmp", "fqn": ["iterable", "staging", "tmp", "stg_iterable__campaign_list_history_tmp"], "alias": "stg_iterable__campaign_list_history_tmp", "checksum": {"name": "sha256", "checksum": "c26b6a07e1d280b2d5dea6ddbff02200d527e798d8af0a8105be30c0e7d013f7"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"materialized": "view", "schema": "iterable_{{ var('directed_schema','dev') }}", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789422569.2527096, "relation_name": "\"postgres\".\"public_iterable_dev\".\"stg_iterable__campaign_list_history_tmp\"", "raw_code": "{{\n fivetran_utils.union_connections(\n connection_dictionary='iterable_sources',\n single_source_name='iterable',\n single_table_name='campaign_list_history'\n )\n}}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["iterable", "campaign_list_history"], ["iterable", "campaign_list_history"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.fivetran_utils.union_connections"], "nodes": ["source.iterable.iterable.campaign_list_history"]}, "compiled_path": "target/compiled/iterable/models/staging/tmp/stg_iterable__campaign_list_history_tmp.sql", "compiled": true, "compiled_code": "\n\n\n-- ** Values passed to adapter.get_relation:\n -- full-identifier_var: iterable_campaign_list_history_identifier\n -- database: postgres \n -- schema: public\n -- identifier: campaign_list_history_data\n\n\n select\n \"list_id\",\n \"campaign_id\",\n \"updated_at\",\n \"_fivetran_synced\"\n from \"postgres\".\"public\".\"campaign_list_history_data\" as source_table\n\n ", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.stg_iterable__list_user_tmp": {"database": "postgres", "schema": "public_iterable_dev", "name": "stg_iterable__list_user_tmp", "resource_type": "model", "package_name": "iterable", "path": "staging/tmp/stg_iterable__list_user_tmp.sql", "original_file_path": "models/staging/tmp/stg_iterable__list_user_tmp.sql", "unique_id": "model.iterable.stg_iterable__list_user_tmp", "fqn": ["iterable", "staging", "tmp", "stg_iterable__list_user_tmp"], "alias": "stg_iterable__list_user_tmp", "checksum": {"name": "sha256", "checksum": "5c8b455013c26cfd4094b38e210edeb911a22dc0f05544e65fb48c350c2725fe"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"materialized": "view", "schema": "iterable_{{ var('directed_schema','dev') }}", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789422569.2605634, "relation_name": "\"postgres\".\"public_iterable_dev\".\"stg_iterable__list_user_tmp\"", "raw_code": "{{\n fivetran_utils.union_connections(\n connection_dictionary='iterable_sources',\n single_source_name='iterable',\n single_table_name='list_user'\n )\n}}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["iterable", "list_user"], ["iterable", "list_user"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.fivetran_utils.union_connections"], "nodes": ["source.iterable.iterable.list_user"]}, "compiled_path": "target/compiled/iterable/models/staging/tmp/stg_iterable__list_user_tmp.sql", "compiled": true, "compiled_code": "\n\n\n-- ** Values passed to adapter.get_relation:\n -- full-identifier_var: iterable_list_user_identifier\n -- database: postgres \n -- schema: public\n -- identifier: list_user_data\n\n\n select\n \"_fivetran_id\",\n \"index\",\n \"list_id\",\n \"_fivetran_synced\"\n from \"postgres\".\"public\".\"list_user_data\" as source_table\n\n ", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.stg_iterable__user_history_tmp": {"database": "postgres", "schema": "public_iterable_dev", "name": "stg_iterable__user_history_tmp", "resource_type": "model", "package_name": "iterable", "path": "staging/tmp/stg_iterable__user_history_tmp.sql", "original_file_path": "models/staging/tmp/stg_iterable__user_history_tmp.sql", "unique_id": "model.iterable.stg_iterable__user_history_tmp", "fqn": ["iterable", "staging", "tmp", "stg_iterable__user_history_tmp"], "alias": "stg_iterable__user_history_tmp", "checksum": {"name": "sha256", "checksum": "cc04d0fbef9ff5cd4f72ae66c9cffd316c5e134ecd81dc216dcf682b34eb587b"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"materialized": "view", "schema": "iterable_{{ var('directed_schema','dev') }}", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789422569.2691276, "relation_name": "\"postgres\".\"public_iterable_dev\".\"stg_iterable__user_history_tmp\"", "raw_code": "{{\n fivetran_utils.union_connections(\n connection_dictionary='iterable_sources',\n single_source_name='iterable',\n single_table_name='user_history'\n )\n}}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["iterable", "user_history"], ["iterable", "user_history"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.fivetran_utils.union_connections"], "nodes": ["source.iterable.iterable.user_history"]}, "compiled_path": "target/compiled/iterable/models/staging/tmp/stg_iterable__user_history_tmp.sql", "compiled": true, "compiled_code": "\n\n\n-- ** Values passed to adapter.get_relation:\n -- full-identifier_var: iterable_user_history_identifier\n -- database: postgres \n -- schema: public\n -- identifier: user_history_data\n\n\n select\n \"email\",\n \"updated_at\",\n \"first_name\",\n \"last_name\",\n \"phone_number\",\n \"user_id\",\n \"signup_date\",\n \"signup_source\",\n \"phone_number_carrier\",\n \"phone_number_country_code_iso\",\n \"phone_number_line_type\",\n \"phone_number_updated_at\",\n \"_fivetran_synced\",\n \"email_list_ids\",\n \"iterable_user_id\"\n from \"postgres\".\"public\".\"user_history_data\" as source_table\n\n ", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.stg_iterable__campaign_history_tmp": {"database": "postgres", "schema": "public_iterable_dev", "name": "stg_iterable__campaign_history_tmp", "resource_type": "model", "package_name": "iterable", "path": "staging/tmp/stg_iterable__campaign_history_tmp.sql", "original_file_path": "models/staging/tmp/stg_iterable__campaign_history_tmp.sql", "unique_id": "model.iterable.stg_iterable__campaign_history_tmp", "fqn": ["iterable", "staging", "tmp", "stg_iterable__campaign_history_tmp"], "alias": "stg_iterable__campaign_history_tmp", "checksum": {"name": "sha256", "checksum": "a37ade72efad4e5d8b38cc0548f4a4c79d38a4a337ce71f236581bda47f94696"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"materialized": "view", "schema": "iterable_{{ var('directed_schema','dev') }}", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789422569.2772555, "relation_name": "\"postgres\".\"public_iterable_dev\".\"stg_iterable__campaign_history_tmp\"", "raw_code": "{{\n fivetran_utils.union_connections(\n connection_dictionary='iterable_sources',\n single_source_name='iterable',\n single_table_name='campaign_history'\n )\n}}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["iterable", "campaign_history"], ["iterable", "campaign_history"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.fivetran_utils.union_connections"], "nodes": ["source.iterable.iterable.campaign_history"]}, "compiled_path": "target/compiled/iterable/models/staging/tmp/stg_iterable__campaign_history_tmp.sql", "compiled": true, "compiled_code": "\n\n\n-- ** Values passed to adapter.get_relation:\n -- full-identifier_var: iterable_campaign_history_identifier\n -- database: postgres \n -- schema: public\n -- identifier: campaign_history_data\n\n\n select\n \"id\",\n \"updated_at\",\n \"template_id\",\n \"recurring_campaign_id\",\n \"campaign_state\",\n \"created_at\",\n \"created_by_user_id\",\n \"ended_at\",\n \"name\",\n \"send_size\",\n \"start_at\",\n \"type\",\n \"workflow_id\",\n \"_fivetran_synced\",\n \"updated_by_user_id\",\n \"message_medium\"\n from \"postgres\".\"public\".\"campaign_history_data\" as source_table\n\n ", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.stg_iterable__template_history_tmp": {"database": "postgres", "schema": "public_iterable_dev", "name": "stg_iterable__template_history_tmp", "resource_type": "model", "package_name": "iterable", "path": "staging/tmp/stg_iterable__template_history_tmp.sql", "original_file_path": "models/staging/tmp/stg_iterable__template_history_tmp.sql", "unique_id": "model.iterable.stg_iterable__template_history_tmp", "fqn": ["iterable", "staging", "tmp", "stg_iterable__template_history_tmp"], "alias": "stg_iterable__template_history_tmp", "checksum": {"name": "sha256", "checksum": "b37299e696c1cd6388ad85a4042f9b8a5364b969e7c4fdb42f03e4c4803e9a7f"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"materialized": "view", "schema": "iterable_{{ var('directed_schema','dev') }}", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789422569.2852395, "relation_name": "\"postgres\".\"public_iterable_dev\".\"stg_iterable__template_history_tmp\"", "raw_code": "{{\n fivetran_utils.union_connections(\n connection_dictionary='iterable_sources',\n single_source_name='iterable',\n single_table_name='template_history'\n )\n}}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["iterable", "template_history"], ["iterable", "template_history"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.fivetran_utils.union_connections"], "nodes": ["source.iterable.iterable.template_history"]}, "compiled_path": "target/compiled/iterable/models/staging/tmp/stg_iterable__template_history_tmp.sql", "compiled": true, "compiled_code": "\n\n\n-- ** Values passed to adapter.get_relation:\n -- full-identifier_var: iterable_template_history_identifier\n -- database: postgres \n -- schema: public\n -- identifier: template_history_data\n\n\n select\n \"id\",\n \"updated_at\",\n \"message_type_id\",\n \"client_template_id\",\n \"created_at\",\n \"creator_user_id\",\n \"name\",\n \"template_type\",\n \"_fivetran_synced\"\n from \"postgres\".\"public\".\"template_history_data\" as source_table\n\n ", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.stg_iterable__event_tmp": {"database": "postgres", "schema": "public_iterable_dev", "name": "stg_iterable__event_tmp", "resource_type": "model", "package_name": "iterable", "path": "staging/tmp/stg_iterable__event_tmp.sql", "original_file_path": "models/staging/tmp/stg_iterable__event_tmp.sql", "unique_id": "model.iterable.stg_iterable__event_tmp", "fqn": ["iterable", "staging", "tmp", "stg_iterable__event_tmp"], "alias": "stg_iterable__event_tmp", "checksum": {"name": "sha256", "checksum": "31555eb22bfca797c1f1a4f1503da21f7620762d199e7e32b2d268c03e139f65"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"materialized": "view", "schema": "iterable_{{ var('directed_schema','dev') }}", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789422569.2934778, "relation_name": "\"postgres\".\"public_iterable_dev\".\"stg_iterable__event_tmp\"", "raw_code": "{{\n fivetran_utils.union_connections(\n connection_dictionary='iterable_sources',\n single_source_name='iterable',\n single_table_name='event'\n )\n}}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["iterable", "event"], ["iterable", "event"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.fivetran_utils.union_connections"], "nodes": ["source.iterable.iterable.event"]}, "compiled_path": "target/compiled/iterable/models/staging/tmp/stg_iterable__event_tmp.sql", "compiled": true, "compiled_code": "\n\n\n-- ** Values passed to adapter.get_relation:\n -- full-identifier_var: iterable_event_identifier\n -- database: postgres \n -- schema: public\n -- identifier: event_data\n\n\n select\n \"_fivetran_id\",\n \"email\",\n \"campaign_id\",\n \"message_id\",\n \"content_id\",\n \"created_at\",\n \"event_name\",\n \"ip\",\n \"message_bus_id\",\n \"message_type_id\",\n \"recipient_state\",\n \"status\",\n \"unsub_source\",\n \"user_agent\",\n \"user_agent_device\",\n \"transactional_data\",\n \"additional_properties\",\n \"_fivetran_synced\",\n \"_fivetran_user_id\"\n from \"postgres\".\"public\".\"event_data\" as source_table\n\n ", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.stg_iterable__journey_tmp": {"database": "postgres", "schema": "public_iterable_dev", "name": "stg_iterable__journey_tmp", "resource_type": "model", "package_name": "iterable", "path": "staging/tmp/stg_iterable__journey_tmp.sql", "original_file_path": "models/staging/tmp/stg_iterable__journey_tmp.sql", "unique_id": "model.iterable.stg_iterable__journey_tmp", "fqn": ["iterable", "staging", "tmp", "stg_iterable__journey_tmp"], "alias": "stg_iterable__journey_tmp", "checksum": {"name": "sha256", "checksum": "9e10fed335359755ce1488a7df46c9bfd4a08b029e757c4e81c8c2f8cce28961"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"materialized": "view", "schema": "iterable_{{ var('directed_schema','dev') }}", "enabled": "var('iterable__using_journey', True)", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789422569.302108, "relation_name": "\"postgres\".\"public_iterable_dev\".\"stg_iterable__journey_tmp\"", "raw_code": "{{ config(enabled=var('iterable__using_journey', True)) }}\n\n{{\n fivetran_utils.union_connections(\n connection_dictionary='iterable_sources',\n single_source_name='iterable',\n single_table_name='journey'\n )\n}}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["iterable", "journey"], ["iterable", "journey"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.fivetran_utils.union_connections"], "nodes": ["source.iterable.iterable.journey"]}, "compiled_path": "target/compiled/iterable/models/staging/tmp/stg_iterable__journey_tmp.sql", "compiled": true, "compiled_code": "\n\n\n\n\n-- ** Values passed to adapter.get_relation:\n -- full-identifier_var: iterable_journey_identifier\n -- database: postgres \n -- schema: public\n -- identifier: journey_data\n\n\n select\n \"id\",\n \"name\",\n \"journey_type\",\n \"description\",\n \"creator_user_id\",\n \"enabled\",\n \"is_archived\",\n \"lifetime_limit\",\n \"simultaneous_limit\",\n \"start_tile_id\",\n \"trigger_event_names\",\n \"created_at\",\n \"updated_at\",\n \"_fivetran_deleted\",\n \"_fivetran_synced\",\n \"draft_name\"\n from \"postgres\".\"public\".\"journey_data\" as source_table\n\n ", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.stg_iterable__campaign_suppression_list_history_tmp": {"database": "postgres", "schema": "public_iterable_dev", "name": "stg_iterable__campaign_suppression_list_history_tmp", "resource_type": "model", "package_name": "iterable", "path": "staging/tmp/stg_iterable__campaign_suppression_list_history_tmp.sql", "original_file_path": "models/staging/tmp/stg_iterable__campaign_suppression_list_history_tmp.sql", "unique_id": "model.iterable.stg_iterable__campaign_suppression_list_history_tmp", "fqn": ["iterable", "staging", "tmp", "stg_iterable__campaign_suppression_list_history_tmp"], "alias": "stg_iterable__campaign_suppression_list_history_tmp", "checksum": {"name": "sha256", "checksum": "3c5a325cac70574f2defa9fa09b436c03a3fe8a3dede5729ca95451b410d636c"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"materialized": "view", "schema": "iterable_{{ var('directed_schema','dev') }}", "enabled": "var('iterable__using_campaign_suppression_list_history', True)", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789422569.31171, "relation_name": "\"postgres\".\"public_iterable_dev\".\"stg_iterable__campaign_suppression_list_history_tmp\"", "raw_code": "{{ config(enabled=var('iterable__using_campaign_suppression_list_history', True)) }}\n\n{{\n fivetran_utils.union_connections(\n connection_dictionary='iterable_sources',\n single_source_name='iterable',\n single_table_name='campaign_suppression_list_history'\n )\n}}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["iterable", "campaign_suppression_list_history"], ["iterable", "campaign_suppression_list_history"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.fivetran_utils.union_connections"], "nodes": ["source.iterable.iterable.campaign_suppression_list_history"]}, "compiled_path": "target/compiled/iterable/models/staging/tmp/stg_iterable__campaign_suppression_list_history_tmp.sql", "compiled": true, "compiled_code": "\n\n\n\n\n-- ** Values passed to adapter.get_relation:\n -- full-identifier_var: iterable_campaign_suppression_list_history_identifier\n -- database: postgres \n -- schema: public\n -- identifier: campaign_suppression_list_history_data\n\n\n select\n \"suppressed_list_id\",\n \"campaign_id\",\n \"updated_at\",\n \"_fivetran_synced\"\n from \"postgres\".\"public\".\"campaign_suppression_list_history_data\" as source_table\n\n ", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.stg_iterable__campaign_label_history_tmp": {"database": "postgres", "schema": "public_iterable_dev", "name": "stg_iterable__campaign_label_history_tmp", "resource_type": "model", "package_name": "iterable", "path": "staging/tmp/stg_iterable__campaign_label_history_tmp.sql", "original_file_path": "models/staging/tmp/stg_iterable__campaign_label_history_tmp.sql", "unique_id": "model.iterable.stg_iterable__campaign_label_history_tmp", "fqn": ["iterable", "staging", "tmp", "stg_iterable__campaign_label_history_tmp"], "alias": "stg_iterable__campaign_label_history_tmp", "checksum": {"name": "sha256", "checksum": "08e70c9938c895459cabba65b1992d360775e26ea2b8275e408bcf21e814bd58"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"materialized": "view", "schema": "iterable_{{ var('directed_schema','dev') }}", "enabled": "var('iterable__using_campaign_label_history', True)", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789422569.3218236, "relation_name": "\"postgres\".\"public_iterable_dev\".\"stg_iterable__campaign_label_history_tmp\"", "raw_code": "{{ config(enabled=var('iterable__using_campaign_label_history', True)) }}\n\n{{\n fivetran_utils.union_connections(\n connection_dictionary='iterable_sources',\n single_source_name='iterable',\n single_table_name='campaign_label_history'\n )\n}}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["iterable", "campaign_label_history"], ["iterable", "campaign_label_history"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.fivetran_utils.union_connections"], "nodes": ["source.iterable.iterable.campaign_label_history"]}, "compiled_path": "target/compiled/iterable/models/staging/tmp/stg_iterable__campaign_label_history_tmp.sql", "compiled": true, "compiled_code": "\n\n\n\n\n-- ** Values passed to adapter.get_relation:\n -- full-identifier_var: iterable_campaign_label_history_identifier\n -- database: postgres \n -- schema: public\n -- identifier: campaign_label_history_data\n\n\n select\n \"campaign_id\",\n \"label\",\n \"updated_at\",\n \"_fivetran_synced\"\n from \"postgres\".\"public\".\"campaign_label_history_data\" as source_table\n\n ", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.stg_iterable__list_tmp": {"database": "postgres", "schema": "public_iterable_dev", "name": "stg_iterable__list_tmp", "resource_type": "model", "package_name": "iterable", "path": "staging/tmp/stg_iterable__list_tmp.sql", "original_file_path": "models/staging/tmp/stg_iterable__list_tmp.sql", "unique_id": "model.iterable.stg_iterable__list_tmp", "fqn": ["iterable", "staging", "tmp", "stg_iterable__list_tmp"], "alias": "stg_iterable__list_tmp", "checksum": {"name": "sha256", "checksum": "95fbbf63205ef9000c19e76270c8ab96e23c4f9d8072f3892a08f20648a42b5a"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"materialized": "view", "schema": "iterable_{{ var('directed_schema','dev') }}", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789422569.331224, "relation_name": "\"postgres\".\"public_iterable_dev\".\"stg_iterable__list_tmp\"", "raw_code": "{{\n fivetran_utils.union_connections(\n connection_dictionary='iterable_sources',\n single_source_name='iterable',\n single_table_name='list'\n )\n}}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["iterable", "list"], ["iterable", "list"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.fivetran_utils.union_connections"], "nodes": ["source.iterable.iterable.list"]}, "compiled_path": "target/compiled/iterable/models/staging/tmp/stg_iterable__list_tmp.sql", "compiled": true, "compiled_code": "\n\n\n-- ** Values passed to adapter.get_relation:\n -- full-identifier_var: iterable_list_identifier\n -- database: postgres \n -- schema: public\n -- identifier: list_data\n\n\n select\n \"id\",\n \"name\",\n \"created_at\",\n \"list_type\",\n \"_fivetran_deleted\",\n \"_fivetran_synced\",\n \"description\"\n from \"postgres\".\"public\".\"list_data\" as source_table\n\n ", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.stg_iterable__channel_tmp": {"database": "postgres", "schema": "public_iterable_dev", "name": "stg_iterable__channel_tmp", "resource_type": "model", "package_name": "iterable", "path": "staging/tmp/stg_iterable__channel_tmp.sql", "original_file_path": "models/staging/tmp/stg_iterable__channel_tmp.sql", "unique_id": "model.iterable.stg_iterable__channel_tmp", "fqn": ["iterable", "staging", "tmp", "stg_iterable__channel_tmp"], "alias": "stg_iterable__channel_tmp", "checksum": {"name": "sha256", "checksum": "0516bc3567b725378b33829b8c3e7dc1b6680922f2d1e7824a913b82ca617905"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"materialized": "view", "schema": "iterable_{{ var('directed_schema','dev') }}", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789422569.3394008, "relation_name": "\"postgres\".\"public_iterable_dev\".\"stg_iterable__channel_tmp\"", "raw_code": "{{\n fivetran_utils.union_connections(\n connection_dictionary='iterable_sources',\n single_source_name='iterable',\n single_table_name='channel'\n )\n}}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["iterable", "channel"], ["iterable", "channel"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.fivetran_utils.union_connections"], "nodes": ["source.iterable.iterable.channel"]}, "compiled_path": "target/compiled/iterable/models/staging/tmp/stg_iterable__channel_tmp.sql", "compiled": true, "compiled_code": "\n\n\n-- ** Values passed to adapter.get_relation:\n -- full-identifier_var: iterable_channel_identifier\n -- database: postgres \n -- schema: public\n -- identifier: channel_data\n\n\n select\n \"id\",\n \"name\",\n \"channel_type\",\n \"message_medium\",\n \"_fivetran_deleted\",\n \"_fivetran_synced\"\n from \"postgres\".\"public\".\"channel_data\" as source_table\n\n ", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.stg_iterable__user_unsubscribed_channel_tmp": {"database": "postgres", "schema": "public_iterable_dev", "name": "stg_iterable__user_unsubscribed_channel_tmp", "resource_type": "model", "package_name": "iterable", "path": "staging/tmp/stg_iterable__user_unsubscribed_channel_tmp.sql", "original_file_path": "models/staging/tmp/stg_iterable__user_unsubscribed_channel_tmp.sql", "unique_id": "model.iterable.stg_iterable__user_unsubscribed_channel_tmp", "fqn": ["iterable", "staging", "tmp", "stg_iterable__user_unsubscribed_channel_tmp"], "alias": "stg_iterable__user_unsubscribed_channel_tmp", "checksum": {"name": "sha256", "checksum": "a8d43331a84f0d1dae8511478d01cded7dfb389fef925f7173f50eb6b6b9c142"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"materialized": "view", "schema": "iterable_{{ var('directed_schema','dev') }}", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789422569.3479986, "relation_name": "\"postgres\".\"public_iterable_dev\".\"stg_iterable__user_unsubscribed_channel_tmp\"", "raw_code": "{{\n fivetran_utils.union_connections(\n connection_dictionary='iterable_sources',\n single_source_name='iterable',\n single_table_name='user_unsubscribed_channel' if does_table_exist('user_unsubscribed_channel') else 'user_unsubscribed_channel_history'\n )\n}}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["iterable", "user_unsubscribed_channel_history"], ["iterable", "user_unsubscribed_channel_history"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.iterable.does_table_exist", "macro.fivetran_utils.union_connections"], "nodes": ["source.iterable.iterable.user_unsubscribed_channel_history"]}, "compiled_path": "target/compiled/iterable/models/staging/tmp/stg_iterable__user_unsubscribed_channel_tmp.sql", "compiled": true, "compiled_code": "\n\n\n-- ** Values passed to adapter.get_relation:\n -- full-identifier_var: iterable_user_unsubscribed_channel_identifier\n -- database: postgres \n -- schema: public\n -- identifier: user_unsubscribed_channel_data\n\n\n select\n \"_fivetran_id\",\n \"channel_id\",\n \"_fivetran_synced\"\n from \"postgres\".\"public\".\"user_unsubscribed_channel_data\" as source_table\n\n ", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "test.iterable.not_null_iterable__campaigns_campaign_id.03c9448919": {"database": "postgres", "schema": "public_dbt_test__audit", "name": "not_null_iterable__campaigns_campaign_id", "resource_type": "test", "package_name": "iterable", "path": "not_null_iterable__campaigns_campaign_id.sql", "original_file_path": "models/iterable.yml", "unique_id": "test.iterable.not_null_iterable__campaigns_campaign_id.03c9448919", "fqn": ["iterable", "not_null_iterable__campaigns_campaign_id"], "alias": "not_null_iterable__campaigns_campaign_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "sql_header": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {}, "created_at": 1789422569.8661883, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "iterable__campaigns", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.iterable.iterable__campaigns"]}, "compiled_path": "target/compiled/iterable/models/iterable.yml/not_null_iterable__campaigns_campaign_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect campaign_id\nfrom \"postgres\".\"public_iterable_dev\".\"iterable__campaigns\"\nwhere campaign_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "campaign_id", "file_key_name": "models.iterable__campaigns", "attached_node": "model.iterable.iterable__campaigns", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "campaign_id", "model": "{{ get_where_subquery(ref('iterable__campaigns')) }}"}, "namespace": null}}, "test.iterable.not_null_iterable__events_event_id.ed1d28a650": {"database": "postgres", "schema": "public_dbt_test__audit", "name": "not_null_iterable__events_event_id", "resource_type": "test", "package_name": "iterable", "path": "not_null_iterable__events_event_id.sql", "original_file_path": "models/iterable.yml", "unique_id": "test.iterable.not_null_iterable__events_event_id.ed1d28a650", "fqn": ["iterable", "not_null_iterable__events_event_id"], "alias": "not_null_iterable__events_event_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "sql_header": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {}, "created_at": 1789422569.8697667, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "iterable__events", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.iterable.iterable__events"]}, "compiled_path": "target/compiled/iterable/models/iterable.yml/not_null_iterable__events_event_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect event_id\nfrom \"postgres\".\"public_iterable_dev\".\"iterable__events\"\nwhere event_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "event_id", "file_key_name": "models.iterable__events", "attached_node": "model.iterable.iterable__events", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "event_id", "model": "{{ get_where_subquery(ref('iterable__events')) }}"}, "namespace": null}}, "test.iterable.not_null_iterable__journeys_journey_id.b5c6b8783a": {"database": "postgres", "schema": "public_dbt_test__audit", "name": "not_null_iterable__journeys_journey_id", "resource_type": "test", "package_name": "iterable", "path": "not_null_iterable__journeys_journey_id.sql", "original_file_path": "models/iterable.yml", "unique_id": "test.iterable.not_null_iterable__journeys_journey_id.b5c6b8783a", "fqn": ["iterable", "not_null_iterable__journeys_journey_id"], "alias": "not_null_iterable__journeys_journey_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "sql_header": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {}, "created_at": 1789422569.8729744, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "iterable__journeys", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.iterable.iterable__journeys"]}, "compiled_path": "target/compiled/iterable/models/iterable.yml/not_null_iterable__journeys_journey_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect journey_id\nfrom \"postgres\".\"public_iterable_dev\".\"iterable__journeys\"\nwhere journey_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "journey_id", "file_key_name": "models.iterable__journeys", "attached_node": "model.iterable.iterable__journeys", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "journey_id", "model": "{{ get_where_subquery(ref('iterable__journeys')) }}"}, "namespace": null}}, "test.iterable.unique_iterable__journeys_unique_journey_id.ba86841246": {"database": "postgres", "schema": "public_dbt_test__audit", "name": "unique_iterable__journeys_unique_journey_id", "resource_type": "test", "package_name": "iterable", "path": "unique_iterable__journeys_unique_journey_id.sql", "original_file_path": "models/iterable.yml", "unique_id": "test.iterable.unique_iterable__journeys_unique_journey_id.ba86841246", "fqn": ["iterable", "unique_iterable__journeys_unique_journey_id"], "alias": "unique_iterable__journeys_unique_journey_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "sql_header": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {}, "created_at": 1789422569.8760312, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "iterable__journeys", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.iterable.iterable__journeys"]}, "compiled_path": "target/compiled/iterable/models/iterable.yml/unique_iterable__journeys_unique_journey_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n unique_journey_id as unique_field,\n count(*) as n_records\n\nfrom \"postgres\".\"public_iterable_dev\".\"iterable__journeys\"\nwhere unique_journey_id is not null\ngroup by unique_journey_id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "unique_journey_id", "file_key_name": "models.iterable__journeys", "attached_node": "model.iterable.iterable__journeys", "test_metadata": {"name": "unique", "kwargs": {"column_name": "unique_journey_id", "model": "{{ get_where_subquery(ref('iterable__journeys')) }}"}, "namespace": null}}, "test.iterable.not_null_iterable__user_unsubscriptions_unique_user_key.f8db72932b": {"database": "postgres", "schema": "public_dbt_test__audit", "name": "not_null_iterable__user_unsubscriptions_unique_user_key", "resource_type": "test", "package_name": "iterable", "path": "not_null_iterable__user_unsubscriptions_unique_user_key.sql", "original_file_path": "models/iterable.yml", "unique_id": "test.iterable.not_null_iterable__user_unsubscriptions_unique_user_key.f8db72932b", "fqn": ["iterable", "not_null_iterable__user_unsubscriptions_unique_user_key"], "alias": "not_null_iterable__user_unsubscriptions_unique_user_key", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "sql_header": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {}, "created_at": 1789422569.8791687, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "iterable__user_unsubscriptions", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.iterable.iterable__user_unsubscriptions"]}, "compiled_path": "target/compiled/iterable/models/iterable.yml/not_null_iterable__user_unsubscriptions_unique_user_key.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect unique_user_key\nfrom \"postgres\".\"public_iterable_dev\".\"iterable__user_unsubscriptions\"\nwhere unique_user_key is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "unique_user_key", "file_key_name": "models.iterable__user_unsubscriptions", "attached_node": "model.iterable.iterable__user_unsubscriptions", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "unique_user_key", "model": "{{ get_where_subquery(ref('iterable__user_unsubscriptions')) }}"}, "namespace": null}}, "test.iterable.not_null_iterable__users_unique_user_key.4ca37a26c8": {"database": "postgres", "schema": "public_dbt_test__audit", "name": "not_null_iterable__users_unique_user_key", "resource_type": "test", "package_name": "iterable", "path": "not_null_iterable__users_unique_user_key.sql", "original_file_path": "models/iterable.yml", "unique_id": "test.iterable.not_null_iterable__users_unique_user_key.4ca37a26c8", "fqn": ["iterable", "not_null_iterable__users_unique_user_key"], "alias": "not_null_iterable__users_unique_user_key", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "sql_header": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {}, "created_at": 1789422569.8846214, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "iterable__users", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.iterable.iterable__users"]}, "compiled_path": "target/compiled/iterable/models/iterable.yml/not_null_iterable__users_unique_user_key.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect unique_user_key\nfrom \"postgres\".\"public_iterable_dev\".\"iterable__users\"\nwhere unique_user_key is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "unique_user_key", "file_key_name": "models.iterable__users", "attached_node": "model.iterable.iterable__users", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "unique_user_key", "model": "{{ get_where_subquery(ref('iterable__users')) }}"}, "namespace": null}}, "test.iterable.not_null_stg_iterable__campaign_history_campaign_id.b7c36e4525": {"database": "postgres", "schema": "public_dbt_test__audit", "name": "not_null_stg_iterable__campaign_history_campaign_id", "resource_type": "test", "package_name": "iterable", "path": "not_null_stg_iterable__campaign_history_campaign_id.sql", "original_file_path": "models/staging/stg_iterable.yml", "unique_id": "test.iterable.not_null_stg_iterable__campaign_history_campaign_id.b7c36e4525", "fqn": ["iterable", "staging", "not_null_stg_iterable__campaign_history_campaign_id"], "alias": "not_null_stg_iterable__campaign_history_campaign_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "sql_header": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {}, "created_at": 1789422569.9190476, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__campaign_history", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.iterable.stg_iterable__campaign_history"]}, "compiled_path": "target/compiled/iterable/models/staging/stg_iterable.yml/not_null_stg_iterable__campaign_history_campaign_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect campaign_id\nfrom \"postgres\".\"public_iterable_dev\".\"stg_iterable__campaign_history\"\nwhere campaign_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "campaign_id", "file_key_name": "models.stg_iterable__campaign_history", "attached_node": "model.iterable.stg_iterable__campaign_history", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "campaign_id", "model": "{{ get_where_subquery(ref('stg_iterable__campaign_history')) }}"}, "namespace": null}}, "test.iterable.not_null_stg_iterable__campaign_label_history_campaign_id.1918cef89a": {"database": "postgres", "schema": "public_dbt_test__audit", "name": "not_null_stg_iterable__campaign_label_history_campaign_id", "resource_type": "test", "package_name": "iterable", "path": "not_null_stg_iterable__campaign_label_history_campaign_id.sql", "original_file_path": "models/staging/stg_iterable.yml", "unique_id": "test.iterable.not_null_stg_iterable__campaign_label_history_campaign_id.1918cef89a", "fqn": ["iterable", "staging", "not_null_stg_iterable__campaign_label_history_campaign_id"], "alias": "not_null_stg_iterable__campaign_label_history_campaign_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "sql_header": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {}, "created_at": 1789422569.9224381, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__campaign_label_history", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.iterable.stg_iterable__campaign_label_history"]}, "compiled_path": "target/compiled/iterable/models/staging/stg_iterable.yml/not_null_stg_iterable__campaign_label_history_campaign_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect campaign_id\nfrom \"postgres\".\"public_iterable_dev\".\"stg_iterable__campaign_label_history\"\nwhere campaign_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "campaign_id", "file_key_name": "models.stg_iterable__campaign_label_history", "attached_node": "model.iterable.stg_iterable__campaign_label_history", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "campaign_id", "model": "{{ get_where_subquery(ref('stg_iterable__campaign_label_history')) }}"}, "namespace": null}}, "test.iterable.not_null_stg_iterable__campaign_list_history_campaign_id.208f9bf9ed": {"database": "postgres", "schema": "public_dbt_test__audit", "name": "not_null_stg_iterable__campaign_list_history_campaign_id", "resource_type": "test", "package_name": "iterable", "path": "not_null_stg_iterable__campaign_list_history_campaign_id.sql", "original_file_path": "models/staging/stg_iterable.yml", "unique_id": "test.iterable.not_null_stg_iterable__campaign_list_history_campaign_id.208f9bf9ed", "fqn": ["iterable", "staging", "not_null_stg_iterable__campaign_list_history_campaign_id"], "alias": "not_null_stg_iterable__campaign_list_history_campaign_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "sql_header": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {}, "created_at": 1789422569.9257402, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__campaign_list_history", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.iterable.stg_iterable__campaign_list_history"]}, "compiled_path": "target/compiled/iterable/models/staging/stg_iterable.yml/not_null_stg_iterable__campaign_list_history_campaign_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect campaign_id\nfrom \"postgres\".\"public_iterable_dev\".\"stg_iterable__campaign_list_history\"\nwhere campaign_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "campaign_id", "file_key_name": "models.stg_iterable__campaign_list_history", "attached_node": "model.iterable.stg_iterable__campaign_list_history", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "campaign_id", "model": "{{ get_where_subquery(ref('stg_iterable__campaign_list_history')) }}"}, "namespace": null}}, "test.iterable.not_null_stg_iterable__campaign_suppression_list_history_campaign_id.3921289710": {"database": "postgres", "schema": "public_dbt_test__audit", "name": "not_null_stg_iterable__campaign_suppression_list_history_campaign_id", "resource_type": "test", "package_name": "iterable", "path": "not_null_stg_iterable__campaig_3ce753a10225cac67c8a1434b5541997.sql", "original_file_path": "models/staging/stg_iterable.yml", "unique_id": "test.iterable.not_null_stg_iterable__campaign_suppression_list_history_campaign_id.3921289710", "fqn": ["iterable", "staging", "not_null_stg_iterable__campaign_suppression_list_history_campaign_id"], "alias": "not_null_stg_iterable__campaig_3ce753a10225cac67c8a1434b5541997", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "not_null_stg_iterable__campaig_3ce753a10225cac67c8a1434b5541997", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "sql_header": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"alias": "not_null_stg_iterable__campaig_3ce753a10225cac67c8a1434b5541997"}, "created_at": 1789422569.928887, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"not_null_stg_iterable__campaig_3ce753a10225cac67c8a1434b5541997\") }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__campaign_suppression_list_history", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.iterable.stg_iterable__campaign_suppression_list_history"]}, "compiled_path": "target/compiled/iterable/models/staging/stg_iterable.yml/not_null_stg_iterable__campaig_3ce753a10225cac67c8a1434b5541997.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect campaign_id\nfrom \"postgres\".\"public_iterable_dev\".\"stg_iterable__campaign_suppression_list_history\"\nwhere campaign_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "campaign_id", "file_key_name": "models.stg_iterable__campaign_suppression_list_history", "attached_node": "model.iterable.stg_iterable__campaign_suppression_list_history", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "campaign_id", "model": "{{ get_where_subquery(ref('stg_iterable__campaign_suppression_list_history')) }}"}, "namespace": null}}, "test.iterable.not_null_stg_iterable__channel_channel_id.182ceb9636": {"database": "postgres", "schema": "public_dbt_test__audit", "name": "not_null_stg_iterable__channel_channel_id", "resource_type": "test", "package_name": "iterable", "path": "not_null_stg_iterable__channel_channel_id.sql", "original_file_path": "models/staging/stg_iterable.yml", "unique_id": "test.iterable.not_null_stg_iterable__channel_channel_id.182ceb9636", "fqn": ["iterable", "staging", "not_null_stg_iterable__channel_channel_id"], "alias": "not_null_stg_iterable__channel_channel_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "sql_header": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {}, "created_at": 1789422569.9319706, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__channel", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.iterable.stg_iterable__channel"]}, "compiled_path": "target/compiled/iterable/models/staging/stg_iterable.yml/not_null_stg_iterable__channel_channel_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect channel_id\nfrom \"postgres\".\"public_iterable_dev\".\"stg_iterable__channel\"\nwhere channel_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "channel_id", "file_key_name": "models.stg_iterable__channel", "attached_node": "model.iterable.stg_iterable__channel", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "channel_id", "model": "{{ get_where_subquery(ref('stg_iterable__channel')) }}"}, "namespace": null}}, "test.iterable.not_null_stg_iterable__event_event_id.370cd4bc9d": {"database": "postgres", "schema": "public_dbt_test__audit", "name": "not_null_stg_iterable__event_event_id", "resource_type": "test", "package_name": "iterable", "path": "not_null_stg_iterable__event_event_id.sql", "original_file_path": "models/staging/stg_iterable.yml", "unique_id": "test.iterable.not_null_stg_iterable__event_event_id.370cd4bc9d", "fqn": ["iterable", "staging", "not_null_stg_iterable__event_event_id"], "alias": "not_null_stg_iterable__event_event_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "sql_header": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {}, "created_at": 1789422569.9350955, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__event", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.iterable.stg_iterable__event"]}, "compiled_path": "target/compiled/iterable/models/staging/stg_iterable.yml/not_null_stg_iterable__event_event_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect event_id\nfrom \"postgres\".\"public_iterable_dev\".\"stg_iterable__event\"\nwhere event_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "event_id", "file_key_name": "models.stg_iterable__event", "attached_node": "model.iterable.stg_iterable__event", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "event_id", "model": "{{ get_where_subquery(ref('stg_iterable__event')) }}"}, "namespace": null}}, "test.iterable.not_null_stg_iterable__event_unique_event_id.e2b46d3bb6": {"database": "postgres", "schema": "public_dbt_test__audit", "name": "not_null_stg_iterable__event_unique_event_id", "resource_type": "test", "package_name": "iterable", "path": "not_null_stg_iterable__event_unique_event_id.sql", "original_file_path": "models/staging/stg_iterable.yml", "unique_id": "test.iterable.not_null_stg_iterable__event_unique_event_id.e2b46d3bb6", "fqn": ["iterable", "staging", "not_null_stg_iterable__event_unique_event_id"], "alias": "not_null_stg_iterable__event_unique_event_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "sql_header": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {}, "created_at": 1789422569.9382055, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__event", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.iterable.stg_iterable__event"]}, "compiled_path": "target/compiled/iterable/models/staging/stg_iterable.yml/not_null_stg_iterable__event_unique_event_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect unique_event_id\nfrom \"postgres\".\"public_iterable_dev\".\"stg_iterable__event\"\nwhere unique_event_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "unique_event_id", "file_key_name": "models.stg_iterable__event", "attached_node": "model.iterable.stg_iterable__event", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "unique_event_id", "model": "{{ get_where_subquery(ref('stg_iterable__event')) }}"}, "namespace": null}}, "test.iterable.not_null_stg_iterable__event_extension_event_id.144dedcd30": {"database": "postgres", "schema": "public_dbt_test__audit", "name": "not_null_stg_iterable__event_extension_event_id", "resource_type": "test", "package_name": "iterable", "path": "not_null_stg_iterable__event_extension_event_id.sql", "original_file_path": "models/staging/stg_iterable.yml", "unique_id": "test.iterable.not_null_stg_iterable__event_extension_event_id.144dedcd30", "fqn": ["iterable", "staging", "not_null_stg_iterable__event_extension_event_id"], "alias": "not_null_stg_iterable__event_extension_event_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "sql_header": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {}, "created_at": 1789422569.941636, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__event_extension", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.iterable.stg_iterable__event_extension"]}, "compiled_path": "target/compiled/iterable/models/staging/stg_iterable.yml/not_null_stg_iterable__event_extension_event_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect event_id\nfrom \"postgres\".\"public_iterable_dev\".\"stg_iterable__event_extension\"\nwhere event_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "event_id", "file_key_name": "models.stg_iterable__event_extension", "attached_node": "model.iterable.stg_iterable__event_extension", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "event_id", "model": "{{ get_where_subquery(ref('stg_iterable__event_extension')) }}"}, "namespace": null}}, "test.iterable.not_null_stg_iterable__journey_journey_id.cc38bd633c": {"database": "postgres", "schema": "public_dbt_test__audit", "name": "not_null_stg_iterable__journey_journey_id", "resource_type": "test", "package_name": "iterable", "path": "not_null_stg_iterable__journey_journey_id.sql", "original_file_path": "models/staging/stg_iterable.yml", "unique_id": "test.iterable.not_null_stg_iterable__journey_journey_id.cc38bd633c", "fqn": ["iterable", "staging", "not_null_stg_iterable__journey_journey_id"], "alias": "not_null_stg_iterable__journey_journey_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "sql_header": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {}, "created_at": 1789422569.9448404, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__journey", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.iterable.stg_iterable__journey"]}, "compiled_path": "target/compiled/iterable/models/staging/stg_iterable.yml/not_null_stg_iterable__journey_journey_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect journey_id\nfrom \"postgres\".\"public_iterable_dev\".\"stg_iterable__journey\"\nwhere journey_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "journey_id", "file_key_name": "models.stg_iterable__journey", "attached_node": "model.iterable.stg_iterable__journey", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "journey_id", "model": "{{ get_where_subquery(ref('stg_iterable__journey')) }}"}, "namespace": null}}, "test.iterable.not_null_stg_iterable__list_list_id.47029d839a": {"database": "postgres", "schema": "public_dbt_test__audit", "name": "not_null_stg_iterable__list_list_id", "resource_type": "test", "package_name": "iterable", "path": "not_null_stg_iterable__list_list_id.sql", "original_file_path": "models/staging/stg_iterable.yml", "unique_id": "test.iterable.not_null_stg_iterable__list_list_id.47029d839a", "fqn": ["iterable", "staging", "not_null_stg_iterable__list_list_id"], "alias": "not_null_stg_iterable__list_list_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "sql_header": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {}, "created_at": 1789422569.947927, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__list", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.iterable.stg_iterable__list"]}, "compiled_path": "target/compiled/iterable/models/staging/stg_iterable.yml/not_null_stg_iterable__list_list_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect list_id\nfrom \"postgres\".\"public_iterable_dev\".\"stg_iterable__list\"\nwhere list_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "list_id", "file_key_name": "models.stg_iterable__list", "attached_node": "model.iterable.stg_iterable__list", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "list_id", "model": "{{ get_where_subquery(ref('stg_iterable__list')) }}"}, "namespace": null}}, "test.iterable.not_null_stg_iterable__message_type_message_type_id.75eaa6fa62": {"database": "postgres", "schema": "public_dbt_test__audit", "name": "not_null_stg_iterable__message_type_message_type_id", "resource_type": "test", "package_name": "iterable", "path": "not_null_stg_iterable__message_type_message_type_id.sql", "original_file_path": "models/staging/stg_iterable.yml", "unique_id": "test.iterable.not_null_stg_iterable__message_type_message_type_id.75eaa6fa62", "fqn": ["iterable", "staging", "not_null_stg_iterable__message_type_message_type_id"], "alias": "not_null_stg_iterable__message_type_message_type_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "sql_header": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {}, "created_at": 1789422569.9509652, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__message_type", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.iterable.stg_iterable__message_type"]}, "compiled_path": "target/compiled/iterable/models/staging/stg_iterable.yml/not_null_stg_iterable__message_type_message_type_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect message_type_id\nfrom \"postgres\".\"public_iterable_dev\".\"stg_iterable__message_type\"\nwhere message_type_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "message_type_id", "file_key_name": "models.stg_iterable__message_type", "attached_node": "model.iterable.stg_iterable__message_type", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "message_type_id", "model": "{{ get_where_subquery(ref('stg_iterable__message_type')) }}"}, "namespace": null}}, "test.iterable.not_null_stg_iterable__template_history_template_id.14b24a1dfe": {"database": "postgres", "schema": "public_dbt_test__audit", "name": "not_null_stg_iterable__template_history_template_id", "resource_type": "test", "package_name": "iterable", "path": "not_null_stg_iterable__template_history_template_id.sql", "original_file_path": "models/staging/stg_iterable.yml", "unique_id": "test.iterable.not_null_stg_iterable__template_history_template_id.14b24a1dfe", "fqn": ["iterable", "staging", "not_null_stg_iterable__template_history_template_id"], "alias": "not_null_stg_iterable__template_history_template_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "sql_header": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {}, "created_at": 1789422569.954257, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__template_history", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.iterable.stg_iterable__template_history"]}, "compiled_path": "target/compiled/iterable/models/staging/stg_iterable.yml/not_null_stg_iterable__template_history_template_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect template_id\nfrom \"postgres\".\"public_iterable_dev\".\"stg_iterable__template_history\"\nwhere template_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "template_id", "file_key_name": "models.stg_iterable__template_history", "attached_node": "model.iterable.stg_iterable__template_history", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "template_id", "model": "{{ get_where_subquery(ref('stg_iterable__template_history')) }}"}, "namespace": null}}, "test.iterable.not_null_stg_iterable__list_user__fivetran_user_id.cca4b34c07": {"database": "postgres", "schema": "public_dbt_test__audit", "name": "not_null_stg_iterable__list_user__fivetran_user_id", "resource_type": "test", "package_name": "iterable", "path": "not_null_stg_iterable__list_user__fivetran_user_id.sql", "original_file_path": "models/staging/stg_iterable.yml", "unique_id": "test.iterable.not_null_stg_iterable__list_user__fivetran_user_id.cca4b34c07", "fqn": ["iterable", "staging", "not_null_stg_iterable__list_user__fivetran_user_id"], "alias": "not_null_stg_iterable__list_user__fivetran_user_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "sql_header": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {}, "created_at": 1789422569.9573488, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__list_user", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.iterable.stg_iterable__list_user"]}, "compiled_path": "target/compiled/iterable/models/staging/stg_iterable.yml/not_null_stg_iterable__list_user__fivetran_user_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect _fivetran_user_id\nfrom \"postgres\".\"public_iterable_dev\".\"stg_iterable__list_user\"\nwhere _fivetran_user_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "_fivetran_user_id", "file_key_name": "models.stg_iterable__list_user", "attached_node": "model.iterable.stg_iterable__list_user", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "_fivetran_user_id", "model": "{{ get_where_subquery(ref('stg_iterable__list_user')) }}"}, "namespace": null}}, "test.iterable.not_null_stg_iterable__user_history_unique_user_key.2845af2127": {"database": "postgres", "schema": "public_dbt_test__audit", "name": "not_null_stg_iterable__user_history_unique_user_key", "resource_type": "test", "package_name": "iterable", "path": "not_null_stg_iterable__user_history_unique_user_key.sql", "original_file_path": "models/staging/stg_iterable.yml", "unique_id": "test.iterable.not_null_stg_iterable__user_history_unique_user_key.2845af2127", "fqn": ["iterable", "staging", "not_null_stg_iterable__user_history_unique_user_key"], "alias": "not_null_stg_iterable__user_history_unique_user_key", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "sql_header": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {}, "created_at": 1789422569.9604406, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__user_history", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.iterable.stg_iterable__user_history"]}, "compiled_path": "target/compiled/iterable/models/staging/stg_iterable.yml/not_null_stg_iterable__user_history_unique_user_key.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect unique_user_key\nfrom \"postgres\".\"public_iterable_dev\".\"stg_iterable__user_history\"\nwhere unique_user_key is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "unique_user_key", "file_key_name": "models.stg_iterable__user_history", "attached_node": "model.iterable.stg_iterable__user_history", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "unique_user_key", "model": "{{ get_where_subquery(ref('stg_iterable__user_history')) }}"}, "namespace": null}}, "test.iterable.not_null_stg_iterable__user_unsubscribed_channel_channel_id.da0ed9e9be": {"database": "postgres", "schema": "public_dbt_test__audit", "name": "not_null_stg_iterable__user_unsubscribed_channel_channel_id", "resource_type": "test", "package_name": "iterable", "path": "not_null_stg_iterable__user_unsubscribed_channel_channel_id.sql", "original_file_path": "models/staging/stg_iterable.yml", "unique_id": "test.iterable.not_null_stg_iterable__user_unsubscribed_channel_channel_id.da0ed9e9be", "fqn": ["iterable", "staging", "not_null_stg_iterable__user_unsubscribed_channel_channel_id"], "alias": "not_null_stg_iterable__user_unsubscribed_channel_channel_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "sql_header": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {}, "created_at": 1789422569.9635522, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__user_unsubscribed_channel", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.iterable.stg_iterable__user_unsubscribed_channel"]}, "compiled_path": "target/compiled/iterable/models/staging/stg_iterable.yml/not_null_stg_iterable__user_unsubscribed_channel_channel_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect channel_id\nfrom \"postgres\".\"public_iterable_dev\".\"stg_iterable__user_unsubscribed_channel\"\nwhere channel_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "channel_id", "file_key_name": "models.stg_iterable__user_unsubscribed_channel", "attached_node": "model.iterable.stg_iterable__user_unsubscribed_channel", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "channel_id", "model": "{{ get_where_subquery(ref('stg_iterable__user_unsubscribed_channel')) }}"}, "namespace": null}}, "test.iterable.not_null_stg_iterable__user_unsub_message_type_message_type_id.268a89ea6f": {"database": "postgres", "schema": "public_dbt_test__audit", "name": "not_null_stg_iterable__user_unsub_message_type_message_type_id", "resource_type": "test", "package_name": "iterable", "path": "not_null_stg_iterable__user_unsub_message_type_message_type_id.sql", "original_file_path": "models/staging/stg_iterable.yml", "unique_id": "test.iterable.not_null_stg_iterable__user_unsub_message_type_message_type_id.268a89ea6f", "fqn": ["iterable", "staging", "not_null_stg_iterable__user_unsub_message_type_message_type_id"], "alias": "not_null_stg_iterable__user_unsub_message_type_message_type_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "sql_header": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {}, "created_at": 1789422569.9665875, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__user_unsub_message_type", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.iterable.stg_iterable__user_unsub_message_type"]}, "compiled_path": "target/compiled/iterable/models/staging/stg_iterable.yml/not_null_stg_iterable__user_unsub_message_type_message_type_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect message_type_id\nfrom \"postgres\".\"public_iterable_dev\".\"stg_iterable__user_unsub_message_type\"\nwhere message_type_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "message_type_id", "file_key_name": "models.stg_iterable__user_unsub_message_type", "attached_node": "model.iterable.stg_iterable__user_unsub_message_type", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "message_type_id", "model": "{{ get_where_subquery(ref('stg_iterable__user_unsub_message_type')) }}"}, "namespace": null}}}, "sources": {"source.iterable.iterable.campaign_history": {"database": "postgres", "schema": "public", "name": "campaign_history", "resource_type": "source", "package_name": "iterable", "path": "models/staging/src_iterable.yml", "original_file_path": "models/staging/src_iterable.yml", "unique_id": "source.iterable.iterable.campaign_history", "fqn": ["iterable", "staging", "iterable", "campaign_history"], "source_name": "iterable", "source_description": "", "loader": "fivetran", "identifier": "campaign_history_data", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Table containing a history of campaigns.", "columns": {"id": {"name": "id", "description": "Unique identifier of the campaign record", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "updated_at": {"name": "updated_at", "description": "Last update's timestamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "name": {"name": "name", "description": "User defined name of the campaign.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "campaign_state": {"name": "campaign_state", "description": "State of the campaign. Can be Draft, Ready, Scheduled, Running, Finished, Starting, Aborted or Recurring", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "type": {"name": "type", "description": "The campaign type. Can be Blast or Triggered", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "send_size": {"name": "send_size", "description": "Size of the campaign. Number of individuals included in the campaign", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "start_at": {"name": "start_at", "description": "Start timestamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "ended_at": {"name": "ended_at", "description": "Ended timestamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "created_at": {"name": "created_at", "description": "Creation timestamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "recurring_campaign_id": {"name": "recurring_campaign_id", "description": "Reference to the recurring campaign, if applicable", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "created_by_user_id": {"name": "created_by_user_id", "description": "Reference to the user who created the campaign", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "template_id": {"name": "template_id", "description": "Reference to the campaign template", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "updated_by_user_id": {"name": "updated_by_user_id", "description": "ID of the user who updated this record", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "message_medium": {"name": "message_medium", "description": "The medium that this message was sent via, for example Email or InApp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": "_fivetran_synced", "loaded_at_query": null, "meta": {}, "tags": [], "static_analysis": null}, "patch_path": null, "unrendered_config": {"loaded_at_field": "_fivetran_synced", "enabled": true, "loaded_at_query": null, "meta": {}, "tags": []}, "relation_name": "\"postgres\".\"public\".\"campaign_history_data\"", "created_at": 1789422570.1692965, "unrendered_database": "{% if target.type != 'spark' %}{{ var('iterable_database', target.database)}}{% endif %}", "unrendered_schema": "{{var ('iterable_schema', 'iterable')}}", "doc_blocks": []}, "source.iterable.iterable.campaign_label_history": {"database": "postgres", "schema": "public", "name": "campaign_label_history", "resource_type": "source", "package_name": "iterable", "path": "models/staging/src_iterable.yml", "original_file_path": "models/staging/src_iterable.yml", "unique_id": "source.iterable.iterable.campaign_label_history", "fqn": ["iterable", "staging", "iterable", "campaign_label_history"], "source_name": "iterable", "source_description": "", "loader": "fivetran", "identifier": "campaign_label_history_data", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Table containing a history of labels.", "columns": {"campaign_id": {"name": "campaign_id", "description": "Reference to the campaign associated with the label", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "label": {"name": "label", "description": "Name of the label", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "updated_at": {"name": "updated_at", "description": "Last update timestamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": "_fivetran_synced", "loaded_at_query": null, "meta": {}, "tags": [], "static_analysis": null}, "patch_path": null, "unrendered_config": {"loaded_at_field": "_fivetran_synced", "enabled": true, "loaded_at_query": null, "meta": {}, "tags": []}, "relation_name": "\"postgres\".\"public\".\"campaign_label_history_data\"", "created_at": 1789422570.1717672, "unrendered_database": "{% if target.type != 'spark' %}{{ var('iterable_database', target.database)}}{% endif %}", "unrendered_schema": "{{var ('iterable_schema', 'iterable')}}", "doc_blocks": []}, "source.iterable.iterable.campaign_list_history": {"database": "postgres", "schema": "public", "name": "campaign_list_history", "resource_type": "source", "package_name": "iterable", "path": "models/staging/src_iterable.yml", "original_file_path": "models/staging/src_iterable.yml", "unique_id": "source.iterable.iterable.campaign_list_history", "fqn": ["iterable", "staging", "iterable", "campaign_list_history"], "source_name": "iterable", "source_description": "", "loader": "fivetran", "identifier": "campaign_list_history_data", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Table containing a history of lists.", "columns": {"campaign_id": {"name": "campaign_id", "description": "Reference to the campaign associated with the label", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "list_id": {"name": "list_id", "description": "Reference to the list used", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "updated_at": {"name": "updated_at", "description": "Last update timestamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": "_fivetran_synced", "loaded_at_query": null, "meta": {}, "tags": [], "static_analysis": null}, "patch_path": null, "unrendered_config": {"loaded_at_field": "_fivetran_synced", "enabled": true, "loaded_at_query": null, "meta": {}, "tags": []}, "relation_name": "\"postgres\".\"public\".\"campaign_list_history_data\"", "created_at": 1789422570.1724825, "unrendered_database": "{% if target.type != 'spark' %}{{ var('iterable_database', target.database)}}{% endif %}", "unrendered_schema": "{{var ('iterable_schema', 'iterable')}}", "doc_blocks": []}, "source.iterable.iterable.campaign_suppression_list_history": {"database": "postgres", "schema": "public", "name": "campaign_suppression_list_history", "resource_type": "source", "package_name": "iterable", "path": "models/staging/src_iterable.yml", "original_file_path": "models/staging/src_iterable.yml", "unique_id": "source.iterable.iterable.campaign_suppression_list_history", "fqn": ["iterable", "staging", "iterable", "campaign_suppression_list_history"], "source_name": "iterable", "source_description": "", "loader": "fivetran", "identifier": "campaign_suppression_list_history_data", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Table containing a history of suppression lists.\n", "columns": {"campaign_id": {"name": "campaign_id", "description": "Reference to the campaign associated with the label", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "suppressed_list_id": {"name": "suppressed_list_id", "description": "Reference to the list used", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "updated_at": {"name": "updated_at", "description": "Last update timestamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": "_fivetran_synced", "loaded_at_query": null, "meta": {}, "tags": [], "static_analysis": null}, "patch_path": null, "unrendered_config": {"loaded_at_field": "_fivetran_synced", "enabled": true, "loaded_at_query": null, "meta": {}, "tags": []}, "relation_name": "\"postgres\".\"public\".\"campaign_suppression_list_history_data\"", "created_at": 1789422570.17318, "unrendered_database": "{% if target.type != 'spark' %}{{ var('iterable_database', target.database)}}{% endif %}", "unrendered_schema": "{{var ('iterable_schema', 'iterable')}}", "doc_blocks": []}, "source.iterable.iterable.channel": {"database": "postgres", "schema": "public", "name": "channel", "resource_type": "source", "package_name": "iterable", "path": "models/staging/src_iterable.yml", "original_file_path": "models/staging/src_iterable.yml", "unique_id": "source.iterable.iterable.channel", "fqn": ["iterable", "staging", "iterable", "channel"], "source_name": "iterable", "source_description": "", "loader": "fivetran", "identifier": "channel_data", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Table containing unique channels.", "columns": {"id": {"name": "id", "description": "Unique identifier of the channel", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "name": {"name": "name", "description": "User defined name of the channel", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "channel_type": {"name": "channel_type", "description": "The channel type", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "message_medium": {"name": "message_medium", "description": "The message medium associated with the channel", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": "_fivetran_synced", "loaded_at_query": null, "meta": {}, "tags": [], "static_analysis": null}, "patch_path": null, "unrendered_config": {"loaded_at_field": "_fivetran_synced", "enabled": true, "loaded_at_query": null, "meta": {}, "tags": []}, "relation_name": "\"postgres\".\"public\".\"channel_data\"", "created_at": 1789422570.1741278, "unrendered_database": "{% if target.type != 'spark' %}{{ var('iterable_database', target.database)}}{% endif %}", "unrendered_schema": "{{var ('iterable_schema', 'iterable')}}", "doc_blocks": []}, "source.iterable.iterable.event": {"database": "postgres", "schema": "public", "name": "event", "resource_type": "source", "package_name": "iterable", "path": "models/staging/src_iterable.yml", "original_file_path": "models/staging/src_iterable.yml", "unique_id": "source.iterable.iterable.event", "fqn": ["iterable", "staging", "iterable", "event"], "source_name": "iterable", "source_description": "", "loader": "fivetran", "identifier": "event_data", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Table containing individual events within campaigns.", "columns": {"_fivetran_id": {"name": "_fivetran_id", "description": "A Fivetran-created unique identifier derived from hashing campaign_id, created_at, and event_name.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "campaign_id": {"name": "campaign_id", "description": "Reference to the campaign from which the event originated", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "content_id": {"name": "content_id", "description": "Reference to the content the event is associated with.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "created_at": {"name": "created_at", "description": "Creation timestamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "email": {"name": "email", "description": "The user's email. User identifier, for email-based projects. Previously was the unique identifier for user records, for Iterable customers before August 2023. Exists if using the history version of the table.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "additional_properties": {"name": "additional_properties", "description": "json object containing addition event properties", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "event_name": {"name": "event_name", "description": "Name provided to the individual event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "message_bus_id": {"name": "message_bus_id", "description": "Reference to the message bus associated with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "message_id": {"name": "message_id", "description": "Reference to the message the event is associated with", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "message_type_id": {"name": "message_type_id", "description": "Reference to the type of message the event is associated with", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "recipient_state": {"name": "recipient_state", "description": "The state of the recipient upon receiving the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "status": {"name": "status", "description": "Status of the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "transactional_data": {"name": "transactional_data", "description": "Transactional data associated with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unsub_source": {"name": "unsub_source", "description": "Source of the unsubscribe event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "user_agent": {"name": "user_agent", "description": "User agent associated with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "user_agent_device": {"name": "user_agent_device", "description": "The device of the user agent", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "_fivetran_user_id": {"name": "_fivetran_user_id", "description": "A Fivetran-created unique identifier for users, derived from hashing user_id and/or email, depending on project type.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": "_fivetran_synced", "loaded_at_query": null, "meta": {}, "tags": [], "static_analysis": null}, "patch_path": null, "unrendered_config": {"loaded_at_field": "_fivetran_synced", "enabled": true, "loaded_at_query": null, "meta": {}, "tags": []}, "relation_name": "\"postgres\".\"public\".\"event_data\"", "created_at": 1789422570.174916, "unrendered_database": "{% if target.type != 'spark' %}{{ var('iterable_database', target.database)}}{% endif %}", "unrendered_schema": "{{var ('iterable_schema', 'iterable')}}", "doc_blocks": []}, "source.iterable.iterable.event_extension": {"database": "postgres", "schema": "public", "name": "event_extension", "resource_type": "source", "package_name": "iterable", "path": "models/staging/src_iterable.yml", "original_file_path": "models/staging/src_iterable.yml", "unique_id": "source.iterable.iterable.event_extension", "fqn": ["iterable", "staging", "iterable", "event_extension"], "source_name": "iterable", "source_description": "", "loader": "fivetran", "identifier": "event_extension_data", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Table containing additional properties from the event table.", "columns": {"_fivetran_id": {"name": "_fivetran_id", "description": "A Fivetran-created unique identifier derived from hashing campaign_id, created_at, and event_name.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "app_already_running": {"name": "app_already_running", "description": "Boolean indicating if the app is currently running or not", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "badge": {"name": "badge", "description": "Badge associated with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "canonical_url_id": {"name": "canonical_url_id", "description": "Reference to the url associated with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "content_available": {"name": "content_available", "description": "Content available from the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "content_id": {"name": "content_id", "description": "Reference to the content associated with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "deeplink_android": {"name": "deeplink_android", "description": "Deeplink associated with the event from an android device", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "deeplink_ios": {"name": "deeplink_ios", "description": "Deeplink associated with the event from an ios device", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "device": {"name": "device", "description": "The device associated with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "email_id": {"name": "email_id", "description": "Reference to the email associated with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "email_subject": {"name": "email_subject", "description": "Subject of the email associated with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "experiment_id": {"name": "experiment_id", "description": "Reference to the experiment used if the event is an experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "from_phone_number_id": {"name": "from_phone_number_id", "description": "Reference to the phone number which the event is from", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "from_smssender_id": {"name": "from_smssender_id", "description": "Reference to the sms sender which the event is from", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "image_url": {"name": "image_url", "description": "Image url of the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "is_ghost_push": {"name": "is_ghost_push", "description": "Boolean indicating if the event is a result of a ghost push", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "link_id": {"name": "link_id", "description": "Reference to the link associated with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "link_url": {"name": "link_url", "description": "Url of the link associated with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "locale": {"name": "locale", "description": "Locale associated with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "payload": {"name": "payload", "description": "Payload resulted from the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "platform_endpoint": {"name": "platform_endpoint", "description": "The specific platform endpoint of the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "push_message": {"name": "push_message", "description": "Boolean indicating if the event is a push message", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "region": {"name": "region", "description": "Region of the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "sms_message": {"name": "sms_message", "description": "Boolean indicating if the event is an sms message", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "sms_provider_response_code": {"name": "sms_provider_response_code", "description": "sms provider response code from the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "sms_provider_response_message": {"name": "sms_provider_response_message", "description": "sms provider response message from the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "sms_provider_response_more_info": {"name": "sms_provider_response_more_info", "description": "sms provider response addition info from the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "sms_provider_response_status": {"name": "sms_provider_response_status", "description": "Status of the sms provider response from the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "sound": {"name": "sound", "description": "Boolean indicating if a sound was used with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "to_phone_number": {"name": "to_phone_number", "description": "To phone number associated with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "url": {"name": "url", "description": "Url associated with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "workflow_id": {"name": "workflow_id", "description": "Reference to the workflow which the event originated", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "workflow_name": {"name": "workflow_name", "description": "Name of the workflow which the event originated", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "catalog_collection_count": {"name": "catalog_collection_count", "description": "The count of products or items collected in a catalog associated with the event.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "catalog_lookup_count": {"name": "catalog_lookup_count", "description": "The count of times a catalog was looked up or queried during the event.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "city": {"name": "city", "description": "The city associated with the event, which could be the location of the recipient.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "clicked_url": {"name": "clicked_url", "description": "The URL that was clicked by the recipient in response to the marketing message.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "country": {"name": "country", "description": "The country associated with the event, which could be the location of the recipient.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "error_code": {"name": "error_code", "description": "The error code or message indicating any issues or errors encountered during the event.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "expires_at": {"name": "expires_at", "description": "The date and time when the event or message is set to expire or become invalid.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "from_phone_number": {"name": "from_phone_number", "description": "The phone number from which the SMS message was sent.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "in_app_body": {"name": "in_app_body", "description": "The content or body of an in-app message that was sent as part of the event.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "is_sms_estimation": {"name": "is_sms_estimation", "description": "A boolean indicating whether the SMS message is an estimation or not.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "labels": {"name": "labels", "description": "Any labels or tags associated with the event, which can be used for categorization or organization.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "message_context": {"name": "message_context", "description": "Additional contextual information related to the marketing message or event.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "message_status": {"name": "message_status", "description": "The status of the marketing message, such as sent, delivered, opened, etc.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "mms_send_count": {"name": "mms_send_count", "description": "The count of multimedia messages (MMS) sent as part of the event.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "product_recommendation_count": {"name": "product_recommendation_count", "description": "The count of product recommendations included in the message.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "proxy_source": {"name": "proxy_source", "description": "Information about the source or proxy used for sending the message.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "reason": {"name": "reason", "description": "The reason or cause associated with a specific event or action.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "sms_send_count": {"name": "sms_send_count", "description": "The count of SMS messages sent as part of the event.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "web_push_body": {"name": "web_push_body", "description": "The content or body of a web push notification sent as part of the event.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "web_push_click_action": {"name": "web_push_click_action", "description": "The action triggered when a recipient clicks a web push notification.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "web_push_icon": {"name": "web_push_icon", "description": "The icon or image associated with the web push notification.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "web_push_message": {"name": "web_push_message", "description": "The message or notification sent to web users as part of the event.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": "_fivetran_synced", "loaded_at_query": null, "meta": {}, "tags": [], "static_analysis": null}, "patch_path": null, "unrendered_config": {"loaded_at_field": "_fivetran_synced", "enabled": true, "loaded_at_query": null, "meta": {}, "tags": []}, "relation_name": "\"postgres\".\"public\".\"event_extension_data\"", "created_at": 1789422570.175931, "unrendered_database": "{% if target.type != 'spark' %}{{ var('iterable_database', target.database)}}{% endif %}", "unrendered_schema": "{{var ('iterable_schema', 'iterable')}}", "doc_blocks": []}, "source.iterable.iterable.journey": {"database": "postgres", "schema": "public", "name": "journey", "resource_type": "source", "package_name": "iterable", "path": "models/staging/src_iterable.yml", "original_file_path": "models/staging/src_iterable.yml", "unique_id": "source.iterable.iterable.journey", "fqn": ["iterable", "staging", "iterable", "journey"], "source_name": "iterable", "source_description": "", "loader": "fivetran", "identifier": "journey_data", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Table containing unique journeys, formerly known as workflows.", "columns": {"id": {"name": "id", "description": "Unique identifier of the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "name": {"name": "name", "description": "User defined name of the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "journey_type": {"name": "journey_type", "description": "Whether the journey is published or a draft.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "description": {"name": "description", "description": "Information about the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "creator_user_id": {"name": "creator_user_id", "description": "Reference to the user who created the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "enabled": {"name": "enabled", "description": "Boolean indicating if the journey is currently enabled", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "is_archived": {"name": "is_archived", "description": "Boolean indicating if the journey has been archived", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "lifetime_limit": {"name": "lifetime_limit", "description": "Maximum number of times a user may enter the journey over their lifetime", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "simultaneous_limit": {"name": "simultaneous_limit", "description": "Maximum number of times a user may be in the journey at the same time", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "start_tile_id": {"name": "start_tile_id", "description": "Reference to the tile which begins the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "trigger_event_names": {"name": "trigger_event_names", "description": "The event names which trigger a user's entry into the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "created_at": {"name": "created_at", "description": "Creation timestamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "updated_at": {"name": "updated_at", "description": "Last update timestamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": "_fivetran_synced", "loaded_at_query": null, "meta": {}, "tags": [], "static_analysis": null}, "patch_path": null, "unrendered_config": {"loaded_at_field": "_fivetran_synced", "enabled": true, "loaded_at_query": null, "meta": {}, "tags": []}, "relation_name": "\"postgres\".\"public\".\"journey_data\"", "created_at": 1789422570.176689, "unrendered_database": "{% if target.type != 'spark' %}{{ var('iterable_database', target.database)}}{% endif %}", "unrendered_schema": "{{var ('iterable_schema', 'iterable')}}", "doc_blocks": []}, "source.iterable.iterable.list": {"database": "postgres", "schema": "public", "name": "list", "resource_type": "source", "package_name": "iterable", "path": "models/staging/src_iterable.yml", "original_file_path": "models/staging/src_iterable.yml", "unique_id": "source.iterable.iterable.list", "fqn": ["iterable", "staging", "iterable", "list"], "source_name": "iterable", "source_description": "", "loader": "fivetran", "identifier": "list_data", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Table containing users and the lists the users are associated with.", "columns": {"id": {"name": "id", "description": "Unique identifier of the list", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "name": {"name": "name", "description": "User defined name of the list", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "list_type": {"name": "list_type", "description": "The list type", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "created_at": {"name": "created_at", "description": "Creation timestamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "description": {"name": "description", "description": "Information about the list", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": "_fivetran_synced", "loaded_at_query": null, "meta": {}, "tags": [], "static_analysis": null}, "patch_path": null, "unrendered_config": {"loaded_at_field": "_fivetran_synced", "enabled": true, "loaded_at_query": null, "meta": {}, "tags": []}, "relation_name": "\"postgres\".\"public\".\"list_data\"", "created_at": 1789422570.1773958, "unrendered_database": "{% if target.type != 'spark' %}{{ var('iterable_database', target.database)}}{% endif %}", "unrendered_schema": "{{var ('iterable_schema', 'iterable')}}", "doc_blocks": []}, "source.iterable.iterable.message_type": {"database": "postgres", "schema": "public", "name": "message_type", "resource_type": "source", "package_name": "iterable", "path": "models/staging/src_iterable.yml", "original_file_path": "models/staging/src_iterable.yml", "unique_id": "source.iterable.iterable.message_type", "fqn": ["iterable", "staging", "iterable", "message_type"], "source_name": "iterable", "source_description": "", "loader": "fivetran", "identifier": "message_type_data", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Table containing unique message types.", "columns": {"id": {"name": "id", "description": "Unique identifier of the message type", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "name": {"name": "name", "description": "User defined name of the message type", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "channel_id": {"name": "channel_id", "description": "Channel that this message type belongs to", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "created_at": {"name": "created_at", "description": "Time when the message type was initially created", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "frequency_cap": {"name": "frequency_cap", "description": "The maximum number of times a message of this type can be sent to a recipient within a specified time period to prevent over-messaging", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "rate_limit_per_minute": {"name": "rate_limit_per_minute", "description": "The maximum number of messages of this type that can be sent to recipients in a minute, ensuring controlled message delivery", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "subscription_policy": {"name": "subscription_policy", "description": "Information about the policy or rules governing how users can subscribe to or unsubscribe from this specific message type, like OptOut", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "updated_at": {"name": "updated_at", "description": "Time when the message type was last updated or modified", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": "_fivetran_synced", "loaded_at_query": null, "meta": {}, "tags": [], "static_analysis": null}, "patch_path": null, "unrendered_config": {"loaded_at_field": "_fivetran_synced", "enabled": true, "loaded_at_query": null, "meta": {}, "tags": []}, "relation_name": "\"postgres\".\"public\".\"message_type_data\"", "created_at": 1789422570.1781225, "unrendered_database": "{% if target.type != 'spark' %}{{ var('iterable_database', target.database)}}{% endif %}", "unrendered_schema": "{{var ('iterable_schema', 'iterable')}}", "doc_blocks": []}, "source.iterable.iterable.template_history": {"database": "postgres", "schema": "public", "name": "template_history", "resource_type": "source", "package_name": "iterable", "path": "models/staging/src_iterable.yml", "original_file_path": "models/staging/src_iterable.yml", "unique_id": "source.iterable.iterable.template_history", "fqn": ["iterable", "staging", "iterable", "template_history"], "source_name": "iterable", "source_description": "", "loader": "fivetran", "identifier": "template_history_data", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Table containing unique templates used across campaigns.", "columns": {"id": {"name": "id", "description": "Unique identifier of the template", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "name": {"name": "name", "description": "User defined name of the template", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "template_type": {"name": "template_type", "description": "The type of the template", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "created_at": {"name": "created_at", "description": "Creation timestamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "client_template_id": {"name": "client_template_id", "description": "Reference to the client template", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "creator_user_id": {"name": "creator_user_id", "description": "Reference to the user who created the template", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "message_type_id": {"name": "message_type_id", "description": "Reference to the message type associated with the template", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "updated_at": {"name": "updated_at", "description": "Last update timestamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": "_fivetran_synced", "loaded_at_query": null, "meta": {}, "tags": [], "static_analysis": null}, "patch_path": null, "unrendered_config": {"loaded_at_field": "_fivetran_synced", "enabled": true, "loaded_at_query": null, "meta": {}, "tags": []}, "relation_name": "\"postgres\".\"public\".\"template_history_data\"", "created_at": 1789422570.1788342, "unrendered_database": "{% if target.type != 'spark' %}{{ var('iterable_database', target.database)}}{% endif %}", "unrendered_schema": "{{var ('iterable_schema', 'iterable')}}", "doc_blocks": []}, "source.iterable.iterable.user_history": {"database": "postgres", "schema": "public", "name": "user_history", "resource_type": "source", "package_name": "iterable", "path": "models/staging/src_iterable.yml", "original_file_path": "models/staging/src_iterable.yml", "unique_id": "source.iterable.iterable.user_history", "fqn": ["iterable", "staging", "iterable", "user_history"], "source_name": "iterable", "source_description": "", "loader": "fivetran", "identifier": "user_history_data", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Table containing individual user history information.", "columns": {"email": {"name": "email", "description": "The user's email. Previously was the unique identifier for the user records, for Iterable customers before August 2023. This has since been replaced by iterable_user_id.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "user_id": {"name": "user_id", "description": "User defined identifier of the user. This is not a unique field", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "iterable_user_id": {"name": "iterable_user_id", "description": "The unique identifier of the user", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "first_name": {"name": "first_name", "description": "First name of the user", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "last_name": {"name": "last_name", "description": "Last name of the user", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "email_list_ids": {"name": "email_list_ids", "description": "[DEPRECATED October 13, 2025 Use LIST_USER source instead.] Array of references to the lists associated with the user\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "signup_date": {"name": "signup_date", "description": "Timestamp of when the user signed up", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "signup_source": {"name": "signup_source", "description": "Source where the user signed up", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "updated_at": {"name": "updated_at", "description": "Last update timestamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": "_fivetran_synced", "loaded_at_query": null, "meta": {}, "tags": [], "static_analysis": null}, "patch_path": null, "unrendered_config": {"loaded_at_field": "_fivetran_synced", "enabled": true, "loaded_at_query": null, "meta": {}, "tags": []}, "relation_name": "\"postgres\".\"public\".\"user_history_data\"", "created_at": 1789422570.1795614, "unrendered_database": "{% if target.type != 'spark' %}{{ var('iterable_database', target.database)}}{% endif %}", "unrendered_schema": "{{var ('iterable_schema', 'iterable')}}", "doc_blocks": []}, "source.iterable.iterable.user_unsubscribed_channel": {"database": "postgres", "schema": "public", "name": "user_unsubscribed_channel", "resource_type": "source", "package_name": "iterable", "path": "models/staging/src_iterable.yml", "original_file_path": "models/staging/src_iterable.yml", "unique_id": "source.iterable.iterable.user_unsubscribed_channel", "fqn": ["iterable", "staging", "iterable", "user_unsubscribed_channel"], "source_name": "iterable", "source_description": "", "loader": "fivetran", "identifier": "user_unsubscribed_channel_data", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Table containing the channels from which a user has unsubscribed.", "columns": {"_fivetran_id": {"name": "_fivetran_id", "description": "A Fivetran-created unique identifier for users, derived from hashing user_id and/or email, depending on project type.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "channel_id": {"name": "channel_id", "description": "Reference to the channel from which the user unsubscribed", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": "_fivetran_synced", "loaded_at_query": null, "meta": {}, "tags": [], "static_analysis": null}, "patch_path": null, "unrendered_config": {"loaded_at_field": "_fivetran_synced", "enabled": true, "loaded_at_query": null, "meta": {}, "tags": []}, "relation_name": "\"postgres\".\"public\".\"user_unsubscribed_channel_data\"", "created_at": 1789422570.1802247, "unrendered_database": "{% if target.type != 'spark' %}{{ var('iterable_database', target.database)}}{% endif %}", "unrendered_schema": "{{var ('iterable_schema', 'iterable')}}", "doc_blocks": []}, "source.iterable.iterable.user_unsubscribed_message_type": {"database": "postgres", "schema": "public", "name": "user_unsubscribed_message_type", "resource_type": "source", "package_name": "iterable", "path": "models/staging/src_iterable.yml", "original_file_path": "models/staging/src_iterable.yml", "unique_id": "source.iterable.iterable.user_unsubscribed_message_type", "fqn": ["iterable", "staging", "iterable", "user_unsubscribed_message_type"], "source_name": "iterable", "source_description": "", "loader": "fivetran", "identifier": "user_unsubscribed_message_type_data", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Table containing the message types from which a user has unsubscribed.", "columns": {"_fivetran_id": {"name": "_fivetran_id", "description": "A Fivetran-created unique identifier for users, derived from hashing user_id and/or email, depending on project type.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "message_type_id": {"name": "message_type_id", "description": "Reference to the message type from which the user unsubscribed", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": "_fivetran_synced", "loaded_at_query": null, "meta": {}, "tags": [], "static_analysis": null}, "patch_path": null, "unrendered_config": {"loaded_at_field": "_fivetran_synced", "enabled": true, "loaded_at_query": null, "meta": {}, "tags": []}, "relation_name": "\"postgres\".\"public\".\"user_unsubscribed_message_type_data\"", "created_at": 1789422570.1809583, "unrendered_database": "{% if target.type != 'spark' %}{{ var('iterable_database', target.database)}}{% endif %}", "unrendered_schema": "{{var ('iterable_schema', 'iterable')}}", "doc_blocks": []}, "source.iterable.iterable.user_unsubscribed_channel_history": {"database": "postgres", "schema": "public", "name": "user_unsubscribed_channel_history", "resource_type": "source", "package_name": "iterable", "path": "models/staging/src_iterable.yml", "original_file_path": "models/staging/src_iterable.yml", "unique_id": "source.iterable.iterable.user_unsubscribed_channel_history", "fqn": ["iterable", "staging", "iterable", "user_unsubscribed_channel_history"], "source_name": "iterable", "source_description": "", "loader": "fivetran", "identifier": "user_unsubscribed_channel_history_data", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Table containing the history of channels from which a user has unsubscribed.", "columns": {"channel_id": {"name": "channel_id", "description": "Reference to the channel from which the user unsubscribed", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "email": {"name": "email", "description": "Unique identifier of the user", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "updated_at": {"name": "updated_at", "description": "Last update timestamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": "_fivetran_synced", "loaded_at_query": null, "meta": {}, "tags": [], "static_analysis": null}, "patch_path": null, "unrendered_config": {"loaded_at_field": "_fivetran_synced", "enabled": true, "loaded_at_query": null, "meta": {}, "tags": []}, "relation_name": "\"postgres\".\"public\".\"user_unsubscribed_channel_history_data\"", "created_at": 1789422570.1816406, "unrendered_database": "{% if target.type != 'spark' %}{{ var('iterable_database', target.database)}}{% endif %}", "unrendered_schema": "{{var ('iterable_schema', 'iterable')}}", "doc_blocks": []}, "source.iterable.iterable.user_unsubscribed_message_type_history": {"database": "postgres", "schema": "public", "name": "user_unsubscribed_message_type_history", "resource_type": "source", "package_name": "iterable", "path": "models/staging/src_iterable.yml", "original_file_path": "models/staging/src_iterable.yml", "unique_id": "source.iterable.iterable.user_unsubscribed_message_type_history", "fqn": ["iterable", "staging", "iterable", "user_unsubscribed_message_type_history"], "source_name": "iterable", "source_description": "", "loader": "fivetran", "identifier": "user_unsubscribed_message_type_history_data", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Table containing the history of message types from which a user has unsubscribed.", "columns": {"message_type_id": {"name": "message_type_id", "description": "Reference to the message type from which the user unsubscribed", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "email": {"name": "email", "description": "Unique identifier of the user", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "updated_at": {"name": "updated_at", "description": "Last update timestamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": "_fivetran_synced", "loaded_at_query": null, "meta": {}, "tags": [], "static_analysis": null}, "patch_path": null, "unrendered_config": {"loaded_at_field": "_fivetran_synced", "enabled": true, "loaded_at_query": null, "meta": {}, "tags": []}, "relation_name": "\"postgres\".\"public\".\"user_unsubscribed_message_type_history_data\"", "created_at": 1789422570.1823082, "unrendered_database": "{% if target.type != 'spark' %}{{ var('iterable_database', target.database)}}{% endif %}", "unrendered_schema": "{{var ('iterable_schema', 'iterable')}}", "doc_blocks": []}, "source.iterable.iterable.list_user": {"database": "postgres", "schema": "public", "name": "list_user", "resource_type": "source", "package_name": "iterable", "path": "models/staging/src_iterable.yml", "original_file_path": "models/staging/src_iterable.yml", "unique_id": "source.iterable.iterable.list_user", "fqn": ["iterable", "staging", "iterable", "list_user"], "source_name": "iterable", "source_description": "", "loader": "fivetran", "identifier": "list_user_data", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Table containing the relationship between users and lists they belong to.", "columns": {"_fivetran_id": {"name": "_fivetran_id", "description": "Unique identifier of the list-user relationship record, serving as a foreign key to `user_history._fivetran_id`.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "index": {"name": "index", "description": "Index of the record", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "list_id": {"name": "list_id", "description": "Reference to the list that the user belongs to", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "Timestamp when the record was last synced by Fivetran", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": "_fivetran_synced", "loaded_at_query": null, "meta": {}, "tags": [], "static_analysis": null}, "patch_path": null, "unrendered_config": {"loaded_at_field": "_fivetran_synced", "enabled": true, "loaded_at_query": null, "meta": {}, "tags": []}, "relation_name": "\"postgres\".\"public\".\"list_user_data\"", "created_at": 1789422570.1830015, "unrendered_database": "{% if target.type != 'spark' %}{{ var('iterable_database', target.database)}}{% endif %}", "unrendered_schema": "{{var ('iterable_schema', 'iterable')}}", "doc_blocks": []}}, "macros": {"macro.dbt_postgres.postgres__current_timestamp": {"name": "postgres__current_timestamp", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/timestamps.sql", "original_file_path": "macros/timestamps.sql", "unique_id": "macro.dbt_postgres.postgres__current_timestamp", "macro_sql": "{% macro postgres__current_timestamp() -%}\n now()\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789422566.268828, "supported_languages": null}, "macro.dbt_postgres.postgres__snapshot_string_as_time": {"name": "postgres__snapshot_string_as_time", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/timestamps.sql", "original_file_path": "macros/timestamps.sql", "unique_id": "macro.dbt_postgres.postgres__snapshot_string_as_time", "macro_sql": "{% macro postgres__snapshot_string_as_time(timestamp) -%}\n {%- set result = \"'\" ~ timestamp ~ \"'::timestamp without time zone\" -%}\n {{ return(result) }}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "timestamp", "type": null, "description": ""}], "created_at": 1789422566.2693083, "supported_languages": null}, "macro.dbt_postgres.postgres__snapshot_get_time": {"name": "postgres__snapshot_get_time", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/timestamps.sql", "original_file_path": "macros/timestamps.sql", "unique_id": "macro.dbt_postgres.postgres__snapshot_get_time", "macro_sql": "{% macro postgres__snapshot_get_time() -%}\n {{ current_timestamp() }}::timestamp without time zone\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.current_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789422566.2695978, "supported_languages": null}, "macro.dbt_postgres.postgres__current_timestamp_backcompat": {"name": "postgres__current_timestamp_backcompat", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/timestamps.sql", "original_file_path": "macros/timestamps.sql", "unique_id": "macro.dbt_postgres.postgres__current_timestamp_backcompat", "macro_sql": "{% macro postgres__current_timestamp_backcompat() %}\n current_timestamp::{{ type_timestamp() }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.type_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789422566.2698395, "supported_languages": null}, "macro.dbt_postgres.postgres__current_timestamp_in_utc_backcompat": {"name": "postgres__current_timestamp_in_utc_backcompat", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/timestamps.sql", "original_file_path": "macros/timestamps.sql", "unique_id": "macro.dbt_postgres.postgres__current_timestamp_in_utc_backcompat", "macro_sql": "{% macro postgres__current_timestamp_in_utc_backcompat() %}\n (current_timestamp at time zone 'utc')::{{ type_timestamp() }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.type_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789422566.2700758, "supported_languages": null}, "macro.dbt_postgres.postgres__get_catalog_relations": {"name": "postgres__get_catalog_relations", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/catalog.sql", "original_file_path": "macros/catalog.sql", "unique_id": "macro.dbt_postgres.postgres__get_catalog_relations", "macro_sql": "{% macro postgres__get_catalog_relations(information_schema, relations) -%}\n {%- call statement('catalog', fetch_result=True) -%}\n\n {#\n If the user has multiple databases set and the first one is wrong, this will fail.\n But we won't fail in the case where there are multiple quoting-difference-only dbs, which is better.\n #}\n {% set database = information_schema.database %}\n {{ adapter.verify_database(database) }}\n\n select\n '{{ database }}' as table_database,\n sch.nspname as table_schema,\n tbl.relname as table_name,\n case tbl.relkind\n when 'v' then 'VIEW'\n when 'm' then 'MATERIALIZED VIEW'\n else 'BASE TABLE'\n end as table_type,\n tbl_desc.description as table_comment,\n col.attname as column_name,\n col.attnum as column_index,\n pg_catalog.format_type(col.atttypid, col.atttypmod) as column_type,\n col_desc.description as column_comment,\n pg_get_userbyid(tbl.relowner) as table_owner\n\n from pg_catalog.pg_namespace sch\n join pg_catalog.pg_class tbl on tbl.relnamespace = sch.oid\n join pg_catalog.pg_attribute col on col.attrelid = tbl.oid\n left outer join pg_catalog.pg_description tbl_desc on (tbl_desc.objoid = tbl.oid and tbl_desc.objsubid = 0)\n left outer join pg_catalog.pg_description col_desc on (col_desc.objoid = tbl.oid and col_desc.objsubid = col.attnum)\n where (\n {%- for relation in relations -%}\n {%- if relation.identifier -%}\n (upper(sch.nspname) = upper('{{ relation.schema }}') and\n upper(tbl.relname) = upper('{{ relation.identifier }}'))\n {%- else-%}\n upper(sch.nspname) = upper('{{ relation.schema }}')\n {%- endif -%}\n {%- if not loop.last %} or {% endif -%}\n {%- endfor -%}\n )\n and not pg_is_other_temp_schema(sch.oid) -- not a temporary schema belonging to another session\n and tbl.relpersistence in ('p', 'u') -- [p]ermanent table or [u]nlogged table. Exclude [t]emporary tables\n and tbl.relkind in ('r', 'v', 'f', 'p', 'm') -- o[r]dinary table, [v]iew, [f]oreign table, [p]artitioned table, [m]aterialized view. Other values are [i]ndex, [S]equence, [c]omposite type, [t]OAST table\n and col.attnum > 0 -- negative numbers are used for system columns such as oid\n and not col.attisdropped -- column as not been dropped\n\n order by\n sch.nspname,\n tbl.relname,\n col.attnum\n\n {%- endcall -%}\n\n {{ return(load_result('catalog').table) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "information_schema", "type": null, "description": ""}, {"name": "relations", "type": null, "description": ""}], "created_at": 1789422566.2722476, "supported_languages": null}, "macro.dbt_postgres.postgres__get_catalog": {"name": "postgres__get_catalog", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/catalog.sql", "original_file_path": "macros/catalog.sql", "unique_id": "macro.dbt_postgres.postgres__get_catalog", "macro_sql": "{% macro postgres__get_catalog(information_schema, schemas) -%}\n {%- set relations = [] -%}\n {%- for schema in schemas -%}\n {%- set dummy = relations.append({'schema': schema}) -%}\n {%- endfor -%}\n {{ return(postgres__get_catalog_relations(information_schema, relations)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__get_catalog_relations"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "information_schema", "type": null, "description": ""}, {"name": "schemas", "type": null, "description": ""}], "created_at": 1789422566.2730575, "supported_languages": null}, "macro.dbt_postgres.postgres__get_relations": {"name": "postgres__get_relations", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/relations.sql", "original_file_path": "macros/relations.sql", "unique_id": "macro.dbt_postgres.postgres__get_relations", "macro_sql": "{% macro postgres__get_relations() -%}\n\n {#\n -- in pg_depend, objid is the dependent, refobjid is the referenced object\n -- > a pg_depend entry indicates that the referenced object cannot be\n -- > dropped without also dropping the dependent object.\n #}\n\n {%- call statement('relations', fetch_result=True) -%}\n select distinct\n dependent_namespace.nspname as dependent_schema,\n dependent_class.relname as dependent_name,\n referenced_namespace.nspname as referenced_schema,\n referenced_class.relname as referenced_name\n\n -- Query for views: views are entries in pg_class with an entry in pg_rewrite, but we avoid\n -- a seq scan on pg_rewrite by leveraging the fact there is an \"internal\" row in pg_depend for\n -- the view...\n from pg_class as dependent_class\n join pg_namespace as dependent_namespace on dependent_namespace.oid = dependent_class.relnamespace\n join pg_depend as dependent_depend on dependent_depend.refobjid = dependent_class.oid\n and dependent_depend.classid = 'pg_rewrite'::regclass\n and dependent_depend.refclassid = 'pg_class'::regclass\n and dependent_depend.deptype = 'i'\n\n -- ... and via pg_depend (that has a row per column, hence the need for \"distinct\" above, and\n -- making sure to exclude the internal row to avoid a view appearing to depend on itself)...\n join pg_depend as joining_depend on joining_depend.objid = dependent_depend.objid\n and joining_depend.classid = 'pg_rewrite'::regclass\n and joining_depend.refclassid = 'pg_class'::regclass\n and joining_depend.refobjid != dependent_depend.refobjid\n\n -- ... we can find the tables they query from in pg_class, but excluding system tables. Note we\n -- don't need need to exclude _dependent_ system tables, because they only query from other\n -- system tables, and so are automatically excluded by excluding _referenced_ system tables\n join pg_class as referenced_class on referenced_class.oid = joining_depend.refobjid\n join pg_namespace as referenced_namespace on referenced_namespace.oid = referenced_class.relnamespace\n and referenced_namespace.nspname != 'information_schema'\n and referenced_namespace.nspname not like 'pg\\_%'\n\n order by\n dependent_schema, dependent_name, referenced_schema, referenced_name;\n\n {%- endcall -%}\n\n {{ return(load_result('relations').table) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789422566.274116, "supported_languages": null}, "macro.dbt_postgres.postgres_get_relations": {"name": "postgres_get_relations", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/relations.sql", "original_file_path": "macros/relations.sql", "unique_id": "macro.dbt_postgres.postgres_get_relations", "macro_sql": "{% macro postgres_get_relations() %}\n {{ return(postgres__get_relations()) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__get_relations"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789422566.274446, "supported_languages": null}, "macro.dbt_postgres.postgres__create_table_as": {"name": "postgres__create_table_as", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "unique_id": "macro.dbt_postgres.postgres__create_table_as", "macro_sql": "{% macro postgres__create_table_as(temporary, relation, sql) -%}\n {%- set unlogged = config.get('unlogged', default=false) -%}\n {%- set sql_header = config.get('sql_header', none) -%}\n\n {{ sql_header if sql_header is not none }}\n\n create {% if temporary -%}\n temporary\n {%- elif unlogged -%}\n unlogged\n {%- endif %} table {{ relation }}\n {% set contract_config = config.get('contract') %}\n {% if contract_config.enforced %}\n {{ get_assert_columns_equivalent(sql) }}\n {% endif -%}\n {% if contract_config.enforced and (not temporary) -%}\n {{ get_table_columns_and_constraints() }} ;\n insert into {{ relation }} (\n {{ adapter.dispatch('get_column_names', 'dbt')() }}\n )\n {%- set sql = get_select_subquery(sql) %}\n {% else %}\n as\n {% endif %}\n (\n {{ sql }}\n );\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.get_assert_columns_equivalent", "macro.dbt.get_table_columns_and_constraints", "macro.dbt.default__get_column_names", "macro.dbt.get_select_subquery"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "temporary", "type": null, "description": ""}, {"name": "relation", "type": null, "description": ""}, {"name": "sql", "type": null, "description": ""}], "created_at": 1789422566.2792485, "supported_languages": null}, "macro.dbt_postgres.postgres__get_create_index_sql": {"name": "postgres__get_create_index_sql", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "unique_id": "macro.dbt_postgres.postgres__get_create_index_sql", "macro_sql": "{% macro postgres__get_create_index_sql(relation, index_dict) -%}\n {%- set index_config = adapter.parse_index(index_dict) -%}\n {%- set comma_separated_columns = \", \".join(index_config.columns) -%}\n {%- set index_name = index_config.render(relation) -%}\n\n create {% if index_config.unique -%}\n unique\n {%- endif %} index if not exists\n \"{{ index_name }}\"\n on {{ relation }} {% if index_config.type -%}\n using {{ index_config.type }}\n {%- endif %}\n ({{ comma_separated_columns }})\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "index_dict", "type": null, "description": ""}], "created_at": 1789422566.2803223, "supported_languages": null}, "macro.dbt_postgres.postgres__create_schema": {"name": "postgres__create_schema", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "unique_id": "macro.dbt_postgres.postgres__create_schema", "macro_sql": "{% macro postgres__create_schema(relation) -%}\n {% if relation.database -%}\n {{ adapter.verify_database(relation.database) }}\n {%- endif -%}\n {%- call statement('create_schema') -%}\n create schema if not exists {{ relation.without_identifier().include(database=False) }}\n {%- endcall -%}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789422566.2809951, "supported_languages": null}, "macro.dbt_postgres.postgres__drop_schema": {"name": "postgres__drop_schema", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "unique_id": "macro.dbt_postgres.postgres__drop_schema", "macro_sql": "{% macro postgres__drop_schema(relation) -%}\n {% if relation.database -%}\n {{ adapter.verify_database(relation.database) }}\n {%- endif -%}\n {%- call statement('drop_schema') -%}\n drop schema if exists {{ relation.without_identifier().include(database=False) }} cascade\n {%- endcall -%}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789422566.2816875, "supported_languages": null}, "macro.dbt_postgres.postgres__get_columns_in_relation": {"name": "postgres__get_columns_in_relation", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "unique_id": "macro.dbt_postgres.postgres__get_columns_in_relation", "macro_sql": "{% macro postgres__get_columns_in_relation(relation) -%}\n {% call statement('get_columns_in_relation', fetch_result=True) %}\n select\n column_name,\n data_type,\n character_maximum_length,\n numeric_precision,\n numeric_scale\n\n from {{ relation.information_schema('columns') }}\n where table_name = '{{ relation.identifier }}'\n {% if relation.schema %}\n and table_schema = '{{ relation.schema }}'\n {% endif %}\n order by ordinal_position\n\n {% endcall %}\n {% set table = load_result('get_columns_in_relation').table %}\n {{ return(sql_convert_columns_in_relation(table)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement", "macro.dbt.sql_convert_columns_in_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789422566.282788, "supported_languages": null}, "macro.dbt_postgres.postgres__list_relations_without_caching": {"name": "postgres__list_relations_without_caching", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "unique_id": "macro.dbt_postgres.postgres__list_relations_without_caching", "macro_sql": "{% macro postgres__list_relations_without_caching(schema_relation) %}\n {% call statement('list_relations_without_caching', fetch_result=True) -%}\n select\n '{{ schema_relation.database }}' as database,\n tablename as name,\n schemaname as schema,\n 'table' as type\n from pg_tables\n where schemaname ilike '{{ schema_relation.schema }}'\n union all\n select\n '{{ schema_relation.database }}' as database,\n viewname as name,\n schemaname as schema,\n 'view' as type\n from pg_views\n where schemaname ilike '{{ schema_relation.schema }}'\n union all\n select\n '{{ schema_relation.database }}' as database,\n matviewname as name,\n schemaname as schema,\n 'materialized_view' as type\n from pg_matviews\n where schemaname ilike '{{ schema_relation.schema }}'\n union all\n select distinct\n '{{ schema_relation.database }}' as database,\n proname as name,\n ns.nspname as schema,\n 'function' as type\n from pg_proc\n join pg_namespace as ns on pronamespace = ns.oid\n where ns.nspname ilike '{{ schema_relation.schema }}'\n {% endcall %}\n {{ return(load_result('list_relations_without_caching').table) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "schema_relation", "type": null, "description": ""}], "created_at": 1789422566.2839053, "supported_languages": null}, "macro.dbt_postgres.postgres__information_schema_name": {"name": "postgres__information_schema_name", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "unique_id": "macro.dbt_postgres.postgres__information_schema_name", "macro_sql": "{% macro postgres__information_schema_name(database) -%}\n {% if database_name -%}\n {{ adapter.verify_database(database_name) }}\n {%- endif -%}\n information_schema\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "database", "type": null, "description": ""}], "created_at": 1789422566.2842984, "supported_languages": null}, "macro.dbt_postgres.postgres__list_schemas": {"name": "postgres__list_schemas", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "unique_id": "macro.dbt_postgres.postgres__list_schemas", "macro_sql": "{% macro postgres__list_schemas(database) %}\n {% if database -%}\n {{ adapter.verify_database(database) }}\n {%- endif -%}\n {% call statement('list_schemas', fetch_result=True, auto_begin=False) %}\n select distinct nspname from pg_namespace\n {% endcall %}\n {{ return(load_result('list_schemas').table) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "database", "type": null, "description": ""}], "created_at": 1789422566.2851322, "supported_languages": null}, "macro.dbt_postgres.postgres__check_schema_exists": {"name": "postgres__check_schema_exists", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "unique_id": "macro.dbt_postgres.postgres__check_schema_exists", "macro_sql": "{% macro postgres__check_schema_exists(information_schema, schema) -%}\n {% if information_schema.database -%}\n {{ adapter.verify_database(information_schema.database) }}\n {%- endif -%}\n {% call statement('check_schema_exists', fetch_result=True, auto_begin=False) %}\n select count(*) from pg_namespace where nspname = '{{ schema }}'\n {% endcall %}\n {{ return(load_result('check_schema_exists').table) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "information_schema", "type": null, "description": ""}, {"name": "schema", "type": null, "description": ""}], "created_at": 1789422566.2859566, "supported_languages": null}, "macro.dbt_postgres.postgres__make_relation_with_suffix": {"name": "postgres__make_relation_with_suffix", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "unique_id": "macro.dbt_postgres.postgres__make_relation_with_suffix", "macro_sql": "{% macro postgres__make_relation_with_suffix(base_relation, suffix, dstring) %}\n {% if dstring %}\n {% set dt = modules.datetime.datetime.now() %}\n {% set dtstring = dt.strftime(\"%H%M%S%f\") %}\n {% set suffix = suffix ~ dtstring %}\n {% endif %}\n {% set suffix_length = suffix|length %}\n {% set relation_max_name_length = base_relation.relation_max_name_length() %}\n {% if suffix_length > relation_max_name_length %}\n {% do exceptions.raise_compiler_error('Relation suffix is too long (' ~ suffix_length ~ ' characters). Maximum length is ' ~ relation_max_name_length ~ ' characters.') %}\n {% endif %}\n {% set identifier = base_relation.identifier[:relation_max_name_length - suffix_length] ~ suffix %}\n\n {{ return(base_relation.incorporate(path={\"identifier\": identifier })) }}\n\n {% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "base_relation", "type": null, "description": ""}, {"name": "suffix", "type": null, "description": ""}, {"name": "dstring", "type": null, "description": ""}], "created_at": 1789422566.287879, "supported_languages": null}, "macro.dbt_postgres.postgres__make_intermediate_relation": {"name": "postgres__make_intermediate_relation", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "unique_id": "macro.dbt_postgres.postgres__make_intermediate_relation", "macro_sql": "{% macro postgres__make_intermediate_relation(base_relation, suffix) %}\n {{ return(postgres__make_relation_with_suffix(base_relation, suffix, dstring=False)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__make_relation_with_suffix"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "base_relation", "type": null, "description": ""}, {"name": "suffix", "type": null, "description": ""}], "created_at": 1789422566.2882876, "supported_languages": null}, "macro.dbt_postgres.postgres__make_temp_relation": {"name": "postgres__make_temp_relation", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "unique_id": "macro.dbt_postgres.postgres__make_temp_relation", "macro_sql": "{% macro postgres__make_temp_relation(base_relation, suffix) %}\n {% set temp_relation = postgres__make_relation_with_suffix(base_relation, suffix, dstring=True) %}\n {{ return(temp_relation.incorporate(path={\"schema\": none,\n \"database\": none})) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__make_relation_with_suffix"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "base_relation", "type": null, "description": ""}, {"name": "suffix", "type": null, "description": ""}], "created_at": 1789422566.2889562, "supported_languages": null}, "macro.dbt_postgres.postgres__make_backup_relation": {"name": "postgres__make_backup_relation", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "unique_id": "macro.dbt_postgres.postgres__make_backup_relation", "macro_sql": "{% macro postgres__make_backup_relation(base_relation, backup_relation_type, suffix) %}\n {% set backup_relation = postgres__make_relation_with_suffix(base_relation, suffix, dstring=False) %}\n {{ return(backup_relation.incorporate(type=backup_relation_type)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__make_relation_with_suffix"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "base_relation", "type": null, "description": ""}, {"name": "backup_relation_type", "type": null, "description": ""}, {"name": "suffix", "type": null, "description": ""}], "created_at": 1789422566.2894948, "supported_languages": null}, "macro.dbt_postgres.postgres_escape_comment": {"name": "postgres_escape_comment", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "unique_id": "macro.dbt_postgres.postgres_escape_comment", "macro_sql": "{% macro postgres_escape_comment(comment) -%}\n {% if comment is not string %}\n {% do exceptions.raise_compiler_error('cannot escape a non-string: ' ~ comment) %}\n {% endif %}\n {%- set magic = '$dbt_comment_literal_block$' -%}\n {%- if magic in comment -%}\n {%- do exceptions.raise_compiler_error('The string ' ~ magic ~ ' is not allowed in comments.') -%}\n {%- endif -%}\n {{ magic }}{{ comment }}{{ magic }}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "comment", "type": null, "description": ""}], "created_at": 1789422566.2904072, "supported_languages": null}, "macro.dbt_postgres.postgres__alter_relation_comment": {"name": "postgres__alter_relation_comment", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "unique_id": "macro.dbt_postgres.postgres__alter_relation_comment", "macro_sql": "{% macro postgres__alter_relation_comment(relation, comment) %}\n {% set escaped_comment = postgres_escape_comment(comment) %}\n {% if relation.type == 'materialized_view' -%}\n {% set relation_type = \"materialized view\" %}\n {%- else -%}\n {%- set relation_type = relation.type -%}\n {%- endif -%}\n comment on {{ relation_type }} {{ relation }} is {{ escaped_comment }};\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres_escape_comment"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "comment", "type": null, "description": ""}], "created_at": 1789422566.291243, "supported_languages": null}, "macro.dbt_postgres.postgres__alter_column_comment": {"name": "postgres__alter_column_comment", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "unique_id": "macro.dbt_postgres.postgres__alter_column_comment", "macro_sql": "{% macro postgres__alter_column_comment(relation, column_dict) %}\n {% set existing_columns = adapter.get_columns_in_relation(relation) | map(attribute=\"name\") | list %}\n {% for column_name in column_dict if (column_name in existing_columns) %}\n {% set comment = column_dict[column_name]['description'] %}\n {% set escaped_comment = postgres_escape_comment(comment) %}\n comment on column {{ relation }}.{{ adapter.quote(column_name) if column_dict[column_name]['quote'] else column_name }} is {{ escaped_comment }};\n {% endfor %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres_escape_comment"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "column_dict", "type": null, "description": ""}], "created_at": 1789422566.292459, "supported_languages": null}, "macro.dbt_postgres.postgres__get_show_grant_sql": {"name": "postgres__get_show_grant_sql", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "unique_id": "macro.dbt_postgres.postgres__get_show_grant_sql", "macro_sql": "\n\n{%- macro postgres__get_show_grant_sql(relation) -%}\n select grantee, privilege_type\n from {{ relation.information_schema('role_table_grants') }}\n where grantor = current_role\n and grantee != current_role\n and table_schema = '{{ relation.schema }}'\n and table_name = '{{ relation.identifier }}'\n{%- endmacro -%}\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789422566.2929168, "supported_languages": null}, "macro.dbt_postgres.postgres__copy_grants": {"name": "postgres__copy_grants", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "unique_id": "macro.dbt_postgres.postgres__copy_grants", "macro_sql": "{% macro postgres__copy_grants() %}\n {{ return(False) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789422566.2931628, "supported_languages": null}, "macro.dbt_postgres.postgres__get_show_indexes_sql": {"name": "postgres__get_show_indexes_sql", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "unique_id": "macro.dbt_postgres.postgres__get_show_indexes_sql", "macro_sql": "{% macro postgres__get_show_indexes_sql(relation) %}\n select\n i.relname as name,\n m.amname as method,\n ix.indisunique as \"unique\",\n array_to_string(array_agg(a.attname), ',') as column_names\n from pg_index ix\n join pg_class i\n on i.oid = ix.indexrelid\n join pg_am m\n on m.oid=i.relam\n join pg_class t\n on t.oid = ix.indrelid\n join pg_namespace n\n on n.oid = t.relnamespace\n join pg_attribute a\n on a.attrelid = t.oid\n and a.attnum = ANY(ix.indkey)\n where t.relname = '{{ relation.identifier }}'\n and n.nspname = '{{ relation.schema }}'\n and t.relkind in ('r', 'm')\n group by 1, 2, 3\n order by 1, 2, 3\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789422566.293506, "supported_languages": null}, "macro.dbt_postgres.postgres__get_drop_index_sql": {"name": "postgres__get_drop_index_sql", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "unique_id": "macro.dbt_postgres.postgres__get_drop_index_sql", "macro_sql": "\n\n\n{%- macro postgres__get_drop_index_sql(relation, index_name) -%}\n drop index if exists \"{{ relation.schema }}\".\"{{ index_name }}\"\n{%- endmacro -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "index_name", "type": null, "description": ""}], "created_at": 1789422566.2938256, "supported_languages": null}, "macro.dbt_postgres.postgres__get_create_materialized_view_as_sql": {"name": "postgres__get_create_materialized_view_as_sql", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/relations/materialized_view/create.sql", "original_file_path": "macros/relations/materialized_view/create.sql", "unique_id": "macro.dbt_postgres.postgres__get_create_materialized_view_as_sql", "macro_sql": "{% macro postgres__get_create_materialized_view_as_sql(relation, sql) %}\n create materialized view if not exists {{ relation }} as {{ sql }};\n\n {% for _index_dict in config.get('indexes', []) -%}\n {{- get_create_index_sql(relation, _index_dict) -}}{{ ';' if not loop.last else \"\" }}\n {%- endfor -%}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_create_index_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "sql", "type": null, "description": ""}], "created_at": 1789422566.294824, "supported_languages": null}, "macro.dbt_postgres.postgres__get_alter_materialized_view_as_sql": {"name": "postgres__get_alter_materialized_view_as_sql", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/relations/materialized_view/alter.sql", "original_file_path": "macros/relations/materialized_view/alter.sql", "unique_id": "macro.dbt_postgres.postgres__get_alter_materialized_view_as_sql", "macro_sql": "{% macro postgres__get_alter_materialized_view_as_sql(\n relation,\n configuration_changes,\n sql,\n existing_relation,\n backup_relation,\n intermediate_relation\n) %}\n\n -- apply a full refresh immediately if needed\n {% if configuration_changes.requires_full_refresh %}\n\n {{ get_replace_sql(existing_relation, relation, sql) }}\n\n -- otherwise apply individual changes as needed\n {% else %}\n\n {{ postgres__update_indexes_on_materialized_view(relation, configuration_changes.indexes) }}\n\n {%- endif -%}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_replace_sql", "macro.dbt_postgres.postgres__update_indexes_on_materialized_view"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "configuration_changes", "type": null, "description": ""}, {"name": "sql", "type": null, "description": ""}, {"name": "existing_relation", "type": null, "description": ""}, {"name": "backup_relation", "type": null, "description": ""}, {"name": "intermediate_relation", "type": null, "description": ""}], "created_at": 1789422566.2959797, "supported_languages": null}, "macro.dbt_postgres.postgres__update_indexes_on_materialized_view": {"name": "postgres__update_indexes_on_materialized_view", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/relations/materialized_view/alter.sql", "original_file_path": "macros/relations/materialized_view/alter.sql", "unique_id": "macro.dbt_postgres.postgres__update_indexes_on_materialized_view", "macro_sql": "\n\n\n{%- macro postgres__update_indexes_on_materialized_view(relation, index_changes) -%}\n {{- log(\"Applying UPDATE INDEXES to: \" ~ relation) -}}\n\n {%- for _index_change in index_changes -%}\n {%- set _index = _index_change.context -%}\n\n {%- if _index_change.action == \"drop\" -%}\n\n {{ postgres__get_drop_index_sql(relation, _index.name) }}\n\n {%- elif _index_change.action == \"create\" -%}\n\n {{ postgres__get_create_index_sql(relation, _index.as_node_config) }}\n\n {%- endif -%}\n\t{{ ';' if not loop.last else \"\" }}\n\n {%- endfor -%}\n\n{%- endmacro -%}\n\n\n", "depends_on": {"macros": ["macro.dbt_postgres.postgres__get_drop_index_sql", "macro.dbt_postgres.postgres__get_create_index_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "index_changes", "type": null, "description": ""}], "created_at": 1789422566.2971077, "supported_languages": null}, "macro.dbt_postgres.postgres__get_materialized_view_configuration_changes": {"name": "postgres__get_materialized_view_configuration_changes", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/relations/materialized_view/alter.sql", "original_file_path": "macros/relations/materialized_view/alter.sql", "unique_id": "macro.dbt_postgres.postgres__get_materialized_view_configuration_changes", "macro_sql": "{% macro postgres__get_materialized_view_configuration_changes(existing_relation, new_config) %}\n {% set _existing_materialized_view = postgres__describe_materialized_view(existing_relation) %}\n {% set _configuration_changes = existing_relation.get_materialized_view_config_change_collection(_existing_materialized_view, new_config.model) %}\n {% do return(_configuration_changes) %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__describe_materialized_view"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "existing_relation", "type": null, "description": ""}, {"name": "new_config", "type": null, "description": ""}], "created_at": 1789422566.2977424, "supported_languages": null}, "macro.dbt_postgres.postgres__get_rename_materialized_view_sql": {"name": "postgres__get_rename_materialized_view_sql", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/relations/materialized_view/rename.sql", "original_file_path": "macros/relations/materialized_view/rename.sql", "unique_id": "macro.dbt_postgres.postgres__get_rename_materialized_view_sql", "macro_sql": "{% macro postgres__get_rename_materialized_view_sql(relation, new_name) %}\n alter materialized view {{ relation }} rename to {{ new_name }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "new_name", "type": null, "description": ""}], "created_at": 1789422566.298205, "supported_languages": null}, "macro.dbt_postgres.postgres__refresh_materialized_view": {"name": "postgres__refresh_materialized_view", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/relations/materialized_view/refresh.sql", "original_file_path": "macros/relations/materialized_view/refresh.sql", "unique_id": "macro.dbt_postgres.postgres__refresh_materialized_view", "macro_sql": "{% macro postgres__refresh_materialized_view(relation) %}\n refresh materialized view {{ relation }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789422566.2985184, "supported_languages": null}, "macro.dbt_postgres.postgres__drop_materialized_view": {"name": "postgres__drop_materialized_view", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/relations/materialized_view/drop.sql", "original_file_path": "macros/relations/materialized_view/drop.sql", "unique_id": "macro.dbt_postgres.postgres__drop_materialized_view", "macro_sql": "{% macro postgres__drop_materialized_view(relation) -%}\n drop materialized view if exists {{ relation }} cascade\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789422566.2988834, "supported_languages": null}, "macro.dbt_postgres.postgres__describe_materialized_view": {"name": "postgres__describe_materialized_view", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/relations/materialized_view/describe.sql", "original_file_path": "macros/relations/materialized_view/describe.sql", "unique_id": "macro.dbt_postgres.postgres__describe_materialized_view", "macro_sql": "{% macro postgres__describe_materialized_view(relation) %}\n -- for now just get the indexes, we don't need the name or the query yet\n {% set _indexes = run_query(get_show_indexes_sql(relation)) %}\n {% do return({'indexes': _indexes}) %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.run_query", "macro.dbt.get_show_indexes_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789422566.2996848, "supported_languages": null}, "macro.dbt_postgres.postgres__get_rename_view_sql": {"name": "postgres__get_rename_view_sql", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/relations/view/rename.sql", "original_file_path": "macros/relations/view/rename.sql", "unique_id": "macro.dbt_postgres.postgres__get_rename_view_sql", "macro_sql": "{% macro postgres__get_rename_view_sql(relation, new_name) %}\n alter view {{ relation }} rename to {{ new_name }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "new_name", "type": null, "description": ""}], "created_at": 1789422566.3001013, "supported_languages": null}, "macro.dbt_postgres.postgres__drop_view": {"name": "postgres__drop_view", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/relations/view/drop.sql", "original_file_path": "macros/relations/view/drop.sql", "unique_id": "macro.dbt_postgres.postgres__drop_view", "macro_sql": "{% macro postgres__drop_view(relation) -%}\n drop view if exists {{ relation }} cascade\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789422566.3003917, "supported_languages": null}, "macro.dbt_postgres.postgres__get_replace_view_sql": {"name": "postgres__get_replace_view_sql", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/relations/view/replace.sql", "original_file_path": "macros/relations/view/replace.sql", "unique_id": "macro.dbt_postgres.postgres__get_replace_view_sql", "macro_sql": "{% macro postgres__get_replace_view_sql(relation, sql) -%}\n\n {%- set sql_header = config.get('sql_header', none) -%}\n {{ sql_header if sql_header is not none }}\n\n create or replace view {{ relation }}\n {% set contract_config = config.get('contract') %}\n {% if contract_config.enforced %}\n {{ get_assert_columns_equivalent(sql) }}\n {%- endif %}\n as (\n {{ sql }}\n );\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.get_assert_columns_equivalent"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "sql", "type": null, "description": ""}], "created_at": 1789422566.3014584, "supported_languages": null}, "macro.dbt_postgres.postgres__get_rename_table_sql": {"name": "postgres__get_rename_table_sql", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/relations/table/rename.sql", "original_file_path": "macros/relations/table/rename.sql", "unique_id": "macro.dbt_postgres.postgres__get_rename_table_sql", "macro_sql": "{% macro postgres__get_rename_table_sql(relation, new_name) %}\n alter table {{ relation }} rename to {{ new_name }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "new_name", "type": null, "description": ""}], "created_at": 1789422566.3018432, "supported_languages": null}, "macro.dbt_postgres.postgres__drop_table": {"name": "postgres__drop_table", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/relations/table/drop.sql", "original_file_path": "macros/relations/table/drop.sql", "unique_id": "macro.dbt_postgres.postgres__drop_table", "macro_sql": "{% macro postgres__drop_table(relation) -%}\n drop table if exists {{ relation }} cascade\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789422566.302127, "supported_languages": null}, "macro.dbt_postgres.postgres__get_replace_table_sql": {"name": "postgres__get_replace_table_sql", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/relations/table/replace.sql", "original_file_path": "macros/relations/table/replace.sql", "unique_id": "macro.dbt_postgres.postgres__get_replace_table_sql", "macro_sql": "{% macro postgres__get_replace_table_sql(relation, sql) -%}\n\n {%- set sql_header = config.get('sql_header', none) -%}\n {{ sql_header if sql_header is not none }}\n\n create or replace table {{ relation }}\n {% set contract_config = config.get('contract') %}\n {% if contract_config.enforced %}\n {{ get_assert_columns_equivalent(sql) }}\n {{ get_table_columns_and_constraints() }}\n {%- set sql = get_select_subquery(sql) %}\n {% endif %}\n as (\n {{ sql }}\n );\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.get_assert_columns_equivalent", "macro.dbt.get_table_columns_and_constraints", "macro.dbt.get_select_subquery"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "sql", "type": null, "description": ""}], "created_at": 1789422566.303377, "supported_languages": null}, "macro.dbt_postgres.postgres__get_incremental_default_sql": {"name": "postgres__get_incremental_default_sql", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/materializations/incremental_strategies.sql", "original_file_path": "macros/materializations/incremental_strategies.sql", "unique_id": "macro.dbt_postgres.postgres__get_incremental_default_sql", "macro_sql": "{% macro postgres__get_incremental_default_sql(arg_dict) %}\n\n {% if arg_dict[\"unique_key\"] %}\n {% do return(get_incremental_delete_insert_sql(arg_dict)) %}\n {% else %}\n {% do return(get_incremental_append_sql(arg_dict)) %}\n {% endif %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_incremental_delete_insert_sql", "macro.dbt.get_incremental_append_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "arg_dict", "type": null, "description": ""}], "created_at": 1789422566.3042722, "supported_languages": null}, "macro.dbt_postgres.postgres__get_incremental_microbatch_sql": {"name": "postgres__get_incremental_microbatch_sql", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/materializations/incremental_strategies.sql", "original_file_path": "macros/materializations/incremental_strategies.sql", "unique_id": "macro.dbt_postgres.postgres__get_incremental_microbatch_sql", "macro_sql": "{% macro postgres__get_incremental_microbatch_sql(arg_dict) %}\n\n {% if arg_dict[\"unique_key\"] %}\n {% do return(adapter.dispatch('get_incremental_merge_sql', 'dbt')(arg_dict)) %}\n {% else %}\n {{ exceptions.raise_compiler_error(\"dbt-postgres 'microbatch' requires a `unique_key` config\") }}\n {% endif %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_incremental_merge_sql", "macro.dbt.default__get_incremental_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "arg_dict", "type": null, "description": ""}], "created_at": 1789422566.3049467, "supported_languages": null}, "macro.dbt_postgres.postgres__snapshot_merge_sql": {"name": "postgres__snapshot_merge_sql", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/materializations/snapshot_merge.sql", "original_file_path": "macros/materializations/snapshot_merge.sql", "unique_id": "macro.dbt_postgres.postgres__snapshot_merge_sql", "macro_sql": "{% macro postgres__snapshot_merge_sql(target, source, insert_cols) -%}\n {%- set insert_cols_csv = insert_cols | join(', ') -%}\n\n {%- set columns = config.get(\"snapshot_table_column_names\") or get_snapshot_table_column_names() -%}\n\n update {{ target }}\n set {{ columns.dbt_valid_to }} = DBT_INTERNAL_SOURCE.{{ columns.dbt_valid_to }}\n from {{ source }} as DBT_INTERNAL_SOURCE\n where DBT_INTERNAL_SOURCE.{{ columns.dbt_scd_id }}::text = {{ target }}.{{ columns.dbt_scd_id }}::text\n and DBT_INTERNAL_SOURCE.dbt_change_type::text in ('update'::text, 'delete'::text)\n {% if config.get(\"dbt_valid_to_current\") %}\n and ({{ target }}.{{ columns.dbt_valid_to }} = {{ config.get('dbt_valid_to_current') }} or {{ target }}.{{ columns.dbt_valid_to }} is null);\n {% else %}\n and {{ target }}.{{ columns.dbt_valid_to }} is null;\n {% endif %}\n\n\n insert into {{ target }} ({{ insert_cols_csv }})\n select {% for column in insert_cols -%}\n DBT_INTERNAL_SOURCE.{{ column }} {%- if not loop.last %}, {%- endif %}\n {%- endfor %}\n from {{ source }} as DBT_INTERNAL_SOURCE\n where DBT_INTERNAL_SOURCE.dbt_change_type::text = 'insert'::text;\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_snapshot_table_column_names"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "target", "type": null, "description": ""}, {"name": "source", "type": null, "description": ""}, {"name": "insert_cols", "type": null, "description": ""}], "created_at": 1789422566.3071961, "supported_languages": null}, "macro.dbt_postgres.postgres__formatted_scalar_function_args_sql": {"name": "postgres__formatted_scalar_function_args_sql", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/materializations/functions/scalar.sql", "original_file_path": "macros/materializations/functions/scalar.sql", "unique_id": "macro.dbt_postgres.postgres__formatted_scalar_function_args_sql", "macro_sql": "{% macro postgres__formatted_scalar_function_args_sql() %}\n {% set args = [] %}\n {% for arg in model.arguments -%}\n {% set default_value = arg.get('default_value', none) %}\n {% if default_value != none %}\n {%- do args.append(arg.name ~ ' ' ~ arg.data_type ~ ' DEFAULT ' ~ default_value) -%}\n {% else %}\n {%- do args.append(arg.name ~ ' ' ~ arg.data_type) -%}\n {% endif %}\n {%- endfor %}\n {{ args | join(', ') }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789422566.308627, "supported_languages": null}, "macro.dbt_postgres.postgres__last_day": {"name": "postgres__last_day", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/utils/last_day.sql", "original_file_path": "macros/utils/last_day.sql", "unique_id": "macro.dbt_postgres.postgres__last_day", "macro_sql": "{% macro postgres__last_day(date, datepart) -%}\n\n {%- if datepart == 'quarter' -%}\n -- postgres dateadd does not support quarter interval.\n cast(\n {{dbt.dateadd('day', '-1',\n dbt.dateadd('month', '3', dbt.date_trunc(datepart, date))\n )}}\n as date)\n {%- else -%}\n {{dbt.default_last_day(date, datepart)}}\n {%- endif -%}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.dateadd", "macro.dbt.date_trunc", "macro.dbt.default_last_day"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "date", "type": null, "description": ""}, {"name": "datepart", "type": null, "description": ""}], "created_at": 1789422566.3096073, "supported_languages": null}, "macro.dbt_postgres.postgres__listagg": {"name": "postgres__listagg", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/utils/listagg.sql", "original_file_path": "macros/utils/listagg.sql", "unique_id": "macro.dbt_postgres.postgres__listagg", "macro_sql": "{% macro postgres__listagg(measure, delimiter_text, order_by_clause, limit_num) -%}\n\n {% if limit_num -%}\n array_to_string(\n (array_agg(\n {{ measure }}\n {% if order_by_clause -%}\n {{ order_by_clause }}\n {%- endif %}\n ))[1:{{ limit_num }}],\n {{ delimiter_text }}\n )\n {%- else %}\n string_agg(\n {{ measure }},\n {{ delimiter_text }}\n {% if order_by_clause -%}\n {{ order_by_clause }}\n {%- endif %}\n )\n {%- endif %}\n\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "measure", "type": null, "description": ""}, {"name": "delimiter_text", "type": null, "description": ""}, {"name": "order_by_clause", "type": null, "description": ""}, {"name": "limit_num", "type": null, "description": ""}], "created_at": 1789422566.310663, "supported_languages": null}, "macro.dbt_postgres.postgres__any_value": {"name": "postgres__any_value", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/utils/any_value.sql", "original_file_path": "macros/utils/any_value.sql", "unique_id": "macro.dbt_postgres.postgres__any_value", "macro_sql": "{% macro postgres__any_value(expression) -%}\n\n min({{ expression }})\n\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "expression", "type": null, "description": ""}], "created_at": 1789422566.3109703, "supported_languages": null}, "macro.dbt_postgres.postgres__datediff": {"name": "postgres__datediff", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/utils/datediff.sql", "original_file_path": "macros/utils/datediff.sql", "unique_id": "macro.dbt_postgres.postgres__datediff", "macro_sql": "{% macro postgres__datediff(first_date, second_date, datepart) -%}\n\n {% if datepart == 'year' %}\n (date_part('year', ({{second_date}})::date) - date_part('year', ({{first_date}})::date))\n {% elif datepart == 'quarter' %}\n ({{ datediff(first_date, second_date, 'year') }} * 4 + date_part('quarter', ({{second_date}})::date) - date_part('quarter', ({{first_date}})::date))\n {% elif datepart == 'month' %}\n ({{ datediff(first_date, second_date, 'year') }} * 12 + date_part('month', ({{second_date}})::date) - date_part('month', ({{first_date}})::date))\n {% elif datepart == 'day' %}\n (({{second_date}})::date - ({{first_date}})::date)\n {% elif datepart == 'week' %}\n ({{ datediff(first_date, second_date, 'day') }} / 7 + case\n when date_part('dow', ({{first_date}})::timestamp) <= date_part('dow', ({{second_date}})::timestamp) then\n case when {{first_date}} <= {{second_date}} then 0 else -1 end\n else\n case when {{first_date}} <= {{second_date}} then 1 else 0 end\n end)\n {% elif datepart == 'hour' %}\n ({{ datediff(first_date, second_date, 'day') }} * 24 + date_part('hour', ({{second_date}})::timestamp) - date_part('hour', ({{first_date}})::timestamp))\n {% elif datepart == 'minute' %}\n ({{ datediff(first_date, second_date, 'hour') }} * 60 + date_part('minute', ({{second_date}})::timestamp) - date_part('minute', ({{first_date}})::timestamp))\n {% elif datepart == 'second' %}\n ({{ datediff(first_date, second_date, 'minute') }} * 60 + floor(date_part('second', ({{second_date}})::timestamp)) - floor(date_part('second', ({{first_date}})::timestamp)))\n {% elif datepart == 'millisecond' %}\n ({{ datediff(first_date, second_date, 'minute') }} * 60000 + floor(date_part('millisecond', ({{second_date}})::timestamp)) - floor(date_part('millisecond', ({{first_date}})::timestamp)))\n {% elif datepart == 'microsecond' %}\n ({{ datediff(first_date, second_date, 'minute') }} * 60000000 + floor(date_part('microsecond', ({{second_date}})::timestamp)) - floor(date_part('microsecond', ({{first_date}})::timestamp)))\n {% else %}\n {{ exceptions.raise_compiler_error(\"Unsupported datepart for macro datediff in postgres: {!r}\".format(datepart)) }}\n {% endif %}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.datediff"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "first_date", "type": null, "description": ""}, {"name": "second_date", "type": null, "description": ""}, {"name": "datepart", "type": null, "description": ""}], "created_at": 1789422566.3151038, "supported_languages": null}, "macro.dbt_postgres.postgres__equals": {"name": "postgres__equals", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/utils/equals.sql", "original_file_path": "macros/utils/equals.sql", "unique_id": "macro.dbt_postgres.postgres__equals", "macro_sql": "{% macro postgres__equals(expr1, expr2) -%}\n{%- if adapter.behavior.enable_truthy_nulls_equals_macro.no_warn %}\n ({{ expr1 }} IS NOT DISTINCT FROM {{ expr2 }})\n{%- else -%}\n ({{ expr1 }} = {{ expr2 }})\n{%- endif %}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "expr1", "type": null, "description": ""}, {"name": "expr2", "type": null, "description": ""}], "created_at": 1789422566.315845, "supported_languages": null}, "macro.dbt_postgres.postgres__dateadd": {"name": "postgres__dateadd", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/utils/dateadd.sql", "original_file_path": "macros/utils/dateadd.sql", "unique_id": "macro.dbt_postgres.postgres__dateadd", "macro_sql": "{% macro postgres__dateadd(datepart, interval, from_date_or_timestamp) %}\n\n {{ from_date_or_timestamp }} + ((interval '1 {{ datepart }}') * ({{ interval }}))\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "datepart", "type": null, "description": ""}, {"name": "interval", "type": null, "description": ""}, {"name": "from_date_or_timestamp", "type": null, "description": ""}], "created_at": 1789422566.3163226, "supported_languages": null}, "macro.dbt_postgres.postgres__split_part": {"name": "postgres__split_part", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/utils/split_part.sql", "original_file_path": "macros/utils/split_part.sql", "unique_id": "macro.dbt_postgres.postgres__split_part", "macro_sql": "{% macro postgres__split_part(string_text, delimiter_text, part_number) %}\n\n {% if part_number >= 0 %}\n {{ dbt.default__split_part(string_text, delimiter_text, part_number) }}\n {% else %}\n {{ dbt._split_part_negative(string_text, delimiter_text, part_number) }}\n {% endif %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__split_part", "macro.dbt._split_part_negative"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "string_text", "type": null, "description": ""}, {"name": "delimiter_text", "type": null, "description": ""}, {"name": "part_number", "type": null, "description": ""}], "created_at": 1789422566.3171492, "supported_languages": null}, "macro.dbt.get_fixture_sql": {"name": "get_fixture_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/unit_test_sql/get_fixture_sql.sql", "original_file_path": "macros/unit_test_sql/get_fixture_sql.sql", "unique_id": "macro.dbt.get_fixture_sql", "macro_sql": "{% macro get_fixture_sql(rows, column_name_to_data_types) %}\n-- Fixture for {{ model.name }}\n{% set default_row = {} %}\n\n{%- if not column_name_to_data_types -%}\n{#-- Use defer_relation IFF it is available in the manifest and 'this' is missing from the database --#}\n{%- set this_or_defer_relation = defer_relation if (defer_relation and not load_relation(this)) else this -%}\n{%- set columns_in_relation = adapter.get_columns_in_relation(this_or_defer_relation) -%}\n\n{%- set column_name_to_data_types = {} -%}\n{%- set column_name_to_quoted = {} -%}\n{%- for column in columns_in_relation -%}\n\n{#-- This needs to be a case-insensitive comparison --#}\n{%- do column_name_to_data_types.update({column.name|lower: column.data_type}) -%}\n{%- do column_name_to_quoted.update({column.name|lower: column.quoted}) -%}\n{%- endfor -%}\n{%- endif -%}\n\n{%- if not column_name_to_data_types -%}\n {{ exceptions.raise_compiler_error(\"Not able to get columns for unit test '\" ~ model.name ~ \"' from relation \" ~ this ~ \" because the relation doesn't exist\") }}\n{%- endif -%}\n\n{%- for column_name, column_type in column_name_to_data_types.items() -%}\n {%- do default_row.update({column_name: (safe_cast(\"null\", column_type) | trim )}) -%}\n{%- endfor -%}\n\n{{ validate_fixture_rows(rows, row_number) }}\n\n{%- for row in rows -%}\n{%- set formatted_row = format_row(row, column_name_to_data_types) -%}\n{%- set default_row_copy = default_row.copy() -%}\n{%- do default_row_copy.update(formatted_row) -%}\nselect\n{%- for column_name, column_value in default_row_copy.items() %} {{ column_value }} as {{ column_name_to_quoted[column_name] }}{% if not loop.last -%}, {%- endif %}\n{%- endfor %}\n{%- if not loop.last %}\nunion all\n{% endif %}\n{%- endfor -%}\n\n{%- if (rows | length) == 0 -%}\n select\n {%- for column_name, column_value in default_row.items() %} {{ column_value }} as {{ column_name_to_quoted[column_name] }}{% if not loop.last -%},{%- endif %}\n {%- endfor %}\n limit 0\n{%- endif -%}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.load_relation", "macro.dbt.safe_cast", "macro.dbt.validate_fixture_rows", "macro.dbt.format_row"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "rows", "type": null, "description": ""}, {"name": "column_name_to_data_types", "type": null, "description": ""}], "created_at": 1789422566.3225598, "supported_languages": null}, "macro.dbt.get_expected_sql": {"name": "get_expected_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/unit_test_sql/get_fixture_sql.sql", "original_file_path": "macros/unit_test_sql/get_fixture_sql.sql", "unique_id": "macro.dbt.get_expected_sql", "macro_sql": "{% macro get_expected_sql(rows, column_name_to_data_types, column_name_to_quoted) %}\n\n{%- if (rows | length) == 0 -%}\n select * from dbt_internal_unit_test_actual\n limit 0\n{%- else -%}\n{%- for row in rows -%}\n{%- set formatted_row = format_row(row, column_name_to_data_types) -%}\nselect\n{%- for column_name, column_value in formatted_row.items() %} {{ column_value }} as {{ column_name_to_quoted[column_name] }}{% if not loop.last -%}, {%- endif %}\n{%- endfor %}\n{%- if not loop.last %}\nunion all\n{% endif %}\n{%- endfor -%}\n{%- endif -%}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.format_row"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "rows", "type": null, "description": ""}, {"name": "column_name_to_data_types", "type": null, "description": ""}, {"name": "column_name_to_quoted", "type": null, "description": ""}], "created_at": 1789422566.3242898, "supported_languages": null}, "macro.dbt.format_row": {"name": "format_row", "resource_type": "macro", "package_name": "dbt", "path": "macros/unit_test_sql/get_fixture_sql.sql", "original_file_path": "macros/unit_test_sql/get_fixture_sql.sql", "unique_id": "macro.dbt.format_row", "macro_sql": "\n\n{%- macro format_row(row, column_name_to_data_types) -%}\n {#-- generate case-insensitive formatted row --#}\n {% set formatted_row = {} %}\n {%- for column_name, column_value in row.items() -%}\n {% set column_name = column_name|lower %}\n\n {%- if column_name not in column_name_to_data_types %}\n {#-- if user-provided row contains column name that relation does not contain, raise an error --#}\n {% set fixture_name = \"expected output\" if model.resource_type == 'unit_test' else (\"'\" ~ model.name ~ \"'\") %}\n {{ exceptions.raise_compiler_error(\n \"Invalid column name: '\" ~ column_name ~ \"' in unit test fixture for \" ~ fixture_name ~ \".\"\n \"\\nAccepted columns for \" ~ fixture_name ~ \" are: \" ~ (column_name_to_data_types.keys()|list)\n ) }}\n {%- endif -%}\n\n {%- set column_type = column_name_to_data_types[column_name] %}\n\n {#-- For string fixture values, strip varchar length to prevent silent truncation (GH-11974) --#}\n {%- if column_value is string and 'varying' in column_type -%}\n {%- set column_type = column_type.split('(')[0] -%}\n {%- endif -%}\n\n {#-- sanitize column_value: wrap yaml strings in quotes, apply cast --#}\n {%- set column_value_clean = column_value -%}\n {%- if column_value is string -%}\n {%- set column_value_clean = dbt.string_literal(dbt.escape_single_quotes(column_value)) -%}\n {%- elif column_value is none -%}\n {%- set column_value_clean = 'null' -%}\n {%- endif -%}\n\n {%- set row_update = {column_name: safe_cast(column_value_clean, column_type) } -%}\n {%- do formatted_row.update(row_update) -%}\n {%- endfor -%}\n {{ return(formatted_row) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt.string_literal", "macro.dbt.escape_single_quotes", "macro.dbt.safe_cast"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "row", "type": null, "description": ""}, {"name": "column_name_to_data_types", "type": null, "description": ""}], "created_at": 1789422566.3269722, "supported_languages": null}, "macro.dbt.validate_fixture_rows": {"name": "validate_fixture_rows", "resource_type": "macro", "package_name": "dbt", "path": "macros/unit_test_sql/get_fixture_sql.sql", "original_file_path": "macros/unit_test_sql/get_fixture_sql.sql", "unique_id": "macro.dbt.validate_fixture_rows", "macro_sql": "{%- macro validate_fixture_rows(rows, row_number) -%}\n {{ return(adapter.dispatch('validate_fixture_rows', 'dbt')(rows, row_number)) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt.default__validate_fixture_rows"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "rows", "type": null, "description": ""}, {"name": "row_number", "type": null, "description": ""}], "created_at": 1789422566.3274496, "supported_languages": null}, "macro.dbt.default__validate_fixture_rows": {"name": "default__validate_fixture_rows", "resource_type": "macro", "package_name": "dbt", "path": "macros/unit_test_sql/get_fixture_sql.sql", "original_file_path": "macros/unit_test_sql/get_fixture_sql.sql", "unique_id": "macro.dbt.default__validate_fixture_rows", "macro_sql": "{%- macro default__validate_fixture_rows(rows, row_number) -%}\n {# This is an abstract method for adapter overrides as needed #}\n{%- endmacro -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "rows", "type": null, "description": ""}, {"name": "row_number", "type": null, "description": ""}], "created_at": 1789422566.3276994, "supported_languages": null}, "macro.dbt.get_create_sql": {"name": "get_create_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/create.sql", "original_file_path": "macros/relations/create.sql", "unique_id": "macro.dbt.get_create_sql", "macro_sql": "{%- macro get_create_sql(relation, sql) -%}\n {{- log('Applying CREATE to: ' ~ relation) -}}\n {{- adapter.dispatch('get_create_sql', 'dbt')(relation, sql) -}}\n{%- endmacro -%}\n\n\n", "depends_on": {"macros": ["macro.dbt.default__get_create_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "sql", "type": null, "description": ""}], "created_at": 1789422566.3284988, "supported_languages": null}, "macro.dbt.default__get_create_sql": {"name": "default__get_create_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/create.sql", "original_file_path": "macros/relations/create.sql", "unique_id": "macro.dbt.default__get_create_sql", "macro_sql": "{%- macro default__get_create_sql(relation, sql) -%}\n\n {%- if relation.is_view -%}\n {{ get_create_view_as_sql(relation, sql) }}\n\n {%- elif relation.is_table -%}\n {{ get_create_table_as_sql(False, relation, sql) }}\n\n {%- elif relation.is_materialized_view -%}\n {{ get_create_materialized_view_as_sql(relation, sql) }}\n\n {%- else -%}\n {{- exceptions.raise_compiler_error(\"`get_create_sql` has not been implemented for: \" ~ relation.type ) -}}\n\n {%- endif -%}\n\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt.get_create_view_as_sql", "macro.dbt.get_create_table_as_sql", "macro.dbt.get_create_materialized_view_as_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "sql", "type": null, "description": ""}], "created_at": 1789422566.3294413, "supported_languages": null}, "macro.dbt.drop_schema_named": {"name": "drop_schema_named", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/schema.sql", "original_file_path": "macros/relations/schema.sql", "unique_id": "macro.dbt.drop_schema_named", "macro_sql": "{% macro drop_schema_named(schema_name) %}\n {{ return(adapter.dispatch('drop_schema_named', 'dbt') (schema_name)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__drop_schema_named"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "schema_name", "type": null, "description": ""}], "created_at": 1789422566.3300567, "supported_languages": null}, "macro.dbt.default__drop_schema_named": {"name": "default__drop_schema_named", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/schema.sql", "original_file_path": "macros/relations/schema.sql", "unique_id": "macro.dbt.default__drop_schema_named", "macro_sql": "{% macro default__drop_schema_named(schema_name) %}\n {% set schema_relation = api.Relation.create(schema=schema_name) %}\n {{ adapter.drop_schema(schema_relation) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "schema_name", "type": null, "description": ""}], "created_at": 1789422566.3304894, "supported_languages": null}, "macro.dbt.get_create_intermediate_sql": {"name": "get_create_intermediate_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/create_intermediate.sql", "original_file_path": "macros/relations/create_intermediate.sql", "unique_id": "macro.dbt.get_create_intermediate_sql", "macro_sql": "{%- macro get_create_intermediate_sql(relation, sql) -%}\n {{- log('Applying CREATE INTERMEDIATE to: ' ~ relation) -}}\n {{- adapter.dispatch('get_create_intermediate_sql', 'dbt')(relation, sql) -}}\n{%- endmacro -%}\n\n\n", "depends_on": {"macros": ["macro.dbt.default__get_create_intermediate_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "sql", "type": null, "description": ""}], "created_at": 1789422566.3311872, "supported_languages": null}, "macro.dbt.default__get_create_intermediate_sql": {"name": "default__get_create_intermediate_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/create_intermediate.sql", "original_file_path": "macros/relations/create_intermediate.sql", "unique_id": "macro.dbt.default__get_create_intermediate_sql", "macro_sql": "{%- macro default__get_create_intermediate_sql(relation, sql) -%}\n\n -- get the standard intermediate name\n {% set intermediate_relation = make_intermediate_relation(relation) %}\n\n -- drop any pre-existing intermediate\n {{ get_drop_sql(intermediate_relation) }};\n\n {{ get_create_sql(intermediate_relation, sql) }}\n\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt.make_intermediate_relation", "macro.dbt.get_drop_sql", "macro.dbt.get_create_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "sql", "type": null, "description": ""}], "created_at": 1789422566.331728, "supported_languages": null}, "macro.dbt.get_drop_backup_sql": {"name": "get_drop_backup_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/drop_backup.sql", "original_file_path": "macros/relations/drop_backup.sql", "unique_id": "macro.dbt.get_drop_backup_sql", "macro_sql": "{%- macro get_drop_backup_sql(relation) -%}\n {{- log('Applying DROP BACKUP to: ' ~ relation) -}}\n {{- adapter.dispatch('get_drop_backup_sql', 'dbt')(relation) -}}\n{%- endmacro -%}\n\n\n", "depends_on": {"macros": ["macro.dbt.default__get_drop_backup_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789422566.33233, "supported_languages": null}, "macro.dbt.default__get_drop_backup_sql": {"name": "default__get_drop_backup_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/drop_backup.sql", "original_file_path": "macros/relations/drop_backup.sql", "unique_id": "macro.dbt.default__get_drop_backup_sql", "macro_sql": "{%- macro default__get_drop_backup_sql(relation) -%}\n\n -- get the standard backup name\n {% set backup_relation = make_backup_relation(relation, relation.type) %}\n\n {{ get_drop_sql(backup_relation) }}\n\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt.make_backup_relation", "macro.dbt.get_drop_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789422566.3327804, "supported_languages": null}, "macro.dbt.get_rename_sql": {"name": "get_rename_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/rename.sql", "original_file_path": "macros/relations/rename.sql", "unique_id": "macro.dbt.get_rename_sql", "macro_sql": "{%- macro get_rename_sql(relation, new_name) -%}\n {{- log('Applying RENAME to: ' ~ relation) -}}\n {{- adapter.dispatch('get_rename_sql', 'dbt')(relation, new_name) -}}\n{%- endmacro -%}\n\n\n", "depends_on": {"macros": ["macro.dbt.default__get_rename_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "new_name", "type": null, "description": ""}], "created_at": 1789422566.333704, "supported_languages": null}, "macro.dbt.default__get_rename_sql": {"name": "default__get_rename_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/rename.sql", "original_file_path": "macros/relations/rename.sql", "unique_id": "macro.dbt.default__get_rename_sql", "macro_sql": "{%- macro default__get_rename_sql(relation, new_name) -%}\n\n {%- if relation.is_view -%}\n {{ get_rename_view_sql(relation, new_name) }}\n\n {%- elif relation.is_table -%}\n {{ get_rename_table_sql(relation, new_name) }}\n\n {%- elif relation.is_materialized_view -%}\n {{ get_rename_materialized_view_sql(relation, new_name) }}\n\n {%- else -%}\n {{- exceptions.raise_compiler_error(\"`get_rename_sql` has not been implemented for: \" ~ relation.type ) -}}\n\n {%- endif -%}\n\n{%- endmacro -%}\n\n\n", "depends_on": {"macros": ["macro.dbt.get_rename_view_sql", "macro.dbt.get_rename_table_sql", "macro.dbt.get_rename_materialized_view_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "new_name", "type": null, "description": ""}], "created_at": 1789422566.3346136, "supported_languages": null}, "macro.dbt.rename_relation": {"name": "rename_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/rename.sql", "original_file_path": "macros/relations/rename.sql", "unique_id": "macro.dbt.rename_relation", "macro_sql": "{% macro rename_relation(from_relation, to_relation) -%}\n {{ return(adapter.dispatch('rename_relation', 'dbt')(from_relation, to_relation)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__rename_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "from_relation", "type": null, "description": ""}, {"name": "to_relation", "type": null, "description": ""}], "created_at": 1789422566.335042, "supported_languages": null}, "macro.dbt.default__rename_relation": {"name": "default__rename_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/rename.sql", "original_file_path": "macros/relations/rename.sql", "unique_id": "macro.dbt.default__rename_relation", "macro_sql": "{% macro default__rename_relation(from_relation, to_relation) -%}\n {% set target_name = adapter.quote_as_configured(to_relation.identifier, 'identifier') %}\n {% call statement('rename_relation') -%}\n alter table {{ from_relation.render() }} rename to {{ target_name }}\n {%- endcall %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "from_relation", "type": null, "description": ""}, {"name": "to_relation", "type": null, "description": ""}], "created_at": 1789422566.33569, "supported_languages": null}, "macro.dbt.get_drop_sql": {"name": "get_drop_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/drop.sql", "original_file_path": "macros/relations/drop.sql", "unique_id": "macro.dbt.get_drop_sql", "macro_sql": "{%- macro get_drop_sql(relation) -%}\n {{- log('Applying DROP to: ' ~ relation) -}}\n {{- adapter.dispatch('get_drop_sql', 'dbt')(relation) -}}\n{%- endmacro -%}\n\n\n", "depends_on": {"macros": ["macro.dbt.default__get_drop_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789422566.336595, "supported_languages": null}, "macro.dbt.default__get_drop_sql": {"name": "default__get_drop_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/drop.sql", "original_file_path": "macros/relations/drop.sql", "unique_id": "macro.dbt.default__get_drop_sql", "macro_sql": "{%- macro default__get_drop_sql(relation) -%}\n\n {%- if relation.is_view -%}\n {{ drop_view(relation) }}\n\n {%- elif relation.is_table -%}\n {{ drop_table(relation) }}\n\n {%- elif relation.is_materialized_view -%}\n {{ drop_materialized_view(relation) }}\n\n {%- else -%}\n drop {{ relation.type }} if exists {{ relation.render() }} cascade\n\n {%- endif -%}\n\n{%- endmacro -%}\n\n\n", "depends_on": {"macros": ["macro.dbt.drop_view", "macro.dbt.drop_table", "macro.dbt.drop_materialized_view"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789422566.3375607, "supported_languages": null}, "macro.dbt.drop_relation": {"name": "drop_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/drop.sql", "original_file_path": "macros/relations/drop.sql", "unique_id": "macro.dbt.drop_relation", "macro_sql": "{% macro drop_relation(relation) -%}\n {{ return(adapter.dispatch('drop_relation', 'dbt')(relation)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__drop_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789422566.337949, "supported_languages": null}, "macro.dbt.default__drop_relation": {"name": "default__drop_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/drop.sql", "original_file_path": "macros/relations/drop.sql", "unique_id": "macro.dbt.default__drop_relation", "macro_sql": "{% macro default__drop_relation(relation) -%}\n {% call statement('drop_relation', auto_begin=False) -%}\n {{ get_drop_sql(relation) }}\n {%- endcall %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement", "macro.dbt.get_drop_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789422566.3383658, "supported_languages": null}, "macro.dbt.drop_relation_if_exists": {"name": "drop_relation_if_exists", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/drop.sql", "original_file_path": "macros/relations/drop.sql", "unique_id": "macro.dbt.drop_relation_if_exists", "macro_sql": "{% macro drop_relation_if_exists(relation) %}\n {% if relation is not none %}\n {{ adapter.drop_relation(relation) }}\n {% endif %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789422566.3387935, "supported_languages": null}, "macro.dbt.get_rename_intermediate_sql": {"name": "get_rename_intermediate_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/rename_intermediate.sql", "original_file_path": "macros/relations/rename_intermediate.sql", "unique_id": "macro.dbt.get_rename_intermediate_sql", "macro_sql": "{%- macro get_rename_intermediate_sql(relation) -%}\n {{- log('Applying RENAME INTERMEDIATE to: ' ~ relation) -}}\n {{- adapter.dispatch('get_rename_intermediate_sql', 'dbt')(relation) -}}\n{%- endmacro -%}\n\n\n", "depends_on": {"macros": ["macro.dbt.default__get_rename_intermediate_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789422566.3394024, "supported_languages": null}, "macro.dbt.default__get_rename_intermediate_sql": {"name": "default__get_rename_intermediate_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/rename_intermediate.sql", "original_file_path": "macros/relations/rename_intermediate.sql", "unique_id": "macro.dbt.default__get_rename_intermediate_sql", "macro_sql": "{%- macro default__get_rename_intermediate_sql(relation) -%}\n\n -- get the standard intermediate name\n {% set intermediate_relation = make_intermediate_relation(relation) %}\n\n {{ get_rename_sql(intermediate_relation, relation.identifier) }}\n\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt.make_intermediate_relation", "macro.dbt.get_rename_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789422566.3398528, "supported_languages": null}, "macro.dbt.get_replace_sql": {"name": "get_replace_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/replace.sql", "original_file_path": "macros/relations/replace.sql", "unique_id": "macro.dbt.get_replace_sql", "macro_sql": "{% macro get_replace_sql(existing_relation, target_relation, sql) %}\n {{- log('Applying REPLACE to: ' ~ existing_relation) -}}\n {{- adapter.dispatch('get_replace_sql', 'dbt')(existing_relation, target_relation, sql) -}}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_replace_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "existing_relation", "type": null, "description": ""}, {"name": "target_relation", "type": null, "description": ""}, {"name": "sql", "type": null, "description": ""}], "created_at": 1789422566.3409288, "supported_languages": null}, "macro.dbt.default__get_replace_sql": {"name": "default__get_replace_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/replace.sql", "original_file_path": "macros/relations/replace.sql", "unique_id": "macro.dbt.default__get_replace_sql", "macro_sql": "{% macro default__get_replace_sql(existing_relation, target_relation, sql) %}\n\n {# /* use a create or replace statement if possible */ #}\n\n {% set is_replaceable = existing_relation.type == target_relation.type and existing_relation.can_be_replaced %}\n\n {% if is_replaceable and existing_relation.is_view %}\n {{ get_replace_view_sql(target_relation, sql) }}\n\n {% elif is_replaceable and existing_relation.is_table %}\n {{ get_replace_table_sql(target_relation, sql) }}\n\n {% elif is_replaceable and existing_relation.is_materialized_view %}\n {{ get_replace_materialized_view_sql(target_relation, sql) }}\n\n {# /* a create or replace statement is not possible, so try to stage and/or backup to be safe */ #}\n\n {# /* create target_relation as an intermediate relation, then swap it out with the existing one using a backup */ #}\n {%- elif target_relation.can_be_renamed and existing_relation.can_be_renamed -%}\n {{ get_create_intermediate_sql(target_relation, sql) }};\n {{ get_create_backup_sql(existing_relation) }};\n {{ get_rename_intermediate_sql(target_relation) }};\n {{ get_drop_backup_sql(existing_relation) }}\n\n {# /* create target_relation as an intermediate relation, then swap it out with the existing one without using a backup */ #}\n {%- elif target_relation.can_be_renamed -%}\n {{ get_create_intermediate_sql(target_relation, sql) }};\n {{ get_drop_sql(existing_relation) }};\n {{ get_rename_intermediate_sql(target_relation) }}\n\n {# /* create target_relation in place by first backing up the existing relation */ #}\n {%- elif existing_relation.can_be_renamed -%}\n {{ get_create_backup_sql(existing_relation) }};\n {{ get_create_sql(target_relation, sql) }};\n {{ get_drop_backup_sql(existing_relation) }}\n\n {# /* no renaming is allowed, so just drop and create */ #}\n {%- else -%}\n {{ get_drop_sql(existing_relation) }};\n {{ get_create_sql(target_relation, sql) }}\n\n {%- endif -%}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_replace_view_sql", "macro.dbt.get_replace_table_sql", "macro.dbt.get_replace_materialized_view_sql", "macro.dbt.get_create_intermediate_sql", "macro.dbt.get_create_backup_sql", "macro.dbt.get_rename_intermediate_sql", "macro.dbt.get_drop_backup_sql", "macro.dbt.get_drop_sql", "macro.dbt.get_create_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "existing_relation", "type": null, "description": ""}, {"name": "target_relation", "type": null, "description": ""}, {"name": "sql", "type": null, "description": ""}], "created_at": 1789422566.3433557, "supported_languages": null}, "macro.dbt.get_create_backup_sql": {"name": "get_create_backup_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/create_backup.sql", "original_file_path": "macros/relations/create_backup.sql", "unique_id": "macro.dbt.get_create_backup_sql", "macro_sql": "{%- macro get_create_backup_sql(relation) -%}\n {{- log('Applying CREATE BACKUP to: ' ~ relation) -}}\n {{- adapter.dispatch('get_create_backup_sql', 'dbt')(relation) -}}\n{%- endmacro -%}\n\n\n", "depends_on": {"macros": ["macro.dbt.default__get_create_backup_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789422566.3440492, "supported_languages": null}, "macro.dbt.default__get_create_backup_sql": {"name": "default__get_create_backup_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/create_backup.sql", "original_file_path": "macros/relations/create_backup.sql", "unique_id": "macro.dbt.default__get_create_backup_sql", "macro_sql": "{%- macro default__get_create_backup_sql(relation) -%}\n\n -- get the standard backup name\n {% set backup_relation = make_backup_relation(relation, relation.type) %}\n\n -- drop any pre-existing backup\n {{ get_drop_sql(backup_relation) }};\n\n {{ get_rename_sql(relation, backup_relation.identifier) }}\n\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt.make_backup_relation", "macro.dbt.get_drop_sql", "macro.dbt.get_rename_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789422566.3446255, "supported_languages": null}, "macro.dbt.get_create_materialized_view_as_sql": {"name": "get_create_materialized_view_as_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/materialized_view/create.sql", "original_file_path": "macros/relations/materialized_view/create.sql", "unique_id": "macro.dbt.get_create_materialized_view_as_sql", "macro_sql": "{% macro get_create_materialized_view_as_sql(relation, sql) -%}\n {{- adapter.dispatch('get_create_materialized_view_as_sql', 'dbt')(relation, sql) -}}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__get_create_materialized_view_as_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "sql", "type": null, "description": ""}], "created_at": 1789422566.345163, "supported_languages": null}, "macro.dbt.default__get_create_materialized_view_as_sql": {"name": "default__get_create_materialized_view_as_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/materialized_view/create.sql", "original_file_path": "macros/relations/materialized_view/create.sql", "unique_id": "macro.dbt.default__get_create_materialized_view_as_sql", "macro_sql": "{% macro default__get_create_materialized_view_as_sql(relation, sql) -%}\n {{ exceptions.raise_compiler_error(\n \"`get_create_materialized_view_as_sql` has not been implemented for this adapter.\"\n ) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "sql", "type": null, "description": ""}], "created_at": 1789422566.3454645, "supported_languages": null}, "macro.dbt.get_alter_materialized_view_as_sql": {"name": "get_alter_materialized_view_as_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/materialized_view/alter.sql", "original_file_path": "macros/relations/materialized_view/alter.sql", "unique_id": "macro.dbt.get_alter_materialized_view_as_sql", "macro_sql": "{% macro get_alter_materialized_view_as_sql(\n relation,\n configuration_changes,\n sql,\n existing_relation,\n backup_relation,\n intermediate_relation\n) %}\n {{- log('Applying ALTER to: ' ~ relation) -}}\n {{- adapter.dispatch('get_alter_materialized_view_as_sql', 'dbt')(\n relation,\n configuration_changes,\n sql,\n existing_relation,\n backup_relation,\n intermediate_relation\n ) -}}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__get_alter_materialized_view_as_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "configuration_changes", "type": null, "description": ""}, {"name": "sql", "type": null, "description": ""}, {"name": "existing_relation", "type": null, "description": ""}, {"name": "backup_relation", "type": null, "description": ""}, {"name": "intermediate_relation", "type": null, "description": ""}], "created_at": 1789422566.3465042, "supported_languages": null}, "macro.dbt.default__get_alter_materialized_view_as_sql": {"name": "default__get_alter_materialized_view_as_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/materialized_view/alter.sql", "original_file_path": "macros/relations/materialized_view/alter.sql", "unique_id": "macro.dbt.default__get_alter_materialized_view_as_sql", "macro_sql": "{% macro default__get_alter_materialized_view_as_sql(\n relation,\n configuration_changes,\n sql,\n existing_relation,\n backup_relation,\n intermediate_relation\n) %}\n {{ exceptions.raise_compiler_error(\"Materialized views have not been implemented for this adapter.\") }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "configuration_changes", "type": null, "description": ""}, {"name": "sql", "type": null, "description": ""}, {"name": "existing_relation", "type": null, "description": ""}, {"name": "backup_relation", "type": null, "description": ""}, {"name": "intermediate_relation", "type": null, "description": ""}], "created_at": 1789422566.346919, "supported_languages": null}, "macro.dbt.get_materialized_view_configuration_changes": {"name": "get_materialized_view_configuration_changes", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/materialized_view/alter.sql", "original_file_path": "macros/relations/materialized_view/alter.sql", "unique_id": "macro.dbt.get_materialized_view_configuration_changes", "macro_sql": "{% macro get_materialized_view_configuration_changes(existing_relation, new_config) %}\n /* {#\n It's recommended that configuration changes be formatted as follows:\n {\"\": [{\"action\": \"\", \"context\": ...}]}\n\n For example:\n {\n \"indexes\": [\n {\"action\": \"drop\", \"context\": \"index_abc\"},\n {\"action\": \"create\", \"context\": {\"columns\": [\"column_1\", \"column_2\"], \"type\": \"hash\", \"unique\": True}},\n ],\n }\n\n Either way, `get_materialized_view_configuration_changes` needs to align with `get_alter_materialized_view_as_sql`.\n #} */\n {{- log('Determining configuration changes on: ' ~ existing_relation) -}}\n {%- do return(adapter.dispatch('get_materialized_view_configuration_changes', 'dbt')(existing_relation, new_config)) -%}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__get_materialized_view_configuration_changes"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "existing_relation", "type": null, "description": ""}, {"name": "new_config", "type": null, "description": ""}], "created_at": 1789422566.3474896, "supported_languages": null}, "macro.dbt.default__get_materialized_view_configuration_changes": {"name": "default__get_materialized_view_configuration_changes", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/materialized_view/alter.sql", "original_file_path": "macros/relations/materialized_view/alter.sql", "unique_id": "macro.dbt.default__get_materialized_view_configuration_changes", "macro_sql": "{% macro default__get_materialized_view_configuration_changes(existing_relation, new_config) %}\n {{ exceptions.raise_compiler_error(\"Materialized views have not been implemented for this adapter.\") }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "existing_relation", "type": null, "description": ""}, {"name": "new_config", "type": null, "description": ""}], "created_at": 1789422566.3478215, "supported_languages": null}, "macro.dbt.get_rename_materialized_view_sql": {"name": "get_rename_materialized_view_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/materialized_view/rename.sql", "original_file_path": "macros/relations/materialized_view/rename.sql", "unique_id": "macro.dbt.get_rename_materialized_view_sql", "macro_sql": "{% macro get_rename_materialized_view_sql(relation, new_name) %}\n {{- adapter.dispatch('get_rename_materialized_view_sql', 'dbt')(relation, new_name) -}}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__get_rename_materialized_view_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "new_name", "type": null, "description": ""}], "created_at": 1789422566.3483796, "supported_languages": null}, "macro.dbt.default__get_rename_materialized_view_sql": {"name": "default__get_rename_materialized_view_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/materialized_view/rename.sql", "original_file_path": "macros/relations/materialized_view/rename.sql", "unique_id": "macro.dbt.default__get_rename_materialized_view_sql", "macro_sql": "{% macro default__get_rename_materialized_view_sql(relation, new_name) %}\n {{ exceptions.raise_compiler_error(\n \"`get_rename_materialized_view_sql` has not been implemented for this adapter.\"\n ) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "new_name", "type": null, "description": ""}], "created_at": 1789422566.3489113, "supported_languages": null}, "macro.dbt.refresh_materialized_view": {"name": "refresh_materialized_view", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/materialized_view/refresh.sql", "original_file_path": "macros/relations/materialized_view/refresh.sql", "unique_id": "macro.dbt.refresh_materialized_view", "macro_sql": "{% macro refresh_materialized_view(relation) %}\n {{- log('Applying REFRESH to: ' ~ relation) -}}\n {{- adapter.dispatch('refresh_materialized_view', 'dbt')(relation) -}}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__refresh_materialized_view"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789422566.3495524, "supported_languages": null}, "macro.dbt.default__refresh_materialized_view": {"name": "default__refresh_materialized_view", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/materialized_view/refresh.sql", "original_file_path": "macros/relations/materialized_view/refresh.sql", "unique_id": "macro.dbt.default__refresh_materialized_view", "macro_sql": "{% macro default__refresh_materialized_view(relation) %}\n {{ exceptions.raise_compiler_error(\"`refresh_materialized_view` has not been implemented for this adapter.\") }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789422566.349849, "supported_languages": null}, "macro.dbt.drop_materialized_view": {"name": "drop_materialized_view", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/materialized_view/drop.sql", "original_file_path": "macros/relations/materialized_view/drop.sql", "unique_id": "macro.dbt.drop_materialized_view", "macro_sql": "{% macro drop_materialized_view(relation) -%}\n {{- adapter.dispatch('drop_materialized_view', 'dbt')(relation) -}}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__drop_materialized_view"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789422566.3503485, "supported_languages": null}, "macro.dbt.default__drop_materialized_view": {"name": "default__drop_materialized_view", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/materialized_view/drop.sql", "original_file_path": "macros/relations/materialized_view/drop.sql", "unique_id": "macro.dbt.default__drop_materialized_view", "macro_sql": "{% macro default__drop_materialized_view(relation) -%}\n drop materialized view if exists {{ relation.render() }} cascade\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789422566.3506382, "supported_languages": null}, "macro.dbt.get_replace_materialized_view_sql": {"name": "get_replace_materialized_view_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/materialized_view/replace.sql", "original_file_path": "macros/relations/materialized_view/replace.sql", "unique_id": "macro.dbt.get_replace_materialized_view_sql", "macro_sql": "{% macro get_replace_materialized_view_sql(relation, sql) %}\n {{- adapter.dispatch('get_replace_materialized_view_sql', 'dbt')(relation, sql) -}}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_replace_materialized_view_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "sql", "type": null, "description": ""}], "created_at": 1789422566.3511674, "supported_languages": null}, "macro.dbt.default__get_replace_materialized_view_sql": {"name": "default__get_replace_materialized_view_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/materialized_view/replace.sql", "original_file_path": "macros/relations/materialized_view/replace.sql", "unique_id": "macro.dbt.default__get_replace_materialized_view_sql", "macro_sql": "{% macro default__get_replace_materialized_view_sql(relation, sql) %}\n {{ exceptions.raise_compiler_error(\n \"`get_replace_materialized_view_sql` has not been implemented for this adapter.\"\n ) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "sql", "type": null, "description": ""}], "created_at": 1789422566.351471, "supported_languages": null}, "macro.dbt.get_create_view_as_sql": {"name": "get_create_view_as_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/view/create.sql", "original_file_path": "macros/relations/view/create.sql", "unique_id": "macro.dbt.get_create_view_as_sql", "macro_sql": "{% macro get_create_view_as_sql(relation, sql) -%}\n {{ adapter.dispatch('get_create_view_as_sql', 'dbt')(relation, sql) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_create_view_as_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "sql", "type": null, "description": ""}], "created_at": 1789422566.3521984, "supported_languages": null}, "macro.dbt.default__get_create_view_as_sql": {"name": "default__get_create_view_as_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/view/create.sql", "original_file_path": "macros/relations/view/create.sql", "unique_id": "macro.dbt.default__get_create_view_as_sql", "macro_sql": "{% macro default__get_create_view_as_sql(relation, sql) -%}\n {{ return(create_view_as(relation, sql)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.create_view_as"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "sql", "type": null, "description": ""}], "created_at": 1789422566.3525555, "supported_languages": null}, "macro.dbt.create_view_as": {"name": "create_view_as", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/view/create.sql", "original_file_path": "macros/relations/view/create.sql", "unique_id": "macro.dbt.create_view_as", "macro_sql": "{% macro create_view_as(relation, sql) -%}\n {{ adapter.dispatch('create_view_as', 'dbt')(relation, sql) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__create_view_as"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "sql", "type": null, "description": ""}], "created_at": 1789422566.3529282, "supported_languages": null}, "macro.dbt.default__create_view_as": {"name": "default__create_view_as", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/view/create.sql", "original_file_path": "macros/relations/view/create.sql", "unique_id": "macro.dbt.default__create_view_as", "macro_sql": "{% macro default__create_view_as(relation, sql) -%}\n {%- set sql_header = config.get('sql_header', none) -%}\n\n {{ sql_header if sql_header is not none }}\n create view {{ relation.render() }}\n {% set contract_config = config.get('contract') %}\n {% if contract_config.enforced %}\n {{ get_assert_columns_equivalent(sql) }}\n {%- endif %}\n as (\n {{ sql }}\n );\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.get_assert_columns_equivalent"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "sql", "type": null, "description": ""}], "created_at": 1789422566.3538282, "supported_languages": null}, "macro.dbt.get_rename_view_sql": {"name": "get_rename_view_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/view/rename.sql", "original_file_path": "macros/relations/view/rename.sql", "unique_id": "macro.dbt.get_rename_view_sql", "macro_sql": "{% macro get_rename_view_sql(relation, new_name) %}\n {{- adapter.dispatch('get_rename_view_sql', 'dbt')(relation, new_name) -}}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__get_rename_view_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "new_name", "type": null, "description": ""}], "created_at": 1789422566.3543596, "supported_languages": null}, "macro.dbt.default__get_rename_view_sql": {"name": "default__get_rename_view_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/view/rename.sql", "original_file_path": "macros/relations/view/rename.sql", "unique_id": "macro.dbt.default__get_rename_view_sql", "macro_sql": "{% macro default__get_rename_view_sql(relation, new_name) %}\n {{ exceptions.raise_compiler_error(\n \"`get_rename_view_sql` has not been implemented for this adapter.\"\n ) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "new_name", "type": null, "description": ""}], "created_at": 1789422566.3546846, "supported_languages": null}, "macro.dbt.drop_view": {"name": "drop_view", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/view/drop.sql", "original_file_path": "macros/relations/view/drop.sql", "unique_id": "macro.dbt.drop_view", "macro_sql": "{% macro drop_view(relation) -%}\n {{- adapter.dispatch('drop_view', 'dbt')(relation) -}}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__drop_view"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789422566.355162, "supported_languages": null}, "macro.dbt.default__drop_view": {"name": "default__drop_view", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/view/drop.sql", "original_file_path": "macros/relations/view/drop.sql", "unique_id": "macro.dbt.default__drop_view", "macro_sql": "{% macro default__drop_view(relation) -%}\n drop view if exists {{ relation.render() }} cascade\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789422566.3554144, "supported_languages": null}, "macro.dbt.get_replace_view_sql": {"name": "get_replace_view_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/view/replace.sql", "original_file_path": "macros/relations/view/replace.sql", "unique_id": "macro.dbt.get_replace_view_sql", "macro_sql": "{% macro get_replace_view_sql(relation, sql) %}\n {{- adapter.dispatch('get_replace_view_sql', 'dbt')(relation, sql) -}}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__get_replace_view_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "sql", "type": null, "description": ""}], "created_at": 1789422566.3563964, "supported_languages": null}, "macro.dbt.default__get_replace_view_sql": {"name": "default__get_replace_view_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/view/replace.sql", "original_file_path": "macros/relations/view/replace.sql", "unique_id": "macro.dbt.default__get_replace_view_sql", "macro_sql": "{% macro default__get_replace_view_sql(relation, sql) %}\n {{ exceptions.raise_compiler_error(\n \"`get_replace_view_sql` has not been implemented for this adapter.\"\n ) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "sql", "type": null, "description": ""}], "created_at": 1789422566.3568575, "supported_languages": null}, "macro.dbt.create_or_replace_view": {"name": "create_or_replace_view", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/view/replace.sql", "original_file_path": "macros/relations/view/replace.sql", "unique_id": "macro.dbt.create_or_replace_view", "macro_sql": "{% macro create_or_replace_view() %}\n {%- set identifier = model['alias'] -%}\n\n {%- set old_relation = adapter.get_relation(database=database, schema=schema, identifier=identifier) -%}\n {%- set exists_as_view = (old_relation is not none and old_relation.is_view) -%}\n\n {%- set target_relation = api.Relation.create(\n identifier=identifier, schema=schema, database=database,\n type='view') -%}\n {% set grant_config = config.get('grants') %}\n\n {{ run_hooks(pre_hooks) }}\n\n -- If there's a table with the same name and we weren't told to full refresh,\n -- that's an error. If we were told to full refresh, drop it. This behavior differs\n -- for Snowflake and BigQuery, so multiple dispatch is used.\n {%- if old_relation is not none and old_relation.is_table -%}\n {{ handle_existing_table(should_full_refresh(), old_relation) }}\n {%- endif -%}\n\n -- build model\n {% call statement('main') -%}\n {{ get_create_view_as_sql(target_relation, sql) }}\n {%- endcall %}\n\n {% set should_revoke = should_revoke(exists_as_view, full_refresh_mode=True) %}\n {% do apply_grants(target_relation, grant_config, should_revoke=should_revoke) %}\n\n {{ run_hooks(post_hooks) }}\n\n {{ return({'relations': [target_relation]}) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.run_hooks", "macro.dbt.handle_existing_table", "macro.dbt.should_full_refresh", "macro.dbt.statement", "macro.dbt.get_create_view_as_sql", "macro.dbt.should_revoke", "macro.dbt.apply_grants"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789422566.3591506, "supported_languages": null}, "macro.dbt.handle_existing_table": {"name": "handle_existing_table", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/view/replace.sql", "original_file_path": "macros/relations/view/replace.sql", "unique_id": "macro.dbt.handle_existing_table", "macro_sql": "{% macro handle_existing_table(full_refresh, old_relation) %}\n {{ adapter.dispatch('handle_existing_table', 'dbt')(full_refresh, old_relation) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__handle_existing_table"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "full_refresh", "type": null, "description": ""}, {"name": "old_relation", "type": null, "description": ""}], "created_at": 1789422566.3595805, "supported_languages": null}, "macro.dbt.default__handle_existing_table": {"name": "default__handle_existing_table", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/view/replace.sql", "original_file_path": "macros/relations/view/replace.sql", "unique_id": "macro.dbt.default__handle_existing_table", "macro_sql": "{% macro default__handle_existing_table(full_refresh, old_relation) %}\n {{ log(\"Dropping relation \" ~ old_relation.render() ~ \" because it is of type \" ~ old_relation.type) }}\n {{ adapter.drop_relation(old_relation) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "full_refresh", "type": null, "description": ""}, {"name": "old_relation", "type": null, "description": ""}], "created_at": 1789422566.3600807, "supported_languages": null}, "macro.dbt.get_table_columns_and_constraints": {"name": "get_table_columns_and_constraints", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/column/columns_spec_ddl.sql", "original_file_path": "macros/relations/column/columns_spec_ddl.sql", "unique_id": "macro.dbt.get_table_columns_and_constraints", "macro_sql": "{%- macro get_table_columns_and_constraints() -%}\n {{ adapter.dispatch('get_table_columns_and_constraints', 'dbt')() }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt.default__get_table_columns_and_constraints"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789422566.3617125, "supported_languages": null}, "macro.dbt.default__get_table_columns_and_constraints": {"name": "default__get_table_columns_and_constraints", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/column/columns_spec_ddl.sql", "original_file_path": "macros/relations/column/columns_spec_ddl.sql", "unique_id": "macro.dbt.default__get_table_columns_and_constraints", "macro_sql": "{% macro default__get_table_columns_and_constraints() -%}\n {{ return(table_columns_and_constraints()) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.table_columns_and_constraints"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789422566.3619745, "supported_languages": null}, "macro.dbt.table_columns_and_constraints": {"name": "table_columns_and_constraints", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/column/columns_spec_ddl.sql", "original_file_path": "macros/relations/column/columns_spec_ddl.sql", "unique_id": "macro.dbt.table_columns_and_constraints", "macro_sql": "{% macro table_columns_and_constraints() %}\n {# loop through user_provided_columns to create DDL with data types and constraints #}\n {%- set raw_column_constraints = adapter.render_raw_columns_constraints(raw_columns=model['columns']) -%}\n {%- set raw_model_constraints = adapter.render_raw_model_constraints(raw_constraints=model['constraints']) -%}\n (\n {% for c in raw_column_constraints -%}\n {{ c }}{{ \",\" if not loop.last or raw_model_constraints }}\n {% endfor %}\n {% for c in raw_model_constraints -%}\n {{ c }}{{ \",\" if not loop.last }}\n {% endfor -%}\n )\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789422566.3630724, "supported_languages": null}, "macro.dbt.get_assert_columns_equivalent": {"name": "get_assert_columns_equivalent", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/column/columns_spec_ddl.sql", "original_file_path": "macros/relations/column/columns_spec_ddl.sql", "unique_id": "macro.dbt.get_assert_columns_equivalent", "macro_sql": "\n\n{%- macro get_assert_columns_equivalent(sql) -%}\n {{ adapter.dispatch('get_assert_columns_equivalent', 'dbt')(sql) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt.default__get_assert_columns_equivalent"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "sql", "type": null, "description": ""}], "created_at": 1789422566.36341, "supported_languages": null}, "macro.dbt.default__get_assert_columns_equivalent": {"name": "default__get_assert_columns_equivalent", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/column/columns_spec_ddl.sql", "original_file_path": "macros/relations/column/columns_spec_ddl.sql", "unique_id": "macro.dbt.default__get_assert_columns_equivalent", "macro_sql": "{% macro default__get_assert_columns_equivalent(sql) -%}\n {{ return(assert_columns_equivalent(sql)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.assert_columns_equivalent"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "sql", "type": null, "description": ""}], "created_at": 1789422566.3637156, "supported_languages": null}, "macro.dbt.assert_columns_equivalent": {"name": "assert_columns_equivalent", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/column/columns_spec_ddl.sql", "original_file_path": "macros/relations/column/columns_spec_ddl.sql", "unique_id": "macro.dbt.assert_columns_equivalent", "macro_sql": "{% macro assert_columns_equivalent(sql) %}\n\n {#-- First ensure the user has defined 'columns' in yaml specification --#}\n {%- set user_defined_columns = model['columns'] -%}\n {%- if not user_defined_columns -%}\n {{ exceptions.raise_contract_error([], []) }}\n {%- endif -%}\n\n {#-- Obtain the column schema provided by sql file. #}\n {%- set sql_file_provided_columns = get_column_schema_from_query(sql, config.get('sql_header', none)) -%}\n {#--Obtain the column schema provided by the schema file by generating an 'empty schema' query from the model's columns. #}\n {%- set schema_file_provided_columns = get_column_schema_from_query(get_empty_schema_sql(user_defined_columns)) -%}\n\n {#-- create dictionaries with name and formatted data type and strings for exception #}\n {%- set sql_columns = format_columns(sql_file_provided_columns) -%}\n {%- set yaml_columns = format_columns(schema_file_provided_columns) -%}\n\n {%- if sql_columns|length != yaml_columns|length -%}\n {%- do exceptions.raise_contract_error(yaml_columns, sql_columns) -%}\n {%- endif -%}\n\n {%- for sql_col in sql_columns -%}\n {%- set yaml_col = [] -%}\n {%- for this_col in yaml_columns -%}\n {%- if this_col['name'] == sql_col['name'] -%}\n {%- do yaml_col.append(this_col) -%}\n {%- break -%}\n {%- endif -%}\n {%- endfor -%}\n {%- if not yaml_col -%}\n {#-- Column with name not found in yaml #}\n {%- do exceptions.raise_contract_error(yaml_columns, sql_columns) -%}\n {%- endif -%}\n {%- if sql_col['formatted'] != yaml_col[0]['formatted'] -%}\n {#-- Column data types don't match #}\n {%- do exceptions.raise_contract_error(yaml_columns, sql_columns) -%}\n {%- endif -%}\n {%- endfor -%}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_column_schema_from_query", "macro.dbt.get_empty_schema_sql", "macro.dbt.format_columns"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "sql", "type": null, "description": ""}], "created_at": 1789422566.3663154, "supported_languages": null}, "macro.dbt.format_columns": {"name": "format_columns", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/column/columns_spec_ddl.sql", "original_file_path": "macros/relations/column/columns_spec_ddl.sql", "unique_id": "macro.dbt.format_columns", "macro_sql": "{% macro format_columns(columns) %}\n {% set formatted_columns = [] %}\n {% for column in columns %}\n {%- set formatted_column = adapter.dispatch('format_column', 'dbt')(column) -%}\n {%- do formatted_columns.append(formatted_column) -%}\n {% endfor %}\n {{ return(formatted_columns) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__format_column"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "columns", "type": null, "description": ""}], "created_at": 1789422566.367107, "supported_languages": null}, "macro.dbt.default__format_column": {"name": "default__format_column", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/column/columns_spec_ddl.sql", "original_file_path": "macros/relations/column/columns_spec_ddl.sql", "unique_id": "macro.dbt.default__format_column", "macro_sql": "{% macro default__format_column(column) -%}\n {% set data_type = column.dtype %}\n {% set formatted = column.column.lower() ~ \" \" ~ data_type %}\n {{ return({'name': column.name, 'data_type': data_type, 'formatted': formatted}) }}\n{%- endmacro -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "column", "type": null, "description": ""}], "created_at": 1789422566.3678143, "supported_languages": null}, "macro.dbt.get_create_table_as_sql": {"name": "get_create_table_as_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/table/create.sql", "original_file_path": "macros/relations/table/create.sql", "unique_id": "macro.dbt.get_create_table_as_sql", "macro_sql": "{% macro get_create_table_as_sql(temporary, relation, sql) -%}\n {{ adapter.dispatch('get_create_table_as_sql', 'dbt')(temporary, relation, sql) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_create_table_as_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "temporary", "type": null, "description": ""}, {"name": "relation", "type": null, "description": ""}, {"name": "sql", "type": null, "description": ""}], "created_at": 1789422566.3690455, "supported_languages": null}, "macro.dbt.default__get_create_table_as_sql": {"name": "default__get_create_table_as_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/table/create.sql", "original_file_path": "macros/relations/table/create.sql", "unique_id": "macro.dbt.default__get_create_table_as_sql", "macro_sql": "{% macro default__get_create_table_as_sql(temporary, relation, sql) -%}\n {{ return(create_table_as(temporary, relation, sql)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.create_table_as"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "temporary", "type": null, "description": ""}, {"name": "relation", "type": null, "description": ""}, {"name": "sql", "type": null, "description": ""}], "created_at": 1789422566.369427, "supported_languages": null}, "macro.dbt.create_table_as": {"name": "create_table_as", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/table/create.sql", "original_file_path": "macros/relations/table/create.sql", "unique_id": "macro.dbt.create_table_as", "macro_sql": "{% macro create_table_as(temporary, relation, compiled_code, language='sql') -%}\n {# backward compatibility for create_table_as that does not support language #}\n {% if language == \"sql\" %}\n {{ adapter.dispatch('create_table_as', 'dbt')(temporary, relation, compiled_code)}}\n {% else %}\n {{ adapter.dispatch('create_table_as', 'dbt')(temporary, relation, compiled_code, language) }}\n {% endif %}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__create_table_as"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "temporary", "type": null, "description": ""}, {"name": "relation", "type": null, "description": ""}, {"name": "compiled_code", "type": null, "description": ""}, {"name": "language", "type": null, "description": ""}], "created_at": 1789422566.3704698, "supported_languages": null}, "macro.dbt.default__create_table_as": {"name": "default__create_table_as", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/table/create.sql", "original_file_path": "macros/relations/table/create.sql", "unique_id": "macro.dbt.default__create_table_as", "macro_sql": "{% macro default__create_table_as(temporary, relation, sql) -%}\n {%- set sql_header = config.get('sql_header', none) -%}\n\n {{ sql_header if sql_header is not none }}\n\n create {% if temporary: -%}temporary{%- endif %} table\n {{ relation.include(database=(not temporary), schema=(not temporary)) }}\n {% set contract_config = config.get('contract') %}\n {% if contract_config.enforced and (not temporary) %}\n {{ get_assert_columns_equivalent(sql) }}\n {{ get_table_columns_and_constraints() }}\n {%- set sql = get_select_subquery(sql) %}\n {% endif %}\n as (\n {{ sql }}\n );\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.get_assert_columns_equivalent", "macro.dbt.get_table_columns_and_constraints", "macro.dbt.get_select_subquery"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "temporary", "type": null, "description": ""}, {"name": "relation", "type": null, "description": ""}, {"name": "sql", "type": null, "description": ""}], "created_at": 1789422566.3718944, "supported_languages": null}, "macro.dbt.default__get_column_names": {"name": "default__get_column_names", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/table/create.sql", "original_file_path": "macros/relations/table/create.sql", "unique_id": "macro.dbt.default__get_column_names", "macro_sql": "{% macro default__get_column_names() %}\n {#- loop through user_provided_columns to get column names -#}\n {%- set user_provided_columns = model['columns'] -%}\n {%- for i in user_provided_columns %}\n {%- set col = user_provided_columns[i] -%}\n {%- set col_name = adapter.quote(col['name']) if col.get('quote') else col['name'] -%}\n {{ col_name }}{{ \", \" if not loop.last }}\n {%- endfor -%}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789422566.3728456, "supported_languages": null}, "macro.dbt.get_select_subquery": {"name": "get_select_subquery", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/table/create.sql", "original_file_path": "macros/relations/table/create.sql", "unique_id": "macro.dbt.get_select_subquery", "macro_sql": "{% macro get_select_subquery(sql) %}\n {{ return(adapter.dispatch('get_select_subquery', 'dbt')(sql)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_select_subquery"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "sql", "type": null, "description": ""}], "created_at": 1789422566.3732207, "supported_languages": null}, "macro.dbt.default__get_select_subquery": {"name": "default__get_select_subquery", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/table/create.sql", "original_file_path": "macros/relations/table/create.sql", "unique_id": "macro.dbt.default__get_select_subquery", "macro_sql": "{% macro default__get_select_subquery(sql) %}\n select {{ adapter.dispatch('get_column_names', 'dbt')() }}\n from (\n {{ sql }}\n ) as model_subq\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_column_names"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "sql", "type": null, "description": ""}], "created_at": 1789422566.3736048, "supported_languages": null}, "macro.dbt.get_rename_table_sql": {"name": "get_rename_table_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/table/rename.sql", "original_file_path": "macros/relations/table/rename.sql", "unique_id": "macro.dbt.get_rename_table_sql", "macro_sql": "{% macro get_rename_table_sql(relation, new_name) %}\n {{- adapter.dispatch('get_rename_table_sql', 'dbt')(relation, new_name) -}}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__get_rename_table_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "new_name", "type": null, "description": ""}], "created_at": 1789422566.3741367, "supported_languages": null}, "macro.dbt.default__get_rename_table_sql": {"name": "default__get_rename_table_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/table/rename.sql", "original_file_path": "macros/relations/table/rename.sql", "unique_id": "macro.dbt.default__get_rename_table_sql", "macro_sql": "{% macro default__get_rename_table_sql(relation, new_name) %}\n {{ exceptions.raise_compiler_error(\n \"`get_rename_table_sql` has not been implemented for this adapter.\"\n ) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "new_name", "type": null, "description": ""}], "created_at": 1789422566.3744912, "supported_languages": null}, "macro.dbt.drop_table": {"name": "drop_table", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/table/drop.sql", "original_file_path": "macros/relations/table/drop.sql", "unique_id": "macro.dbt.drop_table", "macro_sql": "{% macro drop_table(relation) -%}\n {{- adapter.dispatch('drop_table', 'dbt')(relation) -}}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__drop_table"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789422566.3750062, "supported_languages": null}, "macro.dbt.default__drop_table": {"name": "default__drop_table", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/table/drop.sql", "original_file_path": "macros/relations/table/drop.sql", "unique_id": "macro.dbt.default__drop_table", "macro_sql": "{% macro default__drop_table(relation) -%}\n drop table if exists {{ relation.render() }} cascade\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789422566.375262, "supported_languages": null}, "macro.dbt.get_replace_table_sql": {"name": "get_replace_table_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/table/replace.sql", "original_file_path": "macros/relations/table/replace.sql", "unique_id": "macro.dbt.get_replace_table_sql", "macro_sql": "{% macro get_replace_table_sql(relation, sql) %}\n {{- adapter.dispatch('get_replace_table_sql', 'dbt')(relation, sql) -}}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__get_replace_table_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "sql", "type": null, "description": ""}], "created_at": 1789422566.375803, "supported_languages": null}, "macro.dbt.default__get_replace_table_sql": {"name": "default__get_replace_table_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/table/replace.sql", "original_file_path": "macros/relations/table/replace.sql", "unique_id": "macro.dbt.default__get_replace_table_sql", "macro_sql": "{% macro default__get_replace_table_sql(relation, sql) %}\n {{ exceptions.raise_compiler_error(\n \"`get_replace_table_sql` has not been implemented for this adapter.\"\n ) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "sql", "type": null, "description": ""}], "created_at": 1789422566.3761163, "supported_languages": null}, "macro.dbt.default__test_relationships": {"name": "default__test_relationships", "resource_type": "macro", "package_name": "dbt", "path": "macros/generic_test_sql/relationships.sql", "original_file_path": "macros/generic_test_sql/relationships.sql", "unique_id": "macro.dbt.default__test_relationships", "macro_sql": "{% macro default__test_relationships(model, column_name, to, field) %}\n\nwith child as (\n select {{ column_name }} as from_field\n from {{ model }}\n where {{ column_name }} is not null\n),\n\nparent as (\n select {{ field }} as to_field\n from {{ to }}\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "column_name", "type": null, "description": ""}, {"name": "to", "type": null, "description": ""}, {"name": "field", "type": null, "description": ""}], "created_at": 1789422566.3767345, "supported_languages": null}, "macro.dbt.default__test_accepted_values": {"name": "default__test_accepted_values", "resource_type": "macro", "package_name": "dbt", "path": "macros/generic_test_sql/accepted_values.sql", "original_file_path": "macros/generic_test_sql/accepted_values.sql", "unique_id": "macro.dbt.default__test_accepted_values", "macro_sql": "{% macro default__test_accepted_values(model, column_name, values, quote=True) %}\n\nwith all_values as (\n\n select\n {{ column_name }} as value_field,\n count(*) as n_records\n\n from {{ model }}\n group by {{ column_name }}\n\n)\n\nselect *\nfrom all_values\nwhere value_field not in (\n {% for value in values -%}\n {% if quote -%}\n '{{ value }}'\n {%- else -%}\n {{ value }}\n {%- endif -%}\n {%- if not loop.last -%},{%- endif %}\n {%- endfor %}\n)\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "column_name", "type": null, "description": ""}, {"name": "values", "type": null, "description": ""}, {"name": "quote", "type": null, "description": ""}], "created_at": 1789422566.3777702, "supported_languages": null}, "macro.dbt.default__test_not_null": {"name": "default__test_not_null", "resource_type": "macro", "package_name": "dbt", "path": "macros/generic_test_sql/not_null.sql", "original_file_path": "macros/generic_test_sql/not_null.sql", "unique_id": "macro.dbt.default__test_not_null", "macro_sql": "{% macro default__test_not_null(model, column_name) %}\n\n{% set column_list = '*' if should_store_failures() else column_name %}\n\nselect {{ column_list }}\nfrom {{ model }}\nwhere {{ column_name }} is null\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.should_store_failures"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "column_name", "type": null, "description": ""}], "created_at": 1789422566.378364, "supported_languages": null}, "macro.dbt.default__test_unique": {"name": "default__test_unique", "resource_type": "macro", "package_name": "dbt", "path": "macros/generic_test_sql/unique.sql", "original_file_path": "macros/generic_test_sql/unique.sql", "unique_id": "macro.dbt.default__test_unique", "macro_sql": "{% macro default__test_unique(model, column_name) %}\n\nselect\n {{ column_name }} as unique_field,\n count(*) as n_records\n\nfrom {{ model }}\nwhere {{ column_name }} is not null\ngroup by {{ column_name }}\nhaving count(*) > 1\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "column_name", "type": null, "description": ""}], "created_at": 1789422566.378854, "supported_languages": null}, "macro.dbt.set_sql_header": {"name": "set_sql_header", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/configs.sql", "original_file_path": "macros/materializations/configs.sql", "unique_id": "macro.dbt.set_sql_header", "macro_sql": "{% macro set_sql_header(config) -%}\n {{ config.set('sql_header', caller()) }}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "config", "type": null, "description": ""}], "created_at": 1789422566.3794324, "supported_languages": null}, "macro.dbt.should_full_refresh": {"name": "should_full_refresh", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/configs.sql", "original_file_path": "macros/materializations/configs.sql", "unique_id": "macro.dbt.should_full_refresh", "macro_sql": "{% macro should_full_refresh() %}\n {% set config_full_refresh = config.get('full_refresh') %}\n {% if config_full_refresh is none %}\n {% set config_full_refresh = flags.FULL_REFRESH %}\n {% endif %}\n {% do return(config_full_refresh) %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789422566.3802483, "supported_languages": null}, "macro.dbt.should_store_failures": {"name": "should_store_failures", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/configs.sql", "original_file_path": "macros/materializations/configs.sql", "unique_id": "macro.dbt.should_store_failures", "macro_sql": "{% macro should_store_failures() %}\n {% set config_store_failures = config.get('store_failures') %}\n {% if config_store_failures is none %}\n {% set config_store_failures = flags.STORE_FAILURES %}\n {% endif %}\n {% do return(config_store_failures) %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789422566.3808987, "supported_languages": null}, "macro.dbt.run_hooks": {"name": "run_hooks", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/hooks.sql", "original_file_path": "macros/materializations/hooks.sql", "unique_id": "macro.dbt.run_hooks", "macro_sql": "{% macro run_hooks(hooks, inside_transaction=True) %}\n {% for hook in hooks | selectattr('transaction', 'equalto', inside_transaction) %}\n {% if not inside_transaction and loop.first %}\n {% call statement(auto_begin=inside_transaction) %}\n commit;\n {% endcall %}\n {% endif %}\n {% set rendered = render(hook.get('sql')) | trim %}\n {% if (rendered | length) > 0 %}\n {% call statement(auto_begin=inside_transaction) %}\n {{ rendered }}\n {% endcall %}\n {% endif %}\n {% endfor %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "hooks", "type": null, "description": ""}, {"name": "inside_transaction", "type": null, "description": ""}], "created_at": 1789422566.3826485, "supported_languages": null}, "macro.dbt.make_hook_config": {"name": "make_hook_config", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/hooks.sql", "original_file_path": "macros/materializations/hooks.sql", "unique_id": "macro.dbt.make_hook_config", "macro_sql": "{% macro make_hook_config(sql, inside_transaction) %}\n {{ tojson({\"sql\": sql, \"transaction\": inside_transaction}) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "sql", "type": null, "description": ""}, {"name": "inside_transaction", "type": null, "description": ""}], "created_at": 1789422566.383067, "supported_languages": null}, "macro.dbt.before_begin": {"name": "before_begin", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/hooks.sql", "original_file_path": "macros/materializations/hooks.sql", "unique_id": "macro.dbt.before_begin", "macro_sql": "{% macro before_begin(sql) %}\n {{ make_hook_config(sql, inside_transaction=False) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.make_hook_config"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "sql", "type": null, "description": ""}], "created_at": 1789422566.3833725, "supported_languages": null}, "macro.dbt.in_transaction": {"name": "in_transaction", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/hooks.sql", "original_file_path": "macros/materializations/hooks.sql", "unique_id": "macro.dbt.in_transaction", "macro_sql": "{% macro in_transaction(sql) %}\n {{ make_hook_config(sql, inside_transaction=True) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.make_hook_config"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "sql", "type": null, "description": ""}], "created_at": 1789422566.383698, "supported_languages": null}, "macro.dbt.after_commit": {"name": "after_commit", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/hooks.sql", "original_file_path": "macros/materializations/hooks.sql", "unique_id": "macro.dbt.after_commit", "macro_sql": "{% macro after_commit(sql) %}\n {{ make_hook_config(sql, inside_transaction=False) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.make_hook_config"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "sql", "type": null, "description": ""}], "created_at": 1789422566.3839965, "supported_languages": null}, "macro.dbt.materialization_seed_default": {"name": "materialization_seed_default", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/seeds/seed.sql", "original_file_path": "macros/materializations/seeds/seed.sql", "unique_id": "macro.dbt.materialization_seed_default", "macro_sql": "{% materialization seed, default %}\n\n {%- set identifier = model['alias'] -%}\n {%- set full_refresh_mode = (should_full_refresh()) -%}\n\n {%- set old_relation = adapter.get_relation(database=database, schema=schema, identifier=identifier) -%}\n\n {%- set exists_as_table = (old_relation is not none and old_relation.is_table) -%}\n {%- set exists_as_view = (old_relation is not none and old_relation.is_view) -%}\n\n {%- set grant_config = config.get('grants') -%}\n {%- set agate_table = load_agate_table() -%}\n -- grab current tables grants config for comparison later on\n\n {%- do store_result('agate_table', response='OK', agate_table=agate_table) -%}\n\n {{ run_hooks(pre_hooks, inside_transaction=False) }}\n\n -- `BEGIN` happens here:\n {{ run_hooks(pre_hooks, inside_transaction=True) }}\n\n -- build model\n {% set create_table_sql = \"\" %}\n {% if exists_as_view %}\n {{ exceptions.raise_compiler_error(\"Cannot seed to '{}', it is a view\".format(old_relation.render())) }}\n {% elif exists_as_table %}\n {% set create_table_sql = reset_csv_table(model, full_refresh_mode, old_relation, agate_table) %}\n {% else %}\n {% set create_table_sql = create_csv_table(model, agate_table) %}\n {% endif %}\n\n {% set code = 'CREATE' if full_refresh_mode else 'INSERT' %}\n {% set rows_affected = (agate_table.rows | length) %}\n {% set sql = \"\" %}\n {% if rows_affected > 0 %}\n {% set sql = load_csv_rows(model, agate_table) %}\n {% endif %}\n\n {% call noop_statement('main', code ~ ' ' ~ rows_affected, code, rows_affected) %}\n {{ get_csv_sql(create_table_sql, sql) }};\n {% endcall %}\n\n {% set target_relation = this.incorporate(type='table') %}\n\n {% set should_revoke = should_revoke(old_relation, full_refresh_mode) %}\n {% do apply_grants(target_relation, grant_config, should_revoke=should_revoke) %}\n\n {% do persist_docs(target_relation, model) %}\n\n {% if full_refresh_mode or not exists_as_table %}\n {% do create_indexes(target_relation) %}\n {% endif %}\n\n {{ run_hooks(post_hooks, inside_transaction=True) }}\n\n -- `COMMIT` happens here\n {{ adapter.commit() }}\n\n {{ run_hooks(post_hooks, inside_transaction=False) }}\n\n {{ return({'relations': [target_relation]}) }}\n\n{% endmaterialization %}", "depends_on": {"macros": ["macro.dbt.should_full_refresh", "macro.dbt.run_hooks", "macro.dbt.reset_csv_table", "macro.dbt.create_csv_table", "macro.dbt.load_csv_rows", "macro.dbt.noop_statement", "macro.dbt.get_csv_sql", "macro.dbt.should_revoke", "macro.dbt.apply_grants", "macro.dbt.persist_docs", "macro.dbt.create_indexes"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "supported_languages", "type": null, "description": ""}], "created_at": 1789422566.389706, "supported_languages": ["sql"]}, "macro.dbt.create_csv_table": {"name": "create_csv_table", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "unique_id": "macro.dbt.create_csv_table", "macro_sql": "{% macro create_csv_table(model, agate_table) -%}\n {{ adapter.dispatch('create_csv_table', 'dbt')(model, agate_table) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__create_csv_table"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "agate_table", "type": null, "description": ""}], "created_at": 1789422566.3917823, "supported_languages": null}, "macro.dbt.default__create_csv_table": {"name": "default__create_csv_table", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "unique_id": "macro.dbt.default__create_csv_table", "macro_sql": "{% macro default__create_csv_table(model, agate_table) %}\n {%- set column_override = model['config'].get('column_types', {}) -%}\n {%- set quote_seed_column = model['config'].get('quote_columns', None) -%}\n\n {% set sql %}\n create table {{ this.render() }} (\n {%- for col_name in agate_table.column_names -%}\n {%- set inferred_type = adapter.convert_type(agate_table, loop.index0) -%}\n {%- set type = column_override.get(col_name, inferred_type) -%}\n {%- set column_name = (col_name | string) -%}\n {{ adapter.quote_seed_column(column_name, quote_seed_column) }} {{ type }} {%- if not loop.last -%}, {%- endif -%}\n {%- endfor -%}\n )\n {% endset %}\n\n {% call statement('_') -%}\n {{ sql }}\n {%- endcall %}\n\n {{ return(sql) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "agate_table", "type": null, "description": ""}], "created_at": 1789422566.3936818, "supported_languages": null}, "macro.dbt.reset_csv_table": {"name": "reset_csv_table", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "unique_id": "macro.dbt.reset_csv_table", "macro_sql": "{% macro reset_csv_table(model, full_refresh, old_relation, agate_table) -%}\n {{ adapter.dispatch('reset_csv_table', 'dbt')(model, full_refresh, old_relation, agate_table) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__reset_csv_table"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "full_refresh", "type": null, "description": ""}, {"name": "old_relation", "type": null, "description": ""}, {"name": "agate_table", "type": null, "description": ""}], "created_at": 1789422566.394192, "supported_languages": null}, "macro.dbt.default__reset_csv_table": {"name": "default__reset_csv_table", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "unique_id": "macro.dbt.default__reset_csv_table", "macro_sql": "{% macro default__reset_csv_table(model, full_refresh, old_relation, agate_table) %}\n {% set sql = \"\" %}\n {% if full_refresh %}\n {{ adapter.drop_relation(old_relation) }}\n {% set sql = create_csv_table(model, agate_table) %}\n {% else %}\n {{ adapter.truncate_relation(old_relation) }}\n {% set sql = \"truncate table \" ~ old_relation.render() %}\n {% endif %}\n\n {{ return(sql) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.create_csv_table"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "full_refresh", "type": null, "description": ""}, {"name": "old_relation", "type": null, "description": ""}, {"name": "agate_table", "type": null, "description": ""}], "created_at": 1789422566.395229, "supported_languages": null}, "macro.dbt.get_csv_sql": {"name": "get_csv_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "unique_id": "macro.dbt.get_csv_sql", "macro_sql": "{% macro get_csv_sql(create_or_truncate_sql, insert_sql) %}\n {{ adapter.dispatch('get_csv_sql', 'dbt')(create_or_truncate_sql, insert_sql) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_csv_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "create_or_truncate_sql", "type": null, "description": ""}, {"name": "insert_sql", "type": null, "description": ""}], "created_at": 1789422566.3956826, "supported_languages": null}, "macro.dbt.default__get_csv_sql": {"name": "default__get_csv_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "unique_id": "macro.dbt.default__get_csv_sql", "macro_sql": "{% macro default__get_csv_sql(create_or_truncate_sql, insert_sql) %}\n {{ create_or_truncate_sql }};\n -- dbt seed --\n {{ insert_sql }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "create_or_truncate_sql", "type": null, "description": ""}, {"name": "insert_sql", "type": null, "description": ""}], "created_at": 1789422566.3959718, "supported_languages": null}, "macro.dbt.get_binding_char": {"name": "get_binding_char", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "unique_id": "macro.dbt.get_binding_char", "macro_sql": "{% macro get_binding_char() -%}\n {{ adapter.dispatch('get_binding_char', 'dbt')() }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_binding_char"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789422566.396269, "supported_languages": null}, "macro.dbt.default__get_binding_char": {"name": "default__get_binding_char", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "unique_id": "macro.dbt.default__get_binding_char", "macro_sql": "{% macro default__get_binding_char() %}\n {{ return('%s') }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789422566.3965125, "supported_languages": null}, "macro.dbt.get_batch_size": {"name": "get_batch_size", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "unique_id": "macro.dbt.get_batch_size", "macro_sql": "{% macro get_batch_size() -%}\n {{ return(adapter.dispatch('get_batch_size', 'dbt')()) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_batch_size"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789422566.3968668, "supported_languages": null}, "macro.dbt.default__get_batch_size": {"name": "default__get_batch_size", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "unique_id": "macro.dbt.default__get_batch_size", "macro_sql": "{% macro default__get_batch_size() %}\n {{ return(10000) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789422566.3971162, "supported_languages": null}, "macro.dbt.get_seed_column_quoted_csv": {"name": "get_seed_column_quoted_csv", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "unique_id": "macro.dbt.get_seed_column_quoted_csv", "macro_sql": "{% macro get_seed_column_quoted_csv(model, column_names) %}\n {%- set quote_seed_column = model['config'].get('quote_columns', None) -%}\n {% set quoted = [] %}\n {% for col in column_names -%}\n {%- do quoted.append(adapter.quote_seed_column(col, quote_seed_column)) -%}\n {%- endfor %}\n\n {%- set dest_cols_csv = quoted | join(', ') -%}\n {{ return(dest_cols_csv) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "column_names", "type": null, "description": ""}], "created_at": 1789422566.3981068, "supported_languages": null}, "macro.dbt.load_csv_rows": {"name": "load_csv_rows", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "unique_id": "macro.dbt.load_csv_rows", "macro_sql": "{% macro load_csv_rows(model, agate_table) -%}\n {{ adapter.dispatch('load_csv_rows', 'dbt')(model, agate_table) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__load_csv_rows"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "agate_table", "type": null, "description": ""}], "created_at": 1789422566.39849, "supported_languages": null}, "macro.dbt.default__load_csv_rows": {"name": "default__load_csv_rows", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "unique_id": "macro.dbt.default__load_csv_rows", "macro_sql": "{% macro default__load_csv_rows(model, agate_table) %}\n\n {% set batch_size = get_batch_size() %}\n\n {% set cols_sql = get_seed_column_quoted_csv(model, agate_table.column_names) %}\n {% set bindings = [] %}\n\n {% set statements = [] %}\n\n {% for chunk in agate_table.rows | batch(batch_size) %}\n {% set bindings = [] %}\n\n {% for row in chunk %}\n {% do bindings.extend(row) %}\n {% endfor %}\n\n {% set sql %}\n insert into {{ this.render() }} ({{ cols_sql }}) values\n {% for row in chunk -%}\n ({%- for column in agate_table.column_names -%}\n {{ get_binding_char() }}\n {%- if not loop.last%},{%- endif %}\n {%- endfor -%})\n {%- if not loop.last%},{%- endif %}\n {%- endfor %}\n {% endset %}\n\n {% do adapter.add_query(sql, bindings=bindings, abridge_sql_log=True) %}\n\n {% if loop.index0 == 0 %}\n {% do statements.append(sql) %}\n {% endif %}\n {% endfor %}\n\n {# Return SQL so we can render it out into the compiled files #}\n {{ return(statements[0]) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_batch_size", "macro.dbt.get_seed_column_quoted_csv", "macro.dbt.get_binding_char"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "agate_table", "type": null, "description": ""}], "created_at": 1789422566.4010775, "supported_languages": null}, "macro.dbt.materialization_unit_default": {"name": "materialization_unit_default", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/tests/unit.sql", "original_file_path": "macros/materializations/tests/unit.sql", "unique_id": "macro.dbt.materialization_unit_default", "macro_sql": "{%- materialization unit, default -%}\n\n {% set relations = [] %}\n {% set sql_header = config.get('sql_header') if flags.REQUIRE_SQL_HEADER_IN_TEST_CONFIGS else none %}\n\n {% set expected_rows = config.get('expected_rows') %}\n {% set expected_sql = config.get('expected_sql') %}\n {% set tested_expected_column_names = expected_rows[0].keys() if (expected_rows | length ) > 0 else get_columns_in_query(sql) %}\n\n {%- set target_relation = this.incorporate(type='table') -%}\n {%- set temp_relation = make_temp_relation(target_relation)-%}\n {% do run_query(get_create_table_as_sql(True, temp_relation, get_empty_subquery_sql(sql))) %}\n {%- set columns_in_relation = adapter.get_columns_in_relation(temp_relation) -%}\n {%- set column_name_to_data_types = {} -%}\n {%- set column_name_to_quoted = {} -%}\n {%- for column in columns_in_relation -%}\n {%- do column_name_to_data_types.update({column.name|lower: column.data_type}) -%}\n {%- do column_name_to_quoted.update({column.name|lower: column.quoted}) -%}\n {%- endfor -%}\n\n {%- set expected_column_names_quoted = [] -%}\n {%- for column_name in tested_expected_column_names -%}\n {%- do expected_column_names_quoted.append(column_name_to_quoted[column_name|lower]) -%}\n {%- endfor -%}\n\n {% if not expected_sql %}\n {% set expected_sql = get_expected_sql(expected_rows, column_name_to_data_types, column_name_to_quoted) %}\n {% endif %}\n {% set unit_test_sql = get_unit_test_sql(sql, expected_sql, expected_column_names_quoted) %}\n\n {% call statement('main', fetch_result=True) -%}\n\n {% if sql_header %}{{ sql_header }}{% endif %}\n {{ unit_test_sql }}\n\n {%- endcall %}\n\n {% do adapter.drop_relation(temp_relation) %}\n\n {{ return({'relations': relations}) }}\n\n{%- endmaterialization -%}", "depends_on": {"macros": ["macro.dbt.get_columns_in_query", "macro.dbt.make_temp_relation", "macro.dbt.run_query", "macro.dbt.get_create_table_as_sql", "macro.dbt.get_empty_subquery_sql", "macro.dbt.get_expected_sql", "macro.dbt.get_unit_test_sql", "macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "supported_languages", "type": null, "description": ""}], "created_at": 1789422566.4052465, "supported_languages": ["sql"]}, "macro.dbt.materialization_test_default": {"name": "materialization_test_default", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/tests/test.sql", "original_file_path": "macros/materializations/tests/test.sql", "unique_id": "macro.dbt.materialization_test_default", "macro_sql": "{%- materialization test, default -%}\n\n {% set relations = [] %}\n {% set limit = config.get('limit') %}\n {% set sql_header = config.get('sql_header') if flags.REQUIRE_SQL_HEADER_IN_TEST_CONFIGS else none %}\n\n {% set sql_with_limit %}\n {{ get_limit_subquery_sql(sql, limit) }}\n {% endset %}\n\n {% if should_store_failures() %}\n\n {% set identifier = model['alias'] %}\n {% set old_relation = adapter.get_relation(database=database, schema=schema, identifier=identifier) %}\n\n {% set store_failures_as = config.get('store_failures_as') %}\n -- if `--store-failures` is invoked via command line and `store_failures_as` is not set,\n -- config.get('store_failures_as', 'table') returns None, not 'table'\n {% if store_failures_as == none %}{% set store_failures_as = 'table' %}{% endif %}\n {% if store_failures_as not in ['table', 'view'] %}\n {{ exceptions.raise_compiler_error(\n \"'\" ~ store_failures_as ~ \"' is not a valid value for `store_failures_as`. \"\n \"Accepted values are: ['ephemeral', 'table', 'view']\"\n ) }}\n {% endif %}\n\n {% set target_relation = api.Relation.create(\n identifier=identifier, schema=schema, database=database, type=store_failures_as) -%} %}\n\n {% if old_relation %}\n {% do adapter.drop_relation(old_relation) %}\n {% endif %}\n\n {% call statement(auto_begin=True) %}\n {% if sql_header %}{{ sql_header }}{% endif %}\n {{ get_create_sql(target_relation, sql_with_limit) }}\n {% endcall %}\n\n {% do relations.append(target_relation) %}\n\n {# Since the test failures have already been saved to the database, reuse that result rather than querying again #}\n {% set main_sql %}\n select *\n from {{ target_relation }}\n {% endset %}\n\n {{ adapter.commit() }}\n\n {% else %}\n\n {% set main_sql = sql_with_limit %}\n\n {% endif %}\n\n {% set fail_calc = config.get('fail_calc') %}\n {% set warn_if = config.get('warn_if') %}\n {% set error_if = config.get('error_if') %}\n\n {% call statement('main', fetch_result=True) -%}\n\n {% if sql_header %}{{ sql_header }}{% endif %}\n {# The limit has already been included above, and we do not want to duplicate it again. We also want to be safe for macro overrides treating `limit` as a required parameter. #}\n {{ get_test_sql(main_sql, fail_calc, warn_if, error_if, limit=none)}}\n\n {%- endcall %}\n\n {{ return({'relations': relations}) }}\n\n{%- endmaterialization -%}", "depends_on": {"macros": ["macro.dbt.get_limit_subquery_sql", "macro.dbt.should_store_failures", "macro.dbt.statement", "macro.dbt.get_create_sql", "macro.dbt.get_test_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "supported_languages", "type": null, "description": ""}], "created_at": 1789422566.4104576, "supported_languages": ["sql"]}, "macro.dbt.get_test_sql": {"name": "get_test_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/tests/helpers.sql", "original_file_path": "macros/materializations/tests/helpers.sql", "unique_id": "macro.dbt.get_test_sql", "macro_sql": "{% macro get_test_sql(main_sql, fail_calc, warn_if, error_if, limit) -%}\n {{ adapter.dispatch('get_test_sql', 'dbt')(main_sql, fail_calc, warn_if, error_if, limit) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_test_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "main_sql", "type": null, "description": ""}, {"name": "fail_calc", "type": null, "description": ""}, {"name": "warn_if", "type": null, "description": ""}, {"name": "error_if", "type": null, "description": ""}, {"name": "limit", "type": null, "description": ""}], "created_at": 1789422566.4117005, "supported_languages": null}, "macro.dbt.default__get_test_sql": {"name": "default__get_test_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/tests/helpers.sql", "original_file_path": "macros/materializations/tests/helpers.sql", "unique_id": "macro.dbt.default__get_test_sql", "macro_sql": "{% macro default__get_test_sql(main_sql, fail_calc, warn_if, error_if, limit) -%}\n select\n {{ fail_calc }} as failures,\n {{ fail_calc }} {{ warn_if }} as should_warn,\n {{ fail_calc }} {{ error_if }} as should_error\n from (\n {{ main_sql }}\n {{ \"limit \" ~ limit if limit != none }}\n ) dbt_internal_test\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "main_sql", "type": null, "description": ""}, {"name": "fail_calc", "type": null, "description": ""}, {"name": "warn_if", "type": null, "description": ""}, {"name": "error_if", "type": null, "description": ""}, {"name": "limit", "type": null, "description": ""}], "created_at": 1789422566.4123914, "supported_languages": null}, "macro.dbt.get_unit_test_sql": {"name": "get_unit_test_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/tests/helpers.sql", "original_file_path": "macros/materializations/tests/helpers.sql", "unique_id": "macro.dbt.get_unit_test_sql", "macro_sql": "{% macro get_unit_test_sql(main_sql, expected_fixture_sql, expected_column_names) -%}\n {{ adapter.dispatch('get_unit_test_sql', 'dbt')(main_sql, expected_fixture_sql, expected_column_names) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_unit_test_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "main_sql", "type": null, "description": ""}, {"name": "expected_fixture_sql", "type": null, "description": ""}, {"name": "expected_column_names", "type": null, "description": ""}], "created_at": 1789422566.4128892, "supported_languages": null}, "macro.dbt.default__get_unit_test_sql": {"name": "default__get_unit_test_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/tests/helpers.sql", "original_file_path": "macros/materializations/tests/helpers.sql", "unique_id": "macro.dbt.default__get_unit_test_sql", "macro_sql": "{% macro default__get_unit_test_sql(main_sql, expected_fixture_sql, expected_column_names) -%}\n-- Build actual result given inputs\nwith dbt_internal_unit_test_actual as (\n select\n {% for expected_column_name in expected_column_names %}{{expected_column_name}}{% if not loop.last -%},{% endif %}{%- endfor -%}, {{ dbt.string_literal(\"actual\") }} as {{ adapter.quote(\"actual_or_expected\") }}\n from (\n {{ main_sql }}\n ) _dbt_internal_unit_test_actual\n),\n-- Build expected result\ndbt_internal_unit_test_expected as (\n select\n {% for expected_column_name in expected_column_names %}{{expected_column_name}}{% if not loop.last -%}, {% endif %}{%- endfor -%}, {{ dbt.string_literal(\"expected\") }} as {{ adapter.quote(\"actual_or_expected\") }}\n from (\n {{ expected_fixture_sql }}\n ) _dbt_internal_unit_test_expected\n)\n-- Union actual and expected results\nselect * from dbt_internal_unit_test_actual\nunion all\nselect * from dbt_internal_unit_test_expected\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.string_literal"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "main_sql", "type": null, "description": ""}, {"name": "expected_fixture_sql", "type": null, "description": ""}, {"name": "expected_column_names", "type": null, "description": ""}], "created_at": 1789422566.4142032, "supported_languages": null}, "macro.dbt.get_where_subquery": {"name": "get_where_subquery", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/tests/where_subquery.sql", "original_file_path": "macros/materializations/tests/where_subquery.sql", "unique_id": "macro.dbt.get_where_subquery", "macro_sql": "{% macro get_where_subquery(relation) -%}\n {% do return(adapter.dispatch('get_where_subquery', 'dbt')(relation)) %}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_where_subquery"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789422566.4149399, "supported_languages": null}, "macro.dbt.default__get_where_subquery": {"name": "default__get_where_subquery", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/tests/where_subquery.sql", "original_file_path": "macros/materializations/tests/where_subquery.sql", "unique_id": "macro.dbt.default__get_where_subquery", "macro_sql": "{% macro default__get_where_subquery(relation) -%}\n {% set where = config.get('where', '') %}\n {% if where %}\n {%- set filtered -%}\n (select * from {{ relation }} where {{ where }}) dbt_subquery\n {%- endset -%}\n {% do return(filtered) %}\n {%- else -%}\n {% do return(relation) %}\n {%- endif -%}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789422566.4157655, "supported_languages": null}, "macro.dbt.materialization_snapshot_default": {"name": "materialization_snapshot_default", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/snapshot.sql", "original_file_path": "macros/materializations/snapshots/snapshot.sql", "unique_id": "macro.dbt.materialization_snapshot_default", "macro_sql": "{% materialization snapshot, default %}\n\n {%- set target_table = model.get('alias', model.get('name')) -%}\n\n {%- set strategy_name = config.get('strategy') -%}\n {%- set unique_key = config.get('unique_key') %}\n -- grab current tables grants config for comparision later on\n {%- set grant_config = config.get('grants') -%}\n\n {% set target_relation_exists, target_relation = get_or_create_relation(\n database=model.database,\n schema=model.schema,\n identifier=target_table,\n type='table') -%}\n\n {%- if not target_relation.is_table -%}\n {% do exceptions.relation_wrong_type(target_relation, 'table') %}\n {%- endif -%}\n\n\n {{ run_hooks(pre_hooks, inside_transaction=False) }}\n\n {{ run_hooks(pre_hooks, inside_transaction=True) }}\n\n {% set strategy_macro = strategy_dispatch(strategy_name) %}\n {# The model['config'] parameter below is no longer used, but passing anyway for compatibility #}\n {# It was a dictionary of config, instead of the config object from the context #}\n {% set strategy = strategy_macro(model, \"snapshotted_data\", \"source_data\", model['config'], target_relation_exists) %}\n\n {% if not target_relation_exists %}\n\n {% set build_sql = build_snapshot_table(strategy, model['compiled_code']) %}\n {% set build_or_select_sql = build_sql %}\n {% set final_sql = create_table_as(False, target_relation, build_sql) %}\n\n {% else %}\n\n {% set columns = config.get(\"snapshot_table_column_names\") or get_snapshot_table_column_names() %}\n\n {{ adapter.assert_valid_snapshot_target_given_strategy(target_relation, columns, strategy) }}\n\n {% set build_or_select_sql = snapshot_staging_table(strategy, sql, target_relation) %}\n {% set staging_table = build_snapshot_staging_table(strategy, sql, target_relation) %}\n\n -- this may no-op if the database does not require column expansion\n {% do adapter.expand_target_column_types(from_relation=staging_table,\n to_relation=target_relation) %}\n\n {% set remove_columns = ['dbt_change_type', 'DBT_CHANGE_TYPE', 'dbt_unique_key', 'DBT_UNIQUE_KEY'] %}\n {% if unique_key | is_list %}\n {% for key in strategy.unique_key %}\n {{ remove_columns.append('dbt_unique_key_' + loop.index|string) }}\n {{ remove_columns.append('DBT_UNIQUE_KEY_' + loop.index|string) }}\n {% endfor %}\n {% endif %}\n\n {% set missing_columns = adapter.get_missing_columns(staging_table, target_relation)\n | rejectattr('name', 'in', remove_columns)\n | list %}\n\n {% do create_columns(target_relation, missing_columns) %}\n\n {% set source_columns = adapter.get_columns_in_relation(staging_table)\n | rejectattr('name', 'in', remove_columns)\n | list %}\n\n {% set quoted_source_columns = [] %}\n {% for column in source_columns %}\n {% do quoted_source_columns.append(adapter.quote(column.name)) %}\n {% endfor %}\n\n {% set final_sql = snapshot_merge_sql(\n target = target_relation,\n source = staging_table,\n insert_cols = quoted_source_columns\n )\n %}\n\n {% endif %}\n\n\n {{ check_time_data_types(build_or_select_sql) }}\n\n {% call statement('main') %}\n {{ final_sql }}\n {% endcall %}\n\n {% set should_revoke = should_revoke(target_relation_exists, full_refresh_mode=False) %}\n {% do apply_grants(target_relation, grant_config, should_revoke=should_revoke) %}\n\n {% do persist_docs(target_relation, model) %}\n\n {% if not target_relation_exists %}\n {% do create_indexes(target_relation) %}\n {% endif %}\n\n {{ run_hooks(post_hooks, inside_transaction=True) }}\n\n {{ adapter.commit() }}\n\n {% if staging_table is defined %}\n {% do post_snapshot(staging_table) %}\n {% endif %}\n\n {{ run_hooks(post_hooks, inside_transaction=False) }}\n\n {{ return({'relations': [target_relation]}) }}\n\n{% endmaterialization %}", "depends_on": {"macros": ["macro.dbt.get_or_create_relation", "macro.dbt.run_hooks", "macro.dbt.strategy_dispatch", "macro.dbt.build_snapshot_table", "macro.dbt.create_table_as", "macro.dbt.get_snapshot_table_column_names", "macro.dbt.snapshot_staging_table", "macro.dbt.build_snapshot_staging_table", "macro.dbt.create_columns", "macro.dbt.snapshot_merge_sql", "macro.dbt.check_time_data_types", "macro.dbt.statement", "macro.dbt.should_revoke", "macro.dbt.apply_grants", "macro.dbt.persist_docs", "macro.dbt.create_indexes", "macro.dbt.post_snapshot"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "supported_languages", "type": null, "description": ""}], "created_at": 1789422566.4240882, "supported_languages": ["sql"]}, "macro.dbt.strategy_dispatch": {"name": "strategy_dispatch", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/strategies.sql", "original_file_path": "macros/materializations/snapshots/strategies.sql", "unique_id": "macro.dbt.strategy_dispatch", "macro_sql": "{% macro strategy_dispatch(name) -%}\n{% set original_name = name %}\n {% if '.' in name %}\n {% set package_name, name = name.split(\".\", 1) %}\n {% else %}\n {% set package_name = none %}\n {% endif %}\n\n {% if package_name is none %}\n {% set package_context = context %}\n {% elif package_name in context %}\n {% set package_context = context[package_name] %}\n {% else %}\n {% set error_msg %}\n Could not find package '{{package_name}}', called with '{{original_name}}'\n {% endset %}\n {{ exceptions.raise_compiler_error(error_msg | trim) }}\n {% endif %}\n\n {%- set search_name = 'snapshot_' ~ name ~ '_strategy' -%}\n\n {% if search_name not in package_context %}\n {% set error_msg %}\n The specified strategy macro '{{name}}' was not found in package '{{ package_name }}'\n {% endset %}\n {{ exceptions.raise_compiler_error(error_msg | trim) }}\n {% endif %}\n {{ return(package_context[search_name]) }}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "name", "type": null, "description": ""}], "created_at": 1789422566.42838, "supported_languages": null}, "macro.dbt.snapshot_hash_arguments": {"name": "snapshot_hash_arguments", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/strategies.sql", "original_file_path": "macros/materializations/snapshots/strategies.sql", "unique_id": "macro.dbt.snapshot_hash_arguments", "macro_sql": "{% macro snapshot_hash_arguments(args) -%}\n {{ adapter.dispatch('snapshot_hash_arguments', 'dbt')(args) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__snapshot_hash_arguments"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "args", "type": null, "description": ""}], "created_at": 1789422566.4288304, "supported_languages": null}, "macro.dbt.default__snapshot_hash_arguments": {"name": "default__snapshot_hash_arguments", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/strategies.sql", "original_file_path": "macros/materializations/snapshots/strategies.sql", "unique_id": "macro.dbt.default__snapshot_hash_arguments", "macro_sql": "{% macro default__snapshot_hash_arguments(args) -%}\n md5({%- for arg in args -%}\n coalesce(cast({{ arg }} as varchar ), '')\n {% if not loop.last %} || '|' || {% endif %}\n {%- endfor -%})\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "args", "type": null, "description": ""}], "created_at": 1789422566.429323, "supported_languages": null}, "macro.dbt.snapshot_timestamp_strategy": {"name": "snapshot_timestamp_strategy", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/strategies.sql", "original_file_path": "macros/materializations/snapshots/strategies.sql", "unique_id": "macro.dbt.snapshot_timestamp_strategy", "macro_sql": "{% macro snapshot_timestamp_strategy(node, snapshotted_rel, current_rel, model_config, target_exists) %}\n {# The model_config parameter is no longer used, but is passed in anyway for compatibility. #}\n {% set primary_key = config.get('unique_key') %}\n {% set updated_at = config.get('updated_at') %}\n {% set hard_deletes = adapter.get_hard_deletes_behavior(config) %}\n {% set invalidate_hard_deletes = hard_deletes == 'invalidate' %}\n {% set columns = config.get(\"snapshot_table_column_names\") or get_snapshot_table_column_names() %}\n\n {#/*\n The snapshot relation might not have an {{ updated_at }} value if the\n snapshot strategy is changed from `check` to `timestamp`. We\n should use a dbt-created column for the comparison in the snapshot\n table instead of assuming that the user-supplied {{ updated_at }}\n will be present in the historical data.\n\n See https://github.com/dbt-labs/dbt-core/issues/2350\n */ #}\n {% set row_changed_expr -%}\n ({{ snapshotted_rel }}.{{ columns.dbt_valid_from }} < {{ current_rel }}.{{ updated_at }})\n {%- endset %}\n\n {% set scd_args = api.Relation.scd_args(primary_key, updated_at) %}\n {% set scd_id_expr = snapshot_hash_arguments(scd_args) %}\n\n {% do return({\n \"unique_key\": primary_key,\n \"updated_at\": updated_at,\n \"row_changed\": row_changed_expr,\n \"scd_id\": scd_id_expr,\n \"invalidate_hard_deletes\": invalidate_hard_deletes,\n \"hard_deletes\": hard_deletes\n }) %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_snapshot_table_column_names", "macro.dbt.snapshot_hash_arguments"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "node", "type": null, "description": ""}, {"name": "snapshotted_rel", "type": null, "description": ""}, {"name": "current_rel", "type": null, "description": ""}, {"name": "model_config", "type": null, "description": ""}, {"name": "target_exists", "type": null, "description": ""}], "created_at": 1789422566.4313323, "supported_languages": null}, "macro.dbt.snapshot_string_as_time": {"name": "snapshot_string_as_time", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/strategies.sql", "original_file_path": "macros/materializations/snapshots/strategies.sql", "unique_id": "macro.dbt.snapshot_string_as_time", "macro_sql": "{% macro snapshot_string_as_time(timestamp) -%}\n {{ adapter.dispatch('snapshot_string_as_time', 'dbt')(timestamp) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__snapshot_string_as_time"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "timestamp", "type": null, "description": ""}], "created_at": 1789422566.4317546, "supported_languages": null}, "macro.dbt.default__snapshot_string_as_time": {"name": "default__snapshot_string_as_time", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/strategies.sql", "original_file_path": "macros/materializations/snapshots/strategies.sql", "unique_id": "macro.dbt.default__snapshot_string_as_time", "macro_sql": "{% macro default__snapshot_string_as_time(timestamp) %}\n {% do exceptions.raise_not_implemented(\n 'snapshot_string_as_time macro not implemented for adapter '+adapter.type()\n ) %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "timestamp", "type": null, "description": ""}], "created_at": 1789422566.4321177, "supported_languages": null}, "macro.dbt.snapshot_check_all_get_existing_columns": {"name": "snapshot_check_all_get_existing_columns", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/strategies.sql", "original_file_path": "macros/materializations/snapshots/strategies.sql", "unique_id": "macro.dbt.snapshot_check_all_get_existing_columns", "macro_sql": "{% macro snapshot_check_all_get_existing_columns(node, target_exists, check_cols_config) -%}\n {%- if not target_exists -%}\n {#-- no table yet -> return whatever the query does --#}\n {{ return((false, query_columns)) }}\n {%- endif -%}\n\n {#-- handle any schema changes --#}\n {%- set target_relation = adapter.get_relation(database=node.database, schema=node.schema, identifier=node.alias) -%}\n\n {% if check_cols_config == 'all' %}\n {%- set query_columns = get_columns_in_query(node['compiled_code']) -%}\n\n {% elif check_cols_config is iterable and (check_cols_config | length) > 0 %}\n {#-- query for proper casing/quoting, to support comparison below --#}\n {%- set select_check_cols_from_target -%}\n {#-- N.B. The whitespace below is necessary to avoid edge case issue with comments --#}\n {#-- See: https://github.com/dbt-labs/dbt-core/issues/6781 --#}\n select {{ check_cols_config | join(', ') }} from (\n {{ node['compiled_code'] }}\n ) subq\n {%- endset -%}\n {% set query_columns = get_columns_in_query(select_check_cols_from_target) %}\n\n {% else %}\n {% do exceptions.raise_compiler_error(\"Invalid value for 'check_cols': \" ~ check_cols_config) %}\n {% endif %}\n\n {%- set existing_cols = adapter.get_columns_in_relation(target_relation) | map(attribute = 'name') | list -%}\n {%- set ns = namespace() -%} {#-- handle for-loop scoping with a namespace --#}\n {%- set ns.column_added = false -%}\n\n {%- set intersection = [] -%}\n {%- for col in query_columns -%}\n {%- if col in existing_cols -%}\n {%- do intersection.append(adapter.quote(col)) -%}\n {%- else -%}\n {% set ns.column_added = true %}\n {%- endif -%}\n {%- endfor -%}\n {{ return((ns.column_added, intersection)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.get_columns_in_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "node", "type": null, "description": ""}, {"name": "target_exists", "type": null, "description": ""}, {"name": "check_cols_config", "type": null, "description": ""}], "created_at": 1789422566.4349904, "supported_languages": null}, "macro.dbt.snapshot_check_strategy": {"name": "snapshot_check_strategy", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/strategies.sql", "original_file_path": "macros/materializations/snapshots/strategies.sql", "unique_id": "macro.dbt.snapshot_check_strategy", "macro_sql": "{% macro snapshot_check_strategy(node, snapshotted_rel, current_rel, model_config, target_exists) %}\n {# The model_config parameter is no longer used, but is passed in anyway for compatibility. #}\n {% set check_cols_config = config.get('check_cols') %}\n {% set primary_key = config.get('unique_key') %}\n {% set hard_deletes = adapter.get_hard_deletes_behavior(config) %}\n {% set invalidate_hard_deletes = hard_deletes == 'invalidate' %}\n {% set updated_at = config.get('updated_at') or snapshot_get_time() %}\n\n {% set column_added = false %}\n\n {% set column_added, check_cols = snapshot_check_all_get_existing_columns(node, target_exists, check_cols_config) %}\n\n {%- set row_changed_expr -%}\n (\n {%- if column_added -%}\n {{ get_true_sql() }}\n {%- else -%}\n {%- for col in check_cols -%}\n {{ snapshotted_rel }}.{{ col }} != {{ current_rel }}.{{ col }}\n or\n (\n (({{ snapshotted_rel }}.{{ col }} is null) and not ({{ current_rel }}.{{ col }} is null))\n or\n ((not {{ snapshotted_rel }}.{{ col }} is null) and ({{ current_rel }}.{{ col }} is null))\n )\n {%- if not loop.last %} or {% endif -%}\n {%- endfor -%}\n {%- endif -%}\n )\n {%- endset %}\n\n {% set scd_args = api.Relation.scd_args(primary_key, updated_at) %}\n {% set scd_id_expr = snapshot_hash_arguments(scd_args) %}\n\n {% do return({\n \"unique_key\": primary_key,\n \"updated_at\": updated_at,\n \"row_changed\": row_changed_expr,\n \"scd_id\": scd_id_expr,\n \"invalidate_hard_deletes\": invalidate_hard_deletes,\n \"hard_deletes\": hard_deletes\n }) %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.snapshot_get_time", "macro.dbt.snapshot_check_all_get_existing_columns", "macro.dbt.get_true_sql", "macro.dbt.snapshot_hash_arguments"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "node", "type": null, "description": ""}, {"name": "snapshotted_rel", "type": null, "description": ""}, {"name": "current_rel", "type": null, "description": ""}, {"name": "model_config", "type": null, "description": ""}, {"name": "target_exists", "type": null, "description": ""}], "created_at": 1789422566.438158, "supported_languages": null}, "macro.dbt.snapshot_merge_sql": {"name": "snapshot_merge_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/snapshot_merge.sql", "original_file_path": "macros/materializations/snapshots/snapshot_merge.sql", "unique_id": "macro.dbt.snapshot_merge_sql", "macro_sql": "{% macro snapshot_merge_sql(target, source, insert_cols) -%}\n {{ adapter.dispatch('snapshot_merge_sql', 'dbt')(target, source, insert_cols) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__snapshot_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "target", "type": null, "description": ""}, {"name": "source", "type": null, "description": ""}, {"name": "insert_cols", "type": null, "description": ""}], "created_at": 1789422566.439094, "supported_languages": null}, "macro.dbt.default__snapshot_merge_sql": {"name": "default__snapshot_merge_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/snapshot_merge.sql", "original_file_path": "macros/materializations/snapshots/snapshot_merge.sql", "unique_id": "macro.dbt.default__snapshot_merge_sql", "macro_sql": "{% macro default__snapshot_merge_sql(target, source, insert_cols) -%}\n {%- set insert_cols_csv = insert_cols | join(', ') -%}\n\n {%- set columns = config.get(\"snapshot_table_column_names\") or get_snapshot_table_column_names() -%}\n\n merge into {{ target.render() }} as DBT_INTERNAL_DEST\n using {{ source }} as DBT_INTERNAL_SOURCE\n on DBT_INTERNAL_SOURCE.{{ columns.dbt_scd_id }} = DBT_INTERNAL_DEST.{{ columns.dbt_scd_id }}\n\n when matched\n {% if config.get(\"dbt_valid_to_current\") %}\n\t{% set source_unique_key = (\"DBT_INTERNAL_DEST.\" ~ columns.dbt_valid_to) | trim %}\n\t{% set target_unique_key = config.get('dbt_valid_to_current') | trim %}\n\tand ({{ equals(source_unique_key, target_unique_key) }} or {{ source_unique_key }} is null)\n\n {% else %}\n and DBT_INTERNAL_DEST.{{ columns.dbt_valid_to }} is null\n {% endif %}\n and DBT_INTERNAL_SOURCE.dbt_change_type in ('update', 'delete')\n then update\n set {{ columns.dbt_valid_to }} = DBT_INTERNAL_SOURCE.{{ columns.dbt_valid_to }}\n\n when not matched\n and DBT_INTERNAL_SOURCE.dbt_change_type = 'insert'\n then insert ({{ insert_cols_csv }})\n values ({{ insert_cols_csv }})\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_snapshot_table_column_names", "macro.dbt.equals"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "target", "type": null, "description": ""}, {"name": "source", "type": null, "description": ""}, {"name": "insert_cols", "type": null, "description": ""}], "created_at": 1789422566.440812, "supported_languages": null}, "macro.dbt.create_columns": {"name": "create_columns", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "unique_id": "macro.dbt.create_columns", "macro_sql": "{% macro create_columns(relation, columns) %}\n {{ adapter.dispatch('create_columns', 'dbt')(relation, columns) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__create_columns"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "columns", "type": null, "description": ""}], "created_at": 1789422566.445017, "supported_languages": null}, "macro.dbt.default__create_columns": {"name": "default__create_columns", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "unique_id": "macro.dbt.default__create_columns", "macro_sql": "{% macro default__create_columns(relation, columns) %}\n {% for column in columns %}\n {% call statement() %}\n alter table {{ relation.render() }} add column {{ adapter.quote(column.name) }} {{ column.expanded_data_type }};\n {% endcall %}\n {% endfor %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "columns", "type": null, "description": ""}], "created_at": 1789422566.445764, "supported_languages": null}, "macro.dbt.post_snapshot": {"name": "post_snapshot", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "unique_id": "macro.dbt.post_snapshot", "macro_sql": "{% macro post_snapshot(staging_relation) %}\n {{ adapter.dispatch('post_snapshot', 'dbt')(staging_relation) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__post_snapshot"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "staging_relation", "type": null, "description": ""}], "created_at": 1789422566.4461465, "supported_languages": null}, "macro.dbt.default__post_snapshot": {"name": "default__post_snapshot", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "unique_id": "macro.dbt.default__post_snapshot", "macro_sql": "{% macro default__post_snapshot(staging_relation) %}\n {# no-op #}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "staging_relation", "type": null, "description": ""}], "created_at": 1789422566.4463596, "supported_languages": null}, "macro.dbt.get_true_sql": {"name": "get_true_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "unique_id": "macro.dbt.get_true_sql", "macro_sql": "{% macro get_true_sql() %}\n {{ adapter.dispatch('get_true_sql', 'dbt')() }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_true_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789422566.4467065, "supported_languages": null}, "macro.dbt.default__get_true_sql": {"name": "default__get_true_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "unique_id": "macro.dbt.default__get_true_sql", "macro_sql": "{% macro default__get_true_sql() %}\n {{ return('TRUE') }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789422566.446969, "supported_languages": null}, "macro.dbt.snapshot_staging_table": {"name": "snapshot_staging_table", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "unique_id": "macro.dbt.snapshot_staging_table", "macro_sql": "{% macro snapshot_staging_table(strategy, source_sql, target_relation) -%}\n {{ adapter.dispatch('snapshot_staging_table', 'dbt')(strategy, source_sql, target_relation) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__snapshot_staging_table"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "strategy", "type": null, "description": ""}, {"name": "source_sql", "type": null, "description": ""}, {"name": "target_relation", "type": null, "description": ""}], "created_at": 1789422566.4473934, "supported_languages": null}, "macro.dbt.get_snapshot_table_column_names": {"name": "get_snapshot_table_column_names", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "unique_id": "macro.dbt.get_snapshot_table_column_names", "macro_sql": "{% macro get_snapshot_table_column_names() %}\n {{ return({'dbt_valid_to': 'dbt_valid_to', 'dbt_valid_from': 'dbt_valid_from', 'dbt_scd_id': 'dbt_scd_id', 'dbt_updated_at': 'dbt_updated_at', 'dbt_is_deleted': 'dbt_is_deleted'}) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789422566.4479334, "supported_languages": null}, "macro.dbt.default__snapshot_staging_table": {"name": "default__snapshot_staging_table", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "unique_id": "macro.dbt.default__snapshot_staging_table", "macro_sql": "{% macro default__snapshot_staging_table(strategy, source_sql, target_relation) -%}\n {% set columns = config.get('snapshot_table_column_names') or get_snapshot_table_column_names() %}\n {% if strategy.hard_deletes == 'new_record' %}\n {% set new_scd_id = snapshot_hash_arguments([columns.dbt_scd_id, snapshot_get_time()]) %}\n {% endif %}\n with snapshot_query as (\n\n {{ source_sql }}\n\n ),\n\n snapshotted_data as (\n\n select *, {{ unique_key_fields(strategy.unique_key) }}\n from {{ target_relation }}\n where\n {% if config.get('dbt_valid_to_current') %}\n\t\t{% set source_unique_key = columns.dbt_valid_to | trim %}\n\t\t{% set target_unique_key = config.get('dbt_valid_to_current') | trim %}\n\n\t\t{# The exact equals semantics between NULL values depends on the current behavior flag set. Also, update records if the source field is null #}\n ( {{ equals(source_unique_key, target_unique_key) }} or {{ source_unique_key }} is null )\n {% else %}\n {{ columns.dbt_valid_to }} is null\n {% endif %}\n\n ),\n\n insertions_source_data as (\n\n select *, {{ unique_key_fields(strategy.unique_key) }},\n {{ strategy.updated_at }} as {{ columns.dbt_updated_at }},\n {{ strategy.updated_at }} as {{ columns.dbt_valid_from }},\n {{ get_dbt_valid_to_current(strategy, columns) }},\n {{ strategy.scd_id }} as {{ columns.dbt_scd_id }}\n\n from snapshot_query\n ),\n\n updates_source_data as (\n\n select *, {{ unique_key_fields(strategy.unique_key) }},\n {{ strategy.updated_at }} as {{ columns.dbt_updated_at }},\n {{ strategy.updated_at }} as {{ columns.dbt_valid_from }},\n {{ strategy.updated_at }} as {{ columns.dbt_valid_to }}\n\n from snapshot_query\n ),\n\n {%- if strategy.hard_deletes == 'invalidate' or strategy.hard_deletes == 'new_record' %}\n\n deletes_source_data as (\n\n select *, {{ unique_key_fields(strategy.unique_key) }}\n from snapshot_query\n ),\n {% endif %}\n\n insertions as (\n\n select\n 'insert' as dbt_change_type,\n source_data.*\n {%- if strategy.hard_deletes == 'new_record' -%}\n ,'False' as {{ columns.dbt_is_deleted }}\n {%- endif %}\n\n from insertions_source_data as source_data\n left outer join snapshotted_data\n on {{ unique_key_join_on(strategy.unique_key, \"snapshotted_data\", \"source_data\") }}\n where {{ unique_key_is_null(strategy.unique_key, \"snapshotted_data\") }}\n or ({{ unique_key_is_not_null(strategy.unique_key, \"snapshotted_data\") }} and (\n {{ strategy.row_changed }} {%- if strategy.hard_deletes == 'new_record' -%} or snapshotted_data.{{ columns.dbt_is_deleted }} = 'True' {% endif %}\n )\n\n )\n\n ),\n\n updates as (\n\n select\n 'update' as dbt_change_type,\n source_data.*,\n snapshotted_data.{{ columns.dbt_scd_id }}\n {%- if strategy.hard_deletes == 'new_record' -%}\n , snapshotted_data.{{ columns.dbt_is_deleted }}\n {%- endif %}\n\n from updates_source_data as source_data\n join snapshotted_data\n on {{ unique_key_join_on(strategy.unique_key, \"snapshotted_data\", \"source_data\") }}\n where (\n {{ strategy.row_changed }} {%- if strategy.hard_deletes == 'new_record' -%} or snapshotted_data.{{ columns.dbt_is_deleted }} = 'True' {% endif %}\n )\n )\n\n {%- if strategy.hard_deletes == 'invalidate' or strategy.hard_deletes == 'new_record' %}\n ,\n deletes as (\n\n select\n 'delete' as dbt_change_type,\n source_data.*,\n {{ snapshot_get_time() }} as {{ columns.dbt_valid_from }},\n {{ snapshot_get_time() }} as {{ columns.dbt_updated_at }},\n {{ snapshot_get_time() }} as {{ columns.dbt_valid_to }},\n snapshotted_data.{{ columns.dbt_scd_id }}\n {%- if strategy.hard_deletes == 'new_record' -%}\n , snapshotted_data.{{ columns.dbt_is_deleted }}\n {%- endif %}\n from snapshotted_data\n left join deletes_source_data as source_data\n on {{ unique_key_join_on(strategy.unique_key, \"snapshotted_data\", \"source_data\") }}\n where {{ unique_key_is_null(strategy.unique_key, \"source_data\") }}\n\n {%- if strategy.hard_deletes == 'new_record' %}\n and not (\n --avoid updating the record's valid_to if the latest entry is marked as deleted\n snapshotted_data.{{ columns.dbt_is_deleted }} = 'True'\n and\n {% if config.get('dbt_valid_to_current') -%}\n snapshotted_data.{{ columns.dbt_valid_to }} = {{ config.get('dbt_valid_to_current') }}\n {%- else -%}\n snapshotted_data.{{ columns.dbt_valid_to }} is null\n {%- endif %}\n )\n {%- endif %}\n )\n {%- endif %}\n\n {%- if strategy.hard_deletes == 'new_record' %}\n {% set snapshotted_cols = get_list_of_column_names(get_columns_in_relation(target_relation)) %}\n {% set source_col_names = get_columns_in_query(source_sql) %}\n ,\n deletion_records as (\n\n select\n 'insert' as dbt_change_type,\n {%- for col_name in source_col_names -%}\n {%- if col_name in snapshotted_cols -%}\n snapshotted_data.{{ adapter.quote(col_name) }},\n {%- else -%}\n source_data.{{ adapter.quote(col_name) }},\n {%- endif -%}\n {% endfor -%}\n {%- if strategy.unique_key | is_list -%}\n {%- for key in strategy.unique_key -%}\n snapshotted_data.{{ key }} as dbt_unique_key_{{ loop.index }},\n {% endfor -%}\n {%- else -%}\n snapshotted_data.dbt_unique_key as dbt_unique_key,\n {% endif -%}\n {{ snapshot_get_time() }} as {{ columns.dbt_valid_from }},\n {{ snapshot_get_time() }} as {{ columns.dbt_updated_at }},\n snapshotted_data.{{ columns.dbt_valid_to }} as {{ columns.dbt_valid_to }},\n {{ new_scd_id }} as {{ columns.dbt_scd_id }},\n 'True' as {{ columns.dbt_is_deleted }}\n from snapshotted_data\n left join deletes_source_data as source_data\n on {{ unique_key_join_on(strategy.unique_key, \"snapshotted_data\", \"source_data\") }}\n where {{ unique_key_is_null(strategy.unique_key, \"source_data\") }}\n and not (\n --avoid inserting a new record if the latest one is marked as deleted\n snapshotted_data.{{ columns.dbt_is_deleted }} = 'True'\n and\n {% if config.get('dbt_valid_to_current') -%}\n snapshotted_data.{{ columns.dbt_valid_to }} = {{ config.get('dbt_valid_to_current') }}\n {%- else -%}\n snapshotted_data.{{ columns.dbt_valid_to }} is null\n {%- endif %}\n )\n\n )\n {%- endif %}\n\n select * from insertions\n union all\n select * from updates\n {%- if strategy.hard_deletes == 'invalidate' or strategy.hard_deletes == 'new_record' %}\n union all\n select * from deletes\n {%- endif %}\n {%- if strategy.hard_deletes == 'new_record' %}\n union all\n select * from deletion_records\n {%- endif %}\n\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.get_snapshot_table_column_names", "macro.dbt.snapshot_hash_arguments", "macro.dbt.snapshot_get_time", "macro.dbt.unique_key_fields", "macro.dbt.equals", "macro.dbt.get_dbt_valid_to_current", "macro.dbt.unique_key_join_on", "macro.dbt.unique_key_is_null", "macro.dbt.unique_key_is_not_null", "macro.dbt.get_list_of_column_names", "macro.dbt.get_columns_in_relation", "macro.dbt.get_columns_in_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "strategy", "type": null, "description": ""}, {"name": "source_sql", "type": null, "description": ""}, {"name": "target_relation", "type": null, "description": ""}], "created_at": 1789422566.4569213, "supported_languages": null}, "macro.dbt.build_snapshot_table": {"name": "build_snapshot_table", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "unique_id": "macro.dbt.build_snapshot_table", "macro_sql": "{% macro build_snapshot_table(strategy, sql) -%}\n {{ adapter.dispatch('build_snapshot_table', 'dbt')(strategy, sql) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__build_snapshot_table"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "strategy", "type": null, "description": ""}, {"name": "sql", "type": null, "description": ""}], "created_at": 1789422566.457362, "supported_languages": null}, "macro.dbt.default__build_snapshot_table": {"name": "default__build_snapshot_table", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "unique_id": "macro.dbt.default__build_snapshot_table", "macro_sql": "{% macro default__build_snapshot_table(strategy, sql) %}\n {% set columns = config.get('snapshot_table_column_names') or get_snapshot_table_column_names() %}\n\n select *,\n {{ strategy.scd_id }} as {{ columns.dbt_scd_id }},\n {{ strategy.updated_at }} as {{ columns.dbt_updated_at }},\n {{ strategy.updated_at }} as {{ columns.dbt_valid_from }},\n {{ get_dbt_valid_to_current(strategy, columns) }}\n {%- if strategy.hard_deletes == 'new_record' -%}\n , 'False' as {{ columns.dbt_is_deleted }}\n {% endif -%}\n from (\n {{ sql }}\n ) sbq\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_snapshot_table_column_names", "macro.dbt.get_dbt_valid_to_current"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "strategy", "type": null, "description": ""}, {"name": "sql", "type": null, "description": ""}], "created_at": 1789422566.4584165, "supported_languages": null}, "macro.dbt.build_snapshot_staging_table": {"name": "build_snapshot_staging_table", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "unique_id": "macro.dbt.build_snapshot_staging_table", "macro_sql": "{% macro build_snapshot_staging_table(strategy, sql, target_relation) %}\n {% set temp_relation = make_temp_relation(target_relation) %}\n\n {% set select = snapshot_staging_table(strategy, sql, target_relation) %}\n\n {% call statement('build_snapshot_staging_relation') %}\n {{ create_table_as(True, temp_relation, select) }}\n {% endcall %}\n\n {% do return(temp_relation) %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.make_temp_relation", "macro.dbt.snapshot_staging_table", "macro.dbt.statement", "macro.dbt.create_table_as"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "strategy", "type": null, "description": ""}, {"name": "sql", "type": null, "description": ""}, {"name": "target_relation", "type": null, "description": ""}], "created_at": 1789422566.459296, "supported_languages": null}, "macro.dbt.get_updated_at_column_data_type": {"name": "get_updated_at_column_data_type", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "unique_id": "macro.dbt.get_updated_at_column_data_type", "macro_sql": "{% macro get_updated_at_column_data_type(snapshot_sql) %}\n {% set snapshot_sql_column_schema = get_column_schema_from_query(snapshot_sql) %}\n {% set dbt_updated_at_data_type = null %}\n {% set ns = namespace() -%} {#-- handle for-loop scoping with a namespace --#}\n {% set ns.dbt_updated_at_data_type = null -%}\n {% for column in snapshot_sql_column_schema %}\n {% if ((column.column == 'dbt_updated_at') or (column.column == 'DBT_UPDATED_AT')) %}\n {% set ns.dbt_updated_at_data_type = column.dtype %}\n {% endif %}\n {% endfor %}\n {{ return(ns.dbt_updated_at_data_type or none) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_column_schema_from_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "snapshot_sql", "type": null, "description": ""}], "created_at": 1789422566.4605103, "supported_languages": null}, "macro.dbt.check_time_data_types": {"name": "check_time_data_types", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "unique_id": "macro.dbt.check_time_data_types", "macro_sql": "{% macro check_time_data_types(sql) %}\n {% set dbt_updated_at_data_type = get_updated_at_column_data_type(sql) %}\n {% set snapshot_get_time_data_type = get_snapshot_get_time_data_type() %}\n {% if snapshot_get_time_data_type is not none and dbt_updated_at_data_type is not none and snapshot_get_time_data_type != dbt_updated_at_data_type %}\n {% if exceptions.warn_snapshot_timestamp_data_types %}\n {{ exceptions.warn_snapshot_timestamp_data_types(snapshot_get_time_data_type, dbt_updated_at_data_type) }}\n {% endif %}\n {% endif %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_updated_at_column_data_type", "macro.dbt.get_snapshot_get_time_data_type"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "sql", "type": null, "description": ""}], "created_at": 1789422566.4613829, "supported_languages": null}, "macro.dbt.get_dbt_valid_to_current": {"name": "get_dbt_valid_to_current", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "unique_id": "macro.dbt.get_dbt_valid_to_current", "macro_sql": "{% macro get_dbt_valid_to_current(strategy, columns) %}\n {% set dbt_valid_to_current = config.get('dbt_valid_to_current') or \"null\" %}\n coalesce(nullif({{ strategy.updated_at }}, {{ strategy.updated_at }}), {{dbt_valid_to_current}})\n as {{ columns.dbt_valid_to }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "strategy", "type": null, "description": ""}, {"name": "columns", "type": null, "description": ""}], "created_at": 1789422566.4619863, "supported_languages": null}, "macro.dbt.unique_key_fields": {"name": "unique_key_fields", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "unique_id": "macro.dbt.unique_key_fields", "macro_sql": "{% macro unique_key_fields(unique_key) %}\n {% if unique_key | is_list %}\n {% for key in unique_key %}\n {{ key }} as dbt_unique_key_{{ loop.index }}\n {%- if not loop.last %} , {%- endif %}\n {% endfor %}\n {% else %}\n {{ unique_key }} as dbt_unique_key\n {% endif %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "unique_key", "type": null, "description": ""}], "created_at": 1789422566.4627075, "supported_languages": null}, "macro.dbt.unique_key_join_on": {"name": "unique_key_join_on", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "unique_id": "macro.dbt.unique_key_join_on", "macro_sql": "{% macro unique_key_join_on(unique_key, identifier, from_identifier) %}\n {% if unique_key | is_list %}\n {% for key in unique_key %}\n\t {% set source_unique_key = (identifier ~ \".dbt_unique_key_\" ~ loop.index) | trim %}\n\t {% set target_unique_key = (from_identifier ~ \".dbt_unique_key_\" ~ loop.index) | trim %}\n\t {{ equals(source_unique_key, target_unique_key) }}\n {%- if not loop.last %} and {%- endif %}\n {% endfor %}\n {% else %}\n {{ identifier }}.dbt_unique_key = {{ from_identifier }}.dbt_unique_key\n {% endif %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.equals"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "unique_key", "type": null, "description": ""}, {"name": "identifier", "type": null, "description": ""}, {"name": "from_identifier", "type": null, "description": ""}], "created_at": 1789422566.4638612, "supported_languages": null}, "macro.dbt.unique_key_is_null": {"name": "unique_key_is_null", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "unique_id": "macro.dbt.unique_key_is_null", "macro_sql": "{% macro unique_key_is_null(unique_key, identifier) %}\n {% if unique_key | is_list %}\n {{ identifier }}.dbt_unique_key_1 is null\n {% else %}\n {{ identifier }}.dbt_unique_key is null\n {% endif %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "unique_key", "type": null, "description": ""}, {"name": "identifier", "type": null, "description": ""}], "created_at": 1789422566.4642923, "supported_languages": null}, "macro.dbt.unique_key_is_not_null": {"name": "unique_key_is_not_null", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "unique_id": "macro.dbt.unique_key_is_not_null", "macro_sql": "{% macro unique_key_is_not_null(unique_key, identifier) %}\n {% if unique_key | is_list %}\n {{ identifier }}.dbt_unique_key_1 is not null\n {% else %}\n {{ identifier }}.dbt_unique_key is not null\n {% endif %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "unique_key", "type": null, "description": ""}, {"name": "identifier", "type": null, "description": ""}], "created_at": 1789422566.4648025, "supported_languages": null}, "macro.dbt.get_aggregate_function_create_replace_signature": {"name": "get_aggregate_function_create_replace_signature", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/functions/aggregate.sql", "original_file_path": "macros/materializations/functions/aggregate.sql", "unique_id": "macro.dbt.get_aggregate_function_create_replace_signature", "macro_sql": "{% macro get_aggregate_function_create_replace_signature(target_relation) %}\n {{ return(adapter.dispatch('get_aggregate_function_create_replace_signature', 'dbt')(target_relation)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_aggregate_function_create_replace_signature"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "target_relation", "type": null, "description": ""}], "created_at": 1789422566.4662585, "supported_languages": null}, "macro.dbt.default__get_aggregate_function_create_replace_signature": {"name": "default__get_aggregate_function_create_replace_signature", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/functions/aggregate.sql", "original_file_path": "macros/materializations/functions/aggregate.sql", "unique_id": "macro.dbt.default__get_aggregate_function_create_replace_signature", "macro_sql": "{% macro default__get_aggregate_function_create_replace_signature(target_relation) %}\n CREATE OR REPLACE AGGREGATE FUNCTION {{ target_relation.render() }} ({{ get_formatted_aggregate_function_args()}})\n RETURNS {{ model.returns.data_type }}\n {{ get_function_language_specifier() }}\n {{ get_aggregate_function_volatility_specifier() }}\n {% if model.get('language') == 'python' %}\n {{ get_function_python_options() }}\n {% endif %}\n AS\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_formatted_aggregate_function_args", "macro.dbt.get_function_language_specifier", "macro.dbt.get_aggregate_function_volatility_specifier", "macro.dbt.get_function_python_options"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "target_relation", "type": null, "description": ""}], "created_at": 1789422566.4670286, "supported_languages": null}, "macro.dbt.get_formatted_aggregate_function_args": {"name": "get_formatted_aggregate_function_args", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/functions/aggregate.sql", "original_file_path": "macros/materializations/functions/aggregate.sql", "unique_id": "macro.dbt.get_formatted_aggregate_function_args", "macro_sql": "{% macro get_formatted_aggregate_function_args() %}\n {{ return(adapter.dispatch('get_formatted_aggregate_function_args', 'dbt')()) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_formatted_aggregate_function_args"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789422566.4673774, "supported_languages": null}, "macro.dbt.default__get_formatted_aggregate_function_args": {"name": "default__get_formatted_aggregate_function_args", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/functions/aggregate.sql", "original_file_path": "macros/materializations/functions/aggregate.sql", "unique_id": "macro.dbt.default__get_formatted_aggregate_function_args", "macro_sql": "{% macro default__get_formatted_aggregate_function_args() %}\n {# conveniently we can reuse the sql scalar function args #}\n {{ formatted_scalar_function_args_sql() }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.formatted_scalar_function_args_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789422566.46764, "supported_languages": null}, "macro.dbt.get_function_language_specifier": {"name": "get_function_language_specifier", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/functions/aggregate.sql", "original_file_path": "macros/materializations/functions/aggregate.sql", "unique_id": "macro.dbt.get_function_language_specifier", "macro_sql": "{% macro get_function_language_specifier() %}\n {{ return(adapter.dispatch('get_function_language_specifier', 'dbt')()) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_function_language_specifier"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789422566.4679794, "supported_languages": null}, "macro.dbt.default__get_function_language_specifier": {"name": "default__get_function_language_specifier", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/functions/aggregate.sql", "original_file_path": "macros/materializations/functions/aggregate.sql", "unique_id": "macro.dbt.default__get_function_language_specifier", "macro_sql": "{% macro default__get_function_language_specifier() %}\n {% set language = model.get('language') %}\n {% if language == 'sql' %}\n {# generally you dont need to specify the language for sql functions #}\n {% elif language == 'python' %}\n LANGUAGE PYTHON\n {% elif language == 'javascript' %}\n LANGUAGE js\n {% else %}\n {{ 'LANGUAGE ' ~ language.upper() }}\n {% endif %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789422566.4693208, "supported_languages": null}, "macro.dbt.get_aggregate_function_volatility_specifier": {"name": "get_aggregate_function_volatility_specifier", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/functions/aggregate.sql", "original_file_path": "macros/materializations/functions/aggregate.sql", "unique_id": "macro.dbt.get_aggregate_function_volatility_specifier", "macro_sql": "{% macro get_aggregate_function_volatility_specifier() %}\n {{ return(adapter.dispatch('get_aggregate_function_volatility_specifier', 'dbt')()) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_aggregate_function_volatility_specifier"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789422566.4697015, "supported_languages": null}, "macro.dbt.default__get_aggregate_function_volatility_specifier": {"name": "default__get_aggregate_function_volatility_specifier", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/functions/aggregate.sql", "original_file_path": "macros/materializations/functions/aggregate.sql", "unique_id": "macro.dbt.default__get_aggregate_function_volatility_specifier", "macro_sql": "{% macro default__get_aggregate_function_volatility_specifier() %}\n {{ scalar_function_volatility_sql() }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.scalar_function_volatility_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789422566.469934, "supported_languages": null}, "macro.dbt.get_function_python_options": {"name": "get_function_python_options", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/functions/aggregate.sql", "original_file_path": "macros/materializations/functions/aggregate.sql", "unique_id": "macro.dbt.get_function_python_options", "macro_sql": "{% macro get_function_python_options() %}\n {{ return(adapter.dispatch('get_function_python_options', 'dbt')()) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_function_python_options"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789422566.4702735, "supported_languages": null}, "macro.dbt.default__get_function_python_options": {"name": "default__get_function_python_options", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/functions/aggregate.sql", "original_file_path": "macros/materializations/functions/aggregate.sql", "unique_id": "macro.dbt.default__get_function_python_options", "macro_sql": "{% macro default__get_function_python_options() %}\n RUNTIME_VERSION = '{{ model.config.get('runtime_version') }}'\n HANDLER = '{{ model.config.get('entry_point') }}'\n {% set packages = model.config.get('packages', []) %}\n {% if packages %}\n PACKAGES = ('{{ packages | join(\"','\") }}')\n {% endif %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789422566.4710586, "supported_languages": null}, "macro.dbt.scalar_function_sql": {"name": "scalar_function_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/functions/scalar.sql", "original_file_path": "macros/materializations/functions/scalar.sql", "unique_id": "macro.dbt.scalar_function_sql", "macro_sql": "{% macro scalar_function_sql(target_relation) %}\n {{ return(adapter.dispatch('scalar_function_sql', 'dbt')(target_relation)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__scalar_function_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "target_relation", "type": null, "description": ""}], "created_at": 1789422566.4727728, "supported_languages": null}, "macro.dbt.default__scalar_function_sql": {"name": "default__scalar_function_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/functions/scalar.sql", "original_file_path": "macros/materializations/functions/scalar.sql", "unique_id": "macro.dbt.default__scalar_function_sql", "macro_sql": "{% macro default__scalar_function_sql(target_relation) %}\n {{ scalar_function_create_replace_signature_sql(target_relation) }}\n {{ scalar_function_body_sql() }};\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.scalar_function_create_replace_signature_sql", "macro.dbt.scalar_function_body_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "target_relation", "type": null, "description": ""}], "created_at": 1789422566.4731412, "supported_languages": null}, "macro.dbt.scalar_function_create_replace_signature_sql": {"name": "scalar_function_create_replace_signature_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/functions/scalar.sql", "original_file_path": "macros/materializations/functions/scalar.sql", "unique_id": "macro.dbt.scalar_function_create_replace_signature_sql", "macro_sql": "{% macro scalar_function_create_replace_signature_sql(target_relation) %}\n {{ return(adapter.dispatch('scalar_function_create_replace_signature_sql', 'dbt')(target_relation)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__scalar_function_create_replace_signature_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "target_relation", "type": null, "description": ""}], "created_at": 1789422566.4735677, "supported_languages": null}, "macro.dbt.default__scalar_function_create_replace_signature_sql": {"name": "default__scalar_function_create_replace_signature_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/functions/scalar.sql", "original_file_path": "macros/materializations/functions/scalar.sql", "unique_id": "macro.dbt.default__scalar_function_create_replace_signature_sql", "macro_sql": "{% macro default__scalar_function_create_replace_signature_sql(target_relation) %}\n CREATE OR REPLACE FUNCTION {{ target_relation.render() }} ({{ formatted_scalar_function_args_sql()}})\n RETURNS {{ model.returns.data_type }}\n {{ scalar_function_volatility_sql() }}\n AS\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.formatted_scalar_function_args_sql", "macro.dbt.scalar_function_volatility_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "target_relation", "type": null, "description": ""}], "created_at": 1789422566.4740436, "supported_languages": null}, "macro.dbt.formatted_scalar_function_args_sql": {"name": "formatted_scalar_function_args_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/functions/scalar.sql", "original_file_path": "macros/materializations/functions/scalar.sql", "unique_id": "macro.dbt.formatted_scalar_function_args_sql", "macro_sql": "{% macro formatted_scalar_function_args_sql() %}\n {{ return(adapter.dispatch('formatted_scalar_function_args_sql', 'dbt')()) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__formatted_scalar_function_args_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789422566.4744072, "supported_languages": null}, "macro.dbt.formatted_scalar_function_args_javascript": {"name": "formatted_scalar_function_args_javascript", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/functions/scalar.sql", "original_file_path": "macros/materializations/functions/scalar.sql", "unique_id": "macro.dbt.formatted_scalar_function_args_javascript", "macro_sql": "{% macro formatted_scalar_function_args_javascript() %}\n {{ return(adapter.dispatch('formatted_scalar_function_args_javascript', 'dbt')()) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__formatted_scalar_function_args_javascript"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789422566.4747882, "supported_languages": null}, "macro.dbt.default__formatted_scalar_function_args_sql": {"name": "default__formatted_scalar_function_args_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/functions/scalar.sql", "original_file_path": "macros/materializations/functions/scalar.sql", "unique_id": "macro.dbt.default__formatted_scalar_function_args_sql", "macro_sql": "{% macro default__formatted_scalar_function_args_sql() %}\n {% set args = [] %}\n {% for arg in model.arguments -%}\n {%- do args.append(arg.name ~ ' ' ~ arg.data_type) -%}\n {%- endfor %}\n {{ args | join(', ') }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789422566.4755492, "supported_languages": null}, "macro.dbt.default__formatted_scalar_function_args_javascript": {"name": "default__formatted_scalar_function_args_javascript", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/functions/scalar.sql", "original_file_path": "macros/materializations/functions/scalar.sql", "unique_id": "macro.dbt.default__formatted_scalar_function_args_javascript", "macro_sql": "{% macro default__formatted_scalar_function_args_javascript() %}\n {% set msg = \"formatted_scalar_function_args_javascript not implemented for adapter \" ~ adapter.type() %}\n {% do exceptions.raise_compiler_error(msg) %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789422566.4760053, "supported_languages": null}, "macro.dbt.scalar_function_body_sql": {"name": "scalar_function_body_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/functions/scalar.sql", "original_file_path": "macros/materializations/functions/scalar.sql", "unique_id": "macro.dbt.scalar_function_body_sql", "macro_sql": "{% macro scalar_function_body_sql() %}\n {{ return(adapter.dispatch('scalar_function_body_sql', 'dbt')()) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__scalar_function_body_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789422566.4763544, "supported_languages": null}, "macro.dbt.default__scalar_function_body_sql": {"name": "default__scalar_function_body_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/functions/scalar.sql", "original_file_path": "macros/materializations/functions/scalar.sql", "unique_id": "macro.dbt.default__scalar_function_body_sql", "macro_sql": "{% macro default__scalar_function_body_sql() %}\n $$\n {{ model.compiled_code }}\n $$ LANGUAGE SQL\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789422566.476606, "supported_languages": null}, "macro.dbt.scalar_function_volatility_sql": {"name": "scalar_function_volatility_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/functions/scalar.sql", "original_file_path": "macros/materializations/functions/scalar.sql", "unique_id": "macro.dbt.scalar_function_volatility_sql", "macro_sql": "{% macro scalar_function_volatility_sql() %}\n {{ return(adapter.dispatch('scalar_function_volatility_sql', 'dbt')()) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__scalar_function_volatility_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789422566.476951, "supported_languages": null}, "macro.dbt.scalar_function_volatility_javascript": {"name": "scalar_function_volatility_javascript", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/functions/scalar.sql", "original_file_path": "macros/materializations/functions/scalar.sql", "unique_id": "macro.dbt.scalar_function_volatility_javascript", "macro_sql": "{% macro scalar_function_volatility_javascript() %}\n {{ return(adapter.dispatch('scalar_function_volatility_javascript', 'dbt')()) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__scalar_function_volatility_javascript"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789422566.4772909, "supported_languages": null}, "macro.dbt.default__scalar_function_volatility_javascript": {"name": "default__scalar_function_volatility_javascript", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/functions/scalar.sql", "original_file_path": "macros/materializations/functions/scalar.sql", "unique_id": "macro.dbt.default__scalar_function_volatility_javascript", "macro_sql": "{% macro default__scalar_function_volatility_javascript() %}\n {% set volatility = model.config.get('volatility') %}\n {% if volatility != none %}\n {% set msg = \"Volatility is not supported by \" ~ adapter.type() ~ \" in javascript UDF and will be ignored\" %}\n {% do exceptions.warn(msg) %}\n {% endif %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789422566.5575764, "supported_languages": null}, "macro.dbt.default__scalar_function_volatility_sql": {"name": "default__scalar_function_volatility_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/functions/scalar.sql", "original_file_path": "macros/materializations/functions/scalar.sql", "unique_id": "macro.dbt.default__scalar_function_volatility_sql", "macro_sql": "{% macro default__scalar_function_volatility_sql() %}\n {% set volatility = model.config.get('volatility') %}\n {% if volatility == 'deterministic' %}\n IMMUTABLE\n {% elif volatility == 'stable' %}\n STABLE\n {% elif volatility == 'non-deterministic' %}\n VOLATILE\n {% elif volatility != none %}\n {# This shouldn't happen unless a new volatility is invented #}\n {% do unsupported_volatility_warning(volatility) %}\n {% endif %}\n {# If no volatility is set, don't add anything and let the data warehouse default it #}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.unsupported_volatility_warning"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789422566.55868, "supported_languages": null}, "macro.dbt.unsupported_volatility_warning": {"name": "unsupported_volatility_warning", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/functions/scalar.sql", "original_file_path": "macros/materializations/functions/scalar.sql", "unique_id": "macro.dbt.unsupported_volatility_warning", "macro_sql": "{% macro unsupported_volatility_warning(volatility) %}\n {{ return(adapter.dispatch('unsupported_volatility_warning', 'dbt')(volatility)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__unsupported_volatility_warning"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "volatility", "type": null, "description": ""}], "created_at": 1789422566.5591884, "supported_languages": null}, "macro.dbt.default__unsupported_volatility_warning": {"name": "default__unsupported_volatility_warning", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/functions/scalar.sql", "original_file_path": "macros/materializations/functions/scalar.sql", "unique_id": "macro.dbt.default__unsupported_volatility_warning", "macro_sql": "{% macro default__unsupported_volatility_warning(volatility) %}\n {% set msg = \"Found `\" ~ volatility ~ \"` volatility specified on function `\" ~ model.name ~ \"`. This volatility is not supported by \" ~ adapter.type() ~ \", and will be ignored\" %}\n {% do exceptions.warn(msg) %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "volatility", "type": null, "description": ""}], "created_at": 1789422566.5598834, "supported_languages": null}, "macro.dbt.materialization_function_default": {"name": "materialization_function_default", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/functions/function.sql", "original_file_path": "macros/materializations/functions/function.sql", "unique_id": "macro.dbt.materialization_function_default", "macro_sql": "{% materialization function, default, supported_languages=['sql', 'python', 'javascript'] %}\n {% set existing_relation = load_cached_relation(this) %}\n {% set target_relation = this.incorporate(type=this.Function) %}\n\n {{ run_hooks(pre_hooks) }}\n\n {% set function_config = this.get_function_config(model) %}\n {% set macro_name = this.get_function_macro_name(function_config) %}\n\n {# Doing this aliasing of adapter.dispatch is a hacky way to disable the static analysis of actually calling adapter.dispatch #}\n {# This is necessary because the static analysis breaks being able to dynamically pass a macro_name #}\n {% set _dispatch = adapter.dispatch %}\n\n {% set build_sql = _dispatch(macro_name, 'dbt')(target_relation) %}\n {{ function_execute_build_sql(build_sql, existing_relation, target_relation) }}\n {{ run_hooks(post_hooks) }}\n\n {{ return({'relations': [target_relation]}) }}\n\n{% endmaterialization %}", "depends_on": {"macros": ["macro.dbt.load_cached_relation", "macro.dbt.run_hooks", "macro.dbt.function_execute_build_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "supported_languages", "type": null, "description": ""}], "created_at": 1789422566.5620732, "supported_languages": ["sql", "python", "javascript"]}, "macro.dbt.function_execute_build_sql": {"name": "function_execute_build_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/functions/helpers.sql", "original_file_path": "macros/materializations/functions/helpers.sql", "unique_id": "macro.dbt.function_execute_build_sql", "macro_sql": "{% macro function_execute_build_sql(build_sql, existing_relation, target_relation) %}\n {{ return(adapter.dispatch('function_execute_build_sql', 'dbt')(build_sql, existing_relation, target_relation)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__function_execute_build_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "build_sql", "type": null, "description": ""}, {"name": "existing_relation", "type": null, "description": ""}, {"name": "target_relation", "type": null, "description": ""}], "created_at": 1789422566.562941, "supported_languages": null}, "macro.dbt.default__function_execute_build_sql": {"name": "default__function_execute_build_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/functions/helpers.sql", "original_file_path": "macros/materializations/functions/helpers.sql", "unique_id": "macro.dbt.default__function_execute_build_sql", "macro_sql": "{% macro default__function_execute_build_sql(build_sql, existing_relation, target_relation) %}\n\n {% set grant_config = config.get('grants') %}\n\n {% call statement(name=\"main\") %}\n {{ build_sql }}\n {% endcall %}\n\n {% set should_revoke = should_revoke(existing_relation, full_refresh_mode=True) %}\n {% do apply_grants(target_relation, grant_config, should_revoke=should_revoke) %}\n\n {% do persist_docs(target_relation, model) %}\n\n {{ adapter.commit() }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement", "macro.dbt.should_revoke", "macro.dbt.apply_grants", "macro.dbt.persist_docs"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "build_sql", "type": null, "description": ""}, {"name": "existing_relation", "type": null, "description": ""}, {"name": "target_relation", "type": null, "description": ""}], "created_at": 1789422566.5640967, "supported_languages": null}, "macro.dbt.materialization_table_default": {"name": "materialization_table_default", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/table.sql", "original_file_path": "macros/materializations/models/table.sql", "unique_id": "macro.dbt.materialization_table_default", "macro_sql": "{% materialization table, default %}\n\n {%- set existing_relation = load_cached_relation(this) -%}\n {%- set target_relation = this.incorporate(type='table') %}\n {%- set intermediate_relation = make_intermediate_relation(target_relation) -%}\n -- the intermediate_relation should not already exist in the database; get_relation\n -- will return None in that case. Otherwise, we get a relation that we can drop\n -- later, before we try to use this name for the current operation\n {%- set preexisting_intermediate_relation = load_cached_relation(intermediate_relation) -%}\n /*\n See ../view/view.sql for more information about this relation.\n */\n {%- set backup_relation_type = 'table' if existing_relation is none else existing_relation.type -%}\n {%- set backup_relation = make_backup_relation(target_relation, backup_relation_type) -%}\n -- as above, the backup_relation should not already exist\n {%- set preexisting_backup_relation = load_cached_relation(backup_relation) -%}\n -- grab current tables grants config for comparision later on\n {% set grant_config = config.get('grants') %}\n\n -- drop the temp relations if they exist already in the database\n {{ drop_relation_if_exists(preexisting_intermediate_relation) }}\n {{ drop_relation_if_exists(preexisting_backup_relation) }}\n\n {{ run_hooks(pre_hooks, inside_transaction=False) }}\n\n -- `BEGIN` happens here:\n {{ run_hooks(pre_hooks, inside_transaction=True) }}\n\n -- build model\n {% call statement('main') -%}\n {{ get_create_table_as_sql(False, intermediate_relation, sql) }}\n {%- endcall %}\n\n {% do create_indexes(intermediate_relation) %}\n\n -- cleanup\n {% if existing_relation is not none %}\n /* Do the equivalent of rename_if_exists. 'existing_relation' could have been dropped\n since the variable was first set. */\n {% set existing_relation = load_cached_relation(existing_relation) %}\n {% if existing_relation is not none %}\n {{ adapter.rename_relation(existing_relation, backup_relation) }}\n {% endif %}\n {% endif %}\n\n {{ adapter.rename_relation(intermediate_relation, target_relation) }}\n\n {{ run_hooks(post_hooks, inside_transaction=True) }}\n\n {% set should_revoke = should_revoke(existing_relation, full_refresh_mode=True) %}\n {% do apply_grants(target_relation, grant_config, should_revoke=should_revoke) %}\n\n {% do persist_docs(target_relation, model) %}\n\n -- `COMMIT` happens here\n {{ adapter.commit() }}\n\n -- finally, drop the existing/backup relation after the commit\n {{ drop_relation_if_exists(backup_relation) }}\n\n {{ run_hooks(post_hooks, inside_transaction=False) }}\n\n {{ return({'relations': [target_relation]}) }}\n{% endmaterialization %}", "depends_on": {"macros": ["macro.dbt.load_cached_relation", "macro.dbt.make_intermediate_relation", "macro.dbt.make_backup_relation", "macro.dbt.drop_relation_if_exists", "macro.dbt.run_hooks", "macro.dbt.statement", "macro.dbt.get_create_table_as_sql", "macro.dbt.create_indexes", "macro.dbt.should_revoke", "macro.dbt.apply_grants", "macro.dbt.persist_docs"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "supported_languages", "type": null, "description": ""}], "created_at": 1789422566.5689363, "supported_languages": ["sql"]}, "macro.dbt.materialization_materialized_view_default": {"name": "materialization_materialized_view_default", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/materialized_view.sql", "original_file_path": "macros/materializations/models/materialized_view.sql", "unique_id": "macro.dbt.materialization_materialized_view_default", "macro_sql": "{% materialization materialized_view, default %}\n {% set existing_relation = load_cached_relation(this) %}\n {% set target_relation = this.incorporate(type=this.MaterializedView) %}\n {% set intermediate_relation = make_intermediate_relation(target_relation) %}\n {% set backup_relation_type = target_relation.MaterializedView if existing_relation is none else existing_relation.type %}\n {% set backup_relation = make_backup_relation(target_relation, backup_relation_type) %}\n\n {{ materialized_view_setup(backup_relation, intermediate_relation, pre_hooks) }}\n\n {% set build_sql = materialized_view_get_build_sql(existing_relation, target_relation, backup_relation, intermediate_relation) %}\n\n {% if build_sql == '' %}\n {{ materialized_view_execute_no_op(target_relation) }}\n {% else %}\n {{ materialized_view_execute_build_sql(build_sql, existing_relation, target_relation, post_hooks) }}\n {% endif %}\n\n {{ materialized_view_teardown(backup_relation, intermediate_relation, post_hooks) }}\n\n {{ return({'relations': [target_relation]}) }}\n\n{% endmaterialization %}", "depends_on": {"macros": ["macro.dbt.load_cached_relation", "macro.dbt.make_intermediate_relation", "macro.dbt.make_backup_relation", "macro.dbt.materialized_view_setup", "macro.dbt.materialized_view_get_build_sql", "macro.dbt.materialized_view_execute_no_op", "macro.dbt.materialized_view_execute_build_sql", "macro.dbt.materialized_view_teardown"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "supported_languages", "type": null, "description": ""}], "created_at": 1789422566.572397, "supported_languages": ["sql"]}, "macro.dbt.materialized_view_setup": {"name": "materialized_view_setup", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/materialized_view.sql", "original_file_path": "macros/materializations/models/materialized_view.sql", "unique_id": "macro.dbt.materialized_view_setup", "macro_sql": "{% macro materialized_view_setup(backup_relation, intermediate_relation, pre_hooks) %}\n\n -- backup_relation and intermediate_relation should not already exist in the database\n -- it's possible these exist because of a previous run that exited unexpectedly\n {% set preexisting_backup_relation = load_cached_relation(backup_relation) %}\n {% set preexisting_intermediate_relation = load_cached_relation(intermediate_relation) %}\n\n -- drop the temp relations if they exist already in the database\n {{ drop_relation_if_exists(preexisting_backup_relation) }}\n {{ drop_relation_if_exists(preexisting_intermediate_relation) }}\n\n {{ run_hooks(pre_hooks, inside_transaction=False) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.load_cached_relation", "macro.dbt.drop_relation_if_exists", "macro.dbt.run_hooks"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "backup_relation", "type": null, "description": ""}, {"name": "intermediate_relation", "type": null, "description": ""}, {"name": "pre_hooks", "type": null, "description": ""}], "created_at": 1789422566.5733616, "supported_languages": null}, "macro.dbt.materialized_view_teardown": {"name": "materialized_view_teardown", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/materialized_view.sql", "original_file_path": "macros/materializations/models/materialized_view.sql", "unique_id": "macro.dbt.materialized_view_teardown", "macro_sql": "{% macro materialized_view_teardown(backup_relation, intermediate_relation, post_hooks) %}\n\n -- drop the temp relations if they exist to leave the database clean for the next run\n {{ drop_relation_if_exists(backup_relation) }}\n {{ drop_relation_if_exists(intermediate_relation) }}\n\n {{ run_hooks(post_hooks, inside_transaction=False) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.drop_relation_if_exists", "macro.dbt.run_hooks"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "backup_relation", "type": null, "description": ""}, {"name": "intermediate_relation", "type": null, "description": ""}, {"name": "post_hooks", "type": null, "description": ""}], "created_at": 1789422566.573995, "supported_languages": null}, "macro.dbt.materialized_view_get_build_sql": {"name": "materialized_view_get_build_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/materialized_view.sql", "original_file_path": "macros/materializations/models/materialized_view.sql", "unique_id": "macro.dbt.materialized_view_get_build_sql", "macro_sql": "{% macro materialized_view_get_build_sql(existing_relation, target_relation, backup_relation, intermediate_relation) %}\n\n {% set full_refresh_mode = should_full_refresh() %}\n\n -- determine the scenario we're in: create, full_refresh, alter, refresh data\n {% if existing_relation is none %}\n {% set build_sql = get_create_materialized_view_as_sql(target_relation, sql) %}\n {% elif full_refresh_mode or not existing_relation.is_materialized_view %}\n {% set build_sql = get_replace_sql(existing_relation, target_relation, sql) %}\n {% else %}\n\n -- get config options\n {% set on_configuration_change = config.get('on_configuration_change') %}\n {% set configuration_changes = get_materialized_view_configuration_changes(existing_relation, config) %}\n\n {% if configuration_changes is none %}\n {% set build_sql = refresh_materialized_view(target_relation) %}\n\n {% elif on_configuration_change == 'apply' %}\n {% set build_sql = get_alter_materialized_view_as_sql(target_relation, configuration_changes, sql, existing_relation, backup_relation, intermediate_relation) %}\n {% elif on_configuration_change == 'continue' %}\n {% set build_sql = '' %}\n {{ exceptions.warn(\"Configuration changes were identified and `on_configuration_change` was set to `continue` for `\" ~ target_relation.render() ~ \"`\") }}\n {% elif on_configuration_change == 'fail' %}\n {{ exceptions.raise_fail_fast_error(\"Configuration changes were identified and `on_configuration_change` was set to `fail` for `\" ~ target_relation.render() ~ \"`\") }}\n\n {% else %}\n -- this only happens if the user provides a value other than `apply`, 'skip', 'fail'\n {{ exceptions.raise_compiler_error(\"Unexpected configuration scenario\") }}\n\n {% endif %}\n\n {% endif %}\n\n {% do return(build_sql) %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.should_full_refresh", "macro.dbt.get_create_materialized_view_as_sql", "macro.dbt.get_replace_sql", "macro.dbt.get_materialized_view_configuration_changes", "macro.dbt.refresh_materialized_view", "macro.dbt.get_alter_materialized_view_as_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "existing_relation", "type": null, "description": ""}, {"name": "target_relation", "type": null, "description": ""}, {"name": "backup_relation", "type": null, "description": ""}, {"name": "intermediate_relation", "type": null, "description": ""}], "created_at": 1789422566.5767748, "supported_languages": null}, "macro.dbt.materialized_view_execute_no_op": {"name": "materialized_view_execute_no_op", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/materialized_view.sql", "original_file_path": "macros/materializations/models/materialized_view.sql", "unique_id": "macro.dbt.materialized_view_execute_no_op", "macro_sql": "{% macro materialized_view_execute_no_op(target_relation) %}\n {% do store_raw_result(\n name=\"main\",\n message=\"skip \" ~ target_relation,\n code=\"skip\",\n rows_affected=\"-1\"\n ) %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "target_relation", "type": null, "description": ""}], "created_at": 1789422566.5773506, "supported_languages": null}, "macro.dbt.materialized_view_execute_build_sql": {"name": "materialized_view_execute_build_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/materialized_view.sql", "original_file_path": "macros/materializations/models/materialized_view.sql", "unique_id": "macro.dbt.materialized_view_execute_build_sql", "macro_sql": "{% macro materialized_view_execute_build_sql(build_sql, existing_relation, target_relation, post_hooks) %}\n\n -- `BEGIN` happens here:\n {{ run_hooks(pre_hooks, inside_transaction=True) }}\n\n {% set grant_config = config.get('grants') %}\n\n {% call statement(name=\"main\") %}\n {{ build_sql }}\n {% endcall %}\n\n {% set should_revoke = should_revoke(existing_relation, full_refresh_mode=True) %}\n {% do apply_grants(target_relation, grant_config, should_revoke=should_revoke) %}\n\n {% do persist_docs(target_relation, model) %}\n\n {{ run_hooks(post_hooks, inside_transaction=True) }}\n\n {{ adapter.commit() }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.run_hooks", "macro.dbt.statement", "macro.dbt.should_revoke", "macro.dbt.apply_grants", "macro.dbt.persist_docs"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "build_sql", "type": null, "description": ""}, {"name": "existing_relation", "type": null, "description": ""}, {"name": "target_relation", "type": null, "description": ""}, {"name": "post_hooks", "type": null, "description": ""}], "created_at": 1789422566.5787964, "supported_languages": null}, "macro.dbt.materialization_view_default": {"name": "materialization_view_default", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/view.sql", "original_file_path": "macros/materializations/models/view.sql", "unique_id": "macro.dbt.materialization_view_default", "macro_sql": "{%- materialization view, default -%}\n\n {%- set existing_relation = load_cached_relation(this) -%}\n {%- set target_relation = this.incorporate(type='view') -%}\n {%- set intermediate_relation = make_intermediate_relation(target_relation) -%}\n\n -- the intermediate_relation should not already exist in the database; get_relation\n -- will return None in that case. Otherwise, we get a relation that we can drop\n -- later, before we try to use this name for the current operation\n {%- set preexisting_intermediate_relation = load_cached_relation(intermediate_relation) -%}\n /*\n This relation (probably) doesn't exist yet. If it does exist, it's a leftover from\n a previous run, and we're going to try to drop it immediately. At the end of this\n materialization, we're going to rename the \"existing_relation\" to this identifier,\n and then we're going to drop it. In order to make sure we run the correct one of:\n - drop view ...\n - drop table ...\n\n We need to set the type of this relation to be the type of the existing_relation, if it exists,\n or else \"view\" as a sane default if it does not. Note that if the existing_relation does not\n exist, then there is nothing to move out of the way and subsequentally drop. In that case,\n this relation will be effectively unused.\n */\n {%- set backup_relation_type = 'view' if existing_relation is none else existing_relation.type -%}\n {%- set backup_relation = make_backup_relation(target_relation, backup_relation_type) -%}\n -- as above, the backup_relation should not already exist\n {%- set preexisting_backup_relation = load_cached_relation(backup_relation) -%}\n -- grab current tables grants config for comparision later on\n {% set grant_config = config.get('grants') %}\n\n {{ run_hooks(pre_hooks, inside_transaction=False) }}\n\n -- drop the temp relations if they exist already in the database\n {{ drop_relation_if_exists(preexisting_intermediate_relation) }}\n {{ drop_relation_if_exists(preexisting_backup_relation) }}\n\n -- `BEGIN` happens here:\n {{ run_hooks(pre_hooks, inside_transaction=True) }}\n\n -- build model\n {% call statement('main') -%}\n {{ get_create_view_as_sql(intermediate_relation, sql) }}\n {%- endcall %}\n\n -- cleanup\n -- move the existing view out of the way\n {% if existing_relation is not none %}\n /* Do the equivalent of rename_if_exists. 'existing_relation' could have been dropped\n since the variable was first set. */\n {% set existing_relation = load_cached_relation(existing_relation) %}\n {% if existing_relation is not none %}\n {{ adapter.rename_relation(existing_relation, backup_relation) }}\n {% endif %}\n {% endif %}\n {{ adapter.rename_relation(intermediate_relation, target_relation) }}\n\n {% set should_revoke = should_revoke(existing_relation, full_refresh_mode=True) %}\n {% do apply_grants(target_relation, grant_config, should_revoke=should_revoke) %}\n\n {% do persist_docs(target_relation, model) %}\n\n {{ run_hooks(post_hooks, inside_transaction=True) }}\n\n {{ adapter.commit() }}\n\n {{ drop_relation_if_exists(backup_relation) }}\n\n {{ run_hooks(post_hooks, inside_transaction=False) }}\n\n {{ return({'relations': [target_relation]}) }}\n\n{%- endmaterialization -%}", "depends_on": {"macros": ["macro.dbt.load_cached_relation", "macro.dbt.make_intermediate_relation", "macro.dbt.make_backup_relation", "macro.dbt.run_hooks", "macro.dbt.drop_relation_if_exists", "macro.dbt.statement", "macro.dbt.get_create_view_as_sql", "macro.dbt.should_revoke", "macro.dbt.apply_grants", "macro.dbt.persist_docs"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "supported_languages", "type": null, "description": ""}], "created_at": 1789422566.5831225, "supported_languages": ["sql"]}, "macro.dbt.materialization_clone_default": {"name": "materialization_clone_default", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/clone/clone.sql", "original_file_path": "macros/materializations/models/clone/clone.sql", "unique_id": "macro.dbt.materialization_clone_default", "macro_sql": "{%- materialization clone, default -%}\n\n {%- set relations = {'relations': []} -%}\n\n {%- if not defer_relation -%}\n -- nothing to do\n {{ log(\"No relation found in state manifest for \" ~ model.unique_id, info=True) }}\n {{ return(relations) }}\n {%- endif -%}\n\n {%- set existing_relation = load_cached_relation(this) -%}\n\n {%- if existing_relation and not flags.FULL_REFRESH -%}\n -- noop!\n {{ log(\"Relation \" ~ existing_relation ~ \" already exists\", info=True) }}\n {{ return(relations) }}\n {%- endif -%}\n\n {%- set other_existing_relation = load_cached_relation(defer_relation) -%}\n\n -- If this is a database that can do zero-copy cloning of tables, and the other relation is a table, then this will be a table\n -- Otherwise, this will be a view\n\n {% set can_clone_table = can_clone_table() %}\n {%- set grant_config = config.get('grants') -%}\n\n {%- if other_existing_relation and other_existing_relation.type == 'table' and can_clone_table -%}\n\n {%- set target_relation = this.incorporate(type='table') -%}\n {% if existing_relation is not none and not existing_relation.is_table %}\n {{ log(\"Dropping relation \" ~ existing_relation.render() ~ \" because it is of type \" ~ existing_relation.type) }}\n {{ drop_relation_if_exists(existing_relation) }}\n {% endif %}\n\n -- as a general rule, data platforms that can clone tables can also do atomic 'create or replace'\n {% if target_relation.database == defer_relation.database and\n target_relation.schema == defer_relation.schema and\n target_relation.identifier == defer_relation.identifier %}\n {{ log(\"Target relation and defer relation are the same, skipping clone for relation: \" ~ target_relation.render()) }}\n {% else %}\n {% call statement('main') %}\n {{ create_or_replace_clone(target_relation, defer_relation) }}\n {% endcall %}\n {% endif %}\n {% set should_revoke = should_revoke(existing_relation, full_refresh_mode=True) %}\n {% do apply_grants(target_relation, grant_config, should_revoke=should_revoke) %}\n {% do persist_docs(target_relation, model) %}\n\n {{ return({'relations': [target_relation]}) }}\n\n {%- else -%}\n\n {%- set target_relation = this.incorporate(type='view') -%}\n\n -- reuse the view materialization\n -- TODO: support actual dispatch for materialization macros\n -- Tracking ticket: https://github.com/dbt-labs/dbt-core/issues/7799\n {% set search_name = \"materialization_view_\" ~ adapter.type() %}\n {% if not search_name in context %}\n {% set search_name = \"materialization_view_default\" %}\n {% endif %}\n {% set materialization_macro = context[search_name] %}\n {% set relations = materialization_macro() %}\n {{ return(relations) }}\n\n {%- endif -%}\n\n{%- endmaterialization -%}", "depends_on": {"macros": ["macro.dbt.load_cached_relation", "macro.dbt.can_clone_table", "macro.dbt.drop_relation_if_exists", "macro.dbt.statement", "macro.dbt.create_or_replace_clone", "macro.dbt.should_revoke", "macro.dbt.apply_grants", "macro.dbt.persist_docs"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "supported_languages", "type": null, "description": ""}], "created_at": 1789422566.5887384, "supported_languages": ["sql"]}, "macro.dbt.can_clone_table": {"name": "can_clone_table", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/clone/can_clone_table.sql", "original_file_path": "macros/materializations/models/clone/can_clone_table.sql", "unique_id": "macro.dbt.can_clone_table", "macro_sql": "{% macro can_clone_table() %}\n {{ return(adapter.dispatch('can_clone_table', 'dbt')()) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__can_clone_table"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789422566.5893815, "supported_languages": null}, "macro.dbt.default__can_clone_table": {"name": "default__can_clone_table", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/clone/can_clone_table.sql", "original_file_path": "macros/materializations/models/clone/can_clone_table.sql", "unique_id": "macro.dbt.default__can_clone_table", "macro_sql": "{% macro default__can_clone_table() %}\n {{ return(False) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789422566.5896866, "supported_languages": null}, "macro.dbt.create_or_replace_clone": {"name": "create_or_replace_clone", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/clone/create_or_replace_clone.sql", "original_file_path": "macros/materializations/models/clone/create_or_replace_clone.sql", "unique_id": "macro.dbt.create_or_replace_clone", "macro_sql": "{% macro create_or_replace_clone(this_relation, defer_relation) %}\n {{ return(adapter.dispatch('create_or_replace_clone', 'dbt')(this_relation, defer_relation)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__create_or_replace_clone"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "this_relation", "type": null, "description": ""}, {"name": "defer_relation", "type": null, "description": ""}], "created_at": 1789422566.5903094, "supported_languages": null}, "macro.dbt.default__create_or_replace_clone": {"name": "default__create_or_replace_clone", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/clone/create_or_replace_clone.sql", "original_file_path": "macros/materializations/models/clone/create_or_replace_clone.sql", "unique_id": "macro.dbt.default__create_or_replace_clone", "macro_sql": "{% macro default__create_or_replace_clone(this_relation, defer_relation) %}\n create or replace table {{ this_relation.render() }} clone {{ defer_relation.render() }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "this_relation", "type": null, "description": ""}, {"name": "defer_relation", "type": null, "description": ""}], "created_at": 1789422566.5907218, "supported_languages": null}, "macro.dbt.materialization_incremental_default": {"name": "materialization_incremental_default", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/incremental.sql", "original_file_path": "macros/materializations/models/incremental/incremental.sql", "unique_id": "macro.dbt.materialization_incremental_default", "macro_sql": "{% materialization incremental, default -%}\n\n -- relations\n {%- set existing_relation = load_cached_relation(this) -%}\n {%- set target_relation = this.incorporate(type='table') -%}\n {%- set temp_relation = make_temp_relation(target_relation)-%}\n {%- set intermediate_relation = make_intermediate_relation(target_relation)-%}\n {%- set backup_relation_type = 'table' if existing_relation is none else existing_relation.type -%}\n {%- set backup_relation = make_backup_relation(target_relation, backup_relation_type) -%}\n\n -- configs\n {%- set unique_key = config.get('unique_key') -%}\n {%- set full_refresh_mode = (should_full_refresh() or existing_relation.is_view) -%}\n {%- set on_schema_change = incremental_validate_on_schema_change(config.get('on_schema_change'), default='ignore') -%}\n\n -- the temp_ and backup_ relations should not already exist in the database; get_relation\n -- will return None in that case. Otherwise, we get a relation that we can drop\n -- later, before we try to use this name for the current operation. This has to happen before\n -- BEGIN, in a separate transaction\n {%- set preexisting_intermediate_relation = load_cached_relation(intermediate_relation)-%}\n {%- set preexisting_backup_relation = load_cached_relation(backup_relation) -%}\n -- grab current tables grants config for comparision later on\n {% set grant_config = config.get('grants') %}\n {{ drop_relation_if_exists(preexisting_intermediate_relation) }}\n {{ drop_relation_if_exists(preexisting_backup_relation) }}\n\n {{ run_hooks(pre_hooks, inside_transaction=False) }}\n\n -- `BEGIN` happens here:\n {{ run_hooks(pre_hooks, inside_transaction=True) }}\n\n {% set to_drop = [] %}\n\n {% set incremental_strategy = config.get('incremental_strategy') or 'default' %}\n {% set strategy_sql_macro_func = adapter.get_incremental_strategy_macro(context, incremental_strategy) %}\n\n {% if existing_relation is none %}\n {% set build_sql = get_create_table_as_sql(False, target_relation, sql) %}\n {% set relation_for_indexes = target_relation %}\n {% elif full_refresh_mode %}\n {% set build_sql = get_create_table_as_sql(False, intermediate_relation, sql) %}\n {% set relation_for_indexes = intermediate_relation %}\n {% set need_swap = true %}\n {% else %}\n {% do run_query(get_create_table_as_sql(True, temp_relation, sql)) %}\n {% set relation_for_indexes = temp_relation %}\n {% set contract_config = config.get('contract') %}\n {% if not contract_config or not contract_config.enforced %}\n {% do adapter.expand_target_column_types(\n from_relation=temp_relation,\n to_relation=target_relation) %}\n {% endif %}\n {#-- Process schema changes. Returns dict of changes if successful. Use source columns for upserting/merging --#}\n {% set dest_columns = process_schema_changes(on_schema_change, temp_relation, existing_relation) %}\n {% if not dest_columns %}\n {% set dest_columns = adapter.get_columns_in_relation(existing_relation) %}\n {% endif %}\n\n {#-- Get the incremental_strategy, the macro to use for the strategy, and build the sql --#}\n {% set incremental_predicates = config.get('predicates', none) or config.get('incremental_predicates', none) %}\n {% set strategy_arg_dict = ({'target_relation': target_relation, 'temp_relation': temp_relation, 'unique_key': unique_key, 'dest_columns': dest_columns, 'incremental_predicates': incremental_predicates }) %}\n {% set build_sql = strategy_sql_macro_func(strategy_arg_dict) %}\n\n {% endif %}\n\n {% call statement(\"main\") %}\n {{ build_sql }}\n {% endcall %}\n\n {% if existing_relation is none or existing_relation.is_view or should_full_refresh() %}\n {% do create_indexes(relation_for_indexes) %}\n {% endif %}\n\n {% if need_swap %}\n {% do adapter.rename_relation(target_relation, backup_relation) %}\n {% do adapter.rename_relation(intermediate_relation, target_relation) %}\n {% do to_drop.append(backup_relation) %}\n {% endif %}\n\n {% set should_revoke = should_revoke(existing_relation, full_refresh_mode) %}\n {% do apply_grants(target_relation, grant_config, should_revoke=should_revoke) %}\n\n {% do persist_docs(target_relation, model) %}\n\n {{ run_hooks(post_hooks, inside_transaction=True) }}\n\n -- `COMMIT` happens here\n {% do adapter.commit() %}\n\n {% for rel in to_drop %}\n {% do adapter.drop_relation(rel) %}\n {% endfor %}\n\n {{ run_hooks(post_hooks, inside_transaction=False) }}\n\n {{ return({'relations': [target_relation]}) }}\n\n{%- endmaterialization %}", "depends_on": {"macros": ["macro.dbt.load_cached_relation", "macro.dbt.make_temp_relation", "macro.dbt.make_intermediate_relation", "macro.dbt.make_backup_relation", "macro.dbt.should_full_refresh", "macro.dbt.incremental_validate_on_schema_change", "macro.dbt.drop_relation_if_exists", "macro.dbt.run_hooks", "macro.dbt.get_create_table_as_sql", "macro.dbt.run_query", "macro.dbt.process_schema_changes", "macro.dbt.statement", "macro.dbt.create_indexes", "macro.dbt.should_revoke", "macro.dbt.apply_grants", "macro.dbt.persist_docs"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "supported_languages", "type": null, "description": ""}], "created_at": 1789422566.599978, "supported_languages": ["sql"]}, "macro.dbt.get_quoted_csv": {"name": "get_quoted_csv", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/column_helpers.sql", "original_file_path": "macros/materializations/models/incremental/column_helpers.sql", "unique_id": "macro.dbt.get_quoted_csv", "macro_sql": "{% macro get_quoted_csv(column_names) %}\n\n {% set quoted = [] %}\n {% for col in column_names -%}\n {%- do quoted.append(adapter.quote(col)) -%}\n {%- endfor %}\n\n {%- set dest_cols_csv = quoted | join(', ') -%}\n {{ return(dest_cols_csv) }}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "column_names", "type": null, "description": ""}], "created_at": 1789422566.60195, "supported_languages": null}, "macro.dbt.diff_columns": {"name": "diff_columns", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/column_helpers.sql", "original_file_path": "macros/materializations/models/incremental/column_helpers.sql", "unique_id": "macro.dbt.diff_columns", "macro_sql": "{% macro diff_columns(source_columns, target_columns) %}\n\n {% set result = [] %}\n {% set source_names = source_columns | map(attribute = 'column') | list %}\n {% set target_names = target_columns | map(attribute = 'column') | list %}\n\n {# --check whether the name attribute exists in the target - this does not perform a data type check #}\n {% for sc in source_columns %}\n {% if sc.name not in target_names %}\n {{ result.append(sc) }}\n {% endif %}\n {% endfor %}\n\n {{ return(result) }}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "source_columns", "type": null, "description": ""}, {"name": "target_columns", "type": null, "description": ""}], "created_at": 1789422566.6031625, "supported_languages": null}, "macro.dbt.diff_column_data_types": {"name": "diff_column_data_types", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/column_helpers.sql", "original_file_path": "macros/materializations/models/incremental/column_helpers.sql", "unique_id": "macro.dbt.diff_column_data_types", "macro_sql": "{% macro diff_column_data_types(source_columns, target_columns) %}\n {{ return(adapter.dispatch('diff_column_data_types', 'dbt')(source_columns, target_columns)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__diff_column_data_types"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "source_columns", "type": null, "description": ""}, {"name": "target_columns", "type": null, "description": ""}], "created_at": 1789422566.6036859, "supported_languages": null}, "macro.dbt.default__diff_column_data_types": {"name": "default__diff_column_data_types", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/column_helpers.sql", "original_file_path": "macros/materializations/models/incremental/column_helpers.sql", "unique_id": "macro.dbt.default__diff_column_data_types", "macro_sql": "{% macro default__diff_column_data_types(source_columns, target_columns) %}\n {% set result = [] %}\n {% for sc in source_columns %}\n {% set tc = target_columns | selectattr(\"name\", \"equalto\", sc.name) | list | first %}\n {% if tc %}\n {% if sc.expanded_data_type != tc.expanded_data_type and not sc.can_expand_to(other_column=tc) %}\n {{ result.append( { 'column_name': tc.name, 'new_type': sc.expanded_data_type } ) }}\n {% endif %}\n {% endif %}\n {% endfor %}\n\n {{ return(result) }}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "source_columns", "type": null, "description": ""}, {"name": "target_columns", "type": null, "description": ""}], "created_at": 1789422566.605084, "supported_languages": null}, "macro.dbt.get_merge_update_columns": {"name": "get_merge_update_columns", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/column_helpers.sql", "original_file_path": "macros/materializations/models/incremental/column_helpers.sql", "unique_id": "macro.dbt.get_merge_update_columns", "macro_sql": "{% macro get_merge_update_columns(merge_update_columns, merge_exclude_columns, dest_columns) %}\n {{ return(adapter.dispatch('get_merge_update_columns', 'dbt')(merge_update_columns, merge_exclude_columns, dest_columns)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_merge_update_columns"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "merge_update_columns", "type": null, "description": ""}, {"name": "merge_exclude_columns", "type": null, "description": ""}, {"name": "dest_columns", "type": null, "description": ""}], "created_at": 1789422566.6056132, "supported_languages": null}, "macro.dbt.default__get_merge_update_columns": {"name": "default__get_merge_update_columns", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/column_helpers.sql", "original_file_path": "macros/materializations/models/incremental/column_helpers.sql", "unique_id": "macro.dbt.default__get_merge_update_columns", "macro_sql": "{% macro default__get_merge_update_columns(merge_update_columns, merge_exclude_columns, dest_columns) %}\n {%- set default_cols = dest_columns | map(attribute=\"quoted\") | list -%}\n\n {%- if merge_update_columns and merge_exclude_columns -%}\n {{ exceptions.raise_compiler_error(\n 'Model cannot specify merge_update_columns and merge_exclude_columns. Please update model to use only one config'\n )}}\n {%- elif merge_update_columns -%}\n {%- set update_columns = merge_update_columns -%}\n {%- elif merge_exclude_columns -%}\n {%- set update_columns = [] -%}\n {%- for column in dest_columns -%}\n {% if column.column | lower not in merge_exclude_columns | map(\"lower\") | list %}\n {%- do update_columns.append(column.quoted) -%}\n {% endif %}\n {%- endfor -%}\n {%- else -%}\n {%- set update_columns = default_cols -%}\n {%- endif -%}\n\n {{ return(update_columns) }}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "merge_update_columns", "type": null, "description": ""}, {"name": "merge_exclude_columns", "type": null, "description": ""}, {"name": "dest_columns", "type": null, "description": ""}], "created_at": 1789422566.6071324, "supported_languages": null}, "macro.dbt.get_incremental_append_sql": {"name": "get_incremental_append_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "unique_id": "macro.dbt.get_incremental_append_sql", "macro_sql": "{% macro get_incremental_append_sql(arg_dict) %}\n\n {{ return(adapter.dispatch('get_incremental_append_sql', 'dbt')(arg_dict)) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_incremental_append_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "arg_dict", "type": null, "description": ""}], "created_at": 1789422566.6084747, "supported_languages": null}, "macro.dbt.default__get_incremental_append_sql": {"name": "default__get_incremental_append_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "unique_id": "macro.dbt.default__get_incremental_append_sql", "macro_sql": "{% macro default__get_incremental_append_sql(arg_dict) %}\n\n {% do return(get_insert_into_sql(arg_dict[\"target_relation\"], arg_dict[\"temp_relation\"], arg_dict[\"dest_columns\"])) %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_insert_into_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "arg_dict", "type": null, "description": ""}], "created_at": 1789422566.608993, "supported_languages": null}, "macro.dbt.get_incremental_delete_insert_sql": {"name": "get_incremental_delete_insert_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "unique_id": "macro.dbt.get_incremental_delete_insert_sql", "macro_sql": "{% macro get_incremental_delete_insert_sql(arg_dict) %}\n\n {{ return(adapter.dispatch('get_incremental_delete_insert_sql', 'dbt')(arg_dict)) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_incremental_delete_insert_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "arg_dict", "type": null, "description": ""}], "created_at": 1789422566.6093924, "supported_languages": null}, "macro.dbt.default__get_incremental_delete_insert_sql": {"name": "default__get_incremental_delete_insert_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "unique_id": "macro.dbt.default__get_incremental_delete_insert_sql", "macro_sql": "{% macro default__get_incremental_delete_insert_sql(arg_dict) %}\n\n {% do return(get_delete_insert_merge_sql(arg_dict[\"target_relation\"], arg_dict[\"temp_relation\"], arg_dict[\"unique_key\"], arg_dict[\"dest_columns\"], arg_dict[\"incremental_predicates\"])) %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_delete_insert_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "arg_dict", "type": null, "description": ""}], "created_at": 1789422566.6100266, "supported_languages": null}, "macro.dbt.get_incremental_merge_sql": {"name": "get_incremental_merge_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "unique_id": "macro.dbt.get_incremental_merge_sql", "macro_sql": "{% macro get_incremental_merge_sql(arg_dict) %}\n\n {{ return(adapter.dispatch('get_incremental_merge_sql', 'dbt')(arg_dict)) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_incremental_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "arg_dict", "type": null, "description": ""}], "created_at": 1789422566.6104097, "supported_languages": null}, "macro.dbt.default__get_incremental_merge_sql": {"name": "default__get_incremental_merge_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "unique_id": "macro.dbt.default__get_incremental_merge_sql", "macro_sql": "{% macro default__get_incremental_merge_sql(arg_dict) %}\n\n {% do return(get_merge_sql(arg_dict[\"target_relation\"], arg_dict[\"temp_relation\"], arg_dict[\"unique_key\"], arg_dict[\"dest_columns\"], arg_dict[\"incremental_predicates\"])) %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "arg_dict", "type": null, "description": ""}], "created_at": 1789422566.6110232, "supported_languages": null}, "macro.dbt.get_incremental_insert_overwrite_sql": {"name": "get_incremental_insert_overwrite_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "unique_id": "macro.dbt.get_incremental_insert_overwrite_sql", "macro_sql": "{% macro get_incremental_insert_overwrite_sql(arg_dict) %}\n\n {{ return(adapter.dispatch('get_incremental_insert_overwrite_sql', 'dbt')(arg_dict)) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_incremental_insert_overwrite_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "arg_dict", "type": null, "description": ""}], "created_at": 1789422566.6114058, "supported_languages": null}, "macro.dbt.default__get_incremental_insert_overwrite_sql": {"name": "default__get_incremental_insert_overwrite_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "unique_id": "macro.dbt.default__get_incremental_insert_overwrite_sql", "macro_sql": "{% macro default__get_incremental_insert_overwrite_sql(arg_dict) %}\n\n {% do return(get_insert_overwrite_merge_sql(arg_dict[\"target_relation\"], arg_dict[\"temp_relation\"], arg_dict[\"dest_columns\"], arg_dict[\"incremental_predicates\"])) %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_insert_overwrite_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "arg_dict", "type": null, "description": ""}], "created_at": 1789422566.6121151, "supported_languages": null}, "macro.dbt.get_incremental_default_sql": {"name": "get_incremental_default_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "unique_id": "macro.dbt.get_incremental_default_sql", "macro_sql": "{% macro get_incremental_default_sql(arg_dict) %}\n\n {{ return(adapter.dispatch('get_incremental_default_sql', 'dbt')(arg_dict)) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__get_incremental_default_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "arg_dict", "type": null, "description": ""}], "created_at": 1789422566.612499, "supported_languages": null}, "macro.dbt.default__get_incremental_default_sql": {"name": "default__get_incremental_default_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "unique_id": "macro.dbt.default__get_incremental_default_sql", "macro_sql": "{% macro default__get_incremental_default_sql(arg_dict) %}\n\n {% do return(get_incremental_append_sql(arg_dict)) %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_incremental_append_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "arg_dict", "type": null, "description": ""}], "created_at": 1789422566.6128404, "supported_languages": null}, "macro.dbt.get_incremental_microbatch_sql": {"name": "get_incremental_microbatch_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "unique_id": "macro.dbt.get_incremental_microbatch_sql", "macro_sql": "{% macro get_incremental_microbatch_sql(arg_dict) %}\n\n {{ return(adapter.dispatch('get_incremental_microbatch_sql', 'dbt')(arg_dict)) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__get_incremental_microbatch_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "arg_dict", "type": null, "description": ""}], "created_at": 1789422566.6132188, "supported_languages": null}, "macro.dbt.default__get_incremental_microbatch_sql": {"name": "default__get_incremental_microbatch_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "unique_id": "macro.dbt.default__get_incremental_microbatch_sql", "macro_sql": "{% macro default__get_incremental_microbatch_sql(arg_dict) %}\n\n {{ exceptions.raise_not_implemented('microbatch materialization strategy not implemented for adapter ' + adapter.type()) }}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "arg_dict", "type": null, "description": ""}], "created_at": 1789422566.6135805, "supported_languages": null}, "macro.dbt.get_insert_into_sql": {"name": "get_insert_into_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "unique_id": "macro.dbt.get_insert_into_sql", "macro_sql": "{% macro get_insert_into_sql(target_relation, temp_relation, dest_columns) %}\n\n {%- set dest_cols_csv = get_quoted_csv(dest_columns | map(attribute=\"name\")) -%}\n\n insert into {{ target_relation }} ({{ dest_cols_csv }})\n (\n select {{ dest_cols_csv }}\n from {{ temp_relation }}\n )\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_quoted_csv"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "target_relation", "type": null, "description": ""}, {"name": "temp_relation", "type": null, "description": ""}, {"name": "dest_columns", "type": null, "description": ""}], "created_at": 1789422566.6141553, "supported_languages": null}, "macro.dbt.incremental_validate_on_schema_change": {"name": "incremental_validate_on_schema_change", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/on_schema_change.sql", "original_file_path": "macros/materializations/models/incremental/on_schema_change.sql", "unique_id": "macro.dbt.incremental_validate_on_schema_change", "macro_sql": "{% macro incremental_validate_on_schema_change(on_schema_change, default='ignore') %}\n\n {% if on_schema_change not in ['sync_all_columns', 'append_new_columns', 'fail', 'ignore'] %}\n\n {% set log_message = 'Invalid value for on_schema_change (%s) specified. Setting default value of %s.' % (on_schema_change, default) %}\n {% do log(log_message) %}\n\n {{ return(default) }}\n\n {% else %}\n\n {{ return(on_schema_change) }}\n\n {% endif %}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "on_schema_change", "type": null, "description": ""}, {"name": "default", "type": null, "description": ""}], "created_at": 1789422566.616734, "supported_languages": null}, "macro.dbt.check_for_schema_changes": {"name": "check_for_schema_changes", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/on_schema_change.sql", "original_file_path": "macros/materializations/models/incremental/on_schema_change.sql", "unique_id": "macro.dbt.check_for_schema_changes", "macro_sql": "{% macro check_for_schema_changes(source_relation, target_relation) %}\n {{ return(adapter.dispatch('check_for_schema_changes', 'dbt')(source_relation, target_relation)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__check_for_schema_changes"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "source_relation", "type": null, "description": ""}, {"name": "target_relation", "type": null, "description": ""}], "created_at": 1789422566.617195, "supported_languages": null}, "macro.dbt.default__check_for_schema_changes": {"name": "default__check_for_schema_changes", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/on_schema_change.sql", "original_file_path": "macros/materializations/models/incremental/on_schema_change.sql", "unique_id": "macro.dbt.default__check_for_schema_changes", "macro_sql": "{% macro default__check_for_schema_changes(source_relation, target_relation) %}\n\n {% set schema_changed = False %}\n\n {%- set source_columns = adapter.get_columns_in_relation(source_relation) -%}\n {%- set target_columns = adapter.get_columns_in_relation(target_relation) -%}\n {%- set source_not_in_target = diff_columns(source_columns, target_columns) -%}\n {%- set target_not_in_source = diff_columns(target_columns, source_columns) -%}\n\n {% set new_target_types = diff_column_data_types(source_columns, target_columns) %}\n\n {% if source_not_in_target != [] %}\n {% set schema_changed = True %}\n {% elif target_not_in_source != [] or new_target_types != [] %}\n {% set schema_changed = True %}\n {% elif new_target_types != [] %}\n {% set schema_changed = True %}\n {% endif %}\n\n {% set changes_dict = {\n 'schema_changed': schema_changed,\n 'source_not_in_target': source_not_in_target,\n 'target_not_in_source': target_not_in_source,\n 'source_columns': source_columns,\n 'target_columns': target_columns,\n 'new_target_types': new_target_types\n } %}\n\n {% set msg %}\n In {{ target_relation }}:\n Schema changed: {{ schema_changed }}\n Source columns not in target: {{ source_not_in_target }}\n Target columns not in source: {{ target_not_in_source }}\n New column types: {{ new_target_types }}\n {% endset %}\n\n {% do log(msg) %}\n\n {{ return(changes_dict) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.diff_columns", "macro.dbt.diff_column_data_types"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "source_relation", "type": null, "description": ""}, {"name": "target_relation", "type": null, "description": ""}], "created_at": 1789422566.619802, "supported_languages": null}, "macro.dbt.sync_column_schemas": {"name": "sync_column_schemas", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/on_schema_change.sql", "original_file_path": "macros/materializations/models/incremental/on_schema_change.sql", "unique_id": "macro.dbt.sync_column_schemas", "macro_sql": "{% macro sync_column_schemas(on_schema_change, target_relation, schema_changes_dict) %}\n {{ return(adapter.dispatch('sync_column_schemas', 'dbt')(on_schema_change, target_relation, schema_changes_dict)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__sync_column_schemas"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "on_schema_change", "type": null, "description": ""}, {"name": "target_relation", "type": null, "description": ""}, {"name": "schema_changes_dict", "type": null, "description": ""}], "created_at": 1789422566.6203303, "supported_languages": null}, "macro.dbt.default__sync_column_schemas": {"name": "default__sync_column_schemas", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/on_schema_change.sql", "original_file_path": "macros/materializations/models/incremental/on_schema_change.sql", "unique_id": "macro.dbt.default__sync_column_schemas", "macro_sql": "{% macro default__sync_column_schemas(on_schema_change, target_relation, schema_changes_dict) %}\n\n {%- set add_to_target_arr = schema_changes_dict['source_not_in_target'] -%}\n {%- set remove_from_target_arr = schema_changes_dict['target_not_in_source'] -%}\n {%- set new_target_types = schema_changes_dict['new_target_types'] -%}\n\n {%- if on_schema_change == 'append_new_columns'-%}\n {%- if add_to_target_arr | length > 0 -%}\n {%- do alter_relation_add_remove_columns(target_relation, add_to_target_arr, none) -%}\n {%- endif -%}\n\n {% elif on_schema_change == 'sync_all_columns' %}\n\n {% if add_to_target_arr | length > 0 or remove_from_target_arr | length > 0 %}\n {%- do alter_relation_add_remove_columns(target_relation, add_to_target_arr, remove_from_target_arr) -%}\n {% endif %}\n\n {% if new_target_types != [] %}\n {% for ntt in new_target_types %}\n {% set column_name = ntt['column_name'] %}\n {% set new_type = ntt['new_type'] %}\n {% do alter_column_type(target_relation, column_name, new_type) %}\n {% endfor %}\n {% endif %}\n\n {% endif %}\n\n {% set schema_change_message %}\n In {{ target_relation }}:\n Schema change approach: {{ on_schema_change }}\n Columns added: {{ add_to_target_arr }}\n Columns removed: {{ remove_from_target_arr }}\n Data types changed: {{ new_target_types }}\n {% endset %}\n\n {% do log(schema_change_message) %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.alter_relation_add_remove_columns", "macro.dbt.alter_column_type"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "on_schema_change", "type": null, "description": ""}, {"name": "target_relation", "type": null, "description": ""}, {"name": "schema_changes_dict", "type": null, "description": ""}], "created_at": 1789422566.6228302, "supported_languages": null}, "macro.dbt.process_schema_changes": {"name": "process_schema_changes", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/on_schema_change.sql", "original_file_path": "macros/materializations/models/incremental/on_schema_change.sql", "unique_id": "macro.dbt.process_schema_changes", "macro_sql": "{% macro process_schema_changes(on_schema_change, source_relation, target_relation) %}\n {{ return(adapter.dispatch('process_schema_changes', 'dbt')(on_schema_change, source_relation, target_relation)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__process_schema_changes"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "on_schema_change", "type": null, "description": ""}, {"name": "source_relation", "type": null, "description": ""}, {"name": "target_relation", "type": null, "description": ""}], "created_at": 1789422566.6235557, "supported_languages": null}, "macro.dbt.default__process_schema_changes": {"name": "default__process_schema_changes", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/on_schema_change.sql", "original_file_path": "macros/materializations/models/incremental/on_schema_change.sql", "unique_id": "macro.dbt.default__process_schema_changes", "macro_sql": "{% macro default__process_schema_changes(on_schema_change, source_relation, target_relation) %}\n\n {% if on_schema_change == 'ignore' %}\n\n {{ return({}) }}\n\n {% else %}\n\n {% set schema_changes_dict = check_for_schema_changes(source_relation, target_relation) %}\n\n {% if schema_changes_dict['schema_changed'] %}\n\n {% if on_schema_change == 'fail' %}\n\n {% set fail_msg %}\n The source and target schemas on this incremental model are out of sync!\n They can be reconciled in several ways:\n - set the `on_schema_change` config to either append_new_columns or sync_all_columns, depending on your situation.\n - Re-run the incremental model with `full_refresh: True` to update the target schema.\n - update the schema manually and re-run the process.\n\n Additional troubleshooting context:\n Source columns not in target: {{ schema_changes_dict['source_not_in_target'] }}\n Target columns not in source: {{ schema_changes_dict['target_not_in_source'] }}\n New column types: {{ schema_changes_dict['new_target_types'] }}\n {% endset %}\n\n {% do exceptions.raise_compiler_error(fail_msg) %}\n\n {# -- unless we ignore, run the sync operation per the config #}\n {% else %}\n\n {% do sync_column_schemas(on_schema_change, target_relation, schema_changes_dict) %}\n\n {% endif %}\n\n {% endif %}\n\n {{ return(schema_changes_dict['source_columns']) }}\n\n {% endif %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.check_for_schema_changes", "macro.dbt.sync_column_schemas"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "on_schema_change", "type": null, "description": ""}, {"name": "source_relation", "type": null, "description": ""}, {"name": "target_relation", "type": null, "description": ""}], "created_at": 1789422566.6253078, "supported_languages": null}, "macro.dbt.get_merge_sql": {"name": "get_merge_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/merge.sql", "original_file_path": "macros/materializations/models/incremental/merge.sql", "unique_id": "macro.dbt.get_merge_sql", "macro_sql": "{% macro get_merge_sql(target, source, unique_key, dest_columns, incremental_predicates=none) -%}\n -- back compat for old kwarg name\n {% set incremental_predicates = kwargs.get('predicates', incremental_predicates) %}\n {{ adapter.dispatch('get_merge_sql', 'dbt')(target, source, unique_key, dest_columns, incremental_predicates) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "target", "type": null, "description": ""}, {"name": "source", "type": null, "description": ""}, {"name": "unique_key", "type": null, "description": ""}, {"name": "dest_columns", "type": null, "description": ""}, {"name": "incremental_predicates", "type": null, "description": ""}], "created_at": 1789422566.6276743, "supported_languages": null}, "macro.dbt.get_merge_unique_key_match": {"name": "get_merge_unique_key_match", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/merge.sql", "original_file_path": "macros/materializations/models/incremental/merge.sql", "unique_id": "macro.dbt.get_merge_unique_key_match", "macro_sql": "{% macro get_merge_unique_key_match(source_unique_key, target_unique_key) %}\n {{ return(adapter.dispatch('get_merge_unique_key_match', 'dbt')(source_unique_key, target_unique_key)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_merge_unique_key_match"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "source_unique_key", "type": null, "description": ""}, {"name": "target_unique_key", "type": null, "description": ""}], "created_at": 1789422566.6281452, "supported_languages": null}, "macro.dbt.default__get_merge_unique_key_match": {"name": "default__get_merge_unique_key_match", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/merge.sql", "original_file_path": "macros/materializations/models/incremental/merge.sql", "unique_id": "macro.dbt.default__get_merge_unique_key_match", "macro_sql": "{% macro default__get_merge_unique_key_match(source_unique_key, target_unique_key) -%}\n {{ return(equals(source_unique_key, target_unique_key) | trim) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.equals"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "source_unique_key", "type": null, "description": ""}, {"name": "target_unique_key", "type": null, "description": ""}], "created_at": 1789422566.6285443, "supported_languages": null}, "macro.dbt.default__get_merge_sql": {"name": "default__get_merge_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/merge.sql", "original_file_path": "macros/materializations/models/incremental/merge.sql", "unique_id": "macro.dbt.default__get_merge_sql", "macro_sql": "{% macro default__get_merge_sql(target, source, unique_key, dest_columns, incremental_predicates=none) -%}\n {%- set predicates = [] if incremental_predicates is none else [] + incremental_predicates -%}\n {%- set dest_cols_csv = get_quoted_csv(dest_columns | map(attribute=\"name\")) -%}\n {%- set merge_update_columns = config.get('merge_update_columns') -%}\n {%- set merge_exclude_columns = config.get('merge_exclude_columns') -%}\n {%- set update_columns = get_merge_update_columns(merge_update_columns, merge_exclude_columns, dest_columns) -%}\n {%- set sql_header = config.get('sql_header', none) -%}\n\n {% if unique_key %}\n {% if unique_key is sequence and unique_key is not mapping and unique_key is not string %}\n {% for key in unique_key %}\n {% set this_key_match %}\n DBT_INTERNAL_SOURCE.{{ key }} = DBT_INTERNAL_DEST.{{ key }}\n {% endset %}\n {% do predicates.append(this_key_match) %}\n {% endfor %}\n {% else %}\n {% set source_unique_key = (\"DBT_INTERNAL_SOURCE.\" ~ unique_key) | trim %}\n {% set target_unique_key = (\"DBT_INTERNAL_DEST.\" ~ unique_key) | trim %}\n {% set unique_key_match = get_merge_unique_key_match(source_unique_key, target_unique_key) %}\n {% do predicates.append(unique_key_match) %}\n {% endif %}\n {% else %}\n {% do predicates.append('FALSE') %}\n {% endif %}\n\n {{ sql_header if sql_header is not none }}\n\n merge into {{ target }} as DBT_INTERNAL_DEST\n using {{ source }} as DBT_INTERNAL_SOURCE\n on {{\"(\" ~ predicates | join(\") and (\") ~ \")\"}}\n\n {% if unique_key %}\n when matched then update set\n {% for column_name in update_columns -%}\n {{ column_name }} = DBT_INTERNAL_SOURCE.{{ column_name }}\n {%- if not loop.last %}, {%- endif %}\n {%- endfor %}\n {% endif %}\n\n when not matched then insert\n ({{ dest_cols_csv }})\n values\n ({{ dest_cols_csv }})\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_quoted_csv", "macro.dbt.get_merge_update_columns", "macro.dbt.get_merge_unique_key_match"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "target", "type": null, "description": ""}, {"name": "source", "type": null, "description": ""}, {"name": "unique_key", "type": null, "description": ""}, {"name": "dest_columns", "type": null, "description": ""}, {"name": "incremental_predicates", "type": null, "description": ""}], "created_at": 1789422566.6321812, "supported_languages": null}, "macro.dbt.get_delete_insert_merge_sql": {"name": "get_delete_insert_merge_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/merge.sql", "original_file_path": "macros/materializations/models/incremental/merge.sql", "unique_id": "macro.dbt.get_delete_insert_merge_sql", "macro_sql": "{% macro get_delete_insert_merge_sql(target, source, unique_key, dest_columns, incremental_predicates) -%}\n {{ adapter.dispatch('get_delete_insert_merge_sql', 'dbt')(target, source, unique_key, dest_columns, incremental_predicates) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_delete_insert_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "target", "type": null, "description": ""}, {"name": "source", "type": null, "description": ""}, {"name": "unique_key", "type": null, "description": ""}, {"name": "dest_columns", "type": null, "description": ""}, {"name": "incremental_predicates", "type": null, "description": ""}], "created_at": 1789422566.6327806, "supported_languages": null}, "macro.dbt.default__get_delete_insert_merge_sql": {"name": "default__get_delete_insert_merge_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/merge.sql", "original_file_path": "macros/materializations/models/incremental/merge.sql", "unique_id": "macro.dbt.default__get_delete_insert_merge_sql", "macro_sql": "{% macro default__get_delete_insert_merge_sql(target, source, unique_key, dest_columns, incremental_predicates) -%}\n\n {%- set dest_cols_csv = get_quoted_csv(dest_columns | map(attribute=\"name\")) -%}\n\n {% if unique_key %}\n {% if unique_key is string %}\n {% set unique_key = [unique_key] %}\n {% endif %}\n\n {%- set unique_key_str = unique_key|join(', ') -%}\n\n delete from {{ target }} as DBT_INTERNAL_DEST\n where ({{ unique_key_str }}) in (\n select distinct {{ unique_key_str }}\n from {{ source }} as DBT_INTERNAL_SOURCE\n )\n {%- if incremental_predicates %}\n {% for predicate in incremental_predicates %}\n and {{ predicate }}\n {% endfor %}\n {%- endif -%};\n\n {% endif %}\n\n insert into {{ target }} ({{ dest_cols_csv }})\n (\n select {{ dest_cols_csv }}\n from {{ source }}\n )\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.get_quoted_csv"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "target", "type": null, "description": ""}, {"name": "source", "type": null, "description": ""}, {"name": "unique_key", "type": null, "description": ""}, {"name": "dest_columns", "type": null, "description": ""}, {"name": "incremental_predicates", "type": null, "description": ""}], "created_at": 1789422566.634303, "supported_languages": null}, "macro.dbt.get_insert_overwrite_merge_sql": {"name": "get_insert_overwrite_merge_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/merge.sql", "original_file_path": "macros/materializations/models/incremental/merge.sql", "unique_id": "macro.dbt.get_insert_overwrite_merge_sql", "macro_sql": "{% macro get_insert_overwrite_merge_sql(target, source, dest_columns, predicates, include_sql_header=false) -%}\n {{ adapter.dispatch('get_insert_overwrite_merge_sql', 'dbt')(target, source, dest_columns, predicates, include_sql_header) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_insert_overwrite_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "target", "type": null, "description": ""}, {"name": "source", "type": null, "description": ""}, {"name": "dest_columns", "type": null, "description": ""}, {"name": "predicates", "type": null, "description": ""}, {"name": "include_sql_header", "type": null, "description": ""}], "created_at": 1789422566.6349115, "supported_languages": null}, "macro.dbt.default__get_insert_overwrite_merge_sql": {"name": "default__get_insert_overwrite_merge_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/merge.sql", "original_file_path": "macros/materializations/models/incremental/merge.sql", "unique_id": "macro.dbt.default__get_insert_overwrite_merge_sql", "macro_sql": "{% macro default__get_insert_overwrite_merge_sql(target, source, dest_columns, predicates, include_sql_header) -%}\n {#-- The only time include_sql_header is True: --#}\n {#-- BigQuery + insert_overwrite strategy + \"static\" partitions config --#}\n {#-- We should consider including the sql header at the materialization level instead --#}\n\n {%- set predicates = [] if predicates is none else [] + predicates -%}\n {%- set dest_cols_csv = get_quoted_csv(dest_columns | map(attribute=\"name\")) -%}\n {%- set sql_header = config.get('sql_header', none) -%}\n\n {{ sql_header if sql_header is not none and include_sql_header }}\n\n merge into {{ target }} as DBT_INTERNAL_DEST\n using {{ source }} as DBT_INTERNAL_SOURCE\n on FALSE\n\n when not matched by source\n {% if predicates %} and {{ predicates | join(' and ') }} {% endif %}\n then delete\n\n when not matched then insert\n ({{ dest_cols_csv }})\n values\n ({{ dest_cols_csv }})\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_quoted_csv"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "target", "type": null, "description": ""}, {"name": "source", "type": null, "description": ""}, {"name": "dest_columns", "type": null, "description": ""}, {"name": "predicates", "type": null, "description": ""}, {"name": "include_sql_header", "type": null, "description": ""}], "created_at": 1789422566.6362722, "supported_languages": null}, "macro.dbt.is_incremental": {"name": "is_incremental", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/is_incremental.sql", "original_file_path": "macros/materializations/models/incremental/is_incremental.sql", "unique_id": "macro.dbt.is_incremental", "macro_sql": "{% macro is_incremental() %}\n {#-- do not run introspective queries in parsing #}\n {% if not execute %}\n {{ return(False) }}\n {% else %}\n {% set relation = adapter.get_relation(this.database, this.schema, this.table) %}\n {{ return(relation is not none\n and relation.type == 'table'\n and model.config.materialized == 'incremental'\n and not should_full_refresh()) }}\n {% endif %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.should_full_refresh"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789422566.6375062, "supported_languages": null}, "macro.dbt.date": {"name": "date", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/date.sql", "original_file_path": "macros/utils/date.sql", "unique_id": "macro.dbt.date", "macro_sql": "{% macro date(year, month, day) %}\n {{ return(adapter.dispatch('date', 'dbt') (year, month, day)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__date"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "year", "type": null, "description": ""}, {"name": "month", "type": null, "description": ""}, {"name": "day", "type": null, "description": ""}], "created_at": 1789422566.638219, "supported_languages": null}, "macro.dbt.default__date": {"name": "default__date", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/date.sql", "original_file_path": "macros/utils/date.sql", "unique_id": "macro.dbt.default__date", "macro_sql": "{% macro default__date(year, month, day) -%}\n {%- set dt = modules.datetime.date(year, month, day) -%}\n {%- set iso_8601_formatted_date = dt.strftime('%Y-%m-%d') -%}\n to_date('{{ iso_8601_formatted_date }}', 'YYYY-MM-DD')\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "year", "type": null, "description": ""}, {"name": "month", "type": null, "description": ""}, {"name": "day", "type": null, "description": ""}], "created_at": 1789422566.6388443, "supported_languages": null}, "macro.dbt.safe_cast": {"name": "safe_cast", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/safe_cast.sql", "original_file_path": "macros/utils/safe_cast.sql", "unique_id": "macro.dbt.safe_cast", "macro_sql": "{% macro safe_cast(field, type) %}\n {{ return(adapter.dispatch('safe_cast', 'dbt') (field, type)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__safe_cast"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field", "type": null, "description": ""}, {"name": "type", "type": null, "description": ""}], "created_at": 1789422566.639453, "supported_languages": null}, "macro.dbt.default__safe_cast": {"name": "default__safe_cast", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/safe_cast.sql", "original_file_path": "macros/utils/safe_cast.sql", "unique_id": "macro.dbt.default__safe_cast", "macro_sql": "{% macro default__safe_cast(field, type) %}\n {# most databases don't support this function yet\n so we just need to use cast #}\n cast({{field}} as {{type}})\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field", "type": null, "description": ""}, {"name": "type", "type": null, "description": ""}], "created_at": 1789422566.6397977, "supported_languages": null}, "macro.dbt.array_concat": {"name": "array_concat", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/array_concat.sql", "original_file_path": "macros/utils/array_concat.sql", "unique_id": "macro.dbt.array_concat", "macro_sql": "{% macro array_concat(array_1, array_2) -%}\n {{ return(adapter.dispatch('array_concat', 'dbt')(array_1, array_2)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__array_concat"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "array_1", "type": null, "description": ""}, {"name": "array_2", "type": null, "description": ""}], "created_at": 1789422566.6405811, "supported_languages": null}, "macro.dbt.default__array_concat": {"name": "default__array_concat", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/array_concat.sql", "original_file_path": "macros/utils/array_concat.sql", "unique_id": "macro.dbt.default__array_concat", "macro_sql": "{% macro default__array_concat(array_1, array_2) -%}\n array_cat({{ array_1 }}, {{ array_2 }})\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "array_1", "type": null, "description": ""}, {"name": "array_2", "type": null, "description": ""}], "created_at": 1789422566.6408834, "supported_languages": null}, "macro.dbt.escape_single_quotes": {"name": "escape_single_quotes", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/escape_single_quotes.sql", "original_file_path": "macros/utils/escape_single_quotes.sql", "unique_id": "macro.dbt.escape_single_quotes", "macro_sql": "{% macro escape_single_quotes(expression) %}\n {{ return(adapter.dispatch('escape_single_quotes', 'dbt') (expression)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__escape_single_quotes"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "expression", "type": null, "description": ""}], "created_at": 1789422566.6414423, "supported_languages": null}, "macro.dbt.default__escape_single_quotes": {"name": "default__escape_single_quotes", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/escape_single_quotes.sql", "original_file_path": "macros/utils/escape_single_quotes.sql", "unique_id": "macro.dbt.default__escape_single_quotes", "macro_sql": "{% macro default__escape_single_quotes(expression) -%}\n{{ expression | replace(\"'\",\"''\") }}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "expression", "type": null, "description": ""}], "created_at": 1789422566.641783, "supported_languages": null}, "macro.dbt.type_string": {"name": "type_string", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "unique_id": "macro.dbt.type_string", "macro_sql": "\n\n{%- macro type_string() -%}\n {{ return(adapter.dispatch('type_string', 'dbt')()) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt.default__type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789422566.6431413, "supported_languages": null}, "macro.dbt.default__type_string": {"name": "default__type_string", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "unique_id": "macro.dbt.default__type_string", "macro_sql": "{% macro default__type_string() %}\n {{ return(api.Column.translate_type(\"string\")) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789422566.6434603, "supported_languages": null}, "macro.dbt.type_timestamp": {"name": "type_timestamp", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "unique_id": "macro.dbt.type_timestamp", "macro_sql": "\n\n{%- macro type_timestamp() -%}\n {{ return(adapter.dispatch('type_timestamp', 'dbt')()) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt.default__type_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789422566.6438212, "supported_languages": null}, "macro.dbt.default__type_timestamp": {"name": "default__type_timestamp", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "unique_id": "macro.dbt.default__type_timestamp", "macro_sql": "{% macro default__type_timestamp() %}\n {{ return(api.Column.translate_type(\"timestamp\")) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789422566.6441386, "supported_languages": null}, "macro.dbt.type_float": {"name": "type_float", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "unique_id": "macro.dbt.type_float", "macro_sql": "\n\n{%- macro type_float() -%}\n {{ return(adapter.dispatch('type_float', 'dbt')()) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt.default__type_float"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789422566.6444724, "supported_languages": null}, "macro.dbt.default__type_float": {"name": "default__type_float", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "unique_id": "macro.dbt.default__type_float", "macro_sql": "{% macro default__type_float() %}\n {{ return(api.Column.translate_type(\"float\")) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789422566.6448133, "supported_languages": null}, "macro.dbt.type_numeric": {"name": "type_numeric", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "unique_id": "macro.dbt.type_numeric", "macro_sql": "\n\n{%- macro type_numeric() -%}\n {{ return(adapter.dispatch('type_numeric', 'dbt')()) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt.default__type_numeric"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789422566.645146, "supported_languages": null}, "macro.dbt.default__type_numeric": {"name": "default__type_numeric", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "unique_id": "macro.dbt.default__type_numeric", "macro_sql": "{% macro default__type_numeric() %}\n {{ return(api.Column.numeric_type(\"numeric\", 28, 6)) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789422566.6455076, "supported_languages": null}, "macro.dbt.type_bigint": {"name": "type_bigint", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "unique_id": "macro.dbt.type_bigint", "macro_sql": "\n\n{%- macro type_bigint() -%}\n {{ return(adapter.dispatch('type_bigint', 'dbt')()) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt.default__type_bigint"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789422566.6459658, "supported_languages": null}, "macro.dbt.default__type_bigint": {"name": "default__type_bigint", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "unique_id": "macro.dbt.default__type_bigint", "macro_sql": "{% macro default__type_bigint() %}\n {{ return(api.Column.translate_type(\"bigint\")) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789422566.6463103, "supported_languages": null}, "macro.dbt.type_int": {"name": "type_int", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "unique_id": "macro.dbt.type_int", "macro_sql": "\n\n{%- macro type_int() -%}\n {{ return(adapter.dispatch('type_int', 'dbt')()) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt.default__type_int"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789422566.646671, "supported_languages": null}, "macro.dbt.default__type_int": {"name": "default__type_int", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "unique_id": "macro.dbt.default__type_int", "macro_sql": "{%- macro default__type_int() -%}\n {{ return(api.Column.translate_type(\"integer\")) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789422566.64698, "supported_languages": null}, "macro.dbt.type_boolean": {"name": "type_boolean", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "unique_id": "macro.dbt.type_boolean", "macro_sql": "\n\n{%- macro type_boolean() -%}\n {{ return(adapter.dispatch('type_boolean', 'dbt')()) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt.default__type_boolean"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789422566.6474552, "supported_languages": null}, "macro.dbt.default__type_boolean": {"name": "default__type_boolean", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "unique_id": "macro.dbt.default__type_boolean", "macro_sql": "{%- macro default__type_boolean() -%}\n {{ return(api.Column.translate_type(\"boolean\")) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789422566.6477861, "supported_languages": null}, "macro.dbt.array_append": {"name": "array_append", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/array_append.sql", "original_file_path": "macros/utils/array_append.sql", "unique_id": "macro.dbt.array_append", "macro_sql": "{% macro array_append(array, new_element) -%}\n {{ return(adapter.dispatch('array_append', 'dbt')(array, new_element)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__array_append"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "array", "type": null, "description": ""}, {"name": "new_element", "type": null, "description": ""}], "created_at": 1789422566.6483893, "supported_languages": null}, "macro.dbt.default__array_append": {"name": "default__array_append", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/array_append.sql", "original_file_path": "macros/utils/array_append.sql", "unique_id": "macro.dbt.default__array_append", "macro_sql": "{% macro default__array_append(array, new_element) -%}\n array_append({{ array }}, {{ new_element }})\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "array", "type": null, "description": ""}, {"name": "new_element", "type": null, "description": ""}], "created_at": 1789422566.6487083, "supported_languages": null}, "macro.dbt.get_powers_of_two": {"name": "get_powers_of_two", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/generate_series.sql", "original_file_path": "macros/utils/generate_series.sql", "unique_id": "macro.dbt.get_powers_of_two", "macro_sql": "{% macro get_powers_of_two(upper_bound) %}\n {{ return(adapter.dispatch('get_powers_of_two', 'dbt')(upper_bound)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_powers_of_two"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "upper_bound", "type": null, "description": ""}], "created_at": 1789422566.649593, "supported_languages": null}, "macro.dbt.default__get_powers_of_two": {"name": "default__get_powers_of_two", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/generate_series.sql", "original_file_path": "macros/utils/generate_series.sql", "unique_id": "macro.dbt.default__get_powers_of_two", "macro_sql": "{% macro default__get_powers_of_two(upper_bound) %}\n\n {% if upper_bound <= 0 %}\n {{ exceptions.raise_compiler_error(\"upper bound must be positive\") }}\n {% endif %}\n\n {% for _ in range(1, 100) %}\n {% if upper_bound <= 2 ** loop.index %}{{ return(loop.index) }}{% endif %}\n {% endfor %}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "upper_bound", "type": null, "description": ""}], "created_at": 1789422566.6504695, "supported_languages": null}, "macro.dbt.generate_series": {"name": "generate_series", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/generate_series.sql", "original_file_path": "macros/utils/generate_series.sql", "unique_id": "macro.dbt.generate_series", "macro_sql": "{% macro generate_series(upper_bound) %}\n {{ return(adapter.dispatch('generate_series', 'dbt')(upper_bound)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__generate_series"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "upper_bound", "type": null, "description": ""}], "created_at": 1789422566.65088, "supported_languages": null}, "macro.dbt.default__generate_series": {"name": "default__generate_series", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/generate_series.sql", "original_file_path": "macros/utils/generate_series.sql", "unique_id": "macro.dbt.default__generate_series", "macro_sql": "{% macro default__generate_series(upper_bound) %}\n\n {% set n = dbt.get_powers_of_two(upper_bound) %}\n\n with p as (\n select 0 as generated_number union all select 1\n ), unioned as (\n\n select\n\n {% for i in range(n) %}\n p{{i}}.generated_number * power(2, {{i}})\n {% if not loop.last %} + {% endif %}\n {% endfor %}\n + 1\n as generated_number\n\n from\n\n {% for i in range(n) %}\n p as p{{i}}\n {% if not loop.last %} cross join {% endif %}\n {% endfor %}\n\n )\n\n select *\n from unioned\n where generated_number <= {{upper_bound}}\n order by generated_number\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_powers_of_two"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "upper_bound", "type": null, "description": ""}], "created_at": 1789422566.6519334, "supported_languages": null}, "macro.dbt.right": {"name": "right", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/right.sql", "original_file_path": "macros/utils/right.sql", "unique_id": "macro.dbt.right", "macro_sql": "{% macro right(string_text, length_expression) -%}\n {{ return(adapter.dispatch('right', 'dbt') (string_text, length_expression)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__right"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "string_text", "type": null, "description": ""}, {"name": "length_expression", "type": null, "description": ""}], "created_at": 1789422566.6525445, "supported_languages": null}, "macro.dbt.default__right": {"name": "default__right", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/right.sql", "original_file_path": "macros/utils/right.sql", "unique_id": "macro.dbt.default__right", "macro_sql": "{% macro default__right(string_text, length_expression) %}\n\n right(\n {{ string_text }},\n {{ length_expression }}\n )\n\n{%- endmacro -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "string_text", "type": null, "description": ""}, {"name": "length_expression", "type": null, "description": ""}], "created_at": 1789422566.6528485, "supported_languages": null}, "macro.dbt.hash": {"name": "hash", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/hash.sql", "original_file_path": "macros/utils/hash.sql", "unique_id": "macro.dbt.hash", "macro_sql": "{% macro hash(field) -%}\n {{ return(adapter.dispatch('hash', 'dbt') (field)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__hash"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field", "type": null, "description": ""}], "created_at": 1789422566.653364, "supported_languages": null}, "macro.dbt.default__hash": {"name": "default__hash", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/hash.sql", "original_file_path": "macros/utils/hash.sql", "unique_id": "macro.dbt.default__hash", "macro_sql": "{% macro default__hash(field) -%}\n md5(cast({{ field }} as {{ api.Column.translate_type('string') }}))\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field", "type": null, "description": ""}], "created_at": 1789422566.6537268, "supported_languages": null}, "macro.dbt.intersect": {"name": "intersect", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/intersect.sql", "original_file_path": "macros/utils/intersect.sql", "unique_id": "macro.dbt.intersect", "macro_sql": "{% macro intersect() %}\n {{ return(adapter.dispatch('intersect', 'dbt')()) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__intersect"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789422566.6541848, "supported_languages": null}, "macro.dbt.default__intersect": {"name": "default__intersect", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/intersect.sql", "original_file_path": "macros/utils/intersect.sql", "unique_id": "macro.dbt.default__intersect", "macro_sql": "{% macro default__intersect() %}\n\n intersect\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789422566.6543596, "supported_languages": null}, "macro.dbt.last_day": {"name": "last_day", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/last_day.sql", "original_file_path": "macros/utils/last_day.sql", "unique_id": "macro.dbt.last_day", "macro_sql": "{% macro last_day(date, datepart) %}\n {{ return(adapter.dispatch('last_day', 'dbt') (date, datepart)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__last_day"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "date", "type": null, "description": ""}, {"name": "datepart", "type": null, "description": ""}], "created_at": 1789422566.6549988, "supported_languages": null}, "macro.dbt.default_last_day": {"name": "default_last_day", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/last_day.sql", "original_file_path": "macros/utils/last_day.sql", "unique_id": "macro.dbt.default_last_day", "macro_sql": "\n\n{%- macro default_last_day(date, datepart) -%}\n cast(\n {{dbt.dateadd('day', '-1',\n dbt.dateadd(datepart, '1', dbt.date_trunc(datepart, date))\n )}}\n as date)\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt.dateadd", "macro.dbt.date_trunc"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "date", "type": null, "description": ""}, {"name": "datepart", "type": null, "description": ""}], "created_at": 1789422566.6555607, "supported_languages": null}, "macro.dbt.default__last_day": {"name": "default__last_day", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/last_day.sql", "original_file_path": "macros/utils/last_day.sql", "unique_id": "macro.dbt.default__last_day", "macro_sql": "{% macro default__last_day(date, datepart) -%}\n {{dbt.default_last_day(date, datepart)}}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default_last_day"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "date", "type": null, "description": ""}, {"name": "datepart", "type": null, "description": ""}], "created_at": 1789422566.6560266, "supported_languages": null}, "macro.dbt.listagg": {"name": "listagg", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/listagg.sql", "original_file_path": "macros/utils/listagg.sql", "unique_id": "macro.dbt.listagg", "macro_sql": "{% macro listagg(measure, delimiter_text=\"','\", order_by_clause=none, limit_num=none) -%}\n {{ return(adapter.dispatch('listagg', 'dbt') (measure, delimiter_text, order_by_clause, limit_num)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__listagg"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "measure", "type": null, "description": ""}, {"name": "delimiter_text", "type": null, "description": ""}, {"name": "order_by_clause", "type": null, "description": ""}, {"name": "limit_num", "type": null, "description": ""}], "created_at": 1789422566.656923, "supported_languages": null}, "macro.dbt.default__listagg": {"name": "default__listagg", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/listagg.sql", "original_file_path": "macros/utils/listagg.sql", "unique_id": "macro.dbt.default__listagg", "macro_sql": "{% macro default__listagg(measure, delimiter_text, order_by_clause, limit_num) -%}\n\n {% if limit_num -%}\n array_to_string(\n array_slice(\n array_agg(\n {{ measure }}\n ){% if order_by_clause -%}\n within group ({{ order_by_clause }})\n {%- endif %}\n ,0\n ,{{ limit_num }}\n ),\n {{ delimiter_text }}\n )\n {%- else %}\n listagg(\n {{ measure }},\n {{ delimiter_text }}\n )\n {% if order_by_clause -%}\n within group ({{ order_by_clause }})\n {%- endif %}\n {%- endif %}\n\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "measure", "type": null, "description": ""}, {"name": "delimiter_text", "type": null, "description": ""}, {"name": "order_by_clause", "type": null, "description": ""}, {"name": "limit_num", "type": null, "description": ""}], "created_at": 1789422566.6577795, "supported_languages": null}, "macro.dbt.cast_bool_to_text": {"name": "cast_bool_to_text", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/cast_bool_to_text.sql", "original_file_path": "macros/utils/cast_bool_to_text.sql", "unique_id": "macro.dbt.cast_bool_to_text", "macro_sql": "{% macro cast_bool_to_text(field) %}\n {{ adapter.dispatch('cast_bool_to_text', 'dbt') (field) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__cast_bool_to_text"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field", "type": null, "description": ""}], "created_at": 1789422566.658277, "supported_languages": null}, "macro.dbt.default__cast_bool_to_text": {"name": "default__cast_bool_to_text", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/cast_bool_to_text.sql", "original_file_path": "macros/utils/cast_bool_to_text.sql", "unique_id": "macro.dbt.default__cast_bool_to_text", "macro_sql": "{% macro default__cast_bool_to_text(field) %}\n cast({{ field }} as {{ api.Column.translate_type('string') }})\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field", "type": null, "description": ""}], "created_at": 1789422566.6586301, "supported_languages": null}, "macro.dbt.date_trunc": {"name": "date_trunc", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/date_trunc.sql", "original_file_path": "macros/utils/date_trunc.sql", "unique_id": "macro.dbt.date_trunc", "macro_sql": "{% macro date_trunc(datepart, date) -%}\n {{ return(adapter.dispatch('date_trunc', 'dbt') (datepart, date)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__date_trunc"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "datepart", "type": null, "description": ""}, {"name": "date", "type": null, "description": ""}], "created_at": 1789422566.6591804, "supported_languages": null}, "macro.dbt.default__date_trunc": {"name": "default__date_trunc", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/date_trunc.sql", "original_file_path": "macros/utils/date_trunc.sql", "unique_id": "macro.dbt.default__date_trunc", "macro_sql": "{% macro default__date_trunc(datepart, date) -%}\n date_trunc('{{datepart}}', {{date}})\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "datepart", "type": null, "description": ""}, {"name": "date", "type": null, "description": ""}], "created_at": 1789422566.6594713, "supported_languages": null}, "macro.dbt.position": {"name": "position", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/position.sql", "original_file_path": "macros/utils/position.sql", "unique_id": "macro.dbt.position", "macro_sql": "{% macro position(substring_text, string_text) -%}\n {{ return(adapter.dispatch('position', 'dbt') (substring_text, string_text)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__position"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "substring_text", "type": null, "description": ""}, {"name": "string_text", "type": null, "description": ""}], "created_at": 1789422566.6600716, "supported_languages": null}, "macro.dbt.default__position": {"name": "default__position", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/position.sql", "original_file_path": "macros/utils/position.sql", "unique_id": "macro.dbt.default__position", "macro_sql": "{% macro default__position(substring_text, string_text) %}\n\n position(\n {{ substring_text }} in {{ string_text }}\n )\n\n{%- endmacro -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "substring_text", "type": null, "description": ""}, {"name": "string_text", "type": null, "description": ""}], "created_at": 1789422566.6603727, "supported_languages": null}, "macro.dbt.any_value": {"name": "any_value", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/any_value.sql", "original_file_path": "macros/utils/any_value.sql", "unique_id": "macro.dbt.any_value", "macro_sql": "{% macro any_value(expression) -%}\n {{ return(adapter.dispatch('any_value', 'dbt') (expression)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__any_value"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "expression", "type": null, "description": ""}], "created_at": 1789422566.660899, "supported_languages": null}, "macro.dbt.default__any_value": {"name": "default__any_value", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/any_value.sql", "original_file_path": "macros/utils/any_value.sql", "unique_id": "macro.dbt.default__any_value", "macro_sql": "{% macro default__any_value(expression) -%}\n\n any_value({{ expression }})\n\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "expression", "type": null, "description": ""}], "created_at": 1789422566.66113, "supported_languages": null}, "macro.dbt.length": {"name": "length", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/length.sql", "original_file_path": "macros/utils/length.sql", "unique_id": "macro.dbt.length", "macro_sql": "{% macro length(expression) -%}\n {{ return(adapter.dispatch('length', 'dbt') (expression)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__length"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "expression", "type": null, "description": ""}], "created_at": 1789422566.6616504, "supported_languages": null}, "macro.dbt.default__length": {"name": "default__length", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/length.sql", "original_file_path": "macros/utils/length.sql", "unique_id": "macro.dbt.default__length", "macro_sql": "{% macro default__length(expression) %}\n\n length(\n {{ expression }}\n )\n\n{%- endmacro -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "expression", "type": null, "description": ""}], "created_at": 1789422566.6618798, "supported_languages": null}, "macro.dbt.cast": {"name": "cast", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/cast.sql", "original_file_path": "macros/utils/cast.sql", "unique_id": "macro.dbt.cast", "macro_sql": "{% macro cast(field, type) %}\n {{ return(adapter.dispatch('cast', 'dbt') (field, type)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__cast"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field", "type": null, "description": ""}, {"name": "type", "type": null, "description": ""}], "created_at": 1789422566.66242, "supported_languages": null}, "macro.dbt.default__cast": {"name": "default__cast", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/cast.sql", "original_file_path": "macros/utils/cast.sql", "unique_id": "macro.dbt.default__cast", "macro_sql": "{% macro default__cast(field, type) %}\n cast({{field}} as {{type}})\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field", "type": null, "description": ""}, {"name": "type", "type": null, "description": ""}], "created_at": 1789422566.662723, "supported_languages": null}, "macro.dbt.get_intervals_between": {"name": "get_intervals_between", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/date_spine.sql", "original_file_path": "macros/utils/date_spine.sql", "unique_id": "macro.dbt.get_intervals_between", "macro_sql": "{% macro get_intervals_between(start_date, end_date, datepart) -%}\n {{ return(adapter.dispatch('get_intervals_between', 'dbt')(start_date, end_date, datepart)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_intervals_between"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "start_date", "type": null, "description": ""}, {"name": "end_date", "type": null, "description": ""}, {"name": "datepart", "type": null, "description": ""}], "created_at": 1789422566.6638603, "supported_languages": null}, "macro.dbt.default__get_intervals_between": {"name": "default__get_intervals_between", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/date_spine.sql", "original_file_path": "macros/utils/date_spine.sql", "unique_id": "macro.dbt.default__get_intervals_between", "macro_sql": "{% macro default__get_intervals_between(start_date, end_date, datepart) -%}\n {%- call statement('get_intervals_between', fetch_result=True) %}\n\n select {{ dbt.datediff(start_date, end_date, datepart) }}\n\n {%- endcall -%}\n\n {%- set value_list = load_result('get_intervals_between') -%}\n\n {%- if value_list and value_list['data'] -%}\n {%- set values = value_list['data'] | map(attribute=0) | list %}\n {{ return(values[0]) }}\n {%- else -%}\n {{ return(1) }}\n {%- endif -%}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.statement", "macro.dbt.datediff"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "start_date", "type": null, "description": ""}, {"name": "end_date", "type": null, "description": ""}, {"name": "datepart", "type": null, "description": ""}], "created_at": 1789422566.6651115, "supported_languages": null}, "macro.dbt.date_spine": {"name": "date_spine", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/date_spine.sql", "original_file_path": "macros/utils/date_spine.sql", "unique_id": "macro.dbt.date_spine", "macro_sql": "{% macro date_spine(datepart, start_date, end_date) %}\n {{ return(adapter.dispatch('date_spine', 'dbt')(datepart, start_date, end_date)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__date_spine"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "datepart", "type": null, "description": ""}, {"name": "start_date", "type": null, "description": ""}, {"name": "end_date", "type": null, "description": ""}], "created_at": 1789422566.6656117, "supported_languages": null}, "macro.dbt.default__date_spine": {"name": "default__date_spine", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/date_spine.sql", "original_file_path": "macros/utils/date_spine.sql", "unique_id": "macro.dbt.default__date_spine", "macro_sql": "{% macro default__date_spine(datepart, start_date, end_date) %}\n\n\n {# call as follows:\n\n date_spine(\n \"day\",\n \"to_date('01/01/2016', 'mm/dd/yyyy')\",\n \"dbt.dateadd(week, 1, current_date)\"\n ) #}\n\n\n with rawdata as (\n\n {{dbt.generate_series(\n dbt.get_intervals_between(start_date, end_date, datepart)\n )}}\n\n ),\n\n all_periods as (\n\n select (\n {{\n dbt.dateadd(\n datepart,\n \"row_number() over (order by 1) - 1\",\n start_date\n )\n }}\n ) as date_{{datepart}}\n from rawdata\n\n ),\n\n filtered as (\n\n select *\n from all_periods\n where date_{{datepart}} <= {{ end_date }}\n\n )\n\n select * from filtered\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.generate_series", "macro.dbt.get_intervals_between", "macro.dbt.dateadd"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "datepart", "type": null, "description": ""}, {"name": "start_date", "type": null, "description": ""}, {"name": "end_date", "type": null, "description": ""}], "created_at": 1789422566.6663523, "supported_languages": null}, "macro.dbt.datediff": {"name": "datediff", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/datediff.sql", "original_file_path": "macros/utils/datediff.sql", "unique_id": "macro.dbt.datediff", "macro_sql": "{% macro datediff(first_date, second_date, datepart) %}\n {{ return(adapter.dispatch('datediff', 'dbt')(first_date, second_date, datepart)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__datediff"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "first_date", "type": null, "description": ""}, {"name": "second_date", "type": null, "description": ""}, {"name": "datepart", "type": null, "description": ""}], "created_at": 1789422566.6670258, "supported_languages": null}, "macro.dbt.default__datediff": {"name": "default__datediff", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/datediff.sql", "original_file_path": "macros/utils/datediff.sql", "unique_id": "macro.dbt.default__datediff", "macro_sql": "{% macro default__datediff(first_date, second_date, datepart) -%}\n\n datediff(\n {{ datepart }},\n {{ first_date }},\n {{ second_date }}\n )\n\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "first_date", "type": null, "description": ""}, {"name": "second_date", "type": null, "description": ""}, {"name": "datepart", "type": null, "description": ""}], "created_at": 1789422566.667372, "supported_languages": null}, "macro.dbt.equals": {"name": "equals", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/equals.sql", "original_file_path": "macros/utils/equals.sql", "unique_id": "macro.dbt.equals", "macro_sql": "{% macro equals(expr1, expr2) %}\n {{ return(adapter.dispatch('equals', 'dbt') (expr1, expr2)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__equals"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "expr1", "type": null, "description": ""}, {"name": "expr2", "type": null, "description": ""}], "created_at": 1789422566.6680577, "supported_languages": null}, "macro.dbt.default__equals": {"name": "default__equals", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/equals.sql", "original_file_path": "macros/utils/equals.sql", "unique_id": "macro.dbt.default__equals", "macro_sql": "{% macro default__equals(expr1, expr2) -%}\n{%- if adapter.behavior.enable_truthy_nulls_equals_macro.no_warn %}\n case when (({{ expr1 }} = {{ expr2 }}) or ({{ expr1 }} is null and {{ expr2 }} is null))\n then 0\n else 1\n end = 0\n{%- else -%}\n ({{ expr1 }} = {{ expr2 }})\n{%- endif %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "expr1", "type": null, "description": ""}, {"name": "expr2", "type": null, "description": ""}], "created_at": 1789422566.6686938, "supported_languages": null}, "macro.dbt.dateadd": {"name": "dateadd", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/dateadd.sql", "original_file_path": "macros/utils/dateadd.sql", "unique_id": "macro.dbt.dateadd", "macro_sql": "{% macro dateadd(datepart, interval, from_date_or_timestamp) %}\n {{ return(adapter.dispatch('dateadd', 'dbt')(datepart, interval, from_date_or_timestamp)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__dateadd"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "datepart", "type": null, "description": ""}, {"name": "interval", "type": null, "description": ""}, {"name": "from_date_or_timestamp", "type": null, "description": ""}], "created_at": 1789422566.6693184, "supported_languages": null}, "macro.dbt.default__dateadd": {"name": "default__dateadd", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/dateadd.sql", "original_file_path": "macros/utils/dateadd.sql", "unique_id": "macro.dbt.default__dateadd", "macro_sql": "{% macro default__dateadd(datepart, interval, from_date_or_timestamp) %}\n\n dateadd(\n {{ datepart }},\n {{ interval }},\n {{ from_date_or_timestamp }}\n )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "datepart", "type": null, "description": ""}, {"name": "interval", "type": null, "description": ""}, {"name": "from_date_or_timestamp", "type": null, "description": ""}], "created_at": 1789422566.6696968, "supported_languages": null}, "macro.dbt.concat": {"name": "concat", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/concat.sql", "original_file_path": "macros/utils/concat.sql", "unique_id": "macro.dbt.concat", "macro_sql": "{% macro concat(fields) -%}\n {{ return(adapter.dispatch('concat', 'dbt')(fields)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__concat"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "fields", "type": null, "description": ""}], "created_at": 1789422566.6701877, "supported_languages": null}, "macro.dbt.default__concat": {"name": "default__concat", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/concat.sql", "original_file_path": "macros/utils/concat.sql", "unique_id": "macro.dbt.default__concat", "macro_sql": "{% macro default__concat(fields) -%}\n {{ fields|join(' || ') }}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "fields", "type": null, "description": ""}], "created_at": 1789422566.6704667, "supported_languages": null}, "macro.dbt.array_construct": {"name": "array_construct", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/array_construct.sql", "original_file_path": "macros/utils/array_construct.sql", "unique_id": "macro.dbt.array_construct", "macro_sql": "{% macro array_construct(inputs=[], data_type=api.Column.translate_type('integer')) -%}\n {{ return(adapter.dispatch('array_construct', 'dbt')(inputs, data_type)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__array_construct"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "inputs", "type": null, "description": ""}, {"name": "data_type", "type": null, "description": ""}], "created_at": 1789422566.6712174, "supported_languages": null}, "macro.dbt.default__array_construct": {"name": "default__array_construct", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/array_construct.sql", "original_file_path": "macros/utils/array_construct.sql", "unique_id": "macro.dbt.default__array_construct", "macro_sql": "{% macro default__array_construct(inputs, data_type) -%}\n {% if inputs|length > 0 %}\n array[ {{ inputs|join(' , ') }} ]\n {% else %}\n array[]::{{data_type}}[]\n {% endif %}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "inputs", "type": null, "description": ""}, {"name": "data_type", "type": null, "description": ""}], "created_at": 1789422566.6717455, "supported_languages": null}, "macro.dbt.split_part": {"name": "split_part", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/split_part.sql", "original_file_path": "macros/utils/split_part.sql", "unique_id": "macro.dbt.split_part", "macro_sql": "{% macro split_part(string_text, delimiter_text, part_number) %}\n {{ return(adapter.dispatch('split_part', 'dbt') (string_text, delimiter_text, part_number)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__split_part"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "string_text", "type": null, "description": ""}, {"name": "delimiter_text", "type": null, "description": ""}, {"name": "part_number", "type": null, "description": ""}], "created_at": 1789422566.6724453, "supported_languages": null}, "macro.dbt.default__split_part": {"name": "default__split_part", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/split_part.sql", "original_file_path": "macros/utils/split_part.sql", "unique_id": "macro.dbt.default__split_part", "macro_sql": "{% macro default__split_part(string_text, delimiter_text, part_number) %}\n\n split_part(\n {{ string_text }},\n {{ delimiter_text }},\n {{ part_number }}\n )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "string_text", "type": null, "description": ""}, {"name": "delimiter_text", "type": null, "description": ""}, {"name": "part_number", "type": null, "description": ""}], "created_at": 1789422566.6729462, "supported_languages": null}, "macro.dbt._split_part_negative": {"name": "_split_part_negative", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/split_part.sql", "original_file_path": "macros/utils/split_part.sql", "unique_id": "macro.dbt._split_part_negative", "macro_sql": "{% macro _split_part_negative(string_text, delimiter_text, part_number) %}\n\n split_part(\n {{ string_text }},\n {{ delimiter_text }},\n length({{ string_text }})\n - length(\n replace({{ string_text }}, {{ delimiter_text }}, '')\n ) + 2 + {{ part_number }}\n )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "string_text", "type": null, "description": ""}, {"name": "delimiter_text", "type": null, "description": ""}, {"name": "part_number", "type": null, "description": ""}], "created_at": 1789422566.673408, "supported_languages": null}, "macro.dbt.bool_or": {"name": "bool_or", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/bool_or.sql", "original_file_path": "macros/utils/bool_or.sql", "unique_id": "macro.dbt.bool_or", "macro_sql": "{% macro bool_or(expression) -%}\n {{ return(adapter.dispatch('bool_or', 'dbt') (expression)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__bool_or"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "expression", "type": null, "description": ""}], "created_at": 1789422566.6739252, "supported_languages": null}, "macro.dbt.default__bool_or": {"name": "default__bool_or", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/bool_or.sql", "original_file_path": "macros/utils/bool_or.sql", "unique_id": "macro.dbt.default__bool_or", "macro_sql": "{% macro default__bool_or(expression) -%}\n\n bool_or({{ expression }})\n\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "expression", "type": null, "description": ""}], "created_at": 1789422566.6741476, "supported_languages": null}, "macro.dbt.replace": {"name": "replace", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/replace.sql", "original_file_path": "macros/utils/replace.sql", "unique_id": "macro.dbt.replace", "macro_sql": "{% macro replace(field, old_chars, new_chars) -%}\n {{ return(adapter.dispatch('replace', 'dbt') (field, old_chars, new_chars)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__replace"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field", "type": null, "description": ""}, {"name": "old_chars", "type": null, "description": ""}, {"name": "new_chars", "type": null, "description": ""}], "created_at": 1789422566.6747844, "supported_languages": null}, "macro.dbt.default__replace": {"name": "default__replace", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/replace.sql", "original_file_path": "macros/utils/replace.sql", "unique_id": "macro.dbt.default__replace", "macro_sql": "{% macro default__replace(field, old_chars, new_chars) %}\n\n replace(\n {{ field }},\n {{ old_chars }},\n {{ new_chars }}\n )\n\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field", "type": null, "description": ""}, {"name": "old_chars", "type": null, "description": ""}, {"name": "new_chars", "type": null, "description": ""}], "created_at": 1789422566.675129, "supported_languages": null}, "macro.dbt.string_literal": {"name": "string_literal", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/literal.sql", "original_file_path": "macros/utils/literal.sql", "unique_id": "macro.dbt.string_literal", "macro_sql": "{%- macro string_literal(value) -%}\n {{ return(adapter.dispatch('string_literal', 'dbt') (value)) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt.default__string_literal"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "value", "type": null, "description": ""}], "created_at": 1789422566.6756468, "supported_languages": null}, "macro.dbt.default__string_literal": {"name": "default__string_literal", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/literal.sql", "original_file_path": "macros/utils/literal.sql", "unique_id": "macro.dbt.default__string_literal", "macro_sql": "{% macro default__string_literal(value) -%}\n '{{ value }}'\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "value", "type": null, "description": ""}], "created_at": 1789422566.6758692, "supported_languages": null}, "macro.dbt.except": {"name": "except", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/except.sql", "original_file_path": "macros/utils/except.sql", "unique_id": "macro.dbt.except", "macro_sql": "{% macro except() %}\n {{ return(adapter.dispatch('except', 'dbt')()) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__except"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789422566.6763148, "supported_languages": null}, "macro.dbt.default__except": {"name": "default__except", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/except.sql", "original_file_path": "macros/utils/except.sql", "unique_id": "macro.dbt.default__except", "macro_sql": "{% macro default__except() %}\n\n except\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789422566.6764803, "supported_languages": null}, "macro.dbt.statement": {"name": "statement", "resource_type": "macro", "package_name": "dbt", "path": "macros/etc/statement.sql", "original_file_path": "macros/etc/statement.sql", "unique_id": "macro.dbt.statement", "macro_sql": "\n{%- macro statement(name=None, fetch_result=False, auto_begin=True, language='sql') -%}\n {%- if execute: -%}\n {%- set compiled_code = caller() -%}\n\n {%- if name == 'main' -%}\n {{ log('Writing runtime {} for node \"{}\"'.format(language, model['unique_id'])) }}\n {{ write(compiled_code) }}\n {%- endif -%}\n {%- if language == 'sql'-%}\n {%- set res, table = adapter.execute(compiled_code, auto_begin=auto_begin, fetch=fetch_result) -%}\n {%- elif language == 'python' -%}\n {%- set res = submit_python_job(model, compiled_code) -%}\n {#-- TODO: What should table be for python models? --#}\n {%- set table = None -%}\n {%- else -%}\n {% do exceptions.raise_compiler_error(\"statement macro didn't get supported language\") %}\n {%- endif -%}\n\n {%- if name is not none -%}\n {{ store_result(name, response=res, agate_table=table) }}\n {%- endif -%}\n\n {%- endif -%}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "name", "type": null, "description": ""}, {"name": "fetch_result", "type": null, "description": ""}, {"name": "auto_begin", "type": null, "description": ""}, {"name": "language", "type": null, "description": ""}], "created_at": 1789422566.679077, "supported_languages": null}, "macro.dbt.noop_statement": {"name": "noop_statement", "resource_type": "macro", "package_name": "dbt", "path": "macros/etc/statement.sql", "original_file_path": "macros/etc/statement.sql", "unique_id": "macro.dbt.noop_statement", "macro_sql": "{% macro noop_statement(name=None, message=None, code=None, rows_affected=None, res=None) -%}\n {%- set sql = caller() -%}\n\n {%- if name == 'main' -%}\n {{ log('Writing runtime SQL for node \"{}\"'.format(model['unique_id'])) }}\n {{ write(sql) }}\n {%- endif -%}\n\n {%- if name is not none -%}\n {{ store_raw_result(name, message=message, code=code, rows_affected=rows_affected, agate_table=res) }}\n {%- endif -%}\n\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "name", "type": null, "description": ""}, {"name": "message", "type": null, "description": ""}, {"name": "code", "type": null, "description": ""}, {"name": "rows_affected", "type": null, "description": ""}, {"name": "res", "type": null, "description": ""}], "created_at": 1789422566.6803765, "supported_languages": null}, "macro.dbt.run_query": {"name": "run_query", "resource_type": "macro", "package_name": "dbt", "path": "macros/etc/statement.sql", "original_file_path": "macros/etc/statement.sql", "unique_id": "macro.dbt.run_query", "macro_sql": "{% macro run_query(sql) %}\n {% call statement(\"run_query_statement\", fetch_result=true, auto_begin=false) %}\n {{ sql }}\n {% endcall %}\n\n {% do return(load_result(\"run_query_statement\").table) %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "sql", "type": null, "description": ""}], "created_at": 1789422566.6809905, "supported_languages": null}, "macro.dbt.convert_datetime": {"name": "convert_datetime", "resource_type": "macro", "package_name": "dbt", "path": "macros/etc/datetime.sql", "original_file_path": "macros/etc/datetime.sql", "unique_id": "macro.dbt.convert_datetime", "macro_sql": "{% macro convert_datetime(date_str, date_fmt) %}\n\n {% set error_msg -%}\n The provided partition date '{{ date_str }}' does not match the expected format '{{ date_fmt }}'\n {%- endset %}\n\n {% set res = try_or_compiler_error(error_msg, modules.datetime.datetime.strptime, date_str.strip(), date_fmt) %}\n {{ return(res) }}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "date_str", "type": null, "description": ""}, {"name": "date_fmt", "type": null, "description": ""}], "created_at": 1789422566.6824377, "supported_languages": null}, "macro.dbt.dates_in_range": {"name": "dates_in_range", "resource_type": "macro", "package_name": "dbt", "path": "macros/etc/datetime.sql", "original_file_path": "macros/etc/datetime.sql", "unique_id": "macro.dbt.dates_in_range", "macro_sql": "{% macro dates_in_range(start_date_str, end_date_str=none, in_fmt=\"%Y%m%d\", out_fmt=\"%Y%m%d\") %}\n {% set end_date_str = start_date_str if end_date_str is none else end_date_str %}\n\n {% set start_date = convert_datetime(start_date_str, in_fmt) %}\n {% set end_date = convert_datetime(end_date_str, in_fmt) %}\n\n {% set day_count = (end_date - start_date).days %}\n {% if day_count < 0 %}\n {% set msg -%}\n Partition start date is after the end date ({{ start_date }}, {{ end_date }})\n {%- endset %}\n\n {{ exceptions.raise_compiler_error(msg, model) }}\n {% endif %}\n\n {% set date_list = [] %}\n {% for i in range(0, day_count + 1) %}\n {% set the_date = (modules.datetime.timedelta(days=i) + start_date) %}\n {% if not out_fmt %}\n {% set _ = date_list.append(the_date) %}\n {% else %}\n {% set _ = date_list.append(the_date.strftime(out_fmt)) %}\n {% endif %}\n {% endfor %}\n\n {{ return(date_list) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.convert_datetime"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "start_date_str", "type": null, "description": ""}, {"name": "end_date_str", "type": null, "description": ""}, {"name": "in_fmt", "type": null, "description": ""}, {"name": "out_fmt", "type": null, "description": ""}], "created_at": 1789422566.6847908, "supported_languages": null}, "macro.dbt.partition_range": {"name": "partition_range", "resource_type": "macro", "package_name": "dbt", "path": "macros/etc/datetime.sql", "original_file_path": "macros/etc/datetime.sql", "unique_id": "macro.dbt.partition_range", "macro_sql": "{% macro partition_range(raw_partition_date, date_fmt='%Y%m%d') %}\n {% set partition_range = (raw_partition_date | string).split(\",\") %}\n\n {% if (partition_range | length) == 1 %}\n {% set start_date = partition_range[0] %}\n {% set end_date = none %}\n {% elif (partition_range | length) == 2 %}\n {% set start_date = partition_range[0] %}\n {% set end_date = partition_range[1] %}\n {% else %}\n {{ exceptions.raise_compiler_error(\"Invalid partition time. Expected format: {Start Date}[,{End Date}]. Got: \" ~ raw_partition_date) }}\n {% endif %}\n\n {{ return(dates_in_range(start_date, end_date, in_fmt=date_fmt)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.dates_in_range"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "raw_partition_date", "type": null, "description": ""}, {"name": "date_fmt", "type": null, "description": ""}], "created_at": 1789422566.686285, "supported_languages": null}, "macro.dbt.py_current_timestring": {"name": "py_current_timestring", "resource_type": "macro", "package_name": "dbt", "path": "macros/etc/datetime.sql", "original_file_path": "macros/etc/datetime.sql", "unique_id": "macro.dbt.py_current_timestring", "macro_sql": "{% macro py_current_timestring() %}\n {% set dt = modules.datetime.datetime.now() %}\n {% do return(dt.strftime(\"%Y%m%d%H%M%S%f\")) %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789422566.6867692, "supported_languages": null}, "macro.dbt.resolve_model_name": {"name": "resolve_model_name", "resource_type": "macro", "package_name": "dbt", "path": "macros/python_model/python.sql", "original_file_path": "macros/python_model/python.sql", "unique_id": "macro.dbt.resolve_model_name", "macro_sql": "{% macro resolve_model_name(input_model_name) %}\n {{ return(adapter.dispatch('resolve_model_name', 'dbt')(input_model_name)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__resolve_model_name"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "input_model_name", "type": null, "description": ""}], "created_at": 1789422566.6883264, "supported_languages": null}, "macro.dbt.default__resolve_model_name": {"name": "default__resolve_model_name", "resource_type": "macro", "package_name": "dbt", "path": "macros/python_model/python.sql", "original_file_path": "macros/python_model/python.sql", "unique_id": "macro.dbt.default__resolve_model_name", "macro_sql": "\n\n{%- macro default__resolve_model_name(input_model_name) -%}\n {{ input_model_name | string | replace('\"', '\\\"') }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "input_model_name", "type": null, "description": ""}], "created_at": 1789422566.688668, "supported_languages": null}, "macro.dbt.build_ref_function": {"name": "build_ref_function", "resource_type": "macro", "package_name": "dbt", "path": "macros/python_model/python.sql", "original_file_path": "macros/python_model/python.sql", "unique_id": "macro.dbt.build_ref_function", "macro_sql": "{% macro build_ref_function(model) %}\n\n {%- set ref_dict = {} -%}\n {%- for _ref in model.refs -%}\n {% set _ref_args = [_ref.get('package'), _ref['name']] if _ref.get('package') else [_ref['name'],] %}\n {%- set resolved = ref(*_ref_args, v=_ref.get('version')) -%}\n\n {#\n We want to get the string of the returned relation by calling .render() in order to skip sample/empty\n mode rendering logic. However, people override the default ref macro, and often return a string instead\n of a relation (like the ref macro does by default). Thus, to make sure we dont blow things up, we have\n to ensure the resolved relation has a .render() method.\n #}\n {%- if resolved.render is defined and resolved.render is callable -%}\n {%- set resolved = resolved.render() -%}\n {%- endif -%}\n\n {%- if _ref.get('version') -%}\n {% do _ref_args.extend([\"v\" ~ _ref['version']]) %}\n {%- endif -%}\n {%- do ref_dict.update({_ref_args | join('.'): resolve_model_name(resolved)}) -%}\n {%- endfor -%}\n\ndef ref(*args, **kwargs):\n refs = {{ ref_dict | tojson }}\n key = '.'.join(args)\n version = kwargs.get(\"v\") or kwargs.get(\"version\")\n if version:\n key += f\".v{version}\"\n dbt_load_df_function = kwargs.get(\"dbt_load_df_function\")\n return dbt_load_df_function(refs[key])\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.resolve_model_name"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}], "created_at": 1789422566.6906376, "supported_languages": null}, "macro.dbt.build_source_function": {"name": "build_source_function", "resource_type": "macro", "package_name": "dbt", "path": "macros/python_model/python.sql", "original_file_path": "macros/python_model/python.sql", "unique_id": "macro.dbt.build_source_function", "macro_sql": "{% macro build_source_function(model) %}\n\n {%- set source_dict = {} -%}\n {%- for _source in model.sources -%}\n {%- set resolved = source(*_source) -%}\n {%- do source_dict.update({_source | join('.'): resolve_model_name(resolved)}) -%}\n {%- endfor -%}\n\ndef source(*args, dbt_load_df_function):\n sources = {{ source_dict | tojson }}\n key = '.'.join(args)\n return dbt_load_df_function(sources[key])\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.resolve_model_name"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}], "created_at": 1789422566.6914983, "supported_languages": null}, "macro.dbt.build_config_dict": {"name": "build_config_dict", "resource_type": "macro", "package_name": "dbt", "path": "macros/python_model/python.sql", "original_file_path": "macros/python_model/python.sql", "unique_id": "macro.dbt.build_config_dict", "macro_sql": "{% macro build_config_dict(model) %}\n {%- set config_dict = {} -%}\n {% set config_dbt_used = zip(model.config.config_keys_used, model.config.config_keys_defaults) | list %}\n {%- for key, default in config_dbt_used -%}\n {# weird type testing with enum, would be much easier to write this logic in Python! #}\n {%- if key == \"language\" -%}\n {%- set value = \"python\" -%}\n {%- endif -%}\n {%- set value = model.config.get(key, default) -%}\n {%- do config_dict.update({key: value}) -%}\n {%- endfor -%}\n {# Handle dbt.config.meta_get() calls - use separate dict to avoid overwriting native configs #}\n {%- set meta_dict = {} -%}\n {%- if model.config.meta_keys_used -%}\n {% set meta_dbt_used = zip(model.config.meta_keys_used, model.config.meta_keys_defaults) | list %}\n {%- for key, default in meta_dbt_used -%}\n {%- if model.config.meta and key in model.config.meta -%}\n {%- set value = model.config.meta[key] -%}\n {%- else -%}\n {%- set value = default -%}\n {%- endif -%}\n {%- do meta_dict.update({key: value}) -%}\n {%- endfor -%}\n {%- endif -%}\nconfig_dict = {{ config_dict }}\nmeta_dict = {{ meta_dict }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}], "created_at": 1789422566.6938574, "supported_languages": null}, "macro.dbt.py_script_postfix": {"name": "py_script_postfix", "resource_type": "macro", "package_name": "dbt", "path": "macros/python_model/python.sql", "original_file_path": "macros/python_model/python.sql", "unique_id": "macro.dbt.py_script_postfix", "macro_sql": "{% macro py_script_postfix(model) %}\n# This part is user provided model code\n# you will need to copy the next section to run the code\n# COMMAND ----------\n# this part is dbt logic for get ref work, do not modify\n\n{{ build_ref_function(model ) }}\n{{ build_source_function(model ) }}\n{{ build_config_dict(model) }}\n\nclass config:\n def __init__(self, *args, **kwargs):\n pass\n\n @staticmethod\n def get(key, default=None):\n return config_dict.get(key, default)\n\n @staticmethod\n def meta_get(key, default=None):\n return meta_dict.get(key, default)\n\nclass this:\n \"\"\"dbt.this() or dbt.this.identifier\"\"\"\n database = \"{{ this.database }}\"\n schema = \"{{ this.schema }}\"\n identifier = \"{{ this.identifier }}\"\n {% set this_relation_name = resolve_model_name(this) %}\n def __repr__(self):\n return '{{ this_relation_name }}'\n\n\nclass dbtObj:\n def __init__(self, load_df_function) -> None:\n self.source = lambda *args: source(*args, dbt_load_df_function=load_df_function)\n self.ref = lambda *args, **kwargs: ref(*args, **kwargs, dbt_load_df_function=load_df_function)\n self.config = config\n self.this = this()\n self.is_incremental = {{ is_incremental() }}\n\n# COMMAND ----------\n{{py_script_comment()}}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.build_ref_function", "macro.dbt.build_source_function", "macro.dbt.build_config_dict", "macro.dbt.resolve_model_name", "macro.dbt.is_incremental", "macro.dbt.py_script_comment"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}], "created_at": 1789422566.695848, "supported_languages": null}, "macro.dbt.py_script_comment": {"name": "py_script_comment", "resource_type": "macro", "package_name": "dbt", "path": "macros/python_model/python.sql", "original_file_path": "macros/python_model/python.sql", "unique_id": "macro.dbt.py_script_comment", "macro_sql": "{%macro py_script_comment()%}\n{%endmacro%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789422566.6960485, "supported_languages": null}, "macro.dbt.generate_schema_name": {"name": "generate_schema_name", "resource_type": "macro", "package_name": "dbt", "path": "macros/get_custom_name/get_custom_schema.sql", "original_file_path": "macros/get_custom_name/get_custom_schema.sql", "unique_id": "macro.dbt.generate_schema_name", "macro_sql": "{% macro generate_schema_name(custom_schema_name=none, node=none) -%}\n {{ return(adapter.dispatch('generate_schema_name', 'dbt')(custom_schema_name, node)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__generate_schema_name"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "custom_schema_name", "type": null, "description": ""}, {"name": "node", "type": null, "description": ""}], "created_at": 1789422566.6969738, "supported_languages": null}, "macro.dbt.default__generate_schema_name": {"name": "default__generate_schema_name", "resource_type": "macro", "package_name": "dbt", "path": "macros/get_custom_name/get_custom_schema.sql", "original_file_path": "macros/get_custom_name/get_custom_schema.sql", "unique_id": "macro.dbt.default__generate_schema_name", "macro_sql": "{% macro default__generate_schema_name(custom_schema_name, node) -%}\n\n {%- set default_schema = target.schema -%}\n {%- if custom_schema_name is none -%}\n\n {{ default_schema }}\n\n {%- else -%}\n\n {{ default_schema }}_{{ custom_schema_name | trim }}\n\n {%- endif -%}\n\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "custom_schema_name", "type": null, "description": ""}, {"name": "node", "type": null, "description": ""}], "created_at": 1789422566.6975646, "supported_languages": null}, "macro.dbt.generate_schema_name_for_env": {"name": "generate_schema_name_for_env", "resource_type": "macro", "package_name": "dbt", "path": "macros/get_custom_name/get_custom_schema.sql", "original_file_path": "macros/get_custom_name/get_custom_schema.sql", "unique_id": "macro.dbt.generate_schema_name_for_env", "macro_sql": "{% macro generate_schema_name_for_env(custom_schema_name, node) -%}\n\n {%- set default_schema = target.schema -%}\n {%- if target.name == 'prod' and custom_schema_name is not none -%}\n\n {{ custom_schema_name | trim }}\n\n {%- else -%}\n\n {{ default_schema }}\n\n {%- endif -%}\n\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "custom_schema_name", "type": null, "description": ""}, {"name": "node", "type": null, "description": ""}], "created_at": 1789422566.6981773, "supported_languages": null}, "macro.dbt.generate_latest_version_pointer_alias": {"name": "generate_latest_version_pointer_alias", "resource_type": "macro", "package_name": "dbt", "path": "macros/get_custom_name/get_latest_version_pointer_alias.sql", "original_file_path": "macros/get_custom_name/get_latest_version_pointer_alias.sql", "unique_id": "macro.dbt.generate_latest_version_pointer_alias", "macro_sql": "{% macro generate_latest_version_pointer_alias(custom_alias_name=none, node=none) -%}\n {% do return(adapter.dispatch('generate_latest_version_pointer_alias', 'dbt')(custom_alias_name, node)) %}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__generate_latest_version_pointer_alias"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "custom_alias_name", "type": null, "description": ""}, {"name": "node", "type": null, "description": ""}], "created_at": 1789422566.6989422, "supported_languages": null}, "macro.dbt.default__generate_latest_version_pointer_alias": {"name": "default__generate_latest_version_pointer_alias", "resource_type": "macro", "package_name": "dbt", "path": "macros/get_custom_name/get_latest_version_pointer_alias.sql", "original_file_path": "macros/get_custom_name/get_latest_version_pointer_alias.sql", "unique_id": "macro.dbt.default__generate_latest_version_pointer_alias", "macro_sql": "{% macro default__generate_latest_version_pointer_alias(custom_alias_name=none, node=none) -%}\n {%- if custom_alias_name -%}\n {{ custom_alias_name | trim }}\n {%- else -%}\n {{ node.name }}\n {%- endif -%}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "custom_alias_name", "type": null, "description": ""}, {"name": "node", "type": null, "description": ""}], "created_at": 1789422566.699402, "supported_languages": null}, "macro.dbt.generate_database_name": {"name": "generate_database_name", "resource_type": "macro", "package_name": "dbt", "path": "macros/get_custom_name/get_custom_database.sql", "original_file_path": "macros/get_custom_name/get_custom_database.sql", "unique_id": "macro.dbt.generate_database_name", "macro_sql": "{% macro generate_database_name(custom_database_name=none, node=none) -%}\n {% do return(adapter.dispatch('generate_database_name', 'dbt')(custom_database_name, node)) %}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__generate_database_name"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "custom_database_name", "type": null, "description": ""}, {"name": "node", "type": null, "description": ""}], "created_at": 1789422566.7002354, "supported_languages": null}, "macro.dbt.default__generate_database_name": {"name": "default__generate_database_name", "resource_type": "macro", "package_name": "dbt", "path": "macros/get_custom_name/get_custom_database.sql", "original_file_path": "macros/get_custom_name/get_custom_database.sql", "unique_id": "macro.dbt.default__generate_database_name", "macro_sql": "{% macro default__generate_database_name(custom_database_name=none, node=none) -%}\n {%- set default_database = target.database -%}\n {%- if node is not none and node|attr('database') -%}\n {%- set catalog_relation = adapter.build_catalog_relation(node) -%}\n {%- if catalog_relation and catalog_relation|attr('catalog_database') -%}\n {{ return(catalog_relation.catalog_database) }}\n {%- endif -%}\n {%- endif -%}\n {%- if custom_database_name is none -%}\n\n {{ default_database }}\n\n {%- else -%}\n\n {{ custom_database_name }}\n\n {%- endif -%}\n\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "custom_database_name", "type": null, "description": ""}, {"name": "node", "type": null, "description": ""}], "created_at": 1789422566.7013574, "supported_languages": null}, "macro.dbt.generate_alias_name": {"name": "generate_alias_name", "resource_type": "macro", "package_name": "dbt", "path": "macros/get_custom_name/get_custom_alias.sql", "original_file_path": "macros/get_custom_name/get_custom_alias.sql", "unique_id": "macro.dbt.generate_alias_name", "macro_sql": "{% macro generate_alias_name(custom_alias_name=none, node=none) -%}\n {% do return(adapter.dispatch('generate_alias_name', 'dbt')(custom_alias_name, node)) %}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__generate_alias_name"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "custom_alias_name", "type": null, "description": ""}, {"name": "node", "type": null, "description": ""}], "created_at": 1789422566.7021346, "supported_languages": null}, "macro.dbt.default__generate_alias_name": {"name": "default__generate_alias_name", "resource_type": "macro", "package_name": "dbt", "path": "macros/get_custom_name/get_custom_alias.sql", "original_file_path": "macros/get_custom_name/get_custom_alias.sql", "unique_id": "macro.dbt.default__generate_alias_name", "macro_sql": "{% macro default__generate_alias_name(custom_alias_name=none, node=none) -%}\n\n {%- if custom_alias_name -%}\n\n {{ custom_alias_name | trim }}\n\n {%- elif node.version -%}\n\n {{ return(node.name ~ \"_v\" ~ (node.version | replace(\".\", \"_\"))) }}\n\n {%- else -%}\n\n {{ node.name }}\n\n {%- endif -%}\n\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "custom_alias_name", "type": null, "description": ""}, {"name": "node", "type": null, "description": ""}], "created_at": 1789422566.7029536, "supported_languages": null}, "macro.dbt.get_show_sql": {"name": "get_show_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/show.sql", "original_file_path": "macros/adapters/show.sql", "unique_id": "macro.dbt.get_show_sql", "macro_sql": "{% macro get_show_sql(compiled_code, sql_header, limit) -%}\n {%- if sql_header is not none -%}\n {{ sql_header }}\n {%- endif %}\n {{ get_limit_subquery_sql(compiled_code, limit) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_limit_subquery_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "compiled_code", "type": null, "description": ""}, {"name": "sql_header", "type": null, "description": ""}, {"name": "limit", "type": null, "description": ""}], "created_at": 1789422566.703741, "supported_languages": null}, "macro.dbt.get_limit_subquery_sql": {"name": "get_limit_subquery_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/show.sql", "original_file_path": "macros/adapters/show.sql", "unique_id": "macro.dbt.get_limit_subquery_sql", "macro_sql": "\n{%- macro get_limit_subquery_sql(sql, limit) -%}\n {{ adapter.dispatch('get_limit_sql', 'dbt')(sql, limit) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt.default__get_limit_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "sql", "type": null, "description": ""}, {"name": "limit", "type": null, "description": ""}], "created_at": 1789422566.7041314, "supported_languages": null}, "macro.dbt.default__get_limit_sql": {"name": "default__get_limit_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/show.sql", "original_file_path": "macros/adapters/show.sql", "unique_id": "macro.dbt.default__get_limit_sql", "macro_sql": "{% macro default__get_limit_sql(sql, limit) %}\n {{ sql }}\n {% if limit is not none %}\n limit {{ limit }}\n {%- endif -%}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "sql", "type": null, "description": ""}, {"name": "limit", "type": null, "description": ""}], "created_at": 1789422566.7045596, "supported_languages": null}, "macro.dbt.current_timestamp": {"name": "current_timestamp", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/timestamps.sql", "original_file_path": "macros/adapters/timestamps.sql", "unique_id": "macro.dbt.current_timestamp", "macro_sql": "{%- macro current_timestamp() -%}\n {{ adapter.dispatch('current_timestamp', 'dbt')() }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt_postgres.postgres__current_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789422566.7054558, "supported_languages": null}, "macro.dbt.default__current_timestamp": {"name": "default__current_timestamp", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/timestamps.sql", "original_file_path": "macros/adapters/timestamps.sql", "unique_id": "macro.dbt.default__current_timestamp", "macro_sql": "{% macro default__current_timestamp() -%}\n {{ exceptions.raise_not_implemented(\n 'current_timestamp macro not implemented for adapter ' + adapter.type()) }}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789422566.7058275, "supported_languages": null}, "macro.dbt.snapshot_get_time": {"name": "snapshot_get_time", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/timestamps.sql", "original_file_path": "macros/adapters/timestamps.sql", "unique_id": "macro.dbt.snapshot_get_time", "macro_sql": "\n\n{%- macro snapshot_get_time() -%}\n {{ adapter.dispatch('snapshot_get_time', 'dbt')() }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt_postgres.postgres__snapshot_get_time"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789422566.7062938, "supported_languages": null}, "macro.dbt.default__snapshot_get_time": {"name": "default__snapshot_get_time", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/timestamps.sql", "original_file_path": "macros/adapters/timestamps.sql", "unique_id": "macro.dbt.default__snapshot_get_time", "macro_sql": "{% macro default__snapshot_get_time() %}\n {{ current_timestamp() }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.current_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789422566.7065542, "supported_languages": null}, "macro.dbt.get_snapshot_get_time_data_type": {"name": "get_snapshot_get_time_data_type", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/timestamps.sql", "original_file_path": "macros/adapters/timestamps.sql", "unique_id": "macro.dbt.get_snapshot_get_time_data_type", "macro_sql": "{% macro get_snapshot_get_time_data_type() %}\n {% set snapshot_time = adapter.dispatch('snapshot_get_time', 'dbt')() %}\n {% set time_data_type_sql = 'select ' ~ snapshot_time ~ ' as dbt_snapshot_time' %}\n {% set snapshot_time_column_schema = get_column_schema_from_query(time_data_type_sql) %}\n {% set time_data_type = snapshot_time_column_schema[0].dtype %}\n {{ return(time_data_type or none) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.snapshot_get_time", "macro.dbt_postgres.postgres__snapshot_get_time", "macro.dbt.get_column_schema_from_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789422566.7074099, "supported_languages": null}, "macro.dbt.current_timestamp_backcompat": {"name": "current_timestamp_backcompat", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/timestamps.sql", "original_file_path": "macros/adapters/timestamps.sql", "unique_id": "macro.dbt.current_timestamp_backcompat", "macro_sql": "{% macro current_timestamp_backcompat() %}\n {{ return(adapter.dispatch('current_timestamp_backcompat', 'dbt')()) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__current_timestamp_backcompat"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789422566.7077844, "supported_languages": null}, "macro.dbt.default__current_timestamp_backcompat": {"name": "default__current_timestamp_backcompat", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/timestamps.sql", "original_file_path": "macros/adapters/timestamps.sql", "unique_id": "macro.dbt.default__current_timestamp_backcompat", "macro_sql": "{% macro default__current_timestamp_backcompat() %}\n current_timestamp::timestamp\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789422566.7079546, "supported_languages": null}, "macro.dbt.current_timestamp_in_utc_backcompat": {"name": "current_timestamp_in_utc_backcompat", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/timestamps.sql", "original_file_path": "macros/adapters/timestamps.sql", "unique_id": "macro.dbt.current_timestamp_in_utc_backcompat", "macro_sql": "{% macro current_timestamp_in_utc_backcompat() %}\n {{ return(adapter.dispatch('current_timestamp_in_utc_backcompat', 'dbt')()) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__current_timestamp_in_utc_backcompat"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789422566.7082903, "supported_languages": null}, "macro.dbt.default__current_timestamp_in_utc_backcompat": {"name": "default__current_timestamp_in_utc_backcompat", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/timestamps.sql", "original_file_path": "macros/adapters/timestamps.sql", "unique_id": "macro.dbt.default__current_timestamp_in_utc_backcompat", "macro_sql": "{% macro default__current_timestamp_in_utc_backcompat() %}\n {{ return(adapter.dispatch('current_timestamp_backcompat', 'dbt')()) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.current_timestamp_backcompat", "macro.dbt_postgres.postgres__current_timestamp_backcompat"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789422566.7086544, "supported_languages": null}, "macro.dbt.create_schema": {"name": "create_schema", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/schema.sql", "original_file_path": "macros/adapters/schema.sql", "unique_id": "macro.dbt.create_schema", "macro_sql": "{% macro create_schema(relation) -%}\n {{ adapter.dispatch('create_schema', 'dbt')(relation) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__create_schema"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789422566.7092948, "supported_languages": null}, "macro.dbt.default__create_schema": {"name": "default__create_schema", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/schema.sql", "original_file_path": "macros/adapters/schema.sql", "unique_id": "macro.dbt.default__create_schema", "macro_sql": "{% macro default__create_schema(relation) -%}\n {%- call statement('create_schema') -%}\n create schema if not exists {{ relation.without_identifier() }}\n {% endcall %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789422566.709717, "supported_languages": null}, "macro.dbt.drop_schema": {"name": "drop_schema", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/schema.sql", "original_file_path": "macros/adapters/schema.sql", "unique_id": "macro.dbt.drop_schema", "macro_sql": "{% macro drop_schema(relation) -%}\n {{ adapter.dispatch('drop_schema', 'dbt')(relation) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__drop_schema"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789422566.7100646, "supported_languages": null}, "macro.dbt.default__drop_schema": {"name": "default__drop_schema", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/schema.sql", "original_file_path": "macros/adapters/schema.sql", "unique_id": "macro.dbt.default__drop_schema", "macro_sql": "{% macro default__drop_schema(relation) -%}\n {%- call statement('drop_schema') -%}\n drop schema if exists {{ relation.without_identifier() }} cascade\n {% endcall %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789422566.71046, "supported_languages": null}, "macro.dbt.copy_grants": {"name": "copy_grants", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "unique_id": "macro.dbt.copy_grants", "macro_sql": "{% macro copy_grants() %}\n {{ return(adapter.dispatch('copy_grants', 'dbt')()) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__copy_grants"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789422566.7126234, "supported_languages": null}, "macro.dbt.default__copy_grants": {"name": "default__copy_grants", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "unique_id": "macro.dbt.default__copy_grants", "macro_sql": "{% macro default__copy_grants() %}\n {{ return(True) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789422566.712877, "supported_languages": null}, "macro.dbt.support_multiple_grantees_per_dcl_statement": {"name": "support_multiple_grantees_per_dcl_statement", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "unique_id": "macro.dbt.support_multiple_grantees_per_dcl_statement", "macro_sql": "{% macro support_multiple_grantees_per_dcl_statement() %}\n {{ return(adapter.dispatch('support_multiple_grantees_per_dcl_statement', 'dbt')()) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__support_multiple_grantees_per_dcl_statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789422566.713214, "supported_languages": null}, "macro.dbt.default__support_multiple_grantees_per_dcl_statement": {"name": "default__support_multiple_grantees_per_dcl_statement", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "unique_id": "macro.dbt.default__support_multiple_grantees_per_dcl_statement", "macro_sql": "\n\n{%- macro default__support_multiple_grantees_per_dcl_statement() -%}\n {{ return(True) }}\n{%- endmacro -%}\n\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789422566.713453, "supported_languages": null}, "macro.dbt.should_revoke": {"name": "should_revoke", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "unique_id": "macro.dbt.should_revoke", "macro_sql": "{% macro should_revoke(existing_relation, full_refresh_mode=True) %}\n\n {% if not existing_relation %}\n {#-- The table doesn't already exist, so no grants to copy over --#}\n {{ return(False) }}\n {% elif full_refresh_mode %}\n {#-- The object is being REPLACED -- whether grants are copied over depends on the value of user config --#}\n {{ return(copy_grants()) }}\n {% else %}\n {#-- The table is being merged/upserted/inserted -- grants will be carried over --#}\n {{ return(True) }}\n {% endif %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.copy_grants"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "existing_relation", "type": null, "description": ""}, {"name": "full_refresh_mode", "type": null, "description": ""}], "created_at": 1789422566.7142947, "supported_languages": null}, "macro.dbt.get_show_grant_sql": {"name": "get_show_grant_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "unique_id": "macro.dbt.get_show_grant_sql", "macro_sql": "{% macro get_show_grant_sql(relation) %}\n {{ return(adapter.dispatch(\"get_show_grant_sql\", \"dbt\")(relation)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__get_show_grant_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789422566.714706, "supported_languages": null}, "macro.dbt.default__get_show_grant_sql": {"name": "default__get_show_grant_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "unique_id": "macro.dbt.default__get_show_grant_sql", "macro_sql": "{% macro default__get_show_grant_sql(relation) %}\n show grants on {{ relation.render() }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789422566.714973, "supported_languages": null}, "macro.dbt.get_grant_sql": {"name": "get_grant_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "unique_id": "macro.dbt.get_grant_sql", "macro_sql": "{% macro get_grant_sql(relation, privilege, grantees) %}\n {{ return(adapter.dispatch('get_grant_sql', 'dbt')(relation, privilege, grantees)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_grant_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "privilege", "type": null, "description": ""}, {"name": "grantees", "type": null, "description": ""}], "created_at": 1789422566.7154317, "supported_languages": null}, "macro.dbt.default__get_grant_sql": {"name": "default__get_grant_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "unique_id": "macro.dbt.default__get_grant_sql", "macro_sql": "\n\n{%- macro default__get_grant_sql(relation, privilege, grantees) -%}\n grant {{ privilege }} on {{ relation.render() }} to {{ grantees | join(', ') }}\n{%- endmacro -%}\n\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "privilege", "type": null, "description": ""}, {"name": "grantees", "type": null, "description": ""}], "created_at": 1789422566.7158856, "supported_languages": null}, "macro.dbt.get_revoke_sql": {"name": "get_revoke_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "unique_id": "macro.dbt.get_revoke_sql", "macro_sql": "{% macro get_revoke_sql(relation, privilege, grantees) %}\n {{ return(adapter.dispatch('get_revoke_sql', 'dbt')(relation, privilege, grantees)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_revoke_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "privilege", "type": null, "description": ""}, {"name": "grantees", "type": null, "description": ""}], "created_at": 1789422566.7163506, "supported_languages": null}, "macro.dbt.default__get_revoke_sql": {"name": "default__get_revoke_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "unique_id": "macro.dbt.default__get_revoke_sql", "macro_sql": "\n\n{%- macro default__get_revoke_sql(relation, privilege, grantees) -%}\n {%- set quoted_grantees = [] -%}\n {%- for grantee in grantees -%}\n {%- do quoted_grantees.append(adapter.quote(grantee)) -%}\n {%- endfor -%}\n revoke {{ privilege }} on {{ relation.render() }} from {{ quoted_grantees | join(', ') }}\n{%- endmacro -%}\n\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "privilege", "type": null, "description": ""}, {"name": "grantees", "type": null, "description": ""}], "created_at": 1789422566.7171462, "supported_languages": null}, "macro.dbt.get_dcl_statement_list": {"name": "get_dcl_statement_list", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "unique_id": "macro.dbt.get_dcl_statement_list", "macro_sql": "{% macro get_dcl_statement_list(relation, grant_config, get_dcl_macro) %}\n {{ return(adapter.dispatch('get_dcl_statement_list', 'dbt')(relation, grant_config, get_dcl_macro)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_dcl_statement_list"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "grant_config", "type": null, "description": ""}, {"name": "get_dcl_macro", "type": null, "description": ""}], "created_at": 1789422566.717639, "supported_languages": null}, "macro.dbt.default__get_dcl_statement_list": {"name": "default__get_dcl_statement_list", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "unique_id": "macro.dbt.default__get_dcl_statement_list", "macro_sql": "\n\n{%- macro default__get_dcl_statement_list(relation, grant_config, get_dcl_macro) -%}\n {#\n -- Unpack grant_config into specific privileges and the set of users who need them granted/revoked.\n -- Depending on whether this database supports multiple grantees per statement, pass in the list of\n -- all grantees per privilege, or (if not) template one statement per privilege-grantee pair.\n -- `get_dcl_macro` will be either `get_grant_sql` or `get_revoke_sql`\n #}\n {%- set dcl_statements = [] -%}\n {%- for privilege, grantees in grant_config.items() %}\n {%- if support_multiple_grantees_per_dcl_statement() and grantees -%}\n {%- set dcl = get_dcl_macro(relation, privilege, grantees) -%}\n {%- do dcl_statements.append(dcl) -%}\n {%- else -%}\n {%- for grantee in grantees -%}\n {% set dcl = get_dcl_macro(relation, privilege, [grantee]) %}\n {%- do dcl_statements.append(dcl) -%}\n {% endfor -%}\n {%- endif -%}\n {%- endfor -%}\n {{ return(dcl_statements) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.support_multiple_grantees_per_dcl_statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "grant_config", "type": null, "description": ""}, {"name": "get_dcl_macro", "type": null, "description": ""}], "created_at": 1789422566.719024, "supported_languages": null}, "macro.dbt.call_dcl_statements": {"name": "call_dcl_statements", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "unique_id": "macro.dbt.call_dcl_statements", "macro_sql": "{% macro call_dcl_statements(dcl_statement_list) %}\n {{ return(adapter.dispatch(\"call_dcl_statements\", \"dbt\")(dcl_statement_list)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__call_dcl_statements"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "dcl_statement_list", "type": null, "description": ""}], "created_at": 1789422566.7194161, "supported_languages": null}, "macro.dbt.default__call_dcl_statements": {"name": "default__call_dcl_statements", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "unique_id": "macro.dbt.default__call_dcl_statements", "macro_sql": "{% macro default__call_dcl_statements(dcl_statement_list) %}\n {#\n -- By default, supply all grant + revoke statements in a single semicolon-separated block,\n -- so that they're all processed together.\n\n -- Some databases do not support this. Those adapters will need to override this macro\n -- to run each statement individually.\n #}\n {% call statement('grants') %}\n {% for dcl_statement in dcl_statement_list %}\n {{ dcl_statement }};\n {% endfor %}\n {% endcall %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "dcl_statement_list", "type": null, "description": ""}], "created_at": 1789422566.7199445, "supported_languages": null}, "macro.dbt.apply_grants": {"name": "apply_grants", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "unique_id": "macro.dbt.apply_grants", "macro_sql": "{% macro apply_grants(relation, grant_config, should_revoke) %}\n {{ return(adapter.dispatch(\"apply_grants\", \"dbt\")(relation, grant_config, should_revoke)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__apply_grants"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "grant_config", "type": null, "description": ""}, {"name": "should_revoke", "type": null, "description": ""}], "created_at": 1789422566.7204025, "supported_languages": null}, "macro.dbt.default__apply_grants": {"name": "default__apply_grants", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "unique_id": "macro.dbt.default__apply_grants", "macro_sql": "{% macro default__apply_grants(relation, grant_config, should_revoke=True) %}\n {#-- If grant_config is {} or None, this is a no-op --#}\n {% if grant_config %}\n {% if should_revoke %}\n {#-- We think previous grants may have carried over --#}\n {#-- Show current grants and calculate diffs --#}\n {% set current_grants_table = run_query(get_show_grant_sql(relation)) %}\n {% set current_grants_dict = adapter.standardize_grants_dict(current_grants_table) %}\n {% set needs_granting = diff_of_two_dicts(grant_config, current_grants_dict) %}\n {% set needs_revoking = diff_of_two_dicts(current_grants_dict, grant_config) %}\n {% if not (needs_granting or needs_revoking) %}\n {{ log('On ' ~ relation.render() ~': All grants are in place, no revocation or granting needed.')}}\n {% endif %}\n {% else %}\n {#-- We don't think there's any chance of previous grants having carried over. --#}\n {#-- Jump straight to granting what the user has configured. --#}\n {% set needs_revoking = {} %}\n {% set needs_granting = grant_config %}\n {% endif %}\n {% if needs_granting or needs_revoking %}\n {% set revoke_statement_list = get_dcl_statement_list(relation, needs_revoking, get_revoke_sql) %}\n {% set grant_statement_list = get_dcl_statement_list(relation, needs_granting, get_grant_sql) %}\n {% set dcl_statement_list = revoke_statement_list + grant_statement_list %}\n {% if dcl_statement_list %}\n {{ call_dcl_statements(dcl_statement_list) }}\n {% endif %}\n {% endif %}\n {% endif %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.run_query", "macro.dbt.get_show_grant_sql", "macro.dbt.get_dcl_statement_list", "macro.dbt.call_dcl_statements"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "grant_config", "type": null, "description": ""}, {"name": "should_revoke", "type": null, "description": ""}], "created_at": 1789422566.7228863, "supported_languages": null}, "macro.dbt.is_core_v2": {"name": "is_core_v2", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/runtime.sql", "original_file_path": "macros/adapters/runtime.sql", "unique_id": "macro.dbt.is_core_v2", "macro_sql": "{% macro is_core_v2() -%}\n {%- set major_version = (dbt_version.split('.') | first) | int -%}\n {{ return(major_version == 2) }}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789422566.7235444, "supported_languages": null}, "macro.dbt.alter_column_comment": {"name": "alter_column_comment", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/persist_docs.sql", "original_file_path": "macros/adapters/persist_docs.sql", "unique_id": "macro.dbt.alter_column_comment", "macro_sql": "{% macro alter_column_comment(relation, column_dict) -%}\n {{ return(adapter.dispatch('alter_column_comment', 'dbt')(relation, column_dict)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__alter_column_comment"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "column_dict", "type": null, "description": ""}], "created_at": 1789422566.7248378, "supported_languages": null}, "macro.dbt.default__alter_column_comment": {"name": "default__alter_column_comment", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/persist_docs.sql", "original_file_path": "macros/adapters/persist_docs.sql", "unique_id": "macro.dbt.default__alter_column_comment", "macro_sql": "{% macro default__alter_column_comment(relation, column_dict) -%}\n {{ exceptions.raise_not_implemented(\n 'alter_column_comment macro not implemented for adapter '+adapter.type()) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "column_dict", "type": null, "description": ""}], "created_at": 1789422566.7252047, "supported_languages": null}, "macro.dbt.alter_relation_comment": {"name": "alter_relation_comment", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/persist_docs.sql", "original_file_path": "macros/adapters/persist_docs.sql", "unique_id": "macro.dbt.alter_relation_comment", "macro_sql": "{% macro alter_relation_comment(relation, relation_comment) -%}\n {{ return(adapter.dispatch('alter_relation_comment', 'dbt')(relation, relation_comment)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__alter_relation_comment"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "relation_comment", "type": null, "description": ""}], "created_at": 1789422566.725646, "supported_languages": null}, "macro.dbt.default__alter_relation_comment": {"name": "default__alter_relation_comment", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/persist_docs.sql", "original_file_path": "macros/adapters/persist_docs.sql", "unique_id": "macro.dbt.default__alter_relation_comment", "macro_sql": "{% macro default__alter_relation_comment(relation, relation_comment) -%}\n {{ exceptions.raise_not_implemented(\n 'alter_relation_comment macro not implemented for adapter '+adapter.type()) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "relation_comment", "type": null, "description": ""}], "created_at": 1789422566.7259986, "supported_languages": null}, "macro.dbt.persist_docs": {"name": "persist_docs", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/persist_docs.sql", "original_file_path": "macros/adapters/persist_docs.sql", "unique_id": "macro.dbt.persist_docs", "macro_sql": "{% macro persist_docs(relation, model, for_relation=true, for_columns=true) -%}\n {{ return(adapter.dispatch('persist_docs', 'dbt')(relation, model, for_relation, for_columns)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__persist_docs"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "model", "type": null, "description": ""}, {"name": "for_relation", "type": null, "description": ""}, {"name": "for_columns", "type": null, "description": ""}], "created_at": 1789422566.7265499, "supported_languages": null}, "macro.dbt.validate_doc_columns": {"name": "validate_doc_columns", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/persist_docs.sql", "original_file_path": "macros/adapters/persist_docs.sql", "unique_id": "macro.dbt.validate_doc_columns", "macro_sql": "{% macro validate_doc_columns(relation, column_dict, existing_column_names) %}\n {% set existing_lower = existing_column_names | map(\"lower\") | list %}\n {% set missing = [] %}\n {% set filtered = {} %}\n {% for col_name in column_dict %}\n {% set is_quoted = column_dict[col_name]['quote'] %}\n {% if is_quoted %}\n {% set present = col_name in existing_column_names %}\n {% else %}\n {% set present = col_name | lower in existing_lower %}\n {% endif %}\n {% if present %}\n {% do filtered.update({col_name: column_dict[col_name]}) %}\n {% else %}\n {% do missing.append(col_name) %}\n {% endif %}\n {% endfor %}\n {% if missing | length > 0 %}\n {{ exceptions.warn(\"In relation \" ~ relation.render() ~ \": The following columns are specified in the schema but are not present in the database: \" ~ missing | join(\", \")) }}\n {% endif %}\n {{ return(filtered) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "column_dict", "type": null, "description": ""}, {"name": "existing_column_names", "type": null, "description": ""}], "created_at": 1789422566.7286646, "supported_languages": null}, "macro.dbt.default__persist_docs": {"name": "default__persist_docs", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/persist_docs.sql", "original_file_path": "macros/adapters/persist_docs.sql", "unique_id": "macro.dbt.default__persist_docs", "macro_sql": "{% macro default__persist_docs(relation, model, for_relation, for_columns) -%}\n {% if for_relation and config.persist_relation_docs() and model.description %}\n {% do run_query(alter_relation_comment(relation, model.description)) %}\n {% endif %}\n\n {% if for_columns and config.persist_column_docs() and model.columns %}\n {% set existing_columns = adapter.get_columns_in_relation(relation) | map(attribute=\"name\") | list %}\n {% set filtered_columns = validate_doc_columns(relation, model.columns, existing_columns) %}\n {% set alter_comment_sql = alter_column_comment(relation, filtered_columns) %}\n {% if alter_comment_sql and alter_comment_sql | trim | length > 0 %}\n {% do run_query(alter_comment_sql) %}\n {% endif %}\n {% endif %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.run_query", "macro.dbt.alter_relation_comment", "macro.dbt.validate_doc_columns", "macro.dbt.alter_column_comment"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "model", "type": null, "description": ""}, {"name": "for_relation", "type": null, "description": ""}, {"name": "for_columns", "type": null, "description": ""}], "created_at": 1789422566.7304385, "supported_languages": null}, "macro.dbt.get_columns_in_relation": {"name": "get_columns_in_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "unique_id": "macro.dbt.get_columns_in_relation", "macro_sql": "{% macro get_columns_in_relation(relation) -%}\n {{ return(adapter.dispatch('get_columns_in_relation', 'dbt')(relation)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__get_columns_in_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789422566.732719, "supported_languages": null}, "macro.dbt.default__get_columns_in_relation": {"name": "default__get_columns_in_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "unique_id": "macro.dbt.default__get_columns_in_relation", "macro_sql": "{% macro default__get_columns_in_relation(relation) -%}\n {{ exceptions.raise_not_implemented(\n 'get_columns_in_relation macro not implemented for adapter '+adapter.type()) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789422566.7330706, "supported_languages": null}, "macro.dbt.sql_convert_columns_in_relation": {"name": "sql_convert_columns_in_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "unique_id": "macro.dbt.sql_convert_columns_in_relation", "macro_sql": "{% macro sql_convert_columns_in_relation(table) -%}\n {% set columns = [] %}\n {% for row in table %}\n {% do columns.append(api.Column(*row)) %}\n {% endfor %}\n {{ return(columns) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "table", "type": null, "description": ""}], "created_at": 1789422566.7337415, "supported_languages": null}, "macro.dbt.get_list_of_column_names": {"name": "get_list_of_column_names", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "unique_id": "macro.dbt.get_list_of_column_names", "macro_sql": "\n\n{%- macro get_list_of_column_names(columns) -%}\n {% set col_names = [] %}\n {% for col in columns %}\n {% do col_names.append(col.name) %}\n {% endfor %}\n {{ return(col_names) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "columns", "type": null, "description": ""}], "created_at": 1789422566.73433, "supported_languages": null}, "macro.dbt.get_empty_subquery_sql": {"name": "get_empty_subquery_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "unique_id": "macro.dbt.get_empty_subquery_sql", "macro_sql": "{% macro get_empty_subquery_sql(select_sql, select_sql_header=none) -%}\n {{ return(adapter.dispatch('get_empty_subquery_sql', 'dbt')(select_sql, select_sql_header)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_empty_subquery_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "select_sql", "type": null, "description": ""}, {"name": "select_sql_header", "type": null, "description": ""}], "created_at": 1789422566.7347944, "supported_languages": null}, "macro.dbt.default__get_empty_subquery_sql": {"name": "default__get_empty_subquery_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "unique_id": "macro.dbt.default__get_empty_subquery_sql", "macro_sql": "{% macro default__get_empty_subquery_sql(select_sql, select_sql_header=none) %}\n {%- if select_sql_header is not none -%}\n {{ select_sql_header }}\n {%- endif -%}\n select * from (\n {{ select_sql }}\n ) as __dbt_sbq\n where false\n limit 0\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "select_sql", "type": null, "description": ""}, {"name": "select_sql_header", "type": null, "description": ""}], "created_at": 1789422566.735231, "supported_languages": null}, "macro.dbt.get_empty_schema_sql": {"name": "get_empty_schema_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "unique_id": "macro.dbt.get_empty_schema_sql", "macro_sql": "{% macro get_empty_schema_sql(columns) -%}\n {{ return(adapter.dispatch('get_empty_schema_sql', 'dbt')(columns)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_empty_schema_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "columns", "type": null, "description": ""}], "created_at": 1789422566.735625, "supported_languages": null}, "macro.dbt.default__get_empty_schema_sql": {"name": "default__get_empty_schema_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "unique_id": "macro.dbt.default__get_empty_schema_sql", "macro_sql": "{% macro default__get_empty_schema_sql(columns) %}\n {%- set col_err = [] -%}\n {%- set col_naked_numeric = [] -%}\n select\n {% for i in columns %}\n {%- set col = columns[i] -%}\n {%- if col['data_type'] is not defined -%}\n {%- do col_err.append(col['name']) -%}\n {#-- If this column's type is just 'numeric' then it is missing precision/scale, raise a warning --#}\n {%- elif col['data_type'].strip().lower() in ('numeric', 'decimal', 'number') -%}\n {%- do col_naked_numeric.append(col['name']) -%}\n {%- endif -%}\n {% set col_name = adapter.quote(col['name']) if col.get('quote') else col['name'] %}\n {{ cast('null', col['data_type']) }} as {{ col_name }}{{ \", \" if not loop.last }}\n {%- endfor -%}\n {%- if (col_err | length) > 0 -%}\n {{ exceptions.column_type_missing(column_names=col_err) }}\n {%- elif (col_naked_numeric | length) > 0 -%}\n {{ exceptions.warn(\"Detected columns with numeric type and unspecified precision/scale, this can lead to unintended rounding: \" ~ col_naked_numeric ~ \"`\") }}\n {%- endif -%}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.cast"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "columns", "type": null, "description": ""}], "created_at": 1789422566.737975, "supported_languages": null}, "macro.dbt.get_column_schema_from_query": {"name": "get_column_schema_from_query", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "unique_id": "macro.dbt.get_column_schema_from_query", "macro_sql": "{% macro get_column_schema_from_query(select_sql, select_sql_header=none) -%}\n {% set columns = [] %}\n {# -- Using an 'empty subquery' here to get the same schema as the given select_sql statement, without necessitating a data scan.#}\n {% set sql = get_empty_subquery_sql(select_sql, select_sql_header) %}\n {% set column_schema = adapter.get_column_schema_from_query(sql) %}\n {{ return(column_schema) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_empty_subquery_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "select_sql", "type": null, "description": ""}, {"name": "select_sql_header", "type": null, "description": ""}], "created_at": 1789422566.7386892, "supported_languages": null}, "macro.dbt.get_columns_in_query": {"name": "get_columns_in_query", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "unique_id": "macro.dbt.get_columns_in_query", "macro_sql": "{% macro get_columns_in_query(select_sql) -%}\n {{ return(adapter.dispatch('get_columns_in_query', 'dbt')(select_sql)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_columns_in_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "select_sql", "type": null, "description": ""}], "created_at": 1789422566.7390711, "supported_languages": null}, "macro.dbt.default__get_columns_in_query": {"name": "default__get_columns_in_query", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "unique_id": "macro.dbt.default__get_columns_in_query", "macro_sql": "{% macro default__get_columns_in_query(select_sql) %}\n {% call statement('get_columns_in_query', fetch_result=True, auto_begin=False) -%}\n {{ get_empty_subquery_sql(select_sql) }}\n {% endcall %}\n {{ return(load_result('get_columns_in_query').table.columns | map(attribute='name') | list) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement", "macro.dbt.get_empty_subquery_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "select_sql", "type": null, "description": ""}], "created_at": 1789422566.7398105, "supported_languages": null}, "macro.dbt.alter_column_type": {"name": "alter_column_type", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "unique_id": "macro.dbt.alter_column_type", "macro_sql": "{% macro alter_column_type(relation, column_name, new_column_type) -%}\n {{ return(adapter.dispatch('alter_column_type', 'dbt')(relation, column_name, new_column_type)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__alter_column_type"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "column_name", "type": null, "description": ""}, {"name": "new_column_type", "type": null, "description": ""}], "created_at": 1789422566.7402956, "supported_languages": null}, "macro.dbt.default__alter_column_type": {"name": "default__alter_column_type", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "unique_id": "macro.dbt.default__alter_column_type", "macro_sql": "{% macro default__alter_column_type(relation, column_name, new_column_type) -%}\n {#\n 1. Create a new column (w/ temp name and correct type)\n 2. Copy data over to it\n 3. Drop the existing column (cascade!)\n 4. Rename the new column to existing column\n #}\n {%- set tmp_column = column_name + \"__dbt_alter\" -%}\n\n {% call statement('alter_column_type') %}\n alter table {{ relation.render() }} add column {{ adapter.quote(tmp_column) }} {{ new_column_type }};\n update {{ relation.render() }} set {{ adapter.quote(tmp_column) }} = {{ adapter.quote(column_name) }};\n alter table {{ relation.render() }} drop column {{ adapter.quote(column_name) }} cascade;\n alter table {{ relation.render() }} rename column {{ adapter.quote(tmp_column) }} to {{ adapter.quote(column_name) }}\n {% endcall %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "column_name", "type": null, "description": ""}, {"name": "new_column_type", "type": null, "description": ""}], "created_at": 1789422566.74181, "supported_languages": null}, "macro.dbt.alter_relation_add_remove_columns": {"name": "alter_relation_add_remove_columns", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "unique_id": "macro.dbt.alter_relation_add_remove_columns", "macro_sql": "{% macro alter_relation_add_remove_columns(relation, add_columns = none, remove_columns = none) -%}\n {{ return(adapter.dispatch('alter_relation_add_remove_columns', 'dbt')(relation, add_columns, remove_columns)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__alter_relation_add_remove_columns"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "add_columns", "type": null, "description": ""}, {"name": "remove_columns", "type": null, "description": ""}], "created_at": 1789422566.7423255, "supported_languages": null}, "macro.dbt.default__alter_relation_add_remove_columns": {"name": "default__alter_relation_add_remove_columns", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "unique_id": "macro.dbt.default__alter_relation_add_remove_columns", "macro_sql": "{% macro default__alter_relation_add_remove_columns(relation, add_columns, remove_columns) %}\n\n {% if add_columns is none %}\n {% set add_columns = [] %}\n {% endif %}\n {% if remove_columns is none %}\n {% set remove_columns = [] %}\n {% endif %}\n\n {% set sql -%}\n\n alter {{ relation.type }} {{ relation.render() }}\n\n {% for column in add_columns %}\n add column {{ column.quoted }} {{ column.expanded_data_type }}{{ ',' if not loop.last }}\n {% endfor %}{{ ',' if add_columns and remove_columns }}\n\n {% for column in remove_columns %}\n drop column {{ column.quoted }}{{ ',' if not loop.last }}\n {% endfor %}\n\n {%- endset -%}\n\n {% do run_query(sql) %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "add_columns", "type": null, "description": ""}, {"name": "remove_columns", "type": null, "description": ""}], "created_at": 1789422566.7439692, "supported_languages": null}, "macro.dbt.get_create_index_sql": {"name": "get_create_index_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/indexes.sql", "original_file_path": "macros/adapters/indexes.sql", "unique_id": "macro.dbt.get_create_index_sql", "macro_sql": "{% macro get_create_index_sql(relation, index_dict) -%}\n {{ return(adapter.dispatch('get_create_index_sql', 'dbt')(relation, index_dict)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__get_create_index_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "index_dict", "type": null, "description": ""}], "created_at": 1789422566.7449834, "supported_languages": null}, "macro.dbt.default__get_create_index_sql": {"name": "default__get_create_index_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/indexes.sql", "original_file_path": "macros/adapters/indexes.sql", "unique_id": "macro.dbt.default__get_create_index_sql", "macro_sql": "{% macro default__get_create_index_sql(relation, index_dict) -%}\n {% do return(None) %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "index_dict", "type": null, "description": ""}], "created_at": 1789422566.7452774, "supported_languages": null}, "macro.dbt.create_indexes": {"name": "create_indexes", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/indexes.sql", "original_file_path": "macros/adapters/indexes.sql", "unique_id": "macro.dbt.create_indexes", "macro_sql": "{% macro create_indexes(relation) -%}\n {{ adapter.dispatch('create_indexes', 'dbt')(relation) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__create_indexes"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789422566.7456298, "supported_languages": null}, "macro.dbt.default__create_indexes": {"name": "default__create_indexes", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/indexes.sql", "original_file_path": "macros/adapters/indexes.sql", "unique_id": "macro.dbt.default__create_indexes", "macro_sql": "{% macro default__create_indexes(relation) -%}\n {%- set _indexes = config.get('indexes', default=[]) -%}\n\n {% for _index_dict in _indexes %}\n {% set create_index_sql = get_create_index_sql(relation, _index_dict) %}\n {% if create_index_sql %}\n {% do run_query(create_index_sql) %}\n {% endif %}\n {% endfor %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_create_index_sql", "macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789422566.7464464, "supported_languages": null}, "macro.dbt.get_drop_index_sql": {"name": "get_drop_index_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/indexes.sql", "original_file_path": "macros/adapters/indexes.sql", "unique_id": "macro.dbt.get_drop_index_sql", "macro_sql": "{% macro get_drop_index_sql(relation, index_name) -%}\n {{ adapter.dispatch('get_drop_index_sql', 'dbt')(relation, index_name) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__get_drop_index_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "index_name", "type": null, "description": ""}], "created_at": 1789422566.7468884, "supported_languages": null}, "macro.dbt.default__get_drop_index_sql": {"name": "default__get_drop_index_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/indexes.sql", "original_file_path": "macros/adapters/indexes.sql", "unique_id": "macro.dbt.default__get_drop_index_sql", "macro_sql": "{% macro default__get_drop_index_sql(relation, index_name) -%}\n {{ exceptions.raise_compiler_error(\"`get_drop_index_sql has not been implemented for this adapter.\") }}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "index_name", "type": null, "description": ""}], "created_at": 1789422566.7472048, "supported_languages": null}, "macro.dbt.get_show_indexes_sql": {"name": "get_show_indexes_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/indexes.sql", "original_file_path": "macros/adapters/indexes.sql", "unique_id": "macro.dbt.get_show_indexes_sql", "macro_sql": "{% macro get_show_indexes_sql(relation) -%}\n {{ adapter.dispatch('get_show_indexes_sql', 'dbt')(relation) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__get_show_indexes_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789422566.747565, "supported_languages": null}, "macro.dbt.default__get_show_indexes_sql": {"name": "default__get_show_indexes_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/indexes.sql", "original_file_path": "macros/adapters/indexes.sql", "unique_id": "macro.dbt.default__get_show_indexes_sql", "macro_sql": "{% macro default__get_show_indexes_sql(relation) -%}\n {{ exceptions.raise_compiler_error(\"`get_show_indexes_sql has not been implemented for this adapter.\") }}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789422566.7478402, "supported_languages": null}, "macro.dbt.get_catalog_relations": {"name": "get_catalog_relations", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "unique_id": "macro.dbt.get_catalog_relations", "macro_sql": "{% macro get_catalog_relations(information_schema, relations) -%}\n {{ return(adapter.dispatch('get_catalog_relations', 'dbt')(information_schema, relations)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__get_catalog_relations"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "information_schema", "type": null, "description": ""}, {"name": "relations", "type": null, "description": ""}], "created_at": 1789422566.749547, "supported_languages": null}, "macro.dbt.default__get_catalog_relations": {"name": "default__get_catalog_relations", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "unique_id": "macro.dbt.default__get_catalog_relations", "macro_sql": "{% macro default__get_catalog_relations(information_schema, relations) -%}\n {% set typename = adapter.type() %}\n {% set msg -%}\n get_catalog_relations not implemented for {{ typename }}\n {%- endset %}\n\n {{ exceptions.raise_compiler_error(msg) }}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "information_schema", "type": null, "description": ""}, {"name": "relations", "type": null, "description": ""}], "created_at": 1789422566.7500935, "supported_languages": null}, "macro.dbt.get_catalog": {"name": "get_catalog", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "unique_id": "macro.dbt.get_catalog", "macro_sql": "{% macro get_catalog(information_schema, schemas) -%}\n {{ return(adapter.dispatch('get_catalog', 'dbt')(information_schema, schemas)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__get_catalog"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "information_schema", "type": null, "description": ""}, {"name": "schemas", "type": null, "description": ""}], "created_at": 1789422566.7505064, "supported_languages": null}, "macro.dbt.default__get_catalog": {"name": "default__get_catalog", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "unique_id": "macro.dbt.default__get_catalog", "macro_sql": "{% macro default__get_catalog(information_schema, schemas) -%}\n\n {% set typename = adapter.type() %}\n {% set msg -%}\n get_catalog not implemented for {{ typename }}\n {%- endset %}\n\n {{ exceptions.raise_compiler_error(msg) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "information_schema", "type": null, "description": ""}, {"name": "schemas", "type": null, "description": ""}], "created_at": 1789422566.7510574, "supported_languages": null}, "macro.dbt.information_schema_name": {"name": "information_schema_name", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "unique_id": "macro.dbt.information_schema_name", "macro_sql": "{% macro information_schema_name(database) %}\n {{ return(adapter.dispatch('information_schema_name', 'dbt')(database)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__information_schema_name"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "database", "type": null, "description": ""}], "created_at": 1789422566.7514288, "supported_languages": null}, "macro.dbt.default__information_schema_name": {"name": "default__information_schema_name", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "unique_id": "macro.dbt.default__information_schema_name", "macro_sql": "{% macro default__information_schema_name(database) -%}\n {%- if database -%}\n {{ database }}.INFORMATION_SCHEMA\n {%- else -%}\n INFORMATION_SCHEMA\n {%- endif -%}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "database", "type": null, "description": ""}], "created_at": 1789422566.751916, "supported_languages": null}, "macro.dbt.list_schemas": {"name": "list_schemas", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "unique_id": "macro.dbt.list_schemas", "macro_sql": "{% macro list_schemas(database) -%}\n {{ return(adapter.dispatch('list_schemas', 'dbt')(database)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__list_schemas"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "database", "type": null, "description": ""}], "created_at": 1789422566.7522855, "supported_languages": null}, "macro.dbt.default__list_schemas": {"name": "default__list_schemas", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "unique_id": "macro.dbt.default__list_schemas", "macro_sql": "{% macro default__list_schemas(database) -%}\n {% set sql %}\n select distinct schema_name\n from {{ information_schema_name(database) }}.SCHEMATA\n where catalog_name ilike '{{ database }}'\n {% endset %}\n {{ return(run_query(sql)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.information_schema_name", "macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "database", "type": null, "description": ""}], "created_at": 1789422566.7528024, "supported_languages": null}, "macro.dbt.check_schema_exists": {"name": "check_schema_exists", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "unique_id": "macro.dbt.check_schema_exists", "macro_sql": "{% macro check_schema_exists(information_schema, schema) -%}\n {{ return(adapter.dispatch('check_schema_exists', 'dbt')(information_schema, schema)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__check_schema_exists"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "information_schema", "type": null, "description": ""}, {"name": "schema", "type": null, "description": ""}], "created_at": 1789422566.7532167, "supported_languages": null}, "macro.dbt.default__check_schema_exists": {"name": "default__check_schema_exists", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "unique_id": "macro.dbt.default__check_schema_exists", "macro_sql": "{% macro default__check_schema_exists(information_schema, schema) -%}\n {% set sql -%}\n select count(*)\n from {{ information_schema.replace(information_schema_view='SCHEMATA') }}\n where catalog_name='{{ information_schema.database }}'\n and schema_name='{{ schema }}'\n {%- endset %}\n {{ return(run_query(sql)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.replace", "macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "information_schema", "type": null, "description": ""}, {"name": "schema", "type": null, "description": ""}], "created_at": 1789422566.7538514, "supported_languages": null}, "macro.dbt.list_relations_without_caching": {"name": "list_relations_without_caching", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "unique_id": "macro.dbt.list_relations_without_caching", "macro_sql": "{% macro list_relations_without_caching(schema_relation) %}\n {{ return(adapter.dispatch('list_relations_without_caching', 'dbt')(schema_relation)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__list_relations_without_caching"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "schema_relation", "type": null, "description": ""}], "created_at": 1789422566.7542272, "supported_languages": null}, "macro.dbt.default__list_relations_without_caching": {"name": "default__list_relations_without_caching", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "unique_id": "macro.dbt.default__list_relations_without_caching", "macro_sql": "{% macro default__list_relations_without_caching(schema_relation) %}\n {{ exceptions.raise_not_implemented(\n 'list_relations_without_caching macro not implemented for adapter '+adapter.type()) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "schema_relation", "type": null, "description": ""}], "created_at": 1789422566.7545776, "supported_languages": null}, "macro.dbt.list_function_relations_without_caching": {"name": "list_function_relations_without_caching", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "unique_id": "macro.dbt.list_function_relations_without_caching", "macro_sql": "{% macro list_function_relations_without_caching(schema_relation) %}\n {{ return(adapter.dispatch('list_function_relations_without_caching', 'dbt')(schema_relation)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__list_function_relations_without_caching"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "schema_relation", "type": null, "description": ""}], "created_at": 1789422566.7549646, "supported_languages": null}, "macro.dbt.default__list_function_relations_without_caching": {"name": "default__list_function_relations_without_caching", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "unique_id": "macro.dbt.default__list_function_relations_without_caching", "macro_sql": "{% macro default__list_function_relations_without_caching(schema_relation) %}\n {{ exceptions.raise_not_implemented(\n 'list_function_relations_without_caching macro not implemented for adapter '+adapter.type()) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "schema_relation", "type": null, "description": ""}], "created_at": 1789422566.7552981, "supported_languages": null}, "macro.dbt.get_catalog_for_single_relation": {"name": "get_catalog_for_single_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "unique_id": "macro.dbt.get_catalog_for_single_relation", "macro_sql": "{% macro get_catalog_for_single_relation(relation) %}\n {{ return(adapter.dispatch('get_catalog_for_single_relation', 'dbt')(relation)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_catalog_for_single_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789422566.7556884, "supported_languages": null}, "macro.dbt.default__get_catalog_for_single_relation": {"name": "default__get_catalog_for_single_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "unique_id": "macro.dbt.default__get_catalog_for_single_relation", "macro_sql": "{% macro default__get_catalog_for_single_relation(relation) %}\n {{ exceptions.raise_not_implemented(\n 'get_catalog_for_single_relation macro not implemented for adapter '+adapter.type()) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789422566.756015, "supported_languages": null}, "macro.dbt.get_relations": {"name": "get_relations", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "unique_id": "macro.dbt.get_relations", "macro_sql": "{% macro get_relations() %}\n {{ return(adapter.dispatch('get_relations', 'dbt')()) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__get_relations"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789422566.7563472, "supported_languages": null}, "macro.dbt.default__get_relations": {"name": "default__get_relations", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "unique_id": "macro.dbt.default__get_relations", "macro_sql": "{% macro default__get_relations() %}\n {{ exceptions.raise_not_implemented(\n 'get_relations macro not implemented for adapter '+adapter.type()) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789422566.7566772, "supported_languages": null}, "macro.dbt.get_relation_last_modified": {"name": "get_relation_last_modified", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "unique_id": "macro.dbt.get_relation_last_modified", "macro_sql": "{% macro get_relation_last_modified(information_schema, relations) %}\n {{ return(adapter.dispatch('get_relation_last_modified', 'dbt')(information_schema, relations)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_relation_last_modified"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "information_schema", "type": null, "description": ""}, {"name": "relations", "type": null, "description": ""}], "created_at": 1789422566.7570934, "supported_languages": null}, "macro.dbt.default__get_relation_last_modified": {"name": "default__get_relation_last_modified", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "unique_id": "macro.dbt.default__get_relation_last_modified", "macro_sql": "{% macro default__get_relation_last_modified(information_schema, relations) %}\n {{ exceptions.raise_not_implemented(\n 'get_relation_last_modified macro not implemented for adapter ' + adapter.type()) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "information_schema", "type": null, "description": ""}, {"name": "relations", "type": null, "description": ""}], "created_at": 1789422566.7574434, "supported_languages": null}, "macro.dbt.validate_sql": {"name": "validate_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/validate_sql.sql", "original_file_path": "macros/adapters/validate_sql.sql", "unique_id": "macro.dbt.validate_sql", "macro_sql": "{% macro validate_sql(sql) -%}\n {{ return(adapter.dispatch('validate_sql', 'dbt')(sql)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__validate_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "sql", "type": null, "description": ""}], "created_at": 1789422566.7580557, "supported_languages": null}, "macro.dbt.default__validate_sql": {"name": "default__validate_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/validate_sql.sql", "original_file_path": "macros/adapters/validate_sql.sql", "unique_id": "macro.dbt.default__validate_sql", "macro_sql": "{% macro default__validate_sql(sql) -%}\n {% call statement('validate_sql') -%}\n explain {{ sql }}\n {% endcall %}\n {{ return(load_result('validate_sql')) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "sql", "type": null, "description": ""}], "created_at": 1789422566.7586913, "supported_languages": null}, "macro.dbt.collect_freshness": {"name": "collect_freshness", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/freshness.sql", "original_file_path": "macros/adapters/freshness.sql", "unique_id": "macro.dbt.collect_freshness", "macro_sql": "{% macro collect_freshness(source, loaded_at_field, filter) %}\n {{ return(adapter.dispatch('collect_freshness', 'dbt')(source, loaded_at_field, filter))}}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__collect_freshness"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "source", "type": null, "description": ""}, {"name": "loaded_at_field", "type": null, "description": ""}, {"name": "filter", "type": null, "description": ""}], "created_at": 1789422566.7596006, "supported_languages": null}, "macro.dbt.default__collect_freshness": {"name": "default__collect_freshness", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/freshness.sql", "original_file_path": "macros/adapters/freshness.sql", "unique_id": "macro.dbt.default__collect_freshness", "macro_sql": "{% macro default__collect_freshness(source, loaded_at_field, filter) %}\n {% call statement('collect_freshness', fetch_result=True, auto_begin=False) -%}\n select\n max({{ loaded_at_field }}) as max_loaded_at,\n {{ current_timestamp() }} as snapshotted_at\n from {{ source }}\n {% if filter %}\n where {{ filter }}\n {% endif %}\n {% endcall %}\n {{ return(load_result('collect_freshness')) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement", "macro.dbt.current_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "source", "type": null, "description": ""}, {"name": "loaded_at_field", "type": null, "description": ""}, {"name": "filter", "type": null, "description": ""}], "created_at": 1789422566.760444, "supported_languages": null}, "macro.dbt.collect_freshness_custom_sql": {"name": "collect_freshness_custom_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/freshness.sql", "original_file_path": "macros/adapters/freshness.sql", "unique_id": "macro.dbt.collect_freshness_custom_sql", "macro_sql": "{% macro collect_freshness_custom_sql(source, loaded_at_query) %}\n {{ return(adapter.dispatch('collect_freshness_custom_sql', 'dbt')(source, loaded_at_query))}}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__collect_freshness_custom_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "source", "type": null, "description": ""}, {"name": "loaded_at_query", "type": null, "description": ""}], "created_at": 1789422566.7608943, "supported_languages": null}, "macro.dbt.default__collect_freshness_custom_sql": {"name": "default__collect_freshness_custom_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/freshness.sql", "original_file_path": "macros/adapters/freshness.sql", "unique_id": "macro.dbt.default__collect_freshness_custom_sql", "macro_sql": "{% macro default__collect_freshness_custom_sql(source, loaded_at_query) %}\n {% call statement('collect_freshness_custom_sql', fetch_result=True, auto_begin=False) -%}\n with source_query as (\n {{ loaded_at_query }}\n )\n select\n (select * from source_query) as max_loaded_at,\n {{ current_timestamp() }} as snapshotted_at\n {% endcall %}\n {{ return(load_result('collect_freshness_custom_sql')) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement", "macro.dbt.current_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "source", "type": null, "description": ""}, {"name": "loaded_at_query", "type": null, "description": ""}], "created_at": 1789422566.7615488, "supported_languages": null}, "macro.dbt.make_intermediate_relation": {"name": "make_intermediate_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "unique_id": "macro.dbt.make_intermediate_relation", "macro_sql": "{% macro make_intermediate_relation(base_relation, suffix='__dbt_tmp') %}\n {{ return(adapter.dispatch('make_intermediate_relation', 'dbt')(base_relation, suffix)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__make_intermediate_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "base_relation", "type": null, "description": ""}, {"name": "suffix", "type": null, "description": ""}], "created_at": 1789422566.7629483, "supported_languages": null}, "macro.dbt.default__make_intermediate_relation": {"name": "default__make_intermediate_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "unique_id": "macro.dbt.default__make_intermediate_relation", "macro_sql": "{% macro default__make_intermediate_relation(base_relation, suffix) %}\n {{ return(default__make_temp_relation(base_relation, suffix)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__make_temp_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "base_relation", "type": null, "description": ""}, {"name": "suffix", "type": null, "description": ""}], "created_at": 1789422566.7633042, "supported_languages": null}, "macro.dbt.make_temp_relation": {"name": "make_temp_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "unique_id": "macro.dbt.make_temp_relation", "macro_sql": "{% macro make_temp_relation(base_relation, suffix='__dbt_tmp') %}\n {#-- This ensures microbatch batches get unique temp relations to avoid clobbering --#}\n {% if suffix == '__dbt_tmp' and model.batch %}\n {% set suffix = suffix ~ '_' ~ model.batch.id %}\n {% endif %}\n\n {{ return(adapter.dispatch('make_temp_relation', 'dbt')(base_relation, suffix)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__make_temp_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "base_relation", "type": null, "description": ""}, {"name": "suffix", "type": null, "description": ""}], "created_at": 1789422566.7641368, "supported_languages": null}, "macro.dbt.default__make_temp_relation": {"name": "default__make_temp_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "unique_id": "macro.dbt.default__make_temp_relation", "macro_sql": "{% macro default__make_temp_relation(base_relation, suffix) %}\n {%- set temp_identifier = base_relation.identifier ~ suffix -%}\n {%- set temp_relation = base_relation.incorporate(\n path={\"identifier\": temp_identifier}) -%}\n\n {{ return(temp_relation) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "base_relation", "type": null, "description": ""}, {"name": "suffix", "type": null, "description": ""}], "created_at": 1789422566.7647634, "supported_languages": null}, "macro.dbt.make_backup_relation": {"name": "make_backup_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "unique_id": "macro.dbt.make_backup_relation", "macro_sql": "{% macro make_backup_relation(base_relation, backup_relation_type, suffix='__dbt_backup') %}\n {{ return(adapter.dispatch('make_backup_relation', 'dbt')(base_relation, backup_relation_type, suffix)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__make_backup_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "base_relation", "type": null, "description": ""}, {"name": "backup_relation_type", "type": null, "description": ""}, {"name": "suffix", "type": null, "description": ""}], "created_at": 1789422566.7652571, "supported_languages": null}, "macro.dbt.default__make_backup_relation": {"name": "default__make_backup_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "unique_id": "macro.dbt.default__make_backup_relation", "macro_sql": "{% macro default__make_backup_relation(base_relation, backup_relation_type, suffix) %}\n {%- set backup_identifier = base_relation.identifier ~ suffix -%}\n {%- set backup_relation = base_relation.incorporate(\n path={\"identifier\": backup_identifier},\n type=backup_relation_type\n ) -%}\n {{ return(backup_relation) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "base_relation", "type": null, "description": ""}, {"name": "backup_relation_type", "type": null, "description": ""}, {"name": "suffix", "type": null, "description": ""}], "created_at": 1789422566.7659912, "supported_languages": null}, "macro.dbt.truncate_relation": {"name": "truncate_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "unique_id": "macro.dbt.truncate_relation", "macro_sql": "{% macro truncate_relation(relation) -%}\n {{ return(adapter.dispatch('truncate_relation', 'dbt')(relation)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__truncate_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789422566.7664187, "supported_languages": null}, "macro.dbt.default__truncate_relation": {"name": "default__truncate_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "unique_id": "macro.dbt.default__truncate_relation", "macro_sql": "{% macro default__truncate_relation(relation) -%}\n {% call statement('truncate_relation') -%}\n truncate table {{ relation.render() }}\n {%- endcall %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789422566.7668948, "supported_languages": null}, "macro.dbt.get_or_create_relation": {"name": "get_or_create_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "unique_id": "macro.dbt.get_or_create_relation", "macro_sql": "{% macro get_or_create_relation(database, schema, identifier, type) -%}\n {{ return(adapter.dispatch('get_or_create_relation', 'dbt')(database, schema, identifier, type)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_or_create_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "database", "type": null, "description": ""}, {"name": "schema", "type": null, "description": ""}, {"name": "identifier", "type": null, "description": ""}, {"name": "type", "type": null, "description": ""}], "created_at": 1789422566.7674046, "supported_languages": null}, "macro.dbt.default__get_or_create_relation": {"name": "default__get_or_create_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "unique_id": "macro.dbt.default__get_or_create_relation", "macro_sql": "{% macro default__get_or_create_relation(database, schema, identifier, type) %}\n {%- set target_relation = adapter.get_relation(database=database, schema=schema, identifier=identifier) %}\n\n {% if target_relation %}\n {% do return([true, target_relation]) %}\n {% endif %}\n\n {%- set new_relation = api.Relation.create(\n database=database,\n schema=schema,\n identifier=identifier,\n type=type\n ) -%}\n {% do return([false, new_relation]) %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "database", "type": null, "description": ""}, {"name": "schema", "type": null, "description": ""}, {"name": "identifier", "type": null, "description": ""}, {"name": "type", "type": null, "description": ""}], "created_at": 1789422566.768728, "supported_languages": null}, "macro.dbt.load_cached_relation": {"name": "load_cached_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "unique_id": "macro.dbt.load_cached_relation", "macro_sql": "{% macro load_cached_relation(relation) %}\n {% do return(adapter.get_relation(\n database=relation.database,\n schema=relation.schema,\n identifier=relation.identifier\n )) -%}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789422566.7691922, "supported_languages": null}, "macro.dbt.load_relation": {"name": "load_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "unique_id": "macro.dbt.load_relation", "macro_sql": "{% macro load_relation(relation) %}\n {{ return(load_cached_relation(relation)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.load_cached_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789422566.7694907, "supported_languages": null}, "macro.dbt.test_unique": {"name": "test_unique", "resource_type": "macro", "package_name": "dbt", "path": "tests/generic/builtin.sql", "original_file_path": "tests/generic/builtin.sql", "unique_id": "macro.dbt.test_unique", "macro_sql": "{% test unique(model, column_name) %}\n {% set macro = adapter.dispatch('test_unique', 'dbt') %}\n {{ macro(model, column_name) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt.default__test_unique"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789422566.7703934, "supported_languages": null}, "macro.dbt.test_not_null": {"name": "test_not_null", "resource_type": "macro", "package_name": "dbt", "path": "tests/generic/builtin.sql", "original_file_path": "tests/generic/builtin.sql", "unique_id": "macro.dbt.test_not_null", "macro_sql": "{% test not_null(model, column_name) %}\n {% set macro = adapter.dispatch('test_not_null', 'dbt') %}\n {{ macro(model, column_name) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt.default__test_not_null"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789422566.770916, "supported_languages": null}, "macro.dbt.test_accepted_values": {"name": "test_accepted_values", "resource_type": "macro", "package_name": "dbt", "path": "tests/generic/builtin.sql", "original_file_path": "tests/generic/builtin.sql", "unique_id": "macro.dbt.test_accepted_values", "macro_sql": "{% test accepted_values(model, column_name, values, quote=True) %}\n {% set macro = adapter.dispatch('test_accepted_values', 'dbt') %}\n {{ macro(model, column_name, values, quote) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt.default__test_accepted_values"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789422566.7715425, "supported_languages": null}, "macro.dbt.test_relationships": {"name": "test_relationships", "resource_type": "macro", "package_name": "dbt", "path": "tests/generic/builtin.sql", "original_file_path": "tests/generic/builtin.sql", "unique_id": "macro.dbt.test_relationships", "macro_sql": "{% test relationships(model, column_name, to, field) %}\n {% set macro = adapter.dispatch('test_relationships', 'dbt') %}\n {{ macro(model, column_name, to, field) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt.default__test_relationships"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789422566.772132, "supported_languages": null}, "macro.dbt_utils.slugify": {"name": "slugify", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/jinja_helpers/slugify.sql", "original_file_path": "macros/jinja_helpers/slugify.sql", "unique_id": "macro.dbt_utils.slugify", "macro_sql": "{% macro slugify(string) %}\n\n{% if not string %}\n{{ return('') }}\n{% endif %}\n\n{#- Lower case the string -#}\n{% set string = string | lower %}\n{#- Replace spaces and dashes with underscores -#}\n{% set string = modules.re.sub('[ -]+', '_', string) %}\n{#- Only take letters, numbers, and underscores -#}\n{% set string = modules.re.sub('[^a-z0-9_]+', '', string) %}\n{#- Prepends \"_\" if string begins with a number -#}\n{% set string = modules.re.sub('^[0-9]', '_' + string[0], string) %}\n\n{{ return(string) }}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "string", "type": null, "description": ""}], "created_at": 1789422566.7736318, "supported_languages": null}, "macro.dbt_utils.log_info": {"name": "log_info", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/jinja_helpers/log_info.sql", "original_file_path": "macros/jinja_helpers/log_info.sql", "unique_id": "macro.dbt_utils.log_info", "macro_sql": "{% macro log_info(message) %}\n {{ return(adapter.dispatch('log_info', 'dbt_utils')(message)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__log_info"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "message", "type": null, "description": ""}], "created_at": 1789422566.7741477, "supported_languages": null}, "macro.dbt_utils.default__log_info": {"name": "default__log_info", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/jinja_helpers/log_info.sql", "original_file_path": "macros/jinja_helpers/log_info.sql", "unique_id": "macro.dbt_utils.default__log_info", "macro_sql": "{% macro default__log_info(message) %}\n {{ log(dbt_utils.pretty_log_format(message), info=True) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.pretty_log_format"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "message", "type": null, "description": ""}], "created_at": 1789422566.7744966, "supported_languages": null}, "macro.dbt_utils.pretty_log_format": {"name": "pretty_log_format", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/jinja_helpers/pretty_log_format.sql", "original_file_path": "macros/jinja_helpers/pretty_log_format.sql", "unique_id": "macro.dbt_utils.pretty_log_format", "macro_sql": "{% macro pretty_log_format(message) %}\n {{ return(adapter.dispatch('pretty_log_format', 'dbt_utils')(message)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__pretty_log_format"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "message", "type": null, "description": ""}], "created_at": 1789422566.7750258, "supported_languages": null}, "macro.dbt_utils.default__pretty_log_format": {"name": "default__pretty_log_format", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/jinja_helpers/pretty_log_format.sql", "original_file_path": "macros/jinja_helpers/pretty_log_format.sql", "unique_id": "macro.dbt_utils.default__pretty_log_format", "macro_sql": "{% macro default__pretty_log_format(message) %}\n {{ return( dbt_utils.pretty_time() ~ ' + ' ~ message) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.pretty_time"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "message", "type": null, "description": ""}], "created_at": 1789422566.7753654, "supported_languages": null}, "macro.dbt_utils._is_ephemeral": {"name": "_is_ephemeral", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/jinja_helpers/_is_ephemeral.sql", "original_file_path": "macros/jinja_helpers/_is_ephemeral.sql", "unique_id": "macro.dbt_utils._is_ephemeral", "macro_sql": "{% macro _is_ephemeral(obj, macro) %}\n {%- if obj.is_cte -%}\n {% set ephemeral_prefix = api.Relation.add_ephemeral_prefix('') %}\n {% if obj.name.startswith(ephemeral_prefix) %}\n {% set model_name = obj.name[(ephemeral_prefix|length):] %}\n {% else %}\n {% set model_name = obj.name %}\n {%- endif -%}\n {% set error_message %}\nThe `{{ macro }}` macro cannot be used with ephemeral models, as it relies on the information schema.\n\n`{{ model_name }}` is an ephemeral model. Consider making it a view or table instead.\n {% endset %}\n {%- do exceptions.raise_compiler_error(error_message) -%}\n {%- endif -%}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "obj", "type": null, "description": ""}, {"name": "macro", "type": null, "description": ""}], "created_at": 1789422566.776858, "supported_languages": null}, "macro.dbt_utils._is_relation": {"name": "_is_relation", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/jinja_helpers/_is_relation.sql", "original_file_path": "macros/jinja_helpers/_is_relation.sql", "unique_id": "macro.dbt_utils._is_relation", "macro_sql": "{% macro _is_relation(obj, macro) %}\n {%- if not (obj is mapping and obj.get('metadata', {}).get('type', '').endswith('Relation')) -%}\n {%- do exceptions.raise_compiler_error(\"Macro \" ~ macro ~ \" expected a Relation but received the value: \" ~ obj) -%}\n {%- endif -%}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "obj", "type": null, "description": ""}, {"name": "macro", "type": null, "description": ""}], "created_at": 1789422566.7777565, "supported_languages": null}, "macro.dbt_utils.pretty_time": {"name": "pretty_time", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/jinja_helpers/pretty_time.sql", "original_file_path": "macros/jinja_helpers/pretty_time.sql", "unique_id": "macro.dbt_utils.pretty_time", "macro_sql": "{% macro pretty_time(format='%H:%M:%S') %}\n {{ return(adapter.dispatch('pretty_time', 'dbt_utils')(format)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__pretty_time"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "format", "type": null, "description": ""}], "created_at": 1789422566.778298, "supported_languages": null}, "macro.dbt_utils.default__pretty_time": {"name": "default__pretty_time", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/jinja_helpers/pretty_time.sql", "original_file_path": "macros/jinja_helpers/pretty_time.sql", "unique_id": "macro.dbt_utils.default__pretty_time", "macro_sql": "{% macro default__pretty_time(format='%H:%M:%S') %}\n {{ return(modules.datetime.datetime.now().strftime(format)) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "format", "type": null, "description": ""}], "created_at": 1789422566.778714, "supported_languages": null}, "macro.dbt_utils.test_not_constant": {"name": "test_not_constant", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/not_constant.sql", "original_file_path": "macros/generic_tests/not_constant.sql", "unique_id": "macro.dbt_utils.test_not_constant", "macro_sql": "{% test not_constant(model, column_name, group_by_columns = []) %}\n {{ return(adapter.dispatch('test_not_constant', 'dbt_utils')(model, column_name, group_by_columns)) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_not_constant"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "column_name", "type": null, "description": ""}, {"name": "group_by_columns", "type": null, "description": ""}], "created_at": 1789422566.7794783, "supported_languages": null}, "macro.dbt_utils.default__test_not_constant": {"name": "default__test_not_constant", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/not_constant.sql", "original_file_path": "macros/generic_tests/not_constant.sql", "unique_id": "macro.dbt_utils.default__test_not_constant", "macro_sql": "{% macro default__test_not_constant(model, column_name, group_by_columns) %}\n\n{% if group_by_columns|length() > 0 %}\n {% set select_gb_cols = group_by_columns|join(' ,') + ', ' %}\n {% set groupby_gb_cols = 'group by ' + group_by_columns|join(',') %}\n{% endif %}\n\n\nselect\n {# In TSQL, subquery aggregate columns need aliases #}\n {# thus: a filler col name, 'filler_column' #}\n {{select_gb_cols}}\n count(distinct {{ column_name }}) as filler_column\n\nfrom {{ model }}\n\n {{groupby_gb_cols}}\n\nhaving count(distinct {{ column_name }}) = 1\n\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "column_name", "type": null, "description": ""}, {"name": "group_by_columns", "type": null, "description": ""}], "created_at": 1789422566.7805753, "supported_languages": null}, "macro.dbt_utils.test_equality": {"name": "test_equality", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/equality.sql", "original_file_path": "macros/generic_tests/equality.sql", "unique_id": "macro.dbt_utils.test_equality", "macro_sql": "{% test equality(model, compare_model, compare_columns=None, exclude_columns=None, precision = None) %}\n {{ return(adapter.dispatch('test_equality', 'dbt_utils')(model, compare_model, compare_columns, exclude_columns, precision)) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_equality"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "compare_model", "type": null, "description": ""}, {"name": "compare_columns", "type": null, "description": ""}, {"name": "exclude_columns", "type": null, "description": ""}, {"name": "precision", "type": null, "description": ""}], "created_at": 1789422566.7828298, "supported_languages": null}, "macro.dbt_utils.default__test_equality": {"name": "default__test_equality", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/equality.sql", "original_file_path": "macros/generic_tests/equality.sql", "unique_id": "macro.dbt_utils.default__test_equality", "macro_sql": "{% macro default__test_equality(model, compare_model, compare_columns=None, exclude_columns=None, precision = None) %}\n\n{%- if compare_columns and exclude_columns -%}\n {{ exceptions.raise_compiler_error(\"Both a compare and an ignore list were provided to the `equality` macro. Only one is allowed\") }}\n{%- endif -%}\n\n{% set set_diff %}\n count(*) + coalesce(abs(\n sum(case when which_diff = 'a_minus_b' then 1 else 0 end) -\n sum(case when which_diff = 'b_minus_a' then 1 else 0 end)\n ), 0)\n{% endset %}\n\n{#-- Needs to be set at parse time, before we return '' below --#}\n{{ config(fail_calc = set_diff) }}\n\n{#-- Prevent querying of db in parsing mode. This works because this macro does not create any new refs. #}\n{%- if not execute -%}\n {{ return('') }}\n{% endif %}\n\n\n\n-- setup\n{%- do dbt_utils._is_relation(model, 'test_equality') -%}\n\n{# Ensure there are no extra columns in the compare_model vs model #}\n{%- if not compare_columns -%}\n {%- do dbt_utils._is_ephemeral(model, 'test_equality') -%}\n {%- do dbt_utils._is_ephemeral(compare_model, 'test_equality') -%}\n\n {%- set model_columns = adapter.get_columns_in_relation(model) -%}\n {%- set compare_model_columns = adapter.get_columns_in_relation(compare_model) -%}\n\n\n {%- if exclude_columns -%}\n {#-- Lower case ignore columns for easier comparison --#}\n {%- set exclude_columns = exclude_columns | map(\"lower\") | list %}\n\n {# Filter out the excluded columns #}\n {%- set include_columns = [] %}\n {%- set include_model_columns = [] %}\n {%- for column in model_columns -%}\n {%- if column.name | lower not in exclude_columns -%}\n {% do include_columns.append(column) %}\n {%- endif %}\n {%- endfor %}\n {%- for column in compare_model_columns -%}\n {%- if column.name | lower not in exclude_columns -%}\n {% do include_model_columns.append(column) %}\n {%- endif %}\n {%- endfor %}\n\n {%- set compare_columns_set = set(include_columns | map(attribute='quoted') | map(\"lower\")) %}\n {%- set compare_model_columns_set = set(include_model_columns | map(attribute='quoted') | map(\"lower\")) %}\n {%- else -%}\n {%- set compare_columns_set = set(model_columns | map(attribute='quoted') | map(\"lower\")) %}\n {%- set compare_model_columns_set = set(compare_model_columns | map(attribute='quoted') | map(\"lower\")) %}\n {%- endif -%}\n\n {% if compare_columns_set != compare_model_columns_set %}\n {{ exceptions.raise_compiler_error(compare_model ~\" has less columns than \" ~ model ~ \", please ensure they have the same columns or use the `compare_columns` or `exclude_columns` arguments to subset them.\") }}\n {% endif %}\n\n\n{% endif %}\n\n{%- if not precision -%}\n {%- if not compare_columns -%}\n {# \n You cannot get the columns in an ephemeral model (due to not existing in the information schema),\n so if the user does not provide an explicit list of columns we must error in the case it is ephemeral\n #}\n {%- do dbt_utils._is_ephemeral(model, 'test_equality') -%}\n {%- set compare_columns = adapter.get_columns_in_relation(model)-%}\n\n {%- if exclude_columns -%}\n {#-- Lower case ignore columns for easier comparison --#}\n {%- set exclude_columns = exclude_columns | map(\"lower\") | list %}\n\n {# Filter out the excluded columns #}\n {%- set include_columns = [] %}\n {%- for column in compare_columns -%}\n {%- if column.name | lower not in exclude_columns -%}\n {% do include_columns.append(column) %}\n {%- endif %}\n {%- endfor %}\n\n {%- set compare_columns = include_columns | map(attribute='quoted') %}\n {%- else -%} {# Compare columns provided #}\n {%- set compare_columns = compare_columns | map(attribute='quoted') %}\n {%- endif -%}\n {%- endif -%}\n\n {% set compare_cols_csv = compare_columns | join(', ') %}\n\n{% else %} {# Precision required #}\n {#-\n If rounding is required, we need to get the types, so it cannot be ephemeral even if they provide column names\n -#}\n {%- do dbt_utils._is_ephemeral(model, 'test_equality') -%}\n {%- set columns = adapter.get_columns_in_relation(model) -%}\n\n {% set columns_list = [] %}\n {%- for col in columns -%}\n {%- if (\n (col.name|lower in compare_columns|map('lower') or not compare_columns) and\n (col.name|lower not in exclude_columns|map('lower') or not exclude_columns)\n ) -%}\n {# Databricks double type is not picked up by any number type checks in dbt #}\n {%- if col.is_float() or col.is_numeric() or col.data_type == 'double' -%}\n {# Cast is required due to postgres not having round for a double precision number #}\n {%- do columns_list.append('round(cast(' ~ col.quoted ~ ' as ' ~ dbt.type_numeric() ~ '),' ~ precision ~ ') as ' ~ col.quoted) -%}\n {%- else -%} {# Non-numeric type #}\n {%- do columns_list.append(col.quoted) -%}\n {%- endif -%}\n {% endif %}\n {%- endfor -%}\n\n {% set compare_cols_csv = columns_list | join(', ') %}\n\n{% endif %}\n\nwith a as (\n\n select * from {{ model }}\n\n),\n\nb as (\n\n select * from {{ compare_model }}\n\n),\n\na_minus_b as (\n\n select {{compare_cols_csv}} from a\n {{ dbt.except() }}\n select {{compare_cols_csv}} from b\n\n),\n\nb_minus_a as (\n\n select {{compare_cols_csv}} from b\n {{ dbt.except() }}\n select {{compare_cols_csv}} from a\n\n),\n\nunioned as (\n\n select 'a_minus_b' as which_diff, a_minus_b.* from a_minus_b\n union all\n select 'b_minus_a' as which_diff, b_minus_a.* from b_minus_a\n\n)\n\nselect * from unioned\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils._is_relation", "macro.dbt_utils._is_ephemeral", "macro.dbt.type_numeric", "macro.dbt.except"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "compare_model", "type": null, "description": ""}, {"name": "compare_columns", "type": null, "description": ""}, {"name": "exclude_columns", "type": null, "description": ""}, {"name": "precision", "type": null, "description": ""}], "created_at": 1789422566.7908626, "supported_languages": null}, "macro.dbt_utils.test_not_empty_string": {"name": "test_not_empty_string", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/not_empty_string.sql", "original_file_path": "macros/generic_tests/not_empty_string.sql", "unique_id": "macro.dbt_utils.test_not_empty_string", "macro_sql": "{% test not_empty_string(model, column_name, trim_whitespace=true) %}\n\n {{ return(adapter.dispatch('test_not_empty_string', 'dbt_utils')(model, column_name, trim_whitespace)) }}\n\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_not_empty_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "column_name", "type": null, "description": ""}, {"name": "trim_whitespace", "type": null, "description": ""}], "created_at": 1789422566.79184, "supported_languages": null}, "macro.dbt_utils.default__test_not_empty_string": {"name": "default__test_not_empty_string", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/not_empty_string.sql", "original_file_path": "macros/generic_tests/not_empty_string.sql", "unique_id": "macro.dbt_utils.default__test_not_empty_string", "macro_sql": "{% macro default__test_not_empty_string(model, column_name, trim_whitespace=true) %}\n\n with\n \n all_values as (\n\n select \n\n\n {% if trim_whitespace == true -%}\n\n trim({{ column_name }}) as {{ column_name }}\n\n {%- else -%}\n\n {{ column_name }}\n\n {%- endif %}\n \n from {{ model }}\n\n ),\n\n errors as (\n\n select * from all_values\n where {{ column_name }} = ''\n\n )\n\n select * from errors\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "column_name", "type": null, "description": ""}, {"name": "trim_whitespace", "type": null, "description": ""}], "created_at": 1789422566.7925186, "supported_languages": null}, "macro.dbt_utils.test_recency": {"name": "test_recency", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/recency.sql", "original_file_path": "macros/generic_tests/recency.sql", "unique_id": "macro.dbt_utils.test_recency", "macro_sql": "{% test recency(model, field, datepart, interval, ignore_time_component=False, group_by_columns = []) %}\n {{ return(adapter.dispatch('test_recency', 'dbt_utils')(model, field, datepart, interval, ignore_time_component, group_by_columns)) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_recency"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "field", "type": null, "description": ""}, {"name": "datepart", "type": null, "description": ""}, {"name": "interval", "type": null, "description": ""}, {"name": "ignore_time_component", "type": null, "description": ""}, {"name": "group_by_columns", "type": null, "description": ""}], "created_at": 1789422566.793994, "supported_languages": null}, "macro.dbt_utils.default__test_recency": {"name": "default__test_recency", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/recency.sql", "original_file_path": "macros/generic_tests/recency.sql", "unique_id": "macro.dbt_utils.default__test_recency", "macro_sql": "{% macro default__test_recency(model, field, datepart, interval, ignore_time_component, group_by_columns) %}\n\n{% set empty_invocation = flags.EMPTY is defined and flags.EMPTY %}\n\n{% set threshold = 'cast(' ~ dbt.dateadd(datepart, interval * -1, dbt.current_timestamp()) ~ ' as ' ~ ('date' if ignore_time_component else dbt.type_timestamp()) ~ ')' %}\n\n{% if group_by_columns|length() > 0 %}\n {% set select_gb_cols = group_by_columns|join(' ,') + ', ' %}\n {% set groupby_gb_cols = 'group by ' + group_by_columns|join(',') %}\n{% endif %}\n\n\nwith recency as (\n\n select \n\n {{ select_gb_cols }}\n {% if ignore_time_component %}\n cast(max({{ field }}) as date) as most_recent\n {%- else %}\n max({{ field }}) as most_recent\n {%- endif %}\n\n from {{ model }}\n\n {{ groupby_gb_cols }}\n\n)\n\nselect\n\n {{ select_gb_cols }}\n most_recent,\n {{ threshold }} as threshold\n\nfrom recency\nwhere most_recent < {{ threshold }}\n{%- if not empty_invocation %}\n or most_recent is null\n{%- endif %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.dateadd", "macro.dbt.current_timestamp", "macro.dbt.type_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "field", "type": null, "description": ""}, {"name": "datepart", "type": null, "description": ""}, {"name": "interval", "type": null, "description": ""}, {"name": "ignore_time_component", "type": null, "description": ""}, {"name": "group_by_columns", "type": null, "description": ""}], "created_at": 1789422566.7959976, "supported_languages": null}, "macro.dbt_utils.test_at_least_one": {"name": "test_at_least_one", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/at_least_one.sql", "original_file_path": "macros/generic_tests/at_least_one.sql", "unique_id": "macro.dbt_utils.test_at_least_one", "macro_sql": "{% test at_least_one(model, column_name, group_by_columns = []) %}\n {{ return(adapter.dispatch('test_at_least_one', 'dbt_utils')(model, column_name, group_by_columns)) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_at_least_one"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "column_name", "type": null, "description": ""}, {"name": "group_by_columns", "type": null, "description": ""}], "created_at": 1789422566.7969756, "supported_languages": null}, "macro.dbt_utils.default__test_at_least_one": {"name": "default__test_at_least_one", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/at_least_one.sql", "original_file_path": "macros/generic_tests/at_least_one.sql", "unique_id": "macro.dbt_utils.default__test_at_least_one", "macro_sql": "{% macro default__test_at_least_one(model, column_name, group_by_columns) %}\n\n{% set pruned_cols = [column_name] %}\n\n{% if group_by_columns|length() > 0 %}\n\n {% set select_gb_cols = group_by_columns|join(' ,') + ', ' %}\n {% set groupby_gb_cols = 'group by ' + group_by_columns|join(',') %}\n {% set pruned_cols = group_by_columns %}\n\n {% if column_name not in pruned_cols %}\n {% do pruned_cols.append(column_name) %}\n {% endif %}\n\n{% endif %}\n\n{% set select_pruned_cols = pruned_cols|join(' ,') %}\n\nselect *\nfrom (\n with pruned_rows as (\n select\n {{ select_pruned_cols }}\n from {{ model }}\n {% if group_by_columns|length() == 0 %}\n where {{ column_name }} is not null\n limit 1\n {% endif %}\n )\n select\n {# In TSQL, subquery aggregate columns need aliases #}\n {# thus: a filler col name, 'filler_column' #}\n {{select_gb_cols}}\n count({{ column_name }}) as filler_column\n\n from pruned_rows\n\n {{groupby_gb_cols}}\n\n having count({{ column_name }}) = 0\n\n) validation_errors\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "column_name", "type": null, "description": ""}, {"name": "group_by_columns", "type": null, "description": ""}], "created_at": 1789422566.7988071, "supported_languages": null}, "macro.dbt_utils.test_unique_combination_of_columns": {"name": "test_unique_combination_of_columns", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/unique_combination_of_columns.sql", "original_file_path": "macros/generic_tests/unique_combination_of_columns.sql", "unique_id": "macro.dbt_utils.test_unique_combination_of_columns", "macro_sql": "{% test unique_combination_of_columns(model, combination_of_columns, quote_columns=false) %}\n {{ return(adapter.dispatch('test_unique_combination_of_columns', 'dbt_utils')(model, combination_of_columns, quote_columns)) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_unique_combination_of_columns"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "combination_of_columns", "type": null, "description": ""}, {"name": "quote_columns", "type": null, "description": ""}], "created_at": 1789422566.7996724, "supported_languages": null}, "macro.dbt_utils.default__test_unique_combination_of_columns": {"name": "default__test_unique_combination_of_columns", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/unique_combination_of_columns.sql", "original_file_path": "macros/generic_tests/unique_combination_of_columns.sql", "unique_id": "macro.dbt_utils.default__test_unique_combination_of_columns", "macro_sql": "{% macro default__test_unique_combination_of_columns(model, combination_of_columns, quote_columns=false) %}\n\n{% if not quote_columns %}\n {%- set column_list=combination_of_columns %}\n{% elif quote_columns %}\n {%- set column_list=[] %}\n {% for column in combination_of_columns -%}\n {% do column_list.append( adapter.quote(column) ) %}\n {%- endfor %}\n{% else %}\n {{ exceptions.raise_compiler_error(\n \"`quote_columns` argument for unique_combination_of_columns test must be one of [True, False] Got: '\" ~ quote ~\"'.'\"\n ) }}\n{% endif %}\n\n{%- set columns_csv=column_list | join(', ') %}\n\n\nwith validation_errors as (\n\n select\n {{ columns_csv }}\n from {{ model }}\n group by {{ columns_csv }}\n having count(*) > 1\n\n)\n\nselect *\nfrom validation_errors\n\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "combination_of_columns", "type": null, "description": ""}, {"name": "quote_columns", "type": null, "description": ""}], "created_at": 1789422566.800962, "supported_languages": null}, "macro.dbt_utils.test_fewer_rows_than": {"name": "test_fewer_rows_than", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/fewer_rows_than.sql", "original_file_path": "macros/generic_tests/fewer_rows_than.sql", "unique_id": "macro.dbt_utils.test_fewer_rows_than", "macro_sql": "{% test fewer_rows_than(model, compare_model, group_by_columns = []) %}\n {{ return(adapter.dispatch('test_fewer_rows_than', 'dbt_utils')(model, compare_model, group_by_columns)) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_fewer_rows_than"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "compare_model", "type": null, "description": ""}, {"name": "group_by_columns", "type": null, "description": ""}], "created_at": 1789422566.8021145, "supported_languages": null}, "macro.dbt_utils.default__test_fewer_rows_than": {"name": "default__test_fewer_rows_than", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/fewer_rows_than.sql", "original_file_path": "macros/generic_tests/fewer_rows_than.sql", "unique_id": "macro.dbt_utils.default__test_fewer_rows_than", "macro_sql": "{% macro default__test_fewer_rows_than(model, compare_model, group_by_columns) %}\n\n{{ config(fail_calc = 'sum(coalesce(row_count_delta, 0))') }}\n\n{% if group_by_columns|length() > 0 %}\n {% set select_gb_cols = group_by_columns|join(' ,') + ', ' %}\n {% set join_gb_cols %}\n {% for c in group_by_columns %}\n and a.{{c}} = b.{{c}}\n {% endfor %}\n {% endset %}\n {% set groupby_gb_cols = 'group by ' + group_by_columns|join(',') %}\n{% endif %}\n\n{#-- We must add a fake join key in case additional grouping variables are not provided --#}\n{#-- Redshift does not allow for dynamically created join conditions (e.g. full join on 1 = 1 --#}\n{#-- The same logic is used in equal_rowcount. In case of changes, maintain consistent logic --#}\n{% set group_by_columns = ['id_dbtutils_test_fewer_rows_than'] + group_by_columns %}\n{% set groupby_gb_cols = 'group by ' + group_by_columns|join(',') %}\n\n\nwith a as (\n\n select \n {{select_gb_cols}}\n 1 as id_dbtutils_test_fewer_rows_than,\n count(*) as count_our_model \n from {{ model }}\n {{ groupby_gb_cols }}\n\n),\nb as (\n\n select \n {{select_gb_cols}}\n 1 as id_dbtutils_test_fewer_rows_than,\n count(*) as count_comparison_model \n from {{ compare_model }}\n {{ groupby_gb_cols }}\n\n),\ncounts as (\n\n select\n\n {% for c in group_by_columns -%}\n a.{{c}} as {{c}}_a,\n b.{{c}} as {{c}}_b,\n {% endfor %}\n\n count_our_model,\n count_comparison_model\n from a\n full join b on \n a.id_dbtutils_test_fewer_rows_than = b.id_dbtutils_test_fewer_rows_than\n {{ join_gb_cols }}\n\n),\nfinal as (\n\n select *,\n case\n -- fail the test if we have more rows than the reference model and return the row count delta\n when count_our_model > count_comparison_model then (count_our_model - count_comparison_model)\n -- fail the test if they are the same number\n when count_our_model = count_comparison_model then 1\n -- pass the test if the delta is positive (i.e. return the number 0)\n else 0\n end as row_count_delta\n from counts\n\n)\n\nselect * from final\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "compare_model", "type": null, "description": ""}, {"name": "group_by_columns", "type": null, "description": ""}], "created_at": 1789422566.8042731, "supported_languages": null}, "macro.dbt_utils.test_not_null_proportion": {"name": "test_not_null_proportion", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/not_null_proportion.sql", "original_file_path": "macros/generic_tests/not_null_proportion.sql", "unique_id": "macro.dbt_utils.test_not_null_proportion", "macro_sql": "{% macro test_not_null_proportion(model, group_by_columns = []) %}\n {{ return(adapter.dispatch('test_not_null_proportion', 'dbt_utils')(model, group_by_columns, **kwargs)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_not_null_proportion"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "group_by_columns", "type": null, "description": ""}], "created_at": 1789422566.8051627, "supported_languages": null}, "macro.dbt_utils.default__test_not_null_proportion": {"name": "default__test_not_null_proportion", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/not_null_proportion.sql", "original_file_path": "macros/generic_tests/not_null_proportion.sql", "unique_id": "macro.dbt_utils.default__test_not_null_proportion", "macro_sql": "{% macro default__test_not_null_proportion(model, group_by_columns) %}\n\n{% set column_name = kwargs.get('column_name', kwargs.get('arg')) %}\n{% set at_least = kwargs.get('at_least', kwargs.get('arg')) %}\n{% set at_most = kwargs.get('at_most', kwargs.get('arg', 1)) %}\n\n{% if group_by_columns|length() > 0 %}\n {% set select_gb_cols = group_by_columns|join(' ,') + ', ' %}\n {% set groupby_gb_cols = 'group by ' + group_by_columns|join(',') %}\n{% endif %}\n\nwith validation as (\n select\n {{select_gb_cols}}\n sum(case when {{ column_name }} is null then 0 else 1 end) / cast(count(*) as {{ dbt.type_numeric() }}) as not_null_proportion\n from {{ model }}\n {{groupby_gb_cols}}\n),\nvalidation_errors as (\n select\n {{select_gb_cols}}\n not_null_proportion\n from validation\n where not_null_proportion < {{ at_least }} or not_null_proportion > {{ at_most }}\n)\nselect\n *\nfrom validation_errors\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.type_numeric"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "group_by_columns", "type": null, "description": ""}], "created_at": 1789422566.8068588, "supported_languages": null}, "macro.dbt_utils.test_equal_rowcount": {"name": "test_equal_rowcount", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/equal_rowcount.sql", "original_file_path": "macros/generic_tests/equal_rowcount.sql", "unique_id": "macro.dbt_utils.test_equal_rowcount", "macro_sql": "{% test equal_rowcount(model, compare_model, group_by_columns = []) %}\n {{ return(adapter.dispatch('test_equal_rowcount', 'dbt_utils')(model, compare_model, group_by_columns)) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_equal_rowcount"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "compare_model", "type": null, "description": ""}, {"name": "group_by_columns", "type": null, "description": ""}], "created_at": 1789422566.807982, "supported_languages": null}, "macro.dbt_utils.default__test_equal_rowcount": {"name": "default__test_equal_rowcount", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/equal_rowcount.sql", "original_file_path": "macros/generic_tests/equal_rowcount.sql", "unique_id": "macro.dbt_utils.default__test_equal_rowcount", "macro_sql": "{% macro default__test_equal_rowcount(model, compare_model, group_by_columns) %}\n\n{#-- Needs to be set at parse time, before we return '' below --#}\n{{ config(fail_calc = 'sum(coalesce(diff_count, 0))') }}\n\n{#-- Prevent querying of db in parsing mode. This works because this macro does not create any new refs. #}\n{%- if not execute -%}\n {{ return('') }}\n{% endif %}\n\n{% if group_by_columns|length() > 0 %}\n {% set select_gb_cols = group_by_columns|join(', ') + ', ' %}\n {% set join_gb_cols %}\n {% for c in group_by_columns %}\n and a.{{c}} = b.{{c}}\n {% endfor %}\n {% endset %}\n {% set groupby_gb_cols = 'group by ' + group_by_columns|join(',') %}\n{% endif %}\n\n{#-- We must add a fake join key in case additional grouping variables are not provided --#}\n{#-- Redshift does not allow for dynamically created join conditions (e.g. full join on 1 = 1 --#}\n{#-- The same logic is used in fewer_rows_than. In case of changes, maintain consistent logic --#}\n{% set group_by_columns = ['id_dbtutils_test_equal_rowcount'] + group_by_columns %}\n{% set groupby_gb_cols = 'group by ' + group_by_columns|join(',') %}\n\nwith a as (\n\n select \n {{select_gb_cols}}\n 1 as id_dbtutils_test_equal_rowcount,\n count(*) as count_a \n from {{ model }}\n {{groupby_gb_cols}}\n\n\n),\nb as (\n\n select \n {{select_gb_cols}}\n 1 as id_dbtutils_test_equal_rowcount,\n count(*) as count_b \n from {{ compare_model }}\n {{groupby_gb_cols}}\n\n),\nfinal as (\n\n select\n \n {% for c in group_by_columns -%}\n a.{{c}} as {{c}}_a,\n b.{{c}} as {{c}}_b,\n {% endfor %}\n\n count_a,\n count_b,\n abs(count_a - count_b) as diff_count\n\n from a\n full join b\n on\n a.id_dbtutils_test_equal_rowcount = b.id_dbtutils_test_equal_rowcount\n {{join_gb_cols}}\n\n\n)\n\nselect * from final\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "compare_model", "type": null, "description": ""}, {"name": "group_by_columns", "type": null, "description": ""}], "created_at": 1789422566.8101482, "supported_languages": null}, "macro.dbt_utils.test_sequential_values": {"name": "test_sequential_values", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/sequential_values.sql", "original_file_path": "macros/generic_tests/sequential_values.sql", "unique_id": "macro.dbt_utils.test_sequential_values", "macro_sql": "{% test sequential_values(model, column_name, interval=1, datepart=None, group_by_columns = []) %}\n\n {{ return(adapter.dispatch('test_sequential_values', 'dbt_utils')(model, column_name, interval, datepart, group_by_columns)) }}\n\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_sequential_values"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "column_name", "type": null, "description": ""}, {"name": "interval", "type": null, "description": ""}, {"name": "datepart", "type": null, "description": ""}, {"name": "group_by_columns", "type": null, "description": ""}], "created_at": 1789422566.811216, "supported_languages": null}, "macro.dbt_utils.default__test_sequential_values": {"name": "default__test_sequential_values", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/sequential_values.sql", "original_file_path": "macros/generic_tests/sequential_values.sql", "unique_id": "macro.dbt_utils.default__test_sequential_values", "macro_sql": "{% macro default__test_sequential_values(model, column_name, interval=1, datepart=None, group_by_columns = []) %}\n\n{% set previous_column_name = \"previous_\" ~ dbt_utils.slugify(column_name) %}\n\n{% if group_by_columns|length() > 0 %}\n {% set select_gb_cols = group_by_columns|join(',') + ', ' %}\n {% set partition_gb_cols = 'partition by ' + group_by_columns|join(',') %}\n{% endif %}\n\nwith windowed as (\n\n select\n {{ select_gb_cols }}\n {{ column_name }},\n lag({{ column_name }}) over (\n {{partition_gb_cols}}\n order by {{ column_name }}\n ) as {{ previous_column_name }}\n from {{ model }}\n),\n\nvalidation_errors as (\n select\n *\n from windowed\n {% if datepart %}\n where not(cast({{ column_name }} as {{ dbt.type_timestamp() }})= cast({{ dbt.dateadd(datepart, interval, previous_column_name) }} as {{ dbt.type_timestamp() }}))\n {% else %}\n where not({{ column_name }} = {{ previous_column_name }} + {{ interval }})\n {% endif %}\n)\n\nselect *\nfrom validation_errors\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.slugify", "macro.dbt.type_timestamp", "macro.dbt.dateadd"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "column_name", "type": null, "description": ""}, {"name": "interval", "type": null, "description": ""}, {"name": "datepart", "type": null, "description": ""}, {"name": "group_by_columns", "type": null, "description": ""}], "created_at": 1789422566.8130665, "supported_languages": null}, "macro.dbt_utils.test_mutually_exclusive_ranges": {"name": "test_mutually_exclusive_ranges", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/mutually_exclusive_ranges.sql", "original_file_path": "macros/generic_tests/mutually_exclusive_ranges.sql", "unique_id": "macro.dbt_utils.test_mutually_exclusive_ranges", "macro_sql": "{% test mutually_exclusive_ranges(model, lower_bound_column, upper_bound_column, partition_by=None, gaps='allowed', zero_length_range_allowed=False) %}\n {{ return(adapter.dispatch('test_mutually_exclusive_ranges', 'dbt_utils')(model, lower_bound_column, upper_bound_column, partition_by, gaps, zero_length_range_allowed)) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_mutually_exclusive_ranges"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "lower_bound_column", "type": null, "description": ""}, {"name": "upper_bound_column", "type": null, "description": ""}, {"name": "partition_by", "type": null, "description": ""}, {"name": "gaps", "type": null, "description": ""}, {"name": "zero_length_range_allowed", "type": null, "description": ""}], "created_at": 1789422566.8146474, "supported_languages": null}, "macro.dbt_utils.default__test_mutually_exclusive_ranges": {"name": "default__test_mutually_exclusive_ranges", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/mutually_exclusive_ranges.sql", "original_file_path": "macros/generic_tests/mutually_exclusive_ranges.sql", "unique_id": "macro.dbt_utils.default__test_mutually_exclusive_ranges", "macro_sql": "{% macro default__test_mutually_exclusive_ranges(model, lower_bound_column, upper_bound_column, partition_by=None, gaps='allowed', zero_length_range_allowed=False) %}\n{% if gaps == 'not_allowed' %}\n {% set allow_gaps_operator='=' %}\n {% set allow_gaps_operator_in_words='equal_to' %}\n{% elif gaps == 'allowed' %}\n {% set allow_gaps_operator='<=' %}\n {% set allow_gaps_operator_in_words='less_than_or_equal_to' %}\n{% elif gaps == 'required' %}\n {% set allow_gaps_operator='<' %}\n {% set allow_gaps_operator_in_words='less_than' %}\n{% else %}\n {{ exceptions.raise_compiler_error(\n \"`gaps` argument for mutually_exclusive_ranges test must be one of ['not_allowed', 'allowed', 'required'] Got: '\" ~ gaps ~\"'.'\"\n ) }}\n{% endif %}\n{% if not zero_length_range_allowed %}\n {% set allow_zero_length_operator='<' %}\n {% set allow_zero_length_operator_in_words='less_than' %}\n{% elif zero_length_range_allowed %}\n {% set allow_zero_length_operator='<=' %}\n {% set allow_zero_length_operator_in_words='less_than_or_equal_to' %}\n{% else %}\n {{ exceptions.raise_compiler_error(\n \"`zero_length_range_allowed` argument for mutually_exclusive_ranges test must be one of [true, false] Got: '\" ~ zero_length_range_allowed ~\"'.'\"\n ) }}\n{% endif %}\n\n{% set partition_clause=\"partition by \" ~ partition_by if partition_by else '' %}\n\nwith window_functions as (\n\n select\n {% if partition_by %}\n {{ partition_by }} as partition_by_col,\n {% endif %}\n {{ lower_bound_column }} as lower_bound,\n {{ upper_bound_column }} as upper_bound,\n\n lead({{ lower_bound_column }}) over (\n {{ partition_clause }}\n order by {{ lower_bound_column }}, {{ upper_bound_column }}\n ) as next_lower_bound,\n\n row_number() over (\n {{ partition_clause }}\n order by {{ lower_bound_column }} desc, {{ upper_bound_column }} desc\n ) = 1 as is_last_record\n\n from {{ model }}\n\n),\n\ncalc as (\n -- We want to return records where one of our assumptions fails, so we'll use\n -- the `not` function with `and` statements so we can write our assumptions more cleanly\n select\n *,\n\n -- For each record: lower_bound should be < upper_bound.\n -- Coalesce it to return an error on the null case (implicit assumption\n -- these columns are not_null)\n coalesce(\n lower_bound {{ allow_zero_length_operator }} upper_bound,\n false\n ) as lower_bound_{{ allow_zero_length_operator_in_words }}_upper_bound,\n\n -- For each record: upper_bound {{ allow_gaps_operator }} the next lower_bound.\n -- Coalesce it to handle null cases for the last record.\n coalesce(\n upper_bound {{ allow_gaps_operator }} next_lower_bound,\n is_last_record,\n false\n ) as upper_bound_{{ allow_gaps_operator_in_words }}_next_lower_bound\n\n from window_functions\n\n),\n\nvalidation_errors as (\n\n select\n *\n from calc\n\n where not(\n -- THE FOLLOWING SHOULD BE TRUE --\n lower_bound_{{ allow_zero_length_operator_in_words }}_upper_bound\n and upper_bound_{{ allow_gaps_operator_in_words }}_next_lower_bound\n )\n)\n\nselect * from validation_errors\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "lower_bound_column", "type": null, "description": ""}, {"name": "upper_bound_column", "type": null, "description": ""}, {"name": "partition_by", "type": null, "description": ""}, {"name": "gaps", "type": null, "description": ""}, {"name": "zero_length_range_allowed", "type": null, "description": ""}], "created_at": 1789422566.818652, "supported_languages": null}, "macro.dbt_utils.test_cardinality_equality": {"name": "test_cardinality_equality", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/cardinality_equality.sql", "original_file_path": "macros/generic_tests/cardinality_equality.sql", "unique_id": "macro.dbt_utils.test_cardinality_equality", "macro_sql": "{% test cardinality_equality(model, column_name, to, field) %}\n {{ return(adapter.dispatch('test_cardinality_equality', 'dbt_utils')(model, column_name, to, field)) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_cardinality_equality"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "column_name", "type": null, "description": ""}, {"name": "to", "type": null, "description": ""}, {"name": "field", "type": null, "description": ""}], "created_at": 1789422566.81954, "supported_languages": null}, "macro.dbt_utils.default__test_cardinality_equality": {"name": "default__test_cardinality_equality", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/cardinality_equality.sql", "original_file_path": "macros/generic_tests/cardinality_equality.sql", "unique_id": "macro.dbt_utils.default__test_cardinality_equality", "macro_sql": "{% macro default__test_cardinality_equality(model, column_name, to, field) %}\n\n{# T-SQL does not let you use numbers as aliases for columns #}\n{# Thus, no \"GROUP BY 1\" #}\n\nwith table_a as (\nselect\n {{ column_name }},\n count(*) as num_rows\nfrom {{ model }}\ngroup by {{ column_name }}\n),\n\ntable_b as (\nselect\n {{ field }},\n count(*) as num_rows\nfrom {{ to }}\ngroup by {{ field }}\n),\n\nexcept_a as (\n select *\n from table_a\n {{ dbt.except() }}\n select *\n from table_b\n),\n\nexcept_b as (\n select *\n from table_b\n {{ dbt.except() }}\n select *\n from table_a\n),\n\nunioned as (\n select *\n from except_a\n union all\n select *\n from except_b\n)\n\nselect *\nfrom unioned\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.except"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "column_name", "type": null, "description": ""}, {"name": "to", "type": null, "description": ""}, {"name": "field", "type": null, "description": ""}], "created_at": 1789422566.82028, "supported_languages": null}, "macro.dbt_utils.test_relationships_where": {"name": "test_relationships_where", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/relationships_where.sql", "original_file_path": "macros/generic_tests/relationships_where.sql", "unique_id": "macro.dbt_utils.test_relationships_where", "macro_sql": "{% test relationships_where(model, column_name, to, field, from_condition=\"1=1\", to_condition=\"1=1\") %}\n {{ return(adapter.dispatch('test_relationships_where', 'dbt_utils')(model, column_name, to, field, from_condition, to_condition)) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_relationships_where"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "column_name", "type": null, "description": ""}, {"name": "to", "type": null, "description": ""}, {"name": "field", "type": null, "description": ""}, {"name": "from_condition", "type": null, "description": ""}, {"name": "to_condition", "type": null, "description": ""}], "created_at": 1789422566.8212712, "supported_languages": null}, "macro.dbt_utils.default__test_relationships_where": {"name": "default__test_relationships_where", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/relationships_where.sql", "original_file_path": "macros/generic_tests/relationships_where.sql", "unique_id": "macro.dbt_utils.default__test_relationships_where", "macro_sql": "{% macro default__test_relationships_where(model, column_name, to, field, from_condition=\"1=1\", to_condition=\"1=1\") %}\n\n{# T-SQL has no boolean data type so we use 1=1 which returns TRUE #}\n{# ref https://stackoverflow.com/a/7170753/3842610 #}\n\nwith left_table as (\n\n select\n {{column_name}} as id\n\n from {{model}}\n\n where {{column_name}} is not null\n and {{from_condition}}\n\n),\n\nright_table as (\n\n select\n {{field}} as id\n\n from {{to}}\n\n where {{field}} is not null\n and {{to_condition}}\n\n),\n\nexceptions as (\n\n select\n left_table.id,\n right_table.id as right_id\n\n from left_table\n\n left join right_table\n on left_table.id = right_table.id\n\n where right_table.id is null\n\n)\n\nselect * from exceptions\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "column_name", "type": null, "description": ""}, {"name": "to", "type": null, "description": ""}, {"name": "field", "type": null, "description": ""}, {"name": "from_condition", "type": null, "description": ""}, {"name": "to_condition", "type": null, "description": ""}], "created_at": 1789422566.8220117, "supported_languages": null}, "macro.dbt_utils.test_expression_is_true": {"name": "test_expression_is_true", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/expression_is_true.sql", "original_file_path": "macros/generic_tests/expression_is_true.sql", "unique_id": "macro.dbt_utils.test_expression_is_true", "macro_sql": "{% test expression_is_true(model, expression, column_name=None) %}\n {{ return(adapter.dispatch('test_expression_is_true', 'dbt_utils')(model, expression, column_name)) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_expression_is_true"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "expression", "type": null, "description": ""}, {"name": "column_name", "type": null, "description": ""}], "created_at": 1789422566.822794, "supported_languages": null}, "macro.dbt_utils.default__test_expression_is_true": {"name": "default__test_expression_is_true", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/expression_is_true.sql", "original_file_path": "macros/generic_tests/expression_is_true.sql", "unique_id": "macro.dbt_utils.default__test_expression_is_true", "macro_sql": "{% macro default__test_expression_is_true(model, expression, column_name) %}\n\n{% set column_list = '*' if should_store_failures() else \"1\" %}\n\nselect\n {{ column_list }}\nfrom {{ model }}\n{% if column_name is none %}\nwhere not({{ expression }})\n{%- else %}\nwhere not({{ column_name }} {{ expression }})\n{%- endif %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.should_store_failures"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "expression", "type": null, "description": ""}, {"name": "column_name", "type": null, "description": ""}], "created_at": 1789422566.823576, "supported_languages": null}, "macro.dbt_utils.test_not_accepted_values": {"name": "test_not_accepted_values", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/not_accepted_values.sql", "original_file_path": "macros/generic_tests/not_accepted_values.sql", "unique_id": "macro.dbt_utils.test_not_accepted_values", "macro_sql": "{% test not_accepted_values(model, column_name, values, quote=True) %}\n {{ return(adapter.dispatch('test_not_accepted_values', 'dbt_utils')(model, column_name, values, quote)) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_not_accepted_values"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "column_name", "type": null, "description": ""}, {"name": "values", "type": null, "description": ""}, {"name": "quote", "type": null, "description": ""}], "created_at": 1789422566.8244045, "supported_languages": null}, "macro.dbt_utils.default__test_not_accepted_values": {"name": "default__test_not_accepted_values", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/not_accepted_values.sql", "original_file_path": "macros/generic_tests/not_accepted_values.sql", "unique_id": "macro.dbt_utils.default__test_not_accepted_values", "macro_sql": "{% macro default__test_not_accepted_values(model, column_name, values, quote=True) %}\nwith all_values as (\n\n select distinct\n {{ column_name }} as value_field\n\n from {{ model }}\n\n),\n\nvalidation_errors as (\n\n select\n value_field\n\n from all_values\n where value_field in (\n {% for value in values -%}\n {% if quote -%}\n '{{ value }}'\n {%- else -%}\n {{ value }}\n {%- endif -%}\n {%- if not loop.last -%},{%- endif %}\n {%- endfor %}\n )\n\n)\n\nselect *\nfrom validation_errors\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "column_name", "type": null, "description": ""}, {"name": "values", "type": null, "description": ""}, {"name": "quote", "type": null, "description": ""}], "created_at": 1789422566.8252313, "supported_languages": null}, "macro.dbt_utils.test_accepted_range": {"name": "test_accepted_range", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/accepted_range.sql", "original_file_path": "macros/generic_tests/accepted_range.sql", "unique_id": "macro.dbt_utils.test_accepted_range", "macro_sql": "{% test accepted_range(model, column_name, min_value=none, max_value=none, inclusive=true) %}\n {{ return(adapter.dispatch('test_accepted_range', 'dbt_utils')(model, column_name, min_value, max_value, inclusive)) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_accepted_range"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "column_name", "type": null, "description": ""}, {"name": "min_value", "type": null, "description": ""}, {"name": "max_value", "type": null, "description": ""}, {"name": "inclusive", "type": null, "description": ""}], "created_at": 1789422566.8261817, "supported_languages": null}, "macro.dbt_utils.default__test_accepted_range": {"name": "default__test_accepted_range", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/accepted_range.sql", "original_file_path": "macros/generic_tests/accepted_range.sql", "unique_id": "macro.dbt_utils.default__test_accepted_range", "macro_sql": "{% macro default__test_accepted_range(model, column_name, min_value=none, max_value=none, inclusive=true) %}\n\nwith meet_condition as(\n select *\n from {{ model }}\n),\n\nvalidation_errors as (\n select *\n from meet_condition\n where\n -- never true, defaults to an empty result set. Exists to ensure any combo of the `or` clauses below succeeds\n 1 = 2\n\n {%- if min_value is not none %}\n -- records with a value >= min_value are permitted. The `not` flips this to find records that don't meet the rule.\n or not {{ column_name }} > {{- \"=\" if inclusive }} {{ min_value }}\n {%- endif %}\n\n {%- if max_value is not none %}\n -- records with a value <= max_value are permitted. The `not` flips this to find records that don't meet the rule.\n or not {{ column_name }} < {{- \"=\" if inclusive }} {{ max_value }}\n {%- endif %}\n)\n\nselect *\nfrom validation_errors\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "column_name", "type": null, "description": ""}, {"name": "min_value", "type": null, "description": ""}, {"name": "max_value", "type": null, "description": ""}, {"name": "inclusive", "type": null, "description": ""}], "created_at": 1789422566.8271964, "supported_languages": null}, "macro.dbt_utils.get_url_parameter": {"name": "get_url_parameter", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/web/get_url_parameter.sql", "original_file_path": "macros/web/get_url_parameter.sql", "unique_id": "macro.dbt_utils.get_url_parameter", "macro_sql": "{% macro get_url_parameter(field, url_parameter) -%}\n {{ return(adapter.dispatch('get_url_parameter', 'dbt_utils')(field, url_parameter)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__get_url_parameter"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field", "type": null, "description": ""}, {"name": "url_parameter", "type": null, "description": ""}], "created_at": 1789422566.8278525, "supported_languages": null}, "macro.dbt_utils.default__get_url_parameter": {"name": "default__get_url_parameter", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/web/get_url_parameter.sql", "original_file_path": "macros/web/get_url_parameter.sql", "unique_id": "macro.dbt_utils.default__get_url_parameter", "macro_sql": "{% macro default__get_url_parameter(field, url_parameter) -%}\n\n{%- set formatted_url_parameter = \"'\" + url_parameter + \"='\" -%}\n\n{%- set split = dbt.split_part(dbt.split_part(field, formatted_url_parameter, 2), \"'&'\", 1) -%}\n\nnullif({{ split }},'')\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.split_part"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field", "type": null, "description": ""}, {"name": "url_parameter", "type": null, "description": ""}], "created_at": 1789422566.8285804, "supported_languages": null}, "macro.dbt_utils.get_url_host": {"name": "get_url_host", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/web/get_url_host.sql", "original_file_path": "macros/web/get_url_host.sql", "unique_id": "macro.dbt_utils.get_url_host", "macro_sql": "{% macro get_url_host(field) -%}\n {{ return(adapter.dispatch('get_url_host', 'dbt_utils')(field)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__get_url_host"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field", "type": null, "description": ""}], "created_at": 1789422566.829212, "supported_languages": null}, "macro.dbt_utils.default__get_url_host": {"name": "default__get_url_host", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/web/get_url_host.sql", "original_file_path": "macros/web/get_url_host.sql", "unique_id": "macro.dbt_utils.default__get_url_host", "macro_sql": "{% macro default__get_url_host(field) -%}\n\n{%- set parsed =\n dbt.split_part(\n dbt.split_part(\n dbt.replace(\n dbt.replace(\n dbt.replace(field, \"'android-app://'\", \"''\"\n ), \"'http://'\", \"''\"\n ), \"'https://'\", \"''\"\n ), \"'/'\", 1\n ), \"'?'\", 1\n )\n\n-%}\n\n\n {{ dbt.safe_cast(\n parsed,\n dbt.type_string()\n )}}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.split_part", "macro.dbt.replace", "macro.dbt.safe_cast", "macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field", "type": null, "description": ""}], "created_at": 1789422566.8303456, "supported_languages": null}, "macro.dbt_utils.get_url_path": {"name": "get_url_path", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/web/get_url_path.sql", "original_file_path": "macros/web/get_url_path.sql", "unique_id": "macro.dbt_utils.get_url_path", "macro_sql": "{% macro get_url_path(field) -%}\n {{ return(adapter.dispatch('get_url_path', 'dbt_utils')(field)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__get_url_path"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field", "type": null, "description": ""}], "created_at": 1789422566.831044, "supported_languages": null}, "macro.dbt_utils.default__get_url_path": {"name": "default__get_url_path", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/web/get_url_path.sql", "original_file_path": "macros/web/get_url_path.sql", "unique_id": "macro.dbt_utils.default__get_url_path", "macro_sql": "{% macro default__get_url_path(field) -%}\n\n {%- set stripped_url =\n dbt.replace(\n dbt.replace(field, \"'http://'\", \"''\"), \"'https://'\", \"''\")\n -%}\n\n {%- set first_slash_pos -%}\n coalesce(\n nullif({{ dbt.position(\"'/'\", stripped_url) }}, 0),\n {{ dbt.position(\"'?'\", stripped_url) }} - 1\n )\n {%- endset -%}\n\n {%- set parsed_path =\n dbt.split_part(\n dbt.right(\n stripped_url,\n dbt.length(stripped_url) ~ \"-\" ~ first_slash_pos\n ),\n \"'?'\", 1\n )\n -%}\n\n {{ dbt.safe_cast(\n parsed_path,\n dbt.type_string()\n )}}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.replace", "macro.dbt.position", "macro.dbt.split_part", "macro.dbt.right", "macro.dbt.length", "macro.dbt.safe_cast", "macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field", "type": null, "description": ""}], "created_at": 1789422566.8323634, "supported_languages": null}, "macro.dbt_utils.get_column_values": {"name": "get_column_values", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_column_values.sql", "original_file_path": "macros/sql/get_column_values.sql", "unique_id": "macro.dbt_utils.get_column_values", "macro_sql": "{% macro get_column_values(table, column, order_by='count(*) desc', max_records=none, default=none, where=none) -%}\n {{ return(adapter.dispatch('get_column_values', 'dbt_utils')(table, column, order_by, max_records, default, where)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__get_column_values"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "table", "type": null, "description": ""}, {"name": "column", "type": null, "description": ""}, {"name": "order_by", "type": null, "description": ""}, {"name": "max_records", "type": null, "description": ""}, {"name": "default", "type": null, "description": ""}, {"name": "where", "type": null, "description": ""}], "created_at": 1789422566.8337777, "supported_languages": null}, "macro.dbt_utils.default__get_column_values": {"name": "default__get_column_values", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_column_values.sql", "original_file_path": "macros/sql/get_column_values.sql", "unique_id": "macro.dbt_utils.default__get_column_values", "macro_sql": "{% macro default__get_column_values(table, column, order_by='count(*) desc', max_records=none, default=none, where=none) -%}\n {#-- Prevent querying of db in parsing mode. This works because this macro does not create any new refs. #}\n {%- if not execute -%}\n {% set default = [] if not default %}\n {{ return(default) }}\n {% endif %}\n\n {%- do dbt_utils._is_ephemeral(table, 'get_column_values') -%}\n\n {# Not all relations are tables. Renaming for internal clarity without breaking functionality for anyone using named arguments #}\n {# TODO: Change the method signature in a future 0.x.0 release #}\n {%- set target_relation = table -%}\n\n {# adapter.load_relation is a convenience wrapper to avoid building a Relation when we already have one #}\n {% set relation_exists = (load_relation(target_relation)) is not none %}\n\n {%- call statement('get_column_values', fetch_result=true) %}\n\n {%- if not relation_exists and default is none -%}\n\n {{ exceptions.raise_compiler_error(\"In get_column_values(): relation \" ~ target_relation ~ \" does not exist and no default value was provided.\") }}\n\n {%- elif not relation_exists and default is not none -%}\n\n {{ log(\"Relation \" ~ target_relation ~ \" does not exist. Returning the default value: \" ~ default) }}\n\n {{ return(default) }}\n\n {%- else -%}\n\n\n select\n {{ column }} as value\n\n from {{ target_relation }}\n\n {% if where is not none %}\n where {{ where }}\n {% endif %}\n\n group by {{ column }}\n order by {{ order_by }}\n\n {% if max_records is not none %}\n limit {{ max_records }}\n {% endif %}\n\n {% endif %}\n\n {%- endcall -%}\n\n {%- set value_list = load_result('get_column_values') -%}\n\n {%- if value_list and value_list['data'] -%}\n {%- set values = value_list['data'] | map(attribute=0) | list %}\n {{ return(values) }}\n {%- else -%}\n {{ return(default) }}\n {%- endif -%}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_utils._is_ephemeral", "macro.dbt.load_relation", "macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "table", "type": null, "description": ""}, {"name": "column", "type": null, "description": ""}, {"name": "order_by", "type": null, "description": ""}, {"name": "max_records", "type": null, "description": ""}, {"name": "default", "type": null, "description": ""}, {"name": "where", "type": null, "description": ""}], "created_at": 1789422566.8368983, "supported_languages": null}, "macro.dbt_utils.star": {"name": "star", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/star.sql", "original_file_path": "macros/sql/star.sql", "unique_id": "macro.dbt_utils.star", "macro_sql": "{% macro star(from, relation_alias=False, except=[], prefix='', suffix='', quote_identifiers=True, unquote_aliases=False, rename={}) -%}\r\n {{ return(adapter.dispatch('star', 'dbt_utils')(from, relation_alias, except, prefix, suffix, quote_identifiers, unquote_aliases, rename)) }}\r\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__star"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "from", "type": null, "description": ""}, {"name": "relation_alias", "type": null, "description": ""}, {"name": "except", "type": null, "description": ""}, {"name": "prefix", "type": null, "description": ""}, {"name": "suffix", "type": null, "description": ""}, {"name": "quote_identifiers", "type": null, "description": ""}, {"name": "unquote_aliases", "type": null, "description": ""}, {"name": "rename", "type": null, "description": ""}], "created_at": 1789422566.8386836, "supported_languages": null}, "macro.dbt_utils.default__star": {"name": "default__star", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/star.sql", "original_file_path": "macros/sql/star.sql", "unique_id": "macro.dbt_utils.default__star", "macro_sql": "{% macro default__star(from, relation_alias=False, except=[], prefix='', suffix='', quote_identifiers=True, unquote_aliases=False, rename={}) -%}\r\n {%- do dbt_utils._is_relation(from, 'star') -%}\r\n {%- do dbt_utils._is_ephemeral(from, 'star') -%}\r\n\r\n {#-- Prevent querying of db in parsing mode. This works because this macro does not create any new refs. #}\r\n {%- if not execute -%}\r\n {% do return('*') %}\r\n {%- endif -%}\r\n\r\n {% set cols = dbt_utils.get_filtered_columns_in_relation(from, except) %}\r\n\r\n {%- set rename_lower = {} -%}\r\n {%- for key, val in rename.items() -%}\r\n {%- do rename_lower.update({key.lower(): val}) -%}\r\n {%- endfor -%}\r\n\r\n {%- if cols|length <= 0 -%}\r\n {% if flags.WHICH == 'compile' %}\r\n {% set response %}\r\n*\r\n/* No columns were returned. Maybe the relation doesn't exist yet\r\nor all columns were excluded. This star is only output during\r\ndbt compile, and exists to keep SQLFluff happy. */\r\n {% endset %}\r\n {% do return(response) %}\r\n {% else %}\r\n {% do return(\"/* no columns returned from star() macro */\") %}\r\n {% endif %}\r\n {%- else -%}\r\n {%- for col in cols %}\r\n {%- if relation_alias %}{{ relation_alias }}.{% else %}{%- endif -%}\r\n {%- if quote_identifiers -%}\r\n {{ adapter.quote(col)|trim }}\r\n {%- if col.lower() in rename_lower %} as {{ rename_lower[col.lower()] }}\r\n {%- elif unquote_aliases %} as {{ (prefix ~ col ~ suffix)|trim }}\r\n {%- elif prefix!='' or suffix!='' %} as {{ adapter.quote(prefix ~ col ~ suffix)|trim }}\r\n {%- endif -%}\r\n {%- else -%}\r\n {{ col|trim }}\r\n {%- if col.lower() in rename_lower %} as {{ rename_lower[col.lower()] }}\r\n {%- elif prefix!='' or suffix!='' %} as {{ (prefix ~ col ~ suffix)|trim }}\r\n {%- endif -%}\r\n {%- endif -%}\r\n {%- if not loop.last %},{{ '\\n ' }}{%- endif -%}\r\n {%- endfor -%}\r\n {% endif %}\r\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_utils._is_relation", "macro.dbt_utils._is_ephemeral", "macro.dbt_utils.get_filtered_columns_in_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "from", "type": null, "description": ""}, {"name": "relation_alias", "type": null, "description": ""}, {"name": "except", "type": null, "description": ""}, {"name": "prefix", "type": null, "description": ""}, {"name": "suffix", "type": null, "description": ""}, {"name": "quote_identifiers", "type": null, "description": ""}, {"name": "unquote_aliases", "type": null, "description": ""}, {"name": "rename", "type": null, "description": ""}], "created_at": 1789422566.8429065, "supported_languages": null}, "macro.dbt_utils.get_table_types_sql": {"name": "get_table_types_sql", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_table_types_sql.sql", "original_file_path": "macros/sql/get_table_types_sql.sql", "unique_id": "macro.dbt_utils.get_table_types_sql", "macro_sql": "{%- macro get_table_types_sql() -%}\n {{ return(adapter.dispatch('get_table_types_sql', 'dbt_utils')()) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt_utils.postgres__get_table_types_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789422566.8436716, "supported_languages": null}, "macro.dbt_utils.default__get_table_types_sql": {"name": "default__get_table_types_sql", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_table_types_sql.sql", "original_file_path": "macros/sql/get_table_types_sql.sql", "unique_id": "macro.dbt_utils.default__get_table_types_sql", "macro_sql": "{% macro default__get_table_types_sql() %}\n case table_type\n when 'BASE TABLE' then 'table'\n when 'EXTERNAL TABLE' then 'external'\n when 'MATERIALIZED VIEW' then 'materializedview'\n else lower(table_type)\n end as {{ adapter.quote('table_type') }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789422566.8439841, "supported_languages": null}, "macro.dbt_utils.postgres__get_table_types_sql": {"name": "postgres__get_table_types_sql", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_table_types_sql.sql", "original_file_path": "macros/sql/get_table_types_sql.sql", "unique_id": "macro.dbt_utils.postgres__get_table_types_sql", "macro_sql": "{% macro postgres__get_table_types_sql() %}\n case table_type\n when 'BASE TABLE' then 'table'\n when 'FOREIGN' then 'external'\n when 'MATERIALIZED VIEW' then 'materializedview'\n else lower(table_type)\n end as {{ adapter.quote('table_type') }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789422566.8442814, "supported_languages": null}, "macro.dbt_utils.databricks__get_table_types_sql": {"name": "databricks__get_table_types_sql", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_table_types_sql.sql", "original_file_path": "macros/sql/get_table_types_sql.sql", "unique_id": "macro.dbt_utils.databricks__get_table_types_sql", "macro_sql": "{% macro databricks__get_table_types_sql() %}\n case table_type\n when 'MANAGED' then 'table'\n when 'BASE TABLE' then 'table'\n when 'MATERIALIZED VIEW' then 'materializedview'\n else lower(table_type)\n end as {{ adapter.quote('table_type') }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789422566.8445983, "supported_languages": null}, "macro.dbt_utils.get_tables_by_pattern_sql": {"name": "get_tables_by_pattern_sql", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_tables_by_pattern_sql.sql", "original_file_path": "macros/sql/get_tables_by_pattern_sql.sql", "unique_id": "macro.dbt_utils.get_tables_by_pattern_sql", "macro_sql": "{% macro get_tables_by_pattern_sql(schema_pattern, table_pattern, exclude='', database=target.database) %}\n {{ return(adapter.dispatch('get_tables_by_pattern_sql', 'dbt_utils')\n (schema_pattern, table_pattern, exclude, database)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__get_tables_by_pattern_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "schema_pattern", "type": null, "description": ""}, {"name": "table_pattern", "type": null, "description": ""}, {"name": "exclude", "type": null, "description": ""}, {"name": "database", "type": null, "description": ""}], "created_at": 1789422566.8461683, "supported_languages": null}, "macro.dbt_utils.default__get_tables_by_pattern_sql": {"name": "default__get_tables_by_pattern_sql", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_tables_by_pattern_sql.sql", "original_file_path": "macros/sql/get_tables_by_pattern_sql.sql", "unique_id": "macro.dbt_utils.default__get_tables_by_pattern_sql", "macro_sql": "{% macro default__get_tables_by_pattern_sql(schema_pattern, table_pattern, exclude='', database=target.database) %}\n\n select distinct\n table_schema as {{ adapter.quote('table_schema') }},\n table_name as {{ adapter.quote('table_name') }},\n {{ dbt_utils.get_table_types_sql() }}\n from {{ database }}.information_schema.tables\n where table_schema ilike '{{ schema_pattern }}'\n and table_name ilike '{{ table_pattern }}'\n and table_name not ilike '{{ exclude }}'\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.get_table_types_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "schema_pattern", "type": null, "description": ""}, {"name": "table_pattern", "type": null, "description": ""}, {"name": "exclude", "type": null, "description": ""}, {"name": "database", "type": null, "description": ""}], "created_at": 1789422566.8470151, "supported_languages": null}, "macro.dbt_utils.redshift__get_tables_by_pattern_sql": {"name": "redshift__get_tables_by_pattern_sql", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_tables_by_pattern_sql.sql", "original_file_path": "macros/sql/get_tables_by_pattern_sql.sql", "unique_id": "macro.dbt_utils.redshift__get_tables_by_pattern_sql", "macro_sql": "{% macro redshift__get_tables_by_pattern_sql(schema_pattern, table_pattern, exclude='', database=target.database) %}\n\n {% set sql %}\n select distinct\n table_schema as {{ adapter.quote('table_schema') }},\n table_name as {{ adapter.quote('table_name') }},\n {{ dbt_utils.get_table_types_sql() }}\n from \"{{ database }}\".\"information_schema\".\"tables\"\n where table_schema ilike '{{ schema_pattern }}'\n and table_name ilike '{{ table_pattern }}'\n and table_name not ilike '{{ exclude }}'\n union all\n select distinct\n schemaname as {{ adapter.quote('table_schema') }},\n tablename as {{ adapter.quote('table_name') }},\n 'external' as {{ adapter.quote('table_type') }}\n from svv_external_tables\n where redshift_database_name = '{{ database }}'\n and schemaname ilike '{{ schema_pattern }}'\n and table_name ilike '{{ table_pattern }}'\n and table_name not ilike '{{ exclude }}'\n {% endset %}\n\n {{ return(sql) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.get_table_types_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "schema_pattern", "type": null, "description": ""}, {"name": "table_pattern", "type": null, "description": ""}, {"name": "exclude", "type": null, "description": ""}, {"name": "database", "type": null, "description": ""}], "created_at": 1789422566.8484142, "supported_languages": null}, "macro.dbt_utils.bigquery__get_tables_by_pattern_sql": {"name": "bigquery__get_tables_by_pattern_sql", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_tables_by_pattern_sql.sql", "original_file_path": "macros/sql/get_tables_by_pattern_sql.sql", "unique_id": "macro.dbt_utils.bigquery__get_tables_by_pattern_sql", "macro_sql": "{% macro bigquery__get_tables_by_pattern_sql(schema_pattern, table_pattern, exclude='', database=target.database) %}\n\n {% if '%' in schema_pattern %}\n {% set schemata=dbt_utils._bigquery__get_matching_schemata(schema_pattern, database) %}\n {% else %}\n {% set schemata=[schema_pattern] %}\n {% endif %}\n\n {% set sql %}\n {% for schema in schemata %}\n select distinct\n table_schema,\n table_name,\n {{ dbt_utils.get_table_types_sql() }}\n\n from {{ adapter.quote(database) }}.{{ schema }}.INFORMATION_SCHEMA.TABLES\n where lower(table_name) like lower ('{{ table_pattern }}')\n and lower(table_name) not like lower ('{{ exclude }}')\n\n {% if not loop.last %} union all {% endif %}\n\n {% endfor %}\n {% endset %}\n\n {{ return(sql) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils._bigquery__get_matching_schemata", "macro.dbt_utils.get_table_types_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "schema_pattern", "type": null, "description": ""}, {"name": "table_pattern", "type": null, "description": ""}, {"name": "exclude", "type": null, "description": ""}, {"name": "database", "type": null, "description": ""}], "created_at": 1789422566.849924, "supported_languages": null}, "macro.dbt_utils._bigquery__get_matching_schemata": {"name": "_bigquery__get_matching_schemata", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_tables_by_pattern_sql.sql", "original_file_path": "macros/sql/get_tables_by_pattern_sql.sql", "unique_id": "macro.dbt_utils._bigquery__get_matching_schemata", "macro_sql": "{% macro _bigquery__get_matching_schemata(schema_pattern, database) %}\n {% if execute %}\n\n {% set sql %}\n select schema_name from {{ adapter.quote(database) }}.INFORMATION_SCHEMA.SCHEMATA\n where lower(schema_name) like lower('{{ schema_pattern }}')\n {% endset %}\n\n {% set results=run_query(sql) %}\n\n {% set schemata=results.columns['schema_name'].values() %}\n\n {{ return(schemata) }}\n\n {% else %}\n\n {{ return([]) }}\n\n {% endif %}\n\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "schema_pattern", "type": null, "description": ""}, {"name": "database", "type": null, "description": ""}], "created_at": 1789422566.8509758, "supported_languages": null}, "macro.dbt_utils.get_tables_by_prefix_sql": {"name": "get_tables_by_prefix_sql", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_tables_by_prefix_sql.sql", "original_file_path": "macros/sql/get_tables_by_prefix_sql.sql", "unique_id": "macro.dbt_utils.get_tables_by_prefix_sql", "macro_sql": "{% macro get_tables_by_prefix_sql(schema, prefix, exclude='', database=target.database) %}\n {{ return(adapter.dispatch('get_tables_by_prefix_sql', 'dbt_utils')(schema, prefix, exclude, database)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__get_tables_by_prefix_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "schema", "type": null, "description": ""}, {"name": "prefix", "type": null, "description": ""}, {"name": "exclude", "type": null, "description": ""}, {"name": "database", "type": null, "description": ""}], "created_at": 1789422566.8518112, "supported_languages": null}, "macro.dbt_utils.default__get_tables_by_prefix_sql": {"name": "default__get_tables_by_prefix_sql", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_tables_by_prefix_sql.sql", "original_file_path": "macros/sql/get_tables_by_prefix_sql.sql", "unique_id": "macro.dbt_utils.default__get_tables_by_prefix_sql", "macro_sql": "{% macro default__get_tables_by_prefix_sql(schema, prefix, exclude='', database=target.database) %}\n\n {{ dbt_utils.get_tables_by_pattern_sql(\n schema_pattern = schema,\n table_pattern = prefix ~ '%',\n exclude = exclude,\n database = database\n ) }}\n \n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.get_tables_by_pattern_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "schema", "type": null, "description": ""}, {"name": "prefix", "type": null, "description": ""}, {"name": "exclude", "type": null, "description": ""}, {"name": "database", "type": null, "description": ""}], "created_at": 1789422566.852389, "supported_languages": null}, "macro.dbt_utils.degrees_to_radians": {"name": "degrees_to_radians", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/haversine_distance.sql", "original_file_path": "macros/sql/haversine_distance.sql", "unique_id": "macro.dbt_utils.degrees_to_radians", "macro_sql": "{% macro degrees_to_radians(degrees) -%}\n acos(-1) * {{degrees}} / 180\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "degrees", "type": null, "description": ""}], "created_at": 1789422566.8532808, "supported_languages": null}, "macro.dbt_utils.haversine_distance": {"name": "haversine_distance", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/haversine_distance.sql", "original_file_path": "macros/sql/haversine_distance.sql", "unique_id": "macro.dbt_utils.haversine_distance", "macro_sql": "{% macro haversine_distance(lat1, lon1, lat2, lon2, unit='mi') -%}\n {{ return(adapter.dispatch('haversine_distance', 'dbt_utils')(lat1,lon1,lat2,lon2,unit)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__haversine_distance"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "lat1", "type": null, "description": ""}, {"name": "lon1", "type": null, "description": ""}, {"name": "lat2", "type": null, "description": ""}, {"name": "lon2", "type": null, "description": ""}, {"name": "unit", "type": null, "description": ""}], "created_at": 1789422566.8538573, "supported_languages": null}, "macro.dbt_utils.default__haversine_distance": {"name": "default__haversine_distance", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/haversine_distance.sql", "original_file_path": "macros/sql/haversine_distance.sql", "unique_id": "macro.dbt_utils.default__haversine_distance", "macro_sql": "{% macro default__haversine_distance(lat1, lon1, lat2, lon2, unit='mi') -%}\n{%- if unit == 'mi' %}\n {% set conversion_rate = 1 %}\n{% elif unit == 'km' %}\n {% set conversion_rate = 1.60934 %}\n{% else %}\n {{ exceptions.raise_compiler_error(\"unit input must be one of 'mi' or 'km'. Got \" ~ unit) }}\n{% endif %}\n\n 2 * 3961 * asin(sqrt(power((sin(radians(({{ lat2 }} - {{ lat1 }}) / 2))), 2) +\n cos(radians({{lat1}})) * cos(radians({{lat2}})) *\n power((sin(radians(({{ lon2 }} - {{ lon1 }}) / 2))), 2))) * {{ conversion_rate }}\n\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "lat1", "type": null, "description": ""}, {"name": "lon1", "type": null, "description": ""}, {"name": "lat2", "type": null, "description": ""}, {"name": "lon2", "type": null, "description": ""}, {"name": "unit", "type": null, "description": ""}], "created_at": 1789422566.855184, "supported_languages": null}, "macro.dbt_utils.bigquery__haversine_distance": {"name": "bigquery__haversine_distance", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/haversine_distance.sql", "original_file_path": "macros/sql/haversine_distance.sql", "unique_id": "macro.dbt_utils.bigquery__haversine_distance", "macro_sql": "{% macro bigquery__haversine_distance(lat1, lon1, lat2, lon2, unit='mi') -%}\n{% set radians_lat1 = dbt_utils.degrees_to_radians(lat1) %}\n{% set radians_lat2 = dbt_utils.degrees_to_radians(lat2) %}\n{% set radians_lon1 = dbt_utils.degrees_to_radians(lon1) %}\n{% set radians_lon2 = dbt_utils.degrees_to_radians(lon2) %}\n{%- if unit == 'mi' %}\n {% set conversion_rate = 1 %}\n{% elif unit == 'km' %}\n {% set conversion_rate = 1.60934 %}\n{% else %}\n {{ exceptions.raise_compiler_error(\"unit input must be one of 'mi' or 'km'. Got \" ~ unit) }}\n{% endif %}\n 2 * 3961 * asin(sqrt(power(sin(({{ radians_lat2 }} - {{ radians_lat1 }}) / 2), 2) +\n cos({{ radians_lat1 }}) * cos({{ radians_lat2 }}) *\n power(sin(({{ radians_lon2 }} - {{ radians_lon1 }}) / 2), 2))) * {{ conversion_rate }}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.degrees_to_radians"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "lat1", "type": null, "description": ""}, {"name": "lon1", "type": null, "description": ""}, {"name": "lat2", "type": null, "description": ""}, {"name": "lon2", "type": null, "description": ""}, {"name": "unit", "type": null, "description": ""}], "created_at": 1789422566.8568597, "supported_languages": null}, "macro.dbt_utils.get_powers_of_two": {"name": "get_powers_of_two", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/generate_series.sql", "original_file_path": "macros/sql/generate_series.sql", "unique_id": "macro.dbt_utils.get_powers_of_two", "macro_sql": "{% macro get_powers_of_two(upper_bound) %}\n {{ return(adapter.dispatch('get_powers_of_two', 'dbt_utils')(upper_bound)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__get_powers_of_two"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "upper_bound", "type": null, "description": ""}], "created_at": 1789422566.857796, "supported_languages": null}, "macro.dbt_utils.default__get_powers_of_two": {"name": "default__get_powers_of_two", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/generate_series.sql", "original_file_path": "macros/sql/generate_series.sql", "unique_id": "macro.dbt_utils.default__get_powers_of_two", "macro_sql": "{% macro default__get_powers_of_two(upper_bound) %}\n\n {% if upper_bound <= 0 %}\n {{ exceptions.raise_compiler_error(\"upper bound must be positive\") }}\n {% endif %}\n\n {% for _ in range(1, 100) %}\n {% if upper_bound <= 2 ** loop.index %}{{ return(loop.index) }}{% endif %}\n {% endfor %}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "upper_bound", "type": null, "description": ""}], "created_at": 1789422566.8586578, "supported_languages": null}, "macro.dbt_utils.generate_series": {"name": "generate_series", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/generate_series.sql", "original_file_path": "macros/sql/generate_series.sql", "unique_id": "macro.dbt_utils.generate_series", "macro_sql": "{% macro generate_series(upper_bound) %}\n {{ return(adapter.dispatch('generate_series', 'dbt_utils')(upper_bound)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__generate_series"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "upper_bound", "type": null, "description": ""}], "created_at": 1789422566.859045, "supported_languages": null}, "macro.dbt_utils.default__generate_series": {"name": "default__generate_series", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/generate_series.sql", "original_file_path": "macros/sql/generate_series.sql", "unique_id": "macro.dbt_utils.default__generate_series", "macro_sql": "{% macro default__generate_series(upper_bound) %}\n\n {% set n = dbt_utils.get_powers_of_two(upper_bound) %}\n\n with p as (\n select 0 as generated_number union all select 1\n ), unioned as (\n\n select\n\n {% for i in range(n) %}\n p{{i}}.generated_number * power(2, {{i}})\n {% if not loop.last %} + {% endif %}\n {% endfor %}\n + 1\n as generated_number\n\n from\n\n {% for i in range(n) %}\n p as p{{i}}\n {% if not loop.last %} cross join {% endif %}\n {% endfor %}\n\n )\n\n select *\n from unioned\n where generated_number <= {{upper_bound}}\n order by generated_number\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.get_powers_of_two"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "upper_bound", "type": null, "description": ""}], "created_at": 1789422566.860126, "supported_languages": null}, "macro.dbt_utils.safe_subtract": {"name": "safe_subtract", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/safe_subtract.sql", "original_file_path": "macros/sql/safe_subtract.sql", "unique_id": "macro.dbt_utils.safe_subtract", "macro_sql": "{%- macro safe_subtract(field_list) -%}\n {{ return(adapter.dispatch('safe_subtract', 'dbt_utils')(field_list)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__safe_subtract"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field_list", "type": null, "description": ""}], "created_at": 1789422566.8608294, "supported_languages": null}, "macro.dbt_utils.default__safe_subtract": {"name": "default__safe_subtract", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/safe_subtract.sql", "original_file_path": "macros/sql/safe_subtract.sql", "unique_id": "macro.dbt_utils.default__safe_subtract", "macro_sql": "\n\n{%- macro default__safe_subtract(field_list) -%}\n\n{%- if field_list is not iterable or field_list is string or field_list is mapping -%}\n\n{%- set error_message = '\nWarning: the `safe_subtract` macro takes a single list argument instead of \\\nstring arguments. The {}.{} model triggered this warning. \\\n'.format(model.package_name, model.name) -%}\n\n{%- do exceptions.raise_compiler_error(error_message) -%}\n\n{%- endif -%}\n\n{% set fields = [] %}\n\n{%- for field in field_list -%}\n\n {% do fields.append(\"coalesce(\" ~ field ~ \", 0)\") %}\n\n{%- endfor -%}\n\n{{ fields|join(' -\\n ') }}\n\n{%- endmacro -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field_list", "type": null, "description": ""}], "created_at": 1789422566.8619585, "supported_languages": null}, "macro.dbt_utils.deduplicate": {"name": "deduplicate", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/deduplicate.sql", "original_file_path": "macros/sql/deduplicate.sql", "unique_id": "macro.dbt_utils.deduplicate", "macro_sql": "{%- macro deduplicate(relation, partition_by, order_by) -%}\n {{ return(adapter.dispatch('deduplicate', 'dbt_utils')(relation, partition_by, order_by)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.postgres__deduplicate"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "partition_by", "type": null, "description": ""}, {"name": "order_by", "type": null, "description": ""}], "created_at": 1789422566.8630905, "supported_languages": null}, "macro.dbt_utils.default__deduplicate": {"name": "default__deduplicate", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/deduplicate.sql", "original_file_path": "macros/sql/deduplicate.sql", "unique_id": "macro.dbt_utils.default__deduplicate", "macro_sql": "\n\n{%- macro default__deduplicate(relation, partition_by, order_by) -%}\n\n with row_numbered as (\n select\n _inner.*,\n row_number() over (\n partition by {{ partition_by }}\n order by {{ order_by }}\n ) as rn\n from {{ relation }} as _inner\n )\n\n select\n distinct data.*\n from {{ relation }} as data\n {#\n -- Not all DBs will support natural joins but the ones that do include:\n -- Oracle, MySQL, SQLite, Redshift, Teradata, Materialize, Databricks\n -- Apache Spark, SingleStore, Vertica\n -- Those that do not appear to support natural joins include:\n -- SQLServer, Trino, Presto, Rockset, Athena\n #}\n natural join row_numbered\n where row_numbered.rn = 1\n\n{%- endmacro -%}\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "partition_by", "type": null, "description": ""}, {"name": "order_by", "type": null, "description": ""}], "created_at": 1789422566.863553, "supported_languages": null}, "macro.dbt_utils.redshift__deduplicate": {"name": "redshift__deduplicate", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/deduplicate.sql", "original_file_path": "macros/sql/deduplicate.sql", "unique_id": "macro.dbt_utils.redshift__deduplicate", "macro_sql": "{% macro redshift__deduplicate(relation, partition_by, order_by) -%}\n\n select *\n from {{ relation }} as tt\n qualify\n row_number() over (\n partition by {{ partition_by }}\n order by {{ order_by }}\n ) = 1\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "partition_by", "type": null, "description": ""}, {"name": "order_by", "type": null, "description": ""}], "created_at": 1789422566.8639166, "supported_languages": null}, "macro.dbt_utils.postgres__deduplicate": {"name": "postgres__deduplicate", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/deduplicate.sql", "original_file_path": "macros/sql/deduplicate.sql", "unique_id": "macro.dbt_utils.postgres__deduplicate", "macro_sql": "\n{%- macro postgres__deduplicate(relation, partition_by, order_by) -%}\n\n select\n distinct on ({{ partition_by }}) *\n from {{ relation }}\n order by {{ partition_by }}{{ ',' ~ order_by }}\n\n{%- endmacro -%}\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "partition_by", "type": null, "description": ""}, {"name": "order_by", "type": null, "description": ""}], "created_at": 1789422566.8643167, "supported_languages": null}, "macro.dbt_utils.snowflake__deduplicate": {"name": "snowflake__deduplicate", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/deduplicate.sql", "original_file_path": "macros/sql/deduplicate.sql", "unique_id": "macro.dbt_utils.snowflake__deduplicate", "macro_sql": "\n{%- macro snowflake__deduplicate(relation, partition_by, order_by) -%}\n\n select *\n from {{ relation }}\n qualify\n row_number() over (\n partition by {{ partition_by }}\n order by {{ order_by }}\n ) = 1\n\n{%- endmacro -%}\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "partition_by", "type": null, "description": ""}, {"name": "order_by", "type": null, "description": ""}], "created_at": 1789422566.864695, "supported_languages": null}, "macro.dbt_utils.databricks__deduplicate": {"name": "databricks__deduplicate", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/deduplicate.sql", "original_file_path": "macros/sql/deduplicate.sql", "unique_id": "macro.dbt_utils.databricks__deduplicate", "macro_sql": "\n{%- macro databricks__deduplicate(relation, partition_by, order_by) -%}\n\n select *\n from {{ relation }}\n qualify\n row_number() over (\n partition by {{ partition_by }}\n order by {{ order_by }}\n ) = 1\n\n{%- endmacro -%}\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "partition_by", "type": null, "description": ""}, {"name": "order_by", "type": null, "description": ""}], "created_at": 1789422566.8650415, "supported_languages": null}, "macro.dbt_utils.bigquery__deduplicate": {"name": "bigquery__deduplicate", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/deduplicate.sql", "original_file_path": "macros/sql/deduplicate.sql", "unique_id": "macro.dbt_utils.bigquery__deduplicate", "macro_sql": "\n{%- macro bigquery__deduplicate(relation, partition_by, order_by) -%}\n\n select unique.*\n from (\n select\n array_agg (\n original\n order by {{ order_by }}\n limit 1\n )[offset(0)] unique\n from {{ relation }} original\n group by {{ partition_by }}\n )\n\n{%- endmacro -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "partition_by", "type": null, "description": ""}, {"name": "order_by", "type": null, "description": ""}], "created_at": 1789422566.8653922, "supported_languages": null}, "macro.dbt_utils.generate_surrogate_key": {"name": "generate_surrogate_key", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/generate_surrogate_key.sql", "original_file_path": "macros/sql/generate_surrogate_key.sql", "unique_id": "macro.dbt_utils.generate_surrogate_key", "macro_sql": "{%- macro generate_surrogate_key(field_list) -%}\n {{ return(adapter.dispatch('generate_surrogate_key', 'dbt_utils')(field_list)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__generate_surrogate_key"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field_list", "type": null, "description": ""}], "created_at": 1789422566.8661597, "supported_languages": null}, "macro.dbt_utils.default__generate_surrogate_key": {"name": "default__generate_surrogate_key", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/generate_surrogate_key.sql", "original_file_path": "macros/sql/generate_surrogate_key.sql", "unique_id": "macro.dbt_utils.default__generate_surrogate_key", "macro_sql": "\n\n{%- macro default__generate_surrogate_key(field_list) -%}\n\n{%- if var('surrogate_key_treat_nulls_as_empty_strings', False) -%}\n {%- set default_null_value = \"\" -%}\n{%- else -%}\n {%- set default_null_value = '_dbt_utils_surrogate_key_null_' -%}\n{%- endif -%}\n\n{%- set fields = [] -%}\n\n{%- for field in field_list -%}\n\n {%- do fields.append(\n \"coalesce(cast(\" ~ field ~ \" as \" ~ dbt.type_string() ~ \"), '\" ~ default_null_value ~\"')\"\n ) -%}\n\n {%- if not loop.last %}\n {%- do fields.append(\"'-'\") -%}\n {%- endif -%}\n\n{%- endfor -%}\n\n{{ dbt.hash(dbt.concat(fields)) }}\n\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt.type_string", "macro.dbt.hash", "macro.dbt.concat"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field_list", "type": null, "description": ""}], "created_at": 1789422566.867667, "supported_languages": null}, "macro.dbt_utils.pivot": {"name": "pivot", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/pivot.sql", "original_file_path": "macros/sql/pivot.sql", "unique_id": "macro.dbt_utils.pivot", "macro_sql": "{% macro pivot(column,\n values,\n alias=True,\n agg='sum',\n cmp='=',\n prefix='',\n suffix='',\n then_value=1,\n else_value=0,\n quote_identifiers=True,\n distinct=False) %}\n {{ return(adapter.dispatch('pivot', 'dbt_utils')(column, values, alias, agg, cmp, prefix, suffix, then_value, else_value, quote_identifiers, distinct)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__pivot"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "column", "type": null, "description": ""}, {"name": "values", "type": null, "description": ""}, {"name": "alias", "type": null, "description": ""}, {"name": "agg", "type": null, "description": ""}, {"name": "cmp", "type": null, "description": ""}, {"name": "prefix", "type": null, "description": ""}, {"name": "suffix", "type": null, "description": ""}, {"name": "then_value", "type": null, "description": ""}, {"name": "else_value", "type": null, "description": ""}, {"name": "quote_identifiers", "type": null, "description": ""}, {"name": "distinct", "type": null, "description": ""}], "created_at": 1789422566.8692465, "supported_languages": null}, "macro.dbt_utils.default__pivot": {"name": "default__pivot", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/pivot.sql", "original_file_path": "macros/sql/pivot.sql", "unique_id": "macro.dbt_utils.default__pivot", "macro_sql": "{% macro default__pivot(column,\n values,\n alias=True,\n agg='sum',\n cmp='=',\n prefix='',\n suffix='',\n then_value=1,\n else_value=0,\n quote_identifiers=True,\n distinct=False) %}\n {% for value in values %}\n {{ agg }}(\n {% if distinct %} distinct {% endif %}\n case\n when {{ column }} {{ cmp }} '{{ dbt.escape_single_quotes(value) }}'\n then {{ then_value }}\n else {{ else_value }}\n end\n )\n {% if alias %}\n {% if quote_identifiers %}\n as {{ adapter.quote(prefix ~ value ~ suffix) }}\n {% else %}\n as {{ dbt_utils.slugify(prefix ~ value ~ suffix) }}\n {% endif %}\n {% endif %}\n {% if not loop.last %},{% endif %}\n {% endfor %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.escape_single_quotes", "macro.dbt_utils.slugify"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "column", "type": null, "description": ""}, {"name": "values", "type": null, "description": ""}, {"name": "alias", "type": null, "description": ""}, {"name": "agg", "type": null, "description": ""}, {"name": "cmp", "type": null, "description": ""}, {"name": "prefix", "type": null, "description": ""}, {"name": "suffix", "type": null, "description": ""}, {"name": "then_value", "type": null, "description": ""}, {"name": "else_value", "type": null, "description": ""}, {"name": "quote_identifiers", "type": null, "description": ""}, {"name": "distinct", "type": null, "description": ""}], "created_at": 1789422566.870989, "supported_languages": null}, "macro.dbt_utils.nullcheck_table": {"name": "nullcheck_table", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/nullcheck_table.sql", "original_file_path": "macros/sql/nullcheck_table.sql", "unique_id": "macro.dbt_utils.nullcheck_table", "macro_sql": "{% macro nullcheck_table(relation) %}\n {{ return(adapter.dispatch('nullcheck_table', 'dbt_utils')(relation)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__nullcheck_table"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789422566.8716378, "supported_languages": null}, "macro.dbt_utils.default__nullcheck_table": {"name": "default__nullcheck_table", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/nullcheck_table.sql", "original_file_path": "macros/sql/nullcheck_table.sql", "unique_id": "macro.dbt_utils.default__nullcheck_table", "macro_sql": "{% macro default__nullcheck_table(relation) %}\n\n {%- do dbt_utils._is_relation(relation, 'nullcheck_table') -%}\n {%- do dbt_utils._is_ephemeral(relation, 'nullcheck_table') -%}\n {% set cols = adapter.get_columns_in_relation(relation) %}\n\n select {{ dbt_utils.nullcheck(cols) }}\n from {{relation}}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils._is_relation", "macro.dbt_utils._is_ephemeral", "macro.dbt_utils.nullcheck"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789422566.8723376, "supported_languages": null}, "macro.dbt_utils.get_relations_by_pattern": {"name": "get_relations_by_pattern", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_relations_by_pattern.sql", "original_file_path": "macros/sql/get_relations_by_pattern.sql", "unique_id": "macro.dbt_utils.get_relations_by_pattern", "macro_sql": "{% macro get_relations_by_pattern(schema_pattern, table_pattern, exclude='', database=target.database) %}\n {{ return(adapter.dispatch('get_relations_by_pattern', 'dbt_utils')(schema_pattern, table_pattern, exclude, database)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__get_relations_by_pattern"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "schema_pattern", "type": null, "description": ""}, {"name": "table_pattern", "type": null, "description": ""}, {"name": "exclude", "type": null, "description": ""}, {"name": "database", "type": null, "description": ""}], "created_at": 1789422566.8732865, "supported_languages": null}, "macro.dbt_utils.default__get_relations_by_pattern": {"name": "default__get_relations_by_pattern", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_relations_by_pattern.sql", "original_file_path": "macros/sql/get_relations_by_pattern.sql", "unique_id": "macro.dbt_utils.default__get_relations_by_pattern", "macro_sql": "{% macro default__get_relations_by_pattern(schema_pattern, table_pattern, exclude='', database=target.database) %}\n\n {%- call statement('get_tables', fetch_result=True) %}\n\n {{ dbt_utils.get_tables_by_pattern_sql(schema_pattern, table_pattern, exclude, database) }}\n\n {%- endcall -%}\n\n {%- set table_list = load_result('get_tables') -%}\n\n {%- if table_list and table_list['table'] -%}\n {%- set tbl_relations = [] -%}\n {%- for row in table_list['table'] -%}\n {%- set tbl_relation = api.Relation.create(\n database=database,\n schema=row.table_schema,\n identifier=row.table_name,\n type=row.table_type\n ) -%}\n {%- do tbl_relations.append(tbl_relation) -%}\n {%- endfor -%}\n\n {{ return(tbl_relations) }}\n {%- else -%}\n {{ return([]) }}\n {%- endif -%}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement", "macro.dbt_utils.get_tables_by_pattern_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "schema_pattern", "type": null, "description": ""}, {"name": "table_pattern", "type": null, "description": ""}, {"name": "exclude", "type": null, "description": ""}, {"name": "database", "type": null, "description": ""}], "created_at": 1789422566.8750427, "supported_languages": null}, "macro.dbt_utils.get_query_results_as_dict": {"name": "get_query_results_as_dict", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_query_results_as_dict.sql", "original_file_path": "macros/sql/get_query_results_as_dict.sql", "unique_id": "macro.dbt_utils.get_query_results_as_dict", "macro_sql": "{% macro get_query_results_as_dict(query) %}\n {{ return(adapter.dispatch('get_query_results_as_dict', 'dbt_utils')(query)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__get_query_results_as_dict"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "query", "type": null, "description": ""}], "created_at": 1789422566.8757565, "supported_languages": null}, "macro.dbt_utils.default__get_query_results_as_dict": {"name": "default__get_query_results_as_dict", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_query_results_as_dict.sql", "original_file_path": "macros/sql/get_query_results_as_dict.sql", "unique_id": "macro.dbt_utils.default__get_query_results_as_dict", "macro_sql": "{% macro default__get_query_results_as_dict(query) %}\n\n{# This macro returns a dictionary of the form {column_name: (tuple_of_results)} #}\n\n {%- call statement('get_query_results', fetch_result=True,auto_begin=false) -%}\n\n {{ query }}\n\n {%- endcall -%}\n\n {% set sql_results={} %}\n\n {%- if execute -%}\n {% set sql_results_table = load_result('get_query_results').table.columns %}\n {% for column_name, column in sql_results_table.items() %}\n {% do sql_results.update({column_name: column.values()}) %}\n {% endfor %}\n {%- endif -%}\n\n {{ return(sql_results) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "query", "type": null, "description": ""}], "created_at": 1789422566.8769526, "supported_languages": null}, "macro.dbt_utils.union_relations": {"name": "union_relations", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/union.sql", "original_file_path": "macros/sql/union.sql", "unique_id": "macro.dbt_utils.union_relations", "macro_sql": "{%- macro union_relations(relations, column_override=none, include=[], exclude=[], source_column_name='_dbt_source_relation', where=none) -%}\n {{ return(adapter.dispatch('union_relations', 'dbt_utils')(relations, column_override, include, exclude, source_column_name, where)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__union_relations"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relations", "type": null, "description": ""}, {"name": "column_override", "type": null, "description": ""}, {"name": "include", "type": null, "description": ""}, {"name": "exclude", "type": null, "description": ""}, {"name": "source_column_name", "type": null, "description": ""}, {"name": "where", "type": null, "description": ""}], "created_at": 1789422566.8790145, "supported_languages": null}, "macro.dbt_utils.default__union_relations": {"name": "default__union_relations", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/union.sql", "original_file_path": "macros/sql/union.sql", "unique_id": "macro.dbt_utils.default__union_relations", "macro_sql": "\n\n{%- macro default__union_relations(relations, column_override=none, include=[], exclude=[], source_column_name='_dbt_source_relation', where=none) -%}\n\n {%- if exclude and include -%}\n {{ exceptions.raise_compiler_error(\"Both an exclude and include list were provided to the `union` macro. Only one is allowed\") }}\n {%- endif -%}\n\n {#-- Prevent querying of db in parsing mode. This works because this macro does not create any new refs. -#}\n {%- if not execute %}\n {{ return('') }}\n {% endif -%}\n\n {%- set column_override = column_override if column_override is not none else {} -%}\n\n {%- set relation_columns = {} -%}\n {%- set column_superset = {} -%}\n {%- set all_excludes = [] -%}\n {%- set all_includes = [] -%}\n\n {%- if exclude -%}\n {%- for exc in exclude -%}\n {%- do all_excludes.append(exc | lower) -%}\n {%- endfor -%}\n {%- endif -%}\n\n {%- if include -%}\n {%- for inc in include -%}\n {%- do all_includes.append(inc | lower) -%}\n {%- endfor -%}\n {%- endif -%}\n\n {%- for relation in relations -%}\n\n {%- do relation_columns.update({relation: []}) -%}\n\n {%- do dbt_utils._is_relation(relation, 'union_relations') -%}\n {%- do dbt_utils._is_ephemeral(relation, 'union_relations') -%}\n {%- set cols = adapter.get_columns_in_relation(relation) -%}\n {%- for col in cols -%}\n\n {#- If an exclude list was provided and the column is in the list, do nothing -#}\n {%- if exclude and col.column | lower in all_excludes -%}\n\n {#- If an include list was provided and the column is not in the list, do nothing -#}\n {%- elif include and col.column | lower not in all_includes -%}\n\n {#- Otherwise add the column to the column superset -#}\n {%- else -%}\n\n {#- update the list of columns in this relation -#}\n {%- do relation_columns[relation].append(col.column) -%}\n\n {%- if col.column in column_superset -%}\n\n {%- set stored = column_superset[col.column] -%}\n {%- if col.is_string() and stored.is_string() and col.string_size() > stored.string_size() -%}\n\n {%- do column_superset.update({col.column: col}) -%}\n\n {%- endif %}\n\n {%- else -%}\n\n {%- do column_superset.update({col.column: col}) -%}\n\n {%- endif -%}\n\n {%- endif -%}\n\n {%- endfor -%}\n {%- endfor -%}\n\n {%- set ordered_column_names = column_superset.keys() -%}\n {%- set dbt_command = flags.WHICH -%}\n\n\n {% if dbt_command in ['run', 'build'] %}\n {% if (include | length > 0 or exclude | length > 0) and not column_superset.keys() %}\n {%- set relations_string -%}\n {%- for relation in relations -%}\n {{ relation.name }}\n {%- if not loop.last %}, {% endif -%}\n {%- endfor -%}\n {%- endset -%}\n\n {%- set error_message -%}\n There were no columns found to union for relations {{ relations_string }}\n {%- endset -%}\n\n {{ exceptions.raise_compiler_error(error_message) }}\n {%- endif -%}\n {%- endif -%}\n\n {%- for relation in relations %}\n\n (\n select\n\n {%- if source_column_name is not none %}\n cast({{ dbt.string_literal(relation.render()) }} as {{ dbt.type_string() }}) as {{ source_column_name }},\n {%- endif %}\n\n /* No columns from any of the relations.\n This star is only output during dbt compile, and exists to keep SQLFluff happy. */\n {% if dbt_command == 'compile' and ordered_column_names|length == 0 %}\n *\n {% endif %}\n\n {% for col_name in ordered_column_names -%}\n\n {%- set col = column_superset[col_name] %}\n {%- set col_type = column_override.get(col.column, col.data_type) %}\n {%- set col_name = adapter.quote(col_name) if col_name in relation_columns[relation] else 'null' %}\n cast({{ col_name }} as {{ col_type }}) as {{ col.quoted }} {% if not loop.last %},{% endif -%}\n\n {%- endfor %}\n\n from {{ relation }}\n\n {% if where -%}\n where {{ where }}\n {%- endif %}\n )\n\n {% if not loop.last -%}\n union all\n {% endif -%}\n\n {%- endfor -%}\n\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt_utils._is_relation", "macro.dbt_utils._is_ephemeral", "macro.dbt.string_literal", "macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relations", "type": null, "description": ""}, {"name": "column_override", "type": null, "description": ""}, {"name": "include", "type": null, "description": ""}, {"name": "exclude", "type": null, "description": ""}, {"name": "source_column_name", "type": null, "description": ""}, {"name": "where", "type": null, "description": ""}], "created_at": 1789422566.8863785, "supported_languages": null}, "macro.dbt_utils.unpivot": {"name": "unpivot", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/unpivot.sql", "original_file_path": "macros/sql/unpivot.sql", "unique_id": "macro.dbt_utils.unpivot", "macro_sql": "{% macro unpivot(relation=none, cast_to='varchar', exclude=none, remove=none, field_name='field_name', value_name='value', quote_identifiers=False) -%}\n {{ return(adapter.dispatch('unpivot', 'dbt_utils')(relation, cast_to, exclude, remove, field_name, value_name, quote_identifiers)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__unpivot"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "cast_to", "type": null, "description": ""}, {"name": "exclude", "type": null, "description": ""}, {"name": "remove", "type": null, "description": ""}, {"name": "field_name", "type": null, "description": ""}, {"name": "value_name", "type": null, "description": ""}, {"name": "quote_identifiers", "type": null, "description": ""}], "created_at": 1789422566.8880556, "supported_languages": null}, "macro.dbt_utils.default__unpivot": {"name": "default__unpivot", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/unpivot.sql", "original_file_path": "macros/sql/unpivot.sql", "unique_id": "macro.dbt_utils.default__unpivot", "macro_sql": "{% macro default__unpivot(relation=none, cast_to='varchar', exclude=none, remove=none, field_name='field_name', value_name='value', quote_identifiers=False) -%}\n\n {% if not relation %}\n {{ exceptions.raise_compiler_error(\"Error: argument `relation` is required for `unpivot` macro.\") }}\n {% endif %}\n\n {%- set exclude = exclude if exclude is not none else [] %}\n {%- set remove = remove if remove is not none else [] %}\n\n {%- set include_cols = [] %}\n\n {%- set table_columns = {} %}\n\n {%- do table_columns.update({relation: []}) %}\n\n {%- do dbt_utils._is_relation(relation, 'unpivot') -%}\n {%- do dbt_utils._is_ephemeral(relation, 'unpivot') -%}\n {%- set cols = adapter.get_columns_in_relation(relation) %}\n\n {%- for col in cols -%}\n {%- if col.column.lower() not in remove|map('lower') and col.column.lower() not in exclude|map('lower') -%}\n {% do include_cols.append(col) %}\n {%- endif %}\n {%- endfor %}\n\n\n {%- for col in include_cols -%}\n {%- set current_col_name = adapter.quote(col.column) if quote_identifiers else col.column -%}\n select\n {%- for exclude_col in exclude %}\n {{ adapter.quote(exclude_col) if quote_identifiers else exclude_col }},\n {%- endfor %}\n\n cast('{{ col.column }}' as {{ dbt.type_string() }}) as {{ adapter.quote(field_name) if quote_identifiers else field_name }},\n cast( {% if col.data_type == 'boolean' %}\n {{ dbt.cast_bool_to_text(current_col_name) }}\n {% else %}\n {{ current_col_name }}\n {% endif %}\n as {{ cast_to }}) as {{ adapter.quote(value_name) if quote_identifiers else value_name }}\n\n from {{ relation }}\n\n {% if not loop.last -%}\n union all\n {% endif -%}\n {%- endfor -%}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_utils._is_relation", "macro.dbt_utils._is_ephemeral", "macro.dbt.type_string", "macro.dbt.cast_bool_to_text"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "cast_to", "type": null, "description": ""}, {"name": "exclude", "type": null, "description": ""}, {"name": "remove", "type": null, "description": ""}, {"name": "field_name", "type": null, "description": ""}, {"name": "value_name", "type": null, "description": ""}, {"name": "quote_identifiers", "type": null, "description": ""}], "created_at": 1789422566.891995, "supported_languages": null}, "macro.dbt_utils.nullcheck": {"name": "nullcheck", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/nullcheck.sql", "original_file_path": "macros/sql/nullcheck.sql", "unique_id": "macro.dbt_utils.nullcheck", "macro_sql": "{% macro nullcheck(cols) %}\n {{ return(adapter.dispatch('nullcheck', 'dbt_utils')(cols)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__nullcheck"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "cols", "type": null, "description": ""}], "created_at": 1789422566.8927524, "supported_languages": null}, "macro.dbt_utils.default__nullcheck": {"name": "default__nullcheck", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/nullcheck.sql", "original_file_path": "macros/sql/nullcheck.sql", "unique_id": "macro.dbt_utils.default__nullcheck", "macro_sql": "{% macro default__nullcheck(cols) %}\n{%- for col in cols %}\n\n {% if col.is_string() -%}\n\n nullif({{col.name}},'') as {{col.name}}\n\n {%- else -%}\n\n {{col.name}}\n\n {%- endif -%}\n\n{%- if not loop.last -%} , {%- endif -%}\n\n{%- endfor -%}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "cols", "type": null, "description": ""}], "created_at": 1789422566.8934684, "supported_languages": null}, "macro.dbt_utils.get_intervals_between": {"name": "get_intervals_between", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/date_spine.sql", "original_file_path": "macros/sql/date_spine.sql", "unique_id": "macro.dbt_utils.get_intervals_between", "macro_sql": "{% macro get_intervals_between(start_date, end_date, datepart) -%}\n {{ return(adapter.dispatch('get_intervals_between', 'dbt_utils')(start_date, end_date, datepart)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__get_intervals_between"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "start_date", "type": null, "description": ""}, {"name": "end_date", "type": null, "description": ""}, {"name": "datepart", "type": null, "description": ""}], "created_at": 1789422566.8944535, "supported_languages": null}, "macro.dbt_utils.default__get_intervals_between": {"name": "default__get_intervals_between", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/date_spine.sql", "original_file_path": "macros/sql/date_spine.sql", "unique_id": "macro.dbt_utils.default__get_intervals_between", "macro_sql": "{% macro default__get_intervals_between(start_date, end_date, datepart) -%}\n {%- call statement('get_intervals_between', fetch_result=True) %}\n\n select {{ dbt.datediff(start_date, end_date, datepart) }}\n\n {%- endcall -%}\n\n {%- set value_list = load_result('get_intervals_between') -%}\n\n {%- if value_list and value_list['data'] -%}\n {%- set values = value_list['data'] | map(attribute=0) | list %}\n {{ return(values[0]) }}\n {%- else -%}\n {{ return(1) }}\n {%- endif -%}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.statement", "macro.dbt.datediff"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "start_date", "type": null, "description": ""}, {"name": "end_date", "type": null, "description": ""}, {"name": "datepart", "type": null, "description": ""}], "created_at": 1789422566.8957024, "supported_languages": null}, "macro.dbt_utils.date_spine": {"name": "date_spine", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/date_spine.sql", "original_file_path": "macros/sql/date_spine.sql", "unique_id": "macro.dbt_utils.date_spine", "macro_sql": "{% macro date_spine(datepart, start_date, end_date) %}\n {{ return(adapter.dispatch('date_spine', 'dbt_utils')(datepart, start_date, end_date)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__date_spine"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "datepart", "type": null, "description": ""}, {"name": "start_date", "type": null, "description": ""}, {"name": "end_date", "type": null, "description": ""}], "created_at": 1789422566.8961778, "supported_languages": null}, "macro.dbt_utils.default__date_spine": {"name": "default__date_spine", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/date_spine.sql", "original_file_path": "macros/sql/date_spine.sql", "unique_id": "macro.dbt_utils.default__date_spine", "macro_sql": "{% macro default__date_spine(datepart, start_date, end_date) %}\n\n\n{# call as follows:\n\ndate_spine(\n \"day\",\n \"to_date('01/01/2016', 'mm/dd/yyyy')\",\n \"dbt.dateadd(week, 1, current_date)\"\n) #}\n\n\nwith rawdata as (\n\n {{dbt_utils.generate_series(\n dbt_utils.get_intervals_between(start_date, end_date, datepart)\n )}}\n\n),\n\nall_periods as (\n\n select (\n {{\n dbt.dateadd(\n datepart,\n \"row_number() over (order by generated_number) - 1\",\n start_date\n )\n }}\n ) as date_{{datepart}}\n from rawdata\n\n),\n\nfiltered as (\n\n select *\n from all_periods\n where date_{{datepart}} <= {{ end_date }}\n\n)\n\nselect * from filtered\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.generate_series", "macro.dbt_utils.get_intervals_between", "macro.dbt.dateadd"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "datepart", "type": null, "description": ""}, {"name": "start_date", "type": null, "description": ""}, {"name": "end_date", "type": null, "description": ""}], "created_at": 1789422566.8969185, "supported_languages": null}, "macro.dbt_utils.get_filtered_columns_in_relation": {"name": "get_filtered_columns_in_relation", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_filtered_columns_in_relation.sql", "original_file_path": "macros/sql/get_filtered_columns_in_relation.sql", "unique_id": "macro.dbt_utils.get_filtered_columns_in_relation", "macro_sql": "{% macro get_filtered_columns_in_relation(from, except=[]) -%}\n {{ return(adapter.dispatch('get_filtered_columns_in_relation', 'dbt_utils')(from, except)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__get_filtered_columns_in_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "from", "type": null, "description": ""}, {"name": "except", "type": null, "description": ""}], "created_at": 1789422566.8977926, "supported_languages": null}, "macro.dbt_utils.default__get_filtered_columns_in_relation": {"name": "default__get_filtered_columns_in_relation", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_filtered_columns_in_relation.sql", "original_file_path": "macros/sql/get_filtered_columns_in_relation.sql", "unique_id": "macro.dbt_utils.default__get_filtered_columns_in_relation", "macro_sql": "{% macro default__get_filtered_columns_in_relation(from, except=[]) -%}\n {%- do dbt_utils._is_relation(from, 'get_filtered_columns_in_relation') -%}\n {%- do dbt_utils._is_ephemeral(from, 'get_filtered_columns_in_relation') -%}\n\n {# -- Prevent querying of db in parsing mode. This works because this macro does not create any new refs. #}\n {%- if not execute -%}\n {{ return([]) }}\n {% endif %}\n\n {%- set include_cols = [] %}\n {%- set cols = adapter.get_columns_in_relation(from) -%}\n {%- set except = except | map(\"lower\") | list %}\n {%- for col in cols -%}\n {%- if col.column|lower not in except -%}\n {% do include_cols.append(col.column) %}\n {%- endif %}\n {%- endfor %}\n\n {{ return(include_cols) }}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_utils._is_relation", "macro.dbt_utils._is_ephemeral"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "from", "type": null, "description": ""}, {"name": "except", "type": null, "description": ""}], "created_at": 1789422566.899312, "supported_languages": null}, "macro.dbt_utils.surrogate_key": {"name": "surrogate_key", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/surrogate_key.sql", "original_file_path": "macros/sql/surrogate_key.sql", "unique_id": "macro.dbt_utils.surrogate_key", "macro_sql": "{%- macro surrogate_key(field_list) -%}\n {% set frustrating_jinja_feature = varargs %}\n {{ return(adapter.dispatch('surrogate_key', 'dbt_utils')(field_list, *varargs)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__surrogate_key"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field_list", "type": null, "description": ""}], "created_at": 1789422566.9000335, "supported_languages": null}, "macro.dbt_utils.default__surrogate_key": {"name": "default__surrogate_key", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/surrogate_key.sql", "original_file_path": "macros/sql/surrogate_key.sql", "unique_id": "macro.dbt_utils.default__surrogate_key", "macro_sql": "\n\n{%- macro default__surrogate_key(field_list) -%}\n\n{%- set error_message = '\nWarning: `dbt_utils.surrogate_key` has been replaced by \\\n`dbt_utils.generate_surrogate_key`. The new macro treats null values \\\ndifferently to empty strings. To restore the behaviour of the original \\\nmacro, add a global variable in dbt_project.yml called \\\n`surrogate_key_treat_nulls_as_empty_strings` to your \\\ndbt_project.yml file with a value of True. \\\nThe {}.{} model triggered this warning. \\\n'.format(model.package_name, model.name) -%}\n\n{%- do exceptions.raise_compiler_error(error_message) -%}\n\n{%- endmacro -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field_list", "type": null, "description": ""}], "created_at": 1789422566.9005384, "supported_languages": null}, "macro.dbt_utils.get_single_value": {"name": "get_single_value", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_single_value.sql", "original_file_path": "macros/sql/get_single_value.sql", "unique_id": "macro.dbt_utils.get_single_value", "macro_sql": "{% macro get_single_value(query, default=none) %}\n {{ return(adapter.dispatch('get_single_value', 'dbt_utils')(query, default)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__get_single_value"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "query", "type": null, "description": ""}, {"name": "default", "type": null, "description": ""}], "created_at": 1789422566.901344, "supported_languages": null}, "macro.dbt_utils.default__get_single_value": {"name": "default__get_single_value", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_single_value.sql", "original_file_path": "macros/sql/get_single_value.sql", "unique_id": "macro.dbt_utils.default__get_single_value", "macro_sql": "{% macro default__get_single_value(query, default) %}\n\n{# This macro returns the (0, 0) record in a query, i.e. the first row of the first column #}\n\n {%- call statement('get_query_result', fetch_result=True, auto_begin=false) -%}\n\n {{ query }}\n\n {%- endcall -%}\n\n {%- if execute -%}\n\n {% set r = load_result('get_query_result').table.columns[0].values() %}\n {% if r | length == 0 %}\n {% do print('Query `' ~ query ~ '` returned no rows. Using the default value: ' ~ default) %}\n {% set sql_result = default %}\n {% else %}\n {% set sql_result = r[0] %}\n {% endif %}\n \n {%- else -%}\n \n {% set sql_result = default %}\n \n {%- endif -%}\n\n {% do return(sql_result) %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "query", "type": null, "description": ""}, {"name": "default", "type": null, "description": ""}], "created_at": 1789422566.9030287, "supported_languages": null}, "macro.dbt_utils.width_bucket": {"name": "width_bucket", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/width_bucket.sql", "original_file_path": "macros/sql/width_bucket.sql", "unique_id": "macro.dbt_utils.width_bucket", "macro_sql": "{% macro width_bucket(expr, min_value, max_value, num_buckets) %}\n {{ return(adapter.dispatch('width_bucket', 'dbt_utils') (expr, min_value, max_value, num_buckets)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__width_bucket"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "expr", "type": null, "description": ""}, {"name": "min_value", "type": null, "description": ""}, {"name": "max_value", "type": null, "description": ""}, {"name": "num_buckets", "type": null, "description": ""}], "created_at": 1789422566.9039302, "supported_languages": null}, "macro.dbt_utils.default__width_bucket": {"name": "default__width_bucket", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/width_bucket.sql", "original_file_path": "macros/sql/width_bucket.sql", "unique_id": "macro.dbt_utils.default__width_bucket", "macro_sql": "{% macro default__width_bucket(expr, min_value, max_value, num_buckets) -%}\n\n {% set bin_size -%}\n (( {{ max_value }} - {{ min_value }} ) / {{ num_buckets }} )\n {%- endset %}\n (\n -- to break ties when the amount is eaxtly at the bucket egde\n case\n when\n mod(\n {{ dbt.safe_cast(expr, dbt.type_numeric() ) }},\n {{ dbt.safe_cast(bin_size, dbt.type_numeric() ) }}\n ) = 0\n then 1\n else 0\n end\n ) +\n -- Anything over max_value goes the N+1 bucket\n least(\n ceil(\n ({{ expr }} - {{ min_value }})/{{ bin_size }}\n ),\n {{ num_buckets }} + 1\n )\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.safe_cast", "macro.dbt.type_numeric"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "expr", "type": null, "description": ""}, {"name": "min_value", "type": null, "description": ""}, {"name": "max_value", "type": null, "description": ""}, {"name": "num_buckets", "type": null, "description": ""}], "created_at": 1789422566.9048831, "supported_languages": null}, "macro.dbt_utils.snowflake__width_bucket": {"name": "snowflake__width_bucket", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/width_bucket.sql", "original_file_path": "macros/sql/width_bucket.sql", "unique_id": "macro.dbt_utils.snowflake__width_bucket", "macro_sql": "{% macro snowflake__width_bucket(expr, min_value, max_value, num_buckets) %}\n width_bucket({{ expr }}, {{ min_value }}, {{ max_value }}, {{ num_buckets }} )\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "expr", "type": null, "description": ""}, {"name": "min_value", "type": null, "description": ""}, {"name": "max_value", "type": null, "description": ""}, {"name": "num_buckets", "type": null, "description": ""}], "created_at": 1789422566.9052858, "supported_languages": null}, "macro.dbt_utils.get_relations_by_prefix": {"name": "get_relations_by_prefix", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_relations_by_prefix.sql", "original_file_path": "macros/sql/get_relations_by_prefix.sql", "unique_id": "macro.dbt_utils.get_relations_by_prefix", "macro_sql": "{% macro get_relations_by_prefix(schema, prefix, exclude='', database=target.database) %}\n {{ return(adapter.dispatch('get_relations_by_prefix', 'dbt_utils')(schema, prefix, exclude, database)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__get_relations_by_prefix"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "schema", "type": null, "description": ""}, {"name": "prefix", "type": null, "description": ""}, {"name": "exclude", "type": null, "description": ""}, {"name": "database", "type": null, "description": ""}], "created_at": 1789422566.9062462, "supported_languages": null}, "macro.dbt_utils.default__get_relations_by_prefix": {"name": "default__get_relations_by_prefix", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_relations_by_prefix.sql", "original_file_path": "macros/sql/get_relations_by_prefix.sql", "unique_id": "macro.dbt_utils.default__get_relations_by_prefix", "macro_sql": "{% macro default__get_relations_by_prefix(schema, prefix, exclude='', database=target.database) %}\n\n {%- call statement('get_tables', fetch_result=True) %}\n\n {{ dbt_utils.get_tables_by_prefix_sql(schema, prefix, exclude, database) }}\n\n {%- endcall -%}\n\n {%- set table_list = load_result('get_tables') -%}\n\n {%- if table_list and table_list['table'] -%}\n {%- set tbl_relations = [] -%}\n {%- for row in table_list['table'] -%}\n {%- set tbl_relation = api.Relation.create(\n database=database,\n schema=row.table_schema,\n identifier=row.table_name,\n type=row.table_type\n ) -%}\n {%- do tbl_relations.append(tbl_relation) -%}\n {%- endfor -%}\n\n {{ return(tbl_relations) }}\n {%- else -%}\n {{ return([]) }}\n {%- endif -%}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement", "macro.dbt_utils.get_tables_by_prefix_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "schema", "type": null, "description": ""}, {"name": "prefix", "type": null, "description": ""}, {"name": "exclude", "type": null, "description": ""}, {"name": "database", "type": null, "description": ""}], "created_at": 1789422566.9079988, "supported_languages": null}, "macro.dbt_utils.safe_divide": {"name": "safe_divide", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/safe_divide.sql", "original_file_path": "macros/sql/safe_divide.sql", "unique_id": "macro.dbt_utils.safe_divide", "macro_sql": "{% macro safe_divide(numerator, denominator) -%}\n {{ return(adapter.dispatch('safe_divide', 'dbt_utils')(numerator, denominator)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__safe_divide"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "numerator", "type": null, "description": ""}, {"name": "denominator", "type": null, "description": ""}], "created_at": 1789422566.9086, "supported_languages": null}, "macro.dbt_utils.default__safe_divide": {"name": "default__safe_divide", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/safe_divide.sql", "original_file_path": "macros/sql/safe_divide.sql", "unique_id": "macro.dbt_utils.default__safe_divide", "macro_sql": "{% macro default__safe_divide(numerator, denominator) %}\n ( {{ numerator }} ) / nullif( ( {{ denominator }} ), 0)\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "numerator", "type": null, "description": ""}, {"name": "denominator", "type": null, "description": ""}], "created_at": 1789422566.9088984, "supported_languages": null}, "macro.dbt_utils.safe_add": {"name": "safe_add", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/safe_add.sql", "original_file_path": "macros/sql/safe_add.sql", "unique_id": "macro.dbt_utils.safe_add", "macro_sql": "{%- macro safe_add(field_list) -%}\n {{ return(adapter.dispatch('safe_add', 'dbt_utils')(field_list)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__safe_add"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field_list", "type": null, "description": ""}], "created_at": 1789422566.9095612, "supported_languages": null}, "macro.dbt_utils.default__safe_add": {"name": "default__safe_add", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/safe_add.sql", "original_file_path": "macros/sql/safe_add.sql", "unique_id": "macro.dbt_utils.default__safe_add", "macro_sql": "\n\n{%- macro default__safe_add(field_list) -%}\n\n{%- if field_list is not iterable or field_list is string or field_list is mapping -%}\n\n{%- set error_message = '\nWarning: the `safe_add` macro now takes a single list argument instead of \\\nstring arguments. The {}.{} model triggered this warning. \\\n'.format(model.package_name, model.name) -%}\n\n{%- do exceptions.warn(error_message) -%}\n\n{%- endif -%}\n\n{% set fields = [] %}\n\n{%- for field in field_list -%}\n\n {% do fields.append(\"coalesce(\" ~ field ~ \", 0)\") %}\n\n{%- endfor -%}\n\n{{ fields|join(' +\\n ') }}\n\n{%- endmacro -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field_list", "type": null, "description": ""}], "created_at": 1789422566.9106946, "supported_languages": null}, "macro.dbt_utils.group_by": {"name": "group_by", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/groupby.sql", "original_file_path": "macros/sql/groupby.sql", "unique_id": "macro.dbt_utils.group_by", "macro_sql": "{%- macro group_by(n) -%}\n {{ return(adapter.dispatch('group_by', 'dbt_utils')(n)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__group_by"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "n", "type": null, "description": ""}], "created_at": 1789422566.9112496, "supported_languages": null}, "macro.dbt_utils.default__group_by": {"name": "default__group_by", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/groupby.sql", "original_file_path": "macros/sql/groupby.sql", "unique_id": "macro.dbt_utils.default__group_by", "macro_sql": "\n\n{%- macro default__group_by(n) -%}\n\n group by {% for i in range(1, n + 1) -%}\n {{ i }}{{ ',' if not loop.last }} \n {%- endfor -%}\n\n{%- endmacro -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "n", "type": null, "description": ""}], "created_at": 1789422566.9117882, "supported_languages": null}, "macro.iterable.iterable_lookback": {"name": "iterable_lookback", "resource_type": "macro", "package_name": "iterable", "path": "macros/iterable_lookback.sql", "original_file_path": "macros/iterable_lookback.sql", "unique_id": "macro.iterable.iterable_lookback", "macro_sql": "{% macro iterable_lookback(from_date, datepart, interval, safety_date='2020-01-01') %}\n\n{{ adapter.dispatch('iterable_lookback', 'iterable') (from_date, datepart, interval, safety_date='2020-01-01') }}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.iterable.default__iterable_lookback"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "from_date", "type": null, "description": ""}, {"name": "datepart", "type": null, "description": ""}, {"name": "interval", "type": null, "description": ""}, {"name": "safety_date", "type": null, "description": ""}], "created_at": 1789422566.9125977, "supported_languages": null}, "macro.iterable.default__iterable_lookback": {"name": "default__iterable_lookback", "resource_type": "macro", "package_name": "iterable", "path": "macros/iterable_lookback.sql", "original_file_path": "macros/iterable_lookback.sql", "unique_id": "macro.iterable.default__iterable_lookback", "macro_sql": "{% macro default__iterable_lookback(from_date, datepart, interval, safety_date='2020-01-01') %}\n\n {% set sql_statement %}\n select coalesce({{ from_date }}, {{ \"'\" ~ safety_date ~ \"'\" }})\n from {{ this }}\n {%- endset -%}\n\n {%- set result = dbt_utils.get_single_value(sql_statement) %}\n\n {{ dbt.dateadd(datepart=datepart, interval=-interval, from_date_or_timestamp=\"cast('\" ~ result ~ \"' as date)\") }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.get_single_value", "macro.dbt.dateadd"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "from_date", "type": null, "description": ""}, {"name": "datepart", "type": null, "description": ""}, {"name": "interval", "type": null, "description": ""}, {"name": "safety_date", "type": null, "description": ""}], "created_at": 1789422566.913653, "supported_languages": null}, "macro.iterable.get_campaign_list_history_columns": {"name": "get_campaign_list_history_columns", "resource_type": "macro", "package_name": "iterable", "path": "macros/staging/get_campaign_list_history_columns.sql", "original_file_path": "macros/staging/get_campaign_list_history_columns.sql", "unique_id": "macro.iterable.get_campaign_list_history_columns", "macro_sql": "{% macro get_campaign_list_history_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"campaign_id\", \"datatype\": dbt.type_int()},\n {\"name\": \"list_id\", \"datatype\": dbt.type_int()},\n {\"name\": \"updated_at\", \"datatype\": dbt.type_timestamp()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.type_timestamp", "macro.dbt.type_int"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789422566.9148285, "supported_languages": null}, "macro.iterable.get_list_columns": {"name": "get_list_columns", "resource_type": "macro", "package_name": "iterable", "path": "macros/staging/get_list_columns.sql", "original_file_path": "macros/staging/get_list_columns.sql", "unique_id": "macro.iterable.get_list_columns", "macro_sql": "{% macro get_list_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_deleted\", \"datatype\": \"boolean\"},\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"created_at\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"id\", \"datatype\": dbt.type_int()},\n {\"name\": \"list_type\", \"datatype\": dbt.type_string()},\n {\"name\": \"description\", \"datatype\": dbt.type_string()},\n {\"name\": \"name\", \"datatype\": dbt.type_string()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.type_timestamp", "macro.dbt.type_int", "macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789422566.9165046, "supported_languages": null}, "macro.iterable.get_campaign_history_columns": {"name": "get_campaign_history_columns", "resource_type": "macro", "package_name": "iterable", "path": "macros/staging/get_campaign_history_columns.sql", "original_file_path": "macros/staging/get_campaign_history_columns.sql", "unique_id": "macro.iterable.get_campaign_history_columns", "macro_sql": "{% macro get_campaign_history_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"campaign_state\", \"datatype\": dbt.type_string()},\n {\"name\": \"created_at\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"created_by_user_id\", \"datatype\": dbt.type_string()},\n {\"name\": \"updated_by_user_id\", \"datatype\": dbt.type_string()},\n {\"name\": \"ended_at\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"id\", \"datatype\": dbt.type_int()},\n {\"name\": \"name\", \"datatype\": dbt.type_string()},\n {\"name\": \"recurring_campaign_id\", \"datatype\": dbt.type_int()},\n {\"name\": \"send_size\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"start_at\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"template_id\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"type\", \"datatype\": dbt.type_string()},\n {\"name\": \"updated_at\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"workflow_id\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"message_medium\", \"datatype\": dbt.type_string()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.type_timestamp", "macro.dbt.type_string", "macro.dbt.type_int", "macro.dbt.type_numeric"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789422566.9197512, "supported_languages": null}, "macro.iterable.get_event_columns": {"name": "get_event_columns", "resource_type": "macro", "package_name": "iterable", "path": "macros/staging/get_event_columns.sql", "original_file_path": "macros/staging/get_event_columns.sql", "unique_id": "macro.iterable.get_event_columns", "macro_sql": "{% macro get_event_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_id\", \"datatype\": dbt.type_string()},\n {\"name\": \"_fivetran_user_id\", \"datatype\": dbt.type_string()},\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"campaign_id\", \"datatype\": dbt.type_int()},\n {\"name\": \"content_id\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"created_at\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"email\", \"datatype\": dbt.type_string()},\n {\"name\": \"event_name\", \"datatype\": dbt.type_string()},\n {\"name\": \"message_bus_id\", \"datatype\": dbt.type_string()},\n {\"name\": \"message_id\", \"datatype\": dbt.type_string()},\n {\"name\": \"message_type_id\", \"datatype\": dbt.type_int()},\n {\"name\": \"recipient_state\", \"datatype\": dbt.type_string()},\n {\"name\": \"status\", \"datatype\": dbt.type_string()},\n {\"name\": \"unsub_source\", \"datatype\": dbt.type_string()},\n {\"name\": \"user_agent\", \"datatype\": dbt.type_string()},\n {\"name\": \"user_agent_device\", \"datatype\": dbt.type_string()},\n {\"name\": \"transactional_data\", \"datatype\": dbt.type_string()},\n {\"name\": \"additional_properties\", \"datatype\": dbt.type_string()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.type_string", "macro.dbt.type_timestamp", "macro.dbt.type_int", "macro.dbt.type_numeric"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789422566.923343, "supported_languages": null}, "macro.iterable.get_event_extension_columns": {"name": "get_event_extension_columns", "resource_type": "macro", "package_name": "iterable", "path": "macros/staging/get_event_extension_columns.sql", "original_file_path": "macros/staging/get_event_extension_columns.sql", "unique_id": "macro.iterable.get_event_extension_columns", "macro_sql": "{% macro get_event_extension_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_id\", \"datatype\": dbt.type_string()},\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"app_already_running\", \"datatype\": \"boolean\"},\n {\"name\": \"badge\", \"datatype\": dbt.type_string()},\n {\"name\": \"catalog_collection_count\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"catalog_lookup_count\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"canonical_url_id\", \"datatype\": dbt.type_string()},\n {\"name\": \"content_available\", \"datatype\": \"boolean\"},\n {\"name\": \"content_id\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"device\", \"datatype\": dbt.type_string()},\n {\"name\": \"email_id\", \"datatype\": dbt.type_string()},\n {\"name\": \"email_subject\", \"datatype\": dbt.type_string()},\n {\"name\": \"experiment_id\", \"datatype\": dbt.type_string()},\n {\"name\": \"from_phone_number_id\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"from_smssender_id\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"link_id\", \"datatype\": dbt.type_string()},\n {\"name\": \"link_url\", \"datatype\": dbt.type_string()},\n {\"name\": \"locale\", \"datatype\": dbt.type_string()},\n {\"name\": \"payload\", \"datatype\": dbt.type_string()},\n {\"name\": \"platform_endpoint\", \"datatype\": dbt.type_string()},\n {\"name\": \"push_message\", \"datatype\": dbt.type_string()},\n {\"name\": \"region\", \"datatype\": dbt.type_string()},\n {\"name\": \"sms_message\", \"datatype\": dbt.type_string()},\n {\"name\": \"to_phone_number\", \"datatype\": dbt.type_string()},\n {\"name\": \"url\", \"datatype\": dbt.type_string()},\n {\"name\": \"workflow_id\", \"datatype\": dbt.type_string()},\n {\"name\": \"workflow_name\", \"datatype\": dbt.type_string()},\n {\"name\": \"city\", \"datatype\": dbt.type_string()},\n {\"name\": \"clicked_url\", \"datatype\": dbt.type_string()},\n {\"name\": \"country\", \"datatype\": dbt.type_string()},\n {\"name\": \"error_code\", \"datatype\": dbt.type_string()},\n {\"name\": \"expires_at\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"from_phone_number\", \"datatype\": dbt.type_string()},\n {\"name\": \"in_app_body\", \"datatype\": dbt.type_string()},\n {\"name\": \"is_sms_estimation\", \"datatype\": \"boolean\"},\n {\"name\": \"labels\", \"datatype\": dbt.type_string()},\n {\"name\": \"message_status\", \"datatype\": dbt.type_string()},\n {\"name\": \"mms_send_count\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"reason\", \"datatype\": dbt.type_string()},\n {\"name\": \"sms_send_count\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"_fivetran_user_id\", \"datatype\": dbt.type_string()}\n] %}\n\n{{ fivetran_utils.add_pass_through_columns(columns, var('iterable_event_extension_pass_through_columns')) }}\n\n{{ return(columns) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.type_string", "macro.dbt.type_timestamp", "macro.dbt.type_numeric", "macro.fivetran_utils.add_pass_through_columns"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789422566.9312851, "supported_languages": null}, "macro.iterable.get_campaign_label_history_columns": {"name": "get_campaign_label_history_columns", "resource_type": "macro", "package_name": "iterable", "path": "macros/staging/get_campaign_label_history_columns.sql", "original_file_path": "macros/staging/get_campaign_label_history_columns.sql", "unique_id": "macro.iterable.get_campaign_label_history_columns", "macro_sql": "{% macro get_campaign_label_history_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"campaign_id\", \"datatype\": dbt.type_int()},\n {\"name\": \"label\", \"datatype\": dbt.type_string()},\n {\"name\": \"updated_at\", \"datatype\": dbt.type_timestamp()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.type_timestamp", "macro.dbt.type_int", "macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789422566.9326022, "supported_languages": null}, "macro.iterable.get_template_history_columns": {"name": "get_template_history_columns", "resource_type": "macro", "package_name": "iterable", "path": "macros/staging/get_template_history_columns.sql", "original_file_path": "macros/staging/get_template_history_columns.sql", "unique_id": "macro.iterable.get_template_history_columns", "macro_sql": "{% macro get_template_history_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"client_template_id\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"created_at\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"creator_user_id\", \"datatype\": dbt.type_string()},\n {\"name\": \"id\", \"datatype\": dbt.type_int()},\n {\"name\": \"message_type_id\", \"datatype\": dbt.type_int()},\n {\"name\": \"name\", \"datatype\": dbt.type_string()},\n {\"name\": \"template_type\", \"datatype\": dbt.type_string()},\n {\"name\": \"updated_at\", \"datatype\": dbt.type_timestamp()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.type_timestamp", "macro.dbt.type_numeric", "macro.dbt.type_string", "macro.dbt.type_int"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789422566.9346886, "supported_languages": null}, "macro.iterable.get_journey_columns": {"name": "get_journey_columns", "resource_type": "macro", "package_name": "iterable", "path": "macros/staging/get_journey_columns.sql", "original_file_path": "macros/staging/get_journey_columns.sql", "unique_id": "macro.iterable.get_journey_columns", "macro_sql": "{% macro get_journey_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_deleted\", \"datatype\": \"boolean\"},\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"created_at\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"creator_user_id\", \"datatype\": dbt.type_string()},\n {\"name\": \"description\", \"datatype\": dbt.type_string()},\n {\"name\": \"enabled\", \"datatype\": \"boolean\"},\n {\"name\": \"id\", \"datatype\": dbt.type_int()},\n {\"name\": \"is_archived\", \"datatype\": \"boolean\"},\n {\"name\": \"journey_type\", \"datatype\": dbt.type_string()},\n {\"name\": \"lifetime_limit\", \"datatype\": dbt.type_int()},\n {\"name\": \"name\", \"datatype\": dbt.type_string()},\n {\"name\": \"simultaneous_limit\", \"datatype\": dbt.type_int()},\n {\"name\": \"start_tile_id\", \"datatype\": dbt.type_int()},\n {\"name\": \"trigger_event_names\", \"datatype\": dbt.type_string()},\n {\"name\": \"updated_at\", \"datatype\": dbt.type_timestamp()}\n] %}\n\n{{ fivetran_utils.add_pass_through_columns(columns, var('iterable_journey_pass_through_columns')) }}\n\n{{ return(columns) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.type_timestamp", "macro.dbt.type_string", "macro.dbt.type_int", "macro.fivetran_utils.add_pass_through_columns"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789422566.9379141, "supported_languages": null}, "macro.iterable.get_list_user_columns": {"name": "get_list_user_columns", "resource_type": "macro", "package_name": "iterable", "path": "macros/staging/get_list_user_columns.sql", "original_file_path": "macros/staging/get_list_user_columns.sql", "unique_id": "macro.iterable.get_list_user_columns", "macro_sql": "{% macro get_list_user_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_id\", \"datatype\": dbt.type_string()},\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"index\", \"datatype\": dbt.type_int()},\n {\"name\": \"list_id\", \"datatype\": dbt.type_int()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.type_string", "macro.dbt.type_timestamp", "macro.dbt.type_int"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789422566.9391432, "supported_languages": null}, "macro.iterable.json_to_string": {"name": "json_to_string", "resource_type": "macro", "package_name": "iterable", "path": "macros/staging/json_to_string.sql", "original_file_path": "macros/staging/json_to_string.sql", "unique_id": "macro.iterable.json_to_string", "macro_sql": "{%- macro json_to_string(column, column_list) -%}\n {{ return(adapter.dispatch('json_to_string', 'iterable')(column, column_list)) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.iterable.default__json_to_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "column", "type": null, "description": ""}, {"name": "column_list", "type": null, "description": ""}], "created_at": 1789422566.9399734, "supported_languages": null}, "macro.iterable.default__json_to_string": {"name": "default__json_to_string", "resource_type": "macro", "package_name": "iterable", "path": "macros/staging/json_to_string.sql", "original_file_path": "macros/staging/json_to_string.sql", "unique_id": "macro.iterable.default__json_to_string", "macro_sql": "{%- macro default__json_to_string(column, column_list) -%}\n cast({{ column }} as {{ dbt.type_string() }})\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "column", "type": null, "description": ""}, {"name": "column_list", "type": null, "description": ""}], "created_at": 1789422566.9403088, "supported_languages": null}, "macro.iterable.bigquery__json_to_string": {"name": "bigquery__json_to_string", "resource_type": "macro", "package_name": "iterable", "path": "macros/staging/json_to_string.sql", "original_file_path": "macros/staging/json_to_string.sql", "unique_id": "macro.iterable.bigquery__json_to_string", "macro_sql": "{%- macro bigquery__json_to_string(column, column_list) -%}\n {%- set columns = column_list -%}\n {%- set ns = namespace(column_type='string') -%}\n\n {%- for col in columns -%}\n {%- if col.name|lower == column|lower -%}\n {%- set ns.column_type = col.dtype|lower -%}\n {%- endif -%}\n {%- endfor -%}\n\n {%- if ns.column_type == 'json' -%}\n to_json_string({{ column }})\n {%- else -%}\n cast({{ column }} as {{ dbt.type_string() }})\n {%- endif -%}\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "column", "type": null, "description": ""}, {"name": "column_list", "type": null, "description": ""}], "created_at": 1789422566.941584, "supported_languages": null}, "macro.iterable.get_user_unsubscribed_message_type_columns": {"name": "get_user_unsubscribed_message_type_columns", "resource_type": "macro", "package_name": "iterable", "path": "macros/staging/get_user_unsubscribed_message_type_columns.sql", "original_file_path": "macros/staging/get_user_unsubscribed_message_type_columns.sql", "unique_id": "macro.iterable.get_user_unsubscribed_message_type_columns", "macro_sql": "{% macro get_user_unsubscribed_message_type_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"_fivetran_id\", \"datatype\": dbt.type_string()},\n {\"name\": \"message_type_id\", \"datatype\": dbt.type_string()},\n {\"name\": \"email\", \"datatype\": dbt.type_string()},\n {\"name\": \"updated_at\", \"datatype\": dbt.type_timestamp()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.type_timestamp", "macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789422566.9429448, "supported_languages": null}, "macro.iterable.does_table_exist": {"name": "does_table_exist", "resource_type": "macro", "package_name": "iterable", "path": "macros/staging/does_table_exist.sql", "original_file_path": "macros/staging/does_table_exist.sql", "unique_id": "macro.iterable.does_table_exist", "macro_sql": "{%- macro does_table_exist(table_name) -%}\n {%- if execute -%} -- returns true when dbt is in execute mode\n {%- set ns = namespace(has_table=false) -%} -- declare boolean namespace and default value \n {%- for node in graph.sources.values() -%} -- grab sources from the dictionary of nodes \n -- call the database for the matching table\n {%- if node.name | lower == table_name | lower -%} \n {%- set source_relation = adapter.get_relation(\n database=node.database,\n schema=node.schema,\n identifier=node.identifier ) -%}\n {% endif %}\n {%- if source_relation == None -%} \n {{ return(False) }} -- return false if relation identified by the database.schema.identifier does not exist for the given table name\n {% endif %}\n {%- endfor -%}\n {{ return(True) }}\n {%- endif -%} \n{%- endmacro -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "table_name", "type": null, "description": ""}], "created_at": 1789422566.9444804, "supported_languages": null}, "macro.iterable.get_user_history_columns": {"name": "get_user_history_columns", "resource_type": "macro", "package_name": "iterable", "path": "macros/staging/get_user_history_columns.sql", "original_file_path": "macros/staging/get_user_history_columns.sql", "unique_id": "macro.iterable.get_user_history_columns", "macro_sql": "{% macro get_user_history_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_id\", \"datatype\": dbt.type_string()},\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"email\", \"datatype\": dbt.type_string()},\n {\"name\": \"email_list_ids\", \"datatype\": dbt.type_string()},\n {\"name\": \"first_name\", \"datatype\": dbt.type_string()},\n {\"name\": \"last_name\", \"datatype\": dbt.type_string()},\n {\"name\": \"phone_number\", \"datatype\": dbt.type_string()},\n {\"name\": \"signup_date\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"signup_source\", \"datatype\": dbt.type_string()},\n {\"name\": \"updated_at\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"user_id\", \"datatype\": dbt.type_string()},\n {\"name\": \"iterable_user_id\", \"datatype\": dbt.type_string()}\n\n] %}\n\n{{ fivetran_utils.add_pass_through_columns(columns, var('iterable_user_history_pass_through_columns')) }}\n\n{{ return(columns) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.type_string", "macro.dbt.type_timestamp", "macro.fivetran_utils.add_pass_through_columns"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789422566.9473164, "supported_languages": null}, "macro.iterable.get_campaign_suppression_list_history_columns": {"name": "get_campaign_suppression_list_history_columns", "resource_type": "macro", "package_name": "iterable", "path": "macros/staging/get_campaign_suppression_list_history_columns.sql", "original_file_path": "macros/staging/get_campaign_suppression_list_history_columns.sql", "unique_id": "macro.iterable.get_campaign_suppression_list_history_columns", "macro_sql": "{% macro get_campaign_suppression_list_history_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"campaign_id\", \"datatype\": dbt.type_int()},\n {\"name\": \"suppressed_list_id\", \"datatype\": dbt.type_int()},\n {\"name\": \"updated_at\", \"datatype\": dbt.type_timestamp()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.type_timestamp", "macro.dbt.type_int"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789422566.9485075, "supported_languages": null}, "macro.iterable.get_user_unsubscribed_channel_columns": {"name": "get_user_unsubscribed_channel_columns", "resource_type": "macro", "package_name": "iterable", "path": "macros/staging/get_user_unsubscribed_channel_columns.sql", "original_file_path": "macros/staging/get_user_unsubscribed_channel_columns.sql", "unique_id": "macro.iterable.get_user_unsubscribed_channel_columns", "macro_sql": "{% macro get_user_unsubscribed_channel_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"_fivetran_id\", \"datatype\": dbt.type_string()},\n {\"name\": \"channel_id\", \"datatype\": dbt.type_int()},\n {\"name\": \"email\", \"datatype\": dbt.type_string()},\n {\"name\": \"updated_at\", \"datatype\": dbt.type_timestamp()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.type_timestamp", "macro.dbt.type_string", "macro.dbt.type_int"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789422566.9498982, "supported_languages": null}, "macro.iterable.get_message_type_columns": {"name": "get_message_type_columns", "resource_type": "macro", "package_name": "iterable", "path": "macros/staging/get_message_type_columns.sql", "original_file_path": "macros/staging/get_message_type_columns.sql", "unique_id": "macro.iterable.get_message_type_columns", "macro_sql": "{% macro get_message_type_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_deleted\", \"datatype\": \"boolean\"},\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"channel_id\", \"datatype\": dbt.type_int()},\n {\"name\": \"id\", \"datatype\": dbt.type_int()},\n {\"name\": \"name\", \"datatype\": dbt.type_string()},\n {\"name\": \"created_at\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"frequency_cap\", \"datatype\": dbt.type_string()},\n {\"name\": \"rate_limit_per_minute\", \"datatype\": dbt.type_string()},\n {\"name\": \"subscription_policy\", \"datatype\": dbt.type_string()},\n {\"name\": \"updated_at\", \"datatype\": dbt.type_timestamp()},\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.type_timestamp", "macro.dbt.type_int", "macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789422566.952249, "supported_languages": null}, "macro.iterable.get_channel_columns": {"name": "get_channel_columns", "resource_type": "macro", "package_name": "iterable", "path": "macros/staging/get_channel_columns.sql", "original_file_path": "macros/staging/get_channel_columns.sql", "unique_id": "macro.iterable.get_channel_columns", "macro_sql": "{% macro get_channel_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_deleted\", \"datatype\": \"boolean\"},\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"channel_type\", \"datatype\": dbt.type_string()},\n {\"name\": \"id\", \"datatype\": dbt.type_int()},\n {\"name\": \"message_medium\", \"datatype\": dbt.type_string()},\n {\"name\": \"name\", \"datatype\": dbt.type_string()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.type_timestamp", "macro.dbt.type_string", "macro.dbt.type_int"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789422566.9537706, "supported_languages": null}, "macro.fivetran_utils.enabled_vars_one_true": {"name": "enabled_vars_one_true", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/enabled_vars_one_true.sql", "original_file_path": "macros/enabled_vars_one_true.sql", "unique_id": "macro.fivetran_utils.enabled_vars_one_true", "macro_sql": "{% macro enabled_vars_one_true(vars) %}\n\n{% for v in vars %}\n \n {% if var(v, False) == True %}\n {{ return(True) }}\n {% endif %}\n\n{% endfor %}\n\n{{ return(False) }}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "vars", "type": null, "description": ""}], "created_at": 1789422566.9545958, "supported_languages": null}, "macro.fivetran_utils.json_parse": {"name": "json_parse", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/json_parse.sql", "original_file_path": "macros/json_parse.sql", "unique_id": "macro.fivetran_utils.json_parse", "macro_sql": "{% macro json_parse(string, string_path) -%}\n\n{{ adapter.dispatch('json_parse', 'fivetran_utils') (string, string_path) }}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.postgres__json_parse"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "string", "type": null, "description": ""}, {"name": "string_path", "type": null, "description": ""}], "created_at": 1789422566.9558837, "supported_languages": null}, "macro.fivetran_utils.default__json_parse": {"name": "default__json_parse", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/json_parse.sql", "original_file_path": "macros/json_parse.sql", "unique_id": "macro.fivetran_utils.default__json_parse", "macro_sql": "{% macro default__json_parse(string, string_path) %}\n\n json_extract_path_text({{string}}, {%- for s in string_path -%}'{{ s }}'{%- if not loop.last -%},{%- endif -%}{%- endfor -%} )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "string", "type": null, "description": ""}, {"name": "string_path", "type": null, "description": ""}], "created_at": 1789422566.9563992, "supported_languages": null}, "macro.fivetran_utils.redshift__json_parse": {"name": "redshift__json_parse", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/json_parse.sql", "original_file_path": "macros/json_parse.sql", "unique_id": "macro.fivetran_utils.redshift__json_parse", "macro_sql": "{% macro redshift__json_parse(string, string_path) %}\n\n json_extract_path_text({{string}}, {%- for s in string_path -%}'{{ s }}'{%- if not loop.last -%},{%- endif -%}{%- endfor -%} )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "string", "type": null, "description": ""}, {"name": "string_path", "type": null, "description": ""}], "created_at": 1789422566.9569306, "supported_languages": null}, "macro.fivetran_utils.bigquery__json_parse": {"name": "bigquery__json_parse", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/json_parse.sql", "original_file_path": "macros/json_parse.sql", "unique_id": "macro.fivetran_utils.bigquery__json_parse", "macro_sql": "{% macro bigquery__json_parse(string, string_path) %}\n\n \n json_extract_scalar({{string}}, '$.{%- for s in string_path -%}{{ s }}{%- if not loop.last -%}.{%- endif -%}{%- endfor -%} ')\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "string", "type": null, "description": ""}, {"name": "string_path", "type": null, "description": ""}], "created_at": 1789422566.9574234, "supported_languages": null}, "macro.fivetran_utils.postgres__json_parse": {"name": "postgres__json_parse", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/json_parse.sql", "original_file_path": "macros/json_parse.sql", "unique_id": "macro.fivetran_utils.postgres__json_parse", "macro_sql": "{% macro postgres__json_parse(string, string_path) %}\n\n {{string}}::json #>> '{ {%- for s in string_path -%}{{ s }}{%- if not loop.last -%},{%- endif -%}{%- endfor -%} }'\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "string", "type": null, "description": ""}, {"name": "string_path", "type": null, "description": ""}], "created_at": 1789422566.957953, "supported_languages": null}, "macro.fivetran_utils.snowflake__json_parse": {"name": "snowflake__json_parse", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/json_parse.sql", "original_file_path": "macros/json_parse.sql", "unique_id": "macro.fivetran_utils.snowflake__json_parse", "macro_sql": "{% macro snowflake__json_parse(string, string_path) %}\n\n parse_json( {{string}} ) {%- for s in string_path -%}{% if s is number %}[{{ s }}]{% else %}['{{ s }}']{% endif %}{%- endfor -%}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "string", "type": null, "description": ""}, {"name": "string_path", "type": null, "description": ""}], "created_at": 1789422566.9584985, "supported_languages": null}, "macro.fivetran_utils.spark__json_parse": {"name": "spark__json_parse", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/json_parse.sql", "original_file_path": "macros/json_parse.sql", "unique_id": "macro.fivetran_utils.spark__json_parse", "macro_sql": "{% macro spark__json_parse(string, string_path) %}\n\n {{string}} : {%- for s in string_path -%}{% if s is number %}[{{ s }}]{% else %}['{{ s }}']{% endif %}{%- endfor -%}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "string", "type": null, "description": ""}, {"name": "string_path", "type": null, "description": ""}], "created_at": 1789422566.9590635, "supported_languages": null}, "macro.fivetran_utils.sqlserver__json_parse": {"name": "sqlserver__json_parse", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/json_parse.sql", "original_file_path": "macros/json_parse.sql", "unique_id": "macro.fivetran_utils.sqlserver__json_parse", "macro_sql": "{% macro sqlserver__json_parse(string, string_path) %}\n\n json_value({{string}}, '$.{%- for s in string_path -%}{{ s }}{%- if not loop.last -%}.{%- endif -%}{%- endfor -%} ')\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "string", "type": null, "description": ""}, {"name": "string_path", "type": null, "description": ""}], "created_at": 1789422566.959562, "supported_languages": null}, "macro.fivetran_utils.duckdb__json_parse": {"name": "duckdb__json_parse", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/json_parse.sql", "original_file_path": "macros/json_parse.sql", "unique_id": "macro.fivetran_utils.duckdb__json_parse", "macro_sql": "{% macro duckdb__json_parse(string, string_path) %}\n\n json_extract_string({{string}}, '${%- for s in string_path -%}{% if s is number %}[{{ s }}]{% else %}.{{ s }}{% endif %}{%- endfor -%}')\n \n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "string", "type": null, "description": ""}, {"name": "string_path", "type": null, "description": ""}], "created_at": 1789422566.9601202, "supported_languages": null}, "macro.fivetran_utils.union_relations_custom": {"name": "union_relations_custom", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/union_relations_custom.sql", "original_file_path": "macros/union_relations_custom.sql", "unique_id": "macro.fivetran_utils.union_relations_custom", "macro_sql": "{%- macro union_relations_custom(relations, aliases=none, column_override=none, include=[], exclude=[], source_column_name='_dbt_source_relation', where=none) -%}\n {{ return(adapter.dispatch('union_relations_custom', 'fivetran_utils')(relations, aliases, column_override, include, exclude, source_column_name, where)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.default__union_relations_custom"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relations", "type": null, "description": ""}, {"name": "aliases", "type": null, "description": ""}, {"name": "column_override", "type": null, "description": ""}, {"name": "include", "type": null, "description": ""}, {"name": "exclude", "type": null, "description": ""}, {"name": "source_column_name", "type": null, "description": ""}, {"name": "where", "type": null, "description": ""}], "created_at": 1789422566.962282, "supported_languages": null}, "macro.fivetran_utils.default__union_relations_custom": {"name": "default__union_relations_custom", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/union_relations_custom.sql", "original_file_path": "macros/union_relations_custom.sql", "unique_id": "macro.fivetran_utils.default__union_relations_custom", "macro_sql": "\n\n{%- macro default__union_relations_custom(relations, aliases=none, column_override=none, include=[], exclude=[], source_column_name='_dbt_source_relation', where=none) -%}\n\n {%- if exclude and include -%}\n {{ exceptions.raise_compiler_error(\"Both an exclude and include list were provided to the `union` macro. Only one is allowed\") }}\n {%- endif -%}\n\n {#-- Prevent querying of db in parsing mode. This works because this macro does not create any new refs. -#}\n {%- if not execute %}\n {{ return('') }}\n {% endif -%}\n\n {%- set column_override = column_override if column_override is not none else {} -%}\n\n {%- set relation_columns = {} -%}\n {%- set column_superset = {} -%}\n {%- set all_excludes = [] -%}\n {%- set all_includes = [] -%}\n\n {%- if exclude -%}\n {%- for exc in exclude -%}\n {%- do all_excludes.append(exc | lower) -%}\n {%- endfor -%}\n {%- endif -%}\n\n {%- if include -%}\n {%- for inc in include -%}\n {%- do all_includes.append(inc | lower) -%}\n {%- endfor -%}\n {%- endif -%}\n\n {%- for relation in relations -%}\n\n {%- do relation_columns.update({relation: []}) -%}\n\n {%- do dbt_utils._is_relation(relation, 'union_relations_custom') -%}\n {%- do dbt_utils._is_ephemeral(relation, 'union_relations_custom') -%}\n {%- set cols = adapter.get_columns_in_relation(relation) -%}\n {%- for col in cols -%}\n\n {#- If an exclude list was provided and the column is in the list, do nothing -#}\n {%- if exclude and col.column | lower in all_excludes -%}\n\n {#- If an include list was provided and the column is not in the list, do nothing -#}\n {%- elif include and col.column | lower not in all_includes -%}\n\n {#- Otherwise add the column to the column superset -#}\n {%- else -%}\n\n {#- update the list of columns in this relation -#}\n {%- do relation_columns[relation].append(col.column) -%}\n\n {%- if col.column in column_superset -%}\n\n {%- set stored = column_superset[col.column] -%}\n {%- if col.is_string() and stored.is_string() and col.string_size() > stored.string_size() -%}\n\n {%- do column_superset.update({col.column: col}) -%}\n\n {%- endif %}\n\n {%- else -%}\n\n {%- do column_superset.update({col.column: col}) -%}\n\n {%- endif -%}\n\n {%- endif -%}\n\n {%- endfor -%}\n {%- endfor -%}\n\n {%- set ordered_column_names = column_superset.keys() -%}\n {%- set dbt_command = flags.WHICH -%}\n\n\n {% if dbt_command in ['run', 'build'] %}\n {% if (include | length > 0 or exclude | length > 0) and not column_superset.keys() %}\n {%- set relations_string -%}\n {%- for relation in relations -%}\n {{ relation.name }}\n {%- if not loop.last %}, {% endif -%}\n {%- endfor -%}\n {%- endset -%}\n\n {%- set error_message -%}\n There were no columns found to union for relations {{ relations_string }}\n {%- endset -%}\n\n {{ exceptions.raise_compiler_error(error_message) }}\n {%- endif -%}\n {%- endif -%}\n\n {%- for relation in relations %}\n\n (\n select\n\n {%- if source_column_name is not none %}\n {# dbt_utils union_relations includes the table in the source_relation. For Fivetran dbt package purposes the table should not be included in the source relation. #}\n cast({{ dbt.string_literal(relation.database ~ '.' ~ relation.schema) }} as {{ dbt.type_string() }}) as {{ source_column_name }},\n {%- endif %}\n\n {% for col_name in ordered_column_names -%}\n\n {%- set col = column_superset[col_name] %}\n {%- set col_type = column_override.get(col.column, col.data_type) %}\n {%- set col_name = adapter.quote(col_name) if col_name in relation_columns[relation] else 'null' %}\n cast({{ col_name }} as {{ col_type }}) as {{ col.quoted }} {% if not loop.last %},{% endif -%}\n\n {%- endfor %}\n \n {# This alias is a change from dbt_utils union_relations code. Avoids errors if the table is named a reserved keyword #}\n from {{ aliases[loop.index0] if aliases else relation }} as unioned_relation_{{ loop.index }}\n\n {% if where -%}\n where {{ where }}\n {%- endif %}\n )\n\n {% if not loop.last -%}\n union all\n {% endif -%}\n\n {%- endfor -%}\n\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt_utils._is_relation", "macro.dbt_utils._is_ephemeral", "macro.dbt.string_literal", "macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relations", "type": null, "description": ""}, {"name": "aliases", "type": null, "description": ""}, {"name": "column_override", "type": null, "description": ""}, {"name": "include", "type": null, "description": ""}, {"name": "exclude", "type": null, "description": ""}, {"name": "source_column_name", "type": null, "description": ""}, {"name": "where", "type": null, "description": ""}], "created_at": 1789422566.96965, "supported_languages": null}, "macro.fivetran_utils.seed_data_helper": {"name": "seed_data_helper", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/seed_data_helper.sql", "original_file_path": "macros/seed_data_helper.sql", "unique_id": "macro.fivetran_utils.seed_data_helper", "macro_sql": "{% macro seed_data_helper(seed_name, warehouses) %}\n\n{% if target.type in warehouses %}\n {% for w in warehouses %}\n {% if target.type == w %}\n {{ return(ref(seed_name ~ \"_\" ~ w ~ \"\")) }}\n {% endif %}\n {% endfor %}\n{% else %}\n{{ return(ref(seed_name)) }}\n{% endif %}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "seed_name", "type": null, "description": ""}, {"name": "warehouses", "type": null, "description": ""}], "created_at": 1789422566.970872, "supported_languages": null}, "macro.fivetran_utils.drop_schemas_automation": {"name": "drop_schemas_automation", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/drop_schemas_automation.sql", "original_file_path": "macros/drop_schemas_automation.sql", "unique_id": "macro.fivetran_utils.drop_schemas_automation", "macro_sql": "{% macro drop_schemas_automation(drop_target_schema=true) %}\n {{ return(adapter.dispatch('drop_schemas_automation', 'fivetran_utils')(drop_target_schema)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.default__drop_schemas_automation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "drop_target_schema", "type": null, "description": ""}], "created_at": 1789422566.9718199, "supported_languages": null}, "macro.fivetran_utils.default__drop_schemas_automation": {"name": "default__drop_schemas_automation", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/drop_schemas_automation.sql", "original_file_path": "macros/drop_schemas_automation.sql", "unique_id": "macro.fivetran_utils.default__drop_schemas_automation", "macro_sql": "{% macro default__drop_schemas_automation(drop_target_schema=true) %}\n\n{% set fetch_list_sql %}\n {% if target.type not in ('databricks', 'spark') %}\n select schema_name\n from \n {{ wrap_in_quotes(target.database) }}.INFORMATION_SCHEMA.SCHEMATA\n where lower(schema_name) like '{{ target.schema | lower }}{%- if not drop_target_schema -%}_{%- endif -%}%'\n {% else %}\n SHOW SCHEMAS LIKE '{{ target.schema }}{%- if not drop_target_schema -%}_{%- endif -%}*'\n {% endif %}\n{% endset %}\n\n{% set results = run_query(fetch_list_sql) %}\n\n{% if execute %}\n {% set results_list = results.columns[0].values() %}\n{% else %}\n {% set results_list = [] %}\n{% endif %}\n\n{% for schema_to_drop in results_list %}\n {% do adapter.drop_schema(api.Relation.create(database=target.database, schema=schema_to_drop)) %}\n {{ print('Schema ' ~ schema_to_drop ~ ' successfully dropped from the ' ~ target.database ~ ' database.\\n')}}\n{% endfor %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.wrap_in_quotes", "macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "drop_target_schema", "type": null, "description": ""}], "created_at": 1789422566.973866, "supported_languages": null}, "macro.fivetran_utils.duckdb__drop_schemas_automation": {"name": "duckdb__drop_schemas_automation", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/drop_schemas_automation.sql", "original_file_path": "macros/drop_schemas_automation.sql", "unique_id": "macro.fivetran_utils.duckdb__drop_schemas_automation", "macro_sql": "{% macro duckdb__drop_schemas_automation(drop_target_schema=true) %}\n\n {{ print('Not dropping any schemas in DuckDB.\\n') }}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "drop_target_schema", "type": null, "description": ""}], "created_at": 1789422566.9741857, "supported_languages": null}, "macro.fivetran_utils.ceiling": {"name": "ceiling", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/ceiling.sql", "original_file_path": "macros/ceiling.sql", "unique_id": "macro.fivetran_utils.ceiling", "macro_sql": "{% macro ceiling(num) -%}\n\n{{ adapter.dispatch('ceiling', 'fivetran_utils') (num) }}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.default__ceiling"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "num", "type": null, "description": ""}], "created_at": 1789422566.974717, "supported_languages": null}, "macro.fivetran_utils.default__ceiling": {"name": "default__ceiling", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/ceiling.sql", "original_file_path": "macros/ceiling.sql", "unique_id": "macro.fivetran_utils.default__ceiling", "macro_sql": "{% macro default__ceiling(num) %}\n ceiling({{ num }})\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "num", "type": null, "description": ""}], "created_at": 1789422566.9749465, "supported_languages": null}, "macro.fivetran_utils.snowflake__ceiling": {"name": "snowflake__ceiling", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/ceiling.sql", "original_file_path": "macros/ceiling.sql", "unique_id": "macro.fivetran_utils.snowflake__ceiling", "macro_sql": "{% macro snowflake__ceiling(num) %}\n ceil({{ num }})\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "num", "type": null, "description": ""}], "created_at": 1789422566.9751635, "supported_languages": null}, "macro.fivetran_utils.fill_pass_through_columns": {"name": "fill_pass_through_columns", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/fill_pass_through_columns.sql", "original_file_path": "macros/fill_pass_through_columns.sql", "unique_id": "macro.fivetran_utils.fill_pass_through_columns", "macro_sql": "{% macro fill_pass_through_columns(pass_through_variable) %}\n\n{% if var(pass_through_variable) %}\n {% for field in var(pass_through_variable) %}\n {% if field is mapping %}\n {% if field.transform_sql %}\n , {{ field.transform_sql }} as {{ field.alias if field.alias else field.name }}\n {% else %}\n , {{ field.alias if field.alias else field.name }}\n {% endif %}\n {% else %}\n , {{ field }}\n {% endif %}\n {% endfor %}\n{% endif %}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "pass_through_variable", "type": null, "description": ""}], "created_at": 1789422566.976541, "supported_languages": null}, "macro.fivetran_utils.persist_pass_through_columns": {"name": "persist_pass_through_columns", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/persist_pass_through_columns.sql", "original_file_path": "macros/persist_pass_through_columns.sql", "unique_id": "macro.fivetran_utils.persist_pass_through_columns", "macro_sql": "{% macro persist_pass_through_columns(pass_through_variable, identifier=none, transform='') %}\n\n{% if var(pass_through_variable, none) %}\n {% for field in var(pass_through_variable) %}\n , {{ transform ~ '(' ~ (identifier ~ '.' if identifier else '') ~ (field.alias if field.alias else field.name) ~ ')' }} as {{ field.alias if field.alias else field.name }}\n {% endfor %}\n{% endif %}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "pass_through_variable", "type": null, "description": ""}, {"name": "identifier", "type": null, "description": ""}, {"name": "transform", "type": null, "description": ""}], "created_at": 1789422566.9778264, "supported_languages": null}, "macro.fivetran_utils.try_cast": {"name": "try_cast", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/try_cast.sql", "original_file_path": "macros/try_cast.sql", "unique_id": "macro.fivetran_utils.try_cast", "macro_sql": "{% macro try_cast(field, type) %}\n {{ adapter.dispatch('try_cast', 'fivetran_utils') (field, type) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.postgres__try_cast"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field", "type": null, "description": ""}, {"name": "type", "type": null, "description": ""}], "created_at": 1789422566.978827, "supported_languages": null}, "macro.fivetran_utils.default__try_cast": {"name": "default__try_cast", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/try_cast.sql", "original_file_path": "macros/try_cast.sql", "unique_id": "macro.fivetran_utils.default__try_cast", "macro_sql": "{% macro default__try_cast(field, type) %}\n {# most databases don't support this function yet\n so we just need to use cast #}\n cast({{field}} as {{type}})\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field", "type": null, "description": ""}, {"name": "type", "type": null, "description": ""}], "created_at": 1789422566.9791296, "supported_languages": null}, "macro.fivetran_utils.redshift__try_cast": {"name": "redshift__try_cast", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/try_cast.sql", "original_file_path": "macros/try_cast.sql", "unique_id": "macro.fivetran_utils.redshift__try_cast", "macro_sql": "{% macro redshift__try_cast(field, type) %}\n{%- if type == 'numeric' -%}\n\n case\n when trim({{field}}) ~ '^(0|[1-9][0-9]*)$' then trim({{field}})\n else null\n end::{{type}}\n\n{% else %}\n {{ exceptions.raise_compiler_error(\n \"non-numeric datatypes are not currently supported\") }}\n\n{% endif %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field", "type": null, "description": ""}, {"name": "type", "type": null, "description": ""}], "created_at": 1789422566.979775, "supported_languages": null}, "macro.fivetran_utils.postgres__try_cast": {"name": "postgres__try_cast", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/try_cast.sql", "original_file_path": "macros/try_cast.sql", "unique_id": "macro.fivetran_utils.postgres__try_cast", "macro_sql": "{% macro postgres__try_cast(field, type) %}\n{%- if type == 'numeric' -%}\n\n case\n when replace(cast({{field}} as varchar),cast(' ' as varchar),cast('' as varchar)) ~ '^(0|[1-9][0-9]*)$' \n then replace(cast({{field}} as varchar),cast(' ' as varchar),cast('' as varchar))\n else null\n end::{{type}}\n\n{% else %}\n {{ exceptions.raise_compiler_error(\n \"non-numeric datatypes are not currently supported\") }}\n\n{% endif %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field", "type": null, "description": ""}, {"name": "type", "type": null, "description": ""}], "created_at": 1789422566.9803689, "supported_languages": null}, "macro.fivetran_utils.snowflake__try_cast": {"name": "snowflake__try_cast", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/try_cast.sql", "original_file_path": "macros/try_cast.sql", "unique_id": "macro.fivetran_utils.snowflake__try_cast", "macro_sql": "{% macro snowflake__try_cast(field, type) %}\n try_cast(cast({{field}} as varchar) as {{type}})\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field", "type": null, "description": ""}, {"name": "type", "type": null, "description": ""}], "created_at": 1789422566.9806774, "supported_languages": null}, "macro.fivetran_utils.bigquery__try_cast": {"name": "bigquery__try_cast", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/try_cast.sql", "original_file_path": "macros/try_cast.sql", "unique_id": "macro.fivetran_utils.bigquery__try_cast", "macro_sql": "{% macro bigquery__try_cast(field, type) %}\n safe_cast({{field}} as {{type}})\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field", "type": null, "description": ""}, {"name": "type", "type": null, "description": ""}], "created_at": 1789422566.9811075, "supported_languages": null}, "macro.fivetran_utils.spark__try_cast": {"name": "spark__try_cast", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/try_cast.sql", "original_file_path": "macros/try_cast.sql", "unique_id": "macro.fivetran_utils.spark__try_cast", "macro_sql": "{% macro spark__try_cast(field, type) %}\n try_cast({{field}} as {{type}})\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field", "type": null, "description": ""}, {"name": "type", "type": null, "description": ""}], "created_at": 1789422566.9813786, "supported_languages": null}, "macro.fivetran_utils.sqlserver__try_cast": {"name": "sqlserver__try_cast", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/try_cast.sql", "original_file_path": "macros/try_cast.sql", "unique_id": "macro.fivetran_utils.sqlserver__try_cast", "macro_sql": "{% macro sqlserver__try_cast(field, type) %}\n try_cast({{field}} as {{type}})\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field", "type": null, "description": ""}, {"name": "type", "type": null, "description": ""}], "created_at": 1789422566.9816737, "supported_languages": null}, "macro.fivetran_utils.fivetran_date_spine": {"name": "fivetran_date_spine", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/fivetran_date_spine.sql", "original_file_path": "macros/fivetran_date_spine.sql", "unique_id": "macro.fivetran_utils.fivetran_date_spine", "macro_sql": "{% macro fivetran_date_spine(datepart, start_date, end_date) -%}\n\n{{ return(adapter.dispatch('fivetran_date_spine', 'fivetran_utils') (datepart, start_date, end_date)) }}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.default__fivetran_date_spine"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "datepart", "type": null, "description": ""}, {"name": "start_date", "type": null, "description": ""}, {"name": "end_date", "type": null, "description": ""}], "created_at": 1789422566.9827187, "supported_languages": null}, "macro.fivetran_utils.default__fivetran_date_spine": {"name": "default__fivetran_date_spine", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/fivetran_date_spine.sql", "original_file_path": "macros/fivetran_date_spine.sql", "unique_id": "macro.fivetran_utils.default__fivetran_date_spine", "macro_sql": "{% macro default__fivetran_date_spine(datepart, start_date, end_date) %}\n\n {{ dbt_utils.date_spine(datepart, start_date, end_date) }}\n \n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.date_spine"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "datepart", "type": null, "description": ""}, {"name": "start_date", "type": null, "description": ""}, {"name": "end_date", "type": null, "description": ""}], "created_at": 1789422566.9830935, "supported_languages": null}, "macro.fivetran_utils.sqlserver__fivetran_date_spine": {"name": "sqlserver__fivetran_date_spine", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/fivetran_date_spine.sql", "original_file_path": "macros/fivetran_date_spine.sql", "unique_id": "macro.fivetran_utils.sqlserver__fivetran_date_spine", "macro_sql": "{% macro sqlserver__fivetran_date_spine(datepart, start_date, end_date) -%}\n\n {% set date_spine_query %}\n with\n\n l0 as (\n\n select c\n from (select 1 union all select 1) as d(c)\n\n ),\n l1 as (\n\n select\n 1 as c\n from l0 as a\n cross join l0 as b\n\n ),\n\n l2 as (\n\n select 1 as c\n from l1 as a\n cross join l1 as b\n ),\n\n l3 as (\n\n select 1 as c\n from l2 as a\n cross join l2 as b\n ),\n\n l4 as (\n\n select 1 as c\n from l3 as a\n cross join l3 as b\n ),\n\n l5 as (\n\n select 1 as c\n from l4 as a\n cross join l4 as b\n ),\n\n nums as (\n\n select row_number() over (order by (select null)) as rownum\n from l5\n ),\n\n rawdata as (\n\n select top ({{dbt.datediff(start_date, end_date, datepart)}}) rownum -1 as n\n from nums\n order by rownum\n ),\n\n all_periods as (\n\n select (\n {{\n dbt.dateadd(\n datepart,\n 'n',\n start_date\n )\n }}\n ) as date_{{datepart}}\n from rawdata\n ),\n\n filtered as (\n\n select *\n from all_periods\n where date_{{datepart}} <= {{ end_date }}\n\n )\n\n select * from filtered\n order by 1\n\n {% endset %}\n\n {% set results = run_query(date_spine_query) %}\n\n {% if execute %}\n\n {% set results_list = results.columns[0].values() %}\n \n {% else %}\n\n {% set results_list = [] %}\n\n {% endif %}\n\n {%- for date_field in results_list %}\n select cast('{{ date_field }}' as date) as date_{{datepart}} {{ 'union all ' if not loop.last else '' }}\n {% endfor -%}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.datediff", "macro.dbt.dateadd", "macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "datepart", "type": null, "description": ""}, {"name": "start_date", "type": null, "description": ""}, {"name": "end_date", "type": null, "description": ""}], "created_at": 1789422566.9847863, "supported_languages": null}, "macro.fivetran_utils.partition_by_source_relation": {"name": "partition_by_source_relation", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/partition_by_source_relation.sql", "original_file_path": "macros/partition_by_source_relation.sql", "unique_id": "macro.fivetran_utils.partition_by_source_relation", "macro_sql": "{% macro partition_by_source_relation(package_name, has_other_partitions='yes', alias=None, package_prefix_union_variable=true) %}\n {{ return(adapter.dispatch('partition_by_source_relation', 'fivetran_utils')(package_name, has_other_partitions, alias, package_prefix_union_variable)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.default__partition_by_source_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "package_name", "type": null, "description": ""}, {"name": "has_other_partitions", "type": null, "description": ""}, {"name": "alias", "type": null, "description": ""}, {"name": "package_prefix_union_variable", "type": null, "description": ""}], "created_at": 1789422566.9858522, "supported_languages": null}, "macro.fivetran_utils.default__partition_by_source_relation": {"name": "default__partition_by_source_relation", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/partition_by_source_relation.sql", "original_file_path": "macros/partition_by_source_relation.sql", "unique_id": "macro.fivetran_utils.default__partition_by_source_relation", "macro_sql": "{% macro default__partition_by_source_relation(package_name, has_other_partitions='yes', alias=None, package_prefix_union_variable=true) -%}\n\n{%- if package_prefix_union_variable %}\n {%- set union_schemas_var = package_name ~ '_union_schemas' -%}\n {%- set union_databases_var = package_name ~ '_union_databases' -%}\n{%- else %}\n {%- set union_schemas_var = 'union_schemas' -%}\n {%- set union_databases_var = 'union_databases' -%}\n{%- endif -%}\n\n{%- set is_unioning = var(union_schemas_var, [])|length > 1 or var(union_databases_var, [])|length > 1 or var(package_name ~ '_sources', [])|length > 1 -%}\n{%- set prefix = '' if alias is none else alias ~ '.' -%}\n\n{%- if has_other_partitions == 'no' -%}\n {{- 'partition by ' ~ prefix ~ 'source_relation' if is_unioning else '' -}}\n{%- else -%}\n {{- ', ' ~ prefix ~ 'source_relation' if is_unioning else '' -}}\n{%- endif -%}\n\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "package_name", "type": null, "description": ""}, {"name": "has_other_partitions", "type": null, "description": ""}, {"name": "alias", "type": null, "description": ""}, {"name": "package_prefix_union_variable", "type": null, "description": ""}], "created_at": 1789422566.987704, "supported_languages": null}, "macro.fivetran_utils.fill_staging_columns": {"name": "fill_staging_columns", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/fill_staging_columns.sql", "original_file_path": "macros/fill_staging_columns.sql", "unique_id": "macro.fivetran_utils.fill_staging_columns", "macro_sql": "{% macro fill_staging_columns(source_columns, staging_columns) %}\n\n{%- set source_column_names = source_columns|map(attribute='name')|map('lower')|list -%}\n{%- set using_source_casing = var('fivetran_using_source_casing', false) -%}\n\n{%- for column in staging_columns %}\n {%- if column.name|lower in source_column_names %}\n {%- if using_source_casing %}\n {%- set column_alias = column.alias if 'alias' in column else column.name %}\n {{ adapter.quote(column.name) }} as {{ adapter.quote(column_alias|upper if target.type == 'snowflake' else column_alias) }}\n {%- else %}\n {{ fivetran_utils.quote_column(column) }} as\n {%- if 'alias' in column %} {{ column.alias }}{% else %} {{ fivetran_utils.quote_column(column) }}{% endif %}\n {%- endif %}\n {%- else %}\n cast(null as {{ column.datatype }}) as\n {%- if 'alias' in column %} {{ column.alias }}{% else %} {{ fivetran_utils.quote_column(column) }}{% endif %}\n {%- endif %}{{ ',' if not loop.last }}\n{%- endfor %}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.quote_column"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "source_columns", "type": null, "description": ""}, {"name": "staging_columns", "type": null, "description": ""}], "created_at": 1789422566.990676, "supported_languages": null}, "macro.fivetran_utils.quote_column": {"name": "quote_column", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/fill_staging_columns.sql", "original_file_path": "macros/fill_staging_columns.sql", "unique_id": "macro.fivetran_utils.quote_column", "macro_sql": "{% macro quote_column(column) %}\n {%- if 'quote' in column %}\n {%- if column.quote %}\n {%- if target.type in ('bigquery', 'spark', 'databricks') %}\n `{{ column.name }}`\n {%- elif target.type == 'snowflake' %}\n \"{{ column.name | upper }}\"\n {%- else %}\n \"{{ column.name }}\"\n {%- endif %}\n {%- else %}{{ column.name }}\n {%- endif %}\n {%- else %}{{ column.name }}\n {%- endif %}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "column", "type": null, "description": ""}], "created_at": 1789422566.9924278, "supported_languages": null}, "macro.fivetran_utils.union_connections": {"name": "union_connections", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/union_connections.sql", "original_file_path": "macros/union_connections.sql", "unique_id": "macro.fivetran_utils.union_connections", "macro_sql": "{% macro union_connections(connection_dictionary, single_source_name, single_table_name, default_identifier=single_table_name) %}\n\n{{ adapter.dispatch('union_connections', 'fivetran_utils') (connection_dictionary, single_source_name, single_table_name, default_identifier) }}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.default__union_connections"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "connection_dictionary", "type": null, "description": ""}, {"name": "single_source_name", "type": null, "description": ""}, {"name": "single_table_name", "type": null, "description": ""}, {"name": "default_identifier", "type": null, "description": ""}], "created_at": 1789422566.9939523, "supported_languages": null}, "macro.fivetran_utils.default__union_connections": {"name": "default__union_connections", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/union_connections.sql", "original_file_path": "macros/union_connections.sql", "unique_id": "macro.fivetran_utils.default__union_connections", "macro_sql": "{% macro default__union_connections(connection_dictionary, single_source_name, single_table_name, default_identifier=single_table_name) %}\n\n{%- set exception_warning = \"\\n\\nPlease be aware: The \" ~ single_source_name|upper ~ \".\" ~ single_table_name|upper ~ \" table was not found in your schema(s). The Fivetran Data Model will create a completely empty staging model as to not break downstream transformations. To turn off these warnings, set the `fivetran__remove_empty_table_warnings` variable to TRUE (see https://github.com/fivetran/dbt_fivetran_utils/tree/releases/v0.4.latest#union_connections-source for details).\\n\"%}\n{%- set using_empty_table_warnings = (execute and not var('fivetran__remove_empty_table_warnings', false)) %}\n{%- set connections = var(connection_dictionary, []) %}\n{%- set using_unioning = connections | length > 0 %}\n{%- set identifier_var = single_source_name + \"_\" + single_table_name + \"_identifier\" %}\n\n{%- if using_unioning %}\n{# For unioning #}\n {%- set relations = [] -%}\n {%- for connection in connections -%}\n\n {% if var('has_defined_sources', false) %}\n {%- set database = source(connection.name, single_table_name).database %}\n {%- set schema = source(connection.name, single_table_name).schema %}\n {%- set identifier = source(connection.name, single_table_name).identifier %}\n {%- else %}\n {%- set database = connection.database if connection.database else target.database %}\n {%- set schema = connection.schema if connection.schema else single_source_name %}\n {%- set identifier = var(identifier_var, default_identifier) %}\n {%- endif %}\n \n {%- set relation=adapter.get_relation(\n database=database,\n schema=schema,\n identifier=identifier\n )\n -%}\n\n {%- if relation is not none -%}\n {%- do relations.append(relation) -%}\n {%- endif -%}\n\n -- ** Values passed to adapter.get_relation:\n {{ '-- database: ' ~ database }}\n {{ '-- schema: ' ~ schema }}\n {{ '-- identifier: ' ~ identifier ~ '\\n' }}\n\n {%- endfor -%}\n\n {%- if relations | length > 0 -%}\n {{ fivetran_utils.union_relations_custom(relations, source_column_name='_dbt_source_relation') }}\n\n {%- else -%}\n {{ exceptions.warn(exception_warning) if using_empty_table_warnings }}\n\n select\n cast(null as {{ dbt.type_string() }}) as _dbt_source_relation\n limit {{ '0' if target.type != 'redshift' else '1' }}\n {%- endif -%}\n\n{% else %}\n{# Not unioning #}\n\n {%- set database = source(single_source_name, single_table_name).database %}\n {%- set schema = source(single_source_name, single_table_name).schema %}\n {%- set identifier = var(identifier_var, default_identifier) %}\n\n {%- set relation=adapter.get_relation(\n database=database,\n schema=schema,\n identifier=identifier\n )\n -%}\n\n -- ** Values passed to adapter.get_relation:\n {{ '-- full-identifier_var: ' ~ identifier_var }}\n {{ '-- database: ' ~ database }} \n {{ '-- schema: ' ~ schema }}\n {{ '-- identifier: ' ~ identifier ~ '\\n' }}\n\n {% if relation is not none -%}\n select\n {{ dbt_utils.star(from=source(single_source_name, single_table_name)) }}\n from {{ source(single_source_name, single_table_name) }} as source_table\n\n {% else %}\n {{ exceptions.warn(exception_warning) if using_empty_table_warnings }}\n\n select\n cast(null as {{ dbt.type_string() }}) as _dbt_source_relation\n limit {{ '0' if target.type != 'redshift' else '1' }}\n {%- endif -%}\n{% endif -%}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.union_relations_custom", "macro.dbt.type_string", "macro.dbt_utils.star"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "connection_dictionary", "type": null, "description": ""}, {"name": "single_source_name", "type": null, "description": ""}, {"name": "single_table_name", "type": null, "description": ""}, {"name": "default_identifier", "type": null, "description": ""}], "created_at": 1789422566.9994524, "supported_languages": null}, "macro.fivetran_utils.source_relation": {"name": "source_relation", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/source_relation.sql", "original_file_path": "macros/source_relation.sql", "unique_id": "macro.fivetran_utils.source_relation", "macro_sql": "{% macro source_relation(union_schema_variable='union_schemas', union_database_variable='union_databases') -%}\n\n{{ adapter.dispatch('source_relation', 'fivetran_utils') (union_schema_variable, union_database_variable) }}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.default__source_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "union_schema_variable", "type": null, "description": ""}, {"name": "union_database_variable", "type": null, "description": ""}], "created_at": 1789422567.0002692, "supported_languages": null}, "macro.fivetran_utils.default__source_relation": {"name": "default__source_relation", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/source_relation.sql", "original_file_path": "macros/source_relation.sql", "unique_id": "macro.fivetran_utils.default__source_relation", "macro_sql": "{% macro default__source_relation(union_schema_variable, union_database_variable) %}\n\n{% if var(union_schema_variable, none) %}\n, case\n {% for schema in var(union_schema_variable) %}\n when lower(replace(replace(_dbt_source_relation,'\"',''),'`','')) like '%.{{ schema|lower }}.%' then '{{ schema|lower }}'\n {% endfor %}\n end as source_relation\n{% elif var(union_database_variable, none) %}\n, case\n {% for database in var(union_database_variable) %}\n when lower(replace(replace(_dbt_source_relation,'\"',''),'`','')) like '%{{ database|lower }}.%' then '{{ database|lower }}'\n {% endfor %}\n end as source_relation\n{% else %}\n, cast('' as {{ dbt.type_string() }}) as source_relation\n{% endif %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "union_schema_variable", "type": null, "description": ""}, {"name": "union_database_variable", "type": null, "description": ""}], "created_at": 1789422567.0014277, "supported_languages": null}, "macro.fivetran_utils.apply_source_relation": {"name": "apply_source_relation", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/apply_source_relation.sql", "original_file_path": "macros/apply_source_relation.sql", "unique_id": "macro.fivetran_utils.apply_source_relation", "macro_sql": "{% macro apply_source_relation(package_name, use_package_prefix=true) -%}\n\n{{ adapter.dispatch('apply_source_relation', 'fivetran_utils') (package_name, use_package_prefix) }}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.default__apply_source_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "package_name", "type": null, "description": ""}, {"name": "use_package_prefix", "type": null, "description": ""}], "created_at": 1789422567.0022898, "supported_languages": null}, "macro.fivetran_utils.default__apply_source_relation": {"name": "default__apply_source_relation", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/apply_source_relation.sql", "original_file_path": "macros/apply_source_relation.sql", "unique_id": "macro.fivetran_utils.default__apply_source_relation", "macro_sql": "{% macro default__apply_source_relation(package_name, use_package_prefix=true) -%}\n\n{% set sources_var = package_name ~ '_sources' %}\n{% set database_var = package_name ~ '_database' %}\n{% set schema_var = package_name ~ '_schema' %}\n\n{% if use_package_prefix %}\n {% set union_schemas_var = package_name ~ '_union_schemas' %}\n {% set union_databases_var = package_name ~ '_union_databases' %}\n{% else %}\n {% set union_schemas_var = 'union_schemas' %}\n {% set union_databases_var = 'union_databases' %}\n{% endif %}\n\n{% if var(sources_var, []) | length > 0 %}\n, _dbt_source_relation as source_relation\n{% elif var(union_schemas_var, []) | length > 0 or var(union_databases_var, []) | length > 0 %}\n{{ fivetran_utils.source_relation(union_schema_variable=union_schemas_var, union_database_variable=union_databases_var) }}\n{% else %}\n{% set database = var(database_var, target.database) %}\n{% set schema = var(schema_var, package_name) %}\n, cast('{{ database ~ \".\" ~ schema }}' as {{ dbt.type_string() }}) as source_relation\n{% endif %}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.source_relation", "macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "package_name", "type": null, "description": ""}, {"name": "use_package_prefix", "type": null, "description": ""}], "created_at": 1789422567.0045087, "supported_languages": null}, "macro.fivetran_utils.calculated_fields": {"name": "calculated_fields", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/calculated_fields.sql", "original_file_path": "macros/calculated_fields.sql", "unique_id": "macro.fivetran_utils.calculated_fields", "macro_sql": "{% macro calculated_fields(variable) -%}\n\n{% if var(variable, none) %}\n {% for field in var(variable) %}\n , {{ field.transform_sql }} as {{ field.name }} \n {% endfor %}\n{% endif %}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "variable", "type": null, "description": ""}], "created_at": 1789422567.0052843, "supported_languages": null}, "macro.fivetran_utils.union_data": {"name": "union_data", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/union_data.sql", "original_file_path": "macros/union_data.sql", "unique_id": "macro.fivetran_utils.union_data", "macro_sql": "{%- macro union_data(table_identifier, database_variable, schema_variable, default_database, default_schema, default_variable, union_schema_variable='union_schemas', union_database_variable='union_databases') -%}\n\n{{ adapter.dispatch('union_data', 'fivetran_utils') (\n table_identifier, \n database_variable, \n schema_variable, \n default_database, \n default_schema, \n default_variable,\n union_schema_variable,\n union_database_variable\n ) }}\n\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.fivetran_utils.default__union_data"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "table_identifier", "type": null, "description": ""}, {"name": "database_variable", "type": null, "description": ""}, {"name": "schema_variable", "type": null, "description": ""}, {"name": "default_database", "type": null, "description": ""}, {"name": "default_schema", "type": null, "description": ""}, {"name": "default_variable", "type": null, "description": ""}, {"name": "union_schema_variable", "type": null, "description": ""}, {"name": "union_database_variable", "type": null, "description": ""}], "created_at": 1789422567.007518, "supported_languages": null}, "macro.fivetran_utils.default__union_data": {"name": "default__union_data", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/union_data.sql", "original_file_path": "macros/union_data.sql", "unique_id": "macro.fivetran_utils.default__union_data", "macro_sql": "{%- macro default__union_data(\n table_identifier, \n database_variable, \n schema_variable, \n default_database, \n default_schema, \n default_variable,\n union_schema_variable,\n union_database_variable\n ) -%}\n\n{%- if var(union_schema_variable, none) -%}\n\n {%- set relations = [] -%}\n \n {%- if var(union_schema_variable) is string -%}\n {%- set trimmed = var(union_schema_variable)|trim('[')|trim(']') -%}\n {%- set schemas = trimmed.split(',')|map('trim',\" \")|map('trim','\"')|map('trim',\"'\") -%}\n {%- else -%}\n {%- set schemas = var(union_schema_variable) -%}\n {%- endif -%}\n\n {%- for schema in var(union_schema_variable) -%}\n {%- set relation=adapter.get_relation(\n database=source(schema, table_identifier).database if var('has_defined_sources', false) else var(database_variable, default_database),\n schema=source(schema, table_identifier).schema if var('has_defined_sources', false) else schema,\n identifier=source(schema, table_identifier).identifier if var('has_defined_sources', false) else table_identifier\n ) -%}\n \n {%- set relation_exists=relation is not none -%}\n\n {%- if relation_exists -%}\n {%- do relations.append(relation) -%}\n {%- endif -%}\n\n {%- endfor -%}\n \n {%- if relations != [] -%}\n {{ dbt_utils.union_relations(relations) }}\n {%- else -%}\n {% if execute and not var('fivetran__remove_empty_table_warnings', false) -%}\n {{ exceptions.warn(\"\\n\\nPlease be aware: The \" ~ table_identifier|upper ~ \" table was not found in your \" ~ default_schema|upper ~ \" schema(s). The Fivetran dbt package will create a completely empty \" ~ table_identifier|upper ~ \" staging model as to not break downstream transformations. To turn off these warnings, set the `fivetran__remove_empty_table_warnings` variable to TRUE (see https://github.com/fivetran/dbt_fivetran_utils/tree/releases/v0.4.latest#union_data-source for details).\\n\") }}\n {% endif -%}\n select \n cast(null as {{ dbt.type_string() }}) as _dbt_source_relation\n limit 0\n {%- endif -%}\n\n{%- elif var(union_database_variable, none) -%}\n\n {%- set relations = [] -%}\n\n {%- for database in var(union_database_variable) -%}\n {%- set relation=adapter.get_relation(\n database=source(schema, table_identifier).database if var('has_defined_sources', false) else database,\n schema=source(schema, table_identifier).schema if var('has_defined_sources', false) else var(schema_variable, default_schema),\n identifier=source(schema, table_identifier).identifier if var('has_defined_sources', false) else table_identifier\n ) -%}\n\n {%- set relation_exists=relation is not none -%}\n\n {%- if relation_exists -%}\n {%- do relations.append(relation) -%}\n {%- endif -%}\n\n {%- endfor -%}\n\n {%- if relations != [] -%}\n {{ dbt_utils.union_relations(relations) }}\n {%- else -%}\n {% if execute and not var('fivetran__remove_empty_table_warnings', false) -%}\n {{ exceptions.warn(\"\\n\\nPlease be aware: The \" ~ table_identifier|upper ~ \" table was not found in your \" ~ default_schema|upper ~ \" schema(s). The Fivetran dbt package will create a completely empty \" ~ table_identifier|upper ~ \" staging model as to not break downstream transformations. To turn off these warnings, set the `fivetran__remove_empty_table_warnings` variable to TRUE (see https://github.com/fivetran/dbt_fivetran_utils/tree/releases/v0.4.latest#union_data-source for details).\\n\") }}\n {% endif -%}\n select \n cast(null as {{ dbt.type_string() }}) as _dbt_source_relation\n limit 0\n {%- endif -%}\n\n{%- else -%}\n {% set exception_schemas = {\"linkedin_company_pages\": \"linkedin_pages\", \"instagram_business_pages\": \"instagram_business\"} %}\n {% set relation = namespace(value=\"\") %}\n {% if default_schema in exception_schemas.keys() %}\n {% for corrected_schema_name in exception_schemas.items() %} \n {% if default_schema in corrected_schema_name %}\n {# In order for this macro to effectively work within upstream integration tests (mainly used by the Fivetran dbt package maintainers), this identifier variable selection is required to use the macro with different identifier names. #}\n {% set identifier_var = corrected_schema_name[1] + \"_\" + table_identifier + \"_identifier\" %}\n {%- set relation.value=adapter.get_relation(\n database=source(corrected_schema_name[1], table_identifier).database,\n schema=source(corrected_schema_name[1], table_identifier).schema,\n identifier=var(identifier_var, table_identifier)\n ) -%}\n {% endif %}\n {% endfor %}\n {% else %}\n {# In order for this macro to effectively work within upstream integration tests (mainly used by the Fivetran dbt package maintainers), this identifier variable selection is required to use the macro with different identifier names. #}\n {% set identifier_var = default_schema + \"_\" + table_identifier + \"_identifier\" %}\n {# Unfortunately the Twitter Organic identifiers were misspelled. As such, we will need to account for this in the model. This will be adjusted in the Twitter Organic package, but to ensure backwards compatibility, this needs to be included. #}\n {% if var(identifier_var, none) is none %} \n {% set identifier_var = default_schema + \"_\" + table_identifier + \"_identifer\" %}\n {% endif %}\n {%- set relation.value=adapter.get_relation(\n database=source(default_schema, table_identifier).database,\n schema=source(default_schema, table_identifier).schema,\n identifier=var(identifier_var, table_identifier)\n ) -%}\n {% endif %}\n{%- set table_exists=relation.value is not none -%}\n\n{%- if table_exists -%}\n select * \n from {{ relation.value }}\n{%- else -%}\n {% if execute and not var('fivetran__remove_empty_table_warnings', false) -%}\n {{ exceptions.warn(\"\\n\\nPlease be aware: The \" ~ table_identifier|upper ~ \" table was not found in your \" ~ default_schema|upper ~ \" schema(s). The Fivetran dbt package will create a completely empty \" ~ table_identifier|upper ~ \" staging model as to not break downstream transformations. To turn off these warnings, set the `fivetran__remove_empty_table_warnings` variable to TRUE (see https://github.com/fivetran/dbt_fivetran_utils/tree/releases/v0.4.latest#union_data-source for details).\\n\") }}\n {% endif -%}\n select \n cast(null as {{ dbt.type_string() }}) as _dbt_source_relation\n limit 0\n{%- endif -%}\n{%- endif -%}\n\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt_utils.union_relations", "macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "table_identifier", "type": null, "description": ""}, {"name": "database_variable", "type": null, "description": ""}, {"name": "schema_variable", "type": null, "description": ""}, {"name": "default_database", "type": null, "description": ""}, {"name": "default_schema", "type": null, "description": ""}, {"name": "default_variable", "type": null, "description": ""}, {"name": "union_schema_variable", "type": null, "description": ""}, {"name": "union_database_variable", "type": null, "description": ""}], "created_at": 1789422567.018966, "supported_languages": null}, "macro.fivetran_utils.pivot_json_extract": {"name": "pivot_json_extract", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/pivot_json_extract.sql", "original_file_path": "macros/pivot_json_extract.sql", "unique_id": "macro.fivetran_utils.pivot_json_extract", "macro_sql": "{% macro pivot_json_extract(string, list_of_properties) %}\n\n{%- for property in list_of_properties -%}\n{%- if property is mapping -%}\nreplace( {{ fivetran_utils.json_extract(string, property.name) }}, '\"', '') as {{ property.alias if property.alias else property.name | replace(' ', '_') | replace('.', '_') | lower }}\n\n{%- else -%}\nreplace( {{ fivetran_utils.json_extract(string, property) }}, '\"', '') as {{ property | replace(' ', '_') | lower }}\n\n{%- endif -%}\n{%- if not loop.last -%},{%- endif %}\n{% endfor -%}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.json_extract"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "string", "type": null, "description": ""}, {"name": "list_of_properties", "type": null, "description": ""}], "created_at": 1789422567.020628, "supported_languages": null}, "macro.fivetran_utils.add_dbt_source_relation": {"name": "add_dbt_source_relation", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/add_dbt_source_relation.sql", "original_file_path": "macros/add_dbt_source_relation.sql", "unique_id": "macro.fivetran_utils.add_dbt_source_relation", "macro_sql": "{% macro add_dbt_source_relation() %}\n\n{% if var('union_schemas', none) or var('union_databases', none) %}\n, _dbt_source_relation\n{% endif %}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789422567.0211966, "supported_languages": null}, "macro.fivetran_utils.array_agg": {"name": "array_agg", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/array_agg.sql", "original_file_path": "macros/array_agg.sql", "unique_id": "macro.fivetran_utils.array_agg", "macro_sql": "{% macro array_agg(field_to_agg) -%}\n\n{{ adapter.dispatch('array_agg', 'fivetran_utils') (field_to_agg) }}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.default__array_agg"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field_to_agg", "type": null, "description": ""}], "created_at": 1789422567.0217557, "supported_languages": null}, "macro.fivetran_utils.default__array_agg": {"name": "default__array_agg", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/array_agg.sql", "original_file_path": "macros/array_agg.sql", "unique_id": "macro.fivetran_utils.default__array_agg", "macro_sql": "{% macro default__array_agg(field_to_agg) %}\n array_agg({{ field_to_agg }})\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field_to_agg", "type": null, "description": ""}], "created_at": 1789422567.0219913, "supported_languages": null}, "macro.fivetran_utils.redshift__array_agg": {"name": "redshift__array_agg", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/array_agg.sql", "original_file_path": "macros/array_agg.sql", "unique_id": "macro.fivetran_utils.redshift__array_agg", "macro_sql": "{% macro redshift__array_agg(field_to_agg) %}\n listagg({{ field_to_agg }}, ',')\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field_to_agg", "type": null, "description": ""}], "created_at": 1789422567.0222123, "supported_languages": null}, "macro.fivetran_utils.collect_freshness": {"name": "collect_freshness", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/collect_freshness.sql", "original_file_path": "macros/collect_freshness.sql", "unique_id": "macro.fivetran_utils.collect_freshness", "macro_sql": "{% macro collect_freshness(source, loaded_at_field, filter) %}\n {{ return(adapter.dispatch('collect_freshness')(source, loaded_at_field, filter))}}\n{% endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.default__collect_freshness"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "source", "type": null, "description": ""}, {"name": "loaded_at_field", "type": null, "description": ""}, {"name": "filter", "type": null, "description": ""}], "created_at": 1789422567.0231752, "supported_languages": null}, "macro.fivetran_utils.default__collect_freshness": {"name": "default__collect_freshness", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/collect_freshness.sql", "original_file_path": "macros/collect_freshness.sql", "unique_id": "macro.fivetran_utils.default__collect_freshness", "macro_sql": "{% macro default__collect_freshness(source, loaded_at_field, filter) %}\n {% call statement('collect_freshness', fetch_result=True, auto_begin=False) -%}\n\n {%- set enabled_array = [] -%}\n {% for node in graph.sources.values() %}\n {% if node.identifier == source.identifier %}\n {% if (node.meta['is_enabled'] | default(true)) %}\n {%- do enabled_array.append(1) -%}\n {% endif %}\n {% endif %}\n {% endfor %}\n {% set is_enabled = (enabled_array != []) %}\n\n select\n {% if is_enabled %}\n max({{ loaded_at_field }})\n {% else %} \n {{ current_timestamp() }} {% endif %} as max_loaded_at,\n {{ current_timestamp() }} as snapshotted_at\n\n {% if is_enabled %}\n from {{ source }}\n {% if filter %}\n where {{ filter }}\n {% endif %}\n {% endif %}\n\n {% endcall %}\n\n {% if dbt_version.split('.') | map('int') | list >= [1, 5, 0] %}\n {{ return(load_result('collect_freshness')) }}\n {% else %}\n {{ return(load_result('collect_freshness').table) }}\n {% endif %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement", "macro.dbt.current_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "source", "type": null, "description": ""}, {"name": "loaded_at_field", "type": null, "description": ""}, {"name": "filter", "type": null, "description": ""}], "created_at": 1789422567.0257485, "supported_languages": null}, "macro.fivetran_utils.first_value": {"name": "first_value", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/first_value.sql", "original_file_path": "macros/first_value.sql", "unique_id": "macro.fivetran_utils.first_value", "macro_sql": "{% macro first_value(first_value_field, partition_field, order_by_field, order=\"asc\") -%}\n\n{{ adapter.dispatch('first_value', 'fivetran_utils') (first_value_field, partition_field, order_by_field, order) }}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.default__first_value"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "first_value_field", "type": null, "description": ""}, {"name": "partition_field", "type": null, "description": ""}, {"name": "order_by_field", "type": null, "description": ""}, {"name": "order", "type": null, "description": ""}], "created_at": 1789422567.026595, "supported_languages": null}, "macro.fivetran_utils.default__first_value": {"name": "default__first_value", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/first_value.sql", "original_file_path": "macros/first_value.sql", "unique_id": "macro.fivetran_utils.default__first_value", "macro_sql": "{% macro default__first_value(first_value_field, partition_field, order_by_field, order=\"asc\") %}\n\n first_value( {{ first_value_field }} ignore nulls ) over (partition by {{ partition_field }} order by {{ order_by_field }} {{ order }} )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "first_value_field", "type": null, "description": ""}, {"name": "partition_field", "type": null, "description": ""}, {"name": "order_by_field", "type": null, "description": ""}, {"name": "order", "type": null, "description": ""}], "created_at": 1789422567.027117, "supported_languages": null}, "macro.fivetran_utils.redshift__first_value": {"name": "redshift__first_value", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/first_value.sql", "original_file_path": "macros/first_value.sql", "unique_id": "macro.fivetran_utils.redshift__first_value", "macro_sql": "{% macro redshift__first_value(first_value_field, partition_field, order_by_field, order=\"asc\") %}\n\n first_value( {{ first_value_field }} ignore nulls ) over (partition by {{ partition_field }} order by {{ order_by_field }} {{ order }} , {{ partition_field }} rows unbounded preceding )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "first_value_field", "type": null, "description": ""}, {"name": "partition_field", "type": null, "description": ""}, {"name": "order_by_field", "type": null, "description": ""}, {"name": "order", "type": null, "description": ""}], "created_at": 1789422567.0279338, "supported_languages": null}, "macro.fivetran_utils.union_relations": {"name": "union_relations", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/union_relations.sql", "original_file_path": "macros/union_relations.sql", "unique_id": "macro.fivetran_utils.union_relations", "macro_sql": "{%- macro union_relations(relations, aliases=none, column_override=none, include=[], exclude=[], source_column_name=none) -%}\n\n {%- if exclude and include -%}\n {{ exceptions.raise_compiler_error(\"Both an exclude and include list were provided to the `union` macro. Only one is allowed\") }}\n {%- endif -%}\n\n {#-- Prevent querying of db in parsing mode. This works because this macro does not create any new refs. -#}\n {%- if not execute %}\n {{ return('') }}\n {% endif -%}\n\n {%- set column_override = column_override if column_override is not none else {} -%}\n {%- set source_column_name = source_column_name if source_column_name is not none else '_dbt_source_relation' -%}\n\n {%- set relation_columns = {} -%}\n {%- set column_superset = {} -%}\n\n {%- for relation in relations -%}\n\n {%- do relation_columns.update({relation: []}) -%}\n\n {%- do dbt_utils._is_relation(relation, 'union_relations') -%}\n {%- set cols = adapter.get_columns_in_relation(relation) -%}\n {%- for col in cols -%}\n\n {#- If an exclude list was provided and the column is in the list, do nothing -#}\n {%- if exclude and col.column in exclude -%}\n\n {#- If an include list was provided and the column is not in the list, do nothing -#}\n {%- elif include and col.column not in include -%}\n\n {#- Otherwise add the column to the column superset -#}\n {%- else -%}\n\n {#- update the list of columns in this relation -#}\n {%- do relation_columns[relation].append(col.column) -%}\n\n {%- if col.column in column_superset -%}\n\n {%- set stored = column_superset[col.column] -%}\n {%- if col.is_string() and stored.is_string() and col.string_size() > stored.string_size() -%}\n\n {%- do column_superset.update({col.column: col}) -%}\n\n {%- endif %}\n\n {%- else -%}\n\n {%- do column_superset.update({col.column: col}) -%}\n\n {%- endif -%}\n\n {%- endif -%}\n\n {%- endfor -%}\n {%- endfor -%}\n\n {%- set ordered_column_names = column_superset.keys() -%}\n\n {%- for relation in relations %}\n\n (\n select\n\n cast({{ dbt.string_literal(relation) }} as {{ dbt.type_string() }}) as {{ source_column_name }},\n {% for col_name in ordered_column_names -%}\n\n {%- set col = column_superset[col_name] %}\n {%- set col_type = column_override.get(col.column, col.data_type) %}\n {%- set col_name = adapter.quote(col_name) if col_name in relation_columns[relation] else 'null' %}\n cast({{ col_name }} as {{ col_type }}) as {{ col.quoted }} {% if not loop.last %},{% endif -%}\n\n {%- endfor %}\n\n from {{ aliases[loop.index0] if aliases else relation }}\n )\n\n {% if not loop.last -%}\n union all\n {% endif -%}\n\n {%- endfor -%}\n\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt_utils._is_relation", "macro.dbt.string_literal", "macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relations", "type": null, "description": ""}, {"name": "aliases", "type": null, "description": ""}, {"name": "column_override", "type": null, "description": ""}, {"name": "include", "type": null, "description": ""}, {"name": "exclude", "type": null, "description": ""}, {"name": "source_column_name", "type": null, "description": ""}], "created_at": 1789422567.0373888, "supported_languages": null}, "macro.fivetran_utils.union_tables": {"name": "union_tables", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/union_relations.sql", "original_file_path": "macros/union_relations.sql", "unique_id": "macro.fivetran_utils.union_tables", "macro_sql": "{%- macro union_tables(tables, column_override=none, include=[], exclude=[], source_column_name='_dbt_source_table') -%}\n\n {%- do exceptions.warn(\"Warning: the `union_tables` macro is no longer supported and will be deprecated in a future release of dbt-utils. Use the `union_relations` macro instead\") -%}\n\n {{ return(dbt_utils.union_relations(tables, column_override, include, exclude, source_column_name)) }}\n\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt_utils.union_relations"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "tables", "type": null, "description": ""}, {"name": "column_override", "type": null, "description": ""}, {"name": "include", "type": null, "description": ""}, {"name": "exclude", "type": null, "description": ""}, {"name": "source_column_name", "type": null, "description": ""}], "created_at": 1789422567.0381799, "supported_languages": null}, "macro.fivetran_utils.timestamp_diff": {"name": "timestamp_diff", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/timestamp_diff.sql", "original_file_path": "macros/timestamp_diff.sql", "unique_id": "macro.fivetran_utils.timestamp_diff", "macro_sql": "{% macro timestamp_diff(first_date, second_date, datepart) %}\n {{ adapter.dispatch('timestamp_diff', 'fivetran_utils')(first_date, second_date, datepart) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.postgres__timestamp_diff"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "first_date", "type": null, "description": ""}, {"name": "second_date", "type": null, "description": ""}, {"name": "datepart", "type": null, "description": ""}], "created_at": 1789422567.0397525, "supported_languages": null}, "macro.fivetran_utils.default__timestamp_diff": {"name": "default__timestamp_diff", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/timestamp_diff.sql", "original_file_path": "macros/timestamp_diff.sql", "unique_id": "macro.fivetran_utils.default__timestamp_diff", "macro_sql": "{% macro default__timestamp_diff(first_date, second_date, datepart) %}\n\n datediff(\n {{ datepart }},\n {{ first_date }},\n {{ second_date }}\n )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "first_date", "type": null, "description": ""}, {"name": "second_date", "type": null, "description": ""}, {"name": "datepart", "type": null, "description": ""}], "created_at": 1789422567.0401154, "supported_languages": null}, "macro.fivetran_utils.redshift__timestamp_diff": {"name": "redshift__timestamp_diff", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/timestamp_diff.sql", "original_file_path": "macros/timestamp_diff.sql", "unique_id": "macro.fivetran_utils.redshift__timestamp_diff", "macro_sql": "{% macro redshift__timestamp_diff(first_date, second_date, datepart) %}\n\n datediff(\n {{ datepart }},\n {{ first_date }},\n {{ second_date }}\n )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "first_date", "type": null, "description": ""}, {"name": "second_date", "type": null, "description": ""}, {"name": "datepart", "type": null, "description": ""}], "created_at": 1789422567.0404613, "supported_languages": null}, "macro.fivetran_utils.bigquery__timestamp_diff": {"name": "bigquery__timestamp_diff", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/timestamp_diff.sql", "original_file_path": "macros/timestamp_diff.sql", "unique_id": "macro.fivetran_utils.bigquery__timestamp_diff", "macro_sql": "{% macro bigquery__timestamp_diff(first_date, second_date, datepart) %}\n\n timestamp_diff(\n {{second_date}},\n {{first_date}},\n {{datepart}}\n )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "first_date", "type": null, "description": ""}, {"name": "second_date", "type": null, "description": ""}, {"name": "datepart", "type": null, "description": ""}], "created_at": 1789422567.0408182, "supported_languages": null}, "macro.fivetran_utils.postgres__timestamp_diff": {"name": "postgres__timestamp_diff", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/timestamp_diff.sql", "original_file_path": "macros/timestamp_diff.sql", "unique_id": "macro.fivetran_utils.postgres__timestamp_diff", "macro_sql": "{% macro postgres__timestamp_diff(first_date, second_date, datepart) %}\n\n {% if datepart == 'year' %}\n (date_part('year', ({{second_date}})::date) - date_part('year', ({{first_date}})::date))\n {% elif datepart == 'quarter' %}\n ({{ dbt.datediff(first_date, second_date, 'year') }} * 4 + date_part('quarter', ({{second_date}})::date) - date_part('quarter', ({{first_date}})::date))\n {% elif datepart == 'month' %}\n ({{ dbt.datediff(first_date, second_date, 'year') }} * 12 + date_part('month', ({{second_date}})::date) - date_part('month', ({{first_date}})::date))\n {% elif datepart == 'day' %}\n (({{second_date}})::date - ({{first_date}})::date)\n {% elif datepart == 'week' %}\n ({{ dbt.datediff(first_date, second_date, 'day') }} / 7 + case\n when date_part('dow', ({{first_date}})::timestamp) <= date_part('dow', ({{second_date}})::timestamp) then\n case when {{first_date}} <= {{second_date}} then 0 else -1 end\n else\n case when {{first_date}} <= {{second_date}} then 1 else 0 end\n end)\n {% elif datepart == 'hour' %}\n ({{ dbt.datediff(first_date, second_date, 'day') }} * 24 + date_part('hour', ({{second_date}})::timestamp) - date_part('hour', ({{first_date}})::timestamp))\n {% elif datepart == 'minute' %}\n ({{ dbt.datediff(first_date, second_date, 'hour') }} * 60 + date_part('minute', ({{second_date}})::timestamp) - date_part('minute', ({{first_date}})::timestamp))\n {% elif datepart == 'second' %}\n ({{ dbt.datediff(first_date, second_date, 'minute') }} * 60 + floor(date_part('second', ({{second_date}})::timestamp)) - floor(date_part('second', ({{first_date}})::timestamp)))\n {% elif datepart == 'millisecond' %}\n ({{ dbt.datediff(first_date, second_date, 'minute') }} * 60000 + floor(date_part('millisecond', ({{second_date}})::timestamp)) - floor(date_part('millisecond', ({{first_date}})::timestamp)))\n {% elif datepart == 'microsecond' %}\n ({{ dbt.datediff(first_date, second_date, 'minute') }} * 60000000 + floor(date_part('microsecond', ({{second_date}})::timestamp)) - floor(date_part('microsecond', ({{first_date}})::timestamp)))\n {% else %}\n {{ exceptions.raise_compiler_error(\"Unsupported datepart for macro datediff in postgres: {!r}\".format(datepart)) }}\n {% endif %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.datediff"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "first_date", "type": null, "description": ""}, {"name": "second_date", "type": null, "description": ""}, {"name": "datepart", "type": null, "description": ""}], "created_at": 1789422567.0441275, "supported_languages": null}, "macro.fivetran_utils.duckdb__timestamp_diff": {"name": "duckdb__timestamp_diff", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/timestamp_diff.sql", "original_file_path": "macros/timestamp_diff.sql", "unique_id": "macro.fivetran_utils.duckdb__timestamp_diff", "macro_sql": "{% macro duckdb__timestamp_diff(first_date, second_date, datepart) %}\n\n datediff('{{ datepart }}', {{ first_date }}, {{ second_date }})\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "first_date", "type": null, "description": ""}, {"name": "second_date", "type": null, "description": ""}, {"name": "datepart", "type": null, "description": ""}], "created_at": 1789422567.0444863, "supported_languages": null}, "macro.fivetran_utils.add_pass_through_columns": {"name": "add_pass_through_columns", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/add_pass_through_columns.sql", "original_file_path": "macros/add_pass_through_columns.sql", "unique_id": "macro.fivetran_utils.add_pass_through_columns", "macro_sql": "{% macro add_pass_through_columns(base_columns, pass_through_var) %}\n\n {% if pass_through_var %}\n\n {% for column in pass_through_var %}\n\n {% if column is mapping %}\n\n {% if column.alias %}\n\n {% do base_columns.append({ \"name\": column.name, \"alias\": column.alias, \"datatype\": column.datatype if column.datatype else dbt.type_string()}) %}\n\n {% else %}\n\n {% do base_columns.append({ \"name\": column.name, \"datatype\": column.datatype if column.datatype else dbt.type_string()}) %}\n \n {% endif %}\n\n {% else %}\n\n {% do base_columns.append({ \"name\": column, \"datatype\": dbt.type_string()}) %}\n\n {% endif %}\n\n {% endfor %}\n\n {% endif %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "base_columns", "type": null, "description": ""}, {"name": "pass_through_var", "type": null, "description": ""}], "created_at": 1789422567.0464602, "supported_languages": null}, "macro.fivetran_utils.timestamp_add": {"name": "timestamp_add", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/timestamp_add.sql", "original_file_path": "macros/timestamp_add.sql", "unique_id": "macro.fivetran_utils.timestamp_add", "macro_sql": "{% macro timestamp_add(datepart, interval, from_timestamp) -%}\n\n{{ adapter.dispatch('timestamp_add', 'fivetran_utils') (datepart, interval, from_timestamp) }}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.postgres__timestamp_add"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "datepart", "type": null, "description": ""}, {"name": "interval", "type": null, "description": ""}, {"name": "from_timestamp", "type": null, "description": ""}], "created_at": 1789422567.047338, "supported_languages": null}, "macro.fivetran_utils.default__timestamp_add": {"name": "default__timestamp_add", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/timestamp_add.sql", "original_file_path": "macros/timestamp_add.sql", "unique_id": "macro.fivetran_utils.default__timestamp_add", "macro_sql": "{% macro default__timestamp_add(datepart, interval, from_timestamp) %}\n\n timestampadd(\n {{ datepart }},\n {{ interval }},\n {{ from_timestamp }}\n )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "datepart", "type": null, "description": ""}, {"name": "interval", "type": null, "description": ""}, {"name": "from_timestamp", "type": null, "description": ""}], "created_at": 1789422567.0477054, "supported_languages": null}, "macro.fivetran_utils.bigquery__timestamp_add": {"name": "bigquery__timestamp_add", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/timestamp_add.sql", "original_file_path": "macros/timestamp_add.sql", "unique_id": "macro.fivetran_utils.bigquery__timestamp_add", "macro_sql": "{% macro bigquery__timestamp_add(datepart, interval, from_timestamp) %}\n\n timestamp_add({{ from_timestamp }}, interval {{ interval }} {{ datepart }})\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "datepart", "type": null, "description": ""}, {"name": "interval", "type": null, "description": ""}, {"name": "from_timestamp", "type": null, "description": ""}], "created_at": 1789422567.0480375, "supported_languages": null}, "macro.fivetran_utils.redshift__timestamp_add": {"name": "redshift__timestamp_add", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/timestamp_add.sql", "original_file_path": "macros/timestamp_add.sql", "unique_id": "macro.fivetran_utils.redshift__timestamp_add", "macro_sql": "{% macro redshift__timestamp_add(datepart, interval, from_timestamp) %}\n\n dateadd(\n {{ datepart }},\n {{ interval }},\n {{ from_timestamp }}\n )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "datepart", "type": null, "description": ""}, {"name": "interval", "type": null, "description": ""}, {"name": "from_timestamp", "type": null, "description": ""}], "created_at": 1789422567.0484006, "supported_languages": null}, "macro.fivetran_utils.postgres__timestamp_add": {"name": "postgres__timestamp_add", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/timestamp_add.sql", "original_file_path": "macros/timestamp_add.sql", "unique_id": "macro.fivetran_utils.postgres__timestamp_add", "macro_sql": "{% macro postgres__timestamp_add(datepart, interval, from_timestamp) %}\n\n {{ from_timestamp }} + ((interval '1 {{ datepart }}') * ({{ interval }}))\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "datepart", "type": null, "description": ""}, {"name": "interval", "type": null, "description": ""}, {"name": "from_timestamp", "type": null, "description": ""}], "created_at": 1789422567.048769, "supported_languages": null}, "macro.fivetran_utils.spark__timestamp_add": {"name": "spark__timestamp_add", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/timestamp_add.sql", "original_file_path": "macros/timestamp_add.sql", "unique_id": "macro.fivetran_utils.spark__timestamp_add", "macro_sql": "{% macro spark__timestamp_add(datepart, interval, from_timestamp) %}\n\n {{ dbt.dateadd(datepart, interval, from_timestamp) }}\n \n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.dateadd"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "datepart", "type": null, "description": ""}, {"name": "interval", "type": null, "description": ""}, {"name": "from_timestamp", "type": null, "description": ""}], "created_at": 1789422567.0491323, "supported_languages": null}, "macro.fivetran_utils.duckdb__timestamp_add": {"name": "duckdb__timestamp_add", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/timestamp_add.sql", "original_file_path": "macros/timestamp_add.sql", "unique_id": "macro.fivetran_utils.duckdb__timestamp_add", "macro_sql": "{% macro duckdb__timestamp_add(datepart, interval, from_timestamp) %}\n\n {{ from_timestamp }} + ((interval '1 {{ datepart }}') * ({{ interval }}))\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "datepart", "type": null, "description": ""}, {"name": "interval", "type": null, "description": ""}, {"name": "from_timestamp", "type": null, "description": ""}], "created_at": 1789422567.0496027, "supported_languages": null}, "macro.fivetran_utils.enabled_vars": {"name": "enabled_vars", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/enabled_vars.sql", "original_file_path": "macros/enabled_vars.sql", "unique_id": "macro.fivetran_utils.enabled_vars", "macro_sql": "{% macro enabled_vars(vars) %}\n\n{% for v in vars %}\n \n {% if var(v, True) == False %}\n {{ return(False) }}\n {% endif %}\n\n{% endfor %}\n\n{{ return(True) }}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "vars", "type": null, "description": ""}], "created_at": 1789422567.0503929, "supported_languages": null}, "macro.fivetran_utils.wrap_in_quotes": {"name": "wrap_in_quotes", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/wrap_in_quotes.sql", "original_file_path": "macros/wrap_in_quotes.sql", "unique_id": "macro.fivetran_utils.wrap_in_quotes", "macro_sql": "{%- macro wrap_in_quotes(object_to_quote) -%}\n\n{{ return(adapter.dispatch('wrap_in_quotes', 'fivetran_utils')(object_to_quote)) }}\n\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.fivetran_utils.postgres__wrap_in_quotes"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "object_to_quote", "type": null, "description": ""}], "created_at": 1789422567.0510821, "supported_languages": null}, "macro.fivetran_utils.default__wrap_in_quotes": {"name": "default__wrap_in_quotes", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/wrap_in_quotes.sql", "original_file_path": "macros/wrap_in_quotes.sql", "unique_id": "macro.fivetran_utils.default__wrap_in_quotes", "macro_sql": "{%- macro default__wrap_in_quotes(object_to_quote) -%}\n{# bigquery, spark, databricks #}\n `{{ object_to_quote }}`\n{%- endmacro -%}\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "object_to_quote", "type": null, "description": ""}], "created_at": 1789422567.0513198, "supported_languages": null}, "macro.fivetran_utils.snowflake__wrap_in_quotes": {"name": "snowflake__wrap_in_quotes", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/wrap_in_quotes.sql", "original_file_path": "macros/wrap_in_quotes.sql", "unique_id": "macro.fivetran_utils.snowflake__wrap_in_quotes", "macro_sql": "{%- macro snowflake__wrap_in_quotes(object_to_quote) -%}\n \"{{ object_to_quote | upper }}\"\n{%- endmacro -%}\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "object_to_quote", "type": null, "description": ""}], "created_at": 1789422567.0515866, "supported_languages": null}, "macro.fivetran_utils.redshift__wrap_in_quotes": {"name": "redshift__wrap_in_quotes", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/wrap_in_quotes.sql", "original_file_path": "macros/wrap_in_quotes.sql", "unique_id": "macro.fivetran_utils.redshift__wrap_in_quotes", "macro_sql": "{%- macro redshift__wrap_in_quotes(object_to_quote) -%}\n \"{{ object_to_quote }}\"\n{%- endmacro -%}\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "object_to_quote", "type": null, "description": ""}], "created_at": 1789422567.0518093, "supported_languages": null}, "macro.fivetran_utils.postgres__wrap_in_quotes": {"name": "postgres__wrap_in_quotes", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/wrap_in_quotes.sql", "original_file_path": "macros/wrap_in_quotes.sql", "unique_id": "macro.fivetran_utils.postgres__wrap_in_quotes", "macro_sql": "{%- macro postgres__wrap_in_quotes(object_to_quote) -%}\n \"{{ object_to_quote }}\"\n{%- endmacro -%}\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "object_to_quote", "type": null, "description": ""}], "created_at": 1789422567.0520272, "supported_languages": null}, "macro.fivetran_utils.duckdb__wrap_in_quotes": {"name": "duckdb__wrap_in_quotes", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/wrap_in_quotes.sql", "original_file_path": "macros/wrap_in_quotes.sql", "unique_id": "macro.fivetran_utils.duckdb__wrap_in_quotes", "macro_sql": "{%- macro duckdb__wrap_in_quotes(object_to_quote) -%}\n \"{{ object_to_quote }}\"\n{%- endmacro -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "object_to_quote", "type": null, "description": ""}], "created_at": 1789422567.052247, "supported_languages": null}, "macro.fivetran_utils.json_extract": {"name": "json_extract", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/json_extract.sql", "original_file_path": "macros/json_extract.sql", "unique_id": "macro.fivetran_utils.json_extract", "macro_sql": "{% macro json_extract(string, string_path) -%}\n\n{{ adapter.dispatch('json_extract', 'fivetran_utils') (string, string_path) }}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.postgres__json_extract"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "string", "type": null, "description": ""}, {"name": "string_path", "type": null, "description": ""}], "created_at": 1789422567.0530546, "supported_languages": null}, "macro.fivetran_utils.default__json_extract": {"name": "default__json_extract", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/json_extract.sql", "original_file_path": "macros/json_extract.sql", "unique_id": "macro.fivetran_utils.default__json_extract", "macro_sql": "{% macro default__json_extract(string, string_path) %}\n\n json_extract_path_text({{string}}, {{ \"'\" ~ string_path ~ \"'\" }} )\n \n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "string", "type": null, "description": ""}, {"name": "string_path", "type": null, "description": ""}], "created_at": 1789422567.0533824, "supported_languages": null}, "macro.fivetran_utils.snowflake__json_extract": {"name": "snowflake__json_extract", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/json_extract.sql", "original_file_path": "macros/json_extract.sql", "unique_id": "macro.fivetran_utils.snowflake__json_extract", "macro_sql": "{% macro snowflake__json_extract(string, string_path) %}\n\n json_extract_path_text(try_parse_json( {{string}} ), {{ \"'\" ~ string_path ~ \"'\" }} )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "string", "type": null, "description": ""}, {"name": "string_path", "type": null, "description": ""}], "created_at": 1789422567.0537546, "supported_languages": null}, "macro.fivetran_utils.redshift__json_extract": {"name": "redshift__json_extract", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/json_extract.sql", "original_file_path": "macros/json_extract.sql", "unique_id": "macro.fivetran_utils.redshift__json_extract", "macro_sql": "{% macro redshift__json_extract(string, string_path) %}\n\n case when is_valid_json( {{string}} ) then json_extract_path_text({{string}}, {{ \"'\" ~ string_path ~ \"'\" }} ) else null end\n \n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "string", "type": null, "description": ""}, {"name": "string_path", "type": null, "description": ""}], "created_at": 1789422567.0541115, "supported_languages": null}, "macro.fivetran_utils.bigquery__json_extract": {"name": "bigquery__json_extract", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/json_extract.sql", "original_file_path": "macros/json_extract.sql", "unique_id": "macro.fivetran_utils.bigquery__json_extract", "macro_sql": "{% macro bigquery__json_extract(string, string_path) %}\n\n json_extract_scalar({{string}}, {{ \"'$.\" ~ string_path ~ \"'\" }} )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "string", "type": null, "description": ""}, {"name": "string_path", "type": null, "description": ""}], "created_at": 1789422567.0544286, "supported_languages": null}, "macro.fivetran_utils.postgres__json_extract": {"name": "postgres__json_extract", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/json_extract.sql", "original_file_path": "macros/json_extract.sql", "unique_id": "macro.fivetran_utils.postgres__json_extract", "macro_sql": "{% macro postgres__json_extract(string, string_path) %}\n\n {{string}}::json->>{{\"'\" ~ string_path ~ \"'\" }}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "string", "type": null, "description": ""}, {"name": "string_path", "type": null, "description": ""}], "created_at": 1789422567.0547667, "supported_languages": null}, "macro.fivetran_utils.extract_url_parameter": {"name": "extract_url_parameter", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/extract_url_parameter.sql", "original_file_path": "macros/extract_url_parameter.sql", "unique_id": "macro.fivetran_utils.extract_url_parameter", "macro_sql": "{% macro extract_url_parameter(field, url_parameter) -%}\n\n{{ adapter.dispatch('extract_url_parameter', 'fivetran_utils') (field, url_parameter) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.default__extract_url_parameter"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field", "type": null, "description": ""}, {"name": "url_parameter", "type": null, "description": ""}], "created_at": 1789422567.055362, "supported_languages": null}, "macro.fivetran_utils.default__extract_url_parameter": {"name": "default__extract_url_parameter", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/extract_url_parameter.sql", "original_file_path": "macros/extract_url_parameter.sql", "unique_id": "macro.fivetran_utils.default__extract_url_parameter", "macro_sql": "{% macro default__extract_url_parameter(field, url_parameter) -%}\n\n{{ dbt_utils.get_url_parameter(field, url_parameter) }}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.get_url_parameter"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field", "type": null, "description": ""}, {"name": "url_parameter", "type": null, "description": ""}], "created_at": 1789422567.0558097, "supported_languages": null}, "macro.fivetran_utils.spark__extract_url_parameter": {"name": "spark__extract_url_parameter", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/extract_url_parameter.sql", "original_file_path": "macros/extract_url_parameter.sql", "unique_id": "macro.fivetran_utils.spark__extract_url_parameter", "macro_sql": "{% macro spark__extract_url_parameter(field, url_parameter) -%}\n\n{%- set formatted_url_parameter = \"'\" + url_parameter + \"=([^&]+)'\" -%}\nnullif(regexp_extract({{ field }}, {{ formatted_url_parameter }}, 1), '')\n\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field", "type": null, "description": ""}, {"name": "url_parameter", "type": null, "description": ""}], "created_at": 1789422567.0562558, "supported_languages": null}, "macro.fivetran_utils.string_agg": {"name": "string_agg", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/string_agg.sql", "original_file_path": "macros/string_agg.sql", "unique_id": "macro.fivetran_utils.string_agg", "macro_sql": "{% macro string_agg(field_to_agg, delimiter) -%}\n\n{{ adapter.dispatch('string_agg', 'fivetran_utils') (field_to_agg, delimiter) }}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.default__string_agg"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field_to_agg", "type": null, "description": ""}, {"name": "delimiter", "type": null, "description": ""}], "created_at": 1789422567.0569427, "supported_languages": null}, "macro.fivetran_utils.default__string_agg": {"name": "default__string_agg", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/string_agg.sql", "original_file_path": "macros/string_agg.sql", "unique_id": "macro.fivetran_utils.default__string_agg", "macro_sql": "{% macro default__string_agg(field_to_agg, delimiter) %}\n string_agg({{ field_to_agg }}, {{ delimiter }})\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field_to_agg", "type": null, "description": ""}, {"name": "delimiter", "type": null, "description": ""}], "created_at": 1789422567.057225, "supported_languages": null}, "macro.fivetran_utils.snowflake__string_agg": {"name": "snowflake__string_agg", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/string_agg.sql", "original_file_path": "macros/string_agg.sql", "unique_id": "macro.fivetran_utils.snowflake__string_agg", "macro_sql": "{% macro snowflake__string_agg(field_to_agg, delimiter) %}\n listagg({{ field_to_agg }}, {{ delimiter }})\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field_to_agg", "type": null, "description": ""}, {"name": "delimiter", "type": null, "description": ""}], "created_at": 1789422567.0575018, "supported_languages": null}, "macro.fivetran_utils.redshift__string_agg": {"name": "redshift__string_agg", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/string_agg.sql", "original_file_path": "macros/string_agg.sql", "unique_id": "macro.fivetran_utils.redshift__string_agg", "macro_sql": "{% macro redshift__string_agg(field_to_agg, delimiter) %}\n listagg({{ field_to_agg }}, {{ delimiter }})\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field_to_agg", "type": null, "description": ""}, {"name": "delimiter", "type": null, "description": ""}], "created_at": 1789422567.057803, "supported_languages": null}, "macro.fivetran_utils.spark__string_agg": {"name": "spark__string_agg", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/string_agg.sql", "original_file_path": "macros/string_agg.sql", "unique_id": "macro.fivetran_utils.spark__string_agg", "macro_sql": "{% macro spark__string_agg(field_to_agg, delimiter) %}\n -- collect set will remove duplicates\n replace(replace(replace(cast( collect_set({{ field_to_agg }}) as string), '[', ''), ']', ''), ', ', {{ delimiter }} )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field_to_agg", "type": null, "description": ""}, {"name": "delimiter", "type": null, "description": ""}], "created_at": 1789422567.0580823, "supported_languages": null}, "macro.fivetran_utils.max_bool": {"name": "max_bool", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/max_bool.sql", "original_file_path": "macros/max_bool.sql", "unique_id": "macro.fivetran_utils.max_bool", "macro_sql": "{% macro max_bool(boolean_field) -%}\n\n{{ adapter.dispatch('max_bool', 'fivetran_utils') (boolean_field) }}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.default__max_bool"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "boolean_field", "type": null, "description": ""}], "created_at": 1789422567.0586424, "supported_languages": null}, "macro.fivetran_utils.default__max_bool": {"name": "default__max_bool", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/max_bool.sql", "original_file_path": "macros/max_bool.sql", "unique_id": "macro.fivetran_utils.default__max_bool", "macro_sql": "{% macro default__max_bool(boolean_field) %}\n\n bool_or( {{ boolean_field }} )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "boolean_field", "type": null, "description": ""}], "created_at": 1789422567.0588825, "supported_languages": null}, "macro.fivetran_utils.snowflake__max_bool": {"name": "snowflake__max_bool", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/max_bool.sql", "original_file_path": "macros/max_bool.sql", "unique_id": "macro.fivetran_utils.snowflake__max_bool", "macro_sql": "{% macro snowflake__max_bool(boolean_field) %}\n\n max( {{ boolean_field }} )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "boolean_field", "type": null, "description": ""}], "created_at": 1789422567.0590987, "supported_languages": null}, "macro.fivetran_utils.bigquery__max_bool": {"name": "bigquery__max_bool", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/max_bool.sql", "original_file_path": "macros/max_bool.sql", "unique_id": "macro.fivetran_utils.bigquery__max_bool", "macro_sql": "{% macro bigquery__max_bool(boolean_field) %}\n\n max( {{ boolean_field }} )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "boolean_field", "type": null, "description": ""}], "created_at": 1789422567.0593126, "supported_languages": null}, "macro.fivetran_utils.empty_variable_warning": {"name": "empty_variable_warning", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/empty_variable_warning.sql", "original_file_path": "macros/empty_variable_warning.sql", "unique_id": "macro.fivetran_utils.empty_variable_warning", "macro_sql": "{% macro empty_variable_warning(variable, downstream_model) %}\n\n{% if not var(variable) %}\n{{ log(\n \"\"\"\n Warning: You have passed an empty list to the \"\"\" ~ variable ~ \"\"\".\n As a result, you won't see the history of any columns in the \"\"\" ~ downstream_model ~ \"\"\" model.\n \"\"\",\n info=True\n) }}\n{% endif %}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "variable", "type": null, "description": ""}, {"name": "downstream_model", "type": null, "description": ""}], "created_at": 1789422567.060093, "supported_languages": null}, "macro.fivetran_utils.dummy_coalesce_value": {"name": "dummy_coalesce_value", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/dummy_coalesce_value.sql", "original_file_path": "macros/dummy_coalesce_value.sql", "unique_id": "macro.fivetran_utils.dummy_coalesce_value", "macro_sql": "{% macro dummy_coalesce_value(column) %}\n\n{% set coalesce_value = {\n 'STRING': \"'DUMMY_STRING'\",\n 'BOOLEAN': 'null',\n 'INT': 999999999,\n 'FLOAT': 999999999.99,\n 'TIMESTAMP': 'cast(\"2099-12-31\" as timestamp)',\n 'DATE': 'cast(\"2099-12-31\" as date)',\n} %}\n\n{% if column.is_float() %}\n{{ return(coalesce_value['FLOAT']) }}\n\n{% elif column.is_numeric() %}\n{{ return(coalesce_value['INT']) }}\n\n{% elif column.is_string() %}\n{{ return(coalesce_value['STRING']) }}\n\n{% elif column.data_type|lower == 'boolean' %}\n{{ return(coalesce_value['BOOLEAN']) }}\n\n{% elif 'timestamp' in column.data_type|lower %}\n{{ return(coalesce_value['TIMESTAMP']) }}\n\n{% elif 'date' in column.data_type|lower %}\n{{ return(coalesce_value['DATE']) }}\n\n{% elif 'int' in column.data_type|lower %}\n{{ return(coalesce_value['INT']) }}\n\n{% endif %}\n\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "column", "type": null, "description": ""}], "created_at": 1789422567.0628223, "supported_languages": null}, "macro.fivetran_utils.percentile": {"name": "percentile", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/percentile.sql", "original_file_path": "macros/percentile.sql", "unique_id": "macro.fivetran_utils.percentile", "macro_sql": "{% macro percentile(percentile_field, partition_field, percent) -%}\n\n{{ adapter.dispatch('percentile', 'fivetran_utils') (percentile_field, partition_field, percent) }}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.postgres__percentile"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "percentile_field", "type": null, "description": ""}, {"name": "partition_field", "type": null, "description": ""}, {"name": "percent", "type": null, "description": ""}], "created_at": 1789422567.06375, "supported_languages": null}, "macro.fivetran_utils.default__percentile": {"name": "default__percentile", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/percentile.sql", "original_file_path": "macros/percentile.sql", "unique_id": "macro.fivetran_utils.default__percentile", "macro_sql": "{% macro default__percentile(percentile_field, partition_field, percent) %}\n\n percentile_cont( \n {{ percent }} )\n within group ( order by {{ percentile_field }} )\n over ( partition by {{ partition_field }} )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "percentile_field", "type": null, "description": ""}, {"name": "partition_field", "type": null, "description": ""}, {"name": "percent", "type": null, "description": ""}], "created_at": 1789422567.0640993, "supported_languages": null}, "macro.fivetran_utils.redshift__percentile": {"name": "redshift__percentile", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/percentile.sql", "original_file_path": "macros/percentile.sql", "unique_id": "macro.fivetran_utils.redshift__percentile", "macro_sql": "{% macro redshift__percentile(percentile_field, partition_field, percent) %}\n\n percentile_cont( \n {{ percent }} )\n within group ( order by {{ percentile_field }} )\n over ( partition by {{ partition_field }} )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "percentile_field", "type": null, "description": ""}, {"name": "partition_field", "type": null, "description": ""}, {"name": "percent", "type": null, "description": ""}], "created_at": 1789422567.0644395, "supported_languages": null}, "macro.fivetran_utils.bigquery__percentile": {"name": "bigquery__percentile", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/percentile.sql", "original_file_path": "macros/percentile.sql", "unique_id": "macro.fivetran_utils.bigquery__percentile", "macro_sql": "{% macro bigquery__percentile(percentile_field, partition_field, percent) %}\n\n percentile_cont( \n {{ percentile_field }}, \n {{ percent }}) \n over (partition by {{ partition_field }} \n )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "percentile_field", "type": null, "description": ""}, {"name": "partition_field", "type": null, "description": ""}, {"name": "percent", "type": null, "description": ""}], "created_at": 1789422567.0648038, "supported_languages": null}, "macro.fivetran_utils.postgres__percentile": {"name": "postgres__percentile", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/percentile.sql", "original_file_path": "macros/percentile.sql", "unique_id": "macro.fivetran_utils.postgres__percentile", "macro_sql": "{% macro postgres__percentile(percentile_field, partition_field, percent) %}\n\n percentile_cont( \n {{ percent }} )\n within group ( order by {{ percentile_field }} )\n /* have to group by partition field */\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "percentile_field", "type": null, "description": ""}, {"name": "partition_field", "type": null, "description": ""}, {"name": "percent", "type": null, "description": ""}], "created_at": 1789422567.0651069, "supported_languages": null}, "macro.fivetran_utils.spark__percentile": {"name": "spark__percentile", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/percentile.sql", "original_file_path": "macros/percentile.sql", "unique_id": "macro.fivetran_utils.spark__percentile", "macro_sql": "{% macro spark__percentile(percentile_field, partition_field, percent) %}\n\n percentile( \n {{ percentile_field }}, \n {{ percent }}) \n over (partition by {{ partition_field }} \n )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "percentile_field", "type": null, "description": ""}, {"name": "partition_field", "type": null, "description": ""}, {"name": "percent", "type": null, "description": ""}], "created_at": 1789422567.0654411, "supported_languages": null}, "macro.fivetran_utils.duckdb__percentile": {"name": "duckdb__percentile", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/percentile.sql", "original_file_path": "macros/percentile.sql", "unique_id": "macro.fivetran_utils.duckdb__percentile", "macro_sql": "{% macro duckdb__percentile(percentile_field, partition_field, percent) %}\n\n quantile_cont(\n {{ percentile_field }},\n {{ percent }})\n over (partition by {{ partition_field }}\n )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "percentile_field", "type": null, "description": ""}, {"name": "partition_field", "type": null, "description": ""}, {"name": "percent", "type": null, "description": ""}], "created_at": 1789422567.0657961, "supported_languages": null}, "macro.fivetran_utils.remove_prefix_from_columns": {"name": "remove_prefix_from_columns", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/remove_prefix_from_columns.sql", "original_file_path": "macros/remove_prefix_from_columns.sql", "unique_id": "macro.fivetran_utils.remove_prefix_from_columns", "macro_sql": "{% macro remove_prefix_from_columns(columns, prefix='', exclude=[]) %}\n\n {%- for col in columns if col.name not in exclude -%}\n {%- if col.name[:prefix|length]|lower == prefix -%}\n {{ col.name }} as {{ col.name[prefix|length:] }}\n {%- else -%}\n {{ col.name }}\n {%- endif -%}\n {%- if not loop.last -%},{%- endif %}\n {% endfor -%}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "columns", "type": null, "description": ""}, {"name": "prefix", "type": null, "description": ""}, {"name": "exclude", "type": null, "description": ""}], "created_at": 1789422567.0670316, "supported_languages": null}, "macro.fivetran_utils.snowflake_seed_data": {"name": "snowflake_seed_data", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/snowflake_seed_data.sql", "original_file_path": "macros/snowflake_seed_data.sql", "unique_id": "macro.fivetran_utils.snowflake_seed_data", "macro_sql": "{% macro snowflake_seed_data(seed_name) %}\n\n{% if target.type == 'snowflake' %}\n{{ return(ref(seed_name ~ '_snowflake')) }}\n{% else %}\n{{ return(ref(seed_name)) }}\n{% endif %}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "seed_name", "type": null, "description": ""}], "created_at": 1789422567.0678208, "supported_languages": null}}, "docs": {"doc.dbt.__overview__": {"name": "__overview__", "resource_type": "doc", "package_name": "dbt", "path": "overview.md", "original_file_path": "docs/overview.md", "unique_id": "doc.dbt.__overview__", "block_contents": "### Welcome!\n\nWelcome to the auto-generated documentation for your dbt project!\n\n### Navigation\n\nYou can use the `Project` and `Database` navigation tabs on the left side of the window to explore the models\nin your project.\n\n#### Project Tab\nThe `Project` tab mirrors the directory structure of your dbt project. In this tab, you can see all of the\nmodels defined in your dbt project, as well as models imported from dbt packages.\n\n#### Database Tab\nThe `Database` tab also exposes your models, but in a format that looks more like a database explorer. This view\nshows relations (tables and views) grouped into database schemas. Note that ephemeral models are _not_ shown\nin this interface, as they do not exist in the database.\n\n### Graph Exploration\nYou can click the blue icon on the bottom-right corner of the page to view the lineage graph of your models.\n\nOn model pages, you'll see the immediate parents and children of the model you're exploring. By clicking the `Expand`\nbutton at the top-right of this lineage pane, you'll be able to see all of the models that are used to build,\nor are built from, the model you're exploring.\n\nOnce expanded, you'll be able to use the `--select` and `--exclude` model selection syntax to filter the\nmodels in the graph. For more information on model selection, check out the [dbt docs](https://docs.getdbt.com/docs/model-selection-syntax).\n\nNote that you can also right-click on models to interactively filter and explore the graph.\n\n---\n\n### More information\n\n- [What is dbt](https://docs.getdbt.com/docs/introduction)?\n- Read the [dbt viewpoint](https://docs.getdbt.com/docs/viewpoint)\n- [Installation](https://docs.getdbt.com/docs/installation)\n- Join the [dbt Community](https://www.getdbt.com/community/) for questions and discussion"}, "doc.iterable.source_relation": {"name": "source_relation", "resource_type": "doc", "package_name": "iterable", "path": "docs.md", "original_file_path": "models/docs.md", "unique_id": "doc.iterable.source_relation", "block_contents": "Identifies the record's source."}, "doc.iterable._fivetran_synced": {"name": "_fivetran_synced", "resource_type": "doc", "package_name": "iterable", "path": "docs.md", "original_file_path": "models/docs.md", "unique_id": "doc.iterable._fivetran_synced", "block_contents": "The time when a record was last updated by Fivetran."}}, "exposures": {}, "metrics": {}, "groups": {}, "selectors": {}, "disabled": {"test.iterable_integration_tests.consistency_campaigns": [{"database": "postgres", "schema": "public_dbt_test__audit", "name": "consistency_campaigns", "resource_type": "test", "package_name": "iterable_integration_tests", "path": "consistency/consistency_campaigns.sql", "original_file_path": "tests/consistency/consistency_campaigns.sql", "unique_id": "test.iterable_integration_tests.consistency_campaigns", "fqn": ["iterable_integration_tests", "consistency", "consistency_campaigns"], "alias": "consistency_campaigns", "checksum": {"name": "sha256", "checksum": "30e008529ef9f5fa6d8697bbcff2562fc9b176d571cc310458e67e8c82a46185"}, "config": {"enabled": false, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": ["fivetran_validations"], "meta": {}, "group": null, "static_analysis": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "sql_header": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": ["fivetran_validations"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"tags": "fivetran_validations", "enabled": "var('fivetran_validation_tests_enabled', False)"}, "created_at": 1789422567.9130704, "relation_name": null, "raw_code": "{{ config(\n tags=\"fivetran_validations\",\n enabled=var('fivetran_validation_tests_enabled', false)\n) }}\n\n{% set exclude_cols = ['labels'] + var('consistency_test_exclude_metrics', []) %}\n{% set fields = dbt_utils.star(from=ref('iterable__campaigns'), except=exclude_cols) %}\n\n-- this test ensures the iterable__campaigns end model matches the prior version\nwith prod as (\n select {{ fields }}\n from {{ target.schema }}_iterable_prod.iterable__campaigns\n where date(updated_at) < date({{ dbt.current_timestamp() }})\n),\n\ndev as (\n select {{ fields }}\n from {{ target.schema }}_iterable_dev.iterable__campaigns\n where date(updated_at) < date({{ dbt.current_timestamp() }})\n),\n\nprod_not_in_dev as (\n -- rows from prod not found in dev\n select * from prod\n except distinct\n select * from dev\n),\n\ndev_not_in_prod as (\n -- rows from dev not found in prod\n select * from dev\n except distinct\n select * from prod\n),\n\nfinal as (\n select\n *,\n 'from prod' as source\n from prod_not_in_dev\n\n union all -- union since we only care if rows are produced\n\n select\n *,\n 'from dev' as source\n from dev_not_in_prod\n)\n\nselect *\nfrom final", "doc_blocks": [], "language": "sql", "refs": [{"name": "iterable__campaigns", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt_utils.star", "macro.dbt.current_timestamp"], "nodes": []}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}}], "test.iterable_integration_tests.consistency_user_unsubscriptions": [{"database": "postgres", "schema": "public_dbt_test__audit", "name": "consistency_user_unsubscriptions", "resource_type": "test", "package_name": "iterable_integration_tests", "path": "consistency/consistency_user_unsubscriptions.sql", "original_file_path": "tests/consistency/consistency_user_unsubscriptions.sql", "unique_id": "test.iterable_integration_tests.consistency_user_unsubscriptions", "fqn": ["iterable_integration_tests", "consistency", "consistency_user_unsubscriptions"], "alias": "consistency_user_unsubscriptions", "checksum": {"name": "sha256", "checksum": "32d0be8a7f721a49100a7f4b1046a8ecb1d75b86f4ad1a484d53a1d03343bc40"}, "config": {"enabled": false, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": ["fivetran_validations"], "meta": {}, "group": null, "static_analysis": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "sql_header": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": ["fivetran_validations"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"tags": "fivetran_validations", "enabled": "var('fivetran_validation_tests_enabled', False)"}, "created_at": 1789422567.9743235, "relation_name": null, "raw_code": "{{ config(\n tags=\"fivetran_validations\",\n enabled=var('fivetran_validation_tests_enabled', false)\n) }}\n\n{% set exclude_cols = var('consistency_test_exclude_metrics', []) %}\n{% set fields = dbt_utils.star(from=ref('iterable__user_unsubscriptions'), except=exclude_cols) %}\n\n-- this test ensures the iterable__user_unsubscriptions end model matches the prior version\nwith prod as (\n select {{ fields }}\n from {{ target.schema }}_iterable_prod.iterable__user_unsubscriptions\n),\n\ndev as (\n select {{ fields }}\n from {{ target.schema }}_iterable_dev.iterable__user_unsubscriptions\n),\n\nprod_not_in_dev as (\n -- rows from prod not found in dev\n select * from prod\n except distinct\n select * from dev\n),\n\ndev_not_in_prod as (\n -- rows from dev not found in prod\n select * from dev\n except distinct\n select * from prod\n),\n\nfinal as (\n select\n *,\n 'from prod' as source\n from prod_not_in_dev\n\n union all -- union since we only care if rows are produced\n\n select\n *,\n 'from dev' as source\n from dev_not_in_prod\n)\n\nselect *\nfrom final", "doc_blocks": [], "language": "sql", "refs": [{"name": "iterable__user_unsubscriptions", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt_utils.star"], "nodes": []}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}}], "test.iterable_integration_tests.consistency_list_user_history": [{"database": "postgres", "schema": "public_dbt_test__audit", "name": "consistency_list_user_history", "resource_type": "test", "package_name": "iterable_integration_tests", "path": "consistency/consistency_list_user_history.sql", "original_file_path": "tests/consistency/consistency_list_user_history.sql", "unique_id": "test.iterable_integration_tests.consistency_list_user_history", "fqn": ["iterable_integration_tests", "consistency", "consistency_list_user_history"], "alias": "consistency_list_user_history", "checksum": {"name": "sha256", "checksum": "e0081cf1366801020e3c9fbdc71e989f2bdd7b713ee328c2f4a5e9b97355601e"}, "config": {"enabled": false, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": ["fivetran_validations"], "meta": {}, "group": null, "static_analysis": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "sql_header": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": ["fivetran_validations"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"tags": "fivetran_validations", "enabled": "var('fivetran_validation_tests_enabled', False)"}, "created_at": 1789422567.982923, "relation_name": null, "raw_code": "{{ config(\n tags=\"fivetran_validations\",\n enabled=var('fivetran_validation_tests_enabled', false)\n) }}\n\n{% set exclude_cols = var('consistency_test_exclude_metrics', []) %}\n{% set fields = dbt_utils.star(from=ref('iterable__list_user_history'), except=exclude_cols) %}\n\n-- this test ensures the iterable__list_user_history end model matches the prior version\nwith prod as (\n select {{ fields }}\n from {{ target.schema }}_iterable_prod.iterable__list_user_history\n),\n\ndev as (\n select {{ fields }}\n from {{ target.schema }}_iterable_dev.iterable__list_user_history\n),\n\nprod_not_in_dev as (\n -- rows from prod not found in dev\n select * from prod\n except distinct\n select * from dev\n),\n\ndev_not_in_prod as (\n -- rows from dev not found in prod\n select * from dev\n except distinct\n select * from prod\n),\n\nfinal as (\n select\n *,\n 'from prod' as source\n from prod_not_in_dev\n\n union all -- union since we only care if rows are produced\n\n select\n *,\n 'from dev' as source\n from dev_not_in_prod\n)\n\nselect *\nfrom final", "doc_blocks": [], "language": "sql", "refs": [{"name": "iterable__list_user_history", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt_utils.star"], "nodes": []}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}}], "test.iterable_integration_tests.consistency_users": [{"database": "postgres", "schema": "public_dbt_test__audit", "name": "consistency_users", "resource_type": "test", "package_name": "iterable_integration_tests", "path": "consistency/consistency_users.sql", "original_file_path": "tests/consistency/consistency_users.sql", "unique_id": "test.iterable_integration_tests.consistency_users", "fqn": ["iterable_integration_tests", "consistency", "consistency_users"], "alias": "consistency_users", "checksum": {"name": "sha256", "checksum": "d367ccd8f7d79248da78ce29fc8f08876913df08b89866895cce315f46ef81e3"}, "config": {"enabled": false, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": ["fivetran_validations"], "meta": {}, "group": null, "static_analysis": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "sql_header": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": ["fivetran_validations"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"tags": "fivetran_validations", "enabled": "var('fivetran_validation_tests_enabled', False)"}, "created_at": 1789422567.991117, "relation_name": null, "raw_code": "{{ config(\n tags=\"fivetran_validations\",\n enabled=var('fivetran_validation_tests_enabled', false)\n) }}\n\n{% set exclude_cols = var('consistency_test_exclude_metrics', []) %}\n{% set fields = dbt_utils.star(from=ref('iterable__users'), except=exclude_cols) %}\n\n-- this test ensures the iterable__users end model matches the prior version\nwith prod as (\n select {{ fields }}\n from {{ target.schema }}_iterable_prod.iterable__users\n where date(updated_at) < date({{ dbt.current_timestamp() }})\n),\n\ndev as (\n select {{ fields }}\n from {{ target.schema }}_iterable_dev.iterable__users\n where date(updated_at) < date({{ dbt.current_timestamp() }})\n),\n\nprod_not_in_dev as (\n -- rows from prod not found in dev\n select * from prod\n except distinct\n select * from dev\n),\n\ndev_not_in_prod as (\n -- rows from dev not found in prod\n select * from dev\n except distinct\n select * from prod\n),\n\nfinal as (\n select\n *,\n 'from prod' as source\n from prod_not_in_dev\n\n union all -- union since we only care if rows are produced\n\n select\n *,\n 'from dev' as source\n from dev_not_in_prod\n)\n\nselect *\nfrom final", "doc_blocks": [], "language": "sql", "refs": [{"name": "iterable__users", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt_utils.star", "macro.dbt.current_timestamp"], "nodes": []}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}}], "test.iterable_integration_tests.consistency_user_unsubscribes_pre_aug_2023": [{"database": "postgres", "schema": "public_dbt_test__audit", "name": "consistency_user_unsubscribes_pre_aug_2023", "resource_type": "test", "package_name": "iterable_integration_tests", "path": "consistency/consistency_user_unsubscribes_pre_aug_2023.sql", "original_file_path": "tests/consistency/consistency_user_unsubscribes_pre_aug_2023.sql", "unique_id": "test.iterable_integration_tests.consistency_user_unsubscribes_pre_aug_2023", "fqn": ["iterable_integration_tests", "consistency", "consistency_user_unsubscribes_pre_aug_2023"], "alias": "consistency_user_unsubscribes_pre_aug_2023", "checksum": {"name": "sha256", "checksum": "0d85b35d94066e59119f57fbe930a19353dfbb79b4e812b54de9c19520a58402"}, "config": {"enabled": false, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": ["fivetran_validations"], "meta": {}, "group": null, "static_analysis": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "sql_header": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": ["fivetran_validations"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"tags": "fivetran_validations", "enabled": "var('fivetran_validation_tests_enabled', False)"}, "created_at": 1789422568.0003777, "relation_name": null, "raw_code": "-- These validation tests were designed to work with the pre-August 2023 version of the Iterable connector.\n-- You will thus need to comment out `iterable_user_unsubscribed_channel_identifier` and `iterable_user_unsubscribed_message_type_identifier` in the `integration_tests/dbt_project.yml` to run and validate these tests. \n\n{{ config(\n tags=\"fivetran_validations\",\n enabled=var('fivetran_validation_tests_enabled', false)\n) }}\n\n\nwith prod as (\n\n select \n unique_user_key, \n coalesce(count(distinct unique_user_key), 0) as unique_user_records_prod, \n coalesce(count(distinct channel_id), 0) as channels_prod, \n coalesce(count(distinct message_type_id), 0) as message_types_prod\n from {{ target.schema }}_iterable_prod.iterable__user_unsubscriptions\n where channel_id is not null\n and message_type_id is not null\n group by 1\n),\n\ndev as (\n\n select \n unique_user_key, \n coalesce(count(distinct unique_user_key), 0) as unique_user_records_dev, \n coalesce(count(distinct channel_id), 0) as channels_dev, \n coalesce(count(distinct message_type_id), 0) as message_types_dev\n from {{ target.schema }}_iterable_dev.iterable__user_unsubscriptions\n where channel_id is not null\n and message_type_id is not null\n group by 1\n),\n\nfinal as (\n\n select \n prod.unique_user_key,\n unique_user_records_prod,\n unique_user_records_dev,\n channels_prod,\n channels_dev,\n message_types_prod,\n message_types_dev\n from prod\n full outer join dev\n on prod.unique_user_key = dev.unique_user_key\n) \n\nselect *\nfrom final\nwhere unique_user_records_prod != unique_user_records_dev\n and channels_prod != channels_dev \n and message_types_prod != message_types_dev", "doc_blocks": [], "language": "sql", "refs": [], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": [], "nodes": []}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}}], "test.iterable_integration_tests.consistency_user_campaign": [{"database": "postgres", "schema": "public_dbt_test__audit", "name": "consistency_user_campaign", "resource_type": "test", "package_name": "iterable_integration_tests", "path": "consistency/consistency_user_campaign.sql", "original_file_path": "tests/consistency/consistency_user_campaign.sql", "unique_id": "test.iterable_integration_tests.consistency_user_campaign", "fqn": ["iterable_integration_tests", "consistency", "consistency_user_campaign"], "alias": "consistency_user_campaign", "checksum": {"name": "sha256", "checksum": "8663f2c250688a8303d2ef38dc723e2fc62d996396b4b07e13c05feeb48cd97c"}, "config": {"enabled": false, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": ["fivetran_validations"], "meta": {}, "group": null, "static_analysis": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "sql_header": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": ["fivetran_validations"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"tags": "fivetran_validations", "enabled": "var('fivetran_validation_tests_enabled', False)"}, "created_at": 1789422568.006229, "relation_name": null, "raw_code": "{{ config(\n tags=\"fivetran_validations\",\n enabled=var('fivetran_validation_tests_enabled', false)\n) }}\n\n{% set exclude_cols = var('consistency_test_exclude_metrics', []) %}\n{% set fields = dbt_utils.star(from=ref('iterable__user_campaign'), except=exclude_cols) %}\n\n-- this test ensures the iterable__user_campaign end model matches the prior version\nwith prod as (\n select {{ fields }}\n from {{ target.schema }}_iterable_prod.iterable__user_campaign\n where date(first_event_at) < date({{ dbt.current_timestamp() }})\n),\n\ndev as (\n select {{ fields }}\n from {{ target.schema }}_iterable_dev.iterable__user_campaign\n where date(first_event_at) < date({{ dbt.current_timestamp() }})\n),\n\nprod_not_in_dev as (\n -- rows from prod not found in dev\n select * from prod\n except distinct\n select * from dev\n),\n\ndev_not_in_prod as (\n -- rows from dev not found in prod\n select * from dev\n except distinct\n select * from prod\n),\n\nfinal as (\n select\n *,\n 'from prod' as source\n from prod_not_in_dev\n\n union all -- union since we only care if rows are produced\n\n select\n *,\n 'from dev' as source\n from dev_not_in_prod\n)\n\nselect *\nfrom final", "doc_blocks": [], "language": "sql", "refs": [{"name": "iterable__user_campaign", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt_utils.star", "macro.dbt.current_timestamp"], "nodes": []}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}}], "test.iterable_integration_tests.consistency_events": [{"database": "postgres", "schema": "public_dbt_test__audit", "name": "consistency_events", "resource_type": "test", "package_name": "iterable_integration_tests", "path": "consistency/consistency_events.sql", "original_file_path": "tests/consistency/consistency_events.sql", "unique_id": "test.iterable_integration_tests.consistency_events", "fqn": ["iterable_integration_tests", "consistency", "consistency_events"], "alias": "consistency_events", "checksum": {"name": "sha256", "checksum": "6e82de77a605ca7613eb3563f2158ad172785552d38cbf3617136a816c073b36"}, "config": {"enabled": false, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": ["fivetran_validations"], "meta": {}, "group": null, "static_analysis": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "sql_header": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": ["fivetran_validations"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"tags": "fivetran_validations", "enabled": "var('fivetran_validation_tests_enabled', False)"}, "created_at": 1789422568.0157788, "relation_name": null, "raw_code": "{{ config(\n tags=\"fivetran_validations\",\n enabled=var('fivetran_validation_tests_enabled', false)\n) }}\n\n-- exclude JSON fields\n{% set exclude_cols = ['additional_properties', 'transactional_data'] + var('consistency_test_exclude_metrics', []) %}\n{% set fields = dbt_utils.star(from=ref('iterable__events'), except=exclude_cols) %}\n\n-- this test ensures the iterable__events end model matches the prior version\nwith prod as (\n select {{ fields }}\n from {{ target.schema }}_iterable_prod.iterable__events\n where date(created_at) < date({{ dbt.current_timestamp() }})\n),\n\ndev as (\n select {{ fields }}\n from {{ target.schema }}_iterable_dev.iterable__events\n where date(created_at) < date({{ dbt.current_timestamp() }})\n),\n\nprod_not_in_dev as (\n -- rows from prod not found in dev\n select * from prod\n except distinct\n select * from dev\n),\n\ndev_not_in_prod as (\n -- rows from dev not found in prod\n select * from dev\n except distinct\n select * from prod\n),\n\nfinal as (\n select\n *,\n 'from prod' as source\n from prod_not_in_dev\n\n union all -- union since we only care if rows are produced\n\n select\n *,\n 'from dev' as source\n from dev_not_in_prod\n)\n\nselect *\nfrom final", "doc_blocks": [], "language": "sql", "refs": [{"name": "iterable__events", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt_utils.star", "macro.dbt.current_timestamp"], "nodes": []}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}}], "test.iterable_integration_tests.consistency_journeys": [{"database": "postgres", "schema": "public_dbt_test__audit", "name": "consistency_journeys", "resource_type": "test", "package_name": "iterable_integration_tests", "path": "consistency/consistency_journeys.sql", "original_file_path": "tests/consistency/consistency_journeys.sql", "unique_id": "test.iterable_integration_tests.consistency_journeys", "fqn": ["iterable_integration_tests", "consistency", "consistency_journeys"], "alias": "consistency_journeys", "checksum": {"name": "sha256", "checksum": "93a73b2e7e1d608a1116fddcec932e15ce18a57fb099872a13b4f97ca006d18f"}, "config": {"enabled": false, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": ["fivetran_validations"], "meta": {}, "group": null, "static_analysis": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "sql_header": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": ["fivetran_validations"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"tags": "fivetran_validations", "enabled": "var('fivetran_validation_tests_enabled', False)"}, "created_at": 1789422568.0267456, "relation_name": null, "raw_code": "{{ config(\n tags=\"fivetran_validations\",\n enabled=var('fivetran_validation_tests_enabled', false)\n) }}\n\n{% set exclude_cols = ['trigger_event_names'] + var('consistency_test_exclude_metrics', []) %}\n{% set fields = dbt_utils.star(from=ref('iterable__journeys'), except=exclude_cols) %}\n\n-- this test ensures the iterable__journeys end model matches the prior version\nwith prod as (\n select {{ fields }}\n from {{ target.schema }}_iterable_prod.iterable__journeys\n where date(updated_at) < date({{ dbt.current_timestamp() }})\n),\n\ndev as (\n select {{ fields }}\n from {{ target.schema }}_iterable_dev.iterable__journeys\n where date(updated_at) < date({{ dbt.current_timestamp() }})\n),\n\nprod_not_in_dev as (\n -- rows from prod not found in dev\n select * from prod\n except distinct\n select * from dev\n),\n\ndev_not_in_prod as (\n -- rows from dev not found in prod\n select * from dev\n except distinct\n select * from prod\n),\n\nfinal as (\n select\n *,\n 'from prod' as source\n from prod_not_in_dev\n\n union all -- union since we only care if rows are produced\n\n select\n *,\n 'from dev' as source\n from dev_not_in_prod\n)\n\nselect *\nfrom final", "doc_blocks": [], "language": "sql", "refs": [{"name": "iterable__journeys", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt_utils.star", "macro.dbt.current_timestamp"], "nodes": []}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}}], "test.iterable_integration_tests.user_unsubscribe_count_match_pre_aug_2023": [{"database": "postgres", "schema": "public_dbt_test__audit", "name": "user_unsubscribe_count_match_pre_aug_2023", "resource_type": "test", "package_name": "iterable_integration_tests", "path": "integrity/user_unsubscribe_count_match_pre_aug_2023.sql", "original_file_path": "tests/integrity/user_unsubscribe_count_match_pre_aug_2023.sql", "unique_id": "test.iterable_integration_tests.user_unsubscribe_count_match_pre_aug_2023", "fqn": ["iterable_integration_tests", "integrity", "user_unsubscribe_count_match_pre_aug_2023"], "alias": "user_unsubscribe_count_match_pre_aug_2023", "checksum": {"name": "sha256", "checksum": "6b37518965460a9c0b7161808527fa4b6f240a6ead0827a3950705267ebd236f"}, "config": {"enabled": false, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": ["fivetran_validations"], "meta": {}, "group": null, "static_analysis": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "sql_header": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": ["fivetran_validations"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"tags": "fivetran_validations", "enabled": "var('fivetran_validation_tests_enabled', False)"}, "created_at": 1789422568.0365741, "relation_name": null, "raw_code": "-- These validation tests were designed to work with the pre-August 2023 version of the Iterable connector.\n-- You will thus need to comment out `iterable_user_unsubscribed_channel_identifier` and `iterable_user_unsubscribed_message_type_identifier` in the `integration_tests/dbt_project.yml` to run and validate these tests. \n\n{{ config(\n tags=\"fivetran_validations\",\n enabled=var('fivetran_validation_tests_enabled', false)\n) }}\n\nwith unsub_channels as (\n\n select \n unique_user_key, \n channel_id\n from {{ ref('stg_iterable__user_unsubscribed_channel') }}\n group by 1, 2\n),\n\nunsub_messages as (\n\n select \n unique_user_key, \n message_type_id\n from {{ ref('stg_iterable__user_unsub_message_type') }}\n group by 1, 2\n),\n\nchannel_message_combos as (\n\n select channel_id, message_type_id \n from {{ ref('stg_iterable__message_type') }}\n group by 1, 2\n),\n\nmessage_channel_unsubs as (\n\n select \n unsub_channels.unique_user_key as unique_user_key_source,\n channel_message_combos.channel_id as channel_source,\n channel_message_combos.message_type_id as message_type_source\n from unsub_channels \n inner join channel_message_combos\n on unsub_channels.channel_id = channel_message_combos.channel_id\n\n union all\n\n select \n unsub_messages.unique_user_key as unique_user_key_source,\n channel_message_combos.channel_id as channel_source,\n channel_message_combos.message_type_id as message_type_source\n from unsub_messages\n inner join channel_message_combos\n on unsub_messages.message_type_id = channel_message_combos.message_type_id\n\n),\n\nsource_counts as (\n\n select unique_user_key_source, channel_source, message_type_source, count(*) as source_count\n from message_channel_unsubs \n group by 1, 2, 3\n),\n\nend_model_counts as (\n\n select unique_user_key as unique_user_key_end, channel_id as channel_end, message_type_id as message_type_end, count(*) as end_count\n from {{ ref('iterable__user_unsubscriptions') }}\n group by 1, 2, 3 \n)\n\nselect * \nfrom source_counts\ninner join end_model_counts \n on source_counts.unique_user_key_source = end_model_counts.unique_user_key_end\nwhere source_counts.channel_source = end_model_counts.channel_end\n and source_counts.message_type_source = end_model_counts.message_type_end\n and source_counts.source_count != end_model_counts.end_count", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__user_unsubscribed_channel", "package": null, "version": null}, {"name": "stg_iterable__user_unsub_message_type", "package": null, "version": null}, {"name": "stg_iterable__message_type", "package": null, "version": null}, {"name": "iterable__user_unsubscriptions", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": [], "nodes": []}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}}], "model.iterable.int_iterable__custom_events": [{"database": "postgres", "schema": "public_iterable_dev", "name": "int_iterable__custom_events", "resource_type": "model", "package_name": "iterable", "path": "intermediate/int_iterable__custom_events.sql", "original_file_path": "models/intermediate/int_iterable__custom_events.sql", "unique_id": "model.iterable.int_iterable__custom_events", "fqn": ["iterable", "intermediate", "int_iterable__custom_events"], "alias": "int_iterable__custom_events", "checksum": {"name": "sha256", "checksum": "0f0f1330b62dd5a320f37f7e30dae86a90c57e07c135369a259cfcba61875a16"}, "config": {"enabled": false, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "incremental", "incremental_strategy": "merge", "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": "event_id", "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}, "file_format": "delta"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"materialized": "incremental", "schema": "iterable_{{ var('directed_schema','dev') }}", "unique_key": "event_id", "incremental_strategy": "merge", "file_format": "delta", "enabled": "False", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789422568.7904952, "relation_name": "\"postgres\".\"public_iterable_dev\".\"int_iterable__custom_events\"", "raw_code": "{{\n config(\n materialized='incremental',\n unique_key='event_id',\n incremental_strategy = 'merge',\n file_format = 'delta',\n enabled=false\n )\n}}\n\n-- leave this alone for now....setting enabled to false\nwith events as (\n\n select *\n from {{ ref('stg_iterable__event') }}\n\n where lower(event_name) = 'customevent'\n {% if is_incremental() %}\n and updated_at > ( select max(updated_at) from {{ this }} )\n {% endif %}\n\n), custom_events as (\n\n select \n events.*\n {# {{ dbt.split_part(string_text='additional_properties', delimiter_text=' : \"{', part_number=1) }} #}\n\n {% if target.type == 'snowflake' %}\n ,\n additional_properties.key as custom_event_name,\n additional_properties.value as custom_event_metadata\n {% endif %}\n from events\n\n \n {% if target.type == 'snowflake' %}\n cross join \n table(flatten(additional_properties)) as additional_properties\n where additional_properties.key != '_id'\n {% endif %}\n)\n\nselect *\nfrom custom_events", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__event", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.is_incremental"], "nodes": []}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}]}, "parent_map": {"seed.iterable_integration_tests.campaign_metrics_data": [], "seed.iterable_integration_tests.campaign_list_history_data": [], "seed.iterable_integration_tests.user_unsubscribed_message_type_history_data": [], "seed.iterable_integration_tests.user_unsubscribed_channel_history_data": [], "seed.iterable_integration_tests.campaign_suppression_list_history_data": [], "seed.iterable_integration_tests.channel_data": [], "seed.iterable_integration_tests.template_history_data": [], "seed.iterable_integration_tests.message_type_data": [], "seed.iterable_integration_tests.event_data": [], "seed.iterable_integration_tests.list_user_data": [], "seed.iterable_integration_tests.user_history_bq_json_data": [], "seed.iterable_integration_tests.user_unsubscribed_message_type_data": [], "seed.iterable_integration_tests.journey_data": [], "seed.iterable_integration_tests.campaign_history_data": [], "seed.iterable_integration_tests.list_data": [], "seed.iterable_integration_tests.event_extension_data": [], "seed.iterable_integration_tests.user_unsubscribed_channel_data": [], "seed.iterable_integration_tests.campaign_label_history_data": [], "seed.iterable_integration_tests.user_history_data": [], "model.iterable.iterable__users": ["model.iterable.int_iterable__list_user_unnest", "model.iterable.int_iterable__user_event_metrics", "model.iterable.stg_iterable__list_user"], "model.iterable.iterable__list_user_history": ["model.iterable.int_iterable__list_user_unnest", "model.iterable.stg_iterable__list", "model.iterable.stg_iterable__list_user"], "model.iterable.iterable__events": ["model.iterable.int_iterable__latest_template", "model.iterable.int_iterable__latest_user", "model.iterable.int_iterable__message_type_channel", "model.iterable.int_iterable__recurring_campaigns", "model.iterable.stg_iterable__event", "model.iterable.stg_iterable__event_extension"], "model.iterable.iterable__user_campaign": ["model.iterable.iterable__events"], "model.iterable.iterable__user_unsubscriptions": ["model.iterable.int_iterable__message_type_channel", "model.iterable.stg_iterable__user_unsub_message_type", "model.iterable.stg_iterable__user_unsubscribed_channel"], "model.iterable.iterable__journeys": ["model.iterable.int_iterable__journey_event_metrics", "model.iterable.stg_iterable__journey"], "model.iterable.iterable__campaigns": ["model.iterable.int_iterable__campaign_event_metrics", "model.iterable.int_iterable__campaign_labels", "model.iterable.int_iterable__campaign_lists", "model.iterable.int_iterable__latest_template", "model.iterable.int_iterable__recurring_campaigns", "model.iterable.stg_iterable__journey"], "model.iterable.int_iterable__campaign_labels": ["model.iterable.stg_iterable__campaign_label_history"], "model.iterable.int_iterable__journey_event_metrics": ["model.iterable.int_iterable__recurring_campaigns", "model.iterable.iterable__user_campaign"], "model.iterable.int_iterable__list_user_unnest": ["model.iterable.int_iterable__list_user_history"], "model.iterable.int_iterable__latest_template": ["model.iterable.int_iterable__message_type_channel", "model.iterable.stg_iterable__template_history"], "model.iterable.int_iterable__campaign_event_metrics": ["model.iterable.iterable__user_campaign"], "model.iterable.int_iterable__campaign_lists": ["model.iterable.stg_iterable__campaign_list_history", "model.iterable.stg_iterable__campaign_suppression_list_history"], "model.iterable.int_iterable__recurring_campaigns": ["model.iterable.int_iterable__latest_campaign"], "model.iterable.int_iterable__list_user_history": ["model.iterable.stg_iterable__user_history"], "model.iterable.int_iterable__message_type_channel": ["model.iterable.stg_iterable__channel", "model.iterable.stg_iterable__message_type"], "model.iterable.int_iterable__user_event_metrics": ["model.iterable.iterable__user_campaign"], "model.iterable.int_iterable__latest_user": ["model.iterable.stg_iterable__user_history"], "model.iterable.int_iterable__latest_campaign": ["model.iterable.stg_iterable__campaign_history"], "model.iterable.stg_iterable__message_type": ["model.iterable.stg_iterable__message_type_tmp"], "model.iterable.stg_iterable__event": ["model.iterable.stg_iterable__event_tmp"], "model.iterable.stg_iterable__user_unsubscribed_channel": ["model.iterable.stg_iterable__user_unsubscribed_channel_tmp"], "model.iterable.stg_iterable__campaign_history": ["model.iterable.stg_iterable__campaign_history_tmp"], "model.iterable.stg_iterable__campaign_label_history": ["model.iterable.stg_iterable__campaign_label_history_tmp"], "model.iterable.stg_iterable__template_history": ["model.iterable.stg_iterable__template_history_tmp"], "model.iterable.stg_iterable__journey": ["model.iterable.stg_iterable__journey_tmp"], "model.iterable.stg_iterable__user_history": ["model.iterable.stg_iterable__user_history_tmp"], "model.iterable.stg_iterable__user_unsub_message_type": ["model.iterable.stg_iterable__user_unsub_message_type_tmp"], "model.iterable.stg_iterable__list": ["model.iterable.stg_iterable__list_tmp"], "model.iterable.stg_iterable__list_user": ["model.iterable.stg_iterable__list_user_tmp"], "model.iterable.stg_iterable__campaign_suppression_list_history": ["model.iterable.stg_iterable__campaign_suppression_list_history_tmp"], "model.iterable.stg_iterable__event_extension": ["model.iterable.stg_iterable__event_extension_tmp"], "model.iterable.stg_iterable__campaign_list_history": ["model.iterable.stg_iterable__campaign_list_history_tmp"], "model.iterable.stg_iterable__channel": ["model.iterable.stg_iterable__channel_tmp"], "model.iterable.stg_iterable__message_type_tmp": ["source.iterable.iterable.message_type"], "model.iterable.stg_iterable__event_extension_tmp": ["source.iterable.iterable.event_extension"], "model.iterable.stg_iterable__user_unsub_message_type_tmp": ["source.iterable.iterable.user_unsubscribed_message_type_history"], "model.iterable.stg_iterable__campaign_list_history_tmp": ["source.iterable.iterable.campaign_list_history"], "model.iterable.stg_iterable__list_user_tmp": ["source.iterable.iterable.list_user"], "model.iterable.stg_iterable__user_history_tmp": ["source.iterable.iterable.user_history"], "model.iterable.stg_iterable__campaign_history_tmp": ["source.iterable.iterable.campaign_history"], "model.iterable.stg_iterable__template_history_tmp": ["source.iterable.iterable.template_history"], "model.iterable.stg_iterable__event_tmp": ["source.iterable.iterable.event"], "model.iterable.stg_iterable__journey_tmp": ["source.iterable.iterable.journey"], "model.iterable.stg_iterable__campaign_suppression_list_history_tmp": ["source.iterable.iterable.campaign_suppression_list_history"], "model.iterable.stg_iterable__campaign_label_history_tmp": ["source.iterable.iterable.campaign_label_history"], "model.iterable.stg_iterable__list_tmp": ["source.iterable.iterable.list"], "model.iterable.stg_iterable__channel_tmp": ["source.iterable.iterable.channel"], "model.iterable.stg_iterable__user_unsubscribed_channel_tmp": ["source.iterable.iterable.user_unsubscribed_channel_history"], "test.iterable.not_null_iterable__campaigns_campaign_id.03c9448919": ["model.iterable.iterable__campaigns"], "test.iterable.not_null_iterable__events_event_id.ed1d28a650": ["model.iterable.iterable__events"], "test.iterable.not_null_iterable__journeys_journey_id.b5c6b8783a": ["model.iterable.iterable__journeys"], "test.iterable.unique_iterable__journeys_unique_journey_id.ba86841246": ["model.iterable.iterable__journeys"], "test.iterable.not_null_iterable__user_unsubscriptions_unique_user_key.f8db72932b": ["model.iterable.iterable__user_unsubscriptions"], "test.iterable.not_null_iterable__users_unique_user_key.4ca37a26c8": ["model.iterable.iterable__users"], "test.iterable.not_null_stg_iterable__campaign_history_campaign_id.b7c36e4525": ["model.iterable.stg_iterable__campaign_history"], "test.iterable.not_null_stg_iterable__campaign_label_history_campaign_id.1918cef89a": ["model.iterable.stg_iterable__campaign_label_history"], "test.iterable.not_null_stg_iterable__campaign_list_history_campaign_id.208f9bf9ed": ["model.iterable.stg_iterable__campaign_list_history"], "test.iterable.not_null_stg_iterable__campaign_suppression_list_history_campaign_id.3921289710": ["model.iterable.stg_iterable__campaign_suppression_list_history"], "test.iterable.not_null_stg_iterable__channel_channel_id.182ceb9636": ["model.iterable.stg_iterable__channel"], "test.iterable.not_null_stg_iterable__event_event_id.370cd4bc9d": ["model.iterable.stg_iterable__event"], "test.iterable.not_null_stg_iterable__event_unique_event_id.e2b46d3bb6": ["model.iterable.stg_iterable__event"], "test.iterable.not_null_stg_iterable__event_extension_event_id.144dedcd30": ["model.iterable.stg_iterable__event_extension"], "test.iterable.not_null_stg_iterable__journey_journey_id.cc38bd633c": ["model.iterable.stg_iterable__journey"], "test.iterable.not_null_stg_iterable__list_list_id.47029d839a": ["model.iterable.stg_iterable__list"], "test.iterable.not_null_stg_iterable__message_type_message_type_id.75eaa6fa62": ["model.iterable.stg_iterable__message_type"], "test.iterable.not_null_stg_iterable__template_history_template_id.14b24a1dfe": ["model.iterable.stg_iterable__template_history"], "test.iterable.not_null_stg_iterable__list_user__fivetran_user_id.cca4b34c07": ["model.iterable.stg_iterable__list_user"], "test.iterable.not_null_stg_iterable__user_history_unique_user_key.2845af2127": ["model.iterable.stg_iterable__user_history"], "test.iterable.not_null_stg_iterable__user_unsubscribed_channel_channel_id.da0ed9e9be": ["model.iterable.stg_iterable__user_unsubscribed_channel"], "test.iterable.not_null_stg_iterable__user_unsub_message_type_message_type_id.268a89ea6f": ["model.iterable.stg_iterable__user_unsub_message_type"], "source.iterable.iterable.campaign_history": [], "source.iterable.iterable.campaign_label_history": [], "source.iterable.iterable.campaign_list_history": [], "source.iterable.iterable.campaign_suppression_list_history": [], "source.iterable.iterable.channel": [], "source.iterable.iterable.event": [], "source.iterable.iterable.event_extension": [], "source.iterable.iterable.journey": [], "source.iterable.iterable.list": [], "source.iterable.iterable.message_type": [], "source.iterable.iterable.template_history": [], "source.iterable.iterable.user_history": [], "source.iterable.iterable.user_unsubscribed_channel": [], "source.iterable.iterable.user_unsubscribed_message_type": [], "source.iterable.iterable.user_unsubscribed_channel_history": [], "source.iterable.iterable.user_unsubscribed_message_type_history": [], "source.iterable.iterable.list_user": []}, "child_map": {"seed.iterable_integration_tests.campaign_metrics_data": [], "seed.iterable_integration_tests.campaign_list_history_data": [], "seed.iterable_integration_tests.user_unsubscribed_message_type_history_data": [], "seed.iterable_integration_tests.user_unsubscribed_channel_history_data": [], "seed.iterable_integration_tests.campaign_suppression_list_history_data": [], "seed.iterable_integration_tests.channel_data": [], "seed.iterable_integration_tests.template_history_data": [], "seed.iterable_integration_tests.message_type_data": [], "seed.iterable_integration_tests.event_data": [], "seed.iterable_integration_tests.list_user_data": [], "seed.iterable_integration_tests.user_history_bq_json_data": [], "seed.iterable_integration_tests.user_unsubscribed_message_type_data": [], "seed.iterable_integration_tests.journey_data": [], "seed.iterable_integration_tests.campaign_history_data": [], "seed.iterable_integration_tests.list_data": [], "seed.iterable_integration_tests.event_extension_data": [], "seed.iterable_integration_tests.user_unsubscribed_channel_data": [], "seed.iterable_integration_tests.campaign_label_history_data": [], "seed.iterable_integration_tests.user_history_data": [], "model.iterable.iterable__users": ["test.iterable.not_null_iterable__users_unique_user_key.4ca37a26c8"], "model.iterable.iterable__list_user_history": [], "model.iterable.iterable__events": ["model.iterable.iterable__user_campaign", "test.iterable.not_null_iterable__events_event_id.ed1d28a650"], "model.iterable.iterable__user_campaign": ["model.iterable.int_iterable__campaign_event_metrics", "model.iterable.int_iterable__journey_event_metrics", "model.iterable.int_iterable__user_event_metrics"], "model.iterable.iterable__user_unsubscriptions": ["test.iterable.not_null_iterable__user_unsubscriptions_unique_user_key.f8db72932b"], "model.iterable.iterable__journeys": ["test.iterable.not_null_iterable__journeys_journey_id.b5c6b8783a", "test.iterable.unique_iterable__journeys_unique_journey_id.ba86841246"], "model.iterable.iterable__campaigns": ["test.iterable.not_null_iterable__campaigns_campaign_id.03c9448919"], "model.iterable.int_iterable__campaign_labels": ["model.iterable.iterable__campaigns"], "model.iterable.int_iterable__journey_event_metrics": ["model.iterable.iterable__journeys"], "model.iterable.int_iterable__list_user_unnest": ["model.iterable.iterable__list_user_history", "model.iterable.iterable__users"], "model.iterable.int_iterable__latest_template": ["model.iterable.iterable__campaigns", "model.iterable.iterable__events"], "model.iterable.int_iterable__campaign_event_metrics": ["model.iterable.iterable__campaigns"], "model.iterable.int_iterable__campaign_lists": ["model.iterable.iterable__campaigns"], "model.iterable.int_iterable__recurring_campaigns": ["model.iterable.int_iterable__journey_event_metrics", "model.iterable.iterable__campaigns", "model.iterable.iterable__events"], "model.iterable.int_iterable__list_user_history": ["model.iterable.int_iterable__list_user_unnest"], "model.iterable.int_iterable__message_type_channel": ["model.iterable.int_iterable__latest_template", "model.iterable.iterable__events", "model.iterable.iterable__user_unsubscriptions"], "model.iterable.int_iterable__user_event_metrics": ["model.iterable.iterable__users"], "model.iterable.int_iterable__latest_user": ["model.iterable.iterable__events"], "model.iterable.int_iterable__latest_campaign": ["model.iterable.int_iterable__recurring_campaigns"], "model.iterable.stg_iterable__message_type": ["model.iterable.int_iterable__message_type_channel", "test.iterable.not_null_stg_iterable__message_type_message_type_id.75eaa6fa62"], "model.iterable.stg_iterable__event": ["model.iterable.iterable__events", "test.iterable.not_null_stg_iterable__event_event_id.370cd4bc9d", "test.iterable.not_null_stg_iterable__event_unique_event_id.e2b46d3bb6"], "model.iterable.stg_iterable__user_unsubscribed_channel": ["model.iterable.iterable__user_unsubscriptions", "test.iterable.not_null_stg_iterable__user_unsubscribed_channel_channel_id.da0ed9e9be"], "model.iterable.stg_iterable__campaign_history": ["model.iterable.int_iterable__latest_campaign", "test.iterable.not_null_stg_iterable__campaign_history_campaign_id.b7c36e4525"], "model.iterable.stg_iterable__campaign_label_history": ["model.iterable.int_iterable__campaign_labels", "test.iterable.not_null_stg_iterable__campaign_label_history_campaign_id.1918cef89a"], "model.iterable.stg_iterable__template_history": ["model.iterable.int_iterable__latest_template", "test.iterable.not_null_stg_iterable__template_history_template_id.14b24a1dfe"], "model.iterable.stg_iterable__journey": ["model.iterable.iterable__campaigns", "model.iterable.iterable__journeys", "test.iterable.not_null_stg_iterable__journey_journey_id.cc38bd633c"], "model.iterable.stg_iterable__user_history": ["model.iterable.int_iterable__latest_user", "model.iterable.int_iterable__list_user_history", "test.iterable.not_null_stg_iterable__user_history_unique_user_key.2845af2127"], "model.iterable.stg_iterable__user_unsub_message_type": ["model.iterable.iterable__user_unsubscriptions", "test.iterable.not_null_stg_iterable__user_unsub_message_type_message_type_id.268a89ea6f"], "model.iterable.stg_iterable__list": ["model.iterable.iterable__list_user_history", "test.iterable.not_null_stg_iterable__list_list_id.47029d839a"], "model.iterable.stg_iterable__list_user": ["model.iterable.iterable__list_user_history", "model.iterable.iterable__users", "test.iterable.not_null_stg_iterable__list_user__fivetran_user_id.cca4b34c07"], "model.iterable.stg_iterable__campaign_suppression_list_history": ["model.iterable.int_iterable__campaign_lists", "test.iterable.not_null_stg_iterable__campaign_suppression_list_history_campaign_id.3921289710"], "model.iterable.stg_iterable__event_extension": ["model.iterable.iterable__events", "test.iterable.not_null_stg_iterable__event_extension_event_id.144dedcd30"], "model.iterable.stg_iterable__campaign_list_history": ["model.iterable.int_iterable__campaign_lists", "test.iterable.not_null_stg_iterable__campaign_list_history_campaign_id.208f9bf9ed"], "model.iterable.stg_iterable__channel": ["model.iterable.int_iterable__message_type_channel", "test.iterable.not_null_stg_iterable__channel_channel_id.182ceb9636"], "model.iterable.stg_iterable__message_type_tmp": ["model.iterable.stg_iterable__message_type"], "model.iterable.stg_iterable__event_extension_tmp": ["model.iterable.stg_iterable__event_extension"], "model.iterable.stg_iterable__user_unsub_message_type_tmp": ["model.iterable.stg_iterable__user_unsub_message_type"], "model.iterable.stg_iterable__campaign_list_history_tmp": ["model.iterable.stg_iterable__campaign_list_history"], "model.iterable.stg_iterable__list_user_tmp": ["model.iterable.stg_iterable__list_user"], "model.iterable.stg_iterable__user_history_tmp": ["model.iterable.stg_iterable__user_history"], "model.iterable.stg_iterable__campaign_history_tmp": ["model.iterable.stg_iterable__campaign_history"], "model.iterable.stg_iterable__template_history_tmp": ["model.iterable.stg_iterable__template_history"], "model.iterable.stg_iterable__event_tmp": ["model.iterable.stg_iterable__event"], "model.iterable.stg_iterable__journey_tmp": ["model.iterable.stg_iterable__journey"], "model.iterable.stg_iterable__campaign_suppression_list_history_tmp": ["model.iterable.stg_iterable__campaign_suppression_list_history"], "model.iterable.stg_iterable__campaign_label_history_tmp": ["model.iterable.stg_iterable__campaign_label_history"], "model.iterable.stg_iterable__list_tmp": ["model.iterable.stg_iterable__list"], "model.iterable.stg_iterable__channel_tmp": ["model.iterable.stg_iterable__channel"], "model.iterable.stg_iterable__user_unsubscribed_channel_tmp": ["model.iterable.stg_iterable__user_unsubscribed_channel"], "test.iterable.not_null_iterable__campaigns_campaign_id.03c9448919": [], "test.iterable.not_null_iterable__events_event_id.ed1d28a650": [], "test.iterable.not_null_iterable__journeys_journey_id.b5c6b8783a": [], "test.iterable.unique_iterable__journeys_unique_journey_id.ba86841246": [], "test.iterable.not_null_iterable__user_unsubscriptions_unique_user_key.f8db72932b": [], "test.iterable.not_null_iterable__users_unique_user_key.4ca37a26c8": [], "test.iterable.not_null_stg_iterable__campaign_history_campaign_id.b7c36e4525": [], "test.iterable.not_null_stg_iterable__campaign_label_history_campaign_id.1918cef89a": [], "test.iterable.not_null_stg_iterable__campaign_list_history_campaign_id.208f9bf9ed": [], "test.iterable.not_null_stg_iterable__campaign_suppression_list_history_campaign_id.3921289710": [], "test.iterable.not_null_stg_iterable__channel_channel_id.182ceb9636": [], "test.iterable.not_null_stg_iterable__event_event_id.370cd4bc9d": [], "test.iterable.not_null_stg_iterable__event_unique_event_id.e2b46d3bb6": [], "test.iterable.not_null_stg_iterable__event_extension_event_id.144dedcd30": [], "test.iterable.not_null_stg_iterable__journey_journey_id.cc38bd633c": [], "test.iterable.not_null_stg_iterable__list_list_id.47029d839a": [], "test.iterable.not_null_stg_iterable__message_type_message_type_id.75eaa6fa62": [], "test.iterable.not_null_stg_iterable__template_history_template_id.14b24a1dfe": [], "test.iterable.not_null_stg_iterable__list_user__fivetran_user_id.cca4b34c07": [], "test.iterable.not_null_stg_iterable__user_history_unique_user_key.2845af2127": [], "test.iterable.not_null_stg_iterable__user_unsubscribed_channel_channel_id.da0ed9e9be": [], "test.iterable.not_null_stg_iterable__user_unsub_message_type_message_type_id.268a89ea6f": [], "source.iterable.iterable.campaign_history": ["model.iterable.stg_iterable__campaign_history_tmp"], "source.iterable.iterable.campaign_label_history": ["model.iterable.stg_iterable__campaign_label_history_tmp"], "source.iterable.iterable.campaign_list_history": ["model.iterable.stg_iterable__campaign_list_history_tmp"], "source.iterable.iterable.campaign_suppression_list_history": ["model.iterable.stg_iterable__campaign_suppression_list_history_tmp"], "source.iterable.iterable.channel": ["model.iterable.stg_iterable__channel_tmp"], "source.iterable.iterable.event": ["model.iterable.stg_iterable__event_tmp"], "source.iterable.iterable.event_extension": ["model.iterable.stg_iterable__event_extension_tmp"], "source.iterable.iterable.journey": ["model.iterable.stg_iterable__journey_tmp"], "source.iterable.iterable.list": ["model.iterable.stg_iterable__list_tmp"], "source.iterable.iterable.message_type": ["model.iterable.stg_iterable__message_type_tmp"], "source.iterable.iterable.template_history": ["model.iterable.stg_iterable__template_history_tmp"], "source.iterable.iterable.user_history": ["model.iterable.stg_iterable__user_history_tmp"], "source.iterable.iterable.user_unsubscribed_channel": [], "source.iterable.iterable.user_unsubscribed_message_type": [], "source.iterable.iterable.user_unsubscribed_channel_history": ["model.iterable.stg_iterable__user_unsubscribed_channel_tmp"], "source.iterable.iterable.user_unsubscribed_message_type_history": ["model.iterable.stg_iterable__user_unsub_message_type_tmp"], "source.iterable.iterable.list_user": ["model.iterable.stg_iterable__list_user_tmp"]}, "group_map": {}, "saved_queries": {}, "semantic_models": {}, "unit_tests": {}, "functions": {}} \ No newline at end of file +{"metadata": {"dbt_schema_version": "https://schemas.getdbt.com/dbt/manifest/v12.json", "dbt_version": "1.12.5", "generated_at": "2026-09-15T20:17:33.746333Z", "invocation_id": "f92eb9ec-397c-44a2-972d-f82fe2f43994", "invocation_started_at": "2026-09-15T20:17:22.160338+00:00", "env": {}, "project_name": "iterable_integration_tests", "project_id": "726648524a3768595307d45548dac26e", "user_id": null, "send_anonymous_usage_stats": false, "adapter_type": "postgres", "quoting": {"database": true, "schema": true, "identifier": true, "column": null}, "run_started_at": "2026-09-15T20:17:22.160642+00:00"}, "nodes": {"seed.iterable_integration_tests.campaign_metrics_data": {"database": "postgres", "schema": "public", "name": "campaign_metrics_data", "resource_type": "seed", "package_name": "iterable_integration_tests", "path": "campaign_metrics_data.csv", "original_file_path": "seeds/campaign_metrics_data.csv", "unique_id": "seed.iterable_integration_tests.campaign_metrics_data", "fqn": ["iterable_integration_tests", "campaign_metrics_data"], "alias": "campaign_metrics_data", "checksum": {"name": "sha256", "checksum": "45e8e7be3941e10f43112fac7bd78f0b6a63c070090062f65b2ffabe481b8c4e"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "seed", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": false, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "delimiter": ",", "quote_columns": false}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": false, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"docs": {"show": false}, "quote_columns": "{{ target.type == 'redshift' or var('fivetran_using_source_casing', false) }}"}, "created_at": 1789503444.8369384, "relation_name": "\"postgres\".\"public\".\"campaign_metrics_data\"", "raw_code": "", "doc_blocks": [], "root_path": "/home/runner/work/dbt_iterable/dbt_iterable/integration_tests", "depends_on": {"macros": []}}, "seed.iterable_integration_tests.campaign_list_history_data": {"database": "postgres", "schema": "public", "name": "campaign_list_history_data", "resource_type": "seed", "package_name": "iterable_integration_tests", "path": "campaign_list_history_data.csv", "original_file_path": "seeds/campaign_list_history_data.csv", "unique_id": "seed.iterable_integration_tests.campaign_list_history_data", "fqn": ["iterable_integration_tests", "campaign_list_history_data"], "alias": "campaign_list_history_data", "checksum": {"name": "sha256", "checksum": "206581e614bf60f37345cbf1bd5e0cacac8a2f329a7dfc521b809c3e6d72e728"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "seed", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {"_fivetran_synced": "timestamp"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": false, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "delimiter": ",", "quote_columns": false}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": false, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"docs": {"show": false}, "quote_columns": "{{ target.type == 'redshift' or var('fivetran_using_source_casing', false) }}", "column_types": {"_fivetran_synced": "timestamp"}}, "created_at": 1789503444.8452237, "relation_name": "\"postgres\".\"public\".\"campaign_list_history_data\"", "raw_code": "", "doc_blocks": [], "root_path": "/home/runner/work/dbt_iterable/dbt_iterable/integration_tests", "depends_on": {"macros": []}}, "seed.iterable_integration_tests.user_unsubscribed_message_type_history_data": {"database": "postgres", "schema": "public", "name": "user_unsubscribed_message_type_history_data", "resource_type": "seed", "package_name": "iterable_integration_tests", "path": "user_unsubscribed_message_type_history_data.csv", "original_file_path": "seeds/user_unsubscribed_message_type_history_data.csv", "unique_id": "seed.iterable_integration_tests.user_unsubscribed_message_type_history_data", "fqn": ["iterable_integration_tests", "user_unsubscribed_message_type_history_data"], "alias": "user_unsubscribed_message_type_history_data", "checksum": {"name": "sha256", "checksum": "1e6883673b9a6f44966d10891cece60a739773fadf44302ccf2aad5290222687"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "seed", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {"_fivetran_synced": "timestamp"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": false, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "delimiter": ",", "quote_columns": false}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": false, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"docs": {"show": false}, "quote_columns": "{{ target.type == 'redshift' or var('fivetran_using_source_casing', false) }}", "column_types": {"_fivetran_synced": "timestamp"}}, "created_at": 1789503444.8490307, "relation_name": "\"postgres\".\"public\".\"user_unsubscribed_message_type_history_data\"", "raw_code": "", "doc_blocks": [], "root_path": "/home/runner/work/dbt_iterable/dbt_iterable/integration_tests", "depends_on": {"macros": []}}, "seed.iterable_integration_tests.user_unsubscribed_channel_history_data": {"database": "postgres", "schema": "public", "name": "user_unsubscribed_channel_history_data", "resource_type": "seed", "package_name": "iterable_integration_tests", "path": "user_unsubscribed_channel_history_data.csv", "original_file_path": "seeds/user_unsubscribed_channel_history_data.csv", "unique_id": "seed.iterable_integration_tests.user_unsubscribed_channel_history_data", "fqn": ["iterable_integration_tests", "user_unsubscribed_channel_history_data"], "alias": "user_unsubscribed_channel_history_data", "checksum": {"name": "sha256", "checksum": "a1b532e561033f6ff137e5a1bde082263903493b763e9358a2a2ba151360e00e"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "seed", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {"channel_id": "bigint", "_fivetran_synced": "timestamp"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": false, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "delimiter": ",", "quote_columns": false}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": false, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"docs": {"show": false}, "quote_columns": "{{ target.type == 'redshift' or var('fivetran_using_source_casing', false) }}", "column_types": {"channel_id": "{%- if target.type == 'bigquery' -%} INT64 {%- else -%} bigint {%- endif -%}", "_fivetran_synced": "timestamp"}}, "created_at": 1789503444.8529654, "relation_name": "\"postgres\".\"public\".\"user_unsubscribed_channel_history_data\"", "raw_code": "", "doc_blocks": [], "root_path": "/home/runner/work/dbt_iterable/dbt_iterable/integration_tests", "depends_on": {"macros": []}}, "seed.iterable_integration_tests.campaign_suppression_list_history_data": {"database": "postgres", "schema": "public", "name": "campaign_suppression_list_history_data", "resource_type": "seed", "package_name": "iterable_integration_tests", "path": "campaign_suppression_list_history_data.csv", "original_file_path": "seeds/campaign_suppression_list_history_data.csv", "unique_id": "seed.iterable_integration_tests.campaign_suppression_list_history_data", "fqn": ["iterable_integration_tests", "campaign_suppression_list_history_data"], "alias": "campaign_suppression_list_history_data", "checksum": {"name": "sha256", "checksum": "c9eaab0efe0e47ef695b57f71b41f23cf527c87610d7770be604e461fe7c9846"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "seed", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {"_fivetran_synced": "timestamp"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": false, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "delimiter": ",", "quote_columns": false}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": false, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"docs": {"show": false}, "quote_columns": "{{ target.type == 'redshift' or var('fivetran_using_source_casing', false) }}", "column_types": {"_fivetran_synced": "timestamp"}}, "created_at": 1789503444.8567157, "relation_name": "\"postgres\".\"public\".\"campaign_suppression_list_history_data\"", "raw_code": "", "doc_blocks": [], "root_path": "/home/runner/work/dbt_iterable/dbt_iterable/integration_tests", "depends_on": {"macros": []}}, "seed.iterable_integration_tests.channel_data": {"database": "postgres", "schema": "public", "name": "channel_data", "resource_type": "seed", "package_name": "iterable_integration_tests", "path": "channel_data.csv", "original_file_path": "seeds/channel_data.csv", "unique_id": "seed.iterable_integration_tests.channel_data", "fqn": ["iterable_integration_tests", "channel_data"], "alias": "channel_data", "checksum": {"name": "sha256", "checksum": "a77e21fb127c0ff7fc652eb5ffc6b3559fde3d63c2c5291a68f10fefcc2fac37"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "seed", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {"id": "bigint", "_fivetran_synced": "timestamp"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": false, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "delimiter": ",", "quote_columns": false}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": false, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"docs": {"show": false}, "quote_columns": "{{ target.type == 'redshift' or var('fivetran_using_source_casing', false) }}", "column_types": {"id": "{%- if target.type == 'bigquery' -%} INT64 {%- else -%} bigint {%- endif -%}", "_fivetran_synced": "timestamp"}}, "created_at": 1789503444.86044, "relation_name": "\"postgres\".\"public\".\"channel_data\"", "raw_code": "", "doc_blocks": [], "root_path": "/home/runner/work/dbt_iterable/dbt_iterable/integration_tests", "depends_on": {"macros": []}}, "seed.iterable_integration_tests.template_history_data": {"database": "postgres", "schema": "public", "name": "template_history_data", "resource_type": "seed", "package_name": "iterable_integration_tests", "path": "template_history_data.csv", "original_file_path": "seeds/template_history_data.csv", "unique_id": "seed.iterable_integration_tests.template_history_data", "fqn": ["iterable_integration_tests", "template_history_data"], "alias": "template_history_data", "checksum": {"name": "sha256", "checksum": "0f0c442398531afc5fb4c18f12f0d0f694eb3453cb09e0c6c48ba340b110f4a6"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "seed", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {"_fivetran_synced": "timestamp"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": false, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "delimiter": ",", "quote_columns": false}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": false, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"docs": {"show": false}, "quote_columns": "{{ target.type == 'redshift' or var('fivetran_using_source_casing', false) }}", "column_types": {"_fivetran_synced": "timestamp"}}, "created_at": 1789503444.8642054, "relation_name": "\"postgres\".\"public\".\"template_history_data\"", "raw_code": "", "doc_blocks": [], "root_path": "/home/runner/work/dbt_iterable/dbt_iterable/integration_tests", "depends_on": {"macros": []}}, "seed.iterable_integration_tests.message_type_data": {"database": "postgres", "schema": "public", "name": "message_type_data", "resource_type": "seed", "package_name": "iterable_integration_tests", "path": "message_type_data.csv", "original_file_path": "seeds/message_type_data.csv", "unique_id": "seed.iterable_integration_tests.message_type_data", "fqn": ["iterable_integration_tests", "message_type_data"], "alias": "message_type_data", "checksum": {"name": "sha256", "checksum": "84228c8c4a13092ca90bdf9579856968f5265c49f456d01b8510834ae3520bce"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "seed", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {"id": "bigint", "channel_id": "bigint", "_fivetran_synced": "timestamp"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": false, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "delimiter": ",", "quote_columns": false}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": false, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"docs": {"show": false}, "quote_columns": "{{ target.type == 'redshift' or var('fivetran_using_source_casing', false) }}", "column_types": {"id": "{%- if target.type == 'bigquery' -%} INT64 {%- else -%} bigint {%- endif -%}", "channel_id": "{%- if target.type == 'bigquery' -%} INT64 {%- else -%} bigint {%- endif -%}", "_fivetran_synced": "timestamp"}}, "created_at": 1789503444.868063, "relation_name": "\"postgres\".\"public\".\"message_type_data\"", "raw_code": "", "doc_blocks": [], "root_path": "/home/runner/work/dbt_iterable/dbt_iterable/integration_tests", "depends_on": {"macros": []}}, "seed.iterable_integration_tests.event_data": {"database": "postgres", "schema": "public", "name": "event_data", "resource_type": "seed", "package_name": "iterable_integration_tests", "path": "event_data.csv", "original_file_path": "seeds/event_data.csv", "unique_id": "seed.iterable_integration_tests.event_data", "fqn": ["iterable_integration_tests", "event_data"], "alias": "event_data", "checksum": {"name": "sha256", "checksum": "c886615b369d98135814bac7c4070be9d58b4aa6eb9a90a5caa5ddc4454ab0ed"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "seed", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {"transactional_data": "varchar(100)", "created_at": "timestamp", "_fivetran_synced": "timestamp"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": false, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "delimiter": ",", "quote_columns": false}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": false, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"docs": {"show": false}, "quote_columns": "{{ target.type == 'redshift' or var('fivetran_using_source_casing', false) }}", "column_types": {"transactional_data": "{{ 'varchar(100)' if target.type in ('redshift', 'postgres') else 'string'}}", "created_at": "timestamp", "_fivetran_synced": "timestamp"}}, "created_at": 1789503444.8717995, "relation_name": "\"postgres\".\"public\".\"event_data\"", "raw_code": "", "doc_blocks": [], "root_path": "/home/runner/work/dbt_iterable/dbt_iterable/integration_tests", "depends_on": {"macros": []}}, "seed.iterable_integration_tests.list_user_data": {"database": "postgres", "schema": "public", "name": "list_user_data", "resource_type": "seed", "package_name": "iterable_integration_tests", "path": "list_user_data.csv", "original_file_path": "seeds/list_user_data.csv", "unique_id": "seed.iterable_integration_tests.list_user_data", "fqn": ["iterable_integration_tests", "list_user_data"], "alias": "list_user_data", "checksum": {"name": "sha256", "checksum": "2dbd80b8fb4338602a543026ede3f5a0797c0a4cf13c4724a877bb60ac6a4793"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "seed", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {"list_id": "bigint", "index": "bigint", "_fivetran_synced": "timestamp"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": false, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "delimiter": ",", "quote_columns": false}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": false, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"docs": {"show": false}, "quote_columns": "{{ target.type == 'redshift' or var('fivetran_using_source_casing', false) }}", "column_types": {"list_id": "{%- if target.type == 'bigquery' -%} INT64 {%- else -%} bigint {%- endif -%}", "index": "{%- if target.type == 'bigquery' -%} INT64 {%- else -%} bigint {%- endif -%}", "_fivetran_synced": "timestamp"}}, "created_at": 1789503444.8755531, "relation_name": "\"postgres\".\"public\".\"list_user_data\"", "raw_code": "", "doc_blocks": [], "root_path": "/home/runner/work/dbt_iterable/dbt_iterable/integration_tests", "depends_on": {"macros": []}}, "seed.iterable_integration_tests.user_history_bq_json_data": {"database": "postgres", "schema": "public", "name": "user_history_bq_json_data", "resource_type": "seed", "package_name": "iterable_integration_tests", "path": "user_history_bq_json_data.csv", "original_file_path": "seeds/user_history_bq_json_data.csv", "unique_id": "seed.iterable_integration_tests.user_history_bq_json_data", "fqn": ["iterable_integration_tests", "user_history_bq_json_data"], "alias": "user_history_bq_json_data", "checksum": {"name": "sha256", "checksum": "d2689731ace45d1a5c13930bcc8b80f7b3a02993f8ee4c58bfcf754b734a5caa"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "seed", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": false, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "delimiter": ",", "quote_columns": false}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": false, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"docs": {"show": false}, "quote_columns": "{{ target.type == 'redshift' or var('fivetran_using_source_casing', false) }}"}, "created_at": 1789503444.8792076, "relation_name": "\"postgres\".\"public\".\"user_history_bq_json_data\"", "raw_code": "", "doc_blocks": [], "root_path": "/home/runner/work/dbt_iterable/dbt_iterable/integration_tests", "depends_on": {"macros": []}}, "seed.iterable_integration_tests.user_unsubscribed_message_type_data": {"database": "postgres", "schema": "public", "name": "user_unsubscribed_message_type_data", "resource_type": "seed", "package_name": "iterable_integration_tests", "path": "user_unsubscribed_message_type_data.csv", "original_file_path": "seeds/user_unsubscribed_message_type_data.csv", "unique_id": "seed.iterable_integration_tests.user_unsubscribed_message_type_data", "fqn": ["iterable_integration_tests", "user_unsubscribed_message_type_data"], "alias": "user_unsubscribed_message_type_data", "checksum": {"name": "sha256", "checksum": "473f01110084e53b2115bd09606172cb87559359ccd66775f60209851bfdac12"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "seed", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {"_fivetran_synced": "timestamp"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": false, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "delimiter": ",", "quote_columns": false}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": false, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"docs": {"show": false}, "quote_columns": "{{ target.type == 'redshift' or var('fivetran_using_source_casing', false) }}", "column_types": {"_fivetran_synced": "timestamp"}}, "created_at": 1789503444.8827708, "relation_name": "\"postgres\".\"public\".\"user_unsubscribed_message_type_data\"", "raw_code": "", "doc_blocks": [], "root_path": "/home/runner/work/dbt_iterable/dbt_iterable/integration_tests", "depends_on": {"macros": []}}, "seed.iterable_integration_tests.journey_data": {"database": "postgres", "schema": "public", "name": "journey_data", "resource_type": "seed", "package_name": "iterable_integration_tests", "path": "journey_data.csv", "original_file_path": "seeds/journey_data.csv", "unique_id": "seed.iterable_integration_tests.journey_data", "fqn": ["iterable_integration_tests", "journey_data"], "alias": "journey_data", "checksum": {"name": "sha256", "checksum": "92a4d352f49066fe21a71c1888414bbdae00796afdaeb5f8ebd361edbcdb4900"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "seed", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {"id": "bigint", "lifetime_limit": "bigint", "simultaneous_limit": "bigint", "start_tile_id": "bigint", "created_at": "timestamp", "updated_at": "timestamp", "_fivetran_synced": "timestamp"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": false, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "delimiter": ",", "quote_columns": false}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": false, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"docs": {"show": false}, "quote_columns": "{{ target.type == 'redshift' or var('fivetran_using_source_casing', false) }}", "column_types": {"id": "{%- if target.type == 'bigquery' -%} INT64 {%- else -%} bigint {%- endif -%}", "lifetime_limit": "{%- if target.type == 'bigquery' -%} INT64 {%- else -%} bigint {%- endif -%}", "simultaneous_limit": "{%- if target.type == 'bigquery' -%} INT64 {%- else -%} bigint {%- endif -%}", "start_tile_id": "{%- if target.type == 'bigquery' -%} INT64 {%- else -%} bigint {%- endif -%}", "created_at": "timestamp", "updated_at": "timestamp", "_fivetran_synced": "timestamp"}}, "created_at": 1789503444.8867135, "relation_name": "\"postgres\".\"public\".\"journey_data\"", "raw_code": "", "doc_blocks": [], "root_path": "/home/runner/work/dbt_iterable/dbt_iterable/integration_tests", "depends_on": {"macros": []}}, "seed.iterable_integration_tests.campaign_history_data": {"database": "postgres", "schema": "public", "name": "campaign_history_data", "resource_type": "seed", "package_name": "iterable_integration_tests", "path": "campaign_history_data.csv", "original_file_path": "seeds/campaign_history_data.csv", "unique_id": "seed.iterable_integration_tests.campaign_history_data", "fqn": ["iterable_integration_tests", "campaign_history_data"], "alias": "campaign_history_data", "checksum": {"name": "sha256", "checksum": "06adf392dab227dbabbda6782b710213ceea5a30d87990d0cbabe92ba0a955c4"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "seed", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {"_fivetran_synced": "timestamp"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": false, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "delimiter": ",", "quote_columns": false}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": false, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"docs": {"show": false}, "quote_columns": "{{ target.type == 'redshift' or var('fivetran_using_source_casing', false) }}", "column_types": {"_fivetran_synced": "timestamp"}}, "created_at": 1789503444.8904538, "relation_name": "\"postgres\".\"public\".\"campaign_history_data\"", "raw_code": "", "doc_blocks": [], "root_path": "/home/runner/work/dbt_iterable/dbt_iterable/integration_tests", "depends_on": {"macros": []}}, "seed.iterable_integration_tests.list_data": {"database": "postgres", "schema": "public", "name": "list_data", "resource_type": "seed", "package_name": "iterable_integration_tests", "path": "list_data.csv", "original_file_path": "seeds/list_data.csv", "unique_id": "seed.iterable_integration_tests.list_data", "fqn": ["iterable_integration_tests", "list_data"], "alias": "list_data", "checksum": {"name": "sha256", "checksum": "9d817c52008be5fbdb25cde6fa5855f8222f41a436ba7e2e5ed564e319cb64fd"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "seed", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {"_fivetran_synced": "timestamp"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": false, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "delimiter": ",", "quote_columns": false}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": false, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"docs": {"show": false}, "quote_columns": "{{ target.type == 'redshift' or var('fivetran_using_source_casing', false) }}", "column_types": {"_fivetran_synced": "timestamp"}}, "created_at": 1789503444.8941548, "relation_name": "\"postgres\".\"public\".\"list_data\"", "raw_code": "", "doc_blocks": [], "root_path": "/home/runner/work/dbt_iterable/dbt_iterable/integration_tests", "depends_on": {"macros": []}}, "seed.iterable_integration_tests.event_extension_data": {"database": "postgres", "schema": "public", "name": "event_extension_data", "resource_type": "seed", "package_name": "iterable_integration_tests", "path": "event_extension_data.csv", "original_file_path": "seeds/event_extension_data.csv", "unique_id": "seed.iterable_integration_tests.event_extension_data", "fqn": ["iterable_integration_tests", "event_extension_data"], "alias": "event_extension_data", "checksum": {"name": "sha256", "checksum": "e0ed2a4a9661ad12bdd9d9a2221df3fd32f2da5fad39e9d0f6f01cbc819ffa9a"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "seed", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {"payload": "varchar(100)", "_fivetran_synced": "timestamp"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": false, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "delimiter": ",", "quote_columns": false}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": false, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"docs": {"show": false}, "quote_columns": "{{ target.type == 'redshift' or var('fivetran_using_source_casing', false) }}", "column_types": {"payload": "{{ 'varchar(100)' if target.type in ('redshift', 'postgres') else 'string'}}", "_fivetran_synced": "timestamp"}}, "created_at": 1789503444.8978896, "relation_name": "\"postgres\".\"public\".\"event_extension_data\"", "raw_code": "", "doc_blocks": [], "root_path": "/home/runner/work/dbt_iterable/dbt_iterable/integration_tests", "depends_on": {"macros": []}}, "seed.iterable_integration_tests.user_unsubscribed_channel_data": {"database": "postgres", "schema": "public", "name": "user_unsubscribed_channel_data", "resource_type": "seed", "package_name": "iterable_integration_tests", "path": "user_unsubscribed_channel_data.csv", "original_file_path": "seeds/user_unsubscribed_channel_data.csv", "unique_id": "seed.iterable_integration_tests.user_unsubscribed_channel_data", "fqn": ["iterable_integration_tests", "user_unsubscribed_channel_data"], "alias": "user_unsubscribed_channel_data", "checksum": {"name": "sha256", "checksum": "4c6abacf719352d79d0da89751296fc2665d65546ee2c1ad45d142918c750f28"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "seed", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {"_fivetran_synced": "timestamp"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": false, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "delimiter": ",", "quote_columns": false}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": false, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"docs": {"show": false}, "quote_columns": "{{ target.type == 'redshift' or var('fivetran_using_source_casing', false) }}", "column_types": {"_fivetran_synced": "timestamp"}}, "created_at": 1789503444.90169, "relation_name": "\"postgres\".\"public\".\"user_unsubscribed_channel_data\"", "raw_code": "", "doc_blocks": [], "root_path": "/home/runner/work/dbt_iterable/dbt_iterable/integration_tests", "depends_on": {"macros": []}}, "seed.iterable_integration_tests.campaign_label_history_data": {"database": "postgres", "schema": "public", "name": "campaign_label_history_data", "resource_type": "seed", "package_name": "iterable_integration_tests", "path": "campaign_label_history_data.csv", "original_file_path": "seeds/campaign_label_history_data.csv", "unique_id": "seed.iterable_integration_tests.campaign_label_history_data", "fqn": ["iterable_integration_tests", "campaign_label_history_data"], "alias": "campaign_label_history_data", "checksum": {"name": "sha256", "checksum": "30ed21c883f801eb859d0280b90d45cb3dd020cdb708f4ef4aeca772372bf077"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "seed", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {"_fivetran_synced": "timestamp"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": false, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "delimiter": ",", "quote_columns": false}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": false, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"docs": {"show": false}, "quote_columns": "{{ target.type == 'redshift' or var('fivetran_using_source_casing', false) }}", "column_types": {"_fivetran_synced": "timestamp"}}, "created_at": 1789503444.9053767, "relation_name": "\"postgres\".\"public\".\"campaign_label_history_data\"", "raw_code": "", "doc_blocks": [], "root_path": "/home/runner/work/dbt_iterable/dbt_iterable/integration_tests", "depends_on": {"macros": []}}, "seed.iterable_integration_tests.user_history_data": {"database": "postgres", "schema": "public", "name": "user_history_data", "resource_type": "seed", "package_name": "iterable_integration_tests", "path": "user_history_data.csv", "original_file_path": "seeds/user_history_data.csv", "unique_id": "seed.iterable_integration_tests.user_history_data", "fqn": ["iterable_integration_tests", "user_history_data"], "alias": "user_history_data", "checksum": {"name": "sha256", "checksum": "708bd35a21174cf05f0b4370079a339061c0b9292690ac4facd43b1d2bdff186"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "seed", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {"updated_at": "timestamp", "_fivetran_synced": "timestamp"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": false, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "delimiter": ",", "quote_columns": false}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": false, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"docs": {"show": false}, "quote_columns": "{{ target.type == 'redshift' or var('fivetran_using_source_casing', false) }}", "column_types": {"updated_at": "timestamp", "_fivetran_synced": "timestamp"}}, "created_at": 1789503444.909143, "relation_name": "\"postgres\".\"public\".\"user_history_data\"", "raw_code": "", "doc_blocks": [], "root_path": "/home/runner/work/dbt_iterable/dbt_iterable/integration_tests", "depends_on": {"macros": []}}, "model.iterable.iterable__users": {"database": "postgres", "schema": "public_iterable_dev", "name": "iterable__users", "resource_type": "model", "package_name": "iterable", "path": "iterable__users.sql", "original_file_path": "models/iterable__users.sql", "unique_id": "model.iterable.iterable__users", "fqn": ["iterable", "iterable__users"], "alias": "iterable__users", "checksum": {"name": "sha256", "checksum": "da23dacdef77d357083015551b25b1e1013e549ccea451e28820df44f3ac4f5a"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "table", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "Table that provides unique user enriched information.", "columns": {"source_relation": {"name": "source_relation", "description": "Identifies the record's source.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": ["doc.iterable.source_relation"]}, "unique_user_key": {"name": "unique_user_key", "description": "The unique identifier of the user. With the new schema (Aug 2023), it is the _fivetran_user_id. This is a hash of user_id and/or email, depending on project type. If using the old schema, it is email.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "_fivetran_user_id": {"name": "_fivetran_user_id", "description": "A Fivetran-created unique identifier for the new Iterable schema in Aug 2023, for users, derived from hashing user_id and/or email, depending on project type.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "email": {"name": "email", "description": "The user's email. User identifier, for email-based projects. Previously was the unique identifier for user records, for the old Iterable schema before the August 2023 updates.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "first_name": {"name": "first_name", "description": "First name of the user", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "last_name": {"name": "last_name", "description": "Last name of the user", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "user_id": {"name": "user_id", "description": "User identifier, for userID-based projects.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "signup_date": {"name": "signup_date", "description": "Timestamp of when the user signed up", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "signup_source": {"name": "signup_source", "description": "Source where the user signed up", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "updated_at": {"name": "updated_at", "description": "Last update timestamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "phone_number": {"name": "phone_number", "description": "Phone number associated with the user", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "email_list_ids": {"name": "email_list_ids", "description": "Array of all email lists associated with the user, derived from the list_user table relationships", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "count_lists": {"name": "count_lists", "description": "Total count of lists associated with the user", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "count_total_campaigns": {"name": "count_total_campaigns", "description": "Count of all campaigns the user has been in", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "first_event_at": {"name": "first_event_at", "description": "The first event the user ever encountered", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "last_event_at": {"name": "last_event_at", "description": "The most recent event the user has encountered", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_emailclick": {"name": "total_emailclick", "description": "Total number of email clicks the user has performed", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_emailunsubscribe": {"name": "total_emailunsubscribe", "description": "Total unsubscription events the user has performed", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_emailcomplaint": {"name": "total_emailcomplaint", "description": "Total email complaints the user has performed", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_customevent": {"name": "total_customevent", "description": "Total custom events associated with the user", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_emailsubscribe": {"name": "total_emailsubscribe", "description": "Total subscription events the user has performed", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_emailopen": {"name": "total_emailopen", "description": "Total email opened events the user has performed", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_pushsend": {"name": "total_pushsend", "description": "The push send events the user has experienced", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_smsbounce": {"name": "total_smsbounce", "description": "Total sms bounces that are associated with the user", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_pushbounce": {"name": "total_pushbounce", "description": "Total number of push bounces associated with the user", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_inappsendskip": {"name": "total_inappsendskip", "description": "Total in app send skips associated with the user", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_smssend": {"name": "total_smssend", "description": "Total sms sends that the user has experienced", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_inappsend": {"name": "total_inappsend", "description": "Total in app sends the user has experienced", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_pushopen": {"name": "total_pushopen", "description": "Total push messages the user has opened", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_emailsend": {"name": "total_emailsend", "description": "Total emails that have been sent to the user", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_pushsendskip": {"name": "total_pushsendskip", "description": "Total push sends the user has skipped", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_inappopen": {"name": "total_inappopen", "description": "Total in app opens the user has performed", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_emailsendskip": {"name": "total_emailsendskip", "description": "Total email sends the user has skipped", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_emailbounce": {"name": "total_emailbounce", "description": "Total number of emails that have bounced from the user", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_inappclick": {"name": "total_inappclick", "description": "Total in app clicks associated with the user", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_pushuninstall": {"name": "total_pushuninstall", "description": "Total push uninstall events the user has performed", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "iterable://models/iterable.yml", "build_path": null, "unrendered_config": {"materialized": "table", "schema": "iterable_{{ var('directed_schema','dev') }}", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789503446.3289306, "relation_name": "\"postgres\".\"public_iterable_dev\".\"iterable__users\"", "raw_code": "{% set passthrough_column_count = var('iterable_user_history_pass_through_columns') | length %}\n\nwith user_event_metrics as (\n\n select *\n from {{ ref('int_iterable__user_event_metrics') }}\n\n), list_users as (\n\n select *\n from {{ ref('stg_iterable__list_user') }}\n order by list_id -- so the list ids will aggregate in the right order\n\n), list_user_aggregated as (\n\n select\n source_relation,\n _fivetran_user_id,\n count(*) as count_lists,\n {{ dbt.concat([\"'['\", fivetran_utils.string_agg(field_to_agg=\"cast(list_id as \" ~ dbt.type_string() ~ \")\", delimiter=\"','\"), \"']'\"]) }} as email_list_ids\n from list_users\n group by 1, 2 \n\n), user_history_unnest as (\n -- this has all the user fields we're looking to pass through\n\n select *\n from {{ ref('int_iterable__list_user_unnest') }}\n\n -- limit to current lists they are a member of. each list-user combo is a unique row, which we will roll up\n where is_current\n\n), user_with_list_metrics as (\n\n select\n source_relation,\n user_id,\n _fivetran_user_id,\n unique_user_key,\n email,\n first_name,\n last_name,\n signup_date,\n signup_source,\n updated_at,\n phone_number,\n email_list_ids\n\n --The below script allows for pass through columns.\n {{ fivetran_utils.persist_pass_through_columns(pass_through_variable='iterable_user_history_pass_through_columns') }}\n\n , count(distinct list_id) as count_lists\n\n from user_history_unnest\n -- roll up to the user\n {{ dbt_utils.group_by(n = 12 + passthrough_column_count) }}\n\n), user_join as (\n\n select\n user_with_list_metrics.source_relation,\n user_with_list_metrics.user_id,\n user_with_list_metrics._fivetran_user_id,\n user_with_list_metrics.unique_user_key,\n user_with_list_metrics.email,\n user_with_list_metrics.first_name,\n user_with_list_metrics.last_name,\n user_with_list_metrics.signup_date,\n user_with_list_metrics.signup_source,\n user_with_list_metrics.updated_at,\n user_with_list_metrics.phone_number,\n coalesce(list_user_aggregated.email_list_ids, user_with_list_metrics.email_list_ids, '[]') as email_list_ids,\n coalesce(list_user_aggregated.count_lists, user_with_list_metrics.count_lists, 0) as count_lists,\n {{ dbt_utils.star(from=ref('int_iterable__user_event_metrics'), except=['source_relation','unique_user_key','_fivetran_user_id','user_id','user_email']) }}\n {{ fivetran_utils.persist_pass_through_columns(pass_through_variable='iterable_user_history_pass_through_columns', identifier='user_with_list_metrics') }}\n\n from user_with_list_metrics\n left join user_event_metrics\n on user_with_list_metrics.unique_user_key = user_event_metrics.unique_user_key\n and user_with_list_metrics.source_relation = user_event_metrics.source_relation\n left join list_user_aggregated\n -- use _fivetran_user_id since in list_user it is a primary key\n on user_with_list_metrics._fivetran_user_id = list_user_aggregated._fivetran_user_id\n and user_with_list_metrics.source_relation = list_user_aggregated.source_relation\n)\n\nselect *\nfrom user_join", "doc_blocks": [], "language": "sql", "refs": [{"name": "int_iterable__user_event_metrics", "package": null, "version": null}, {"name": "stg_iterable__list_user", "package": null, "version": null}, {"name": "int_iterable__list_user_unnest", "package": null, "version": null}, {"name": "int_iterable__user_event_metrics", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.type_string", "macro.fivetran_utils.string_agg", "macro.dbt.concat", "macro.fivetran_utils.persist_pass_through_columns", "macro.dbt_utils.group_by", "macro.dbt_utils.star"], "nodes": ["model.iterable.int_iterable__user_event_metrics", "model.iterable.stg_iterable__list_user", "model.iterable.int_iterable__list_user_unnest"]}, "compiled_path": "target/compiled/iterable/models/iterable__users.sql", "compiled": true, "compiled_code": "\n\nwith user_event_metrics as (\n\n select *\n from \"postgres\".\"public_iterable_dev\".\"int_iterable__user_event_metrics\"\n\n), list_users as (\n\n select *\n from \"postgres\".\"public_iterable_dev\".\"stg_iterable__list_user\"\n order by list_id -- so the list ids will aggregate in the right order\n\n), list_user_aggregated as (\n\n select\n source_relation,\n _fivetran_user_id,\n count(*) as count_lists,\n '[' || \n string_agg(cast(list_id as TEXT), ',')\n\n || ']' as email_list_ids\n from list_users\n group by 1, 2 \n\n), user_history_unnest as (\n -- this has all the user fields we're looking to pass through\n\n select *\n from \"postgres\".\"public_iterable_dev\".\"int_iterable__list_user_unnest\"\n\n -- limit to current lists they are a member of. each list-user combo is a unique row, which we will roll up\n where is_current\n\n), user_with_list_metrics as (\n\n select\n source_relation,\n user_id,\n _fivetran_user_id,\n unique_user_key,\n email,\n first_name,\n last_name,\n signup_date,\n signup_source,\n updated_at,\n phone_number,\n email_list_ids\n\n --The below script allows for pass through columns.\n \n\n\n\n\n\n , count(distinct list_id) as count_lists\n\n from user_history_unnest\n -- roll up to the user\n group by 1,2,3,4,5,6,7,8,9,10,11,12\n\n), user_join as (\n\n select\n user_with_list_metrics.source_relation,\n user_with_list_metrics.user_id,\n user_with_list_metrics._fivetran_user_id,\n user_with_list_metrics.unique_user_key,\n user_with_list_metrics.email,\n user_with_list_metrics.first_name,\n user_with_list_metrics.last_name,\n user_with_list_metrics.signup_date,\n user_with_list_metrics.signup_source,\n user_with_list_metrics.updated_at,\n user_with_list_metrics.phone_number,\n coalesce(list_user_aggregated.email_list_ids, user_with_list_metrics.email_list_ids, '[]') as email_list_ids,\n coalesce(list_user_aggregated.count_lists, user_with_list_metrics.count_lists, 0) as count_lists,\n \"count_total_campaigns\",\n \"first_event_at\",\n \"last_event_at\",\n \"total_emailclick\",\n \"total_emailunsubscribe\",\n \"total_emailcomplaint\",\n \"total_customevent\",\n \"total_emailsubscribe\",\n \"total_emailopen\",\n \"total_pushsend\",\n \"total_smsbounce\",\n \"total_pushbounce\",\n \"total_inappsendskip\",\n \"total_smssend\",\n \"total_inappsend\",\n \"total_pushopen\",\n \"total_emailsend\",\n \"total_pushsendskip\",\n \"total_inappopen\",\n \"total_emailsendskip\",\n \"total_emailbounce\",\n \"total_inappclick\",\n \"total_pushuninstall\"\n \n\n\n\n\n\n from user_with_list_metrics\n left join user_event_metrics\n on user_with_list_metrics.unique_user_key = user_event_metrics.unique_user_key\n and user_with_list_metrics.source_relation = user_event_metrics.source_relation\n left join list_user_aggregated\n -- use _fivetran_user_id since in list_user it is a primary key\n on user_with_list_metrics._fivetran_user_id = list_user_aggregated._fivetran_user_id\n and user_with_list_metrics.source_relation = list_user_aggregated.source_relation\n)\n\nselect *\nfrom user_join", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.iterable__list_user_history": {"database": "postgres", "schema": "public_iterable_dev", "name": "iterable__list_user_history", "resource_type": "model", "package_name": "iterable", "path": "iterable__list_user_history.sql", "original_file_path": "models/iterable__list_user_history.sql", "unique_id": "model.iterable.iterable__list_user_history", "fqn": ["iterable", "iterable__list_user_history"], "alias": "iterable__list_user_history", "checksum": {"name": "sha256", "checksum": "9c0778ad02c86e2145ba4189534ea1eabf07b41bb3aa414934fa554ae4af4e1c"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "table", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "Table that recreates the `list_user_history` source table. Additionally, this table provides an `is_current` field to identify the current lists associated with the user. The table coalesces list_id values from both the direct list_user relationships and the unnested email_list_ids from user history to ensure comprehensive list coverage. The grain of this table is at the user/list/updated_at level.\n", "columns": {"source_relation": {"name": "source_relation", "description": "Identifies the record's source.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": ["doc.iterable.source_relation"]}, "unique_user_key": {"name": "unique_user_key", "description": "The unique identifier of the user. With the new schema (Aug 2023), it is the _fivetran_user_id. This is a hash of user_id and/or email, depending on project type. If using the old schema, it is email.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "_fivetran_user_id": {"name": "_fivetran_user_id", "description": "A Fivetran-created unique identifier for the new Iterable schema in Aug 2023, for users, derived from hashing user_id and/or email, depending on project type.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "user_email": {"name": "user_email", "description": "Email of the user if it exists.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "user_first_name": {"name": "user_first_name", "description": "First name of the user", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "user_last_name": {"name": "user_last_name", "description": "Last name of the user", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "user_id": {"name": "user_id", "description": "User identifier, for userID-based projects.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "user_signup_date": {"name": "user_signup_date", "description": "Timestamp of when the user signed up", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "user_signup_source": {"name": "user_signup_source", "description": "Source where the user signed up", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "user_updated_at": {"name": "user_updated_at", "description": "Last update timestamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "list_id": {"name": "list_id", "description": "The list associated with the user. Uses coalesced values prioritizing `list_id` from `LIST_USER` over the unnested `email_list_ids` from `USER_HISTORY` for comprehensive list coverage.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "is_current": {"name": "is_current", "description": "Boolean indicating if the current list is active", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "list_name": {"name": "list_name", "description": "Name of the list associated with the user", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "list_type": {"name": "list_type", "description": "Type of list associated with the user", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "list_created_at": {"name": "list_created_at", "description": "Date the list was created", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "iterable://models/iterable.yml", "build_path": null, "unrendered_config": {"materialized": "table", "schema": "iterable_{{ var('directed_schema','dev') }}", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789503446.3200083, "relation_name": "\"postgres\".\"public_iterable_dev\".\"iterable__list_user_history\"", "raw_code": "with user_history_unnest as (\n\n select *\n from {{ ref('int_iterable__list_user_unnest') }}\n\n), list_users as (\n\n select *\n from {{ ref('stg_iterable__list_user') }}\n\n), lists as (\n\n select *\n from {{ ref('stg_iterable__list') }}\n\n), final as (\n select distinct\n user_history_unnest.source_relation,\n user_history_unnest.unique_user_key,\n user_history_unnest._fivetran_user_id,\n user_history_unnest.user_id,\n user_history_unnest.email as user_email,\n user_history_unnest.first_name as user_first_name,\n user_history_unnest.last_name as user_last_name,\n user_history_unnest.signup_date as user_signup_date,\n user_history_unnest.signup_source as user_signup_source,\n user_history_unnest.updated_at as user_updated_at,\n coalesce(list_users.list_id, user_history_unnest.list_id) as list_id,\n user_history_unnest.is_current,\n lists.list_name,\n lists.list_type,\n lists.created_at as list_created_at\n\n --The below script allows for pass through columns.\n {{ fivetran_utils.persist_pass_through_columns(pass_through_variable='iterable_user_history_pass_through_columns', identifier='user_history_unnest') }}\n\n from user_history_unnest\n left join list_users\n on list_users.source_relation = user_history_unnest.source_relation\n and list_users._fivetran_user_id = user_history_unnest._fivetran_user_id\n left join lists\n on lists.source_relation = user_history_unnest.source_relation\n and lists.list_id = coalesce(list_users.list_id, user_history_unnest.list_id)\n)\n\nselect *\nfrom final", "doc_blocks": [], "language": "sql", "refs": [{"name": "int_iterable__list_user_unnest", "package": null, "version": null}, {"name": "stg_iterable__list_user", "package": null, "version": null}, {"name": "stg_iterable__list", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.fivetran_utils.persist_pass_through_columns"], "nodes": ["model.iterable.int_iterable__list_user_unnest", "model.iterable.stg_iterable__list_user", "model.iterable.stg_iterable__list"]}, "compiled_path": "target/compiled/iterable/models/iterable__list_user_history.sql", "compiled": true, "compiled_code": "with user_history_unnest as (\n\n select *\n from \"postgres\".\"public_iterable_dev\".\"int_iterable__list_user_unnest\"\n\n), list_users as (\n\n select *\n from \"postgres\".\"public_iterable_dev\".\"stg_iterable__list_user\"\n\n), lists as (\n\n select *\n from \"postgres\".\"public_iterable_dev\".\"stg_iterable__list\"\n\n), final as (\n select distinct\n user_history_unnest.source_relation,\n user_history_unnest.unique_user_key,\n user_history_unnest._fivetran_user_id,\n user_history_unnest.user_id,\n user_history_unnest.email as user_email,\n user_history_unnest.first_name as user_first_name,\n user_history_unnest.last_name as user_last_name,\n user_history_unnest.signup_date as user_signup_date,\n user_history_unnest.signup_source as user_signup_source,\n user_history_unnest.updated_at as user_updated_at,\n coalesce(list_users.list_id, user_history_unnest.list_id) as list_id,\n user_history_unnest.is_current,\n lists.list_name,\n lists.list_type,\n lists.created_at as list_created_at\n\n --The below script allows for pass through columns.\n \n\n\n\n\n\n from user_history_unnest\n left join list_users\n on list_users.source_relation = user_history_unnest.source_relation\n and list_users._fivetran_user_id = user_history_unnest._fivetran_user_id\n left join lists\n on lists.source_relation = user_history_unnest.source_relation\n and lists.list_id = coalesce(list_users.list_id, user_history_unnest.list_id)\n)\n\nselect *\nfrom final", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.iterable__events": {"database": "postgres", "schema": "public_iterable_dev", "name": "iterable__events", "resource_type": "model", "package_name": "iterable", "path": "iterable__events.sql", "original_file_path": "models/iterable__events.sql", "unique_id": "model.iterable.iterable__events", "fqn": ["iterable", "iterable__events"], "alias": "iterable__events", "checksum": {"name": "sha256", "checksum": "d516cb05680b528ba689ac2a2e34bfee8bbd7ede3c7d8ccfea16a28232d39c44"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "incremental", "incremental_strategy": "delete+insert", "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": ["unique_event_id"], "on_schema_change": "fail", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}, "partition_by": {"field": "created_on", "data_type": "date"}, "file_format": "delta"}, "tags": [], "description": "Table that provides a comprehensive view of all events with enriched information such as the campaign, user effected, and template used.", "columns": {"source_relation": {"name": "source_relation", "description": "Identifies the record's source.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": ["doc.iterable.source_relation"]}, "event_id": {"name": "event_id", "description": "Unique id of the event generated by Fivetran", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_event_id": {"name": "unique_event_id", "description": "A unique surrogate key of event_id, _fivetran_user_id, and source_relation.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_user_key": {"name": "unique_user_key", "description": "The unique identifier of the user. With the new schema (Aug 2023), it is the _fivetran_user_id. This is a hash of user_id and/or email, depending on project type. If using the old schema, it is email.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "_fivetran_user_id": {"name": "_fivetran_user_id", "description": "A Fivetran-created unique identifier for the new Iterable schema in Aug 2023, for users, derived from hashing user_id and/or email, depending on project type.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "campaign_id": {"name": "campaign_id", "description": "Reference to the campaign from which the event originated", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "content_id": {"name": "content_id", "description": "Reference to the content the event is associated with", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "created_at": {"name": "created_at", "description": "Creation timestamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "email": {"name": "email", "description": "The user's email. User identifier, for email-based projects. Previously was the unique identifier for user records, for the old Iterable schema before the August 2023 updates.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "additional_properties": {"name": "additional_properties", "description": "json object containing addition event properties", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "event_name": {"name": "event_name", "description": "Name provided to the individual event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "message_bus_id": {"name": "message_bus_id", "description": "Reference to the message bus associated with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "message_id": {"name": "message_id", "description": "Reference to the message the event is associated with", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "message_type_id": {"name": "message_type_id", "description": "Reference to the type of message the event is associated with", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "recipient_state": {"name": "recipient_state", "description": "The state of the recipient upon receiving the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "status": {"name": "status", "description": "Status of the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "transactional_data": {"name": "transactional_data", "description": "Transactional data associated with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unsub_source": {"name": "unsub_source", "description": "Source of the unsubscribe event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "user_agent": {"name": "user_agent", "description": "User agent associated with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "user_agent_device": {"name": "user_agent_device", "description": "The device of the user agent", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "Timestamp of when the event record was synced by Fivetran", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "campaign_name": {"name": "campaign_name", "description": "The name of the campaign", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "campaign_type": {"name": "campaign_type", "description": "The type of campaign", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "is_campaign_recurring": {"name": "is_campaign_recurring", "description": "Boolean indicating if the campaign is recurrent", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "recurring_campaign_name": {"name": "recurring_campaign_name", "description": "The name of the recurring campaign (if applicable)", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "recurring_campaign_id": {"name": "recurring_campaign_id", "description": "The campaign if of the recurring campaign (if applicable)", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "user_id": {"name": "user_id", "description": "User identifier, for userID-based projects.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "user_full_name": {"name": "user_full_name", "description": "Full name of the user", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "message_type_name": {"name": "message_type_name", "description": "Name of the message type", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "message_medium": {"name": "message_medium", "description": "Medium of the message", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "channel_id": {"name": "channel_id", "description": "Unique identifier of the channel", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "channel_name": {"name": "channel_name", "description": "The channel name", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "channel_type": {"name": "channel_type", "description": "The type of channel", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "is_app_already_running": {"name": "is_app_already_running", "description": "Boolean indicating if the app is already running", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "badge": {"name": "badge", "description": "Badge associated with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "canonical_url_id": {"name": "canonical_url_id", "description": "Reference to the url associated with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "is_content_available": {"name": "is_content_available", "description": "Content available from the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "device": {"name": "device", "description": "The device associated with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "email_id": {"name": "email_id", "description": "Reference to the email associated with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "email_subject": {"name": "email_subject", "description": "Subject of the email associated with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "experiment_id": {"name": "experiment_id", "description": "Reference to the experiment used if the event is an experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "from_phone_number_id": {"name": "from_phone_number_id", "description": "Reference to the phone number which the event is from", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "from_smssender_id": {"name": "from_smssender_id", "description": "Reference to the sms sender which the event is from", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "link_id": {"name": "link_id", "description": "Reference to the link associated with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "link_url": {"name": "link_url", "description": "Url of the link associated with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "locale": {"name": "locale", "description": "Locale associated with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "payload": {"name": "payload", "description": "Payload resulted from the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "platform_endpoint": {"name": "platform_endpoint", "description": "The specific platform endpoint of the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "push_message": {"name": "push_message", "description": "Boolean indicating if the event is a push message", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "region": {"name": "region", "description": "Region of the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "sms_message": {"name": "sms_message", "description": "Boolean indicating if the event is an sms message", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "to_phone_number": {"name": "to_phone_number", "description": "To phone number associated with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "url": {"name": "url", "description": "Url associated with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "workflow_id": {"name": "workflow_id", "description": "Reference to the workflow which the event originated", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "workflow_name": {"name": "workflow_name", "description": "Name of the workflow which the event originated", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "catalog_collection_count": {"name": "catalog_collection_count", "description": "The count of products or items collected in a catalog associated with the event.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "catalog_lookup_count": {"name": "catalog_lookup_count", "description": "The count of times a catalog was looked up or queried during the event.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "template_id": {"name": "template_id", "description": "Unique identifier of the template", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "template_name": {"name": "template_name", "description": "User defined name of the template", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "template_creator_user_id": {"name": "template_creator_user_id", "description": "Reference to the user who created the template", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "created_on": {"name": "created_on", "description": "Day when the event was created", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "city": {"name": "city", "description": "The city associated with the event, which could be the location of the recipient.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "clicked_url": {"name": "clicked_url", "description": "The URL that was clicked by the recipient in response to the marketing message.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "country": {"name": "country", "description": "The country associated with the event, which could be the location of the recipient.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "error_code": {"name": "error_code", "description": "The error code or message indicating any issues or errors encountered during the event.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "expires_at": {"name": "expires_at", "description": "The date and time when the event or message is set to expire or become invalid.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "from_phone_number": {"name": "from_phone_number", "description": "The phone number from which the SMS message was sent.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "in_app_body": {"name": "in_app_body", "description": "The content or body of an in-app message that was sent as part of the event.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "is_sms_estimation": {"name": "is_sms_estimation", "description": "A boolean indicating whether the SMS message is an estimation or not.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "labels": {"name": "labels", "description": "Any labels or tags associated with the event, which can be used for categorization or organization.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "message_status": {"name": "message_status", "description": "The status of the marketing message, such as sent, delivered, opened, etc.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "mms_send_count": {"name": "mms_send_count", "description": "The count of multimedia messages (MMS) sent as part of the event.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "reason": {"name": "reason", "description": "The reason or cause associated with a specific event or action.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "sms_send_count": {"name": "sms_send_count", "description": "The count of SMS messages sent as part of the event.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "iterable://models/iterable.yml", "build_path": null, "unrendered_config": {"materialized": "incremental", "schema": "iterable_{{ var('directed_schema','dev') }}", "unique_key": "['unique_event_id']", "incremental_strategy": "CondExpr(test=Compare(expr=Getattr(node=Name(name='target', ctx='load'), attr='type', ctx='load'), ops=[Operand(op='in', expr=Tuple(items=[Const(value='bigquery'), Const(value='spark'), Const(value='databricks')], ctx='load'))]), expr1=Const(value='insert_overwrite'), expr2=Const(value='delete+insert'))", "partition_by": "CondExpr(test=Compare(expr=Getattr(node=Name(name='target', ctx='load'), attr='type', ctx='load'), ops=[Operand(op='notin', expr=Tuple(items=[Const(value='spark'), Const(value='databricks'), Const(value='duckdb')], ctx='load'))]), expr1=Dict(items=[Pair(key=Const(value='field'), value=Const(value='created_on')), Pair(key=Const(value='data_type'), value=Const(value='date'))]), expr2=List(items=[Const(value='created_on')]))", "file_format": "delta", "on_schema_change": "fail", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789503446.307184, "relation_name": "\"postgres\".\"public_iterable_dev\".\"iterable__events\"", "raw_code": "{{ config(\n materialized='incremental',\n unique_key=['unique_event_id'],\n incremental_strategy='insert_overwrite' if target.type in ('bigquery', 'spark', 'databricks') else 'delete+insert',\n partition_by={\"field\": \"created_on\", \"data_type\": \"date\"} if target.type not in ('spark', 'databricks', 'duckdb') else ['created_on'],\n file_format='delta',\n on_schema_change='fail'\n ) \n}}\n\n{% set using_event_extension = var('iterable__using_event_extension', True) %}\n\nwith events as (\n\n select *\n from {{ ref('stg_iterable__event') }}\n\n {% if is_incremental() %}\n where created_on >= {{ iterable.iterable_lookback(\n from_date=\"max(created_on)\",\n datepart='day', \n interval=var('iterable_lookback_window', 7)) }}\n {% endif %}\n\n), campaign as (\n\n select *\n from {{ ref('int_iterable__recurring_campaigns') }}\n\n\n{% if using_event_extension %}\n), event_extension as (\n\n select *\n from {{ ref('stg_iterable__event_extension') }}\n{% endif %}\n\n), users as (\n\n select *\n from {{ ref('int_iterable__latest_user') }}\n\n), message_type_channel as (\n\n select *\n from {{ ref('int_iterable__message_type_channel') }}\n\n), template as (\n\n select *\n from {{ ref('int_iterable__latest_template') }}\n\n), event_join as (\n\n select \n events.*,\n campaign.campaign_name,\n campaign.campaign_type,\n campaign.is_campaign_recurring,\n campaign.recurring_campaign_name,\n campaign.recurring_campaign_id,\n\n users.user_id,\n users.first_name || ' ' || users.last_name as user_full_name,\n\n message_type_channel.message_type_name,\n message_type_channel.message_medium,\n message_type_channel.channel_id,\n message_type_channel.channel_name,\n message_type_channel.channel_type\n\n {% if using_event_extension %}\n {% set exclude_fields = [\"source_relation\", \"unique_user_key\",\"_fivetran_user_id\",\"event_id\", \"content_id\", \"_fivetran_synced\", \"unique_event_id\"] %}\n , {{ dbt_utils.star(from=ref('stg_iterable__event_extension'), except=exclude_fields, relation_alias=\"event_extension\") }}\n {% endif %}\n\n ,\n campaign.template_id,\n template.template_name,\n template.creator_user_id as template_creator_user_id\n \n from events\n\n {% if using_event_extension %}\n left join event_extension\n on events.unique_event_id = event_extension.unique_event_id\n and events.source_relation = event_extension.source_relation\n {% endif %}\n\n left join campaign\n on events.campaign_id = campaign.campaign_id\n and events.source_relation = campaign.source_relation\n left join users\n on events.unique_user_key = users.unique_user_key -- unique_user_key = _fivetran_user_id if exists, otherwise email\n and events.source_relation = users.source_relation\n left join message_type_channel\n on events.message_type_id = message_type_channel.message_type_id\n and events.source_relation = message_type_channel.source_relation\n left join template\n on campaign.template_id = template.template_id\n and events.source_relation = template.source_relation\n)\n\nselect *\nfrom event_join", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__event", "package": null, "version": null}, {"name": "int_iterable__recurring_campaigns", "package": null, "version": null}, {"name": "stg_iterable__event_extension", "package": null, "version": null}, {"name": "int_iterable__latest_user", "package": null, "version": null}, {"name": "int_iterable__message_type_channel", "package": null, "version": null}, {"name": "int_iterable__latest_template", "package": null, "version": null}, {"name": "stg_iterable__event_extension", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.is_incremental", "macro.dbt_utils.star", "macro.iterable.iterable_lookback"], "nodes": ["model.iterable.stg_iterable__event", "model.iterable.int_iterable__recurring_campaigns", "model.iterable.stg_iterable__event_extension", "model.iterable.int_iterable__latest_user", "model.iterable.int_iterable__message_type_channel", "model.iterable.int_iterable__latest_template"]}, "compiled_path": "target/compiled/iterable/models/iterable__events.sql", "compiled": true, "compiled_code": "\n\n\n\nwith events as (\n\n select *\n from \"postgres\".\"public_iterable_dev\".\"stg_iterable__event\"\n\n \n where created_on >= \n\n\n\n \n\n \n\n cast('2020-07-12' as date) + ((interval '1 day') * (-7))\n\n\n\n\n \n\n), campaign as (\n\n select *\n from \"postgres\".\"public_iterable_dev\".\"int_iterable__recurring_campaigns\"\n\n\n\n), event_extension as (\n\n select *\n from \"postgres\".\"public_iterable_dev\".\"stg_iterable__event_extension\"\n\n\n), users as (\n\n select *\n from \"postgres\".\"public_iterable_dev\".\"int_iterable__latest_user\"\n\n), message_type_channel as (\n\n select *\n from \"postgres\".\"public_iterable_dev\".\"int_iterable__message_type_channel\"\n\n), template as (\n\n select *\n from \"postgres\".\"public_iterable_dev\".\"int_iterable__latest_template\"\n\n), event_join as (\n\n select \n events.*,\n campaign.campaign_name,\n campaign.campaign_type,\n campaign.is_campaign_recurring,\n campaign.recurring_campaign_name,\n campaign.recurring_campaign_id,\n\n users.user_id,\n users.first_name || ' ' || users.last_name as user_full_name,\n\n message_type_channel.message_type_name,\n message_type_channel.message_medium,\n message_type_channel.channel_id,\n message_type_channel.channel_name,\n message_type_channel.channel_type\n\n \n \n , event_extension.\"is_app_already_running\",\n event_extension.\"badge\",\n event_extension.\"catalog_collection_count\",\n event_extension.\"catalog_lookup_count\",\n event_extension.\"canonical_url_id\",\n event_extension.\"is_content_available\",\n event_extension.\"device\",\n event_extension.\"email_id\",\n event_extension.\"email_subject\",\n event_extension.\"experiment_id\",\n event_extension.\"from_phone_number_id\",\n event_extension.\"from_smssender_id\",\n event_extension.\"link_id\",\n event_extension.\"link_url\",\n event_extension.\"locale\",\n event_extension.\"payload\",\n event_extension.\"platform_endpoint\",\n event_extension.\"push_message\",\n event_extension.\"region\",\n event_extension.\"sms_message\",\n event_extension.\"to_phone_number\",\n event_extension.\"url\",\n event_extension.\"workflow_id\",\n event_extension.\"workflow_name\",\n event_extension.\"city\",\n event_extension.\"clicked_url\",\n event_extension.\"country\",\n event_extension.\"error_code\",\n event_extension.\"expires_at\",\n event_extension.\"from_phone_number\",\n event_extension.\"in_app_body\",\n event_extension.\"is_sms_estimation\",\n event_extension.\"labels\",\n event_extension.\"message_status\",\n event_extension.\"mms_send_count\",\n event_extension.\"reason\",\n event_extension.\"sms_send_count\"\n \n\n ,\n campaign.template_id,\n template.template_name,\n template.creator_user_id as template_creator_user_id\n \n from events\n\n \n left join event_extension\n on events.unique_event_id = event_extension.unique_event_id\n and events.source_relation = event_extension.source_relation\n \n\n left join campaign\n on events.campaign_id = campaign.campaign_id\n and events.source_relation = campaign.source_relation\n left join users\n on events.unique_user_key = users.unique_user_key -- unique_user_key = _fivetran_user_id if exists, otherwise email\n and events.source_relation = users.source_relation\n left join message_type_channel\n on events.message_type_id = message_type_channel.message_type_id\n and events.source_relation = message_type_channel.source_relation\n left join template\n on campaign.template_id = template.template_id\n and events.source_relation = template.source_relation\n)\n\nselect *\nfrom event_join", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.iterable__user_campaign": {"database": "postgres", "schema": "public_iterable_dev", "name": "iterable__user_campaign", "resource_type": "model", "package_name": "iterable", "path": "iterable__user_campaign.sql", "original_file_path": "models/iterable__user_campaign.sql", "unique_id": "model.iterable.iterable__user_campaign", "fqn": ["iterable", "iterable__user_campaign"], "alias": "iterable__user_campaign", "checksum": {"name": "sha256", "checksum": "343ed0b8ab547da53812f4a8426cfd7b93f81ce3886680c4182a2596f1ea8632"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "table", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "Table that provides total and unique metrics for a user associated with particular campaigns and if available, experiments.", "columns": {"source_relation": {"name": "source_relation", "description": "Identifies the record's source.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": ["doc.iterable.source_relation"]}, "unique_user_campaign_id": {"name": "unique_user_campaign_id", "description": "Unique ID combining source_relation, unique_user_key, campaign_id, and if available, experiment_id.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "_fivetran_user_id": {"name": "_fivetran_user_id", "description": "A Fivetran-created unique identifier for the new Iterable schema in Aug 2023, for users, derived from hashing user_id and/or email, depending on project type.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_user_key": {"name": "unique_user_key", "description": "The unique identifier of the user. With the new schema (Aug 2023), it is the _fivetran_user_id. This is a hash of user_id and/or email, depending on project type. If using the old schema, it is email.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "user_id": {"name": "user_id", "description": "User identifier, for userID-based projects.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "user_email": {"name": "user_email", "description": "Email of the user if it exists.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "user_full_name": {"name": "user_full_name", "description": "The users first and last name", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "campaign_id": {"name": "campaign_id", "description": "The unique identifier of the campaign which the user metrics are associated", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "campaign_name": {"name": "campaign_name", "description": "The name of the campaign which the user metrics are associated", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "template_id": {"name": "template_id", "description": "The unique identifier of the template used within the campaign", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "template_name": {"name": "template_name", "description": "The name of the template used for the campaign", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "experiment_id": {"name": "experiment_id", "description": "The unique experiment variation of the campaign", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "recurring_campaign_id": {"name": "recurring_campaign_id", "description": "The unique identifier of the recurring campaign which the campaign is tied to", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "recurring_campaign_name": {"name": "recurring_campaign_name", "description": "The name of the recurring campaign which the campaign is tied to", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "first_event_at": {"name": "first_event_at", "description": "Timestamp of the first campaign/experiment event associated with the user", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "last_event_at": {"name": "last_event_at", "description": "Timestamp of the most recent campaign/experiment event associated with the user", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_emailclick": {"name": "total_emailclick", "description": "Total email clicks events the user took within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_emailunsubscribe": {"name": "total_emailunsubscribe", "description": "Total email unsubscription events the user performed within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_emailcomplaint": {"name": "total_emailcomplaint", "description": "Total email complaint events the user performed within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_customevent": {"name": "total_customevent", "description": "Total custom events associated with the user within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_emailsubscribe": {"name": "total_emailsubscribe", "description": "Total email subscription events associate with the user within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_emailopen": {"name": "total_emailopen", "description": "Total email open events the user performed within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_pushsend": {"name": "total_pushsend", "description": "Total push send events the user performed within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_smsbounce": {"name": "total_smsbounce", "description": "Total sms bounce events associated with the user within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_pushbounce": {"name": "total_pushbounce", "description": "Total push bounce events associated with the user within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_inappsendskip": {"name": "total_inappsendskip", "description": "Total in app send skip events the user performed within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_smssend": {"name": "total_smssend", "description": "Total sms send events associated with the user within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_inappsend": {"name": "total_inappsend", "description": "Total in app send events associated with the user within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_pushopen": {"name": "total_pushopen", "description": "Total push open events the user performed within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_emailsend": {"name": "total_emailsend", "description": "Total email send event associated with the user within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_pushsendskip": {"name": "total_pushsendskip", "description": "Total push send skip events associated with the user within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_inappopen": {"name": "total_inappopen", "description": "Total in app open events associated with the user within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_emailsendskip": {"name": "total_emailsendskip", "description": "Total email send skip events associated with the user within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_emailbounce": {"name": "total_emailbounce", "description": "Total email bounce events associated with the user within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_inappclick": {"name": "total_inappclick", "description": "Total in app click events associated with the user within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_pushuninstall": {"name": "total_pushuninstall", "description": "Total push uninstall events associated with the user within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "first_open_or_click_event_at": {"name": "first_open_or_click_event_at", "description": "The time of the first open or click time. This is the first time a user interacts with a campaign, recording the earliest occurring event out of 'emailOpen', 'emailClick', and 'pushOpen'.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "iterable://models/iterable.yml", "build_path": null, "unrendered_config": {"materialized": "table", "schema": "iterable_{{ var('directed_schema','dev') }}", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789503446.3229315, "relation_name": "\"postgres\".\"public_iterable_dev\".\"iterable__user_campaign\"", "raw_code": "{% set using_event_extension = var('iterable__using_event_extension', True) %}\n\nwith events as (\n\n select *\n from {{ ref('iterable__events') }}\n\n), pivot_out_events as (\n\n-- this will be at the user-campaign-experiment variation level\n-- if experiment_id is null, the user-campaign interactions happened outside of an experiment\n-- if campaign_id is null, the user interactions are organic\n select\n source_relation,\n _fivetran_user_id,\n unique_user_key,\n user_id,\n campaign_id,\n\n {{ \"experiment_id,\" if using_event_extension }}\n\n email as user_email,\n user_full_name,\n case when campaign_id is null then 'organic' else campaign_name end as campaign_name,\n template_id,\n template_name,\n\n recurring_campaign_id,\n recurring_campaign_name,\n\n min(created_at) as first_event_at,\n max(created_at) as last_event_at,\n min(case when event_name in ('emailOpen', 'emailClick', 'pushOpen') then created_at end) as first_open_or_click_event_at\n\n\n -- count up the number of instances of each metric\n -- `iterable__event_metrics` is set by default to all events brought in by fivetran+iterable\n -- https://fivetran.com/docs/applications/iterable#schemanotes\n {% for em in var('iterable__event_metrics') %}\n , sum(case when lower(event_name) = '{{ em | lower }}' then 1 else 0 end)\n as {{ 'total_' ~ em | replace(' ', '_') | replace('(', '') | replace(')', '') | lower }}\n {% endfor %}\n\n from events\n\n {{ dbt_utils.group_by(n=13 if using_event_extension else 12 ) }}\n\n), add_surrogate_key as (\n\n {% set surrogate_key_fields = ['source_relation', 'unique_user_key', 'campaign_id'] %}\n {% do surrogate_key_fields.append('experiment_id') if var('iterable__using_event_extension', True) %}\n\n select \n *,\n {{ dbt_utils.generate_surrogate_key(surrogate_key_fields) }} as unique_user_campaign_id\n\n from pivot_out_events\n)\n\nselect *\nfrom add_surrogate_key", "doc_blocks": [], "language": "sql", "refs": [{"name": "iterable__events", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt_utils.group_by", "macro.dbt_utils.generate_surrogate_key"], "nodes": ["model.iterable.iterable__events"]}, "compiled_path": "target/compiled/iterable/models/iterable__user_campaign.sql", "compiled": true, "compiled_code": "\n\nwith events as (\n\n select *\n from \"postgres\".\"public_iterable_dev\".\"iterable__events\"\n\n), pivot_out_events as (\n\n-- this will be at the user-campaign-experiment variation level\n-- if experiment_id is null, the user-campaign interactions happened outside of an experiment\n-- if campaign_id is null, the user interactions are organic\n select\n source_relation,\n _fivetran_user_id,\n unique_user_key,\n user_id,\n campaign_id,\n\n experiment_id,\n\n email as user_email,\n user_full_name,\n case when campaign_id is null then 'organic' else campaign_name end as campaign_name,\n template_id,\n template_name,\n\n recurring_campaign_id,\n recurring_campaign_name,\n\n min(created_at) as first_event_at,\n max(created_at) as last_event_at,\n min(case when event_name in ('emailOpen', 'emailClick', 'pushOpen') then created_at end) as first_open_or_click_event_at\n\n\n -- count up the number of instances of each metric\n -- `iterable__event_metrics` is set by default to all events brought in by fivetran+iterable\n -- https://fivetran.com/docs/applications/iterable#schemanotes\n \n , sum(case when lower(event_name) = 'emailclick' then 1 else 0 end)\n as total_emailclick\n \n , sum(case when lower(event_name) = 'emailunsubscribe' then 1 else 0 end)\n as total_emailunsubscribe\n \n , sum(case when lower(event_name) = 'emailcomplaint' then 1 else 0 end)\n as total_emailcomplaint\n \n , sum(case when lower(event_name) = 'customevent' then 1 else 0 end)\n as total_customevent\n \n , sum(case when lower(event_name) = 'emailsubscribe' then 1 else 0 end)\n as total_emailsubscribe\n \n , sum(case when lower(event_name) = 'emailopen' then 1 else 0 end)\n as total_emailopen\n \n , sum(case when lower(event_name) = 'pushsend' then 1 else 0 end)\n as total_pushsend\n \n , sum(case when lower(event_name) = 'smsbounce' then 1 else 0 end)\n as total_smsbounce\n \n , sum(case when lower(event_name) = 'pushbounce' then 1 else 0 end)\n as total_pushbounce\n \n , sum(case when lower(event_name) = 'inappsendskip' then 1 else 0 end)\n as total_inappsendskip\n \n , sum(case when lower(event_name) = 'smssend' then 1 else 0 end)\n as total_smssend\n \n , sum(case when lower(event_name) = 'inappsend' then 1 else 0 end)\n as total_inappsend\n \n , sum(case when lower(event_name) = 'pushopen' then 1 else 0 end)\n as total_pushopen\n \n , sum(case when lower(event_name) = 'emailsend' then 1 else 0 end)\n as total_emailsend\n \n , sum(case when lower(event_name) = 'pushsendskip' then 1 else 0 end)\n as total_pushsendskip\n \n , sum(case when lower(event_name) = 'inappopen' then 1 else 0 end)\n as total_inappopen\n \n , sum(case when lower(event_name) = 'emailsendskip' then 1 else 0 end)\n as total_emailsendskip\n \n , sum(case when lower(event_name) = 'emailbounce' then 1 else 0 end)\n as total_emailbounce\n \n , sum(case when lower(event_name) = 'inappclick' then 1 else 0 end)\n as total_inappclick\n \n , sum(case when lower(event_name) = 'pushuninstall' then 1 else 0 end)\n as total_pushuninstall\n \n\n from events\n\n group by 1,2,3,4,5,6,7,8,9,10,11,12,13\n\n), add_surrogate_key as (\n\n \n \n\n select \n *,\n md5(cast(coalesce(cast(source_relation as TEXT), '_dbt_utils_surrogate_key_null_') || '-' || coalesce(cast(unique_user_key as TEXT), '_dbt_utils_surrogate_key_null_') || '-' || coalesce(cast(campaign_id as TEXT), '_dbt_utils_surrogate_key_null_') || '-' || coalesce(cast(experiment_id as TEXT), '_dbt_utils_surrogate_key_null_') as TEXT)) as unique_user_campaign_id\n\n from pivot_out_events\n)\n\nselect *\nfrom add_surrogate_key", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.iterable__user_unsubscriptions": {"database": "postgres", "schema": "public_iterable_dev", "name": "iterable__user_unsubscriptions", "resource_type": "model", "package_name": "iterable", "path": "iterable__user_unsubscriptions.sql", "original_file_path": "models/iterable__user_unsubscriptions.sql", "unique_id": "model.iterable.iterable__user_unsubscriptions", "fqn": ["iterable", "iterable__user_unsubscriptions"], "alias": "iterable__user_unsubscriptions", "checksum": {"name": "sha256", "checksum": "9ffdcfb7996a2147cd7739fc5ac7a1bd2e0db91e0ffc76d1458f53046fc4598f"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "table", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "Table that generates the total channel and message types a user has chosen to unsubscribe.", "columns": {"source_relation": {"name": "source_relation", "description": "Identifies the record's source.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": ["doc.iterable.source_relation"]}, "_fivetran_user_id": {"name": "_fivetran_user_id", "description": "A Fivetran-created unique identifier for the new Iterable schema in Aug 2023, for users, derived from hashing user_id and/or email, depending on project type.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_user_key": {"name": "unique_user_key", "description": "The unique identifier of the user. With the new schema (Aug 2023), it is the _fivetran_user_id. This is a hash of user_id and/or email, depending on project type. If using the old schema, it is email.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "channel_id": {"name": "channel_id", "description": "Unique identifier of the channel which the user is unsubscribed", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "message_type_id": {"name": "message_type_id", "description": "Unique identifier of the message type which the user is unsubscribed", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "channel_name": {"name": "channel_name", "description": "The name of the channel which the user is unsubscribed", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "message_type_name": {"name": "message_type_name", "description": "The name of the message type which the user is unsubscribed", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "channel_type": {"name": "channel_type", "description": "The channel type which the user is unsubscribed", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "message_medium": {"name": "message_medium", "description": "The medium type the message was provided which the user is unsubscribed", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "updated_at": {"name": "updated_at", "description": "Timestamp of when the user unsubscribed from the channel or message type", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "is_unsubscribed_channel_wide": {"name": "is_unsubscribed_channel_wide", "description": "Boolean indicating if the user unsubscribed at the channel level (i.e. unsubscribed to all message types) or if they unsubscribed from only an individual message type.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "iterable://models/iterable.yml", "build_path": null, "unrendered_config": {"materialized": "table", "schema": "iterable_{{ var('directed_schema','dev') }}", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789503446.3244345, "relation_name": "\"postgres\".\"public_iterable_dev\".\"iterable__user_unsubscriptions\"", "raw_code": "{% set using_user_unsubscribed_message_type = var('iterable__using_user_unsubscribed_message_type', True) %}\n\nwith message_type_channel as (\n\n select *\n from {{ ref('int_iterable__message_type_channel') }}\n\n), user_unsubscribed_channel as (\n\n select\n *\n from {{ ref('stg_iterable__user_unsubscribed_channel') }}\n where latest_batch_index = 1\n\n{% if using_user_unsubscribed_message_type %}\n), user_unsubscribed_message_type as (\n\n select\n *\n from {{ ref('stg_iterable__user_unsub_message_type') }}\n where latest_batch_index = 1\n\n{% endif %}\n\n), combine as (\n\n select\n source_relation,\n _fivetran_user_id,\n unique_user_key,\n channel_id,\n cast(null as {{ dbt.type_string() }}) as message_type_id,\n updated_at\n from user_unsubscribed_channel\n\n{% if using_user_unsubscribed_message_type %}\n\n union all\n\n select\n source_relation,\n _fivetran_user_id,\n unique_user_key,\n cast(null as {{ dbt.type_string() }}) as channel_id,\n message_type_id,\n updated_at\n from user_unsubscribed_message_type\n{% endif %}\n\n), final as (\n\n select\n combine.source_relation,\n combine._fivetran_user_id,\n combine.unique_user_key,\n -- coalescing since message_type -> channel goes up a grain\n coalesce(combine.channel_id, message_type_channel.channel_id) as channel_id,\n coalesce(combine.message_type_id, message_type_channel.message_type_id) as message_type_id,\n combine.updated_at,\n message_type_channel.channel_name,\n message_type_channel.message_type_name,\n message_type_channel.channel_type,\n message_type_channel.message_medium,\n case when combine.channel_id is not null then true else false end as is_unsubscribed_channel_wide\n\n from combine\n\n -- unsubscribing from an entire channel unsubscribes a user from all message types in that channel\n join message_type_channel\n on combine.source_relation = message_type_channel.source_relation\n and (combine.channel_id = message_type_channel.channel_id\n or combine.message_type_id = message_type_channel.message_type_id)\n)\n\nselect *\nfrom final", "doc_blocks": [], "language": "sql", "refs": [{"name": "int_iterable__message_type_channel", "package": null, "version": null}, {"name": "stg_iterable__user_unsubscribed_channel", "package": null, "version": null}, {"name": "stg_iterable__user_unsub_message_type", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.type_string"], "nodes": ["model.iterable.int_iterable__message_type_channel", "model.iterable.stg_iterable__user_unsubscribed_channel", "model.iterable.stg_iterable__user_unsub_message_type"]}, "compiled_path": "target/compiled/iterable/models/iterable__user_unsubscriptions.sql", "compiled": true, "compiled_code": "\n\nwith message_type_channel as (\n\n select *\n from \"postgres\".\"public_iterable_dev\".\"int_iterable__message_type_channel\"\n\n), user_unsubscribed_channel as (\n\n select\n *\n from \"postgres\".\"public_iterable_dev\".\"stg_iterable__user_unsubscribed_channel\"\n where latest_batch_index = 1\n\n\n), user_unsubscribed_message_type as (\n\n select\n *\n from \"postgres\".\"public_iterable_dev\".\"stg_iterable__user_unsub_message_type\"\n where latest_batch_index = 1\n\n\n\n), combine as (\n\n select\n source_relation,\n _fivetran_user_id,\n unique_user_key,\n channel_id,\n cast(null as TEXT) as message_type_id,\n updated_at\n from user_unsubscribed_channel\n\n\n\n union all\n\n select\n source_relation,\n _fivetran_user_id,\n unique_user_key,\n cast(null as TEXT) as channel_id,\n message_type_id,\n updated_at\n from user_unsubscribed_message_type\n\n\n), final as (\n\n select\n combine.source_relation,\n combine._fivetran_user_id,\n combine.unique_user_key,\n -- coalescing since message_type -> channel goes up a grain\n coalesce(combine.channel_id, message_type_channel.channel_id) as channel_id,\n coalesce(combine.message_type_id, message_type_channel.message_type_id) as message_type_id,\n combine.updated_at,\n message_type_channel.channel_name,\n message_type_channel.message_type_name,\n message_type_channel.channel_type,\n message_type_channel.message_medium,\n case when combine.channel_id is not null then true else false end as is_unsubscribed_channel_wide\n\n from combine\n\n -- unsubscribing from an entire channel unsubscribes a user from all message types in that channel\n join message_type_channel\n on combine.source_relation = message_type_channel.source_relation\n and (combine.channel_id = message_type_channel.channel_id\n or combine.message_type_id = message_type_channel.message_type_id)\n)\n\nselect *\nfrom final", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.iterable__journeys": {"database": "postgres", "schema": "public_iterable_dev", "name": "iterable__journeys", "resource_type": "model", "package_name": "iterable", "path": "iterable__journeys.sql", "original_file_path": "models/iterable__journeys.sql", "unique_id": "model.iterable.iterable__journeys", "fqn": ["iterable", "iterable__journeys"], "alias": "iterable__journeys", "checksum": {"name": "sha256", "checksum": "cc93337c06625ef9675afae4540f52c2cb0cb78669a9a881f650742e8679380b"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "table", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "Table that provides aggregations for journeys, formerly known as workflows. Metrics are rolled up from the user/campaign grain via each campaign's journey reference. Journeys which generate no events, such as those that only split audiences or update user fields, are still included with null metrics. The grain of this table is one record per journey.\n", "columns": {"source_relation": {"name": "source_relation", "description": "Identifies the record's source.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": ["doc.iterable.source_relation"]}, "journey_id": {"name": "journey_id", "description": "Unique identifier of the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_journey_id": {"name": "unique_journey_id", "description": "Unique identifier combining journey_id and source_relation.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "journey_name": {"name": "journey_name", "description": "User defined name of the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "journey_type": {"name": "journey_type", "description": "The journey type", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "journey_description": {"name": "journey_description", "description": "Information about the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "creator_user_id": {"name": "creator_user_id", "description": "Reference to the user who created the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "is_enabled": {"name": "is_enabled", "description": "Boolean indicating if the journey is currently enabled", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "is_archived": {"name": "is_archived", "description": "Boolean indicating if the journey has been archived", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "lifetime_limit": {"name": "lifetime_limit", "description": "Maximum number of times a user may enter the journey over their lifetime", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "simultaneous_limit": {"name": "simultaneous_limit", "description": "Maximum number of times a user may be in the journey at the same time", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "start_tile_id": {"name": "start_tile_id", "description": "Reference to the tile which begins the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "trigger_event_names": {"name": "trigger_event_names", "description": "The event names which trigger a user's entry into the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "created_at": {"name": "created_at", "description": "Creation timestamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "updated_at": {"name": "updated_at", "description": "Last update timestamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "The time when a record was last updated by Fivetran.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": ["doc.iterable._fivetran_synced"]}, "count_total_campaigns": {"name": "count_total_campaigns", "description": "Count of distinct campaigns within the journey that generated events", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "count_unique_users": {"name": "count_unique_users", "description": "Count of total unique users within the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "first_event_at": {"name": "first_event_at", "description": "Timestamp of the first event generated by any campaign in the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "last_event_at": {"name": "last_event_at", "description": "Timestamp of the most recent event generated by any campaign in the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_emailclick": {"name": "total_emailclick", "description": "Total email clicks within the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_total_emailclick": {"name": "unique_total_emailclick", "description": "Count of distinct users with email clicks within the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_emailunsubscribe": {"name": "total_emailunsubscribe", "description": "Total email unsubscribe events within the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_total_emailunsubscribe": {"name": "unique_total_emailunsubscribe", "description": "Count of distinct users with email unsubscribe events within the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_emailcomplaint": {"name": "total_emailcomplaint", "description": "Total email complaints within the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_total_emailcomplaint": {"name": "unique_total_emailcomplaint", "description": "Count of distinct users with email complaints within the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_customevent": {"name": "total_customevent", "description": "Total custom events within the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_total_customevent": {"name": "unique_total_customevent", "description": "Count of distinct users with custom events within the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_emailsubscribe": {"name": "total_emailsubscribe", "description": "Total email subscribe events within the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_total_emailsubscribe": {"name": "unique_total_emailsubscribe", "description": "Count of distinct users with email subscribe events within the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_emailopen": {"name": "total_emailopen", "description": "Total email open events within the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_total_emailopen": {"name": "unique_total_emailopen", "description": "Count of distinct users with email open events within the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_pushsend": {"name": "total_pushsend", "description": "Total push send events within the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_total_pushsend": {"name": "unique_total_pushsend", "description": "Count of distinct users with push send events within the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_smsbounce": {"name": "total_smsbounce", "description": "Total sms bounce events within the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_total_smsbounce": {"name": "unique_total_smsbounce", "description": "Count of distinct users with sms bounce events within the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_pushbounce": {"name": "total_pushbounce", "description": "Total push bounce events within the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_total_pushbounce": {"name": "unique_total_pushbounce", "description": "Count of distinct users with push bounce events within the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_inappsendskip": {"name": "total_inappsendskip", "description": "Total in app send skip events within the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_total_inappsendskip": {"name": "unique_total_inappsendskip", "description": "Count of distinct users with in app send skip events within the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_smssend": {"name": "total_smssend", "description": "Total sms send events within the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_total_smssend": {"name": "unique_total_smssend", "description": "Count of distinct users with sms send events within the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_inappsend": {"name": "total_inappsend", "description": "Total in app send events within the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_total_inappsend": {"name": "unique_total_inappsend", "description": "Count of distinct users with in app send events within the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_pushopen": {"name": "total_pushopen", "description": "Total push open events within the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_total_pushopen": {"name": "unique_total_pushopen", "description": "Count of distinct users with push open events within the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_emailsend": {"name": "total_emailsend", "description": "Total email send events within the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_total_emailsend": {"name": "unique_total_emailsend", "description": "Count of distinct users with email send events within the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_pushsendskip": {"name": "total_pushsendskip", "description": "Total push send skip events within the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_total_pushsendskip": {"name": "unique_total_pushsendskip", "description": "Count of distinct users with push send skip events within the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_inappopen": {"name": "total_inappopen", "description": "Total in app open events within the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_total_inappopen": {"name": "unique_total_inappopen", "description": "Count of distinct users with in app open events within the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_emailsendskip": {"name": "total_emailsendskip", "description": "Total email send skip events within the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_total_emailsendskip": {"name": "unique_total_emailsendskip", "description": "Count of distinct users with email send skip events within the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_emailbounce": {"name": "total_emailbounce", "description": "Total email bounce events within the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_total_emailbounce": {"name": "unique_total_emailbounce", "description": "Count of distinct users with email bounce events within the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_inappclick": {"name": "total_inappclick", "description": "Total in app click events within the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_total_inappclick": {"name": "unique_total_inappclick", "description": "Count of distinct users with in app click events within the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_pushuninstall": {"name": "total_pushuninstall", "description": "Total push uninstall events within the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_total_pushuninstall": {"name": "unique_total_pushuninstall", "description": "Count of distinct users with push uninstall events within the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "iterable://models/iterable.yml", "build_path": null, "unrendered_config": {"materialized": "table", "schema": "iterable_{{ var('directed_schema','dev') }}", "enabled": "var('iterable__using_journey', True)", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789503446.3151095, "relation_name": "\"postgres\".\"public_iterable_dev\".\"iterable__journeys\"", "raw_code": "{{ config(enabled=var('iterable__using_journey', True)) }}\n\nwith journey as (\n\n select *\n from {{ ref('stg_iterable__journey') }}\n\n), journey_metrics as (\n\n select *\n from {{ ref('int_iterable__journey_event_metrics') }}\n\n), journey_join as (\n\n {% set exclude_fields = ['source_relation', 'journey_id'] %} -- these are in journey\n\n -- left join so journeys that generate no events, such as audience-splitting or\n -- field-update journeys, are still reported with null metrics\n select\n journey.*,\n {{ dbt_utils.star(from=ref('int_iterable__journey_event_metrics'), except=exclude_fields, relation_alias=\"journey_metrics\") }}\n\n from journey\n\n left join journey_metrics\n on journey.journey_id = journey_metrics.journey_id\n and journey.source_relation = journey_metrics.source_relation\n\n), add_surrogate_key as (\n\n {% set surrogate_key_fields = ['journey_id', 'source_relation'] %}\n\n select\n *,\n {{ dbt_utils.generate_surrogate_key(surrogate_key_fields) }} as unique_journey_id\n\n from journey_join\n)\n\nselect *\nfrom add_surrogate_key", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__journey", "package": null, "version": null}, {"name": "int_iterable__journey_event_metrics", "package": null, "version": null}, {"name": "int_iterable__journey_event_metrics", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt_utils.star", "macro.dbt_utils.generate_surrogate_key"], "nodes": ["model.iterable.stg_iterable__journey", "model.iterable.int_iterable__journey_event_metrics"]}, "compiled_path": "target/compiled/iterable/models/iterable__journeys.sql", "compiled": true, "compiled_code": "\n\nwith journey as (\n\n select *\n from \"postgres\".\"public_iterable_dev\".\"stg_iterable__journey\"\n\n), journey_metrics as (\n\n select *\n from \"postgres\".\"public_iterable_dev\".\"int_iterable__journey_event_metrics\"\n\n), journey_join as (\n\n -- these are in journey\n\n -- left join so journeys that generate no events, such as audience-splitting or\n -- field-update journeys, are still reported with null metrics\n select\n journey.*,\n journey_metrics.\"count_total_campaigns\",\n journey_metrics.\"count_unique_users\",\n journey_metrics.\"first_event_at\",\n journey_metrics.\"last_event_at\",\n journey_metrics.\"total_emailclick\",\n journey_metrics.\"unique_total_emailclick\",\n journey_metrics.\"total_emailunsubscribe\",\n journey_metrics.\"unique_total_emailunsubscribe\",\n journey_metrics.\"total_emailcomplaint\",\n journey_metrics.\"unique_total_emailcomplaint\",\n journey_metrics.\"total_customevent\",\n journey_metrics.\"unique_total_customevent\",\n journey_metrics.\"total_emailsubscribe\",\n journey_metrics.\"unique_total_emailsubscribe\",\n journey_metrics.\"total_emailopen\",\n journey_metrics.\"unique_total_emailopen\",\n journey_metrics.\"total_pushsend\",\n journey_metrics.\"unique_total_pushsend\",\n journey_metrics.\"total_smsbounce\",\n journey_metrics.\"unique_total_smsbounce\",\n journey_metrics.\"total_pushbounce\",\n journey_metrics.\"unique_total_pushbounce\",\n journey_metrics.\"total_inappsendskip\",\n journey_metrics.\"unique_total_inappsendskip\",\n journey_metrics.\"total_smssend\",\n journey_metrics.\"unique_total_smssend\",\n journey_metrics.\"total_inappsend\",\n journey_metrics.\"unique_total_inappsend\",\n journey_metrics.\"total_pushopen\",\n journey_metrics.\"unique_total_pushopen\",\n journey_metrics.\"total_emailsend\",\n journey_metrics.\"unique_total_emailsend\",\n journey_metrics.\"total_pushsendskip\",\n journey_metrics.\"unique_total_pushsendskip\",\n journey_metrics.\"total_inappopen\",\n journey_metrics.\"unique_total_inappopen\",\n journey_metrics.\"total_emailsendskip\",\n journey_metrics.\"unique_total_emailsendskip\",\n journey_metrics.\"total_emailbounce\",\n journey_metrics.\"unique_total_emailbounce\",\n journey_metrics.\"total_inappclick\",\n journey_metrics.\"unique_total_inappclick\",\n journey_metrics.\"total_pushuninstall\",\n journey_metrics.\"unique_total_pushuninstall\"\n\n from journey\n\n left join journey_metrics\n on journey.journey_id = journey_metrics.journey_id\n and journey.source_relation = journey_metrics.source_relation\n\n), add_surrogate_key as (\n\n \n\n select\n *,\n md5(cast(coalesce(cast(journey_id as TEXT), '_dbt_utils_surrogate_key_null_') || '-' || coalesce(cast(source_relation as TEXT), '_dbt_utils_surrogate_key_null_') as TEXT)) as unique_journey_id\n\n from journey_join\n)\n\nselect *\nfrom add_surrogate_key", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": ["unique_journey_id"], "time_spine": null}, "model.iterable.iterable__campaigns": {"database": "postgres", "schema": "public_iterable_dev", "name": "iterable__campaigns", "resource_type": "model", "package_name": "iterable", "path": "iterable__campaigns.sql", "original_file_path": "models/iterable__campaigns.sql", "unique_id": "model.iterable.iterable__campaigns", "fqn": ["iterable", "iterable__campaigns"], "alias": "iterable__campaigns", "checksum": {"name": "sha256", "checksum": "8a06f641cc3e4a6fcf53c1ff0571db0c9b0e7212a2a2ff5ea9111e035a96b0cc"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "table", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "Table that provides aggregations for campaigns at the template and if available, the experiment grain.", "columns": {"source_relation": {"name": "source_relation", "description": "Identifies the record's source.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": ["doc.iterable.source_relation"]}, "campaign_id": {"name": "campaign_id", "description": "Unique identifier of the campaign record", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_campaign_version_id": {"name": "unique_campaign_version_id", "description": "Unique identifier combining campaign_id, template_id, source_relation, and if available, experiment_id.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "campaign_name": {"name": "campaign_name", "description": "User defined name of the campaign.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "updated_at": {"name": "updated_at", "description": "Last update timestamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "campaign_state": {"name": "campaign_state", "description": "State of the campaign. Can be Draft, Ready, Scheduled, Running, Finished, Starting, Aborted or Recurring", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "campaign_type": {"name": "campaign_type", "description": "The campaign type. Can be Blast or Triggered", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "send_size": {"name": "send_size", "description": "Size of the campaign. Number of individuals included in the campaign", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "start_at": {"name": "start_at", "description": "Start timestamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "ended_at": {"name": "ended_at", "description": "Ended timestamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "created_at": {"name": "created_at", "description": "Creation timestamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "created_by_user_id": {"name": "created_by_user_id", "description": "Reference to the user who created the campaign", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "template_id": {"name": "template_id", "description": "Reference to the campaign template", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "recurring_campaign_id": {"name": "recurring_campaign_id", "description": "Unique identifier of the recurring campaign (if applicable)", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "recurring_campaign_name": {"name": "recurring_campaign_name", "description": "Name of the recurring campaign (if applicable)", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "recurring_campaign_state": {"name": "recurring_campaign_state", "description": "State of the recurring campaign (if applicable)", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "recurring_campaign_send_size": {"name": "recurring_campaign_send_size", "description": "Size of the recurring campaign. Number of individuals included in the recurring campaign (if applicable)", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "recurring_campaign_start_at": {"name": "recurring_campaign_start_at", "description": "Timestamp of when the recurring campaign started (if applicable)", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "is_campaign_recurring": {"name": "is_campaign_recurring", "description": "Boolean indicating if the campaign is a recurring campaign", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "experiment_id": {"name": "experiment_id", "description": "Reference to the experiment used if the event is an experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "count_unique_users": {"name": "count_unique_users", "description": "Count of total unique users within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_emailclick": {"name": "total_emailclick", "description": "Total email clicks within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_total_emailclick": {"name": "unique_total_emailclick", "description": "Unique email clicks within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_emailunsubscribe": {"name": "total_emailunsubscribe", "description": "Total email unsubscribe events within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_total_emailunsubscribe": {"name": "unique_total_emailunsubscribe", "description": "Unique total email unsubscribe events within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_emailcomplaint": {"name": "total_emailcomplaint", "description": "Total email complaints within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_total_emailcomplaint": {"name": "unique_total_emailcomplaint", "description": "Unique total email complaints within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_customevent": {"name": "total_customevent", "description": "Total custom events within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_total_customevent": {"name": "unique_total_customevent", "description": "Unique total custom events within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_emailsubscribe": {"name": "total_emailsubscribe", "description": "Total email subscribe events within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_total_emailsubscribe": {"name": "unique_total_emailsubscribe", "description": "Unique total email subscribe events within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_emailopen": {"name": "total_emailopen", "description": "Total email open events within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_total_emailopen": {"name": "unique_total_emailopen", "description": "Unique total email open events within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_pushsend": {"name": "total_pushsend", "description": "Total push send event within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_total_pushsend": {"name": "unique_total_pushsend", "description": "Unique total push send events within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_smsbounce": {"name": "total_smsbounce", "description": "Total sms bounce events within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_total_smsbounce": {"name": "unique_total_smsbounce", "description": "Unique total sms bounce events within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_pushbounce": {"name": "total_pushbounce", "description": "Total push bounce events within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_total_pushbounce": {"name": "unique_total_pushbounce", "description": "Unique total push bounce events within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_inappsendskip": {"name": "total_inappsendskip", "description": "Total in app send skip events within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_total_inappsendskip": {"name": "unique_total_inappsendskip", "description": "Unique total in app send skip events within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_smssend": {"name": "total_smssend", "description": "Total sms send events within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_total_smssend": {"name": "unique_total_smssend", "description": "Unique total sms send events within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_inappsend": {"name": "total_inappsend", "description": "Total in app send events within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_total_inappsend": {"name": "unique_total_inappsend", "description": "Unique total in app send events within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_pushopen": {"name": "total_pushopen", "description": "Total push open events within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_total_pushopen": {"name": "unique_total_pushopen", "description": "Unique total push open events within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_emailsend": {"name": "total_emailsend", "description": "Total email send events within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_total_emailsend": {"name": "unique_total_emailsend", "description": "Unique total email send events within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_pushsendskip": {"name": "total_pushsendskip", "description": "Total push send skip events within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_total_pushsendskip": {"name": "unique_total_pushsendskip", "description": "Unique total push send skip events within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_inappopen": {"name": "total_inappopen", "description": "Total in app open events within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_total_inappopen": {"name": "unique_total_inappopen", "description": "Unique total in app open events within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_emailsendskip": {"name": "total_emailsendskip", "description": "Total email send skip events within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_total_emailsendskip": {"name": "unique_total_emailsendskip", "description": "Unique total email send skip events within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_emailbounce": {"name": "total_emailbounce", "description": "Total email bounce events within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_total_emailbounce": {"name": "unique_total_emailbounce", "description": "Unique total email bounce events within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_inappclick": {"name": "total_inappclick", "description": "Total in app click events within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_total_inappclick": {"name": "unique_total_inappclick", "description": "Unique total in app click events within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "total_pushuninstall": {"name": "total_pushuninstall", "description": "Total push uninstall events within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_total_pushuninstall": {"name": "unique_total_pushuninstall", "description": "Unique total push uninstall events within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "count_send_lists": {"name": "count_send_lists", "description": "Count of send lists within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "count_suppress_lists": {"name": "count_suppress_lists", "description": "Count of suppress lists within the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "labels": {"name": "labels", "description": "List of labels associated with the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "journey_id": {"name": "journey_id", "description": "Reference to the journey the campaign belongs to, if applicable", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "journey_name": {"name": "journey_name", "description": "User defined name of the journey the campaign belongs to, if applicable", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "journey_type": {"name": "journey_type", "description": "The type of the journey the campaign belongs to, if applicable", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "template_name": {"name": "template_name", "description": "Name of the template associated with the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "template_creator_user_id": {"name": "template_creator_user_id", "description": "The creator user id of the template associated with the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "message_medium": {"name": "message_medium", "description": "The medium which the message was provided", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "message_type_name": {"name": "message_type_name", "description": "The message type name associated with the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "channel_name": {"name": "channel_name", "description": "The channel name associated with the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "channel_id": {"name": "channel_id", "description": "The channel identifier associated with the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "channel_type": {"name": "channel_type", "description": "The channel type associated with the campaign/experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "iterable://models/iterable.yml", "build_path": null, "unrendered_config": {"materialized": "table", "schema": "iterable_{{ var('directed_schema','dev') }}", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789503446.2850325, "relation_name": "\"postgres\".\"public_iterable_dev\".\"iterable__campaigns\"", "raw_code": "with campaign_event_metrics as (\n\n select *\n from {{ ref('int_iterable__campaign_event_metrics') }}\n\n), campaign_list_metrics as (\n\n select\n source_relation,\n campaign_id,\n sum(case when list_activity = 'send' then 1 else 0 end) as count_send_lists,\n sum(case when list_activity = 'suppress' then 1 else 0 end) as count_suppress_lists\n\n from {{ ref('int_iterable__campaign_lists') }}\n {{ dbt_utils.group_by(n=2) }}\n\n), campaign as (\n\n select *\n from {{ ref('int_iterable__recurring_campaigns') }}\n \n{% if var('iterable__using_campaign_label_history', true) %}\n), campaign_labels as (\n\n select *\n from {{ ref('int_iterable__campaign_labels') }}\n\n{% endif %}\n\n), template as (\n -- rebringing this in (it is brought in iterable__events) in case any campaigns don't have events yet\n -- this will result in some DAG ugliness but maintains template info for non-sent campaigns\n select *\n from {{ ref('int_iterable__latest_template') }}\n\n{% if var('iterable__using_journey', true) %}\n), journey as (\n\n select *\n from {{ ref('stg_iterable__journey') }}\n\n{% endif %}\n\n), campaign_join as (\n\n {% set exclude_fields = ['source_relation', 'campaign_id', 'template_id'] %} -- these are in campaigns\n\n -- this query will be at the campaign and experiment(if available) variation grain\n select\n campaign.*,\n {{ dbt_utils.star(from=ref('int_iterable__campaign_event_metrics'), except=exclude_fields, relation_alias=\"campaign_event_metrics\") }}\n , \n campaign_list_metrics.count_send_lists,\n campaign_list_metrics.count_suppress_lists,\n {% if var('iterable__using_campaign_label_history', true) %}\n campaign_labels.labels,\n {% endif %}\n {% if var('iterable__using_journey', true) %}\n journey.journey_name,\n journey.journey_type,\n {% endif %}\n template.template_name,\n template.creator_user_id as template_creator_user_id,\n template.message_medium,\n template.message_type_name,\n template.channel_name,\n template.channel_id,\n template.channel_type\n\n from campaign\n left join campaign_event_metrics\n on campaign.campaign_id = campaign_event_metrics.campaign_id\n and campaign.template_id = campaign_event_metrics.template_id\n and campaign.source_relation = campaign_event_metrics.source_relation\n left join campaign_list_metrics\n on campaign.campaign_id = campaign_list_metrics.campaign_id\n and campaign.source_relation = campaign_list_metrics.source_relation\n\n {% if var('iterable__using_campaign_label_history', true) %}\n left join campaign_labels\n on campaign.campaign_id = campaign_labels.campaign_id\n and campaign.source_relation = campaign_labels.source_relation\n {% endif %}\n\n left join template\n on campaign.template_id = template.template_id\n and campaign.source_relation = template.source_relation\n\n {% if var('iterable__using_journey', true) %}\n left join journey\n on campaign.journey_id = journey.journey_id\n and campaign.source_relation = journey.source_relation\n {% endif %}\n\n), add_surrogate_key as (\n\n {% set surrogate_key_fields = ['campaign_id', 'template_id', 'source_relation'] %}\n {% do surrogate_key_fields.append('experiment_id') if var('iterable__using_event_extension', True) %}\n\n select \n *,\n {{ dbt_utils.generate_surrogate_key(surrogate_key_fields) }} as unique_campaign_version_id\n\n from campaign_join\n)\n\nselect *\nfrom add_surrogate_key", "doc_blocks": [], "language": "sql", "refs": [{"name": "int_iterable__campaign_event_metrics", "package": null, "version": null}, {"name": "int_iterable__campaign_lists", "package": null, "version": null}, {"name": "int_iterable__recurring_campaigns", "package": null, "version": null}, {"name": "int_iterable__campaign_labels", "package": null, "version": null}, {"name": "int_iterable__latest_template", "package": null, "version": null}, {"name": "stg_iterable__journey", "package": null, "version": null}, {"name": "int_iterable__campaign_event_metrics", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt_utils.group_by", "macro.dbt_utils.star", "macro.dbt_utils.generate_surrogate_key"], "nodes": ["model.iterable.int_iterable__campaign_event_metrics", "model.iterable.int_iterable__campaign_lists", "model.iterable.int_iterable__recurring_campaigns", "model.iterable.int_iterable__campaign_labels", "model.iterable.int_iterable__latest_template", "model.iterable.stg_iterable__journey"]}, "compiled_path": "target/compiled/iterable/models/iterable__campaigns.sql", "compiled": true, "compiled_code": "with campaign_event_metrics as (\n\n select *\n from \"postgres\".\"public_iterable_dev\".\"int_iterable__campaign_event_metrics\"\n\n), campaign_list_metrics as (\n\n select\n source_relation,\n campaign_id,\n sum(case when list_activity = 'send' then 1 else 0 end) as count_send_lists,\n sum(case when list_activity = 'suppress' then 1 else 0 end) as count_suppress_lists\n\n from \"postgres\".\"public_iterable_dev\".\"int_iterable__campaign_lists\"\n group by 1,2\n\n), campaign as (\n\n select *\n from \"postgres\".\"public_iterable_dev\".\"int_iterable__recurring_campaigns\"\n \n\n), campaign_labels as (\n\n select *\n from \"postgres\".\"public_iterable_dev\".\"int_iterable__campaign_labels\"\n\n\n\n), template as (\n -- rebringing this in (it is brought in iterable__events) in case any campaigns don't have events yet\n -- this will result in some DAG ugliness but maintains template info for non-sent campaigns\n select *\n from \"postgres\".\"public_iterable_dev\".\"int_iterable__latest_template\"\n\n\n), journey as (\n\n select *\n from \"postgres\".\"public_iterable_dev\".\"stg_iterable__journey\"\n\n\n\n), campaign_join as (\n\n -- these are in campaigns\n\n -- this query will be at the campaign and experiment(if available) variation grain\n select\n campaign.*,\n campaign_event_metrics.\"experiment_id\",\n campaign_event_metrics.\"count_unique_users\",\n campaign_event_metrics.\"total_emailclick\",\n campaign_event_metrics.\"unique_total_emailclick\",\n campaign_event_metrics.\"total_emailunsubscribe\",\n campaign_event_metrics.\"unique_total_emailunsubscribe\",\n campaign_event_metrics.\"total_emailcomplaint\",\n campaign_event_metrics.\"unique_total_emailcomplaint\",\n campaign_event_metrics.\"total_customevent\",\n campaign_event_metrics.\"unique_total_customevent\",\n campaign_event_metrics.\"total_emailsubscribe\",\n campaign_event_metrics.\"unique_total_emailsubscribe\",\n campaign_event_metrics.\"total_emailopen\",\n campaign_event_metrics.\"unique_total_emailopen\",\n campaign_event_metrics.\"total_pushsend\",\n campaign_event_metrics.\"unique_total_pushsend\",\n campaign_event_metrics.\"total_smsbounce\",\n campaign_event_metrics.\"unique_total_smsbounce\",\n campaign_event_metrics.\"total_pushbounce\",\n campaign_event_metrics.\"unique_total_pushbounce\",\n campaign_event_metrics.\"total_inappsendskip\",\n campaign_event_metrics.\"unique_total_inappsendskip\",\n campaign_event_metrics.\"total_smssend\",\n campaign_event_metrics.\"unique_total_smssend\",\n campaign_event_metrics.\"total_inappsend\",\n campaign_event_metrics.\"unique_total_inappsend\",\n campaign_event_metrics.\"total_pushopen\",\n campaign_event_metrics.\"unique_total_pushopen\",\n campaign_event_metrics.\"total_emailsend\",\n campaign_event_metrics.\"unique_total_emailsend\",\n campaign_event_metrics.\"total_pushsendskip\",\n campaign_event_metrics.\"unique_total_pushsendskip\",\n campaign_event_metrics.\"total_inappopen\",\n campaign_event_metrics.\"unique_total_inappopen\",\n campaign_event_metrics.\"total_emailsendskip\",\n campaign_event_metrics.\"unique_total_emailsendskip\",\n campaign_event_metrics.\"total_emailbounce\",\n campaign_event_metrics.\"unique_total_emailbounce\",\n campaign_event_metrics.\"total_inappclick\",\n campaign_event_metrics.\"unique_total_inappclick\",\n campaign_event_metrics.\"total_pushuninstall\",\n campaign_event_metrics.\"unique_total_pushuninstall\"\n , \n campaign_list_metrics.count_send_lists,\n campaign_list_metrics.count_suppress_lists,\n \n campaign_labels.labels,\n \n \n journey.journey_name,\n journey.journey_type,\n \n template.template_name,\n template.creator_user_id as template_creator_user_id,\n template.message_medium,\n template.message_type_name,\n template.channel_name,\n template.channel_id,\n template.channel_type\n\n from campaign\n left join campaign_event_metrics\n on campaign.campaign_id = campaign_event_metrics.campaign_id\n and campaign.template_id = campaign_event_metrics.template_id\n and campaign.source_relation = campaign_event_metrics.source_relation\n left join campaign_list_metrics\n on campaign.campaign_id = campaign_list_metrics.campaign_id\n and campaign.source_relation = campaign_list_metrics.source_relation\n\n \n left join campaign_labels\n on campaign.campaign_id = campaign_labels.campaign_id\n and campaign.source_relation = campaign_labels.source_relation\n \n\n left join template\n on campaign.template_id = template.template_id\n and campaign.source_relation = template.source_relation\n\n \n left join journey\n on campaign.journey_id = journey.journey_id\n and campaign.source_relation = journey.source_relation\n \n\n), add_surrogate_key as (\n\n \n \n\n select \n *,\n md5(cast(coalesce(cast(campaign_id as TEXT), '_dbt_utils_surrogate_key_null_') || '-' || coalesce(cast(template_id as TEXT), '_dbt_utils_surrogate_key_null_') || '-' || coalesce(cast(source_relation as TEXT), '_dbt_utils_surrogate_key_null_') || '-' || coalesce(cast(experiment_id as TEXT), '_dbt_utils_surrogate_key_null_') as TEXT)) as unique_campaign_version_id\n\n from campaign_join\n)\n\nselect *\nfrom add_surrogate_key", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.int_iterable__campaign_labels": {"database": "postgres", "schema": "public_iterable_dev", "name": "int_iterable__campaign_labels", "resource_type": "model", "package_name": "iterable", "path": "intermediate/int_iterable__campaign_labels.sql", "original_file_path": "models/intermediate/int_iterable__campaign_labels.sql", "unique_id": "model.iterable.int_iterable__campaign_labels", "fqn": ["iterable", "intermediate", "int_iterable__campaign_labels"], "alias": "int_iterable__campaign_labels", "checksum": {"name": "sha256", "checksum": "64ae8d410bd6673399326348a650a7facc7b6631aa34fbb01a1598cb96c7d012"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "Table that provides the distinct string aggregation of labels for each campaign.", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "iterable://models/intermediate/int_iterable.yml", "build_path": null, "unrendered_config": {"materialized": "view", "schema": "iterable_{{ var('directed_schema','dev') }}", "enabled": "var('iterable__using_campaign_label_history', True)", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789503446.46725, "relation_name": "\"postgres\".\"public_iterable_dev\".\"int_iterable__campaign_labels\"", "raw_code": "{{ config(enabled=var('iterable__using_campaign_label_history', True)) }}\n\nwith campaign_label_history as (\n\n select *\n from {{ ref('stg_iterable__campaign_label_history') }}\n\n), order_campaign_labels as (\n\n select \n *,\n rank() over(partition by campaign_id{{ fivetran_utils.partition_by_source_relation(package_name='iterable') }} order by updated_at desc) as latest_label_batch_index\n\n from campaign_label_history\n\n), latest_labels as (\n\n select *\n from order_campaign_labels\n where latest_label_batch_index = 1\n\n), aggregate_labels as (\n\n select\n source_relation,\n campaign_id,\n {{ fivetran_utils.string_agg('distinct label', \"', '\") }} as labels\n\n from latest_labels\n {{ dbt_utils.group_by(n=2) }}\n)\n\nselect * from aggregate_labels", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__campaign_label_history", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.fivetran_utils.partition_by_source_relation", "macro.fivetran_utils.string_agg", "macro.dbt_utils.group_by"], "nodes": ["model.iterable.stg_iterable__campaign_label_history"]}, "compiled_path": "target/compiled/iterable/models/intermediate/int_iterable__campaign_labels.sql", "compiled": true, "compiled_code": "\n\nwith campaign_label_history as (\n\n select *\n from \"postgres\".\"public_iterable_dev\".\"stg_iterable__campaign_label_history\"\n\n), order_campaign_labels as (\n\n select \n *,\n rank() over(partition by campaign_id order by updated_at desc) as latest_label_batch_index\n\n from campaign_label_history\n\n), latest_labels as (\n\n select *\n from order_campaign_labels\n where latest_label_batch_index = 1\n\n), aggregate_labels as (\n\n select\n source_relation,\n campaign_id,\n \n string_agg(distinct label, ', ')\n\n as labels\n\n from latest_labels\n group by 1,2\n)\n\nselect * from aggregate_labels", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.int_iterable__journey_event_metrics": {"database": "postgres", "schema": "public_iterable_dev", "name": "int_iterable__journey_event_metrics", "resource_type": "model", "package_name": "iterable", "path": "intermediate/int_iterable__journey_event_metrics.sql", "original_file_path": "models/intermediate/int_iterable__journey_event_metrics.sql", "unique_id": "model.iterable.int_iterable__journey_event_metrics", "fqn": ["iterable", "intermediate", "int_iterable__journey_event_metrics"], "alias": "int_iterable__journey_event_metrics", "checksum": {"name": "sha256", "checksum": "bfde0156d4c1044ca7bc2993a11f34370dba3692b6d75b001ed4a9ba799b38b4"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "Table that generates relevant total and unique journey level aggregations, rolled up from the user/campaign grain via the campaign's journey reference.", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "iterable://models/intermediate/int_iterable.yml", "build_path": null, "unrendered_config": {"materialized": "view", "schema": "iterable_{{ var('directed_schema','dev') }}", "enabled": "var('iterable__using_journey', True)", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789503446.4682705, "relation_name": "\"postgres\".\"public_iterable_dev\".\"int_iterable__journey_event_metrics\"", "raw_code": "{{ config(enabled=var('iterable__using_journey', True)) }}\n\nwith user_campaign as (\n select *\n from {{ ref('iterable__user_campaign') }}\n\n), campaign as (\n\n select\n source_relation,\n campaign_id,\n journey_id\n\n from {{ ref('int_iterable__recurring_campaigns') }}\n where journey_id is not null\n\n), journey_event_metrics as (\n{%- set user_campaign_columns = adapter.get_columns_in_relation(ref('iterable__user_campaign')) %}\n{%- set non_agg_columns = ['source_relation', 'unique_user_key', 'user_id', '_fivetran_user_id',\n 'user_email', 'user_full_name', 'campaign_id', 'campaign_name', 'recurring_campaign_id',\n 'recurring_campaign_name', 'first_event_at', 'last_event_at', 'template_id', 'template_name',\n 'experiment_id', 'unique_user_campaign_id', 'first_open_or_click_event_at'\n ] %}\n\n select\n campaign.source_relation,\n campaign.journey_id,\n count(distinct user_campaign.campaign_id) as count_total_campaigns,\n count(distinct user_campaign.unique_user_key) as count_unique_users,\n min(user_campaign.first_event_at) as first_event_at,\n max(user_campaign.last_event_at) as last_event_at\n {% for col in user_campaign_columns if col.name|lower not in non_agg_columns %}\n , sum(user_campaign.{{ col.name }}) as {{ col.name }}\n -- counts distinct users; campaign_event_metrics counts distinct emails\n , count(distinct case when user_campaign.{{ col.name }} > 0 then user_campaign.unique_user_key else null end) as unique_{{ col.name }}\n {% endfor %}\n\n from user_campaign\n\n inner join campaign\n on user_campaign.campaign_id = campaign.campaign_id\n and user_campaign.source_relation = campaign.source_relation\n\n {{ dbt_utils.group_by(n=2) }}\n)\n\nselect *\nfrom journey_event_metrics", "doc_blocks": [], "language": "sql", "refs": [{"name": "iterable__user_campaign", "package": null, "version": null}, {"name": "int_iterable__recurring_campaigns", "package": null, "version": null}, {"name": "iterable__user_campaign", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt_utils.group_by"], "nodes": ["model.iterable.iterable__user_campaign", "model.iterable.int_iterable__recurring_campaigns"]}, "compiled_path": "target/compiled/iterable/models/intermediate/int_iterable__journey_event_metrics.sql", "compiled": true, "compiled_code": "\n\nwith user_campaign as (\n select *\n from \"postgres\".\"public_iterable_dev\".\"iterable__user_campaign\"\n\n), campaign as (\n\n select\n source_relation,\n campaign_id,\n journey_id\n\n from \"postgres\".\"public_iterable_dev\".\"int_iterable__recurring_campaigns\"\n where journey_id is not null\n\n), journey_event_metrics as (\n\n select\n campaign.source_relation,\n campaign.journey_id,\n count(distinct user_campaign.campaign_id) as count_total_campaigns,\n count(distinct user_campaign.unique_user_key) as count_unique_users,\n min(user_campaign.first_event_at) as first_event_at,\n max(user_campaign.last_event_at) as last_event_at\n \n , sum(user_campaign.total_emailclick) as total_emailclick\n -- counts distinct users; campaign_event_metrics counts distinct emails\n , count(distinct case when user_campaign.total_emailclick > 0 then user_campaign.unique_user_key else null end) as unique_total_emailclick\n \n , sum(user_campaign.total_emailunsubscribe) as total_emailunsubscribe\n -- counts distinct users; campaign_event_metrics counts distinct emails\n , count(distinct case when user_campaign.total_emailunsubscribe > 0 then user_campaign.unique_user_key else null end) as unique_total_emailunsubscribe\n \n , sum(user_campaign.total_emailcomplaint) as total_emailcomplaint\n -- counts distinct users; campaign_event_metrics counts distinct emails\n , count(distinct case when user_campaign.total_emailcomplaint > 0 then user_campaign.unique_user_key else null end) as unique_total_emailcomplaint\n \n , sum(user_campaign.total_customevent) as total_customevent\n -- counts distinct users; campaign_event_metrics counts distinct emails\n , count(distinct case when user_campaign.total_customevent > 0 then user_campaign.unique_user_key else null end) as unique_total_customevent\n \n , sum(user_campaign.total_emailsubscribe) as total_emailsubscribe\n -- counts distinct users; campaign_event_metrics counts distinct emails\n , count(distinct case when user_campaign.total_emailsubscribe > 0 then user_campaign.unique_user_key else null end) as unique_total_emailsubscribe\n \n , sum(user_campaign.total_emailopen) as total_emailopen\n -- counts distinct users; campaign_event_metrics counts distinct emails\n , count(distinct case when user_campaign.total_emailopen > 0 then user_campaign.unique_user_key else null end) as unique_total_emailopen\n \n , sum(user_campaign.total_pushsend) as total_pushsend\n -- counts distinct users; campaign_event_metrics counts distinct emails\n , count(distinct case when user_campaign.total_pushsend > 0 then user_campaign.unique_user_key else null end) as unique_total_pushsend\n \n , sum(user_campaign.total_smsbounce) as total_smsbounce\n -- counts distinct users; campaign_event_metrics counts distinct emails\n , count(distinct case when user_campaign.total_smsbounce > 0 then user_campaign.unique_user_key else null end) as unique_total_smsbounce\n \n , sum(user_campaign.total_pushbounce) as total_pushbounce\n -- counts distinct users; campaign_event_metrics counts distinct emails\n , count(distinct case when user_campaign.total_pushbounce > 0 then user_campaign.unique_user_key else null end) as unique_total_pushbounce\n \n , sum(user_campaign.total_inappsendskip) as total_inappsendskip\n -- counts distinct users; campaign_event_metrics counts distinct emails\n , count(distinct case when user_campaign.total_inappsendskip > 0 then user_campaign.unique_user_key else null end) as unique_total_inappsendskip\n \n , sum(user_campaign.total_smssend) as total_smssend\n -- counts distinct users; campaign_event_metrics counts distinct emails\n , count(distinct case when user_campaign.total_smssend > 0 then user_campaign.unique_user_key else null end) as unique_total_smssend\n \n , sum(user_campaign.total_inappsend) as total_inappsend\n -- counts distinct users; campaign_event_metrics counts distinct emails\n , count(distinct case when user_campaign.total_inappsend > 0 then user_campaign.unique_user_key else null end) as unique_total_inappsend\n \n , sum(user_campaign.total_pushopen) as total_pushopen\n -- counts distinct users; campaign_event_metrics counts distinct emails\n , count(distinct case when user_campaign.total_pushopen > 0 then user_campaign.unique_user_key else null end) as unique_total_pushopen\n \n , sum(user_campaign.total_emailsend) as total_emailsend\n -- counts distinct users; campaign_event_metrics counts distinct emails\n , count(distinct case when user_campaign.total_emailsend > 0 then user_campaign.unique_user_key else null end) as unique_total_emailsend\n \n , sum(user_campaign.total_pushsendskip) as total_pushsendskip\n -- counts distinct users; campaign_event_metrics counts distinct emails\n , count(distinct case when user_campaign.total_pushsendskip > 0 then user_campaign.unique_user_key else null end) as unique_total_pushsendskip\n \n , sum(user_campaign.total_inappopen) as total_inappopen\n -- counts distinct users; campaign_event_metrics counts distinct emails\n , count(distinct case when user_campaign.total_inappopen > 0 then user_campaign.unique_user_key else null end) as unique_total_inappopen\n \n , sum(user_campaign.total_emailsendskip) as total_emailsendskip\n -- counts distinct users; campaign_event_metrics counts distinct emails\n , count(distinct case when user_campaign.total_emailsendskip > 0 then user_campaign.unique_user_key else null end) as unique_total_emailsendskip\n \n , sum(user_campaign.total_emailbounce) as total_emailbounce\n -- counts distinct users; campaign_event_metrics counts distinct emails\n , count(distinct case when user_campaign.total_emailbounce > 0 then user_campaign.unique_user_key else null end) as unique_total_emailbounce\n \n , sum(user_campaign.total_inappclick) as total_inappclick\n -- counts distinct users; campaign_event_metrics counts distinct emails\n , count(distinct case when user_campaign.total_inappclick > 0 then user_campaign.unique_user_key else null end) as unique_total_inappclick\n \n , sum(user_campaign.total_pushuninstall) as total_pushuninstall\n -- counts distinct users; campaign_event_metrics counts distinct emails\n , count(distinct case when user_campaign.total_pushuninstall > 0 then user_campaign.unique_user_key else null end) as unique_total_pushuninstall\n \n\n from user_campaign\n\n inner join campaign\n on user_campaign.campaign_id = campaign.campaign_id\n and user_campaign.source_relation = campaign.source_relation\n\n group by 1,2\n)\n\nselect *\nfrom journey_event_metrics", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.int_iterable__list_user_unnest": {"database": "postgres", "schema": "public_iterable_dev", "name": "int_iterable__list_user_unnest", "resource_type": "model", "package_name": "iterable", "path": "intermediate/int_iterable__list_user_unnest.sql", "original_file_path": "models/intermediate/int_iterable__list_user_unnest.sql", "unique_id": "model.iterable.int_iterable__list_user_unnest", "fqn": ["iterable", "intermediate", "int_iterable__list_user_unnest"], "alias": "int_iterable__list_user_unnest", "checksum": {"name": "sha256", "checksum": "82ec833586106f02efef7fe24516f3323171e61f1083323e97c892f21ddfa263"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "incremental", "incremental_strategy": "delete+insert", "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": "unique_key", "on_schema_change": "fail", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}, "partition_by": {"field": "date_day", "data_type": "date"}, "file_format": "delta"}, "tags": [], "description": "Table that unnests the `email_list_id` field for each user to create a new record for each user and the unique list it was associated with at a unique update. Due to the unnesting functions varying greatly between warehouses, conditional logic is applied throughout the model to appropriately accommodate the model being ran within Redshift, Snowflake, BigQuery, and Postgres.\n", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "iterable://models/intermediate/int_iterable.yml", "build_path": null, "unrendered_config": {"materialized": "incremental", "schema": "iterable_{{ var('directed_schema','dev') }}", "unique_key": "unique_key", "incremental_strategy": "CondExpr(test=Compare(expr=Getattr(node=Name(name='target', ctx='load'), attr='type', ctx='load'), ops=[Operand(op='in', expr=Tuple(items=[Const(value='bigquery'), Const(value='spark'), Const(value='databricks')], ctx='load'))]), expr1=Const(value='insert_overwrite'), expr2=Const(value='delete+insert'))", "partition_by": "CondExpr(test=Compare(expr=Getattr(node=Name(name='target', ctx='load'), attr='type', ctx='load'), ops=[Operand(op='notin', expr=Tuple(items=[Const(value='spark'), Const(value='databricks'), Const(value='duckdb')], ctx='load'))]), expr1=Dict(items=[Pair(key=Const(value='field'), value=Const(value='date_day')), Pair(key=Const(value='data_type'), value=Const(value='date'))]), expr2=List(items=[Const(value='date_day')]))", "file_format": "delta", "on_schema_change": "fail", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789503446.470746, "relation_name": "\"postgres\".\"public_iterable_dev\".\"int_iterable__list_user_unnest\"", "raw_code": "{{ config(\n materialized='incremental',\n unique_key='unique_key',\n incremental_strategy='insert_overwrite' if target.type in ('bigquery', 'spark', 'databricks') else 'delete+insert',\n partition_by={\"field\": \"date_day\", \"data_type\": \"date\"} if target.type not in ('spark', 'databricks', 'duckdb') else ['date_day'],\n file_format='delta',\n on_schema_change='fail'\n )\n}}\n\nwith user_history as (\n\n select *\n from {{ ref('int_iterable__list_user_history') }} as user_history\n\n {% if is_incremental() %}\n {# the only rows we potentially want to overwrite are active ones #}\n where user_history.updated_at >= coalesce((select min(updated_at) from {{ this }} where is_current), '2010-01-01')\n {% endif %}\n\n{% if target.type == 'redshift' %}\n{# using PartiQL syntax to work with redshift's SUPER types #}\n), redshift_parse_email_lists as (\n\n select\n source_relation,\n _fivetran_user_id,\n unique_user_key,\n email,\n first_name,\n last_name,\n user_id,\n signup_date,\n signup_source,\n phone_number,\n updated_at,\n is_current,\n email_list_ids,\n {# let's not remove empty array-rows #}\n json_parse(case when email_list_ids = '[]' then '[\"is_null\"]' else email_list_ids end) as super_email_list_ids\n\n --The below script allows for pass through columns.\n {{ fivetran_utils.persist_pass_through_columns(pass_through_variable='iterable_user_history_pass_through_columns', identifier='user_history') }}\n\n from user_history\n\n), unnest_email_array as (\n\n select\n source_relation,\n _fivetran_user_id,\n unique_user_key,\n email,\n first_name,\n last_name,\n user_id,\n signup_date,\n signup_source,\n phone_number,\n updated_at,\n is_current,\n {# go back to strings #}\n cast(email_list_ids as {{ dbt.type_string() }}) as email_list_ids,\n cast(email_list_id as {{ dbt.type_string() }}) as email_list_id\n\n --The below script allows for pass through columns.\n {{ fivetran_utils.persist_pass_through_columns(pass_through_variable='iterable_user_history_pass_through_columns', identifier='emails') }}\n\n from redshift_parse_email_lists as emails, emails.super_email_list_ids as email_list_id\n\n{% else %}\n), unnest_email_array as (\n\n select\n source_relation,\n _fivetran_user_id,\n unique_user_key,\n email,\n first_name,\n last_name,\n user_id,\n signup_date,\n signup_source,\n phone_number,\n updated_at,\n is_current,\n email_list_ids,\n case when email_list_ids != '[]' then\n {% if target.type == 'snowflake' %}\n email_list_id.value\n {% elif target.type in ('spark','databricks') %}\n email_list_id.col\n {% else %} email_list_id {% endif %}\n else null\n end as email_list_id\n\n --The below script allows for pass through columns.\n {{ fivetran_utils.persist_pass_through_columns(pass_through_variable='iterable_user_history_pass_through_columns', identifier='user_history') }}\n\n from user_history\n\n {% if target.type == 'snowflake' %}\n cross join\n table(flatten(input => parse_json(\n case when email_list_ids = '[]' then '[\"is_null\"]' {# to not remove empty array-rows #}\n else email_list_ids end))) as email_list_id\n {% elif target.type == 'bigquery' %}\n cross join\n unnest(JSON_EXTRACT_STRING_ARRAY(\n case when email_list_ids = '[]' then '[\"is_null\"]' {# to not remove empty array-rows #}\n else email_list_ids end)) as email_list_id\n {% elif target.type in ('spark','databricks') %}\n cross join\n lateral explode_outer(from_json(\n case when email_list_ids = '[]' then '[\"is_null\"]' {# to not remove empty array-rows #}\n else email_list_ids end, 'array')) as email_list_id\n {% elif target.type == 'duckdb' %}\n cross join\n unnest(from_json(cast((\n case when email_list_ids = '[]' then '[\"is_null\"]' {# to not remove empty array-rows #}\n else email_list_ids end) as varchar), '[\"VARCHAR\"]')) as t(email_list_id)\n {% else %} {# target is postgres #}\n cross join\n json_array_elements_text(cast((\n case when email_list_ids = '[]' then '[\"is_null\"]' {# to not remove empty array-rows #}\n else email_list_ids end) as json)) as email_list_id\n {%- endif %}\n\n{%- endif -%}\n), adjust_nulls as (\n\n select\n source_relation,\n _fivetran_user_id,\n unique_user_key,\n email,\n first_name,\n last_name,\n user_id,\n signup_date,\n signup_source,\n updated_at,\n phone_number,\n is_current,\n case when email_list_ids = '[\"is_null\"]' then '[]' else email_list_ids end as email_list_ids,\n cast(NULLIF(email_list_id, 'is_null') as {{ dbt.type_int() }}) as list_id\n\n --The below script allows for pass through columns.\n {{ fivetran_utils.persist_pass_through_columns(pass_through_variable='iterable_user_history_pass_through_columns', identifier='unnest_email_array') }}\n\n from unnest_email_array\n\n), final as (\n\n select\n source_relation,\n _fivetran_user_id,\n unique_user_key,\n user_id,\n email,\n first_name,\n last_name,\n signup_date,\n signup_source,\n updated_at,\n phone_number,\n is_current,\n email_list_ids,\n list_id,\n {{ dbt_utils.generate_surrogate_key([\"source_relation\", \"unique_user_key\", \"list_id\", \"updated_at\"]) }} as unique_key,\n cast( {{ dbt.date_trunc('day', 'updated_at') }} as date) as date_day\n\n --The below script allows for pass through columns.\n {{ fivetran_utils.persist_pass_through_columns(pass_through_variable='iterable_user_history_pass_through_columns', identifier='adjust_nulls') }}\n\n from adjust_nulls\n)\n\nselect *\nfrom final", "doc_blocks": [], "language": "sql", "refs": [{"name": "int_iterable__list_user_history", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.is_incremental", "macro.fivetran_utils.persist_pass_through_columns", "macro.dbt.type_int", "macro.dbt_utils.generate_surrogate_key", "macro.dbt.date_trunc"], "nodes": ["model.iterable.int_iterable__list_user_history"]}, "compiled_path": "target/compiled/iterable/models/intermediate/int_iterable__list_user_unnest.sql", "compiled": true, "compiled_code": "\n\nwith user_history as (\n\n select *\n from \"postgres\".\"public_iterable_dev\".\"int_iterable__list_user_history\" as user_history\n\n \n \n where user_history.updated_at >= coalesce((select min(updated_at) from \"postgres\".\"public_iterable_dev\".\"int_iterable__list_user_unnest\" where is_current), '2010-01-01')\n \n\n\n), unnest_email_array as (\n\n select\n source_relation,\n _fivetran_user_id,\n unique_user_key,\n email,\n first_name,\n last_name,\n user_id,\n signup_date,\n signup_source,\n phone_number,\n updated_at,\n is_current,\n email_list_ids,\n case when email_list_ids != '[]' then\n email_list_id \n else null\n end as email_list_id\n\n --The below script allows for pass through columns.\n \n\n\n\n\n\n from user_history\n\n \n cross join\n json_array_elements_text(cast((\n case when email_list_ids = '[]' then '[\"is_null\"]' \n else email_list_ids end) as json)) as email_list_id), adjust_nulls as (\n\n select\n source_relation,\n _fivetran_user_id,\n unique_user_key,\n email,\n first_name,\n last_name,\n user_id,\n signup_date,\n signup_source,\n updated_at,\n phone_number,\n is_current,\n case when email_list_ids = '[\"is_null\"]' then '[]' else email_list_ids end as email_list_ids,\n cast(NULLIF(email_list_id, 'is_null') as integer) as list_id\n\n --The below script allows for pass through columns.\n \n\n\n\n\n\n from unnest_email_array\n\n), final as (\n\n select\n source_relation,\n _fivetran_user_id,\n unique_user_key,\n user_id,\n email,\n first_name,\n last_name,\n signup_date,\n signup_source,\n updated_at,\n phone_number,\n is_current,\n email_list_ids,\n list_id,\n md5(cast(coalesce(cast(source_relation as TEXT), '_dbt_utils_surrogate_key_null_') || '-' || coalesce(cast(unique_user_key as TEXT), '_dbt_utils_surrogate_key_null_') || '-' || coalesce(cast(list_id as TEXT), '_dbt_utils_surrogate_key_null_') || '-' || coalesce(cast(updated_at as TEXT), '_dbt_utils_surrogate_key_null_') as TEXT)) as unique_key,\n cast( date_trunc('day', updated_at) as date) as date_day\n\n --The below script allows for pass through columns.\n \n\n\n\n\n\n from adjust_nulls\n)\n\nselect *\nfrom final", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.int_iterable__latest_template": {"database": "postgres", "schema": "public_iterable_dev", "name": "int_iterable__latest_template", "resource_type": "model", "package_name": "iterable", "path": "intermediate/int_iterable__latest_template.sql", "original_file_path": "models/intermediate/int_iterable__latest_template.sql", "unique_id": "model.iterable.int_iterable__latest_template", "fqn": ["iterable", "intermediate", "int_iterable__latest_template"], "alias": "int_iterable__latest_template", "checksum": {"name": "sha256", "checksum": "44d385d803b47bd9be4b5bfc6d78b88689e9c113d478ba8feb96f91717f45b3b"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "Table that provides the most recent version of the template as well as joining relevant message type information.", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "iterable://models/intermediate/int_iterable.yml", "build_path": null, "unrendered_config": {"materialized": "view", "schema": "iterable_{{ var('directed_schema','dev') }}", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789503446.469275, "relation_name": "\"postgres\".\"public_iterable_dev\".\"int_iterable__latest_template\"", "raw_code": "with template_history as (\n select *\n from {{ ref('stg_iterable__template_history') }}\n\n), order_template as (\n select\n *,\n row_number() over(partition by template_id{{ fivetran_utils.partition_by_source_relation(package_name='iterable') }} order by updated_at desc) as latest_template_index\n from template_history\n\n), latest_template as (\n\n select *\n from order_template\n where latest_template_index = 1\n\n), message_type_channel as (\n\n select *\n from {{ ref('int_iterable__message_type_channel') }}\n\n), template_join as (\n\n select \n latest_template.*,\n message_type_channel.message_type_name,\n message_type_channel.channel_id,\n message_type_channel.channel_name,\n message_type_channel.channel_type,\n message_type_channel.message_medium\n\n from latest_template \n left join message_type_channel\n on latest_template.message_type_id = message_type_channel.message_type_id\n and latest_template.source_relation = message_type_channel.source_relation\n)\n\nselect *\nfrom template_join", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__template_history", "package": null, "version": null}, {"name": "int_iterable__message_type_channel", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.fivetran_utils.partition_by_source_relation"], "nodes": ["model.iterable.stg_iterable__template_history", "model.iterable.int_iterable__message_type_channel"]}, "compiled_path": "target/compiled/iterable/models/intermediate/int_iterable__latest_template.sql", "compiled": true, "compiled_code": "with template_history as (\n select *\n from \"postgres\".\"public_iterable_dev\".\"stg_iterable__template_history\"\n\n), order_template as (\n select\n *,\n row_number() over(partition by template_id order by updated_at desc) as latest_template_index\n from template_history\n\n), latest_template as (\n\n select *\n from order_template\n where latest_template_index = 1\n\n), message_type_channel as (\n\n select *\n from \"postgres\".\"public_iterable_dev\".\"int_iterable__message_type_channel\"\n\n), template_join as (\n\n select \n latest_template.*,\n message_type_channel.message_type_name,\n message_type_channel.channel_id,\n message_type_channel.channel_name,\n message_type_channel.channel_type,\n message_type_channel.message_medium\n\n from latest_template \n left join message_type_channel\n on latest_template.message_type_id = message_type_channel.message_type_id\n and latest_template.source_relation = message_type_channel.source_relation\n)\n\nselect *\nfrom template_join", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.int_iterable__campaign_event_metrics": {"database": "postgres", "schema": "public_iterable_dev", "name": "int_iterable__campaign_event_metrics", "resource_type": "model", "package_name": "iterable", "path": "intermediate/int_iterable__campaign_event_metrics.sql", "original_file_path": "models/intermediate/int_iterable__campaign_event_metrics.sql", "unique_id": "model.iterable.int_iterable__campaign_event_metrics", "fqn": ["iterable", "intermediate", "int_iterable__campaign_event_metrics"], "alias": "int_iterable__campaign_event_metrics", "checksum": {"name": "sha256", "checksum": "81038e93b6f7f8151fb0d719780a87ebc5bd95b613431564e7c470121a174e26"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "Table that generates relevant total and unique campaign/experiment level aggregations.", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "iterable://models/intermediate/int_iterable.yml", "build_path": null, "unrendered_config": {"materialized": "view", "schema": "iterable_{{ var('directed_schema','dev') }}", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789503446.4666932, "relation_name": "\"postgres\".\"public_iterable_dev\".\"int_iterable__campaign_event_metrics\"", "raw_code": "with user_campaign as (\n select *\n from {{ ref('iterable__user_campaign') }}\n\n), campaign_user_event_metrics as (\n{%- set using_event_extension = var('iterable__using_event_extension', True) %}\n{%- set user_campaign_columns = adapter.get_columns_in_relation(ref('iterable__user_campaign')) %}\n{%- set non_agg_columns = ['source_relation', 'unique_user_key', 'user_id', '_fivetran_user_id', \n 'user_email', 'user_full_name', 'campaign_id', 'campaign_name', 'recurring_campaign_id', \n 'recurring_campaign_name', 'first_event_at', 'last_event_at', 'template_id', 'template_name', \n 'experiment_id', 'unique_user_campaign_id', 'first_open_or_click_event_at'\n ] %}\n\n select\n source_relation,\n campaign_id,\n template_id\n {{ \", experiment_id\" if using_event_extension }}\n , count(distinct unique_user_key) as count_unique_users\n {% for col in user_campaign_columns if col.name|lower not in non_agg_columns %}\n , sum({{ col.name }}) as {{ col.name }}\n , count(distinct case when {{ col.name }} > 0 then user_email else null end) as unique_{{ col.name }}\n {% endfor %}\n \n from user_campaign\n \n {{ dbt_utils.group_by(n=4 if using_event_extension else 3) }}\n)\n\nselect *\nfrom campaign_user_event_metrics", "doc_blocks": [], "language": "sql", "refs": [{"name": "iterable__user_campaign", "package": null, "version": null}, {"name": "iterable__user_campaign", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt_utils.group_by"], "nodes": ["model.iterable.iterable__user_campaign"]}, "compiled_path": "target/compiled/iterable/models/intermediate/int_iterable__campaign_event_metrics.sql", "compiled": true, "compiled_code": "with user_campaign as (\n select *\n from \"postgres\".\"public_iterable_dev\".\"iterable__user_campaign\"\n\n), campaign_user_event_metrics as (\n\n select\n source_relation,\n campaign_id,\n template_id\n , experiment_id\n , count(distinct unique_user_key) as count_unique_users\n \n , sum(total_emailclick) as total_emailclick\n , count(distinct case when total_emailclick > 0 then user_email else null end) as unique_total_emailclick\n \n , sum(total_emailunsubscribe) as total_emailunsubscribe\n , count(distinct case when total_emailunsubscribe > 0 then user_email else null end) as unique_total_emailunsubscribe\n \n , sum(total_emailcomplaint) as total_emailcomplaint\n , count(distinct case when total_emailcomplaint > 0 then user_email else null end) as unique_total_emailcomplaint\n \n , sum(total_customevent) as total_customevent\n , count(distinct case when total_customevent > 0 then user_email else null end) as unique_total_customevent\n \n , sum(total_emailsubscribe) as total_emailsubscribe\n , count(distinct case when total_emailsubscribe > 0 then user_email else null end) as unique_total_emailsubscribe\n \n , sum(total_emailopen) as total_emailopen\n , count(distinct case when total_emailopen > 0 then user_email else null end) as unique_total_emailopen\n \n , sum(total_pushsend) as total_pushsend\n , count(distinct case when total_pushsend > 0 then user_email else null end) as unique_total_pushsend\n \n , sum(total_smsbounce) as total_smsbounce\n , count(distinct case when total_smsbounce > 0 then user_email else null end) as unique_total_smsbounce\n \n , sum(total_pushbounce) as total_pushbounce\n , count(distinct case when total_pushbounce > 0 then user_email else null end) as unique_total_pushbounce\n \n , sum(total_inappsendskip) as total_inappsendskip\n , count(distinct case when total_inappsendskip > 0 then user_email else null end) as unique_total_inappsendskip\n \n , sum(total_smssend) as total_smssend\n , count(distinct case when total_smssend > 0 then user_email else null end) as unique_total_smssend\n \n , sum(total_inappsend) as total_inappsend\n , count(distinct case when total_inappsend > 0 then user_email else null end) as unique_total_inappsend\n \n , sum(total_pushopen) as total_pushopen\n , count(distinct case when total_pushopen > 0 then user_email else null end) as unique_total_pushopen\n \n , sum(total_emailsend) as total_emailsend\n , count(distinct case when total_emailsend > 0 then user_email else null end) as unique_total_emailsend\n \n , sum(total_pushsendskip) as total_pushsendskip\n , count(distinct case when total_pushsendskip > 0 then user_email else null end) as unique_total_pushsendskip\n \n , sum(total_inappopen) as total_inappopen\n , count(distinct case when total_inappopen > 0 then user_email else null end) as unique_total_inappopen\n \n , sum(total_emailsendskip) as total_emailsendskip\n , count(distinct case when total_emailsendskip > 0 then user_email else null end) as unique_total_emailsendskip\n \n , sum(total_emailbounce) as total_emailbounce\n , count(distinct case when total_emailbounce > 0 then user_email else null end) as unique_total_emailbounce\n \n , sum(total_inappclick) as total_inappclick\n , count(distinct case when total_inappclick > 0 then user_email else null end) as unique_total_inappclick\n \n , sum(total_pushuninstall) as total_pushuninstall\n , count(distinct case when total_pushuninstall > 0 then user_email else null end) as unique_total_pushuninstall\n \n \n from user_campaign\n \n group by 1,2,3,4\n)\n\nselect *\nfrom campaign_user_event_metrics", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.int_iterable__campaign_lists": {"database": "postgres", "schema": "public_iterable_dev", "name": "int_iterable__campaign_lists", "resource_type": "model", "package_name": "iterable", "path": "intermediate/int_iterable__campaign_lists.sql", "original_file_path": "models/intermediate/int_iterable__campaign_lists.sql", "unique_id": "model.iterable.int_iterable__campaign_lists", "fqn": ["iterable", "intermediate", "int_iterable__campaign_lists"], "alias": "int_iterable__campaign_lists", "checksum": {"name": "sha256", "checksum": "33c167f12bf4fadb7316af985f2b60ee9989ade1a428d684037465d1a449685e"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "Table that identifies the suppressed and send lists associated with a campaign.", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "iterable://models/intermediate/int_iterable.yml", "build_path": null, "unrendered_config": {"materialized": "view", "schema": "iterable_{{ var('directed_schema','dev') }}", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789503446.467752, "relation_name": "\"postgres\".\"public_iterable_dev\".\"int_iterable__campaign_lists\"", "raw_code": "with \n\n{% if var('iterable__using_campaign_suppression_list_history', True) %}\n\ncampaign_suppression_list_history as (\n\n select *\n from {{ ref('stg_iterable__campaign_suppression_list_history') }}\n\n), \n\n{% endif %}\n\ncampaign_send_list_history as (\n\n select *\n from {{ ref('stg_iterable__campaign_list_history') }}\n\n), combine_list_histories as (\n\n{% if var('iterable__using_campaign_suppression_list_history', True) %}\n\n select\n source_relation,\n suppressed_list_id as list_id,\n campaign_id,\n updated_at,\n 'suppress' as list_activity\n from campaign_suppression_list_history\n\n union all\n\n{% endif %}\n\n select\n source_relation,\n list_id,\n campaign_id,\n updated_at,\n 'send' as list_activity\n from campaign_send_list_history\n\n), order_campaign_list_history as (\n\n select\n *,\n row_number() over(partition by list_id, campaign_id{{ fivetran_utils.partition_by_source_relation(package_name='iterable') }} order by updated_at desc) as latest_list_index\n from combine_list_histories\n\n), latest_campaign_list_history as (\n\n select\n source_relation,\n list_id,\n campaign_id,\n updated_at,\n list_activity\n\n from order_campaign_list_history\n where latest_list_index = 1\n)\n\nselect *\nfrom latest_campaign_list_history", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__campaign_suppression_list_history", "package": null, "version": null}, {"name": "stg_iterable__campaign_list_history", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.fivetran_utils.partition_by_source_relation"], "nodes": ["model.iterable.stg_iterable__campaign_suppression_list_history", "model.iterable.stg_iterable__campaign_list_history"]}, "compiled_path": "target/compiled/iterable/models/intermediate/int_iterable__campaign_lists.sql", "compiled": true, "compiled_code": "with \n\n\n\ncampaign_suppression_list_history as (\n\n select *\n from \"postgres\".\"public_iterable_dev\".\"stg_iterable__campaign_suppression_list_history\"\n\n), \n\n\n\ncampaign_send_list_history as (\n\n select *\n from \"postgres\".\"public_iterable_dev\".\"stg_iterable__campaign_list_history\"\n\n), combine_list_histories as (\n\n\n\n select\n source_relation,\n suppressed_list_id as list_id,\n campaign_id,\n updated_at,\n 'suppress' as list_activity\n from campaign_suppression_list_history\n\n union all\n\n\n\n select\n source_relation,\n list_id,\n campaign_id,\n updated_at,\n 'send' as list_activity\n from campaign_send_list_history\n\n), order_campaign_list_history as (\n\n select\n *,\n row_number() over(partition by list_id, campaign_id order by updated_at desc) as latest_list_index\n from combine_list_histories\n\n), latest_campaign_list_history as (\n\n select\n source_relation,\n list_id,\n campaign_id,\n updated_at,\n list_activity\n\n from order_campaign_list_history\n where latest_list_index = 1\n)\n\nselect *\nfrom latest_campaign_list_history", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.int_iterable__recurring_campaigns": {"database": "postgres", "schema": "public_iterable_dev", "name": "int_iterable__recurring_campaigns", "resource_type": "model", "package_name": "iterable", "path": "intermediate/int_iterable__recurring_campaigns.sql", "original_file_path": "models/intermediate/int_iterable__recurring_campaigns.sql", "unique_id": "model.iterable.int_iterable__recurring_campaigns", "fqn": ["iterable", "intermediate", "int_iterable__recurring_campaigns"], "alias": "int_iterable__recurring_campaigns", "checksum": {"name": "sha256", "checksum": "177c12b9779cfd975d0de322b8ccfc36bdecb1f509262c02ca1c8cb7035926d8"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "Table that identifies when a campaign is associated with a recurring campaign and provides additional enriched recurring campaign information.", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "iterable://models/intermediate/int_iterable.yml", "build_path": null, "unrendered_config": {"materialized": "view", "schema": "iterable_{{ var('directed_schema','dev') }}", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789503446.4717386, "relation_name": "\"postgres\".\"public_iterable_dev\".\"int_iterable__recurring_campaigns\"", "raw_code": "with latest_campaign as (\n\n select * \n from {{ ref('int_iterable__latest_campaign') }}\n\n), recurring_campaign_join as (\n select\n latest_campaign.source_relation,\n latest_campaign.campaign_id,\n latest_campaign.campaign_name,\n latest_campaign.updated_at,\n latest_campaign.campaign_state,\n latest_campaign.campaign_type,\n latest_campaign.send_size,\n latest_campaign.start_at,\n latest_campaign.ended_at,\n latest_campaign.created_at,\n latest_campaign.created_by_user_id,\n latest_campaign.template_id,\n latest_campaign.recurring_campaign_id,\n {% if var('iterable__using_journey', true) %}\n -- cast to string so this matches journey_id in stg_iterable__journey; workflow_id arrives\n -- numeric from campaign_history but as a string from event_extension\n cast(latest_campaign.workflow_id as {{ dbt.type_string() }}) as journey_id,\n {% endif %}\n\n recurring_campaign.campaign_name as recurring_campaign_name,\n recurring_campaign.campaign_state as recurring_campaign_state,\n recurring_campaign.send_size as recurring_campaign_send_size,\n recurring_campaign.start_at as recurring_campaign_start_at\n\n from latest_campaign\n\n left join latest_campaign as recurring_campaign\n on latest_campaign.recurring_campaign_id = recurring_campaign.campaign_id\n and latest_campaign.source_relation = recurring_campaign.source_relation\n\n), final as (\n\n select\n recurring_campaign_join.*,\n case when latest_campaign.recurring_campaign_id is not null then true \n else false end as is_campaign_recurring\n\n from recurring_campaign_join\n left join latest_campaign on recurring_campaign_join.campaign_id = latest_campaign.recurring_campaign_id\n and recurring_campaign_join.template_id = latest_campaign.template_id\n and recurring_campaign_join.source_relation = latest_campaign.source_relation\n)\n\nselect *\nfrom final", "doc_blocks": [], "language": "sql", "refs": [{"name": "int_iterable__latest_campaign", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.type_string"], "nodes": ["model.iterable.int_iterable__latest_campaign"]}, "compiled_path": "target/compiled/iterable/models/intermediate/int_iterable__recurring_campaigns.sql", "compiled": true, "compiled_code": "with latest_campaign as (\n\n select * \n from \"postgres\".\"public_iterable_dev\".\"int_iterable__latest_campaign\"\n\n), recurring_campaign_join as (\n select\n latest_campaign.source_relation,\n latest_campaign.campaign_id,\n latest_campaign.campaign_name,\n latest_campaign.updated_at,\n latest_campaign.campaign_state,\n latest_campaign.campaign_type,\n latest_campaign.send_size,\n latest_campaign.start_at,\n latest_campaign.ended_at,\n latest_campaign.created_at,\n latest_campaign.created_by_user_id,\n latest_campaign.template_id,\n latest_campaign.recurring_campaign_id,\n \n -- cast to string so this matches journey_id in stg_iterable__journey; workflow_id arrives\n -- numeric from campaign_history but as a string from event_extension\n cast(latest_campaign.workflow_id as TEXT) as journey_id,\n \n\n recurring_campaign.campaign_name as recurring_campaign_name,\n recurring_campaign.campaign_state as recurring_campaign_state,\n recurring_campaign.send_size as recurring_campaign_send_size,\n recurring_campaign.start_at as recurring_campaign_start_at\n\n from latest_campaign\n\n left join latest_campaign as recurring_campaign\n on latest_campaign.recurring_campaign_id = recurring_campaign.campaign_id\n and latest_campaign.source_relation = recurring_campaign.source_relation\n\n), final as (\n\n select\n recurring_campaign_join.*,\n case when latest_campaign.recurring_campaign_id is not null then true \n else false end as is_campaign_recurring\n\n from recurring_campaign_join\n left join latest_campaign on recurring_campaign_join.campaign_id = latest_campaign.recurring_campaign_id\n and recurring_campaign_join.template_id = latest_campaign.template_id\n and recurring_campaign_join.source_relation = latest_campaign.source_relation\n)\n\nselect *\nfrom final", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.int_iterable__list_user_history": {"database": "postgres", "schema": "public_iterable_dev", "name": "int_iterable__list_user_history", "resource_type": "model", "package_name": "iterable", "path": "intermediate/int_iterable__list_user_history.sql", "original_file_path": "models/intermediate/int_iterable__list_user_history.sql", "unique_id": "model.iterable.int_iterable__list_user_history", "fqn": ["iterable", "intermediate", "int_iterable__list_user_history"], "alias": "int_iterable__list_user_history", "checksum": {"name": "sha256", "checksum": "26b2bd189944dfea25bb63edf9e3da03a3e8169e3501b894716e8d1f8e1df5a0"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "table", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "Table that provides a history of all lists the user has been associated with.", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "iterable://models/intermediate/int_iterable.yml", "build_path": null, "unrendered_config": {"materialized": "table", "schema": "iterable_{{ var('directed_schema','dev') }}", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789503446.4702656, "relation_name": "\"postgres\".\"public_iterable_dev\".\"int_iterable__list_user_history\"", "raw_code": "-- this model will serve to extract only email-list changes\nwith user_history as (\n\n select *\n from {{ ref('stg_iterable__user_history') }}\n\n), previous_email_list_ids as (\n\n select\n *,\n lag(email_list_ids) over(partition by unique_user_key{{ fivetran_utils.partition_by_source_relation(package_name='iterable') }} order by updated_at asc) as previous_ids -- partition by email instead of unique_user_key here since this model is only for email-list users\n\n from user_history\n\n), only_new_email_list_ids as (\n\n select\n source_relation,\n _fivetran_user_id,\n unique_user_key,\n user_id,\n email,\n first_name,\n last_name,\n email_list_ids,\n phone_number,\n signup_date,\n signup_source,\n updated_at\n\n --The below script allows for pass through columns.\n {{ fivetran_utils.persist_pass_through_columns(pass_through_variable='iterable_user_history_pass_through_columns', identifier='previous_email_list_ids') }}\n\n from previous_email_list_ids\n where email_list_ids != coalesce(previous_ids, 'this is new') -- list ids are always stored in their arrays in numerical order\n\n), most_recent_list_ids as (\n\n select\n *,\n row_number() over(partition by email{{ fivetran_utils.partition_by_source_relation(package_name='iterable') }} order by updated_at desc) as latest_user_index\n\n from only_new_email_list_ids\n\n), final as (\n\n select\n source_relation,\n _fivetran_user_id,\n unique_user_key,\n email,\n user_id,\n first_name,\n last_name,\n email_list_ids,\n phone_number,\n signup_date,\n signup_source,\n updated_at,\n latest_user_index = 1 as is_current\n\n --The below script allows for pass through columns.\n {{ fivetran_utils.persist_pass_through_columns(pass_through_variable='iterable_user_history_pass_through_columns', identifier='most_recent_list_ids') }}\n\n from most_recent_list_ids\n)\n\nselect * from final", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__user_history", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.fivetran_utils.partition_by_source_relation", "macro.fivetran_utils.persist_pass_through_columns"], "nodes": ["model.iterable.stg_iterable__user_history"]}, "compiled_path": "target/compiled/iterable/models/intermediate/int_iterable__list_user_history.sql", "compiled": true, "compiled_code": "-- this model will serve to extract only email-list changes\nwith user_history as (\n\n select *\n from \"postgres\".\"public_iterable_dev\".\"stg_iterable__user_history\"\n\n), previous_email_list_ids as (\n\n select\n *,\n lag(email_list_ids) over(partition by unique_user_key order by updated_at asc) as previous_ids -- partition by email instead of unique_user_key here since this model is only for email-list users\n\n from user_history\n\n), only_new_email_list_ids as (\n\n select\n source_relation,\n _fivetran_user_id,\n unique_user_key,\n user_id,\n email,\n first_name,\n last_name,\n email_list_ids,\n phone_number,\n signup_date,\n signup_source,\n updated_at\n\n --The below script allows for pass through columns.\n \n\n\n\n\n\n from previous_email_list_ids\n where email_list_ids != coalesce(previous_ids, 'this is new') -- list ids are always stored in their arrays in numerical order\n\n), most_recent_list_ids as (\n\n select\n *,\n row_number() over(partition by email order by updated_at desc) as latest_user_index\n\n from only_new_email_list_ids\n\n), final as (\n\n select\n source_relation,\n _fivetran_user_id,\n unique_user_key,\n email,\n user_id,\n first_name,\n last_name,\n email_list_ids,\n phone_number,\n signup_date,\n signup_source,\n updated_at,\n latest_user_index = 1 as is_current\n\n --The below script allows for pass through columns.\n \n\n\n\n\n\n from most_recent_list_ids\n)\n\nselect * from final", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.int_iterable__message_type_channel": {"database": "postgres", "schema": "public_iterable_dev", "name": "int_iterable__message_type_channel", "resource_type": "model", "package_name": "iterable", "path": "intermediate/int_iterable__message_type_channel.sql", "original_file_path": "models/intermediate/int_iterable__message_type_channel.sql", "unique_id": "model.iterable.int_iterable__message_type_channel", "fqn": ["iterable", "intermediate", "int_iterable__message_type_channel"], "alias": "int_iterable__message_type_channel", "checksum": {"name": "sha256", "checksum": "9f54e0a46c508fbe16514b8e598ee614b3462649f85582b5513905f6392d728d"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "Table that joins the message type and channel records together into one comprehensive model to be referenced downstream.", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "iterable://models/intermediate/int_iterable.yml", "build_path": null, "unrendered_config": {"materialized": "view", "schema": "iterable_{{ var('directed_schema','dev') }}", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789503446.4712505, "relation_name": "\"postgres\".\"public_iterable_dev\".\"int_iterable__message_type_channel\"", "raw_code": "with message_type as (\n\n select *\n from {{ ref('stg_iterable__message_type') }}\n\n), channel as (\n\n select *\n from {{ ref('stg_iterable__channel') }}\n\n), final as (\n\n select \n channel.*,\n message_type.message_type_name,\n message_type.message_type_id\n from channel\n left join message_type\n on channel.channel_id = message_type.channel_id\n and channel.source_relation = message_type.source_relation\n)\n\nselect *\nfrom final", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__message_type", "package": null, "version": null}, {"name": "stg_iterable__channel", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": [], "nodes": ["model.iterable.stg_iterable__message_type", "model.iterable.stg_iterable__channel"]}, "compiled_path": "target/compiled/iterable/models/intermediate/int_iterable__message_type_channel.sql", "compiled": true, "compiled_code": "with message_type as (\n\n select *\n from \"postgres\".\"public_iterable_dev\".\"stg_iterable__message_type\"\n\n), channel as (\n\n select *\n from \"postgres\".\"public_iterable_dev\".\"stg_iterable__channel\"\n\n), final as (\n\n select \n channel.*,\n message_type.message_type_name,\n message_type.message_type_id\n from channel\n left join message_type\n on channel.channel_id = message_type.channel_id\n and channel.source_relation = message_type.source_relation\n)\n\nselect *\nfrom final", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.int_iterable__user_event_metrics": {"database": "postgres", "schema": "public_iterable_dev", "name": "int_iterable__user_event_metrics", "resource_type": "model", "package_name": "iterable", "path": "intermediate/int_iterable__user_event_metrics.sql", "original_file_path": "models/intermediate/int_iterable__user_event_metrics.sql", "unique_id": "model.iterable.int_iterable__user_event_metrics", "fqn": ["iterable", "intermediate", "int_iterable__user_event_metrics"], "alias": "int_iterable__user_event_metrics", "checksum": {"name": "sha256", "checksum": "56af49e00fd9cad13663d8bf802187ff1d12561fb1fd9d3732d182703b34ca4d"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "Table that generates user aggregations at the campaign level.", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "iterable://models/intermediate/int_iterable.yml", "build_path": null, "unrendered_config": {"materialized": "view", "schema": "iterable_{{ var('directed_schema','dev') }}", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789503446.47224, "relation_name": "\"postgres\".\"public_iterable_dev\".\"int_iterable__user_event_metrics\"", "raw_code": "with user_campaign as (\n\n select *\n from {{ ref('iterable__user_campaign') }}\n\n), user_event_metrics as (\n\n{%- set user_campaign_columns = adapter.get_columns_in_relation(ref('iterable__user_campaign')) %}\n{%- set non_agg_columns = ['source_relation', 'unique_user_key', 'user_id', '_fivetran_user_id', \n 'user_email', 'user_full_name', 'campaign_id', 'campaign_name', 'recurring_campaign_id', \n 'recurring_campaign_name', 'first_event_at', 'last_event_at', 'template_id', 'template_name', \n 'experiment_id', 'unique_user_campaign_id', 'first_open_or_click_event_at'\n ] %}\n\n select\n source_relation,\n _fivetran_user_id,\n unique_user_key,\n user_id,\n user_email,\n count(distinct campaign_id) as count_total_campaigns,\n min(first_event_at) as first_event_at,\n max(last_event_at) as last_event_at\n\n {% for col in user_campaign_columns if col.name|lower not in non_agg_columns %}\n , sum({{ col.name }}) as {{ col.name }}\n {% endfor %}\n\n from user_campaign\n {{ dbt_utils.group_by(n=5) }}\n\n)\n\nselect *\nfrom user_event_metrics", "doc_blocks": [], "language": "sql", "refs": [{"name": "iterable__user_campaign", "package": null, "version": null}, {"name": "iterable__user_campaign", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt_utils.group_by"], "nodes": ["model.iterable.iterable__user_campaign"]}, "compiled_path": "target/compiled/iterable/models/intermediate/int_iterable__user_event_metrics.sql", "compiled": true, "compiled_code": "with user_campaign as (\n\n select *\n from \"postgres\".\"public_iterable_dev\".\"iterable__user_campaign\"\n\n), user_event_metrics as (\n\n select\n source_relation,\n _fivetran_user_id,\n unique_user_key,\n user_id,\n user_email,\n count(distinct campaign_id) as count_total_campaigns,\n min(first_event_at) as first_event_at,\n max(last_event_at) as last_event_at\n\n \n , sum(total_emailclick) as total_emailclick\n \n , sum(total_emailunsubscribe) as total_emailunsubscribe\n \n , sum(total_emailcomplaint) as total_emailcomplaint\n \n , sum(total_customevent) as total_customevent\n \n , sum(total_emailsubscribe) as total_emailsubscribe\n \n , sum(total_emailopen) as total_emailopen\n \n , sum(total_pushsend) as total_pushsend\n \n , sum(total_smsbounce) as total_smsbounce\n \n , sum(total_pushbounce) as total_pushbounce\n \n , sum(total_inappsendskip) as total_inappsendskip\n \n , sum(total_smssend) as total_smssend\n \n , sum(total_inappsend) as total_inappsend\n \n , sum(total_pushopen) as total_pushopen\n \n , sum(total_emailsend) as total_emailsend\n \n , sum(total_pushsendskip) as total_pushsendskip\n \n , sum(total_inappopen) as total_inappopen\n \n , sum(total_emailsendskip) as total_emailsendskip\n \n , sum(total_emailbounce) as total_emailbounce\n \n , sum(total_inappclick) as total_inappclick\n \n , sum(total_pushuninstall) as total_pushuninstall\n \n\n from user_campaign\n group by 1,2,3,4,5\n\n)\n\nselect *\nfrom user_event_metrics", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.int_iterable__latest_user": {"database": "postgres", "schema": "public_iterable_dev", "name": "int_iterable__latest_user", "resource_type": "model", "package_name": "iterable", "path": "intermediate/int_iterable__latest_user.sql", "original_file_path": "models/intermediate/int_iterable__latest_user.sql", "unique_id": "model.iterable.int_iterable__latest_user", "fqn": ["iterable", "intermediate", "int_iterable__latest_user"], "alias": "int_iterable__latest_user", "checksum": {"name": "sha256", "checksum": "580070cfbe396b904d0dc15669eefe5b9f017005d0aa91aa2c3d96b4e4686e81"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "Table that filters out historical versions of the user, and returns only the most recent version.", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "iterable://models/intermediate/int_iterable.yml", "build_path": null, "unrendered_config": {"materialized": "view", "schema": "iterable_{{ var('directed_schema','dev') }}", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789503446.4697568, "relation_name": "\"postgres\".\"public_iterable_dev\".\"int_iterable__latest_user\"", "raw_code": "with user_history as (\n select *\n from {{ ref('stg_iterable__user_history') }}\n\n), latest_user as (\n select\n *,\n row_number() over(partition by unique_user_key{{ fivetran_utils.partition_by_source_relation(package_name='iterable') }} order by updated_at desc) as latest_user_index\n from user_history\n)\n\nselect *\nfrom latest_user\nwhere latest_user_index = 1", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__user_history", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.fivetran_utils.partition_by_source_relation"], "nodes": ["model.iterable.stg_iterable__user_history"]}, "compiled_path": "target/compiled/iterable/models/intermediate/int_iterable__latest_user.sql", "compiled": true, "compiled_code": "with user_history as (\n select *\n from \"postgres\".\"public_iterable_dev\".\"stg_iterable__user_history\"\n\n), latest_user as (\n select\n *,\n row_number() over(partition by unique_user_key order by updated_at desc) as latest_user_index\n from user_history\n)\n\nselect *\nfrom latest_user\nwhere latest_user_index = 1", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.int_iterable__latest_campaign": {"database": "postgres", "schema": "public_iterable_dev", "name": "int_iterable__latest_campaign", "resource_type": "model", "package_name": "iterable", "path": "intermediate/int_iterable__latest_campaign.sql", "original_file_path": "models/intermediate/int_iterable__latest_campaign.sql", "unique_id": "model.iterable.int_iterable__latest_campaign", "fqn": ["iterable", "intermediate", "int_iterable__latest_campaign"], "alias": "int_iterable__latest_campaign", "checksum": {"name": "sha256", "checksum": "8063c9ccdfe6dee1694944607534fbb31bafe2856073ac2f5ea58aa513714e4f"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "Table that filters out historical versions of the campaign, and returns the most recent campaign version.", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "iterable://models/intermediate/int_iterable.yml", "build_path": null, "unrendered_config": {"materialized": "view", "schema": "iterable_{{ var('directed_schema','dev') }}", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789503446.4687629, "relation_name": "\"postgres\".\"public_iterable_dev\".\"int_iterable__latest_campaign\"", "raw_code": "with campaign_history as (\n select *\n from {{ ref('stg_iterable__campaign_history') }}\n\n), latest_campaign as (\n select\n *,\n row_number() over(partition by campaign_id{{ fivetran_utils.partition_by_source_relation(package_name='iterable') }} order by updated_at desc) as latest_campaign_index\n from campaign_history\n)\n\nselect *\nfrom latest_campaign\nwhere latest_campaign_index = 1", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__campaign_history", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.fivetran_utils.partition_by_source_relation"], "nodes": ["model.iterable.stg_iterable__campaign_history"]}, "compiled_path": "target/compiled/iterable/models/intermediate/int_iterable__latest_campaign.sql", "compiled": true, "compiled_code": "with campaign_history as (\n select *\n from \"postgres\".\"public_iterable_dev\".\"stg_iterable__campaign_history\"\n\n), latest_campaign as (\n select\n *,\n row_number() over(partition by campaign_id order by updated_at desc) as latest_campaign_index\n from campaign_history\n)\n\nselect *\nfrom latest_campaign\nwhere latest_campaign_index = 1", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.stg_iterable__message_type": {"database": "postgres", "schema": "public_iterable_dev", "name": "stg_iterable__message_type", "resource_type": "model", "package_name": "iterable", "path": "staging/stg_iterable__message_type.sql", "original_file_path": "models/staging/stg_iterable__message_type.sql", "unique_id": "model.iterable.stg_iterable__message_type", "fqn": ["iterable", "staging", "stg_iterable__message_type"], "alias": "stg_iterable__message_type", "checksum": {"name": "sha256", "checksum": "046caf2bcc8a01dd2b8ef46a5dfb52e02b8bebe01e892de5d658910c97d5e6a4"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "table", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "Table containing unique message types.", "columns": {"source_relation": {"name": "source_relation", "description": "Identifies the record's source.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": ["doc.iterable.source_relation"]}, "message_type_id": {"name": "message_type_id", "description": "Unique identifier of the message type", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "message_type_name": {"name": "message_type_name", "description": "User defined name of the message type", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "channel_id": {"name": "channel_id", "description": "Channel that this message type belongs to", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "message_type_created_at": {"name": "message_type_created_at", "description": "Time when the message type was initially created", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "frequency_cap": {"name": "frequency_cap", "description": "The maximum number of times a message of this type can be sent to a recipient within a specified time period to prevent over-messaging", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "rate_limit_per_minute": {"name": "rate_limit_per_minute", "description": "The maximum number of messages of this type that can be sent to recipients in a minute, ensuring controlled message delivery", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "subscription_policy": {"name": "subscription_policy", "description": "Information about the policy or rules governing how users can subscribe to or unsubscribe from this specific message type, like OptOut", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "message_type_updated_at": {"name": "message_type_updated_at", "description": "Time when the message type was last updated or modified", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "The time when a record was last updated by Fivetran.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": ["doc.iterable._fivetran_synced"]}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "iterable://models/staging/stg_iterable.yml", "build_path": null, "unrendered_config": {"materialized": "table", "schema": "iterable_{{ var('directed_schema','dev') }}", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789503446.4880998, "relation_name": "\"postgres\".\"public_iterable_dev\".\"stg_iterable__message_type\"", "raw_code": "with base as (\n\n select * \n from {{ ref('stg_iterable__message_type_tmp') }}\n\n),\n\nfields as (\n\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_iterable/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_iterable/macros/).\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_iterable__message_type_tmp')),\n staging_columns=get_message_type_columns()\n )\n }}\n {{ fivetran_utils.apply_source_relation(package_name='iterable') }}\n\n from base\n),\n\nfinal as (\n\n select\n source_relation,\n cast(id as {{ dbt.type_string() }} ) as message_type_id,\n name as message_type_name,\n cast(channel_id as {{ dbt.type_string() }} ) as channel_id,\n created_at as message_type_created_at,\n frequency_cap,\n rate_limit_per_minute,\n subscription_policy,\n updated_at as message_type_updated_at,\n _fivetran_synced\n from fields\n where not coalesce(_fivetran_deleted, true)\n)\n\nselect * \nfrom final", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__message_type_tmp", "package": null, "version": null}, {"name": "stg_iterable__message_type_tmp", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.iterable.get_message_type_columns", "macro.fivetran_utils.fill_staging_columns", "macro.fivetran_utils.apply_source_relation", "macro.dbt.type_string"], "nodes": ["model.iterable.stg_iterable__message_type_tmp"]}, "compiled_path": "target/compiled/iterable/models/staging/stg_iterable__message_type.sql", "compiled": true, "compiled_code": "with base as (\n\n select * \n from \"postgres\".\"public_iterable_dev\".\"stg_iterable__message_type_tmp\"\n\n),\n\nfields as (\n\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_iterable/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_iterable/macros/).\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n \n _fivetran_deleted as _fivetran_deleted,\n _fivetran_synced as _fivetran_synced,\n channel_id as channel_id,\n id as id,\n name as name,\n created_at as created_at,\n frequency_cap as frequency_cap,\n rate_limit_per_minute as rate_limit_per_minute,\n subscription_policy as subscription_policy,\n updated_at as updated_at\n \n\n\n\n\n \n \n\n\n\n\n\n, cast('postgres.public' as TEXT) as source_relation\n\n\n from base\n),\n\nfinal as (\n\n select\n source_relation,\n cast(id as TEXT ) as message_type_id,\n name as message_type_name,\n cast(channel_id as TEXT ) as channel_id,\n created_at as message_type_created_at,\n frequency_cap,\n rate_limit_per_minute,\n subscription_policy,\n updated_at as message_type_updated_at,\n _fivetran_synced\n from fields\n where not coalesce(_fivetran_deleted, true)\n)\n\nselect * \nfrom final", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.stg_iterable__event": {"database": "postgres", "schema": "public_iterable_dev", "name": "stg_iterable__event", "resource_type": "model", "package_name": "iterable", "path": "staging/stg_iterable__event.sql", "original_file_path": "models/staging/stg_iterable__event.sql", "unique_id": "model.iterable.stg_iterable__event", "fqn": ["iterable", "staging", "stg_iterable__event"], "alias": "stg_iterable__event", "checksum": {"name": "sha256", "checksum": "22ba2d21012d8301984a6fcea5b9f40f9579f5565aaea7417f7458f6fd37937b"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "Table containing individual events within campaigns.", "columns": {"source_relation": {"name": "source_relation", "description": "Identifies the record's source.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": ["doc.iterable.source_relation"]}, "event_id": {"name": "event_id", "description": "A Fivetran-created unique identifier derived from hashing campaign_id, created_at, and event_name.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_event_id": {"name": "unique_event_id", "description": "A surrogate key made up of event_id, _fivetran_user_id, and source_relation.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "campaign_id": {"name": "campaign_id", "description": "Reference to the campaign from which the event originated", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "content_id": {"name": "content_id", "description": "Reference to the content the event is associated with", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "created_at": {"name": "created_at", "description": "Creation timestamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "created_on": {"name": "created_on", "description": "Creation date", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "email": {"name": "email", "description": "Reference to the unique user the event was applied to", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "additional_properties": {"name": "additional_properties", "description": "json object containing addition event properties", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "event_name": {"name": "event_name", "description": "Name provided to the individual event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "message_bus_id": {"name": "message_bus_id", "description": "Reference to the message bus associated with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "message_id": {"name": "message_id", "description": "Reference to the message the event is associated with", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "message_type_id": {"name": "message_type_id", "description": "Reference to the type of message the event is associated with", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "recipient_state": {"name": "recipient_state", "description": "The state of the recipient upon receiving the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "status": {"name": "status", "description": "Status of the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "transactional_data": {"name": "transactional_data", "description": "Transactional data associated with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unsub_source": {"name": "unsub_source", "description": "Source of the unsubscribe event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "user_agent": {"name": "user_agent", "description": "User agent associated with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "user_agent_device": {"name": "user_agent_device", "description": "The device of the user agent", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "_fivetran_user_id": {"name": "_fivetran_user_id", "description": "A Fivetran-created unique identifier for users, derived from hashing user_id and/or email, depending on project type. This exists for users of the new schema starting Aug 2023. In the old schema, the unique identifier is email.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_user_key": {"name": "unique_user_key", "description": "The unique identifier of the user. With the new schema (Aug 2023), it is the _fivetran_user_id. This is a hash of user_id and/or email, depending on project type. If using the old schema, it is email.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "The time when a record was last updated by Fivetran.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": ["doc.iterable._fivetran_synced"]}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "iterable://models/staging/stg_iterable.yml", "build_path": null, "unrendered_config": {"materialized": "view", "schema": "iterable_{{ var('directed_schema','dev') }}", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789503446.4801724, "relation_name": "\"postgres\".\"public_iterable_dev\".\"stg_iterable__event\"", "raw_code": "{{ config( materialized = 'view' ) }}\n\nwith base as (\n\n select * \n from {{ ref('stg_iterable__event_tmp') }}\n\n),\n\nfields as (\n\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_iterable/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_iterable/macros/).\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_iterable__event_tmp')),\n staging_columns=get_event_columns()\n )\n }}\n {{ fivetran_utils.apply_source_relation(package_name='iterable') }}\n \n from base\n),\n\nfinal as (\n\n select\n source_relation,\n cast(_fivetran_id as {{ dbt.type_string() }} ) as event_id,\n {{ dbt_utils.generate_surrogate_key(['_fivetran_id','_fivetran_user_id','source_relation']) }} as unique_event_id,\n cast(_fivetran_user_id as {{ dbt.type_string() }} ) as _fivetran_user_id,\n coalesce(cast(_fivetran_user_id as {{ dbt.type_string() }} ) , email) as unique_user_key,\n cast(campaign_id as {{ dbt.type_string() }} ) as campaign_id,\n cast(content_id as {{ dbt.type_string() }} ) as content_id,\n created_at,\n cast( {{ dbt.date_trunc('day', 'created_at') }} as date) as created_on,\n lower(email) as email,\n additional_properties,\n event_name,\n cast(message_bus_id as {{ dbt.type_string() }} ) as message_bus_id,\n cast(message_id as {{ dbt.type_string() }} ) as message_id,\n cast(message_type_id as {{ dbt.type_string() }} ) as message_type_id,\n recipient_state,\n status,\n transactional_data,\n unsub_source,\n user_agent,\n user_agent_device,\n _fivetran_synced\n\n from fields\n)\n\nselect *\nfrom final", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__event_tmp", "package": null, "version": null}, {"name": "stg_iterable__event_tmp", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.iterable.get_event_columns", "macro.fivetran_utils.fill_staging_columns", "macro.fivetran_utils.apply_source_relation", "macro.dbt.type_string", "macro.dbt_utils.generate_surrogate_key", "macro.dbt.date_trunc"], "nodes": ["model.iterable.stg_iterable__event_tmp"]}, "compiled_path": "target/compiled/iterable/models/staging/stg_iterable__event.sql", "compiled": true, "compiled_code": "\n\nwith base as (\n\n select * \n from \"postgres\".\"public_iterable_dev\".\"stg_iterable__event_tmp\"\n\n),\n\nfields as (\n\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_iterable/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_iterable/macros/).\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n \n _fivetran_id as _fivetran_id,\n _fivetran_user_id as _fivetran_user_id,\n _fivetran_synced as _fivetran_synced,\n campaign_id as campaign_id,\n content_id as content_id,\n created_at as created_at,\n email as email,\n event_name as event_name,\n message_bus_id as message_bus_id,\n message_id as message_id,\n message_type_id as message_type_id,\n recipient_state as recipient_state,\n status as status,\n unsub_source as unsub_source,\n user_agent as user_agent,\n user_agent_device as user_agent_device,\n transactional_data as transactional_data,\n additional_properties as additional_properties\n \n\n\n\n\n \n \n\n\n\n\n\n, cast('postgres.public' as TEXT) as source_relation\n\n \n from base\n),\n\nfinal as (\n\n select\n source_relation,\n cast(_fivetran_id as TEXT ) as event_id,\n md5(cast(coalesce(cast(_fivetran_id as TEXT), '_dbt_utils_surrogate_key_null_') || '-' || coalesce(cast(_fivetran_user_id as TEXT), '_dbt_utils_surrogate_key_null_') || '-' || coalesce(cast(source_relation as TEXT), '_dbt_utils_surrogate_key_null_') as TEXT)) as unique_event_id,\n cast(_fivetran_user_id as TEXT ) as _fivetran_user_id,\n coalesce(cast(_fivetran_user_id as TEXT ) , email) as unique_user_key,\n cast(campaign_id as TEXT ) as campaign_id,\n cast(content_id as TEXT ) as content_id,\n created_at,\n cast( date_trunc('day', created_at) as date) as created_on,\n lower(email) as email,\n additional_properties,\n event_name,\n cast(message_bus_id as TEXT ) as message_bus_id,\n cast(message_id as TEXT ) as message_id,\n cast(message_type_id as TEXT ) as message_type_id,\n recipient_state,\n status,\n transactional_data,\n unsub_source,\n user_agent,\n user_agent_device,\n _fivetran_synced\n\n from fields\n)\n\nselect *\nfrom final", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.stg_iterable__user_unsubscribed_channel": {"database": "postgres", "schema": "public_iterable_dev", "name": "stg_iterable__user_unsubscribed_channel", "resource_type": "model", "package_name": "iterable", "path": "staging/stg_iterable__user_unsubscribed_channel.sql", "original_file_path": "models/staging/stg_iterable__user_unsubscribed_channel.sql", "unique_id": "model.iterable.stg_iterable__user_unsubscribed_channel", "fqn": ["iterable", "staging", "stg_iterable__user_unsubscribed_channel"], "alias": "stg_iterable__user_unsubscribed_channel", "checksum": {"name": "sha256", "checksum": "5c639597d14f4bb7072df74e39c2b8aaa7bf1e29c6204243035014d14a0bc6f2"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "table", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "Table containing the history of channels from which a user has unsubscribed.", "columns": {"source_relation": {"name": "source_relation", "description": "Identifies the record's source.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": ["doc.iterable.source_relation"]}, "channel_id": {"name": "channel_id", "description": "Reference to the channel from which the user unsubscribed", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unsub_channel_unique_key": {"name": "unsub_channel_unique_key", "description": "A surrogate key providing a unique key for each record. If using user_unsubscribed_channel_history, it uses '_fivetran_id', 'channel_id', 'email', 'updated_at', and 'source_relation'. If not using the history table, it uses '_fivetran_id', 'channel_id', and 'source_relation'.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "_fivetran_user_id": {"name": "_fivetran_user_id", "description": "A Fivetran-created unique identifier for users, derived from hashing user_id and/or email, depending on project type. This exists for users of the new schema starting Aug 2023. In the old schema, the unique identifier is email.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_user_key": {"name": "unique_user_key", "description": "The unique identifier of the user. With the new schema (Aug 2023), it is the _fivetran_user_id. This is a hash of user_id and/or email, depending on project type. If using the old schema, it is email.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "latest_batch_index": {"name": "latest_batch_index", "description": "Indexes each user record based on the most recent available.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "updated_at": {"name": "updated_at", "description": "Last update timestamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "The time when a record was last updated by Fivetran.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": ["doc.iterable._fivetran_synced"]}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "iterable://models/staging/stg_iterable.yml", "build_path": null, "unrendered_config": {"materialized": "table", "schema": "iterable_{{ var('directed_schema','dev') }}", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789503446.4948869, "relation_name": "\"postgres\".\"public_iterable_dev\".\"stg_iterable__user_unsubscribed_channel\"", "raw_code": "with base as (\n select *\n from {{ ref('stg_iterable__user_unsubscribed_channel_tmp') }}\n\n),\n\nfields as (\n\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_iterable/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_iterable/macros/).\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_iterable__user_unsubscribed_channel_tmp')),\n staging_columns=get_user_unsubscribed_channel_columns()\n )\n }}\n {{ fivetran_utils.apply_source_relation(package_name='iterable') }}\n\n from base\n),\n\nfinal as (\n\n select\n source_relation,\n cast(_fivetran_id as {{ dbt.type_string() }} ) as _fivetran_user_id,\n coalesce(cast(_fivetran_id as {{ dbt.type_string() }} ), email) as unique_user_key,\n cast(channel_id as {{ dbt.type_string() }} ) as channel_id,\n {{ dbt_utils.generate_surrogate_key(['_fivetran_id', 'channel_id', 'email', 'updated_at', 'source_relation']) }} as unsub_channel_unique_key,\n\n {% if does_table_exist('user_unsubscribed_channel') == false %}\n rank() over(partition by email, channel_id{{ fivetran_utils.partition_by_source_relation(package_name='iterable') }} order by updated_at desc) as latest_batch_index,\n {% else %}\n 1 as latest_batch_index,\n {% endif %}\n\n updated_at,\n _fivetran_synced\n\n from fields\n)\n\n\nselect *\nfrom final", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__user_unsubscribed_channel_tmp", "package": null, "version": null}, {"name": "stg_iterable__user_unsubscribed_channel_tmp", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.iterable.get_user_unsubscribed_channel_columns", "macro.fivetran_utils.fill_staging_columns", "macro.fivetran_utils.apply_source_relation", "macro.dbt.type_string", "macro.dbt_utils.generate_surrogate_key", "macro.iterable.does_table_exist"], "nodes": ["model.iterable.stg_iterable__user_unsubscribed_channel_tmp"]}, "compiled_path": "target/compiled/iterable/models/staging/stg_iterable__user_unsubscribed_channel.sql", "compiled": true, "compiled_code": "with base as (\n select *\n from \"postgres\".\"public_iterable_dev\".\"stg_iterable__user_unsubscribed_channel_tmp\"\n\n),\n\nfields as (\n\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_iterable/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_iterable/macros/).\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n \n _fivetran_synced as _fivetran_synced,\n _fivetran_id as _fivetran_id,\n channel_id as channel_id,\n cast(null as TEXT) as email,\n cast(null as timestamp) as updated_at\n \n\n\n\n\n \n \n\n\n\n\n\n, cast('postgres.public' as TEXT) as source_relation\n\n\n from base\n),\n\nfinal as (\n\n select\n source_relation,\n cast(_fivetran_id as TEXT ) as _fivetran_user_id,\n coalesce(cast(_fivetran_id as TEXT ), email) as unique_user_key,\n cast(channel_id as TEXT ) as channel_id,\n md5(cast(coalesce(cast(_fivetran_id as TEXT), '_dbt_utils_surrogate_key_null_') || '-' || coalesce(cast(channel_id as TEXT), '_dbt_utils_surrogate_key_null_') || '-' || coalesce(cast(email as TEXT), '_dbt_utils_surrogate_key_null_') || '-' || coalesce(cast(updated_at as TEXT), '_dbt_utils_surrogate_key_null_') || '-' || coalesce(cast(source_relation as TEXT), '_dbt_utils_surrogate_key_null_') as TEXT)) as unsub_channel_unique_key,\n\n \n 1 as latest_batch_index,\n \n\n updated_at,\n _fivetran_synced\n\n from fields\n)\n\n\nselect *\nfrom final", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.stg_iterable__campaign_history": {"database": "postgres", "schema": "public_iterable_dev", "name": "stg_iterable__campaign_history", "resource_type": "model", "package_name": "iterable", "path": "staging/stg_iterable__campaign_history.sql", "original_file_path": "models/staging/stg_iterable__campaign_history.sql", "unique_id": "model.iterable.stg_iterable__campaign_history", "fqn": ["iterable", "staging", "stg_iterable__campaign_history"], "alias": "stg_iterable__campaign_history", "checksum": {"name": "sha256", "checksum": "7e7aecc134f0b697da58c7cd663aadf6de586a55c84369c2a7274811b2bb368b"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "table", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "Table containing a history of campaigns.", "columns": {"source_relation": {"name": "source_relation", "description": "Identifies the record's source.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": ["doc.iterable.source_relation"]}, "campaign_id": {"name": "campaign_id", "description": "Unique identifier of the campaign record", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "updated_at": {"name": "updated_at", "description": "Last update timestamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "campaign_name": {"name": "campaign_name", "description": "User defined name of the campaign.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "campaign_state": {"name": "campaign_state", "description": "State of the campaign. Can be Draft, Ready, Scheduled, Running, Finished, Starting, Aborted or Recurring", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "campaign_type": {"name": "campaign_type", "description": "The campaign type. Can be Blast or Triggered", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "send_size": {"name": "send_size", "description": "Size of the campaign. Number of individuals included in the campaign", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "start_at": {"name": "start_at", "description": "Start timestamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "ended_at": {"name": "ended_at", "description": "Ended timestamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "created_at": {"name": "created_at", "description": "Creation timestamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "recurring_campaign_id": {"name": "recurring_campaign_id", "description": "Reference to the recurring campaign, if applicable", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "created_by_user_id": {"name": "created_by_user_id", "description": "Reference to the user who created the campaign", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "template_id": {"name": "template_id", "description": "Reference to the campaign template", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "updated_by_user_id": {"name": "updated_by_user_id", "description": "ID of the user who updated this record", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "message_medium": {"name": "message_medium", "description": "The medium that this message was sent via, for example Email or InApp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "workflow_id": {"name": "workflow_id", "description": "Reference to the workflow which the event originated", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "The time when a record was last updated by Fivetran.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": ["doc.iterable._fivetran_synced"]}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "iterable://models/staging/stg_iterable.yml", "build_path": null, "unrendered_config": {"materialized": "table", "schema": "iterable_{{ var('directed_schema','dev') }}", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789503446.4743361, "relation_name": "\"postgres\".\"public_iterable_dev\".\"stg_iterable__campaign_history\"", "raw_code": "with base as (\n\n select * \n from {{ ref('stg_iterable__campaign_history_tmp') }}\n\n),\n\nfields as (\n\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_iterable/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_iterable/macros/).\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_iterable__campaign_history_tmp')),\n staging_columns=get_campaign_history_columns()\n )\n }}\n {{ fivetran_utils.apply_source_relation(package_name='iterable') }}\n \n from base\n),\n\nfinal as (\n\n select\n source_relation,\n cast(id as {{ dbt.type_string() }}) as campaign_id,\n updated_at,\n name as campaign_name,\n campaign_state,\n type as campaign_type,\n send_size,\n start_at,\n ended_at,\n created_at,\n message_medium,\n cast(recurring_campaign_id as {{ dbt.type_string() }}) as recurring_campaign_id,\n cast(created_by_user_id as {{ dbt.type_string() }} ) as created_by_user_id,\n cast(updated_by_user_id as {{ dbt.type_string() }} ) as updated_by_user_id,\n cast(template_id as {{ dbt.type_string() }}) as template_id,\n workflow_id,\n _fivetran_synced\n\n from fields\n)\n\nselect * \nfrom final", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__campaign_history_tmp", "package": null, "version": null}, {"name": "stg_iterable__campaign_history_tmp", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.iterable.get_campaign_history_columns", "macro.fivetran_utils.fill_staging_columns", "macro.fivetran_utils.apply_source_relation", "macro.dbt.type_string"], "nodes": ["model.iterable.stg_iterable__campaign_history_tmp"]}, "compiled_path": "target/compiled/iterable/models/staging/stg_iterable__campaign_history.sql", "compiled": true, "compiled_code": "with base as (\n\n select * \n from \"postgres\".\"public_iterable_dev\".\"stg_iterable__campaign_history_tmp\"\n\n),\n\nfields as (\n\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_iterable/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_iterable/macros/).\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n \n _fivetran_synced as _fivetran_synced,\n campaign_state as campaign_state,\n created_at as created_at,\n created_by_user_id as created_by_user_id,\n updated_by_user_id as updated_by_user_id,\n ended_at as ended_at,\n id as id,\n name as name,\n recurring_campaign_id as recurring_campaign_id,\n send_size as send_size,\n start_at as start_at,\n template_id as template_id,\n type as type,\n updated_at as updated_at,\n workflow_id as workflow_id,\n message_medium as message_medium\n \n\n\n\n\n \n \n\n\n\n\n\n, cast('postgres.public' as TEXT) as source_relation\n\n \n from base\n),\n\nfinal as (\n\n select\n source_relation,\n cast(id as TEXT) as campaign_id,\n updated_at,\n name as campaign_name,\n campaign_state,\n type as campaign_type,\n send_size,\n start_at,\n ended_at,\n created_at,\n message_medium,\n cast(recurring_campaign_id as TEXT) as recurring_campaign_id,\n cast(created_by_user_id as TEXT ) as created_by_user_id,\n cast(updated_by_user_id as TEXT ) as updated_by_user_id,\n cast(template_id as TEXT) as template_id,\n workflow_id,\n _fivetran_synced\n\n from fields\n)\n\nselect * \nfrom final", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.stg_iterable__campaign_label_history": {"database": "postgres", "schema": "public_iterable_dev", "name": "stg_iterable__campaign_label_history", "resource_type": "model", "package_name": "iterable", "path": "staging/stg_iterable__campaign_label_history.sql", "original_file_path": "models/staging/stg_iterable__campaign_label_history.sql", "unique_id": "model.iterable.stg_iterable__campaign_label_history", "fqn": ["iterable", "staging", "stg_iterable__campaign_label_history"], "alias": "stg_iterable__campaign_label_history", "checksum": {"name": "sha256", "checksum": "2001c425039c576063482caa3d4a72f39c5cd8aff32ffee63f083977f1f0c35f"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "table", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "Table containing a history of labels.", "columns": {"source_relation": {"name": "source_relation", "description": "Identifies the record's source.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": ["doc.iterable.source_relation"]}, "campaign_id": {"name": "campaign_id", "description": "Reference to the campaign associated with the label", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "label": {"name": "label", "description": "Name of the label", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "updated_at": {"name": "updated_at", "description": "Last update timestamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "The time when a record was last updated by Fivetran.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": ["doc.iterable._fivetran_synced"]}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "iterable://models/staging/stg_iterable.yml", "build_path": null, "unrendered_config": {"materialized": "table", "schema": "iterable_{{ var('directed_schema','dev') }}", "enabled": "var('iterable__using_campaign_label_history', True)", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789503446.4755557, "relation_name": "\"postgres\".\"public_iterable_dev\".\"stg_iterable__campaign_label_history\"", "raw_code": "{{ config(enabled=var('iterable__using_campaign_label_history', True)) }}\n\nwith base as (\n\n select * \n from {{ ref('stg_iterable__campaign_label_history_tmp') }}\n\n),\n\nfields as (\n\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_iterable/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_iterable/macros/).\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_iterable__campaign_label_history_tmp')),\n staging_columns=get_campaign_label_history_columns()\n )\n }}\n {{ fivetran_utils.apply_source_relation(package_name='iterable') }}\n \n from base\n),\n\nfinal as (\n\n select\n source_relation,\n cast(campaign_id as {{ dbt.type_string() }}) as campaign_id,\n label,\n updated_at,\n _fivetran_synced\n from fields\n)\n\nselect * \nfrom final", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__campaign_label_history_tmp", "package": null, "version": null}, {"name": "stg_iterable__campaign_label_history_tmp", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.iterable.get_campaign_label_history_columns", "macro.fivetran_utils.fill_staging_columns", "macro.fivetran_utils.apply_source_relation", "macro.dbt.type_string"], "nodes": ["model.iterable.stg_iterable__campaign_label_history_tmp"]}, "compiled_path": "target/compiled/iterable/models/staging/stg_iterable__campaign_label_history.sql", "compiled": true, "compiled_code": "\n\nwith base as (\n\n select * \n from \"postgres\".\"public_iterable_dev\".\"stg_iterable__campaign_label_history_tmp\"\n\n),\n\nfields as (\n\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_iterable/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_iterable/macros/).\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n \n _fivetran_synced as _fivetran_synced,\n campaign_id as campaign_id,\n label as label,\n updated_at as updated_at\n \n\n\n\n\n \n \n\n\n\n\n\n, cast('postgres.public' as TEXT) as source_relation\n\n \n from base\n),\n\nfinal as (\n\n select\n source_relation,\n cast(campaign_id as TEXT) as campaign_id,\n label,\n updated_at,\n _fivetran_synced\n from fields\n)\n\nselect * \nfrom final", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.stg_iterable__template_history": {"database": "postgres", "schema": "public_iterable_dev", "name": "stg_iterable__template_history", "resource_type": "model", "package_name": "iterable", "path": "staging/stg_iterable__template_history.sql", "original_file_path": "models/staging/stg_iterable__template_history.sql", "unique_id": "model.iterable.stg_iterable__template_history", "fqn": ["iterable", "staging", "stg_iterable__template_history"], "alias": "stg_iterable__template_history", "checksum": {"name": "sha256", "checksum": "f0eaf9d44d7959a04ba079cbf711646772487aeafc89414b097dd5f230b44910"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "table", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "Table containing unique templates used across campaigns.", "columns": {"source_relation": {"name": "source_relation", "description": "Identifies the record's source.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": ["doc.iterable.source_relation"]}, "template_id": {"name": "template_id", "description": "Unique identifier of the template", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "template_name": {"name": "template_name", "description": "User defined name of the template", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "template_type": {"name": "template_type", "description": "The type of the template", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "created_at": {"name": "created_at", "description": "Creation timestamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "client_template_id": {"name": "client_template_id", "description": "Reference to the client template", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "creator_user_id": {"name": "creator_user_id", "description": "Reference to the user who created the template", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "message_type_id": {"name": "message_type_id", "description": "Reference to the message type associated with the template", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "updated_at": {"name": "updated_at", "description": "Last update timestamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "The time when a record was last updated by Fivetran.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": ["doc.iterable._fivetran_synced"]}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "iterable://models/staging/stg_iterable.yml", "build_path": null, "unrendered_config": {"materialized": "table", "schema": "iterable_{{ var('directed_schema','dev') }}", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789503446.4902356, "relation_name": "\"postgres\".\"public_iterable_dev\".\"stg_iterable__template_history\"", "raw_code": "with base as (\n\n select * \n from {{ ref('stg_iterable__template_history_tmp') }}\n\n),\n\nfields as (\n\n select\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_iterable__template_history_tmp')),\n staging_columns=get_template_history_columns()\n )\n }}\n {{ fivetran_utils.apply_source_relation(package_name='iterable') }}\n\n from base\n),\n\nfinal as (\n\n select\n source_relation,\n cast(id as {{ dbt.type_string() }} ) as template_id,\n name as template_name,\n template_type,\n created_at,\n cast(client_template_id as {{ dbt.type_string() }} ) as client_template_id,\n cast(creator_user_id as {{ dbt.type_string() }} ) as creator_user_id,\n cast(message_type_id as {{ dbt.type_string() }} ) as message_type_id,\n updated_at,\n _fivetran_synced\n from fields\n)\n\nselect * \nfrom final", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__template_history_tmp", "package": null, "version": null}, {"name": "stg_iterable__template_history_tmp", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.iterable.get_template_history_columns", "macro.fivetran_utils.fill_staging_columns", "macro.fivetran_utils.apply_source_relation", "macro.dbt.type_string"], "nodes": ["model.iterable.stg_iterable__template_history_tmp"]}, "compiled_path": "target/compiled/iterable/models/staging/stg_iterable__template_history.sql", "compiled": true, "compiled_code": "with base as (\n\n select * \n from \"postgres\".\"public_iterable_dev\".\"stg_iterable__template_history_tmp\"\n\n),\n\nfields as (\n\n select\n \n _fivetran_synced as _fivetran_synced,\n client_template_id as client_template_id,\n created_at as created_at,\n creator_user_id as creator_user_id,\n id as id,\n message_type_id as message_type_id,\n name as name,\n template_type as template_type,\n updated_at as updated_at\n \n\n\n\n\n \n \n\n\n\n\n\n, cast('postgres.public' as TEXT) as source_relation\n\n\n from base\n),\n\nfinal as (\n\n select\n source_relation,\n cast(id as TEXT ) as template_id,\n name as template_name,\n template_type,\n created_at,\n cast(client_template_id as TEXT ) as client_template_id,\n cast(creator_user_id as TEXT ) as creator_user_id,\n cast(message_type_id as TEXT ) as message_type_id,\n updated_at,\n _fivetran_synced\n from fields\n)\n\nselect * \nfrom final", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.stg_iterable__journey": {"database": "postgres", "schema": "public_iterable_dev", "name": "stg_iterable__journey", "resource_type": "model", "package_name": "iterable", "path": "staging/stg_iterable__journey.sql", "original_file_path": "models/staging/stg_iterable__journey.sql", "unique_id": "model.iterable.stg_iterable__journey", "fqn": ["iterable", "staging", "stg_iterable__journey"], "alias": "stg_iterable__journey", "checksum": {"name": "sha256", "checksum": "d53993c3137351b54f560a3e0194593ea0d2787d328e2bc6cfe13977b35a3906"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "table", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "Table containing unique journeys, formerly known as workflows.", "columns": {"source_relation": {"name": "source_relation", "description": "Identifies the record's source.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": ["doc.iterable.source_relation"]}, "journey_id": {"name": "journey_id", "description": "Unique identifier of the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "journey_name": {"name": "journey_name", "description": "User defined name of the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "journey_type": {"name": "journey_type", "description": "Whether the journey is published or a draft", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "journey_description": {"name": "journey_description", "description": "Information about the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "creator_user_id": {"name": "creator_user_id", "description": "Reference to the user who created the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "is_enabled": {"name": "is_enabled", "description": "Boolean indicating if the journey is currently enabled", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "is_archived": {"name": "is_archived", "description": "Boolean indicating if the journey has been archived", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "lifetime_limit": {"name": "lifetime_limit", "description": "Maximum number of times a user may enter the journey over their lifetime", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "simultaneous_limit": {"name": "simultaneous_limit", "description": "Maximum number of times a user may be in the journey at the same time", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "start_tile_id": {"name": "start_tile_id", "description": "Reference to the tile which begins the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "trigger_event_names": {"name": "trigger_event_names", "description": "The event names which trigger a user's entry into the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "created_at": {"name": "created_at", "description": "Creation timestamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "updated_at": {"name": "updated_at", "description": "Last update timestamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "The time when a record was last updated by Fivetran.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": ["doc.iterable._fivetran_synced"]}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "iterable://models/staging/stg_iterable.yml", "build_path": null, "unrendered_config": {"materialized": "table", "schema": "iterable_{{ var('directed_schema','dev') }}", "enabled": "var('iterable__using_journey', True)", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789503446.4840384, "relation_name": "\"postgres\".\"public_iterable_dev\".\"stg_iterable__journey\"", "raw_code": "{{ config(enabled=var('iterable__using_journey', True)) }}\n\n{% set source_columns_in_relation = adapter.get_columns_in_relation(ref('stg_iterable__journey_tmp')) %}\n\nwith base as (\n\n select *\n from {{ ref('stg_iterable__journey_tmp') }}\n\n),\n\nfields as (\n\n select\n\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=source_columns_in_relation,\n staging_columns=get_journey_columns()\n )\n }}\n {{ fivetran_utils.apply_source_relation(package_name='iterable') }}\n\n from base\n),\n\nfinal as (\n\n select\n source_relation,\n cast(id as {{ dbt.type_string() }} ) as journey_id,\n name as journey_name,\n journey_type,\n description as journey_description,\n cast(creator_user_id as {{ dbt.type_string() }} ) as creator_user_id,\n enabled as is_enabled,\n is_archived,\n lifetime_limit,\n simultaneous_limit,\n cast(start_tile_id as {{ dbt.type_string() }} ) as start_tile_id,\n {{ iterable.json_to_string(\"trigger_event_names\", source_columns_in_relation) }} as trigger_event_names,\n created_at,\n updated_at,\n _fivetran_synced\n\n --The below script allows for pass through columns.\n {{ fivetran_utils.fill_pass_through_columns('iterable_journey_pass_through_columns') }}\n\n from fields\n where not coalesce(_fivetran_deleted, false)\n)\n\nselect *\nfrom final", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__journey_tmp", "package": null, "version": null}, {"name": "stg_iterable__journey_tmp", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.iterable.get_journey_columns", "macro.fivetran_utils.fill_staging_columns", "macro.fivetran_utils.apply_source_relation", "macro.dbt.type_string", "macro.iterable.json_to_string", "macro.fivetran_utils.fill_pass_through_columns"], "nodes": ["model.iterable.stg_iterable__journey_tmp"]}, "compiled_path": "target/compiled/iterable/models/staging/stg_iterable__journey.sql", "compiled": true, "compiled_code": "\n\n\n\nwith base as (\n\n select *\n from \"postgres\".\"public_iterable_dev\".\"stg_iterable__journey_tmp\"\n\n),\n\nfields as (\n\n select\n\n \n _fivetran_deleted as _fivetran_deleted,\n _fivetran_synced as _fivetran_synced,\n created_at as created_at,\n creator_user_id as creator_user_id,\n description as description,\n enabled as enabled,\n id as id,\n is_archived as is_archived,\n journey_type as journey_type,\n lifetime_limit as lifetime_limit,\n name as name,\n simultaneous_limit as simultaneous_limit,\n start_tile_id as start_tile_id,\n trigger_event_names as trigger_event_names,\n updated_at as updated_at\n \n\n\n\n\n \n \n\n\n\n\n\n, cast('postgres.public' as TEXT) as source_relation\n\n\n from base\n),\n\nfinal as (\n\n select\n source_relation,\n cast(id as TEXT ) as journey_id,\n name as journey_name,\n journey_type,\n description as journey_description,\n cast(creator_user_id as TEXT ) as creator_user_id,\n enabled as is_enabled,\n is_archived,\n lifetime_limit,\n simultaneous_limit,\n cast(start_tile_id as TEXT ) as start_tile_id,\n cast(trigger_event_names as TEXT) as trigger_event_names,\n created_at,\n updated_at,\n _fivetran_synced\n\n --The below script allows for pass through columns.\n \n\n\n\n\n\n from fields\n where not coalesce(_fivetran_deleted, false)\n)\n\nselect *\nfrom final", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.stg_iterable__user_history": {"database": "postgres", "schema": "public_iterable_dev", "name": "stg_iterable__user_history", "resource_type": "model", "package_name": "iterable", "path": "staging/stg_iterable__user_history.sql", "original_file_path": "models/staging/stg_iterable__user_history.sql", "unique_id": "model.iterable.stg_iterable__user_history", "fqn": ["iterable", "staging", "stg_iterable__user_history"], "alias": "stg_iterable__user_history", "checksum": {"name": "sha256", "checksum": "632b1ddaf71b0cb861ae314c40c6a68a25371b8646d2fa2334c4eb7149227251"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "Table containing individual user history information.", "columns": {"source_relation": {"name": "source_relation", "description": "Identifies the record's source.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": ["doc.iterable.source_relation"]}, "unique_user_key": {"name": "unique_user_key", "description": "The unique identifier of the user. With the new schema (Aug 2023), it is the _fivetran_user_id. This is a hash of user_id and/or email, depending on project type. If using the old schema, it is email.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "email": {"name": "email", "description": "The user's email. User identifier, for email-based projects. Previously was the unique identifier for user records, for the old Iterable schema before the August 2023 updates.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "user_id": {"name": "user_id", "description": "User identifier, for userID-based projects.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "first_name": {"name": "first_name", "description": "First name of the user", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "last_name": {"name": "last_name", "description": "Last name of the user", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "email_list_ids": {"name": "email_list_ids", "description": "[DEPRECATED October 13, 2025. Use LIST_USER source instead.] Array of references to the lists associated with the user.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "signup_date": {"name": "signup_date", "description": "Timestamp of when the user signed up", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "signup_source": {"name": "signup_source", "description": "Source where the user signed up", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "updated_at": {"name": "updated_at", "description": "Last update timestamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "phone_number": {"name": "phone_number", "description": "Phone number associated with the user", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "iterable_user_id": {"name": "iterable_user_id", "description": "Another user identifier, for userID-based projects", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "_fivetran_user_id": {"name": "_fivetran_user_id", "description": "A Fivetran-created unique identifier for users, derived from hashing user_id and/or email, depending on project type. This exists for users of the new schema starting Aug 2023. In the old schema, the unique identifier is email.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "The time when a record was last updated by Fivetran.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": ["doc.iterable._fivetran_synced"]}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "iterable://models/staging/stg_iterable.yml", "build_path": null, "unrendered_config": {"materialized": "view", "schema": "iterable_{{ var('directed_schema','dev') }}", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789503446.4931817, "relation_name": "\"postgres\".\"public_iterable_dev\".\"stg_iterable__user_history\"", "raw_code": "{{ config(materialized='view') }}\n{% set source_columns_in_relation = adapter.get_columns_in_relation(ref('stg_iterable__user_history_tmp')) %}\n\n\nwith base as (\n\n select * \n from {{ ref('stg_iterable__user_history_tmp') }}\n\n),\n\nfields as (\n\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_iterable/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_iterable/macros/).\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=source_columns_in_relation,\n staging_columns=get_user_history_columns()\n )\n }}\n {{ fivetran_utils.apply_source_relation(package_name='iterable') }}\n\n from base\n),\n\nfinal as (\n\n select\n source_relation,\n cast(_fivetran_id as {{ dbt.type_string() }} ) as _fivetran_user_id,\n lower(email) as email,\n updated_at,\n cast(user_id as {{ dbt.type_string() }} ) as user_id,\n first_name,\n last_name,\n {{ iterable.json_to_string(\"email_list_ids\", source_columns_in_relation) }} as email_list_ids,\n phone_number,\n signup_date,\n signup_source,\n cast(iterable_user_id as {{ dbt.type_string() }} ) as iterable_user_id,\n _fivetran_synced,\n coalesce(cast(_fivetran_id as {{ dbt.type_string() }} ) , email) as unique_user_key\n\n {{ fivetran_utils.fill_pass_through_columns('iterable_user_history_pass_through_columns') }}\n\n from fields\n)\n\nselect *\nfrom final", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__user_history_tmp", "package": null, "version": null}, {"name": "stg_iterable__user_history_tmp", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.iterable.get_user_history_columns", "macro.fivetran_utils.fill_staging_columns", "macro.fivetran_utils.apply_source_relation", "macro.dbt.type_string", "macro.iterable.json_to_string", "macro.fivetran_utils.fill_pass_through_columns"], "nodes": ["model.iterable.stg_iterable__user_history_tmp"]}, "compiled_path": "target/compiled/iterable/models/staging/stg_iterable__user_history.sql", "compiled": true, "compiled_code": "\n\n\n\nwith base as (\n\n select * \n from \"postgres\".\"public_iterable_dev\".\"stg_iterable__user_history_tmp\"\n\n),\n\nfields as (\n\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_iterable/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_iterable/macros/).\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n \n cast(null as TEXT) as _fivetran_id,\n _fivetran_synced as _fivetran_synced,\n email as email,\n email_list_ids as email_list_ids,\n first_name as first_name,\n last_name as last_name,\n phone_number as phone_number,\n signup_date as signup_date,\n signup_source as signup_source,\n updated_at as updated_at,\n user_id as user_id,\n iterable_user_id as iterable_user_id\n \n\n\n\n\n \n \n\n\n\n\n\n, cast('postgres.public' as TEXT) as source_relation\n\n\n from base\n),\n\nfinal as (\n\n select\n source_relation,\n cast(_fivetran_id as TEXT ) as _fivetran_user_id,\n lower(email) as email,\n updated_at,\n cast(user_id as TEXT ) as user_id,\n first_name,\n last_name,\n cast(email_list_ids as TEXT) as email_list_ids,\n phone_number,\n signup_date,\n signup_source,\n cast(iterable_user_id as TEXT ) as iterable_user_id,\n _fivetran_synced,\n coalesce(cast(_fivetran_id as TEXT ) , email) as unique_user_key\n\n \n\n\n\n\n\n from fields\n)\n\nselect *\nfrom final", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.stg_iterable__user_unsub_message_type": {"database": "postgres", "schema": "public_iterable_dev", "name": "stg_iterable__user_unsub_message_type", "resource_type": "model", "package_name": "iterable", "path": "staging/stg_iterable__user_unsub_message_type.sql", "original_file_path": "models/staging/stg_iterable__user_unsub_message_type.sql", "unique_id": "model.iterable.stg_iterable__user_unsub_message_type", "fqn": ["iterable", "staging", "stg_iterable__user_unsub_message_type"], "alias": "stg_iterable__user_unsub_message_type", "checksum": {"name": "sha256", "checksum": "82bd48604365ec4a7a3309f2ce007e169add2c902675e5d1da155edc32a6bb71"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "table", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "Table containing the message types from which a user has unsubscribed. \"Unsubscribed\" is shortened to \"unsub\" for postgres compatibility.", "columns": {"source_relation": {"name": "source_relation", "description": "Identifies the record's source.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": ["doc.iterable.source_relation"]}, "message_type_id": {"name": "message_type_id", "description": "Reference to the message type from which the user unsubscribed", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unsub_message_type_unique_key": {"name": "unsub_message_type_unique_key", "description": "A surrogate key providing a unique key for each record. If using user_unsubscribed_message_type_history, it uses '_fivetran_id', 'email', 'message_type_id', 'updated_at', and 'source_relation'. If not using the history table, it uses '_fivetran_id', 'message_type_id', and 'source_relation'.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "_fivetran_user_id": {"name": "_fivetran_user_id", "description": "A Fivetran-created unique identifier for users, derived from hashing user_id and/or email, depending on project type. This exists for users of the new schema starting Aug 2023. In the old schema, the unique identifier is email.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_user_key": {"name": "unique_user_key", "description": "The unique identifier of the user. With the new schema (Aug 2023), it is the _fivetran_user_id. This is a hash of user_id and/or email, depending on project type. If using the old schema, it is email.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "latest_batch_index": {"name": "latest_batch_index", "description": "Indexes each user record based on the most recent available.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "updated_at": {"name": "updated_at", "description": "Last update timestamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "The time when a record was last updated by Fivetran.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": ["doc.iterable._fivetran_synced"]}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "iterable://models/staging/stg_iterable.yml", "build_path": null, "unrendered_config": {"materialized": "table", "schema": "iterable_{{ var('directed_schema','dev') }}", "enabled": "var('iterable__using_user_unsubscribed_message_type', True)", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789503446.496223, "relation_name": "\"postgres\".\"public_iterable_dev\".\"stg_iterable__user_unsub_message_type\"", "raw_code": "{{ config(enabled=var('iterable__using_user_unsubscribed_message_type', True)) }}\n\nwith base as (\n\n select * \n from {{ ref('stg_iterable__user_unsub_message_type_tmp') }}\n\n),\n\nfields as (\n\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_iterable/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_iterable/macros/).\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_iterable__user_unsub_message_type_tmp')),\n staging_columns=get_user_unsubscribed_message_type_columns()\n )\n }}\n {{ fivetran_utils.apply_source_relation(package_name='iterable') }}\n\n from base\n),\n\nfinal as (\n\n select\n source_relation,\n cast(_fivetran_id as {{ dbt.type_string() }} ) as _fivetran_user_id,\n coalesce(cast(_fivetran_id as {{ dbt.type_string() }} ), email) as unique_user_key,\n cast(message_type_id as {{ dbt.type_string() }} ) as message_type_id,\n {{ dbt_utils.generate_surrogate_key(['_fivetran_id', 'email', 'message_type_id','updated_at','source_relation']) }} as unsub_message_type_unique_key,\n\n {% if does_table_exist('user_unsubscribed_message_type') == false %}\n rank() over(partition by email, message_type_id{{ fivetran_utils.partition_by_source_relation(package_name='iterable') }} order by updated_at desc) as latest_batch_index,\n {% else %}\n 1 as latest_batch_index,\n {% endif %}\n\n updated_at,\n _fivetran_synced\n\n from fields\n)\n\nselect *\nfrom final", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__user_unsub_message_type_tmp", "package": null, "version": null}, {"name": "stg_iterable__user_unsub_message_type_tmp", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.iterable.get_user_unsubscribed_message_type_columns", "macro.fivetran_utils.fill_staging_columns", "macro.fivetran_utils.apply_source_relation", "macro.dbt.type_string", "macro.dbt_utils.generate_surrogate_key", "macro.iterable.does_table_exist"], "nodes": ["model.iterable.stg_iterable__user_unsub_message_type_tmp"]}, "compiled_path": "target/compiled/iterable/models/staging/stg_iterable__user_unsub_message_type.sql", "compiled": true, "compiled_code": "\n\nwith base as (\n\n select * \n from \"postgres\".\"public_iterable_dev\".\"stg_iterable__user_unsub_message_type_tmp\"\n\n),\n\nfields as (\n\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_iterable/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_iterable/macros/).\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n \n _fivetran_synced as _fivetran_synced,\n _fivetran_id as _fivetran_id,\n message_type_id as message_type_id,\n cast(null as TEXT) as email,\n cast(null as timestamp) as updated_at\n \n\n\n\n\n \n \n\n\n\n\n\n, cast('postgres.public' as TEXT) as source_relation\n\n\n from base\n),\n\nfinal as (\n\n select\n source_relation,\n cast(_fivetran_id as TEXT ) as _fivetran_user_id,\n coalesce(cast(_fivetran_id as TEXT ), email) as unique_user_key,\n cast(message_type_id as TEXT ) as message_type_id,\n md5(cast(coalesce(cast(_fivetran_id as TEXT), '_dbt_utils_surrogate_key_null_') || '-' || coalesce(cast(email as TEXT), '_dbt_utils_surrogate_key_null_') || '-' || coalesce(cast(message_type_id as TEXT), '_dbt_utils_surrogate_key_null_') || '-' || coalesce(cast(updated_at as TEXT), '_dbt_utils_surrogate_key_null_') || '-' || coalesce(cast(source_relation as TEXT), '_dbt_utils_surrogate_key_null_') as TEXT)) as unsub_message_type_unique_key,\n\n \n 1 as latest_batch_index,\n \n\n updated_at,\n _fivetran_synced\n\n from fields\n)\n\nselect *\nfrom final", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.stg_iterable__list": {"database": "postgres", "schema": "public_iterable_dev", "name": "stg_iterable__list", "resource_type": "model", "package_name": "iterable", "path": "staging/stg_iterable__list.sql", "original_file_path": "models/staging/stg_iterable__list.sql", "unique_id": "model.iterable.stg_iterable__list", "fqn": ["iterable", "staging", "stg_iterable__list"], "alias": "stg_iterable__list", "checksum": {"name": "sha256", "checksum": "b2a6869e5186282b7f5c8173ecba41c0324c1dc31df78db2418f51f2578eaa21"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "table", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "Table containing users and the lists the users are associated with.", "columns": {"source_relation": {"name": "source_relation", "description": "Identifies the record's source.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": ["doc.iterable.source_relation"]}, "list_id": {"name": "list_id", "description": "Unique identifier of the list", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "list_name": {"name": "list_name", "description": "User defined name of the list", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "list_type": {"name": "list_type", "description": "The list type", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "created_at": {"name": "created_at", "description": "Creation timestamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "list_description": {"name": "list_description", "description": "Information about the list", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "The time when a record was last updated by Fivetran.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": ["doc.iterable._fivetran_synced"]}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "iterable://models/staging/stg_iterable.yml", "build_path": null, "unrendered_config": {"materialized": "table", "schema": "iterable_{{ var('directed_schema','dev') }}", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789503446.4853036, "relation_name": "\"postgres\".\"public_iterable_dev\".\"stg_iterable__list\"", "raw_code": "with base as (\n\n select * \n from {{ ref('stg_iterable__list_tmp') }}\n\n),\n\nfields as (\n\n select\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_iterable__list_tmp')),\n staging_columns=get_list_columns()\n )\n }}\n {{ fivetran_utils.apply_source_relation(package_name='iterable') }}\n \n from base\n),\n\nfinal as (\n\n select\n source_relation,\n id as list_id,\n name as list_name,\n list_type,\n created_at,\n description as list_description,\n _fivetran_synced\n from fields\n where not coalesce(_fivetran_deleted, true)\n)\n\nselect * \nfrom final", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__list_tmp", "package": null, "version": null}, {"name": "stg_iterable__list_tmp", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.iterable.get_list_columns", "macro.fivetran_utils.fill_staging_columns", "macro.fivetran_utils.apply_source_relation"], "nodes": ["model.iterable.stg_iterable__list_tmp"]}, "compiled_path": "target/compiled/iterable/models/staging/stg_iterable__list.sql", "compiled": true, "compiled_code": "with base as (\n\n select * \n from \"postgres\".\"public_iterable_dev\".\"stg_iterable__list_tmp\"\n\n),\n\nfields as (\n\n select\n \n _fivetran_deleted as _fivetran_deleted,\n _fivetran_synced as _fivetran_synced,\n created_at as created_at,\n id as id,\n list_type as list_type,\n description as description,\n name as name\n \n\n\n\n\n \n \n\n\n\n\n\n, cast('postgres.public' as TEXT) as source_relation\n\n \n from base\n),\n\nfinal as (\n\n select\n source_relation,\n id as list_id,\n name as list_name,\n list_type,\n created_at,\n description as list_description,\n _fivetran_synced\n from fields\n where not coalesce(_fivetran_deleted, true)\n)\n\nselect * \nfrom final", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.stg_iterable__list_user": {"database": "postgres", "schema": "public_iterable_dev", "name": "stg_iterable__list_user", "resource_type": "model", "package_name": "iterable", "path": "staging/stg_iterable__list_user.sql", "original_file_path": "models/staging/stg_iterable__list_user.sql", "unique_id": "model.iterable.stg_iterable__list_user", "fqn": ["iterable", "staging", "stg_iterable__list_user"], "alias": "stg_iterable__list_user", "checksum": {"name": "sha256", "checksum": "f3fe66e05562725c91948ac2023c649573560043aa82c03fe93f6232f6600954"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "table", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "Table containing the relationship between users and lists they belong to.", "columns": {"source_relation": {"name": "source_relation", "description": "Identifies the record's source.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": ["doc.iterable.source_relation"]}, "_fivetran_user_id": {"name": "_fivetran_user_id", "description": "Unique identifier of the list-user relationship record, serving as a foreign key to `stg_iterable__user_history._fivetran_id`.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "list_user_index": {"name": "list_user_index", "description": "Index of the record", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "list_id": {"name": "list_id", "description": "Reference to the list that the user belongs to", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "The time when a record was last updated by Fivetran.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": ["doc.iterable._fivetran_synced"]}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "iterable://models/staging/stg_iterable.yml", "build_path": null, "unrendered_config": {"materialized": "table", "schema": "iterable_{{ var('directed_schema','dev') }}", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789503446.4915621, "relation_name": "\"postgres\".\"public_iterable_dev\".\"stg_iterable__list_user\"", "raw_code": "{% set source_columns_in_relation = adapter.get_columns_in_relation(ref('stg_iterable__list_user_tmp')) %}\n\nwith base as (\n\n select *\n from {{ ref('stg_iterable__list_user_tmp') }}\n\n),\n\nfields as (\n\n select\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=source_columns_in_relation,\n staging_columns=get_list_user_columns()\n )\n }}\n {{ fivetran_utils.apply_source_relation(package_name='iterable') }}\n\n from base\n),\n\nfinal as (\n\n select\n source_relation,\n cast(_fivetran_id as {{ dbt.type_string() }} ) as _fivetran_user_id,\n index as list_user_index,\n list_id,\n _fivetran_synced\n\n from fields\n)\n\nselect *\nfrom final", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__list_user_tmp", "package": null, "version": null}, {"name": "stg_iterable__list_user_tmp", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.iterable.get_list_user_columns", "macro.fivetran_utils.fill_staging_columns", "macro.fivetran_utils.apply_source_relation", "macro.dbt.type_string"], "nodes": ["model.iterable.stg_iterable__list_user_tmp"]}, "compiled_path": "target/compiled/iterable/models/staging/stg_iterable__list_user.sql", "compiled": true, "compiled_code": "\n\nwith base as (\n\n select *\n from \"postgres\".\"public_iterable_dev\".\"stg_iterable__list_user_tmp\"\n\n),\n\nfields as (\n\n select\n \n _fivetran_id as _fivetran_id,\n _fivetran_synced as _fivetran_synced,\n index as index,\n list_id as list_id\n \n\n\n\n\n \n \n\n\n\n\n\n, cast('postgres.public' as TEXT) as source_relation\n\n\n from base\n),\n\nfinal as (\n\n select\n source_relation,\n cast(_fivetran_id as TEXT ) as _fivetran_user_id,\n index as list_user_index,\n list_id,\n _fivetran_synced\n\n from fields\n)\n\nselect *\nfrom final", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.stg_iterable__campaign_suppression_list_history": {"database": "postgres", "schema": "public_iterable_dev", "name": "stg_iterable__campaign_suppression_list_history", "resource_type": "model", "package_name": "iterable", "path": "staging/stg_iterable__campaign_suppression_list_history.sql", "original_file_path": "models/staging/stg_iterable__campaign_suppression_list_history.sql", "unique_id": "model.iterable.stg_iterable__campaign_suppression_list_history", "fqn": ["iterable", "staging", "stg_iterable__campaign_suppression_list_history"], "alias": "stg_iterable__campaign_suppression_list_history", "checksum": {"name": "sha256", "checksum": "695d57ff7cf14d55ef6881ee9184e873c2cdc7fd61bfd9fbb0cb3330fe055ae0"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "table", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "Table containing a history of suppression lists.", "columns": {"source_relation": {"name": "source_relation", "description": "Identifies the record's source.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": ["doc.iterable.source_relation"]}, "campaign_id": {"name": "campaign_id", "description": "Reference to the campaign associated with the label", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "suppressed_list_id": {"name": "suppressed_list_id", "description": "Reference to the list used", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "updated_at": {"name": "updated_at", "description": "Last update timestamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "The time when a record was last updated by Fivetran.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": ["doc.iterable._fivetran_synced"]}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "iterable://models/staging/stg_iterable.yml", "build_path": null, "unrendered_config": {"materialized": "table", "schema": "iterable_{{ var('directed_schema','dev') }}", "enabled": "var('iterable__using_campaign_suppression_list_history', True)", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789503446.4776623, "relation_name": "\"postgres\".\"public_iterable_dev\".\"stg_iterable__campaign_suppression_list_history\"", "raw_code": "{{ config(enabled=var('iterable__using_campaign_suppression_list_history', True)) }}\n\nwith base as (\n\n select * \n from {{ ref('stg_iterable__campaign_suppression_list_history_tmp') }}\n\n),\n\nfields as (\n\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_iterable/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_iterable/macros/).\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_iterable__campaign_suppression_list_history_tmp')),\n staging_columns=get_campaign_suppression_list_history_columns()\n )\n }}\n {{ fivetran_utils.apply_source_relation(package_name='iterable') }}\n\n from base\n),\n\nfinal as (\n\n select\n source_relation,\n cast(campaign_id as {{ dbt.type_string() }}) as campaign_id,\n cast(suppressed_list_id as {{ dbt.type_string() }}) as suppressed_list_id,\n updated_at,\n _fivetran_synced\n from fields\n)\n\nselect * \nfrom final", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__campaign_suppression_list_history_tmp", "package": null, "version": null}, {"name": "stg_iterable__campaign_suppression_list_history_tmp", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.iterable.get_campaign_suppression_list_history_columns", "macro.fivetran_utils.fill_staging_columns", "macro.fivetran_utils.apply_source_relation", "macro.dbt.type_string"], "nodes": ["model.iterable.stg_iterable__campaign_suppression_list_history_tmp"]}, "compiled_path": "target/compiled/iterable/models/staging/stg_iterable__campaign_suppression_list_history.sql", "compiled": true, "compiled_code": "\n\nwith base as (\n\n select * \n from \"postgres\".\"public_iterable_dev\".\"stg_iterable__campaign_suppression_list_history_tmp\"\n\n),\n\nfields as (\n\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_iterable/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_iterable/macros/).\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n \n _fivetran_synced as _fivetran_synced,\n campaign_id as campaign_id,\n suppressed_list_id as suppressed_list_id,\n updated_at as updated_at\n \n\n\n\n\n \n \n\n\n\n\n\n, cast('postgres.public' as TEXT) as source_relation\n\n\n from base\n),\n\nfinal as (\n\n select\n source_relation,\n cast(campaign_id as TEXT) as campaign_id,\n cast(suppressed_list_id as TEXT) as suppressed_list_id,\n updated_at,\n _fivetran_synced\n from fields\n)\n\nselect * \nfrom final", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.stg_iterable__event_extension": {"database": "postgres", "schema": "public_iterable_dev", "name": "stg_iterable__event_extension", "resource_type": "model", "package_name": "iterable", "path": "staging/stg_iterable__event_extension.sql", "original_file_path": "models/staging/stg_iterable__event_extension.sql", "unique_id": "model.iterable.stg_iterable__event_extension", "fqn": ["iterable", "staging", "stg_iterable__event_extension"], "alias": "stg_iterable__event_extension", "checksum": {"name": "sha256", "checksum": "006d3abf1fe12ef7312b3f02d07a13a483883e57acfe0fceedb3e6a9f71372ff"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "Table containing addition properties from the event table.", "columns": {"source_relation": {"name": "source_relation", "description": "Identifies the record's source.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": ["doc.iterable.source_relation"]}, "event_id": {"name": "event_id", "description": "A Fivetran-created unique identifier derived from hashing campaign_id, created_at, and event_name.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unique_event_id": {"name": "unique_event_id", "description": "A surrogate key made up of event_id, _fivetran_user_id, and source_relation.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "is_app_already_running": {"name": "is_app_already_running", "description": "Boolean indicating if the app is currently running or not", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "badge": {"name": "badge", "description": "Badge associated with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "canonical_url_id": {"name": "canonical_url_id", "description": "Reference to the url associated with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "is_content_available": {"name": "is_content_available", "description": "Content available from the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "content_id": {"name": "content_id", "description": "Reference to the content associated with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "device": {"name": "device", "description": "The device associated with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "email_id": {"name": "email_id", "description": "Reference to the email associated with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "email_subject": {"name": "email_subject", "description": "Subject of the email associated with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "experiment_id": {"name": "experiment_id", "description": "Reference to the experiment used if the event is an experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "from_phone_number_id": {"name": "from_phone_number_id", "description": "Reference to the phone number which the event is from", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "from_smssender_id": {"name": "from_smssender_id", "description": "Reference to the sms sender which the event is from", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "link_id": {"name": "link_id", "description": "Reference to the link associated with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "link_url": {"name": "link_url", "description": "Url of the link associated with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "locale": {"name": "locale", "description": "Locale associated with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "payload": {"name": "payload", "description": "Payload resulted from the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "platform_endpoint": {"name": "platform_endpoint", "description": "The specific platform endpoint of the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "push_message": {"name": "push_message", "description": "Boolean indicating if the event is a push message", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "region": {"name": "region", "description": "Region of the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "sms_message": {"name": "sms_message", "description": "Boolean indicating if the event is an sms message", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "to_phone_number": {"name": "to_phone_number", "description": "To phone number associated with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "url": {"name": "url", "description": "Url associated with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "workflow_id": {"name": "workflow_id", "description": "Reference to the workflow which the event originated", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "workflow_name": {"name": "workflow_name", "description": "Name of the workflow which the event originated", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "catalog_collection_count": {"name": "catalog_collection_count", "description": "The count of products or items collected in a catalog associated with the event.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "catalog_lookup_count": {"name": "catalog_lookup_count", "description": "The count of times a catalog was looked up or queried during the event.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "city": {"name": "city", "description": "The city associated with the event, which could be the location of the recipient.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "clicked_url": {"name": "clicked_url", "description": "The URL that was clicked by the recipient in response to the marketing message.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "country": {"name": "country", "description": "The country associated with the event, which could be the location of the recipient.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "error_code": {"name": "error_code", "description": "The error code or message indicating any issues or errors encountered during the event.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "expires_at": {"name": "expires_at", "description": "The date and time when the event or message is set to expire or become invalid.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "from_phone_number": {"name": "from_phone_number", "description": "The phone number from which the SMS message was sent.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "in_app_body": {"name": "in_app_body", "description": "The content or body of an in-app message that was sent as part of the event.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "is_sms_estimation": {"name": "is_sms_estimation", "description": "A boolean indicating whether the SMS message is an estimation or not.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "labels": {"name": "labels", "description": "Any labels or tags associated with the event, which can be used for categorization or organization.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "message_status": {"name": "message_status", "description": "The status of the marketing message, such as sent, delivered, opened, etc.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "mms_send_count": {"name": "mms_send_count", "description": "The count of multimedia messages (MMS) sent as part of the event.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "reason": {"name": "reason", "description": "The reason or cause associated with a specific event or action.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "sms_send_count": {"name": "sms_send_count", "description": "The count of SMS messages sent as part of the event.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "_fivetran_user_id": {"name": "_fivetran_user_id", "description": "A Fivetran-created unique identifier for users, derived from hashing user_id and/or email, depending on project type. This exists for users of the new schema starting Aug 2023. In the old schema, the unique identifier is email.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "The time when a record was last updated by Fivetran.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": ["doc.iterable._fivetran_synced"]}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "iterable://models/staging/stg_iterable.yml", "build_path": null, "unrendered_config": {"materialized": "view", "schema": "iterable_{{ var('directed_schema','dev') }}", "enabled": "var('iterable__using_event_extension', True)", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789503446.4827368, "relation_name": "\"postgres\".\"public_iterable_dev\".\"stg_iterable__event_extension\"", "raw_code": "{{ config(\n enabled=var('iterable__using_event_extension', True),\n materialized='view'\n) }}\n\nwith base as (\n\n select * \n from {{ ref('stg_iterable__event_extension_tmp') }}\n\n),\n\nfields as (\n\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_iterable/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_iterable/macros/).\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_iterable__event_extension_tmp')),\n staging_columns=get_event_extension_columns()\n )\n }}\n {{ fivetran_utils.apply_source_relation(package_name='iterable') }}\n\n from base\n),\n\nfinal as (\n select\n source_relation,\n cast(_fivetran_id as {{ dbt.type_string() }} ) as event_id,\n {{ dbt_utils.generate_surrogate_key(['_fivetran_id','_fivetran_user_id','source_relation']) }} as unique_event_id,\n app_already_running as is_app_already_running,\n badge,\n catalog_collection_count,\n catalog_lookup_count,\n cast(canonical_url_id as {{ dbt.type_string() }} ) as canonical_url_id,\n content_available as is_content_available,\n cast(content_id as {{ dbt.type_string() }} ) as content_id,\n device,\n cast(email_id as {{ dbt.type_string() }}) as email_id,\n email_subject,\n experiment_id,\n from_phone_number_id,\n from_smssender_id,\n cast(link_id as {{ dbt.type_string() }} ) as link_id,\n link_url,\n locale,\n payload,\n platform_endpoint,\n push_message,\n region,\n sms_message,\n to_phone_number,\n url,\n cast(workflow_id as {{ dbt.type_string() }} ) as workflow_id,\n workflow_name,\n city,\n clicked_url,\n country,\n error_code,\n expires_at,\n from_phone_number,\n in_app_body,\n is_sms_estimation,\n labels,\n message_status,\n mms_send_count,\n reason,\n sms_send_count,\n _fivetran_synced,\n cast(_fivetran_user_id as {{ dbt.type_string() }} ) as _fivetran_user_id\n\n --The below script allows for pass through columns.\n {{ fivetran_utils.fill_pass_through_columns('iterable_event_extension_pass_through_columns') }}\n\n from fields\n)\n\nselect *\nfrom final", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__event_extension_tmp", "package": null, "version": null}, {"name": "stg_iterable__event_extension_tmp", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.iterable.get_event_extension_columns", "macro.fivetran_utils.fill_staging_columns", "macro.fivetran_utils.apply_source_relation", "macro.dbt.type_string", "macro.dbt_utils.generate_surrogate_key", "macro.fivetran_utils.fill_pass_through_columns"], "nodes": ["model.iterable.stg_iterable__event_extension_tmp"]}, "compiled_path": "target/compiled/iterable/models/staging/stg_iterable__event_extension.sql", "compiled": true, "compiled_code": "\n\nwith base as (\n\n select * \n from \"postgres\".\"public_iterable_dev\".\"stg_iterable__event_extension_tmp\"\n\n),\n\nfields as (\n\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_iterable/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_iterable/macros/).\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n \n _fivetran_id as _fivetran_id,\n _fivetran_synced as _fivetran_synced,\n app_already_running as app_already_running,\n badge as badge,\n catalog_collection_count as catalog_collection_count,\n catalog_lookup_count as catalog_lookup_count,\n canonical_url_id as canonical_url_id,\n content_available as content_available,\n content_id as content_id,\n device as device,\n email_id as email_id,\n email_subject as email_subject,\n experiment_id as experiment_id,\n from_phone_number_id as from_phone_number_id,\n from_smssender_id as from_smssender_id,\n link_id as link_id,\n link_url as link_url,\n locale as locale,\n payload as payload,\n platform_endpoint as platform_endpoint,\n push_message as push_message,\n region as region,\n sms_message as sms_message,\n to_phone_number as to_phone_number,\n url as url,\n workflow_id as workflow_id,\n workflow_name as workflow_name,\n city as city,\n clicked_url as clicked_url,\n country as country,\n error_code as error_code,\n expires_at as expires_at,\n from_phone_number as from_phone_number,\n in_app_body as in_app_body,\n is_sms_estimation as is_sms_estimation,\n labels as labels,\n message_status as message_status,\n mms_send_count as mms_send_count,\n reason as reason,\n sms_send_count as sms_send_count,\n _fivetran_user_id as _fivetran_user_id\n \n\n\n\n\n \n \n\n\n\n\n\n, cast('postgres.public' as TEXT) as source_relation\n\n\n from base\n),\n\nfinal as (\n select\n source_relation,\n cast(_fivetran_id as TEXT ) as event_id,\n md5(cast(coalesce(cast(_fivetran_id as TEXT), '_dbt_utils_surrogate_key_null_') || '-' || coalesce(cast(_fivetran_user_id as TEXT), '_dbt_utils_surrogate_key_null_') || '-' || coalesce(cast(source_relation as TEXT), '_dbt_utils_surrogate_key_null_') as TEXT)) as unique_event_id,\n app_already_running as is_app_already_running,\n badge,\n catalog_collection_count,\n catalog_lookup_count,\n cast(canonical_url_id as TEXT ) as canonical_url_id,\n content_available as is_content_available,\n cast(content_id as TEXT ) as content_id,\n device,\n cast(email_id as TEXT) as email_id,\n email_subject,\n experiment_id,\n from_phone_number_id,\n from_smssender_id,\n cast(link_id as TEXT ) as link_id,\n link_url,\n locale,\n payload,\n platform_endpoint,\n push_message,\n region,\n sms_message,\n to_phone_number,\n url,\n cast(workflow_id as TEXT ) as workflow_id,\n workflow_name,\n city,\n clicked_url,\n country,\n error_code,\n expires_at,\n from_phone_number,\n in_app_body,\n is_sms_estimation,\n labels,\n message_status,\n mms_send_count,\n reason,\n sms_send_count,\n _fivetran_synced,\n cast(_fivetran_user_id as TEXT ) as _fivetran_user_id\n\n --The below script allows for pass through columns.\n \n\n\n\n\n\n from fields\n)\n\nselect *\nfrom final", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.stg_iterable__campaign_list_history": {"database": "postgres", "schema": "public_iterable_dev", "name": "stg_iterable__campaign_list_history", "resource_type": "model", "package_name": "iterable", "path": "staging/stg_iterable__campaign_list_history.sql", "original_file_path": "models/staging/stg_iterable__campaign_list_history.sql", "unique_id": "model.iterable.stg_iterable__campaign_list_history", "fqn": ["iterable", "staging", "stg_iterable__campaign_list_history"], "alias": "stg_iterable__campaign_list_history", "checksum": {"name": "sha256", "checksum": "c7db9c46a66fec00d9fbd6492c0ea17397ec80a12d85fa2d63b9f04f09c45013"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "table", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "Table containing a history of lists.", "columns": {"source_relation": {"name": "source_relation", "description": "Identifies the record's source.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": ["doc.iterable.source_relation"]}, "campaign_id": {"name": "campaign_id", "description": "Reference to the campaign associated with the label", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "list_id": {"name": "list_id", "description": "Reference to the list used", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "updated_at": {"name": "updated_at", "description": "Last update timestamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "The time when a record was last updated by Fivetran.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": ["doc.iterable._fivetran_synced"]}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "iterable://models/staging/stg_iterable.yml", "build_path": null, "unrendered_config": {"materialized": "table", "schema": "iterable_{{ var('directed_schema','dev') }}", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789503446.4763973, "relation_name": "\"postgres\".\"public_iterable_dev\".\"stg_iterable__campaign_list_history\"", "raw_code": "with base as (\n\n select * \n from {{ ref('stg_iterable__campaign_list_history_tmp') }}\n\n),\n\nfields as (\n\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_iterable/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_iterable/macros/).\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_iterable__campaign_list_history_tmp')),\n staging_columns=get_campaign_list_history_columns()\n )\n }}\n {{ fivetran_utils.apply_source_relation(package_name='iterable') }}\n \n from base\n),\n\nfinal as (\n\n select\n source_relation,\n cast(campaign_id as {{ dbt.type_string() }}) as campaign_id,\n cast(list_id as {{ dbt.type_string() }}) as list_id,\n updated_at,\n _fivetran_synced\n from fields\n)\n\nselect * \nfrom final", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__campaign_list_history_tmp", "package": null, "version": null}, {"name": "stg_iterable__campaign_list_history_tmp", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.iterable.get_campaign_list_history_columns", "macro.fivetran_utils.fill_staging_columns", "macro.fivetran_utils.apply_source_relation", "macro.dbt.type_string"], "nodes": ["model.iterable.stg_iterable__campaign_list_history_tmp"]}, "compiled_path": "target/compiled/iterable/models/staging/stg_iterable__campaign_list_history.sql", "compiled": true, "compiled_code": "with base as (\n\n select * \n from \"postgres\".\"public_iterable_dev\".\"stg_iterable__campaign_list_history_tmp\"\n\n),\n\nfields as (\n\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_iterable/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_iterable/macros/).\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n \n _fivetran_synced as _fivetran_synced,\n campaign_id as campaign_id,\n list_id as list_id,\n updated_at as updated_at\n \n\n\n\n\n \n \n\n\n\n\n\n, cast('postgres.public' as TEXT) as source_relation\n\n \n from base\n),\n\nfinal as (\n\n select\n source_relation,\n cast(campaign_id as TEXT) as campaign_id,\n cast(list_id as TEXT) as list_id,\n updated_at,\n _fivetran_synced\n from fields\n)\n\nselect * \nfrom final", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.stg_iterable__channel": {"database": "postgres", "schema": "public_iterable_dev", "name": "stg_iterable__channel", "resource_type": "model", "package_name": "iterable", "path": "staging/stg_iterable__channel.sql", "original_file_path": "models/staging/stg_iterable__channel.sql", "unique_id": "model.iterable.stg_iterable__channel", "fqn": ["iterable", "staging", "stg_iterable__channel"], "alias": "stg_iterable__channel", "checksum": {"name": "sha256", "checksum": "1ade77557691cabd1c65676182adaf401d8dde9ee42a6918d1ea7a124159cbf2"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "table", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "Table containing unique channels.", "columns": {"source_relation": {"name": "source_relation", "description": "Identifies the record's source.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": ["doc.iterable.source_relation"]}, "channel_id": {"name": "channel_id", "description": "Unique identifier of the channel", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "channel_name": {"name": "channel_name", "description": "User defined name of the channel", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "channel_type": {"name": "channel_type", "description": "The channel type", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "message_medium": {"name": "message_medium", "description": "The message medium associated with the channel", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "The time when a record was last updated by Fivetran.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": ["doc.iterable._fivetran_synced"]}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "iterable://models/staging/stg_iterable.yml", "build_path": null, "unrendered_config": {"materialized": "table", "schema": "iterable_{{ var('directed_schema','dev') }}", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789503446.4785326, "relation_name": "\"postgres\".\"public_iterable_dev\".\"stg_iterable__channel\"", "raw_code": "with base as (\n\n select *\n from {{ ref('stg_iterable__channel_tmp') }}\n\n),\n\nfields as (\n\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns\n that are expected/needed (staging_columns from dbt_iterable/models/tmp/) and compares it with columns\n in the source (source_columns from dbt_iterable/macros/).\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_iterable__channel_tmp')),\n staging_columns=get_channel_columns()\n )\n }}\n {{ fivetran_utils.apply_source_relation(package_name='iterable') }}\n\n from base\n\n),\n\nfinal as (\n\n select\n source_relation,\n cast(id as {{ dbt.type_string() }} ) as channel_id,\n name as channel_name,\n channel_type,\n message_medium,\n _fivetran_synced\n\n from fields\n where not coalesce(_fivetran_deleted, false)\n)\n\nselect * \nfrom final", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__channel_tmp", "package": null, "version": null}, {"name": "stg_iterable__channel_tmp", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.iterable.get_channel_columns", "macro.fivetran_utils.fill_staging_columns", "macro.fivetran_utils.apply_source_relation", "macro.dbt.type_string"], "nodes": ["model.iterable.stg_iterable__channel_tmp"]}, "compiled_path": "target/compiled/iterable/models/staging/stg_iterable__channel.sql", "compiled": true, "compiled_code": "with base as (\n\n select *\n from \"postgres\".\"public_iterable_dev\".\"stg_iterable__channel_tmp\"\n\n),\n\nfields as (\n\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns\n that are expected/needed (staging_columns from dbt_iterable/models/tmp/) and compares it with columns\n in the source (source_columns from dbt_iterable/macros/).\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n \n _fivetran_deleted as _fivetran_deleted,\n _fivetran_synced as _fivetran_synced,\n channel_type as channel_type,\n id as id,\n message_medium as message_medium,\n name as name\n \n\n\n\n\n \n \n\n\n\n\n\n, cast('postgres.public' as TEXT) as source_relation\n\n\n from base\n\n),\n\nfinal as (\n\n select\n source_relation,\n cast(id as TEXT ) as channel_id,\n name as channel_name,\n channel_type,\n message_medium,\n _fivetran_synced\n\n from fields\n where not coalesce(_fivetran_deleted, false)\n)\n\nselect * \nfrom final", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.stg_iterable__message_type_tmp": {"database": "postgres", "schema": "public_iterable_dev", "name": "stg_iterable__message_type_tmp", "resource_type": "model", "package_name": "iterable", "path": "staging/tmp/stg_iterable__message_type_tmp.sql", "original_file_path": "models/staging/tmp/stg_iterable__message_type_tmp.sql", "unique_id": "model.iterable.stg_iterable__message_type_tmp", "fqn": ["iterable", "staging", "tmp", "stg_iterable__message_type_tmp"], "alias": "stg_iterable__message_type_tmp", "checksum": {"name": "sha256", "checksum": "fda7a978e7b71b46f37e4878898c6655526f0531d36f74968c7bbb56ec4200e5"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"materialized": "view", "schema": "iterable_{{ var('directed_schema','dev') }}", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789503445.8091335, "relation_name": "\"postgres\".\"public_iterable_dev\".\"stg_iterable__message_type_tmp\"", "raw_code": "{{\n fivetran_utils.union_connections(\n connection_dictionary='iterable_sources',\n single_source_name='iterable',\n single_table_name='message_type'\n )\n}}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["iterable", "message_type"], ["iterable", "message_type"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.fivetran_utils.union_connections"], "nodes": ["source.iterable.iterable.message_type"]}, "compiled_path": "target/compiled/iterable/models/staging/tmp/stg_iterable__message_type_tmp.sql", "compiled": true, "compiled_code": "\n\n\n-- ** Values passed to adapter.get_relation:\n -- full-identifier_var: iterable_message_type_identifier\n -- database: postgres \n -- schema: public\n -- identifier: message_type_data\n\n\n select\n \"id\",\n \"name\",\n \"channel_id\",\n \"_fivetran_deleted\",\n \"_fivetran_synced\",\n \"created_at\",\n \"frequency_cap\",\n \"rate_limit_per_minute\",\n \"subscription_policy\",\n \"updated_at\"\n from \"postgres\".\"public\".\"message_type_data\" as source_table\n\n ", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.stg_iterable__event_extension_tmp": {"database": "postgres", "schema": "public_iterable_dev", "name": "stg_iterable__event_extension_tmp", "resource_type": "model", "package_name": "iterable", "path": "staging/tmp/stg_iterable__event_extension_tmp.sql", "original_file_path": "models/staging/tmp/stg_iterable__event_extension_tmp.sql", "unique_id": "model.iterable.stg_iterable__event_extension_tmp", "fqn": ["iterable", "staging", "tmp", "stg_iterable__event_extension_tmp"], "alias": "stg_iterable__event_extension_tmp", "checksum": {"name": "sha256", "checksum": "09d92da24c5304acbb0f0ebc81fe49e70458d1319cb1c2090f5f9ce0b87ecb29"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"materialized": "view", "schema": "iterable_{{ var('directed_schema','dev') }}", "enabled": "var('iterable__using_event_extension', True)", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789503445.8338664, "relation_name": "\"postgres\".\"public_iterable_dev\".\"stg_iterable__event_extension_tmp\"", "raw_code": "{{ config(enabled=var('iterable__using_event_extension', True)) }}\n\n{{\n fivetran_utils.union_connections(\n connection_dictionary='iterable_sources',\n single_source_name='iterable',\n single_table_name='event_extension'\n )\n}}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["iterable", "event_extension"], ["iterable", "event_extension"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.fivetran_utils.union_connections"], "nodes": ["source.iterable.iterable.event_extension"]}, "compiled_path": "target/compiled/iterable/models/staging/tmp/stg_iterable__event_extension_tmp.sql", "compiled": true, "compiled_code": "\n\n\n\n\n-- ** Values passed to adapter.get_relation:\n -- full-identifier_var: iterable_event_extension_identifier\n -- database: postgres \n -- schema: public\n -- identifier: event_extension_data\n\n\n select\n \"_fivetran_id\",\n \"app_already_running\",\n \"badge\",\n \"canonical_url_id\",\n \"content_available\",\n \"content_id\",\n \"device\",\n \"email_id\",\n \"email_subject\",\n \"experiment_id\",\n \"from_phone_number_id\",\n \"from_smssender_id\",\n \"image_url\",\n \"is_ghost_push\",\n \"link_id\",\n \"link_url\",\n \"platform_endpoint\",\n \"push_message\",\n \"region\",\n \"sms_message\",\n \"sound\",\n \"to_phone_number\",\n \"url\",\n \"workflow_id\",\n \"workflow_name\",\n \"locale\",\n \"deeplink_android\",\n \"deeplink_ios\",\n \"payload\",\n \"sms_provider_response_status\",\n \"sms_provider_response_message\",\n \"sms_provider_response_code\",\n \"sms_provider_response_more_info\",\n \"_fivetran_synced\",\n \"catalog_collection_count\",\n \"catalog_lookup_count\",\n \"city\",\n \"clicked_url\",\n \"country\",\n \"error_code\",\n \"expires_at\",\n \"from_phone_number\",\n \"in_app_body\",\n \"is_sms_estimation\",\n \"labels\",\n \"message_context\",\n \"message_status\",\n \"mms_send_count\",\n \"product_recommendation_count\",\n \"proxy_source\",\n \"reason\",\n \"sms_send_count\",\n \"web_push_body\",\n \"web_push_click_action\",\n \"web_push_icon\",\n \"web_push_message\",\n \"_fivetran_user_id\"\n from \"postgres\".\"public\".\"event_extension_data\" as source_table\n\n ", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.stg_iterable__user_unsub_message_type_tmp": {"database": "postgres", "schema": "public_iterable_dev", "name": "stg_iterable__user_unsub_message_type_tmp", "resource_type": "model", "package_name": "iterable", "path": "staging/tmp/stg_iterable__user_unsub_message_type_tmp.sql", "original_file_path": "models/staging/tmp/stg_iterable__user_unsub_message_type_tmp.sql", "unique_id": "model.iterable.stg_iterable__user_unsub_message_type_tmp", "fqn": ["iterable", "staging", "tmp", "stg_iterable__user_unsub_message_type_tmp"], "alias": "stg_iterable__user_unsub_message_type_tmp", "checksum": {"name": "sha256", "checksum": "ddb46e159ed22f011676fbe7e00ba9271a493bc5185d286261ae30fa0b183636"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"materialized": "view", "schema": "iterable_{{ var('directed_schema','dev') }}", "enabled": "var('iterable__using_user_unsubscribed_message_type', True)", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789503445.842114, "relation_name": "\"postgres\".\"public_iterable_dev\".\"stg_iterable__user_unsub_message_type_tmp\"", "raw_code": "{{ config(enabled=var('iterable__using_user_unsubscribed_message_type', True)) }}\n\n{{\n fivetran_utils.union_connections(\n connection_dictionary='iterable_sources',\n single_source_name='iterable',\n single_table_name='user_unsubscribed_message_type' if does_table_exist('user_unsubscribed_message_type') else 'user_unsubscribed_message_type_history'\n )\n}}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["iterable", "user_unsubscribed_message_type_history"], ["iterable", "user_unsubscribed_message_type_history"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.iterable.does_table_exist", "macro.fivetran_utils.union_connections"], "nodes": ["source.iterable.iterable.user_unsubscribed_message_type_history"]}, "compiled_path": "target/compiled/iterable/models/staging/tmp/stg_iterable__user_unsub_message_type_tmp.sql", "compiled": true, "compiled_code": "\n\n\n\n\n-- ** Values passed to adapter.get_relation:\n -- full-identifier_var: iterable_user_unsubscribed_message_type_identifier\n -- database: postgres \n -- schema: public\n -- identifier: user_unsubscribed_message_type_data\n\n\n select\n \"_fivetran_id\",\n \"message_type_id\",\n \"_fivetran_synced\"\n from \"postgres\".\"public\".\"user_unsubscribed_message_type_data\" as source_table\n\n ", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.stg_iterable__campaign_list_history_tmp": {"database": "postgres", "schema": "public_iterable_dev", "name": "stg_iterable__campaign_list_history_tmp", "resource_type": "model", "package_name": "iterable", "path": "staging/tmp/stg_iterable__campaign_list_history_tmp.sql", "original_file_path": "models/staging/tmp/stg_iterable__campaign_list_history_tmp.sql", "unique_id": "model.iterable.stg_iterable__campaign_list_history_tmp", "fqn": ["iterable", "staging", "tmp", "stg_iterable__campaign_list_history_tmp"], "alias": "stg_iterable__campaign_list_history_tmp", "checksum": {"name": "sha256", "checksum": "c26b6a07e1d280b2d5dea6ddbff02200d527e798d8af0a8105be30c0e7d013f7"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"materialized": "view", "schema": "iterable_{{ var('directed_schema','dev') }}", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789503445.8507566, "relation_name": "\"postgres\".\"public_iterable_dev\".\"stg_iterable__campaign_list_history_tmp\"", "raw_code": "{{\n fivetran_utils.union_connections(\n connection_dictionary='iterable_sources',\n single_source_name='iterable',\n single_table_name='campaign_list_history'\n )\n}}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["iterable", "campaign_list_history"], ["iterable", "campaign_list_history"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.fivetran_utils.union_connections"], "nodes": ["source.iterable.iterable.campaign_list_history"]}, "compiled_path": "target/compiled/iterable/models/staging/tmp/stg_iterable__campaign_list_history_tmp.sql", "compiled": true, "compiled_code": "\n\n\n-- ** Values passed to adapter.get_relation:\n -- full-identifier_var: iterable_campaign_list_history_identifier\n -- database: postgres \n -- schema: public\n -- identifier: campaign_list_history_data\n\n\n select\n \"list_id\",\n \"campaign_id\",\n \"updated_at\",\n \"_fivetran_synced\"\n from \"postgres\".\"public\".\"campaign_list_history_data\" as source_table\n\n ", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.stg_iterable__list_user_tmp": {"database": "postgres", "schema": "public_iterable_dev", "name": "stg_iterable__list_user_tmp", "resource_type": "model", "package_name": "iterable", "path": "staging/tmp/stg_iterable__list_user_tmp.sql", "original_file_path": "models/staging/tmp/stg_iterable__list_user_tmp.sql", "unique_id": "model.iterable.stg_iterable__list_user_tmp", "fqn": ["iterable", "staging", "tmp", "stg_iterable__list_user_tmp"], "alias": "stg_iterable__list_user_tmp", "checksum": {"name": "sha256", "checksum": "5c8b455013c26cfd4094b38e210edeb911a22dc0f05544e65fb48c350c2725fe"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"materialized": "view", "schema": "iterable_{{ var('directed_schema','dev') }}", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789503445.8577416, "relation_name": "\"postgres\".\"public_iterable_dev\".\"stg_iterable__list_user_tmp\"", "raw_code": "{{\n fivetran_utils.union_connections(\n connection_dictionary='iterable_sources',\n single_source_name='iterable',\n single_table_name='list_user'\n )\n}}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["iterable", "list_user"], ["iterable", "list_user"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.fivetran_utils.union_connections"], "nodes": ["source.iterable.iterable.list_user"]}, "compiled_path": "target/compiled/iterable/models/staging/tmp/stg_iterable__list_user_tmp.sql", "compiled": true, "compiled_code": "\n\n\n-- ** Values passed to adapter.get_relation:\n -- full-identifier_var: iterable_list_user_identifier\n -- database: postgres \n -- schema: public\n -- identifier: list_user_data\n\n\n select\n \"_fivetran_id\",\n \"index\",\n \"list_id\",\n \"_fivetran_synced\"\n from \"postgres\".\"public\".\"list_user_data\" as source_table\n\n ", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.stg_iterable__user_history_tmp": {"database": "postgres", "schema": "public_iterable_dev", "name": "stg_iterable__user_history_tmp", "resource_type": "model", "package_name": "iterable", "path": "staging/tmp/stg_iterable__user_history_tmp.sql", "original_file_path": "models/staging/tmp/stg_iterable__user_history_tmp.sql", "unique_id": "model.iterable.stg_iterable__user_history_tmp", "fqn": ["iterable", "staging", "tmp", "stg_iterable__user_history_tmp"], "alias": "stg_iterable__user_history_tmp", "checksum": {"name": "sha256", "checksum": "cc04d0fbef9ff5cd4f72ae66c9cffd316c5e134ecd81dc216dcf682b34eb587b"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"materialized": "view", "schema": "iterable_{{ var('directed_schema','dev') }}", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789503445.8653522, "relation_name": "\"postgres\".\"public_iterable_dev\".\"stg_iterable__user_history_tmp\"", "raw_code": "{{\n fivetran_utils.union_connections(\n connection_dictionary='iterable_sources',\n single_source_name='iterable',\n single_table_name='user_history'\n )\n}}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["iterable", "user_history"], ["iterable", "user_history"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.fivetran_utils.union_connections"], "nodes": ["source.iterable.iterable.user_history"]}, "compiled_path": "target/compiled/iterable/models/staging/tmp/stg_iterable__user_history_tmp.sql", "compiled": true, "compiled_code": "\n\n\n-- ** Values passed to adapter.get_relation:\n -- full-identifier_var: iterable_user_history_identifier\n -- database: postgres \n -- schema: public\n -- identifier: user_history_data\n\n\n select\n \"email\",\n \"updated_at\",\n \"first_name\",\n \"last_name\",\n \"phone_number\",\n \"user_id\",\n \"signup_date\",\n \"signup_source\",\n \"phone_number_carrier\",\n \"phone_number_country_code_iso\",\n \"phone_number_line_type\",\n \"phone_number_updated_at\",\n \"_fivetran_synced\",\n \"email_list_ids\",\n \"iterable_user_id\"\n from \"postgres\".\"public\".\"user_history_data\" as source_table\n\n ", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.stg_iterable__campaign_history_tmp": {"database": "postgres", "schema": "public_iterable_dev", "name": "stg_iterable__campaign_history_tmp", "resource_type": "model", "package_name": "iterable", "path": "staging/tmp/stg_iterable__campaign_history_tmp.sql", "original_file_path": "models/staging/tmp/stg_iterable__campaign_history_tmp.sql", "unique_id": "model.iterable.stg_iterable__campaign_history_tmp", "fqn": ["iterable", "staging", "tmp", "stg_iterable__campaign_history_tmp"], "alias": "stg_iterable__campaign_history_tmp", "checksum": {"name": "sha256", "checksum": "a37ade72efad4e5d8b38cc0548f4a4c79d38a4a337ce71f236581bda47f94696"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"materialized": "view", "schema": "iterable_{{ var('directed_schema','dev') }}", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789503445.872387, "relation_name": "\"postgres\".\"public_iterable_dev\".\"stg_iterable__campaign_history_tmp\"", "raw_code": "{{\n fivetran_utils.union_connections(\n connection_dictionary='iterable_sources',\n single_source_name='iterable',\n single_table_name='campaign_history'\n )\n}}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["iterable", "campaign_history"], ["iterable", "campaign_history"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.fivetran_utils.union_connections"], "nodes": ["source.iterable.iterable.campaign_history"]}, "compiled_path": "target/compiled/iterable/models/staging/tmp/stg_iterable__campaign_history_tmp.sql", "compiled": true, "compiled_code": "\n\n\n-- ** Values passed to adapter.get_relation:\n -- full-identifier_var: iterable_campaign_history_identifier\n -- database: postgres \n -- schema: public\n -- identifier: campaign_history_data\n\n\n select\n \"id\",\n \"updated_at\",\n \"template_id\",\n \"recurring_campaign_id\",\n \"campaign_state\",\n \"created_at\",\n \"created_by_user_id\",\n \"ended_at\",\n \"name\",\n \"send_size\",\n \"start_at\",\n \"type\",\n \"workflow_id\",\n \"_fivetran_synced\",\n \"updated_by_user_id\",\n \"message_medium\"\n from \"postgres\".\"public\".\"campaign_history_data\" as source_table\n\n ", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.stg_iterable__template_history_tmp": {"database": "postgres", "schema": "public_iterable_dev", "name": "stg_iterable__template_history_tmp", "resource_type": "model", "package_name": "iterable", "path": "staging/tmp/stg_iterable__template_history_tmp.sql", "original_file_path": "models/staging/tmp/stg_iterable__template_history_tmp.sql", "unique_id": "model.iterable.stg_iterable__template_history_tmp", "fqn": ["iterable", "staging", "tmp", "stg_iterable__template_history_tmp"], "alias": "stg_iterable__template_history_tmp", "checksum": {"name": "sha256", "checksum": "b37299e696c1cd6388ad85a4042f9b8a5364b969e7c4fdb42f03e4c4803e9a7f"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"materialized": "view", "schema": "iterable_{{ var('directed_schema','dev') }}", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789503445.8794386, "relation_name": "\"postgres\".\"public_iterable_dev\".\"stg_iterable__template_history_tmp\"", "raw_code": "{{\n fivetran_utils.union_connections(\n connection_dictionary='iterable_sources',\n single_source_name='iterable',\n single_table_name='template_history'\n )\n}}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["iterable", "template_history"], ["iterable", "template_history"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.fivetran_utils.union_connections"], "nodes": ["source.iterable.iterable.template_history"]}, "compiled_path": "target/compiled/iterable/models/staging/tmp/stg_iterable__template_history_tmp.sql", "compiled": true, "compiled_code": "\n\n\n-- ** Values passed to adapter.get_relation:\n -- full-identifier_var: iterable_template_history_identifier\n -- database: postgres \n -- schema: public\n -- identifier: template_history_data\n\n\n select\n \"id\",\n \"updated_at\",\n \"message_type_id\",\n \"client_template_id\",\n \"created_at\",\n \"creator_user_id\",\n \"name\",\n \"template_type\",\n \"_fivetran_synced\"\n from \"postgres\".\"public\".\"template_history_data\" as source_table\n\n ", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.stg_iterable__event_tmp": {"database": "postgres", "schema": "public_iterable_dev", "name": "stg_iterable__event_tmp", "resource_type": "model", "package_name": "iterable", "path": "staging/tmp/stg_iterable__event_tmp.sql", "original_file_path": "models/staging/tmp/stg_iterable__event_tmp.sql", "unique_id": "model.iterable.stg_iterable__event_tmp", "fqn": ["iterable", "staging", "tmp", "stg_iterable__event_tmp"], "alias": "stg_iterable__event_tmp", "checksum": {"name": "sha256", "checksum": "31555eb22bfca797c1f1a4f1503da21f7620762d199e7e32b2d268c03e139f65"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"materialized": "view", "schema": "iterable_{{ var('directed_schema','dev') }}", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789503445.8864737, "relation_name": "\"postgres\".\"public_iterable_dev\".\"stg_iterable__event_tmp\"", "raw_code": "{{\n fivetran_utils.union_connections(\n connection_dictionary='iterable_sources',\n single_source_name='iterable',\n single_table_name='event'\n )\n}}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["iterable", "event"], ["iterable", "event"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.fivetran_utils.union_connections"], "nodes": ["source.iterable.iterable.event"]}, "compiled_path": "target/compiled/iterable/models/staging/tmp/stg_iterable__event_tmp.sql", "compiled": true, "compiled_code": "\n\n\n-- ** Values passed to adapter.get_relation:\n -- full-identifier_var: iterable_event_identifier\n -- database: postgres \n -- schema: public\n -- identifier: event_data\n\n\n select\n \"_fivetran_id\",\n \"email\",\n \"campaign_id\",\n \"message_id\",\n \"content_id\",\n \"created_at\",\n \"event_name\",\n \"ip\",\n \"message_bus_id\",\n \"message_type_id\",\n \"recipient_state\",\n \"status\",\n \"unsub_source\",\n \"user_agent\",\n \"user_agent_device\",\n \"transactional_data\",\n \"additional_properties\",\n \"_fivetran_synced\",\n \"_fivetran_user_id\"\n from \"postgres\".\"public\".\"event_data\" as source_table\n\n ", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.stg_iterable__journey_tmp": {"database": "postgres", "schema": "public_iterable_dev", "name": "stg_iterable__journey_tmp", "resource_type": "model", "package_name": "iterable", "path": "staging/tmp/stg_iterable__journey_tmp.sql", "original_file_path": "models/staging/tmp/stg_iterable__journey_tmp.sql", "unique_id": "model.iterable.stg_iterable__journey_tmp", "fqn": ["iterable", "staging", "tmp", "stg_iterable__journey_tmp"], "alias": "stg_iterable__journey_tmp", "checksum": {"name": "sha256", "checksum": "9e10fed335359755ce1488a7df46c9bfd4a08b029e757c4e81c8c2f8cce28961"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"materialized": "view", "schema": "iterable_{{ var('directed_schema','dev') }}", "enabled": "var('iterable__using_journey', True)", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789503445.893542, "relation_name": "\"postgres\".\"public_iterable_dev\".\"stg_iterable__journey_tmp\"", "raw_code": "{{ config(enabled=var('iterable__using_journey', True)) }}\n\n{{\n fivetran_utils.union_connections(\n connection_dictionary='iterable_sources',\n single_source_name='iterable',\n single_table_name='journey'\n )\n}}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["iterable", "journey"], ["iterable", "journey"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.fivetran_utils.union_connections"], "nodes": ["source.iterable.iterable.journey"]}, "compiled_path": "target/compiled/iterable/models/staging/tmp/stg_iterable__journey_tmp.sql", "compiled": true, "compiled_code": "\n\n\n\n\n-- ** Values passed to adapter.get_relation:\n -- full-identifier_var: iterable_journey_identifier\n -- database: postgres \n -- schema: public\n -- identifier: journey_data\n\n\n select\n \"id\",\n \"name\",\n \"journey_type\",\n \"description\",\n \"creator_user_id\",\n \"enabled\",\n \"is_archived\",\n \"lifetime_limit\",\n \"simultaneous_limit\",\n \"start_tile_id\",\n \"trigger_event_names\",\n \"created_at\",\n \"updated_at\",\n \"_fivetran_deleted\",\n \"_fivetran_synced\",\n \"draft_name\"\n from \"postgres\".\"public\".\"journey_data\" as source_table\n\n ", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.stg_iterable__campaign_suppression_list_history_tmp": {"database": "postgres", "schema": "public_iterable_dev", "name": "stg_iterable__campaign_suppression_list_history_tmp", "resource_type": "model", "package_name": "iterable", "path": "staging/tmp/stg_iterable__campaign_suppression_list_history_tmp.sql", "original_file_path": "models/staging/tmp/stg_iterable__campaign_suppression_list_history_tmp.sql", "unique_id": "model.iterable.stg_iterable__campaign_suppression_list_history_tmp", "fqn": ["iterable", "staging", "tmp", "stg_iterable__campaign_suppression_list_history_tmp"], "alias": "stg_iterable__campaign_suppression_list_history_tmp", "checksum": {"name": "sha256", "checksum": "3c5a325cac70574f2defa9fa09b436c03a3fe8a3dede5729ca95451b410d636c"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"materialized": "view", "schema": "iterable_{{ var('directed_schema','dev') }}", "enabled": "var('iterable__using_campaign_suppression_list_history', True)", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789503445.901649, "relation_name": "\"postgres\".\"public_iterable_dev\".\"stg_iterable__campaign_suppression_list_history_tmp\"", "raw_code": "{{ config(enabled=var('iterable__using_campaign_suppression_list_history', True)) }}\n\n{{\n fivetran_utils.union_connections(\n connection_dictionary='iterable_sources',\n single_source_name='iterable',\n single_table_name='campaign_suppression_list_history'\n )\n}}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["iterable", "campaign_suppression_list_history"], ["iterable", "campaign_suppression_list_history"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.fivetran_utils.union_connections"], "nodes": ["source.iterable.iterable.campaign_suppression_list_history"]}, "compiled_path": "target/compiled/iterable/models/staging/tmp/stg_iterable__campaign_suppression_list_history_tmp.sql", "compiled": true, "compiled_code": "\n\n\n\n\n-- ** Values passed to adapter.get_relation:\n -- full-identifier_var: iterable_campaign_suppression_list_history_identifier\n -- database: postgres \n -- schema: public\n -- identifier: campaign_suppression_list_history_data\n\n\n select\n \"suppressed_list_id\",\n \"campaign_id\",\n \"updated_at\",\n \"_fivetran_synced\"\n from \"postgres\".\"public\".\"campaign_suppression_list_history_data\" as source_table\n\n ", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.stg_iterable__campaign_label_history_tmp": {"database": "postgres", "schema": "public_iterable_dev", "name": "stg_iterable__campaign_label_history_tmp", "resource_type": "model", "package_name": "iterable", "path": "staging/tmp/stg_iterable__campaign_label_history_tmp.sql", "original_file_path": "models/staging/tmp/stg_iterable__campaign_label_history_tmp.sql", "unique_id": "model.iterable.stg_iterable__campaign_label_history_tmp", "fqn": ["iterable", "staging", "tmp", "stg_iterable__campaign_label_history_tmp"], "alias": "stg_iterable__campaign_label_history_tmp", "checksum": {"name": "sha256", "checksum": "08e70c9938c895459cabba65b1992d360775e26ea2b8275e408bcf21e814bd58"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"materialized": "view", "schema": "iterable_{{ var('directed_schema','dev') }}", "enabled": "var('iterable__using_campaign_label_history', True)", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789503445.9098628, "relation_name": "\"postgres\".\"public_iterable_dev\".\"stg_iterable__campaign_label_history_tmp\"", "raw_code": "{{ config(enabled=var('iterable__using_campaign_label_history', True)) }}\n\n{{\n fivetran_utils.union_connections(\n connection_dictionary='iterable_sources',\n single_source_name='iterable',\n single_table_name='campaign_label_history'\n )\n}}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["iterable", "campaign_label_history"], ["iterable", "campaign_label_history"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.fivetran_utils.union_connections"], "nodes": ["source.iterable.iterable.campaign_label_history"]}, "compiled_path": "target/compiled/iterable/models/staging/tmp/stg_iterable__campaign_label_history_tmp.sql", "compiled": true, "compiled_code": "\n\n\n\n\n-- ** Values passed to adapter.get_relation:\n -- full-identifier_var: iterable_campaign_label_history_identifier\n -- database: postgres \n -- schema: public\n -- identifier: campaign_label_history_data\n\n\n select\n \"campaign_id\",\n \"label\",\n \"updated_at\",\n \"_fivetran_synced\"\n from \"postgres\".\"public\".\"campaign_label_history_data\" as source_table\n\n ", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.stg_iterable__list_tmp": {"database": "postgres", "schema": "public_iterable_dev", "name": "stg_iterable__list_tmp", "resource_type": "model", "package_name": "iterable", "path": "staging/tmp/stg_iterable__list_tmp.sql", "original_file_path": "models/staging/tmp/stg_iterable__list_tmp.sql", "unique_id": "model.iterable.stg_iterable__list_tmp", "fqn": ["iterable", "staging", "tmp", "stg_iterable__list_tmp"], "alias": "stg_iterable__list_tmp", "checksum": {"name": "sha256", "checksum": "95fbbf63205ef9000c19e76270c8ab96e23c4f9d8072f3892a08f20648a42b5a"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"materialized": "view", "schema": "iterable_{{ var('directed_schema','dev') }}", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789503445.9178252, "relation_name": "\"postgres\".\"public_iterable_dev\".\"stg_iterable__list_tmp\"", "raw_code": "{{\n fivetran_utils.union_connections(\n connection_dictionary='iterable_sources',\n single_source_name='iterable',\n single_table_name='list'\n )\n}}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["iterable", "list"], ["iterable", "list"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.fivetran_utils.union_connections"], "nodes": ["source.iterable.iterable.list"]}, "compiled_path": "target/compiled/iterable/models/staging/tmp/stg_iterable__list_tmp.sql", "compiled": true, "compiled_code": "\n\n\n-- ** Values passed to adapter.get_relation:\n -- full-identifier_var: iterable_list_identifier\n -- database: postgres \n -- schema: public\n -- identifier: list_data\n\n\n select\n \"id\",\n \"name\",\n \"created_at\",\n \"list_type\",\n \"_fivetran_deleted\",\n \"_fivetran_synced\",\n \"description\"\n from \"postgres\".\"public\".\"list_data\" as source_table\n\n ", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.stg_iterable__channel_tmp": {"database": "postgres", "schema": "public_iterable_dev", "name": "stg_iterable__channel_tmp", "resource_type": "model", "package_name": "iterable", "path": "staging/tmp/stg_iterable__channel_tmp.sql", "original_file_path": "models/staging/tmp/stg_iterable__channel_tmp.sql", "unique_id": "model.iterable.stg_iterable__channel_tmp", "fqn": ["iterable", "staging", "tmp", "stg_iterable__channel_tmp"], "alias": "stg_iterable__channel_tmp", "checksum": {"name": "sha256", "checksum": "0516bc3567b725378b33829b8c3e7dc1b6680922f2d1e7824a913b82ca617905"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"materialized": "view", "schema": "iterable_{{ var('directed_schema','dev') }}", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789503445.9248748, "relation_name": "\"postgres\".\"public_iterable_dev\".\"stg_iterable__channel_tmp\"", "raw_code": "{{\n fivetran_utils.union_connections(\n connection_dictionary='iterable_sources',\n single_source_name='iterable',\n single_table_name='channel'\n )\n}}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["iterable", "channel"], ["iterable", "channel"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.fivetran_utils.union_connections"], "nodes": ["source.iterable.iterable.channel"]}, "compiled_path": "target/compiled/iterable/models/staging/tmp/stg_iterable__channel_tmp.sql", "compiled": true, "compiled_code": "\n\n\n-- ** Values passed to adapter.get_relation:\n -- full-identifier_var: iterable_channel_identifier\n -- database: postgres \n -- schema: public\n -- identifier: channel_data\n\n\n select\n \"id\",\n \"name\",\n \"channel_type\",\n \"message_medium\",\n \"_fivetran_deleted\",\n \"_fivetran_synced\"\n from \"postgres\".\"public\".\"channel_data\" as source_table\n\n ", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "model.iterable.stg_iterable__user_unsubscribed_channel_tmp": {"database": "postgres", "schema": "public_iterable_dev", "name": "stg_iterable__user_unsubscribed_channel_tmp", "resource_type": "model", "package_name": "iterable", "path": "staging/tmp/stg_iterable__user_unsubscribed_channel_tmp.sql", "original_file_path": "models/staging/tmp/stg_iterable__user_unsubscribed_channel_tmp.sql", "unique_id": "model.iterable.stg_iterable__user_unsubscribed_channel_tmp", "fqn": ["iterable", "staging", "tmp", "stg_iterable__user_unsubscribed_channel_tmp"], "alias": "stg_iterable__user_unsubscribed_channel_tmp", "checksum": {"name": "sha256", "checksum": "a8d43331a84f0d1dae8511478d01cded7dfb389fef925f7173f50eb6b6b9c142"}, "config": {"enabled": true, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "view", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"materialized": "view", "schema": "iterable_{{ var('directed_schema','dev') }}", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789503445.93191, "relation_name": "\"postgres\".\"public_iterable_dev\".\"stg_iterable__user_unsubscribed_channel_tmp\"", "raw_code": "{{\n fivetran_utils.union_connections(\n connection_dictionary='iterable_sources',\n single_source_name='iterable',\n single_table_name='user_unsubscribed_channel' if does_table_exist('user_unsubscribed_channel') else 'user_unsubscribed_channel_history'\n )\n}}", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["iterable", "user_unsubscribed_channel_history"], ["iterable", "user_unsubscribed_channel_history"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.iterable.does_table_exist", "macro.fivetran_utils.union_connections"], "nodes": ["source.iterable.iterable.user_unsubscribed_channel_history"]}, "compiled_path": "target/compiled/iterable/models/staging/tmp/stg_iterable__user_unsubscribed_channel_tmp.sql", "compiled": true, "compiled_code": "\n\n\n-- ** Values passed to adapter.get_relation:\n -- full-identifier_var: iterable_user_unsubscribed_channel_identifier\n -- database: postgres \n -- schema: public\n -- identifier: user_unsubscribed_channel_data\n\n\n select\n \"_fivetran_id\",\n \"channel_id\",\n \"_fivetran_synced\"\n from \"postgres\".\"public\".\"user_unsubscribed_channel_data\" as source_table\n\n ", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}, "test.iterable.not_null_iterable__campaigns_campaign_id.03c9448919": {"database": "postgres", "schema": "public_dbt_test__audit", "name": "not_null_iterable__campaigns_campaign_id", "resource_type": "test", "package_name": "iterable", "path": "not_null_iterable__campaigns_campaign_id.sql", "original_file_path": "models/iterable.yml", "unique_id": "test.iterable.not_null_iterable__campaigns_campaign_id.03c9448919", "fqn": ["iterable", "not_null_iterable__campaigns_campaign_id"], "alias": "not_null_iterable__campaigns_campaign_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "sql_header": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {}, "created_at": 1789503446.44712, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "iterable__campaigns", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.iterable.iterable__campaigns"]}, "compiled_path": "target/compiled/iterable/models/iterable.yml/not_null_iterable__campaigns_campaign_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect campaign_id\nfrom \"postgres\".\"public_iterable_dev\".\"iterable__campaigns\"\nwhere campaign_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "campaign_id", "file_key_name": "models.iterable__campaigns", "attached_node": "model.iterable.iterable__campaigns", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "campaign_id", "model": "{{ get_where_subquery(ref('iterable__campaigns')) }}"}, "namespace": null}}, "test.iterable.not_null_iterable__events_event_id.ed1d28a650": {"database": "postgres", "schema": "public_dbt_test__audit", "name": "not_null_iterable__events_event_id", "resource_type": "test", "package_name": "iterable", "path": "not_null_iterable__events_event_id.sql", "original_file_path": "models/iterable.yml", "unique_id": "test.iterable.not_null_iterable__events_event_id.ed1d28a650", "fqn": ["iterable", "not_null_iterable__events_event_id"], "alias": "not_null_iterable__events_event_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "sql_header": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {}, "created_at": 1789503446.45053, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "iterable__events", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.iterable.iterable__events"]}, "compiled_path": "target/compiled/iterable/models/iterable.yml/not_null_iterable__events_event_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect event_id\nfrom \"postgres\".\"public_iterable_dev\".\"iterable__events\"\nwhere event_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "event_id", "file_key_name": "models.iterable__events", "attached_node": "model.iterable.iterable__events", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "event_id", "model": "{{ get_where_subquery(ref('iterable__events')) }}"}, "namespace": null}}, "test.iterable.not_null_iterable__journeys_journey_id.b5c6b8783a": {"database": "postgres", "schema": "public_dbt_test__audit", "name": "not_null_iterable__journeys_journey_id", "resource_type": "test", "package_name": "iterable", "path": "not_null_iterable__journeys_journey_id.sql", "original_file_path": "models/iterable.yml", "unique_id": "test.iterable.not_null_iterable__journeys_journey_id.b5c6b8783a", "fqn": ["iterable", "not_null_iterable__journeys_journey_id"], "alias": "not_null_iterable__journeys_journey_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "sql_header": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {}, "created_at": 1789503446.4535866, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "iterable__journeys", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.iterable.iterable__journeys"]}, "compiled_path": "target/compiled/iterable/models/iterable.yml/not_null_iterable__journeys_journey_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect journey_id\nfrom \"postgres\".\"public_iterable_dev\".\"iterable__journeys\"\nwhere journey_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "journey_id", "file_key_name": "models.iterable__journeys", "attached_node": "model.iterable.iterable__journeys", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "journey_id", "model": "{{ get_where_subquery(ref('iterable__journeys')) }}"}, "namespace": null}}, "test.iterable.unique_iterable__journeys_unique_journey_id.ba86841246": {"database": "postgres", "schema": "public_dbt_test__audit", "name": "unique_iterable__journeys_unique_journey_id", "resource_type": "test", "package_name": "iterable", "path": "unique_iterable__journeys_unique_journey_id.sql", "original_file_path": "models/iterable.yml", "unique_id": "test.iterable.unique_iterable__journeys_unique_journey_id.ba86841246", "fqn": ["iterable", "unique_iterable__journeys_unique_journey_id"], "alias": "unique_iterable__journeys_unique_journey_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "sql_header": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {}, "created_at": 1789503446.4565332, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "iterable__journeys", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.iterable.iterable__journeys"]}, "compiled_path": "target/compiled/iterable/models/iterable.yml/unique_iterable__journeys_unique_journey_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n unique_journey_id as unique_field,\n count(*) as n_records\n\nfrom \"postgres\".\"public_iterable_dev\".\"iterable__journeys\"\nwhere unique_journey_id is not null\ngroup by unique_journey_id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "unique_journey_id", "file_key_name": "models.iterable__journeys", "attached_node": "model.iterable.iterable__journeys", "test_metadata": {"name": "unique", "kwargs": {"column_name": "unique_journey_id", "model": "{{ get_where_subquery(ref('iterable__journeys')) }}"}, "namespace": null}}, "test.iterable.not_null_iterable__user_unsubscriptions_unique_user_key.f8db72932b": {"database": "postgres", "schema": "public_dbt_test__audit", "name": "not_null_iterable__user_unsubscriptions_unique_user_key", "resource_type": "test", "package_name": "iterable", "path": "not_null_iterable__user_unsubscriptions_unique_user_key.sql", "original_file_path": "models/iterable.yml", "unique_id": "test.iterable.not_null_iterable__user_unsubscriptions_unique_user_key.f8db72932b", "fqn": ["iterable", "not_null_iterable__user_unsubscriptions_unique_user_key"], "alias": "not_null_iterable__user_unsubscriptions_unique_user_key", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "sql_header": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {}, "created_at": 1789503446.4595494, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "iterable__user_unsubscriptions", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.iterable.iterable__user_unsubscriptions"]}, "compiled_path": "target/compiled/iterable/models/iterable.yml/not_null_iterable__user_unsubscriptions_unique_user_key.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect unique_user_key\nfrom \"postgres\".\"public_iterable_dev\".\"iterable__user_unsubscriptions\"\nwhere unique_user_key is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "unique_user_key", "file_key_name": "models.iterable__user_unsubscriptions", "attached_node": "model.iterable.iterable__user_unsubscriptions", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "unique_user_key", "model": "{{ get_where_subquery(ref('iterable__user_unsubscriptions')) }}"}, "namespace": null}}, "test.iterable.not_null_iterable__users_unique_user_key.4ca37a26c8": {"database": "postgres", "schema": "public_dbt_test__audit", "name": "not_null_iterable__users_unique_user_key", "resource_type": "test", "package_name": "iterable", "path": "not_null_iterable__users_unique_user_key.sql", "original_file_path": "models/iterable.yml", "unique_id": "test.iterable.not_null_iterable__users_unique_user_key.4ca37a26c8", "fqn": ["iterable", "not_null_iterable__users_unique_user_key"], "alias": "not_null_iterable__users_unique_user_key", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "sql_header": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {}, "created_at": 1789503446.4636893, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "iterable__users", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.iterable.iterable__users"]}, "compiled_path": "target/compiled/iterable/models/iterable.yml/not_null_iterable__users_unique_user_key.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect unique_user_key\nfrom \"postgres\".\"public_iterable_dev\".\"iterable__users\"\nwhere unique_user_key is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "unique_user_key", "file_key_name": "models.iterable__users", "attached_node": "model.iterable.iterable__users", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "unique_user_key", "model": "{{ get_where_subquery(ref('iterable__users')) }}"}, "namespace": null}}, "test.iterable.not_null_stg_iterable__campaign_history_campaign_id.b7c36e4525": {"database": "postgres", "schema": "public_dbt_test__audit", "name": "not_null_stg_iterable__campaign_history_campaign_id", "resource_type": "test", "package_name": "iterable", "path": "not_null_stg_iterable__campaign_history_campaign_id.sql", "original_file_path": "models/staging/stg_iterable.yml", "unique_id": "test.iterable.not_null_stg_iterable__campaign_history_campaign_id.b7c36e4525", "fqn": ["iterable", "staging", "not_null_stg_iterable__campaign_history_campaign_id"], "alias": "not_null_stg_iterable__campaign_history_campaign_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "sql_header": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {}, "created_at": 1789503446.4973776, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__campaign_history", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.iterable.stg_iterable__campaign_history"]}, "compiled_path": "target/compiled/iterable/models/staging/stg_iterable.yml/not_null_stg_iterable__campaign_history_campaign_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect campaign_id\nfrom \"postgres\".\"public_iterable_dev\".\"stg_iterable__campaign_history\"\nwhere campaign_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "campaign_id", "file_key_name": "models.stg_iterable__campaign_history", "attached_node": "model.iterable.stg_iterable__campaign_history", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "campaign_id", "model": "{{ get_where_subquery(ref('stg_iterable__campaign_history')) }}"}, "namespace": null}}, "test.iterable.not_null_stg_iterable__campaign_label_history_campaign_id.1918cef89a": {"database": "postgres", "schema": "public_dbt_test__audit", "name": "not_null_stg_iterable__campaign_label_history_campaign_id", "resource_type": "test", "package_name": "iterable", "path": "not_null_stg_iterable__campaign_label_history_campaign_id.sql", "original_file_path": "models/staging/stg_iterable.yml", "unique_id": "test.iterable.not_null_stg_iterable__campaign_label_history_campaign_id.1918cef89a", "fqn": ["iterable", "staging", "not_null_stg_iterable__campaign_label_history_campaign_id"], "alias": "not_null_stg_iterable__campaign_label_history_campaign_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "sql_header": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {}, "created_at": 1789503446.500388, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__campaign_label_history", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.iterable.stg_iterable__campaign_label_history"]}, "compiled_path": "target/compiled/iterable/models/staging/stg_iterable.yml/not_null_stg_iterable__campaign_label_history_campaign_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect campaign_id\nfrom \"postgres\".\"public_iterable_dev\".\"stg_iterable__campaign_label_history\"\nwhere campaign_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "campaign_id", "file_key_name": "models.stg_iterable__campaign_label_history", "attached_node": "model.iterable.stg_iterable__campaign_label_history", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "campaign_id", "model": "{{ get_where_subquery(ref('stg_iterable__campaign_label_history')) }}"}, "namespace": null}}, "test.iterable.not_null_stg_iterable__campaign_list_history_campaign_id.208f9bf9ed": {"database": "postgres", "schema": "public_dbt_test__audit", "name": "not_null_stg_iterable__campaign_list_history_campaign_id", "resource_type": "test", "package_name": "iterable", "path": "not_null_stg_iterable__campaign_list_history_campaign_id.sql", "original_file_path": "models/staging/stg_iterable.yml", "unique_id": "test.iterable.not_null_stg_iterable__campaign_list_history_campaign_id.208f9bf9ed", "fqn": ["iterable", "staging", "not_null_stg_iterable__campaign_list_history_campaign_id"], "alias": "not_null_stg_iterable__campaign_list_history_campaign_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "sql_header": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {}, "created_at": 1789503446.5034409, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__campaign_list_history", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.iterable.stg_iterable__campaign_list_history"]}, "compiled_path": "target/compiled/iterable/models/staging/stg_iterable.yml/not_null_stg_iterable__campaign_list_history_campaign_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect campaign_id\nfrom \"postgres\".\"public_iterable_dev\".\"stg_iterable__campaign_list_history\"\nwhere campaign_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "campaign_id", "file_key_name": "models.stg_iterable__campaign_list_history", "attached_node": "model.iterable.stg_iterable__campaign_list_history", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "campaign_id", "model": "{{ get_where_subquery(ref('stg_iterable__campaign_list_history')) }}"}, "namespace": null}}, "test.iterable.not_null_stg_iterable__campaign_suppression_list_history_campaign_id.3921289710": {"database": "postgres", "schema": "public_dbt_test__audit", "name": "not_null_stg_iterable__campaign_suppression_list_history_campaign_id", "resource_type": "test", "package_name": "iterable", "path": "not_null_stg_iterable__campaig_3ce753a10225cac67c8a1434b5541997.sql", "original_file_path": "models/staging/stg_iterable.yml", "unique_id": "test.iterable.not_null_stg_iterable__campaign_suppression_list_history_campaign_id.3921289710", "fqn": ["iterable", "staging", "not_null_stg_iterable__campaign_suppression_list_history_campaign_id"], "alias": "not_null_stg_iterable__campaig_3ce753a10225cac67c8a1434b5541997", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "not_null_stg_iterable__campaig_3ce753a10225cac67c8a1434b5541997", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "sql_header": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"alias": "not_null_stg_iterable__campaig_3ce753a10225cac67c8a1434b5541997"}, "created_at": 1789503446.5064232, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"not_null_stg_iterable__campaig_3ce753a10225cac67c8a1434b5541997\") }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__campaign_suppression_list_history", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.iterable.stg_iterable__campaign_suppression_list_history"]}, "compiled_path": "target/compiled/iterable/models/staging/stg_iterable.yml/not_null_stg_iterable__campaig_3ce753a10225cac67c8a1434b5541997.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect campaign_id\nfrom \"postgres\".\"public_iterable_dev\".\"stg_iterable__campaign_suppression_list_history\"\nwhere campaign_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "campaign_id", "file_key_name": "models.stg_iterable__campaign_suppression_list_history", "attached_node": "model.iterable.stg_iterable__campaign_suppression_list_history", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "campaign_id", "model": "{{ get_where_subquery(ref('stg_iterable__campaign_suppression_list_history')) }}"}, "namespace": null}}, "test.iterable.not_null_stg_iterable__channel_channel_id.182ceb9636": {"database": "postgres", "schema": "public_dbt_test__audit", "name": "not_null_stg_iterable__channel_channel_id", "resource_type": "test", "package_name": "iterable", "path": "not_null_stg_iterable__channel_channel_id.sql", "original_file_path": "models/staging/stg_iterable.yml", "unique_id": "test.iterable.not_null_stg_iterable__channel_channel_id.182ceb9636", "fqn": ["iterable", "staging", "not_null_stg_iterable__channel_channel_id"], "alias": "not_null_stg_iterable__channel_channel_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "sql_header": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {}, "created_at": 1789503446.5093307, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__channel", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.iterable.stg_iterable__channel"]}, "compiled_path": "target/compiled/iterable/models/staging/stg_iterable.yml/not_null_stg_iterable__channel_channel_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect channel_id\nfrom \"postgres\".\"public_iterable_dev\".\"stg_iterable__channel\"\nwhere channel_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "channel_id", "file_key_name": "models.stg_iterable__channel", "attached_node": "model.iterable.stg_iterable__channel", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "channel_id", "model": "{{ get_where_subquery(ref('stg_iterable__channel')) }}"}, "namespace": null}}, "test.iterable.not_null_stg_iterable__event_event_id.370cd4bc9d": {"database": "postgres", "schema": "public_dbt_test__audit", "name": "not_null_stg_iterable__event_event_id", "resource_type": "test", "package_name": "iterable", "path": "not_null_stg_iterable__event_event_id.sql", "original_file_path": "models/staging/stg_iterable.yml", "unique_id": "test.iterable.not_null_stg_iterable__event_event_id.370cd4bc9d", "fqn": ["iterable", "staging", "not_null_stg_iterable__event_event_id"], "alias": "not_null_stg_iterable__event_event_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "sql_header": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {}, "created_at": 1789503446.512339, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__event", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.iterable.stg_iterable__event"]}, "compiled_path": "target/compiled/iterable/models/staging/stg_iterable.yml/not_null_stg_iterable__event_event_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect event_id\nfrom \"postgres\".\"public_iterable_dev\".\"stg_iterable__event\"\nwhere event_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "event_id", "file_key_name": "models.stg_iterable__event", "attached_node": "model.iterable.stg_iterable__event", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "event_id", "model": "{{ get_where_subquery(ref('stg_iterable__event')) }}"}, "namespace": null}}, "test.iterable.not_null_stg_iterable__event_unique_event_id.e2b46d3bb6": {"database": "postgres", "schema": "public_dbt_test__audit", "name": "not_null_stg_iterable__event_unique_event_id", "resource_type": "test", "package_name": "iterable", "path": "not_null_stg_iterable__event_unique_event_id.sql", "original_file_path": "models/staging/stg_iterable.yml", "unique_id": "test.iterable.not_null_stg_iterable__event_unique_event_id.e2b46d3bb6", "fqn": ["iterable", "staging", "not_null_stg_iterable__event_unique_event_id"], "alias": "not_null_stg_iterable__event_unique_event_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "sql_header": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {}, "created_at": 1789503446.5152392, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__event", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.iterable.stg_iterable__event"]}, "compiled_path": "target/compiled/iterable/models/staging/stg_iterable.yml/not_null_stg_iterable__event_unique_event_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect unique_event_id\nfrom \"postgres\".\"public_iterable_dev\".\"stg_iterable__event\"\nwhere unique_event_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "unique_event_id", "file_key_name": "models.stg_iterable__event", "attached_node": "model.iterable.stg_iterable__event", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "unique_event_id", "model": "{{ get_where_subquery(ref('stg_iterable__event')) }}"}, "namespace": null}}, "test.iterable.not_null_stg_iterable__event_extension_event_id.144dedcd30": {"database": "postgres", "schema": "public_dbt_test__audit", "name": "not_null_stg_iterable__event_extension_event_id", "resource_type": "test", "package_name": "iterable", "path": "not_null_stg_iterable__event_extension_event_id.sql", "original_file_path": "models/staging/stg_iterable.yml", "unique_id": "test.iterable.not_null_stg_iterable__event_extension_event_id.144dedcd30", "fqn": ["iterable", "staging", "not_null_stg_iterable__event_extension_event_id"], "alias": "not_null_stg_iterable__event_extension_event_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "sql_header": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {}, "created_at": 1789503446.5182981, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__event_extension", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.iterable.stg_iterable__event_extension"]}, "compiled_path": "target/compiled/iterable/models/staging/stg_iterable.yml/not_null_stg_iterable__event_extension_event_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect event_id\nfrom \"postgres\".\"public_iterable_dev\".\"stg_iterable__event_extension\"\nwhere event_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "event_id", "file_key_name": "models.stg_iterable__event_extension", "attached_node": "model.iterable.stg_iterable__event_extension", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "event_id", "model": "{{ get_where_subquery(ref('stg_iterable__event_extension')) }}"}, "namespace": null}}, "test.iterable.not_null_stg_iterable__journey_journey_id.cc38bd633c": {"database": "postgres", "schema": "public_dbt_test__audit", "name": "not_null_stg_iterable__journey_journey_id", "resource_type": "test", "package_name": "iterable", "path": "not_null_stg_iterable__journey_journey_id.sql", "original_file_path": "models/staging/stg_iterable.yml", "unique_id": "test.iterable.not_null_stg_iterable__journey_journey_id.cc38bd633c", "fqn": ["iterable", "staging", "not_null_stg_iterable__journey_journey_id"], "alias": "not_null_stg_iterable__journey_journey_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "sql_header": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {}, "created_at": 1789503446.5212362, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__journey", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.iterable.stg_iterable__journey"]}, "compiled_path": "target/compiled/iterable/models/staging/stg_iterable.yml/not_null_stg_iterable__journey_journey_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect journey_id\nfrom \"postgres\".\"public_iterable_dev\".\"stg_iterable__journey\"\nwhere journey_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "journey_id", "file_key_name": "models.stg_iterable__journey", "attached_node": "model.iterable.stg_iterable__journey", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "journey_id", "model": "{{ get_where_subquery(ref('stg_iterable__journey')) }}"}, "namespace": null}}, "test.iterable.not_null_stg_iterable__list_list_id.47029d839a": {"database": "postgres", "schema": "public_dbt_test__audit", "name": "not_null_stg_iterable__list_list_id", "resource_type": "test", "package_name": "iterable", "path": "not_null_stg_iterable__list_list_id.sql", "original_file_path": "models/staging/stg_iterable.yml", "unique_id": "test.iterable.not_null_stg_iterable__list_list_id.47029d839a", "fqn": ["iterable", "staging", "not_null_stg_iterable__list_list_id"], "alias": "not_null_stg_iterable__list_list_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "sql_header": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {}, "created_at": 1789503446.5241885, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__list", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.iterable.stg_iterable__list"]}, "compiled_path": "target/compiled/iterable/models/staging/stg_iterable.yml/not_null_stg_iterable__list_list_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect list_id\nfrom \"postgres\".\"public_iterable_dev\".\"stg_iterable__list\"\nwhere list_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "list_id", "file_key_name": "models.stg_iterable__list", "attached_node": "model.iterable.stg_iterable__list", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "list_id", "model": "{{ get_where_subquery(ref('stg_iterable__list')) }}"}, "namespace": null}}, "test.iterable.not_null_stg_iterable__message_type_message_type_id.75eaa6fa62": {"database": "postgres", "schema": "public_dbt_test__audit", "name": "not_null_stg_iterable__message_type_message_type_id", "resource_type": "test", "package_name": "iterable", "path": "not_null_stg_iterable__message_type_message_type_id.sql", "original_file_path": "models/staging/stg_iterable.yml", "unique_id": "test.iterable.not_null_stg_iterable__message_type_message_type_id.75eaa6fa62", "fqn": ["iterable", "staging", "not_null_stg_iterable__message_type_message_type_id"], "alias": "not_null_stg_iterable__message_type_message_type_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "sql_header": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {}, "created_at": 1789503446.527352, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__message_type", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.iterable.stg_iterable__message_type"]}, "compiled_path": "target/compiled/iterable/models/staging/stg_iterable.yml/not_null_stg_iterable__message_type_message_type_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect message_type_id\nfrom \"postgres\".\"public_iterable_dev\".\"stg_iterable__message_type\"\nwhere message_type_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "message_type_id", "file_key_name": "models.stg_iterable__message_type", "attached_node": "model.iterable.stg_iterable__message_type", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "message_type_id", "model": "{{ get_where_subquery(ref('stg_iterable__message_type')) }}"}, "namespace": null}}, "test.iterable.not_null_stg_iterable__template_history_template_id.14b24a1dfe": {"database": "postgres", "schema": "public_dbt_test__audit", "name": "not_null_stg_iterable__template_history_template_id", "resource_type": "test", "package_name": "iterable", "path": "not_null_stg_iterable__template_history_template_id.sql", "original_file_path": "models/staging/stg_iterable.yml", "unique_id": "test.iterable.not_null_stg_iterable__template_history_template_id.14b24a1dfe", "fqn": ["iterable", "staging", "not_null_stg_iterable__template_history_template_id"], "alias": "not_null_stg_iterable__template_history_template_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "sql_header": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {}, "created_at": 1789503446.530438, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__template_history", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.iterable.stg_iterable__template_history"]}, "compiled_path": "target/compiled/iterable/models/staging/stg_iterable.yml/not_null_stg_iterable__template_history_template_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect template_id\nfrom \"postgres\".\"public_iterable_dev\".\"stg_iterable__template_history\"\nwhere template_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "template_id", "file_key_name": "models.stg_iterable__template_history", "attached_node": "model.iterable.stg_iterable__template_history", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "template_id", "model": "{{ get_where_subquery(ref('stg_iterable__template_history')) }}"}, "namespace": null}}, "test.iterable.not_null_stg_iterable__list_user__fivetran_user_id.cca4b34c07": {"database": "postgres", "schema": "public_dbt_test__audit", "name": "not_null_stg_iterable__list_user__fivetran_user_id", "resource_type": "test", "package_name": "iterable", "path": "not_null_stg_iterable__list_user__fivetran_user_id.sql", "original_file_path": "models/staging/stg_iterable.yml", "unique_id": "test.iterable.not_null_stg_iterable__list_user__fivetran_user_id.cca4b34c07", "fqn": ["iterable", "staging", "not_null_stg_iterable__list_user__fivetran_user_id"], "alias": "not_null_stg_iterable__list_user__fivetran_user_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "sql_header": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {}, "created_at": 1789503446.5333672, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__list_user", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.iterable.stg_iterable__list_user"]}, "compiled_path": "target/compiled/iterable/models/staging/stg_iterable.yml/not_null_stg_iterable__list_user__fivetran_user_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect _fivetran_user_id\nfrom \"postgres\".\"public_iterable_dev\".\"stg_iterable__list_user\"\nwhere _fivetran_user_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "_fivetran_user_id", "file_key_name": "models.stg_iterable__list_user", "attached_node": "model.iterable.stg_iterable__list_user", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "_fivetran_user_id", "model": "{{ get_where_subquery(ref('stg_iterable__list_user')) }}"}, "namespace": null}}, "test.iterable.not_null_stg_iterable__user_history_unique_user_key.2845af2127": {"database": "postgres", "schema": "public_dbt_test__audit", "name": "not_null_stg_iterable__user_history_unique_user_key", "resource_type": "test", "package_name": "iterable", "path": "not_null_stg_iterable__user_history_unique_user_key.sql", "original_file_path": "models/staging/stg_iterable.yml", "unique_id": "test.iterable.not_null_stg_iterable__user_history_unique_user_key.2845af2127", "fqn": ["iterable", "staging", "not_null_stg_iterable__user_history_unique_user_key"], "alias": "not_null_stg_iterable__user_history_unique_user_key", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "sql_header": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {}, "created_at": 1789503446.536258, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__user_history", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.iterable.stg_iterable__user_history"]}, "compiled_path": "target/compiled/iterable/models/staging/stg_iterable.yml/not_null_stg_iterable__user_history_unique_user_key.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect unique_user_key\nfrom \"postgres\".\"public_iterable_dev\".\"stg_iterable__user_history\"\nwhere unique_user_key is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "unique_user_key", "file_key_name": "models.stg_iterable__user_history", "attached_node": "model.iterable.stg_iterable__user_history", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "unique_user_key", "model": "{{ get_where_subquery(ref('stg_iterable__user_history')) }}"}, "namespace": null}}, "test.iterable.not_null_stg_iterable__user_unsubscribed_channel_channel_id.da0ed9e9be": {"database": "postgres", "schema": "public_dbt_test__audit", "name": "not_null_stg_iterable__user_unsubscribed_channel_channel_id", "resource_type": "test", "package_name": "iterable", "path": "not_null_stg_iterable__user_unsubscribed_channel_channel_id.sql", "original_file_path": "models/staging/stg_iterable.yml", "unique_id": "test.iterable.not_null_stg_iterable__user_unsubscribed_channel_channel_id.da0ed9e9be", "fqn": ["iterable", "staging", "not_null_stg_iterable__user_unsubscribed_channel_channel_id"], "alias": "not_null_stg_iterable__user_unsubscribed_channel_channel_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "sql_header": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {}, "created_at": 1789503446.5391512, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__user_unsubscribed_channel", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.iterable.stg_iterable__user_unsubscribed_channel"]}, "compiled_path": "target/compiled/iterable/models/staging/stg_iterable.yml/not_null_stg_iterable__user_unsubscribed_channel_channel_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect channel_id\nfrom \"postgres\".\"public_iterable_dev\".\"stg_iterable__user_unsubscribed_channel\"\nwhere channel_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "channel_id", "file_key_name": "models.stg_iterable__user_unsubscribed_channel", "attached_node": "model.iterable.stg_iterable__user_unsubscribed_channel", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "channel_id", "model": "{{ get_where_subquery(ref('stg_iterable__user_unsubscribed_channel')) }}"}, "namespace": null}}, "test.iterable.not_null_stg_iterable__user_unsub_message_type_message_type_id.268a89ea6f": {"database": "postgres", "schema": "public_dbt_test__audit", "name": "not_null_stg_iterable__user_unsub_message_type_message_type_id", "resource_type": "test", "package_name": "iterable", "path": "not_null_stg_iterable__user_unsub_message_type_message_type_id.sql", "original_file_path": "models/staging/stg_iterable.yml", "unique_id": "test.iterable.not_null_stg_iterable__user_unsub_message_type_message_type_id.268a89ea6f", "fqn": ["iterable", "staging", "not_null_stg_iterable__user_unsub_message_type_message_type_id"], "alias": "not_null_stg_iterable__user_unsub_message_type_message_type_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "sql_header": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {}, "created_at": 1789503446.5420778, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__user_unsub_message_type", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.iterable.stg_iterable__user_unsub_message_type"]}, "compiled_path": "target/compiled/iterable/models/staging/stg_iterable.yml/not_null_stg_iterable__user_unsub_message_type_message_type_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect message_type_id\nfrom \"postgres\".\"public_iterable_dev\".\"stg_iterable__user_unsub_message_type\"\nwhere message_type_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "message_type_id", "file_key_name": "models.stg_iterable__user_unsub_message_type", "attached_node": "model.iterable.stg_iterable__user_unsub_message_type", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "message_type_id", "model": "{{ get_where_subquery(ref('stg_iterable__user_unsub_message_type')) }}"}, "namespace": null}}}, "sources": {"source.iterable.iterable.campaign_history": {"database": "postgres", "schema": "public", "name": "campaign_history", "resource_type": "source", "package_name": "iterable", "path": "models/staging/src_iterable.yml", "original_file_path": "models/staging/src_iterable.yml", "unique_id": "source.iterable.iterable.campaign_history", "fqn": ["iterable", "staging", "iterable", "campaign_history"], "source_name": "iterable", "source_description": "", "loader": "fivetran", "identifier": "campaign_history_data", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Table containing a history of campaigns.", "columns": {"id": {"name": "id", "description": "Unique identifier of the campaign record", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "updated_at": {"name": "updated_at", "description": "Last update's timestamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "name": {"name": "name", "description": "User defined name of the campaign.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "campaign_state": {"name": "campaign_state", "description": "State of the campaign. Can be Draft, Ready, Scheduled, Running, Finished, Starting, Aborted or Recurring", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "type": {"name": "type", "description": "The campaign type. Can be Blast or Triggered", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "send_size": {"name": "send_size", "description": "Size of the campaign. Number of individuals included in the campaign", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "start_at": {"name": "start_at", "description": "Start timestamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "ended_at": {"name": "ended_at", "description": "Ended timestamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "created_at": {"name": "created_at", "description": "Creation timestamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "recurring_campaign_id": {"name": "recurring_campaign_id", "description": "Reference to the recurring campaign, if applicable", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "created_by_user_id": {"name": "created_by_user_id", "description": "Reference to the user who created the campaign", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "template_id": {"name": "template_id", "description": "Reference to the campaign template", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "updated_by_user_id": {"name": "updated_by_user_id", "description": "ID of the user who updated this record", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "message_medium": {"name": "message_medium", "description": "The medium that this message was sent via, for example Email or InApp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": "_fivetran_synced", "loaded_at_query": null, "meta": {}, "tags": [], "static_analysis": null}, "patch_path": null, "unrendered_config": {"loaded_at_field": "_fivetran_synced", "enabled": true, "loaded_at_query": null, "meta": {}, "tags": []}, "relation_name": "\"postgres\".\"public\".\"campaign_history_data\"", "created_at": 1789503446.734005, "unrendered_database": "{% if target.type != 'spark' %}{{ var('iterable_database', target.database)}}{% endif %}", "unrendered_schema": "{{var ('iterable_schema', 'iterable')}}", "doc_blocks": []}, "source.iterable.iterable.campaign_label_history": {"database": "postgres", "schema": "public", "name": "campaign_label_history", "resource_type": "source", "package_name": "iterable", "path": "models/staging/src_iterable.yml", "original_file_path": "models/staging/src_iterable.yml", "unique_id": "source.iterable.iterable.campaign_label_history", "fqn": ["iterable", "staging", "iterable", "campaign_label_history"], "source_name": "iterable", "source_description": "", "loader": "fivetran", "identifier": "campaign_label_history_data", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Table containing a history of labels.", "columns": {"campaign_id": {"name": "campaign_id", "description": "Reference to the campaign associated with the label", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "label": {"name": "label", "description": "Name of the label", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "updated_at": {"name": "updated_at", "description": "Last update timestamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": "_fivetran_synced", "loaded_at_query": null, "meta": {}, "tags": [], "static_analysis": null}, "patch_path": null, "unrendered_config": {"loaded_at_field": "_fivetran_synced", "enabled": true, "loaded_at_query": null, "meta": {}, "tags": []}, "relation_name": "\"postgres\".\"public\".\"campaign_label_history_data\"", "created_at": 1789503446.7363071, "unrendered_database": "{% if target.type != 'spark' %}{{ var('iterable_database', target.database)}}{% endif %}", "unrendered_schema": "{{var ('iterable_schema', 'iterable')}}", "doc_blocks": []}, "source.iterable.iterable.campaign_list_history": {"database": "postgres", "schema": "public", "name": "campaign_list_history", "resource_type": "source", "package_name": "iterable", "path": "models/staging/src_iterable.yml", "original_file_path": "models/staging/src_iterable.yml", "unique_id": "source.iterable.iterable.campaign_list_history", "fqn": ["iterable", "staging", "iterable", "campaign_list_history"], "source_name": "iterable", "source_description": "", "loader": "fivetran", "identifier": "campaign_list_history_data", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Table containing a history of lists.", "columns": {"campaign_id": {"name": "campaign_id", "description": "Reference to the campaign associated with the label", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "list_id": {"name": "list_id", "description": "Reference to the list used", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "updated_at": {"name": "updated_at", "description": "Last update timestamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": "_fivetran_synced", "loaded_at_query": null, "meta": {}, "tags": [], "static_analysis": null}, "patch_path": null, "unrendered_config": {"loaded_at_field": "_fivetran_synced", "enabled": true, "loaded_at_query": null, "meta": {}, "tags": []}, "relation_name": "\"postgres\".\"public\".\"campaign_list_history_data\"", "created_at": 1789503446.73702, "unrendered_database": "{% if target.type != 'spark' %}{{ var('iterable_database', target.database)}}{% endif %}", "unrendered_schema": "{{var ('iterable_schema', 'iterable')}}", "doc_blocks": []}, "source.iterable.iterable.campaign_suppression_list_history": {"database": "postgres", "schema": "public", "name": "campaign_suppression_list_history", "resource_type": "source", "package_name": "iterable", "path": "models/staging/src_iterable.yml", "original_file_path": "models/staging/src_iterable.yml", "unique_id": "source.iterable.iterable.campaign_suppression_list_history", "fqn": ["iterable", "staging", "iterable", "campaign_suppression_list_history"], "source_name": "iterable", "source_description": "", "loader": "fivetran", "identifier": "campaign_suppression_list_history_data", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Table containing a history of suppression lists.\n", "columns": {"campaign_id": {"name": "campaign_id", "description": "Reference to the campaign associated with the label", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "suppressed_list_id": {"name": "suppressed_list_id", "description": "Reference to the list used", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "updated_at": {"name": "updated_at", "description": "Last update timestamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": "_fivetran_synced", "loaded_at_query": null, "meta": {}, "tags": [], "static_analysis": null}, "patch_path": null, "unrendered_config": {"loaded_at_field": "_fivetran_synced", "enabled": true, "loaded_at_query": null, "meta": {}, "tags": []}, "relation_name": "\"postgres\".\"public\".\"campaign_suppression_list_history_data\"", "created_at": 1789503446.7376974, "unrendered_database": "{% if target.type != 'spark' %}{{ var('iterable_database', target.database)}}{% endif %}", "unrendered_schema": "{{var ('iterable_schema', 'iterable')}}", "doc_blocks": []}, "source.iterable.iterable.channel": {"database": "postgres", "schema": "public", "name": "channel", "resource_type": "source", "package_name": "iterable", "path": "models/staging/src_iterable.yml", "original_file_path": "models/staging/src_iterable.yml", "unique_id": "source.iterable.iterable.channel", "fqn": ["iterable", "staging", "iterable", "channel"], "source_name": "iterable", "source_description": "", "loader": "fivetran", "identifier": "channel_data", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Table containing unique channels.", "columns": {"id": {"name": "id", "description": "Unique identifier of the channel", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "name": {"name": "name", "description": "User defined name of the channel", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "channel_type": {"name": "channel_type", "description": "The channel type", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "message_medium": {"name": "message_medium", "description": "The message medium associated with the channel", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": "_fivetran_synced", "loaded_at_query": null, "meta": {}, "tags": [], "static_analysis": null}, "patch_path": null, "unrendered_config": {"loaded_at_field": "_fivetran_synced", "enabled": true, "loaded_at_query": null, "meta": {}, "tags": []}, "relation_name": "\"postgres\".\"public\".\"channel_data\"", "created_at": 1789503446.7385418, "unrendered_database": "{% if target.type != 'spark' %}{{ var('iterable_database', target.database)}}{% endif %}", "unrendered_schema": "{{var ('iterable_schema', 'iterable')}}", "doc_blocks": []}, "source.iterable.iterable.event": {"database": "postgres", "schema": "public", "name": "event", "resource_type": "source", "package_name": "iterable", "path": "models/staging/src_iterable.yml", "original_file_path": "models/staging/src_iterable.yml", "unique_id": "source.iterable.iterable.event", "fqn": ["iterable", "staging", "iterable", "event"], "source_name": "iterable", "source_description": "", "loader": "fivetran", "identifier": "event_data", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Table containing individual events within campaigns.", "columns": {"_fivetran_id": {"name": "_fivetran_id", "description": "A Fivetran-created unique identifier derived from hashing campaign_id, created_at, and event_name.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "campaign_id": {"name": "campaign_id", "description": "Reference to the campaign from which the event originated", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "content_id": {"name": "content_id", "description": "Reference to the content the event is associated with.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "created_at": {"name": "created_at", "description": "Creation timestamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "email": {"name": "email", "description": "The user's email. User identifier, for email-based projects. Previously was the unique identifier for user records, for Iterable customers before August 2023. Exists if using the history version of the table.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "additional_properties": {"name": "additional_properties", "description": "json object containing addition event properties", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "event_name": {"name": "event_name", "description": "Name provided to the individual event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "message_bus_id": {"name": "message_bus_id", "description": "Reference to the message bus associated with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "message_id": {"name": "message_id", "description": "Reference to the message the event is associated with", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "message_type_id": {"name": "message_type_id", "description": "Reference to the type of message the event is associated with", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "recipient_state": {"name": "recipient_state", "description": "The state of the recipient upon receiving the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "status": {"name": "status", "description": "Status of the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "transactional_data": {"name": "transactional_data", "description": "Transactional data associated with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "unsub_source": {"name": "unsub_source", "description": "Source of the unsubscribe event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "user_agent": {"name": "user_agent", "description": "User agent associated with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "user_agent_device": {"name": "user_agent_device", "description": "The device of the user agent", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "_fivetran_user_id": {"name": "_fivetran_user_id", "description": "A Fivetran-created unique identifier for users, derived from hashing user_id and/or email, depending on project type.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": "_fivetran_synced", "loaded_at_query": null, "meta": {}, "tags": [], "static_analysis": null}, "patch_path": null, "unrendered_config": {"loaded_at_field": "_fivetran_synced", "enabled": true, "loaded_at_query": null, "meta": {}, "tags": []}, "relation_name": "\"postgres\".\"public\".\"event_data\"", "created_at": 1789503446.739323, "unrendered_database": "{% if target.type != 'spark' %}{{ var('iterable_database', target.database)}}{% endif %}", "unrendered_schema": "{{var ('iterable_schema', 'iterable')}}", "doc_blocks": []}, "source.iterable.iterable.event_extension": {"database": "postgres", "schema": "public", "name": "event_extension", "resource_type": "source", "package_name": "iterable", "path": "models/staging/src_iterable.yml", "original_file_path": "models/staging/src_iterable.yml", "unique_id": "source.iterable.iterable.event_extension", "fqn": ["iterable", "staging", "iterable", "event_extension"], "source_name": "iterable", "source_description": "", "loader": "fivetran", "identifier": "event_extension_data", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Table containing additional properties from the event table.", "columns": {"_fivetran_id": {"name": "_fivetran_id", "description": "A Fivetran-created unique identifier derived from hashing campaign_id, created_at, and event_name.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "app_already_running": {"name": "app_already_running", "description": "Boolean indicating if the app is currently running or not", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "badge": {"name": "badge", "description": "Badge associated with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "canonical_url_id": {"name": "canonical_url_id", "description": "Reference to the url associated with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "content_available": {"name": "content_available", "description": "Content available from the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "content_id": {"name": "content_id", "description": "Reference to the content associated with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "deeplink_android": {"name": "deeplink_android", "description": "Deeplink associated with the event from an android device", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "deeplink_ios": {"name": "deeplink_ios", "description": "Deeplink associated with the event from an ios device", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "device": {"name": "device", "description": "The device associated with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "email_id": {"name": "email_id", "description": "Reference to the email associated with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "email_subject": {"name": "email_subject", "description": "Subject of the email associated with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "experiment_id": {"name": "experiment_id", "description": "Reference to the experiment used if the event is an experiment", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "from_phone_number_id": {"name": "from_phone_number_id", "description": "Reference to the phone number which the event is from", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "from_smssender_id": {"name": "from_smssender_id", "description": "Reference to the sms sender which the event is from", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "image_url": {"name": "image_url", "description": "Image url of the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "is_ghost_push": {"name": "is_ghost_push", "description": "Boolean indicating if the event is a result of a ghost push", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "link_id": {"name": "link_id", "description": "Reference to the link associated with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "link_url": {"name": "link_url", "description": "Url of the link associated with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "locale": {"name": "locale", "description": "Locale associated with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "payload": {"name": "payload", "description": "Payload resulted from the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "platform_endpoint": {"name": "platform_endpoint", "description": "The specific platform endpoint of the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "push_message": {"name": "push_message", "description": "Boolean indicating if the event is a push message", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "region": {"name": "region", "description": "Region of the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "sms_message": {"name": "sms_message", "description": "Boolean indicating if the event is an sms message", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "sms_provider_response_code": {"name": "sms_provider_response_code", "description": "sms provider response code from the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "sms_provider_response_message": {"name": "sms_provider_response_message", "description": "sms provider response message from the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "sms_provider_response_more_info": {"name": "sms_provider_response_more_info", "description": "sms provider response addition info from the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "sms_provider_response_status": {"name": "sms_provider_response_status", "description": "Status of the sms provider response from the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "sound": {"name": "sound", "description": "Boolean indicating if a sound was used with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "to_phone_number": {"name": "to_phone_number", "description": "To phone number associated with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "url": {"name": "url", "description": "Url associated with the event", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "workflow_id": {"name": "workflow_id", "description": "Reference to the workflow which the event originated", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "workflow_name": {"name": "workflow_name", "description": "Name of the workflow which the event originated", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "catalog_collection_count": {"name": "catalog_collection_count", "description": "The count of products or items collected in a catalog associated with the event.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "catalog_lookup_count": {"name": "catalog_lookup_count", "description": "The count of times a catalog was looked up or queried during the event.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "city": {"name": "city", "description": "The city associated with the event, which could be the location of the recipient.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "clicked_url": {"name": "clicked_url", "description": "The URL that was clicked by the recipient in response to the marketing message.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "country": {"name": "country", "description": "The country associated with the event, which could be the location of the recipient.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "error_code": {"name": "error_code", "description": "The error code or message indicating any issues or errors encountered during the event.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "expires_at": {"name": "expires_at", "description": "The date and time when the event or message is set to expire or become invalid.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "from_phone_number": {"name": "from_phone_number", "description": "The phone number from which the SMS message was sent.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "in_app_body": {"name": "in_app_body", "description": "The content or body of an in-app message that was sent as part of the event.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "is_sms_estimation": {"name": "is_sms_estimation", "description": "A boolean indicating whether the SMS message is an estimation or not.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "labels": {"name": "labels", "description": "Any labels or tags associated with the event, which can be used for categorization or organization.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "message_context": {"name": "message_context", "description": "Additional contextual information related to the marketing message or event.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "message_status": {"name": "message_status", "description": "The status of the marketing message, such as sent, delivered, opened, etc.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "mms_send_count": {"name": "mms_send_count", "description": "The count of multimedia messages (MMS) sent as part of the event.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "product_recommendation_count": {"name": "product_recommendation_count", "description": "The count of product recommendations included in the message.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "proxy_source": {"name": "proxy_source", "description": "Information about the source or proxy used for sending the message.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "reason": {"name": "reason", "description": "The reason or cause associated with a specific event or action.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "sms_send_count": {"name": "sms_send_count", "description": "The count of SMS messages sent as part of the event.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "web_push_body": {"name": "web_push_body", "description": "The content or body of a web push notification sent as part of the event.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "web_push_click_action": {"name": "web_push_click_action", "description": "The action triggered when a recipient clicks a web push notification.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "web_push_icon": {"name": "web_push_icon", "description": "The icon or image associated with the web push notification.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "web_push_message": {"name": "web_push_message", "description": "The message or notification sent to web users as part of the event.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": "_fivetran_synced", "loaded_at_query": null, "meta": {}, "tags": [], "static_analysis": null}, "patch_path": null, "unrendered_config": {"loaded_at_field": "_fivetran_synced", "enabled": true, "loaded_at_query": null, "meta": {}, "tags": []}, "relation_name": "\"postgres\".\"public\".\"event_extension_data\"", "created_at": 1789503446.7403038, "unrendered_database": "{% if target.type != 'spark' %}{{ var('iterable_database', target.database)}}{% endif %}", "unrendered_schema": "{{var ('iterable_schema', 'iterable')}}", "doc_blocks": []}, "source.iterable.iterable.journey": {"database": "postgres", "schema": "public", "name": "journey", "resource_type": "source", "package_name": "iterable", "path": "models/staging/src_iterable.yml", "original_file_path": "models/staging/src_iterable.yml", "unique_id": "source.iterable.iterable.journey", "fqn": ["iterable", "staging", "iterable", "journey"], "source_name": "iterable", "source_description": "", "loader": "fivetran", "identifier": "journey_data", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Table containing unique journeys, formerly known as workflows.", "columns": {"id": {"name": "id", "description": "Unique identifier of the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "name": {"name": "name", "description": "User defined name of the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "journey_type": {"name": "journey_type", "description": "Whether the journey is published or a draft.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "description": {"name": "description", "description": "Information about the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "creator_user_id": {"name": "creator_user_id", "description": "Reference to the user who created the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "enabled": {"name": "enabled", "description": "Boolean indicating if the journey is currently enabled", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "is_archived": {"name": "is_archived", "description": "Boolean indicating if the journey has been archived", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "lifetime_limit": {"name": "lifetime_limit", "description": "Maximum number of times a user may enter the journey over their lifetime", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "simultaneous_limit": {"name": "simultaneous_limit", "description": "Maximum number of times a user may be in the journey at the same time", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "start_tile_id": {"name": "start_tile_id", "description": "Reference to the tile which begins the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "trigger_event_names": {"name": "trigger_event_names", "description": "The event names which trigger a user's entry into the journey", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "created_at": {"name": "created_at", "description": "Creation timestamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "updated_at": {"name": "updated_at", "description": "Last update timestamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": "_fivetran_synced", "loaded_at_query": null, "meta": {}, "tags": [], "static_analysis": null}, "patch_path": null, "unrendered_config": {"loaded_at_field": "_fivetran_synced", "enabled": true, "loaded_at_query": null, "meta": {}, "tags": []}, "relation_name": "\"postgres\".\"public\".\"journey_data\"", "created_at": 1789503446.7410448, "unrendered_database": "{% if target.type != 'spark' %}{{ var('iterable_database', target.database)}}{% endif %}", "unrendered_schema": "{{var ('iterable_schema', 'iterable')}}", "doc_blocks": []}, "source.iterable.iterable.list": {"database": "postgres", "schema": "public", "name": "list", "resource_type": "source", "package_name": "iterable", "path": "models/staging/src_iterable.yml", "original_file_path": "models/staging/src_iterable.yml", "unique_id": "source.iterable.iterable.list", "fqn": ["iterable", "staging", "iterable", "list"], "source_name": "iterable", "source_description": "", "loader": "fivetran", "identifier": "list_data", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Table containing users and the lists the users are associated with.", "columns": {"id": {"name": "id", "description": "Unique identifier of the list", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "name": {"name": "name", "description": "User defined name of the list", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "list_type": {"name": "list_type", "description": "The list type", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "created_at": {"name": "created_at", "description": "Creation timestamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "description": {"name": "description", "description": "Information about the list", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": "_fivetran_synced", "loaded_at_query": null, "meta": {}, "tags": [], "static_analysis": null}, "patch_path": null, "unrendered_config": {"loaded_at_field": "_fivetran_synced", "enabled": true, "loaded_at_query": null, "meta": {}, "tags": []}, "relation_name": "\"postgres\".\"public\".\"list_data\"", "created_at": 1789503446.7417114, "unrendered_database": "{% if target.type != 'spark' %}{{ var('iterable_database', target.database)}}{% endif %}", "unrendered_schema": "{{var ('iterable_schema', 'iterable')}}", "doc_blocks": []}, "source.iterable.iterable.message_type": {"database": "postgres", "schema": "public", "name": "message_type", "resource_type": "source", "package_name": "iterable", "path": "models/staging/src_iterable.yml", "original_file_path": "models/staging/src_iterable.yml", "unique_id": "source.iterable.iterable.message_type", "fqn": ["iterable", "staging", "iterable", "message_type"], "source_name": "iterable", "source_description": "", "loader": "fivetran", "identifier": "message_type_data", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Table containing unique message types.", "columns": {"id": {"name": "id", "description": "Unique identifier of the message type", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "name": {"name": "name", "description": "User defined name of the message type", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "channel_id": {"name": "channel_id", "description": "Channel that this message type belongs to", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "created_at": {"name": "created_at", "description": "Time when the message type was initially created", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "frequency_cap": {"name": "frequency_cap", "description": "The maximum number of times a message of this type can be sent to a recipient within a specified time period to prevent over-messaging", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "rate_limit_per_minute": {"name": "rate_limit_per_minute", "description": "The maximum number of messages of this type that can be sent to recipients in a minute, ensuring controlled message delivery", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "subscription_policy": {"name": "subscription_policy", "description": "Information about the policy or rules governing how users can subscribe to or unsubscribe from this specific message type, like OptOut", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "updated_at": {"name": "updated_at", "description": "Time when the message type was last updated or modified", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": "_fivetran_synced", "loaded_at_query": null, "meta": {}, "tags": [], "static_analysis": null}, "patch_path": null, "unrendered_config": {"loaded_at_field": "_fivetran_synced", "enabled": true, "loaded_at_query": null, "meta": {}, "tags": []}, "relation_name": "\"postgres\".\"public\".\"message_type_data\"", "created_at": 1789503446.7424054, "unrendered_database": "{% if target.type != 'spark' %}{{ var('iterable_database', target.database)}}{% endif %}", "unrendered_schema": "{{var ('iterable_schema', 'iterable')}}", "doc_blocks": []}, "source.iterable.iterable.template_history": {"database": "postgres", "schema": "public", "name": "template_history", "resource_type": "source", "package_name": "iterable", "path": "models/staging/src_iterable.yml", "original_file_path": "models/staging/src_iterable.yml", "unique_id": "source.iterable.iterable.template_history", "fqn": ["iterable", "staging", "iterable", "template_history"], "source_name": "iterable", "source_description": "", "loader": "fivetran", "identifier": "template_history_data", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Table containing unique templates used across campaigns.", "columns": {"id": {"name": "id", "description": "Unique identifier of the template", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "name": {"name": "name", "description": "User defined name of the template", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "template_type": {"name": "template_type", "description": "The type of the template", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "created_at": {"name": "created_at", "description": "Creation timestamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "client_template_id": {"name": "client_template_id", "description": "Reference to the client template", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "creator_user_id": {"name": "creator_user_id", "description": "Reference to the user who created the template", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "message_type_id": {"name": "message_type_id", "description": "Reference to the message type associated with the template", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "updated_at": {"name": "updated_at", "description": "Last update timestamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": "_fivetran_synced", "loaded_at_query": null, "meta": {}, "tags": [], "static_analysis": null}, "patch_path": null, "unrendered_config": {"loaded_at_field": "_fivetran_synced", "enabled": true, "loaded_at_query": null, "meta": {}, "tags": []}, "relation_name": "\"postgres\".\"public\".\"template_history_data\"", "created_at": 1789503446.743095, "unrendered_database": "{% if target.type != 'spark' %}{{ var('iterable_database', target.database)}}{% endif %}", "unrendered_schema": "{{var ('iterable_schema', 'iterable')}}", "doc_blocks": []}, "source.iterable.iterable.user_history": {"database": "postgres", "schema": "public", "name": "user_history", "resource_type": "source", "package_name": "iterable", "path": "models/staging/src_iterable.yml", "original_file_path": "models/staging/src_iterable.yml", "unique_id": "source.iterable.iterable.user_history", "fqn": ["iterable", "staging", "iterable", "user_history"], "source_name": "iterable", "source_description": "", "loader": "fivetran", "identifier": "user_history_data", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Table containing individual user history information.", "columns": {"email": {"name": "email", "description": "The user's email. Previously was the unique identifier for the user records, for Iterable customers before August 2023. This has since been replaced by iterable_user_id.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "user_id": {"name": "user_id", "description": "User defined identifier of the user. This is not a unique field", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "iterable_user_id": {"name": "iterable_user_id", "description": "The unique identifier of the user", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "first_name": {"name": "first_name", "description": "First name of the user", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "last_name": {"name": "last_name", "description": "Last name of the user", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "email_list_ids": {"name": "email_list_ids", "description": "[DEPRECATED October 13, 2025 Use LIST_USER source instead.] Array of references to the lists associated with the user\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "signup_date": {"name": "signup_date", "description": "Timestamp of when the user signed up", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "signup_source": {"name": "signup_source", "description": "Source where the user signed up", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "updated_at": {"name": "updated_at", "description": "Last update timestamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": "_fivetran_synced", "loaded_at_query": null, "meta": {}, "tags": [], "static_analysis": null}, "patch_path": null, "unrendered_config": {"loaded_at_field": "_fivetran_synced", "enabled": true, "loaded_at_query": null, "meta": {}, "tags": []}, "relation_name": "\"postgres\".\"public\".\"user_history_data\"", "created_at": 1789503446.7437766, "unrendered_database": "{% if target.type != 'spark' %}{{ var('iterable_database', target.database)}}{% endif %}", "unrendered_schema": "{{var ('iterable_schema', 'iterable')}}", "doc_blocks": []}, "source.iterable.iterable.user_unsubscribed_channel": {"database": "postgres", "schema": "public", "name": "user_unsubscribed_channel", "resource_type": "source", "package_name": "iterable", "path": "models/staging/src_iterable.yml", "original_file_path": "models/staging/src_iterable.yml", "unique_id": "source.iterable.iterable.user_unsubscribed_channel", "fqn": ["iterable", "staging", "iterable", "user_unsubscribed_channel"], "source_name": "iterable", "source_description": "", "loader": "fivetran", "identifier": "user_unsubscribed_channel_data", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Table containing the channels from which a user has unsubscribed.", "columns": {"_fivetran_id": {"name": "_fivetran_id", "description": "A Fivetran-created unique identifier for users, derived from hashing user_id and/or email, depending on project type.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "channel_id": {"name": "channel_id", "description": "Reference to the channel from which the user unsubscribed", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": "_fivetran_synced", "loaded_at_query": null, "meta": {}, "tags": [], "static_analysis": null}, "patch_path": null, "unrendered_config": {"loaded_at_field": "_fivetran_synced", "enabled": true, "loaded_at_query": null, "meta": {}, "tags": []}, "relation_name": "\"postgres\".\"public\".\"user_unsubscribed_channel_data\"", "created_at": 1789503446.7444537, "unrendered_database": "{% if target.type != 'spark' %}{{ var('iterable_database', target.database)}}{% endif %}", "unrendered_schema": "{{var ('iterable_schema', 'iterable')}}", "doc_blocks": []}, "source.iterable.iterable.user_unsubscribed_message_type": {"database": "postgres", "schema": "public", "name": "user_unsubscribed_message_type", "resource_type": "source", "package_name": "iterable", "path": "models/staging/src_iterable.yml", "original_file_path": "models/staging/src_iterable.yml", "unique_id": "source.iterable.iterable.user_unsubscribed_message_type", "fqn": ["iterable", "staging", "iterable", "user_unsubscribed_message_type"], "source_name": "iterable", "source_description": "", "loader": "fivetran", "identifier": "user_unsubscribed_message_type_data", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Table containing the message types from which a user has unsubscribed.", "columns": {"_fivetran_id": {"name": "_fivetran_id", "description": "A Fivetran-created unique identifier for users, derived from hashing user_id and/or email, depending on project type.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "message_type_id": {"name": "message_type_id", "description": "Reference to the message type from which the user unsubscribed", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": "_fivetran_synced", "loaded_at_query": null, "meta": {}, "tags": [], "static_analysis": null}, "patch_path": null, "unrendered_config": {"loaded_at_field": "_fivetran_synced", "enabled": true, "loaded_at_query": null, "meta": {}, "tags": []}, "relation_name": "\"postgres\".\"public\".\"user_unsubscribed_message_type_data\"", "created_at": 1789503446.745158, "unrendered_database": "{% if target.type != 'spark' %}{{ var('iterable_database', target.database)}}{% endif %}", "unrendered_schema": "{{var ('iterable_schema', 'iterable')}}", "doc_blocks": []}, "source.iterable.iterable.user_unsubscribed_channel_history": {"database": "postgres", "schema": "public", "name": "user_unsubscribed_channel_history", "resource_type": "source", "package_name": "iterable", "path": "models/staging/src_iterable.yml", "original_file_path": "models/staging/src_iterable.yml", "unique_id": "source.iterable.iterable.user_unsubscribed_channel_history", "fqn": ["iterable", "staging", "iterable", "user_unsubscribed_channel_history"], "source_name": "iterable", "source_description": "", "loader": "fivetran", "identifier": "user_unsubscribed_channel_history_data", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Table containing the history of channels from which a user has unsubscribed.", "columns": {"channel_id": {"name": "channel_id", "description": "Reference to the channel from which the user unsubscribed", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "email": {"name": "email", "description": "Unique identifier of the user", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "updated_at": {"name": "updated_at", "description": "Last update timestamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": "_fivetran_synced", "loaded_at_query": null, "meta": {}, "tags": [], "static_analysis": null}, "patch_path": null, "unrendered_config": {"loaded_at_field": "_fivetran_synced", "enabled": true, "loaded_at_query": null, "meta": {}, "tags": []}, "relation_name": "\"postgres\".\"public\".\"user_unsubscribed_channel_history_data\"", "created_at": 1789503446.7458887, "unrendered_database": "{% if target.type != 'spark' %}{{ var('iterable_database', target.database)}}{% endif %}", "unrendered_schema": "{{var ('iterable_schema', 'iterable')}}", "doc_blocks": []}, "source.iterable.iterable.user_unsubscribed_message_type_history": {"database": "postgres", "schema": "public", "name": "user_unsubscribed_message_type_history", "resource_type": "source", "package_name": "iterable", "path": "models/staging/src_iterable.yml", "original_file_path": "models/staging/src_iterable.yml", "unique_id": "source.iterable.iterable.user_unsubscribed_message_type_history", "fqn": ["iterable", "staging", "iterable", "user_unsubscribed_message_type_history"], "source_name": "iterable", "source_description": "", "loader": "fivetran", "identifier": "user_unsubscribed_message_type_history_data", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Table containing the history of message types from which a user has unsubscribed.", "columns": {"message_type_id": {"name": "message_type_id", "description": "Reference to the message type from which the user unsubscribed", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "email": {"name": "email", "description": "Unique identifier of the user", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "updated_at": {"name": "updated_at", "description": "Last update timestamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": "_fivetran_synced", "loaded_at_query": null, "meta": {}, "tags": [], "static_analysis": null}, "patch_path": null, "unrendered_config": {"loaded_at_field": "_fivetran_synced", "enabled": true, "loaded_at_query": null, "meta": {}, "tags": []}, "relation_name": "\"postgres\".\"public\".\"user_unsubscribed_message_type_history_data\"", "created_at": 1789503446.7466168, "unrendered_database": "{% if target.type != 'spark' %}{{ var('iterable_database', target.database)}}{% endif %}", "unrendered_schema": "{{var ('iterable_schema', 'iterable')}}", "doc_blocks": []}, "source.iterable.iterable.list_user": {"database": "postgres", "schema": "public", "name": "list_user", "resource_type": "source", "package_name": "iterable", "path": "models/staging/src_iterable.yml", "original_file_path": "models/staging/src_iterable.yml", "unique_id": "source.iterable.iterable.list_user", "fqn": ["iterable", "staging", "iterable", "list_user"], "source_name": "iterable", "source_description": "", "loader": "fivetran", "identifier": "list_user_data", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "loaded_at_query": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Table containing the relationship between users and lists they belong to.", "columns": {"_fivetran_id": {"name": "_fivetran_id", "description": "Unique identifier of the list-user relationship record, serving as a foreign key to `user_history._fivetran_id`.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "index": {"name": "index", "description": "Index of the record", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "list_id": {"name": "list_id", "description": "Reference to the list that the user belongs to", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "Timestamp when the record was last synced by Fivetran", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "dimension": null, "entity": null, "doc_blocks": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "loaded_at_field": "_fivetran_synced", "loaded_at_query": null, "meta": {}, "tags": [], "static_analysis": null}, "patch_path": null, "unrendered_config": {"loaded_at_field": "_fivetran_synced", "enabled": true, "loaded_at_query": null, "meta": {}, "tags": []}, "relation_name": "\"postgres\".\"public\".\"list_user_data\"", "created_at": 1789503446.747314, "unrendered_database": "{% if target.type != 'spark' %}{{ var('iterable_database', target.database)}}{% endif %}", "unrendered_schema": "{{var ('iterable_schema', 'iterable')}}", "doc_blocks": []}}, "macros": {"macro.dbt_postgres.postgres__current_timestamp": {"name": "postgres__current_timestamp", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/timestamps.sql", "original_file_path": "macros/timestamps.sql", "unique_id": "macro.dbt_postgres.postgres__current_timestamp", "macro_sql": "{% macro postgres__current_timestamp() -%}\n now()\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789503442.9574149, "supported_languages": null}, "macro.dbt_postgres.postgres__snapshot_string_as_time": {"name": "postgres__snapshot_string_as_time", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/timestamps.sql", "original_file_path": "macros/timestamps.sql", "unique_id": "macro.dbt_postgres.postgres__snapshot_string_as_time", "macro_sql": "{% macro postgres__snapshot_string_as_time(timestamp) -%}\n {%- set result = \"'\" ~ timestamp ~ \"'::timestamp without time zone\" -%}\n {{ return(result) }}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "timestamp", "type": null, "description": ""}], "created_at": 1789503442.9578629, "supported_languages": null}, "macro.dbt_postgres.postgres__snapshot_get_time": {"name": "postgres__snapshot_get_time", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/timestamps.sql", "original_file_path": "macros/timestamps.sql", "unique_id": "macro.dbt_postgres.postgres__snapshot_get_time", "macro_sql": "{% macro postgres__snapshot_get_time() -%}\n {{ current_timestamp() }}::timestamp without time zone\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.current_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789503442.9581335, "supported_languages": null}, "macro.dbt_postgres.postgres__current_timestamp_backcompat": {"name": "postgres__current_timestamp_backcompat", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/timestamps.sql", "original_file_path": "macros/timestamps.sql", "unique_id": "macro.dbt_postgres.postgres__current_timestamp_backcompat", "macro_sql": "{% macro postgres__current_timestamp_backcompat() %}\n current_timestamp::{{ type_timestamp() }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.type_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789503442.9583695, "supported_languages": null}, "macro.dbt_postgres.postgres__current_timestamp_in_utc_backcompat": {"name": "postgres__current_timestamp_in_utc_backcompat", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/timestamps.sql", "original_file_path": "macros/timestamps.sql", "unique_id": "macro.dbt_postgres.postgres__current_timestamp_in_utc_backcompat", "macro_sql": "{% macro postgres__current_timestamp_in_utc_backcompat() %}\n (current_timestamp at time zone 'utc')::{{ type_timestamp() }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.type_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789503442.958599, "supported_languages": null}, "macro.dbt_postgres.postgres__get_catalog_relations": {"name": "postgres__get_catalog_relations", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/catalog.sql", "original_file_path": "macros/catalog.sql", "unique_id": "macro.dbt_postgres.postgres__get_catalog_relations", "macro_sql": "{% macro postgres__get_catalog_relations(information_schema, relations) -%}\n {%- call statement('catalog', fetch_result=True) -%}\n\n {#\n If the user has multiple databases set and the first one is wrong, this will fail.\n But we won't fail in the case where there are multiple quoting-difference-only dbs, which is better.\n #}\n {% set database = information_schema.database %}\n {{ adapter.verify_database(database) }}\n\n select\n '{{ database }}' as table_database,\n sch.nspname as table_schema,\n tbl.relname as table_name,\n case tbl.relkind\n when 'v' then 'VIEW'\n when 'm' then 'MATERIALIZED VIEW'\n else 'BASE TABLE'\n end as table_type,\n tbl_desc.description as table_comment,\n col.attname as column_name,\n col.attnum as column_index,\n pg_catalog.format_type(col.atttypid, col.atttypmod) as column_type,\n col_desc.description as column_comment,\n pg_get_userbyid(tbl.relowner) as table_owner\n\n from pg_catalog.pg_namespace sch\n join pg_catalog.pg_class tbl on tbl.relnamespace = sch.oid\n join pg_catalog.pg_attribute col on col.attrelid = tbl.oid\n left outer join pg_catalog.pg_description tbl_desc on (tbl_desc.objoid = tbl.oid and tbl_desc.objsubid = 0)\n left outer join pg_catalog.pg_description col_desc on (col_desc.objoid = tbl.oid and col_desc.objsubid = col.attnum)\n where (\n {%- for relation in relations -%}\n {%- if relation.identifier -%}\n (upper(sch.nspname) = upper('{{ relation.schema }}') and\n upper(tbl.relname) = upper('{{ relation.identifier }}'))\n {%- else-%}\n upper(sch.nspname) = upper('{{ relation.schema }}')\n {%- endif -%}\n {%- if not loop.last %} or {% endif -%}\n {%- endfor -%}\n )\n and not pg_is_other_temp_schema(sch.oid) -- not a temporary schema belonging to another session\n and tbl.relpersistence in ('p', 'u') -- [p]ermanent table or [u]nlogged table. Exclude [t]emporary tables\n and tbl.relkind in ('r', 'v', 'f', 'p', 'm') -- o[r]dinary table, [v]iew, [f]oreign table, [p]artitioned table, [m]aterialized view. Other values are [i]ndex, [S]equence, [c]omposite type, [t]OAST table\n and col.attnum > 0 -- negative numbers are used for system columns such as oid\n and not col.attisdropped -- column as not been dropped\n\n order by\n sch.nspname,\n tbl.relname,\n col.attnum\n\n {%- endcall -%}\n\n {{ return(load_result('catalog').table) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "information_schema", "type": null, "description": ""}, {"name": "relations", "type": null, "description": ""}], "created_at": 1789503442.9607022, "supported_languages": null}, "macro.dbt_postgres.postgres__get_catalog": {"name": "postgres__get_catalog", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/catalog.sql", "original_file_path": "macros/catalog.sql", "unique_id": "macro.dbt_postgres.postgres__get_catalog", "macro_sql": "{% macro postgres__get_catalog(information_schema, schemas) -%}\n {%- set relations = [] -%}\n {%- for schema in schemas -%}\n {%- set dummy = relations.append({'schema': schema}) -%}\n {%- endfor -%}\n {{ return(postgres__get_catalog_relations(information_schema, relations)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__get_catalog_relations"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "information_schema", "type": null, "description": ""}, {"name": "schemas", "type": null, "description": ""}], "created_at": 1789503442.9614773, "supported_languages": null}, "macro.dbt_postgres.postgres__get_relations": {"name": "postgres__get_relations", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/relations.sql", "original_file_path": "macros/relations.sql", "unique_id": "macro.dbt_postgres.postgres__get_relations", "macro_sql": "{% macro postgres__get_relations() -%}\n\n {#\n -- in pg_depend, objid is the dependent, refobjid is the referenced object\n -- > a pg_depend entry indicates that the referenced object cannot be\n -- > dropped without also dropping the dependent object.\n #}\n\n {%- call statement('relations', fetch_result=True) -%}\n select distinct\n dependent_namespace.nspname as dependent_schema,\n dependent_class.relname as dependent_name,\n referenced_namespace.nspname as referenced_schema,\n referenced_class.relname as referenced_name\n\n -- Query for views: views are entries in pg_class with an entry in pg_rewrite, but we avoid\n -- a seq scan on pg_rewrite by leveraging the fact there is an \"internal\" row in pg_depend for\n -- the view...\n from pg_class as dependent_class\n join pg_namespace as dependent_namespace on dependent_namespace.oid = dependent_class.relnamespace\n join pg_depend as dependent_depend on dependent_depend.refobjid = dependent_class.oid\n and dependent_depend.classid = 'pg_rewrite'::regclass\n and dependent_depend.refclassid = 'pg_class'::regclass\n and dependent_depend.deptype = 'i'\n\n -- ... and via pg_depend (that has a row per column, hence the need for \"distinct\" above, and\n -- making sure to exclude the internal row to avoid a view appearing to depend on itself)...\n join pg_depend as joining_depend on joining_depend.objid = dependent_depend.objid\n and joining_depend.classid = 'pg_rewrite'::regclass\n and joining_depend.refclassid = 'pg_class'::regclass\n and joining_depend.refobjid != dependent_depend.refobjid\n\n -- ... we can find the tables they query from in pg_class, but excluding system tables. Note we\n -- don't need need to exclude _dependent_ system tables, because they only query from other\n -- system tables, and so are automatically excluded by excluding _referenced_ system tables\n join pg_class as referenced_class on referenced_class.oid = joining_depend.refobjid\n join pg_namespace as referenced_namespace on referenced_namespace.oid = referenced_class.relnamespace\n and referenced_namespace.nspname != 'information_schema'\n and referenced_namespace.nspname not like 'pg\\_%'\n\n order by\n dependent_schema, dependent_name, referenced_schema, referenced_name;\n\n {%- endcall -%}\n\n {{ return(load_result('relations').table) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789503442.9624937, "supported_languages": null}, "macro.dbt_postgres.postgres_get_relations": {"name": "postgres_get_relations", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/relations.sql", "original_file_path": "macros/relations.sql", "unique_id": "macro.dbt_postgres.postgres_get_relations", "macro_sql": "{% macro postgres_get_relations() %}\n {{ return(postgres__get_relations()) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__get_relations"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789503442.9627688, "supported_languages": null}, "macro.dbt_postgres.postgres__create_table_as": {"name": "postgres__create_table_as", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "unique_id": "macro.dbt_postgres.postgres__create_table_as", "macro_sql": "{% macro postgres__create_table_as(temporary, relation, sql) -%}\n {%- set unlogged = config.get('unlogged', default=false) -%}\n {%- set sql_header = config.get('sql_header', none) -%}\n\n {{ sql_header if sql_header is not none }}\n\n create {% if temporary -%}\n temporary\n {%- elif unlogged -%}\n unlogged\n {%- endif %} table {{ relation }}\n {% set contract_config = config.get('contract') %}\n {% if contract_config.enforced %}\n {{ get_assert_columns_equivalent(sql) }}\n {% endif -%}\n {% if contract_config.enforced and (not temporary) -%}\n {{ get_table_columns_and_constraints() }} ;\n insert into {{ relation }} (\n {{ adapter.dispatch('get_column_names', 'dbt')() }}\n )\n {%- set sql = get_select_subquery(sql) %}\n {% else %}\n as\n {% endif %}\n (\n {{ sql }}\n );\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.get_assert_columns_equivalent", "macro.dbt.get_table_columns_and_constraints", "macro.dbt.default__get_column_names", "macro.dbt.get_select_subquery"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "temporary", "type": null, "description": ""}, {"name": "relation", "type": null, "description": ""}, {"name": "sql", "type": null, "description": ""}], "created_at": 1789503442.9673457, "supported_languages": null}, "macro.dbt_postgres.postgres__get_create_index_sql": {"name": "postgres__get_create_index_sql", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "unique_id": "macro.dbt_postgres.postgres__get_create_index_sql", "macro_sql": "{% macro postgres__get_create_index_sql(relation, index_dict) -%}\n {%- set index_config = adapter.parse_index(index_dict) -%}\n {%- set comma_separated_columns = \", \".join(index_config.columns) -%}\n {%- set index_name = index_config.render(relation) -%}\n\n create {% if index_config.unique -%}\n unique\n {%- endif %} index if not exists\n \"{{ index_name }}\"\n on {{ relation }} {% if index_config.type -%}\n using {{ index_config.type }}\n {%- endif %}\n ({{ comma_separated_columns }})\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "index_dict", "type": null, "description": ""}], "created_at": 1789503442.968386, "supported_languages": null}, "macro.dbt_postgres.postgres__create_schema": {"name": "postgres__create_schema", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "unique_id": "macro.dbt_postgres.postgres__create_schema", "macro_sql": "{% macro postgres__create_schema(relation) -%}\n {% if relation.database -%}\n {{ adapter.verify_database(relation.database) }}\n {%- endif -%}\n {%- call statement('create_schema') -%}\n create schema if not exists {{ relation.without_identifier().include(database=False) }}\n {%- endcall -%}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789503442.969043, "supported_languages": null}, "macro.dbt_postgres.postgres__drop_schema": {"name": "postgres__drop_schema", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "unique_id": "macro.dbt_postgres.postgres__drop_schema", "macro_sql": "{% macro postgres__drop_schema(relation) -%}\n {% if relation.database -%}\n {{ adapter.verify_database(relation.database) }}\n {%- endif -%}\n {%- call statement('drop_schema') -%}\n drop schema if exists {{ relation.without_identifier().include(database=False) }} cascade\n {%- endcall -%}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789503442.9696858, "supported_languages": null}, "macro.dbt_postgres.postgres__get_columns_in_relation": {"name": "postgres__get_columns_in_relation", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "unique_id": "macro.dbt_postgres.postgres__get_columns_in_relation", "macro_sql": "{% macro postgres__get_columns_in_relation(relation) -%}\n {% call statement('get_columns_in_relation', fetch_result=True) %}\n select\n column_name,\n data_type,\n character_maximum_length,\n numeric_precision,\n numeric_scale\n\n from {{ relation.information_schema('columns') }}\n where table_name = '{{ relation.identifier }}'\n {% if relation.schema %}\n and table_schema = '{{ relation.schema }}'\n {% endif %}\n order by ordinal_position\n\n {% endcall %}\n {% set table = load_result('get_columns_in_relation').table %}\n {{ return(sql_convert_columns_in_relation(table)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement", "macro.dbt.sql_convert_columns_in_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789503442.9706593, "supported_languages": null}, "macro.dbt_postgres.postgres__list_relations_without_caching": {"name": "postgres__list_relations_without_caching", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "unique_id": "macro.dbt_postgres.postgres__list_relations_without_caching", "macro_sql": "{% macro postgres__list_relations_without_caching(schema_relation) %}\n {% call statement('list_relations_without_caching', fetch_result=True) -%}\n select\n '{{ schema_relation.database }}' as database,\n tablename as name,\n schemaname as schema,\n 'table' as type\n from pg_tables\n where schemaname ilike '{{ schema_relation.schema }}'\n union all\n select\n '{{ schema_relation.database }}' as database,\n viewname as name,\n schemaname as schema,\n 'view' as type\n from pg_views\n where schemaname ilike '{{ schema_relation.schema }}'\n union all\n select\n '{{ schema_relation.database }}' as database,\n matviewname as name,\n schemaname as schema,\n 'materialized_view' as type\n from pg_matviews\n where schemaname ilike '{{ schema_relation.schema }}'\n union all\n select distinct\n '{{ schema_relation.database }}' as database,\n proname as name,\n ns.nspname as schema,\n 'function' as type\n from pg_proc\n join pg_namespace as ns on pronamespace = ns.oid\n where ns.nspname ilike '{{ schema_relation.schema }}'\n {% endcall %}\n {{ return(load_result('list_relations_without_caching').table) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "schema_relation", "type": null, "description": ""}], "created_at": 1789503442.9716792, "supported_languages": null}, "macro.dbt_postgres.postgres__information_schema_name": {"name": "postgres__information_schema_name", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "unique_id": "macro.dbt_postgres.postgres__information_schema_name", "macro_sql": "{% macro postgres__information_schema_name(database) -%}\n {% if database_name -%}\n {{ adapter.verify_database(database_name) }}\n {%- endif -%}\n information_schema\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "database", "type": null, "description": ""}], "created_at": 1789503442.972068, "supported_languages": null}, "macro.dbt_postgres.postgres__list_schemas": {"name": "postgres__list_schemas", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "unique_id": "macro.dbt_postgres.postgres__list_schemas", "macro_sql": "{% macro postgres__list_schemas(database) %}\n {% if database -%}\n {{ adapter.verify_database(database) }}\n {%- endif -%}\n {% call statement('list_schemas', fetch_result=True, auto_begin=False) %}\n select distinct nspname from pg_namespace\n {% endcall %}\n {{ return(load_result('list_schemas').table) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "database", "type": null, "description": ""}], "created_at": 1789503442.9727604, "supported_languages": null}, "macro.dbt_postgres.postgres__check_schema_exists": {"name": "postgres__check_schema_exists", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "unique_id": "macro.dbt_postgres.postgres__check_schema_exists", "macro_sql": "{% macro postgres__check_schema_exists(information_schema, schema) -%}\n {% if information_schema.database -%}\n {{ adapter.verify_database(information_schema.database) }}\n {%- endif -%}\n {% call statement('check_schema_exists', fetch_result=True, auto_begin=False) %}\n select count(*) from pg_namespace where nspname = '{{ schema }}'\n {% endcall %}\n {{ return(load_result('check_schema_exists').table) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "information_schema", "type": null, "description": ""}, {"name": "schema", "type": null, "description": ""}], "created_at": 1789503442.9735644, "supported_languages": null}, "macro.dbt_postgres.postgres__make_relation_with_suffix": {"name": "postgres__make_relation_with_suffix", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "unique_id": "macro.dbt_postgres.postgres__make_relation_with_suffix", "macro_sql": "{% macro postgres__make_relation_with_suffix(base_relation, suffix, dstring) %}\n {% if dstring %}\n {% set dt = modules.datetime.datetime.now() %}\n {% set dtstring = dt.strftime(\"%H%M%S%f\") %}\n {% set suffix = suffix ~ dtstring %}\n {% endif %}\n {% set suffix_length = suffix|length %}\n {% set relation_max_name_length = base_relation.relation_max_name_length() %}\n {% if suffix_length > relation_max_name_length %}\n {% do exceptions.raise_compiler_error('Relation suffix is too long (' ~ suffix_length ~ ' characters). Maximum length is ' ~ relation_max_name_length ~ ' characters.') %}\n {% endif %}\n {% set identifier = base_relation.identifier[:relation_max_name_length - suffix_length] ~ suffix %}\n\n {{ return(base_relation.incorporate(path={\"identifier\": identifier })) }}\n\n {% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "base_relation", "type": null, "description": ""}, {"name": "suffix", "type": null, "description": ""}, {"name": "dstring", "type": null, "description": ""}], "created_at": 1789503442.9753644, "supported_languages": null}, "macro.dbt_postgres.postgres__make_intermediate_relation": {"name": "postgres__make_intermediate_relation", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "unique_id": "macro.dbt_postgres.postgres__make_intermediate_relation", "macro_sql": "{% macro postgres__make_intermediate_relation(base_relation, suffix) %}\n {{ return(postgres__make_relation_with_suffix(base_relation, suffix, dstring=False)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__make_relation_with_suffix"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "base_relation", "type": null, "description": ""}, {"name": "suffix", "type": null, "description": ""}], "created_at": 1789503442.9757614, "supported_languages": null}, "macro.dbt_postgres.postgres__make_temp_relation": {"name": "postgres__make_temp_relation", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "unique_id": "macro.dbt_postgres.postgres__make_temp_relation", "macro_sql": "{% macro postgres__make_temp_relation(base_relation, suffix) %}\n {% set temp_relation = postgres__make_relation_with_suffix(base_relation, suffix, dstring=True) %}\n {{ return(temp_relation.incorporate(path={\"schema\": none,\n \"database\": none})) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__make_relation_with_suffix"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "base_relation", "type": null, "description": ""}, {"name": "suffix", "type": null, "description": ""}], "created_at": 1789503442.9764209, "supported_languages": null}, "macro.dbt_postgres.postgres__make_backup_relation": {"name": "postgres__make_backup_relation", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "unique_id": "macro.dbt_postgres.postgres__make_backup_relation", "macro_sql": "{% macro postgres__make_backup_relation(base_relation, backup_relation_type, suffix) %}\n {% set backup_relation = postgres__make_relation_with_suffix(base_relation, suffix, dstring=False) %}\n {{ return(backup_relation.incorporate(type=backup_relation_type)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__make_relation_with_suffix"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "base_relation", "type": null, "description": ""}, {"name": "backup_relation_type", "type": null, "description": ""}, {"name": "suffix", "type": null, "description": ""}], "created_at": 1789503442.9769638, "supported_languages": null}, "macro.dbt_postgres.postgres_escape_comment": {"name": "postgres_escape_comment", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "unique_id": "macro.dbt_postgres.postgres_escape_comment", "macro_sql": "{% macro postgres_escape_comment(comment) -%}\n {% if comment is not string %}\n {% do exceptions.raise_compiler_error('cannot escape a non-string: ' ~ comment) %}\n {% endif %}\n {%- set magic = '$dbt_comment_literal_block$' -%}\n {%- if magic in comment -%}\n {%- do exceptions.raise_compiler_error('The string ' ~ magic ~ ' is not allowed in comments.') -%}\n {%- endif -%}\n {{ magic }}{{ comment }}{{ magic }}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "comment", "type": null, "description": ""}], "created_at": 1789503442.9778473, "supported_languages": null}, "macro.dbt_postgres.postgres__alter_relation_comment": {"name": "postgres__alter_relation_comment", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "unique_id": "macro.dbt_postgres.postgres__alter_relation_comment", "macro_sql": "{% macro postgres__alter_relation_comment(relation, comment) %}\n {% set escaped_comment = postgres_escape_comment(comment) %}\n {% if relation.type == 'materialized_view' -%}\n {% set relation_type = \"materialized view\" %}\n {%- else -%}\n {%- set relation_type = relation.type -%}\n {%- endif -%}\n comment on {{ relation_type }} {{ relation }} is {{ escaped_comment }};\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres_escape_comment"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "comment", "type": null, "description": ""}], "created_at": 1789503442.978633, "supported_languages": null}, "macro.dbt_postgres.postgres__alter_column_comment": {"name": "postgres__alter_column_comment", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "unique_id": "macro.dbt_postgres.postgres__alter_column_comment", "macro_sql": "{% macro postgres__alter_column_comment(relation, column_dict) %}\n {% set existing_columns = adapter.get_columns_in_relation(relation) | map(attribute=\"name\") | list %}\n {% for column_name in column_dict if (column_name in existing_columns) %}\n {% set comment = column_dict[column_name]['description'] %}\n {% set escaped_comment = postgres_escape_comment(comment) %}\n comment on column {{ relation }}.{{ adapter.quote(column_name) if column_dict[column_name]['quote'] else column_name }} is {{ escaped_comment }};\n {% endfor %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres_escape_comment"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "column_dict", "type": null, "description": ""}], "created_at": 1789503442.979831, "supported_languages": null}, "macro.dbt_postgres.postgres__get_show_grant_sql": {"name": "postgres__get_show_grant_sql", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "unique_id": "macro.dbt_postgres.postgres__get_show_grant_sql", "macro_sql": "\n\n{%- macro postgres__get_show_grant_sql(relation) -%}\n select grantee, privilege_type\n from {{ relation.information_schema('role_table_grants') }}\n where grantor = current_role\n and grantee != current_role\n and table_schema = '{{ relation.schema }}'\n and table_name = '{{ relation.identifier }}'\n{%- endmacro -%}\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789503442.9802651, "supported_languages": null}, "macro.dbt_postgres.postgres__copy_grants": {"name": "postgres__copy_grants", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "unique_id": "macro.dbt_postgres.postgres__copy_grants", "macro_sql": "{% macro postgres__copy_grants() %}\n {{ return(False) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789503442.980509, "supported_languages": null}, "macro.dbt_postgres.postgres__get_show_indexes_sql": {"name": "postgres__get_show_indexes_sql", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "unique_id": "macro.dbt_postgres.postgres__get_show_indexes_sql", "macro_sql": "{% macro postgres__get_show_indexes_sql(relation) %}\n select\n i.relname as name,\n m.amname as method,\n ix.indisunique as \"unique\",\n array_to_string(array_agg(a.attname), ',') as column_names\n from pg_index ix\n join pg_class i\n on i.oid = ix.indexrelid\n join pg_am m\n on m.oid=i.relam\n join pg_class t\n on t.oid = ix.indrelid\n join pg_namespace n\n on n.oid = t.relnamespace\n join pg_attribute a\n on a.attrelid = t.oid\n and a.attnum = ANY(ix.indkey)\n where t.relname = '{{ relation.identifier }}'\n and n.nspname = '{{ relation.schema }}'\n and t.relkind in ('r', 'm')\n group by 1, 2, 3\n order by 1, 2, 3\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789503442.9808564, "supported_languages": null}, "macro.dbt_postgres.postgres__get_drop_index_sql": {"name": "postgres__get_drop_index_sql", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "unique_id": "macro.dbt_postgres.postgres__get_drop_index_sql", "macro_sql": "\n\n\n{%- macro postgres__get_drop_index_sql(relation, index_name) -%}\n drop index if exists \"{{ relation.schema }}\".\"{{ index_name }}\"\n{%- endmacro -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "index_name", "type": null, "description": ""}], "created_at": 1789503442.9811785, "supported_languages": null}, "macro.dbt_postgres.postgres__get_create_materialized_view_as_sql": {"name": "postgres__get_create_materialized_view_as_sql", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/relations/materialized_view/create.sql", "original_file_path": "macros/relations/materialized_view/create.sql", "unique_id": "macro.dbt_postgres.postgres__get_create_materialized_view_as_sql", "macro_sql": "{% macro postgres__get_create_materialized_view_as_sql(relation, sql) %}\n create materialized view if not exists {{ relation }} as {{ sql }};\n\n {% for _index_dict in config.get('indexes', []) -%}\n {{- get_create_index_sql(relation, _index_dict) -}}{{ ';' if not loop.last else \"\" }}\n {%- endfor -%}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_create_index_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "sql", "type": null, "description": ""}], "created_at": 1789503442.9820764, "supported_languages": null}, "macro.dbt_postgres.postgres__get_alter_materialized_view_as_sql": {"name": "postgres__get_alter_materialized_view_as_sql", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/relations/materialized_view/alter.sql", "original_file_path": "macros/relations/materialized_view/alter.sql", "unique_id": "macro.dbt_postgres.postgres__get_alter_materialized_view_as_sql", "macro_sql": "{% macro postgres__get_alter_materialized_view_as_sql(\n relation,\n configuration_changes,\n sql,\n existing_relation,\n backup_relation,\n intermediate_relation\n) %}\n\n -- apply a full refresh immediately if needed\n {% if configuration_changes.requires_full_refresh %}\n\n {{ get_replace_sql(existing_relation, relation, sql) }}\n\n -- otherwise apply individual changes as needed\n {% else %}\n\n {{ postgres__update_indexes_on_materialized_view(relation, configuration_changes.indexes) }}\n\n {%- endif -%}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_replace_sql", "macro.dbt_postgres.postgres__update_indexes_on_materialized_view"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "configuration_changes", "type": null, "description": ""}, {"name": "sql", "type": null, "description": ""}, {"name": "existing_relation", "type": null, "description": ""}, {"name": "backup_relation", "type": null, "description": ""}, {"name": "intermediate_relation", "type": null, "description": ""}], "created_at": 1789503442.9831939, "supported_languages": null}, "macro.dbt_postgres.postgres__update_indexes_on_materialized_view": {"name": "postgres__update_indexes_on_materialized_view", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/relations/materialized_view/alter.sql", "original_file_path": "macros/relations/materialized_view/alter.sql", "unique_id": "macro.dbt_postgres.postgres__update_indexes_on_materialized_view", "macro_sql": "\n\n\n{%- macro postgres__update_indexes_on_materialized_view(relation, index_changes) -%}\n {{- log(\"Applying UPDATE INDEXES to: \" ~ relation) -}}\n\n {%- for _index_change in index_changes -%}\n {%- set _index = _index_change.context -%}\n\n {%- if _index_change.action == \"drop\" -%}\n\n {{ postgres__get_drop_index_sql(relation, _index.name) }}\n\n {%- elif _index_change.action == \"create\" -%}\n\n {{ postgres__get_create_index_sql(relation, _index.as_node_config) }}\n\n {%- endif -%}\n\t{{ ';' if not loop.last else \"\" }}\n\n {%- endfor -%}\n\n{%- endmacro -%}\n\n\n", "depends_on": {"macros": ["macro.dbt_postgres.postgres__get_drop_index_sql", "macro.dbt_postgres.postgres__get_create_index_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "index_changes", "type": null, "description": ""}], "created_at": 1789503442.9843051, "supported_languages": null}, "macro.dbt_postgres.postgres__get_materialized_view_configuration_changes": {"name": "postgres__get_materialized_view_configuration_changes", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/relations/materialized_view/alter.sql", "original_file_path": "macros/relations/materialized_view/alter.sql", "unique_id": "macro.dbt_postgres.postgres__get_materialized_view_configuration_changes", "macro_sql": "{% macro postgres__get_materialized_view_configuration_changes(existing_relation, new_config) %}\n {% set _existing_materialized_view = postgres__describe_materialized_view(existing_relation) %}\n {% set _configuration_changes = existing_relation.get_materialized_view_config_change_collection(_existing_materialized_view, new_config.model) %}\n {% do return(_configuration_changes) %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__describe_materialized_view"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "existing_relation", "type": null, "description": ""}, {"name": "new_config", "type": null, "description": ""}], "created_at": 1789503442.9849017, "supported_languages": null}, "macro.dbt_postgres.postgres__get_rename_materialized_view_sql": {"name": "postgres__get_rename_materialized_view_sql", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/relations/materialized_view/rename.sql", "original_file_path": "macros/relations/materialized_view/rename.sql", "unique_id": "macro.dbt_postgres.postgres__get_rename_materialized_view_sql", "macro_sql": "{% macro postgres__get_rename_materialized_view_sql(relation, new_name) %}\n alter materialized view {{ relation }} rename to {{ new_name }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "new_name", "type": null, "description": ""}], "created_at": 1789503442.9852977, "supported_languages": null}, "macro.dbt_postgres.postgres__refresh_materialized_view": {"name": "postgres__refresh_materialized_view", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/relations/materialized_view/refresh.sql", "original_file_path": "macros/relations/materialized_view/refresh.sql", "unique_id": "macro.dbt_postgres.postgres__refresh_materialized_view", "macro_sql": "{% macro postgres__refresh_materialized_view(relation) %}\n refresh materialized view {{ relation }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789503442.9855855, "supported_languages": null}, "macro.dbt_postgres.postgres__drop_materialized_view": {"name": "postgres__drop_materialized_view", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/relations/materialized_view/drop.sql", "original_file_path": "macros/relations/materialized_view/drop.sql", "unique_id": "macro.dbt_postgres.postgres__drop_materialized_view", "macro_sql": "{% macro postgres__drop_materialized_view(relation) -%}\n drop materialized view if exists {{ relation }} cascade\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789503442.9858692, "supported_languages": null}, "macro.dbt_postgres.postgres__describe_materialized_view": {"name": "postgres__describe_materialized_view", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/relations/materialized_view/describe.sql", "original_file_path": "macros/relations/materialized_view/describe.sql", "unique_id": "macro.dbt_postgres.postgres__describe_materialized_view", "macro_sql": "{% macro postgres__describe_materialized_view(relation) %}\n -- for now just get the indexes, we don't need the name or the query yet\n {% set _indexes = run_query(get_show_indexes_sql(relation)) %}\n {% do return({'indexes': _indexes}) %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.run_query", "macro.dbt.get_show_indexes_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789503442.9865882, "supported_languages": null}, "macro.dbt_postgres.postgres__get_rename_view_sql": {"name": "postgres__get_rename_view_sql", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/relations/view/rename.sql", "original_file_path": "macros/relations/view/rename.sql", "unique_id": "macro.dbt_postgres.postgres__get_rename_view_sql", "macro_sql": "{% macro postgres__get_rename_view_sql(relation, new_name) %}\n alter view {{ relation }} rename to {{ new_name }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "new_name", "type": null, "description": ""}], "created_at": 1789503442.986951, "supported_languages": null}, "macro.dbt_postgres.postgres__drop_view": {"name": "postgres__drop_view", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/relations/view/drop.sql", "original_file_path": "macros/relations/view/drop.sql", "unique_id": "macro.dbt_postgres.postgres__drop_view", "macro_sql": "{% macro postgres__drop_view(relation) -%}\n drop view if exists {{ relation }} cascade\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789503442.9872622, "supported_languages": null}, "macro.dbt_postgres.postgres__get_replace_view_sql": {"name": "postgres__get_replace_view_sql", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/relations/view/replace.sql", "original_file_path": "macros/relations/view/replace.sql", "unique_id": "macro.dbt_postgres.postgres__get_replace_view_sql", "macro_sql": "{% macro postgres__get_replace_view_sql(relation, sql) -%}\n\n {%- set sql_header = config.get('sql_header', none) -%}\n {{ sql_header if sql_header is not none }}\n\n create or replace view {{ relation }}\n {% set contract_config = config.get('contract') %}\n {% if contract_config.enforced %}\n {{ get_assert_columns_equivalent(sql) }}\n {%- endif %}\n as (\n {{ sql }}\n );\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.get_assert_columns_equivalent"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "sql", "type": null, "description": ""}], "created_at": 1789503442.9883118, "supported_languages": null}, "macro.dbt_postgres.postgres__get_rename_table_sql": {"name": "postgres__get_rename_table_sql", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/relations/table/rename.sql", "original_file_path": "macros/relations/table/rename.sql", "unique_id": "macro.dbt_postgres.postgres__get_rename_table_sql", "macro_sql": "{% macro postgres__get_rename_table_sql(relation, new_name) %}\n alter table {{ relation }} rename to {{ new_name }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "new_name", "type": null, "description": ""}], "created_at": 1789503442.9886725, "supported_languages": null}, "macro.dbt_postgres.postgres__drop_table": {"name": "postgres__drop_table", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/relations/table/drop.sql", "original_file_path": "macros/relations/table/drop.sql", "unique_id": "macro.dbt_postgres.postgres__drop_table", "macro_sql": "{% macro postgres__drop_table(relation) -%}\n drop table if exists {{ relation }} cascade\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789503442.988957, "supported_languages": null}, "macro.dbt_postgres.postgres__get_replace_table_sql": {"name": "postgres__get_replace_table_sql", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/relations/table/replace.sql", "original_file_path": "macros/relations/table/replace.sql", "unique_id": "macro.dbt_postgres.postgres__get_replace_table_sql", "macro_sql": "{% macro postgres__get_replace_table_sql(relation, sql) -%}\n\n {%- set sql_header = config.get('sql_header', none) -%}\n {{ sql_header if sql_header is not none }}\n\n create or replace table {{ relation }}\n {% set contract_config = config.get('contract') %}\n {% if contract_config.enforced %}\n {{ get_assert_columns_equivalent(sql) }}\n {{ get_table_columns_and_constraints() }}\n {%- set sql = get_select_subquery(sql) %}\n {% endif %}\n as (\n {{ sql }}\n );\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.get_assert_columns_equivalent", "macro.dbt.get_table_columns_and_constraints", "macro.dbt.get_select_subquery"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "sql", "type": null, "description": ""}], "created_at": 1789503442.9902349, "supported_languages": null}, "macro.dbt_postgres.postgres__get_incremental_default_sql": {"name": "postgres__get_incremental_default_sql", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/materializations/incremental_strategies.sql", "original_file_path": "macros/materializations/incremental_strategies.sql", "unique_id": "macro.dbt_postgres.postgres__get_incremental_default_sql", "macro_sql": "{% macro postgres__get_incremental_default_sql(arg_dict) %}\n\n {% if arg_dict[\"unique_key\"] %}\n {% do return(get_incremental_delete_insert_sql(arg_dict)) %}\n {% else %}\n {% do return(get_incremental_append_sql(arg_dict)) %}\n {% endif %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_incremental_delete_insert_sql", "macro.dbt.get_incremental_append_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "arg_dict", "type": null, "description": ""}], "created_at": 1789503442.991124, "supported_languages": null}, "macro.dbt_postgres.postgres__get_incremental_microbatch_sql": {"name": "postgres__get_incremental_microbatch_sql", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/materializations/incremental_strategies.sql", "original_file_path": "macros/materializations/incremental_strategies.sql", "unique_id": "macro.dbt_postgres.postgres__get_incremental_microbatch_sql", "macro_sql": "{% macro postgres__get_incremental_microbatch_sql(arg_dict) %}\n\n {% if arg_dict[\"unique_key\"] %}\n {% do return(adapter.dispatch('get_incremental_merge_sql', 'dbt')(arg_dict)) %}\n {% else %}\n {{ exceptions.raise_compiler_error(\"dbt-postgres 'microbatch' requires a `unique_key` config\") }}\n {% endif %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_incremental_merge_sql", "macro.dbt.default__get_incremental_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "arg_dict", "type": null, "description": ""}], "created_at": 1789503442.991777, "supported_languages": null}, "macro.dbt_postgres.postgres__snapshot_merge_sql": {"name": "postgres__snapshot_merge_sql", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/materializations/snapshot_merge.sql", "original_file_path": "macros/materializations/snapshot_merge.sql", "unique_id": "macro.dbt_postgres.postgres__snapshot_merge_sql", "macro_sql": "{% macro postgres__snapshot_merge_sql(target, source, insert_cols) -%}\n {%- set insert_cols_csv = insert_cols | join(', ') -%}\n\n {%- set columns = config.get(\"snapshot_table_column_names\") or get_snapshot_table_column_names() -%}\n\n update {{ target }}\n set {{ columns.dbt_valid_to }} = DBT_INTERNAL_SOURCE.{{ columns.dbt_valid_to }}\n from {{ source }} as DBT_INTERNAL_SOURCE\n where DBT_INTERNAL_SOURCE.{{ columns.dbt_scd_id }}::text = {{ target }}.{{ columns.dbt_scd_id }}::text\n and DBT_INTERNAL_SOURCE.dbt_change_type::text in ('update'::text, 'delete'::text)\n {% if config.get(\"dbt_valid_to_current\") %}\n and ({{ target }}.{{ columns.dbt_valid_to }} = {{ config.get('dbt_valid_to_current') }} or {{ target }}.{{ columns.dbt_valid_to }} is null);\n {% else %}\n and {{ target }}.{{ columns.dbt_valid_to }} is null;\n {% endif %}\n\n\n insert into {{ target }} ({{ insert_cols_csv }})\n select {% for column in insert_cols -%}\n DBT_INTERNAL_SOURCE.{{ column }} {%- if not loop.last %}, {%- endif %}\n {%- endfor %}\n from {{ source }} as DBT_INTERNAL_SOURCE\n where DBT_INTERNAL_SOURCE.dbt_change_type::text = 'insert'::text;\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_snapshot_table_column_names"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "target", "type": null, "description": ""}, {"name": "source", "type": null, "description": ""}, {"name": "insert_cols", "type": null, "description": ""}], "created_at": 1789503442.9940295, "supported_languages": null}, "macro.dbt_postgres.postgres__formatted_scalar_function_args_sql": {"name": "postgres__formatted_scalar_function_args_sql", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/materializations/functions/scalar.sql", "original_file_path": "macros/materializations/functions/scalar.sql", "unique_id": "macro.dbt_postgres.postgres__formatted_scalar_function_args_sql", "macro_sql": "{% macro postgres__formatted_scalar_function_args_sql() %}\n {% set args = [] %}\n {% for arg in model.arguments -%}\n {% set default_value = arg.get('default_value', none) %}\n {% if default_value != none %}\n {%- do args.append(arg.name ~ ' ' ~ arg.data_type ~ ' DEFAULT ' ~ default_value) -%}\n {% else %}\n {%- do args.append(arg.name ~ ' ' ~ arg.data_type) -%}\n {% endif %}\n {%- endfor %}\n {{ args | join(', ') }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789503442.995467, "supported_languages": null}, "macro.dbt_postgres.postgres__last_day": {"name": "postgres__last_day", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/utils/last_day.sql", "original_file_path": "macros/utils/last_day.sql", "unique_id": "macro.dbt_postgres.postgres__last_day", "macro_sql": "{% macro postgres__last_day(date, datepart) -%}\n\n {%- if datepart == 'quarter' -%}\n -- postgres dateadd does not support quarter interval.\n cast(\n {{dbt.dateadd('day', '-1',\n dbt.dateadd('month', '3', dbt.date_trunc(datepart, date))\n )}}\n as date)\n {%- else -%}\n {{dbt.default_last_day(date, datepart)}}\n {%- endif -%}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.dateadd", "macro.dbt.date_trunc", "macro.dbt.default_last_day"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "date", "type": null, "description": ""}, {"name": "datepart", "type": null, "description": ""}], "created_at": 1789503442.99645, "supported_languages": null}, "macro.dbt_postgres.postgres__listagg": {"name": "postgres__listagg", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/utils/listagg.sql", "original_file_path": "macros/utils/listagg.sql", "unique_id": "macro.dbt_postgres.postgres__listagg", "macro_sql": "{% macro postgres__listagg(measure, delimiter_text, order_by_clause, limit_num) -%}\n\n {% if limit_num -%}\n array_to_string(\n (array_agg(\n {{ measure }}\n {% if order_by_clause -%}\n {{ order_by_clause }}\n {%- endif %}\n ))[1:{{ limit_num }}],\n {{ delimiter_text }}\n )\n {%- else %}\n string_agg(\n {{ measure }},\n {{ delimiter_text }}\n {% if order_by_clause -%}\n {{ order_by_clause }}\n {%- endif %}\n )\n {%- endif %}\n\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "measure", "type": null, "description": ""}, {"name": "delimiter_text", "type": null, "description": ""}, {"name": "order_by_clause", "type": null, "description": ""}, {"name": "limit_num", "type": null, "description": ""}], "created_at": 1789503442.9974954, "supported_languages": null}, "macro.dbt_postgres.postgres__any_value": {"name": "postgres__any_value", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/utils/any_value.sql", "original_file_path": "macros/utils/any_value.sql", "unique_id": "macro.dbt_postgres.postgres__any_value", "macro_sql": "{% macro postgres__any_value(expression) -%}\n\n min({{ expression }})\n\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "expression", "type": null, "description": ""}], "created_at": 1789503442.9978013, "supported_languages": null}, "macro.dbt_postgres.postgres__datediff": {"name": "postgres__datediff", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/utils/datediff.sql", "original_file_path": "macros/utils/datediff.sql", "unique_id": "macro.dbt_postgres.postgres__datediff", "macro_sql": "{% macro postgres__datediff(first_date, second_date, datepart) -%}\n\n {% if datepart == 'year' %}\n (date_part('year', ({{second_date}})::date) - date_part('year', ({{first_date}})::date))\n {% elif datepart == 'quarter' %}\n ({{ datediff(first_date, second_date, 'year') }} * 4 + date_part('quarter', ({{second_date}})::date) - date_part('quarter', ({{first_date}})::date))\n {% elif datepart == 'month' %}\n ({{ datediff(first_date, second_date, 'year') }} * 12 + date_part('month', ({{second_date}})::date) - date_part('month', ({{first_date}})::date))\n {% elif datepart == 'day' %}\n (({{second_date}})::date - ({{first_date}})::date)\n {% elif datepart == 'week' %}\n ({{ datediff(first_date, second_date, 'day') }} / 7 + case\n when date_part('dow', ({{first_date}})::timestamp) <= date_part('dow', ({{second_date}})::timestamp) then\n case when {{first_date}} <= {{second_date}} then 0 else -1 end\n else\n case when {{first_date}} <= {{second_date}} then 1 else 0 end\n end)\n {% elif datepart == 'hour' %}\n ({{ datediff(first_date, second_date, 'day') }} * 24 + date_part('hour', ({{second_date}})::timestamp) - date_part('hour', ({{first_date}})::timestamp))\n {% elif datepart == 'minute' %}\n ({{ datediff(first_date, second_date, 'hour') }} * 60 + date_part('minute', ({{second_date}})::timestamp) - date_part('minute', ({{first_date}})::timestamp))\n {% elif datepart == 'second' %}\n ({{ datediff(first_date, second_date, 'minute') }} * 60 + floor(date_part('second', ({{second_date}})::timestamp)) - floor(date_part('second', ({{first_date}})::timestamp)))\n {% elif datepart == 'millisecond' %}\n ({{ datediff(first_date, second_date, 'minute') }} * 60000 + floor(date_part('millisecond', ({{second_date}})::timestamp)) - floor(date_part('millisecond', ({{first_date}})::timestamp)))\n {% elif datepart == 'microsecond' %}\n ({{ datediff(first_date, second_date, 'minute') }} * 60000000 + floor(date_part('microsecond', ({{second_date}})::timestamp)) - floor(date_part('microsecond', ({{first_date}})::timestamp)))\n {% else %}\n {{ exceptions.raise_compiler_error(\"Unsupported datepart for macro datediff in postgres: {!r}\".format(datepart)) }}\n {% endif %}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.datediff"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "first_date", "type": null, "description": ""}, {"name": "second_date", "type": null, "description": ""}, {"name": "datepart", "type": null, "description": ""}], "created_at": 1789503443.0018604, "supported_languages": null}, "macro.dbt_postgres.postgres__equals": {"name": "postgres__equals", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/utils/equals.sql", "original_file_path": "macros/utils/equals.sql", "unique_id": "macro.dbt_postgres.postgres__equals", "macro_sql": "{% macro postgres__equals(expr1, expr2) -%}\n{%- if adapter.behavior.enable_truthy_nulls_equals_macro.no_warn %}\n ({{ expr1 }} IS NOT DISTINCT FROM {{ expr2 }})\n{%- else -%}\n ({{ expr1 }} = {{ expr2 }})\n{%- endif %}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "expr1", "type": null, "description": ""}, {"name": "expr2", "type": null, "description": ""}], "created_at": 1789503443.00256, "supported_languages": null}, "macro.dbt_postgres.postgres__dateadd": {"name": "postgres__dateadd", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/utils/dateadd.sql", "original_file_path": "macros/utils/dateadd.sql", "unique_id": "macro.dbt_postgres.postgres__dateadd", "macro_sql": "{% macro postgres__dateadd(datepart, interval, from_date_or_timestamp) %}\n\n {{ from_date_or_timestamp }} + ((interval '1 {{ datepart }}') * ({{ interval }}))\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "datepart", "type": null, "description": ""}, {"name": "interval", "type": null, "description": ""}, {"name": "from_date_or_timestamp", "type": null, "description": ""}], "created_at": 1789503443.003007, "supported_languages": null}, "macro.dbt_postgres.postgres__split_part": {"name": "postgres__split_part", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/utils/split_part.sql", "original_file_path": "macros/utils/split_part.sql", "unique_id": "macro.dbt_postgres.postgres__split_part", "macro_sql": "{% macro postgres__split_part(string_text, delimiter_text, part_number) %}\n\n {% if part_number >= 0 %}\n {{ dbt.default__split_part(string_text, delimiter_text, part_number) }}\n {% else %}\n {{ dbt._split_part_negative(string_text, delimiter_text, part_number) }}\n {% endif %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__split_part", "macro.dbt._split_part_negative"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "string_text", "type": null, "description": ""}, {"name": "delimiter_text", "type": null, "description": ""}, {"name": "part_number", "type": null, "description": ""}], "created_at": 1789503443.0037954, "supported_languages": null}, "macro.dbt.get_fixture_sql": {"name": "get_fixture_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/unit_test_sql/get_fixture_sql.sql", "original_file_path": "macros/unit_test_sql/get_fixture_sql.sql", "unique_id": "macro.dbt.get_fixture_sql", "macro_sql": "{% macro get_fixture_sql(rows, column_name_to_data_types) %}\n-- Fixture for {{ model.name }}\n{% set default_row = {} %}\n\n{%- if not column_name_to_data_types -%}\n{#-- Use defer_relation IFF it is available in the manifest and 'this' is missing from the database --#}\n{%- set this_or_defer_relation = defer_relation if (defer_relation and not load_relation(this)) else this -%}\n{%- set columns_in_relation = adapter.get_columns_in_relation(this_or_defer_relation) -%}\n\n{%- set column_name_to_data_types = {} -%}\n{%- set column_name_to_quoted = {} -%}\n{%- for column in columns_in_relation -%}\n\n{#-- This needs to be a case-insensitive comparison --#}\n{%- do column_name_to_data_types.update({column.name|lower: column.data_type}) -%}\n{%- do column_name_to_quoted.update({column.name|lower: column.quoted}) -%}\n{%- endfor -%}\n{%- endif -%}\n\n{%- if not column_name_to_data_types -%}\n {{ exceptions.raise_compiler_error(\"Not able to get columns for unit test '\" ~ model.name ~ \"' from relation \" ~ this ~ \" because the relation doesn't exist\") }}\n{%- endif -%}\n\n{%- for column_name, column_type in column_name_to_data_types.items() -%}\n {%- do default_row.update({column_name: (safe_cast(\"null\", column_type) | trim )}) -%}\n{%- endfor -%}\n\n{{ validate_fixture_rows(rows, row_number) }}\n\n{%- for row in rows -%}\n{%- set formatted_row = format_row(row, column_name_to_data_types) -%}\n{%- set default_row_copy = default_row.copy() -%}\n{%- do default_row_copy.update(formatted_row) -%}\nselect\n{%- for column_name, column_value in default_row_copy.items() %} {{ column_value }} as {{ column_name_to_quoted[column_name] }}{% if not loop.last -%}, {%- endif %}\n{%- endfor %}\n{%- if not loop.last %}\nunion all\n{% endif %}\n{%- endfor -%}\n\n{%- if (rows | length) == 0 -%}\n select\n {%- for column_name, column_value in default_row.items() %} {{ column_value }} as {{ column_name_to_quoted[column_name] }}{% if not loop.last -%},{%- endif %}\n {%- endfor %}\n limit 0\n{%- endif -%}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.load_relation", "macro.dbt.safe_cast", "macro.dbt.validate_fixture_rows", "macro.dbt.format_row"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "rows", "type": null, "description": ""}, {"name": "column_name_to_data_types", "type": null, "description": ""}], "created_at": 1789503443.008985, "supported_languages": null}, "macro.dbt.get_expected_sql": {"name": "get_expected_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/unit_test_sql/get_fixture_sql.sql", "original_file_path": "macros/unit_test_sql/get_fixture_sql.sql", "unique_id": "macro.dbt.get_expected_sql", "macro_sql": "{% macro get_expected_sql(rows, column_name_to_data_types, column_name_to_quoted) %}\n\n{%- if (rows | length) == 0 -%}\n select * from dbt_internal_unit_test_actual\n limit 0\n{%- else -%}\n{%- for row in rows -%}\n{%- set formatted_row = format_row(row, column_name_to_data_types) -%}\nselect\n{%- for column_name, column_value in formatted_row.items() %} {{ column_value }} as {{ column_name_to_quoted[column_name] }}{% if not loop.last -%}, {%- endif %}\n{%- endfor %}\n{%- if not loop.last %}\nunion all\n{% endif %}\n{%- endfor -%}\n{%- endif -%}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.format_row"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "rows", "type": null, "description": ""}, {"name": "column_name_to_data_types", "type": null, "description": ""}, {"name": "column_name_to_quoted", "type": null, "description": ""}], "created_at": 1789503443.0103753, "supported_languages": null}, "macro.dbt.format_row": {"name": "format_row", "resource_type": "macro", "package_name": "dbt", "path": "macros/unit_test_sql/get_fixture_sql.sql", "original_file_path": "macros/unit_test_sql/get_fixture_sql.sql", "unique_id": "macro.dbt.format_row", "macro_sql": "\n\n{%- macro format_row(row, column_name_to_data_types) -%}\n {#-- generate case-insensitive formatted row --#}\n {% set formatted_row = {} %}\n {%- for column_name, column_value in row.items() -%}\n {% set column_name = column_name|lower %}\n\n {%- if column_name not in column_name_to_data_types %}\n {#-- if user-provided row contains column name that relation does not contain, raise an error --#}\n {% set fixture_name = \"expected output\" if model.resource_type == 'unit_test' else (\"'\" ~ model.name ~ \"'\") %}\n {{ exceptions.raise_compiler_error(\n \"Invalid column name: '\" ~ column_name ~ \"' in unit test fixture for \" ~ fixture_name ~ \".\"\n \"\\nAccepted columns for \" ~ fixture_name ~ \" are: \" ~ (column_name_to_data_types.keys()|list)\n ) }}\n {%- endif -%}\n\n {%- set column_type = column_name_to_data_types[column_name] %}\n\n {#-- For string fixture values, strip varchar length to prevent silent truncation (GH-11974) --#}\n {%- if column_value is string and 'varying' in column_type -%}\n {%- set column_type = column_type.split('(')[0] -%}\n {%- endif -%}\n\n {#-- sanitize column_value: wrap yaml strings in quotes, apply cast --#}\n {%- set column_value_clean = column_value -%}\n {%- if column_value is string -%}\n {%- set column_value_clean = dbt.string_literal(dbt.escape_single_quotes(column_value)) -%}\n {%- elif column_value is none -%}\n {%- set column_value_clean = 'null' -%}\n {%- endif -%}\n\n {%- set row_update = {column_name: safe_cast(column_value_clean, column_type) } -%}\n {%- do formatted_row.update(row_update) -%}\n {%- endfor -%}\n {{ return(formatted_row) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt.string_literal", "macro.dbt.escape_single_quotes", "macro.dbt.safe_cast"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "row", "type": null, "description": ""}, {"name": "column_name_to_data_types", "type": null, "description": ""}], "created_at": 1789503443.012927, "supported_languages": null}, "macro.dbt.validate_fixture_rows": {"name": "validate_fixture_rows", "resource_type": "macro", "package_name": "dbt", "path": "macros/unit_test_sql/get_fixture_sql.sql", "original_file_path": "macros/unit_test_sql/get_fixture_sql.sql", "unique_id": "macro.dbt.validate_fixture_rows", "macro_sql": "{%- macro validate_fixture_rows(rows, row_number) -%}\n {{ return(adapter.dispatch('validate_fixture_rows', 'dbt')(rows, row_number)) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt.default__validate_fixture_rows"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "rows", "type": null, "description": ""}, {"name": "row_number", "type": null, "description": ""}], "created_at": 1789503443.0133808, "supported_languages": null}, "macro.dbt.default__validate_fixture_rows": {"name": "default__validate_fixture_rows", "resource_type": "macro", "package_name": "dbt", "path": "macros/unit_test_sql/get_fixture_sql.sql", "original_file_path": "macros/unit_test_sql/get_fixture_sql.sql", "unique_id": "macro.dbt.default__validate_fixture_rows", "macro_sql": "{%- macro default__validate_fixture_rows(rows, row_number) -%}\n {# This is an abstract method for adapter overrides as needed #}\n{%- endmacro -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "rows", "type": null, "description": ""}, {"name": "row_number", "type": null, "description": ""}], "created_at": 1789503443.013589, "supported_languages": null}, "macro.dbt.get_create_sql": {"name": "get_create_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/create.sql", "original_file_path": "macros/relations/create.sql", "unique_id": "macro.dbt.get_create_sql", "macro_sql": "{%- macro get_create_sql(relation, sql) -%}\n {{- log('Applying CREATE to: ' ~ relation) -}}\n {{- adapter.dispatch('get_create_sql', 'dbt')(relation, sql) -}}\n{%- endmacro -%}\n\n\n", "depends_on": {"macros": ["macro.dbt.default__get_create_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "sql", "type": null, "description": ""}], "created_at": 1789503443.0143573, "supported_languages": null}, "macro.dbt.default__get_create_sql": {"name": "default__get_create_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/create.sql", "original_file_path": "macros/relations/create.sql", "unique_id": "macro.dbt.default__get_create_sql", "macro_sql": "{%- macro default__get_create_sql(relation, sql) -%}\n\n {%- if relation.is_view -%}\n {{ get_create_view_as_sql(relation, sql) }}\n\n {%- elif relation.is_table -%}\n {{ get_create_table_as_sql(False, relation, sql) }}\n\n {%- elif relation.is_materialized_view -%}\n {{ get_create_materialized_view_as_sql(relation, sql) }}\n\n {%- else -%}\n {{- exceptions.raise_compiler_error(\"`get_create_sql` has not been implemented for: \" ~ relation.type ) -}}\n\n {%- endif -%}\n\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt.get_create_view_as_sql", "macro.dbt.get_create_table_as_sql", "macro.dbt.get_create_materialized_view_as_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "sql", "type": null, "description": ""}], "created_at": 1789503443.0152733, "supported_languages": null}, "macro.dbt.drop_schema_named": {"name": "drop_schema_named", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/schema.sql", "original_file_path": "macros/relations/schema.sql", "unique_id": "macro.dbt.drop_schema_named", "macro_sql": "{% macro drop_schema_named(schema_name) %}\n {{ return(adapter.dispatch('drop_schema_named', 'dbt') (schema_name)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__drop_schema_named"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "schema_name", "type": null, "description": ""}], "created_at": 1789503443.015799, "supported_languages": null}, "macro.dbt.default__drop_schema_named": {"name": "default__drop_schema_named", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/schema.sql", "original_file_path": "macros/relations/schema.sql", "unique_id": "macro.dbt.default__drop_schema_named", "macro_sql": "{% macro default__drop_schema_named(schema_name) %}\n {% set schema_relation = api.Relation.create(schema=schema_name) %}\n {{ adapter.drop_schema(schema_relation) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "schema_name", "type": null, "description": ""}], "created_at": 1789503443.0162666, "supported_languages": null}, "macro.dbt.get_create_intermediate_sql": {"name": "get_create_intermediate_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/create_intermediate.sql", "original_file_path": "macros/relations/create_intermediate.sql", "unique_id": "macro.dbt.get_create_intermediate_sql", "macro_sql": "{%- macro get_create_intermediate_sql(relation, sql) -%}\n {{- log('Applying CREATE INTERMEDIATE to: ' ~ relation) -}}\n {{- adapter.dispatch('get_create_intermediate_sql', 'dbt')(relation, sql) -}}\n{%- endmacro -%}\n\n\n", "depends_on": {"macros": ["macro.dbt.default__get_create_intermediate_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "sql", "type": null, "description": ""}], "created_at": 1789503443.0169144, "supported_languages": null}, "macro.dbt.default__get_create_intermediate_sql": {"name": "default__get_create_intermediate_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/create_intermediate.sql", "original_file_path": "macros/relations/create_intermediate.sql", "unique_id": "macro.dbt.default__get_create_intermediate_sql", "macro_sql": "{%- macro default__get_create_intermediate_sql(relation, sql) -%}\n\n -- get the standard intermediate name\n {% set intermediate_relation = make_intermediate_relation(relation) %}\n\n -- drop any pre-existing intermediate\n {{ get_drop_sql(intermediate_relation) }};\n\n {{ get_create_sql(intermediate_relation, sql) }}\n\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt.make_intermediate_relation", "macro.dbt.get_drop_sql", "macro.dbt.get_create_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "sql", "type": null, "description": ""}], "created_at": 1789503443.0174448, "supported_languages": null}, "macro.dbt.get_drop_backup_sql": {"name": "get_drop_backup_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/drop_backup.sql", "original_file_path": "macros/relations/drop_backup.sql", "unique_id": "macro.dbt.get_drop_backup_sql", "macro_sql": "{%- macro get_drop_backup_sql(relation) -%}\n {{- log('Applying DROP BACKUP to: ' ~ relation) -}}\n {{- adapter.dispatch('get_drop_backup_sql', 'dbt')(relation) -}}\n{%- endmacro -%}\n\n\n", "depends_on": {"macros": ["macro.dbt.default__get_drop_backup_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789503443.0180466, "supported_languages": null}, "macro.dbt.default__get_drop_backup_sql": {"name": "default__get_drop_backup_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/drop_backup.sql", "original_file_path": "macros/relations/drop_backup.sql", "unique_id": "macro.dbt.default__get_drop_backup_sql", "macro_sql": "{%- macro default__get_drop_backup_sql(relation) -%}\n\n -- get the standard backup name\n {% set backup_relation = make_backup_relation(relation, relation.type) %}\n\n {{ get_drop_sql(backup_relation) }}\n\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt.make_backup_relation", "macro.dbt.get_drop_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789503443.0184667, "supported_languages": null}, "macro.dbt.get_rename_sql": {"name": "get_rename_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/rename.sql", "original_file_path": "macros/relations/rename.sql", "unique_id": "macro.dbt.get_rename_sql", "macro_sql": "{%- macro get_rename_sql(relation, new_name) -%}\n {{- log('Applying RENAME to: ' ~ relation) -}}\n {{- adapter.dispatch('get_rename_sql', 'dbt')(relation, new_name) -}}\n{%- endmacro -%}\n\n\n", "depends_on": {"macros": ["macro.dbt.default__get_rename_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "new_name", "type": null, "description": ""}], "created_at": 1789503443.019367, "supported_languages": null}, "macro.dbt.default__get_rename_sql": {"name": "default__get_rename_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/rename.sql", "original_file_path": "macros/relations/rename.sql", "unique_id": "macro.dbt.default__get_rename_sql", "macro_sql": "{%- macro default__get_rename_sql(relation, new_name) -%}\n\n {%- if relation.is_view -%}\n {{ get_rename_view_sql(relation, new_name) }}\n\n {%- elif relation.is_table -%}\n {{ get_rename_table_sql(relation, new_name) }}\n\n {%- elif relation.is_materialized_view -%}\n {{ get_rename_materialized_view_sql(relation, new_name) }}\n\n {%- else -%}\n {{- exceptions.raise_compiler_error(\"`get_rename_sql` has not been implemented for: \" ~ relation.type ) -}}\n\n {%- endif -%}\n\n{%- endmacro -%}\n\n\n", "depends_on": {"macros": ["macro.dbt.get_rename_view_sql", "macro.dbt.get_rename_table_sql", "macro.dbt.get_rename_materialized_view_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "new_name", "type": null, "description": ""}], "created_at": 1789503443.0202727, "supported_languages": null}, "macro.dbt.rename_relation": {"name": "rename_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/rename.sql", "original_file_path": "macros/relations/rename.sql", "unique_id": "macro.dbt.rename_relation", "macro_sql": "{% macro rename_relation(from_relation, to_relation) -%}\n {{ return(adapter.dispatch('rename_relation', 'dbt')(from_relation, to_relation)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__rename_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "from_relation", "type": null, "description": ""}, {"name": "to_relation", "type": null, "description": ""}], "created_at": 1789503443.0208066, "supported_languages": null}, "macro.dbt.default__rename_relation": {"name": "default__rename_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/rename.sql", "original_file_path": "macros/relations/rename.sql", "unique_id": "macro.dbt.default__rename_relation", "macro_sql": "{% macro default__rename_relation(from_relation, to_relation) -%}\n {% set target_name = adapter.quote_as_configured(to_relation.identifier, 'identifier') %}\n {% call statement('rename_relation') -%}\n alter table {{ from_relation.render() }} rename to {{ target_name }}\n {%- endcall %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "from_relation", "type": null, "description": ""}, {"name": "to_relation", "type": null, "description": ""}], "created_at": 1789503443.0215704, "supported_languages": null}, "macro.dbt.get_drop_sql": {"name": "get_drop_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/drop.sql", "original_file_path": "macros/relations/drop.sql", "unique_id": "macro.dbt.get_drop_sql", "macro_sql": "{%- macro get_drop_sql(relation) -%}\n {{- log('Applying DROP to: ' ~ relation) -}}\n {{- adapter.dispatch('get_drop_sql', 'dbt')(relation) -}}\n{%- endmacro -%}\n\n\n", "depends_on": {"macros": ["macro.dbt.default__get_drop_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789503443.022486, "supported_languages": null}, "macro.dbt.default__get_drop_sql": {"name": "default__get_drop_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/drop.sql", "original_file_path": "macros/relations/drop.sql", "unique_id": "macro.dbt.default__get_drop_sql", "macro_sql": "{%- macro default__get_drop_sql(relation) -%}\n\n {%- if relation.is_view -%}\n {{ drop_view(relation) }}\n\n {%- elif relation.is_table -%}\n {{ drop_table(relation) }}\n\n {%- elif relation.is_materialized_view -%}\n {{ drop_materialized_view(relation) }}\n\n {%- else -%}\n drop {{ relation.type }} if exists {{ relation.render() }} cascade\n\n {%- endif -%}\n\n{%- endmacro -%}\n\n\n", "depends_on": {"macros": ["macro.dbt.drop_view", "macro.dbt.drop_table", "macro.dbt.drop_materialized_view"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789503443.0234113, "supported_languages": null}, "macro.dbt.drop_relation": {"name": "drop_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/drop.sql", "original_file_path": "macros/relations/drop.sql", "unique_id": "macro.dbt.drop_relation", "macro_sql": "{% macro drop_relation(relation) -%}\n {{ return(adapter.dispatch('drop_relation', 'dbt')(relation)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__drop_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789503443.0237818, "supported_languages": null}, "macro.dbt.default__drop_relation": {"name": "default__drop_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/drop.sql", "original_file_path": "macros/relations/drop.sql", "unique_id": "macro.dbt.default__drop_relation", "macro_sql": "{% macro default__drop_relation(relation) -%}\n {% call statement('drop_relation', auto_begin=False) -%}\n {{ get_drop_sql(relation) }}\n {%- endcall %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement", "macro.dbt.get_drop_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789503443.024218, "supported_languages": null}, "macro.dbt.drop_relation_if_exists": {"name": "drop_relation_if_exists", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/drop.sql", "original_file_path": "macros/relations/drop.sql", "unique_id": "macro.dbt.drop_relation_if_exists", "macro_sql": "{% macro drop_relation_if_exists(relation) %}\n {% if relation is not none %}\n {{ adapter.drop_relation(relation) }}\n {% endif %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789503443.0246134, "supported_languages": null}, "macro.dbt.get_rename_intermediate_sql": {"name": "get_rename_intermediate_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/rename_intermediate.sql", "original_file_path": "macros/relations/rename_intermediate.sql", "unique_id": "macro.dbt.get_rename_intermediate_sql", "macro_sql": "{%- macro get_rename_intermediate_sql(relation) -%}\n {{- log('Applying RENAME INTERMEDIATE to: ' ~ relation) -}}\n {{- adapter.dispatch('get_rename_intermediate_sql', 'dbt')(relation) -}}\n{%- endmacro -%}\n\n\n", "depends_on": {"macros": ["macro.dbt.default__get_rename_intermediate_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789503443.0252364, "supported_languages": null}, "macro.dbt.default__get_rename_intermediate_sql": {"name": "default__get_rename_intermediate_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/rename_intermediate.sql", "original_file_path": "macros/relations/rename_intermediate.sql", "unique_id": "macro.dbt.default__get_rename_intermediate_sql", "macro_sql": "{%- macro default__get_rename_intermediate_sql(relation) -%}\n\n -- get the standard intermediate name\n {% set intermediate_relation = make_intermediate_relation(relation) %}\n\n {{ get_rename_sql(intermediate_relation, relation.identifier) }}\n\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt.make_intermediate_relation", "macro.dbt.get_rename_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789503443.0256588, "supported_languages": null}, "macro.dbt.get_replace_sql": {"name": "get_replace_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/replace.sql", "original_file_path": "macros/relations/replace.sql", "unique_id": "macro.dbt.get_replace_sql", "macro_sql": "{% macro get_replace_sql(existing_relation, target_relation, sql) %}\n {{- log('Applying REPLACE to: ' ~ existing_relation) -}}\n {{- adapter.dispatch('get_replace_sql', 'dbt')(existing_relation, target_relation, sql) -}}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_replace_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "existing_relation", "type": null, "description": ""}, {"name": "target_relation", "type": null, "description": ""}, {"name": "sql", "type": null, "description": ""}], "created_at": 1789503443.026749, "supported_languages": null}, "macro.dbt.default__get_replace_sql": {"name": "default__get_replace_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/replace.sql", "original_file_path": "macros/relations/replace.sql", "unique_id": "macro.dbt.default__get_replace_sql", "macro_sql": "{% macro default__get_replace_sql(existing_relation, target_relation, sql) %}\n\n {# /* use a create or replace statement if possible */ #}\n\n {% set is_replaceable = existing_relation.type == target_relation.type and existing_relation.can_be_replaced %}\n\n {% if is_replaceable and existing_relation.is_view %}\n {{ get_replace_view_sql(target_relation, sql) }}\n\n {% elif is_replaceable and existing_relation.is_table %}\n {{ get_replace_table_sql(target_relation, sql) }}\n\n {% elif is_replaceable and existing_relation.is_materialized_view %}\n {{ get_replace_materialized_view_sql(target_relation, sql) }}\n\n {# /* a create or replace statement is not possible, so try to stage and/or backup to be safe */ #}\n\n {# /* create target_relation as an intermediate relation, then swap it out with the existing one using a backup */ #}\n {%- elif target_relation.can_be_renamed and existing_relation.can_be_renamed -%}\n {{ get_create_intermediate_sql(target_relation, sql) }};\n {{ get_create_backup_sql(existing_relation) }};\n {{ get_rename_intermediate_sql(target_relation) }};\n {{ get_drop_backup_sql(existing_relation) }}\n\n {# /* create target_relation as an intermediate relation, then swap it out with the existing one without using a backup */ #}\n {%- elif target_relation.can_be_renamed -%}\n {{ get_create_intermediate_sql(target_relation, sql) }};\n {{ get_drop_sql(existing_relation) }};\n {{ get_rename_intermediate_sql(target_relation) }}\n\n {# /* create target_relation in place by first backing up the existing relation */ #}\n {%- elif existing_relation.can_be_renamed -%}\n {{ get_create_backup_sql(existing_relation) }};\n {{ get_create_sql(target_relation, sql) }};\n {{ get_drop_backup_sql(existing_relation) }}\n\n {# /* no renaming is allowed, so just drop and create */ #}\n {%- else -%}\n {{ get_drop_sql(existing_relation) }};\n {{ get_create_sql(target_relation, sql) }}\n\n {%- endif -%}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_replace_view_sql", "macro.dbt.get_replace_table_sql", "macro.dbt.get_replace_materialized_view_sql", "macro.dbt.get_create_intermediate_sql", "macro.dbt.get_create_backup_sql", "macro.dbt.get_rename_intermediate_sql", "macro.dbt.get_drop_backup_sql", "macro.dbt.get_drop_sql", "macro.dbt.get_create_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "existing_relation", "type": null, "description": ""}, {"name": "target_relation", "type": null, "description": ""}, {"name": "sql", "type": null, "description": ""}], "created_at": 1789503443.0292199, "supported_languages": null}, "macro.dbt.get_create_backup_sql": {"name": "get_create_backup_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/create_backup.sql", "original_file_path": "macros/relations/create_backup.sql", "unique_id": "macro.dbt.get_create_backup_sql", "macro_sql": "{%- macro get_create_backup_sql(relation) -%}\n {{- log('Applying CREATE BACKUP to: ' ~ relation) -}}\n {{- adapter.dispatch('get_create_backup_sql', 'dbt')(relation) -}}\n{%- endmacro -%}\n\n\n", "depends_on": {"macros": ["macro.dbt.default__get_create_backup_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789503443.0298526, "supported_languages": null}, "macro.dbt.default__get_create_backup_sql": {"name": "default__get_create_backup_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/create_backup.sql", "original_file_path": "macros/relations/create_backup.sql", "unique_id": "macro.dbt.default__get_create_backup_sql", "macro_sql": "{%- macro default__get_create_backup_sql(relation) -%}\n\n -- get the standard backup name\n {% set backup_relation = make_backup_relation(relation, relation.type) %}\n\n -- drop any pre-existing backup\n {{ get_drop_sql(backup_relation) }};\n\n {{ get_rename_sql(relation, backup_relation.identifier) }}\n\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt.make_backup_relation", "macro.dbt.get_drop_sql", "macro.dbt.get_rename_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789503443.0304208, "supported_languages": null}, "macro.dbt.get_create_materialized_view_as_sql": {"name": "get_create_materialized_view_as_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/materialized_view/create.sql", "original_file_path": "macros/relations/materialized_view/create.sql", "unique_id": "macro.dbt.get_create_materialized_view_as_sql", "macro_sql": "{% macro get_create_materialized_view_as_sql(relation, sql) -%}\n {{- adapter.dispatch('get_create_materialized_view_as_sql', 'dbt')(relation, sql) -}}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__get_create_materialized_view_as_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "sql", "type": null, "description": ""}], "created_at": 1789503443.030941, "supported_languages": null}, "macro.dbt.default__get_create_materialized_view_as_sql": {"name": "default__get_create_materialized_view_as_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/materialized_view/create.sql", "original_file_path": "macros/relations/materialized_view/create.sql", "unique_id": "macro.dbt.default__get_create_materialized_view_as_sql", "macro_sql": "{% macro default__get_create_materialized_view_as_sql(relation, sql) -%}\n {{ exceptions.raise_compiler_error(\n \"`get_create_materialized_view_as_sql` has not been implemented for this adapter.\"\n ) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "sql", "type": null, "description": ""}], "created_at": 1789503443.0312672, "supported_languages": null}, "macro.dbt.get_alter_materialized_view_as_sql": {"name": "get_alter_materialized_view_as_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/materialized_view/alter.sql", "original_file_path": "macros/relations/materialized_view/alter.sql", "unique_id": "macro.dbt.get_alter_materialized_view_as_sql", "macro_sql": "{% macro get_alter_materialized_view_as_sql(\n relation,\n configuration_changes,\n sql,\n existing_relation,\n backup_relation,\n intermediate_relation\n) %}\n {{- log('Applying ALTER to: ' ~ relation) -}}\n {{- adapter.dispatch('get_alter_materialized_view_as_sql', 'dbt')(\n relation,\n configuration_changes,\n sql,\n existing_relation,\n backup_relation,\n intermediate_relation\n ) -}}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__get_alter_materialized_view_as_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "configuration_changes", "type": null, "description": ""}, {"name": "sql", "type": null, "description": ""}, {"name": "existing_relation", "type": null, "description": ""}, {"name": "backup_relation", "type": null, "description": ""}, {"name": "intermediate_relation", "type": null, "description": ""}], "created_at": 1789503443.0322945, "supported_languages": null}, "macro.dbt.default__get_alter_materialized_view_as_sql": {"name": "default__get_alter_materialized_view_as_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/materialized_view/alter.sql", "original_file_path": "macros/relations/materialized_view/alter.sql", "unique_id": "macro.dbt.default__get_alter_materialized_view_as_sql", "macro_sql": "{% macro default__get_alter_materialized_view_as_sql(\n relation,\n configuration_changes,\n sql,\n existing_relation,\n backup_relation,\n intermediate_relation\n) %}\n {{ exceptions.raise_compiler_error(\"Materialized views have not been implemented for this adapter.\") }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "configuration_changes", "type": null, "description": ""}, {"name": "sql", "type": null, "description": ""}, {"name": "existing_relation", "type": null, "description": ""}, {"name": "backup_relation", "type": null, "description": ""}, {"name": "intermediate_relation", "type": null, "description": ""}], "created_at": 1789503443.0326874, "supported_languages": null}, "macro.dbt.get_materialized_view_configuration_changes": {"name": "get_materialized_view_configuration_changes", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/materialized_view/alter.sql", "original_file_path": "macros/relations/materialized_view/alter.sql", "unique_id": "macro.dbt.get_materialized_view_configuration_changes", "macro_sql": "{% macro get_materialized_view_configuration_changes(existing_relation, new_config) %}\n /* {#\n It's recommended that configuration changes be formatted as follows:\n {\"\": [{\"action\": \"\", \"context\": ...}]}\n\n For example:\n {\n \"indexes\": [\n {\"action\": \"drop\", \"context\": \"index_abc\"},\n {\"action\": \"create\", \"context\": {\"columns\": [\"column_1\", \"column_2\"], \"type\": \"hash\", \"unique\": True}},\n ],\n }\n\n Either way, `get_materialized_view_configuration_changes` needs to align with `get_alter_materialized_view_as_sql`.\n #} */\n {{- log('Determining configuration changes on: ' ~ existing_relation) -}}\n {%- do return(adapter.dispatch('get_materialized_view_configuration_changes', 'dbt')(existing_relation, new_config)) -%}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__get_materialized_view_configuration_changes"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "existing_relation", "type": null, "description": ""}, {"name": "new_config", "type": null, "description": ""}], "created_at": 1789503443.033293, "supported_languages": null}, "macro.dbt.default__get_materialized_view_configuration_changes": {"name": "default__get_materialized_view_configuration_changes", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/materialized_view/alter.sql", "original_file_path": "macros/relations/materialized_view/alter.sql", "unique_id": "macro.dbt.default__get_materialized_view_configuration_changes", "macro_sql": "{% macro default__get_materialized_view_configuration_changes(existing_relation, new_config) %}\n {{ exceptions.raise_compiler_error(\"Materialized views have not been implemented for this adapter.\") }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "existing_relation", "type": null, "description": ""}, {"name": "new_config", "type": null, "description": ""}], "created_at": 1789503443.033602, "supported_languages": null}, "macro.dbt.get_rename_materialized_view_sql": {"name": "get_rename_materialized_view_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/materialized_view/rename.sql", "original_file_path": "macros/relations/materialized_view/rename.sql", "unique_id": "macro.dbt.get_rename_materialized_view_sql", "macro_sql": "{% macro get_rename_materialized_view_sql(relation, new_name) %}\n {{- adapter.dispatch('get_rename_materialized_view_sql', 'dbt')(relation, new_name) -}}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__get_rename_materialized_view_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "new_name", "type": null, "description": ""}], "created_at": 1789503443.0341563, "supported_languages": null}, "macro.dbt.default__get_rename_materialized_view_sql": {"name": "default__get_rename_materialized_view_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/materialized_view/rename.sql", "original_file_path": "macros/relations/materialized_view/rename.sql", "unique_id": "macro.dbt.default__get_rename_materialized_view_sql", "macro_sql": "{% macro default__get_rename_materialized_view_sql(relation, new_name) %}\n {{ exceptions.raise_compiler_error(\n \"`get_rename_materialized_view_sql` has not been implemented for this adapter.\"\n ) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "new_name", "type": null, "description": ""}], "created_at": 1789503443.034571, "supported_languages": null}, "macro.dbt.refresh_materialized_view": {"name": "refresh_materialized_view", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/materialized_view/refresh.sql", "original_file_path": "macros/relations/materialized_view/refresh.sql", "unique_id": "macro.dbt.refresh_materialized_view", "macro_sql": "{% macro refresh_materialized_view(relation) %}\n {{- log('Applying REFRESH to: ' ~ relation) -}}\n {{- adapter.dispatch('refresh_materialized_view', 'dbt')(relation) -}}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__refresh_materialized_view"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789503443.0351768, "supported_languages": null}, "macro.dbt.default__refresh_materialized_view": {"name": "default__refresh_materialized_view", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/materialized_view/refresh.sql", "original_file_path": "macros/relations/materialized_view/refresh.sql", "unique_id": "macro.dbt.default__refresh_materialized_view", "macro_sql": "{% macro default__refresh_materialized_view(relation) %}\n {{ exceptions.raise_compiler_error(\"`refresh_materialized_view` has not been implemented for this adapter.\") }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789503443.0354593, "supported_languages": null}, "macro.dbt.drop_materialized_view": {"name": "drop_materialized_view", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/materialized_view/drop.sql", "original_file_path": "macros/relations/materialized_view/drop.sql", "unique_id": "macro.dbt.drop_materialized_view", "macro_sql": "{% macro drop_materialized_view(relation) -%}\n {{- adapter.dispatch('drop_materialized_view', 'dbt')(relation) -}}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__drop_materialized_view"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789503443.0359344, "supported_languages": null}, "macro.dbt.default__drop_materialized_view": {"name": "default__drop_materialized_view", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/materialized_view/drop.sql", "original_file_path": "macros/relations/materialized_view/drop.sql", "unique_id": "macro.dbt.default__drop_materialized_view", "macro_sql": "{% macro default__drop_materialized_view(relation) -%}\n drop materialized view if exists {{ relation.render() }} cascade\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789503443.0362294, "supported_languages": null}, "macro.dbt.get_replace_materialized_view_sql": {"name": "get_replace_materialized_view_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/materialized_view/replace.sql", "original_file_path": "macros/relations/materialized_view/replace.sql", "unique_id": "macro.dbt.get_replace_materialized_view_sql", "macro_sql": "{% macro get_replace_materialized_view_sql(relation, sql) %}\n {{- adapter.dispatch('get_replace_materialized_view_sql', 'dbt')(relation, sql) -}}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_replace_materialized_view_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "sql", "type": null, "description": ""}], "created_at": 1789503443.0367472, "supported_languages": null}, "macro.dbt.default__get_replace_materialized_view_sql": {"name": "default__get_replace_materialized_view_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/materialized_view/replace.sql", "original_file_path": "macros/relations/materialized_view/replace.sql", "unique_id": "macro.dbt.default__get_replace_materialized_view_sql", "macro_sql": "{% macro default__get_replace_materialized_view_sql(relation, sql) %}\n {{ exceptions.raise_compiler_error(\n \"`get_replace_materialized_view_sql` has not been implemented for this adapter.\"\n ) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "sql", "type": null, "description": ""}], "created_at": 1789503443.0370736, "supported_languages": null}, "macro.dbt.get_create_view_as_sql": {"name": "get_create_view_as_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/view/create.sql", "original_file_path": "macros/relations/view/create.sql", "unique_id": "macro.dbt.get_create_view_as_sql", "macro_sql": "{% macro get_create_view_as_sql(relation, sql) -%}\n {{ adapter.dispatch('get_create_view_as_sql', 'dbt')(relation, sql) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_create_view_as_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "sql", "type": null, "description": ""}], "created_at": 1789503443.037761, "supported_languages": null}, "macro.dbt.default__get_create_view_as_sql": {"name": "default__get_create_view_as_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/view/create.sql", "original_file_path": "macros/relations/view/create.sql", "unique_id": "macro.dbt.default__get_create_view_as_sql", "macro_sql": "{% macro default__get_create_view_as_sql(relation, sql) -%}\n {{ return(create_view_as(relation, sql)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.create_view_as"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "sql", "type": null, "description": ""}], "created_at": 1789503443.0381155, "supported_languages": null}, "macro.dbt.create_view_as": {"name": "create_view_as", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/view/create.sql", "original_file_path": "macros/relations/view/create.sql", "unique_id": "macro.dbt.create_view_as", "macro_sql": "{% macro create_view_as(relation, sql) -%}\n {{ adapter.dispatch('create_view_as', 'dbt')(relation, sql) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__create_view_as"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "sql", "type": null, "description": ""}], "created_at": 1789503443.0384855, "supported_languages": null}, "macro.dbt.default__create_view_as": {"name": "default__create_view_as", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/view/create.sql", "original_file_path": "macros/relations/view/create.sql", "unique_id": "macro.dbt.default__create_view_as", "macro_sql": "{% macro default__create_view_as(relation, sql) -%}\n {%- set sql_header = config.get('sql_header', none) -%}\n\n {{ sql_header if sql_header is not none }}\n create view {{ relation.render() }}\n {% set contract_config = config.get('contract') %}\n {% if contract_config.enforced %}\n {{ get_assert_columns_equivalent(sql) }}\n {%- endif %}\n as (\n {{ sql }}\n );\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.get_assert_columns_equivalent"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "sql", "type": null, "description": ""}], "created_at": 1789503443.039382, "supported_languages": null}, "macro.dbt.get_rename_view_sql": {"name": "get_rename_view_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/view/rename.sql", "original_file_path": "macros/relations/view/rename.sql", "unique_id": "macro.dbt.get_rename_view_sql", "macro_sql": "{% macro get_rename_view_sql(relation, new_name) %}\n {{- adapter.dispatch('get_rename_view_sql', 'dbt')(relation, new_name) -}}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__get_rename_view_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "new_name", "type": null, "description": ""}], "created_at": 1789503443.0399024, "supported_languages": null}, "macro.dbt.default__get_rename_view_sql": {"name": "default__get_rename_view_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/view/rename.sql", "original_file_path": "macros/relations/view/rename.sql", "unique_id": "macro.dbt.default__get_rename_view_sql", "macro_sql": "{% macro default__get_rename_view_sql(relation, new_name) %}\n {{ exceptions.raise_compiler_error(\n \"`get_rename_view_sql` has not been implemented for this adapter.\"\n ) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "new_name", "type": null, "description": ""}], "created_at": 1789503443.0402267, "supported_languages": null}, "macro.dbt.drop_view": {"name": "drop_view", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/view/drop.sql", "original_file_path": "macros/relations/view/drop.sql", "unique_id": "macro.dbt.drop_view", "macro_sql": "{% macro drop_view(relation) -%}\n {{- adapter.dispatch('drop_view', 'dbt')(relation) -}}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__drop_view"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789503443.0406966, "supported_languages": null}, "macro.dbt.default__drop_view": {"name": "default__drop_view", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/view/drop.sql", "original_file_path": "macros/relations/view/drop.sql", "unique_id": "macro.dbt.default__drop_view", "macro_sql": "{% macro default__drop_view(relation) -%}\n drop view if exists {{ relation.render() }} cascade\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789503443.040949, "supported_languages": null}, "macro.dbt.get_replace_view_sql": {"name": "get_replace_view_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/view/replace.sql", "original_file_path": "macros/relations/view/replace.sql", "unique_id": "macro.dbt.get_replace_view_sql", "macro_sql": "{% macro get_replace_view_sql(relation, sql) %}\n {{- adapter.dispatch('get_replace_view_sql', 'dbt')(relation, sql) -}}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__get_replace_view_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "sql", "type": null, "description": ""}], "created_at": 1789503443.0419288, "supported_languages": null}, "macro.dbt.default__get_replace_view_sql": {"name": "default__get_replace_view_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/view/replace.sql", "original_file_path": "macros/relations/view/replace.sql", "unique_id": "macro.dbt.default__get_replace_view_sql", "macro_sql": "{% macro default__get_replace_view_sql(relation, sql) %}\n {{ exceptions.raise_compiler_error(\n \"`get_replace_view_sql` has not been implemented for this adapter.\"\n ) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "sql", "type": null, "description": ""}], "created_at": 1789503443.0423589, "supported_languages": null}, "macro.dbt.create_or_replace_view": {"name": "create_or_replace_view", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/view/replace.sql", "original_file_path": "macros/relations/view/replace.sql", "unique_id": "macro.dbt.create_or_replace_view", "macro_sql": "{% macro create_or_replace_view() %}\n {%- set identifier = model['alias'] -%}\n\n {%- set old_relation = adapter.get_relation(database=database, schema=schema, identifier=identifier) -%}\n {%- set exists_as_view = (old_relation is not none and old_relation.is_view) -%}\n\n {%- set target_relation = api.Relation.create(\n identifier=identifier, schema=schema, database=database,\n type='view') -%}\n {% set grant_config = config.get('grants') %}\n\n {{ run_hooks(pre_hooks) }}\n\n -- If there's a table with the same name and we weren't told to full refresh,\n -- that's an error. If we were told to full refresh, drop it. This behavior differs\n -- for Snowflake and BigQuery, so multiple dispatch is used.\n {%- if old_relation is not none and old_relation.is_table -%}\n {{ handle_existing_table(should_full_refresh(), old_relation) }}\n {%- endif -%}\n\n -- build model\n {% call statement('main') -%}\n {{ get_create_view_as_sql(target_relation, sql) }}\n {%- endcall %}\n\n {% set should_revoke = should_revoke(exists_as_view, full_refresh_mode=True) %}\n {% do apply_grants(target_relation, grant_config, should_revoke=should_revoke) %}\n\n {{ run_hooks(post_hooks) }}\n\n {{ return({'relations': [target_relation]}) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.run_hooks", "macro.dbt.handle_existing_table", "macro.dbt.should_full_refresh", "macro.dbt.statement", "macro.dbt.get_create_view_as_sql", "macro.dbt.should_revoke", "macro.dbt.apply_grants"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789503443.0445654, "supported_languages": null}, "macro.dbt.handle_existing_table": {"name": "handle_existing_table", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/view/replace.sql", "original_file_path": "macros/relations/view/replace.sql", "unique_id": "macro.dbt.handle_existing_table", "macro_sql": "{% macro handle_existing_table(full_refresh, old_relation) %}\n {{ adapter.dispatch('handle_existing_table', 'dbt')(full_refresh, old_relation) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__handle_existing_table"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "full_refresh", "type": null, "description": ""}, {"name": "old_relation", "type": null, "description": ""}], "created_at": 1789503443.044982, "supported_languages": null}, "macro.dbt.default__handle_existing_table": {"name": "default__handle_existing_table", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/view/replace.sql", "original_file_path": "macros/relations/view/replace.sql", "unique_id": "macro.dbt.default__handle_existing_table", "macro_sql": "{% macro default__handle_existing_table(full_refresh, old_relation) %}\n {{ log(\"Dropping relation \" ~ old_relation.render() ~ \" because it is of type \" ~ old_relation.type) }}\n {{ adapter.drop_relation(old_relation) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "full_refresh", "type": null, "description": ""}, {"name": "old_relation", "type": null, "description": ""}], "created_at": 1789503443.0454805, "supported_languages": null}, "macro.dbt.get_table_columns_and_constraints": {"name": "get_table_columns_and_constraints", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/column/columns_spec_ddl.sql", "original_file_path": "macros/relations/column/columns_spec_ddl.sql", "unique_id": "macro.dbt.get_table_columns_and_constraints", "macro_sql": "{%- macro get_table_columns_and_constraints() -%}\n {{ adapter.dispatch('get_table_columns_and_constraints', 'dbt')() }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt.default__get_table_columns_and_constraints"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789503443.0468924, "supported_languages": null}, "macro.dbt.default__get_table_columns_and_constraints": {"name": "default__get_table_columns_and_constraints", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/column/columns_spec_ddl.sql", "original_file_path": "macros/relations/column/columns_spec_ddl.sql", "unique_id": "macro.dbt.default__get_table_columns_and_constraints", "macro_sql": "{% macro default__get_table_columns_and_constraints() -%}\n {{ return(table_columns_and_constraints()) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.table_columns_and_constraints"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789503443.0471783, "supported_languages": null}, "macro.dbt.table_columns_and_constraints": {"name": "table_columns_and_constraints", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/column/columns_spec_ddl.sql", "original_file_path": "macros/relations/column/columns_spec_ddl.sql", "unique_id": "macro.dbt.table_columns_and_constraints", "macro_sql": "{% macro table_columns_and_constraints() %}\n {# loop through user_provided_columns to create DDL with data types and constraints #}\n {%- set raw_column_constraints = adapter.render_raw_columns_constraints(raw_columns=model['columns']) -%}\n {%- set raw_model_constraints = adapter.render_raw_model_constraints(raw_constraints=model['constraints']) -%}\n (\n {% for c in raw_column_constraints -%}\n {{ c }}{{ \",\" if not loop.last or raw_model_constraints }}\n {% endfor %}\n {% for c in raw_model_constraints -%}\n {{ c }}{{ \",\" if not loop.last }}\n {% endfor -%}\n )\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789503443.0482597, "supported_languages": null}, "macro.dbt.get_assert_columns_equivalent": {"name": "get_assert_columns_equivalent", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/column/columns_spec_ddl.sql", "original_file_path": "macros/relations/column/columns_spec_ddl.sql", "unique_id": "macro.dbt.get_assert_columns_equivalent", "macro_sql": "\n\n{%- macro get_assert_columns_equivalent(sql) -%}\n {{ adapter.dispatch('get_assert_columns_equivalent', 'dbt')(sql) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt.default__get_assert_columns_equivalent"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "sql", "type": null, "description": ""}], "created_at": 1789503443.048599, "supported_languages": null}, "macro.dbt.default__get_assert_columns_equivalent": {"name": "default__get_assert_columns_equivalent", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/column/columns_spec_ddl.sql", "original_file_path": "macros/relations/column/columns_spec_ddl.sql", "unique_id": "macro.dbt.default__get_assert_columns_equivalent", "macro_sql": "{% macro default__get_assert_columns_equivalent(sql) -%}\n {{ return(assert_columns_equivalent(sql)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.assert_columns_equivalent"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "sql", "type": null, "description": ""}], "created_at": 1789503443.0488832, "supported_languages": null}, "macro.dbt.assert_columns_equivalent": {"name": "assert_columns_equivalent", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/column/columns_spec_ddl.sql", "original_file_path": "macros/relations/column/columns_spec_ddl.sql", "unique_id": "macro.dbt.assert_columns_equivalent", "macro_sql": "{% macro assert_columns_equivalent(sql) %}\n\n {#-- First ensure the user has defined 'columns' in yaml specification --#}\n {%- set user_defined_columns = model['columns'] -%}\n {%- if not user_defined_columns -%}\n {{ exceptions.raise_contract_error([], []) }}\n {%- endif -%}\n\n {#-- Obtain the column schema provided by sql file. #}\n {%- set sql_file_provided_columns = get_column_schema_from_query(sql, config.get('sql_header', none)) -%}\n {#--Obtain the column schema provided by the schema file by generating an 'empty schema' query from the model's columns. #}\n {%- set schema_file_provided_columns = get_column_schema_from_query(get_empty_schema_sql(user_defined_columns)) -%}\n\n {#-- create dictionaries with name and formatted data type and strings for exception #}\n {%- set sql_columns = format_columns(sql_file_provided_columns) -%}\n {%- set yaml_columns = format_columns(schema_file_provided_columns) -%}\n\n {%- if sql_columns|length != yaml_columns|length -%}\n {%- do exceptions.raise_contract_error(yaml_columns, sql_columns) -%}\n {%- endif -%}\n\n {%- for sql_col in sql_columns -%}\n {%- set yaml_col = [] -%}\n {%- for this_col in yaml_columns -%}\n {%- if this_col['name'] == sql_col['name'] -%}\n {%- do yaml_col.append(this_col) -%}\n {%- break -%}\n {%- endif -%}\n {%- endfor -%}\n {%- if not yaml_col -%}\n {#-- Column with name not found in yaml #}\n {%- do exceptions.raise_contract_error(yaml_columns, sql_columns) -%}\n {%- endif -%}\n {%- if sql_col['formatted'] != yaml_col[0]['formatted'] -%}\n {#-- Column data types don't match #}\n {%- do exceptions.raise_contract_error(yaml_columns, sql_columns) -%}\n {%- endif -%}\n {%- endfor -%}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_column_schema_from_query", "macro.dbt.get_empty_schema_sql", "macro.dbt.format_columns"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "sql", "type": null, "description": ""}], "created_at": 1789503443.0514922, "supported_languages": null}, "macro.dbt.format_columns": {"name": "format_columns", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/column/columns_spec_ddl.sql", "original_file_path": "macros/relations/column/columns_spec_ddl.sql", "unique_id": "macro.dbt.format_columns", "macro_sql": "{% macro format_columns(columns) %}\n {% set formatted_columns = [] %}\n {% for column in columns %}\n {%- set formatted_column = adapter.dispatch('format_column', 'dbt')(column) -%}\n {%- do formatted_columns.append(formatted_column) -%}\n {% endfor %}\n {{ return(formatted_columns) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__format_column"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "columns", "type": null, "description": ""}], "created_at": 1789503443.0522807, "supported_languages": null}, "macro.dbt.default__format_column": {"name": "default__format_column", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/column/columns_spec_ddl.sql", "original_file_path": "macros/relations/column/columns_spec_ddl.sql", "unique_id": "macro.dbt.default__format_column", "macro_sql": "{% macro default__format_column(column) -%}\n {% set data_type = column.dtype %}\n {% set formatted = column.column.lower() ~ \" \" ~ data_type %}\n {{ return({'name': column.name, 'data_type': data_type, 'formatted': formatted}) }}\n{%- endmacro -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "column", "type": null, "description": ""}], "created_at": 1789503443.0529604, "supported_languages": null}, "macro.dbt.get_create_table_as_sql": {"name": "get_create_table_as_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/table/create.sql", "original_file_path": "macros/relations/table/create.sql", "unique_id": "macro.dbt.get_create_table_as_sql", "macro_sql": "{% macro get_create_table_as_sql(temporary, relation, sql) -%}\n {{ adapter.dispatch('get_create_table_as_sql', 'dbt')(temporary, relation, sql) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_create_table_as_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "temporary", "type": null, "description": ""}, {"name": "relation", "type": null, "description": ""}, {"name": "sql", "type": null, "description": ""}], "created_at": 1789503443.0541923, "supported_languages": null}, "macro.dbt.default__get_create_table_as_sql": {"name": "default__get_create_table_as_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/table/create.sql", "original_file_path": "macros/relations/table/create.sql", "unique_id": "macro.dbt.default__get_create_table_as_sql", "macro_sql": "{% macro default__get_create_table_as_sql(temporary, relation, sql) -%}\n {{ return(create_table_as(temporary, relation, sql)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.create_table_as"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "temporary", "type": null, "description": ""}, {"name": "relation", "type": null, "description": ""}, {"name": "sql", "type": null, "description": ""}], "created_at": 1789503443.0545702, "supported_languages": null}, "macro.dbt.create_table_as": {"name": "create_table_as", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/table/create.sql", "original_file_path": "macros/relations/table/create.sql", "unique_id": "macro.dbt.create_table_as", "macro_sql": "{% macro create_table_as(temporary, relation, compiled_code, language='sql') -%}\n {# backward compatibility for create_table_as that does not support language #}\n {% if language == \"sql\" %}\n {{ adapter.dispatch('create_table_as', 'dbt')(temporary, relation, compiled_code)}}\n {% else %}\n {{ adapter.dispatch('create_table_as', 'dbt')(temporary, relation, compiled_code, language) }}\n {% endif %}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__create_table_as"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "temporary", "type": null, "description": ""}, {"name": "relation", "type": null, "description": ""}, {"name": "compiled_code", "type": null, "description": ""}, {"name": "language", "type": null, "description": ""}], "created_at": 1789503443.0555592, "supported_languages": null}, "macro.dbt.default__create_table_as": {"name": "default__create_table_as", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/table/create.sql", "original_file_path": "macros/relations/table/create.sql", "unique_id": "macro.dbt.default__create_table_as", "macro_sql": "{% macro default__create_table_as(temporary, relation, sql) -%}\n {%- set sql_header = config.get('sql_header', none) -%}\n\n {{ sql_header if sql_header is not none }}\n\n create {% if temporary: -%}temporary{%- endif %} table\n {{ relation.include(database=(not temporary), schema=(not temporary)) }}\n {% set contract_config = config.get('contract') %}\n {% if contract_config.enforced and (not temporary) %}\n {{ get_assert_columns_equivalent(sql) }}\n {{ get_table_columns_and_constraints() }}\n {%- set sql = get_select_subquery(sql) %}\n {% endif %}\n as (\n {{ sql }}\n );\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.get_assert_columns_equivalent", "macro.dbt.get_table_columns_and_constraints", "macro.dbt.get_select_subquery"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "temporary", "type": null, "description": ""}, {"name": "relation", "type": null, "description": ""}, {"name": "sql", "type": null, "description": ""}], "created_at": 1789503443.0569565, "supported_languages": null}, "macro.dbt.default__get_column_names": {"name": "default__get_column_names", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/table/create.sql", "original_file_path": "macros/relations/table/create.sql", "unique_id": "macro.dbt.default__get_column_names", "macro_sql": "{% macro default__get_column_names() %}\n {#- loop through user_provided_columns to get column names -#}\n {%- set user_provided_columns = model['columns'] -%}\n {%- for i in user_provided_columns %}\n {%- set col = user_provided_columns[i] -%}\n {%- set col_name = adapter.quote(col['name']) if col.get('quote') else col['name'] -%}\n {{ col_name }}{{ \", \" if not loop.last }}\n {%- endfor -%}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789503443.0578945, "supported_languages": null}, "macro.dbt.get_select_subquery": {"name": "get_select_subquery", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/table/create.sql", "original_file_path": "macros/relations/table/create.sql", "unique_id": "macro.dbt.get_select_subquery", "macro_sql": "{% macro get_select_subquery(sql) %}\n {{ return(adapter.dispatch('get_select_subquery', 'dbt')(sql)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_select_subquery"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "sql", "type": null, "description": ""}], "created_at": 1789503443.0583117, "supported_languages": null}, "macro.dbt.default__get_select_subquery": {"name": "default__get_select_subquery", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/table/create.sql", "original_file_path": "macros/relations/table/create.sql", "unique_id": "macro.dbt.default__get_select_subquery", "macro_sql": "{% macro default__get_select_subquery(sql) %}\n select {{ adapter.dispatch('get_column_names', 'dbt')() }}\n from (\n {{ sql }}\n ) as model_subq\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_column_names"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "sql", "type": null, "description": ""}], "created_at": 1789503443.058691, "supported_languages": null}, "macro.dbt.get_rename_table_sql": {"name": "get_rename_table_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/table/rename.sql", "original_file_path": "macros/relations/table/rename.sql", "unique_id": "macro.dbt.get_rename_table_sql", "macro_sql": "{% macro get_rename_table_sql(relation, new_name) %}\n {{- adapter.dispatch('get_rename_table_sql', 'dbt')(relation, new_name) -}}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__get_rename_table_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "new_name", "type": null, "description": ""}], "created_at": 1789503443.059257, "supported_languages": null}, "macro.dbt.default__get_rename_table_sql": {"name": "default__get_rename_table_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/table/rename.sql", "original_file_path": "macros/relations/table/rename.sql", "unique_id": "macro.dbt.default__get_rename_table_sql", "macro_sql": "{% macro default__get_rename_table_sql(relation, new_name) %}\n {{ exceptions.raise_compiler_error(\n \"`get_rename_table_sql` has not been implemented for this adapter.\"\n ) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "new_name", "type": null, "description": ""}], "created_at": 1789503443.0595694, "supported_languages": null}, "macro.dbt.drop_table": {"name": "drop_table", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/table/drop.sql", "original_file_path": "macros/relations/table/drop.sql", "unique_id": "macro.dbt.drop_table", "macro_sql": "{% macro drop_table(relation) -%}\n {{- adapter.dispatch('drop_table', 'dbt')(relation) -}}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__drop_table"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789503443.0600708, "supported_languages": null}, "macro.dbt.default__drop_table": {"name": "default__drop_table", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/table/drop.sql", "original_file_path": "macros/relations/table/drop.sql", "unique_id": "macro.dbt.default__drop_table", "macro_sql": "{% macro default__drop_table(relation) -%}\n drop table if exists {{ relation.render() }} cascade\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789503443.0603297, "supported_languages": null}, "macro.dbt.get_replace_table_sql": {"name": "get_replace_table_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/table/replace.sql", "original_file_path": "macros/relations/table/replace.sql", "unique_id": "macro.dbt.get_replace_table_sql", "macro_sql": "{% macro get_replace_table_sql(relation, sql) %}\n {{- adapter.dispatch('get_replace_table_sql', 'dbt')(relation, sql) -}}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__get_replace_table_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "sql", "type": null, "description": ""}], "created_at": 1789503443.060853, "supported_languages": null}, "macro.dbt.default__get_replace_table_sql": {"name": "default__get_replace_table_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/table/replace.sql", "original_file_path": "macros/relations/table/replace.sql", "unique_id": "macro.dbt.default__get_replace_table_sql", "macro_sql": "{% macro default__get_replace_table_sql(relation, sql) %}\n {{ exceptions.raise_compiler_error(\n \"`get_replace_table_sql` has not been implemented for this adapter.\"\n ) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "sql", "type": null, "description": ""}], "created_at": 1789503443.0611818, "supported_languages": null}, "macro.dbt.default__test_relationships": {"name": "default__test_relationships", "resource_type": "macro", "package_name": "dbt", "path": "macros/generic_test_sql/relationships.sql", "original_file_path": "macros/generic_test_sql/relationships.sql", "unique_id": "macro.dbt.default__test_relationships", "macro_sql": "{% macro default__test_relationships(model, column_name, to, field) %}\n\nwith child as (\n select {{ column_name }} as from_field\n from {{ model }}\n where {{ column_name }} is not null\n),\n\nparent as (\n select {{ field }} as to_field\n from {{ to }}\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "column_name", "type": null, "description": ""}, {"name": "to", "type": null, "description": ""}, {"name": "field", "type": null, "description": ""}], "created_at": 1789503443.0617547, "supported_languages": null}, "macro.dbt.default__test_accepted_values": {"name": "default__test_accepted_values", "resource_type": "macro", "package_name": "dbt", "path": "macros/generic_test_sql/accepted_values.sql", "original_file_path": "macros/generic_test_sql/accepted_values.sql", "unique_id": "macro.dbt.default__test_accepted_values", "macro_sql": "{% macro default__test_accepted_values(model, column_name, values, quote=True) %}\n\nwith all_values as (\n\n select\n {{ column_name }} as value_field,\n count(*) as n_records\n\n from {{ model }}\n group by {{ column_name }}\n\n)\n\nselect *\nfrom all_values\nwhere value_field not in (\n {% for value in values -%}\n {% if quote -%}\n '{{ value }}'\n {%- else -%}\n {{ value }}\n {%- endif -%}\n {%- if not loop.last -%},{%- endif %}\n {%- endfor %}\n)\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "column_name", "type": null, "description": ""}, {"name": "values", "type": null, "description": ""}, {"name": "quote", "type": null, "description": ""}], "created_at": 1789503443.0627978, "supported_languages": null}, "macro.dbt.default__test_not_null": {"name": "default__test_not_null", "resource_type": "macro", "package_name": "dbt", "path": "macros/generic_test_sql/not_null.sql", "original_file_path": "macros/generic_test_sql/not_null.sql", "unique_id": "macro.dbt.default__test_not_null", "macro_sql": "{% macro default__test_not_null(model, column_name) %}\n\n{% set column_list = '*' if should_store_failures() else column_name %}\n\nselect {{ column_list }}\nfrom {{ model }}\nwhere {{ column_name }} is null\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.should_store_failures"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "column_name", "type": null, "description": ""}], "created_at": 1789503443.0634215, "supported_languages": null}, "macro.dbt.default__test_unique": {"name": "default__test_unique", "resource_type": "macro", "package_name": "dbt", "path": "macros/generic_test_sql/unique.sql", "original_file_path": "macros/generic_test_sql/unique.sql", "unique_id": "macro.dbt.default__test_unique", "macro_sql": "{% macro default__test_unique(model, column_name) %}\n\nselect\n {{ column_name }} as unique_field,\n count(*) as n_records\n\nfrom {{ model }}\nwhere {{ column_name }} is not null\ngroup by {{ column_name }}\nhaving count(*) > 1\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "column_name", "type": null, "description": ""}], "created_at": 1789503443.0638888, "supported_languages": null}, "macro.dbt.set_sql_header": {"name": "set_sql_header", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/configs.sql", "original_file_path": "macros/materializations/configs.sql", "unique_id": "macro.dbt.set_sql_header", "macro_sql": "{% macro set_sql_header(config) -%}\n {{ config.set('sql_header', caller()) }}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "config", "type": null, "description": ""}], "created_at": 1789503443.0644825, "supported_languages": null}, "macro.dbt.should_full_refresh": {"name": "should_full_refresh", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/configs.sql", "original_file_path": "macros/materializations/configs.sql", "unique_id": "macro.dbt.should_full_refresh", "macro_sql": "{% macro should_full_refresh() %}\n {% set config_full_refresh = config.get('full_refresh') %}\n {% if config_full_refresh is none %}\n {% set config_full_refresh = flags.FULL_REFRESH %}\n {% endif %}\n {% do return(config_full_refresh) %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789503443.06524, "supported_languages": null}, "macro.dbt.should_store_failures": {"name": "should_store_failures", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/configs.sql", "original_file_path": "macros/materializations/configs.sql", "unique_id": "macro.dbt.should_store_failures", "macro_sql": "{% macro should_store_failures() %}\n {% set config_store_failures = config.get('store_failures') %}\n {% if config_store_failures is none %}\n {% set config_store_failures = flags.STORE_FAILURES %}\n {% endif %}\n {% do return(config_store_failures) %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789503443.0658355, "supported_languages": null}, "macro.dbt.run_hooks": {"name": "run_hooks", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/hooks.sql", "original_file_path": "macros/materializations/hooks.sql", "unique_id": "macro.dbt.run_hooks", "macro_sql": "{% macro run_hooks(hooks, inside_transaction=True) %}\n {% for hook in hooks | selectattr('transaction', 'equalto', inside_transaction) %}\n {% if not inside_transaction and loop.first %}\n {% call statement(auto_begin=inside_transaction) %}\n commit;\n {% endcall %}\n {% endif %}\n {% set rendered = render(hook.get('sql')) | trim %}\n {% if (rendered | length) > 0 %}\n {% call statement(auto_begin=inside_transaction) %}\n {{ rendered }}\n {% endcall %}\n {% endif %}\n {% endfor %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "hooks", "type": null, "description": ""}, {"name": "inside_transaction", "type": null, "description": ""}], "created_at": 1789503443.0675786, "supported_languages": null}, "macro.dbt.make_hook_config": {"name": "make_hook_config", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/hooks.sql", "original_file_path": "macros/materializations/hooks.sql", "unique_id": "macro.dbt.make_hook_config", "macro_sql": "{% macro make_hook_config(sql, inside_transaction) %}\n {{ tojson({\"sql\": sql, \"transaction\": inside_transaction}) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "sql", "type": null, "description": ""}, {"name": "inside_transaction", "type": null, "description": ""}], "created_at": 1789503443.0679977, "supported_languages": null}, "macro.dbt.before_begin": {"name": "before_begin", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/hooks.sql", "original_file_path": "macros/materializations/hooks.sql", "unique_id": "macro.dbt.before_begin", "macro_sql": "{% macro before_begin(sql) %}\n {{ make_hook_config(sql, inside_transaction=False) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.make_hook_config"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "sql", "type": null, "description": ""}], "created_at": 1789503443.0683045, "supported_languages": null}, "macro.dbt.in_transaction": {"name": "in_transaction", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/hooks.sql", "original_file_path": "macros/materializations/hooks.sql", "unique_id": "macro.dbt.in_transaction", "macro_sql": "{% macro in_transaction(sql) %}\n {{ make_hook_config(sql, inside_transaction=True) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.make_hook_config"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "sql", "type": null, "description": ""}], "created_at": 1789503443.0686004, "supported_languages": null}, "macro.dbt.after_commit": {"name": "after_commit", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/hooks.sql", "original_file_path": "macros/materializations/hooks.sql", "unique_id": "macro.dbt.after_commit", "macro_sql": "{% macro after_commit(sql) %}\n {{ make_hook_config(sql, inside_transaction=False) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.make_hook_config"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "sql", "type": null, "description": ""}], "created_at": 1789503443.0688968, "supported_languages": null}, "macro.dbt.materialization_seed_default": {"name": "materialization_seed_default", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/seeds/seed.sql", "original_file_path": "macros/materializations/seeds/seed.sql", "unique_id": "macro.dbt.materialization_seed_default", "macro_sql": "{% materialization seed, default %}\n\n {%- set identifier = model['alias'] -%}\n {%- set full_refresh_mode = (should_full_refresh()) -%}\n\n {%- set old_relation = adapter.get_relation(database=database, schema=schema, identifier=identifier) -%}\n\n {%- set exists_as_table = (old_relation is not none and old_relation.is_table) -%}\n {%- set exists_as_view = (old_relation is not none and old_relation.is_view) -%}\n\n {%- set grant_config = config.get('grants') -%}\n {%- set agate_table = load_agate_table() -%}\n -- grab current tables grants config for comparison later on\n\n {%- do store_result('agate_table', response='OK', agate_table=agate_table) -%}\n\n {{ run_hooks(pre_hooks, inside_transaction=False) }}\n\n -- `BEGIN` happens here:\n {{ run_hooks(pre_hooks, inside_transaction=True) }}\n\n -- build model\n {% set create_table_sql = \"\" %}\n {% if exists_as_view %}\n {{ exceptions.raise_compiler_error(\"Cannot seed to '{}', it is a view\".format(old_relation.render())) }}\n {% elif exists_as_table %}\n {% set create_table_sql = reset_csv_table(model, full_refresh_mode, old_relation, agate_table) %}\n {% else %}\n {% set create_table_sql = create_csv_table(model, agate_table) %}\n {% endif %}\n\n {% set code = 'CREATE' if full_refresh_mode else 'INSERT' %}\n {% set rows_affected = (agate_table.rows | length) %}\n {% set sql = \"\" %}\n {% if rows_affected > 0 %}\n {% set sql = load_csv_rows(model, agate_table) %}\n {% endif %}\n\n {% call noop_statement('main', code ~ ' ' ~ rows_affected, code, rows_affected) %}\n {{ get_csv_sql(create_table_sql, sql) }};\n {% endcall %}\n\n {% set target_relation = this.incorporate(type='table') %}\n\n {% set should_revoke = should_revoke(old_relation, full_refresh_mode) %}\n {% do apply_grants(target_relation, grant_config, should_revoke=should_revoke) %}\n\n {% do persist_docs(target_relation, model) %}\n\n {% if full_refresh_mode or not exists_as_table %}\n {% do create_indexes(target_relation) %}\n {% endif %}\n\n {{ run_hooks(post_hooks, inside_transaction=True) }}\n\n -- `COMMIT` happens here\n {{ adapter.commit() }}\n\n {{ run_hooks(post_hooks, inside_transaction=False) }}\n\n {{ return({'relations': [target_relation]}) }}\n\n{% endmaterialization %}", "depends_on": {"macros": ["macro.dbt.should_full_refresh", "macro.dbt.run_hooks", "macro.dbt.reset_csv_table", "macro.dbt.create_csv_table", "macro.dbt.load_csv_rows", "macro.dbt.noop_statement", "macro.dbt.get_csv_sql", "macro.dbt.should_revoke", "macro.dbt.apply_grants", "macro.dbt.persist_docs", "macro.dbt.create_indexes"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "supported_languages", "type": null, "description": ""}], "created_at": 1789503443.074313, "supported_languages": ["sql"]}, "macro.dbt.create_csv_table": {"name": "create_csv_table", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "unique_id": "macro.dbt.create_csv_table", "macro_sql": "{% macro create_csv_table(model, agate_table) -%}\n {{ adapter.dispatch('create_csv_table', 'dbt')(model, agate_table) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__create_csv_table"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "agate_table", "type": null, "description": ""}], "created_at": 1789503443.0761995, "supported_languages": null}, "macro.dbt.default__create_csv_table": {"name": "default__create_csv_table", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "unique_id": "macro.dbt.default__create_csv_table", "macro_sql": "{% macro default__create_csv_table(model, agate_table) %}\n {%- set column_override = model['config'].get('column_types', {}) -%}\n {%- set quote_seed_column = model['config'].get('quote_columns', None) -%}\n\n {% set sql %}\n create table {{ this.render() }} (\n {%- for col_name in agate_table.column_names -%}\n {%- set inferred_type = adapter.convert_type(agate_table, loop.index0) -%}\n {%- set type = column_override.get(col_name, inferred_type) -%}\n {%- set column_name = (col_name | string) -%}\n {{ adapter.quote_seed_column(column_name, quote_seed_column) }} {{ type }} {%- if not loop.last -%}, {%- endif -%}\n {%- endfor -%}\n )\n {% endset %}\n\n {% call statement('_') -%}\n {{ sql }}\n {%- endcall %}\n\n {{ return(sql) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "agate_table", "type": null, "description": ""}], "created_at": 1789503443.078017, "supported_languages": null}, "macro.dbt.reset_csv_table": {"name": "reset_csv_table", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "unique_id": "macro.dbt.reset_csv_table", "macro_sql": "{% macro reset_csv_table(model, full_refresh, old_relation, agate_table) -%}\n {{ adapter.dispatch('reset_csv_table', 'dbt')(model, full_refresh, old_relation, agate_table) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__reset_csv_table"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "full_refresh", "type": null, "description": ""}, {"name": "old_relation", "type": null, "description": ""}, {"name": "agate_table", "type": null, "description": ""}], "created_at": 1789503443.0784867, "supported_languages": null}, "macro.dbt.default__reset_csv_table": {"name": "default__reset_csv_table", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "unique_id": "macro.dbt.default__reset_csv_table", "macro_sql": "{% macro default__reset_csv_table(model, full_refresh, old_relation, agate_table) %}\n {% set sql = \"\" %}\n {% if full_refresh %}\n {{ adapter.drop_relation(old_relation) }}\n {% set sql = create_csv_table(model, agate_table) %}\n {% else %}\n {{ adapter.truncate_relation(old_relation) }}\n {% set sql = \"truncate table \" ~ old_relation.render() %}\n {% endif %}\n\n {{ return(sql) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.create_csv_table"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "full_refresh", "type": null, "description": ""}, {"name": "old_relation", "type": null, "description": ""}, {"name": "agate_table", "type": null, "description": ""}], "created_at": 1789503443.0794976, "supported_languages": null}, "macro.dbt.get_csv_sql": {"name": "get_csv_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "unique_id": "macro.dbt.get_csv_sql", "macro_sql": "{% macro get_csv_sql(create_or_truncate_sql, insert_sql) %}\n {{ adapter.dispatch('get_csv_sql', 'dbt')(create_or_truncate_sql, insert_sql) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_csv_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "create_or_truncate_sql", "type": null, "description": ""}, {"name": "insert_sql", "type": null, "description": ""}], "created_at": 1789503443.0798848, "supported_languages": null}, "macro.dbt.default__get_csv_sql": {"name": "default__get_csv_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "unique_id": "macro.dbt.default__get_csv_sql", "macro_sql": "{% macro default__get_csv_sql(create_or_truncate_sql, insert_sql) %}\n {{ create_or_truncate_sql }};\n -- dbt seed --\n {{ insert_sql }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "create_or_truncate_sql", "type": null, "description": ""}, {"name": "insert_sql", "type": null, "description": ""}], "created_at": 1789503443.0801923, "supported_languages": null}, "macro.dbt.get_binding_char": {"name": "get_binding_char", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "unique_id": "macro.dbt.get_binding_char", "macro_sql": "{% macro get_binding_char() -%}\n {{ adapter.dispatch('get_binding_char', 'dbt')() }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_binding_char"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789503443.0804877, "supported_languages": null}, "macro.dbt.default__get_binding_char": {"name": "default__get_binding_char", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "unique_id": "macro.dbt.default__get_binding_char", "macro_sql": "{% macro default__get_binding_char() %}\n {{ return('%s') }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789503443.080731, "supported_languages": null}, "macro.dbt.get_batch_size": {"name": "get_batch_size", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "unique_id": "macro.dbt.get_batch_size", "macro_sql": "{% macro get_batch_size() -%}\n {{ return(adapter.dispatch('get_batch_size', 'dbt')()) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_batch_size"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789503443.0810742, "supported_languages": null}, "macro.dbt.default__get_batch_size": {"name": "default__get_batch_size", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "unique_id": "macro.dbt.default__get_batch_size", "macro_sql": "{% macro default__get_batch_size() %}\n {{ return(10000) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789503443.081321, "supported_languages": null}, "macro.dbt.get_seed_column_quoted_csv": {"name": "get_seed_column_quoted_csv", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "unique_id": "macro.dbt.get_seed_column_quoted_csv", "macro_sql": "{% macro get_seed_column_quoted_csv(model, column_names) %}\n {%- set quote_seed_column = model['config'].get('quote_columns', None) -%}\n {% set quoted = [] %}\n {% for col in column_names -%}\n {%- do quoted.append(adapter.quote_seed_column(col, quote_seed_column)) -%}\n {%- endfor %}\n\n {%- set dest_cols_csv = quoted | join(', ') -%}\n {{ return(dest_cols_csv) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "column_names", "type": null, "description": ""}], "created_at": 1789503443.0823002, "supported_languages": null}, "macro.dbt.load_csv_rows": {"name": "load_csv_rows", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "unique_id": "macro.dbt.load_csv_rows", "macro_sql": "{% macro load_csv_rows(model, agate_table) -%}\n {{ adapter.dispatch('load_csv_rows', 'dbt')(model, agate_table) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__load_csv_rows"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "agate_table", "type": null, "description": ""}], "created_at": 1789503443.0826743, "supported_languages": null}, "macro.dbt.default__load_csv_rows": {"name": "default__load_csv_rows", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "unique_id": "macro.dbt.default__load_csv_rows", "macro_sql": "{% macro default__load_csv_rows(model, agate_table) %}\n\n {% set batch_size = get_batch_size() %}\n\n {% set cols_sql = get_seed_column_quoted_csv(model, agate_table.column_names) %}\n {% set bindings = [] %}\n\n {% set statements = [] %}\n\n {% for chunk in agate_table.rows | batch(batch_size) %}\n {% set bindings = [] %}\n\n {% for row in chunk %}\n {% do bindings.extend(row) %}\n {% endfor %}\n\n {% set sql %}\n insert into {{ this.render() }} ({{ cols_sql }}) values\n {% for row in chunk -%}\n ({%- for column in agate_table.column_names -%}\n {{ get_binding_char() }}\n {%- if not loop.last%},{%- endif %}\n {%- endfor -%})\n {%- if not loop.last%},{%- endif %}\n {%- endfor %}\n {% endset %}\n\n {% do adapter.add_query(sql, bindings=bindings, abridge_sql_log=True) %}\n\n {% if loop.index0 == 0 %}\n {% do statements.append(sql) %}\n {% endif %}\n {% endfor %}\n\n {# Return SQL so we can render it out into the compiled files #}\n {{ return(statements[0]) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_batch_size", "macro.dbt.get_seed_column_quoted_csv", "macro.dbt.get_binding_char"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "agate_table", "type": null, "description": ""}], "created_at": 1789503443.0852625, "supported_languages": null}, "macro.dbt.materialization_unit_default": {"name": "materialization_unit_default", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/tests/unit.sql", "original_file_path": "macros/materializations/tests/unit.sql", "unique_id": "macro.dbt.materialization_unit_default", "macro_sql": "{%- materialization unit, default -%}\n\n {% set relations = [] %}\n {% set sql_header = config.get('sql_header') if flags.REQUIRE_SQL_HEADER_IN_TEST_CONFIGS else none %}\n\n {% set expected_rows = config.get('expected_rows') %}\n {% set expected_sql = config.get('expected_sql') %}\n {% set tested_expected_column_names = expected_rows[0].keys() if (expected_rows | length ) > 0 else get_columns_in_query(sql) %}\n\n {%- set target_relation = this.incorporate(type='table') -%}\n {%- set temp_relation = make_temp_relation(target_relation)-%}\n {% do run_query(get_create_table_as_sql(True, temp_relation, get_empty_subquery_sql(sql))) %}\n {%- set columns_in_relation = adapter.get_columns_in_relation(temp_relation) -%}\n {%- set column_name_to_data_types = {} -%}\n {%- set column_name_to_quoted = {} -%}\n {%- for column in columns_in_relation -%}\n {%- do column_name_to_data_types.update({column.name|lower: column.data_type}) -%}\n {%- do column_name_to_quoted.update({column.name|lower: column.quoted}) -%}\n {%- endfor -%}\n\n {%- set expected_column_names_quoted = [] -%}\n {%- for column_name in tested_expected_column_names -%}\n {%- do expected_column_names_quoted.append(column_name_to_quoted[column_name|lower]) -%}\n {%- endfor -%}\n\n {% if not expected_sql %}\n {% set expected_sql = get_expected_sql(expected_rows, column_name_to_data_types, column_name_to_quoted) %}\n {% endif %}\n {% set unit_test_sql = get_unit_test_sql(sql, expected_sql, expected_column_names_quoted) %}\n\n {% call statement('main', fetch_result=True) -%}\n\n {% if sql_header %}{{ sql_header }}{% endif %}\n {{ unit_test_sql }}\n\n {%- endcall %}\n\n {% do adapter.drop_relation(temp_relation) %}\n\n {{ return({'relations': relations}) }}\n\n{%- endmaterialization -%}", "depends_on": {"macros": ["macro.dbt.get_columns_in_query", "macro.dbt.make_temp_relation", "macro.dbt.run_query", "macro.dbt.get_create_table_as_sql", "macro.dbt.get_empty_subquery_sql", "macro.dbt.get_expected_sql", "macro.dbt.get_unit_test_sql", "macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "supported_languages", "type": null, "description": ""}], "created_at": 1789503443.0894203, "supported_languages": ["sql"]}, "macro.dbt.materialization_test_default": {"name": "materialization_test_default", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/tests/test.sql", "original_file_path": "macros/materializations/tests/test.sql", "unique_id": "macro.dbt.materialization_test_default", "macro_sql": "{%- materialization test, default -%}\n\n {% set relations = [] %}\n {% set limit = config.get('limit') %}\n {% set sql_header = config.get('sql_header') if flags.REQUIRE_SQL_HEADER_IN_TEST_CONFIGS else none %}\n\n {% set sql_with_limit %}\n {{ get_limit_subquery_sql(sql, limit) }}\n {% endset %}\n\n {% if should_store_failures() %}\n\n {% set identifier = model['alias'] %}\n {% set old_relation = adapter.get_relation(database=database, schema=schema, identifier=identifier) %}\n\n {% set store_failures_as = config.get('store_failures_as') %}\n -- if `--store-failures` is invoked via command line and `store_failures_as` is not set,\n -- config.get('store_failures_as', 'table') returns None, not 'table'\n {% if store_failures_as == none %}{% set store_failures_as = 'table' %}{% endif %}\n {% if store_failures_as not in ['table', 'view'] %}\n {{ exceptions.raise_compiler_error(\n \"'\" ~ store_failures_as ~ \"' is not a valid value for `store_failures_as`. \"\n \"Accepted values are: ['ephemeral', 'table', 'view']\"\n ) }}\n {% endif %}\n\n {% set target_relation = api.Relation.create(\n identifier=identifier, schema=schema, database=database, type=store_failures_as) -%} %}\n\n {% if old_relation %}\n {% do adapter.drop_relation(old_relation) %}\n {% endif %}\n\n {% call statement(auto_begin=True) %}\n {% if sql_header %}{{ sql_header }}{% endif %}\n {{ get_create_sql(target_relation, sql_with_limit) }}\n {% endcall %}\n\n {% do relations.append(target_relation) %}\n\n {# Since the test failures have already been saved to the database, reuse that result rather than querying again #}\n {% set main_sql %}\n select *\n from {{ target_relation }}\n {% endset %}\n\n {{ adapter.commit() }}\n\n {% else %}\n\n {% set main_sql = sql_with_limit %}\n\n {% endif %}\n\n {% set fail_calc = config.get('fail_calc') %}\n {% set warn_if = config.get('warn_if') %}\n {% set error_if = config.get('error_if') %}\n\n {% call statement('main', fetch_result=True) -%}\n\n {% if sql_header %}{{ sql_header }}{% endif %}\n {# The limit has already been included above, and we do not want to duplicate it again. We also want to be safe for macro overrides treating `limit` as a required parameter. #}\n {{ get_test_sql(main_sql, fail_calc, warn_if, error_if, limit=none)}}\n\n {%- endcall %}\n\n {{ return({'relations': relations}) }}\n\n{%- endmaterialization -%}", "depends_on": {"macros": ["macro.dbt.get_limit_subquery_sql", "macro.dbt.should_store_failures", "macro.dbt.statement", "macro.dbt.get_create_sql", "macro.dbt.get_test_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "supported_languages", "type": null, "description": ""}], "created_at": 1789503443.0945303, "supported_languages": ["sql"]}, "macro.dbt.get_test_sql": {"name": "get_test_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/tests/helpers.sql", "original_file_path": "macros/materializations/tests/helpers.sql", "unique_id": "macro.dbt.get_test_sql", "macro_sql": "{% macro get_test_sql(main_sql, fail_calc, warn_if, error_if, limit) -%}\n {{ adapter.dispatch('get_test_sql', 'dbt')(main_sql, fail_calc, warn_if, error_if, limit) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_test_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "main_sql", "type": null, "description": ""}, {"name": "fail_calc", "type": null, "description": ""}, {"name": "warn_if", "type": null, "description": ""}, {"name": "error_if", "type": null, "description": ""}, {"name": "limit", "type": null, "description": ""}], "created_at": 1789503443.0956202, "supported_languages": null}, "macro.dbt.default__get_test_sql": {"name": "default__get_test_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/tests/helpers.sql", "original_file_path": "macros/materializations/tests/helpers.sql", "unique_id": "macro.dbt.default__get_test_sql", "macro_sql": "{% macro default__get_test_sql(main_sql, fail_calc, warn_if, error_if, limit) -%}\n select\n {{ fail_calc }} as failures,\n {{ fail_calc }} {{ warn_if }} as should_warn,\n {{ fail_calc }} {{ error_if }} as should_error\n from (\n {{ main_sql }}\n {{ \"limit \" ~ limit if limit != none }}\n ) dbt_internal_test\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "main_sql", "type": null, "description": ""}, {"name": "fail_calc", "type": null, "description": ""}, {"name": "warn_if", "type": null, "description": ""}, {"name": "error_if", "type": null, "description": ""}, {"name": "limit", "type": null, "description": ""}], "created_at": 1789503443.0962865, "supported_languages": null}, "macro.dbt.get_unit_test_sql": {"name": "get_unit_test_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/tests/helpers.sql", "original_file_path": "macros/materializations/tests/helpers.sql", "unique_id": "macro.dbt.get_unit_test_sql", "macro_sql": "{% macro get_unit_test_sql(main_sql, expected_fixture_sql, expected_column_names) -%}\n {{ adapter.dispatch('get_unit_test_sql', 'dbt')(main_sql, expected_fixture_sql, expected_column_names) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_unit_test_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "main_sql", "type": null, "description": ""}, {"name": "expected_fixture_sql", "type": null, "description": ""}, {"name": "expected_column_names", "type": null, "description": ""}], "created_at": 1789503443.0967145, "supported_languages": null}, "macro.dbt.default__get_unit_test_sql": {"name": "default__get_unit_test_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/tests/helpers.sql", "original_file_path": "macros/materializations/tests/helpers.sql", "unique_id": "macro.dbt.default__get_unit_test_sql", "macro_sql": "{% macro default__get_unit_test_sql(main_sql, expected_fixture_sql, expected_column_names) -%}\n-- Build actual result given inputs\nwith dbt_internal_unit_test_actual as (\n select\n {% for expected_column_name in expected_column_names %}{{expected_column_name}}{% if not loop.last -%},{% endif %}{%- endfor -%}, {{ dbt.string_literal(\"actual\") }} as {{ adapter.quote(\"actual_or_expected\") }}\n from (\n {{ main_sql }}\n ) _dbt_internal_unit_test_actual\n),\n-- Build expected result\ndbt_internal_unit_test_expected as (\n select\n {% for expected_column_name in expected_column_names %}{{expected_column_name}}{% if not loop.last -%}, {% endif %}{%- endfor -%}, {{ dbt.string_literal(\"expected\") }} as {{ adapter.quote(\"actual_or_expected\") }}\n from (\n {{ expected_fixture_sql }}\n ) _dbt_internal_unit_test_expected\n)\n-- Union actual and expected results\nselect * from dbt_internal_unit_test_actual\nunion all\nselect * from dbt_internal_unit_test_expected\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.string_literal"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "main_sql", "type": null, "description": ""}, {"name": "expected_fixture_sql", "type": null, "description": ""}, {"name": "expected_column_names", "type": null, "description": ""}], "created_at": 1789503443.097946, "supported_languages": null}, "macro.dbt.get_where_subquery": {"name": "get_where_subquery", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/tests/where_subquery.sql", "original_file_path": "macros/materializations/tests/where_subquery.sql", "unique_id": "macro.dbt.get_where_subquery", "macro_sql": "{% macro get_where_subquery(relation) -%}\n {% do return(adapter.dispatch('get_where_subquery', 'dbt')(relation)) %}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_where_subquery"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789503443.0986025, "supported_languages": null}, "macro.dbt.default__get_where_subquery": {"name": "default__get_where_subquery", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/tests/where_subquery.sql", "original_file_path": "macros/materializations/tests/where_subquery.sql", "unique_id": "macro.dbt.default__get_where_subquery", "macro_sql": "{% macro default__get_where_subquery(relation) -%}\n {% set where = config.get('where', '') %}\n {% if where %}\n {%- set filtered -%}\n (select * from {{ relation }} where {{ where }}) dbt_subquery\n {%- endset -%}\n {% do return(filtered) %}\n {%- else -%}\n {% do return(relation) %}\n {%- endif -%}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789503443.0993948, "supported_languages": null}, "macro.dbt.materialization_snapshot_default": {"name": "materialization_snapshot_default", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/snapshot.sql", "original_file_path": "macros/materializations/snapshots/snapshot.sql", "unique_id": "macro.dbt.materialization_snapshot_default", "macro_sql": "{% materialization snapshot, default %}\n\n {%- set target_table = model.get('alias', model.get('name')) -%}\n\n {%- set strategy_name = config.get('strategy') -%}\n {%- set unique_key = config.get('unique_key') %}\n -- grab current tables grants config for comparision later on\n {%- set grant_config = config.get('grants') -%}\n\n {% set target_relation_exists, target_relation = get_or_create_relation(\n database=model.database,\n schema=model.schema,\n identifier=target_table,\n type='table') -%}\n\n {%- if not target_relation.is_table -%}\n {% do exceptions.relation_wrong_type(target_relation, 'table') %}\n {%- endif -%}\n\n\n {{ run_hooks(pre_hooks, inside_transaction=False) }}\n\n {{ run_hooks(pre_hooks, inside_transaction=True) }}\n\n {% set strategy_macro = strategy_dispatch(strategy_name) %}\n {# The model['config'] parameter below is no longer used, but passing anyway for compatibility #}\n {# It was a dictionary of config, instead of the config object from the context #}\n {% set strategy = strategy_macro(model, \"snapshotted_data\", \"source_data\", model['config'], target_relation_exists) %}\n\n {% if not target_relation_exists %}\n\n {% set build_sql = build_snapshot_table(strategy, model['compiled_code']) %}\n {% set build_or_select_sql = build_sql %}\n {% set final_sql = create_table_as(False, target_relation, build_sql) %}\n\n {% else %}\n\n {% set columns = config.get(\"snapshot_table_column_names\") or get_snapshot_table_column_names() %}\n\n {{ adapter.assert_valid_snapshot_target_given_strategy(target_relation, columns, strategy) }}\n\n {% set build_or_select_sql = snapshot_staging_table(strategy, sql, target_relation) %}\n {% set staging_table = build_snapshot_staging_table(strategy, sql, target_relation) %}\n\n -- this may no-op if the database does not require column expansion\n {% do adapter.expand_target_column_types(from_relation=staging_table,\n to_relation=target_relation) %}\n\n {% set remove_columns = ['dbt_change_type', 'DBT_CHANGE_TYPE', 'dbt_unique_key', 'DBT_UNIQUE_KEY'] %}\n {% if unique_key | is_list %}\n {% for key in strategy.unique_key %}\n {{ remove_columns.append('dbt_unique_key_' + loop.index|string) }}\n {{ remove_columns.append('DBT_UNIQUE_KEY_' + loop.index|string) }}\n {% endfor %}\n {% endif %}\n\n {% set missing_columns = adapter.get_missing_columns(staging_table, target_relation)\n | rejectattr('name', 'in', remove_columns)\n | list %}\n\n {% do create_columns(target_relation, missing_columns) %}\n\n {% set source_columns = adapter.get_columns_in_relation(staging_table)\n | rejectattr('name', 'in', remove_columns)\n | list %}\n\n {% set quoted_source_columns = [] %}\n {% for column in source_columns %}\n {% do quoted_source_columns.append(adapter.quote(column.name)) %}\n {% endfor %}\n\n {% set final_sql = snapshot_merge_sql(\n target = target_relation,\n source = staging_table,\n insert_cols = quoted_source_columns\n )\n %}\n\n {% endif %}\n\n\n {{ check_time_data_types(build_or_select_sql) }}\n\n {% call statement('main') %}\n {{ final_sql }}\n {% endcall %}\n\n {% set should_revoke = should_revoke(target_relation_exists, full_refresh_mode=False) %}\n {% do apply_grants(target_relation, grant_config, should_revoke=should_revoke) %}\n\n {% do persist_docs(target_relation, model) %}\n\n {% if not target_relation_exists %}\n {% do create_indexes(target_relation) %}\n {% endif %}\n\n {{ run_hooks(post_hooks, inside_transaction=True) }}\n\n {{ adapter.commit() }}\n\n {% if staging_table is defined %}\n {% do post_snapshot(staging_table) %}\n {% endif %}\n\n {{ run_hooks(post_hooks, inside_transaction=False) }}\n\n {{ return({'relations': [target_relation]}) }}\n\n{% endmaterialization %}", "depends_on": {"macros": ["macro.dbt.get_or_create_relation", "macro.dbt.run_hooks", "macro.dbt.strategy_dispatch", "macro.dbt.build_snapshot_table", "macro.dbt.create_table_as", "macro.dbt.get_snapshot_table_column_names", "macro.dbt.snapshot_staging_table", "macro.dbt.build_snapshot_staging_table", "macro.dbt.create_columns", "macro.dbt.snapshot_merge_sql", "macro.dbt.check_time_data_types", "macro.dbt.statement", "macro.dbt.should_revoke", "macro.dbt.apply_grants", "macro.dbt.persist_docs", "macro.dbt.create_indexes", "macro.dbt.post_snapshot"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "supported_languages", "type": null, "description": ""}], "created_at": 1789503443.1074216, "supported_languages": ["sql"]}, "macro.dbt.strategy_dispatch": {"name": "strategy_dispatch", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/strategies.sql", "original_file_path": "macros/materializations/snapshots/strategies.sql", "unique_id": "macro.dbt.strategy_dispatch", "macro_sql": "{% macro strategy_dispatch(name) -%}\n{% set original_name = name %}\n {% if '.' in name %}\n {% set package_name, name = name.split(\".\", 1) %}\n {% else %}\n {% set package_name = none %}\n {% endif %}\n\n {% if package_name is none %}\n {% set package_context = context %}\n {% elif package_name in context %}\n {% set package_context = context[package_name] %}\n {% else %}\n {% set error_msg %}\n Could not find package '{{package_name}}', called with '{{original_name}}'\n {% endset %}\n {{ exceptions.raise_compiler_error(error_msg | trim) }}\n {% endif %}\n\n {%- set search_name = 'snapshot_' ~ name ~ '_strategy' -%}\n\n {% if search_name not in package_context %}\n {% set error_msg %}\n The specified strategy macro '{{name}}' was not found in package '{{ package_name }}'\n {% endset %}\n {{ exceptions.raise_compiler_error(error_msg | trim) }}\n {% endif %}\n {{ return(package_context[search_name]) }}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "name", "type": null, "description": ""}], "created_at": 1789503443.1114783, "supported_languages": null}, "macro.dbt.snapshot_hash_arguments": {"name": "snapshot_hash_arguments", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/strategies.sql", "original_file_path": "macros/materializations/snapshots/strategies.sql", "unique_id": "macro.dbt.snapshot_hash_arguments", "macro_sql": "{% macro snapshot_hash_arguments(args) -%}\n {{ adapter.dispatch('snapshot_hash_arguments', 'dbt')(args) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__snapshot_hash_arguments"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "args", "type": null, "description": ""}], "created_at": 1789503443.1118362, "supported_languages": null}, "macro.dbt.default__snapshot_hash_arguments": {"name": "default__snapshot_hash_arguments", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/strategies.sql", "original_file_path": "macros/materializations/snapshots/strategies.sql", "unique_id": "macro.dbt.default__snapshot_hash_arguments", "macro_sql": "{% macro default__snapshot_hash_arguments(args) -%}\n md5({%- for arg in args -%}\n coalesce(cast({{ arg }} as varchar ), '')\n {% if not loop.last %} || '|' || {% endif %}\n {%- endfor -%})\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "args", "type": null, "description": ""}], "created_at": 1789503443.1123242, "supported_languages": null}, "macro.dbt.snapshot_timestamp_strategy": {"name": "snapshot_timestamp_strategy", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/strategies.sql", "original_file_path": "macros/materializations/snapshots/strategies.sql", "unique_id": "macro.dbt.snapshot_timestamp_strategy", "macro_sql": "{% macro snapshot_timestamp_strategy(node, snapshotted_rel, current_rel, model_config, target_exists) %}\n {# The model_config parameter is no longer used, but is passed in anyway for compatibility. #}\n {% set primary_key = config.get('unique_key') %}\n {% set updated_at = config.get('updated_at') %}\n {% set hard_deletes = adapter.get_hard_deletes_behavior(config) %}\n {% set invalidate_hard_deletes = hard_deletes == 'invalidate' %}\n {% set columns = config.get(\"snapshot_table_column_names\") or get_snapshot_table_column_names() %}\n\n {#/*\n The snapshot relation might not have an {{ updated_at }} value if the\n snapshot strategy is changed from `check` to `timestamp`. We\n should use a dbt-created column for the comparison in the snapshot\n table instead of assuming that the user-supplied {{ updated_at }}\n will be present in the historical data.\n\n See https://github.com/dbt-labs/dbt-core/issues/2350\n */ #}\n {% set row_changed_expr -%}\n ({{ snapshotted_rel }}.{{ columns.dbt_valid_from }} < {{ current_rel }}.{{ updated_at }})\n {%- endset %}\n\n {% set scd_args = api.Relation.scd_args(primary_key, updated_at) %}\n {% set scd_id_expr = snapshot_hash_arguments(scd_args) %}\n\n {% do return({\n \"unique_key\": primary_key,\n \"updated_at\": updated_at,\n \"row_changed\": row_changed_expr,\n \"scd_id\": scd_id_expr,\n \"invalidate_hard_deletes\": invalidate_hard_deletes,\n \"hard_deletes\": hard_deletes\n }) %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_snapshot_table_column_names", "macro.dbt.snapshot_hash_arguments"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "node", "type": null, "description": ""}, {"name": "snapshotted_rel", "type": null, "description": ""}, {"name": "current_rel", "type": null, "description": ""}, {"name": "model_config", "type": null, "description": ""}, {"name": "target_exists", "type": null, "description": ""}], "created_at": 1789503443.1143038, "supported_languages": null}, "macro.dbt.snapshot_string_as_time": {"name": "snapshot_string_as_time", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/strategies.sql", "original_file_path": "macros/materializations/snapshots/strategies.sql", "unique_id": "macro.dbt.snapshot_string_as_time", "macro_sql": "{% macro snapshot_string_as_time(timestamp) -%}\n {{ adapter.dispatch('snapshot_string_as_time', 'dbt')(timestamp) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__snapshot_string_as_time"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "timestamp", "type": null, "description": ""}], "created_at": 1789503443.1146462, "supported_languages": null}, "macro.dbt.default__snapshot_string_as_time": {"name": "default__snapshot_string_as_time", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/strategies.sql", "original_file_path": "macros/materializations/snapshots/strategies.sql", "unique_id": "macro.dbt.default__snapshot_string_as_time", "macro_sql": "{% macro default__snapshot_string_as_time(timestamp) %}\n {% do exceptions.raise_not_implemented(\n 'snapshot_string_as_time macro not implemented for adapter '+adapter.type()\n ) %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "timestamp", "type": null, "description": ""}], "created_at": 1789503443.115018, "supported_languages": null}, "macro.dbt.snapshot_check_all_get_existing_columns": {"name": "snapshot_check_all_get_existing_columns", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/strategies.sql", "original_file_path": "macros/materializations/snapshots/strategies.sql", "unique_id": "macro.dbt.snapshot_check_all_get_existing_columns", "macro_sql": "{% macro snapshot_check_all_get_existing_columns(node, target_exists, check_cols_config) -%}\n {%- if not target_exists -%}\n {#-- no table yet -> return whatever the query does --#}\n {{ return((false, query_columns)) }}\n {%- endif -%}\n\n {#-- handle any schema changes --#}\n {%- set target_relation = adapter.get_relation(database=node.database, schema=node.schema, identifier=node.alias) -%}\n\n {% if check_cols_config == 'all' %}\n {%- set query_columns = get_columns_in_query(node['compiled_code']) -%}\n\n {% elif check_cols_config is iterable and (check_cols_config | length) > 0 %}\n {#-- query for proper casing/quoting, to support comparison below --#}\n {%- set select_check_cols_from_target -%}\n {#-- N.B. The whitespace below is necessary to avoid edge case issue with comments --#}\n {#-- See: https://github.com/dbt-labs/dbt-core/issues/6781 --#}\n select {{ check_cols_config | join(', ') }} from (\n {{ node['compiled_code'] }}\n ) subq\n {%- endset -%}\n {% set query_columns = get_columns_in_query(select_check_cols_from_target) %}\n\n {% else %}\n {% do exceptions.raise_compiler_error(\"Invalid value for 'check_cols': \" ~ check_cols_config) %}\n {% endif %}\n\n {%- set existing_cols = adapter.get_columns_in_relation(target_relation) | map(attribute = 'name') | list -%}\n {%- set ns = namespace() -%} {#-- handle for-loop scoping with a namespace --#}\n {%- set ns.column_added = false -%}\n\n {%- set intersection = [] -%}\n {%- for col in query_columns -%}\n {%- if col in existing_cols -%}\n {%- do intersection.append(adapter.quote(col)) -%}\n {%- else -%}\n {% set ns.column_added = true %}\n {%- endif -%}\n {%- endfor -%}\n {{ return((ns.column_added, intersection)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.get_columns_in_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "node", "type": null, "description": ""}, {"name": "target_exists", "type": null, "description": ""}, {"name": "check_cols_config", "type": null, "description": ""}], "created_at": 1789503443.117795, "supported_languages": null}, "macro.dbt.snapshot_check_strategy": {"name": "snapshot_check_strategy", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/strategies.sql", "original_file_path": "macros/materializations/snapshots/strategies.sql", "unique_id": "macro.dbt.snapshot_check_strategy", "macro_sql": "{% macro snapshot_check_strategy(node, snapshotted_rel, current_rel, model_config, target_exists) %}\n {# The model_config parameter is no longer used, but is passed in anyway for compatibility. #}\n {% set check_cols_config = config.get('check_cols') %}\n {% set primary_key = config.get('unique_key') %}\n {% set hard_deletes = adapter.get_hard_deletes_behavior(config) %}\n {% set invalidate_hard_deletes = hard_deletes == 'invalidate' %}\n {% set updated_at = config.get('updated_at') or snapshot_get_time() %}\n\n {% set column_added = false %}\n\n {% set column_added, check_cols = snapshot_check_all_get_existing_columns(node, target_exists, check_cols_config) %}\n\n {%- set row_changed_expr -%}\n (\n {%- if column_added -%}\n {{ get_true_sql() }}\n {%- else -%}\n {%- for col in check_cols -%}\n {{ snapshotted_rel }}.{{ col }} != {{ current_rel }}.{{ col }}\n or\n (\n (({{ snapshotted_rel }}.{{ col }} is null) and not ({{ current_rel }}.{{ col }} is null))\n or\n ((not {{ snapshotted_rel }}.{{ col }} is null) and ({{ current_rel }}.{{ col }} is null))\n )\n {%- if not loop.last %} or {% endif -%}\n {%- endfor -%}\n {%- endif -%}\n )\n {%- endset %}\n\n {% set scd_args = api.Relation.scd_args(primary_key, updated_at) %}\n {% set scd_id_expr = snapshot_hash_arguments(scd_args) %}\n\n {% do return({\n \"unique_key\": primary_key,\n \"updated_at\": updated_at,\n \"row_changed\": row_changed_expr,\n \"scd_id\": scd_id_expr,\n \"invalidate_hard_deletes\": invalidate_hard_deletes,\n \"hard_deletes\": hard_deletes\n }) %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.snapshot_get_time", "macro.dbt.snapshot_check_all_get_existing_columns", "macro.dbt.get_true_sql", "macro.dbt.snapshot_hash_arguments"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "node", "type": null, "description": ""}, {"name": "snapshotted_rel", "type": null, "description": ""}, {"name": "current_rel", "type": null, "description": ""}, {"name": "model_config", "type": null, "description": ""}, {"name": "target_exists", "type": null, "description": ""}], "created_at": 1789503443.120772, "supported_languages": null}, "macro.dbt.snapshot_merge_sql": {"name": "snapshot_merge_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/snapshot_merge.sql", "original_file_path": "macros/materializations/snapshots/snapshot_merge.sql", "unique_id": "macro.dbt.snapshot_merge_sql", "macro_sql": "{% macro snapshot_merge_sql(target, source, insert_cols) -%}\n {{ adapter.dispatch('snapshot_merge_sql', 'dbt')(target, source, insert_cols) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__snapshot_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "target", "type": null, "description": ""}, {"name": "source", "type": null, "description": ""}, {"name": "insert_cols", "type": null, "description": ""}], "created_at": 1789503443.1216235, "supported_languages": null}, "macro.dbt.default__snapshot_merge_sql": {"name": "default__snapshot_merge_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/snapshot_merge.sql", "original_file_path": "macros/materializations/snapshots/snapshot_merge.sql", "unique_id": "macro.dbt.default__snapshot_merge_sql", "macro_sql": "{% macro default__snapshot_merge_sql(target, source, insert_cols) -%}\n {%- set insert_cols_csv = insert_cols | join(', ') -%}\n\n {%- set columns = config.get(\"snapshot_table_column_names\") or get_snapshot_table_column_names() -%}\n\n merge into {{ target.render() }} as DBT_INTERNAL_DEST\n using {{ source }} as DBT_INTERNAL_SOURCE\n on DBT_INTERNAL_SOURCE.{{ columns.dbt_scd_id }} = DBT_INTERNAL_DEST.{{ columns.dbt_scd_id }}\n\n when matched\n {% if config.get(\"dbt_valid_to_current\") %}\n\t{% set source_unique_key = (\"DBT_INTERNAL_DEST.\" ~ columns.dbt_valid_to) | trim %}\n\t{% set target_unique_key = config.get('dbt_valid_to_current') | trim %}\n\tand ({{ equals(source_unique_key, target_unique_key) }} or {{ source_unique_key }} is null)\n\n {% else %}\n and DBT_INTERNAL_DEST.{{ columns.dbt_valid_to }} is null\n {% endif %}\n and DBT_INTERNAL_SOURCE.dbt_change_type in ('update', 'delete')\n then update\n set {{ columns.dbt_valid_to }} = DBT_INTERNAL_SOURCE.{{ columns.dbt_valid_to }}\n\n when not matched\n and DBT_INTERNAL_SOURCE.dbt_change_type = 'insert'\n then insert ({{ insert_cols_csv }})\n values ({{ insert_cols_csv }})\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_snapshot_table_column_names", "macro.dbt.equals"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "target", "type": null, "description": ""}, {"name": "source", "type": null, "description": ""}, {"name": "insert_cols", "type": null, "description": ""}], "created_at": 1789503443.123289, "supported_languages": null}, "macro.dbt.create_columns": {"name": "create_columns", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "unique_id": "macro.dbt.create_columns", "macro_sql": "{% macro create_columns(relation, columns) %}\n {{ adapter.dispatch('create_columns', 'dbt')(relation, columns) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__create_columns"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "columns", "type": null, "description": ""}], "created_at": 1789503443.1272616, "supported_languages": null}, "macro.dbt.default__create_columns": {"name": "default__create_columns", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "unique_id": "macro.dbt.default__create_columns", "macro_sql": "{% macro default__create_columns(relation, columns) %}\n {% for column in columns %}\n {% call statement() %}\n alter table {{ relation.render() }} add column {{ adapter.quote(column.name) }} {{ column.expanded_data_type }};\n {% endcall %}\n {% endfor %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "columns", "type": null, "description": ""}], "created_at": 1789503443.1279147, "supported_languages": null}, "macro.dbt.post_snapshot": {"name": "post_snapshot", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "unique_id": "macro.dbt.post_snapshot", "macro_sql": "{% macro post_snapshot(staging_relation) %}\n {{ adapter.dispatch('post_snapshot', 'dbt')(staging_relation) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__post_snapshot"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "staging_relation", "type": null, "description": ""}], "created_at": 1789503443.1283104, "supported_languages": null}, "macro.dbt.default__post_snapshot": {"name": "default__post_snapshot", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "unique_id": "macro.dbt.default__post_snapshot", "macro_sql": "{% macro default__post_snapshot(staging_relation) %}\n {# no-op #}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "staging_relation", "type": null, "description": ""}], "created_at": 1789503443.128508, "supported_languages": null}, "macro.dbt.get_true_sql": {"name": "get_true_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "unique_id": "macro.dbt.get_true_sql", "macro_sql": "{% macro get_true_sql() %}\n {{ adapter.dispatch('get_true_sql', 'dbt')() }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_true_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789503443.1288152, "supported_languages": null}, "macro.dbt.default__get_true_sql": {"name": "default__get_true_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "unique_id": "macro.dbt.default__get_true_sql", "macro_sql": "{% macro default__get_true_sql() %}\n {{ return('TRUE') }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789503443.1290812, "supported_languages": null}, "macro.dbt.snapshot_staging_table": {"name": "snapshot_staging_table", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "unique_id": "macro.dbt.snapshot_staging_table", "macro_sql": "{% macro snapshot_staging_table(strategy, source_sql, target_relation) -%}\n {{ adapter.dispatch('snapshot_staging_table', 'dbt')(strategy, source_sql, target_relation) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__snapshot_staging_table"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "strategy", "type": null, "description": ""}, {"name": "source_sql", "type": null, "description": ""}, {"name": "target_relation", "type": null, "description": ""}], "created_at": 1789503443.1294959, "supported_languages": null}, "macro.dbt.get_snapshot_table_column_names": {"name": "get_snapshot_table_column_names", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "unique_id": "macro.dbt.get_snapshot_table_column_names", "macro_sql": "{% macro get_snapshot_table_column_names() %}\n {{ return({'dbt_valid_to': 'dbt_valid_to', 'dbt_valid_from': 'dbt_valid_from', 'dbt_scd_id': 'dbt_scd_id', 'dbt_updated_at': 'dbt_updated_at', 'dbt_is_deleted': 'dbt_is_deleted'}) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789503443.1300097, "supported_languages": null}, "macro.dbt.default__snapshot_staging_table": {"name": "default__snapshot_staging_table", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "unique_id": "macro.dbt.default__snapshot_staging_table", "macro_sql": "{% macro default__snapshot_staging_table(strategy, source_sql, target_relation) -%}\n {% set columns = config.get('snapshot_table_column_names') or get_snapshot_table_column_names() %}\n {% if strategy.hard_deletes == 'new_record' %}\n {% set new_scd_id = snapshot_hash_arguments([columns.dbt_scd_id, snapshot_get_time()]) %}\n {% endif %}\n with snapshot_query as (\n\n {{ source_sql }}\n\n ),\n\n snapshotted_data as (\n\n select *, {{ unique_key_fields(strategy.unique_key) }}\n from {{ target_relation }}\n where\n {% if config.get('dbt_valid_to_current') %}\n\t\t{% set source_unique_key = columns.dbt_valid_to | trim %}\n\t\t{% set target_unique_key = config.get('dbt_valid_to_current') | trim %}\n\n\t\t{# The exact equals semantics between NULL values depends on the current behavior flag set. Also, update records if the source field is null #}\n ( {{ equals(source_unique_key, target_unique_key) }} or {{ source_unique_key }} is null )\n {% else %}\n {{ columns.dbt_valid_to }} is null\n {% endif %}\n\n ),\n\n insertions_source_data as (\n\n select *, {{ unique_key_fields(strategy.unique_key) }},\n {{ strategy.updated_at }} as {{ columns.dbt_updated_at }},\n {{ strategy.updated_at }} as {{ columns.dbt_valid_from }},\n {{ get_dbt_valid_to_current(strategy, columns) }},\n {{ strategy.scd_id }} as {{ columns.dbt_scd_id }}\n\n from snapshot_query\n ),\n\n updates_source_data as (\n\n select *, {{ unique_key_fields(strategy.unique_key) }},\n {{ strategy.updated_at }} as {{ columns.dbt_updated_at }},\n {{ strategy.updated_at }} as {{ columns.dbt_valid_from }},\n {{ strategy.updated_at }} as {{ columns.dbt_valid_to }}\n\n from snapshot_query\n ),\n\n {%- if strategy.hard_deletes == 'invalidate' or strategy.hard_deletes == 'new_record' %}\n\n deletes_source_data as (\n\n select *, {{ unique_key_fields(strategy.unique_key) }}\n from snapshot_query\n ),\n {% endif %}\n\n insertions as (\n\n select\n 'insert' as dbt_change_type,\n source_data.*\n {%- if strategy.hard_deletes == 'new_record' -%}\n ,'False' as {{ columns.dbt_is_deleted }}\n {%- endif %}\n\n from insertions_source_data as source_data\n left outer join snapshotted_data\n on {{ unique_key_join_on(strategy.unique_key, \"snapshotted_data\", \"source_data\") }}\n where {{ unique_key_is_null(strategy.unique_key, \"snapshotted_data\") }}\n or ({{ unique_key_is_not_null(strategy.unique_key, \"snapshotted_data\") }} and (\n {{ strategy.row_changed }} {%- if strategy.hard_deletes == 'new_record' -%} or snapshotted_data.{{ columns.dbt_is_deleted }} = 'True' {% endif %}\n )\n\n )\n\n ),\n\n updates as (\n\n select\n 'update' as dbt_change_type,\n source_data.*,\n snapshotted_data.{{ columns.dbt_scd_id }}\n {%- if strategy.hard_deletes == 'new_record' -%}\n , snapshotted_data.{{ columns.dbt_is_deleted }}\n {%- endif %}\n\n from updates_source_data as source_data\n join snapshotted_data\n on {{ unique_key_join_on(strategy.unique_key, \"snapshotted_data\", \"source_data\") }}\n where (\n {{ strategy.row_changed }} {%- if strategy.hard_deletes == 'new_record' -%} or snapshotted_data.{{ columns.dbt_is_deleted }} = 'True' {% endif %}\n )\n )\n\n {%- if strategy.hard_deletes == 'invalidate' or strategy.hard_deletes == 'new_record' %}\n ,\n deletes as (\n\n select\n 'delete' as dbt_change_type,\n source_data.*,\n {{ snapshot_get_time() }} as {{ columns.dbt_valid_from }},\n {{ snapshot_get_time() }} as {{ columns.dbt_updated_at }},\n {{ snapshot_get_time() }} as {{ columns.dbt_valid_to }},\n snapshotted_data.{{ columns.dbt_scd_id }}\n {%- if strategy.hard_deletes == 'new_record' -%}\n , snapshotted_data.{{ columns.dbt_is_deleted }}\n {%- endif %}\n from snapshotted_data\n left join deletes_source_data as source_data\n on {{ unique_key_join_on(strategy.unique_key, \"snapshotted_data\", \"source_data\") }}\n where {{ unique_key_is_null(strategy.unique_key, \"source_data\") }}\n\n {%- if strategy.hard_deletes == 'new_record' %}\n and not (\n --avoid updating the record's valid_to if the latest entry is marked as deleted\n snapshotted_data.{{ columns.dbt_is_deleted }} = 'True'\n and\n {% if config.get('dbt_valid_to_current') -%}\n snapshotted_data.{{ columns.dbt_valid_to }} = {{ config.get('dbt_valid_to_current') }}\n {%- else -%}\n snapshotted_data.{{ columns.dbt_valid_to }} is null\n {%- endif %}\n )\n {%- endif %}\n )\n {%- endif %}\n\n {%- if strategy.hard_deletes == 'new_record' %}\n {% set snapshotted_cols = get_list_of_column_names(get_columns_in_relation(target_relation)) %}\n {% set source_col_names = get_columns_in_query(source_sql) %}\n ,\n deletion_records as (\n\n select\n 'insert' as dbt_change_type,\n {%- for col_name in source_col_names -%}\n {%- if col_name in snapshotted_cols -%}\n snapshotted_data.{{ adapter.quote(col_name) }},\n {%- else -%}\n source_data.{{ adapter.quote(col_name) }},\n {%- endif -%}\n {% endfor -%}\n {%- if strategy.unique_key | is_list -%}\n {%- for key in strategy.unique_key -%}\n snapshotted_data.{{ key }} as dbt_unique_key_{{ loop.index }},\n {% endfor -%}\n {%- else -%}\n snapshotted_data.dbt_unique_key as dbt_unique_key,\n {% endif -%}\n {{ snapshot_get_time() }} as {{ columns.dbt_valid_from }},\n {{ snapshot_get_time() }} as {{ columns.dbt_updated_at }},\n snapshotted_data.{{ columns.dbt_valid_to }} as {{ columns.dbt_valid_to }},\n {{ new_scd_id }} as {{ columns.dbt_scd_id }},\n 'True' as {{ columns.dbt_is_deleted }}\n from snapshotted_data\n left join deletes_source_data as source_data\n on {{ unique_key_join_on(strategy.unique_key, \"snapshotted_data\", \"source_data\") }}\n where {{ unique_key_is_null(strategy.unique_key, \"source_data\") }}\n and not (\n --avoid inserting a new record if the latest one is marked as deleted\n snapshotted_data.{{ columns.dbt_is_deleted }} = 'True'\n and\n {% if config.get('dbt_valid_to_current') -%}\n snapshotted_data.{{ columns.dbt_valid_to }} = {{ config.get('dbt_valid_to_current') }}\n {%- else -%}\n snapshotted_data.{{ columns.dbt_valid_to }} is null\n {%- endif %}\n )\n\n )\n {%- endif %}\n\n select * from insertions\n union all\n select * from updates\n {%- if strategy.hard_deletes == 'invalidate' or strategy.hard_deletes == 'new_record' %}\n union all\n select * from deletes\n {%- endif %}\n {%- if strategy.hard_deletes == 'new_record' %}\n union all\n select * from deletion_records\n {%- endif %}\n\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.get_snapshot_table_column_names", "macro.dbt.snapshot_hash_arguments", "macro.dbt.snapshot_get_time", "macro.dbt.unique_key_fields", "macro.dbt.equals", "macro.dbt.get_dbt_valid_to_current", "macro.dbt.unique_key_join_on", "macro.dbt.unique_key_is_null", "macro.dbt.unique_key_is_not_null", "macro.dbt.get_list_of_column_names", "macro.dbt.get_columns_in_relation", "macro.dbt.get_columns_in_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "strategy", "type": null, "description": ""}, {"name": "source_sql", "type": null, "description": ""}, {"name": "target_relation", "type": null, "description": ""}], "created_at": 1789503443.1387334, "supported_languages": null}, "macro.dbt.build_snapshot_table": {"name": "build_snapshot_table", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "unique_id": "macro.dbt.build_snapshot_table", "macro_sql": "{% macro build_snapshot_table(strategy, sql) -%}\n {{ adapter.dispatch('build_snapshot_table', 'dbt')(strategy, sql) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__build_snapshot_table"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "strategy", "type": null, "description": ""}, {"name": "sql", "type": null, "description": ""}], "created_at": 1789503443.1391816, "supported_languages": null}, "macro.dbt.default__build_snapshot_table": {"name": "default__build_snapshot_table", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "unique_id": "macro.dbt.default__build_snapshot_table", "macro_sql": "{% macro default__build_snapshot_table(strategy, sql) %}\n {% set columns = config.get('snapshot_table_column_names') or get_snapshot_table_column_names() %}\n\n select *,\n {{ strategy.scd_id }} as {{ columns.dbt_scd_id }},\n {{ strategy.updated_at }} as {{ columns.dbt_updated_at }},\n {{ strategy.updated_at }} as {{ columns.dbt_valid_from }},\n {{ get_dbt_valid_to_current(strategy, columns) }}\n {%- if strategy.hard_deletes == 'new_record' -%}\n , 'False' as {{ columns.dbt_is_deleted }}\n {% endif -%}\n from (\n {{ sql }}\n ) sbq\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_snapshot_table_column_names", "macro.dbt.get_dbt_valid_to_current"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "strategy", "type": null, "description": ""}, {"name": "sql", "type": null, "description": ""}], "created_at": 1789503443.1402411, "supported_languages": null}, "macro.dbt.build_snapshot_staging_table": {"name": "build_snapshot_staging_table", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "unique_id": "macro.dbt.build_snapshot_staging_table", "macro_sql": "{% macro build_snapshot_staging_table(strategy, sql, target_relation) %}\n {% set temp_relation = make_temp_relation(target_relation) %}\n\n {% set select = snapshot_staging_table(strategy, sql, target_relation) %}\n\n {% call statement('build_snapshot_staging_relation') %}\n {{ create_table_as(True, temp_relation, select) }}\n {% endcall %}\n\n {% do return(temp_relation) %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.make_temp_relation", "macro.dbt.snapshot_staging_table", "macro.dbt.statement", "macro.dbt.create_table_as"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "strategy", "type": null, "description": ""}, {"name": "sql", "type": null, "description": ""}, {"name": "target_relation", "type": null, "description": ""}], "created_at": 1789503443.1411088, "supported_languages": null}, "macro.dbt.get_updated_at_column_data_type": {"name": "get_updated_at_column_data_type", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "unique_id": "macro.dbt.get_updated_at_column_data_type", "macro_sql": "{% macro get_updated_at_column_data_type(snapshot_sql) %}\n {% set snapshot_sql_column_schema = get_column_schema_from_query(snapshot_sql) %}\n {% set dbt_updated_at_data_type = null %}\n {% set ns = namespace() -%} {#-- handle for-loop scoping with a namespace --#}\n {% set ns.dbt_updated_at_data_type = null -%}\n {% for column in snapshot_sql_column_schema %}\n {% if ((column.column == 'dbt_updated_at') or (column.column == 'DBT_UPDATED_AT')) %}\n {% set ns.dbt_updated_at_data_type = column.dtype %}\n {% endif %}\n {% endfor %}\n {{ return(ns.dbt_updated_at_data_type or none) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_column_schema_from_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "snapshot_sql", "type": null, "description": ""}], "created_at": 1789503443.1422935, "supported_languages": null}, "macro.dbt.check_time_data_types": {"name": "check_time_data_types", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "unique_id": "macro.dbt.check_time_data_types", "macro_sql": "{% macro check_time_data_types(sql) %}\n {% set dbt_updated_at_data_type = get_updated_at_column_data_type(sql) %}\n {% set snapshot_get_time_data_type = get_snapshot_get_time_data_type() %}\n {% if snapshot_get_time_data_type is not none and dbt_updated_at_data_type is not none and snapshot_get_time_data_type != dbt_updated_at_data_type %}\n {% if exceptions.warn_snapshot_timestamp_data_types %}\n {{ exceptions.warn_snapshot_timestamp_data_types(snapshot_get_time_data_type, dbt_updated_at_data_type) }}\n {% endif %}\n {% endif %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_updated_at_column_data_type", "macro.dbt.get_snapshot_get_time_data_type"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "sql", "type": null, "description": ""}], "created_at": 1789503443.1431637, "supported_languages": null}, "macro.dbt.get_dbt_valid_to_current": {"name": "get_dbt_valid_to_current", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "unique_id": "macro.dbt.get_dbt_valid_to_current", "macro_sql": "{% macro get_dbt_valid_to_current(strategy, columns) %}\n {% set dbt_valid_to_current = config.get('dbt_valid_to_current') or \"null\" %}\n coalesce(nullif({{ strategy.updated_at }}, {{ strategy.updated_at }}), {{dbt_valid_to_current}})\n as {{ columns.dbt_valid_to }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "strategy", "type": null, "description": ""}, {"name": "columns", "type": null, "description": ""}], "created_at": 1789503443.1437292, "supported_languages": null}, "macro.dbt.unique_key_fields": {"name": "unique_key_fields", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "unique_id": "macro.dbt.unique_key_fields", "macro_sql": "{% macro unique_key_fields(unique_key) %}\n {% if unique_key | is_list %}\n {% for key in unique_key %}\n {{ key }} as dbt_unique_key_{{ loop.index }}\n {%- if not loop.last %} , {%- endif %}\n {% endfor %}\n {% else %}\n {{ unique_key }} as dbt_unique_key\n {% endif %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "unique_key", "type": null, "description": ""}], "created_at": 1789503443.1444576, "supported_languages": null}, "macro.dbt.unique_key_join_on": {"name": "unique_key_join_on", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "unique_id": "macro.dbt.unique_key_join_on", "macro_sql": "{% macro unique_key_join_on(unique_key, identifier, from_identifier) %}\n {% if unique_key | is_list %}\n {% for key in unique_key %}\n\t {% set source_unique_key = (identifier ~ \".dbt_unique_key_\" ~ loop.index) | trim %}\n\t {% set target_unique_key = (from_identifier ~ \".dbt_unique_key_\" ~ loop.index) | trim %}\n\t {{ equals(source_unique_key, target_unique_key) }}\n {%- if not loop.last %} and {%- endif %}\n {% endfor %}\n {% else %}\n {{ identifier }}.dbt_unique_key = {{ from_identifier }}.dbt_unique_key\n {% endif %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.equals"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "unique_key", "type": null, "description": ""}, {"name": "identifier", "type": null, "description": ""}, {"name": "from_identifier", "type": null, "description": ""}], "created_at": 1789503443.1456153, "supported_languages": null}, "macro.dbt.unique_key_is_null": {"name": "unique_key_is_null", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "unique_id": "macro.dbt.unique_key_is_null", "macro_sql": "{% macro unique_key_is_null(unique_key, identifier) %}\n {% if unique_key | is_list %}\n {{ identifier }}.dbt_unique_key_1 is null\n {% else %}\n {{ identifier }}.dbt_unique_key is null\n {% endif %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "unique_key", "type": null, "description": ""}, {"name": "identifier", "type": null, "description": ""}], "created_at": 1789503443.1460705, "supported_languages": null}, "macro.dbt.unique_key_is_not_null": {"name": "unique_key_is_not_null", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "unique_id": "macro.dbt.unique_key_is_not_null", "macro_sql": "{% macro unique_key_is_not_null(unique_key, identifier) %}\n {% if unique_key | is_list %}\n {{ identifier }}.dbt_unique_key_1 is not null\n {% else %}\n {{ identifier }}.dbt_unique_key is not null\n {% endif %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "unique_key", "type": null, "description": ""}, {"name": "identifier", "type": null, "description": ""}], "created_at": 1789503443.146503, "supported_languages": null}, "macro.dbt.get_aggregate_function_create_replace_signature": {"name": "get_aggregate_function_create_replace_signature", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/functions/aggregate.sql", "original_file_path": "macros/materializations/functions/aggregate.sql", "unique_id": "macro.dbt.get_aggregate_function_create_replace_signature", "macro_sql": "{% macro get_aggregate_function_create_replace_signature(target_relation) %}\n {{ return(adapter.dispatch('get_aggregate_function_create_replace_signature', 'dbt')(target_relation)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_aggregate_function_create_replace_signature"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "target_relation", "type": null, "description": ""}], "created_at": 1789503443.1477613, "supported_languages": null}, "macro.dbt.default__get_aggregate_function_create_replace_signature": {"name": "default__get_aggregate_function_create_replace_signature", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/functions/aggregate.sql", "original_file_path": "macros/materializations/functions/aggregate.sql", "unique_id": "macro.dbt.default__get_aggregate_function_create_replace_signature", "macro_sql": "{% macro default__get_aggregate_function_create_replace_signature(target_relation) %}\n CREATE OR REPLACE AGGREGATE FUNCTION {{ target_relation.render() }} ({{ get_formatted_aggregate_function_args()}})\n RETURNS {{ model.returns.data_type }}\n {{ get_function_language_specifier() }}\n {{ get_aggregate_function_volatility_specifier() }}\n {% if model.get('language') == 'python' %}\n {{ get_function_python_options() }}\n {% endif %}\n AS\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_formatted_aggregate_function_args", "macro.dbt.get_function_language_specifier", "macro.dbt.get_aggregate_function_volatility_specifier", "macro.dbt.get_function_python_options"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "target_relation", "type": null, "description": ""}], "created_at": 1789503443.148508, "supported_languages": null}, "macro.dbt.get_formatted_aggregate_function_args": {"name": "get_formatted_aggregate_function_args", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/functions/aggregate.sql", "original_file_path": "macros/materializations/functions/aggregate.sql", "unique_id": "macro.dbt.get_formatted_aggregate_function_args", "macro_sql": "{% macro get_formatted_aggregate_function_args() %}\n {{ return(adapter.dispatch('get_formatted_aggregate_function_args', 'dbt')()) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_formatted_aggregate_function_args"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789503443.1488492, "supported_languages": null}, "macro.dbt.default__get_formatted_aggregate_function_args": {"name": "default__get_formatted_aggregate_function_args", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/functions/aggregate.sql", "original_file_path": "macros/materializations/functions/aggregate.sql", "unique_id": "macro.dbt.default__get_formatted_aggregate_function_args", "macro_sql": "{% macro default__get_formatted_aggregate_function_args() %}\n {# conveniently we can reuse the sql scalar function args #}\n {{ formatted_scalar_function_args_sql() }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.formatted_scalar_function_args_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789503443.1491148, "supported_languages": null}, "macro.dbt.get_function_language_specifier": {"name": "get_function_language_specifier", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/functions/aggregate.sql", "original_file_path": "macros/materializations/functions/aggregate.sql", "unique_id": "macro.dbt.get_function_language_specifier", "macro_sql": "{% macro get_function_language_specifier() %}\n {{ return(adapter.dispatch('get_function_language_specifier', 'dbt')()) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_function_language_specifier"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789503443.1494496, "supported_languages": null}, "macro.dbt.default__get_function_language_specifier": {"name": "default__get_function_language_specifier", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/functions/aggregate.sql", "original_file_path": "macros/materializations/functions/aggregate.sql", "unique_id": "macro.dbt.default__get_function_language_specifier", "macro_sql": "{% macro default__get_function_language_specifier() %}\n {% set language = model.get('language') %}\n {% if language == 'sql' %}\n {# generally you dont need to specify the language for sql functions #}\n {% elif language == 'python' %}\n LANGUAGE PYTHON\n {% elif language == 'javascript' %}\n LANGUAGE js\n {% else %}\n {{ 'LANGUAGE ' ~ language.upper() }}\n {% endif %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789503443.150626, "supported_languages": null}, "macro.dbt.get_aggregate_function_volatility_specifier": {"name": "get_aggregate_function_volatility_specifier", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/functions/aggregate.sql", "original_file_path": "macros/materializations/functions/aggregate.sql", "unique_id": "macro.dbt.get_aggregate_function_volatility_specifier", "macro_sql": "{% macro get_aggregate_function_volatility_specifier() %}\n {{ return(adapter.dispatch('get_aggregate_function_volatility_specifier', 'dbt')()) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_aggregate_function_volatility_specifier"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789503443.1509843, "supported_languages": null}, "macro.dbt.default__get_aggregate_function_volatility_specifier": {"name": "default__get_aggregate_function_volatility_specifier", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/functions/aggregate.sql", "original_file_path": "macros/materializations/functions/aggregate.sql", "unique_id": "macro.dbt.default__get_aggregate_function_volatility_specifier", "macro_sql": "{% macro default__get_aggregate_function_volatility_specifier() %}\n {{ scalar_function_volatility_sql() }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.scalar_function_volatility_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789503443.1512156, "supported_languages": null}, "macro.dbt.get_function_python_options": {"name": "get_function_python_options", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/functions/aggregate.sql", "original_file_path": "macros/materializations/functions/aggregate.sql", "unique_id": "macro.dbt.get_function_python_options", "macro_sql": "{% macro get_function_python_options() %}\n {{ return(adapter.dispatch('get_function_python_options', 'dbt')()) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_function_python_options"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789503443.1515546, "supported_languages": null}, "macro.dbt.default__get_function_python_options": {"name": "default__get_function_python_options", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/functions/aggregate.sql", "original_file_path": "macros/materializations/functions/aggregate.sql", "unique_id": "macro.dbt.default__get_function_python_options", "macro_sql": "{% macro default__get_function_python_options() %}\n RUNTIME_VERSION = '{{ model.config.get('runtime_version') }}'\n HANDLER = '{{ model.config.get('entry_point') }}'\n {% set packages = model.config.get('packages', []) %}\n {% if packages %}\n PACKAGES = ('{{ packages | join(\"','\") }}')\n {% endif %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789503443.1523144, "supported_languages": null}, "macro.dbt.scalar_function_sql": {"name": "scalar_function_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/functions/scalar.sql", "original_file_path": "macros/materializations/functions/scalar.sql", "unique_id": "macro.dbt.scalar_function_sql", "macro_sql": "{% macro scalar_function_sql(target_relation) %}\n {{ return(adapter.dispatch('scalar_function_sql', 'dbt')(target_relation)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__scalar_function_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "target_relation", "type": null, "description": ""}], "created_at": 1789503443.153873, "supported_languages": null}, "macro.dbt.default__scalar_function_sql": {"name": "default__scalar_function_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/functions/scalar.sql", "original_file_path": "macros/materializations/functions/scalar.sql", "unique_id": "macro.dbt.default__scalar_function_sql", "macro_sql": "{% macro default__scalar_function_sql(target_relation) %}\n {{ scalar_function_create_replace_signature_sql(target_relation) }}\n {{ scalar_function_body_sql() }};\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.scalar_function_create_replace_signature_sql", "macro.dbt.scalar_function_body_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "target_relation", "type": null, "description": ""}], "created_at": 1789503443.1542184, "supported_languages": null}, "macro.dbt.scalar_function_create_replace_signature_sql": {"name": "scalar_function_create_replace_signature_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/functions/scalar.sql", "original_file_path": "macros/materializations/functions/scalar.sql", "unique_id": "macro.dbt.scalar_function_create_replace_signature_sql", "macro_sql": "{% macro scalar_function_create_replace_signature_sql(target_relation) %}\n {{ return(adapter.dispatch('scalar_function_create_replace_signature_sql', 'dbt')(target_relation)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__scalar_function_create_replace_signature_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "target_relation", "type": null, "description": ""}], "created_at": 1789503443.154591, "supported_languages": null}, "macro.dbt.default__scalar_function_create_replace_signature_sql": {"name": "default__scalar_function_create_replace_signature_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/functions/scalar.sql", "original_file_path": "macros/materializations/functions/scalar.sql", "unique_id": "macro.dbt.default__scalar_function_create_replace_signature_sql", "macro_sql": "{% macro default__scalar_function_create_replace_signature_sql(target_relation) %}\n CREATE OR REPLACE FUNCTION {{ target_relation.render() }} ({{ formatted_scalar_function_args_sql()}})\n RETURNS {{ model.returns.data_type }}\n {{ scalar_function_volatility_sql() }}\n AS\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.formatted_scalar_function_args_sql", "macro.dbt.scalar_function_volatility_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "target_relation", "type": null, "description": ""}], "created_at": 1789503443.1550505, "supported_languages": null}, "macro.dbt.formatted_scalar_function_args_sql": {"name": "formatted_scalar_function_args_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/functions/scalar.sql", "original_file_path": "macros/materializations/functions/scalar.sql", "unique_id": "macro.dbt.formatted_scalar_function_args_sql", "macro_sql": "{% macro formatted_scalar_function_args_sql() %}\n {{ return(adapter.dispatch('formatted_scalar_function_args_sql', 'dbt')()) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__formatted_scalar_function_args_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789503443.155396, "supported_languages": null}, "macro.dbt.formatted_scalar_function_args_javascript": {"name": "formatted_scalar_function_args_javascript", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/functions/scalar.sql", "original_file_path": "macros/materializations/functions/scalar.sql", "unique_id": "macro.dbt.formatted_scalar_function_args_javascript", "macro_sql": "{% macro formatted_scalar_function_args_javascript() %}\n {{ return(adapter.dispatch('formatted_scalar_function_args_javascript', 'dbt')()) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__formatted_scalar_function_args_javascript"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789503443.1557314, "supported_languages": null}, "macro.dbt.default__formatted_scalar_function_args_sql": {"name": "default__formatted_scalar_function_args_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/functions/scalar.sql", "original_file_path": "macros/materializations/functions/scalar.sql", "unique_id": "macro.dbt.default__formatted_scalar_function_args_sql", "macro_sql": "{% macro default__formatted_scalar_function_args_sql() %}\n {% set args = [] %}\n {% for arg in model.arguments -%}\n {%- do args.append(arg.name ~ ' ' ~ arg.data_type) -%}\n {%- endfor %}\n {{ args | join(', ') }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789503443.156412, "supported_languages": null}, "macro.dbt.default__formatted_scalar_function_args_javascript": {"name": "default__formatted_scalar_function_args_javascript", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/functions/scalar.sql", "original_file_path": "macros/materializations/functions/scalar.sql", "unique_id": "macro.dbt.default__formatted_scalar_function_args_javascript", "macro_sql": "{% macro default__formatted_scalar_function_args_javascript() %}\n {% set msg = \"formatted_scalar_function_args_javascript not implemented for adapter \" ~ adapter.type() %}\n {% do exceptions.raise_compiler_error(msg) %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789503443.1568341, "supported_languages": null}, "macro.dbt.scalar_function_body_sql": {"name": "scalar_function_body_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/functions/scalar.sql", "original_file_path": "macros/materializations/functions/scalar.sql", "unique_id": "macro.dbt.scalar_function_body_sql", "macro_sql": "{% macro scalar_function_body_sql() %}\n {{ return(adapter.dispatch('scalar_function_body_sql', 'dbt')()) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__scalar_function_body_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789503443.1571996, "supported_languages": null}, "macro.dbt.default__scalar_function_body_sql": {"name": "default__scalar_function_body_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/functions/scalar.sql", "original_file_path": "macros/materializations/functions/scalar.sql", "unique_id": "macro.dbt.default__scalar_function_body_sql", "macro_sql": "{% macro default__scalar_function_body_sql() %}\n $$\n {{ model.compiled_code }}\n $$ LANGUAGE SQL\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789503443.1574228, "supported_languages": null}, "macro.dbt.scalar_function_volatility_sql": {"name": "scalar_function_volatility_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/functions/scalar.sql", "original_file_path": "macros/materializations/functions/scalar.sql", "unique_id": "macro.dbt.scalar_function_volatility_sql", "macro_sql": "{% macro scalar_function_volatility_sql() %}\n {{ return(adapter.dispatch('scalar_function_volatility_sql', 'dbt')()) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__scalar_function_volatility_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789503443.1577547, "supported_languages": null}, "macro.dbt.scalar_function_volatility_javascript": {"name": "scalar_function_volatility_javascript", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/functions/scalar.sql", "original_file_path": "macros/materializations/functions/scalar.sql", "unique_id": "macro.dbt.scalar_function_volatility_javascript", "macro_sql": "{% macro scalar_function_volatility_javascript() %}\n {{ return(adapter.dispatch('scalar_function_volatility_javascript', 'dbt')()) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__scalar_function_volatility_javascript"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789503443.1581237, "supported_languages": null}, "macro.dbt.default__scalar_function_volatility_javascript": {"name": "default__scalar_function_volatility_javascript", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/functions/scalar.sql", "original_file_path": "macros/materializations/functions/scalar.sql", "unique_id": "macro.dbt.default__scalar_function_volatility_javascript", "macro_sql": "{% macro default__scalar_function_volatility_javascript() %}\n {% set volatility = model.config.get('volatility') %}\n {% if volatility != none %}\n {% set msg = \"Volatility is not supported by \" ~ adapter.type() ~ \" in javascript UDF and will be ignored\" %}\n {% do exceptions.warn(msg) %}\n {% endif %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789503443.2170491, "supported_languages": null}, "macro.dbt.default__scalar_function_volatility_sql": {"name": "default__scalar_function_volatility_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/functions/scalar.sql", "original_file_path": "macros/materializations/functions/scalar.sql", "unique_id": "macro.dbt.default__scalar_function_volatility_sql", "macro_sql": "{% macro default__scalar_function_volatility_sql() %}\n {% set volatility = model.config.get('volatility') %}\n {% if volatility == 'deterministic' %}\n IMMUTABLE\n {% elif volatility == 'stable' %}\n STABLE\n {% elif volatility == 'non-deterministic' %}\n VOLATILE\n {% elif volatility != none %}\n {# This shouldn't happen unless a new volatility is invented #}\n {% do unsupported_volatility_warning(volatility) %}\n {% endif %}\n {# If no volatility is set, don't add anything and let the data warehouse default it #}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.unsupported_volatility_warning"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789503443.2179654, "supported_languages": null}, "macro.dbt.unsupported_volatility_warning": {"name": "unsupported_volatility_warning", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/functions/scalar.sql", "original_file_path": "macros/materializations/functions/scalar.sql", "unique_id": "macro.dbt.unsupported_volatility_warning", "macro_sql": "{% macro unsupported_volatility_warning(volatility) %}\n {{ return(adapter.dispatch('unsupported_volatility_warning', 'dbt')(volatility)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__unsupported_volatility_warning"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "volatility", "type": null, "description": ""}], "created_at": 1789503443.218397, "supported_languages": null}, "macro.dbt.default__unsupported_volatility_warning": {"name": "default__unsupported_volatility_warning", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/functions/scalar.sql", "original_file_path": "macros/materializations/functions/scalar.sql", "unique_id": "macro.dbt.default__unsupported_volatility_warning", "macro_sql": "{% macro default__unsupported_volatility_warning(volatility) %}\n {% set msg = \"Found `\" ~ volatility ~ \"` volatility specified on function `\" ~ model.name ~ \"`. This volatility is not supported by \" ~ adapter.type() ~ \", and will be ignored\" %}\n {% do exceptions.warn(msg) %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "volatility", "type": null, "description": ""}], "created_at": 1789503443.2189517, "supported_languages": null}, "macro.dbt.materialization_function_default": {"name": "materialization_function_default", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/functions/function.sql", "original_file_path": "macros/materializations/functions/function.sql", "unique_id": "macro.dbt.materialization_function_default", "macro_sql": "{% materialization function, default, supported_languages=['sql', 'python', 'javascript'] %}\n {% set existing_relation = load_cached_relation(this) %}\n {% set target_relation = this.incorporate(type=this.Function) %}\n\n {{ run_hooks(pre_hooks) }}\n\n {% set function_config = this.get_function_config(model) %}\n {% set macro_name = this.get_function_macro_name(function_config) %}\n\n {# Doing this aliasing of adapter.dispatch is a hacky way to disable the static analysis of actually calling adapter.dispatch #}\n {# This is necessary because the static analysis breaks being able to dynamically pass a macro_name #}\n {% set _dispatch = adapter.dispatch %}\n\n {% set build_sql = _dispatch(macro_name, 'dbt')(target_relation) %}\n {{ function_execute_build_sql(build_sql, existing_relation, target_relation) }}\n {{ run_hooks(post_hooks) }}\n\n {{ return({'relations': [target_relation]}) }}\n\n{% endmaterialization %}", "depends_on": {"macros": ["macro.dbt.load_cached_relation", "macro.dbt.run_hooks", "macro.dbt.function_execute_build_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "supported_languages", "type": null, "description": ""}], "created_at": 1789503443.2209125, "supported_languages": ["sql", "python", "javascript"]}, "macro.dbt.function_execute_build_sql": {"name": "function_execute_build_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/functions/helpers.sql", "original_file_path": "macros/materializations/functions/helpers.sql", "unique_id": "macro.dbt.function_execute_build_sql", "macro_sql": "{% macro function_execute_build_sql(build_sql, existing_relation, target_relation) %}\n {{ return(adapter.dispatch('function_execute_build_sql', 'dbt')(build_sql, existing_relation, target_relation)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__function_execute_build_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "build_sql", "type": null, "description": ""}, {"name": "existing_relation", "type": null, "description": ""}, {"name": "target_relation", "type": null, "description": ""}], "created_at": 1789503443.2216816, "supported_languages": null}, "macro.dbt.default__function_execute_build_sql": {"name": "default__function_execute_build_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/functions/helpers.sql", "original_file_path": "macros/materializations/functions/helpers.sql", "unique_id": "macro.dbt.default__function_execute_build_sql", "macro_sql": "{% macro default__function_execute_build_sql(build_sql, existing_relation, target_relation) %}\n\n {% set grant_config = config.get('grants') %}\n\n {% call statement(name=\"main\") %}\n {{ build_sql }}\n {% endcall %}\n\n {% set should_revoke = should_revoke(existing_relation, full_refresh_mode=True) %}\n {% do apply_grants(target_relation, grant_config, should_revoke=should_revoke) %}\n\n {% do persist_docs(target_relation, model) %}\n\n {{ adapter.commit() }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement", "macro.dbt.should_revoke", "macro.dbt.apply_grants", "macro.dbt.persist_docs"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "build_sql", "type": null, "description": ""}, {"name": "existing_relation", "type": null, "description": ""}, {"name": "target_relation", "type": null, "description": ""}], "created_at": 1789503443.2228024, "supported_languages": null}, "macro.dbt.materialization_table_default": {"name": "materialization_table_default", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/table.sql", "original_file_path": "macros/materializations/models/table.sql", "unique_id": "macro.dbt.materialization_table_default", "macro_sql": "{% materialization table, default %}\n\n {%- set existing_relation = load_cached_relation(this) -%}\n {%- set target_relation = this.incorporate(type='table') %}\n {%- set intermediate_relation = make_intermediate_relation(target_relation) -%}\n -- the intermediate_relation should not already exist in the database; get_relation\n -- will return None in that case. Otherwise, we get a relation that we can drop\n -- later, before we try to use this name for the current operation\n {%- set preexisting_intermediate_relation = load_cached_relation(intermediate_relation) -%}\n /*\n See ../view/view.sql for more information about this relation.\n */\n {%- set backup_relation_type = 'table' if existing_relation is none else existing_relation.type -%}\n {%- set backup_relation = make_backup_relation(target_relation, backup_relation_type) -%}\n -- as above, the backup_relation should not already exist\n {%- set preexisting_backup_relation = load_cached_relation(backup_relation) -%}\n -- grab current tables grants config for comparision later on\n {% set grant_config = config.get('grants') %}\n\n -- drop the temp relations if they exist already in the database\n {{ drop_relation_if_exists(preexisting_intermediate_relation) }}\n {{ drop_relation_if_exists(preexisting_backup_relation) }}\n\n {{ run_hooks(pre_hooks, inside_transaction=False) }}\n\n -- `BEGIN` happens here:\n {{ run_hooks(pre_hooks, inside_transaction=True) }}\n\n -- build model\n {% call statement('main') -%}\n {{ get_create_table_as_sql(False, intermediate_relation, sql) }}\n {%- endcall %}\n\n {% do create_indexes(intermediate_relation) %}\n\n -- cleanup\n {% if existing_relation is not none %}\n /* Do the equivalent of rename_if_exists. 'existing_relation' could have been dropped\n since the variable was first set. */\n {% set existing_relation = load_cached_relation(existing_relation) %}\n {% if existing_relation is not none %}\n {{ adapter.rename_relation(existing_relation, backup_relation) }}\n {% endif %}\n {% endif %}\n\n {{ adapter.rename_relation(intermediate_relation, target_relation) }}\n\n {{ run_hooks(post_hooks, inside_transaction=True) }}\n\n {% set should_revoke = should_revoke(existing_relation, full_refresh_mode=True) %}\n {% do apply_grants(target_relation, grant_config, should_revoke=should_revoke) %}\n\n {% do persist_docs(target_relation, model) %}\n\n -- `COMMIT` happens here\n {{ adapter.commit() }}\n\n -- finally, drop the existing/backup relation after the commit\n {{ drop_relation_if_exists(backup_relation) }}\n\n {{ run_hooks(post_hooks, inside_transaction=False) }}\n\n {{ return({'relations': [target_relation]}) }}\n{% endmaterialization %}", "depends_on": {"macros": ["macro.dbt.load_cached_relation", "macro.dbt.make_intermediate_relation", "macro.dbt.make_backup_relation", "macro.dbt.drop_relation_if_exists", "macro.dbt.run_hooks", "macro.dbt.statement", "macro.dbt.get_create_table_as_sql", "macro.dbt.create_indexes", "macro.dbt.should_revoke", "macro.dbt.apply_grants", "macro.dbt.persist_docs"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "supported_languages", "type": null, "description": ""}], "created_at": 1789503443.227175, "supported_languages": ["sql"]}, "macro.dbt.materialization_materialized_view_default": {"name": "materialization_materialized_view_default", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/materialized_view.sql", "original_file_path": "macros/materializations/models/materialized_view.sql", "unique_id": "macro.dbt.materialization_materialized_view_default", "macro_sql": "{% materialization materialized_view, default %}\n {% set existing_relation = load_cached_relation(this) %}\n {% set target_relation = this.incorporate(type=this.MaterializedView) %}\n {% set intermediate_relation = make_intermediate_relation(target_relation) %}\n {% set backup_relation_type = target_relation.MaterializedView if existing_relation is none else existing_relation.type %}\n {% set backup_relation = make_backup_relation(target_relation, backup_relation_type) %}\n\n {{ materialized_view_setup(backup_relation, intermediate_relation, pre_hooks) }}\n\n {% set build_sql = materialized_view_get_build_sql(existing_relation, target_relation, backup_relation, intermediate_relation) %}\n\n {% if build_sql == '' %}\n {{ materialized_view_execute_no_op(target_relation) }}\n {% else %}\n {{ materialized_view_execute_build_sql(build_sql, existing_relation, target_relation, post_hooks) }}\n {% endif %}\n\n {{ materialized_view_teardown(backup_relation, intermediate_relation, post_hooks) }}\n\n {{ return({'relations': [target_relation]}) }}\n\n{% endmaterialization %}", "depends_on": {"macros": ["macro.dbt.load_cached_relation", "macro.dbt.make_intermediate_relation", "macro.dbt.make_backup_relation", "macro.dbt.materialized_view_setup", "macro.dbt.materialized_view_get_build_sql", "macro.dbt.materialized_view_execute_no_op", "macro.dbt.materialized_view_execute_build_sql", "macro.dbt.materialized_view_teardown"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "supported_languages", "type": null, "description": ""}], "created_at": 1789503443.2303138, "supported_languages": ["sql"]}, "macro.dbt.materialized_view_setup": {"name": "materialized_view_setup", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/materialized_view.sql", "original_file_path": "macros/materializations/models/materialized_view.sql", "unique_id": "macro.dbt.materialized_view_setup", "macro_sql": "{% macro materialized_view_setup(backup_relation, intermediate_relation, pre_hooks) %}\n\n -- backup_relation and intermediate_relation should not already exist in the database\n -- it's possible these exist because of a previous run that exited unexpectedly\n {% set preexisting_backup_relation = load_cached_relation(backup_relation) %}\n {% set preexisting_intermediate_relation = load_cached_relation(intermediate_relation) %}\n\n -- drop the temp relations if they exist already in the database\n {{ drop_relation_if_exists(preexisting_backup_relation) }}\n {{ drop_relation_if_exists(preexisting_intermediate_relation) }}\n\n {{ run_hooks(pre_hooks, inside_transaction=False) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.load_cached_relation", "macro.dbt.drop_relation_if_exists", "macro.dbt.run_hooks"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "backup_relation", "type": null, "description": ""}, {"name": "intermediate_relation", "type": null, "description": ""}, {"name": "pre_hooks", "type": null, "description": ""}], "created_at": 1789503443.2311292, "supported_languages": null}, "macro.dbt.materialized_view_teardown": {"name": "materialized_view_teardown", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/materialized_view.sql", "original_file_path": "macros/materializations/models/materialized_view.sql", "unique_id": "macro.dbt.materialized_view_teardown", "macro_sql": "{% macro materialized_view_teardown(backup_relation, intermediate_relation, post_hooks) %}\n\n -- drop the temp relations if they exist to leave the database clean for the next run\n {{ drop_relation_if_exists(backup_relation) }}\n {{ drop_relation_if_exists(intermediate_relation) }}\n\n {{ run_hooks(post_hooks, inside_transaction=False) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.drop_relation_if_exists", "macro.dbt.run_hooks"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "backup_relation", "type": null, "description": ""}, {"name": "intermediate_relation", "type": null, "description": ""}, {"name": "post_hooks", "type": null, "description": ""}], "created_at": 1789503443.2316365, "supported_languages": null}, "macro.dbt.materialized_view_get_build_sql": {"name": "materialized_view_get_build_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/materialized_view.sql", "original_file_path": "macros/materializations/models/materialized_view.sql", "unique_id": "macro.dbt.materialized_view_get_build_sql", "macro_sql": "{% macro materialized_view_get_build_sql(existing_relation, target_relation, backup_relation, intermediate_relation) %}\n\n {% set full_refresh_mode = should_full_refresh() %}\n\n -- determine the scenario we're in: create, full_refresh, alter, refresh data\n {% if existing_relation is none %}\n {% set build_sql = get_create_materialized_view_as_sql(target_relation, sql) %}\n {% elif full_refresh_mode or not existing_relation.is_materialized_view %}\n {% set build_sql = get_replace_sql(existing_relation, target_relation, sql) %}\n {% else %}\n\n -- get config options\n {% set on_configuration_change = config.get('on_configuration_change') %}\n {% set configuration_changes = get_materialized_view_configuration_changes(existing_relation, config) %}\n\n {% if configuration_changes is none %}\n {% set build_sql = refresh_materialized_view(target_relation) %}\n\n {% elif on_configuration_change == 'apply' %}\n {% set build_sql = get_alter_materialized_view_as_sql(target_relation, configuration_changes, sql, existing_relation, backup_relation, intermediate_relation) %}\n {% elif on_configuration_change == 'continue' %}\n {% set build_sql = '' %}\n {{ exceptions.warn(\"Configuration changes were identified and `on_configuration_change` was set to `continue` for `\" ~ target_relation.render() ~ \"`\") }}\n {% elif on_configuration_change == 'fail' %}\n {{ exceptions.raise_fail_fast_error(\"Configuration changes were identified and `on_configuration_change` was set to `fail` for `\" ~ target_relation.render() ~ \"`\") }}\n\n {% else %}\n -- this only happens if the user provides a value other than `apply`, 'skip', 'fail'\n {{ exceptions.raise_compiler_error(\"Unexpected configuration scenario\") }}\n\n {% endif %}\n\n {% endif %}\n\n {% do return(build_sql) %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.should_full_refresh", "macro.dbt.get_create_materialized_view_as_sql", "macro.dbt.get_replace_sql", "macro.dbt.get_materialized_view_configuration_changes", "macro.dbt.refresh_materialized_view", "macro.dbt.get_alter_materialized_view_as_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "existing_relation", "type": null, "description": ""}, {"name": "target_relation", "type": null, "description": ""}, {"name": "backup_relation", "type": null, "description": ""}, {"name": "intermediate_relation", "type": null, "description": ""}], "created_at": 1789503443.2342732, "supported_languages": null}, "macro.dbt.materialized_view_execute_no_op": {"name": "materialized_view_execute_no_op", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/materialized_view.sql", "original_file_path": "macros/materializations/models/materialized_view.sql", "unique_id": "macro.dbt.materialized_view_execute_no_op", "macro_sql": "{% macro materialized_view_execute_no_op(target_relation) %}\n {% do store_raw_result(\n name=\"main\",\n message=\"skip \" ~ target_relation,\n code=\"skip\",\n rows_affected=\"-1\"\n ) %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "target_relation", "type": null, "description": ""}], "created_at": 1789503443.2347515, "supported_languages": null}, "macro.dbt.materialized_view_execute_build_sql": {"name": "materialized_view_execute_build_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/materialized_view.sql", "original_file_path": "macros/materializations/models/materialized_view.sql", "unique_id": "macro.dbt.materialized_view_execute_build_sql", "macro_sql": "{% macro materialized_view_execute_build_sql(build_sql, existing_relation, target_relation, post_hooks) %}\n\n -- `BEGIN` happens here:\n {{ run_hooks(pre_hooks, inside_transaction=True) }}\n\n {% set grant_config = config.get('grants') %}\n\n {% call statement(name=\"main\") %}\n {{ build_sql }}\n {% endcall %}\n\n {% set should_revoke = should_revoke(existing_relation, full_refresh_mode=True) %}\n {% do apply_grants(target_relation, grant_config, should_revoke=should_revoke) %}\n\n {% do persist_docs(target_relation, model) %}\n\n {{ run_hooks(post_hooks, inside_transaction=True) }}\n\n {{ adapter.commit() }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.run_hooks", "macro.dbt.statement", "macro.dbt.should_revoke", "macro.dbt.apply_grants", "macro.dbt.persist_docs"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "build_sql", "type": null, "description": ""}, {"name": "existing_relation", "type": null, "description": ""}, {"name": "target_relation", "type": null, "description": ""}, {"name": "post_hooks", "type": null, "description": ""}], "created_at": 1789503443.2361107, "supported_languages": null}, "macro.dbt.materialization_view_default": {"name": "materialization_view_default", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/view.sql", "original_file_path": "macros/materializations/models/view.sql", "unique_id": "macro.dbt.materialization_view_default", "macro_sql": "{%- materialization view, default -%}\n\n {%- set existing_relation = load_cached_relation(this) -%}\n {%- set target_relation = this.incorporate(type='view') -%}\n {%- set intermediate_relation = make_intermediate_relation(target_relation) -%}\n\n -- the intermediate_relation should not already exist in the database; get_relation\n -- will return None in that case. Otherwise, we get a relation that we can drop\n -- later, before we try to use this name for the current operation\n {%- set preexisting_intermediate_relation = load_cached_relation(intermediate_relation) -%}\n /*\n This relation (probably) doesn't exist yet. If it does exist, it's a leftover from\n a previous run, and we're going to try to drop it immediately. At the end of this\n materialization, we're going to rename the \"existing_relation\" to this identifier,\n and then we're going to drop it. In order to make sure we run the correct one of:\n - drop view ...\n - drop table ...\n\n We need to set the type of this relation to be the type of the existing_relation, if it exists,\n or else \"view\" as a sane default if it does not. Note that if the existing_relation does not\n exist, then there is nothing to move out of the way and subsequentally drop. In that case,\n this relation will be effectively unused.\n */\n {%- set backup_relation_type = 'view' if existing_relation is none else existing_relation.type -%}\n {%- set backup_relation = make_backup_relation(target_relation, backup_relation_type) -%}\n -- as above, the backup_relation should not already exist\n {%- set preexisting_backup_relation = load_cached_relation(backup_relation) -%}\n -- grab current tables grants config for comparision later on\n {% set grant_config = config.get('grants') %}\n\n {{ run_hooks(pre_hooks, inside_transaction=False) }}\n\n -- drop the temp relations if they exist already in the database\n {{ drop_relation_if_exists(preexisting_intermediate_relation) }}\n {{ drop_relation_if_exists(preexisting_backup_relation) }}\n\n -- `BEGIN` happens here:\n {{ run_hooks(pre_hooks, inside_transaction=True) }}\n\n -- build model\n {% call statement('main') -%}\n {{ get_create_view_as_sql(intermediate_relation, sql) }}\n {%- endcall %}\n\n -- cleanup\n -- move the existing view out of the way\n {% if existing_relation is not none %}\n /* Do the equivalent of rename_if_exists. 'existing_relation' could have been dropped\n since the variable was first set. */\n {% set existing_relation = load_cached_relation(existing_relation) %}\n {% if existing_relation is not none %}\n {{ adapter.rename_relation(existing_relation, backup_relation) }}\n {% endif %}\n {% endif %}\n {{ adapter.rename_relation(intermediate_relation, target_relation) }}\n\n {% set should_revoke = should_revoke(existing_relation, full_refresh_mode=True) %}\n {% do apply_grants(target_relation, grant_config, should_revoke=should_revoke) %}\n\n {% do persist_docs(target_relation, model) %}\n\n {{ run_hooks(post_hooks, inside_transaction=True) }}\n\n {{ adapter.commit() }}\n\n {{ drop_relation_if_exists(backup_relation) }}\n\n {{ run_hooks(post_hooks, inside_transaction=False) }}\n\n {{ return({'relations': [target_relation]}) }}\n\n{%- endmaterialization -%}", "depends_on": {"macros": ["macro.dbt.load_cached_relation", "macro.dbt.make_intermediate_relation", "macro.dbt.make_backup_relation", "macro.dbt.run_hooks", "macro.dbt.drop_relation_if_exists", "macro.dbt.statement", "macro.dbt.get_create_view_as_sql", "macro.dbt.should_revoke", "macro.dbt.apply_grants", "macro.dbt.persist_docs"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "supported_languages", "type": null, "description": ""}], "created_at": 1789503443.2403216, "supported_languages": ["sql"]}, "macro.dbt.materialization_clone_default": {"name": "materialization_clone_default", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/clone/clone.sql", "original_file_path": "macros/materializations/models/clone/clone.sql", "unique_id": "macro.dbt.materialization_clone_default", "macro_sql": "{%- materialization clone, default -%}\n\n {%- set relations = {'relations': []} -%}\n\n {%- if not defer_relation -%}\n -- nothing to do\n {{ log(\"No relation found in state manifest for \" ~ model.unique_id, info=True) }}\n {{ return(relations) }}\n {%- endif -%}\n\n {%- set existing_relation = load_cached_relation(this) -%}\n\n {%- if existing_relation and not flags.FULL_REFRESH -%}\n -- noop!\n {{ log(\"Relation \" ~ existing_relation ~ \" already exists\", info=True) }}\n {{ return(relations) }}\n {%- endif -%}\n\n {%- set other_existing_relation = load_cached_relation(defer_relation) -%}\n\n -- If this is a database that can do zero-copy cloning of tables, and the other relation is a table, then this will be a table\n -- Otherwise, this will be a view\n\n {% set can_clone_table = can_clone_table() %}\n {%- set grant_config = config.get('grants') -%}\n\n {%- if other_existing_relation and other_existing_relation.type == 'table' and can_clone_table -%}\n\n {%- set target_relation = this.incorporate(type='table') -%}\n {% if existing_relation is not none and not existing_relation.is_table %}\n {{ log(\"Dropping relation \" ~ existing_relation.render() ~ \" because it is of type \" ~ existing_relation.type) }}\n {{ drop_relation_if_exists(existing_relation) }}\n {% endif %}\n\n -- as a general rule, data platforms that can clone tables can also do atomic 'create or replace'\n {% if target_relation.database == defer_relation.database and\n target_relation.schema == defer_relation.schema and\n target_relation.identifier == defer_relation.identifier %}\n {{ log(\"Target relation and defer relation are the same, skipping clone for relation: \" ~ target_relation.render()) }}\n {% else %}\n {% call statement('main') %}\n {{ create_or_replace_clone(target_relation, defer_relation) }}\n {% endcall %}\n {% endif %}\n {% set should_revoke = should_revoke(existing_relation, full_refresh_mode=True) %}\n {% do apply_grants(target_relation, grant_config, should_revoke=should_revoke) %}\n {% do persist_docs(target_relation, model) %}\n\n {{ return({'relations': [target_relation]}) }}\n\n {%- else -%}\n\n {%- set target_relation = this.incorporate(type='view') -%}\n\n -- reuse the view materialization\n -- TODO: support actual dispatch for materialization macros\n -- Tracking ticket: https://github.com/dbt-labs/dbt-core/issues/7799\n {% set search_name = \"materialization_view_\" ~ adapter.type() %}\n {% if not search_name in context %}\n {% set search_name = \"materialization_view_default\" %}\n {% endif %}\n {% set materialization_macro = context[search_name] %}\n {% set relations = materialization_macro() %}\n {{ return(relations) }}\n\n {%- endif -%}\n\n{%- endmaterialization -%}", "depends_on": {"macros": ["macro.dbt.load_cached_relation", "macro.dbt.can_clone_table", "macro.dbt.drop_relation_if_exists", "macro.dbt.statement", "macro.dbt.create_or_replace_clone", "macro.dbt.should_revoke", "macro.dbt.apply_grants", "macro.dbt.persist_docs"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "supported_languages", "type": null, "description": ""}], "created_at": 1789503443.2456775, "supported_languages": ["sql"]}, "macro.dbt.can_clone_table": {"name": "can_clone_table", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/clone/can_clone_table.sql", "original_file_path": "macros/materializations/models/clone/can_clone_table.sql", "unique_id": "macro.dbt.can_clone_table", "macro_sql": "{% macro can_clone_table() %}\n {{ return(adapter.dispatch('can_clone_table', 'dbt')()) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__can_clone_table"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789503443.2462447, "supported_languages": null}, "macro.dbt.default__can_clone_table": {"name": "default__can_clone_table", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/clone/can_clone_table.sql", "original_file_path": "macros/materializations/models/clone/can_clone_table.sql", "unique_id": "macro.dbt.default__can_clone_table", "macro_sql": "{% macro default__can_clone_table() %}\n {{ return(False) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789503443.2465017, "supported_languages": null}, "macro.dbt.create_or_replace_clone": {"name": "create_or_replace_clone", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/clone/create_or_replace_clone.sql", "original_file_path": "macros/materializations/models/clone/create_or_replace_clone.sql", "unique_id": "macro.dbt.create_or_replace_clone", "macro_sql": "{% macro create_or_replace_clone(this_relation, defer_relation) %}\n {{ return(adapter.dispatch('create_or_replace_clone', 'dbt')(this_relation, defer_relation)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__create_or_replace_clone"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "this_relation", "type": null, "description": ""}, {"name": "defer_relation", "type": null, "description": ""}], "created_at": 1789503443.2470958, "supported_languages": null}, "macro.dbt.default__create_or_replace_clone": {"name": "default__create_or_replace_clone", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/clone/create_or_replace_clone.sql", "original_file_path": "macros/materializations/models/clone/create_or_replace_clone.sql", "unique_id": "macro.dbt.default__create_or_replace_clone", "macro_sql": "{% macro default__create_or_replace_clone(this_relation, defer_relation) %}\n create or replace table {{ this_relation.render() }} clone {{ defer_relation.render() }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "this_relation", "type": null, "description": ""}, {"name": "defer_relation", "type": null, "description": ""}], "created_at": 1789503443.2474513, "supported_languages": null}, "macro.dbt.materialization_incremental_default": {"name": "materialization_incremental_default", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/incremental.sql", "original_file_path": "macros/materializations/models/incremental/incremental.sql", "unique_id": "macro.dbt.materialization_incremental_default", "macro_sql": "{% materialization incremental, default -%}\n\n -- relations\n {%- set existing_relation = load_cached_relation(this) -%}\n {%- set target_relation = this.incorporate(type='table') -%}\n {%- set temp_relation = make_temp_relation(target_relation)-%}\n {%- set intermediate_relation = make_intermediate_relation(target_relation)-%}\n {%- set backup_relation_type = 'table' if existing_relation is none else existing_relation.type -%}\n {%- set backup_relation = make_backup_relation(target_relation, backup_relation_type) -%}\n\n -- configs\n {%- set unique_key = config.get('unique_key') -%}\n {%- set full_refresh_mode = (should_full_refresh() or existing_relation.is_view) -%}\n {%- set on_schema_change = incremental_validate_on_schema_change(config.get('on_schema_change'), default='ignore') -%}\n\n -- the temp_ and backup_ relations should not already exist in the database; get_relation\n -- will return None in that case. Otherwise, we get a relation that we can drop\n -- later, before we try to use this name for the current operation. This has to happen before\n -- BEGIN, in a separate transaction\n {%- set preexisting_intermediate_relation = load_cached_relation(intermediate_relation)-%}\n {%- set preexisting_backup_relation = load_cached_relation(backup_relation) -%}\n -- grab current tables grants config for comparision later on\n {% set grant_config = config.get('grants') %}\n {{ drop_relation_if_exists(preexisting_intermediate_relation) }}\n {{ drop_relation_if_exists(preexisting_backup_relation) }}\n\n {{ run_hooks(pre_hooks, inside_transaction=False) }}\n\n -- `BEGIN` happens here:\n {{ run_hooks(pre_hooks, inside_transaction=True) }}\n\n {% set to_drop = [] %}\n\n {% set incremental_strategy = config.get('incremental_strategy') or 'default' %}\n {% set strategy_sql_macro_func = adapter.get_incremental_strategy_macro(context, incremental_strategy) %}\n\n {% if existing_relation is none %}\n {% set build_sql = get_create_table_as_sql(False, target_relation, sql) %}\n {% set relation_for_indexes = target_relation %}\n {% elif full_refresh_mode %}\n {% set build_sql = get_create_table_as_sql(False, intermediate_relation, sql) %}\n {% set relation_for_indexes = intermediate_relation %}\n {% set need_swap = true %}\n {% else %}\n {% do run_query(get_create_table_as_sql(True, temp_relation, sql)) %}\n {% set relation_for_indexes = temp_relation %}\n {% set contract_config = config.get('contract') %}\n {% if not contract_config or not contract_config.enforced %}\n {% do adapter.expand_target_column_types(\n from_relation=temp_relation,\n to_relation=target_relation) %}\n {% endif %}\n {#-- Process schema changes. Returns dict of changes if successful. Use source columns for upserting/merging --#}\n {% set dest_columns = process_schema_changes(on_schema_change, temp_relation, existing_relation) %}\n {% if not dest_columns %}\n {% set dest_columns = adapter.get_columns_in_relation(existing_relation) %}\n {% endif %}\n\n {#-- Get the incremental_strategy, the macro to use for the strategy, and build the sql --#}\n {% set incremental_predicates = config.get('predicates', none) or config.get('incremental_predicates', none) %}\n {% set strategy_arg_dict = ({'target_relation': target_relation, 'temp_relation': temp_relation, 'unique_key': unique_key, 'dest_columns': dest_columns, 'incremental_predicates': incremental_predicates }) %}\n {% set build_sql = strategy_sql_macro_func(strategy_arg_dict) %}\n\n {% endif %}\n\n {% call statement(\"main\") %}\n {{ build_sql }}\n {% endcall %}\n\n {% if existing_relation is none or existing_relation.is_view or should_full_refresh() %}\n {% do create_indexes(relation_for_indexes) %}\n {% endif %}\n\n {% if need_swap %}\n {% do adapter.rename_relation(target_relation, backup_relation) %}\n {% do adapter.rename_relation(intermediate_relation, target_relation) %}\n {% do to_drop.append(backup_relation) %}\n {% endif %}\n\n {% set should_revoke = should_revoke(existing_relation, full_refresh_mode) %}\n {% do apply_grants(target_relation, grant_config, should_revoke=should_revoke) %}\n\n {% do persist_docs(target_relation, model) %}\n\n {{ run_hooks(post_hooks, inside_transaction=True) }}\n\n -- `COMMIT` happens here\n {% do adapter.commit() %}\n\n {% for rel in to_drop %}\n {% do adapter.drop_relation(rel) %}\n {% endfor %}\n\n {{ run_hooks(post_hooks, inside_transaction=False) }}\n\n {{ return({'relations': [target_relation]}) }}\n\n{%- endmaterialization %}", "depends_on": {"macros": ["macro.dbt.load_cached_relation", "macro.dbt.make_temp_relation", "macro.dbt.make_intermediate_relation", "macro.dbt.make_backup_relation", "macro.dbt.should_full_refresh", "macro.dbt.incremental_validate_on_schema_change", "macro.dbt.drop_relation_if_exists", "macro.dbt.run_hooks", "macro.dbt.get_create_table_as_sql", "macro.dbt.run_query", "macro.dbt.process_schema_changes", "macro.dbt.statement", "macro.dbt.create_indexes", "macro.dbt.should_revoke", "macro.dbt.apply_grants", "macro.dbt.persist_docs"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "supported_languages", "type": null, "description": ""}], "created_at": 1789503443.2560873, "supported_languages": ["sql"]}, "macro.dbt.get_quoted_csv": {"name": "get_quoted_csv", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/column_helpers.sql", "original_file_path": "macros/materializations/models/incremental/column_helpers.sql", "unique_id": "macro.dbt.get_quoted_csv", "macro_sql": "{% macro get_quoted_csv(column_names) %}\n\n {% set quoted = [] %}\n {% for col in column_names -%}\n {%- do quoted.append(adapter.quote(col)) -%}\n {%- endfor %}\n\n {%- set dest_cols_csv = quoted | join(', ') -%}\n {{ return(dest_cols_csv) }}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "column_names", "type": null, "description": ""}], "created_at": 1789503443.2578113, "supported_languages": null}, "macro.dbt.diff_columns": {"name": "diff_columns", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/column_helpers.sql", "original_file_path": "macros/materializations/models/incremental/column_helpers.sql", "unique_id": "macro.dbt.diff_columns", "macro_sql": "{% macro diff_columns(source_columns, target_columns) %}\n\n {% set result = [] %}\n {% set source_names = source_columns | map(attribute = 'column') | list %}\n {% set target_names = target_columns | map(attribute = 'column') | list %}\n\n {# --check whether the name attribute exists in the target - this does not perform a data type check #}\n {% for sc in source_columns %}\n {% if sc.name not in target_names %}\n {{ result.append(sc) }}\n {% endif %}\n {% endfor %}\n\n {{ return(result) }}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "source_columns", "type": null, "description": ""}, {"name": "target_columns", "type": null, "description": ""}], "created_at": 1789503443.2589433, "supported_languages": null}, "macro.dbt.diff_column_data_types": {"name": "diff_column_data_types", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/column_helpers.sql", "original_file_path": "macros/materializations/models/incremental/column_helpers.sql", "unique_id": "macro.dbt.diff_column_data_types", "macro_sql": "{% macro diff_column_data_types(source_columns, target_columns) %}\n {{ return(adapter.dispatch('diff_column_data_types', 'dbt')(source_columns, target_columns)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__diff_column_data_types"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "source_columns", "type": null, "description": ""}, {"name": "target_columns", "type": null, "description": ""}], "created_at": 1789503443.2594082, "supported_languages": null}, "macro.dbt.default__diff_column_data_types": {"name": "default__diff_column_data_types", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/column_helpers.sql", "original_file_path": "macros/materializations/models/incremental/column_helpers.sql", "unique_id": "macro.dbt.default__diff_column_data_types", "macro_sql": "{% macro default__diff_column_data_types(source_columns, target_columns) %}\n {% set result = [] %}\n {% for sc in source_columns %}\n {% set tc = target_columns | selectattr(\"name\", \"equalto\", sc.name) | list | first %}\n {% if tc %}\n {% if sc.expanded_data_type != tc.expanded_data_type and not sc.can_expand_to(other_column=tc) %}\n {{ result.append( { 'column_name': tc.name, 'new_type': sc.expanded_data_type } ) }}\n {% endif %}\n {% endif %}\n {% endfor %}\n\n {{ return(result) }}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "source_columns", "type": null, "description": ""}, {"name": "target_columns", "type": null, "description": ""}], "created_at": 1789503443.2607622, "supported_languages": null}, "macro.dbt.get_merge_update_columns": {"name": "get_merge_update_columns", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/column_helpers.sql", "original_file_path": "macros/materializations/models/incremental/column_helpers.sql", "unique_id": "macro.dbt.get_merge_update_columns", "macro_sql": "{% macro get_merge_update_columns(merge_update_columns, merge_exclude_columns, dest_columns) %}\n {{ return(adapter.dispatch('get_merge_update_columns', 'dbt')(merge_update_columns, merge_exclude_columns, dest_columns)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_merge_update_columns"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "merge_update_columns", "type": null, "description": ""}, {"name": "merge_exclude_columns", "type": null, "description": ""}, {"name": "dest_columns", "type": null, "description": ""}], "created_at": 1789503443.2612872, "supported_languages": null}, "macro.dbt.default__get_merge_update_columns": {"name": "default__get_merge_update_columns", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/column_helpers.sql", "original_file_path": "macros/materializations/models/incremental/column_helpers.sql", "unique_id": "macro.dbt.default__get_merge_update_columns", "macro_sql": "{% macro default__get_merge_update_columns(merge_update_columns, merge_exclude_columns, dest_columns) %}\n {%- set default_cols = dest_columns | map(attribute=\"quoted\") | list -%}\n\n {%- if merge_update_columns and merge_exclude_columns -%}\n {{ exceptions.raise_compiler_error(\n 'Model cannot specify merge_update_columns and merge_exclude_columns. Please update model to use only one config'\n )}}\n {%- elif merge_update_columns -%}\n {%- set update_columns = merge_update_columns -%}\n {%- elif merge_exclude_columns -%}\n {%- set update_columns = [] -%}\n {%- for column in dest_columns -%}\n {% if column.column | lower not in merge_exclude_columns | map(\"lower\") | list %}\n {%- do update_columns.append(column.quoted) -%}\n {% endif %}\n {%- endfor -%}\n {%- else -%}\n {%- set update_columns = default_cols -%}\n {%- endif -%}\n\n {{ return(update_columns) }}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "merge_update_columns", "type": null, "description": ""}, {"name": "merge_exclude_columns", "type": null, "description": ""}, {"name": "dest_columns", "type": null, "description": ""}], "created_at": 1789503443.2628775, "supported_languages": null}, "macro.dbt.get_incremental_append_sql": {"name": "get_incremental_append_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "unique_id": "macro.dbt.get_incremental_append_sql", "macro_sql": "{% macro get_incremental_append_sql(arg_dict) %}\n\n {{ return(adapter.dispatch('get_incremental_append_sql', 'dbt')(arg_dict)) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_incremental_append_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "arg_dict", "type": null, "description": ""}], "created_at": 1789503443.2642024, "supported_languages": null}, "macro.dbt.default__get_incremental_append_sql": {"name": "default__get_incremental_append_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "unique_id": "macro.dbt.default__get_incremental_append_sql", "macro_sql": "{% macro default__get_incremental_append_sql(arg_dict) %}\n\n {% do return(get_insert_into_sql(arg_dict[\"target_relation\"], arg_dict[\"temp_relation\"], arg_dict[\"dest_columns\"])) %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_insert_into_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "arg_dict", "type": null, "description": ""}], "created_at": 1789503443.2646873, "supported_languages": null}, "macro.dbt.get_incremental_delete_insert_sql": {"name": "get_incremental_delete_insert_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "unique_id": "macro.dbt.get_incremental_delete_insert_sql", "macro_sql": "{% macro get_incremental_delete_insert_sql(arg_dict) %}\n\n {{ return(adapter.dispatch('get_incremental_delete_insert_sql', 'dbt')(arg_dict)) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_incremental_delete_insert_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "arg_dict", "type": null, "description": ""}], "created_at": 1789503443.2650988, "supported_languages": null}, "macro.dbt.default__get_incremental_delete_insert_sql": {"name": "default__get_incremental_delete_insert_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "unique_id": "macro.dbt.default__get_incremental_delete_insert_sql", "macro_sql": "{% macro default__get_incremental_delete_insert_sql(arg_dict) %}\n\n {% do return(get_delete_insert_merge_sql(arg_dict[\"target_relation\"], arg_dict[\"temp_relation\"], arg_dict[\"unique_key\"], arg_dict[\"dest_columns\"], arg_dict[\"incremental_predicates\"])) %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_delete_insert_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "arg_dict", "type": null, "description": ""}], "created_at": 1789503443.2657087, "supported_languages": null}, "macro.dbt.get_incremental_merge_sql": {"name": "get_incremental_merge_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "unique_id": "macro.dbt.get_incremental_merge_sql", "macro_sql": "{% macro get_incremental_merge_sql(arg_dict) %}\n\n {{ return(adapter.dispatch('get_incremental_merge_sql', 'dbt')(arg_dict)) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_incremental_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "arg_dict", "type": null, "description": ""}], "created_at": 1789503443.2661188, "supported_languages": null}, "macro.dbt.default__get_incremental_merge_sql": {"name": "default__get_incremental_merge_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "unique_id": "macro.dbt.default__get_incremental_merge_sql", "macro_sql": "{% macro default__get_incremental_merge_sql(arg_dict) %}\n\n {% do return(get_merge_sql(arg_dict[\"target_relation\"], arg_dict[\"temp_relation\"], arg_dict[\"unique_key\"], arg_dict[\"dest_columns\"], arg_dict[\"incremental_predicates\"])) %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "arg_dict", "type": null, "description": ""}], "created_at": 1789503443.2667174, "supported_languages": null}, "macro.dbt.get_incremental_insert_overwrite_sql": {"name": "get_incremental_insert_overwrite_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "unique_id": "macro.dbt.get_incremental_insert_overwrite_sql", "macro_sql": "{% macro get_incremental_insert_overwrite_sql(arg_dict) %}\n\n {{ return(adapter.dispatch('get_incremental_insert_overwrite_sql', 'dbt')(arg_dict)) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_incremental_insert_overwrite_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "arg_dict", "type": null, "description": ""}], "created_at": 1789503443.2671235, "supported_languages": null}, "macro.dbt.default__get_incremental_insert_overwrite_sql": {"name": "default__get_incremental_insert_overwrite_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "unique_id": "macro.dbt.default__get_incremental_insert_overwrite_sql", "macro_sql": "{% macro default__get_incremental_insert_overwrite_sql(arg_dict) %}\n\n {% do return(get_insert_overwrite_merge_sql(arg_dict[\"target_relation\"], arg_dict[\"temp_relation\"], arg_dict[\"dest_columns\"], arg_dict[\"incremental_predicates\"])) %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_insert_overwrite_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "arg_dict", "type": null, "description": ""}], "created_at": 1789503443.2677863, "supported_languages": null}, "macro.dbt.get_incremental_default_sql": {"name": "get_incremental_default_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "unique_id": "macro.dbt.get_incremental_default_sql", "macro_sql": "{% macro get_incremental_default_sql(arg_dict) %}\n\n {{ return(adapter.dispatch('get_incremental_default_sql', 'dbt')(arg_dict)) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__get_incremental_default_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "arg_dict", "type": null, "description": ""}], "created_at": 1789503443.2681956, "supported_languages": null}, "macro.dbt.default__get_incremental_default_sql": {"name": "default__get_incremental_default_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "unique_id": "macro.dbt.default__get_incremental_default_sql", "macro_sql": "{% macro default__get_incremental_default_sql(arg_dict) %}\n\n {% do return(get_incremental_append_sql(arg_dict)) %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_incremental_append_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "arg_dict", "type": null, "description": ""}], "created_at": 1789503443.268511, "supported_languages": null}, "macro.dbt.get_incremental_microbatch_sql": {"name": "get_incremental_microbatch_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "unique_id": "macro.dbt.get_incremental_microbatch_sql", "macro_sql": "{% macro get_incremental_microbatch_sql(arg_dict) %}\n\n {{ return(adapter.dispatch('get_incremental_microbatch_sql', 'dbt')(arg_dict)) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__get_incremental_microbatch_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "arg_dict", "type": null, "description": ""}], "created_at": 1789503443.268888, "supported_languages": null}, "macro.dbt.default__get_incremental_microbatch_sql": {"name": "default__get_incremental_microbatch_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "unique_id": "macro.dbt.default__get_incremental_microbatch_sql", "macro_sql": "{% macro default__get_incremental_microbatch_sql(arg_dict) %}\n\n {{ exceptions.raise_not_implemented('microbatch materialization strategy not implemented for adapter ' + adapter.type()) }}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "arg_dict", "type": null, "description": ""}], "created_at": 1789503443.2692485, "supported_languages": null}, "macro.dbt.get_insert_into_sql": {"name": "get_insert_into_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "unique_id": "macro.dbt.get_insert_into_sql", "macro_sql": "{% macro get_insert_into_sql(target_relation, temp_relation, dest_columns) %}\n\n {%- set dest_cols_csv = get_quoted_csv(dest_columns | map(attribute=\"name\")) -%}\n\n insert into {{ target_relation }} ({{ dest_cols_csv }})\n (\n select {{ dest_cols_csv }}\n from {{ temp_relation }}\n )\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_quoted_csv"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "target_relation", "type": null, "description": ""}, {"name": "temp_relation", "type": null, "description": ""}, {"name": "dest_columns", "type": null, "description": ""}], "created_at": 1789503443.2698252, "supported_languages": null}, "macro.dbt.incremental_validate_on_schema_change": {"name": "incremental_validate_on_schema_change", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/on_schema_change.sql", "original_file_path": "macros/materializations/models/incremental/on_schema_change.sql", "unique_id": "macro.dbt.incremental_validate_on_schema_change", "macro_sql": "{% macro incremental_validate_on_schema_change(on_schema_change, default='ignore') %}\n\n {% if on_schema_change not in ['sync_all_columns', 'append_new_columns', 'fail', 'ignore'] %}\n\n {% set log_message = 'Invalid value for on_schema_change (%s) specified. Setting default value of %s.' % (on_schema_change, default) %}\n {% do log(log_message) %}\n\n {{ return(default) }}\n\n {% else %}\n\n {{ return(on_schema_change) }}\n\n {% endif %}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "on_schema_change", "type": null, "description": ""}, {"name": "default", "type": null, "description": ""}], "created_at": 1789503443.2724326, "supported_languages": null}, "macro.dbt.check_for_schema_changes": {"name": "check_for_schema_changes", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/on_schema_change.sql", "original_file_path": "macros/materializations/models/incremental/on_schema_change.sql", "unique_id": "macro.dbt.check_for_schema_changes", "macro_sql": "{% macro check_for_schema_changes(source_relation, target_relation) %}\n {{ return(adapter.dispatch('check_for_schema_changes', 'dbt')(source_relation, target_relation)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__check_for_schema_changes"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "source_relation", "type": null, "description": ""}, {"name": "target_relation", "type": null, "description": ""}], "created_at": 1789503443.2728646, "supported_languages": null}, "macro.dbt.default__check_for_schema_changes": {"name": "default__check_for_schema_changes", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/on_schema_change.sql", "original_file_path": "macros/materializations/models/incremental/on_schema_change.sql", "unique_id": "macro.dbt.default__check_for_schema_changes", "macro_sql": "{% macro default__check_for_schema_changes(source_relation, target_relation) %}\n\n {% set schema_changed = False %}\n\n {%- set source_columns = adapter.get_columns_in_relation(source_relation) -%}\n {%- set target_columns = adapter.get_columns_in_relation(target_relation) -%}\n {%- set source_not_in_target = diff_columns(source_columns, target_columns) -%}\n {%- set target_not_in_source = diff_columns(target_columns, source_columns) -%}\n\n {% set new_target_types = diff_column_data_types(source_columns, target_columns) %}\n\n {% if source_not_in_target != [] %}\n {% set schema_changed = True %}\n {% elif target_not_in_source != [] or new_target_types != [] %}\n {% set schema_changed = True %}\n {% elif new_target_types != [] %}\n {% set schema_changed = True %}\n {% endif %}\n\n {% set changes_dict = {\n 'schema_changed': schema_changed,\n 'source_not_in_target': source_not_in_target,\n 'target_not_in_source': target_not_in_source,\n 'source_columns': source_columns,\n 'target_columns': target_columns,\n 'new_target_types': new_target_types\n } %}\n\n {% set msg %}\n In {{ target_relation }}:\n Schema changed: {{ schema_changed }}\n Source columns not in target: {{ source_not_in_target }}\n Target columns not in source: {{ target_not_in_source }}\n New column types: {{ new_target_types }}\n {% endset %}\n\n {% do log(msg) %}\n\n {{ return(changes_dict) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.diff_columns", "macro.dbt.diff_column_data_types"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "source_relation", "type": null, "description": ""}, {"name": "target_relation", "type": null, "description": ""}], "created_at": 1789503443.2753227, "supported_languages": null}, "macro.dbt.sync_column_schemas": {"name": "sync_column_schemas", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/on_schema_change.sql", "original_file_path": "macros/materializations/models/incremental/on_schema_change.sql", "unique_id": "macro.dbt.sync_column_schemas", "macro_sql": "{% macro sync_column_schemas(on_schema_change, target_relation, schema_changes_dict) %}\n {{ return(adapter.dispatch('sync_column_schemas', 'dbt')(on_schema_change, target_relation, schema_changes_dict)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__sync_column_schemas"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "on_schema_change", "type": null, "description": ""}, {"name": "target_relation", "type": null, "description": ""}, {"name": "schema_changes_dict", "type": null, "description": ""}], "created_at": 1789503443.2758124, "supported_languages": null}, "macro.dbt.default__sync_column_schemas": {"name": "default__sync_column_schemas", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/on_schema_change.sql", "original_file_path": "macros/materializations/models/incremental/on_schema_change.sql", "unique_id": "macro.dbt.default__sync_column_schemas", "macro_sql": "{% macro default__sync_column_schemas(on_schema_change, target_relation, schema_changes_dict) %}\n\n {%- set add_to_target_arr = schema_changes_dict['source_not_in_target'] -%}\n {%- set remove_from_target_arr = schema_changes_dict['target_not_in_source'] -%}\n {%- set new_target_types = schema_changes_dict['new_target_types'] -%}\n\n {%- if on_schema_change == 'append_new_columns'-%}\n {%- if add_to_target_arr | length > 0 -%}\n {%- do alter_relation_add_remove_columns(target_relation, add_to_target_arr, none) -%}\n {%- endif -%}\n\n {% elif on_schema_change == 'sync_all_columns' %}\n\n {% if add_to_target_arr | length > 0 or remove_from_target_arr | length > 0 %}\n {%- do alter_relation_add_remove_columns(target_relation, add_to_target_arr, remove_from_target_arr) -%}\n {% endif %}\n\n {% if new_target_types != [] %}\n {% for ntt in new_target_types %}\n {% set column_name = ntt['column_name'] %}\n {% set new_type = ntt['new_type'] %}\n {% do alter_column_type(target_relation, column_name, new_type) %}\n {% endfor %}\n {% endif %}\n\n {% endif %}\n\n {% set schema_change_message %}\n In {{ target_relation }}:\n Schema change approach: {{ on_schema_change }}\n Columns added: {{ add_to_target_arr }}\n Columns removed: {{ remove_from_target_arr }}\n Data types changed: {{ new_target_types }}\n {% endset %}\n\n {% do log(schema_change_message) %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.alter_relation_add_remove_columns", "macro.dbt.alter_column_type"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "on_schema_change", "type": null, "description": ""}, {"name": "target_relation", "type": null, "description": ""}, {"name": "schema_changes_dict", "type": null, "description": ""}], "created_at": 1789503443.2782557, "supported_languages": null}, "macro.dbt.process_schema_changes": {"name": "process_schema_changes", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/on_schema_change.sql", "original_file_path": "macros/materializations/models/incremental/on_schema_change.sql", "unique_id": "macro.dbt.process_schema_changes", "macro_sql": "{% macro process_schema_changes(on_schema_change, source_relation, target_relation) %}\n {{ return(adapter.dispatch('process_schema_changes', 'dbt')(on_schema_change, source_relation, target_relation)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__process_schema_changes"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "on_schema_change", "type": null, "description": ""}, {"name": "source_relation", "type": null, "description": ""}, {"name": "target_relation", "type": null, "description": ""}], "created_at": 1789503443.2788646, "supported_languages": null}, "macro.dbt.default__process_schema_changes": {"name": "default__process_schema_changes", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/on_schema_change.sql", "original_file_path": "macros/materializations/models/incremental/on_schema_change.sql", "unique_id": "macro.dbt.default__process_schema_changes", "macro_sql": "{% macro default__process_schema_changes(on_schema_change, source_relation, target_relation) %}\n\n {% if on_schema_change == 'ignore' %}\n\n {{ return({}) }}\n\n {% else %}\n\n {% set schema_changes_dict = check_for_schema_changes(source_relation, target_relation) %}\n\n {% if schema_changes_dict['schema_changed'] %}\n\n {% if on_schema_change == 'fail' %}\n\n {% set fail_msg %}\n The source and target schemas on this incremental model are out of sync!\n They can be reconciled in several ways:\n - set the `on_schema_change` config to either append_new_columns or sync_all_columns, depending on your situation.\n - Re-run the incremental model with `full_refresh: True` to update the target schema.\n - update the schema manually and re-run the process.\n\n Additional troubleshooting context:\n Source columns not in target: {{ schema_changes_dict['source_not_in_target'] }}\n Target columns not in source: {{ schema_changes_dict['target_not_in_source'] }}\n New column types: {{ schema_changes_dict['new_target_types'] }}\n {% endset %}\n\n {% do exceptions.raise_compiler_error(fail_msg) %}\n\n {# -- unless we ignore, run the sync operation per the config #}\n {% else %}\n\n {% do sync_column_schemas(on_schema_change, target_relation, schema_changes_dict) %}\n\n {% endif %}\n\n {% endif %}\n\n {{ return(schema_changes_dict['source_columns']) }}\n\n {% endif %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.check_for_schema_changes", "macro.dbt.sync_column_schemas"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "on_schema_change", "type": null, "description": ""}, {"name": "source_relation", "type": null, "description": ""}, {"name": "target_relation", "type": null, "description": ""}], "created_at": 1789503443.2805765, "supported_languages": null}, "macro.dbt.get_merge_sql": {"name": "get_merge_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/merge.sql", "original_file_path": "macros/materializations/models/incremental/merge.sql", "unique_id": "macro.dbt.get_merge_sql", "macro_sql": "{% macro get_merge_sql(target, source, unique_key, dest_columns, incremental_predicates=none) -%}\n -- back compat for old kwarg name\n {% set incremental_predicates = kwargs.get('predicates', incremental_predicates) %}\n {{ adapter.dispatch('get_merge_sql', 'dbt')(target, source, unique_key, dest_columns, incremental_predicates) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "target", "type": null, "description": ""}, {"name": "source", "type": null, "description": ""}, {"name": "unique_key", "type": null, "description": ""}, {"name": "dest_columns", "type": null, "description": ""}, {"name": "incremental_predicates", "type": null, "description": ""}], "created_at": 1789503443.2827787, "supported_languages": null}, "macro.dbt.get_merge_unique_key_match": {"name": "get_merge_unique_key_match", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/merge.sql", "original_file_path": "macros/materializations/models/incremental/merge.sql", "unique_id": "macro.dbt.get_merge_unique_key_match", "macro_sql": "{% macro get_merge_unique_key_match(source_unique_key, target_unique_key) %}\n {{ return(adapter.dispatch('get_merge_unique_key_match', 'dbt')(source_unique_key, target_unique_key)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_merge_unique_key_match"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "source_unique_key", "type": null, "description": ""}, {"name": "target_unique_key", "type": null, "description": ""}], "created_at": 1789503443.2832465, "supported_languages": null}, "macro.dbt.default__get_merge_unique_key_match": {"name": "default__get_merge_unique_key_match", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/merge.sql", "original_file_path": "macros/materializations/models/incremental/merge.sql", "unique_id": "macro.dbt.default__get_merge_unique_key_match", "macro_sql": "{% macro default__get_merge_unique_key_match(source_unique_key, target_unique_key) -%}\n {{ return(equals(source_unique_key, target_unique_key) | trim) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.equals"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "source_unique_key", "type": null, "description": ""}, {"name": "target_unique_key", "type": null, "description": ""}], "created_at": 1789503443.2835991, "supported_languages": null}, "macro.dbt.default__get_merge_sql": {"name": "default__get_merge_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/merge.sql", "original_file_path": "macros/materializations/models/incremental/merge.sql", "unique_id": "macro.dbt.default__get_merge_sql", "macro_sql": "{% macro default__get_merge_sql(target, source, unique_key, dest_columns, incremental_predicates=none) -%}\n {%- set predicates = [] if incremental_predicates is none else [] + incremental_predicates -%}\n {%- set dest_cols_csv = get_quoted_csv(dest_columns | map(attribute=\"name\")) -%}\n {%- set merge_update_columns = config.get('merge_update_columns') -%}\n {%- set merge_exclude_columns = config.get('merge_exclude_columns') -%}\n {%- set update_columns = get_merge_update_columns(merge_update_columns, merge_exclude_columns, dest_columns) -%}\n {%- set sql_header = config.get('sql_header', none) -%}\n\n {% if unique_key %}\n {% if unique_key is sequence and unique_key is not mapping and unique_key is not string %}\n {% for key in unique_key %}\n {% set this_key_match %}\n DBT_INTERNAL_SOURCE.{{ key }} = DBT_INTERNAL_DEST.{{ key }}\n {% endset %}\n {% do predicates.append(this_key_match) %}\n {% endfor %}\n {% else %}\n {% set source_unique_key = (\"DBT_INTERNAL_SOURCE.\" ~ unique_key) | trim %}\n {% set target_unique_key = (\"DBT_INTERNAL_DEST.\" ~ unique_key) | trim %}\n {% set unique_key_match = get_merge_unique_key_match(source_unique_key, target_unique_key) %}\n {% do predicates.append(unique_key_match) %}\n {% endif %}\n {% else %}\n {% do predicates.append('FALSE') %}\n {% endif %}\n\n {{ sql_header if sql_header is not none }}\n\n merge into {{ target }} as DBT_INTERNAL_DEST\n using {{ source }} as DBT_INTERNAL_SOURCE\n on {{\"(\" ~ predicates | join(\") and (\") ~ \")\"}}\n\n {% if unique_key %}\n when matched then update set\n {% for column_name in update_columns -%}\n {{ column_name }} = DBT_INTERNAL_SOURCE.{{ column_name }}\n {%- if not loop.last %}, {%- endif %}\n {%- endfor %}\n {% endif %}\n\n when not matched then insert\n ({{ dest_cols_csv }})\n values\n ({{ dest_cols_csv }})\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_quoted_csv", "macro.dbt.get_merge_update_columns", "macro.dbt.get_merge_unique_key_match"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "target", "type": null, "description": ""}, {"name": "source", "type": null, "description": ""}, {"name": "unique_key", "type": null, "description": ""}, {"name": "dest_columns", "type": null, "description": ""}, {"name": "incremental_predicates", "type": null, "description": ""}], "created_at": 1789503443.2871728, "supported_languages": null}, "macro.dbt.get_delete_insert_merge_sql": {"name": "get_delete_insert_merge_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/merge.sql", "original_file_path": "macros/materializations/models/incremental/merge.sql", "unique_id": "macro.dbt.get_delete_insert_merge_sql", "macro_sql": "{% macro get_delete_insert_merge_sql(target, source, unique_key, dest_columns, incremental_predicates) -%}\n {{ adapter.dispatch('get_delete_insert_merge_sql', 'dbt')(target, source, unique_key, dest_columns, incremental_predicates) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_delete_insert_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "target", "type": null, "description": ""}, {"name": "source", "type": null, "description": ""}, {"name": "unique_key", "type": null, "description": ""}, {"name": "dest_columns", "type": null, "description": ""}, {"name": "incremental_predicates", "type": null, "description": ""}], "created_at": 1789503443.2877245, "supported_languages": null}, "macro.dbt.default__get_delete_insert_merge_sql": {"name": "default__get_delete_insert_merge_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/merge.sql", "original_file_path": "macros/materializations/models/incremental/merge.sql", "unique_id": "macro.dbt.default__get_delete_insert_merge_sql", "macro_sql": "{% macro default__get_delete_insert_merge_sql(target, source, unique_key, dest_columns, incremental_predicates) -%}\n\n {%- set dest_cols_csv = get_quoted_csv(dest_columns | map(attribute=\"name\")) -%}\n\n {% if unique_key %}\n {% if unique_key is string %}\n {% set unique_key = [unique_key] %}\n {% endif %}\n\n {%- set unique_key_str = unique_key|join(', ') -%}\n\n delete from {{ target }} as DBT_INTERNAL_DEST\n where ({{ unique_key_str }}) in (\n select distinct {{ unique_key_str }}\n from {{ source }} as DBT_INTERNAL_SOURCE\n )\n {%- if incremental_predicates %}\n {% for predicate in incremental_predicates %}\n and {{ predicate }}\n {% endfor %}\n {%- endif -%};\n\n {% endif %}\n\n insert into {{ target }} ({{ dest_cols_csv }})\n (\n select {{ dest_cols_csv }}\n from {{ source }}\n )\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.get_quoted_csv"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "target", "type": null, "description": ""}, {"name": "source", "type": null, "description": ""}, {"name": "unique_key", "type": null, "description": ""}, {"name": "dest_columns", "type": null, "description": ""}, {"name": "incremental_predicates", "type": null, "description": ""}], "created_at": 1789503443.2892435, "supported_languages": null}, "macro.dbt.get_insert_overwrite_merge_sql": {"name": "get_insert_overwrite_merge_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/merge.sql", "original_file_path": "macros/materializations/models/incremental/merge.sql", "unique_id": "macro.dbt.get_insert_overwrite_merge_sql", "macro_sql": "{% macro get_insert_overwrite_merge_sql(target, source, dest_columns, predicates, include_sql_header=false) -%}\n {{ adapter.dispatch('get_insert_overwrite_merge_sql', 'dbt')(target, source, dest_columns, predicates, include_sql_header) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_insert_overwrite_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "target", "type": null, "description": ""}, {"name": "source", "type": null, "description": ""}, {"name": "dest_columns", "type": null, "description": ""}, {"name": "predicates", "type": null, "description": ""}, {"name": "include_sql_header", "type": null, "description": ""}], "created_at": 1789503443.2897894, "supported_languages": null}, "macro.dbt.default__get_insert_overwrite_merge_sql": {"name": "default__get_insert_overwrite_merge_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/merge.sql", "original_file_path": "macros/materializations/models/incremental/merge.sql", "unique_id": "macro.dbt.default__get_insert_overwrite_merge_sql", "macro_sql": "{% macro default__get_insert_overwrite_merge_sql(target, source, dest_columns, predicates, include_sql_header) -%}\n {#-- The only time include_sql_header is True: --#}\n {#-- BigQuery + insert_overwrite strategy + \"static\" partitions config --#}\n {#-- We should consider including the sql header at the materialization level instead --#}\n\n {%- set predicates = [] if predicates is none else [] + predicates -%}\n {%- set dest_cols_csv = get_quoted_csv(dest_columns | map(attribute=\"name\")) -%}\n {%- set sql_header = config.get('sql_header', none) -%}\n\n {{ sql_header if sql_header is not none and include_sql_header }}\n\n merge into {{ target }} as DBT_INTERNAL_DEST\n using {{ source }} as DBT_INTERNAL_SOURCE\n on FALSE\n\n when not matched by source\n {% if predicates %} and {{ predicates | join(' and ') }} {% endif %}\n then delete\n\n when not matched then insert\n ({{ dest_cols_csv }})\n values\n ({{ dest_cols_csv }})\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_quoted_csv"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "target", "type": null, "description": ""}, {"name": "source", "type": null, "description": ""}, {"name": "dest_columns", "type": null, "description": ""}, {"name": "predicates", "type": null, "description": ""}, {"name": "include_sql_header", "type": null, "description": ""}], "created_at": 1789503443.2911434, "supported_languages": null}, "macro.dbt.is_incremental": {"name": "is_incremental", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/is_incremental.sql", "original_file_path": "macros/materializations/models/incremental/is_incremental.sql", "unique_id": "macro.dbt.is_incremental", "macro_sql": "{% macro is_incremental() %}\n {#-- do not run introspective queries in parsing #}\n {% if not execute %}\n {{ return(False) }}\n {% else %}\n {% set relation = adapter.get_relation(this.database, this.schema, this.table) %}\n {{ return(relation is not none\n and relation.type == 'table'\n and model.config.materialized == 'incremental'\n and not should_full_refresh()) }}\n {% endif %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.should_full_refresh"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789503443.2923372, "supported_languages": null}, "macro.dbt.date": {"name": "date", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/date.sql", "original_file_path": "macros/utils/date.sql", "unique_id": "macro.dbt.date", "macro_sql": "{% macro date(year, month, day) %}\n {{ return(adapter.dispatch('date', 'dbt') (year, month, day)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__date"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "year", "type": null, "description": ""}, {"name": "month", "type": null, "description": ""}, {"name": "day", "type": null, "description": ""}], "created_at": 1789503443.293005, "supported_languages": null}, "macro.dbt.default__date": {"name": "default__date", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/date.sql", "original_file_path": "macros/utils/date.sql", "unique_id": "macro.dbt.default__date", "macro_sql": "{% macro default__date(year, month, day) -%}\n {%- set dt = modules.datetime.date(year, month, day) -%}\n {%- set iso_8601_formatted_date = dt.strftime('%Y-%m-%d') -%}\n to_date('{{ iso_8601_formatted_date }}', 'YYYY-MM-DD')\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "year", "type": null, "description": ""}, {"name": "month", "type": null, "description": ""}, {"name": "day", "type": null, "description": ""}], "created_at": 1789503443.2936056, "supported_languages": null}, "macro.dbt.safe_cast": {"name": "safe_cast", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/safe_cast.sql", "original_file_path": "macros/utils/safe_cast.sql", "unique_id": "macro.dbt.safe_cast", "macro_sql": "{% macro safe_cast(field, type) %}\n {{ return(adapter.dispatch('safe_cast', 'dbt') (field, type)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__safe_cast"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field", "type": null, "description": ""}, {"name": "type", "type": null, "description": ""}], "created_at": 1789503443.2942133, "supported_languages": null}, "macro.dbt.default__safe_cast": {"name": "default__safe_cast", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/safe_cast.sql", "original_file_path": "macros/utils/safe_cast.sql", "unique_id": "macro.dbt.default__safe_cast", "macro_sql": "{% macro default__safe_cast(field, type) %}\n {# most databases don't support this function yet\n so we just need to use cast #}\n cast({{field}} as {{type}})\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field", "type": null, "description": ""}, {"name": "type", "type": null, "description": ""}], "created_at": 1789503443.294514, "supported_languages": null}, "macro.dbt.array_concat": {"name": "array_concat", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/array_concat.sql", "original_file_path": "macros/utils/array_concat.sql", "unique_id": "macro.dbt.array_concat", "macro_sql": "{% macro array_concat(array_1, array_2) -%}\n {{ return(adapter.dispatch('array_concat', 'dbt')(array_1, array_2)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__array_concat"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "array_1", "type": null, "description": ""}, {"name": "array_2", "type": null, "description": ""}], "created_at": 1789503443.2952094, "supported_languages": null}, "macro.dbt.default__array_concat": {"name": "default__array_concat", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/array_concat.sql", "original_file_path": "macros/utils/array_concat.sql", "unique_id": "macro.dbt.default__array_concat", "macro_sql": "{% macro default__array_concat(array_1, array_2) -%}\n array_cat({{ array_1 }}, {{ array_2 }})\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "array_1", "type": null, "description": ""}, {"name": "array_2", "type": null, "description": ""}], "created_at": 1789503443.2955027, "supported_languages": null}, "macro.dbt.escape_single_quotes": {"name": "escape_single_quotes", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/escape_single_quotes.sql", "original_file_path": "macros/utils/escape_single_quotes.sql", "unique_id": "macro.dbt.escape_single_quotes", "macro_sql": "{% macro escape_single_quotes(expression) %}\n {{ return(adapter.dispatch('escape_single_quotes', 'dbt') (expression)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__escape_single_quotes"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "expression", "type": null, "description": ""}], "created_at": 1789503443.2960596, "supported_languages": null}, "macro.dbt.default__escape_single_quotes": {"name": "default__escape_single_quotes", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/escape_single_quotes.sql", "original_file_path": "macros/utils/escape_single_quotes.sql", "unique_id": "macro.dbt.default__escape_single_quotes", "macro_sql": "{% macro default__escape_single_quotes(expression) -%}\n{{ expression | replace(\"'\",\"''\") }}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "expression", "type": null, "description": ""}], "created_at": 1789503443.2963648, "supported_languages": null}, "macro.dbt.type_string": {"name": "type_string", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "unique_id": "macro.dbt.type_string", "macro_sql": "\n\n{%- macro type_string() -%}\n {{ return(adapter.dispatch('type_string', 'dbt')()) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt.default__type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789503443.2976894, "supported_languages": null}, "macro.dbt.default__type_string": {"name": "default__type_string", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "unique_id": "macro.dbt.default__type_string", "macro_sql": "{% macro default__type_string() %}\n {{ return(api.Column.translate_type(\"string\")) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789503443.2980282, "supported_languages": null}, "macro.dbt.type_timestamp": {"name": "type_timestamp", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "unique_id": "macro.dbt.type_timestamp", "macro_sql": "\n\n{%- macro type_timestamp() -%}\n {{ return(adapter.dispatch('type_timestamp', 'dbt')()) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt.default__type_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789503443.2983685, "supported_languages": null}, "macro.dbt.default__type_timestamp": {"name": "default__type_timestamp", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "unique_id": "macro.dbt.default__type_timestamp", "macro_sql": "{% macro default__type_timestamp() %}\n {{ return(api.Column.translate_type(\"timestamp\")) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789503443.298685, "supported_languages": null}, "macro.dbt.type_float": {"name": "type_float", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "unique_id": "macro.dbt.type_float", "macro_sql": "\n\n{%- macro type_float() -%}\n {{ return(adapter.dispatch('type_float', 'dbt')()) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt.default__type_float"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789503443.2990413, "supported_languages": null}, "macro.dbt.default__type_float": {"name": "default__type_float", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "unique_id": "macro.dbt.default__type_float", "macro_sql": "{% macro default__type_float() %}\n {{ return(api.Column.translate_type(\"float\")) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789503443.2993548, "supported_languages": null}, "macro.dbt.type_numeric": {"name": "type_numeric", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "unique_id": "macro.dbt.type_numeric", "macro_sql": "\n\n{%- macro type_numeric() -%}\n {{ return(adapter.dispatch('type_numeric', 'dbt')()) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt.default__type_numeric"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789503443.2996829, "supported_languages": null}, "macro.dbt.default__type_numeric": {"name": "default__type_numeric", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "unique_id": "macro.dbt.default__type_numeric", "macro_sql": "{% macro default__type_numeric() %}\n {{ return(api.Column.numeric_type(\"numeric\", 28, 6)) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789503443.300074, "supported_languages": null}, "macro.dbt.type_bigint": {"name": "type_bigint", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "unique_id": "macro.dbt.type_bigint", "macro_sql": "\n\n{%- macro type_bigint() -%}\n {{ return(adapter.dispatch('type_bigint', 'dbt')()) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt.default__type_bigint"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789503443.300409, "supported_languages": null}, "macro.dbt.default__type_bigint": {"name": "default__type_bigint", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "unique_id": "macro.dbt.default__type_bigint", "macro_sql": "{% macro default__type_bigint() %}\n {{ return(api.Column.translate_type(\"bigint\")) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789503443.3007176, "supported_languages": null}, "macro.dbt.type_int": {"name": "type_int", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "unique_id": "macro.dbt.type_int", "macro_sql": "\n\n{%- macro type_int() -%}\n {{ return(adapter.dispatch('type_int', 'dbt')()) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt.default__type_int"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789503443.3010664, "supported_languages": null}, "macro.dbt.default__type_int": {"name": "default__type_int", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "unique_id": "macro.dbt.default__type_int", "macro_sql": "{%- macro default__type_int() -%}\n {{ return(api.Column.translate_type(\"integer\")) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789503443.3013682, "supported_languages": null}, "macro.dbt.type_boolean": {"name": "type_boolean", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "unique_id": "macro.dbt.type_boolean", "macro_sql": "\n\n{%- macro type_boolean() -%}\n {{ return(adapter.dispatch('type_boolean', 'dbt')()) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt.default__type_boolean"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789503443.3018105, "supported_languages": null}, "macro.dbt.default__type_boolean": {"name": "default__type_boolean", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "unique_id": "macro.dbt.default__type_boolean", "macro_sql": "{%- macro default__type_boolean() -%}\n {{ return(api.Column.translate_type(\"boolean\")) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789503443.3021495, "supported_languages": null}, "macro.dbt.array_append": {"name": "array_append", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/array_append.sql", "original_file_path": "macros/utils/array_append.sql", "unique_id": "macro.dbt.array_append", "macro_sql": "{% macro array_append(array, new_element) -%}\n {{ return(adapter.dispatch('array_append', 'dbt')(array, new_element)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__array_append"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "array", "type": null, "description": ""}, {"name": "new_element", "type": null, "description": ""}], "created_at": 1789503443.302722, "supported_languages": null}, "macro.dbt.default__array_append": {"name": "default__array_append", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/array_append.sql", "original_file_path": "macros/utils/array_append.sql", "unique_id": "macro.dbt.default__array_append", "macro_sql": "{% macro default__array_append(array, new_element) -%}\n array_append({{ array }}, {{ new_element }})\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "array", "type": null, "description": ""}, {"name": "new_element", "type": null, "description": ""}], "created_at": 1789503443.3030345, "supported_languages": null}, "macro.dbt.get_powers_of_two": {"name": "get_powers_of_two", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/generate_series.sql", "original_file_path": "macros/utils/generate_series.sql", "unique_id": "macro.dbt.get_powers_of_two", "macro_sql": "{% macro get_powers_of_two(upper_bound) %}\n {{ return(adapter.dispatch('get_powers_of_two', 'dbt')(upper_bound)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_powers_of_two"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "upper_bound", "type": null, "description": ""}], "created_at": 1789503443.3038776, "supported_languages": null}, "macro.dbt.default__get_powers_of_two": {"name": "default__get_powers_of_two", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/generate_series.sql", "original_file_path": "macros/utils/generate_series.sql", "unique_id": "macro.dbt.default__get_powers_of_two", "macro_sql": "{% macro default__get_powers_of_two(upper_bound) %}\n\n {% if upper_bound <= 0 %}\n {{ exceptions.raise_compiler_error(\"upper bound must be positive\") }}\n {% endif %}\n\n {% for _ in range(1, 100) %}\n {% if upper_bound <= 2 ** loop.index %}{{ return(loop.index) }}{% endif %}\n {% endfor %}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "upper_bound", "type": null, "description": ""}], "created_at": 1789503443.3047392, "supported_languages": null}, "macro.dbt.generate_series": {"name": "generate_series", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/generate_series.sql", "original_file_path": "macros/utils/generate_series.sql", "unique_id": "macro.dbt.generate_series", "macro_sql": "{% macro generate_series(upper_bound) %}\n {{ return(adapter.dispatch('generate_series', 'dbt')(upper_bound)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__generate_series"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "upper_bound", "type": null, "description": ""}], "created_at": 1789503443.3051503, "supported_languages": null}, "macro.dbt.default__generate_series": {"name": "default__generate_series", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/generate_series.sql", "original_file_path": "macros/utils/generate_series.sql", "unique_id": "macro.dbt.default__generate_series", "macro_sql": "{% macro default__generate_series(upper_bound) %}\n\n {% set n = dbt.get_powers_of_two(upper_bound) %}\n\n with p as (\n select 0 as generated_number union all select 1\n ), unioned as (\n\n select\n\n {% for i in range(n) %}\n p{{i}}.generated_number * power(2, {{i}})\n {% if not loop.last %} + {% endif %}\n {% endfor %}\n + 1\n as generated_number\n\n from\n\n {% for i in range(n) %}\n p as p{{i}}\n {% if not loop.last %} cross join {% endif %}\n {% endfor %}\n\n )\n\n select *\n from unioned\n where generated_number <= {{upper_bound}}\n order by generated_number\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_powers_of_two"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "upper_bound", "type": null, "description": ""}], "created_at": 1789503443.3062334, "supported_languages": null}, "macro.dbt.right": {"name": "right", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/right.sql", "original_file_path": "macros/utils/right.sql", "unique_id": "macro.dbt.right", "macro_sql": "{% macro right(string_text, length_expression) -%}\n {{ return(adapter.dispatch('right', 'dbt') (string_text, length_expression)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__right"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "string_text", "type": null, "description": ""}, {"name": "length_expression", "type": null, "description": ""}], "created_at": 1789503443.306816, "supported_languages": null}, "macro.dbt.default__right": {"name": "default__right", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/right.sql", "original_file_path": "macros/utils/right.sql", "unique_id": "macro.dbt.default__right", "macro_sql": "{% macro default__right(string_text, length_expression) %}\n\n right(\n {{ string_text }},\n {{ length_expression }}\n )\n\n{%- endmacro -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "string_text", "type": null, "description": ""}, {"name": "length_expression", "type": null, "description": ""}], "created_at": 1789503443.307131, "supported_languages": null}, "macro.dbt.hash": {"name": "hash", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/hash.sql", "original_file_path": "macros/utils/hash.sql", "unique_id": "macro.dbt.hash", "macro_sql": "{% macro hash(field) -%}\n {{ return(adapter.dispatch('hash', 'dbt') (field)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__hash"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field", "type": null, "description": ""}], "created_at": 1789503443.3076484, "supported_languages": null}, "macro.dbt.default__hash": {"name": "default__hash", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/hash.sql", "original_file_path": "macros/utils/hash.sql", "unique_id": "macro.dbt.default__hash", "macro_sql": "{% macro default__hash(field) -%}\n md5(cast({{ field }} as {{ api.Column.translate_type('string') }}))\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field", "type": null, "description": ""}], "created_at": 1789503443.3080094, "supported_languages": null}, "macro.dbt.intersect": {"name": "intersect", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/intersect.sql", "original_file_path": "macros/utils/intersect.sql", "unique_id": "macro.dbt.intersect", "macro_sql": "{% macro intersect() %}\n {{ return(adapter.dispatch('intersect', 'dbt')()) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__intersect"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789503443.3084686, "supported_languages": null}, "macro.dbt.default__intersect": {"name": "default__intersect", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/intersect.sql", "original_file_path": "macros/utils/intersect.sql", "unique_id": "macro.dbt.default__intersect", "macro_sql": "{% macro default__intersect() %}\n\n intersect\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789503443.3086352, "supported_languages": null}, "macro.dbt.last_day": {"name": "last_day", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/last_day.sql", "original_file_path": "macros/utils/last_day.sql", "unique_id": "macro.dbt.last_day", "macro_sql": "{% macro last_day(date, datepart) %}\n {{ return(adapter.dispatch('last_day', 'dbt') (date, datepart)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__last_day"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "date", "type": null, "description": ""}, {"name": "datepart", "type": null, "description": ""}], "created_at": 1789503443.309264, "supported_languages": null}, "macro.dbt.default_last_day": {"name": "default_last_day", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/last_day.sql", "original_file_path": "macros/utils/last_day.sql", "unique_id": "macro.dbt.default_last_day", "macro_sql": "\n\n{%- macro default_last_day(date, datepart) -%}\n cast(\n {{dbt.dateadd('day', '-1',\n dbt.dateadd(datepart, '1', dbt.date_trunc(datepart, date))\n )}}\n as date)\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt.dateadd", "macro.dbt.date_trunc"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "date", "type": null, "description": ""}, {"name": "datepart", "type": null, "description": ""}], "created_at": 1789503443.3097997, "supported_languages": null}, "macro.dbt.default__last_day": {"name": "default__last_day", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/last_day.sql", "original_file_path": "macros/utils/last_day.sql", "unique_id": "macro.dbt.default__last_day", "macro_sql": "{% macro default__last_day(date, datepart) -%}\n {{dbt.default_last_day(date, datepart)}}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default_last_day"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "date", "type": null, "description": ""}, {"name": "datepart", "type": null, "description": ""}], "created_at": 1789503443.310247, "supported_languages": null}, "macro.dbt.listagg": {"name": "listagg", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/listagg.sql", "original_file_path": "macros/utils/listagg.sql", "unique_id": "macro.dbt.listagg", "macro_sql": "{% macro listagg(measure, delimiter_text=\"','\", order_by_clause=none, limit_num=none) -%}\n {{ return(adapter.dispatch('listagg', 'dbt') (measure, delimiter_text, order_by_clause, limit_num)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__listagg"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "measure", "type": null, "description": ""}, {"name": "delimiter_text", "type": null, "description": ""}, {"name": "order_by_clause", "type": null, "description": ""}, {"name": "limit_num", "type": null, "description": ""}], "created_at": 1789503443.3111415, "supported_languages": null}, "macro.dbt.default__listagg": {"name": "default__listagg", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/listagg.sql", "original_file_path": "macros/utils/listagg.sql", "unique_id": "macro.dbt.default__listagg", "macro_sql": "{% macro default__listagg(measure, delimiter_text, order_by_clause, limit_num) -%}\n\n {% if limit_num -%}\n array_to_string(\n array_slice(\n array_agg(\n {{ measure }}\n ){% if order_by_clause -%}\n within group ({{ order_by_clause }})\n {%- endif %}\n ,0\n ,{{ limit_num }}\n ),\n {{ delimiter_text }}\n )\n {%- else %}\n listagg(\n {{ measure }},\n {{ delimiter_text }}\n )\n {% if order_by_clause -%}\n within group ({{ order_by_clause }})\n {%- endif %}\n {%- endif %}\n\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "measure", "type": null, "description": ""}, {"name": "delimiter_text", "type": null, "description": ""}, {"name": "order_by_clause", "type": null, "description": ""}, {"name": "limit_num", "type": null, "description": ""}], "created_at": 1789503443.3119974, "supported_languages": null}, "macro.dbt.cast_bool_to_text": {"name": "cast_bool_to_text", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/cast_bool_to_text.sql", "original_file_path": "macros/utils/cast_bool_to_text.sql", "unique_id": "macro.dbt.cast_bool_to_text", "macro_sql": "{% macro cast_bool_to_text(field) %}\n {{ adapter.dispatch('cast_bool_to_text', 'dbt') (field) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__cast_bool_to_text"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field", "type": null, "description": ""}], "created_at": 1789503443.3124888, "supported_languages": null}, "macro.dbt.default__cast_bool_to_text": {"name": "default__cast_bool_to_text", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/cast_bool_to_text.sql", "original_file_path": "macros/utils/cast_bool_to_text.sql", "unique_id": "macro.dbt.default__cast_bool_to_text", "macro_sql": "{% macro default__cast_bool_to_text(field) %}\n cast({{ field }} as {{ api.Column.translate_type('string') }})\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field", "type": null, "description": ""}], "created_at": 1789503443.3128233, "supported_languages": null}, "macro.dbt.date_trunc": {"name": "date_trunc", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/date_trunc.sql", "original_file_path": "macros/utils/date_trunc.sql", "unique_id": "macro.dbt.date_trunc", "macro_sql": "{% macro date_trunc(datepart, date) -%}\n {{ return(adapter.dispatch('date_trunc', 'dbt') (datepart, date)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__date_trunc"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "datepart", "type": null, "description": ""}, {"name": "date", "type": null, "description": ""}], "created_at": 1789503443.3133876, "supported_languages": null}, "macro.dbt.default__date_trunc": {"name": "default__date_trunc", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/date_trunc.sql", "original_file_path": "macros/utils/date_trunc.sql", "unique_id": "macro.dbt.default__date_trunc", "macro_sql": "{% macro default__date_trunc(datepart, date) -%}\n date_trunc('{{datepart}}', {{date}})\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "datepart", "type": null, "description": ""}, {"name": "date", "type": null, "description": ""}], "created_at": 1789503443.313662, "supported_languages": null}, "macro.dbt.position": {"name": "position", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/position.sql", "original_file_path": "macros/utils/position.sql", "unique_id": "macro.dbt.position", "macro_sql": "{% macro position(substring_text, string_text) -%}\n {{ return(adapter.dispatch('position', 'dbt') (substring_text, string_text)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__position"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "substring_text", "type": null, "description": ""}, {"name": "string_text", "type": null, "description": ""}], "created_at": 1789503443.3142352, "supported_languages": null}, "macro.dbt.default__position": {"name": "default__position", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/position.sql", "original_file_path": "macros/utils/position.sql", "unique_id": "macro.dbt.default__position", "macro_sql": "{% macro default__position(substring_text, string_text) %}\n\n position(\n {{ substring_text }} in {{ string_text }}\n )\n\n{%- endmacro -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "substring_text", "type": null, "description": ""}, {"name": "string_text", "type": null, "description": ""}], "created_at": 1789503443.314521, "supported_languages": null}, "macro.dbt.any_value": {"name": "any_value", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/any_value.sql", "original_file_path": "macros/utils/any_value.sql", "unique_id": "macro.dbt.any_value", "macro_sql": "{% macro any_value(expression) -%}\n {{ return(adapter.dispatch('any_value', 'dbt') (expression)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__any_value"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "expression", "type": null, "description": ""}], "created_at": 1789503443.3150184, "supported_languages": null}, "macro.dbt.default__any_value": {"name": "default__any_value", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/any_value.sql", "original_file_path": "macros/utils/any_value.sql", "unique_id": "macro.dbt.default__any_value", "macro_sql": "{% macro default__any_value(expression) -%}\n\n any_value({{ expression }})\n\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "expression", "type": null, "description": ""}], "created_at": 1789503443.3152475, "supported_languages": null}, "macro.dbt.length": {"name": "length", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/length.sql", "original_file_path": "macros/utils/length.sql", "unique_id": "macro.dbt.length", "macro_sql": "{% macro length(expression) -%}\n {{ return(adapter.dispatch('length', 'dbt') (expression)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__length"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "expression", "type": null, "description": ""}], "created_at": 1789503443.3157382, "supported_languages": null}, "macro.dbt.default__length": {"name": "default__length", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/length.sql", "original_file_path": "macros/utils/length.sql", "unique_id": "macro.dbt.default__length", "macro_sql": "{% macro default__length(expression) %}\n\n length(\n {{ expression }}\n )\n\n{%- endmacro -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "expression", "type": null, "description": ""}], "created_at": 1789503443.315965, "supported_languages": null}, "macro.dbt.cast": {"name": "cast", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/cast.sql", "original_file_path": "macros/utils/cast.sql", "unique_id": "macro.dbt.cast", "macro_sql": "{% macro cast(field, type) %}\n {{ return(adapter.dispatch('cast', 'dbt') (field, type)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__cast"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field", "type": null, "description": ""}, {"name": "type", "type": null, "description": ""}], "created_at": 1789503443.3165386, "supported_languages": null}, "macro.dbt.default__cast": {"name": "default__cast", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/cast.sql", "original_file_path": "macros/utils/cast.sql", "unique_id": "macro.dbt.default__cast", "macro_sql": "{% macro default__cast(field, type) %}\n cast({{field}} as {{type}})\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field", "type": null, "description": ""}, {"name": "type", "type": null, "description": ""}], "created_at": 1789503443.316823, "supported_languages": null}, "macro.dbt.get_intervals_between": {"name": "get_intervals_between", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/date_spine.sql", "original_file_path": "macros/utils/date_spine.sql", "unique_id": "macro.dbt.get_intervals_between", "macro_sql": "{% macro get_intervals_between(start_date, end_date, datepart) -%}\n {{ return(adapter.dispatch('get_intervals_between', 'dbt')(start_date, end_date, datepart)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_intervals_between"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "start_date", "type": null, "description": ""}, {"name": "end_date", "type": null, "description": ""}, {"name": "datepart", "type": null, "description": ""}], "created_at": 1789503443.317887, "supported_languages": null}, "macro.dbt.default__get_intervals_between": {"name": "default__get_intervals_between", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/date_spine.sql", "original_file_path": "macros/utils/date_spine.sql", "unique_id": "macro.dbt.default__get_intervals_between", "macro_sql": "{% macro default__get_intervals_between(start_date, end_date, datepart) -%}\n {%- call statement('get_intervals_between', fetch_result=True) %}\n\n select {{ dbt.datediff(start_date, end_date, datepart) }}\n\n {%- endcall -%}\n\n {%- set value_list = load_result('get_intervals_between') -%}\n\n {%- if value_list and value_list['data'] -%}\n {%- set values = value_list['data'] | map(attribute=0) | list %}\n {{ return(values[0]) }}\n {%- else -%}\n {{ return(1) }}\n {%- endif -%}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.statement", "macro.dbt.datediff"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "start_date", "type": null, "description": ""}, {"name": "end_date", "type": null, "description": ""}, {"name": "datepart", "type": null, "description": ""}], "created_at": 1789503443.3191438, "supported_languages": null}, "macro.dbt.date_spine": {"name": "date_spine", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/date_spine.sql", "original_file_path": "macros/utils/date_spine.sql", "unique_id": "macro.dbt.date_spine", "macro_sql": "{% macro date_spine(datepart, start_date, end_date) %}\n {{ return(adapter.dispatch('date_spine', 'dbt')(datepart, start_date, end_date)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__date_spine"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "datepart", "type": null, "description": ""}, {"name": "start_date", "type": null, "description": ""}, {"name": "end_date", "type": null, "description": ""}], "created_at": 1789503443.319618, "supported_languages": null}, "macro.dbt.default__date_spine": {"name": "default__date_spine", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/date_spine.sql", "original_file_path": "macros/utils/date_spine.sql", "unique_id": "macro.dbt.default__date_spine", "macro_sql": "{% macro default__date_spine(datepart, start_date, end_date) %}\n\n\n {# call as follows:\n\n date_spine(\n \"day\",\n \"to_date('01/01/2016', 'mm/dd/yyyy')\",\n \"dbt.dateadd(week, 1, current_date)\"\n ) #}\n\n\n with rawdata as (\n\n {{dbt.generate_series(\n dbt.get_intervals_between(start_date, end_date, datepart)\n )}}\n\n ),\n\n all_periods as (\n\n select (\n {{\n dbt.dateadd(\n datepart,\n \"row_number() over (order by 1) - 1\",\n start_date\n )\n }}\n ) as date_{{datepart}}\n from rawdata\n\n ),\n\n filtered as (\n\n select *\n from all_periods\n where date_{{datepart}} <= {{ end_date }}\n\n )\n\n select * from filtered\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.generate_series", "macro.dbt.get_intervals_between", "macro.dbt.dateadd"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "datepart", "type": null, "description": ""}, {"name": "start_date", "type": null, "description": ""}, {"name": "end_date", "type": null, "description": ""}], "created_at": 1789503443.3203738, "supported_languages": null}, "macro.dbt.datediff": {"name": "datediff", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/datediff.sql", "original_file_path": "macros/utils/datediff.sql", "unique_id": "macro.dbt.datediff", "macro_sql": "{% macro datediff(first_date, second_date, datepart) %}\n {{ return(adapter.dispatch('datediff', 'dbt')(first_date, second_date, datepart)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__datediff"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "first_date", "type": null, "description": ""}, {"name": "second_date", "type": null, "description": ""}, {"name": "datepart", "type": null, "description": ""}], "created_at": 1789503443.321013, "supported_languages": null}, "macro.dbt.default__datediff": {"name": "default__datediff", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/datediff.sql", "original_file_path": "macros/utils/datediff.sql", "unique_id": "macro.dbt.default__datediff", "macro_sql": "{% macro default__datediff(first_date, second_date, datepart) -%}\n\n datediff(\n {{ datepart }},\n {{ first_date }},\n {{ second_date }}\n )\n\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "first_date", "type": null, "description": ""}, {"name": "second_date", "type": null, "description": ""}, {"name": "datepart", "type": null, "description": ""}], "created_at": 1789503443.3213706, "supported_languages": null}, "macro.dbt.equals": {"name": "equals", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/equals.sql", "original_file_path": "macros/utils/equals.sql", "unique_id": "macro.dbt.equals", "macro_sql": "{% macro equals(expr1, expr2) %}\n {{ return(adapter.dispatch('equals', 'dbt') (expr1, expr2)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__equals"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "expr1", "type": null, "description": ""}, {"name": "expr2", "type": null, "description": ""}], "created_at": 1789503443.3220127, "supported_languages": null}, "macro.dbt.default__equals": {"name": "default__equals", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/equals.sql", "original_file_path": "macros/utils/equals.sql", "unique_id": "macro.dbt.default__equals", "macro_sql": "{% macro default__equals(expr1, expr2) -%}\n{%- if adapter.behavior.enable_truthy_nulls_equals_macro.no_warn %}\n case when (({{ expr1 }} = {{ expr2 }}) or ({{ expr1 }} is null and {{ expr2 }} is null))\n then 0\n else 1\n end = 0\n{%- else -%}\n ({{ expr1 }} = {{ expr2 }})\n{%- endif %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "expr1", "type": null, "description": ""}, {"name": "expr2", "type": null, "description": ""}], "created_at": 1789503443.3226311, "supported_languages": null}, "macro.dbt.dateadd": {"name": "dateadd", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/dateadd.sql", "original_file_path": "macros/utils/dateadd.sql", "unique_id": "macro.dbt.dateadd", "macro_sql": "{% macro dateadd(datepart, interval, from_date_or_timestamp) %}\n {{ return(adapter.dispatch('dateadd', 'dbt')(datepart, interval, from_date_or_timestamp)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__dateadd"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "datepart", "type": null, "description": ""}, {"name": "interval", "type": null, "description": ""}, {"name": "from_date_or_timestamp", "type": null, "description": ""}], "created_at": 1789503443.3232818, "supported_languages": null}, "macro.dbt.default__dateadd": {"name": "default__dateadd", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/dateadd.sql", "original_file_path": "macros/utils/dateadd.sql", "unique_id": "macro.dbt.default__dateadd", "macro_sql": "{% macro default__dateadd(datepart, interval, from_date_or_timestamp) %}\n\n dateadd(\n {{ datepart }},\n {{ interval }},\n {{ from_date_or_timestamp }}\n )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "datepart", "type": null, "description": ""}, {"name": "interval", "type": null, "description": ""}, {"name": "from_date_or_timestamp", "type": null, "description": ""}], "created_at": 1789503443.3236454, "supported_languages": null}, "macro.dbt.concat": {"name": "concat", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/concat.sql", "original_file_path": "macros/utils/concat.sql", "unique_id": "macro.dbt.concat", "macro_sql": "{% macro concat(fields) -%}\n {{ return(adapter.dispatch('concat', 'dbt')(fields)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__concat"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "fields", "type": null, "description": ""}], "created_at": 1789503443.3241618, "supported_languages": null}, "macro.dbt.default__concat": {"name": "default__concat", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/concat.sql", "original_file_path": "macros/utils/concat.sql", "unique_id": "macro.dbt.default__concat", "macro_sql": "{% macro default__concat(fields) -%}\n {{ fields|join(' || ') }}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "fields", "type": null, "description": ""}], "created_at": 1789503443.3244293, "supported_languages": null}, "macro.dbt.array_construct": {"name": "array_construct", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/array_construct.sql", "original_file_path": "macros/utils/array_construct.sql", "unique_id": "macro.dbt.array_construct", "macro_sql": "{% macro array_construct(inputs=[], data_type=api.Column.translate_type('integer')) -%}\n {{ return(adapter.dispatch('array_construct', 'dbt')(inputs, data_type)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__array_construct"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "inputs", "type": null, "description": ""}, {"name": "data_type", "type": null, "description": ""}], "created_at": 1789503443.3251913, "supported_languages": null}, "macro.dbt.default__array_construct": {"name": "default__array_construct", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/array_construct.sql", "original_file_path": "macros/utils/array_construct.sql", "unique_id": "macro.dbt.default__array_construct", "macro_sql": "{% macro default__array_construct(inputs, data_type) -%}\n {% if inputs|length > 0 %}\n array[ {{ inputs|join(' , ') }} ]\n {% else %}\n array[]::{{data_type}}[]\n {% endif %}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "inputs", "type": null, "description": ""}, {"name": "data_type", "type": null, "description": ""}], "created_at": 1789503443.325695, "supported_languages": null}, "macro.dbt.split_part": {"name": "split_part", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/split_part.sql", "original_file_path": "macros/utils/split_part.sql", "unique_id": "macro.dbt.split_part", "macro_sql": "{% macro split_part(string_text, delimiter_text, part_number) %}\n {{ return(adapter.dispatch('split_part', 'dbt') (string_text, delimiter_text, part_number)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__split_part"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "string_text", "type": null, "description": ""}, {"name": "delimiter_text", "type": null, "description": ""}, {"name": "part_number", "type": null, "description": ""}], "created_at": 1789503443.3264759, "supported_languages": null}, "macro.dbt.default__split_part": {"name": "default__split_part", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/split_part.sql", "original_file_path": "macros/utils/split_part.sql", "unique_id": "macro.dbt.default__split_part", "macro_sql": "{% macro default__split_part(string_text, delimiter_text, part_number) %}\n\n split_part(\n {{ string_text }},\n {{ delimiter_text }},\n {{ part_number }}\n )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "string_text", "type": null, "description": ""}, {"name": "delimiter_text", "type": null, "description": ""}, {"name": "part_number", "type": null, "description": ""}], "created_at": 1789503443.3269424, "supported_languages": null}, "macro.dbt._split_part_negative": {"name": "_split_part_negative", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/split_part.sql", "original_file_path": "macros/utils/split_part.sql", "unique_id": "macro.dbt._split_part_negative", "macro_sql": "{% macro _split_part_negative(string_text, delimiter_text, part_number) %}\n\n split_part(\n {{ string_text }},\n {{ delimiter_text }},\n length({{ string_text }})\n - length(\n replace({{ string_text }}, {{ delimiter_text }}, '')\n ) + 2 + {{ part_number }}\n )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "string_text", "type": null, "description": ""}, {"name": "delimiter_text", "type": null, "description": ""}, {"name": "part_number", "type": null, "description": ""}], "created_at": 1789503443.327436, "supported_languages": null}, "macro.dbt.bool_or": {"name": "bool_or", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/bool_or.sql", "original_file_path": "macros/utils/bool_or.sql", "unique_id": "macro.dbt.bool_or", "macro_sql": "{% macro bool_or(expression) -%}\n {{ return(adapter.dispatch('bool_or', 'dbt') (expression)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__bool_or"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "expression", "type": null, "description": ""}], "created_at": 1789503443.3279316, "supported_languages": null}, "macro.dbt.default__bool_or": {"name": "default__bool_or", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/bool_or.sql", "original_file_path": "macros/utils/bool_or.sql", "unique_id": "macro.dbt.default__bool_or", "macro_sql": "{% macro default__bool_or(expression) -%}\n\n bool_or({{ expression }})\n\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "expression", "type": null, "description": ""}], "created_at": 1789503443.3281794, "supported_languages": null}, "macro.dbt.replace": {"name": "replace", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/replace.sql", "original_file_path": "macros/utils/replace.sql", "unique_id": "macro.dbt.replace", "macro_sql": "{% macro replace(field, old_chars, new_chars) -%}\n {{ return(adapter.dispatch('replace', 'dbt') (field, old_chars, new_chars)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__replace"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field", "type": null, "description": ""}, {"name": "old_chars", "type": null, "description": ""}, {"name": "new_chars", "type": null, "description": ""}], "created_at": 1789503443.3287935, "supported_languages": null}, "macro.dbt.default__replace": {"name": "default__replace", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/replace.sql", "original_file_path": "macros/utils/replace.sql", "unique_id": "macro.dbt.default__replace", "macro_sql": "{% macro default__replace(field, old_chars, new_chars) %}\n\n replace(\n {{ field }},\n {{ old_chars }},\n {{ new_chars }}\n )\n\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field", "type": null, "description": ""}, {"name": "old_chars", "type": null, "description": ""}, {"name": "new_chars", "type": null, "description": ""}], "created_at": 1789503443.329166, "supported_languages": null}, "macro.dbt.string_literal": {"name": "string_literal", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/literal.sql", "original_file_path": "macros/utils/literal.sql", "unique_id": "macro.dbt.string_literal", "macro_sql": "{%- macro string_literal(value) -%}\n {{ return(adapter.dispatch('string_literal', 'dbt') (value)) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt.default__string_literal"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "value", "type": null, "description": ""}], "created_at": 1789503443.3296561, "supported_languages": null}, "macro.dbt.default__string_literal": {"name": "default__string_literal", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/literal.sql", "original_file_path": "macros/utils/literal.sql", "unique_id": "macro.dbt.default__string_literal", "macro_sql": "{% macro default__string_literal(value) -%}\n '{{ value }}'\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "value", "type": null, "description": ""}], "created_at": 1789503443.32988, "supported_languages": null}, "macro.dbt.except": {"name": "except", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/except.sql", "original_file_path": "macros/utils/except.sql", "unique_id": "macro.dbt.except", "macro_sql": "{% macro except() %}\n {{ return(adapter.dispatch('except', 'dbt')()) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__except"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789503443.3303566, "supported_languages": null}, "macro.dbt.default__except": {"name": "default__except", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/except.sql", "original_file_path": "macros/utils/except.sql", "unique_id": "macro.dbt.default__except", "macro_sql": "{% macro default__except() %}\n\n except\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789503443.3305233, "supported_languages": null}, "macro.dbt.statement": {"name": "statement", "resource_type": "macro", "package_name": "dbt", "path": "macros/etc/statement.sql", "original_file_path": "macros/etc/statement.sql", "unique_id": "macro.dbt.statement", "macro_sql": "\n{%- macro statement(name=None, fetch_result=False, auto_begin=True, language='sql') -%}\n {%- if execute: -%}\n {%- set compiled_code = caller() -%}\n\n {%- if name == 'main' -%}\n {{ log('Writing runtime {} for node \"{}\"'.format(language, model['unique_id'])) }}\n {{ write(compiled_code) }}\n {%- endif -%}\n {%- if language == 'sql'-%}\n {%- set res, table = adapter.execute(compiled_code, auto_begin=auto_begin, fetch=fetch_result) -%}\n {%- elif language == 'python' -%}\n {%- set res = submit_python_job(model, compiled_code) -%}\n {#-- TODO: What should table be for python models? --#}\n {%- set table = None -%}\n {%- else -%}\n {% do exceptions.raise_compiler_error(\"statement macro didn't get supported language\") %}\n {%- endif -%}\n\n {%- if name is not none -%}\n {{ store_result(name, response=res, agate_table=table) }}\n {%- endif -%}\n\n {%- endif -%}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "name", "type": null, "description": ""}, {"name": "fetch_result", "type": null, "description": ""}, {"name": "auto_begin", "type": null, "description": ""}, {"name": "language", "type": null, "description": ""}], "created_at": 1789503443.3331356, "supported_languages": null}, "macro.dbt.noop_statement": {"name": "noop_statement", "resource_type": "macro", "package_name": "dbt", "path": "macros/etc/statement.sql", "original_file_path": "macros/etc/statement.sql", "unique_id": "macro.dbt.noop_statement", "macro_sql": "{% macro noop_statement(name=None, message=None, code=None, rows_affected=None, res=None) -%}\n {%- set sql = caller() -%}\n\n {%- if name == 'main' -%}\n {{ log('Writing runtime SQL for node \"{}\"'.format(model['unique_id'])) }}\n {{ write(sql) }}\n {%- endif -%}\n\n {%- if name is not none -%}\n {{ store_raw_result(name, message=message, code=code, rows_affected=rows_affected, agate_table=res) }}\n {%- endif -%}\n\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "name", "type": null, "description": ""}, {"name": "message", "type": null, "description": ""}, {"name": "code", "type": null, "description": ""}, {"name": "rows_affected", "type": null, "description": ""}, {"name": "res", "type": null, "description": ""}], "created_at": 1789503443.334474, "supported_languages": null}, "macro.dbt.run_query": {"name": "run_query", "resource_type": "macro", "package_name": "dbt", "path": "macros/etc/statement.sql", "original_file_path": "macros/etc/statement.sql", "unique_id": "macro.dbt.run_query", "macro_sql": "{% macro run_query(sql) %}\n {% call statement(\"run_query_statement\", fetch_result=true, auto_begin=false) %}\n {{ sql }}\n {% endcall %}\n\n {% do return(load_result(\"run_query_statement\").table) %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "sql", "type": null, "description": ""}], "created_at": 1789503443.3351436, "supported_languages": null}, "macro.dbt.convert_datetime": {"name": "convert_datetime", "resource_type": "macro", "package_name": "dbt", "path": "macros/etc/datetime.sql", "original_file_path": "macros/etc/datetime.sql", "unique_id": "macro.dbt.convert_datetime", "macro_sql": "{% macro convert_datetime(date_str, date_fmt) %}\n\n {% set error_msg -%}\n The provided partition date '{{ date_str }}' does not match the expected format '{{ date_fmt }}'\n {%- endset %}\n\n {% set res = try_or_compiler_error(error_msg, modules.datetime.datetime.strptime, date_str.strip(), date_fmt) %}\n {{ return(res) }}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "date_str", "type": null, "description": ""}, {"name": "date_fmt", "type": null, "description": ""}], "created_at": 1789503443.336652, "supported_languages": null}, "macro.dbt.dates_in_range": {"name": "dates_in_range", "resource_type": "macro", "package_name": "dbt", "path": "macros/etc/datetime.sql", "original_file_path": "macros/etc/datetime.sql", "unique_id": "macro.dbt.dates_in_range", "macro_sql": "{% macro dates_in_range(start_date_str, end_date_str=none, in_fmt=\"%Y%m%d\", out_fmt=\"%Y%m%d\") %}\n {% set end_date_str = start_date_str if end_date_str is none else end_date_str %}\n\n {% set start_date = convert_datetime(start_date_str, in_fmt) %}\n {% set end_date = convert_datetime(end_date_str, in_fmt) %}\n\n {% set day_count = (end_date - start_date).days %}\n {% if day_count < 0 %}\n {% set msg -%}\n Partition start date is after the end date ({{ start_date }}, {{ end_date }})\n {%- endset %}\n\n {{ exceptions.raise_compiler_error(msg, model) }}\n {% endif %}\n\n {% set date_list = [] %}\n {% for i in range(0, day_count + 1) %}\n {% set the_date = (modules.datetime.timedelta(days=i) + start_date) %}\n {% if not out_fmt %}\n {% set _ = date_list.append(the_date) %}\n {% else %}\n {% set _ = date_list.append(the_date.strftime(out_fmt)) %}\n {% endif %}\n {% endfor %}\n\n {{ return(date_list) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.convert_datetime"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "start_date_str", "type": null, "description": ""}, {"name": "end_date_str", "type": null, "description": ""}, {"name": "in_fmt", "type": null, "description": ""}, {"name": "out_fmt", "type": null, "description": ""}], "created_at": 1789503443.339099, "supported_languages": null}, "macro.dbt.partition_range": {"name": "partition_range", "resource_type": "macro", "package_name": "dbt", "path": "macros/etc/datetime.sql", "original_file_path": "macros/etc/datetime.sql", "unique_id": "macro.dbt.partition_range", "macro_sql": "{% macro partition_range(raw_partition_date, date_fmt='%Y%m%d') %}\n {% set partition_range = (raw_partition_date | string).split(\",\") %}\n\n {% if (partition_range | length) == 1 %}\n {% set start_date = partition_range[0] %}\n {% set end_date = none %}\n {% elif (partition_range | length) == 2 %}\n {% set start_date = partition_range[0] %}\n {% set end_date = partition_range[1] %}\n {% else %}\n {{ exceptions.raise_compiler_error(\"Invalid partition time. Expected format: {Start Date}[,{End Date}]. Got: \" ~ raw_partition_date) }}\n {% endif %}\n\n {{ return(dates_in_range(start_date, end_date, in_fmt=date_fmt)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.dates_in_range"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "raw_partition_date", "type": null, "description": ""}, {"name": "date_fmt", "type": null, "description": ""}], "created_at": 1789503443.3406448, "supported_languages": null}, "macro.dbt.py_current_timestring": {"name": "py_current_timestring", "resource_type": "macro", "package_name": "dbt", "path": "macros/etc/datetime.sql", "original_file_path": "macros/etc/datetime.sql", "unique_id": "macro.dbt.py_current_timestring", "macro_sql": "{% macro py_current_timestring() %}\n {% set dt = modules.datetime.datetime.now() %}\n {% do return(dt.strftime(\"%Y%m%d%H%M%S%f\")) %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789503443.3411727, "supported_languages": null}, "macro.dbt.resolve_model_name": {"name": "resolve_model_name", "resource_type": "macro", "package_name": "dbt", "path": "macros/python_model/python.sql", "original_file_path": "macros/python_model/python.sql", "unique_id": "macro.dbt.resolve_model_name", "macro_sql": "{% macro resolve_model_name(input_model_name) %}\n {{ return(adapter.dispatch('resolve_model_name', 'dbt')(input_model_name)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__resolve_model_name"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "input_model_name", "type": null, "description": ""}], "created_at": 1789503443.3428617, "supported_languages": null}, "macro.dbt.default__resolve_model_name": {"name": "default__resolve_model_name", "resource_type": "macro", "package_name": "dbt", "path": "macros/python_model/python.sql", "original_file_path": "macros/python_model/python.sql", "unique_id": "macro.dbt.default__resolve_model_name", "macro_sql": "\n\n{%- macro default__resolve_model_name(input_model_name) -%}\n {{ input_model_name | string | replace('\"', '\\\"') }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "input_model_name", "type": null, "description": ""}], "created_at": 1789503443.3432403, "supported_languages": null}, "macro.dbt.build_ref_function": {"name": "build_ref_function", "resource_type": "macro", "package_name": "dbt", "path": "macros/python_model/python.sql", "original_file_path": "macros/python_model/python.sql", "unique_id": "macro.dbt.build_ref_function", "macro_sql": "{% macro build_ref_function(model) %}\n\n {%- set ref_dict = {} -%}\n {%- for _ref in model.refs -%}\n {% set _ref_args = [_ref.get('package'), _ref['name']] if _ref.get('package') else [_ref['name'],] %}\n {%- set resolved = ref(*_ref_args, v=_ref.get('version')) -%}\n\n {#\n We want to get the string of the returned relation by calling .render() in order to skip sample/empty\n mode rendering logic. However, people override the default ref macro, and often return a string instead\n of a relation (like the ref macro does by default). Thus, to make sure we dont blow things up, we have\n to ensure the resolved relation has a .render() method.\n #}\n {%- if resolved.render is defined and resolved.render is callable -%}\n {%- set resolved = resolved.render() -%}\n {%- endif -%}\n\n {%- if _ref.get('version') -%}\n {% do _ref_args.extend([\"v\" ~ _ref['version']]) %}\n {%- endif -%}\n {%- do ref_dict.update({_ref_args | join('.'): resolve_model_name(resolved)}) -%}\n {%- endfor -%}\n\ndef ref(*args, **kwargs):\n refs = {{ ref_dict | tojson }}\n key = '.'.join(args)\n version = kwargs.get(\"v\") or kwargs.get(\"version\")\n if version:\n key += f\".v{version}\"\n dbt_load_df_function = kwargs.get(\"dbt_load_df_function\")\n return dbt_load_df_function(refs[key])\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.resolve_model_name"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}], "created_at": 1789503443.3452168, "supported_languages": null}, "macro.dbt.build_source_function": {"name": "build_source_function", "resource_type": "macro", "package_name": "dbt", "path": "macros/python_model/python.sql", "original_file_path": "macros/python_model/python.sql", "unique_id": "macro.dbt.build_source_function", "macro_sql": "{% macro build_source_function(model) %}\n\n {%- set source_dict = {} -%}\n {%- for _source in model.sources -%}\n {%- set resolved = source(*_source) -%}\n {%- do source_dict.update({_source | join('.'): resolve_model_name(resolved)}) -%}\n {%- endfor -%}\n\ndef source(*args, dbt_load_df_function):\n sources = {{ source_dict | tojson }}\n key = '.'.join(args)\n return dbt_load_df_function(sources[key])\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.resolve_model_name"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}], "created_at": 1789503443.3460555, "supported_languages": null}, "macro.dbt.build_config_dict": {"name": "build_config_dict", "resource_type": "macro", "package_name": "dbt", "path": "macros/python_model/python.sql", "original_file_path": "macros/python_model/python.sql", "unique_id": "macro.dbt.build_config_dict", "macro_sql": "{% macro build_config_dict(model) %}\n {%- set config_dict = {} -%}\n {% set config_dbt_used = zip(model.config.config_keys_used, model.config.config_keys_defaults) | list %}\n {%- for key, default in config_dbt_used -%}\n {# weird type testing with enum, would be much easier to write this logic in Python! #}\n {%- if key == \"language\" -%}\n {%- set value = \"python\" -%}\n {%- endif -%}\n {%- set value = model.config.get(key, default) -%}\n {%- do config_dict.update({key: value}) -%}\n {%- endfor -%}\n {# Handle dbt.config.meta_get() calls - use separate dict to avoid overwriting native configs #}\n {%- set meta_dict = {} -%}\n {%- if model.config.meta_keys_used -%}\n {% set meta_dbt_used = zip(model.config.meta_keys_used, model.config.meta_keys_defaults) | list %}\n {%- for key, default in meta_dbt_used -%}\n {%- if model.config.meta and key in model.config.meta -%}\n {%- set value = model.config.meta[key] -%}\n {%- else -%}\n {%- set value = default -%}\n {%- endif -%}\n {%- do meta_dict.update({key: value}) -%}\n {%- endfor -%}\n {%- endif -%}\nconfig_dict = {{ config_dict }}\nmeta_dict = {{ meta_dict }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}], "created_at": 1789503443.3483517, "supported_languages": null}, "macro.dbt.py_script_postfix": {"name": "py_script_postfix", "resource_type": "macro", "package_name": "dbt", "path": "macros/python_model/python.sql", "original_file_path": "macros/python_model/python.sql", "unique_id": "macro.dbt.py_script_postfix", "macro_sql": "{% macro py_script_postfix(model) %}\n# This part is user provided model code\n# you will need to copy the next section to run the code\n# COMMAND ----------\n# this part is dbt logic for get ref work, do not modify\n\n{{ build_ref_function(model ) }}\n{{ build_source_function(model ) }}\n{{ build_config_dict(model) }}\n\nclass config:\n def __init__(self, *args, **kwargs):\n pass\n\n @staticmethod\n def get(key, default=None):\n return config_dict.get(key, default)\n\n @staticmethod\n def meta_get(key, default=None):\n return meta_dict.get(key, default)\n\nclass this:\n \"\"\"dbt.this() or dbt.this.identifier\"\"\"\n database = \"{{ this.database }}\"\n schema = \"{{ this.schema }}\"\n identifier = \"{{ this.identifier }}\"\n {% set this_relation_name = resolve_model_name(this) %}\n def __repr__(self):\n return '{{ this_relation_name }}'\n\n\nclass dbtObj:\n def __init__(self, load_df_function) -> None:\n self.source = lambda *args: source(*args, dbt_load_df_function=load_df_function)\n self.ref = lambda *args, **kwargs: ref(*args, **kwargs, dbt_load_df_function=load_df_function)\n self.config = config\n self.this = this()\n self.is_incremental = {{ is_incremental() }}\n\n# COMMAND ----------\n{{py_script_comment()}}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.build_ref_function", "macro.dbt.build_source_function", "macro.dbt.build_config_dict", "macro.dbt.resolve_model_name", "macro.dbt.is_incremental", "macro.dbt.py_script_comment"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}], "created_at": 1789503443.3497577, "supported_languages": null}, "macro.dbt.py_script_comment": {"name": "py_script_comment", "resource_type": "macro", "package_name": "dbt", "path": "macros/python_model/python.sql", "original_file_path": "macros/python_model/python.sql", "unique_id": "macro.dbt.py_script_comment", "macro_sql": "{%macro py_script_comment()%}\n{%endmacro%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789503443.349927, "supported_languages": null}, "macro.dbt.generate_schema_name": {"name": "generate_schema_name", "resource_type": "macro", "package_name": "dbt", "path": "macros/get_custom_name/get_custom_schema.sql", "original_file_path": "macros/get_custom_name/get_custom_schema.sql", "unique_id": "macro.dbt.generate_schema_name", "macro_sql": "{% macro generate_schema_name(custom_schema_name=none, node=none) -%}\n {{ return(adapter.dispatch('generate_schema_name', 'dbt')(custom_schema_name, node)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__generate_schema_name"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "custom_schema_name", "type": null, "description": ""}, {"name": "node", "type": null, "description": ""}], "created_at": 1789503443.3508017, "supported_languages": null}, "macro.dbt.default__generate_schema_name": {"name": "default__generate_schema_name", "resource_type": "macro", "package_name": "dbt", "path": "macros/get_custom_name/get_custom_schema.sql", "original_file_path": "macros/get_custom_name/get_custom_schema.sql", "unique_id": "macro.dbt.default__generate_schema_name", "macro_sql": "{% macro default__generate_schema_name(custom_schema_name, node) -%}\n\n {%- set default_schema = target.schema -%}\n {%- if custom_schema_name is none -%}\n\n {{ default_schema }}\n\n {%- else -%}\n\n {{ default_schema }}_{{ custom_schema_name | trim }}\n\n {%- endif -%}\n\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "custom_schema_name", "type": null, "description": ""}, {"name": "node", "type": null, "description": ""}], "created_at": 1789503443.351383, "supported_languages": null}, "macro.dbt.generate_schema_name_for_env": {"name": "generate_schema_name_for_env", "resource_type": "macro", "package_name": "dbt", "path": "macros/get_custom_name/get_custom_schema.sql", "original_file_path": "macros/get_custom_name/get_custom_schema.sql", "unique_id": "macro.dbt.generate_schema_name_for_env", "macro_sql": "{% macro generate_schema_name_for_env(custom_schema_name, node) -%}\n\n {%- set default_schema = target.schema -%}\n {%- if target.name == 'prod' and custom_schema_name is not none -%}\n\n {{ custom_schema_name | trim }}\n\n {%- else -%}\n\n {{ default_schema }}\n\n {%- endif -%}\n\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "custom_schema_name", "type": null, "description": ""}, {"name": "node", "type": null, "description": ""}], "created_at": 1789503443.3519616, "supported_languages": null}, "macro.dbt.generate_latest_version_pointer_alias": {"name": "generate_latest_version_pointer_alias", "resource_type": "macro", "package_name": "dbt", "path": "macros/get_custom_name/get_latest_version_pointer_alias.sql", "original_file_path": "macros/get_custom_name/get_latest_version_pointer_alias.sql", "unique_id": "macro.dbt.generate_latest_version_pointer_alias", "macro_sql": "{% macro generate_latest_version_pointer_alias(custom_alias_name=none, node=none) -%}\n {% do return(adapter.dispatch('generate_latest_version_pointer_alias', 'dbt')(custom_alias_name, node)) %}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__generate_latest_version_pointer_alias"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "custom_alias_name", "type": null, "description": ""}, {"name": "node", "type": null, "description": ""}], "created_at": 1789503443.3526812, "supported_languages": null}, "macro.dbt.default__generate_latest_version_pointer_alias": {"name": "default__generate_latest_version_pointer_alias", "resource_type": "macro", "package_name": "dbt", "path": "macros/get_custom_name/get_latest_version_pointer_alias.sql", "original_file_path": "macros/get_custom_name/get_latest_version_pointer_alias.sql", "unique_id": "macro.dbt.default__generate_latest_version_pointer_alias", "macro_sql": "{% macro default__generate_latest_version_pointer_alias(custom_alias_name=none, node=none) -%}\n {%- if custom_alias_name -%}\n {{ custom_alias_name | trim }}\n {%- else -%}\n {{ node.name }}\n {%- endif -%}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "custom_alias_name", "type": null, "description": ""}, {"name": "node", "type": null, "description": ""}], "created_at": 1789503443.3531528, "supported_languages": null}, "macro.dbt.generate_database_name": {"name": "generate_database_name", "resource_type": "macro", "package_name": "dbt", "path": "macros/get_custom_name/get_custom_database.sql", "original_file_path": "macros/get_custom_name/get_custom_database.sql", "unique_id": "macro.dbt.generate_database_name", "macro_sql": "{% macro generate_database_name(custom_database_name=none, node=none) -%}\n {% do return(adapter.dispatch('generate_database_name', 'dbt')(custom_database_name, node)) %}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__generate_database_name"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "custom_database_name", "type": null, "description": ""}, {"name": "node", "type": null, "description": ""}], "created_at": 1789503443.3539267, "supported_languages": null}, "macro.dbt.default__generate_database_name": {"name": "default__generate_database_name", "resource_type": "macro", "package_name": "dbt", "path": "macros/get_custom_name/get_custom_database.sql", "original_file_path": "macros/get_custom_name/get_custom_database.sql", "unique_id": "macro.dbt.default__generate_database_name", "macro_sql": "{% macro default__generate_database_name(custom_database_name=none, node=none) -%}\n {%- set default_database = target.database -%}\n {%- if node is not none and node|attr('database') -%}\n {%- set catalog_relation = adapter.build_catalog_relation(node) -%}\n {%- if catalog_relation and catalog_relation|attr('catalog_database') -%}\n {{ return(catalog_relation.catalog_database) }}\n {%- endif -%}\n {%- endif -%}\n {%- if custom_database_name is none -%}\n\n {{ default_database }}\n\n {%- else -%}\n\n {{ custom_database_name }}\n\n {%- endif -%}\n\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "custom_database_name", "type": null, "description": ""}, {"name": "node", "type": null, "description": ""}], "created_at": 1789503443.355135, "supported_languages": null}, "macro.dbt.generate_alias_name": {"name": "generate_alias_name", "resource_type": "macro", "package_name": "dbt", "path": "macros/get_custom_name/get_custom_alias.sql", "original_file_path": "macros/get_custom_name/get_custom_alias.sql", "unique_id": "macro.dbt.generate_alias_name", "macro_sql": "{% macro generate_alias_name(custom_alias_name=none, node=none) -%}\n {% do return(adapter.dispatch('generate_alias_name', 'dbt')(custom_alias_name, node)) %}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__generate_alias_name"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "custom_alias_name", "type": null, "description": ""}, {"name": "node", "type": null, "description": ""}], "created_at": 1789503443.355875, "supported_languages": null}, "macro.dbt.default__generate_alias_name": {"name": "default__generate_alias_name", "resource_type": "macro", "package_name": "dbt", "path": "macros/get_custom_name/get_custom_alias.sql", "original_file_path": "macros/get_custom_name/get_custom_alias.sql", "unique_id": "macro.dbt.default__generate_alias_name", "macro_sql": "{% macro default__generate_alias_name(custom_alias_name=none, node=none) -%}\n\n {%- if custom_alias_name -%}\n\n {{ custom_alias_name | trim }}\n\n {%- elif node.version -%}\n\n {{ return(node.name ~ \"_v\" ~ (node.version | replace(\".\", \"_\"))) }}\n\n {%- else -%}\n\n {{ node.name }}\n\n {%- endif -%}\n\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "custom_alias_name", "type": null, "description": ""}, {"name": "node", "type": null, "description": ""}], "created_at": 1789503443.3566794, "supported_languages": null}, "macro.dbt.get_show_sql": {"name": "get_show_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/show.sql", "original_file_path": "macros/adapters/show.sql", "unique_id": "macro.dbt.get_show_sql", "macro_sql": "{% macro get_show_sql(compiled_code, sql_header, limit) -%}\n {%- if sql_header is not none -%}\n {{ sql_header }}\n {%- endif %}\n {{ get_limit_subquery_sql(compiled_code, limit) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_limit_subquery_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "compiled_code", "type": null, "description": ""}, {"name": "sql_header", "type": null, "description": ""}, {"name": "limit", "type": null, "description": ""}], "created_at": 1789503443.3574471, "supported_languages": null}, "macro.dbt.get_limit_subquery_sql": {"name": "get_limit_subquery_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/show.sql", "original_file_path": "macros/adapters/show.sql", "unique_id": "macro.dbt.get_limit_subquery_sql", "macro_sql": "\n{%- macro get_limit_subquery_sql(sql, limit) -%}\n {{ adapter.dispatch('get_limit_sql', 'dbt')(sql, limit) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt.default__get_limit_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "sql", "type": null, "description": ""}, {"name": "limit", "type": null, "description": ""}], "created_at": 1789503443.357824, "supported_languages": null}, "macro.dbt.default__get_limit_sql": {"name": "default__get_limit_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/show.sql", "original_file_path": "macros/adapters/show.sql", "unique_id": "macro.dbt.default__get_limit_sql", "macro_sql": "{% macro default__get_limit_sql(sql, limit) %}\n {{ sql }}\n {% if limit is not none %}\n limit {{ limit }}\n {%- endif -%}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "sql", "type": null, "description": ""}, {"name": "limit", "type": null, "description": ""}], "created_at": 1789503443.3582432, "supported_languages": null}, "macro.dbt.current_timestamp": {"name": "current_timestamp", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/timestamps.sql", "original_file_path": "macros/adapters/timestamps.sql", "unique_id": "macro.dbt.current_timestamp", "macro_sql": "{%- macro current_timestamp() -%}\n {{ adapter.dispatch('current_timestamp', 'dbt')() }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt_postgres.postgres__current_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789503443.3591523, "supported_languages": null}, "macro.dbt.default__current_timestamp": {"name": "default__current_timestamp", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/timestamps.sql", "original_file_path": "macros/adapters/timestamps.sql", "unique_id": "macro.dbt.default__current_timestamp", "macro_sql": "{% macro default__current_timestamp() -%}\n {{ exceptions.raise_not_implemented(\n 'current_timestamp macro not implemented for adapter ' + adapter.type()) }}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789503443.3594663, "supported_languages": null}, "macro.dbt.snapshot_get_time": {"name": "snapshot_get_time", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/timestamps.sql", "original_file_path": "macros/adapters/timestamps.sql", "unique_id": "macro.dbt.snapshot_get_time", "macro_sql": "\n\n{%- macro snapshot_get_time() -%}\n {{ adapter.dispatch('snapshot_get_time', 'dbt')() }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt_postgres.postgres__snapshot_get_time"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789503443.3598762, "supported_languages": null}, "macro.dbt.default__snapshot_get_time": {"name": "default__snapshot_get_time", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/timestamps.sql", "original_file_path": "macros/adapters/timestamps.sql", "unique_id": "macro.dbt.default__snapshot_get_time", "macro_sql": "{% macro default__snapshot_get_time() %}\n {{ current_timestamp() }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.current_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789503443.360133, "supported_languages": null}, "macro.dbt.get_snapshot_get_time_data_type": {"name": "get_snapshot_get_time_data_type", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/timestamps.sql", "original_file_path": "macros/adapters/timestamps.sql", "unique_id": "macro.dbt.get_snapshot_get_time_data_type", "macro_sql": "{% macro get_snapshot_get_time_data_type() %}\n {% set snapshot_time = adapter.dispatch('snapshot_get_time', 'dbt')() %}\n {% set time_data_type_sql = 'select ' ~ snapshot_time ~ ' as dbt_snapshot_time' %}\n {% set snapshot_time_column_schema = get_column_schema_from_query(time_data_type_sql) %}\n {% set time_data_type = snapshot_time_column_schema[0].dtype %}\n {{ return(time_data_type or none) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.snapshot_get_time", "macro.dbt_postgres.postgres__snapshot_get_time", "macro.dbt.get_column_schema_from_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789503443.3609629, "supported_languages": null}, "macro.dbt.current_timestamp_backcompat": {"name": "current_timestamp_backcompat", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/timestamps.sql", "original_file_path": "macros/adapters/timestamps.sql", "unique_id": "macro.dbt.current_timestamp_backcompat", "macro_sql": "{% macro current_timestamp_backcompat() %}\n {{ return(adapter.dispatch('current_timestamp_backcompat', 'dbt')()) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__current_timestamp_backcompat"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789503443.3613338, "supported_languages": null}, "macro.dbt.default__current_timestamp_backcompat": {"name": "default__current_timestamp_backcompat", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/timestamps.sql", "original_file_path": "macros/adapters/timestamps.sql", "unique_id": "macro.dbt.default__current_timestamp_backcompat", "macro_sql": "{% macro default__current_timestamp_backcompat() %}\n current_timestamp::timestamp\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789503443.361504, "supported_languages": null}, "macro.dbt.current_timestamp_in_utc_backcompat": {"name": "current_timestamp_in_utc_backcompat", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/timestamps.sql", "original_file_path": "macros/adapters/timestamps.sql", "unique_id": "macro.dbt.current_timestamp_in_utc_backcompat", "macro_sql": "{% macro current_timestamp_in_utc_backcompat() %}\n {{ return(adapter.dispatch('current_timestamp_in_utc_backcompat', 'dbt')()) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__current_timestamp_in_utc_backcompat"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789503443.361836, "supported_languages": null}, "macro.dbt.default__current_timestamp_in_utc_backcompat": {"name": "default__current_timestamp_in_utc_backcompat", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/timestamps.sql", "original_file_path": "macros/adapters/timestamps.sql", "unique_id": "macro.dbt.default__current_timestamp_in_utc_backcompat", "macro_sql": "{% macro default__current_timestamp_in_utc_backcompat() %}\n {{ return(adapter.dispatch('current_timestamp_backcompat', 'dbt')()) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.current_timestamp_backcompat", "macro.dbt_postgres.postgres__current_timestamp_backcompat"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789503443.362199, "supported_languages": null}, "macro.dbt.create_schema": {"name": "create_schema", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/schema.sql", "original_file_path": "macros/adapters/schema.sql", "unique_id": "macro.dbt.create_schema", "macro_sql": "{% macro create_schema(relation) -%}\n {{ adapter.dispatch('create_schema', 'dbt')(relation) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__create_schema"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789503443.362813, "supported_languages": null}, "macro.dbt.default__create_schema": {"name": "default__create_schema", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/schema.sql", "original_file_path": "macros/adapters/schema.sql", "unique_id": "macro.dbt.default__create_schema", "macro_sql": "{% macro default__create_schema(relation) -%}\n {%- call statement('create_schema') -%}\n create schema if not exists {{ relation.without_identifier() }}\n {% endcall %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789503443.3632202, "supported_languages": null}, "macro.dbt.drop_schema": {"name": "drop_schema", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/schema.sql", "original_file_path": "macros/adapters/schema.sql", "unique_id": "macro.dbt.drop_schema", "macro_sql": "{% macro drop_schema(relation) -%}\n {{ adapter.dispatch('drop_schema', 'dbt')(relation) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__drop_schema"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789503443.3635595, "supported_languages": null}, "macro.dbt.default__drop_schema": {"name": "default__drop_schema", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/schema.sql", "original_file_path": "macros/adapters/schema.sql", "unique_id": "macro.dbt.default__drop_schema", "macro_sql": "{% macro default__drop_schema(relation) -%}\n {%- call statement('drop_schema') -%}\n drop schema if exists {{ relation.without_identifier() }} cascade\n {% endcall %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789503443.3639307, "supported_languages": null}, "macro.dbt.copy_grants": {"name": "copy_grants", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "unique_id": "macro.dbt.copy_grants", "macro_sql": "{% macro copy_grants() %}\n {{ return(adapter.dispatch('copy_grants', 'dbt')()) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__copy_grants"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789503443.3660681, "supported_languages": null}, "macro.dbt.default__copy_grants": {"name": "default__copy_grants", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "unique_id": "macro.dbt.default__copy_grants", "macro_sql": "{% macro default__copy_grants() %}\n {{ return(True) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789503443.3663244, "supported_languages": null}, "macro.dbt.support_multiple_grantees_per_dcl_statement": {"name": "support_multiple_grantees_per_dcl_statement", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "unique_id": "macro.dbt.support_multiple_grantees_per_dcl_statement", "macro_sql": "{% macro support_multiple_grantees_per_dcl_statement() %}\n {{ return(adapter.dispatch('support_multiple_grantees_per_dcl_statement', 'dbt')()) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__support_multiple_grantees_per_dcl_statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789503443.36667, "supported_languages": null}, "macro.dbt.default__support_multiple_grantees_per_dcl_statement": {"name": "default__support_multiple_grantees_per_dcl_statement", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "unique_id": "macro.dbt.default__support_multiple_grantees_per_dcl_statement", "macro_sql": "\n\n{%- macro default__support_multiple_grantees_per_dcl_statement() -%}\n {{ return(True) }}\n{%- endmacro -%}\n\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789503443.366906, "supported_languages": null}, "macro.dbt.should_revoke": {"name": "should_revoke", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "unique_id": "macro.dbt.should_revoke", "macro_sql": "{% macro should_revoke(existing_relation, full_refresh_mode=True) %}\n\n {% if not existing_relation %}\n {#-- The table doesn't already exist, so no grants to copy over --#}\n {{ return(False) }}\n {% elif full_refresh_mode %}\n {#-- The object is being REPLACED -- whether grants are copied over depends on the value of user config --#}\n {{ return(copy_grants()) }}\n {% else %}\n {#-- The table is being merged/upserted/inserted -- grants will be carried over --#}\n {{ return(True) }}\n {% endif %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.copy_grants"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "existing_relation", "type": null, "description": ""}, {"name": "full_refresh_mode", "type": null, "description": ""}], "created_at": 1789503443.3677258, "supported_languages": null}, "macro.dbt.get_show_grant_sql": {"name": "get_show_grant_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "unique_id": "macro.dbt.get_show_grant_sql", "macro_sql": "{% macro get_show_grant_sql(relation) %}\n {{ return(adapter.dispatch(\"get_show_grant_sql\", \"dbt\")(relation)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__get_show_grant_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789503443.368131, "supported_languages": null}, "macro.dbt.default__get_show_grant_sql": {"name": "default__get_show_grant_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "unique_id": "macro.dbt.default__get_show_grant_sql", "macro_sql": "{% macro default__get_show_grant_sql(relation) %}\n show grants on {{ relation.render() }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789503443.3683903, "supported_languages": null}, "macro.dbt.get_grant_sql": {"name": "get_grant_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "unique_id": "macro.dbt.get_grant_sql", "macro_sql": "{% macro get_grant_sql(relation, privilege, grantees) %}\n {{ return(adapter.dispatch('get_grant_sql', 'dbt')(relation, privilege, grantees)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_grant_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "privilege", "type": null, "description": ""}, {"name": "grantees", "type": null, "description": ""}], "created_at": 1789503443.368849, "supported_languages": null}, "macro.dbt.default__get_grant_sql": {"name": "default__get_grant_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "unique_id": "macro.dbt.default__get_grant_sql", "macro_sql": "\n\n{%- macro default__get_grant_sql(relation, privilege, grantees) -%}\n grant {{ privilege }} on {{ relation.render() }} to {{ grantees | join(', ') }}\n{%- endmacro -%}\n\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "privilege", "type": null, "description": ""}, {"name": "grantees", "type": null, "description": ""}], "created_at": 1789503443.369295, "supported_languages": null}, "macro.dbt.get_revoke_sql": {"name": "get_revoke_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "unique_id": "macro.dbt.get_revoke_sql", "macro_sql": "{% macro get_revoke_sql(relation, privilege, grantees) %}\n {{ return(adapter.dispatch('get_revoke_sql', 'dbt')(relation, privilege, grantees)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_revoke_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "privilege", "type": null, "description": ""}, {"name": "grantees", "type": null, "description": ""}], "created_at": 1789503443.369759, "supported_languages": null}, "macro.dbt.default__get_revoke_sql": {"name": "default__get_revoke_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "unique_id": "macro.dbt.default__get_revoke_sql", "macro_sql": "\n\n{%- macro default__get_revoke_sql(relation, privilege, grantees) -%}\n {%- set quoted_grantees = [] -%}\n {%- for grantee in grantees -%}\n {%- do quoted_grantees.append(adapter.quote(grantee)) -%}\n {%- endfor -%}\n revoke {{ privilege }} on {{ relation.render() }} from {{ quoted_grantees | join(', ') }}\n{%- endmacro -%}\n\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "privilege", "type": null, "description": ""}, {"name": "grantees", "type": null, "description": ""}], "created_at": 1789503443.3705406, "supported_languages": null}, "macro.dbt.get_dcl_statement_list": {"name": "get_dcl_statement_list", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "unique_id": "macro.dbt.get_dcl_statement_list", "macro_sql": "{% macro get_dcl_statement_list(relation, grant_config, get_dcl_macro) %}\n {{ return(adapter.dispatch('get_dcl_statement_list', 'dbt')(relation, grant_config, get_dcl_macro)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_dcl_statement_list"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "grant_config", "type": null, "description": ""}, {"name": "get_dcl_macro", "type": null, "description": ""}], "created_at": 1789503443.371023, "supported_languages": null}, "macro.dbt.default__get_dcl_statement_list": {"name": "default__get_dcl_statement_list", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "unique_id": "macro.dbt.default__get_dcl_statement_list", "macro_sql": "\n\n{%- macro default__get_dcl_statement_list(relation, grant_config, get_dcl_macro) -%}\n {#\n -- Unpack grant_config into specific privileges and the set of users who need them granted/revoked.\n -- Depending on whether this database supports multiple grantees per statement, pass in the list of\n -- all grantees per privilege, or (if not) template one statement per privilege-grantee pair.\n -- `get_dcl_macro` will be either `get_grant_sql` or `get_revoke_sql`\n #}\n {%- set dcl_statements = [] -%}\n {%- for privilege, grantees in grant_config.items() %}\n {%- if support_multiple_grantees_per_dcl_statement() and grantees -%}\n {%- set dcl = get_dcl_macro(relation, privilege, grantees) -%}\n {%- do dcl_statements.append(dcl) -%}\n {%- else -%}\n {%- for grantee in grantees -%}\n {% set dcl = get_dcl_macro(relation, privilege, [grantee]) %}\n {%- do dcl_statements.append(dcl) -%}\n {% endfor -%}\n {%- endif -%}\n {%- endfor -%}\n {{ return(dcl_statements) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.support_multiple_grantees_per_dcl_statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "grant_config", "type": null, "description": ""}, {"name": "get_dcl_macro", "type": null, "description": ""}], "created_at": 1789503443.3723645, "supported_languages": null}, "macro.dbt.call_dcl_statements": {"name": "call_dcl_statements", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "unique_id": "macro.dbt.call_dcl_statements", "macro_sql": "{% macro call_dcl_statements(dcl_statement_list) %}\n {{ return(adapter.dispatch(\"call_dcl_statements\", \"dbt\")(dcl_statement_list)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__call_dcl_statements"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "dcl_statement_list", "type": null, "description": ""}], "created_at": 1789503443.3727427, "supported_languages": null}, "macro.dbt.default__call_dcl_statements": {"name": "default__call_dcl_statements", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "unique_id": "macro.dbt.default__call_dcl_statements", "macro_sql": "{% macro default__call_dcl_statements(dcl_statement_list) %}\n {#\n -- By default, supply all grant + revoke statements in a single semicolon-separated block,\n -- so that they're all processed together.\n\n -- Some databases do not support this. Those adapters will need to override this macro\n -- to run each statement individually.\n #}\n {% call statement('grants') %}\n {% for dcl_statement in dcl_statement_list %}\n {{ dcl_statement }};\n {% endfor %}\n {% endcall %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "dcl_statement_list", "type": null, "description": ""}], "created_at": 1789503443.3732579, "supported_languages": null}, "macro.dbt.apply_grants": {"name": "apply_grants", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "unique_id": "macro.dbt.apply_grants", "macro_sql": "{% macro apply_grants(relation, grant_config, should_revoke) %}\n {{ return(adapter.dispatch(\"apply_grants\", \"dbt\")(relation, grant_config, should_revoke)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__apply_grants"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "grant_config", "type": null, "description": ""}, {"name": "should_revoke", "type": null, "description": ""}], "created_at": 1789503443.373716, "supported_languages": null}, "macro.dbt.default__apply_grants": {"name": "default__apply_grants", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "unique_id": "macro.dbt.default__apply_grants", "macro_sql": "{% macro default__apply_grants(relation, grant_config, should_revoke=True) %}\n {#-- If grant_config is {} or None, this is a no-op --#}\n {% if grant_config %}\n {% if should_revoke %}\n {#-- We think previous grants may have carried over --#}\n {#-- Show current grants and calculate diffs --#}\n {% set current_grants_table = run_query(get_show_grant_sql(relation)) %}\n {% set current_grants_dict = adapter.standardize_grants_dict(current_grants_table) %}\n {% set needs_granting = diff_of_two_dicts(grant_config, current_grants_dict) %}\n {% set needs_revoking = diff_of_two_dicts(current_grants_dict, grant_config) %}\n {% if not (needs_granting or needs_revoking) %}\n {{ log('On ' ~ relation.render() ~': All grants are in place, no revocation or granting needed.')}}\n {% endif %}\n {% else %}\n {#-- We don't think there's any chance of previous grants having carried over. --#}\n {#-- Jump straight to granting what the user has configured. --#}\n {% set needs_revoking = {} %}\n {% set needs_granting = grant_config %}\n {% endif %}\n {% if needs_granting or needs_revoking %}\n {% set revoke_statement_list = get_dcl_statement_list(relation, needs_revoking, get_revoke_sql) %}\n {% set grant_statement_list = get_dcl_statement_list(relation, needs_granting, get_grant_sql) %}\n {% set dcl_statement_list = revoke_statement_list + grant_statement_list %}\n {% if dcl_statement_list %}\n {{ call_dcl_statements(dcl_statement_list) }}\n {% endif %}\n {% endif %}\n {% endif %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.run_query", "macro.dbt.get_show_grant_sql", "macro.dbt.get_dcl_statement_list", "macro.dbt.call_dcl_statements"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "grant_config", "type": null, "description": ""}, {"name": "should_revoke", "type": null, "description": ""}], "created_at": 1789503443.376126, "supported_languages": null}, "macro.dbt.is_core_v2": {"name": "is_core_v2", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/runtime.sql", "original_file_path": "macros/adapters/runtime.sql", "unique_id": "macro.dbt.is_core_v2", "macro_sql": "{% macro is_core_v2() -%}\n {%- set major_version = (dbt_version.split('.') | first) | int -%}\n {{ return(major_version == 2) }}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789503443.3767066, "supported_languages": null}, "macro.dbt.alter_column_comment": {"name": "alter_column_comment", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/persist_docs.sql", "original_file_path": "macros/adapters/persist_docs.sql", "unique_id": "macro.dbt.alter_column_comment", "macro_sql": "{% macro alter_column_comment(relation, column_dict) -%}\n {{ return(adapter.dispatch('alter_column_comment', 'dbt')(relation, column_dict)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__alter_column_comment"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "column_dict", "type": null, "description": ""}], "created_at": 1789503443.3779511, "supported_languages": null}, "macro.dbt.default__alter_column_comment": {"name": "default__alter_column_comment", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/persist_docs.sql", "original_file_path": "macros/adapters/persist_docs.sql", "unique_id": "macro.dbt.default__alter_column_comment", "macro_sql": "{% macro default__alter_column_comment(relation, column_dict) -%}\n {{ exceptions.raise_not_implemented(\n 'alter_column_comment macro not implemented for adapter '+adapter.type()) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "column_dict", "type": null, "description": ""}], "created_at": 1789503443.378329, "supported_languages": null}, "macro.dbt.alter_relation_comment": {"name": "alter_relation_comment", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/persist_docs.sql", "original_file_path": "macros/adapters/persist_docs.sql", "unique_id": "macro.dbt.alter_relation_comment", "macro_sql": "{% macro alter_relation_comment(relation, relation_comment) -%}\n {{ return(adapter.dispatch('alter_relation_comment', 'dbt')(relation, relation_comment)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__alter_relation_comment"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "relation_comment", "type": null, "description": ""}], "created_at": 1789503443.3787408, "supported_languages": null}, "macro.dbt.default__alter_relation_comment": {"name": "default__alter_relation_comment", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/persist_docs.sql", "original_file_path": "macros/adapters/persist_docs.sql", "unique_id": "macro.dbt.default__alter_relation_comment", "macro_sql": "{% macro default__alter_relation_comment(relation, relation_comment) -%}\n {{ exceptions.raise_not_implemented(\n 'alter_relation_comment macro not implemented for adapter '+adapter.type()) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "relation_comment", "type": null, "description": ""}], "created_at": 1789503443.379114, "supported_languages": null}, "macro.dbt.persist_docs": {"name": "persist_docs", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/persist_docs.sql", "original_file_path": "macros/adapters/persist_docs.sql", "unique_id": "macro.dbt.persist_docs", "macro_sql": "{% macro persist_docs(relation, model, for_relation=true, for_columns=true) -%}\n {{ return(adapter.dispatch('persist_docs', 'dbt')(relation, model, for_relation, for_columns)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__persist_docs"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "model", "type": null, "description": ""}, {"name": "for_relation", "type": null, "description": ""}, {"name": "for_columns", "type": null, "description": ""}], "created_at": 1789503443.379654, "supported_languages": null}, "macro.dbt.validate_doc_columns": {"name": "validate_doc_columns", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/persist_docs.sql", "original_file_path": "macros/adapters/persist_docs.sql", "unique_id": "macro.dbt.validate_doc_columns", "macro_sql": "{% macro validate_doc_columns(relation, column_dict, existing_column_names) %}\n {% set existing_lower = existing_column_names | map(\"lower\") | list %}\n {% set missing = [] %}\n {% set filtered = {} %}\n {% for col_name in column_dict %}\n {% set is_quoted = column_dict[col_name]['quote'] %}\n {% if is_quoted %}\n {% set present = col_name in existing_column_names %}\n {% else %}\n {% set present = col_name | lower in existing_lower %}\n {% endif %}\n {% if present %}\n {% do filtered.update({col_name: column_dict[col_name]}) %}\n {% else %}\n {% do missing.append(col_name) %}\n {% endif %}\n {% endfor %}\n {% if missing | length > 0 %}\n {{ exceptions.warn(\"In relation \" ~ relation.render() ~ \": The following columns are specified in the schema but are not present in the database: \" ~ missing | join(\", \")) }}\n {% endif %}\n {{ return(filtered) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "column_dict", "type": null, "description": ""}, {"name": "existing_column_names", "type": null, "description": ""}], "created_at": 1789503443.3817415, "supported_languages": null}, "macro.dbt.default__persist_docs": {"name": "default__persist_docs", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/persist_docs.sql", "original_file_path": "macros/adapters/persist_docs.sql", "unique_id": "macro.dbt.default__persist_docs", "macro_sql": "{% macro default__persist_docs(relation, model, for_relation, for_columns) -%}\n {% if for_relation and config.persist_relation_docs() and model.description %}\n {% do run_query(alter_relation_comment(relation, model.description)) %}\n {% endif %}\n\n {% if for_columns and config.persist_column_docs() and model.columns %}\n {% set existing_columns = adapter.get_columns_in_relation(relation) | map(attribute=\"name\") | list %}\n {% set filtered_columns = validate_doc_columns(relation, model.columns, existing_columns) %}\n {% set alter_comment_sql = alter_column_comment(relation, filtered_columns) %}\n {% if alter_comment_sql and alter_comment_sql | trim | length > 0 %}\n {% do run_query(alter_comment_sql) %}\n {% endif %}\n {% endif %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.run_query", "macro.dbt.alter_relation_comment", "macro.dbt.validate_doc_columns", "macro.dbt.alter_column_comment"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "model", "type": null, "description": ""}, {"name": "for_relation", "type": null, "description": ""}, {"name": "for_columns", "type": null, "description": ""}], "created_at": 1789503443.383502, "supported_languages": null}, "macro.dbt.get_columns_in_relation": {"name": "get_columns_in_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "unique_id": "macro.dbt.get_columns_in_relation", "macro_sql": "{% macro get_columns_in_relation(relation) -%}\n {{ return(adapter.dispatch('get_columns_in_relation', 'dbt')(relation)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__get_columns_in_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789503443.3857346, "supported_languages": null}, "macro.dbt.default__get_columns_in_relation": {"name": "default__get_columns_in_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "unique_id": "macro.dbt.default__get_columns_in_relation", "macro_sql": "{% macro default__get_columns_in_relation(relation) -%}\n {{ exceptions.raise_not_implemented(\n 'get_columns_in_relation macro not implemented for adapter '+adapter.type()) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789503443.3860984, "supported_languages": null}, "macro.dbt.sql_convert_columns_in_relation": {"name": "sql_convert_columns_in_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "unique_id": "macro.dbt.sql_convert_columns_in_relation", "macro_sql": "{% macro sql_convert_columns_in_relation(table) -%}\n {% set columns = [] %}\n {% for row in table %}\n {% do columns.append(api.Column(*row)) %}\n {% endfor %}\n {{ return(columns) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "table", "type": null, "description": ""}], "created_at": 1789503443.3867211, "supported_languages": null}, "macro.dbt.get_list_of_column_names": {"name": "get_list_of_column_names", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "unique_id": "macro.dbt.get_list_of_column_names", "macro_sql": "\n\n{%- macro get_list_of_column_names(columns) -%}\n {% set col_names = [] %}\n {% for col in columns %}\n {% do col_names.append(col.name) %}\n {% endfor %}\n {{ return(col_names) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "columns", "type": null, "description": ""}], "created_at": 1789503443.3873303, "supported_languages": null}, "macro.dbt.get_empty_subquery_sql": {"name": "get_empty_subquery_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "unique_id": "macro.dbt.get_empty_subquery_sql", "macro_sql": "{% macro get_empty_subquery_sql(select_sql, select_sql_header=none) -%}\n {{ return(adapter.dispatch('get_empty_subquery_sql', 'dbt')(select_sql, select_sql_header)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_empty_subquery_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "select_sql", "type": null, "description": ""}, {"name": "select_sql_header", "type": null, "description": ""}], "created_at": 1789503443.3877625, "supported_languages": null}, "macro.dbt.default__get_empty_subquery_sql": {"name": "default__get_empty_subquery_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "unique_id": "macro.dbt.default__get_empty_subquery_sql", "macro_sql": "{% macro default__get_empty_subquery_sql(select_sql, select_sql_header=none) %}\n {%- if select_sql_header is not none -%}\n {{ select_sql_header }}\n {%- endif -%}\n select * from (\n {{ select_sql }}\n ) as __dbt_sbq\n where false\n limit 0\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "select_sql", "type": null, "description": ""}, {"name": "select_sql_header", "type": null, "description": ""}], "created_at": 1789503443.388202, "supported_languages": null}, "macro.dbt.get_empty_schema_sql": {"name": "get_empty_schema_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "unique_id": "macro.dbt.get_empty_schema_sql", "macro_sql": "{% macro get_empty_schema_sql(columns) -%}\n {{ return(adapter.dispatch('get_empty_schema_sql', 'dbt')(columns)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_empty_schema_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "columns", "type": null, "description": ""}], "created_at": 1789503443.3885639, "supported_languages": null}, "macro.dbt.default__get_empty_schema_sql": {"name": "default__get_empty_schema_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "unique_id": "macro.dbt.default__get_empty_schema_sql", "macro_sql": "{% macro default__get_empty_schema_sql(columns) %}\n {%- set col_err = [] -%}\n {%- set col_naked_numeric = [] -%}\n select\n {% for i in columns %}\n {%- set col = columns[i] -%}\n {%- if col['data_type'] is not defined -%}\n {%- do col_err.append(col['name']) -%}\n {#-- If this column's type is just 'numeric' then it is missing precision/scale, raise a warning --#}\n {%- elif col['data_type'].strip().lower() in ('numeric', 'decimal', 'number') -%}\n {%- do col_naked_numeric.append(col['name']) -%}\n {%- endif -%}\n {% set col_name = adapter.quote(col['name']) if col.get('quote') else col['name'] %}\n {{ cast('null', col['data_type']) }} as {{ col_name }}{{ \", \" if not loop.last }}\n {%- endfor -%}\n {%- if (col_err | length) > 0 -%}\n {{ exceptions.column_type_missing(column_names=col_err) }}\n {%- elif (col_naked_numeric | length) > 0 -%}\n {{ exceptions.warn(\"Detected columns with numeric type and unspecified precision/scale, this can lead to unintended rounding: \" ~ col_naked_numeric ~ \"`\") }}\n {%- endif -%}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.cast"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "columns", "type": null, "description": ""}], "created_at": 1789503443.3908958, "supported_languages": null}, "macro.dbt.get_column_schema_from_query": {"name": "get_column_schema_from_query", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "unique_id": "macro.dbt.get_column_schema_from_query", "macro_sql": "{% macro get_column_schema_from_query(select_sql, select_sql_header=none) -%}\n {% set columns = [] %}\n {# -- Using an 'empty subquery' here to get the same schema as the given select_sql statement, without necessitating a data scan.#}\n {% set sql = get_empty_subquery_sql(select_sql, select_sql_header) %}\n {% set column_schema = adapter.get_column_schema_from_query(sql) %}\n {{ return(column_schema) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_empty_subquery_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "select_sql", "type": null, "description": ""}, {"name": "select_sql_header", "type": null, "description": ""}], "created_at": 1789503443.3916082, "supported_languages": null}, "macro.dbt.get_columns_in_query": {"name": "get_columns_in_query", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "unique_id": "macro.dbt.get_columns_in_query", "macro_sql": "{% macro get_columns_in_query(select_sql) -%}\n {{ return(adapter.dispatch('get_columns_in_query', 'dbt')(select_sql)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_columns_in_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "select_sql", "type": null, "description": ""}], "created_at": 1789503443.391993, "supported_languages": null}, "macro.dbt.default__get_columns_in_query": {"name": "default__get_columns_in_query", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "unique_id": "macro.dbt.default__get_columns_in_query", "macro_sql": "{% macro default__get_columns_in_query(select_sql) %}\n {% call statement('get_columns_in_query', fetch_result=True, auto_begin=False) -%}\n {{ get_empty_subquery_sql(select_sql) }}\n {% endcall %}\n {{ return(load_result('get_columns_in_query').table.columns | map(attribute='name') | list) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement", "macro.dbt.get_empty_subquery_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "select_sql", "type": null, "description": ""}], "created_at": 1789503443.3926735, "supported_languages": null}, "macro.dbt.alter_column_type": {"name": "alter_column_type", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "unique_id": "macro.dbt.alter_column_type", "macro_sql": "{% macro alter_column_type(relation, column_name, new_column_type) -%}\n {{ return(adapter.dispatch('alter_column_type', 'dbt')(relation, column_name, new_column_type)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__alter_column_type"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "column_name", "type": null, "description": ""}, {"name": "new_column_type", "type": null, "description": ""}], "created_at": 1789503443.3931441, "supported_languages": null}, "macro.dbt.default__alter_column_type": {"name": "default__alter_column_type", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "unique_id": "macro.dbt.default__alter_column_type", "macro_sql": "{% macro default__alter_column_type(relation, column_name, new_column_type) -%}\n {#\n 1. Create a new column (w/ temp name and correct type)\n 2. Copy data over to it\n 3. Drop the existing column (cascade!)\n 4. Rename the new column to existing column\n #}\n {%- set tmp_column = column_name + \"__dbt_alter\" -%}\n\n {% call statement('alter_column_type') %}\n alter table {{ relation.render() }} add column {{ adapter.quote(tmp_column) }} {{ new_column_type }};\n update {{ relation.render() }} set {{ adapter.quote(tmp_column) }} = {{ adapter.quote(column_name) }};\n alter table {{ relation.render() }} drop column {{ adapter.quote(column_name) }} cascade;\n alter table {{ relation.render() }} rename column {{ adapter.quote(tmp_column) }} to {{ adapter.quote(column_name) }}\n {% endcall %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "column_name", "type": null, "description": ""}, {"name": "new_column_type", "type": null, "description": ""}], "created_at": 1789503443.3945477, "supported_languages": null}, "macro.dbt.alter_relation_add_remove_columns": {"name": "alter_relation_add_remove_columns", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "unique_id": "macro.dbt.alter_relation_add_remove_columns", "macro_sql": "{% macro alter_relation_add_remove_columns(relation, add_columns = none, remove_columns = none) -%}\n {{ return(adapter.dispatch('alter_relation_add_remove_columns', 'dbt')(relation, add_columns, remove_columns)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__alter_relation_add_remove_columns"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "add_columns", "type": null, "description": ""}, {"name": "remove_columns", "type": null, "description": ""}], "created_at": 1789503443.3951237, "supported_languages": null}, "macro.dbt.default__alter_relation_add_remove_columns": {"name": "default__alter_relation_add_remove_columns", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "unique_id": "macro.dbt.default__alter_relation_add_remove_columns", "macro_sql": "{% macro default__alter_relation_add_remove_columns(relation, add_columns, remove_columns) %}\n\n {% if add_columns is none %}\n {% set add_columns = [] %}\n {% endif %}\n {% if remove_columns is none %}\n {% set remove_columns = [] %}\n {% endif %}\n\n {% set sql -%}\n\n alter {{ relation.type }} {{ relation.render() }}\n\n {% for column in add_columns %}\n add column {{ column.quoted }} {{ column.expanded_data_type }}{{ ',' if not loop.last }}\n {% endfor %}{{ ',' if add_columns and remove_columns }}\n\n {% for column in remove_columns %}\n drop column {{ column.quoted }}{{ ',' if not loop.last }}\n {% endfor %}\n\n {%- endset -%}\n\n {% do run_query(sql) %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "add_columns", "type": null, "description": ""}, {"name": "remove_columns", "type": null, "description": ""}], "created_at": 1789503443.3967404, "supported_languages": null}, "macro.dbt.get_create_index_sql": {"name": "get_create_index_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/indexes.sql", "original_file_path": "macros/adapters/indexes.sql", "unique_id": "macro.dbt.get_create_index_sql", "macro_sql": "{% macro get_create_index_sql(relation, index_dict) -%}\n {{ return(adapter.dispatch('get_create_index_sql', 'dbt')(relation, index_dict)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__get_create_index_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "index_dict", "type": null, "description": ""}], "created_at": 1789503443.3977194, "supported_languages": null}, "macro.dbt.default__get_create_index_sql": {"name": "default__get_create_index_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/indexes.sql", "original_file_path": "macros/adapters/indexes.sql", "unique_id": "macro.dbt.default__get_create_index_sql", "macro_sql": "{% macro default__get_create_index_sql(relation, index_dict) -%}\n {% do return(None) %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "index_dict", "type": null, "description": ""}], "created_at": 1789503443.3980331, "supported_languages": null}, "macro.dbt.create_indexes": {"name": "create_indexes", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/indexes.sql", "original_file_path": "macros/adapters/indexes.sql", "unique_id": "macro.dbt.create_indexes", "macro_sql": "{% macro create_indexes(relation) -%}\n {{ adapter.dispatch('create_indexes', 'dbt')(relation) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__create_indexes"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789503443.398365, "supported_languages": null}, "macro.dbt.default__create_indexes": {"name": "default__create_indexes", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/indexes.sql", "original_file_path": "macros/adapters/indexes.sql", "unique_id": "macro.dbt.default__create_indexes", "macro_sql": "{% macro default__create_indexes(relation) -%}\n {%- set _indexes = config.get('indexes', default=[]) -%}\n\n {% for _index_dict in _indexes %}\n {% set create_index_sql = get_create_index_sql(relation, _index_dict) %}\n {% if create_index_sql %}\n {% do run_query(create_index_sql) %}\n {% endif %}\n {% endfor %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_create_index_sql", "macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789503443.3991764, "supported_languages": null}, "macro.dbt.get_drop_index_sql": {"name": "get_drop_index_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/indexes.sql", "original_file_path": "macros/adapters/indexes.sql", "unique_id": "macro.dbt.get_drop_index_sql", "macro_sql": "{% macro get_drop_index_sql(relation, index_name) -%}\n {{ adapter.dispatch('get_drop_index_sql', 'dbt')(relation, index_name) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__get_drop_index_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "index_name", "type": null, "description": ""}], "created_at": 1789503443.3995538, "supported_languages": null}, "macro.dbt.default__get_drop_index_sql": {"name": "default__get_drop_index_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/indexes.sql", "original_file_path": "macros/adapters/indexes.sql", "unique_id": "macro.dbt.default__get_drop_index_sql", "macro_sql": "{% macro default__get_drop_index_sql(relation, index_name) -%}\n {{ exceptions.raise_compiler_error(\"`get_drop_index_sql has not been implemented for this adapter.\") }}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "index_name", "type": null, "description": ""}], "created_at": 1789503443.39984, "supported_languages": null}, "macro.dbt.get_show_indexes_sql": {"name": "get_show_indexes_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/indexes.sql", "original_file_path": "macros/adapters/indexes.sql", "unique_id": "macro.dbt.get_show_indexes_sql", "macro_sql": "{% macro get_show_indexes_sql(relation) -%}\n {{ adapter.dispatch('get_show_indexes_sql', 'dbt')(relation) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__get_show_indexes_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789503443.400189, "supported_languages": null}, "macro.dbt.default__get_show_indexes_sql": {"name": "default__get_show_indexes_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/indexes.sql", "original_file_path": "macros/adapters/indexes.sql", "unique_id": "macro.dbt.default__get_show_indexes_sql", "macro_sql": "{% macro default__get_show_indexes_sql(relation) -%}\n {{ exceptions.raise_compiler_error(\"`get_show_indexes_sql has not been implemented for this adapter.\") }}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789503443.400453, "supported_languages": null}, "macro.dbt.get_catalog_relations": {"name": "get_catalog_relations", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "unique_id": "macro.dbt.get_catalog_relations", "macro_sql": "{% macro get_catalog_relations(information_schema, relations) -%}\n {{ return(adapter.dispatch('get_catalog_relations', 'dbt')(information_schema, relations)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__get_catalog_relations"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "information_schema", "type": null, "description": ""}, {"name": "relations", "type": null, "description": ""}], "created_at": 1789503443.4022098, "supported_languages": null}, "macro.dbt.default__get_catalog_relations": {"name": "default__get_catalog_relations", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "unique_id": "macro.dbt.default__get_catalog_relations", "macro_sql": "{% macro default__get_catalog_relations(information_schema, relations) -%}\n {% set typename = adapter.type() %}\n {% set msg -%}\n get_catalog_relations not implemented for {{ typename }}\n {%- endset %}\n\n {{ exceptions.raise_compiler_error(msg) }}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "information_schema", "type": null, "description": ""}, {"name": "relations", "type": null, "description": ""}], "created_at": 1789503443.4027438, "supported_languages": null}, "macro.dbt.get_catalog": {"name": "get_catalog", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "unique_id": "macro.dbt.get_catalog", "macro_sql": "{% macro get_catalog(information_schema, schemas) -%}\n {{ return(adapter.dispatch('get_catalog', 'dbt')(information_schema, schemas)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__get_catalog"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "information_schema", "type": null, "description": ""}, {"name": "schemas", "type": null, "description": ""}], "created_at": 1789503443.4031832, "supported_languages": null}, "macro.dbt.default__get_catalog": {"name": "default__get_catalog", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "unique_id": "macro.dbt.default__get_catalog", "macro_sql": "{% macro default__get_catalog(information_schema, schemas) -%}\n\n {% set typename = adapter.type() %}\n {% set msg -%}\n get_catalog not implemented for {{ typename }}\n {%- endset %}\n\n {{ exceptions.raise_compiler_error(msg) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "information_schema", "type": null, "description": ""}, {"name": "schemas", "type": null, "description": ""}], "created_at": 1789503443.403718, "supported_languages": null}, "macro.dbt.information_schema_name": {"name": "information_schema_name", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "unique_id": "macro.dbt.information_schema_name", "macro_sql": "{% macro information_schema_name(database) %}\n {{ return(adapter.dispatch('information_schema_name', 'dbt')(database)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__information_schema_name"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "database", "type": null, "description": ""}], "created_at": 1789503443.4041193, "supported_languages": null}, "macro.dbt.default__information_schema_name": {"name": "default__information_schema_name", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "unique_id": "macro.dbt.default__information_schema_name", "macro_sql": "{% macro default__information_schema_name(database) -%}\n {%- if database -%}\n {{ database }}.INFORMATION_SCHEMA\n {%- else -%}\n INFORMATION_SCHEMA\n {%- endif -%}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "database", "type": null, "description": ""}], "created_at": 1789503443.4045603, "supported_languages": null}, "macro.dbt.list_schemas": {"name": "list_schemas", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "unique_id": "macro.dbt.list_schemas", "macro_sql": "{% macro list_schemas(database) -%}\n {{ return(adapter.dispatch('list_schemas', 'dbt')(database)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__list_schemas"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "database", "type": null, "description": ""}], "created_at": 1789503443.4049242, "supported_languages": null}, "macro.dbt.default__list_schemas": {"name": "default__list_schemas", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "unique_id": "macro.dbt.default__list_schemas", "macro_sql": "{% macro default__list_schemas(database) -%}\n {% set sql %}\n select distinct schema_name\n from {{ information_schema_name(database) }}.SCHEMATA\n where catalog_name ilike '{{ database }}'\n {% endset %}\n {{ return(run_query(sql)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.information_schema_name", "macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "database", "type": null, "description": ""}], "created_at": 1789503443.405442, "supported_languages": null}, "macro.dbt.check_schema_exists": {"name": "check_schema_exists", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "unique_id": "macro.dbt.check_schema_exists", "macro_sql": "{% macro check_schema_exists(information_schema, schema) -%}\n {{ return(adapter.dispatch('check_schema_exists', 'dbt')(information_schema, schema)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__check_schema_exists"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "information_schema", "type": null, "description": ""}, {"name": "schema", "type": null, "description": ""}], "created_at": 1789503443.4058514, "supported_languages": null}, "macro.dbt.default__check_schema_exists": {"name": "default__check_schema_exists", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "unique_id": "macro.dbt.default__check_schema_exists", "macro_sql": "{% macro default__check_schema_exists(information_schema, schema) -%}\n {% set sql -%}\n select count(*)\n from {{ information_schema.replace(information_schema_view='SCHEMATA') }}\n where catalog_name='{{ information_schema.database }}'\n and schema_name='{{ schema }}'\n {%- endset %}\n {{ return(run_query(sql)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.replace", "macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "information_schema", "type": null, "description": ""}, {"name": "schema", "type": null, "description": ""}], "created_at": 1789503443.4064858, "supported_languages": null}, "macro.dbt.list_relations_without_caching": {"name": "list_relations_without_caching", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "unique_id": "macro.dbt.list_relations_without_caching", "macro_sql": "{% macro list_relations_without_caching(schema_relation) %}\n {{ return(adapter.dispatch('list_relations_without_caching', 'dbt')(schema_relation)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__list_relations_without_caching"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "schema_relation", "type": null, "description": ""}], "created_at": 1789503443.4068596, "supported_languages": null}, "macro.dbt.default__list_relations_without_caching": {"name": "default__list_relations_without_caching", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "unique_id": "macro.dbt.default__list_relations_without_caching", "macro_sql": "{% macro default__list_relations_without_caching(schema_relation) %}\n {{ exceptions.raise_not_implemented(\n 'list_relations_without_caching macro not implemented for adapter '+adapter.type()) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "schema_relation", "type": null, "description": ""}], "created_at": 1789503443.4072106, "supported_languages": null}, "macro.dbt.list_function_relations_without_caching": {"name": "list_function_relations_without_caching", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "unique_id": "macro.dbt.list_function_relations_without_caching", "macro_sql": "{% macro list_function_relations_without_caching(schema_relation) %}\n {{ return(adapter.dispatch('list_function_relations_without_caching', 'dbt')(schema_relation)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__list_function_relations_without_caching"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "schema_relation", "type": null, "description": ""}], "created_at": 1789503443.4075792, "supported_languages": null}, "macro.dbt.default__list_function_relations_without_caching": {"name": "default__list_function_relations_without_caching", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "unique_id": "macro.dbt.default__list_function_relations_without_caching", "macro_sql": "{% macro default__list_function_relations_without_caching(schema_relation) %}\n {{ exceptions.raise_not_implemented(\n 'list_function_relations_without_caching macro not implemented for adapter '+adapter.type()) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "schema_relation", "type": null, "description": ""}], "created_at": 1789503443.4079037, "supported_languages": null}, "macro.dbt.get_catalog_for_single_relation": {"name": "get_catalog_for_single_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "unique_id": "macro.dbt.get_catalog_for_single_relation", "macro_sql": "{% macro get_catalog_for_single_relation(relation) %}\n {{ return(adapter.dispatch('get_catalog_for_single_relation', 'dbt')(relation)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_catalog_for_single_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789503443.4083028, "supported_languages": null}, "macro.dbt.default__get_catalog_for_single_relation": {"name": "default__get_catalog_for_single_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "unique_id": "macro.dbt.default__get_catalog_for_single_relation", "macro_sql": "{% macro default__get_catalog_for_single_relation(relation) %}\n {{ exceptions.raise_not_implemented(\n 'get_catalog_for_single_relation macro not implemented for adapter '+adapter.type()) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789503443.408642, "supported_languages": null}, "macro.dbt.get_relations": {"name": "get_relations", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "unique_id": "macro.dbt.get_relations", "macro_sql": "{% macro get_relations() %}\n {{ return(adapter.dispatch('get_relations', 'dbt')()) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__get_relations"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789503443.4089954, "supported_languages": null}, "macro.dbt.default__get_relations": {"name": "default__get_relations", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "unique_id": "macro.dbt.default__get_relations", "macro_sql": "{% macro default__get_relations() %}\n {{ exceptions.raise_not_implemented(\n 'get_relations macro not implemented for adapter '+adapter.type()) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789503443.4093137, "supported_languages": null}, "macro.dbt.get_relation_last_modified": {"name": "get_relation_last_modified", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "unique_id": "macro.dbt.get_relation_last_modified", "macro_sql": "{% macro get_relation_last_modified(information_schema, relations) %}\n {{ return(adapter.dispatch('get_relation_last_modified', 'dbt')(information_schema, relations)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_relation_last_modified"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "information_schema", "type": null, "description": ""}, {"name": "relations", "type": null, "description": ""}], "created_at": 1789503443.4097335, "supported_languages": null}, "macro.dbt.default__get_relation_last_modified": {"name": "default__get_relation_last_modified", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "unique_id": "macro.dbt.default__get_relation_last_modified", "macro_sql": "{% macro default__get_relation_last_modified(information_schema, relations) %}\n {{ exceptions.raise_not_implemented(\n 'get_relation_last_modified macro not implemented for adapter ' + adapter.type()) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "information_schema", "type": null, "description": ""}, {"name": "relations", "type": null, "description": ""}], "created_at": 1789503443.4101017, "supported_languages": null}, "macro.dbt.validate_sql": {"name": "validate_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/validate_sql.sql", "original_file_path": "macros/adapters/validate_sql.sql", "unique_id": "macro.dbt.validate_sql", "macro_sql": "{% macro validate_sql(sql) -%}\n {{ return(adapter.dispatch('validate_sql', 'dbt')(sql)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__validate_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "sql", "type": null, "description": ""}], "created_at": 1789503443.410671, "supported_languages": null}, "macro.dbt.default__validate_sql": {"name": "default__validate_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/validate_sql.sql", "original_file_path": "macros/adapters/validate_sql.sql", "unique_id": "macro.dbt.default__validate_sql", "macro_sql": "{% macro default__validate_sql(sql) -%}\n {% call statement('validate_sql') -%}\n explain {{ sql }}\n {% endcall %}\n {{ return(load_result('validate_sql')) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "sql", "type": null, "description": ""}], "created_at": 1789503443.411277, "supported_languages": null}, "macro.dbt.collect_freshness": {"name": "collect_freshness", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/freshness.sql", "original_file_path": "macros/adapters/freshness.sql", "unique_id": "macro.dbt.collect_freshness", "macro_sql": "{% macro collect_freshness(source, loaded_at_field, filter) %}\n {{ return(adapter.dispatch('collect_freshness', 'dbt')(source, loaded_at_field, filter))}}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__collect_freshness"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "source", "type": null, "description": ""}, {"name": "loaded_at_field", "type": null, "description": ""}, {"name": "filter", "type": null, "description": ""}], "created_at": 1789503443.4121819, "supported_languages": null}, "macro.dbt.default__collect_freshness": {"name": "default__collect_freshness", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/freshness.sql", "original_file_path": "macros/adapters/freshness.sql", "unique_id": "macro.dbt.default__collect_freshness", "macro_sql": "{% macro default__collect_freshness(source, loaded_at_field, filter) %}\n {% call statement('collect_freshness', fetch_result=True, auto_begin=False) -%}\n select\n max({{ loaded_at_field }}) as max_loaded_at,\n {{ current_timestamp() }} as snapshotted_at\n from {{ source }}\n {% if filter %}\n where {{ filter }}\n {% endif %}\n {% endcall %}\n {{ return(load_result('collect_freshness')) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement", "macro.dbt.current_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "source", "type": null, "description": ""}, {"name": "loaded_at_field", "type": null, "description": ""}, {"name": "filter", "type": null, "description": ""}], "created_at": 1789503443.4130263, "supported_languages": null}, "macro.dbt.collect_freshness_custom_sql": {"name": "collect_freshness_custom_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/freshness.sql", "original_file_path": "macros/adapters/freshness.sql", "unique_id": "macro.dbt.collect_freshness_custom_sql", "macro_sql": "{% macro collect_freshness_custom_sql(source, loaded_at_query) %}\n {{ return(adapter.dispatch('collect_freshness_custom_sql', 'dbt')(source, loaded_at_query))}}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__collect_freshness_custom_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "source", "type": null, "description": ""}, {"name": "loaded_at_query", "type": null, "description": ""}], "created_at": 1789503443.413456, "supported_languages": null}, "macro.dbt.default__collect_freshness_custom_sql": {"name": "default__collect_freshness_custom_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/freshness.sql", "original_file_path": "macros/adapters/freshness.sql", "unique_id": "macro.dbt.default__collect_freshness_custom_sql", "macro_sql": "{% macro default__collect_freshness_custom_sql(source, loaded_at_query) %}\n {% call statement('collect_freshness_custom_sql', fetch_result=True, auto_begin=False) -%}\n with source_query as (\n {{ loaded_at_query }}\n )\n select\n (select * from source_query) as max_loaded_at,\n {{ current_timestamp() }} as snapshotted_at\n {% endcall %}\n {{ return(load_result('collect_freshness_custom_sql')) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement", "macro.dbt.current_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "source", "type": null, "description": ""}, {"name": "loaded_at_query", "type": null, "description": ""}], "created_at": 1789503443.4141133, "supported_languages": null}, "macro.dbt.make_intermediate_relation": {"name": "make_intermediate_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "unique_id": "macro.dbt.make_intermediate_relation", "macro_sql": "{% macro make_intermediate_relation(base_relation, suffix='__dbt_tmp') %}\n {{ return(adapter.dispatch('make_intermediate_relation', 'dbt')(base_relation, suffix)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__make_intermediate_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "base_relation", "type": null, "description": ""}, {"name": "suffix", "type": null, "description": ""}], "created_at": 1789503443.415445, "supported_languages": null}, "macro.dbt.default__make_intermediate_relation": {"name": "default__make_intermediate_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "unique_id": "macro.dbt.default__make_intermediate_relation", "macro_sql": "{% macro default__make_intermediate_relation(base_relation, suffix) %}\n {{ return(default__make_temp_relation(base_relation, suffix)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__make_temp_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "base_relation", "type": null, "description": ""}, {"name": "suffix", "type": null, "description": ""}], "created_at": 1789503443.415784, "supported_languages": null}, "macro.dbt.make_temp_relation": {"name": "make_temp_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "unique_id": "macro.dbt.make_temp_relation", "macro_sql": "{% macro make_temp_relation(base_relation, suffix='__dbt_tmp') %}\n {#-- This ensures microbatch batches get unique temp relations to avoid clobbering --#}\n {% if suffix == '__dbt_tmp' and model.batch %}\n {% set suffix = suffix ~ '_' ~ model.batch.id %}\n {% endif %}\n\n {{ return(adapter.dispatch('make_temp_relation', 'dbt')(base_relation, suffix)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__make_temp_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "base_relation", "type": null, "description": ""}, {"name": "suffix", "type": null, "description": ""}], "created_at": 1789503443.4165907, "supported_languages": null}, "macro.dbt.default__make_temp_relation": {"name": "default__make_temp_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "unique_id": "macro.dbt.default__make_temp_relation", "macro_sql": "{% macro default__make_temp_relation(base_relation, suffix) %}\n {%- set temp_identifier = base_relation.identifier ~ suffix -%}\n {%- set temp_relation = base_relation.incorporate(\n path={\"identifier\": temp_identifier}) -%}\n\n {{ return(temp_relation) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "base_relation", "type": null, "description": ""}, {"name": "suffix", "type": null, "description": ""}], "created_at": 1789503443.4172106, "supported_languages": null}, "macro.dbt.make_backup_relation": {"name": "make_backup_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "unique_id": "macro.dbt.make_backup_relation", "macro_sql": "{% macro make_backup_relation(base_relation, backup_relation_type, suffix='__dbt_backup') %}\n {{ return(adapter.dispatch('make_backup_relation', 'dbt')(base_relation, backup_relation_type, suffix)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__make_backup_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "base_relation", "type": null, "description": ""}, {"name": "backup_relation_type", "type": null, "description": ""}, {"name": "suffix", "type": null, "description": ""}], "created_at": 1789503443.4177043, "supported_languages": null}, "macro.dbt.default__make_backup_relation": {"name": "default__make_backup_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "unique_id": "macro.dbt.default__make_backup_relation", "macro_sql": "{% macro default__make_backup_relation(base_relation, backup_relation_type, suffix) %}\n {%- set backup_identifier = base_relation.identifier ~ suffix -%}\n {%- set backup_relation = base_relation.incorporate(\n path={\"identifier\": backup_identifier},\n type=backup_relation_type\n ) -%}\n {{ return(backup_relation) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "base_relation", "type": null, "description": ""}, {"name": "backup_relation_type", "type": null, "description": ""}, {"name": "suffix", "type": null, "description": ""}], "created_at": 1789503443.418365, "supported_languages": null}, "macro.dbt.truncate_relation": {"name": "truncate_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "unique_id": "macro.dbt.truncate_relation", "macro_sql": "{% macro truncate_relation(relation) -%}\n {{ return(adapter.dispatch('truncate_relation', 'dbt')(relation)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__truncate_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789503443.4187376, "supported_languages": null}, "macro.dbt.default__truncate_relation": {"name": "default__truncate_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "unique_id": "macro.dbt.default__truncate_relation", "macro_sql": "{% macro default__truncate_relation(relation) -%}\n {% call statement('truncate_relation') -%}\n truncate table {{ relation.render() }}\n {%- endcall %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789503443.4191449, "supported_languages": null}, "macro.dbt.get_or_create_relation": {"name": "get_or_create_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "unique_id": "macro.dbt.get_or_create_relation", "macro_sql": "{% macro get_or_create_relation(database, schema, identifier, type) -%}\n {{ return(adapter.dispatch('get_or_create_relation', 'dbt')(database, schema, identifier, type)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_or_create_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "database", "type": null, "description": ""}, {"name": "schema", "type": null, "description": ""}, {"name": "identifier", "type": null, "description": ""}, {"name": "type", "type": null, "description": ""}], "created_at": 1789503443.419643, "supported_languages": null}, "macro.dbt.default__get_or_create_relation": {"name": "default__get_or_create_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "unique_id": "macro.dbt.default__get_or_create_relation", "macro_sql": "{% macro default__get_or_create_relation(database, schema, identifier, type) %}\n {%- set target_relation = adapter.get_relation(database=database, schema=schema, identifier=identifier) %}\n\n {% if target_relation %}\n {% do return([true, target_relation]) %}\n {% endif %}\n\n {%- set new_relation = api.Relation.create(\n database=database,\n schema=schema,\n identifier=identifier,\n type=type\n ) -%}\n {% do return([false, new_relation]) %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "database", "type": null, "description": ""}, {"name": "schema", "type": null, "description": ""}, {"name": "identifier", "type": null, "description": ""}, {"name": "type", "type": null, "description": ""}], "created_at": 1789503443.4208515, "supported_languages": null}, "macro.dbt.load_cached_relation": {"name": "load_cached_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "unique_id": "macro.dbt.load_cached_relation", "macro_sql": "{% macro load_cached_relation(relation) %}\n {% do return(adapter.get_relation(\n database=relation.database,\n schema=relation.schema,\n identifier=relation.identifier\n )) -%}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789503443.4213746, "supported_languages": null}, "macro.dbt.load_relation": {"name": "load_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "unique_id": "macro.dbt.load_relation", "macro_sql": "{% macro load_relation(relation) %}\n {{ return(load_cached_relation(relation)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.load_cached_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789503443.421676, "supported_languages": null}, "macro.dbt.test_unique": {"name": "test_unique", "resource_type": "macro", "package_name": "dbt", "path": "tests/generic/builtin.sql", "original_file_path": "tests/generic/builtin.sql", "unique_id": "macro.dbt.test_unique", "macro_sql": "{% test unique(model, column_name) %}\n {% set macro = adapter.dispatch('test_unique', 'dbt') %}\n {{ macro(model, column_name) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt.default__test_unique"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789503443.4225445, "supported_languages": null}, "macro.dbt.test_not_null": {"name": "test_not_null", "resource_type": "macro", "package_name": "dbt", "path": "tests/generic/builtin.sql", "original_file_path": "tests/generic/builtin.sql", "unique_id": "macro.dbt.test_not_null", "macro_sql": "{% test not_null(model, column_name) %}\n {% set macro = adapter.dispatch('test_not_null', 'dbt') %}\n {{ macro(model, column_name) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt.default__test_not_null"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789503443.4230611, "supported_languages": null}, "macro.dbt.test_accepted_values": {"name": "test_accepted_values", "resource_type": "macro", "package_name": "dbt", "path": "tests/generic/builtin.sql", "original_file_path": "tests/generic/builtin.sql", "unique_id": "macro.dbt.test_accepted_values", "macro_sql": "{% test accepted_values(model, column_name, values, quote=True) %}\n {% set macro = adapter.dispatch('test_accepted_values', 'dbt') %}\n {{ macro(model, column_name, values, quote) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt.default__test_accepted_values"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789503443.4236703, "supported_languages": null}, "macro.dbt.test_relationships": {"name": "test_relationships", "resource_type": "macro", "package_name": "dbt", "path": "tests/generic/builtin.sql", "original_file_path": "tests/generic/builtin.sql", "unique_id": "macro.dbt.test_relationships", "macro_sql": "{% test relationships(model, column_name, to, field) %}\n {% set macro = adapter.dispatch('test_relationships', 'dbt') %}\n {{ macro(model, column_name, to, field) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt.default__test_relationships"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789503443.4242706, "supported_languages": null}, "macro.dbt_utils.slugify": {"name": "slugify", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/jinja_helpers/slugify.sql", "original_file_path": "macros/jinja_helpers/slugify.sql", "unique_id": "macro.dbt_utils.slugify", "macro_sql": "{% macro slugify(string) %}\n\n{% if not string %}\n{{ return('') }}\n{% endif %}\n\n{#- Lower case the string -#}\n{% set string = string | lower %}\n{#- Replace spaces and dashes with underscores -#}\n{% set string = modules.re.sub('[ -]+', '_', string) %}\n{#- Only take letters, numbers, and underscores -#}\n{% set string = modules.re.sub('[^a-z0-9_]+', '', string) %}\n{#- Prepends \"_\" if string begins with a number -#}\n{% set string = modules.re.sub('^[0-9]', '_' + string[0], string) %}\n\n{{ return(string) }}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "string", "type": null, "description": ""}], "created_at": 1789503443.4257362, "supported_languages": null}, "macro.dbt_utils.log_info": {"name": "log_info", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/jinja_helpers/log_info.sql", "original_file_path": "macros/jinja_helpers/log_info.sql", "unique_id": "macro.dbt_utils.log_info", "macro_sql": "{% macro log_info(message) %}\n {{ return(adapter.dispatch('log_info', 'dbt_utils')(message)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__log_info"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "message", "type": null, "description": ""}], "created_at": 1789503443.426275, "supported_languages": null}, "macro.dbt_utils.default__log_info": {"name": "default__log_info", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/jinja_helpers/log_info.sql", "original_file_path": "macros/jinja_helpers/log_info.sql", "unique_id": "macro.dbt_utils.default__log_info", "macro_sql": "{% macro default__log_info(message) %}\n {{ log(dbt_utils.pretty_log_format(message), info=True) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.pretty_log_format"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "message", "type": null, "description": ""}], "created_at": 1789503443.4266264, "supported_languages": null}, "macro.dbt_utils.pretty_log_format": {"name": "pretty_log_format", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/jinja_helpers/pretty_log_format.sql", "original_file_path": "macros/jinja_helpers/pretty_log_format.sql", "unique_id": "macro.dbt_utils.pretty_log_format", "macro_sql": "{% macro pretty_log_format(message) %}\n {{ return(adapter.dispatch('pretty_log_format', 'dbt_utils')(message)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__pretty_log_format"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "message", "type": null, "description": ""}], "created_at": 1789503443.427159, "supported_languages": null}, "macro.dbt_utils.default__pretty_log_format": {"name": "default__pretty_log_format", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/jinja_helpers/pretty_log_format.sql", "original_file_path": "macros/jinja_helpers/pretty_log_format.sql", "unique_id": "macro.dbt_utils.default__pretty_log_format", "macro_sql": "{% macro default__pretty_log_format(message) %}\n {{ return( dbt_utils.pretty_time() ~ ' + ' ~ message) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.pretty_time"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "message", "type": null, "description": ""}], "created_at": 1789503443.4274976, "supported_languages": null}, "macro.dbt_utils._is_ephemeral": {"name": "_is_ephemeral", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/jinja_helpers/_is_ephemeral.sql", "original_file_path": "macros/jinja_helpers/_is_ephemeral.sql", "unique_id": "macro.dbt_utils._is_ephemeral", "macro_sql": "{% macro _is_ephemeral(obj, macro) %}\n {%- if obj.is_cte -%}\n {% set ephemeral_prefix = api.Relation.add_ephemeral_prefix('') %}\n {% if obj.name.startswith(ephemeral_prefix) %}\n {% set model_name = obj.name[(ephemeral_prefix|length):] %}\n {% else %}\n {% set model_name = obj.name %}\n {%- endif -%}\n {% set error_message %}\nThe `{{ macro }}` macro cannot be used with ephemeral models, as it relies on the information schema.\n\n`{{ model_name }}` is an ephemeral model. Consider making it a view or table instead.\n {% endset %}\n {%- do exceptions.raise_compiler_error(error_message) -%}\n {%- endif -%}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "obj", "type": null, "description": ""}, {"name": "macro", "type": null, "description": ""}], "created_at": 1789503443.4289548, "supported_languages": null}, "macro.dbt_utils._is_relation": {"name": "_is_relation", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/jinja_helpers/_is_relation.sql", "original_file_path": "macros/jinja_helpers/_is_relation.sql", "unique_id": "macro.dbt_utils._is_relation", "macro_sql": "{% macro _is_relation(obj, macro) %}\n {%- if not (obj is mapping and obj.get('metadata', {}).get('type', '').endswith('Relation')) -%}\n {%- do exceptions.raise_compiler_error(\"Macro \" ~ macro ~ \" expected a Relation but received the value: \" ~ obj) -%}\n {%- endif -%}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "obj", "type": null, "description": ""}, {"name": "macro", "type": null, "description": ""}], "created_at": 1789503443.4298458, "supported_languages": null}, "macro.dbt_utils.pretty_time": {"name": "pretty_time", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/jinja_helpers/pretty_time.sql", "original_file_path": "macros/jinja_helpers/pretty_time.sql", "unique_id": "macro.dbt_utils.pretty_time", "macro_sql": "{% macro pretty_time(format='%H:%M:%S') %}\n {{ return(adapter.dispatch('pretty_time', 'dbt_utils')(format)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__pretty_time"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "format", "type": null, "description": ""}], "created_at": 1789503443.43042, "supported_languages": null}, "macro.dbt_utils.default__pretty_time": {"name": "default__pretty_time", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/jinja_helpers/pretty_time.sql", "original_file_path": "macros/jinja_helpers/pretty_time.sql", "unique_id": "macro.dbt_utils.default__pretty_time", "macro_sql": "{% macro default__pretty_time(format='%H:%M:%S') %}\n {{ return(modules.datetime.datetime.now().strftime(format)) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "format", "type": null, "description": ""}], "created_at": 1789503443.4308126, "supported_languages": null}, "macro.dbt_utils.test_not_constant": {"name": "test_not_constant", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/not_constant.sql", "original_file_path": "macros/generic_tests/not_constant.sql", "unique_id": "macro.dbt_utils.test_not_constant", "macro_sql": "{% test not_constant(model, column_name, group_by_columns = []) %}\n {{ return(adapter.dispatch('test_not_constant', 'dbt_utils')(model, column_name, group_by_columns)) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_not_constant"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "column_name", "type": null, "description": ""}, {"name": "group_by_columns", "type": null, "description": ""}], "created_at": 1789503443.4316063, "supported_languages": null}, "macro.dbt_utils.default__test_not_constant": {"name": "default__test_not_constant", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/not_constant.sql", "original_file_path": "macros/generic_tests/not_constant.sql", "unique_id": "macro.dbt_utils.default__test_not_constant", "macro_sql": "{% macro default__test_not_constant(model, column_name, group_by_columns) %}\n\n{% if group_by_columns|length() > 0 %}\n {% set select_gb_cols = group_by_columns|join(' ,') + ', ' %}\n {% set groupby_gb_cols = 'group by ' + group_by_columns|join(',') %}\n{% endif %}\n\n\nselect\n {# In TSQL, subquery aggregate columns need aliases #}\n {# thus: a filler col name, 'filler_column' #}\n {{select_gb_cols}}\n count(distinct {{ column_name }}) as filler_column\n\nfrom {{ model }}\n\n {{groupby_gb_cols}}\n\nhaving count(distinct {{ column_name }}) = 1\n\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "column_name", "type": null, "description": ""}, {"name": "group_by_columns", "type": null, "description": ""}], "created_at": 1789503443.432665, "supported_languages": null}, "macro.dbt_utils.test_equality": {"name": "test_equality", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/equality.sql", "original_file_path": "macros/generic_tests/equality.sql", "unique_id": "macro.dbt_utils.test_equality", "macro_sql": "{% test equality(model, compare_model, compare_columns=None, exclude_columns=None, precision = None) %}\n {{ return(adapter.dispatch('test_equality', 'dbt_utils')(model, compare_model, compare_columns, exclude_columns, precision)) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_equality"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "compare_model", "type": null, "description": ""}, {"name": "compare_columns", "type": null, "description": ""}, {"name": "exclude_columns", "type": null, "description": ""}, {"name": "precision", "type": null, "description": ""}], "created_at": 1789503443.4348743, "supported_languages": null}, "macro.dbt_utils.default__test_equality": {"name": "default__test_equality", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/equality.sql", "original_file_path": "macros/generic_tests/equality.sql", "unique_id": "macro.dbt_utils.default__test_equality", "macro_sql": "{% macro default__test_equality(model, compare_model, compare_columns=None, exclude_columns=None, precision = None) %}\n\n{%- if compare_columns and exclude_columns -%}\n {{ exceptions.raise_compiler_error(\"Both a compare and an ignore list were provided to the `equality` macro. Only one is allowed\") }}\n{%- endif -%}\n\n{% set set_diff %}\n count(*) + coalesce(abs(\n sum(case when which_diff = 'a_minus_b' then 1 else 0 end) -\n sum(case when which_diff = 'b_minus_a' then 1 else 0 end)\n ), 0)\n{% endset %}\n\n{#-- Needs to be set at parse time, before we return '' below --#}\n{{ config(fail_calc = set_diff) }}\n\n{#-- Prevent querying of db in parsing mode. This works because this macro does not create any new refs. #}\n{%- if not execute -%}\n {{ return('') }}\n{% endif %}\n\n\n\n-- setup\n{%- do dbt_utils._is_relation(model, 'test_equality') -%}\n\n{# Ensure there are no extra columns in the compare_model vs model #}\n{%- if not compare_columns -%}\n {%- do dbt_utils._is_ephemeral(model, 'test_equality') -%}\n {%- do dbt_utils._is_ephemeral(compare_model, 'test_equality') -%}\n\n {%- set model_columns = adapter.get_columns_in_relation(model) -%}\n {%- set compare_model_columns = adapter.get_columns_in_relation(compare_model) -%}\n\n\n {%- if exclude_columns -%}\n {#-- Lower case ignore columns for easier comparison --#}\n {%- set exclude_columns = exclude_columns | map(\"lower\") | list %}\n\n {# Filter out the excluded columns #}\n {%- set include_columns = [] %}\n {%- set include_model_columns = [] %}\n {%- for column in model_columns -%}\n {%- if column.name | lower not in exclude_columns -%}\n {% do include_columns.append(column) %}\n {%- endif %}\n {%- endfor %}\n {%- for column in compare_model_columns -%}\n {%- if column.name | lower not in exclude_columns -%}\n {% do include_model_columns.append(column) %}\n {%- endif %}\n {%- endfor %}\n\n {%- set compare_columns_set = set(include_columns | map(attribute='quoted') | map(\"lower\")) %}\n {%- set compare_model_columns_set = set(include_model_columns | map(attribute='quoted') | map(\"lower\")) %}\n {%- else -%}\n {%- set compare_columns_set = set(model_columns | map(attribute='quoted') | map(\"lower\")) %}\n {%- set compare_model_columns_set = set(compare_model_columns | map(attribute='quoted') | map(\"lower\")) %}\n {%- endif -%}\n\n {% if compare_columns_set != compare_model_columns_set %}\n {{ exceptions.raise_compiler_error(compare_model ~\" has less columns than \" ~ model ~ \", please ensure they have the same columns or use the `compare_columns` or `exclude_columns` arguments to subset them.\") }}\n {% endif %}\n\n\n{% endif %}\n\n{%- if not precision -%}\n {%- if not compare_columns -%}\n {# \n You cannot get the columns in an ephemeral model (due to not existing in the information schema),\n so if the user does not provide an explicit list of columns we must error in the case it is ephemeral\n #}\n {%- do dbt_utils._is_ephemeral(model, 'test_equality') -%}\n {%- set compare_columns = adapter.get_columns_in_relation(model)-%}\n\n {%- if exclude_columns -%}\n {#-- Lower case ignore columns for easier comparison --#}\n {%- set exclude_columns = exclude_columns | map(\"lower\") | list %}\n\n {# Filter out the excluded columns #}\n {%- set include_columns = [] %}\n {%- for column in compare_columns -%}\n {%- if column.name | lower not in exclude_columns -%}\n {% do include_columns.append(column) %}\n {%- endif %}\n {%- endfor %}\n\n {%- set compare_columns = include_columns | map(attribute='quoted') %}\n {%- else -%} {# Compare columns provided #}\n {%- set compare_columns = compare_columns | map(attribute='quoted') %}\n {%- endif -%}\n {%- endif -%}\n\n {% set compare_cols_csv = compare_columns | join(', ') %}\n\n{% else %} {# Precision required #}\n {#-\n If rounding is required, we need to get the types, so it cannot be ephemeral even if they provide column names\n -#}\n {%- do dbt_utils._is_ephemeral(model, 'test_equality') -%}\n {%- set columns = adapter.get_columns_in_relation(model) -%}\n\n {% set columns_list = [] %}\n {%- for col in columns -%}\n {%- if (\n (col.name|lower in compare_columns|map('lower') or not compare_columns) and\n (col.name|lower not in exclude_columns|map('lower') or not exclude_columns)\n ) -%}\n {# Databricks double type is not picked up by any number type checks in dbt #}\n {%- if col.is_float() or col.is_numeric() or col.data_type == 'double' -%}\n {# Cast is required due to postgres not having round for a double precision number #}\n {%- do columns_list.append('round(cast(' ~ col.quoted ~ ' as ' ~ dbt.type_numeric() ~ '),' ~ precision ~ ') as ' ~ col.quoted) -%}\n {%- else -%} {# Non-numeric type #}\n {%- do columns_list.append(col.quoted) -%}\n {%- endif -%}\n {% endif %}\n {%- endfor -%}\n\n {% set compare_cols_csv = columns_list | join(', ') %}\n\n{% endif %}\n\nwith a as (\n\n select * from {{ model }}\n\n),\n\nb as (\n\n select * from {{ compare_model }}\n\n),\n\na_minus_b as (\n\n select {{compare_cols_csv}} from a\n {{ dbt.except() }}\n select {{compare_cols_csv}} from b\n\n),\n\nb_minus_a as (\n\n select {{compare_cols_csv}} from b\n {{ dbt.except() }}\n select {{compare_cols_csv}} from a\n\n),\n\nunioned as (\n\n select 'a_minus_b' as which_diff, a_minus_b.* from a_minus_b\n union all\n select 'b_minus_a' as which_diff, b_minus_a.* from b_minus_a\n\n)\n\nselect * from unioned\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils._is_relation", "macro.dbt_utils._is_ephemeral", "macro.dbt.type_numeric", "macro.dbt.except"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "compare_model", "type": null, "description": ""}, {"name": "compare_columns", "type": null, "description": ""}, {"name": "exclude_columns", "type": null, "description": ""}, {"name": "precision", "type": null, "description": ""}], "created_at": 1789503443.442801, "supported_languages": null}, "macro.dbt_utils.test_not_empty_string": {"name": "test_not_empty_string", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/not_empty_string.sql", "original_file_path": "macros/generic_tests/not_empty_string.sql", "unique_id": "macro.dbt_utils.test_not_empty_string", "macro_sql": "{% test not_empty_string(model, column_name, trim_whitespace=true) %}\n\n {{ return(adapter.dispatch('test_not_empty_string', 'dbt_utils')(model, column_name, trim_whitespace)) }}\n\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_not_empty_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "column_name", "type": null, "description": ""}, {"name": "trim_whitespace", "type": null, "description": ""}], "created_at": 1789503443.443607, "supported_languages": null}, "macro.dbt_utils.default__test_not_empty_string": {"name": "default__test_not_empty_string", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/not_empty_string.sql", "original_file_path": "macros/generic_tests/not_empty_string.sql", "unique_id": "macro.dbt_utils.default__test_not_empty_string", "macro_sql": "{% macro default__test_not_empty_string(model, column_name, trim_whitespace=true) %}\n\n with\n \n all_values as (\n\n select \n\n\n {% if trim_whitespace == true -%}\n\n trim({{ column_name }}) as {{ column_name }}\n\n {%- else -%}\n\n {{ column_name }}\n\n {%- endif %}\n \n from {{ model }}\n\n ),\n\n errors as (\n\n select * from all_values\n where {{ column_name }} = ''\n\n )\n\n select * from errors\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "column_name", "type": null, "description": ""}, {"name": "trim_whitespace", "type": null, "description": ""}], "created_at": 1789503443.444249, "supported_languages": null}, "macro.dbt_utils.test_recency": {"name": "test_recency", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/recency.sql", "original_file_path": "macros/generic_tests/recency.sql", "unique_id": "macro.dbt_utils.test_recency", "macro_sql": "{% test recency(model, field, datepart, interval, ignore_time_component=False, group_by_columns = []) %}\n {{ return(adapter.dispatch('test_recency', 'dbt_utils')(model, field, datepart, interval, ignore_time_component, group_by_columns)) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_recency"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "field", "type": null, "description": ""}, {"name": "datepart", "type": null, "description": ""}, {"name": "interval", "type": null, "description": ""}, {"name": "ignore_time_component", "type": null, "description": ""}, {"name": "group_by_columns", "type": null, "description": ""}], "created_at": 1789503443.4453335, "supported_languages": null}, "macro.dbt_utils.default__test_recency": {"name": "default__test_recency", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/recency.sql", "original_file_path": "macros/generic_tests/recency.sql", "unique_id": "macro.dbt_utils.default__test_recency", "macro_sql": "{% macro default__test_recency(model, field, datepart, interval, ignore_time_component, group_by_columns) %}\n\n{% set empty_invocation = flags.EMPTY is defined and flags.EMPTY %}\n\n{% set threshold = 'cast(' ~ dbt.dateadd(datepart, interval * -1, dbt.current_timestamp()) ~ ' as ' ~ ('date' if ignore_time_component else dbt.type_timestamp()) ~ ')' %}\n\n{% if group_by_columns|length() > 0 %}\n {% set select_gb_cols = group_by_columns|join(' ,') + ', ' %}\n {% set groupby_gb_cols = 'group by ' + group_by_columns|join(',') %}\n{% endif %}\n\n\nwith recency as (\n\n select \n\n {{ select_gb_cols }}\n {% if ignore_time_component %}\n cast(max({{ field }}) as date) as most_recent\n {%- else %}\n max({{ field }}) as most_recent\n {%- endif %}\n\n from {{ model }}\n\n {{ groupby_gb_cols }}\n\n)\n\nselect\n\n {{ select_gb_cols }}\n most_recent,\n {{ threshold }} as threshold\n\nfrom recency\nwhere most_recent < {{ threshold }}\n{%- if not empty_invocation %}\n or most_recent is null\n{%- endif %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.dateadd", "macro.dbt.current_timestamp", "macro.dbt.type_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "field", "type": null, "description": ""}, {"name": "datepart", "type": null, "description": ""}, {"name": "interval", "type": null, "description": ""}, {"name": "ignore_time_component", "type": null, "description": ""}, {"name": "group_by_columns", "type": null, "description": ""}], "created_at": 1789503443.447267, "supported_languages": null}, "macro.dbt_utils.test_at_least_one": {"name": "test_at_least_one", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/at_least_one.sql", "original_file_path": "macros/generic_tests/at_least_one.sql", "unique_id": "macro.dbt_utils.test_at_least_one", "macro_sql": "{% test at_least_one(model, column_name, group_by_columns = []) %}\n {{ return(adapter.dispatch('test_at_least_one', 'dbt_utils')(model, column_name, group_by_columns)) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_at_least_one"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "column_name", "type": null, "description": ""}, {"name": "group_by_columns", "type": null, "description": ""}], "created_at": 1789503443.448218, "supported_languages": null}, "macro.dbt_utils.default__test_at_least_one": {"name": "default__test_at_least_one", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/at_least_one.sql", "original_file_path": "macros/generic_tests/at_least_one.sql", "unique_id": "macro.dbt_utils.default__test_at_least_one", "macro_sql": "{% macro default__test_at_least_one(model, column_name, group_by_columns) %}\n\n{% set pruned_cols = [column_name] %}\n\n{% if group_by_columns|length() > 0 %}\n\n {% set select_gb_cols = group_by_columns|join(' ,') + ', ' %}\n {% set groupby_gb_cols = 'group by ' + group_by_columns|join(',') %}\n {% set pruned_cols = group_by_columns %}\n\n {% if column_name not in pruned_cols %}\n {% do pruned_cols.append(column_name) %}\n {% endif %}\n\n{% endif %}\n\n{% set select_pruned_cols = pruned_cols|join(' ,') %}\n\nselect *\nfrom (\n with pruned_rows as (\n select\n {{ select_pruned_cols }}\n from {{ model }}\n {% if group_by_columns|length() == 0 %}\n where {{ column_name }} is not null\n limit 1\n {% endif %}\n )\n select\n {# In TSQL, subquery aggregate columns need aliases #}\n {# thus: a filler col name, 'filler_column' #}\n {{select_gb_cols}}\n count({{ column_name }}) as filler_column\n\n from pruned_rows\n\n {{groupby_gb_cols}}\n\n having count({{ column_name }}) = 0\n\n) validation_errors\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "column_name", "type": null, "description": ""}, {"name": "group_by_columns", "type": null, "description": ""}], "created_at": 1789503443.4499445, "supported_languages": null}, "macro.dbt_utils.test_unique_combination_of_columns": {"name": "test_unique_combination_of_columns", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/unique_combination_of_columns.sql", "original_file_path": "macros/generic_tests/unique_combination_of_columns.sql", "unique_id": "macro.dbt_utils.test_unique_combination_of_columns", "macro_sql": "{% test unique_combination_of_columns(model, combination_of_columns, quote_columns=false) %}\n {{ return(adapter.dispatch('test_unique_combination_of_columns', 'dbt_utils')(model, combination_of_columns, quote_columns)) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_unique_combination_of_columns"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "combination_of_columns", "type": null, "description": ""}, {"name": "quote_columns", "type": null, "description": ""}], "created_at": 1789503443.4507926, "supported_languages": null}, "macro.dbt_utils.default__test_unique_combination_of_columns": {"name": "default__test_unique_combination_of_columns", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/unique_combination_of_columns.sql", "original_file_path": "macros/generic_tests/unique_combination_of_columns.sql", "unique_id": "macro.dbt_utils.default__test_unique_combination_of_columns", "macro_sql": "{% macro default__test_unique_combination_of_columns(model, combination_of_columns, quote_columns=false) %}\n\n{% if not quote_columns %}\n {%- set column_list=combination_of_columns %}\n{% elif quote_columns %}\n {%- set column_list=[] %}\n {% for column in combination_of_columns -%}\n {% do column_list.append( adapter.quote(column) ) %}\n {%- endfor %}\n{% else %}\n {{ exceptions.raise_compiler_error(\n \"`quote_columns` argument for unique_combination_of_columns test must be one of [True, False] Got: '\" ~ quote ~\"'.'\"\n ) }}\n{% endif %}\n\n{%- set columns_csv=column_list | join(', ') %}\n\n\nwith validation_errors as (\n\n select\n {{ columns_csv }}\n from {{ model }}\n group by {{ columns_csv }}\n having count(*) > 1\n\n)\n\nselect *\nfrom validation_errors\n\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "combination_of_columns", "type": null, "description": ""}, {"name": "quote_columns", "type": null, "description": ""}], "created_at": 1789503443.4520736, "supported_languages": null}, "macro.dbt_utils.test_fewer_rows_than": {"name": "test_fewer_rows_than", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/fewer_rows_than.sql", "original_file_path": "macros/generic_tests/fewer_rows_than.sql", "unique_id": "macro.dbt_utils.test_fewer_rows_than", "macro_sql": "{% test fewer_rows_than(model, compare_model, group_by_columns = []) %}\n {{ return(adapter.dispatch('test_fewer_rows_than', 'dbt_utils')(model, compare_model, group_by_columns)) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_fewer_rows_than"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "compare_model", "type": null, "description": ""}, {"name": "group_by_columns", "type": null, "description": ""}], "created_at": 1789503443.4531674, "supported_languages": null}, "macro.dbt_utils.default__test_fewer_rows_than": {"name": "default__test_fewer_rows_than", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/fewer_rows_than.sql", "original_file_path": "macros/generic_tests/fewer_rows_than.sql", "unique_id": "macro.dbt_utils.default__test_fewer_rows_than", "macro_sql": "{% macro default__test_fewer_rows_than(model, compare_model, group_by_columns) %}\n\n{{ config(fail_calc = 'sum(coalesce(row_count_delta, 0))') }}\n\n{% if group_by_columns|length() > 0 %}\n {% set select_gb_cols = group_by_columns|join(' ,') + ', ' %}\n {% set join_gb_cols %}\n {% for c in group_by_columns %}\n and a.{{c}} = b.{{c}}\n {% endfor %}\n {% endset %}\n {% set groupby_gb_cols = 'group by ' + group_by_columns|join(',') %}\n{% endif %}\n\n{#-- We must add a fake join key in case additional grouping variables are not provided --#}\n{#-- Redshift does not allow for dynamically created join conditions (e.g. full join on 1 = 1 --#}\n{#-- The same logic is used in equal_rowcount. In case of changes, maintain consistent logic --#}\n{% set group_by_columns = ['id_dbtutils_test_fewer_rows_than'] + group_by_columns %}\n{% set groupby_gb_cols = 'group by ' + group_by_columns|join(',') %}\n\n\nwith a as (\n\n select \n {{select_gb_cols}}\n 1 as id_dbtutils_test_fewer_rows_than,\n count(*) as count_our_model \n from {{ model }}\n {{ groupby_gb_cols }}\n\n),\nb as (\n\n select \n {{select_gb_cols}}\n 1 as id_dbtutils_test_fewer_rows_than,\n count(*) as count_comparison_model \n from {{ compare_model }}\n {{ groupby_gb_cols }}\n\n),\ncounts as (\n\n select\n\n {% for c in group_by_columns -%}\n a.{{c}} as {{c}}_a,\n b.{{c}} as {{c}}_b,\n {% endfor %}\n\n count_our_model,\n count_comparison_model\n from a\n full join b on \n a.id_dbtutils_test_fewer_rows_than = b.id_dbtutils_test_fewer_rows_than\n {{ join_gb_cols }}\n\n),\nfinal as (\n\n select *,\n case\n -- fail the test if we have more rows than the reference model and return the row count delta\n when count_our_model > count_comparison_model then (count_our_model - count_comparison_model)\n -- fail the test if they are the same number\n when count_our_model = count_comparison_model then 1\n -- pass the test if the delta is positive (i.e. return the number 0)\n else 0\n end as row_count_delta\n from counts\n\n)\n\nselect * from final\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "compare_model", "type": null, "description": ""}, {"name": "group_by_columns", "type": null, "description": ""}], "created_at": 1789503443.455332, "supported_languages": null}, "macro.dbt_utils.test_not_null_proportion": {"name": "test_not_null_proportion", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/not_null_proportion.sql", "original_file_path": "macros/generic_tests/not_null_proportion.sql", "unique_id": "macro.dbt_utils.test_not_null_proportion", "macro_sql": "{% macro test_not_null_proportion(model, group_by_columns = []) %}\n {{ return(adapter.dispatch('test_not_null_proportion', 'dbt_utils')(model, group_by_columns, **kwargs)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_not_null_proportion"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "group_by_columns", "type": null, "description": ""}], "created_at": 1789503443.4562414, "supported_languages": null}, "macro.dbt_utils.default__test_not_null_proportion": {"name": "default__test_not_null_proportion", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/not_null_proportion.sql", "original_file_path": "macros/generic_tests/not_null_proportion.sql", "unique_id": "macro.dbt_utils.default__test_not_null_proportion", "macro_sql": "{% macro default__test_not_null_proportion(model, group_by_columns) %}\n\n{% set column_name = kwargs.get('column_name', kwargs.get('arg')) %}\n{% set at_least = kwargs.get('at_least', kwargs.get('arg')) %}\n{% set at_most = kwargs.get('at_most', kwargs.get('arg', 1)) %}\n\n{% if group_by_columns|length() > 0 %}\n {% set select_gb_cols = group_by_columns|join(' ,') + ', ' %}\n {% set groupby_gb_cols = 'group by ' + group_by_columns|join(',') %}\n{% endif %}\n\nwith validation as (\n select\n {{select_gb_cols}}\n sum(case when {{ column_name }} is null then 0 else 1 end) / cast(count(*) as {{ dbt.type_numeric() }}) as not_null_proportion\n from {{ model }}\n {{groupby_gb_cols}}\n),\nvalidation_errors as (\n select\n {{select_gb_cols}}\n not_null_proportion\n from validation\n where not_null_proportion < {{ at_least }} or not_null_proportion > {{ at_most }}\n)\nselect\n *\nfrom validation_errors\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.type_numeric"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "group_by_columns", "type": null, "description": ""}], "created_at": 1789503443.4579287, "supported_languages": null}, "macro.dbt_utils.test_equal_rowcount": {"name": "test_equal_rowcount", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/equal_rowcount.sql", "original_file_path": "macros/generic_tests/equal_rowcount.sql", "unique_id": "macro.dbt_utils.test_equal_rowcount", "macro_sql": "{% test equal_rowcount(model, compare_model, group_by_columns = []) %}\n {{ return(adapter.dispatch('test_equal_rowcount', 'dbt_utils')(model, compare_model, group_by_columns)) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_equal_rowcount"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "compare_model", "type": null, "description": ""}, {"name": "group_by_columns", "type": null, "description": ""}], "created_at": 1789503443.4590883, "supported_languages": null}, "macro.dbt_utils.default__test_equal_rowcount": {"name": "default__test_equal_rowcount", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/equal_rowcount.sql", "original_file_path": "macros/generic_tests/equal_rowcount.sql", "unique_id": "macro.dbt_utils.default__test_equal_rowcount", "macro_sql": "{% macro default__test_equal_rowcount(model, compare_model, group_by_columns) %}\n\n{#-- Needs to be set at parse time, before we return '' below --#}\n{{ config(fail_calc = 'sum(coalesce(diff_count, 0))') }}\n\n{#-- Prevent querying of db in parsing mode. This works because this macro does not create any new refs. #}\n{%- if not execute -%}\n {{ return('') }}\n{% endif %}\n\n{% if group_by_columns|length() > 0 %}\n {% set select_gb_cols = group_by_columns|join(', ') + ', ' %}\n {% set join_gb_cols %}\n {% for c in group_by_columns %}\n and a.{{c}} = b.{{c}}\n {% endfor %}\n {% endset %}\n {% set groupby_gb_cols = 'group by ' + group_by_columns|join(',') %}\n{% endif %}\n\n{#-- We must add a fake join key in case additional grouping variables are not provided --#}\n{#-- Redshift does not allow for dynamically created join conditions (e.g. full join on 1 = 1 --#}\n{#-- The same logic is used in fewer_rows_than. In case of changes, maintain consistent logic --#}\n{% set group_by_columns = ['id_dbtutils_test_equal_rowcount'] + group_by_columns %}\n{% set groupby_gb_cols = 'group by ' + group_by_columns|join(',') %}\n\nwith a as (\n\n select \n {{select_gb_cols}}\n 1 as id_dbtutils_test_equal_rowcount,\n count(*) as count_a \n from {{ model }}\n {{groupby_gb_cols}}\n\n\n),\nb as (\n\n select \n {{select_gb_cols}}\n 1 as id_dbtutils_test_equal_rowcount,\n count(*) as count_b \n from {{ compare_model }}\n {{groupby_gb_cols}}\n\n),\nfinal as (\n\n select\n \n {% for c in group_by_columns -%}\n a.{{c}} as {{c}}_a,\n b.{{c}} as {{c}}_b,\n {% endfor %}\n\n count_a,\n count_b,\n abs(count_a - count_b) as diff_count\n\n from a\n full join b\n on\n a.id_dbtutils_test_equal_rowcount = b.id_dbtutils_test_equal_rowcount\n {{join_gb_cols}}\n\n\n)\n\nselect * from final\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "compare_model", "type": null, "description": ""}, {"name": "group_by_columns", "type": null, "description": ""}], "created_at": 1789503443.4612472, "supported_languages": null}, "macro.dbt_utils.test_sequential_values": {"name": "test_sequential_values", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/sequential_values.sql", "original_file_path": "macros/generic_tests/sequential_values.sql", "unique_id": "macro.dbt_utils.test_sequential_values", "macro_sql": "{% test sequential_values(model, column_name, interval=1, datepart=None, group_by_columns = []) %}\n\n {{ return(adapter.dispatch('test_sequential_values', 'dbt_utils')(model, column_name, interval, datepart, group_by_columns)) }}\n\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_sequential_values"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "column_name", "type": null, "description": ""}, {"name": "interval", "type": null, "description": ""}, {"name": "datepart", "type": null, "description": ""}, {"name": "group_by_columns", "type": null, "description": ""}], "created_at": 1789503443.4623156, "supported_languages": null}, "macro.dbt_utils.default__test_sequential_values": {"name": "default__test_sequential_values", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/sequential_values.sql", "original_file_path": "macros/generic_tests/sequential_values.sql", "unique_id": "macro.dbt_utils.default__test_sequential_values", "macro_sql": "{% macro default__test_sequential_values(model, column_name, interval=1, datepart=None, group_by_columns = []) %}\n\n{% set previous_column_name = \"previous_\" ~ dbt_utils.slugify(column_name) %}\n\n{% if group_by_columns|length() > 0 %}\n {% set select_gb_cols = group_by_columns|join(',') + ', ' %}\n {% set partition_gb_cols = 'partition by ' + group_by_columns|join(',') %}\n{% endif %}\n\nwith windowed as (\n\n select\n {{ select_gb_cols }}\n {{ column_name }},\n lag({{ column_name }}) over (\n {{partition_gb_cols}}\n order by {{ column_name }}\n ) as {{ previous_column_name }}\n from {{ model }}\n),\n\nvalidation_errors as (\n select\n *\n from windowed\n {% if datepart %}\n where not(cast({{ column_name }} as {{ dbt.type_timestamp() }})= cast({{ dbt.dateadd(datepart, interval, previous_column_name) }} as {{ dbt.type_timestamp() }}))\n {% else %}\n where not({{ column_name }} = {{ previous_column_name }} + {{ interval }})\n {% endif %}\n)\n\nselect *\nfrom validation_errors\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.slugify", "macro.dbt.type_timestamp", "macro.dbt.dateadd"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "column_name", "type": null, "description": ""}, {"name": "interval", "type": null, "description": ""}, {"name": "datepart", "type": null, "description": ""}, {"name": "group_by_columns", "type": null, "description": ""}], "created_at": 1789503443.4641488, "supported_languages": null}, "macro.dbt_utils.test_mutually_exclusive_ranges": {"name": "test_mutually_exclusive_ranges", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/mutually_exclusive_ranges.sql", "original_file_path": "macros/generic_tests/mutually_exclusive_ranges.sql", "unique_id": "macro.dbt_utils.test_mutually_exclusive_ranges", "macro_sql": "{% test mutually_exclusive_ranges(model, lower_bound_column, upper_bound_column, partition_by=None, gaps='allowed', zero_length_range_allowed=False) %}\n {{ return(adapter.dispatch('test_mutually_exclusive_ranges', 'dbt_utils')(model, lower_bound_column, upper_bound_column, partition_by, gaps, zero_length_range_allowed)) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_mutually_exclusive_ranges"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "lower_bound_column", "type": null, "description": ""}, {"name": "upper_bound_column", "type": null, "description": ""}, {"name": "partition_by", "type": null, "description": ""}, {"name": "gaps", "type": null, "description": ""}, {"name": "zero_length_range_allowed", "type": null, "description": ""}], "created_at": 1789503443.4656878, "supported_languages": null}, "macro.dbt_utils.default__test_mutually_exclusive_ranges": {"name": "default__test_mutually_exclusive_ranges", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/mutually_exclusive_ranges.sql", "original_file_path": "macros/generic_tests/mutually_exclusive_ranges.sql", "unique_id": "macro.dbt_utils.default__test_mutually_exclusive_ranges", "macro_sql": "{% macro default__test_mutually_exclusive_ranges(model, lower_bound_column, upper_bound_column, partition_by=None, gaps='allowed', zero_length_range_allowed=False) %}\n{% if gaps == 'not_allowed' %}\n {% set allow_gaps_operator='=' %}\n {% set allow_gaps_operator_in_words='equal_to' %}\n{% elif gaps == 'allowed' %}\n {% set allow_gaps_operator='<=' %}\n {% set allow_gaps_operator_in_words='less_than_or_equal_to' %}\n{% elif gaps == 'required' %}\n {% set allow_gaps_operator='<' %}\n {% set allow_gaps_operator_in_words='less_than' %}\n{% else %}\n {{ exceptions.raise_compiler_error(\n \"`gaps` argument for mutually_exclusive_ranges test must be one of ['not_allowed', 'allowed', 'required'] Got: '\" ~ gaps ~\"'.'\"\n ) }}\n{% endif %}\n{% if not zero_length_range_allowed %}\n {% set allow_zero_length_operator='<' %}\n {% set allow_zero_length_operator_in_words='less_than' %}\n{% elif zero_length_range_allowed %}\n {% set allow_zero_length_operator='<=' %}\n {% set allow_zero_length_operator_in_words='less_than_or_equal_to' %}\n{% else %}\n {{ exceptions.raise_compiler_error(\n \"`zero_length_range_allowed` argument for mutually_exclusive_ranges test must be one of [true, false] Got: '\" ~ zero_length_range_allowed ~\"'.'\"\n ) }}\n{% endif %}\n\n{% set partition_clause=\"partition by \" ~ partition_by if partition_by else '' %}\n\nwith window_functions as (\n\n select\n {% if partition_by %}\n {{ partition_by }} as partition_by_col,\n {% endif %}\n {{ lower_bound_column }} as lower_bound,\n {{ upper_bound_column }} as upper_bound,\n\n lead({{ lower_bound_column }}) over (\n {{ partition_clause }}\n order by {{ lower_bound_column }}, {{ upper_bound_column }}\n ) as next_lower_bound,\n\n row_number() over (\n {{ partition_clause }}\n order by {{ lower_bound_column }} desc, {{ upper_bound_column }} desc\n ) = 1 as is_last_record\n\n from {{ model }}\n\n),\n\ncalc as (\n -- We want to return records where one of our assumptions fails, so we'll use\n -- the `not` function with `and` statements so we can write our assumptions more cleanly\n select\n *,\n\n -- For each record: lower_bound should be < upper_bound.\n -- Coalesce it to return an error on the null case (implicit assumption\n -- these columns are not_null)\n coalesce(\n lower_bound {{ allow_zero_length_operator }} upper_bound,\n false\n ) as lower_bound_{{ allow_zero_length_operator_in_words }}_upper_bound,\n\n -- For each record: upper_bound {{ allow_gaps_operator }} the next lower_bound.\n -- Coalesce it to handle null cases for the last record.\n coalesce(\n upper_bound {{ allow_gaps_operator }} next_lower_bound,\n is_last_record,\n false\n ) as upper_bound_{{ allow_gaps_operator_in_words }}_next_lower_bound\n\n from window_functions\n\n),\n\nvalidation_errors as (\n\n select\n *\n from calc\n\n where not(\n -- THE FOLLOWING SHOULD BE TRUE --\n lower_bound_{{ allow_zero_length_operator_in_words }}_upper_bound\n and upper_bound_{{ allow_gaps_operator_in_words }}_next_lower_bound\n )\n)\n\nselect * from validation_errors\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "lower_bound_column", "type": null, "description": ""}, {"name": "upper_bound_column", "type": null, "description": ""}, {"name": "partition_by", "type": null, "description": ""}, {"name": "gaps", "type": null, "description": ""}, {"name": "zero_length_range_allowed", "type": null, "description": ""}], "created_at": 1789503443.4691455, "supported_languages": null}, "macro.dbt_utils.test_cardinality_equality": {"name": "test_cardinality_equality", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/cardinality_equality.sql", "original_file_path": "macros/generic_tests/cardinality_equality.sql", "unique_id": "macro.dbt_utils.test_cardinality_equality", "macro_sql": "{% test cardinality_equality(model, column_name, to, field) %}\n {{ return(adapter.dispatch('test_cardinality_equality', 'dbt_utils')(model, column_name, to, field)) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_cardinality_equality"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "column_name", "type": null, "description": ""}, {"name": "to", "type": null, "description": ""}, {"name": "field", "type": null, "description": ""}], "created_at": 1789503443.4699173, "supported_languages": null}, "macro.dbt_utils.default__test_cardinality_equality": {"name": "default__test_cardinality_equality", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/cardinality_equality.sql", "original_file_path": "macros/generic_tests/cardinality_equality.sql", "unique_id": "macro.dbt_utils.default__test_cardinality_equality", "macro_sql": "{% macro default__test_cardinality_equality(model, column_name, to, field) %}\n\n{# T-SQL does not let you use numbers as aliases for columns #}\n{# Thus, no \"GROUP BY 1\" #}\n\nwith table_a as (\nselect\n {{ column_name }},\n count(*) as num_rows\nfrom {{ model }}\ngroup by {{ column_name }}\n),\n\ntable_b as (\nselect\n {{ field }},\n count(*) as num_rows\nfrom {{ to }}\ngroup by {{ field }}\n),\n\nexcept_a as (\n select *\n from table_a\n {{ dbt.except() }}\n select *\n from table_b\n),\n\nexcept_b as (\n select *\n from table_b\n {{ dbt.except() }}\n select *\n from table_a\n),\n\nunioned as (\n select *\n from except_a\n union all\n select *\n from except_b\n)\n\nselect *\nfrom unioned\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.except"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "column_name", "type": null, "description": ""}, {"name": "to", "type": null, "description": ""}, {"name": "field", "type": null, "description": ""}], "created_at": 1789503443.4706316, "supported_languages": null}, "macro.dbt_utils.test_relationships_where": {"name": "test_relationships_where", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/relationships_where.sql", "original_file_path": "macros/generic_tests/relationships_where.sql", "unique_id": "macro.dbt_utils.test_relationships_where", "macro_sql": "{% test relationships_where(model, column_name, to, field, from_condition=\"1=1\", to_condition=\"1=1\") %}\n {{ return(adapter.dispatch('test_relationships_where', 'dbt_utils')(model, column_name, to, field, from_condition, to_condition)) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_relationships_where"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "column_name", "type": null, "description": ""}, {"name": "to", "type": null, "description": ""}, {"name": "field", "type": null, "description": ""}, {"name": "from_condition", "type": null, "description": ""}, {"name": "to_condition", "type": null, "description": ""}], "created_at": 1789503443.4715502, "supported_languages": null}, "macro.dbt_utils.default__test_relationships_where": {"name": "default__test_relationships_where", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/relationships_where.sql", "original_file_path": "macros/generic_tests/relationships_where.sql", "unique_id": "macro.dbt_utils.default__test_relationships_where", "macro_sql": "{% macro default__test_relationships_where(model, column_name, to, field, from_condition=\"1=1\", to_condition=\"1=1\") %}\n\n{# T-SQL has no boolean data type so we use 1=1 which returns TRUE #}\n{# ref https://stackoverflow.com/a/7170753/3842610 #}\n\nwith left_table as (\n\n select\n {{column_name}} as id\n\n from {{model}}\n\n where {{column_name}} is not null\n and {{from_condition}}\n\n),\n\nright_table as (\n\n select\n {{field}} as id\n\n from {{to}}\n\n where {{field}} is not null\n and {{to_condition}}\n\n),\n\nexceptions as (\n\n select\n left_table.id,\n right_table.id as right_id\n\n from left_table\n\n left join right_table\n on left_table.id = right_table.id\n\n where right_table.id is null\n\n)\n\nselect * from exceptions\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "column_name", "type": null, "description": ""}, {"name": "to", "type": null, "description": ""}, {"name": "field", "type": null, "description": ""}, {"name": "from_condition", "type": null, "description": ""}, {"name": "to_condition", "type": null, "description": ""}], "created_at": 1789503443.4722698, "supported_languages": null}, "macro.dbt_utils.test_expression_is_true": {"name": "test_expression_is_true", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/expression_is_true.sql", "original_file_path": "macros/generic_tests/expression_is_true.sql", "unique_id": "macro.dbt_utils.test_expression_is_true", "macro_sql": "{% test expression_is_true(model, expression, column_name=None) %}\n {{ return(adapter.dispatch('test_expression_is_true', 'dbt_utils')(model, expression, column_name)) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_expression_is_true"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "expression", "type": null, "description": ""}, {"name": "column_name", "type": null, "description": ""}], "created_at": 1789503443.473004, "supported_languages": null}, "macro.dbt_utils.default__test_expression_is_true": {"name": "default__test_expression_is_true", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/expression_is_true.sql", "original_file_path": "macros/generic_tests/expression_is_true.sql", "unique_id": "macro.dbt_utils.default__test_expression_is_true", "macro_sql": "{% macro default__test_expression_is_true(model, expression, column_name) %}\n\n{% set column_list = '*' if should_store_failures() else \"1\" %}\n\nselect\n {{ column_list }}\nfrom {{ model }}\n{% if column_name is none %}\nwhere not({{ expression }})\n{%- else %}\nwhere not({{ column_name }} {{ expression }})\n{%- endif %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.should_store_failures"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "expression", "type": null, "description": ""}, {"name": "column_name", "type": null, "description": ""}], "created_at": 1789503443.47374, "supported_languages": null}, "macro.dbt_utils.test_not_accepted_values": {"name": "test_not_accepted_values", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/not_accepted_values.sql", "original_file_path": "macros/generic_tests/not_accepted_values.sql", "unique_id": "macro.dbt_utils.test_not_accepted_values", "macro_sql": "{% test not_accepted_values(model, column_name, values, quote=True) %}\n {{ return(adapter.dispatch('test_not_accepted_values', 'dbt_utils')(model, column_name, values, quote)) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_not_accepted_values"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "column_name", "type": null, "description": ""}, {"name": "values", "type": null, "description": ""}, {"name": "quote", "type": null, "description": ""}], "created_at": 1789503443.4745634, "supported_languages": null}, "macro.dbt_utils.default__test_not_accepted_values": {"name": "default__test_not_accepted_values", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/not_accepted_values.sql", "original_file_path": "macros/generic_tests/not_accepted_values.sql", "unique_id": "macro.dbt_utils.default__test_not_accepted_values", "macro_sql": "{% macro default__test_not_accepted_values(model, column_name, values, quote=True) %}\nwith all_values as (\n\n select distinct\n {{ column_name }} as value_field\n\n from {{ model }}\n\n),\n\nvalidation_errors as (\n\n select\n value_field\n\n from all_values\n where value_field in (\n {% for value in values -%}\n {% if quote -%}\n '{{ value }}'\n {%- else -%}\n {{ value }}\n {%- endif -%}\n {%- if not loop.last -%},{%- endif %}\n {%- endfor %}\n )\n\n)\n\nselect *\nfrom validation_errors\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "column_name", "type": null, "description": ""}, {"name": "values", "type": null, "description": ""}, {"name": "quote", "type": null, "description": ""}], "created_at": 1789503443.4753792, "supported_languages": null}, "macro.dbt_utils.test_accepted_range": {"name": "test_accepted_range", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/accepted_range.sql", "original_file_path": "macros/generic_tests/accepted_range.sql", "unique_id": "macro.dbt_utils.test_accepted_range", "macro_sql": "{% test accepted_range(model, column_name, min_value=none, max_value=none, inclusive=true) %}\n {{ return(adapter.dispatch('test_accepted_range', 'dbt_utils')(model, column_name, min_value, max_value, inclusive)) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_accepted_range"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "column_name", "type": null, "description": ""}, {"name": "min_value", "type": null, "description": ""}, {"name": "max_value", "type": null, "description": ""}, {"name": "inclusive", "type": null, "description": ""}], "created_at": 1789503443.476318, "supported_languages": null}, "macro.dbt_utils.default__test_accepted_range": {"name": "default__test_accepted_range", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/accepted_range.sql", "original_file_path": "macros/generic_tests/accepted_range.sql", "unique_id": "macro.dbt_utils.default__test_accepted_range", "macro_sql": "{% macro default__test_accepted_range(model, column_name, min_value=none, max_value=none, inclusive=true) %}\n\nwith meet_condition as(\n select *\n from {{ model }}\n),\n\nvalidation_errors as (\n select *\n from meet_condition\n where\n -- never true, defaults to an empty result set. Exists to ensure any combo of the `or` clauses below succeeds\n 1 = 2\n\n {%- if min_value is not none %}\n -- records with a value >= min_value are permitted. The `not` flips this to find records that don't meet the rule.\n or not {{ column_name }} > {{- \"=\" if inclusive }} {{ min_value }}\n {%- endif %}\n\n {%- if max_value is not none %}\n -- records with a value <= max_value are permitted. The `not` flips this to find records that don't meet the rule.\n or not {{ column_name }} < {{- \"=\" if inclusive }} {{ max_value }}\n {%- endif %}\n)\n\nselect *\nfrom validation_errors\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "model", "type": null, "description": ""}, {"name": "column_name", "type": null, "description": ""}, {"name": "min_value", "type": null, "description": ""}, {"name": "max_value", "type": null, "description": ""}, {"name": "inclusive", "type": null, "description": ""}], "created_at": 1789503443.4773066, "supported_languages": null}, "macro.dbt_utils.get_url_parameter": {"name": "get_url_parameter", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/web/get_url_parameter.sql", "original_file_path": "macros/web/get_url_parameter.sql", "unique_id": "macro.dbt_utils.get_url_parameter", "macro_sql": "{% macro get_url_parameter(field, url_parameter) -%}\n {{ return(adapter.dispatch('get_url_parameter', 'dbt_utils')(field, url_parameter)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__get_url_parameter"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field", "type": null, "description": ""}, {"name": "url_parameter", "type": null, "description": ""}], "created_at": 1789503443.4779115, "supported_languages": null}, "macro.dbt_utils.default__get_url_parameter": {"name": "default__get_url_parameter", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/web/get_url_parameter.sql", "original_file_path": "macros/web/get_url_parameter.sql", "unique_id": "macro.dbt_utils.default__get_url_parameter", "macro_sql": "{% macro default__get_url_parameter(field, url_parameter) -%}\n\n{%- set formatted_url_parameter = \"'\" + url_parameter + \"='\" -%}\n\n{%- set split = dbt.split_part(dbt.split_part(field, formatted_url_parameter, 2), \"'&'\", 1) -%}\n\nnullif({{ split }},'')\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.split_part"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field", "type": null, "description": ""}, {"name": "url_parameter", "type": null, "description": ""}], "created_at": 1789503443.4785855, "supported_languages": null}, "macro.dbt_utils.get_url_host": {"name": "get_url_host", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/web/get_url_host.sql", "original_file_path": "macros/web/get_url_host.sql", "unique_id": "macro.dbt_utils.get_url_host", "macro_sql": "{% macro get_url_host(field) -%}\n {{ return(adapter.dispatch('get_url_host', 'dbt_utils')(field)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__get_url_host"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field", "type": null, "description": ""}], "created_at": 1789503443.4791994, "supported_languages": null}, "macro.dbt_utils.default__get_url_host": {"name": "default__get_url_host", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/web/get_url_host.sql", "original_file_path": "macros/web/get_url_host.sql", "unique_id": "macro.dbt_utils.default__get_url_host", "macro_sql": "{% macro default__get_url_host(field) -%}\n\n{%- set parsed =\n dbt.split_part(\n dbt.split_part(\n dbt.replace(\n dbt.replace(\n dbt.replace(field, \"'android-app://'\", \"''\"\n ), \"'http://'\", \"''\"\n ), \"'https://'\", \"''\"\n ), \"'/'\", 1\n ), \"'?'\", 1\n )\n\n-%}\n\n\n {{ dbt.safe_cast(\n parsed,\n dbt.type_string()\n )}}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.split_part", "macro.dbt.replace", "macro.dbt.safe_cast", "macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field", "type": null, "description": ""}], "created_at": 1789503443.4802585, "supported_languages": null}, "macro.dbt_utils.get_url_path": {"name": "get_url_path", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/web/get_url_path.sql", "original_file_path": "macros/web/get_url_path.sql", "unique_id": "macro.dbt_utils.get_url_path", "macro_sql": "{% macro get_url_path(field) -%}\n {{ return(adapter.dispatch('get_url_path', 'dbt_utils')(field)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__get_url_path"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field", "type": null, "description": ""}], "created_at": 1789503443.4809148, "supported_languages": null}, "macro.dbt_utils.default__get_url_path": {"name": "default__get_url_path", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/web/get_url_path.sql", "original_file_path": "macros/web/get_url_path.sql", "unique_id": "macro.dbt_utils.default__get_url_path", "macro_sql": "{% macro default__get_url_path(field) -%}\n\n {%- set stripped_url =\n dbt.replace(\n dbt.replace(field, \"'http://'\", \"''\"), \"'https://'\", \"''\")\n -%}\n\n {%- set first_slash_pos -%}\n coalesce(\n nullif({{ dbt.position(\"'/'\", stripped_url) }}, 0),\n {{ dbt.position(\"'?'\", stripped_url) }} - 1\n )\n {%- endset -%}\n\n {%- set parsed_path =\n dbt.split_part(\n dbt.right(\n stripped_url,\n dbt.length(stripped_url) ~ \"-\" ~ first_slash_pos\n ),\n \"'?'\", 1\n )\n -%}\n\n {{ dbt.safe_cast(\n parsed_path,\n dbt.type_string()\n )}}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.replace", "macro.dbt.position", "macro.dbt.split_part", "macro.dbt.right", "macro.dbt.length", "macro.dbt.safe_cast", "macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field", "type": null, "description": ""}], "created_at": 1789503443.4822476, "supported_languages": null}, "macro.dbt_utils.get_column_values": {"name": "get_column_values", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_column_values.sql", "original_file_path": "macros/sql/get_column_values.sql", "unique_id": "macro.dbt_utils.get_column_values", "macro_sql": "{% macro get_column_values(table, column, order_by='count(*) desc', max_records=none, default=none, where=none) -%}\n {{ return(adapter.dispatch('get_column_values', 'dbt_utils')(table, column, order_by, max_records, default, where)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__get_column_values"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "table", "type": null, "description": ""}, {"name": "column", "type": null, "description": ""}, {"name": "order_by", "type": null, "description": ""}, {"name": "max_records", "type": null, "description": ""}, {"name": "default", "type": null, "description": ""}, {"name": "where", "type": null, "description": ""}], "created_at": 1789503443.4836502, "supported_languages": null}, "macro.dbt_utils.default__get_column_values": {"name": "default__get_column_values", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_column_values.sql", "original_file_path": "macros/sql/get_column_values.sql", "unique_id": "macro.dbt_utils.default__get_column_values", "macro_sql": "{% macro default__get_column_values(table, column, order_by='count(*) desc', max_records=none, default=none, where=none) -%}\n {#-- Prevent querying of db in parsing mode. This works because this macro does not create any new refs. #}\n {%- if not execute -%}\n {% set default = [] if not default %}\n {{ return(default) }}\n {% endif %}\n\n {%- do dbt_utils._is_ephemeral(table, 'get_column_values') -%}\n\n {# Not all relations are tables. Renaming for internal clarity without breaking functionality for anyone using named arguments #}\n {# TODO: Change the method signature in a future 0.x.0 release #}\n {%- set target_relation = table -%}\n\n {# adapter.load_relation is a convenience wrapper to avoid building a Relation when we already have one #}\n {% set relation_exists = (load_relation(target_relation)) is not none %}\n\n {%- call statement('get_column_values', fetch_result=true) %}\n\n {%- if not relation_exists and default is none -%}\n\n {{ exceptions.raise_compiler_error(\"In get_column_values(): relation \" ~ target_relation ~ \" does not exist and no default value was provided.\") }}\n\n {%- elif not relation_exists and default is not none -%}\n\n {{ log(\"Relation \" ~ target_relation ~ \" does not exist. Returning the default value: \" ~ default) }}\n\n {{ return(default) }}\n\n {%- else -%}\n\n\n select\n {{ column }} as value\n\n from {{ target_relation }}\n\n {% if where is not none %}\n where {{ where }}\n {% endif %}\n\n group by {{ column }}\n order by {{ order_by }}\n\n {% if max_records is not none %}\n limit {{ max_records }}\n {% endif %}\n\n {% endif %}\n\n {%- endcall -%}\n\n {%- set value_list = load_result('get_column_values') -%}\n\n {%- if value_list and value_list['data'] -%}\n {%- set values = value_list['data'] | map(attribute=0) | list %}\n {{ return(values) }}\n {%- else -%}\n {{ return(default) }}\n {%- endif -%}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_utils._is_ephemeral", "macro.dbt.load_relation", "macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "table", "type": null, "description": ""}, {"name": "column", "type": null, "description": ""}, {"name": "order_by", "type": null, "description": ""}, {"name": "max_records", "type": null, "description": ""}, {"name": "default", "type": null, "description": ""}, {"name": "where", "type": null, "description": ""}], "created_at": 1789503443.4871469, "supported_languages": null}, "macro.dbt_utils.star": {"name": "star", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/star.sql", "original_file_path": "macros/sql/star.sql", "unique_id": "macro.dbt_utils.star", "macro_sql": "{% macro star(from, relation_alias=False, except=[], prefix='', suffix='', quote_identifiers=True, unquote_aliases=False, rename={}) -%}\r\n {{ return(adapter.dispatch('star', 'dbt_utils')(from, relation_alias, except, prefix, suffix, quote_identifiers, unquote_aliases, rename)) }}\r\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__star"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "from", "type": null, "description": ""}, {"name": "relation_alias", "type": null, "description": ""}, {"name": "except", "type": null, "description": ""}, {"name": "prefix", "type": null, "description": ""}, {"name": "suffix", "type": null, "description": ""}, {"name": "quote_identifiers", "type": null, "description": ""}, {"name": "unquote_aliases", "type": null, "description": ""}, {"name": "rename", "type": null, "description": ""}], "created_at": 1789503443.4888468, "supported_languages": null}, "macro.dbt_utils.default__star": {"name": "default__star", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/star.sql", "original_file_path": "macros/sql/star.sql", "unique_id": "macro.dbt_utils.default__star", "macro_sql": "{% macro default__star(from, relation_alias=False, except=[], prefix='', suffix='', quote_identifiers=True, unquote_aliases=False, rename={}) -%}\r\n {%- do dbt_utils._is_relation(from, 'star') -%}\r\n {%- do dbt_utils._is_ephemeral(from, 'star') -%}\r\n\r\n {#-- Prevent querying of db in parsing mode. This works because this macro does not create any new refs. #}\r\n {%- if not execute -%}\r\n {% do return('*') %}\r\n {%- endif -%}\r\n\r\n {% set cols = dbt_utils.get_filtered_columns_in_relation(from, except) %}\r\n\r\n {%- set rename_lower = {} -%}\r\n {%- for key, val in rename.items() -%}\r\n {%- do rename_lower.update({key.lower(): val}) -%}\r\n {%- endfor -%}\r\n\r\n {%- if cols|length <= 0 -%}\r\n {% if flags.WHICH == 'compile' %}\r\n {% set response %}\r\n*\r\n/* No columns were returned. Maybe the relation doesn't exist yet\r\nor all columns were excluded. This star is only output during\r\ndbt compile, and exists to keep SQLFluff happy. */\r\n {% endset %}\r\n {% do return(response) %}\r\n {% else %}\r\n {% do return(\"/* no columns returned from star() macro */\") %}\r\n {% endif %}\r\n {%- else -%}\r\n {%- for col in cols %}\r\n {%- if relation_alias %}{{ relation_alias }}.{% else %}{%- endif -%}\r\n {%- if quote_identifiers -%}\r\n {{ adapter.quote(col)|trim }}\r\n {%- if col.lower() in rename_lower %} as {{ rename_lower[col.lower()] }}\r\n {%- elif unquote_aliases %} as {{ (prefix ~ col ~ suffix)|trim }}\r\n {%- elif prefix!='' or suffix!='' %} as {{ adapter.quote(prefix ~ col ~ suffix)|trim }}\r\n {%- endif -%}\r\n {%- else -%}\r\n {{ col|trim }}\r\n {%- if col.lower() in rename_lower %} as {{ rename_lower[col.lower()] }}\r\n {%- elif prefix!='' or suffix!='' %} as {{ (prefix ~ col ~ suffix)|trim }}\r\n {%- endif -%}\r\n {%- endif -%}\r\n {%- if not loop.last %},{{ '\\n ' }}{%- endif -%}\r\n {%- endfor -%}\r\n {% endif %}\r\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_utils._is_relation", "macro.dbt_utils._is_ephemeral", "macro.dbt_utils.get_filtered_columns_in_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "from", "type": null, "description": ""}, {"name": "relation_alias", "type": null, "description": ""}, {"name": "except", "type": null, "description": ""}, {"name": "prefix", "type": null, "description": ""}, {"name": "suffix", "type": null, "description": ""}, {"name": "quote_identifiers", "type": null, "description": ""}, {"name": "unquote_aliases", "type": null, "description": ""}, {"name": "rename", "type": null, "description": ""}], "created_at": 1789503443.4929245, "supported_languages": null}, "macro.dbt_utils.get_table_types_sql": {"name": "get_table_types_sql", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_table_types_sql.sql", "original_file_path": "macros/sql/get_table_types_sql.sql", "unique_id": "macro.dbt_utils.get_table_types_sql", "macro_sql": "{%- macro get_table_types_sql() -%}\n {{ return(adapter.dispatch('get_table_types_sql', 'dbt_utils')()) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt_utils.postgres__get_table_types_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789503443.493613, "supported_languages": null}, "macro.dbt_utils.default__get_table_types_sql": {"name": "default__get_table_types_sql", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_table_types_sql.sql", "original_file_path": "macros/sql/get_table_types_sql.sql", "unique_id": "macro.dbt_utils.default__get_table_types_sql", "macro_sql": "{% macro default__get_table_types_sql() %}\n case table_type\n when 'BASE TABLE' then 'table'\n when 'EXTERNAL TABLE' then 'external'\n when 'MATERIALIZED VIEW' then 'materializedview'\n else lower(table_type)\n end as {{ adapter.quote('table_type') }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789503443.4939067, "supported_languages": null}, "macro.dbt_utils.postgres__get_table_types_sql": {"name": "postgres__get_table_types_sql", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_table_types_sql.sql", "original_file_path": "macros/sql/get_table_types_sql.sql", "unique_id": "macro.dbt_utils.postgres__get_table_types_sql", "macro_sql": "{% macro postgres__get_table_types_sql() %}\n case table_type\n when 'BASE TABLE' then 'table'\n when 'FOREIGN' then 'external'\n when 'MATERIALIZED VIEW' then 'materializedview'\n else lower(table_type)\n end as {{ adapter.quote('table_type') }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789503443.4942167, "supported_languages": null}, "macro.dbt_utils.databricks__get_table_types_sql": {"name": "databricks__get_table_types_sql", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_table_types_sql.sql", "original_file_path": "macros/sql/get_table_types_sql.sql", "unique_id": "macro.dbt_utils.databricks__get_table_types_sql", "macro_sql": "{% macro databricks__get_table_types_sql() %}\n case table_type\n when 'MANAGED' then 'table'\n when 'BASE TABLE' then 'table'\n when 'MATERIALIZED VIEW' then 'materializedview'\n else lower(table_type)\n end as {{ adapter.quote('table_type') }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789503443.4945004, "supported_languages": null}, "macro.dbt_utils.get_tables_by_pattern_sql": {"name": "get_tables_by_pattern_sql", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_tables_by_pattern_sql.sql", "original_file_path": "macros/sql/get_tables_by_pattern_sql.sql", "unique_id": "macro.dbt_utils.get_tables_by_pattern_sql", "macro_sql": "{% macro get_tables_by_pattern_sql(schema_pattern, table_pattern, exclude='', database=target.database) %}\n {{ return(adapter.dispatch('get_tables_by_pattern_sql', 'dbt_utils')\n (schema_pattern, table_pattern, exclude, database)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__get_tables_by_pattern_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "schema_pattern", "type": null, "description": ""}, {"name": "table_pattern", "type": null, "description": ""}, {"name": "exclude", "type": null, "description": ""}, {"name": "database", "type": null, "description": ""}], "created_at": 1789503443.4960797, "supported_languages": null}, "macro.dbt_utils.default__get_tables_by_pattern_sql": {"name": "default__get_tables_by_pattern_sql", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_tables_by_pattern_sql.sql", "original_file_path": "macros/sql/get_tables_by_pattern_sql.sql", "unique_id": "macro.dbt_utils.default__get_tables_by_pattern_sql", "macro_sql": "{% macro default__get_tables_by_pattern_sql(schema_pattern, table_pattern, exclude='', database=target.database) %}\n\n select distinct\n table_schema as {{ adapter.quote('table_schema') }},\n table_name as {{ adapter.quote('table_name') }},\n {{ dbt_utils.get_table_types_sql() }}\n from {{ database }}.information_schema.tables\n where table_schema ilike '{{ schema_pattern }}'\n and table_name ilike '{{ table_pattern }}'\n and table_name not ilike '{{ exclude }}'\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.get_table_types_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "schema_pattern", "type": null, "description": ""}, {"name": "table_pattern", "type": null, "description": ""}, {"name": "exclude", "type": null, "description": ""}, {"name": "database", "type": null, "description": ""}], "created_at": 1789503443.4968176, "supported_languages": null}, "macro.dbt_utils.redshift__get_tables_by_pattern_sql": {"name": "redshift__get_tables_by_pattern_sql", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_tables_by_pattern_sql.sql", "original_file_path": "macros/sql/get_tables_by_pattern_sql.sql", "unique_id": "macro.dbt_utils.redshift__get_tables_by_pattern_sql", "macro_sql": "{% macro redshift__get_tables_by_pattern_sql(schema_pattern, table_pattern, exclude='', database=target.database) %}\n\n {% set sql %}\n select distinct\n table_schema as {{ adapter.quote('table_schema') }},\n table_name as {{ adapter.quote('table_name') }},\n {{ dbt_utils.get_table_types_sql() }}\n from \"{{ database }}\".\"information_schema\".\"tables\"\n where table_schema ilike '{{ schema_pattern }}'\n and table_name ilike '{{ table_pattern }}'\n and table_name not ilike '{{ exclude }}'\n union all\n select distinct\n schemaname as {{ adapter.quote('table_schema') }},\n tablename as {{ adapter.quote('table_name') }},\n 'external' as {{ adapter.quote('table_type') }}\n from svv_external_tables\n where redshift_database_name = '{{ database }}'\n and schemaname ilike '{{ schema_pattern }}'\n and table_name ilike '{{ table_pattern }}'\n and table_name not ilike '{{ exclude }}'\n {% endset %}\n\n {{ return(sql) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.get_table_types_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "schema_pattern", "type": null, "description": ""}, {"name": "table_pattern", "type": null, "description": ""}, {"name": "exclude", "type": null, "description": ""}, {"name": "database", "type": null, "description": ""}], "created_at": 1789503443.4982054, "supported_languages": null}, "macro.dbt_utils.bigquery__get_tables_by_pattern_sql": {"name": "bigquery__get_tables_by_pattern_sql", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_tables_by_pattern_sql.sql", "original_file_path": "macros/sql/get_tables_by_pattern_sql.sql", "unique_id": "macro.dbt_utils.bigquery__get_tables_by_pattern_sql", "macro_sql": "{% macro bigquery__get_tables_by_pattern_sql(schema_pattern, table_pattern, exclude='', database=target.database) %}\n\n {% if '%' in schema_pattern %}\n {% set schemata=dbt_utils._bigquery__get_matching_schemata(schema_pattern, database) %}\n {% else %}\n {% set schemata=[schema_pattern] %}\n {% endif %}\n\n {% set sql %}\n {% for schema in schemata %}\n select distinct\n table_schema,\n table_name,\n {{ dbt_utils.get_table_types_sql() }}\n\n from {{ adapter.quote(database) }}.{{ schema }}.INFORMATION_SCHEMA.TABLES\n where lower(table_name) like lower ('{{ table_pattern }}')\n and lower(table_name) not like lower ('{{ exclude }}')\n\n {% if not loop.last %} union all {% endif %}\n\n {% endfor %}\n {% endset %}\n\n {{ return(sql) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils._bigquery__get_matching_schemata", "macro.dbt_utils.get_table_types_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "schema_pattern", "type": null, "description": ""}, {"name": "table_pattern", "type": null, "description": ""}, {"name": "exclude", "type": null, "description": ""}, {"name": "database", "type": null, "description": ""}], "created_at": 1789503443.4996405, "supported_languages": null}, "macro.dbt_utils._bigquery__get_matching_schemata": {"name": "_bigquery__get_matching_schemata", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_tables_by_pattern_sql.sql", "original_file_path": "macros/sql/get_tables_by_pattern_sql.sql", "unique_id": "macro.dbt_utils._bigquery__get_matching_schemata", "macro_sql": "{% macro _bigquery__get_matching_schemata(schema_pattern, database) %}\n {% if execute %}\n\n {% set sql %}\n select schema_name from {{ adapter.quote(database) }}.INFORMATION_SCHEMA.SCHEMATA\n where lower(schema_name) like lower('{{ schema_pattern }}')\n {% endset %}\n\n {% set results=run_query(sql) %}\n\n {% set schemata=results.columns['schema_name'].values() %}\n\n {{ return(schemata) }}\n\n {% else %}\n\n {{ return([]) }}\n\n {% endif %}\n\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "schema_pattern", "type": null, "description": ""}, {"name": "database", "type": null, "description": ""}], "created_at": 1789503443.5006695, "supported_languages": null}, "macro.dbt_utils.get_tables_by_prefix_sql": {"name": "get_tables_by_prefix_sql", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_tables_by_prefix_sql.sql", "original_file_path": "macros/sql/get_tables_by_prefix_sql.sql", "unique_id": "macro.dbt_utils.get_tables_by_prefix_sql", "macro_sql": "{% macro get_tables_by_prefix_sql(schema, prefix, exclude='', database=target.database) %}\n {{ return(adapter.dispatch('get_tables_by_prefix_sql', 'dbt_utils')(schema, prefix, exclude, database)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__get_tables_by_prefix_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "schema", "type": null, "description": ""}, {"name": "prefix", "type": null, "description": ""}, {"name": "exclude", "type": null, "description": ""}, {"name": "database", "type": null, "description": ""}], "created_at": 1789503443.5014434, "supported_languages": null}, "macro.dbt_utils.default__get_tables_by_prefix_sql": {"name": "default__get_tables_by_prefix_sql", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_tables_by_prefix_sql.sql", "original_file_path": "macros/sql/get_tables_by_prefix_sql.sql", "unique_id": "macro.dbt_utils.default__get_tables_by_prefix_sql", "macro_sql": "{% macro default__get_tables_by_prefix_sql(schema, prefix, exclude='', database=target.database) %}\n\n {{ dbt_utils.get_tables_by_pattern_sql(\n schema_pattern = schema,\n table_pattern = prefix ~ '%',\n exclude = exclude,\n database = database\n ) }}\n \n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.get_tables_by_pattern_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "schema", "type": null, "description": ""}, {"name": "prefix", "type": null, "description": ""}, {"name": "exclude", "type": null, "description": ""}, {"name": "database", "type": null, "description": ""}], "created_at": 1789503443.502039, "supported_languages": null}, "macro.dbt_utils.degrees_to_radians": {"name": "degrees_to_radians", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/haversine_distance.sql", "original_file_path": "macros/sql/haversine_distance.sql", "unique_id": "macro.dbt_utils.degrees_to_radians", "macro_sql": "{% macro degrees_to_radians(degrees) -%}\n acos(-1) * {{degrees}} / 180\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "degrees", "type": null, "description": ""}], "created_at": 1789503443.502881, "supported_languages": null}, "macro.dbt_utils.haversine_distance": {"name": "haversine_distance", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/haversine_distance.sql", "original_file_path": "macros/sql/haversine_distance.sql", "unique_id": "macro.dbt_utils.haversine_distance", "macro_sql": "{% macro haversine_distance(lat1, lon1, lat2, lon2, unit='mi') -%}\n {{ return(adapter.dispatch('haversine_distance', 'dbt_utils')(lat1,lon1,lat2,lon2,unit)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__haversine_distance"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "lat1", "type": null, "description": ""}, {"name": "lon1", "type": null, "description": ""}, {"name": "lat2", "type": null, "description": ""}, {"name": "lon2", "type": null, "description": ""}, {"name": "unit", "type": null, "description": ""}], "created_at": 1789503443.5034692, "supported_languages": null}, "macro.dbt_utils.default__haversine_distance": {"name": "default__haversine_distance", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/haversine_distance.sql", "original_file_path": "macros/sql/haversine_distance.sql", "unique_id": "macro.dbt_utils.default__haversine_distance", "macro_sql": "{% macro default__haversine_distance(lat1, lon1, lat2, lon2, unit='mi') -%}\n{%- if unit == 'mi' %}\n {% set conversion_rate = 1 %}\n{% elif unit == 'km' %}\n {% set conversion_rate = 1.60934 %}\n{% else %}\n {{ exceptions.raise_compiler_error(\"unit input must be one of 'mi' or 'km'. Got \" ~ unit) }}\n{% endif %}\n\n 2 * 3961 * asin(sqrt(power((sin(radians(({{ lat2 }} - {{ lat1 }}) / 2))), 2) +\n cos(radians({{lat1}})) * cos(radians({{lat2}})) *\n power((sin(radians(({{ lon2 }} - {{ lon1 }}) / 2))), 2))) * {{ conversion_rate }}\n\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "lat1", "type": null, "description": ""}, {"name": "lon1", "type": null, "description": ""}, {"name": "lat2", "type": null, "description": ""}, {"name": "lon2", "type": null, "description": ""}, {"name": "unit", "type": null, "description": ""}], "created_at": 1789503443.504724, "supported_languages": null}, "macro.dbt_utils.bigquery__haversine_distance": {"name": "bigquery__haversine_distance", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/haversine_distance.sql", "original_file_path": "macros/sql/haversine_distance.sql", "unique_id": "macro.dbt_utils.bigquery__haversine_distance", "macro_sql": "{% macro bigquery__haversine_distance(lat1, lon1, lat2, lon2, unit='mi') -%}\n{% set radians_lat1 = dbt_utils.degrees_to_radians(lat1) %}\n{% set radians_lat2 = dbt_utils.degrees_to_radians(lat2) %}\n{% set radians_lon1 = dbt_utils.degrees_to_radians(lon1) %}\n{% set radians_lon2 = dbt_utils.degrees_to_radians(lon2) %}\n{%- if unit == 'mi' %}\n {% set conversion_rate = 1 %}\n{% elif unit == 'km' %}\n {% set conversion_rate = 1.60934 %}\n{% else %}\n {{ exceptions.raise_compiler_error(\"unit input must be one of 'mi' or 'km'. Got \" ~ unit) }}\n{% endif %}\n 2 * 3961 * asin(sqrt(power(sin(({{ radians_lat2 }} - {{ radians_lat1 }}) / 2), 2) +\n cos({{ radians_lat1 }}) * cos({{ radians_lat2 }}) *\n power(sin(({{ radians_lon2 }} - {{ radians_lon1 }}) / 2), 2))) * {{ conversion_rate }}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.degrees_to_radians"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "lat1", "type": null, "description": ""}, {"name": "lon1", "type": null, "description": ""}, {"name": "lat2", "type": null, "description": ""}, {"name": "lon2", "type": null, "description": ""}, {"name": "unit", "type": null, "description": ""}], "created_at": 1789503443.5063958, "supported_languages": null}, "macro.dbt_utils.get_powers_of_two": {"name": "get_powers_of_two", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/generate_series.sql", "original_file_path": "macros/sql/generate_series.sql", "unique_id": "macro.dbt_utils.get_powers_of_two", "macro_sql": "{% macro get_powers_of_two(upper_bound) %}\n {{ return(adapter.dispatch('get_powers_of_two', 'dbt_utils')(upper_bound)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__get_powers_of_two"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "upper_bound", "type": null, "description": ""}], "created_at": 1789503443.5072737, "supported_languages": null}, "macro.dbt_utils.default__get_powers_of_two": {"name": "default__get_powers_of_two", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/generate_series.sql", "original_file_path": "macros/sql/generate_series.sql", "unique_id": "macro.dbt_utils.default__get_powers_of_two", "macro_sql": "{% macro default__get_powers_of_two(upper_bound) %}\n\n {% if upper_bound <= 0 %}\n {{ exceptions.raise_compiler_error(\"upper bound must be positive\") }}\n {% endif %}\n\n {% for _ in range(1, 100) %}\n {% if upper_bound <= 2 ** loop.index %}{{ return(loop.index) }}{% endif %}\n {% endfor %}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "upper_bound", "type": null, "description": ""}], "created_at": 1789503443.508118, "supported_languages": null}, "macro.dbt_utils.generate_series": {"name": "generate_series", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/generate_series.sql", "original_file_path": "macros/sql/generate_series.sql", "unique_id": "macro.dbt_utils.generate_series", "macro_sql": "{% macro generate_series(upper_bound) %}\n {{ return(adapter.dispatch('generate_series', 'dbt_utils')(upper_bound)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__generate_series"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "upper_bound", "type": null, "description": ""}], "created_at": 1789503443.508502, "supported_languages": null}, "macro.dbt_utils.default__generate_series": {"name": "default__generate_series", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/generate_series.sql", "original_file_path": "macros/sql/generate_series.sql", "unique_id": "macro.dbt_utils.default__generate_series", "macro_sql": "{% macro default__generate_series(upper_bound) %}\n\n {% set n = dbt_utils.get_powers_of_two(upper_bound) %}\n\n with p as (\n select 0 as generated_number union all select 1\n ), unioned as (\n\n select\n\n {% for i in range(n) %}\n p{{i}}.generated_number * power(2, {{i}})\n {% if not loop.last %} + {% endif %}\n {% endfor %}\n + 1\n as generated_number\n\n from\n\n {% for i in range(n) %}\n p as p{{i}}\n {% if not loop.last %} cross join {% endif %}\n {% endfor %}\n\n )\n\n select *\n from unioned\n where generated_number <= {{upper_bound}}\n order by generated_number\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.get_powers_of_two"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "upper_bound", "type": null, "description": ""}], "created_at": 1789503443.5095522, "supported_languages": null}, "macro.dbt_utils.safe_subtract": {"name": "safe_subtract", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/safe_subtract.sql", "original_file_path": "macros/sql/safe_subtract.sql", "unique_id": "macro.dbt_utils.safe_subtract", "macro_sql": "{%- macro safe_subtract(field_list) -%}\n {{ return(adapter.dispatch('safe_subtract', 'dbt_utils')(field_list)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__safe_subtract"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field_list", "type": null, "description": ""}], "created_at": 1789503443.510217, "supported_languages": null}, "macro.dbt_utils.default__safe_subtract": {"name": "default__safe_subtract", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/safe_subtract.sql", "original_file_path": "macros/sql/safe_subtract.sql", "unique_id": "macro.dbt_utils.default__safe_subtract", "macro_sql": "\n\n{%- macro default__safe_subtract(field_list) -%}\n\n{%- if field_list is not iterable or field_list is string or field_list is mapping -%}\n\n{%- set error_message = '\nWarning: the `safe_subtract` macro takes a single list argument instead of \\\nstring arguments. The {}.{} model triggered this warning. \\\n'.format(model.package_name, model.name) -%}\n\n{%- do exceptions.raise_compiler_error(error_message) -%}\n\n{%- endif -%}\n\n{% set fields = [] %}\n\n{%- for field in field_list -%}\n\n {% do fields.append(\"coalesce(\" ~ field ~ \", 0)\") %}\n\n{%- endfor -%}\n\n{{ fields|join(' -\\n ') }}\n\n{%- endmacro -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field_list", "type": null, "description": ""}], "created_at": 1789503443.511335, "supported_languages": null}, "macro.dbt_utils.deduplicate": {"name": "deduplicate", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/deduplicate.sql", "original_file_path": "macros/sql/deduplicate.sql", "unique_id": "macro.dbt_utils.deduplicate", "macro_sql": "{%- macro deduplicate(relation, partition_by, order_by) -%}\n {{ return(adapter.dispatch('deduplicate', 'dbt_utils')(relation, partition_by, order_by)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.postgres__deduplicate"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "partition_by", "type": null, "description": ""}, {"name": "order_by", "type": null, "description": ""}], "created_at": 1789503443.5124464, "supported_languages": null}, "macro.dbt_utils.default__deduplicate": {"name": "default__deduplicate", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/deduplicate.sql", "original_file_path": "macros/sql/deduplicate.sql", "unique_id": "macro.dbt_utils.default__deduplicate", "macro_sql": "\n\n{%- macro default__deduplicate(relation, partition_by, order_by) -%}\n\n with row_numbered as (\n select\n _inner.*,\n row_number() over (\n partition by {{ partition_by }}\n order by {{ order_by }}\n ) as rn\n from {{ relation }} as _inner\n )\n\n select\n distinct data.*\n from {{ relation }} as data\n {#\n -- Not all DBs will support natural joins but the ones that do include:\n -- Oracle, MySQL, SQLite, Redshift, Teradata, Materialize, Databricks\n -- Apache Spark, SingleStore, Vertica\n -- Those that do not appear to support natural joins include:\n -- SQLServer, Trino, Presto, Rockset, Athena\n #}\n natural join row_numbered\n where row_numbered.rn = 1\n\n{%- endmacro -%}\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "partition_by", "type": null, "description": ""}, {"name": "order_by", "type": null, "description": ""}], "created_at": 1789503443.5128894, "supported_languages": null}, "macro.dbt_utils.redshift__deduplicate": {"name": "redshift__deduplicate", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/deduplicate.sql", "original_file_path": "macros/sql/deduplicate.sql", "unique_id": "macro.dbt_utils.redshift__deduplicate", "macro_sql": "{% macro redshift__deduplicate(relation, partition_by, order_by) -%}\n\n select *\n from {{ relation }} as tt\n qualify\n row_number() over (\n partition by {{ partition_by }}\n order by {{ order_by }}\n ) = 1\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "partition_by", "type": null, "description": ""}, {"name": "order_by", "type": null, "description": ""}], "created_at": 1789503443.5132627, "supported_languages": null}, "macro.dbt_utils.postgres__deduplicate": {"name": "postgres__deduplicate", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/deduplicate.sql", "original_file_path": "macros/sql/deduplicate.sql", "unique_id": "macro.dbt_utils.postgres__deduplicate", "macro_sql": "\n{%- macro postgres__deduplicate(relation, partition_by, order_by) -%}\n\n select\n distinct on ({{ partition_by }}) *\n from {{ relation }}\n order by {{ partition_by }}{{ ',' ~ order_by }}\n\n{%- endmacro -%}\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "partition_by", "type": null, "description": ""}, {"name": "order_by", "type": null, "description": ""}], "created_at": 1789503443.5136635, "supported_languages": null}, "macro.dbt_utils.snowflake__deduplicate": {"name": "snowflake__deduplicate", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/deduplicate.sql", "original_file_path": "macros/sql/deduplicate.sql", "unique_id": "macro.dbt_utils.snowflake__deduplicate", "macro_sql": "\n{%- macro snowflake__deduplicate(relation, partition_by, order_by) -%}\n\n select *\n from {{ relation }}\n qualify\n row_number() over (\n partition by {{ partition_by }}\n order by {{ order_by }}\n ) = 1\n\n{%- endmacro -%}\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "partition_by", "type": null, "description": ""}, {"name": "order_by", "type": null, "description": ""}], "created_at": 1789503443.5140417, "supported_languages": null}, "macro.dbt_utils.databricks__deduplicate": {"name": "databricks__deduplicate", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/deduplicate.sql", "original_file_path": "macros/sql/deduplicate.sql", "unique_id": "macro.dbt_utils.databricks__deduplicate", "macro_sql": "\n{%- macro databricks__deduplicate(relation, partition_by, order_by) -%}\n\n select *\n from {{ relation }}\n qualify\n row_number() over (\n partition by {{ partition_by }}\n order by {{ order_by }}\n ) = 1\n\n{%- endmacro -%}\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "partition_by", "type": null, "description": ""}, {"name": "order_by", "type": null, "description": ""}], "created_at": 1789503443.5143938, "supported_languages": null}, "macro.dbt_utils.bigquery__deduplicate": {"name": "bigquery__deduplicate", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/deduplicate.sql", "original_file_path": "macros/sql/deduplicate.sql", "unique_id": "macro.dbt_utils.bigquery__deduplicate", "macro_sql": "\n{%- macro bigquery__deduplicate(relation, partition_by, order_by) -%}\n\n select unique.*\n from (\n select\n array_agg (\n original\n order by {{ order_by }}\n limit 1\n )[offset(0)] unique\n from {{ relation }} original\n group by {{ partition_by }}\n )\n\n{%- endmacro -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "partition_by", "type": null, "description": ""}, {"name": "order_by", "type": null, "description": ""}], "created_at": 1789503443.5147488, "supported_languages": null}, "macro.dbt_utils.generate_surrogate_key": {"name": "generate_surrogate_key", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/generate_surrogate_key.sql", "original_file_path": "macros/sql/generate_surrogate_key.sql", "unique_id": "macro.dbt_utils.generate_surrogate_key", "macro_sql": "{%- macro generate_surrogate_key(field_list) -%}\n {{ return(adapter.dispatch('generate_surrogate_key', 'dbt_utils')(field_list)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__generate_surrogate_key"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field_list", "type": null, "description": ""}], "created_at": 1789503443.5154781, "supported_languages": null}, "macro.dbt_utils.default__generate_surrogate_key": {"name": "default__generate_surrogate_key", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/generate_surrogate_key.sql", "original_file_path": "macros/sql/generate_surrogate_key.sql", "unique_id": "macro.dbt_utils.default__generate_surrogate_key", "macro_sql": "\n\n{%- macro default__generate_surrogate_key(field_list) -%}\n\n{%- if var('surrogate_key_treat_nulls_as_empty_strings', False) -%}\n {%- set default_null_value = \"\" -%}\n{%- else -%}\n {%- set default_null_value = '_dbt_utils_surrogate_key_null_' -%}\n{%- endif -%}\n\n{%- set fields = [] -%}\n\n{%- for field in field_list -%}\n\n {%- do fields.append(\n \"coalesce(cast(\" ~ field ~ \" as \" ~ dbt.type_string() ~ \"), '\" ~ default_null_value ~\"')\"\n ) -%}\n\n {%- if not loop.last %}\n {%- do fields.append(\"'-'\") -%}\n {%- endif -%}\n\n{%- endfor -%}\n\n{{ dbt.hash(dbt.concat(fields)) }}\n\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt.type_string", "macro.dbt.hash", "macro.dbt.concat"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field_list", "type": null, "description": ""}], "created_at": 1789503443.5168989, "supported_languages": null}, "macro.dbt_utils.pivot": {"name": "pivot", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/pivot.sql", "original_file_path": "macros/sql/pivot.sql", "unique_id": "macro.dbt_utils.pivot", "macro_sql": "{% macro pivot(column,\n values,\n alias=True,\n agg='sum',\n cmp='=',\n prefix='',\n suffix='',\n then_value=1,\n else_value=0,\n quote_identifiers=True,\n distinct=False) %}\n {{ return(adapter.dispatch('pivot', 'dbt_utils')(column, values, alias, agg, cmp, prefix, suffix, then_value, else_value, quote_identifiers, distinct)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__pivot"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "column", "type": null, "description": ""}, {"name": "values", "type": null, "description": ""}, {"name": "alias", "type": null, "description": ""}, {"name": "agg", "type": null, "description": ""}, {"name": "cmp", "type": null, "description": ""}, {"name": "prefix", "type": null, "description": ""}, {"name": "suffix", "type": null, "description": ""}, {"name": "then_value", "type": null, "description": ""}, {"name": "else_value", "type": null, "description": ""}, {"name": "quote_identifiers", "type": null, "description": ""}, {"name": "distinct", "type": null, "description": ""}], "created_at": 1789503443.5185046, "supported_languages": null}, "macro.dbt_utils.default__pivot": {"name": "default__pivot", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/pivot.sql", "original_file_path": "macros/sql/pivot.sql", "unique_id": "macro.dbt_utils.default__pivot", "macro_sql": "{% macro default__pivot(column,\n values,\n alias=True,\n agg='sum',\n cmp='=',\n prefix='',\n suffix='',\n then_value=1,\n else_value=0,\n quote_identifiers=True,\n distinct=False) %}\n {% for value in values %}\n {{ agg }}(\n {% if distinct %} distinct {% endif %}\n case\n when {{ column }} {{ cmp }} '{{ dbt.escape_single_quotes(value) }}'\n then {{ then_value }}\n else {{ else_value }}\n end\n )\n {% if alias %}\n {% if quote_identifiers %}\n as {{ adapter.quote(prefix ~ value ~ suffix) }}\n {% else %}\n as {{ dbt_utils.slugify(prefix ~ value ~ suffix) }}\n {% endif %}\n {% endif %}\n {% if not loop.last %},{% endif %}\n {% endfor %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.escape_single_quotes", "macro.dbt_utils.slugify"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "column", "type": null, "description": ""}, {"name": "values", "type": null, "description": ""}, {"name": "alias", "type": null, "description": ""}, {"name": "agg", "type": null, "description": ""}, {"name": "cmp", "type": null, "description": ""}, {"name": "prefix", "type": null, "description": ""}, {"name": "suffix", "type": null, "description": ""}, {"name": "then_value", "type": null, "description": ""}, {"name": "else_value", "type": null, "description": ""}, {"name": "quote_identifiers", "type": null, "description": ""}, {"name": "distinct", "type": null, "description": ""}], "created_at": 1789503443.520265, "supported_languages": null}, "macro.dbt_utils.nullcheck_table": {"name": "nullcheck_table", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/nullcheck_table.sql", "original_file_path": "macros/sql/nullcheck_table.sql", "unique_id": "macro.dbt_utils.nullcheck_table", "macro_sql": "{% macro nullcheck_table(relation) %}\n {{ return(adapter.dispatch('nullcheck_table', 'dbt_utils')(relation)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__nullcheck_table"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789503443.5208557, "supported_languages": null}, "macro.dbt_utils.default__nullcheck_table": {"name": "default__nullcheck_table", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/nullcheck_table.sql", "original_file_path": "macros/sql/nullcheck_table.sql", "unique_id": "macro.dbt_utils.default__nullcheck_table", "macro_sql": "{% macro default__nullcheck_table(relation) %}\n\n {%- do dbt_utils._is_relation(relation, 'nullcheck_table') -%}\n {%- do dbt_utils._is_ephemeral(relation, 'nullcheck_table') -%}\n {% set cols = adapter.get_columns_in_relation(relation) %}\n\n select {{ dbt_utils.nullcheck(cols) }}\n from {{relation}}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils._is_relation", "macro.dbt_utils._is_ephemeral", "macro.dbt_utils.nullcheck"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}], "created_at": 1789503443.5216253, "supported_languages": null}, "macro.dbt_utils.get_relations_by_pattern": {"name": "get_relations_by_pattern", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_relations_by_pattern.sql", "original_file_path": "macros/sql/get_relations_by_pattern.sql", "unique_id": "macro.dbt_utils.get_relations_by_pattern", "macro_sql": "{% macro get_relations_by_pattern(schema_pattern, table_pattern, exclude='', database=target.database) %}\n {{ return(adapter.dispatch('get_relations_by_pattern', 'dbt_utils')(schema_pattern, table_pattern, exclude, database)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__get_relations_by_pattern"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "schema_pattern", "type": null, "description": ""}, {"name": "table_pattern", "type": null, "description": ""}, {"name": "exclude", "type": null, "description": ""}, {"name": "database", "type": null, "description": ""}], "created_at": 1789503443.5226095, "supported_languages": null}, "macro.dbt_utils.default__get_relations_by_pattern": {"name": "default__get_relations_by_pattern", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_relations_by_pattern.sql", "original_file_path": "macros/sql/get_relations_by_pattern.sql", "unique_id": "macro.dbt_utils.default__get_relations_by_pattern", "macro_sql": "{% macro default__get_relations_by_pattern(schema_pattern, table_pattern, exclude='', database=target.database) %}\n\n {%- call statement('get_tables', fetch_result=True) %}\n\n {{ dbt_utils.get_tables_by_pattern_sql(schema_pattern, table_pattern, exclude, database) }}\n\n {%- endcall -%}\n\n {%- set table_list = load_result('get_tables') -%}\n\n {%- if table_list and table_list['table'] -%}\n {%- set tbl_relations = [] -%}\n {%- for row in table_list['table'] -%}\n {%- set tbl_relation = api.Relation.create(\n database=database,\n schema=row.table_schema,\n identifier=row.table_name,\n type=row.table_type\n ) -%}\n {%- do tbl_relations.append(tbl_relation) -%}\n {%- endfor -%}\n\n {{ return(tbl_relations) }}\n {%- else -%}\n {{ return([]) }}\n {%- endif -%}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement", "macro.dbt_utils.get_tables_by_pattern_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "schema_pattern", "type": null, "description": ""}, {"name": "table_pattern", "type": null, "description": ""}, {"name": "exclude", "type": null, "description": ""}, {"name": "database", "type": null, "description": ""}], "created_at": 1789503443.524324, "supported_languages": null}, "macro.dbt_utils.get_query_results_as_dict": {"name": "get_query_results_as_dict", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_query_results_as_dict.sql", "original_file_path": "macros/sql/get_query_results_as_dict.sql", "unique_id": "macro.dbt_utils.get_query_results_as_dict", "macro_sql": "{% macro get_query_results_as_dict(query) %}\n {{ return(adapter.dispatch('get_query_results_as_dict', 'dbt_utils')(query)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__get_query_results_as_dict"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "query", "type": null, "description": ""}], "created_at": 1789503443.5250137, "supported_languages": null}, "macro.dbt_utils.default__get_query_results_as_dict": {"name": "default__get_query_results_as_dict", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_query_results_as_dict.sql", "original_file_path": "macros/sql/get_query_results_as_dict.sql", "unique_id": "macro.dbt_utils.default__get_query_results_as_dict", "macro_sql": "{% macro default__get_query_results_as_dict(query) %}\n\n{# This macro returns a dictionary of the form {column_name: (tuple_of_results)} #}\n\n {%- call statement('get_query_results', fetch_result=True,auto_begin=false) -%}\n\n {{ query }}\n\n {%- endcall -%}\n\n {% set sql_results={} %}\n\n {%- if execute -%}\n {% set sql_results_table = load_result('get_query_results').table.columns %}\n {% for column_name, column in sql_results_table.items() %}\n {% do sql_results.update({column_name: column.values()}) %}\n {% endfor %}\n {%- endif -%}\n\n {{ return(sql_results) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "query", "type": null, "description": ""}], "created_at": 1789503443.5261958, "supported_languages": null}, "macro.dbt_utils.union_relations": {"name": "union_relations", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/union.sql", "original_file_path": "macros/sql/union.sql", "unique_id": "macro.dbt_utils.union_relations", "macro_sql": "{%- macro union_relations(relations, column_override=none, include=[], exclude=[], source_column_name='_dbt_source_relation', where=none) -%}\n {{ return(adapter.dispatch('union_relations', 'dbt_utils')(relations, column_override, include, exclude, source_column_name, where)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__union_relations"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relations", "type": null, "description": ""}, {"name": "column_override", "type": null, "description": ""}, {"name": "include", "type": null, "description": ""}, {"name": "exclude", "type": null, "description": ""}, {"name": "source_column_name", "type": null, "description": ""}, {"name": "where", "type": null, "description": ""}], "created_at": 1789503443.5282857, "supported_languages": null}, "macro.dbt_utils.default__union_relations": {"name": "default__union_relations", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/union.sql", "original_file_path": "macros/sql/union.sql", "unique_id": "macro.dbt_utils.default__union_relations", "macro_sql": "\n\n{%- macro default__union_relations(relations, column_override=none, include=[], exclude=[], source_column_name='_dbt_source_relation', where=none) -%}\n\n {%- if exclude and include -%}\n {{ exceptions.raise_compiler_error(\"Both an exclude and include list were provided to the `union` macro. Only one is allowed\") }}\n {%- endif -%}\n\n {#-- Prevent querying of db in parsing mode. This works because this macro does not create any new refs. -#}\n {%- if not execute %}\n {{ return('') }}\n {% endif -%}\n\n {%- set column_override = column_override if column_override is not none else {} -%}\n\n {%- set relation_columns = {} -%}\n {%- set column_superset = {} -%}\n {%- set all_excludes = [] -%}\n {%- set all_includes = [] -%}\n\n {%- if exclude -%}\n {%- for exc in exclude -%}\n {%- do all_excludes.append(exc | lower) -%}\n {%- endfor -%}\n {%- endif -%}\n\n {%- if include -%}\n {%- for inc in include -%}\n {%- do all_includes.append(inc | lower) -%}\n {%- endfor -%}\n {%- endif -%}\n\n {%- for relation in relations -%}\n\n {%- do relation_columns.update({relation: []}) -%}\n\n {%- do dbt_utils._is_relation(relation, 'union_relations') -%}\n {%- do dbt_utils._is_ephemeral(relation, 'union_relations') -%}\n {%- set cols = adapter.get_columns_in_relation(relation) -%}\n {%- for col in cols -%}\n\n {#- If an exclude list was provided and the column is in the list, do nothing -#}\n {%- if exclude and col.column | lower in all_excludes -%}\n\n {#- If an include list was provided and the column is not in the list, do nothing -#}\n {%- elif include and col.column | lower not in all_includes -%}\n\n {#- Otherwise add the column to the column superset -#}\n {%- else -%}\n\n {#- update the list of columns in this relation -#}\n {%- do relation_columns[relation].append(col.column) -%}\n\n {%- if col.column in column_superset -%}\n\n {%- set stored = column_superset[col.column] -%}\n {%- if col.is_string() and stored.is_string() and col.string_size() > stored.string_size() -%}\n\n {%- do column_superset.update({col.column: col}) -%}\n\n {%- endif %}\n\n {%- else -%}\n\n {%- do column_superset.update({col.column: col}) -%}\n\n {%- endif -%}\n\n {%- endif -%}\n\n {%- endfor -%}\n {%- endfor -%}\n\n {%- set ordered_column_names = column_superset.keys() -%}\n {%- set dbt_command = flags.WHICH -%}\n\n\n {% if dbt_command in ['run', 'build'] %}\n {% if (include | length > 0 or exclude | length > 0) and not column_superset.keys() %}\n {%- set relations_string -%}\n {%- for relation in relations -%}\n {{ relation.name }}\n {%- if not loop.last %}, {% endif -%}\n {%- endfor -%}\n {%- endset -%}\n\n {%- set error_message -%}\n There were no columns found to union for relations {{ relations_string }}\n {%- endset -%}\n\n {{ exceptions.raise_compiler_error(error_message) }}\n {%- endif -%}\n {%- endif -%}\n\n {%- for relation in relations %}\n\n (\n select\n\n {%- if source_column_name is not none %}\n cast({{ dbt.string_literal(relation.render()) }} as {{ dbt.type_string() }}) as {{ source_column_name }},\n {%- endif %}\n\n /* No columns from any of the relations.\n This star is only output during dbt compile, and exists to keep SQLFluff happy. */\n {% if dbt_command == 'compile' and ordered_column_names|length == 0 %}\n *\n {% endif %}\n\n {% for col_name in ordered_column_names -%}\n\n {%- set col = column_superset[col_name] %}\n {%- set col_type = column_override.get(col.column, col.data_type) %}\n {%- set col_name = adapter.quote(col_name) if col_name in relation_columns[relation] else 'null' %}\n cast({{ col_name }} as {{ col_type }}) as {{ col.quoted }} {% if not loop.last %},{% endif -%}\n\n {%- endfor %}\n\n from {{ relation }}\n\n {% if where -%}\n where {{ where }}\n {%- endif %}\n )\n\n {% if not loop.last -%}\n union all\n {% endif -%}\n\n {%- endfor -%}\n\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt_utils._is_relation", "macro.dbt_utils._is_ephemeral", "macro.dbt.string_literal", "macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relations", "type": null, "description": ""}, {"name": "column_override", "type": null, "description": ""}, {"name": "include", "type": null, "description": ""}, {"name": "exclude", "type": null, "description": ""}, {"name": "source_column_name", "type": null, "description": ""}, {"name": "where", "type": null, "description": ""}], "created_at": 1789503443.5353901, "supported_languages": null}, "macro.dbt_utils.unpivot": {"name": "unpivot", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/unpivot.sql", "original_file_path": "macros/sql/unpivot.sql", "unique_id": "macro.dbt_utils.unpivot", "macro_sql": "{% macro unpivot(relation=none, cast_to='varchar', exclude=none, remove=none, field_name='field_name', value_name='value', quote_identifiers=False) -%}\n {{ return(adapter.dispatch('unpivot', 'dbt_utils')(relation, cast_to, exclude, remove, field_name, value_name, quote_identifiers)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__unpivot"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "cast_to", "type": null, "description": ""}, {"name": "exclude", "type": null, "description": ""}, {"name": "remove", "type": null, "description": ""}, {"name": "field_name", "type": null, "description": ""}, {"name": "value_name", "type": null, "description": ""}, {"name": "quote_identifiers", "type": null, "description": ""}], "created_at": 1789503443.5369527, "supported_languages": null}, "macro.dbt_utils.default__unpivot": {"name": "default__unpivot", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/unpivot.sql", "original_file_path": "macros/sql/unpivot.sql", "unique_id": "macro.dbt_utils.default__unpivot", "macro_sql": "{% macro default__unpivot(relation=none, cast_to='varchar', exclude=none, remove=none, field_name='field_name', value_name='value', quote_identifiers=False) -%}\n\n {% if not relation %}\n {{ exceptions.raise_compiler_error(\"Error: argument `relation` is required for `unpivot` macro.\") }}\n {% endif %}\n\n {%- set exclude = exclude if exclude is not none else [] %}\n {%- set remove = remove if remove is not none else [] %}\n\n {%- set include_cols = [] %}\n\n {%- set table_columns = {} %}\n\n {%- do table_columns.update({relation: []}) %}\n\n {%- do dbt_utils._is_relation(relation, 'unpivot') -%}\n {%- do dbt_utils._is_ephemeral(relation, 'unpivot') -%}\n {%- set cols = adapter.get_columns_in_relation(relation) %}\n\n {%- for col in cols -%}\n {%- if col.column.lower() not in remove|map('lower') and col.column.lower() not in exclude|map('lower') -%}\n {% do include_cols.append(col) %}\n {%- endif %}\n {%- endfor %}\n\n\n {%- for col in include_cols -%}\n {%- set current_col_name = adapter.quote(col.column) if quote_identifiers else col.column -%}\n select\n {%- for exclude_col in exclude %}\n {{ adapter.quote(exclude_col) if quote_identifiers else exclude_col }},\n {%- endfor %}\n\n cast('{{ col.column }}' as {{ dbt.type_string() }}) as {{ adapter.quote(field_name) if quote_identifiers else field_name }},\n cast( {% if col.data_type == 'boolean' %}\n {{ dbt.cast_bool_to_text(current_col_name) }}\n {% else %}\n {{ current_col_name }}\n {% endif %}\n as {{ cast_to }}) as {{ adapter.quote(value_name) if quote_identifiers else value_name }}\n\n from {{ relation }}\n\n {% if not loop.last -%}\n union all\n {% endif -%}\n {%- endfor -%}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_utils._is_relation", "macro.dbt_utils._is_ephemeral", "macro.dbt.type_string", "macro.dbt.cast_bool_to_text"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relation", "type": null, "description": ""}, {"name": "cast_to", "type": null, "description": ""}, {"name": "exclude", "type": null, "description": ""}, {"name": "remove", "type": null, "description": ""}, {"name": "field_name", "type": null, "description": ""}, {"name": "value_name", "type": null, "description": ""}, {"name": "quote_identifiers", "type": null, "description": ""}], "created_at": 1789503443.5406728, "supported_languages": null}, "macro.dbt_utils.nullcheck": {"name": "nullcheck", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/nullcheck.sql", "original_file_path": "macros/sql/nullcheck.sql", "unique_id": "macro.dbt_utils.nullcheck", "macro_sql": "{% macro nullcheck(cols) %}\n {{ return(adapter.dispatch('nullcheck', 'dbt_utils')(cols)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__nullcheck"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "cols", "type": null, "description": ""}], "created_at": 1789503443.541326, "supported_languages": null}, "macro.dbt_utils.default__nullcheck": {"name": "default__nullcheck", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/nullcheck.sql", "original_file_path": "macros/sql/nullcheck.sql", "unique_id": "macro.dbt_utils.default__nullcheck", "macro_sql": "{% macro default__nullcheck(cols) %}\n{%- for col in cols %}\n\n {% if col.is_string() -%}\n\n nullif({{col.name}},'') as {{col.name}}\n\n {%- else -%}\n\n {{col.name}}\n\n {%- endif -%}\n\n{%- if not loop.last -%} , {%- endif -%}\n\n{%- endfor -%}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "cols", "type": null, "description": ""}], "created_at": 1789503443.5420275, "supported_languages": null}, "macro.dbt_utils.get_intervals_between": {"name": "get_intervals_between", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/date_spine.sql", "original_file_path": "macros/sql/date_spine.sql", "unique_id": "macro.dbt_utils.get_intervals_between", "macro_sql": "{% macro get_intervals_between(start_date, end_date, datepart) -%}\n {{ return(adapter.dispatch('get_intervals_between', 'dbt_utils')(start_date, end_date, datepart)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__get_intervals_between"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "start_date", "type": null, "description": ""}, {"name": "end_date", "type": null, "description": ""}, {"name": "datepart", "type": null, "description": ""}], "created_at": 1789503443.5429618, "supported_languages": null}, "macro.dbt_utils.default__get_intervals_between": {"name": "default__get_intervals_between", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/date_spine.sql", "original_file_path": "macros/sql/date_spine.sql", "unique_id": "macro.dbt_utils.default__get_intervals_between", "macro_sql": "{% macro default__get_intervals_between(start_date, end_date, datepart) -%}\n {%- call statement('get_intervals_between', fetch_result=True) %}\n\n select {{ dbt.datediff(start_date, end_date, datepart) }}\n\n {%- endcall -%}\n\n {%- set value_list = load_result('get_intervals_between') -%}\n\n {%- if value_list and value_list['data'] -%}\n {%- set values = value_list['data'] | map(attribute=0) | list %}\n {{ return(values[0]) }}\n {%- else -%}\n {{ return(1) }}\n {%- endif -%}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.statement", "macro.dbt.datediff"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "start_date", "type": null, "description": ""}, {"name": "end_date", "type": null, "description": ""}, {"name": "datepart", "type": null, "description": ""}], "created_at": 1789503443.5441847, "supported_languages": null}, "macro.dbt_utils.date_spine": {"name": "date_spine", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/date_spine.sql", "original_file_path": "macros/sql/date_spine.sql", "unique_id": "macro.dbt_utils.date_spine", "macro_sql": "{% macro date_spine(datepart, start_date, end_date) %}\n {{ return(adapter.dispatch('date_spine', 'dbt_utils')(datepart, start_date, end_date)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__date_spine"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "datepart", "type": null, "description": ""}, {"name": "start_date", "type": null, "description": ""}, {"name": "end_date", "type": null, "description": ""}], "created_at": 1789503443.5446484, "supported_languages": null}, "macro.dbt_utils.default__date_spine": {"name": "default__date_spine", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/date_spine.sql", "original_file_path": "macros/sql/date_spine.sql", "unique_id": "macro.dbt_utils.default__date_spine", "macro_sql": "{% macro default__date_spine(datepart, start_date, end_date) %}\n\n\n{# call as follows:\n\ndate_spine(\n \"day\",\n \"to_date('01/01/2016', 'mm/dd/yyyy')\",\n \"dbt.dateadd(week, 1, current_date)\"\n) #}\n\n\nwith rawdata as (\n\n {{dbt_utils.generate_series(\n dbt_utils.get_intervals_between(start_date, end_date, datepart)\n )}}\n\n),\n\nall_periods as (\n\n select (\n {{\n dbt.dateadd(\n datepart,\n \"row_number() over (order by generated_number) - 1\",\n start_date\n )\n }}\n ) as date_{{datepart}}\n from rawdata\n\n),\n\nfiltered as (\n\n select *\n from all_periods\n where date_{{datepart}} <= {{ end_date }}\n\n)\n\nselect * from filtered\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.generate_series", "macro.dbt_utils.get_intervals_between", "macro.dbt.dateadd"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "datepart", "type": null, "description": ""}, {"name": "start_date", "type": null, "description": ""}, {"name": "end_date", "type": null, "description": ""}], "created_at": 1789503443.545391, "supported_languages": null}, "macro.dbt_utils.get_filtered_columns_in_relation": {"name": "get_filtered_columns_in_relation", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_filtered_columns_in_relation.sql", "original_file_path": "macros/sql/get_filtered_columns_in_relation.sql", "unique_id": "macro.dbt_utils.get_filtered_columns_in_relation", "macro_sql": "{% macro get_filtered_columns_in_relation(from, except=[]) -%}\n {{ return(adapter.dispatch('get_filtered_columns_in_relation', 'dbt_utils')(from, except)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__get_filtered_columns_in_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "from", "type": null, "description": ""}, {"name": "except", "type": null, "description": ""}], "created_at": 1789503443.5461986, "supported_languages": null}, "macro.dbt_utils.default__get_filtered_columns_in_relation": {"name": "default__get_filtered_columns_in_relation", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_filtered_columns_in_relation.sql", "original_file_path": "macros/sql/get_filtered_columns_in_relation.sql", "unique_id": "macro.dbt_utils.default__get_filtered_columns_in_relation", "macro_sql": "{% macro default__get_filtered_columns_in_relation(from, except=[]) -%}\n {%- do dbt_utils._is_relation(from, 'get_filtered_columns_in_relation') -%}\n {%- do dbt_utils._is_ephemeral(from, 'get_filtered_columns_in_relation') -%}\n\n {# -- Prevent querying of db in parsing mode. This works because this macro does not create any new refs. #}\n {%- if not execute -%}\n {{ return([]) }}\n {% endif %}\n\n {%- set include_cols = [] %}\n {%- set cols = adapter.get_columns_in_relation(from) -%}\n {%- set except = except | map(\"lower\") | list %}\n {%- for col in cols -%}\n {%- if col.column|lower not in except -%}\n {% do include_cols.append(col.column) %}\n {%- endif %}\n {%- endfor %}\n\n {{ return(include_cols) }}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_utils._is_relation", "macro.dbt_utils._is_ephemeral"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "from", "type": null, "description": ""}, {"name": "except", "type": null, "description": ""}], "created_at": 1789503443.5476701, "supported_languages": null}, "macro.dbt_utils.surrogate_key": {"name": "surrogate_key", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/surrogate_key.sql", "original_file_path": "macros/sql/surrogate_key.sql", "unique_id": "macro.dbt_utils.surrogate_key", "macro_sql": "{%- macro surrogate_key(field_list) -%}\n {% set frustrating_jinja_feature = varargs %}\n {{ return(adapter.dispatch('surrogate_key', 'dbt_utils')(field_list, *varargs)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__surrogate_key"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field_list", "type": null, "description": ""}], "created_at": 1789503443.5483646, "supported_languages": null}, "macro.dbt_utils.default__surrogate_key": {"name": "default__surrogate_key", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/surrogate_key.sql", "original_file_path": "macros/sql/surrogate_key.sql", "unique_id": "macro.dbt_utils.default__surrogate_key", "macro_sql": "\n\n{%- macro default__surrogate_key(field_list) -%}\n\n{%- set error_message = '\nWarning: `dbt_utils.surrogate_key` has been replaced by \\\n`dbt_utils.generate_surrogate_key`. The new macro treats null values \\\ndifferently to empty strings. To restore the behaviour of the original \\\nmacro, add a global variable in dbt_project.yml called \\\n`surrogate_key_treat_nulls_as_empty_strings` to your \\\ndbt_project.yml file with a value of True. \\\nThe {}.{} model triggered this warning. \\\n'.format(model.package_name, model.name) -%}\n\n{%- do exceptions.raise_compiler_error(error_message) -%}\n\n{%- endmacro -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field_list", "type": null, "description": ""}], "created_at": 1789503443.5488455, "supported_languages": null}, "macro.dbt_utils.get_single_value": {"name": "get_single_value", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_single_value.sql", "original_file_path": "macros/sql/get_single_value.sql", "unique_id": "macro.dbt_utils.get_single_value", "macro_sql": "{% macro get_single_value(query, default=none) %}\n {{ return(adapter.dispatch('get_single_value', 'dbt_utils')(query, default)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__get_single_value"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "query", "type": null, "description": ""}, {"name": "default", "type": null, "description": ""}], "created_at": 1789503443.5496619, "supported_languages": null}, "macro.dbt_utils.default__get_single_value": {"name": "default__get_single_value", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_single_value.sql", "original_file_path": "macros/sql/get_single_value.sql", "unique_id": "macro.dbt_utils.default__get_single_value", "macro_sql": "{% macro default__get_single_value(query, default) %}\n\n{# This macro returns the (0, 0) record in a query, i.e. the first row of the first column #}\n\n {%- call statement('get_query_result', fetch_result=True, auto_begin=false) -%}\n\n {{ query }}\n\n {%- endcall -%}\n\n {%- if execute -%}\n\n {% set r = load_result('get_query_result').table.columns[0].values() %}\n {% if r | length == 0 %}\n {% do print('Query `' ~ query ~ '` returned no rows. Using the default value: ' ~ default) %}\n {% set sql_result = default %}\n {% else %}\n {% set sql_result = r[0] %}\n {% endif %}\n \n {%- else -%}\n \n {% set sql_result = default %}\n \n {%- endif -%}\n\n {% do return(sql_result) %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "query", "type": null, "description": ""}, {"name": "default", "type": null, "description": ""}], "created_at": 1789503443.551283, "supported_languages": null}, "macro.dbt_utils.width_bucket": {"name": "width_bucket", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/width_bucket.sql", "original_file_path": "macros/sql/width_bucket.sql", "unique_id": "macro.dbt_utils.width_bucket", "macro_sql": "{% macro width_bucket(expr, min_value, max_value, num_buckets) %}\n {{ return(adapter.dispatch('width_bucket', 'dbt_utils') (expr, min_value, max_value, num_buckets)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__width_bucket"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "expr", "type": null, "description": ""}, {"name": "min_value", "type": null, "description": ""}, {"name": "max_value", "type": null, "description": ""}, {"name": "num_buckets", "type": null, "description": ""}], "created_at": 1789503443.552163, "supported_languages": null}, "macro.dbt_utils.default__width_bucket": {"name": "default__width_bucket", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/width_bucket.sql", "original_file_path": "macros/sql/width_bucket.sql", "unique_id": "macro.dbt_utils.default__width_bucket", "macro_sql": "{% macro default__width_bucket(expr, min_value, max_value, num_buckets) -%}\n\n {% set bin_size -%}\n (( {{ max_value }} - {{ min_value }} ) / {{ num_buckets }} )\n {%- endset %}\n (\n -- to break ties when the amount is eaxtly at the bucket egde\n case\n when\n mod(\n {{ dbt.safe_cast(expr, dbt.type_numeric() ) }},\n {{ dbt.safe_cast(bin_size, dbt.type_numeric() ) }}\n ) = 0\n then 1\n else 0\n end\n ) +\n -- Anything over max_value goes the N+1 bucket\n least(\n ceil(\n ({{ expr }} - {{ min_value }})/{{ bin_size }}\n ),\n {{ num_buckets }} + 1\n )\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.safe_cast", "macro.dbt.type_numeric"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "expr", "type": null, "description": ""}, {"name": "min_value", "type": null, "description": ""}, {"name": "max_value", "type": null, "description": ""}, {"name": "num_buckets", "type": null, "description": ""}], "created_at": 1789503443.5531075, "supported_languages": null}, "macro.dbt_utils.snowflake__width_bucket": {"name": "snowflake__width_bucket", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/width_bucket.sql", "original_file_path": "macros/sql/width_bucket.sql", "unique_id": "macro.dbt_utils.snowflake__width_bucket", "macro_sql": "{% macro snowflake__width_bucket(expr, min_value, max_value, num_buckets) %}\n width_bucket({{ expr }}, {{ min_value }}, {{ max_value }}, {{ num_buckets }} )\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "expr", "type": null, "description": ""}, {"name": "min_value", "type": null, "description": ""}, {"name": "max_value", "type": null, "description": ""}, {"name": "num_buckets", "type": null, "description": ""}], "created_at": 1789503443.5535028, "supported_languages": null}, "macro.dbt_utils.get_relations_by_prefix": {"name": "get_relations_by_prefix", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_relations_by_prefix.sql", "original_file_path": "macros/sql/get_relations_by_prefix.sql", "unique_id": "macro.dbt_utils.get_relations_by_prefix", "macro_sql": "{% macro get_relations_by_prefix(schema, prefix, exclude='', database=target.database) %}\n {{ return(adapter.dispatch('get_relations_by_prefix', 'dbt_utils')(schema, prefix, exclude, database)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__get_relations_by_prefix"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "schema", "type": null, "description": ""}, {"name": "prefix", "type": null, "description": ""}, {"name": "exclude", "type": null, "description": ""}, {"name": "database", "type": null, "description": ""}], "created_at": 1789503443.5544343, "supported_languages": null}, "macro.dbt_utils.default__get_relations_by_prefix": {"name": "default__get_relations_by_prefix", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_relations_by_prefix.sql", "original_file_path": "macros/sql/get_relations_by_prefix.sql", "unique_id": "macro.dbt_utils.default__get_relations_by_prefix", "macro_sql": "{% macro default__get_relations_by_prefix(schema, prefix, exclude='', database=target.database) %}\n\n {%- call statement('get_tables', fetch_result=True) %}\n\n {{ dbt_utils.get_tables_by_prefix_sql(schema, prefix, exclude, database) }}\n\n {%- endcall -%}\n\n {%- set table_list = load_result('get_tables') -%}\n\n {%- if table_list and table_list['table'] -%}\n {%- set tbl_relations = [] -%}\n {%- for row in table_list['table'] -%}\n {%- set tbl_relation = api.Relation.create(\n database=database,\n schema=row.table_schema,\n identifier=row.table_name,\n type=row.table_type\n ) -%}\n {%- do tbl_relations.append(tbl_relation) -%}\n {%- endfor -%}\n\n {{ return(tbl_relations) }}\n {%- else -%}\n {{ return([]) }}\n {%- endif -%}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement", "macro.dbt_utils.get_tables_by_prefix_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "schema", "type": null, "description": ""}, {"name": "prefix", "type": null, "description": ""}, {"name": "exclude", "type": null, "description": ""}, {"name": "database", "type": null, "description": ""}], "created_at": 1789503443.5561612, "supported_languages": null}, "macro.dbt_utils.safe_divide": {"name": "safe_divide", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/safe_divide.sql", "original_file_path": "macros/sql/safe_divide.sql", "unique_id": "macro.dbt_utils.safe_divide", "macro_sql": "{% macro safe_divide(numerator, denominator) -%}\n {{ return(adapter.dispatch('safe_divide', 'dbt_utils')(numerator, denominator)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__safe_divide"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "numerator", "type": null, "description": ""}, {"name": "denominator", "type": null, "description": ""}], "created_at": 1789503443.5567207, "supported_languages": null}, "macro.dbt_utils.default__safe_divide": {"name": "default__safe_divide", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/safe_divide.sql", "original_file_path": "macros/sql/safe_divide.sql", "unique_id": "macro.dbt_utils.default__safe_divide", "macro_sql": "{% macro default__safe_divide(numerator, denominator) %}\n ( {{ numerator }} ) / nullif( ( {{ denominator }} ), 0)\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "numerator", "type": null, "description": ""}, {"name": "denominator", "type": null, "description": ""}], "created_at": 1789503443.5570233, "supported_languages": null}, "macro.dbt_utils.safe_add": {"name": "safe_add", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/safe_add.sql", "original_file_path": "macros/sql/safe_add.sql", "unique_id": "macro.dbt_utils.safe_add", "macro_sql": "{%- macro safe_add(field_list) -%}\n {{ return(adapter.dispatch('safe_add', 'dbt_utils')(field_list)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__safe_add"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field_list", "type": null, "description": ""}], "created_at": 1789503443.5576565, "supported_languages": null}, "macro.dbt_utils.default__safe_add": {"name": "default__safe_add", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/safe_add.sql", "original_file_path": "macros/sql/safe_add.sql", "unique_id": "macro.dbt_utils.default__safe_add", "macro_sql": "\n\n{%- macro default__safe_add(field_list) -%}\n\n{%- if field_list is not iterable or field_list is string or field_list is mapping -%}\n\n{%- set error_message = '\nWarning: the `safe_add` macro now takes a single list argument instead of \\\nstring arguments. The {}.{} model triggered this warning. \\\n'.format(model.package_name, model.name) -%}\n\n{%- do exceptions.warn(error_message) -%}\n\n{%- endif -%}\n\n{% set fields = [] %}\n\n{%- for field in field_list -%}\n\n {% do fields.append(\"coalesce(\" ~ field ~ \", 0)\") %}\n\n{%- endfor -%}\n\n{{ fields|join(' +\\n ') }}\n\n{%- endmacro -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field_list", "type": null, "description": ""}], "created_at": 1789503443.5587595, "supported_languages": null}, "macro.dbt_utils.group_by": {"name": "group_by", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/groupby.sql", "original_file_path": "macros/sql/groupby.sql", "unique_id": "macro.dbt_utils.group_by", "macro_sql": "{%- macro group_by(n) -%}\n {{ return(adapter.dispatch('group_by', 'dbt_utils')(n)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__group_by"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "n", "type": null, "description": ""}], "created_at": 1789503443.5593166, "supported_languages": null}, "macro.dbt_utils.default__group_by": {"name": "default__group_by", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/groupby.sql", "original_file_path": "macros/sql/groupby.sql", "unique_id": "macro.dbt_utils.default__group_by", "macro_sql": "\n\n{%- macro default__group_by(n) -%}\n\n group by {% for i in range(1, n + 1) -%}\n {{ i }}{{ ',' if not loop.last }} \n {%- endfor -%}\n\n{%- endmacro -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "n", "type": null, "description": ""}], "created_at": 1789503443.559814, "supported_languages": null}, "macro.iterable.iterable_lookback": {"name": "iterable_lookback", "resource_type": "macro", "package_name": "iterable", "path": "macros/iterable_lookback.sql", "original_file_path": "macros/iterable_lookback.sql", "unique_id": "macro.iterable.iterable_lookback", "macro_sql": "{% macro iterable_lookback(from_date, datepart, interval, safety_date='2020-01-01') %}\n\n{{ adapter.dispatch('iterable_lookback', 'iterable') (from_date, datepart, interval, safety_date='2020-01-01') }}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.iterable.default__iterable_lookback"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "from_date", "type": null, "description": ""}, {"name": "datepart", "type": null, "description": ""}, {"name": "interval", "type": null, "description": ""}, {"name": "safety_date", "type": null, "description": ""}], "created_at": 1789503443.560613, "supported_languages": null}, "macro.iterable.default__iterable_lookback": {"name": "default__iterable_lookback", "resource_type": "macro", "package_name": "iterable", "path": "macros/iterable_lookback.sql", "original_file_path": "macros/iterable_lookback.sql", "unique_id": "macro.iterable.default__iterable_lookback", "macro_sql": "{% macro default__iterable_lookback(from_date, datepart, interval, safety_date='2020-01-01') %}\n\n {% set sql_statement %}\n select coalesce({{ from_date }}, {{ \"'\" ~ safety_date ~ \"'\" }})\n from {{ this }}\n {%- endset -%}\n\n {%- set result = dbt_utils.get_single_value(sql_statement) %}\n\n {{ dbt.dateadd(datepart=datepart, interval=-interval, from_date_or_timestamp=\"cast('\" ~ result ~ \"' as date)\") }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.get_single_value", "macro.dbt.dateadd"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "from_date", "type": null, "description": ""}, {"name": "datepart", "type": null, "description": ""}, {"name": "interval", "type": null, "description": ""}, {"name": "safety_date", "type": null, "description": ""}], "created_at": 1789503443.5616329, "supported_languages": null}, "macro.iterable.get_campaign_list_history_columns": {"name": "get_campaign_list_history_columns", "resource_type": "macro", "package_name": "iterable", "path": "macros/staging/get_campaign_list_history_columns.sql", "original_file_path": "macros/staging/get_campaign_list_history_columns.sql", "unique_id": "macro.iterable.get_campaign_list_history_columns", "macro_sql": "{% macro get_campaign_list_history_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"campaign_id\", \"datatype\": dbt.type_int()},\n {\"name\": \"list_id\", \"datatype\": dbt.type_int()},\n {\"name\": \"updated_at\", \"datatype\": dbt.type_timestamp()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.type_timestamp", "macro.dbt.type_int"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789503443.562798, "supported_languages": null}, "macro.iterable.get_list_columns": {"name": "get_list_columns", "resource_type": "macro", "package_name": "iterable", "path": "macros/staging/get_list_columns.sql", "original_file_path": "macros/staging/get_list_columns.sql", "unique_id": "macro.iterable.get_list_columns", "macro_sql": "{% macro get_list_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_deleted\", \"datatype\": \"boolean\"},\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"created_at\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"id\", \"datatype\": dbt.type_int()},\n {\"name\": \"list_type\", \"datatype\": dbt.type_string()},\n {\"name\": \"description\", \"datatype\": dbt.type_string()},\n {\"name\": \"name\", \"datatype\": dbt.type_string()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.type_timestamp", "macro.dbt.type_int", "macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789503443.5644505, "supported_languages": null}, "macro.iterable.get_campaign_history_columns": {"name": "get_campaign_history_columns", "resource_type": "macro", "package_name": "iterable", "path": "macros/staging/get_campaign_history_columns.sql", "original_file_path": "macros/staging/get_campaign_history_columns.sql", "unique_id": "macro.iterable.get_campaign_history_columns", "macro_sql": "{% macro get_campaign_history_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"campaign_state\", \"datatype\": dbt.type_string()},\n {\"name\": \"created_at\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"created_by_user_id\", \"datatype\": dbt.type_string()},\n {\"name\": \"updated_by_user_id\", \"datatype\": dbt.type_string()},\n {\"name\": \"ended_at\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"id\", \"datatype\": dbt.type_int()},\n {\"name\": \"name\", \"datatype\": dbt.type_string()},\n {\"name\": \"recurring_campaign_id\", \"datatype\": dbt.type_int()},\n {\"name\": \"send_size\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"start_at\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"template_id\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"type\", \"datatype\": dbt.type_string()},\n {\"name\": \"updated_at\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"workflow_id\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"message_medium\", \"datatype\": dbt.type_string()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.type_timestamp", "macro.dbt.type_string", "macro.dbt.type_int", "macro.dbt.type_numeric"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789503443.5677395, "supported_languages": null}, "macro.iterable.get_event_columns": {"name": "get_event_columns", "resource_type": "macro", "package_name": "iterable", "path": "macros/staging/get_event_columns.sql", "original_file_path": "macros/staging/get_event_columns.sql", "unique_id": "macro.iterable.get_event_columns", "macro_sql": "{% macro get_event_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_id\", \"datatype\": dbt.type_string()},\n {\"name\": \"_fivetran_user_id\", \"datatype\": dbt.type_string()},\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"campaign_id\", \"datatype\": dbt.type_int()},\n {\"name\": \"content_id\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"created_at\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"email\", \"datatype\": dbt.type_string()},\n {\"name\": \"event_name\", \"datatype\": dbt.type_string()},\n {\"name\": \"message_bus_id\", \"datatype\": dbt.type_string()},\n {\"name\": \"message_id\", \"datatype\": dbt.type_string()},\n {\"name\": \"message_type_id\", \"datatype\": dbt.type_int()},\n {\"name\": \"recipient_state\", \"datatype\": dbt.type_string()},\n {\"name\": \"status\", \"datatype\": dbt.type_string()},\n {\"name\": \"unsub_source\", \"datatype\": dbt.type_string()},\n {\"name\": \"user_agent\", \"datatype\": dbt.type_string()},\n {\"name\": \"user_agent_device\", \"datatype\": dbt.type_string()},\n {\"name\": \"transactional_data\", \"datatype\": dbt.type_string()},\n {\"name\": \"additional_properties\", \"datatype\": dbt.type_string()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.type_string", "macro.dbt.type_timestamp", "macro.dbt.type_int", "macro.dbt.type_numeric"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789503443.5713172, "supported_languages": null}, "macro.iterable.get_event_extension_columns": {"name": "get_event_extension_columns", "resource_type": "macro", "package_name": "iterable", "path": "macros/staging/get_event_extension_columns.sql", "original_file_path": "macros/staging/get_event_extension_columns.sql", "unique_id": "macro.iterable.get_event_extension_columns", "macro_sql": "{% macro get_event_extension_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_id\", \"datatype\": dbt.type_string()},\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"app_already_running\", \"datatype\": \"boolean\"},\n {\"name\": \"badge\", \"datatype\": dbt.type_string()},\n {\"name\": \"catalog_collection_count\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"catalog_lookup_count\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"canonical_url_id\", \"datatype\": dbt.type_string()},\n {\"name\": \"content_available\", \"datatype\": \"boolean\"},\n {\"name\": \"content_id\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"device\", \"datatype\": dbt.type_string()},\n {\"name\": \"email_id\", \"datatype\": dbt.type_string()},\n {\"name\": \"email_subject\", \"datatype\": dbt.type_string()},\n {\"name\": \"experiment_id\", \"datatype\": dbt.type_string()},\n {\"name\": \"from_phone_number_id\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"from_smssender_id\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"link_id\", \"datatype\": dbt.type_string()},\n {\"name\": \"link_url\", \"datatype\": dbt.type_string()},\n {\"name\": \"locale\", \"datatype\": dbt.type_string()},\n {\"name\": \"payload\", \"datatype\": dbt.type_string()},\n {\"name\": \"platform_endpoint\", \"datatype\": dbt.type_string()},\n {\"name\": \"push_message\", \"datatype\": dbt.type_string()},\n {\"name\": \"region\", \"datatype\": dbt.type_string()},\n {\"name\": \"sms_message\", \"datatype\": dbt.type_string()},\n {\"name\": \"to_phone_number\", \"datatype\": dbt.type_string()},\n {\"name\": \"url\", \"datatype\": dbt.type_string()},\n {\"name\": \"workflow_id\", \"datatype\": dbt.type_string()},\n {\"name\": \"workflow_name\", \"datatype\": dbt.type_string()},\n {\"name\": \"city\", \"datatype\": dbt.type_string()},\n {\"name\": \"clicked_url\", \"datatype\": dbt.type_string()},\n {\"name\": \"country\", \"datatype\": dbt.type_string()},\n {\"name\": \"error_code\", \"datatype\": dbt.type_string()},\n {\"name\": \"expires_at\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"from_phone_number\", \"datatype\": dbt.type_string()},\n {\"name\": \"in_app_body\", \"datatype\": dbt.type_string()},\n {\"name\": \"is_sms_estimation\", \"datatype\": \"boolean\"},\n {\"name\": \"labels\", \"datatype\": dbt.type_string()},\n {\"name\": \"message_status\", \"datatype\": dbt.type_string()},\n {\"name\": \"mms_send_count\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"reason\", \"datatype\": dbt.type_string()},\n {\"name\": \"sms_send_count\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"_fivetran_user_id\", \"datatype\": dbt.type_string()}\n] %}\n\n{{ fivetran_utils.add_pass_through_columns(columns, var('iterable_event_extension_pass_through_columns')) }}\n\n{{ return(columns) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.type_string", "macro.dbt.type_timestamp", "macro.dbt.type_numeric", "macro.fivetran_utils.add_pass_through_columns"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789503443.5790813, "supported_languages": null}, "macro.iterable.get_campaign_label_history_columns": {"name": "get_campaign_label_history_columns", "resource_type": "macro", "package_name": "iterable", "path": "macros/staging/get_campaign_label_history_columns.sql", "original_file_path": "macros/staging/get_campaign_label_history_columns.sql", "unique_id": "macro.iterable.get_campaign_label_history_columns", "macro_sql": "{% macro get_campaign_label_history_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"campaign_id\", \"datatype\": dbt.type_int()},\n {\"name\": \"label\", \"datatype\": dbt.type_string()},\n {\"name\": \"updated_at\", \"datatype\": dbt.type_timestamp()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.type_timestamp", "macro.dbt.type_int", "macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789503443.5803509, "supported_languages": null}, "macro.iterable.get_template_history_columns": {"name": "get_template_history_columns", "resource_type": "macro", "package_name": "iterable", "path": "macros/staging/get_template_history_columns.sql", "original_file_path": "macros/staging/get_template_history_columns.sql", "unique_id": "macro.iterable.get_template_history_columns", "macro_sql": "{% macro get_template_history_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"client_template_id\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"created_at\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"creator_user_id\", \"datatype\": dbt.type_string()},\n {\"name\": \"id\", \"datatype\": dbt.type_int()},\n {\"name\": \"message_type_id\", \"datatype\": dbt.type_int()},\n {\"name\": \"name\", \"datatype\": dbt.type_string()},\n {\"name\": \"template_type\", \"datatype\": dbt.type_string()},\n {\"name\": \"updated_at\", \"datatype\": dbt.type_timestamp()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.type_timestamp", "macro.dbt.type_numeric", "macro.dbt.type_string", "macro.dbt.type_int"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789503443.5824087, "supported_languages": null}, "macro.iterable.get_journey_columns": {"name": "get_journey_columns", "resource_type": "macro", "package_name": "iterable", "path": "macros/staging/get_journey_columns.sql", "original_file_path": "macros/staging/get_journey_columns.sql", "unique_id": "macro.iterable.get_journey_columns", "macro_sql": "{% macro get_journey_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_deleted\", \"datatype\": \"boolean\"},\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"created_at\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"creator_user_id\", \"datatype\": dbt.type_string()},\n {\"name\": \"description\", \"datatype\": dbt.type_string()},\n {\"name\": \"enabled\", \"datatype\": \"boolean\"},\n {\"name\": \"id\", \"datatype\": dbt.type_int()},\n {\"name\": \"is_archived\", \"datatype\": \"boolean\"},\n {\"name\": \"journey_type\", \"datatype\": dbt.type_string()},\n {\"name\": \"lifetime_limit\", \"datatype\": dbt.type_int()},\n {\"name\": \"name\", \"datatype\": dbt.type_string()},\n {\"name\": \"simultaneous_limit\", \"datatype\": dbt.type_int()},\n {\"name\": \"start_tile_id\", \"datatype\": dbt.type_int()},\n {\"name\": \"trigger_event_names\", \"datatype\": dbt.type_string()},\n {\"name\": \"updated_at\", \"datatype\": dbt.type_timestamp()}\n] %}\n\n{{ fivetran_utils.add_pass_through_columns(columns, var('iterable_journey_pass_through_columns')) }}\n\n{{ return(columns) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.type_timestamp", "macro.dbt.type_string", "macro.dbt.type_int", "macro.fivetran_utils.add_pass_through_columns"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789503443.5855522, "supported_languages": null}, "macro.iterable.get_list_user_columns": {"name": "get_list_user_columns", "resource_type": "macro", "package_name": "iterable", "path": "macros/staging/get_list_user_columns.sql", "original_file_path": "macros/staging/get_list_user_columns.sql", "unique_id": "macro.iterable.get_list_user_columns", "macro_sql": "{% macro get_list_user_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_id\", \"datatype\": dbt.type_string()},\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"index\", \"datatype\": dbt.type_int()},\n {\"name\": \"list_id\", \"datatype\": dbt.type_int()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.type_string", "macro.dbt.type_timestamp", "macro.dbt.type_int"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789503443.586711, "supported_languages": null}, "macro.iterable.json_to_string": {"name": "json_to_string", "resource_type": "macro", "package_name": "iterable", "path": "macros/staging/json_to_string.sql", "original_file_path": "macros/staging/json_to_string.sql", "unique_id": "macro.iterable.json_to_string", "macro_sql": "{%- macro json_to_string(column, column_list) -%}\n {{ return(adapter.dispatch('json_to_string', 'iterable')(column, column_list)) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.iterable.default__json_to_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "column", "type": null, "description": ""}, {"name": "column_list", "type": null, "description": ""}], "created_at": 1789503443.5874746, "supported_languages": null}, "macro.iterable.default__json_to_string": {"name": "default__json_to_string", "resource_type": "macro", "package_name": "iterable", "path": "macros/staging/json_to_string.sql", "original_file_path": "macros/staging/json_to_string.sql", "unique_id": "macro.iterable.default__json_to_string", "macro_sql": "{%- macro default__json_to_string(column, column_list) -%}\n cast({{ column }} as {{ dbt.type_string() }})\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "column", "type": null, "description": ""}, {"name": "column_list", "type": null, "description": ""}], "created_at": 1789503443.587795, "supported_languages": null}, "macro.iterable.bigquery__json_to_string": {"name": "bigquery__json_to_string", "resource_type": "macro", "package_name": "iterable", "path": "macros/staging/json_to_string.sql", "original_file_path": "macros/staging/json_to_string.sql", "unique_id": "macro.iterable.bigquery__json_to_string", "macro_sql": "{%- macro bigquery__json_to_string(column, column_list) -%}\n {%- set columns = column_list -%}\n {%- set ns = namespace(column_type='string') -%}\n\n {%- for col in columns -%}\n {%- if col.name|lower == column|lower -%}\n {%- set ns.column_type = col.dtype|lower -%}\n {%- endif -%}\n {%- endfor -%}\n\n {%- if ns.column_type == 'json' -%}\n to_json_string({{ column }})\n {%- else -%}\n cast({{ column }} as {{ dbt.type_string() }})\n {%- endif -%}\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "column", "type": null, "description": ""}, {"name": "column_list", "type": null, "description": ""}], "created_at": 1789503443.588904, "supported_languages": null}, "macro.iterable.get_user_unsubscribed_message_type_columns": {"name": "get_user_unsubscribed_message_type_columns", "resource_type": "macro", "package_name": "iterable", "path": "macros/staging/get_user_unsubscribed_message_type_columns.sql", "original_file_path": "macros/staging/get_user_unsubscribed_message_type_columns.sql", "unique_id": "macro.iterable.get_user_unsubscribed_message_type_columns", "macro_sql": "{% macro get_user_unsubscribed_message_type_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"_fivetran_id\", \"datatype\": dbt.type_string()},\n {\"name\": \"message_type_id\", \"datatype\": dbt.type_string()},\n {\"name\": \"email\", \"datatype\": dbt.type_string()},\n {\"name\": \"updated_at\", \"datatype\": dbt.type_timestamp()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.type_timestamp", "macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789503443.590241, "supported_languages": null}, "macro.iterable.does_table_exist": {"name": "does_table_exist", "resource_type": "macro", "package_name": "iterable", "path": "macros/staging/does_table_exist.sql", "original_file_path": "macros/staging/does_table_exist.sql", "unique_id": "macro.iterable.does_table_exist", "macro_sql": "{%- macro does_table_exist(table_name) -%}\n {%- if execute -%} -- returns true when dbt is in execute mode\n {%- set ns = namespace(has_table=false) -%} -- declare boolean namespace and default value \n {%- for node in graph.sources.values() -%} -- grab sources from the dictionary of nodes \n -- call the database for the matching table\n {%- if node.name | lower == table_name | lower -%} \n {%- set source_relation = adapter.get_relation(\n database=node.database,\n schema=node.schema,\n identifier=node.identifier ) -%}\n {% endif %}\n {%- if source_relation == None -%} \n {{ return(False) }} -- return false if relation identified by the database.schema.identifier does not exist for the given table name\n {% endif %}\n {%- endfor -%}\n {{ return(True) }}\n {%- endif -%} \n{%- endmacro -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "table_name", "type": null, "description": ""}], "created_at": 1789503443.5917642, "supported_languages": null}, "macro.iterable.get_user_history_columns": {"name": "get_user_history_columns", "resource_type": "macro", "package_name": "iterable", "path": "macros/staging/get_user_history_columns.sql", "original_file_path": "macros/staging/get_user_history_columns.sql", "unique_id": "macro.iterable.get_user_history_columns", "macro_sql": "{% macro get_user_history_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_id\", \"datatype\": dbt.type_string()},\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"email\", \"datatype\": dbt.type_string()},\n {\"name\": \"email_list_ids\", \"datatype\": dbt.type_string()},\n {\"name\": \"first_name\", \"datatype\": dbt.type_string()},\n {\"name\": \"last_name\", \"datatype\": dbt.type_string()},\n {\"name\": \"phone_number\", \"datatype\": dbt.type_string()},\n {\"name\": \"signup_date\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"signup_source\", \"datatype\": dbt.type_string()},\n {\"name\": \"updated_at\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"user_id\", \"datatype\": dbt.type_string()},\n {\"name\": \"iterable_user_id\", \"datatype\": dbt.type_string()}\n\n] %}\n\n{{ fivetran_utils.add_pass_through_columns(columns, var('iterable_user_history_pass_through_columns')) }}\n\n{{ return(columns) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.type_string", "macro.dbt.type_timestamp", "macro.fivetran_utils.add_pass_through_columns"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789503443.5944695, "supported_languages": null}, "macro.iterable.get_campaign_suppression_list_history_columns": {"name": "get_campaign_suppression_list_history_columns", "resource_type": "macro", "package_name": "iterable", "path": "macros/staging/get_campaign_suppression_list_history_columns.sql", "original_file_path": "macros/staging/get_campaign_suppression_list_history_columns.sql", "unique_id": "macro.iterable.get_campaign_suppression_list_history_columns", "macro_sql": "{% macro get_campaign_suppression_list_history_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"campaign_id\", \"datatype\": dbt.type_int()},\n {\"name\": \"suppressed_list_id\", \"datatype\": dbt.type_int()},\n {\"name\": \"updated_at\", \"datatype\": dbt.type_timestamp()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.type_timestamp", "macro.dbt.type_int"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789503443.5956209, "supported_languages": null}, "macro.iterable.get_user_unsubscribed_channel_columns": {"name": "get_user_unsubscribed_channel_columns", "resource_type": "macro", "package_name": "iterable", "path": "macros/staging/get_user_unsubscribed_channel_columns.sql", "original_file_path": "macros/staging/get_user_unsubscribed_channel_columns.sql", "unique_id": "macro.iterable.get_user_unsubscribed_channel_columns", "macro_sql": "{% macro get_user_unsubscribed_channel_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"_fivetran_id\", \"datatype\": dbt.type_string()},\n {\"name\": \"channel_id\", \"datatype\": dbt.type_int()},\n {\"name\": \"email\", \"datatype\": dbt.type_string()},\n {\"name\": \"updated_at\", \"datatype\": dbt.type_timestamp()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.type_timestamp", "macro.dbt.type_string", "macro.dbt.type_int"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789503443.5969286, "supported_languages": null}, "macro.iterable.get_message_type_columns": {"name": "get_message_type_columns", "resource_type": "macro", "package_name": "iterable", "path": "macros/staging/get_message_type_columns.sql", "original_file_path": "macros/staging/get_message_type_columns.sql", "unique_id": "macro.iterable.get_message_type_columns", "macro_sql": "{% macro get_message_type_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_deleted\", \"datatype\": \"boolean\"},\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"channel_id\", \"datatype\": dbt.type_int()},\n {\"name\": \"id\", \"datatype\": dbt.type_int()},\n {\"name\": \"name\", \"datatype\": dbt.type_string()},\n {\"name\": \"created_at\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"frequency_cap\", \"datatype\": dbt.type_string()},\n {\"name\": \"rate_limit_per_minute\", \"datatype\": dbt.type_string()},\n {\"name\": \"subscription_policy\", \"datatype\": dbt.type_string()},\n {\"name\": \"updated_at\", \"datatype\": dbt.type_timestamp()},\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.type_timestamp", "macro.dbt.type_int", "macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789503443.5992413, "supported_languages": null}, "macro.iterable.get_channel_columns": {"name": "get_channel_columns", "resource_type": "macro", "package_name": "iterable", "path": "macros/staging/get_channel_columns.sql", "original_file_path": "macros/staging/get_channel_columns.sql", "unique_id": "macro.iterable.get_channel_columns", "macro_sql": "{% macro get_channel_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_deleted\", \"datatype\": \"boolean\"},\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"channel_type\", \"datatype\": dbt.type_string()},\n {\"name\": \"id\", \"datatype\": dbt.type_int()},\n {\"name\": \"message_medium\", \"datatype\": dbt.type_string()},\n {\"name\": \"name\", \"datatype\": dbt.type_string()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.type_timestamp", "macro.dbt.type_string", "macro.dbt.type_int"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789503443.6007142, "supported_languages": null}, "macro.fivetran_utils.enabled_vars_one_true": {"name": "enabled_vars_one_true", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/enabled_vars_one_true.sql", "original_file_path": "macros/enabled_vars_one_true.sql", "unique_id": "macro.fivetran_utils.enabled_vars_one_true", "macro_sql": "{% macro enabled_vars_one_true(vars) %}\n\n{% for v in vars %}\n \n {% if var(v, False) == True %}\n {{ return(True) }}\n {% endif %}\n\n{% endfor %}\n\n{{ return(False) }}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "vars", "type": null, "description": ""}], "created_at": 1789503443.6015048, "supported_languages": null}, "macro.fivetran_utils.json_parse": {"name": "json_parse", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/json_parse.sql", "original_file_path": "macros/json_parse.sql", "unique_id": "macro.fivetran_utils.json_parse", "macro_sql": "{% macro json_parse(string, string_path) -%}\n\n{{ adapter.dispatch('json_parse', 'fivetran_utils') (string, string_path) }}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.postgres__json_parse"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "string", "type": null, "description": ""}, {"name": "string_path", "type": null, "description": ""}], "created_at": 1789503443.6027572, "supported_languages": null}, "macro.fivetran_utils.default__json_parse": {"name": "default__json_parse", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/json_parse.sql", "original_file_path": "macros/json_parse.sql", "unique_id": "macro.fivetran_utils.default__json_parse", "macro_sql": "{% macro default__json_parse(string, string_path) %}\n\n json_extract_path_text({{string}}, {%- for s in string_path -%}'{{ s }}'{%- if not loop.last -%},{%- endif -%}{%- endfor -%} )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "string", "type": null, "description": ""}, {"name": "string_path", "type": null, "description": ""}], "created_at": 1789503443.6032987, "supported_languages": null}, "macro.fivetran_utils.redshift__json_parse": {"name": "redshift__json_parse", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/json_parse.sql", "original_file_path": "macros/json_parse.sql", "unique_id": "macro.fivetran_utils.redshift__json_parse", "macro_sql": "{% macro redshift__json_parse(string, string_path) %}\n\n json_extract_path_text({{string}}, {%- for s in string_path -%}'{{ s }}'{%- if not loop.last -%},{%- endif -%}{%- endfor -%} )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "string", "type": null, "description": ""}, {"name": "string_path", "type": null, "description": ""}], "created_at": 1789503443.603809, "supported_languages": null}, "macro.fivetran_utils.bigquery__json_parse": {"name": "bigquery__json_parse", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/json_parse.sql", "original_file_path": "macros/json_parse.sql", "unique_id": "macro.fivetran_utils.bigquery__json_parse", "macro_sql": "{% macro bigquery__json_parse(string, string_path) %}\n\n \n json_extract_scalar({{string}}, '$.{%- for s in string_path -%}{{ s }}{%- if not loop.last -%}.{%- endif -%}{%- endfor -%} ')\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "string", "type": null, "description": ""}, {"name": "string_path", "type": null, "description": ""}], "created_at": 1789503443.6043305, "supported_languages": null}, "macro.fivetran_utils.postgres__json_parse": {"name": "postgres__json_parse", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/json_parse.sql", "original_file_path": "macros/json_parse.sql", "unique_id": "macro.fivetran_utils.postgres__json_parse", "macro_sql": "{% macro postgres__json_parse(string, string_path) %}\n\n {{string}}::json #>> '{ {%- for s in string_path -%}{{ s }}{%- if not loop.last -%},{%- endif -%}{%- endfor -%} }'\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "string", "type": null, "description": ""}, {"name": "string_path", "type": null, "description": ""}], "created_at": 1789503443.6048305, "supported_languages": null}, "macro.fivetran_utils.snowflake__json_parse": {"name": "snowflake__json_parse", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/json_parse.sql", "original_file_path": "macros/json_parse.sql", "unique_id": "macro.fivetran_utils.snowflake__json_parse", "macro_sql": "{% macro snowflake__json_parse(string, string_path) %}\n\n parse_json( {{string}} ) {%- for s in string_path -%}{% if s is number %}[{{ s }}]{% else %}['{{ s }}']{% endif %}{%- endfor -%}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "string", "type": null, "description": ""}, {"name": "string_path", "type": null, "description": ""}], "created_at": 1789503443.6053982, "supported_languages": null}, "macro.fivetran_utils.spark__json_parse": {"name": "spark__json_parse", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/json_parse.sql", "original_file_path": "macros/json_parse.sql", "unique_id": "macro.fivetran_utils.spark__json_parse", "macro_sql": "{% macro spark__json_parse(string, string_path) %}\n\n {{string}} : {%- for s in string_path -%}{% if s is number %}[{{ s }}]{% else %}['{{ s }}']{% endif %}{%- endfor -%}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "string", "type": null, "description": ""}, {"name": "string_path", "type": null, "description": ""}], "created_at": 1789503443.605931, "supported_languages": null}, "macro.fivetran_utils.sqlserver__json_parse": {"name": "sqlserver__json_parse", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/json_parse.sql", "original_file_path": "macros/json_parse.sql", "unique_id": "macro.fivetran_utils.sqlserver__json_parse", "macro_sql": "{% macro sqlserver__json_parse(string, string_path) %}\n\n json_value({{string}}, '$.{%- for s in string_path -%}{{ s }}{%- if not loop.last -%}.{%- endif -%}{%- endfor -%} ')\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "string", "type": null, "description": ""}, {"name": "string_path", "type": null, "description": ""}], "created_at": 1789503443.606451, "supported_languages": null}, "macro.fivetran_utils.duckdb__json_parse": {"name": "duckdb__json_parse", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/json_parse.sql", "original_file_path": "macros/json_parse.sql", "unique_id": "macro.fivetran_utils.duckdb__json_parse", "macro_sql": "{% macro duckdb__json_parse(string, string_path) %}\n\n json_extract_string({{string}}, '${%- for s in string_path -%}{% if s is number %}[{{ s }}]{% else %}.{{ s }}{% endif %}{%- endfor -%}')\n \n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "string", "type": null, "description": ""}, {"name": "string_path", "type": null, "description": ""}], "created_at": 1789503443.6070116, "supported_languages": null}, "macro.fivetran_utils.union_relations_custom": {"name": "union_relations_custom", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/union_relations_custom.sql", "original_file_path": "macros/union_relations_custom.sql", "unique_id": "macro.fivetran_utils.union_relations_custom", "macro_sql": "{%- macro union_relations_custom(relations, aliases=none, column_override=none, include=[], exclude=[], source_column_name='_dbt_source_relation', where=none) -%}\n {{ return(adapter.dispatch('union_relations_custom', 'fivetran_utils')(relations, aliases, column_override, include, exclude, source_column_name, where)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.default__union_relations_custom"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relations", "type": null, "description": ""}, {"name": "aliases", "type": null, "description": ""}, {"name": "column_override", "type": null, "description": ""}, {"name": "include", "type": null, "description": ""}, {"name": "exclude", "type": null, "description": ""}, {"name": "source_column_name", "type": null, "description": ""}, {"name": "where", "type": null, "description": ""}], "created_at": 1789503443.60916, "supported_languages": null}, "macro.fivetran_utils.default__union_relations_custom": {"name": "default__union_relations_custom", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/union_relations_custom.sql", "original_file_path": "macros/union_relations_custom.sql", "unique_id": "macro.fivetran_utils.default__union_relations_custom", "macro_sql": "\n\n{%- macro default__union_relations_custom(relations, aliases=none, column_override=none, include=[], exclude=[], source_column_name='_dbt_source_relation', where=none) -%}\n\n {%- if exclude and include -%}\n {{ exceptions.raise_compiler_error(\"Both an exclude and include list were provided to the `union` macro. Only one is allowed\") }}\n {%- endif -%}\n\n {#-- Prevent querying of db in parsing mode. This works because this macro does not create any new refs. -#}\n {%- if not execute %}\n {{ return('') }}\n {% endif -%}\n\n {%- set column_override = column_override if column_override is not none else {} -%}\n\n {%- set relation_columns = {} -%}\n {%- set column_superset = {} -%}\n {%- set all_excludes = [] -%}\n {%- set all_includes = [] -%}\n\n {%- if exclude -%}\n {%- for exc in exclude -%}\n {%- do all_excludes.append(exc | lower) -%}\n {%- endfor -%}\n {%- endif -%}\n\n {%- if include -%}\n {%- for inc in include -%}\n {%- do all_includes.append(inc | lower) -%}\n {%- endfor -%}\n {%- endif -%}\n\n {%- for relation in relations -%}\n\n {%- do relation_columns.update({relation: []}) -%}\n\n {%- do dbt_utils._is_relation(relation, 'union_relations_custom') -%}\n {%- do dbt_utils._is_ephemeral(relation, 'union_relations_custom') -%}\n {%- set cols = adapter.get_columns_in_relation(relation) -%}\n {%- for col in cols -%}\n\n {#- If an exclude list was provided and the column is in the list, do nothing -#}\n {%- if exclude and col.column | lower in all_excludes -%}\n\n {#- If an include list was provided and the column is not in the list, do nothing -#}\n {%- elif include and col.column | lower not in all_includes -%}\n\n {#- Otherwise add the column to the column superset -#}\n {%- else -%}\n\n {#- update the list of columns in this relation -#}\n {%- do relation_columns[relation].append(col.column) -%}\n\n {%- if col.column in column_superset -%}\n\n {%- set stored = column_superset[col.column] -%}\n {%- if col.is_string() and stored.is_string() and col.string_size() > stored.string_size() -%}\n\n {%- do column_superset.update({col.column: col}) -%}\n\n {%- endif %}\n\n {%- else -%}\n\n {%- do column_superset.update({col.column: col}) -%}\n\n {%- endif -%}\n\n {%- endif -%}\n\n {%- endfor -%}\n {%- endfor -%}\n\n {%- set ordered_column_names = column_superset.keys() -%}\n {%- set dbt_command = flags.WHICH -%}\n\n\n {% if dbt_command in ['run', 'build'] %}\n {% if (include | length > 0 or exclude | length > 0) and not column_superset.keys() %}\n {%- set relations_string -%}\n {%- for relation in relations -%}\n {{ relation.name }}\n {%- if not loop.last %}, {% endif -%}\n {%- endfor -%}\n {%- endset -%}\n\n {%- set error_message -%}\n There were no columns found to union for relations {{ relations_string }}\n {%- endset -%}\n\n {{ exceptions.raise_compiler_error(error_message) }}\n {%- endif -%}\n {%- endif -%}\n\n {%- for relation in relations %}\n\n (\n select\n\n {%- if source_column_name is not none %}\n {# dbt_utils union_relations includes the table in the source_relation. For Fivetran dbt package purposes the table should not be included in the source relation. #}\n cast({{ dbt.string_literal(relation.database ~ '.' ~ relation.schema) }} as {{ dbt.type_string() }}) as {{ source_column_name }},\n {%- endif %}\n\n {% for col_name in ordered_column_names -%}\n\n {%- set col = column_superset[col_name] %}\n {%- set col_type = column_override.get(col.column, col.data_type) %}\n {%- set col_name = adapter.quote(col_name) if col_name in relation_columns[relation] else 'null' %}\n cast({{ col_name }} as {{ col_type }}) as {{ col.quoted }} {% if not loop.last %},{% endif -%}\n\n {%- endfor %}\n \n {# This alias is a change from dbt_utils union_relations code. Avoids errors if the table is named a reserved keyword #}\n from {{ aliases[loop.index0] if aliases else relation }} as unioned_relation_{{ loop.index }}\n\n {% if where -%}\n where {{ where }}\n {%- endif %}\n )\n\n {% if not loop.last -%}\n union all\n {% endif -%}\n\n {%- endfor -%}\n\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt_utils._is_relation", "macro.dbt_utils._is_ephemeral", "macro.dbt.string_literal", "macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relations", "type": null, "description": ""}, {"name": "aliases", "type": null, "description": ""}, {"name": "column_override", "type": null, "description": ""}, {"name": "include", "type": null, "description": ""}, {"name": "exclude", "type": null, "description": ""}, {"name": "source_column_name", "type": null, "description": ""}, {"name": "where", "type": null, "description": ""}], "created_at": 1789503443.6163406, "supported_languages": null}, "macro.fivetran_utils.seed_data_helper": {"name": "seed_data_helper", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/seed_data_helper.sql", "original_file_path": "macros/seed_data_helper.sql", "unique_id": "macro.fivetran_utils.seed_data_helper", "macro_sql": "{% macro seed_data_helper(seed_name, warehouses) %}\n\n{% if target.type in warehouses %}\n {% for w in warehouses %}\n {% if target.type == w %}\n {{ return(ref(seed_name ~ \"_\" ~ w ~ \"\")) }}\n {% endif %}\n {% endfor %}\n{% else %}\n{{ return(ref(seed_name)) }}\n{% endif %}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "seed_name", "type": null, "description": ""}, {"name": "warehouses", "type": null, "description": ""}], "created_at": 1789503443.6175082, "supported_languages": null}, "macro.fivetran_utils.drop_schemas_automation": {"name": "drop_schemas_automation", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/drop_schemas_automation.sql", "original_file_path": "macros/drop_schemas_automation.sql", "unique_id": "macro.fivetran_utils.drop_schemas_automation", "macro_sql": "{% macro drop_schemas_automation(drop_target_schema=true) %}\n {{ return(adapter.dispatch('drop_schemas_automation', 'fivetran_utils')(drop_target_schema)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.default__drop_schemas_automation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "drop_target_schema", "type": null, "description": ""}], "created_at": 1789503443.6184223, "supported_languages": null}, "macro.fivetran_utils.default__drop_schemas_automation": {"name": "default__drop_schemas_automation", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/drop_schemas_automation.sql", "original_file_path": "macros/drop_schemas_automation.sql", "unique_id": "macro.fivetran_utils.default__drop_schemas_automation", "macro_sql": "{% macro default__drop_schemas_automation(drop_target_schema=true) %}\n\n{% set fetch_list_sql %}\n {% if target.type not in ('databricks', 'spark') %}\n select schema_name\n from \n {{ wrap_in_quotes(target.database) }}.INFORMATION_SCHEMA.SCHEMATA\n where lower(schema_name) like '{{ target.schema | lower }}{%- if not drop_target_schema -%}_{%- endif -%}%'\n {% else %}\n SHOW SCHEMAS LIKE '{{ target.schema }}{%- if not drop_target_schema -%}_{%- endif -%}*'\n {% endif %}\n{% endset %}\n\n{% set results = run_query(fetch_list_sql) %}\n\n{% if execute %}\n {% set results_list = results.columns[0].values() %}\n{% else %}\n {% set results_list = [] %}\n{% endif %}\n\n{% for schema_to_drop in results_list %}\n {% do adapter.drop_schema(api.Relation.create(database=target.database, schema=schema_to_drop)) %}\n {{ print('Schema ' ~ schema_to_drop ~ ' successfully dropped from the ' ~ target.database ~ ' database.\\n')}}\n{% endfor %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.wrap_in_quotes", "macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "drop_target_schema", "type": null, "description": ""}], "created_at": 1789503443.6204474, "supported_languages": null}, "macro.fivetran_utils.duckdb__drop_schemas_automation": {"name": "duckdb__drop_schemas_automation", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/drop_schemas_automation.sql", "original_file_path": "macros/drop_schemas_automation.sql", "unique_id": "macro.fivetran_utils.duckdb__drop_schemas_automation", "macro_sql": "{% macro duckdb__drop_schemas_automation(drop_target_schema=true) %}\n\n {{ print('Not dropping any schemas in DuckDB.\\n') }}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "drop_target_schema", "type": null, "description": ""}], "created_at": 1789503443.6207561, "supported_languages": null}, "macro.fivetran_utils.ceiling": {"name": "ceiling", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/ceiling.sql", "original_file_path": "macros/ceiling.sql", "unique_id": "macro.fivetran_utils.ceiling", "macro_sql": "{% macro ceiling(num) -%}\n\n{{ adapter.dispatch('ceiling', 'fivetran_utils') (num) }}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.default__ceiling"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "num", "type": null, "description": ""}], "created_at": 1789503443.6212766, "supported_languages": null}, "macro.fivetran_utils.default__ceiling": {"name": "default__ceiling", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/ceiling.sql", "original_file_path": "macros/ceiling.sql", "unique_id": "macro.fivetran_utils.default__ceiling", "macro_sql": "{% macro default__ceiling(num) %}\n ceiling({{ num }})\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "num", "type": null, "description": ""}], "created_at": 1789503443.6215022, "supported_languages": null}, "macro.fivetran_utils.snowflake__ceiling": {"name": "snowflake__ceiling", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/ceiling.sql", "original_file_path": "macros/ceiling.sql", "unique_id": "macro.fivetran_utils.snowflake__ceiling", "macro_sql": "{% macro snowflake__ceiling(num) %}\n ceil({{ num }})\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "num", "type": null, "description": ""}], "created_at": 1789503443.6217175, "supported_languages": null}, "macro.fivetran_utils.fill_pass_through_columns": {"name": "fill_pass_through_columns", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/fill_pass_through_columns.sql", "original_file_path": "macros/fill_pass_through_columns.sql", "unique_id": "macro.fivetran_utils.fill_pass_through_columns", "macro_sql": "{% macro fill_pass_through_columns(pass_through_variable) %}\n\n{% if var(pass_through_variable) %}\n {% for field in var(pass_through_variable) %}\n {% if field is mapping %}\n {% if field.transform_sql %}\n , {{ field.transform_sql }} as {{ field.alias if field.alias else field.name }}\n {% else %}\n , {{ field.alias if field.alias else field.name }}\n {% endif %}\n {% else %}\n , {{ field }}\n {% endif %}\n {% endfor %}\n{% endif %}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "pass_through_variable", "type": null, "description": ""}], "created_at": 1789503443.6230884, "supported_languages": null}, "macro.fivetran_utils.persist_pass_through_columns": {"name": "persist_pass_through_columns", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/persist_pass_through_columns.sql", "original_file_path": "macros/persist_pass_through_columns.sql", "unique_id": "macro.fivetran_utils.persist_pass_through_columns", "macro_sql": "{% macro persist_pass_through_columns(pass_through_variable, identifier=none, transform='') %}\n\n{% if var(pass_through_variable, none) %}\n {% for field in var(pass_through_variable) %}\n , {{ transform ~ '(' ~ (identifier ~ '.' if identifier else '') ~ (field.alias if field.alias else field.name) ~ ')' }} as {{ field.alias if field.alias else field.name }}\n {% endfor %}\n{% endif %}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "pass_through_variable", "type": null, "description": ""}, {"name": "identifier", "type": null, "description": ""}, {"name": "transform", "type": null, "description": ""}], "created_at": 1789503443.624333, "supported_languages": null}, "macro.fivetran_utils.try_cast": {"name": "try_cast", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/try_cast.sql", "original_file_path": "macros/try_cast.sql", "unique_id": "macro.fivetran_utils.try_cast", "macro_sql": "{% macro try_cast(field, type) %}\n {{ adapter.dispatch('try_cast', 'fivetran_utils') (field, type) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.postgres__try_cast"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field", "type": null, "description": ""}, {"name": "type", "type": null, "description": ""}], "created_at": 1789503443.6253326, "supported_languages": null}, "macro.fivetran_utils.default__try_cast": {"name": "default__try_cast", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/try_cast.sql", "original_file_path": "macros/try_cast.sql", "unique_id": "macro.fivetran_utils.default__try_cast", "macro_sql": "{% macro default__try_cast(field, type) %}\n {# most databases don't support this function yet\n so we just need to use cast #}\n cast({{field}} as {{type}})\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field", "type": null, "description": ""}, {"name": "type", "type": null, "description": ""}], "created_at": 1789503443.6256287, "supported_languages": null}, "macro.fivetran_utils.redshift__try_cast": {"name": "redshift__try_cast", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/try_cast.sql", "original_file_path": "macros/try_cast.sql", "unique_id": "macro.fivetran_utils.redshift__try_cast", "macro_sql": "{% macro redshift__try_cast(field, type) %}\n{%- if type == 'numeric' -%}\n\n case\n when trim({{field}}) ~ '^(0|[1-9][0-9]*)$' then trim({{field}})\n else null\n end::{{type}}\n\n{% else %}\n {{ exceptions.raise_compiler_error(\n \"non-numeric datatypes are not currently supported\") }}\n\n{% endif %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field", "type": null, "description": ""}, {"name": "type", "type": null, "description": ""}], "created_at": 1789503443.6262183, "supported_languages": null}, "macro.fivetran_utils.postgres__try_cast": {"name": "postgres__try_cast", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/try_cast.sql", "original_file_path": "macros/try_cast.sql", "unique_id": "macro.fivetran_utils.postgres__try_cast", "macro_sql": "{% macro postgres__try_cast(field, type) %}\n{%- if type == 'numeric' -%}\n\n case\n when replace(cast({{field}} as varchar),cast(' ' as varchar),cast('' as varchar)) ~ '^(0|[1-9][0-9]*)$' \n then replace(cast({{field}} as varchar),cast(' ' as varchar),cast('' as varchar))\n else null\n end::{{type}}\n\n{% else %}\n {{ exceptions.raise_compiler_error(\n \"non-numeric datatypes are not currently supported\") }}\n\n{% endif %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field", "type": null, "description": ""}, {"name": "type", "type": null, "description": ""}], "created_at": 1789503443.6268106, "supported_languages": null}, "macro.fivetran_utils.snowflake__try_cast": {"name": "snowflake__try_cast", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/try_cast.sql", "original_file_path": "macros/try_cast.sql", "unique_id": "macro.fivetran_utils.snowflake__try_cast", "macro_sql": "{% macro snowflake__try_cast(field, type) %}\n try_cast(cast({{field}} as varchar) as {{type}})\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field", "type": null, "description": ""}, {"name": "type", "type": null, "description": ""}], "created_at": 1789503443.6271176, "supported_languages": null}, "macro.fivetran_utils.bigquery__try_cast": {"name": "bigquery__try_cast", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/try_cast.sql", "original_file_path": "macros/try_cast.sql", "unique_id": "macro.fivetran_utils.bigquery__try_cast", "macro_sql": "{% macro bigquery__try_cast(field, type) %}\n safe_cast({{field}} as {{type}})\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field", "type": null, "description": ""}, {"name": "type", "type": null, "description": ""}], "created_at": 1789503443.6274874, "supported_languages": null}, "macro.fivetran_utils.spark__try_cast": {"name": "spark__try_cast", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/try_cast.sql", "original_file_path": "macros/try_cast.sql", "unique_id": "macro.fivetran_utils.spark__try_cast", "macro_sql": "{% macro spark__try_cast(field, type) %}\n try_cast({{field}} as {{type}})\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field", "type": null, "description": ""}, {"name": "type", "type": null, "description": ""}], "created_at": 1789503443.6277585, "supported_languages": null}, "macro.fivetran_utils.sqlserver__try_cast": {"name": "sqlserver__try_cast", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/try_cast.sql", "original_file_path": "macros/try_cast.sql", "unique_id": "macro.fivetran_utils.sqlserver__try_cast", "macro_sql": "{% macro sqlserver__try_cast(field, type) %}\n try_cast({{field}} as {{type}})\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field", "type": null, "description": ""}, {"name": "type", "type": null, "description": ""}], "created_at": 1789503443.628055, "supported_languages": null}, "macro.fivetran_utils.fivetran_date_spine": {"name": "fivetran_date_spine", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/fivetran_date_spine.sql", "original_file_path": "macros/fivetran_date_spine.sql", "unique_id": "macro.fivetran_utils.fivetran_date_spine", "macro_sql": "{% macro fivetran_date_spine(datepart, start_date, end_date) -%}\n\n{{ return(adapter.dispatch('fivetran_date_spine', 'fivetran_utils') (datepart, start_date, end_date)) }}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.default__fivetran_date_spine"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "datepart", "type": null, "description": ""}, {"name": "start_date", "type": null, "description": ""}, {"name": "end_date", "type": null, "description": ""}], "created_at": 1789503443.6290777, "supported_languages": null}, "macro.fivetran_utils.default__fivetran_date_spine": {"name": "default__fivetran_date_spine", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/fivetran_date_spine.sql", "original_file_path": "macros/fivetran_date_spine.sql", "unique_id": "macro.fivetran_utils.default__fivetran_date_spine", "macro_sql": "{% macro default__fivetran_date_spine(datepart, start_date, end_date) %}\n\n {{ dbt_utils.date_spine(datepart, start_date, end_date) }}\n \n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.date_spine"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "datepart", "type": null, "description": ""}, {"name": "start_date", "type": null, "description": ""}, {"name": "end_date", "type": null, "description": ""}], "created_at": 1789503443.6294503, "supported_languages": null}, "macro.fivetran_utils.sqlserver__fivetran_date_spine": {"name": "sqlserver__fivetran_date_spine", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/fivetran_date_spine.sql", "original_file_path": "macros/fivetran_date_spine.sql", "unique_id": "macro.fivetran_utils.sqlserver__fivetran_date_spine", "macro_sql": "{% macro sqlserver__fivetran_date_spine(datepart, start_date, end_date) -%}\n\n {% set date_spine_query %}\n with\n\n l0 as (\n\n select c\n from (select 1 union all select 1) as d(c)\n\n ),\n l1 as (\n\n select\n 1 as c\n from l0 as a\n cross join l0 as b\n\n ),\n\n l2 as (\n\n select 1 as c\n from l1 as a\n cross join l1 as b\n ),\n\n l3 as (\n\n select 1 as c\n from l2 as a\n cross join l2 as b\n ),\n\n l4 as (\n\n select 1 as c\n from l3 as a\n cross join l3 as b\n ),\n\n l5 as (\n\n select 1 as c\n from l4 as a\n cross join l4 as b\n ),\n\n nums as (\n\n select row_number() over (order by (select null)) as rownum\n from l5\n ),\n\n rawdata as (\n\n select top ({{dbt.datediff(start_date, end_date, datepart)}}) rownum -1 as n\n from nums\n order by rownum\n ),\n\n all_periods as (\n\n select (\n {{\n dbt.dateadd(\n datepart,\n 'n',\n start_date\n )\n }}\n ) as date_{{datepart}}\n from rawdata\n ),\n\n filtered as (\n\n select *\n from all_periods\n where date_{{datepart}} <= {{ end_date }}\n\n )\n\n select * from filtered\n order by 1\n\n {% endset %}\n\n {% set results = run_query(date_spine_query) %}\n\n {% if execute %}\n\n {% set results_list = results.columns[0].values() %}\n \n {% else %}\n\n {% set results_list = [] %}\n\n {% endif %}\n\n {%- for date_field in results_list %}\n select cast('{{ date_field }}' as date) as date_{{datepart}} {{ 'union all ' if not loop.last else '' }}\n {% endfor -%}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.datediff", "macro.dbt.dateadd", "macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "datepart", "type": null, "description": ""}, {"name": "start_date", "type": null, "description": ""}, {"name": "end_date", "type": null, "description": ""}], "created_at": 1789503443.631116, "supported_languages": null}, "macro.fivetran_utils.partition_by_source_relation": {"name": "partition_by_source_relation", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/partition_by_source_relation.sql", "original_file_path": "macros/partition_by_source_relation.sql", "unique_id": "macro.fivetran_utils.partition_by_source_relation", "macro_sql": "{% macro partition_by_source_relation(package_name, has_other_partitions='yes', alias=None, package_prefix_union_variable=true) %}\n {{ return(adapter.dispatch('partition_by_source_relation', 'fivetran_utils')(package_name, has_other_partitions, alias, package_prefix_union_variable)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.default__partition_by_source_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "package_name", "type": null, "description": ""}, {"name": "has_other_partitions", "type": null, "description": ""}, {"name": "alias", "type": null, "description": ""}, {"name": "package_prefix_union_variable", "type": null, "description": ""}], "created_at": 1789503443.6321442, "supported_languages": null}, "macro.fivetran_utils.default__partition_by_source_relation": {"name": "default__partition_by_source_relation", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/partition_by_source_relation.sql", "original_file_path": "macros/partition_by_source_relation.sql", "unique_id": "macro.fivetran_utils.default__partition_by_source_relation", "macro_sql": "{% macro default__partition_by_source_relation(package_name, has_other_partitions='yes', alias=None, package_prefix_union_variable=true) -%}\n\n{%- if package_prefix_union_variable %}\n {%- set union_schemas_var = package_name ~ '_union_schemas' -%}\n {%- set union_databases_var = package_name ~ '_union_databases' -%}\n{%- else %}\n {%- set union_schemas_var = 'union_schemas' -%}\n {%- set union_databases_var = 'union_databases' -%}\n{%- endif -%}\n\n{%- set is_unioning = var(union_schemas_var, [])|length > 1 or var(union_databases_var, [])|length > 1 or var(package_name ~ '_sources', [])|length > 1 -%}\n{%- set prefix = '' if alias is none else alias ~ '.' -%}\n\n{%- if has_other_partitions == 'no' -%}\n {{- 'partition by ' ~ prefix ~ 'source_relation' if is_unioning else '' -}}\n{%- else -%}\n {{- ', ' ~ prefix ~ 'source_relation' if is_unioning else '' -}}\n{%- endif -%}\n\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "package_name", "type": null, "description": ""}, {"name": "has_other_partitions", "type": null, "description": ""}, {"name": "alias", "type": null, "description": ""}, {"name": "package_prefix_union_variable", "type": null, "description": ""}], "created_at": 1789503443.6339514, "supported_languages": null}, "macro.fivetran_utils.fill_staging_columns": {"name": "fill_staging_columns", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/fill_staging_columns.sql", "original_file_path": "macros/fill_staging_columns.sql", "unique_id": "macro.fivetran_utils.fill_staging_columns", "macro_sql": "{% macro fill_staging_columns(source_columns, staging_columns) %}\n\n{%- set source_column_names = source_columns|map(attribute='name')|map('lower')|list -%}\n{%- set using_source_casing = var('fivetran_using_source_casing', false) -%}\n\n{%- for column in staging_columns %}\n {%- if column.name|lower in source_column_names %}\n {%- if using_source_casing %}\n {%- set column_alias = column.alias if 'alias' in column else column.name %}\n {{ adapter.quote(column.name) }} as {{ adapter.quote(column_alias|upper if target.type == 'snowflake' else column_alias) }}\n {%- else %}\n {{ fivetran_utils.quote_column(column) }} as\n {%- if 'alias' in column %} {{ column.alias }}{% else %} {{ fivetran_utils.quote_column(column) }}{% endif %}\n {%- endif %}\n {%- else %}\n cast(null as {{ column.datatype }}) as\n {%- if 'alias' in column %} {{ column.alias }}{% else %} {{ fivetran_utils.quote_column(column) }}{% endif %}\n {%- endif %}{{ ',' if not loop.last }}\n{%- endfor %}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.quote_column"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "source_columns", "type": null, "description": ""}, {"name": "staging_columns", "type": null, "description": ""}], "created_at": 1789503443.6369011, "supported_languages": null}, "macro.fivetran_utils.quote_column": {"name": "quote_column", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/fill_staging_columns.sql", "original_file_path": "macros/fill_staging_columns.sql", "unique_id": "macro.fivetran_utils.quote_column", "macro_sql": "{% macro quote_column(column) %}\n {%- if 'quote' in column %}\n {%- if column.quote %}\n {%- if target.type in ('bigquery', 'spark', 'databricks') %}\n `{{ column.name }}`\n {%- elif target.type == 'snowflake' %}\n \"{{ column.name | upper }}\"\n {%- else %}\n \"{{ column.name }}\"\n {%- endif %}\n {%- else %}{{ column.name }}\n {%- endif %}\n {%- else %}{{ column.name }}\n {%- endif %}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "column", "type": null, "description": ""}], "created_at": 1789503443.6384025, "supported_languages": null}, "macro.fivetran_utils.union_connections": {"name": "union_connections", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/union_connections.sql", "original_file_path": "macros/union_connections.sql", "unique_id": "macro.fivetran_utils.union_connections", "macro_sql": "{% macro union_connections(connection_dictionary, single_source_name, single_table_name, default_identifier=single_table_name) %}\n\n{{ adapter.dispatch('union_connections', 'fivetran_utils') (connection_dictionary, single_source_name, single_table_name, default_identifier) }}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.default__union_connections"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "connection_dictionary", "type": null, "description": ""}, {"name": "single_source_name", "type": null, "description": ""}, {"name": "single_table_name", "type": null, "description": ""}, {"name": "default_identifier", "type": null, "description": ""}], "created_at": 1789503443.6398907, "supported_languages": null}, "macro.fivetran_utils.default__union_connections": {"name": "default__union_connections", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/union_connections.sql", "original_file_path": "macros/union_connections.sql", "unique_id": "macro.fivetran_utils.default__union_connections", "macro_sql": "{% macro default__union_connections(connection_dictionary, single_source_name, single_table_name, default_identifier=single_table_name) %}\n\n{%- set exception_warning = \"\\n\\nPlease be aware: The \" ~ single_source_name|upper ~ \".\" ~ single_table_name|upper ~ \" table was not found in your schema(s). The Fivetran Data Model will create a completely empty staging model as to not break downstream transformations. To turn off these warnings, set the `fivetran__remove_empty_table_warnings` variable to TRUE (see https://github.com/fivetran/dbt_fivetran_utils/tree/releases/v0.4.latest#union_connections-source for details).\\n\"%}\n{%- set using_empty_table_warnings = (execute and not var('fivetran__remove_empty_table_warnings', false)) %}\n{%- set connections = var(connection_dictionary, []) %}\n{%- set using_unioning = connections | length > 0 %}\n{%- set identifier_var = single_source_name + \"_\" + single_table_name + \"_identifier\" %}\n\n{%- if using_unioning %}\n{# For unioning #}\n {%- set relations = [] -%}\n {%- for connection in connections -%}\n\n {% if var('has_defined_sources', false) %}\n {%- set database = source(connection.name, single_table_name).database %}\n {%- set schema = source(connection.name, single_table_name).schema %}\n {%- set identifier = source(connection.name, single_table_name).identifier %}\n {%- else %}\n {%- set database = connection.database if connection.database else target.database %}\n {%- set schema = connection.schema if connection.schema else single_source_name %}\n {%- set identifier = var(identifier_var, default_identifier) %}\n {%- endif %}\n \n {%- set relation=adapter.get_relation(\n database=database,\n schema=schema,\n identifier=identifier\n )\n -%}\n\n {%- if relation is not none -%}\n {%- do relations.append(relation) -%}\n {%- endif -%}\n\n -- ** Values passed to adapter.get_relation:\n {{ '-- database: ' ~ database }}\n {{ '-- schema: ' ~ schema }}\n {{ '-- identifier: ' ~ identifier ~ '\\n' }}\n\n {%- endfor -%}\n\n {%- if relations | length > 0 -%}\n {{ fivetran_utils.union_relations_custom(relations, source_column_name='_dbt_source_relation') }}\n\n {%- else -%}\n {{ exceptions.warn(exception_warning) if using_empty_table_warnings }}\n\n select\n cast(null as {{ dbt.type_string() }}) as _dbt_source_relation\n limit {{ '0' if target.type != 'redshift' else '1' }}\n {%- endif -%}\n\n{% else %}\n{# Not unioning #}\n\n {%- set database = source(single_source_name, single_table_name).database %}\n {%- set schema = source(single_source_name, single_table_name).schema %}\n {%- set identifier = var(identifier_var, default_identifier) %}\n\n {%- set relation=adapter.get_relation(\n database=database,\n schema=schema,\n identifier=identifier\n )\n -%}\n\n -- ** Values passed to adapter.get_relation:\n {{ '-- full-identifier_var: ' ~ identifier_var }}\n {{ '-- database: ' ~ database }} \n {{ '-- schema: ' ~ schema }}\n {{ '-- identifier: ' ~ identifier ~ '\\n' }}\n\n {% if relation is not none -%}\n select\n {{ dbt_utils.star(from=source(single_source_name, single_table_name)) }}\n from {{ source(single_source_name, single_table_name) }} as source_table\n\n {% else %}\n {{ exceptions.warn(exception_warning) if using_empty_table_warnings }}\n\n select\n cast(null as {{ dbt.type_string() }}) as _dbt_source_relation\n limit {{ '0' if target.type != 'redshift' else '1' }}\n {%- endif -%}\n{% endif -%}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.union_relations_custom", "macro.dbt.type_string", "macro.dbt_utils.star"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "connection_dictionary", "type": null, "description": ""}, {"name": "single_source_name", "type": null, "description": ""}, {"name": "single_table_name", "type": null, "description": ""}, {"name": "default_identifier", "type": null, "description": ""}], "created_at": 1789503443.6453402, "supported_languages": null}, "macro.fivetran_utils.source_relation": {"name": "source_relation", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/source_relation.sql", "original_file_path": "macros/source_relation.sql", "unique_id": "macro.fivetran_utils.source_relation", "macro_sql": "{% macro source_relation(union_schema_variable='union_schemas', union_database_variable='union_databases') -%}\n\n{{ adapter.dispatch('source_relation', 'fivetran_utils') (union_schema_variable, union_database_variable) }}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.default__source_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "union_schema_variable", "type": null, "description": ""}, {"name": "union_database_variable", "type": null, "description": ""}], "created_at": 1789503443.6461508, "supported_languages": null}, "macro.fivetran_utils.default__source_relation": {"name": "default__source_relation", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/source_relation.sql", "original_file_path": "macros/source_relation.sql", "unique_id": "macro.fivetran_utils.default__source_relation", "macro_sql": "{% macro default__source_relation(union_schema_variable, union_database_variable) %}\n\n{% if var(union_schema_variable, none) %}\n, case\n {% for schema in var(union_schema_variable) %}\n when lower(replace(replace(_dbt_source_relation,'\"',''),'`','')) like '%.{{ schema|lower }}.%' then '{{ schema|lower }}'\n {% endfor %}\n end as source_relation\n{% elif var(union_database_variable, none) %}\n, case\n {% for database in var(union_database_variable) %}\n when lower(replace(replace(_dbt_source_relation,'\"',''),'`','')) like '%{{ database|lower }}.%' then '{{ database|lower }}'\n {% endfor %}\n end as source_relation\n{% else %}\n, cast('' as {{ dbt.type_string() }}) as source_relation\n{% endif %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "union_schema_variable", "type": null, "description": ""}, {"name": "union_database_variable", "type": null, "description": ""}], "created_at": 1789503443.647329, "supported_languages": null}, "macro.fivetran_utils.apply_source_relation": {"name": "apply_source_relation", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/apply_source_relation.sql", "original_file_path": "macros/apply_source_relation.sql", "unique_id": "macro.fivetran_utils.apply_source_relation", "macro_sql": "{% macro apply_source_relation(package_name, use_package_prefix=true) -%}\n\n{{ adapter.dispatch('apply_source_relation', 'fivetran_utils') (package_name, use_package_prefix) }}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.default__apply_source_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "package_name", "type": null, "description": ""}, {"name": "use_package_prefix", "type": null, "description": ""}], "created_at": 1789503443.6481874, "supported_languages": null}, "macro.fivetran_utils.default__apply_source_relation": {"name": "default__apply_source_relation", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/apply_source_relation.sql", "original_file_path": "macros/apply_source_relation.sql", "unique_id": "macro.fivetran_utils.default__apply_source_relation", "macro_sql": "{% macro default__apply_source_relation(package_name, use_package_prefix=true) -%}\n\n{% set sources_var = package_name ~ '_sources' %}\n{% set database_var = package_name ~ '_database' %}\n{% set schema_var = package_name ~ '_schema' %}\n\n{% if use_package_prefix %}\n {% set union_schemas_var = package_name ~ '_union_schemas' %}\n {% set union_databases_var = package_name ~ '_union_databases' %}\n{% else %}\n {% set union_schemas_var = 'union_schemas' %}\n {% set union_databases_var = 'union_databases' %}\n{% endif %}\n\n{% if var(sources_var, []) | length > 0 %}\n, _dbt_source_relation as source_relation\n{% elif var(union_schemas_var, []) | length > 0 or var(union_databases_var, []) | length > 0 %}\n{{ fivetran_utils.source_relation(union_schema_variable=union_schemas_var, union_database_variable=union_databases_var) }}\n{% else %}\n{% set database = var(database_var, target.database) %}\n{% set schema = var(schema_var, package_name) %}\n, cast('{{ database ~ \".\" ~ schema }}' as {{ dbt.type_string() }}) as source_relation\n{% endif %}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.source_relation", "macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "package_name", "type": null, "description": ""}, {"name": "use_package_prefix", "type": null, "description": ""}], "created_at": 1789503443.6503806, "supported_languages": null}, "macro.fivetran_utils.calculated_fields": {"name": "calculated_fields", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/calculated_fields.sql", "original_file_path": "macros/calculated_fields.sql", "unique_id": "macro.fivetran_utils.calculated_fields", "macro_sql": "{% macro calculated_fields(variable) -%}\n\n{% if var(variable, none) %}\n {% for field in var(variable) %}\n , {{ field.transform_sql }} as {{ field.name }} \n {% endfor %}\n{% endif %}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "variable", "type": null, "description": ""}], "created_at": 1789503443.651146, "supported_languages": null}, "macro.fivetran_utils.union_data": {"name": "union_data", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/union_data.sql", "original_file_path": "macros/union_data.sql", "unique_id": "macro.fivetran_utils.union_data", "macro_sql": "{%- macro union_data(table_identifier, database_variable, schema_variable, default_database, default_schema, default_variable, union_schema_variable='union_schemas', union_database_variable='union_databases') -%}\n\n{{ adapter.dispatch('union_data', 'fivetran_utils') (\n table_identifier, \n database_variable, \n schema_variable, \n default_database, \n default_schema, \n default_variable,\n union_schema_variable,\n union_database_variable\n ) }}\n\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.fivetran_utils.default__union_data"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "table_identifier", "type": null, "description": ""}, {"name": "database_variable", "type": null, "description": ""}, {"name": "schema_variable", "type": null, "description": ""}, {"name": "default_database", "type": null, "description": ""}, {"name": "default_schema", "type": null, "description": ""}, {"name": "default_variable", "type": null, "description": ""}, {"name": "union_schema_variable", "type": null, "description": ""}, {"name": "union_database_variable", "type": null, "description": ""}], "created_at": 1789503443.6533885, "supported_languages": null}, "macro.fivetran_utils.default__union_data": {"name": "default__union_data", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/union_data.sql", "original_file_path": "macros/union_data.sql", "unique_id": "macro.fivetran_utils.default__union_data", "macro_sql": "{%- macro default__union_data(\n table_identifier, \n database_variable, \n schema_variable, \n default_database, \n default_schema, \n default_variable,\n union_schema_variable,\n union_database_variable\n ) -%}\n\n{%- if var(union_schema_variable, none) -%}\n\n {%- set relations = [] -%}\n \n {%- if var(union_schema_variable) is string -%}\n {%- set trimmed = var(union_schema_variable)|trim('[')|trim(']') -%}\n {%- set schemas = trimmed.split(',')|map('trim',\" \")|map('trim','\"')|map('trim',\"'\") -%}\n {%- else -%}\n {%- set schemas = var(union_schema_variable) -%}\n {%- endif -%}\n\n {%- for schema in var(union_schema_variable) -%}\n {%- set relation=adapter.get_relation(\n database=source(schema, table_identifier).database if var('has_defined_sources', false) else var(database_variable, default_database),\n schema=source(schema, table_identifier).schema if var('has_defined_sources', false) else schema,\n identifier=source(schema, table_identifier).identifier if var('has_defined_sources', false) else table_identifier\n ) -%}\n \n {%- set relation_exists=relation is not none -%}\n\n {%- if relation_exists -%}\n {%- do relations.append(relation) -%}\n {%- endif -%}\n\n {%- endfor -%}\n \n {%- if relations != [] -%}\n {{ dbt_utils.union_relations(relations) }}\n {%- else -%}\n {% if execute and not var('fivetran__remove_empty_table_warnings', false) -%}\n {{ exceptions.warn(\"\\n\\nPlease be aware: The \" ~ table_identifier|upper ~ \" table was not found in your \" ~ default_schema|upper ~ \" schema(s). The Fivetran dbt package will create a completely empty \" ~ table_identifier|upper ~ \" staging model as to not break downstream transformations. To turn off these warnings, set the `fivetran__remove_empty_table_warnings` variable to TRUE (see https://github.com/fivetran/dbt_fivetran_utils/tree/releases/v0.4.latest#union_data-source for details).\\n\") }}\n {% endif -%}\n select \n cast(null as {{ dbt.type_string() }}) as _dbt_source_relation\n limit 0\n {%- endif -%}\n\n{%- elif var(union_database_variable, none) -%}\n\n {%- set relations = [] -%}\n\n {%- for database in var(union_database_variable) -%}\n {%- set relation=adapter.get_relation(\n database=source(schema, table_identifier).database if var('has_defined_sources', false) else database,\n schema=source(schema, table_identifier).schema if var('has_defined_sources', false) else var(schema_variable, default_schema),\n identifier=source(schema, table_identifier).identifier if var('has_defined_sources', false) else table_identifier\n ) -%}\n\n {%- set relation_exists=relation is not none -%}\n\n {%- if relation_exists -%}\n {%- do relations.append(relation) -%}\n {%- endif -%}\n\n {%- endfor -%}\n\n {%- if relations != [] -%}\n {{ dbt_utils.union_relations(relations) }}\n {%- else -%}\n {% if execute and not var('fivetran__remove_empty_table_warnings', false) -%}\n {{ exceptions.warn(\"\\n\\nPlease be aware: The \" ~ table_identifier|upper ~ \" table was not found in your \" ~ default_schema|upper ~ \" schema(s). The Fivetran dbt package will create a completely empty \" ~ table_identifier|upper ~ \" staging model as to not break downstream transformations. To turn off these warnings, set the `fivetran__remove_empty_table_warnings` variable to TRUE (see https://github.com/fivetran/dbt_fivetran_utils/tree/releases/v0.4.latest#union_data-source for details).\\n\") }}\n {% endif -%}\n select \n cast(null as {{ dbt.type_string() }}) as _dbt_source_relation\n limit 0\n {%- endif -%}\n\n{%- else -%}\n {% set exception_schemas = {\"linkedin_company_pages\": \"linkedin_pages\", \"instagram_business_pages\": \"instagram_business\"} %}\n {% set relation = namespace(value=\"\") %}\n {% if default_schema in exception_schemas.keys() %}\n {% for corrected_schema_name in exception_schemas.items() %} \n {% if default_schema in corrected_schema_name %}\n {# In order for this macro to effectively work within upstream integration tests (mainly used by the Fivetran dbt package maintainers), this identifier variable selection is required to use the macro with different identifier names. #}\n {% set identifier_var = corrected_schema_name[1] + \"_\" + table_identifier + \"_identifier\" %}\n {%- set relation.value=adapter.get_relation(\n database=source(corrected_schema_name[1], table_identifier).database,\n schema=source(corrected_schema_name[1], table_identifier).schema,\n identifier=var(identifier_var, table_identifier)\n ) -%}\n {% endif %}\n {% endfor %}\n {% else %}\n {# In order for this macro to effectively work within upstream integration tests (mainly used by the Fivetran dbt package maintainers), this identifier variable selection is required to use the macro with different identifier names. #}\n {% set identifier_var = default_schema + \"_\" + table_identifier + \"_identifier\" %}\n {# Unfortunately the Twitter Organic identifiers were misspelled. As such, we will need to account for this in the model. This will be adjusted in the Twitter Organic package, but to ensure backwards compatibility, this needs to be included. #}\n {% if var(identifier_var, none) is none %} \n {% set identifier_var = default_schema + \"_\" + table_identifier + \"_identifer\" %}\n {% endif %}\n {%- set relation.value=adapter.get_relation(\n database=source(default_schema, table_identifier).database,\n schema=source(default_schema, table_identifier).schema,\n identifier=var(identifier_var, table_identifier)\n ) -%}\n {% endif %}\n{%- set table_exists=relation.value is not none -%}\n\n{%- if table_exists -%}\n select * \n from {{ relation.value }}\n{%- else -%}\n {% if execute and not var('fivetran__remove_empty_table_warnings', false) -%}\n {{ exceptions.warn(\"\\n\\nPlease be aware: The \" ~ table_identifier|upper ~ \" table was not found in your \" ~ default_schema|upper ~ \" schema(s). The Fivetran dbt package will create a completely empty \" ~ table_identifier|upper ~ \" staging model as to not break downstream transformations. To turn off these warnings, set the `fivetran__remove_empty_table_warnings` variable to TRUE (see https://github.com/fivetran/dbt_fivetran_utils/tree/releases/v0.4.latest#union_data-source for details).\\n\") }}\n {% endif -%}\n select \n cast(null as {{ dbt.type_string() }}) as _dbt_source_relation\n limit 0\n{%- endif -%}\n{%- endif -%}\n\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt_utils.union_relations", "macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "table_identifier", "type": null, "description": ""}, {"name": "database_variable", "type": null, "description": ""}, {"name": "schema_variable", "type": null, "description": ""}, {"name": "default_database", "type": null, "description": ""}, {"name": "default_schema", "type": null, "description": ""}, {"name": "default_variable", "type": null, "description": ""}, {"name": "union_schema_variable", "type": null, "description": ""}, {"name": "union_database_variable", "type": null, "description": ""}], "created_at": 1789503443.6624804, "supported_languages": null}, "macro.fivetran_utils.pivot_json_extract": {"name": "pivot_json_extract", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/pivot_json_extract.sql", "original_file_path": "macros/pivot_json_extract.sql", "unique_id": "macro.fivetran_utils.pivot_json_extract", "macro_sql": "{% macro pivot_json_extract(string, list_of_properties) %}\n\n{%- for property in list_of_properties -%}\n{%- if property is mapping -%}\nreplace( {{ fivetran_utils.json_extract(string, property.name) }}, '\"', '') as {{ property.alias if property.alias else property.name | replace(' ', '_') | replace('.', '_') | lower }}\n\n{%- else -%}\nreplace( {{ fivetran_utils.json_extract(string, property) }}, '\"', '') as {{ property | replace(' ', '_') | lower }}\n\n{%- endif -%}\n{%- if not loop.last -%},{%- endif %}\n{% endfor -%}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.json_extract"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "string", "type": null, "description": ""}, {"name": "list_of_properties", "type": null, "description": ""}], "created_at": 1789503443.6640663, "supported_languages": null}, "macro.fivetran_utils.add_dbt_source_relation": {"name": "add_dbt_source_relation", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/add_dbt_source_relation.sql", "original_file_path": "macros/add_dbt_source_relation.sql", "unique_id": "macro.fivetran_utils.add_dbt_source_relation", "macro_sql": "{% macro add_dbt_source_relation() %}\n\n{% if var('union_schemas', none) or var('union_databases', none) %}\n, _dbt_source_relation\n{% endif %}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1789503443.664611, "supported_languages": null}, "macro.fivetran_utils.array_agg": {"name": "array_agg", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/array_agg.sql", "original_file_path": "macros/array_agg.sql", "unique_id": "macro.fivetran_utils.array_agg", "macro_sql": "{% macro array_agg(field_to_agg) -%}\n\n{{ adapter.dispatch('array_agg', 'fivetran_utils') (field_to_agg) }}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.default__array_agg"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field_to_agg", "type": null, "description": ""}], "created_at": 1789503443.6651316, "supported_languages": null}, "macro.fivetran_utils.default__array_agg": {"name": "default__array_agg", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/array_agg.sql", "original_file_path": "macros/array_agg.sql", "unique_id": "macro.fivetran_utils.default__array_agg", "macro_sql": "{% macro default__array_agg(field_to_agg) %}\n array_agg({{ field_to_agg }})\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field_to_agg", "type": null, "description": ""}], "created_at": 1789503443.6653595, "supported_languages": null}, "macro.fivetran_utils.redshift__array_agg": {"name": "redshift__array_agg", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/array_agg.sql", "original_file_path": "macros/array_agg.sql", "unique_id": "macro.fivetran_utils.redshift__array_agg", "macro_sql": "{% macro redshift__array_agg(field_to_agg) %}\n listagg({{ field_to_agg }}, ',')\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field_to_agg", "type": null, "description": ""}], "created_at": 1789503443.6655772, "supported_languages": null}, "macro.fivetran_utils.collect_freshness": {"name": "collect_freshness", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/collect_freshness.sql", "original_file_path": "macros/collect_freshness.sql", "unique_id": "macro.fivetran_utils.collect_freshness", "macro_sql": "{% macro collect_freshness(source, loaded_at_field, filter) %}\n {{ return(adapter.dispatch('collect_freshness')(source, loaded_at_field, filter))}}\n{% endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.default__collect_freshness"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "source", "type": null, "description": ""}, {"name": "loaded_at_field", "type": null, "description": ""}, {"name": "filter", "type": null, "description": ""}], "created_at": 1789503443.6665227, "supported_languages": null}, "macro.fivetran_utils.default__collect_freshness": {"name": "default__collect_freshness", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/collect_freshness.sql", "original_file_path": "macros/collect_freshness.sql", "unique_id": "macro.fivetran_utils.default__collect_freshness", "macro_sql": "{% macro default__collect_freshness(source, loaded_at_field, filter) %}\n {% call statement('collect_freshness', fetch_result=True, auto_begin=False) -%}\n\n {%- set enabled_array = [] -%}\n {% for node in graph.sources.values() %}\n {% if node.identifier == source.identifier %}\n {% if (node.meta['is_enabled'] | default(true)) %}\n {%- do enabled_array.append(1) -%}\n {% endif %}\n {% endif %}\n {% endfor %}\n {% set is_enabled = (enabled_array != []) %}\n\n select\n {% if is_enabled %}\n max({{ loaded_at_field }})\n {% else %} \n {{ current_timestamp() }} {% endif %} as max_loaded_at,\n {{ current_timestamp() }} as snapshotted_at\n\n {% if is_enabled %}\n from {{ source }}\n {% if filter %}\n where {{ filter }}\n {% endif %}\n {% endif %}\n\n {% endcall %}\n\n {% if dbt_version.split('.') | map('int') | list >= [1, 5, 0] %}\n {{ return(load_result('collect_freshness')) }}\n {% else %}\n {{ return(load_result('collect_freshness').table) }}\n {% endif %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement", "macro.dbt.current_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "source", "type": null, "description": ""}, {"name": "loaded_at_field", "type": null, "description": ""}, {"name": "filter", "type": null, "description": ""}], "created_at": 1789503443.6689339, "supported_languages": null}, "macro.fivetran_utils.first_value": {"name": "first_value", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/first_value.sql", "original_file_path": "macros/first_value.sql", "unique_id": "macro.fivetran_utils.first_value", "macro_sql": "{% macro first_value(first_value_field, partition_field, order_by_field, order=\"asc\") -%}\n\n{{ adapter.dispatch('first_value', 'fivetran_utils') (first_value_field, partition_field, order_by_field, order) }}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.default__first_value"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "first_value_field", "type": null, "description": ""}, {"name": "partition_field", "type": null, "description": ""}, {"name": "order_by_field", "type": null, "description": ""}, {"name": "order", "type": null, "description": ""}], "created_at": 1789503443.6697266, "supported_languages": null}, "macro.fivetran_utils.default__first_value": {"name": "default__first_value", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/first_value.sql", "original_file_path": "macros/first_value.sql", "unique_id": "macro.fivetran_utils.default__first_value", "macro_sql": "{% macro default__first_value(first_value_field, partition_field, order_by_field, order=\"asc\") %}\n\n first_value( {{ first_value_field }} ignore nulls ) over (partition by {{ partition_field }} order by {{ order_by_field }} {{ order }} )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "first_value_field", "type": null, "description": ""}, {"name": "partition_field", "type": null, "description": ""}, {"name": "order_by_field", "type": null, "description": ""}, {"name": "order", "type": null, "description": ""}], "created_at": 1789503443.6701767, "supported_languages": null}, "macro.fivetran_utils.redshift__first_value": {"name": "redshift__first_value", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/first_value.sql", "original_file_path": "macros/first_value.sql", "unique_id": "macro.fivetran_utils.redshift__first_value", "macro_sql": "{% macro redshift__first_value(first_value_field, partition_field, order_by_field, order=\"asc\") %}\n\n first_value( {{ first_value_field }} ignore nulls ) over (partition by {{ partition_field }} order by {{ order_by_field }} {{ order }} , {{ partition_field }} rows unbounded preceding )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "first_value_field", "type": null, "description": ""}, {"name": "partition_field", "type": null, "description": ""}, {"name": "order_by_field", "type": null, "description": ""}, {"name": "order", "type": null, "description": ""}], "created_at": 1789503443.6706355, "supported_languages": null}, "macro.fivetran_utils.union_relations": {"name": "union_relations", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/union_relations.sql", "original_file_path": "macros/union_relations.sql", "unique_id": "macro.fivetran_utils.union_relations", "macro_sql": "{%- macro union_relations(relations, aliases=none, column_override=none, include=[], exclude=[], source_column_name=none) -%}\n\n {%- if exclude and include -%}\n {{ exceptions.raise_compiler_error(\"Both an exclude and include list were provided to the `union` macro. Only one is allowed\") }}\n {%- endif -%}\n\n {#-- Prevent querying of db in parsing mode. This works because this macro does not create any new refs. -#}\n {%- if not execute %}\n {{ return('') }}\n {% endif -%}\n\n {%- set column_override = column_override if column_override is not none else {} -%}\n {%- set source_column_name = source_column_name if source_column_name is not none else '_dbt_source_relation' -%}\n\n {%- set relation_columns = {} -%}\n {%- set column_superset = {} -%}\n\n {%- for relation in relations -%}\n\n {%- do relation_columns.update({relation: []}) -%}\n\n {%- do dbt_utils._is_relation(relation, 'union_relations') -%}\n {%- set cols = adapter.get_columns_in_relation(relation) -%}\n {%- for col in cols -%}\n\n {#- If an exclude list was provided and the column is in the list, do nothing -#}\n {%- if exclude and col.column in exclude -%}\n\n {#- If an include list was provided and the column is not in the list, do nothing -#}\n {%- elif include and col.column not in include -%}\n\n {#- Otherwise add the column to the column superset -#}\n {%- else -%}\n\n {#- update the list of columns in this relation -#}\n {%- do relation_columns[relation].append(col.column) -%}\n\n {%- if col.column in column_superset -%}\n\n {%- set stored = column_superset[col.column] -%}\n {%- if col.is_string() and stored.is_string() and col.string_size() > stored.string_size() -%}\n\n {%- do column_superset.update({col.column: col}) -%}\n\n {%- endif %}\n\n {%- else -%}\n\n {%- do column_superset.update({col.column: col}) -%}\n\n {%- endif -%}\n\n {%- endif -%}\n\n {%- endfor -%}\n {%- endfor -%}\n\n {%- set ordered_column_names = column_superset.keys() -%}\n\n {%- for relation in relations %}\n\n (\n select\n\n cast({{ dbt.string_literal(relation) }} as {{ dbt.type_string() }}) as {{ source_column_name }},\n {% for col_name in ordered_column_names -%}\n\n {%- set col = column_superset[col_name] %}\n {%- set col_type = column_override.get(col.column, col.data_type) %}\n {%- set col_name = adapter.quote(col_name) if col_name in relation_columns[relation] else 'null' %}\n cast({{ col_name }} as {{ col_type }}) as {{ col.quoted }} {% if not loop.last %},{% endif -%}\n\n {%- endfor %}\n\n from {{ aliases[loop.index0] if aliases else relation }}\n )\n\n {% if not loop.last -%}\n union all\n {% endif -%}\n\n {%- endfor -%}\n\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt_utils._is_relation", "macro.dbt.string_literal", "macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "relations", "type": null, "description": ""}, {"name": "aliases", "type": null, "description": ""}, {"name": "column_override", "type": null, "description": ""}, {"name": "include", "type": null, "description": ""}, {"name": "exclude", "type": null, "description": ""}, {"name": "source_column_name", "type": null, "description": ""}], "created_at": 1789503443.6764696, "supported_languages": null}, "macro.fivetran_utils.union_tables": {"name": "union_tables", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/union_relations.sql", "original_file_path": "macros/union_relations.sql", "unique_id": "macro.fivetran_utils.union_tables", "macro_sql": "{%- macro union_tables(tables, column_override=none, include=[], exclude=[], source_column_name='_dbt_source_table') -%}\n\n {%- do exceptions.warn(\"Warning: the `union_tables` macro is no longer supported and will be deprecated in a future release of dbt-utils. Use the `union_relations` macro instead\") -%}\n\n {{ return(dbt_utils.union_relations(tables, column_override, include, exclude, source_column_name)) }}\n\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt_utils.union_relations"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "tables", "type": null, "description": ""}, {"name": "column_override", "type": null, "description": ""}, {"name": "include", "type": null, "description": ""}, {"name": "exclude", "type": null, "description": ""}, {"name": "source_column_name", "type": null, "description": ""}], "created_at": 1789503443.677221, "supported_languages": null}, "macro.fivetran_utils.timestamp_diff": {"name": "timestamp_diff", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/timestamp_diff.sql", "original_file_path": "macros/timestamp_diff.sql", "unique_id": "macro.fivetran_utils.timestamp_diff", "macro_sql": "{% macro timestamp_diff(first_date, second_date, datepart) %}\n {{ adapter.dispatch('timestamp_diff', 'fivetran_utils')(first_date, second_date, datepart) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.postgres__timestamp_diff"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "first_date", "type": null, "description": ""}, {"name": "second_date", "type": null, "description": ""}, {"name": "datepart", "type": null, "description": ""}], "created_at": 1789503443.6787045, "supported_languages": null}, "macro.fivetran_utils.default__timestamp_diff": {"name": "default__timestamp_diff", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/timestamp_diff.sql", "original_file_path": "macros/timestamp_diff.sql", "unique_id": "macro.fivetran_utils.default__timestamp_diff", "macro_sql": "{% macro default__timestamp_diff(first_date, second_date, datepart) %}\n\n datediff(\n {{ datepart }},\n {{ first_date }},\n {{ second_date }}\n )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "first_date", "type": null, "description": ""}, {"name": "second_date", "type": null, "description": ""}, {"name": "datepart", "type": null, "description": ""}], "created_at": 1789503443.6790886, "supported_languages": null}, "macro.fivetran_utils.redshift__timestamp_diff": {"name": "redshift__timestamp_diff", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/timestamp_diff.sql", "original_file_path": "macros/timestamp_diff.sql", "unique_id": "macro.fivetran_utils.redshift__timestamp_diff", "macro_sql": "{% macro redshift__timestamp_diff(first_date, second_date, datepart) %}\n\n datediff(\n {{ datepart }},\n {{ first_date }},\n {{ second_date }}\n )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "first_date", "type": null, "description": ""}, {"name": "second_date", "type": null, "description": ""}, {"name": "datepart", "type": null, "description": ""}], "created_at": 1789503443.6794374, "supported_languages": null}, "macro.fivetran_utils.bigquery__timestamp_diff": {"name": "bigquery__timestamp_diff", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/timestamp_diff.sql", "original_file_path": "macros/timestamp_diff.sql", "unique_id": "macro.fivetran_utils.bigquery__timestamp_diff", "macro_sql": "{% macro bigquery__timestamp_diff(first_date, second_date, datepart) %}\n\n timestamp_diff(\n {{second_date}},\n {{first_date}},\n {{datepart}}\n )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "first_date", "type": null, "description": ""}, {"name": "second_date", "type": null, "description": ""}, {"name": "datepart", "type": null, "description": ""}], "created_at": 1789503443.679771, "supported_languages": null}, "macro.fivetran_utils.postgres__timestamp_diff": {"name": "postgres__timestamp_diff", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/timestamp_diff.sql", "original_file_path": "macros/timestamp_diff.sql", "unique_id": "macro.fivetran_utils.postgres__timestamp_diff", "macro_sql": "{% macro postgres__timestamp_diff(first_date, second_date, datepart) %}\n\n {% if datepart == 'year' %}\n (date_part('year', ({{second_date}})::date) - date_part('year', ({{first_date}})::date))\n {% elif datepart == 'quarter' %}\n ({{ dbt.datediff(first_date, second_date, 'year') }} * 4 + date_part('quarter', ({{second_date}})::date) - date_part('quarter', ({{first_date}})::date))\n {% elif datepart == 'month' %}\n ({{ dbt.datediff(first_date, second_date, 'year') }} * 12 + date_part('month', ({{second_date}})::date) - date_part('month', ({{first_date}})::date))\n {% elif datepart == 'day' %}\n (({{second_date}})::date - ({{first_date}})::date)\n {% elif datepart == 'week' %}\n ({{ dbt.datediff(first_date, second_date, 'day') }} / 7 + case\n when date_part('dow', ({{first_date}})::timestamp) <= date_part('dow', ({{second_date}})::timestamp) then\n case when {{first_date}} <= {{second_date}} then 0 else -1 end\n else\n case when {{first_date}} <= {{second_date}} then 1 else 0 end\n end)\n {% elif datepart == 'hour' %}\n ({{ dbt.datediff(first_date, second_date, 'day') }} * 24 + date_part('hour', ({{second_date}})::timestamp) - date_part('hour', ({{first_date}})::timestamp))\n {% elif datepart == 'minute' %}\n ({{ dbt.datediff(first_date, second_date, 'hour') }} * 60 + date_part('minute', ({{second_date}})::timestamp) - date_part('minute', ({{first_date}})::timestamp))\n {% elif datepart == 'second' %}\n ({{ dbt.datediff(first_date, second_date, 'minute') }} * 60 + floor(date_part('second', ({{second_date}})::timestamp)) - floor(date_part('second', ({{first_date}})::timestamp)))\n {% elif datepart == 'millisecond' %}\n ({{ dbt.datediff(first_date, second_date, 'minute') }} * 60000 + floor(date_part('millisecond', ({{second_date}})::timestamp)) - floor(date_part('millisecond', ({{first_date}})::timestamp)))\n {% elif datepart == 'microsecond' %}\n ({{ dbt.datediff(first_date, second_date, 'minute') }} * 60000000 + floor(date_part('microsecond', ({{second_date}})::timestamp)) - floor(date_part('microsecond', ({{first_date}})::timestamp)))\n {% else %}\n {{ exceptions.raise_compiler_error(\"Unsupported datepart for macro datediff in postgres: {!r}\".format(datepart)) }}\n {% endif %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.datediff"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "first_date", "type": null, "description": ""}, {"name": "second_date", "type": null, "description": ""}, {"name": "datepart", "type": null, "description": ""}], "created_at": 1789503443.6832304, "supported_languages": null}, "macro.fivetran_utils.duckdb__timestamp_diff": {"name": "duckdb__timestamp_diff", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/timestamp_diff.sql", "original_file_path": "macros/timestamp_diff.sql", "unique_id": "macro.fivetran_utils.duckdb__timestamp_diff", "macro_sql": "{% macro duckdb__timestamp_diff(first_date, second_date, datepart) %}\n\n datediff('{{ datepart }}', {{ first_date }}, {{ second_date }})\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "first_date", "type": null, "description": ""}, {"name": "second_date", "type": null, "description": ""}, {"name": "datepart", "type": null, "description": ""}], "created_at": 1789503443.6836023, "supported_languages": null}, "macro.fivetran_utils.add_pass_through_columns": {"name": "add_pass_through_columns", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/add_pass_through_columns.sql", "original_file_path": "macros/add_pass_through_columns.sql", "unique_id": "macro.fivetran_utils.add_pass_through_columns", "macro_sql": "{% macro add_pass_through_columns(base_columns, pass_through_var) %}\n\n {% if pass_through_var %}\n\n {% for column in pass_through_var %}\n\n {% if column is mapping %}\n\n {% if column.alias %}\n\n {% do base_columns.append({ \"name\": column.name, \"alias\": column.alias, \"datatype\": column.datatype if column.datatype else dbt.type_string()}) %}\n\n {% else %}\n\n {% do base_columns.append({ \"name\": column.name, \"datatype\": column.datatype if column.datatype else dbt.type_string()}) %}\n \n {% endif %}\n\n {% else %}\n\n {% do base_columns.append({ \"name\": column, \"datatype\": dbt.type_string()}) %}\n\n {% endif %}\n\n {% endfor %}\n\n {% endif %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "base_columns", "type": null, "description": ""}, {"name": "pass_through_var", "type": null, "description": ""}], "created_at": 1789503443.6855977, "supported_languages": null}, "macro.fivetran_utils.timestamp_add": {"name": "timestamp_add", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/timestamp_add.sql", "original_file_path": "macros/timestamp_add.sql", "unique_id": "macro.fivetran_utils.timestamp_add", "macro_sql": "{% macro timestamp_add(datepart, interval, from_timestamp) -%}\n\n{{ adapter.dispatch('timestamp_add', 'fivetran_utils') (datepart, interval, from_timestamp) }}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.postgres__timestamp_add"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "datepart", "type": null, "description": ""}, {"name": "interval", "type": null, "description": ""}, {"name": "from_timestamp", "type": null, "description": ""}], "created_at": 1789503443.6864753, "supported_languages": null}, "macro.fivetran_utils.default__timestamp_add": {"name": "default__timestamp_add", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/timestamp_add.sql", "original_file_path": "macros/timestamp_add.sql", "unique_id": "macro.fivetran_utils.default__timestamp_add", "macro_sql": "{% macro default__timestamp_add(datepart, interval, from_timestamp) %}\n\n timestampadd(\n {{ datepart }},\n {{ interval }},\n {{ from_timestamp }}\n )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "datepart", "type": null, "description": ""}, {"name": "interval", "type": null, "description": ""}, {"name": "from_timestamp", "type": null, "description": ""}], "created_at": 1789503443.6868215, "supported_languages": null}, "macro.fivetran_utils.bigquery__timestamp_add": {"name": "bigquery__timestamp_add", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/timestamp_add.sql", "original_file_path": "macros/timestamp_add.sql", "unique_id": "macro.fivetran_utils.bigquery__timestamp_add", "macro_sql": "{% macro bigquery__timestamp_add(datepart, interval, from_timestamp) %}\n\n timestamp_add({{ from_timestamp }}, interval {{ interval }} {{ datepart }})\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "datepart", "type": null, "description": ""}, {"name": "interval", "type": null, "description": ""}, {"name": "from_timestamp", "type": null, "description": ""}], "created_at": 1789503443.687195, "supported_languages": null}, "macro.fivetran_utils.redshift__timestamp_add": {"name": "redshift__timestamp_add", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/timestamp_add.sql", "original_file_path": "macros/timestamp_add.sql", "unique_id": "macro.fivetran_utils.redshift__timestamp_add", "macro_sql": "{% macro redshift__timestamp_add(datepart, interval, from_timestamp) %}\n\n dateadd(\n {{ datepart }},\n {{ interval }},\n {{ from_timestamp }}\n )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "datepart", "type": null, "description": ""}, {"name": "interval", "type": null, "description": ""}, {"name": "from_timestamp", "type": null, "description": ""}], "created_at": 1789503443.687534, "supported_languages": null}, "macro.fivetran_utils.postgres__timestamp_add": {"name": "postgres__timestamp_add", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/timestamp_add.sql", "original_file_path": "macros/timestamp_add.sql", "unique_id": "macro.fivetran_utils.postgres__timestamp_add", "macro_sql": "{% macro postgres__timestamp_add(datepart, interval, from_timestamp) %}\n\n {{ from_timestamp }} + ((interval '1 {{ datepart }}') * ({{ interval }}))\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "datepart", "type": null, "description": ""}, {"name": "interval", "type": null, "description": ""}, {"name": "from_timestamp", "type": null, "description": ""}], "created_at": 1789503443.6878633, "supported_languages": null}, "macro.fivetran_utils.spark__timestamp_add": {"name": "spark__timestamp_add", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/timestamp_add.sql", "original_file_path": "macros/timestamp_add.sql", "unique_id": "macro.fivetran_utils.spark__timestamp_add", "macro_sql": "{% macro spark__timestamp_add(datepart, interval, from_timestamp) %}\n\n {{ dbt.dateadd(datepart, interval, from_timestamp) }}\n \n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.dateadd"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "datepart", "type": null, "description": ""}, {"name": "interval", "type": null, "description": ""}, {"name": "from_timestamp", "type": null, "description": ""}], "created_at": 1789503443.6882498, "supported_languages": null}, "macro.fivetran_utils.duckdb__timestamp_add": {"name": "duckdb__timestamp_add", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/timestamp_add.sql", "original_file_path": "macros/timestamp_add.sql", "unique_id": "macro.fivetran_utils.duckdb__timestamp_add", "macro_sql": "{% macro duckdb__timestamp_add(datepart, interval, from_timestamp) %}\n\n {{ from_timestamp }} + ((interval '1 {{ datepart }}') * ({{ interval }}))\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "datepart", "type": null, "description": ""}, {"name": "interval", "type": null, "description": ""}, {"name": "from_timestamp", "type": null, "description": ""}], "created_at": 1789503443.6886985, "supported_languages": null}, "macro.fivetran_utils.enabled_vars": {"name": "enabled_vars", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/enabled_vars.sql", "original_file_path": "macros/enabled_vars.sql", "unique_id": "macro.fivetran_utils.enabled_vars", "macro_sql": "{% macro enabled_vars(vars) %}\n\n{% for v in vars %}\n \n {% if var(v, True) == False %}\n {{ return(False) }}\n {% endif %}\n\n{% endfor %}\n\n{{ return(True) }}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "vars", "type": null, "description": ""}], "created_at": 1789503443.6895468, "supported_languages": null}, "macro.fivetran_utils.wrap_in_quotes": {"name": "wrap_in_quotes", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/wrap_in_quotes.sql", "original_file_path": "macros/wrap_in_quotes.sql", "unique_id": "macro.fivetran_utils.wrap_in_quotes", "macro_sql": "{%- macro wrap_in_quotes(object_to_quote) -%}\n\n{{ return(adapter.dispatch('wrap_in_quotes', 'fivetran_utils')(object_to_quote)) }}\n\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.fivetran_utils.postgres__wrap_in_quotes"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "object_to_quote", "type": null, "description": ""}], "created_at": 1789503443.6902456, "supported_languages": null}, "macro.fivetran_utils.default__wrap_in_quotes": {"name": "default__wrap_in_quotes", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/wrap_in_quotes.sql", "original_file_path": "macros/wrap_in_quotes.sql", "unique_id": "macro.fivetran_utils.default__wrap_in_quotes", "macro_sql": "{%- macro default__wrap_in_quotes(object_to_quote) -%}\n{# bigquery, spark, databricks #}\n `{{ object_to_quote }}`\n{%- endmacro -%}\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "object_to_quote", "type": null, "description": ""}], "created_at": 1789503443.6904905, "supported_languages": null}, "macro.fivetran_utils.snowflake__wrap_in_quotes": {"name": "snowflake__wrap_in_quotes", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/wrap_in_quotes.sql", "original_file_path": "macros/wrap_in_quotes.sql", "unique_id": "macro.fivetran_utils.snowflake__wrap_in_quotes", "macro_sql": "{%- macro snowflake__wrap_in_quotes(object_to_quote) -%}\n \"{{ object_to_quote | upper }}\"\n{%- endmacro -%}\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "object_to_quote", "type": null, "description": ""}], "created_at": 1789503443.6907387, "supported_languages": null}, "macro.fivetran_utils.redshift__wrap_in_quotes": {"name": "redshift__wrap_in_quotes", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/wrap_in_quotes.sql", "original_file_path": "macros/wrap_in_quotes.sql", "unique_id": "macro.fivetran_utils.redshift__wrap_in_quotes", "macro_sql": "{%- macro redshift__wrap_in_quotes(object_to_quote) -%}\n \"{{ object_to_quote }}\"\n{%- endmacro -%}\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "object_to_quote", "type": null, "description": ""}], "created_at": 1789503443.6909862, "supported_languages": null}, "macro.fivetran_utils.postgres__wrap_in_quotes": {"name": "postgres__wrap_in_quotes", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/wrap_in_quotes.sql", "original_file_path": "macros/wrap_in_quotes.sql", "unique_id": "macro.fivetran_utils.postgres__wrap_in_quotes", "macro_sql": "{%- macro postgres__wrap_in_quotes(object_to_quote) -%}\n \"{{ object_to_quote }}\"\n{%- endmacro -%}\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "object_to_quote", "type": null, "description": ""}], "created_at": 1789503443.6912138, "supported_languages": null}, "macro.fivetran_utils.duckdb__wrap_in_quotes": {"name": "duckdb__wrap_in_quotes", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/wrap_in_quotes.sql", "original_file_path": "macros/wrap_in_quotes.sql", "unique_id": "macro.fivetran_utils.duckdb__wrap_in_quotes", "macro_sql": "{%- macro duckdb__wrap_in_quotes(object_to_quote) -%}\n \"{{ object_to_quote }}\"\n{%- endmacro -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "object_to_quote", "type": null, "description": ""}], "created_at": 1789503443.6914303, "supported_languages": null}, "macro.fivetran_utils.json_extract": {"name": "json_extract", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/json_extract.sql", "original_file_path": "macros/json_extract.sql", "unique_id": "macro.fivetran_utils.json_extract", "macro_sql": "{% macro json_extract(string, string_path) -%}\n\n{{ adapter.dispatch('json_extract', 'fivetran_utils') (string, string_path) }}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.postgres__json_extract"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "string", "type": null, "description": ""}, {"name": "string_path", "type": null, "description": ""}], "created_at": 1789503443.6922307, "supported_languages": null}, "macro.fivetran_utils.default__json_extract": {"name": "default__json_extract", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/json_extract.sql", "original_file_path": "macros/json_extract.sql", "unique_id": "macro.fivetran_utils.default__json_extract", "macro_sql": "{% macro default__json_extract(string, string_path) %}\n\n json_extract_path_text({{string}}, {{ \"'\" ~ string_path ~ \"'\" }} )\n \n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "string", "type": null, "description": ""}, {"name": "string_path", "type": null, "description": ""}], "created_at": 1789503443.6925604, "supported_languages": null}, "macro.fivetran_utils.snowflake__json_extract": {"name": "snowflake__json_extract", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/json_extract.sql", "original_file_path": "macros/json_extract.sql", "unique_id": "macro.fivetran_utils.snowflake__json_extract", "macro_sql": "{% macro snowflake__json_extract(string, string_path) %}\n\n json_extract_path_text(try_parse_json( {{string}} ), {{ \"'\" ~ string_path ~ \"'\" }} )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "string", "type": null, "description": ""}, {"name": "string_path", "type": null, "description": ""}], "created_at": 1789503443.692894, "supported_languages": null}, "macro.fivetran_utils.redshift__json_extract": {"name": "redshift__json_extract", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/json_extract.sql", "original_file_path": "macros/json_extract.sql", "unique_id": "macro.fivetran_utils.redshift__json_extract", "macro_sql": "{% macro redshift__json_extract(string, string_path) %}\n\n case when is_valid_json( {{string}} ) then json_extract_path_text({{string}}, {{ \"'\" ~ string_path ~ \"'\" }} ) else null end\n \n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "string", "type": null, "description": ""}, {"name": "string_path", "type": null, "description": ""}], "created_at": 1789503443.6932774, "supported_languages": null}, "macro.fivetran_utils.bigquery__json_extract": {"name": "bigquery__json_extract", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/json_extract.sql", "original_file_path": "macros/json_extract.sql", "unique_id": "macro.fivetran_utils.bigquery__json_extract", "macro_sql": "{% macro bigquery__json_extract(string, string_path) %}\n\n json_extract_scalar({{string}}, {{ \"'$.\" ~ string_path ~ \"'\" }} )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "string", "type": null, "description": ""}, {"name": "string_path", "type": null, "description": ""}], "created_at": 1789503443.6936128, "supported_languages": null}, "macro.fivetran_utils.postgres__json_extract": {"name": "postgres__json_extract", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/json_extract.sql", "original_file_path": "macros/json_extract.sql", "unique_id": "macro.fivetran_utils.postgres__json_extract", "macro_sql": "{% macro postgres__json_extract(string, string_path) %}\n\n {{string}}::json->>{{\"'\" ~ string_path ~ \"'\" }}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "string", "type": null, "description": ""}, {"name": "string_path", "type": null, "description": ""}], "created_at": 1789503443.6939292, "supported_languages": null}, "macro.fivetran_utils.extract_url_parameter": {"name": "extract_url_parameter", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/extract_url_parameter.sql", "original_file_path": "macros/extract_url_parameter.sql", "unique_id": "macro.fivetran_utils.extract_url_parameter", "macro_sql": "{% macro extract_url_parameter(field, url_parameter) -%}\n\n{{ adapter.dispatch('extract_url_parameter', 'fivetran_utils') (field, url_parameter) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.default__extract_url_parameter"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field", "type": null, "description": ""}, {"name": "url_parameter", "type": null, "description": ""}], "created_at": 1789503443.6945553, "supported_languages": null}, "macro.fivetran_utils.default__extract_url_parameter": {"name": "default__extract_url_parameter", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/extract_url_parameter.sql", "original_file_path": "macros/extract_url_parameter.sql", "unique_id": "macro.fivetran_utils.default__extract_url_parameter", "macro_sql": "{% macro default__extract_url_parameter(field, url_parameter) -%}\n\n{{ dbt_utils.get_url_parameter(field, url_parameter) }}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.get_url_parameter"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field", "type": null, "description": ""}, {"name": "url_parameter", "type": null, "description": ""}], "created_at": 1789503443.6949914, "supported_languages": null}, "macro.fivetran_utils.spark__extract_url_parameter": {"name": "spark__extract_url_parameter", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/extract_url_parameter.sql", "original_file_path": "macros/extract_url_parameter.sql", "unique_id": "macro.fivetran_utils.spark__extract_url_parameter", "macro_sql": "{% macro spark__extract_url_parameter(field, url_parameter) -%}\n\n{%- set formatted_url_parameter = \"'\" + url_parameter + \"=([^&]+)'\" -%}\nnullif(regexp_extract({{ field }}, {{ formatted_url_parameter }}, 1), '')\n\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field", "type": null, "description": ""}, {"name": "url_parameter", "type": null, "description": ""}], "created_at": 1789503443.6954136, "supported_languages": null}, "macro.fivetran_utils.string_agg": {"name": "string_agg", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/string_agg.sql", "original_file_path": "macros/string_agg.sql", "unique_id": "macro.fivetran_utils.string_agg", "macro_sql": "{% macro string_agg(field_to_agg, delimiter) -%}\n\n{{ adapter.dispatch('string_agg', 'fivetran_utils') (field_to_agg, delimiter) }}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.default__string_agg"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field_to_agg", "type": null, "description": ""}, {"name": "delimiter", "type": null, "description": ""}], "created_at": 1789503443.6960955, "supported_languages": null}, "macro.fivetran_utils.default__string_agg": {"name": "default__string_agg", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/string_agg.sql", "original_file_path": "macros/string_agg.sql", "unique_id": "macro.fivetran_utils.default__string_agg", "macro_sql": "{% macro default__string_agg(field_to_agg, delimiter) %}\n string_agg({{ field_to_agg }}, {{ delimiter }})\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field_to_agg", "type": null, "description": ""}, {"name": "delimiter", "type": null, "description": ""}], "created_at": 1789503443.6963933, "supported_languages": null}, "macro.fivetran_utils.snowflake__string_agg": {"name": "snowflake__string_agg", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/string_agg.sql", "original_file_path": "macros/string_agg.sql", "unique_id": "macro.fivetran_utils.snowflake__string_agg", "macro_sql": "{% macro snowflake__string_agg(field_to_agg, delimiter) %}\n listagg({{ field_to_agg }}, {{ delimiter }})\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field_to_agg", "type": null, "description": ""}, {"name": "delimiter", "type": null, "description": ""}], "created_at": 1789503443.6966736, "supported_languages": null}, "macro.fivetran_utils.redshift__string_agg": {"name": "redshift__string_agg", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/string_agg.sql", "original_file_path": "macros/string_agg.sql", "unique_id": "macro.fivetran_utils.redshift__string_agg", "macro_sql": "{% macro redshift__string_agg(field_to_agg, delimiter) %}\n listagg({{ field_to_agg }}, {{ delimiter }})\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field_to_agg", "type": null, "description": ""}, {"name": "delimiter", "type": null, "description": ""}], "created_at": 1789503443.696955, "supported_languages": null}, "macro.fivetran_utils.spark__string_agg": {"name": "spark__string_agg", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/string_agg.sql", "original_file_path": "macros/string_agg.sql", "unique_id": "macro.fivetran_utils.spark__string_agg", "macro_sql": "{% macro spark__string_agg(field_to_agg, delimiter) %}\n -- collect set will remove duplicates\n replace(replace(replace(cast( collect_set({{ field_to_agg }}) as string), '[', ''), ']', ''), ', ', {{ delimiter }} )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "field_to_agg", "type": null, "description": ""}, {"name": "delimiter", "type": null, "description": ""}], "created_at": 1789503443.697266, "supported_languages": null}, "macro.fivetran_utils.max_bool": {"name": "max_bool", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/max_bool.sql", "original_file_path": "macros/max_bool.sql", "unique_id": "macro.fivetran_utils.max_bool", "macro_sql": "{% macro max_bool(boolean_field) -%}\n\n{{ adapter.dispatch('max_bool', 'fivetran_utils') (boolean_field) }}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.default__max_bool"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "boolean_field", "type": null, "description": ""}], "created_at": 1789503443.6978, "supported_languages": null}, "macro.fivetran_utils.default__max_bool": {"name": "default__max_bool", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/max_bool.sql", "original_file_path": "macros/max_bool.sql", "unique_id": "macro.fivetran_utils.default__max_bool", "macro_sql": "{% macro default__max_bool(boolean_field) %}\n\n bool_or( {{ boolean_field }} )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "boolean_field", "type": null, "description": ""}], "created_at": 1789503443.6980493, "supported_languages": null}, "macro.fivetran_utils.snowflake__max_bool": {"name": "snowflake__max_bool", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/max_bool.sql", "original_file_path": "macros/max_bool.sql", "unique_id": "macro.fivetran_utils.snowflake__max_bool", "macro_sql": "{% macro snowflake__max_bool(boolean_field) %}\n\n max( {{ boolean_field }} )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "boolean_field", "type": null, "description": ""}], "created_at": 1789503443.6982713, "supported_languages": null}, "macro.fivetran_utils.bigquery__max_bool": {"name": "bigquery__max_bool", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/max_bool.sql", "original_file_path": "macros/max_bool.sql", "unique_id": "macro.fivetran_utils.bigquery__max_bool", "macro_sql": "{% macro bigquery__max_bool(boolean_field) %}\n\n max( {{ boolean_field }} )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "boolean_field", "type": null, "description": ""}], "created_at": 1789503443.6984925, "supported_languages": null}, "macro.fivetran_utils.empty_variable_warning": {"name": "empty_variable_warning", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/empty_variable_warning.sql", "original_file_path": "macros/empty_variable_warning.sql", "unique_id": "macro.fivetran_utils.empty_variable_warning", "macro_sql": "{% macro empty_variable_warning(variable, downstream_model) %}\n\n{% if not var(variable) %}\n{{ log(\n \"\"\"\n Warning: You have passed an empty list to the \"\"\" ~ variable ~ \"\"\".\n As a result, you won't see the history of any columns in the \"\"\" ~ downstream_model ~ \"\"\" model.\n \"\"\",\n info=True\n) }}\n{% endif %}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "variable", "type": null, "description": ""}, {"name": "downstream_model", "type": null, "description": ""}], "created_at": 1789503443.6992688, "supported_languages": null}, "macro.fivetran_utils.dummy_coalesce_value": {"name": "dummy_coalesce_value", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/dummy_coalesce_value.sql", "original_file_path": "macros/dummy_coalesce_value.sql", "unique_id": "macro.fivetran_utils.dummy_coalesce_value", "macro_sql": "{% macro dummy_coalesce_value(column) %}\n\n{% set coalesce_value = {\n 'STRING': \"'DUMMY_STRING'\",\n 'BOOLEAN': 'null',\n 'INT': 999999999,\n 'FLOAT': 999999999.99,\n 'TIMESTAMP': 'cast(\"2099-12-31\" as timestamp)',\n 'DATE': 'cast(\"2099-12-31\" as date)',\n} %}\n\n{% if column.is_float() %}\n{{ return(coalesce_value['FLOAT']) }}\n\n{% elif column.is_numeric() %}\n{{ return(coalesce_value['INT']) }}\n\n{% elif column.is_string() %}\n{{ return(coalesce_value['STRING']) }}\n\n{% elif column.data_type|lower == 'boolean' %}\n{{ return(coalesce_value['BOOLEAN']) }}\n\n{% elif 'timestamp' in column.data_type|lower %}\n{{ return(coalesce_value['TIMESTAMP']) }}\n\n{% elif 'date' in column.data_type|lower %}\n{{ return(coalesce_value['DATE']) }}\n\n{% elif 'int' in column.data_type|lower %}\n{{ return(coalesce_value['INT']) }}\n\n{% endif %}\n\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "column", "type": null, "description": ""}], "created_at": 1789503443.7019582, "supported_languages": null}, "macro.fivetran_utils.percentile": {"name": "percentile", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/percentile.sql", "original_file_path": "macros/percentile.sql", "unique_id": "macro.fivetran_utils.percentile", "macro_sql": "{% macro percentile(percentile_field, partition_field, percent) -%}\n\n{{ adapter.dispatch('percentile', 'fivetran_utils') (percentile_field, partition_field, percent) }}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.postgres__percentile"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "percentile_field", "type": null, "description": ""}, {"name": "partition_field", "type": null, "description": ""}, {"name": "percent", "type": null, "description": ""}], "created_at": 1789503443.7028694, "supported_languages": null}, "macro.fivetran_utils.default__percentile": {"name": "default__percentile", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/percentile.sql", "original_file_path": "macros/percentile.sql", "unique_id": "macro.fivetran_utils.default__percentile", "macro_sql": "{% macro default__percentile(percentile_field, partition_field, percent) %}\n\n percentile_cont( \n {{ percent }} )\n within group ( order by {{ percentile_field }} )\n over ( partition by {{ partition_field }} )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "percentile_field", "type": null, "description": ""}, {"name": "partition_field", "type": null, "description": ""}, {"name": "percent", "type": null, "description": ""}], "created_at": 1789503443.7032406, "supported_languages": null}, "macro.fivetran_utils.redshift__percentile": {"name": "redshift__percentile", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/percentile.sql", "original_file_path": "macros/percentile.sql", "unique_id": "macro.fivetran_utils.redshift__percentile", "macro_sql": "{% macro redshift__percentile(percentile_field, partition_field, percent) %}\n\n percentile_cont( \n {{ percent }} )\n within group ( order by {{ percentile_field }} )\n over ( partition by {{ partition_field }} )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "percentile_field", "type": null, "description": ""}, {"name": "partition_field", "type": null, "description": ""}, {"name": "percent", "type": null, "description": ""}], "created_at": 1789503443.7035828, "supported_languages": null}, "macro.fivetran_utils.bigquery__percentile": {"name": "bigquery__percentile", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/percentile.sql", "original_file_path": "macros/percentile.sql", "unique_id": "macro.fivetran_utils.bigquery__percentile", "macro_sql": "{% macro bigquery__percentile(percentile_field, partition_field, percent) %}\n\n percentile_cont( \n {{ percentile_field }}, \n {{ percent }}) \n over (partition by {{ partition_field }} \n )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "percentile_field", "type": null, "description": ""}, {"name": "partition_field", "type": null, "description": ""}, {"name": "percent", "type": null, "description": ""}], "created_at": 1789503443.7039256, "supported_languages": null}, "macro.fivetran_utils.postgres__percentile": {"name": "postgres__percentile", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/percentile.sql", "original_file_path": "macros/percentile.sql", "unique_id": "macro.fivetran_utils.postgres__percentile", "macro_sql": "{% macro postgres__percentile(percentile_field, partition_field, percent) %}\n\n percentile_cont( \n {{ percent }} )\n within group ( order by {{ percentile_field }} )\n /* have to group by partition field */\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "percentile_field", "type": null, "description": ""}, {"name": "partition_field", "type": null, "description": ""}, {"name": "percent", "type": null, "description": ""}], "created_at": 1789503443.7042603, "supported_languages": null}, "macro.fivetran_utils.spark__percentile": {"name": "spark__percentile", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/percentile.sql", "original_file_path": "macros/percentile.sql", "unique_id": "macro.fivetran_utils.spark__percentile", "macro_sql": "{% macro spark__percentile(percentile_field, partition_field, percent) %}\n\n percentile( \n {{ percentile_field }}, \n {{ percent }}) \n over (partition by {{ partition_field }} \n )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "percentile_field", "type": null, "description": ""}, {"name": "partition_field", "type": null, "description": ""}, {"name": "percent", "type": null, "description": ""}], "created_at": 1789503443.704602, "supported_languages": null}, "macro.fivetran_utils.duckdb__percentile": {"name": "duckdb__percentile", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/percentile.sql", "original_file_path": "macros/percentile.sql", "unique_id": "macro.fivetran_utils.duckdb__percentile", "macro_sql": "{% macro duckdb__percentile(percentile_field, partition_field, percent) %}\n\n quantile_cont(\n {{ percentile_field }},\n {{ percent }})\n over (partition by {{ partition_field }}\n )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "percentile_field", "type": null, "description": ""}, {"name": "partition_field", "type": null, "description": ""}, {"name": "percent", "type": null, "description": ""}], "created_at": 1789503443.7049403, "supported_languages": null}, "macro.fivetran_utils.remove_prefix_from_columns": {"name": "remove_prefix_from_columns", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/remove_prefix_from_columns.sql", "original_file_path": "macros/remove_prefix_from_columns.sql", "unique_id": "macro.fivetran_utils.remove_prefix_from_columns", "macro_sql": "{% macro remove_prefix_from_columns(columns, prefix='', exclude=[]) %}\n\n {%- for col in columns if col.name not in exclude -%}\n {%- if col.name[:prefix|length]|lower == prefix -%}\n {{ col.name }} as {{ col.name[prefix|length:] }}\n {%- else -%}\n {{ col.name }}\n {%- endif -%}\n {%- if not loop.last -%},{%- endif %}\n {% endfor -%}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "columns", "type": null, "description": ""}, {"name": "prefix", "type": null, "description": ""}, {"name": "exclude", "type": null, "description": ""}], "created_at": 1789503443.7061725, "supported_languages": null}, "macro.fivetran_utils.snowflake_seed_data": {"name": "snowflake_seed_data", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/snowflake_seed_data.sql", "original_file_path": "macros/snowflake_seed_data.sql", "unique_id": "macro.fivetran_utils.snowflake_seed_data", "macro_sql": "{% macro snowflake_seed_data(seed_name) %}\n\n{% if target.type == 'snowflake' %}\n{{ return(ref(seed_name ~ '_snowflake')) }}\n{% else %}\n{{ return(ref(seed_name)) }}\n{% endif %}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [{"name": "seed_name", "type": null, "description": ""}], "created_at": 1789503443.7069304, "supported_languages": null}}, "docs": {"doc.dbt.__overview__": {"name": "__overview__", "resource_type": "doc", "package_name": "dbt", "path": "overview.md", "original_file_path": "docs/overview.md", "unique_id": "doc.dbt.__overview__", "block_contents": "### Welcome!\n\nWelcome to the auto-generated documentation for your dbt project!\n\n### Navigation\n\nYou can use the `Project` and `Database` navigation tabs on the left side of the window to explore the models\nin your project.\n\n#### Project Tab\nThe `Project` tab mirrors the directory structure of your dbt project. In this tab, you can see all of the\nmodels defined in your dbt project, as well as models imported from dbt packages.\n\n#### Database Tab\nThe `Database` tab also exposes your models, but in a format that looks more like a database explorer. This view\nshows relations (tables and views) grouped into database schemas. Note that ephemeral models are _not_ shown\nin this interface, as they do not exist in the database.\n\n### Graph Exploration\nYou can click the blue icon on the bottom-right corner of the page to view the lineage graph of your models.\n\nOn model pages, you'll see the immediate parents and children of the model you're exploring. By clicking the `Expand`\nbutton at the top-right of this lineage pane, you'll be able to see all of the models that are used to build,\nor are built from, the model you're exploring.\n\nOnce expanded, you'll be able to use the `--select` and `--exclude` model selection syntax to filter the\nmodels in the graph. For more information on model selection, check out the [dbt docs](https://docs.getdbt.com/docs/model-selection-syntax).\n\nNote that you can also right-click on models to interactively filter and explore the graph.\n\n---\n\n### More information\n\n- [What is dbt](https://docs.getdbt.com/docs/introduction)?\n- Read the [dbt viewpoint](https://docs.getdbt.com/docs/viewpoint)\n- [Installation](https://docs.getdbt.com/docs/installation)\n- Join the [dbt Community](https://www.getdbt.com/community/) for questions and discussion"}, "doc.iterable.source_relation": {"name": "source_relation", "resource_type": "doc", "package_name": "iterable", "path": "docs.md", "original_file_path": "models/docs.md", "unique_id": "doc.iterable.source_relation", "block_contents": "Identifies the record's source."}, "doc.iterable._fivetran_synced": {"name": "_fivetran_synced", "resource_type": "doc", "package_name": "iterable", "path": "docs.md", "original_file_path": "models/docs.md", "unique_id": "doc.iterable._fivetran_synced", "block_contents": "The time when a record was last updated by Fivetran."}}, "exposures": {}, "metrics": {}, "groups": {}, "selectors": {}, "disabled": {"test.iterable_integration_tests.consistency_campaigns": [{"database": "postgres", "schema": "public_dbt_test__audit", "name": "consistency_campaigns", "resource_type": "test", "package_name": "iterable_integration_tests", "path": "consistency/consistency_campaigns.sql", "original_file_path": "tests/consistency/consistency_campaigns.sql", "unique_id": "test.iterable_integration_tests.consistency_campaigns", "fqn": ["iterable_integration_tests", "consistency", "consistency_campaigns"], "alias": "consistency_campaigns", "checksum": {"name": "sha256", "checksum": "30e008529ef9f5fa6d8697bbcff2562fc9b176d571cc310458e67e8c82a46185"}, "config": {"enabled": false, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": ["fivetran_validations"], "meta": {}, "group": null, "static_analysis": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "sql_header": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": ["fivetran_validations"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"tags": "fivetran_validations", "enabled": "var('fivetran_validation_tests_enabled', False)"}, "created_at": 1789503444.5334823, "relation_name": null, "raw_code": "{{ config(\n tags=\"fivetran_validations\",\n enabled=var('fivetran_validation_tests_enabled', false)\n) }}\n\n{% set exclude_cols = ['labels'] + var('consistency_test_exclude_metrics', []) %}\n{% set fields = dbt_utils.star(from=ref('iterable__campaigns'), except=exclude_cols) %}\n\n-- this test ensures the iterable__campaigns end model matches the prior version\nwith prod as (\n select {{ fields }}\n from {{ target.schema }}_iterable_prod.iterable__campaigns\n where date(updated_at) < date({{ dbt.current_timestamp() }})\n),\n\ndev as (\n select {{ fields }}\n from {{ target.schema }}_iterable_dev.iterable__campaigns\n where date(updated_at) < date({{ dbt.current_timestamp() }})\n),\n\nprod_not_in_dev as (\n -- rows from prod not found in dev\n select * from prod\n except distinct\n select * from dev\n),\n\ndev_not_in_prod as (\n -- rows from dev not found in prod\n select * from dev\n except distinct\n select * from prod\n),\n\nfinal as (\n select\n *,\n 'from prod' as source\n from prod_not_in_dev\n\n union all -- union since we only care if rows are produced\n\n select\n *,\n 'from dev' as source\n from dev_not_in_prod\n)\n\nselect *\nfrom final", "doc_blocks": [], "language": "sql", "refs": [{"name": "iterable__campaigns", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt_utils.star", "macro.dbt.current_timestamp"], "nodes": []}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}}], "test.iterable_integration_tests.consistency_user_unsubscriptions": [{"database": "postgres", "schema": "public_dbt_test__audit", "name": "consistency_user_unsubscriptions", "resource_type": "test", "package_name": "iterable_integration_tests", "path": "consistency/consistency_user_unsubscriptions.sql", "original_file_path": "tests/consistency/consistency_user_unsubscriptions.sql", "unique_id": "test.iterable_integration_tests.consistency_user_unsubscriptions", "fqn": ["iterable_integration_tests", "consistency", "consistency_user_unsubscriptions"], "alias": "consistency_user_unsubscriptions", "checksum": {"name": "sha256", "checksum": "32d0be8a7f721a49100a7f4b1046a8ecb1d75b86f4ad1a484d53a1d03343bc40"}, "config": {"enabled": false, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": ["fivetran_validations"], "meta": {}, "group": null, "static_analysis": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "sql_header": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": ["fivetran_validations"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"tags": "fivetran_validations", "enabled": "var('fivetran_validation_tests_enabled', False)"}, "created_at": 1789503444.5940793, "relation_name": null, "raw_code": "{{ config(\n tags=\"fivetran_validations\",\n enabled=var('fivetran_validation_tests_enabled', false)\n) }}\n\n{% set exclude_cols = var('consistency_test_exclude_metrics', []) %}\n{% set fields = dbt_utils.star(from=ref('iterable__user_unsubscriptions'), except=exclude_cols) %}\n\n-- this test ensures the iterable__user_unsubscriptions end model matches the prior version\nwith prod as (\n select {{ fields }}\n from {{ target.schema }}_iterable_prod.iterable__user_unsubscriptions\n),\n\ndev as (\n select {{ fields }}\n from {{ target.schema }}_iterable_dev.iterable__user_unsubscriptions\n),\n\nprod_not_in_dev as (\n -- rows from prod not found in dev\n select * from prod\n except distinct\n select * from dev\n),\n\ndev_not_in_prod as (\n -- rows from dev not found in prod\n select * from dev\n except distinct\n select * from prod\n),\n\nfinal as (\n select\n *,\n 'from prod' as source\n from prod_not_in_dev\n\n union all -- union since we only care if rows are produced\n\n select\n *,\n 'from dev' as source\n from dev_not_in_prod\n)\n\nselect *\nfrom final", "doc_blocks": [], "language": "sql", "refs": [{"name": "iterable__user_unsubscriptions", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt_utils.star"], "nodes": []}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}}], "test.iterable_integration_tests.consistency_list_user_history": [{"database": "postgres", "schema": "public_dbt_test__audit", "name": "consistency_list_user_history", "resource_type": "test", "package_name": "iterable_integration_tests", "path": "consistency/consistency_list_user_history.sql", "original_file_path": "tests/consistency/consistency_list_user_history.sql", "unique_id": "test.iterable_integration_tests.consistency_list_user_history", "fqn": ["iterable_integration_tests", "consistency", "consistency_list_user_history"], "alias": "consistency_list_user_history", "checksum": {"name": "sha256", "checksum": "e0081cf1366801020e3c9fbdc71e989f2bdd7b713ee328c2f4a5e9b97355601e"}, "config": {"enabled": false, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": ["fivetran_validations"], "meta": {}, "group": null, "static_analysis": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "sql_header": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": ["fivetran_validations"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"tags": "fivetran_validations", "enabled": "var('fivetran_validation_tests_enabled', False)"}, "created_at": 1789503444.6018593, "relation_name": null, "raw_code": "{{ config(\n tags=\"fivetran_validations\",\n enabled=var('fivetran_validation_tests_enabled', false)\n) }}\n\n{% set exclude_cols = var('consistency_test_exclude_metrics', []) %}\n{% set fields = dbt_utils.star(from=ref('iterable__list_user_history'), except=exclude_cols) %}\n\n-- this test ensures the iterable__list_user_history end model matches the prior version\nwith prod as (\n select {{ fields }}\n from {{ target.schema }}_iterable_prod.iterable__list_user_history\n),\n\ndev as (\n select {{ fields }}\n from {{ target.schema }}_iterable_dev.iterable__list_user_history\n),\n\nprod_not_in_dev as (\n -- rows from prod not found in dev\n select * from prod\n except distinct\n select * from dev\n),\n\ndev_not_in_prod as (\n -- rows from dev not found in prod\n select * from dev\n except distinct\n select * from prod\n),\n\nfinal as (\n select\n *,\n 'from prod' as source\n from prod_not_in_dev\n\n union all -- union since we only care if rows are produced\n\n select\n *,\n 'from dev' as source\n from dev_not_in_prod\n)\n\nselect *\nfrom final", "doc_blocks": [], "language": "sql", "refs": [{"name": "iterable__list_user_history", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt_utils.star"], "nodes": []}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}}], "test.iterable_integration_tests.consistency_users": [{"database": "postgres", "schema": "public_dbt_test__audit", "name": "consistency_users", "resource_type": "test", "package_name": "iterable_integration_tests", "path": "consistency/consistency_users.sql", "original_file_path": "tests/consistency/consistency_users.sql", "unique_id": "test.iterable_integration_tests.consistency_users", "fqn": ["iterable_integration_tests", "consistency", "consistency_users"], "alias": "consistency_users", "checksum": {"name": "sha256", "checksum": "d367ccd8f7d79248da78ce29fc8f08876913df08b89866895cce315f46ef81e3"}, "config": {"enabled": false, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": ["fivetran_validations"], "meta": {}, "group": null, "static_analysis": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "sql_header": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": ["fivetran_validations"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"tags": "fivetran_validations", "enabled": "var('fivetran_validation_tests_enabled', False)"}, "created_at": 1789503444.609599, "relation_name": null, "raw_code": "{{ config(\n tags=\"fivetran_validations\",\n enabled=var('fivetran_validation_tests_enabled', false)\n) }}\n\n{% set exclude_cols = var('consistency_test_exclude_metrics', []) %}\n{% set fields = dbt_utils.star(from=ref('iterable__users'), except=exclude_cols) %}\n\n-- this test ensures the iterable__users end model matches the prior version\nwith prod as (\n select {{ fields }}\n from {{ target.schema }}_iterable_prod.iterable__users\n where date(updated_at) < date({{ dbt.current_timestamp() }})\n),\n\ndev as (\n select {{ fields }}\n from {{ target.schema }}_iterable_dev.iterable__users\n where date(updated_at) < date({{ dbt.current_timestamp() }})\n),\n\nprod_not_in_dev as (\n -- rows from prod not found in dev\n select * from prod\n except distinct\n select * from dev\n),\n\ndev_not_in_prod as (\n -- rows from dev not found in prod\n select * from dev\n except distinct\n select * from prod\n),\n\nfinal as (\n select\n *,\n 'from prod' as source\n from prod_not_in_dev\n\n union all -- union since we only care if rows are produced\n\n select\n *,\n 'from dev' as source\n from dev_not_in_prod\n)\n\nselect *\nfrom final", "doc_blocks": [], "language": "sql", "refs": [{"name": "iterable__users", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt_utils.star", "macro.dbt.current_timestamp"], "nodes": []}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}}], "test.iterable_integration_tests.consistency_user_unsubscribes_pre_aug_2023": [{"database": "postgres", "schema": "public_dbt_test__audit", "name": "consistency_user_unsubscribes_pre_aug_2023", "resource_type": "test", "package_name": "iterable_integration_tests", "path": "consistency/consistency_user_unsubscribes_pre_aug_2023.sql", "original_file_path": "tests/consistency/consistency_user_unsubscribes_pre_aug_2023.sql", "unique_id": "test.iterable_integration_tests.consistency_user_unsubscribes_pre_aug_2023", "fqn": ["iterable_integration_tests", "consistency", "consistency_user_unsubscribes_pre_aug_2023"], "alias": "consistency_user_unsubscribes_pre_aug_2023", "checksum": {"name": "sha256", "checksum": "0d85b35d94066e59119f57fbe930a19353dfbb79b4e812b54de9c19520a58402"}, "config": {"enabled": false, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": ["fivetran_validations"], "meta": {}, "group": null, "static_analysis": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "sql_header": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": ["fivetran_validations"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"tags": "fivetran_validations", "enabled": "var('fivetran_validation_tests_enabled', False)"}, "created_at": 1789503444.6186495, "relation_name": null, "raw_code": "-- These validation tests were designed to work with the pre-August 2023 version of the Iterable connector.\n-- You will thus need to comment out `iterable_user_unsubscribed_channel_identifier` and `iterable_user_unsubscribed_message_type_identifier` in the `integration_tests/dbt_project.yml` to run and validate these tests. \n\n{{ config(\n tags=\"fivetran_validations\",\n enabled=var('fivetran_validation_tests_enabled', false)\n) }}\n\n\nwith prod as (\n\n select \n unique_user_key, \n coalesce(count(distinct unique_user_key), 0) as unique_user_records_prod, \n coalesce(count(distinct channel_id), 0) as channels_prod, \n coalesce(count(distinct message_type_id), 0) as message_types_prod\n from {{ target.schema }}_iterable_prod.iterable__user_unsubscriptions\n where channel_id is not null\n and message_type_id is not null\n group by 1\n),\n\ndev as (\n\n select \n unique_user_key, \n coalesce(count(distinct unique_user_key), 0) as unique_user_records_dev, \n coalesce(count(distinct channel_id), 0) as channels_dev, \n coalesce(count(distinct message_type_id), 0) as message_types_dev\n from {{ target.schema }}_iterable_dev.iterable__user_unsubscriptions\n where channel_id is not null\n and message_type_id is not null\n group by 1\n),\n\nfinal as (\n\n select \n prod.unique_user_key,\n unique_user_records_prod,\n unique_user_records_dev,\n channels_prod,\n channels_dev,\n message_types_prod,\n message_types_dev\n from prod\n full outer join dev\n on prod.unique_user_key = dev.unique_user_key\n) \n\nselect *\nfrom final\nwhere unique_user_records_prod != unique_user_records_dev\n and channels_prod != channels_dev \n and message_types_prod != message_types_dev", "doc_blocks": [], "language": "sql", "refs": [], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": [], "nodes": []}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}}], "test.iterable_integration_tests.consistency_user_campaign": [{"database": "postgres", "schema": "public_dbt_test__audit", "name": "consistency_user_campaign", "resource_type": "test", "package_name": "iterable_integration_tests", "path": "consistency/consistency_user_campaign.sql", "original_file_path": "tests/consistency/consistency_user_campaign.sql", "unique_id": "test.iterable_integration_tests.consistency_user_campaign", "fqn": ["iterable_integration_tests", "consistency", "consistency_user_campaign"], "alias": "consistency_user_campaign", "checksum": {"name": "sha256", "checksum": "8663f2c250688a8303d2ef38dc723e2fc62d996396b4b07e13c05feeb48cd97c"}, "config": {"enabled": false, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": ["fivetran_validations"], "meta": {}, "group": null, "static_analysis": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "sql_header": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": ["fivetran_validations"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"tags": "fivetran_validations", "enabled": "var('fivetran_validation_tests_enabled', False)"}, "created_at": 1789503444.624223, "relation_name": null, "raw_code": "{{ config(\n tags=\"fivetran_validations\",\n enabled=var('fivetran_validation_tests_enabled', false)\n) }}\n\n{% set exclude_cols = var('consistency_test_exclude_metrics', []) %}\n{% set fields = dbt_utils.star(from=ref('iterable__user_campaign'), except=exclude_cols) %}\n\n-- this test ensures the iterable__user_campaign end model matches the prior version\nwith prod as (\n select {{ fields }}\n from {{ target.schema }}_iterable_prod.iterable__user_campaign\n where date(first_event_at) < date({{ dbt.current_timestamp() }})\n),\n\ndev as (\n select {{ fields }}\n from {{ target.schema }}_iterable_dev.iterable__user_campaign\n where date(first_event_at) < date({{ dbt.current_timestamp() }})\n),\n\nprod_not_in_dev as (\n -- rows from prod not found in dev\n select * from prod\n except distinct\n select * from dev\n),\n\ndev_not_in_prod as (\n -- rows from dev not found in prod\n select * from dev\n except distinct\n select * from prod\n),\n\nfinal as (\n select\n *,\n 'from prod' as source\n from prod_not_in_dev\n\n union all -- union since we only care if rows are produced\n\n select\n *,\n 'from dev' as source\n from dev_not_in_prod\n)\n\nselect *\nfrom final", "doc_blocks": [], "language": "sql", "refs": [{"name": "iterable__user_campaign", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt_utils.star", "macro.dbt.current_timestamp"], "nodes": []}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}}], "test.iterable_integration_tests.consistency_events": [{"database": "postgres", "schema": "public_dbt_test__audit", "name": "consistency_events", "resource_type": "test", "package_name": "iterable_integration_tests", "path": "consistency/consistency_events.sql", "original_file_path": "tests/consistency/consistency_events.sql", "unique_id": "test.iterable_integration_tests.consistency_events", "fqn": ["iterable_integration_tests", "consistency", "consistency_events"], "alias": "consistency_events", "checksum": {"name": "sha256", "checksum": "6e82de77a605ca7613eb3563f2158ad172785552d38cbf3617136a816c073b36"}, "config": {"enabled": false, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": ["fivetran_validations"], "meta": {}, "group": null, "static_analysis": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "sql_header": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": ["fivetran_validations"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"tags": "fivetran_validations", "enabled": "var('fivetran_validation_tests_enabled', False)"}, "created_at": 1789503444.6330667, "relation_name": null, "raw_code": "{{ config(\n tags=\"fivetran_validations\",\n enabled=var('fivetran_validation_tests_enabled', false)\n) }}\n\n-- exclude JSON fields\n{% set exclude_cols = ['additional_properties', 'transactional_data'] + var('consistency_test_exclude_metrics', []) %}\n{% set fields = dbt_utils.star(from=ref('iterable__events'), except=exclude_cols) %}\n\n-- this test ensures the iterable__events end model matches the prior version\nwith prod as (\n select {{ fields }}\n from {{ target.schema }}_iterable_prod.iterable__events\n where date(created_at) < date({{ dbt.current_timestamp() }})\n),\n\ndev as (\n select {{ fields }}\n from {{ target.schema }}_iterable_dev.iterable__events\n where date(created_at) < date({{ dbt.current_timestamp() }})\n),\n\nprod_not_in_dev as (\n -- rows from prod not found in dev\n select * from prod\n except distinct\n select * from dev\n),\n\ndev_not_in_prod as (\n -- rows from dev not found in prod\n select * from dev\n except distinct\n select * from prod\n),\n\nfinal as (\n select\n *,\n 'from prod' as source\n from prod_not_in_dev\n\n union all -- union since we only care if rows are produced\n\n select\n *,\n 'from dev' as source\n from dev_not_in_prod\n)\n\nselect *\nfrom final", "doc_blocks": [], "language": "sql", "refs": [{"name": "iterable__events", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt_utils.star", "macro.dbt.current_timestamp"], "nodes": []}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}}], "test.iterable_integration_tests.consistency_journeys": [{"database": "postgres", "schema": "public_dbt_test__audit", "name": "consistency_journeys", "resource_type": "test", "package_name": "iterable_integration_tests", "path": "consistency/consistency_journeys.sql", "original_file_path": "tests/consistency/consistency_journeys.sql", "unique_id": "test.iterable_integration_tests.consistency_journeys", "fqn": ["iterable_integration_tests", "consistency", "consistency_journeys"], "alias": "consistency_journeys", "checksum": {"name": "sha256", "checksum": "93a73b2e7e1d608a1116fddcec932e15ce18a57fb099872a13b4f97ca006d18f"}, "config": {"enabled": false, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": ["fivetran_validations"], "meta": {}, "group": null, "static_analysis": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "sql_header": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": ["fivetran_validations"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"tags": "fivetran_validations", "enabled": "var('fivetran_validation_tests_enabled', False)"}, "created_at": 1789503444.6434412, "relation_name": null, "raw_code": "{{ config(\n tags=\"fivetran_validations\",\n enabled=var('fivetran_validation_tests_enabled', false)\n) }}\n\n{% set exclude_cols = ['trigger_event_names'] + var('consistency_test_exclude_metrics', []) %}\n{% set fields = dbt_utils.star(from=ref('iterable__journeys'), except=exclude_cols) %}\n\n-- this test ensures the iterable__journeys end model matches the prior version\nwith prod as (\n select {{ fields }}\n from {{ target.schema }}_iterable_prod.iterable__journeys\n where date(updated_at) < date({{ dbt.current_timestamp() }})\n),\n\ndev as (\n select {{ fields }}\n from {{ target.schema }}_iterable_dev.iterable__journeys\n where date(updated_at) < date({{ dbt.current_timestamp() }})\n),\n\nprod_not_in_dev as (\n -- rows from prod not found in dev\n select * from prod\n except distinct\n select * from dev\n),\n\ndev_not_in_prod as (\n -- rows from dev not found in prod\n select * from dev\n except distinct\n select * from prod\n),\n\nfinal as (\n select\n *,\n 'from prod' as source\n from prod_not_in_dev\n\n union all -- union since we only care if rows are produced\n\n select\n *,\n 'from dev' as source\n from dev_not_in_prod\n)\n\nselect *\nfrom final", "doc_blocks": [], "language": "sql", "refs": [{"name": "iterable__journeys", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt_utils.star", "macro.dbt.current_timestamp"], "nodes": []}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}}], "test.iterable_integration_tests.user_unsubscribe_count_match_pre_aug_2023": [{"database": "postgres", "schema": "public_dbt_test__audit", "name": "user_unsubscribe_count_match_pre_aug_2023", "resource_type": "test", "package_name": "iterable_integration_tests", "path": "integrity/user_unsubscribe_count_match_pre_aug_2023.sql", "original_file_path": "tests/integrity/user_unsubscribe_count_match_pre_aug_2023.sql", "unique_id": "test.iterable_integration_tests.user_unsubscribe_count_match_pre_aug_2023", "fqn": ["iterable_integration_tests", "integrity", "user_unsubscribe_count_match_pre_aug_2023"], "alias": "user_unsubscribe_count_match_pre_aug_2023", "checksum": {"name": "sha256", "checksum": "6b37518965460a9c0b7161808527fa4b6f240a6ead0827a3950705267ebd236f"}, "config": {"enabled": false, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": ["fivetran_validations"], "meta": {}, "group": null, "static_analysis": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "sql_header": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": ["fivetran_validations"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"tags": "fivetran_validations", "enabled": "var('fivetran_validation_tests_enabled', False)"}, "created_at": 1789503444.6527135, "relation_name": null, "raw_code": "-- These validation tests were designed to work with the pre-August 2023 version of the Iterable connector.\n-- You will thus need to comment out `iterable_user_unsubscribed_channel_identifier` and `iterable_user_unsubscribed_message_type_identifier` in the `integration_tests/dbt_project.yml` to run and validate these tests. \n\n{{ config(\n tags=\"fivetran_validations\",\n enabled=var('fivetran_validation_tests_enabled', false)\n) }}\n\nwith unsub_channels as (\n\n select \n unique_user_key, \n channel_id\n from {{ ref('stg_iterable__user_unsubscribed_channel') }}\n group by 1, 2\n),\n\nunsub_messages as (\n\n select \n unique_user_key, \n message_type_id\n from {{ ref('stg_iterable__user_unsub_message_type') }}\n group by 1, 2\n),\n\nchannel_message_combos as (\n\n select channel_id, message_type_id \n from {{ ref('stg_iterable__message_type') }}\n group by 1, 2\n),\n\nmessage_channel_unsubs as (\n\n select \n unsub_channels.unique_user_key as unique_user_key_source,\n channel_message_combos.channel_id as channel_source,\n channel_message_combos.message_type_id as message_type_source\n from unsub_channels \n inner join channel_message_combos\n on unsub_channels.channel_id = channel_message_combos.channel_id\n\n union all\n\n select \n unsub_messages.unique_user_key as unique_user_key_source,\n channel_message_combos.channel_id as channel_source,\n channel_message_combos.message_type_id as message_type_source\n from unsub_messages\n inner join channel_message_combos\n on unsub_messages.message_type_id = channel_message_combos.message_type_id\n\n),\n\nsource_counts as (\n\n select unique_user_key_source, channel_source, message_type_source, count(*) as source_count\n from message_channel_unsubs \n group by 1, 2, 3\n),\n\nend_model_counts as (\n\n select unique_user_key as unique_user_key_end, channel_id as channel_end, message_type_id as message_type_end, count(*) as end_count\n from {{ ref('iterable__user_unsubscriptions') }}\n group by 1, 2, 3 \n)\n\nselect * \nfrom source_counts\ninner join end_model_counts \n on source_counts.unique_user_key_source = end_model_counts.unique_user_key_end\nwhere source_counts.channel_source = end_model_counts.channel_end\n and source_counts.message_type_source = end_model_counts.message_type_end\n and source_counts.source_count != end_model_counts.end_count", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__user_unsubscribed_channel", "package": null, "version": null}, {"name": "stg_iterable__user_unsub_message_type", "package": null, "version": null}, {"name": "stg_iterable__message_type", "package": null, "version": null}, {"name": "iterable__user_unsubscriptions", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": [], "nodes": []}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}}], "model.iterable.int_iterable__custom_events": [{"database": "postgres", "schema": "public_iterable_dev", "name": "int_iterable__custom_events", "resource_type": "model", "package_name": "iterable", "path": "intermediate/int_iterable__custom_events.sql", "original_file_path": "models/intermediate/int_iterable__custom_events.sql", "unique_id": "model.iterable.int_iterable__custom_events", "fqn": ["iterable", "intermediate", "int_iterable__custom_events"], "alias": "int_iterable__custom_events", "checksum": {"name": "sha256", "checksum": "0f0f1330b62dd5a320f37f7e30dae86a90c57e07c135369a259cfcba61875a16"}, "config": {"enabled": false, "alias": null, "schema": "iterable_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "incremental", "incremental_strategy": "merge", "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": "event_id", "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "on_error": null, "latest_version_pointer": {"enabled": null, "alias": null}, "file_format": "delta"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"materialized": "incremental", "schema": "iterable_{{ var('directed_schema','dev') }}", "unique_key": "event_id", "incremental_strategy": "merge", "file_format": "delta", "enabled": "False", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}}, "created_at": 1789503445.3843079, "relation_name": "\"postgres\".\"public_iterable_dev\".\"int_iterable__custom_events\"", "raw_code": "{{\n config(\n materialized='incremental',\n unique_key='event_id',\n incremental_strategy = 'merge',\n file_format = 'delta',\n enabled=false\n )\n}}\n\n-- leave this alone for now....setting enabled to false\nwith events as (\n\n select *\n from {{ ref('stg_iterable__event') }}\n\n where lower(event_name) = 'customevent'\n {% if is_incremental() %}\n and updated_at > ( select max(updated_at) from {{ this }} )\n {% endif %}\n\n), custom_events as (\n\n select \n events.*\n {# {{ dbt.split_part(string_text='additional_properties', delimiter_text=' : \"{', part_number=1) }} #}\n\n {% if target.type == 'snowflake' %}\n ,\n additional_properties.key as custom_event_name,\n additional_properties.value as custom_event_metadata\n {% endif %}\n from events\n\n \n {% if target.type == 'snowflake' %}\n cross join \n table(flatten(additional_properties)) as additional_properties\n where additional_properties.key != '_id'\n {% endif %}\n)\n\nselect *\nfrom custom_events", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_iterable__event", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.is_incremental"], "nodes": []}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": [], "time_spine": null}]}, "parent_map": {"seed.iterable_integration_tests.campaign_metrics_data": [], "seed.iterable_integration_tests.campaign_list_history_data": [], "seed.iterable_integration_tests.user_unsubscribed_message_type_history_data": [], "seed.iterable_integration_tests.user_unsubscribed_channel_history_data": [], "seed.iterable_integration_tests.campaign_suppression_list_history_data": [], "seed.iterable_integration_tests.channel_data": [], "seed.iterable_integration_tests.template_history_data": [], "seed.iterable_integration_tests.message_type_data": [], "seed.iterable_integration_tests.event_data": [], "seed.iterable_integration_tests.list_user_data": [], "seed.iterable_integration_tests.user_history_bq_json_data": [], "seed.iterable_integration_tests.user_unsubscribed_message_type_data": [], "seed.iterable_integration_tests.journey_data": [], "seed.iterable_integration_tests.campaign_history_data": [], "seed.iterable_integration_tests.list_data": [], "seed.iterable_integration_tests.event_extension_data": [], "seed.iterable_integration_tests.user_unsubscribed_channel_data": [], "seed.iterable_integration_tests.campaign_label_history_data": [], "seed.iterable_integration_tests.user_history_data": [], "model.iterable.iterable__users": ["model.iterable.int_iterable__list_user_unnest", "model.iterable.int_iterable__user_event_metrics", "model.iterable.stg_iterable__list_user"], "model.iterable.iterable__list_user_history": ["model.iterable.int_iterable__list_user_unnest", "model.iterable.stg_iterable__list", "model.iterable.stg_iterable__list_user"], "model.iterable.iterable__events": ["model.iterable.int_iterable__latest_template", "model.iterable.int_iterable__latest_user", "model.iterable.int_iterable__message_type_channel", "model.iterable.int_iterable__recurring_campaigns", "model.iterable.stg_iterable__event", "model.iterable.stg_iterable__event_extension"], "model.iterable.iterable__user_campaign": ["model.iterable.iterable__events"], "model.iterable.iterable__user_unsubscriptions": ["model.iterable.int_iterable__message_type_channel", "model.iterable.stg_iterable__user_unsub_message_type", "model.iterable.stg_iterable__user_unsubscribed_channel"], "model.iterable.iterable__journeys": ["model.iterable.int_iterable__journey_event_metrics", "model.iterable.stg_iterable__journey"], "model.iterable.iterable__campaigns": ["model.iterable.int_iterable__campaign_event_metrics", "model.iterable.int_iterable__campaign_labels", "model.iterable.int_iterable__campaign_lists", "model.iterable.int_iterable__latest_template", "model.iterable.int_iterable__recurring_campaigns", "model.iterable.stg_iterable__journey"], "model.iterable.int_iterable__campaign_labels": ["model.iterable.stg_iterable__campaign_label_history"], "model.iterable.int_iterable__journey_event_metrics": ["model.iterable.int_iterable__recurring_campaigns", "model.iterable.iterable__user_campaign"], "model.iterable.int_iterable__list_user_unnest": ["model.iterable.int_iterable__list_user_history"], "model.iterable.int_iterable__latest_template": ["model.iterable.int_iterable__message_type_channel", "model.iterable.stg_iterable__template_history"], "model.iterable.int_iterable__campaign_event_metrics": ["model.iterable.iterable__user_campaign"], "model.iterable.int_iterable__campaign_lists": ["model.iterable.stg_iterable__campaign_list_history", "model.iterable.stg_iterable__campaign_suppression_list_history"], "model.iterable.int_iterable__recurring_campaigns": ["model.iterable.int_iterable__latest_campaign"], "model.iterable.int_iterable__list_user_history": ["model.iterable.stg_iterable__user_history"], "model.iterable.int_iterable__message_type_channel": ["model.iterable.stg_iterable__channel", "model.iterable.stg_iterable__message_type"], "model.iterable.int_iterable__user_event_metrics": ["model.iterable.iterable__user_campaign"], "model.iterable.int_iterable__latest_user": ["model.iterable.stg_iterable__user_history"], "model.iterable.int_iterable__latest_campaign": ["model.iterable.stg_iterable__campaign_history"], "model.iterable.stg_iterable__message_type": ["model.iterable.stg_iterable__message_type_tmp"], "model.iterable.stg_iterable__event": ["model.iterable.stg_iterable__event_tmp"], "model.iterable.stg_iterable__user_unsubscribed_channel": ["model.iterable.stg_iterable__user_unsubscribed_channel_tmp"], "model.iterable.stg_iterable__campaign_history": ["model.iterable.stg_iterable__campaign_history_tmp"], "model.iterable.stg_iterable__campaign_label_history": ["model.iterable.stg_iterable__campaign_label_history_tmp"], "model.iterable.stg_iterable__template_history": ["model.iterable.stg_iterable__template_history_tmp"], "model.iterable.stg_iterable__journey": ["model.iterable.stg_iterable__journey_tmp"], "model.iterable.stg_iterable__user_history": ["model.iterable.stg_iterable__user_history_tmp"], "model.iterable.stg_iterable__user_unsub_message_type": ["model.iterable.stg_iterable__user_unsub_message_type_tmp"], "model.iterable.stg_iterable__list": ["model.iterable.stg_iterable__list_tmp"], "model.iterable.stg_iterable__list_user": ["model.iterable.stg_iterable__list_user_tmp"], "model.iterable.stg_iterable__campaign_suppression_list_history": ["model.iterable.stg_iterable__campaign_suppression_list_history_tmp"], "model.iterable.stg_iterable__event_extension": ["model.iterable.stg_iterable__event_extension_tmp"], "model.iterable.stg_iterable__campaign_list_history": ["model.iterable.stg_iterable__campaign_list_history_tmp"], "model.iterable.stg_iterable__channel": ["model.iterable.stg_iterable__channel_tmp"], "model.iterable.stg_iterable__message_type_tmp": ["source.iterable.iterable.message_type"], "model.iterable.stg_iterable__event_extension_tmp": ["source.iterable.iterable.event_extension"], "model.iterable.stg_iterable__user_unsub_message_type_tmp": ["source.iterable.iterable.user_unsubscribed_message_type_history"], "model.iterable.stg_iterable__campaign_list_history_tmp": ["source.iterable.iterable.campaign_list_history"], "model.iterable.stg_iterable__list_user_tmp": ["source.iterable.iterable.list_user"], "model.iterable.stg_iterable__user_history_tmp": ["source.iterable.iterable.user_history"], "model.iterable.stg_iterable__campaign_history_tmp": ["source.iterable.iterable.campaign_history"], "model.iterable.stg_iterable__template_history_tmp": ["source.iterable.iterable.template_history"], "model.iterable.stg_iterable__event_tmp": ["source.iterable.iterable.event"], "model.iterable.stg_iterable__journey_tmp": ["source.iterable.iterable.journey"], "model.iterable.stg_iterable__campaign_suppression_list_history_tmp": ["source.iterable.iterable.campaign_suppression_list_history"], "model.iterable.stg_iterable__campaign_label_history_tmp": ["source.iterable.iterable.campaign_label_history"], "model.iterable.stg_iterable__list_tmp": ["source.iterable.iterable.list"], "model.iterable.stg_iterable__channel_tmp": ["source.iterable.iterable.channel"], "model.iterable.stg_iterable__user_unsubscribed_channel_tmp": ["source.iterable.iterable.user_unsubscribed_channel_history"], "test.iterable.not_null_iterable__campaigns_campaign_id.03c9448919": ["model.iterable.iterable__campaigns"], "test.iterable.not_null_iterable__events_event_id.ed1d28a650": ["model.iterable.iterable__events"], "test.iterable.not_null_iterable__journeys_journey_id.b5c6b8783a": ["model.iterable.iterable__journeys"], "test.iterable.unique_iterable__journeys_unique_journey_id.ba86841246": ["model.iterable.iterable__journeys"], "test.iterable.not_null_iterable__user_unsubscriptions_unique_user_key.f8db72932b": ["model.iterable.iterable__user_unsubscriptions"], "test.iterable.not_null_iterable__users_unique_user_key.4ca37a26c8": ["model.iterable.iterable__users"], "test.iterable.not_null_stg_iterable__campaign_history_campaign_id.b7c36e4525": ["model.iterable.stg_iterable__campaign_history"], "test.iterable.not_null_stg_iterable__campaign_label_history_campaign_id.1918cef89a": ["model.iterable.stg_iterable__campaign_label_history"], "test.iterable.not_null_stg_iterable__campaign_list_history_campaign_id.208f9bf9ed": ["model.iterable.stg_iterable__campaign_list_history"], "test.iterable.not_null_stg_iterable__campaign_suppression_list_history_campaign_id.3921289710": ["model.iterable.stg_iterable__campaign_suppression_list_history"], "test.iterable.not_null_stg_iterable__channel_channel_id.182ceb9636": ["model.iterable.stg_iterable__channel"], "test.iterable.not_null_stg_iterable__event_event_id.370cd4bc9d": ["model.iterable.stg_iterable__event"], "test.iterable.not_null_stg_iterable__event_unique_event_id.e2b46d3bb6": ["model.iterable.stg_iterable__event"], "test.iterable.not_null_stg_iterable__event_extension_event_id.144dedcd30": ["model.iterable.stg_iterable__event_extension"], "test.iterable.not_null_stg_iterable__journey_journey_id.cc38bd633c": ["model.iterable.stg_iterable__journey"], "test.iterable.not_null_stg_iterable__list_list_id.47029d839a": ["model.iterable.stg_iterable__list"], "test.iterable.not_null_stg_iterable__message_type_message_type_id.75eaa6fa62": ["model.iterable.stg_iterable__message_type"], "test.iterable.not_null_stg_iterable__template_history_template_id.14b24a1dfe": ["model.iterable.stg_iterable__template_history"], "test.iterable.not_null_stg_iterable__list_user__fivetran_user_id.cca4b34c07": ["model.iterable.stg_iterable__list_user"], "test.iterable.not_null_stg_iterable__user_history_unique_user_key.2845af2127": ["model.iterable.stg_iterable__user_history"], "test.iterable.not_null_stg_iterable__user_unsubscribed_channel_channel_id.da0ed9e9be": ["model.iterable.stg_iterable__user_unsubscribed_channel"], "test.iterable.not_null_stg_iterable__user_unsub_message_type_message_type_id.268a89ea6f": ["model.iterable.stg_iterable__user_unsub_message_type"], "source.iterable.iterable.campaign_history": [], "source.iterable.iterable.campaign_label_history": [], "source.iterable.iterable.campaign_list_history": [], "source.iterable.iterable.campaign_suppression_list_history": [], "source.iterable.iterable.channel": [], "source.iterable.iterable.event": [], "source.iterable.iterable.event_extension": [], "source.iterable.iterable.journey": [], "source.iterable.iterable.list": [], "source.iterable.iterable.message_type": [], "source.iterable.iterable.template_history": [], "source.iterable.iterable.user_history": [], "source.iterable.iterable.user_unsubscribed_channel": [], "source.iterable.iterable.user_unsubscribed_message_type": [], "source.iterable.iterable.user_unsubscribed_channel_history": [], "source.iterable.iterable.user_unsubscribed_message_type_history": [], "source.iterable.iterable.list_user": []}, "child_map": {"seed.iterable_integration_tests.campaign_metrics_data": [], "seed.iterable_integration_tests.campaign_list_history_data": [], "seed.iterable_integration_tests.user_unsubscribed_message_type_history_data": [], "seed.iterable_integration_tests.user_unsubscribed_channel_history_data": [], "seed.iterable_integration_tests.campaign_suppression_list_history_data": [], "seed.iterable_integration_tests.channel_data": [], "seed.iterable_integration_tests.template_history_data": [], "seed.iterable_integration_tests.message_type_data": [], "seed.iterable_integration_tests.event_data": [], "seed.iterable_integration_tests.list_user_data": [], "seed.iterable_integration_tests.user_history_bq_json_data": [], "seed.iterable_integration_tests.user_unsubscribed_message_type_data": [], "seed.iterable_integration_tests.journey_data": [], "seed.iterable_integration_tests.campaign_history_data": [], "seed.iterable_integration_tests.list_data": [], "seed.iterable_integration_tests.event_extension_data": [], "seed.iterable_integration_tests.user_unsubscribed_channel_data": [], "seed.iterable_integration_tests.campaign_label_history_data": [], "seed.iterable_integration_tests.user_history_data": [], "model.iterable.iterable__users": ["test.iterable.not_null_iterable__users_unique_user_key.4ca37a26c8"], "model.iterable.iterable__list_user_history": [], "model.iterable.iterable__events": ["model.iterable.iterable__user_campaign", "test.iterable.not_null_iterable__events_event_id.ed1d28a650"], "model.iterable.iterable__user_campaign": ["model.iterable.int_iterable__campaign_event_metrics", "model.iterable.int_iterable__journey_event_metrics", "model.iterable.int_iterable__user_event_metrics"], "model.iterable.iterable__user_unsubscriptions": ["test.iterable.not_null_iterable__user_unsubscriptions_unique_user_key.f8db72932b"], "model.iterable.iterable__journeys": ["test.iterable.not_null_iterable__journeys_journey_id.b5c6b8783a", "test.iterable.unique_iterable__journeys_unique_journey_id.ba86841246"], "model.iterable.iterable__campaigns": ["test.iterable.not_null_iterable__campaigns_campaign_id.03c9448919"], "model.iterable.int_iterable__campaign_labels": ["model.iterable.iterable__campaigns"], "model.iterable.int_iterable__journey_event_metrics": ["model.iterable.iterable__journeys"], "model.iterable.int_iterable__list_user_unnest": ["model.iterable.iterable__list_user_history", "model.iterable.iterable__users"], "model.iterable.int_iterable__latest_template": ["model.iterable.iterable__campaigns", "model.iterable.iterable__events"], "model.iterable.int_iterable__campaign_event_metrics": ["model.iterable.iterable__campaigns"], "model.iterable.int_iterable__campaign_lists": ["model.iterable.iterable__campaigns"], "model.iterable.int_iterable__recurring_campaigns": ["model.iterable.int_iterable__journey_event_metrics", "model.iterable.iterable__campaigns", "model.iterable.iterable__events"], "model.iterable.int_iterable__list_user_history": ["model.iterable.int_iterable__list_user_unnest"], "model.iterable.int_iterable__message_type_channel": ["model.iterable.int_iterable__latest_template", "model.iterable.iterable__events", "model.iterable.iterable__user_unsubscriptions"], "model.iterable.int_iterable__user_event_metrics": ["model.iterable.iterable__users"], "model.iterable.int_iterable__latest_user": ["model.iterable.iterable__events"], "model.iterable.int_iterable__latest_campaign": ["model.iterable.int_iterable__recurring_campaigns"], "model.iterable.stg_iterable__message_type": ["model.iterable.int_iterable__message_type_channel", "test.iterable.not_null_stg_iterable__message_type_message_type_id.75eaa6fa62"], "model.iterable.stg_iterable__event": ["model.iterable.iterable__events", "test.iterable.not_null_stg_iterable__event_event_id.370cd4bc9d", "test.iterable.not_null_stg_iterable__event_unique_event_id.e2b46d3bb6"], "model.iterable.stg_iterable__user_unsubscribed_channel": ["model.iterable.iterable__user_unsubscriptions", "test.iterable.not_null_stg_iterable__user_unsubscribed_channel_channel_id.da0ed9e9be"], "model.iterable.stg_iterable__campaign_history": ["model.iterable.int_iterable__latest_campaign", "test.iterable.not_null_stg_iterable__campaign_history_campaign_id.b7c36e4525"], "model.iterable.stg_iterable__campaign_label_history": ["model.iterable.int_iterable__campaign_labels", "test.iterable.not_null_stg_iterable__campaign_label_history_campaign_id.1918cef89a"], "model.iterable.stg_iterable__template_history": ["model.iterable.int_iterable__latest_template", "test.iterable.not_null_stg_iterable__template_history_template_id.14b24a1dfe"], "model.iterable.stg_iterable__journey": ["model.iterable.iterable__campaigns", "model.iterable.iterable__journeys", "test.iterable.not_null_stg_iterable__journey_journey_id.cc38bd633c"], "model.iterable.stg_iterable__user_history": ["model.iterable.int_iterable__latest_user", "model.iterable.int_iterable__list_user_history", "test.iterable.not_null_stg_iterable__user_history_unique_user_key.2845af2127"], "model.iterable.stg_iterable__user_unsub_message_type": ["model.iterable.iterable__user_unsubscriptions", "test.iterable.not_null_stg_iterable__user_unsub_message_type_message_type_id.268a89ea6f"], "model.iterable.stg_iterable__list": ["model.iterable.iterable__list_user_history", "test.iterable.not_null_stg_iterable__list_list_id.47029d839a"], "model.iterable.stg_iterable__list_user": ["model.iterable.iterable__list_user_history", "model.iterable.iterable__users", "test.iterable.not_null_stg_iterable__list_user__fivetran_user_id.cca4b34c07"], "model.iterable.stg_iterable__campaign_suppression_list_history": ["model.iterable.int_iterable__campaign_lists", "test.iterable.not_null_stg_iterable__campaign_suppression_list_history_campaign_id.3921289710"], "model.iterable.stg_iterable__event_extension": ["model.iterable.iterable__events", "test.iterable.not_null_stg_iterable__event_extension_event_id.144dedcd30"], "model.iterable.stg_iterable__campaign_list_history": ["model.iterable.int_iterable__campaign_lists", "test.iterable.not_null_stg_iterable__campaign_list_history_campaign_id.208f9bf9ed"], "model.iterable.stg_iterable__channel": ["model.iterable.int_iterable__message_type_channel", "test.iterable.not_null_stg_iterable__channel_channel_id.182ceb9636"], "model.iterable.stg_iterable__message_type_tmp": ["model.iterable.stg_iterable__message_type"], "model.iterable.stg_iterable__event_extension_tmp": ["model.iterable.stg_iterable__event_extension"], "model.iterable.stg_iterable__user_unsub_message_type_tmp": ["model.iterable.stg_iterable__user_unsub_message_type"], "model.iterable.stg_iterable__campaign_list_history_tmp": ["model.iterable.stg_iterable__campaign_list_history"], "model.iterable.stg_iterable__list_user_tmp": ["model.iterable.stg_iterable__list_user"], "model.iterable.stg_iterable__user_history_tmp": ["model.iterable.stg_iterable__user_history"], "model.iterable.stg_iterable__campaign_history_tmp": ["model.iterable.stg_iterable__campaign_history"], "model.iterable.stg_iterable__template_history_tmp": ["model.iterable.stg_iterable__template_history"], "model.iterable.stg_iterable__event_tmp": ["model.iterable.stg_iterable__event"], "model.iterable.stg_iterable__journey_tmp": ["model.iterable.stg_iterable__journey"], "model.iterable.stg_iterable__campaign_suppression_list_history_tmp": ["model.iterable.stg_iterable__campaign_suppression_list_history"], "model.iterable.stg_iterable__campaign_label_history_tmp": ["model.iterable.stg_iterable__campaign_label_history"], "model.iterable.stg_iterable__list_tmp": ["model.iterable.stg_iterable__list"], "model.iterable.stg_iterable__channel_tmp": ["model.iterable.stg_iterable__channel"], "model.iterable.stg_iterable__user_unsubscribed_channel_tmp": ["model.iterable.stg_iterable__user_unsubscribed_channel"], "test.iterable.not_null_iterable__campaigns_campaign_id.03c9448919": [], "test.iterable.not_null_iterable__events_event_id.ed1d28a650": [], "test.iterable.not_null_iterable__journeys_journey_id.b5c6b8783a": [], "test.iterable.unique_iterable__journeys_unique_journey_id.ba86841246": [], "test.iterable.not_null_iterable__user_unsubscriptions_unique_user_key.f8db72932b": [], "test.iterable.not_null_iterable__users_unique_user_key.4ca37a26c8": [], "test.iterable.not_null_stg_iterable__campaign_history_campaign_id.b7c36e4525": [], "test.iterable.not_null_stg_iterable__campaign_label_history_campaign_id.1918cef89a": [], "test.iterable.not_null_stg_iterable__campaign_list_history_campaign_id.208f9bf9ed": [], "test.iterable.not_null_stg_iterable__campaign_suppression_list_history_campaign_id.3921289710": [], "test.iterable.not_null_stg_iterable__channel_channel_id.182ceb9636": [], "test.iterable.not_null_stg_iterable__event_event_id.370cd4bc9d": [], "test.iterable.not_null_stg_iterable__event_unique_event_id.e2b46d3bb6": [], "test.iterable.not_null_stg_iterable__event_extension_event_id.144dedcd30": [], "test.iterable.not_null_stg_iterable__journey_journey_id.cc38bd633c": [], "test.iterable.not_null_stg_iterable__list_list_id.47029d839a": [], "test.iterable.not_null_stg_iterable__message_type_message_type_id.75eaa6fa62": [], "test.iterable.not_null_stg_iterable__template_history_template_id.14b24a1dfe": [], "test.iterable.not_null_stg_iterable__list_user__fivetran_user_id.cca4b34c07": [], "test.iterable.not_null_stg_iterable__user_history_unique_user_key.2845af2127": [], "test.iterable.not_null_stg_iterable__user_unsubscribed_channel_channel_id.da0ed9e9be": [], "test.iterable.not_null_stg_iterable__user_unsub_message_type_message_type_id.268a89ea6f": [], "source.iterable.iterable.campaign_history": ["model.iterable.stg_iterable__campaign_history_tmp"], "source.iterable.iterable.campaign_label_history": ["model.iterable.stg_iterable__campaign_label_history_tmp"], "source.iterable.iterable.campaign_list_history": ["model.iterable.stg_iterable__campaign_list_history_tmp"], "source.iterable.iterable.campaign_suppression_list_history": ["model.iterable.stg_iterable__campaign_suppression_list_history_tmp"], "source.iterable.iterable.channel": ["model.iterable.stg_iterable__channel_tmp"], "source.iterable.iterable.event": ["model.iterable.stg_iterable__event_tmp"], "source.iterable.iterable.event_extension": ["model.iterable.stg_iterable__event_extension_tmp"], "source.iterable.iterable.journey": ["model.iterable.stg_iterable__journey_tmp"], "source.iterable.iterable.list": ["model.iterable.stg_iterable__list_tmp"], "source.iterable.iterable.message_type": ["model.iterable.stg_iterable__message_type_tmp"], "source.iterable.iterable.template_history": ["model.iterable.stg_iterable__template_history_tmp"], "source.iterable.iterable.user_history": ["model.iterable.stg_iterable__user_history_tmp"], "source.iterable.iterable.user_unsubscribed_channel": [], "source.iterable.iterable.user_unsubscribed_message_type": [], "source.iterable.iterable.user_unsubscribed_channel_history": ["model.iterable.stg_iterable__user_unsubscribed_channel_tmp"], "source.iterable.iterable.user_unsubscribed_message_type_history": ["model.iterable.stg_iterable__user_unsub_message_type_tmp"], "source.iterable.iterable.list_user": ["model.iterable.stg_iterable__list_user_tmp"]}, "group_map": {}, "saved_queries": {}, "semantic_models": {}, "unit_tests": {}, "functions": {}} \ No newline at end of file